"use strict";(globalThis.webpackChunknotion_next=globalThis.webpackChunknotion_next||[]).push([[32252],{221797:(e,t,n)=>{n.d(t,{Sw:()=>C,Tr:()=>D,Vm:()=>I,b4:()=>T,rz:()=>x,te:()=>R});n(667294);var o=n(709291),r=n(531701),i=n(653965),a=n(250906),s=n(496802),l=n(498724),c=n(210228),d=n(541216),u=n(672495),p=n(119037),m=n(880025),g=n(551783),f=n(165598),h=n(873153),v=n(829281),y=n(385555),b=n(152689),_=n(206258),S=n(62967),k=n(785893);const w=(0,o.defineMessages)({lastUsedHighlightTitle:{id:"action.lastUsedHighlight.title",defaultMessage:"Last used"},lastUsedHighlightKeywords:{id:"action.lastUsedHighlight.fuzzySearchKeywords",defaultMessage:"Color last used"},highlightName:{id:"action.highlight.name",defaultMessage:"Highlight"}}),x=(0,S.$J)({key:"text color actions",title:S.RE.colorSection,render:e=>(0,k.jsx)(u.Z,{...e}),actions:r.CY.map((e=>P(e)))}),I=(0,S.$J)({key:"background color actions",title:S.RE.backgroundSection,overrideSearchTitle:S.RE.backgroundSectionKeywords,render:e=>(0,k.jsx)(u.Z,{...e}),actions:[...r._K.map((e=>P(e)))]}),C=(0,S.$J)({key:"background color selection actions",title:S.RE.backgroundSection,overrideSearchTitle:S.RE.backgroundSectionKeywords,render:e=>(0,k.jsx)(u.Z,{...e}),actions:[...r._K.map((e=>A(e)))]}),T=(0,S.$J)({key:"text color selection actions",title:S.RE.colorSection,render:e=>(0,k.jsx)(u.Z,{...e}),actions:r.CY.map((e=>A(e)))});function M(){return[p.J5S,p.ffD(p.OPg),h.c,p.YBx,p.ffD(p.O4s),p.Vc5]}function P(e,t,n){const o=n||(0,m.qf)(e),a=(0,S.cN)({key:`color ${t||e}`,displayName:o,analyticsName:o.defaultMessage,analyticsActionType:"change_block_color",fuzzySearchKeywords:(0,S.CJ)(e),validators:M(),action:t=>{let{blocks:n,environment:o}=t;b.Z.setHighlightColor(e),c.createAndCommit({userAction:"actionRegistry.createBlockColorAction",environment:o,perform:t=>{if(1===n.length){const e=n[0].getParentStore();if(e instanceof _.G&&e.isCalloutV2()){e.getContentIds()[0]===n[0].id&&(n=[e])}}(0,r.jS)(e)||(l.QE({environment:o,annotationKey:"hb",blocks:n,transaction:t}),l.QE({environment:o,annotationKey:"hf",blocks:n,transaction:t}),s.FH({stores:i.VS(n,(e=>(0,f.MI)({blockStore:e,transclusionReferences:"omit",childPages:"omit"}))),update:{block_color:void 0},transaction:t})),s.FH({stores:n,update:{block_color:e},transaction:t})}})},closeParentMenu:!0,render:(t,n)=>{let{blocks:o}=n;return(0,k.jsx)(d.Z,{...t,color:e,overrideDisplayName:a.displayName,selected:e===(o.length>0?o[0].getFormat().block_color:"default")})},nativeImageReference:n=>{let{environment:o}=n;return(0,S.q7)(o,e,t)}});return a}function A(e,t,n){const o=n||(0,m.qf)(e),r=(0,S.cN)({key:`color ${t||e}`,displayName:o,analyticsName:o.defaultMessage,fuzzySearchKeywords:(0,S.CJ)(e),validators:M(),action:async t=>{let{blocks:n,environment:o}=t;var r;g.y6(o)&&await(null===(r=o.NativeMobileActionBarStore)||void 0===r?void 0:r.clearNativeActionMenuAndRestoreSelectionIfNecessary());y.default.checkGate({gateName:"get_all_highlight_annotations"})||(l.mX({environment:o,annotationKey:"hb"}),l.mX({environment:o,annotationKey:"hf"})),b.Z.setHighlightColor(e),l.aS({environment:o,annotation:["h",b.Z.state.color]}),a.mt(o,{action:"h",color:b.Z.state.color})},closeParentMenu:!0,render:t=>(0,k.jsx)(d.Z,{...t,color:e,overrideDisplayName:r.displayName}),nativeImageReference:n=>{let{environment:o}=n;return(0,S.q7)(o,e,t)}});return r}const R=(0,S.$J)({key:"toggle last highlight",title:w.lastUsedHighlightTitle,overrideSearchTitle:w.lastUsedHighlightKeywords,render:e=>(0,k.jsx)(u.Z,{...e}),actions:[(0,S.cs)({key:"toggle highlight action",displayName:w.highlightName,analyticsName:w.highlightName.defaultMessage,validators:M(),shortcuts:["toggleHighlight"],closeParentMenu:!0,action:e=>{let{environment:t,blocks:n}=e;const o=b.Z.state.color;c.createAndCommit({userAction:"actionRegistry.toggleLastUsedHighlight",environment:t,perform:e=>{const t=i.yW(n.map((e=>{const t=e.getFormat();return t&&t.block_color===o})))?void 0:o;s.FH({stores:n,update:{block_color:t},transaction:e})}})},render:e=>{const t=b.Z.state.color;return(0,k.jsx)(d.Z,{...e,color:t,shortcuts:["toggleHighlight"]})}})]}),D=(0,S.MV)({key:"color section",displayName:S.RE.colorName,analyticsName:S.RE.colorName.defaultMessage,svg:v.U,validators:M(),subActions:()=>[R,x,I]})},560987:(e,t,n)=>{n.d(t,{Bt:()=>E,VJ:()=>B,UI:()=>D});var o=n(541432),r=n(709291),i=n(988150),a=n(554564),s=n(311712),l=n(171728),c=n(627153),d=n(938530),u=n(433929),p=n(58202),m=n(948514);var g=n(398740),f=n(808549),h=n(119037),v=n(268056),y=n(165598),b=n(489086),_=n(873153),S=n(646124),k=(n(667294),n(745238)),w=n(785893);const x=(0,k.IU)("alt",{viewBox:"0 0 16 16",svg:(0,w.jsx)("path",{d:"M13.367 11.659c-.427 0-.678-.26-.678-.706v-4.74h-1.34c-.367 0-.615-.211-.615-.561 0-.351.243-.562.616-.562h4.04c.368 0 .61.211.61.562 0 .35-.247.561-.61.561h-1.344v4.74c0 .445-.252.706-.679.706zm-5.896-.085c-.426 0-.678-.261-.678-.71V5.71c0-.45.252-.71.678-.71.427 0 .679.26.679.71v4.74h2.3c.369 0 .616.212.616.562 0 .35-.243.562-.616.562H7.471zm-6.784.085c-.422 0-.687-.247-.687-.638 0-.112.031-.265.09-.431l1.77-4.822C2.05 5.243 2.368 5 2.88 5c.53 0 .845.234 1.038.764l1.78 4.826c.062.175.085.296.085.43 0 .374-.283.639-.679.639-.382 0-.584-.175-.705-.598l-.342-1.024h-2.34l-.342 1.01c-.126.432-.328.612-.688.612zm1.326-2.674h1.73L2.885 6.33h-.032l-.84 2.655z"})});var I=n(886760),C=n(414726),T=n(799826),M=n(358299),P=n(924666),A=n(62967);const R=(0,r.defineMessages)({commentName:{id:"action.comment.name",defaultMessage:"Comment"},captionName:{id:"action.caption.name",defaultMessage:"Caption"},altTextName:{id:"action.altText.name",defaultMessage:"Alt text"},reactName:{id:"action.react.name",defaultMessage:"React"}}),D=(0,A.cs)({key:"comment",displayName:R.commentName,analyticsName:R.commentName.defaultMessage,svg:T.s,hideFromSlashActionMenu:!0,validators:[f.c_],shortcuts:["comment"],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;const r=t[0],i=null==r?void 0:r.getModel();if(r){const e="editing"===P.default.state.mode&&P.default.state.multiSelection;if(e&&!(0,v.iG)(e)&&(e.start.store.id===r.id||null!=i&&i.isType("table")&&"properties"===e.start.store.path[0]&&e.start.store.path[1]&&(r.getFormatStore().getKeyStore("table_block_column_order").getValue()??[]).includes(String(e.start.store.path[1]))))l.WD({environment:n,blockStore:r,multiSelection:e});else if(r.isDefined()&&null!=i&&i.isType(o.eh)){const e=r.getTitleStore(),t=e&&(0,b.x0)(e);if(e&&t&&t.endIndex>0){const o={startIndex:0,endIndex:t.endIndex};l.WD({environment:n,blockStore:r,multiSelection:(0,v.TD)({store:e,selection:o}),rect:p.R.getRect(r)})}}else if(r.getAssociatedCollectionStore()){var s;const e=y.Xp(r,{recursivelyLoadAllDiscussions:!1}),t=M.Z.findBlockPropertyValue(r,"title"),o=null==t||null===(s=t.getNode())||void 0===s?void 0:s.getBoundingClientRect();e>0?a.Ib({environment:n,blockStore:r,shouldFocusDiscussion:!0,analyticsFrom:"db_page_comments",rect:o,recursivelyLoadAllDiscussions:!1}):(0,g.y)({environment:n,blockStore:r,rect:o})}else(0,g.y)({environment:n,blockStore:r})}}}),B=(0,A.cs)({key:"caption",displayName:R.captionName,analyticsName:R.captionName.defaultMessage,svg:I.o,validators:[h.J5S,h.ffD(h.OPg),h.U7o,h.W2t,h.or([h.l$5("source"),h.l$5("link"),h.P99("code")])],shortcuts:["caption"],closeParentMenu:!0,action:e=>s.VJ(e)}),E=(0,A.cN)({key:"alt text",displayName:R.altTextName,analyticsName:R.altTextName.defaultMessage,svg:x,validators:[h.U7o,h.P99(o.Ti.image),h.l$5("source"),h.or([h.l$5("alt_text"),h.xDy([h.J5S,h.ffD(h.OPg)])])],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;if(t.length>0)return i.b({blockStore:t[0],entrypoint:"block_menu",environment:n})}});(0,A.cs)({key:"react",displayName:R.reactName,analyticsName:R.reactName.defaultMessage,svg:C.V,validators:[h.J5S,h.ffD(h.OPg),_.c,h.ffD(h.DFt),f.VS,h.or([h.U7o,S.K]),h.ffD(h.OXD),h.QLY("block_reactions")],shortcuts:["react"],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;const r=t[0],i=null==r?void 0:r.getModel();if(r){const e="editing"===P.default.state.mode&&P.default.state.multiSelection;if(e&&!(0,v.iG)(e)&&(e.start.store.id===r.id||null!=i&&i.isType("table")&&"properties"===e.start.store.path[0]&&e.start.store.path[1]&&(r.getFormatStore().getKeyStore("table_block_column_order").getValue()??[]).includes(String(e.start.store.path[1]))))l.Bf({environment:n,blockStore:r,multiSelection:e});else if(r.isDefined()&&null!=i&&i.isType(o.eh)){const e=r.getTitleStore(),t=e&&(0,b.x0)(e);if(e&&t&&t.endIndex>0){const o={startIndex:0,endIndex:t.endIndex};l.Bf({environment:n,blockStore:r,multiSelection:(0,v.TD)({store:e,selection:o}),rect:p.R.getRect(r)})}}else!function(e){const{environment:t,blockStore:n}=e,o=p.R.getRect(n);if(!o)return;const r=o.width,i=o.height,a=o.right-r;m.Z.setState({open:!0,rect:new DOMRect(a,o.top,r,i),type:"block",content:"reaction",blockStore:n,blockId:n.id,emoji:void 0}),c.$(t,{originGap:4,originRect:o,popupWidth:d.FZ,popupHeight:d.kX,isSmallWidth:!1,title:u.default.formatMessage(l.sY.emojiPicker),currentTab:"emoji",onCancel:()=>m.Z.reset(),tabs:[{type:"emoji",title:u.default.formatMessage(l.sY.emojiTitle),hideRandomButton:!0,onChange:e=>{const n=m.Z.state;n.open&&"reaction"===n.content&&(m.Z.setState({...n,emoji:e}),(0,l.Dc)(t),c.Z())}}]})}({environment:n,blockStore:r})}}})},547801:(e,t,n)=>{n.d(t,{Pz:()=>c,fF:()=>a,vE:()=>s,vW:()=>d});var o=n(119037),r=n(120315),i=n(521273);const a=[function(e){return(0,r.GD)(e.publicEditMode)},o.J5S,o.ffD(o.ypk)],s=[...a,o.ffD(o.OPg),o.ffD(o.OXD)];function l(e){return!i.Z.isAssistantInWriterEnabled()}const c=[...s,l],d=[...s,e=>!l()]},113493:(e,t,n)=>{n.d(t,{NY:()=>f,OY:()=>h});n(667294);var o=n(709291),r=n(9353),i=n(168866),a=n(119037),s=n(895083),l=n(521273),c=n(547801),d=n(62967),u=n(785893);const p=[...c.vE,e=>{const{blocks:t}=e;return t.some((e=>{const t=e.getType();return void 0!==t&&(!!(l.Z.isAttachmentUploadEnabledForUser()||"pdf"!==t&&"file"!==t&&"image"!==t)&&s.d[t])}))}],m=[...c.vE,e=>l.Z.isXMLAssistantEnabled()],g=(0,o.defineMessages)({blockSelectionCompletionName:{id:"action.blockSelectionCompletionName.name",defaultMessage:"Ask AI"},pageCompletionName:{id:"action.pageCompletionName.name",defaultMessage:"Notion AI"},executeFillAiSectionName:{id:"action.executeAiSection.name",defaultMessage:"Fill with AI"},editAiSectionName:{id:"action.editAiSection.name",defaultMessage:"Edit AI autofill"}}),f=(0,d.cs)({key:"block selection completion",displayName:g.blockSelectionCompletionName,analyticsName:g.blockSelectionCompletionName.defaultMessage,svg:e=>(0,u.jsx)(r.dX,{}),shortcuts:["commandJ"],validators:p,hideFromSlashActionMenu:!0,closeParentMenu:!0,action:async(e,t)=>{const{environment:o,blocks:r}=e,i=await Promise.resolve().then(n.bind(n,81598)),a=await i.assistantDependency.load();if(a.assistantActions.isSelectionValidAttachmentSelection(r))return void a.assistantActions.initializeSessionFromAttachmentBlockSelection({environment:o,selectedAttachmentStore:r[0]});const{aiDependency:s}=await Promise.resolve().then(n.bind(n,772899));(await s.load()).completionInitialPromptActions.toggleInitialPrompt({from:"block_action_menu",environment:o})}}),h=((0,d.cN)({key:"page completion",displayName:g.pageCompletionName,analyticsName:g.pageCompletionName.defaultMessage,svg:e=>(0,u.jsx)("img",{style:{borderRadius:"100%",background:"white",border:"1px solid rgba(0, 0, 0, 0.09)",...e,width:"22px",height:"22px",marginLeft:"-3px",marginRight:"-3px",overflowX:"visible"},src:i}),validators:m,closeParentMenu:!0,action:async(e,t)=>{const{environment:o}=e,{assistantDependency:r}=await Promise.resolve().then(n.bind(n,81598));(await r.load()).assistantMenuActions.openAssistantRightHandSideMenu({environment:o,from:"sidebar"})}}),(0,d.cs)({key:"ai prompt menu",analyticsName:"ai_prompt_menu",displayName:void 0,validators:[...c.vE,a.FSO],shortcuts:["commandJ"],closeParentMenu:!0,action:async e=>{let{environment:t}=e;const{aiDependency:o}=await Promise.resolve().then(n.bind(n,772899));(await o.load()).completionInitialPromptActions.toggleInitialPrompt({from:"keyboard_shortcut",environment:t})}}))},482763:(e,t,n)=>{n.d(t,{C8:()=>u,Hs:()=>d,Kk:()=>c});var o=n(448948),r=n(800893),i=n(119037),a=n(349434),s=n(975463),l=n(62967);const c=(0,l.cN)({key:"copy link to page",displayName:l.RE.copyLinkNavigableTypeName,analyticsName:l.RE.copyLinkNavigableTypeName.defaultMessage,svg:a.N,validators:[i.jlf,i.U7o,i.DFt,i.ffD(i.q4$),i.ffD(i.uY7)],closeParentMenu:!0,action:(e,t)=>{r.Hs({...e,event:t})}}),d=(0,l.cs)({key:"copy link to block",displayName:l.RE.copyLinkName,analyticsName:l.RE.copyLinkName.defaultMessage,svg:a.N,shortcuts:["copyLinkToBlock"],validators:[i.jlf,i.U7o,i.ffD(i.DFt),i.ffD(i.q4$)],closeParentMenu:!0,action:(e,t)=>{r.Hs({...e,event:t})}}),u=(0,l.cN)({key:"convert to link mention",displayName:l.RE.convertToLinkMentionName,analyticsName:l.RE.convertToLinkMentionName.defaultMessage,svg:s.z,validators:[i.jlf,i.U7o,i.rol("bookmark")],closeParentMenu:!0,action:(e,t)=>{o.$$({...e,event:t})}})},135067:(e,t,n)=>{n.d(t,{G:()=>u});n(667294);var o=n(541432),r=n(709291),i=n(311712),a=n(693405),s=n(119037),l=n(560682),c=n(62967),d=n(785893);const u=(0,c.cs)({key:"delete block",displayName:c.RE.deleteName,analyticsName:c.RE.deleteName.defaultMessage,svg:l.y,validators:[s.or([s.xDy([s.lA5,s.MaU]),s.xDy([s.or([s.eot,s.EWv]),s.ffD(s.sRS)])]),s.or([s.J5S,s.EWv]),s.ffD(s.xDy([s.DFt,s.EWv])),s.ffD(s.OPg),s.ffD(s.Vfv),s.ffD(s.OOv),s.ffD(s.P99(o.Ti.externalObjectInstancePage)),s.ffD(s.Q_M),s.vdd],shortcuts:["delete","backspace"],closeParentMenu:!0,render:e=>(0,d.jsx)(a.Z,{...e,isRed:!0,svg:l.y,title:(0,d.jsx)(r.FormattedMessage,{...c.RE.deleteName}),shortcut:"delete"}),action:async e=>{let{blocks:t,environment:n}=e;await i.Qw({environment:n,blocks:t,shouldCheckSuggestEdit:!0})}})},593685:(e,t,n)=>{n.d(t,{gz:()=>f,j8:()=>v,NE:()=>h});n(667294);var o=n(709291),r=n(552689),i=n(296994),a=n(119037),s=n(623461),l=n(74948),c=n(68688);const d=[function(){return(0,c.d)()},a.J5S],u=[...d,a.ryx,a.Zuh,a.ffD(a.OPg)];var p=n(62967),m=n(785893);const g=(0,o.defineMessages)({dictateName:{id:"action.dictate.name",defaultMessage:"Dictate"}}),f=(0,p.cs)({key:"dictate",displayName:g.dictateName,analyticsName:g.dictateName.defaultMessage,svg:s.q,validators:[...u,a.ffD(a.Fxc)],shortcuts:["dictate"],badge:(0,m.jsx)(r.Z,{}),closeParentMenu:!0,action:async(e,t)=>{const{environment:n}=e,o=t instanceof KeyboardEvent&&"Enter"!==t.key,{dictationActions:r}=await i.FF.dictation.load();r.smartToggleDictation({environment:n,from:o?"shortcut":"topbar_menu"})}}),h=(0,p.cs)({key:"newPageAndDictate",analyticsName:"New page and dictate",displayName:void 0,validators:[a.ROK,a.jlf,...d,a.ffD(a.Fxc)],shortcuts:["newPageAndDictate"],closeParentMenu:!0,action:async(e,t)=>{const{environment:n}=e,o=t instanceof KeyboardEvent&&"Enter"!==t.key?"new_page_and_dictate_shortcut":"new_page_and_dictate_action",r=await(0,l.quickAddPage)({environment:n,from:o});if(r){const{dictationActions:e}=await i.FF.dictation.load();e.startDictation({environment:n,from:o,pageBlock:r})}}}),v=(0,p.cs)({key:"dictate",displayName:g.dictateName,analyticsName:g.dictateName.defaultMessage,svg:s.q,validators:[...u,a.j61,a.ffD(a.Fxc)],shortcuts:["dictate"],closeParentMenu:!0,badge:(0,m.jsx)(r.Z,{}),action:async(e,t)=>{const{environment:n}=e,{dictationActions:o}=await i.FF.dictation.load();o.startDictation({environment:n,from:"block_action"})}})},129768:(e,t,n)=>{n.d(t,{MI:()=>S,UO:()=>h,fI:()=>_,m7:()=>v,nh:()=>y,o1:()=>g,vh:()=>f});n(667294);var o=n(403297),r=n(311712),i=n(672495),a=n(27105),s=n(119037),l=n(454230),c=n(80444),d=n(385555),u=n(897630),p=n(62967),m=n(785893);const g=(0,p.cs)({key:"duplicate",displayName:p.RE.duplicateName,analyticsName:p.RE.duplicateName.defaultMessage,svg:l.a,validators:[s.MaU,s.ffD(s.sRS),s.ffD(s.cWe),s.ffD(s.Q_M),s.or([s.O4s,s.ffD(s.OPg)]),s.or([s.ffD(s.plk),s.f7f]),...p.kv],shortcuts:["duplicate"],closeParentMenu:!0,action:async(e,t)=>{let{blocks:n,environment:o}=e;await r.nG({environment:o,blocks:n,event:t})}}),f=(0,p.MV)({key:"duplicateCollection",displayName:p.RE.duplicateName,analyticsName:p.RE.duplicateName.defaultMessage,svg:l.a,width:275,validators:[s.MaU,s.ffD(s.sRS),s.ffD(s.cWe),s.or([s.O4s,s.ffD(s.OPg)]),s.xDy([s.plk,s.ffD(s.f7f)]),s.ffD(s.Jtb),...p.kv],subActions:()=>[{key:"collection duplication options",render:e=>(0,m.jsx)(i.Z,{...e}),actions:h.actions}]}),h=(0,p.$J)({key:"duplicate collection actions",title:p.RE.duplicateName,render:e=>(0,m.jsx)(i.Z,{...e}),actions:[(0,p.cs)({key:"duplicate with data",displayName:p.RE.duplicateCollectionWithDataName,analyticsName:"",validators:[s.ffD(s.Q_M),s.ffD(s.tls)],shortcuts:["duplicate"],closeParentMenu:!0,action:async(e,t)=>{let{blocks:n,environment:o}=e;await r.nG({environment:o,blocks:n,duplicateOnlyCollectionSchema:!1,event:t}),d.default.logEvent("duplicate_collection","true")}}),(0,p.cs)({key:"duplicate schema only",displayName:p.RE.duplicateCollectionSchemaOnlyName,analyticsName:"",validators:[s.ffD(s.tls)],shortcuts:["duplicateSchema"],closeParentMenu:!0,action:async(e,t)=>{let{blocks:n,environment:o}=e;await r.nG({environment:o,blocks:n,duplicateOnlyCollectionSchema:!0,event:t}),d.default.logEvent("duplicate_collection_schema","true")}})]}),v=(0,p.cs)({key:"duplicate",displayName:p.RE.duplicateName,analyticsName:p.RE.duplicateName.defaultMessage,svg:l.a,validators:[s.U7o,s.KEd,s.or([s.ffD(s.xks),s.sVB]),s.or([s.ffD(s.plk),s.f7f]),...p.kv,s.ffD(s.uY7)],shortcuts:["duplicate"],closeParentMenu:!0,action:(e,t)=>{let{blocks:n,environment:o}=e;w(n,o,{event:t})}}),y=(0,p.MV)({key:"duplicateCollection",displayName:p.RE.duplicateName,analyticsName:p.RE.duplicateName.defaultMessage,svg:l.a,width:275,validators:[s.U7o,s.KEd,s.ffD(s.xks),s.ffD(s.Jtb),s.xDy([s.plk,s.ffD(s.f7f)]),...p.kv],subActions:()=>[{key:"collection duplication options",render:e=>(0,m.jsx)(i.Z,{...e}),actions:b.actions}]}),b=(0,p.$J)({key:"duplicate collection actions",title:p.RE.duplicateName,render:e=>(0,m.jsx)(i.Z,{...e}),actions:[(0,p.cs)({key:"duplicate with data",displayName:p.RE.duplicateCollectionWithDataName,analyticsName:"",validators:[s.ffD(s.tls)],shortcuts:["duplicate"],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;w(t,n,{duplicateOnlyCollectionSchema:!1}),d.default.logEvent("duplicate_collection","true")}}),(0,p.cs)({key:"duplicate schema only",displayName:p.RE.duplicateCollectionSchemaOnlyName,analyticsName:"",validators:[s.ffD(s.tls)],shortcuts:["duplicateSchema"],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;w(t,n,{duplicateOnlyCollectionSchema:!0}),d.default.logEvent("duplicate_collection_schema","true")}})]}),_=(0,p.cN)({key:"duplicate into private",displayName:p.RE.duplicateToPrivateName,analyticsName:p.RE.duplicateToPrivateName.defaultMessage,svg:l.a,validators:[s.ffD(s.sRS),s.DFt,s.J5S,s.ffD(s.nJQ),s.or([s.cWe,s.ffD(s.KEd),s.b1c]),s.or([s.ffD(s.plk),s.f7f]),s.ffD(s.uY7)],closeParentMenu:!0,action:async(e,t)=>{let{blocks:n,environment:o}=e;await x(n,o,void 0,t)}}),S=(0,p.MV)({key:"duplicate collection to private",displayName:p.RE.duplicateToPrivateName,analyticsName:p.RE.duplicateToPrivateName.defaultMessage,svg:l.a,width:275,validators:[s.ffD(s.sRS),s.DFt,s.J5S,s.ffD(s.nJQ),s.or([s.cWe,s.ffD(s.KEd),s.b1c]),s.xDy([s.plk,s.ffD(s.f7f)]),s.ffD(s.uY7)],subActions:()=>[{key:"collection duplication options",render:e=>(0,m.jsx)(i.Z,{...e}),actions:k.actions}]}),k=(0,p.$J)({key:"duplicate collection to private actions",title:p.RE.duplicateName,render:e=>(0,m.jsx)(i.Z,{...e}),actions:[(0,p.cN)({key:"duplicate with data",displayName:p.RE.duplicateCollectionWithDataName,analyticsName:"",validators:[],closeParentMenu:!0,action:async e=>{let{blocks:t,environment:n}=e;await x(t,n,!1),d.default.logEvent("duplicate_collection","true")}}),(0,p.cN)({key:"duplicate schema only",displayName:p.RE.duplicateCollectionSchemaOnlyName,analyticsName:"",validators:[],closeParentMenu:!0,action:async e=>{let{blocks:t,environment:n}=e;await x(t,n,!0),d.default.logEvent("duplicate_collection_schema","true")}})]});function w(e,t,n){const{duplicateOnlyCollectionSchema:r,event:i}=n??{};if(!u.M_(t))return;const a=e[0].getParentStore();"block"!==(null==a?void 0:a.table)&&"team"!==(null==a?void 0:a.table)&&"space"!==(null==a?void 0:a.table)||o.VE({environment:t,store:e[0],newParentStore:a,duplicateOnlyCollectionSchema:r,event:i})}async function x(e,t,n,r){if(!u.M_(t))return;const i=e[0],s=c.default.state.currentSpaceStore,l=c.default.state.currentSpaceViewStore;s&&l&&await o.DK({environment:t,store:i,spaceStore:s,spaceViewStore:l,isPrivate:!0,context:"duplicate_to_private_space",duplicateOnlyCollectionSchema:n,useCrdt:(0,a.Sy)({event:r,source:"private",contextualDefault:i.useCrdt()})})}},62967:(e,t,n)=>{n.d(t,{$J:()=>E,CJ:()=>V,MV:()=>F,N$:()=>U,N_:()=>R,RE:()=>C,aS:()=>N,cN:()=>A,cs:()=>P,kv:()=>Z,q7:()=>O,zz:()=>T});n(252262),n(324506),n(667294);var o=n(541432),r=n(709291),i=n(531701),a=n(401898),s=n(210228),l=n(940663),c=n(693405),d=n(748019),u=n(552275),p=n(478140),m=n(840721),g=n(886825),f=n(526388),h=n(842782),v=n(95477),y=n(119037),b=n(847853),_=n(433929),S=n(460709),k=n(98742),w=n(825464),x=n(905162),I=n(785893);const C=(0,r.defineMessages)({deleteName:{id:"action.delete.name",defaultMessage:"Delete"},moveToTrashName:{id:"action.moveToTrash.name",defaultMessage:"Move to Trash"},undoName:{id:"action.undo.name",defaultMessage:"Undo"},redoName:{id:"action.redo.name",defaultMessage:"Redo"},duplicateName:{id:"action.duplicate.name",defaultMessage:"Duplicate"},duplicateToPrivateName:{id:"action.duplicateToPrivate.name",defaultMessage:"Duplicate to Private"},turnIntoName:{id:"action.turnInto.name",defaultMessage:"Turn into"},copyLinkName:{id:"action.copyLink.name",defaultMessage:"Copy link to block"},copyLinkNavigableTypeName:{id:"action.copyLinkNavigableType.name",defaultMessage:"Copy link"},showCodePreviewFormat:{id:"action.showCodePreviewFormat.name",defaultMessage:"Preview"},showOnlyCodeFormat:{id:"action.showOnlyCodeFormat.name",defaultMessage:"Code"},showSplitViewFormat:{id:"action.showSplitViewFormat.name",defaultMessage:"Split"},searchPlaceholder:{defaultMessage:"Search for a language…",id:"codeBlock.searchPrompt"},foregroundColorDefaultKeywords:{id:"action.foregroundColor.default.fuzzySearchKeyword",defaultMessage:"Default Black White"},backgroundColorDefaultKeywords:{id:"action.backgroundColor.default.fuzzySearchKeyword",defaultMessage:"Default Black White defaultbackground Defaultbackground"},foregroundColorGrayKeywords:{id:"action.foregroundColor.gray.fuzzySearchKeyword",defaultMessage:"Grey Gray"},backgroundColorGrayKeywords:{id:"action.backgroundColor.gray.fuzzySearchKeyword",defaultMessage:"Grey Gray background Greybackground Graybackground"},foregroundColorBrownKeywords:{id:"action.foregroundColor.brown.fuzzySearchKeyword",defaultMessage:"Brown"},backgroundColorBrownKeywords:{id:"action.backgroundColor.brown.fuzzySearchKeyword",defaultMessage:"Brown background Brownbackground"},foregroundColorOrangeKeywords:{id:"action.foregroundColor.orange.fuzzySearchKeyword",defaultMessage:"Orange"},backgroundColorOrangeKeywords:{id:"action.backgroundColor.orange.fuzzySearchKeyword",defaultMessage:"Orange background Orangebackground"},foregroundColorYellowKeywords:{id:"action.foregroundColor.yellow.fuzzySearchKeyword",defaultMessage:"Yellow"},backgroundColorYellowKeywords:{id:"action.backgroundColor.yellow.fuzzySearchKeyword",defaultMessage:"Yellow background Yellowbackground"},foregroundColorTealKeywords:{id:"action.foregroundColor.teal.fuzzySearchKeyword",defaultMessage:"Teal green"},backgroundColorTealKeywords:{id:"action.backgroundColor.teal.fuzzySearchKeyword",defaultMessage:"Teal green background Tealbackground Greenbackground"},foregroundColorBlueKeywords:{id:"action.foregroundColor.blue.fuzzySearchKeyword",defaultMessage:"Blue"},backgroundColorBlueKeywords:{id:"action.backgroundColor.blue.fuzzySearchKeyword",defaultMessage:"Blue background Bluebackground"},foregroundColorPurpleKeywords:{id:"action.foregroundColor.purple.fuzzySearchKeyword",defaultMessage:"Purple"},backgroundColorPurpleKeywords:{id:"action.backgroundColor.purple.fuzzySearchKeyword",defaultMessage:"Purple background Purplebackground"},foregroundColorPinkKeywords:{id:"action.foregroundColor.pink.fuzzySearchKeyword",defaultMessage:"Pink"},backgroundColorPinkKeywords:{id:"action.backgroundColor.pink.fuzzySearchKeyword",defaultMessage:"Pink background Pinkbackground"},foregroundColorRedKeywords:{id:"action.foregroundColor.red.fuzzySearchKeyword",defaultMessage:"Red"},backgroundColorRedKeywords:{id:"action.backgroundColor.red.fuzzySearchKeyword",defaultMessage:"Red background Redbackground"},backgroundSectionKeywords:{id:"action.section.background.fuzzySearchKeywords",defaultMessage:"Color Background"},backgroundSection:{id:"action.section.background",defaultMessage:"Background"},colorSection:{id:"action.section.color",defaultMessage:"Color"},colorName:{id:"action.color.name",defaultMessage:"Color"},duplicateCollectionSchemaOnlyName:{id:"action.duplicateSchemaOnly.name",defaultMessage:"Duplicate without content"},duplicateCollectionWithDataName:{id:"action.duplicateWithData.name",defaultMessage:"Duplicate with content"},convertToLinkMentionName:{id:"action.convertToLinkMention.name",defaultMessage:"Turn into mention"}});function T(e){let{title:t}=e;return t}const M={maxWidth:400,whiteSpace:"pre-wrap"};function P(e){const{key:t,displayName:n,displayNameInterpolatedValues:o,contextualDisplayName:r,analyticsName:i,analyticsActionType:a,fuzzySearchKeywords:s,svg:l,svgCustomFill:c,validators:d,shortcuts:u,sortScoreMultiplier:p,closeParentMenu:m,action:g,subActions:f,collapseSubActionsIntoParent:h,nativeImageReference:v,alwaysShowInSearch:y,right:b,renderTooltip:_,userProvidedSearchName:S,hideFromSlashActionMenu:k,badge:w,clientSkill:x}=e,{formattedDisplayName:I,searchName:C}=D({displayName:n,displayNameInterpolatedValues:o,userProvidedSearchName:S,fuzzySearchKeywords:s});return{key:`action ${t}`,displayName:I,analyticsName:i,analyticsActionType:a,searchName:C,validators:d,shortcuts:u,sortScoreMultiplier:p,action:g,subActions:f,collapseSubActionsIntoParent:h,closeParentMenu:m,render:e.render??B({svg:l,svgCustomFill:c,formattedDisplayName:I,right:b,contextualDisplayName:r,shortcut:u[0],renderTooltip:_,badge:w}),nativeImageReference:v,alwaysShowInSearch:y,hideFromSlashActionMenu:k,svg:l,svgCustomFill:c,clientSkill:x}}function A(e){const{key:t,displayName:n,displayNameInterpolatedValues:o,contextualDisplayName:r,analyticsName:i,analyticsActionType:a,fuzzySearchKeywords:s,svg:l,svgCustomFill:c,validators:d,sortScoreMultiplier:u,closeParentMenu:p,action:m,subActions:g,collapseSubActionsIntoParent:f,nativeImageReference:h,alwaysShowInSearch:v,right:y,renderTooltip:b,userProvidedSearchName:_,clientSkill:S,tooltipPlacement:k,badge:w}=e,{formattedDisplayName:x,searchName:I}=D({displayName:n,displayNameInterpolatedValues:o,userProvidedSearchName:_,fuzzySearchKeywords:s}),C=e.render??B({svg:l,svgCustomFill:c,formattedDisplayName:x,right:y,contextualDisplayName:r,renderTooltip:b,tooltipPlacement:k,badge:w});return{key:(T=t,`action ${T}`),displayName:x,analyticsName:i,analyticsActionType:a,searchName:I,validators:d,sortScoreMultiplier:u,action:m,subActions:g,collapseSubActionsIntoParent:f,closeParentMenu:p,render:C,nativeImageReference:h,alwaysShowInSearch:v,svg:l,svgCustomFill:c,clientSkill:S};var T}function R(e){if("string"==typeof e)return e.split(" ").at(-1)}function D(e){const{displayName:t,displayNameInterpolatedValues:n,fuzzySearchKeywords:o,userProvidedSearchName:r}=e,i=t?_.default.formatMessage(t,n):void 0,a=o||t,s=o?_.default.formatMessage(o):i;let l=r;return l||(l=a?s===a.defaultMessage?s:`${s} ${a.defaultMessage}`:void 0),{formattedDisplayName:i,searchName:l}}function B(e){const{formattedDisplayName:t,svg:n,svgCustomFill:o,shortcut:r,right:i,renderTooltip:a,badge:s,tooltipPlacement:l=w.u.Right}=e;return function(d,u,p){const m=(e.contextualDisplayName?e.contextualDisplayName(u):void 0)||t;return(0,I.jsx)(f.Z,{render:e=>(0,I.jsx)(c.Z,{...(0,k.Z)(d,e),title:m,svg:n,svgCustomFill:o,shortcut:r,badge:s,right:"function"==typeof i?i(d,u,p):i}),renderTooltip:()=>(0,I.jsx)("div",{style:M,children:null==a?void 0:a({title:m})}),disableTooltip:!a,placement:l})}}function E(e){const{key:t,title:n,overrideSearchTitle:o,render:r,actions:i}=e,a=n?_.default.formatMessage(n):void 0,s=o||n,l=s&&_.default.formatMessage(s);return{key:t,title:a,searchTitle:s?l===s.defaultMessage?l:`${l} ${s.defaultMessage}`:void 0,render:r,actions:i}}function F(e){const{key:t,displayName:n,displayNameInterpolatedValues:o,analyticsName:r,validators:i,subActions:a,collapseSubActionsIntoParent:s,svg:l,icon:g,right:f,rightStyle:v,width:y,initialFocus:b,clientSkill:_}=e,k=A({clientSkill:_,key:`extension ${t}`,displayName:n,displayNameInterpolatedValues:o,analyticsName:r,validators:i,subActions:a,collapseSubActionsIntoParent:s,closeParentMenu:!0,action:()=>{},render:(e,t,n)=>(0,I.jsx)(h.Z,{...e,renderOrigin:(e,t)=>l?(0,I.jsx)(c.Z,{...e,title:k.displayName,svg:l,right:f,rightStyle:v,ref:t}):(0,I.jsx)(u.Z,{...e,title:k.displayName,icon:g,right:f,rightStyle:v,ref:t}),onFocus:n.onFocus,renderExtension:(e,o)=>{let r;return r=t.environment.device.isPhone?{menuType:S.og.Modal,right:(0,I.jsx)(m.DoneMenuText,{}),onClickRight:o.close,...e}:{menuType:S.og.Popup,width:y??220,...e},(0,I.jsx)(p.Z,{...r,children:(0,I.jsx)(d.Z,{initialFocus:b??0,context:t,sections:a(t),onAccept:n.onAccept})})}})});return k}const Z=[y.ffD(y.P99(o.Ti.externalObjectInstancePage)),y.ffD(y.Q_M),y.ffD(y.K5G),y.J5S,y.ffD((e=>e.blocks.some((e=>e.isDefined()&&(0,l.h7)(e))))),y.vdd];function U(e){return A({key:`format ${e.key}`,displayName:e.displayName,analyticsName:e.displayName.defaultMessage,validators:e.validators,render:(t,n,o)=>{let{blocks:r,environment:i}=n;const a=r[0],s=e.isEnabled(a),{isMobile:l}=i.device;return(0,I.jsx)(g.Z,{...t,title:e.label,icon:e.svg?(0,I.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.svg({width:l?20:17,height:l?20:17})}):void 0,badge:e.badge,on:s})},closeParentMenu:!1,action:t=>{let{environment:n,blocks:o}=t;s.createAndCommit({userAction:"actionRegistry.createToggleAction",environment:n,perform:t=>{var r;const i=o[0],a=!e.isEnabled(i);e.action(n,i,t),null===(r=e.afterAction)||void 0===r||r.call(e,a,n)}})}})}function V(e){switch(e){case"default":return C.foregroundColorDefaultKeywords;case"default_background":return C.backgroundColorDefaultKeywords;case"gray":return C.foregroundColorGrayKeywords;case"gray_background":return C.backgroundColorGrayKeywords;case"brown":return C.foregroundColorBrownKeywords;case"brown_background":return C.backgroundColorBrownKeywords;case"orange":return C.foregroundColorOrangeKeywords;case"orange_background":return C.backgroundColorOrangeKeywords;case"yellow":return C.foregroundColorYellowKeywords;case"yellow_background":return C.backgroundColorYellowKeywords;case"teal":return C.foregroundColorTealKeywords;case"teal_background":return C.backgroundColorTealKeywords;case"blue":return C.foregroundColorBlueKeywords;case"blue_background":return C.backgroundColorBlueKeywords;case"purple":return C.foregroundColorPurpleKeywords;case"purple_background":return C.backgroundColorPurpleKeywords;case"pink":return C.foregroundColorPinkKeywords;case"pink_background":return C.backgroundColorPinkKeywords;case"red":return C.foregroundColorRedKeywords;case"red_background":return C.backgroundColorRedKeywords;default:return(0,a.t1)(e)}}function N(e){const t=e.thumbnail?(0,b.D)(null==e?void 0:e.thumbnail):void 0,n=Boolean(void 0!==t&&/^https?:\/\//.test(t));return{remoteImageUrl:t?`${n?"":v.default.domainBaseUrl}${t}`:void 0,localAssetBundleImagePath:n?void 0:t}}function O(e,t,n){const o=e.device.isAndroid&&!(0,x.Y)("supportsNativeMobileDynamicActionBar")?(0,i.gh)({theme:"light"}):(0,i.gh)({theme:e.ThemeStore.state.mode}),r=(0,i.fi)(t,o);let a,s,l;const c="default_background"!==t;t.includes("background")||null!=n&&n.includes("background")?(a="background",s=c?"square.fill":"square",l="textBackgroundColor"):(a="color",s="character",l="textColor");const d=a in r?r[a]:void 0,u=d&&(0,i.J1)(d);return{sfProGlyphName:s,localImageIdentifier:l,imageTintColor:c?u:void 0}}},482494:(e,t,n)=>{n.d(t,{T:()=>c,U:()=>d});var o=n(709291),r=n(119037),i=n(349434),a=n(398115),s=n(62967);const l=(0,o.defineMessages)({addImageHyperlink:{id:"action.addImageHyperlink",defaultMessage:"Add link"},editImageHyperlink:{id:"action.editImageHyperlink",defaultMessage:"Edit link"}}),c=(0,s.cs)({key:"link image",displayName:l.addImageHyperlink,analyticsName:l.addImageHyperlink.defaultMessage,svg:i.N,validators:[r.J5S,r.U7o,r.Or$,r.QLY("image_hyperlink"),r.ffD(r.OPg),r.ffD(r.OoW)],shortcuts:["openLinkMenuOrOpenSearch"],closeParentMenu:!0,action:e=>{let{blocks:t}=e;const n=t[0];a.KB({store:n})}}),d=(0,s.cs)({key:"link image",displayName:l.editImageHyperlink,analyticsName:l.editImageHyperlink.defaultMessage,svg:i.N,validators:[r.J5S,r.U7o,r.Or$,r.QLY("image_hyperlink"),r.ffD(r.OPg),r.OoW],shortcuts:["openLinkMenuOrOpenSearch"],closeParentMenu:!0,action:e=>{let{blocks:t}=e;const n=t[0];a.KB({store:n})}})},336154:(e,t,n)=>{n.d(t,{L6:()=>Yt,aU:()=>gt,dI:()=>pt,vd:()=>Ve,Yw:()=>Ge});var o=n(427537),r=n.n(o),i=n(548317),a=n(815145),s=n(541432),l=n(421838),c=n(709291),d=n(966324),u=n(701302),p=n(27724),m=n(844886),g=n(761045),f=n(524677);var h=n(106404),v=n(800893),y=n(730188),b=n(42239),_=n(247839),S=n(536280),k=n(245990),w=n(91376),x=n(587420),I=n(452423),C=n(275754),T=n(608055),M=n(901357),P=n(587531),A=n(311712),R=n(29974),D=n(137973),B=n(522974),E=n(429373),F=n(210228),Z=n(668422),U=n(119037),V=n(721429),N=n(304708),O=n(792783),L=n(918514),j=n(195697),K=n(873153),z=n(646124),q=n(344161),H=n(349434),G=n(602499),W=n(172360),$=n(62967),Y=n(394841),Q=n(830806);const J=(0,$.cs)({key:"open home",displayName:void 0,analyticsName:"openHome",validators:[U.jlf],shortcuts:["openHome"],closeParentMenu:!0,action:async e=>{const t=e.environment,n=Y.J2("main");n&&(await n.load(),n.canRead()&&((0,Q.$X)({environment:t,from:"keyboard_shortcut"}),C._c({environment:t,store:n,pageVisitSource:a.tY.SidebarHome})))}});var X=n(823376),ee=n(457345),te=n(74948),ne=n(224646),oe=n(938676),re=n(436391),ie=n(80444),ae=n(521273),se=n(798180),le=n(985526),ce=n(188923),de=n(629026),ue=n(992083),pe=n(2679),me=n(221797),ge=n(560987),fe=n(547801),he=n(113493),ve=n(482763),ye=n(135067),be=n(593685),_e=n(129768),Se=n(482494),ke=n(388941),we=n(819588),xe=n(456606),Ie=n(206471),Ce=n(52606),Te=n(110906),Me=n(58202),Pe=n(469316),Ae=n(924666);const Re=(0,c.defineMessages)({searchName:{id:"action.search.name",defaultMessage:"Search"}}),De=(0,$.cs)({key:"search",displayName:Re.searchName,analyticsName:Re.searchName.defaultMessage,validators:[U.jlf,U.QLY("native-find-in-page"),U.or([U.NnH,U.lvA]),U.ffD(U.hrD)],shortcuts:["search"],closeParentMenu:!0,action:e=>{var t,n;const o=(0,V.np)();if(!o)return;const r=o.isCollectionView(),i=(0,Te.fm)(o),a="page"===(null==i||null===(t=i.collectionViewStore())||void 0===t?void 0:t.getType());if(r&&!a){const e=Me.R.findCollectionViewBlockFromStore(o);return void(null==e||e.collectionContextStore.searchOpenStore.setState(!0))}const{open:s,focused:l}=Pe.ZP.state,c=null===(n=window.getSelection())||void 0===n?void 0:n.toString(),d="editing"===Ae.default.state.mode?Ae.default.state:void 0;if(s){if(s&&l)return void Ce.xv({clearQuery:!1})}else Ce.bA({environment:e.environment,selectedString:c,textSelection:d})}});var Be=n(211703),Ee=n(641670),Fe=n(811732);function Ze(e){return void 0!==e.shortcuts}const Ue=(0,c.defineMessages)({enterName:{id:"action.enter.name",defaultMessage:"Enter"},syncPageName:{id:"action.syncPage.name",defaultMessage:"Save for offline"},resyncPageName:{id:"action.resyncPage.name",defaultMessage:"Refresh offline data"},unsyncPageName:{id:"action.unsyncPage.name",defaultMessage:"Remove from offline"},edit:{id:"action.edit.name",defaultMessage:"Edit"},quickFindName:{id:"action.quickFind.name",defaultMessage:"Quick find"},copyLinktoViewName:{id:"action.copyLinktoView.name",defaultMessage:"Copy link to view"},zoomInName:{id:"action.zoomIn.name",defaultMessage:"Zoom in"},zoomOutName:{id:"action.zoomOut.name",defaultMessage:"Zoom out"},resetZoomName:{id:"action.resetZoom.name",defaultMessage:"Reset zoom"},blockSelectionCompletionName:{id:"action.blockSelectionCompletionName.name",defaultMessage:"Ask AI"},copyFormattedLinkNavigableTypeName:{id:"action.copyFormattedLinkNavigableType.name",defaultMessage:"Copy linked title"},copyLinkToCurrentPageSnackBarMessage:{id:"action.copyLinkToCurrentPage.snackBarMessage",defaultMessage:"Link to current page copied to clipboard"},pasteName:{id:"action.paste.name",defaultMessage:"Paste"},moveUpName:{id:"action.moveUp.name",defaultMessage:"Move up"},moveDownName:{id:"action.moveDown.name",defaultMessage:"Move down"},propertyVisibilityLabel:{id:"action.propertyVisibility.label",defaultMessage:"Toggle property visibility"},databaseLockLabel:{id:"action.databaseLock.label",defaultMessage:"Database lock"},wrapCellsName:{id:"action.wrapAllColumns.name",defaultMessage:"Wrap all columns"},createLinkName:{id:"action.createLink.name",defaultMessage:"Add link"},createEquationName:{id:"action.createEquation.name",defaultMessage:"Mark as equation"},filterName:{id:"action.filter.name",defaultMessage:"Filter"},sortName:{id:"action.sort.name",defaultMessage:"Sort"},legacyGroupByName:{id:"action.legacyGroupBy.name",defaultMessage:"Group by"},groupByName:{id:"action.groupBy.name",defaultMessage:"Group"},subGroupByName:{id:"action.subGroupBy.name",defaultMessage:"Sub-group"},propertiesName:{id:"action.properties.name",defaultMessage:"Properties"},templatesName:{id:"action.templates.name",defaultMessage:"Templates"},calendarByName:{id:"action.calendarBy.name",defaultMessage:"Calendar by"},timelineByName:{id:"action.timelineBy.name",defaultMessage:"Timeline by"},noDateName:{id:"action.noDate.name",defaultMessage:"No date"},boldName:{id:"action.bold.name",defaultMessage:"Bold"},italicName:{id:"action.italic.name",defaultMessage:"Italic"},strikeThroughName:{id:"action.strikeThrough.name",defaultMessage:"Strike-through"},underlineName:{id:"action.underline.name",defaultMessage:"Underline"},darkModeName:{id:"action.darkMode.name",defaultMessage:"Dark mode"},openAsPageName:{id:"action.openAsPage.name",defaultMessage:"Open as page"},openAllTogglesName:{id:"action.openAllToggles.name",defaultMessage:"Open all toggles"},toggleRecordingInputLatencyName:{id:"action.toggleRecordingInputLatency.name",defaultMessage:"Toggle recording input latency"},suggestedSlashMenuSection:{id:"slashMenu.suggestedSection.title",defaultMessage:"Suggested"},more:{defaultMessage:"See more",id:"slashMenu.more.title"},toggleQnAMessage:{defaultMessage:"Toggle QnA",id:"action.toggleQnA.name"}});function Ve(e){return"key"in e}function Ne(e){return"clipboardData"in e}const Oe=[U.J5S,U.ffD(U.OPg),U.FSO];function Le(e){return(0,$.cs)({...e,validators:Oe,closeParentMenu:!0,action:t=>{let{environment:n,blocks:o}=t;F.createAndCommit({userAction:"actionRegistry.createAnnotationAction",environment:n,perform:t=>{D.P2({environment:n,blocks:o,annotation:e.annotation,transaction:t})}})}})}const je=(0,$.cs)({key:"quick find",displayName:Ue.quickFindName,analyticsName:Ue.quickFindName.defaultMessage,validators:[U.or([U.lvA,U.MpE,U.E5p]),U.ffD(U.$bF)],shortcuts:["quickFind"],closeParentMenu:!0,action:e=>{let{environment:t}=e;P.Kf({environment:t,analyticsFrom:"keyboard-shortcut"})}}),Ke=(0,$.cs)({key:"quick find (alternative)",displayName:Ue.quickFindName,analyticsName:Ue.quickFindName.defaultMessage,validators:[U.or([U.lvA,U.MpE,U.E5p]),U.ffD(U.or([U.xDy([U.DaG,z.K]),U.xDy([U.J5S,U.U7o,U.Or$,U.QLY("image_hyperlink")])])),U.ffD(U.$bF)],shortcuts:["openLinkMenuOrOpenSearch"],closeParentMenu:!0,action:e=>{let{environment:t}=e;P.Kf({environment:t,analyticsFrom:"keyboard-shortcut-command-k"})}}),ze=(0,$.cs)({key:"toggle all updates",displayName:void 0,analyticsName:"toggleAllUpdates",validators:[U.jlf],shortcuts:["toggleAllUpdates"],closeParentMenu:!0,action:e=>{X.AP({environment:e.environment,contentType:"inbox"})}}),qe=(0,$.cs)({key:"toggle all teams",displayName:void 0,analyticsName:"toggleAllTeams",validators:[U.jlf,j.bq],shortcuts:["toggleAllTeams"],closeParentMenu:!0,action:e=>{let{environment:t}=e;(0,X.AP)({environment:t,contentType:"teams"})}}),He=(0,$.cs)({key:"open share menu",displayName:void 0,analyticsName:"openShareMenu",validators:[U.jlf],shortcuts:["openShareMenu"],closeParentMenu:!0,action:e=>{let{environment:t}=e;return ee.lG(t)}}),Ge=(0,$.cs)({key:"undo",displayName:$.RE.undoName,analyticsName:$.RE.undoName.defaultMessage,svg:W.s,validators:[U.jlf,U.J5S,U.ffD(U.tqC),U.ffD(U.P99(s.Ti.externalObjectInstancePage)),U.or([U.ffD(U._z),U.ffD(U.Q_M)]),U.ffD(U.uY7)],shortcuts:["undo"],closeParentMenu:!0,action:e=>{let{environment:t}=e;return I.Yw(t)}}),We=(0,$.cs)({key:"redo",displayName:$.RE.redoName,analyticsName:$.RE.redoName.defaultMessage,svg:G.N,validators:[],shortcuts:["redo"],closeParentMenu:!0,action:e=>{let{environment:t}=e;return I.KX(t)}}),$e=(0,$.cs)({key:"up",analyticsName:"Up",displayName:void 0,validators:[],shortcuts:["up"],closeParentMenu:!0,action:(e,t)=>{let{environment:n}=e;if(t&&Ve(t))return t.metaKey||t.ctrlKey?f.w5(n):void f.zJ({environment:n,shiftKey:Boolean(t&&t.shiftKey),altKey:Boolean(t&&t.altKey)})}}),Ye=(0,$.cs)({key:"left",analyticsName:"Left",displayName:void 0,validators:[],shortcuts:["left"],closeParentMenu:!0,action:(e,t)=>{let{environment:n}=e;t&&Ve(t)&&f.e2(n)}}),Qe=(0,$.cs)({key:"down",analyticsName:"Down",displayName:void 0,validators:[],shortcuts:["down"],closeParentMenu:!0,action:(e,t)=>{let{environment:n}=e;if(t&&Ve(t))return t.metaKey||t.ctrlKey?f.hn(n):void f.DI({environment:n,shiftKey:Boolean(t&&t.shiftKey),altKey:Boolean(t&&t.altKey)})}}),Je=(0,$.cs)({key:"right",analyticsName:"Right",displayName:void 0,validators:[],shortcuts:["right"],closeParentMenu:!0,action:e=>{let{environment:t}=e;f.FC(t)}}),Xe=(0,$.cs)({key:"context menu",analyticsName:"Context menu",displayName:void 0,validators:[U.KHO,U.ffD(U.OPg)],shortcuts:["commandSlash"],closeParentMenu:!0,action:e=>{let{environment:t}=e;const{stores:n}=p.default.state;h.$Z({environment:t,stores:n,actionSectionGroupKey:"default",analyticsFrom:"command_slash_menu"})}}),et=(0,$.cs)({key:"indent",analyticsName:"Indent",displayName:void 0,validators:[U.J5S,U.ffD(U.OPg),U.Eok,U.ffD(U.AKv)],shortcuts:["tab"],closeParentMenu:!0,action:e=>{let{environment:t}=e;F.createAndCommit({userAction:"actionRegistry.indent",environment:t,perform:e=>{!function(e){const t=p.default.state.stores;if(t.length>0){const n=m.WY({environment:e.environment,blocks:t,transaction:e.transaction});n&&f.Z5({environment:e.environment,stores:n})}}({environment:t,transaction:e})}})}}),tt=(0,$.cs)({key:"subitemIndent",analyticsName:"Toggle By Indent",displayName:void 0,validators:[U.J5S,U.ffD(U.OPg),U.Eok,U.AKv,U.y9X,U.v_H],shortcuts:["tab"],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;F.createAndCommit({userAction:"actionRegistry.subitemIndent",environment:n,perform:e=>{y.wA({environment:n,transaction:e,blocks:t,action:"indentSelfAndSubtree"})}})}}),nt=(0,$.cs)({key:"unindent",analyticsName:"Unindent",displayName:void 0,validators:[U.J5S,U.ffD(U.OPg),U.Eok,U.ffD(U.AKv)],shortcuts:["untab"],closeParentMenu:!0,action:e=>{let{environment:t}=e;F.createAndCommit({userAction:"actionRegistry.unindent",environment:t,perform:e=>{!function(e){const t=p.default.state.stores;if(t.length>0){const n=m.rB({environment:e.environment,blocks:t,transaction:e.transaction});n&&f.Z5({environment:e.environment,stores:n})}}({environment:t,transaction:e})}})}}),ot=(0,$.cs)({key:"subitemUnindent",analyticsName:"Toggle By Unindent",displayName:void 0,validators:[U.J5S,U.ffD(U.OPg),U.Eok,U.AKv,U.y9X,U.v_H],shortcuts:["untab"],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;F.createAndCommit({userAction:"actionRegistry.subitemUnindent",environment:n,perform:e=>{y.wA({environment:n,transaction:e,blocks:t,action:"unindentSelf"})}})}}),rt=(0,$.cs)({key:"escape",analyticsName:"Escape",displayName:void 0,validators:[U.ffD(U.lPL)],shortcuts:["esc"],closeParentMenu:!0,action:e=>{let{environment:t}=e;b.cQ(t),f.ZH({environment:t}),x.jG(t),pe.default.dismissTourTutorial()}}),it=(0,$.cs)({key:"escape",analyticsName:"Quick Search Escape",displayName:void 0,validators:[U.lPL],shortcuts:["esc"],closeParentMenu:!0,action:()=>{de.ZP.state.query.text.length>0?de.ZP.updateQueryText(""):_.closeQuickSearch()}}),at=(0,$.cs)({key:"select all",analyticsName:"Select all",displayName:void 0,validators:[],shortcuts:["selectAll"],closeParentMenu:!0,action:e=>{let{environment:t}=e;f.td(t)}}),st=(0,$.cs)({key:"cut",analyticsName:"Cut",displayName:void 0,validators:[U.J5S,U.ffD(U.OPg),U.ryx],shortcuts:["cut"],closeParentMenu:!0,action:(e,t)=>{let{environment:n,lazyDependencies:{markdownLinkifyIt:o}}=e;t&&Ne(t)&&v.by({environment:n,event:t,markdownLinkifyIt:o})}}),lt=(0,$.cs)({key:"copy",analyticsName:"Copy",displayName:void 0,validators:[],shortcuts:["copy"],closeParentMenu:!0,action:(e,t)=>{let{environment:n,lazyDependencies:{markdownLinkifyIt:o}}=e;t&&Ne(t)&&v.JG({environment:n,event:t,markdownLinkifyIt:o})}}),ct=(0,$.cs)({key:"zoom in",displayName:Ue.zoomInName,analyticsName:Ue.zoomInName.defaultMessage,validators:[U.daU,U.ffD(U.ar_)],shortcuts:["zoomIn"],closeParentMenu:!0,action:()=>{_.zoomIn()}}),dt=(0,$.cs)({key:"zoom out",displayName:Ue.zoomOutName,analyticsName:Ue.zoomOutName.defaultMessage,validators:[U.daU,U.ffD(U.ar_)],shortcuts:["zoomOut"],closeParentMenu:!0,action:()=>{_.zoomOut()}}),ut=(0,$.cs)({key:"zoom reset",displayName:Ue.resetZoomName,analyticsName:Ue.resetZoomName.defaultMessage,validators:[U.daU,U.ffD(U.ar_)],shortcuts:["zoomReset"],closeParentMenu:!0,action:()=>{_.zoomReset()}});function pt(){const{mainEditorCurrentBlockStore:e}=ie.default.state;return ce.default.state.open&&ce.default.state.targetStore||e}function mt(e){return(t,n)=>{let{environment:o}=t;const r=pt(),i=(0,L.oX)(o);r?e({environment:o,blocks:[r],event:n}):i&&v.RD({environment:o,stringValue:i,copiedMessage:v.tq.copiedLinkToClipboard})}}const gt=(0,$.cs)({key:"copy link to current page",displayName:$.RE.copyLinkNavigableTypeName,analyticsName:$.RE.copyLinkNavigableTypeName.defaultMessage,svg:H.N,validators:[U.daU,U.ffD(U.uY7)],shortcuts:["copyLinkToCurrentPage"],closeParentMenu:!0,action:mt(v.Hs)}),ft=(0,$.cs)({key:"copy linkified page title to current page",displayName:Ue.copyFormattedLinkNavigableTypeName,analyticsName:Ue.copyFormattedLinkNavigableTypeName.defaultMessage,svg:H.N,validators:[],shortcuts:["copyCurrentPageLinkifiedBlockTitle"],closeParentMenu:!0,action:mt(v.VG)}),ht=(0,$.cs)({key:"paste",displayName:Ue.pasteName,analyticsName:Ue.pasteName.defaultMessage,validators:[U.J5S,U.ffD(U.OPg),U.ryx,U.jlf],shortcuts:["paste"],closeParentMenu:!0,action:(e,t)=>{let{environment:n,lazyDependencies:{markdownLinkifyIt:o,tinyMceMicrosoftWordPasteFilter:r}}=e;t&&Ne(t)&&F.createAndCommit({userAction:"actionRegistry.paste",environment:n,perform:e=>{v.v({environment:n,event:t,disableEmbedMenu:!0,transaction:e,onPasteFiles:v.AL,markdownLinkifyIt:o,tinyMceMicrosoftWordPasteFilter:r})}})}}),vt=(0,$.cs)({key:"move up",displayName:Ue.moveUpName,analyticsName:Ue.moveUpName.defaultMessage,validators:[U.J5S,U.Eok,U.ffD(U.AKv)],shortcuts:["moveUp"],closeParentMenu:!0,action:e=>{let{environment:t}=e;F.createAndCommit({userAction:"actionRegistry.moveUp",environment:t,perform:e=>{!async function(e){const t=m.A1({transaction:e.transaction,blocks:p.default.state.stores});t&&(f.Z5({environment:e.environment,stores:t}),await u.default.afterNextFlush(),g.Zv())}({environment:t,transaction:e})}})}}),yt=(0,$.cs)({key:"move down",displayName:Ue.moveDownName,analyticsName:Ue.moveDownName.defaultMessage,validators:[U.J5S,U.Eok,U.ffD(U.AKv)],shortcuts:["moveDown"],closeParentMenu:!0,action:e=>{let{environment:t}=e;F.createAndCommit({userAction:"actionRegistry.moveDown",environment:t,perform:e=>{!async function(e){const t=m.vi({transaction:e.transaction,blocks:p.default.state.stores});t&&(f.Z5({environment:e.environment,stores:t}),await u.default.afterNextFlush(),g.Zv())}({environment:t,transaction:e})}})}}),bt=(0,$.cs)({key:"property visibility",displayName:Ue.propertyVisibilityLabel,analyticsName:Ue.propertyVisibilityLabel.defaultMessage,svg:q.B,shortcuts:["togglePropertyVisibility"],validators:[U.J5S,U.ffD(U.YGm)],closeParentMenu:!0,action:e=>{const t=le.my.state.pagePropertiesStore;t&&t.setState({...t.state,forceShowProperties:!t.state.forceShowProperties})}}),_t=(0,$.cs)({key:"enter",displayName:Ue.enterName,analyticsName:Ue.enterName.defaultMessage,validators:[U.J5S,U.ffD(U.OPg)],shortcuts:["enter"],closeParentMenu:!0,action:e=>{let{environment:t,blocks:n}=e;F.createAndCommit({userAction:"actionRegistry.enter",environment:t,perform:e=>{A.mp({blocks:n,transaction:e})}})}}),St=(0,$.cs)({key:"activate",analyticsName:"Activate",displayName:void 0,validators:[U.J5S,U.nWT],shortcuts:["commandEnter"],closeParentMenu:!0,action:e=>A.QZ(e)}),kt=(0,$.cs)({key:"open tab",analyticsName:"open tab",displayName:void 0,validators:[U.fy9],shortcuts:["commandEnter"],closeParentMenu:!0,action:e=>A.Ah(e)}),wt=(0,$.cs)({key:"toggle sidebar",analyticsName:"Toggle sidebar",displayName:void 0,validators:[U.ffD(U.ATo)],shortcuts:["toggleSidebar"],closeParentMenu:!0,action:e=>{let{environment:t}=e;return te.setExpand({environment:t,isExpanded:!oe.sidebarExpandedStore.state,from:"action_registry",saveDetailsSidebarPreference:!0})}}),xt=(0,$.cs)({key:"toggle favorite",analyticsName:"Toggle favorite",displayName:void 0,validators:[U.jlf,U.ffD(U.tls),U.ffD(U.hrD)],shortcuts:["toggleFavorite"],closeParentMenu:!0,action:e=>{let{environment:t}=e;const{currentSpaceViewStore:n}=ie.default.state,o=pt();if(!n||!o)return;const r=(0,O.Z)({spaceViewStore:n,pageId:o.id})?te.unbookmarkPage:te.bookmarkPage;F.createAndCommit({userAction:"actionRegistry.toggleFavorite",environment:t,perform:e=>r({spaceViewStore:n,store:o,transaction:e})})}}),It=(0,$.cs)({key:"toggle update sidebar",analyticsName:"Toggle update sidebar",displayName:void 0,validators:[],shortcuts:["toggleUpdateSidebar"],closeParentMenu:!0,action:e=>{let{environment:t}=e;return te.setUpdateExpand({environment:t,isExpanded:!(0,ne.Sx)(t),from:"keyboard_default",saveDetailsSidebarPreference:!0})}}),Ct=(0,$.cs)({key:"toggle both sidebars",analyticsName:"Toggle both sidebars",displayName:void 0,validators:[],shortcuts:["toggleBothSidebars"],closeParentMenu:!0,action:e=>{let{environment:t}=e;te.toggleBothSidebars(t)}}),Tt=(0,$.cs)({key:"open comments tab in update sidebar",analyticsName:"Open comments tab in update sidebar",displayName:void 0,validators:[],shortcuts:["openCommentsTabInUpdateSidebar"],closeParentMenu:!0,action:e=>{let{environment:t}=e;te.setUpdateExpand({environment:t,isExpanded:!0,from:"keyboard_comments",saveDetailsSidebarPreference:!0}),te.setUpdateSidebarTab(re.gY.Comments)}}),Mt=(0,$.cs)({key:"open updates tab in update sidebar",analyticsName:"Open updates tab in update sidebar",displayName:void 0,validators:[],shortcuts:["openUpdatesTabInUpdateSidebar"],closeParentMenu:!0,action:e=>{let{environment:t}=e;te.setUpdateExpand({environment:t,isExpanded:!0,from:"keyboard_updates",saveDetailsSidebarPreference:!0}),te.setUpdateSidebarTab(re.gY.Updates)}}),Pt=(0,$.cs)({key:"open link annotation menu",displayName:Ue.createLinkName,analyticsName:Ue.createLinkName.defaultMessage,validators:[U.DaG,z.K,U.U4I,U.ryx,U.ffD(U.tls)],shortcuts:["openLinkMenuOrOpenSearch"],closeParentMenu:!0,action:()=>k.dz({type:"focusOnly",focus:!0})}),At=(0,$.cs)({key:"open equation annotation menu",displayName:Ue.createEquationName,analyticsName:Ue.createEquationName.defaultMessage,validators:[U.DaG,U.ffD(U.or([U.Khw,U.T29,U.QYD,U.DUX]))],shortcuts:["openEquationMenu"],closeParentMenu:!0,action:e=>S.qn({environment:e.environment,analyticsFrom:"input_keyboard_shortcut"})}),Rt=(0,$.cs)({key:"exit app",analyticsName:"Exit app",displayName:void 0,validators:[U.ffD(U.NWv),U.DtP],shortcuts:["backbutton"],closeParentMenu:!0,action:e=>{let{environment:t}=e;if(t.mobileNative)if((0,L.__)(t)){const{TabbedRouterStore:e}=t;"home"!==e.state.activeTab?M.S({environment:t,tab:"home",navigationAction:"pop",navigationSource:"mobile-back-navigation"}):t.mobileNative.exitApp()}else t.mobileNative.exitApp()}}),Dt=(0,$.cs)({key:"command left",analyticsName:"Go back",displayName:void 0,validators:[U.NWv,U.ffD(U.DaG)],shortcuts:["commandLeft"],closeParentMenu:!0,action:(e,t)=>T.op(e.environment)}),Bt=(0,$.cs)({key:"command right",analyticsName:"Go forward",displayName:void 0,validators:[U.vyP,U.ffD(U.DaG)],shortcuts:["commandRight"],closeParentMenu:!0,action:()=>T.eH()}),Et=(0,$.cs)({key:"go back",analyticsName:"Go back",displayName:void 0,validators:[U.NWv],shortcuts:["goBack","backbutton"],closeParentMenu:!0,action:e=>{let{environment:t}=e;return T.op(t)}}),Ft=(0,$.cs)({key:"go forward",analyticsName:"Go forward",displayName:void 0,validators:[U.vyP],shortcuts:["goForward"],closeParentMenu:!0,action:()=>T.eH()}),Zt=(0,$.cs)({key:"go up",analyticsName:"Go up",displayName:void 0,validators:[()=>T.LU()],shortcuts:["goUp"],closeParentMenu:!0,action:e=>{let{environment:t}=e;return T.up(t)}}),Ut=(0,$.cs)({key:"switch spaces pre tabs",analyticsName:"Switch spaces pre tabs",displayName:void 0,validators:[U.daU,U.ffD(U.VcC)],shortcuts:["switchSpacesPreTabs"],closeParentMenu:!0,action:(e,t)=>{let{environment:n}=e;if(!t||!Ve(t))return;t.preventDefault();const o=parseInt(r()(t.keyCode)),{currentUserRootStore:i,currentUserSettingsStore:a}=ie.default.state;i&&a&&(R._u({environment:n,index:o-1,userRootStore:i,userSettingsStore:a}),d.so(n))}}),Vt=(0,$.cs)({key:"switch spaces post tabs",analyticsName:"Switch spaces post tabs",displayName:void 0,validators:[U.daU,U.VcC],shortcuts:["switchSpacesPostTabs"],closeParentMenu:!0,action:(e,t)=>{let{environment:n}=e;if(!t||!Ve(t))return;t.preventDefault();const o=parseInt(r()(t.keyCode)),{currentUserRootStore:i,currentUserSettingsStore:a}=ie.default.state;i&&a&&(R._u({environment:n,index:o-1,userRootStore:i,userSettingsStore:a}),d.so(n))}}),Nt=(0,$.cs)({key:"open settings",analyticsName:"Open settings",displayName:void 0,validators:[U.daU,U.EDF],shortcuts:["settings"],closeParentMenu:!0,action:e=>{w.r$()}}),Ot=(0,$.cs)({key:"new page",analyticsName:"New page",displayName:void 0,validators:[U.ROK,U.jlf,U.or([U.daU,U.Fxc])],shortcuts:["newPage"],closeParentMenu:!0,action:e=>{let{environment:t}=e;te.quickAddPage({environment:t,from:"cmd_n"})}}),Lt=(0,$.cs)({key:"turn into type",displayName:$.RE.turnIntoName,analyticsName:$.RE.turnIntoName.defaultMessage,validators:[U.J5S,U.ffD(U.OPg),K.c,U.wFS],shortcuts:["turnIntoType"],closeParentMenu:!0,action:(e,t)=>{let{blocks:n,environment:o}=e;if(!t||!Ve(t))return;t.preventDefault();const i=parseInt(r()(t.keyCode)),a=s.PH[i];F.createAndCommit({userAction:"actionRegistry.turnIntoTypeViaKeyboard",environment:o,perform:e=>{Z.Cj({environment:o,blocks:n,blockType:a,transaction:e})}})}}),jt=(0,$.cs)({key:"open experiment settings",displayName:void 0,analyticsName:"openExperimentSettings",validators:[N.mS],shortcuts:["openExperimentSettings"],closeParentMenu:!0,action:()=>{ue.Z.setState({...ue.Z.state,open:!0,currentTab:"experiments",defaultSubtab:void 0})}}),Kt=[Le({key:"toggle bold",displayName:Ue.boldName,analyticsName:Ue.boldName.defaultMessage,shortcuts:["toggleBold"],annotation:["b"]}),Le({key:"toggle italics",displayName:Ue.italicName,analyticsName:Ue.italicName.defaultMessage,shortcuts:["toggleItalics"],annotation:["i"]}),Le({key:"toggle strike",displayName:Ue.strikeThroughName,analyticsName:Ue.strikeThroughName.defaultMessage,shortcuts:["toggleStrike"],annotation:["s"]}),Le({key:"toggle underline",displayName:Ue.underlineName,analyticsName:Ue.underlineName.defaultMessage,shortcuts:["toggleUnderline"],annotation:[l.GKr.Underline]})],zt=(0,$.cs)({key:"toggle dark mode",displayName:Ue.darkModeName,analyticsName:Ue.darkModeName.defaultMessage,validators:[],shortcuts:["toggleDarkMode"],closeParentMenu:!0,action:e=>{let{environment:t}=e;const n="light"===t.ThemeStore.state.mode?"dark":"light";B.Y7(n)}}),qt=(0,$.cs)({key:"open peek view as page",displayName:Ue.openAsPageName,analyticsName:Ue.openAsPageName.defaultMessage,validators:[U.Txk],shortcuts:["commandEnter"],closeParentMenu:!0,action:e=>{let{environment:t}=e;ce.default.peekTargetStore.state&&C._c({environment:t,store:ce.default.peekTargetStore.state,pageVisitSource:a.tY.Expand})}}),Ht=(0,$.cs)({key:"toggle all toggles",displayName:Ue.openAllTogglesName,analyticsName:Ue.openAllTogglesName.defaultMessage,validators:[],shortcuts:["toggleAllToggles"],closeParentMenu:!0,action:e=>{let{environment:t}=e;const n=V.np();n&&E.X_(t,n)}});function Gt(e){return e.actions.filter(Ze).map((t=>({...t,searchName:[e.title,t.displayName].filter(Boolean).join(" ")})))}const Wt=(0,$.cs)({key:"toggle recording input latency",displayName:Ue.toggleRecordingInputLatencyName,analyticsName:Ue.toggleRecordingInputLatencyName.defaultMessage,validators:[],shortcuts:["toggleRecordingInputLatency"],closeParentMenu:!0,action:()=>{i.toggleRecordingInputLatency()}}),$t=(0,$.cs)({key:"toggle qna in corner",displayName:Ue.toggleQnAMessage,analyticsName:"toggleQnAPane",validators:[U.lvA,U.ffD(U.DaG),U.ffD(U.KHO),...fe.fF],shortcuts:["commandJ"],closeParentMenu:!0,action:async e=>{let{environment:t}=e;const{assistantDependency:o}=await Promise.resolve().then(n.bind(n,81598)),{assistantMenuStore:r,assistantOriginElementStore:i,assistantAnalyticsActions:a,assistantMenuActions:s}=await o.load();if(ae.Z.shouldShowAssistantInCorner(t.device))if(r.state.open){await s.closeAssistantRightHandSideMenu({environment:t}),i.setAssistantLastViewedTime();const e=se.default.getActiveSession();e&&a.trackAssistantClosed(t,{sessionContext:e,from:"button"})}else s.openAssistantRightHandSideMenu({environment:t,from:"shortcut"})}}),Yt=[Ht,je,Ke,ye.G,..._e.UO.actions,_e.o1,ke.d,_t,St,Se.T,Se.U,kt,xe.KB,xe.Jw,Ee.B,Ee.L9,Ie.$,Ie.g,ge.UI,ge.VJ,(0,Be.E)("keyboard_shortcut"),Ge,We,De,et,tt,ot,nt,at,rt,it,vt,yt,st,lt,ht,$e,Ye,Qe,Je,$t,Xe,he.OY,ve.Hs,he.NY,Pt,At,Rt,Et,Ft,Dt,Bt,ct,dt,ut,Zt,we.A,we.Q,Ut,Vt,gt,ft,Lt,xe.Qk,xe.OW,wt,Ct,It,Tt,Mt,Nt,Ot,be.NE,zt,qt,bt,Wt,xt,ze,qe,He,J,be.gz,jt,...Kt,...Gt(Fe.g),...Gt(me.te)]},388941:(e,t,n)=>{n.d(t,{d:()=>u});var o=n(709291),r=n(311712),i=n(119037),a=(n(667294),n(745238)),s=n(785893);const l=(0,a.IU)("fullscreen",{viewBox:"0 0 16 16",svg:(0,s.jsx)("path",{d:"M1.25293 6.82031C1.25293 9.88965 3.74805 12.3848 6.81738 12.3848C7.95898 12.3848 9.00488 12.0361 9.87988 11.4414L13.0244 14.5859C13.2158 14.7842 13.4824 14.873 13.749 14.873C14.3301 14.873 14.7471 14.4355 14.7471 13.8682C14.7471 13.5947 14.6514 13.3418 14.4668 13.1504L11.3428 10.0195C11.9922 9.12402 12.3818 8.0166 12.3818 6.82031C12.3818 3.75098 9.88672 1.25586 6.81738 1.25586C3.74805 1.25586 1.25293 3.75098 1.25293 6.82031ZM2.70215 6.82031C2.70215 4.55078 4.54102 2.70508 6.81738 2.70508C9.08691 2.70508 10.9326 4.55078 10.9326 6.82031C10.9326 9.08984 9.08691 10.9355 6.81738 10.9355C4.54102 10.9355 2.70215 9.08984 2.70215 6.82031ZM4.52051 6.82031C4.52051 7.12109 4.75293 7.35352 5.05371 7.35352H6.27734V8.58398C6.27734 8.88477 6.5166 9.11719 6.81738 9.11719C7.11816 9.11719 7.35059 8.87793 7.35059 8.58398V7.35352H8.58105C8.875 7.35352 9.11426 7.12109 9.11426 6.82031C9.11426 6.51953 8.875 6.28711 8.58105 6.28711H7.35059V5.05664C7.35059 4.7627 7.11133 4.52344 6.81738 4.52344C6.5166 4.52344 6.27734 4.7627 6.27734 5.05664V6.28711H5.05371C4.75293 6.28711 4.52051 6.51953 4.52051 6.82031Z"})});var c=n(62967);const d=(0,o.defineMessages)({fullScreenName:{id:"action.fullScreen.name",defaultMessage:"Full screen"}}),u=(0,c.cs)({key:"full screen",displayName:d.fullScreenName,analyticsName:d.fullScreenName.defaultMessage,svg:l,validators:[i.U7o,i.Cjo,i.ITt,i.ffD(i.DaG)],shortcuts:["space"],closeParentMenu:!0,action:e=>r.dK(e)})},819588:(e,t,n)=>{n.d(t,{Q:()=>w,A:()=>x});n(667294);var o=n(709291),r=n(401898),i=n(73990),a=n(211302),s=n(164964),l=n(693405),c=n(301951),d=n(526388),u=n(119037),p=n(721429),m=n(843250),g=n(98742),f=n(175770),h=n(745238),v=n(785893);const y=(0,h.IU)("moveTo",{viewBox:"0 0 16 16",svg:(0,v.jsx)("path",{d:"M2.34668 13.5469C2.78418 13.5469 3.07812 13.2393 3.07812 12.8018C3.07812 12.542 3.05762 12.2754 3.05762 11.8994C3.05762 9.60254 3.86426 8.67285 6.14062 8.67285H10.5771L12.2109 8.57031L10.1738 10.4297L8.64941 11.9678C8.5127 12.1045 8.43066 12.2891 8.43066 12.501C8.43066 12.9111 8.73828 13.2188 9.16895 13.2188C9.35352 13.2188 9.53809 13.1436 9.70215 12.9863L14.207 8.48145C14.3711 8.33105 14.4531 8.12598 14.4531 7.9209C14.4531 7.71582 14.3711 7.51758 14.207 7.36035L9.71582 2.86914C9.53809 2.70508 9.35352 2.62305 9.16895 2.62305C8.73828 2.62305 8.43066 2.93066 8.43066 3.34082C8.43066 3.55273 8.5127 3.7373 8.64941 3.87402L10.1738 5.41895L12.2041 7.27148L10.5771 7.17578H6.04492C2.87988 7.17578 1.54688 8.63184 1.54688 11.8516C1.54688 12.2549 1.56055 12.6035 1.61523 12.877C1.67676 13.2051 1.88184 13.5469 2.34668 13.5469Z"})});var b=n(825464),_=n(80444),S=n(62967);const k=(0,o.defineMessages)({moveToName:{id:"action.moveTo.name",defaultMessage:"Move to"}}),w=(0,S.cs)({key:"move page to",displayName:k.moveToName,analyticsName:k.moveToName.defaultMessage,shortcuts:["moveTo"],validators:[u.ffD(u.q4$)],closeParentMenu:!0,action:e=>{let{environment:t,publicEditMode:n,lazyDependencies:o}=e;const{mainEditorCurrentBlockStore:r}=_.default.state;if(!r)return;const i=x.validators||[],a=document.querySelector(`.${m.mSZ}`);if(!a)return;const s={environment:t,blocks:[r],originRect:a.getBoundingClientRect(),publicEditMode:n,lazyDependencies:o};i.every((e=>e(s)))&&x.action(s)}}),x=(0,S.cs)({key:"move to",displayName:k.moveToName,analyticsName:k.moveToName.defaultMessage,svg:y,shortcuts:["moveTo"],validators:[...a.z1()],closeParentMenu:!0,render:(e,t)=>{const{environment:n,blocks:r}=t,i=f.hD({environment:n,blocks:r}),a=i.canMoveBlocks?void 0:I(i.reason),s=Boolean(a);return(0,v.jsx)(d.Z,{placement:b.u.Right,textWrap:!0,style:{maxWidth:240},disableTooltip:!s,renderTooltip:()=>a,render:t=>(0,v.jsx)(l.Z,{...(0,g.Z)(e,t),svg:y,title:(0,v.jsx)(o.FormattedMessage,{...k.moveToName}),disabled:s,disabledFeedback:s,shortcut:"moveTo"})})},action:async e=>{const{environment:t}=e,n=f.hD({environment:t,blocks:e.blocks});if(!n.canMoveBlocks){const{reason:t}=n;return void function(e){let{environment:t,reason:n}=e;switch(s.oV({label:I(n)}),n.key){case"lockedTopLevelTeamPage":i.fW(t,{type:"locked_top_level_team"});break;case"needsFullAccess":case"needsEditAccessOnParent":case"unknown":i.fW(t,{type:"no_permission"});break;default:(0,r.t1)(n)}}({environment:e.environment,reason:t})}let o=[];const l=_.default.state.mainEditorCurrentBlockStore,c=p.np();e.blocks.length>0&&e.blocks[0]!==l?o=e.blocks:c&&(o=[c]),e.environment.device.isMobileNative?await a.$X({environment:e.environment,blocks:o,originRect:e.originRect,moveToContext:"action_menu"}):a.bA({environment:e.environment,blocks:o,originRect:e.originRect,moveToContext:"action_menu"})}});function I(e){var t;switch(e.key){case"needsFullAccess":return(0,v.jsx)(o.FormattedMessage,{id:"blockMenu.moveTo.disabled.fullAccess.reason",defaultMessage:'You need "Full access" to this page to move it.'});case"needsEditAccessOnParent":return null!==(t=e.parentStore)&&void 0!==t&&t.canRead()?(0,v.jsx)(o.FormattedMessage,{id:"blockMenu.moveTo.disabled.editAccessOnParent.reasonWithParentName",defaultMessage:"You need edit access to {parentPageName} to move this page.",values:{parentPageName:(0,v.jsx)(c.Z,{store:e.parentStore,useInvertedColors:!0})}}):(0,v.jsx)(o.FormattedMessage,{id:"blockMenu.moveTo.disabled.editAccessOnParent.reason",defaultMessage:"You need edit access to the parent page to move this page."});case"unknown":return(0,v.jsx)(o.FormattedMessage,{id:"action.doNotHavePermissionToMoveBlock",defaultMessage:"You do not have permission to move this page."});case"lockedTopLevelTeamPage":return(0,v.jsx)(o.FormattedMessage,{id:"action.isLockedTopLevelTeamPage",defaultMessage:"This teamspace has its sidebar locked. You must be a teamspace owner to move this page."});default:(0,r.t1)(e)}}},456606:(e,t,n)=>{n.d(t,{OW:()=>N,Qk:()=>V,Y7:()=>w,KB:()=>R,ej:()=>U,Ob:()=>Z,Jw:()=>M});var o=n(815145),r=n(837167),i=n(421202),a=n(870279),s=n(709291),l=n(472711),c=n(926999),d=n(608055),u=n(119037),p=n(484210),m=n(317105),g=(n(667294),n(745238)),f=n(785893);const h=(0,g.IU)("newWindow",{viewBox:"0 0 18 14",svg:(0,f.jsx)("g",{children:(0,f.jsx)("path",{d:"M.9 11.234V2.915C.9 1.452 1.664.693 3.141.693h11.71c1.476 0 2.242.76 2.242 2.222v8.32c0 1.455-.766 2.221-2.242 2.221H3.142c-1.477 0-2.243-.759-2.243-2.222zM3.264 3.1a.643.643 0 00.635-.636.648.648 0 00-.635-.636c-.356 0-.636.3-.636.636 0 .342.28.636.636.636zm2.016 0a.638.638 0 00.63-.636.642.642 0 00-.63-.636.65.65 0 00-.642.636c0 .342.287.636.642.636zm2.01 0a.643.643 0 00.636-.636.648.648 0 00-.636-.636c-.349 0-.636.3-.636.636 0 .342.287.636.636.636zm-5.052 8.018c0 .663.349.998.985.998H14.77c.628 0 .984-.335.984-.998V4.241H2.239v6.877z"})})});var v=n(220300),y=n(392582),b=n(80444),_=n(188923),S=n(62967);const k=(0,s.defineMessages)({openInFullPage:{id:"action.navigation.openInFullPage",defaultMessage:"Open in full page"},openInSidePeek:{id:"action.navigation.openInSidePeek",defaultMessage:"Open in side peek"},openInNewTab:{id:"action.openInNewTab.name",defaultMessage:"Open in new tab"},openInNewWindow:{id:"action.openInNewWindow.name",defaultMessage:"Open in new window"},openInFullPageShort:{id:"action.navigation.openInFullPageShort",defaultMessage:"Full page"},openInSidePeekShort:{id:"action.navigation.openInSidePeekShort",defaultMessage:"Side peek"},openInNewTabShort:{id:"action.openInNewTab.nameShort",defaultMessage:"New tab"},openInNewWindowShort:{id:"action.openInNewWindow.nameShort",defaultMessage:"New window"}});function w(e){var t;const n=e.blocks[0];if(!n)return!1;if(null!==(t=n.getModel())&&void 0!==t&&t.isNavigableBlock())return!0;if(n.isType("alias")){var o;const e=null===(o=n.getAliasTargetStore())||void 0===o?void 0:o.getModel();if((null==e?void 0:e.table)===i.iU&&null!=e&&e.isNavigableBlock())return!0}return!1}function x(e){return _.default.isSidePeekOpen()}const I=T(!1),C=T(!0);function T(e){return(0,S.cN)({key:"open in full page",displayName:e?k.openInFullPageShort:k.openInFullPage,analyticsName:e?k.openInFullPageShort.defaultMessage:k.openInFullPage.defaultMessage,svg:v.M,validators:[u.U7o,w,x],closeParentMenu:!0,action:e=>{const t=e.blocks[0],n=t.getAliasTargetStore()??t;if(n.table===a.x_)return;const r=(0,p.ZP)({store:n,pageVisitSource:o.tY.LinkInPage});d.c4({environment:e.environment,url:r})}})}const M=A(!1),P=A(!0);function A(e){return(0,S.cs)({key:"open side peek",displayName:e?k.openInSidePeekShort:k.openInSidePeek,analyticsName:e?k.openInSidePeekShort.defaultMessage:k.openInSidePeek.defaultMessage,svg:y.y,shortcuts:["openInSidePeek"],validators:[u.U7o,w,u.ffD(u.tqC),u.WCc,u.ffD(u.hrD)],closeParentMenu:!0,action:e=>{var t;const{route:n}=e.environment.RouterStore.state,i="chat"===n.name;if(!(null===(t=b.default.state.mainEditorCurrentBlockStore)||void 0===t?void 0:t.id)&&!i)return;const s=e.blocks[0],l=s.getAliasTargetStore()??s;if(l.table===a.x_)return;const c=i?(0,r.tj)({pageId:s.id,pageVisitSource:o.tY.AIChat,scrollToBlockId:void 0,isMobile:e.environment.device.isMobile}):(0,p.ZP)({store:l,openInSidePeek:!0,peekViewBlockId:l.id,peekMode:"s",pageVisitSource:o.tY.PeekOpen});d.c4({environment:e.environment,url:c})}})}const R=B(!1),D=B(!0);function B(e){return(0,S.cs)({key:"navigate to page in new tab",analyticsName:"Navigate to page in new tab",displayName:e?k.openInNewTabShort:k.openInNewTab,svg:m.J,validators:[u.U7o,w,u.ffD(u.tqC),u.ffD(u.K5G)],shortcuts:["commandShiftEnter"],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;if(t[0].isType("alias")){var r;const e=t[0];if(!(null===(r=b.default.state.mainEditorCurrentBlockStore)||void 0===r?void 0:r.id))return;const i=e.getAliasTargetStore()??e;if(i.table===a.x_)return;l.ru({environment:n,blocks:[i],openInNew:"tab",pageVisitSource:o.tY.LinkInPage})}else l.ru({environment:n,blocks:t,openInNew:"tab",pageVisitSource:o.tY.LinkInPage})}})}const E=F(!1);function F(e){return(0,S.cN)({key:"navigate to page in new window",analyticsName:"Navigate to page in new window",displayName:e?k.openInNewWindowShort:k.openInNewWindow,svg:h,validators:[u.U7o,u.DFt,u.tYA,u.ffD(u.vjj),u.ffD(u.tqC),u.ffD(u.K5G)],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;l.ru({environment:n,blocks:t,openInNew:"window",pageVisitSource:o.tY.LinkInPage})}})}const Z=[D,F(!0),C,P],U=[R,E,I,M],V=(0,S.cs)({key:"go up one page",analyticsName:"Go up one page",displayName:void 0,validators:[u.Txk],shortcuts:["peekUp"],closeParentMenu:!0,action:()=>c.Qk()}),N=(0,S.cs)({key:"go down one page",analyticsName:"Go down one page",displayName:void 0,validators:[u.Txk],shortcuts:["peekDown"],closeParentMenu:!0,action:()=>c.OW()})},206471:(e,t,n)=>{n.d(t,{$:()=>u,g:()=>p});var o=n(541432),r=n(709291),i=n(443008),a=n(552771),s=n(119037),l=n(698246),c=n(62967);const d=(0,r.defineMessages)({renameName:{id:"action.rename.name",defaultMessage:"Rename"}}),u=(0,c.cs)({key:"rename page",displayName:d.renameName,analyticsName:d.renameName.defaultMessage,svg:l.H,validators:[s.YZb,s.k5s,s.U7o,s.DFt,s.ffD(s.NnH),s.ffD(s.p1d),s.ffD(s.CJE),s.ffD(s.P99(o.Ti.externalObjectInstancePage)),s.ffD(s.Q_M),s.ffD(s.K5G),s.ffD(s.q4$),s.ffD(s.uY7)],shortcuts:["rename"],closeParentMenu:!0,action:e=>{const{blocks:t,originRect:n}=e;if(t.length>0)return a.$({blockStore:t[0],originRect:n})}}),p=(0,c.cs)({key:"rename file",displayName:d.renameName,analyticsName:d.renameName.defaultMessage,svg:l.H,validators:[s.J5S,s.U7o,s.$H4,s.ffD(s.j2U("table"))],shortcuts:["rename"],closeParentMenu:!0,action:e=>{const{blocks:t,originRect:n}=e;if(t.length>0)return i.g({blockStore:t[0],originRect:n})}})},211703:(e,t,n)=>{n.d(t,{E:()=>p});var o=n(709291),r=n(850799),i=n(808549),a=n(119037),s=n(873153),l=n(646124),c=n(452452),d=n(62967);const u=(0,o.defineMessages)({suggestName:{id:"action.suggest.name",defaultMessage:"Suggest"}});function p(e){return(0,d.cs)({key:"suggest",displayName:u.suggestName,analyticsName:u.suggestName.defaultMessage,svg:c.I,hideFromSlashActionMenu:!0,validators:[a.ffD(a.tqC),a.iR0,a.ffD(a.OPg),s.c,i.nZ,i.VS,a.or([a.U7o,l.K]),a.ffD(a.OXD)],shortcuts:["suggest"],closeParentMenu:!0,action:t=>{let{blocks:n,environment:o}=t;n[0]&&r.cA({environment:o,navigableBlockStore:n[0],mode:"suggest",location:e})}})}},641670:(e,t,n)=>{n.d(t,{L9:()=>S,B:()=>_});var o=n(709291),r=(n(757658),n(23867)),i=n(653965),a=n(95477),s=n(165598),l=n(58202),c=n(21359),d=n(276725),u=n(594419),p=n(311712),m=n(524677),g=n(210228);function f(e){return l.R.find((t=>t.getBlockStore()===e))}var h=n(119037),v=n(621386),y=n(62967);const b=(0,o.defineMessages)({unsyncTransclusionReferenceName:{id:"action.unsyncTransclusionReference.name",defaultMessage:"Unsync"},unsyncTransclusionReferenceFuzzySearch:{id:"action.unsyncTransclusionReference.fuzzySearchKeywords",defaultMessage:"Unsync ungroup"},unsyncTransclusionContainerName:{id:"action.unsyncTransclusionContainerName.name",defaultMessage:"Unsync all"},unsyncTransclusionContainerFuzzySearch:{id:"action.unsyncTransclusionContainer.fuzzySearchKeywords",defaultMessage:"Unsync all ungroup"}}),_=(0,y.cs)({key:"unsyncTransclusionReference",displayName:b.unsyncTransclusionReferenceName,analyticsName:b.unsyncTransclusionReferenceName.defaultMessage,fuzzySearchKeywords:b.unsyncTransclusionReferenceFuzzySearch,svg:v.T,validators:[h.J5S,h.FYR,h.U7o],shortcuts:["ungroup"],closeParentMenu:!0,action:e=>{!async function(e){const{environment:t,store:n}=e,o=n.getRecordStoreUIParent(),l=n.getTransclusionReferenceTargetStore();if(!o||!(0,s.dz)(o)||!l)return;const c=f(l);c&&await c.confirmUnsyncTransclusionReference()&&g.createAndCommit({userAction:"transclusionActions.unsyncTransclusionReference",environment:t,perform:e=>{const s=l.getContentStores().map((n=>{const[i,s]=d.Qi({environment:t,stores:[n],addCopyName:!1,transaction:e,deepCopyTransclusionContainers:!0,resolveTemplateVariables:!1,targetSpaceId:(0,r.C)(n.pointer.spaceId),baseUrl:a.default.domainBaseUrl,publicDomainName:a.default.publicDomainName,preferDuplicateLocation:"local",useCrdt:o.getRecordStoreAtRootPath().useCrdt()});return i[0]})),c=i.d9(s).reverse().map((t=>{const{childStore:r}=u.BE({parentStore:o,insertStore:t,afterStore:n,transaction:e});return r}));p.Od({store:n,transaction:e}),m.Z5({environment:t,stores:c})}})}({environment:e.environment,store:e.blocks[0]})}}),S=(0,y.cs)({key:"unsyncTransclusionContainer",displayName:b.unsyncTransclusionContainerName,analyticsName:b.unsyncTransclusionContainerName.defaultMessage,fuzzySearchKeywords:b.unsyncTransclusionContainerFuzzySearch,svg:v.T,validators:[h.J5S,h.muB,h.U7o],shortcuts:["ungroup"],closeParentMenu:!0,action:e=>{!async function(e){const{environment:t,store:n}=e,o=f(n),l=n.getRecordStoreUIParent();if(!l||!(0,s.dz)(l)||!o)return;if(!(await o.confirmUnsyncTransclusionContainer()))return;const h=n.getContentStores();g.createAndCommit({userAction:"transclusionActions.unsyncTransclusionContainer",environment:t,canUndo:!1,perform:e=>{const o=h.map((n=>{const[o,i]=d.Qi({environment:t,stores:[n],addCopyName:!1,transaction:e,deepCopyTransclusionContainers:!0,resolveTemplateVariables:!1,targetSpaceId:(0,r.C)(n.pointer.spaceId),baseUrl:a.default.domainBaseUrl,publicDomainName:a.default.publicDomainName,preferDuplicateLocation:"local",useCrdt:l.getRecordStoreAtRootPath().useCrdt()});return o[0]})),s=i.d9(o).reverse().map((t=>{const{childStore:o}=u.BE({parentStore:l,insertStore:t,afterStore:n,transaction:e});return o}));p.Od({store:n,transaction:e}),m.Z5({environment:t,stores:s}),e.postSubmitCallbacks.push((async e=>{e||await c.deleteBlocks(t,{blocks:[{id:n.id,spaceId:(0,r.C)(n.pointer.spaceId)}],permanentlyDelete:!1})}))}})}({environment:e.environment,store:e.blocks[0]})}})},811732:(e,t,n)=>{n.d(t,{g:()=>I,s:()=>w});n(667294);var o=n(841892),r=n(541432),i=n(709291),a=n(531701),s=n(653965),l=n(401898),c=n(210228),d=n(668422),u=n(30994),p=n(672495),m=n(296994),g=n(119037),f=n(840959),h=n(873153),v=n(646124),y=n(738195),b=n(905162),_=n(62967),S=n(785893);const k={column_list:!0,transclusion_container:!0},w=(0,i.defineMessages)({turnIntoSection:{id:"action.section.turnInto",defaultMessage:"Turn into"},newPageInName:{id:"action.pageIn.name",defaultMessage:"Page in"}}),x=(0,_.cN)({key:"new page in section",displayName:w.newPageInName,analyticsName:w.newPageInName.defaultMessage,closeParentMenu:!0,svg:y.a,hideFromSlashActionMenu:!0,validators:[g.J5S,g.ffD(g.OPg),g.ffD(g.P99("page")),h.c,g.wFS,g.ffD(g.Fxc)],render:(e,t,n)=>{const{onFocus:o,onAccept:r}=n;return(0,S.jsx)(m.bI,{...e,title:w.newPageInName,blocksToTransform:t.blocks,onFocus:o,onAccept:r?()=>r(x,t,void 0):void 0})},action:e=>{}});const I=(0,_.$J)({key:"turn into actions",title:w.turnIntoSection,render:e=>(0,S.jsx)(p.Z,{...e}),actions:function(){const e=(0,l.Yd)(r.Zi),t=e.findIndex((e=>"page"===e)),n=e.map((e=>C(e))),o=Object.values(r.MF).map((e=>C(e)));return[...n.slice(0,t+1),x,...n.slice(t+1),...o]}()});function C(e){const t=f.Hc[e],n=k[e];return{key:`turn into ${e}`,displayName:t.displayName,analyticsName:t.analyticsName,analyticsActionType:"turn_block_into",searchName:t.searchName,validators:s.oA([g.J5S,n?void 0:g.wFS,h.c,"transclusion_container"===e?g.xDy([g.ffD(g.wTx),T]):void 0,"slide"===e?g.zqE:void 0,(0,r.sX)(e)?e=>1===e.blocks.length:void 0,(0,r.UW)(e)?e=>!1:void 0,"column_list"===e?e=>{if(!e.blocks)return!1;const t=e.blocks.length;if(t<2||t>5)return!1;const n=e.blocks[0].getParentBlockStore();if(!n)return!1;const o=e.blocks.map((e=>{const t=e.getParentBlockStore();return(null==t?void 0:t.id)!==n.id?-1:n.getRenderableContentIds().indexOf(e.id)}));for(let r=0;r<o.length;r++)if(r>0&&o[r-1]+1!==o[r])return!1;return!0}:void 0,(0,r.Fx)(e)?()=>!0:void 0,"mermaid_code_block"===e?()=>!1:void 0]),shortcuts:"transclusion_container"===e?["group"]:void 0,closeParentMenu:!0,action:t=>{let{environment:n,blocks:o}=t;c.createAndCommit({userAction:`actionRegistry.turnIntoAction.${e}`,environment:n,perform:t=>{d.Cj({environment:n,blocks:o,blockType:e,transaction:t})}})},render:(e,n)=>{const o=function(e,t){const n=e.blocks[0];if(!n)return!1;const o=n.getType()===t.blockType;if(o&&("header"===t.blockType||"sub_header"===t.blockType||"sub_sub_header"===t.blockType)){const e=n.getFormat().toggleable;return!(e&&!t.key.includes("toggle"))&&!(!e&&t.key.includes("toggle"))}return o}(n,t);return(0,S.jsx)(u.Z,{...e,...t,title:t.displayName,format:u.Q.TurnInto,selected:o})},nativeImageReference:n=>{if((0,b.Y)("supportsNativeMobileDynamicActionBar")){const t=o.Z.images.mab,r=`${s.eV(e)}Svg`,i=(0,a.gh)({theme:n.environment.ThemeModeStore.state});return{imageUrl:t[r],imageTintColor:(0,a.J1)(i.icon.secondary)}}return(0,_.aS)({thumbnail:t.thumbnail})}}}function T(e){return!(0,v.K)()||g.DaG()&&g.ECq(e)}},352229:(e,t,n)=>{n.d(t,{k:()=>u});n(21703);var o=n(815145),r=n(541432),i=n(421202),a=n(870279),s=n(95477),l=n(798165),c=n(206258),d=n(709953);function u(e){const{environment:t,parentBlockStore:n,targetStore:u,transaction:p,isPagePreview:m}=e;if(!u.isDefined())throw new Error("Target store was not defined.");if(!n.isDefined())throw new Error("Parent block store was not defined.");const g=u instanceof c.G;let f;if(!g){if(l.Dg(u)&&u.isDefined()){const e=u.getParentStore(),t=null==e?void 0:e.getParentStore();var h;if(null!=e&&e.isDefined())f=null==t||null===(h=t.getModel())||void 0===h?void 0:h.getRenderUrl({getRecordModel:u.getRecordModel,baseUrl:s.default.domainBaseUrl,discussionId:e.id,pageVisitSource:o.tY.LinkInPage})}}const v=d.j4({environment:t,type:r.Ti.alias,format:{alias_pointer:{table:g?i.iU:a.x_,id:u.id,spaceId:u.getSpaceId()},comment_alias_url:f,alias_page_preview:m||void 0},spaceId:n.getSpaceId(),useCrdt:n.useCrdt(),inMemoryRecordCache:n.inMemoryRecordCache,transaction:p}).pointer.id;return c.G.createChildStore(n.getContentStore(),{table:i.iU,id:v,spaceId:n.getSpaceId()})}},988150:(e,t,n)=>{n.d(t,{x:()=>c,b:()=>l});var o=n(214976),r=n(58202),i=n(885305),a=n(855337);var s=n(524677);function l(e){let{blockStore:t,entrypoint:n,environment:o}=e;const r=!t.getPropertyValue("alt_text");i.Z.setState({open:!0,blockStore:t,originRect:d(t),isEmptyOnOpen:r}),function(e,t){a.K4(e,"alt_text_open",t)}(o,{entrypoint:n,is_empty:r})}function c(e){let t=0,n=!1;const r=i.Z.state.blockStore;i.Z.state.open&&null!=r&&r.getPropertyValue("alt_text")&&(t=(0,o.Xh)(r.getPropertyValue("alt_text"),r).length,n=i.Z.state.isEmptyOnOpen),function(e,t){a.K4(e,"alt_text_close",t)}(e,{number_of_characters:t,did_create:n}),i.Z.setState({open:!1,blockStore:r}),s.ZH({environment:e})}function d(e){var t;const n=r.R.findNodeFromStore(e);return n&&n instanceof Element?null===(t=n.querySelector(".altTextBlockButton"))||void 0===t?void 0:t.getBoundingClientRect():void 0}},250906:(e,t,n)=>{n.d(t,{$X:()=>be,$q:()=>U,Af:()=>Ae,Al:()=>Q,Bb:()=>v,By:()=>We,CB:()=>J,DB:()=>Ke,DC:()=>rt,FT:()=>Te,Fj:()=>Ge,H6:()=>Y,Hc:()=>Be,IM:()=>we,JE:()=>ie,Ji:()=>z,Jr:()=>k,K1:()=>se,K9:()=>I,KI:()=>Ne,LE:()=>te,Lf:()=>it,Md:()=>Ye,Mz:()=>R,NM:()=>h,Op:()=>je,P$:()=>ge,PL:()=>Me,P_:()=>tt,Py:()=>x,R9:()=>nt,RO:()=>_e,Rb:()=>ze,Rc:()=>j,TJ:()=>Ve,UJ:()=>P,V:()=>Le,VJ:()=>Oe,V_:()=>T,WF:()=>de,XW:()=>f,XX:()=>me,YM:()=>Se,YO:()=>y,YU:()=>F,ZZ:()=>G,Zr:()=>fe,Zz:()=>ot,_H:()=>Z,_k:()=>oe,a_:()=>re,ct:()=>S,dh:()=>C,du:()=>De,eT:()=>M,eW:()=>ce,en:()=>ve,f7:()=>$e,fE:()=>dt,fM:()=>ye,g0:()=>Fe,gL:()=>st,gP:()=>ue,g_:()=>Pe,gl:()=>Ue,gw:()=>X,iA:()=>ke,iR:()=>W,iS:()=>b,ie:()=>g,ik:()=>K,jR:()=>w,j_:()=>ct,jd:()=>lt,kB:()=>pt,kq:()=>qe,l7:()=>Ze,lf:()=>ne,mt:()=>A,n2:()=>Ie,nX:()=>mt,ne:()=>ee,nl:()=>_,q7:()=>ut,qD:()=>et,r5:()=>L,rv:()=>E,sG:()=>B,sS:()=>He,sd:()=>D,tM:()=>H,tn:()=>Re,tx:()=>Ee,uD:()=>ae,ud:()=>pe,vN:()=>at,wd:()=>O,wy:()=>xe,xb:()=>N,xh:()=>Ce,y:()=>Je,y4:()=>Qe,y9:()=>V,yT:()=>le,yj:()=>he,zI:()=>$,ze:()=>q});var o=n(701302),r=n(460341),i=n(109852),a=n(307032),s=n(855337),l=n(721429),c=n(368585),d=n(512955),u=n(385555),p=n(27724),m=n(117224);function g(e,t){s.$A({environment:e,userId:(0,a.F9)(t.user_id),traits:{...t,...t.tags?{original_tags:t.tags}:void 0,user_id:(0,a.F9)(t.user_id)}})}function f(e,t){s.$A({environment:e,userId:(0,a.F9)(t.user_id),traits:{...t,user_id:(0,a.F9)(t.user_id)}})}async function h(){await s.NM()}async function v(e){const{environment:t,experiment_id:n,experiment_group:o,experiment_version:r,logging_source:a}=e,l=(0,i.Ag)(n),c=await d.getExperimentDeviceId(t);Boolean(l)&&l===(0,i.So)(r,o)||(s.K4(t,"experiment_exposure",{experiment_id:n,experiment_group:o,experiment_version:r,experiment_device_id:c,logging_source:a}),(0,i.UJ)(n,o,r))}function y(e){s.K4(e,"delete_workspace_click"),u.default.logEvent("delete_workspace_click")}function b(e){s.K4(e,"quick_workspace_creation_click"),u.default.logEvent("quick_workspace_creation_click")}function _(e){s.K4(e,"workspace_invite_copy_link"),u.default.logEvent("workspace_invite_copy_link")}function S(e,t){s.lu(e,"edit_block_text_60","edit_block_text_60",60,t)}function k(e,t){s.K4(e,"todo_block_check",t)}function w(e,t){s.K4(e,"toggle_block_toggle")}function x(e,t){s.K4(e,"equation_block_edit",t)}function I(e,t){s.K4(e,"view_link_preview",t)}function C(e,t){o.default.afterNextFlush((()=>{let n;const o=p.default.state.stores[0];o&&(n=o.getType());const{parentTeamStore:r,...i}=t;m.ej(e,"block_action",`block_action-${t.analyticsName}-${t.from}-${t.block_id}`,60,{store:r,...i,final_block_type:n})}))}function T(e){s.K4(e,"open_slash_menu")}function M(e){s.K4(e,"click_add_menu")}function P(e,t){s.K4(e,"edit_lock_toggle",t)}function A(e,t){s.K4(e,"rich_text_menu_click",t)}function R(e,t){s.K4(e,"update_page_section_visibility",t)}function D(e,t,n){s.K4(e,t,n)}function B(e,t){s.K4(e,"board_item_delete_newly_created",t)}function E(e,t,n){if(!0===n)s.K4(e,"edit_block_property_60",t);else{const n=(0,l.zj)(),{property_type:o,collection_id:r,collection_view_id:i}=t;s.lu(e,"edit_block_property_60",`edit_block_property_60-${n||""}-${o||""}-${r||""}-${i||""}`,60,t)}}function F(e,t){s.K4(e,"click_block_property_url",t)}function Z(e,t){s.K4(e,"create_property",t),u.default.logEvent("create_property",String(Boolean(t.is_suggested_property)),t)}function U(e,t){s.K4(e,"configure_property",t)}function V(e,t){s.K4(e,"delete_property",t),u.default.logEvent("delete_property")}function N(e,t){s.K4(e,"create_view",t)}function O(e,t){s.K4(e,"configure_view",t)}function L(e,t){s.K4(e,"view_settings",t),u.default.logEvent("view_settings",t.menu,t)}function j(e,t){s.K4(e,"delete_view",t)}function K(e,t){s.K4(e,"collection_search",t)}function z(e,t){s.K4(e,"open_collection_as_page",t)}function q(e){s.K4(e,"collection_no_date_menu_add")}function H(e){s.K4(e,"collection_no_date_menu_view")}function G(e,t){s.K4(e,"relation_database_click",t)}function W(e,t){s.lu(e,"timeline_view","timeline_view",5,t)}function $(e,t){s.K4(e,"timeline_zoom_level_update",t)}function Y(e,t){s.K4(e,"timeline_today_click",t)}function Q(e,t){s.K4(e,"timeline_shift_time_click",t)}function J(e,t){s.K4(e,"timeline_toggle_table_click",t)}function X(e,t){s.K4(e,"timeline_item_scroll_arrow_click",t)}function ee(e,t){s.K4(e,"timeline_item_resize",t)}function te(e,t){s.K4(e,"timeline_dependency_arrow_add",t)}function ne(e,t){s.K4(e,"timeline_dependency_arrow_delete",t)}function oe(e,t){s.K4(e,"subitem_toggle_block_open",t)}function re(e,t){s.K4(e,"subitem_toggle_block_close",t)}function ie(e,t){s.K4(e,"create_subitem",t)}function ae(e){s.K4(e,"inline_collection_load_more_click")}function se(e,t){s.K4(e,"relation_show_as",t)}function le(e,t){s.K4(e,"relation_reorder",t)}function ce(e,t){s.K4(e,"relation_add_block",t)}function de(e,t){s.K4(e,"relation_remove_block",t)}function ue(e,t){s.K4(e,"relation_customize_displayed_properties",t)}function pe(e,t){s.K4(e,"relation_section_link_pages",t)}function me(e,t){s.K4(e,"relation_navigate_block",t)}function ge(e,t){s.K4(e,"relation_update_property_visibility",t)}function fe(e,t){s.K4(e,"configure_rollup_relation",t)}function he(e,t){s.K4(e,"configure_rollup_target_property",t)}function ve(e,t){s.K4(e,"configure_rollup_aggregation",t)}function ye(e,t){s.K4(e,"collection_table_drag_and_fill",t)}function be(e,t){s.K4(e,"complete_sprint_action",t)}function _e(e,t){const{collectionContextStore:n}=t.optionalAnalyticsProperties||{},o=(0,c.Pn)(n)||{},r={from:t.from,block_types:t.draggedTypes,block_count:t.draggedTypes.length,as_copy:t.asCopy||!1,draggable:t.draggableProps,dropzone:t.dropzoneProps,...o};s.K4(e,"drag",r)}function Se(e,t){s.K4(e,"click_selection_menu",{block_type:t.blockType})}function ke(e,t){s.K4(e,"inline_equation_edit",t)}function we(e,t){s.K4(e,"set_reminder",{date:t.date,reminder:t.reminder})}function xe(e){s.K4(e,"resize_column")}function Ie(e){s.K4(e,"reset_column_sizes")}function Ce(e){s.K4(e,"create_column_list")}function Te(e,t){s.K4(e,"insert_column",t)}function Me(e,t){s.K4(e,"drag_near_edge_scroll",t)}function Pe(e,t){s.K4(e,"transform_text_block_filter",t)}function Ae(e,t){s.K4(e,"unicode_filter",t)}function Re(e,t){s.K4(e,"annotation_filter",t)}function De(e,t){s.K4(e,"keyboard_annotation",t)}function Be(e,t){s.K4(e,"link_filter",t)}function Ee(e,t){s.K4(e,"change_email",t)}function Fe(e,t){s.K4(e,"toggle_allow_search_engine_indexing",t)}function Ze(e,t){s.K4(e,"toggle_allow_duplicate",t)}function Ue(e,t){s.K4(e,"restrict_permissions",t)}function Ve(e,t){s.K4(e,"restore_permissions",t)}function Ne(e,t){s.K4(e,"set_database_sync_permissions",t)}function Oe(e,t){let{source:n,types:o,fileExtensions:r,htmlContent:i}=t;const a=[...o];a.sort();const l=r.map((e=>e.toLowerCase()));s.K4(e,"paste",{source:n,types:a,file_extensions:l,original_html_content_size:i.length},{sampling:{behavior:"custom",sampleRate:u.default.getConfigKey("paste_event_logging","samplePercentage")||s.ZQ()||0}})}function Le(e){s.K4(e,"open_breadcrumb_current_page_menu")}function je(e){s.K4(e,"click_breadcrumb_current_page_scroll_to_top")}function Ke(e,t){s.K4(e,"open_page_share",t),u.default.logEvent("open_page_share")}function ze(e,t){s.K4(e,"close_page_share",t)}function qe(e){s.K4(e,"open_more_menu")}function He(e){s.K4(e,"open_more_connections_menu")}function Ge(e){s.K4(e,"open_public_more_menu")}function We(e){s.K4(e,"confirm_app_update")}function $e(e,t){s.K4(e,"show_page_reload_confirmation_dialog",t)}function Ye(e,t){s.K4(e,"export",t)}function Qe(e,t){s.K4(e,"export_failed",t)}function Je(e,t){s.K4(e,"open_history",{from:t})}function Xe(e){return Date.now()-parseInt(e.timestamp)}function et(e,t){s.K4(e,"select_snapshot",{ageMs:Xe(t)})}function tt(e,t){s.K4(e,"history_copy",{ageMs:Xe(t)})}function nt(e,t){s.K4(e,"restore_snapshot",{ageMs:Xe(t)})}function ot(e,t){var n;s.K4(e,"fork_page",{blockId:t},{dontWait:!0}),u.default.logEvent("fork_page",(0,r.Q)(null===(n=document.location)||void 0===n?void 0:n.hostname))}function rt(e,t){s.K4(e,"offline_access_failure",t)}function it(e,t){s.K4(e,"full_screen_action",t)}function at(e){s.K4(e,"admin_content_search_analytics_acknowledge_confirm")}function st(e,t){s.K4(e,"admin_content_search_analytics_filter_change",t)}function lt(e,t){s.K4(e,"admin_content_search_analytics_queried",t)}function ct(e,t){s.K4(e,"admin_content_search_analytics_export_requested",t)}function dt(e){s.K4(e,"click_sidebar_student_org_promo")}function ut(e){s.K4(e,"click_student_org_logged_out_notice")}function pt(e){s.j({environment:e,event:{eventName:"click_github_student_pack_logged_out_notice",eventProperties:{}}})}function mt(e,t){s.j({environment:e,event:{eventName:"factory_block_upgrade",eventProperties:t}})}},232317:(e,t,n)=>{n.d(t,{C6:()=>b,Dq:()=>h,Io:()=>l,L1:()=>p,PL:()=>g,QF:()=>S,T1:()=>d,U5:()=>v,VT:()=>u,XT:()=>_,jM:()=>y,kd:()=>f,tO:()=>m});var o=n(779946),r=n(937850),i=n(215010),a=n(258455),s=n(80444);function l(e){o.j({device:e.device,cookieService:e.cookieService,event:{google:{eventName:"registration"}},source:"client"}),(async()=>{const t=await async function(){var e;return await(0,r.OI)(2500,(null===(e=s.default.state.currentUserSettingsStore)||void 0===e?void 0:e.waitUntil((()=>{var e;return void 0!==(null===(e=s.default.state.currentUserSettingsStore)||void 0===e||null===(e=e.getSettings())||void 0===e?void 0:e.domain_type)})))||Promise.resolve()),(0,i.JF)()}();!function(e,t){const{hashed_user_id:n}=a.default.state;c(e,{event:"sign_up_flow_complete",data:{domainType:t,metaEventId:n}})}(e,t)})()}function c(e,t){o.j({device:e.device,cookieService:e.cookieService,event:{google:{eventName:"custom",data:t}},source:"client"})}function d(e){c(e,{event:"sign_up_flow_start"})}function u(e,t){const{planType:n,subscriptionTier:o,domainType:r}=t;n&&"team"===n?c(e,{event:"create_space",data:{planType:n}}):o&&c(e,{event:"create_space",data:{subscriptionTier:o,domainType:r}})}function p(e,t){c(e,{event:"professional_workspace_created",data:t})}function m(e,t){c(e,{event:"team_workspace_created",data:t})}function g(e){c(e,{event:"onboarding_complete"})}function f(e,t){c(e,{event:"workspace_first_invite_sent",data:t})}function h(e){c(e,{event:"professional_workspace_first_invite_sent"})}function v(e,t){c(e,{event:"workspace_upgraded",data:t})}function y(e){c(e,{event:"professional_workspace_upgraded"})}function b(e){c(e,{event:"team_workspace_upgraded"})}function _(e){c(e,{event:"ai_addon_purchased"})}function S(e,t){c(e,{event:"trial_apply_attempt",data:t})}},10910:(e,t,n)=>{n.d(t,{Bp:()=>h,HC:()=>g,NF:()=>s,RL:()=>d,Tl:()=>m,UD:()=>k,Vo:()=>c,WP:()=>b,Xw:()=>f,_e:()=>p,bd:()=>S,g_:()=>v,hi:()=>w,ov:()=>y,qG:()=>u,rT:()=>l,zi:()=>_});var o=n(828344),r=n(855337),i=n(521273),a=n(385555);function s(e,t){const{user_comment:n,...o}=t;r.K4(e,"ai_action",o)}function l(e,t,n){const o={site:"client",...n};r.K4(e,t,o)}function c(e,t){r.K4(e,"ai_favorite_action",t)}function d(e,t){r.K4(e,"ai_block_action",t)}function u(e,t){r.K4(e,"ai_autofill_action",t),a.default.logEvent("ai_autofill_action",1,{action_type:t.type})}function p(e,t){r.K4(e,"ai_autofill_settings_action",t)}function m(e,t){if(i.Z.isXMLAssistantEnabled()){var n;const r=(null===(n=t.sessionContext)||void 0===n?void 0:n.evaluator.getTranscript())??[];(0,o.trackAssistantOpened)(e,{from:"assistant_writer",sessionId:t.session_id,isReminder:!1,reminderType:void 0,startTimestamp:Date.now(),transcript:r,hasQuery:!1,searchSessionId:void 0})}else r.K4(e,"ai_completion_popup_open",{session_id:t.session_id,prompt_key:t.prompt_key,from:t.from})}function g(e,t){r.K4(e,"ai_completion_popup_close",t),a.default.logEvent("ai_completion_popup_close",1,{exit_type:t.exit_type})}function f(e,t){r.K4(e,"ai_completion_popup_retry",t)}function h(e,t){r.K4(e,"ai_completion_popup_history_navigation",t)}function v(e,t){r.K4(e,"ai_completion_popup_preview_start",t),a.default.logEvent("ai_completion_popup_preview_start",1,{from:t.from,prompt_key:t.prompt_key})}function y(e,t){r.K4(e,"ai_completion_popup_update_prompt_text",t)}function b(e,t){r.K4(e,"ai_completion_popup_preview_end",t),a.default.logEvent("ai_completion_popup_preview_end",1,{preview_time:t.preview_time})}function _(e,t){r.K4(e,"ai_completion_popup_preview_stopped_by_user",t)}function S(e,t){r.K4(e,"ai_user_data_sharing_opt_in_submit",t)}function k(e,t){r.K4(e,"getCompletion.emptyResponse",t),a.default.logEvent("getCompletion.emptyResponse",1,{promptKey:t.promptKey})}function w(e,t){r.K4(e,"ai_assistant_error",t)}},108406:(e,t,n)=>{n.d(t,{$q:()=>h,Ac:()=>k,Rc:()=>v,S$:()=>b,YU:()=>x,_H:()=>d,bn:()=>M,g2:()=>C,gd:()=>I,gl:()=>f,mH:()=>u,nS:()=>g,qm:()=>w,rv:()=>_,tW:()=>T,tf:()=>P,wd:()=>m,xb:()=>p,y9:()=>y,zF:()=>S});var o=n(401898),r=n(855337),i=n(368585),a=n(966603),s=n(277181),l=n(250906),c=n(492973);function d(e){const{environment:t,collectionContextStore:n,...o}=e,r=(0,i.Pn)(n)||{};l._H(t,{...r,...o})}function u(e,t){r.K4(e,"collection_create_suggested_property_latency",t)}function p(e){const{environment:t,collectionContextStore:n,view_type:o,view_config_uri:r,...a}=e,s=(0,i.Pn)(n)||{};l.xb(t,{...s,...a,view_type:o,view_config_uri:r})}function m(e){const{environment:t,collectionContextStore:n,action:o,original_view_type:r,new_view_type:a,new_view_id:s,property_type:c,new_date_shift_mode:d,new_avoid_weekends:u,charts_analytics_context:p}=e,m=(0,i.Pn)(n);m&&m.view_type&&l.wd(t,{action:o,...m,view_type:m.view_type,original_view_type:r,new_view_type:a,new_view_id:s,property_type:c,new_date_shift_mode:d,new_avoid_weekends:u,charts_analytics_context:p})}function g(e){const t=(0,i.Pn)(e.collectionContextStore);t&&t.view_type&&c.MU(e.environment,{from:e.from,from_peek_mode:e.from_peek_mode,...t,view_type:t.view_type})}function f(e){const{peek_mode:t,from_peek_mode:n}=e,o=(0,i.Pn)(e.collectionContextStore);o&&o.view_type&&c.lg(e.environment,{from:e.from,peek_mode:t,from_peek_mode:n,...o,view_type:o.view_type})}function h(e){const{environment:t,collectionContextStore:n,property:o,from:r,action:a,new_property_type:s,...c}=e,d=n.normalizedSchemaStore.state[o],u=(0,i.Pn)(n)||{};l.$q(t,{property_type:null==d?void 0:d.type,new_property_type:s,property:o,from:r,action:a,...c,...u})}function v(e){const{environment:t,collectionContextStore:n,view_type:o,from:r,...a}=e,s=(0,i.Pn)(n)||{};l.Rc(t,{from:r,...a,...s,view_type:o})}function y(e){const{environment:t,collectionContextStore:n,property_type:o,from:r,property:a,...s}=e,c=(0,i.Pn)(n)||{};l.y9(t,{property:a,property_type:o,from:r,...s,...c})}function b(e,t,n){var a,s,l;let c="page_properties";const d=(0,i.Pn)(t);switch(d.view_type){case void 0:case"page":case"table":c="table";break;case"list":c="list";break;case"gallery":c="gallery";break;case"board":c="board";break;case"calendar":c="calendar";break;case"timeline":c="timeline";break;case"chart":case"form_editor":break;default:(0,o.t1)(d.view_type)}const u={...n,collection_id:null==t||null===(a=t.collectionStore())||void 0===a?void 0:a.id,collection_view_id:null==t||null===(s=t.collectionViewStore())||void 0===s?void 0:s.id,collection_view_block_id:null==t||null===(l=t.collectionViewBlockStore())||void 0===l?void 0:l.id,from:c};r.K4(e,"copy_property",u)}function _(e){var t;const{environment:n,collectionContextStore:o,block_id:r,property:a,property_type:c,from:d,isFromBulkActionsToolbar:u,isUnthrottled:p,collection_id:m,...g}=e,f=(0,i.Pn)(o,m)||{};let h;if(null!==(t=o.currentSubitemFormatStoreForCollectionStore.state)&&void 0!==t&&t.property){h=(0,s.EK)({blockId:r,collectionContextStore:o})?"subitem":"parent_item"}else o.currentArrowsByFormatStore.state&&(h="timeline_arrows_by");l.rv(n,{block_id:r,property:a,property_type:c,property_context:h,from:d,isFromBulkActionsToolbar:u,...g,...f},p||!1)}function S(e){const{environment:t,collectionContextStore:n,property:o,property_type:a,from:s,isFromBulkActionsToolbar:l,...c}=e,d=(0,i.Pn)(n)||{};r.K4(t,"collection_open_block_property_overlay",{property:o,property_type:a,property_context:undefined,from:s,isFromBulkActionsToolbar:l,...c,...d})}function k(e){const{environment:t,collectionContextStore:n,checkbox_type:o,...a}=e,s=(0,i.Pn)(n)||{};r.K4(t,"collection_multi_select_checkbox_clicked",{...s,checkbox_type:o,...a})}function w(e){const{environment:t,collectionContextStore:n,property_type:o,num_rows:r}=e,a=(0,i.Pn)(n)||{};l.fM(t,{property_type:o,num_rows:r,...a})}function x(e){const{environment:t,collectionContextStore:n,...o}=e,r=(0,i.Pn)(n)||{};l.YU(t,{...r,...o})}function I(e){const{environment:t,collectionContextStore:n,...o}=e,a=(0,i.Pn)(n)||{};r.K4(t,"convert_db_start",{...a,...o})}function C(e){const{environment:t,collectionContextStore:n,...o}=e,a=(0,i.Pn)(n)||{};r.K4(t,"convert_db_complete",{...a,...o})}function T(e){const{environment:t,totalResults:n,clickedIndex:o,eventName:i,sessionId:s,source:l,queryLength:c}=e;let d;l===a.S7.Automation?d="automation_collection_picker":l===a.S7.Relation?d="collection_settings_select_relation_source":l===a.S7.Source&&(d="collection_settings_source");const u=Boolean(0===c);r.K4(t,i,{source:d,"server-indexAlias":"collection",totalResults:n,clickedIndex:o,sessionId:s,queryLength:c,isEmptyQuery:u})}function M(e){r.K4(e,"collection_load_more_blocks")}function P(e){r.K4(e,"collection_load_more_groups")}},585344:(e,t,n)=>{n.d(t,{$5:()=>u,Em:()=>x,Je:()=>l,Rn:()=>c,SU:()=>S,Tw:()=>a,Uw:()=>k,Yz:()=>m,ZW:()=>s,Zq:()=>I,bR:()=>f,d2:()=>v,hJ:()=>_,jX:()=>g,k$:()=>y,lL:()=>p,pP:()=>w,x6:()=>h,yr:()=>d,zd:()=>b});var o=n(249902),r=n(855337),i=n(385555);function a(e,t){r.j({environment:e,event:{eventName:"click_updates_sidebar_empty_comments_cta",eventProperties:t}})}function s(e,t){r.K4(e,"open_block_discussion_menu",t)}function l(e){let{environment:t,from:n,notificationId:o,activityId:i}=e;r.K4(t,"open_reply_discussion_menu",{from:n,notificationId:o,activityId:i})}function c(e){let{environment:t,from:n,notificationId:o,activityId:i}=e;r.K4(t,"close_reply_discussion_menu",{from:n,notificationId:o,activityId:i})}function d(e,t){r.K4(e,"open_new_block_discussion",t)}function u(e,t){r.K4(e,"open_new_inline_discussion",t)}function p(e){r.K4(e,"discard_new_discussion_dialog_show")}function m(e){r.K4(e,"discard_new_discussion_dialog_confirm")}function g(e){r.K4(e,"discard_new_discussion_dialog_cancel")}function f(e,t){r.K4(e,"create_block_discussion",t),i.default.logEvent("create_block_discussion"),o.j({name:"create_block_discussion"})}function h(e,t){r.K4(e,"create_inline_discussion",t),i.default.logEvent("create_inline_discussion"),o.j({name:"create_inline_discussion"})}function v(e,t){r.j({environment:e,event:{eventName:"add_comment",eventProperties:t}}),i.default.logEvent("add_comment",t.from),o.j({name:"add_comment"})}function y(e,t){r.K4(e,"delete_comment",t)}function b(e,t){r.j({environment:e,event:{eventName:"edit_comment",eventProperties:t}})}function _(e,t){r.K4(e,"resolve_discussion",t),i.default.logEvent("resolve_discussion",t.from)}function S(e,t){r.K4(e,"reopen_discussion",t)}function k(e,t){r.K4(e,"click_discussion",t)}function w(e){const{environment:t,...n}=e;r.j({environment:t,event:{eventName:"add_reaction",eventProperties:n}}),i.default.logEvent("add_reaction",n.reaction_value),o.j({name:"add_reaction"})}function x(e){const{environment:t,...n}=e;r.K4(t,"remove_reaction",n)}function I(e,t){r.K4(e,"comment_upload_attachments",t)}},100952:(e,t,n)=>{n.d(t,{W:()=>l,t:()=>c});var o=n(653965),r=n(855337),i=n(224646),a=n(117224);const s=o.P2((e=>{r.Zf(e,{created_page:!0})}),864e5,{trailing:!1});function l(e,t){const{teamStore:n,new_page_id:o,...r}=t;let l=60;"chart"===t.view_type&&(l=1),a.ej(e,"create_block",`create_block-${t.type}-${t.from}`,l,{store:n,...r}),"page"===t.type&&(a.YP(e,"create_page",{store:n,...r,new_page_id:o,...(0,i.UF)({environment:e})}),s(e))}function c(e,t){"onboarding"===t.from?function(e,t){const{teamStore:n,...o}=t;a.YP(e,"create_onboarding_page",{store:n,...o})}(e,{from:t.from,teamStore:t.teamStore,forkedTemplateId:t.pageId}):l(e,{type:"page",from:t.from,teamStore:t.teamStore,new_page_id:t.pageId,creating_block_id:t.pageId})}},288864:(e,t,n)=>{n.d(t,{E5:()=>p,Fn:()=>i,Gl:()=>g,Jg:()=>m,QI:()=>l,QU:()=>f,Uk:()=>s,Wl:()=>a,X0:()=>d,el:()=>c,mC:()=>u});var o=n(218265),r=n(855337);function i(e,t){(0,r.j)({environment:e,event:{eventName:"embed_block_action",eventProperties:t}})}function a(e,t){(0,r.j)({environment:e,event:{eventName:"embed_block_resize",eventProperties:t}})}function s(e,t){(0,r.j)({environment:e,event:{eventName:"download_file",eventProperties:t}})}function l(e,t){(0,r.j)({environment:e,event:{eventName:"file_open_attempt",eventProperties:t}})}function c(e,t){const n=(0,o.gy)(t.url);(0,r.j)({environment:e,event:{eventName:"open_embed_menu",eventProperties:{url_domain:null==n?void 0:n.hostname}}})}function d(e,t){let n;n=void 0===t.url?void 0:t.url.includes("mailto:")?t.url:(0,o.Qc)(t.url).hostname,(0,r.j)({environment:e,event:{eventName:"click_embed_menu",eventProperties:{url_domain:n,type:t.type}}})}function u(e,t){(0,r.j)({environment:e,event:{eventName:"url_turned_bookmark",eventProperties:{}}})}function p(e,t){(0,r.j)({environment:e,event:{eventName:"link_mention_shows_placeholder",eventProperties:t}})}function m(e,t){(0,r.j)({environment:e,event:{eventName:"embed_type",eventProperties:t}})}function g(e,t){(0,r.j)({environment:e,event:{eventName:"embed_render",eventProperties:t}})}function f(e,t){(0,r.j)({environment:e,event:{eventName:"embed_client_error",eventProperties:t}})}},815978:(e,t,n)=>{n.d(t,{aM:()=>i,b5:()=>c,e2:()=>a,f1:()=>s,m0:()=>l,m9:()=>r,yu:()=>d});var o=n(855337);function r(e,t){(0,o.j)({environment:e,event:{eventName:"home_checklist_impression",eventProperties:{checklist_type:t}}})}function i(e,t,n){(0,o.j)({environment:t,event:{eventName:"home_checklist_item_selected",eventProperties:{checklist_item:e,checklist_type:n}}})}function a(e,t,n,r){(0,o.j)({environment:n,event:{eventName:"home_checklist_button_clicked",eventProperties:{checklist_item:e,button:t,checklist_type:r}}})}function s(e,t,n){(0,o.j)({environment:e,event:{eventName:"home_checklist_item_finished",eventProperties:{checklist_item:t,checklist_type:n}}})}function l(e,t){(0,o.j)({environment:e,event:{eventName:"home_checklist_all_finished",eventProperties:{checklist_type:t}}})}function c(e,t){(0,o.j)({environment:e,event:{eventName:"home_checklist_auto_hide",eventProperties:{checklist_type:t}}})}function d(e,t){(0,o.j)({environment:e,event:{eventName:"home_checklist_home_topbar_tooltip_showed",eventProperties:{checklist_type:t}}})}},368425:(e,t,n)=>{n.d(t,{VJ:()=>a,fA:()=>l,kz:()=>s,xu:()=>i});var o=n(855337),r=n(385555);function i(e){o.K4(e,"open_emoji_menu")}function a(e,t){const{searchQuery:n,...r}=t;o.K4(e,"emoji_no_results",r)}function s(e,t,n){o.K4(e,t,n)}function l(e,t,n){o.K4(e,t,n),r.default.logEvent(t,n.icon)}},659301:(e,t,n)=>{n.d(t,{M:()=>i,Z:()=>a});var o=n(855337),r=n(318245);function i(e,t){o.K4(e,"image_uploaded",t)}function a(e,t){r.default.DO_NOT_USE_markLegacy("image_edit_load"),o.K4(e,"image_edit_open",t)}},757549:(e,t,n)=>{n.d(t,{AS:()=>X,B3:()=>re,BI:()=>B,Cm:()=>V,D:()=>$,D6:()=>C,DU:()=>Z,DW:()=>G,EJ:()=>F,EU:()=>le,FB:()=>O,FI:()=>b,G7:()=>k,Gl:()=>S,IG:()=>Y,IN:()=>q,IV:()=>N,Iv:()=>ee,L3:()=>v,Mp:()=>oe,Ng:()=>E,PR:()=>U,SC:()=>ie,SO:()=>x,Sy:()=>h,Vf:()=>y,YY:()=>L,Z3:()=>_,Z9:()=>z,_x:()=>ne,a1:()=>u,ay:()=>d,bO:()=>P,cV:()=>T,eR:()=>Q,fc:()=>K,iI:()=>H,kM:()=>M,lC:()=>m,lL:()=>te,oQ:()=>ae,oS:()=>R,pZ:()=>D,pp:()=>se,qJ:()=>w,qy:()=>p,re:()=>A,tc:()=>f,tf:()=>W,uu:()=>I,uy:()=>j,wi:()=>J,y6:()=>g});var o=n(630845),r=n(218265),i=n(855337),a=n(971776),s=n(224646),l=n(385555),c=n(535057);function d(e,t){i.K4(e,"import_button_click",t)}function u(e,t){i.K4(e,"import_source_auth",t)}function p(e,t){i.K4(e,"import_source_input",t)}function m(e,t){i.K4(e,"import_file_upload",t)}function g(e,t){i.K4(e,"uploaded_file_size",t)}function f(e,t){i.K4(e,"file_upload_latency",t)}function h(e,t){i.K4(e,"open_import_modal",{...t,...(0,s.UF)({environment:e})})}function v(e,t){i.K4(e,"auth_integration",t)}function y(e,t){i.K4(e,"integration_select_all",t)}function b(e,t){i.K4(e,"integration_deselect_all",t)}function _(e,t){i.K4(e,"integration_select_item",t)}function S(e,t){i.K4(e,"integration_deselect_item",t)}function k(e,t){i.K4(e,"import_integration",t)}function w(e,t){i.K4(e,"remove_integration",t)}function x(e,t){i.K4(e,"integration_prompt_auth",t)}function I(e){i.K4(e,"open_google_drive_file_picker")}function C(e,t){i.K4(e,"google_drive_pick_file",t)}function T(e,t){i.K4(e,"google_drive_embed_file",t)}function M(e,t){i.K4(e,"unfurl_menu_option",t)}function P(e,t){const{pastedText:n}=t;let a;if(o.B(n,"url")){const e=r.Qc(n);e.host&&(a=e.host)}if(a){const{pastedText:n,...o}={...t,url_domain:a};i.K4(e,"paste_url",o)}}function A(e,t){const n=t.file.lastIndexOf("."),o=n>0?t.file.substring(n+1):"",r=c.zt();o&&i.K4(e,"file_uploads",{source:t.source,extension:o,subscriptionTier:r})}function R(e,t){const n=t.url?(0,r.gy)(t.url):void 0;i.K4(e,"edit_link",{type:t.type,url_domain:null==n?void 0:n.hostname})}function D(e){i.K4(e,"edit_link_title")}function B(e){i.K4(e,"developer_integrations_list_visit")}function E(e){i.K4(e,"developer_integrations_new_click")}function F(e,t){i.K4(e,"developer_integrations_filter_click",t)}function Z(e,t){const n=a.OS[t.table];i.K4(e,"developer_integrations_view_visit",{type:n})}function U(e,t){const n=a.OS[t.table];i.K4(e,"developer_integrations_create",{type:n})}function V(e,t){const n=a.OS[t.table];i.K4(e,"developer_integrations_view_secret",{type:n})}function N(e,t){const n=a.OS[t.table];i.K4(e,"developer_integrations_copy_secret",{type:n})}function O(e,t){const n=a.OS[t.table],{table:o,...r}=t;i.K4(e,"developer_integrations_update",{type:n,...r})}function L(e,t){i.K4(e,"developer_integrations_my_integrations_click",t)}function j(e,t){i.K4(e,"developer_integrations_all_integrations_click",t)}function K(e,t){i.K4(e,"developer_integrations_visit_developer_website_click",t)}function z(e,t){i.K4(e,"developer_integrations_contact_developer_click",t)}function q(e,t){i.K4(e,"developer_integrations_disconnect_click",t)}function H(e,t){i.K4(e,"developer_integrations_open_card_dropdown_click",t)}function G(e,t){i.K4(e,"developer_integrations_delete_click",t)}function W(e,t){i.K4(e,"developer_integrations_confirm_delete_click",t)}function $(e,t){i.K4(e,"install_public_integration_oauth",t)}function Y(e,t){i.K4(e,"security_and_compliance_integration_oauth_attempt",t)}function Q(e,t){i.K4(e,"security_and_compliance_integration_install",t)}function J(e,t){i.K4(e,"security_and_compliance_integration_uninstall",t)}function X(e,t){i.K4(e,"security_and_compliance_integration_update",t)}function ee(e,t){i.K4(e,"connect_external_integration",t),l.default.logEvent("connect_external_integration",void 0,t)}function te(e,t){i.K4(e,"disconnect_external_integration",t)}function ne(e,t){i.K4(e,"activate_link_preview_menu",t)}function oe(e,t){i.K4(e,"save_link_preview",t)}function re(e,t){i.K4(e,"update_link_preview",t)}function ie(e,t){i.K4(e,"open_link_preview_help_guide",t)}function ae(e,t){i.K4(e,"remove_link_preview_with_error",t)}function se(e,t){i.K4(e,"link_preview_url_miss",t)}function le(e,t){i.K4(e,"show_all_discoverable_connected_apps",t)}},891219:(e,t,n)=>{n.d(t,{$2:()=>M,$z:()=>B,Dg:()=>U,E0:()=>P,G:()=>V,Mq:()=>D,TC:()=>C,UW:()=>x,bR:()=>F,d:()=>A,hE:()=>I,jB:()=>w,l5:()=>k,oI:()=>Z,q_:()=>T,yE:()=>E,zx:()=>R});var o=n(133728),r=n(519889),i=n(249902),a=n(653965),s=n(307032),l=n(855337),c=n(215010),d=n(80444),u=n(385555),p=n(429677),m=n(206258),g=n(88893),f=n(535057),h=n(288280),v=n(781918),y=(n(117224),n(210228)),b=n(237181),_=n(232317);function S(e){var t;const n=e.invite_targets.filter(p.cl),r=e.invite_targets.filter(p.fZ),i=n.length+r.length,l=a.oA(e.permission_items.map((e=>{if("user_permission"===e.type)return e.user_id&&(0,s.F9)(e.user_id)}))),c=new Set(null===(t=d.default.state.currentSpaceStore)||void 0===t?void 0:t.getEmailDomains()),u=e.invite_targets.filter((e=>{if("existingUser"!==e.type&&"newUser"!==e.type)return!1;const t=(0,o.Gd)(e.value.email);return t&&c.has(t)})).flatMap((e=>e.value.id?[(0,s.F9)(e.value.id)]:[])),m=(0,f.zt)(),g=e.invitee_ids_with_internal_domain??[];return{role:e.role,user_count:i,new_user_count:n.length,new_workspace_member_count:e.is_space?i:u.length,new_workspace_member_ids:e.is_space?l:u,is_onboarding:e.is_onboarding,invite_flow_id:e.invite_flow_id,invite_origin:e.invite_origin,invitee_ids:l,invite_message_length:e.invite_message_length,subscription_tier:m,domain_type:e.domainType,...!e.is_space&&{share_menu_session_id:e.share_menu_session_id},allow_domain_auto_invite:u.length>0,is_space:e.is_space,collection_id:e.collection_id,parent_collection_id:e.parent_collection_id,is_internal_domain:g.length>0,invitee_ids_with_internal_domain:g,invitee_ids_with_internal_domain_enforced:e.invitee_ids_with_internal_domain_enforced}}function k(e,t){const n=S(t);l.K4(e,"invite_error",n)}function w(e,t){const n=(0,f.zt)(),i=S(t);l.K4(e,"invite",{...i,is_space:t.is_space}),h.subscriptionDataStoreInstance.waitUntilLoaded().then((()=>{const n=h.subscriptionDataStoreInstance.state,a=n?g.Ln(e,n):void 0,s=n?g.Lz(e,n):void 0;l.K4(e,"invite_debug_with_block_usage",{...i,is_space:t.is_space,is_over_block_limit:a,block_usage:s}),t.is_space||(!function(e,t){const{currentSpaceStore:n,currentUserStore:i}=d.default.state,a=n&&n.canEditMembership(),s=c.JF(),u=null==i?void 0:i.getEmail();if(!a||!s||!u)return;if("professional"!==s)return;const p=(0,o.Gd)(u),f=g.A7().slice(0,50).map((e=>({email:m.U6.createChildStore(n,{table:r.KJ,id:e.userId}).getEmail(),guestId:e.userId}))).filter((e=>e.email&&(0,o.Gd)(e.email)===p)).map((e=>e.guestId));l.K4(e,"page_invite_guest_summary",{...t,guest_with_same_domain_count:f.length,guest_ids:f})}(e,i),v.fN(e,{inviteTargets:t.invite_targets,origin:t.invite_origin}))})),(t.is_space||i.allow_domain_auto_invite)&&(l.K4(e,"space_invite",i),l.Zf(e,{space_invited:!0}),u.default.logEvent("space_invite",i.allow_domain_auto_invite?`${t.invite_origin}_allow_domain`:t.invite_origin,i),v.Jk(e,{invite_origin:t.invite_origin,domainType:t.domainType,new_workspace_member_count:i.new_workspace_member_count,new_workspace_member_ids:i.new_workspace_member_ids,allow_domain_auto_invite:i.allow_domain_auto_invite}),function(e,t){const n=(0,f.zt)();t.visibleMembersCount<=1&&(l.K4(e,"workspace_first_invite_sent"),_.kd(e,{subscriptionTier:n,domainType:t.domainType}),"professional"===t.domainType&&(l.K4(e,"professional_workspace_first_invite_sent",{visible_members_count:t.visibleMembersCount,is_professional_team_user:t.isProfessionalTeamUser,domain_type:t.domainType}),_.Dq(e)))}(e,{visibleMembersCount:g.qX(),isProfessionalTeamUser:t.isProfessionalTeamUser,domainType:t.domainType})),t.is_space||i.new_workspace_member_ids.length===t.invite_targets.length||(l.K4(e,"page_invite",i),u.default.logEvent("page_invite",n,i),function(e,t){const{currentUserSettingsStore:n}=d.default.state;if(!n)return;const o=n.getKeyStore("settings").getKeyStore("signup_time").getValue(),r=n.getKeyStore("settings").getKeyStore("first_page_invite_at").getValue();if(!Boolean(r)){const r=Date.now(),i={...t,...o?{signup_time_ready:!0,time_from_signup_to_first_page_invite:o-r}:{signup_time_ready:!1}};l.K4(e,"page_invite_time",i),u.default.logEvent("page_invite_time",t.subscription_tier,i),y.createAndCommit({userAction:"firstPageInvite",environment:e,userId:n.id,perform:e=>{b.d2({userSettingsStore:n,data:{first_page_invite_at:r},transaction:e})}})}}(e,i))}function x(e,t){l.K4(e,"invite_typed",t),u.default.logEvent("invite_typed",t.subscription_tier,{...t})}function I(e,t){l.K4(e,"invite_select_target",t),u.default.logEvent("invite_select_target",t.subscription_tier,{selected_user_token_rank:t.selected_user_token_rank,from:t.from,type:t.type??"permission_invite"})}function C(e,t){l.K4(e,"invite_change_role",t),u.default.logEvent("invite_change_role",t.subscription_tier,{...t})}function T(e,t){l.K4(e,"abandon_permissions_invite",t),u.default.logEvent("abandon_permissions_invite",t.subscription_tier,{...t})}function M(e,t){l.K4(e,"open_share_workspace_invite",t),u.default.logEvent("open_share_workspace_invite",t.subscription_tier,{...t})}function P(e,t){l.K4(e,"send_share_workspace",t),u.default.logEvent("send_share_workspace",t.subscription_tier,{...t})}function A(e,t){l.K4(e,"send_membership_request",t),u.default.logEvent("send_membership_request",t.subscription_tier,{...t})}function R(e,t){l.K4(e,"send_guest_request",t),u.default.logEvent("send_guest_request",t.subscription_tier,{...t})}function D(e,t){l.K4(e,"open_page_share_invite",t),u.default.logEvent("open_page_share_invite",t.subscription_tier,{...t})}function B(e){l.K4(e,"open_space_invite")}function E(e,t){l.K4(e,"invite_modal_input_focus",t)}function F(e,t){l.K4(e,"invite_users_to_page",t),i.j({name:"invite_users_to_page"})}function Z(e,t){l.K4(e,"internal_domain_enforced",t)}function U(e,t){l.K4(e,"workspace_over_guest_limit",t)}function V(e,t){l.j({environment:e,event:{eventName:"open_invite_members_modal",eventProperties:t}})}},458912:(e,t,n)=>{n.d(t,{Qq:()=>v,SK:()=>f,TI:()=>d,VN:()=>h,Yo:()=>g,Z0:()=>u,ew:()=>c,iH:()=>p,j1:()=>s,pi:()=>m,uo:()=>y,wB:()=>b,z7:()=>l});var o=n(249902),r=n(307032),i=n(855337),a=n(385555);function s(e,t){i.K4(e,"open_mention_menu",t),a.default.logEvent("open_mention_menu",void 0,t)}function l(e,t){const{clickIndexLocal:n,clickIndexGlobal:o}=t,r=void 0!==n?1/(n+1):void 0,s=void 0!==o?1/(o+1):void 0,l={...t,localReciprocalRank:r,globalReciprocalRank:s};i.K4(e,"insert_mention_from_mention_menu",l),a.default.logEvent("insert_mention_from_mention_menu",r,l)}function c(e,t){i.K4(e,"mention_menu_abandon",t),a.default.logEvent("mention_menu_abandon",void 0,t)}function d(e,t){i.K4(e,"mention_user",{mentioned_user_id:(0,r.F9)(t.user_id),mentioned_user_access_level:t.user_access_level,from:t.from,block_type:t.block_type,share_menu_selection:t.share_menu_selection}),a.default.logEvent("mention_user",t.user_access_level,t),t.is_current_user||"none"===t.user_access_level||"reader"===t.user_access_level||o.j({name:"mention_other_user"})}function u(e,t){i.K4(e,"mention_group",{mentioned_group_id:(0,r.F9)(t.group_id),from:t.from,block_type:t.block_type})}function p(e,t){i.K4(e,"hover_mention_group",{group_id:(0,r.F9)(t.group_id)})}function m(e,t){i.K4(e,"hover_page_mention_start",t)}function g(e,t){i.K4(e,"hover_page_mention_end",t)}function f(e,t){i.K4(e,"page_mention_click",t)}function h(e,t){i.K4(e,"mention_date",t)}function v(e,t){i.K4(e,"mention_page",{mentioned_page_id:(0,r.F9)(t.page_id),from:t.from,block_type:t.block_type})}function y(e,t){i.K4(e,"hyperlink_hover",t),a.default.logEvent("hyperlink_hover",t.type,void 0)}function b(e,t){i.K4(e,"link_mention_hover",t),a.default.logEvent("link_mention_hover",t.type,void 0)}},483249:(e,t,n)=>{n.d(t,{FG:()=>i,YO:()=>r,jD:()=>a,nB:()=>s,w3:()=>c,xx:()=>l});var o=n(855337);function r(e,t){o.K4(e,"tap_mobile_action_bar_item",{item_name:t.itemName,from:t.from})}function i(e){o.K4(e,"scroll_mobile_action_bar")}function a(e){o.K4(e,"open_mobile_sidebar")}function s(e,t){o.K4(e,"tap_mobile_bottom_bar_item",{...t})}function l(e){o.K4(e,"mobile_add_to_menu_accept")}function c(e,t){o.K4(e,"navigation",{...t})}},73990:(e,t,n)=>{n.d(t,{A6:()=>c,Fo:()=>r,Y8:()=>d,_T:()=>a,a6:()=>u,fW:()=>i,mf:()=>s,rY:()=>l,w6:()=>p});var o=n(855337);function r(e){o.K4(e,"click_breadcrumb_move_to")}function i(e,t){o.K4(e,"move_to_error",t)}function a(e,t){o.K4(e,"move_to",t)}function s(e,t){o.K4(e,"move_to_value_selected",t)}function l(e,t){o.K4(e,"move_to_menu_open",t)}function c(e,t){o.K4(e,"move_to_menu_cancel",t)}function d(e,t){o.K4(e,"add_editor_permission_to_ensure_undo",t)}function u(e,t){o.K4(e,"move_to_autocomplete_query_change",t)}function p(e,t){o.K4(e,"move_to_toggle_click",t)}},632441:(e,t,n)=>{n.d(t,{$k:()=>C,AM:()=>h,BR:()=>T,D6:()=>b,Es:()=>g,PB:()=>p,Pu:()=>m,Q4:()=>y,RK:()=>A,Sn:()=>I,T3:()=>S,VU:()=>x,WT:()=>P,_W:()=>f,eb:()=>k,u_:()=>M,ux:()=>_,yv:()=>w,zX:()=>v});var o=n(779946),r=n(815145),i=n(109852),a=n(937850),s=n(218265),l=n(855337),c=n(514654),d=n(224646),u=n(385555);function p(e,t){const{page_id:n,query:o,team_id:i,page_visit_id:a,previous_page_visit_id:u,marketplace_state:p,...m}=t,g=s.Ph(o,r.$X),f=parseInt(g),h="push"===e.RouterStore.getState().action,v=(0,r.bh)(f)&&h?(0,r.xt)(r.tY.LinkInPage):(0,r.xt)(f),y=s.Ph(o,r.Qs),b=c.t3({blockOrCollectionId:n}),_={eventName:"page_visit",eventProperties:{...m,page_visit_source:v,notification_id:y,page_visit_id:a,previous_page_visit_id:u,entered_at:Date.now(),home_page_type:b,marketplace_state:p,...(0,d.UF)({environment:e})}};l.j({environment:e,event:_,opts:{forceOverrideAutomaticEventData:{team_id:i}}})}function m(e,t){const{pageVisitId:n,pageVisitDuration:o,...r}=t;l.K4(e,"page_exit",{exited_at:Date.now(),visit_duration:o,page_visit_id:n},{forceOverrideAutomaticEventData:r})}function g(e){const t=[{name:"initial_partner_stack_key",value:e.partner_stack_key,operation:"setOnce"},{name:"partner_stack_key",value:e.partner_stack_key,operation:"set"}];l.fK(t)}function f(e,t){const n=s.nx(t,(0,i.x6)());if(n){const{fbclid:e,gclid:t}=n;e&&o.xx({type:"facebook",id:e}),t&&o.xx({type:"google",id:t}),(0,i.NW)(n)}l.j({environment:e,event:{eventName:"visit",eventProperties:{}}})}function h(e,t){l.K4(e,"page_error",t)}function v(e,t){l.K4(e,"page_error_button_click",t)}function y(e,t){l.K4(e,"reorder_workspaces",t)}function b(e,t){l.K4(e,"multi_account_add_or_create_account_clicked",t)}function _(e){l.K4(e,"content_classification_proceed")}function S(e,t){l.K4(e,"notion_topbar_click",t,{dontWait:!0}),u.default.logEvent("notion_topbar_click",t.variant)}function k(e,t){l.K4(e,"template_gallery_public_page_topbar_click",t,{dontWait:!0}),u.default.logEvent("template_gallery_public_page_topbar_click",t.target)}function w(e,t){l.K4(e,"getting_started_page_create",t)}function x(e,t){l.K4(e,"debug_getting_started_page_error",t)}function I(e,t){l.K4(e,"landing_page_visit",{routerName:t}),(0,a.Vs)(4e3).then((n=>{u.default.logEvent(`${t}_page_visit`,e.device.deviceType,{})}))}function C(e,t){l.K4(e,"desktop_app_signup_browser_visit",{desktop_app_reroute_email:t.desktopAppRerouteEmail,desktop_app_device_id:t.desktopAppDeviceId})}function T(e,t,n){const o=e=>({blockId:"blockId"in e?e.blockId:void 0,peekViewBlockId:"peekViewBlockId"in e?e.peekViewBlockId:void 0}),{blockId:i,peekViewBlockId:a}=o(t),{blockId:s,peekViewBlockId:c}=o(n),d="pageVisitSource"in n&&n.pageVisitSource?(0,r.xt)(parseInt(n.pageVisitSource)):void 0;l.K4(e,"click_in_page_navigation",{current_route_name:t.name,next_route_name:n.name,page_visit_source:d,current_page_id:i,current_peek_view_page_id:a,next_page_id:s,next_peek_view_page_id:c})}function M(e){l.K4(e,"public_page_topbar_edit_click",{},{dontWait:!0}),u.default.logEvent("public_page_topbar_edit_click")}function P(e){l.K4(e,"public_page_topbar_comment_click",{},{dontWait:!0}),u.default.logEvent("public_page_topbar_comment_click")}function A(e){l.K4(e,"public_page_topbar_menu_sign_up_log_in_click",{},{dontWait:!0}),u.default.logEvent("public_page_topbar_menu_sign_up_log_in_click")}},519719:(e,t,n)=>{n.d(t,{Br:()=>E,Cg:()=>L,EH:()=>V,EQ:()=>S,Ee:()=>Z,F5:()=>g,FR:()=>N,GP:()=>C,Jn:()=>M,Md:()=>K,Q6:()=>T,RJ:()=>z,U0:()=>D,Up:()=>I,Xf:()=>R,Z8:()=>_,Zh:()=>j,_H:()=>F,_b:()=>m,b2:()=>P,bE:()=>U,cC:()=>f,gM:()=>O,gY:()=>y,hI:()=>b,ix:()=>v,kL:()=>H,l2:()=>B,nI:()=>w,pw:()=>x,u_:()=>h,ub:()=>q,zD:()=>A});var o=n(427328),r=n(682813),i=n(401898),a=n(641549),s=n(116746),l=n(224646),c=n(385555),d=n(304761),u=n(717659),p=n(855337);function m(e){k({...e,target:"archive"})}function g(e){k({...e,target:"unarchive"})}function f(e){k({...e,target:"mark_as_read"})}function h(e){k({...e,target:"mark_as_unread"})}function v(e){k({...e,target:"frame"})}function y(e){k({...e,target:"open_reply_menu"})}function b(e){k({...e,target:"open_automation_view_all_notifications_menu"})}function _(e){let{environment:t,pageId:n,isCurrentlyFollowing:o,from:r,notificationId:i}=e;p.K4(t,"click_page_updates_notifications_button",{pageId:n,isCurrentlyFollowing:o,from:r,notificationId:i})}function S(e){let{environment:t,backlinkPageId:n,notificationId:o,alreadyRead:r,activity:i,tab:a}=e;k({environment:t,target:"title",notificationId:o,alreadyRead:r,activity:i,tab:a,otherArgs:{backlinkPageId:n}})}function k(e){let{environment:t,target:n,notificationId:o,alreadyRead:i,activity:a,tab:s,otherArgs:l}=e;x({environment:t,target:n});const c=d.ZP.state.sessionId;L(t,{target:n,notification_id:o,activity_id:a.id,tab:s,sessionId:c,is_filtered:d.ZP.isFilteredToUnreadOnly(),...l}),o&&r.e(p.mc(t),{alreadyRead:i,notificationId:o,activityId:a.id,from:n,sessionId:c})}function w(e){const t=d.ZP.state.sessionId;t&&(p.K4(e,"close_sidebar_updates",{sessionId:t,tab:M()}),d.ZP.endSession())}function x(e){let{environment:t,target:n}=e,o=!1;switch(n){case"title":case"body":o=!0;break;case"archive":case"unarchive":case"mark_as_read":case"mark_as_unread":case"add_reaction":case"remove_reaction":case"open_reply_menu":case"open_automation_view_all_notifications_menu":case"frame":case"main":case"approve_request_access":case"deny_request_access":o=!1;break;default:(0,i.t1)(n)}o&&w(t)}function I(e){let{environment:t,from:n}=e;const r=(0,o.w_)(t.TabbedRouterStore.state);var i;"web"===(i=r).type&&"nativeTab"===i.route.name&&"updates"===i.route.tab&&C({environment:t,from:n})}function C(e){let{environment:t,forceRestartSession:n,from:o}=e;d.ZP.startSession({forceRestart:n??!1}),function(e,t){c.default.logEvent("open_sidebar_updates",t.tab,t),p.K4(e,"open_sidebar_updates",{...t,...(0,l.UF)({environment:e})})}(t,{tab:M(),unread_notifications_count:u.aY(),sessionId:d.ZP.state.sessionId,from:o})}function T(e){let{environment:t,activityUpdatesSource:n,filters:o,prevFilters:r}=e;p.K4(t,"update_notification_filters",{source:n,prev_date_range_filter_start:r.dateRange.start,prev_date_range_filter_end:r.dateRange.end,prev_activity_types:r.activityTypes,date_range_filter_start:o.dateRange.start,date_range_filter_end:o.dateRange.end,activity_types:o.activityTypes})}function M(){const e=d.ZP.state.currentTab;switch(e){case"mentions":return"mentions_comments";case"archive":return"archive";case"allPages":return"all_updates";default:(0,i.t1)(e)}}function P(e){let{environment:t,action:n,args:o}=e;p.K4(t,"push_notification_desktop",{...o,action:n})}function A(e,t){const n={...t,onlyRead:"read"===t.readFilter,sessionId:d.ZP.state.sessionId};c.default.logEvent("archive_all_notifications",t.readFilter,n),p.K4(e,"archive_all_notifications",n)}function R(e){c.default.logEvent("mark_all_notifications_as_read"),p.K4(e,"mark_all_notifications_as_read",{sessionId:d.ZP.state.sessionId})}function D(e,t){p.K4(e,"toggle_filter_for_unread_notifications",t)}function B(e){let{environment:t,auto_loaded:n}=e;d.ZP.startSession({forceRestart:!0});const o={tab:a.Fz(),unread_notifications_count:u.aY(),sessionId:d.ZP.state.sessionId,from:"inbox",auto_loaded:n,...(0,l.UF)({environment:t})};c.default.logEvent("open_sidebar_updates",a.Fz(),o),p.K4(t,"open_sidebar_updates",o)}function E(e){let{environment:t}=e;const n=d.ZP.state.sessionId;n&&(p.K4(t,"close_sidebar_updates",{tab:a.Fz(),sessionId:n}),d.ZP.endSession())}function F(e){k({...e,target:"main"})}function Z(e,t){const{notificationActivityPairs:n,affectedNotificationIds:o,target:r}=t,i=new Set(o),a=n.filter((e=>{let{notification:t}=e;return i.has(t.id)}));if(0===a.length)return;const s=new Set,l=new Set;a.forEach((e=>{let{notification:t,activity:n}=e;"commented"===t.type?s.add(n.discussion_id):l.add(t.id)})),p.K4(e,"click_update_group",{target:r,sessionId:d.ZP.state.sessionId,notification_ids:Array.from(l),discussion_ids:Array.from(s),notification_page_id:a[0].notification.navigable_block_id})}function U(e,t){p.K4(e,"toggle_inbox_tab",{...t,sessionId:d.ZP.state.sessionId})}function V(e,t){p.K4(e,"click_expand_replies",{...t,sessionId:d.ZP.state.sessionId})}function N(e){p.K4(e,"open_notification_settings_from_all_updates")}function O(e){p.K4(e,"open_page_updates")}function L(e,t){p.K4(e,"click_update",{...t,tab:"homeTile"===t.tab?"homeTile":a.Fz(),view_type:s.default.state.mode})}function j(e,t){const{target:n,...o}=t;let r;"notify_mobile"===n?r="set_mobile_notification":"notify_desktop"===n?r="set_desktop_notification":"notify_email"===n?r="set_email_notification":"notify_email_always"===n?r="set_email_always_notification":"notify_email_digest"===n?r="set_email_digest_notification":"notify_slack_mention"===n?r="set_slack_mention_notification":"notify_slack_all_activity"===n?r="set_slack_all_activity_notification":(0,i.t1)(n),p.K4(e,r,o)}function K(e){p.K4(e,"set_marketing_emails_preferences")}function z(e,t){p.K4(e,"follow_page",t)}function q(e,t){p.K4(e,"unfollow_page",t)}function H(e,t){p.K4(e,"update_page_follow_settings",t)}},86615:(e,t,n)=>{n.d(t,{Et:()=>s,G:()=>c,QK:()=>i,QL:()=>a,Wy:()=>l,dl:()=>r,eZ:()=>d,kS:()=>u});var o=n(855337);async function r(e){return o.K4(e,"notion_calendar_connect")}function i(e,t){o.K4(e,"click_open_in_calendar",t)}function a(e){o.K4(e,"calendar_rebrand_onboarding_modal_show")}function s(e,t){o.K4(e,"calendar_rebrand_onboarding_modal_click",t)}function l(e){o.K4(e,"calendar_rebrand_success_modal_show")}function c(e,t){o.K4(e,"calendar_rebrand_success_modal_click",t)}function d(e){o.K4(e,"click_calendar_sidebar_link")}function u(e){o.K4(e,"click_calendar_upsell_prompt_cta")}},738208:(e,t,n)=>{n.d(t,{$D:()=>y,$l:()=>I,C$:()=>P,Fr:()=>B,Gk:()=>d,IE:()=>k,J7:()=>f,L:()=>U,NG:()=>u,PL:()=>V,Pk:()=>E,SY:()=>D,TL:()=>Z,VZ:()=>N,Vk:()=>w,YV:()=>x,_0:()=>p,a7:()=>O,ax:()=>C,e7:()=>T,fP:()=>R,ho:()=>c,iI:()=>F,jB:()=>_,jw:()=>g,o7:()=>S,p5:()=>A,qJ:()=>v,qO:()=>m,qq:()=>h,vd:()=>M,wq:()=>L,y6:()=>b});var o=n(249902),r=n(855337),i=n(215010),a=n(80444),s=n(385555),l=n(232317);function c(e,t){r.K4(e,"onboarding_dialog_error",t),S(e,"onboarding_dialog_error",t)}function d(e,t){r.K4(e,"onboarding_error",t),S(e,"onboarding_error",t)}function u(e,t){if(r.K4(e,"onboarding_show",t),s.default.logEvent("onboarding_show",1,{...t}),t.is_new_onboarding){var n;const{currentUserSettingsStore:e}=a.default.getState();s.default.logEvent("sign_up_by_domain_type",null==e||null===(n=e.getSettings())||void 0===n?void 0:n.domain_type,{})}}function p(e,t){r.K4(e,"onboarding_invite_copy",t),S(e,"onboarding_invite_copy",t)}function m(e,t){r.K4(e,"onboarding_share_link",t),S(e,"onboarding_share_link",t)}function g(e,t){r.K4(e,"onboarding_close",t),S(e,"onboarding_close",t)}function f(e,t){r.K4(e,"onboarding_skip",t),S(e,"onboarding_skip",t)}function h(e,t){r.K4(e,"onboarding_back",t),S(e,"onboarding_back",t)}function v(e,t){r.K4(e,"onboarding_invite_send",t),S(e,"onboarding_invite_send",t)}function y(e,t){r.K4(e,"onboarding_space_icon_upload",t),S(e,"onboarding_space_icon_upload",t)}function b(e,t){r.K4(e,"onboarding_stage",t),s.default.logEvent("onboarding_stage",1,{stage:t.stage,workspace_type:t.initial_workspace_type,is_new_onboarding:t.is_new_onboarding,device_type:e.device.deviceType})}function _(e,t,n){r.K4(e,"onboarding_stage_exit",{...t,back:n}),s.default.logEvent("onboarding_stage_exit",1,{stage:t.stage,workspace_type:t.initial_workspace_type,is_new_onboarding:t.is_new_onboarding,device_type:e.device.deviceType,back:n})}function S(e,t,n){r.K4(e,"onboarding_serverside",{...n,phase:t},{dontWait:!0})}function k(e,t){r.K4(e,"onboarding_join_space_click",t),s.default.logEvent("onboarding_join_space_click",t.joined_space_index,{...t})}function w(e,t){r.K4(e,"onboarding_create_space_click",t),s.default.logEvent("onboarding_create_space_click")}function x(e,t){r.K4(e,"onboarding_invite_click",t);const{invited_emails:n,...o}=t;s.default.logEvent("onboarding_invite_click",n.length,{...o})}function I(e,t){r.K4(e,"onboarding_invite_attempt",t)}function C(e,t){r.K4(e,"onboarding_upload_profile_photo",t)}function T(e,t){r.K4(e,"onboarding_join_space",t)}function M(e,t){const n="space_name"in t?(e=>{let{space_name:t,...n}=e;return n})(t):t;r.j({environment:e,event:{eventName:"onboarding_create_space",eventProperties:n}})}function P(e,t){r.K4(e,"onboarding_plan_type_select",t),s.default.logEvent("onboarding_plan_type_select",t.planType,{...t})}function A(e,t){r.K4(e,"onboarding_persona_select",t),s.default.logEvent("onboarding_persona_select","persona",{...t})}function R(e,t){r.K4(e,"onboarding_persona_select",t),s.default.logEvent("onboarding_persona_select","role",{...t})}function D(e,t){r.K4(e,"onboarding_persona_select",t),s.default.logEvent("onboarding_persona_select","useCases",{...t})}function B(e,t){r.K4(e,"onboarding_persona_select",t),s.default.logEvent("onboarding_persona_select","tools",{...t})}function E(e,t){r.K4(e,"onboarding_persona_select",t),s.default.logEvent("onboarding_persona_select","categories",{...t})}function F(e,t){r.K4(e,"onboarding_persona_select",t),s.default.logEvent("onboarding_persona_select","companySize",{...t})}function Z(e,t){r.K4(e,"onboarding_persona_survey_action",{...t,action:t.action}),s.default.logEvent("onboarding_persona_survey_action",t.action,{}),s.default.logEvent(`onboarding_persona_survey_action_${t.action}`,t.plan_selection,{})}function U(e,t){r.K4(e,"onboarding_mobile_app_download_click",t),s.default.logEvent("onboarding_mobile_app_download_click")}function V(e,t){var n,c;const{currentUserSettingsStore:d,currentUserRootStore:u}=a.default.state;r.Zf(e,{onboarding_complete:!0}),r.j({environment:e,event:{eventName:"onboarding_complete",eventProperties:t}}),l.PL(e),s.default.logEvent("onboarding_complete",1,{domain_type:null==d||null===(n=d.getSettings())||void 0===n?void 0:n.domain_type,device_type:e.device.deviceType,is_new_onboarding:t.is_new_onboarding,is_professional_team_user:i.QZ(),user_persona:t.user_persona,plan_type:t.plan_type,create_or_join:t.initial_workspace_type}),o.j({name:"onboarding_complete"}),s.default.logEvent("onboarding_complete_by_plan_type",t.plan_type,{}),s.default.logEvent("onboarding_complete_by_device_type",e.device.deviceType,{}),s.default.logEvent("onboarding_complete_by_user_persona",t.user_persona,{}),s.default.logEvent("onboarding_complete_by_user_team_role",t.user_team_role,{}),t.user_use_cases&&t.user_use_cases.forEach((e=>{s.default.logEvent("onboarding_complete_by_user_use_case",e,{})})),t.user_categories&&t.user_categories.forEach((e=>{s.default.logEvent("onboarding_complete_by_user_category",e,{})})),s.default.logEvent("onboarding_complete_by_domain_type",null==d||null===(c=d.getSettings())||void 0===c?void 0:c.domain_type,{}),s.default.logEvent("onboarding_complete_by_create_or_join_space",t.initial_workspace_type,{}),s.default.logEvent("onboarding_complete_by_is_new_user_onboarding",t.is_new_onboarding.toString(),{}),s.default.logEvent("onboarding_complete_by_workspaces_count",(null==u?void 0:u.getSpaceViewStores().length)||0,{}),i.QZ()&&s.default.logEvent("pro_team_onboarding_complete",1,{})}function N(e,t){r.K4(e,"onboarding_team_invite_email_entered",t)}function O(e,t){r.K4(e,"onboarding_team_invite_add_more_clicked",t)}function L(e,t){r.K4(e,"onboarding_bulk_invites_rendered",t)}},492973:(e,t,n)=>{n.d(t,{$C:()=>s,MU:()=>c,UZ:()=>p,hy:()=>l,lg:()=>u,sx:()=>r,v2:()=>d,vc:()=>a,zP:()=>i});var o=n(855337);function r(e,t){o.K4(e,"open_peek_as_page",t)}function i(e,t){o.K4(e,"peek_arrow_navigation",t)}function a(e,t){o.K4(e,"close_side_peek",t)}function s(e,t){o.K4(e,"close_peek",t)}function l(e,t){o.K4(e,"expand_block",t)}function c(e,t){o.K4(e,"open_peek_mode_picker",t)}function d(e,t){o.K4(e,"open_peek_mode_picker",t)}function u(e,t){o.K4(e,"update_peek_mode_format",t)}function p(e,t){o.K4(e,"update_peek_mode_format",t)}},91536:(e,t,n)=>{n.d(t,{Ad:()=>m,E5:()=>W,If:()=>q,Jp:()=>G,Kf:()=>B,L7:()=>b,LA:()=>h,ME:()=>C,Mv:()=>I,NL:()=>k,O8:()=>Z,PH:()=>Y,Pd:()=>P,RP:()=>f,SM:()=>j,Xb:()=>R,b4:()=>y,cO:()=>H,d:()=>F,dS:()=>w,dU:()=>K,dq:()=>T,g9:()=>$,gR:()=>M,hY:()=>x,kM:()=>U,kx:()=>g,nC:()=>z,oE:()=>V,pZ:()=>v,qT:()=>A,xt:()=>E,zU:()=>D});var o=n(186517),r=n(772141),i=n(249902),a=n(653965),s=n(307032),l=n(855337),c=n(367669),d=n(28578),u=n(385555),p=n(117224);function m(e,t){l.K4(e,"permissions_settings_security_banner_show",t)}function g(e,t){l.K4(e,"permissions_settings_security_banner_click",t)}function f(e,t){l.K4(e,"permissions_settings_search_click",t),u.default.logEvent("permissions_settings_search_click",t.current_tab)}function h(e,t){l.K4(e,"permissions_settings_export_guests_button_click",t),u.default.logEvent("permissions_settings_export_guests_button_click",1,t)}function v(e,t){l.K4(e,"permissions_settings_table_multiselect_click",t)}function y(e,t){l.K4(e,"permissions_settings_table_button_click",t),u.default.logEvent("permissions_settings_table_button_click",t.button_name,t)}function b(e,t){l.K4(e,"permissions_settings_invite_button_click",t),u.default.logEvent("permissions_settings_invite_button_click",t.type)}function _(e){const{user_id:t,page_id:n,...o}=e;return o}function S(e,t){l.K4(e,"update_page_permission","user_id"in t||"page_id"in t?_(t):t)}function k(e,t){l.K4(e,"set_permission_item",t)}function w(e,t){if("team"===t.type){const{team_id:n,...o}=t;l.K4(e,"expand_permission",{...o},{forceOverrideAutomaticEventData:{team_id:n}})}else l.K4(e,"expand_permission",t)}function x(e,t){l.K4(e,"page_share_user_access_role",t)}function I(e){const{newRole:t,availableRoles:n}=e;if("none"===t||"content_only_editor"===t)return;n.some((e=>"content_only_editor"===e.role))&&i.j({name:"save_non_content_editor_role"})}function C(e){const{environment:t,spaceBot:n,from:o}=e;l.j({environment:t,event:{eventName:"update_space_permission",eventProperties:{updated_bot_id:(0,s.cj)(n.bot_id),from:o,membership_type:n.membership_type,parent_table:n.bot_parent_table,parent_id:n.bot_parent_id}}}),u.default.logEvent("update_space_permission",o,{membership_type:n.membership_type})}function T(e){const{environment:t,spaceUser:n,from:o}=e;l.j({environment:t,event:{eventName:"update_space_permission",eventProperties:{updated_user_id:(0,s.cj)(n.user_id),membership_type:n.membership_type,invite_id:n.invite_id,from:o}}}),u.default.logEvent("update_space_permission",o,{membership_type:n.membership_type})}function M(e,t){var n;let{item:o,teamStore:r}=t;const i=null===(n=r.getPermissionItems())||void 0===n?void 0:n.find((e=>e.type===o.type));(null==i?void 0:i.role)!==o.role&&p.YP(e,"update_team_permission",{store:r,..."user_id"in o||"page_id"in o?_(o):o,..."user_id"in o&&{permission_user_id:(0,s.cj)(o.user_id)},old_role:null==i?void 0:i.role,is_team_role_change:!1,is_permission_change:!0})}function P(e,t){let{permission_user_id:n,store:o,team_role:r}=t;p.YP(e,"update_team_permission",{store:o,permission_user_id:n,team_role:r,is_team_role_change:!0,is_permission_change:!1})}function A(e,t){l.K4(e,"permissions_settings_tab_click",t),u.default.logEvent("permissions_settings_tab_click",t.tab,t)}function R(e){l.K4(e,"permission_group_rename")}function D(e,t){l.K4(e,"permission_group_set_icon",t)}function B(e,t){l.K4(e,"permission_group_add_members",t)}function E(e){l.K4(e,"permission_group_remove_member")}function F(e){l.K4(e,"permission_group_delete")}function Z(e){l.K4(e,"permission_group_create")}function U(e){var t;let{environment:n,location:o,inSudoMode:r,store:i,newItems:a,fromPermissionWrapper:s,flowId:l}=e;const c=null===(t=i.getCollectionViewCollectionStore())||void 0===t?void 0:t.id,u=i.getParentCollectionIdUpToTwoLevels();N({store:i,newItems:a}).forEach((e=>{let{role_old_inherited_or_most_permissive:t,role_old_on_page:i,privacy_level:a,old_privacy_level:p,newItem:m}=e;S(n,a||p?{...m,location:o,in_sudo_mode:r||void 0,role_old_inherited_or_most_permissive:t,role_old_on_page:i,privacy_level:a,old_privacy_level:p,share_menu_session_id:d.ZP.state.sessionId,from_permission_wrapper:s,collection_id:c,parent_collection_id:u,invite_flow_id:l}:{...m,location:o,in_sudo_mode:r||void 0,role_old_inherited_or_most_permissive:t,role_old_on_page:i,share_menu_session_id:d.ZP.state.sessionId,from_permission_wrapper:s,collection_id:c,parent_collection_id:u,invite_flow_id:l})}))}function V(e){const{environment:t,calculatedPermissions:n}=e;l.K4(t,"page_share_permissions_summary",{share_menu_session_id:d.ZP.state.sessionId,page_permission_summary:L(n)})}function N(e){let{store:t,newItems:n}=e;const i=e=>`${e.type}:${o.D3(e)}`,s=t.getPermissionItems(),l=a.KX(s,i),d=c.YO(t).map((e=>e.permissionItem)),u=a.KX(d,i);return n.map((e=>{var t;const n=i(e),o=u[n],a=null===(t=l[n])||void 0===t?void 0:t.role,s=null==o?void 0:o.role;return(0,r.Ir)(e)?{newItem:e,role_old_inherited_or_most_permissive:s,role_old_on_page:a,privacy_level:O(e),old_privacy_level:o&&(0,r.Ir)(o)?O(o):"private"}:{newItem:e,role_old_inherited_or_most_permissive:s,role_old_on_page:a}}))}function O(e){return"none"===e.role?"private":e.unlisted_timestamp?"unlisted":"open"}function L(e){const{mostPermissiveSpaceItem:t,mostPermissiveAncestorTeamOwnerItem:n,mostPermissiveAncestorTeamMemberItem:o,pagePermissionUIModel:i}=e,{mostPermissiveGroupPermissions:a,mostPermissiveUserPermissions:s}=i;return{space:t.permissionItem.role,team_owner:null==n?void 0:n.permissionItem.role,team_member:null==o?void 0:o.permissionItem.role,groups:{full_access:a.filter((e=>{let{permissionItem:{role:t}}=e;return r.zz(t)})).length,can_edit:a.filter((e=>{let{permissionItem:{role:t}}=e;return r.VM(t)})).length,can_edit_content:a.filter((e=>{let{permissionItem:{role:t}}=e;return r.WY(t)})).length,can_comment:a.filter((e=>{let{permissionItem:{role:t}}=e;return r.rG(t)})).length,can_view:a.filter((e=>{let{permissionItem:{role:t}}=e;return r.rz(t)})).length},users:{full_access:s.filter((e=>{let{permissionItem:{role:t}}=e;return r.zz(t)})).length,can_edit:s.filter((e=>{let{permissionItem:{role:t}}=e;return r.VM(t)})).length,can_edit_content:s.filter((e=>{let{permissionItem:{role:t}}=e;return r.WY(t)})).length,can_comment:s.filter((e=>{let{permissionItem:{role:t}}=e;return r.rG(t)})).length,can_view:s.filter((e=>{let{permissionItem:{role:t}}=e;return r.rz(t)})).length},privacy_level:O(t.permissionItem)}}function j(e){l.K4(e,"widen_permissions")}function K(e,t){l.K4(e,"request_access",t),u.default.logEvent("request_access","page"===t.request_access_type?t.previous_access_level:"team_access_request",t)}function z(e,t){l.K4(e,"grant_access",t),u.default.logEvent("grant_access",t.newAccessLevel,t)}function q(e,t){l.K4(e,"grant_access_update_access_level",t)}function H(e,t){l.K4(e,"ignore_access_request",t)}function G(e,t){l.K4(e,"toggle_request_access_security_setting",t)}function W(e,t){l.K4(e,"view_all_requests_from_membership_request_notification",t),u.default.logEvent("view_all_requests_from_membership_request_notification","notification",t)}function $(e){l.K4(e,"open_guest_membership_request_modal"),u.default.logEvent("open_guest_membership_request_modal")}function Y(e){l.K4(e,"render_guest_membership_request_entry_point"),u.default.logEvent("render_guest_membership_request_entry_point")}},751787:(e,t,n)=>{n.d(t,{Cr:()=>y,EH:()=>u,Eb:()=>g,Kk:()=>m,Sn:()=>h,WC:()=>l,Zb:()=>v,Zf:()=>p,fh:()=>f,nL:()=>c,sb:()=>d,wF:()=>s});var o=n(855337),r=n(224646),i=n(385555),a=n(787956);function s(e,t){const n={...t,...(0,r.UF)({environment:e})};o.K4(e,"open_search",n)}function l(e,t){o.K4(e,"space_invitation_email_clicked",t)}function c(e,t){o.K4(e,"select_search_item",t);const{numKeystrokes:n,timeToSelectMs:r,selectedItemIndex:a,originalPosition:s,context:l,numLocalResults:c,searchSessionId:d,searchSessionFlowNumber:u,numVisibleMembers:p,localSources:m,isMobile:g,timeToRenderResult:f}=t,h=Boolean(!!m&&m.length>0),v=p>1;i.default.logEvent("select_search_item",a,{numKeystrokes:n,timeToSelectMs:r,selectedItemIndex:a,numLocalResults:c,originalItemIndex:s,searchSessionFlowNumber:u,searchSessionId:d,context:l,isMultiplayer:v,isLocalResult:h,isMobile:g,timeToRenderResult:f});const y=1/(a+1);o.K4(e,"quick_find_reciprocal_rank",{reciprocalRank:y,context:l,searchSessionId:d,numLocalResults:c,isMultiplayer:v}),i.default.logEvent("quick_find_reciprocal_rank",y,{context:l,searchSessionId:d,numLocalResults:c,isMultiplayer:v,isLocalResult:h,isMobile:g})}function d(e,t){o.K4(e,"search_copy_link",t)}function u(e,t){o.K4(e,"abandoned_search",t);const{numKeystrokes:n,timeToAbandonMs:r,numLocalResults:a,numVisibleMembers:s,isMobile:l}=t,c=s>1;i.default.logEvent("abandoned_search",n,{numKeystrokes:n,timeToAbandonMs:r,numLocalResults:a,searchSessionId:t.searchSessionId,isMultiplayer:c,isMobile:l}),o.K4(e,"quick_find_reciprocal_rank",{reciprocalRank:0,searchSessionId:t.searchSessionId,numLocalResults:a,isMultiplayer:c}),i.default.logEvent("quick_find_reciprocal_rank",0,{searchSessionId:t.searchSessionId,numLocalResults:a,isMultiplayer:c,isMobile:l})}function p(e,t){o.K4(e,"search_client_results",t)}function m(e,t){o.K4(e,"search_post_click_page_interaction",t)}function g(e,t){var n;o.K4(e,"search_post_click_page_exit",{dwellTime:(new Date).getTime()-t.timeEntered.getTime()},{forceOverrideAutomaticEventData:{queryId:null===(n=a.Z.state)||void 0===n?void 0:n.queryId}})}function f(e,t){const{currentSearchSessionId:n,currentWorkspaceId:r,newWorkspaceId:i}=t;o.K4(e,"search_quick_search_switch_workspace",{current_search_session_id:n,current_workspace_id:r,new_workspace_id:i})}function h(e,t){o.K4(e,"search_open_shortcut_settings_from_command_search_hint",{search_session_id:t.searchSessionId})}function v(e,t){o.K4(e,"search_hover_command_search_hint",{search_session_id:t.searchSessionId})}function y(e,t){o.K4(e,"search_query_has_operators",{operations:t.operations,search_session_id:t.searchSessionId})}},614549:(e,t,n)=>{n.d(t,{A0:()=>h,AQ:()=>m,He:()=>c,O$:()=>d,SU:()=>a,Wb:()=>g,XI:()=>s,Ym:()=>S,eo:()=>y,gV:()=>l,kA:()=>_,ps:()=>p,qP:()=>u,wr:()=>f,xG:()=>b,xU:()=>v});var o=n(855337),r=n(224646),i=n(385555);function a(e,t){o.K4(e,"open_settings",{...t,...(0,r.UF)({environment:e})})}function s(e,t){o.K4(e,"toggle_settings_tab",t)}function l(e,t){o.K4(e,"site_settings_action",t)}function c(e){o.K4(e,"upload_profile_photo")}function d(e,t){o.K4(e,"name_changed",t)}function u(e){o.K4(e,"delete_account_clicked")}function p(e){o.K4(e,"delete_account_confirmed")}function m(e){o.K4(e,"log_out_from_active_sessions_clicked")}function g(e){o.K4(e,"change_password_clicked")}function f(e){o.K4(e,"remove_password_clicked")}function h(e,t){o.K4(e,"locale_changed",t)}function v(e,t){o.K4(e,"change_locale_clicked",t)}function y(e,t){o.K4(e,"invite_link_updated",t),i.default.logEvent("invite_link_updated",String(t.enabled),t)}function b(e,t){o.K4(e,"allowed_email_domains_updated",t)}function _(e,t){o.K4(e,"security_settings_tab_changed",t)}function S(e,t){o.K4(e,"cdrr_setting_updated",t)}},966324:(e,t,n)=>{n.d(t,{An:()=>x,Bf:()=>R,HY:()=>k,LM:()=>l,ME:()=>b,MR:()=>h,Mk:()=>C,NQ:()=>T,P0:()=>A,PR:()=>P,Qd:()=>c,SR:()=>D,Se:()=>y,VS:()=>v,Yg:()=>I,Zm:()=>p,_f:()=>g,ai:()=>_,hH:()=>M,kV:()=>m,mv:()=>s,ph:()=>u,qY:()=>w,so:()=>S,t8:()=>f,v$:()=>d});var o=n(269246),r=n(855337),i=n(224646),a=n(117224);function s(e,t){r.K4(e,"reorder_outliner_section",t)}function l(e){r.K4(e,"sidebar_expand")}function c(e){r.K4(e,"sidebar_unexpand")}function d(e,t){r.K4(e,"open_comments_sidebar",t)}function u(e,t){r.K4(e,"open_updates_sidebar",t)}function p(e,t){r.K4(e,"updates_sidebar_tab_click",t)}function m(e,t){r.K4(e,"open_view_all_popover",t)}function g(e,t){r.K4(e,"select_page_from_view_all_popover",t)}function f(e,t){const{teamStore:n,...o}=t;a.YP(e,"outliner_item_toggle",{store:n,...o})}function h(e,t){a.YP(e,"outliner_team_toggle",t)}function v(e,t){r.K4(e,"outliner_section_toggle",t)}function y(e){r.K4(e,"click_nested_child_page")}function b(e,t){r.K4(e,"click_desktop_navigator",t)}function _(e){r.K4(e,"open_space_switcher")}function S(e){r.K4(e,"space_switcher_select_space")}function k(e){r.K4(e,"space_switcher_logout_click")}function w(e,t){r.K4(e,"pin_page",t)}function x(e,t){r.K4(e,"unpin_page",t)}function I(e,t){const{teamStore:n,...o}=t;a.YP(e,"click_outliner_item",{store:n,...(0,i.UF)({environment:e}),...o})}function C(e,t){const{outliner_type:n}=t;r.j({environment:e,event:{eventName:"open_outliner_section_menu",eventProperties:{outliner_type:n,...(0,i.UF)({environment:e})}}})}function T(e,t){r.j({environment:e,event:{eventName:"sort_outliner_section",eventProperties:{...t,...(0,i.UF)({environment:e})}}})}function M(e,t){const{outliner_type:n,option:a}=t;r.j({environment:e,event:{eventName:"truncate_outliner_section",eventProperties:{outliner_type:n,option:a===o.Ng?"None":a,...(0,i.UF)({environment:e})}}})}function P(e,t){const{outliner_type:n,auto_loaded:o}=t;r.j({environment:e,event:{eventName:"open_outliner_section_overflow",eventProperties:{outliner_type:n,auto_loaded:o,...(0,i.UF)({environment:e})}}})}function A(e,t){const{auto_loaded:n}=t;r.j({environment:e,event:{eventName:"open_assistant_pane",eventProperties:{auto_loaded:n,...(0,i.UF)({environment:e})}}})}function R(e,t){r.j({environment:e,event:{eventName:"toggle_sidebar_section_panel",eventProperties:t}})}function D(e,t){const{sidebar_section_type:n,search_query:o,flow_id:i}=t;r.j({environment:e,event:{eventName:"sidebar_pane_query_change",eventProperties:{sidebar_section:n,search_query:o,flow_id:i}}})}},781918:(e,t,n)=>{n.d(t,{$B:()=>V,BP:()=>v,Cg:()=>le,Ci:()=>S,Dn:()=>k,Ef:()=>I,HH:()=>w,Io:()=>ie,JX:()=>Z,Jk:()=>H,Jo:()=>E,KF:()=>B,KZ:()=>ne,LO:()=>F,NF:()=>P,Om:()=>re,P0:()=>G,P1:()=>T,Pv:()=>f,Rb:()=>y,S4:()=>ee,Sw:()=>_,T4:()=>x,TJ:()=>X,VM:()=>ce,VT:()=>m,Vi:()=>Q,Y7:()=>te,ZA:()=>Y,Zm:()=>R,Zv:()=>oe,_6:()=>K,_m:()=>N,aT:()=>z,am:()=>M,bw:()=>b,dw:()=>O,fN:()=>ue,j7:()=>U,jk:()=>se,kj:()=>g,l0:()=>C,o8:()=>de,pC:()=>q,pR:()=>J,rZ:()=>D,rv:()=>j,tB:()=>ae,tX:()=>$,vC:()=>L,wV:()=>A,x8:()=>W,z0:()=>h});var o=n(779946),r=n(21359),i=n(855337),a=n(215010),s=n(385555),l=n(429677),c=n(88893),d=n(535057),u=n(288280),p=n(232317);function m(e,t){i.j({environment:e,event:{eventName:"create_space",eventProperties:t}});const n=(0,d.zt)();if("professional"===t.domain_type&&(i.K4(e,"professional_workspace_created",t),p.L1(e,{subscriptionTier:n,planType:t.planType})),"team"===t.planType&&(i.K4(e,"team_workspace_created",t),p.tO(e,{subscriptionTier:n,planType:t.planType})),p.VT(e,{subscriptionTier:n,domainType:t.domain_type}),"team"===t.planType){const t=o.Q3(),n=o.SY();r.trackConversionEvent(e,{eventName:"create_team_space",fbp:t,clickIds:n})}}function g(e,t){i.K4(e,"join_space",t)}function f(e,t){i.K4(e,"set_notifications_as_read",t)}function h(e){i.K4(e,"leave_space"),H(e,{invite_origin:"workspace_leave",domainType:(0,a.JF)(),new_workspace_member_count:-1,new_workspace_member_ids:[e.currentUser.id??""]})}function v(e){i.K4(e,"delete_space"),s.default.logEvent("delete_space")}function y(e,t){i.K4(e,"convert_guest_to_member",t),s.default.logEvent("convert_guest_to_member",t.convert_to,{origin:t.origin})}function b(e){i.K4(e,"remove_guest")}function _(e,t){s.default.logEvent("remove_member",t.member_user_id,t),H(e,{invite_origin:"workspace_remove_member",domainType:t.domainType,new_workspace_member_count:t.new_workspace_member_count,new_workspace_member_ids:[t.member_user_id]}),i.K4(e,"remove_member",{member_user_id:t.member_user_id,member_role:t.member_role,contraction_survey_id:t.contraction_survey_id})}function S(e){i.K4(e,"managed_user_reactivate_button_clicked")}function k(e,t){i.K4(e,"managed_user_support_access_toggled",t)}function w(e,t){i.K4(e,"managed_users_dashboard_search",t)}function x(e,t){i.K4(e,"managed_users_external_space_access_set",t)}function I(e,t){i.K4(e,"managed_users_prevent_support_access_toggled",t)}function C(e,t){i.K4(e,"managed_users_session_duration_modal_confirmed",t)}function T(e,t){i.K4(e,"managed_user_delete_button_clicked",t)}function M(e,t){i.K4(e,"managed_user_edit_modal_submitted",t)}function P(e){i.K4(e,"managed_user_log_out_button_clicked")}function A(e,t){i.K4(e,"managed_user_remove_from_external_workspace_button_clicked",t)}function R(e){i.K4(e,"managed_user_reset_password_button_clicked")}function D(e){i.K4(e,"managed_user_suspend_button_clicked")}function B(e,t){i.K4(e,"managed_users_log_out_all_button_clicked",t)}function E(e,t){i.K4(e,"managed_users_reset_passwords_all_button_clicked",t)}function F(e,t){i.K4(e,"managed_users_session_duration_selected",t)}function Z(e,t){i.K4(e,"managed_user_edit_profile_modal_open",t)}function U(e,t){i.K4(e,"managed_user_delete_modal_confirmed",t)}function V(e,t){i.K4(e,"managed_user_edit_modal_confirmed",t)}function N(e){i.K4(e,"managed_user_log_out_modal_confirmed")}function O(e,t){i.K4(e,"managed_user_remove_from_external_workspace_modal_confirmed",t)}function L(e){i.K4(e,"managed_user_reset_password_modal_confirmed")}function j(e,t){i.K4(e,"managed_user_suspend_modal_confirmed",t)}function K(e,t){i.K4(e,"managed_users_log_out_all_modal_confirmed",t)}function z(e,t){i.K4(e,"managed_users_reset_passwords_all_modal_confirmed",t)}function q(e){i.K4(e,"managed_users_dashboard_button_clicked")}function H(e,t){const n=(0,d.zt)();i.K4(e,"workspace_member_number_update",{new_workspace_member_count:t.new_workspace_member_count,new_workspace_member_ids:t.new_workspace_member_ids,origin:t.invite_origin,subscription_tier:n,domain_type:t.domainType,allow_domain_auto_invite:t.allow_domain_auto_invite,company_segment:(0,c.Ns)()}),s.default.logEvent("workspace_member_number_update",t.new_workspace_member_count,{origin:t.allow_domain_auto_invite?`${t.invite_origin}_allow_domain`:t.invite_origin,subscription_tier:n,domain_type:t.domainType,company_segment:(0,c.Ns)()})}function G(e,t){const n=(0,d.zt)(),o=(0,a.JF)();i.K4(e,"person_property_invite_click_menu_item",{subscription_tier:n,domain_type:o,origin:t.origin,invite_flow_id:t.invite_flow_id})}function W(e,t){const n=(0,d.zt)(),o=(0,a.JF)();i.K4(e,"person_property_invite_render_menu_item",{subscription_tier:n,domain_type:o,origin:t.origin,invite_flow_id:t.invite_flow_id})}function $(e,t){const n=(0,d.zt)(),o=(0,a.JF)(),r="member"===t.invite_option?t.can_add_member?"member":"request_member":"guest";i.K4(e,"person_property_invite_click_invite_button",{subscription_tier:n,domain_type:o,invited_type:r,invited_user_count:t.invited_user_count,origin:t.origin,invite_token_query:t.inviteTokenQuery,invite_targets:t.inviteTargets,invite_flow_id:t.invite_flow_id})}function Y(e,t){const n=(0,d.zt)(),o=(0,a.JF)();i.K4(e,"person_property_invite_click_upgrade_button",{subscription_tier:n,domain_type:o,origin:t.origin,invited_user_count:t.invited_user_count,invite_flow_id:t.invite_flow_id})}function Q(e,t){const n=(0,d.zt)(),o=(0,a.JF)();i.K4(e,"person_property_invite_guest_invited",{subscription_tier:n,domain_type:o,invited_user_count:t.invited_user_count,origin:t.origin,invite_flow_id:t.invite_flow_id})}function J(e,t){const n=(0,d.zt)(),o=(0,a.JF)();i.K4(e,"person_property_invite_member_invited",{subscription_tier:n,domain_type:o,invited_user_count:t.invited_user_count,origin:t.origin,invite_flow_id:t.invite_flow_id})}function X(e,t){const n=(0,d.zt)(),o=(0,a.JF)();i.K4(e,"person_property_invite_member_requested",{subscription_tier:n,domain_type:o,invited_user_count:t.invited_user_count,origin:t.origin,invite_flow_id:t.invite_flow_id})}function ee(e,t){const n=(0,d.zt)(),o=(0,a.JF)();i.K4(e,"person_property_invite_error",{subscription_tier:n,domain_type:o,invite_stage:t.invite_stage,invite_flow_id:t.invite_flow_id,error:t.error})}function te(e,t){const n=(0,d.zt)(),o=(0,a.JF)(),r="member"===t.invite_option?t.can_add_member?"member":"request_member":"guest";i.K4(e,"person_property_invite_completed",{subscription_tier:n,domain_type:o,invited_type:r,invited_user_count:t.invited_user_count,is_success:t.is_success,origin:t.origin,invite_flow_id:t.invite_flow_id})}function ne(e,t){const n=(0,d.zt)(),o=(0,a.JF)();i.K4(e,"person_property_invite_message_typed",{subscription_tier:n,domain_type:o,origin:t.origin,invite_flow_id:t.invite_flow_id})}function oe(e,t){const n=(0,d.zt)(),o=(0,a.JF)();i.K4(e,"person_property_invite_dismiss_popup",{subscription_tier:n,domain_type:o,origin:t.origin,invite_flow_id:t.invite_flow_id})}function re(e,t){const n=(0,d.zt)(),o=(0,a.JF)();i.K4(e,"person_property_invite_change_permission",{subscription_tier:n,domain_type:o,origin:t.origin,invite_flow_id:t.invite_flow_id,invited_role:t.invited_role})}function ie(e,t){const n=(0,d.zt)(),o=(0,a.JF)();i.K4(e,"person_property_invite_click_invite_option",{subscription_tier:n,domain_type:o,origin:t.origin,invite_flow_id:t.invite_flow_id,invite_option:t.invite_option})}function ae(e,t){i.K4(e,"guest_invite_request_setting_toggled",t)}function se(e,t){i.K4(e,"settings_deeplink_clicked",t)}function le(e,t){i.K4(e,"guest_invite_request_resolved",t)}function ce(e,t){i.K4(e,"request_access_review_button_clicked",t),s.default.logEvent("request_access_review_button_clicked",t.status,{from:t.from,user_count:t.user_count,request_type:t.request_type})}function de(e,t){if(i.K4(e,"disable_guest_toggle",t),!0===t.new_value&&!t.keep_existing_guests_if_disabled){const t=u.subscriptionDataStoreInstance.state;if(!t)return;const n=(0,c.ND)(t).length;n>0&&ue(e,{origin:"space_setting_disable_guest",changedNumber:-n})}}function ue(e,t){let{inviteTargets:n,origin:o,changedNumber:r}=t;const p=(0,a.JF)(),m=(0,d.zt)();if(r)return i.K4(e,"workspace_guest_number_update",{new_workspace_guest_count:r,origin:o,subscription_tier:m,domain_type:p,company_segment:(0,c.Ns)()}),void s.default.logEvent("workspace_guest_number_update",r,{origin:o,subscription_tier:m,domain_type:p,company_segment:(0,c.Ns)()});const g=u.subscriptionDataStoreInstance.state;if(!g||!n)return;const f=c.CM(g).map((e=>e.userId)),h=n.filter((e=>!!(0,l.cl)(e)||"existingUser"===e.type&&!f.includes(e.value.id)));0!==h.length&&(i.K4(e,"workspace_guest_number_update",{new_workspace_guest_count:h.length,origin:o,subscription_tier:m,domain_type:p,company_segment:(0,c.Ns)()}),s.default.logEvent("workspace_guest_number_update",h.length,{origin:o,subscription_tier:m,domain_type:p,company_segment:(0,c.Ns)()}))}},286572:(e,t,n)=>{n.d(t,{Aq:()=>O,Bg:()=>N,Dc:()=>R,FR:()=>D,GT:()=>pe,Ib:()=>te,LY:()=>j,Lc:()=>A,Ls:()=>W,Ms:()=>ie,NI:()=>ee,PN:()=>F,QO:()=>Q,Qr:()=>T,R3:()=>I,VO:()=>le,VQ:()=>Z,Vk:()=>de,YT:()=>y,Zb:()=>$,_j:()=>q,_q:()=>K,b0:()=>S,bf:()=>ae,cY:()=>V,e3:()=>v,fZ:()=>E,g3:()=>Y,iL:()=>U,j:()=>me,jh:()=>H,jw:()=>M,k1:()=>w,k6:()=>z,lj:()=>re,lq:()=>x,ms:()=>ce,nd:()=>b,q7:()=>_,qP:()=>P,qz:()=>B,rY:()=>L,rx:()=>J,sA:()=>X,t6:()=>se,wl:()=>G,x1:()=>ne,xo:()=>C,y$:()=>k,z2:()=>oe,zq:()=>ue});var o=n(730120),r=n(599405),i=n(102438),a=n(653965),s=n(307032),l=n(619584),c=n(247839),d=n(95477),u=n(855337),p=n(215010),m=n(385555),g=n(88893),f=n(535057),h=n(232317);function v(e){u.K4(e,"pricing_grid_view_end"),m.default.logEvent("pricing_grid_view_end")}function y(e,t){u.K4(e,"subscription_update_modal_open",t),m.default.logEvent("subscription_update_modal_open",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function b(e,t){u.K4(e,"subscription_update_modal_confirmation_click",{...a.CE(t.state,"modalId"),modal_id:t.state.modalId}),m.default.logEvent("subscription_update_modal_confirmation_click",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function _(e,t){u.K4(e,"subscription_update_modal_exit",{...a.CE(t.state,"modalId"),modal_id:t.state.modalId}),m.default.logEvent("subscription_update_modal_exit",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function S(e,t){u.K4(e,"subscription_update_modal_billing_interval_updated",t),m.default.logEvent("subscription_update_modal_billing_interval_updated",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function k(e,t){u.K4(e,"subscription_update_modal_expand_billing_summary",{...a.CE(t.state,"modalId"),modal_id:t.state.modalId}),m.default.logEvent("subscription_update_modal_expand_billing_summary",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function w(e,t){u.K4(e,"subscription_update_modal_hide_billing_summary",{...a.CE(t.state,"modalId"),modal_id:t.state.modalId}),m.default.logEvent("subscription_update_modal_hide_billing_summary",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function x(e){u.K4(e,"subscription_billing_dismissed"),m.default.logEvent("subscription_billing_dismissed",void 0,{device_os:e.device.os,platform:e.device.platform})}function I(e,t){u.K4(e,"subscription_billing_opened",t),m.default.logEvent("subscription_billing_opened",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function C(e){u.K4(e,"subscription_plans_dismissed"),m.default.logEvent("subscription_plans_dismissed",void 0,{device_os:e.device.os,platform:e.device.platform})}function T(e,t){u.K4(e,"subscription_plans_opened",t),m.default.logEvent("subscription_plans_opened",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function M(e){u.K4(e,"currently_subscribed")}function P(e,t){u.j({environment:e,event:{eventName:"subscription_upgrade_modal_present_price",eventProperties:{external_id:t.externalId}}})}function A(e,t){u.K4(e,"subscription_upgrade_modal_open",t),m.default.logEvent("subscription_upgrade_modal_open",void 0,t)}function R(e,t){const{event:n,modal_id:o,modal_type:r}=t,i={...(0,l.by)(n),modal_id:o,modal_type:r};u.K4(e,"subscription_upgrade_modal_payment_element_changed",i),m.default.logEvent("subscription_upgrade_modal_payment_element_changed",void 0,{...i,device_os:e.device.os,platform:e.device.platform})}function D(e,t){u.K4(e,"subscription_upgrade_modal_billing_interval_updated",t),m.default.logEvent("subscription_upgrade_modal_billing_interval_updated",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function B(e,t){u.K4(e,"subscription_upgrade_modal_add_on_features_updated",t),m.default.logEvent("subscription_upgrade_modal_add_on_features_updated",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function E(e,t){u.K4(e,"subscription_upgrade_modal_upgrade_accepted",t),m.default.logEvent("subscription_upgrade_modal_upgrade_accepted",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function F(e,t){u.K4(e,"subscription_upgrade_modal_upgrade_click",t),m.default.logEvent("subscription_upgrade_modal_upgrade_click",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function Z(e,t){u.K4(e,"subscription_upgrade_modal_upgrade_failed_validation",t),m.default.logEvent("subscription_upgrade_modal_upgrade_failed_validation",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function U(e,t){u.K4(e,"subscription_upgrade_onboarding_failed_validation",t)}function V(e,t){u.K4(e,"subscription_upgrade_modal_upgrade_failed_payment",t),m.default.logEvent("subscription_upgrade_modal_upgrade_failed_payment",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function N(e){u.K4(e,"subscription_upgrade_onboarding_failed_payment")}function O(e,t){u.K4(e,"subscription_upgrade_modal_upgrade_failed_payment_recovery_initiated",t),m.default.logEvent("subscription_upgrade_modal_upgrade_failed_payment_recovery_initiated",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function L(e,t){u.K4(e,"subscription_upgrade_modal_address_form_updated",t),m.default.logEvent("subscription_upgrade_modal_address_form_updated",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function j(e,t){u.K4(e,"subscription_upgrade_modal_exit",t),m.default.logEvent("subscription_upgrade_modal_exit",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function K(e,t){u.K4(e,"subscription_upgrade_modal_stripe_error",t),m.default.logEvent("subscription_upgrade_modal_stripe_error",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function z(e,t){u.j({environment:e,event:{eventName:"create_subscription",eventProperties:t}}),m.default.logEvent("create_subscription",t.plan,t)}async function q(e,t){var n,a,l,f;const v=p.JF(),y=g.qX(),b=!!t.trialEndDate&&t.trialEndDate>=o.ou.now();u.K4(e,"update_subscription_tier",{from:t.from,action:t.action,old_subscription_tier:t.oldSubscriptionTier,new_subscription_tier:t.newSubscriptionTier,old_price_id:t.oldPriceId,new_price_id:t.newPriceId,old_currency:t.oldCurrency,new_currency:t.newCurrency,old_add_ons:t.oldAddOns,new_add_ons:t.newAddOns,old_billing_interval:t.oldBillingInterval,new_billing_interval:t.newBillingInterval,is_cancel_subscription:t.isCancelSubscription,is_professional_team:t.isProfessionalTeamUser,domain_type:v,space_visible_members:y,is_trial:t.isTrial,is_mid_trial:b,is_mm_or_ent_trial:t.isMmOrEnt,trial_end_date:null==t?void 0:t.trialEndDate,trial_id:null===(n=t.trialData)||void 0===n?void 0:n.id,trial_from:null===(a=t.trialData)||void 0===a?void 0:a.from,modal_id:t.modalId}),m.default.logEvent("update_subscription_tier",void 0,{from:t.from,action:t.action,old_subscription_tier:t.oldSubscriptionTier,new_subscription_tier:t.newSubscriptionTier,old_price_id:t.oldPriceId,new_price_id:t.newPriceId,old_currency:t.oldCurrency,new_currency:t.newCurrency,old_add_ons:t.oldAddOns,new_add_ons:t.newAddOns,old_billing_interval:t.oldBillingInterval,new_billing_interval:t.newBillingInterval,is_cancel_subscription:t.isCancelSubscription,space_visible_members:y,is_trial:t.isTrial,is_mid_trial:b,trial_end_date:null==t?void 0:t.trialEndDate,device_os:e.device.os,platform:e.device.platform,is_mm_or_ent_trial:t.isMmOrEnt,modal_id:t.modalId});const _=null===(l=t.oldAddOns)||void 0===l?void 0:l.includes("ai"),S=null===(f=t.newAddOns)||void 0===f?void 0:f.includes("ai");if(!_&&S&&(u.K4(e,"ai_addon_purchased",t),h.XT(e)),!t.oldSubscriptionTier||!t.newSubscriptionTier)return;const{device:k}=e;if(!(0,i.nR)(t.oldSubscriptionTier)&&(0,i.nR)(t.newSubscriptionTier)&&"personal"!==t.newSubscriptionTier){const n={country:t.addressCountry,productName:t.newPriceId,price:t.creditAmount||0,spaceId:(0,s.cj)(t.spaceId),deviceType:k.isTablet?"tablet":k.isMobile?"mobile":"desktop",subscriptionTier:t.newSubscriptionTier};if("professional"===v&&u.K4(e,"professional_workspace_upgraded",t),u.K4(e,"workspace_upgraded",t),h.U5(e,{...n,domainType:v}),"professional"===v&&h.jM(e),"team"===t.planType&&(u.K4(e,"team_workspace_upgraded",t),h.C6(e)),e.device.isElectron){const o=(0,r.createUpgradedPageRedirect)(d.default.domainBaseUrl,{deviceId:await u.cG(e),oldSubscriptionTier:t.oldSubscriptionTier,newSubscriptionTier:t.newSubscriptionTier,isProfessionalTeamUser:t.isProfessionalTeamUser,deviceType:e.device.deviceType,domainType:v,eventData:n});return void c.openExternalUrl(o)}}}function H(e,t){u.K4(e,"subscription_update_plan",t),m.default.logEvent("subscription_update_plan",void 0,t)}function G(e,t){u.K4(e,"subscription_update_billing",t),m.default.logEvent("subscription_update_billing",void 0,t)}function W(e,t){const{firstName:n,email:o,...r}=t;u.K4(e,"enterprise_sales_contact",{...r,enterprise_name:n,enterprise_email:o}),m.default.logEvent("enterprise_sales_contact")}function $(e,t){u.K4(e,"enterprise_sales_contact_opened",t)}function Y(e){u.j({environment:e,event:{eventName:"enterprise_sales_contact_dismissed",eventProperties:{}}})}function Q(e,t){u.K4(e,"enterprise_sales_contact_updated",t)}function J(e,t){u.K4(e,"cancel_subscription",t),m.default.logEvent("cancel_subscription",void 0,t)}function X(e,t){u.K4(e,"click_upgrade_button",t),m.default.logEvent("click_upgrade_button",void 0,t)}function ee(e,t){u.K4(e,"plan_cta_click",t),m.default.logEvent("plan_cta_click",void 0,t)}function te(e){u.K4(e,"compare_all_features_click"),m.default.logEvent("compare_all_features_click",void 0)}function ne(e,t){u.j({environment:e,event:{eventName:"block_limit_banner_viewed",eventProperties:t}})}function oe(e){u.lu(e,"approaching_block_limit","approaching_block_limit",60)}function re(e){const t=u.lu(e,"reach_block_limit","reach_block_limit",60);m.default.logEvent("reach_block_limit",1),t&&u.Zf(e,{reach_block_limit:!0,reach_block_limit_time:Date.now(),subscription_tier:f.zt()})}function ie(e,t){u.K4(e,"add_on_update_click",t)}function ae(e,t){u.K4(e,"member_requested_ai_addon",t),m.default.logEvent("member_requested_ai_addon",void 0,{...t,device_os:e.device.os,platform:e.device.platform})}function se(e,t){u.j({environment:e,event:{eventName:"student_ai_offer_viewed",eventProperties:t}}),m.default.logEvent("student_ai_offer_viewed",void 0,{device_os:e.device.os,platform:e.device.platform})}function le(e){u.j({environment:e,event:{eventName:"student_ai_popup_dismissed",eventProperties:{}}}),m.default.logEvent("student_ai_popup_dismissed",void 0,{device_os:e.device.os,platform:e.device.platform})}function ce(e,t){u.K4(e,"partner_trial_signup",t),m.default.logEvent("partner_trial_signup",void 0,{...t})}function de(e){u.K4(e,"cancel_trial_button_clicked"),m.default.logEvent("cancel_trial_button_clicked",void 0)}function ue(e,t){u.j({environment:e,event:{eventName:"timed_trial_offer_viewed",eventProperties:t}}),m.default.logEvent("timed_trial_offer_viewed",void 0,{device_os:e.device.os,platform:e.device.platform})}function pe(e){u.j({environment:e,event:{eventName:"timed_trial_popup_dismissed",eventProperties:{}}}),m.default.logEvent("timed_trial_popup_dismissed",void 0,{device_os:e.device.os,platform:e.device.platform})}function me(e,t){const n=t.name,o="args"in t?t.args:void 0;u.K4(e,n,o)}},65028:(e,t,n)=>{n.d(t,{Kx:()=>s,VI:()=>r,Zv:()=>i,eO:()=>a});var o=n(855337);function r(e){const{environment:t,...n}=e;(0,o.j)({environment:t,event:{eventName:"suggesting_mode_session_start",eventProperties:n}})}function i(e){const{environment:t,...n}=e;(0,o.j)({environment:t,event:{eventName:"suggesting_mode_session_end",eventProperties:n}})}function a(e){const{environment:t,...n}=e;(0,o.j)({environment:t,event:{eventName:"suggest_edit",eventProperties:n}})}function s(e){const{environment:t,...n}=e;(0,o.j)({environment:t,event:{eventName:"edit_existing_suggestion",eventProperties:n}})}},225888:(e,t,n)=>{n.d(t,{Ar:()=>s,Fs:()=>c,LS:()=>d,Ot:()=>a,V:()=>l,wk:()=>u});var o=n(855337),r=n(224646),i=n(385555);function a(e,t){o.K4(e,"open_support_chat",t)}function s(e,t){o.K4(e,"click_help",{from:t.from,qna_session_id:t.qnaSessionId}),i.default.logEvent("click_help")}function l(e,t){o.K4(e,"click_help_item",{...t,...(0,r.UF)({environment:e})}),"sales_chat"===t.item&&i.default.logEvent("click_help_item")}function c(e,t){o.K4(e,"global_click_learn",t)}function d(e){o.K4(e,"zendesk_metadata_open_messenger")}function u(e){o.K4(e,"zendesk_metadata_signup")}},117224:(e,t,n)=>{n.d(t,{$:()=>T,$1:()=>S,$4:()=>p,BW:()=>A,Bd:()=>g,FN:()=>O,GZ:()=>d,Gp:()=>x,IW:()=>C,LB:()=>z,NO:()=>y,OR:()=>R,Ph:()=>L,Pr:()=>b,Qk:()=>D,SJ:()=>U,UD:()=>w,XT:()=>j,YP:()=>F,cX:()=>k,co:()=>q,dw:()=>u,ej:()=>Z,er:()=>P,ix:()=>_,kr:()=>h,mF:()=>I,mi:()=>M,o_:()=>v,pi:()=>m,rF:()=>N,uA:()=>K,v2:()=>f,z:()=>B});var o=n(653965),r=n(401898),i=n(855337),a=n(224646),s=n(568418),l=n(455838),c=n(385555);async function d(e,t){await i.K4(e,"manage_teams_filter_click",t)}function u(e,t){i.K4(e,"manage_teams_sort",t)}function p(e,t){F(e,"duplicate_team",t)}function m(e,t){i.K4(e,"open_team_browser",{...t,...(0,a.UF)({environment:e})})}function g(e,t){i.K4(e,"team_browser_search_cleared",t)}function f(e,t){const{teamStore:n,outliner_type:o}=t;F(e,"team_browser_member_list_hover",{store:n,outliner_type:o})}function h(e,t){i.K4(e,"create_team_start",{from:t.from,flow_id:t.flowId}),c.default.logEvent("create_team_start",1,{...t,...(0,a.UF)({environment:e})})}async function v(e,t){const{store:n}=t;await n.load(),F(e,"create_team_complete",t),E("create_team_complete",t)}async function y(e,t){const{store:n}=t;await n.load(),F(e,"enable_teams",t)}function b(e,t){const{screen:n,...o}=t;if(n===s.F.Team){const t={screen:"team",...o};return F(e,"close_create_team_modal",t),void E("close_create_team_modal",t)}const r={screen:"members",flow_id:t.flow_id,from:t.from,team_id:t.team_id,store:t.store};F(e,"close_create_team_modal",r),E("close_create_team_modal",r)}function _(e,t){F(e,"invite_team_members",t),E("invite_team_members",t)}function S(e,t){F(e,"invite_team_groups",t),E("invite_team_groups",t)}function k(e,t){F(e,"set_default_team",t)}function w(e,t){F(e,"join_team",t),E("join_team",t)}function x(e,t){F(e,"archive_team",t)}function I(e,t){F(e,"transition_to_zero_teams",t)}function C(e,t){F(e,"restore_team",t)}function T(e,t){F(e,"remove_team_members",t)}function M(e,t){F(e,"remove_team_groups",t)}function P(e,t){F(e,"change_teams_order",t)}function A(e,t){F(e,"change_team_access_level",t)}function R(e,t){F(e,"update_team_settings",t)}function D(e,t){F(e,"open_outliner_team_overflow",{...t,...(0,a.UF)({environment:e})})}function B(e,t){F(e,"click_outliner_team_overflow_option",t),E("click_outliner_team_overflow_option",t)}function E(e,t){const{store:n,...o}=t;n?c.default.logEvent(e,1,{...i.nB(n),...o}):c.default.logEvent(e,1,t)}async function F(e,t,n){const{store:r,...a}=n;if(!r)return void(await i.K4(e,t,{...a}));const s=i.nB(r),l=o.CE(s,"team_id");await i.K4(e,t,{...l,...a},{forceOverrideAutomaticEventData:{team_id:s.team_id}})}function Z(e,t,n,r,a){const{store:s,...l}=a;if(!s)return void i.lu(e,t,n,r,{...l});const c=i.nB(s),d=o.CE(c,"team_id");i.lu(e,t,n,r,{...d,...l},{forceOverrideAutomaticEventData:{team_id:c.team_id}})}function U(e,t){F(e,"open_team_home",t)}function V(e){switch(e){case l.a.General:return"general";case l.a.Members:return"members";case l.a.Security:return"security";default:(0,r.t1)(e)}}function N(e,t){F(e,"click_team_settings_tab",{store:t.store,tab_old_value:V(t.tab_old_value),tab_new_value:V(t.tab_new_value)})}function O(e,t){F(e,"restore_team_permissions",t)}function L(e,t){F(e,"team_invite_link_confirmation_selection",t)}function j(e,t){F(e,"copy_team_invite_link",t),E("copy_team_invite_link",t)}function K(e,t){F(e,"click_team_invite_link",t)}function z(e,t){F(e,"request_access_to_team",t)}function q(e,t){F(e,"resolve_team_access_request",t)}},981193:(e,t,n)=>{n.d(t,{$6:()=>D,$K:()=>k,Cu:()=>M,EZ:()=>R,HU:()=>p,Ib:()=>d,Jw:()=>I,T2:()=>c,Tt:()=>g,Ui:()=>E,XQ:()=>b,Xy:()=>u,Y4:()=>A,Yn:()=>w,bR:()=>C,dZ:()=>y,en:()=>v,gI:()=>B,jW:()=>m,me:()=>P,n1:()=>f,nn:()=>x,rN:()=>_,sY:()=>S,ye:()=>h});n(757658);var o=n(371663),r=n(307032),i=n(401898),a=n(855337),s=n(224646),l=n(385555);function c(e){a.K4(e,"browse_more_templates_click"),l.default.logEvent("browse_more_templates_click",1)}function d(e){a.K4(e,"in_app_template_gallery_brand_click")}function u(e,t){a.K4(e,"duplicate_template",{...t,is_paid:!1})}function p(e,t){a.K4(e,"duplicate_template_attempt",t)}function m(e,t){a.K4(e,"template_modal_open",{...t,...(0,s.UF)({environment:e})}),l.default.logEvent("template_modal_open",1)}function g(e,t){a.K4(e,"template_modal_close",{...t,...(0,s.UF)({environment:e})}),l.default.logEvent("template_modal_close",1)}function f(e,t){a.K4(e,"template_modal_item_click",t),l.default.logEvent("template_modal_item_click",1)}function h(e,t){a.K4(e,"template_modal_get_template_click",t),l.default.logEvent("template_modal_get_template_click",1)}function v(e,t){const{team_id:n,...o}=t;a.K4(e,"template_modal_accept",o,{forceOverrideAutomaticEventData:{team_id:n}}),l.default.logEvent("template_modal_accept",1)}function y(e,t){a.K4(e,"create_collection_template",t),l.default.logEvent("create_collection_template",1)}function b(e,t){a.K4(e,"activate_collection_template",t),l.default.logEvent("activate_collection_template",1)}function _(e,t){a.K4(e,"select_template",t)}function S(e,t){a.K4(e,"collection_template_action",t)}function k(e,t){a.K4(e,"click_outliner_team_new_page",t)}function w(e,t){a.K4(e,"show_team_duplicate_template_confirmation",t)}function x(e,t){a.K4(e,"click_team_duplicate_template_confirmation_option",t)}function I(e,t){let{from:n,wiki_block_id:r,destination_team_id:i,wiki_template_id:a}=t;T(e,{from:n,preset_uri:"notion://wiki/wiki_preset",created_page_ids:[r],database_types:[o.GZ],destination_team_id:i,wiki_template_id:a})}function C(e,t){let{from:n,preset_uri:o,created_block_stores:r,destination_team_id:a}=t;const s=[],l=[];for(const i of r){var c;const e=null===(c=i.getCollectionStore())||void 0===c?void 0:c.getDatabaseType();e&&(l.push(i.id),s.push(e))}const d=r.map((e=>{var t;return null===(t=e.getFormat())||void 0===t?void 0:t.app_id})).filter(i.$K);T(e,{from:n,preset_uri:o,created_page_ids:l,database_types:s,destination_team_id:a,app_ids:[...new Set(d)]})}function T(e,t){a.K4(e,"create_app_template",t)}function M(e,t){a.K4(e,"delete_app_template",t)}function P(e,t){a.K4(e,"create_typed_dbs_in_team_latency",t)}function A(e,t){a.K4(e,"apply_preset_features",t)}function R(e,t){a.K4(e,"template_duplication_v2_modal_close",{template_block_id:t.templateBlockId&&(0,r.F9)(t.templateBlockId)})}function D(e,t){a.K4(e,"template_duplication_v2_account_switcher_open",{template_block_id:(0,r.F9)(t.templateBlockId),num_of_users:t.numOfUsers})}function B(e,t){a.K4(e,"template_duplication_v2_switch_space",{template_block_id:(0,r.F9)(t.templateBlockId),template_destination_space_id:t.templateDestinationSpaceId&&(0,r.F9)(t.templateDestinationSpaceId),num_of_users:t.numOfUsers})}function E(e,t){a.K4(e,"template_not_found_in_gallery",{template_block_id:(0,r.F9)(t.templateBlockId)})}},103022:(e,t,n)=>{n.d(t,{F4:()=>p,Gb:()=>i,LA:()=>s,SL:()=>g,Sl:()=>a,Y_:()=>y,ap:()=>f,h2:()=>v,iB:()=>c,kY:()=>d,mc:()=>b,sI:()=>m,vk:()=>r,vt:()=>l,y9:()=>u,zQ:()=>h});var o=n(855337);function r(e,t){o.lu(e,"legacy_transclusion_show",`legacy_transclusion_show_${t.block_type}`,3600,t)}function i(e,t){o.K4(e,"legacy_transclusion_autofix",t)}function a(e,t){o.K4(e,"legacy_transclusion_duplication_fix",t)}function s(e,t){o.K4(e,"transaction_timestamp_collision",t)}function l(e,t){o.K4(e,"transaction_timestamp_regression",t)}function c(e,t){o.K4(e,"transaction_race_hazard",t)}function d(e,t){o.K4(e,"transaction_async_data_loss",t)}function u(e,t){o.K4(e,"transaction_deadlock_warning",t)}function p(e,t){o.K4(e,"transaction_too_large",t)}function m(e,t){o.K4(e,"transaction_queue_error_show",t)}function g(e){o.K4(e,"connection_error_show",{})}function f(e,t){o.K4(e,"connection_error_indicator_details_show",t)}function h(e,t){o.K4(e,"low_storage_error_show",t)}function v(e,t){o.K4(e,"transaction_queue_healthcheck",t)}function y(e,t){o.K4(e,"save_edits_error_modal_show",t)}function b(e,t){o.K4(e,"unsaved_transaction_error",t)}},21359:(e,t,n)=>{n.r(t),n.d(t,{activateReferral:()=>Pr,addUserToWaitlist:()=>ku,addUsersToSpace:()=>wo,addWebClipperFile:()=>gn,addWebClipperURLs:()=>Gr,adminAddLinkPreviewToSpace:()=>su,adminAddPreservedSpaces:()=>Ia,adminAddPublicEmailDomains:()=>xa,adminAddZeroRetentionSpace:()=>eo,adminAllowlistCreditDomain:()=>di,adminBanUser:()=>Fl,adminBlockApiBots:()=>Op,adminBlockEmailDomain:()=>Os,adminBulkAddEduUniversitiesAndDomains:()=>Tu,adminBulkAddPromotionCodes:()=>Ts,adminBulkApplyPromotionCodes:()=>Bs,adminBulkBanUsers:()=>Zl,adminBulkCreateTimedTrials:()=>pd,adminBulkRemoveSpaceGuests:()=>Ms,adminBulkSetSalesAssistedSubscriptionBanner:()=>ea,adminBulkSetStartupReferralPartners:()=>Mu,adminBulkUpgradeEduPlusUser:()=>Zs,adminBypassEmailReputationChecks:()=>Ai,adminCancelSpaceConsolidation:()=>zl,adminCancelSubscription:()=>ia,adminChangeEmail:()=>pa,adminCheckHIPAAComplianceStatus:()=>to,adminCheckStatsigSegment:()=>si,adminClaimAndUpgradeForSalesAssisted:()=>Ll,adminContentSearch:()=>Rc,adminCopyPageBetweenEnvironments:()=>Ks,adminCountWordsInPage:()=>zs,adminCreateMarketingRoute:()=>El,adminDelayClaimSpaceDeletion:()=>jl,adminDeleteFileFromS3:()=>fs,adminDeleteSpaces:()=>po,adminDeleteUser:()=>Xn,adminDescribeAccountsToReset:()=>mo,adminDescribeBlocksOnPageToRevive:()=>So,adminDescribeDeleteFileFromS3:()=>hs,adminDescribeDeletedBlockPermissions:()=>ks,adminDescribeEditSpacePermission:()=>ao,adminDescribeRestoreDeletedGuestPermissions:()=>au,adminDescribeRunSpaceConsolidation:()=>uo,adminDescribeSpacesToDelete:()=>co,adminDisableReverifyForUser:()=>lo,adminDowngradeFraudSubscription:()=>lc,adminEditBlockPermissions:()=>oo,adminEditSpacePermissions:()=>io,adminEditTeamMembership:()=>vo,adminEmployeeSubscriptionUpdate:()=>Ln,adminFindDeletedUser:()=>ci,adminFlushSpaceMembershipUpdates:()=>ud,adminForceResyncExternalObjects:()=>Pl,adminGetAutomationRecurrenceStatus:()=>Cu,adminGetAutomationsForRecordId:()=>Iu,adminGetBulkIds:()=>_d,adminGetBulkSpaceIdsByDomain:()=>yi,adminGetBulkSpaceIdsByEmail:()=>bi,adminGetBulkUserIdsByEmail:()=>_i,adminGetClientExperiments:()=>ri,adminGetCurrentUserPermissions:()=>us,adminGetDataAccessConsent:()=>vi,adminGetDomainClaimEligibleSpaces:()=>Nl,adminGetDomainManagementSettings:()=>Ol,adminGetIntegrationData:()=>xl,adminGetOwnership:()=>ds,adminGetPremiumFeatureAvailabilities:()=>Ps,adminGetProcessedSpaceMembershipUpdates:()=>dd,adminGetPublicDomainStatus:()=>Js,adminGetPublicPages:()=>Qs,adminGetRateLimits:()=>ps,adminGetSamlConfig:()=>ms,adminGetSlackIntegrationData:()=>Cl,adminGetSpaceIdsForDeletionDate:()=>Hl,adminGetSpaceMembershipUpdates:()=>cd,adminGetSpacesForAllowedEmailDomain:()=>vs,adminGetStatsigExperiment:()=>ii,adminGetStatsigFeatureGate:()=>ai,adminGetSubscriptionBannerHistory:()=>ta,adminGetSubscriptionBannerState:()=>na,adminGetSyncedDatabaseData:()=>Tl,adminGetUnrepresentableState:()=>oa,adminGetUserBillingInformation:()=>Pi,adminGetWorkspaceWebhookSubscriptions:()=>wu,adminIsSpaceDomainClaimEligible:()=>Vl,adminIsWorkspaceInQnA:()=>vu,adminJoinSpacesForOauthRedirect:()=>Ml,adminListData:()=>no,adminMergeUsers:()=>yu,adminModifyBlock:()=>_s,adminMonetizationTaskRunnerEnqueue:()=>Fs,adminOnboardAISlackQnA:()=>go,adminOptOutNotionAIDataSharing:()=>vd,adminOverrideInternalDomains:()=>Rs,adminOverridePremiumFeatureAvailability:()=>As,adminPartnerStackFixMissingProductKeys:()=>Es,adminPrimaryWorkspaceChange:()=>gs,adminQnACheckIndexingStatus:()=>fo,adminQueryCollectionReplay:()=>Ii,adminReadBlockPermissions:()=>ro,adminRecoverMfa:()=>Ti,adminRecoverUserContentInSpace:()=>bu,adminReleaseSubscriptionSchedule:()=>Xc,adminRemoveAllowedEducationEmails:()=>Ds,adminRemoveChildFromExternalCollection:()=>Kl,adminRemovePreservedSpaces:()=>Ca,adminRemoveSpaceUsersAndTransferContent:()=>Mi,adminResetAccounts:()=>ho,adminResetRateLimits:()=>ys,adminRestoreBlock:()=>Ss,adminRestoreDeletedCollectionProperties:()=>Xs,adminRestoreDeletedGuestPermissions:()=>iu,adminReviveBlocksOnPage:()=>_o,adminRevokeBotToken:()=>Nn,adminRunSpaceConsolidation:()=>ql,adminScheduleHomeDigestEmail:()=>Cp,adminSearchAuditLog:()=>Ul,adminSearchBlocks:()=>Si,adminSearchBots:()=>xu,adminSearchCollectionViews:()=>xi,adminSearchCollections:()=>wi,adminSearchForUsersInSpaces:()=>hi,adminSearchOrganizations:()=>Ci,adminSearchPermanentlyDeletedPages:()=>Ls,adminSearchSpaceActivity:()=>js,adminSearchSpaces:()=>fi,adminSearchTeams:()=>ki,adminSearchUserAdminToolRoles:()=>oi,adminSearchUsers:()=>ni,adminSetAssistantEnabledForSpaces:()=>Pu,adminSetCreatorStripeOnboardingStatus:()=>On,adminSetDisableSpacePublicAccess:()=>ya,adminSetHighWaterMark:()=>ra,adminSetPageContentClassification:()=>so,adminSetSalesAssistedSubscriptionBanner:()=>Xi,adminSetSpaceDomain:()=>ba,adminShowCustomerInvoice:()=>Ta,adminSwapUserDomains:()=>Ma,adminSwapUserEmails:()=>Pa,adminSyncBillingState:()=>Ee,adminTriggerSubscriptionAuditor:()=>aa,adminUpdateAddOnSubscription:()=>Jc,adminUpdateExperiment:()=>Yi,adminUpdateIntegrationData:()=>Il,adminUpdateNotionAIAvailabilityForSpace:()=>ld,adminUpdateNotionCalendarAvailableForSpace:()=>Nu,adminUpdateOrganizationSpaces:()=>Di,adminUpdateSamlConfig:()=>Ri,adminUpdateStatsigSegmentIds:()=>li,adminUpdateSubscription:()=>Ji,adminUpdateTeamMember:()=>yo,adminUpdateUserSettings:()=>bo,adminViewDeletedCollectionProperties:()=>el,adminViewExperiments:()=>$i,aiSourcePicker:()=>nl,allowEducationEmails:()=>sa,allowPrivateSlackIngestion:()=>bp,annotateRecentIntercomConversation:()=>bs,appApiTriggerWithArgs:()=>Y,applyCustomerOffer:()=>yc,applyStudentGitHubGrant:()=>bc,authCreateBackupCodes:()=>zc,authCreateSms:()=>Pn,authCreateTotp:()=>Lc,authGetLoginConfiguration:()=>vn,authSendSms:()=>Rn,authUpdateMfa:()=>Bn,authVerifyBackupCodesLogin:()=>qc,authVerifyPassword:()=>Hc,authVerifySmsEnroll:()=>An,authVerifySmsLogin:()=>Dn,authVerifyTotpEnroll:()=>Kc,authVerifyTotpLogin:()=>jc,authWithAsana:()=>Rr,authWithEvernote:()=>$r,authWithExternalIntegration:()=>Lr,authWithGoogleForDrive:()=>Or,authWithSlack:()=>Nr,authWithTrello:()=>Vr,authenticateConfluenceUser:()=>Ct,authenticateGithubStudent:()=>xp,authenticateJiraUser:()=>Tt,authenticateMondayUser:()=>At,authenticateQuipUser:()=>Dt,bulkAddUsersToOrganizationSpaces:()=>fp,calculateMarketplaceTax:()=>je,calculateTax:()=>Us,calendarTrack:()=>ju,canUserQuerySlack:()=>Ip,canViewChart:()=>Qn,cancelSpaceDeletionForDomain:()=>sc,cancelSubscription:()=>vt,changeEmail:()=>Cn,checkAndApplyPerfmarkTrial:()=>Lp,checkFilePermission:()=>pr,checkSpaceDomain:()=>Vs,claimAndUpgradeSpace:()=>oc,completeMultipartUpload:()=>dc,confirmProductPurchase:()=>Le,connectGoogleDriveForAIIngestion:()=>np,createDebuggingQnaQuery:()=>sd,createDomainVerificationCode:()=>$l,createEmailUser:()=>Ze,createMarketplaceInstallation:()=>Fe,createMarketplaceListingReview:()=>Yd,createOauthAuthorizationCode:()=>Ys,createPublicDomain:()=>Ku,createSpace:()=>va,createTeam:()=>gl,deleteBlocks:()=>Ao,deleteBot:()=>Ns,deleteDomainVerificationCode:()=>Gl,deleteGroup:()=>jo,deleteIntegration:()=>Hd,deleteManagedUser:()=>Ui,deletePublicDomain:()=>Wu,deleteSpace:()=>zn,deleteSpaceForDomain:()=>ac,deleteTemplate:()=>zd,deleteTemplateDraft:()=>qd,deleteUser:()=>qn,disableUserAnalytics:()=>Sr,disconnectAsana:()=>bn,disconnectConfluence:()=>Ft,disconnectDrive:()=>kn,disconnectEvernote:()=>Sn,disconnectGoogleDriveAIIngestion:()=>ap,disconnectMonday:()=>Zt,disconnectQuipAccount:()=>Ut,disconnectSlackIngestion:()=>up,disconnectTrello:()=>_n,duplicateBlock:()=>he,duplicateTemplateBlock:()=>ye,enableTeams:()=>Jn,enqueueScanContentTask:()=>Zu,enqueueTask:()=>an,exportAdminContentSearch:()=>br,exportAuditLog:()=>fr,exportBlock:()=>on,exportBlockPreview:()=>ei,exportContentAnalytics:()=>yr,exportDomainClaimableSpaces:()=>hr,exportSpace:()=>gr,exportSpaceGuests:()=>gu,exportSpaceMembers:()=>mu,exportUserAnalytics:()=>vr,findRelatedContent:()=>Ur,findUser:()=>_e,generateSetup:()=>Zr,generateTemplateScreenshot:()=>rn,getAIUsageEligibility:()=>ed,getAboutNotionDevelopers:()=>Zc,getAccessRequests:()=>Ba,getActiveExportTasks:()=>bd,getActiveImportTasks:()=>be,getActivityFeedForHomePrototypeDoNotUse:()=>xn,getActivityLog:()=>wn,getAdminHistory:()=>ls,getAiSuggestedProperties:()=>id,getAiWaitlistRequestsForSpace:()=>Uu,getAllSpacePermissionGroupsWithMemberCount:()=>Ap,getAllTeamsInSpaceForAdmin:()=>yl,getAsanaAccount:()=>se,getAsanaTaskProperties:()=>ge,getAsanaWorkspacesNames:()=>pe,getAssetsJson:()=>re,getAssetsJsonV2:()=>ie,getAssetsJsonV3:()=>ae,getAssistantAutomationsInSpace:()=>pt,getAuthorizedEmailPreferenceCenterLink:()=>ja,getAvailableCountries:()=>os,getBacklinksForBlock:()=>En,getBacklinksForBlockFanout:()=>Zn,getBacklinksForBlockInitial:()=>Fn,getBacklinksForBlockMultiCell:()=>Fp,getBillingData:()=>Qe,getBillingHistory:()=>mr,getBillingSubscriptionBannerData:()=>_t,getBlockAdminApiLog:()=>ss,getBlockFileDownloadUrl:()=>Ae,getBookmarks:()=>Po,getBotSharedPageIds:()=>wr,getBotToken:()=>Un,getBots:()=>kr,getBraintrustDataset:()=>Fr,getBraintrustDatasetsForProject:()=>at,getBraintrustProjects:()=>st,getCalendarEvents:()=>Lu,getChatTranscriptSessionHistoryForUser:()=>mt,getClientExperiments:()=>Hi,getClientExperimentsV2:()=>Gi,getCollectionViewBlocksByAppId:()=>pc,getCompletion:()=>Br,getCompletionForProperty:()=>nd,getCompletionForSelectOption:()=>rd,getConfluenceAccount:()=>Et,getConfluenceSpaces:()=>Bt,getConnectedAppsForUniversalQna:()=>Ju,getConnectedAppsStatus:()=>Dr,getContentEngagementAnalytics:()=>Ic,getCostForSpaceUpgrade:()=>nc,getCreatorStripeOnboardingStatus:()=>Ne,getCreatorTemplates:()=>Wd,getCurrentTemplateCreatorId:()=>vp,getCustomEmojisForSpace:()=>hp,getCustomerOffer:()=>fc,getCustomerOfferEligibility:()=>hc,getCustomerOfferStatus:()=>vc,getDailyUsersAnalytics:()=>wc,getDataAccessConsent:()=>za,getDataAccessConsentForManagedUser:()=>Oi,getDataForLinkMention:()=>Ws,getDesktopAppRegistration:()=>Nc,getDesktopDownloadUrl:()=>ht,getDeveloperBotsAndIntegrations:()=>xs,getDomainVerificationCodesForSpace:()=>Yl,getEmailDomainSettings:()=>Ki,getEmailDomainsForSpace:()=>Ei,getEmailsWithoutAccessToBlock:()=>il,getEvernoteAccount:()=>le,getEvernoteNotebooks:()=>qr,getExternalCollectionSyncState:()=>rl,getExternalConnectionMetaInfo:()=>Sc,getExternalIntegrationAccessToken:()=>_c,getExternalIntegrations:()=>qs,getExternalNotificationChannels:()=>Ac,getExternalOrgData:()=>Su,getExternalSyncedCollectionInTeams:()=>Yt,getFeatureBillingData:()=>Je,getFieldsForJiraIssues:()=>pl,getFormData:()=>Gn,getFormUploadFileUrl:()=>Wn,getGenericEmbedBlockData:()=>da,getGeoIpLocation:()=>md,getGiphyRandomId:()=>mi,getGoogleDriveAccounts:()=>jr,getGoogleDriveQnAAnnouncementEligibility:()=>cp,getGoogleDriveRecallStatusForUser:()=>sp,getGoogleDriveSyncProgress:()=>lp,getGroupsForTemplateCategories:()=>Md,getGuestsInOrganization:()=>mp,getHistoricalAuditLogUsers:()=>Ce,getHomeContentForOrganization:()=>Eu,getHomeEnabledSpaceViews:()=>Vu,getIdFromUniqueId:()=>$c,getImageFromPdf:()=>ns,getImmediateUpdateCost:()=>Xe,getInAppCategoriesAndTemplates:()=>Qc,getInferenceTestExamples:()=>Bc,getIngestedSlackChannels:()=>_p,getIngestionOptions:()=>Sp,getIntegrationCreatorPartnerStatus:()=>Me,getIntegrationDataForGallery:()=>Sl,getIntegrationDomainVerifications:()=>Is,getIntegrationIdsForGallery:()=>kl,getIntegrationSecret:()=>Cs,getInternalDomains:()=>kt,getInvitesForInvitees:()=>wt,getInvoiceData:()=>ko,getJiraAccount:()=>de,getJiraSitesForWorkspace:()=>Qt,getJoinableSpaces:()=>Io,getLivestormEvents:()=>gt,getLivestormSessions:()=>ft,getLocalizedTemplatesById:()=>Mp,getLoginOptions:()=>hn,getManagedUsers:()=>Fi,getMarketplaceAcquiredListings:()=>Sd,getMarketplaceAcquisitionByProduct:()=>kd,getMembersInOrganization:()=>pp,getMondayFoldersAndBoards:()=>Nt,getMondayUser:()=>Rt,getMondayWorkspaces:()=>Vt,getNotificationLog:()=>Ho,getNotificationLogPrototype:()=>Wo,getNotificationLogV2:()=>Go,getNotificationsForInbox:()=>qo,getOauthMetadata:()=>$o,getOrganizationSettingsOverrides:()=>Fu,getPageAnalytics:()=>gc,getPageAssistantPreferences:()=>ou,getPageSignals:()=>es,getPageVisitors:()=>Ha,getPosts:()=>Pp,getPrivatePageInfo:()=>bl,getProjectsForJiraSite:()=>ul,getPromoCode:()=>ca,getPublicApiObject:()=>Oc,getPublicPageData:()=>Hn,getPublicSpaceData:()=>sr,getPublishedPageCountForOrganizationSpace:()=>Bu,getPublishedPagesForUser:()=>hu,getQnaOnboardingData:()=>xt,getQuipAccount:()=>ue,getRecentPageVisits:()=>De,getRecentlyRemovedUsers:()=>Dl,getRecoverableSpaceUserContent:()=>Al,getSamlConfigForSpace:()=>Bi,getSamlRedirect:()=>yn,getSelectPropertyValues:()=>Ko,getSignedFileUrl:()=>Yp,getSitesOnPublicDomain:()=>$u,getSkillsInSpace:()=>ut,getSlackBulkIngestionStatus:()=>ep,getSlackIngestionAuthorizeUrl:()=>Xu,getSlackPublicChannels:()=>yp,getSnapshotContents:()=>Tr,getSnapshotsList:()=>Cr,getSpaceAdminApiLog:()=>as,getSpaceMembershipUpdates:()=>Jd,getSpaceUserData:()=>Mo,getSpaces:()=>Co,getSpacesCreatedByUserWithDomains:()=>ec,getSpacesInOrganization:()=>Au,getSpacesMultiCell:()=>Zp,getSprintBoardViewBlocks:()=>mc,getStartupReferralPartners:()=>uu,getStatsigResults:()=>Wi,getSubitems:()=>oe,getSubscriptionBanner:()=>bt,getSubscriptionData:()=>yt,getSubscriptionEntitlements:()=>St,getSuggestedPageQna:()=>ad,getSyncControlsForGoogleDriveAIIngestion:()=>dp,getTasks:()=>Ra,getTeamAccessRequestMetadata:()=>gd,getTeams:()=>vl,getTeamsAndProjectsInAsanaWorkspace:()=>me,getTeamsForOrganizationSpace:()=>Va,getTemplateBySlug:()=>Ge,getTemplateCategory:()=>Id,getTemplateCollectionBySlug:()=>Tp,getTemplateContentGroup:()=>He,getTemplateCreator:()=>Cd,getTemplateCreators:()=>Td,getTemplateDrafts:()=>Gd,getTemplateSearchResults:()=>wd,getTemplates:()=>xd,getTestFlightStatus:()=>Da,getTransitivePageRelations:()=>yd,getTrelloAccount:()=>ce,getTrelloBoards:()=>fe,getTypedDatabases:()=>uc,getUniversitiesAndDomains:()=>du,getUnreadAccessRequestCount:()=>La,getUnvisitedNotificationIds:()=>Yo,getUploadFileUrl:()=>jn,getUploadFileUrlForAssistantChatTranscriptUpload:()=>Kn,getUserAdminApiLog:()=>is,getUserAnalyticsSettings:()=>Do,getUserContractionData:()=>Xd,getUserData:()=>To,getUserDevices:()=>ha,getUserEngagementAnalytics:()=>xc,getUserHomePages:()=>ts,getUserNotifications:()=>tr,getUserOrganizations:()=>Ru,getUserSharedPagesInSpace:()=>Ja,getUserSignals:()=>Xa,getUserSophisticationLevel:()=>In,getUserSpaceExternalBots:()=>$s,getUserTasks:()=>Aa,getVerifiedDomainsForOrganization:()=>Na,getVerifiedEmailDomain:()=>Pc,getVerifiedUsersCountForOrganization:()=>Oa,getVisibleUsers:()=>It,getWebClipperData:()=>Hr,getWebhookSubscriptions:()=>xr,getWillBeSubjectToSanctions:()=>et,getWorkspaceOwnersInOrganization:()=>Du,getZendeskTicketConversation:()=>Gs,handleRecordMapForResponse:()=>H,handleSlackNotificationActionForButtonAutomation:()=>Hs,identifySegmentUser:()=>Xo,identifySegmentWorkspace:()=>Jo,importAsanaIntoBetterTemplate:()=>Wt,importConfluenceExport:()=>Kt,importEvernote:()=>nn,importFile:()=>Ot,importGoogleDoc:()=>Lt,importQuip:()=>Ht,importTrello:()=>Gt,inAppGetTemplateByBlockId:()=>Ed,inAppGetTemplateCategories:()=>Pd,inAppGetTemplateCategory:()=>Ad,inAppGetTemplateCollections:()=>Dd,inAppGetTemplateSearchResults:()=>Bd,inAppGetTemplates:()=>Rd,ingestGithub:()=>Dp,ingestSlackPublicData:()=>tp,initializeGoogleDriveBlock:()=>Kr,initializePageTemplate:()=>ti,initializeUserAnalytics:()=>cr,initializeUserAnalyticsEmptySync:()=>dr,initiateCreatorStripeOnboarding:()=>Ue,initiateGoogleDriveDelayedIngestion:()=>rp,initiateMultipartUpload:()=>cc,initiateProductPurchase:()=>Oe,initiateWorkspaceTransfer:()=>tc,insertIntoBraintrustDataset:()=>it,invalidateSubscriptionData:()=>rs,inviteGuestsToSpace:()=>ka,isDesktopVersionCompatible:()=>Ou,isEligibleForGuestMembershipRequest:()=>Ec,isEmailEducation:()=>la,isRecordKeyAvailable:()=>Wc,isUserDomainJoinable:()=>ua,leaveBlock:()=>ar,listExternalCollections:()=>dl,listExternalObjects:()=>ml,listNewPrices:()=>Ye,listPrices:()=>$e,loadBlockSubtree:()=>lr,loadCachedPageChunk:()=>Fo,loadCachedPageChunkBatched:()=>zp,loadCachedPageChunkV2:()=>Zo,loadCachedPageChunks:()=>Uo,loadContacts:()=>Uc,loadContentAnalytics:()=>Tc,loadPageChunk:()=>Vo,loadPageChunkV2:()=>No,loadSearchAnalytics:()=>Mc,loadUniversalObject:()=>dt,loadUserContent:()=>Eo,loadWorkspaceAnalyticsUsers:()=>Cc,loginWithAppleAuth:()=>sn,loginWithAppleNativeAuth:()=>ln,loginWithEmail:()=>cn,loginWithGoogleAuth:()=>un,loginWithGoogleJwt:()=>dn,logout:()=>pn,logoutActiveSessions:()=>ga,logoutManagedUsers:()=>zi,logoutSingleDeviceSession:()=>fa,markDiscussionNotificationsRead:()=>_l,mondayFullImport:()=>tn,moveToSpace:()=>Sa,parallelAsanaImport:()=>Xt,parallelImportConfluenceExport:()=>zt,parallelImportConfluenceViaApi:()=>qt,parallelJiraImport:()=>Jt,parallelMondayImport:()=>en,patchSyncControlsForGoogleDriveAIIngestion:()=>ip,payInvoice:()=>Rp,pendingTaskEventsById:()=>Qp,pendingTaskIds:()=>te,performAiSearch:()=>lt,ping:()=>Qr,postGiphyAnalytics:()=>gi,preprocessAndSaveEncodedPdfTask:()=>ve,processShareActionToBlock:()=>al,publishAiSession:()=>fu,purgeBlockTree:()=>wp,queryCollection:()=>Oo,recordAIUsage:()=>td,recordCookieConsent:()=>wl,recordPageExit:()=>Wa,recordPageVisit:()=>Ga,recoverSpace:()=>Jr,recoverUser:()=>Yr,recoverUserContentInSpace:()=>Bl,refetchExternalObjectInstanceBlocks:()=>cl,refreshGoogleDriveBlock:()=>zr,refreshInviteLink:()=>wa,registerDesktopApp:()=>Vc,releaseSubscriptionSchedule:()=>We,removeManagedUserFromSpace:()=>ji,removeUserFromOrganizationSpaces:()=>Yu,removeUsersFromSpace:()=>xo,renameGroup:()=>Lo,reportBadQnA:()=>Ie,reportBadSearch:()=>xe,reportPage:()=>cs,requestAccess:()=>Ka,requestClaimAndUpgrade:()=>rc,resetExperimentOverrides:()=>ll,resetPasswordsForManagedUsers:()=>qi,resolveAccessRequest:()=>_u,resolveAddress:()=>ws,restoreBlock:()=>Ro,restoreSnapshot:()=>Mr,resubscribeExternalCollection:()=>ol,resyncJiraCollection:()=>Pt,retrieveCreatorStripeDashboardLink:()=>Ve,retrieveMarketplaceProductListing:()=>Be,revokeBotToken:()=>Vn,revokeUserTokens:()=>Xr,runAssistant:()=>Er,runAsyncAiSearch:()=>jt,saveAssistantChatHistory:()=>gp,saveAssistantFeedback:()=>rt,saveTransactions:()=>_a,saveTransactionsMultiCell:()=>Vp,search:()=>Se,searchAuditLog:()=>ke,searchContacts:()=>we,searchGiphyImages:()=>pi,searchIntegrations:()=>Pe,searchPagesInSite:()=>kp,searchUnsplashImages:()=>ui,searchVectors:()=>Dc,searchWebClipperPages:()=>Wr,sendEmailVerification:()=>Tn,sendHIPAACompliancyUpdate:()=>Mn,sendTemporaryPassword:()=>fn,sendVerifyTransferEmail:()=>kc,setAdminPrivilegedTeamMembership:()=>fl,setBookmarkMetadata:()=>Ar,setDataAccessConsent:()=>qa,setDataAccessConsentForManagedUser:()=>Li,setDefaultPaymentMethod:()=>qe,setLocale:()=>Re,setNotificationsAsRead:()=>er,setNotificationsStatus:()=>or,setPageAssistantPreferences:()=>ru,setPageNotificationsAsRead:()=>nr,setPassword:()=>ma,setRecordKey:()=>Gc,setSamlConfig:()=>Xl,setSeenGuestMembershipRequests:()=>Fc,setSpaceNotificationsAsRead:()=>rr,setStatusPropertyDefaults:()=>zo,spaceAdminRestoreAccess:()=>$a,startGoogleDriveSyncForAIIngestion:()=>op,streamCascadeInference:()=>od,stripeAdvanceTestClock:()=>fd,stripeGetTestClock:()=>hd,submitEducationGroupApplication:()=>cu,submitForm:()=>$n,submitFormstack:()=>ot,submitIntegrationPublishRequest:()=>Zd,submitMarketoForm:()=>tt,submitStartupApplication:()=>pu,submitTemplateCreator:()=>Fd,submitTemplateDraft:()=>Ld,submitTemplateDraftBulk:()=>Kd,submitTemplateDraftLocalizedBulk:()=>jd,submitVirtualAttendeeRegistration:()=>nt,suggestRecordKey:()=>Yc,syncJiraProjects:()=>$t,syncRecordValue:()=>Hp,syncRecordValues:()=>Bo,testCreatePage:()=>tu,testDeleteRecord:()=>nu,testMultiCell:()=>Up,testMultiCellFanout:()=>Ep,testMultiCellInitial:()=>Bp,testSetupWorkspace:()=>eu,testWebhookConnection:()=>Ir,trackConversionEvent:()=>Ya,trackSegmentEvent:()=>Qo,transferPermissionGroup:()=>_r,transferSpaceUserContent:()=>Rl,transferWorkspaceToUser:()=>ic,translatePage:()=>jp,unfurlUrl:()=>tl,unsubscribeFromEmails:()=>ir,updateCustomPublicDomainPayment:()=>Gu,updateDisableGuestsOnSpace:()=>lu,updateEmailDomainSettings:()=>Vi,updateExperimentOverride:()=>sl,updateFreeCharts:()=>Yn,updateJiraWebhook:()=>Mt,updateMarketplaceListingReview:()=>Qd,updateOrganization:()=>Ea,updateOrganizationSettings:()=>Ua,updateOrganizationSpaceSettings:()=>Za,updateOrganizationTeamSettings:()=>Fa,updatePaymentMethod:()=>ze,updatePinnedTemplates:()=>$d,updatePublicDomainHomePage:()=>qu,updatePublicDomainName:()=>zu,updatePublicHomePage:()=>Qa,updateSubscription:()=>Ke,updateSubscriptionToEducationPlan:()=>Qi,updateTeamMembers:()=>hl,updateUserProfile:()=>Ni,updateUserRoleInOrganizationSpace:()=>Qu,updateUserSuspension:()=>Zi,updateWorkspaceCreationForEmailDomains:()=>Ql,validateActorOwnsTemplate:()=>Nd,validateCustomPublicDomain:()=>Hu,validateIntegrationName:()=>Te,validateTemplate:()=>Ud,validateTemplateCreatorHandle:()=>Vd,validateTemplateDraftSlug:()=>Od,validateUserCanCreateWorkspace:()=>Jl,verifyDomain:()=>Wl,verifyEmail:()=>mn,warmVectorDBCache:()=>ct});n(757658);var o=n(39593),r=n.n(o),i=n(428084),a=n(354064),s=n(643593),l=n(568626),c=n(159730),d=n(597213),u=n(992149);const p={getPageBacklinks:{initial:"getBacklinksForBlockInitial",fanout:"getBacklinksForBlockFanout"},testMultiCell:{initial:"testMultiCellInitial",fanout:"testMultiCellFanout"},getSpaces:{initial:"getSpacesInitial",fanout:"getSpacesFanout"}};var m=n(145953),g=n(600606),f=n(89101),h=n(598151),v=n(653965),y=n(937850),b=n(203303),_=n(401898),S=n(619584),k=n(95477),w=n(855337),x=n(223823),I=n(249953),C=n(833954),T=n(979947),M=n(433929),P=n(66430),A=n(918514),R=n(80444),D=n(788632),B=n(385555),E=n(879167),F=n(577144),Z=n(633759),U=n(547307),V=n(497977),N=n(811045),O=n(985677);const L="curSpaceId",j={saveTransactions:{splitRequestHandler:function(e){const t=e.requestId,n=[],o={};for(const i of e.transactions){let e,t=!1;i.spaceId&&(e=i.spaceId);for(const o of i.operations){if(!(0,N.IO)(o.pointer.table)){n.push(i),t=!0;break}if(o.pointer.spaceId){if(void 0!==e&&e!==o.pointer.spaceId){n.push(i),t=!0;break}e=o.pointer.spaceId}}if(!t){const t=e||L;o[t]??=[],o[t].push(i)}}const r=[];n.length>0&&r.push({requestData:{requestId:t,transactions:n},type:"main"});for(const i of Object.keys(o)){const e=o[i];e&&e.length>0&&(i===L?r.push({requestData:{requestId:t,transactions:e},type:"currentSpace"}):r.push({requestData:{requestId:t,transactions:e},spaceId:i,type:"space"}))}0===r.length&&r.push({requestData:e,type:"currentSpace"});return r},main:"saveTransactionsMain",space:"saveTransactionsFanout"}};var K=n(504408),z=n(608055),q=n(61202);function H(e){const{environment:t,eventName:n,response:o,userId:r,recordEventListeners:i}=e;if(o&&o.recordMap){const e=m.PF.create(o.recordMap);"syncRecordValues"!==n&&K.fL({environment:t,userId:r,inMemoryRecordCache:t.defaultRecordCache.inMemoryRecordCache,recordMap:e,maybeStaleRecordMap:"loadCachedPageChunk"===n||"loadCachedPageChunks"===n||"loadCachedPageChunkV2"===n,debugSource:"handleRecordMapForResponse",onSetRecordMapPersistComplete:null==i?void 0:i.onSetRecordMapPersistComplete})}}let G;async function W(e,t,n,o){if((0,c.tn)(n.body)){U.showError(n);const t=n.body.clientData&&(0,C.cq)(n.body.clientData);w.K4(e,"show_user_validation_response",{type:null==t?void 0:t.type})}if(n.offline)return n;console.error(n.error);const{RouterStore:r}=e;if(401===n.status&&l.log({level:"error",from:"api",type:"httpTrigger401",data:{eventName:t,isLoggedIn:e.currentUser.isLoggedIn(),miscDataToConvertToString:{response:n},routeName:r.state.route.name}}),403===n.status&&n.headers["content-type"]&&n.headers["content-type"].startsWith("text/html")&&l.logWithSampleRate({logMessage:{level:"error",from:"api",type:"httpTrigger403",data:{eventName:t,isLoggedIn:e.currentUser.isLoggedIn(),miscDataToConvertToString:{response:n},userId:e.currentUser.id,routeName:r.state.route.name}},samplePercentage:1}),401===n.status&&Boolean(n.body&&n.body.errorId)&&e.currentUser.isLoggedIn())switch(r.state.route.name){case"page":if((0,A.Sr)(e)){await V.actuallyLogoutAndDeleteMostLocalData({environment:e,nextLocation:window.location.pathname,logoutOrigin:d.F.PublicPageAccessDenied});break}case"root":case"space":case"onboarding":case"myIntegrations":case"creatorProfile":case"creatorProfileAnalytics":case"creatorProfileTemplates":case"creatorProfileIntegrations":case"studentGroupSignup":if(o&&o===e.currentUser.id){const t=v.Ds((async()=>await V.actuallyLogoutAndDeleteMostLocalData({environment:e,userId:o,doNotRedirect:!0,logoutOrigin:d.F.PageAccessDenied})),1e3);await t();!function(e,t){if((0,c.Jx)(t.body)&&"saml_sso_required"===t.body.clientData.type){const e=(0,C.wf)(M.default.getIntl(),t);Z.Z.setState({...Z.Z.state,loginType:"saml",alert:e})}else if((0,c.Jx)(t.body)&&("login_custom_session_expired"===t.body.clientData.type||"login_generic_session_expired"===t.body.clientData.type)){const e=M.default.getIntl().formatMessage("login_custom_session_expired"===t.body.clientData.type?C.xf.login_custom_session_expired:C.xf.login_generic_session_expired,{errorCode:t.status});Z.Z.setState({...Z.Z.state,alert:e})}z.c4({environment:e,url:f._j.login})}(await V.clearCurrentUser(e),n)}}return n}async function $(e){const{environment:t,eventName:n,data:o,userId:r,tracking:i,abortSignal:a,prefetchCacheKey:s,encoding:d,headers:u,recordEventListeners:m,prefetchMultiCellFanout:g}=e;!function(e){for(const t of Object.keys(e)){const n=e[t];(v.Ft(n)||v.o8(n))&&delete e[t]}}(o);const f=r||t.currentUser.id,h=(0,x.createApiHttpJsonRequestOptions)({environment:t,eventName:n,data:o,activeUserId:f,tracking:i,abortSignal:a,encoding:d,eventListeners:(0,I.getPerformanceEventListeners)({environment:t,eventName:n,isPrefetchRequest:!1}),headers:u});let y;if(s&&t.prefetchCache){let e=s;if(g){if(!(s in p))throw new c.p8("prefetchMultiCellFanout can only enable prefetching for multi-cell api events");e=`${s}-${(0,P.getPrefetchRequestHash)(h)}`}y=t.prefetchCache.getPrefetchedHttpRequest(e,h,a,t.device.isMobileNative)}y??=(0,T.default)(h),F.Z.incrementNumApiCallsInitiated();const b=await y;return F.Z.incrementNumApiCallsCompleted(),"success"===b.type?(H({environment:t,eventName:n,response:b.data,userId:f,recordEventListeners:m}),function(e){const{environment:t,responseUserId:n,eventName:o}=e;if(!n)return;if("saveTransactions"!==o&&"saveTransactionsMain"!==o&&"saveTransactionsFanout"!==o)return;const{id:r}=t.currentUser;if(n!==r){if(G===n)return;const{currentUserStore:e,currentUserRootStore:t,currentUserSettingsStore:i,currentSpaceViewStore:a}=R.default.state,s=r||"<undefined>",c=`currentUser ${s} didn't match user's cookie ${n}`;l.log({from:"client/api",level:"error",type:"currentUserWrong",data:{eventName:o,miscDataToConvertToString:{responseUserId:n,connectionStoreState:D.Z.state,currentUserId:s,userStoreId:e&&e.id,userRootStoreId:t&&t.id,userSettingsStoreId:i&&i.id,currentSpaceViewStoreParentId:a&&a.getParentId()},message:c}}),G=n}else G=void 0}({environment:t,eventName:n,responseUserId:b.headers["X-Notion-User-Id"]}),b):W(t,n,b,f)}function Y(e){return function(t){return $({...t,eventName:e})}}function Q(e){return function(t,n,o,r,i,a,s,l,c,d){return $({environment:t,eventName:e,data:n,userId:o,tracking:r,abortSignal:i,prefetchCacheKey:a,encoding:s,headers:l,prefetchMultiCellFanout:c,recordEventListeners:d})}}function J(e){return function(t){const{environment:n,data:o,userId:r,tracking:i,abortSignal:a,prefetchCacheKey:s,encoding:l,headers:c}=t;return async function*(e){const{eventName:t}=e,{initial:n,fanout:o}=function(e){switch(e){case"getPageBacklinks":return p.getPageBacklinks;case"testMultiCell":return p.testMultiCell;case"getSpaces":return p.getSpaces;default:(0,_.t1)(e)}}(t),r=Y(n),i=Y(o),a=await r(e);if("failed"===a.type)return void(yield a);if(yield a,!a.data.fanoutData)return;const s=async function*(t){const n=await y.Lc(t,10,(async t=>i({...e,data:t.request,headers:t.headers,prefetchMultiCellFanout:!0})));for(const e of n)yield e;const o=n.map((e=>{if("success"===e.type)return e.data.fanoutData})).reduce(((e,t)=>t?e.concat(t):e),[]);o&&o.length&&(yield*s(o))};yield*s(a.data.fanoutData)}({environment:n,eventName:e,data:o,userId:r,tracking:i,abortSignal:a,prefetchCacheKey:s,encoding:l,headers:c})}}function X(e){return async function(t,n,o,r){const i=o||t.currentUser.id,a=(0,x.createApiHttpRequestOptions)({environment:t,eventName:e,data:n,activeUserId:i,tracking:r,abortSignal:void 0,format:"jsonStream"}),s=await(0,T.default)(a);return"failed"===s.type?W(t,e,s,i):(h.H1.is(s.data)||H({environment:t,eventName:e,response:s.data,userId:i}),s)}}async function ee(e){return new Promise(((t,n)=>{Qp.addOnceListener(e,(e=>{t(e)}))}))}const te=new Set;function ne(e){return async function*(t,n){const o={task:{eventName:e,request:n}},r=await an(t,o);if("failed"===r.type)yield{error:r.error,taskStatus:"not_started"};else{const{taskId:o}=r.data;for(te.add(o);;){const r=await ee(o);if("success"===r.state){const n=r.status;H({environment:t,eventName:e,response:n}),yield{value:n,taskStatus:r.state};break}if("failure"===r.state){yield{error:new c.hm(r.error||"Something went wrong.",{eventName:e,request:n},r.clientData),taskStatus:r.state};break}"in_progress"===r.state&&r.status&&(yield{value:r.status,taskStatus:r.state})}}}}const oe=Q("getSubitems"),re=Q("getAssetsJson"),ie=Q("getAssetsJsonV2"),ae=Q("getAssetsJsonV3"),se=Q("getAsanaAccount"),le=Q("getEvernoteAccount"),ce=Q("getTrelloAccount"),de=Q("getJiraAccount"),ue=Q("getQuipAccount"),pe=Q("getAsanaWorkspacesNames"),me=Q("getTeamsAndProjectsInAsanaWorkspace"),ge=Q("getAsanaTaskProperties"),fe=Q("getTrelloBoards"),he=ne("duplicateBlock"),ve=ne("preprocessAndSaveEncodedPdfTask"),ye=ne("duplicateTemplateBlock"),be=Q("getActiveImportTasks"),_e=Q("findUser"),Se=Q("search"),ke=Q("searchAuditLog"),we=Q("searchContacts"),xe=Q("reportBadSearch"),Ie=Q("reportBadQnA"),Ce=Q("getHistoricalAuditLogUsers"),Te=Q("validateIntegrationName"),Me=Q("getIntegrationCreatorPartnerStatus"),Pe=Q("searchIntegrations"),Ae=Q("getBlockFileDownloadUrl"),Re=Q("setlocale"),De=Q("getRecentPageVisits"),Be=Q("retrieveMarketplaceProductListing"),Ee=Q("adminSyncBillingState"),Fe=Q("createMarketplaceInstallation"),Ze=Q("createEmailUser"),Ue=Q("initiateCreatorStripeOnboarding"),Ve=Q("retrieveCreatorStripeDashboardLink"),Ne=Q("getCreatorStripeOnboardingStatus"),Oe=Q("initiateProductPurchase"),Le=Q("confirmProductPurchase"),je=Q("calculateMarketplaceTax"),Ke=Q("updateSubscription"),ze=Q("updatePaymentMethod"),qe=Q("setDefaultPaymentMethod"),He=Q("getTemplateContentGroup"),Ge=Q("getTemplateBySlug"),We=Q("releaseSubscriptionSchedule"),$e=Q("listPrices"),Ye=Q("listNewPrices"),Qe=Q("getBillingData"),Je=Q("getFeatureBillingData"),Xe=Q("getImmediateUpdateCost"),et=Q("getWillBeSubjectToSanctions"),tt=Q("submitMarketoForm"),nt=Q("submitVirtualAttendeeRegistration"),ot=Q("submitFormstack"),rt=Q("saveAssistantFeedback"),it=Q("insertIntoBraintrustDataset"),at=Q("getBraintrustDatasetsForProject"),st=Q("getBraintrustProjects"),lt=Q("performAiSearch"),ct=Q("warmVectorDBCache"),dt=Q("loadUniversalObject"),ut=Q("getSkillsInSpace"),pt=Q("getAssistantAutomationsInSpace"),mt=Q("getChatTranscriptSessionHistoryForUser"),gt=Q("getLivestormEvents"),ft=Q("getLivestormSessions"),ht=Q("getDesktopDownloadUrl"),vt=Q("cancelSubscription"),yt=Q("getSubscriptionData"),bt=Q("getSubscriptionBanner"),_t=Q("getBillingSubscriptionBannerData"),St=Q("getSubscriptionEntitlements"),kt=Q("getInternalDomains"),wt=Q("getInvitesForInvitees"),xt=Q("getQnaOnboardingData"),It=Q("getVisibleUsers"),Ct=Q("authenticateConfluenceUser"),Tt=Q("authenticateJiraUser"),Mt=Q("updateJiraWebhook"),Pt=Q("resyncJiraCollection"),At=Q("authenticateMondayUser"),Rt=Q("getMondayUser"),Dt=Q("authenticateQuipUser"),Bt=Q("getConfluenceSpaces"),Et=Q("getConfluenceAccount"),Ft=Q("disconnectConfluence"),Zt=Q("disconnectMonday"),Ut=Q("disconnectQuipAccount"),Vt=Q("getMondayWorkspaces"),Nt=Q("getMondayFoldersAndBoards"),Ot=ne("importFile"),Lt=ne("importGoogleDoc"),jt=ne("runAsyncAiSearch"),Kt=ne("importConfluenceExport"),zt=ne("parallelImportConfluenceExport"),qt=ne("parallelImportConfluenceViaApi"),Ht=ne("importQuip"),Gt=ne("importTrello"),Wt=ne("importAsanaIntoBetterTemplate"),$t=Q("syncJiraProjects"),Yt=Q("getExternalSyncedCollectionInTeams"),Qt=Q("getJiraSitesForWorkspace"),Jt=ne("parallelJiraImport"),Xt=ne("parallelAsanaImport"),en=ne("parallelMondayImport"),tn=ne("mondayFullImport"),nn=ne("importEvernote"),on=ne("exportBlock"),rn=ne("generateTemplateScreenshot"),an=Q("enqueueTask"),sn=Q("loginWithAppleAuth"),ln=Q("loginWithAppleNativeAuth"),cn=Q("loginWithEmail"),dn=Q("loginWithGoogleJwt"),un=Q("loginWithGoogleAuth"),pn=Q("logout"),mn=Q("verifyEmail"),gn=Q("addWebClipperFile"),fn=Q("sendTemporaryPassword"),hn=Q("getLoginOptions"),vn=Q("authGetLoginConfiguration"),yn=Q("getSamlRedirect"),bn=Q("disconnectAsana"),_n=Q("disconnectTrello"),Sn=Q("disconnectEvernote"),kn=Q("disconnectDrive"),wn=Q("getActivityLog"),xn=Q("getActivityFeedForHomePrototypeDoNotUse"),In=Q("getUserSophisticationLevel"),Cn=Q("changeEmail"),Tn=Q("sendEmailVerification"),Mn=Q("sendHIPAACompliancyUpdate"),Pn=Q("authCreateSms"),An=Q("authVerifySmsEnroll"),Rn=Q("authSendSms"),Dn=Q("authVerifySmsLogin"),Bn=Q("authUpdateMfa"),En=Q("getBacklinksForBlock"),Fn=Q("getBacklinksForBlockInitial"),Zn=Q("getBacklinksForBlockFanout"),Un=Q("getBotToken"),Vn=Q("revokeBotToken"),Nn=Q("adminRevokeBotToken"),On=Q("adminSetCreatorStripeOnboardingStatus"),Ln=Q("adminEmployeeSubscriptionUpdate"),jn=Q("getUploadFileUrl"),Kn=Q("getUploadFileUrlForAssistantChatTranscriptUpload"),zn=ne("deleteSpace"),qn=Q("deleteUser"),Hn=Q("getPublicPageData"),Gn=Q("getFormData"),Wn=Q("getFormUploadFileUrl"),$n=Q("submitForm"),Yn=Q("updateFreeCharts"),Qn=Q("canViewChart"),Jn=Q("enableTeams"),Xn=Q("adminDeleteUser"),eo=Q("adminAddZeroRetentionSpace"),to=Q("adminCheckHIPAAComplianceStatus"),no=Q("adminListData"),oo=Q("adminEditBlockPermissions"),ro=Q("adminReadBlockPermissions"),io=Q("adminEditSpacePermissions"),ao=Q("adminDescribeEditSpacePermission"),so=Q("adminSetPageContentClassification"),lo=Q("adminDisableReverifyForUser"),co=Q("adminDescribeSpacesToDelete"),uo=Q("adminDescribeRunSpaceConsolidation"),po=Q("adminDeleteSpaces"),mo=Q("adminDescribeAccountsToReset"),go=Q("adminOnboardAISlackQnA"),fo=Q("adminQnACheckIndexingStatus"),ho=Q("adminResetAccounts"),vo=Q("adminEditTeamMembership"),yo=Q("adminUpdateTeamMember"),bo=Q("adminUpdateUserSettings"),_o=Q("adminReviveBlocksOnPage"),So=Q("adminDescribeBlocksOnPageToRevive"),ko=Q("getInvoiceData"),wo=Q("addUsersToSpace"),xo=Q("removeUsersFromSpace"),Io=Q("getJoinableSpaces"),Co=Q("getSpaces"),To=Q("getUserData"),Mo=Q("getSpaceUserData"),Po=Q("getBookmarks"),Ao=Q("deleteBlocks"),Ro=Q("restoreBlock"),Do=Q("getUserAnalyticsSettings"),Bo=Q("syncRecordValues"),Eo=Q("loadUserContent"),Fo=Y("loadCachedPageChunk"),Zo=Y("loadCachedPageChunkV2"),Uo=Y("loadCachedPageChunks"),Vo=Y("loadPageChunk"),No=Y("loadPageChunkV2"),Oo=Q("queryCollection"),Lo=ne("renameGroup"),jo=ne("deleteGroup"),Ko=Q("getSelectPropertyValues"),zo=Q("setStatusPropertyDefaults"),qo=Q("getNotificationsForInbox"),Ho=Q("getNotificationLog"),Go=Q("getNotificationLogV2"),Wo=Q("getNotificationLogPrototype"),$o=Q("getOauthMetadata"),Yo=Q("getUnvisitedNotificationIds"),Qo=Q("trackSegmentEvent"),Jo=Q("identifySegmentWorkspace"),Xo=Q("identifySegmentUser"),er=Q("setNotificationsAsRead"),tr=Q("getUserNotifications"),nr=Q("setPageNotificationsAsRead"),or=Q("setNotificationsStatus"),rr=Q("setSpaceNotificationsAsRead"),ir=Q("unsubscribeFromEmails"),ar=Q("leaveBlock"),sr=Q("getPublicSpaceData"),lr=Q("loadBlockSubtree"),cr=Q("initializeUserAnalytics"),dr=Q("initializeUserAnalyticsEmptySync"),ur=Q("getSignedFileUrls"),pr=Q("checkFilePermission"),mr=Q("getBillingHistory"),gr=ne("exportSpace"),fr=ne("exportAuditLog"),hr=ne("exportDomainClaimableSpaces"),vr=ne("exportUserAnalytics"),yr=ne("exportContentAnalytics"),br=ne("exportAdminContentSearch"),_r=Q("transferPermissionGroup"),Sr=Q("disableUserAnalytics"),kr=Q("getBots"),wr=Q("getBotSharedPageIds"),xr=Q("getWebhookSubscriptions"),Ir=Q("testWebhookConnection"),Cr=Q("getSnapshotsList"),Tr=Q("getSnapshotContents"),Mr=ne("restoreSnapshot"),Pr=Q("activateReferral"),Ar=Q("setBookmarkMetadata"),Rr=Q("authWithAsana"),Dr=Q("getConnectedAppsStatus"),Br=X("getCompletion"),Er=X("runAssistant"),Fr=X("getBraintrustDataset"),Zr=X("generateSetup"),Ur=Q("findRelatedContent"),Vr=Q("authWithTrello"),Nr=Q("authWithSlack"),Or=Q("authWithGoogleForDrive"),Lr=Q("authWithExternalIntegration"),jr=Q("getGoogleDriveAccounts"),Kr=Q("initializeGoogleDriveBlock"),zr=Q("refreshGoogleDriveBlock"),qr=Q("getEvernoteNotebooks"),Hr=Q("getWebClipperData"),Gr=Q("addWebClipperURLs"),Wr=Q("searchWebClipperPages"),$r=Q("authWithEvernote"),Yr=Q("recoverUser"),Qr=Q("ping"),Jr=Q("recoverSpace"),Xr=Q("revokeUserTokens"),ei=Q("exportBlockPreview"),ti=Q("initializePageTemplate"),ni=Q("adminSearchUsers"),oi=Q("adminSearchUserAdminToolRoles"),ri=Q("adminGetClientExperiments"),ii=Q("adminGetStatsigExperiment"),ai=Q("adminGetStatsigFeatureGate"),si=Q("adminCheckStatsigSegment"),li=Q("adminUpdateStatsigSegmentIds"),ci=Q("adminFindDeletedUser"),di=Q("adminAllowlistCreditDomain"),ui=Q("searchUnsplashImages"),pi=Q("searchGiphyImages"),mi=Q("getGiphyRandomId"),gi=Q("postGiphyAnalytics"),fi=Q("adminSearchSpaces"),hi=Q("adminSearchForUsersInSpaces"),vi=Q("adminGetDataAccessConsent"),yi=Q("adminGetBulkSpaceIdsByDomain"),bi=Q("adminGetBulkSpaceIdsByEmail"),_i=Q("adminGetBulkUserIdsByEmail"),Si=Q("adminSearchBlocks"),ki=Q("adminSearchTeams"),wi=Q("adminSearchCollections"),xi=Q("adminSearchCollectionViews"),Ii=Q("adminQueryCollectionReplay"),Ci=Q("adminSearchOrganizations"),Ti=Q("adminRecoverMfa"),Mi=Q("adminRemoveSpaceUsersAndTransferContent"),Pi=Q("adminGetUserBillingInformation"),Ai=Q("adminBypassEmailReputationChecks"),Ri=Q("adminUpdateSamlConfig"),Di=Q("adminUpdateOrganizationSpaces"),Bi=Q("getSamlConfigForSpace"),Ei=Q("getEmailDomainsForSpace"),Fi=Q("getManagedUsers"),Zi=Q("updateUserSuspension"),Ui=Q("deleteManagedUser"),Vi=Q("updateEmailDomainSettings"),Ni=Q("updateUserProfile"),Oi=Q("getDataAccessConsentForManagedUser"),Li=Q("setDataAccessConsentForManagedUser"),ji=Q("removeManagedUserFromSpace"),Ki=Q("getEmailDomainSettings"),zi=Q("logoutManagedUsers"),qi=Q("resetPasswordsForManagedUsers"),Hi=Q("getClientExperiments"),Gi=Q("getClientExperimentsV2"),Wi=Q("getStatsigResults"),$i=Q("adminViewExperiments"),Yi=Q("adminUpdateExperiment"),Qi=Q("updateSubscriptionToEducationPlan"),Ji=Q("adminUpdateSubscription"),Xi=Q("adminSetSalesAssistedSubscriptionBanner"),ea=Q("adminBulkSetSalesAssistedSubscriptionBanner"),ta=Q("adminGetSubscriptionBannerHistory"),na=Q("adminGetSubscriptionBannerState"),oa=Q("adminGetUnrepresentableState"),ra=Q("adminSetHighWaterMark"),ia=Q("adminCancelSubscription"),aa=Q("adminTriggerSubscriptionAuditor"),sa=Q("allowEducationEmails"),la=Q("isEmailEducation"),ca=Q("getPromoCode"),da=Q("getGenericEmbedBlockData"),ua=Q("isUserDomainJoinable"),pa=Q("adminChangeEmail"),ma=Q("setPassword"),ga=Q("logoutActiveSessions"),fa=Q("logoutSingleDeviceSession"),ha=Q("getUserDevices"),va=Q("createSpace"),ya=Q("adminSetDisableSpacePublicAccess"),ba=Q("adminSetSpaceDomain"),_a=Q("saveTransactions"),Sa=ne("moveToSpace"),ka=Q("inviteGuestsToSpace"),wa=Q("refreshInviteLink"),xa=Q("adminAddPublicEmailDomains"),Ia=Q("adminAddPreservedSpaces"),Ca=Q("adminRemovePreservedSpaces"),Ta=Q("adminShowCustomerInvoice"),Ma=Q("adminSwapUserDomains"),Pa=Q("adminSwapUserEmails"),Aa=Q("getUserTasks"),Ra=Q("getTasks"),Da=Q("getTestFlightStatus"),Ba=Q("getAccessRequests"),Ea=Q("updateOrganization"),Fa=Q("updateOrganizationTeamSettings"),Za=Q("updateOrganizationSpaceSettings"),Ua=Q("updateOrganizationSettings"),Va=Q("getTeamsForOrganizationSpace"),Na=Q("getVerifiedDomainsForOrganization"),Oa=Q("getVerifiedUsersCountForOrganization"),La=Q("getUnreadAccessRequestCount"),ja=Q("getAuthorizedEmailPreferenceCenterLink"),Ka=Q("requestAccess"),za=Q("getDataAccessConsent"),qa=Q("setDataAccessConsent"),Ha=Q("getPageVisitors"),Ga=Q("recordPageVisit"),Wa=Q("recordPageExit"),$a=Q("spaceAdminRestoreAccess"),Ya=Q("trackConversionEvent"),Qa=Q("updatePublicHomePage"),Ja=Q("getUserSharedPagesInSpace"),Xa=Q("getUserSignals"),es=Q("getPageSignals"),ts=Q("getUserHomePages"),ns=Q("getImageFromPdf"),os=Q("getAvailableCountries"),rs=Q("invalidateSubscriptionData"),is=Q("getUserAdminApiLog"),as=Q("getSpaceAdminApiLog"),ss=Q("getBlockAdminApiLog"),ls=Q("getAdminHistory"),cs=Q("reportPage"),ds=Q("adminGetOwnership"),us=Q("adminGetCurrentUserPermissions"),ps=Q("adminGetRateLimits"),ms=Q("adminGetSamlConfig"),gs=Q("adminPrimaryWorkspaceChange"),fs=Q("adminDeleteFileFromS3"),hs=Q("adminDescribeDeleteFileFromS3"),vs=Q("adminGetSpacesForAllowedEmailDomain"),ys=Q("adminResetRateLimits"),bs=Q("annotateRecentIntercomConversation"),_s=Q("adminModifyBlock"),Ss=Q("adminRestoreBlock"),ks=Q("adminDescribeDeletedBlockPermissions"),ws=Q("resolveAddress"),xs=Q("getDeveloperBotsAndIntegrations"),Is=Q("getIntegrationDomainVerifications"),Cs=Q("getIntegrationSecret"),Ts=Q("adminBulkAddPromotionCodes"),Ms=Q("adminBulkRemoveSpaceGuests"),Ps=Q("adminGetPremiumFeatureAvailabilities"),As=Q("adminOverridePremiumFeatureAvailability"),Rs=Q("adminOverrideInternalDomains"),Ds=Q("adminRemoveAllowedEducationEmails"),Bs=Q("adminBulkApplyPromotionCodes"),Es=Q("adminPartnerStackFixMissingProductKeys"),Fs=Q("adminMonetizationTaskRunnerEnqueue"),Zs=Q("adminBulkUpgradeEduPlusUser"),Us=Q("calculateTax"),Vs=Q("checkSpaceDomain"),Ns=Q("deleteBot"),Os=Q("adminBlockEmailDomain"),Ls=Q("adminSearchPermanentlyDeletedPages"),js=Q("adminSearchSpaceActivity"),Ks=Q("adminCopyPageBetweenEnvironments"),zs=Q("adminCountWordsInPage"),qs=Q("getExternalIntegrations"),Hs=Q("handleSlackNotificationActionForButtonAutomation"),Gs=Q("getZendeskTicketConversation"),Ws=Q("getDataForLinkMention"),$s=Q("getUserSpaceExternalBots"),Ys=Q("createOauthAuthorizationCode"),Qs=Q("adminGetPublicPages"),Js=Q("adminGetPublicDomainStatus"),Xs=Q("adminRestoreDeletedCollectionProperties"),el=Q("adminViewDeletedCollectionProperties"),tl=Q("unfurlUrl"),nl=Q("aiSourcePicker"),ol=Q("resubscribeExternalCollection"),rl=Q("getExternalCollectionSyncState"),il=Q("getEmailsWithoutAccessToBlock"),al=Q("processShareActionToBlock"),sl=Q("updateExperimentOverride"),ll=Q("resetExperimentOverrides"),cl=Q("refetchExternalObjectInstanceBlocks"),dl=Q("listExternalCollections"),ul=Q("getProjectsForJiraSite"),pl=Q("getFieldsForJiraIssues"),ml=Q("listExternalObjects"),gl=Q("createTeam"),fl=Q("setAdminPrivilegedTeamMembership"),hl=Q("updateTeamMembers"),vl=Q("getTeams"),yl=Q("getAllTeamsInSpaceForAdmin"),bl=Q("getPrivatePageInfo"),_l=Q("markDiscussionNotificationsRead"),Sl=Q("getIntegrationDataForGallery"),kl=Q("getIntegrationIdsForGallery"),wl=Q("recordCookieConsent"),xl=Q("adminGetIntegrationData"),Il=Q("adminUpdateIntegrationData"),Cl=Q("adminGetSlackIntegrationData"),Tl=Q("adminGetSyncedDatabaseData"),Ml=Q("adminJoinSpacesForOauthRedirect"),Pl=Q("adminForceResyncExternalObjects"),Al=Q("getRecoverableSpaceUserContent"),Rl=Q("transferSpaceUserContent"),Dl=Q("getRecentlyRemovedUsers"),Bl=Q("recoverUserContentInSpace"),El=Q("adminCreateMarketingRoute"),Fl=Q("adminBanUser"),Zl=Q("adminBulkBanUsers"),Ul=Q("adminSearchAuditLog"),Vl=Q("adminIsSpaceDomainClaimEligible"),Nl=Q("adminGetDomainClaimEligibleSpaces"),Ol=Q("adminGetDomainManagementSettings"),Ll=Q("adminClaimAndUpgradeForSalesAssisted"),jl=Q("adminDelayClaimSpaceDeletion"),Kl=Q("adminRemoveChildFromExternalCollection"),zl=Q("adminCancelSpaceConsolidation"),ql=Q("adminRunSpaceConsolidation"),Hl=Q("adminGetSpaceIdsForDeletionDate"),Gl=Q("deleteDomainVerificationCode"),Wl=Q("verifyDomain"),$l=Q("createDomainVerificationCode"),Yl=Q("getDomainVerificationCodesForSpace"),Ql=Q("updateWorkspaceCreationForEmailDomains"),Jl=Q("validateUserCanCreateWorkspace"),Xl=Q("setSamlConfig"),ec=Q("getSpacesCreatedByUserWithDomains"),tc=Q("initiateWorkspaceTransfer"),nc=Q("getCostForSpaceUpgrade"),oc=Q("claimAndUpgradeSpace"),rc=Q("requestClaimAndUpgrade"),ic=Q("transferWorkspaceToUser"),ac=Q("deleteSpaceForDomain"),sc=Q("cancelSpaceDeletionForDomain"),lc=Q("adminDowngradeFraudSubscription"),cc=Q("initiateMultipartUpload"),dc=Q("completeMultipartUpload"),uc=Q("getTypedDatabases"),pc=Q("getCollectionViewBlocksByAppId"),mc=Q("getSprintBoardViewBlocks"),gc=Q("getPageAnalytics"),fc=Q("getCustomerOffer"),hc=Q("getCustomerOfferEligibility"),vc=Q("getCustomerOfferStatus"),yc=Q("applyCustomerOffer"),bc=Q("applyStudentGitHubGrant"),_c=Q("getExternalIntegrationAccessToken"),Sc=Q("getExternalConnectionMetaInfo"),kc=Q("sendVerifyTransferEmail"),wc=Q("getDailyUsersAnalytics"),xc=Q("getUserEngagementAnalytics"),Ic=Q("getContentEngagementAnalytics"),Cc=Q("loadWorkspaceAnalyticsUsers"),Tc=Q("loadContentAnalytics"),Mc=Q("loadSearchAnalytics"),Pc=Q("getVerifiedEmailDomain"),Ac=Q("getExternalNotificationChannels"),Rc=Q("adminContentSearch"),Dc=Q("searchVectors"),Bc=Q("getInferenceTestExamples"),Ec=Q("isEligibleForGuestMembershipRequest"),Fc=Q("setSeenGuestMembershipRequests"),Zc=Q("getAboutNotionDevelopers"),Uc=Q("loadContacts"),Vc=Q("registerDesktopApp"),Nc=Q("getDesktopAppRegistration"),Oc=Q("getPublicApiObject"),Lc=Q("authCreateTotp"),jc=Q("authVerifyTotpLogin"),Kc=Q("authVerifyTotpEnroll"),zc=Q("authCreateBackupCodes"),qc=Q("authVerifyBackupCodesLogin"),Hc=Q("authVerifyPassword"),Gc=Q("setRecordKey"),Wc=Q("isRecordKeyAvailable"),$c=Q("getIdFromUniqueId"),Yc=Q("suggestRecordKey"),Qc=Q("getInAppCategoriesAndTemplates"),Jc=Q("adminUpdateAddOnSubscription"),Xc=Q("adminReleaseSubscriptionSchedule"),ed=Q("getAIUsageEligibility"),td=Q("recordAIUsage"),nd=X("getCompletionForProperty"),od=X("streamCascadeInference"),rd=Q("getCompletionForSelectOption"),id=Q("getAiSuggestedProperties"),ad=Q("getSuggestedPageQna"),sd=Q("createDebuggingQnaQuery"),ld=Q("adminUpdateNotionAIAvailabilityForSpace"),cd=Q("adminGetSpaceMembershipUpdates"),dd=Q("adminGetProcessedSpaceMembershipUpdates"),ud=Q("adminFlushSpaceMembershipUpdates"),pd=Q("adminBulkCreateTimedTrials"),md=Q("getGeoIpLocation"),gd=Q("getTeamAccessRequestMetadata"),fd=Q("stripeAdvanceTestClock"),hd=Q("stripeGetTestClock"),vd=Q("adminOptOutNotionAIDataSharing"),yd=Q("getTransitivePageRelations"),bd=Q("getActiveExportTasks"),_d=Q("adminGetBulkIds"),Sd=Q("getMarketplaceAcquiredListings"),kd=Q("getMarketplaceAcquisitionByProduct"),wd=Q("getTemplateSearchResults"),xd=Q("getTemplates"),Id=Q("getTemplateCategory"),Cd=Q("getTemplateCreator"),Td=Q("getTemplateCreators"),Md=Q("getGroupsForTemplateCategories"),Pd=Q("inAppGetTemplateCategories"),Ad=Q("inAppGetTemplateCategory"),Rd=Q("inAppGetTemplates"),Dd=Q("inAppGetTemplateCollections"),Bd=Q("inAppGetTemplateSearchResults"),Ed=Q("inAppGetTemplateByBlockId"),Fd=Q("submitTemplateCreator"),Zd=Q("submitIntegrationPublishRequest"),Ud=Q("validateTemplate"),Vd=Q("validateTemplateCreatorHandle"),Nd=Q("validateActorOwnsTemplate"),Od=Q("validateTemplateDraftSlug"),Ld=Q("submitTemplateDraft"),jd=Q("submitTemplateDraftLocalizedBulk"),Kd=Q("submitTemplateDraftBulk"),zd=Q("deleteTemplate"),qd=Q("deleteTemplateDraft"),Hd=Q("deleteIntegration"),Gd=Q("getTemplateDrafts"),Wd=Q("getCreatorTemplates"),$d=Q("updatePinnedTemplates"),Yd=Q("createMarketplaceListingReview"),Qd=Q("updateMarketplaceListingReview"),Jd=Q("getSpaceMembershipUpdates"),Xd=Q("getUserContractionData"),eu=Q("testSetupWorkspace"),tu=Q("testCreatePage"),nu=Q("testDeleteRecord"),ou=Q("getPageAssistantPreferences"),ru=Q("setPageAssistantPreferences"),iu=Q("adminRestoreDeletedGuestPermissions"),au=Q("adminDescribeRestoreDeletedGuestPermissions"),su=Q("adminAddLinkPreviewToSpace"),lu=Q("updateDisableGuestsOnSpace"),cu=Q("submitEducationGroupApplication"),du=Q("getUniversitiesAndDomains"),uu=Q("getStartupReferralPartners"),pu=Q("submitStartupApplication"),mu=Q("exportSpaceMembers"),gu=Q("exportSpaceGuests"),fu=Q("publishAiSession"),hu=Q("getPublishedPagesForUser"),vu=Q("adminIsWorkspaceInQnA"),yu=Q("adminMergeUsers"),bu=Q("adminRecoverUserContentInSpace"),_u=Q("resolveAccessRequest"),Su=Q("getExternalOrgData"),ku=Q("addUserToWaitlist"),wu=Q("adminGetWorkspaceWebhookSubscriptions"),xu=Q("adminSearchBots"),Iu=Q("adminGetAutomationsForRecordId"),Cu=Q("adminGetAutomationRecurrenceStatus"),Tu=Q("adminBulkAddEduUniversitiesAndDomains"),Mu=Q("adminBulkSetStartupReferralPartners"),Pu=Q("adminSetAssistantEnabledForSpaces"),Au=Q("getSpacesInOrganization"),Ru=Q("getUserOrganizations"),Du=Q("getWorkspaceOwnersInOrganization"),Bu=Q("getPublishedPageCountForOrganizationSpace"),Eu=Q("getHomeContentForOrganization"),Fu=Q("getOrganizationSettingsOverrides"),Zu=Q("enqueueScanContentTask"),Uu=Q("getAiWaitlistRequestsForSpace"),Vu=Q("getHomeEnabledSpaceViews"),Nu=Q("adminUpdateNotionCalendarAvailableForSpace"),Ou=Q("isDesktopVersionCompatible"),Lu=Q("getCalendarEvents"),ju=Q("calendarTrack"),Ku=Q("createPublicDomain"),zu=Q("updatePublicDomainName"),qu=Q("updatePublicDomainHomePage"),Hu=Q("validateCustomPublicDomain"),Gu=Q("updateCustomPublicDomainPayment"),Wu=Q("deletePublicDomain"),$u=Q("getSitesOnPublicDomain"),Yu=Q("removeUserFromOrganizationSpaces"),Qu=Q("updateUserRoleInOrganizationSpace"),Ju=Q("getConnectedAppsForUniversalQna"),Xu=Q("getSlackIngestionAuthorizeUrl"),ep=Q("getSlackBulkIngestionStatus"),tp=Q("ingestSlackPublicData"),np=Q("connectGoogleDriveForAIIngestion"),op=Q("startGoogleDriveSyncForAIIngestion"),rp=Q("initiateGoogleDriveDelayedIngestion"),ip=Q("patchSyncControlsForGoogleDriveAIIngestion"),ap=Q("disconnectGoogleDriveAIIngestion"),sp=Q("getGoogleDriveRecallStatusForUser"),lp=Q("getGoogleDriveSyncProgress"),cp=Q("getGoogleDriveQnAAnnouncementEligibility"),dp=Q("getSyncControlsForGoogleDriveAIIngestion"),up=Q("disconnectSlackIngestion"),pp=Q("getMembersInOrganization"),mp=Q("getGuestsInOrganization"),gp=Q("saveAssistantChatHistory"),fp=Q("bulkAddUsersToOrganizationSpaces"),hp=Q("getCustomEmojisForSpace"),vp=Q("getCurrentTemplateCreatorId"),yp=Q("getSlackPublicChannels"),bp=Q("allowPrivateSlackIngestion"),_p=Q("getIngestedSlackChannels"),Sp=Q("getIngestionOptions"),kp=Q("searchPagesInSite"),wp=Q("purgeBlockTree"),xp=Q("authenticateGithubStudent"),Ip=Q("canUserQuerySlack"),Cp=Q("adminScheduleHomeDigestEmail"),Tp=Q("getTemplateCollectionBySlug"),Mp=Q("getLocalizedTemplatesById"),Pp=Q("getPosts"),Ap=Q("getAllSpacePermissionGroupsWithMemberCount"),Rp=Q("payInvoice"),Dp=Q("ingestGithub"),Bp=Q("testMultiCellInitial"),Ep=Q("testMultiCellFanout"),Fp=J("getPageBacklinks"),Zp=J("getSpaces"),Up=J("testMultiCell"),Vp=(Np="saveTransactions",async function*(e){const{data:t}=e,n=Y(j[Np].main),o=Y(j[Np].space),{splitRequestHandler:r}=j[Np],i=r(t),a=await y.Lc(i,10,(async t=>{if("main"===t.type)return{request:t.requestData,response:await n({...e,data:t.requestData})};if("space"===t.type){const n=e.headers,r=(0,O.Bb)({spaceId:t.spaceId});for(const e of(0,_.Yd)(r)){const t=r[e];t&&(n[e]=t)}return{request:t.requestData,response:await o({...e,headers:n,data:t.requestData})}}if("currentSpace"===t.type)return{request:t.requestData,response:await o({...e,data:t.requestData})};(0,_.t1)(t)}));for(const s of a)yield s});var Np;const Op=Q("adminBlockApiBots"),Lp=Q("checkAndApplyPerfmarkTrial"),jp=Y("translatePage"),Kp=new i.Z({performRequests:async e=>{const{environment:t}=e[0];if(B.default.checkGate({gateName:"load_page_chunk_multi_cell_enabled"})){const n=v.vM(e,(e=>{const t=e.headers;return t[u.HY]||t[u.YM]}));await y.Lc(Object.values(n),10,(async e=>{if(e.length>0){const n=await Uo({environment:t,data:{requests:e.map((e=>e.args))},headers:e[0].headers});if("failed"===n.type)throw n.error}}))}else{const n=e.map((e=>e.args)),o=await Uo({environment:t,data:{requests:n},headers:{}});if("failed"===o.type)throw o.error}return[]},batchSize:50,maxWorkers:2,requestDelayMs:20,requestTimeoutMs:10*S.C0});async function zp(e,t,n){return await Kp.enqueue({environment:e,args:t,headers:n})}const qp=new i.Z({performRequests:async e=>{const t=new Array(e.length),n=e.map(((e,t)=>({environment:e.environment,request:e.args,index:t}))),o=v.vM(n,(e=>e.request.userId));for(const[r,i]of Object.entries(o)){const e=i[0].environment,n=[];for(const{request:t}of i){const{pointer:e,version:o}=t;n.push({pointer:e,version:o})}const o=await Bo(e,{requests:n},"undefined"===r?void 0:r);if("failed"===o.type)throw o.error;const a=m.PF.create(o.data.recordMap);E.Z.addFromRecordMapWithRole(a),E.Z.isEmpty()||q.dY({environment:e});for(const{request:r,index:s}of i)if(r.pointer){const e=a.getValue(r.pointer),n=a.getRole(r.pointer);n&&(t[s]={value:e,role:n})}}return t},batchSize:500,maxWorkers:2,requestDelayMs:20,requestTimeoutMs:30*S.C0});async function Hp(e,t){if(t.pointer&&(0,g.Ok)(t.pointer))try{const n=await qp.enqueue({environment:e,args:t});return n||-1!==t.version?n:{value:void 0,role:"editor"}}catch(n){console.error("syncRecordValue error",n)}}function Gp(e){return[e.url,e.downloadName,e.download].filter(Boolean).join(":")}const Wp=new class{constructor(){this.lru=new(r())({max:1e3,maxAge:S.U6})}set(e,t){this.lru.set(Gp(e),t)}get(e){return this.lru.get(Gp(e))}},$p=new i.Z({performRequests:async e=>{const t=e.map((e=>{let{url:t}=e;return t})),n=await ur(e[0].environment,{urls:t});if("failed"===n.type)throw n.error;const{signedUrls:o}=n.data;return t.forEach(((e,t)=>{const n=o[t];Wp.set(e,n)})),o},batchSize:500,maxWorkers:1});async function Yp(e,t,n){const o=Wp.get(t);let r;return r=o||await $p.enqueue({environment:e,url:t}),r&&(0,s.x$)(r)&&n&&(r=(0,b.NV)({httpUrl:r,protocol:k.default.protocol,includePort:!0})),r}const Qp=new a.Z},696454:(e,t,n)=>{n.d(t,{Bs:()=>ve,_S:()=>be,qY:()=>xe,mc:()=>he,KJ:()=>_e,Uz:()=>ye});var o=n(350112),r=n(815145),i=n(682813),a=n(568626),s=n(597213),l=n(421202),c=n(213493),d=n(865311),u=n(519889),p=n(766079),m=n(328182),g=n(109852),f=n(554153),h=n(657347),v=n(307032),y=n(218265),b=n(619584),_=n(325320),S=n(855337),k=n(120315),w=n(484210),x=n(798165),I=n(918514),C=n(774482),T=n(785751),M=n(600051),P=n(80444),A=n(156681),R=n(781258),D=n(269327),B=n(864970),E=n(193220),F=n(272014),Z=n(489523),U=n(206258),V=n(832470),N=n(787956),O=n(629026),L=n(897630),j=n(228517),K=(n(21703),n(401898)),z=n(749085);class q extends z.default{getInitialState(){return{loaded:!1,loading:!1}}}const H=new q;var G=n(21359);var W=n(632441),$=n(798688),Y=n(950950),Q=n(547307),J=n(957400),X=n(391367),ee=n(294273),te=n(497977),ne=n(98958),oe=n(717659),re=n(731304),ie=n(640277),ae=n(132953),se=n(608055),le=n(587531),ce=n(29974),de=n(210228),ue=n(61202),pe=n(970782),me=n(712321),ge=n(237181),fe=n(165452);function he(e){P.default.setState(P.default.getInitialState());const{id:t}=e.currentUser;(!P.default.state.currentUserStore||t&&t!==P.default.state.currentUserStore.id)&&(t?(me.j(e,t),ee.Bk(e,t),_e(e,t)):(P.default.setState({...P.default.state,initialized:!0}),Y.dd(e)))}function ve(){const{currentSpaceStore:e}=P.default.getState();return e?e.id:void 0}async function ye(e){const{nextRoute:t,currentRoute:n,environment:u,query:p}=e,m=P.default.state.mainEditorCurrentBlockStore,f=P.default.state.currentCollectionViewStore,b=u.currentUser.id,x=e=>{P.default.state.lastUpdater===x&&(u.device.isMobileNative&&e.currentSpaceStore&&a.log({level:"info",from:"appActions",type:"SpaceSwitchingDebug",data:{message:"AppStore setting space with update in updateCurrentRoute: ",spaceId:e.currentSpaceStore.id}}),P.default.setState({...P.default.state,...e}))};P.default.setState({...P.default.state,lastUpdater:x});const I=e=>{P.default.state.lastUpdater===x&&M.Z.setState({publicPageData:e})};if("page"===t.name&&t.queryId&&N.Z.setState({queryId:t.queryId,pageId:t.blockId,timeEntered:new Date}),"gallery"===t.name&&(C.Z.setState({...C.Z.state,isBuyerProfileEnabled:Boolean(t.isBuyerProfileEnabled),isModalOpen:Boolean(t.isBuyerProfileEnabled)&&Boolean(t.showBuyerProfileModal)}),t.isMarketplaceCheckoutEnabled&&t.showMarketplaceCheckoutModal&&t.productId?T.Z.setState({...T.Z.state,isMarketplaceCheckoutEnabled:!0,isModalOpen:!0,marketplaceListingId:t.productId}):T.Z.setState({...T.Z.state,isMarketplaceCheckoutEnabled:Boolean(t.isMarketplaceCheckoutEnabled),isModalOpen:!1,marketplaceListingId:void 0})),"page"===t.name||"space"===t.name||"nativeTab"===t.name||"quickSearch"===t.name||"chat"===t.name||"marketplace"===t.name||"gallery"===t.name||"team"===t.name){let e;const c=async()=>{e||(e=ie.I6({environment:u,request:{type:"block-space",...t}}));const[n]=await Promise.all([e.next(),P.default.waitUntil((()=>P.default.state.initialized))]),o=n.value;return I(o),o},f=(0,g.QG)();if((0,k.AC)(u),"page"===t.name&&(!m||m.id!==t.blockId||n&&"page"===n.name&&n.blockId!==t.blockId||m.userId!==b)){ae.Pg(u),ae.LU(u),L.$B(),ae.rM(u);const{blockId:e}=t,g=new U.G(u,{table:l.iU,id:e}),h=new E.Z;x({mainEditorCurrentBlockStore:g,currentLoadingContainerStore:h}),m||await be({environment:u,store:g});const k=await c(),{currentUserSettingsStore:I}=P.default.state;if(we({environment:u,publicPageData:k}))return void function(e){const{store:t,environment:n}=e,o=(0,w.ZP)({store:t,preferPublicLink:!1,pageVisitSource:void 0});se.c4({environment:n,url:o})}({store:g,environment:u});const{presenceStore:C,currentUserRootStore:T}=P.default.state;re.E(C,u,F.$g,m),_.UX(u,{blockStore:g,fromPageRefresh:f,pageVisitStore:P.default.state.pageVisitStore,timestamp:Date.now()}),A.Z.resetIfNotCurrentPage(g.id);const M=new Z.Z;x({presenceStore:M});const R=F.$g.getCurrentPageVisitId();if(F.$g.initializeNewPageVisitId(),re._({userId:b,rootStore:g,presenceStore:M,environment:u,pageVisitIdStore:F.$g}),T){const e=T.getSpaceViewStores().filter((e=>e.getSpaceId()===k.spaceId)).length>0;if("root"===(null==n?void 0:n.name)&&(void 0===k.spaceId||!e&&!k.isTrustedDomainPage)){if(I)return u.device.isMobileNative&&a.log({level:"warning",from:"loginActions",type:"setLoggedInUserId",data:{message:"SpaceDebug: navigateToFirstSpace because updateCurrentRoute is root and page is not in current spaceView"}}),void(await ce.L5({environment:u,userRootStore:T,userSettingsStore:I,pageVisitSource:r.tY.BackForward}));if(b)return void(await te.logoutSingleAccount({environment:u,userId:b,logoutOrigin:s.F.NoAvailableSpaces}))}const t=k.isTrustedDomainPage?e&&k.canJoinSpace:k.canJoinSpace;if(k.spaceId&&(t||k.userHasExplicitAccess)){const e=await ce.j({environment:u,userRootStore:T,spaceId:k.spaceId,navigate:!1,analyticsFrom:"redirect",userSettingsStore:I,redirectSource:"update_current_route_with_space_id"});u.device.isMobileNative&&a.log({level:"info",from:"appActions",type:"SpaceSwitchingDebug",data:{message:"updateCurrentRoute updating space because the route is a page with spaceId",spaceId:k.spaceId}}),x({currentSpaceViewStore:e.spaceViewStore,currentSpaceStore:e.spaceViewStore.getSpaceStore()})}else if(!k.spaceId&&P.default.state.currentSpaceStore){const e=await ce.j({environment:u,userRootStore:T,spaceId:P.default.state.currentSpaceStore.id,navigate:!1,analyticsFrom:"redirect",userSettingsStore:I,redirectSource:"update_current_route_no_space_id"});var z;if(u.device.isMobileNative)a.log({level:"info",from:"appActions",type:"SpaceSwitchingDebug",data:{message:"updateCurrentRoute updating space because of joinSpaceResult of current space",spaceId:null===(z=e.spaceViewStore)||void 0===z?void 0:z.getSpaceId()}});x({currentSpaceViewStore:e.spaceViewStore,currentSpaceStore:e.spaceViewStore.getSpaceStore()})}}k.spaceId&&b&&(fe.h({environment:u,spaceId:k.spaceId,userId:b}),j.I({environment:u,spaceId:k.spaceId,userId:b}));const{currentSpaceStore:B}=P.default.state;B?(L.OR({environment:u,spaceId:B.id}).then((async()=>{await g.load(),ke(u,g,p,F.$g,R)})),S.Jq(u)):k&&k.spaceId&&(await g.load(),ke(u,g,p,F.$g,R)),async function(e,t,n){const a=(0,y.Qc)(t).query,s=a[o.gS];if(parseInt(a[r.$X])===r.tY.Email&&(s.includes("email_digest")||s.includes("email_push"))&&a[r.Qs]&&n){const t=(0,v.wr)(a[r.Qs]),o=U.Xo.createChildStore(n,{table:d.uX,id:t});await o.load();const s=o.getModel();if(!s)return;if((0,i.e)((0,S.mc)(e),{alreadyRead:s.getRead(),notificationId:t,activityId:s.getActivityId(),from:"email"}),!s.getRead()){const t={id:s.id,space_id:s.getSpaceId(),read:s.getRead()};de.createAndCommit({userAction:"appActions.setNotificationAsReadFromEmail",environment:e,perform:e=>oe.$h({notification:t,rootStore:n,transaction:e,read:!0})})}}}(u,p,B);const V=(null==B?void 0:B.id)||k.spaceId;V&&(ue.pt({environment:u,spaceId:V,force:!1}),$.L({environment:u,spaceId:V,force:!1})),V&&X.Wf({environment:u,spaceId:V}),V&&async function(e){const{environment:t,spaceId:n,force:o}=e;await P.default.waitUntilRendered();const r=H.state,i=t.currentUser.id,{currentSpaceStore:a}=P.default.state;if(i&&a&&(!r.loaded&&!r.loading||r.loaded&&n!==r.spaceId||r.loaded&&i!==r.userId||o)){H.setState({...H.state,loading:!0});const e=await G.getAiWaitlistRequestsForSpace(t,{spaceId:n});if("success"!==e.type)throw new Error("Request failed.");const{aiWaitlistIds:o}=e.data,r=a.getRole()??"none";(0,K.Of)(o)?H.setState({loaded:!0,loading:!1,spaceId:n,userId:i,isOnWaitlist:!0,spaceRole:r,aiWaitlistIds:o}):H.setState({loaded:!0,loading:!1,spaceId:n,userId:i,isOnWaitlist:!1,spaceRole:r,aiWaitlistIds:void 0})}}({environment:u,spaceId:V,force:!1}),V&&b&&(D.Z.getIsInitialized()||D.Z.reinitializeState(u,b,V)),ee.nr({route:t,userId:b,spaceId:V})}else if("space"===t.name){const e=await c();if(e.publicHomePage){const t=new U.G(u,{table:l.iU,id:e.publicHomePage}),n=new E.Z;x({mainEditorCurrentBlockStore:t,currentLoadingContainerStore:n})}else if(x({mainEditorCurrentBlockStore:void 0,currentLoadingContainerStore:void 0}),we({environment:u,publicPageData:e}))return void xe({spaceDomain:e.spaceDomain,environment:u})}else if("nativeTab"===t.name||"quickSearch"===t.name||"chat"===t.name||"marketplace"===t.name||"gallery"===t.name||"team"===t.name){ae.Pg(u),ae.LU(u),L.$B(),ae.rM(u),await P.default.waitUntil((()=>P.default.state.initialized));const e="spaceId"in t?t.spaceId:void 0;if((!P.default.state.currentSpaceViewStore||!P.default.state.currentSpaceStore||e&&P.default.state.currentSpaceStore.id!==e)&&P.default.state.currentUserRootStore){const n=P.default.state.currentUserRootStore.getSpaceViewStores(),o=e?n.find((t=>{var n;return(null===(n=t.getSpaceId())||void 0===n?void 0:n.replaceAll("-",""))===(null==e?void 0:e.replaceAll("-",""))})):n[0],r=null==o?void 0:o.getSpaceStore();if(o&&r){var q,W;if(u.device.isMobileNative)a.log({level:"info",from:"appActions",type:"SpaceSwitchingDebug",data:{message:`updateCurrentRoute updating space because it's native tab and current space store id (${null===(q=P.default.state.currentSpaceStore)||void 0===q?void 0:q.id}, spaceView: ${null===(W=P.default.state.currentSpaceViewStore)||void 0===W?void 0:W.id}) doesn't match nextRoute space id`,spaceId:e}});x({currentSpaceStore:r,currentSpaceViewStore:o});const n="nativeTab"===t.name&&"search"===t.tab&&!1,i="quickSearch"===t.name,s="chat"===t.name,l="nativeTab"===t.name&&"assistant"===t.tab,c="marketplace"===t.name||"gallery"===t.name,d="team"===t.name;b&&(n||i||s||l||c||d)&&D.Z.reinitializeState(u,b,r.id),b&&(s||c||d)&&fe.h({environment:u,spaceId:r.id,userId:b})}}("chat"===t.name||"nativeTab"===t.name&&"assistant"===t.tab||"marketplace"===t.name||"gallery"===t.name||"team"===t.name)&&x({mainEditorCurrentBlockStore:void 0,currentCollectionViewStore:void 0})}if("searchQuery"in t||"searchRequest"in t)if(t.searchQuery)le.UT({environment:u,analyticsFrom:"query-args",renderAsPage:!1}),O.ZP.setState({...O.ZP.state,query:{...O.ZP.state.query,text:t.searchQuery}});else if(t.searchRequest)try{const e=JSON.parse(t.searchRequest),{text:n,sort:o,filters:r}=e;p&&O.ZP.setState({...O.ZP.state,query:{text:n,sort:o,filters:r}}),V.ZP.setState({...V.ZP.state,showDebugInfo:!0,debug:"everything"})}catch(pe){Q.deprecatedShowErrorMessage("Invalid json in searchRequest param"),a.log({level:"error",from:"appActions",type:"JSONParseError",error:{miscDataString:(0,h.t)(pe).message}})}if(e)for await(const t of e)I(t);J.Yh(u),(0,g.um)(!1)}const Y=f?f.id:void 0;if("page"===t.name&&Y!==t.collectionViewId){const e=t.collectionViewId;x({currentCollectionViewStore:e?new U.Xr(u,{table:c.np,id:e}):void 0})}const ne=(0,y.Qc)(p).query[r.RL];Boolean(ne)&&(B.m.setState(!0),R.Z.setState({open:!0}))}async function be(e){const{environment:t,store:n}=e,o=await async function(e){const{environment:t,blockId:n}=e,{currentUser:o}=t,r=(0,b.jj)([...o.id?[o.id]:[],...o.loggedInUserIds]);for(const i of r){const e=new U.G(t,{table:l.iU,id:n},{userId:i});if(await e.load(),e.isDefined())return o.id===i?void 0:i}}({environment:t,blockId:n.id});o&&await pe.f({newCurrentUserId:o,environment:t,store:n})}async function _e(e,t){const n=new U.U6(e,{table:u.KJ,id:t},{userId:t}),o=new U.vO(e,{table:m.Sr,id:t},{userId:t});o.addListener(Se);const r=new U.r9(e,{table:p.dx,id:t},{userId:t});ne.registerPushNotifications(e),P.default.setState({...P.default.state,currentUserStore:n,currentUserSettingsStore:o,currentUserRootStore:r,initialized:!1}),await me.w(),P.default.setState({...P.default.state,initialized:!0}),ge.fG(e),Y.oG(e)}function Se(e){const t=e.getSettingsStore().getKeyStore("preferred_locale").getValue();t||f.Z.set("preferredLocale",t)}function ke(e,t,n,o,r){var i,a;const s=t.getAssociatedCollectionStore(),l=null==s?void 0:s.getLayoutStore(),c=t.getParentTable();W.PB(e,{query:n,page_id:t.id,is_peek:!1,peek_mode:void 0,type:"collection"===c?"database_page":"page",collection_id:(null==s?void 0:s.id)??(null===(i=t.getCollectionViewCollectionStore())||void 0===i?void 0:i.id),layout_id:null==l?void 0:l.id,team_id:null===(a=(0,x.VP)(t))||void 0===a?void 0:a.id,page_visit_id:o.getCurrentPageVisitId(),previous_page_visit_id:r})}function we(e){const{environment:t,publicPageData:n}=e;return!(!(0,I.Sr)(t)||"none"!==n.publicAccessRole||!n.spaceName)}function xe(e){const{spaceDomain:t,environment:n}=e,o=(0,I.Rs)(t);se.c4({environment:n,url:o,redirect:!0})}},102449:(e,t,n)=>{n.d(t,{D$:()=>w,Ji:()=>T,KE:()=>R,M0:()=>_,TK:()=>D,Tm:()=>E,W$:()=>I,ac:()=>x,cM:()=>S,gA:()=>M,hC:()=>b,mK:()=>F,p9:()=>B,uG:()=>C});n(21703);var o=n(568626),r=n(89101),i=n(109852),a=n(554153),s=n(211342),l=n(619584),c=n(95477),d=n(855337),u=n(44819),p=n(421051),m=n(453730),g=n(250906),f=n(135253),h=n(547307),v=n(247839),y=n(412714);function b(e){var t;const{environment:n,url:r,version:a,versionCreatedTime:s}=e,{AppUpdateStore:l,device:c}=n;c.isElectron&&r.startsWith("https:")?o.log({level:"error",from:"appUpdateActions",type:"installAppJsUpdate",error:{message:"Attempting to refresh app js on desktop for an https url",stack:(new Error).stack},data:{url:r}}):(l.setState({electronUpdate:l.state.electronUpdate,appUpdate:void 0}),a&&w(a,s),_(a)||(n.mobileNative&&n.mobileNative.showSplashscreen(),(0,i.um)(!0),null!==(t=v.electronApi)&&void 0!==t&&t.installAppJsUpdate?v.electronApi.installAppJsUpdate(r):r!==window.location.href?window.location.href=r:window.location.reload()))}function _(e){return(0,s.isEqualVersion)(e,C())}function S(e,t){if(!t)return!1;if("ready"!==t.state)return!1;if(m.transactionQueue.hasTasks())return!1;if(!e.currentUser.isLoggedIn())return!1;if(t.type===s.UpdateType.Silent){if(e.device.isMobileNative)return!1;const t=I(),n=168;if(t&&(Date.now()-t)/l.U6<n)return!1;o.log({level:"info",from:"appUpdateActions",type:"shouldUpdateOnNavigate",data:{lastKnownUpdateTime:t}})}return!0}const k="lastKnownAppJsVersion";function w(e,t){a.Z.set(k,{version:e,time:t})}function x(){const e=a.Z.get(k);if(e&&e.version)return e.version;{const e=(0,s.parseVersion)(c.default.version),t=c.default.lastUpdatedTime;return a.Z.set(k,{version:e,time:t}),e}}function I(){const e=a.Z.get(k);if(e&&e.time)return e.time}function C(){return(0,s.parseVersion)(c.default.version)}function T(){return c.default.lastUpdatedTime}function M(e,t,n){const o=t===s.UpdateType.Major?"major":t===s.UpdateType.Minor?"minor":"patch";(0,d.j)({environment:e,event:{eventName:"client_app_updated",eventProperties:{type:o,intervention:n}}})}const P=336*l.U6,A=672*l.U6;function R(){const e=T();return(I()||Date.now())-e>P}function D(){const e=T();return(I()||Date.now())-e>A}const B=!1,E="electronUpdateReady2";function F(e){const{AppUpdateStore:t,device:n}=e;if(g.By(e),B){const t=(0,u.Us)(r._j.releases);y.D({environment:e,url:t})}if(n.isElectron&&t.state.electronUpdate&&"ready"===t.state.electronUpdate.state){const e=v.getDesktopVersion();a.Z.set(E,(0,s.formatVersion)(e)),v.installElectronUpdate()}else t.state.appUpdate&&"ready"===t.state.appUpdate.state?(b({environment:e,url:window.location.href,version:t.state.appUpdate.version,versionCreatedTime:t.state.appUpdate.versionCreatedTime}),h.dismissDialog(),f.Js({bannerStore:p.Z})):(w((0,s.parseVersion)(c.default.version),c.default.lastUpdatedTime),h.dismissDialog(),f.Js({bannerStore:p.Z}))}},135253:(e,t,n)=>{n.d(t,{Bw:()=>i,Js:()=>s,qL:()=>a});var o=n(401898),r=n(222294);function i(e){const{id:t,styleKey:n,contentKey:i,removeTimeout:s,bannerStore:l,blockStore:c,context:d,disabled:u}=e,{banners:p}=l.state;if(!p.find((e=>e.id===t))){let m;switch(i){case"template_in_page":case"template_in_button":m={id:t,contentKey:i,styleKey:n,blockStore:c,context:d,disabled:u};break;case"space_content_duplication":case"deleted_or_moved_page":case"importing_evernote":case"asana_importer_banner":case"site":case"translate":m={id:t,contentKey:i,styleKey:n,blockStore:c};break;case"over_free_block_limit":case"editing_page":case"subscription_trial_add_payment_method":case"upload_limit_exceeded":case"admin_mode":case"subscription_uncollectible":case"billing_subscription_status":case"minor_app_update":case"mobile_platform_unsupported":case"page_in_archived_team":case"test_clock":case"dictation_connection":case"trusted_domain_page":case"russian_sanctions":m={id:t,contentKey:i,styleKey:n};break;default:(0,o.t1)(i)}const g=e.prepend?[m,...p]:[...p,m];l.setState({banners:g}),r.Z.setKeyboardMode(!1),s&&setTimeout((()=>{a({bannerStore:l,id:t})}),s)}}function a(e){const{id:t,bannerStore:n}=e,{banners:o}=n.state,r=o.filter((e=>e.id!==t));r.length!==o.length&&n.setState({banners:r})}function s(e){e.bannerStore.state.banners.length>0&&e.bannerStore.setState({banners:[]})}},554564:(e,t,n)=>{n.d(t,{Ib:()=>R,LZ:()=>D,Xv:()=>B});var o=n(701302),r=n(933709),i=n(23867),a=n(653965),s=n(937850),l=n(934959),c=n(736974),d=n(947002),u=n(948514),p=n(721429),m=n(708661),g=n(165598),f=n(177546),h=n(431183),v=n(358299),y=n(58202),b=n(246351),_=n(74948),S=n(224646),k=n(436391),w=n(524229),x=n(156681),I=n(385555),C=n(206258),T=n(585344),M=n(524677),P=n(898104);function A(e,t){const n=b.Z.find((e=>e.getStore().id===t));n&&(M.ZH({preventDismissMobileKeyboard:!0,environment:e}),P.setSelectionAtEnd({store:n.getInputStore().state.textStore}))}async function R(e){var t,f,b;const{environment:R,blockStore:D,analyticsFrom:B,discussionIds:F,shouldFocusDiscussion:Z,recursivelyLoadAllDiscussions:U,property_id:V,openFullPropertyDiscussionOnly:N,intl:O}=e;let L=(null==F?void 0:F.map((e=>C.t1.createChildStore(D,{table:r.qF,id:e,spaceId:(0,i.C)(D.pointer.spaceId)}))))||g.al(D,{recursivelyLoadAllDiscussions:U,onlyIncludePropertyDiscussions:Boolean(V)});V&&(L=L.filter((e=>e.getPropertyId()===V)),N&&O&&(L=L.filter((e=>(0,m.tH)(e,O,D,V)))));let{rect:j}=e;const{resolved:K,unresolved:z}=g.bB(L),{commentsDependency:q}=await Promise.resolve().then(n.bind(n,133767)),{discussionHelpers:H}=await q.load(),G=H.sortDiscussionStoresByLatestComment(z.length>0?z:K)||[],W=null==G||null===(t=G[0])||void 0===t?void 0:t.id,$=null==G||null===(f=G[0])||void 0===f?void 0:f.getPropertyId(),{device:Y}=R;Y.isMobile&&"updates_sidebar"!==B&&(M.ZH({environment:R}),Y.isIOS&&P.blurActiveElement()),x.Z.markDiscussionsInteractedWith(G.map((e=>e.id))),await o.default.afterNextFlush();const Q=(0,S.vK)(R);if(D.id===(0,p.zj)()&&void 0===$){if(W){"PageDetailsStore"in R&&R.PageDetailsStore.setToggleState({type:"discussion",id:D.id,environment:R},!0);const e=C.t1.createChildStore(D,{table:r.qF,id:W,spaceId:(0,i.C)(D.pointer.spaceId)});if((Q||!Q&&Z)&&E(W),e.getResolved())if((0,S.vK)(R))_.setUpdateSidebarCommentsMode("resolved");else if((0,S.Sx)(R))_.setUpdateSidebarTab(k.gY.Comments),_.setUpdateSidebarCommentsMode("resolved");else{const e=y.R.findBlockFromStoreWithMethod(D,"openResolvedDiscussionPopup");e&&(e.openResolvedDiscussionPopup(),await o.default.afterNextFlush(),E(W))}T.ZW(R,{from:B,discussion_id:e.id,discussion_type:e.getType()})}if(!Q)return}if(!j&&!Q&&"margin_comments"!==B){const e=V?v.Z.getRect(D,V):y.R.getRect(D);if(!e)return;const t=e.width,n=e.height,o=e.right-t;j=new DOMRect(o,e.top,t,n)}let J,X=w.u.Open;if(W){var ee;J=C.t1.createChildStore(D,{table:r.qF,id:W,spaceId:(0,i.C)(D.pointer.spaceId)}),J.getResolved()&&(X=w.u.Resolved);const e=Boolean(D.isCollectionView()),t=null===(ee=D.getAssociatedCollectionStore())||void 0===ee?void 0:ee.getLayoutStore(),n=Boolean(V&&t&&(0,h.Uo)({layoutStore:t,propertyId:V}).isPropertyInPageDetails);J.getResolved()||e||n||(_.setUpdateSidebarCommentsMode("unresolved"),_.setUpdateSidebarTab(k.gY.Comments))}else X=w.u.Resolved;if(Y.isMobile&&"updates_sidebar"!==B&&(M.ZH({environment:R}),Y.isIOS&&P.blurActiveElement()),w.Z.setState({open:!0,rect:j,tab:X,blockStore:D,discussionIds:L.map((e=>e.id)),recursivelyLoadAllDiscussions:U,property_id:V}),T.ZW(R,{from:B,discussion_id:W,discussion_type:null===(b=J)||void 0===b?void 0:b.getType()}),!Z)return;const te=u.Z.getDiscussionInputStore(),ne="on"===I.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0});if(ne&&d.Z.state.overlapsExistingDiscussionMenu&&te){if(await s.Vs(10),await o.default.afterNextFlush(),(0,c.m)({animate:!1}),R.device.isMobile)return;(0,l.l)({discussionInputStore:te,environment:R,allowActionsWhileCommenting:ne})}else if(W){if(await s.Vs(10),await o.default.afterNextFlush(),E(W),R.device.isMobile)return;(function(e){var t;const{blockStore:n,discussionIds:o}=e;return w.Z.state.open&&w.Z.state.blockStore.id===n.id&&a.Xy(null===(t=w.Z.state)||void 0===t?void 0:t.discussionIds,o)})(e)||A(R,W)}else{if(R.device.isMobile)return;z.length>0&&(await s.Vs(10),await o.default.afterNextFlush(),A(R,z[0].id))}}function D(){const e=w.Z.state;"on"===I.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0})&&!u.Z.hasContent()&&e.open&&u.Z.getBlockStore()===e.blockStore&&d.Z.state.overlapsExistingDiscussionMenu&&(u.Z.reset(),d.Z.reset()),e.open&&w.Z.setState({open:!1,rect:e.rect})}function B(){const e=w.Z.state;if(e.open&&e.tab===w.u.Open){0===g.vV(e.blockStore,{recursivelyLoadAllDiscussions:!1}).length&&D()}}function E(e){const t=b.Z.find((t=>t.getStore().id===e&&!t.isSidebarFormat()&&!t.isMarginFormat()));if(t){const e=t.getNode();if(e&&e.parentElement){const t=Array.from(e.parentElement.children).indexOf(e);f.Wr(e,{edgeDist:0===t?0:-1,animate:!1})}}}},106404:(e,t,n)=>{n.d(t,{$Z:()=>p,Qn:()=>u,xv:()=>m});var o=n(368585),r=n(95802),i=n(224646),a=n(708949),s=n(417903),l=n(896026),c=n(650628),d=n(117224);function u(e){const{environment:t,left:n,top:o,actionSectionGroupKey:r,showInput:i,stores:c,analyticsFrom:d,optionalAnalyticsProperties:u,pageAnnotationToken:p}=e,m=new DOMRect(n,o,1,1);a.Z.setState({isActive:!0,inputValue:"",actionSectionGroupKey:r,stores:c,frameScrollTop:s.Z.state.scrollTop,originBlockRect:m,showInput:i,analyticsFrom:d,publicEditMode:c[0]?l.Z.getMode(t,c[0]):void 0,collectionContextStore:null==u?void 0:u.collectionContextStore,clickedPageAnnotation:p}),g(t,{from:d,block_type:c[0]&&c[0].getType(),optionalAnalyticsProperties:u})}function p(e){const{environment:t,analyticsFrom:n,actionSectionGroupKey:o,stores:i,showInput:d}=e,u=r.C.findSelectableFromStore(i[0]);if(!u)return;const p=c.Z.state.selectableRectMap.get(u);p&&a.Z.setState({isActive:!0,inputValue:"",actionSectionGroupKey:o,stores:i,frameScrollTop:s.Z.state.scrollTop,originBlockRect:p,showInput:void 0===d||d,analyticsFrom:n,publicEditMode:i[0]?l.Z.getMode(t,i[0]):void 0}),t&&g(t,{from:n,block_type:i[0]&&i[0].getType()})}function m(){a.Z.setState({isActive:!1})}function g(e,t){const{optionalAnalyticsProperties:n,...r}=t,{teamStore:a,collectionContextStore:s,...l}=t.optionalAnalyticsProperties||{},c=(0,o.Pn)(s)||{};d.YP(e,"open_block_menu",{store:a,...(0,i.UF)({environment:e}),...c,...r,...l})}},179554:(e,t,n)=>{n.d(t,{Dq:()=>R,H8:()=>D,RH:()=>M,_x:()=>I,kE:()=>x,ry:()=>B,wK:()=>P,xv:()=>C});n(21703);var o=n(815145),r=n(541432),i=n(401800),a=n(600606),s=n(421202),l=n(421838),c=n(653965),d=n(401898),u=n(95477),p=n(721429),m=n(95802),g=n(561207),f=n(400807),h=n(206258),v=n(352229),y=n(119785),b=n(709953),_=n(311712),S=n(524677),k=n(800993),w=n(210228);function x(e){const{blocks:t,copiedStores:n,pageSource:o}=e,r=c.Z$(t);if(!r)return;const i=m.C.getRectFromStore(r);i&&g.Z.setState({open:!0,type:"blocks",blocks:t,rect:i,copiedStores:n,pageSource:o})}function I(e){const{blocks:t,copiedLinks:n,rootStore:o}=e;if(!t.every(T))return!1;if(n.some((e=>e.blockId===o.id)))return!1;const r=c.Z$(t);if(!r)return!1;const i=m.C.getRectFromStore(r);return!!i&&(g.Z.setState({open:!0,type:"links",blocks:t,rect:i,copiedLinks:n}),!0)}function C(){g.Z.setState({open:!1})}function T(e){return!(e.isType(r.Ti.copyIndicator)||e.isTransclusionType()||e.isInsideCollection())}function M(e){const{blocks:t,pageSource:n,wasContiguousSelection:o,action:i,rootStore:s,copiedStores:l}=e,c=f.Z.getMode(t[0]);return"copy"===i&&o&&!(0,a.qo)(n,s.pointer)&&(P(e)||D({currentSpaceId:s.getSpaceId(),...e}))&&t.every(T)&&!l.every((e=>e.getType()===r.Ti.externalObjectInstance))&&"suggest"!==c}function P(e){const{blocks:t}=e;return 1===t.length}function A(e){const{transaction:t,blockUrl:n,spaceId:o,useCrdt:i,environment:a}=e,s=b.j4({environment:a,type:r.Ti.text,inMemoryRecordCache:a.defaultRecordCache.inMemoryRecordCache,transaction:t,spaceId:o,useCrdt:i}),c=[(0,l.V3y)(n,[(0,l.edl)(n)])];return k.sO({environment:a,store:s.getBlockTitleStore(),value:c,transaction:t}),s}async function R(e){const{environment:t,blocks:n,source:r}=e,a=c.Ps(n);if(!a)return;const l=a.getParentBlockStore();if(!l)return;const p=a.getContentStore();let m;await w.createAndCommitAsync({environment:t,userAction:"blockPasteMenuActions.acceptLinkToPage",waitForServerCommit:!0,perform:async e=>{if("blocks"===r.type){const{copiedStores:n,pageSource:c}=r,d=a,g=n[0];if(!d||!g)return;const f=h.G.createChildStore(p,{table:s.iU,id:g.id});if(f.isNavigableBlock())await f.load(),m=[v.k({environment:t,parentBlockStore:l,targetStore:f,transaction:e})];else{const n=(0,i.Z)({pageId:c.id,scrollToBlockId:f.id,baseUrl:u.default.domainBaseUrl,pageVisitSource:o.tY.LinkInPage});m=[A({blockUrl:n,spaceId:a.getSpaceId(),useCrdt:a.useCrdt(),environment:t,transaction:e})]}}else if("links"===r.type){const{copiedLinks:c}=r;if(c.length!==n.length)return;m=await Promise.all(c.map((async n=>{const r=n.scrollToBlockId||n.peekViewBlockId||n.blockId,c=h.G.createChildStore(p,{table:s.iU,id:r});if(await c.load(),c.isNavigableBlock())return v.k({environment:t,parentBlockStore:l,targetStore:c,transaction:e});{const r=n.peekViewBlockId||n.blockId,l=h.G.createChildStore(p,{table:s.iU,id:r});await l.load();return A({blockUrl:(0,i.Z)({pageId:r,pageModel:l.getModel(),scrollToBlockId:c.id,baseUrl:u.default.domainBaseUrl,pageVisitSource:o.tY.LinkInPage}),spaceId:a.getSpaceId(),useCrdt:a.useCrdt(),environment:t,transaction:e})}})))}else(0,d.t1)(r);const c=_.BM({environment:t,blocksToInsert:m,target:n,replaceEmptyTextBlock:!0,transaction:e});_.Cl({environment:t,blocks:n,transaction:e}),S.Z5({environment:t,stores:c}),C()}})}function D(e){const{currentSpaceId:t,blocks:n,copiedStores:o}=e;return n.length>0&&!o.some((e=>e.isInsideCollection()))&&o.every((e=>e.canEdit()))&&o.every((e=>e.getSpaceId()===t))}async function B(e){const{environment:t,blocks:n,copiedBlockIds:o}=e,i=await Promise.all(o.map((async e=>{const t=h.G.createChildStore(n[0],{table:s.iU,id:e});await t.load();const o=t.getParentBlockStore();if(!o)throw new Error("Block has no parent.");await o.load();const r=o.getContentStore();return{store:h.G.createChildStore(r,{table:s.iU,id:e}),parentStore:o,parentContentStore:r}}))),a=i[0];if(!a)return;const l=(0,p.RM)();if(!l)return;const{serverCommitResult:c}=w.createAndCommit({userAction:"blockPasteMenuActions.acceptCreateTransclusion",environment:t,perform:e=>{let o;if(a.store.getType()===r.Ti.transclusionContainer)o=a.store;else if(a.store.getType()===r.Ti.transclusionReference){const e=a.store.getTransclusionReferenceTargetStore();if(!e)throw new Error("Could not find target");o=e}else if(a.parentStore.getType()===r.Ti.transclusionContainer)o=a.parentStore;else{o=b.j4({environment:t,type:r.Ti.transclusionContainer,inMemoryRecordCache:t.defaultRecordCache.inMemoryRecordCache,transaction:e,spaceId:a.store.pointer.spaceId,useCrdt:a.store.useCrdt()});const n=o.getContentStore();y.rS({parentStore:a.parentContentStore,oldChildStore:a.store,newChildStore:o,transaction:e});for(const{store:t}of i)y.jG({parentStore:n,childStore:t,transaction:e})}const s=b.j4({environment:t,type:r.Ti.transclusionReference,format:{transclusion_reference_pointer:o.pointer},inMemoryRecordCache:t.defaultRecordCache.inMemoryRecordCache,transaction:e,spaceId:0!==n.length?n[n.length-1].pointer.spaceId:l.pointer.spaceId,useCrdt:0!==n.length?n[n.length-1].useCrdt():l.useCrdt()}),c=_.BM({environment:t,blocksToInsert:[s],target:n,transaction:e,replaceEmptyTextBlock:!0});_.Cl({environment:t,blocks:n,transaction:e}),S.Z5({environment:t,stores:c}),C()}});await c}},551365:(e,t,n)=>{n.d(t,{$o:()=>v,RX:()=>y,bA:()=>g,fG:()=>S,gT:()=>b,i2:()=>_,vO:()=>h,xv:()=>f});var o=n(973935),r=n(701302),i=n(399036),a=n(180951),s=n(421838),l=n(358299),c=n(761045),d=n(524677),u=n(800993),p=n(898104),m=n(210228);function g(e){const{environment:t,blockPropertyValueOverlayStore:n,store:a,additionalStores:g=[],property:f,format:h,preventClearSelection:v,insertChar:y,uploadFiles:b,disableHorizontalEdgeScroll:_,isNewBlock:S,collectionContextStore:k,mode:w,collectionsBulkActionsToolbarStore:x,readOnly:I,sizing:C,formQuestionStore:T}=e,M=((null==k?void 0:k.normalizedSchemaStore.state)??a.getSchema())[f],P=l.Z.findBlockPropertyValue(a,f,h);let A=e.rect;const R=null==P?void 0:P.getNode();if(R&&(c.bx({element:R,vertical:{reveal:"closest"},horizontal:_?void 0:{reveal:"closest"},scrollers:{verticalScroller:null==P?void 0:P.getContextVerticalScroller(),horizontalScroller:null==P?void 0:P.getContextHorizontalScroller()}}),!A)){const e=o.findDOMNode(R);e instanceof Element&&(A=e.getBoundingClientRect())}if(!A)return;const D=a.clone();if(n.setState({isOpen:!0,store:a,clonedStore:D,additionalStores:g,property:f,format:h,rect:A,preventClearSelection:v,insertChar:y,uploadFiles:b,isNewBlock:S,collectionContextStore:k,mode:w,collectionsBulkActionsToolbarStore:x,readOnly:I,sizing:C,formQuestionStore:T}),!x||"title"!==(null==M?void 0:M.type)&&"text"!==(null==M?void 0:M.type)||null==x||x.setState({textStoresBeingEdited:[...g,a]}),M&&i.Yl(M.type)){v||d.ZH({environment:t});const e=D.getPropertyStore(f);y&&m.createAndCommit({userAction:"blockPropertyValueOverlayActions.open",environment:t,perform:n=>{u.sO({environment:t,store:e,value:s.TPx(y),transaction:n})}}),r.default.afterNextFlush((()=>{r.default.afterNextFlush((()=>{r.default.afterNextFlush((()=>{p.setSelectionAtEnd({store:e})}))}))}))}else v||d.ZH({environment:t}),p.clear({preventDismissMobileKeyboard:v,environment:t})}function f(e){const{environment:t,blockPropertyValueOverlayStore:n}=e,o=n.state;var r;o.isOpen&&(o.preventClearSelection||d.ZH({environment:t}),n.reset(),null===(r=o.collectionsBulkActionsToolbarStore)||void 0===r||r.setState({textStoresBeingEdited:[]}))}function h(e){const{stores:t,property:n,transaction:o}=e,r=t[0].getPropertyStore(n),i=(0,a.Ml)(r.getValue());for(const s of t)u.sO({environment:s.environment,store:s.getPropertyStore(n),value:(0,a._I)(!i),transaction:o})}function v(e){const{blockPropertyValueOverlayStore:t}=e,n=t.state;if(n.isOpen){const{store:t,property:i}=n,a=l.Z.findBlockPropertyValue(t,i);var o,r;if(null!=a&&a.getProps().onTab)null==a||null===(o=(r=a.getProps()).onTab)||void 0===o||o.call(r);else f(e)}}function y(e){const{blockPropertyValueOverlayStore:t}=e,n=t.state;if(n.isOpen){const{store:t,property:i}=n,a=l.Z.findBlockPropertyValue(t,i);var o,r;if(null!=a&&a.getProps().onUntab)null==a||null===(o=(r=a.getProps()).onUntab)||void 0===o||o.call(r);else f(e)}}function b(e){const{blockPropertyValueOverlayStore:t}=e,n=t.state;if(n.isOpen){const{store:t,property:i}=n,a=l.Z.findBlockPropertyValue(t,i);var o,r;if(null!=a&&a.getProps().onEnter)null==a||null===(o=(r=a.getProps()).onEnter)||void 0===o||o.call(r);else f(e)}}function _(e){const{blockPropertyValueOverlayStore:t}=e,n=t.state;if(n.isOpen){const{store:t,property:i}=n,a=l.Z.findBlockPropertyValue(t,i);var o,r;if(null!=a&&a.getProps().onEsc)null==a||null===(o=(r=a.getProps()).onEsc)||void 0===o||o.call(r);else f(e)}}function S(e){const{blockPropertyValueOverlayStore:t}=e,n=t.state;if(n.isOpen){const{store:t,property:i}=n,a=l.Z.findBlockPropertyValue(t,i);var o,r;if(null!=a&&a.getProps().onBgClick)null==a||null===(o=(r=a.getProps()).onBgClick)||void 0===o||o.call(r);else f(e)}}},448948:(e,t,n)=>{n.d(t,{$$:()=>f,Ke:()=>m,e1:()=>g});var o=n(541432),r=n(23867),i=n(421838),a=n(937850),s=n(594419),l=n(80444),c=n(21359),d=n(709953),u=n(800993),p=n(210228);async function m(e){const{store:t,url:n,environment:s,teamId:m}=e,g=void 0!==e.transformTimeout?e.transformTimeout:3e3,{serverCommitResult:f}=p.createAndCommit({userAction:"bookmarkBlockActions.createBookmark",environment:s,perform:e=>{d.sW({store:t.getPropertiesStore(),data:{link:i.TPx(n)},transaction:e}),u.sO({environment:s,store:t.getBlockTitleStore(),value:i.TPx(n),transaction:e})}}),{winner:h,rest:v}=await a.S3([f,a.Vs(g)]);if(1===h&&(await async function(e,t){const{serverCommitResult:n}=p.createAndCommit({userAction:"bookmarkBlockActions.transformIntoBookmark",environment:e,perform:e=>{d.sW({store:t,data:{type:o.Ti.bookmark},transaction:e})}});await n}(s,t),await v),m){const{currentSpaceStore:e}=l.default.state;await c.setBookmarkMetadata(s,{type:"team-invite-bookmark",block:{id:t.id,spaceId:(0,r.C)(t.pointer.spaceId)},url:n,teamId:m,spaceId:e&&e.id})}else await c.setBookmarkMetadata(s,{type:"external-bookmark",block:{id:t.id,spaceId:(0,r.C)(t.pointer.spaceId)},url:n})}function g(e){var t;const{transaction:n,blockStore:o,parentBlockStore:r,token:i}=e,{tokenIndex:a}=i;if(!o.isDefined())return;const l=null===(t=r.getParentBlockStore())||void 0===t?void 0:t.getContentStore();if(!l)return;u.gy({block:r,editorMode:"default",transaction:n,tokenIndex:a})&&s.BE({parentStore:l,insertStore:o,afterStore:r,transaction:n})}async function f(e){const{environment:t,blocks:n}=e,r=n[0],a=r.getPropertyValue("link");if(!a)return;const s=a[0][0];await(async e=>{var n,o;return await c.getDataForLinkMention(t,{url:e,spaceId:(null===(n=l.default.state.currentSpaceStore)||void 0===n?void 0:n.id)??(null===(o=l.default.state.mainEditorCurrentBlockStore)||void 0===o?void 0:o.getSpaceId()),source:"bookmark_to_link_mention"})})(s).then((e=>{p.createAndCommit({userAction:"bookmarkBlockActions.transformBookmarkToLinkMention",environment:t,perform:n=>{if("success"===e.type){const l=e.data;if("error"in l){const e=i.YCD(i.Wy3({href:s,title:s.includes("mailto:")?s:new URL(s).hostname}));d.sW({store:r,data:{type:o.Ti.text},transaction:n}),u.sO({environment:r.environment,store:r.getBlockTitleStore(),value:[e],transaction:n})}else{var a;const{title:e,description:c,author_name:p,provider_name:m,images:g,favicon_url:f,iframe:h,height:v,padding:y,padding_top:b}=l,_=i.YCD(i.Wy3({href:s,title:e||(m||new URL(s).hostname),description:c,link_author:p,link_provider:m,thumbnail_url:g&&g.length>0?null===(a=g[0])||void 0===a?void 0:a.url:void 0,icon_url:f,iframe_url:h,height:v,padding:y,padding_top:b}));d.sW({store:r,data:{type:o.Ti.text},transaction:n}),u.sO({environment:t,store:r.getBlockTitleStore(),value:[_],transaction:n})}}else{const e=i.YCD(i.Wy3({href:s,title:s.includes("mailto:")?s:new URL(s).hostname}));d.sW({store:r,data:{type:o.Ti.text},transaction:n}),u.sO({environment:t,store:r.getBlockTitleStore(),value:[e],transaction:n})}d.sW({store:r,data:{type:o.Ti.text},transaction:n})}})}))}},616241:(e,t,n)=>{n.d(t,{Q:()=>s});var o=n(855337),r=n(721429),i=n(80444),a=n(21359);async function s(e){let{environment:t,collectionContextStore:n,collectionViewId:s,from:l}=e;const c=i.default.state.currentSpaceStore;if(!c||!s)return;const d=new Map(n.updateFreeChartsResultStore.state);d.set(s,{isPending:!0,value:void 0}),n.updateFreeChartsResultStore.setState(d);const u=(0,r.zj)(),p=await(0,o.cG)(t),m={spaceId:c.id,collectionViewId:s,from:l,pageId:u,deviceId:p},g=await a.updateFreeCharts(t,m);if("success"===g.type){const e=new Map(n.updateFreeChartsResultStore.state);e.set(s,{isPending:!1,value:g.data.can_view_chart}),n.updateFreeChartsResultStore.setState(e)}else{const e=new Map(n.updateFreeChartsResultStore.state);e.set(s,{isPending:!1,value:void 0}),n.updateFreeChartsResultStore.setState(e)}return g}},800893:(e,t,n)=>{n.d(t,{tq:()=>kt,JG:()=>Xt,IK:()=>Pn,VG:()=>Tn,g9:()=>An,Hs:()=>Cn,Dw:()=>Mn,RD:()=>Rn,Pm:()=>En,by:()=>Jt,tk:()=>yn,of:()=>cn,e0:()=>Kt,Mt:()=>Zn,wc:()=>Fn,v:()=>wn,AL:()=>en,R$:()=>an,jm:()=>Ht,f4:()=>Bn});n(757658);var o=n(552751),r=n.n(o),i=n(701302),a=n(266897),s=n(815145),l=n(541432),c=n(399036),d=n(401800),u=n(895538),p=n(415095),m=n(664962),g=n(761075),f=n(642509),h=n(643593),v=n(335102),y=n(568626),b=n(238297),_=n(842875),S=n(719531),k=n(471924),w=n(264572),x=n(522808),I=n(630845),C=n(225718),T=n(959753),M=n(300482),P=n(433422),A=n(719233),R=n(145953),D=n(600606),B=n(882883),E=n(599405),F=n(421202),Z=n(606287),U=n(870279),V=n(23867),N=n(554153),O=n(421838),L=n(167175),j=n(744805),K=n(463332),z=n(95371),q=n(709291),H=n(531701),G=n(653965),W=n(307032),$=n(215828),Y=n(401898),Q=n(218265),J=n(336154),X=n(247839),ee=n(196313),te=n(594419),ne=n(237524),oe=n(710274),re=n(601600),ie=n(95477),ae=n(27105),se=n(924990),le=n(721429),ce=n(956518),de=n(344486),ue=n(484210),pe=n(741195),me=n(278429),ge=n(433929),fe=n(268056),he=n(745162),ve=n(165598),ye=n(273959),be=n(341984),_e=n(389224),Se=n(489086),ke=n(199341),we=n(58202),xe=n(828685),Ie=n(598794),Ce=n(427534),Te=n(70853),Me=n(885305),Pe=n(80444),Ae=n(487143),Re=n(788632),De=n(400807),Be=n(385555),Ee=n(530874),Fe=n(222294),Ze=n(206258),Ue=n(27724),Ve=n(924666),Ne=n(897630),Oe=n(250906),Le=n(100952),je=n(757549),Ke=n(179554),ze=(n(21703),n(475246)),qe=n(500374),He=n(570842),Ge=n(182798),We=n(119785),$e=n(678791),Ye=n(798165),Qe=n(669645),Je=n(95802),Xe=n(276725),et=n(419358),tt=n(800993),nt=n(898104),ot=n(668422);function rt(e){const{environment:t,clipboardData:n,transaction:o,allowPasteIntoHeaderWithoutChildren:r,selectAll:a,preventLegacyTransclusions:s}=e;if(Ve.default.isEditingComment()||(0,Se.qK)())return!1;if(n.blockSelection.blocks.some((e=>!e.blockSubtree)))return!1;const c=Ve.default.state;if("editing"!==c.mode)return!1;const d=c.multiSelection.start.store;if(!d.isTable(F.iU))return!1;const u=(0,ye.sQ)(d);if(!u)return!1;if(d!==u.getBlockTitleStore())return!1;const p=u.getType(),m=u.getFormat();if(!p)return!1;if(!((0,l.Um)(p,m)||r&&(0,l.zp)(p)))return!1;if(r&&(0,l.zp)(p)){const e=n.blockSelection.blocks[0],t=null==e?void 0:e.blockId,o=null==e?void 0:e.blockSubtree,r=t&&o?o.getModel({id:t,table:"block"}):void 0;if(Boolean(null==r?void 0:r.getContentLength()))return!1}const g=(0,Qe.dq)({includeNonSelectableListContainer:!0});if(!g)return!1;const f=(0,Qe.v5)(u,[g]);if(!f)return!1;let h=0;for(let i=f.length-1;i>=0;i--){const e=f[i].value.store,t=Je.C.findSelectableFromStore(e),n=e.getModel();if(null!=n&&n.isType(l.$t)||t&&!t.props.canSelect){h=i;break}}const v=f.slice(h);if(0===v.length)return!1;const y=v[0].value.store,b=y.pointer.spaceId,_=y.isInsideTemplate()||y.isInsideFactoryOrDuplicateBlocksAction();o.logDebugMessage("pasteMultiTextSelection: pasting",v,{spaceId:b,pastingIntoTemplate:_,insertionPathRootStore:y});const S=n.blockSelection.blocks.map((e=>{var n;let{blockId:r,blockSubtree:i}=e;if(!i)throw new Error("Missing data for local duplicate block during paste");const a=(null===(n=i.getModel({table:F.iU,id:r}))||void 0===n?void 0:n.getType())===l.Ti.factory,c=!(_||a),d=Ze.G.createChildStore(y,{table:F.iU,id:r}),p=Xe.E9({environment:t,sourceBlockId:r,targetBlockPointer:(0,pe.Ii)({environment:t,table:F.iU,spaceId:b}),sourceBlockSubtree:i,targetInMemoryRecordCache:y.inMemoryRecordCache,addCopyName:(0,be.Z)(d),deepCopyTransclusionContainers:!1,resolveTemplateVariables:c,transaction:o,useCrdt:y.useCrdt(),preventLegacyTransclusions:s}),m=p.targetBlockStore.getType();return m&&Le.W(t,{from:"paste",type:m,new_page_id:"page"===m?p.targetBlockStore.id:void 0,creating_block_id:p.targetBlockStore.id,parent_collection_id:u.getParentCollectionIdUpToTwoLevels()}),p})),k=n.multiTextSelection.start.pointerPath,w=n.multiTextSelection.end.pointerPath,x=[],I=[],C=Math.max(k.length,w.length),T=(v[v.length-C]||v[0]).value.store,M=(0,z.MW)({node:n.tree,recordStoreParent:T},(e=>{let{node:t,recordStoreParent:n}=e;const o=((e,t)=>{let n;for(const{originalToDuplicate:o}of S)if(n=o.get(t),n)break;if(n)return Ze.G.createChildStore(e,n)})(n,t.value),r=x.length<k.length?k[x.length]:void 0,i=I.length<w.length?w[I.length]:void 0;let a=!1;if((null==r?void 0:r.id)===t.value.id&&(a=!0,x.push(o)),(null==i?void 0:i.id)===t.value.id&&(a=!0,I.push(o)),!a)return{value:{store:o}};const s=(null==o?void 0:o.getContentStore())||y;return{value:{store:o},children:t.children.map((e=>({node:e,recordStoreParent:s})))}}));if(x.length!==k.length||0===x.length)throw new Error(`Failed to hydrate start path during paste (found ${x.length} of ${k.length})`);if(I.length!==w.length||0===I.length)throw new Error(`Failed to hydrate end path during paste (found ${I.length} of ${w.length})`);const P=x[x.length-1],A=I[I.length-1];if(!P||!A)throw new Error(`Failed to hydrate position during paste (${P?"":"missing start"} ${A?"":"missing end"})`);const R=(0,z.DY)([M],(e=>e.value.store===P)),D=(0,z.DY)([M],(e=>e.value.store===A)),B=R&&D&&He.T.fromNearestCommonAncestor(R,D);if(!B)throw new Error(`Failed to build range for paths: ${R?"":"missing start"} ${D?"":"missing end"}`);tt.pz({environment:t,multiSelection:c.multiSelection,transaction:o});const E=Ve.default.state,Z="editing"===E.mode?E.multiSelection:c.multiSelection;if((0,ve.Nm)(u)&&0===n.multiTextSelection.start.textIndex){const e=P.getType();e&&(0,l.Zu)(e)&&ot.Cj({environment:t,blocks:[u],blockType:e,transaction:o})}let U;return y.useCrdt()?(at({transaction:o,clipboardData:n,startBlockStore:u,duplicateStartStore:P,range:B,insertionPath:v,duplicates:S,insertionPathRootStore:y}),U=it({environment:t,transaction:o,clipboardData:n,insertionPoint:Z,textSelectionState:c,duplicateEndStore:A,pastingIntoTemplate:_}).newSelectionIndex):(U=it({environment:t,transaction:o,clipboardData:n,insertionPoint:Z,textSelectionState:c,duplicateEndStore:A,pastingIntoTemplate:_}).newSelectionIndex,at({transaction:o,clipboardData:n,startBlockStore:u,duplicateStartStore:P,range:B,insertionPath:v,duplicates:S,insertionPathRootStore:y})),i.default.afterNextFlush((()=>{const e=(0,Qe.kC)({rootStore:y,root:g,target:B.end}),t=e&&(0,ye.mh)(e[e.length-1]);if(!t)return;const n={start:{index:a?Z.start.index:U,store:a?Z.start.store:t},end:{index:U,store:t}};nt.setMultiSelection({multiSelection:n})})),!0}function it(e){const{insertionPoint:t,duplicateEndStore:n,pastingIntoTemplate:o,environment:r,transaction:i,clipboardData:a}=e;let s=0;const l=t.end.store,c=t.end.index,d=(0,ye.mh)(n);if(d){s=O.eeV(d.getValue()).length;const e=(0,Ge.TO)((0,ye.sQ)(l)),t=(0,Ge.TO)((0,ye.sQ)(d));ae.Ls({store:l,blockStore:e})&&ae.Ls({store:d,blockStore:t})?($e.Wc({sourceBlockStore:e,targetBlockStore:t,splitAtGraphemeIndex:c,transaction:i,moveIntoNewBlock:!1}),i.logDebugMessage("(CRDT) pasted suffix into end",d)):(tt.gc({environment:r,sourceStore:l,sourceIndex:c,targetStore:d,targetIndex:s,transaction:i}),i.logDebugMessage("pasted suffix into end",d))}else tt.pe({environment:r,transaction:i,store:l,selection:{startIndex:c,endIndex:1/0}}),i.logDebugMessage("no end title store to paste text into");let u=O.V3g(a.multiTextSelection.start.copiedText,{removeSuggestionAnnotationsAndText:!1,removeSuggestionAnnotations:!0,removeDiscussions:!0});return o||(u=(0,K.KV)(u,{currentUserId:r.currentUser.id,currentTimeZone:(0,_.r)()})),tt.mM({environment:r,index:t.start.index,store:t.start.store,tokens:u,transaction:i}),{newSelectionIndex:s}}function at(e){const{transaction:t,clipboardData:n,startBlockStore:o,duplicateStartStore:r,insertionPath:i,insertionPathRootStore:a,duplicates:s,range:l}=e,c=Be.default.checkGate({gateName:"prefer_high_level_operations"});for(const u of l.iterateInsertionAt(i))(0,Qe.D_)({transaction:t,treeOperation:u,deleteFrom:"tree-parent",preferHighLevelOperations:c}),qe.f.applyMutable(u);if(n.blockSelection.wasContiguousSelection&&n.blockSelection.blocks.length>0&&!o.hasContent())for(const u of r.getContentStores())We.jG({parentStore:o.getContentStore(),childStore:u,transaction:t});const d=new Set;for(const{originalToDuplicate:u}of s){const e=u.getByTable(F.iU);for(const{value:n}of e){if(!n||d.has(n.id))continue;d.add(n.id);const e=Ze.G.createChildStore(r,n);(0,Ye.qA)(e).find((e=>e.table===ze.bx))||(t.logDebugMessage("disposing of unwanted duplicated block",e,e.id===r.id),et.YM({childStore:e,parentStore:a,alive:!1,transaction:t}))}}}var st=n(442274),lt=n(547307),ct=n(631781),dt=n(489951),ut=n(709953),pt=n(311712),mt=n(524677),gt=n(164964),ft=n(680402),ht=n(666771),vt=n(210228),yt=n(61202);const bt=!1;function _t(){if(bt){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.log("clipboardActions:",...t)}}const St=(0,q.defineMessages)({offlineError:{id:"clipboardActions.offlineError.message",defaultMessage:"Please go online to copy this block."},untitled:{defaultMessage:"Untitled",id:"clipboardActions.untitledMessage"}}),kt=(0,q.defineMessages)({copiedQnAMessageToClipboard:{id:"action.copiedQnAMessageToClipboard",defaultMessage:"Copied response to clipboard"},copiedLinkToClipboard:{id:"action.copiedLinkToClipboard.snackBarMessage",defaultMessage:"Copied link to clipboard"},copiedBlockLinkToClipboard:{id:"action.copiedBlockLinkToClipboard.snackBarMessage",defaultMessage:"Copied block link to clipboard"},copiedLinksToClipboard:{id:"action.copiedLinksToClipboard.snackBarMessage",defaultMessage:"Copied links to clipboard"},copiedPropertyToClipboard:{id:"action.copiedPropertyToClipboard.snackBarMessage",defaultMessage:"Copied property to clipboard"},copiedCodeToClipboard:{id:"action.copiedCodeToClipboard.snackBarMessage",defaultMessage:"Copied code to clipboard"},copiedTokenToClipboard:{id:"action.copiedTokenToClipboard.snackBarMessage",defaultMessage:"Copied token to clipboard"},copiedToClipboard:{id:"action.copiedToClipboard.snackBarMessage",defaultMessage:"Copied to clipboard"},copiedApiObjectToClipboard:{id:"action.copiedApiObjectToClipboard.snackBarMessage",defaultMessage:"Copied API object to clipboard"},copiedImageToClipboard:{id:"action.copiedImageToClipboard.snackBarMessage",defaultMessage:"Copied image to clipboard"},copyImageError:{id:"action.copyImageError.snackBarMessage",defaultMessage:"Failed to copy image to clipboard"}}),wt={...A.Y,dockerfile:"Docker",javascriptreact:"JavaScript",jsonc:"JSON","objective-c":"Objective-C",proto:"Protobuf",shellscript:"Shell",typescriptreact:"TypeScript",vb:"Visual Basic"},xt="text/_notion-blocks-v3-production",It="text/_notion-text-production",Ct="text/_notion-multi-text-production",Tt="text/_notion-page-source-production",Mt="vscode-editor-data",Pt=[xt,It,Ct,Tt],At=new Set(Pt);const Rt={fromJson:e=>e,toJson:e=>e},Dt=Rt,Bt=Rt,Et=Rt,Ft={fromJson(e){const t=(0,z.MW)(e.tree,(e=>e)),n=Zt.fromJson(e.blockSelection);return{...e,tree:t,blockSelection:n}},toJson(e){const t=Zt.toJson(e.blockSelection);return{...e,blockSelection:t}}},Zt={fromJson:e=>({...e,blocks:e.blocks.map((e=>({...e,blockSubtree:e.blockSubtree?R.Ak.create(e.blockSubtree):void 0})))}),toJson:e=>({...e,blocks:e.blocks.map((e=>({...e,blockSubtree:e.blockSubtree?e.blockSubtree.toJson({allowVersionDowngrade:!1}):void 0})))})},Ut="VirtualClipboard:production";let Vt;function Nt(e){return e.isAndroid}function Ot(e,t){if(!Nt(t))return e;const n=(0,ce.nZ)(e.getData("text/html"));if(n){Vt||(Vt=N.Z.get(Ut));const t=Vt;if(n===(null==t?void 0:t.id)){const n=e.types.concat(Object.keys(t.mimeTypes));return{getData(n){const o=e.getData(n);return!o&&function(e){return At.has(e)}(n)?t.mimeTypes[n]||"":o},types:[...new Set(n)].filter((n=>{const o=t.mimeTypes[n];return""!==e.getData(n)||o&&""!==o})),items:e.items}}}return e}function Lt(e,t,n,o){if(!e.clipboardData)return;const r=n.toJson(o),i=JSON.stringify(r);e.clipboardData.setData(t,i)}function jt(e,t,n){try{const o=e.getData(t),r=JSON.parse(o);return n.fromJson(r)}catch(o){return}}function Kt(e){const{clipboardData:t}=e,{text:n,html:o,isFromMicrosoftOffice:r,isHtmlTable:i}=function(e){const{clipboardData:t,tinyMceMicrosoftWordPasteFilter:n}=e,o=t.getData("text/uri-list"),r=t.getData("text/plain").replace(kn,"\n")||o,i=t.getData("text/html"),a=gn(i),{isHtmlTable:s,htmlContainsRichFormatting:l}=function(e){var t;const n=document.createElement("div");n.innerHTML=fn(e);const o=Boolean("table"===(null===(t=n.firstElementChild)||void 0===t?void 0:t.nodeName.toLowerCase()));return{htmlContainsRichFormatting:S.RE({node:n,window,emojiData:se.Z.state}),isHtmlTable:o}}({html:i,tinyMceMicrosoftWordPasteFilter:n});if(!l&&!function(e,t){return Sn.test(e)&&Sn.test(t)}(i,r))return{text:r,isFromMicrosoftOffice:a,isHtmlTable:s};return{text:r,html:i,isFromMicrosoftOffice:a,isHtmlTable:s}}(e);return{text:n,html:o,multiTextSelectionData:jt(t,Ct,Ft),textSelectionData:jt(t,It,Dt),blockSelectionData:jt(t,xt,Zt),isFromMicrosoftOffice:r,isHtmlTable:i}}function zt(e){const{blocks:t,action:n,environment:o}=e;if(0===t.length)return{action:n,blocks:[],wasContiguousSelection:!1};const r=t[0],i=r.inMemoryRecordCache,a=G.jj(G.oA(t.map((e=>e.id)))),s=r.getParentBlockStore(),l=s?s.getRenderableContentIds():[],c=l.indexOf(r.id),d=Boolean(s&&t.every(((e,t)=>l.indexOf(e.id)===c+t)));if(i.isTemplatePreview){return{blocks:a.map((e=>({blockId:e,snapshotData:void 0,blockSubtree:Xe.K8(o,{blockId:e,inMemoryRecordCache:i,allowCopyCollections:!0,requireFullSubtree:!1,skipTransclusionContainerChildren:!0,allowCopyExternalObjectInstances:!0,excludeCrdtData:!0,includeLegacyTransclusionBlockValues:(0,me.hC)()})}))),action:n,wasContiguousSelection:d}}if(i.snapshotData){Oe.P_(o,i.snapshotData);return{blocks:a.map((e=>({blockId:e,snapshotData:i.snapshotData,blockSubtree:Xe.K8(o,{blockId:e,inMemoryRecordCache:i,allowCopyCollections:!0,requireFullSubtree:!0,skipTransclusionContainerChildren:!0,allowCopyExternalObjectInstances:!0,excludeCrdtData:!0,includeLegacyTransclusionBlockValues:(0,me.hC)()})}))),action:n,wasContiguousSelection:d}}{const e=(0,ce.IU)(t),r=e&&function(e){var t;const{environment:n,multiColumnPasteInfo:o,inMemoryRecordCache:r}=e,{columnListId:i,columnIds:a,spaceId:s}=o,l=R.Ak.create(),c=null===(t=r.getEntry({pointer:{table:F.iU,id:i,spaceId:s},userId:n.currentUser.id}))||void 0===t?void 0:t.value.value;if("column_list"!==(null==c?void 0:c.type))return;const d={...c,content:(c.content||[]).filter((e=>a.has(e)))};l.setValue({table:F.iU,id:i,spaceId:s},d);for(const m of a){var u;const e=null===(u=r.getEntry({pointer:{table:F.iU,id:m,spaceId:s},userId:n.currentUser.id}))||void 0===u?void 0:u.value.value;if("column"!==(null==e?void 0:e.type))return;const t={...e,content:(e.content||[]).filter((e=>o.blockIds.has(e)))};l.setValue({table:F.iU,id:m,spaceId:s},t)}const p=[l];for(const m of o.blockIds){const e=Xe.K8(n,{blockId:m,inMemoryRecordCache:r,allowCopyCollections:!1,requireFullSubtree:!0,skipTransclusionContainerChildren:!0,allowCopyExternalObjectInstances:!0,excludeCrdtData:!0,includeLegacyTransclusionBlockValues:(0,me.hC)()});if(!e)return;p.push(e)}return R.Ak.merge(p)}({environment:o,inMemoryRecordCache:i,multiColumnPasteInfo:e});if(e&&r){let t=!1;const s=[];for(const n of a)e.blockIds.has(n)?t||(s.push({blockId:e.columnListId,snapshotData:void 0,blockSubtree:r}),t=!0):s.push({blockId:n,snapshotData:void 0,blockSubtree:Xe.K8(o,{blockId:n,inMemoryRecordCache:i,allowCopyCollections:!1,requireFullSubtree:!0,skipTransclusionContainerChildren:!0,allowCopyExternalObjectInstances:!0,excludeCrdtData:!0,includeLegacyTransclusionBlockValues:(0,me.hC)()})});return{blocks:s,action:n,wasContiguousSelection:d}}return{blocks:a.map((e=>({blockId:e,snapshotData:void 0,blockSubtree:Xe.K8(o,{blockId:e,inMemoryRecordCache:i,allowCopyCollections:!1,requireFullSubtree:!0,skipTransclusionContainerChildren:!0,allowCopyExternalObjectInstances:!0,excludeCrdtData:!0,includeLegacyTransclusionBlockValues:(0,me.hC)()})}))),action:n,wasContiguousSelection:d}}}function qt(e){const{markdown:t,markdownOptions:n,markdownLinkifyIt:o}=e;if(o)return C.c8({...o,markdown:t,plugin:null==n?void 0:n.plugin})}function Ht(e){const{rootBlock:t,getRecordValue:n}=e,o=n(t);if(!o)return;const r=(0,b.ky)({block:o,getRecordValue:n});if(!r)return;const i=(0,ce.ax)({rootBlock:t,getRecordValue:n}),a=(0,c.oC)(r),s=Object.keys(a),l=G.MR(s,(e=>{const t=a[e];return t&&t.name||""}));let d="";for(const c of l){const e=a[c];if(e&&"title"!==c){const t=(0,g.Wy)({property:c,schema:a,block:o,exportArgs:i,renderers:m.O});t&&(d+=`${e.name}: ${t}\n`)}}return d||void 0}function Gt(e){const{treePath:t,textPosition:n,endpoint:o}=e,{store:r,index:i}=n,a=t.map((e=>e.value.store.pointer)),s=ae.FX(n.store)?["properties","title"]:n.store.path,l=O.xrQ(r.getValue(),i,i);return{copiedText:"end"===o?l.tokensBeforeRange:l.tokensAfterRange,textIndex:i,attributePath:s,pointerPath:a}}function Wt(e){var t;const{multiSelection:n,action:o,environment:r}=e;(0,fe.qS)(n)&&console.warn("Warning, serializeMultiTextSelectionToClipboardData() was called with a single-store text selection! This function should only be  called with a multi-selection that spans multiple blocks.");const i=null===(t=(0,he.tp)({filterCommonAncestors:!0,multiSelection:n,focus:void 0}))||void 0===t?void 0:t.stores;if(!i)return;const a=n.start.store.inMemoryRecordCache,s=zt({action:o,blocks:i,environment:r});if(0===s.blocks.length)return;const l=(0,he.Nj)({multiSelection:n,includeNonSelectable:!1});if(!l)return;const{treeRange:c}=l,d=[],u=new Map,p=(e,t)=>{t.forEach((e=>p(e,[])));const n=u.get(e),o=n&&n.length>t.length?n:t;u.set(e,o)},m=Be.default.checkGate({gateName:"prefer_high_level_operations"});for(const{start:b,end:_}of c.iterateAnalogousNodes()){if(b){const e=b.childrenBeforeRange.slice(-1).concat(b.childrenInsideRange);p(b.parent,e)}if(_)if(p(_.parent,_.childrenInsideRange),m)for(const e of _.childrenAfterRange)d.push({command:"removeChild",path:["content"],pointer:_.parent.value.store.pointer,args:{id:e.value.store.id}});else d.push(M.op.set({pointer:_.parent.value.store.pointer,path:["content"],args:_.childrenInsideRange.map((e=>e.value.store.id))}))}const g=Gt({textPosition:n.start,endpoint:"start",treePath:c.startPath}),f=Gt({textPosition:n.end,endpoint:"end",treePath:c.endPath});d.push(...(0,ce.FQ)(g),...(0,ce.FQ)(f));for(const b of[null===(h=s.blocks[0])||void 0===h?void 0:h.blockSubtree,null===(v=s.blocks[s.blocks.length-1])||void 0===v?void 0:v.blockSubtree]){var h,v;b&&((0,P.FS)({recordMap:b,operations:d,updateOnly:!0}),m&&$t(r,a,b))}const y=(0,z.MW)(c.commonAncestor,(e=>{const t=u.get(e);if(t)return{value:e.value.store.pointer,children:t}}));if(y)return{blockSelection:s,tree:y,multiTextSelection:{start:g,end:f},action:o};_t("unexpected: trimming tree produced undefined")}function $t(e,t,n){const o=[];for(const{model:r}of n)if(r instanceof T.yJh&&!r.alive){o.push(r.pointer);const n=Xe.K8(e,{blockId:r.pointer.id,inMemoryRecordCache:t,allowCopyCollections:!0,requireFullSubtree:!1,skipTransclusionContainerChildren:!0,allowCopyExternalObjectInstances:!0,excludeCrdtData:!0,includeLegacyTransclusionBlockValues:(0,me.hC)()});if(n)for(const{pointer:e}of n)o.push(e)}for(const r of o)n.delete(r)}function Yt(e){const{environment:t,event:n}=e,o=k.Il();!function(e){const{environment:t,event:n,markdownLinkifyIt:o}=e;if(!n.clipboardData)return;const r=Ue.default.state.stores,i=Ve.default.isEditingComment(),a=Me.Z.state.open,s=Ce.UQ(),c="empty"!==Ve.default.state.mode&&Ve.default.state.multiSelection,d=t.currentUser.id,u="copy"===n.type?"copy":"cut",p=le.RM();p&&(0,D.$O)(p.pointer,F.iU)&&Lt(n,Tt,Bt,p.pointer);const m=c&&(0,fe.QY)(c);if(m&&m.selection.startIndex!==m.selection.endIndex){const e=ge.default.getIntl(),{store:o,selection:r}=m,i=o.inMemoryRecordCache,a=o.getValue();if(_t("copy: copying single-store text selection"),n.preventDefault(),a&&!yn()){const e=o.table===F.iU?(0,ye.sQ)(o):void 0,t=e&&G.Xy(o.path,e.getBlockTitleStore().path)?e.getType():void 0,i=t&&(0,l.Zu)(t)?t:void 0,s=a.filter((e=>!O.eIM(e)));Lt(n,It,Dt,{blockType:i,editing:s,selection:r,action:u})}const s=O.KU1(a,r.startIndex,r.endIndex),c=T.omK.fromGetRecordValueFn(i.makeGetRecordValueFn(d)),p=i.makeGetRecordRoleFn(d),g=(0,B.Xh)({intl:e,textValue:s,getRecordModel:c,userTimeZone:(0,_.r)(),externalIntegrations:Ee.Z.integrations.state});n.clipboardData.setData("text/plain",(0,ce.ZI)(t.device.isWindows,g));const f=j.hW({textValue:s&&{value:s,spaceId:(0,V.C)(o.pointer.spaceId)},getRecordModel:c,getRecordRole:p,userTimeZone:(0,_.r)(),isAndroid:!1,isSafariOrIOS:!1,isWindows:!1,disableLinks:!1,disabled:!0,disableHover:!1,disableStyleAnnotations:!1,disableInsertedDeletedAnnotations:!1,disableDateStyleAnnotations:!1,disableSuggestionAnnotations:!1,baseUrl:ie.default.domainBaseUrl,publicDomainName:ie.default.publicDomainName,showEmojiInline:!0,emojiType:"raw",theme:(0,H.Vx)(),intl:e,katex:void 0,isClient:void 0,currentUserId:void 0,getPublicBaseUrlForPage:ue.Lr,externalIntegrations:Ee.Z.integrations.state,formulaValueTypes:[],emojiData:se.Z.state,isMobileNative:!1});return void n.clipboardData.setData("text/html",(0,ce.ZI)(t.device.isWindows,f))}if(c&&!(0,fe.iG)(c)&&!i&&c.start.store.table===F.iU&&c.end.store.table===F.iU){const e=Wt({environment:t,multiSelection:c,action:u});if(e){_t("copy: copying multi-text selection"),n.preventDefault(),Lt(n,Ct,Ft,e);const r=c.start.store.inMemoryRecordCache,i=c.start.store.getRecordStoreUIRoot().getValue();if(!i)return;const{markdown:a,html:s}=(0,ce.Ef)({clipboardData:e,rootBlock:{id:i.id,table:F.iU,spaceId:i.space_id},isWindows:t.device.isWindows,fallbackGetRecordValue:r.makeGetRecordValueFn(d),markdownLinkifyIt:o,markdownSerializationOptions:{transformBlockMapping:{image:Be.default.checkGate({gateName:"docs_clipboard_imagedata"})?Qt:void 0}}});return a&&n.clipboardData.setData("text/plain",a),void(s&&n.clipboardData.setData("text/html",s))}}if(c&&!(0,fe.iG)(c)&&!i&&c.start.store.table===U.x_&&c.end.store.table===U.x_){_t("copy: copying comment multi-text selection"),n.preventDefault();const e=(0,he.L5)(c),o=ge.default.getIntl(),r=e.map((e=>{let{store:n,selection:r}=e;if(r.startIndex===r.endIndex)return;const i=n.inMemoryRecordCache,a=T.omK.fromGetRecordValueFn(i.makeGetRecordValueFn(d)),s=i.makeGetRecordRoleFn(d),l=O.KU1(n.getValue(),r.startIndex,r.endIndex);return{plainText:(0,B.Xh)({intl:o,textValue:l,getRecordModel:a,userTimeZone:(0,_.r)(),externalIntegrations:Ee.Z.integrations.state}),htmlContent:j.hW({textValue:l&&{value:l,spaceId:(0,V.C)(n.pointer.spaceId)},getRecordModel:a,getRecordRole:s,userTimeZone:(0,_.r)(),isAndroid:!1,isSafariOrIOS:!1,isWindows:!1,disableLinks:!1,disabled:!0,disableHover:!1,disableStyleAnnotations:!1,disableInsertedDeletedAnnotations:!1,disableDateStyleAnnotations:!1,disableSuggestionAnnotations:!1,baseUrl:ie.default.domainBaseUrl,publicDomainName:ie.default.publicDomainName,showEmojiInline:!0,emojiType:"raw",theme:(0,H.Vx)(),intl:o,katex:void 0,isClient:void 0,currentUserId:void 0,getPublicBaseUrlForPage:Te.aR(t),externalIntegrations:Ee.Z.integrations.state,formulaValueTypes:[],emojiData:se.Z.state,isMobileNative:!1}),textValue:l}})).filter(Y.$K),i=r.map((e=>e.plainText)).join("\n\n"),a=`<div>${r.map((e=>e.htmlContent)).join("</div><div>")}</div>`;return n.clipboardData.setData("text/plain",(0,ce.ZI)(t.device.isWindows,i)),void n.clipboardData.setData("text/html",(0,ce.ZI)(t.device.isWindows,a))}if(r.length>0&&!i&&!s&&!a){_t("copy: copying block selection"),n.preventDefault();const e=r[0],i=e.inMemoryRecordCache,a=zt({blocks:r,environment:t,action:u});if(Lt(n,xt,Zt,a),!e.isDefined())return;const s=G.oA(r.map((e=>e.computeWithRecordValues((t=>{let{getRecordValueAndSubscribe:n}=t;return n(e)}))))),l=i.makeGetRecordValueFn(d),{markdown:c,html:p}=(0,ce.X4)({rootBlock:{id:e.id,table:F.iU,spaceId:e.getSpaceId()},blockValues:s,getRecordValue:l,isWindows:t.device.isWindows,markdownLinkifyIt:o});return c&&n.clipboardData.setData("text/plain",c),void(p&&n.clipboardData.setData("text/html",p))}_t("copy: doing nothing")}(e),(0,ce.Li)(n,o),function(e){let{event:t,device:n,customEventId:o}=e;if(!t.clipboardData||!Nt(n))return;const r={};for(const s of Pt)r[s]=t.clipboardData.getData(s);const i=t.clipboardData.getData("text/html");t.clipboardData.setData("text/html",`${i}${(0,ce.Gp)(o)}`),Vt={id:o,mimeTypes:r};try{N.Z.set(Ut,Vt)}catch(a){y.log({level:"error",from:"clipboardActions",type:"setVirtualClipboardData",error:{message:"Unable to persistently store virtual clipboard data."}})}}({event:n,device:t.device,customEventId:o})}function Qt(e){const{block:t,exportArgs:n}=e,{getExportedRenderAsset:o}=n,{source:r}=T.kk5.fromBlock(t).getProperties(),i=O.QaF(r),a=function(e){if(!e.file_ids)return;const t=we.R.findBlockFromId(e.id);if(!t)return;const n=t.getNode();if(!(n instanceof Element))return;const o=n.querySelector("img");if(!o)return;const r=document.createElement("canvas");r.width=o.width,r.height=o.height;const i=r.getContext("2d");if(!i)return;return i.drawImage(o,0,0,o.width,o.height),r.toDataURL()}(t)??o({fromBlockId:n.blockId,toFileURI:i}),s=C.cG(e)||C.WB({block:t,exportArgs:n})||a;return{text:(0,u.SR)({url:i})?`![${s}](${a})`:`[${s}](${a})`,breakLines:!0,children:C.AS(e)}}async function Jt(e){const{event:t,environment:n,markdownLinkifyIt:o}=e;nt.syncTextSelection();const r=Ue.default.state.stores,i=Ve.default.isEditingComment(),a=le.JE(),s="editing"===Ve.default.state.mode&&Ve.default.state.multiSelection,{phase:l}=Ue.default.state;if(Xt({environment:n,event:t,disableSyncTextSelection:!0,markdownLinkifyIt:o}),s&&!(0,fe.iG)(s)){const e=s.start.store.getAncestorBlockStoreAtRootPath(),t=e?De.Z.getMode(e):"default";vt.createAndCommit({userAction:"clipboardActions.cutWithMaybeConfirmation",environment:n,perform:o=>{if("suggest"===t){const t=re.oG(n,o,e);re.Sz({environment:n,multiSelection:s,transaction:o,discussionStore:t})}else tt.pz({environment:n,multiSelection:s,transaction:o})}})}else(l===Ue.SelectionPhase.Selected||s)&&r.length>0&&!i&&!a&&await pt.Qw({environment:n,blocks:r,shouldCheckSuggestEdit:!0});Fe.Z.setKeyboardMode(!0)}function Xt(e){const{environment:t,event:n,disableSyncTextSelection:o,markdownLinkifyIt:r}=e;o||nt.syncTextSelection(),Yt({environment:t,event:n,markdownLinkifyIt:r}),Fe.Z.setKeyboardMode(!0)}function en(e){var t,n;const{environment:o,files:r,transaction:i,insertBelowBlockStore:a}=e,s=Ue.default.getCurrentRecordCache(),l=le.qQ(o);if(!s)return;const c=Ue.default.state.stores,d=ct.z({environment:o,files:r,inMemoryRecordCache:s,transaction:i,pageWidth:l,spaceId:0!==c.length?c[0].pointer.spaceId:null===(t=le.RM())||void 0===t?void 0:t.pointer.spaceId,useCrdt:0!==c.length?c[0].useCrdt():(null===(n=le.RM())||void 0===n?void 0:n.useCrdt())??!1});d.forEach((e=>{const t=e.getType();t&&Le.W(o,{from:"paste",type:t,creating_block_id:e.id})})),on({environment:o,blocks:d,transaction:i,replaceEmptyTextBlock:!0,insertBelowBlockStore:a})}function tn(e){const{environment:t,store:n,tokens:o,index:r,transaction:a,multiTextSelection:s,disableEmbedMenu:l,selectAll:c}=e,d=(0,fe.QY)(s),u=d?{value:d.store.getValue()}:void 0,m=n.getAncestorBlockStoreAtRootPath(),g=m?De.Z.getMode(m):"default";let f=o;(Ve.default.isEditingComment()||Ve.default.isEditingCaption())&&(f=function(e){const{environment:t,tokens:n}=e,o=nn(n);if(o&&o.url===o.text){const e=(0,E.parseRoute)({url:o.url,baseUrl:ie.default.domainBaseUrl,publicDomainName:ie.default.publicDomainName,isMobile:t.device.isMobile,protocol:ie.default.protocol,currentUrl:window.location.href});if("page"===e.name){const t=O.$0A(e.scrollToBlockId??e.blockId,void 0);return[O.YCD(t),O.V3y(" ")]}}return n}({environment:t,tokens:o})),tt.mM({environment:t,store:n,tokens:f,index:r,transaction:a,selectAll:c,editorMode:g});const h=nn(f);!l&&u&&h&&"suggest"!==g&&function(e){const{environment:t,hyperlink:n,oldTextValue:o}=e,r="editing"===Ve.default.state.mode&&(0,fe.QY)(Ve.default.state.multiSelection),a=Ue.default.state;if(r&&a.stores.length>0){const e=r.store.getValue(),a=O.QaF(e),s=p.p4(a.substring(0,a.indexOf(n.text))).length,l=s+p.p4(n.text).length;if(r.store.isTable(F.iU)||r.store.isTable(U.x_)){if(yt.KT({environment:t,blockStore:Ue.default.state.stores[0],textStore:r.store,textValueBeforePaste:o,url:n.url,urlSelection:{startIndex:s,endIndex:l}}))return;if(ee.QZ({environment:t,textStore:r.store,blockStore:Ue.default.state.stores[0],oldTextValue:o,url:n.url,urlSelection:{startIndex:s,endIndex:l}}))return}i.default.afterNextFlush((()=>{let e=n.url;try{e=decodeURIComponent(n.url)}catch(i){y.log({level:"info",from:"clipboardActions",type:"activateMenuFromLink",error:{message:`Encountered error in decodeURIComponent ${n.url}`}})}dt.KT({environment:t,textStore:r.store,oldTextValue:o,url:e,urlSelection:{startIndex:s,endIndex:l}})}))}}({environment:t,hyperlink:h,oldTextValue:u.value,transaction:a})}function nn(e){if(1!==e.length)return;const t=e[0];if(!O.AJd(t))return;const[n,o]=t;if(1!==o.length)return;const r=o[0];if(!O.j0F(r))return;return{text:n,url:O.zW$(r)}}function on(e){const{environment:t,blocks:n,transaction:o,replaceEmptyTextBlock:r,insertBelowBlockStore:i}=e,a=Ue.default.state.stores;if(1===a.length){const e=a[0];if(e.getType()&&e.isType(l.hY)&&function(e){if("editing"!==Ve.default.state.mode||!Ve.default.state.multiSelection)return!1;const t=(0,fe.QY)(Ve.default.state.multiSelection);if(!t)return!1;return t.store===e.getTitleStore()}(e)){const r=e.getContentStore(),i=G.d9(n).reverse().map((e=>te.Ce({parentStore:r,prependStore:e,transaction:o}).childStore));return mt.Z5({environment:t,stores:i}),i}}return pt.BM({environment:t,blocksToInsert:n,target:i?[i]:a,transaction:o,replaceEmptyTextBlock:r})}function rn(e,t,n,o){const r=(0,le.RM)();if(!r)return;const a=Ue.default.state.stores,s=0!==a.length?a[0].pointer.spaceId:r.pointer.spaceId,c=0!==a.length?a[0].useCrdt():r.useCrdt();let d=function(e,t){if("cut"!==t.action||!Be.default.checkGate({gateName:"convert_cut_paste_to_move"}))return;const n=[];for(const o of t.blocks){const t=Ze.G.createChildStore(e,{table:F.iU,id:o.blockId});if(!t.isReady())return;if(t.useCrdt()!==e.useCrdt())return;const r=t.getModel();if(!r)return;if(r.getSpaceId()!==e.getSpaceId())return;if(!1!==r.alive)return;n.push(t)}return n}(r,t);if(!d){const n=JSON.stringify(t).length>ke._V;d=t.blocks.map((t=>{var i;let{blockId:a,blockSubtree:l,snapshotData:d}=t;const u=Ze.G.createChildStore(r,{table:F.iU,id:a});let p;if(u.isDefined())p=u.getModel();else{const e=null==l?void 0:l.getValue({table:F.iU,id:a});p=e&&T.kk5.fromBlock(e)}const m=!(r.isInsideTemplate()||bn()||r.isInsideFactoryOrDuplicateBlocksAction()||null!==(i=p)&&void 0!==i&&i.isTemplateVariableContainerBlock());if(l&&!n){const t=Xe.E9({environment:e,sourceBlockId:a,targetBlockPointer:(0,pe.Ii)({environment:e,table:F.iU,spaceId:s}),sourceBlockSubtree:l,targetInMemoryRecordCache:u.inMemoryRecordCache,addCopyName:(0,be.Z)(u),deepCopyTransclusionContainers:!1,resolveTemplateVariables:m,transaction:o,useCrdt:c,preventLegacyTransclusions:(0,me.hC)()}).targetBlockStore,n=t.getType();return n&&Le.W(e,{from:"paste",type:n,new_page_id:"page"===n?t.id:void 0,creating_block_id:t.id,parent_collection_id:u.getParentCollectionIdUpToTwoLevels()}),t}{Re.Z.state.online||lt.showErrorMessage(ge.default.formatMessage(St.offlineError));const[t,r]=Xe.WJ({environment:e,sourceBlocks:[{id:a,spaceId:(0,V.C)(void 0)}],targetInMemoryRecordCache:u.inMemoryRecordCache,addCopyName:(0,be.Z)(u),transaction:o,deepCopyTransclusionContainers:!1,resolveTemplateVariables:m,snapshotData:d,targetSpaceId:(0,V.C)(s),convertExternalObjectInstancesToPlaceholders:!1,useCrdt:c,userActionSuffix:l&&n?" (forceServerSideCopy)":void 0}),i=t[0],p=i.getType();return r.then((t=>{t?lt.showErrorMessage(t):p&&Le.W(e,{from:"paste",type:p,new_page_id:"page"===p?i.id:void 0,creating_block_id:i.id,parent_collection_id:u.getParentCollectionIdUpToTwoLevels()})})),i}}))}if("suggest"===De.Z.getMode(a[0])){const t=re.oG(e,o,d[0]),n=[];d.forEach((e=>{const r={type:"insert",id:k.Il(),discussionId:t.id};re.n1(o,e,r),n.push(e.id)})),o.preEnqueueActions.push((()=>{re.vh({environment:e,transaction:o,discussionStore:t,addModifiedBlockIdsAfter:n})})),ht.uj({environment:e,blocks:d,annotation:[O.GKr.SuggestionInsertText,t.id],transaction:o})}on({environment:e,blocks:d,transaction:o,replaceEmptyTextBlock:!0});const u=Ue.default.state.stores,p=u.length>0?u:[r],m=t.blocks.map((e=>{const t=p.length>0?p[0]:function(e){return e.isCollectionView()?e.getCollectionViewCollectionStore()||e:e.getContentStore()}(r);return Ze.G.createChildStore(t,{table:F.iU,id:e.blockId})}));i.default.afterNextFlush((async()=>{await Promise.all(p.map((e=>e.waitUntil((()=>{const t=e.getType();return Boolean(t&&t!==l.Ti.copyIndicator)}))))),await Promise.all(m.map((e=>e.load()))),n&&Ke.RH({environment:e,blocks:p,pageSource:n,copiedStores:m,action:t.action,wasContiguousSelection:t.wasContiguousSelection,rootStore:r})&&Ke.kE({copiedStores:m,blocks:p,pageSource:n})}))}function an(e){const{environment:t,disableEmbedMenu:n,transaction:o,overwrite:r,selectAll:i,markdownOptions:a,markdownLinkifyIt:s,text:l,tinyMceMicrosoftWordPasteFilter:c}=e,d=l.includes("\n"),u=Ve.default.state,p=vn(u);d&&"inline"!==p||"editing"!==u.mode?r?(o.logDebugMessage("paste: pasting as markdown overwrite"),function(e){const{environment:t,text:n,transaction:o,selectAll:r,markdownOptions:i,markdownLinkifyIt:a,tinyMceMicrosoftWordPasteFilter:s}=e,l=qt({markdown:n,markdownOptions:i,markdownLinkifyIt:a});if(!l)return;let c=ln({environment:t,html:l,wrapInEmptyBlocks:!1,tinyMceMicrosoftWordPasteFilter:s});c||(c=ln({environment:t,html:l,wrapInEmptyBlocks:!0,tinyMceMicrosoftWordPasteFilter:s}));if(!c)return;rt({environment:t,clipboardData:c,transaction:o,allowPasteIntoHeaderWithoutChildren:!0,selectAll:r,preventLegacyTransclusions:(0,me.hC)()})}({environment:t,text:l,transaction:o,selectAll:i,markdownOptions:a,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:c})):l&&(o.logDebugMessage("paste: pasting as markdown append"),function(e){const{environment:t,text:n,transaction:o,markdownOptions:r,markdownLinkifyIt:i,tinyMceMicrosoftWordPasteFilter:a}=e,s=qt({markdown:n,markdownOptions:r,markdownLinkifyIt:i});if(s)un({environment:t,html:s,transaction:o,tinyMceMicrosoftWordPasteFilter:a})}({environment:t,text:l,transaction:o,markdownOptions:a,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:c})):(o.logDebugMessage("paste: pasting as inline markdown"),function(e){const{environment:t,text:n,disableEmbedMenu:o,transaction:r,selectAll:i,markdownOptions:a,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:l}=e,c="editing"===Ve.default.state.mode&&Ve.default.state.multiSelection;if(c){const e=(0,fe.QY)(c);if(e&&function(e){const t=Ve.default.state;return"editing"===t.mode&&!(0,fe.iG)(t.multiSelection)&&(0,fe.qS)(t.multiSelection)&&I.B(e,"url")}(n))_n({environment:t,text:n,transaction:r,editingSelection:e,selectAll:i});else if((0,Se.Ld)("c")){const e=(0,ye.sQ)(c.start.store);tt.hJ({environment:t,editorMode:e?De.Z.getMode(e):"default",multiSelection:c,string:n,disableMentions:!0,disableEmojiCommands:!0,disableSlashCommands:!0,transaction:r,selectAll:i})}else{const e=s&&C.lM({...s,markdown:n,plugin:null==a?void 0:a.plugin});if(!e)return;dn({environment:t,html:e,transaction:r,stripText:!1,stripSurroundingWhitespace:!1,disableEmbedMenu:o,selectAll:i,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:l})}}}({environment:t,text:l,disableEmbedMenu:n,transaction:o,selectAll:i,markdownOptions:a,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:c}))}function sn(e,t){const n=e.getValue({table:F.iU,id:t});if(!n)return;const o={table:F.iU,id:t,spaceId:n.space_id},r=(n.content??[]).map((t=>sn(e,t))).filter(Y.$K);return new z.mp(o,r)}function ln(e){var t,n,o,r;const i=le.RM(),{html:a,wrapInEmptyBlocks:s,tinyMceMicrosoftWordPasteFilter:l,environment:c}=e,d=mn({environment:c,html:a,tinyMceMicrosoftWordPasteFilter:l,useCrdt:!1});if(!d)return;let{allOperations:u,rootContentIds:p}=d;if(s){const e=pn(c),t=pn(c);if(!e||!t)return;u=[e.operation,...u,t.operation],p=[e.id,...p,t.id]}const m=R.Ak.create();(0,P.FS)({recordMap:m,operations:u,updateOnly:!1});const g=[];for(const w of p)g.push({blockId:w,snapshotData:void 0,blockSubtree:m.clone()});const f=new z.mp({...(0,pe.Ii)({environment:c,table:F.iU,spaceId:null==i?void 0:i.pointer.spaceId})},p.map((e=>sn(m,e))).filter(Y.$K));if(0===f.children.length)return;const h=f.children[0],v=null===(t=(0,z.DY)([f],(e=>e===h)))||void 0===t?void 0:t.map((e=>e.value)),y=null===(n=m.getValue(h.value))||void 0===n||null===(n=n.properties)||void 0===n?void 0:n.title,b=(0,z.CY)(f),_=null===(o=(0,z.DY)([f],(e=>e===b)))||void 0===o?void 0:o.map((e=>e.value)),S=null===(r=m.getValue(b.value))||void 0===r||null===(r=r.properties)||void 0===r?void 0:r.title,k=S?O.QaF(S).length:0;return y&&v&&S&&_?{blockSelection:{blocks:g,wasContiguousSelection:!0,action:"copy"},tree:f,multiTextSelection:{start:{textIndex:0,copiedText:y,attributePath:["properties","title"],pointerPath:v},end:{textIndex:k,copiedText:S,attributePath:["properties","title"],pointerPath:_}},action:"copy"}:void 0}function cn(e){const{text:t,html:n,stripText:o,stripSurroundingWhitespace:r,markdownLinkifyIt:i,tinyMceMicrosoftWordPasteFilter:a}=e,s=n||(t?qt({markdown:t,markdownLinkifyIt:i}):void 0);if(!s)return;const l=document.createElement("div");return l.innerHTML=fn({html:s,tinyMceMicrosoftWordPasteFilter:a}),S.xR({node:l,window,stripText:o,stripSurroundingWhitespace:r,emojiData:se.Z.state})}function dn(e){const{environment:t,html:n,transaction:o,stripText:r,stripSurroundingWhitespace:i,disableEmbedMenu:a,selectAll:s,markdownLinkifyIt:l,tinyMceMicrosoftWordPasteFilter:c}=e,d="editing"===Ve.default.state.mode&&Ve.default.state.multiSelection;if(d){const e=cn({html:n,stripText:r,stripSurroundingWhitespace:i,markdownLinkifyIt:l,tinyMceMicrosoftWordPasteFilter:c});if(!e)return;const u=(0,ye.sQ)(d.start.store),p=1===e.length;if(p){if(p&&(!e[0][1]||0===e[0][1].length)){o.logDebugMessage("pasteInlineHtml: insertString");const n=e[0][0];return void tt.hJ({environment:t,editorMode:u?De.Z.getMode(u):"default",multiSelection:d,string:n,disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,transaction:o,selectAll:s})}const n=(0,fe.QY)(d);if(n&&!(0,fe.iG)(d)){const[,r]=e[0],i=r&&O.rlz(r);if(i){o.logDebugMessage("pasteInlineHtml: pasteLinkOverText");return void _n({environment:t,text:O.zW$(i),transaction:o,editingSelection:n,selectAll:s})}}}o.logDebugMessage("pasteInlineHtml: delete selection and insert"),tt.pz({environment:t,multiSelection:d,transaction:o}),tn({environment:t,store:d.start.store,tokens:e,index:d.start.index,transaction:o,disableEmbedMenu:a,multiTextSelection:d,selectAll:s})}}function un(e){const{environment:t,html:n,transaction:o,tinyMceMicrosoftWordPasteFilter:r}=e,a=le.RM();if(!a)return;const s=mn({environment:t,html:n,tinyMceMicrosoftWordPasteFilter:r,useCrdt:a.useCrdt()});if(!s)return;const{allOperations:c,rootContentIds:d}=s;for(const i of c)if((0,L.Qf)(i)){const e=Ze.G.createChildStore(a,i.pointer);vt.applyCrdtTextOperation({store:e,operation:i,invertedOperation:void 0,transaction:o})}else if((0,M.V_)(i)){const e=(0,Ze.Kv)(a,i.pointer);vt.applyOperation({store:e,operation:i,transaction:o})}else(0,Y.t1)(i);const u=d.map((e=>Ze.G.createChildStore(a,{table:F.iU,id:e})));u.forEach((e=>{const n=e.getType();n&&Le.W(t,{from:"paste",type:n,creating_block_id:e.id,parent_collection_id:e.getParentCollectionIdUpToTwoLevels()})}));const p=on({environment:t,blocks:u,transaction:o,replaceEmptyTextBlock:!0}).slice().reverse();return i.default.afterNextFlush((()=>{const e=p.map((e=>{if(e.getType()!==l.Ti.text)return;const n=nn(e.getTitleValue());if(!n)return;const o=(0,E.parseRoute)({url:n.url,baseUrl:ie.default.domainBaseUrl,publicDomainName:ie.default.publicDomainName,isMobile:t.device.isMobile,protocol:ie.default.protocol,currentUrl:window.location.href});return"page"===o.name?o:void 0})).filter(Y.$K);e.length===p.length&&Ke._x({environment:t,rootStore:a,blocks:p,copiedLinks:e})})),u}function pn(e){const{currentUserStore:t}=Pe.default.state,n=le.RM();if(!t||!n)return;const o=t.id;if(!o)return;const r=n.id,i=n.pointer.spaceId,a=(0,pe.TS)({environment:e,table:F.iU,spaceId:i});return{operation:{pointer:{table:"block",id:a,spaceId:i},command:"set",path:[],args:{id:a,version:1,type:"text",properties:{title:[[""]]},parent_id:r,parent_table:"block",space_id:i,created_by_table:"notion_user",created_by_id:o,created_time:Date.now(),last_edited_by_table:"notion_user",last_edited_by_id:o,last_edited_time:Date.now(),alive:!0}},id:a}}function mn(e){const{environment:t,useCrdt:n,...o}=e,r=document.createElement("div");r.innerHTML=fn(o);const{currentUserStore:i}=Pe.default.state,s=le.RM();if(!i||!s)return;const l=i.getValue();if(!l)return;const c=s.getSpaceId(),d=(0,pe.l5)({environment:t,spaceId:c}),u=t.idCreator.getSpaceShortIdCreator(c,d);return S.$O({actor:(0,a.dp)(l),parent:{id:s.id,table:F.iU,spaceId:c},rootNode:r,deps:{importFileMap:{},window,secureFileS3Url:ie.default.secureFileS3.url,secureFileS3UrlV2:ie.default.secureFileS3V2.url,intl:ge.default.getIntl(),randomID:W.ZP,spaceIdCreator:u,randomShortID:$.ZP,isPhoneNumber:hn,emojiData:se.Z.state},options:{useCrdt:n,ignoreBlockCount:!1}})}function gn(e){return/schemas-microsoft-com:office/.test(e)||/xmlns:m="http:\/\/schemas.microsoft.com\/office\/2004\/12\/omml"/.test(e)}function fn(e){const{html:t,tinyMceMicrosoftWordPasteFilter:n}=e;return r().sanitize(n&&gn(t)?n(t):t)}function hn(e){return/^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$/.test(e)}function vn(e){const t="editing"===e.mode&&e.multiSelection;if(!t)return;const n=xe.E.findEditableWithStore(t.start.store),o=null==n?void 0:n.props;return o&&!o.disabled?o.pasteBehavior:void 0}function yn(){var e;if("editing"!==Ve.default.state.mode)return;const t=Ve.default.state.multiSelection.start,n=t.store.path;if("formula"!==n[n.length-1])return;const o=t.store.getRecordStoreAtRootPath();if((null==o?void 0:o.table)!==F.iU)return;const r=null==o||null===(e=o.getPropertiesStore())||void 0===e||null===(e=e.getValue())||void 0===e||null===(e=e.collection_id)||void 0===e||null===(e=e[0])||void 0===e?void 0:e[0];if(!r)return;const i={table:Z.vF,id:r,spaceId:o.getSpaceId()},a=o.getRecordModel(i);return a?{parentCollection:a,start:t,getRecordModel:o.getRecordModel}:void 0}function bn(){const e=Ue.default.state.stores;if("editing"!==Ve.default.state.mode)return e.length>0&&e[0].isInsideFactoryOrDuplicateBlocksAction();if(0===e.length)return!1;const{multiSelection:t}=Ve.default.state,n=t.start.store;if(!n.isTable(F.iU))return!1;const o=de.W(n);return Boolean(o)}function _n(e){const{text:t,transaction:n,environment:o,editingSelection:r,selectAll:i}=e,a=(0,E.parseRoute)({url:t,baseUrl:ie.default.domainBaseUrl,publicDomainName:ie.default.publicDomainName,isMobile:o.device.isMobile,protocol:ie.default.protocol,currentUrl:window.location.href}),s="page"===a.name?(0,w.nR)({pageId:a.blockId,peekViewBlockId:a.peekViewBlockId,peekMode:a.peekMode,discussionId:a.discussionId,scrollToBlockId:a.scrollToBlockId,collectionViewId:a.collectionViewId}):t,l=tt.ao({environment:o,store:r.store,selection:r.selection,transaction:n});tt.ST({environment:o,store:r.store,selection:l,annotationKey:"a",transaction:n,updateSelection:!1}),ht.WO({environment:o,store:r.store,selection:l,annotation:["a",s],transaction:n}),nt.setSelection({store:r.store,selection:{startIndex:i?l.startIndex:l.endIndex,endIndex:l.endIndex}})}const Sn=/\<\!-- wp:/;const kn=/\u2028/g;function wn(e){var t;let{environment:n,event:o,disableEmbedMenu:r,transaction:i,onPasteFiles:a,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:c}=e;const d=Be.default.checkGate({gateName:"allow_cut_copy_comment"});if(o.preventDefault(),nt.syncTextSelection(),!o.clipboardData)return;if(!Ne.M_(n))return;const u=Ot(o.clipboardData,n.device),m=Array.from(Array((null===(t=u.items)||void 0===t?void 0:t.length)??0).keys()).flatMap((e=>{var t;const n=u.items[e];if("file"!==n.kind)return[];const o=null===(t=n.getAsFile())||void 0===t||null===(t=t.name.match(/\.[^.]+$/))||void 0===t?void 0:t[0];return o?[o]:[]}));Oe.VJ(n,{source:"editor",types:u.types||[],fileExtensions:m,htmlContent:u.getData("text/html")});const{text:g,html:f,multiTextSelectionData:h,textSelectionData:y,blockSelectionData:b,isFromMicrosoftOffice:S,isHtmlTable:k}=Kt({clipboardData:u,tinyMceMicrosoftWordPasteFilter:c}),w=jt(u,Tt,Bt),x=function(e){return e.clipboardData?e.clipboardData.items?G.oA(G.UI(e.clipboardData.items,(e=>{const t=e.getAsFile();if(t&&t.size>0)return new File([t],t.name??ge.default.formatMessage(St.untitled),{type:e.type})}))):p.p4(e.clipboardData.files):[]}(o),I=vn(Ve.default.state),C=(null==b?void 0:b.action)||(null==h?void 0:h.action)||(null==y?void 0:y.action);i.annotateWithUserAction("cut"===C?"paste.from_cut":ce.xF);const T=g.includes("\n"),M=function(e){const t=jt(e,Mt,Et),n=null==t?void 0:t.mode;if(!n)return;return wt[n]||"Plain Text"}(u),P=T&&M&&"inline"!==I&&!(0,Se.qK)()?function(e){const{codeLanguage:t,environment:n,transaction:o}=e,r=Ve.default.state,i="editing"===r.mode&&r.multiSelection,a=Ue.default.state.stores;if(!i&&0===a.length)return;let s,c,d;i?(s=i.start.store,c=i.end.store,d=(0,ye.sQ)(c)):(s=a[0],c=a[a.length-1],d=c);if(!d)return;let u=d;if((0,ve.Nm)(d))!function(e){const{blockStore:t,environment:n,transaction:o,codeLanguage:r}=e;ot.Cj({environment:n,blocks:[t],blockType:"code",transaction:o}),st.E5({blocks:[t],language:r,transaction:o})}({blockStore:d,environment:n,transaction:o,codeLanguage:t});else{const e=(0,ye.sQ)(d);if(!e)return;const t=s.inMemoryRecordCache;if(!t)return;u=ut.j4({environment:n,type:l.Ti.code,inMemoryRecordCache:t,transaction:o,spaceId:e.pointer.spaceId,useCrdt:e.useCrdt()}),te.BE({parentStore:e.getContentStore(),afterStore:c,insertStore:u,transaction:o})}_e.clear(n);const p=(0,ye.mh)(u);p&&nt.setSelectionAtStart({store:p});return u}({codeLanguage:M,environment:n,transaction:i}):void 0;je.bO(n,{pastedText:g,source:"editor_paste"});const A=Ce.UQ(),R=o.clipboardData.getData(ne.mH),D=yn();if(x.length>0&&!S&&!k)i.logDebugMessage("paste: file/image detected -> onPasteFiles"),a({environment:n,files:x,transaction:i});else if("body"!==(0,Se.qK)()||y)if(P)i.logDebugMessage("paste: pasting code in existing empty text block with no selection or new code block after selection  -> pasteRawText"),xn(n,g,i);else if(D){i.logDebugMessage("paste: formulaInformation detected, attempting to paste as formula");const{parentCollection:e,start:t}=D,o=[[g]],r=e;if(!r)return void xn(n,g,i);const a=Ve.default.state;"multiSelection"in a&&tt.pz({environment:n,multiSelection:a.multiSelection,transaction:i});const s=(0,v.UQ)(o,r,D.getRecordModel);tt.mM({environment:n,tokens:s,store:t.store,index:t.index,transaction:i})}else if("plaintext"===I)i.logDebugMessage("paste: plaintext paste behavior detected, pasting as inline html"),dn({environment:n,html:g,transaction:i,stripText:!0,stripSurroundingWhitespace:!0,disableEmbedMenu:r,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:c});else if(h){i.logDebugMessage("paste: multiTextSelectionData detected, attempting to paste as textselection");const e=function(e){const{environment:t,transaction:n,multiTextSelectionData:o,disableEmbedMenu:r,markdownLinkifyIt:i,tinyMceMicrosoftWordPasteFilter:a}=e,s=e.pasteBehavior||"inline",l=e.html||qt({markdown:e.text,markdownLinkifyIt:i});if("editing"===Ve.default.state.mode)switch(s){case"inline":return!!l&&(dn({environment:t,html:l,transaction:n,stripText:!1,stripSurroundingWhitespace:!0,disableEmbedMenu:r,markdownLinkifyIt:i,tinyMceMicrosoftWordPasteFilter:a}),!0);case"block":return rt({environment:t,clipboardData:o,transaction:n,preventLegacyTransclusions:(0,me.hC)()});default:(0,Y.t1)(s)}}({multiTextSelectionData:h,environment:n,html:f,text:g,transaction:i,disableEmbedMenu:r,pasteBehavior:I,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:c});e||(i.logDebugMessage("paste: could not paste as textSelection -> paste as blockSelection"),rn(n,h.blockSelection,w,i))}else if(y&&y.editing){i.logDebugMessage("paste: textSelectionData detected, pasting text selection");const e=(0,J.dI)(),t=(null==w?void 0:w.id)!==(null==e?void 0:e.id);!function(e){const{environment:t,textSelectionData:n,transaction:o,disableEmbedMenu:r,removeDiscussions:i}=e,a=Ue.default.getCurrentRecordCache(),{editing:s,selection:c}=n;let{tokensInsideRange:d}=O.xrQ(s,c.startIndex,c.endIndex);d=O.V3g(d,{removeSuggestionAnnotationsAndText:!1,removeSuggestionAnnotations:!0,removeDiscussions:i??!0});const u=(0,le.RM)();if(u&&!(u.isInsideTemplate()||bn()||u.isInsideFactoryOrDuplicateBlocksAction())&&(d=(0,K.KV)(d,{currentUserId:t.currentUser.id,currentTimeZone:(0,_.r)()})),"body"===(0,Se.qK)()){const e=O.vNd(d);e&&(d=e)}const p="editing"===Ve.default.state.mode&&Ve.default.state.multiSelection;if(p){if(!(0,fe.iG)(p)){const t=(0,fe.QY)(p);if(t){const o=O.KU1(n.editing,n.selection.startIndex,n.selection.endIndex);if(1===o.length){const[n,r]=o[0],i=r&&O.rlz(r);if(i){const o=O.zW$(i);if([n,`http://${n}`,`https://${n}`].includes(o))return void _n({environment:e.environment,text:o,transaction:e.transaction,editingSelection:t})}}}}const i=(0,ye.sQ)(p.start.store),a=i?De.Z.getMode(i):"default";if("suggest"===a){const e=re.oG(t,o,p);re.Sz({environment:t,multiSelection:p,transaction:o,discussionStore:e}),d=O.WO0({textValue:d,selection:{startIndex:0,endIndex:1/0},annotation:[O.GKr.SuggestionInsertText,e.id]})}else"default"===a&&tt.pz({environment:t,multiSelection:p,transaction:o});const s=Ve.default.state;if("editing"===s.mode){const e=s.multiSelection;if(n.blockType&&0===c.startIndex){const r=(0,ye.sQ)(e.start.store);r&&"page"!==n.blockType&&(0,ve.Nm)(r)&&ot.Cj({environment:t,blocks:[r],blockType:n.blockType,transaction:o})}tn({environment:t,store:e.end.store,tokens:d,index:e.end.index,transaction:o,disableEmbedMenu:"suggest"===a||r,multiTextSelection:p})}}else if(a){var m,g;const e=Ue.default.state.stores,n=ut.j4({environment:t,type:l.Ti.text,inMemoryRecordCache:a,transaction:o,spaceId:0!==e.length?e[e.length-1].pointer.spaceId:null===(m=le.RM())||void 0===m?void 0:m.pointer.spaceId,useCrdt:0!==e.length?e[e.length-1].useCrdt():(null===(g=le.RM())||void 0===g?void 0:g.useCrdt())??!1}),r=n.getTitleStore();r&&tt.mM({environment:t,store:r,tokens:d,index:0,transaction:o}),on({environment:t,blocks:[n],transaction:o,replaceEmptyTextBlock:!1}),Le.W(t,{from:"paste",type:l.Ti.text,creating_block_id:n.id,parent_collection_id:n.getParentCollectionIdUpToTwoLevels()})}}({environment:n,textSelectionData:y,transaction:i,disableEmbedMenu:r,removeDiscussions:!d||("copy"===C||t)})}else if(b&&b.blocks.length>0&&"inline"!==I)i.logDebugMessage("paste: blockSelectionData detected, pasting block selection"),rn(n,b,w,i);else if(A&&R){const{simpleTableStore:e,selection:t}=A.getProps(),r=Ce.h4(e);t&&r&&ft.j0({environment:n,simpleTableStore:e,selection:t,currentRows:e.getContentStores(),columnOrder:r,event:o,transaction:i,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:c})}else if(f)if(A){const{simpleTableStore:e,selection:t}=A.getProps(),r=Ce.h4(e);t&&r&&(i.logDebugMessage("paste: pasting selection into simple table"),ft.j0({environment:n,simpleTableStore:e,selection:t,currentRows:e.getContentStores(),columnOrder:r,event:o,transaction:i,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:c}))}else(T||k)&&"inline"!==I?(i.logDebugMessage("paste: pasting as html"),un({environment:n,html:f,transaction:i,tinyMceMicrosoftWordPasteFilter:c})):(i.logDebugMessage("paste: pasting as inline html"),dn({environment:n,html:f,transaction:i,stripText:!1,stripSurroundingWhitespace:!1,disableEmbedMenu:r,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:c}));else i.logDebugMessage("paste: pasting as markdown"),an({environment:n,text:g,disableEmbedMenu:r,transaction:i,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:c});else i.logDebugMessage("paste: editing code block contents with no Notion text selection -> pasteRawText"),xn(n,g,i);Fe.Z.setKeyboardMode(!0)}function xn(e,t,n){const o="editing"===Ve.default.state.mode&&Ve.default.state.multiSelection;if(o){const r=(0,ye.sQ)(o.start.store);tt.hJ({environment:e,editorMode:r?De.Z.getMode(r):"default",multiSelection:o,string:t,disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,transaction:n})}}function In(e){const t=e.getNavigableBlockStore();if(t)return(0,ue.Hu)({store:t,scrollToBlockId:t.id===e.id?void 0:e.id,fullyQualified:!0,pageVisitSource:s.tY.CopyLink})}function Cn(e){const{environment:t,blocks:n}=e,o=n[0];oe.wG(),Ie.MO();const r=In(o);if(r){Rn({environment:t,stringValue:r,copiedMessage:o.isPageBlock()||o.isFormBlock()?kt.copiedLinkToClipboard:kt.copiedBlockLinkToClipboard})}}function Tn(e){const{environment:t,blocks:n}=e,o=n[0];oe.wG(),Ie.MO();const r=In(o),i=function(e,t){var n;const o=In(t);if(!o)return;const r=e.currentUser.id,i=(0,g.Ho)({blockId:t.id,intl:ge.default.getIntl(),getRecordValue:t.inMemoryRecordCache.makeGetRecordValueFn(r),userTimeZone:(0,_.r)()}),a=null===(n=t.getBlockIconStore())||void 0===n?void 0:n.getValue(),s=[(0,x.Z)(a)?a:void 0,i].filter(Y.$K).join(" ");return s?`<a href="${o}"><span>${s}</span></a>`:o}(t,o);if(r&&i){An({environment:t,stringValue:r,htmlValue:i,copiedMessage:kt.copiedLinkToClipboard})}}function Mn(e){const{environment:t,blocks:n}=e;if(n.length<2)return Cn(e);oe.wG(),Ie.MO();const o=n.map(In).filter(Y.$K);if(o.some(Boolean)){const e=o.length>1?kt.copiedLinksToClipboard:kt.copiedLinkToClipboard;Rn({environment:t,stringValue:o.join("\n\n"),copiedMessage:e})}}function Pn(e){const{environment:t,blocks:n}=e,o=n[0];if(!o.isDefined())return;const r=o.getModel(),i=o.getProperties(),a=o.getFormat();let s;if(o.isType(l.Ti.bookmark))s=null==i?void 0:i.link,s=O.QaF(s);else if(r.isType(l.Ok))s=null==i?void 0:i.source,s=O.QaF(s);else if(o.isType(l.Ti.file))s=null==i?void 0:i.source,s=O.QaF(s);else if(o.isType(l.Ti.externalObjectInstance)||o.isType(l.Ti.externalObjectInstancePage))s=(null==a?void 0:a.original_url)||(null==a?void 0:a.uri);else if(o.isType(l.Ti.collectionView)){var c;const e=null===(c=o.getCollectionViewCollectionStore())||void 0===c?void 0:c.getValue();var d;if(e&&(0,f.Gq)(e))s=null===(d=e.format)||void 0===d?void 0:d.original_url}else{if(!o.isType(l.Ti.alias))return;s=null==a?void 0:a.comment_alias_url}if(!s)return;if(h.E$(s,[ie.default.secureFileS3.url,ie.default.secureFileS3V2.url]))return void y.log({level:"error",from:"clipboardActions",type:"copyDirectLinkToContent",error:{message:"Attempted to copy a direct signed url for S3-housed content."}});if(s=Q.yn(s),!s)return;oe.wG(),Ie.MO();Rn({environment:t,stringValue:s,copiedMessage:kt.copiedLinkToClipboard})}function An(e){return Dn(e)}function Rn(e){return Dn(e)}async function Dn(e){const{environment:t,htmlValue:n,stringValue:o,copiedMessage:r,showCopyModal:i}=e;function a(){mt.ZH({environment:t}),Ae.Z.setState({...Ae.Z.state,active:!0,stringValue:o})}if(i)a();else try{var s;if(t.device.isElectron&&null!==(s=X.electronApi)&&void 0!==s&&s.clipboard){const e={text:o};n&&(e.html=n),await X.electronApi.clipboard.write(e)}else if("undefined"==typeof ClipboardItem)await navigator.clipboard.writeText(o);else{const e={"text/plain":new Blob([o],{type:"text/plain"})};n&&(e["text/html"]=new Blob([n],{type:"text/html"}));const t=new ClipboardItem(e);await navigator.clipboard.write([t])}r&&gt.oV({label:ge.default.formatMessage(r)})}catch{a()}}function Bn(){document.queryCommandSupported("copy")&&document.execCommand("copy")}async function En(e,t){let n;n="string"==typeof t?t:JSON.stringify(t),n&&await Rn({environment:e,stringValue:n,copiedMessage:kt.copiedToClipboard})}function Fn(e){const{environment:t,textSelection:n,markdownSerializationOptions:o,markdownLinkifyIt:r}=e,i=(0,fe.QY)(n);if(i&&i.selection.startIndex!==i.selection.endIndex)return function(e){const{environment:t,singleStoreTextSelection:n,markdownSerializationOptions:o}=e,{store:r,selection:i}=n,a=t.currentUser.id,l=r.inMemoryRecordCache,c=ge.default.getIntl(),u=r.getValue(),p=O.KU1(u,i.startIndex,i.endIndex),m=r.getRecordStoreUIRoot().getValue();if(!m)return;const g={id:m.id,table:F.iU,spaceId:m.space_id},f=l.makeGetRecordValueFn(a);return C.CK({textValue:p,exportArgs:{root:g,navigableBlockId:g.id,renderParentBlockId:void 0,blockId:g.id,userTimeZone:(0,_.r)(),intl:c,getRecordValue:f,numberedListCache:{},bulletedListCache:{},getRecordsWithParent:()=>[],getExportedPathToFile:e=>{let{toFileURI:t}=e;return t},getExportedRenderAsset:e=>{let{toFileURI:t}=e;return t},getExportedPathToPage:e=>{let{toPageId:t}=e;return(0,d.Z)({pageId:t,pageValue:f({table:F.iU,id:t}),baseUrl:ie.default.domainBaseUrl,pageVisitSource:s.tY.Export})},baseUrl:ie.default.domainBaseUrl,publicDomainName:ie.default.publicDomainName,transformAnnotation:null==o?void 0:o.transformAnnotation,transformBlockMapping:null==o?void 0:o.transformBlockMapping,resultCache:new Map}})}({environment:t,singleStoreTextSelection:i,markdownSerializationOptions:o});const a=Wt({environment:t,multiSelection:n,action:"copy"});if(!a)return;const l=n.start.store.inMemoryRecordCache,c=n.start.store.getRecordStoreUIRoot().getValue();if(!c)return;const u=t.currentUser.id,{markdown:p}=(0,ce.Ef)({clipboardData:a,rootBlock:{id:c.id,table:F.iU,spaceId:c.space_id},isWindows:t.device.isWindows,fallbackGetRecordValue:l.makeGetRecordValueFn(u),markdownSerializationOptions:o,markdownLinkifyIt:r});return p}function Zn(e){const{environment:t,inMemoryRecordCache:n,text:o,transaction:r,markdownOptions:i,markdownLinkifyIt:s,tinyMceMicrosoftWordPasteFilter:l,useCrdt:c}=e,d=qt({markdown:o,markdownOptions:i,markdownLinkifyIt:s});if(!d)return;const u=document.createElement("div");u.innerHTML=fn({html:d,tinyMceMicrosoftWordPasteFilter:l});const{currentUserStore:p,currentSpaceStore:m}=Pe.default.state;if(!p||!m)return;const g=p.getValue();if(!g)return;const f=(le.RM()??m).id,h=m.id,v=(0,pe.l5)({environment:t,spaceId:h}),y=t.idCreator.getSpaceShortIdCreator(h,v),{allOperations:b,rootContentIds:_}=S.$O({actor:(0,a.dp)(g),parent:{id:f,table:F.iU,spaceId:m.id},rootNode:u,deps:{importFileMap:{},window,secureFileS3Url:ie.default.secureFileS3.url,secureFileS3UrlV2:ie.default.secureFileS3V2.url,intl:ge.default.getIntl(),randomID:W.ZP,spaceIdCreator:y,randomShortID:$.ZP,isPhoneNumber:hn,emojiData:se.Z.state},options:{ignoreBlockCount:!1,useCrdt:c}});for(const a of b)if((0,L.Qf)(a)){const e=new Ze.G(t,a.pointer,{inMemoryRecordCache:n,userId:g.id});vt.applyCrdtTextOperation({store:e,operation:a,invertedOperation:void 0,transaction:r})}else if((0,M.V_)(a)){const e=new Ze.ST({environment:t,pointer:a.pointer,recordStoreOptions:{inMemoryRecordCache:n,userId:g.id}});vt.applyOperation({store:e,operation:a,transaction:r})}else(0,Y.t1)(a);return _.map((e=>new Ze.G(t,{table:F.iU,id:e},{inMemoryRecordCache:n})))}},442274:(e,t,n)=>{n.d(t,{XQ:()=>u,Cn:()=>p,pZ:()=>d,E5:()=>c});const o={TypeScript:async()=>({plugins:[(await n.e(90119).then(n.t.bind(n,728182,23))).default],parser:"babel"}),JavaScript:async()=>({plugins:[(await n.e(90119).then(n.t.bind(n,728182,23))).default],parser:"babel"}),GraphQL:async()=>({plugins:[(await n.e(80214).then(n.t.bind(n,780214,23))).default],parser:"graphql"}),HTML:async()=>({plugins:[(await n.e(72237).then(n.t.bind(n,272237,23))).default],parser:"html"}),CSS:async()=>({plugins:[(await n.e(45657).then(n.t.bind(n,945657,23))).default],parser:"css"}),Scss:async()=>({plugins:[(await n.e(45657).then(n.t.bind(n,945657,23))).default],parser:"scss"}),JSON:async()=>({plugins:[(await n.e(90119).then(n.t.bind(n,728182,23))).default],parser:"json"}),XML:async()=>({plugins:[await Promise.all([n.e(39236),n.e(84219)]).then(n.t.bind(n,784219,23))],parser:"xml",prettierOptionsOverride:{xmlWhitespaceSensitivity:"ignore"}}),Rust:async()=>({plugins:[await Promise.all([n.e(39236),n.e(73411)]).then(n.bind(n,173411))],parser:"jinx-rust"})};var r=n(421838),i=n(496802),a=n(709953),s=n(800993),l=n(210228);function c(e){const{blocks:t,language:n,transaction:o}=e,i=r.TPx(n);for(const r of t)a.sW({store:r.getPropertiesStore(),data:{language:i},transaction:o})}function d(e){const{environment:t,blocks:n,previewFormat:o}=e;l.createAndCommit({userAction:"codeBlockActions.setPersistedCodePreviewFormat",environment:t,perform:e=>{i.FH({stores:n,update:{code_preview_format:o},transaction:e})}})}async function u(e){const{codeSnippet:t,language:r}=e,i=o[r];if(!i)return;const{parser:a,plugins:s,prettierOptionsOverride:l}=await i();let c="";try{c=(await n.e(73945).then(n.t.bind(n,673945,23))).format(t,{parser:a,plugins:s,...l})}finally{if(!c||c===t)return}return c=function(e){const t=e.split("\n");t.length>0&&""===t[t.length-1].trim()&&t.pop();return t.join("\n")}(c),c}async function p(e){const{codeBlockStore:t,environment:n}=e,{title:o,language:i}=t.getProperties(),a=r.QaF(o);if(!a||0===a.length)return;const c=r.QaF(i),d=await u({codeSnippet:a,language:c});if(!d)return;const p=r.TPx(d);l.createAndCommit({userAction:"codeBlockActions.formatCode",environment:n,perform:e=>{s.sO({environment:t.environment,store:t.getBlockTitleStore(),value:p,transaction:e})}})}},774882:(e,t,n)=>{n.d(t,{K:()=>a});var o=n(568626),r=n(606287),i=n(21359);async function a(e){const{environment:t,collectionStore:n}=e,a={id:n.id,table:r.vF,spaceId:n.getSpaceId()},s=await i.suggestRecordKey(t,{...a,shouldSetSuccessfullySuggestedRecord:!0});if("success"===s.type)return s.data.key;o.log({level:"error",from:"collectionAutoIncrementIdActions.suggestRecordKeyResponse",type:"JSONParseError",error:{miscDataString:s.error.message}})}},234993:(e,t,n)=>{n.d(t,{mO:()=>x,Ys:()=>I,k7:()=>C,ul:()=>A,iU:()=>T,_7:()=>R,RD:()=>P,_x:()=>M});n(667294);var o=n(701302),r=n(576205),i=n(114714),a=n(653965),s=n(401898),l=n(164964),c=n(710274),d=n(800480),u=n(709291),p=n(452423),m=n(606854),g=n(785893);function f(){return(0,g.jsx)(u.FormattedMessage,{defaultMessage:"Changes saved for everyone.",id:"database.filterBar.saved.title"})}function h(e){const{collectionContextStore:t,temporaryState:n}=e,o=(0,d.O7)();return(0,g.jsx)(m.Pn,{onClick:()=>{p.Yw(o,!0),l.rN(),T({environment:o,collectionContextStore:t,temporaryState:n})},children:(0,g.jsx)(u.FormattedMessage,{defaultMessage:"Undo",id:"database.filterBar.undo.title"})})}var v=n(397004),y=n(798165),b=n(80444),_=n(616241),S=n(805149),k=n(210228),w=n(237181);let x=function(e){return e[e.All=0]="All",e[e.Filters=1]="Filters",e[e.Sorts=2]="Sorts",e}({});function I(e){const{environment:t,collectionContextStore:n,targetCollectionViewStore:o,preventSnackbarNotification:r,type:i,transaction:a}=e,s=n.temporaryStateStore.state,d=n.currentPropertyFiltersStore.state,u=o.getPropertyFiltersStore(),p=(0,v.Zh)(n,"persisted");if(i===x.All||i===x.Filters){p.combinatorFilter&&c.Es({collectionViewStore:o,update:{filter:p.combinatorFilter.value||null},transaction:a});for(const e of p.filters.removed)k.applyOperation({store:u,operation:{pointer:u.pointer,command:"keyedObjectListRemove",path:u.path,args:{remove:{id:e}}},transaction:a});for(const{id:e,beforeId:t}of p.filters.moveOps){const n=d.find((t=>t.id===e));n&&(t?k.applyOperation({store:u,operation:{pointer:u.pointer,command:"keyedObjectListBefore",path:u.path,args:{before:{id:t},value:n}},transaction:a}):k.applyOperation({store:u,operation:{pointer:u.pointer,command:"keyedObjectListAfter",path:u.path,args:{value:n}},transaction:a}))}for(const e of p.filters.updated){const t=d.find((t=>t.id===e));t&&k.applyOperation({store:u,operation:{pointer:u.pointer,command:"keyedObjectListUpdate",path:u.path,args:{value:t}},transaction:a})}}i!==x.All&&i!==x.Sorts||!p.sorts||c.Es({collectionViewStore:o,update:{sort:p.sorts.value||null},transaction:a}),M({environment:t,collectionContextStore:n,temporaryState:i===x.All?void 0:i===x.Filters?{...s,combinatorFilter:void 0,propertyFilters:void 0}:{...s,sorts:void 0}}),r||l.oV({label:(0,g.jsx)(f,{}),right:(0,g.jsx)(h,{collectionContextStore:n,temporaryState:s})})}function C(e){const{environment:t,intl:n,collectionContextStore:r,transaction:i}=e,a=r.collectionViewStore(),s=r.isFullScreenStore.state,l=r.isRootChildStore.state,d=r.isInPeekRendererStore.state;if(!a)return;const u=r.collectionViewBlockStore(),p=c.tG({environment:t,collectionViewBlockStore:u,collectionViewStore:a,intl:n,transaction:i});p&&(I({environment:t,type:x.All,collectionContextStore:r,targetCollectionViewStore:p,transaction:i}),p&&("chart"===p.getType()&&_.Q({environment:t,collectionContextStore:r,collectionViewId:p.id,from:"filter_save_as_new_view"}),c.f8({environment:t,collectionContextStore:r,collectionViewId:p.id,isFullScreen:s,isRootChild:l,isInPeekRenderer:d}),o.default.afterNextFlush((()=>{S.r$({collectionContextStore:r,collectionSettingsStore:r.settingsStore,selectViewNameInitial:!0})}))))}function T(e){M(e),function(e){const{environment:t,collectionContextStore:n}=e,o=n.collectionViewStore(),r=n.collectionViewBlockStore();if(!o||!r)return;(n.isUnlistedViewStore.state&&n.isInlineViewStore.state||(0,y.RC)({environment:t,store:r})&&n.permissionScopesStore.state.canConfigureBlock)&&k.createAndCommit({userAction:"collectionFilterActions.applyTemporaryStateIfPrivate",environment:t,perform:e=>{I({environment:t,collectionContextStore:n,type:x.All,targetCollectionViewStore:o,preventSnackbarNotification:!0,transaction:e})}})}(e)}function M(e){const{environment:t,collectionContextStore:n,temporaryState:o}=e,r=n.collectionViewStore();if(!r)return;const i=t.currentUser.id;n.temporaryStateStore.setState(o||{}),c.bu({currentUserId:i,collectionViewId:r.id,collectionViewModuleCurrentPageId:n.collectionViewModuleContextStore.currentPageInRelatedCollectionId(),temporaryState:o}),n.groupsStore.resetAllLimits()}function P(e){const{environment:t,seen:n}=e,{currentUserSettingsStore:o}=b.default.state;o&&k.createAndCommit({userAction:"collectionFilterActions.setSeenFiltersIntroTooltip",environment:t,perform:e=>{w.d2({userSettingsStore:o,transaction:e,data:{seen_filters_tooltip:n}})}})}function A(e){var t;let{transaction:n,newGroups:o,collectionContextStore:l,environment:c}=e;const d=l.collectionViewStore(),u=l.currentCombinatorFilterStore.state,p=(0,a.Xh)(u),m=null==p||null===(t=p.filters)||void 0===t?void 0:t.find(r.s9),g=(0,v.yU)(l);if(!(d&&p&&p.filters&&m))return;const f=m.filter.value.filter((e=>"exact"===e.type)).map((e=>e.value)).filter(s.$K),h=o.map((e=>e.value)).filter(i.tL).map((e=>e.value)).filter(i.RA).map((e=>e.id)),y=(0,a.zu)(h,...f);0!==y.length&&(m.filter.value=[...m.filter.value,...y.map((e=>({type:"exact",value:e})))],M({environment:c,collectionContextStore:l,temporaryState:{...l.temporaryStateStore.state,combinatorFilter:{value:p}}}),g||I({environment:c,collectionContextStore:l,type:x.Filters,targetCollectionViewStore:d,preventSnackbarNotification:!0,transaction:n}))}function R(e){var t;const n=null===(t=e.collectionViewStore())||void 0===t?void 0:t.id,o=e.getCurrentUserId();n&&o&&(c.E7({userId:o,collectionViewId:n,isOpen:!1}),e.filtersBarOpenStore.setState(!1))}},554569:(e,t,n)=>{n.d(t,{$D:()=>Te,$T:()=>ue,A6:()=>_e,Ab:()=>ge,BN:()=>ce,ID:()=>Be,IW:()=>be,Od:()=>de,V$:()=>Pe,Zv:()=>Ze,by:()=>fe,hz:()=>Se,iE:()=>ke,mp:()=>pe,o3:()=>Ce,qn:()=>Fe,tH:()=>De,tQ:()=>ve,uo:()=>Ae,w$:()=>Re,yk:()=>we});n(757658);var o=n(815145),r=n(371663),i=n(541432),a=n(514248),s=n(668497),l=n(114714),c=n(399036),d=n(293824),u=n(643593),p=n(842875),m=n(915157),g=n(421202),f=n(606287),h=n(23867),v=n(542297),y=n(421838),b=n(95371),_=n(709291),S=n(653965),k=n(401898),w=n(710274),x=n(110906),I=n(521100),C=n(27105),T=n(721429),M=n(397004),P=n(368585),A=n(892918),R=n(708661),D=n(277181),B=n(292283),E=n(433929),F=n(318245),Z=n(80444),U=n(990827),V=n(155367),N=n(385555),O=n(206258),L=n(108406),j=n(100952),K=n(21359),z=n(234993),q=n(498834),H=n(730188),G=n(547307),W=n(42239),$=n(631781),Y=n(496802),Q=n(594419),J=n(119785),X=n(709953),ee=n(879978),te=n(926999),ne=n(311712),oe=n(524677),re=n(164964),ie=n(210228),ae=n(227370),se=n(237181);const le=(0,_.defineMessages)({removeSortingConfirmation:{id:"databaseActions.removeSortingConfirmationDialog.prompt",defaultMessage:"Would you like to remove sorting?"},removeSortingButton:{id:"databaseActions.removeSortingConfirmationDialog.removeSortingButton.label",defaultMessage:"Remove"},removeSortingCancel:{id:"databaseActions.removeSortingConfirmationDialog.cancelRemoveSortingButton.label",defaultMessage:"Don't remove"},removeGroupSortingConfirmation:{id:"databaseActions.remoteGroupSortingConfirmationDialog.prompt",defaultMessage:"Would you like to remove {sortType} group sorting?"},removeGroupSortingButton:{id:"databaseActions.removeGroupSortingConfirmationDialog.removeButton.label",defaultMessage:"Remove"},removeGroupSortingCancel:{id:"databaseActions.removeGroupSortingConfirmationDialog.cancelButton.label",defaultMessage:"Don't remove"}});function ce(e){const{store:t,groupsPointer:n,environment:o,collectionContextStore:r,transaction:i}=e;if(!t.isDefined())return;const s=r.normalizedSchemaStore.state,l=r.relativeVariableStore.state,c=r.collectionViewModuleContextStore.currentPageInRelatedCollectionId(),d=new Map;for(const u of n){const e=a.ND({block:t.getModel(),schema:s,propertyMapping:void 0,userFilterContext:{userId:o.currentUser.id,userTimeZone:(0,p.r)(),userStartOfWeek:T.AK.state},group:u,getRecordModel:t.getRecordModel,intl:E.default.getIntl(),relativeVariableResult:l,currentPageInRelatedCollection:c,resultCache:d});Ee({environment:o,blockStore:t,properties:e,transaction:i})}}function de(e){const{store:t,transaction:n}=e;J.hh({childStore:t,transaction:n})}function ue(e){var t,n;const{environment:o,collectionContextStore:r,before:i,insertStores:a,store:s,groupsPointer:l,transaction:c}=e,d=r.collectionViewStore(),u=(null===(t=r.groupsStore.getGroupState(l))||void 0===t?void 0:t.resultsStore.state)||[],p=null===(n=r.groupsStore.getGroupState(l))||void 0===n?void 0:n.groupUiParentStore;if(!p)return[];const m=[];for(const y of a){const t=e.collectionStore??y.getAssociatedCollectionStore();t&&(pe({environment:o,store:y,collectionStore:t,collectionContextStore:r,groupsPointer:l,shouldCoerce:!0,transaction:c}),m.push(O.G.createChildStore(p,{table:g.iU,id:y.id})))}const f=u.indexOf(s),h=i?f:f+1,v=[...u.slice(0,h),...m,...u.slice(h)];return d&&me({resultIds:v.map((e=>e.id)),collectionViewStore:d,collectionContextStore:r,transaction:c}),r.groupsStore.setLimitIfGreater(l,v.length),m}function pe(e){var t;const{environment:n,store:o,collectionStore:r,collectionContextStore:s,groupsPointer:l,transaction:c,shouldCoerce:d,alreadyMovedToCollection:u}=e,m=r.getSchema(),g=r.getParentBlockStore(),f=g&&g.isNonEditableState();let h=!d;const y=(null==s||null===(t=s.groupsStore.getGroupState(l))||void 0===t?void 0:t.resultsStore.state)||[];if(o.isDefined()){var b,_;const e=u?(0,v.Kc)(E.default.getIntl()):o.getSchema()||{},t=null===(b=o.getAssociatedCollectionStore())||void 0===b?void 0:b.getDatabaseType(),i=r.getDatabaseType(),s=void 0!==t&&t===i,l=a.Xq({blockProperties:o.getProperties(),oldSchema:e,oldPropertyMapping:null===(_=o.getAssociatedCollectionStore())||void 0===_?void 0:_.getPropertyMapping(),newPropertyMapping:r.getPropertyMapping(),newSchema:m,typesMatch:s});l.propertyUpdate&&Ee({environment:n,blockStore:o,properties:l.propertyUpdate,transaction:c}),S.Xy(m,l.newSchema)||f||!x.eD({collectionStore:r,collectionViewBlockStore:g,checkNavigableAncestorLocked:!1})||w.Rm({environment:n,collectionStore:r,update:{schema:l.newSchema},transaction:c})}if(o.getType()===i.Ti.page||o.getType()===i.Ti.collectionViewPage&&o.isAssociatedCollectionAPageTree()||r.isPageTreeCollection()||o.getType()===i.Ti.copyIndicator||o.getType()===i.Ti.externalObjectInstancePage||X.sW({store:o,data:{type:i.Ti.page},transaction:c}),s){if(s.collectionViewStore()){const e=o.getModel(),t=s.relativeVariableStore.state,i=s.collectionViewModuleContextStore.currentPageInRelatedCollectionId(),u=(0,M.ze)(s,!1);if(e&&d){const d=o.getAssociatedCollectionStore()??r,m="collectionTypedView"===s.contextType&&d?d.getSchema():s.normalizedSchemaStore.state,g=a.RA({block:e,schema:m,propertyMapping:r.getPropertyMapping(),filter:u,userFilterContext:{userId:n.currentUser.id,userTimeZone:(0,p.r)(),userStartOfWeek:T.AK.state},relativeVariableResult:t,currentPageInRelatedCollection:i,groupsPointer:l,getRecordModel:r.getRecordModel,intl:E.default.getIntl(),resultCache:new Map});Ee({environment:n,blockStore:o,properties:g.update,transaction:c}),h=g.coercionSucceeded}}}const k="collectionTypedView"===(null==s?void 0:s.contextType)&&x.fm(o)===s;if(u||k?ie.applyOperation({store:o,operation:{pointer:o.pointer,path:["alive"],command:"set",args:!0},transaction:c}):J.zw({childStore:o,parentStore:r,transaction:c}),s&&s.resultSetStore.addLocalChange([o.id]),s){var I;const e=null===(I=s.groupsStore.getGroupState(l))||void 0===I?void 0:I.currentLimit;if(e){const t=e.state,n=y.find((e=>e.id===o.id));y.length>=t&&!n&&e.setState(y.length+1)}}return h}function me(e){const{resultIds:t,collectionViewStore:n,collectionContextStore:o,transaction:r}=e,i=n.getPageSortStore(),a=i.getValue()||[],{beforeOps:s}=(0,d.q)(a,t.slice(0,c.gq));for(const[l,c]of Object.entries(s))if(c){const e=(0,O.Kv)(n,{table:g.iU,id:c});Q.Vt({parentStore:i,insertStore:(0,O.Kv)(n,{table:g.iU,id:l}),beforeStore:e,transaction:r})}else{const e=t.findIndex((e=>e===l)),o=t[e-1],a=o?(0,O.Kv)(n,{table:g.iU,id:o}):void 0;Q.BE({parentStore:i,insertStore:(0,O.Kv)(n,{table:g.iU,id:l}),afterStore:a,transaction:r})}!function(e){const{collectionContextStore:t,collectionViewStore:n,transaction:o}=e,r=n.getPageSortStore(),i=r.getValue(),a=t.groupsStore.getAllGroupStates(),s=new Set(a.flatMap((e=>e.resultsStore.state.map((e=>e.id))))),l=function(e){const{pageSort:t,currentResults:n}=e;if(!t||t.length<=c.gq)return[];const o=t.filter((e=>!n.has(e))),r=S.jj([...o.reverse(),...S.d9(t).reverse()]).slice(0,t.length-c.gq);return r}({pageSort:i,currentResults:s});for(const c of l)Q.Od({parentStore:r,childToRemoveStore:(0,O.Kv)(r,{table:g.iU,id:c}),transaction:o})}({collectionContextStore:o,collectionViewStore:n,transaction:r})}function ge(e){const{environment:t,collectionStore:n,duplicate:o,droppedStores:r,transaction:i,duplicateUseCrdt:a}=e,{movedStores:s,reparentedStores:l}=r.reduce(((e,t)=>(o||t.getAssociatedCollectionId()!==(null==n?void 0:n.id)?e.reparentedStores.push(t):e.movedStores.push(t),e)),{movedStores:[],reparentedStores:[]});return[...s,...W.LQ({environment:t,droppedStores:l,duplicate:o,duplicateUseCrdt:a,transaction:i,resolveTemplateVariables:!1})]}function fe(e){var t,n,o,i;const{environment:a,collectionStore:s,targetStore:l,droppedDirection:d,droppedStores:u,transaction:p,duplicate:m,collectionContextStore:h,groupsPointer:v,subitemPath:y}=e;if(!h.permissionScopesStore.state.canEditContent)return;if(u.some((e=>(0,U.xR)(e.id))))return;if(u.some((e=>{const t=e.getDiscussionStores();for(const n of t)if(n.isSuggestionDiscussion())return!0})))return;if(e.collapsedGroup&&function(e){var t;const{environment:n,droppedStores:o,duplicate:r,collectionContextStore:i,groupsPointer:a,transaction:s}=e,l=i.collectionStore(),c=i.collectionViewStore(),d=null===(t=o[0])||void 0===t?void 0:t.getAssociatedCollectionStore(),u=d&&d.id===(null==l?void 0:l.id),p=i.hasSingleCollection()&&r,m=ge({environment:n,droppedStores:o,duplicate:p,duplicateUseCrdt:"same_as_store",transaction:s,collectionStore:l});for(const g of m){const e=l??g.getAssociatedCollectionStore();e&&pe({environment:n,store:g,collectionStore:e,collectionContextStore:i,groupsPointer:a,shouldCoerce:!0,transaction:s})}c&&me({resultIds:m.map((e=>e.id)),collectionViewStore:c,collectionContextStore:i,transaction:s});s.postSubmitCallbacks.push((async e=>{!e&&l&&(N.default.checkGate({gateName:"subitems_drag_drop_improvements"})&&u||await H.YE({droppedStores:o,createdStores:m,collectionStore:l,environment:n,collectionContextStore:i,groupsPointer:a,shouldDuplicate:r}))}))}({environment:a,collectionContextStore:h,groupsPointer:v,droppedStores:u,duplicate:m,transaction:p}),!l)return;const _=h.collectionViewStore();if(!_)return;const k=null===(t=u[0])||void 0===t?void 0:t.getAssociatedCollectionStore(),w=k&&k.id===(null==s?void 0:s.id),x=null===(n=h.groupsStore.getGroupState(v))||void 0===n?void 0:n.groupUiParentStore;if(!x)return;const I=he({groupsPointer:v,collectionContextStore:h,blocks:u}),T=(null===(o=h.groupsStore.getGroupState(v))||void 0===o?void 0:o.resultsStore.state)||[],M=u.every((e=>e.isExternalObjectInstancePageBlockStore()))&&!(null!=s&&s.isSyncedCollection()&&(null===(i=u[0])||void 0===i?void 0:i.getParentId())===(null==s?void 0:s.id)),P=h.hasSingleCollection()&&(M||m);if(d===V.vh.Onto){if(oe.ZH({environment:a}),!P&&(0,C.iG)(l,u))return void re.oV({label:(0,C.s8)(l)});const e=l.getContentStore(),t=ge({environment:a,droppedStores:u,duplicate:P,duplicateUseCrdt:l.useCrdt(),transaction:p,collectionStore:s});for(const n of t)Q.R3({parentStore:e,appendStore:n,transaction:p});return[]}let A=!1,R=[];if(!P&&s){const e=function(e){const{environment:t,droppedStores:n,collectionStore:o,transaction:r}=e;if(!n.length)return;const i=Ce({environment:t,stores:n,spaceId:o.getSpaceId(),transaction:r});for(const a of i){if(a.getParentTable()===f.vF||a.getAssociatedCollectionStore())return;if(!J.zw({childStore:a,parentStore:o,transaction:r}))return}return i}({environment:a,droppedStores:u,collectionStore:s,transaction:p});A=void 0!==e,R=e??[]}const E=(0,D.Af)([...(null==y?void 0:y.map((e=>e.value.store.pointer)))??[]]),F=h.subitemExpandedStore.state.get(E),L=y&&y.length>1||(null==F?void 0:F.isExpanded)&&d===V.vh.Below,j=h.groupsStore.getAllGroupStates();u.forEach((e=>{const t=j.find((t=>t.resultsStore.state.includes(e)));t&&!L&&ce({environment:a,store:e,collectionContextStore:h,groupsPointer:t.groupsPointer,transaction:p})}));const K=ge({environment:a,droppedStores:u,duplicate:P,duplicateUseCrdt:"same_as_store",transaction:p,collectionStore:s});A||(R=Ce({environment:a,stores:K,spaceId:l.getSpaceId(),transaction:p})),p.postSubmitCallbacks.push((async e=>{!e&&s&&(N.default.checkGate({gateName:"subitems_drag_drop_improvements"})&&w||await H.YE({droppedStores:u,createdStores:K,collectionStore:s,environment:a,collectionContextStore:h,groupsPointer:v,alreadyMovedToCollection:A,shouldDuplicate:P}))}));const z=he({groupsPointer:v,collectionContextStore:h,blocks:K});for(const r of R){const e=s??r.getAssociatedCollectionStore();e&&pe({environment:a,store:r,collectionStore:e,collectionContextStore:h,groupsPointer:Boolean(L)?[]:v,shouldCoerce:!0,transaction:p,alreadyMovedToCollection:A})}s&&function(e){var t,n,o;const{environment:r,isInsertingAsSubitem:i,shouldDuplicate:a,collectionContextStore:s,collectionStore:l,droppedStores:d,wrappedStores:u,targetSubitemExpandedState:p,subitemPath:m,targetStore:g,transaction:f}=e,h=s.currentSubitemFormatStoreForCollectionStore.state,v=null==h?void 0:h.inverse,y=v&&s.normalizedSchemaStore.state[v],_=null==h?void 0:h.property,S=_&&s.normalizedSchemaStore.state[_],k=null===(t=s.collectionViewStore())||void 0===t?void 0:t.getType(),w=null===(n=s.collectionViewStore())||void 0===n?void 0:n.getFormat();if(null!==(o=s.collectionViewStore())&&void 0!==o&&null!==(o=o.getCollectionStore())&&void 0!==o&&o.isExternallyImportedAndSyncedCollection()&&(0,B.K6)())return;const x=(null==w?void 0:w.subitem_display_mode)??"show",I=h&&k&&(0,D.Av)(k)&&y&&(0,c.p_)(y)&&"flattened"!==x,C=(0,D.g0)(d[0]);null!=C&&C.subitemFormat&&h&&S&&(0,c.p_)(S)&&H.i6({blocksToDuplicate:[...d],duplicatedBlocks:[...u],environment:r,shouldDuplicate:a,originSubitemFormat:C.subitemFormat,destinationSubitemFormat:h,transaction:f,subitemRelationSchema:S,relationPropertyCollectionId:l.id});const T=h?(0,D.Kg)(u,h):void 0,M=T?u.filter(((e,t)=>T.includes(t))):[];for(const c of M){if(I){const e=(0,D.xb)({store:c,subitemFormat:h,propertySchema:y});for(const t of e){const e=O.G.createChildStore(c,t);ee.Bl({environment:r,sourceStore:e,destStore:c,propertyWithInverse:h,transaction:f})}}if(i){const e=null!=p&&p.isExpanded?"into":"below";xe({environment:r,collectionContextStore:s,collectionStore:l,subitemPath:m&&(null==m?void 0:m.length)>0?m:[new b.mp((0,D.SM)(g),[])],store:g,before:"into"===e,insertBlockStore:c,insertDirection:e,transaction:f})}}}({environment:a,isInsertingAsSubitem:Boolean(L),shouldDuplicate:P,collectionContextStore:h,collectionStore:s,droppedStores:u,wrappedStores:R,targetSubitemExpandedState:F,subitemPath:y,targetStore:l,transaction:p});const q=T.filter((e=>!K.includes(e))),G=q.indexOf(l),W=d===V.vh.Above||d===V.vh.Left?G:G+1;me({resultIds:[...q.slice(0,W),...R,...q.slice(W)].map((e=>e.id)),collectionViewStore:_,collectionContextStore:h,transaction:p});const $=S.Xy(I.sort(),z.sort());N.default.checkGate({gateName:"intelligent_collections_sort_modal"})?w&&$&&ye({environment:a,collectionContextStore:h}):ye({environment:a,collectionContextStore:h});if(!h.collectionViewBlockStore())return;const Y=L?l:x,X=S.UI(R,(e=>O.G.createChildStore(Y,{table:g.iU,id:e.id})));return oe.Z5({environment:a,stores:X}),function(e,t){var n,o;const i=(null===(n=e.collectionViewStore())||void 0===n?void 0:n.getFormat().app_config_uri)===r.g3&&"sprint_board"===(null===(o=Z.default.state.mainEditorCurrentBlockStore)||void 0===o?void 0:o.getFormat().special_page_for_pm_launch);i&&ae.tutorialAdvanceToStepAfter(t,"sprints-onboarding","sprint-task-tooltip")}(h,p),X}function he(e){const{groupsPointer:t,collectionContextStore:n,blocks:o}=e,r=[];return t.map((e=>{var t,i;const a=null==n||null===(t=n.collectionStore())||void 0===t?void 0:t.getSchema()[e.property],l=null==n||null===(i=n.collectionStore())||void 0===i?void 0:i.getSchema(),c=new Map,d=o.flatMap((t=>{const n=t.getModel();if(a&&l&&n)return(0,s.L)({property:e.property,schema:l,block:n,getRecordModel:t.getRecordModel,collectionRequestContext:{userId:void 0,userTimeZone:(0,p.r)(),depth:0,intl:E.default.getIntl(),visitedProperties:new Set,resultCache:c},exportedFilePaths:!1})})).filter((e=>!S.o8(e)));r.push(...d)})),S.sv(r,S.Xy)}function ve(e){const{environment:t,collectionStore:n,targetStore:o,droppedDirection:r,files:i,transaction:a,collectionContextStore:s,groupsPointer:l}=e,c=s.collectionViewStore(),d=T.qQ(t);if(!c)return;const p=n.inMemoryRecordCache,m=$.z({environment:t,files:i,inMemoryRecordCache:p,pageWidth:d,transaction:a,spaceId:n.pointer.spaceId,useCrdt:C.dy({source:"collection_unknown_view"})}).map(((e,o)=>{const r=i[o],s=X.j4({environment:t,type:"page",inMemoryRecordCache:p,properties:{title:(0,y.TPx)(u.AA(r.name))},transaction:a,spaceId:n.pointer.spaceId,useCrdt:e.useCrdt()});return Q.R3({parentStore:s.getContentStore(),appendStore:e,transaction:a}),s}));fe({environment:t,collectionStore:n,targetStore:o,droppedDirection:r,collectionContextStore:s,groupsPointer:l,droppedStores:m,duplicate:!1,transaction:a,collapsedGroup:!1})}function ye(e){const{environment:t,collectionContextStore:n}=e,o=n.collectionViewBlockStore(),r=n.collectionViewStore();if(!r||!o)return!1;const i=n.currentViewHasSort(),a=(0,M.Mj)(n),s=i||a,l=r.getType(),c=n.permissionScopesStore.state;return!!(s&&l&&R.Km[l]&&c.canConfigureBlock)&&(G.showDialog({message:E.default.formatMessage(le.removeSortingConfirmation),items:[{label:E.default.formatMessage(le.removeSortingButton),color:"red",onAccept:()=>{ie.createAndCommit({userAction:"collectionGroupActions.offerToRemoveSort",environment:t,perform:e=>{w.Es({collectionViewStore:r,update:{sort:[]},transaction:e})}});const e=n.temporaryStateStore.state;n.temporaryStateStore.setState({...e,sorts:void 0})}},{label:E.default.formatMessage(le.removeSortingCancel),onAccept:()=>{}}],showCancel:!1,keepFocus:!0}),!0)}function be(e){var t,n,o;const{environment:r,collectionContextStore:a,groupsPointer:s,insertAtIndex:l,shouldCoerce:c,initializeDefaultTemplate:d,transaction:u,from:p,tracker:m,useCrdt:f}=e,h=F.default.DO_NOT_USE_markLegacy("collections.add_item_lag");F.default.DO_NOT_USE_measureAfterNextFlushLegacy(h,{environment:r,getData:()=>({...P.vS(a),from:p})});const v="collectionTypedView"===a.contextType,y=a.databaseType,b=a.collectionStoresStore.state,_=b.find((e=>e.canEdit()||e.canEditCollection()||e.canEditContentOnly()))||b[0];!v&&_&&se.zq({transaction:u,dbType:y,collectionId:_.id});const S=null===(t=Z.default.state.currentSpaceStore)||void 0===t?void 0:t.id,k=Z.default.state.currentUserSettingsStore,w=v&&y&&S&&k&&[...k.getAllPreferredCollections(S),...k.getPreferredCollectionsOfType(S,y)]||[];let x;const I=s[0];if("group_header"===p&&"location"===I.value.type){const e=I.value.value;if(e){x=b.find((t=>t.id===e.id&&(t.canEdit()||t.canEditCollection()||t.canEditContentOnly())))}}else x=function(e,t){for(const n of e){const e=t.find((e=>e.id===n&&(e.canEdit()||e.canEditCollection()||e.canEditContentOnly())));if(e)return e}}(w,b);const C=x??_,T=a.collectionViewStore(),M=a.getViewType(),A=C.getParentBlockStore(),R=X.j4({environment:r,type:i.Ti.page,inMemoryRecordCache:r.defaultRecordCache.inMemoryRecordCache,transaction:u,spaceId:S,tracker:m,useCrdt:A&&A.isCollectionViewPageWithContent()?A.useCrdt():Boolean(f)});if(!C||!T||!M)return{coercionSucceeded:!0,newStore:R};const D=null===(n=a.groupsStore.getGroupState(s))||void 0===n?void 0:n.groupUiParentStore;if(!D)return{coercionSucceeded:!0,newStore:R};const B=O.G.createChildStore(D,{table:g.iU,id:R.id});if(d){const e=a.defaultPageTemplateStore.state;e&&q.ob({title:"template",environment:r,store:R,templateStore:e,isKeyboard:!1,isCreateIn:!1,transaction:u,from:"collection_group_actions"})}const E=pe({environment:r,store:R,collectionStore:C,collectionContextStore:a,groupsPointer:s,shouldCoerce:c,transaction:u}),U=(null===(o=a.groupsStore.getGroupState(s))||void 0===o||null===(o=o.reducerResultStore.state)||void 0===o?void 0:o.blockIds)||[],V=void 0!==l?l:U.length;if(a.permissionScopesStore.state.canEditContent||v){me({resultIds:[...U.slice(0,V),B.id,...U.slice(V)],collectionViewStore:T,collectionContextStore:a,transaction:u})}return{coercionSucceeded:E,newStore:B}}function _e(e){const{collectionContextStore:t,newGroups:n,groupsFormatKey:o,transaction:r}=e,i=t.collectionViewStore();i&&Y.FH({stores:[i],update:{[o]:n},transaction:r})}function Se(e){const{environment:t,collectionStore:n,property:o,oldValue:r,newValue:i,preventPublishAppEventsForBlockUpdates:s,transaction:l}=e,c=n.getSchema(),d=t.currentUser.id;s||n.inMemoryRecordCache.forEachRecord(d,(e=>{var s;let{model:d}=e;if(d.table!==g.iU)return;const u=O.G.createChildStore(n,{table:g.iU,id:d.id});if(u.canEdit()&&(null===(s=u.getAssociatedCollectionStore())||void 0===s?void 0:s.id)===n.id){const e=a.hz({block:d,schema:c,property:o,oldValue:r,newValue:i});Ee({environment:t,blockStore:u,properties:e,transaction:l})}})),n.isDefaultRecordCache()&&l.postSubmitCallbacks.push((async e=>{const a=n.pointer,{value:s}=await K.renameGroup(t,{collection:{id:a.id,spaceId:(0,h.C)(a.spaceId)},property:o,oldValue:r,newValue:i}).next();if(s.error)throw s.error}))}function ke(e){const{environment:t,collectionStore:n,groupsFormatKey:o,property:r,groupFormat:i,currentGroups:s,collectionContextStore:d,transaction:u,intl:m}=e,f=n.getSchema(),v=f[i.property];_e({collectionContextStore:d,newGroups:s.filter((e=>!(0,l.we)(i.value,e.value))),groupsFormatKey:o,transaction:u});const y=i.value;if(v&&(0,c.cu)(v)&&y.type===v.type&&n){const e=(v.options||[]).filter((e=>e.value!==y.value)),o={...v,options:e},r={...f,[i.property]:o};w.Rm({environment:t,collectionStore:n,update:{schema:r},transaction:u})}const b=t.currentUser.id,_=new Map;n.inMemoryRecordCache.forEachRecord(b,(async e=>{let{model:o}=e;if(o.table!==g.iU)return;const i=O.G.createChildStore(n,o.pointer);if(a.wg({block:o,schema:f,property:r,value:y,intl:m,timeZone:(0,p.r)(),getRecordModel:n.getRecordModel,resultCache:_}))if(o.parent_id===n.id)J.hh({childStore:i,transaction:u});else{const e=i.getAssociatedCollectionStore();e&&e.id===n.id&&("page"===i.getType()||"collection_view_page"===i.getType()&&!i.isCollectionViewPageWithContent())&&await ne.Qw({environment:t,blocks:[i],shouldCheckSuggestEdit:!0})}})),n.isDefaultRecordCache()&&u.postSubmitCallbacks.push((async e=>{const o=await K.deleteGroup(t,{collection:{id:n.id,spaceId:(0,h.C)(n.pointer.spaceId)},property:r,value:y}).next();if(o.value.error)throw o.value.error}))}function we(e){var t;const{environment:n,collectionContextStore:r,before:a,store:s,groupsPointer:l,collectionStore:c,transaction:d,subitemPath:u,subitemInsertDirection:p,from:m,event:f}=e,h=r.collectionViewStore();if(!h)return;const v=r.groupsStore.getGroupState(l),y=null==v?void 0:v.groupUiParentStore,b=(null==v?void 0:v.resultsStore.state)||[];if(!y)return;const _=X.j4({environment:n,type:i.Ti.page,inMemoryRecordCache:s.inMemoryRecordCache,transaction:d,spaceId:h.pointer.spaceId,useCrdt:(0,C.SL)({event:f,source:"collection_unknown_view",contextualDefault:null===(t=r.defaultPageTemplateStore.state)||void 0===t?void 0:t.useCrdt()})});if(m){const e="collectionTypedView"===r.contextType?_.getAssociatedCollectionId():void 0;j.W(n,{from:m,type:"page",new_page_id:_.id,creating_block_id:_.id,...P.Pn(r,e)})}const S=pe({environment:n,store:_,collectionStore:c,collectionContextStore:r,groupsPointer:l,shouldCoerce:!0,transaction:d}),k=r.defaultPageTemplateStore.state;k&&q.ob({title:"template",environment:n,store:_,templateStore:k,isKeyboard:!1,isCreateIn:!1,transaction:d,from:"collection_group_actions"});const w=O.G.createChildStore(y,{table:g.iU,id:_.id});u&&u.length>0&&xe({environment:n,collectionContextStore:r,subitemPath:u,collectionStore:c,store:s,before:!1,insertBlockStore:w,insertDirection:p,transaction:d});const I=b.indexOf(s),T=a?I:I+1;if(me({resultIds:[...b.slice(0,T),w,...b.slice(T)].map((e=>e.id)),collectionViewStore:h,collectionContextStore:r,transaction:d}),S){if(u){var M;const e="into"===p?s:null===(M=u[u.length-2])||void 0===M?void 0:M.value.store;return e?O.G.createChildStore(e,w.pointer):w}return oe.Ys({environment:n,store:w}),ye({environment:n,collectionContextStore:r}),w}te.CH({environment:n,store:w,peekMode:x.kr(r),resultsStore:null==v?void 0:v.resultsStore,collectionContextStore:r,pageVisitSource:o.tY.Create})}function xe(e){const{environment:t,collectionContextStore:n,subitemPath:o,collectionStore:r,store:i,before:a,insertBlockStore:s,insertDirection:l,transaction:c}=e,d=n.currentSubitemFormatStoreForCollectionStore.state;if(!d)return;const u=r.getSchema()[d.property];if(!u||"relation"!==u.type)return;if("into"===l){var p;const e=o[o.length-1],n=e.value.store;return void ee.hE({environment:t,sourceStore:n,destStore:s,position:a?{type:"before",before:null===(p=e.children[0])||void 0===p?void 0:p.value.store.id}:{type:"after"},propertyWithInverse:d,transaction:c})}const m=o[o.length-2];if(!m)return;const g=m.value.store;ee.hE({environment:t,sourceStore:g,destStore:s,propertyWithInverse:d,position:a?{type:"before",before:i.id}:{type:"after",after:i.id},transaction:c})}function Ie(e){const{environment:t,collectionContextStore:n,groupFormat:o,newGroupFormat:r,groupsFormatKey:i,currentGroups:a,transaction:s}=e,c=n.collectionStore();!(0,l.we)(o.value,r.value)&&c&&Se({environment:t,collectionStore:c,property:o.property,oldValue:o.value,newValue:r.value,preventPublishAppEventsForBlockUpdates:!1,transaction:s});_e({collectionContextStore:n,newGroups:a.map((e=>(0,l.we)(o.value,e.value)?r:e)),groupsFormatKey:i,transaction:s})}function Ce(e){const{environment:t,stores:n,spaceId:o,transaction:r}=e;return n.map((e=>{const n=e.getType();if(n&&(i.Ok[n]||n===i.Ti.file||n===i.Ti.externalObjectInstance)){const n=X.j4({environment:t,type:"page",inMemoryRecordCache:e.inMemoryRecordCache,transaction:r,spaceId:o,useCrdt:e.useCrdt()});return J.jG({parentStore:n,childStore:e,transaction:r}),n}return e}))}function Te(e){const{environment:t,format:n,groupsFormatKey:o,collectionContextStore:r,currentGroups:i}=e,a=n[o]||[];if(!r.permissionScopesStore.state.canConfigureBlock)return;if(0===i.length)return;const s=i.slice(0,A.XD),l=a.slice(0,A.XD);S.Xy(s,l)||ie.createAndCommit({userAction:"collectionGroupActions.persistFormatGroups",environment:t,canUndo:!1,perform:e=>{_e({collectionContextStore:r,newGroups:i,groupsFormatKey:o,transaction:e})}})}function Me(e,t){return`group-${e}-${(0,l.mD)(t)}`}function Pe(e){const{environment:t,groupFormat:n,collectionContextStore:o}=e,r=o.collectionViewStore();if(!r)return;const i=o.groupsStore.getGroupState(n);if(!i)return;const a=m.Z.get({userId:t.currentUser.id,key:Me(r.id,n)});i.toggleStateStore.setState(a??!0)}function Ae(e){const{environment:t,groupFormat:n,toggleStateStore:o,newValue:r,collectionContextStore:i}=e,a=i.collectionViewStore();a&&(o.setState(r),m.Z.set({userId:t.currentUser.id,key:Me(a.id,n),value:r}))}function Re(e){const{newGroupValue:t,groupFormat:n,schema:o,collectionContextStore:r,currentGroups:i,groupsFormatKey:a,collectionStore:s,environment:d}=e,u=o[n.property];if(!u)return;if(!(0,l.LG)(u))return;const p=n.value;if((0,c.cu)(u)){if(p.type!==u.type)return;if(t.type!==u.type)return;if(void 0===t.value)return;const e=u.options||[],l=t.value,c=e.map((e=>e.value===p.value?{...e,value:l}:e)),m={...u,options:c},g={...o,[n.property]:m},f={...n,value:{...p,value:l}};ie.createAndCommit({userAction:"collectionGroupActions.handleCollectionGroupValueChange",environment:d,perform:e=>{Ie({environment:d,collectionContextStore:r,groupFormat:n,newGroupFormat:f,currentGroups:i,transaction:e,groupsFormatKey:a}),w.Rm({environment:d,collectionStore:s,update:{schema:g},transaction:e})}})}else if("person"!==u.type)if((0,l.HB)(u.type)){if(p.type!==u.type)return;if(t.type!==u.type)return;if(!t.value||"exact"!==t.value.type)return;const e={...n,value:t};ie.createAndCommit({userAction:"collectionGroupActions.handleCollectionGroupValueChange",environment:d,perform:t=>{Ie({environment:d,collectionContextStore:r,groupFormat:n,newGroupFormat:e,currentGroups:i,groupsFormatKey:a,transaction:t})}})}else"status"===u.type||(0,l.A1)(u.type)||"created_by"===u.type||"last_edited_by"===u.type||"number"===u.type||"checkbox"===u.type||"formula"===u.type||"relation"===u.type||"location"===u.type||(0,k.t1)(u.type);else{if(p.type!==u.type)return;if(t.type!==u.type)return;const e={...n,value:t};ie.createAndCommit({userAction:"collectionGroupActions.handleCollectionGroupValueChange",environment:d,perform:t=>{Ie({environment:d,collectionContextStore:r,groupFormat:n,newGroupFormat:e,currentGroups:i,groupsFormatKey:a,transaction:t})}})}}async function De(e){const{update:t,collectionContextStore:n,groupsFormatKey:o,collectionStore:r,environment:a,schema:s,groupBy:l}=e,d=s[l.property];if(!d)return;const u="relation"===d.type&&(0,c.F0)(d),p=u&&new O.NW(a,{table:f.vF,id:u});p&&await p.load(),ie.createAndCommit({userAction:"collectionGroupActions.handleCollectionAddGroupButtonAccept",environment:a,perform:e=>{if(t.newGroups&&(_e({collectionContextStore:n,newGroups:t.newGroups,groupsFormatKey:o,transaction:e}),z.ul({transaction:e,newGroups:t.newGroups,collectionContextStore:n,environment:a})),t.newSchema&&w.Rm({environment:a,collectionStore:r,update:{schema:t.newSchema},transaction:e}),t.newPage&&"relation"===d.type&&p){const n=(0,y.TPx)(t.newPage.name),o=X.j4({environment:a,id:t.newPage.id,type:i.Ti.page,spaceId:t.newPage.spaceId,properties:{title:n},inMemoryRecordCache:r.inMemoryRecordCache,transaction:e,useCrdt:C.dy({source:"collection_unknown_view"})});J.zw({parentStore:p,childStore:o,transaction:e});const s=p.getDefaultTemplatePageStore();s&&q.ob({title:{text:n},environment:a,store:O.G.createChildStore(p,o.pointer),templateStore:s,isKeyboard:!1,isCreateIn:!1,transaction:e,from:"collection_group_actions"})}}})}function Be(e){const{collectionContextStore:t,environment:n,incrementLimitArgs:o}=e;t.groupsStore.incrementLimit(e.incrementLimitArgs),t.loadingDetailsStore.setState({type:"load_more_blocks",group:o.groupsPointer}),L.bn(n)}function Ee(e){const{environment:t,blockStore:n,properties:o,transaction:r}=e;I.b({environment:t,store:n,properties:o,transaction:r})}function Fe(e){const{environment:t,collectionContextStore:n,transaction:o,groupByKey:r,groupsFormatKey:i,sortType:a}=e;if("chart_config"===r)return;const s=(0,l.b7)(n.normalizedFormatStore.state,r,i),c=n.collectionViewStore();if(s&&c){if("formula"===s.type){const e={...s,groupBy:{...s.groupBy,sort:{type:a}}};Y.FH({stores:[c],update:{[r]:e},transaction:o})}else Y.FH({stores:[c],update:{[r]:{...s,sort:{type:a}}},transaction:o});L.wd({environment:t,collectionContextStore:n,action:"update_group_sort"})}}function Ze(e){const{environment:t,collectionContextStore:n,isHidden:o,groupByKey:r,groupsFormatKey:i,currentGroups:a,newGroupIds:s}=e,c=(0,l.b7)(n.normalizedFormatStore.state,r,i),d=c?(0,l.mu)(c):void 0,u=a.filter((e=>s.indexOf((0,l.mD)(e))<0)),p=a.filter((e=>s.indexOf((0,l.mD)(e))>=0)),m=S.MR(p,(e=>{const t=s.indexOf((0,l.mD)(e));return t>=0?t:1/0})),g=o?[...u,...m]:[...m,...u];ie.createAndCommit({userAction:`collectionGroupActions.handleGroupReorder#${i}`,environment:t,perform:e=>{Fe({sortType:"manual",environment:t,collectionContextStore:n,groupByKey:r,groupsFormatKey:i,transaction:e}),_e({collectionContextStore:n,newGroups:g,groupsFormatKey:i,transaction:e})}});const f="board_columns"===i?o?"board_reorder_hidden_groups":"board_reorder_groups":o?"reorder_hidden_groups":"reorder_groups";L.wd({environment:t,collectionContextStore:n,action:f}),c&&d&&function(e){const{environment:t,collectionContextStore:n,groupByKey:o,groupsFormatKey:r,previousGroupBy:i,previousSortType:a}=e;"manual"!==a&&G.showDialog({message:E.default.formatMessage(le.removeGroupSortingConfirmation,{sortType:E.default.formatMessage((0,A.h8)(i,a))}),items:[{label:E.default.formatMessage(le.removeGroupSortingButton),color:"red",onAccept:()=>{}},{label:E.default.formatMessage(le.removeGroupSortingCancel),onAccept:()=>{ie.createAndCommit({userAction:"collectionGroupActions.offerToRemoveGroupSort",environment:t,perform:e=>{Fe({environment:t,collectionContextStore:n,transaction:e,groupByKey:o,groupsFormatKey:r,sortType:a})}})}}],showCancel:!1,keepFocus:!0})}({environment:t,collectionContextStore:n,groupByKey:r,groupsFormatKey:i,previousGroupBy:c,previousSortType:d.type})}},316956:(e,t,n)=>{n.d(t,{Bv:()=>Z,E2:()=>j,G3:()=>B,LC:()=>E,OK:()=>U,TI:()=>O,bL:()=>F,er:()=>V,fH:()=>N,yV:()=>L});n(757658),n(667294);var o=n(846283),r=n(399036),i=n(595200),a=n(406695),s=n(295519),l=n(606287),c=n(709291),d=n(653965),u=n(215828),p=n(401898),m=n(137810),g=n(691851),f=n(710274),h=n(110906),v=n(776798),y=n(708661),b=n(433929),_=n(729376),S=n(123347),k=n(206258),w=n(108406),x=n(431869),I=n(805149),C=n(287085),T=n(579257),M=n(547307),P=n(496802),A=n(210228),R=n(512304),D=n(785893);function B(e){const{environment:t,collectionViewArgs:n,collectionStore:a,propertyName:s,propertyType:l,selectOptions:c,transaction:d,propertyId:m,propertySchema:g}=e,h={},v=a.getSchema(),_=Object.keys(v),S=(0,i.Z)(s??y.SO[l],(e=>!_.find((t=>{const n=v[t];return Boolean(n&&n.name===e)})))),k=m??(0,u.ZP)();let w;if(g&&g.type===l)w=g;else{const e=(0,y.k4)();if((0,r.XU)(l))switch(l){case"ai_custom_prompt":w={name:S,type:"text",ai_inference:{type:"custom",prompt:"",auto_update_on_edit:e}};break;case"ai_summary":w={name:S,type:"text",ai_inference:{type:"summarize",auto_update_on_edit:e}};break;case"ai_extract":w={name:S,type:"text",ai_inference:{type:"extract",prompt:"",auto_update_on_edit:e}};break;case"ai_translate":w={name:S,type:"text",ai_inference:{type:"translate",targetProperties:["title"],toLanguage:"english",auto_update_on_edit:e}};break;case"ai_keywords":w={name:S,type:"multi_select",select_ai_inference:{type:"multi_select",add_options:!0,auto_update_on_edit:!1}};break;default:(0,p.t1)(l)}else w=!c||"select"!==l&&"multi_select"!==l?{name:S,type:l}:{name:S,type:l,options:c}}if(h[k]=w,r.iE(w)&&(_.includes(o.k.Owner)||(h[o.k.Owner]={name:b.default.formatMessage(R.Zi.ownerPropertyName),type:"person",default:"created_by"}),w.verifier_property=o.k.Owner),n){const{format:e,formatKey:t,collectionViewStore:o}=n,r=[...e[t]||[],{property:k,visible:!0}];P.FH({stores:[o],update:{[t]:r},transaction:d})}return f.xO({environment:t,collectionStore:a,update:h,transaction:d}),k}function E(e){const{environment:t,collectionStore:n,property:o,type:i,transaction:a}=e,s=n.getSchema()[o];if(!s||s.type===i)return;const l={...s};l.type=(0,r.TN)(i),f.xO({environment:t,collectionStore:n,update:{[o]:l},transaction:a})}function F(e){const{collectionStore:t,property:n,autoRelate:o,transaction:r}=e;t.getSchema()[n]&&A.applyOperation({store:t,operation:{pointer:t.pointer,path:["schema",n,"autoRelate"],command:"set",args:o},transaction:r})}function Z(e){const{collectionStore:t,property:n,name:o,transaction:r}=e;t.getSchema()[n]&&A.applyOperation({store:t,operation:{pointer:t.pointer,path:["schema",n,"name"],command:"set",args:o},transaction:r})}function U(e){const{collectionStore:t,property:n,icon:o,transaction:r}=e;t.getSchema()[n]&&A.applyOperation({store:t,operation:{pointer:t.pointer,path:["schema",n,"icon"],command:"set",args:o},transaction:r})}function V(e){const{formatStore:t,formatKey:n,property:o,update:r,transaction:i}=e,a=[...t.getFormat()[n]||[]],s=a.findIndex((e=>e.property===o));-1!==s?a[s]={...a[s],...r}:a.push({property:o,...r}),P.FH({stores:t instanceof k.G||t instanceof k.NW||t instanceof k.Xr?[t]:(0,p.t1)(t),update:{[n]:a},transaction:i})}function N(e){const{propertyGroupId:t,collectionContextStore:n,collectionStore:o,environment:i,isInPeekRenderer:l,onCloseMenu:c,pagePropertiesStore:d,propertyVisibility:u}=e,p=n.settingsStore;I.H4({collectionSettingsStore:p,item:{type:"propertyType",onAccept:(e,m,g,f)=>{if("relation"===e)return void I.H4({collectionSettingsStore:p,item:{type:"selectRelationSource",property:void 0,formatKey:"collection_page_properties",propertyGroupId:t}});const{performResult:h}=A.createAndCommit({userAction:"PageProperties.handleAddPropertyClick",environment:i,perform:t=>B({environment:i,collectionStore:o,collectionViewArgs:void 0,propertyType:e,propertyName:g,selectOptions:f,transaction:t})});(t||u)&&A.createAndCommit({userAction:"PageProperties.handleAddPropertyClick.addPropertyToGroupAndUpdateVisibility",environment:i,perform:e=>{t&&(0,S.Nk)({collectionStore:o,groupId:t,propertyId:h,transaction:e}),u&&T.M0({property:h,visibility:u,format:(0,s.i)(o.getFormat(),o.getSchema(),void 0,a.j5.Collection),store:o,transaction:e})}}),null==c||c(h),I.FK({collectionSettingsStore:p,item:{type:"property",formatKey:"collection_page_properties",property:h,selectNameInitial:!i.device.isMobile}}),d.setState({...d.state,openProperty:{property:h,isInPeekRenderer:l},forceShowProperties:!0}),(0,r.XU)(e)&&C.K7({propertyType:e,propertyId:h,collectionContextStore:n}),w._H({environment:i,collectionContextStore:n,from:"page_properties",property_type:(0,r.TN)(e),property:(0,r.XU)(e)?e:void 0,is_suggested_property:m})}}})}async function O(e){const{environment:t,collectionContextStore:n,property:o,handleDeleteAccept:r}=e,i=n.collectionStore();if(!i)return;if(i.isTypedProperty(o)){if(await g.w0({environment:t,property:o,collectionContextStore:n,theme:e.theme,from:e.from}))return}const a=n.normalizedSchemaStore.state,s=a[o],l=_.ny(n,s);await(null==l?void 0:l.load());const d=l&&_.OP(n,o,l),u=l&&_.gZ(l),p=l&&i.id===l.id,f=[{label:(0,D.jsx)(c.FormattedMessage,{id:"database.viewSettings.propertyTab.deleteProperty.modal.confirmButton",defaultMessage:"Delete"}),color:"red",onAccept:r}];let h;if(d&&i&&u&&!p&&f.push({label:(0,D.jsx)(c.FormattedMessage,{id:"database.tableHeaderCell.deleteProperty.modal.inverseConfirmButton",defaultMessage:"Delete, but keep related property"}),color:"red",onAccept:()=>{A.createAndCommit({userAction:"collectionPropertyActions.showDeletePropertyDialog",environment:t,perform:e=>{if(s&&"relation"===s.type&&s.property&&l){const n=s.property,o=l.getSchema();x.q0({environment:t,collectionStore:l,propertySchema:o[n],property:n,targetPropertyID:void 0,autoRelate:i.isSyncedCollection()&&!l.isSyncedCollection()?{enabled:!1}:s.autoRelate,transaction:e})}x.kQ({environment:t,collectionStore:i,property:o,transaction:e})}})}}),"auto_increment_id"===(null==s?void 0:s.type))h=_.pR(a)?(0,D.jsx)(c.FormattedMessage,{id:"database.tableHeaderCell.deleteUniqueIdWithGithubProperty.modal.prompt",defaultMessage:"You will no longer be able to link new GitHub PRs and status automations will stop working."}):(0,D.jsx)(c.FormattedMessage,{id:"database.tableHeaderCell.deleteUniqueIdProperty.modal.prompt",defaultMessage:"The ID property will be permanently deleted."});else if("status"===(null==s?void 0:s.type)){const e=_.Pi(a);if(e){const t=e.connectedRelation.automation;t&&t[o]&&(h=(0,D.jsx)(c.FormattedMessage,{id:"database.tableHeaderCell.deleteStatusProperty.modal.prompt",defaultMessage:"Deleting this status property will stop the GitHub Pull Requests status automation."}))}}else l&&u&&!p&&d&&(h=(0,D.jsx)(c.FormattedMessage,{id:"database.tableHeaderCell.deleteRelatedProperty.modal.prompt",defaultMessage:"This property has a related property on {relationTargetName} which will also be deleted.",values:{relationTargetName:(0,D.jsx)(v.Z,{style:{display:"inline",fontWeight:m.Z.fontWeight.medium},store:l})}}));M.showDialog({message:(0,D.jsx)("span",{children:(0,D.jsx)(c.FormattedMessage,{id:"database.tableHeaderCell.deleteProperty.modal.prompt",defaultMessage:"Delete this property for everyone on {databaseName}?",values:{databaseName:(0,D.jsx)(v.Z,{style:{display:"inline",fontWeight:m.Z.fontWeight.medium},shouldWrap:!0,store:i})}})}),description:h,showCancel:!0,keepFocus:!0,items:f,mode:"wide"})}async function L(e){const{environment:t,collectionStore:n,schema:o,property:i,transaction:a}=e,s=o[i];if(s)if("relation"===s.type&&r.F0(s)&&s.property&&r.F0(s)!==n.id){const e=new k.NW(t,r.j0(s));await e.load(),j({environment:t,collectionStore:n,schema:o,property:i,transaction:a,targetCollectionStore:e})}else j({environment:t,collectionStore:n,schema:o,property:i,transaction:a})}function j(e){const{environment:t,collectionStore:n,schema:o,property:r,transaction:i,targetCollectionStore:a,permanentlyDelete:s}=e;if(!n.isDefined())return;const c=Boolean(s),u=h.zm({environment:t,collectionId:n.id,schema:o,property:r,targetCollectionStore:a,omitNewSchema:!0});if(!u)return;(0,S.K$)({collectionStore:n,propertyId:r,transaction:i}),c||f.$N({collectionStore:n,update:u.deletedSchema,transaction:i});let p=d.Xh(u.deletedSchema);for(const l in p)p[l]=null;if(f.xO({environment:t,collectionStore:n,update:p,transaction:i}),u.otherCollectionId&&u.otherCollectionSchema){c||f.$N({collectionStore:k.NW.createChildStore(n,{table:l.vF,id:u.otherCollectionId}),update:u.otherCollectionDeletedSchema||{},transaction:i}),p=d.Xh(u.otherCollectionDeletedSchema||{});for(const e in p)p[e]=null;f.xO({environment:t,collectionStore:k.NW.createChildStore(n,{table:l.vF,id:u.otherCollectionId}),update:p||{},transaction:i})}const m=o[r];("auto_increment_id"===(null==m?void 0:m.type)||c)&&f.$N({collectionStore:n,update:{[r]:null},transaction:i})}},575134:(e,t,n)=>{n.d(t,{H:()=>I,r:()=>C});n(667294);var o=n(252936),r=n(842875),i=(n(757658),n(21703),n(653965)),a=n(180951),s=n(261158),l=n(145953);const c=500;function*d(e){const{startingBlock:t,relationPropertyIdGroups:n,receiver:o}=e;let r,s=n.map((e=>function*(e){const{startingBlock:t,relationPropertyIds:n,receiver:o}=e,r=new Set,s=[{block:t}];let l=0;for(;;){const e=s.shift();if(!e)break;const{block:t}=e;if(r.has(t.id))continue;r.add(t.id);const d=n.flatMap((e=>{var n;return(0,a.rq)(null===(n=t.properties)||void 0===n?void 0:n[e])}));if(!o.receive(d))return;if(d.length>0){const{recordMap:e}=yield{recordPointers:d};s.push(...i.oA(d.map((t=>{const n=e.getValue(t);if(n&&n.alive)return{block:n}}))))}if(l++,l>c)throw new Error("Reached maximum number of iterations")}}({relationPropertyIds:e,startingBlock:t,receiver:o})));for(;s.length>0;){const e=[];s=s.filter((t=>{const n=r?t.next(r):t.next();return!n.done&&(e.push(n.value),!0)})),e.length>0&&(r=yield{recordPointers:e.flatMap((e=>e.recordPointers))})}}class u{constructor(e){this.blockPointerSet=new s.Z,this.limit=e}getBlockPointers(){return this.blockPointerSet.valuesArray()}receive(e){return this.blockPointerSet.add(...e),this.blockPointerSet.size<this.limit}}function p(e){return function(e){const{startingBlock:t,relationPropertyIdGroups:n,getRecordValue:o,limit:r}=e,i=new u(r),a=d({startingBlock:t,relationPropertyIdGroups:n,receiver:i});let s=a.next();for(;!s.done;){const e=l.Ak.create();for(const t of s.value.recordPointers)e.setValue(t,o(t));s=a.next({recordMap:e})}return i.getBlockPointers()}(e).every((t=>Boolean(e.getRecordValue(t))))}var m=n(709291),g=n(990038),f=n(401898),h=n(606854),v=n(531062),y=n(80444),b=n(206258),_=n(21359),S=n(164964),k=n(210228),w=n(785893);const x=100;function I(e){const{environment:t,store:n}=e;M({environment:t,store:n,change:{type:"date",...e}})}function C(e){const{environment:t,store:n}=e;M({environment:t,store:n,change:{type:"relation",...e}})}const T=new g.z(1);function M(e){const{environment:t,store:n,change:a}=e,s=n.getAssociatedCollectionStore();if(!s)return;const l=s.getDatabaseType(),c=s.getSchema(),d=s.getNormalizedDependencyDateShiftingConfig();if(!d)return;const u=s.getFormatStore().getKeyStore("collection_default_arrows_by").getValue();if(!u)return;const g=c[u];if("relation"!==(null==g?void 0:g.type))return;const I=g.property;I&&T.enqueue((()=>async function(e){var t,n;const{environment:a,store:s,dateShiftConfig:l,databaseType:c,blockedByPropertyId:d,blockingPropertyId:u,change:g,collectionSchema:I}=e,C={id:s.id,properties:s.getProperties()},T=null===(t=y.default.state.currentUserSettingsStore)||void 0===t||null===(t=t.getSettings())||void 0===t?void 0:t.locale,M=(0,r.r)();let P,A,R;if("date"===g.type){var D;if(0===i.jV(i.oA([l.date_property,l.end_date_property]),i.oA([g.dateProperty.id,null===(D=g.otherDateProperty)||void 0===D?void 0:D.id])).length)return;const e=new Map;e.set(g.dateProperty.id,g.dateProperty),g.otherDateProperty&&e.set(g.otherDateProperty.id,g.otherDateProperty);const t=t=>{const n=e.get(t);if((0,f.$K)(n))return n;{var o;const e=null===(o=C.properties)||void 0===o?void 0:o[t];return{id:t,oldValue:e,newValue:e}}};P=t(l.date_property),(0,f.$K)(l.end_date_property)&&(A=t(l.end_date_property))}else if("relation"===g.type){if(g.relationPropertyId!==u&&g.relationPropertyId!==d)return;if("preserve_gap"===l.mode)return;P={id:l.date_property,oldValue:void 0,newValue:C.properties[l.date_property]},l.end_date_property&&(A={id:l.end_date_property,oldValue:void 0,newValue:C.properties[l.end_date_property]})}else(0,f.t1)(g);"preserve_gap"===l.mode?R=[[d,u]]:"consume_gap"===l.mode?R=[[d],[u]]:(0,f.t1)(l.mode);p({startingBlock:C,relationPropertyIdGroups:R,limit:x,getRecordValue:s.getRecordValue})?await Promise.resolve():await _.getTransitivePageRelations(a,{blockId:C.id,limit:x,relationPropertyIdGroups:R}).then((()=>{}));const B=(0,o.yu)({block:{id:C.id,properties:{...C.properties,...P.oldValue?{[P.id]:P.oldValue}:{},...null!==(n=A)&&void 0!==n&&n.oldValue?{[A.id]:A.oldValue}:{}}},blockingPropertyId:u,blockedByPropertyId:d,dateProperty:P,endDateProperty:A,getRecordValue:s.getRecordValue,timeZone:M,locale:T,options:l,collectionSchema:I,getRecordRole:s.getRecordRole}),{operations:E}=B;k.createAndCommit({userAction:"collectionDateActions.handleDependencyDateShifting",environment:a,perform:e=>{for(const t of E){const n=(0,b.Kv)(s,t.pointer);k.applyOperation({store:n,operation:t,transaction:e})}}});const F=(0,v.vi)({result:B,databaseType:c});F&&S.oV({label:(0,w.jsx)(m.FormattedMessage,{...F.message}),right:F.canUndo?(0,w.jsx)(h.ow,{}):void 0})}({environment:t,store:n,dateShiftConfig:d,databaseType:l,blockedByPropertyId:I,blockingPropertyId:u,change:a,collectionSchema:c}))).catch((e=>{console.error(e)}))}},431869:(e,t,n)=>{n.d(t,{gy:()=>y,kQ:()=>h,n7:()=>v,q0:()=>f,qK:()=>_,sf:()=>b});var o=n(180951),r=n(215828),i=n(250906),a=n(710274),s=n(729376),l=n(108406),c=n(316956),d=n(575134),u=n(496802),p=n(800993),m=n(210228);function g(e){const{environment:t,collectionStore:n,collectionPointer:o,property:r,name:i,autoRelate:s,limit:l,targetPropertyID:c,connectedRelation:d,transaction:u,hideByDefaultInUnconfiguredViews:p}=e,m={type:"relation",name:i,collection_id:o.id,collection_pointer:o,limit:"1"===l?1:void 0,property:c,version:"v2",autoRelate:s,connectedRelation:d,hideByDefaultInUnconfiguredViews:p};a.xO({environment:t,collectionStore:n,update:{[r]:m},transaction:u})}function f(e){const{environment:t,collectionStore:n,propertySchema:o,targetPropertyID:r,property:i,autoRelate:s,transaction:l}=e;a.xO({environment:t,collectionStore:n,update:{[i]:{...o,autoRelate:s,property:r,version:"v2"}},transaction:l})}function h(e){const{environment:t,collectionStore:n,property:o,transaction:r}=e,i=n.getSchema()[o];i&&"relation"===i.type&&(a.xO({environment:t,collectionStore:n,update:{[o]:null},transaction:r}),a.$N({collectionStore:n,update:{[o]:i},transaction:r}))}function v(e){const{environment:t,collectionContextStore:n,collectionStore:o,property:i,propertyName:a,propertyLimit:d,targetCollectionStore:u,hasInverseRelation:p,inverseName:m,autoRelate:f,intl:h,connectedRelation:v,transaction:y,from:b,analyticsFrom:_,onlyCheckPermissions:S}=e,k=u.pointer.id===o.id&&Boolean(p)?"separate_property":"same_property",w=s.KV(n,i),x="subitem"===b||void 0,I=function(e){const{environment:t,collectionContextStore:n,property:o,limit:i,collectionPointer:a,selfRelationType:s,oneWay:l,autoRelate:c,connectedRelation:d,transaction:u,hideByDefaultInUnconfiguredViews:p}=e,m=n.collectionStore();if(!m)return;const f=m.getSchema()[o];if(!f)return;const h=a.id===m.id?"same_property"===s?o:(0,r.ZP)():l?void 0:(0,r.ZP)();return g({environment:t,collectionStore:m,collectionPointer:a,property:o,name:f.name,autoRelate:c,limit:i,targetPropertyID:h,connectedRelation:d,transaction:u,hideByDefaultInUnconfiguredViews:p}),h}({environment:t,collectionContextStore:n,property:i,limit:d,collectionPointer:u.pointer,selfRelationType:k,oneWay:!p,autoRelate:f,connectedRelation:v,transaction:y,hideByDefaultInUnconfiguredViews:x});if((null==w?void 0:w.name)!==a&&(c.Bv({collectionStore:o,property:i,name:a,transaction:y}),l.$q({environment:t,collectionContextStore:n,property:i,from:_??"view_settings",action:"rename"})),S&&p&&null!=o&&o.canEditCollection()&&I){const e=s.rj({inverseName:m,collectionStore:o,propertySchema:w,intl:h,targetCollectionStore:u,from:b});g({environment:t,collectionStore:u,collectionPointer:o.pointer,property:I,name:e,autoRelate:f,limit:"subitem"===b?"1":"no_limit",targetPropertyID:i,connectedRelation:v,transaction:y,hideByDefaultInUnconfiguredViews:x})}if(p&&s.gZ(u)&&I){const e=s.rj({inverseName:m,collectionStore:o,propertySchema:w,intl:h,targetCollectionStore:u,from:b});g({environment:t,collectionStore:u,collectionPointer:o.pointer,property:I,name:e,autoRelate:f,limit:"subitem"===b?"1":"no_limit",targetPropertyID:i,connectedRelation:v,transaction:y,hideByDefaultInUnconfiguredViews:x})}}function y(e){const{environment:t,collectionContextStore:n,property:o,hasInverseRelation:i,inverseName:a,autoRelate:l,intl:d,transaction:u}=e,p=s.KV(n,o);if(!p||"relation"!==p.type)return;const m=s.ny(n,p),v=n.collectionStore();if(!v||!m)return;const y=s.rj({inverseName:a,collectionStore:v,propertySchema:p,intl:d,targetCollectionStore:m});if(i&&!s.OP(n,o,m)){const e=(0,r.ZP)();f({environment:t,collectionStore:v,propertySchema:p,property:o,targetPropertyID:e,autoRelate:l,transaction:u}),g({environment:t,collectionStore:m,collectionPointer:v.pointer,property:e,name:y,autoRelate:l,limit:"no_limit",targetPropertyID:o,transaction:u,hideByDefaultInUnconfiguredViews:void 0})}else if(i){const e=p.property;if(!e)return;c.Bv({collectionStore:m,property:e,name:y,transaction:u}),l&&(c.bL({collectionStore:v,property:o,autoRelate:l,transaction:u}),c.bL({collectionStore:m,property:e,autoRelate:l,transaction:u}))}else{l&&c.bL({collectionStore:v,property:o,autoRelate:l,transaction:u});const e=p.property;if(!e)return;f({environment:t,collectionStore:v,propertySchema:p,property:o,targetPropertyID:void 0,autoRelate:l,transaction:u}),h({environment:t,collectionStore:m,property:e,transaction:u})}}function b(e){const{store:t,propertyId:n,value:r,environment:i,relatedPageId:a,propertySchema:s,transaction:c,collectionContextStore:u,analyticsData:m,isUnthrottled:g}=e,f=t.getPropertyStore(n),h=o.ow(r);if(p.sO({environment:i,store:f,value:h,transaction:c}),u&&m){var v;const{analyticsFrom:e,isFromBulkActionsToolbar:t}=m;l.rv({environment:i,block_id:a,property:n,property_type:s.type,from:e,collectionContextStore:u,isFromBulkActionsToolbar:t,isUnthrottled:g,integration_id:null===(v=s.connectedRelation)||void 0===v?void 0:v.integration_id,action:"remove"})}d.r({environment:i,store:t,relationPropertyId:n})}function _(e){const{propertyFormat:t,visibility:n,collectionStore:r,property:a,environment:l}=e,c=t.property,d=s.U1({collectionStore:r,property:a}),p=(0,o.pX)(d,c,!n),g={...s.ZI(r)};g[a]||(g[a]={}),g[a].related_properties=p,m.createAndCommit({userAction:"collectionRelationActions.updateRelationPropertyVisibility",environment:l,perform:e=>{u.FH({stores:[r],update:{collection_relation_options:g},transaction:e})}}),i.P$(l,{collection_id:r.id,property_id:a,related_property_id:c,visible:!n})}},805149:(e,t,n)=>{n.d(t,{E3:()=>E,FK:()=>U,H4:()=>Z,ID:()=>F,NG:()=>D,Ol:()=>K,Qu:()=>B,R0:()=>q,TT:()=>L,YN:()=>H,iN:()=>z,qU:()=>O,r$:()=>R,wl:()=>V,z$:()=>N,zt:()=>j});n(21703),n(667294);var o=n(701302),r=n(815145),i=n(159730),a=n(915157),s=n(421202),l=n(709291),c=n(937850),d=n(137810),u=n(619584),p=n(710274),m=n(95477),g=n(892918),f=n(484210),h=n(433929),v=n(816402),y=n(121039),b=n(108406),_=n(21359),S=n(616241),k=n(800893),w=n(547307),x=n(496802),I=n(311712),C=n(164964),T=n(210228),M=n(239865),P=n(785893);const A=(0,l.defineMessages)({copySuccessMessage:{defaultMessage:"Link to view copied to clipboard",id:"database.viewSettings.copyLinkSnackBarItem.title"},chartDataTableName:{defaultMessage:"Data",id:"database.viewSettings.createView.charts.dataTable"}});function R(e){const{collectionContextStore:t,selectViewNameInitial:n,collectionSettingsStore:o,hideSettingsPopup:r,hideSettingsHeader:i,hideDuplicatePropertyOption:a,fromBlockStore:s,ref:l}=e;let c;c=t.hasSingleCollection()&&!t.collectionStore()?{type:"createViewSource"}:{type:"main",selectViewNameInitial:n},o.setState({open:!0,hideSettingsPopup:r,hideSettingsHeader:i,stack:[c],fromBlockStore:s,ref:l,hideDuplicatePropertyOption:a})}function D(e){const{collectionSettingsStore:t}=e;V({collectionSettingsStore:t,item:{type:"createSyncedViewSource"}})}function B(e){const{collectionSettingsStore:t,source:n}=e;V({collectionSettingsStore:t,item:{type:"externalProjectsSyncSettings",source:n}})}function E(e){const{collectionSettingsStore:t}=e;t.setState({...t.state,open:!1,hideSettingsPopup:void 0,hideSettingsHeader:void 0,stack:[],ref:void 0,hideDuplicatePropertyOption:void 0}),y.Z.setState({...y.Z.state,flowId:void 0})}function F(e){const{collectionSettingsStore:t,item:n}=e,o=t.state;t.setState({...o,open:!0,stack:[...o.stack,n]})}function Z(e){const{collectionSettingsStore:t,item:n,hideSettingsPopup:o}=e,r=t.state;t.setState({...r,open:!0,stack:[...r.stack,n],...void 0!==o?{hideSettingsPopup:o}:{}})}function U(e){const{collectionSettingsStore:t,item:n,ref:o}=e,r=t.state;t.setState({open:!0,stack:[...r.stack.slice(0,r.stack.length-1),n],...void 0!==o?{ref:o}:{}})}function V(e){const{collectionSettingsStore:t,item:n}=e;t.setState({open:!0,stack:[n]})}function N(e){const{collectionSettingsStore:t,keepPreviousRef:n}=e,o=t.state,r=o.stack.slice(0,o.stack.length-1);0===r.length?E({collectionSettingsStore:t}):t.setState({open:!0,stack:r,...void 0!==o.ref&&n?{ref:o.ref}:{}})}function O(e){const{collectionSettingsStore:t,property:n,formatKey:o,selectNameInitial:r}=e,i=t.state,a=i.stack.findIndex((e=>"property"===e.type));t.setState({open:!0,stack:[...a>=0?i.stack.slice(0,a):i.stack,{type:"property",property:n,formatKey:o,selectNameInitial:r}]})}function L(e){const{environment:t,collectionContextStore:n,collectionViewStore:o,collectionSettingsStore:r,additionalBlocksToDelete:i,from:a}=e,s=o.getType(),u="form_editor"===s,m=(0,c.UZ)(),g=()=>{const e=n.collectionViewStore(),l=n.collectionViewBlockStore(),c=n.isFullScreenStore.state;e&&l&&s&&(T.createAndCommit({userAction:"collectionSettingsActions.handleDeleteCollectionView",environment:t,perform:d=>{if(p.dp({collectionViewBlockStore:l,collectionViewStore:o,transaction:d}),E({collectionSettingsStore:r}),e.id===o.id){const e=l.getCollectionViewStores()[0];if(e)p.f8({environment:t,collectionContextStore:n,collectionViewId:e.id,isFullScreen:n.isFullScreenStore.state,isRootChild:n.isRootChildStore.state,isInPeekRenderer:n.isInPeekRendererStore.state});else{if(!n.isEditableHomeCollectionStore.state)throw new Error("Cannot delete last view. Delete database instead.");p.ME({environment:t,collectionContextStore:n,newViewType:"table",transaction:d,skipOpenSettings:n.isInHomeWidgetStore.state}),c||I.Cl({environment:t,blocks:[l],transaction:d})}}i&&M.y8({environment:t,blocks:i,transaction:d}),b.Rc({environment:t,collectionContextStore:n,view_type:s,from:a})}}),m.resolve(!0))};return u?w.showDialog({showCancel:!0,keepFocus:!1,message:(0,P.jsx)("div",{style:{fontWeight:d.Z.fontWeight.semibold,fontSize:18},children:(0,P.jsx)(l.FormattedMessage,{id:"database.formEditSettings.deleteFormModal. essage",defaultMessage:"Permanently delete {viewName}?",values:{viewName:o.getName()}})}),description:(0,P.jsx)(l.FormattedMessage,{defaultMessage:"Users will no longer be able to submit data through this form. Any data already submitted will remain unaffected",id:"database.formEditSettings.deleteFormModal.text"}),items:[{label:(0,P.jsx)(l.FormattedMessage,{defaultMessage:"Delete form",id:"database.viewSettings.formDeleteButton.text"}),color:"red",onAccept:()=>{g()}}],innerStyle:{textAlign:"center"},handleCancel:()=>m.resolve(!1)}):w.showDialog({showCancel:!0,keepFocus:!1,message:(0,P.jsx)(l.FormattedMessage,{defaultMessage:"Are you sure you want to delete this view?",id:"database.viewSettings.mainTab.deleteViewConfirm.text"}),items:[{label:(0,P.jsx)(l.FormattedMessage,{defaultMessage:"Delete view",id:"database.viewSettings.deleteButton.text"}),color:"red",onAccept:()=>{g()}}],handleCancel:()=>m.resolve(!1)}),m.promise}function j(e){const{environment:t,collectionContextStore:n,collectionViewStore:r,collectionSettingsStore:i,intl:a,from:s}=e,l=n.isFullScreenStore.state,c=n.isRootChildStore.state,d=n.isInPeekRendererStore.state,u=n.collectionViewBlockStore(),{performResult:m}=T.createAndCommit({userAction:"collectionSettingsActions.newView",environment:t,perform:e=>p.tG({environment:t,collectionViewBlockStore:u,collectionViewStore:r,intl:a,transaction:e})});m&&("chart"===m.getType()&&S.Q({environment:t,collectionContextStore:n,collectionViewId:m.id,from:s}),p.f8({environment:t,collectionContextStore:n,collectionViewId:m.id,isFullScreen:l,isRootChild:c,isInPeekRenderer:d}),o.default.afterNextFlush((()=>{R({collectionContextStore:n,collectionSettingsStore:i,selectViewNameInitial:!0})})))}async function K(e){const{environment:t,collectionContextStore:n,collectionViewStore:o}=e,i=n.collectionViewBlockStore();if(!o||!i)return;const a=(0,f.ZP)({store:i,collectionViewId:o.id,fullyQualified:!0,pageVisitSource:r.tY.CopyLink});await k.RD({environment:t,stringValue:a,copiedMessage:k.tq.copiedLinkToClipboard}),C.oV({label:h.default.formatMessage(A.copySuccessMessage)})}function z(e){const{environment:t,collectionContextStore:n}=e,o=n.normalizedFormatStore.state,r=o.board_columns_by,i=n.collectionViewStore();if(!r||!i)return;const a=!(0,g.h6)(o);T.createAndCommit({userAction:"collectionSettingsActions.handleBoardGroupColorColumnsClick",environment:t,perform:e=>{x.FH({stores:[i],update:{board_columns_by:{...r,disableBoardColorColumns:a}},transaction:e})}}),b.wd({environment:t,collectionContextStore:n,action:"toggle_group_color_columns"})}async function q(e){const{environment:t,uri:n,botId:o,collectionId:r,isStale:s,nextSync:c,setNextSync:d}=e;if(!c||Date.now()>c){var p;let e=Date.now()+u.U6;const c=await _.resubscribeExternalCollection(t,{botId:o,uri:n,isStale:s,collectionId:r});if("failed"===c.type&&(0,i.A6)(c.body)&&"rate_limited"===(null===(p=c.body.clientData)||void 0===p?void 0:p.type)){const t=c.body.clientData.retryAfter;t&&(e=Date.now()+t*u.C0),C.oV({label:(0,P.jsx)(l.FormattedMessage,{id:"database.viewSettings.syncedSourceTab.update.rateLimitError",defaultMessage:"This database was synced recently. You may try again in {time}.",values:{time:(0,v.hH)(Date.now(),e)}})})}if(m.default.isAdminMode)return;a.Z.set({userId:t.currentUser.id,key:`${o}:${n}`,value:e}),d(e)}}function H(e){const{collectionContextStore:t,environment:n}=e,o=t.collectionViewStore(),r=t.collectionViewBlockStore(),i=t.collectionStore(),a=null==o?void 0:o.getType(),l=null==r?void 0:r.getCollectionViewIds(),c=null==r?void 0:r.getSpaceId();r&&i&&"chart"===a&&1===(null==l?void 0:l.length)&&c&&T.createAndCommit({userAction:"CollectionSettingsCreateViewSource.createDataTableForChart",environment:n,perform:e=>{p.W9({environment:n,collectionViewBlockStore:r,collectionView:{type:"table",parent_id:r.pointer.id,parent_table:s.iU,alive:!0,name:h.default.formatMessage(A.chartDataTableName),space_id:c,format:{table_properties:[{property:"title",visible:!0}],table_wrap:!0,hide_linked_collection_name:!0,collection_pointer:r.getCollectionPointer()}},transaction:e})}})}},287085:(e,t,n)=>{n.d(t,{G0:()=>Z,Jw:()=>N,K7:()=>U,PW:()=>V});n(757658),n(21703);var o=n(371663),r=n(990559),i=n(399036),a=n(977657),s=n(568626),l=n(474181),c=n(959753),d=n(421202),u=n(509844),p=n(475246),m=n(429369),g=n(709291),f=n(653965),h=n(401898),v=n(940663),y=n(710274),b=n(110906),_=n(296994),S=n(433929),k=n(80444),w=n(530874),x=n(206258),I=n(108406),C=n(21359),T=n(774882),M=n(316956),P=n(431869),A=n(805149),R=n(928673),D=n(496802),B=n(210228);const E=(0,g.defineMessages)({aiCustomPromptDefaultPropertyName:{id:"collectionSettingsCreatePropertyActions.createProperty",defaultMessage:"Text"}});function F(e){const{environment:t,collectionContextStore:n,collectionUri:o,feature:r,transaction:i,addFeatureFrom:a,createFeatureStartTime:s}=e;if("dependencies"in r)for(const l of r.dependencies)"property"===l.type&&l.collectionUri===o&&I._H({environment:t,collectionContextStore:n,from:"view_settings",property:l.uri,property_type:l.propertySchema.type,is_suggested_property:!0,feature:{id:l.uri,from:a,type:r.uri}});if("dependencies"in r&&r.dependencies.map((e=>e.type)).every((e=>"property"===e))){const e=n.collectionViewStore(),t=n.getPropertyFormatKey(),o=n.normalizedFormatStore.state;if(t&&e){const n=o[t]||[],a=[...n];r.dependencies.forEach((e=>{const t=n.findIndex((t=>t.property===e.uri));-1===t?a.push({visible:!0,property:e.uri}):a[t]={...n[t],visible:!0}})),D.FH({stores:[e],update:{[t]:a},transaction:i})}}if(void 0!==r.propertyIdCollectionSettingToNavigateTo){const e={type:"property",property:r.propertyIdCollectionSettingToNavigateTo,selectNameInitial:!1,formatKey:n.getPropertyFormatKey()};A.H4({collectionSettingsStore:n.settingsStore,item:e})}i.postSubmitCallbacks.push((e=>{I.mH(t,{collection_uri:r.collectionUri,feature_uri:r.uri,time:Date.now()-s,status:Boolean(e)?"fail":"success"})}))}async function Z(e){var t;const{appTemplatesSetupActions:n,appTemplatesSprintBoardActions:i,appConfigs:c}=await _.FF.AppTemplates.load(),{environment:g,collectionContextStore:f,feature:h,addFeatureFrom:y}=e,{currentSpaceViewStore:b}=k.default.state,S=f.collectionStore(),I=null==S?void 0:S.getParentBlockStore(),M=e=>{(0,s.log)({level:"error",from:"collectionSettingsCreatePropertyActions",type:"handleCreateNewSuggestedProperty",data:{collectionId:null==S?void 0:S.id,miscDataToConvertToString:{featureUri:h.uri,addFeatureFrom:y,...e}}})};if(!S||!I)return void M({hasCollectionStore:Boolean(S),hasCollectionViewBlockStore:Boolean(I)});if((0,v.EU)(h))return async function(e){const{environment:t,collectionContextStore:n,feature:r,addFeatureFrom:i}=e,{untypedFeaturesSetupActions:a}=await _.FF.AppTemplates.load(),s=n.collectionStore(),l=null==s?void 0:s.getParentBlockStore();if(!s||!l)return;const c=Date.now();B.createAndCommit({environment:t,userAction:"collectionSettingsCreatePropertyActions.handleCreateNewUntypedFeature",perform:e=>{a.applyUntypedFeature({environment:t,collectionStore:s,collectionViewBlockStore:l,feature:r,transaction:e}),F({environment:t,collectionContextStore:n,collectionUri:o.br,feature:r,transaction:e,addFeatureFrom:i,createFeatureStartTime:c})}})}({environment:g,collectionContextStore:f,feature:h,addFeatureFrom:y});const P=f.collectionViewStore(),A=null==I?void 0:I.getParentStore(),E=null==S||null===(t=S.getFormat())||void 0===t?void 0:t.app_config_uri,Z=E&&(0,v.YB)(c(),E);if(!A||A.table!==p.bx&&A.table!==d.iU&&A.table!==m.e0||!Z)return void M({hasAppParentStore:Boolean(A),appParentStoreTable:null==A?void 0:A.table,appConfigUri:Z?Z.uri:void 0});const U=S.getSchema(),V=I.getFormat().app_id,N=V?await C.getCollectionViewBlocksByAppId(g,{spaceId:I.getSpaceId(),appId:V}):void 0,O="success"===(null==N?void 0:N.type)&&N.data.result.length?N.data.result.map((e=>x.G.createChildStore(A,{table:d.iU,id:e.blockId,spaceId:I.getSpaceId()}))):[I],L=h.integrationId;if(L){const e=w.Z.getIntegrationsAsRecordMap().getValue({table:u.K2,id:L});if(!e||!(0,l.VM)(e))return void M({hasIntegration:Boolean(e)});await R.V(g,S,e,Boolean(h.canOnlyAdminAuth))}L===a.U9&&U&&0===(0,r.$z)(U).length&&await T.K({environment:g,collectionStore:S});const j=Date.now();B.createAndCommit({environment:g,userAction:"collectionSettingsCreatePropertyActions.handleCreateNewSuggestedProperty",perform:e=>{var t;if(!b)return void M({hasCurrentSpaceViewStore:!1});const r=null===(t=S.getFormat())||void 0===t?void 0:t.app_config_uri;if(!r)return void M({hasCollectionUri:!1});const a=n.applyTypedFeatures({environment:g,spaceViewStore:b,appParentStore:A,appUri:Z.uri,features:[{type:"simple",featureUri:h.uri}],transaction:e,createOrModify:"modify",appCollectionViewBlockStores:O});i.createSprintPage({environment:g,spaceViewStore:b,appParentStore:A,transaction:e,blockStores:a,creationEntryPoint:{type:"sprint_relation"}}),"notion://tasks/sub_task_feature"===h.uri&&D.FH({stores:[S],update:{subitem_property:o.Es.SubTaskRelation},transaction:e}),"notion://tasks/task_dependencies_feature"===h.uri&&(D.FH({stores:[S],update:{collection_default_arrows_by:o.Es.BlockingRelation},transaction:e}),P&&D.FH({stores:[P],update:{timeline_arrows_by:{property:o.Es.BlockingRelation}},transaction:e})),F({environment:g,collectionContextStore:f,collectionUri:r,feature:h,transaction:e,addFeatureFrom:y,createFeatureStartTime:j})}})}function U(e){let{propertyType:t,collectionContextStore:n,propertyId:o}=e;switch(t){case"ai_custom_prompt":case"ai_summary":case"ai_extract":case"ai_translate":return A.H4({collectionSettingsStore:n.settingsStore,item:{type:"propertyAiAutofill",propertySchema:n.normalizedSchemaStore[o],property:o}});case"ai_keywords":return A.H4({collectionSettingsStore:n.settingsStore,item:{type:"property",property:o,formatKey:n.getPropertyFormatKey()}});default:(0,h.t1)(t)}}function V(e){const{environment:t,collectionContextStore:n,propertyType:o,isSuggestedProperty:r,propertyName:a,selectOptions:s,from:l}=e,c=n.collectionStore(),d=n.collectionViewStore(),u=n.getPropertyFormatKey();if(!c||!u)return;if("relation"===o)return void A.H4({collectionSettingsStore:n.settingsStore,item:{type:"selectRelationSource",property:void 0,formatKey:"collection_page_properties"}});let p=a;"ai_custom_prompt"===o&&(p=S.default.formatMessage(E.aiCustomPromptDefaultPropertyName));const{performResult:m}=B.createAndCommit({userAction:"collectionSettingsCreatePropertyActions.handleCreateNewStandardProperty",environment:t,perform:e=>M.G3({environment:t,collectionStore:c,collectionViewArgs:d?{collectionViewStore:d,format:d.getFormat(),formatKey:u}:void 0,propertyName:p,propertyType:o,selectOptions:s,transaction:e})});(0,i.XU)(o)?U({propertyType:o,propertyId:m,collectionContextStore:n}):A.qU({collectionSettingsStore:n.settingsStore,property:m,formatKey:u,selectNameInitial:!0});const g="view_settings"===l?{feature:{id:m,from:"new_property",type:o}}:{};I._H({environment:t,collectionContextStore:n,from:l,property_type:(0,i.TN)(o),property:(0,i.XU)(o)?o:void 0,is_suggested_property:r,...g})}async function N(e){const{environment:t,collectionContextStore:n,intl:o,connectedRelationProperty:s,from:l,untypedFeatureArgs:d}=e,u=n.collectionStore(),p=n.collectionViewStore(),m=n.getPropertyFormatKey();if(!u||!m)return;const g=s.integration.id;[a.f3,a.mQ].includes(g)||await R.V(t,u,s.integration,Boolean(s.canOnlyAdminAuth));const v=u.getSchema();let _;g===a.U9&&v&&0===(0,r.$z)(v).length&&(_=await T.K({environment:t,collectionStore:u})),B.createAndCommit({environment:t,userAction:"collectionSettingsCreatePropertyActions.handleCreateNewConnectedRelationProperty",perform:e=>{_&&M.G3({environment:t,collectionStore:u,collectionViewArgs:p?{collectionViewStore:p,format:p.getFormat(),formatKey:m}:void 0,propertyType:"auto_increment_id",transaction:e});const r=u.getDeletedSchema(),v=(0,h.qP)(r).map((e=>{let[t,n]=e;if(n&&i.NK(n)&&n.connectedRelation.integration_id===a.U9)return{propertyId:t,propertySchema:n}})).filter(h.$K);if(!f.xb(v)){const{propertyId:o}=v[0],i=(0,b.D8)({deletedSchema:r,property:o});if(!i)throw new Error("Deleted property schema was not found");y.xO({environment:t,collectionStore:u,update:i.updateSchema,transaction:e}),y.$N({collectionStore:u,update:i.updateDeletedSchema,transaction:e});const a={type:"property",property:o,formatKey:m};return void A.H4({collectionSettingsStore:n.settingsStore,item:a})}const S=c.kk5.fromIntegration(s.integration),k=R.c({environment:t,pattern:s.pattern,integration:S,parentCollectionStore:u,transaction:e}),w=M.G3({environment:t,collectionStore:u,collectionViewArgs:p&&m?{collectionViewStore:p,format:p.getFormat(),formatKey:m}:void 0,propertyType:"relation",transaction:e,propertyId:null==d?void 0:d.propertyId});if(P.n7({environment:t,collectionContextStore:n,collectionStore:u,property:w,propertyName:s.name,propertyLimit:"no_limit",targetCollectionStore:k,hasInverseRelation:!0,autoRelate:void 0,intl:o,connectedRelation:{integration_id:g},transaction:e}),!d){const e={type:"property",property:w,formatKey:m};A.H4({collectionSettingsStore:n.settingsStore,item:e})}I._H({environment:t,collectionContextStore:n,from:"view_settings",property_type:"relation",integration_id:g,feature:{id:w,from:l,type:`notion://feature/connection_${g}`}})}})}},498834:(e,t,n)=>{n.d(t,{$p:()=>B,R5:()=>A,Zh:()=>P,nx:()=>M,ob:()=>D});n(21703),n(757658);var o=n(541432),r=n(320297),i=n(842875),a=n(23867),s=n(421838),l=n(709291),c=n(521100),d=n(27105),u=n(278429),p=n(433929),m=n(318245),g=n(594896),f=n(206258),h=n(981193),v=n(21359),y=n(547307),b=n(276725),_=n(496802),S=n(594419),k=n(709953),w=n(800993),x=n(498724),I=n(429373);const C=(0,l.defineMessages)({duplicateTemplateError:{id:"databaseTemplatePickerActions.duplicateTemplateFailedError.message",defaultMessage:"Duplicate template failed."}});function T(e){const{environment:t,pageStore:n,copiedFromPointer:o,useInMemoryRecordCache:s,addCopyName:l,transaction:c,resolveTemplateVariables:d}=e,m=n.useCrdt(),h=new f.G(t,o,{inMemoryRecordCache:s});if(s){const e=b.K8(t,{blockId:h.id,inMemoryRecordCache:h.inMemoryRecordCache,allowCopyCollections:!0,requireFullSubtree:!1,skipTransclusionContainerChildren:!1,allowCopyExternalObjectInstances:!0,includeLegacyTransclusionBlockValues:(0,u.hC)()});if(!e)throw new Error("Client copy could not be created.");b.E9({environment:t,sourceBlockId:h.id,targetBlockPointer:n.pointer,sourceBlockSubtree:e,targetInMemoryRecordCache:n.inMemoryRecordCache,addCopyName:l,transaction:c,deepCopyTransclusionContainers:!1,resolveTemplateVariables:d,useCrdt:m,preventLegacyTransclusions:(0,u.hC)()})}else{if(R({environment:t,store:n,properties:h.getProperties(),transaction:c}),d&&x.bt({environment:t,store:n,context:{currentUserId:t.currentUser.id,currentTimeZone:(0,i.r)()},transaction:c}),l){const e=n.getBlockTitleStore();w.sO({environment:t,store:e,value:r.eb(e.getValue()),transaction:c})}const e={copied_from:o.id};k.sW({store:n,data:e,transaction:c});const{use_crdt:s,text_clocks:u,text_slice_tree:f,automation_id:b,app_config_uri:_,...S}=h.getFormat(),I={...S,copied_from_pointer:o};k.sW({store:n.getFormatStore(),data:I,transaction:c}),h.hasContent()&&(g.Z.setStatus(n.id,!0),c.postSubmitCallbacks.push((async e=>{if(e)return y.showErrorMessage(p.default.formatMessage(C.duplicateTemplateError)),void g.Z.setStatus(n.id,!1);await v.duplicateBlock(t,{sourceBlocks:[{id:o.id,spaceId:(0,a.C)(o.spaceId)}],targetBlocks:[{id:n.id,spaceId:(0,a.C)(n.pointer.spaceId)}],addCopyName:l,appendContentOnly:!0,isTemplateInstantiation:!0,resolveTemplateVariables:!!d&&{currentUserId:t.currentUser.id,currentTimeZone:(0,i.r)()},deepCopyTransclusionContainers:!1,useCrdt:m,userAction:"collectionTemplatePickerActions.createCopyOfCollectionTemplate"}).next().finally((()=>{g.Z.setStatus(n.id,!1)}))})))}return n}function M(e){const{environment:t,collectionStore:n,transaction:r,title:i,useCrdt:a}=e,l=k.j4({environment:t,type:o.Ti.page,inMemoryRecordCache:n.inMemoryRecordCache,transaction:r,spaceId:n.getTemplatePagesStore().pointer.spaceId,properties:{title:(0,s.TPx)(i||"")},useCrdt:a});return k.sW({store:l,data:{is_template:!0},transaction:r}),S.R3({parentStore:n.getTemplatePagesStore(),appendStore:l,transaction:r}),l}function P(e){const{environment:t,event:n,collectionStore:r,templateStore:i,transaction:a}=e,s=k.j4({environment:t,type:o.Ti.page,inMemoryRecordCache:i.inMemoryRecordCache,transaction:a,spaceId:r.getTemplatePagesStore().pointer.spaceId,useCrdt:(0,d.SL)({event:n,source:"collection_instantiate_template",contextualDefault:i.useCrdt()})});k.sW({store:s,data:{is_template:!0},transaction:a}),S.BE({parentStore:r.getTemplatePagesStore(),afterStore:i,insertStore:s,transaction:a});try{T({environment:t,copiedFromPointer:i.pointer,pageStore:s,addCopyName:!0,transaction:a,resolveTemplateVariables:!1})}catch(l){y.showErrorMessage(p.default.formatMessage(C.duplicateTemplateError))}return s}function A(e){const{collectionStore:t,templateStore:n,transaction:o}=e;S.Od({parentStore:t.getTemplatePagesStore(),childToRemoveStore:n,transaction:o})}function R(e){const{environment:t,store:n,properties:o,transaction:r}=e;c.b({environment:t,store:n,properties:o,transaction:r})}function D(e){const{environment:t,store:n,templateStore:o,title:r,isKeyboard:i,isCreateIn:a,transaction:s,from:l}=e,c=n.getProperties(),d=m.default.DO_NOT_USE_markLegacy("rum.initialize_collection_template");if(T({environment:t,pageStore:n,copiedFromPointer:o.pointer,useInMemoryRecordCache:n.inMemoryRecordCache!==t.defaultRecordCache.inMemoryRecordCache?n.inMemoryRecordCache:void 0,transaction:s,resolveTemplateVariables:!0}),"template"!==r){const e="empty"===r?void 0:r.text;w.sO({environment:t,store:n.getBlockTitleStore(),value:e,transaction:s})}R({environment:t,store:n,properties:c,transaction:s}),k.sW({store:n,data:{is_template:null},transaction:s}),_.Wq({environment:t,store:n,isLocked:!1,transaction:s}),0===o.getContentLength()&&I.ls({environment:t,store:n,transaction:s}),m.default.DO_NOT_USE_measureLegacy(d,{environment:t}),h.XQ(t,{template_id:o.id,collection_id:o.getParentId(),is_keyboard:i,is_create_in:a,from:l})}function B(e){const{collectionStore:t,newTemplateIds:n,transaction:o}=e;k.sW({store:t,data:{template_pages:n},transaction:o})}},730188:(e,t,n)=>{n.d(t,{Bb:()=>le,Cz:()=>me,FC:()=>te,R2:()=>ie,VP:()=>de,W9:()=>pe,YE:()=>se,cI:()=>ae,e2:()=>ee,h5:()=>ue,i6:()=>ce,km:()=>ne,rT:()=>X,wA:()=>$,xr:()=>oe});n(757658),n(21703),n(252262),n(324506),n(667294);var o=n(701302),r=n(815145),i=n(371663),a=n(399036),s=n(180951),l=n(421202),c=n(23867),d=n(429369),u=n(95371),p=n(439721),m=n(873597),g=n(570842),f=n(709291),h=n(653965),v=n(401898),y=n(137810),b=n(275754),_=n(51592),S=n(110906),k=n(855337),w=n(277181),x=n(741195),I=n(278429),C=n(433929),T=n(729376),M=n(635328),P=n(80444),A=n(453730),R=n(206258),D=n(250906),B=n(108406),E=n(100952),F=n(21359),Z=n(554569),U=n(316956),V=n(431869),N=n(547307),O=n(276725),L=n(496802),j=n(119785),K=n(709953),z=n(879978),q=n(311712),H=n(524677),G=n(210228),W=n(785893);function $(e){const{environment:t,transaction:n,blocks:o,action:r}=e,i=(0,S.fm)(o[0]);if(!i)return;const a=i.subitemTreeStore.state;if(!a)return;const s=i.currentSubitemFormatStoreForUiDisplayStore.state;if(!s||!s.property)return;const l=i.collectionViewBlockStore();if(!l)return;const c=new u.mp({store:l,pathKey:""},a.map((e=>e)).children),d=function(e,t){const n=new Set(e);let o,r;for(const i of m.JK(t)){if(!n.has(i.value.store)){if(o)return;continue}const e=(0,u.DY)([t],(e=>e===i));if(!e||e.length<2)return;if(o??=e,r=e,n.delete(i.value.store),0===n.size)break}if(o&&r)return g.T.fromNearestCommonAncestor(o,r)}(o,c);if(!d)return;const f=p.o.getIndentOperationsFromTreeRange(d,r),h=new Set,y=[],b="unindentSelf"===r?new Set(f.map((e=>e.target))):new Set;for(const m of f){const{target:e,operation:o}=m,r=(0,u.DY)([c],(t=>t===e));if(void 0===r)return;const a=r[r.length-2];if("indentSelfAndSubtree"===o){if(h.has(a)){h.add(e),y.push(e.value.store);continue}const o=a.children,r=o.indexOf(e);if(0===r)return;const l=o[r-1].value.store;Y({environment:t,parentStore:a.value.store,previousSiblingStore:l,targetStore:e.value.store,subitemFormat:s,transaction:n}),y.push(R.G.createChildStore(l,e.value.store.pointer)),X({collectionContextStore:i,pathKey:(0,w.zV)(a.value.pathKey,l)})}else{if("unindentSelf"!==o)break;{var _;if(b.has(a)){b.delete(e),y.push(e.value.store);continue}if(1===r.length)return;const o=null===(_=r[r.length-3])||void 0===_?void 0:_.value.store;Q({environment:t,parentStore:a.value.store,grandparentStore:o,targetStore:e.value.store,subitemFormat:s,transaction:n}),y.push(R.G.createChildStore(o&&o.isPageBlock()?o:i.collectionViewBlockStore(),e.value.store.pointer))}}if(p.F.applyMutable(c,m))if("indentSelfAndSubtree"===o)h.add(e);else if("unindentSelf"===o){const t=i.subitemExpandedStore.state,n=a.value.pathKey,o=t.get(n);0===a.children.length&&null!=o&&o.isExpanded&&(t.delete(n),i.subitemExpandedStore.emit()),b.delete(e)}else(0,v.t1)(o)}y&&H.Z5({environment:t,stores:y})}function Y(e){const{environment:t,parentStore:n,previousSiblingStore:o,targetStore:r,subitemFormat:i,transaction:a}=e;n.isPageBlock()&&z.Bl({environment:t,sourceStore:n,destStore:r,propertyWithInverse:i,transaction:a}),z.hE({environment:t,sourceStore:o,destStore:r,propertyWithInverse:i,transaction:a,position:{type:"after"}})}function Q(e){const{environment:t,parentStore:n,grandparentStore:o,targetStore:r,subitemFormat:i,transaction:a}=e;z.Bl({environment:t,sourceStore:n,destStore:r,propertyWithInverse:i,transaction:a}),o&&o.isPageBlock()&&z.hE({environment:t,sourceStore:o,destStore:r,propertyWithInverse:i,position:{type:"after",after:n.id},transaction:a})}function J(e){var t,n;const{blocksToDuplicate:o,duplicatedBlocks:r,environment:i,transaction:s,migrateSubitemFormat:l,pageCollectionContextStore:c,originalSubitemSchemas:d}=e;if(o.length!==r.length)throw new Error("Error rebuilding relations. blocksToDuplicate and duplicatedBlocks must be the same length");const u=o.at(0);if(!u)return;const{from:p,to:m}=l||function(e){const t=(0,w.g0)(e);if(!t)throw new Error("Error rebuilding relations");const{subitemFormat:n}=t;return{from:n,to:n}}(u),g=(0,S.fm)(u)||c;if(!g)return;const f=(null===(t=g.collectionStore())||void 0===t?void 0:t.getSchema()[p.property])||(null==d?void 0:d.subitemRelationSchema),v=(null===(n=g.collectionStore())||void 0===n?void 0:n.getSchema()[p.inverse])||(null==d?void 0:d.parentRelationSchema);if(!(f&&v&&(0,a.p_)(f)&&(0,a.p_)(v)))return;const y=new Map(h.$R(o.map((e=>e.id)),r));h.$R(o,r).forEach((e=>{let[t,n]=e;const o=(0,w.CJ)({store:t,subitemFormat:{property:p.property},propertySchema:f}),r=(0,w.xb)({store:t,subitemFormat:p,propertySchema:v});o.forEach((e=>{const t=R.G.createChildStore(n,e),o=y.get(e.id);o&&(z.Bl({environment:i,sourceStore:n,destStore:t,propertyWithInverse:p,transaction:s}),z.hE({environment:i,sourceStore:n,destStore:o,propertyWithInverse:m,transaction:s,position:{type:"after"}}))})),r.forEach((e=>{const t=R.G.createChildStore(n,e);y.get(e.id)&&z.Bl({environment:i,sourceStore:t,destStore:n,propertyWithInverse:p,transaction:s})}))}))}function X(e){const{collectionContextStore:t,pathKey:n}=e,o=t.subitemExpandedStore.state,r=o.get(n);null!=r&&r.isExpanded||(o.set(n,{isExpanded:!0,limit:20}),t.subitemExpandedStore.emit())}function ee(e){const t=(0,S.fm)(e);if(!t)return;const n=t.subitemTreeStore.state,o=(0,u.DY)(n.children,(t=>t.value.store===e));if(!o)return;const r=o.map((e=>e.value.store.pointer)),i=(0,w.Af)(r),a=t.subitemExpandedStore.state,s=a.get(i);s&&s.isExpanded&&(a.delete(i),t.subitemExpandedStore.emit())}function te(e){var t;const n=(0,S.fm)(e);if(!n)return;const o=n.subitemTreeStore.state,r=(0,u.DY)(o.children,(t=>t.value.store===e));if(!r)return;const i=n.currentSubitemFormatStoreForUiDisplayStore.state;if(!i)return;const a=null===(t=n.collectionStore())||void 0===t?void 0:t.getSchema()[i.property];if(!a||"relation"!==a.type)return;if(0===(0,w.CJ)({store:e,subitemFormat:i,propertySchema:a}).length)return;const s=r.map((e=>e.value.store.pointer));X({collectionContextStore:n,pathKey:(0,w.Af)(s)})}function ne(e){var t;const{collectionContextStore:n,relationPropertyId:o,transaction:r,environment:a}=e,s=n.collectionStore();if(!s)return;const l=o?s.getSchema()[o]:void 0,c="relation"===(null==l?void 0:l.type)&&l.property&&"relation"===(null===(t=s.getSchema()[l.property])||void 0===t?void 0:t.type)?l.property:void 0,d=s.getFormat().subitem_property&&o?"collectionViewSubitemActions.changeSubitemProperty":s.getFormat().subitem_property?"collectionViewSubitemActions.turnOffSubitems":"collectionViewSubitemActions.turnOnSubitems";L.FH({stores:[s],update:{subitem_property:o,...s.getFormat().app_config_uri===i.Ym?{app_uri_map:{...s.getFormat().app_uri_map?s.getFormat().app_uri_map:{},[i.Es.SubTaskRelation]:o,[i.Es.ParentTaskRelation]:c}}:{}},transaction:r}),k.K4(a,"update_subitem_property",{userAction:d})}async function oe(e){const{environment:t,blocks:n,options:o}=e;if(n.some((e=>!e.isPageBlock())))return[];const r=h.Ps(n);if(!r)return[];const i=e.collectionContextStore??(0,S.fm)(r);if(!i)return[];const s=i.collectionStore();if(!s)return[];const l=i.currentSubitemFormatStoreForCollectionStore.state,c=i.normalizedSchemaStore.state,d=(null==l?void 0:l.inverse)&&c[l.inverse];if(!d||!(0,a.p_)(d))return[];const u=d.property;if(!u)return[];const p=s.id,m=s.getSpaceId();if(!n.some((e=>(0,w.CJ)({store:e,subitemFormat:l,propertySchema:d}).length>0)))return[];await A.transactionQueue.drain();const g=await F.getSubitems(t,{collection:{id:p,spaceId:m},blocks:n.map((e=>({id:e.id,spaceId:m}))),childRelationProperty:u,canEdit:null==o?void 0:o.canEdit});return"failed"===g.type?[]:g.data.blocks.map((e=>R.G.createChildStore(s,{table:"block",...e})))}function re(e){const t=h.Ps(e);if(!t)return[];const n=(0,S.fm)(t);if(!n)return[];const o=n.collectionStore(),r=n.collectionViewBlockStore();if(!o||!r)return[];const i=n.currentSubitemFormatStoreForCollectionStore.state,s=n.normalizedSchemaStore.state,l=(null==i?void 0:i.inverse)&&s[i.inverse];if(!l||!(0,a.p_)(l))return[];if(!l.property)return[];const c=new Set(e.map((e=>e.id)));let d=e;const u=[];for(;d.length>0;){const e=h.xH(d.map((e=>(0,w.CJ)({store:e,subitemFormat:i,propertySchema:l})))).filter((e=>!c.has(e.id))).map((e=>R.G.createChildStore(r,e)));for(const t of e)c.add(t.id);u.push(...e),d=e}return u}function ie(e){let{environment:t,blocks:n,recordMaps:o,analyticsFrom:r,transaction:i,migrateSubitemFormat:a,collectionContextStore:s,originalSubitemSchemas:u,useCrdt:p}=e;const m=n.at(0);if(!m)return[];const g=(e,n)=>{const r=o?o.get(e.id):O.K8(t,{blockId:e.id,inMemoryRecordCache:e.inMemoryRecordCache,allowCopyCollections:!0,requireFullSubtree:!1,skipTransclusionContainerChildren:!0,allowCopyExternalObjectInstances:!0,skipBlockContent:!0,includeLegacyTransclusionBlockValues:null==n?void 0:n.includeLegacyTransclusionBlockValues});if(!r)throw new Error("Could not find cached copy of block during sub-item duplication.");return r};n.forEach((e=>{var n;const o=e.getModel();if(!o)return[];const{currentSpaceStore:i}=P.default.getState();let a;i&&o.getParentTable()===d.e0&&o.parent_id&&(a=R.zX.createChildStore(i,{table:d.e0,id:o.parent_id})),E.W(t,{from:r??"copy",type:o.type,teamStore:a,is_toggleable:(0,M._A)(o.type,o.getFormat()),collection_id:e.getAssociatedCollectionId()??(null===(n=e.getCollectionViewCollectionStore())||void 0===n?void 0:n.id),new_page_id:"page"===o.type?e.id:void 0,creating_block_id:e.id})}));const f=(0,I.hC)(),h=n.map((e=>{const n=O.E9({environment:t,transaction:i,sourceBlockId:e.id,targetBlockPointer:(0,x.Ii)({environment:t,table:l.iU,spaceId:(0,c.C)(e.pointer.spaceId)}),sourceBlockSubtree:g(e,{includeLegacyTransclusionBlockValues:f}),targetInMemoryRecordCache:e.inMemoryRecordCache,addCopyName:!1,deepCopyTransclusionContainers:!m.isTransclusionType(),resolveTemplateVariables:!(m.isInsideTemplate()||m.isInsideFactoryOrDuplicateBlocksAction()),useCrdt:p??e.useCrdt(),preventLegacyTransclusions:f}).targetBlockStore;return K.sW({store:n,data:{content:[]},transaction:i}),n}));return J({blocksToDuplicate:n,duplicatedBlocks:h,environment:t,transaction:i,migrateSubitemFormat:a,pageCollectionContextStore:s,originalSubitemSchemas:u}),i.postSubmitCallbacks.push((async e=>{e||await Promise.all(n.map(((e,n)=>F.duplicateBlock(t,{sourceBlocks:[{id:e.pointer.id,spaceId:(0,c.C)(e.pointer.spaceId)}],targetBlocks:[{id:h[n].pointer.id,spaceId:(0,c.C)(h[n].pointer.spaceId)}],addCopyName:!1,appendContentOnly:!0,isTemplateInstantiation:!0,resolveTemplateVariables:!1,deepCopyTransclusionContainers:!1,useCrdt:p??e.useCrdt(),userAction:"collectionViewSubitemActions.localDuplicateBlocksWithSubitems"}).next().finally((()=>{})))))})),h}function ae(e){let{blocks:t,transaction:n,from:o,to:r,environment:i,originAction:a}=e;return t.forEach((e=>{(0,w.dI)({store:e,subitemFormat:{property:o.property},originAction:a}).forEach((t=>{const o=R.G.createChildStore(e,t);z.hE({environment:i,sourceStore:e,destStore:o,propertyWithInverse:r,transaction:n,position:{type:"after"}})}))})),t}async function se(e){let{droppedStores:t,createdStores:n,collectionStore:o,environment:r,collectionContextStore:i,groupsPointer:a,alreadyMovedToCollection:s,shouldDuplicate:l}=e;const c=t.at(0);if(!c)return;const d=(0,w.g0)(c);let u=(0,w.ko)(o);if(!d)return;const p=await oe({environment:r,blocks:t,options:{canEdit:!0}});if(p.length<=0)return;let m=[...p];if(l){const e=await pe({environment:r,blocks:p,analyticsFrom:"subitem_option_drag_drop"});e&&(m=[...e])}G.createAndCommit({userAction:"collectionGroupActions.handleGroupDrop.subitemsDrop",environment:r,perform:e=>{if(!u){le({transaction:e,collectionContextStore:i,environment:r})&&(u=(0,w.ko)(o))}for(const t of m)Z.mp({environment:r,store:t,collectionStore:o,collectionContextStore:i,groupsPointer:a,shouldCoerce:!0,transaction:e,alreadyMovedToCollection:s});u&&ce({blocksToDuplicate:[...t,...p],duplicatedBlocks:[...n,...m],environment:r,shouldDuplicate:l,originSubitemFormat:d.subitemFormat,destinationSubitemFormat:u,transaction:e,subitemRelationSchema:d.childRelationSchema,relationPropertyCollectionId:o.id})}}),D.RO(r,{draggedTypes:h.oA(m.map((e=>e.getType()))),from:"subitem_drag",asCopy:l,optionalAnalyticsProperties:{collectionContextStore:i}})}function le(e){let{transaction:t,collectionContextStore:n,environment:o}=e;if(n.permissionScopesStore.state.isLocked||!n.permissionScopesStore.state.canEditContent)return;const r=n.collectionStore(),i=n.collectionViewStore();if(!r)return;const a=r.getModel();if(!a)return;const s=n.normalizedSchemaStore.state,l=T.m8(C.default.getIntl(),{targetCollectionStore:r,isSelfRelation:!0,sourceSchema:s,createUnique:!0,from:"subitem"}),c=T.aI(C.default.getIntl(),{sourceCollection:a,isSelfRelation:!0,targetCollectionStore:r,createUnique:!0,from:"subitem"}),d=U.G3({environment:o,collectionStore:r,collectionViewArgs:i?{collectionViewStore:i,format:i.getFormat(),formatKey:"collection_page_properties"}:void 0,propertyType:"relation",transaction:t});return V.n7({environment:o,collectionContextStore:n,collectionStore:r,property:d,propertyName:l,targetCollectionStore:r,hasInverseRelation:!0,inverseName:c,autoRelate:{enabled:!1},propertyLimit:"no_limit",intl:C.default.getIntl(),transaction:t,from:"subitem",analyticsFrom:"nested_subitem_operation",onlyCheckPermissions:!0}),ne({environment:o,collectionContextStore:n,relationPropertyId:d,transaction:t}),B._H({environment:o,collectionContextStore:n,from:"nested_subitem_operation",property_type:"relation"}),d}function ce(e){let{blocksToDuplicate:t,duplicatedBlocks:n,environment:o,shouldDuplicate:r,originSubitemFormat:i,destinationSubitemFormat:a,transaction:s,subitemRelationSchema:l,relationPropertyCollectionId:c}=e;r?J({blocksToDuplicate:t,duplicatedBlocks:n,environment:o,transaction:s,migrateSubitemFormat:{from:i,to:a}}):ae({blocks:t,transaction:s,from:i,to:a,environment:o})}async function de(e){var t;let{blocks:n,subitems:o,environment:r,canUndo:i,skipConfirmation:a}=e;const s=o||re(n),l=[...n,...s];q.zO(l);const c=n.at(0);if(!c)return;const d=(0,S.fm)(c)??(0,w.Ll)(c,r),u=o||await oe({environment:r,blocks:n,options:{canEdit:!0},collectionContextStore:d}),p=null==d||null===(t=d.collectionStore())||void 0===t?void 0:t.getFormat().app_config_uri,m=(0,_.sN)(p,!0),g=(0,_.Q_)(p,!0);if(!a&&u.length>0){const e=await function(e){let{itemCount:t,subitemCount:n,newItemName:o,newItemNamePlural:r}=e;return new Promise((e=>{N.showDialog({onDismiss(){e(!1)},description:(0,W.jsx)(f.FormattedMessage,{id:"deleteSubitems.confirmation.description",defaultMessage:"This will also delete {subitemCount, plural, one {{subitemCount} sub-{newItemName}} other {{subitemCount} sub-{newItemNamePlural}}}.",values:{subitemCount:n,newItemName:o,newItemNamePlural:r}}),message:(0,W.jsx)("div",{style:{fontWeight:y.Z.fontWeight.semibold,fontSize:18},children:(0,W.jsx)(f.FormattedMessage,{id:"deleteSubitems.confirmation.message",defaultMessage:"Are you sure you want to delete {itemCount, plural, one {this {newItemName}} other {these {newItemNamePlural}}}?",values:{itemCount:t,newItemName:o,newItemNamePlural:r}})}),innerStyle:{textAlign:"center"},showCancel:!0,keepFocus:!0,items:[{label:(0,W.jsx)(f.FormattedMessage,{id:"deleteSubitems.confirmation.acceptLabel",defaultMessage:"Delete"}),color:"red",onAccept:()=>{e(!0)}}]})}))}({itemCount:n.length,subitemCount:u.length,newItemName:m,newItemNamePlural:g});if(!e)return q.bj(l),!1}const{serverCommitResult:h}=G.createAndCommit({userAction:"collectionViewSubitemActions.removeBlocksWithSubitems",environment:r,canUndo:i,perform:e=>{q.Cl({environment:r,blocks:n,transaction:e});for(const t of u)K.sW({store:t,data:{alive:!1},transaction:e})}});return await h,!0}async function ue(e){let{environment:t,blocks:n,collectionContextStore:o,useCrdt:i}=e;const a=await oe({environment:t,blocks:n,collectionContextStore:o,options:{canEdit:!0}});await Promise.all(a.map((e=>e.load())));const s=(0,w.JR)(o);if(!s)throw new Error("Could not find subitem info during duplication");const l=s.subitemFormat;G.createAndCommit({userAction:"collectionViewSubitemActions.duplicateBlocksWithSubitemsFromPage",environment:t,perform:e=>{const s=ie({blocks:[...n,...a],environment:t,transaction:e,migrateSubitemFormat:{from:l,to:l},collectionContextStore:o,analyticsFrom:"subitem_duplication_page_menu",useCrdt:i}),c=o.collectionStore();if(!c)return;s.map((t=>{j.zw({childStore:t,parentStore:c,transaction:e})}));const d=s.at(0);d&&b._c({environment:t,store:d,pageVisitSource:r.tY.Duplicate})}})}async function pe(e){var t;let{environment:n,blocks:r,analyticsFrom:i}=e;const a=r.at(0);if(!a)return;const s=(0,w.g0)(a),l=null===(t=(0,S.fm)(a))||void 0===t?void 0:t.collectionViewBlockStore();if(!l||!s)return;const{parentRelationProperty:c,parentRelationSchema:d}=s,u=[...r,...re(r)];if(q.zO(u),!r.at(-1))return;const p=await oe({environment:n,blocks:r,options:{canEdit:!0}});let m=[],g=[];G.createAndCommit({userAction:"actionRegistry.duplicateToSelectionWithSubitems",environment:n,perform:e=>{g=ie({blocks:[...r,...p],environment:n,transaction:e,analyticsFrom:i}),m=q.BM({environment:n,blocksToInsert:g,target:r,transaction:e,replaceEmptyTextBlock:!1,preventSetSelection:!0})}});const f=(0,w.T2)({blocks:m,parentRelationProperty:c,parentRelationSchema:d,collectionViewBlockStore:l});return o.default.afterNextFlush((()=>{o.default.afterNextFlush((()=>{H.Z5({environment:n,stores:f})}))})),q.bj(u),g}function me(e){const{environment:t,blockStore:n,collectionStore:o,subitemFormat:r,transaction:i}=e,a=n.getPropertyValue(r.inverse);s.rq(a).forEach((e=>{const a=R.G.createChildStore(o,e);z.Bl({environment:t,sourceStore:n,destStore:a,propertyWithInverse:{property:r.inverse,inverse:r.property},transaction:i})}))}},798688:(e,t,n)=>{n.d(t,{L:()=>g,v:()=>m});var o=n(568626),r=n(145953),i=n(509844),a=n(35794),s=n(653965),l=n(552629),c=n(80444),d=n(372371),u=n(21359),p=n(309377);async function m(e){const{currentSpaceStore:t}=c.default.state;t&&await g({environment:e.environment,spaceId:t.id,force:!0})}async function g(e){const{environment:t,spaceId:n,force:m}=e;if(!t.currentUser.id)return;await c.default.waitUntilRendered();const g=d.Z.state;if(!g.loaded&&!g.loading||g.loaded&&n!==g.spaceId||m){d.Z.setState({...d.Z.state,loading:!0});const e=async()=>{const e=await u.searchIntegrations(t,{query:"",type:"compliance",spaceId:n});return"success"!==e.type?(o.log({level:"error",from:"complianceIntegrationActions",type:"searchIntegrationsError",error:(0,l.Ui)(e.error)}),{status:"rejected",error:e.error}):{status:"resolved",value:e}},c=async()=>{try{return{status:"resolved",value:await p.j({environment:t,spaceId:n})}}catch(e){return o.log({level:"error",from:"complianceIntegrationActions",type:"fetchWebhookSubscriptionsError",error:(0,l.Ui)(e)}),{status:"rejected",error:e}}},[m,g]=await Promise.all([e(),c()]);if("rejected"===m.status||"rejected"===g.status)return;const{value:f}=m,{value:h}=g,v=r.PF.create(f.data.recordMap),y=r.PF.create(h.recordMap);d.Z.setState({loaded:!0,loading:!1,spaceId:n,integrations:s.MR(s.oA(f.data.integrationIds.map((e=>v.getModel({table:i.K2,id:e})))),(e=>{let{created_at:t}=e;return t})),webhookSubscriptions:s.oA(h.webhookSubscriptionIds.map((e=>y.getModel({table:a.bf,id:e,spaceId:n}))))})}}},986080:(e,t,n)=>{n.d(t,{b:()=>i,x:()=>a});var o=n(937850),r=n(481700);function i(e){const t=o.UZ();return r.Z.setState({...e,open:!0,onComplete:t.resolve}),t.promise}function a(e){const t=r.Z.state;t.open&&(t.onComplete(e.didConfirm),r.Z.reset())}},928673:(e,t,n)=>{n.d(t,{V:()=>h,c:()=>v});n(21703);var o=n(606287),r=n(23867),i=n(709291),a=n(401898),s=n(970764),l=n(741195),c=n(433929),d=n(932363),u=n(206258),p=n(547307),m=n(389475),g=n(709953);const f=(0,i.defineMessages)({authError:{defaultMessage:"Auth failed. Please try again or contact Notion support.",id:"database.viewSettings.propertyTypeSection.connected.authFail"},mobileAdminError:{defaultMessage:"Ask your workspace admin to configure the GitHub (Workspace) app in settings to use this feature.",id:"database.viewSettings.propertyTypeSection.connected.mobileAdminError"},mobileError:{defaultMessage:"Please authorize this integration on the desktop app or a browser.",id:"database.viewSettings.propertyTypeSection.connected.mobileError"}});async function h(e,t,n,o){const r=e.device.isMobile,i=null==t?void 0:t.getSpaceStore();if(!i)return;const a=(0,s.NP)(n.id).length;if(r&&o&&!a){const e=c.default.formatMessage(f.mobileAdminError);throw p.showErrorMessage(e),new Error(e)}if(r&&!o&&!a){const e=c.default.formatMessage(f.mobileError);throw p.showErrorMessage(e),new Error(e)}if(!a&&o&&i.canAdmin()||!a&&!o)try{await m.hM({environment:e,integration:n,spaceId:i.id,from:"collection_settings_property_type"})}catch(l){const e=c.default.formatMessage(f.authError);throw p.showErrorMessage(e),new Error(e)}if(!(0,s.NP)(n.id).length){const e=c.default.formatMessage(f.authError);throw p.showErrorMessage(e),new Error(e)}}function v(e){const{environment:t,pattern:n,integration:i,parentCollectionStore:s,transaction:c}=e;if(!n.connected_relation_properties)throw new Error("Cannot create a connected relation collection without properties");const p=new u.NW(t,(0,l.Ii)({environment:t,table:o.vF,spaceId:s.pointer.spaceId})),m={};n.connected_relation_sub_schemas&&(0,a.qP)(n.connected_relation_sub_schemas).map((e=>{let[n,i]=e;const a=new u.NW(t,(0,l.Ii)({environment:t,table:o.vF,spaceId:s.pointer.spaceId})),d={bot_id:void 0,external_object_id:void 0,uri:n,integration_id:void 0,is_placeholder:void 0,original_url:void 0,domain:void 0,external_schema:i,sync_state:void 0,pattern_name:void 0},f={id:a.id,version:0,space_id:(0,r.C)(s.pointer.spaceId),parent_table:o.vF,parent_id:p.id,alive:!0,format:d,schema:{}};m[n]=a.id,g.sW({store:a,data:f,transaction:c})}));const f={id:p.id,version:0,space_id:(0,r.C)(s.pointer.spaceId),parent_table:o.vF,parent_id:s.id,alive:!0,format:{attributes:[{id:"title",name:"title",type:"inline",format:{type:"title",section:"title"},values:[(0,d.ni)({pattern:n,integration:i})]}],bot_id:void 0,external_object_id:void 0,uri:`notion://user-defined-collection/${i.id}/${n.name}`,integration_id:i.id,is_placeholder:void 0,original_url:void 0,domain:void 0,external_schema:n.connected_relation_properties,sync_state:void 0,pattern_name:n.name,related_external_object_uris_to_instance_ids:m},schema:{}};return g.sW({store:p,data:f,transaction:c}),p}},950950:(e,t,n)=>{n.d(t,{wk:()=>D,Tz:()=>E,OM:()=>O,qo:()=>L,oG:()=>j,dd:()=>K,Nh:()=>F,a9:()=>U});n(667294);var o=n(815145),r=n(686658),i=n(674686),a=n(225972),s=n(568626),l=n(709291),c=n(653965),d=n(552629),u=n(215828),p=n(619584),m=n(21359),g=n(800480),f=n(724405),h=n(464939),v=n(110182),y=n(489728),b=n(785893);const _=function(){const e=(0,g.O7)(),t=(0,f.Fg)();return(0,b.jsxs)("div",{style:{display:"flex"},children:[(0,b.jsx)(y.Z,{onClick:()=>O(e,{necessary:!0,performance:!0,preference:!0,targeting:!0}),children:(0,b.jsx)("b",{style:{color:t.contentBackground},children:(0,b.jsx)(l.FormattedMessage,{...r.ze.acceptAllButtonLabel})})}),(0,b.jsx)(y.Z,{onClick:()=>O(e,{necessary:!0,performance:!1,preference:!1,targeting:!1}),children:(0,b.jsx)("b",{style:{color:t.contentBackground},children:(0,b.jsx)(l.FormattedMessage,{...r.ze.rejectAllButtonLabel})})}),(0,b.jsx)(v.Z,{hasDismissButton:!0,renderOrigin:e=>(0,b.jsx)(y.Z,{style:{paddingLeft:8,paddingRight:8},...e,children:(0,h.o)({width:14,marginLeft:4,fill:t.contentBackground})})})]})};var S=n(942402),k=n(855337),w=n(512955),x=n(433929),I=n(436867),C=n(80444),T=n(461893),M=n(45293),P=n(801310),A=n(547307);const R=(0,l.defineMessages)({cookieConsentSaveError:{id:"cookieConsent.saveError",defaultMessage:"Cannot record cookie consent, please try again later."}});async function D(e){const{environment:t,onboardingState:n}=e,{inAppCalloutStore:o}=C.default.state;if(await B(t)&&o.getCalloutVisibility("cookie_preference_popup").canShow)return(0,I.g)(t.currentUser.id)>=2?(N(),M.Z.setState({open:!0}),q({environment:t,type:"modal",onboardingState:n}),o.updateCalloutStatus({calloutId:"cookie_preference_popup",visible:!0,validateCanShow:!0}),void k.K4(t,"cookie_modal_shown")):void(P.ZP.state.currentItem||(o.updateCalloutStatus({calloutId:"cookie_preference_popup",visible:!0,validateCanShow:!0}),P.ZP.setState({...P.ZP.state,currentItem:{key:(0,u.ZP)(),label:(0,b.jsx)("div",{children:(0,r.Fd)(E,"snackbar")}),right:(0,b.jsx)(_,{})}}),q({environment:t,type:"snackbar",onboardingState:n})))}async function B(e){if(!(0,w.canSetCookie)(e))return!1;if(!(0,w.canShowCookieUi)(e))return!1;const t=await(0,w.getHasPermissionArgs)(e);return"true"===(null==t?void 0:t.notion_check_cookie_consent)&&(null==t||!t.notion_cookie_consent)}function E(e,t){return(0,b.jsx)(S.Z,{href:e,children:t})}function F(e,t){if("necessary"===t)return;const n={...T.Z.getState().permission};n[t]=!n[t],T.Z.setPermission(n),Z(e,n)}const Z=c.Ds(((e,t)=>{U(e,t)}),2e3);async function U(e,t){const n=await m.recordCookieConsent(e,{id:T.Z.getId(),permission:t,document_version:r.fV,userId:e.currentUser.id}).catch((e=>{V({type:"recordCookieConsentError",error:(0,d.Ui)(e)})}));if(!n)return void V({type:"recordCookieConsentEmptyResult"});if("success"!==n.type)return void V({type:"recordCookieConsentReturnsNonSuccess",data:{miscDataToConvertToString:{result:n}}});const s=n.data;await T.Z.setCookieConsent(e,s),o.e9();const l=await k.cG(e),c=o.Zk(l);await a.Pv(c);const{permission:u}=s;k.K4(e,"record_cookie_consent",{permission:u,consent_type:(0,i.JT)(u)})}function V(e){let{type:t,data:n,error:o}=e;A.showErrorMessage(x.default.formatMessage(R.cookieConsentSaveError)),s.log({level:"error",from:"cookieActions",type:t,data:n,error:o})}function N(){const{inAppCalloutStore:e}=C.default.state;e.updateCalloutStatus({calloutId:"cookie_preference_popup",visible:!1}),P.ZP.setState({...P.ZP.state,currentItem:void 0})}function O(e,t){U(e,t),N(),L()}function L(){A.showMessage({message:x.default.formatMessage(r.ze.reloadAfterSaveMessage),onAccept:()=>{window.location.reload()}})}async function j(e){const{currentUserSettingsStore:t}=C.default.state;if(!t)return;await t.load();const n=t.getSettings();if(!n)return;const o=n.cookie_consent;o?(await T.Z.setCookieConsent(e,o),N()):(T.Z.clearCookieConsent(),await B(e)&&T.Z.setPermission(r.cW))}async function K(e){const t=await(0,w.getCookieConsentCookie)(e);if(!t)return;const n=(0,p.dj)(t);n&&T.Z.setState(n)}const z={tracked:!1};function q(e){let{environment:t,type:n,onboardingState:o}=e;if(z.tracked)return;const r={type:n,onboardingStage:null==o?void 0:o.stage};k.K4(t,"cookie_banner_shown",r),z.tracked=!0}},141433:(e,t,n)=>{n.d(t,{Ns:()=>A,WO:()=>E,ZI:()=>D,fC:()=>R,jf:()=>B,nF:()=>P});n(21703),n(252262),n(324506),n(757658),n(45060);var o=n(180951),r=n(597531),i=n(320297),a=n(568626),s=n(842875),l=n(159730),c=n(915157),d=n(300482),u=n(719233),p=n(145953),m=n(421202),g=n(519889),f=n(421838),h=n(167175),v=n(401898),y=n(95477),b=n(27105),_=n(741195),S=n(583960),k=n(80444),w=n(206258),x=n(100952),I=n(496802),C=n(709953),T=n(800993),M=n(210228);const P="calloutBlockIcon",A="calloutBlockBackground";function R(e){var t,n,o;const{environment:r,createBlockItem:i,from:a,inMemoryRecordCache:s,transaction:l,useCrdt:c,selection:d}=e;if(!i.templateRootBlockId||!i.createTemplate)throw new Error("Invalid createBlock item.");const u=(d.length>0?d[0].getSpaceId():void 0)??(null===(t=k.default.state.currentSpaceStore)||void 0===t?void 0:t.id)??(null===(n=k.default.state.mainEditorCurrentBlockStore)||void 0===n?void 0:n.getSpaceId()),{targetBlockStore:g}=D({environment:r,sourceBlockId:i.templateRootBlockId,targetBlockPointer:(0,_.Ii)({environment:r,table:m.iU,spaceId:u}),sourceBlockSubtree:(0,p.R3)(i.createTemplate(r)),targetRecordCache:s,transaction:l,deepCopyTransclusionContainers:!0,resolveTemplateVariables:!1,useCrdt:c});if(null===(o=i.postCreateCallback)||void 0===o||o.call(i,g,r,l),B({store:g,transaction:l}),a&&i.blockType){var f,h;const e=i.collectionViewType,t="full_page"===e,n=0!==d.length?null===(f=d[0])||void 0===f?void 0:f.getParentCollectionIdUpToTwoLevels():void 0;let o,s,l,c;if("chart"===e){var v,y;const e=null===(v=g.getCollectionViewStores())||void 0===v?void 0:v.at(0);o=null==e||null===(y=e.getChartConfig())||void 0===y?void 0:y.type,s=null==e?void 0:e.getChartPlaceholderType()}if("form_editor"===e){var b;const e=null===(b=g.getCollectionViewStores())||void 0===b?void 0:b.at(0),t=null==e?void 0:e.getFormBlockStore();l=null==t?void 0:t.id,c=null==e?void 0:e.id}x.W(r,{from:a,type:i.blockType,collection_id:g.getAssociatedCollectionId()??(null===(h=g.getCollectionViewCollectionStore())||void 0===h?void 0:h.id),view_type:"inline"===e||"full_page"===e?"table":e,is_toggleable:i.isToggleable,automation_id:g.getAutomationId(),new_page_id:"page"===i.blockType?g.id:void 0,creating_block_id:g.id,parent_collection_id:n,is_full_screen:t,chart_type:"placeholder"===o?s:o,is_chart_placeholder:"placeholder"===o,form_id:l,view_id:c})}return g}function D(e){const{environment:t,sourceBlockId:n,sourceBlockSubtree:o,targetBlockPointer:c,targetRecordCache:u,transaction:p,deepCopyTransclusionContainers:f,resolveTemplateVariables:_,recordPointerMap:S,useCrdt:k,preventLegacyTransclusions:x,createLegacyTransclusionCopyIndicator:I,spaceIdCreator:T,duplicateDiscussions:P,installationImprint:A}=e,R=(0,b.p8)(k),D=t.currentUser.id,{duplicateRecordMap:B,originalToDuplicate:E}=i.PZ({sourceBlockId:n,targetBlockPointer:c,recordMap:o,recordPointerMap:S,options:{deepCopyTransclusionContainers:f,resolveTemplateVariables:!!_&&{currentUserId:D,currentTimeZone:(0,s.r)()},duplicateDiscussions:P},baseUrl:y.default.domainBaseUrl,publicDomainName:y.default.publicDomainName,actor:D?{table:g.KJ,id:D}:void 0,getRecordRole:u.makeGetRecordRoleFn(D),preventLegacyTransclusions:x,createLegacyTransclusionCopyIndicator:I,installationImprint:A,logWarning:e=>{"unmappedContentId"===e.type||("multiReferencedContentIds"===e.type?a.log({level:"warning",from:"createBlockActions",type:"multiReferencedContentIds",data:{ids:e.contentIds}}):(0,v.t1)(e))},spaceIdCreator:T}),F=new w.G(t,c,{inMemoryRecordCache:u});p.postPerformAssertions.push((function(){if(p.isLocal)return;if(!F.getParentStore())throw new l.p8(`Initialized template was not given a parent before being committed in transaction ${p.getUserActionForAnalyticsPurposesOnly()}`)}));for(const{model:i}of B)if(i)if(i.table===m.iU){var Z,U;const e=i.__IM_SORRY__getValue(),t=w.G.createChildStore(F,i.pointer),n=r.nY(i.getFormat()),o=r.nY((null===(Z=u.getRecord({pointer:i.pointer,userId:D}))||void 0===Z||null===(Z=Z.value)||void 0===Z?void 0:Z.format)??{}),a=d.op.update({pointer:i.pointer,path:["format"],args:(0,v.Yd)(o).reduce(((e,t)=>t in n&&void 0!==n[t]?e:{...e,[t]:null}),{})}),s=i.pointer.table===c.table&&i.pointer.id===c.id?null===(U=u.getRecord({pointer:i.pointer,userId:D}))||void 0===U?void 0:U.value:void 0,l=s?r.Ry({existingBlock:s,updatedBlock:e}).concat([a]):r.mz({block:e,useCrdt:R});for(const r of l)(0,h.Qf)(r)?M.applyCrdtTextOperation({store:t,operation:r,invertedOperation:void 0,transaction:p}):M.applyOperation({store:t,operation:r,transaction:p})}else{const e=i.__IM_SORRY__getValue(),t=(0,w.Kv)(F,i.pointer);C.sO({store:t,value:e,transaction:p})}return{targetBlockStore:F,originalToDuplicate:E}}function B(e){const{store:t,transaction:n}=e;"code"===t.getType()?function(e){const{store:t,transaction:n}=e,r=t.getProperties(),i=t.getFormat(),a=t.environment.currentUser.id,s=c.Z.get({userId:a,key:S.T.localLanguagePreferenceKey}),l=s&&u.W[s]?s:S.T.defaultLanguage,d=c.Z.get({userId:a,key:S.T.localCodeWrapPreferenceKey}),p=t.getBlockTitleStore(),m=p.getValue(),g=f.vNd(m);g&&T.sO({environment:t.environment,store:p,value:g,transaction:n});void 0===r.language&&C.sW({store:t.getPropertiesStore(),data:{language:o.O2(l)},transaction:n});void 0===i.code_wrap&&C.sW({store:t.getFormatStore(),data:{code_wrap:d},transaction:n})}({store:t,transaction:n}):"table_of_contents"===t.getType()?function(e){const{store:t,transaction:n}=e,o=t.getFormat();void 0===o.block_color&&I.FH({stores:[t],update:{block_color:"gray"},transaction:n})}({store:t,transaction:n}):"callout"===t.getType()?E({store:t,transaction:n}):"quote"===t.getType()&&function(e){const{store:t,transaction:n}=e,o=t.environment.currentUser.id,r=c.Z.get({userId:o,key:S.l.localSizePreferenceKey});void 0!==r&&C.sW({store:t.getFormatStore(),data:{quote_size:r},transaction:n})}({store:t,transaction:n})}function E(e){const{store:t,transaction:n}=e,o=t.environment.currentUser.id,r=c.Z.get({userId:o,key:P})??"💡",i=c.Z.get({userId:o,key:A})||"gray_background",a=t.getFormat();void 0===a.block_color&&I.FH({stores:[t],update:{block_color:i},transaction:n}),void 0===a.page_icon&&I.FH({stores:[t],update:{page_icon:""===r?void 0:r},transaction:n})}},579257:(e,t,n)=>{n.d(t,{D2:()=>v,Do:()=>h,M0:()=>g,W4:()=>f,bA:()=>p,xv:()=>m});var o=n(401898),r=n(485680),i=n(398452),a=n(206258),s=n(452258),l=n(250906),c=n(106404),d=n(496802),u=n(210228);function p(e){const{originRect:t}=e;s.Z.reset(),i.Z.reset(),c.xv(),r.Z.setState({isOpen:!0,rect:t})}function m(){r.Z.setState({isOpen:!1})}function g(e){const{format:t,store:n,property:o,visibility:r,transaction:i}=e,a=t.property_visibility;a&&d.FH({stores:[n],update:{property_visibility:Object.values(a||{}).map((e=>({property:e.property,visibility:o===e.property?r:e.visibility})))},transaction:i})}function f(e){const{store:t,pageSection:n,visibility:r,environment:i,format:s}=e,c=s.page_section_visibility;c&&(l.Mz(i,{section:n,visibility:r}),u.createAndCommit({userAction:"customizePageActions.updatePageSectionVisibility",environment:i,perform:e=>{d.FH({stores:t instanceof a.NW||t instanceof a.G?[t]:(0,o.t1)(t),update:{page_section_visibility:{...c,[n]:r}},transaction:e})}}))}function h(e){const{store:t,transaction:n,pageSectionFormats:r}=e;d.FH({stores:t instanceof a.NW||t instanceof a.G?[t]:(0,o.t1)(t),update:{collection_page_sections:r},transaction:n})}function v(e){const{store:t,properties:n,environment:r}=e;u.createAndCommit({userAction:"customizePageActions.updateCollectionPageProperties",environment:r,perform:e=>{d.FH({stores:t instanceof a.NW||t instanceof a.G?[t]:(0,o.t1)(t),update:{collection_page_properties:n},transaction:e})}})}},467133:(e,t,n)=>{n.d(t,{b:()=>a,x:()=>s});var o=n(328748),r=n(524677),i=n(898104);function a(e,t){r.ZH({environment:e}),i.clear({environment:e}),o.Z.setState({open:!0,...t})}function s(){o.Z.setState({open:!1,originRect:o.Z.state.originRect})}},99813:(e,t,n)=>{n.d(t,{Wl:()=>y,ji:()=>f,oi:()=>h});var o=n(643593),r=n(517755),i=n(568626),a=n(211342),s=n(937850),l=n(95477),c=n(288864),d=n(21359),u=n(247839),p=n(412714);function m(e){if(!Boolean(e.mobileNative))return!1;const{device:t}=e,n=(0,a.parseMobileAppVersion)(t.mobileAppVersion,t.isAndroid);return!!n&&(t.isIOS?(0,a.isGreaterThanOrEqualToVersion)(n,[0,4,669]):!!t.isAndroid&&(0,a.isGreaterThanOrEqualToVersion)(n,[0,6,735]))}async function g(e,t){return e.device.isElectron||e.device.isMobileNative?await d.getSignedFileUrl(e,t,!1):(0,r.g)({...t,baseURL:l.default.domainBaseUrl,currentUserId:e.currentUser&&e.currentUser.id})}async function f(e,t){let n=t.url;const a=e.mobileNative&&m(e),c=o.E$(t.url,[l.default.secureFileS3.url,l.default.secureFileS3V2.url]);c&&(a&&e.mobileNative.showLightBoxV2({url:void 0,downloadName:t.downloadName,type:"file",from:"download",state:"fetching"}),n=(await s.OI(r.nK,g(e,t))).result),n?c&&a?e.mobileNative.showLightBoxV2({url:n,downloadName:t.downloadName,type:"file",from:"download",state:"url_ready"}):c?v({environment:e,url:n}):p.D({environment:e,url:n}):(a&&e.mobileNative.showLightBoxV2({url:void 0,downloadName:t.downloadName,type:"file",from:"download",state:"error"}),i.log({level:"error",from:"routerActions",type:"openFileUrl",data:{message:`failed to get url for ${t.url}`}}))}function h(e,t){const n=e.mobileNative&&m(e);if(o.x$(t)&&n){const n=o.rF({title:void 0,source:t});e.mobileNative.showLightBoxV2({url:void 0,downloadName:n,type:"file",from:"download",state:"fetching"}),e.mobileNative.showLightBoxV2({url:t,downloadName:n,type:"file",from:"download",state:"url_ready"})}else v({environment:e,url:t})}function v(e){const{environment:t,url:n}=e;t.mobileNative?t.mobileNative.openInAppBrowser(n):t.device.isElectron?u.downloadUrl(n):window.location.href=n}async function y(e,t){c.QI(e,{from:"embedded_block_click",type:t.type});let n=t.url;const a=e.mobileNative&&m(e),d=o.E$(t.url,[l.default.secureFileS3.url,l.default.secureFileS3V2.url]);d&&(a&&e.mobileNative.showLightBoxV2({url:void 0,downloadName:t.downloadName,type:t.type,from:t.from,state:"fetching"}),n=(await s.OI(r.nK,g(e,t))).result),n?d&&a?e.mobileNative.showLightBoxV2({url:n,downloadName:t.downloadName,type:t.type,from:t.from,state:"url_ready"}):p.D({environment:e,url:n}):(a&&e.mobileNative.showLightBoxV2({url:void 0,downloadName:t.downloadName,type:t.type,from:t.from,state:"error"}),i.log({level:"error",from:"routerActions",type:"openFileUrl",data:{message:`failed to get url for ${t.url}`}}))}},42239:(e,t,n)=>{n.d(t,{LQ:()=>V,_4:()=>F,cQ:()=>B,eN:()=>N,f$:()=>U,fX:()=>E,td:()=>Z});n(757658);var o=n(541432),r=n(415095),i=n(842875),a=n(471924),s=n(23867),l=n(531701),c=n(653965),d=n(307032),u=n(401898),p=n(110906),m=n(601600),g=n(95477),f=n(855337),h=n(843250),v=n(798165),y=n(341984),b=n(827406),_=n(681844),S=n(95802),k=n(155367),w=n(400807),x=n(186486),I=n(27724),C=n(250906),T=n(547307),M=n(276725),P=n(311712),A=n(524677),R=n(498724),D=n(898104);function B(e,t){k.ZP.state.isDragging&&(k.ZP.reset(),A.$Y({environment:e,phase:I.SelectionPhase.Selected,preventClearEditingText:t}))}function E(e){if(k.ZP.state.isDragging){const{draggedStores:r,currentDropZone:i}=k.ZP.state,a=e.optionKey;let s;if(i){var t,n;const e=i.type===k.Dl.Selectable?S.C.findSelectablesFromStore(i.store):b.Z.findDropTargetsFromKey(i.key);null===(t=e.find((e=>Boolean(e.props.onSelectableDrop))))||void 0===t||null===(t=t.props)||void 0===t||null===(n=t.onSelectableDrop)||void 0===n||n.call(t,{droppedDirection:i.direction,droppedStores:r,duplicate:a}),s=function(e,t){const n=t.props,o="store"in n?n.store:void 0,r=o?_.Z.findOutlinerItemFromStore(o):void 0,i=o&&v.VP(o),a=i&&(0,f.nB)(i),s={...r&&{...a,type:r.type},..."analyticsName"in n&&{dropzone_from:n.analyticsName}};if(!e)return{...s,has_dropzone:!1};let l;switch(e.direction){case k.vh.Above:l="above";break;case k.vh.Below:l="below";break;case k.vh.Left:l="left";break;case k.vh.Onto:l="onto";break;case k.vh.Right:l="right";break;default:(0,u.t1)(e.direction)}if(e.type===k.Dl.Selectable)return{...s,has_dropzone:!0,dropzone_type:"selectable",dropzone_block_id:(0,d.cj)(e.store.id),dropzone_direction:l};return{...s,has_dropzone:!0,dropzone_type:"drop_target",dropzone_key:e.key,dropzone_direction:l}}(i,e[0])}const l=r.find((e=>{const t=e.getType();return Boolean(t&&(0,o.S9)(t))})),m=l&&v.VP(l),g=l&&(0,p.fm)(l);C.RO(e.environment,{draggedTypes:c.oA(r.map((e=>e.getType()))),from:e.analyticsFrom,asCopy:a,draggableProps:{draggable_from:e.analyticsFrom,...m&&(0,f.nB)(m)},dropzoneProps:s,optionalAnalyticsProperties:{collectionContextStore:g}}),B(e.environment),e.environment.device.isPhone&&A.ZH({environment:e.environment})}}function F(e){const{environment:t,files:n,analyticsFrom:o}=e;if(k.ZP.state.isDragging){var r;const e=k.ZP.state.currentDropZone;let s;var i,a;if(e)s=e.type===k.Dl.Selectable?S.C.findSelectableFromStore(e.store):b.Z.findDropTargetFromKey(e.key),null===(i=s)||void 0===i||null===(i=i.props)||void 0===i||null===(a=i.onNativeDrop)||void 0===a||a.call(i,{files:n,droppedDirection:e.direction});C.RO(t,{draggedTypes:[],from:o,asCopy:!1}),B(t,null===(r=s)||void 0===r?void 0:r.props.keepTextSelectionOnDrop)}}function Z(e,t){k.ZP.state.isDragging&&(D.clear({environment:e}),k.ZP.setState({...k.ZP.state,...t}))}function U(e,t){if(k.ZP.state.isDragging)return!1;{const{startX:n,startY:o,isNativeDrag:r}=t,i=A.aw(t.stores);D.clear({environment:e});const a=S.C.getRectFromStore(i[0]);return k.ZP.setState({isDragging:!0,startX:n,startY:o,currentX:n,currentY:o,offsetX:n-(a&&a.left||0),offsetY:o-(a&&a.top||0),currentHintDropZones:[],draggedStores:i,isNativeDrag:r,ghostElements:i.map((e=>t.getGhostElement?t.getGhostElement(e):function(e){const{store:t}=e,n=S.C.findSelectablesFromStore(t);return c.oA(n.map((e=>{if(e.props.canSelect){const t=e.getNode();if(t)return N(t)}})))}({store:e})))}),A.$Y({environment:e,phase:I.SelectionPhase.Selected}),x.default.reset(),!0}}function V(e){const{droppedStores:t,transaction:n,environment:r,duplicate:l,duplicateUseCrdt:c}=e,d=e.resolveTemplateVariables,u=t.map((e=>{if(!S.C.findSelectableFromStore(e))return e;if(l){const t=!e.isTransclusionType(),[i,a]=M.Qi({environment:r,stores:[e],addCopyName:(0,y.Z)(e),transaction:n,deepCopyTransclusionContainers:t,targetSpaceId:(0,s.C)(e.pointer.spaceId),resolveTemplateVariables:e.getType()!==o.Ti.factory&&d,baseUrl:g.default.domainBaseUrl,publicDomainName:g.default.publicDomainName,preferDuplicateLocation:"local",useCrdt:"same_as_store"===c?e.useCrdt():c}),l=i[0];return a.then((e=>{e&&T.showErrorMessage(e)})),l}return d&&R.bt({environment:r,store:e,context:{currentUserId:r.currentUser.id,currentTimeZone:(0,i.r)()},transaction:n}),P.Od({store:e,transaction:n}),e}));if(u.length>0&&"suggest"===w.Z.getMode(u[0])){const e=m.oG(r,n,u[0]);u.forEach((t=>{m.n1(n,t,{type:"insert",discussionId:e.id,id:a.Il()})})),m.vh({environment:r,transaction:n,discussionStore:e,addModifiedBlockIdsAfter:u.map((e=>e.id))})}return u}function N(e){const t=e.style.transform,n=e.style.transition;e.style.transform="",e.style.transition="";const o=e.getBoundingClientRect();e.style.transform=t,e.style.transition=n;const r=e.cloneNode(!0);!function(e,t){const{firstElementChild:n}=e;if(n&&n.hasAttribute("embed-ghost")){const n=O(e,[]);if(n){const r=L(e,n),i=L(t,n);if(r&&i)if(r.shadowRoot){const e=r.shadowRoot;let t=null;if(i.createShadowRoot)t=i.createShadowRoot();else if(i.attachShadow)try{t=i.attachShadow({mode:"open"})}catch(o){}t&&(t.innerHTML=e.innerHTML)}else if(!r.src&&r.contentDocument){const e=document.createElement("iframe");e.width=r.offsetWidth,e.height=r.offsetHeight,j(e,i),i.parentElement.replaceChild(e,i),e.onload=t=>{const n=e.contentDocument.children[0],o=r.contentDocument.children[0];j(n,o),n.innerHTML=o.innerHTML}}else i.width=r.offsetWidth,i.height=r.offsetHeight,i.style.backgroundColor=l.ZP.blackWithAlpha(.12),i.style.backgroundImage=null,i.src=""}}}(e,r);const i=getComputedStyle(e);for(let l=0;l<i.length;l++){const e=i[l],t=i.getPropertyValue(e);"app-region"===e&&"none"===t||"-webkit-text-fill-color"!==e&&(r.style[e]=t)}"absolute"!==i.position&&"relative"!==i.position||(r.style.position="",r.style.top="",r.style.left="",r.style.bottom="",r.style.right="");const a=r.querySelectorAll(`.${h.No6}`);for(const l of a)l.remove();r.style.pointerEvents="none";const s=r.querySelectorAll("*");for(const l of s)l.style&&(l.style.pointerEvents="none");return{cloned:r,rect:o}}function O(e,t){if(e.shadowRoot)return t;if(e instanceof HTMLIFrameElement)return t;{const{firstElementChild:n,nextElementSibling:o}=e;if(n){t.push(0);const e=O(n,t);if(e)return e;t.pop()}if(o){t[t.length-1]+=1;const e=O(o,t);if(e)return e}return null}}function L(e,t){return t.reduce(((e,t)=>e&&e.children&&e.children[t]?e.children[t]:null),e)}function j(e,t){r.p4(t.attributes).forEach((t=>{let{name:n,value:o}=t;e.setAttribute(n,o)}))}},191584:(e,t,n)=>{n.d(t,{O$:()=>w,Ui:()=>y,WO:()=>b,cR:()=>S,qN:()=>k,vQ:()=>_});var o=n(599405),r=n(23867),i=n(709291),a=n(218265),s=n(757549),l=n(547307),c=n(247839),d=n(95477),u=n(691924),p=n(107844),m=n(453730),g=n(21359),f=n(792625),h=n(215356);const v=(0,i.defineMessages)({authenticatingWithGoogle:{id:"googleDriveActions.authenticatingWithGoogle.loadingMessage",defaultMessage:"Authenticating with Google…"},googleLoginTitle:{defaultMessage:"Google login",id:"googleDriveActions.loginWithGoogleModal.title"}});async function y(e){const{environment:t,store:n,fileId:o,token:i}=e;await m.transactionQueue.awaitRecordTransaction(n.pointer);const a=await g.initializeGoogleDriveBlock(t,{block:{id:n.id,spaceId:(0,r.C)(n.pointer.spaceId)},fileId:o,token:i});if("failed"!==a.type)return a.data.file&&s.cV(t,{file_type:a.data.file.mimeType??void 0}),a.data;l.showError(a)}function b(e,t){g.refreshGoogleDriveBlock(e,{block:t})}async function _(e){const t=await g.getGoogleDriveAccounts(e,{});return"success"===t.type&&t.data.accounts?t.data:{accounts:[]}}function S(e,t){const{onSuccess:n,onFailure:o}=t;p.Z.setState({open:!0,onConfirm:async()=>{const t=await k(e);t&&t.token?n(t.token):o&&o()},onDecline:o})}async function k(e){const t=(0,u.eC)(e);let n=(0,o.createGoogleDrivePopupRedirect)(d.default.domainBaseUrl,{authType:t});if(n=t.redirectToAuth?n:await(0,u.HU)(e,n),e.device.isElectron)return void c.openExternalUrl(n);const r=await h.M(e,{width:610,height:700,url:n,titleMessage:v.googleLoginTitle});if(!r)return;const i=a.Qc(r);return await w(e,i.query.code)}async function w(e,t){if(!t)return;f.j({message:v.authenticatingWithGoogle});const n=await g.authWithGoogleForDrive(e,{code:t});if(f.x(),"failed"!==n.type)return s.L3(e,{integration_name:"google"}),n.data;{const e=n.error;console.error(e),l.showError(n)}}},276725:(e,t,n)=>{n.d(t,{E9:()=>z,K8:()=>G,Qi:()=>H,WJ:()=>q});n(757658),n(21703);var o=n(541432),r=n(597531),i=n(320297),a=n(842875),s=n(159730),l=n(264572),c=n(959753),d=n(145953),u=n(600606),p=n(798963),m=n(718844),g=n(421202),f=n(606287),h=n(213493),v=n(870279),y=n(933709),b=n(611318),_=n(23867),S=n(429369),k=n(421838),w=n(709291),x=n(937850),I=n(95477),C=n(833954),T=n(741195),M=n(278429),P=n(433929),A=n(635328),R=n(80444),D=n(788632),B=n(206258),E=n(100952),F=n(103022),Z=n(21359),U=n(141433),V=n(547307),N=n(929533),O=n(709953),L=n(800993),j=n(239865);const K=(0,w.defineMessages)({offlineError:{id:"duplicateActions.offlineError.message",defaultMessage:"Please go online to copy this block."},unknownError:{id:"duplicateActions.unknownError.message",defaultMessage:"An unknown error occurred."}});function z(e){const{environment:t,sourceBlockId:n,targetBlockPointer:o,sourceBlockSubtree:r,targetInMemoryRecordCache:a,addCopyName:s,deepCopyTransclusionContainers:l,resolveTemplateVariables:c,transaction:d,useCrdt:u,preventLegacyTransclusions:p,duplicateOnlyCollectionSchema:m,convertExternalObjectInstancesToPlaceholders:f,duplicateDiscussions:h,installationImprint:v}=e,y=[],{targetBlockStore:b,originalToDuplicate:_}=U.ZI({environment:t,sourceBlockId:n,targetBlockPointer:o,sourceBlockSubtree:r,targetRecordCache:a,transaction:d,deepCopyTransclusionContainers:l,resolveTemplateVariables:c,useCrdt:u,preventLegacyTransclusions:p,createLegacyTransclusionCopyIndicator:{onCreate(e){y.push(e)}},duplicateDiscussions:h,installationImprint:v});if(s&&b&&b.isNavigableBlock()){const e=b.getTitleStore();if(e){const n=e.getValue(),o=i.eb(n);L.sO({environment:t,store:e,value:o,transaction:d})}}if(y.length){const e=!D.Z.state.online;e&&V.showErrorMessage(P.default.formatMessage(K.offlineError));for(const n of y){const e=b.getSpaceId(),o=B.G.createChildStore(b,{table:g.iU,id:n.duplicateBlockId});q({environment:t,targetSpaceId:e,targetInMemoryRecordCache:a,transaction:d,userActionSuffix:" (legacy transclusion fix)",sourceBlocks:[{id:n.sourceBlockId,spaceId:e}],copyIndicators:[o],addCopyName:!1,deepCopyTransclusionContainers:l,resolveTemplateVariables:c,useCrdt:u,duplicateOnlyCollectionSchema:m,convertExternalObjectInstancesToPlaceholders:f??!1})}F.Sl(t,{offline:e,num_blocks_duplicated:y.length,user_action:d.getUserActionForAnalyticsPurposesOnly()})}return{targetBlockStore:b,originalToDuplicate:_}}function q(e){const{environment:t,sourceBlocks:n,targetInMemoryRecordCache:r,snapshotData:i,addCopyName:l,deepCopyTransclusionContainers:c,resolveTemplateVariables:d,transaction:u,targetSpaceId:p,convertExternalObjectInstancesToPlaceholders:m,useCrdt:g,duplicateOnlyCollectionSchema:f,userActionSuffix:h,installationImprint:v}=e;if(0===n.length)throw new Error("Must duplicate at least one block");const y=e.copyIndicators??n.map(((e,n)=>O.j4({environment:t,type:o.Ti.copyIndicator,inMemoryRecordCache:r,transaction:u,spaceId:p,useCrdt:g})));if(y.length!==n.length)throw new Error("copyIndicators must be same length as source blocks");const b=x.UZ();return u.postSubmitCallbacks.push((async e=>{if(e)(0,s.Jx)(e)?b.resolve((0,C.nX)(P.default.getIntl(),e)):b.resolve(P.default.formatMessage(K.unknownError));else{let e=u.getUserActionForAnalyticsPurposesOnly();h&&(e=`${e}${h}`);const o=Z.duplicateBlock(t,{sourceBlocks:n,targetBlocks:y.map((e=>({id:e.id,spaceId:e.getSpaceId()}))),snapshotData:i,addCopyName:l,deepCopyTransclusionContainers:c,resolveTemplateVariables:!!d&&{currentUserId:t.currentUser.id,currentTimeZone:(0,a.r)()},convertExternalObjectInstancesToPlaceholders:m,useCrdt:g,duplicateOnlyCollectionSchema:f,userAction:e,installationImprint:v});let r;for await(const t of o){for(const e of y)N.R(t,e.id);r=t}for(const t of y)N.h(t.id);if(!r)return void b.resolve(void 0);if(r.error){g?Z.deleteBlocks(t,{blocks:y.map((e=>({id:e.id,spaceId:(0,_.C)(e.pointer.spaceId)}))),permanentlyDelete:!1}):j.Tq({environment:t,blocks:y});const e=(0,C.HV)(P.default.getIntl(),r.error);b.resolve(e)}else b.resolve(void 0)}})),[y,b.promise]}function H(e){const{environment:t,stores:n,addCopyName:o,deepCopyTransclusionContainers:r,resolveTemplateVariables:i,transaction:a,targetSpaceId:s,preferDuplicateLocation:l,analyticsFrom:c,useCrdt:d,duplicateOnlyCollectionSchema:u,installationImprint:p}=e;if(0===n.length)throw new Error("Must duplicate at least one block");const m=n[0].getSpaceId();if(!n.every((e=>e.getSpaceId()===m)))throw new Error("All stores must be in the same space");if(n.length>1&&!n.every((e=>e.isTypedCollectionViewBlock())))throw new Error("Multiple source blocks only supported for grouped typed DB duplication");for(const g of n){const e=g.getRecordStoreAtRootPath().getValue();let n;const{currentSpaceStore:o}=R.default.getState();var f;if(o&&(null==e?void 0:e.parent_table)===S.e0&&(n=B.zX.createChildStore(o,{table:S.e0,id:e.parent_id})),e)E.W(t,{from:c??"copy",type:e.type,teamStore:n,is_toggleable:(0,A._A)(e.type,e.format),collection_id:g.getAssociatedCollectionId()??(null===(f=g.getCollectionViewCollectionStore())||void 0===f?void 0:f.id),new_page_id:"page"===e.type?g.id:void 0,creating_block_id:g.id,parent_collection_id:g.getParentCollectionIdUpToTwoLevels()})}const h=m!==s;if("local"===l&&1===n.length){const e=n[0],l=(0,M.hC)(),c=G(t,{blockId:e.id,inMemoryRecordCache:e.inMemoryRecordCache,allowCopyCollections:!1,requireFullSubtree:!0,skipTransclusionContainerChildren:!r,allowCopyExternalObjectInstances:!h,includeLegacyTransclusionBlockValues:l});if(c){const{targetBlockStore:n}=z({environment:t,sourceBlockId:e.id,targetBlockPointer:(0,T.Ii)({environment:t,table:g.iU,spaceId:s}),sourceBlockSubtree:c,targetInMemoryRecordCache:e.inMemoryRecordCache,addCopyName:o,deepCopyTransclusionContainers:r,resolveTemplateVariables:i,transaction:a,useCrdt:d,preventLegacyTransclusions:l,installationImprint:p});return[[n],Promise.resolve(void 0)]}}for(const g of n)if(g.inMemoryRecordCache!==t.defaultRecordCache.inMemoryRecordCache)throw new Error("Can only server duplicate from the environment.defaultRecordCache.inMemoryRecordCache.");const v=t.defaultRecordCache.inMemoryRecordCache;return D.Z.state.online||V.showErrorMessage(P.default.formatMessage(K.offlineError)),q({environment:t,sourceBlocks:n.map((e=>({id:e.id,spaceId:e.getSpaceId()}))),targetInMemoryRecordCache:v,addCopyName:o,transaction:a,deepCopyTransclusionContainers:r,resolveTemplateVariables:i,targetSpaceId:s,convertExternalObjectInstancesToPlaceholders:h,useCrdt:d,duplicateOnlyCollectionSchema:u,installationImprint:p})}function G(e,t){const{blockId:n,inMemoryRecordCache:i,allowCopyCollections:a,requireFullSubtree:s,skipTransclusionContainerChildren:_,allowCopyExternalObjectInstances:S,skipBlockContent:w,excludeCrdtData:x,includeLegacyTransclusionBlockValues:C,includeDiscussions:T,includeComments:M}=t,P=e.currentUser.id,A=d.Ak.create(),R=new Set,D=[{pointer:{table:g.iU,id:n},parentId:"doesn't matter"}];for(;D.length>0;){const e=D.shift();if(!e)continue;if(R.has(e.pointer.id))continue;const t=n===e.pointer.id;if((0,u.$O)(e.pointer,g.iU)){var B,E,F;const n=i.getRecord({pointer:e.pointer,userId:P});if(!n||!n.value){if(s)return;continue}const a=x?r.cX(n.value):n.value;if(C){if(!t&&a.parent_id!==e.parentId&&!e.isBlockContentChild)continue}else if(!t&&a.parent_id!==e.parentId)continue;if(a.type===o.Ti.externalObjectInstance&&!S)return;if(A.setValue(e.pointer,a),null!==(B=a.format)&&void 0!==B&&B.collection_pointer&&D.push({pointer:a.format.collection_pointer,parentId:a.id}),a.collection_id&&D.push({pointer:{table:f.vF,id:a.collection_id},parentId:a.id}),a.view_ids)for(const e of a.view_ids)D.push({pointer:{table:h.np,id:e,spaceId:a.space_id},parentId:a.id});if(!(w||_&&"transclusion_container"===a.type)){const e=c.kk5.fromBlock(a).getRenderableContentIds();for(const t of e)D.push({pointer:{table:g.iU,id:t},parentId:a.id,isBlockContentChild:!0})}const d=c.kk5.fromBlock(a).getNonContentChildren();for(const e of d)D.push({pointer:{table:g.iU,id:e},parentId:a.id,isBlockContentChild:!0});if(a.type===o.Ti.externalObjectInstance){var Z,U;const e=(null===(Z=a.format)||void 0===Z?void 0:Z.related_external_object_uris_to_instance_ids)&&Object.values(null===(U=a.format)||void 0===U?void 0:U.related_external_object_uris_to_instance_ids)||[];for(const t of e)D.push({pointer:{table:g.iU,id:t,spaceId:a.space_id},parentId:a.id})}if(a.properties)for(const e of Object.values(a.properties))if(e)for(const t of e)for(const e of k.hDy(t)){if(k.STW(e)){const t=k.TOT(e);D.push({pointer:{table:g.iU,id:t},parentId:a.id})}if(k.j0F(e)){const t=k.zW$(e),n=(0,l.A5)({url:t,baseUrl:I.default.domainBaseUrl,publicDomainName:I.default.publicDomainName});n&&D.push({pointer:{table:g.iU,id:n},parentId:a.id})}if(k.nSN(e)){const t=k.frW(e);t&&D.push({pointer:{table:g.iU,id:t,spaceId:a.space_id},parentId:a.id})}}if(null!==(E=a.format)&&void 0!==E&&E.automation_id&&D.push({pointer:{table:p.cv,id:a.format.automation_id,spaceId:a.space_id},parentId:a.id}),null!==(F=a.format)&&void 0!==F&&F.ai_instructions_page_pointer&&D.push({pointer:a.format.ai_instructions_page_pointer,parentId:a.id}),T&&a.discussions)for(const e of a.discussions)D.push({pointer:{table:y.qF,id:e,spaceId:a.space_id},parentId:a.id})}else if((0,u.$O)(e.pointer,f.vF)){var V,N;if(!a)return;const t=i.getRecord({pointer:e.pointer,userId:P});if(!t||!t.value){if(s)return;continue}if(t.value.parent_id!==e.parentId)continue;const n=t.value;A.setValue(e.pointer,n),i.forEachRecord(P,(t=>{let{model:n}=t;n.table===g.iU&&n&&n.parent_id===e.pointer.id&&n.alive&&D.push({pointer:n.pointer,parentId:e.pointer.id})}));const o=(null===(V=n.format)||void 0===V?void 0:V.automation_ids)??[];for(const e of o)D.push({pointer:{table:p.cv,id:e,spaceId:n.space_id},parentId:n.id});null!==(N=n.format)&&void 0!==N&&N.layout_pointer&&D.push({pointer:n.format.layout_pointer,parentId:n.id})}else if((0,u.$O)(e.pointer,h.np)){const t=i.getRecord({pointer:e.pointer,userId:P});if(!t||!t.value){if(s)return;continue}if(t.value.parent_id!==e.parentId)continue;A.setValue(e.pointer,t.value)}else if((0,u.$O)(e.pointer,p.cv)){const t=i.getRecord({pointer:e.pointer,userId:P});if(!t||!t.value){if(s)return;continue}if(t.value.parent_id!==e.parentId)continue;A.setValue(e.pointer,t.value);for(const e of t.value.action_ids??[])D.push({pointer:{table:m.Xj,id:e,spaceId:t.value.space_id},parentId:t.value.id})}else if((0,u.$O)(e.pointer,m.Xj)){const t=i.getRecord({pointer:e.pointer,userId:P});if(!t||!t.value){if(s)return;continue}if(t.value.parent_id!==e.parentId)continue;A.setValue(e.pointer,t.value);for(const e of t.value.blocks??[])D.push({pointer:{table:g.iU,id:e,spaceId:t.value.space_id},parentId:t.value.id})}else if((0,u.$O)(e.pointer,y.qF)){const t=i.getRecord({pointer:e.pointer,userId:P});if(!t||!t.value){if(s)return;continue}if(t.value.parent_id!==e.parentId)continue;if(A.setValue(e.pointer,t.value),M)for(const e of t.value.comments??[])D.push({pointer:{table:v.x_,id:e,spaceId:t.value.space_id},parentId:t.value.id})}else if((0,u.$O)(e.pointer,v.x_)){const t=i.getRecord({pointer:e.pointer,userId:P});if(!t||!t.value){if(s)return;continue}if(t.value.parent_id!==e.parentId)continue;A.setValue(e.pointer,t.value);for(const e of t.value.content??[])D.push({pointer:{table:g.iU,id:e,spaceId:t.value.space_id},parentId:t.value.id})}else if((0,u.$O)(e.pointer,b.Bh)){const t=i.getRecord({pointer:e.pointer,userId:P});if(!t||!t.value){if(s)return;continue}A.setValue(e.pointer,t.value);const n=c.kk5.fromValue(b.Bh,t.value);for(const o of n.getBlockChildrenPointers())D.push({pointer:o,parentId:e.pointer.id})}R.add(e.pointer.id)}return A}},850799:(e,t,n)=>{n.d(t,{Ej:()=>u,Xt:()=>s,bk:()=>p,cA:()=>d,iE:()=>l,t_:()=>c});n(21703);var o=n(471924),r=n(401898),i=n(400807),a=n(65028);function s(e){const{navigableBlockStore:t,editorModeConfig:n}=e;if(!t.isNavigableBlock())throw new Error("Can only set editor mode on navigable block.");i.Z.setStateForBlock(t.id,n)}function l(e){const{navigableBlockStore:t}=e;if(!t.isNavigableBlock())throw new Error("Can only clear editor mode on navigable block.");i.Z.state&&i.Z.clearStateForBlock(t.id)}function c(e){const{navigableBlockStore:t,mode:n}=e;"default"===n?p(e):"suggest"===n?u(e):"translate"===n||(0,r.t1)(n);let o=t;if(!t.isNavigableBlock()){const e=t.getNavigableBlockStore();if(!e)throw new Error("Store doesn't have a navigable block store.");o=e}const a=i.Z.state;i.Z.setState({...a,blockStoreMode:{...a.blockStoreMode,[o.id]:{...a.blockStoreMode[o.id],mode:n}}})}function d(e){const t=i.Z.getMode(e.navigableBlockStore);c({...e,mode:"default"===t?"suggest":"default"})}function u(e){const{environment:t,location:n}=e,r=o.Il();a.VI({environment:t,from:n,suggesting_session_id:r}),i.Z.setState({blockStoreMode:{...i.Z.state.blockStoreMode,[e.navigableBlockStore.id]:{...i.Z.state.blockStoreMode[e.navigableBlockStore.id],startMilliseconds:Date.now(),sessionId:r}}})}function p(e){const{environment:t,location:n}=e,o=i.Z.state.blockStoreMode[e.navigableBlockStore.id];o.sessionId&&o.startMilliseconds&&a.Zv({environment:t,from:n,suggesting_session_id:o.sessionId,duration_ms:Date.now()-o.startMilliseconds}),i.Z.setState({blockStoreMode:{...i.Z.state.blockStoreMode,[e.navigableBlockStore.id]:{...i.Z.state.blockStoreMode[e.navigableBlockStore.id],startMilliseconds:void 0,sessionId:void 0}}})}},247839:(e,t,n)=>{n.r(t),n.d(t,{appUpdateAvailable:()=>j,appUpdateChecking:()=>L,appUpdateError:()=>O,appUpdateFinished:()=>q,appUpdateInstall:()=>H,appUpdateNotAvailable:()=>K,appUpdateProgress:()=>z,appUpdateReady:()=>N,checkForUpdates:()=>E,clearBrowserHistory:()=>x,clearCookies:()=>he,clearGoogleAuthCookies:()=>ve,closeGlobalSearchModal:()=>De,closeQuickSearch:()=>Fe,downloadUrl:()=>ye,electronApi:()=>m,electronAppFeatures:()=>Ie,electronCurrentTab:()=>b,electronTabs:()=>y,electronUpdateAvailable:()=>Z,electronUpdateChecking:()=>F,electronUpdateError:()=>B,electronUpdateNotAvailable:()=>U,electronUpdateProgress:()=>V,electronUpdateReady:()=>D,fullscreen:()=>$,getCurrentZoom:()=>X,getDesktopVersion:()=>g,getSubstitutions:()=>le,handleBackMetaClick:()=>I,handleBackPinnedClick:()=>T,handleForwardMetaClick:()=>C,handleForwardPinnedClick:()=>M,handleTabClicked:()=>v,handleTabHistoryMenu:()=>P,initializeElectron:()=>we,installElectronUpdate:()=>G,isActiveTab:()=>Pe,isMainTabOrWindow:()=>ce,isProtocolRegistered:()=>Se,isRunningUnderArm64Translation:()=>W,isWindowVisible:()=>Ae,navigationReady:()=>ke,newTab:()=>h,onNewWindow:()=>pe,openAppMenu:()=>re,openDevTools:()=>ie,openExternalUrl:()=>k,openGoogleDrivePickerPopup:()=>ge,openInNewTab:()=>f,openInNewWindow:()=>_,openMailWindow:()=>We,openNotificationUrl:()=>w,openNotionAiFromQuickSearch:()=>qe,openNotionUrl:()=>S,openOauthPopup:()=>me,openPageFromGlobalSearch:()=>Be,openQuickSearchResult:()=>Ze,openQuickSearchShortcutSetting:()=>je,openSearchModalForNewTab:()=>He,openSearchModalFromQuickSearch:()=>ze,openTabFromQuickSearch:()=>Ee,performShortcut:()=>Ye,quickSearchNotReady:()=>Ve,quickSearchReady:()=>Ue,quickSearchRefresh:()=>Le,quickSearchRenderCompleted:()=>Ne,quickSearchSetSearchAssistantMode:()=>Oe,quickSearchVisibilityState:()=>Ke,refreshAll:()=>xe,setAppStoreState:()=>Me,setBadge:()=>A,setGlobalShortcutsEnabled:()=>$e,setIsMediaActive:()=>Ge,setLogglyData:()=>fe,setOverlay:()=>R,setTabBreadcrumbs:()=>se,setTabColors:()=>ue,setTheme:()=>de,setWindowTitle:()=>ae,sidebarState:()=>Ce,subscribeToProtocolUrl:()=>be,subscribeToSettingsMenuItem:()=>_e,toggleMaximized:()=>oe,track:()=>Re,windowSidebarState:()=>Te,zoomIn:()=>ee,zoomOut:()=>te,zoomReset:()=>ne});n(397391);var o=n(840654),r=n(568626),i=n(564850),a=n(653965),s=n(552629),l=n(218265),c=n(608055);function d(){const e=function(e){const t=e.match(/Mac OS X (\d+_\d+)/);if(t)return t[1].split("_").map((e=>parseInt(e,10)));return}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator.userAgent);return!!e&&(10===e[0]&&e[1]<15)}var u=n(514404);let p="lastProtocolUrlDeduplicationId";const m=u.electronApi,g=u.getDesktopVersion;function f(e){const t=l.T1(e.url);m&&(m.openInNewTab?m.openInNewTab(t,Boolean(e.makeTabActive),e.position||"after-children",e.isNewPage):m.openInNewWindow(t))}function h(e){m&&null!=m&&m.newTab?m.newTab():f({url:"",makeTabActive:!0,position:e?"end":"start"})}function v(e){m&&null!=m&&m.handleTabClicked&&m.handleTabClicked(e)}const y={addListener(e){m&&m.electronTabs&&m.electronTabs.addListener(e)},removeListener(e){m&&m.electronTabs&&m.electronTabs.removeListener(e)}},b={addListener(e){m&&m.electronCurrentTab&&m.electronCurrentTab.addListener(e)},removeListener(e){m&&m.electronCurrentTab&&m.electronCurrentTab.removeListener(e)}};function _(e){const t=l.T1(e);null==m||m.openInNewWindow(t)}function S(e){let{openInNew:t,url:n,makeTabActive:o,position:r,isNewPage:i}=e;"tab"!==t?"window"!==t||_(n):f({url:n,position:r,makeTabActive:o,isNewPage:i})}async function k(e){if(!m)return!1;return void 0!==l.yn(e)&&await m.openExternalUrl(e)}function w(e,t){null!=m&&m.openNotificationUrl?m.openNotificationUrl(e):c.c4({environment:t,url:e})}function x(){null==m||m.clearBrowserHistory()}function I(){var e;null==m||null===(e=m.navigationHistory)||void 0===e||e.handleBackMetaClick()}function C(){var e;null==m||null===(e=m.navigationHistory)||void 0===e||e.handleForwardMetaClick()}function T(){var e,t;null==m||null===(e=m.navigationHistory)||void 0===e||null===(t=e.handleBackPinnedClick)||void 0===t||t.call(e)}function M(){var e,t;null==m||null===(e=m.navigationHistory)||void 0===e||null===(t=e.handleForwardPinnedClick)||void 0===t||t.call(e)}function P(e,t,n){var o;null==m||null===(o=m.navigationHistory)||void 0===o||o.handleTabHistoryMenu(e,t,n)}function A(e){return null==m?void 0:m.setBadge(e)}function R(e){var t;return null==m||null===(t=m.setOverlay)||void 0===t?void 0:t.call(m,e)}const D={addListener(e){null==m||m.updateReady.addListener(e)},removeListener(e){null==m||m.updateReady.removeListener(e)}},B={addListener(e){var t;null==m||null===(t=m.updateError)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.updateError)||void 0===t||t.removeListener(e)}};function E(){var e;null==m||null===(e=m.checkForUpdates)||void 0===e||e.call(m)}const F={addListener(e){var t;null==m||null===(t=m.updateChecking)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.updateChecking)||void 0===t||t.removeListener(e)}},Z={addListener(e){var t;null==m||null===(t=m.updateAvailable)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.updateAvailable)||void 0===t||t.removeListener(e)}},U={addListener(e){var t;null==m||null===(t=m.updateNotAvailable)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.updateNotAvailable)||void 0===t||t.removeListener(e)}},V={addListener(e){var t;null==m||null===(t=m.updateProgress)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.updateProgress)||void 0===t||t.removeListener(e)}},N={addListener(e){var t;null==m||null===(t=m.appUpdateReady)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.appUpdateReady)||void 0===t||t.removeListener(e)}},O={addListener(e){var t;null==m||null===(t=m.appUpdateError)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.appUpdateError)||void 0===t||t.removeListener(e)}},L={addListener(e){var t;null==m||null===(t=m.appUpdateChecking)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.appUpdateChecking)||void 0===t||t.removeListener(e)}},j={addListener(e){var t;null==m||null===(t=m.appUpdateAvailable)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.appUpdateAvailable)||void 0===t||t.removeListener(e)}},K={addListener(e){var t;null==m||null===(t=m.appUpdateNotAvailable)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.appUpdateNotAvailable)||void 0===t||t.removeListener(e)}},z={addListener(e){var t;null==m||null===(t=m.appUpdateProgress)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.appUpdateProgress)||void 0===t||t.removeListener(e)}},q={addListener(e){var t;null==m||null===(t=m.appUpdateFinished)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.appUpdateFinished)||void 0===t||t.removeListener(e)}},H={addListener(e){var t;null==m||null===(t=m.appUpdateInstall)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.appUpdateInstall)||void 0===t||t.removeListener(e)}};function G(){null==m||m.installUpdate()}function W(){var e;return null==m||null===(e=m.isRunningUnderArm64Translation)||void 0===e?void 0:e.call(m)}const $={get:()=>null==m?void 0:m.fullscreen.get(),addListener(e){null==m||m.fullscreen.addListener(e)},removeListener(e){null==m||m.fullscreen.removeListener(e)}};function Y(e,t,n){return Math.min(Math.max(e,n),t)}let Q,J=1;function X(){return J}function ee(){m&&m.zoom&&(J+=o.to,m.zoom.set(Y(o.x_,o.A_,J)))}function te(){m&&m.zoom&&(J-=o.to,m.zoom.set(Y(o.x_,o.A_,J)))}function ne(){m&&m.zoom&&(J=o.lO,m.zoom.set(J))}function oe(){m&&m.toggleMaximized&&m.toggleMaximized()}function re(){m&&m.openAppMenu&&m.openAppMenu()}function ie(){m&&m.openDevTools&&m.openDevTools()}function ae(e){m&&m.setWindowTitle&&m.setWindowTitle(e)}function se(e){m&&m.setTabBreadcrumbs&&m.setTabBreadcrumbs(e)}function le(){return Q||[]}async function ce(){return m&&m.isMainTab?m.isMainTab():!m||!m.isMainWindow||m.isMainWindow()}function de(e){m&&m.setTheme&&m.setTheme(e)}function ue(e){m&&m.setTabColors&&m.setTabColors(e)}function pe(e){m&&m.newWindow&&m.newWindow.addListener(e)}async function me(e){if(m&&m.openOauthPopup)return m.openOauthPopup(e)}async function ge(e){if(m&&m.openGoogleDrivePickerPopup)return m.openGoogleDrivePickerPopup(e)}function fe(e){m&&(m.setLoggerData?m.setLoggerData(e):m.setLogglyData&&m.setLogglyData(e))}function he(){m&&m.clearCookies&&m.clearCookies()}function ve(){m&&m.clearAllCookies&&m.clearAllCookies()}function ye(e){m&&m.downloadUrl&&m.downloadUrl(e)}function be(e){m&&m.onNavigate&&m.onNavigate.addListener(((t,n)=>{if("string"!=typeof n&&n.deduplicationID){const e=n.deduplicationID;if(p===e)return void r.log({level:"warning",from:"electronActions",type:"duplicateOnNavigateObjectDetected"});p=e}e(n)}))}function _e(e){m&&m.onOpenSettings&&m.onOpenSettings.addListener(((t,n)=>e(n)))}async function Se(e){return!(!m||!m.isProtocolRegistered)&&m.isProtocolRegistered(e)}function ke(e){m&&m.navigationReady&&m.navigationReady(e)}async function we(e){const{device:t,electronSqlite:n}=e;if(m){if(await u.getAndCacheDesktopVersionAsync(),/WantsServiceWorker/i.test(navigator.userAgent)&&"serviceWorker"in navigator&&(navigator.serviceWorker.register(`${window.location.origin}/sw.js`,{type:"classic",scope:"/"}).catch((e=>{window.location.hostname.includes("localhost")||r.log({level:"error",from:"electronActions",type:"serviceWorkerRegistrationError",error:(0,s.Ui)(e)})})),navigator.serviceWorker.addEventListener("controllerchange",(()=>{window.location.reload()})),m.relayMessageToServiceWorker&&m.relayMessageToServiceWorker.addListener(((e,t)=>{"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((e=>{var n;null===(n=e.active)||void 0===n||n.postMessage(t)}))})),m.relayMessageFromServiceWorker&&navigator.serviceWorker.addEventListener("message",(e=>{m&&m.relayMessageFromServiceWorker&&m.relayMessageFromServiceWorker(e.data)}))),m.zoom&&(J=await m.zoom.get()),n&&n.sqliteConnection){try{await n.sqliteConnection.ensureMigrated()}catch(o){r.log({level:"error",from:"electronActions",type:"sqliteConnectionEnsureMigratedError",error:(0,s.Ui)(o),data:(0,i.fq)(o,{isBrowser:!1,wasmSqliteStorage:void 0})})}n.sqliteConnection.optimize().catch((e=>{r.log({level:"error",from:"electronActions",type:"sqliteConnectionOptimizeError",error:(0,s.Ui)(e),data:(0,i.fq)(e,{isBrowser:!1,wasmSqliteStorage:void 0})})}))}if(m.getSubstitutions&&t.isElectronMac){const e=await m.getSubstitutions();Q=e.filter((e=>e.replace!==e.with)).map((e=>({length:e.replace.length,replace:new RegExp(`\\b${a.hr(e.replace)} $`),with:`${e.with} `})))}t.isElectronMac&&d()&&Ie.setPreference("isAutoUpdaterDisabled",!0)}}function xe(e){m&&m.refreshAll&&m.refreshAll(e.includeFocusedWindow)}const Ie={get(){if(m&&m.electronAppFeatures)return m.electronAppFeatures.get()},setPreference(e,t){var n;m&&null!==(n=m.electronAppFeatures)&&void 0!==n&&n.setPreference&&m.electronAppFeatures.setPreference(e,t)},addListener(e){m&&m.electronAppFeatures&&m.electronAppFeatures.addListener(e)},removeListener(e){m&&m.electronAppFeatures&&m.electronAppFeatures.removeListener(e)}},Ce={set(e){m&&m.sidebarState&&m.sidebarState.set(e)},addSetSidebarOpenListener(e){var t;m&&null!==(t=m.sidebarState)&&void 0!==t&&t.addSetSidebarOpenListener&&m.sidebarState.addSetSidebarOpenListener(e)},removeSetSidebarOpenListener(e){var t;m&&null!==(t=m.sidebarState)&&void 0!==t&&t.removeSetSidebarOpenListener&&m.sidebarState.removeSetSidebarOpenListener(e)},addToggleListener(e){m&&m.sidebarState&&m.sidebarState.addToggleListener(e)},removeToggleListener(e){m&&m.sidebarState&&m.sidebarState.removeToggleListener(e)}},Te={set(e){m&&m.windowSidebarState&&m.windowSidebarState.set(e)},addListener(e){m&&m.windowSidebarState&&m.windowSidebarState.addListener(e)},removeListener(e){m&&m.windowSidebarState&&m.windowSidebarState.removeListener(e)}};function Me(e){m&&m.setAppStoreState&&m.setAppStoreState(e)}const Pe={get:()=>m&&m.isActiveTab?m.isActiveTab.get():Promise.resolve(!1),addListener(e){m&&m.isActiveTab&&m.isActiveTab.addListener(e)},removeListener(e){m&&m.isActiveTab&&m.isActiveTab.removeListener(e)}};async function Ae(){return m&&m.windowIsVisible?m.windowIsVisible():"visible"===document.visibilityState}const Re={addListener(e){m&&m.track&&m.track.addListener(e)},removeListener(e){m&&m.track&&m.track.removeListener(e)}};function De(){m&&m.closeGlobalSearchModal&&m.closeGlobalSearchModal()}function Be(e){m&&m.openPageFromGlobalSearch&&m.openPageFromGlobalSearch(e)}function Ee(){m&&m.openTabFromQuickSearch&&m.openTabFromQuickSearch()}function Fe(){m&&m.closeQuickSearch&&m.closeQuickSearch()}function Ze(e){m&&m.openQuickSearchResult&&m.openQuickSearchResult(e)}function Ue(){m&&m.quickSearchReady&&m.quickSearchReady()}function Ve(){m&&m.quickSearchNotReady&&m.quickSearchNotReady()}function Ne(){m&&m.quickSearchRenderCompleted&&m.quickSearchRenderCompleted()}function Oe(e){m&&m.quickSearchSetSearchAssistantMode&&m.quickSearchSetSearchAssistantMode(e)}function Le(){m&&m.quickSearchRefresh&&m.quickSearchRefresh()}function je(){m&&m.openQuickSearchShortcutSetting&&m.openQuickSearchShortcutSetting()}const Ke={isVisible:()=>m&&m.quickSearchVisibilityState?m.quickSearchVisibilityState.isVisible():Promise.resolve(!1),addListener(e){m&&m.quickSearchVisibilityState&&m.quickSearchVisibilityState.addListener(e)},removeListener(e){m&&m.quickSearchVisibilityState&&m.quickSearchVisibilityState.removeListener(e)}},ze={addListener(e){m&&m.openSearchModalFromQuickSearch&&m.openSearchModalFromQuickSearch.addListener(e)},removeListener(e){m&&m.openSearchModalFromQuickSearch&&m.openSearchModalFromQuickSearch.removeListener(e)}},qe={addListener(e){m&&m.openNotionAiFromQuickSearch&&m.openNotionAiFromQuickSearch.addListener(e)},removeListener(e){m&&m.openNotionAiFromQuickSearch&&m.openNotionAiFromQuickSearch.removeListener(e)}},He={addListener(e){m&&m.openSearchModalForNewTab&&m.openSearchModalForNewTab.addListener(e)},removeListener(e){m&&m.openSearchModalForNewTab&&m.openSearchModalForNewTab.removeListener(e)}};function Ge(e){m&&m.setIsMediaActive&&m.setIsMediaActive(e)}function We(){m&&m.openMailWindow&&m.openMailWindow()}function $e(e){m&&m.setGlobalShortcutsEnabled&&m.setGlobalShortcutsEnabled(e)}const Ye={addListener(e){var t;null==m||null===(t=m.performShortcut)||void 0===t||t.addListener(e)},removeListener(e){var t;null==m||null===(t=m.performShortcut)||void 0===t||t.removeListener(e)}}},459650:(e,t,n)=>{n.d(t,{m:()=>i});var o=n(218265);const r=n(514404).electronMailApi;async function i(e){if(!r)return!1;return void 0!==o.yn(e)&&await r.openExternalUrl(e)}},631781:(e,t,n)=>{n.d(t,{vW:()=>E,z:()=>Z,TH:()=>j,I:()=>V,qC:()=>F,qL:()=>O,x1:()=>K,cT:()=>U});n(757658);var o=n(701302),r=n(541432),i=n(180951),a=n(895538),s=n(643593),l=n(421838),c=n(709291),d=n(21359),u=n(448948),p=n(95477),m=n(433929),g=n(645010),f=n(318245),h=n(58202),v=n(453809),y=n(430548);const b=new v.D({key:"urlTurnedBookmarkToastStatusSetting",namespace:y.$p,important:!0,trackingType:"preference"});var _=n(385555),S=n(27411),k=n(288864),w=n(659301),x=n(99813),I=n(762365),C=n(496802),T=n(627153),M=n(709953),P=n(164964),A=n(800993),R=n(210228),D=n(977357);const B=(0,c.defineMessages)({urlTurnedBookmark:{id:"action.urlTurnedBookmark.snackBarMessage",defaultMessage:"Pasted url is not embeddable, turned to bookmark instead!"}});let E=function(e){return e[e.Page=0]="Page",e[e.PageComment=1]="PageComment",e[e.SidebarComment=2]="SidebarComment",e}({});function F(e){return e===E.PageComment||e===E.SidebarComment}function Z(e){const{environment:t,files:n,inMemoryRecordCache:o,transaction:r,pageWidth:i,ignoreOversizedFiles:a,spaceId:s,useCrdt:l}=e;return n.filter((e=>{if(a){if(!D.Q7({environment:t,file:e,preventLimitFreeFileSize:!1}))return D.A3(t),!1}return!0})).map((e=>{if(e.type&&(e.type.startsWith("image")||e.type.startsWith("video")||e.type.startsWith("audio"))&&!e.type.includes("photoshop")){const n=M.j4({environment:t,type:"embed",inMemoryRecordCache:o,transaction:r,spaceId:s,useCrdt:l});return r.postSubmitCallbacks.push((o=>{o||U({environment:t,store:n,file:e,pageWidth:i,preferredType:void 0})})),n}{const n=M.j4({environment:t,type:"file",inMemoryRecordCache:o,transaction:r,spaceId:s,useCrdt:l});return r.postSubmitCallbacks.push((o=>{o||I.c({environment:t,store:n,file:e})})),n}}))}function U(e){const{environment:t,store:n,file:r,pageWidth:i,preferredType:s}=e,l=S.default.getBlockKey(n.id);let c;T.Z();const d=_.default.checkGate({gateName:"uploads_retry_embeds_immediately"});D.cT({environment:t,file:r,bucket:"secure",record:n.pointer,reportRichUploadMetrics:!0,onStart:e=>{if(c=f.default.DO_NOT_USE_markLegacy("image_upload"),S.default.setKeyState(l,{progressPercent:0,file:r,name:e.name,size:e.size}),r.type.indexOf("image")>=0&&!(0,a.y_)(e.name,"tiff")&&!(0,a.y_)(e.name,"tif")){const e=URL.createObjectURL(r),a=new Image;a.onload=function(){N(t,{store:n,width:a.naturalWidth,height:a.naturalHeight,scale:!0,type:"image",pageWidth:i}),t.device.isMobile&&o.default.afterNextFlush((()=>{g.Z.PageScroller&&g.Z.PageScroller.scrollerHack()})),URL.revokeObjectURL(e)},a.src=e}else{const e=(0,a.Dz)({url:r.name||"",baseUrl:p.default.domainBaseUrl,publicDomainName:p.default.publicDomainName,preferredType:s});N(t,{store:n,width:i,type:e,pageWidth:i})}},onProgress:e=>{const t=S.default.getKeyState(l);t&&S.default.setKeyState(l,{...t,progressPercent:e.progressPercent})},onComplete:async e=>{const o=S.default.getKeyState(l);if(o){const a=Boolean(o.dataURL),d=o.name,u=o.size;await V(t,{source:e,store:n,isDataURL:a,pageWidth:i,preferredType:s,name:d,size:u}),r.type.indexOf("image")>=0&&(w.M(t,{blockId:n.id,fileIds:n.getFileIds(),fileSize:r.size,fileType:r.type}),f.default.DO_NOT_USE_measureLegacy(c,{environment:t,data:{success:!0,type:r.type}})),S.default.setKeyState(l,void 0)}},onError:e=>{f.default.DO_NOT_USE_measureLegacy(c,{environment:t,data:{success:!1,type:r.type}}),S.default.setKeyState(l,void 0)},retryWhenOffline:!0,retryImmediatelyAfterFailure:d})}async function V(e,t){const{store:n,source:o,isDataURL:i,pageWidth:s,preferredType:c,name:g,size:h}=t;let v=i?"image":(0,a.Dz)({url:o,baseUrl:p.default.domainBaseUrl,publicDomainName:p.default.publicDomainName,preferredType:c});const y=function(e,t){const n=/^https?:\/\//i,o=/^https:\/\/[^\/]+\.streamlit\.app/;return"maps"===e?n.test(t)?_.default.checkGate({gateName:"remove_apostrophe_for_maps_url"})?t.replace(/'/g,""):t:`https://maps.google.com/maps/search/${encodeURIComponent(t)}`:"embed"===e&&o.test(t)?`${t}?embed=true`:(0,a.x$)(t)}(v,o),{properties:S,type:w,format:x}=await(0,a.Ol)({source:y,type:v,isDataURL:i,pageWidth:s,isMobileDevice:e.device.isMobile,getEmbedData:async t=>{const n=await d.getGenericEmbedBlockData(e,t);return"failed"===n.type?void console.error(n.error):n.data},trackEmbedType:t=>k.Jg(e,{embedType:t})});if(v=w,v===r.Ti.bookmark){const o=n;return await u.Ke({environment:e,store:o,url:y,transformTimeout:0}),k.mC(e),function(){if("do_not_prompt"===b.state)return;b.state?"displayed_once"===b.state?b.setState("displayed_twice"):"displayed_twice"===b.state&&b.setState("do_not_prompt"):b.setState("displayed_once");P.oV({label:m.default.formatMessage(B.urlTurnedBookmark)})}(),void(t.metric&&f.default.measure(t.metric,{environment:e,data:{embedType:v}}))}let I,T;k.Gl(e,{embedType:w}),g&&h&&(I={size:l.TPx(h)},T=l.TPx(g));const{serverCommitResult:D}=R.createAndCommit({userAction:"embedBlockActions.initializeEmbedBlock",environment:e,perform:t=>{M.sW({store:n.getPropertiesStore(),data:{...S||{},...I},transaction:t}),T&&A.sO({environment:e,store:n.getBlockTitleStore(),value:T,transaction:t}),C.FH({stores:[n],update:x,transaction:t}),M.sW({store:n,data:{type:v},transaction:t})}});await D,t.metric&&f.default.measure(t.metric,{environment:e,data:{embedType:v}})}function N(e,t){let{store:n,...o}=t;R.createAndCommit({userAction:"embedBlockActions.initializeFormat",environment:e,perform:e=>{C.FH({stores:[n],update:(0,a.tj)(o),transaction:e})}})}async function O(e,t){const{store:n}=t,o=n.getProperties();if(o){const d=n.getType(),u=d===r.Ti.bookmark?o.link:o.source,p=i.zB(u),m=l.QaF(o.title),{display_source:g,original_url:f}=n.getFormat(),h=n.isExternalObjectInstanceBlockStore()?f:p||g;let v;h&&(v=s.rF({title:m,source:h}));let y="file";var a,c;if("image"===d?y="image":"video"===d&&(y="video"),h)await x.Wl(e,{url:h,downloadName:v,type:y,from:t.from,permissionRecord:t.store.pointer,download:(null===(a=v)||void 0===a?void 0:a.endsWith(".html"))||(null===(c=v)||void 0===c?void 0:c.endsWith(".htm"))})}}const L=(0,c.defineMessages)({downloadingImage:{id:"embedBlockActions.downloading.label",defaultMessage:"Downloading…"}});async function j(e){const{store:t,environment:n}=e,o=await async function(e){let{store:t,environment:n,calledFrom:o}=e;const r=t.getNavigableBlockStore();if(!r)return;const i=await d.getBlockFileDownloadUrl(n,{blockId:t.id,pageBlockId:r.id,meta:{name:o}});if("success"!==i.type)return;const{url:a,fileName:s}=i.data;return{url:a,fileName:s}}({store:t,environment:n,calledFrom:"downloadSource"});if(!o)return;const{url:r,fileName:i}=o;if(r){let o;k.Uk(n,{url:r,from:"embedBlockActions"}),o=s.E$(r,[p.default.secureFileS3.url,p.default.secureFileS3V2.url])?x.ji(n,{url:r,download:!0,downloadName:i,permissionRecord:t.pointer}):function(e){const{store:t,environment:n}=e;if(!n.currentUser.id)return Promise.resolve();const o=t.getProperties(),r=l.QaF(null==o?void 0:o.source),i=l.QaF(null==o?void 0:o.caption);return s._H(r,t.pointer,p.default.domainBaseUrl,n.currentUser.id,i)}(e),P.oV({label:m.default.formatMessage(L.downloadingImage),durationMs:"keep"}),await o.finally((()=>{P.rN()}))}}function K(e){const{store:t}=e,n=h.R.findBlockFromStoreWithMethod(t,"replace");n&&n.replace()}},489951:(e,t,n)=>{n.d(t,{KT:()=>U,RL:()=>V,f_:()=>Z,xv:()=>N});var o=n(701302),r=n(541432),i=n(895538),a=n(643593),s=n(599405),l=n(421202),c=n(213493),d=n(421838),u=n(653965),p=n(21359),m=n(95477),g=n(269783),f=n(721429),h=n(963085),v=n(389224),y=n(58202),b=n(704266),_=n(80444),S=n(964233),k=n(319111),w=n(206258),x=n(27724),I=n(352229),C=n(288864),T=n(179554),M=n(448948),P=n(496802),A=n(472711),R=n(709953),D=n(311712),B=n(800993),E=n(210228),F=n(668422);function Z(e){const t=e.getRecordStoreAtRootPath();return t instanceof w.G&&void 0!==t.getAssociatedCollectionStore()}function U(e){const{environment:t,textStore:n,url:o,oldTextValue:r,urlSelection:a}=e;if(b.Z.state.open||g.Z.state.open||k.Z.state.open||S.Z.state.open||Z(n)&&i.Cm({url:o,baseUrl:m.default.domainBaseUrl,publicDomainName:m.default.publicDomainName}))return;const s=v.get();if(!s)return;const l=v.getRect(s);l&&(S.Z.setState({open:!0,loading:!1,textStore:n,url:o,oldTextValue:r,urlSelection:a,selectionRect:l}),C.el(t,{url:o}))}async function V(e){const{environment:t}=e,n=S.Z.state;if(n.open){const{url:b,textStore:k,oldTextValue:Z}=n,U=x.default.state.stores,V=U[0];if(!V)return;const N=(0,a.Wv)(b,m.default.secureFileS3.url,m.default.secureFileS3V2.url,m.default.secureFileConfig.rootPath,m.default.secureFileConfig.hostname),O=N?N.link:b,L=(0,s.parseRoute)({url:O,baseUrl:m.default.domainBaseUrl,publicDomainName:m.default.publicDomainName,isMobile:t.device.isMobile,protocol:m.default.protocol,currentUrl:window.location.href});if("page"===L.name)await E.createAndCommitAsync({environment:t,userAction:"embedMenuActions.embedPageAlias",waitForServerCommit:!1,perform:async r=>{let i;if(B.sO({environment:t,store:k,value:Z,transaction:r}),L.peekViewBlockId){const e=w.G.createChildStore(k,{table:l.iU,id:L.peekViewBlockId});await e.load(),e.isPageBlock()&&(i=e)}if(i||(i=w.G.createChildStore(k,{table:l.iU,id:L.blockId})),i){if("mention-page"===e.type){const e=i.getRecordModel({id:i.id,table:l.iU});B.lZ({environment:t,editorMode:"default",store:k,selection:{startIndex:n.urlSelection.startIndex,endIndex:n.urlSelection.startIndex},annotation:d.$0A(L.scrollToBlockId??i.id,null==e?void 0:e.space_id),transaction:r,analyticsFrom:"block"})}else if("create-transclusion"===e.type){if(!L.scrollToBlockId)return;T.ry({environment:t,blocks:x.default.state.stores,copiedBlockIds:[L.scrollToBlockId]})}else if(i.isCollectionView()){const e=L.collectionViewId?w.Xr.createChildStore(i,{table:c.np,id:L.collectionViewId}):void 0;await Promise.all([i.load(),e?e.load():void 0]);const n=e?e.getCollectionStore():i.getCollectionViewCollectionStore();n&&(await n.load(),A.Y_({environment:t,store:V,collectionStore:n,collectionViewStore:e,transaction:r}))}else{const n=V.getParentBlockStore();if(n){const o=I.k({environment:t,parentBlockStore:n,targetStore:i,transaction:r,..."page-preview"===e.type&&{isPagePreview:!0}});D.BM({environment:t,blocksToInsert:[o],target:U,transaction:r,replaceEmptyTextBlock:!0})}}o.default.afterNextFlush((()=>{E.createAndCommit({userAction:"embedMenuActions.accept",environment:t,perform:e=>{D.MD({blocks:U,transaction:e})}})}))}}});else if(e.type===r.Ti.bookmark||"teamsInvite"===L.name){const{performResult:e}=E.createAndCommit({userAction:"embedMenuActions.insertedBlocks",environment:t,perform:e=>{var n,o;B.sO({environment:t,store:k,value:Z,transaction:e});const i=R.j4({environment:t,type:r.Ti.bookmark,inMemoryRecordCache:V.inMemoryRecordCache,transaction:e,spaceId:0!==U.length?U[U.length-1].pointer.spaceId:null===(n=(0,f.RM)())||void 0===n?void 0:n.pointer.spaceId,useCrdt:0!==U.length?U[U.length-1].useCrdt():(null===(o=(0,f.RM)())||void 0===o?void 0:o.useCrdt())??!1}),a=D.BM({environment:t,blocksToInsert:[i],target:U,transaction:e,replaceEmptyTextBlock:!0});return P.FH({stores:[i],transaction:e,update:{bookmark_loading_ttl:Date.now()}}),a}});o.default.afterNextFlush((()=>{E.createAndCommit({userAction:"embedMenuActions.accept",environment:t,perform:e=>{D.MD({blocks:U,transaction:e})}})}));const n=e[0];"teamsInvite"===L.name?await M.Ke({environment:t,store:n,url:b,teamId:L.teamId}):await M.Ke({environment:t,store:n,url:b})}else if(e.type===r.Ti.drive){const{performResult:e}=E.createAndCommit({userAction:"embedMenuActions.insertedBlocks",environment:t,perform:e=>{var n,o;B.sO({environment:t,store:k,value:Z,transaction:e});const i=R.j4({environment:t,type:r.Ti.drive,inMemoryRecordCache:V.inMemoryRecordCache,transaction:e,spaceId:0!==U.length?U[U.length-1].pointer.spaceId:null===(n=(0,f.RM)())||void 0===n?void 0:n.pointer.spaceId,useCrdt:0!==U.length?U[U.length-1].useCrdt():(null===(o=(0,f.RM)())||void 0===o?void 0:o.useCrdt())??!1});return D.BM({environment:t,blocksToInsert:[i],target:U,transaction:e,replaceEmptyTextBlock:!0})}});o.default.afterNextFlush((()=>{E.createAndCommit({userAction:"embedMenuActions.accept",environment:t,perform:e=>{D.MD({blocks:U,transaction:e})}})}));const n=e[0];o.default.afterNextFlush((()=>{const e=y.R.find((e=>e.getBlockStore()===n));e&&e.initializeGoogleDriveBlockFromUrl(b)}))}else if("link-mention"===e.type){var i,g;S.Z.setState({open:!1,loading:!0});const e=await p.getDataForLinkMention(t,{url:O,spaceId:(null===(i=_.default.state.currentSpaceStore)||void 0===i?void 0:i.id)??(null===(g=_.default.state.mainEditorCurrentBlockStore)||void 0===g?void 0:g.getSpaceId()),source:"link_mention_activate"});if("success"===e.type){const o=e.data;if("error"in o){const e=d.YCD(d.Wy3({href:b,title:b.includes("mailto:")?b:new URL(b).hostname}));E.createAndCommit({environment:t,userAction:"embedMenuActions.mention",perform:o=>{B.pe({environment:t,store:k,selection:{startIndex:n.urlSelection.startIndex,endIndex:n.urlSelection.endIndex},transaction:o}),B.mM({environment:t,store:k,tokens:[e],index:n.urlSelection.startIndex,transaction:o})}}),C.E5(t,{domain:b.includes("mailto:")?b:new URL(b).hostname})}else{var v;const{title:e,description:r,author_name:i,provider_name:a,images:s,favicon_url:l,iframe:c,height:u,padding:p,padding_top:m}=o,g=d.YCD(d.Wy3({href:b,title:e||(a||new URL(b).hostname),description:r,link_author:i,link_provider:a,thumbnail_url:s&&s.length>0?null===(v=s[0])||void 0===v?void 0:v.url:void 0,icon_url:l,iframe_url:b.includes("nytimes.com")?void 0:c,height:u,padding:p,padding_top:m}));E.createAndCommit({environment:t,userAction:"embedMenuActions.mention",perform:e=>{B.pe({environment:t,store:k,selection:{startIndex:n.urlSelection.startIndex,endIndex:n.urlSelection.endIndex},transaction:e}),B.mM({environment:t,store:k,tokens:[g],index:n.urlSelection.startIndex,transaction:e})}})}}else{const e=d.YCD(d.Wy3({href:b,title:b.includes("mailto:")?b:new URL(b).hostname}));E.createAndCommit({environment:t,userAction:"embedMenuActions.mention",perform:o=>{B.pe({environment:t,store:k,selection:{startIndex:n.urlSelection.startIndex,endIndex:n.urlSelection.endIndex},transaction:o}),B.mM({environment:t,store:k,tokens:[e],index:n.urlSelection.startIndex,transaction:o})}}),C.E5(t,{domain:b.includes("mailto:")?b:new URL(b).hostname})}}else{const{performResult:n}=E.createAndCommit({userAction:"embedMenuActions.insertedBlocks",environment:t,perform:e=>{var n,o;B.sO({environment:t,store:k,value:Z,transaction:e});const i=R.j4({environment:t,type:r.Ti.copyIndicator,inMemoryRecordCache:V.inMemoryRecordCache,transaction:e,spaceId:0!==U.length?U[U.length-1].pointer.spaceId:null===(n=(0,f.RM)())||void 0===n?void 0:n.pointer.spaceId,useCrdt:0!==U.length?U[U.length-1].useCrdt():(null===(o=(0,f.RM)())||void 0===o?void 0:o.useCrdt())??!1});return D.BM({environment:t,blocksToInsert:[i],target:U,transaction:e,replaceEmptyTextBlock:!0})}});o.default.afterNextFlush((()=>{E.createAndCommit({userAction:"embedMenuActions.accept",environment:t,perform:e=>{D.MD({blocks:U,transaction:e})}})}));const i=n[0],a=n=>{E.createAndCommit({environment:t,userAction:"embedMenuActions.accept.insertExtractedData",perform:t=>{let o;e.type&&"mention-page"!==e.type&&"create-transclusion"!==e.type&&"link-mention"!==e.type&&"page-preview"!==e.type&&"jira-sync"!==e.type?o=e.type:(o=r.Ti.embed,n&&n.media&&("photo"===n.media.type?o=r.Ti.image:"video"===n.media.type&&(o=r.Ti.video))),F.vs({environment:e.environment,block:i,blockType:o,transaction:t})}}),o.default.afterNextFlush((()=>{const e=y.R.find((e=>e.getBlockStore()===i&&u.mf(e.embed)));e&&e.embed(O)}))};h.W4(t,O).then(a)}}N()}function N(){S.Z.setState({open:!1,loading:!1})}},304727:(e,t,n)=>{n.d(t,{RL:()=>f,_P:()=>g,jZ:()=>v,xv:()=>h});var o=n(421838),r=n(269783),i=n(268056),a=n(389224),s=n(704266),l=n(964233),c=n(319111),d=n(924666),u=n(368425),p=n(800993),m=n(210228);function g(e){const{environment:t,textStore:n,oldSelection:i,oldTextValue:d}=e,p=o.eeV(n.getValue()||[]),m=i.startIndex;if(":"!==p[m])return;const g=o.gPn(p,m-5,m).join("");if(/[0-9]$/.test(g[g.length-1]))return;if(g.endsWith("http")||g.endsWith("https"))return;if(g.endsWith(":"))return;if(s.Z.state.open||r.Z.state.open||c.Z.state.open||l.Z.state.open)return;if(t.device.isPhone)return;const f=a.get();if(!f)return;const h=a.getRect(f);h&&(r.Z.setState({open:!0,textStore:n,oldTextValue:d,oldSelection:i,selectionRect:h}),u.xu(t))}function f(e){const t=r.Z.state,{environment:n,emoji:o,transaction:i}=e;t.open&&(p.sO({environment:n,store:t.textStore,value:t.oldTextValue,transaction:i}),p.Q0({environment:n,editorMode:"default",store:t.textStore,selection:t.oldSelection,emoji:o,transaction:i}),h())}function h(){r.Z.setState({open:!1})}function v(e){p.N3({direction:"end"});const t=d.default.state;if("editing"!==t.mode)return;const n=(0,i.QY)(t.multiSelection);if(!n)return;let a=!1;if(n.selection.startIndex>0){const e=n.store.getValue()||[],t=o.eeV(e)[n.selection.startIndex-1];/[\s]/g.test(t)||(a=!0)}m.createAndCommit({userAction:"emojiMenuActions.triggerInsertEmojiMenu",environment:e,perform:t=>{a?(p.hJ({environment:e,store:n.store,editorMode:"default",string:" ",selection:n.selection,disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,transaction:t}),p.hJ({environment:e,store:n.store,editorMode:"default",string:":",selection:{startIndex:n.selection.startIndex+1,endIndex:n.selection.endIndex+1},disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!1,transaction:t})):p.hJ({environment:e,store:n.store,editorMode:"default",string:":",selection:n.selection,disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!1,transaction:t})}});const s=r.Z.state;s.open&&r.Z.setState({...s,showPopupWithEmptyFilter:!0})}},536280:(e,t,n)=>{n.d(t,{Wj:()=>f,gt:()=>v,qn:()=>g});n(21703);var o=n(701302),r=n(421838),i=n(401898),a=n(83631),s=n(268056),l=n(389224),c=n(489086),d=n(966949),u=n(924666),p=n(800993),m=n(898104);function g(e){var t;const{environment:n,selectedToken:o,selectionRect:i,analyticsFrom:p}=e,g=l.get();if(!g)return;if("editing"!==u.default.state.mode)return;const f=null===(t=(0,s.QY)(u.default.state.multiSelection))||void 0===t?void 0:t.store;if(!f)return;const h=o||a.JT(u.default.state);h&&m.setSelection({store:f,selection:h.position});const v=c.lV(u.default.state),y=h?r.o0h(h.token):a.Jf(v),b=a.by({environment:n,equation:y,displayMode:"inline"}),_=h?{editingToken:h.token}:{annotations:a.nk(u.default.state)};d.Z.setState({open:!0,value:y,error:b,savedTextSelectionState:u.default.state,savedTextSelectionRect:i||a.TJ({environment:n,selection:g}),..._,analyticsFrom:a.D9({source:p,currentEquationToken:Boolean(h),selectedText:v})}),m.clear({environment:n})}function f(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d.P.Forward;d.Z.isOpen()&&(h({equationStore:d.Z,getNextSelection:t=>e===d.P.Forward?{startIndex:t.endIndex,endIndex:t.endIndex}:e===d.P.Backward?{startIndex:t.startIndex,endIndex:t.startIndex}:(0,i.t1)(e)}),d.Z.reset(),o.default.afterNextFlush((()=>{u.default.emit()})))}function h(e){const{equationStore:t,getNextSelection:n}=e;if(!t.isOpen())return;const{savedTextSelectionState:o}=t.state,r=(0,s.QY)(o.multiSelection);if(!r)return;const i=n(r.selection);if(m.setSelection({store:r.store,selection:i}),"editing"!==u.default.state.mode)throw new Error("TextSelectionStore should have a selection after calling `setSelection`.");t.setState({...t.state,savedTextSelectionState:u.default.state})}function v(e){const{environment:t,equationStore:n,transaction:o}=e;n.isOpen()&&(n.state.error||n.state.editingToken&&r.o0h(n.state.editingToken)===n.state.value||(!function(e){const{environment:t,equationStore:n,transaction:o}=e;if(!n.isOpen())return;if(n.state.error)return;const{savedTextSelectionState:i}=n.state,{multiSelection:s}=i;let l;p.pz({environment:t,multiSelection:s,transaction:o}),n.state.value&&(l=a.qZ({equationState:n.state,isTemporary:!1}),p.mM({environment:t,store:s.start.store,index:s.start.index,tokens:[l],transaction:o})),h({equationStore:n,getNextSelection:e=>{const t=l?r.eeV([l]).length:0;return{startIndex:e.startIndex,endIndex:e.startIndex+t}}})}({environment:t,equationStore:d.Z,transaction:o}),h({equationStore:n,getNextSelection:e=>({startIndex:e.endIndex,endIndex:e.endIndex})}),a.ND({environment:t,equation:n.state.value,from:n.state.analyticsFrom})))}},957400:(e,t,n)=>{n.d(t,{BX:()=>p,Of:()=>m,Th:()=>u,Yh:()=>d,mc:()=>g});var o=n(915157),r=n(712139),i=n(21359),a=n(547307),s=n(512955),l=n(385555),c=n(807339);async function d(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=await(0,s.getExperimentDeviceId)(e),r=e.currentUser.id;let i;if(i=o.Z.get({userId:r,key:l.localExperimentsV2Key}),i){const e=i.deviceId!==n,t=i.userId!==r,o=Boolean(i.test);!e&&!t||o||(i=void 0,l.default.reset())}i?l.default.updateState(i,e):await u({environment:e}),l.default.getState().isLoaded||l.default.updateState({experimentsBySpace:{},experimentsWithoutSpace:[],isLoaded:!0,userId:r,deviceId:n,test:!1},e),l.default.isStatsigEnabled()&&await c.C.initialize(e,t)}async function u(e){const{environment:t}=e,n=await async function(e){const t=await(0,s.getExperimentDeviceId)(e),n=e.currentUser.id,o=await i.getClientExperimentsV2(e,{deviceId:t});"failed"===o.type&&function(e,t,n){r.rn(e,{from:"experimentActions",type:"ExperimentFetchError",data:{deviceId:n,userId:t}})}(o,n,t);return o}(t);"failed"!==n.type&&l.default.updateState(n.data,t)}async function p(e,t,n){if(!l.default.state.isLoaded)return;const o=await(0,s.getExperimentDeviceId)(e),r=await i.updateExperimentOverride(e,{experimentId:t,experimentGroup:n,deviceId:o});"failed"!==r.type?await u({environment:e}):a.showError(r)}async function m(e){if(!l.default.state.isLoaded)return;const t=await(0,s.getExperimentDeviceId)(e),n=await i.resetExperimentOverrides(e,{deviceId:t});"failed"!==n.type?await u({environment:e}):a.showError(n)}function g(){l.default.reset()}},389475:(e,t,n)=>{n.d(t,{$$:()=>B,ZO:()=>U,cM:()=>Z,hM:()=>E});n(21703);var o=n(977657),r=n(474181),i=n(599405),a=n(89101),s=n(598275),l=n(109852),c=n(994826),d=n(709291),u=n(940470),p=n(218265),m=n(95477),g=n(855337),f=n(691924),h=n(979947),v=n(385555),y=n(530874),b=n(121039),_=n(992083),S=n(757549),k=n(21359),w=n(547307),x=n(247839),I=n(391367),C=n(294273),T=n(215356),M=n(263474),P=n(608055),A=n(310259),R=n(61202);const D=(0,d.defineMessages)({authenticating:{id:"externalIntegrationAuthActions.authenticationWithIntegration.loadingMessage",defaultMessage:"Authorizing with integration…"},titleMessage:{id:"externalIntegrationAuthActions.loginWithExternalIntegrationPopupModal.title",defaultMessage:"Authenticate"}});async function B(e){const{environment:t,integration:n,spaceId:o,from:r}=e,a=n.id,s=t.currentUser.id,l=(0,f.eC)(t);if(!s)throw new Error("No user id found");let d;S.Iv(t,{integrationId:a,from:r});const u=(0,c.I$)(a);if("dlp"===(null==u?void 0:u.type)||"ediscovery"===(null==u?void 0:u.type)){const e=await k.createOauthAuthorizationCode(t,{integrationId:a,spaceId:o});if("failed"===e.type)return w.showError(e),{error:`Unexpected error creating authorization code: ${(0,h.getDebugMessageForApiRequestFailure)(e)}`};d=e.data.code}await V({environment:t,notionAuthorizationCode:d,integration:n,spaceId:o,userId:s,authType:l,from:r,callbackRouteName:(null==u?void 0:u.id)===c.ZB.datadog.id?i.EXTERNAL_INTEGRATION_ROUTE_NAMES.datadogAuthCallback:i.EXTERNAL_INTEGRATION_ROUTE_NAMES.authCallback}),await R.pJ({environment:t}),"workspace_connections_redirect"===r&&_.Z.setState({open:!0,openedFrom:"workspace_connections_redirect",currentTab:"integrations",defaultSubtab:"workspace_connections",highlightedSetting:void 0})}async function E(e){const{environment:t,spaceId:n,integration:c,externalObjectInstanceBlockId:d,unfurlUrl:_,from:B}=e;if(c.id===o.Ff)return await I.jW({environment:t,from:B,action:"add_account"}),(0,g.j)({environment:t,event:{eventName:"external_sync_entry_point",eventProperties:{integration:"jira",flowId:b.Z.createNewFlowId(),from:"my_connections"}}}),{value:{externalAuthentication:void 0}};l.In(void 0);const E=c.id,Z=E===o.nO?y.Z.completeSlackAuthentications.state:y.Z.externalAuthentications.state,U=new Set(Z.filter((e=>{let{integration_id:t}=e;return t===E})).map((e=>e.parent_id)));E===o.f3&&A.pc(t);const N=(0,o.BP)({integrationId:E,env:"production"}),O=(0,r.lT)(m.default.domainBaseUrl),L=c.redirect_uris.includes(O)?O:c.redirect_uris[0],j=await k.createOauthAuthorizationCode(t,{integrationId:E,spaceId:n,...N?{redirectUri:L}:{}});if("failed"===j.type)return w.showError(j),{error:`Unexpected error creating authorization code: ${(0,h.getDebugMessageForApiRequestFailure)(j)}`};const K=j.data.code,z=t.currentUser.id,q=(0,f.eC)(t),H=i.EXTERNAL_INTEGRATION_ROUTE_NAMES.authCallback;if(!z)return{error:"User must be signed in."};const G={environment:t,notionAuthorizationCode:K,integration:c,spaceId:n,externalObjectInstanceBlockId:d,unfurlUrl:_,authType:q,from:B,userId:z,callbackRouteName:H};(0,o.BP)({integrationId:E,env:"production"})?await async function(e){const{environment:t,redirectUri:n,notionAuthorizationCode:o,integration:r,spaceId:l,externalObjectInstanceBlockId:c,unfurlUrl:d,authType:g,userId:f}=e,h=await async function(e){const{integration:t}=e;if("external"===t.type&&void 0!==t.info.handled_by_integrations_server){if("github"===t.info.handled_by_integrations_server)return await async function(e){const{environment:t,notionAuthorizationCode:n,spaceId:o,authType:r}=e,l={notion_workspace_id:o,notion_user_id:t.currentUser.id,notion_last_visited_url:window.location.href,notion_authorization_code:n,callback_type:r.callbackType,...r.redirectToAuth&&{redirectToAuth:"true"}},c=v.default.checkGate({gateName:"enable_server_integrations_proxy"}),d=(0,p.bf)({url:(0,s.r8)("production",c),query:{...l}});if((t.device.isTablet||t.device.isMobile)&&t.mobileNative&&"on"===v.default.getEligibleGroup({experimentId:"allow_auth_with_app_browser_for_mobile",defaultGroup:"control"}))return void t.mobileNative.openInAppBrowser(d);if(t.device.isElectron){if(v.default.checkGate({gateName:"enable_oauth_from_desktop_ux_v2"})){const e=(0,p.bf)({url:`${m.default.domainBaseUrl}${a._j.initiateExternalAuthenticationFromDesktop}`,query:{redirectUri:encodeURIComponent(d)}});x.openExternalUrl(e)}else x.openExternalUrl(d);return}const u=await T.M(t,{width:610,height:700,url:d,titleMessage:D.titleMessage});if(!u)return;const g=(0,i.parseRoute)({url:u,isMobile:t.device.isMobile,baseUrl:m.default.domainBaseUrl,publicDomainName:m.default.publicDomainName,protocol:m.default.protocol,currentUrl:window.location.href}),{url:f}=C.Vr(t);"externalAuthCallback"===g.name&&await M.xp({route:g,environment:t});P.c4({url:f||a._j.root,environment:t})}(e),{value:{success:!0}};if("slack"===t.info.handled_by_integrations_server){return v.default.checkGate({gateName:"link_preview_auth_with_server_integration"})?(await async function(e){const{environment:t,userId:n,spaceId:o,authType:r,from:l,externalObjectInstanceBlockId:c,options:d,notionAuthorizationCode:u}=e,g={notion_workspace_id:o,notion_user_id:n,notion_last_visited_url:window.location.href,auth_initiator:l,callback_type:r.callbackType,slack_workspace_id:null==d?void 0:d.slackWorkspaceId,external_object_instance_block_id:c,...r.redirectToAuth&&{redirectToAuth:"true"},notion_authorization_code:u},f=v.default.checkGate({gateName:"enable_server_integrations_proxy"}),h=(0,p.bf)({url:(0,s.St)("production",f),query:{...g}});if(t.mobileNative)return void t.mobileNative.openInAppBrowser(h);if(t.device.isElectron){if(v.default.checkGate({gateName:"enable_oauth_from_desktop_ux_v2"})){const e=(0,p.bf)({url:`${m.default.domainBaseUrl}${a._j.initiateExternalAuthenticationFromDesktop}`,query:{redirectUri:encodeURIComponent(h)}});x.openExternalUrl(e)}else x.openExternalUrl(h);return}const y=await T.M(t,{width:610,height:700,url:h,titleMessage:D.titleMessage});if(!y)return;const b=(0,i.parseRoute)({url:y,isMobile:t.device.isMobile,baseUrl:m.default.domainBaseUrl,publicDomainName:m.default.publicDomainName,protocol:m.default.protocol,currentUrl:window.location.href});"externalAuthCallback"===b.name&&await M.xp({route:b,environment:t})}(e),{value:{success:!0}}):{error:{success:!1}}}return"zendesk"===t.info.handled_by_integrations_server?(await F(e),{value:{success:!0}}):"salesforce"===t.info.handled_by_integrations_server?(await async function(e){const{environment:t,notionAuthorizationCode:n,spaceId:o,authType:r,externalObjectInstanceBlockId:l}=e,c={notion_workspace_id:o,notion_user_id:t.currentUser.id,notion_last_visited_url:window.location.href,callback_type:r.callbackType,external_object_instance_block_id:l,notion_authorization_code:n,...r.redirectToAuth&&{redirectToAuth:"true"}},d=v.default.checkGate({gateName:"enable_server_integrations_proxy"}),u=(0,p.bf)({url:(0,s.LL)("production",d),query:{...c}});if(t.device.isElectron)return void x.openExternalUrl(u);const g=await T.M(t,{width:610,height:700,url:u,titleMessage:D.titleMessage});if(!g)return;const f=(0,i.parseRoute)({url:g,isMobile:t.device.isMobile,baseUrl:m.default.domainBaseUrl,publicDomainName:m.default.publicDomainName,protocol:m.default.protocol,currentUrl:window.location.href}),{url:h}=C.Vr(t);"externalAuthCallback"===f.name&&await M.xp({route:f,environment:t});P.c4({url:h||a._j.root,environment:t})}(e),{value:{success:!0}}):"gmail"===t.info.handled_by_integrations_server?(await async function(e){const{environment:t,notionAuthorizationCode:n,spaceId:o,authType:r,externalObjectInstanceBlockId:l}=e,c={notion_workspace_id:o,notion_user_id:t.currentUser.id,notion_last_visited_url:window.location.href,callback_type:r.callbackType,external_object_instance_block_id:l,notion_authorization_code:n,...r.redirectToAuth&&{redirectToAuth:"true"}},d=v.default.checkGate({gateName:"enable_server_integrations_proxy"}),u=(0,p.bf)({url:(0,s.Ey)("production",d),query:{...c}});if(t.device.isElectron){const e=(0,p.bf)({url:`${m.default.domainBaseUrl}${a._j.initiateExternalAuthenticationFromDesktop}`,query:{redirectUri:encodeURIComponent(u)}});return void x.openExternalUrl(e)}const g=await T.M(t,{width:610,height:700,url:u,titleMessage:D.titleMessage});if(!g)return;const f=(0,i.parseRoute)({url:g,isMobile:t.device.isMobile,baseUrl:m.default.domainBaseUrl,publicDomainName:m.default.publicDomainName,protocol:m.default.protocol,currentUrl:window.location.href}),{url:h}=C.Vr(t);"externalAuthCallback"===f.name&&await M.xp({route:f,environment:t});P.c4({url:h||a._j.root,environment:t})}(e),{value:{success:!0}}):"jira_data_center"===t.info.handled_by_integrations_server?(await F(e),{value:{success:!0}}):{error:{success:!1}}}return{error:{success:!1}}}(e);if(u.x.isSuccess(h))return;const y={externalObjectInstanceBlockId:c,spaceId:l,userId:f,callbackType:g.callbackType,...g.redirectToAuth&&{redirectToAuth:"true"}},b={code:o,notion_state:JSON.stringify(y),integration_id:r.id,external_url:d,redirect_uri:n},_=(0,p.bf)({url:n,query:{...b}});if(t.device.isElectron){if(v.default.checkGate({gateName:"enable_oauth_from_desktop_ux_v2"})){const e=(0,p.bf)({url:`${m.default.domainBaseUrl}${a._j.initiateExternalAuthenticationFromDesktop}`,query:{redirectUri:encodeURIComponent(_)}});x.openExternalUrl(e)}else x.openExternalUrl(_);return}const S=await T.M(t,{width:610,height:700,url:_,titleMessage:D.titleMessage});if(!S)return;const k=(0,i.parseRoute)({url:S,isMobile:t.device.isMobile,baseUrl:m.default.domainBaseUrl,publicDomainName:m.default.publicDomainName,protocol:m.default.protocol,currentUrl:window.location.href});"externalAuthCallback"===k.name&&await M.xp({route:k,environment:t})}({...G,integration:c,notionAuthorizationCode:K,redirectUri:L}):await V(G),S.Iv(t,{integrationId:c.id,numberOfAccountsAlreadyConnected:U.size,from:B}),await R.pJ({environment:t});return{value:{externalAuthentication:y.Z.externalAuthentications.state.filter((e=>{let{integration_id:t}=e;return t===E})).find((e=>!U.has(e.parent_id)))}}}async function F(e){const{environment:t,notionAuthorizationCode:n,spaceId:o,authType:r,externalObjectInstanceBlockId:s}=e,l={notion_workspace_id:o,notion_user_id:t.currentUser.id,notion_last_visited_url:window.location.href,notion_authorization_code:n,external_object_instance_block_id:s,callback_type:r.callbackType,integration_id:e.integration.id,...r.redirectToAuth&&{redirectToAuth:"true"}},c=(0,p.bf)({url:`${m.default.domainBaseUrl}/initiateExternalAuthentication`,query:{...l}});if(t.device.isElectron)return void x.openExternalUrl(c);const d=await T.M(t,{width:610,height:700,url:c,titleMessage:D.titleMessage});if(!d)return;const u=(0,i.parseRoute)({url:d,isMobile:t.device.isMobile,baseUrl:m.default.domainBaseUrl,publicDomainName:m.default.publicDomainName,protocol:m.default.protocol,currentUrl:window.location.href}),{url:g}=C.Vr(t);"externalAuthCallback"===u.name&&await M.xp({route:u,environment:t}),P.c4({url:g||a._j.root,environment:t})}function Z(e){const{environment:t,notion_workspace_id:n,notion_user_id:o,notion_last_visited_url:r,notion_authorization_code:i,external_object_instance_block_id:a,callback_type:l,redirectToAuth:c,zendeskSubDomain:d}=e,u={notion_workspace_id:n,notion_user_id:o,notion_last_visited_url:r,notion_authorization_code:i,external_object_instance_block_id:a,callback_type:l,zendeskSubDomain:d,...c&&{redirectToAuth:"true"}},m=v.default.checkGate({gateName:"enable_server_integrations_proxy"}),g=(0,p.bf)({url:(0,s.vl)("production",m),query:{...u}});t.device.isElectron?x.openExternalUrl(g):window.location.href=g}function U(e){const{environment:t,notion_workspace_id:n,notion_user_id:o,notion_last_visited_url:r,notion_authorization_code:i,external_object_instance_block_id:a,callback_type:l,redirectToAuth:c,domain:d,personalAccessToken:u}=e,m={notion_workspace_id:n,notion_user_id:o,notion_last_visited_url:r,notion_authorization_code:i,external_object_instance_block_id:a,callback_type:l,domain:d,personalAccessToken:u,...c&&{redirectToAuth:"true"}},g=v.default.checkGate({gateName:"enable_server_integrations_proxy"}),f=(0,p.bf)({url:(0,s.In)("production",g),query:{...m}});t.device.isElectron?x.openExternalUrl(f):window.location.href=f}async function V(e){const{environment:t,notionAuthorizationCode:n,integration:o,spaceId:r,userId:s,authType:l,externalObjectInstanceBlockId:c,from:d,callbackRouteName:u}=e,g=o.id,h={notionAuthorizationCode:n,userId:s,spaceId:r,integrationId:g,externalObjectInstanceBlockId:c,callbackType:l.callbackType,...l.redirectToAuth&&{redirectToAuth:"true"}};let v=(0,p.bf)({url:`${m.default.domainBaseUrl}${a._j.externalIntegrationPopupRedirect}`,query:{...h}});if(v=l.redirectToAuth?v:await(0,f.HU)(t,v),t.device.isElectron)return void x.openExternalUrl(v);const y=await T.M(t,{width:610,height:700,url:v,titleMessage:D.titleMessage});if(!y)return;const b=(0,i.parseRoute)({url:y,isMobile:t.device.isMobile,baseUrl:m.default.domainBaseUrl,publicDomainName:m.default.publicDomainName,protocol:m.default.protocol,currentUrl:window.location.href});b.name===u&&await M.wN({route:b,environment:t,integrationId:g,from:d})}},762365:(e,t,n)=>{n.d(t,{c:()=>u,v:()=>p});var o=n(421838),r=n(218265),i=n(27411),a=n(627153),s=n(709953),l=n(800993),c=n(210228),d=n(977357);function u(e){const{store:t,file:n,environment:o}=e,r=i.default.getBlockKey(t.id);a.Z(),d.cT({environment:o,file:n,bucket:"secure",record:t.pointer,onStart:e=>{i.default.setKeyState(r,{progressPercent:0,file:n,name:e.name,size:e.size})},onProgress:e=>{const t=i.default.getKeyState(r);t&&i.default.setKeyState(r,{...t,progressPercent:e.progressPercent})},onComplete:e=>{const n=i.default.getKeyState(r);n&&c.createAndCommit({userAction:"fileBlockActions.uploadFile",environment:o,perform:a=>{p({environment:o,store:t,source:e,name:n.name,size:n.size,transaction:a}),i.default.setKeyState(r,void 0)}})},onError:()=>{i.default.setKeyState(r,void 0)},retryWhenOffline:!0})}function p(e){const{environment:t,store:n,source:i,name:a,size:c,transaction:d}=e;let u;a?u=a:i&&(u=(0,r.je)(i)),l.sO({environment:t,store:n.getBlockTitleStore(),value:o.TPx(u),transaction:d}),s.sW({store:n.getPropertiesStore(),data:{source:o.TPx(i),size:o.TPx(c)},transaction:d})}},403297:(e,t,n)=>{n.d(t,{DK:()=>K,OH:()=>q,Qk:()=>Q,S:()=>j,VE:()=>W,fD:()=>H,nM:()=>$,qd:()=>Y,sC:()=>L,yR:()=>z});var o=n(815145),r=n(915157),i=n(89101),a=n(421202),s=n(653965),l=n(937850),c=n(307032),d=n(401898),u=n(783105),p=n(275754),m=n(691851),g=n(95477),f=n(27105),h=n(855337),v=n(721429),y=n(408304),b=n(484210),_=n(433929),S=n(918514),k=n(70853),w=n(80444),x=n(189256),I=n(206258),C=n(250906),T=n(981193),M=n(21359),P=n(547307),A=n(276725),R=n(496802),D=n(792625),B=n(211302),E=n(119785),F=n(569915),Z=n(608055),U=n(328014),V=n(210228);const N=750,O="forkPageTemplate";function L(){x.Z.setState({open:!1})}async function j(e){const{environment:t,store:n,originRect:r}=e;C.Zz(t,n.id);const{RouterStore:s}=t,l=s.state.route;if(S.Sr(t)){let e=n;if("space"===l.name){const t=n.getSpaceStore();if(!t)return;const o=l.spaceDomain?k.ih(t,l.spaceDomain):void 0,r=null==o?void 0:o.getPublicHomePage();if(!r)return;const i=I.G.createChildStore(t,{id:r,table:a.iU,spaceId:t.id});if(!i)return;e=i}const r=(0,b.ZP)({store:e,fullyQualified:!1,duplicate:!0,pageVisitSource:o.tY.Duplicate});return void Z.Li({environment:t,url:r,extraSearchParams:{...await F.tc(t),utm_source:"public_page",utm_content:"duplicate_button",tid:await(0,h.cG)(t),from:"public_page",n:"duplicate_public_page"}})}const{currentUserRootStore:c}=w.default.state;if(c){const e=v.o(c);if(1===e.length){const o=e[0],r=o.getSpaceStore();if(!r)return;K({environment:t,store:n,spaceStore:r,spaceViewStore:o,isPrivate:!0,context:"public_page_duplicate_single_workspace"})}else x.Z.setState({open:!0,store:n,originRect:r})}else $({currentUserId:t.currentUser.id,blockId:n.id}),Z.c4({environment:t,url:i._j.login})}async function K(e){const{environment:t,store:n,spaceStore:r,context:i}=e,a=Date.now();let s;const c=q({...e,useCrdt:J(e)}),[d]=await Promise.all([c.then((e=>(s=Date.now()-a,e))),(0,l.Vs)(N)]);D.x();const m=Date.now()-a;"public_page_duplicate_multiple_workspace"!==i&&"public_page_duplicate_single_workspace"!==i&&"signin_after_duplicate"!==i||T.Xy(t,{from:"publicPage",success:!d.error,template_block_id:n.id,target_space_id:r.id,context:i,template_duplication_duration_ms:s,template_duplication_duration_with_minimum_ms:m}),void 0!==d.error?P.showErrorMessage(d.error):p._c({environment:t,store:d.value,visitType:u.vu.Link,pageVisitSource:o.tY.Duplicate})}function z(e){const{store:t,spaceStore:n}=e,o=_.default.getIntl(),r=(0,y.M5)(t,o),i=(0,y.A1)(n,o);return D.j({message:y.sY.loadingStateDisplayText,interpolatedValues:{blockTitle:r,spaceTitle:i}}),{blockTitle:r,spaceTitle:i}}async function q(e){const{environment:t,store:n,spaceStore:o,spaceViewStore:r,isPrivate:i,duplicateOnlyCollectionSchema:a}=e;return new Promise((s=>{V.createAndCommit({userAction:"forkPageActions.forkPage",environment:t,perform:l=>{const[c,d]=A.Qi({environment:t,stores:[n],transaction:l,addCopyName:!1,deepCopyTransclusionContainers:!0,resolveTemplateVariables:!0,targetSpaceId:o.id,baseUrl:g.default.domainBaseUrl,publicDomainName:g.default.publicDomainName,preferDuplicateLocation:"local",useCrdt:J(e),duplicateOnlyCollectionSchema:a}),u=c[0];d.then((e=>{e?s({error:e}):(s({value:u}),u.isLocked()&&V.createAndCommit({userAction:"forkPageActions.forkPageWithLoadingAndNavigate",environment:t,perform:e=>{R.Wq({environment:t,store:u,isLocked:!1,transaction:e})}}))})),U.Hj({environment:t,spaceStore:o,spaceViewStore:r,pageStore:u,isPrivate:i,location:{type:"prepend"},transaction:l})}})}))}async function H(e){const{environment:t,store:n,duplicateOnlyCollectionSchema:o}=e,r=w.default.state.currentSpaceStore,i=w.default.state.currentSpaceViewStore,a=w.default.state.mainEditorCurrentBlockStore;if(!r||!i||!a)return;const l=await m.NN({environment:t,block:n,action:"duplicate"});if("user_canceled"===l)return;return await new Promise((a=>{V.createAndCommit({userAction:"forkPageActions.duplicateTo",environment:t,perform:c=>{const[u,p]=A.Qi({environment:t,stores:l,transaction:c,addCopyName:e.addCopyName,deepCopyTransclusionContainers:!0,resolveTemplateVariables:!0,targetSpaceId:r.id,baseUrl:g.default.domainBaseUrl,publicDomainName:g.default.publicDomainName,preferDuplicateLocation:"local",useCrdt:G({...e,blocksToDuplicate:l}),duplicateOnlyCollectionSchema:o,installationImprint:e.installationImprint});p.then((n=>{n?a({error:n}):(a({value:u}),e.unlockPage&&u.find((e=>e.isLocked()))&&V.createAndCommit({userAction:"forkPageActions.duplicateToHelper",environment:t,perform:e=>{u.forEach((n=>{n.isLocked()&&R.Wq({environment:t,store:n,isLocked:!1,transaction:e})}))}}))}));const m={type:"append",after:e.appendWithoutAfter?void 0:n.id},f=s.d9(u).reverse();if("team"===e.newParentStore.table)B.at({transaction:c,currentSpaceViewStore:i,teamStore:e.newParentStore,targets:u,environment:t,location:m,action:"move",value:{type:"team",id:e.newParentStore.id,spaceId:r.id}});else if("block"===e.newParentStore.table)for(const t of f)E.jG({parentStore:e.newParentStore,childStore:t,transaction:c,after:m.after});else if("space"===e.newParentStore.table)for(const e of f)U.Hj({environment:t,spaceStore:r,spaceViewStore:i,pageStore:e,isPrivate:!0,location:m,transaction:c});else(0,d.t1)(e.newParentStore);return u}})}))}function G(e){const{newParentStore:t,blocksToDuplicate:n,event:o}=e;return"block"===t.table?t.useCrdt():"space"===t.table&&(0,f.Sy)({event:o,contextualDefault:n.every((e=>e.useCrdt()))})}async function W(e){const{environment:t}=e,n=await H({...e,addCopyName:!0});n&&(void 0!==n.error?P.showErrorMessage(n.error):p._c({environment:t,store:n.value[0],visitType:u.vu.Link,pageVisitSource:o.tY.Duplicate}))}function $(e){let{currentUserId:t,blockId:n}=e;r.Z.set({userId:t,key:O,value:n})}function Y(e){return r.Z.get({userId:e,key:O})}async function Q(e){let{environment:t,blockId:n,spaceId:o,templateId:r,installationId:i}=e;if(r&&(0,c.t)(r))await M.createMarketplaceInstallation(t,{destinationTable:"space",destinationId:o,productTable:"template",productId:r,installationId:i});else{const e=await M.inAppGetTemplateByBlockId(t,{blockId:n});if("success"===e.type&&e.data.success&&e.data.template){const n=e.data.template;await M.createMarketplaceInstallation(t,{destinationTable:"space",destinationId:o,productTable:"template",productId:n.id,installationId:i})}}}function J(e){const{isPrivate:t,store:n,useCrdt:o}=e;return"boolean"==typeof o?o:t?(0,f.dy)({source:"private",contextualDefault:n.useCrdt()}):n.useCrdt()}},496802:(e,t,n)=>{n.d(t,{FH:()=>m,MF:()=>_,Mp:()=>S,Wq:()=>g,bf:()=>k,eO:()=>v,fs:()=>h,hc:()=>f,is:()=>b,zM:()=>y});var o=n(541432),r=n(643593),i=n(915157),a=n(653965),s=n(619584),l=n(95477),c=n(924990),d=n(206258),u=n(141433),p=n(709953);function m(e){const{stores:t,update:n,transaction:r}=e;for(const a of t){switch(a.table){case"block":case"collection":case"collection_view":p.sW({store:a.getFormatStore(),data:(0,s.Q2)(n),transaction:r})}a instanceof d.G&&a.getType()===o.Ti.callout&&n.block_color&&i.Z.set({userId:a.environment.currentUser.id,key:u.Ns,value:n.block_color})}}function g(e){const{environment:t,store:n,isLocked:o,transaction:r}=e,{id:i}=t.currentUser;if(!i)return;const a={block_locked:o,block_locked_by:i};p.sW({store:n.getFormatStore(),data:a,transaction:r})}function f(e){const{environment:t,store:n,alignment:o,transaction:r}=e,{id:i}=t.currentUser;if(!i)return;const a={block_alignment:o};p.sW({store:n.getFormatStore(),data:a,transaction:r})}function h(e){const{store:t,url:n,position:o,transaction:i}=e,a=(0,r.Wv)(n,l.default.secureFileS3.url,l.default.secureFileS3V2.url,l.default.secureFileConfig.rootPath,l.default.secureFileConfig.hostname),s=a?a.link:n;m({stores:[t],update:{page_cover_position:o},transaction:i});const c=t.getCoverStore();c&&p.sO({store:c,value:s,transaction:i})}function v(e){const{store:t,url:n,transaction:o}=e,i=(0,r.Wv)(n,l.default.secureFileS3.url,l.default.secureFileS3V2.url,l.default.secureFileConfig.rootPath,l.default.secureFileConfig.hostname);m({stores:[t],update:{social_media_image_preview_url:i?i.link:n},transaction:o})}function y(){const e=a.UP(["Activities","Objects","Travel & Places"]),t=c.Z.state.emojiByCategory[e];return a.UP(t)}function b(e){const{store:t,transaction:n}=e,o=t.getIconStore();if(o){if(!o.getValue()){const e=y();p.sO({store:o,value:e,transaction:n})}}}function _(e){const{store:t,transaction:n}=e,o=t.getCoverStore();o&&p.sO({store:o,value:null,transaction:n})}function S(e){const{store:t,coverPosition:n,transaction:o}=e;if(t.isCollectionView()){const e=t.getCollectionViewCollectionStore();if(e)return void p.sW({store:e.getFormatStore(),data:{collection_cover_position:n},transaction:o})}m({stores:[t],update:{page_cover_position:n},transaction:o})}function k(e){const{store:t,coverPosition:n,transaction:o}=e;m({stores:[t],update:{card_cover_position:n},transaction:o})}},147678:(e,t,n)=>{n.d(t,{Y:()=>v});var o=n(815145),r=n(933709),i=n(23867),a=n(653965),s=n(575497),l=n(645010),c=n(80444),d=n(724612),u=n(206258),p=n(27724),m=n(977503),g=n(554564),f=n(761045),h=n(311712);function v(e,t){var n;const{RouterStore:v}=e,{PageScroller:y}=l.Z;if("page"!==v.state.route.name&&"chat"!==v.state.route.name)return;if(!c.default.state.currentLoadingContainerStore&&"page"===v.state.route.name)return;if((null===(n=c.default.state.currentLoadingContainerStore)||void 0===n||!n.state.ready)&&"page"===v.state.route.name)return;d.Z.reset(),m.Z.reset();const b=v.state.route,_="pageVisitSource"in b&&b.pageVisitSource?parseInt(b.pageVisitSource):void 0;if(v.state.route.scrollToBlockId){h.kB(e,{blockId:v.state.route.scrollToBlockId,animate:t.animateScrollToBlocks});const n=p.default.state.stores[0];n&&"page"===v.state.route.name&&v.state.route.discussionId&&g.Ib({environment:e,blockStore:n,discussionIds:[v.state.route.discussionId],analyticsFrom:_===o.tY.Notification?"notification":"page_load",shouldFocusDiscussion:!0,recursivelyLoadAllDiscussions:!1})}else if("page"===v.state.route.name&&v.state.route.discussionId&&c.default.state.mainEditorCurrentBlockStore){var S;const t=null===(S=u.t1.createChildStore(c.default.state.mainEditorCurrentBlockStore,{table:r.qF,id:v.state.route.discussionId,spaceId:(0,i.C)(c.default.state.mainEditorCurrentBlockStore.pointer.spaceId)}))||void 0===S?void 0:S.getPropertyId();if(t){const e=(0,s.L)({discussionId:v.state.route.discussionId,blockId:c.default.state.mainEditorCurrentBlockStore.id}),t=document.getElementsByClassName(`discussion-id-${v.state.route.discussionId}`)[0];f.bx({element:t,scrollers:{verticalScroller:e.getContextVerticalScroller(),horizontalScroller:e.getContextHorizontalScroller()},vertical:{reveal:"top"},horizontal:{reveal:"closest"},animate:!0})}g.Ib({environment:e,blockStore:c.default.state.mainEditorCurrentBlockStore,discussionIds:[v.state.route.discussionId],analyticsFrom:_===o.tY.Notification?"notification":"page_load",shouldFocusDiscussion:!0,recursivelyLoadAllDiscussions:!1,property_id:t})}else"pop"===v.state.action&&v.state.historyState&&(y&&a.hj(v.state.historyState.scrollTop)&&y.scrollTo(v.state.historyState.scrollTop,void 0),v.state.historyState.blockIds&&h.DQ(e,v.state.historyState.blockIds))}},778321:(e,t,n)=>{n.d(t,{LI:()=>k,V8:()=>w,Xb:()=>x,lR:()=>b,y8:()=>_});n(21703);var o=n(126263),r=n(159730),i=n(421202),a=n(712139),s=n(401898),l=n(741195),c=n(80444),d=n(400807),u=n(385555),p=n(206258),m=n(21359),g=n(276725),f=n(850799),h=n(328014),v=n(800993),y=n(210228);function b(e){const{pageStore:t,environment:n}=e;if(!u.default.checkGate({gateName:"full_page_translate"}))return;const o=d.Z.getStateForBlock(t.id);if(!o||"translate"!==o.mode)return;const r=n.defaultRecordCache.inMemoryRecordCache;"select_language"===o.status?r.removeCacheOverride(o.inMemoryRecordCache):"loading"===o.status?(o.cancel(),r.removeCacheOverride(o.inMemoryRecordCache)):"active"===o.status?r.removeCacheOverride(o.inMemoryRecordCache):(0,s.t1)(o),f.iE({navigableBlockStore:t})}function _(e){const{pageStore:t,environment:n}=e,{currentUserStore:o,currentSpaceStore:r,currentSpaceViewStore:s}=c.default.state;if(!o||!r||!s)return;if(!u.default.checkGate({gateName:"full_page_translate"}))return;const p=d.Z.getStateForBlock(t.id);if(!p||"translate"!==p.mode||"active"!==p.status)return;const m=g.K8(n,{blockId:t.id,inMemoryRecordCache:t.inMemoryRecordCache,allowCopyCollections:!1,requireFullSubtree:!0,skipTransclusionContainerChildren:!0,allowCopyExternalObjectInstances:!0,includeLegacyTransclusionBlockValues:!1});if(!m){const e=new Error("Could not load local subtree for duplicate");return void a.rn(e,{from:"fullPageTranslationActions",type:"loadingLocalSubtreeForDuplicationFailure",data:{sessionId:p.sessionId,blockId:t.id}})}return y.createAndCommit({environment:n,perform:e=>{const o=(0,l.Ii)({environment:n,table:i.iU,spaceId:r.id}),{targetBlockStore:a}=g.E9({environment:n,sourceBlockId:t.id,targetBlockPointer:o,sourceBlockSubtree:m,targetInMemoryRecordCache:n.defaultRecordCache.inMemoryRecordCache,addCopyName:!0,deepCopyTransclusionContainers:!0,resolveTemplateVariables:!0,transaction:e,useCrdt:!0,preventLegacyTransclusions:!1,installationImprint:void 0});return h.Hj({environment:n,spaceStore:r,spaceViewStore:s,pageStore:a,isPrivate:!0,transaction:e}),a},userAction:"fullPageTranslationActions.duplicateTranslatedPage"}).performResult}function S(e){const{blockStore:t,environment:n,transaction:o,inMemoryRecordCache:r,currentUserStore:i}=e;if(t.isType("transclusion_reference")){const e=t.getTransclusionReferenceTargetStore();if(!e)throw new Error("Expected transclusion reference target on transclusion_reference block.");S({blockStore:e,transaction:o,inMemoryRecordCache:r,environment:n,currentUserStore:i})}r.setModelAndRole({pointer:t.getSpaceShardedPointer(),userId:i.id},t.getModel(),"reader");for(const a of t.getContentPointers()){S({blockStore:p.G.createChildStore(t,a),transaction:o,inMemoryRecordCache:r,environment:n,currentUserStore:i})}}function k(e){const{pageStore:t,targetLanguage:n,environment:o}=e,r=d.Z.getStateForBlock(t.id);if(!u.default.checkGate({gateName:"full_page_translate"})||"translate"!==(null==r?void 0:r.mode))return;if(!t.isType("page"))throw new Error("Not a page");const a=new AbortController;m.translatePage({environment:o,data:{pagePointer:t.getSpaceShardedPointer(),targetLanguage:n},headers:{},abortSignal:a.signal}).then((e=>{if("success"===e.type){const{translatedBlockMap:n}=e.data;!function(e){const{pageStore:t,valueMap:n,environment:o}=e,{currentUserStore:r,currentSpaceStore:a}=c.default.state;if(!r||!a)return;if(!u.default.checkGate({gateName:"full_page_translate"}))return;const l=d.Z.getStateForBlock(t.id);if(!l||"translate"!==l.mode)return;if("loading"!==l.status)throw new Error("Expected translation state to be loading");const m=t.clone(l.inMemoryRecordCache);y.createAndCommit({environment:o,perform(e){for(const[t,r]of Object.entries(n)){const n=p.G.createChildStore(m,{table:i.iU,id:t,spaceId:a.id});let l;if("title"===r.mapping)l=n.getBlockTitleStore();else if("caption"===r.mapping)l=n.getPropertyStore("caption");else{if("unmapped"===r.mapping)continue;(0,s.t1)(r.mapping)}v.sO({environment:o,store:l,value:r.value,transaction:e})}l.inMemoryRecordCache.emitAll()},userAction:"fullPageTranslationHelpers.applyTranslationMapToPage"}),f.Xt({navigableBlockStore:t,editorModeConfig:{...l,status:"active"}})}({valueMap:n,pageStore:t,environment:o})}})),f.Xt({navigableBlockStore:t,editorModeConfig:{...r,status:"loading",targetLanguage:n,cancel:()=>a.abort()}})}function w(e){var t;const{pageStore:n,environment:r}=e,{currentUserStore:i}=c.default.state;if(!n.isType("page"))throw new Error("Not a page");if("translate"===(null===(t=d.Z.getStateForBlock(n.id))||void 0===t?void 0:t.mode)||!u.default.checkGate({gateName:"full_page_translate"})||!i)return;const a=new o.Z({name:`TranslationInMemoryRecordCache-${n.id}`,isTemporaryData:!0});r.defaultRecordCache.inMemoryRecordCache.addCacheOverride(a);const s=n.clone(a);y.createAndCommit({environment:r,perform(e){S({blockStore:s,transaction:e,inMemoryRecordCache:a,environment:r,currentUserStore:i})},userAction:"fullPageTranslationActions.openTranslateBanner.lockPage"}),a.emitAll(),f.Xt({navigableBlockStore:n,editorModeConfig:{mode:"translate",status:"select_language",inMemoryRecordCache:a}})}function x(e){const t=new r.p8("Editor handler called in translate mode.");throw a.rn(t,{from:"fullPageTranslationActions",type:"editorHandlerInTranslateModeWarning",data:{sessionId:e}}),t}},954604:(e,t,n)=>{n.d(t,{ui:()=>a,xv:()=>s,zp:()=>l});var o=n(250906),r=n(417903),i=n(138302);function a(e){const{environment:t,renderFullScreenNode:n,fullScreenNodeRect:a,contentAspectRatio:s,blockStore:l,imageUrl:c}=e;o.Lf(t,{type:"open"}),i.Z.setState({...i.Z.state,isOpen:!0,fullscreenNodeAnimationComplete:!1,backgroundAnimationComplete:!1,renderFullScreenNode:n,startScrollTop:r.Z.state.scrollTop,fullScreenNodeRect:a,contentAspectRatio:s,blockStore:l,imageUrl:c})}function s(){i.Z.setState({...i.Z.state,isOpen:!1})}function l(e){return e<1020?0:32}},718250:(e,t,n)=>{n.d(t,{K:()=>i,O:()=>r});var o=n(745483);function r(e){o.Z.state.openModals.has(e)||(o.Z.state.openModals.add(e),o.Z.emit())}function i(e){o.Z.state.openModals.has(e)&&(o.Z.state.openModals.delete(e),o.Z.emit())}},52606:(e,t,n)=>{n.d(t,{AW:()=>P,Du:()=>M,bA:()=>T,gx:()=>R,uO:()=>B,w3:()=>D,xv:()=>C});var o=n(701302),r=n(421838),i=n(116275),a=n(653965),s=n(401898),l=n(601600),c=n(249394),d=n(645010),u=n(177546),p=n(489086),m=n(601381),g=n(87863),f=n(450734),h=n(246351),v=n(469316),y=n(924666),b=n(554564),_=n(761045),S=n(303898),k=n(164964),w=n(800993),x=n(898104),I=n(210228);function C(e){const{clearQuery:t}=e,{textSelection:n,open:o}=v.ZP.state;o&&(n&&"editing"!==y.default.state.mode&&y.default.setState({...n,multiSelection:{start:n.multiSelection.end,end:n.multiSelection.end}}),v.ZP.update((e=>({...e,focused:!1,open:!1,findQuery:t?"":e.findQuery}))))}function T(e){const{environment:t,selectedString:n,textSelection:o}=e,r=n&&n.length>0;v.ZP.update((e=>({...e,open:!0,findQuery:r?n:v.ZP.state.findQuery,focused:!0,showReplaceInput:!1,textSelection:o}))),x.clear({environment:t})}function M(){v.ZP.state.focused||v.ZP.update((e=>({...e,focused:!0})))}function P(){v.ZP.update((e=>({...e,showReplaceInput:!e.showReplaceInput,focused:e.showReplaceInput})))}const A=200;function R(e){const{environment:t,matches:n,replace:o,find:i,intl:d,editorViewEditorModeMap:u}=e,{pageDetails:{activePageDetails:m,secondaryPageDetails:g}}=e,f=o.length-i.length,h=n.filter(s.$K).filter((e=>(0,c.uk)({environment:t,match:e,pageStore:e.view===m.view?m.store:null==g?void 0:g.store}))),y={id:"",columnId:void 0,offset:0};0!==h.length?(h.length>1&&C({clearQuery:!1}),a.yo(h,A).forEach((e=>{I.createAndCommit({userAction:"findAndReplaceInstance",environment:t,perform:n=>{e.forEach((e=>{if(!e.allowReplace)return;const{blockStore:a,selection:s}=e,c="block"===e.type,d=c?e.propertyType:e.propertyId,m=a.getPropertyStore(d);if(!m)return;const g=e.blockStore.id,h=c?void 0:e.propertyId;y.id!==g||y.columnId!==h?(y.id=g,y.columnId=h,y.offset=0):y.offset+=f;const v=s.startIndex+y.offset,b=s.endIndex+y.offset,_=("main"===e.view?u.main:u.side_peek)??"default",S=(0,p.OT)({startIndex:v,endIndex:b},m,_).toArray().filter(r.f_I);if("suggest"===_){const o={start:{store:m,index:v},end:{store:m,index:b}},r=(0,l.oG)(t,n,e.blockStore);(0,l.Sz)({environment:t,multiSelection:o,transaction:n,discussionStore:r}),y.offset+=i.length}else w.pe({environment:t,selection:{startIndex:v,endIndex:b},store:m,transaction:n});const k=S.length>0?[o,S]:[o];w.mM({environment:t,index:"default"===_?v:v+i.length,store:m,tokens:[k],transaction:n,editorMode:_})}))}}),k.d4({item:{label:d.formatMessage({id:"inPageFind.replaceAll.snackbarCopy",defaultMessage:"{numMatches, plural, one {Replaced {numMatches} match} other {Replaced {numMatches} matches}}"},{numMatches:e.length})},undoFunc:()=>{v.ZP.update((e=>({...e,open:!0,showReplaceInput:!0})))}})}))):k.oV({label:d.formatMessage({id:"inPageFind.replaceAll.noMatches",defaultMessage:"No matches replaced"})})}async function D(e){var t;const{match:n,pagePropertiesStore:r,pageStore:a,environment:s}=e;if(a){switch(n.type){case"block":case"simple_table_cell":await S.Nz(a,[n.blockStore.id]),l();break;case"page_property_name":case"page_property_value":const e=a.getAssociatedCollectionStore(),i=null==e||null===(t=e.getNormalizedPropertyGroups())||void 0===t?void 0:t.find((e=>{let{propertyIds:t}=e;return null==t?void 0:t.includes(n.propertyId)}));n.visible||!r||r.state.forceShowProperties||r.update((e=>({...e,forceShowProperties:!0})));if(!(null==e?void 0:e.getLayoutStore()))break;n.isMatchInLayoutPageDetails?(0,m.U)({environment:s,savePreference:!1,from:"search"}):l(),n.isPropertyInGroup&&i&&f.Z.setPropertyGroupExpandedOverride({groupId:i.id,override:"open"});break;case"comment":l(),await S.Nz(a,[n.blockStore.id]);const c=h.Z.find((e=>e.getStore().id===n.discussionId)),d=null==c?void 0:c.getNode();if(!(d&&d instanceof Element))return;const u=d.getBoundingClientRect();await b.Ib({analyticsFrom:"in_page_find",blockStore:n.blockStore,environment:s,shouldFocusDiscussion:!1,recursivelyLoadAllDiscussions:!1,rect:u}),await o.default.afterNextFlush((()=>{const e=null==c?void 0:c.getMarginDiscussionScrollContainer();e&&e.scrollToBottom({animate:!0})}))}("page_property_name"!==n.type&&"page_property_value"!==n.type||!n.isMatchInLayoutPageDetails)&&await async function(e){await o.default.afterNextFlush();const t=document.getElementsByClassName(i.qp).item(0);if(!t)return;const n="main"===e.view?d.Z.PageScroller:d.Z.PeekViewScroller;if(!n)return;_.bx({element:t,scrollers:{verticalScroller:n,horizontalScroller:void 0},vertical:{reveal:"closest"},horizontal:void 0,animate:!1})}(n)}function l(){"popup"===g.Z.state.displayStyle&&(0,m.n)({environment:s,savePreference:!1,from:"search"})}}function B(e){const t=e.getElementsByClassName(i.qp);if(!t.length)return;const n=t.item(0);n&&(0,u.n5)({element:n,block:"center",inline:"nearest"})}},844886:(e,t,n)=>{n.d(t,{A1:()=>h,WY:()=>g,dD:()=>p,gq:()=>b,nt:()=>y,rB:()=>f,uv:()=>m,vi:()=>v});n(757658);var o=n(541432),r=n(421202),i=n(653965),a=n(721429),s=n(635328),l=n(95802),c=n(226664),d=n(445131),u=n(594419);function p(e){const{parentStore:t,blockStore:n,type:o,transaction:r}=e,i=t.getTransclusionReferenceTargetStore()??t,a=i.getContentStores(),l=a.indexOf(n);if(l<=0)return;const c=a[l-1];if(!c)return;if(!_(i)||!_(c))return;if("transclusion_container"===c.getType()||"transclusion_reference"===c.getType()||c.isCalloutV2())return;u.Od({parentStore:i.getContentStore(),childToRemoveStore:n,transaction:r});const{childStore:p}=u.R3({parentStore:c.getContentStore(),appendStore:n,transaction:r});if("self"===o&&!p.isType("table"))for(const s of p.getContentStores().reverse())u.Od({parentStore:p.getContentStore(),childToRemoveStore:s,transaction:r}),u.BE({parentStore:c.getContentStore(),insertStore:s,afterStore:p,transaction:r});return s.BX(c)&&d.Z.setOpen(c.id,!0),p}function m(e){const{grandparentStore:t,parentStore:n,blockStore:o,transaction:r}=e,i=t.getTransclusionReferenceTargetStore()??t;if(i.getContentStores().indexOf(n)<0)return;const a=n.getContentStores(),s=a.indexOf(o);if(s<0)return;if(!_(i)||!_(n))return;if("transclusion_container"===n.getType()||"transclusion_reference"===n.getType()||n.isCalloutV2())return;if(_(o))for(let c=s+1;c<a.length;c++){const e=a[c];u.Od({parentStore:n.getContentStore(),childToRemoveStore:e,transaction:r}),u.R3({parentStore:o.getContentStore(),appendStore:e,transaction:r})}u.Od({parentStore:n.getContentStore(),childToRemoveStore:o,transaction:r});const{childStore:l}=u.BE({parentStore:i.getContentStore(),insertStore:o,afterStore:n,transaction:r});return l}function g(e){const{transaction:t}=e,n=e.blocks,o=n[0];if(!o)return;const r=S(o);if(!r)return;const{previousChildStore:i}=r,a=i.getContentStore();return s.BX(i)&&d.Z.setOpen(i.id,!0),n.map((e=>{const n=e.getRecordStoreUIParent();null!=n&&n.valueIs(c.i)&&u.Od({parentStore:n,childToRemoveStore:e,transaction:t});return u.R3({parentStore:a,appendStore:e,transaction:t}).childStore}))}function f(e){const{transaction:t}=e;let n=e.blocks;const o=n[0];if(!o)return;const r=k(o);if(!r)return;const{parentBlockStore:a,grandparentBlockStore:s}=r,l=a.getContentStores(),d=s.getContentStore();if(l){let e;for(const[t,o]of l.entries())if(o.id===n[n.length-1].id){e=l.splice(t+1);break}n=i.d9(n).reverse(),n=n.map(((n,o)=>{const r=n.getRecordStoreUIParent();null!=r&&r.valueIs(c.i)&&u.Od({parentStore:r,childToRemoveStore:n,transaction:t});const i=u.BE({parentStore:d,insertStore:n,afterStore:a,transaction:t});if(0===o&&e&&_(n))for(const a of e){const e=a.getRecordStoreUIParent();null!=e&&e.valueIs(c.i)&&u.Od({parentStore:e,childToRemoveStore:a,transaction:t}),u.BE({parentStore:n.getContentStore(),insertStore:a,transaction:t})}return i.childStore}))}return n}function h(e){const{transaction:t,blocks:n}=e,o=n[0];if(!o)return;const r=a.RM();if(!r)return;const s=x(r),l=i.cx(s,(e=>e.parentStore===o.getRecordStoreUIParent()&&e.afterStore===o)),c=i.qr(s,((e,t)=>t<l&&e.parentStore===o.getRecordStoreUIParent())),d=i.dF(s,((e,t)=>t<c&&!o.uiContains(e.parentStore)));return d?C({blocks:n,listPosition:d,transaction:t}):void 0}function v(e){const{transaction:t,blocks:n}=e,o=i.Z$(n);if(!o)return;const r=a.RM();if(!r)return;const s=x(r),l=i.cx(s,(e=>e.parentStore===o.getRecordStoreUIParent()&&e.afterStore===o)),c=s.find(((e,t)=>t>l&&!o.uiContains(e.parentStore)));return c?C({blocks:n,listPosition:c,transaction:t}):void 0}function y(e){return Boolean(e&&S(e))}function b(e){return Boolean(e&&k(e))}function _(e){const t=a.np(),n=e.getType(),r=e.getFormat();return n&&((0,o.TT)(n,r)||e===t)}function S(e){const t=e.getRecordStoreUIParent();if(null==t||!t.isTable(r.iU))return;const n=t.getAncestorRecordStoreAtRootPath();if(null==n||!n.isDefined()||!_(n))return;const o=n.getContentStores(),i=o[o.indexOf(e)-1];return null!=i&&i.isDefined()&&_(i)?{previousChildStore:i}:void 0}function k(e){const t=e.getRecordStoreUIParent();if(null==t||!t.isTable(r.iU))return;const n=t.getAncestorRecordStoreAtRootPath();if(null==n||!n.isDefined()||!_(n))return;const o=n.getRecordStoreUIParent();if(null==o||!o.isTable(r.iU))return;const i=o.getAncestorRecordStoreAtRootPath();return null!=i&&i.isDefined()&&_(i)?{parentBlockStore:n,grandparentBlockStore:i}:void 0}function w(e,t){let n=[];const{store:o}=e.props;if(e.props.canDropAbove&&I(o)){const e=o.getRecordStoreUIParent();null!=e&&e.valueIs(c.i)&&n.push({parentStore:e})}const r=t.filter((t=>t.getContextClosestSelectable()===e));for(const a of r)n=i.G0(n,w(a,t));if(e.props.canDropBelow&&I(o)){const e=o.getRecordStoreUIParent();null!=e&&e.valueIs(c.i)&&(e.id===o.id?n.push({parentStore:e}):n.push({parentStore:e,afterStore:o}))}return n}function x(e){let t=[];const n=l.C.getMembersByDOMOrder({filter:()=>!0}),o=e.getContentStores();for(const r of o){const e=n.find((e=>e.props.store===r));e&&(t=i.G0(t,w(e,n)))}return t}function I(e){return"collection"!==e.getParentTable()}function C(e){const{blocks:t,listPosition:n,transaction:o}=e,r=i.d9(t).reverse();for(const i of t){const e=i.getRecordStoreUIParent();null!=e&&e.valueIs(c.i)&&u.Od({parentStore:e,childToRemoveStore:i,transaction:o})}let a;return a=n.afterStore?r.map((e=>u.BE({insertStore:e,afterStore:n.afterStore,parentStore:n.parentStore,transaction:o}).childStore)):r.map((e=>u.Ce({prependStore:e,parentStore:n.parentStore,transaction:o}).childStore)),a}},532603:(e,t,n)=>{n.r(t),n.d(t,{markInitialPageRenderComplete:()=>b,measureSubMetrics:()=>v,setInitialRenderCompleted:()=>f,setNavigatedAfterInitialRenderCompleted:()=>h,setSubMetric:()=>m,setSubMetricsAtRenderCallback:()=>p,updateMetricData:()=>g,updateMetricDataWithIsPushTag:()=>y});var o=n(703925),r=n(805809),i=n(583055),a=n(994134),s=n(318245),l=n(385555),c=n(577144),d=n(141737),u=n(661802);function p(e){const{mainStartTime:t,prefetchInitiatedTime:n,renderStartTime:o,renderEndTime:i}=e,a=r.getAppStartTime();if(!a)return;const s={app_start_to_main_start:{startTime:a,endTime:t},main_start_to_prefetch_initiated:{startTime:t,endTime:n},prefetch_initiated_to_render_start:{startTime:n,endTime:o},render_start_to_render_end:{startTime:o,endTime:i}};c.Z.state.subMetricsStore.update((e=>({...e,...s})))}function m(e){const{name:t,endTime:n}=e,o=e.startTime(c.Z.state.subMetricsStore.state);o&&c.Z.state.subMetricsStore.update((e=>({...e,[t]:{startTime:o,endTime:n}})))}function g(e){c.Z.state.metricDataStore.update((t=>({...t,...e})))}function f(){c.Z.update((e=>({...e,initialRenderCompleted:!0})))}function h(){c.Z.update((e=>({...e,navigatedAfterInitialRenderCompleted:!0})))}function v(e,t){for(const[n,o]of Object.entries(i.getFilteredSubMetrics()))o&&s.default.measure({metricName:n,startTime:o.startTime,endTime:o.endTime},{environment:e,data:{page_type:t}})}function y(e){const t=e.RouterStore.state;let n;var o;"page"===t.route.name&&(n=t.route.mobileData,g({is_push:null===(o=n)||void 0===o?void 0:o.isPush}))}function b(e){let{environment:t,isEditable:n,isHomePage:p,isWikiHome:g}=e;const h=t.RouterStore.state,v=h.initialRoute.name,{initialRenderCompleted:y,initialRenderAfterLoginCompleted:b,initialLoadCachedPageChunkCalledAt:_}=c.Z.state,S="page"===h.route.name?h.route.mobileData:void 0;if(y)if(b||"login"!==v){const e=u.Z.popNavigationStartTime();e&&s.default.DO_NOT_USE_measureLegacy({metricName:"navigation_page_render",startTime:e},{environment:t,data:{is_push:(null==S?void 0:S.isPush)??!1,wasm_sqlite_initialized:c.Z.state.metricDataStore.state.wasm_sqlite_initialized,wasm_sqlite_storage:c.Z.state.metricDataStore.state.wasm_sqlite_storage,functional_component_page_loading_container:l.default.checkGate({gateName:"functional_component_page_loading_container"})}}),d.Z.state.isMeasuring&&d.Z.update((e=>({...e,isMeasuring:!1})))}else s.default.DO_NOT_USE_measureLegacy("initial_page_render_after_login",{environment:t}),c.Z.update((e=>({...e,initialRenderAfterLoginCompleted:!0})));else{var k;f();const e=Boolean(null===(k=performance)||void 0===k?void 0:k.mark)?performance.mark("initial_page_render").startTime:performance.now();o.h1.mark("initial_page_render"),m({name:"await_page_chunk_end_to_browser_repaint_start",startTime:e=>{var t;return null===(t=e.await_page_chunk_start_to_await_page_chunk_end)||void 0===t?void 0:t.endTime},endTime:e}),s.default.measureFromAppStart({metricName:"initial_page_render",endTime:e},{environment:t,data:{...i.getSubMetricsAndMetricDataForTracking(),initial_route:v,is_editable:n,is_home_page:p,profiling_tool:(0,a.getProfilingToolForSession)(),is_wiki_home:g,time_origin_to_app_start:r.getAppStartTime(),functional_component_page_loading_container:l.default.checkGate({gateName:"functional_component_page_loading_container"})},shouldSendIfStatsigNotInitialized:!0}),void 0!==_&&s.default.DO_NOT_USE_measureFromAppStartLegacy({metricName:"load_cached_page_chunk_wait_time",endTime:_},{environment:t,data:{initial_route:v},shouldSendIfStatsigNotInitialized:!0})}}},388295:(e,t,n)=>{n.d(t,{Hk:()=>M,c_:()=>I,f8:()=>x,gt:()=>T,lP:()=>C});var o=n(541432),r=n(421202),i=n(182798),a=n(401898),s=n(119785),l=n(668422),c=n(721429),d=n(798165),u=n(367669),p=n(80444),m=n(896026),g=n(206258),f=n(100952),h=n(554569),v=n(498834),y=n(594419),b=n(760870),_=n(211302),S=n(419358),k=n(709953),w=n(210228);function x(e){const{environment:t,transaction:n,titleText:o,recordStoreParentStore:a}=e,{databaseTemplateStore:s,createInValue:l}=function(e,t){let n;if("page"===e.type){const o=g.G.createChildStore(t,{table:r.iU,id:e.id});if(o.isTemplate()){const t=(0,d.Dg)(o,1);t&&(n=o,e={type:"page",id:t.id})}}return{databaseTemplateStore:n,createInValue:e}}(e.createInValue,a),c="block"===l.type?g.G.createChildStore(a,{table:r.iU,id:l.id}):void 0,u=k.j4({transaction:n,environment:t,type:"page",inMemoryRecordCache:t.defaultRecordCache.inMemoryRecordCache,properties:o?{title:[[o]]}:void 0,spaceId:a.pointer.spaceId,useCrdt:"block"===l.type&&(0,i.TO)(c).useCrdt()});let p;if("block"===l.type)S.YM({transaction:n,childStore:u,parentStore:(0,i.TO)(c),alive:!0});else p=_.Ws({transaction:n,environment:t,targets:[u],value:l});return{environment:t,databaseTemplateStore:s,createdPages:[u],moveToStorePromise:p}}async function I(e){const{environment:t,createdPages:n,databaseTemplateStore:o,moveToStorePromise:i}=e.createInState;let a,s;(null==n?void 0:n.length)>0&&(a=n[0].id,s=n[0].getParentCollectionIdUpToTwoLevels()),f.W(t,{type:"page",from:e.analyticsFrom,new_page_id:a,creating_block_id:a,parent_collection_id:s});const{currentSpaceStore:l}=p.default.state;if(o)w.createAndCommit({userAction:"inlinePageActions.completeCreateIn",environment:t,perform:e=>{n.forEach((n=>v.ob({title:{text:n.getTitleValue()},environment:t,store:n,templateStore:o,isKeyboard:!1,isCreateIn:!0,transaction:e,from:"inline_page_action"})))}}),l&&await b.j2(l,l.id,o.id);else{const e=await i;l&&e&&e.table===r.iU&&await b.j2(l,l.id,e.id)}}function C(e){const{environment:t,transaction:n,parentStore:i,inlinePageIds:l}=e;if(0===l.length)return;const c=g.G.createChildStore(i,i.pointer),p=(0,d.qA)(c).find((e=>{if(e.table!==r.iU)return!1;const t=e.getType(),n=e.getFormat();return!(!t||!n)&&((0,o.Um)(t,n)||(0,o.S9)(t))})),f=p&&p.isCollectionView()?p.getCollectionViewCollectionStore():p,v=f&&m.Z.getMode(t,f);if(!f||(0,u.YF)(v)||!f.canEdit()){for(const e of l)s.nO({pageStore:g.G.createChildStore(i,{table:r.iU,id:e}),transaction:n});return}let b=i;for(const o of l){const e=g.G.createChildStore(i,{table:r.iU,id:o});if(e.isEmptyPage()){s.nO({pageStore:e,transaction:n});continue}const l=!e.isDefined()||Boolean(e.getAlive());S.YM({parentStore:f,childStore:e,transaction:n,alive:l}),"block"!==f.table?"collection"!==f.table?(0,a.t1)(f):h.mp({environment:t,store:e,collectionStore:f,shouldCoerce:!0,groupsPointer:[],transaction:n}):(y.BE({parentStore:f.getContentStore(),afterStore:b,insertStore:e,transaction:n}),b=e)}}function T(e){const t=c.np();if(t){if(e&&e.table===r.iU)return{pageStore:(0,d.Dg)(e,0)||t,createInValue:{type:"block",id:e.id}};if(e&&(0,d.n3)(e)){const t=(0,d.Dg)(e,0);if(t)return{pageStore:t,createInValue:{type:"page",id:t.id}}}return{pageStore:t,createInValue:{type:"page",id:t.id}}}}async function M(e,t){const{createInValue:n,blocksToTransform:o}=t,i="page"===n.type?new g.G(e,{table:r.iU,id:n.id}):void 0,a=Boolean(i&&i.isTemplate()),{performResult:{transformedPages:s,pageStore:c}}=await w.createAndCommitAsync({environment:e,userAction:"inlinePageActions.createNewPageIn",waitForServerCommit:!0,perform:async t=>{const s=o.map((n=>l.vs({environment:e,block:n,blockType:"page",transaction:t})));let c;if("page"===n.type)if(i&&a){const n=i.getAssociatedCollectionStore(),o=null==n?void 0:n.getParentPointer();o&&o.table===r.iU&&(c=await _.Y({transaction:t,environment:e,targets:s,value:{type:"page",id:o.id}}))}else{const{mainEditorCurrentBlockStore:o}=p.default.state;o&&o.id!==n.id&&(c=await _.Y({transaction:t,environment:e,targets:s,value:n}))}else"team"===n.type&&await _.Ws({transaction:t,environment:e,targets:s,value:n});return{transformedPages:s,pageStore:c}}});await I({analyticsFrom:"new_page_in",createInState:{environment:e,createdPages:s,databaseTemplateStore:a?i:void 0,moveToStorePromise:Promise.resolve(c)}})}},196313:(e,t,n)=>{n.d(t,{QZ:()=>D,az:()=>E,pg:()=>B});var o=n(126263),r=n(14577),i=n(541432),a=n(959753),s=n(599405),l=n(421202),c=n(933709),d=n(23867),u=n(421838),p=n(401898),m=n(709953),g=n(524677),f=n(898104),h=n(95477),v=n(269783),y=n(165598),b=n(389224),_=n(704266),S=n(770726),k=n(964233),w=n(348863),x=n(319111),I=n(206258),C=n(352229),T=n(288864),M=n(594419),P=n(504408),A=n(800993),R=n(210228);function D(e){const{environment:t,textStore:n,blockStore:i,url:a,oldTextValue:u,urlSelection:p}=e;if(_.Z.state.open||v.Z.state.open||x.Z.state.open||k.Z.state.open)return!1;const m=b.get();if(!m)return!1;const g=b.getRect(m);if(!g)return!1;const f=(0,s.parseRoute)({url:a,baseUrl:h.default.domainBaseUrl,publicDomainName:h.default.publicDomainName,isMobile:t.device.isMobile,protocol:h.default.protocol,currentUrl:window.location.href});if("page"===f.name&&!!f.discussionId&&f.discussionId){const e=f.discussionId,s=f.blockId,m=i.getParentBlockStore();if(!m)return!1;const h=(0,I.Kv)(m,{table:l.iU,id:s,spaceId:(0,d.C)(m.pointer.spaceId)}),v=(0,I.Kv)(h,{table:c.qF,id:e,spaceId:(0,d.C)(i.pointer.spaceId)});if("none"===v.getRole())return!1;const b=new r.ZP((()=>y.D4(v)[0]),{debugName:"firstCommentStore"}),_=new o.Z({name:"internalUnfurlingMenuActions.activate",isTemporaryData:!0});t.defaultRecordCache.inMemoryRecordCache.addCacheOverride(_);const k=i.clone(_),x=n.clone(_),C=m.clone(_);return w.Z.setState({args:{commentStore:b},stores:{blockStore:i,textStore:n,parentStore:m},temporaryStores:{blockStore:k,textStore:x,parentStore:C},temporaryRecordCache:_,focusedIndex:S.Z.Preview,selectionRect:g,oldTextValue:u,open:!0,url:a,urlSelection:p}),T.el(t,{url:a}),!0}return!1}function B(e){const{actionType:t,environment:n,commentStore:o,useTempStores:r}=e,i=w.Z.state;if(!i.open)return;const{oldTextValue:s}=i,l=r?i.temporaryStores:i.stores,{textStore:c,blockStore:m,parentStore:h}=l,v=n.currentUser.id;if(v){if(r){i.temporaryRecordCache.clearCache();for(const e in i.temporaryStores){const t=i.temporaryStores[e],o={userId:v,pointer:t.pointer},r=n.defaultRecordCache.inMemoryRecordCache.getRecord(o);r?P.Wl({environment:n,inMemoryRecordCache:i.temporaryRecordCache,pointer:t.pointer,model:a.kk5.fromValue(t.pointer.table,r.value),role:r.role,updatePaths:[[]],userId:v,force:!0,debugSource:"setUnfurlType"}):P.uo({environment:n,inMemoryRecordCache:i.temporaryRecordCache,persistedRecordCache:void 0,pointer:t.pointer,userId:v})}}else n.defaultRecordCache.inMemoryRecordCache.removeCacheOverride(i.temporaryRecordCache);switch(t){case S.Z.Link:g.eP({environment:n,store:i.stores.blockStore}),f.setSelection({store:i.stores.textStore,selection:{startIndex:i.urlSelection.endIndex,endIndex:i.urlSelection.endIndex}}),w.Z.setState({...i,focusedIndex:S.Z.Link});break;case S.Z.Mention:if(!o)return;const e=(0,d.C)(c.pointer.spaceId);if(!e)return;const r=o.id;R.createAndCommit({environment:n,userAction:"internalUnfurlingMenuActions.mention",perform:t=>{A.sO({environment:n,store:c,value:s,transaction:t}),A.lZ({environment:n,editorMode:"default",store:c,selection:{startIndex:i.urlSelection.startIndex,endIndex:i.urlSelection.startIndex},annotation:u.mfJ(r,e),transaction:t,analyticsFrom:"block"})}}),w.Z.setState({...i,focusedIndex:S.Z.Mention});break;case S.Z.Preview:if(!o)return;R.createAndCommit({environment:n,userAction:"internalUnfurlingMenuActions.preview",perform:e=>{A.sO({environment:n,store:c,value:s,transaction:e});const t=y.GP(o);if(!t)return;if(!y.HK(t)||!h||!t.getParentId())return;const r=C.k({environment:n,parentBlockStore:h,targetStore:o,transaction:e});if(M.BE({parentStore:h.getContentStore(),insertStore:r,afterStore:m,transaction:e}),0===u.QaF(i.oldTextValue).trim().length){const t=I.G.createChildStore(h.getContentStore(),i.stores.blockStore.pointer);M.Od({parentStore:h.getContentStore(),childToRemoveStore:t,transaction:e})}}}),w.Z.setState({...i,focusedIndex:S.Z.Preview});break;default:throw(0,p.t1)(t)}r||w.Z.setState({open:!1})}}function E(e){var t,n;const{blockStore:o,transaction:r}=e,a=o.getType(),s=o.getFormat(),l=o.getSpaceId();if(!o.isDefined()||a!==i.Ti.alias||null==s||null===(t=s.alias_pointer)||void 0===t||!t.id)return;const c=[u.YCD(u.mfJ(null==s||null===(n=s.alias_pointer)||void 0===n?void 0:n.id,l))];m.sW({store:o,data:{type:i.Ti.text},transaction:r}),m.sW({store:o.getFormatStore(),data:{alias_pointer:null},transaction:r}),A.sO({environment:o.environment,store:o.getBlockTitleStore(),value:c,transaction:r})}},391367:(e,t,n)=>{n.d(t,{G2:()=>P,Pf:()=>A,Wf:()=>R,jW:()=>D});var o=n(371663),r=n(841892),i=n(406695),a=n(568626),s=n(421838),l=n(709291),c=n(653965),d=n(547307),u=n(940663),p=n(296994),m=n(855337),g=n(979947),f=n(137772),h=n(433929),v=n(548779),y=n(80444),b=n(121039),_=n(206258),S=n(992083),k=n(30397),w=n(21359),x=n(792625),I=n(709953),C=n(210228),T=n(61202);const M=(0,l.defineMessages)({JiraAuthorizationError:{id:"jiraImport.unauthorizedAccess",defaultMessage:"Unauthorized Error: API key does not belong to Jira Admin."},JiraAuthenticationSuccess:{id:"jiraImport.successfulAuth",defaultMessage:"Successfully established Jira connection"},JiraAuthenticationInvalidDetails:{id:"jiraImport.invalidDetails",defaultMessage:"Invalid Details"},TasksCollectionName:{defaultMessage:"Issues",id:"appTemplates.tasks.issuesDatabaseName"},JiraFetchAccountError:{id:"jiraSync.setup.fetchAccountError.message",defaultMessage:"Failed to fetch accounts"}});async function P(e){const{environment:t,userEmail:n,apiToken:o,spaceId:r,flowId:i,instance:s}=e;(0,m.j)({environment:t,event:{eventName:"external_sync_auth",eventProperties:{integration:"jira",actionType:"admin_auth_initiated",flowId:i}}});try{var u;const a=e.site.replace(/\/+$/,"");if(!t.currentUser.id)return d.showMessage({message:h.default.formatMessage(M.JiraAuthenticationInvalidDetails)}),void x.x();const f=await w.authenticateJiraUser(t,{userEmail:n,site:a,apiKey:o,userId:t.currentUser.id,spaceId:r,instance:s});if(await T.pJ({environment:t}),(0,m.j)({environment:t,event:{eventName:"external_sync_auth",eventProperties:{integration:"jira",actionType:"admin_auth_status",flowId:i,status:"success"===f.type&&null!=f&&null!==(u=f.data)&&void 0!==u&&u.isAdmin?"success":"failed"}}}),"failed"===f.type){const e=(0,g.getDebugMessageForApiRequestFailure)(f);console.error(f.error);const t=b.Z.getInitialState();b.Z.setState(t);const n=(0,l.defineMessages)({dismissButtonLabel:{defaultMessage:"OK",id:"dialog.dismissButton.label"}});d.showDialog({message:e,showCancel:!1,keepFocus:!1,items:[{label:h.default.formatMessage(n.dismissButtonLabel),onAccept:c.yR}]})}else{var p;if(null!=f&&null!==(p=f.data)&&void 0!==p&&p.isAdmin){b.Z.setState({...b.Z.state,type:"teamspace-selection",open:!0,flowId:i,site:a,botId:f.data.botId}),(0,m.j)({environment:t,event:{eventName:"external_sync_teamspace_selection",eventProperties:{integration:"jira",actionType:"teamspace_modal_render",flowId:i}}});const e=S.Z.getInitialState();S.Z.setState(e)}else b.Z.setState({...b.Z.state,type:"auth",open:!0,adminTokenError:!0,flowId:i,site:void 0}),(0,m.j)({environment:t,event:{eventName:"external_sync_auth",eventProperties:{integration:"jira",actionType:"admin_auth_render",flowId:i}}})}x.x()}catch(f){(0,m.j)({environment:t,event:{eventName:"external_sync_auth",eventProperties:{integration:"jira",actionType:"admin_auth_status",flowId:i,status:"failed"}}}),a.log({level:"error",from:"jiraActions",type:"authenticateWithJira",data:{message:"Failed to authenticate with Jira",miscDataToConvertToString:{err:f}}})}}async function A(e){let{environment:t,selectedTeamspaceId:n,siteUrl:l,botId:c,instanceType:d}=e;try{const{appTemplatesSetupActions:e,appConfigs:a}=await p.FF.AppTemplates.load(),{teams:m}=k.Z.getState(),{currentSpaceStore:g,currentSpaceViewStore:f}=y.default.getState(),v=n?m.find((e=>e.id===n)):g;if(!f||!v)return;const{serverCommitResult:b,performResult:S}=C.createAndCommit({environment:t,perform:n=>{var r;const i={type:"preset",uri:o.T3}.uri,s=null===(r=(0,u.iX)(a(),i))||void 0===r?void 0:r.uri;if(!s)return;const l=a().find((e=>e.uri===s));if(null==l?void 0:l.presets.find((e=>e.uri===i))){return e.initializeApp({environment:t,spaceViewStore:f,appParentStore:v,appUri:s,presetUri:i,transaction:n,from:"jira_import"})}return[]},userAction:"importActions.importJira"}),w=t.defaultRecordCache.inMemoryRecordCache;return await b,null==S||S.forEach((e=>{const n=e.getFormat(),a=null==n?void 0:n.collection_pointer;if(a){const e=w.getRecord({pointer:a,userId:t.currentUser.id});e&&e.value&&C.createAndCommit({userAction:"jiraActions.updateFormatForCollections",environment:t,perform:n=>{const u=e.value,p=null==u?void 0:u.format;if(p){p.external_collection_type=i.Vj.Jira,p.synced_collection_external_url=l,p.synced_collection_instance_type=d,p.bot_id=c,u.icon=p.app_config_uri===o.Ym?r.Z.images.appPackages.jiraTaskIconSvg:r.Z.images.appPackages.jiraProjectIconSvg;const e=new _.NW(t,a);p.app_config_uri===o.Ym&&(u.name=(0,s.TPx)(h.default.formatMessage(M.TasksCollectionName))),I.sW({store:e,data:u,transaction:n})}}})}})),null==S?void 0:S.find((e=>{var t;return(null===(t=e.getFormat())||void 0===t?void 0:t.app_config_uri)===o.Aw}))}catch(m){return void a.log({level:"error",from:"jiraActions",type:"projectPageNotCreated",data:{message:"Error while creating project page for Jira sync",miscDataToConvertToString:{error:m}}})}}function R(e){const t=b.Z.state.spaceId;if(e.spaceId!==t){const t=b.Z.getInitialState();t.spaceId=e.spaceId,b.Z.setState(t)}}async function D(e){var t;const{environment:n,from:o,action:r}=e,{currentSpaceStore:i,currentUserSettingsStore:s}=y.default.state;if(!i)return;const l=b.Z.getFlowId(),c=(0,v.lQ)(i);if(!(void 0!==(null==s||null===(t=s.getSettings())||void 0===t?void 0:t.jira_sync_guide_dismissed_at))&&c)return void("collection_header"===o||"improve_jira_sync_popup"===o?(b.Z.setState({...b.Z.state,rootAction:r,type:"improve-jira-sync",open:!0}),(0,m.j)({environment:n,event:{eventName:"external_sync_setup_action",eventProperties:{integration:"jira",actionType:"improve_jira_sync_modal_render",flowId:l}}})):(b.Z.setState({...b.Z.state,rootAction:r,type:"sync-guide",open:!0}),(0,m.j)({environment:n,event:{eventName:"external_sync_setup_action",eventProperties:{integration:"jira",actionType:"sync_guide_render",flowId:l}}})));let d=(await(0,f.jl)(n,i.id)).account;d||(d=[],a.log({level:"debug",from:"jiraActions",type:"setupJiraSync",data:{miscDataToConvertToString:{spaceId:i.id}}}));const u=b.Z.state.rootAction;!d.length||"add_account"===r||"sync_guide"===o&&"add_account"===u?c?(b.Z.setState({...b.Z.state,type:"auth",open:!0}),(0,m.j)({environment:n,event:{eventName:"external_sync_auth",eventProperties:{integration:"jira",actionType:"admin_auth_render",flowId:l}}})):(b.Z.setState({...b.Z.state,type:"request-feature",open:!0}),(0,m.j)({environment:n,event:{eventName:"external_sync_setup_action",eventProperties:{integration:"jira",actionType:"request_feature_render",flowId:l}}})):(b.Z.setState({...b.Z.state,type:"teamspace-selection",open:!0}),(0,m.j)({environment:n,event:{eventName:"external_sync_teamspace_selection",eventProperties:{integration:"jira",actionType:"teamspace_modal_render",flowId:l}}}))}},662134:(e,t,n)=>{n.d(t,{Fe:()=>a,Zm:()=>l,dJ:()=>i,ys:()=>s});n(757658);var o=n(653965);function r(e,t){return e.KeyboardShortcutStackStore.state.stack.some((e=>t===e.listener))}function i(e,t,n){const{stack:o}=e.KeyboardShortcutStackStore.state;for(let r=o.length-1;r>=0;r--){const i=o[r],a=i.shortcuts[n];if(e.KeyboardShortcutStackStore.debugPropagation){const[t,o]=e.KeyboardShortcutStackStore.getDebugInfoForStackItem(r),s=i.enable&&a?`propagating ${n} to ${t}`:`not propagating ${n} to ${t}`;console.info(`keyboardShortcutStackActions: ${s}`,o)}if(i.enable&&a)return void a(t)}}function a(e){const{environment:t,stackItem:n}=e,i=t.KeyboardShortcutStackStore;if(r(t,n.listener)){const e=i.state.stack.map((e=>e.listener===n.listener?n:e));i.setState({...i.state,stack:e})}else i.state.stack.push(n),i.setState({stack:o.MR(i.state.stack,(e=>e.priority))})}function s(e,t){if(r(e,t)){const n=e.KeyboardShortcutStackStore,r=n.state.stack,i=o.d1(r,(e=>t===e.listener));n.setState({...n.state,stack:i})}}function l(e,t){i(e,t,t.type)}},294273:(e,t,n)=>{n.d(t,{Bk:()=>m,Ie:()=>f,Vr:()=>g,nr:()=>h,vq:()=>v});var o=n(599405),r=n(421202),i=n(554153),a=n(95477),s=n(484210),l=n(367669),c=n(206258);const d="lastVisitedRoute",u="lastVisitedRouteUserId",p="lastVisitedRouteSpaceId";function m(e,t){const n=o.parseRoute({url:window.location.href,isMobile:e.device.isMobile,baseUrl:a.default.domainBaseUrl,publicDomainName:a.default.publicDomainName,protocol:a.default.protocol,currentUrl:window.location.href}),{route:i,userId:s}=y();("root"===n.name||"new"===n.name||"nativeTab"===n.name)&&i&&"page"===i.name&&i.blockId&&s===t&&new c.G(e,{table:r.iU,id:i.blockId,spaceId:i.spaceId}).load()}function g(e){const{route:t,userId:n}=y();if(t&&"page"===t.name){return{url:(0,s.ZP)({fullyQualified:!1,store:new c.G(e,{table:r.iU,id:t.blockId,spaceId:t.spaceId},{userId:n}),scrollToBlockId:t.scrollToBlockId,peekViewBlockId:t.peekViewBlockId,peekMode:t.peekMode,collectionViewId:t.collectionViewId,templateGalleryItem:t.templateGalleryItem,projectManagementLaunch:t.projectManagementLaunch,discussionId:void 0,pageVisitSource:void 0}),userId:n}}if(t&&"space"===t.name){return{url:(0,o.createSpaceUrlPath)({route:t}),userId:n}}return{}}async function f(e){const{route:t,userId:n}=y();let i,a;if(t)if("page"===t.name){const d=new c.G(e,{table:r.iU,id:t.blockId,spaceId:t.spaceId},{userId:n});await d.load();l.IJ(e,d)?(a=t.spaceId??d.getSpaceId(),i=a?o.createSpaceUrlFromSpaceId(a):void 0):(i=(0,s.ZP)({fullyQualified:!1,store:d,scrollToBlockId:t.scrollToBlockId,peekViewBlockId:t.peekViewBlockId,peekMode:t.peekMode,collectionViewId:t.collectionViewId,templateGalleryItem:t.templateGalleryItem,projectManagementLaunch:t.projectManagementLaunch,discussionId:void 0,pageVisitSource:void 0}),a=d.getSpaceId())}else"space"===t.name?(a=t.spaceId,i=(0,o.createSpaceUrlPath)({route:t})):"nativeTab"===t.name&&(a=t.spaceId);return{url:i,userId:n,route:t,spaceId:a}}function h(e){const{route:t,userId:n,spaceId:o}=e;i.Z.set(d,t),i.Z.set(u,n),i.Z.set(p,o)}function v(){i.Z.remove(d),i.Z.remove(u),i.Z.remove(p)}function y(){return{route:i.Z.get(d),userId:i.Z.get(u),spaceId:i.Z.get(p)}}},320747:(e,t,n)=>{n.d(t,{FZ:()=>v,U_:()=>h,fU:()=>_});var o=n(541432),r=n(421202),i=n(182798),a=n(206258),s=n(226664),l=n(250906),c=n(496802),d=n(594419),u=n(709953);function p(e){const t=e.getRecordStoreUIAncestor(2);if(t&&t instanceof a.G&&t.isType(o.Ti.columnList))return t}function m(e){return e&&e instanceof a.G&&e.isType(o.Ti.column)}function g(e){const{environment:t,targets:n,inMemoryRecordCache:r,transaction:a}=e;(0,i.T)(n.length>0);const s=u.j4({environment:t,type:o.Ti.columnList,properties:{},inMemoryRecordCache:r,transaction:a,spaceId:n[0].pointer.spaceId,useCrdt:n[0].useCrdt()}),c=s.getContentStore();for(const o of n)d.R3({parentStore:c,appendStore:o,transaction:a});return l.xh(t),s}function f(e){const{environment:t,targets:n,inMemoryRecordCache:r,transaction:a}=e;(0,i.T)(n.length>0);const s=u.j4({environment:t,type:o.Ti.column,format:{column_ratio:1},inMemoryRecordCache:r,transaction:a,spaceId:n[0].pointer.spaceId,useCrdt:n[0].useCrdt()}),l=s.getContentStore();for(const o of n)d.R3({parentStore:l,appendStore:o,transaction:a});return s}function h(e){const{environment:t,parentStore:n,insertStores:o,leftStore:i,transaction:s}=e;if(0===o.length)return[];let c,u;if(l.FT(t,{side:"left"}),m(i))c=i,u=p(i);else{c=f({environment:t,targets:[i],inMemoryRecordCache:n.inMemoryRecordCache,transaction:s});const o=g({environment:t,targets:[c],inMemoryRecordCache:n.inMemoryRecordCache,transaction:e.transaction});u=d.rS({parentStore:n,oldChildStore:i,newChildStore:o,transaction:s}).childStore}const h=f({environment:t,targets:o,inMemoryRecordCache:n.inMemoryRecordCache,transaction:s});if(u){const t=u.getContentStore();d.Vt({parentStore:t,insertStore:h,beforeStore:c,transaction:e.transaction}),y({columnListStore:u,addedColumnStore:h,transaction:s});return a.G.createChildStore(t,{table:r.iU,id:h.id}).getContentStores()}return[]}function v(e){const{environment:t,parentStore:n,insertStores:o,rightStore:i,transaction:s}=e;if(0===o.length)return[];let c,u;if(l.FT(t,{side:"right"}),m(i))c=i,u=p(i);else{c=f({environment:t,targets:[i],inMemoryRecordCache:n.inMemoryRecordCache,transaction:s});const o=g({environment:t,targets:[c],inMemoryRecordCache:n.inMemoryRecordCache,transaction:e.transaction});u=d.rS({parentStore:n,oldChildStore:i,newChildStore:o,transaction:s}).childStore}const h=f({environment:t,targets:o,inMemoryRecordCache:n.inMemoryRecordCache,transaction:s});if(u){const t=u.getContentStore();d.BE({parentStore:t,insertStore:h,afterStore:c,transaction:e.transaction}),y({columnListStore:u,addedColumnStore:h,transaction:s});return a.G.createChildStore(t,{table:r.iU,id:h.id}).getContentStores()}return[]}function y(e){const{columnListStore:t,addedColumnStore:n,transaction:o}=e,r=t.getContentStores(),i=1/r.length;c.FH({stores:[n],update:{column_ratio:i},transaction:o});for(const a of r)if(a.id!==n.id){const e=a.getColumnRatio();c.FH({stores:[a],update:{column_ratio:(1-i)*e},transaction:o})}}function b(e){const{columnListStore:t,removedColumnStore:n,transaction:o}=e,r=t.getContentStores(),i=n.getColumnRatio();for(const a of r){const e=a.getColumnRatio();c.FH({stores:[a],update:{column_ratio:e/(1-i)},transaction:o})}}function _(e){const{parentStore:t,transaction:n}=e,o=t.getRecordStoreUIParent();let r;if(m(o)&&(r=p(o)),r){const e=r.getContentStore(),t=r.getContentStores();for(const i of t){0===i.getContentStores().length&&(d.Od({parentStore:e,childToRemoveStore:i,shouldGarbageCollect:!1,transaction:n}),b({columnListStore:r,removedColumnStore:i,transaction:n}))}const o=r.getContentStores();if(0===o.length){const e=r.getRecordStoreUIParent();null!=e&&e.valueIs(s.i)&&d.Od({parentStore:e,childToRemoveStore:r,transaction:n,shouldGarbageCollect:!1})}else if(1===o.length){const e=r.getRecordStoreUIParent(),t=o[0],i=t.getContentStore(),a=t.getContentStores();if(a.reverse(),null!=e&&e.valueIs(s.i)){for(const t of a)d.Od({parentStore:i,childToRemoveStore:t,shouldGarbageCollect:!1,transaction:n}),d.BE({parentStore:e,insertStore:t,afterStore:r,transaction:n});d.Od({parentStore:e,childToRemoveStore:r,transaction:n,shouldGarbageCollect:!1})}}}}},865770:(e,t,n)=>{n.d(t,{Y:()=>S,Z:()=>_});n(757658);var o=n(568626),r=n(421202),i=n(23867),a=n(552629),s=n(95477),l=n(741195),c=n(278429),d=n(165598),u=n(453730),p=n(206258),m=n(103022),g=n(276725),f=n(594419),h=n(311712),v=n(524677),y=n(210228);const b=new Set(["text","table_row","header","sub_header","sub_sub_header","to_do","bulleted_list","numbered_list","toggle"]);function _(e){const{parentStore:t,transaction:n,store:i,environment:s}=e,d=i.path[1];if(2!==i.path.length||"properties"!==i.path[0]||"string"!=typeof d)return;const h=i.getRecordStoreAtRootPath();if(!(h instanceof p.G))return;const v=h.getType();if(!v||!b.has(v))return;const y=function(e){var t;const{environment:n,store:o,parentStore:i,transaction:a}=e;if(o.getSpaceId()!==i.getSpaceId())return;const s=null===(t=i.getModel())||void 0===t?void 0:t.getContentIds();if(null==s||!s.includes(o.id))return;if(u.transactionQueue.isPendingTransactionForRecord(i.pointer)||u.transactionQueue.isPendingTransactionForRecord(o.pointer))return;const d=(0,c.hC)(),p=g.K8(n,{blockId:o.id,inMemoryRecordCache:o.inMemoryRecordCache,allowCopyCollections:!1,requireFullSubtree:!0,skipTransclusionContainerChildren:!0,allowCopyExternalObjectInstances:!0,includeLegacyTransclusionBlockValues:d});if(!p)return;const m=g.E9({environment:n,sourceBlockId:o.id,targetBlockPointer:(0,l.Ii)({environment:n,table:r.iU,spaceId:o.pointer.spaceId}),sourceBlockSubtree:p,targetInMemoryRecordCache:o.inMemoryRecordCache,deepCopyTransclusionContainers:!1,resolveTemplateVariables:!1,transaction:a,useCrdt:i.getRecordStoreAtRootPath().useCrdt(),preventLegacyTransclusions:d});return f.rS({parentStore:i.getContentStore(),oldChildStore:o,newChildStore:m.targetBlockStore,transaction:a}),m.targetBlockStore}({environment:s,store:h,parentStore:t,transaction:n});if(!y)return;const _=y.getPropertyStore(d);if(_)return n.postSubmitCallbacks.push((e=>{e&&o.log({from:"legacyTransclusionActions",level:"error",type:"maybeAutofixLegacyTransclusionProperty",error:{miscErrorString:(0,a.LK)(e)}}),m.Gb(s,{block_type:v,successful:!e})})),_;o.log({from:"legacyTransclusionActions",level:"error",type:"maybeAutofixLegacyTransclusionProperty",error:{message:"copied transclusion block does not have expected property"}})}function S(e){const{environment:t,store:n}=e,o=n.getRecordStoreUIParent();o&&(0,d.dz)(o)&&y.createAndCommit({userAction:"legacyTransclusionActions.fixLegacyTransclusion",environment:t,perform:e=>{const[r]=g.Qi({environment:t,stores:[n],addCopyName:!1,transaction:e,deepCopyTransclusionContainers:!0,resolveTemplateVariables:!1,targetSpaceId:(0,i.C)(n.pointer.spaceId),baseUrl:s.default.domainBaseUrl,publicDomainName:s.default.publicDomainName,preferDuplicateLocation:"local",useCrdt:o.getRecordStoreAtRootPath().useCrdt()}),a=r[0],{childStore:l}=f.BE({parentStore:o,insertStore:a,afterStore:n,transaction:e});h.Od({store:n,transaction:e}),v.Z5({environment:t,stores:[l]})}})}},245990:(e,t,n)=>{n.d(t,{Bn:()=>b,F5:()=>y,PP:()=>h,dz:()=>g,gp:()=>f,iX:()=>v});var o=n(421838),r=n(148709),i=n(268056),a=n(389224),s=n(489086),l=n(623178),c=n(924666),d=n(666771),u=n(800993),p=n(898104),m=n(210228);function g(e){const t=c.default.state;if("editing"!==t.mode)return;const n="selectionFocus"===e.type?(0,i.TD)({store:e.store,selection:e.selection}):t.multiSelection,s=(0,i.QY)(n);if(!s)return;const{tokensInsideRange:d}=o.xrQ(s.store.getValue(),n.start.index,n.end.index),u=d.find((e=>Boolean(o.Hze(e)))),p=a.get();if(!p)return;const m=a.getRect(p);if(!m)return;const g=Boolean(u);let f="";if(!u){const e=o.Jcv(d),t=o.rOz(e);t&&(f=t.href)}l.Z.setState({open:!0,url:f,title:u&&(0,r.Ts)(u)||"",type:"text",editingToken:u,savedTextSelectionState:{...t,multiSelection:n},selectionRect:m,focusLinkInput:!g&&e.focus,focusTitleInput:g&&e.focus})}function f(e){const{environment:t,transaction:n,url:o,title:r,editingToken:a,savedTextSelectionState:s}=e,l=(0,i.QY)(s.multiSelection);if(!l)return;a&&u.ST({environment:t,store:l.store,annotationKey:"a",selection:l.selection,transaction:n,updateSelection:!1});const c=["a",o];return d.WO({environment:t,store:l.store,annotation:c,selection:l.selection,transaction:n}),p.setSelection({store:l.store,selection:{startIndex:l.selection.startIndex,endIndex:l.selection.endIndex}}),r?{editingToken:[r,[c]]}:void 0}function h(e){const t=l.Z.state;if(!t.open)return;const{editingToken:n,savedTextSelectionState:o}=t;if(!n)return;const r=(0,i.QY)(o.multiSelection);r&&(m.createAndCommit({userAction:"linkAnnotationActions.unlinkSelection",environment:e,perform:t=>{u.ST({environment:e,store:r.store,annotationKey:"a",selection:r.selection,transaction:t,updateSelection:!1})}}),c.default.emit(),l.Z.reset())}function v(e){const{environment:t,title:n,transaction:r,editingToken:a,savedTextSelectionState:s}=e;if(!n||!a)return;const l=(0,i.QY)(s.multiSelection);if(!l)return;const c=l.store;u.pz({environment:t,multiSelection:s.multiSelection,transaction:r});const d=l.selection.startIndex,m=d+n.length,g={startIndex:d,endIndex:m},f=["a",o.Hze(a)],h=o.V3y(n,[f]);return u.mM({environment:t,store:c,tokens:[h],index:d,transaction:r}),p.setSelection({store:c,selection:g}),{editingToken:[n,[f]],savedTextSelectionState:{...s,multiSelection:{start:{store:c,index:d},end:{store:c,index:m}}}}}function y(){l.Z.setState({open:!1,type:"text"})}function b(){const e=l.Z.state;if(!e.open)return!1;if(e.focusLinkInput||e.focusTitleInput)return!1;const t=c.default.state;if("editing"!==t.mode)return!0;const n=(0,i.QY)(t.multiSelection);if(!n)return!0;const{store:r,selection:a}=n;return(0,s.wd)(a)?!o.oP(r.getValue(),a.startIndex,a.endIndex,o.GKr.Link):!(0,i._v)(t.multiSelection,e.savedTextSelectionState.multiSelection)}},594419:(e,t,n)=>{n.d(t,{BE:()=>c,Ce:()=>g,HP:()=>f,MK:()=>p,Od:()=>u,R3:()=>m,Vt:()=>d,rS:()=>l});n(757658);var o=n(385555),r=n(320747),i=n(119785),a=n(419358),s=n(210228);function l(e){const{parentStore:t,oldChildStore:n,newChildStore:o,transaction:r}=e,i=n.id,l=o.id,c=(t.getValue()||[]).indexOf(i);a.D0({parentStore:t,childStore:o,transaction:r}),a.If({parentStore:t,childStore:n,transaction:r}),c>=0&&(s.applyOperation({transaction:r,store:t,operation:{pointer:t.pointer,path:t.path,command:"listAfter",args:{id:l,after:i}}}),s.applyOperation({transaction:r,store:t,operation:{pointer:t.pointer,path:t.path,command:"listRemove",args:{id:i}}}));return{parentStore:t,childStore:o.cloneWithNewUIParent(t)}}function c(e){const{parentStore:t,insertStore:n,afterStore:r,transaction:l,preferHighLevelOperations:c}=e;let d;r&&(d=r.id),c&&o.default.checkGate({gateName:"prefer_high_level_operations"})?(l.annotateWithDebugTag("tx_tag.prefer_high_level_operations"),i.jG({childStore:n,parentStore:t,transaction:l,after:d})):(a.D0({parentStore:t,childStore:n,transaction:l}),s.applyOperation({transaction:l,store:t,operation:{pointer:t.pointer,path:t.path,command:"listAfter",args:{after:d,id:n.id}}}));return{parentStore:t,childStore:n.cloneWithNewUIParent(t)}}function d(e){const{parentStore:t,insertStore:n,beforeStore:o,transaction:r}=e;let i;o&&(i=o.id),a.D0({parentStore:t,childStore:n,transaction:r}),s.applyOperation({transaction:r,store:t,operation:{pointer:t.pointer,path:t.path,command:"listBefore",args:{before:i,id:n.id}}});return{parentStore:t,childStore:n.cloneWithNewUIParent(t)}}function u(e){void 0===e.shouldGarbageCollect&&(e.shouldGarbageCollect=!0);const{parentStore:t,childToRemoveStore:n,shouldGarbageCollect:i,transaction:l}=e;if(a.If({parentStore:t,childStore:n,transaction:l}),s.applyOperation({transaction:l,store:t,operation:{pointer:t.pointer,path:t.path,command:"listRemove",args:{id:n.id}}}),i&&l.preEnqueueActions.push((()=>{r.fU({parentStore:t,transaction:l})})),o.default.checkGate({gateName:"docs_list_actions_remove_no_clone"}))return{parentStore:t,childStore:n};const c=n.cloneWithNewUIParent(t);return{parentStore:t,childStore:c}}function p(e){const{parentStore:t,appendStore:n,transaction:o}=e;a.D0({parentStore:t,childStore:n,transaction:o}),s.applyOperation({transaction:o,store:t,operation:{pointer:t.pointer,path:t.path,command:"keyedObjectListAfter",args:{value:n.pointer,after:void 0}}});return{parentStore:t,childStore:n.cloneWithNewUIParent(t)}}function m(e){const{parentStore:t,appendStore:n,transaction:o,after:r}=e;a.D0({parentStore:t,childStore:n,transaction:o}),s.applyOperation({transaction:o,store:t,operation:{pointer:t.pointer,path:t.path,command:"listAfter",args:{id:n.id,after:r}}});return{parentStore:t,childStore:n.cloneWithNewUIParent(t)}}function g(e){const{parentStore:t,prependStore:n,transaction:o,before:r}=e;a.D0({parentStore:t,childStore:n,transaction:o}),s.applyOperation({transaction:o,store:t,operation:{pointer:t.pointer,path:t.path,command:"listBefore",args:{id:n.id,before:r}}});return{parentStore:t,childStore:n.cloneWithNewUIParent(t)}}function f(e){const{parentStore:t,currentStore:n,afterStore:o,transaction:r}=e;o?c({parentStore:t,insertStore:n,afterStore:o,transaction:r}):g({parentStore:t,prependStore:n,transaction:r});return{parentStore:t,childStore:n.cloneWithNewUIParent(t)}}},13084:(e,t,n)=>{n.d(t,{Bm:()=>M,DC:()=>T,HO:()=>P,LQ:()=>I,UG:()=>A,dM:()=>B,uQ:()=>C});n(21703);var o=n(701302),r=n(541432),i=n(514248),a=n(421202),s=n(95371),l=n(653965),c=n(721429),d=n(165598),u=n(669645),p=n(273959),m=n(155367),g=n(206258),f=n(897630),h=n(554569),v=n(42239),y=n(631781),b=n(320747),_=n(594419),S=n(709953),k=n(311712),w=n(524677),x=n(898104);function I(e){const{environment:t,droppedDirection:n,droppedStores:o,targetStore:s,targetParentStore:c,transaction:d,duplicate:u}=e,p=o.every((e=>e.isExternalObjectInstancePageBlockStore()))||u;if(s&&n===m.vh.Onto){w.ZH({environment:t});const e=!(s.isInsideTemplate()||s.isInsideFactoryOrDuplicateBlocksAction());let n=s;if(s.isType(r.Ti.alias)){const e=s.getAliasTargetStore();if(!e)throw new Error("Alias has no target.");e instanceof g.G&&(n=e)}const a=v.LQ({environment:t,droppedStores:o,duplicate:p,transaction:d,resolveTemplateVariables:e,duplicateUseCrdt:n.useCrdt()}),l=n.getCollectionViewCollectionStore();if(n.isCollectionView()&&!n.isCollectionViewPageWithContent()){if(!l)throw new Error("CollectionStore is not defined.");const e=h.o3({environment:t,stores:a,transaction:d,spaceId:l.getSpaceId()});for(const n of e)h.mp({environment:t,store:n,collectionStore:l,shouldCoerce:!0,groupsPointer:[],transaction:d});return e}{const e=n.getAssociatedCollectionStore();if(null!=e&&e.isPageTreeCollection())for(const n of a){if("page"!==n.getType())continue;if(!n.isDefined())continue;const t=i.Xq({blockProperties:n.getProperties(),oldSchema:n.getSchema(),newSchema:e.getSchema(),typesMatch:!1,oldPropertyMapping:void 0,newPropertyMapping:void 0});t.propertyUpdate&&Object.keys(t.propertyUpdate).length>0&&S.sW({store:n.getPropertiesStore(),data:t.propertyUpdate,transaction:d})}const t=n.getContentStore();for(const n of a)_.R3({parentStore:t,appendStore:n,transaction:d});return a}}{const e=!!s&&!(s.isInsideTemplate()||s.isInsideFactoryOrDuplicateBlocksAction(!1)),r=c.getRecordStoreAtRootPath();let i=v.LQ({environment:t,droppedStores:o,duplicate:p,transaction:d,resolveTemplateVariables:e,duplicateUseCrdt:r.table===a.iU?r.useCrdt():"same_as_store"});return n===m.vh.Above?(i=l.d9(i),s?i=l.UI(i,(e=>_.Vt({parentStore:c,insertStore:e,beforeStore:s,transaction:d}).childStore)):(i.reverse(),i=l.UI(i,(e=>_.Ce({parentStore:c,prependStore:e,transaction:d}).childStore)))):n===m.vh.Below?(i=l.d9(i),s?(i.reverse(),i=l.UI(i,(e=>_.BE({parentStore:c,insertStore:e,afterStore:s,transaction:d}).childStore))):i=l.UI(i,(e=>_.R3({parentStore:c,appendStore:e,transaction:d}).childStore))):s&&n===m.vh.Left?i=b.U_({environment:t,parentStore:c,insertStores:i,leftStore:s,transaction:d}):s&&n===m.vh.Right&&(i=b.FZ({environment:t,parentStore:c,insertStores:i,rightStore:s,transaction:d})),k.DV({environment:t,insertedStores:i}),w.Z5({environment:t,stores:i}),i}}function C(e){var t;const{environment:n,files:o,droppedDirection:r,targetStore:i,targetParentStore:a,transaction:s}=e,l=a.inMemoryRecordCache,d=c.qQ(n);I({environment:n,targetParentStore:a,targetStore:i,droppedDirection:r,droppedStores:y.z({environment:n,files:o,inMemoryRecordCache:l,pageWidth:d,transaction:s,spaceId:null==i?void 0:i.pointer.spaceId,useCrdt:(null===(t=(0,p.sQ)(a))||void 0===t?void 0:t.useCrdt())??!1}),duplicate:!1,transaction:s})}function T(e){const{environment:t,targetStore:n,isAtStartOfLine:o}=e;(function(e){const{environment:t,isClick:n,targetStore:o}=e;if(!n)return!1;const i=o.findRecordStoreUIAncestor((e=>e instanceof g.G&&e.isTransclusionType())).ancestor;if(i&&i instanceof g.G){const e=o.findRecordStoreUIAncestor((e=>e instanceof g.G&&e.getType()===r.Ti.transclusionReference)).ancestor,n=(e&&e instanceof g.G?e:void 0)||i,a=n.getRecordStoreUIParent();if(!a||!(0,d.dz)(a))return;return w.Z5({environment:t,stores:[n]}),!0}return!1})(e)||B({environment:t,store:n,isAtStartOfLine:o})||function(e){const{environment:t,targetStore:n,isAtStartOfLine:o}=e,r=w.KX(),i=r.indexOf(n);if(-1===i)return!1;if(o)for(let a=i;a>=0&&a>i-20;a--){if(B({environment:t,store:r[a],isAtStartOfLine:!1}))return!0}else for(let a=i;a<r.length&&a<i+20;a++){if(B({environment:t,store:r[a],isAtStartOfLine:!0}))return!0}}(e)}function M(e){const{environment:t,targetStore:n,isAtStartOfLine:o}=e;B({environment:t,store:n,isAtStartOfLine:o})||D({...e,placement:"after"})}function P(e){return R({...e,destination:"page"})}function A(e){return R({...e,destination:"sibling"})}function R(e){const{environment:t,container:n,store:o,transaction:i,destination:a}=e,c=function(e){var t;const{container:n,store:o}=e;let i=(0,u.dq)({includeNonSelectableListContainer:!0,container:n});i&&o&&(i=l.Z$((0,s.DY)([i],(e=>e.value.store===o))));if(!i)return;let a=i;for(;a.children.length>0;){const e=l.Z$(a.children);if(0===e.children.length)break;const t=e.value.store.getType();if(t&&r.BT[t])break;a=e}return{parentStore:a.value.store,siblingStore:null===(t=l.Z$(a.children))||void 0===t?void 0:t.value.store}}({container:n,store:o});if(!c)return!1;const{parentStore:p,siblingStore:m}=c;if(m&&(0,d.Nm)(m))return!1;const f={sibling:p,page:p.getRecordStoreUIRoot()}[a];return f instanceof g.G&&(!f.isNonEditableState()&&D({environment:t,targetParentStore:f.getContentStore(),placement:"after",transaction:i}))}function D(e){const{environment:t,targetStore:n,targetParentStore:i,placement:a,transaction:s}=e;if(i.getValue()&&f.M_(t)&&f.M_(t)){var l;const e=S.j4({environment:t,type:r.Ti.text,inMemoryRecordCache:i.inMemoryRecordCache,transaction:s,spaceId:i.pointer.spaceId,useCrdt:(null===(l=(0,p.sQ)(i))||void 0===l?void 0:l.useCrdt())??!1}),c="after"===a?_.BE({parentStore:i,afterStore:n,insertStore:e,transaction:s}):_.Vt({parentStore:i,beforeStore:n,insertStore:e,transaction:s});return o.default.afterNextFlush((()=>{B({environment:t,store:c.childStore,isAtStartOfLine:!1})})),!0}return!1}function B(e){const{environment:t,store:n,isAtStartOfLine:o}=e,r=(0,p.mh)(n);return!!r&&(w.eP({environment:t,store:n}),o?x.setSelectionAtStart({store:r}):x.setSelectionAtEnd({store:r}),!0)}},792625:(e,t,n)=>{n.d(t,{j:()=>i,x:()=>a});var o=n(433929),r=n(231104);function i(e){let{message:t,interpolatedValues:n,targetRecordId:i}=e;r.Z.setState({open:!0,message:o.default.formatMessage(t,n),targetRecordId:i})}function a(){r.Z.setState({open:!1,targetRecordId:void 0})}},398730:(e,t,n)=>{n.d(t,{S:()=>s});var o=n(897638),r=n(596820),i=n(80444),a=n(184166);async function s(e){const{hasPublicAccessPermission:t}=o.bC(e),n=i.default.state.currentSpaceStore,s=i.default.state.currentSpaceViewStore;if(t)return;if(!n)return;const l=await(0,r.S)({environment:e,currentSpaceStore:n,currentSpaceViewStore:s,excludeCurrentPage:!1});l&&a.Z.update((e=>({...e,localSearchableBlocksCache:l})))}},935979:(e,t,n)=>{n.d(t,{Be:()=>c,TR:()=>v,V_:()=>p,WA:()=>y,XM:()=>d,_5:()=>u,lJ:()=>g,nk:()=>h,wt:()=>f,z_:()=>l});var o=n(738208),r=n(855337),i=n(385555),a=n(232317);function s(e,t){r.K4(e,t)}function l(e){s(e,"request_login_with_apple"),m(e,"login-with-apple")}function c(e){s(e,"request_login_with_google"),m(e,"login-with-google")}function d(e){s(e,"request_login_with_google_onetap"),m(e,"login-with-google-onetap")}function u(e){s(e,"send_temporary_password"),m(e,"temporary-passcode")}function p(e){s(e,"redirect_to_saml_login"),m(e,"saml")}function m(e,t){r.K4(e,"login_attempt",{login_method:t})}function g(e,t){o.o7(e,"signup_login_button_clicked",t),i.default.logEvent("signup_login_button_clicked",t.login_method,t)}function f(e,t){r.K4(e,"login_success",t,{dontWait:!0}),i.default.logEvent("login_success",t.login_method,t)}function h(e,t){const{isBannedGoogleSSOUserAgent:n,isSignup:r}=t;o.o7(e,"onboarding_landing_page",{is_banned_google_sso_user_agent:n,is_signup:r,isPerfmarkTrialSignup:t.isPerfmarkTrialSignup}),r&&a.T1(e)}function v(e,t){const{actionType:n,isSignup:o}=t;r.K4(e,"google_one_tap_login_button_click",{is_signup:Boolean(o),action_type:n},{dontWait:!0})}function y(e,t){r.lu(e,"login_email_input_updates","login_email_input_updates",1)}},497977:(e,t,n)=>{n.r(t),n.d(t,{actuallyLogoutAndDeleteMostLocalData:()=>Pe,clearCurrentUser:()=>Me,clearMostUserStorageAndState:()=>fe,handleLoginFailureIfSamlRequired:()=>Ve,handleLoginSuccess:()=>Ae,handleLoginWithMfa:()=>Re,handleLoginWithTemporaryPasscodeSuccess:()=>be,initialize:()=>Ee,loginPasswordReset:()=>xe,loginSamlUser:()=>Ie,loginSamlUserWithToken:()=>we,loginWithAppleAuth:()=>_e,loginWithGoogleAuth:()=>Se,loginWithTemporaryPasscode:()=>ye,logout:()=>Te,logoutSingleAccount:()=>Ce,openBrowserInMobileNative:()=>ve,redirectToSaml:()=>ke,requestLoginWithGoogleOneTap:()=>he,setLocalStorageUserId:()=>Be,shouldCreatePassword:()=>Ze,showSamlRedirectMessage:()=>Ne});n(757658),n(21703),n(71550);var o=n(687997),r=n(779946),i=n(815145),a=n(853504),s=n(568626),l=n(599405),c=n(89101),d=n(519889),u=n(766079),p=n(109852),m=n(554153),g=n(766504),f=n(709291),h=n(653965),v=n(552629),y=n(937850),b=n(307032),_=n(401898),S=n(218265),k=n(247839),w=n(29974),x=n(95477),I=n(855337),C=n(691924),T=n(512955),M=n(833954),P=n(787381),A=n(433929),R=n(828125),D=n(557491),B=n(778873),E=n(918514),F=n(915517),Z=n(32223),U=n(775538),V=n(408655),N=n(318245),O=n(819034),L=n(478861),j=n(297393),K=n(258455),z=n(80444),q=n(385555),H=n(596071),G=n(453730),W=n(206258),$=n(27724),Y=n(924666),Q=n(88893),J=n(965928),X=n(250906),ee=n(21359),te=n(696454),ne=n(547307),oe=n(459650),re=n(957400),ie=n(403297),ae=n(294273),se=n(792625),le=n(935979),ce=n(98958),de=n(504408),ue=n(608055),pe=n(532219),me=n(970782);const ge=(0,f.defineMessages)({unsavedChanges:{id:"loginActions.dialogError.logoutUnsavedChanges.message",defaultMessage:"You have unsaved changes. If you log out now, you could lose them."},logoutWithoutSaving:{defaultMessage:"Discard edits and log out",id:"loginActions.dialogError.logoutUnsavedChanges.confirmButton.label"},signupPendingMessage:{defaultMessage:"Creating Notion account…",id:"loginActions.signup.pending.message"},loginPendingMessage:{defaultMessage:"Logging in to Notion…",id:"loginActions.login.pending.message"},redirectSamlMessage:{defaultMessage:"SAML SSO required. Redirecting to the configured login page.",id:"loginActions.login.redirect.saml.message"}});async function fe(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=[];if(t){const e=(0,p.DD)();sessionStorage.clear(),(0,p.In)(e)}else sessionStorage.clear();if(F.ZL(),n&&o.push(Me(e)),o.push(X.NM()),e.mobileNative&&(o.push(e.mobileNative.logoutOfGoogle()),o.push(e.mobileNative.cancelUserBackgroundTasks())),e.device.isElectron&&(k.clearBrowserHistory(),t||k.clearCookies()),z.default.reset(),$.default.reset(),Y.default.reset(),de.LK(e),Z.resetRecordSubscriptions(),O.Z.reset(),K.default.reset(),U.default.reset(),H.v.reset(),o.push(G.transactionQueue.reset()),"on"===q.default.getGroup("clear-record-cache-on-login")){const t=e.defaultRecordCache.persistedRecordCache;t&&"reset"in t&&o.push(t.reset())}q.default.reset(),await Promise.all(o)}async function he(e){const{environment:t,idToken:n,store:o,frontPathName:r,googleLoginTimeMetric:i}=e,a=await(0,P.loadCurrentUserId)(t);le.XM(t);const s=await ee.loginWithGoogleJwt(t,{idToken:n});if("success"===s.type){const{isNewSignup:e,userId:n}=s.data;return N.default.measure(i,{environment:t}),await Ae({environment:t,isNewSignup:e,userId:n,previousPersistedUserId:a,loginMethod:"login-with-google-onetap",frontPathName:r}),{status:"success"}}{await Ve(t,s);const e=(0,M.wf)(A.default.getIntl(),s);return o.setState({...o.state,alert:e}),{status:"fail"}}}function ve(e,t){e.mobileNative&&((0,C.Q7)(e)?e.mobileNative.openAuthSessionBrowser(t):e.mobileNative.openInAppBrowser(t))}async function ye(e){const{environment:t,state:n,password:o,redirectURL:r,webBrowserDeviceId:i,passcodeEnterMethod:a,showInvitationVersion:s,temporaryPasscodeLoginTimeMetric:l}=e,d=await(0,P.loadCurrentUserId)(t),u=await ee.loginWithEmail(t,{state:n,password:o});if(N.default.DO_NOT_USE_measureLegacy(l,{environment:t}),"success"!==u.type){await Ve(t,u);return(0,M.wf)(A.default.getIntl(),u)}{const{isNewSignup:e,userId:n}=u.data;if(function(e){let{environment:t,isNewSignup:n,webBrowserDeviceId:o}=e;const r=t.device.isElectron||t.device.isElectronMail,i=r&&n&&!o;if(!i)return!1;return q.default.checkGate({gateName:"desktop_app_login_with_email_redirect"})}({environment:t,isNewSignup:e,webBrowserDeviceId:i})){const e=S.$U(S.bf({url:`${x.default.domainBaseUrl}${c._j.loginSuccess}`}));t.device.isElectron?k.openExternalUrl(e):t.device.isElectronMail&&oe.m(e)}else await be({environment:t,isNewSignup:e,userId:n,redirectURL:r,previousPersistedUserId:d,loginMethod:"temporary-passcode",webBrowserDeviceId:i,passcodeEnterMethod:a,showInvitationVersion:s})}}async function be(e){const{environment:t}=e;await Ae(e);const[n,o,r]=await Promise.all([Ze(t),Ue(t),Fe()]);(n&&o||n&&r)&&B.E({environment:t})}async function _e(e){const{environment:t,code:n,encryptedToken:o,encryptedNonce:r,encryptedUserObject:i,webBrowserDeviceId:a,appleLoginTimeMetric:s}=e,l=await(0,P.loadCurrentUserId)(t),c=await ee.loginWithAppleAuth(t,{code:n,encryptedToken:o,encryptedNonce:r,encryptedUserObject:i});if("success"!==c.type)return await Ve(t,c),(0,M.wf)(A.default.getIntl(),c);{N.default.measure(s,{environment:t});const{isNewSignup:e,userId:n}=c.data;await Ae({environment:t,isNewSignup:e,userId:n,previousPersistedUserId:l,loginMethod:"login-with-apple",webBrowserDeviceId:a})}}async function Se(e){const{environment:t,encryptedToken:n,code:o,callbackType:r,webBrowserDeviceId:i}=e,a=await(0,P.loadCurrentUserId)(t),s=await ee.loginWithGoogleAuth(t,{code:o,encryptedToken:n,callbackType:r});if("success"!==s.type)return await Ve(t,s),(0,M.wf)(A.default.getIntl(),s);{const{isNewSignup:e,userId:n}=s.data;await Ae({environment:t,isNewSignup:e,userId:n,previousPersistedUserId:a,loginMethod:"login-with-google",webBrowserDeviceId:i})}}function ke(e,t){le.V_(e),e.mobileNative?ve(e,t):e.device.isElectron?k.openExternalUrl(t):e.device.isElectronMail?oe.m(t):window.location.href=t}async function we(e){const{environment:t,csrfState:n,token:o,isNewSignup:r}=e,i=await(0,P.loadCurrentUserId)(t),a=await T.getBrowserId(t);n||o||s.log({level:"error",type:"loginSamlUserWithToken",from:"loginActions",error:{stack:(new Error).stack},data:{miscDataToConvertToString:{deviceId:a,isNewSignup:r}}});const l=await ee.loginWithEmail(t,{state:n,password:o});if("success"!==l.type)return await Ve(t,l),(0,M.wf)(A.default.getIntl(),l);{const{userId:e}=l.data;await Ae({environment:t,isNewSignup:r,userId:e,previousPersistedUserId:i,loginMethod:"saml"})}}async function xe(e){const{environment:t,csrfState:n,password:o,loginStore:r}=e,i=await(0,P.loadCurrentUserId)(t);if(!n){const e=await T.getCookie(t,"notion_browser_id");s.log({level:"error",type:"loginPasswordReset",from:"loginActions",error:{stack:(new Error).stack},data:{miscDataToConvertToString:{deviceId:e,previousPersistedUserId:i}}})}const a=await ee.loginWithEmail(t,{state:n,password:o,passwordReset:!0});if("success"!==a.type)return await Ve(t,a),(0,M.wf)(A.default.getIntl(),a);{const{userId:e,enabledMfaSettings:n}=a.data;n&&n.length>0?(Re({environment:t,isNewSignup:!1,userId:e,previousPersistedUserId:i,loginMethod:"password-reset",loginStore:r,mfaSettings:n}),ue.Li({environment:t,url:c._j.login}),B.E({environment:t})):(await Ae({environment:t,isNewSignup:!1,userId:e,previousPersistedUserId:i,loginMethod:"password-reset"}),B.E({environment:t}))}}async function Ie(e){const{environment:t,userId:n,previousUserId:o,isNewSignup:r}=e;await Ae({environment:t,isNewSignup:r,userId:n,previousPersistedUserId:o,loginMethod:"saml"})}async function Ce(e){const{environment:t,userId:n,logoutOrigin:o,fcmToken:r}=e,{nextUserId:a,nextSpaceViewStore:s}=function(e){const{environment:t,userId:n}=e,o=t.currentUser.id;if(n===o){const e=L.Z.getAllSpaceViewStores(t).filter((e=>{const t=e.getUserRootParentId();return t&&t!==n}))[0];return{nextUserId:e&&e.getUserRootParentId(),nextSpaceViewStore:e}}{const{currentSpaceViewStore:e}=z.default.state;return{nextUserId:o,nextSpaceViewStore:e}}}(e);if(a&&s){if(await G.transactionQueue.hasTasksForUser(n)){if(!(await ne.confirmUserAction({message:A.default.formatMessage(ge.unsavedChanges),acceptLabel:A.default.formatMessage(ge.logoutWithoutSaving)})))return}r&&ce.invalidateToken({environment:t,userId:n,token:r}),await ee.logout(t,{userId:n,logoutOrigin:o}),await G.transactionQueue.clearForUser(n),F.ZL(n);const e=await me.x({environment:t,newCurrentUserId:a,loggedOutUserId:n}),{currentUserRootStore:l,currentUserSettingsStore:c}=z.default.state;if(l&&c){t.currentUser.id===n&&w.y3({environment:e,spaceViewStore:s,userSettingsStore:c,userRootStore:l,pageVisitSource:i.tY.Login,navigationType:"switchingToOrLoadingSpace"})}k.refreshAll({includeFocusedWindow:!1})}else await Te(t),k.refreshAll({includeFocusedWindow:!1})}async function Te(e){if(await G.transactionQueue.anySessionHasTasks()){if(!(await ne.confirmUserAction({message:A.default.formatMessage(ge.unsavedChanges),acceptLabel:A.default.formatMessage(ge.logoutWithoutSaving)})))return}if((0,E.Sr)(e))return void(window.location.href=`${x.default.domainBaseUrl}/logout`);if(!q.default.checkGate({gateName:"dot_com_cookie_sync"})||e.device.isElectron)ue.c4({environment:e,url:c._j.logout});else{const n=`${x.default.front.domainBaseUrl}/front-api/status`;let o;try{o=await fetch(n)}catch(t){return void ue.c4({environment:e,url:c._j.logout})}if(!o||200!==o.status)return void ue.c4({environment:e,url:c._j.logout});const r=`${x.default.front.domainBaseUrl}/front-api/cookieSync?logout=true&original_url=/logout`;ue.c4({environment:e,url:r})}}async function Me(e){if(e.mobileNative&&await e.mobileNative.unregisterPushNotifications(),e.updateCurrentUserId){const t={environment:e,currentUserId:void 0,userIds:[]};e.updateCurrentUserId(t)}return{...e,currentUser:new o.CurrentUser}}async function Pe(e){const{environment:t,nextLocation:n,userId:o,doNotRedirect:r,logoutOrigin:i}=e;o?await ee.logout(t,{userId:o,logoutOrigin:i}):await ee.logout(t,{logoutOrigin:i}),await fe(t),k.clearGoogleAuthCookies(),k.refreshAll({includeFocusedWindow:!1}),r||(window.location.href=n||c._j.root)}async function Ae(e){const{environment:t,isNewSignup:n,userId:o,redirectURL:i,previousPersistedUserId:d,frontPathName:u,webBrowserDeviceId:m,passcodeEnterMethod:g,showInvitationVersion:f}=e,h=window.top!==window.self&&q.default.checkGate({gateName:"marketing_signup_front_app"});h&&window.parent.postMessage({loginSuccess:!0},window.location.origin);let v=c._j.root;n?se.j({message:ge.signupPendingMessage}):((0,J.pV)()&&q.default.checkGate({gateName:"enable_smb_trial_onboarding_flow"})&&V.Z.setState({open:!0,isExistingUser:!0}),se.j({message:ge.loginPendingMessage}));try{const S=R.k(t);if(de.LK(t),t.device.isElectron&&(k.clearBrowserHistory(),k.refreshAll({includeFocusedWindow:!1})),d&&d!==o){const e=await G.transactionQueue.getTotalNumberOfTasks();e>5&&s.log({level:"warning",from:"loginActions",type:"setLoggedInUserId",data:{userId:o,currentUserId:d,clearedTransactionCount:e}}),await fe(t,S,!t.currentUser.loggedInUserIds.includes(d))}if(!d){const e=ie.qd(void 0);ie.nM({currentUserId:o,blockId:e}),ie.nM({currentUserId:void 0,blockId:void 0})}const w=await De(t,o);if(le.lJ(w,{is_new_signup:n,login_method:e.loginMethod,front_pathname:u}),n){X.ie(w,{user_id:o,tags:(0,p.mM)(),origin_initial_page:pe.getInitialPage(o)});const t=await(0,I.of)(w);await(0,y.OI)(200,ee.initializeUserAnalyticsEmptySync(w,{isNewSignup:n,analyticsProperties:(0,a.Z)({...(0,I.Ts)(),...(0,I.eR)(),...(0,D.getMobileNativeDeviceInfo)(),...t,experiments:q.default.getExperimentsMap(),login_method:e.loginMethod,signup_from:t.route_name,front_pathname:u,web_browser_device_id:m,passcode_enter_method:g},"ignore-class-instances")}))}const C=q.default.checkGate({gateName:"enable_oauth_from_desktop_ux_v2"}),M=(0,p.r4)({config:C?x.default:void 0,fileHostProtocol:x.default.secureFileConfig.protocol,fileHostName:x.default.secureFileConfig.hostname});let P,A=i;if(A||"other"!==(null==M?void 0:M.type)||(A=M.result,(0,p.Rq)()),A&&(P=l.parseRoute({url:A,isMobile:w.device.isMobile,baseUrl:x.default.domainBaseUrl,publicDomainName:x.default.publicDomainName,protocol:x.default.protocol,currentUrl:window.location.href})),P)if("space"===P.name||"page"===P.name&&!P.shouldDuplicate)ae.nr({route:P,userId:o,spaceId:P.spaceId});else if(P&&"oauthAuthorization"===P.name){const{responseType:e,redirectUri:t,integrationId:n,state:o,owner:r,userId:i,spaceId:a}=P;(0,p.In)({responseType:e,redirectUri:t,integrationId:n,state:o,owner:r,userId:i,spaceId:a})}if(te.mc(w),re.mc(),await re.Yh(w),n&&(q.default.logEvent("sign_up",void 0,{login_method:e.loginMethod,device_type:t.device.deviceType}),q.default.logEvent("sign_up_by_login_method",e.loginMethod),q.default.logEvent("sign_up_by_device_type",t.device.deviceType)),le.wt(w,{is_new_signup:n,login_method:e.loginMethod,logged_in_user_ids:w.currentUser.loggedInUserIds.map((e=>(0,b.F9)(e))),most_recent_user_id:(0,b.F9)(o),web_browser_device_id:m,passcode_enter_method:g,userId:o}),r.j({device:w.device,event:{facebook:{eventName:"ViewContent"},google:{eventName:"loggedIn"}},cookieService:t.cookieService}),h&&window.parent.postMessage({loginAnalyticsFinished:!0},window.location.origin),x.default.isAdminMode){if(!(await T.getGhostAdminUserId(t)))return v="/__admin",void ue.c4({environment:t,url:v})}const B="login"===t.RouterStore.state.route.name?t.RouterStore.state.route.redirectURL:void 0;if("oauth"===(null==M?void 0:M.type)||"file"===(null==M?void 0:M.type)||"global_oauth"===(null==M?void 0:M.type))"global_oauth"===(null==M?void 0:M.type)&&(window.onbeforeunload=null),(0,p.Rq)(),null!=M&&M.result&&(v=null==M?void 0:M.result,window.location.href=v);else if(!S&&d&&d!==o)v=c._j.root,window.location.href=v;else if(n)f?(v=c._j.onboarding,ue.c4({environment:w,url:v})):(v=c._j.root,ue.c4({environment:w,url:v}));else if(A&&P&&((0,_.qg)(c.VP,P.name)||"page"===P.name||"samlAuthCallback"===t.RouterStore.state.initialRoute.name))v=A,ue.c4({environment:w,url:v});else if(B&&B.startsWith(`${x.default.mail.domainBaseUrl}/`))v=B,ue.c4({environment:w,url:v});else if(A&&w.device.isElectronMail&&("googleAuthCallback"===t.RouterStore.state.route.name||"appleAuthCallback"===t.RouterStore.state.route.name||"samlAuthCallback"===t.RouterStore.state.route.name))ue.c4({environment:w,url:A});else{v=(0,p.sC)()??c._j.root,ue.c4({environment:w,url:v}),(0,p.CV)()}}finally{se.x(),h&&window.parent.postMessage({loginActionsFinished:!0,redirectPath:v},window.location.origin)}}function Re(e){const{loginStore:t,userId:n}=e,o=new W.U6(e.environment,{table:d.KJ,id:n},{userId:n});t.setState({...t.state,settings:e.mfaSettings,loginType:"mfa",redirectURL:e.redirectURL,previousPersistedUserId:e.previousPersistedUserId,userStore:o})}async function De(e,t){await async function(e,t){await Be(e,t)}(e,t);let n=[t];const r=await(0,P.getUserIdsFromCookie)(e);r&&(r.push(t),n=h.jj(r));const i=await T.getGhostAdminUserId(e),a={...e,currentUser:new o.CurrentUser({id:t,loggedInUserIds:n,adminUserId:i})};if(e.updateCurrentUserId){const o={environment:e,currentUserId:t,userIds:n};await e.updateCurrentUserId(o)}return a.device.isFirefox||F.lr(),a}async function Be(e,t){const n=await(0,P.getUserIdsFromCookie)(e);n&&!n.includes(t)||m.Z.set(P.currentUserIdKey,t)}async function Ee(e){const t=await(0,P.loadCurrentUserId)(e),{mobileNative:n}=e;if(n&&n.sqliteConnection)try{await j.y6(n.sqliteConnection,t||g.I)}catch(o){s.log({level:"error",from:"loginAction.ts",type:"backfillRecordsWithUserId",error:(0,v.Ui)(o),data:{}})}return t?await De(e,t):e}async function Fe(){var e;const{currentUserStore:t}=z.default.state;if(!t)return!1;if(!t.getEmail())return!1;const{currentUserSettingsStore:n}=z.default.state;return!!n&&(await n.load(),Boolean(null===(e=n.getSettings())||void 0===e?void 0:e.should_set_password_on_login))}async function Ze(e){const{currentUserStore:t}=z.default.state;if(!t)return!1;const n=t.getEmail();if(!n)return!1;const o=await B.c({environment:e,userEmail:n});if(o.error)throw o.error;return!o.value.isSamlEnforced&&!o.value.hasPassword&&!o.value.didLogInWithSaml}async function Ue(e){const t=e.currentUser.id;if(!t)return!1;const n=new W.r9(e,{table:u.dx,id:t});await n.load();return(await(0,Q.Gh)({environment:e,userRootStore:n})||[]).some((e=>e===x.default.pricing.student.productId))}async function Ve(e,t){var n,o;if("saml_sso_required"===(null===(n=t.body.clientData)||void 0===n?void 0:n.type)&&null!==(o=t.body.clientData)&&void 0!==o&&o.redirectUrl){await Ne(2e3);ke(e,t.body.clientData.redirectUrl)}}async function Ne(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;se.j({message:ge.redirectSamlMessage}),await(0,y.Vs)(e),se.x()}},627153:(e,t,n)=>{n.d(t,{$:()=>i,Z:()=>a});var o=n(791390),r=n(524677);function i(e,t){t.disableClearSelection||r.ZH({environment:e}),o.Z.setState({...t,isActive:!0})}function a(){const e=o.Z.state;e.isActive&&e.onCancel&&e.onCancel(),o.Z.reset()}},567060:(e,t,n)=>{n.d(t,{Br:()=>V,RL:()=>Z,_P:()=>E,lZ:()=>F,xv:()=>U});var o=n(749085),r=n(471924),i=n(449143),a=n(421838),s=n(653965),l=n(286420),c=n(269783),d=n(721429),u=n(304708),p=n(344486),m=n(268056),g=n(798165),f=n(389224),h=n(190335),v=n(704266),y=n(80444),b=n(964233),_=n(319111),S=n(374510),k=n(896026),w=n(140061),x=n(672087),I=n(924666),C=n(897630),T=n(535057),M=n(458912),P=n(388295),A=n(398730),R=n(800993),D=n(210228);function B(e){const{textStore:t,environment:n}=e,o=(0,g.n3)(t)&&k.Z.getMode(n,t).hasPublicPermission,r=t.isDefaultRecordCache(),a=!o,c=a&&function(e){const t=(0,d.np)(),n=y.default.state.currentSpaceStore;if(!t||!n)return!1;return t.canEditMembership()&&n.canEditMembership()&&"enterprise"!==(0,T.zt)()&&!e.device.isMobile}(n),m=a&&function(e){const t=(0,d.np)();if(!t)return!1;return(0,h.gi)({store:t})&&t.canEditMembership()&&(0,u.$t)()}(),f=a,v=!o,b=function(e){const t=(0,d.RM)();if(!t||"block"!==e.table)return!1;if(t.isInsideTemplate())return!0;const n=p.W(e);if(n||t.isInsideFactoryOrDuplicateBlocksAction()){const t=null==n?void 0:n.getTitleStore();return!(n&&t&&t.id===e.id&&s.Xy(t.path,e.path))}if((0,l.t)(e))return!0;return!1}(t),_=function(e){if("block"!==e.table)return!1;return!0}(t);return(0,i.lX)({page:true,createPage:r,user:a,inviteUserToWorkspace:c,inviteUserToPage:m,bot:f,date:!0,reminder:!0,templateVariable:b,group:v,heading:!0,formulaContextVariable:_})}function E(e){const{environment:t,textStore:n,oldSelection:s,oldTextValue:l,disabledMentionTypes:d,usePopupOnMobile:u,mentionSectionOrdering:p}=e,m=function(e){const{textStore:t,oldSelection:n}=e;if(v.Z.state.open||c.Z.state.open||b.Z.state.open)return;const o=a.eeV(t.getValue()||[]),r=n.startIndex,i=(o[r]||"").normalize("NFKD"),s=(o[r-1]||"").normalize("NFKD"),l=_.Z.state;if(l.open)return"[["===l.insertionType&&"]"===i&&"]"===s?"]]":void 0;if("@"===i){if(s&&!/[\s\(\)\[\]]/g.test(s))return;return"@"}if("+"===i){if(s&&!/[\s\(\)\[\]]/g.test(s))return;return"+"}if("[["===o.slice(r-1,r+1).join("")){const e=o[r-1];if(e&&!/[\s\(\)\[\]]/g.test(e))return;return"[["}}(e);if(!m)return;const g=_.Z.state;if("]]"===m){if(g.open){const e=g.temporaryInputData.state;e&&g.temporaryInputData.setState({...e,suffix:"]]"}),_.Z.setState({...g,showCreateIn:!0})}return}const h=f.get();if(!h)return;const y=f.getRect(h);if(!y)return;const S=B({textStore:n,environment:t}),k=S.page&&!d.page,w=S.heading&&!d.heading,I=S.createPage&&!d.createPage,C=S.user&&"@"===m&&!d.user,T=S.inviteUserToWorkspace&&"@"===m&&!d.inviteUserToWorkspace,P=S.inviteUserToPage&&"@"===m&&!d.inviteUserToPage,R=S.bot&&"@"===m&&!d.bot,D=S.date&&"@"===m&&!d.date,E=S.reminder&&"@"===m&&!d.reminder,F=S.templateVariable&&"@"===m&&!d.date&&!d.templateVariable,Z=S.group&&"@"===m&&!d.group,U=S.formulaContextVariable&&"@"===m&&!d.formulaContextVariable;if(!(C||Z||k||I||D||E||F||U))return;if("+"===m&&!I)return;const V=r.Il(),N=r.Il();A.S(t),_.Z.setState({open:!0,flowId:V,sessionId:N,openTime:Date.now(),insertionType:m,textStore:n,oldTextValue:l,oldSelection:s,selectionRect:y,userRequestStore:_.Z.state.userRequestStore,botRequestStore:new x.Z,pageRequestStore:new x.Z,temporaryInputData:o.default.createValue(void 0,{name:"temporaryInputData"}),mentionTypes:(0,i.lX)({page:k,createPage:I,user:C,inviteUserToWorkspace:T,inviteUserToPage:P,bot:R,date:D,reminder:E,templateVariable:F,formulaContextVariable:U,group:Z,heading:w}),expandSection:void 0,showCreateIn:!1,showInvite:!1,showMentionAndShare:!1,showFormulaProperty:!1,createInQuery:"",isEmptyPageTitle:!1,usePopupOnMobile:u,sectionOrder:p}),M.j1(t,{analyticsFrom:_.Z.getMentionMenuContext(),flowId:V,searchSessionId:N})}function F(e){const{environment:t,mentionTypes:n,usePopupOnMobile:o,mentionSectionOrdering:r}=e;R.N3({direction:"end"});const s=I.default.state;if("editing"!==s.mode)return;const l=(0,m.QY)(s.multiSelection);return l?function(e){const{selection:t,textValueStore:n,environment:o,mentionTypes:r,usePopupOnMobile:s,mentionSectionOrdering:l}=e;let c=!1;if(t.startIndex>0){const e=n.getValue()||[],o=a.eeV(e)[t.startIndex-1];/[\s]/g.test(o)||(c=!0)}D.createAndCommit({userAction:"mentionMenuActions.insertMention",environment:o,perform:e=>{c?(R.hJ({environment:o,store:n,editorMode:"default",string:" ",selection:t,disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,transaction:e,mentionSectionOrdering:l}),R.hJ({environment:o,store:n,editorMode:"default",string:"@",selection:{startIndex:t.startIndex+1,endIndex:t.endIndex+1},disableMentions:!1,disableSlashCommands:!0,disableEmojiCommands:!0,transaction:e,mentionSectionOrdering:l})):R.hJ({environment:o,store:n,editorMode:"default",string:"@",selection:t,disableMentions:!1,disableSlashCommands:!0,disableEmojiCommands:!0,transaction:e,mentionSectionOrdering:l})}});const d=_.Z.state;if(!d.open)return;const u=B({environment:o,textStore:n});_.Z.setState({...d,usePopupOnMobile:s,mentionTypes:(0,i.lX)({page:u.page&&r.page,createPage:u.createPage&&r.createPage,user:u.user&&r.user,inviteUserToWorkspace:u.inviteUserToWorkspace&&r.inviteUserToWorkspace,inviteUserToPage:u.inviteUserToPage&&r.inviteUserToPage,bot:u.bot&&r.bot,date:u.date&&r.date,reminder:u.reminder&&r.reminder,templateVariable:u.templateVariable&&r.templateVariable,group:u.group&&r.group,heading:u.heading&&r.heading,formulaContextVariable:u.formulaContextVariable&&r.formulaContextVariable})})}({environment:t,mentionTypes:n,textValueStore:l.store,selection:l.selection,usePopupOnMobile:o,mentionSectionOrdering:r}):void 0}function Z(e){const t=_.Z.state,{environment:n,editorMode:o,annotations:r=[],transaction:i,menuListItemAction:s,query:l,serverEventProperties:c,mentionType:d,resultId:u,shareMenuSelection:p}=e;if(t.open){let e=t.oldTextValue,m=t.oldSelection;const g=t.insertionType.length-1;g>0&&(e=a._QS(e,t.oldSelection.startIndex-g,t.oldSelection.startIndex),m={startIndex:m.startIndex-g,endIndex:m.endIndex-g}),R.sO({environment:n,store:t.textStore,value:e,transaction:i});const f=_.Z.getMentionMenuContext();r.forEach((e=>{R.lZ({environment:n,editorMode:o,store:t.textStore,selection:m,annotation:e,analyticsFrom:f,transaction:i,shareMenuSelection:p})}));const h=Date.now();if("page"===d&&u&&w.Z.recordMention({id:u,timestamp:h,currentUserId:n.currentUser.id}),d){const{numServerRequests:e}=S.Z.state;M.z7(n,{clickIndexGlobal:null==s?void 0:s.index,clickIndexLocal:null==s?void 0:s.indexLocal.indexLocal,sectionIndex:null==s?void 0:s.indexLocal.section,analyticsFrom:f,timeToClickInMs:h-t.openTime,queryLength:l.length,serverEventProperties:c,mentionType:d,resultId:u,flowId:t.flowId,searchSessionId:t.sessionId,searchSessionFlowNumber:e})}U()}}function U(){_.Z.setState({open:!1,sessionId:void 0,userRequestStore:_.Z.state.userRequestStore,botRequestStore:_.Z.state.botRequestStore,pageRequestStore:_.Z.state.pageRequestStore,mentionTypes:_.Z.state.mentionTypes}),S.Z.reset()}async function V(e){const{environment:t,titleText:n,ignoreSelectionAreaStore:o,createInValue:r,onPageCreated:i,menuListItemAction:a}=e,s=_.Z.state;if(!s.open)return;if(!C.M_(t))return;o.reset();const{performResult:l}=await D.createAndCommitAsync({environment:t,userAction:"mentionMenuActions.acceptCreateIn",waitForServerCommit:!0,perform:async e=>{const o=P.f8({environment:t,transaction:e,titleText:n,createInValue:r,recordStoreParentStore:s.textStore}),l=o.createdPages[0];if(l)return i&&i(l),Z({environment:t,editorMode:"default",annotations:[["p",l.id]],transaction:e,menuListItemAction:a,query:n,mentionType:"createPage"}),await o.moveToStorePromise,{createInState:o}}});if(l){const{createInState:e}=l;return await P.c_({analyticsFrom:"mention_menu",createInState:e}),e}}},91376:(e,t,n)=>{n.d(t,{CT:()=>l,r$:()=>s});var o=n(397799),r=n(80444),i=n(64404),a=n(992083);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{currentTab:t,subtab:n,isMobile:i,openedFrom:s,upsellType:d,highlightedSetting:u}=e;if(i)"notifications"!==t&&"notifications_and_settings"!==t&&"user_settings"!==t||o.Z.setState({open:!0});else if(t)a.Z.setState({open:!0,openedFrom:s,upsellType:d,...c({currentTab:t,subtab:n}),highlightedSetting:u});else{const{currentSpaceStore:e}=r.default.state;a.Z.setState({open:!0,openedFrom:s,upsellType:d,currentTab:l(e),defaultSubtab:void 0,highlightedSetting:u})}}function l(e){return e&&e.canRead()?"members":"settings"}function c(e){const{currentTab:t,subtab:n}=e;if("members"===t){return{currentTab:"members",defaultSubtab:n===i.Q.Members||n===i.Q.Groups||n===i.Q.Guests||n===i.Q.Reprovisioning||n===i.Q.Requests?n:void 0}}if("integrations"===t){return{currentTab:"integrations",defaultSubtab:"member_connections"===n||"workspace_connections"===n?n:void 0}}if("security"===t){return{currentTab:"security",defaultSubtab:"security"===n||"data_retention"===n?n:void 0}}return{currentTab:t,defaultSubtab:void 0}}},60971:(e,t,n)=>{n.d(t,{aV:()=>i,eV:()=>a,kW:()=>c,sv:()=>d});var o=n(653965),r=n(385818);function i(e){const{store:t,itemsPerRow:n,sections:o,disableKeyboardArrowWrap:r}=e,{focus:i}=t.state;if(void 0===i.indexLocal)return c({store:t,sections:o,indexGlobal:0});const a=i.indexLocal+n,d=o[i.section],u=d.items.length-1;if(a<=u)return c({store:t,sections:o,indexLocal:{section:i.section,indexLocal:a}});const p=function(e){const{indexLocal:t,section:n,itemsPerRow:o}=e,r=l({indexLocal:t,section:n,itemsPerRow:o});if(!r)return;const i=s({section:n,itemsPerRow:o});if(!i)return;return r.rowsBefore===i.rowsBefore}({indexLocal:i.indexLocal,section:d,itemsPerRow:n});if(void 0===p)return;if(!1===p)return c({store:t,sections:o,indexLocal:{section:i.section,indexLocal:u}});const m=function(e){const{currentSection:t,sections:n,disableWrap:o}=e;if(0===n.length)return;if(t&&t>=n.length&&o)return;const r=void 0===t?0:(t+1)%n.length,i=n[r];if(!i)return;return{index:r,section:i}}({currentSection:i.section,sections:o,disableWrap:r});if(!m)return;const g=i.indexLocal%n;return m.section.items.length<=g?c({store:t,sections:o,indexLocal:{section:m.index,indexLocal:0}}):c({store:t,sections:o,indexLocal:{section:m.index,indexLocal:g}})}function a(e){const{store:t,itemsPerRow:n,sections:o,disableKeyboardArrowWrap:i}=e,{focus:a}=t.state;if(void 0===a.indexLocal){return c({store:t,indexGlobal:r.tM(o)-1,sections:o})}const l=a.indexLocal-n;if(l>=0)return c({store:t,sections:o,indexLocal:{section:a.section,indexLocal:l}});const d=function(e){const{currentSection:t,sections:n,disableWrap:o}=e;if(0===n.length)return;if(0===t||void 0===t){if(o)return;const e=n.length-1,t=n[e];if(!t)return;return{index:e,section:t}}const r=n[t-1];if(!r)return;return{index:t-1,section:r}}({currentSection:a.section,sections:o,disableWrap:i});if(!d)return;const u=s({section:d.section,itemsPerRow:n});if(!u)return;const p=a.indexLocal%n;if(u.column<p)return c({store:t,sections:o,indexLocal:{section:d.index,indexLocal:u.indexLocal}});{const e=u.rowsBefore*n+p;return c({store:t,sections:o,indexLocal:{section:d.index,indexLocal:e}})}}function s(e){const{section:t,itemsPerRow:n}=e;if(0===t.items.length)return;if(0===n)return;const o=t.items.length-1,r=l({indexLocal:o,section:t,itemsPerRow:n});return r?{indexLocal:o,...r}:void 0}function l(e){const{indexLocal:t,section:n,itemsPerRow:o}=e;if(!(o<=0||t>=n.items.length))return{rowsBefore:Math.trunc(t/o),column:t%o}}function c(e){const{store:t,sections:n}=e;if(e.indexLocal){const o=r.$6(e.indexLocal,n);if(!r._K(e.indexLocal,n))return;t.setState({...t.state,focus:{...e.indexLocal,indexGlobal:o}})}else if(void 0===e.indexGlobal)t.unsetFocus();else{const o=r.Ds(e.indexGlobal,n);if(!o)return;t.setState({...t.state,focus:{...o.index,indexGlobal:e.indexGlobal}})}}function d(e){let{store:t,focus:n}=e;"number"==typeof t.state.focus.indexLocal&&(o.Xy(n,t.state.focus)||t.setState({...t.state,focus:n}))}},98958:(e,t,n)=>{n.r(t),n.d(t,{handleTokenRefresh:()=>h,initializeMobileNativeApp:()=>m,invalidateToken:()=>f,registerPushNotifications:()=>g,waitForCssInsets:()=>v});var o=n(568626),r=n(262643),i=n(564850),a=n(552629),s=n(937850),l=(n(95477),n(855337)),c=n(206258),d=n(21359),u=n(709953),p=n(210228);async function m(e){if(e.device.isMobileNative&&e.mobileNative&&(await v(e),e.mobileNative.updateReceiveApiHandlers({track:t=>{l.K4(e,t.eventName,{...t.eventData,logging_source:"mobile_native"})}}),e.mobileNative&&e.mobileNative.sqliteConnection)){try{await e.mobileNative.sqliteConnection.ensureMigrated()}catch(t){o.log({level:"error",from:"mobileNativeActions",type:"sqliteConnectionEnsureMigratedError",error:(0,a.Ui)(t),data:(0,i.fq)(t,{isBrowser:!1,wasmSqliteStorage:void 0})})}e.mobileNative.sqliteConnection.optimize().catch((e=>{o.log({level:"error",from:"mobileNativeActions",type:"sqliteConnectionOptimizeError",error:(0,a.Ui)(e),data:(0,i.fq)(e,{isBrowser:!1,wasmSqliteStorage:void 0})})}))}}async function g(e){const{mobileNative:t}=e;if(t&&t.api.registerPushNotifications){const n=await t.api.registerPushNotifications();n&&h(e,n,"registration")}}function f(e){const{environment:t,token:n,userId:o}=e,i=(0,r.r9)({user_id:o,token:n}),a=new c.ST({environment:t,pointer:{table:r.q4,id:i}});p.createAndCommit({userAction:"mobileNativeActions.invalidateToken",userId:o,environment:t,perform:e=>{u.sW({store:a,data:{invalid:!0},transaction:e})}})}async function h(e,t,n){const o=e.currentUser.id;if(t&&o){const n=(0,r.r9)({user_id:o,token:t}),i=await d.syncRecordValue(e,{pointer:{table:r.q4,id:n},userId:o,version:-1});let a=!1;i&&(i.value&&!i.value.invalid||(p.createAndCommit({userAction:"mobileNativeActions.handleTokenRefresh",environment:e,perform:i=>{u.ae({environment:e,table:r.q4,value:{id:n,token:t,user_id:o,invalid:!1},inMemoryRecordCache:e.defaultRecordCache.inMemoryRecordCache,transaction:i})}}),a=!0))}}async function v(e){if(!e.device.isIOS||!e.device.isMobileNative)return;const t=document.createElement("div");t.style.width=`calc(${["env(safe-area-inset-top)","env(safe-area-inset-bottom)","env(safe-area-inset-left)","env(safe-area-inset-right)"].join(" + ")})`,t.style.visibility="hidden",document.body.appendChild(t);let n=0;for(;n<50&&!(t.offsetWidth>0);)await s.Vs(1),n++;document.body.removeChild(t),e.WindowSizeStore.updateWindowSize()}},929533:(e,t,n)=>{n.d(t,{R:()=>i,h:()=>a});var o=n(940470),r=n(917294);function i(e,t){const n={taskStatus:e.taskStatus,...o.x.isSuccess(e)?{completeBlocks:e.value.completeBlocks,totalBlocks:e.value.totalBlocks}:{}};r.Z.update((e=>({...e,[t]:n})))}function a(e){r.Z.update((t=>({...t,[e]:void 0})))}},760870:(e,t,n)=>{n.d(t,{I0:()=>S,eX:()=>b,j2:()=>_,wS:()=>y});n(667294);var o=n(915157),r=n(421202),i=n(653965),a=n(619584),s=n(948514),l=n(175770),c=n(698110),d=n(80444),u=n(385555),p=n(206258),m=n(73990),g=n(476464),f=n(164964),h=n(785893);const v=10;function y(e){const{environment:t,movedItems:n,previousParentIds:o,moveToLocation:r,disableSuccessToast:i,numSubitems:a}=e,d=n.some((e=>{const t=o[e.id],n=e.getParentId();return!(!t||t===n)})),p="on"===u.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0});if(!i&&d){var m;f.oV({label:(0,l.ah)({environment:t,movedItems:n,moveToLocation:r,numSubitems:a}),right:(0,h.jsx)(c.Z,{moveToLocation:r,movedItems:n})});const e=s.Z.state.open?null===(m=s.Z.state)||void 0===m?void 0:m.blockId:void 0;p&&s.Z.state.open&&e&&n.find((t=>t.id===e))&&s.Z.setState({open:!1,rect:new DOMRect})}}function b(e){const{environment:t,transaction:n,moveToStore:o,targetBlocks:r,from:i}=e,{currentUserStore:a}=d.default.state;null!=a&&a.isDefined()&&o.canEdit()&&!o.canAdmin()&&r.forEach((e=>{if(e.canAdmin())return m.Y8(t,{from:i}),g.l3({transaction:n,store:e,environment:t,permissionItems:[{type:"user_permission",user_id:a.id,role:"editor"}]})}))}async function _(e,t,n){const r=await S(e,t),a=i.jj([n,...r]).slice(0,v);o.Z.set({userId:e.environment.currentUser.id,key:k(t),value:JSON.stringify(a)})}async function S(e,t){const n=o.Z.get({userId:e.environment.currentUser.id,key:k(t)});if(n){const t=(0,a.dj)(n);if(t){const n=await Promise.all(t.map((async t=>{const n=p.G.createChildStore(e,{table:r.iU,id:t});return await n.load(),n.canEdit()})));return t.filter(((e,t)=>n[t]))}}return[]}function k(e){return`recentMoveToTargets2:${e}`}},211302:(e,t,n)=>{n.d(t,{$X:()=>te,QF:()=>ne,RL:()=>re,Ws:()=>ae,Y:()=>le,at:()=>pe,bA:()=>ee,kj:()=>se,pB:()=>oe,xv:()=>ie,z1:()=>J});n(252262),n(324506),n(21703);var o=n(815145),r=n(371663),i=n(541432),a=n(399036),s=n(568626),l=n(471924),c=n(421202),d=n(606287),u=n(475246),p=n(709291),m=n(653965),g=n(401898),f=n(110906),h=n(27105),v=n(119037),y=n(855337),b=n(277181),_=n(433929),S=n(175770),k=n(798165),w=n(548779),x=n(905162),I=n(80444),C=n(925489),T=n(385555),M=n(242330),P=n(398452),A=n(206258),R=n(452258),D=n(352229),B=n(73990),E=n(106404),F=n(554569),Z=n(730188),U=n(547307),V=n(957400),N=n(792625),O=n(760870),L=n(472711),j=n(119785),K=n(709953),z=n(901357),q=n(524677),H=n(164964),G=n(29974),W=n(400150),$=n(210228),Y=n(668422),Q=n(165452);function J(){return[v._z,v.Ggh,v.jlf,v.ffD(v.$I3),v.ffD(v.xwj),v.ffD(v.P99(i.Ti.externalObjectInstancePage)),v.ffD(v.Q_M),v.ffD(v.xDj),v.ffD(v.CJE),v.ffD(v.Hjo),v.k5s,v.ffD(v.q4$),v.ffD(v.uY7),v.ffD(v.ypk)]}const X=(0,p.defineMessages)({duplicatingContent:{id:"moveToMenuActions.duplicatingContent.loadingMessage",defaultMessage:"Duplicating content…"},duplicatedToSpace:{id:"moveToMenuActions.duplicatedToSpace.toast",defaultMessage:"Duplicated {name} to {spaceName}"}});function ee(e){const{environment:t,blocks:n,originRect:o,moveToContext:i,onAccept:a,onCanceled:s,isAddTo:c,isDefaultPrivateLocation:d,disableSuccessToast:u,dontCommitActions:p,forceUntyped:m,forceShowPrivatePageOption:g}=e,f=Date.now(),h=(0,M.rJ)(n),v=function(e){const{hasDatabaseType:t,forceUntyped:n}=e;if(n)return r.br;if(t)return r.ii;return r.br}({forceUntyped:m,hasDatabaseType:Boolean(h)}),y=l.Il();n.length&&(R.Z.reset(),P.Z.reset(),E.xv(),M.ZP.setState({variant:v,isOpen:!0,rect:o,targets:n,autocompleteQuery:"",moveToContext:i,onAccept:a,onCanceled:s,isAddTo:c,isDefaultPrivateLocation:d,lastPageId:M.ZP.state.lastPageId,disableSuccessToast:u,dontCommitActions:p,openedTimeMs:f,flowId:y,forceShowPrivatePageOption:g,queryLimit:S.Kg,canLoadMore:!0}),B.rY(t,{from:i,render_type:"web",target_block_ids:n.map((e=>e.id)),targets_database_type:h,flowId:y}))}async function te(e){const t=await async function(e){var t;const{environment:n,blocks:o,originRect:i,moveToContext:a,disableSuccessToast:s,onAccept:c,onCanceled:d,isAddTo:u}=e,{currentSpaceStore:p}=I.default.state,m=Date.now(),g=M.ZP.state.isOpen?M.ZP.state.flowId:l.Il(),f=(0,M.rJ)(o);if(!u&&f&&f!==r.GZ)return!1;if(!(0,x.Y)("supportsNativeMoveTo")||null===(t=n.mobileNative)||void 0===t||!t.api.moveTo||0===o.length||!p)return!1;const h=o.map((e=>e.id)),v=await n.mobileNative.moveTo({targets:h,spaceId:p.id,isAddTo:u||!1,moveToContext:a,flowId:g});if(!v)return!1;if(!v.supported||!v.destination)return v.supported&&d&&d(),v.supported;R.Z.reset(),P.Z.reset(),E.xv(),M.ZP.setState({variant:r.br,isOpen:!0,rect:i,targets:o,autocompleteQuery:"",moveToContext:a,dontCommitActions:e.dontCommitActions,disableSuccessToast:s,onAccept:c,isAddTo:u,lastPageId:M.ZP.state.lastPageId,renderType:"mobileNative",openedTimeMs:m,flowId:g,queryLimit:S.Kg,canLoadMore:!0});const y=M.ZP.state.isOpen&&M.ZP.state.useSudoMode;return await oe({environment:n,value:v.destination,useSudoMode:y,renderType:"native",isSearchResult:v.isSearchResult}),ie({environment:n,clearSelection:!1}),!0}(e);t||ee(e)}function ne(e,t,n){if("page"!==n.type)return!1;const o=new A.G(e,{table:c.iU,id:n.id}),r=(0,k.qA)(o);for(const i of r)if(t.includes(i.id))return!0;return!1}async function oe(e){const{environment:t,value:n,useSudoMode:o,renderType:r,shouldClearPagePermissions:i,isSearchResult:a}=e,s=M.ZP.state;if(s.isOpen)return s.dontCommitActions?(ie({environment:t,clearSelection:!0}),void(s.onAccept&&s.onAccept(n))):void(await $.createAndCommitAsync({environment:t,userAction:"MoveToMenuRenderer.completeMoveTransaction",waitForServerCommit:!1,useSudoMode:o,perform:async e=>{const{targets:o,disableSuccessToast:l,moveToContext:c,isDefaultPrivateLocation:d,flowId:u,autocompleteQuery:p}=s;await re({targets:o,value:n,transaction:e,environment:t,shouldClearPagePermissions:i,disableSuccessToast:l,moveToContext:c,isDefaultPrivateLocation:d,renderType:r,timeToSelectMs:Date.now()-s.openedTimeMs,flowId:u,isSearchResult:Boolean(p)||a}),s.onAccept&&s.onAccept(n)}}))}async function re(e){let{targets:t}=e;const{value:n,transaction:o,environment:r,shouldClearPagePermissions:s,disableSuccessToast:l,moveToContext:u,isDefaultPrivateLocation:p,renderType:h,timeToSelectMs:v,flowId:_,isSearchResult:w}=e,{currentSpaceStore:x}=I.default.state;if(!x)return;const C=await async function(e,t,n,o){let r=[];const i=m.Ps(e);if(!i)return[];const s=(0,f.fm)(i)??(0,b.Ll)(i,n);if(!s)return[];if(!s.collectionStore())return[];const l=s.currentSubitemFormatStoreForCollectionStore.state,c=s.normalizedSchemaStore.state,d=(null==l?void 0:l.inverse)&&c[l.inverse];if(!d||!(0,a.p_)(d))return[];if(!e.some((e=>(0,b.CJ)({store:e,subitemFormat:l,propertySchema:d}).length>0)))return[];const u=(0,S.uw)(t);if(u instanceof A.NW||u instanceof A.G){if(await de(u)instanceof A.NW)return r=await Z.xr({environment:n,blocks:e,options:{canEdit:!0},collectionContextStore:s}),r}return[]}(t,n,r);t=[...t,...C],ie({environment:r,clearSelection:!0});const T=x.id,P=function(e){const{type:t}=e;switch(t){case"page":case"collection":case"space-private-pages":case"team":return e.spaceId;case"space":return e.id;default:(0,g.t1)(t)}}(n);if(P&&T!==P){if(!(await(0,S.cJ)()))return}const R=t.find((e=>{const t=e.getType();return Boolean(t&&(0,i.S9)(t))})),D=R&&(0,k.VP)(R),E=(0,M.rJ)(t),F=Object.fromEntries(t.map((e=>[e.id,e.getParentId()]))),U=await se({environment:r,value:n,targets:t,transaction:o,shouldClearPagePermissions:s});if(!U)return;const V=(0,S.HE)(n,r);O.wS({environment:r,previousParentIds:F,movedItems:t,moveToLocation:V,disableSuccessToast:l,numSubitems:C.length});const N=R&&(0,k.VP)(R);B._T(r,{table:U.table,from:u,type:null==V?void 0:V.type,team_before:D&&(0,y.nB)(D),team_after:N&&(0,y.nB)(N),targets_database_type:E,destination_database_type:U.table===d.vF?U.getDatabaseType():void 0,isDefaultPrivateLocation:p,render_type:h,time_to_select_ms:v,flowId:_,isSearchResult:w,subitemTreeSize:C.length>0?C.length:void 0}),U.table===c.iU&&await O.j2(x,x.id,U.id)}function ie(e){const{environment:t,clearSelection:n}=e,o=M.ZP.state;M.ZP.setState({isOpen:!1,lastPageId:o.lastPageId}),n&&q.ZH({environment:t}),o.isOpen&&"home_tab"===o.moveToContext&&z.d(t)}async function ae(e){return ce({...e,action:"add"})}async function se(e){return ce({...e,action:"move"})}async function le(e){return ce({...e,action:"retain-alias"})}async function ce(e){const{value:t,transaction:n,targets:r,shouldClearPagePermissions:i}=e,a=(0,S.uw)(t),l=await W.fg({moveStores:r,moveTargetStore:a});if("user_cancelled_move"===l)return;let d;const p=r.at(0);p&&(d=(0,b.g0)(p)||(0,b.kG)(p,e.environment));const m=await async function(e){const{transaction:t,targets:n,value:r,environment:i,action:a}=e,{mainEditorCurrentBlockStore:l,currentSpaceStore:d,currentSpaceViewStore:u}=I.default.state,{id:p}=i.currentUser;if(!p||!u)return;const m=(0,S.uw)(r);if(!m)return;let f;const{table:v}=m;switch(v){case"collection":case"block":f=await async function(e){const{environment:t,blockOrCollectionStore:n,targets:o,transaction:r,retainAliasInCurrentParent:i}=e,a=await de(n);if(!a)throw new Error("Move to store invalid.");if(a instanceof A.G&&T.default.checkGate({gateName:"enable_text_crdt_client"})&&(await a.load(),(0,h.iG)(a,o)))return void H.oV({label:(0,h.s8)(a)});for(const s of o){const e=s.getParentStore();if(e instanceof A.G&&i){const n=D.k({environment:t,parentBlockStore:e,targetStore:s,transaction:r});j.jG({parentStore:e.getContentStore(),after:s.id,childStore:n,transaction:r})}if(a instanceof A.G)j.jG({parentStore:a,childStore:s,transaction:r});else if(a instanceof A.NW){const e=F.o3({environment:t,stores:[s],spaceId:a.getSpaceId(),transaction:r})[0];F.mp({environment:t,store:e,collectionStore:a,shouldCoerce:!0,groupsPointer:[],transaction:r}),j.zw({parentStore:a,childStore:e,transaction:r})}}return a}({environment:i,blockOrCollectionStore:m,targets:n,transaction:t,retainAliasInCurrentParent:"retain-alias"===a});break;case"space":if("space-private-pages"===r.type&&m.id===(null==d?void 0:d.id))f=ue({environment:i,spaceStore:m,spaceViewStore:u,targets:n,transaction:t,currentUserId:p,retainAliasToBlock:"retain-alias"===a});else{if(!l)return;f=await async function(e){const{environment:t,transaction:n,currentSpaceViewStore:r,currentBlockStore:i,currentUserId:a,spaceStore:l,targets:d,action:u,value:p}=e;if("space"!==p.type&&p.spaceId&&p.spaceId!==l.id)throw new Error("Wrong value to move to another space");Y._w({environment:t,blocks:d,transaction:n});const m=i.getSpaceId()||l.id;let g;if("move"===u&&("space"!==p.type&&p.spaceId&&p.spaceId!==m||"space"===p.type&&p.id!==m||"space-private-pages"!==p.type)){N.j({message:X.duplicatingContent,targetRecordId:l.id});const e=await G.eX({environment:t,blockStores:d,spaceId:l.id,targetParent:me(p)});if(N.x(),void 0!==e.error)return void U.showErrorMessage(e.error);g=e.value}else"space-private-pages"===p.type&&ue({environment:t,spaceStore:l,spaceViewStore:r,targets:d,transaction:n,currentUserId:a,retainAliasToBlock:"retain-alias"===u});await async function(e){const{environment:t,currentBlockStore:n,currentUserId:r,spaceStore:i,targets:a,crossSpaceTargetBlockId:l}=e,d=Boolean(a.find((e=>e.id===n.id))),u=(0,w.w3)(i.id);if(!d||!u)return;const p=l?A.G.createChildStore(n,{table:c.iU,id:l}):n;await Q.l({environment:t,spaceId:i.id,userId:r}),await async function(e){const{environment:t,spaceStore:n,spaceViewStore:o,blockStore:r}=e;n&&o&&(t.device.isMobileNative&&s.log({level:"info",from:"moveToMenuActions",type:"SpaceSwitchingDebug",data:{message:"moveToMenuActions.switchToSpace"}}),I.default.setState({...I.default.state,currentSpaceStore:n,currentSpaceViewStore:o,mainEditorCurrentBlockStore:r}),await V.Yh(t))}({environment:t,spaceStore:i,spaceViewStore:u,blockStore:p}),L.ru({environment:t,blocks:[p],pageVisitSource:o.tY.Move})}({environment:t,currentBlockStore:i,currentUserId:a,targets:d,spaceStore:l,crossSpaceTargetBlockId:g}),g&&H.oV({label:_.default.formatMessage(X.duplicatedToSpace,{name:(0,S.EC)({movedItems:d}),spaceName:l.getName()})});return l}({environment:i,transaction:t,currentSpaceViewStore:u,currentBlockStore:l,currentUserId:p,spaceStore:m,targets:n,value:r,action:a})}break;case"team":f=pe({environment:i,transaction:t,currentSpaceViewStore:u,teamStore:m,targets:n,value:r,action:a,location:{type:"append"}});break;default:(0,g.t1)(v)}"move"===a&&O.eX({environment:i,transaction:t,moveToStore:m,targetBlocks:n,from:"move_to"});return f}({...e});if(m){for(const{blockStore:e,permissions:t}of l)K.sW({store:e,data:{permissions:t},transaction:n});if(!i||a.table===u.bx&&"space-private-pages"===t.type||G.O2({blocks:r,transaction:n}),d&&m instanceof A.NW&&p){let t=(0,b.ko)(m);if(!t){const o=new C.Z(e.environment);if(o.setContext({type:"collectionPage",collectionViewBlockStore:void 0,collectionStore:m}),o){Z.Bb({transaction:n,collectionContextStore:o,environment:e.environment})&&(t=(0,b.ko)(m))}}d&&t&&Z.cI({blocks:r,transaction:n,from:d.subitemFormat,to:{property:t.property,inverse:t.inverse},environment:e.environment})}return m}}async function de(e){let t;return await e.load(),t=e instanceof A.NW?e:e.isLinkedCollectionView()?e.getCollectionViewSourceOrLinkCollectionStores()[0]:e.isCollectionView()?e.getCollectionViewCollectionStore():e,t}function ue(e){let{environment:t,spaceStore:n,spaceViewStore:o,targets:r,currentUserId:i,transaction:a,retainAliasToBlock:s}=e;for(const l of r){const e=l.getParentStore();if($.applyOperation({store:l,operation:{command:"moveToPrivate",path:[],pointer:l.getSpaceShardedPointer(),args:{spaceViewPointer:o.getSpaceShardedPointer(),userId:i,removeFromParent:null==e?void 0:e.pointer}},transaction:a}),e instanceof A.G&&s){const n=D.k({environment:t,parentBlockStore:e,targetStore:l,transaction:a});j.jG({parentStore:e.getContentStore(),after:l.id,childStore:n,transaction:a})}}return n}function pe(e){let{transaction:t,currentSpaceViewStore:n,teamStore:o,targets:r,location:i,environment:a}=e;const s=n.getTeamsStores(),l=o.getTeamPagesStore();Y._w({environment:a,blocks:r,transaction:t});for(const c of r){const e=m.sE(s,(e=>{const t=e.getTeamPagesStore().getValue();if(t)return t.includes(c.id)}));(null==e?void 0:e.id)!==o.id&&("append"===i.type?j.jG({parentStore:l,childStore:c,after:i.after,transaction:t}):"prepend"===i.type?j.SH({parentStore:l,childStore:c,before:i.before,transaction:t}):(0,g.t1)(i),e&&W.sp({teamStore:e,store:c,transaction:t}))}return o}function me(e){const{type:t}=e;switch(t){case"space":case"space-private-pages":return;case"page":return e.spaceId?{id:e.id,table:"block",spaceId:e.spaceId}:void 0;case"collection":case"team":return e.spaceId?{id:e.id,table:t,spaceId:e.spaceId}:void 0;default:(0,g.t1)(t)}}},717659:(e,t,n)=>{n.d(t,{$h:()=>C,E1:()=>I,G7:()=>P,Jl:()=>S,Qy:()=>M,aY:()=>T,aZ:()=>x,go:()=>b,rG:()=>k});var o=n(568626),r=n(865311),i=n(709291),a=n(552629),s=n(95477),l=n(433929),c=n(819034),d=n(80444),u=n(206258),p=n(304761),m=n(483249),g=n(519719),f=n(21359),h=n(547307),v=n(210228);const y=(0,i.defineMessages)({archiveError:{id:"notificationActions.archiveNotification.errorMessage",defaultMessage:"Failed to archive. Please try again."},setReadError:{id:"notificationActions.setRead.errorMessage",defaultMessage:"Failed to mark notification as read. Please try again."},setAllAsReadError:{id:"notificationActions.setAllAsRead.errorMessage",defaultMessage:"Failed to mark all notifications as read. Please try again."},setUnreadError:{id:"notificationActions.setUnread.errorMessage",defaultMessage:"Failed to mark notification as unread. Please try again."}});async function b(e){const t=p.ZP.state.currentTab,{currentSpaceStore:n}=d.default.state;if(n&&!s.default.isAdminMode&&(0,p.g0)(t)){try{await f.setNotificationsAsRead(e,{spaceId:n.id,timestamp:Date.now(),type:t})}catch(r){return h.showErrorMessage(l.default.formatMessage(y.setAllAsReadError)),void o.log({level:"error",from:"notificationActions",type:"setCurrentUpdatesTabAsRead",error:(0,a.Ui)(r)})}S(t,n.id,_.decrementToZero)}}const _={incrementByOne:e=>e+1,decrementByOne:e=>Math.max(e-1,0),decrementToZero:e=>0};function S(e,t,n){const{results:o}=c.Z.state,r=o.map((o=>{if(o.spaceId===t){const t=o.unread[e];return void 0===t?o:{...o,unread:{...o.unread,[e]:n(t)}}}return o}));c.Z.setState({results:r})}async function k(e,t,n){const{currentSpaceStore:r}=d.default.state;if(r&&!s.default.isAdminMode){try{for(;;){if(!(await w({environment:e,currentSpaceStore:r,inbox:t,readFilter:n})).more)break}}catch(i){return h.showErrorMessage(l.default.formatMessage(y.archiveError)),void o.log({level:"error",from:"notificationActions",type:"archiveAll",error:(0,a.Ui)(i)})}"read"!==n&&S(t,r.id,_.decrementToZero)}}async function w(e){const{environment:t,currentSpaceStore:n,inbox:r,readFilter:i}=e,s=await f.getUnvisitedNotificationIds(t,{spaceId:n.id,timestamp:Date.now(),type:r,size:500,readFilter:i});if("failed"===s.type)return h.showErrorMessage(l.default.formatMessage(y.archiveError)),o.log({level:"error",from:"notificationActions",type:"archiveApiError",error:(0,a.Ui)(s.error)}),{more:!1};const{notificationIds:c}=s.data;return await async function(e){const{environment:t,notificationIds:n,rootStore:o}=e,{serverCommitResult:r}=v.createAndCommit({userAction:"notificationActions.archiveNotificationIds",environment:t,canUndo:!0,undoCheckpoint:!0,perform:e=>{for(const t of n)I({transaction:e,rootStore:o,visited:!0,notificationId:t})}});await r}({environment:t,notificationIds:c,rootStore:n}),c.length>=500?{more:!0}:{more:!1}}function x(e){const{notification:t,rootStore:n,transaction:i}=e;if(!t.visited){try{I({notificationId:t.id,rootStore:n,transaction:i,visited:!0})}catch(s){return h.showErrorMessage(l.default.formatMessage(y.archiveError)),void o.log({level:"error",from:"notificationActions",type:"archiveNotification",error:(0,a.Ui)(s)})}if(!t.read){S(r.hE[t.type],t.space_id,_.decrementByOne)}}}function I(e){const{transaction:t,notificationId:n,rootStore:o,visited:i}=e,a=(0,u.Kv)(o,{table:r.uX,id:n});v.applyOperation({transaction:t,store:a,operation:{command:"update",pointer:{table:r.uX,id:n,spaceId:o.pointer.spaceId},path:[],args:i?{visited:!0,read:!0,archived_at:Date.now()}:{visited:!1,archived_at:null}}})}function C(e){const{transaction:t,notification:n,rootStore:i,read:s}=e;if(n.read===s)return;const c=(0,u.Kv)(i,{table:r.uX,id:n.id});try{v.applyOperation({transaction:t,store:c,operation:{command:"update",pointer:{table:r.uX,id:n.id,spaceId:n.space_id},path:[],args:{read:s,...s?{}:{visited:!1}}}})}catch(d){return e.suppressErrorMessage||h.showErrorMessage(l.default.formatMessage(s?y.setReadError:y.setUnreadError)),void o.log({level:"error",from:"notificationActions",type:"setRead",error:(0,a.Ui)(d)})}S("mentions",n.space_id,s?_.decrementByOne:_.incrementByOne)}function T(){return c.Z.getUnreadCountForCurrentSpace().mentions}async function M(e){const{environment:t}=e,{currentSpaceStore:n}=d.default.state;if(!n)return[];const o=await f.getUnvisitedNotificationIds(t,{spaceId:n.id,timestamp:Date.now(),type:"mentions",size:100,readFilter:"unread"});return"failed"===o.type?[]:o.data.notificationIds}function P(e){let{environment:t,newTab:n,shouldTrack:o}=e;const r=p.ZP.state.currentTab;if(r!==n&&("mentions"===n?p.ZP.update((e=>({...e,currentTab:n,containsBothReadAndUnreadNotifications:!1,containsUnreadNotifications:!1,showOnlyUnreadNotifications:!1,unreadNotificationIds:[]}))):p.ZP.update((e=>({...e,currentTab:n})))),o){const e=t.device.isMobile;g.GP({environment:t,forceRestartSession:!1,from:"updates-tab-click"}),e&&m.nB(t,{itemName:"updates"})}"mentions"===r&&async function(e){const t=await f.getUserNotifications(e,{size:1e3,isInboxV2:!0});if("failed"===t.type)return;const{results:n}=t.data;c.Z.setState({results:n})}(t)}},936110:(e,t,n)=>{n.d(t,{V:()=>v,g:()=>h});var o=n(977657),r=n(474181),i=n(256589),a=n(482036),s=n(89101),l=n(109852),c=n(218265),d=n(619584),u=n(86615),p=n(21359),m=n(547307),g=n(412714),f=n(608055);function h(e){const{environment:t,responseType:n,integrationId:o,redirectUri:r,state:i,owner:a,userId:l,spaceId:u}=e,p=c.bf({url:s._j.oauthAuthorization,query:(0,d.m8)(Object.entries({response_type:n,client_id:o,redirect_uri:r,state:i,owner:a,user_id:l,space_id:u}).filter((e=>{let[,t]=e;return t})))});f.c4({environment:t,url:p,redirect:!0})}async function v(e){const{environment:t,params:n,integration:d}=e;l.In(void 0);const h=d&&i._(d,n.redirectUri);if(!h)return void f.c4({environment:t,url:s._j.root,redirect:!0});let y;if("errorType"in e)y={error:e.errorType,state:n.state};else{const{integration:o,spaceId:i,blockIdsForBot:s,acceptedIntegrationCapabilities:l}=e;let c;if(c=(0,r.VM)(o)?await p.createOauthAuthorizationCode(t,{integrationId:o.id,spaceId:i,redirectUri:n.redirectUri,acceptedIntegrationCapabilities:l}):await p.createOauthAuthorizationCode(t,{integrationId:o.id,spaceId:i,redirectUri:n.redirectUri,blockIdsForBot:s,templatePageId:e.templatePageId,acceptedIntegrationCapabilities:l}),"failed"===c.type){m.showError(c);return v({environment:t,params:n,integration:o,errorType:503===c.status?a._.temporarily_unavailable:a._.server_error})}y={code:c.data.code,state:n.state}}d.id===o.Dv&&await u.dl(t);const b=c.bf({url:h,query:{...y}});g.D({environment:t,url:b,targetSelf:!0})}},215356:(e,t,n)=>{n.d(t,{M:()=>m});var o=n(89101),r=n(709291),i=n(937850),a=n(218265),s=n(95477),l=n(433929),c=n(385555),d=n(547307),u=n(247839);const p=(0,r.defineMessages)({allowPopup:{id:"authAction.authorize.popupBlocked",defaultMessage:"It looks like your browser is currently blocking popups. Please allow pop-ups to continue"},dismissButtonLabel:{defaultMessage:"OK",id:"dialog.dismissButton.label"}});async function m(e,t){const{width:n,height:r,url:m,titleMessage:f}=t,h=l.default.formatMessage(f);if(e.device.isElectron)return u.openOauthPopup({width:n,height:r,url:m,title:h});const v=e.device.isMobile,y=void 0!==window.screenX?window.screenX:window.screenLeft,b=void 0!==window.screenY?window.screenY:window.screenTop,_=void 0!==window.outerWidth?window.outerWidth:document.documentElement.clientWidth,S=void 0!==window.outerHeight?window.outerHeight:document.documentElement.clientHeight-22,k=v?0:n,w=v?0:r;let x="toolbar=0,menubar=0,location=0";0!==k&&(x+=`,width=${k}`),0!==w&&(x+=`,height=${w}`),x+=`,left=${(y<0?window.screen.width+y:y)+(_-k)/2}`,x+=`,top=${b+(S-w)/2.5}`,x+=",scrollbars=1";const I=g()?(0,a.bf)({url:`${s.default.domainBaseUrl}${o._j.verifyNoPopupBlockerHtmlAndRedirect}`,query:{redirectUri:m}}):m,C=window.open(I,h,x);if(C)C.focus();else if(g())return void d.showDialog({showCancel:!1,keepFocus:!1,message:l.default.formatMessage(p.allowPopup),items:[{label:l.default.formatMessage(p.dismissButtonLabel),onAccept:()=>{}}]});const T=i.UZ();if(I.includes("evernotepopupredirect")&&c.default.checkGate({gateName:"is_evernote_authpopup_closing_fix_enabled"})){const e=performance.now()+6e4,t=e=>{if(e&&e.data&&"popup-callback"===e.data.type){const t=e.data.url;T.resolve(t)}},n=setInterval((()=>{const t=performance.now(),n=localStorage.getItem("externalAuthCallback");n?T.resolve(n):C&&C.closed&&e<t&&T.resolve(void 0)}),300);window.addEventListener("message",t,!1);const o=await T.promise;return window.removeEventListener("message",t,!1),localStorage.removeItem("externalAuthCallback"),clearInterval(n),C&&C.close(),window.focus(),o}{const e=e=>{if(e&&e.data&&"popup-callback"===e.data.type){const t=e.data.url;T.resolve(t)}},t=setInterval((()=>{const e=localStorage.getItem("externalAuthCallback");e?T.resolve(e):C&&C.closed&&T.resolve(void 0)}),300);window.addEventListener("message",e,!1);const n=await T.promise;return window.removeEventListener("message",e,!1),localStorage.removeItem("externalAuthCallback"),clearInterval(t),C&&C.close(),window.focus(),n}}function g(){return"on"===c.default.getEligibleGroup({experimentId:"show_instruction_on_auth_popup_blocked",defaultGroup:"control"})}},889858:(e,t,n)=>{n.d(t,{A5:()=>se,D0:()=>J,Eo:()=>ae,LR:()=>ie,NP:()=>re,kC:()=>X,mv:()=>ee,pq:()=>te,v9:()=>ne});n(21703),n(757658),n(667294);var o=n(815145),r=n(541432),i=n(915157),a=n(772141),s=n(429369),l=n(709291),c=n(653965),d=n(783105),u=n(275754),p=n(691851),m=n(27105),g=n(304708),f=n(175770),h=n(35026),v=n(548779),y=n(195697),b=n(361673),_=n(681844),S=n(74948),k=n(224646),w=n(80444),x=n(155367),I=n(242330),C=n(206258),T=n(897630),M=n(88893),P=n(288280),A=n(273292),R=n(2679),D=n(100952),B=n(966324),E=n(498834),F=n(547307),Z=n(594419),U=n(13084),V=n(760870),N=n(211302),O=n(119785),L=n(476464),j=n(709953),K=n(926999),z=n(164964),q=n(29974),H=n(328014),G=n(400150),W=n(210228),$=n(668422),Y=n(801742),Q=n(785893);function J(e){var t,n;const{environment:i,store:a,transaction:s,navigateToParent:l,event:c,from:p}=e,g=a.isCollectionView()?(0,m.SL)({event:c,source:"collection_unknown_view",contextualDefault:null===(t=a.getCollectionViewCollectionStore())||void 0===t||null===(t=t.getDefaultTemplatePageStore())||void 0===t?void 0:t.useCrdt()}):a.useCrdt(),f=j.j4({environment:i,type:r.Ti.page,inMemoryRecordCache:a.inMemoryRecordCache,transaction:s,spaceId:a.isCollectionView()?null===(n=a.getCollectionViewCollectionStore())||void 0===n?void 0:n.pointer.spaceId:a.pointer.spaceId,useCrdt:g}),h=a.getAssociatedCollectionStore();if(a.isCollectionView()){const e=a.getCollectionViewCollectionStore()||h;if(!e)throw new Error("getCollectionViewCollectionStore() returned undefined");if(!O.zw({parentStore:e,childStore:f,transaction:s}))throw new Error("parentChildActions.moveToCollection() returned false");const t=e.getDefaultTemplatePageStore();t&&E.ob({title:"template",environment:i,store:f,templateStore:t,isKeyboard:!1,isCreateIn:!1,transaction:s,from:"outliner_actions"})}a.isCollectionView()||O.jG({parentStore:a.getContentStore(),childStore:f,transaction:s}),I.ZP.setState({...I.ZP.state,lastPageId:w.default.state.mainEditorCurrentBlockStore?w.default.state.mainEditorCurrentBlockStore.id:void 0}),i.device.isMobile?u._c({environment:i,store:f,showMoveTo:!1,saveParent:!1,visitType:d.vu.Link,pageVisitSource:o.tY.Create}):K.CH({environment:i,store:f,showMoveTo:!0,saveParent:!1,currentBlockStore:l?a:void 0,peekMode:void 0,resultsStore:void 0,collectionContextStore:void 0,pageVisitSource:o.tY.Create}),D.W(i,{from:"sidebar_outliner_item",outliner_location:"secondary_sidebar"===p?"pane":"sidebar",type:"page",new_page_id:f.id,creating_block_id:f.id,parent_collection_id:f.getParentCollectionIdUpToTwoLevels()})}async function X(e){const{environment:t,spaceStore:n,spaceViewStore:r,type:i,prepend:a,outlinerToggleButtonStore:s,outlinerItemFrom:c,shouldPersistToggleState:p,title:m,useCrdt:g}=e,f=new Y.sA(t,"createPageInSection");if(T.M_(t)){if("workspace"===i){const e=P.subscriptionDataStoreInstance.state,t=e?(0,M.su)(e):1;if(t>=10){if(!(await F.confirmUserAction({message:(0,Q.jsx)("span",{children:(0,Q.jsx)(l.FormattedMessage,{defaultMessage:"Are you sure you want to create a new top-level page? <strongtext>This page will be visible in the sidebar to all {memberCount} members of your workspace.</strongtext>",id:"sidebarActions.confirmDialog.newWorkspacePage.message",values:{strongtext:e=>(0,Q.jsx)("strong",{children:e}),memberCount:t}})}),acceptLabel:(0,Q.jsx)(l.FormattedMessage,{defaultMessage:"Create top-level page",id:"sidebarActions.confirmDialog.newWorkspacePage.confirmButton.label"})})))return null}}const{serverCommitResult:e,performResult:{createdPage:h}}=W.createAndCommit({userAction:"outlinerActions.createPageInSection",environment:t,perform:e=>{const o=H.KE({environment:t,spaceStore:n,spaceViewStore:r,isPrivate:"private"===i,prepend:a,transaction:e,title:m,tracker:f,useCrdt:g});return s&&ae({environment:t,spaceViewStore:r,type:i,outlinerToggleButtonStore:s,newIsHidden:!1,shouldPersistToggleState:Boolean(p)}),t.device.isMobile&&S.close(),{createdPage:o}}});if("private"===i){const e="secondary_sidebar"===c?"pane":"sidebar",n="secondary_sidebar"===c?"sidebar_private_pane":"sidebar_private_section";D.W(t,{from:n,outliner_location:e,type:"page",new_page_id:h.id,creating_block_id:h.id})}else"workspace"===i&&D.W(t,{from:"sidebar_workspace_section",type:"page",new_page_id:h.id,creating_block_id:h.id});const v=n.getDisableSpacePageEdits();return"workspace"===i&&v&&await e,b.cP({environment:t,checklistItem:"create_page"}),u._c({environment:t,store:h,visitType:d.vu.Link,pageVisitSource:o.tY.Create}),h}}async function ee(e){const{environment:t,spaceStore:n,spaceViewStore:r,teamStore:i,andNavigate:a,from:s,outlinerToggleButtonStore:l,shouldPersistToggleState:c,title:p,loading:m,appendOrPrepend:g,event:f}=e;if(!T.M_(t))return;const{serverCommitResult:h,performResult:{createdPage:v}}=W.createAndCommit({userAction:"outlinerActions.createPageInTeam",environment:t,perform:e=>({createdPage:te({environment:t,spaceStore:n,spaceViewStore:r,teamStore:i,from:s,title:p,event:f,loading:m,appendOrPrepend:g,transaction:e})})});return await h,a&&u._c({environment:t,store:v,visitType:d.vu.Link,pageVisitSource:o.tY.Create}),l&&A.k7({environment:t,spaceViewStore:r,teamStore:i,outlinerToggleButtonStore:l,newIsHidden:!1,shouldPersistToggleState:Boolean(c),isExplicitUserAction:!1}),b.cP({environment:t,checklistItem:"create_page"}),v}function te(e){const{environment:t,spaceStore:n,spaceViewStore:o,teamStore:r,from:i,title:a,event:l,loading:c,appendOrPrepend:d,transaction:u}=e;if(!(0,h.si)({teamStore:r,environment:t}))throw new Error("User is not eligible to create top-level page in team");const p=H.KE({environment:t,spaceStore:n,spaceViewStore:o,isPrivate:!1,prepend:!1,title:a,loading:c,transaction:u,useCrdt:(0,m.Sy)({event:l,source:"team"})});D.t(t,{teamStore:r,from:i,pageId:p.id,transaction:u}),L.u9({store:p,transaction:u});const g=(0,f.uw)({type:"team",id:r.id});if(g.table!==s.e0)throw new Error("Assertion failure, moveToStore table is not TeamTable!");return N.at({environment:t,transaction:u,action:"add",teamStore:g,currentSpaceViewStore:o,targets:[p],value:{type:"team",id:r.id},location:{type:d}}),p}async function ne(e){var t,n;const{environment:o,droppedStores:i,droppedDirection:s,type:c,targetStore:d,targetParentStore:u}=e,h=await(0,f.ed)({environment:e.environment,blocks:i,from:"dragAndDrop",dropArgs:{direction:s,destination:d??oe({targetStore:d,targetParentStore:u}),destinationOutlinerType:c}});if(!h.confirmed)return;const{shouldClearPagePermissions:y,shouldUpdateToManualSort:b}=h;if(1===i.length&&(null===(t=u.getValue())||void 0===t||null===(n=t.includes)||void 0===n||!n.call(t,i[0].id))){let e=[];for(const n of i)if(e=await p.NN({environment:o,block:n,action:"move"}),"user_canceled"===e)return;const t=i[0].id;for(const n of e)n.id!==t&&i.push(n)}const S=Object.fromEntries(i.map((e=>[e.id,e.getParentId()]))),{performResult:{moved:k}}=await W.createAndCommitAsync({environment:o,userAction:"outlinerActions.confirmAndHandleDrop",waitForServerCommit:!0,perform:async t=>{const n=await async function(e){const{environment:t,type:n,droppedDirection:o,targetStore:i,targetParentStore:s,droppedStores:c,transaction:d,isTopLevelItem:u,shouldClearPagePermissions:p,shouldUpdateToManualSort:f}=e,h=function(e){for(const t of e){const e=_.Z.findOutlinerItemFromStore(t);if(e)return e.type}}(c),{currentSpaceStore:y,currentUserStore:b}=w.default.state,S=null==y?void 0:y.id,k=P.subscriptionDataStoreInstance.state,I="bookmarks"===h&&"bookmarks"===n,T=le(e),A=S&&c.some((e=>e.isTopLevelWorkspacePage(S))),R=i&&S&&i.isTopLevelWorkspacePage(S),D=null==y?void 0:y.getDisableSpacePageEdits();if(S&&D&&(A||R)&&!I&&o!==x.vh.Onto&&null!=b&&b.isDefined()&&k){const e=(0,M.hn)(k).filter((e=>e.userId===b.id))[0];if(e&&!a.zz(e.role))return F.showErrorMessage((0,Q.jsx)(l.FormattedMessage,{defaultMessage:"This workspace has locked top-level workspace page operations.",id:"sidebarActions.confirmDialog.lockedWorkspaceTopLevel.message"})),!1}const B=oe({targetStore:i,targetParentStore:s});if(function(e){const{droppedDirection:t,targetStore:n,droppedStores:o,targetParentStore:r}=e,i=t===x.vh.Onto?n:r.getRecordStoreAtRootPath();if(!(i instanceof C.G))return!1;const a=(0,m.iG)(i,o);a&&z.oV({label:(0,m.s8)(i)});return a}(e))return!1;if(!I&&!T){if("user_cancelled_move"===await G.Hl({transaction:d,moveStores:c,moveTargetStore:B}))return!1}V.eX({environment:t,transaction:d,moveToStore:B,targetBlocks:c,from:"drag_and_drop"}),!f||"private"!==n&&"shared"!==n||function(e){let{environment:t,transaction:n,type:o}=e;const{currentSpaceViewStore:r,currentUserSettingsStore:i}=w.default.state;if(!r||!i)return{moved:!1};const{allPagesStores:a}=(0,v.a2)({environment:t,spaceViewStore:r,userSettingsStore:i,type:o}),s="private"===o?r.getPrivatePagesStore():r.getSharedPagesStore();j.sO({transaction:n,store:s,value:a.map((e=>e.id))});const l=r.getSettingsStore().getKeyStore("sidebar_section_menu").getKeyStore("sortOption").getKeyStore(o);l&&j.sO({transaction:n,store:l,value:"manual"})}({environment:t,transaction:d,type:n});const E=function(e){const{environment:t,type:n,targetStore:o,targetParentStore:i,droppedDirection:a,droppedStores:s,duplicate:l,transaction:c}=e,{currentSpaceViewStore:d,currentSpaceStore:u,currentUserSettingsStore:p}=w.default.state;let m;const f=null==o?void 0:o.getModel();if(a===x.vh.Onto&&o&&i&&null!=f&&f.isType(r.m3))m=U.LQ({environment:t,targetParentStore:i,targetStore:o,droppedDirection:x.vh.Below,droppedStores:s,duplicate:l,transaction:c});else if(le(e)&&o){if(!d||!p)throw new Error("currentSpaceViewStore or currentUserSettingsStore not found");const e=(0,g.mq)(t),{visiblePagesStores:n,allPagesStores:r}=(0,v._o)({environment:t,spaceViewStore:d,userSettingsStore:p,type:"shared"}).state,i=e?r.map((e=>e.id)):n.map((e=>e.id)),l=s.map((e=>e.id)),u=i.filter((e=>l.indexOf(e)<0)),f=u.findIndex((e=>e===o.id));let h=[];h=a===x.vh.Above?[...u.slice(0,f),...l,...u.slice(f)]:[...u.slice(0,f+1),...l,...u.slice(f+1)],e?j.sW({store:d,data:{shared_pages_manual_sort:h},transaction:c}):j.sW({store:d,data:{shared_pages:h},transaction:c}),m=s}else"private"===n&&u&&d&&H.OQ({environment:t,spaceStore:u,spaceViewStore:d,transaction:c}),m=U.LQ({environment:t,targetParentStore:i,targetStore:o,droppedDirection:a,droppedStores:s,duplicate:l,transaction:c});return m}(e),Z=E.filter((e=>e.isTopLevel()));p&&q.O2({blocks:E,transaction:d});if("workspace"===n)q.lF({environment:t,blocks:Z,transaction:d});else if("private"===n){const e=null==i?void 0:i.getSpaceStore();e&&c.every((n=>n.isTopLevelPrivatePage({environment:t,spaceStore:e})))&&"private"===h||q.Y5({environment:t,blocks:Z,transaction:d})}const N=u&&o!==x.vh.Onto;N&&$._w({environment:t,blocks:c,transaction:d});return!0}({...e,transaction:t,shouldClearPagePermissions:y,shouldUpdateToManualSort:b});return{moved:n}}});k&&V.wS({environment:o,movedItems:i,previousParentIds:S,moveToLocation:(0,f.vz)({targetStore:d,droppedDirection:s,outlinerSectionType:c,environment:o})})}function oe(e){let{targetStore:t,targetParentStore:n}=e;if(t)return t;const{id:o,table:r}=n;let i;switch(r){case"space":case"space_view":i={type:"space",id:o};break;case"block":i={type:"page",id:o};break;case"team":i={type:"team",id:o};break;default:throw new Error("Unexpected table type")}return(0,f.uw)(i)}async function re(e){const{droppedStores:t,duplicate:n}=e.dropArgs,{environment:o,type:r,isTopLevel:i,parentStore:a}=e,s=x.vh.Below;return!!a&&(await ne({environment:o,type:r,targetParentStore:a,isTopLevelItem:i,droppedDirection:s,droppedStores:t,duplicate:n}),!0)}function ie(e){const{environment:t,store:n,parentStore:o,insertStores:r,transaction:i,before:a,type:s}=e,{currentSpaceViewStore:l,currentSpaceStore:d}=w.default.state,u=c.d9(r).reverse();"private"===s&&d&&l&&H.OQ({environment:t,spaceStore:d,spaceViewStore:l,transaction:i});const p=a?r.map((e=>Z.Vt({parentStore:o,insertStore:e,beforeStore:n,transaction:i}).childStore)):u.map((e=>Z.BE({parentStore:o,insertStore:e,afterStore:n,transaction:i}).childStore)),m=p.filter((e=>e.isTopLevel()));return"workspace"===s?q.lF({environment:t,blocks:m,transaction:i}):"private"===s&&q.Y5({environment:t,blocks:m,transaction:i}),p}function ae(e){const{environment:t,spaceViewStore:n,type:o,outlinerToggleButtonStore:r,newIsHidden:a,shouldPersistToggleState:s}=e;r.setState({...r.state,isHidden:a}),B.VS(t,{is_toggled:!a,outliner_type:o}),s&&i.Z.set({userId:n.environment.currentUser.id,key:(0,k.Fl)(n,o),value:a}),(0,R.tourIsActiveInSidebarStep)(R.default.state)&&a&&R.default.setState({type:"inactive"})}function se(e){const{type:t,targetStore:n,targetParentStore:o,transaction:r,isTopLevelItem:i}=e,a=(0,y.bq)()&&"team"===t&&o.table===s.e0&&i;if(Z.Od({childToRemoveStore:n,parentStore:o,transaction:r}),a&&n.getParentId()===o.id){const t=C.zX.createChildStore(e.targetParentStore,{...e.targetParentStore.pointer,table:s.e0});G.sp({teamStore:t,store:n,transaction:r})}}function le(e){let{type:t,droppedDirection:n,isTopLevelItem:o}=e;return"shared"===t&&n!==x.vh.Onto&&o}},365889:(e,t,n)=>{function o(e){const{key:t,overlayContainerStore:n}=e;n.state.overlays.has(t)||(n.state.overlays.add(t),n.emit())}function r(e){const{key:t,overlayContainerStore:n}=e;n.state.overlays.has(t)&&(n.state.overlays.delete(t),n.emit())}n.d(t,{I:()=>o,O:()=>r})},472711:(e,t,n)=>{n.d(t,{Y_:()=>A,bo:()=>D,hc:()=>P,og:()=>E,ru:()=>R,tk:()=>B});n(21703);var o=n(701302),r=n(541432),i=n(421202),a=n(606287),s=n(213493),l=n(653965),c=n(275754),d=n(110906),u=n(484210),p=n(212534),m=n(741195),g=n(639500),f=n(889014),h=n(58202),v=n(80444),y=n(594896),b=n(206258),_=n(226664),S=n(417963),k=n(352229),w=n(496802),x=n(594419),I=n(709953),C=n(608055),T=n(429373),M=n(210228);function P(e){const{environment:t,store:n,targetStore:o,transaction:r}=e,i=n.getParentBlockStore();if(i){const e=i.getContentStore(),a=k.k({environment:t,parentBlockStore:i,targetStore:o,transaction:r});return x.rS({parentStore:e,oldChildStore:n,newChildStore:a,transaction:r}).childStore}throw new Error("Could not create alias block.")}function A(e){const{environment:t,store:n,collectionStore:l,collectionViewStore:c,transaction:u}=e,{id:p}=t.currentUser,g=n.getRecordStoreUIParent();if(null!=g&&g.valueIs(_.i)){if(!n.isDefined())throw new Error("Block to replace was not defined.");if(g&&p){var v,y;if(g.pointer.spaceId&&n.getSpaceId()&&g.pointer.spaceId!==n.getSpaceId())throw new Error("The parent has a different spaceId than the store.");const e=g.pointer.spaceId||n.getSpaceId(),p=(0,m.TS)({environment:t,table:i.iU,spaceId:e}),_=null===(v=(0,d.Vv)(l))||void 0===v?void 0:v.getFormatStore().getKeyStore("table_properties").getValue(),S=null===(y=(0,d.Vv)(l))||void 0===y||null===(y=y.getQueryStore())||void 0===y?void 0:y.getKeyStore("sort").getValue(),k={id:(0,m.TS)({environment:t,table:s.np,spaceId:n.getSpaceId()}),version:0,type:"table",parent_id:p,parent_table:"block",alive:!0,space_id:n.getSpaceId(),format:{table_properties:_,collection_pointer:{table:a.vF,id:l.id,spaceId:l.pointer.spaceId}},query2:{sort:S}};I.ae({environment:t,table:"collection_view",value:k,inMemoryRecordCache:n.inMemoryRecordCache,transaction:u});const w=I.j4({environment:t,id:p,type:r.Ti.collectionView,spaceId:n.getSpaceId(),useCrdt:n.useCrdt(),inMemoryRecordCache:n.inMemoryRecordCache,transaction:u});I.sW({store:w,data:{view_ids:[k.id]},transaction:u});const C=x.rS({parentStore:g,oldChildStore:n,newChildStore:b.G.createChildStore(g,{table:i.iU,id:p}),transaction:u}).childStore;return(0,f.u)(k.id,{viewPointer:null==c?void 0:c.pointer}),o.default.afterNextFlush((()=>{const e=h.R.findBlockFromStoreWithMethod(C,"handleCreated");e&&e.handleCreated()})),C}}}function R(e){const{environment:t,blocks:n,openInNew:o,pageVisitSource:r}=e,i=n[0];if(o){const e=(0,u.ZP)({store:i,pageVisitSource:r});C.c4({environment:t,url:e,openInNew:o})}else{const e=i.recordStoreUIParentStore instanceof b.G&&i.recordStoreUIParentStore.isCollectionView(),{mainEditorCurrentBlockStore:n}=v.default.state;if(e&&n){const e=(0,u.ZP)({store:n,fullyQualified:!1,peekViewBlockId:i.id,pageVisitSource:r});C.c4({environment:t,url:e})}else c._c({environment:t,store:i,pageVisitSource:r})}}function D(e){const{environment:t,store:n,lock:o}=e,{id:r}=t.currentUser;if(!r)return;const i={block_locked:o,block_locked_by:r};M.createAndCommit({userAction:"pageBlockActions.setPageLock",environment:t,perform:e=>{I.sW({store:n.getFormatStore(),data:i,transaction:e})}})}function B(e){const{transaction:t,store:n,coverStore:o,pageCovers:r}=e,i=Object.keys(r),a=r[i[l.MX(0,i.length-1)]],s=a.items[l.MX(0,a.items.length-1)],c=s.coverUrl,d=s.position;I.sO({store:o,value:c,transaction:t}),w.Mp({store:n,coverPosition:d,transaction:t})}function E(e,t,n){(0,p.ZP)({event:e,context:p.Af.EditorClick,callback:()=>function(e,t){const n=Boolean(S.Z.state.pageMap[e.id])||y.Z.state.pages.has(e.id);!e.canEdit()||e.isNonEditableState()||n||(0,g.X9)()||M.createAndCommit({userAction:"PageViewBlock.handlePlaceholderClick",environment:t,perform:n=>{T.ls({environment:t,store:e,transaction:n})}})}(t,n)})}},325320:(e,t,n)=>{n.d(t,{Ri:()=>b,UX:()=>y,s4:()=>v});var o=n(150475),r=n(421202),i=n(670017),a=n(989470),s=n(23867),l=n(653965),c=n(401898),d=n(367669),u=n(165598),p=n(80444),m=n(453730),g=n(206258),f=n(21359);const h=32,v=100;async function y(e,t){await p.default.waitUntilRendered();const{fromPageRefresh:n,blockStore:l,pageVisitStore:c,timestamp:h}=t,v=e.currentUser.id;if(void 0===v||n)return;t.blockStore.id!==c.state.pageId&&c.setState({...c.getInitialState(),pageId:t.blockStore.id});const y=(0,g.Kv)(l,{table:a.UI,id:(0,a.Pv)({parent_id:l.id,user_id:v}),spaceId:(0,s.C)(l.pointer.spaceId)}),b=(0,g.Kv)(l,{table:i.Kk,id:(0,a.Pv)({parent_id:l.id,user_id:v}),spaceId:(0,s.C)(l.pointer.spaceId)});if(await m.transactionQueue.awaitRecordTransaction({table:r.iU,id:l.id}),await(0,u.M1)(l),!l.canRead()||(0,d.IJ)(e,l))return;await y.load(),await b.load();const S=y.getKeyStore("visited_at").getValue(),k=b.getKeyStore("exited_at").getValue(),w=await async function(e,t,n,r){const{id:i}=e.currentUser,a=t.id,s=t.getSystemBlockTypeStore().getValue();if((0,o.EW)(s))return{type:"skipped"};var l;i&&(null==e||null===(l=e.mobileNative)||void 0===l||l.recordPageVisit(i,{blockId:a,spaceId:n,visitedAt:r}));const c=await f.recordPageVisit(e,{block:{id:a,spaceId:n},timestamp:r});return c}(e,l,(0,s.C)(l.pointer.spaceId),h);if("skipped"===w.type)return;if("failed"===w.type)return;const x=_({pageVisits:w.data.pageVisits,currentState:c.state,blockStore:l});c.state.pageId===l.id&&c.setState({...x,lastViewTime:S,lastExitTime:k})}async function b(e,t){await p.default.waitUntilRendered();const n=e.currentUser.id;if(void 0===n)return;const{blockStore:o,pageVisitStore:r,incremental:i}=t,a=t.limit||h;let d;if(i){const{pageId:e,lastViewTime:t,lastExitTime:o,...i}=r.state,a=Object.entries(i).map((e=>{let[t,o]=e;if(n===t)return;const r=o.getVisitedAt();return void 0!==r?r+1:void 0}));d=l.Fp(a.filter(c.$K))}const u=await f.getPageVisitors(e,{block:{id:o.id,spaceId:(0,s.C)(o.pointer.spaceId)},sinceTimestamp:d,limit:a});if("failed"===u.type)return;const m=_({pageVisits:u.data.pageVisits,blockStore:o,currentState:r.state});let g;if(Object.keys(m).length<=v)g=m;else{const{pageId:e,lastViewTime:t,lastExitTime:n,...o}=m,r=(0,c.qP)(o).map((e=>{let[t,n]=e;return[t,n.getVisitedAt()??0]}));g={pageId:e,lastViewTime:void 0,lastExitTime:void 0};const i=l.MR(r,(e=>{let[,t]=e;return-t})).slice(0,v);for(const[a]of i)g[a]=m[a]}r.state.pageId===m.pageId&&r.setState(g)}function _(e){const{blockStore:t,pageVisits:n,currentState:o}=e,r={...o,pageId:t.id};for(const i of n){const{id:e,user_id:n}=i;n in r||(r[n]=g.t1.createChildStore(t,{table:a.UI,id:e,spaceId:(0,s.C)(t.pointer.spaceId)}))}return r}},119785:(e,t,n)=>{n.d(t,{SH:()=>m,hh:()=>c,hr:()=>u,jG:()=>p,nO:()=>d,rS:()=>g,zo:()=>l,zw:()=>s});n(21703);var o=n(45681),r=n(165598),i=n(709953),a=n(210228);function s(e){const{childStore:t,parentStore:n,transaction:o}=e,r=t.getRecordStoreAtRootPath(),i=r.getValue(),s=r.getAssociatedCollectionId();if(i){const{alive:e}=i;if(s!==n.id||!e){const e=n.getParentBlockStore();return e&&e.isCollectionViewPageWithContent()?(p({parentStore:e,childStore:t,transaction:o}),!0):(a.applyOperation({store:n,operation:{pointer:t.pointer,path:[],command:"setParent",args:{parentId:n.id,parentTable:n.table}},transaction:o}),!0)}}return!1}function l(e){const{blockStore:t,transaction:n}=e,r=t.getParentStore();if(r){(0,o.A6)(r.table,t.table)?u({parentStore:r,childStore:t,transaction:n}):c({childStore:t,transaction:n})}}function c(e){const{childStore:t,transaction:n}=e;if((0,r.OY)(t)){const e=t,o=e.getAssociatedCollectionStore();if(null!=o&&o.isPageTreeCollection()){const o=t.getParentBlockStore();o&&u({childStore:e,parentStore:o,transaction:n})}}t.getRecordStoreAtRootPath().getAlive()&&i.sW({store:t,data:{alive:!1},transaction:n})}function d(e){const{pageStore:t,transaction:n}=e;t.getRecordStoreAtRootPath().getAlive()&&i.sW({store:t,data:{alive:!1},transaction:n})}function u(e){const{childStore:t,parentStore:n,transaction:r}=e,i=(0,o.A6)(n.table,t.table);if(!i)throw new Error(`Could not find child path for parent table ${n.table} and child table ${t.table}`);a.applyOperation({store:n,operation:{pointer:n.pointer,path:i,command:"removeChild",args:{id:t.id}},transaction:r})}function p(e){const{childStore:t,parentStore:n,transaction:r}=e,i=(0,o.A6)(n.table,t.table);if(!i)throw new Error(`Could not find child path for parent table ${n.table} and child table ${t.table}`);a.applyOperation({store:n,operation:{pointer:n.pointer,path:i,command:"insertChildrenAfter",args:{ids:[t.id],after:e.after}},transaction:r})}function m(e){const{childStore:t,parentStore:n,transaction:r}=e,i=(0,o.A6)(n.table,t.table);if(!i)throw new Error(`Could not find child path for parent table ${n.table} and child table ${t.table}`);a.applyOperation({store:n,operation:{pointer:n.pointer,path:i,command:"insertChildrenBefore",args:{ids:[t.id],before:e.before}},transaction:r})}function g(e){const{parentStore:t,oldChildStore:n,newChildStore:o,transaction:r}=e,i=n.id;(t.getValue()||[]).indexOf(i)>=0&&(p({parentStore:t,childStore:o,transaction:r,after:i}),u({parentStore:t,childStore:n,transaction:r}))}},419358:(e,t,n)=>{n.d(t,{D0:()=>h,If:()=>v,YM:()=>f});n(757658);var o=n(673360),r=n(718844),i=n(421202),a=n(606287),s=n(870279),l=n(91644),c=n(475246),d=n(577858),u=n(429369),p=n(766079),m=n(27105),g=n(709953);function f(e){const{childStore:t,parentStore:n,transaction:o}=e,r=t.getRecordStoreAtRootPath().getValue();if(r){const{parent_id:i,parent_table:a,alive:s}=r;i===n.id&&a===n.table&&s===e.alive||(g.sW({store:t,data:{parent_id:n.id,parent_table:n.table,alive:e.alive},transaction:o}),o.postPerformAssertions.push((()=>{(0,m.be)({parentStore:n,childStore:t})})))}}function h(e){if((0,o.hL)(e.childStore.table)){const t=e.childStore;return function(e){const{childStore:t,parentStore:n,transaction:o}=e,m=t.getRecordStoreUIParent();if(n.table===c.bx&&t.table===i.iU||n.table===u.e0&&t.table===i.iU||n.table===p.dx&&t.table===d.zU||n.table===r.Xj&&t.table===i.iU||n.table===l.AT&&t.table===i.iU)f({childStore:t,parentStore:n,alive:!0,transaction:o});else if(n.table===d.zU&&n.path&&"private_pages"===n.path[0]&&t.table===i.iU){const e=n.getRecordStoreUIParent().getSpaceStore();e&&f({childStore:t,parentStore:e,alive:!0,transaction:o})}else n.table===i.iU&&m&&m.table===d.zU&&m.path&&"private_pages"===m.path[0]?f({childStore:t,parentStore:n,alive:!0,transaction:o}):n.table!==i.iU&&n.table!==a.vF&&n.table!==s.x_||f({childStore:t,parentStore:n,alive:!0,transaction:o})}({...e,childStore:t})}{const{childStore:t,parentStore:n,transaction:o}=e,{parent_id:r,parent_table:i}=t.getValue()||{};r===n.id&&i===n.table||g.sW({store:t,data:{parent_id:n.id,parent_table:n.table},transaction:o})}}function v(e){const{childStore:t,parentStore:n,transaction:o}=e,{parent_id:r,parent_table:i,alive:a}=t.getValue()||{},s=n.table===d.zU&&n.path&&"private_pages"===n.path[0]&&a,l=r===n.id&&i===n.table&&a;(s||l)&&g.sW({store:t,data:{alive:!1},transaction:o})}},587420:(e,t,n)=>{n.d(t,{Af:()=>M,E5:()=>A,ME:()=>B,Xd:()=>E,bA:()=>T,jG:()=>P,xv:()=>D});n(757658);var o=n(815145),r=n(570096),i=n(89101),a=n(559183),s=n(874051),l=n(721429),c=n(484210),d=n(823376),u=n(116746),p=n(74948),m=n(938676),g=n(80444),f=n(222294),h=n(188923),v=n(186486),y=n(27724),b=n(924666),_=n(250906),S=n(492973),k=n(594419),w=n(132953),x=n(608055),I=n(210228),C=n(239865);function T(e,t){const{mode:n}=t,o=e.WindowSizeStore.state.width,i=h.default.state.preferredSidePeekWidth||o/2;h.default.setState({...h.default.state,open:!0,preferredSidePeekWidth:Math.min(i,o*(2/3)),isOpening:!0,isClosing:!1,...t}),n===r.R&&p.toggleLeftSidebarByWindowSize(e),u.default.isVisible()&&d.TN({environment:e,autoClose:!0})}function M(e){const{resultsStore:t,collectionContextStore:n,pageVisitSource:o}=e;null==n||n.searchOpenStore.setState(!1),h.default.setState({...h.default.state,resultsStore:t,collectionContextStore:n,pageVisitSource:o})}function P(e){(h.default.isSidePeekOpen()||h.default.isCenterPeekOpen())&&R(e)}function A(e){h.default.isSidePeekOpen()&&R(e)}function R(e){l.kw.state&&!f.Z.state.isKeyboardMode||v.default.state.isOpen&&v.default.state.menuIsOpen||y.default.isSelected()||b.default.hasSelection()||D(e,"empty_space_click")}function D(e,t,n){const r=h.default.state;if(!r.open||r.isClosing)return;h.default.isSidePeekOpen()&&h.default.setState({...r,isClosing:!0});const{mode:s,targetStore:l,showMoveTo:d,collectionContextStore:u,savedSelectionStoreState:p,savedTableSelectionStoreState:f,savedSidebarExpandedStoreState:v}=r,b=l.getContentStores(),T=1===b.length?b[0]:void 0,M=T&&T.isEmptyEditableBlock(),P=d&&l.isEmptyTitle()&&(l.isEmptyPage()||M);I.createAndCommit({userAction:"PeekRenderer.close",environment:e,perform:t=>{P?(C.y8({environment:e,blocks:[r.targetStore],transaction:t}),t.postSubmitCallbacks.push((t=>{t||_.dh(e,{analyticsName:"delete",from:"peek_actions",block_id:l.id,block_type:"page"})}))):M&&k.Od({parentStore:l.getContentStore(),childToRemoveStore:T,transaction:t})}}),t&&"side_peek"===s&&S.vc(e,{from:t}),S.$C(e,{peek_mode:s,from:t,target_page_id:l.id,target_parent_id:l.getParentId(),page_source:n,should_delete:P}),w.jC(e,s),w.LU(e),w.rM(e),y.default.setState({...y.default.state,...p}),f.isActive&&a.Z.setState(f),v&&m.sidebarExpandedStore.setState(!0);const{mainEditorCurrentBlockStore:A}=g.default.state,{RouterStore:R}=e,D=R.state.route;if(null!=u&&u.searchQueryStore.state&&(null==u||u.searchOpenStore.setState(!0)),A&&"page"===D.name){const t=(0,c.ZP)({store:A,fullyQualified:!1,scrollToBlockId:D.scrollToBlockId,collectionViewId:D.collectionViewId,discussionId:D.discussionId,showMoveTo:D.showMoveTo,saveParent:D.saveParent,pageVisitSource:o.tY.PeekClose});x.c4({environment:e,url:t})}else"chat"===D.name?x.c4({environment:e,url:i._j.chat}):"marketplace"!==D.name&&"gallery"!==D.name||x.c4({environment:e,url:i._j.gallery})}function B(){const e=h.default.state;e.open&&!e.isClosing&&h.default.setState({...e,open:!1,resultsStore:void 0,collectionContextStore:void 0})}function E(e){const{collectionContextStore:t,resultsStore:n}=e;(0,s.Y)(t)||M({collectionContextStore:t,resultsStore:n,pageVisitSource:void 0})}},476464:(e,t,n)=>{n.d(t,{$G:()=>re,GQ:()=>he,Kh:()=>ue,MX:()=>ce,Pk:()=>le,hs:()=>de,l3:()=>oe,n_:()=>ge,pk:()=>ve,tQ:()=>ne,u9:()=>ye});n(757658);var o=n(701302),r=n(266897),i=n(159730),a=n(471924),s=n(924211),l=n(463306),c=n(186517),d=n(772141),u=n(291627),p=n(177420),m=n(584683),g=n(475246),f=n(665635),h=n(947969),v=n(429369),y=n(519889),b=n(994044),_=n(709291),S=n(657347),k=n(653965),w=n(401898),x=n(215010),I=n(833954),C=n(433929),T=n(798165),M=n(367669),P=n(75472),A=n(165598),R=n(548779),D=n(195697),B=n(883165),E=n(318245),F=n(918402),Z=n(361673),U=n(28578),V=n(80444),N=n(385555),O=n(281236),L=n(206258),j=n(897630),K=n(535057),z=n(288280),q=n(109867),H=n(250906),G=n(891219),W=n(91536),$=n(781918),Y=n(117224),Q=n(21359),J=n(547307),X=n(709953),ee=n(210228);const te=(0,_.defineMessages)({preventFullPageAccessDeletion:{id:"permissionsActions.preventRemovingAllFullAccess.message",defaultMessage:"Please give someone else Full Access before removing this permission."},preventUserOrGroupDeletion:{id:"permissionsActions.preventUserOrGroupDeletion.message",defaultMessage:"At least one person or group must have access."},confirmUpgradeMessage:{defaultMessage:"To add members to your workspace, you need to switch it to the Team plan. You will be charged a prorated amount based on your current billing interval and account balance.",id:"permissions.confirmDialog.upgradeToTeamWorkspace.message"},confirmUpgradeButtonLabel:{defaultMessage:"Upgrade to Team workspace",id:"permissions.confirmDialog.upgradeToTeamWorkspace.confirmButton.label"}});function ne(e){const{environment:t,spaceStore:n,permissionItems:o,transaction:r,from:i,skipAnalytics:a,pagePermissionChangeLocation:s}=e;if(!n.isDefined())return!1;const l=o.filter(d.jg).map((e=>(0,h.Po)(e,n.id))),c=o.filter((e=>(0,d.FB)(e))).map((e=>(0,f.IK)(e,n.id)));a||(l.forEach((e=>{W.dq({environment:t,spaceUser:e,from:i})})),c.forEach((e=>{W.ME({environment:t,spaceBot:e,from:i})})));for(const d of l)ee.applyOperation({store:(0,B.VK)(n,d.user_id),operation:{pointer:{table:h.WU,id:d.id,spaceId:d.space_id},command:"update",path:[],args:d},transaction:r});for(const d of c)ee.applyOperation({store:(0,B.Wz)(n,d.bot_id),operation:{pointer:{table:f.Zx,id:d.id,spaceId:d.space_id},command:"update",path:[],args:d},transaction:r});return r.postSubmitCallbacks.push((async n=>{W.NL(t,{status:Boolean(n)?"fail":"success",location:s}),n||await j.bi(t),e.metric&&E.default.DO_NOT_USE_measureLegacy(e.metric,{environment:t})})),!0}function oe(e){return ie(e)}function re(e){return ie(e)}function ie(e){const{environment:t,store:n,permissionItems:r,transaction:i,skipAnalytics:a,pagePermissionChangeLocation:s,fromPermissionWrapper:l,skipGuestLimitValidation:u,flowId:p}=e;if(!u){if((0,M.SO)(e))return!1}if(!n.isDefined())return!1;const m=n.getPermissionItems();let f=[...m];const{id:v}=t.currentUser,y=n instanceof L.G&&n.getParentTable()===g.bx,b=n instanceof L.G&&(y||n.isRestricted());a||(n instanceof L.G?W.kM({environment:t,store:n,newItems:r,location:s,inSudoMode:i.useSudoMode,fromPermissionWrapper:l,flowId:p}):r.forEach((e=>{n instanceof L.zX?W.gR(t,{item:e,teamStore:n}):(0,w.t1)(n)}))),f=f.filter((e=>!r.some((t=>c.Kf(e,t)))));for(const o of r)f.push(o);f=f.filter((e=>"none"!==d.cY(e)));const _=Boolean(r.find((e=>"user_permission"===e.type&&e.user_id===v&&!d.zz(e.role))));if(n instanceof L.G&&b&&v){const e=T.Pj(n),t=e?e.getPermissionGroups():[],o=Boolean(f.find((e=>"user_permission"===e.type&&d.zz(e.role)&&e.user_id===v))),a=T.VP(n),s=null==a?void 0:a.isOwner(v),l=null==a?void 0:a.isNonGuestMember(v),c=e?(0,h.v8)({userId:v,spaceId:e.id}):void 0,u=c?n.getRecordModel(c):void 0,p=Boolean(null==u?void 0:u.isMember()),m=r.find((e=>"space_permission"===e.type&&d.zz(e.role))),g=r.find((e=>"space_permission"===e.type&&d.YX(e.role))),y=r.find((e=>"space_permission"===e.type&&!d.YX(e.role))),b=f.find((e=>Boolean("group_permission"===e.type&&d.zz(e.role)&&t.find((t=>Boolean(t.id===e.group_id&&t.user_ids&&t.user_ids.indexOf(v)>=0)))))),S=(0,D.bq)();if(e&&e.canEdit()&&!S){const t=e.getPagesStore();g?ee.applyOperation({transaction:i,store:t,operation:{pointer:t.pointer,path:t.path,command:"listAfter",args:{id:n.id}}}):y&&ee.applyOperation({transaction:i,store:t,operation:{pointer:t.pointer,path:t.path,command:"listRemove",args:{id:n.id}}})}if(!S&&o&&p&&(m||b)&&(f=f.filter((e=>!("user_permission"===e.type&&e.user_id===v)))),!_){f.some((e=>!("space_permission"!==e.type||!d.zz(e.role)||!p)||(!("user_permission"!==e.type||!d.zz(e.role)||e.user_id!==v)||(!("group_permission"!==e.type||!d.zz(e.role)||!t.find((t=>Boolean(t.id===e.group_id&&t.user_ids&&t.user_ids.indexOf(v)>=0))))||(!!((0,d.zU)(e)&&d.zz(e.role)&&(null==a?void 0:a.id)===e.team_id&&l)||!!((0,d.LW)(e)&&d.zz(e.role)&&(null==a?void 0:a.id)===e.team_id&&s))))))||i.useSudoMode||(f=f.filter((e=>!("user_permission"===e.type&&e.user_id===v))),f.push({type:"user_permission",user_id:v,role:"editor"}))}}if(!f.some((e=>{const t=d.cY(e);return d.zz(t)}))&&b)return o.default.afterNextFlush((()=>{J.showErrorMessage(C.default.formatMessage(te.preventFullPageAccessDeletion))})),!1;const S=f.some((e=>(d.jg(e)||d.hV(e))&&"editor"===e.role));if((0,D.bq)()&&y&&!S)return o.default.afterNextFlush((()=>{J.showErrorMessage(C.default.formatMessage(te.preventUserOrGroupDeletion))})),!1;const x=(0,L.Vh)(n,n.pointer,"permissions"),I=[];for(const o of m){!f.find((e=>c.Kf(o,e)))&&d.C2(o)&&I.push({...o,role:"none"})}for(const o of f){const e=m.find((e=>c.Kf(o,e)));!d.C2(o)||e&&k.Xy(e,o)||I.push(o)}let P=[];const A=T.Om(n);if(n instanceof L.G&&!n.isRestricted()&&A&&A instanceof L.G){const e=(0,M.YO)(A);P=I.map((t=>e.find((e=>k.Xy(e.permissionItem,t)))?{...t,role:"none"}:t))}else P=I;for(const o of P)ee.applyOperation({store:x,operation:{pointer:x.pointer,command:"setPermissionItem",path:x.path,args:o},transaction:i});return i.postSubmitCallbacks.push((async n=>{W.NL(t,{status:Boolean(n)?"fail":"success",location:s}),n||await j.bi(t),e.metric&&E.default.DO_NOT_USE_measureLegacy(e.metric,{environment:t})})),!0}function ae(e){var t;const{environment:n,store:o,permissionItems:r,transaction:i,inviteFlowId:a,inviteMessage:s,inviteOrigin:l,disable_invite_email:c}=e,d=null===(t=V.default.state.currentSpaceStore)||void 0===t?void 0:t.id,{id:u}=n.currentUser;for(const p of r)if(d&&"user_permission"===p.type&&p.invite_id){const{inviteeId:e,inviteeTable:t}=se({item:p,spaceId:d}),n={id:p.invite_id,version:1,flow_id:a,space_id:d,target_id:o.id,target_table:o.table,inviter_id:u,inviter_table:y.KJ,invitee_id:e,invitee_table_or_group:t,message:s,created_time:Date.now(),attributes:{permission:p,origin_type:l,disable_invite_email:c}};X.sW({store:(0,L.Kv)(o,{table:"invite",id:n.id,spaceId:d}),data:n,transaction:i})}return i.postSubmitCallbacks.push((e=>{G.bR(n,{status:Boolean(e)?"fail":"success",origin:l})})),!0}function se(e){const{item:t,spaceId:n}=e;return d.jg(t)?{inviteeId:t.user_id,inviteeTable:y.KJ}:d.FB(t)?{inviteeId:t.bot_id,inviteeTable:p.cZ}:d.hV(t)?{inviteeId:t.group_id,inviteeTable:m._e}:d.Ir(t)?{inviteeId:n,inviteeTable:g.bx}:d.zU(t)?{inviteeId:t.team_id,inviteeTable:v.e0}:{}}function le(e){const{environment:t,store:n,permissionItem:o,transaction:i,shouldInherit:a,fromPermissionWrapper:s}=e;if(!n.isDefined())return;const p=[];if(a){const e=(0,M.YO)(n).map((e=>e.permissionItem)).filter((e=>!c.Kf(e,o)));for(const t of e)d.C2(t)&&(n.isCollectionView()||d.FB(t)||"content_only_editor"!==t.role?p.push(t):p.push({...t,role:"read_and_write"}))}const m=t.currentUser.id,g=m?{table:y.KJ,id:m}:void 0,f=void 0===g?void 0:n.getRecordModel(g),h=f&&(0,r.dp)(f),v=l.DW(n.pointer,n.getRecordModel),b=(0,F.bi)({actorPointers:new u.X(void 0===g?[]:[g]),recordPointers:new u.X([n.pointer]),getRecordModel:n.getRecordModel});!m||(0,F.ZO)({actor:h,ancestors:v,updatedPermissionItem:o,permissionsContext:b})||i.useSudoMode||p.push({type:"user_permission",user_id:m,role:"editor"}),p.push(o);const _=n.getPermissionItemsStore();W.kM({environment:t,store:n,newItems:[o],fromPermissionWrapper:s});for(const r of p)ee.applyOperation({store:_,operation:{pointer:_.pointer,command:"setPermissionItem",path:_.path,args:r},transaction:i});ee.applyOperation({store:_,operation:{pointer:_.pointer,command:"setSingletonPermissionItem",path:_.path,args:{singletonPermissionItem:{type:"restricted_permission"},set:!0}},transaction:i}),H.gl(t,{type:"none"===o.role?"remove":"narrow"}),i.postSubmitCallbacks.push((e=>{e||j.bi(t)}))}function ce(e){const{environment:t,store:n,transaction:o,from:r,shareMenuSessionId:i}=e;if(!n.isDefined())return;const a=n.getPermissionItems(),s=T.Om(n),l=s?c.Wo(T.fJ(s)):[],d=c.Ub(n.getModel(),a,l),u=n.getPermissionItemsStore();for(const c of d)ee.applyOperation({store:u,operation:c,transaction:o});H.TJ(t,{using_admin_api:!1,from:r,share_menu_session_id:i}),o.postSubmitCallbacks.push((e=>{e||j.bi(t)}))}async function de(e){const{environment:t,store:n,from:o,shareMenuSessionId:r}=e,{currentSpaceStore:i}=V.default.state;if(i){const e=i.id,a=n.id,s=await Q.spaceAdminRestoreAccess(t,{spaceId:e,blockId:a});H.TJ(t,{using_admin_api:!0,from:o,share_menu_session_id:r}),"failed"===s.type&&J.showError(s)}}function ue(e){const{environment:t,store:n,transaction:o}=e,r=n.getPermissionItems();if(!n.isTopLevelTeamPage()||0===r.length)return;const i=r.filter((e=>d.FB(e)));X.sW({store:n,transaction:o,data:{permissions:i}}),Y.FN(t,{store:T.VP(n)})}function pe(e){const t=e.inviteTargets[0];return!(!t||"bot"!==t.type)}function me(e){return d.jg(e.permissionItem)&&(0,P.OA)(e.inviteTarget)}async function ge(e){const{environment:t,isOnboarding:n,invite:o}=e;if(0===e.inviteTargets.length)return{success:!0,invitedUsers:{},requestedUsers:{}};const r=z.subscriptionDataStoreInstance.state;let i;if(pe(e))if((0,A.Mm)(e.store)){const t=e.inviteRole;i=e.inviteTargets.map((e=>({inviteTarget:e,permissionItem:{type:"bot_permission",role:t,bot_id:e.value.id}})))}else(0,A.OY)(e.store)?i=e.inviteTargets.map((e=>({inviteTarget:e,permissionItem:{type:"bot_permission",role:c.uH(e.value.capabilities),bot_id:e.value.id,parent_table:e.value.parent_table,parent_id:e.value.parent_id}}))):(0,w.t1)(e.store);else i=await async function(e){const{environment:t,inviteTargets:n,inviteRole:o}=e;return Promise.all(n.map((async n=>{if("newUser"===n.type){const e=await fe(t,n),r={type:"user_permission",role:o,user_id:e};return{inviteTarget:{...n,value:{...n.value,id:e}},permissionItem:r}}if("existingUser"===n.type){return{inviteTarget:n,permissionItem:{type:"user_permission",role:e.inviteRole,user_id:n.value.id}}}if("group"===n.type){return{inviteTarget:n,permissionItem:{type:"group_permission",role:e.inviteRole,group_id:n.value.id}}}(0,w.t1)(n)})))}({environment:t,inviteTargets:e.inviteTargets,inviteRole:e.inviteRole,data:r});const{toInvite:s,toRequest:l}=function(e,t){if(!((0,R.Q6)(V.default.state.currentSpaceStore)&&e instanceof L.G))return{toInvite:t,toRequest:[]};const n=[],o=[];for(const r of t)me(r)?n.push(r):o.push(r);return{toInvite:o,toRequest:n}}(e.store,i),u={};if(e.store instanceof L.G&&l.length>0){const n=await async function(e){const{environment:t,permissionItems:n,inviteMessage:o,store:r}=e,i=await Promise.allSettled(n.map((async e=>Q.requestAccess(t,{type:"guest-invite-request",block:{id:r.id,spaceId:r.getSpaceId()},forActorId:e.user_id,message:void 0,attributes:{role:e.role,inviteMessage:o}}))));return!i.find((e=>"rejected"===e.status||"fulfilled"===e.status&&"failed"===e.value.type))}({environment:t,store:e.store,permissionItems:l.map((e=>e.permissionItem)),inviteMessage:o.inviteMessage});if(!n)return{success:!1};for(const e of l)u[e.inviteTarget.value.email]=e.permissionItem.user_id}if(0===s.length)return{success:!0,invitedUsers:{},requestedUsers:u};const p=s.map((e=>e.inviteTarget)),m=s.map((e=>e.permissionItem));let g,f;if(e.store instanceof L.G&&void 0!==(0,K.c4)(r))g=await async function(e){const{environment:t,store:n,permissionItems:o,invite:r}=e,i=n.getSpaceId();if(!i)return!1;const s=O.Z.getData(t,{spaceId:i});if(!s)return!1;const l=o.filter(d.jg).map((e=>({...e,invite_id:a.Il()}))),c=await Q.inviteGuestsToSpace(t,{block:{id:n.id,spaceId:i},permissionItems:l});if("failed"===c.type)return!1;const{serverCommitResult:u}=ee.createAndCommit({userAction:"permissionsActions.saveInvites",environment:t,perform:e=>{const{inviteFlowId:o,inviteMessage:i,inviteOrigin:a,disable_invite_email:s}=r;ae({environment:t,store:n,permissionItems:l,transaction:e,inviteFlowId:o,inviteMessage:(0,b.my)(i),inviteOrigin:a,disable_invite_email:s})}});await u;const p=o.filter(d.FB);p.length>0&&await ve({environment:t,store:n,permissionItems:p,invite:r});return!0}({environment:t,store:e.store,permissionItems:m,invite:o});else try{await ve({environment:t,store:e.store,sudoModeStore:e.sudoModeStore,permissionItems:m,invite:o}),g=!0}catch(k){g=!1,f=(0,S.t)(k)}if(!pe(e)){var h;const n=e.store instanceof L.G?null===(h=e.store.getCollectionViewCollectionStore())||void 0===h?void 0:h.id:void 0,r=e.store instanceof L.G?e.store.getParentCollectionIdUpToTwoLevels():void 0;var v,y;if(g)G.jB(t,{role:e.inviteRole,is_space:e.store instanceof L.H2,invite_targets:p,is_onboarding:e.isOnboarding,invite_origin:o.inviteOrigin,permission_items:m,invite_message_length:(null===(v=o.inviteMessage)||void 0===v?void 0:v.length)??0,invite_flow_id:o.inviteFlowId,isProfessionalTeamUser:(0,x.QZ)(),domainType:(0,x.JF)(),share_menu_session_id:U.ZP.state.sessionId,collection_id:n,parent_collection_id:r}),Z.cP({environment:t,checklistItem:"collaborate"});else G.l5(t,{error:f,role:e.inviteRole,is_space:e.store instanceof L.H2,invite_targets:p,is_onboarding:e.isOnboarding,invite_origin:o.inviteOrigin,permission_items:m,invite_message_length:(null===(y=o.inviteMessage)||void 0===y?void 0:y.length)??0,invite_flow_id:o.inviteFlowId,isProfessionalTeamUser:(0,x.QZ)(),domainType:(0,x.JF)(),share_menu_session_id:U.ZP.state.sessionId,collection_id:n,parent_collection_id:r})}n||await j.bi(t);const _={};return p.forEach(((e,t)=>{var n;const o=m[t];"newUser"!==e.type&&"existingUser"!==e.type||null===(n=e.value)||void 0===n||!n.email||"user_permission"!==o.type||(_[e.value.email]=o.user_id)})),{success:g,error:f,invitedUsers:_,requestedUsers:u}}async function fe(e,t){const n=(0,s.E2)(C.default.getIntl()),o=t.value.email,r=await Q.createEmailUser(e,{email:o,preferredLocaleOrigin:"inferred_from_inviter",preferredLocale:n});if("failed"===r.type){if((0,i.Jx)(r.error)){const e=(0,I.nX)(C.default.getIntl(),r.error);e?J.showErrorMessage(e):J.deprecatedShowErrorMessage(r.error.message)}else J.deprecatedShowErrorMessage(r.error.message);throw r.error}return r.data.userId}async function he(e){let{environment:t,store:n,inviteTargets:o,inviteRole:r,createNewTeamFlowId:i}=e;const a=n.getSpaceId(),s=t.currentUser.id;if(0===o.length)return!0;if(!a||!s)return!1;const l=z.subscriptionDataStoreInstance.state,{teamMemberInfos:c,invitedMemberIds:d}=await async function(e){const{environment:t,inviteTargets:n,inviteRole:o}=e,r=[],i=[];for(const a of n){let e;if("newUser"===a.type){const n=await fe(t,a);e={entity_type:"user",type:o,user_id:n},r.push(n)}else"existingUser"===a.type?(e={entity_type:"user",type:o,user_id:a.value.id},"none"!==a.spaceRole&&"not_in_space"!==a.spaceRole||r.push(a.value.id)):"group"===a.type?e={entity_type:"group",type:N.default.checkGate({gateName:"allow_groups_as_team_owners"})&&"owner"===o?"owner":"member",group_id:a.value.id}:(0,w.t1)(a);i.push(e)}return{teamMemberInfos:i,invitedMemberIds:r}}({environment:t,inviteTargets:o,inviteRole:r,data:l}),u=await q.Uj({environment:t,teamMemberInfos:c,teamStore:n,isSettingDefaultTeam:!1,createNewTeamFlowId:i});return u&&($.Jk(t,{invite_origin:"team_invite_overlay",domainType:(0,x.JF)(),new_workspace_member_count:d.length,new_workspace_member_ids:d}),await j.bi(t)),u}async function ve(e){const{environment:t,store:n,sudoModeStore:o,permissionItems:r,invite:i,skipGuestLimitValidation:s}=e,{serverCommitResult:l}=ee.createAndCommit({userAction:"permissionsActions.savePermissionItems",environment:t,useSudoMode:"block"===n.table&&(null==o?void 0:o.shouldSaveTransactionWithSudoMode(n)),perform:e=>{const o=r.map((e=>"user_permission"!==e.type?e:{...e,invite_id:a.Il()})),{inviteFlowId:l,inviteMessage:c,inviteOrigin:d,disable_invite_email:u}=i;ae({environment:t,store:n,permissionItems:o,transaction:e,inviteFlowId:l,inviteMessage:(0,b.my)(c),inviteOrigin:d,disable_invite_email:u}),n instanceof L.H2?ne({environment:t,spaceStore:n,permissionItems:o,transaction:e,from:d}):n instanceof L.zX?re({environment:t,store:n,permissionItems:o,transaction:e,from:d,skipGuestLimitValidation:s}):n instanceof L.G?oe({environment:t,store:n,permissionItems:o,transaction:e,from:d,skipGuestLimitValidation:s}):(0,w.P)(n)}});await l}function ye(e){const{store:t,transaction:n}=e;X.sW({store:t,data:{permissions:null},transaction:n})}},709700:(e,t,n)=>{n.d(t,{m:()=>m});var o=n(787078),r=n(825464),i=n(626765),a=n(960709);const{Top:s,Bottom:l,Left:c,Right:d}=r.u,{Start:u,Center:p}=r.v;function m(e){const{store:t,placementToOrigin:n,alignmentToOrigin:r,popupRect:u,originRect:p,viewportPadding:m,placementFlipped:f,viewportAdditionalBottomPadding:h,disableFlippingPlacement:v}=e,y=(0,o.Z)();let b=i.jn(y,-m||0);0!==h&&(b=new i.iL(b.x,b.y,b.width,b.height-h));const _=g(u,p,n,r),S=Math.max(b.left-_.left,0)+Math.min(b.right-_.right,0),k=Math.max(b.top-_.top,0)+Math.min(b.bottom-_.bottom,0),w=n===c&&Math.abs(S)>0&&i.TF(b,g(u,p,(0,a.FJ)(n),r)),x=n===d&&Math.abs(S)>0&&i.TF(b,g(u,p,(0,a.FJ)(n),r)),I=n===s&&Math.abs(k)>0&&i.kL(b,g(u,p,(0,a.FJ)(n),r)),C=n===l&&Math.abs(k)>0&&i.kL(b,g(u,p,(0,a.FJ)(n),r)),T={placementFlipped:!1,offsetX:0,offsetY:0};if(T.placementFlipped=!v&&(f||w||x||I||C),(!T.placementFlipped||n!==c&&n!==d)&&(T.offsetX=Math.round(S)),(!T.placementFlipped||n!==s&&n!==l)&&(T.offsetY=Math.round(k)),T.placementFlipped)if(n===l){const e=p.top-u.height;b.y>e&&(T.offsetY=Math.round(b.y-e))}else if(n===s){const e=p.bottom+u.height;b.bottom<e&&(T.offsetY=Math.round(b.bottom-e))}t.setState({...t.state,...T})}function g(e,t,n,o){if(n===s||n===l){let r,i;return r=o===u?t.left:o===p?t.left+t.width/2-e.width/2:t.right-e.width,i=n===s?t.top-e.height:t.bottom,new DOMRect(r,i,e.width,e.height)}{let r,i;return r=o===u?t.top:o===p?t.top+t.height/2-e.height/2:t.bottom-e.height,i=n===c?t.left-e.width:t.right,new DOMRect(i,r,e.width,e.height)}}},731304:(e,t,n)=>{n.d(t,{E:()=>C,_:()=>T});var o=n(118466),r=n(568626),i=n(575189),a=n(144615),s=n(841641),l=n(653965),c=n(552629),d=n(619584),u=n(63811),p=n(559183),m=n(95477),g=n(702688),f=n(385555),h=n(85844),v=n(206258),y=n(155320),b=n(27724),_=n(924666),S=n(632441),k=n(21359);const w=1e3,x=1*d.U6,I="presenceActions";function C(e,t,n,o){!function(e,t){const{persistAutoListener:n,rootStore:o,isActive:i,listenerReference:s,userId:l}=e.state;if(i){if(n&&n.destroy(),s&&g.ZP.removeListener(s,t),l&&o&&A({rootStore:o})){const e=(0,a.T0)(o.id);f.default.checkGate({gateName:"log_destroy_presence"})&&r.log({level:"info",from:"presenceActions",type:"destroyPresence",data:{key:e,userId:l}}),g.ZP.updateField(e,l,{present:!1},x,t,{presenceOnDisconnectFlag:"clear",subscriptionId:I,pageVisitId:void 0,spaceId:o.getSpaceId(),pageId:o.id}),g.ZP.clearOnDisconnect(e,I,t).catch((e=>{r.log({level:"error",from:"destroyPresence",type:"SystemError",error:(0,c.Ui)(e)})}))}e.reset()}}(e,t),o&&function(e,t,n){S.Pu(t,{page_id:e.id,searchSessionId:y.default.state.sessionId,spaceId:e.getSpaceId(),pageVisitId:n.getCurrentPageVisitId(),pageVisitDuration:n.getCurrentPageVisitDuration()}),k.recordPageExit(t,{block:{id:e.id,spaceId:e.getSpaceId()},timestamp:Date.now()})}(o,t,n)}async function T(e){const{userId:t,rootStore:n,presenceStore:r,environment:s,pageVisitIdStore:c}=e;if(await n.load(),t&&P({rootStore:n})){r.setState({...r.state,isActive:!0,rootStore:n,userId:t});const e=l.P2((()=>{r&&r.state.isActive&&r.state.rootStore===n&&M(r,s,c)}),w),d=(e,t)=>{r&&r.state.isActive&&r.state.rootStore===n&&function(e,t){const{remotePresenceData:n}=t.state,o=e||{};l.Xy(n,o)||t.setState({...t.state,remotePresenceData:o})}(function(e){const t={};if(l.Kn(e)){const n=Object.keys(e);for(const o of n){const n=e[o];n&&!(0,u.Gu)(i.uP,n)&&(t[o]=n)}}return t}(t),r)},p=(0,a.T0)(n.id);let m;n.canEdit()&&(m=g.ZP.addListener(p,d,void 0,s)),r.setState({...r.state,persistAutoListener:new o.Z({onChange:e}),listenerReference:m}),h.Z.addListener(e),t&&A({rootStore:n})&&await g.ZP.onDisconnect(p,[{operation:"updateField",key:p,field:t,updates:{present:!1},ttl:x},{operation:"logPageExit",userId:t,blockId:n.id,spaceId:n.getSpaceId(),pageVisitId:c.getCurrentPageVisitId()}],I,s),M(r,s,c)}}function M(e,t,n){var o,i;const{persistAutoListener:s,rootStore:l,userId:c}=e.state;if(s&&s.startListener({incrementCycle:!0}),!l||!c||!A({rootStore:l}))return;const u=(0,a.T0)(l.id),m=d.ud(Date.now());if(!l.canEdit()){if(!h.Z.state.isVisible){f.default.checkGate({gateName:"log_destroy_presence"})&&r.log({level:"info",from:"presenceActions",type:"persistActivityPresenceNoEdit",data:{key:u,userId:c}})}return void g.ZP.updateField(u,c,{userId:c,present:h.Z.state.isVisible,activityTimestampNearestMinuteMs:m,blockId:l.id,blockPath:null},x,t,{presenceOnDisconnectFlag:"register",subscriptionId:I,pageVisitId:n.getCurrentPageVisitId(),spaceId:l.getSpaceId(),pageId:l.id})}let y;const S=p.Z.state;S.isActive&&S.currentRowStore&&(y=S.currentRowStore);const k=b.default.state;k.stores.length&&(y=k.stores[0]);const w=_.default.state,C="editing"===w.mode&&w.multiSelection;C&&l.uiContains(C.start.store)&&"block"===C.start.store.table&&(y=C.start.store);const T=null===(o=y)||void 0===o?void 0:o.findRecordStoreUIAncestors((e=>e instanceof v.G)).map((e=>e.id));if(s&&s.stopListener({isEndOfCycle:!0}),!h.Z.state.isVisible){f.default.checkGate({gateName:"log_destroy_presence"})&&r.log({level:"info",from:"presenceActions",type:"persistActivityPresenceEdit",data:{key:u,userId:c}})}g.ZP.updateField(u,c,{userId:c,present:h.Z.state.isVisible,activityTimestampNearestMinuteMs:m,blockId:(null===(i=y)||void 0===i?void 0:i.id)||null,blockPath:T||null},x,t,{presenceOnDisconnectFlag:"register",subscriptionId:I,pageVisitId:n.getCurrentPageVisitId(),spaceId:l.getSpaceId(),pageId:l.id})}function P(e){const{rootStore:t}=e;return Boolean(t)&&(0,s.Z)(t.id)&&t.canRead()}function A(e){const{rootStore:t}=e;return P({rootStore:t})&&!m.default.isAdminMode}},640277:(e,t,n)=>{n.d(t,{th:()=>E,Jv:()=>A,I6:()=>R,Hr:()=>B});n(21703),n(757658);var o=n(568626),r=n(915157),i=n(463306),a=n(186517),s=n(653965),l=n(133728),c=n(959753),d=n(772141),u=n(421202),p=n(606287),m=n(475246);function g(e){const{space:t,actor:n,spaceUser:o,publicAccessRequestExpEnabled:r}=e;return!!f({space:t,user:n,spaceUser:o})||function(e,t){const n=Boolean(e.disable_public_access_requests||e.admin_disable_public_access);return!(!t||!t.getActorUserId()||n)}(t,n)&&r}function f(e){const{space:t,user:n,spaceUser:o}=e;if(!n||!o)return!1;let r=!1;const i=t.getEmailDomains()||[];if(n&&n.email&&i){const e=(0,l.Gd)(n.email);r=s.q9(i,e)}return null!=o&&o.isMember()&&(r=!0),r}function h(e){const{block:t,space:n,viewer:o,spaceUserIds:r,spaceUser:i}=e;if(!t)return;if(null==o||!o.isUser()||!f({space:n,user:o,spaceUser:i}))return;const a=t.getPermissionItems().filter((e=>"user_permission"===e.type&&(0,d.zz)(e.role))).map((e=>e.user_id));return 0!==a.length?a.find((e=>r.includes(e))):void 0}function v(e){let{space:t,intl:n}=e;return{spaceName:t.name||n.formatMessage({id:"publicPageDataHelpers.untitledWorkspace.placeholder",defaultMessage:"Untitled Workspace"}),spaceId:t.id,icon:t.icon,betaEnabled:t.beta_enabled}}var y=n(673360),b=n(519889),_=n(657347),S=n(552629),k=n(401898),w=n(433929),x=n(145950),I=n(205659),C=n(385555),T=n(88893),M=n(21359);const P="publicAccessPageId";async function*A(e){const{firstResult:t,remotePromise:n}=await D(e);"local"===t.from&&t.result&&!e.ignoreLocalResult&&(yield t.result);const r=await n;"success"===r.result.type?yield r.result.data:(o.log({level:"error",from:"publicPageDataActions",type:"loadPublicPageData",error:(0,S.Ui)(r.result.error)}),yield)}async function*R(e){const{firstResult:t,remotePromise:n}=await D(e);"local"===t.from&&t.result&&(yield t.result);const r=await n;if("success"!==r.result.type)throw o.log({level:"error",from:"publicPageDataActions",type:"loadPublicPageDataUnsafely",error:(0,S.Ui)(r.result.error)}),r.result.error;yield r.result.data}async function D(e){const{environment:t,request:n}=e,o="block-space"===n.type?I.A.measure("loadPublicPageData",`block:${n.blockId} space:${n.spaceId}`,(()=>async function(e,t){if("block-space"!==t.type)return{error:Error("Shouldn't be looking for a non-block-space page")};const{blockId:n}=t,{id:o}=e.currentUser;if(n&&o){let t,S,k,I,M,P;try{var r;const d=await x.yY({environment:e,recordPointers:[{table:u.iU,id:n},{table:b.KJ,id:o}],recurFn:e=>{const o=[];return e.table===u.iU&&e.id===n&&(t=e),e.table===m.bx&&(S=e),e.table===p.vF&&t&&t.parent_id===e.id&&(k=e),e.table===b.KJ&&(M=e),(0,y.tz)(e)&&o.push(e.getParentPointer()),o},recordIsRequired:()=>!0});var s;if(S&&M)P=null===(s=await x.Ye({environment:e,pointer:M.toSpaceUserPointer(S.id)}))||void 0===s?void 0:s.model;const _=null===(r=k)||void 0===r?void 0:r.getLayoutPointer();var l;if(_)I=null===(l=await x.Ye({environment:e,pointer:_}))||void 0===l?void 0:l.model;if(t&&S&&M&&P){const e=i.om({table:u.iU,id:n},d),o=!i.Zg(e),r=M,s=Boolean(i.YL(e,r)),l=i.YP(e),y=(0,T.Io)().map((e=>e.userId)),b=(0,a.gD)(e),_=function(e){const{spaceDomain:t,actor:n,userHasExplicitAccess:o,intl:r,requireInterstitial:i,requireLogin:a,publicAccessRole:s,publicHomePage:l,template:d,securitySettings:y,spaceUserIds:b,isDeleted:_,spaceUser:S,publicDomainName:k,isTrustedDomainPage:w,trustedDomains:x,siteGoogleAnalyticsId:I,associatedLayoutModel:C,siteTheme:T}=e,M=c.kk5.fromValue(u.iU,e.block),P=c.kk5.fromValue(m.bx,e.space),A=c.kk5.fromValue(p.vF,e.associatedCollectionValue),R="none"!==s,D=(null==n?void 0:n.isUser())&&f({space:P,user:n,spaceUser:S}),B=A&&(o||R)?A.getNormalizedSchema():void 0,E=A&&(o||R)?A.id:void 0,F=A&&(o||R)?A.getFormat():void 0,Z=o||R?null==C?void 0:C.id:void 0,U=o||R?null==C?void 0:C.getRawModules():void 0;return{pageId:null==M?void 0:M.id,...v({space:P,intl:r}),spaceDomain:t,canJoinSpace:D,userHasExplicitAccess:o,ownerUserId:h({block:M,space:P,viewer:n,spaceUserIds:b,spaceUser:S}),collectionId:E,collectionSchema:B,collectionFormat:F,layoutId:Z,layoutModules:U,canRequestAccess:!(null==n||!n.isUser())&&g({space:P,actor:n,spaceUser:S,publicAccessRequestExpEnabled:e.publicAccessRequestExpEnabled}),requireInterstitial:i,requireLogin:Boolean(a),publicAccessRole:s,publicHomePage:l,securitySettings:y,template:d,isDeleted:_,publicDomainName:k,isTrustedDomainPage:w,trustedDomains:x,siteGoogleAnalyticsId:I,siteTheme:T}}({block:t,space:S,spaceDomain:void 0,associatedCollectionValue:k,associatedLayoutModel:I,actor:r,userHasExplicitAccess:s,intl:w.default.getIntl(),requireInterstitial:void 0,publicAccessRole:l,securitySettings:void 0,publicHomePage:void 0,template:void 0,publicAccessRequestExpEnabled:C.default.checkGate({gateName:"allow_public_page_access_request",disableExposureLogging:!0}),isDeleted:s?o:void 0,spaceUserIds:y,spaceUser:P,isTrustedDomainPage:b,trustedDomains:b?S.getTrustedDomains():void 0});return{value:_}}}catch(d){return{error:(0,_.t)(d)}}}return{error:Error("No offline public page data found.")}}(t,n))).then((e=>({from:"local",result:"value"in e?e.value:void 0}))):void 0,r=M.getPublicPageData(t,n).then((e=>({from:"remote",result:e})));return{firstResult:await Promise.race([o,r].filter(k.$K)),remotePromise:r}}function B(e){let{currentUserId:t,blockId:n}=e;r.Z.set({userId:t,key:P,value:n})}function E(e){return r.Z.get({userId:e,key:P})}},709953:(e,t,n)=>{n.d(t,{Ue:()=>C,ae:()=>S,j4:()=>k,nj:()=>I,sO:()=>w,sW:()=>x});n(757658),n(21703);var o=n(266749),r=n(597531),i=n(250680),a=n(159730),s=n(959753),l=n(300482),c=n(673360),d=n(600606),u=n(421202),p=n(167175),m=(n(712139),n(653965)),g=n(401898),f=(n(95477),n(27105)),h=n(741195),v=n(80444),y=n(206258),b=n(210228),_=n(801742);function S(e){const{environment:t,table:n,value:o,transaction:r,inMemoryRecordCache:i}=e;if(!o.id){const e=o,r=c.mk.create(n,e),i=c.mk.getSpaceId(r);o.id=(0,h.TS)({environment:t,table:n,spaceId:i})}const a=o,s=c.mk.create(n,a),l=d.dr.fromRecordWithTable(s),u=y.t1.createUniqueRootStore(t,l,{userId:r.userId,inMemoryRecordCache:i});return b.applyOperation({store:u,operation:{pointer:u.pointer,path:[],command:"set",args:o},transaction:r}),u}function k(e){var t,n;const{environment:o,type:i,properties:s,format:c,permissions:d,transaction:m,inMemoryRecordCache:S,useCrdt:k}=e;let w=e.tracker;const x=(0,f.p8)(k),I=e.spaceId||m.spaceId,C=e.id||(0,h.TS)({environment:o,table:u.iU,spaceId:I}),T=new y.G(o,{table:u.iU,id:C,spaceId:I},{userId:m.userId,inMemoryRecordCache:S});if(!w&&!m.getUserFlowForAnalyticsPurposesOnly()){const e="page"===i?"user_flow_create_page":"user_flow_create_block";w=new _.BW({environment:o,entryPointName:"recordActions.createBlock",userFlow:e,succeedOnEnqueue:!0})}null===(t=w)||void 0===t||t.track(T.pointer,m);const M=null===(n=v.default.state.currentUserStore)||void 0===n?void 0:n.pointer,P=r.mz({block:{id:C,type:i,permissions:d,properties:s,format:c,space_id:I,created_time:Date.now(),created_by_table:null==M?void 0:M.table,created_by_id:null==M?void 0:M.id},useCrdt:x});for(const r of P)(0,l.V_)(r)?b.applyOperation({store:T,operation:r,transaction:m}):(0,p.Qf)(r)?b.applyCrdtTextOperation({store:T,operation:r,invertedOperation:void 0,transaction:m}):(0,g.t1)(r);return m.postPerformAssertions.push((function(){if(m.isLocal)return;if(!T.getParentStore())throw new a.p8(`Created block was not given a parent before being committed in transaction ${m.getUserActionForAnalyticsPurposesOnly()}`)})),T}function w(e){const{store:t,value:n,transaction:o}=e,r=t.path;b.applyOperation({store:t,operation:{pointer:t.pointer,path:r,command:"set",args:n??null},transaction:o})}function x(e){const{store:t,transaction:n}=e,r=t.path;let i=e.data;i&&t.table===u.iU&&(m.Xy(r,[])?(i=function(e){const{properties:t,format:n,...o}=e;return o}(i),i=o.pp(i)):m.Xy(r,["properties"])?"title"in i||(i=o.pp(i)):m.Xy(r,["format"])&&(i=function(e){const{use_crdt:t,text_slice_tree:n,text_clocks:o,...r}=e;return r}(i),i=o.pp(i))),b.applyOperation({store:t,operation:{pointer:t.pointer,path:r,command:"update",args:i},transaction:n})}function I(e){const{store:t,source:n,fileIds:o,transaction:r}=e,i=t.path;for(const a of o)b.applyOperation({store:t,operation:{pointer:t.pointer,path:i,command:"copyFile",args:{source:n,fileId:a}},transaction:r})}function C(e){let{environment:t,table:n,args:o,transaction:r,inMemoryRecordCache:a}=e;const l=s.vkc[n],{model:c,operations:d}=l.create(o),m=y.t1.createUniqueRootStore(t,c.pointer,{userId:r.userId,inMemoryRecordCache:a});for(const s of d)(0,p.Qf)(s)?b.applyCrdtTextOperation({store:(0,i.Fb)(m,(e=>e.table===u.iU)),operation:s,invertedOperation:void 0,transaction:r}):b.applyOperation({store:m,operation:s,transaction:r});return m}},504408:(e,t,n)=>{n.d(t,{HB:()=>w,LK:()=>I,Wl:()=>_,bG:()=>k,fL:()=>S,uo:()=>x});n(757658);var o=n(844772),r=n(959753),i=n(772141),a=n(421202),s=n(475246),l=n(577858),c=n(519889),d=n(766079),u=n(328182),p=n(421838),m=n(937850),g=n(741195),f=n(244133),h=n(169151),v=n(318245),y=n(453730),b=n(21359);function _(e){var t,n;const{environment:r,pointer:m,userId:v,inMemoryRecordCache:y,model:b,role:_,force:S,maybeStaleRecordMap:k,updatePaths:w,debugSource:x,onPersistStart:I,onPersistSkip:T}=e;"block"===m.table&&(0,f.setBlockIdDebugSource)(m.id,x);const M=v||r.currentUser.id,P=null==b?void 0:b.getVersion(),A=y.getRole({pointer:m,userId:M}),R=y.getVersion({pointer:m,userId:M}),D="number"==typeof P&&P>R;if(!(S||D||void 0!==_&&A!==_))return void(r.defaultRecordCache.persistedRecordCache&&(0,o.t)(m)&&T&&T());let B=b;if(!S&&!D&&function(e){const{oldRole:t,newRole:n}=e;if(!n||!i.YX(n))return!1;if(t&&!i.J5(t))return!1;return!0}({oldRole:A,newRole:_})){const e=y.getRecordModel({pointer:m,userId:M});e&&(B=e)}null===(t=g.ov.track)||void 0===t||t.call(g.ov,{environment:r,spaceId:m.id,shortId:null===(n=B)||void 0===n?void 0:n.short_id_str,debugMessage:"setRecordValue"}),y.setModelAndRole({pointer:m,userId:M},B,_);for(const o of w)y.emitRecord(m,o);const E=r.defaultRecordCache.persistedRecordCache;if(!y.isTemporaryData&&E&&(0,o.t)(m)){const e=B?B.__IM_SORRY__getValue():void 0;if(m.table===a.iU&&e){const t=e;t.properties&&t.properties.title&&(t.properties.title=t.properties.title.map((e=>p.Y_F(e))))}const t=function(e){const{environment:t,pointer:n,model:o,role:r}=e,{id:a}=t.currentUser,p=n.table===c.KJ||n.table===d.dx||n.table===u.Sr;if(p&&a===n.id)return C.LoggedInUser;if((null==o?void 0:o.table)===l.zU&&o.parent_id===a)return C.JoinedSpace;if(n.table===s.bx&&(0,i.Jy)(r))return C.JoinedSpace;return}({environment:r,pointer:m,model:B,role:_}),n={value:e,role:_};E.set({pointer:m,value:n,importance:t,userId:M,maybeStaleRecordMap:k,debugListeners:I?function(){const{debugListeners:e,promise:t}=function(){const e={onSuccess:()=>{},onError:()=>{}};return{debugListeners:e,promise:new Promise(((t,n)=>{e.onSuccess=()=>{t()},e.onError=()=>{n()}}))}}();return I(t),e}():void 0})}y===r.defaultRecordCache.inMemoryRecordCache&&h.unsubscribeAfterDelay({pointer:m,userId:M,environment:r})}function S(e){const{environment:t,userId:n,recordMap:i,inMemoryRecordCache:a,force:s,maybeStaleRecordMap:l,debugSource:c,onSetRecordMapPersistComplete:d}=e,u=t.defaultRecordCache.persistedRecordCache,p=[];let f=0;(0,m.Lc)(i,100,(async e=>{let{pointer:i,model:m,role:h}=e,v=m,b=h;if(y.transactionQueue.isPendingTransactionForRecord(i)&&u&&(0,o.t)(i)){var S,k;null===(S=g.ov.track)||void 0===S||S.call(g.ov,{environment:t,spaceId:i.id,shortId:null===(k=v)||void 0===k?void 0:k.short_id_str,debugMessage:"setRecordMap1"});const e=await u.get(i,n||t.currentUser.id);var w,x;if(e)v=r.kk5.fromValue(i.table,e.value),b=h,null===(w=g.ov.track)||void 0===w||w.call(g.ov,{environment:t,spaceId:i.id,shortId:null===(x=v)||void 0===x?void 0:x.short_id_str,debugMessage:"setRecordMap2"})}_({environment:t,inMemoryRecordCache:a,pointer:i,userId:n,model:v,role:b,updatePaths:[[]],force:s,maybeStaleRecordMap:l,debugSource:c,...d?{onPersistStart:e=>{p.push(e)},onPersistSkip:()=>{f++}}:{}})})).then((async()=>{if(d)if(0===p.length)d(f>0?"allSkipped":"wasNotAttempted");else try{await Promise.all(p),d("success")}catch(e){d("error")}}))}async function k(e){const{inMemoryRecordCache:t,pointer:n,userId:i,environment:a,minimumVersion:s}=e,l=y.transactionQueue.isPendingTransactionForRecord(n),c=a.defaultRecordCache.persistedRecordCache;if(l&&c&&(0,o.t)(n))return await c.get(n,i);const d=new AbortController,u=c&&(0,o.t)(n)?async e=>{let{onLoadComplete:t}=e;const o=await c.get(n,i);if(t(),!d.signal.aborted)return o}:void 0,p=async function(){let{onLoadComplete:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=t.getEntry({pointer:n,userId:i}),r=o?o.value:void 0,l=o?o.pointer:void 0;if(s&&null!=r&&r.value&&(null==r?void 0:r.value.version)>=s)return r;const c=await b.syncRecordValue(a,{userId:i,version:r&&r.value&&r.value.version?r.value.version:-1,pointer:l||n});return null==e||e(),c},m=e=>o=>{var s,l;o&&(null===(s=g.ov.track)||void 0===s||s.call(g.ov,{environment:a,spaceId:n.id,shortId:null===(l=o.value)||void 0===l?void 0:l.short_id_str,debugMessage:`refreshAndReturnRecord-${e}`}),_({environment:a,inMemoryRecordCache:t,pointer:n,userId:i,model:r.kk5.fromValue(n.table,o.value),role:o.role,updatePaths:[[]],debugSource:`refreshAndReturnRecord (${e})`}));return o};if(!u)return await p().then(m("remoteResult"));const f=v.default.mark("refresh_and_return_record.parallel.local"),h=u({onLoadComplete:()=>{v.default.measure(f,{environment:a,shouldExcludeFromTimeline:!0})}}).then(m("localResult")),S=v.default.mark("refresh_and_return_record.parallel.remote"),k=p({onLoadComplete:()=>{v.default.measure(S,{environment:a,shouldExcludeFromTimeline:!0})}}).then(m("remoteResult"));let w;try{w=await k}catch(x){console.error(x)}return w?(d.abort(),w):await h}async function w(e){const{inMemoryRecordCache:t,pointer:n,userId:o,environment:i}=e,{defaultRecordCache:a}=i,s=await b.syncRecordValue(i,{pointer:n,userId:o,version:-1});var l,c;s&&(x({environment:i,inMemoryRecordCache:t,persistedRecordCache:a.persistedRecordCache,pointer:n,userId:o}),null===(l=g.ov.track)||void 0===l||l.call(g.ov,{environment:i,spaceId:n.id,shortId:null===(c=s.value)||void 0===c?void 0:c.short_id_str,debugMessage:"forceFetchRemoteRecord"}),_({environment:i,inMemoryRecordCache:t,pointer:n,userId:o,model:r.kk5.fromValue(n.table,s.value),role:s.role,updatePaths:[[]],debugSource:"forceFetchRemoteRecord"}))}function x(e){const{inMemoryRecordCache:t,persistedRecordCache:n,pointer:r,userId:i}=e;t.deleteRecord({pointer:r,userId:i}),t.emitRecord(r,[]),n&&(0,o.t)(r)&&n.deleteRecord(r,i)}function I(e){const t=e.defaultRecordCache.inMemoryRecordCache;for(const{pointer:n}of t.data)h.unsubscribeForAllUsers({pointer:n,environment:e});t.clearCache()}const C={LoggedInUser:100,JoinedSpace:50}},52989:(e,t,n)=>{n.d(t,{AI:()=>h,MZ:()=>v,qw:()=>y});n(757658);var o=n(653965),r=n(710274),i=n(973744),a=n(928314),s=n(177546),l=n(95802),c=n(598794),d=n(626765),u=n(304926),p=n(569784),m=n(650628),g=n(27724),f=n(524677);function h(e){const{environment:t,target:n,startX:o,startY:d,showSelectionRect:m,preventSelectStores:h,allowVerticalEdgeScroll:y,allowHorizontalEdgeScroll:b}=e,_=g.default.getDefaultContainerFromTarget(n);if(!_)return;if(o>=window.innerWidth-u.Z.state)return;if(d>=window.innerHeight-u.Z.state)return;const S=s.VW(n),k=s.xH(n),w=l.C.getMembersByDOMOrder({filter:e=>e.getContextSelectableContainer()===_}),x=()=>{p.default.state.isActive&&(f.Jy(),v({environment:t,currentX:p.default.state.currentX,currentY:p.default.state.currentY,toggle:a.yA().shift}))};S&&i.lj(S,"scroll",x),k&&i.lj(k,"scroll",x),p.default.setState({moved:!1,isActive:!0,startX:o,startY:d,currentX:o,currentY:d,currentRect:void 0,defaultContainer:_,startSelection:g.default.state.stores,startSelectables:w,verticalScrollerEl:S,horizontalScrollerEl:k,startScrollTop:S?S.scrollTop:0,startScrollLeft:k?k.scrollLeft:0,showSelectionRect:m,handleScroll:x,preventSelectStores:h,allowVerticalEdgeScroll:y,allowHorizontalEdgeScroll:b}),f.ZH({environment:t}),r.wG(),c.MO()}function v(e){const{environment:t}=e,n=p.default.state;if(n.isActive){const{currentX:r,currentY:i,verticalScrollerEl:a,horizontalScrollerEl:s,startScrollTop:l,startScrollLeft:c,preventSelectStores:u}=n;let g=n.startY;if(a){g-=a.scrollTop-l}let h=n.startX;if(s){h-=s.scrollLeft-c}const v={top:Math.min(g,i),bottom:Math.max(g,i),left:Math.min(h,r),right:Math.max(h,r)},y=m.Z.state.selectableRectMap,_=function(e){const t=new Map,n={root:!0};for(const o of e){const e=b(o)||n;t.get(e)||t.set(e,[]),t.get(e).push(o)}return Array.from(t.values())}(n.startSelectables.filter((e=>{const t=y.get(e),o=e.props.store;return e.props.canSelect&&t&&d.kK(v,t)&&u.indexOf(o)<0&&(!n.showSelectionRect||o.isTransclusionType()||!o.isInsideTransclusion())})));let S=[];const k=_.find((e=>e.length>1));if(k)S=k;else{const e=o.Z$(_);e&&(S=e)}let w=o.UI(S,(e=>e.props.store));if(e.toggle)for(const e of n.startSelection)o.q9(w,e)?w=o.zu(w,e):w.push(e);p.default.setState({...n,moved:!0,currentX:e.currentX,currentY:e.currentY,currentRect:v}),f.Z5({environment:t,stores:w})}}function y(e){const t=p.default.state;if(t.isActive){const{moved:n,verticalScrollerEl:o,horizontalScrollerEl:r,handleScroll:a}=t;n||f.ZH({environment:e}),o&&i.ZV(o,"scroll",a),r&&i.ZV(r,"scroll",a),p.default.setState({isActive:!1})}}function b(e){if(e)for(;;){if(!(e=e.getContextClosestSelectable()))return;if(e.props.canSelect)return e}}},879978:(e,t,n)=>{n.d(t,{Bl:()=>l,Hi:()=>i,VG:()=>a,hE:()=>s});n(180951);var o=n(575134),r=(n(709953),n(210228));function i(e){const{environment:t,store:n,propertyId:i,id:a,position:s,transaction:l}=e;let c;c="before"===s.type?{pointer:n.pointer,path:["properties",i],command:"addRelationBefore",args:{id:a,spaceId:n.getSpaceId(),before:s.before}}:{pointer:n.pointer,path:["properties",i],command:"addRelationAfter",args:{id:a,spaceId:n.getSpaceId(),after:s.after}},r.applyOperation({store:n,operation:c,transaction:l}),o.r({environment:t,store:n,relationPropertyId:i})}function a(e){const{environment:t,store:n,propertyId:i,id:a,transaction:s}=e;r.applyOperation({store:n,operation:{pointer:n.pointer,path:["properties",i],command:"removeRelation",args:{id:a,spaceId:n.getSpaceId()}},transaction:s}),o.r({environment:t,store:n,relationPropertyId:i})}function s(e){const{environment:t,sourceStore:n,destStore:o,propertyWithInverse:r,position:a,transaction:s}=e;i({environment:t,store:n,propertyId:r.property,id:o.id,position:a,transaction:s}),i({environment:t,store:o,propertyId:r.inverse,id:n.id,transaction:s,position:{type:"after"}})}function l(e){const{environment:t,sourceStore:n,destStore:o,propertyWithInverse:r,transaction:i}=e;a({environment:t,store:n,propertyId:r.property,id:o.id,transaction:i}),a({environment:t,store:o,propertyId:r.inverse,id:n.id,transaction:i})}},443008:(e,t,n)=>{n.d(t,{g:()=>l,x:()=>c});var o=n(95802),r=n(80444),i=n(206258),a=n(264951),s=n(524677);function l(e){const{mainEditorCurrentBlockStore:t}=r.default.state;if(t){const n=i.G.createChildStore(t,e.blockStore.pointer);a.Z.setState({...a.Z.state,originRect:e.originRect||o.C.getRectFromStore(e.blockStore),blockStore:n})}}function c(e){a.Z.reset(),s.ZH({environment:e})}},552771:(e,t,n)=>{n.d(t,{$:()=>l,x:()=>c});var o=n(95802),r=n(80444),i=n(206258),a=n(682187),s=n(524677);function l(e){const{currentSpaceViewStore:t}=r.default.state;if(t){const n=i.G.createChildStore(t,e.blockStore.pointer);a.Z.setState({...a.Z.state,originRect:e.originRect||o.C.getRectFromStore(e.blockStore),clonedBlockStore:n,originalBlockStore:e.blockStore,renderDelete:e.renderDelete})}}function c(e){a.Z.reset(),s.ZH({environment:e})}},452423:(e,t,n)=>{n.d(t,{AZ:()=>j,L0:()=>L,hv:()=>H,K9:()=>U,dA:()=>O,M7:()=>q,XT:()=>z,KX:()=>N,Yw:()=>V,qB:()=>K});n(757658),n(252262),n(324506);var o=n(250680),r=n(300482),i=n(600606),a=n(421202),s=n(167175),l=n(182798),c=n(653965),d=n(401898),u=n(312422),p=n(516861),m=n(206258),g=n(370354),f=n(27724),h=n(924666),v=n(421838),y=n(800993),b=n(210228),_=n(273959),S=n(365663),k=n(554843);function w(e,t,n,o){const r=o.getClosestPageAndTransclusionReferenceAncestorIds(t),i=o.getClosestPageAndTransclusionReferenceAncestorIds(n);if(0===r.length||0===i.length)return[];const a=[];for(const s of c.jV(r,i)){const r=(0,l.TO)(o.getPathToBlock(s)),i=(0,l.TO)(I(e,r));a.push(...x(i,t,n))}return a.sort(((e,t)=>e.length-t.length)),a}function x(e,t,n){const o=[];let r=[];for(const i of function*(e,t){let n=!1;for(const o of function*(e){function t(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function*(){if(yield e,(!e.isNavigableBlock()||n)&&("transclusion_reference"!==e.getType()||o))for(const n of(0,k.y)(e))yield*t(n,!1,!1)}()}yield*t(e,!0,!0)}(e))o.id===t&&(n=!0),n&&(yield o)}(e,t))if(i.id!==t){if(r.length>0){if("transclusion_reference"===i.getType()){r=[];continue}r.push(i),i.id===n&&(o.push(r),r=[])}}else r=[i],t===n&&(o.push(r),r=[]);return o.sort(((e,t)=>e.length-t.length)),o}function I(e,t){(0,l.T)(t.length>0,"Path must not be empty"),(0,l.T)(e.id===t.shift(),"Path must start with root store id");let n=e;for(;t.length>0;){const e=(0,l.TO)(t.shift()),o=(0,k.y)(n).find((t=>t.id===e));if(!o)return;n=o}return n}var C=n(377282),T=n(828685);function M(e){const{store:t}=e;let n;const o=C.Z.getPageStoreForBlockStore(t);if(n=o?P({...e,pageStore:o,allowNonRenderedSingleStoreSelection:!1}):A(e),n&&(n.start.store!==n.end.store||n.start.index<n.end.index))return n}function P(e){var t,n;const{store:r,startTextInstanceId:i,startId:a,endTextInstanceId:s,endId:l,pageStore:u,allowNonRenderedSingleStoreSelection:p}=e,m=(0,o.TO)(C.Z.getPageTextInstanceTrackerForPage(u.pointer)),g=m.getBlockIdForTextInstanceItemId(i,a),f=m.getBlockIdForTextInstanceItemId(s,l);if(void 0===g||void 0===f)return;const h=w(u,g,f,(0,o.TO)(C.Z.getPageBlockTrackerForPage(u.pointer)));let v,y;const b=c.MR(h,(e=>(0,o.TO)(e.at(0))===r?-1:1));for(const c of b){const e=(0,o.TO)(c.at(0)),t=(0,o.TO)(c.at(-1));if(T.E.findEditableWithStore(e.getBlockTitleStore())&&T.E.findEditableWithStore(t.getBlockTitleStore())){v=e,y=t;break}}if((!v||!y)&&p&&b.length>0&&b[0].at(0)===b[0].at(-1)&&(v=(0,o.TO)(b[0].at(0)),y=(0,o.TO)(b[0].at(-1))),!v||!y)return;const _=(0,o.TO)(null===(t=v.getTextSliceTree())||void 0===t?void 0:t.getGraphemeIndexOfTextItem(i,a)),S=(0,o.TO)(null===(n=y.getTextSliceTree())||void 0===n?void 0:n.getGraphemeIndexOfTextItem(s,l)),k="visible"===_.type?_.index:"deleted"===_.type?_.nextVisibleIndex:(0,d.t1)(_),x="visible"===S.type?S.index+1:"deleted"===S.type?S.nextVisibleIndex:(0,d.t1)(S);return{start:{store:v.getBlockTitleStore(),index:k},end:{store:y.getBlockTitleStore(),index:x}}}function A(e){var t;const{store:n,startTextInstanceId:r,startId:i,endTextInstanceId:a,endId:s}=e;(0,o.T)(n.useCrdt());const l=null===(t=n.getTextSliceTree())||void 0===t?void 0:t.getTextInstanceIds();if(!l||!l.has(r)||!l.has(a))return;const c=(0,o.TO)(n.getTextSliceTree()),u=c.getGraphemeIndexOfTextItem(e.startTextInstanceId,e.startId);if(!u)return;const p=a===r&&s===i?u:c.getGraphemeIndexOfTextItem(e.endTextInstanceId,e.endId);if(!p)return;const m="visible"===u.type?u.index:"deleted"===u.type?u.nextVisibleIndex:(0,d.t1)(u),g="visible"===p.type?p.index+1:"deleted"===p.type?p.nextVisibleIndex:(0,d.t1)(p);return{start:{store:n.getBlockTitleStore(),index:m},end:{store:n.getBlockTitleStore(),index:g}}}function R(e){const{store:t,textInstanceId:n,itemId:r,options:i}=e,a=C.Z.getPageStoreForBlockStore(t);if(!a)return;const s=(0,o.TO)(C.Z.getPageTextInstanceTrackerForPage(a.pointer)).getBlockIdForTextInstanceItemId(n,r,i);if(!s)return;const l=w(a,s,s,(0,o.TO)(C.Z.getPageBlockTrackerForPage(a.pointer)));if(l.length>0){const e=l[0];return(0,o.T)(1===e.length),e[0]}}function D(e){const{environment:t,store:n,transaction:r,operation:i}=e,a=function(e){const{store:t,textInstanceId:n,id:o}=e,r=C.Z.getPageStoreForBlockStore(t),i=r?P({store:t,startTextInstanceId:n,startId:o,endTextInstanceId:n,endId:o,pageStore:r,allowNonRenderedSingleStoreSelection:!0}):A({store:t,startTextInstanceId:n,startId:o,endTextInstanceId:n,endId:o});return null==i?void 0:i.end}({store:n,textInstanceId:i.args.textInstanceId,id:i.args.originId});if(!a)return n.useCrdt()?"err_no_store_position":(F({environment:t,store:n,invertedOperation:i,transaction:r}),"success_non_crdt");const s=(0,o.TO)((0,_.sQ)(a.store)),l=(0,o.TO)(s.getTextSliceTree()),{operations:c,invertedOperations:u}=l.getOperationsForInsertTextValueAfterOriginId(i.args.textInstanceId,i.args.originId,i.args.deletedTextValue),p=(0,o.TO)(l.getGraphemeIndexOfTextItem(i.args.textInstanceId,i.args.originId)),m="visible"===p.type?p.index+1:"deleted"===p.type?p.nextVisibleIndex:(0,d.t1)(p),g=v.Zxt(v.P$X(l.getTextValue(),i.args.deletedTextValue,m));return S.F({transaction:r,store:s,crdtOperations:c,invertedOperations:u,fullTextValue:g}),"success"}function B(e){const{environment:t,store:n,transaction:r,operation:i}=e,{textInstanceId:s,textSliceStartItemId:l,targetTextInstanceId:c,targetTextSliceEndItemId:d}=i.args,u=R({store:n,textInstanceId:s,itemId:l,options:{type:"start"}}),p=R({store:n,textInstanceId:c,itemId:d,options:{type:"end"}});if(!u||!p){const e=n,s=new m.G(t,{table:a.iU,id:i.args.sourceBlockId,spaceId:n.pointer.spaceId});return e.isDefined()&&!e.useCrdt()||s.isDefined()&&!s.useCrdt()?(function(e){const{environment:t,sourceBlockStore:n,targetBlockStore:r,invertedOperation:i,transaction:a}=e;(0,o.T)(n.isDefined(),"Source block store is expected to be defined"),(0,o.T)(r.isDefined(),"Target block store is expected to be defined"),(0,o.T)(!n.useCrdt()||!r.useCrdt(),"One or both of source and target blocks is expected to be a non-CRDT block");const s=n.getBlockTitleStore(),l=r.getBlockTitleStore();y.sO({environment:t,store:s,value:i.args.previousSourceTextValue,transaction:a}),y.sO({environment:t,store:l,value:i.args.previousTargetTextValue,transaction:a})}({environment:t,sourceBlockStore:s,targetBlockStore:e,invertedOperation:i,transaction:r}),"success_non_crdt"):u?"err_no_target_block_store":"err_no_source_block_store"}const{fullSourceTextValue:g,fullTargetTextValue:f}=function(e){const{source:t,target:n}=e,r=(0,o.TO)(t.blockStore.getTextSliceTree()),i=r.getTextValue(),a=(0,o.TO)(r.findTextSliceTreeContainingItemWithId(t.textInstanceId,t.textSliceStartItemId)),s=(0,o.TO)(r.getGraphemeIndicesOfSlice({boundary:"start",textInstanceId:t.textInstanceId,start:t.textSliceStartItemId})).startIndex,l=a.getLastTextSliceTreeInPreOrderTraversal(),c=(0,o.TO)(r.getGraphemeIndicesOfSlice({boundary:"end",textInstanceId:l.getTextSlice().textInstanceId,end:l.getTextSlice().getEndItem().id})).exclusiveEndIndex,{tokensBeforeRange:d=[],tokensInsideRange:u=[],tokensAfterRange:p=[]}=v.xrQ(i,s,c),m=v.Zxt([...d,...p]);if(t.blockStore.pointer.id===n.blockStore.pointer.id){const e=(0,o.TO)(r.getGraphemeIndicesOfSlice({boundary:"end",textInstanceId:n.textInstanceId,end:n.textSliceEndItemId})).exclusiveEndIndex;if(e<=s){const t=v.Zxt(v.P$X(m,u,e));return{fullSourceTextValue:t,fullTargetTextValue:t}}if(c<=e){const t=e-(c-s),n=v.Zxt(v.P$X(m,u,t));return{fullSourceTextValue:n,fullTargetTextValue:n}}return{fullSourceTextValue:i,fullTargetTextValue:i}}{const e=(0,o.TO)(n.blockStore.getTextSliceTree()),t=(0,o.TO)(e.getTextValue()),r=(0,o.TO)(e.getGraphemeIndicesOfSlice({boundary:"end",textInstanceId:n.textInstanceId,end:n.textSliceEndItemId})).exclusiveEndIndex;return{fullSourceTextValue:m,fullTargetTextValue:v.Zxt(v.P$X(t,u,r))}}}({source:{blockStore:u,textInstanceId:s,textSliceStartItemId:l},target:{blockStore:p,textInstanceId:c,textSliceEndItemId:d}}),h=(0,o.TO)(u.getTextSliceTree()),_=(0,o.TO)(h.findTextSliceTreeBeforeTextSliceStartingWithItemId(i.args.textInstanceId,i.args.textSliceStartItemId)).getTextSlice();return b.applyCrdtTextOperation({transaction:r,store:u,operation:{command:"moveTextSlice",path:[],pointer:u.pointer,args:{textInstanceId:s,textSliceStartItemId:l,targetBlockId:p.id,targetTextInstanceId:c,targetTextSliceEndItemId:d,forDowngrade:{fullSourceTextValue:g,fullTargetTextValue:f}}},invertedOperation:{command:"invertedMoveTextSlice",path:[],pointer:u.pointer,args:{textInstanceId:s,textSliceStartItemId:l,targetTextInstanceId:_.textInstanceId,targetTextSliceEndItemId:_.getEndItem().id,sourceBlockId:p.id,previousSourceTextValue:p.getBlockTitleStore().getValue()??[],targetBlockId:u.id,previousTargetTextValue:u.getBlockTitleStore().getValue()??[]}}}),"success"}function E(e){const{environment:t,store:n,transaction:o,operation:r}=e;switch(r.command){case"invertedInsertText":return function(e){const{environment:t,store:n,transaction:o,operation:r}=e,i=M({store:n,startTextInstanceId:r.args.textInstanceId,startId:r.args.startId,endTextInstanceId:r.args.textInstanceId,endId:r.args.endId});return i?(y.pz({environment:t,multiSelection:i,transaction:o}),"success"):n.useCrdt()?"err_no_multiselection":(F({environment:t,store:n,invertedOperation:r,transaction:o}),"success_non_crdt")}({environment:t,store:n,transaction:o,operation:r});case"invertedDeleteText":return D({environment:t,store:n,transaction:o,operation:r});case"invertedMoveTextSlice":return B({environment:t,store:n,transaction:o,operation:r});case"invertedAddAnnotation":return function(e){const{environment:t,store:n,transaction:o,operation:r}=e,i=M({store:n,startTextInstanceId:r.args.startTextInstanceId,startId:r.args.startId,endTextInstanceId:r.args.endTextInstanceId,endId:r.args.endId});return i?(y.QX({environment:t,multiSelection:i,annotationKey:r.args.annotationKey,transaction:o}),"success"):n.useCrdt()?"err_no_multiselection":(F({environment:t,store:n,invertedOperation:r,transaction:o}),"success_non_crdt")}({environment:t,store:n,transaction:o,operation:r});case"invertedRemoveAnnotation":return function(e){const{environment:t,store:n,transaction:o,operation:r}=e,i=M({store:n,startTextInstanceId:r.args.startTextInstanceId,startId:r.args.startId,endTextInstanceId:r.args.endTextInstanceId,endId:r.args.endId});return i?(y.KM({environment:t,multiSelection:i,annotation:r.args.annotation,transaction:o}),"success"):n.useCrdt()?"err_no_multiselection":(F({environment:t,store:n,invertedOperation:r,transaction:o}),"success_non_crdt")}({environment:t,store:n,transaction:o,operation:r});default:(0,d.t1)(r)}}function F(e){const{environment:t,store:n,invertedOperation:r,transaction:i}=e;(0,o.T)(!n.useCrdt());const a=n.getBlockTitleStore();y.sO({environment:t,store:a,value:r.args.previousTextValue,transaction:i})}var Z=n(424161);function U(e){const t=g.default.state,{undoStack:n,invertedTextOperationIdMapper:o}=t,r=e.currentTime??Date.now(),i=e.transaction.getUserActionForAnalyticsPurposesOnly()??"unknown";if("string"==typeof e.undoCheckpoint){const t=n.find((t=>t.namedRevisionId===e.undoCheckpoint));t?(t.transactions.push(e.transaction),t.userActions.push(i)):n.push({userActions:[i],transactions:[e.transaction],timestamp:r,namedRevisionId:e.undoCheckpoint,undoRedoCount:0})}else{const t=n.at(-1);!e.undoCheckpoint&&t&&!t.namedRevisionId&&r-t.timestamp<=g.groupIntervalMs&&0===t.undoRedoCount&&t.transactions[0].isLocal===e.transaction.isLocal&&t.transactions[0].operations.some(s.Qf)===e.transaction.operations.some(s.Qf)?(t.transactions.push(e.transaction),t.userActions.push(i)):n.push({userActions:[i],transactions:[e.transaction],timestamp:r,undoRedoCount:0})}g.default.setState({undoStack:n,redoStack:[],invertedTextOperationIdMapper:o}),g.default.emit()}function V(e,t){const n=g.default.state,{invertedTextOperationIdMapper:o}=n,{undoStack:r,redoStack:i}=Y(n),a=r.pop();if(a){const n=W({environment:e,revision:a,preventSelectText:t,invertedTextOperationIdMapper:o});i.push(n),g.default.setState({undoStack:r,redoStack:i,invertedTextOperationIdMapper:o})}}function N(e,t){const n=g.default.state,{invertedTextOperationIdMapper:o}=n,{undoStack:r,redoStack:i}=Y(n),a=i.pop();if(a){const n=W({environment:e,revision:a,preventSelectText:t,invertedTextOperationIdMapper:o});r.push(n),g.default.setState({undoStack:r,redoStack:i,invertedTextOperationIdMapper:o})}}function O(){g.default.reset()}function L(){return Boolean(z())}function j(){return Boolean(q())}function K(e){const{skipDefaultPostPerformValidationChecks:t}=e,n=g.default.state,{environment:o,namedRevisionId:r}=e,{invertedTextOperationIdMapper:i}=n,{undoStack:a,redoStack:s}=Y(n),l=a.findIndex((e=>e.namedRevisionId===r));if(l<0)return;const c=W({environment:o,revision:a.splice(l,1)[0],invertedTextOperationIdMapper:i,skipDefaultPostPerformValidationChecks:t});s.push(c),g.default.setState({undoStack:a,redoStack:s,invertedTextOperationIdMapper:i})}function z(){const e=g.default.state.undoStack.at(-1);return e?G(e):void 0}function q(){const e=g.default.state.redoStack.at(-1);return e?G(e):void 0}function H(e){return g.default.state.undoStack.some((t=>t.namedRevisionId===e))}function G(e){return{getUserActions:()=>e.userActions.slice(),getFirstStore(){var t;return null==e||null===(t=e.transactions)||void 0===t||null===(t=t[0].stores)||void 0===t?void 0:t[0]}}}function W(e){const{environment:t,revision:n,invertedTextOperationIdMapper:s,preventSelectText:l,skipDefaultPostPerformValidationChecks:m}=e;let{transactions:g}=n;p.Z.isDebuggingEnabled()&&console.log("Undoing/redoing transactions with user actions",n.userActions.join(","));const{performResult:v}=b.createAndCommit({userAction:"revisionActions.performUndoRedoRevisionTransaction",environment:t,canUndo:!1,skipDefaultPostPerformValidationChecks:m,perform:e=>{g=c.d9(g),g.reverse();for(const n of g){const p=c.d9(n.invertedOperations);p.reverse(),e.copyDebugTagsFrom(n);for(const l of p)if((0,Z.v)(l))$({environment:t,invertedOperation:l,invertedTextOperationIdMapper:s,transaction:n,newTransaction:e});else if((0,r.V_)(l)||(0,r.SH)(l)){const r=n.stores.find((e=>(0,i.qo)(e.pointer,l.pointer)));if(!r)continue;if(r.table===a.iU&&!r.inMemoryRecordCache.isMockTextStore&&(0,o.TO)(r.getAncestorBlockStoreAtRootPath()).useCrdt()){(0,u.y)({environment:t,operation:l,transaction:e});continue}b.applyOperation({transaction:e,store:r,operation:l})}else(0,d.t1)(l);n.beforeSelection&&f.default.setState({...f.default.state,...n.beforeSelection}),n.beforeTextSelection&&!l&&h.default.setState(n.beforeTextSelection)}return e}});return{...n,transactions:[v],undoRedoCount:n.undoRedoCount+1}}function $(e){const{environment:t,invertedOperation:n,invertedTextOperationIdMapper:r,transaction:a,newTransaction:s}=e,c=a.stores.filter((e=>(0,i.qo)(e.pointer,n.pointer)&&e instanceof m.G)),u=c.find((e=>Boolean(e.uiLocation.uiParent)))??c.at(0);if(!u)return;const g=s.operations.length,f=r.getInvertedTextOperationWithMaybeRemappedIds(n),h=E({environment:t,store:u,transaction:s,operation:f});if("success_non_crdt"===h)return;"success"!==h&&p.Z.logInvertedTextOperationError({transaction:a,invertedOperation:n,maybeRemappedInvertedOperation:f,errorCode:h});const v=s.operations.length;if("invertedDeleteText"===f.command&&v>g){const e=(0,o.TO)(s.operations.slice(g,v).find((e=>"insertText"===e.command)),"New operations should contain an InsertTextOperation");r.remapIdsForReinsertedText(f,(0,l.Fb)(e,(0,d.AO)((e=>"insertText"===e.command?{true:e}:{false:e}))))}}function Y(e){const{undoStack:t,redoStack:n}=e;return{undoStack:t.slice(),redoStack:n.slice()}}},756863:(e,t,n)=>{n.d(t,{w:()=>i});var o=n(249557),r=n(904935);function i(){o.Z.state.isActive&&(r.Z.setState({...r.Z.state,open:!1}),o.Z.setState({...o.Z.state,isActive:!1,isAnimatingClosed:!0}))}},275754:(e,t,n)=>{n.d(t,{Rp:()=>y,_c:()=>f,qV:()=>h});n(757658);var o=n(749085),r=n(815145),i=n(421202),a=n(218265),s=n(783105),l=n(484210),c=n(646735),d=n(206258),u=n(250906),p=n(210228),m=n(239865),g=n(608055);function f(e){const{environment:t,store:n,redirect:o,scrollToBlockId:i,collectionViewId:d,openInNew:u,discussionId:p,showMoveTo:m,saveParent:f,visitType:h,templateGalleryItem:v,projectManagementLaunch:y,pageVisitSource:b,openInSidePeek:_,openInCenterPeek:S,queryId:k,callback:w,peekViewBlockId:x,peekMode:I}=e,C=(0,l.Hu)({store:n,fullyQualified:!1,scrollToBlockId:i,collectionViewId:d,discussionId:p,showMoveTo:m,saveParent:f,templateGalleryItem:v,projectManagementLaunch:y,openInSidePeek:_,openInCenterPeek:S,pageVisitSource:b,peekViewBlockId:x,peekMode:I});n.isNavigableBlock()&&c.Z.recordVisit({id:n.id,systemBlockType:n.getSystemBlockTypeStore().getValue(),type:void 0!==h?h:s.vu.Default,currentUserId:t.currentUser.id}),g.c4({environment:t,url:b?a.SK(C,{[r.$X]:b,[r.Mf]:u?k:void 0}):C,redirect:o,openInNew:u,queryId:k,callback:w})}function h(e){const{environment:t,targetId:n}=e;if(t.device.isMobile)return;const o=v.state;if(void 0===o)return;if(n!==o)return;const r=new d.G(t,{id:n,table:i.iU});if("page"!==r.getType())return;const a=r.getContentStores(),s=1===a.length?a[0]:void 0,l=s&&s.isEmptyEditableBlock();r.isEmptyTitle()&&(r.isEmptyPage()||l)&&p.createAndCommit({userAction:"blockNavigationActions.maybeGarbageCollectEmptyPage",environment:t,perform:e=>{m.y8({environment:t,blocks:[r],transaction:e}),e.postSubmitCallbacks.push((e=>{e||u.dh(t,{analyticsName:"delete",from:"navigation_actions",block_id:r.id,block_type:"page"})}))}})}const v=o.default.createValue(void 0,{name:"NewPageEmptyAutoDeleteStore"});function y(e){v.setState(e.id)}},412714:(e,t,n)=>{n.d(t,{D:()=>a});var o=n(218265),r=n(95477),i=n(247839);function a(e){const{environment:t,targetSelf:n}=e;let a=e.url;"/"===a[0]&&(a=r.default.domainBaseUrl+a);const s=o.yn(a);if(s)if(t.device.isElectron)i.openExternalUrl(s);else if(t.mobileNative)s.startsWith("http:")||s.startsWith("https:")?t.mobileNative.openInAppBrowser(s):window.location.href=s;else{const t=document.createElement("a");t.href=e.url,t.classList.add("notion-link"),n||t.setAttribute("target","_blank"),t.setAttribute("rel","noopener noreferrer"),document.body.appendChild(t),t.click(),t.remove()}}},132953:(e,t,n)=>{n.d(t,{Hu:()=>$,LU:()=>z,M3:()=>H,Pg:()=>L,UV:()=>G,Vz:()=>W,jC:()=>j,rM:()=>K});var o=n(915157),r=n(653965),i=n(710274),a=n(380351),s=n(95306),l=n(209080),c=n(823376),d=n(116746),u=n(74948),p=n(136896),m=n(598794),g=n(80444),f=n(316772),h=n(189256),v=n(417903),y=n(619671),b=n(813023),_=n(398452),S=n(799332),k=n(724612),w=n(155320),x=n(186486),I=n(27724),C=n(452258),T=n(766708),M=n(977503),P=n(562820),A=n(554564),R=n(106404),D=n(551365),B=n(954604),E=n(443008),F=n(552771),Z=n(452423),U=n(524677),V=n(164964),N=n(898104),O=n(977357);function L(e){T.Z.reset(),M.Z.reset(),C.Z.reset(),h.Z.reset(),D.xv({environment:e,blockPropertyValueOverlayStore:y.Z}),O.W8(),V.C1()}function j(e,t){_.Z.reset(),S.Z.reset(),k.Z.reset(),D.xv({environment:e,blockPropertyValueOverlayStore:b.Z})}function K(e){var t;U.ZH({environment:e}),N.clear({environment:e}),i.wG(),m.MO(),U.Fp({pivot:void 0}),R.xv(),x.default.reset(),Z.dA(),A.LZ(),F.x(e),E.x(e),f.default.resetStore({environment:e}),B.xv(),null===(t=e.NativeMobileActionBarStore)||void 0===t||t.clear(!1)}function z(e){p.Z.reset(),w.default.reset(),P.Z.state.open&&(P.Z.reset(),e.device.isMobile&&u.close()),d.default.isPeekDismissableState()&&!d.default.isTransitioningState()&&c.TN({environment:e}),l.Z.state.open&&s.UZ(e),(0,a.C)(e)}function q(){const{mainEditorCurrentBlockStore:e}=g.default.state;let t=0,n=[];if(e){const{stores:e}=I.default.state;n=r.oA(e.map((e=>e.id))),t=v.Z.state.scrollTop}return{scrollTop:t,blockIds:n}}function H(e){let{historyId:t,currentUserId:n}=e;const r=o.Z.get({userId:n,key:t});return r?r.index:0}function G(e){let{historyId:t,historyIndex:n,currentUserId:r}=e;const i={...q(),index:n};o.Z.set({userId:r,key:t,value:i})}function W(e){let{historyId:t,currentUserId:n}=e;const r=o.Z.get({userId:n,key:t});if(!r)return;const i={...q(),index:r.index};o.Z.set({userId:n,key:t,value:i})}function $(e){let{RouterStore:t,currentUserId:n}=e;const r=t.state.id;o.Z.remove({userId:n,key:r})}},263474:(e,t,n)=>{n.d(t,{Rd:()=>Dt,fE:()=>bt,dH:()=>dt,FA:()=>Vt,xp:()=>xt,E4:()=>St,LW:()=>wt,ST:()=>gt,Z1:()=>Lt,WC:()=>ft,wo:()=>At,OO:()=>Tt,kd:()=>Ct,hY:()=>Ft,IQ:()=>ut,o9:()=>lt,HR:()=>pt,r$:()=>Pt,uO:()=>mt,KR:()=>Mt,td:()=>ht,D_:()=>ct,nN:()=>yt,rH:()=>_t,OP:()=>Ut,cG:()=>at,JW:()=>Zt,YU:()=>kt,cQ:()=>Bt,Z_:()=>vt,wN:()=>It,AL:()=>Rt,u6:()=>Kt,CV:()=>jt,HB:()=>it,pN:()=>st});n(782801),n(21703),n(757658);var o=n(815145),r=n(837167),i=n(150475),a=n(568626),s=n(471924),l=n(597213),c=n(403072),d=n(570096),u=n(145953),p=n(599405),m=n(89101),g=n(421202),f=n(933709),h=n(23867),v=n(577858),y=n(519889),b=n(766079),_=n(109852),S=n(554153),k=n(994826),w=n(709291),x=n(657347),I=n(307032),C=n(215828),T=n(401898),M=n(218265),P=n(63811),A=n(212847),R=n(772899),D=n(559183),B=n(95477),E=n(970764),F=n(512955),Z=n(321969),U=n(783105),V=n(715070),N=n(509844),O=n(80444),L=n(549065);var j=n(433929),K=n(798165),z=n(918514),q=n(548779),H=n(939270),G=n(584437),W=n(555081),$=n(710929),Y=n(775538),Q=n(601381),J=n(282356),X=n(529294),ee=n(87863),te=n(318245),ne=n(830806),oe=n(394841),re=n(74948),ie=n(938676),ae=n(436391);var se=n(600051),le=n(519511),ce=n(385555),de=n(530874),ue=n(646735),pe=n(633759),me=n(389403),ge=n(749085);class fe extends ge.default{getInitialState(){return{args:void 0}}}const he=new fe;var ve=n(242330),ye=n(193220),be=n(272014),_e=n(530539),Se=n(188923),ke=n(489523),we=n(206258),xe=n(155320),Ie=n(27724),Ce=n(992083),Te=n(170060),Me=n(934593),Pe=n(429949),Ae=n(757549),Re=n(632441),De=n(519719),Be=n(751787),Ee=n(21359),Fe=n(696454),Ze=n(547307),Ue=n(191584),Ve=n(247839),Ne=n(294273),Oe=n(792625),Le=n(497977),je=n(936110),Ke=n(325320),ze=n(587420),qe=n(731304),He=n(640277),Ge=n(504408),We=n(587531),$e=n(29974),Ye=n(61202),Qe=n(275754),Je=n(412714),Xe=n(132953),et=n(321862),tt=n(365729),nt=n(608055),ot=n(901357);const rt=(0,w.defineMessages)({errorSamlMessage:{defaultMessage:"Could not log you in.",id:"router.loginWithSamlError.message"},appleErrorMessage:{id:"loginActions.loggingInWithApple.errorMessage",defaultMessage:"Something went wrong while trying to log in with Apple."},authenticating:{id:"externalIntegrationAuthActions.authenticationWithIntegration.loadingMessage",defaultMessage:"Authorizing with integration…"},joinedTeamMessage:{id:"joinedTeam.confirmationMessage",defaultMessage:"Joined {teamName}"},backToContent:{id:"router.joinSpaceError.acceptLabel.backToContent",defaultMessage:"Back to my content"},goBack:{id:"router.joinSpaceError.acceptLabel.goBack",defaultMessage:"Go back"},thirdPartyDebugPrefix:{id:"router.debugMessage.thirdPartyError",defaultMessage:"Error from third party"},inviteLinkError:{id:"router.inviteError.message",defaultMessage:"Invite link is not valid. Please contact workspace admin."}});function it(e,t){if(F.canSetCookie(e))try{const n=new URL(t),o=n.searchParams.get("ps_partner_key"),r=n.searchParams.get("ps_xid");if(r&&o){const t={partnerKey:window.atob(o),clickId:r};return F.setS2STrackingCookie(e,t),void Re.Es({partner_stack_key:t.partnerKey})}const i=n.searchParams.get("gspk");if(i){const t=window.atob(i);return F.setPartnerStackCookie(e,t),void Re.Es({partner_stack_key:t})}}catch(n){}}async function at(e){nt.c4({environment:e,url:m._j.root,redirect:!0}),await O.default.waitUntil((()=>void 0!==O.default.state.currentSpaceStore));const{currentSpaceStore:t}=O.default.state;if(q.Cx(t)){const t=await F.getCookie(e,"notion_browser_id"),n=Boolean(t)?`?from=marketing&notionDeviceId=${t}`:"?from=marketing";Je.D({environment:e,url:`${B.default.calendar.domainBaseUrl}${n}`,targetSelf:!0})}else G.N$(e)}function st(e,t){if(t)try{const{experimentGroups:n,inviteeEmail:o,inviterName:r}=JSON.parse(window.atob(t));Be.WC(e,{invitee_email:o,invitation_experiment_groups:n}),me.Z.setState({...me.Z.state,inviteeEmail:o,inviterName:r}),o&&pe.Z.setState({...pe.Z.state,email:o})}catch(n){}}async function lt(e,t,n,o){if(!e.currentUser.id)return void nt.c4({environment:e,url:m._j.root,redirect:!0});let r;if(t.spaceId)r=t.spaceId;else{const{spaceId:t}=await Ne.Ie(e);r=t}if(Fe.Uz({nextRoute:{...t,spaceId:r},currentRoute:n,environment:e,query:""}),"search"===t.tab){if(!xe.default.state.sessionId){const t=s.Il();xe.default.update((e=>({...e,open:!1,openAsPage:!0,openedTimeMs:Date.now(),sessionId:t}))),Be.wF(e,{from:"pop"===o?"mobile-back-navigation":"mobile-bottom-bar",searchSessionId:t})}}else"updates"===t.tab&&De.Up({environment:e,from:"pop"===o?"mobile-back-navigation":"mobile-bottom-bar"})}async function ct(e,t,n){if(!e.currentUser.id)return;Fe.Uz({nextRoute:t,currentRoute:n,environment:e,query:""});const o=e.device.isElectron&&!(await Ve.quickSearchVisibilityState.isVisible());We.UT({environment:e,analyticsFrom:"quick-search",renderAsPage:!0,isQuickSearch:!0,doNotTrackOpenSearchEvent:o})}async function dt(e,t,n){e.currentUser.id&&await Fe.Uz({nextRoute:t,currentRoute:n,environment:e,query:""})}async function ut(e,t,n){if(!e.currentUser.id)return;if(e.device.isMobile)return void nt.c4({environment:e,url:m._j.root,redirect:!0});await ce.default.waitUntilStatsigReady();if(ce.default.checkGate({gateName:"inapp_mui"}))if(t.pageType&&!(0,c.GQ)(t.pageType))nt.c4({environment:e,url:m._j.gallery,redirect:!0});else if("search"!==t.pageType||t.query){const o=ce.default.checkGate({gateName:"inapp_bp"}),r=(0,Te.ho)();await Fe.Uz({nextRoute:{...t,isBuyerProfileEnabled:o,isMarketplaceCheckoutEnabled:r},currentRoute:n,environment:e,query:""});const i=n&&"gallery"===n.name?n:void 0,a=void 0!==i?{url:(0,c.cv)(B.default,i),marketplace_page_type:i.pageType??"home",product_slug:i.slug,is_previewing:"templates"===i.pageType&&i.preview}:void 0;let s={url:window.location.href,marketplace_page_type:t.pageType??"home",product_slug:t.slug,is_previewing:"templates"===t.pageType&&t.preview,from:a};const l=n&&"gallery"===n.name&&n.pageType&&!(0,c.GQ)(n.pageType),d=n&&"gallery"===n.name&&"search"===n.pageType&&!n.query;(l||d)&&(s={...s,marketplace_page_type:"home",is_redirect:!0}),Re.PB(e,{query:"",page_id:"",is_peek:!1,peek_mode:void 0,type:"marketplace",page_visit_id:void 0,previous_page_visit_id:void 0,marketplace_state:s})}else nt.c4({environment:e,url:m._j.gallery,redirect:!0});else nt.c4({environment:e,url:m._j.root,redirect:!0})}async function pt(e,t){if(!e.currentUser.id)return void nt.c4({environment:e,url:m._j.root,redirect:!0});const{id:n,type:o,from:r}=t;let i,a;if(t.spaceId)i=t.spaceId;else{const{spaceId:t}=await Ne.Ie(e);i=t}if(i){const{currentUserSettingsStore:t}=O.default.state,n=new we.r9(e,{table:b.dx,id:e.currentUser.id});if(await n.load(),void 0===O.default.state.currentSpaceStore||O.default.state.currentSpaceStore.id!==i)try{const o=ce.default.checkGate({gateName:"new_page_navigation_fix"}),r=await $e.j({environment:e,userRootStore:n,spaceId:i,navigate:!o,analyticsFrom:"redirect",userSettingsStore:t,redirectSource:"handle_new_page"});o&&O.default.setState({...O.default.state,currentSpaceViewStore:r.spaceViewStore,currentSpaceStore:r.spaceViewStore.getSpaceStore()})}catch(s){return void Ze.showMessage({message:(0,x.t)(s).message,onAccept:()=>{nt.op(e)}})}}else nt.c4({environment:e,url:m._j.root,redirect:!0}),await O.default.waitUntil((()=>void 0!==O.default.state.currentSpaceStore&&void 0!==O.default.state.currentSpaceViewStore&&void 0!==O.default.state.currentUserRootStore));if(o){if(!(0,P.Gu)(A.literals(...ve.o1),o)){const e=o;switch(e){case"page":case"team":n&&(a={type:e,spaceId:i,id:n});break;case"space":n&&(a={type:e,id:n});break;case"space-private-pages":a={type:e,spaceId:i}}}}re.quickAddPage({environment:e,from:r||"route",redirect:!0,quickAddParentOverride:a})}async function mt(e){if(e.currentUser.isLoggedIn()){await W.zJ(e)&&await W.yH(e)}else{const t=Y.default.state,n=S.Z.get($.WX);t.isOnboarding||n?nt.c4({environment:e,url:m._j.signup}):nt.c4({environment:e,url:m._j.login})}}async function gt(e,t){const{code:n,frontPathName:o}=t;if(!n)return void nt.c4({environment:e,url:m._j.signup});const r=te.default.mark("login_time.google");"fail"===(await Le.requestLoginWithGoogleOneTap({environment:e,store:pe.Z,idToken:n,frontPathName:o,googleLoginTimeMetric:r})).status&&nt.c4({environment:e,url:m._j.signup})}function ft(e){e.currentUser.isLoggedIn()||nt.c4({environment:e,url:m._j.login}),nt.c4({environment:e,url:m._j.creatorProfileIntegrations})}function ht(e,t,n){var o;if(e.device.isMobile)return;const r=Se.default.state;let a,s,l=!1,c=!1;if("page"===t.name&&t.peekViewBlockId){const{mainEditorCurrentBlockStore:e}=O.default.state;if(e){const n=we.G.createChildStore(e,{table:g.iU,id:t.peekViewBlockId});l=Boolean(t.showMoveTo),c=Boolean(t.saveParent),a=n;const o="page"===t.name&&t.peekMode?t.peekMode:void 0;s=(0,Se.getPeekModeFromUrlParam)(o)}}else if("chat"===t.name&&t.peekViewBlockId){l=!1,c=!1,a=new we.G(e,{table:g.iU,id:t.peekViewBlockId});const n="chat"===t.name&&t.peekMode?t.peekMode:void 0;s=(0,Se.getPeekModeFromUrlParam)(n)??d.R}if(!(0,i.u7)(null===(o=a)||void 0===o?void 0:o.getSystemBlockTypeStore().getValue())){if(a&&(!r.open||a.id!==r.targetStore.id||s!==r.mode)){var u,p;r.open&&qe.E(r.presenceStore,e,be.jx,r.targetStore);const t=be.jx.getCurrentPageVisitId();be.jx.initializeNewPageVisitId();const o=Ie.default.cloneState(),i=D.Z.cloneState(),m=le.Z.cloneState(),g=e.currentUser.id;Xe.jC(e,r.mode),Xe.LU(e),Xe.rM(e);const f=a.getAssociatedCollectionStore(),h=null==f?void 0:f.getLayoutStore();Re.PB(e,{page_id:a.id,collection_id:(null==f?void 0:f.id)??(null===(u=a.getCollectionViewCollectionStore())||void 0===u?void 0:u.id),layout_id:null==h?void 0:h.id,team_id:null===(p=(0,K.VP)(a))||void 0===p?void 0:p.id,is_peek:!0,peek_mode:s,type:"page",query:n,page_visit_id:be.jx.getCurrentPageVisitId(),previous_page_visit_id:t});const v=new we.G(e,a.pointer),y=new _e.Z,b=new ke.Z,S=new ye.Z;ze.bA(e,{mode:s??d.l,targetStore:v,pageVisitStore:y,presenceStore:b,showMoveTo:l,saveParent:c,loadingContainerStore:S,savedSelectionStoreState:o,savedTableSelectionStoreState:i,savedCollectionViewSelectionStoreState:m,savedSidebarExpandedStoreState:ie.sidebarExpandedStore.state}),qe._({userId:g,rootStore:v,presenceStore:b,environment:e,pageVisitIdStore:be.jx}),Ke.UX(e,{blockStore:v,pageVisitStore:y,timestamp:Date.now(),fromPageRefresh:(0,_.QG)()}),ue.Z.recordVisit({id:a.id,systemBlockType:a.getSystemBlockTypeStore().getValue(),type:U.vu.Default,currentUserId:g})}r.open&&!a&&(ze.ME(),qe.E(r.presenceStore,e,be.jx,r.targetStore),Xe.jC(e,r.mode))}}async function vt(e,t){if(e.device.isMobile)return;const{mainEditorCurrentBlockStore:n}=O.default.state;if(n)if("page"===t.name&&t.templateGalleryItem){if((0,Me.qE)()){const n=(0,I.Mt)(t.templateGalleryItem);let o=m._j.gallery;const r=await Ee.inAppGetTemplateByBlockId(e,{blockId:n},e.currentUser.id);"success"===r.type&&r.data.success&&r.data.template&&(o=(0,H.aD)(r.data.template.slug)),nt.c4({environment:e,url:o,redirect:!0})}else if("closed"===Pe.Z.state.status){const n=t.pageVisitSource===o.tY.PersonalHomeTileTemplates.toString()?"home_tile_templates":"direct_link";(0,Me.Cf)({analyticsFrom:n,cloneTo:"destination_picker",environment:e})}}else"closed"!==Pe.Z.state.status&&Pe.Z.setState({...Pe.Z.state,status:"closed"})}async function yt(e,t,n){const i=t.currentUser.isLoggedIn(),{RouterStore:s,device:l}=t,c=l.isMobileNative,d=s.state.route,u=(e,t)=>{c&&"root"!==s.state.route.name?a.log({level:"warning",from:"routerActions",type:"handleRootRedirect",data:{message:`Prevented ${e} as route has since changed to "${s.state.route.name}"]. Initial route at the start of handleRootRedirect was "${d.name}"}`}}):(c&&a.log({level:"info",from:"routerActions",type:"handleRootRedirect",data:{message:`Redirecting for ${e} as route is still root. Initial route at the start of handleRootRedirect was "${d.name}"}`}}),t())};if(i){c&&a.log({level:"info",from:"routerActions",type:"handleRootRedirect",data:{message:"Called handleRootRedirect"}});const e=await(0,q.iX)({environment:t,disableRedirectUrl:!1,blockNoAccessRedirect:!0}),{firstSpaceView:r,lastVisitedSpaceView:s,publicAccessPageId:l,oauthAuthorizationParams:d,userRootStore:m,redirectUrl:f,userSettingsStore:h,userStore:y,isPersonalHomeRedirect:b,lastVisitedUrl:_}=e;b&&(0,ne.$X)({environment:t,from:"on_app_start_page"}),await ce.default.waitUntil((()=>ce.default.state.isLoaded));await W.zJ(t,y)&&await W.yH(t);const k=Y.default.state,w=t.currentUser.id,x=S.Z.get($.WX);if(x&&i)return void(await Bt(t,x));if(d&&r&&(e.onboardingCompleted||$.BB(k))){const{responseType:e,redirectUri:n,integrationId:o,state:r,owner:i,userId:a,spaceId:s}=d;return void je.g({environment:t,responseType:e,redirectUri:n,integrationId:o,state:r,owner:i,userId:a,spaceId:s})}const I=tt.A(void 0);tt.j({currentUserId:void 0,params:void 0});const C=(null==n?void 0:n.templateGalleryItem)||(null==I?void 0:I.tg),T=(null==n?void 0:n.projectManagementLaunch)||Boolean(null==I?void 0:I.pjm);if(k.isOnboarding)if($.BB(k)){if(k.spaceViewId){const e=new we.V9(t,{table:v.zU,id:k.spaceViewId});"workspace_setup"!==k.stage&&await $e.y3({environment:t,spaceViewStore:e,userSettingsStore:h,userRootStore:m,templateGalleryItem:null==n?void 0:n.templateGalleryItem,projectManagementLaunch:null==n?void 0:n.projectManagementLaunch,pageVisitSource:o.tY.Onboarding,navigationType:"joiningOrCreatingSpace",forceLandLastVisitedPage:null==n?void 0:n.forceLandLastVisitedPage,redirect:!0})}}else nt.T4(t);else if(d&&e.onboardingCompleted){const{responseType:e,integrationId:n,redirectUri:o,state:r,owner:i,userId:a,spaceId:s}=d;je.g({environment:t,responseType:e,integrationId:n,redirectUri:o,state:r,owner:i,userId:a,spaceId:s})}else if(l&&e.onboardingCompleted){He.Hr({currentUserId:w,blockId:void 0});const e=we.G.createChildStore(m,{table:g.iU,id:l});await e.load(),Qe._c({environment:t,store:e,pageVisitSource:o.tY.Direct})}else if(r&&e.onboardingCompleted){const r=f;if(t.device.isMobile&&!e.mobileOnboardingCompleted)return void(await W.I1(t,{type:"mobile-onboarding",redirectUrl:f}));if(null!=n&&n.forceLandLastVisitedPage&&_)u("redirectUrl",(()=>{nt.c4({environment:t,url:_,redirect:!0})}));else if(r){let e=r;(T||C)&&(e=M.SK(e,{tg:C,pjm:T})),u("redirectUrl",(()=>{nt.c4({environment:t,url:e,redirect:!0})}))}else s?u("lastVisitedSpaceView",(()=>{$e.y3({environment:t,spaceViewStore:s,userRootStore:m,userSettingsStore:h,templateGalleryItem:C,projectManagementLaunch:T,pageVisitSource:o.tY.Login,navigationType:"switchingToOrLoadingSpace",forceLandLastVisitedPage:null==n?void 0:n.forceLandLastVisitedPage,redirect:!0})})):(t.device.isMobileNative&&a.log({level:"info",from:"routerActions",type:"SpaceSwitchingDebug",data:{message:"navigateToFirstSpace because handleRootRedirect"}}),u("spaceActions.navigateToFirstSpace",(()=>{$e.L5({environment:t,userRootStore:m,userSettingsStore:h,templateGalleryItem:C,projectManagementLaunch:T,pageVisitSource:o.tY.Login,forceLandLastVisitedPage:null==n?void 0:n.forceLandLastVisitedPage,redirect:!0})})))}else{var p;if(ce.default.checkGate({gateName:"trusted_domain_pages_logged_out"}))if(null!==(p=se.Z.getState())&&void 0!==p&&null!==(p=p.publicPageData)&&void 0!==p&&p.isTrustedDomainPage){const e=we.G.createChildStore(m,{table:g.iU,id:se.Z.getState().publicPageData.pageId});return await e.load(),void et.r({environment:t,store:e,pageVisitSource:o.tY.Login})}await W.I1(t,{type:"new-user",redirectUrl:f})}}else if(null!=n&&n.assistantQueryPrefill||null!=n&&n.assistantTargetRedirect){const e=(0,r.GF)({currentUrl:window.location.href,assistantQueryPrefill:null==n?void 0:n.assistantQueryPrefill,assistantTargetRedirect:null==n?void 0:n.assistantTargetRedirect}),o=(0,M.bf)({url:`${B.default.domainBaseUrl}${m._j.login}`,query:{redirectURL:e}});nt.c4({environment:t,url:o,redirect:!0})}else if(null!=n&&n.forceLandLastVisitedPage){const e=function(e){const{domainBaseLoginUrl:t,currentUrl:n,forceLandLastVisitedPage:o}=e,r=new URL(n);return o&&r.searchParams.set("target","sites_publish"),(0,M.bf)({url:t,query:{redirectURL:r.toString()}})}({domainBaseLoginUrl:`${B.default.domainBaseUrl}${m._j.login}`,currentUrl:window.location.href,forceLandLastVisitedPage:null==n?void 0:n.forceLandLastVisitedPage});nt.c4({environment:t,url:e,redirect:!0})}else nt.c4({environment:t,url:m._j.login,redirect:!0})}async function bt(e,t){const{callbackType:n,encryptedToken:o,encryptedNonce:r,code:i,error:a,encryptedUserObject:s,webBrowserDeviceId:l}=e,c=te.default.mark("login_time.apple");if("native"===n&&!t.device.isNative)return void nt.RX({url:window.location.href,environment:t});if("user_cancelled_authorize"===a)return pe.Z.setState({...pe.Z.state,loginType:"email"}),void nt.c4({environment:t,url:m._j.login});if(a||!i||!o||!r){const e=j.default.formatMessage(rt.appleErrorMessage);return pe.Z.setState({...pe.Z.state,alert:e}),void nt.c4({environment:t,url:m._j.login})}const d=await Le.loginWithAppleAuth({environment:t,encryptedToken:o,encryptedNonce:r,code:i,encryptedUserObject:s,webBrowserDeviceId:l,appleLoginTimeMetric:c});d&&(pe.Z.setState({...pe.Z.state,alert:d}),nt.c4({url:m._j.login,environment:t}))}async function _t(e,t){let n;e.userId?await Le.loginSamlUser({environment:t,userId:e.userId,isNewSignup:e.isNewSignup||!1,previousUserId:e.previousUserId}):n=e.token&&e.csrfState?await Le.loginSamlUserWithToken({environment:t,csrfState:e.csrfState,token:e.token,isNewSignup:e.isNewSignup||!1}):e.error||j.default.formatMessage(rt.errorSamlMessage),n&&(pe.Z.setState({...pe.Z.state,alert:n}),nt.c4({environment:t,url:m._j.login}))}async function St(e,t){const{callbackType:n,encryptedToken:o,code:r,error:i,webBrowserDeviceId:a}=e;if("native"===n&&!t.device.isNative)return void nt.RX({url:window.location.href,environment:t});if("access_denied"===i&&pe.Z.setState({...pe.Z.state,loginType:"email"}),i||!r||!o)return pe.Z.setState({...pe.Z.state,alert:i}),void nt.c4({environment:t,url:m._j.login});const s=await Le.loginWithGoogleAuth({environment:t,encryptedToken:o,code:r,callbackType:"native"===n||"nativeredirect"===n||"nativemailredirect"===n?n:void 0,webBrowserDeviceId:a});s&&(pe.Z.setState({...pe.Z.state,alert:s}),nt.c4({url:m._j.login,environment:t}))}async function kt(e){const{route:t,environment:n}=e;"legacy"===t.type?await async function(e){const{route:{code:t,state:n},environment:o}=e;let r;if(t&&n){const e=await Ee.authWithSlack(o,{code:t,encryptedState:n});"failed"===e.type&&(r=e.error.message)}else r="Something went wrong.";r&&Ze.deprecatedShowErrorMessage(r);const{url:i}=Ne.Vr(o);nt.c4({url:i||m._j.root,environment:o})}({environment:n,route:t}):"new"===t.type?await async function(e){const{route:{error:t},environment:n}=e;if(t){const e=j.default.formatMessage((0,E.mO)(t),{value:t});Ze.showErrorMessage(e)}else await Ye.pJ({environment:n});const{url:o}=Ne.Vr(n);nt.c4({url:o||m._j.root,environment:n})}({environment:n,route:t}):(0,T.t1)(t)}function wt(e,t){const{code:n,error:o}=e;!o&&n&&Ue.O$(t,n);const{url:r}=Ne.Vr(t);nt.c4({url:r||m._j.root,environment:t})}async function xt(e){const{route:t,environment:n}=e;let o=t.error?t.errorDescription||j.default.formatMessage((0,E.mO)(t.error),{value:t.error}):void 0;try{if(!t.notionState)throw new Error("No notionState.");const e=JSON.parse(decodeURIComponent(t.notionState));await Ye.pJ({environment:n}),await Ye.FD({environment:n,notionState:e})}catch(r){o||(o="An unknown error occurred.")}o&&Ze.deprecatedShowErrorMessage(o),nt.iy(n)}async function It(e){const{route:t,environment:n,integrationId:o,from:r,options:i}=e;let a=t.error?t.errorDescription||j.default.formatMessage((0,E.mO)(t.error),{value:t.error}):void 0;try{if(!t.state)throw new Error("No state provided.");if(!t.code)throw new Error("No code provided.");Oe.j({message:rt.authenticating});const e=await Ee.authWithExternalIntegration(n,{code:t.code,state:t.state,...t.name===p.EXTERNAL_INTEGRATION_ROUTE_NAMES.datadogAuthCallback?{accountName:t.organizationName,accountId:t.organizationId,accountDomain:t.site}:void 0});if(Oe.x(),"failed"===e.type){var s;const t="access_token_retrieval_failed"===(null===(s=e.body)||void 0===s||null===(s=s.clientData)||void 0===s?void 0:s.type)?j.default.formatMessage(rt.thirdPartyDebugPrefix):void 0;Ze.showError(e,t)}else{const{externalObjectInstanceBlockId:t,spaceId:r}=e.data;if(await Ye.pJ({environment:n}),await Ye.FD({environment:n,notionState:{externalObjectInstanceBlockId:t,spaceId:r}}),o&&(0,k.z6)(o)){const e=de.Z.bots.state.filter((e=>e.integration_id===o))[0];Ae.eR(n,{integration_id:o,configuration_type:"oauth",bot_id:null==e?void 0:e.id})}}}catch(l){a||(a=(0,x.t)(l).message)}a&&Ze.deprecatedShowErrorMessage(a),await async function(e){const{environment:t,integrationId:n,from:o}=e;if(function(e){const{currentUserRootStore:t}=O.default.state;if(!t||!e)return!1;const n=(0,L.Kv)(t,{id:e,table:N.K2}).getKeyStore("capabilities").getValue();return(0,V.ms)(n)}(n)&&!(0,k.uw)(n)){const{spaceId:e}=await Ne.Ie(t);je.g({environment:t,responseType:"code",spaceId:e,integrationId:n,redirectUri:void 0,state:void 0,owner:void 0,userId:void 0})}else"workspace_connections_redirect"!==o&&nt.iy(t)}({environment:n,integrationId:o,shouldOpenSettings:null==i?void 0:i.shouldOpenSettings,from:r})}async function Ct(e,t){const{state:n,password:o,isSignup:r,redirectURL:i,webBrowserDeviceId:a}=e,s=te.default.DO_NOT_USE_markLegacy("login_time.passcode"),l=await Le.loginWithTemporaryPasscode({environment:t,state:n,password:o,redirectURL:i,webBrowserDeviceId:a,passcodeEnterMethod:"magic_link",temporaryPasscodeLoginTimeMetric:s});l&&(pe.Z.setState({...pe.Z.state,alert:l}),r?nt.c4({url:m._j.signup,environment:t}):nt.c4({url:m._j.login,environment:t}))}async function Tt(e,t){const{args:n}=he.getState(),{webBrowserDeviceId:o}=e;n?await Le.handleLoginWithTemporaryPasscodeSuccess({environment:t,...n,webBrowserDeviceId:o}):(a.log({level:"error",from:"routerActions",type:"handleLoginSuccessRedirect",data:{message:"empty args for handleLoginSuccessRedirect"}}),nt.c4({url:m._j.root,environment:t}))}async function Mt(e,t){const{state:n,password:o}=e,r=await Le.loginPasswordReset({environment:t,csrfState:n,password:o,loginStore:pe.Z});r&&(pe.Z.setState({...pe.Z.state,loginType:"email",alert:r}),nt.c4({url:m._j.login,environment:t}))}async function Pt(e,t){_.In(e);const{userId:n,spaceId:o}=e;if(o){const e=n?[n]:t.currentUser.loggedInUserIds;for(const n of e){const e=new we.r9(t,{table:b.dx,id:n},{userId:n});await e.load();const r=e.getSpaceViewStores();if(r.length>0){await Promise.all(r.map((e=>e.load())));const e=r.find((e=>e.getSpaceId()===o));if(e)return void(await $e.ce({environment:t,spaceViewStore:e}))}}}const{currentUserRootStore:r}=O.default.state;if(r){await r.load();const e=r.getSpaceViewStores().find((e=>{var t;return Boolean(null===(t=e.getSpaceStore())||void 0===t?void 0:t.canRead())}));if(e)return void(await $e.ce({environment:t,spaceViewStore:e}))}nt.c4({environment:t,url:m._j.login,redirect:!0})}function At(e){let{environment:t,routeName:n,option:o,redirectUrl:r}=e;if((0,z.Sr)(t)){const e=M.TW({publicDomainName:B.default.publicDomainName},window.location.host);Fe.qY({spaceDomain:e,environment:t})}else!t.currentUser.isLoggedIn()||null!=o&&o.doNotRedirectWhenLoggedIn?Re.Sn(t,n):nt.c4({environment:t,url:r??m._j.root,redirect:!0})}async function Rt(e,t){const n=e.currentUser.id;if(!n)return void Nt(e);const r=new we.r9(e,{table:b.dx,id:n},{userId:n});await r.load();const i=await async function(e,t,n){if(n.spaceDomain){const t=await Ee.getIdFromUniqueId(e,{spaceDomain:n.spaceDomain,uniqueId:n.uniqueId});return"success"===t.type&&t.data.id?t.data.id:void 0}for(const o of t.getSpaceViewStores()){const t=o.getSpaceId();if(!t)continue;const r=await Ee.getIdFromUniqueId(e,{spaceId:t,uniqueId:n.uniqueId});if("failed"!==r.type&&r.data.id)return r.data.id}}(e,r,t);if(!i)return void Nt(e);const a=we.G.createChildStore(r,{table:g.iU,id:i});await a.load(),et.r({environment:e,store:a,pageVisitSource:o.tY.Direct})}async function Dt(e){const{environment:t,route:n}=e;nt.c4({environment:t,url:m._j.root,redirect:!0});const[{favoriteImportActions:o}]=await Promise.all([R.aiDependency.load(),async()=>{await O.default.waitUntil((()=>void 0!==O.default.state.currentUserSettingsStore&&void 0!==O.default.state.currentSpaceStore&&void 0!==O.default.state.currentSpaceViewStore&&void 0!==O.default.state.currentUserRootStore)),await O.default.waitUntilRendered()}]);await o.importGtmFavorite({environment:t,importArgs:n})}async function Bt(e,t){const n=He.I6({environment:e,request:{type:"invite-link",inviteLinkCode:t}}),r=(await n.next()).value;se.Z.setState({publicPageData:r});const i=()=>{S.Z.set($.WX,t),nt.T4(e)};if(e.currentUser.isLoggedIn()&&r.spaceId){const{id:n}=e.currentUser;if(n){const s=new we.U6(e,{table:y.KJ,id:n});await s.load();if(!s.getFullName(j.default.getIntl())){i();const t=await(0,q.iX)({environment:e,disableRedirectUrl:!1});return void(await W.I1(e,{type:"new-user",redirectUrl:t.redirectUrl}))}const l=new we.r9(e,{table:b.dx,id:n});await l.load();const{currentUserSettingsStore:c}=O.default.state;try{const n=await $e.j({environment:e,userRootStore:l,userSettingsStore:c,spaceId:r.spaceId,navigate:!1,analyticsFrom:"redirect",inviteCode:t,redirectSource:"handle_team_invite"});await $e.y3({environment:e,spaceViewStore:n.spaceViewStore,userSettingsStore:c,userRootStore:l,pageVisitSource:o.tY.SwitchSpace,navigationType:"joiningOrCreatingSpace",redirect:!0})}catch(a){Et(e,(0,x.t)(a).message)}}}else e.currentUser.isLoggedIn()&&!r.spaceId?Et(e,j.default.formatMessage(rt.inviteLinkError)):i()}function Et(e,t){const{currentUserRootStore:n,currentUserSettingsStore:r}=O.default.state,i=n&&r;Ze.showMessage({message:t,acceptLabel:i?j.default.formatMessage(rt.backToContent):j.default.formatMessage(rt.goBack),onAccept:()=>{S.Z.remove($.WX),i?$e.L5({environment:e,userRootStore:n,userSettingsStore:r,pageVisitSource:o.tY.Onboarding}):nt.op(e)}})}async function Ft(e){await Le.actuallyLogoutAndDeleteMostLocalData({environment:e,logoutOrigin:l.F.LogoutRouteVisited})}async function Zt(e,t){const{mainEditorCurrentBlockStore:n}=O.default.state;if(!n)return;if("page"!==t.name)return;const o=we.G.createChildStore(n,{table:g.iU,id:t.blockId}),r=t.peekViewBlockId?we.G.createChildStore(n,{table:g.iU,id:t.peekViewBlockId}):o,i=await(0,J.hp)(r),a=null==i?void 0:i.getModules().page_details;if(t.peekViewBlockId?e.WindowSizeStore.state.width<(0,X.Iy)()?ee.Z.setDisplayStyle("popup"):ee.Z.setDisplayStyle("static_sidebar"):ee.Z.setDisplayStyle(e.device.isMobile?"popup":"sidebar"),t.scrollToBlockId&&t.discussionId){const n=(0,we.Kv)(o,{table:f.qF,id:t.discussionId,spaceId:(0,h.C)(o.pointer.spaceId)});await n.load(),n.getKeyStore("resolved").getValue()&&(re.setUpdateSidebarTab(ae.gY.Comments),re.setUpdateExpand({environment:e,isExpanded:!0,from:"resolved_comment",saveDetailsSidebarPreference:!0}),re.setUpdateSidebarCommentsMode("resolved"))}else if(null!=a&&a.length){if(ae.ZP.state.expanded&&ae.ZP.state.currentTab!==ae.gY.Info)return;i&&"popup"!==ee.Z.state.displayStyle&&"closed"!==ee.Z.getOverrideForLayout(i)&&t.peekViewBlockId&&Se.default.state.preferredSidePeekWidth&&Se.default.state.preferredSidePeekWidth>(0,X.Iy)()?(0,Q.U)({environment:e,savePreference:!1,from:"info"}):i&&!t.peekViewBlockId&&"sidebar"===ee.Z.state.displayStyle&&"closed"!==ee.Z.getOverrideForLayout(i)&&(ae.ZP.state.expanded?(0,Q.n)({environment:e,savePreference:!1,from:"info"}):(0,Q.U)({environment:e,savePreference:!1,from:"info"}))}}async function Ut(e,t){"configureOpenInDesktopApp"in t&&t.configureOpenInDesktopApp&&(await ce.default.waitUntilStatsigReady(),e.device.isDesktop&&(e.device.isMac||e.device.isWindows)&&Ce.Z.setState({open:!0,openedFrom:"misc",currentTab:"user_settings",defaultSubtab:void 0,highlightedSetting:Ce.R.OpenInDesktopApp}))}function Vt(e){let t;try{t=M.$U((0,Z.W)(window.location.href))}catch{}t&&nt.c4({environment:e,url:t})}function Nt(e){const t={name:"notFound"};e.RouterStore.setState({id:(0,C.ZP)(),route:t,action:"push",initialRoute:e.RouterStore.state.initialRoute||t})}function Ot(e){nt.c4({environment:e,url:m._j.root,redirect:!0})}async function Lt(e,t){var n;const r=(0,M.Ph)(window.location.href,"pvs");if(null!==(n=e.mobileNative)&&void 0!==n&&n.supportsNativeHomeOnPhone()&&ce.default.checkGate({gateName:"allow_mobile_home_redirect"}))return void ot.d(e);if(e.device.isMobileNative)return void Ot(e);let i=e.currentUser.id;if(!i&&(nt.c4({environment:e,url:m._j.login,redirect:!0}),await O.default.waitUntil((()=>void 0!==O.default.state.currentUserStore&&void 0!==O.default.state.currentUserRootStore&&void 0!==O.default.state.currentSpaceStore)),i=e.currentUser.id,!i))return;const a=await Ee.getHomeEnabledSpaceViews(e,{});if("failed"===a.type)return void Ot(e);const{usersToSpaceViews:s}=a.data,l=[],c=new we.r9(e,{table:b.dx,id:i});for(const o of Object.values(s)){const t=u.PF.create(o.recordMap);Ge.fL({environment:e,userId:i,inMemoryRecordCache:e.defaultRecordCache.inMemoryRecordCache,recordMap:t,debugSource:"handleHomeRedirect"}),l.push(...o.homeEnabledSpaceViewIds.map((e=>we.V9.createChildStore(c,{table:v.zU,id:e}))))}const{spaceId:d}=await Ne.Ie(e),p=function(e){let{currentUserId:t,lastVisitedSpaceId:n,homeEnabledSpaceViewStores:o}=e;const r=n&&o.find((e=>e.getSpaceId()===n&&e.getParentId()===t));if(r)return r;const i=o.find((e=>e.getParentId()===t));if(i)return i;return o[0]}({currentUserId:i,lastVisitedSpaceId:d,homeEnabledSpaceViewStores:l}),g=oe.Al(p);if(!g||!p)return void Ot(e);if(await g.load(),!g.isDefined()){const t=await Ee.getUserHomePages(e,{spaceViewId:p.id,spaceId:p.getSpaceId()},p.getUserId());if("failed"===t.type||void 0===t.data.recordMap.block)return Re.AM(e,{type:"invalid_home_block_from_redirect",flow_id:"home_redirect"}),void Ot(e)}const f=r?Number(r):o.tY.PersonalHomeLink;(0,ne.$X)({environment:e,from:f===o.tY.PersonalHomeEmailLink?"email_link":"link"}),Qe._c({environment:e,store:g,peekViewBlockId:t.peekViewBlockId,peekMode:t.peekMode,pageVisitSource:f})}function jt(e){const{environment:t,redirectRoute:n,options:o}=e;if(t.currentUser.isLoggedIn())return{redirected:!1};return zt({environment:t,redirectURL:M.bf(n),options:o})}function Kt(e){const{environment:t,page:n,options:o}=e;if(t.currentUser.isLoggedIn())return{redirected:!1};return zt({environment:t,redirectURL:M.bf({url:`/${(0,I.cj)(n.blockId)}`,query:{...n.shouldDuplicate?{duplicate:"true"}:{},...n.workspaceId?{workspaceId:n.workspaceId}:{}}}),options:o})}function zt(e){const{environment:t,redirectURL:n,options:o}=e;if(t.currentUser.isLoggedIn())return{redirected:!1};const r=M.bf({url:`${B.default.domainBaseUrl}${m._j.login}`,query:{redirectURL:n}});return nt.c4({environment:t,url:r,redirect:!0,openInNew:null==o?void 0:o.openInNew}),{redirected:!0}}},321862:(e,t,n)=>{n.d(t,{r:()=>u});var o=n(915157),r=n(653965),i=n(619584),a=n(783105),s=n(798165),l=n(80444),c=n(275754);const d=10;function u(e){const{store:t,openInNew:n,environment:u,pageVisitSource:m,openInSidePeek:g,openInCenterPeek:f,peekMode:h}=e,{currentSpaceStore:v}=l.default.state;if(!t.isDefined())return;const y=t.isNavigableBlock(),{page:b,block:_}=y?{page:t,block:void 0}:{page:s.Dg(t),block:t};b&&(!_&&v&&function(e){let{currentUserId:t,spaceId:n,blockId:a}=e;const s=function(e){let{currentUserId:t,spaceId:n}=e;const r=o.Z.get({userId:t,key:p(n)});if(r){const e=(0,i.dj)(r);return Array.isArray(e)?e:[]}return[]}({currentUserId:t,spaceId:n}),l=r.jj([a,...s]).slice(0,d);o.Z.set({userId:t,key:p(n),value:JSON.stringify(l)})}({currentUserId:u.currentUser.id,spaceId:v.id,blockId:b.id}),c._c({environment:u,store:b,scrollToBlockId:_&&_.id,openInNew:n,visitType:a.vu.Search,pageVisitSource:m,queryId:e.queryId,openInSidePeek:g,openInCenterPeek:f,peekMode:h}))}function p(e){return`recentQuickJumps:${e}`}},926999:(e,t,n)=>{n.d(t,{CH:()=>u,OW:()=>m,Qk:()=>p});var o=n(815145),r=n(837167),i=n(484210),a=n(80444),s=n(188923),l=n(492973),c=n(587420),d=n(608055);function u(e){const{environment:t,store:n,peekMode:l,openInNew:u,showMoveTo:p,saveParent:m,resultsStore:g,collectionContextStore:f,pageVisitSource:h}=e,v=e.currentBlockStore??a.default.state.mainEditorCurrentBlockStore;let y;if("chat"===t.RouterStore.state.route.name&&"side_peek"===l){const e=n.getNavigableBlockStore();if(!e)return;y=(0,r.tj)({pageId:e.id,scrollToBlockId:void 0,pageVisitSource:o.tY.AIChat,isMobile:t.device.isMobile})}else y=Boolean(u)||"full_page"===l||!v?(0,i.Hu)({store:n,fullyQualified:!1,showMoveTo:p,saveParent:m,pageVisitSource:h}):(0,i.Hu)({store:v,peekViewBlockId:n.id,peekMode:(0,s.getUrlParamFromPeekMode)(l),fullyQualified:!1,showMoveTo:p,saveParent:m,pageVisitSource:h});d.c4({environment:t,url:y,openInNew:u}),c.Af({resultsStore:g,collectionContextStore:f,pageVisitSource:h})}function p(){const{resultsStore:e}=s.default.state,t=null==e?void 0:e.getState();if(s.default.state.open&&t){const{targetStore:e}=s.default.state,n=t.findIndex((t=>t.id===e.id)),{mainEditorCurrentBlockStore:r}=a.default.state;if(r&&n>0){const e=(0,i.Hu)({store:r,fullyQualified:!1,peekViewBlockId:t[n-1].id,peekMode:(0,s.getUrlParamFromPeekMode)(s.default.state.mode),pageVisitSource:o.tY.PeekScroll});d.c4({environment:r.environment,url:e}),l.zP(r.environment,{direction:"up"})}}}function m(){const{resultsStore:e}=s.default.state,t=null==e?void 0:e.getState();if(s.default.state.open&&t){const{targetStore:e}=s.default.state,n=t.findIndex((t=>t.id===e.id)),{mainEditorCurrentBlockStore:r}=a.default.state;if(r&&n<t.length-1){const e=(0,i.Hu)({store:r,fullyQualified:!1,peekViewBlockId:t[n+1].id,peekMode:(0,s.getUrlParamFromPeekMode)(s.default.state.mode),pageVisitSource:o.tY.PeekScroll});d.c4({environment:r.environment,url:e}),l.zP(r.environment,{direction:"down"})}}}},569915:(e,t,n)=>{n.d(t,{tc:()=>c,yF:()=>l});n(782801);var o=n(307032),r=n(855337),i=n(512955),a=n(80444),s=n(608055);async function l(e,t){const{utmContent:n,nextRoute:o}=t,[r,i]=await Promise.all([c(e),d(e,{utmContent:n,utmSource:"public_page"})]);s.Li({environment:e,url:o,extraSearchParams:{...r,...i}})}async function c(e){const t=await i.getPartnerStackCookie(e);if(t){return{gspk:window.btoa(t)}}const n=await i.getS2STrackingCookie(e);if(n&&n.partnerKey){return{ps_partner_key:window.btoa(n.partnerKey),ps_xid:n.clickId}}return{}}async function d(e,t){const{utmContent:n,utmSource:i}=t,s={utm_source:i,utm_content:n,tid:await(0,r.cG)(e)},{mainEditorCurrentBlockStore:l}=a.default.state;return null!=l&&l.id&&(s.utm_campaign=(0,o.F9)(null==l?void 0:l.id)),s}},365729:(e,t,n)=>{n.d(t,{A:()=>a,j:()=>i});var o=n(915157);const r="queryParamsRedirect";function i(e){let{currentUserId:t,params:n}=e;o.Z.set({userId:t,key:r,value:n})}function a(e){return o.Z.get({userId:e,key:r})}},608055:(e,t,n)=>{n.d(t,{CZ:()=>le,LU:()=>ue,Li:()=>ne,Oj:()=>ie,RX:()=>se,T4:()=>re,c4:()=>oe,eH:()=>de,iy:()=>me,j7:()=>ae,op:()=>ce,up:()=>pe});n(21703);var o=n(701302),r=n(427328),i=n(815145),a=n(599405),s=n(89101),l=n(421202),c=n(653965),d=n(215828),u=n(203303),p=n(401898),m=n(218265),g=n(21359),f=n(959151),h=n(948514),v=n(95477),y=n(855337),b=n(798165),_=n(918514),S=n(797448),k=n(334017),w=n(318245),x=n(95802),I=n(74948),C=n(224646),T=n(938676),M=n(436391),P=n(905162),A=n(80444),R=n(400807),D=n(424042),B=n(833110),E=n(577144),F=n(141737),Z=n(188923),U=n(206258),V=n(787956),N=n(632441),O=n(751787),L=n(102449),j=n(247839),K=n(514404),z=n(147678),q=n(778321),H=n(532603),G=n(294273),W=n(303898),$=n(29974),Y=n(275754),Q=n(412714),J=n(132953),X=n(78603),ee=n(901357);const te=[`${i.tY.MentionInPage}`,`${i.tY.LinkInPage}`,`${i.tY.PeekOpen}`,`${i.tY.Expand}`,`${i.tY.Duplicate}`,`${i.tY.Move}`,`${i.tY.PageTableOfContents}`];function ne(e){const t=function(e,t){try{const n=e.startsWith("/")?new URL(e,v.default.domainBaseUrl):new URL(e);if(t)for(const[e,o]of Object.entries(t))n.searchParams.append(e,o);return n.pathname+n.search+n.hash}catch{throw new Error(`${e} is neither a URL nor an absolute path`)}}(e.url,e.extraSearchParams);return oe({...e,url:`${v.default.domainBaseUrl}${t}`})}function oe(e){var t,o,r,i;const{environment:s,openInNew:c,frontPreserveScrollPosition:y,callback:b}=e,{RouterStore:x,currentUser:P}=s,z=P.id,{savedSidebarExpandedStoreState:G}=Z.default.state;G&&T.sidebarExpandedStore.setState(!0),(0,S.fastCheckGate)("page_layouts")&&k.Z.setState({isOpen:!1});const W=x.state.route,$=a.parseRoute({url:e.url,baseUrl:v.default.domainBaseUrl,publicDomainName:v.default.publicDomainName,isMobile:s.device.isMobile,protocol:v.default.protocol,currentUrl:window.location.href}),Y=e.queryId??("page"===$.name&&$.queryId),{redirect:ee,updateMobileTabbedRouterArgs:ne}=function(e,t){var n;const o={redirect:e.redirect,updateMobileTabbedRouterArgs:e.updateMobileTabbedRouterArgs};if(!_.__(e.environment))return o;"login"!==t.name&&"logout"!==t.name&&"onboarding"!==t.name||(o.redirect=!0,o.updateMobileTabbedRouterArgs={...o.updateMobileTabbedRouterArgs,clearNativeRootPageOverride:!0});(null===(n=e.updateMobileTabbedRouterArgs)||void 0===n||!n.tabbedRouterStateAlreadyUpdated)&&(e.environment.TabbedRouterStore.state.modal??[]).length>0&&(o.redirect=!0,o.updateMobileTabbedRouterArgs={...o.updateMobileTabbedRouterArgs,clearNativeRootPageOverride:!0});return o}(e,$),oe=m.gy(window.location.href),re=m.gy(e.url),ae=Boolean((null==re?void 0:re.hostname)&&(re.hostname!==(null==oe?void 0:oe.hostname)||(null==oe?void 0:oe.port)&&re.port!==oe.port));if("external"===$.name||ae)return void Q.D({environment:s,url:e.url,targetSelf:ae&&!c});const se=u.u5({schemeUrl:e.url,baseUrl:v.default.domainBaseUrl}),le=m.T1(e.url);let ce=!1,de=e.makeTabActive;const ue=B.Z.state.currentTab.isPinned;if((null===(t=D.Z.state.preferences)||void 0===t?void 0:t.isPinnedTabNewTabEnabled)&&ue&&("page"===W.name||"chat"===W.name)&&("page"===$.name||"chat"===$.name)){var pe;const e=Boolean(null==$?void 0:$.peekViewBlockId),t=Boolean((null==W?void 0:W.peekViewBlockId)&&("chat"===$.name||(null===(pe=A.default.state.mainEditorCurrentBlockStore)||void 0===pe?void 0:pe.id)===$.blockId)&&!e);e||t||(ce=!0,de=!0)}if("tab"===c||ce)return void(!s.device.isElectron||"page"!==$.name&&"chat"!==$.name&&"marketplace"!==$.name&&"gallery"!==$.name&&"settingsConsoleOrganization"!==$.name?Q.D({environment:s,url:se}):j.openInNewTab({url:le,position:"after-children",makeTabActive:de}));if("window"===c&&s.device.isElectron&&("page"===$.name||"chat"===$.name||"marketplace"===$.name||"gallery"===$.name))return void j.openInNewWindow(le);if("quickSearch"===W.name&&s.device.isElectron&&"chat"!==$.name&&!Boolean(null==K||null===(o=K.electronApi)||void 0===o?void 0:o.openTabFromQuickSearch))return void j.openQuickSearchResult(le);const me="page"===W.name&&"page"===$.name&&W.blockId===$.blockId,ge="page"===W.name&&"page"===$.name&&W.spaceDomain!==$.spaceDomain&&(W.requestedOnPublicDomain||$.requestedOnPublicDomain),fe=s.AppUpdateStore.state.appUpdate;if(!me&&!e.redirect&&L.cM(s,fe))return void L.hC({environment:s,url:le,version:fe.version,versionCreatedTime:fe.versionCreatedTime});if(h.Z.isComposingNewDiscussion()){const e=h.Z.state,t=e.open&&"comment"===e.content&&e.discussionInputStore||void 0;if(t)return void(async()=>{const{commentsDependency:e}=await Promise.resolve().then(n.bind(n,133767)),{discussionHelpers:o}=await e.load();(0,f.uK)({discussionInputStore:t,environment:s,discussionHelpers:o,reason:"navigating_away"})})()}var he;ee||me||(J.Vz({historyId:x.state.id,currentUserId:z}),"page"===W.name&&A.default.state.mainEditorCurrentBlockStore&&"translate"===(null===(he=R.Z.getStateForBlock(A.default.state.mainEditorCurrentBlockStore.id))||void 0===he?void 0:he.mode)&&q.lR({environment:s,pageStore:A.default.state.mainEditorCurrentBlockStore}),(0,C.Sx)(s)&&(I.setUpdateExpand({environment:s,isExpanded:!1,from:"close_for_space",saveDetailsSidebarPreference:!1}),M.ZP.update((e=>({...e,canRender:!1})))));if(J.LU(s),ge)return void Q.D({environment:s,url:e.url,targetSelf:!0});const ve=(0,d.ZP)();ee?window.history.replaceState({id:ve,currentUserId:s.currentUser.id},void 0,le):window.history.pushState({id:ve,currentUserId:s.currentUser.id},void 0,le);const ye=J.M3({historyId:x.state.id,currentUserId:z});if(J.UV({historyId:ve,historyIndex:ee?ye:ye+1,currentUserId:z}),"pageVisitSource"in $&&(0,p.DE)(te,$.pageVisitSource)&&N.BR(s,W,$),!me&&"page"===W.name&&V.Z.state&&(null===(r=V.Z.state)||void 0===r?void 0:r.pageId)===W.blockId&&O.Eb(s,V.Z.state),E.Z.state.initialRenderCompleted&&H.setNavigatedAfterInitialRenderCompleted(),X.ep({environment:s,id:ve,action:ee?"replace":"push",href:le,updateMobileTabbedRouterArgs:ne}).then((()=>{"page"===$.name&&!me&&Y?V.Z.setState({queryId:Y,pageId:$.blockId,timeEntered:new Date}):V.Z.reset(),"quickSearch"===W.name&&j.openTabFromQuickSearch()})).then((()=>{b&&b()})),"nativeTab"===$.name&&"assistant"===$.tab){const{currentSpaceStore:e}=A.default.state;e&&g.warmVectorDBCache(s,{spaceId:e.id})}if(me||"nativeTab"===W.name&&"page"===$.name&&(null===(i=A.default.state.mainEditorCurrentBlockStore)||void 0===i?void 0:i.id)===$.blockId||"chat"===W.name&&"chat"===$.name){const e="chat"===$.name&&$.peekViewBlockId&&A.default.state.currentSpaceStore?U.G.createChildStore(A.default.state.currentSpaceStore,{table:l.iU,id:$.peekViewBlockId}):void 0;ie(s,e)}!y&&window.scrollTo(0,0),F.Z.update((e=>({...e,isMeasuring:!0}))),w.default.DO_NOT_USE_markLegacy("initial_page_render_after_login")}function re(e){oe({environment:e,url:s._j.onboarding})}async function ie(e,t){const{RouterStore:n}=e,r=A.default.state.mainEditorCurrentBlockStore??t;if(r&&("page"===n.state.route.name||"chat"===n.state.route.name)){if(n.state.route.scrollToBlockId){const e=[n.state.route.scrollToBlockId];0===c.oA(x.C.findSelectablesFromIds(e)).length&&(await W.Nz(r,e),await o.default.afterNextFlush())}z.Y(e,{animateScrollToBlocks:!0})}}function ae(e){var t;const{environment:n,url:o}=e;if(!_.__(n))return;const{TabbedRouterStore:i}=n,s=(0,r.w_)(i.state);if("web"!==s.type)return;const l=a.parseRoute({url:o,baseUrl:v.default.domainBaseUrl,publicDomainName:v.default.publicDomainName,isMobile:n.device.isMobile,protocol:v.default.protocol,currentUrl:window.location.href}),c=(null===(t=s.redirectedTo)||void 0===t?void 0:t.route)??s.route;if(l.name!==c.name)return;const d=m.T1(e.url);s.redirectedTo?(s.redirectedTo.route=l,s.redirectedTo.url=d):(s.route=l,s.url=d)}async function se(e){const{environment:t,url:n,isMail:o}=e,r=m.T1(n);t.device.isNative?oe({url:r,environment:t}):window.location.href=m.SK(u.NV({httpUrl:o?`${v.default.domainBaseUrl}${r}`:r,protocol:o?v.default.mail.protocol:v.default.protocol,includePort:o}),{di:await(0,y.cG)(t)})}async function le(e){const{environment:t,blocks:n}=e,{mainEditorCurrentBlockStore:o,currentSpaceViewStore:r,currentUserSettingsStore:a,currentUserRootStore:s}=A.default.state,l=o&&n.find((e=>e.id===o.id));if(l&&r){const e=b.Dg(l,1);(0,P.Y)("supportsNativeHome")?_.NW(t)?ce(t):ee.d(t):e?Y._c({environment:t,store:e,pageVisitSource:i.tY.LeaveOrRemove}):await $.y3({environment:t,spaceViewStore:r,userSettingsStore:a,userRootStore:s,pageVisitSource:i.tY.LeaveOrRemove,navigationType:"switchingToOrLoadingSpace"})}Boolean(n.find((e=>{var t;return e.id===(null===(t=Z.default.peekTargetStore.state)||void 0===t?void 0:t.id)})))&&o&&Y._c({environment:t,store:o,pageVisitSource:i.tY.LeaveOrRemove})}function ce(e){_.__(e)?function(e){const{TabbedRouterStore:t}=e,n=t.state,o=(0,r.Os)(n);if(!o)return;const i=o.type;"native"===i?t.updateWithNativePage({page:o,clearPages:!1,navigationAction:"pop",navigationSource:"mobile-back-navigation"}):"web"===i?window.history.back():(0,p.t1)(i)}(e):window.history.back()}function de(){window.history.forward()}function ue(){const e=A.default.state.mainEditorCurrentBlockStore;return!!e&&!!b.Dg(e,1)}function pe(e){const t=A.default.state.mainEditorCurrentBlockStore;if(!t)return;const n=b.Dg(t,1);n&&Y._c({environment:e,store:U.G.createChildStore(n,n.pointer),pageVisitSource:i.tY.Breadcrumb})}function me(e){const{url:t}=G.Vr(e);oe({url:t||s._j.root,environment:e})}},532219:(e,t,n)=>{n.r(t),n.d(t,{getInitialPage:()=>d,initialize:()=>c});var o=n(472128),r=n(215828),i=n(918514),a=n(905162),s=n(132953),l=n(78603);async function c(e){const t=window.history.state&&window.history.state.id||(0,r.ZP)();if(!window.history.state){const n=e.currentUser.id;window.history.replaceState({id:t,currentUserId:n},void 0,window.location.href),s.UV({historyId:t,historyIndex:0,currentUserId:n})}i.__(e)&&e.TabbedRouterStore.setUp({nativeInboxEnabled:(0,a.Y)("supportsNativeInbox")}),await l.ep({environment:e,id:t,action:"pop",href:window.location.href,updateMobileTabbedRouterArgs:{forceUpdate:!0,silenceErrors:!0,clearNativeRootPageOverride:"/"!==window.location.pathname},enableDesktopAppRedirect:!0});const n=e.currentUser.id,c=d(n);if(!c||"undefined"===c){const e=window.location.pathname;e&&function(e){let{currentUserId:t,value:n}=e;o.Z.set({userId:t,key:"sourceInitialPage",value:n})}({currentUserId:n,value:e})}}function d(e){return o.Z.get({userId:e,key:"sourceInitialPage"})}},78603:(e,t,n)=>{n.d(t,{ep:()=>Me});var o=n(817673),r=n(350112),i=n(915157),a=n(890850),s=n(599405),l=n(89101),c=n(407678),d=n(109852),u=n(421838),p=n(922121),m=n(712139),g=n(937850),f=n(218265),h=n(244458),v=n(95477),y=n(296994),b=n(401898),_=n(304708),S=n(548779),k=n(997156);function w(e){let{environment:t,spaceStore:n}=e;(function(e){let{environment:t,spaceStore:n}=e;if(!n||!(0,S.Cx)(n)||!(0,_.Ye)())return!1;const o=null==n?void 0:n.getDisableGuestMembershipRequests();if((0,b.$K)(o)&&!1===o)return!0;if(!(0,b.$K)(o)){const e=null==n?void 0:n.getPublicSpaceData();if((0,b.$K)(e)&&!1===e.disableGuestMembershipRequests)return!0}return!1})({environment:t,spaceStore:n})&&k.Z.open()}var x=n(855337),I=n(120315),C=n(778873),T=n(918514),M=n(408655),P=n(811265),A=n(815145),R=n(321862),D=n(457345),B=n(28578),E=n(817856),F=n(117431);var Z=n(80444),U=n(521273),V=n(385555),N=n(596071),O=n(661802),L=n(945946),j=n(757118),K=n(575649),z=n(170060),q=n(288280),H=n(965928),G=n(632441),W=n(286572),$=n(696454),Y=n(91376),Q=n(587531),J=n(139634),X=n(492022),ee=n(74948),te=n(594419),ne=n(709953),oe=n(898104),re=n(210228);async function ie(e){const{environment:t,prefill:n}=e,o=await(0,ee.quickAddPage)({environment:t,from:"ai_writer_deeplink",pageVisitSource:A.tY.AiWriterDeeplink});if(!o)return;const{performResult:r}=re.createAndCommit({userAction:"routerStateActions.aiWriterDeeplink",environment:t,perform:e=>{const n=o.useCrdt(),r=ne.j4({environment:t,type:"text",inMemoryRecordCache:o.inMemoryRecordCache,transaction:e,spaceId:o.pointer.spaceId,useCrdt:n});return te.R3({parentStore:o.getContentStore(),appendStore:r,transaction:e}).childStore}}),i=r.getTitleStore();i&&oe.setSelection({store:i}),await async function(e){const{environment:t,prefill:n}=e;await g.Vs(1e3),(0,X.openHelpMeWriteGenericPopup)({environment:t,from:"deeplink",prefilledValue:n??""})}({environment:t,prefill:n})}var ae=n(275754),se=n(159730),le=n(709291),ce=n(307032),de=n(833954),ue=n(433929),pe=n(21359),me=n(547307),ge=n(29974),fe=n(608055);const he=(0,le.defineMessages)({goBack:{id:"router.githubStudentCallback.goBack",defaultMessage:"Go back"},studentPackUpgradeSuccess:{id:"router.githubStudentCallback.success.message",defaultMessage:"Your workspace has been upgraded to the Education Plus plan."},studentPackUpgradeError:{id:"router.githubStudentCallback.error.message",defaultMessage:"Failed to upgrade to the Education Plus plan. Please try again or reach out to team@makenotion.com."},studentPackUpgradeNoCode:{id:"router.githubStudentCallback.noCode.message",defaultMessage:"Failed to authenticate your GitHub account. Please try again later."},studentPackUpgradeNotStudent:{id:"router.githubStudentCallback.notStudent.message",defaultMessage:"We couldn't verify your student status. Please try again."},studentPackUpgradeNoSpace:{id:"router.githubStudentCallback.noSpace.message",defaultMessage:"We could not locate your workspace. Please try again."}});var ve=n(263474),ye=(n(21703),n(568626)),be=n(421202),_e=n(475246),Se=n(930106),ke=n(206258);function we(){return V.default.checkGate({gateName:"relaunch_duplication_flow",disableExposureLogging:!1})}var xe=n(403297),Ie=n(476795);const Ce=new Set(["1d2d0ce4-3be0-49e4-92ca-3bb0c3de1a6e","6f574aa0-ea3e-4039-bd12-eef2b9c797e1","c92bcc92-bae6-4018-ba72-626108d28bb1","46ec1b0e-c5d5-4476-99c1-0dc578190279","b1b35f81-c752-4251-94de-5813c850d159"]);async function Te(e,t){if(!e.currentUser.isLoggedIn())return xe.nM({currentUserId:void 0,blockId:t.blockId}),void ve.u6({environment:e,page:t});await async function(e,t){Se.Z.reset(),await Promise.all([Z.default.waitUntil((()=>void 0!==Z.default.state.currentUserRootStore))]);const{currentUserRootStore:n}=Z.default.state;if(void 0===n)throw new Error("User root is not defined.");const{blockId:o,workspaceId:r}=t,i=ke.G.createChildStore(n,{table:be.iU,id:o}),a=r&&(0,ce.qn)(r)?ke.H2.createChildStore(n,{table:_e.bx,id:(0,ce.Mt)(r)}):void 0;await Promise.all([i.load(),null==a?void 0:a.load(),V.default.waitUntilStatsigReady()]),fe.c4({environment:e,url:l._j.root,callback:()=>{!async function(e){const{environment:t,currentUserRootStore:n,blockStore:o,spaceStore:r,isFromTemplateGallery:i}=e;if(r&&function(e){let{blockStore:t,spaceStore:n}=e;if(!t.isReady()||!n.isReady()||!n.canEdit())return!1;const o=t.getParentId();return!!o&&Ce.has(o)}({blockStore:o,spaceStore:r}))return Se.Z.setState({open:!1,isFromTemplateGallery:i}),void(await async function(e){const{environment:t,currentUserRootStore:n,blockStore:o,spaceStore:r}=e;if(!o.isReady()||!r.isReady()||!r.canEdit())return;const i=n.getSpaceViewPointers().find((e=>e.spaceId===r.id));if(!i)return;const a=ke.V9.createChildStore(n,i);await a.load(),await(0,Ie.JI)({environment:t,blockStore:o,spaceStore:r,spaceViewStore:a})}({environment:t,currentUserRootStore:n,blockStore:o,spaceStore:r}));Se.Z.setState({open:!0,variant:we()?"modal":"screen",blockStore:o,spaceStore:void 0,spaceViewStore:void 0,teamStore:void 0,isFromTemplateGallery:i})}({environment:e,currentUserRootStore:n,blockStore:i,spaceStore:a,isFromTemplateGallery:"notion_template_gallery"===t.from})}})}(e,t).catch((n=>{ye.log({level:"error",from:"templateRouteActions.handleTemplateDuplicationRoute",type:"handleTemplateDuplicationRouteForLoggedInUsersError",data:{miscDataToConvertToString:{nextRoute:t}},error:n}),fe.c4({environment:e,url:l._j.root})}))}async function Me(e){const{id:t,action:b,href:_,environment:S,updateMobileTabbedRouterArgs:k}=e,{RouterStore:X,currentUser:ee,TabbedRouterStore:te}=S,[ne,oe]=s.getRouteAndPattern({url:_,isMobile:S.device.isMobile,baseUrl:v.default.domainBaseUrl,publicDomainName:v.default.publicDomainName,protocol:v.default.protocol,currentUrl:window.location.href});m.FB(ne.name),p.setRouteTags(ne,oe);const re=X.state.route,le=i.Z.get({userId:ee.id,key:t});X.setState({id:t,historyState:le,action:b,route:ne,initialRoute:X.state.initialRoute||ne}),re&&ne&&O.Z.markNavigationStartTime(re,ne);if("page"===(null==re?void 0:re.name)&&"page"===ne.name&&ne.blockId!==re.blockId&&ae.qV({environment:S,targetId:re.blockId}),null!=k&&k.forceUpdate||T.__(S)&&(null==k||!k.tabbedRouterStateAlreadyUpdated)){const Me={type:"web",url:f.T1(_),route:ne};te.updateWithWebPage({page:Me,action:null!=k&&k.forceUpdate?"replace":b,updateMobileTabbedRouterArgs:k})}const ye=f.Qc(_),be=ye.query[c.Vt];be&&(0,a.Zj)({currentUserId:ee.id,promoCode:be});const _e=ye.query[r.gS];_e&&((0,d.ob)(_e),Pe(r.gS)),"page"===ne.name||s.callbackRoutes[ne.name]||G._W(S,_);const{target:Se,subtarget:ke}=function(e){if(!e)return{target:void 0};const t=null==e?void 0:e.indexOf(".");if(-1===t)return{target:e};return{target:e.substring(0,t),subtarget:e.substring(t+1)}}(ye.query.target),we=f.T1(_),xe=o.parse(we.split("?")[1]||""),Ie="aq",Ce=xe[Ie]&&String(xe[Ie]);if(Se&&function(e){let{environment:t,target:o,subtarget:r,assistantQueryPrefill:i,assistantQueryPrefillKey:a}=e;if("intercom"===o)J.j_({environment:t,from:"query_param"}),Pe("target");else if(t.device.isMobileBrowser&&"plans"===o){async function s(){if(await V.default.waitUntilStatsigReady(),!(0,z.bQ)())return;const e=await y.FF.payments.load(),n=Z.default.state.currentSpaceStore;e.plans.canShowPlans(n)&&await e.plans.showPlans({environment:t,from:"deeplink"}),Pe("target")}Ae({timeoutMs:3e3,effect:s})}else if(t.device.isMobileBrowser&&"billing"===o){async function l(){if(await V.default.waitUntilStatsigReady(),!(0,z.bQ)())return;const e=Z.default.state.currentSpaceStore,n=q.subscriptionDataStoreInstance.state,o=await y.FF.payments.load();e&&n&&o.billing.canShowBilling({subscriptionData:n,spaceStore:e})&&o.billing.showBilling({environment:t,from:"deeplink"}),Pe("target")}Ae({timeoutMs:3e3,effect:l})}else if("billing"===o||"plans"===o||"members"===o||"audit_log"===o||"connected_apps"===o||"identity_provisioning"===o||"analytics"===o||"admin_content_search"===o||"profile"===o||"notifications_and_settings"===o||"user_settings"===o||"notifications"===o||"language_and_region"===o||"settings"===o||"integrations"===o||"sites"===o||"imports"===o||"security"===o)Y.r$({currentTab:o,subtab:r,isMobile:t.device.isMobile,openedFrom:"email"}),Pe("target");else if("contact_us"===o)(0,j.n)({openedFrom:"contact_us_deeplink"}),Pe("target");else if("quickfind"===o)Promise.race([async()=>{await Z.default.waitUntil((()=>void 0!==Z.default.state.currentUserSettingsStore&&void 0!==Z.default.state.currentSpaceStore&&void 0!==Z.default.state.currentSpaceViewStore&&void 0!==Z.default.state.currentUserRootStore)),await Z.default.waitUntilRendered(),Q.UT({environment:t,analyticsFrom:"deeplink"})},g.Vs(1500).then((()=>{Q.UT({environment:t,analyticsFrom:"deeplink"})}))]),Pe("target");else if("qna"===o){const c=async()=>{if(await V.default.waitUntilStatsigReady(),(0,I.AC)(t),!U.Z.isQnaRightSideDeeplinkEnabled()||U.Z.isQnATooltipsVisible(t.device,Z.default.state.currentUserSettingsStore))return;const{assistantDependency:e}=await Promise.resolve().then(n.bind(n,81598)),o=await e.load();o.assistantMenuActions.openAssistantRightHandSideMenu({environment:t,from:"deeplink"}),i&&(Pe(a),o.assistantMenuActions.setPrimeTextInput(i))};Ae({timeoutMs:1500,effect:()=>(Pe("target"),c())})}else if("ai_writer"===o)Ae({timeoutMs:3e3,effect:()=>(Pe("target"),i&&Pe(a),(0,I.AC)(t),ie({environment:t,prefill:i}))});else if("slack_qna"===o){const d="deeplink";(0,h.navigateToSlackUniversalQnAOnboarding)({analyticsFrom:d})}else if("google_drive_qna"===o){const u="deeplink";(0,h.navigateToGoogleDriveUniversalScreen)({analyticsFrom:u,screenToShow:"info_screen"})}else if("guest_to_member"===o){(async()=>{const e=async()=>{var e;await Z.default.waitUntil((()=>void 0!==Z.default.state.currentSpaceStore)),await Promise.all([null===(e=Z.default.state.currentSpaceStore)||void 0===e?void 0:e.waitUntil((()=>{var e;return!(null===(e=Z.default.state.currentSpaceStore)||void 0===e||!e.isReady())})),V.default.waitUntilStatsigReady()])};await Promise.race([e(),g.Vs(3e3)]),w({environment:t,spaceStore:Z.default.state.currentSpaceStore})})(),Pe("target")}else if("add_pro_account"===o)Ae({timeoutMs:3e3,effect:()=>new Promise((()=>{N.v.setState({open:!0,isForAddingProAccount:!0}),Pe("target")}))});else if("add_another_account"===o)Ae({timeoutMs:3e3,effect:()=>new Promise((()=>{N.v.setState({open:!0}),Pe("target")}))});else if("sites_publish"===o)Ae({timeoutMs:3e3,effect:()=>(Pe("target"),async function(e){const t=await E.D();t&&R.r({environment:e,store:t,pageVisitSource:A.tY.SitesTooltipsTourDeeplink}),await Promise.race([(async()=>{await B.ZP.waitUntil((()=>B.ZP.getIsInitialized()))})(),g.Vs(3e3)]),D.lG(e),B.ZP.setState({...B.ZP.state,display:B.wV.Publish,tab:B.XF.Publish})}(t))});else if("sites_tooltips_tour"===o)Ae({timeoutMs:3e3,effect:()=>async function(e){const t=e.device.isMobile,n=await E.D();if(n&&R.r({environment:e,store:n,pageVisitSource:A.tY.SitesTooltipsTourDeeplink}),t){const t=async()=>{await B.ZP.waitUntil((()=>B.ZP.getIsInitialized()))};await Promise.race([t(),g.Vs(3e3)]),D.lG(e),B.ZP.setState({...B.ZP.state,display:B.wV.Publish,tab:B.XF.Publish})}else F.P({environment:e,type:"try_notion_sites_new_page"})}(t)});else if("trial"===o){(async()=>{const e=async()=>{var e;await Z.default.waitUntil((()=>void 0!==Z.default.state.currentSpaceStore)),await Promise.all([null===(e=Z.default.state.currentSpaceStore)||void 0===e?void 0:e.waitUntil((()=>{var e;return!(null===(e=Z.default.state.currentSpaceStore)||void 0===e||!e.isReady())})),V.default.waitUntilStatsigReady()])};await Promise.race([e(),g.Vs(3e3)]),(0,z.rD)()&&(0,K.y)(t,{from:"trial_deeplink",for:"plus",isTrial:!0})})(),Pe("target")}}({environment:S,target:Se,subtarget:ke,assistantQueryPrefill:Ce,assistantQueryPrefillKey:Ie}),"googleOneTapRedirect"!==ne.name)if("samlAuthCallback"!==ne.name)if("appleAuthCallback"!==ne.name)if("googleAuthCallback"!==ne.name)if(await V.default.waitUntil((()=>V.default.state.isLoaded)),"settingsConsoleWorkspace"!==ne.name)if(e.enableDesktopAppRedirect&&function(e){const{route:t}=e.RouterStore.state;return s.desktopDeepLinkingRoutes[t.name]&&"always"===L.Z.state&&e.device.isDesktop&&e.device.isBrowser&&(e.device.isMac||e.device.isWindows||!1)&&(!("configureOpenInDesktopApp"in t)||!t.configureOpenInDesktopApp)}(S))ve.FA(S);else{if("root"===ne.name){const Re=Array.isArray(xe.target)?xe.target[0]:xe.target,De="sites_publish"===Re||S.device.isMobile&&"sites_tooltips_tour"===Re,Be={templateGalleryItem:ne.templateGalleryItem,projectManagementLaunch:"true"===(Array.isArray(xe.pjm)?xe.pjm[0]:xe.pjm),assistantQueryPrefill:Array.isArray(xe.aq)?xe.aq[0]:xe.aq,assistantTargetRedirect:"qna"===Re||"ai_writer"===Re?Re:void 0,forceLandLastVisitedPage:De};ve.nN(ne,S,Be)}else if("onboarding"===ne.name)ve.uO(S);else if("modal"===ne.name)if(S.currentUser.isLoggedIn()){let Ee="/";ne.projectManagementLaunch?Ee+="?tg=gallery":ne.templateGalleryItem&&(Ee+=`?tg=${ne.templateGalleryItem}`),fe.c4({environment:S,url:Ee,redirect:!0})}else fe.c4({environment:S,url:l._j.login,redirect:!0});else if("googleDriveAuthCallback"===ne.name)ve.LW(ne,S);else if("slackAuthCallback"===ne.name)ve.YU({route:ne,environment:S});else if(ne.name===s.EXTERNAL_INTEGRATION_ROUTE_NAMES.datadogAuthCallback)ve.wN({route:ne,environment:S});else if("externalAuthCallback"===ne.name)ve.xp({route:ne,environment:S});else if(ne.name===s.EXTERNAL_INTEGRATION_ROUTE_NAMES.authCallback)ve.wN({route:ne,environment:S});else if("loginWithEmailCallback"===ne.name)ve.kd(ne,S);else if("loginSuccessCallback"===ne.name)ve.OO(ne,S);else if("passwordResetCallback"===ne.name)ve.KR(ne,S);else if("passwordChangeRedirect"===ne.name)fe.Li({environment:S,url:l._j.login}),C.E({environment:S});else if("logout"===ne.name)ve.hY(S);else if("login"===ne.name||"signup"===ne.name){ve.HB(S,_),Boolean(xe.showNotionCalendarModal)&&await ve.cG(S);const Fe={doNotRedirectWhenLoggedIn:Boolean(xe.newSignup)};ve.wo({environment:S,routeName:ne.name,option:Fe,redirectUrl:xe.redirectURL&&String(xe.redirectURL)})}else if("oauthAuthorization"===ne.name)ve.r$(ne,S);else if("page"===ne.name||"space"===ne.name){if(ve.HB(S,_),ve.pN(S,ne.state),"page"===ne.name&&ne.shouldDuplicate)return void(await Te(S,ne));$.Uz({nextRoute:ne,currentRoute:re,environment:S,query:we}),await ve.Z_(S,ne),await ve.JW(S,ne)}else if("templatesRedirect"===ne.name)fe.c4({environment:S,url:(0,T.UY)("templateGallery"),redirect:!0});else if("communityRedirect"===ne.name)fe.c4({environment:S,url:(0,T.UY)("community"),redirect:!1});else if("guideRedirect"===ne.name)fe.c4({environment:S,url:(0,T.UY)("guides.guides"),redirect:!0});else if("invoiceRedirect"===ne.name)fe.c4({environment:S,url:l._j.root,redirect:!0});else if("termsRedirect"===ne.name)fe.c4({environment:S,url:(0,T.UY)("terms"),redirect:!0});else if("contentPolicyRedirect"===ne.name)fe.c4({environment:S,url:(0,T.UY)("contentPolicy"),redirect:!0});else if("uiDoc"===ne.name)fe.c4({environment:S,url:l._j.root,redirect:!0});else if("exportPreview"===ne.name)fe.c4({environment:S,url:l._j.root,redirect:!0});else if("admin"===ne.name)v.default.isAdminMode||fe.c4({environment:S,url:l._j.root,redirect:!0});else if("team"===ne.name)Ae({timeoutMs:3e3,effect:async()=>{await V.default.waitUntilStatsigReady(),(0,P.U)({disableExposureLogging:!0}),fe.c4({environment:S,url:l._j.root,redirect:!0})}});else if("teamInvite"===ne.name)ve.cQ(S,ne.inviteCode);else if("teamsInvite"===ne.name)S.currentUser.isLoggedIn()||fe.c4({environment:S,url:l._j.signup,redirect:!0});else if("aiGtmFavoriteImport"===ne.name)ve.Rd({environment:S,route:ne});else if("new"===ne.name)ve.HR(S,ne);else if("myIntegrations"===ne.name)ve.WC(S);else if("creatorProfile"===ne.name||"creatorProfileAnalytics"===ne.name)ve.CV({environment:S,redirectRoute:{url:l._j.creatorProfile}});else if("creatorProfileTemplates"===ne.name)ve.CV({environment:S,redirectRoute:{url:l._j.creatorProfileTemplates}});else if("creatorProfileIntegrations"===ne.name)ve.CV({environment:S,redirectRoute:{url:l._j.creatorProfileIntegrations}});else if("unknown"===ne.name)fe.c4({environment:S,url:l._j.root,redirect:!0});else if("nativeTab"===ne.name)ve.o9(S,ne,re,b);else if("quickSearch"===ne.name)await ve.D_(S,ne,re);else if("chat"===ne.name){async function Ze(){if(Ce){Pe(Ie);const{assistantDependency:e}=await Promise.resolve().then(n.bind(n,81598)),{assistantMenuActions:t,assistantActions:o}=await e.load(),r=Ce.length>Q.LR&&S.device.isElectron;if(t.setPrimeTextInput(r?void 0:Ce),r){const e=await o.resetAndInitializeAssistantSession({environment:S});o.commitHumanStep({environment:S,text:(0,u.TPx)(Ce),sessionId:e.sessionId,assistantSurfaceType:"searchPane"})}}Pe("persona")}await ve.dH(S,ne,re),Ae({timeoutMs:3e3,effect:Ze})}else if("marketplace"===ne.name||"gallery"===ne.name)await ve.IQ(S,ne,re);else if("uniqueId"===ne.name)await ve.AL(S,ne);else if("signupWithTrial"===ne.name){const Ue=ne.trialUpsell;(0,x.j)({environment:S,event:{eventName:"upsell_link_visit",eventProperties:{source:Ue}}}),"perfmark"===Ue&&S.device.isMobile&&fe.c4({environment:S,url:l._j.signup,redirect:!0}),(0,H.zQ)(Ue,S),(0,H.O1)(Ue)&&W.ms(S,{source:Ue}),"perfmark"===Ue&&S.currentUser.isLoggedIn()&&V.default.checkGate({gateName:"enable_smb_trial_onboarding_flow"})&&(M.Z.setState({open:!0,isExistingUser:!0}),ve.CV({environment:S,redirectRoute:{url:l._j.root}})),fe.c4({environment:S,url:l._j.signup,redirect:!0})}else"home"===ne.name?ve.Z1(S,ne):"githubStudentPackAuthCallback"===ne.name&&async function(e,t){const n=t.code;if(!n)return void me.showMessage({message:ue.default.formatMessage(he.studentPackUpgradeNoCode),acceptLabel:ue.default.formatMessage(he.goBack),onAccept:()=>{fe.c4({environment:e,url:l._j.githubStudentPackHome,redirect:!0})}});const o=await pe.authenticateGithubStudent(e,{code:n});if("success"!==o.type||!o.data.student)return me.showErrorMessage(ue.default.formatMessage(he.studentPackUpgradeNotStudent)),void fe.c4({environment:e,url:l._j.githubStudentPackHome});if(!t.state)return me.showErrorMessage(ue.default.formatMessage(he.studentPackUpgradeNoSpace)),void fe.c4({environment:e,url:l._j.githubStudentPackHome});const r=(0,ce.Mt)(t.state);try{await pe.applyStudentGitHubGrant(e,{spaceId:r,code:n})}catch(i){if((0,se.Cx)(i)){const e=(0,de.nX)(ue.default.getIntl(),i.body);e&&me.showErrorMessage(e)}else me.showErrorMessage(ue.default.formatMessage(he.studentPackUpgradeError));return void fe.c4({environment:e,url:l._j.githubStudentPackHome})}me.showMessage({message:ue.default.formatMessage(he.studentPackUpgradeSuccess),acceptLabel:ue.default.formatMessage(he.goBack),onAccept:async()=>{const{currentUserRootStore:t,currentUserSettingsStore:n}=Z.default.state,o=null==t?void 0:t.getSpaceViewStores(),i=null==o?void 0:o.find((e=>e.getSpaceId()===r));i?await ge.y3({environment:e,spaceViewStore:i,userRootStore:t,userSettingsStore:n,pageVisitSource:A.tY.SwitchSpace,navigationType:"switchingToOrLoadingSpace"}):fe.c4({environment:e,url:l._j.githubStudentPackHome})}})}(S,ne);s.isAppRoute(ne)&&(ve.td(S,ne,we),ve.OP(S,ne))}else fe.c4({environment:S,url:l._j.root,redirect:!0});else ve.E4(ne,S);else ve.fE(ne,S);else ve.rH(ne,S);else ve.ST(S,{code:ne.code,frontPathName:ne.frontPathName})}function Pe(e){const t=f.T1(f.iO(window.location.href,e));window.history.replaceState(history.state,void 0,t)}function Ae(e){const{timeoutMs:t,effect:n}=e;(async()=>{await function(e){const{timeoutMs:t}=e;return Promise.race([Z.default.waitUntil((()=>void 0!==Z.default.state.currentUserSettingsStore&&void 0!==Z.default.state.currentSpaceStore&&void 0!==Z.default.state.currentSpaceViewStore&&void 0!==Z.default.state.currentUserRootStore)),g.Vs(t)])}({timeoutMs:t}),await n()})()}},240468:(e,t,n)=>{n.d(t,{Fm:()=>f,PR:()=>m,TT:()=>p});var o=n(933147),r=n(973744),i=n(783105),a=n(484210),s=n(897638),l=n(247839),c=n(587531),d=n(275754),u=n(321862);const p=new o.Z;function m(e){const{searchResult:t,environment:n}=e,o="page"===t.type?(0,s.dy)(t):t.store.id;n.device.isElectron?function(e){const{searchResult:t,scrollToBlockId:n,electronTabSearch:o,openInNew:r,context:i,pageVisitSource:s}=e;if(!o)return;const{isNewTab:c}=o,{store:d}=t,u=d.id,p=(0,a.ZP)({pageVisitSource:s,store:d,scrollToBlockId:n}),m=o?o.tabs.find((e=>e.pageId===u)):void 0,f=Boolean(r),h="tabs"===i||"query_results"===i;if(m&&!f&&h)return void l.handleTabClicked(m.id);const v=m&&f;if(c)return void l.openNotionUrl({makeTabActive:!v,url:p,position:"end",isNewPage:"new_page"===i,openInNew:r??"tab"});g({...e,scrollToBlockId:n})}({...e,scrollToBlockId:o}):g({...e,scrollToBlockId:o})}function g(e){const{searchResult:t,environment:n,openInNew:o,pageVisitSource:r,queryId:a,scrollToBlockId:s}=e,{store:l}=t;void 0===s?u.r({store:l,openInNew:o,environment:n,pageVisitSource:r,queryId:a}):d._c({environment:n,store:l,scrollToBlockId:s,openInNew:o,visitType:i.vu.Search,pageVisitSource:r,queryId:a})}function f(e){let{environment:t,event:n,tabId:o,url:i}=e;c.IB({environment:t,reset:!1});const a=r.DJ(n);a?l.openNotionUrl({makeTabActive:!1,url:i,position:"end",openInNew:a??"tab"}):l.handleTabClicked(o)}},901357:(e,t,n)=>{n.d(t,{S:()=>_,d:()=>S});n(757658);var o=n(427328),r=n(568626),i=n(599405),a=n(653965),s=n(215828),l=n(95477),c=n(918514),d=n(80444),u=n(385555),p=n(803418),m=n(250906),g=n(519719),f=n(210228),h=n(239865),v=n(608055),y=n(240468);function b(e){return"web"===e.type&&"nativeTab"===e.route.name&&"search"===e.route.tab}function _(e){var t,n,p,_,S;const{environment:k,tab:w,navigationAction:x,navigationSource:I}=e,{TabbedRouterStore:C,currentUser:T}=k;if(!c.__(k))return;"updates"!==w&&g.nI(k);const M=C.state.activeTab,P=(0,o.w_)(C.state),A=a.Xh(C.state);A.activeTab=w,A.navigationAction=x,A.navigationSource=I;let R=!1;if(void 0!==e.nativeRootPageOverrideEnabled&&(R=A.tabs[A.activeTab].nativeRootPageOverrideEnabled!==e.nativeRootPageOverrideEnabled,A.tabs[A.activeTab].nativeRootPageOverrideEnabled=e.nativeRootPageOverrideEnabled),a.Xy(e.modal,A.modal)||(R=!0,A.modal=e.modal??[]),void 0!==e.pages&&0===((null===(t=e.modal)||void 0===t?void 0:t.length)??0)){const t=e.pages.map((e=>{const t=(0,o.Gt)(e,!0),n=i.parseRoute({url:t,baseUrl:l.default.domainBaseUrl,publicDomainName:l.default.publicDomainName,isMobile:k.device.isMobile,protocol:l.default.protocol,currentUrl:window.location.href});return{...e,route:n}})),n=A.tabs[A.activeTab].pages;R||=!a.Xy(n,t),A.tabs[A.activeTab].pages=t}b(P)&&!b((0,o.w_)(A))&&y.TT.emit(Date.now()),C.setState(A);const D="addPage"===w;if(C.state.activeTab===M&&!R&&!D)return;const B=d.default.state.mainEditorCurrentBlockStore,E="web"===P.type&&(null===(n=P.redirectedTo)||void 0===n?void 0:n.route)&&"page"===(null===(p=P.redirectedTo)||void 0===p?void 0:p.route.name)&&(null===(_=P.redirectedTo)||void 0===_?void 0:_.route.showMoveTo),F=B&&(null==B?void 0:B.canEdit())&&B.isEmptyTitle()&&B.isEmptyPage();"addPage"===M&&E&&F&&T.isLoggedIn()&&f.createAndCommit({userAction:"routerActions.navigateToTab",environment:k,perform:e=>{h.y8({environment:k,blocks:[B],transaction:e}),e.postSubmitCallbacks.push((e=>{e||m.dh(k,{analyticsName:"delete",from:"mobile_navigation",block_id:B.id,block_type:"page"})}))}});const Z=(null===(S=A.modal)||void 0===S?void 0:S.filter((e=>"web"===e.type)))??[],U=u.default.checkGate({gateName:"mobile_nav_skip_add_page_check"}),V=C.state.tabs[w],{rootPage:N,pages:O}=V;let L=!1;switch(N.type){case"native":break;case"web":if(O.length+Z.length===0||D&&!U)v.c4({environment:k,redirect:!0,url:(0,o.Gt)(N,!0,{...e.queryParams,...N.queryParams,type:"space-private-pages",from:"mobile_bottom_bar"}),updateMobileTabbedRouterArgs:{tabbedRouterStateAlreadyUpdated:!0}});else{L=!0;const e=(0,s.ZP)();window.history.replaceState({id:e,currentUserId:k.currentUser.id},void 0,(0,o.Gt)(N))}}if(D&&!U)return;const j=!0===A.tabs[A.activeTab].nativeRootPageOverrideEnabled,K=Z[Z.length-1];Z.length>1&&r.log({level:"error",from:"tabNavigationActions",type:"navigateToTab",data:{message:`TabbedRouterStore only support 1 modal page for now. ${Z.length} is detected`}}),O.forEach(((e,t)=>{if(!j&&t===O.length-1&&!K){let t=(0,o.Gt)(e);return"/blank"===t&&(t="/nativetab/empty"),void v.c4({environment:k,redirect:!L,url:t,updateMobileTabbedRouterArgs:{tabbedRouterStateAlreadyUpdated:!0}})}if(j&&0===t)return;const n=(0,s.ZP)(),r=(0,o.Gt)(e);L?window.history.pushState({id:n,currentUserId:k.currentUser.id},void 0,r):(L=!0,window.history.replaceState({id:n,currentUserId:k.currentUser.id},void 0,r))})),K&&"web"===K.type&&v.c4({environment:k,redirect:!L,url:(0,o.Gt)(K),updateMobileTabbedRouterArgs:{tabbedRouterStateAlreadyUpdated:!0}})}function S(e,t){var n,o;if(c.__(e))return e.device.isMobileNative&&e.device.isAndroid&&p.Z.closeAll(),_({environment:e,tab:"home",nativeRootPageOverrideEnabled:!0}),void(t&&t());Boolean(null===(n=e.mobileNative)||void 0===n?void 0:n.supportsNativeHomeOnPhone())&&(null===(o=e.mobileNative)||void 0===o||o.showNativeHomeTab(t))}},303898:(e,t,n)=>{n.d(t,{Nz:()=>f,Rk:()=>m,uE:()=>p});var o=n(421202),r=n(653965),i=n(798165),a=n(52315),s=n(635328),l=n(80444),c=n(206258),d=n(415690),u=n(429373);function p(e){const t=e.state;return"page"===t.route.name&&t.route.scrollToBlockId?[t.route.scrollToBlockId]:t.historyState?t.historyState.blockIds:[]}function m(e,t){const n=function(e,t){const n=t.map((t=>c.G.createChildStore(e,{table:o.iU,id:t}))).map((e=>i.qA(e))).filter((t=>{let n=!1;const o=t.slice(1).find((e=>{if("block"===e.table)return e.isTransclusionType()&&(n=!0),e.isNavigableBlock()}));return o&&(o.id===e.id||n)})).map((e=>{const t=e.findIndex((e=>"block"===e.table&&e.isNavigableBlock()));return e.slice(1,t).filter((e=>"block"===e.table&&(0,s.BX)(e)))}));return r.mN(r.xH(n),(e=>e.id))}(e,t);for(const o of n)u.rd({blockId:o.id,state:!0,currentUserId:o.environment.currentUser.id});return n}function g(e,t){const n=function(e,t){const n=t.map((t=>c.G.createChildStore(e,{table:o.iU,id:t,spaceId:e.pointer.spaceId}))).map((e=>i.qA(e))).filter((t=>{const n=t.slice(1).find((e=>"block"===e.table&&e.isNavigableBlock()));return n&&n.id===e.id})).map((e=>{const t=e.findIndex((e=>"block"===e.table&&e.isNavigableBlock()));return e.slice(1,t).filter((e=>{if("block"!==e.table)return!1;const t=e.getParentStore();return"block"===(null==t?void 0:t.table)&&"tab"===(null==t?void 0:t.getType())}))}));return r.mN(r.xH(n),(e=>e.id))}(e,t);for(const r of n){const e=r.getParentStore();var a;if((null==e?void 0:e.table)===o.iU&&"tab"===(null==e?void 0:e.getType()))d.x2({store:e,id:r.id,currentUserId:null===(a=l.default.state.currentUserStore)||void 0===a?void 0:a.id})}return n}async function f(e,t){await async function(e,t){const n=t.map((t=>c.G.createChildStore(e,{table:o.iU,id:t})));await Promise.all(n.map((e=>i.s(e))))}(e,t);const n=r.mN([...m(e,t),...g(e,t)],(e=>e.id));await async function(e){await Promise.all(e.map((e=>a.r(e))))}(n)}},761045:(e,t,n)=>{n.d(t,{Q7:()=>J,XW:()=>K,YC:()=>$,Zv:()=>z,_4:()=>W,aB:()=>U,bx:()=>j,hQ:()=>Y,hl:()=>q});var o=n(535431),r=n(14577),i=n(653965),a=n(268056),s=n(177546),l=n(731352),c=n(389224),d=n(747372),u=n(303994),p=n(875987),m=n(95802),g=n(455521),f=n(704266),h=n(296198),v=n(905162),y=n(434859),b=n(480796),_=n(964233),S=n(465686),k=n(319111),w=n(869454),x=n(619671),I=n(813023),C=n(188923),T=n(206258),M=n(27724),P=n(924666),A=n(250906);function R(e,t,n,o){const r=(n-t)/n,i=o/10/60,a=i+(3*o/60-i)*Math.min(r*r,1);return e.device.isIOS?Math.ceil(a):a}const D=1e3,B=i.P2((e=>{A.PL(e,{direction:"top"})}),D),E=i.P2((e=>{A.PL(e,{direction:"bottom"})}),D),F=i.P2((e=>{A.PL(e,{direction:"left"})}),D),Z=i.P2((e=>{A.PL(e,{direction:"right"})}),D);function U(e){const{environment:t,scroller:n,currentMouseX:o,currentMouseY:r,verticalEdgeThreshold:i,horizontalEdgeThreshold:a,disableVerticalEdgeScroll:s,disableHorizontalEdgeScroll:l}=e,{clientRect:c,scrollTop:d,scrollHeight:u,scrollLeft:p,scrollWidth:m}=n.stores.store.state;if(c){if(n.props.type!==y.Z.X&&!s){const e=r-c.top;let o,a;w.Z.state.phase!==w.i.shown?(o=i,a=(0,v.Y)("supportsNativeBottomBarOverlappingWebView")?c.bottom-w.Z.mobileNativeBottomPadding(t)-r:c.bottom-r):(o=.25*w.Z.state.estimatedKeyboardWebViewOverlap,a=c.bottom-w.Z.mobileNativeBottomPadding(t)+o-r);const s=0===d,l=d+c.height===u;if(e<i&&!s){const o=R(t,e,i,c.height);n.scrollTo(d-o,void 0),o>0&&B(t)}if(a<o&&!l){const e=R(t,a,o,c.height);n.scrollTo(d+e,void 0),e>0&&E(t)}}if(n.props.type!==y.Z.Y&&!l){const e=o-c.left,r=c.right-o,i=0===p,s=p+c.width===m;if(e<a&&!i){const o=R(t,e,a,c.width);n.scrollTo(void 0,p-o),o>0&&F(t)}if(r<a&&!s){const e=R(t,r,a,c.width);n.scrollTo(void 0,p+e),e>0&&Z(t)}}}}const V=64,N=64,O=64,L=64;function j(e){const{element:t,scrollers:n,vertical:o,horizontal:r,animate:i,centerVertically:a}=e,s=t.getBoundingClientRect();if(o&&n.verticalScroller){const{reveal:e}=o,t=o.paddingToTopEdge||V,r=o.paddingToBottomEdge||N,l=n.verticalScroller,c=l&&l.getClientRect();if(l&&c){const n=c.bottom-r,o=a?c.height/2:0,d=c.top+t+o,u=s.top>d&&s.top<n,p=s.bottom>d&&s.bottom<n,m=s.top<d&&s.bottom>n,g=s.bottom-n,f=s.top-d;"top"===e?u||l.scrollByOffset(f,0,{animate:i}):"bottom"===e?p||l.scrollByOffset(g,0,{animate:i}):u||p||m||(Math.abs(g)<Math.abs(f)?l.scrollByOffset(g,0,{animate:i}):l.scrollByOffset(f,0,{animate:i}))}}if(r&&n.horizontalScroller){const{reveal:e}=r,t=r.paddingToLeftEdge||L,o=r.paddingToRightEdge||O,a=n.horizontalScroller,l=a&&a.getClientRect();if(a&&l){const n=l.left+t,r=l.right-o,c=s.left>n&&s.left<r,d=s.right>n&&s.right<r,u=s.left<n&&s.right>r,p=s.right-r,m=s.left-n;"left"===e?c||a.scrollByOffset(0,m,{animate:i}):"right"===e?d||a.scrollByOffset(0,p,{animate:i}):c||d||u||(Math.abs(p)<Math.abs(m)?a.scrollByOffset(0,p,{animate:i}):a.scrollByOffset(0,m,{animate:i}))}}}function K(e){const{handle:t,horizontal:n,vertical:r,animate:i}=e;if(!t)return;const a=(0,o.e)(t);return a?j({vertical:r,animate:i,horizontal:n,element:a,scrollers:{verticalScroller:t.getContextVerticalScroller?t.getContextVerticalScroller():void 0,horizontalScroller:t.getContextHorizontalScroller?t.getContextHorizontalScroller():void 0}}):void 0}function z(e){if(M.default.state.pivot)q([M.default.state.pivot.id],(null==e?void 0:e.animate)??!1);else{q(M.default.state.stores.map((e=>e.id)),(null==e?void 0:e.animate)??!1)}}function q(e,t){const n=m.C.findScrollToSelectablesFromIds(e)[0];if(n){const{disableScrollToRevealHorizontal:e}=n.props;K({handle:n,vertical:{reveal:"closest"},horizontal:e?void 0:{reveal:"closest"},animate:t})}}let H=function(e){return e[e.top=0]="top",e[e.middle=1]="middle",e[e.bottom=2]="bottom",e[e.natural=3]="natural",e}({});function G(e){let{position:t}=e;const{paddingTop:n}=e;if("editing"!==P.default.state.mode)return;let o=e.paddingBottom;d.Z.find((e=>e.isShown()))&&(o+=h.O);const r=c.get();if(r){const e=s.SD(r.commonAncestorContainer);if(!e)return;const i=s.hI(e).find((e=>e.scrollHeight>e.clientHeight));if(!i)return;const a=c.getRect(r);if(!a||!i)return;const l=i.getBoundingClientRect();if(!(r.startContainer instanceof Text)){const e=a;e.top+=4,e.bottom-=5,e.height-=9}const d=a.top<l.top+n,u=a.bottom>l.bottom-o;if(r.startContainer instanceof Text&&r.startOffset!==r.endOffset)return;if(t===H.natural)if(u)t=H.bottom;else{if(!d)return;t=H.top}if(t===H.top){const e=i.scrollTop+a.top,t=l.top+n;i.scrollTop=e-t}else if(t===H.bottom){const e=i.scrollTop+a.bottom,t=l.bottom-o;i.scrollTop=e-t}else if(t===H.middle){const e=i.scrollTop+a.top,t=l.top+l.height/2-10;i.scrollTop=e-t}}}function W(e){return w.Z.mobileNativeBottomPadding(e)+20}function $(e){if(p.Z.isInlineAutocompleteOpen())return!0;if(_.Z.state.open)return!0;if(!(0,v.Y)("supportsNativeMobileDynamicActionBar")&&f.Z.state.open)return!0;if(e.device.isMobileNative&&e.device.isPhone){if(k.Z.state.open){const e=k.Z.state;if("+"!==e.insertionType)return!0;const t=(0,l.O2)(e.textStore,e.oldTextValue,e.isEmptyPageTitle?"":e.insertionType),n=(0,l.ug)(e.textStore,t);if(t&&""!==(null==n?void 0:n.trim()))return!0}if(function(){var e;const t="editing"===P.default.state.mode&&(null===(e=(0,a.QY)(P.default.state.multiSelection))||void 0===e?void 0:e.store);if(t){const e=t.getRecordStoreAtRootPath();if(e instanceof T.G){const t=e.getValue(),n=t&&t.type;return"link_to_page"===n||"link_to_collection"===n}}return!1}())return!0}return!1}function Y(e){const t=u.Z.shouldPreventMobileAutoScroll(e),n=W(e);$(e)?G({position:H.top,paddingTop:20,paddingBottom:n+40}):t||x.Z.state.isOpen&&!C.default.state.open||I.Z.state.isOpen||G({position:H.natural,paddingTop:20,paddingBottom:n+40})}const Q=i.IH((e=>{const{device:t}=e;return new r.ZP((()=>t.isMobile&&b.Z.state.isDragging||t.isMobile&&g.Z.state.swiping?y.Z.All:S.Z.getPreventScrollType()),{debugName:"preventScrollTypeStore"})}));function J(e){return Q(e).state}},587531:(e,t,n)=>{n.d(t,{IB:()=>Z,Kf:()=>E,Ky:()=>V,LR:()=>B,LU:()=>L,ML:()=>U,UT:()=>F,X2:()=>N});var o=n(730120),r=n(336769),i=n(471924),a=n(89101),s=n(421838),l=n(598151),c=n(307032),d=n(401898),u=n(21359),p=n(432785),m=n(81598),g=n(828344),f=n(791683),h=n(669128),v=n(973744),y=n(259139),b=n(80444),_=n(521273),S=n(798180),k=n(424042),w=n(222294),x=n(155320),I=n(530857),C=n(629026),T=n(751787),M=n(247839),P=n(52606),A=n(608055),R=n(210228),D=n(237181);const B=6;function E(e){x.default.state.open?Z({environment:e.environment,reset:!1}):F(e)}function F(e){const{environment:t,renderAsPage:n,isQuickSearch:o,isPublicPageSearch:r,isNewElectronTab:s}=e,l=i.Il(),c=Date.now();if(Boolean(o))x.default.setState({open:!1,openAsPage:!0,openedTimeMs:c,sessionId:l,isPublicPageSearch:r??!1});else if(Boolean(n))A.c4({environment:t,url:`${a.VP.nativeTab}/search`,redirect:!0}),x.default.setState({open:!1,openAsPage:!0,openedTimeMs:c,sessionId:l,isPublicPageSearch:r??!1});else{if(x.default.state.open)return;x.default.update((e=>({...e,open:!0,openAsPage:!1,isQuickSearch:!1,openedTimeMs:c,sessionId:l,isPublicPageSearch:r??!1,isNewElectronTab:s}))),P.xv({clearQuery:!1})}if(Boolean(e.doNotTrackOpenSearchEvent)||T.wF(e.environment,{from:e.analyticsFrom,searchSessionId:l}),"assistant"===C.ZP.state.mode&&!o){const n=S.default.getActiveSessionId()||S.default.getNextSessionId(),o=S.default.getActiveSession();m.assistantDependency.load().then((e=>{let{assistantMenuActions:n}=e;n.closeAssistantRightHandSideMenu({environment:t})}));const r=x.default.state.sessionId;g.trackAssistantOpened(e.environment,{from:"return_to_search",hasQuery:!1,searchSessionId:r,isReminder:!1,reminderType:void 0,sessionId:n,startTimestamp:(null==o?void 0:o.assistantConfigurationState.sessionStartTimestamp)||Date.now(),transcript:(null==o?void 0:o.evaluator.getTranscript())||[]})}}function Z(e){const{environment:t,reset:n}=e;if(x.default.state.open){if(x.default.reset(),w.Z.setKeyboardMode(!1),"assistant"===C.ZP.state.mode){const e=S.default.getActiveSession();e&&g.trackAssistantClosed(t,{sessionContext:e,from:"search"})}n&&U({resultStore:e.searchResultStore,secondaryResultStore:void 0})}}function U(e){const{resultStore:t,secondaryResultStore:n}=e;C.ZP.reset(),I.default.reset(),t.reset(),n&&n.reset()}async function V(e){var t,n,o;const{environment:r,shouldResetAssistantStore:i=!0,quickSearchMode:a,device:l,event:c,queryOverrideFromAISuggestedQuestion:d}=e,u=b.default.state.mainEditorCurrentBlockStore??b.default.state.currentSpaceStore,p=d||C.ZP.state.query.text,f=x.default.state.sessionId,h=p.length>B,{isNewElectronTab:w}=x.default.state,I=(null===(t=k.Z.state.preferences)||void 0===t?void 0:t.isNewTabSearchEnabled)&&w?v.DJ(c)||"tab":v.DJ(c);if(!u||"assistant"===C.ZP.state.mode)return;const{assistantActions:T,assistantMenuActions:P}=await m.assistantDependency.load();i&&T.clearActiveAssistantSession({environment:r});const A=p.length<=B?p:void 0,R=_.Z.isFullPageAssistantChatEnabled(r.device),D=(0,y.b)(r);let E;if(l.isMobileBrowser?P.openAssistantRightHandSideMenu({environment:r,primeTextInput:A,from:"search"}):R&&!D?(Z({environment:r,reset:!1}),P.openFullPageChat({environment:r,primeTextInput:A,openInNew:I,query:p,from:"search"})):(C.ZP.update((e=>({...e,mode:"assistant"}))),P.setPrimeTextInput(A),await P.closeAssistantRightHandSideMenu({environment:r})),h){E=(await T.resetAndInitializeAssistantSession({environment:r})).sessionId,T.commitHumanStep({environment:r,text:(0,s.TPx)(p),sessionId:E,assistantSurfaceType:"searchPane"}),T.updateAssistantTimestampsAfterSessionInitialization({environment:r})}E||(E=S.default.getActiveSessionId()??S.default.getNextSessionId());const F=null===(n=S.default.getSessionContext(E))||void 0===n||null===(n=n.assistantConfigurationStore)||void 0===n?void 0:n.state,U=(null===(o=S.default.getSessionContext(E))||void 0===o?void 0:o.evaluator.getTranscript())??[];g.trackAssistantOpened(r,{hasQuery:h,from:e.from,searchSessionId:f,isReminder:!1,reminderType:void 0,sessionId:E,startTimestamp:(null==F?void 0:F.sessionStartTimestamp)||Date.now(),transcript:U}),a&&l.isElectron&&M.quickSearchSetSearchAssistantMode(!0)}async function N(e){let{environment:t,timeToAbandonMs:r,query:i}=e;const{assistantDependency:a}=await Promise.resolve().then(n.bind(n,81598)),s=(await a.load()).getCurrentQnaReminderUserSettings();if(!s)return;if(!(0,d.$K)(s.last_exposed_to_ai_qna_at))return;const l=o.ou.utc(),c=s.last_exposed_to_ai_qna_at;if(l.diff(o.ou.fromMillis(c),"days").days<7)return;const u=s.ai_qna_abandoned_search_reminder_shown_at??[],p=u[u.length-1],m={ai_qna_abandoned_search_reminder_shown_at:[...u,l.toMillis()]};if((s.qna_reminders_shown_at??[]).length<f.Qz||u.length>=h.JV||(0,d.$K)(p)&&l.diff(o.ou.fromMillis(p),"days").days<2)return;if(i.trim().length<9)return;if("idle"!==h.Pf.state.type)return;h.Pf.setState({type:"loading",query:i});const g=b.default.state.currentUserSettingsStore;return g&&R.createAndCommit({environment:t,userAction:"searchMenuActions.setAbandonedSearchReminderShownAt",perform:e=>{D.d2({userSettingsStore:g,transaction:e,data:m})}}),O({environment:t,compareTimestamp:c,query:i})}async function O(e){const{environment:t,compareTimestamp:o,query:r}=e,{assistantDependency:i}=await Promise.resolve().then(n.bind(n,81598)),a=await i.load(),s=await(0,p.b)({environment:t,type:"keywordSearchToSuggestedQuestions",inputs:[{query:r}]});if(!s)return void h.Pf.setState({type:"idle"});const l=function(){const{currentUserSettingsStore:e}=b.default.state;if(e)return e.getSettingsStore().getKeyStore("last_exposed_to_ai_qna_at").getValue()}();l&&l>o?h.Pf.setState({type:"idle"}):_.Z.isQnaAbandonedSearchReminderEnabledForUser()&&(h.Pf.setState({type:"ready",questions:s}),S.default.endCurrentSession(),a.assistantMenuActions.openAssistantRightHandSideMenu({environment:t,from:"button",isReminder:!0,reminderType:"abandoned_search"}))}async function L(e){const{environment:t,spaceId:n,query:o}=e,r={type:"searchToSuggestedQuestions",query:o},a=i.Il(),s=await u.getCompletion(t,{id:(0,c.ZP)(),context:r,model:"openai-gpt-4o-mini",spaceId:n,isSpacePermission:!1,aiSessionId:a,metadata:{}});if("success"!==s.type)return;let d="";if(l.H1.is(s.data))for await(const i of s.data)"success"===i.type&&(d+=i.completion);return d}(0,r.exposeDebugEnvironmentValue)("showQnaReminderOnAbandonedSearch",(e=>t=>O({environment:e,compareTimestamp:Date.now(),query:t})))},305851:(e,t,n)=>{n.d(t,{n:()=>g,y:()=>f});n(757658);var o=n(709291),r=n(653965),i=n(401898),a=n(433929),s=n(781918),l=n(21359),c=n(547307),d=n(709953),u=n(29974),p=n(210228);const m=(0,o.defineMessages)({saveFieldError:{id:"securitySAMLSettings.saveSettingsError.message",defaultMessage:"Something went wrong."}});function g(e,t){const{securitySettingsState:n,spaceStore:o}=t,{disablePublicAccess:r,disableGuests:i,disableMoveToSpace:a,disableExport:s,disableSpacePageEdits:l,disablePublicAccessRequests:c,disableTeamCreation:d,disableMembershipRequests:m,disableExternalMembershipRequests:g,disableGuestMembershipRequests:f,enableAiFeature:h,disableTeamGuests:v,enableGuestInviteRequests:y,enableAiTraining:b,zeroRetentionEnabled:_}=n;return p.createAndCommit({userAction:"securitySettingsActions.saveSecuritySettings",environment:e,perform:t=>{u.Xr({environment:e,transaction:t,spaceStore:o,disablePublicAccess:r,disableGuests:i,disableMoveToSpace:a,disableExport:s,disableSpacePageEdits:l,disablePublicAccessRequests:c,disableTeamCreation:d,disableMembershipRequests:m,disableExternalMembershipRequests:g,disableGuestMembershipRequests:f,enableAiFeature:Boolean(h),disableTeamGuests:v,enableGuestInviteRequests:y,enableAiTraining:Boolean(b),zeroRetentionEnabled:Boolean(_)})}})}function f(e,t){const{securitySettingsStore:n,spaceStore:o,fields:u}=t,g={...n.state},f={...n.state,...u};n.setState(f),void 0!==u.disableGuests&&(l.updateDisableGuestsOnSpace(e,{spaceId:o.id,newDisableGuestsValue:u.disableGuests,keepExistingGuests:Boolean(u.keepExistingGuests)}).then((e=>{if("failed"===e.type)return c.showErrorMessage(a.default.formatMessage(m.saveFieldError)),void n.setState(g)})),s.o8(e,{new_value:u.disableGuests,keep_existing_guests_if_disabled:Boolean(u.keepExistingGuests)})),p.createAndCommit({userAction:"SecuritySettings.saveToggle",environment:e,perform:e=>{e.postSubmitCallbacks.push((e=>{if(e)return c.showErrorMessage(a.default.formatMessage(m.saveFieldError)),void n.setState(g)}));const t=r.GM({disable_public_access:u.disablePublicAccess,disable_move_to_space:u.disableMoveToSpace,disable_export:u.disableExport,disable_space_page_edits:u.disableSpacePageEdits,disable_public_access_requests:u.disablePublicAccessRequests},(e=>r.kK(e)));d.sW({store:o,data:t,transaction:e});const s=r.GM({enable_guest_invite_requests:u.enableGuestInviteRequests,disable_membership_requests:u.disableMembershipRequests,disable_external_membership_requests:u.disableExternalMembershipRequests,disable_guest_membership_requests:u.disableGuestMembershipRequests},(e=>!(0,i.$K)(e)));Object.keys(s).length>0&&p.applyOperation({store:o,operation:{pointer:o.pointer,path:["settings"],command:"update",args:s},transaction:e})}}),(0,i.$K)(u.enableGuestInviteRequests)&&s.tB(e,{new_value:u.enableGuestInviteRequests})}},311712:(e,t,n)=>{n.d(t,{QZ:()=>Pe,VJ:()=>Re,yt:()=>Te,nG:()=>Ce,DV:()=>Ue,dK:()=>Me,mp:()=>ke,bj:()=>ye,P8:()=>xe,at:()=>Ie,aO:()=>we,BM:()=>Se,uE:()=>Ze,ZJ:()=>Fe,YP:()=>Ee,Ah:()=>Ae,Od:()=>fe,Cl:()=>_e,Qw:()=>be,MD:()=>he,kB:()=>Be,DQ:()=>De,zO:()=>ve});n(757658),n(252262),n(324506),n(21703);var o=n(701302),r=n(815145),i=n(541432),a=n(471924),s=n(421202),l=n(23867),c=n(182798),d=n(709291),u=n(653965),p=n(619584),m=n(275754),g=n(691851),f=n(110906),h=n(601600),v=n(95477),y=n(27105),b=n(119037),_=n(721429),S=n(451165),k=n(277181),w=n(840959),x=n(783105),I=n(433929),C=n(165598),T=n(341984),M=n(58202),P=n(95802),A=n(431559),R=n(80444),D=n(990827),B=n(400807),E=n(385555),F=n(188923),Z=n(206258),U=n(27724),V=n(897630),N=(n(667294),n(800480)),O=n(379016),L=n(210228),j=n(382914),K=n(707124),z=n(699884),q=n(969098),H=n(575649),G=n(785893);function W(e){const{sizeRange:t,asyncModal:n}=e,o=(0,N.O7)(),r=(0,G.jsx)(j.vI,{iconAndTitle:(0,G.jsx)(j.kC,{iconGroup:O.j,title:(0,G.jsx)(d.FormattedMessage,{id:"deleteBlocksModal.title",defaultMessage:"Delete content?"})}),description:(0,G.jsx)(d.FormattedMessage,{id:"deleteBlocksModal.description",defaultMessage:"You can delete existing blocks but you won’t be able to add new content until you upgrade"})}),i=(0,G.jsx)(j.a6,{layout:"vertical",primaryButtons:[{buttonType:"destructive",label:(0,G.jsx)(d.FormattedMessage,{id:"deleteBlocksModal.delete",defaultMessage:"Delete"}),onClick:()=>n.resolve("delete")}],secondaryButtons:[{buttonType:"secondary",label:(0,G.jsx)(K.q,{colorName:"primary",children:(0,G.jsx)(d.FormattedMessage,{id:"deleteBlocksModal.upgrade",defaultMessage:"Upgrade plan"})}),onClick:()=>{H.y(o,{from:"delete_blocks_modal",for:"plus"}),n.resolve("upgrade")}}]});return(0,G.jsx)(j.sR,{header:r,footer:i,sizeRange:t})}var $=n(170060),Y=n(981193),Q=n(21359),J=n(730188),X=n(141433),ee=n(547307),te=n(276725),ne=n(954604),oe=n(594419),re=n(119785),ie=n(587420),ae=n(608055),se=n(761045),le=n(524677),ce=n(164964),de=n(415690),ue=n(898104),pe=(n(668422),n(239865)),me=n(801742);const ge=(0,d.defineMessages)({deletePages:{id:"action.deletePages.snackBarMessage",defaultMessage:"Moved to Trash"}});function fe(e){var t,n;const{store:o,transaction:r}=e,i=P.C.findSelectablesFromStore(o).find((e=>Boolean(e.props.onRemove)));null==i||null===(t=(n=i.props).onRemove)||void 0===t||t.call(n,{transaction:r})}function he(e){const{blocks:t,transaction:n}=e;if(1===t.length){const e=t[0];e&&C.PF(e)&&fe({store:e,transaction:n})}}function ve(e){const t=P.C.findAllSelectablesFromIds(e.map((e=>e.id)));for(const n of t)n.stores.selectableStore.setState({...n.stores.selectableStore.state,showActionIsInFlight:!0})}function ye(e){const t=P.C.findAllSelectablesFromIds(e.map((e=>e.id)));for(const n of t)n.stores.selectableStore.setState({...n.stores.selectableStore.state,showActionIsInFlight:!1})}async function be(e){var t;const{environment:n,blocks:o,shouldCheckSuggestEdit:r}=e,a=R.default.state.currentSpaceViewStore,l=Boolean(null==a||null===(t=a.getSettings())||void 0===t?void 0:t.seen_delete_blocks_modal),d=V.M_(n);if((0,$.vT)()&&!d&&!l){const e=await async function(e){const t=R.default.state.currentSpaceViewStore;return await q.o.showAsyncModal((n=>(0,G.jsx)(z.c,{isOpen:n.isOpen,onDismiss:()=>{n.resolve("dismiss")},onClosed:()=>{t&&L.createAndCommit({userAction:"DeleteBlocksModal.showDeleteBlocksModal",environment:e,perform:e=>{L.applyOperation({store:t,operation:{pointer:t.pointer,path:["settings"],command:"update",args:{...t.getSettings(),seen_delete_blocks_modal:!0}},transaction:e})}})},areaConstraint:{width:{type:"fixed",length:300}},render:e=>{let{sizeRange:t}=e;return(0,G.jsx)(W,{sizeRange:t,asyncModal:n})}})))}(n);if("delete"!==e)return}let p=o;if(o.length>0&&r){if("suggest"===B.Z.getMode(o[0])){const e=o.filter((e=>(0,S.xU)({blockStore:e,currentUser:n.currentUser})));L.createAndCommit({userAction:"selectableBlockActions.removeBlocksWithMaybeConfirmation",environment:n,canUndo:!0,perform:t=>{h.LC({environment:n,transaction:t,blockStores:o.filter((t=>!e.includes(t)&&!(0,D.Eo)(t)&&!(0,i.S9)((0,c.TO)(t.getType()))))})}}),p=e}}let m=!0;const v=[];for(const i of p){const e=M.R.findBlockFromStore(i);if(e&&u.mf(e.handleRemoveBlockFromComment)){if(await e.handleRemoveBlockFromComment())continue}else if(e&&u.mf(e.canRemoveBlock)){const t=await e.canRemoveBlock();if(!t.canRemove)return;m=t.canUndo}const t=await g.NN({environment:n,block:i,action:"delete"});if("user_canceled"===t)return;t.length>1?v.push(...t):v.push(i)}if(0===v.length)return;const y=v[0],b=(0,f.fm)(y)??(0,k.Ll)(y,n);if(b&&(0,k.wP)({collectionContextStore:b,blockStore:y})){if(!(await J.VP({environment:n,blocks:v,canUndo:m})))return}else{const{serverCommitResult:e}=L.createAndCommit({userAction:"selectableBlockActions.removeBlocksWithMaybeConfirmation",environment:n,canUndo:m,perform:e=>{_e({environment:n,blocks:v.filter((e=>!(0,D.Eo)(e))),transaction:e})}});await e}const{currentSpaceStore:_}=R.default.state;if(_&&v.some((e=>e.isPageBlock()))){ce.d4({item:{label:I.default.formatMessage(ge.deletePages)},undoFunc:()=>{for(const e of v)Q.restoreBlock(n,{pointer:{table:s.iU,id:e.id,spaceId:e.pointer.spaceId||_.id}})}});const e=R.default.state.currentUserSettingsStore;e&&pe.Ts({experimentStore:E.default,currentSpaceStore:_,currentUserSettingsStore:e,intl:I.default.getIntl(),environment:n})}v.some((e=>{var t;return e.id===(null===(t=F.default.peekTargetStore.state)||void 0===t?void 0:t.id)}))&&ie.xv(n,void 0)}function _e(e){const{environment:t,blocks:n,transaction:o,preventClearSelection:r}=e,a=n[0],s=function(e){const t=P.C.getMembersByDOMOrder({filter:()=>!0}),n=u.cx(t,(t=>t.props.store===e)),o=t[n];if(!o)return;const r=o.getContextSelectableContainer(),i=u.tP(t,0,n),a=u.dF(i,(e=>e.props.canSelect&&e.getContextSelectableContainer()===r));if(a)return a.props.store;const s=u.tP(t,n+1).find((e=>Boolean(e.props.canSelect&&e.getContextSelectableContainer()===r)));if(s)return s.props.store}(a);!function(e){const{environment:t,blockStore:n,entryPointName:o}=e,r=new me.GD({environment:t,userFlow:"user_flow_delete_block",entryPointName:o,timeoutMs:90*p.C0});if(r.isDisabled())return;const i=()=>{n.pathIsDead()&&r.succeed()};r.postFinishCallbacks.push((()=>{n.removeListener(i)})),n.addListener(i)}({environment:t,blockStore:a,entryPointName:o.getUserActionForAnalyticsPurposesOnly()||"selectableBlockActions.removeBlocks"});for(const i of n)fe({store:i,transaction:o});if(r||(le.ZH({environment:t}),le.Fp({pivot:s})),b.Zi3({environment:t,blocks:n,publicEditMode:void 0})||b.NnH({environment:t,blocks:n,publicEditMode:void 0})||b.OOv({environment:t,blocks:n,publicEditMode:void 0})||n.some((e=>{var t;return e.getType()===i.Ti.transclusionContainer||(null===(t=e.getAssociatedCollectionStore())||void 0===t?void 0:t.isPageTreeCollection())}))){o.postSubmitCallbacks.push((e=>{e||Q.deleteBlocks(t,{blocks:n.map((e=>({id:e.id,spaceId:(0,l.C)(e.pointer.spaceId)}))),permanentlyDelete:!1})}));for(const e of n){const{app_id:n,app_config_uri:r}=e.getFormat();n&&r&&Y.Cu(t,{block_id:e.id,app_id:n,app_config_uri:r}),re.zo({blockStore:e,transaction:o})}ae.CZ({environment:t,blocks:n})}r||ue.clear({environment:t})}function Se(e){const{environment:t,blocksToInsert:n,target:o,transaction:r,replaceEmptyTextBlock:i,preventSetSelection:a}=e;let s=_.RM();if(!s){const{route:e}=t.RouterStore.state;"chat"===e.name&&(s=o.at(0))}const l=s;if(!l)throw new Error("No root store.");let c;if(o.length>0){const e=o.at(-1);let a=e;if(Boolean(n.find((e=>e.isType("column_list"))))){const t=null==e?void 0:e.findRecordStoreUIAncestor((e=>e&&e instanceof Z.G&&e.isType("column_list"))).ancestor;t&&t instanceof Z.G&&(a=t)}const s=P.C.find((e=>e.props.store===a&&e.props.canInsertBelow&&e.props.onInsertBelow));if(s&&s.props.onInsertBelow)c=u.oA(s.props.onInsertBelow({insertStores:n,transaction:r})),i&&e&&e.isEmptyTextBlock()&&_e({environment:t,blocks:[e],transaction:r});else{c=u.d9(n).reverse().map((e=>oe.Ce({parentStore:l.getContentStore(),prependStore:e,transaction:r}).childStore))}}else if(l.isCollectionView()){const e=M.R.findBlockFromStoreWithMethod(l,"insertBlocks");if(!e)throw new Error("No collection view found.");c=e.insertBlocks(n,r)}else{const e=l.getContentStore();c=n.map((t=>oe.R3({parentStore:e,appendStore:t,transaction:r}).childStore))}return Boolean(a)||(c=c.flatMap((e=>e.isType("column_list")?e.getContentStores().flatMap((e=>e.getContentStores())):[e])),le.Z5({environment:t,stores:c})),c}function ke(e){const{blocks:t}=e,n=t[0];if(n){const t=P.C.findSelectableFromStore(n);t&&t.props.onEnter&&t.props.onEnter(e)}}function we(e){const{environment:t,createBlockItem:n,selection:o,transaction:r,analyticsFrom:i,preventSetSelection:a}=e,s=U.default.getCurrentRecordCache(),l=new me.BW({environment:t,userFlow:"page"===(null==n?void 0:n.blockType)?"user_flow_create_page":"user_flow_create_block",succeedOnEnqueue:!0});let c;if(V.M_(t)&&n&&s){var d;const e=X.fC({environment:t,createBlockItem:n,transaction:r,inMemoryRecordCache:s,from:i,useCrdt:0!==o.length?o[0].useCrdt():(null===(d=_.RM())||void 0===d?void 0:d.useCrdt())??!1,selection:o});l.track(e.pointer,r),c=Se({environment:t,blocksToInsert:[e],target:o,transaction:r,replaceEmptyTextBlock:!1,preventSetSelection:a})[0]}else l.fail("invalid_state");return c}function xe(e){const{environment:t,createBlockItem:n,selection:o,transaction:r,analyticsFrom:i,preventSetSelection:a}=e,s=U.default.getCurrentRecordCache();let l;if(V.M_(t)&&n&&s){var c;l=function(e){const{environment:t,selection:n,transaction:o,preventSetSelection:r}=e,{blocks:i}=e,a=_.RM();if(!a)throw new Error("No root store.");if(n.length>0){const e=n[0],a=P.C.find((t=>t.props.store===e&&t.props.canInsertAbove&&t.props.onInsertAbove));if(!a||!a.props.onInsertAbove)throw new Error("No Selectable found.");const s=a.props.onInsertAbove({insertStores:i,transaction:o});return Boolean(r)||le.Z5({environment:t,stores:s}),s}{const e=a.getContentStore(),n=i.map((t=>oe.R3({parentStore:e,appendStore:t,transaction:o}).childStore));return Boolean(r)||le.Z5({environment:t,stores:n}),n}}({environment:t,blocks:[X.fC({environment:t,createBlockItem:n,transaction:r,inMemoryRecordCache:s,from:i,useCrdt:0!==o.length?o[0].useCrdt():(null===(c=_.RM())||void 0===c?void 0:c.useCrdt())??!1,selection:o})],selection:o,transaction:r,preventSetSelection:a})[0]}return l}function Ie(e){const{environment:t,selection:n,transaction:o}=e,r=we({...e,preventSetSelection:!0});if(r){var i;Ue({environment:t,insertedStores:[r],isCreated:!0});const e=B.Z.getMode(r);if("suggest"===e){const e=h.oG(t,o,r);h.n1(o,r,{id:a.Il(),type:"insert",discussionId:e.id}),h.vh({environment:t,transaction:o,discussionStore:e,addModifiedBlockIdsAfter:[r.id]})}"suggest"===e&&null!==(i=r.getNavigableBlockStore({skipCurrent:!0}))&&void 0!==i&&i.isCommentOnly()||he({transaction:o,blocks:n})}return r}async function Ce(e){const{environment:t,blocks:n,duplicateOnlyCollectionSchema:r,event:i}=e;if(!V.M_(t))return;let a=n;if(1===n.length){const e=await g.NN({environment:t,block:n[0],action:"duplicate"});if("user_canceled"===e)return;a=e}const s=a.at(0);if(!s)return;const l=(0,f.fm)(s);if((0,k.vJ)(s,l))await J.W9({blocks:a,environment:t,analyticsFrom:"subitem_duplication"});else{const e=(0,y.Sy)({event:i,contextualDefault:0!==n.length&&n[0].useCrdt()});L.createAndCommit({userAction:"actionRegistry.duplicateToSelection",environment:t,perform:n=>{Te({environment:t,blocks:a,transaction:n,preferDuplicateLocation:"local",duplicateOnlyCollectionSchema:r,useCrdt:e})},transactionTooBigFallback:n=>{Te({environment:t,blocks:a,transaction:n,preferDuplicateLocation:"server",duplicateOnlyCollectionSchema:r,useCrdt:e})}})}o.default.afterNextFlush((()=>{se.Zv()}))}function Te(e){const{environment:t,blocks:n,transaction:o,preferDuplicateLocation:r,lastTopLevelBlockStore:i,preventSetSelection:a,duplicateOnlyCollectionSchema:s,useCrdt:c}=e,d=u.vM(n,(e=>e.getFormat().app_id??e.id)),p=[];return u.Ed(d,(e=>{const n=e[0],i=!n.isTransclusionType(),[a,d]=te.Qi({environment:t,stores:e,addCopyName:(0,T.Z)(n),transaction:o,deepCopyTransclusionContainers:i,resolveTemplateVariables:!(n.isInsideTemplate()||n.isInsideFactoryOrDuplicateBlocksAction()),targetSpaceId:(0,l.C)(n.pointer.spaceId),baseUrl:v.default.domainBaseUrl,publicDomainName:v.default.publicDomainName,preferDuplicateLocation:r,useCrdt:c,duplicateOnlyCollectionSchema:s});p.push(...a),d.then((e=>{e&&ee.showErrorMessage(e)}))})),Se({blocksToInsert:p,target:i?[i]:n,environment:t,transaction:o,replaceEmptyTextBlock:!1,preventSetSelection:a}),p}function Me(e){const t=e.blocks[0],{blockLocationOfTargetBlock:n}=e,o=M.R.find((e=>"embed"===e.renderedType&&e.getBlockStore().id===t.id&&(!n||e.getBlockLocation()===n)));if(o&&o.canRenderFullScreen()){const e=o.getFullScreenNodeRect();if(e){const n=e.width/e.height;ne.ui({environment:o.environment,renderFullScreenNode:o.renderFullScreenNode,fullScreenNodeRect:e,contentAspectRatio:n,blockStore:t})}}}function Pe(e){let t;e.blocks.find((e=>{const n=M.R.findBlockFromStoreWithMethod(e,"activate");return!!n&&(t=n,!0)})),t&&t.activate&&t.activate()}function Ae(e){e.blocks.forEach((t=>{const n=t.getParentStore();n&&n.table===s.iU&&n.getType()===i.Ti.tab&&de.x2({store:n,id:t.id,currentUserId:e.environment.currentUser.id})}))}function Re(e){const t=e.blocks[0],n=M.R.findBlockFromStoreWithMethod(t,"caption");n&&n.caption()}function De(e,t){const n=u.oA(P.C.findSelectablesFromIds(t)).map((e=>e.props.store));le.Z5({environment:e,stores:n})}function Be(e,t){const{blockId:n,animate:o}=t;let r=P.C.findScrollToSelectablesFromIds([n]),i=r[0];if(!i){const e=R.default.state.currentSpaceStore;if(!e)return;const t=Z.G.createChildStore(e,{id:n,table:s.iU}).getParentId();t&&(r=P.C.findSelectablesFromIds([t]),i=r[0])}i&&(se.XW({handle:r[0],vertical:{reveal:"top"},horizontal:{reveal:"closest"},animate:o}),le.Z5({environment:e,stores:r.map((e=>e.props.store))}))}function Ee(e){const{environment:t,blocks:n}=e,o=n[0].findRecordStoreUIAncestor((e=>e instanceof Z.G&&e.isCollectionView())).ancestor;o&&m._c({environment:t,store:o,visitType:x.vu.Link,pageVisitSource:r.tY.Expand})}function Fe(e){const{blocks:t,transaction:n,environment:r}=e,i=we({environment:r,selection:t,createBlockItem:w.Hc.text,analyticsFrom:"text_insert_below",transaction:n});return i&&o.default.afterNextFlush((()=>{A.hb({environment:r,blockStore:i})})),i}function Ze(e){const{blocks:t,transaction:n,environment:r}=e,i=xe({environment:r,selection:t,createBlockItem:w.Hc.text,analyticsFrom:"text_insert_above",transaction:n});return i&&o.default.afterNextFlush((()=>{A.hb({environment:r,blockStore:i})})),i}function Ue(e){const{environment:t,insertedStores:n,isCreated:r}=e;r?o.default.afterNextFlush((()=>{const e=n[0];if(!e)return;const o=M.R.findBlockFromStoreWithMethod(e,"handleCreated");o?o.handleCreated():(le.Ys({environment:t,store:e}),le.Db(t))})):le.Z5({environment:t,stores:n})}},524677:(e,t,n)=>{n.d(t,{$Y:()=>F,Af:()=>Z,Ch:()=>ee,DI:()=>G,Db:()=>L,FC:()=>$,Fp:()=>U,Jy:()=>X,KX:()=>P,OS:()=>D,Ys:()=>N,Z5:()=>V,ZH:()=>K,aw:()=>E,e2:()=>H,eP:()=>O,hn:()=>J,ji:()=>R,td:()=>Y,w5:()=>Q,yu:()=>j,zJ:()=>z});n(757658);var o=n(455010),r=n(701302),i=n(95371),a=n(653965),s=n(710274),l=n(277181),c=n(928314),d=n(669645),u=n(635328),p=n(827406),m=n(316339),g=n(95802),f=n(598794),h=n(427534),v=n(431559),y=n(312211),b=n(650628),_=n(27724),S=n(445131),k=n(730188),w=n(489951),x=n(567060),I=n(761045),C=n(898104),T=n(429373),M=n(210228);function P(){const e=_.default.getCurrentDefaultContainer();if(e){return g.C.getMembersByDOMOrder({filter:t=>t.getContextSelectableContainer()===e&&t.props.canSelect}).map((e=>e.props.store))}return[]}function A(e){const t=_.default.state.stores,n=_.default.state.pivot,o=a.oA(a.zu(t,n));let r;r=n===a.Z$(t)?t[t.length-2]:t[1],V({environment:e,stores:o,pivot:r})}function R(e){const t=c.yA();return e.device.isMac?t.shift&&t.command:t.shift&&t.option}function D(){return c.yA().shift}function B(e){e.sort(((e,t)=>(0,o.Z)(g.C.findNodeFromStore(e),g.C.findNodeFromStore(t))))}function E(e){const t=new Array(e.length);return g.C.forEach((n=>{if(n.props.canSelect){const o=e.indexOf(n.props.store);if(o>=0){const e=n.getNode();e&&(t[o]=e)}}})),e.filter(((n,o)=>{const r=t[o];return n&&!e.some(((e,n)=>{const o=t[n];return Boolean(o&&o!==r&&r&&o.contains(r))}))}))}function F(e){_.default.setState({..._.default.state,phase:e.phase}),e.phase===_.SelectionPhase.Editing||e.preventClearEditingText||C.clear({preventDismissMobileKeyboard:e.preventDismissMobileKeyboard,environment:e.environment})}function Z(e){const{stores:t}=e,n=_.default.state.stores,o=a.G0(t,n);o.length===t.length&&o.length===n.length||_.default.setState({..._.default.state,stores:e.stores}),t.length>0&&(s.wG(),h.Mp(t)||f.MO())}function U(e){_.default.setState({..._.default.state,pivot:e.pivot})}function V(e){const{environment:t}=e,n=E(e.stores);Z({stores:n}),F({environment:e.environment,phase:e.phase||_.SelectionPhase.Selected}),1===n.length&&function(e){var t;const n=e.anchor,o=null===(t=g.C.findSelectableFromStore(n))||void 0===t?void 0:t.getNode();let r;o&&(r=_.default.getDefaultContainerFromTarget(o)),_.default.setState({..._.default.state,anchor:n,anchorContainer:r})}({anchor:n[0]});const o=e.pivot||n[0];if(U({pivot:o}),r.default.afterNextFlush((()=>{B(n)})),e.phase===_.SelectionPhase.Editing&&o)if(t.device.isMobile)I.hQ(t);else if(!t.device.isMobileBrowser){const e=g.C.findScrollToSelectableFromStore(o);e&&I.XW({handle:e,vertical:{reveal:"closest"},horizontal:e.props.disableScrollToRevealHorizontal?void 0:{reveal:"closest"}})}}function N(e){void 0===e.toggle&&(e.toggle=!1),void 0===e.selectBetween&&(e.selectBetween=!1);const{stores:t}=_.default.state;if(e.toggle)a.q9(t,e.store)?V({environment:e.environment,stores:a.zu(t,e.store)}):V({environment:e.environment,stores:a.G0(t,[e.store])});else if(e.selectBetween){let n=a.d9(t);const o=P(),r=o.indexOf(e.store);a.q9(n,e.store)||n.push(e.store);const i=t[0];if(i){const e=o.indexOf(i);if(e>=0){const t=a.tP(o,r,e);n=a.G0(n,t)}}const s=a.Z$(t);if(s){const e=o.indexOf(s);if(e>=0){const t=a.tP(o,e,r);n=a.G0(n,t)}}V({environment:e.environment,stores:n})}else a.q9(t,e.store)||V({environment:e.environment,stores:[e.store]});F({environment:e.environment,phase:_.SelectionPhase.Selected})}function O(e){const{environment:t,store:n}=e;if(n)if(Z({stores:[n]}),U({pivot:void 0}),F({environment:t,phase:_.SelectionPhase.Editing}),t.device.isMobile)I.hQ(t);else if(!t.device.isMobileBrowser){const e=g.C.findScrollToSelectableFromStore(n);e&&I.XW({handle:e,vertical:{reveal:"closest"},horizontal:e.props.disableScrollToRevealHorizontal?void 0:{reveal:"closest"}})}}function L(e){const{stores:t}=_.default.state,n=t[0];if(!n)return;const o=g.C.findSelectableFromStore(n);if(o&&o.props.onEditText){const t=o.props.onEditText;M.createAndCommit({userAction:"selectionActions.editSelection",environment:e,perform:e=>{t({isAtStartOfLine:!1,isClick:!1,transaction:e})}})}}function j(e){const{environment:t,stores:n}=e,o=a.Z$(n);if(!o)return;const r=g.C.findSelectableFromStore(o);if(r&&r.props.onEditText){const e=r.props.onEditText;M.createAndCommit({userAction:"selectionActions.editStoresAtEnd",environment:t,perform:t=>{e({isAtStartOfLine:!1,isClick:!1,transaction:t})}})}}function K(e){let{environment:t,preventDismissMobileKeyboard:n}=e;Z({stores:[]}),F({environment:t,phase:_.SelectionPhase.Selected,preventDismissMobileKeyboard:n}),x.xv(),v.xv(),w.xv()}function z(e){const{environment:t}=e,n=_.default.state.stores;B(n);const o=_.default.state.pivot,r=n[0];if(r)if(e.shiftKey)if(o===r){const o=(0,d.Bj)({includeNonSelectableListContainer:!1}),s=(0,d.v5)(r,o.children),{prev:l,parent:c}=e.altKey?(0,i.Sr)(o,s):(0,i.YL)(o,s);if(l){const e=l.value.store;V({environment:t,stores:a.G0(n,[e]),pivot:e})}else if(c){const e=c.value.store;V({environment:t,stores:a.G0(n.filter((e=>!(0,i.Yz)(c,(t=>t.store===e)))),[e]),pivot:e})}}else A(e.environment);else{const n=(0,d.Bj)({includeNonSelectableListContainer:!1}),o=(0,d.v5)(r,n.children),{prev:a,parent:s}=e.altKey?(0,i.Sr)(n,o):(0,i.YL)(n,o);if(a){const e=a.value.store;V({environment:t,stores:[e],pivot:e})}else if(s){const e=s.value.store;V({environment:t,stores:[e],pivot:e})}else V({environment:t,stores:[r],pivot:r})}else if(o)V({environment:t,stores:[o]});else{const e=P(),n=a.Z$(e);n&&V({environment:t,stores:[n],pivot:n})}q()}function q(){const e=_.default.state.pivot||_.default.state.stores[0],t=g.C.findScrollToSelectableFromStore(e);t&&I.XW({handle:t,vertical:{reveal:"top"},horizontal:t.props.disableScrollToRevealHorizontal?void 0:{reveal:"closest"}})}function H(e){const t=_.default.state.stores;B(t);const n=_.default.state.pivot;if(0!==t.length&&n)if((0,u.BX)(n)&&S.Z.isOpen(n.id))V({environment:e,stores:[n],pivot:n}),T.rd({blockId:n.id,state:!1,currentUserId:e.currentUser.id});else if((0,l.bX)(n))k.e2(n);else{const t=(0,d.Bj)({includeNonSelectableListContainer:!1}),o=(0,d.v5)(n,t.children),r=(0,i.ub)(o);if(r){const t=r.value.store;V({environment:e,stores:[t],pivot:t})}else V({environment:e,stores:[n],pivot:n})}else if(n)V({environment:e,stores:[n]});else{const t=P(),n=a.Z$(t);n&&V({environment:e,stores:[n],pivot:n})}q()}function G(e){const{environment:t}=e,n=_.default.state.stores;B(n);const o=_.default.state.pivot,r=a.Z$(n);if(r)if(e.shiftKey)if(o===r){const e=(0,d.Bj)({includeNonSelectableListContainer:!1}),o=(0,d.v5)(r,e.children),{next:s}=(0,i.Xf)(e,o);if(s){const e=s.value.store;V({environment:t,stores:a.G0(n,[e]),pivot:e})}}else A(t);else{const n=(0,d.Bj)({includeNonSelectableListContainer:!1}),o=(0,d.v5)(r,n.children),{next:a}=e.altKey?(0,i.Xf)(n,o):(0,i.lj)(n,o);if(a){const e=a.value.store;V({environment:t,stores:[e],pivot:e})}else V({environment:t,stores:[r],pivot:r})}else if(o)V({environment:t,stores:[o]});else{const e=P()[0];e&&V({environment:t,stores:[e],pivot:e})}W()}function W(){const e=_.default.state.pivot||a.Z$(_.default.state.stores);if(e){const t=g.C.findScrollToSelectableFromStore(e);t&&I.XW({handle:t,vertical:{reveal:"bottom"},horizontal:t.props.disableScrollToRevealHorizontal?void 0:{reveal:"closest"}})}}function $(e){const t=_.default.state.stores;B(t);const n=_.default.state.pivot;if(0!==t.length&&n)if((0,u.BX)(n)&&!S.Z.isOpen(n.id))V({environment:e,stores:[n],pivot:n}),T.rd({blockId:n.id,state:!0,currentUserId:e.currentUser.id});else if((0,l.bX)(n))k.FC(n);else{const t=(0,d.Bj)({includeNonSelectableListContainer:!1}),o=(0,d.v5)(n,t.children),r=(0,i.si)(o);if(r){const t=r.value.store;V({environment:e,stores:[t],pivot:t})}else V({environment:e,stores:[n],pivot:n})}else if(n)V({environment:e,stores:[n]});else{const t=P()[0];t&&V({environment:e,stores:[t],pivot:t})}W()}function Y(e){const t=P();V({environment:e,stores:t,pivot:t[0]})}function Q(e){const t=P()[0];if(t){V({environment:e,stores:[t],pivot:t});const n=g.C.findScrollToSelectableFromStore(t);n&&I.XW({handle:n,vertical:{reveal:"top"},horizontal:n.props.disableScrollToRevealHorizontal?void 0:{reveal:"closest"}})}}function J(e){const t=P(),n=t[t.length-1];if(n){V({environment:e,stores:[n],pivot:n});const t=g.C.findScrollToSelectableFromStore(n);t&&I.XW({handle:t,vertical:{reveal:"bottom"},horizontal:t.props.disableScrollToRevealHorizontal?void 0:{reveal:"closest"}})}}function X(){const e=performance.now(),t=new Map,n=new Map;g.C.forEach((e=>{const o=e.getNode();if(o&&o instanceof Element){const r=o.getBoundingClientRect();t.set(e,r),n.set(o,r)}}));const o=new Map;m.Z.forEach((e=>{const t=e.getNode();t&&t instanceof Element&&o.set(e,t.getBoundingClientRect())}));const r=new Map;p.Z.forEach((e=>{const t=e.getNode();t&&t instanceof Element&&r.set(e,t.getBoundingClientRect())})),b.Z.setState({...b.Z.state,selectableRectMap:t,selectableContainerRectMap:o,selectableElementRectMap:n,lastUpdate:e}),y.Z.setState({...y.Z.state,dropTargetRectMap:r})}const ee=a.P2(X,200)},164964:(e,t,n)=>{n.d(t,{C1:()=>p,d4:()=>c,d8:()=>u,lB:()=>d,oV:()=>s,rN:()=>l});n(667294);var o=n(215828),r=n(606854),i=n(801310),a=n(785893);function s(e){const t={...e,key:(0,o.ZP)()};i.ZP.setState({...i.ZP.state,currentItem:t}),"keep"!==t.durationMs&&setTimeout((()=>{i.ZP.state.currentItem===t&&"keep"!==i.ZP.state.currentItem.durationMs&&i.ZP.setState({...i.ZP.state,currentItem:void 0,shouldReset:!0})}),t.durationMs??i.Ty)}function l(){i.ZP.setState({...i.ZP.state,currentItem:void 0})}function c(e){const{item:t,undoFunc:n}=e;s({...t,right:(0,a.jsx)(r.ow,{onUndo:n})})}function d(e){const{item:t}=e;s({...t,right:(0,a.jsx)(r.k$,{})})}function u(e){const{blockToOpenStore:t,item:n,performUndo:o}=e;s({...n,right:(0,a.jsx)(r.wr,{blockToOpenStore:t,performUndo:o})})}function p(){i.ZP.state.shouldReset&&i.ZP.reset()}},29974:(e,t,n)=>{n.d(t,{$F:()=>xe,FB:()=>Le,L5:()=>ke,LV:()=>je,Ns:()=>Re,O2:()=>Ee,OF:()=>Ie,Xr:()=>Ce,Xv:()=>Ue,Y5:()=>De,_Q:()=>Ve,_u:()=>we,bf:()=>Ae,ce:()=>be,eX:()=>ye,j:()=>Me,jF:()=>Ze,lF:()=>Be,mo:()=>Fe,oy:()=>Ne,wg:()=>Oe,wh:()=>ve,y3:()=>Se,ys:()=>Te});n(21703),n(757658);var o=n(815145),r=n(568626),i=n(471924),a=n(772141),s=n(145953),l=n(421202),c=n(475246),d=n(577858),u=n(429369),p=n(766079),m=n(590965),g=n(554153),f=n(709291),h=n(653965),v=n(552629),y=n(937850),b=n(926249),_=n(401898),S=n(275754),k=n(772899),w=n(81598),x=n(95477),I=n(296994),C=n(855337),T=n(215010),M=n(783105),P=n(433929),A=n(396691),R=n(367669),D=n(548779),B=n(195697),E=n(555081),F=n(710929),Z=n(830806),U=n(394841),V=n(823376),N=n(116746),O=n(478861),L=n(80444),j=n(521273),K=n(788632),z=n(385555),q=n(421051),H=n(269327),G=n(206258),W=n(897630),$=n(333493),Y=n(91536),Q=n(614549),J=n(781918),X=n(21359),ee=n(135253),te=n(547307),ne=n(957400),oe=n(294273),re=n(594419),ie=n(792625),ae=n(929533),se=n(476464),le=n(709953),ce=n(504408),de=n(608055),ue=n(901357),pe=n(305851),me=n(328014),ge=n(210228),fe=n(970782);const he=(0,f.defineMessages)({deletingWorkspace:{id:"spaceActions.deletingWorkspace.loadingMessage",defaultMessage:"Deleting workspace…"},goOnlineCreateSpace:{defaultMessage:"Please go online to create your workspace.",id:"spaceActions.dialogError.createWorkspaceError.goOnline.message"},createSpaceError:{defaultMessage:"Sorry! We could not create your workspace. Please try again.",id:"spaceActions.dialogError.createWorkspaceError.message"},loginToCreateSpace:{defaultMessage:"Must be logged in.",id:"spaceActions.dialogError.createWorkspaceError.notLoggedIn.message"},moveToSpaceOnlineError:{defaultMessage:"Please go online to move content to another space.",id:"spaceActions.dialogError.moveContentError.goOnline.message"},cannotMoveShardRestriction:{defaultMessage:"Cannot move these pages at once.",id:"spaceActions.dialogError.moveContentError.cannotMovePages.message"},cannotMoveContent:{defaultMessage:"Sorry! We could not move this content. Please try again.",id:"spaceActions.dialogError.couldNotMoveContentError.message"},loginToMoveContent:{defaultMessage:"Must be logged in.",id:"spaceActions.dialogError.movetoWorkspace.notLoggedIn.message"},invalidSpaceStore:{defaultMessage:"Invalid space data.",id:"spaceActions.dialogError.createTemplatesInSpace.invalidStorage.message"},invalidSpaceStoreOnNavigate:{defaultMessage:"Invalid space data.",id:"spaceActions.dialogError.navigateToWorkspace.invalidStorage.message"},noSpaceViewOnJoin:{defaultMessage:"No space view data was created.",id:"spaceActions.dialogError.joinWorkspace.invalidWorkspaceStorage.message"},noLocalDataForPermissionGroup:{defaultMessage:"No local data about this workspace.",id:"spaceActions.dialogError.createOrUpdatePermissionGroup.invalidWorkspaceStorage.message"}});async function ve(e){const{environment:t,name:n,domain:o,userRootStore:i,emailDomains:a,analyticsFrom:s,icon:l,planType:m,userPersona:g,shouldCreateUserPersonaTeam:f,shouldMakeUserPersonaTeamDefault:v}=e,{id:y}=t.currentUser;if(y){const e=await X.createSpace(t,{name:n,domain:o,emailDomains:a,icon:l,planType:m,initialPersona:g,shouldCreateUserPersonaTeam:f,shouldMakeUserPersonaTeamDefault:v});if("failed"===e.type){if(e.offline)throw new Error(P.default.formatMessage(he.goOnlineCreateSpace));throw new Error(P.default.formatMessage(he.createSpaceError))}const{spaceId:b,teamId:_,personaTeamId:S,inviteLinkCode:k}=e.data,w=new G.H2(t,{table:c.bx,id:b}),x=_?G.zX.createChildStore(w,{table:u.e0,id:_}):void 0,I=S?G.zX.createChildStore(w,{table:u.e0,id:S}):void 0,{serverCommitResult:C,performResult:{spaceViewStore:M}}=ge.createAndCommit({userAction:"spaceActions.createSpace",environment:t,perform:e=>{const n=le.ae({environment:t,table:d.zU,value:{space_id:w.id,notify_mobile:!0,notify_desktop:!0,notify_email:!0,parent_id:y,parent_table:p.dx,alive:!0,joined:!0,joined_teams:(x||I)&&h.oA([null==x?void 0:x.id,null==I?void 0:I.id]),settings:{notify_email_digest:!0},first_joined_space_time:Date.now()},inMemoryRecordCache:i.inMemoryRecordCache,transaction:e}),o=new G.V9(t,n.pointer);return re.R3({parentStore:i.getSpaceViewsStore(),appendStore:n,transaction:e}),re.MK({parentStore:i.getSpaceViewPointersStore(),appendStore:n,transaction:e}),t.device.isMobileNative&&r.log({level:"info",from:"spaceActions",type:"SpaceSwitchingDebug",data:{message:"spaceActions.createSpace setting space"}}),L.default.setState({...L.default.state,currentSpaceStore:w,currentSpaceViewStore:o}),J.VT(t,{from:s,planType:m,isProfessionalTeamUser:(0,T.QZ)(),domain_type:(0,T.JF)()}),{spaceViewStore:o}}});return await C,await ne.Yh(t),{spaceViewStore:M,spaceStore:w,inviteLinkCode:k,teamStore:x,personaTeamStore:I}}throw new Error(P.default.formatMessage(he.loginToCreateSpace))}async function ye(e){const{environment:t,blockStores:n,spaceId:o,targetParent:i}=e,{id:a}=t.currentUser;if(a){if(!K.Z.state.online)return{error:P.default.formatMessage(he.moveToSpaceOnlineError)};const e=[],u=[];for(const t of n)t.isDefined()&&(e.push({id:t.id,spaceId:t.getSpaceId()}),u.push(o));if(h.jj(u).length>1)return{error:P.default.formatMessage(he.cannotMoveShardRestriction)};if(i&&i.spaceId!==o)return{error:P.default.formatMessage(he.cannotMoveShardRestriction)};const p=X.moveToSpace(t,{blocks:e,targetSpaceId:o,targetParent:i,clearPermissions:(0,B.bq)()});let m;for await(const n of p){if(ae.R(n,o),n.error)return C.K4(t,"move_to_space_error",{}),r.log({level:"error",from:"spaceActions",type:"moveSpaceError",error:(0,v.Ui)(n.error),data:{userId:a,blocks:e,spaceId:o}}),{error:P.default.formatMessage(he.cannotMoveContent)};{const e=s.PF.create(n.value.recordMap).getByTable(l.iU);for(const{value:t}of e){var c,d;if("copy_indicator"===(null==t||null===(c=t.value)||void 0===c?void 0:c.type))m=null==t||null===(d=t.value)||void 0===d?void 0:d.id}}}return ae.h(o),{value:m}}return{error:P.default.formatMessage(he.loginToMoveContent)}}async function be(e){const{environment:t,spaceViewStore:n,openInNew:o,isNewlyCreatedSpace:i,leavingSpace:a}=e;await n.awaitNonNullValue();const s=n.getSpaceStore();if(!s)throw new Error(P.default.formatMessage(he.invalidSpaceStoreOnNavigate));if(!o){try{const{dictationActions:e}=await I.FF.dictation.load();await e.stopDictation({environment:t})}catch(d){}if(ee.qL({bannerStore:q.Z,id:"SubscriptionEditingBlocker"}),t.device.isMobileNative&&r.log({level:"info",from:"spaceActions",type:"SpaceSwitchingDebug",data:{message:"spaceActions.switchToSpace",spaceId:s.id}}),L.default.setState({...L.default.state,currentSpaceStore:s,currentSpaceViewStore:n}),a){const e=await(0,D.rg)(t,n);e&&((0,A.Wl)({spaceView:n.getModel(),pageId:e.id}),L.default.setState({...L.default.state,mainEditorCurrentBlockStore:e}))}}$.Z.reset();const l=t.currentUser.id,c=n.getUserRootParentId();if(c&&l!==c){const e=await fe.x({environment:t,newCurrentUserId:c});await W.OR({environment:e,spaceId:s.id,isNewlyCreatedSpace:i});const{currentUserSettingsStore:n,currentUserRootStore:o}=L.default.state;return{switchedUser:!0,newEnvironment:e,newUserRootStore:o,newUserSettingsStore:n}}return await W.OR({environment:t,spaceId:s.id,isNewlyCreatedSpace:i}),{switchedUser:!1}}async function _e(e){const{spaceViewStore:t,redirectPageId:n,openInNew:i,isNewlyCreatedSpace:a,templateGalleryItem:s,projectManagementLaunch:c,redirect:d,leavingSpace:u,pageVisitSource:p,forceLandLastVisitedPage:m,navigateToStore:g}=e;let{environment:f,userSettingsStore:h,userRootStore:v}=e;const y=t.getSpaceStore();if(!y)throw new Error(P.default.formatMessage(he.invalidSpaceStoreOnNavigate));const b=await be({environment:f,spaceViewStore:t,openInNew:i,isNewlyCreatedSpace:a,leavingSpace:u});b.switchedUser&&(f=b.newEnvironment,h=b.newUserSettingsStore,v=b.newUserRootStore),N.default.isOpen()&&(0,V.TN)({environment:f}),j.Z.isAiEnabled()&&(w.assistantDependency.load().then((e=>{let{assistantActions:t}=e;t.clearAllAssistantSessions()})),async function(e,t){const{aiQnaActions:n}=await k.aiDependency.load();n.resetSlackQnaConnectionState({environment:e,spaceStore:t}),n.resetGoogleDriveQnaConnectionState({environment:e,spaceStore:t})}(f,y));const _=v&&v.getSpaceViewStores(),x=D.g4(f,{space:y.getModel(),spaceView:null==t?void 0:t.getModel()}),I=U.Al(t);if(g)return void S._c({environment:f,store:g,visitType:M.vu.Link,pageVisitSource:o.tY.NewWorkspaceWorkflowTemplateOnboarding});if(n)return void S._c({environment:f,store:new G.G(f,{table:l.iU,id:n}),openInNew:i,pageVisitSource:p,redirect:d});if((0,F.Ck)(f)&&ue.d(f),v&&await H.Z.reinitializeState(f,v.id,y.id),m||"last_visited_page"===x){const e=function(e){const{spaceId:t}=e,n=H.Z.getWithoutSubscribing(t);if(!Array.isArray(n))return;const o=n[0];if(void 0===(null==o?void 0:o.pageId))return;return o.store}({environment:f,spaceId:y.id});if(e&&e.canRead()&&e.pathIsAccessibleAndAlive()&&!R.IJ(f,e))return void S._c({environment:f,store:e,openInNew:i,templateGalleryItem:s,projectManagementLaunch:c,pageVisitSource:o.tY.LastVisitedPage,redirect:d})}if("personal_home"===x&&I&&(await I.load(),I.canRead()))return S._c({environment:f,store:I,openInNew:i,templateGalleryItem:s,projectManagementLaunch:c,pageVisitSource:o.tY.DefaultHome,redirect:d}),void(0,Z.$X)({environment:f,from:"on_app_start_page"});if("chat"===x)return void de.c4({environment:f,url:"/chat",redirect:d});const C=await(0,D.rg)(f,t);if(C)return(0,A.Wl)({spaceView:t.getModel(),pageId:C.id}),void S._c({environment:f,store:C,openInNew:i,templateGalleryItem:s,projectManagementLaunch:c,pageVisitSource:p,redirect:d});if(y.canEdit()){const{performResult:e}=ge.createAndCommit({userAction:"spaceActions.createdPage",environment:f,perform:e=>me.KE({environment:f,spaceStore:y,spaceViewStore:t,isPrivate:!0,transaction:e,prepend:!1})});S._c({environment:f,store:e,openInNew:i,pageVisitSource:p,redirect:d})}else{if(h&&v&&_&&_.length>0&&_[0]&&_[0].id!==t.id)return oe.vq(),f.device.isMobileNative&&r.log({level:"info",from:"spaceActions",type:"SpaceSwitchingDebug",data:{message:"navigateToFirstSpace because navigateToSpace didn't find a page"}}),void(await ke({environment:f,userRootStore:v,userSettingsStore:h,openInNew:i,pageVisitSource:p}));oe.vq(),await E.xN(f)}}async function Se(e){L.default.setState({...L.default.state,spaceTransitionStatus:e.navigationType}),await _e(e),await ne.Yh(e.environment,!0),L.default.setState({...L.default.state,spaceTransitionStatus:"notTransitioning"})}async function ke(e){const{environment:t,userRootStore:n,ignoreSpaceId:o,userSettingsStore:r,openInNew:i,skipPendingTransferWorkspaces:a,leavingSpace:s,templateGalleryItem:l,projectManagementLaunch:c,pageVisitSource:d,redirect:u,forceLandLastVisitedPage:p}=e;await n.load();const g=n.getSpaceViewStores();await Promise.all(g.map((e=>e.load())));const f=g.filter((e=>{var t;return!!e.isDefined()&&(o?e.getSpaceId()!==o:!a||!(0,m.DI)(null===(t=e.getSpaceStore())||void 0===t||null===(t=t.getSettings())||void 0===t?void 0:t.space_request))}));let h;for(const m of f){if(!D.Cx(m.getSpaceStore())){h=m;break}{const e=await(0,D.rg)(t,m);if(e&&e.isDefined()){h=m,(0,A.Wl)({spaceView:m.getModel(),pageId:e.id});break}}}h?await Se({environment:t,spaceViewStore:h,userSettingsStore:r,userRootStore:n,openInNew:i,leavingSpace:s,templateGalleryItem:l,projectManagementLaunch:c,pageVisitSource:d,redirect:u,navigationType:"switchingToOrLoadingSpace",forceLandLastVisitedPage:p}):(oe.vq(),await E.xN(t))}async function we(e){const{environment:t,index:n,userRootStore:r,userSettingsStore:i}=e,a=O.Z.getAllSpaceViewStores(t)[n];a&&await Se({environment:t,spaceViewStore:a,userSettingsStore:i,userRootStore:r,pageVisitSource:o.tY.SwitchSpace,navigationType:"switchingToOrLoadingSpace"})}async function xe(e){const{environment:t,spaceStore:n}=e;n.isDefined()&&!(0,b.Z)(n.getEmailDomains(),e.emailDomains)&&Q.xG(t,{domains:e.emailDomains||[],confirmed:!0});const o={email_domains:e.emailDomains};e.name&&(o.name=e.name);const r={};for(const i of(0,_.Yd)(o)){const e=n.getKeyStore(i).getValue(),t=o[i];h.Xy(e,t)||(r[i]=t||null)}h.xb(r)||await new Promise(((e,o)=>{ge.createAndCommit({userAction:"spaceActions.updateSpace",environment:t,perform:t=>{le.sW({store:n,data:r,transaction:t}),t.postSubmitCallbacks.push((t=>{t?o(t):e()}))}})}))}async function Ie(e){const{environment:t,spaceStore:n,spaceBasicSettingsStore:o,securitySettingsStore:r}=e,{name:i,emailDomains:a}=o.state;await Promise.all([xe({environment:t,spaceStore:n,name:i,emailDomains:a}),r?pe.n(t,{spaceStore:n,securitySettingsState:r.state}):Promise.resolve()])}function Ce(e){const{environment:t,transaction:n,spaceStore:o,disablePublicAccess:r,disableGuests:i,disableMoveToSpace:a,disableExport:s,disableSpacePageEdits:l,disablePublicAccessRequests:c,disableTeamCreation:d,disableMembershipRequests:u,disableExternalMembershipRequests:p,disableGuestMembershipRequests:m,enableAiFeature:g,disableTeamGuests:f,enableGuestInviteRequests:h,enableAiTraining:v,zeroRetentionEnabled:y}=e;le.sW({store:o,data:{disable_public_access:r,disable_guests:i,disable_move_to_space:a,disable_export:s,disable_space_page_edits:l,disable_public_access_requests:c,settings:{...o.getSettings(),enable_ai_feature:g,disable_team_guests:f,enable_guest_invite_requests:h,enable_ai_training:v,zero_retention_enabled:y},disable_team_creation:d},transaction:n}),ge.applyOperation({store:o,operation:{pointer:o.pointer,path:["settings","disable_membership_requests"],command:"set",args:u},transaction:n}),ge.applyOperation({store:o,operation:{pointer:o.pointer,path:["settings","disable_external_membership_requests"],command:"set",args:p},transaction:n}),ge.applyOperation({store:o,operation:{pointer:o.pointer,path:["settings","disable_guest_membership_requests"],command:"set",args:m},transaction:n}),c&&Y.Jp(t,{disable_public_access_requests:c})}function Te(e){const{transaction:t,spaceStore:n,inviteLinkEnabled:o}=e;le.sW({store:n,data:{invite_link_enabled:o},transaction:t})}async function Me(e){const{environment:t,spaceId:i,userRootStore:a,navigate:s,analyticsFrom:l,userSettingsStore:c,redirectPageId:d,inviteCode:u,redirectSource:p,isOnboarding:m}=e,f=await Pe({userRootStore:a,spaceId:i,waitForLoad:!1});if(!f){const n=await X.addUsersToSpace(t,{userIds:[a.id],spaceId:e.spaceId,inviteCode:u});if("failed"===n.type)throw n.body&&n.body.clientData&&"invite_link_disabled"===n.body.clientData.type&&g.Z.remove(F.WX),r.log({level:"error",from:"spaceActions",type:"addUsersToSpace",error:(0,v.Ui)(n.error),data:{miscDataToConvertToString:{response:n}}}),n.error}const h=f||await Pe({userRootStore:a,spaceId:i,waitForLoad:!1});if(!h)throw new Error(P.default.formatMessage(he.noSpaceViewOnJoin));await h.load();const y=h.getJoined();if(y||(ge.createAndCommit({userAction:"spaceActions.joinSpace",environment:t,perform:e=>{!function(e){le.sW({store:e.spaceViewStore,data:{joined:!0},transaction:e.transaction})}({spaceViewStore:h,transaction:e})}}),x.default.isAdminMode||(X.setSpaceNotificationsAsRead(t,{timestamp:Date.now(),spaceId:i}),J.Pv(t,{from:p??l})),m||await async function(e){if("on"!==z.default.getEligibleGroup({experimentId:"generate_private_templates_for_invited_joiners",defaultGroup:"control"}))return;const{environment:t,spaceViewStore:o,userSettingsStore:r,userRootStore:i}=e,{onboardingActionsDependency:a}=await n.e(55006).then(n.bind(n,255006)),{createOnboardingTemplatesActions:s}=await a.load(),l=s.getStarterTemplatesForSpace({onboardingPlanType:"team",categories:[],isJoiner:!0,intl:P.default.getIntl()});await s.createTemplatePagesInSpace({environment:t,redirectData:{type:"getting_started_page"},spaceViewStore:o,isPrivate:!0,userSettingsStore:r,userRootStore:i,templatesAndType:{templates:l,templateType:"page_template"},planType:"team",spaceJoinOrCreate:"join",useCases:[],userPersona:"unfilled",isNewUserOnboarding:!1})}({environment:t,spaceViewStore:h,userSettingsStore:c,userRootStore:a})),s&&await Se({environment:t,spaceViewStore:h,userSettingsStore:c,redirectPageId:d,userRootStore:a,pageVisitSource:o.tY.SwitchSpace,navigationType:f?"switchingToOrLoadingSpace":"joiningOrCreatingSpace"}),!f&&(L.default.setState({...L.default.state,currentSpaceStore:h.getSpaceStore(),currentSpaceViewStore:h}),W.OR({environment:t,spaceId:i}).then((()=>{J.kj(t,{from:l})})),g.Z.remove(F.WX),t.device.isMobileNative&&r.log({level:"info",from:"spaceActions",type:"SpaceSwitchingDebug",data:{message:"spaceActions.joinSpace"}}),ne.Th({environment:t}),await ne.Yh(t),!y)){const e=u?"shareable_link_join":"verified_domain_join";J.Jk(t,{invite_origin:e,domainType:(0,T.JF)(),new_workspace_member_count:1,new_workspace_member_ids:[a.id]})}return{spaceViewStore:h}}async function Pe(e){const t=e.userRootStore.getSpaceViewStores();return e.waitForLoad&&await y.Lc(t,10,(e=>e.load())),t.find((t=>t.getSpaceId()===e.spaceId))}async function Ae(e){const{environment:t,spaceId:n,userSettingsStore:r}=e,{currentUserRootStore:i,currentUserStore:a}=L.default.state;if(i&&a){const e=await X.removeUsersFromSpace(t,{userIds:[a.id],spaceId:n,removePagePermissions:!0,revokeUserTokens:!1});return"success"===e.type?(ke({environment:t,userRootStore:i,ignoreSpaceId:n,userSettingsStore:r,leavingSpace:!0,pageVisitSource:o.tY.SwitchSpace}),!0):(te.showError(e),!1)}}async function Re(e){const{environment:t,spaceId:n,userSettingsStore:r}=e,{currentUserRootStore:i,currentUserStore:a}=L.default.state;if(i&&a){ie.j({message:he.deletingWorkspace});try{const{value:e}=await X.deleteSpace(t,{spaceId:n}).next();if(e.error)throw e.error;await ce.bG({environment:t,inMemoryRecordCache:t.defaultRecordCache.inMemoryRecordCache,pointer:{table:p.dx,id:i.id},userId:t.currentUser.id}),ke({environment:t,userRootStore:i,ignoreSpaceId:n,userSettingsStore:r,pageVisitSource:o.tY.SwitchSpace})}finally{ie.x()}}}function De(e){const{environment:t,blocks:n,transaction:o}=e,r=t.currentUser.id;if(r)for(const i of n){const e=i.getPermissionItems().filter((e=>(0,a.FB)(e)));le.sW({store:i,data:{permissions:[...e,{type:"user_permission",role:"editor",user_id:r}]},transaction:o})}}function Be(e){const{environment:t,blocks:n,transaction:o}=e;if(t.currentUser.id)for(const r of n){const e=r.getPermissionItems(),n=e.find((e=>"space_permission"===e.type)),i=e.filter((e=>(0,a.FB)(e)));n||se.l3({environment:t,store:r,permissionItems:[...i,{type:"space_permission",role:"editor"}],transaction:o})}}function Ee(e){const{blocks:t,transaction:n}=e;for(const o of t){const e=o.getPermissionItems().filter((e=>(0,a.FB)(e)));le.sW({store:o,data:{permissions:e.length>0?e:null},transaction:n})}}function Fe(e){const{spaceStore:t,transaction:n}=e;if(!t.isDefined())throw new Error(P.default.formatMessage(he.noLocalDataForPermissionGroup));const o=Date.now(),r={id:i.Il(),last_edited_time:o};return ge.applyOperation({store:t,operation:{pointer:t.pointer,path:[...t.path,"permission_groups"],command:"keyedObjectListBefore",args:{value:r}},transaction:n}),r}function Ze(e){const{spaceStore:t,group:n,transaction:o}=e;if(!t.isDefined())throw new Error(P.default.formatMessage(he.noLocalDataForPermissionGroup));ge.applyOperation({store:t,operation:{pointer:t.pointer,path:[...t.path,"permission_groups"],command:"keyedObjectListUpdate",args:{value:n}},transaction:o})}async function Ue(e){const{environment:t,spaceStore:n,group:o,transaction:r}=e;if(!n.isDefined())throw new Error(P.default.formatMessage(he.noLocalDataForPermissionGroup));ge.applyOperation({store:n,operation:{pointer:n.pointer,path:[...n.path,"permission_groups"],command:"keyedObjectListRemove",args:{remove:{id:o.id}}},transaction:r}),await X.transferPermissionGroup(t,{spaceId:n.id,groupId:o.id})}function Ve(e){const{userRootStore:t,spaceViewIds:n,transaction:o,spaceViewPointers:r}=e;le.sW({store:t,data:{space_views:n,space_view_pointers:r},transaction:o})}function Ne(e){const{planType:t,spaceStore:n,transaction:o}=e;le.sW({store:n,data:{plan_type:t},transaction:o})}function Oe(e,t,n){const o=n||L.default.state.currentSpaceStore;if(!o)throw r.log({level:"error",from:"spaceActions",type:"setSpaceSurveyData",error:{message:"Couldn't find a SpaceStore."}}),new Error;ge.createAndCommit({userAction:"spaceActions.setSpaceSurveyData",environment:e,perform:e=>{Ke(o,e,{space_survey_data:t})}})}function Le(e,t){const n=t||L.default.state.currentSpaceStore;if(!n)throw r.log({level:"error",from:"spaceActions",type:"setHIPAACompliancyData",error:{message:"Couldn't find a SpaceStore."}}),new Error;const o=e.currentUser.id;if(!o)throw r.log({level:"error",from:"spaceActions",type:"setHIPAACompliancyData",error:{message:"No User"}}),new Error;const i={last_edited_time:Date.now(),last_edited_by_id:o};ge.createAndCommit({userAction:"spaceActions.setHIPAACompliancyData",environment:e,perform:e=>{Ke(n,e,{hipaa_compliancy_data:i})}})}function je(e){const t=e.getEditDomain();return t?`${window.location.host}/${t}`:null}function Ke(e,t,n){ge.applyOperation({store:e,operation:{pointer:e.pointer,path:["settings"],command:"update",args:{...e.getSettings(),...n}},transaction:t})}},328014:(e,t,n)=>{n.d(t,{Hj:()=>k,KE:()=>S,OQ:()=>w,cc:()=>x,sY:()=>_,ux:()=>I});n(21703);var o=n(541432),r=n(421202),i=n(709291),a=n(307032),s=n(401898),l=n(278429),c=n(433929),d=n(548779),u=n(385555),p=n(206258),m=n(981193),g=n(276725),f=n(403297),h=n(594419),v=n(709953),y=n(504408),b=n(800993);const _=(0,i.defineMessages)({createAndDuplicatePageError:{defaultMessage:"Duplicated page could not be created.",id:"spaceActions.createAndDuplicatePageInSpace.copyNotCreated.error"},forkPageError:{defaultMessage:"Could not fork page.",id:"spaceActions.dialogError.forkPageError.message"}});function S(e){const{environment:t,spaceViewStore:n,spaceStore:r,isPrivate:i,prepend:a,title:s,transaction:l,loading:c,tracker:d}=e,p=Boolean(u.default.checkGate({gateName:"enable_text_crdt_client"})&&e.useCrdt),m=v.j4({environment:t,type:c?o.Ti.copyIndicator:o.Ti.page,inMemoryRecordCache:r.inMemoryRecordCache,transaction:l,spaceId:r.id,tracker:d,useCrdt:p});return s&&b.sO({environment:t,store:m.getBlockTitleStore(),value:[[s]],transaction:l}),k({environment:t,spaceStore:r,spaceViewStore:n,pageStore:m,isPrivate:i,location:{type:a?"prepend":"append"},transaction:l}),m}function k(e){const{environment:t,spaceStore:n,spaceViewStore:o,pageStore:r,isPrivate:i,location:a,transaction:l}=e,{id:c}=t.currentUser;let d;i?c&&(d={type:"user_permission",role:"editor",user_id:c}):d={type:"space_permission",role:"editor"},v.sW({store:r,data:{permissions:d?[d]:[]},transaction:l}),i&&w({environment:t,spaceStore:n,spaceViewStore:o,transaction:l});const u=a||{type:"append"};"prepend"===u.type?h.Ce({parentStore:i?o.getPrivatePagesStore():n.getPagesStore(),prependStore:r,before:u.before,transaction:l}):"append"===u.type?h.R3({parentStore:i?o.getPrivatePagesStore():n.getPagesStore(),appendStore:r,after:u.after,transaction:l}):(0,s.t1)(u)}function w(e){const{environment:t,spaceStore:n,spaceViewStore:o,transaction:r}=e,i=new Set(o.getPrivatePageStores().map((e=>e.id)));(0,d.XD)(t,n).filter((e=>e.isTopLevelPrivatePage({spaceStore:n,environment:t}))).forEach((e=>{i.has(e.id)||h.R3({parentStore:o.getPrivatePagesStore(),appendStore:e,transaction:r})}))}function x(e){const{environment:t,spaceStore:n,spaceViewStore:o,transaction:r,copyPageId:i,recordMap:a,isPrivate:s,allowCopyExternalObjectInstances:d}=e,u=S({environment:t,spaceStore:n,spaceViewStore:o,isPrivate:s,loading:!0,transaction:r});y.fL({environment:t,inMemoryRecordCache:u.inMemoryRecordCache,recordMap:a,debugSource:"spaceActions.createAndDuplicatePageInSpace"});const p=g.K8(t,{blockId:i,inMemoryRecordCache:u.inMemoryRecordCache,allowCopyCollections:!0,requireFullSubtree:!1,skipTransclusionContainerChildren:!1,allowCopyExternalObjectInstances:d,includeLegacyTransclusionBlockValues:(0,l.hC)()});if(!p)throw new Error(c.default.formatMessage(_.createAndDuplicatePageError));return g.E9({environment:t,sourceBlockId:i,targetBlockPointer:u.pointer,sourceBlockSubtree:p,targetInMemoryRecordCache:u.inMemoryRecordCache,transaction:r,deepCopyTransclusionContainers:!0,resolveTemplateVariables:!0,useCrdt:u.useCrdt(),preventLegacyTransclusions:(0,l.hC)()}),u}async function I(e){const{environment:t,userRootStore:n,isPrivate:o,forkedPageId:i,spaceStore:s,spaceViewStore:l}=e;if(s.canEdit()){const e=p.G.createChildStore(n,{table:r.iU,id:i});f.nM({currentUserId:t.currentUser.id,blockId:void 0});const c=Date.now(),d=await f.OH({environment:t,store:e,spaceStore:s,spaceViewStore:l,isPrivate:o}),u=Date.now()-c;if(m.Xy(t,{from:"onboarding",success:!d.error,template_block_id:i,target_space_id:(0,a.F9)(s.id),context:"fork_page_into_space",template_duplication_duration_ms:u}),void 0===d.error)return d.value}throw new Error(c.default.formatMessage(_.forkPageError))}},310259:(e,t,n)=>{n.d(t,{NY:()=>_,ZJ:()=>h,TY:()=>m,E6:()=>f,pE:()=>p,ce:()=>I,GZ:()=>g,lo:()=>u,pu:()=>y,kY:()=>v,ni:()=>C,ON:()=>d,Rn:()=>x,dg:()=>c,zq:()=>w,pc:()=>S,Q1:()=>k,MA:()=>b,VD:()=>l});n(21703),n(252262),n(324506);var o=n(568626);var r=n(552629),i=n(855337),a=n(80444),s=n(210228);function l(e,t,n){s.applyOperation({store:e,operation:{pointer:e.pointer,path:["settings"],command:"update",args:{...e.getSettings(),...n}},transaction:t})}function c(e){const{currentSpaceViewStore:t}=a.default.state;t&&s.createAndCommit({environment:e,userAction:"AiSlackQnaNotificationTooltip.setSlackQnaNotificationSeenAtToCurrentTimestamp",perform:e=>{l(t,e,{ai_slack_qna_notification_seen_at:Date.now()})}})}function d(e){const{currentSpaceViewStore:t}=a.default.state;t&&s.createAndCommit({environment:e,userAction:"AiGoogleDriveQnaNotificationTooltip.setGoogleDriveQnaNotificationSeenAtToCurrentTimestamp",perform:e=>{l(t,e,{ai_google_drive_qna_notification_seen_at:Date.now()})}})}function u(e){var t;const{currentSpaceViewStore:n}=a.default.state;n&&void 0===(null===(t=n.getSettings())||void 0===t?void 0:t.space_analytics_settings_prompt)&&s.createAndCommit({userAction:"userSettingsActions.initializeSpaceAnalyticsPromptSettings",environment:e,perform:e=>{l(n,e,{space_analytics_settings_prompt:{status:"showing",num_times_shown:0}})}})}function p(e){var t;const{currentSpaceViewStore:n}=a.default.state;if(!n)return;const o=null===(t=n.getSettings())||void 0===t?void 0:t.space_analytics_settings_prompt;if(!o||"dismissed"===o.status||"hidden"===o.status)return;const r={...o,num_times_shown:o.num_times_shown+1};r.num_times_shown>3&&(r.status="hidden"),s.createAndCommit({userAction:"spaceViewActions.incrementSpaceAnalyticsSettings",environment:e,perform:e=>{l(n,e,{space_analytics_settings_prompt:r})}})}function m(e){var t;const{currentSpaceViewStore:n}=a.default.state;if(!n)return;const o=null===(t=n.getSettings())||void 0===t?void 0:t.space_analytics_settings_prompt;o&&"dismissed"!==o.status&&s.createAndCommit({userAction:"spaceViewActions.incrementspaceAnalyticsSettings",environment:e,perform:e=>{l(n,e,{space_analytics_settings_prompt:{status:"dismissed"}})}})}function g(e){var t;const{currentSpaceViewStore:n}=a.default.state;n&&void 0===(null===(t=n.getSettings())||void 0===t?void 0:t.mfa_settings_prompt)&&s.createAndCommit({userAction:"userSettingsActions.initializeMfaPromptSettings",environment:e,perform:e=>{l(n,e,{mfa_settings_prompt:{status:"showing",num_times_shown:0}})}})}function f(e){var t;const{currentSpaceViewStore:n}=a.default.state;if(!n)return;const o=null===(t=n.getSettings())||void 0===t?void 0:t.mfa_settings_prompt;if(!o||"dismissed"===o.status||"hidden"===o.status)return;const r={...o,num_times_shown:o.num_times_shown+1};r.num_times_shown>3&&(r.status="hidden"),s.createAndCommit({userAction:"spaceViewActions.incrementOrHideMfaPrompt",environment:e,perform:e=>{l(n,e,{mfa_settings_prompt:r})}})}function h(e){var t;const{currentSpaceViewStore:n}=a.default.state;if(!n)return;const o=null===(t=n.getSettings())||void 0===t?void 0:t.mfa_settings_prompt;o&&"dismissed"!==o.status&&s.createAndCommit({userAction:"spaceViewActions.dismissMfaPromptSetting",environment:e,perform:e=>{l(n,e,{mfa_settings_prompt:{status:"dismissed"}})}})}function v(e,t){var n;const{currentSpaceViewStore:o}=a.default.state;if(!o)return;const r=(null===(n=o.getSettings())||void 0===n?void 0:n.page_analytics_opt_out_list)||[];r.includes(t)||(s.createAndCommit({userAction:"spaceViewActions.optOutOfPageAnalyticsForPage",environment:e,perform:e=>{l(o,e,{page_analytics_opt_out_list:[...r,t]})}}),i.K4(e,"page_analytics_page_opt_out"))}function y(e,t){var n;const{currentSpaceViewStore:o}=a.default.state;if(!o)return;const r=(null===(n=o.getSettings())||void 0===n?void 0:n.page_analytics_opt_out_list)||[];r.includes(t)&&(s.createAndCommit({userAction:"spaceViewActions.optInToPageAnalyticsForPage",environment:e,perform:e=>{l(o,e,{page_analytics_opt_out_list:r.filter((e=>e!==t))})}}),i.K4(e,"page_analytics_page_opt_in"))}function b(e,t){const{currentSpaceViewStore:n}=a.default.state;n&&s.createAndCommit({userAction:"userSettingsActions.emailDigestSetting.onToggle",environment:e,perform:e=>{l(n,e,{notify_email_digest:t})}})}function _(e){const{currentSpaceViewStore:t}=a.default.state;t&&s.createAndCommit({userAction:"spaceViewActions.confirmAdminContentSearchAcknowledgement",environment:e,perform:e=>{l(t,e,{admin_content_search_acknowledgement:!0})}})}function S(e){var t;const{currentSpaceViewStore:n}=a.default.state;n&&(null!==(t=n.getSettings())&&void 0!==t&&t.has_migrated_to_google_drive_external_integration||s.createAndCommit({userAction:"spaceViewActions.setUserMigratedToGoogleDriveExternalIntegrationInSpace",environment:e,perform:e=>{l(n,e,{has_migrated_to_google_drive_external_integration:!0})}}))}function k(e,t,n){const r=n||a.default.state.currentSpaceViewStore;if(!r)throw o.log({level:"error",from:"spaceActions",type:"setUserSurveyData",error:{message:"Couldn't find a SpaceViewStore."}}),new Error;s.createAndCommit({userAction:"spaceViewActions.setUserSurveyData",environment:e,perform:e=>{l(r,e,{user_survey_data:t})}})}function w(e,t){const{at:n,transactionUserAction:o,spaceViewStore:r}=t;s.createAndCommit({environment:e,userAction:o,perform:e=>{l(r,e,{slack_universal_qna_announcement_seen_at:n})}})}function x(e,t){const{spaceViewStore:n}=t;s.createAndCommit({environment:e,userAction:"GooogleDriveUniversalQnaAnnouncementModal.setSeenAtToCurrentTimestamp",perform:e=>{l(n,e,{google_drive_universal_qna_announcement_seen_at:Date.now()})}})}function I(e,t){var n;const o=(null===(n=t.getSettings())||void 0===n?void 0:n.dismissed_db_page_summary_suggestion)||0;s.createAndCommit({environment:e,userAction:"spaceViewActions.incrementSummarySuggestionDismissCount",perform:e=>{l(t,e,{dismissed_db_page_summary_suggestion:o+1})}})}function C(e){let{environment:t,spaceViewStore:n}=e;const i=n.getModel();if(!i)return;const a=function(e){let{spaceView:t}=e;return[{pointer:{table:"user_root",id:t.parent_id},path:["space_views"],command:"listRemove",args:{id:t.id}},{pointer:{table:"user_root",id:t.parent_id},path:["space_view_pointers"],command:"keyedObjectListRemove",args:{remove:{id:t.id}}},{pointer:{table:"space_view",id:t.id,spaceId:t.space_id},path:[],command:"update",args:{alive:!1}}]}({spaceView:i});try{s.createAndCommit({environment:t,userAction:"spaceViewActions.removeUserSpaceViews",perform:e=>{for(const t of a)s.applyOperation({store:n,operation:t,transaction:e})}})}catch(l){o.log({level:"error",from:"spaceViewActions",type:"removeUserSpaceViews",error:(0,r.Ui)(l)})}}},415690:(e,t,n)=>{n.d(t,{gG:()=>w,jL:()=>g,z7:()=>f,nz:()=>_,ls:()=>S,x2:()=>v,a:()=>h});var o=n(541432),r=n(915157),i=n(709291),a=n(433929),s=n(749085);class l extends s.default{getInitialState(){return{}}setSelected(e,t){this.setState({...this.state,[e]:t})}getSelectedTab(e){return this.state[e]}}const c=new l;var d=n(594419),u=n(709953),p=n(524677),m=n(898104);function g(e){const t=e.getContentStores(),n=e.id,o=c.getSelectedTab(n);return o?t.findIndex((e=>e.id===o)):0}function f(e){const t=g(e),n=e.getContentStores();return n.length>t?n[t]:n[0]}function h(e){const{store:t,index:n,currentUserId:o}=e,r=t.getContentStores()[n];r&&v({store:t,id:r.id,currentUserId:o})}function v(e){const{store:t,id:n,currentUserId:o}=e;c.setSelected(t.id,n),r.Z.set({userId:o,key:b(t.id),value:n})}const y="TabBlock";function b(e){return`${y}-${e}`}function _(e){const{blockId:t,currentUserId:n}=e,o=r.Z.get({userId:n,key:b(t)});o&&c.setSelected(t,o)}function S(e){const{environment:t,store:n,transaction:r}=e,i=u.j4({environment:t,type:o.Ti.text,inMemoryRecordCache:n.inMemoryRecordCache,transaction:r,useCrdt:n.useCrdt()});d.R3({parentStore:n.getContentStore(),appendStore:i,transaction:r});const a=n.getContentStores()[0];p.eP({environment:t,store:a});const s=a.getBlockTitleStore();m.setSelectionAtStart({store:s})}const k=(0,i.defineMessages)({newTab:{id:"tabBlockActions.addTab.title",defaultMessage:"New tab"}});function w(e){const{environment:t,store:n,transaction:r}=e,i=u.j4({environment:t,type:o.Ti.text,inMemoryRecordCache:n.inMemoryRecordCache,transaction:r,properties:{title:[[a.default.formatMessage(k.newTab)]]},useCrdt:n.useCrdt()});return d.R3({parentStore:n.getContentStore(),appendStore:i,transaction:r}),c.setSelected(n.id,i.id),i}},680402:(e,t,n)=>{n.d(t,{AU:()=>ee,DI:()=>K,FC:()=>L,K4:()=>oe,MD:()=>ne,MO:()=>N,NE:()=>q,YY:()=>V,Z5:()=>U,d1:()=>te,e2:()=>O,j0:()=>Y,nA:()=>H,oz:()=>re,qn:()=>G,zJ:()=>j});n(757658),n(21703);var o=n(815145),r=n(668497),i=n(435011),a=n(180951),s=n(401800),l=n(253877),c=n(761075),d=n(406695),u=n(335102),p=n(484682),m=n(842875),g=n(305773),f=n(959753),h=n(882883),v=n(421202),y=n(23867),b=n(519889),_=n(421838),S=n(653965),k=n(237524),w=n(559183),x=n(710274),I=n(95477),C=n(433929),T=n(598794),M=n(385555),P=n(108406),A=n(800893),R=n(554569),D=n(496802),B=n(709953),E=n(524677),F=n(800993),Z=n(210228);function U(e){const{environment:t,selectionKey:n,selection:o,currentRowStore:r}=e,i=w.Z.state.isActive?w.Z.state.currentRowStore:void 0;w.Z.setState({isActive:!0,selectionKey:n,selection:o,currentRowStore:r||i}),E.ZH({environment:t})}function V(e){w.Z.update((t=>({...t,currentRowStore:e})))}function N(){w.Z.setState({isActive:!1})}function O(e){const{environment:t,selectionKey:n,shiftKey:o,columnCount:r,selection:i}=e;if(o&&i.end.col>0){const e={col:i.end.col-1,row:i.end.row};U({environment:t,selectionKey:n,selection:{start:i.start,end:e}})}else if(!o&&i.start.col>0){const e={col:i.start.col-1,row:i.start.row};U({environment:t,selectionKey:n,selection:{start:e,end:e}})}else if(!o&&0===i.start.col&&i.start.row>0){const e={col:r-1,row:i.start.row-1};U({environment:t,selectionKey:n,selection:{start:e,end:e}})}}function L(e){const{environment:t,selectionKey:n,shiftKey:o,columnCount:r,rowCount:i,selection:a}=e;if(o&&a.end.col<r-1){const e={col:a.end.col+1,row:a.end.row};U({environment:t,selectionKey:n,selection:{start:a.start,end:e}})}else if(!o&&a.start.col<r-1){const e={col:a.start.col+1,row:a.start.row};U({environment:t,selectionKey:n,selection:{start:e,end:e}})}else if(!o&&a.start.col>=r-1&&a.start.row<i-1){const e={col:0,row:a.start.row+1};U({environment:t,selectionKey:n,selection:{start:e,end:e}})}}function j(e){const{environment:t,selectionKey:n,shiftKey:o,selection:r}=e;if(o&&r.end.row>0){const e={col:r.end.col,row:r.end.row-1};U({environment:t,selectionKey:n,selection:{start:r.start,end:e}})}else if(!o&&r.start.row>0){const e={col:r.start.col,row:r.start.row-1};U({environment:t,selectionKey:n,selection:{start:e,end:e}})}}function K(e){const{environment:t,selectionKey:n,shiftKey:o,rowCount:r,selection:i}=e;if(o&&i.end.row<r-1){const e={col:i.end.col,row:i.end.row+1};U({environment:t,selectionKey:n,selection:{start:i.start,end:e}})}else if(!o&&i.start.row<r-1){const e={col:i.start.col,row:i.start.row+1};U({environment:t,selectionKey:n,selection:{start:e,end:e}})}}const z=new Set(["auto_increment_id"]);function q(e){const{selection:t,schema:n,currentRows:o,currentPropertyFormats:r,transaction:i}=e,a=k.AV(t);for(let s=a.minRow;s<=a.maxRow;s++){const e=o[s];if(e)for(let t=a.minCol;t<=a.maxCol;t++){const o=r[t],a=n[o.property];if(null!=a&&a.type&&z.has(a.type))continue;const s=e.getPropertyStore(o.property);F.sO({environment:s.environment,store:s,value:void 0,transaction:i})}}}function H(e){G(e),q(e)}function G(e){const{selection:t,currentRows:n,event:r}=e;if(null===r.clipboardData)return;const i=k.AV(t);let a="";const l=[],d=n.slice(Math.max(0,i.minRow),i.maxRow+1).filter((e=>e&&e.isDefined()));for(const o of d){const t=[];l.push(t);for(let n=i.minCol;n<=i.maxCol;n++){const[r,s]="selectionKey"in e?W({row:o,x:n,collectionViewBlockStore:e.selectionKey.collectionViewBlockStore,...e}):$({row:o,x:n,...e});t.push([r,o.pointer]),s&&(a+=s),n<i.maxCol&&(a+="\t")}o!==S.Z$(d)&&(a+="\n")}if(r.preventDefault(),r.clipboardData.setData("text/plain",a),function(e,t){if(null===e.clipboardData)return;e.clipboardData.setData(k.mH,JSON.stringify(t))}(r,l),"simpleTableStore"in e){const{environment:t,simpleTableStore:n,columnOrder:a,exportJsxRenderer:l}=e;if(!l)return;const{default:u,jsxToStaticMarkup:p}=l,g=t.currentUser.id,h=t.defaultRecordCache.inMemoryRecordCache.makeGetRecordValueFn(g),b=f.omK.fromGetRecordValueFn(h),_=a.slice(i.minCol,i.maxCol+1).filter((e=>void 0!==e)),S=(0,c._2)({exportArgs:{root:{table:v.iU,id:n.id,spaceId:(0,y.C)(n.pointer.spaceId)},navigableBlockId:n.id,renderParentBlockId:void 0,blockId:n.id,userTimeZone:(0,m.r)(),intl:C.default.getIntl(),getRecordValue:h,numberedListCache:{},bulletedListCache:{},getRecordsWithParent:()=>[],getExportedPathToFile:e=>{let{toFileURI:t}=e;return t},getExportedRenderAsset:e=>{let{toFileURI:t}=e;return t},getExportedPathToPage:e=>{let{toPageId:t}=e;return(0,s.Z)({pageId:t,pageModel:b({table:v.iU,id:t}),baseUrl:I.default.domainBaseUrl,pageVisitSource:o.tY.Export})},baseUrl:I.default.domainBaseUrl,publicDomainName:I.default.publicDomainName,table:{[n.id]:{renderRows:d.map((e=>e.id)),renderColumns:_}},katex:t.KatexStore.getKatex(),resultCache:new Map},renderers:u});if(S){const e=p(S);r.clipboardData.setData("text/html",e)}}}function W(e){const{row:t,x:n,collectionViewBlockStore:o,schema:s,currentPropertyFormats:c}=e,d=c[n],g=function(e,t,n){const o=t[n];if(!o)throw new Error("Property not found");if(!e.isDefined())return[];const r=e.getPropertyValue(n);if("formula"===o.type){if("v2"===o.version){if(!o.formula2)return[];const t=(0,i.EC)({block:e.getModel(),property:n,formulaCode:o.formula2.code,getRecordModel:e.getRecordModel,intl:C.default.getIntl(),userTimeZone:(0,m.r)(),depth:0,visitedProperties:new Set,resultCache:new Map});return t?(0,u.j4)(t):[]}{const o=(0,p.y4)({property:n,schema:t,block:e.getModel(),getRecordModel:e.getRecordModel,collectionRequestContext:{userId:void 0,userTimeZone:(0,m.r)(),depth:0,intl:C.default.getIntl(),resultCache:new Map,visitedProperties:new Set}});return _.TPx(o)}}if("created_time"===o.type&&e.getCreatedTime())return a.d7(l.CQ(e.getCreatedTime(),(0,m.r)()));if("created_by"===o.type&&e.getCreatedByPointer()){const{table:t,id:n}=e.getCreatedByPointer()??{};return n&&t===b.KJ?[_.YCD(["u",n])]:n?[_.YCD(["r",n])]:[]}if("last_edited_time"===o.type&&e.getLastEditedTime())return a.d7(l.CQ(e.getLastEditedTime(),(0,m.r)()));if("last_edited_by"===o.type&&e.getLastEditedByPointer()){const{table:t,id:n}=e.getLastEditedByPointer()??{};return n&&t===b.KJ?[_.YCD(["u",n])]:n?[_.YCD(["r",n])]:[]}return r||[]}(t,s,d.property);if(!t.isDefined())return[g,void 0];return[g,(0,r.L)({property:d.property,schema:s,block:t.getModel(),getRecordModel:o.getRecordModel,collectionRequestContext:{userId:void 0,userTimeZone:(0,m.r)(),depth:0,intl:C.default.getIntl(),visitedProperties:new Set,resultCache:new Map},exportedFilePaths:!1})]}function $(e){const{row:t,x:n,columnOrder:o,simpleTableStore:r}=e,i=t.getPropertyStore(o[n]);return[i.getValue()||[],(0,h.Xh)({textValue:i.getValue(),getRecordModel:r.getRecordModel,userTimeZone:(0,m.r)(),intl:C.default.getIntl()})]}function Y(e){const{environment:t,selection:n,currentRows:o,event:r,transaction:i,markdownLinkifyIt:a,tinyMceMicrosoftWordPasteFilter:s}=e;if(!r.clipboardData)return;let l;const c=r.clipboardData.getData(k.mH),d=r.clipboardData.getData("text/html");if(c)l=JSON.parse(c);else if(d){const e=document.createElement("div");e.innerHTML=d;const t=e.querySelector("table");if(t){const e=t.querySelectorAll("tr");l=[];for(const t of Array.from(e)){const e=[],n=t.querySelectorAll("td, th");for(const t of Array.from(n)){const n=_.TPx(t.textContent||"");e.push([n,void 0])}l.push(e)}}}if(!l){const e=function(e){const{event:t,markdownLinkifyIt:n,tinyMceMicrosoftWordPasteFilter:o}=e;if(!t.clipboardData)return;const{text:r,html:i,multiTextSelectionData:a,textSelectionData:s,blockSelectionData:l}=A.e0({clipboardData:t.clipboardData,tinyMceMicrosoftWordPasteFilter:o});if(a)return A.of({text:r,html:i,stripText:!1,stripSurroundingWhitespace:!0,markdownLinkifyIt:n,tinyMceMicrosoftWordPasteFilter:o});if(s){const{editing:e,selection:t}=s;return _.V3g(_.xrQ(e,t.startIndex,t.endIndex).tokensInsideRange,{removeSuggestionAnnotationsAndText:!1,removeSuggestionAnnotations:!0,removeDiscussions:!0})}if(i||r)return function(e){const{text:t,html:n,blockSelectionData:o,markdownLinkifyIt:r,tinyMceMicrosoftWordPasteFilter:i}=e,a=t.includes("\n");return a||o&&o.blocks.length>0?_.TPx(t):A.of({text:t,html:n,stripText:!1,stripSurroundingWhitespace:!0,markdownLinkifyIt:r,tinyMceMicrosoftWordPasteFilter:i})}({text:r,html:i,blockSelectionData:l,markdownLinkifyIt:n,tinyMceMicrosoftWordPasteFilter:o})}({event:r,markdownLinkifyIt:a,tinyMceMicrosoftWordPasteFilter:s});e&&(l=[[[e,void 0]]])}if(l){const r=k.AV(n),a=l[0].length;let s=Math.floor((r.maxCol-r.minCol+1)/a);0===s&&(s=1);const c=l.length;let d=Math.floor((r.maxRow-r.minRow+1)/c);0===d&&(d=1);for(let t=0;t<d;t++)for(let n=0;n<s;n++){const s=r.minCol+n*a,d=r.minRow+t*c;for(let t=0;t<c;t++){let n=o[d+t];if(!n){const t="selectionKey"in e?Q(e):T.nS(e);t&&(e.currentRows.push(t),n=t)}for(let o=0;o<a;o++){const r=l[t][o];if(!r)continue;const a=s+o;"currentPropertyFormats"in e?J({row:n,x:a,serializedValue:r,currentPropertyFormats:e.currentPropertyFormats,transaction:i,schema:e.schema}):X({row:n,x:a,serializedValue:r,columnOrder:e.columnOrder,transaction:i})}}}const u={start:{col:r.minCol,row:r.minRow},end:{col:r.minCol+a*s-1,row:r.minRow+c*d-1}};"selectionKey"in e?U({environment:t,selectionKey:e.selectionKey,selection:u}):T.pB({environment:t,start:u.start,end:u.end,simpleTableStore:e.simpleTableStore})}}function Q(e){const{environment:t,currentRows:n,collectionContextStore:o,selectionKey:r,transaction:i}=e,{groupFormat:a}=r,s=R.IW({environment:t,collectionContextStore:o,groupsPointer:a?[a]:[],insertAtIndex:n.length,shouldCoerce:!0,initializeDefaultTemplate:!1,transaction:i,from:"table_paste_selection"});return null==s?void 0:s.newStore}function J(e){var t;const{row:n,x:o,serializedValue:r,currentPropertyFormats:i,transaction:s,schema:l}=e,c=i[o];if(!c)return;if("verification"===(null===(t=l[c.property])||void 0===t?void 0:t.type))return;const[d,u]=r,p=n.getPropertyStore(c.property);if(F.sO({environment:p.environment,store:p,value:d,transaction:s}),u){var m;const e=d?a.g(d):void 0,t=(0,g.jy)(e,[I.default.secureFileS3.url,I.default.secureFileS3V2.url],(null===(m=I.default.secureFileConfig)||void 0===m?void 0:m.rootPath)??"");B.nj({store:n,source:u,fileIds:t.map((e=>e.id)),transaction:s})}}function X(e){const{row:t,x:n,serializedValue:o,transaction:r,columnOrder:i}=e,a=i[n];if(!a)return;const[s,l]=o,c=t.getPropertyStore(a);F.sO({environment:c.environment,store:c,value:_.V3g(s,{removeSuggestionAnnotationsAndText:!1,removeSuggestionAnnotations:!0,removeDiscussions:!0}),transaction:r})}function ee(e){let{environment:t,collectionViewStore:n,currentValue:o}=e;Z.createAndCommit({userAction:"tableActions.toggleTableVerticalLines",environment:t,perform:e=>{D.FH({stores:[n],update:{hide_table_vertical_lines:!o},transaction:e})}})}function te(e){let{environment:t,collectionViewStore:n,currentValue:o}=e;const r="title"===o?void 0:"title";Z.createAndCommit({userAction:"tableActions.toggleTableSubitemToggleOnTitle",environment:t,perform:e=>{D.FH({stores:[n],update:{table_subitem_toggle_column:r},transaction:e})}})}function ne(e){let{environment:t,collectionViewStore:n,currentValue:o}=e;const r=(0,d.oz)(n.getType()??"table")??"table_properties",i=n.getFormat()[r],a=null==i?void 0:i.map((e=>({...e,wrap:!o})));Z.createAndCommit({userAction:"tableActions.toggleTableWrapCells",environment:t,perform:e=>{D.FH({stores:[n],update:{table_wrap:!o,[r]:a},transaction:e})}})}function oe(e){let{property:t,collectionViewStore:n,format:o,formatKey:r,environment:i,currentValue:a}=e;const s=!a,l=n.getFormat().table_wrap,c=o[r]||[];let d=!0;const u=c.map((e=>{let n;return n=e.property===t?s:Boolean(l||e.wrap),n||(d=!1),{...e,wrap:n}})),p={...o,[r]:u,table_wrap:d};Z.createAndCommit({userAction:"tableActions.toggleWrapColumn",environment:i,perform:e=>{x.iG({collectionViewStore:n,update:{format:p},transaction:e})}})}function re(e){let{environment:t,collectionContextStore:n,currentIndex:o,entrypoint:r,transaction:i,propertyAction:a}=e;const s=n.collectionViewStore(),l=n.normalizedFormatStore.state;if(!s||void 0===o)return;const c=n.frozoneStore.state.frozenIndex;let d;switch(a){case"toggle":c!==o?d=o:c===o&&(d=-1);break;case"delete":case"hide":if(!(void 0!==c&&o<=c))return;d=c-1;break;case"duplicate":if(!(void 0!==c&&o<=c))return;d=c+1;break;case void 0:if(c!==o)d=o;else if(c===o)return}const u={...l,table_frozen_column_index:d};n.frozoneStore.setState({...n.frozoneStore.state,frozenIndex:d}),d&&M.default.logEvent("freeze_columns","true",{from:r}),P.wd({environment:t,collectionContextStore:n,action:void 0===d?"table_unfreeze_columns":"table_freeze_column",entrypoint:r,propertyIndex:d}),B.sW({store:s.getFormatStore(),data:u,transaction:i})}},400150:(e,t,n)=>{n.d(t,{Ct:()=>f,Hl:()=>h,c0:()=>b,fg:()=>v,sp:()=>_});n(757658),n(667294);var o=n(772141),r=n(429369),i=n(364684),a=n(709291),s=n(798165),l=n(206258),c=n(117224),d=n(547307),u=n(594419),p=n(709953),m=n(210228),g=n(785893);function f(e){const{environment:t,currentSpaceViewStore:n,orderedTeamIds:o,userAction:i}=e;if(m.createAndCommit({userAction:i,environment:t,perform:e=>{p.sW({store:n,data:{joined_teams:o},transaction:e})}}),e.isExplicitUserAction){const{key:o,startPosition:i,endPosition:a}=e.dropArgs,s=l.zX.createChildStore(n,{table:r.e0,id:o});c.er(t,{store:s,start_position:i,end_position:a})}}async function h(e){let{transaction:t,...n}=e;const o=await v(n);if("user_cancelled_move"===o)return"user_cancelled_move";if(0===o.length)return"not_cleared";for(const{blockStore:r,permissions:i}of o)p.sW({store:r,data:{permissions:i},transaction:t});return"cleared"}async function v(e){const{moveToTeam:t,permissionsUpdateItems:n}=function(e){let{moveStores:t,moveTargetStore:n}=e;const o=t.reduce(((e,t)=>(e[t.id]=(0,s.VP)(t),e)),{}),r=(0,s.VP)(n),i=[];for(const a of t){const e=y({blockStore:a,moveFromTeam:o[a.id],moveToTeam:r});e&&i.push(e)}return{moveToTeam:r,permissionsUpdateItems:i}}(e);if(0===n.length)return[];const o=await async function(e){let{numPagesMoved:t,moveToTeam:n,permissionsUpdateItems:o}=e;if(0===o.length)return!0;if(!n)return!0;const r=n.getName(),i=o.some((e=>{let{isRemovingRestricted:t}=e;return!0===t})),s=i&&(0,g.jsx)(a.FormattedMessage,{id:"teamActions.confirmMoveToTeam.removeRestrictedDescription",defaultMessage:" {numPagesMoved, plural, one {This page} other {These pages}} will no longer have restricted access.",values:{numPagesMoved:t}});return await d.confirmUserAction({message:(0,g.jsx)(a.FormattedMessage,{defaultMessage:"Are you sure you want to move {numPagesMoved, plural, one {this page} other {these pages}} to {moveToTeamName}?",id:"teamActions.confirmMoveToTeam.title",values:{moveToTeamName:r,numPagesMoved:t}}),description:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(a.FormattedMessage,{id:"teamActions.confirmMoveFromTeam.description",defaultMessage:"This will transfer the permissions on {numPagesMoved, plural, one {this page} other {these pages}} to members of {moveToTeamName}. ",values:{moveToTeamName:r,numPagesMoved:t}}),s]})})}({numPagesMoved:e.moveStores.length,moveToTeam:t,permissionsUpdateItems:n});return o?n:"user_cancelled_move"}function y(e){let{blockStore:t,moveFromTeam:n,moveToTeam:r}=e;if(void 0===n&&void 0===r)return;if((null==n?void 0:n.id)===(null==r?void 0:r.id))return;const a=t.getPermissionItems();let s=!1;const l=a.filter((e=>(0,o.Le)(e)?(s=!0,!1):!(0,o.Ir)(e)&&(!n||!(0,i.J2)(e,n.id)&&!(0,i.jc)(e,n.id))));return a.length!==l.length?{blockStore:t,permissions:l,moveFromTeam:n,isRemovingRestricted:s}:void 0}function b(e){const{store:t,teamStore:n,transaction:o,location:r}=e,i=n.getTeamPagesStore(),a=l.G.createChildStore(i,t.pointer);"append"===r.type?u.R3({parentStore:i,appendStore:a,transaction:o,after:r.after}):"prepend"===r.type&&u.Ce({parentStore:i,prependStore:a,transaction:o,before:r.before})}function _(e){const{store:t,teamStore:n,transaction:o}=e,r=n.getTeamPagesStore(),i=l.G.createChildStore(r,t.pointer);u.Od({childToRemoveStore:i,parentStore:r,transaction:o})}},666771:(e,t,n)=>{n.d(t,{KM:()=>p,WO:()=>m,uj:()=>g});var o=n(415095),r=n(421838),i=n(182798),a=n(27105),s=n(745162),l=n(273959),c=n(489086),d=n(365663),u=n(80881);function p(e){const{environment:t,multiSelection:n,annotation:o,transaction:r}=e;(0,s.L5)(n).forEach((e=>{let{store:n,selection:i}=e;m({environment:t,store:n,annotation:o,selection:i,transaction:r})}))}function m(e){const{environment:t,store:n,annotation:s,selection:p,transaction:m}=e,g=n.getValue();if(!g)return;const f=r.WO0({textValue:g,selection:p,annotation:s});if(a.FX(n)){!function(e){const{blockStore:t,selection:n,annotation:a,transaction:s,fullTextValue:l}=e;(0,i.T)(t.useCrdt());const u=t.getBlockTitleStore().getValue(),p=r.Ulv(u,n);if((0,c.wd)(p))return;const m=(0,i.TO)(t.getTextSliceTree()),g=new o.W3(r.eeV(u)),{startIndex:f,endIndex:h}=g.getInclusiveStringRangeForSelection(p),{operations:v,invertedOperations:y}=m.getOperationsForAddAnnotation(f,h,a);d.F({transaction:s,store:t,crdtOperations:v,invertedOperations:y,fullTextValue:l})}({blockStore:(0,i.TO)((0,l.sQ)(n)),selection:p,annotation:s,transaction:m,fullTextValue:f})}else{u.Bj({environment:t,store:n,value:f,transaction:m});const e=n.getRecordStoreAtRootPath();u.tV({environment:t,store:n,oldTextValue:g,newTextValue:f,transaction:m,rootStore:e,removeInlineRecords:!1})}}function g(e){const{environment:t,blocks:n,annotation:o,transaction:r}=e;for(const i of n){const e=i.getTitleStore();if(!e)continue;e.getValue()&&m({environment:t,store:e,annotation:o,selection:{startIndex:0,endIndex:1/0},transaction:r})}}},639344:(e,t,n)=>{n.d(t,{Q:()=>f,S:()=>h});var o=n(415095),r=n(421202),i=n(421838),a=n(182798),s=n(27105),l=n(745162),c=n(273959),d=n(489086),u=n(206258),p=n(365663),m=n(898104),g=n(80881);function f(e){const{environment:t,multiSelection:n,annotationKey:o,transaction:r}=e;(0,l.L5)(n).forEach((e=>{let{store:n,selection:i}=e;h({environment:t,store:n,annotationKey:o,selection:i,transaction:r,updateSelection:!1})}))}function h(e){const{environment:t,store:n,selection:l,annotationKey:f,transaction:h,updateSelection:v}=e,y=n.getValue();if(!y)return;const b=i.STJ({textValue:y,selection:l,annotationKey:f}),_=n.isTable(r.iU)&&(0,c.sQ)(n)||n.getRecordStoreAtRootPath();_ instanceof u.G&&s.Ls({store:n,blockStore:_})?(!function(e){const{blockStore:t,selection:n,annotationKey:r,transaction:s,fullTextValue:l}=e;(0,a.T)(t.useCrdt());const c=t.getBlockTitleStore().getValue(),u=i.Ulv(c,n);if((0,d.wd)(u))return;const m=(0,a.TO)(t.getTextSliceTree()),g=new o.W3(i.eeV(c)),{startIndex:f,endIndex:h}=g.getInclusiveStringRangeForSelection(u),{operations:v,invertedOperations:y}=m.getOperationsForRemoveAnnotation(f,h,r);p.F({transaction:s,store:t,crdtOperations:v,invertedOperations:y,fullTextValue:l})}({blockStore:_,selection:l,annotationKey:f,transaction:h,fullTextValue:b}),(0,a.T)(i.Zgr(b,n.getValue()))):(g.Bj({environment:t,store:n,value:b,transaction:h}),g.tV({environment:t,store:n,oldTextValue:y,newTextValue:b,transaction:h,rootStore:_,removeInlineRecords:!0})),v&&m.setSelection({store:n,selection:l})}},80881:(e,t,n)=>{n.d(t,{Bj:()=>k,IS:()=>w,tV:()=>x,wh:()=>I});var o=n(266749),r=n(264572),i=n(421202),a=n(933709),s=n(23867),l=n(421838),c=n(182798),d=n(653965),u=n(584370),p=n(5779),m=n(601600),g=n(95477),f=n(27105),h=n(635328),v=n(206258),y=n(250906),b=n(388295),_=n(709953),S=n(210228);function k(e){const{store:t,value:n,transaction:r}=e;(0,c.T)(!f.FX(t),"setValueInTitleStore should not be used for updating the title of a CRDT block");const a=l.Zxt(n);S.applyOperation({transaction:r,store:t,operation:{pointer:t.pointer,path:t.path,command:"set",args:t.table===i.iU?(0,o.pp)(a):a}}),w(e)}function w(e){const{environment:t,store:n}=e;if(!n.isTable("block"))return;if(n.inMemoryRecordCache.isTemporaryData)return;const o=n.getRecordStoreAtRootPath();if(!o.inMemoryRecordCache.isMockTextStore){const e=o.getValue();var r;if(e)y.ct(t,{block_id:e.id,type:e.type,is_toggleable:(0,h._A)(e.type,e.format),parent_collection_id:o.getAssociatedCollectionId()??(null===(r=o.getParentBlockStore())||void 0===r?void 0:r.getAssociatedCollectionId())})}}function x(e){const{environment:t,oldTextValue:n,newTextValue:o,transaction:r,rootStore:i,removeInlineRecords:a}=e;if(i instanceof v.G){const e=new Set(d.zu(l.llS(n),...l.llS(o)));if((0,p.Z)({blockStore:i,discussionIds:Array.from(e),transaction:r}),i.isType("table_row")){const t=i.getParentBlockStore();t&&(0,p.Z)({blockStore:t,discussionIds:Array.from(e),transaction:r})}const a=new Set(d.zu(l.llS(o),...l.llS(n)));if(C({blockStore:i,discussionIds:a,transaction:r,environment:t}),i.isType("table_row")){C({blockStore:i.getParentBlockStore(),discussionIds:a,transaction:r,environment:t})}}a&&I(e)}function I(e){const{store:t,environment:n,oldTextValue:o,newTextValue:a,transaction:c,rootStore:u}=e;if(u instanceof v.G){const e=u.getValue();if(e){const i=(0,r.m3)({parentBlock:e,oldTextValue:o,newTextValue:a,getRecordValue:t.getRecordValue,baseUrl:g.default.domainBaseUrl,publicDomainName:g.default.publicDomainName});b.lP({environment:n,transaction:c,parentStore:u,inlinePageIds:i})}}const p=d.zu(l.zUo(o),...l.zUo(a));for(const r of p){const e=v.G.createChildStore(u,{table:i.iU,id:r,spaceId:(0,s.C)(u.pointer.spaceId)});_.sW({store:e,data:{alive:!1},transaction:c})}}function C(e){const{blockStore:t,discussionIds:n,transaction:o,environment:r}=e;if(t)for(const i of n){(0,u.t)({transaction:o,blockStore:t,discussionId:i});const e=v.t1.createChildStore(t,{table:a.qF,id:i,spaceId:(0,s.C)(t.pointer.spaceId)});e.isSuggestionDiscussion()&&m.vh({environment:r,transaction:o,discussionStore:e,addModifiedBlockIdsAfter:[t.id]})}}},137973:(e,t,n)=>{n.d(t,{MY:()=>f,P2:()=>h,QT:()=>v});n(757658);var o=n(421838),r=n(849772),i=n(653965),a=n(401898),s=n(601600),l=n(451165),c=n(745162),d=n(489086),u=n(400807),p=n(778321),m=n(666771),g=n(639344);function f(e){const{environment:t,multiSelection:n,annotation:f,transaction:h}=e,v=(0,r.gO)(f),y=(0,c.L5)(n),b=s.DH(n),_=b?u.Z.getMode(b):"default",S=(0,d.KF)([v],n,{}),k=o.LAI(f)&&i.Xy(f,S[v]),w=!o.xw5(f)&&!o.BIG(f)&&!o.LAI(f)&&Boolean(S[v])||k;if("default"!==_&&o.X5l(f))if("suggest"===_){const e=s.oG(t,h,n),r=e.id,i=w?[o.GKr.SuggestionUnannotate,r,f]:[o.GKr.SuggestionAnnotate,r,f],a=[];y.forEach((e=>{let{store:n,selection:r}=e;const s=n.getValue(),c=o.Ulv(s,r),d=o.EX_({textValue:s,startIndex:c.startIndex,endIndex:c.endIndex}).find((e=>{let{annotation:r}=e;if(o.u2m(r)||o.Jeu(r)){const e=o.EpE(r);if(1===e.length&&e[0]===v){const e=o.fgJ(r),i=l.cC({store:n,discussionId:e});if(i)return l.Ld(i,t.currentUser)}}}));d&&d.startIndex<=c.startIndex&&d.endIndex>=c.endIndex||(m.WO({environment:t,store:n,annotation:i,selection:c,transaction:h}),a.push(n.id))})),a.length>0&&s.vh({environment:t,transaction:h,discussionStore:e,addModifiedBlockIdsAfter:a})}else"translate"===_?p.Xb():(0,a.t1)(_);else y.forEach((e=>{let{store:n,selection:r}=e;w?g.S({environment:t,store:n,annotationKey:o.c14(f),selection:r,transaction:h,updateSelection:!1}):m.WO({environment:t,store:n,annotation:f,selection:r,transaction:h})}))}function h(e){const{environment:t,blocks:n,annotation:r,transaction:a}=e,s=o.J7s(r),l=i.oA(n.map((e=>{const t=e.getTitleStore();if(!t)return;const n=t.getValue();return n?{block:e,titleStore:t,titleValue:n}:void 0}))),c=l.every((e=>{let{titleValue:t}=e;return t.every((e=>o.hDy(e).some((e=>o.J7s(e)===s))))}));for(const{titleStore:o}of l)v({environment:t,annotation:r,textStore:o,action:c?"removeAnnotationType":"annotate",transaction:a})}function v(e){const{environment:t,annotation:n,transaction:r,textStore:i,action:a}=e;"annotate"===a?m.WO({environment:t,store:i,annotation:n,selection:{startIndex:0,endIndex:1/0},transaction:r}):g.S({environment:t,store:i,annotationKey:o.c14(n),selection:{startIndex:0,endIndex:1/0},transaction:r,updateSelection:!1})}},800993:(e,t,n)=>{n.d(t,{AE:()=>pt,E3:()=>mt,KM:()=>Ke.KM,MY:()=>qe.MY,N3:()=>$e,Nh:()=>yt,O5:()=>ut,ON:()=>vt,Q0:()=>ct,QT:()=>qe.QT,QX:()=>ze.Q,ST:()=>ze.S,VO:()=>gt,WO:()=>Ke.WO,YV:()=>it,Zl:()=>bt,aS:()=>at,ao:()=>et,bY:()=>ht,f8:()=>kt,fs:()=>rt,g2:()=>st,gc:()=>nt,gy:()=>_t,hJ:()=>Ye,lZ:()=>lt,mM:()=>Qe,n2:()=>ot,pe:()=>Ge,pz:()=>He,sO:()=>Xe,vE:()=>St,wA:()=>dt,yJ:()=>tt});n(21703),n(757658),n(430541);var o=n(701302),r=n(815145),i=n(840376),a=n(837167),s=n(401800),l=n(415095),c=n(335102),d=n(568626),u=n(842875),p=n(449143),m=n(959753),g=n(882883),f=n(599405),h=n(421202),v=n(870279),y=n(933709),b=n(23867),_=n(456452),S=n(421838),k=n(744805),w=n(439721),x=n(182798),I=n(653965),C=n(401898),T=n(218265),M=n(554564),P=n(467133),A=n(762878),R=n(81598),D=n(828344),B=n(266402),E=n(5779),F=n(601600),Z=n(947002),U=n(948514),V=n(95477),N=n(678791),O=n(27105),L=n(922705),j=n(444388),K=n(451165),z=n(214976),q=n(100754),H=n(973744),G=n(484210),W=n(433929),$=n(268056),Y=n(745162),Q=n(798165),J=n(367669),X=n(165598),ee=n(918514),te=n(645010),ne=n(669645),oe=n(273959),re=n(560846),ie=n(389224),ae=n(489086),se=n(635328),le=n(989574),ce=n(95802),de=n(431559),ue=n(792303),pe=n(626765),me=n(798180),ge=n(524229),fe=n(400807),he=n(966949),ve=n(385555),ye=n(530874),be=n(619671),_e=n(272014),Se=n(813023),ke=n(188923),we=n(206258),xe=n(924666),Ie=n(445131),Ce=n(365663),Te=n(458912),Me=n(106404),Pe=n(800893),Ae=n(304727),Re=n(536280),De=n(778321),Be=n(844886),Ee=n(567060),Fe=n(412714),Ze=n(608055),Ue=n(761045),Ve=n(524677),Ne=n(80881),Oe=n(617269),Le=n(898104),je=n(632741),Ke=n(666771),ze=n(639344),qe=n(137973);function He(e){const{multiSelection:t,environment:n,transaction:o}=e,r=(0,Y.L5)(t);if(0===r.length)return;if(1===r.length){const{store:e,selection:t}=r[0];return Ge({environment:n,transaction:o,store:e,selection:t})}const i=O.p8(!1),a=t.start.store,s=O.FX(a),l=r.some((e=>{let{store:t}=e;return O.FX(t)!==s}));if(l&&!i)throw new Error("Cannot delete a selection that contains a mix of CRDT and non-CRDT blocks!");const c=(0,Y.Nj)({multiSelection:t,includeNonSelectable:!1});if(!c)return;const{treeRange:u}=c;if(s&&!l){const e=new Set,r=[];for(const t of u.iterateDeletion())if("delete"===t.operation)for(const{childToRemove:e}of(0,ne.XL)({treeOperation:t,deleteFrom:"record-store-parent"}))r.push(e);else if("move"===t.operation)for(const n of t.movingChildren)n.value.store&&e.add(n.value.store);let i=0;for(const t of r)i+=1+(0,X.MI)({blockStore:t,transclusionReferences:"omit",childPages:"omit"}).length;const a=ve.default.getConfigKey("text_crdt_config","delete_merge_slice_tree_block_limit");i<=a?N.Cf({environment:n,transaction:o,multiSelection:t,removedBlocks:r,movedBlocks:e}):d.log({level:"info",from:"deleteMultiSelection",type:"crdt:deleteMultiSelectionOverBlockLimit",data:{miscDataToConvertToString:{blockLimit:a,numBlocksInSelection:i}}})}const{start:p,end:m}=t;Ge({environment:n,transaction:o,selection:{startIndex:p.index,endIndex:1/0},store:p.store});const g=(0,ae.x0)(p.store),f=m.store,h=O.FX(f);if(s&&h){const e=(0,x.TO)((0,oe.sQ)(f),"End of selection must be in a block");Ge({environment:n,transaction:o,selection:{startIndex:0,endIndex:m.index},store:m.store}),N.tE({transaction:o,sourceBlockStore:e,targetStore:a})}else g?nt({environment:n,transaction:o,sourceStore:m.store,sourceIndex:m.index,targetStore:p.store,targetIndex:g.endIndex}):Ge({environment:n,transaction:o,store:m.store,selection:{startIndex:m.index,endIndex:1/0}});for(const d of u.iterateDeletion())(0,ne.D_)({transaction:o,treeOperation:d,deleteFrom:"record-store-parent"});Le.setSelection({store:p.store,selection:g}),Ve.eP({environment:n,store:u.start.value.store})}function Ge(e){We({...e,updateSelection:!0,removeInlineRecords:!0})}function We(e){const{environment:t,store:n,selection:o,transaction:r,updateSelection:i,removeInlineRecords:a}=e,s=n.getValue(),c=S.Ulv(s,o);if(c.startIndex===c.endIndex)return void(i&&Le.setSelection({store:n,selection:c}));const d=S._QS(s,o.startIndex,o.endIndex),u=n.isTable(h.iU)&&(0,oe.sQ)(n)||n.getRecordStoreAtRootPath();if(u instanceof we.G&&O.Ls({store:n,blockStore:u})){const o=(0,x.TO)(u.getTextSliceTree()),i=new l.W3(S.eeV(s)),{startIndex:p,endIndex:m}=i.getInclusiveStringRangeForSelection(c),{operations:g,invertedOperations:f}=o.getOperationsForDeleteText(p,m);Ce.F({transaction:r,store:u,crdtOperations:g,invertedOperations:f,fullTextValue:d}),Ne.IS(e),a&&Ne.wh({environment:t,store:n,oldTextValue:s,newTextValue:d,transaction:r,rootStore:u})}else Ne.Bj({environment:t,store:n,value:d,transaction:r}),Ne.tV({environment:t,store:n,oldTextValue:s,newTextValue:d,transaction:r,rootStore:u,removeInlineRecords:a});i&&Le.setSelection({store:n,selection:{startIndex:c.startIndex,endIndex:c.startIndex}})}function $e(e){const t=xe.default.state;if("editing"!==t.mode)return;if((0,$.iG)(t.multiSelection))return;const{start:n,end:o}=t.multiSelection,r="start"===e.direction?n:o;xe.default.setState({...t,multiSelection:{start:r,end:r}})}function Ye(e){const{environment:t,editorMode:n,disableMentions:o,disableSlashCommands:r,disableEmojiCommands:a,disableFilters:s,string:c,transaction:d,selectAll:u,mobileActionBarEnableInsertInsteadOfTurnIntoInSlashCommands:m,usePopupForMentionOnMobile:g,mentionSectionOrdering:f}=e,h=(0,p.lU)(e.disabledMentionTypes);let v;const y=[];if("editing"!==xe.default.state.mode)return;let b="multiSelection"in e?e.multiSelection:(0,$.TD)(e);const _=(0,$.QY)(b);let k=!1;const w=_?{canRestore:!0,oldSelection:_,toTextValue:_.store.getValue()}:{canRestore:!1};"default"===n?He({environment:t,multiSelection:b,transaction:d}):"suggest"===n?(0,$.iG)(b)||(k=!0,v=F.oG(t,d,b),F.Sz({environment:t,multiSelection:b,transaction:d,discussionStore:v}),b={start:{store:b.end.store,index:b.end.index},end:{store:b.end.store,index:b.end.index}}):"translate"===n?De.Xb():(0,C.t1)(n);const x=S.vJ3(c),I=l.p4(x).length;if(0===I)return;const T=(0,ae.bj)(n);if(v&&k&&T.remove([S.GKr.SuggestionRemoveText,v.id]),"suggest"===n){if(v||0!==b.start.index)v||(v=F.oG(t,d,b,{annotations:T,annotationTypes:[S.GKr.SuggestionRemoveText,S.GKr.SuggestionInsertText],currentUser:t.currentUser}));else{const e=(0,q.i)(b.start.store),n=e?(0,oe.sQ)(e):void 0;v=F.oG(t,d,b,{annotations:i.u.fromArray(S.Rkp(null==e?void 0:e.getValue())),annotationTypes:[S.GKr.SuggestionInsertText],currentUser:t.currentUser},n?{blockStore:n,suggestionTypes:["add_line_break"],currentUser:t.currentUser}:void 0)}T.add([S.GKr.SuggestionInsertText,v.id]),T.remove([S.GKr.SuggestionRemoveText,v.id])}const M=S.V3y(x,T.toArray());"suggest"===n&&y.push(b.start.store.id),Je({environment:t,store:b.start.store,tokens:[M],index:b.start.index,transaction:d,updateSelection:!1});const P={startIndex:u?b.start.index:b.start.index+I,endIndex:b.start.index+I};Le.setSelection({store:b.start.store,selection:P}),s||Oe.f({environment:t,editorMode:n,store:b.start.store,transaction:d}),w.canRestore&&(o||Ee._P({environment:t,textStore:w.oldSelection.store,oldSelection:w.oldSelection.selection,oldTextValue:w.toTextValue,disabledMentionTypes:h,usePopupOnMobile:g,mentionSectionOrdering:f}),r||de._P({environment:t,textStore:w.oldSelection.store,oldSelection:w.oldSelection.selection,oldTextValue:w.toTextValue,isAddMenu:m,transaction:d}),a||Ae._P({environment:t,textStore:w.oldSelection.store,oldSelection:w.oldSelection.selection,oldTextValue:w.toTextValue}),"suggest"===n&&v&&F.vh({environment:t,transaction:d,discussionStore:v,addModifiedBlockIdsAfter:y}),t.device.isMobile&&L.ZP.state.enabled&&j.Z.setState(!0))}function Qe(e){Je({...e,updateSelection:!0})}function Je(e){const{environment:t,store:n,index:o,transaction:r,selectAll:i,updateSelection:a,editorMode:s}=e;let c,d=e.tokens.map(S.Y_F);if(d.length){if("suggest"===s){const e=n.getAncestorBlockStoreAtRootPath();e&&(c=F.oG(t,r,e),d=S.WO0({textValue:d,selection:{startIndex:0,endIndex:1/0},annotation:[S.GKr.SuggestionInsertText,c.id]}))}const i=n.getValue()||[],a=S.P$X(i,d,o);if(O.FX(n)){const t=(0,x.TO)((0,oe.sQ)(n)),i=(0,x.TO)(t.getTextSliceTree()),s=new l.W3(S.eeV(n.getValue())).getStringStartIndex(o),{operations:c,invertedOperations:u}=i.getOperationsForInsertTextValue(s,d);Ce.F({transaction:r,store:t,crdtOperations:c,invertedOperations:u,fullTextValue:a}),Ne.IS(e)}else{Ne.Bj({environment:t,store:n,value:a,transaction:r});const e=n.getRecordStoreAtRootPath();Ne.tV({environment:t,store:n,rootStore:e,transaction:r,oldTextValue:i,newTextValue:a,removeInlineRecords:!1})}if("suggest"===s){const e=n.getAncestorBlockStoreAtRootPath();e&&F.vh({environment:t,transaction:r,discussionStore:(0,x.TO)(c),addModifiedBlockIdsAfter:[e.id]})}}if(a){const e=S.eeV(d).length;Le.setSelection({store:n,selection:{startIndex:i?o:o+e,endIndex:o+e}})}}function Xe(e){const{environment:t,store:n,value:o,transaction:r}=e,i=n.getValue()??[];O.FX(n)?(We({environment:t,store:n,selection:{startIndex:0,endIndex:1/0},transaction:r,updateSelection:!1,removeInlineRecords:!0}),o&&S.VrM(o)&&Je({environment:t,store:n,tokens:o,index:0,transaction:r,updateSelection:!1}),Ne.IS(e)):Ne.Bj(e);const a=n.getRecordStoreAtRootPath();if(a instanceof we.G&&i&&"suggest"===fe.Z.getMode(a)){const e=(0,_.K9)(i),o=(0,_.K9)(n.getValue()??[]),s=I.zu(e,...o);(0,E.Z)({discussionIds:s,blockStore:a,transaction:r}),e.forEach((e=>{const n=we.t1.createChildStore(a,{table:y.qF,id:e,spaceId:(0,b.C)(a.pointer.spaceId)});F.vh({environment:t,transaction:r,discussionStore:n})}))}}function et(e){const{environment:t,store:n,selection:o,transaction:r}=e,i=W.default.getIntl(),a=m.omK.fromGetRecordValueFn(n.inMemoryRecordCache.makeGetRecordValueFn(t.currentUser.id)),s=n.getValue()??[];let l=0,c=0;for(const d of s){const e=S.J1x(d);if(c<o.startIndex){c+=e;continue}if(c+e>o.endIndex)break;const s=S.hDy(d),p=s.find(S.ZAl);let m;if(p){const o=(0,g.Xh)({textValue:[d],intl:i,getRecordModel:a,userTimeZone:(0,u.r)(),externalIntegrations:ye.Z.integrations.state});m=S.V3y(o,s.filter((e=>!I.Xy(e,p)))),Ge({environment:t,store:n,selection:{startIndex:c,endIndex:c+e},transaction:r}),Qe({environment:t,store:n,tokens:[m],index:c,transaction:r}),l+=S.J1x(m)-S.J1x(d)}c+=m?S.J1x(m):e}return{startIndex:o.startIndex,endIndex:o.endIndex+l}}function tt(e){const{selection:t,titleStore:n,environment:o,transaction:r,annotationsToAdd:i=[],annotationKeysToRemove:a=[]}=e;let s=n.getValue();i.forEach((e=>{s=S.WO0({textValue:s,selection:t,annotation:e})})),a.forEach((e=>{s=S.STJ({textValue:s,selection:t,annotationKey:e})}));const{tokensInsideRange:l}=S.xrQ(s,t.startIndex,t.endIndex);Ge({environment:o,store:n,selection:t,transaction:r}),Qe({environment:o,store:n,tokens:l,index:t.startIndex,transaction:r})}function nt(e){const{environment:t,sourceStore:n,sourceIndex:o,targetStore:r,targetIndex:i,transaction:a}=e,s=S.lzi(n.getValue()),l=S.QaF(s).length,{tokensInsideRange:c}=S.xrQ(s,o,l);c.length>0&&(We({environment:t,store:n,selection:{startIndex:o,endIndex:l},transaction:a,updateSelection:!0,removeInlineRecords:!1}),Qe({environment:t,store:r,tokens:c,index:i,transaction:a}))}function ot(e){const{environment:t,shiftKey:n,transaction:r}=e;return function(e){const{transaction:t}=e,n=xe.default.state;if("editing"!==n.mode)return;const{multiSelection:r}=n,i=(0,Y.Nj)({multiSelection:r,includeNonSelectable:!0});if(!i)return;const{tree:a,treeRange:s}=i,l=a.value.store,c=w.o.getIndentOperationsFromTreeRange(s,e.direction);for(const o of c){const{target:e,operation:n}=o,r=(0,ne.kC)({rootStore:l,root:a,target:e});if(void 0===r)throw new Error("Cannot find node to indent");let i=!1;switch(n){case"indentSelf":case"indentSelfAndSubtree":if(r.length>=2){const e=r[r.length-2],o=r[r.length-1];if(o){let r="indentSelf"===n?"self":"subtree";(0,se.BX)(o)&&!Ie.Z.isOpen(o.id)&&(r="subtree");void 0!==Be.dD({blockStore:o,parentStore:e,transaction:t,type:r})&&(i=!0)}}break;case"unindentSelfAndUpdateSiblings":if(r.length>=3){const e=r[r.length-3],n=r[r.length-2],o=r[r.length-1];if(n&&o){void 0!==Be.uv({blockStore:o,parentStore:n,grandparentStore:e,transaction:t})&&(i=!0)}}}i&&w.F.applyMutable(a,o)}o.default.afterNextFlush((()=>{const e=(0,ne.kC)({rootStore:l,root:a,target:s.start}),t=(0,ne.kC)({rootStore:l,root:a,target:s.end}),n=e&&(0,oe.mh)(e[e.length-1]),o=t&&(0,oe.mh)(t[t.length-1]);if(n&&o){const e={start:{store:n,index:r.start.index},end:{store:o,index:r.end.index}};Le.setMultiSelection({multiSelection:e})}}))}({environment:t,transaction:r,direction:n?"unindent":"indent"})}function rt(e){const{transaction:t,direction:n}=e,r=xe.default.state;if("editing"!==r.mode)return;const{multiSelection:i}=r,a=(0,Y.tp)({multiSelection:i,filterCommonAncestors:!0,focus:void 0});if(!a)return;const s=a.stores;("up"===n?Be.A1({transaction:t,blocks:s}):Be.vi({transaction:t,blocks:s}))&&o.default.afterNextFlush((()=>{const[e,t]=ce.C.findSelectablesFromIds([i.start.store.id,i.end.store.id]),n=(null==e?void 0:e.props.store)&&(0,oe.mh)(null==e?void 0:e.props.store),o=(null==t?void 0:t.props.store)&&(0,oe.mh)(null==t?void 0:t.props.store);n&&o&&(Le.setMultiSelection({multiSelection:{start:{store:n,index:i.start.index},end:{store:o,index:i.end.index}},forceEmit:!0}),Ue.Zv())}))}function it(e){const{transaction:t,environment:n,editorMode:o,multiSelection:r,store:i,newValue:a}=e;let s=i,c=a;if("suggest"===o&&r){if(!(0,$.iG)(r)){const e=F.oG(n,t,r);F.Sz({environment:n,transaction:t,multiSelection:r,discussionStore:e});const o=S.Vkf(S.KU1(r.start.store.getValue(),0,r.start.index)),i=l.p4(a).slice(o).join("");c=`${S.QaF(S.KU1(r.end.store.getValue(),0,r.end.index))}${i}`}s=r.end.store,Le.setMultiSelection({multiSelection:{start:{store:r.end.store,index:r.end.index},end:{store:r.end.store,index:r.end.index}}})}"default"===o&&r&&!(0,$.qS)(r)&&He({environment:n,transaction:t,multiSelection:r}),at({...e,store:s,usingMultiSelection:!0,newValue:c})}function at(e){const{environment:t,editorMode:n,store:o,newValue:r,disableSlashCommands:i,disableEmojiCommands:a,disableFilters:s,transaction:c,usingMultiSelection:d,disableMentions:u,disabledMentionTypes:p,usePopupForMentionOnMobile:m,mentionSectionOrdering:g}=e,f=o.getValue(),h=S.QaF(f),v=re.UZ(h,r),y=xe.default.state;if("editing"!==y.mode)return;const b=y.multiSelection.start.index;let _=0;for(let S=0;S<v.length;S++){const e=v[S];if(_+l.p4(e[1]).length>b){if(e[0]===re.JZ){const t=v[S-1],n=v[S+1];let o=v[S-2],r=v[S+2];if(n&&n[0]===re.D$)for(r||(r=[re.JZ,""],v.push(r));_+l.p4(e[1]).length>b&&e[1].endsWith(n[1]);)e[1]=e[1].slice(0,e[1].length-n[1].length),r[1]=n[1]+r[1];else if(t&&t[0]===re.D$)for(o||(o=[re.JZ,""],v.unshift(o));_+l.p4(e[1]).length>b&&e[1].startsWith(t[1]);)e[1]=e[1].slice(t[1].length),o[1]=o[1]+t[1],_-=l.p4(t[1]).length}break}_+=l.p4(e[1]).length}let k=!1,w=!1,x=0;for(let T=0;T<v.length;T++){const[e,r]=v[T],d=l.p4(r).length;if(e===re.D$)k=!0,Ye({environment:t,editorMode:n,store:o,selection:{startIndex:x,endIndex:x},string:r,disableSlashCommands:i,disableEmojiCommands:a,disableFilters:s,transaction:c,disableMentions:u,disabledMentionTypes:p,usePopupForMentionOnMobile:m,mentionSectionOrdering:g}),x+=d;else if(e===re.NL)if("suggest"===n){const e={start:{store:o,index:x},end:{store:o,index:x+d}},n=S.KU1(o.getValue(),e.start.index,e.end.index),i=S.lzi(n);for(const a of i){const n=S.QaF([a]),i=l.p4(n).length,s=S.hDy(a).filter((e=>{const n=S.fgJ(e),r=K.cC({store:o,discussionId:n});if(r)return K.Ld(r,t.currentUser)})),d=s.find((e=>S.$b8(e))),u=s.find((e=>S.pGj(e)));if(d){x+=i;continue}if(u){k=!0,w=r===S.qyI,Ge({environment:t,store:o,selection:{startIndex:x,endIndex:x+i},transaction:c});continue}const p=F.oG(t,c,e);F.Sz({environment:t,multiSelection:e,transaction:c,discussionStore:p});const m=e.start.index+i;Le.setSelection({store:e.start.store,selection:{startIndex:m,endIndex:m}}),x+=i}}else"default"===n?(k=!0,w=r===S.qyI,Ge({environment:t,store:o,selection:{startIndex:x,endIndex:x+d},transaction:c})):"translate"===n?De.Xb():(0,C.t1)(n);else e===re.JZ&&(x+=d)}const I=!t.TextSelectionCompositionStore.state.isComposing;k&&I&&!w&&"suggest"!==n&&st({environment:t,store:o,usingMultiSelection:d})}function st(e){const{environment:t,usingMultiSelection:n,store:o}=e;if(n){const e=ie.get(),t=(0,Y.fx)({range:e,contentEditableLeafRegistry:void 0,allowInvisibleEndSelection:!0});t&&Le.setMultiSelection(t)}else{const e=z.Ut(t);e&&(Le.setSelection({store:o,selection:e.selection}),e.forceEmitSelectionStore&&xe.default.emit())}}function lt(e){const{environment:t,editorMode:n,store:o,selection:r,annotation:i,analyticsFrom:a,transaction:s,shareMenuSelection:l}=e;if("suggest"===n)return;Ge({environment:t,store:o,selection:r,transaction:s});const c=(0,ae.OT)(r,o,n).toArray(),d=[S.YCD(i,c),S.V3y(" ",c)];if(Qe({environment:t,store:o,tokens:d,index:r.startIndex,transaction:s}),Le.setSelection({store:o,selection:{startIndex:r.startIndex+d.length,endIndex:r.startIndex+d.length}}),S.IWo(i)&&(o.isTable("block")||o.isTable("comment"))){const e=t.currentUser.id,n=S.zEN(i),r=o.getRecordStoreAtRootPath();e&&Te.TI(t,{is_current_user:n===e,user_id:n,user_access_level:(0,J.rc)(n),from:a,block_type:r instanceof we.G?r.getType():void 0,share_menu_selection:l})}else if(S._bk(i)&&(o.isTable("block")||o.isTable("comment"))){var u;const e=null===(u=S.kxk(i))||void 0===u?void 0:u.groupId,n=o.getRecordStoreAtRootPath();e&&Te.Z0(t,{group_id:e,from:a,block_type:n instanceof we.G?n.getType():void 0})}else if(S.fpG(i)&&(o.isTable("block")||o.isTable("comment"))){const e=S.zyO(i),n=o.getRecordStoreAtRootPath();Te.VN(t,{date:e,from:a,block_type:n instanceof we.G?n.getType():void 0})}else if(S.STW(i)&&(o.isTable("block")||o.isTable("comment"))){const e=S.TOT(i),n=o.getRecordStoreAtRootPath();Te.Qq(t,{page_id:e,from:a,block_type:n instanceof we.G?n.getType():void 0})}}function ct(e){const{environment:t,editorMode:n,store:o,selection:r,emoji:i,transaction:a}=e;if("suggest"===n)return;Ge({environment:t,store:o,selection:r,transaction:a});const s=[l.xo.isCustomEmojiString(i)?S.YCD(S.YWq(l.xo.fromCustomEmojiString(i).pointer)):S.V3y(i)];Qe({environment:t,store:o,tokens:s,index:r.startIndex,transaction:a}),Le.setSelection({store:o,selection:{startIndex:r.startIndex+s.length,endIndex:r.startIndex+s.length}})}function dt(e){const{environment:t,editorMode:n,shouldStripTokens:o,disableFilters:r,store:i,selection:a,transaction:s}=e,c=(0,ae.fM)(i,a,o),d=o?S.Jcv(i.getValue()):S.QaF(i.getValue());let u=l.p4(d),p=0;for(const l of c)if(p++,0===l)u.unshift("\t");else{const e=l+p;u=[...I.tP(u,0,e),"\t",...I.tP(u,e)]}at({environment:t,store:i,editorMode:n,newValue:S.vJ3(u.join("")),disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,disableFilters:r,transaction:s}),Le.setSelection({store:i,selection:{startIndex:a.startIndex+1,endIndex:a.endIndex+p}})}function ut(e){const{environment:t,editorMode:n,shouldStripTokens:o,disableFilters:r,store:i,selection:a,transaction:s}=e,c=(0,ae.fM)(i,a,o),d=o?S.Jcv(i.getValue()):S.QaF(i.getValue());let u=l.p4(d),p=0,m=0;for(const l of c){const e=l-p;0===e?"\t"===u[0]?(u=I.tP(u,1),p+=1):" "===u[0]&&" "===u[1]?(u=I.tP(u,2),p+=2):" "===u[0]&&(u=I.tP(u,1),p+=1):"\t"===u[e+1]?(u=[...I.tP(u,0,e+1),...I.tP(u,e+2)],p+=1):" "===u[e+1]&&" "===u[e+2]?(u=[...I.tP(u,0,e+1),...I.tP(u,e+3)],p+=2):" "===u[e+1]&&(u=[...I.tP(u,0,e+1),...I.tP(u,e+2)],p+=1),l<=a.startIndex&&(m=p)}at({environment:t,store:i,editorMode:n,newValue:S.vJ3(u.join("")),disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,disableFilters:r,transaction:s}),Le.setSelection({store:i,selection:{startIndex:a.startIndex-m,endIndex:a.endIndex-p}})}function pt(e){const{token:t,store:n,readOnly:o}=e;let r=0,i=0;if(t.textValue){let e=0;for(;e<t.tokenIndex;)r+=S.J1x(t.textValue[e]),e++;i=r+S.J1x(t.textValue[e])}Le.setSelection({store:n,selection:{startIndex:r,endIndex:i},readOnly:o})}function mt(e,t){if(!t)return;const n=me.default.getSessionContext(t);if(!n)return;const o=n.getCombinedSteps().find((t=>{var n;return"queryDatabase"===t.type&&(null===(n=t.ephemeralViewData)||void 0===n?void 0:n.assistantQueryDatabaseResultId)===e}));if(null==o||!o.ephemeralViewData)return;const{collectionViewBlockId:r,collectionViewId:i}=o.ephemeralViewData;return B.j.open({collectionViewId:i,collectionViewBlockId:r,assistantSessionId:t})}function gt(e){var t;const{environment:n,event:o,interactiveToken:i,store:l,parentStore:c,canEdit:d}=e,u=S.hDy(i.textToken),p=S.rlz(u),m=S.wPk(u),g=S.V8Y(u),_=S.jC0(u),w=S.zrg(u).map((e=>S.h19(e))),x=S.$d7(u).map((e=>S.fgJ(e))),I=S.eQP(u),T=n.RouterStore.state.route,B=Boolean("chat"===T.name);if(S.YrK(i.textToken)&&!o.shiftKey&&!o.altKey){if(o.preventDefault(),!he.Z.state.open){const e=i.textToken,t=document.createRange(),o=i.node.parentNode,r=i.tokenIndex+1;if(t.setStart(o,i.tokenIndex),t.setEnd(o,r),ie.set(t,n.device),st({environment:n,store:l,usingMultiSelection:!0}),"editing"!==xe.default.state.mode)return;const a=(0,$.QY)(xe.default.state.multiSelection);if(!a)return;return void Re.qn({environment:n,selectedToken:{token:e,position:a.selection},selectionRect:i.node.getBoundingClientRect(),analyticsFrom:"click_token"})}Re.Wj()}const E="on"===ve.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0}),F=[...w,...x].map((e=>{const t=c||l;return we.t1.createChildStore(t,{table:y.qF,id:e,spaceId:(0,b.C)(t.pointer.spaceId)})}));if(I&&null!==(t=me.default.getActiveSession())&&void 0!==t&&t.hasPendingOperations())return void R.assistantDependency.load().then((e=>{let{assistantMenuActions:t}=e;t.openAssistantFromEdit({environment:n})}));const{unresolved:N}=X.bB(F);let O=!1;if(N.length>0){const e=Boolean(p||g),t=ge.Z.state.open||n.device.isMobile,r=(0,oe.sQ)(l);if(e&&t)M.LZ();else if(r){const i=o.target&&o.target.getBoundingClientRect();if(E&&Z.Z.reset(),M.Ib({environment:n,blockStore:r,analyticsFrom:"existing_comment",discussionIds:N.map((e=>e.id)),rect:i,shouldFocusDiscussion:!1,recursivelyLoadAllDiscussions:!1,property_id:be.Z.state.isOpen?be.Z.state.property:Se.Z.state.isOpen?Se.Z.state.property:void 0}),O=!0,e&&!t)return void o.preventDefault()}}else{X.dv(l)||le.Z.find((e=>e.isEditing()))||M.LZ()}var L;E&&S.ujB(u)?(Z.Z.setActiveWithSource("text_annotation"),O&&Z.Z.setState({...Z.Z.state,overlapsExistingDiscussionMenu:!0}),null===(L=te.Z.UpdateSidebarCommentScroller)||void 0===L||L.scrollToTop({animate:!0})):E&&Z.Z.reset();let j,K;p&&(j=ht(S.zW$(p)));let z,q=!1;if(g){K=S.TOT(g);const e=we.G.createChildStore(c||l,{table:h.iU,id:K});q=e.isNavigableBlock();const t=(o.altKey||ke.default.isSidePeekOpen())&&!o.metaKey;j=(0,G.ZP)({store:e,openInSidePeek:t,preferPublicLink:(0,ee.Sr)(n),pageVisitSource:r.tY.LinkInPage})}if(_){const e=S.Vv0(_);if("query_database_result"===e.type)return void mt(e.queryDatabaseResultId,l.inMemoryRecordCache.relatedAssistantSessionId);if("slack"===e.type)j=(0,k.St)({baseUrl:e.baseUrl,domain:e.domain,channelId:e.channelId,messageId:e.messageId,threadTs:e.threadTs}),z="slack";else if("google-drive"===e.type)j=e.url,z="google-drive";else if("helpdoc"===e.type)j=e.url,z="helpdoc";else if("github"===e.type)j=e.url,z="github";else if("url"===e.type)j=e.href;else if((0,C.$K)(e.type)&&"block"!==e.type)(0,C.t1)(e.type);else{const t=e.blockId;if(t){const e=we.G.createChildStore(c||l,{table:h.iU,id:t});q=e.isNavigableBlock();const i=e.getNavigableBlockStore();if(!i)return;j=B&&!o.metaKey?(0,a.tj)({pageVisitSource:r.tY.AIQna,pageId:i.id,scrollToBlockId:i.id!==e.id?e.id:void 0,isMobile:n.device.isMobile}):(0,G.ZP)({store:e,openInSidePeek:!1,preferPublicLink:(0,ee.Sr)(n),pageVisitSource:r.tY.AIQna})}}}if(j){if(U.Z.isComposingNewDiscussion())return void o.preventDefault();o.preventDefault(),Le.clear({environment:n}),je.lY();const{device:e}=n;if(e.isIOS&&Le.blurActiveElement(),o.shiftKey&&!o.altKey)return;const t=(0,f.parseRoute)({url:j,baseUrl:V.default.domainBaseUrl,publicDomainName:V.default.publicDomainName,isMobile:n.device.isMobile,protocol:V.default.protocol,currentUrl:window.location.href});if("page"===t.name||"chat"===t.name){const e=H.DJ(o);if(Ze.c4({environment:n,url:j,openInNew:e}),g&&K&&Te.SK(n,{page_visit_id:_e.$g.getCurrentPageVisitId(),mentioned_page_id:K,source_type:"inline_page_mention_token",hover_preview_enabled:!0,is_navigable_block:q}),l.inMemoryRecordCache.isSyntheticAssistantData){const e=me.default.getActiveAssistantConfigurationState(),o="page"===t.name?t.blockId:t.peekViewBlockId;e&&o&&D.trackQnaResultClicked(n,{configurationState:e,clickedPageId:o,resultType:"page",source:"chat"})}}else{if("aiGtmFavoriteImport"===t.name&&n.currentUser.isLoggedIn())return void(0,A.importGtmFavorite)({environment:n,importArgs:t});if("external"===t.name&&l.inMemoryRecordCache.isSyntheticAssistantData){const e=me.default.getActiveAssistantConfigurationState();e&&z&&D.trackQnaResultClicked(n,{configurationState:e,resultType:z,source:"chat"})}Fe.D({environment:n,url:j})}}else{if(d){const{textToken:e,node:t,tokenIndex:r}=i,a=S.hDy(e);if(S.K9C(a)){const e=l.getAncestorBlockStoreAtRootPath();if(e){if("suggest"===fe.Z.getMode(e))return}return je.lY(),P.b(n,{originRect:t.getBoundingClientRect(),textStore:l,tokenIndex:r,allowReminders:"comment"!==l.table}),void o.preventDefault()}}if(m){const e=we.T5.createChildStore(l,{table:v.x_,id:m[1],spaceId:m[2]}),t=e.getModel();if(!t)return;const i=Q.Dg(e);if(!i)return;const a=we.jQ.createChildStore(i,t.getParentPointer()).getModel();if(!a)return;const c=we.G.createChildStore(i,a.getParentPointer()).getModel(),d=c&&"table_row"===c.getType()?c.getParentId():a.getParentId(),u=(0,s.Z)({pageId:i.id,scrollToBlockId:d,pageModel:i.getModel(),baseUrl:void 0,discussionId:a.id,pageVisitSource:r.tY.MentionInPage});o.preventDefault(),Ze.c4({environment:n,url:u})}d&&S.J82(u)&&(o.preventDefault(),ft(e)),d&&(S.xat(u)||S.hH9(u))&&(o.preventDefault(),ft(e))}}function ft(e){var t;const{event:n,interactiveToken:o,environment:r,store:i}=e,{tokenIndex:a}=o,s=(0,ae.Ts)(i.getValue(),a)??{startIndex:0,endIndex:0},l=Array.from(o.node.getClientRects()),c=pe.em(l),d=(null===(t=c.rects.find((e=>pe.uh(e.original,n.clientX,n.clientY))))||void 0===t?void 0:t.translate)??(0,ue.xS)(),u=c.total.x+c.total.width/2,p=(0,ue.qe)({x:n.clientX,y:n.clientY},d).x>u?s.endIndex:s.startIndex;Le.selectAndEditMultiSelection({environment:r,multiSelection:(0,$.TD)({store:i,selection:{startIndex:p,endIndex:p}}),focus:void 0,forceEmit:!1})}function ht(e){const t=T.Nm({str:e,allowNoProtocol:!0}),n=T.Qc(t);return t&&!t.startsWith("/")&&n&&!n.protocol?`http://${e}`:t}function vt(e){const{environment:t,event:n,interactiveToken:o,store:r,parentStore:i}=e;if(!i)return;const a=S.hDy(o.textToken),s=S.V8Y(a);if(s){const e=S.yrl(s);if(!e)return;const o=we.G.createChildStore(i||r,e);n.preventDefault(),Me.Qn({environment:t,stores:[o],left:n.clientX,top:n.clientY,showInput:!1,actionSectionGroupKey:"page_mention",analyticsFrom:"page_mention_block_menu",pageAnnotationToken:{parentStore:i,pageAnnotation:s}})}}function yt(e){je.HM({token:e.interactiveToken,store:e.store})}function bt(e){je.lY({relatedNode:e.interactiveToken.node})}function _t(e){const{block:t,transaction:n,tokenIndex:o}=e,r=t.getBlockTitleStore();if(!t.getTitleStore()||!r.isDefined()||!r.getValue()||r.getValue().length<o)return!1;const i=r.getValue(),a=(0,ae.Ts)(i,o);return!!a&&(We({environment:t.environment,store:r,selection:a,transaction:n,updateSelection:!1,removeInlineRecords:!0}),!0)}function St(e){var t;const{store:n,transaction:o}=e,r=Pe.tk();if(!r)return;if(!("editing"===xe.default.state.mode&&(null===(t=(0,$.QY)(xe.default.state.multiSelection))||void 0===t?void 0:t.selection)))return;const i=n.getValue();if(!i)return;const a=(0,c.UQ)(i,r.parentCollection,n.getRecordModel);Xe({environment:n.environment,store:n,value:a,transaction:o})}function kt(e){const{store:t,transaction:n}=e;Xe({environment:t.environment,store:t,value:void 0,transaction:n})}},498724:(e,t,n)=>{n.d(t,{QE:()=>f,aS:()=>m,bt:()=>h,mX:()=>g});var o=n(463332),r=n(653965),i=n(745162),a=n(165598),s=n(489086),l=n(924666),c=n(709953),d=n(800993),u=n(898104),p=n(210228);function m(e){const{environment:t,annotation:n}=e,o=l.default.state;if("editing"!==o.mode)return;if(l.default.isEmptySelection())return void u.toggleExtendAnnotation({annotation:n});const{multiSelection:r}=o;(0,i.L5)(r).length>0&&(p.createAndCommit({userAction:"textAnnotationActions.annotateSelection",environment:t,perform:t=>{d.MY({...e,transaction:t,multiSelection:r})}}),u.setMultiSelection({multiSelection:r}))}function g(e){const{environment:t,annotationKey:n}=e,o=l.default.state;if("editing"!==o.mode)return;if(l.default.isEmptySelection())return;const{multiSelection:r}=o,a=(0,i.L5)(r);a.length>0&&(p.createAndCommit({userAction:"textAnnotationActions.unannotateSelection",environment:t,perform:e=>{for(const{selection:o,store:r}of a)d.ST({environment:t,store:r,annotationKey:n,selection:o,transaction:e,updateSelection:!1})}}),u.setMultiSelection({multiSelection:r}))}function f(e){const{environment:t,annotationKey:n,blocks:o,transaction:r}=e;for(const i of(0,a.Sd)({blockStores:o,traverseTransclusionReferences:!1})){const e=i.getBlockTitleStore(),o=(0,s.P2)(e);o&&d.ST({environment:t,store:e,annotationKey:n,selection:o,transaction:r,updateSelection:!1})}}function h(e){const{environment:t,store:n,context:i,transaction:a}=e;if(!n.canEdit())return;const{title:s,...l}=n.getProperties(),u=Object.entries(l).reduce(((e,t)=>{let[n,a]=t;if(a){const t=(0,o.KV)(a,i);r.Xy(a,t)||(e[n]=t)}return e}),{});r.xb(u)||c.sW({store:n.getPropertiesStore(),data:u,transaction:a});const p=n.getTitleValue();if(p){const e=(0,o.KV)(p,i);r.Xy(p,e)||d.sO({environment:t,store:n.getBlockTitleStore(),value:e,transaction:a})}}},56971:(e,t,n)=>{n.d(t,{We:()=>Z,YV:()=>j,as:()=>L,ew:()=>V});n(867635);var o=n(701302),r=n(840376),i=n(541432),a=n(180951),s=n(159730),l=n(421838),c=n(182798),d=n(653965),u=n(401898),p=n(601600),m=n(678791),g=n(27105),f=n(451165),h=n(100754),v=n(268056),y=n(273959),b=n(489086),_=n(635328),S=n(828685),k=n(95802),w=n(385555),x=n(924666),I=n(496802),C=n(778321),T=n(844886),M=n(594419),P=n(119785),A=n(311712),R=n(524677),D=n(800993),B=n(898104),E=n(295982),F=n(668422);function Z(e){const{store:t,block:n,targetStore:o,targetBlock:r}=e;n&&(0,g.Ls)({store:t,blockStore:n})&&r&&(0,g.Ls)({store:o,blockStore:r})?m.tE({...e,targetStore:o,sourceBlockStore:n}):U(e)}function U(e){const{environment:t,transaction:n,store:o,targetStore:r}=e,i=(0,b.x0)(r);i?D.gc({environment:t,sourceStore:o,sourceIndex:0,targetStore:r,targetIndex:i.endIndex,transaction:n}):D.pe({environment:t,transaction:n,store:o,selection:{startIndex:0,endIndex:1/0}})}function V(e){const{environment:t,store:n,transaction:r}=e;r.annotateWithUserAction("textBackspaceActions.annotatedContentBlockBackspaceAtBeginning");const s=(0,y.sQ)(n);if(s){if("callout"===s.getType()&&I.FH({stores:[s],update:{block_color:void 0},transaction:r}),s.isType("to_do")){const e=s.getProperties();e&&a.Ml(e.checked)&&E.c({environment:t,blocks:[s],transaction:r})}let e=s,n=i.Ti.text;if(_.fn(s)){const e=s.getType();e&&(n=e)}e=F.vs({environment:t,block:s,blockType:n,transaction:r}),o.default.afterNextFlush((()=>{const n=k.C.findEditableStoreWithin(e);n&&(B.setSelectionAtStart({store:n}),R.eP({environment:t,store:e}))}))}return n}function N(e){const{environment:t,editorMode:n,multiSelection:o,transaction:i,deleteForwards:a}=e;if("suggest"===n)return void function(e){const{multiSelection:t}=e,n=(0,y.sQ)(t.start.store);if(!n)throw new s.p8("Can not make suggest edits without associated block store");(0,v.iG)(t)?function(e){const{environment:t,multiSelection:n,transaction:o,deleteForwards:i,blockStore:a}=e,c=n.start,d={indexOfAboutToBeDeletedChar:i?c.index:c.index-1,indexOfLeadingChar:i?c.index-1:c.index,annotateSelectionIndex:i?[c.index,c.index+1]:[c.index-1,c.index],newCursorIndex:i?c.index+1:c.index-1},u={start:{store:c.store,index:d.annotateSelectionIndex[0]},end:{store:c.store,index:d.annotateSelectionIndex[1]}},m=(0,b.Mz)(c.store.getValue(),d.indexOfAboutToBeDeletedChar),g=(0,f.k$)(a,r.u.fromArray(m),t.currentUser,l.GKr.SuggestionInsertText);if(g)return D.pz({...e,multiSelection:u}),void(0,p.vh)({environment:t,transaction:o,discussionStore:g.discussionStore});const[h,v]=[d.indexOfAboutToBeDeletedChar,d.indexOfLeadingChar].map((e=>{const t=(0,b.W8)(c.store.getValue(),e,l.GKr.SuggestionRemoveText);if(t&&l.BIG(t))return l.fgJ(t)})),y=l.eeV(c.store.getValue()).length;(i&&c.index<y||!i&&c.index>0)&&O(c.store,d.newCursorIndex);if(h)return;let _;if(v){const e=p.P5(u,v);if(!e)throw new s.p8("Could not get discussion store from selection and leadingSuggestRemoveDiscussionId");(0,f.Ld)(e,t.currentUser)&&(_=e)}_||(_=p.oG(t,o,u));p.Sz({environment:t,transaction:o,multiSelection:u,discussionStore:_})}({...e,blockStore:n}):function(e){const{environment:t,transaction:n,multiSelection:o,blockStore:r}=e,i=p.oG(t,n,r);p.Sz({environment:t,transaction:n,multiSelection:o,discussionStore:i}),O(o.start.store,o.start.index)}({...e,blockStore:n})}(e);let c;i.annotateWithUserAction("textBackspaceActions.textBackspaceWithinContent"),c=(0,v.iG)(o)?a?{start:o.start,end:{store:o.start.store,index:o.start.index+1}}:{start:{store:o.start.store,index:o.start.index-1},end:o.start}:o,D.pz({environment:t,multiSelection:c,transaction:i})}function O(e,t){B.setMultiSelection({multiSelection:{start:{store:e,index:t},end:{store:e,index:t}}})}function L(e){const{environment:t,editorMode:n,multiSelection:r,transaction:a,deleteForwards:s,event:m}=e,g=t.device.isApple&&m.metaKey,D=!(t.device.isIOS&&(0,v.iG)(r));B.clearForceExtendAnnotations();const E=(0,v.QY)(r);if(E&&0===E.selection.startIndex&&0===E.selection.endIndex&&!s){const{store:e}=E;m.preventDefault();const r=(0,y.sQ)(e);if(r){const s=r.getModel();if(s){const r=s.isType(i.q7);r&&!g?V({environment:t,store:e,transaction:a}):s.isType(i.Q3)||r&&g?function(e){const{store:t,editorMode:n,transaction:r,environment:i}=e;r.annotateWithUserAction("textBackspaceActions.textBackspaceAtBeginning");const a=(0,y.sQ)(t);if(!a)return;const s=(0,y.sQ)(a),c=s&&(0,y.sQ)(s);if(s&&c){const e=s.getRenderableContentIds()??[];if(!(d.Z$(e)!==a.id||s.isTransclusionType()||_.BX(s)&&d.Ps(e)===a.id||"tab"===c.getType())){const e=T.uv({blockStore:a,parentStore:s,grandparentStore:c,transaction:r});if(e)return void o.default.afterNextFlush((()=>{if(e){const t=k.C.findEditableStoreWithin(e);t&&(R.eP({environment:i,store:e}),B.setSelectionAtStart({store:t}))}}))}s.isCalloutV2()&&1===e.length&&A.Cl({environment:i,blocks:[s],transaction:r})}if(w.default.checkGate({gateName:"text_align"})){if("center"===a.getFormat().block_alignment)return void I.hc({environment:i,store:a,alignment:"left",transaction:r});if("right"===a.getFormat().block_alignment)return void I.hc({environment:i,store:a,alignment:"center",transaction:r})}const m=(0,h.i)(t),g=m?(0,y.sQ)(m):void 0;if(m&&a&&g){const e=()=>{const e=(0,b.x0)(m);if(Z({environment:i,transaction:r,store:t,block:a,targetStore:m,targetBlock:g}),B.setSelection({store:m,selection:e}),R.eP({environment:i,store:g}),!_.BX(a)&&s){const e=a.getContentStores();for(const n of e)M.Vt({parentStore:s.getContentStore(),beforeStore:a,insertStore:n,transaction:r});const t=a.getContentStore();for(const n of e)M.Od({parentStore:t,childToRemoveStore:n,transaction:r})}A.Od({store:a,transaction:r})},o=()=>{const e=(0,b.x0)(m);B.setSelection({store:m,selection:e})};if("suggest"===n){var v;if("page"===g.getType()||m.path.includes("caption"))return;const n=null===(v=(0,f.YT)({blockStore:g,currentUser:i.currentUser,type:l.GKr.SuggestionInsertText}))||void 0===v?void 0:v.discussionStore,s=(0,f.qM)({blockStore:g,currentUser:i.currentUser,suggestionType:"add_line_break"});if(n)o(),e(),p.vh({environment:i,transaction:r,discussionStore:n,removeModifiedBlockIds:[t.id]});else if(s)0===g.getTitleValue().length?(A.Od({store:g,transaction:r}),B.setSelection({store:t,selection:{startIndex:0,endIndex:0}})):(p.JK({environment:i,transaction:r,blockStore:g,type:"add_line_break",removeDiscussionId:!0}),o());else{const e=0===a.getTitleValue().length;p.N$({environment:i,transaction:r,blockStore:g,createDiscussionStore:()=>p.oG(i,r,g,void 0,e?{blockStore:a,suggestionTypes:["remove_line_break"],currentUser:i.currentUser}:void 0),type:"remove_line_break"}),o()}}else"default"===n?(g.getAddLineBreakSuggestion()?p.JK({environment:i,transaction:r,blockStore:g,type:"add_line_break",removeDiscussionId:!0}):g.getRemoveLineBreakSuggestion()&&p.JK({environment:i,transaction:r,blockStore:g,type:"remove_line_break",removeDiscussionId:!0}),e()):"translate"===n?C.Xb:(0,u.t1)(n)}}({environment:t,editorMode:n,store:e,transaction:a}):E.store.path.includes("caption")&&function(e){const{environment:t,editorMode:n,store:o,transaction:r}=e;if("suggest"===n)return;r.annotateWithUserAction("textBackspaceActions.captionBackspaceAtBeginning");const i=S.E.getMembersByDOMOrder({filter:()=>!0}),a=i.findIndex((e=>e.props.store===o)),s=i.findLast(((e,t)=>t<a&&e.props.canInsertText)),l=null==s?void 0:s.props.store;if(!l)return;const d=(0,c.TO)((0,y.sQ)(o)),u=(0,c.TO)((0,y.sQ)(l)),p=(0,b.x0)(l);U({environment:t,store:o,targetStore:l,transaction:r,targetBlock:d,block:u}),B.setSelection({store:l,selection:p});const m=(0,y.sQ)(l);R.eP({environment:t,store:m})}({environment:t,editorMode:n,store:e,transaction:a})}}}else E&&(0,b.J_)(E.store,E.selection)&&s?(m.preventDefault(),function(e){const{environment:t,editorMode:n,store:o,transaction:r}=e;r.annotateWithUserAction("textBackspaceActions.textDeleteAtEnd");const i=S.E.getMembersByDOMOrder({filter:()=>!0}),a=d.cx(i,(e=>e.props.store===o)),s=i.find(((e,t)=>Boolean(t>a&&e.props.canInsertText))),l=s?s.props.store:void 0,c=(0,y.sQ)(o),m=l?(0,y.sQ)(l):void 0;if(c&&m&&l)if("suggest"===n){if(m.path.includes("caption"))return;const e=(0,h.i)(o),n=e?(0,y.sQ)(e):void 0,i=n&&0===c.getTitleValue().length;p.N$({environment:t,transaction:r,blockStore:c,type:"remove_line_break",createDiscussionStore:()=>p.oG(t,r,c,void 0,i?{blockStore:n,suggestionTypes:["remove_line_break"],currentUser:t.currentUser}:void 0)}),B.setSelection({store:l,selection:{startIndex:0,endIndex:0}})}else if("default"===n||"translate"===n)if(c.isEmptyTextBlock()){const e=(0,y.sQ)(c);e&&P.hr({childStore:c,parentStore:e,transaction:r}),B.setMultiSelection({multiSelection:{start:{store:l,index:0},end:{store:l,index:0}}})}else{const e="readOnly"===x.default.state.mode,n="empty"!==x.default.state.mode&&x.default.state.multiSelection;if(Z({environment:t,transaction:r,store:l,block:m,targetStore:o,targetBlock:c}),m){const t=(0,y.sQ)(m);if(t){const e=m.getContentStore(),n=m.getContentStores();for(const o of n)M.Od({parentStore:e,childToRemoveStore:o,transaction:r}),M.Vt({parentStore:t.getContentStore(),beforeStore:m,insertStore:o,transaction:r})}A.Od({store:m,transaction:r}),n&&B.setMultiSelection({multiSelection:n,readOnly:e})}}else(0,u.t1)(n)}({environment:t,editorMode:n,store:E.store,transaction:a})):D&&(m.preventDefault(),N({environment:t,editorMode:n,multiSelection:r,deleteForwards:s,transaction:a}));const F=x.default.state;"editing"===F.mode&&(0,b.ST)(F.multiSelection.start.store.getValue(),F.multiSelection.start.index-1,"c")&&B.setExtendAnnotation({annotation:["c"],extend:!0})}function j(e){const{event:t,multiSelection:n,device:o}=e;return(o.isApple&&t.metaKey||!o.isApple&&t.ctrlKey||o.isApple&&t.altKey)&&!(0,b.dQ)(n)}},274284:(e,t,n)=>{n.d(t,{IO:()=>F,PF:()=>V});n(252262),n(324506);var o=n(701302),r=n(840376),i=n(541432),a=n(421202),s=n(456452),l=n(421838),c=n(182798),d=n(401898),u=n(601600),p=n(678791),m=n(451165),g=n(100754),f=n(741195),h=n(268056),v=n(273959),y=n(635328),b=n(385555),_=n(206258),S=n(924666),k=n(445131),w=n(897630),x=n(100952),I=n(778321),C=n(844886),T=n(594419),M=n(709953),P=n(761045),A=n(524677),R=n(800993),D=n(56971),B=n(898104);function E(e){const t=(0,v.sQ)(e.store);if(t&&function(e){var t;const n=e.getType();return!!n&&(!!(0,i.he)(n)&&!(e.id!==(null===(t=e.getParentBlockStore())||void 0===t?void 0:t.getRenderableContentIds().at(-1))))}(t)){const n=C.rB({environment:e.environment,blocks:[t],transaction:e.transaction});if(n)return void o.default.afterNextFlush((()=>{const e=n[0].getTitleStore();e&&B.setMultiSelection({multiSelection:{start:{store:e,index:0},end:{store:e,index:0}}})}))}D.ew(e)}function F(e){const{environment:t,transaction:n,multiSelection:c}=e;w.M_(t)?((0,v.x7)(c.start.store)?function(e){const{environment:t,editorMode:n,transaction:r}=e;let a=e.multiSelection;const s=(0,v.sQ)(a.start.store);if(!s||s.isCollectionView())return;if("default"===n||"translate"===n)R.pz({environment:t,multiSelection:a,transaction:r});else{if("suggest"===n)return;(0,d.t1)(n)}const l=S.default.state;a="editing"===l.mode&&l.multiSelection||a;const c=a.start.store,u={environment:t,type:i.Ti.text,inMemoryRecordCache:c.inMemoryRecordCache,transaction:r,spaceId:s.pointer.spaceId,useCrdt:s.useCrdt()},p=M.j4(u),m=T.Ce({parentStore:s.getContentStore(),prependStore:p,transaction:r}).childStore;V({environment:t,blockStore:s,store:c,targetBlockStore:m,splitAtIndex:a.start.index,transaction:r}),o.default.afterNextFlush((()=>{B.setSelectionAtStart({store:m.getBlockTitleStore()})})),x.W(t,{from:"text_enter",type:i.Ti.text,creating_block_id:p.id,parent_collection_id:p.getParentCollectionIdUpToTwoLevels()})}(e):(0,h.iG)(c)&&(function(e){const t=e.getRecordStoreUIParent();return t instanceof _.G&&e&&t.isType(i.q7)&&0===l.QaF(t.getTitleValue()).length}(c.start.store)||function(e){const t=e.getAncestorBlockStoreAtRootPath();return t&&t.getType()===i.Ti.text&&t.isDirectlyWithinCalloutV2Block()&&0===l.QaF(t.getTitleValue()).length}(c.start.store))?E({environment:t,transaction:n,store:c.start.store}):(0,h.ko)(c)&&Z(c.start.store)&&U(c.start.store)?function(e){var t;const{environment:n,transaction:c,multiSelection:d,editorMode:p}=e,h=d.start.store,y=(0,v.sQ)(h);if(!y||!(y.canEdit()||y.isCommentOnly()&&(0,m.xU)({blockStore:y,currentUser:n.currentUser})))return;const b=y.computeWithRecordValues((e=>{let{getRecordValueAndSubscribe:t}=e;return t(y)})),_=(0,v.sQ)(y);if(!b||!_)return;const S=M.j4({environment:n,type:(0,i.he)(b.type)?b.type:i.Ti.text,inMemoryRecordCache:h.inMemoryRecordCache,transaction:c,spaceId:_.pointer.spaceId,properties:b.properties?N(b.properties):void 0,format:b.format?[b.format].map(O).map(s.b8)[0]:void 0,permissions:b.permissions,useCrdt:Boolean(null===(t=b.format)||void 0===t?void 0:t.use_crdt)});if(T.Vt({parentStore:_.getContentStore(),beforeStore:y,insertStore:S,transaction:c}).childStore,"suggest"===p){var k;const e=(0,g.i)(h),t=e?(0,v.sQ)(e):void 0,o=(0,u.oG)(n,c,S,{annotations:r.u.fromArray(l.Rkp(null==e?void 0:e.getValue())),annotationTypes:[l.GKr.SuggestionInsertText],currentUser:n.currentUser},t?{blockStore:t,suggestionTypes:["add_line_break"],currentUser:n.currentUser}:void 0);(0,u.n1)(c,S,{type:"add_line_break",id:(0,f.TS)({table:a.iU,environment:n,spaceId:_.pointer.spaceId}),discussionId:o.id}),null!=y&&null!==(k=y.getNavigableBlockStore())&&void 0!==k&&k.isCommentOnly()&&(0,u.n1)(c,S,{type:"insert",id:(0,f.TS)({table:a.iU,environment:n,spaceId:_.pointer.spaceId}),discussionId:o.id}),(0,u.vh)({environment:n,transaction:c,discussionStore:o,addModifiedBlockIdsAfter:[S.id]})}x.W(n,{from:"text_enter",type:i.Ti.text,creating_block_id:S.id,parent_collection_id:S.getParentCollectionIdUpToTwoLevels()}),n.device.isMobile&&o.default.afterNextFlush((()=>P.hQ(n)))}(e):function(e){var t;const{environment:n,editorMode:o,transaction:r,multiSelection:a}=e,s=(0,v.sQ)(a.start.store);if(!s)return;if(!(s.canEdit()||s.isCommentOnly()&&(0,m.xU)({blockStore:s,currentUser:n.currentUser})))return;const l=(0,v.sQ)(s);if(!l)return;if(!(0,h.iG)(a))if("suggest"===o){const t=(0,u.oG)(n,r,a);(0,u.Sz)({...e,discussionStore:t})}else"default"===o?R.pz(e):"translate"===o?I.Xb():(0,d.t1)(o);const c=a.start.store,p=s.getType(),g=s.getContentLength(),f=s.getModel();let _;if((0,y.BX)(s)&&k.Z.isOpen(s.id))_=i.Ti.text;else if(f&&g>0&&f.isType(i.nH)){_=i.Ti.text;const e=s.getContentStores()[0];if(e){const t=e.getType();e.isDefined()&&t&&i.kC[t]&&(_=t)}}else _=!(p&&f&&!f.isType(i.Q2)&&Z(c)&&U(c)&&"code"!==p)||f.isType("ai_block")&&f.isSkillBlock()?i.Ti.text:p;const S={environment:n,type:_,inMemoryRecordCache:c.inMemoryRecordCache,transaction:r,spaceId:l.pointer.spaceId,format:{block_alignment:b.default.checkGate({gateName:"text_align"})?null===(t=s.getFormat())||void 0===t?void 0:t.block_alignment:void 0},useCrdt:s.useCrdt()},w=M.j4(S),C=l.getRenderableContentIds()||[];let P,A=!1;if((0,y.BX)(s)&&k.Z.isOpen(s.id)){const e=s.getContentStore();A=!0,P=T.Ce({parentStore:e,prependStore:w,transaction:r})}else if(f&&g&&f.isType(i.nH)){const e=s.getContentStore();A=!0,P=T.Ce({parentStore:e,prependStore:w,transaction:r})}else if(null!=f&&f.isType("ai_block")&&f.isSkillBlock()){const e=s.getContentStore();A=!0,P=T.Ce({parentStore:e,prependStore:w,transaction:r})}else P=C.indexOf(s.id)>=0?T.BE({parentStore:l.getContentStore(),afterStore:s,insertStore:w,transaction:r}):T.Ce({parentStore:l.getContentStore(),prependStore:w,transaction:r});const D=P.childStore;if(Z(c)&&p&&!A&&!(0,y.BX)(s)){const e=s.getContentStores(),t=s.getContentStore(),n=D.getContentStore();for(const o of e)T.Od({parentStore:t,childToRemoveStore:o,transaction:r}),T.R3({parentStore:n,appendStore:o,transaction:r})}V({environment:n,blockStore:s,store:a.start.store,targetBlockStore:D,splitAtIndex:a.start.index,transaction:r}),(0,u._T)({environment:n,transaction:r,sourceBlockStore:s,targetBlockStore:D,selectionIsExpanded:!(0,h.iG)(a),editorMode:o}),x.W(n,{from:"text_enter",type:_,creating_block_id:w.id,is_toggleable:(0,y._A)(_,w.getFormat()),parent_collection_id:w.getParentCollectionIdUpToTwoLevels()})}(e),t.device.isMobile||o.default.afterNextFlush((()=>{P.Zv()}))):(0,w.ne)()}function Z(e){if(e.table===a.iU){const t=_.G.createChildStore(e,{table:a.iU,id:e.id}).getType();return t&&!(0,i.S9)(t)}return!1}function U(e){if(e.table===a.iU){const t=_.G.createChildStore(e,{table:a.iU,id:e.id}).getModel();return t&&!t.isType(i.oe)&&!t.isType(i.Ok)}return!1}function V(e){const{environment:t,blockStore:n,store:o,targetBlockStore:r,splitAtIndex:i,transaction:a}=e,s={store:o,index:i},l={start:s,end:s};if(n.useCrdt()&&n.getBlockTitleStore()===o){(0,c.T)(r.useCrdt(),"Calling splitText() with a non-CRDT target block is not currently supported");(0,h.NV)(l)||p.Wc({sourceBlockStore:n,targetBlockStore:r,splitAtGraphemeIndex:i,transaction:a,moveIntoNewBlock:!0})}else R.gc({environment:t,sourceStore:l.end.store,sourceIndex:l.end.index,targetStore:r.getBlockTitleStore(),targetIndex:0,transaction:a});A.eP({environment:t,store:r}),B.setSelectionAtStart({store:r.getBlockTitleStore()})}function N(e){const{title:t,...n}=e;return n}function O(e){const{text_slice_tree:t,text_clocks:n,...o}=e;return o}},617269:(e,t,n)=>{n.d(t,{G:()=>G,f:()=>W});n(397391),n(757658);var o=n(541432),r=n(415095),i=n(423512),a=n(421202),s=n(421838),l=n(182798),c=n(211342),d=n(653965),u=n(401898),p=n(840959),m=n(83631);function g(e,t){return r.p4(e.substring(0,t)).length}var f=n(268056),h=n(799445),v=n(273959),y=n(635328),b=n(206258),_=n(27724),S=n(924666),k=n(250906),w=n(247839),x=n(496802),I=n(311712),C=n(524677),T=n(666771),M=n(800993),P=n(274284),A=n(898104),R=n(210228),D=n(668422);function B(e){var t;const{environment:n,store:i,toBlockType:a,matchRegex:c,insertTextAfter:d,transaction:u,postTransformAction:m}=e,g="editing"===S.default.state.mode&&(null===(t=(0,f.QY)(S.default.state.multiSelection))||void 0===t?void 0:t.selection);if(!g)return;const h=r.p4(s.QaF(i.getValue())).slice(0,g.endIndex).join(""),w=c.exec(h);if(!w)return;const x=i.getRecordStoreUIParent();if(!(x&&x instanceof b.G))return;const T=x.getType();if(!T)return;if(T!==o.Ti.text&&!o.q7[T])return;const R=a(w);if(void 0===R||R===T)return;let B=R;x instanceof b.G&&("toggle"===R&&(0,o.zp)(x.getType())?B=y.m1(T):"toggle"===T&&y.JO(R)&&(B=y.m1(R)),D.vs({environment:n,block:x,blockType:B,transaction:u}));const E={startIndex:0,endIndex:w&&r.p4(w[0]).length||0};if(M.pe({environment:n,store:i,selection:E,transaction:u}),d){const e=I.aO({environment:n,selection:_.default.state.stores,createBlockItem:p.Hc[o.Ti.text],analyticsFrom:"divider"===R?"divider_block_transform":"text_filter_actions",transaction:u});e&&(P.PF({environment:n,blockStore:(0,l.TO)((0,v.sQ)(i)),store:i,targetBlockStore:e,splitAtIndex:0,transaction:u}),C.eP({environment:n,store:e}),A.setSelectionAtStart({store:e.getBlockTitleStore()}))}m&&m(w),k.g_(n,{type:R})}function E(e){var t,n;const{environment:o,editorMode:i,store:a,transaction:l,regex:c,length:d,analyticsType:u,replace:p}=e,m="editing"===S.default.state.mode&&(null===(t=(0,f.QY)(S.default.state.multiSelection))||void 0===t?void 0:t.selection);if(!m)return;const h=a.getValue()||[],v=s.QaF(h),y=r.p4(v).slice(0,m.endIndex).join(""),b=c.exec(y);if(!b)return;const _=g(v,b.index),w={startIndex:_,endIndex:_+d},x=a.getValue()||[];if(s.oP(x,w.startIndex,w.endIndex,"c"))return;const I="function"==typeof p?p({match:b,matchIndex:_,textValue:h}):p;if(void 0===I)return;if(M.pe({environment:o,store:a,selection:w,transaction:l}),"editing"!==S.default.state.mode)return;const C=null===(n=(0,f.QY)(S.default.state.multiSelection))||void 0===n?void 0:n.selection;C&&(M.hJ({environment:o,editorMode:i,store:a,selection:C,string:I,disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,transaction:l}),k.Af(o,{type:u}))}function F(e){var t;const{environment:n,store:o,delimiter:i,annotation:a,transaction:l}=e,c="editing"===S.default.state.mode&&(null===(t=(0,f.QY)(S.default.state.multiSelection))||void 0===t?void 0:t.selection);if(!c)return;const d=o.getValue(),u=Z({delimiter:i,storeValue:d,selectionEndIndex:c.endIndex});if(!u)return;if(!U({delimiter:i,storeValue:d,...u}))return;if(s.p9b(d,u.startIndex,u.endIndex,s.GKr.Code))return;const{textValue:p,startIndex:m,endIndex:h}=u,v=g(p,m),y=p.slice(m,h),b=r.p4(y).length,_={startIndex:v,endIndex:v+i.length};M.pe({environment:n,store:o,selection:_,transaction:l});const w={startIndex:v+b-i.length-i.length,endIndex:v+b-i.length};M.pe({environment:n,store:o,selection:w,transaction:l});const x={startIndex:_.startIndex,endIndex:w.startIndex};T.WO({environment:n,store:o,selection:x,annotation:a,transaction:l});const I=x.endIndex;A.setSelection({store:o,selection:{startIndex:I,endIndex:I}}),A.setExtendAnnotation({annotation:a,extend:!1}),k.tn(n,{type:s.J7s(a)})}function Z(e){const{delimiter:t,storeValue:n,selectionEndIndex:o}=e,i=r.p4(s.QaF(n)).slice(0,o).join("");if(0===i.length||!i.endsWith(t))return;const a=i.split(t);if(a.length<=2)return;a.reverse();const[l,...c]=a.slice(1),u=d.Sm(c.map((e=>e.length+t.length)))-t.length;return{textValue:i,matchString:l,startIndex:u,endIndex:u+l.length+2*t.length}}function U(e){const{delimiter:t,matchString:n,startIndex:o,endIndex:r,textValue:i}=e;return n.length>0&&!/\s/g.test(n[0])&&!/\s/g.test(n[n.length-1])&&!n.startsWith(t)&&!n.endsWith(t)&&(!i[o-1]||/[\s(]/g.test(i[o-1]))&&(!i[r]||/[\s)]/g.test(i[r]))}function V(e){var t;const{environment:n,delimiter:o,store:i,transaction:a}=e,l="editing"===S.default.state.mode&&(null===(t=(0,f.QY)(S.default.state.multiSelection))||void 0===t?void 0:t.selection);if(!l)return;const c=i.getValue(),d=Z({delimiter:o,storeValue:c,selectionEndIndex:l.endIndex});if(!d)return;if(!function(e){const{storeValue:t,startIndex:n,endIndex:o,delimiter:r}=e;if(!U(e))return!1;const i={[s.GKr.User]:s.GKr.User,[s.GKr.Page]:s.GKr.Page,[s.GKr.CustomEmoji]:s.GKr.CustomEmoji,[s.GKr.Comment]:s.GKr.Comment,[s.GKr.Bot]:s.GKr.Bot,[s.GKr.ExternalObjectInstance]:s.GKr.ExternalObjectInstance,[s.GKr.Date]:s.GKr.Date,[s.GKr.TemporaryPage]:s.GKr.TemporaryPage,[s.GKr.TemplateVariable]:s.GKr.TemplateVariable,[s.GKr.FormulaPageProperty]:s.GKr.FormulaPageProperty,[s.GKr.FormulaContextValue]:s.GKr.FormulaContextValue,[s.GKr.Group]:s.GKr.Group,[s.GKr.Citation]:s.GKr.Citation,[s.GKr.LinkMention]:s.GKr.LinkMention,[s.GKr.AssistantInstructionsCollection]:s.GKr.AssistantInstructionsCollection};for(const a of Object.values(i))if(s.oP(t,n,o,a))return!1;if(s.oP(t,n,n+r.length,s.GKr.Code)&&s.oP(t,o-r.length,o,s.GKr.Code))return!1;return!0}({delimiter:o,storeValue:c,...d}))return;const{textValue:u,matchString:p,startIndex:h,endIndex:v}=d,y=g(u,h),b=u.slice(h,v);M.pe({environment:n,store:i,selection:{startIndex:y,endIndex:y+r.p4(b).length},transaction:a});const _=s.qZ6(p);M.mM({environment:n,store:i,tokens:[_],index:y,transaction:a});const w=y+r.p4(s.WiV(_)).length;A.setSelection({store:i,selection:{startIndex:w,endIndex:w}}),k.tn(n,{type:s.GKr.Equation}),m.ND({environment:n,equation:p,from:{type:"create",source:"text_filter",selection:!0}})}const N=["\\.",",",";","\\?","!","\\)","\\]"," "].join("|"),O=new RegExp(` (${N})$`);function L(e){const t=s.xrQ(e.textValue,e.matchIndex-1,e.matchIndex),n=d.Z$(t.tokensInsideRange);if(n&&s.km_(n))return e.match[1]}const j=[{delimiter:"**",type:s.GKr.Bold},{delimiter:"**",type:s.GKr.Bold},{delimiter:"*",type:s.GKr.Italic},{delimiter:"*",type:s.GKr.Italic},{delimiter:"__",type:s.GKr.Bold},{delimiter:"__",type:s.GKr.Bold},{delimiter:"_",type:s.GKr.Italic},{delimiter:"_",type:s.GKr.Italic},{delimiter:"~",type:s.GKr.Strike},{delimiter:"〜",type:s.GKr.Strike},{delimiter:"~",type:s.GKr.Strike}],K=[{toBlockType:()=>o.Ti.toDo,matchRegex:/^(\[\] |\[ \] |\「\」 )$/,insertTextAfter:!1},{toBlockType:()=>o.Ti.subSubHeader,matchRegex:/^(### |###)$/,insertTextAfter:!1},{toBlockType:()=>o.Ti.subHeader,matchRegex:/^(## |##)$/,insertTextAfter:!1},{toBlockType:()=>o.Ti.header,matchRegex:/^(# |#)$/,insertTextAfter:!1},{toBlockType:()=>o.Ti.toggle,matchRegex:/^(> |>)$/,insertTextAfter:!1},{toBlockType:()=>o.Ti.quote,matchRegex:/^(\| |\" |\“ |\”)$/,insertTextAfter:!1},{toBlockType:()=>o.Ti.bulletedList,matchRegex:/^(\* |\- |\+ |\*|\ー|\+|\・)$/,insertTextAfter:!1},{toBlockType:()=>o.Ti.divider,matchRegex:/^—-$/,insertTextAfter:!0}],z=[{annotationDelimiter:"`",blockMatchRegex:/^```$/},{annotationDelimiter:"´",blockMatchRegex:/^´´´$/},{annotationDelimiter:"`",blockMatchRegex:/^```$/}],q=[{regex:/^'$/,length:1,replace:"‘",analyticsType:"sentence_start_single_quote"},{regex:/ '$/,length:2,replace:" ‘",analyticsType:"start_single_quote"},{regex:/'$/,length:1,replace:"’",analyticsType:"middle_single_quote"}],H=[{regex:/^"$/,length:1,replace:"“",analyticsType:"sentence_start_double_quote"},{regex:/ "$/,length:2,replace:" “",analyticsType:"start_double_quote"},{regex:/"$/,length:1,replace:"”",analyticsType:"end_double_quote"},{regex:/--$/,length:2,replace:"—",analyticsType:"em_dash"},{regex:/->$/,length:2,replace:"→",analyticsType:"right_arrow"},{regex:/<->$/,length:3,replace:"↔",analyticsType:"right_left_arrow"},{regex:/←>$/,length:2,replace:"↔",analyticsType:"right_left_arrow"},{regex:/=>$/,length:2,replace:"⇒",analyticsType:"right_arrow_double"},{regex:/<-$/,length:2,replace:"←",analyticsType:"left_arrow"},{regex:/>=$/,length:2,replace:"≥",analyticsType:"greater_than_or_equal_to"},{regex:/<=$/,length:2,replace:"≤",analyticsType:"less_than_or_equal_to"},{regex:/!=$/,length:2,replace:"≠",analyticsType:"not_equal"},{regex:/\.\.\.$/,length:3,replace:"…",analyticsType:"ellipsis"}];function G(e){const{environment:t,editorMode:n,store:l,transaction:p}=e;if("suggest"===n)return;const m=l.getRecordStoreAtRootPath(),v=m instanceof b.G?m.getType():void 0;if("code"!==v||S.default.isEditingCaption()){if("callout"!==v){for(const e of K)B({environment:t,editorMode:n,store:l,toBlockType:e.toBlockType,matchRegex:e.matchRegex,insertTextAfter:e.insertTextAfter,transaction:p});B({environment:t,editorMode:n,store:l,matchRegex:/^(\d+|[\uff10-\uff19]+)(\. |\。|\.|\) )$/,insertTextAfter:!1,transaction:p,toBlockType:t=>{var n;const o=t[1],r=(0,i.DA)(o);return null===(n=$(e,parseInt(r)))||void 0===n?void 0:n.type},postTransformAction:t=>{var n;const o=t[1],r=(0,i.DA)(o),s=null===(n=$(e,parseInt(r)))||void 0===n?void 0:n.number;if(l.table!==a.iU)return;const c=l.getRecordStoreAtRootPath();if(!(c instanceof b.G))return;const d=(0,u.$K)(s)&&s>-1?s:void 0;x.FH({stores:[c],update:{list_start_index:d},transaction:p})}}),B({environment:t,editorMode:n,store:l,matchRegex:/^([a-z]+)(\. |\。|\.|\) )$/,insertTextAfter:!1,transaction:p,toBlockType:t=>{const n=(0,h.UF)(t[1]),o=$(e,n);if(1===n||void 0===(null==o?void 0:o.number))return null==o?void 0:o.type},postTransformAction:()=>{m instanceof b.G&&x.FH({stores:[m],update:{list_format:"roman"},transaction:p})}}),B({environment:t,editorMode:n,store:l,matchRegex:/^([a-z]+)(\. |\。|\.|\) )$/,insertTextAfter:!1,transaction:p,toBlockType:t=>{const n=(0,h.yk)(t[1]),o=$(e,n);if(1===n||void 0===(null==o?void 0:o.number))return null==o?void 0:o.type},postTransformAction:()=>{m instanceof b.G&&x.FH({stores:[m],update:{list_format:"letters"},transaction:p})}});for(const{blockMatchRegex:e}of z)B({environment:t,editorMode:n,store:l,toBlockType:()=>o.Ti.code,matchRegex:e,insertTextAfter:!1,transaction:p})}if(!function(e){var t;const n="editing"===S.default.state.mode&&(null===(t=(0,f.QY)(S.default.state.multiSelection))||void 0===t?void 0:t.selection);if(!n)return!1;const o=e.getValue()||[],r=s.xrQ(o,0,n.endIndex),i=d.qr(r.tokensInsideRange,(e=>s.hDy(e).some((e=>s.fTS(e))))),a=r.tokensInsideRange.slice(-1===i?0:i,r.tokensInsideRange.length),l=s.QaF(a);return Boolean(l.match(/(^| )`[^ ]/))}(l)){const e=w.getSubstitutions();for(const r of e)E({environment:t,editorMode:n,store:l,transaction:p,regex:r.replace,length:r.length,replace:r.with,analyticsType:"custom_substitution"});for(const r of H)E({environment:t,editorMode:n,store:l,transaction:p,regex:r.regex,length:r.length,replace:r.replace,analyticsType:r.analyticsType});const o=t.device.browserVersion.split(".").map((e=>parseInt(e,10)));if(!t.device.isSafari||(0,c.isGreaterThanOrEqualToVersion)(o,[16,4]))for(const r of q)E({environment:t,editorMode:n,store:l,transaction:p,regex:r.regex,length:r.length,replace:r.replace,analyticsType:r.analyticsType});!function(e){E({environment:e.environment,editorMode:e.editorMode,store:e.store,transaction:e.transaction,regex:O,length:2,replace:L,analyticsType:"mention_punctuation"})}({environment:t,editorMode:n,store:l,transaction:p})}for(const{annotationDelimiter:e}of z)F({environment:t,editorMode:n,delimiter:e,annotation:[s.GKr.Code],store:l,transaction:p});for(const{delimiter:e,type:o}of j)F({environment:t,editorMode:n,delimiter:e,annotation:[o],store:l,transaction:p});V({environment:t,editorMode:n,delimiter:"$$",store:l,transaction:p}),V({environment:t,editorMode:n,delimiter:"$$",store:l,transaction:p}),function(e){var t;const{environment:n,store:o,transaction:i}=e,a="editing"===S.default.state.mode&&(null===(t=(0,f.QY)(S.default.state.multiSelection))||void 0===t?void 0:t.selection);if(!a)return;const l=o.getValue(),c=r.p4(s.QaF(l)).slice(0,a.endIndex).join("");if(s.oP(l,a.startIndex,a.endIndex,"c"))return;const d=/([^ ]+) $/.exec(c);if(!d)return;const u=d[1],p=s.rOz(u);if(!p)return;const{value:m,href:h}=p,v=g(c,c.indexOf(m)),y=v+r.p4(m).length,b={startIndex:v,endIndex:y};s.oP(l,v,y,"a")||(T.WO({environment:n,store:o,annotation:["a",h],selection:b,transaction:i}),A.setSelection({store:o,selection:a}),k.Hc(n,{href:h}))}({environment:t,store:l,transaction:p})}}function W(e){const{store:t,editorMode:n,transaction:o,environment:r}=e;o.postEnqueueActions.push((()=>{R.createAndCommit({userAction:"textFilterActions.runAllFiltersAfterTransaction",environment:r,undoCheckpoint:!0,perform:e=>{G({environment:r,editorMode:n,store:t,transaction:e})}})}))}function $(e,t){const{store:n}=e;if(n.table!==a.iU)return;const r=n.getRecordStoreAtRootPath();if(!(r instanceof b.G))return;const i=r.getType();if(i===o.Ti.header||i===o.Ti.subHeader||i===o.Ti.subSubHeader)return;const s=r.getParentBlockStore();if(!s)return;const l=s.getContentStores(),c=l.findIndex((e=>e.id===r.id));if(-1===c)return;const d=l.slice(0,c);let p=-1,m=1;for(let a=0;a<d.length;a++){const e=d[a];if(e.getType()!==o.Ti.numberedList)m=1,p=a;else{var g;const t=null===(g=e.getFormat())||void 0===g?void 0:g.list_start_index;(0,u.$K)(t)?m=t+1:m++}}return m===t?{type:o.Ti.numberedList,number:void 0}:c===p+1?{type:o.Ti.numberedList,number:t}:void 0}},898104:(e,t,n)=>{n.r(t),n.d(t,{arrowDownMultiText:()=>W,arrowLeftMultiText:()=>$,arrowRightMultiText:()=>Y,arrowUpMultiText:()=>G,blurActiveElement:()=>K,clear:()=>z,clearForceExtendAnnotations:()=>B,clearSavedSelectionXPosition:()=>N,editNearestBlock:()=>Q,editNearestBlockOrInsertIfAtBottomOfPage:()=>J,insertIfAtBottomOfColumn:()=>X,maybeHandleExpectedBrowserSelectionUpdate:()=>L,saveSelectionXPosition:()=>V,selectAllText:()=>U,selectAllTextMulti:()=>Z,selectAndEditMultiSelection:()=>ee,setExtendAnnotation:()=>D,setMultiSelection:()=>M,setSelection:()=>A,setSelectionAtEnd:()=>F,setSelectionAtStart:()=>E,setSelectionComposing:()=>P,syncTextSelection:()=>ne,toggleExtendAnnotation:()=>R,updateFromBrowserSelectionAfterTick:()=>j});n(757658);var o=n(701302),r=n(421838),i=n(653965),a=n(804827),s=n(146150),l=n(928314),c=n(268056),d=n(745162),u=n(273959),p=n(389224),m=n(489086),g=n(828685),f=n(95802),h=n(598794),v=n(427534),y=n(385555),b=n(27724),_=n(924666),S=n(536280),k=n(245990),w=n(13084),x=n(524677),I=n(800993),C=n(210228);const T=!1;function M(e){const{multiSelection:t,readOnly:n,forceEmit:o}=e,r=_.default.state,i="empty"!==r.mode&&r.savedSelectionXPosition||void 0,a="editing"===r.mode&&(0,c.e6)(r.multiSelection,t)?r.forceExtendAnnotations:{},s=n?{mode:"readOnly",multiSelection:t,savedSelectionXPosition:i}:{mode:"editing",multiSelection:t,savedSelectionXPosition:i,forceExtendAnnotations:a};if(s.mode!==r.mode||!(0,c._v)(r.multiSelection,t))return _.default.setState(s),void h.Ps();o&&_.default.emit()}function P(e,t){if(!("always"===(0,d.Aw)(e)))return;const{TextSelectionCompositionStore:n}=e;n.setState({isComposing:t})}function A(e){const{store:t,selection:n,readOnly:o}=e;if(n){return void M({multiSelection:(0,c.TD)({store:t,selection:n}),readOnly:o})}const r={store:t,index:0},i={start:r,end:r};o?_.default.setState({mode:"readOnly",multiSelection:i,savedSelectionXPosition:0}):_.default.setState({mode:"editing",multiSelection:i,forceExtendAnnotations:{},savedSelectionXPosition:0})}function R(e){const{annotation:t}=e;if(r.k87[r.J7s(t)])return;const n=r.gOH(t),o=(0,m.bj)("default").findFirstOfGroupingKey(n);D(o?{annotation:o,extend:!1}:{annotation:t,extend:!0})}function D(e){const{annotation:t,extend:n}=e,o=_.default.state,i=r.J7s(t);"editing"===o.mode&&_.default.setState({...o,forceExtendAnnotations:{...o.forceExtendAnnotations,[i]:{annotation:t,extend:n}}})}function B(){const e=_.default.state;"editing"===e.mode&&_.default.setState({...e,forceExtendAnnotations:{}})}function E(e){const{store:t}=e;A({store:t,selection:{startIndex:0,endIndex:0}})}function F(e){const{store:t}=e;A({store:t,selection:(0,m.x0)(t)})}function Z(e){var t;B();const{environment:n,store:o,canSelectAllBlocks:r,contentEditableContextId:i}=e,a=_.default.state;let s;s="empty"===a.mode?{start:{store:o,index:0},end:{store:o,index:0}}:a.multiSelection;const l={start:{store:s.start.store,index:0},end:{store:s.end.store,index:(null===(t=(0,m.x0)(s.end.store))||void 0===t?void 0:t.endIndex)||0}};if(!(0,c._v)(l,s))return void M({multiSelection:l});const d=y.default.checkGate({gateName:"never_select_title_on_select_all"})&&(0,u.Mn)(n.device);if(i&&!d){const e=(0,m.Ov)(),t=e=>{var t;return(null===(t=e.contentEditableContext)||void 0===t?void 0:t.id)===i},n=e.find(t),o=e.reverse().find(t);if(n&&o){const e=n.props.store,t=o.props.store;if(e&&t){var p;return void M({multiSelection:{start:{store:e,index:0},end:{store:t,index:(null===(p=(0,m.x0)(t))||void 0===p?void 0:p.endIndex)||0}}})}}}r&&(0,u.Mn)(n.device)&&x.td(n)}function U(e){var t;B();const{environment:n,store:o,canSelectAllBlocks:r}=e,i=(0,m.x0)(o),a={startIndex:0,endIndex:i?i.endIndex:0};r&&"empty"!==_.default.state.mode&&(0,m.fu)(null===(t=(0,d.xI)("textSelectionActions",_.default.state.multiSelection))||void 0===t?void 0:t.selection,a)?x.td(n):A({store:o,selection:a})}function V(e){const t=_.default.state;"empty"===t.mode||t.savedSelectionXPosition||_.default.setState({...t,savedSelectionXPosition:e.savedSelectionXPosition})}function N(){"empty"!==_.default.state.mode&&_.default.setState({..._.default.state,savedSelectionXPosition:void 0})}let O=[];function L(e){if(0===O.length)return!1;T&&console.log("maybeHandleExpectedBrowserSelectionUpdate",e);const t=O;O=[];for(const n of t)n();return!0}function j(e){const{store:t,contentEditableLeafRegistry:n,avoidEdgesOfContentEditableRoot:r,selection:i}=e;O.push((()=>{const e=p.get(),o=(0,d.fx)({contentEditableLeafRegistry:n,range:e,allowInvisibleEndSelection:(0,l.yA)().shift,avoidEdgesOfContentEditableRoot:r});o?M(o):A({store:t,selection:i})})),o.default.afterNextFlush((()=>L("renderQueueFlush")))}function K(){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}function z(e){let{environment:t,preventDismissMobileKeyboard:n}=e;p.clear(t),"empty"!==_.default.state.mode&&_.default.setState({mode:"empty"}),!n&&t.device.isIOS&&y.default.checkGate({gateName:"ios_clear_selection_auto_dismiss_keyboard"})&&K()}function q(e){const{currentEditableTopBottomPadding:t,targetEdge:n,targetEditable:o,selectionXPosition:r}=e,s=o.getNode();if(!(s&&s instanceof Element))return;const l=s.getBoundingClientRect(),c=Math.min(Math.max(r,l.left),l.right),d=Math.min(t,o.props.topBottomPadding),u="top"===n?l.top:l.bottom;return function(e,t,n){const o=new Map,r={visibility:"hidden"},s=Object.keys(r);let l;try{for(;l=p.rangeFromPoint(e,t);){if(n.contains(l.commonAncestorContainer))return l;const e=(0,a.R)(l.commonAncestorContainer);if(!e)return;if(o.has(e))return;const t=i.ei(e.style,s);o.set(e,t),Object.assign(e.style,r)}}finally{for(const[e,t]of o)Object.assign(e.style,t)}}(c,"top"===n?u+d:u-d,s)}function H(e){const{focusContainerOffset:t,focusStore:n,edge:o,topBottomPadding:r}=e,i=g.E.findNodeFromStore(n);if(!(i&&i instanceof Element))return;const a=p.getRect(p.rangeFromContainerOffsets({start:t,end:t})),s=i.getBoundingClientRect();if(!a||!s)return;const[l,c]="top"===o?[a.top,s.top]:[a.bottom,s.bottom];return{focusIsAtEdge:Math.abs(l-c)<=r,focusSelectionRect:a,renderedNode:i,renderedNodeRect:s}}function G(e){const{environment:t,event:n,topBottomPadding:o,contentEditableLeafRegistry:r}=e,i=p.get();if(!i)return;B();const a=_.default.state;if("empty"===a.mode)return;const{multiSelection:l}=a,{focus:u,anchor:f}=(0,d.uZ)(l),y=H({focusContainerOffset:p.rangeToContainerOffsets(i).focus,focusStore:u.store,topBottomPadding:o,edge:"top"});if(!y)return;const{focusIsAtEdge:b,focusSelectionRect:S}=y,k=v.UQ(),w=k?v.Q8(k):(0,m.mK)(u.store),I=w&&g.E.findEditableWithStore(w);if(b&&I){var C;const e=Math.max(a.savedSelectionXPosition||0,S.left),r=q({targetEditable:I,targetEdge:"bottom",currentEditableTopBottomPadding:o,selectionXPosition:e}),l=(null===(C=(0,d.fx)({range:r,contentEditableLeafRegistry:void 0,allowInvisibleEndSelection:!0}))||void 0===C?void 0:C.multiSelection)||(0,c.TD)({store:I.props.store,selection:(0,m.x0)(I.props.store)});if(n.shiftKey&&!n.altKey&&l&&(0,s.D1)(I.getNode(),i.commonAncestorContainer))return n.preventDefault(),V({savedSelectionXPosition:e}),void ee({environment:t,multiSelection:(0,d.$r)(l.start,f),focus:l.start,forceEmit:!1});if(!n.shiftKey&&!n.altKey&&l)return n.preventDefault(),V({savedSelectionXPosition:e}),void ee({environment:t,forceEmit:!1,multiSelection:l,focus:"start"})}if(n.shiftKey&&!n.altKey&&(0,m.e7)(u,l.start.store)){if(te(t))return void h.rS({environment:t,direction:"up",bypassExistingTextSelection:!1,expandSelection:!0});const e=(0,d.tp)({multiSelection:l,focus:u,filterCommonAncestors:!0});if(e)return n.preventDefault(),void x.Z5({environment:t,...e})}j({store:u.store,contentEditableLeafRegistry:r,avoidEdgesOfContentEditableRoot:!0})}function W(e){const{environment:t,event:n,topBottomPadding:o,contentEditableLeafRegistry:r}=e,i=p.get();if(!i)return;B();const a=_.default.state;if("empty"===a.mode)return;const{multiSelection:l}=a,{focus:f,anchor:y}=(0,d.uZ)(l),b=H({focusContainerOffset:p.rangeToContainerOffsets(i).focus,focusStore:f.store,topBottomPadding:o,edge:"bottom"});if(!b)return;const{focusIsAtEdge:S,focusSelectionRect:k}=b,w=v.UQ(),I=w?v.a5(w):(0,m.hn)(f.store),C=I&&g.E.findEditableWithStore(I);if(S&&C){var T;const e=Math.max(a.savedSelectionXPosition||0,k.left),r=q({targetEditable:C,targetEdge:"top",currentEditableTopBottomPadding:o,selectionXPosition:e}),l=(null===(T=(0,d.fx)({range:r,contentEditableLeafRegistry:void 0,allowInvisibleEndSelection:!0}))||void 0===T?void 0:T.multiSelection)||(0,c.TD)({store:C.props.store,selection:{startIndex:0,endIndex:0}});if(n.shiftKey&&!n.altKey&&l&&(0,s.D1)(C.getNode(),i.commonAncestorContainer))return n.preventDefault(),V({savedSelectionXPosition:e}),void ee({environment:t,multiSelection:(0,d.$r)(l.start,y),focus:l.start,forceEmit:!1});if(!n.shiftKey&&!n.altKey&&l)return n.preventDefault(),V({savedSelectionXPosition:e}),void ee({environment:t,forceEmit:!1,multiSelection:l,focus:"end"})}const M=(0,u.sQ)(l.start.store);if(n.shiftKey&&!n.altKey&&(0,m.iB)(f,l.end.store)&&M){if(te(t))return void h.rS({environment:t,direction:"down",bypassExistingTextSelection:!1,expandSelection:!0});const e=(0,d.tp)({multiSelection:l,focus:f,filterCommonAncestors:!0});if(e)return n.preventDefault(),void x.Z5({environment:t,...e})}j({store:f.store,contentEditableLeafRegistry:r,avoidEdgesOfContentEditableRoot:!0,selection:(0,m.x0)(f.store)})}function $(e){o.default.afterNextFlush((()=>{N()})),B();const{environment:t,event:n,contentEditableLeafRegistry:i}=e,a=p.get(),l=_.default.state;if("empty"===l.mode)return;const{multiSelection:u}=l,{focus:f,anchor:v}=(0,d.uZ)(u),y=f.store&&g.E.findEditableWithStore(f.store),b=(0,m.mK)(f.store),w=b&&g.E.findEditableWithStore(b);if((0,m.e7)(f,f.store)&&w&&y&&w.props.isDiscussionInput===y.props.isDiscussionInput){const e=(0,c.TD)({store:w.props.store,selection:(0,m.x0)(w.props.store)});if(n.shiftKey&&!n.altKey&&e&&(0,s.D1)(w.getNode(),null==a?void 0:a.commonAncestorContainer))return n.preventDefault(),void ee({environment:t,multiSelection:(0,d.$r)(e.start,v),focus:e.start,forceEmit:!1});if(!n.shiftKey&&!n.altKey&&e&&(0,c.iG)(u))return n.preventDefault(),void ee({environment:t,forceEmit:!1,multiSelection:e,focus:"start"})}if(n.shiftKey&&!n.altKey&&(0,m.e7)(f,u.start.store)){if(te(t))return void h.eh({environment:t,direction:"left",bypassExistingTextSelection:!1,expandSelection:!0});const e=(0,d.tp)({multiSelection:u,focus:f,filterCommonAncestors:!0});if(e)return n.preventDefault(),void x.Z5({environment:t,...e})}if(n.altKey||n.shiftKey||n.ctrlKey||n.metaKey||!a||!a.collapsed)j({store:f.store,contentEditableLeafRegistry:i});else{const e=f.index-1,i=r.b1T(u.start.store.getValue(),e);if(i&&r.tk7(i)){n.preventDefault(),M({multiSelection:{start:{...f,index:e},end:f}});const a={startIndex:e,endIndex:f.index};r.YrK(i)&&o.default.afterNextFlush((()=>{S.qn({environment:t,selectedToken:{token:i,position:a},analyticsFrom:"arrow_keys"})}))}const a=r.hpT(f.store.getValue(),e,((e,t)=>{const n=r.Hze(e);return t?Boolean(n&&r.Hze(t)===n):Boolean(n)}));a&&k.dz({type:"selectionFocus",store:f.store,focus:!1,selection:a})}}function Y(e){o.default.afterNextFlush((()=>{N()})),B();const{environment:t,event:n,contentEditableLeafRegistry:i,editorMode:a}=e,l=p.get(),u=_.default.state;if("empty"===u.mode)return;const{multiSelection:f}=u,{focus:v,anchor:y}=(0,d.uZ)(f),b=v.store&&g.E.findEditableWithStore(v.store),w=(0,m.hn)(v.store),T=w&&g.E.findEditableWithStore(w);if((0,m.ST)(u.multiSelection.start.store.getValue(),u.multiSelection.start.index-1,r.GKr.Code)&&(0,m.iB)(v,v.store)&&(0,c.iG)(f))return n.preventDefault(),void C.createAndCommit({userAction:"textSelectionActions.arrowRightInCodeBlockAtEOL",environment:t,perform:e=>{I.hJ({environment:t,editorMode:a,store:v.store,multiSelection:f,string:" ",transaction:e,disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,disableFilters:!0})}});if((0,m.iB)(v,v.store)&&T&&b&&T.props.isDiscussionInput===b.props.isDiscussionInput){const e=(0,c.TD)({store:T.props.store,selection:{startIndex:0,endIndex:0}});if(n.shiftKey&&!n.altKey&&e&&(0,s.D1)(T.getNode(),null==l?void 0:l.commonAncestorContainer))return n.preventDefault(),void ee({environment:t,multiSelection:(0,d.$r)(e.start,y),focus:e.start,forceEmit:!1});if(!n.shiftKey&&!n.altKey&&e&&(0,c.iG)(f))return n.preventDefault(),void ee({environment:t,forceEmit:!1,multiSelection:e,focus:"end"})}if(n.shiftKey&&!n.altKey&&(0,m.iB)(v,f.end.store)){if(te(t))return void h.eh({environment:t,direction:"right",bypassExistingTextSelection:!1,expandSelection:!0});const e=(0,d.tp)({multiSelection:f,focus:v,filterCommonAncestors:!0});if(e)return n.preventDefault(),void x.Z5({environment:t,...e})}if(n.altKey||n.shiftKey||n.ctrlKey||n.metaKey||!l||!l.collapsed)j({store:v.store,contentEditableLeafRegistry:i});else{const e=v.index,i=v.index+1,a=r.b1T(f.start.store.getValue(),e);if(a&&r.tk7(a)){n.preventDefault(),M({multiSelection:{start:v,end:{...v,index:i}}});const s={startIndex:e,endIndex:i};r.YrK(a)&&o.default.afterNextFlush((()=>{S.qn({environment:t,selectedToken:{token:a,position:s},analyticsFrom:"arrow_keys"})}))}const s=r.hpT(v.store.getValue(),e,((e,t)=>{const n=r.Hze(e);return t?Boolean(n&&r.Hze(t)===n):Boolean(n)}));s&&k.dz({type:"selectionFocus",store:v.store,focus:!1,selection:s})}}function Q(e,t){const{x:n,y:o,target:r}=t,i=(0,m.fx)(n,o,r);i&&i.selectable.props.onEditText&&C.createAndCommit({userAction:"textSelectionActions.editNearestBlock",environment:e,perform:e=>{i.selectable.props.onEditText&&i.selectable.props.onEditText({isAtStartOfLine:n<=i.rect.left,isClick:!0,transaction:e})}})}function J(e,t,n){const{x:o,y:r,target:i}=t,a=i?b.default.getDefaultContainerFromTarget(i):void 0;if(a&&(0,m.Q3)(r,a)&&w.HO({environment:e,container:a,transaction:n}))return;const s=(0,m.fx)(o,r,i);if(s&&s.selectable.props.onEditText){const e=r<=s.rect.top;s.selectable.props.onEditText({isAtStartOfLine:o<=s.rect.left,isAtStartOfContainer:e,isClick:!0,transaction:n})}}function X(e,t,n,o){const{y:r,target:i}=t,a=i?b.default.getDefaultContainerFromTarget(i):void 0,s=f.C.findSelectableFromStore(n);a&&s&&(0,m.qh)(r,s)&&w.UG({environment:e,container:a,store:n,transaction:o})}function ee(e){const{environment:t,multiSelection:n,forceEmit:o,readOnly:r,focus:i}=e;M({multiSelection:n,forceEmit:o,readOnly:"infer"===r?(0,d.L5)(n).some((e=>{let{editable:t}=e;return!t.props.store.canComment()&&!t.props.store.canEdit()})):r});const a=(0,d.tp)({multiSelection:n,filterCommonAncestors:!1,focus:i});a&&x.Z5({environment:t,phase:b.SelectionPhase.Editing,...a})}function te(e){const t=v.UQ();if(t){const{rowIndex:n,columnIndex:o,simpleTableStore:r}=t.getProps();return h.n5({environment:e,rowIndex:n,columnIndex:o,simpleTableStore:r}),z({environment:e}),!0}return!1}function ne(){var e;const t=p.get(),n=null===(e=(0,d.fx)({range:t,contentEditableLeafRegistry:void 0,allowInvisibleEndSelection:!0}))||void 0===e?void 0:e.multiSelection;if(n){M({readOnly:(0,d.L5)(n).some((e=>{let{editable:t}=e;return t.props.disabled})),multiSelection:n})}}},522974:(e,t,n)=>{n.d(t,{VZ:()=>f,vn:()=>u,Y7:()=>m,LH:()=>g});var o=n(531701);const r="theme";var i=n(401898),a=n(30021),s=n(304926),l=n(247839);const c=12;function d(e,t){const{device:n,ThemeStore:i}=e,{mode:a,usingSystemTheme:d}=t;if(window.notionTheme)return;const u={mode:a};i.setState(u),e.mobileNative&&e.mobileNative.setTheme(a,d),l.setTheme(function(e,t){const n=(0,o.gh)({theme:e});return{mode:e,usingSystemTheme:t,colors:{white:o.ZP.white,blue:o.ZP.blue},borderRadius:4,textColor:n.regularTextColor,popoverBackgroundColor:n.popoverBackground,popoverBoxShadow:n.mediumBoxShadow,inputBoxShadow:n.inputBoxShadow,inputBackgroundColor:n.inputBackground,dividerColor:n.darkDividerColor,shadowOpacity:n.shadowOpacity}}(a,d)),localStorage.setItem(r,JSON.stringify(u)),function(e,t){if(0===e.nativeScrollbarWidth)return;const n=document.getElementById("scroll-properties");n&&(n.innerHTML=`\n\t\t* {\n\t\t\tscrollbar-width: ${c}px;\n\t\t\tscrollbar-color: ${p.scrollbarThumb[t]}  ${p.scrollbarTrack[t]};\n\t\t}\n\t\t::-webkit-scrollbar {\n\t\t\twidth: ${c}px;\n\t\t\theight: ${c}px;\n\t\t}\n\t\t::-webkit-scrollbar {\n\t\t\tbackground: transparent;\n\t\t}\n\t\t::-webkit-scrollbar-track:hover {\n\t\t\tbackground: ${p.scrollbarTrack[t]};\n\t\t}\n\t\t::-webkit-scrollbar-thumb {\n\t\t\tbackground: ${p.scrollbarThumb[t]};\n\t\t\tcursor: pointer;\n\t\t}\n\t\t::-webkit-scrollbar-thumb:hover {\n\t\t\tbackground: ${p.scrollbarThumbHover[t]};\n\t\t}\n\t\t::-webkit-scrollbar-button {\n\t\t\tdisplay: none;\n\t\t}\n\t`,s.Z.setState(c))}(n,a),"dark"===a?document.body.classList.add("dark"):document.body.classList.remove("dark")}function u(e){return e.device.prefersDarkInterface?"dark":"light"}const p={scrollbarTrack:{light:"rgba(0, 0, 0, 0)",dark:"rgba(0, 0, 0, 0)"},scrollbarThumb:{light:"#D3D1CB",dark:"rgba(255, 255, 255, 0.2)"},scrollbarThumbHover:{light:"#AEACA6",dark:"rgba(255, 255, 255, 0.3)"}};function m(e){a.Z.setState(e)}function g(e){const t=f(e);switch(t){case"dark":case"light":d(e,{mode:t,usingSystemTheme:!1});break;case"system":!async function(e){const{mobileNative:t}=e;let n="light";n=t&&t.api.getTheme?await t.api.getTheme():u(e),d(e,{mode:n,usingSystemTheme:!0})}(e);break;default:(0,i.t1)(t)}}function f(e){const t=a.Z.state||"system";return"dark"===(n=t)||"light"===n||"system"===n?n:"system";var n}},811853:(e,t,n)=>{n.d(t,{Xd:()=>c,m2:()=>l});var o=n(730120),r=n(471924),i=n(653965),a=n(469694);function s(e){const t=e.id??r.Il(),n=e.createdAt??o.ou.now().toMillis(),i={...e,id:t,createdAt:n,presentationType:e.presentationType??"transient"};return a.Z.setState({...a.Z.state,toasts:{...a.Z.state.toasts,[t]:i}}),i}function l(e){const t=e.id;return t&&a.Z.state.toasts[t]?function(e,t){const n=a.Z.state.toasts[e];if(!n)return s(t);const r={...n,...t,updatedAt:o.ou.now().toMillis()};return a.Z.setState({toasts:{...a.Z.state.toasts,[e]:r}}),r}(t,e):s(e)}function c(e,t,n){const o=a.Z.state.toasts[e];if(o){var r,s;if(!t)if(null===(r=o.onDismiss)||void 0===r||r.call(o),n)null===(s=o.onUserDismiss)||void 0===s||s.call(o);a.Z.setState({...a.Z.state,toasts:i.CE({...a.Z.state.toasts},[e])})}}},295982:(e,t,n)=>{n.d(t,{B:()=>a,c:()=>s});var o=n(180951),r=n(250906),i=n(709953);function a(e){const{blocks:t,transaction:n,environment:a}=e;for(const r of t)i.sW({store:r.getPropertiesStore(),data:{checked:o._I(!0)},transaction:n});r.Jr(a,{is_checked:!0})}function s(e){const{environment:t,blocks:n,transaction:a}=e;for(const r of n)i.sW({store:r.getPropertiesStore(),data:{checked:o._I(!1)},transaction:a});r.Jr(t,{is_checked:!1})}},429373:(e,t,n)=>{n.d(t,{LO:()=>k,X_:()=>x,ls:()=>b,nz:()=>S,rd:()=>_});n(757658);var o=n(541432),r=n(915157),i=n(23867),a=n(653965),s=n(985677),l=n(635328),c=n(58202),d=n(445131),u=n(21359),p=n(554569),m=n(594419),g=n(709953),f=n(524677),h=n(898104);const v="ToggleBlock";function y(e){return`${v}-${e}`}function b(e){const{environment:t,store:n,transaction:r}=e,i=g.j4({environment:t,type:o.Ti.text,inMemoryRecordCache:n.inMemoryRecordCache,transaction:r,spaceId:n.pointer.spaceId,useCrdt:n.useCrdt()});m.R3({parentStore:n.getContentStore(),appendStore:i,transaction:r});const a=n.getContentStores()[0];f.eP({environment:t,store:a});const s=a.getBlockTitleStore();h.setSelectionAtStart({store:s})}function _(e){let{blockId:t,state:n,currentUserId:o}=e;d.Z.setOpen(t,n),r.Z.set({userId:o,key:y(t),value:n})}function S(e){let{blockId:t,currentUserId:n}=e;const o=r.Z.get({userId:n,key:y(t)});d.Z.setOpen(t,o)}function k(e,t){u.loadCachedPageChunkBatched(e,{page:{id:t.id,spaceId:(0,i.C)(t.spaceId)},limit:25,chunkNumber:0,cursor:{stack:[]},verticalColumns:!1},(0,s.Bb)({recordId:t.id,spaceId:t.spaceId}))}function w(e,t){const n=(null==t?void 0:t.toggleBlockIds)||[],r=(null==t?void 0:t.collectionBlockIds)||[],i=e.getType();if((0,l.BX)(e)&&n.push(e.id),"collection_view"!==i&&"collection_view_page"!==i||r.push(e.id),i===o.Ti.transclusionReference){const t=e.getTransclusionReferenceTargetStore();t&&w(t,{toggleBlockIds:n,collectionBlockIds:r})}else{const t=e.getContentStores();for(const e of t)e.isNavigableBlock()||w(e,{toggleBlockIds:n,collectionBlockIds:r}),"collection_view"===e.getType()&&r.push(e.id)}return{toggleBlockIds:n,collectionIds:r}}function x(e,t){const{toggleBlockIds:n,collectionIds:o}=w(t),r=t.environment.currentUser.id;n.forEach((e=>S({blockId:e,currentUserId:r})));const i=a.oA(o.map((e=>function(e){const t=c.R.findCollectionViewBlockFromId(e);if(t)return t.collectionContextStore}(e)))),s=i.flatMap((e=>e.groupsStore.getAllGroupStates())),l=n.every((e=>d.Z.isOpen(e))),u=s.every((e=>e.toggleStateStore.state)),m=!(l&&u);n.forEach((e=>_({blockId:e,state:m,currentUserId:r}))),function(e,t,n){for(const o of t)for(const t of o.groupsStore.getAllGroupStates())p.uo({environment:e,collectionContextStore:o,groupFormat:t.groupsPointer[0],toggleStateStore:t.toggleStateStore,newValue:n})}(e,i,m)}},632741:(e,t,n)=>{n.d(t,{lY:()=>h,qA:()=>v,HM:()=>f});var o=n(421838),r=n(744805),i=n(401898),a=n(992120);var s=n(947002),l=n(304708),c=n(442092),d=n(80444),u=n(62740),p=n(385555),m=n(896049),g=n(13086);function f(e){var t;if(m.Z.state)return;const n=(0,l.En)(),{token:f,store:v}=e,y=o.hDy(f.textToken),b=null===(t=d.default.state.mainEditorCurrentBlockStore)||void 0===t?void 0:t.getSpaceId(),_=b?o.zrg(y).filter((e=>!(0,r.vz)({annotation:e,spaceId:b,getRecordModel:v.getRecordModel}))):[],S=b?o.$d7(y).filter((e=>!(0,r.vz)({annotation:e,spaceId:b,getRecordModel:v.getRecordModel}))):[],k=o.eQP(y),w="on"===p.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0}),x=[o.rlz(y),o.K9C(y),o.QGY(y),o.frE(y),o.xat(y),o.J82(y),o.V8Y(y)||void 0,o.LLi(y),w?o.ujB(y):void 0,n&&o.hH9(y)||void 0,..._,...S,o.jC0(y),k].filter(i.$K);x.length>0?(g.Z.setState({type:"token",token:f,store:v,annotations:x}),(_.length>0||S.length>0)&&function(e){let{source:t,discussionAnnotations:n}=e;a.Z.setState({source:t,discussionIds:n.map(o.XIY)})}({discussionAnnotations:[..._,...S],source:"editor"}),k&&!c.Z.containedByAssistantEditCard(f.node)&&u.Z.setState({...u.Z.state,hoveredEditId:k[1]}),w&&o.ujB(y)&&s.Z.setHoverWithSource("text_annotation")):h()}function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{relatedNode:t}=e;var n,o;g.Z.state&&g.Z.setState(void 0),n="editor",(null===(o=a.Z.state)||void 0===o?void 0:o.source)===n&&a.Z.setState(void 0);"on"===p.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0})&&s.Z.resetHoverSource("text_annotation"),!u.Z.state.hoveredEditId||t&&c.Z.containedByAssistantEditCard(t)||u.Z.setState({...u.Z.state,hoveredEditId:void 0})}function v(e){e&&g.Z.state&&g.Z.state.store===e&&h()}},210228:(e,t,n)=>{n.r(t),n.d(t,{DEADLOCK_WARNING_TIMEOUT_MS:()=>he,MetadataUpdateManager:()=>ye,applyCrdtTextOperation:()=>ke,applyCrdtTextOperations:()=>we,applyOperation:()=>Se,createAndCommit:()=>De,createAndCommitAsync:()=>Be,createAndCommitOrAppend:()=>Re,updateConnectionState:()=>ve});n(757658),n(21703);var o=n(118466),r=n(45060),i=n(563144),a=n(568626),s=n(238297),l=n(305773),c=n(643593);var d=n(45681),u=n(159730),p=n(959753),m=n(300482),g=n(433422),f=n(600606),h=n(789320),v=n(798963),y=n(421202),b=n(606287),_=n(213493),S=n(870279),k=n(611318),w=n(475246),x=n(519889),I=n(167175),C=n(712139);var T=n(182798),M=n(709291),P=n(653965),A=n(552629),R=n(401898),D=n(619584),B=n(95477),E=n(266749),F=n(547307),Z=n(516861),U=n(385555);var V=n(121830),N=n(433929),O=n(798165),L=n(503932),j=n(199341),K=n(788632),z=n(437598),q=n(453730),H=n(206258),G=n(27724),W=n(924666),$=n(897630),Y=n(250680),Q=n(926109),J=n(377282);function X(e){const{transaction:t,inMemoryRecordCache:n,store:o,operation:r}=e,i=r.command;switch(i){case"insertText":case"deleteText":case"addAnnotation":case"removeAnnotation":case"splitText":const e=(0,Y.TO)(o.getTextSliceTree());return a=o,s=new ne(t,r),J.Z.getPageStoreForBlockStore(a)||oe("source",a,s),function(e){const{inMemoryRecordCache:t,store:n,operation:o,textSliceTreeToMutate:r}=e,i=r.getTextValue(),a=o.command;switch(a){case"insertText":r.applyInsertTextOperation({type:a,...o.args});break;case"deleteText":r.applyDeleteOperation({type:a,...o.args});break;case"addAnnotation":case"removeAnnotation":r.applyAnnotationOperation({type:a,...o.args});break;case"splitText":r.applySplitOperation({type:a,...o.args});break;default:(0,R.t1)(a)}const s=P.Xh((0,Y.TO)(n.getValue()));return Q.o_({blockValue:s,textSliceTree:r,originalTextValue:i}),[{pointer:n.pointer,newValue:s,role:te(t,n),updatePaths:[["format","text_slice_tree"],["format","text_clocks"],["discussions"]]}]}({inMemoryRecordCache:n,textSliceTreeToMutate:e,store:o,operation:r});case"moveTextSlice":return ee({transaction:t,inMemoryRecordCache:n,sourceStore:o,operation:r});case"moveTextSliceIntoBlock":return function(e){const{transaction:t,inMemoryRecordCache:n,sourceStore:o,operation:r}=e;return(0,Y.T)(r.args.targetBlockId!==r.pointer.id,"Target block should be different from source block."),ee({transaction:t,inMemoryRecordCache:n,sourceStore:o,operation:{...r,command:"moveTextSlice",args:{...r.args,targetTextInstanceId:r.args.targetBlockId,targetTextSliceEndItemId:"end"}},debugInfo:new ne(t,r)})}({transaction:t,inMemoryRecordCache:n,sourceStore:o,operation:r});case"replaceTextInBlock":throw new Error("replaceTextInBlock operation should not be applied on the client");default:(0,R.t1)(i)}var a,s}function ee(e){const{transaction:t,inMemoryRecordCache:n,sourceStore:o,operation:r,debugInfo:i}=e,a=(0,Y.TO)(o.getValue()),s=te(n,o),l=(0,Y.TO)(o.getTextSliceTree()),c=r.args.targetBlockId===o.id?o:new H.G(o.environment,{table:y.iU,id:r.args.targetBlockId});return function(e,t,n){const o=J.Z.getPageStoreForBlockStore(e);if(!o)return void oe("source",e,n);const r=(0,Y.TO)(J.Z.getPageBlockTrackerForPage(o.pointer)).getPathToBlock(t.pointer.id);r||oe("target",t,n)}(o,c,i??new ne(t,r)),function(e){const{transaction:t,inMemoryRecordCache:n,sourceRole:o,sourceValue:r,sourceRootTextSliceTree:i,targetStore:a,operation:s}=e,l=(0,Y.TO)(i.findTextSliceTreeContainingItemWithId(s.args.textInstanceId,s.args.textSliceStartItemId));(0,Y.T)(l!==i,"Can not move root node of text slice tree.");const c=i.getTextValue();!function(e,t){const n=t.getRecordStoreAtRootPath().getValue(),o=t.getRecordStoreAtRootPath().getRole(),r=e.initialRecordMap.getRole(t.pointer);r||(o?e.initialRecordMap.setValueAndRole(t.pointer,n,o):e.initialRecordMap.delete(t.pointer))}(t,a);const d=s.args.targetBlockId===r.id,u=d?i:(0,Y.TO)(a.getTextSliceTree()),p=(0,Y.TO)(u.findTextSliceTreeContainingItemWithId(s.args.targetTextInstanceId,s.args.targetTextSliceEndItemId,{type:"end"})),m=d?c:u.getTextValue();l.detachFromParent(),p.appendChild(l);const g=P.Xh(r);Q.o_({blockValue:g,textSliceTree:i,originalTextValue:c});const f=[{pointer:{table:y.iU,id:r.id,spaceId:r.space_id},newValue:g,role:o,updatePaths:[["format","text_slice_tree"],["format","text_clocks"],["discussions"]]}];if(!d){const e=P.Xh((0,Y.TO)(a.getValue()));Q.o_({blockValue:e,textSliceTree:u,originalTextValue:m}),f.push({pointer:a.pointer,newValue:e,role:te(n,a),updatePaths:[["format","text_slice_tree"],["format","text_clocks"],["discussions"]]})}return f}({transaction:t,inMemoryRecordCache:n,sourceValue:a,sourceRole:s,sourceRootTextSliceTree:l,targetStore:c,operation:r})}function te(e,t){return e.getRole({pointer:t.pointer,userId:t.userId})??"editor"}class ne{constructor(e,t){this.transaction=e,this.operation=t}get(){return{transactionName:this.transaction.getUserActionForAnalyticsPurposesOnly(),operationName:this.operation.command}}}function oe(e,t,n){const{transactionName:o,operationName:i}=n.get();(0,r.XY)(`The ${e} block store for CRDT text operation "${i}" in transaction "${o}" is not on the page. Undoing the transaction may not work!`,[["block id =",t.id]])}var re=n(103022),ie=n(696454),ae=n(736576),se=n(74446),le=n(145953),ce=n(33361);var de=n(504408),ue=n(452423);let pe;const me=new Set;let ge=0;const fe=(0,M.defineMessages)({invalidBlockOperation:{defaultMessage:"Hey there! Blocks cannot be moved inside of themselves.",id:"saveChanges.errorDialog.blocksCannotBeMovedInsideSelf.message"},saveEditsError:{id:"saveEditsError.message",defaultMessage:"There was an issue persisting your edits. Please message us for help."}}),he=25*D.C0;function ve(e){K.Z.state.online&&e.currentUser.id&&q.transactionQueue.unpause()}class ye{constructor(e){this.transaction=void 0,this.timeMs=void 0,this.userId=void 0,this.skipUpdatingEditedMetadata=void 0,this.seenStoreIds=void 0,this.operations=void 0,this.transaction=e.transaction,this.timeMs=e.timeMs,this.userId=e.userId,this.skipUpdatingEditedMetadata=e.skipUpdatingEditedMetadata,this.seenStoreIds=new Set,this.operations=new Map}addStoreWithLargeSubtree(e){this.addStoreInternal(e,{shouldDebounceEditedTime:!0})}addStore(e){this.addStoreInternal(e,{shouldDebounceEditedTime:!1})}getAllOperations(){return Array.from(this.operations.entries())}addStoreInternal(e,t){if(e.inMemoryRecordCache.recordHasOverride({pointer:e.pointer,userId:this.transaction.userId}))return;if(this.seenStoreIds.has(e.id))return;this.seenStoreIds.add(e.id);const n={};P.TS(n,this.collectCreationMetadata(e),this.skipUpdatingEditedMetadata?{}:this.collectEditionMetadata(e,t.shouldDebounceEditedTime)),Object.keys(n).length>0&&this.operations.set(e,{pointer:e.pointer,path:[],command:"update",args:n})}collectCreationMetadata(e){const t={};(e.isDefined()?e.getCreatedById():void 0)||(t.created_by_id=this.userId,t.created_by_table=x.KJ);return(e.isDefined()?e.getCreatedTime():void 0)||(t.created_time=this.timeMs),t}collectEditionMetadata(e,t){const n={},o=e.isDefined()?e.getLastEditedTime():-1;if((t?this.hasDebounceEnded(o,this.timeMs):o!==this.timeMs)&&(n.last_edited_time=this.timeMs),e instanceof H.G||e instanceof H.H2||e instanceof H.Mz||e instanceof H.xj||e instanceof H.y){const t=n;(e.isDefined()?e.getLastEditedById():void 0)!==this.userId&&(t.last_edited_by_id=this.userId,t.last_edited_by_table=x.KJ)}return n}hasDebounceEnded(e,t){return D.ud(e)!==D.ud(t)}}function be(e){P.mN(e.stores,(e=>e.id)).forEach((t=>{if(!t.inMemoryRecordCache.recordHasOverride({pointer:t.pointer,userId:e.userId}))if(t.table===y.iU){const n=H.G.fromRecordStore(t);if(n.isDefined()){const t=n.getModel(),o=(0,l.xN)(t,B.default.secureFileS3.url,B.default.secureFileS3V2.url,B.default.secureFileConfig.rootPath,B.default.secureFileConfig.hostname,t.pointer),r=o.files,i=o.operations,a=n.getFileIds();for(const s of r)a.indexOf(s.id)<0&&Se({transaction:e,store:n,operation:{pointer:n.pointer,path:["file_ids"],command:"listAfter",args:{id:s.id}}});for(const s of i)(0,I.Qf)(s)?ke({transaction:e,store:n,operation:s,invertedOperation:void 0}):(0,m.V_)(s)||(0,m.SH)(s)?Se({transaction:e,store:n,operation:s}):(0,R.t1)(s)}}else if(t.table===b.vF){const n=H.NW.fromRecordStore(t),o=n.getFileIds(),r=n.getIconStore().getValue(),i=n.getCoverStore().getValue();if(n.isDefined()){const t=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(n&&!e.file_ids)return[];const i=[],{cover:a,icon:s}=e;if(a){const e=(0,c.mV)(a,t,o,r);e&&i.push(e)}if(s){const e=(0,c.mV)(s,t,o,r);e&&i.push(e)}return i}({cover:i,icon:r,file_ids:o},[B.default.secureFileS3.url,B.default.secureFileS3V2.url],!1,B.default.secureFileConfig.rootPath,B.default.secureFileConfig.hostname),a=o;for(const o of t)a.indexOf(o.id)<0&&Se({transaction:e,store:n,operation:{pointer:n.pointer,path:["file_ids"],command:"listAfter",args:{id:o.id}}})}}}))}function _e(e){var t,n;const{environment:o,userId:i,userAction:s}=e,l=ie.Bs(),c=new Error("Potential transaction deadlock"),d=new L.Y({spaceId:l,userId:i||o.currentUser.id,deadlockTimeoutMs:he,onDeadlockWarning:()=>{me.delete(d);const e=d.getUserActionForAnalyticsPurposesOnly();(0,r.XY)(`A ${e} transaction hasn't been committed in ${he} ms.`,[["stack =",c.stack]]),C.IE(c,{extra:{operations_count:d.operations.length},tags:{userAction:e}}),re.y9(o,{operations_count:d.operations.length,user_action:e});const t=d.operations.map((e=>({command:e.command,stringifiedArgs:(0,A.LK)({path:e.path,pointer:e.pointer})})));a.log({level:"warning",from:"transactionActions",type:"transactionDeadlockWarning",data:{userAction:e,operations:t}})},debugLogging:{logToConsole:Z.Z.isDebuggingEnabled(),collect:!1}});return null!==(t=d.debugLogging)&&void 0!==t&&t.collect&&d.postEnqueueActions.push((()=>{const e=d.getDebugLog();0===e.length||d.isLocal||a.log({level:"info",from:"transactionActions",type:"transactionDebugLog",data:{transactionId:d.id,userAction:d.getUserActionForAnalyticsPurposesOnly(),userFlow:d.getUserFlowForAnalyticsPurposesOnly(),miscDataToConvertToString:e}})})),d.beforeSelection=G.default.cloneState(),d.beforeTextSelection=W.default.cloneState(),d.annotateWithUserAction(s),me.add(d),null===(n=Z.Z.provider)||void 0===n||n.onTransactionEvent("create",d),d}function Se(e){const{store:t,operation:n,transaction:o}=e,{inMemoryRecordCache:r}=t;if((0,m.SH)(n)){const i=(0,d.rb)(n,r.makeGetRecordValueFn(o.userId)),a=(0,d.T1)(n,r.makeGetRecordValueFn(o.userId));for(const o of a)n.additionalUpdatedPointers||(n.additionalUpdatedPointers=[]),n.additionalUpdatedPointers.push(o.pointer),Ie({...e,operation:o,isInvertible:!1,store:(0,H.Kv)(t,o.pointer)});return o.operations.push(n),void o.invertedOperations.push(...i)}(0,m.V_)(n)?Ie({store:t,operation:n,transaction:o,isInvertible:!0}):(0,R.t1)(n)}function ke(e){const{store:t,operation:n,invertedOperation:o,transaction:r}=e;we({store:t,operations:[n],invertedOperations:o?[o]:[],transaction:r})}function we(e){var t;const{store:n,operations:o,transaction:r}=e;r.invertedOperations.push(...e.invertedOperations),null===(t=Z.Z.provider)||void 0===t||t.rememberStackTrace(e.invertedOperations);for(const i of o)Ie({store:n,operation:i,transaction:r,isInvertible:!0})}const xe="editor";function Ie(e){var t;const{store:n,operation:o,transaction:r}=e,{inMemoryRecordCache:i,environment:a,pointer:l,userId:c}=n;if(i.assertUnexpired(),null===(t=Z.Z.provider)||void 0===t||t.onApplyOperation(e),r.committed)throw new Error("Transaction has already been committed.");const d=n.getRecordStoreAtRootPath().getValue(),u=n.getRecordStoreAtRootPath().getRole(),m=(0,I.Qf)(o)?[]:e.isInvertible?[g.bv(o,d)].filter(R.$K):[];let f;if(r.initialRecordMap.getRole(l)||(u?r.initialRecordMap.setValueAndRole(l,d,u):r.initialRecordMap.delete(l)),(0,I.Qf)(o))f=X({transaction:r,inMemoryRecordCache:i,store:(0,T.R9)(n,H.G),operation:o});else{!function(e,t){if(!E.k8||e.pointer.table!==y.iU)return;const n=t.getUserActionForAnalyticsPurposesOnly();if(null==n||!n.startsWith("revisionActions"))switch(e.command){case"set":if(0===e.path.length)o({operation:e,message:"a new block was not created in a CRDT-aware way!",advice:"Please use a CRDT-aware function instead, such as recordActions.createBlock().",successMessage:"Block created in a CRDT-aware way (this is good)."});else if(P.Xy(e.path,["properties","title"]))o({operation:e,message:"a title update was not performed in a CRDT-aware way!",advice:"Please use a CRDT-aware function instead, such as textActions.setValue().",successMessage:"Title update performed in a CRDT-aware way (this is good)."});else if(P.Xy(e.path,["properties"])||P.Xy(e.path,["format"])){const[t]=e.path;o({operation:e,message:`a ${t} update was not performed in a CRDT-aware way!`,advice:"Please use a CRDT-aware function instead, such as recordActions.updateValue()."})}break;case"update":0===e.path.length&&P.Kn(e.args)&&"properties"in e.args||P.Xy(e.path,["properties"])&&P.Kn(e.args)&&"title"in e.args?o({operation:e,message:"a properties update was not performed in a CRDT-aware way!",advice:"Please use textActions.setValue() to set the title separately from the rest of the properties."}):(0===e.path.length&&P.Kn(e.args)&&"format"in e.args||P.Xy(e.path,["format"])&&P.Kn(e.args)&&("use_crdt"in e.args||"text_slice_tree"in e.args||"text_clocks"in e.args))&&o({operation:e,message:"a format update was not performed in a CRDT-aware way!",advice:"Please use a CRDT-aware function instead, such as recordActions.updateValue()."})}function o(e){const{operation:t,message:o,advice:r,successMessage:i}=e;if((0,E.IG)(t.args))Z.Z.isDebuggingEnabled()&&"string"==typeof i&&console.log(i);else{U.default.checkGate({gateName:"show_crdt_warnings"});const e={command:t.command,pointer:t.pointer,path:t.path};C.IE(new Error(o),{tags:{userAction:n,warningType:"possiblyCrdtUnawareOperation"},extra:{operation:e}})}}}(o,r);const e=g.lK(o,d),t=i.getRole({pointer:l,userId:c});!d&&(0,R.DE)(L.F,l.table)&&r.newlyCreatedStoresForPermissionInference.set(l,{store:n,inferredPermissionFromParent:void 0});const a="update"===o.command?Object.keys(o.args).map((e=>o.path.concat([e]))):[o.path];f=[{pointer:l,newValue:e,role:t??xe,updatePaths:a}]}for(const g of f){const{pointer:e,newValue:t,role:o,updatePaths:l}=g;if(de.Wl({environment:a,inMemoryRecordCache:i,pointer:e,userId:c,force:!0,model:p.kk5.fromValue(n.pointer.table,t),role:o,updatePaths:l,debugSource:r.getUserActionForAnalyticsPurposesOnly()??"applyOperation"}),"block"===n.table){const e=t;if(e){const t=(0,s.ky)({block:e,getRecordValue:i.makeGetRecordValueFn(r.userId)});t&&z.Z.setEditedBlock(t.id,e.id)}0}}r.isLocal=!n.shouldCacheSaveTransactions(),r.isLocal&&i.onOperationCallback&&i.onOperationCallback({operation:o,store:n}),e.isInvertible&&(r.operations.push(o),r.invertedOperations.push(...m)),r.stores.push(n),i.appliedTransaction=!0}const Ce=[{type:"userAction",allowedUserAction:"revisionActions.undoRevision"},{type:"userAction",allowedUserAction:"revisionActions.redoRevision"}];function Te(e){var t;null===(t=Z.Z.provider)||void 0===t||t.onTransactionEvent("cancel",e),e.cancelDeadlockWarning(),me.delete(e);const n=P.mN(e.stores,(e=>e.id));for(const o of n){de.uo({inMemoryRecordCache:o.inMemoryRecordCache,persistedRecordCache:o.environment.defaultRecordCache.persistedRecordCache,pointer:o.pointer,userId:o.userId,environment:o.environment});const t=e.initialRecordMap.getValue(o.pointer),n=e.initialRecordMap.getRole(o.pointer);n&&de.Wl({environment:o.environment,inMemoryRecordCache:o.inMemoryRecordCache,pointer:o.pointer,userId:o.userId,updatePaths:[[]],model:p.kk5.fromValue(o.pointer.table,t),role:n,debugSource:"cancelTransaction"})}for(const o of e.postCancelCallbacks)o()}const Me=P.P2(((e,t)=>{re.Y_(e,{errorType:t.type||t.name}),t.type===V.vZ?F.showThrottledErrorMessage(t.message):F.showThrottledErrorMessage(N.default.formatMessage(fe.saveEditsError))}),3e4);function Pe(e){return new Promise(((t,n)=>{var o,r;me.delete(e.transaction);const s=Array.from(me).filter((e=>e.operations.length>0));var l,c;if(s.length>0&&re.iB(e.environment,{committed_transaction_user_action:e.transaction.getUserActionForAnalyticsPurposesOnly(),first_uncommitted_transaction_user_action:s[0].getUserActionForAnalyticsPurposesOnly(),uncommitted_transaction_count:s.length}),0===e.transaction.operations.length)return null===(l=q.transactionQueue.logEmptyTaskForDebugging)||void 0===l||l.call(q.transactionQueue,e.transaction.getUserActionForAnalyticsPurposesOnly()),e.transaction.committed=!0,e.transaction.done(),null===(c=Z.Z.provider)||void 0===c||c.onTransactionEvent("commitEmpty",e.transaction),t();void 0===e.canUndo&&(e.canUndo=!0);const{transaction:d,canUndo:u}=e,m=function(e){for(const t of e.stores)if("block"===t.table){const e=O.Om(t);if(e&&O.qA(e).find((e=>e.table===t.table&&e.id===t.id)))return N.default.formatMessage(fe.invalidBlockOperation)}}(d);if(m)return Te(d),F.showErrorMessage(m),void t();null===(o=pe)||void 0===o||o(e.environment,d),d.cancelDeadlockWarning();for(const e of d.preEnqueueActions)e();if(function(e){const{environment:t,transaction:n,skipUpdatingEditedMetadata:o}=e,r=t.currentUser.adminUserId?x.el.id:t.currentUser.id,a=new ye({transaction:n,userId:r,skipUpdatingEditedMetadata:o,timeMs:Date.now()}),s=P.mN(n.stores,(e=>e.id));for(const l of s)if(l.table===y.iU){const e=H.G.createChildStore(l,l.pointer);if(e.canEdit()&&a.addStore(e),!e.isNavigableBlock()){const t=O.Dg(e);t&&t.canEdit()&&a.addStoreWithLargeSubtree(t)}}else if(l.table===S.x_){if(l.path.length)continue;const e=l.pointer,t=n.initialRecordMap.getValue(e),o=l.getValue();(void 0===t||i.P(p.kk5.fromValue(S.x_,t),p.kk5.fromValue(S.x_,o)))&&a.addStore(H.T5.createChildStore(l,l.pointer))}else if(l.table===w.bx)a.addStoreWithLargeSubtree(H.H2.createChildStore(l,l.pointer));else if(l.table===b.vF){const e=H.NW.createChildStore(l,l.pointer).getParentBlockStore();e&&e.canEdit()&&a.addStore(e)}else if(l.table===_.np){const e=H.Xr.createChildStore(l,l.pointer).getParentBlockStore();e&&e.canEdit()&&a.addStoreWithLargeSubtree(e)}else if(l.table===v.cv){if(l.canEdit()){const e=H.Mz.createChildStore(l,l.pointer);a.addStore(e);const t=e.getParentBlockStore();t&&t.canEdit()&&a.addStore(t)}}else if(l.table===k.Bh){if(l.canEdit()){const e=H.xj.createChildStore(l,l.pointer);a.addStore(e)}}else if(l.table===h.SS&&l.canEdit()){const e=H.y.createChildStore(l,l.pointer);a.addStore(e)}a.getAllOperations().forEach((e=>{let[t,o]=e;return Se({transaction:n,store:t,operation:o})}))}({environment:e.environment,transaction:d,skipUpdatingEditedMetadata:e.skipUpdatingEditedMetadata}),be(d),function(e,t){const n=t.operations.filter((e=>e.pointer.table===_.np));n.length>0&&f.dr.uniq(n.map((e=>e.pointer))).map((e=>t.initialRecordMap.getRole(e))).includes(void 0)&&t.postSubmitCallbacks.push((()=>{$.bi(e)}))}(e.environment,d),d.afterSelection=G.default.cloneState(),d.afterTextSelection=W.default.cloneState(),u&&ue.K9({transaction:d,undoCheckpoint:e.undoCheckpoint}),null===(r=Z.Z.provider)||void 0===r||r.onTransactionEvent("commit",d),d.isLocal){for(const e of d.postEnqueueActions)e();d.done(),t()}else{const o=e=>{d.done(e),e?n(e):t()},{LocalBacklinkStore:r,currentUser:i}=e.environment;r&&async function(e,t){const{LocalBacklinkStore:n,currentUser:o}=e;if(0===t.stores.length)return;const r=t.stores[0].inMemoryRecordCache,i=[],a=le.Ak.create(),s=new Set;for(const p of t.stores)s.has(p.id)||(s.add(p.id),i.push(p.pointer),a.setValue(p.pointer,p.getRecordStoreAtRootPath().getValue()));const l=ce.DI(t.initialRecordMap),{createdBacklinks:c,deletedBacklinks:d}=await(0,ae.xU)({loadRecordValue:se.zF.fromGetRecordValueFn(r.makeGetRecordValueFn(o.id)),operationPointers:i,getInitialRecordModel:p.omK.fromRecordMap(l),getFinalRecordModel:p.omK.fromRecordMap(a)}),u=n.updateBacklinks({createdBacklinks:c,deletedBacklinks:d,currentUserId:o.id});t.postSubmitCallbacks.push((e=>{e&&n.resetBacklinkState({blockIds:u,currentUserId:o.id})}))}({LocalBacklinkStore:r,currentUser:i},d);const s=Date.now();s<ge&&re.vt(e.environment,{regression_amount:ge-s}),ge=s,q.transactionQueue.enqueueTask((0,j.JG)({transaction:d,timestamp:s,callback:o})).catch((t=>{a.log({level:"error",from:"transactionActions",type:"enqueueTask",error:(0,A.Ui)(t)}),e.environment.device.isMobileNative&&"SqliteOutOfSpace"===t.name||Me(e.environment,t),Te(d),o(t)}));for(const e of d.postEnqueueActions)e()}const g=d.userId;for(const[e,i]of d.newlyCreatedStoresForPermissionInference.entries()){const{store:t}=i,n=t.inMemoryRecordCache.getRole({pointer:e,userId:d.userId}),o=Ae({transaction:d,store:t});o!==n&&t.inMemoryRecordCache.setModelAndRole({pointer:e,userId:g},t.getModel(),o)}d.committed=!0}))}function Ae(e){const{transaction:t,store:n}=e,{pointer:o}=n,r=n.inMemoryRecordCache.getRole({pointer:o,userId:t.userId});if(r&&r!==xe)return r;const i=t.newlyCreatedStoresForPermissionInference.get(o);if(!i)return xe;if(i.inferredPermissionFromParent)return i.inferredPermissionFromParent;const a=n.getParentStore();if(!a||a.table!==y.iU||!a.isReady())return xe;const s=Ae({store:a,transaction:t});return i.inferredPermissionFromParent=s,s}function Re(e){const{transaction:t,...n}=e;return t?n.perform(t):De(n).performResult}function De(e){const{userAction:t,environment:n,userId:r,perform:i,canUndo:s,undoCheckpoint:l,transactionTooBigFallback:c,skipUpdatingEditedMetadata:d,skipDefaultPostPerformValidationChecks:p,useSudoMode:m}=e;return o.Z.withListenerIgnored((()=>{const o=_e({environment:n,userId:r,userAction:t});let g;m&&(o.useSudoMode=!0);try{g=i(o),p||function(e){if(e.isLocal)return;for(const t of e.stores){const n=t.inMemoryRecordCache.checkRecordForTemporaryData(t);if(n)throw new u.p8(`Transaction "${e.getUserActionForAnalyticsPurposesOnly()}" is manipulating a store with temporary local changes from an in-memory record cache named "${n.name}"!`)}}(o);for(const e of o.postPerformAssertions)e()}catch(f){Te(o);const e=o.getUserActionForAnalyticsPurposesOnly(),t=o.getUserFlowForAnalyticsPurposesOnly(),n=o.getDebugTagsForAnalyticsPurposesOnly(),r=n&&function(e){const t={};return e.forEach((e=>t[e]=!0)),t}(n);throw C.IE(f,{tags:{userAction:e,userFlow:t,...r}}),a.log({level:"error",from:"transactionActions",type:"createAndCommit",error:(0,A.Ui)(f),data:{userAction:e,userFlow:t,debugTags:n,spaceId:o.spaceId,miscDataToConvertToString:{transactionDebugLog:o.getDebugLog()}}}),f}finally{0}if(c&&(0,j.jQ)(o))return Te(o),De({...e,perform:c,transactionTooBigFallback:void 0,userAction:`${t} transactionTooBigFallback`});return{performResult:g,serverCommitResult:Pe({environment:n,transaction:o,canUndo:s,undoCheckpoint:l,skipUpdatingEditedMetadata:d})}}))}async function Be(e){const{environment:t,perform:n,waitForServerCommit:o,userAction:r,userId:i,canUndo:s,undoCheckpoint:l,skipUpdatingEditedMetadata:c,useSudoMode:d}=e,u=_e({environment:t,userId:i,userAction:r});let p;d&&(u.useSudoMode=!0);try{p=await n(u);for(const e of u.postPerformAssertions)e()}catch(g){u.cancelDeadlockWarning();const t=u.getUserActionForAnalyticsPurposesOnly();me.delete(u);const n=u.operations.length>0;throw n&&re.kY(e.environment,{user_action:t,operation_count:u.operations.length}),C.IE(g,{tags:{userAction:t,transactionOperationCount:u.operations.length}}),a.log({level:"error",from:"transactionActions",type:"createAndCommitAsync",error:(0,A.Ui)(g),data:{message:n?`POSSIBLE DATA LOSS: asynchronous transaction had ${u.operations.length} operations`:void 0,userAction:t}}),g}const m=Pe({environment:t,transaction:u,canUndo:s,undoCheckpoint:l,skipUpdatingEditedMetadata:c});return o&&await m,{performResult:p,serverCommitResult:m}}},668422:(e,t,n)=>{n.d(t,{_w:()=>Z,vs:()=>D,Cj:()=>B});var o=n(701302),r=n(541432),i=n(772141),a=n(421202),s=n(421838),l=n(653965),c=n(741195),d=n(165598),u=n(635328),p=n(385555),m=n(206258),g=n(226664),f=n(897630),h=n(442274),v=n(141433),y=n(594419),b=n(119785),_=n(476464),S=n(709953),k=n(311712),w=n(524677),x=n(898104),I=n(429373),C=n(273959),T=n(155367),M=n(496802),P=n(13084);function A(e,t){const{store:n,transaction:o,disableAutoChildrenMove:r}=e;return r||function(e){const{environment:t,store:n,transaction:o}=e,r=(0,C.sQ)(n),i=(null==r?void 0:r.getContentStores())||[];let a=!1;const s=i.filter((e=>{return a?(t=e.getType(),o=n.getType(),!(!t||!o||t===o||"divider"===t||"collection_view"===t||"sub_header"===o&&"header"===t||"sub_sub_header"===o&&("header"===t||"sub_header"===t))||(a=!1,!1)):(e===n&&(a=!0),!1);var t,o}));P.LQ({environment:t,targetParentStore:n.getContentStore(),droppedDirection:T.vh.Below,droppedStores:s,duplicate:!1,transaction:o})}(e),M.FH({stores:[n],update:{toggleable:t},transaction:o})}var R=n(210228);function D(e){const{environment:t,block:n,blockType:o,transaction:a,isMultiBlockTransformation:c}=e,d=n.getType(),p=n.getFormat(),m=n.recordStoreUIParentStore;if(f.M_(t)&&d&&!function(e,t){const n=e.type,o=e.format;if(u.ih(t)){var i;return"mermaid_code_block"===t?e.type===r.Ti.code&&"Mermaid"===s.QaF(null===(i=e.properties)||void 0===i?void 0:i.language):(0,r.Fx)(t)?u.tZ(t)===e.type&&(0,r.eJ)(n,o):u.tZ(t)===e.type}return e.type===t&&!(0,r.eJ)(n,o)}({type:d,format:p,properties:n.getProperties()},o)){const e=d,s=u.ih(o)?u.tZ(o):o;if(S.sW({store:n,data:{type:s},transaction:a}),(0,r.Fx)(o)&&!u.fn(n)?function(e){A(e,!0)}({environment:t,store:n,transaction:a,disableAutoChildrenMove:Boolean(c)}):!(0,r.Fx)(o)&&u.fn(n)&&function(e){const{store:t}=e;t.recordStoreUIParentStore&&A(e,!1)}({environment:t,store:n,transaction:a,disableAutoChildrenMove:Boolean(c)}),"mermaid_code_block"===o&&h.E5({blocks:[n],language:"Mermaid",transaction:a}),r.Z7[e]&&!r.Z7[o]){n.getPermissionItems().some(i.Le)&&_.MX({environment:t,store:n,transaction:a})}u.BX(n)&&I.rd({blockId:n.id,state:!0,currentUserId:t.currentUser.id});const g=n.getType();g&&m&&d&&(0,r.Um)(d,p)&&!(0,r.Um)(g,n.getFormat())&&function(e){let{environment:t,block:n,parentStore:o}=e;const r=async()=>{const e=n.getContentStores();await Promise.all(e.map((e=>e.load()))),R.createAndCommit({userAction:"transformActions.runAsync",environment:t,perform:t=>{const r=l.d9(e).reverse();for(const e of r)y.Od({parentStore:n.getContentStore(),childToRemoveStore:e,transaction:t}),y.BE({parentStore:o,insertStore:e,afterStore:n,transaction:t})}})};r()}({environment:t,parentStore:m,block:n}),v.jf({store:n,transaction:a})}return n}function B(e){const{environment:t,blocks:n,blockType:i,transaction:s}=e;if(i!==r.Ti.transclusionContainer)if(i===r.Ti.callout&&p.default.checkGate({gateName:"create_v2_callouts"}))!function(e){const{environment:t,blocks:n,transaction:o}=e,i=n[0];if(!i)return;const s=i.getRecordStoreUIParent();if(!s||!(0,d.dz)(s))return;const l=s.getRecordStoreUIParent();if(!(l&&l instanceof m.G))return;const u=(0,c.TS)({environment:t,table:a.iU,spaceId:l.getSpaceId()}),p=S.j4({environment:t,id:u,type:r.Ti.callout,inMemoryRecordCache:s.inMemoryRecordCache,transaction:o,spaceId:l.getSpaceId(),useCrdt:l.useCrdt(),format:{callout_version:2}});b.jG({parentStore:s,childStore:p,after:i.id,transaction:o});F({newParentStore:p.getContentStore(),blocks:n,transaction:o}),v.WO({store:p,transaction:o}),x.clear({environment:t}),w.ZH({environment:t}),w.Z5({environment:t,stores:[p]})}({environment:t,blocks:n,transaction:s});else if(i!==r.Ti.columnList)if(i!==r.Ti.slide)if((0,r.sX)(i)){const e=parseInt(i.replace("column","").replace("block","")),r=l.oA(l.DZ(e-1,(()=>k.ZJ({environment:t,blocks:n,transaction:s})))),a=[...n,...r],c=E({environment:t,blocks:a,transaction:s});o.default.afterNextFlush((()=>{x.setSelectionAtStart({store:c[0].getBlockTitleStore()})}))}else for(const r of n)if(r.isCalloutV2()){const e=r.getParentBlockStore();if(e){const a=r.getContentStores();R.applyOperation({store:e,operation:{pointer:e.pointer,path:["content"],command:"insertChildrenAfter",args:{ids:a.map((e=>e.id)),after:r.id}},transaction:s}),b.hr({parentStore:e.getContentStore(),childStore:r,transaction:s});for(const e of a)D({environment:t,block:e,blockType:i,transaction:s,isMultiBlockTransformation:n.length>1});o.default.afterNextFlush((()=>{k.DQ(t,a.map((e=>e.id)))}))}}else D({environment:t,block:r,blockType:i,transaction:s,isMultiBlockTransformation:n.length>1});else!function(e){const{environment:t,blocks:n,transaction:o}=e,i=n[0];if(!i)return;const s=i.getRecordStoreUIParent();if(!s||!(0,d.dz)(s))return;const l=s.getRecordStoreUIParent();if(!(l&&l instanceof m.G))return;const u=(0,c.TS)({environment:t,table:a.iU,spaceId:l.getSpaceId()}),p=S.j4({environment:t,id:u,type:r.Ti.slide,inMemoryRecordCache:s.inMemoryRecordCache,transaction:o,spaceId:l.getSpaceId(),useCrdt:l.useCrdt()});b.jG({parentStore:s,childStore:p,after:i.id,transaction:o});F({newParentStore:p.getContentStore(),blocks:n,transaction:o}),x.clear({environment:t}),w.ZH({environment:t}),w.Z5({environment:t,stores:[p]})}({environment:t,blocks:n,transaction:s});else E({environment:t,blocks:n,transaction:s});else!function(e){const{environment:t,blocks:n,transaction:o}=e,i=n[0];if(!i)return;const s=i.getRecordStoreUIParent();if(!s||!(0,d.dz)(s))return;const l=s.getRecordStoreUIParent();if(!l||!(0,d.OY)(l))return;if(!l.isDefined())return;const u=(0,c.TS)({environment:t,table:a.iU,spaceId:l.getSpaceId()}),p=S.j4({environment:t,id:u,type:r.Ti.transclusionContainer,inMemoryRecordCache:s.inMemoryRecordCache,transaction:o,spaceId:l.getSpaceId(),useCrdt:l.useCrdt()});y.BE({parentStore:s,insertStore:p,afterStore:i,transaction:o});F({newParentStore:p.getContentStore(),blocks:n,transaction:o}),x.clear({environment:t}),w.ZH({environment:t}),w.Z5({environment:t,stores:[p]})}({environment:t,blocks:n,transaction:s})}function E(e){const{environment:t,blocks:n,transaction:o}=e,i=n[0];if(!i)return[];const s=i.recordStoreUIParentStore;if(null==s||!s.valueIs(g.i))return[];const l=(0,c.TS)({environment:t,table:a.iU,spaceId:i.getSpaceId()}),d=S.j4({environment:t,id:l,type:r.Ti.columnList,inMemoryRecordCache:i.inMemoryRecordCache,transaction:o,spaceId:i.getSpaceId(),useCrdt:i.useCrdt()}),{childStore:u}=y.Vt({parentStore:s,insertStore:d,beforeStore:i,transaction:o});return n.map((e=>{const n=(0,c.TS)({environment:t,table:a.iU,spaceId:i.getSpaceId()}),l=S.j4({environment:t,id:n,type:r.Ti.column,inMemoryRecordCache:i.inMemoryRecordCache,transaction:o,spaceId:i.getSpaceId(),useCrdt:i.useCrdt()}),{childStore:d}=y.Od({parentStore:s,childToRemoveStore:e,transaction:o}),{childStore:p}=y.BE({parentStore:u.getContentStore(),insertStore:l,transaction:o}),{childStore:m}=y.BE({parentStore:p.getContentStore(),insertStore:d,transaction:o});return m}))}function F(e){const{newParentStore:t,blocks:n,transaction:o}=e;for(const r of n){const e=r.getRecordStoreUIParent();null!=e&&e.valueIs(g.i)&&(y.Od({parentStore:e,childToRemoveStore:r,transaction:o}),y.R3({parentStore:t,appendStore:r,transaction:o}))}}function Z(e){let{environment:t,blocks:n,transaction:o}=e;(function(e){return 1===e.length&&"collection_view"===e[0].getType()})(n)&&B({environment:t,blocks:n,blockType:"collection_view_page",transaction:o})}},239865:(e,t,n)=>{n.d(t,{DV:()=>R,Fy:()=>U,Rn:()=>B,Tq:()=>E,Ts:()=>N,Yk:()=>F,gW:()=>Z,y8:()=>D});n(757658);var o=n(815145),r=n(378168),i=n(159730),a=n(421202),s=n(23867),l=n(786036),c=n(647425),d=n(709291),u=n(275754),p=n(855337),m=n(433929),g=n(915339),f=n(74948),h=n(44604),v=n(600051),y=n(80444),b=n(801310),_=n(21359),S=n(547307),k=n(119785),w=n(640277),x=n(608055),I=n(164964),C=n(811853),T=n(210228),M=n(237181),P=n(165452);const A=(0,d.defineMessages)({deletePageConfirmationMessage:{id:"trashActions.deletePagePermanentlyDialog.prompt",defaultMessage:"Are you sure you want to delete this page from Trash?"},deletePageConfirmationButton:{id:"trashActions.deletePagePermanentlyDialog.confirmDeleteButton.label",defaultMessage:"Yes. Delete this page"},permanentlyDeleteFailedToast:{id:"trashActions.deletePagePermanentlyDialog.actionFailed.toast",defaultMessage:"Failed to delete, please try again later."},permanentlyDeletePermissionsFailure:{id:"trashActions.deletePagePermanentlyDialog.actionFailed.permissions",defaultMessage:"You do not have sufficient permissions to delete this page from Trash."},purgePageConfirmationMessage:{id:"trashActions.purgePageDialog.message",defaultMessage:"Are you sure you want to permanently delete this page?"},purgePageConfirmationDescription:{id:"trashActions.purgePageDialog.description",defaultMessage:"You won't be able to view or restore it."},purgePageConfirmationButton:{id:"trashActions.purgePageDialog.confirm",defaultMessage:"Permanently delete"},purgeFailedToast:{id:"trashActions.purgePageDialog.actionedFailed",defaultMessage:"Failed to permanently delete, please try again later."},restorationFailedToast:{id:"trashActions.restoreDeletedFromTrashPage.actionFailed.toast",defaultMessage:"Failed to restore page, please try again later."},trashDeletionToast:{defaultMessage:"Starting September 19th, pages in Trash will be automatically deleted after {duration}",id:"trashDeletionToast.body"}});async function R(e){const{environment:t,block:n,spaceId:r,from:i,restoreWithoutNavigation:s}=e;h.ZP.state.excludePages.add(n.id),h.ZP.emit(),await _.restoreBlock(t,{pointer:{table:a.iU,id:n.id,spaceId:r}});const l=w.Jv({environment:t,request:{type:"block-space",blockId:n.id},ignoreLocalResult:!0}),c=(await l.next()).value;v.Z.setState({publicPageData:c}),p.K4(t,"restore_trash_page",{from:i}),Boolean(s)||(u._c({environment:t,store:n,pageVisitSource:o.tY.Restore}),t.device.isMobile&&f.close())}function D(e){const{environment:t,blocks:n,transaction:o,permanentlyDelete:r=!1}=e;for(const i of n)k.zo({blockStore:i,transaction:o});o.postSubmitCallbacks.push((async e=>{e||await _.deleteBlocks(t,{blocks:n.map((e=>({id:e.id,spaceId:(0,s.C)(e.pointer.spaceId)}))),permanentlyDelete:r})}))}function B(e){const{environment:t,handleSuccess:n,blocks:o}=e;p.K4(t,"open_delete_trash_page_modal"),S.showDialog({message:m.default.formatMessage(A.deletePageConfirmationMessage),showCancel:!0,keepFocus:!1,items:[{label:m.default.formatMessage(A.deletePageConfirmationButton),color:"red",onAccept:async()=>{await E(e),null==n||n(o)}}],handleCancel:()=>{p.K4(t,"cancel_delete_trash_page")}})}async function E(e){const{blocks:t,environment:n,from:o}=e,{currentSpaceStore:r}=y.default.state,a=e.environment.currentUser.id;if(r&&a){await _.deleteBlocks(e.environment,{blocks:t.map((e=>({id:e.id,spaceId:(0,s.C)(e.pointer.spaceId)}))),permanentlyDelete:!0}).then((e=>{if("failed"===e.type)throw function(e){let t=A.permanentlyDeleteFailedToast;(0,i.QW)(e)&&(t=A.permanentlyDeletePermissionsFailure);I.oV({label:m.default.formatMessage(t),durationMs:b.JY})}(e.body),e.error})),p.K4(n,"delete_trash_page",{from:o});for(const e of t)h.ZP.state.excludePages.add(e.id),h.ZP.emit();await P.l({environment:n,spaceId:r.id,userId:a}),x.CZ({environment:e.environment,blocks:t})}}function F(e){const{blockStore:t,handleSuccess:n,environment:o}=e;S.showDialog({message:m.default.formatMessage(A.purgePageConfirmationMessage),description:m.default.formatMessage(A.purgePageConfirmationDescription),showCancel:!0,keepFocus:!1,items:[{label:m.default.formatMessage(A.purgePageConfirmationButton),color:"red",onAccept:async()=>{await _.purgeBlockTree(o,{pointer:t.pointer}).then((e=>{if("failed"===e.type)throw function(){const e=A.purgeFailedToast;I.oV({label:m.default.formatMessage(e),durationMs:b.JY})}(),e.error;null==n||n(t.id)}))}}],handleCancel:()=>{}})}async function Z(e){"failed"!==(await _.restoreBlock(e.environment,{pointer:{id:e.blockStore.id,table:a.iU,spaceId:e.spaceId},deletedFromTrashRestorationOption:"restore_to_private"})).type?(p.K4(e.environment,"restore_trash_page",{from:e.from,destination:"private_pages"}),e.navigateToPage&&u._c({environment:e.environment,store:e.blockStore,pageVisitSource:o.tY.Restore})):V()}async function U(e){"failed"!==(await _.restoreBlock(e.environment,{pointer:{id:e.blockStore.id,table:a.iU,spaceId:e.spaceId},deletedFromTrashRestorationOption:"restore_original_access"})).type?p.K4(e.environment,"restore_trash_page",{from:e.from,destination:"original_location"}):V()}function V(){const e=A.restorationFailedToast;I.oV({label:m.default.formatMessage(e),durationMs:b.JY})}function N(e){var t;let{experimentStore:n,currentSpaceStore:o,currentUserSettingsStore:i,intl:a,environment:s}=e;const d=new Date>=new Date("2024-09-19"),u=!(0,c.wP)(o.getSubscriptionTier()),f=null===(t=i.getSettings())||void 0===t?void 0:t.seen_trash_autodeletion_announcement,h=s.device.isMobile;if(!d&&u&&!f&&!h){const e=()=>{(0,p.j)({environment:s,event:{eventName:"trash_deletion_toast",eventProperties:{actionType:"dismissed",subscriptionTier:o.getSubscriptionTier()}}}),T.createAndCommit({userAction:"TrashDeletionToast.handleDismiss",environment:s,perform:e=>{M.d2({transaction:e,userSettingsStore:i,data:{seen_trash_autodeletion_announcement:!0}})}})},t=function(e){const{deleteFromTrashDelaySeconds:t,intl:n,onDismiss:o}=e;return{presentationType:"transient",id:"trash_deletion_toast",icon:g.N,message:m.default.formatMessage(A.trashDeletionToast,{duration:(0,l.uP)(t,n)}),onDismiss:o}}({deleteFromTrashDelaySeconds:(0,r.Tv)(null==o?void 0:o.getModel())/1e3,intl:a,environment:s,onDismiss:e});(0,p.j)({environment:s,event:{eventName:"trash_deletion_toast",eventProperties:{actionType:"viewed",subscriptionTier:o.getSubscriptionTier()}}}),C.m2(t)}}},227370:(e,t,n)=>{n.r(t),n.d(t,{dismissTutorial:()=>d,resetTutorials:()=>u,tutorialAdvanceToStep:()=>p,tutorialAdvanceToStepAfter:()=>m,tutorialGoToNextStep:()=>l,tutorialGoToPrevStep:()=>c});var o=n(509163),r=n(210228),i=n(237181),a=n(164856),s=n(80444);function l(e,t){var n;const{currentUserSettingsStore:o}=s.default.state;if(!o)return;const r=null===(n=o.getSettings())||void 0===n?void 0:n.tutorials;g({userAction:"TutorialActions.nextStep",environment:e,perform:e=>{i.d2({userSettingsStore:o,transaction:e,data:{tutorials:{...r,[t]:(0,a.ox)(o,t)}}})},userId:o.id})}function c(e,t){var n;const{currentUserSettingsStore:o}=s.default.state;if(!o)return;const r=null===(n=o.getSettings())||void 0===n?void 0:n.tutorials;g({userAction:"TutorialActions.prevStep",environment:e,perform:e=>{i.d2({userSettingsStore:o,transaction:e,data:{tutorials:{...r,[t]:(0,a.IJ)(o,t)}}})},userId:o.id})}function d(e,t){var n;const{currentUserSettingsStore:r}=s.default.state;if(!r)return;const a=null===(n=r.getSettings())||void 0===n?void 0:n.tutorials;g({userAction:"TutorialActions.dismissTutorial",environment:e,perform:e=>{i.d2({userSettingsStore:r,transaction:e,data:{tutorials:{...a,[t]:o.lR}}})},userId:r.id})}function u(e){const{currentUserSettingsStore:t}=s.default.state;t&&g({userAction:"TutorialActions.resetTutorialsDebug",environment:e,perform:e=>{i.d2({userSettingsStore:t,transaction:e,data:{tutorials:{}}})},userId:t.id})}function p(e,t,n){var r;const{currentUserSettingsStore:l}=s.default.state;if(!l||(0,a.W$)(l,t))return;const c=(0,a.wF)(l,t);o.eU[t].steps.findIndex((e=>e.id===c))>=o.eU[t].steps.findIndex((e=>e.id===n))||i.d2({userSettingsStore:l,transaction:e,data:{tutorials:{...null===(r=l.getSettings())||void 0===r?void 0:r.tutorials,[t]:n}}})}function m(e,t,n){if((0,a.AK)(n))return;const o=(0,a.Xv)(t,n);o&&p(e,t,o)}function g(e){return r.createAndCommit({...e,canUndo:!1})}},61202:(e,t,n)=>{n.d(t,{KT:()=>De,FD:()=>Fe,xv:()=>Be,jh:()=>Le,pt:()=>Me,os:()=>Ge,dY:()=>Oe,pJ:()=>Re,hJ:()=>Ee,UY:()=>Ve,yp:()=>Ue,sz:()=>Ye,aV:()=>Qe,qK:()=>Je});n(21703),n(757658);var o=n(126263),r=n(701302),i=n(541432),a=n(598953),s=n(399036),l=n(597531),c=n(895538),d=n(977657),u=n(402864),p=n(568626),m=n(520270),g=n(959753),f=n(145953),h=n(421202),v=n(177420),y=n(606287),b=n(213493),_=n(332161),S=n(509844),k=n(23867),w=n(590965),x=n(421838),I=n(544876),C=n(182798),T=n(709291),M=n(653965),P=n(401898),A=n(218265),R=n(619584),D=n(800893),B=n(631781),E=n(594419),F=n(709953),Z=n(524677),U=n(800993),V=n(898104),N=n(210228),O=(n(95477),n(27105)),L=n(269783),j=n(721429),K=n(265454),z=n(385555);var q=n(304708),H=n(970764),G=n(341232),W=n(328415),$=n(741195),Y=n(433929),Q=n(165598),J=n(273959),X=n(389224),ee=n(883165),te=n(318245),ne=n(58202),oe=n(80444),re=n(530874),ie=n(879167),ae=n(319111),se=n(206258),le=n(1634),ce=n(880064),de=n(240671),ue=n(897630),pe=n(757549),me=n(21359),ge=n(696454),fe=n(805149),he=n(547307),ve=n(389475),ye=n(627153),be=n(119785),_e=n(504408),Se=n(164964);const ke=!1;const we=[d.Aw];function xe(e,t){var n;const o=Boolean(e&&we.includes(e.id));return{hasServerDeterminedOptionTypes:o,canUnfurlAsCollection:Boolean(!o&&(null==t||null===(n=t.additional_types)||void 0===n?void 0:n.collection)),canUnfurlAsImport:Boolean(e&&Ie(e,t))}}function Ie(e,t){switch(e.id){case d.Aw:return!0;case d.f3:return t&&"google_docs"===t.name;default:return!1}}const Ce=(0,T.defineMessages)({browse:{id:"externalBlock.mediaPicker.browseTab.title",defaultMessage:"Browse {appName}"},somethingWentWrong:{defaultMessage:"Something went wrong.",id:"externalActions.dialogError.openFilePicker.errorMessage"},copyDebuggingInformation:{id:"externalActions.dialogItem.openFilePicker.copyDebugData",defaultMessage:"Copy debugging information"},copiedDebuggingInfo:{id:"externalActions.dialogError.copiedDebuggingInfo",defaultMessage:"Copied to clipboard."},userReAuth:{id:"externalActions.dialogError.userReAuth",defaultMessage:"Authentication Expired. Please Re-Authenticate to continue."}});let Te=!1;async function Me(e){const{environment:t,spaceId:n,force:o}=e;await oe.default.waitUntilRendered();const r=re.Z.state,i=t.currentUser.id;if(!r.loaded&&!r.loading||r.loaded&&n!==r.spaceId||r.loaded&&i!==r.userId||o){const e=!Te;e&&(Te=!0,te.default.DO_NOT_USE_measureFromAppStartLegacy("external_integration_store.app_start_to_loading",{environment:t})),re.Z.setState({...re.Z.state,loading:!0});const[o,r]=await Promise.all([Pe({environment:t,spaceId:n}),Ae({environment:t,spaceId:n})]);if("success"!==o.type||"success"!==r.type)throw new Error("Request failed.");const i=f.PF.create(o.data.recordMap),a=f.PF.create(r.data.recordMap);re.Z.setState({loaded:!0,loading:!1,spaceId:n,userId:t.currentUser.id,integrations:M.MR(M.oA(o.data.integrationIds.map((e=>i.getValue({table:S.K2,id:e})))),(e=>{let{created_at:t}=e;return t})),externalAuthentications:M.MR(M.oA(r.data.externalAuthenticationIds.map((e=>a.getValue({table:_.PJ,id:e})))),(e=>{let{created_at:t}=e;return t})),bots:M.Xo(M.oA(r.data.botIds.map((e=>a.getValue({table:v.cZ,id:e})))),(e=>{let{last_edited_at:t,created_at:n}=e;return t||n}),"desc"),completeSlackAuthentications:M.MR(M.oA(r.data.completeSlackAuthenticationIds.map((e=>a.getValue({table:_.PJ,id:e})))),(e=>{let{created_at:t}=e;return t}))}),e&&(Te=!0,te.default.DO_NOT_USE_measureFromAppStartLegacy("external_integration_store.app_start_to_ready",{environment:t}))}}async function Pe(e){const{environment:t,spaceId:n}=e,o=te.default.DO_NOT_USE_markLegacy("external_integration_store.get_external_integrations"),r=await me.getExternalIntegrations(t,{spaceId:n});return"success"===r.type&&te.default.DO_NOT_USE_measureLegacy(o,{environment:t}),r}async function Ae(e){const{environment:t,spaceId:n}=e;if(!t.currentUser.isLoggedIn())return{type:"success",status:200,headers:{},data:{botIds:[],externalAuthenticationIds:[],recordMap:{},completeSlackAuthenticationIds:[]}};const o=te.default.DO_NOT_USE_markLegacy("external_integration_store.get_user_space_external_bots"),r=await me.getUserSpaceExternalBots(t,{spaceId:n});return"success"===r.type&&te.default.DO_NOT_USE_measureLegacy(o,{environment:t}),r}async function Re(e){const{environment:t}=e,{currentSpaceStore:n}=oe.default.state;n&&await Me({environment:t,spaceId:n.id,force:!0})}function De(e){var t;const{environment:n,blockStore:a,textStore:s,url:l,textValueBeforePaste:u,urlSelection:m}=e,g=X.get();if(!a||L.Z.state.open||ae.Z.state.open||ce.Z.state.open||!g)return!1;const{currentSpaceStore:f}=oe.default.state,v=(0,c.x$)(l),_=(0,A.Qc)(v);if(!_.host)return!1;const S=n.currentUser.id;if(null==f||!f.isDefined()||!S)return!1;const C=re.Z.integrations.state.filter((e=>e.id!==d.U9)),T=(0,I.ny)({url:v,integrations:C,currentSpaceId:f.id});if("partial"===T.type)return function(e){const{environment:t,parsedUrl:n,urlDomain:o,integrationId:r}=e;pe.pp(t,{integrationId:r,urlDomain:o}),p.log({level:"debug",from:"activateFromLinkCreation",type:"linkPreviewUrlMiss",data:{miscDataToConvertToString:{integrationId:r,urlDomain:o,path:n.path}}})}({...T,integrationId:T.integration.id,environment:n}),!1;if("failure"===T.type)return!1;const{integration:P,pattern:R}=T;if(!(0,ee.VK)(f,S).isWorkspaceOwner()&&!(0,w.hU)({spaceBotSettings:f.getBotSettingsStore().getValue(),integrationId:P.id,env:"production"}))return!1;const D=(0,H.NP)(P.id),B=function(e){const{integration:t,pattern:n,blockStore:o,textValueBeforePaste:r}=e,a=o&&o.getType()===i.Ti.text&&0===(0,x.QaF)(r).trim().length,{hasServerDeterminedOptionTypes:s,canUnfurlAsCollection:l,canUnfurlAsImport:c}=xe(t,n);if(t){if(a){const e=z.default.getConfigKey("link_paste_order",(null==t?void 0:t.id)||"defaultOrder");return e?(l&&(e.order.includes("collection")||e.order.splice(e.order.length-1,0,"collection")),c&&(e.order.includes("import")||e.order.push("import")),M.oA(e.order)):M.oA(["preview","mention","link",(s||l)&&"collection",c&&"import"])}return M.oA(["mention","preview","link",(s||l)&&"collection",c&&"import"])}return a?M.oA(["preview","mention","link",(s||l)&&"collection",c&&"import"]):M.oA(["mention","preview","link",(s||l)&&"collection",c&&"import"])}({blockStore:a,integration:P,pattern:R,textValueBeforePaste:u}),E=X.getRect(g);if(!E)return!1;const F=a.getRecordStoreUIParent();if(!F||!(0,Q.dz)(F))return!1;const Z=new o.Z({name:"unfurlingActions.activateFromLinkCreation",isTemporaryData:!0});n.defaultRecordCache.inMemoryRecordCache.addCacheOverride(Z);const U=F.clone(Z),V=a.clone(Z),O=s.table===h.iU&&s===(null===(t=(0,J.sQ)(s))||void 0===t?void 0:t.getBlockTitleStore())?V.getBlockTitleStore():s.clone(Z),j=(0,k.C)(a.pointer.spaceId),K=(0,$.$x)({environment:n,table:h.iU,spaceId:j}),q=new se.G(n,K),G=q.clone(Z),W=M.w6(I.wh).map((()=>new se.G(n,{table:h.iU,id:(0,$.TS)({environment:n,table:h.iU,spaceId:j}),spaceId:j}))),te=W.map((e=>e.clone(Z))),ne=new se.NW(n,(0,$.$x)({environment:n,table:y.vF,spaceId:j})),ie=ne.clone(Z);let le;le=R.defaultViews?R.defaultViews.map((e=>new se.Xr(n,(0,$.$x)({environment:n,table:b.np,spaceId:j})))):[new se.Xr(n,(0,$.$x)({environment:n,table:b.np,spaceId:j}))];const de=le.map((e=>e.clone(Z))),ue=M.w6(I.wh).map((()=>new se.NW(n,(0,$.$x)({environment:n,table:y.vF,spaceId:j})))),me=ue.map((e=>e.clone(Z))),ge=M.w6(I.wh).map((()=>new se.Xr(n,(0,$.$x)({environment:n,table:b.np,spaceId:j})))),fe=ge.map((e=>e.clone(Z)));let he;return ce.Z.setState({open:!0,url:v,textValueBeforePaste:u,textValueAfterPaste:s.getValue(),urlSelection:m,renderRect:E,integration:P,pattern:R,currentOption:{type:"link"},allOptionTypes:B,temporaryRecordCache:Z,stores:{blockStore:a,blockParentStore:F,textStore:s,externalObjectInstanceBlockStore:q,subExternalObjectInstanceBlockStores:W,externalCollectionStore:ne,externalCollectionViewStores:le,subExternalCollectionStores:ue,subExternalCollectionViewStores:ge},temporaryStores:{blockParentStore:U,blockStore:V,textStore:O,externalObjectInstanceBlockStore:G,subExternalObjectInstanceBlockStores:te,externalCollectionStore:ie,externalCollectionViewStores:de,subExternalCollectionStores:me,subExternalCollectionViewStores:fe},unfurlResponse:void 0}),D.length>0&&Ze({environment:n,url:l,botIds:D.map((e=>{let{id:t}=e;return t})),integrationId:P.id,externalObjectInstanceBlockStore:q}),pe._x(n,{integrationId:P.id,entity:R.name,domain:_.host,from:"link_paste"}),he="import"===B[0]?"link":B[0],r.default.afterNextFlush((()=>{const e="drive"!==he;N.createAndCommit({userAction:"unfurlingActions.activateFromLinkCreation",environment:n,canUndo:!e,perform:t=>{Ee({environment:n,type:he,useTemporaryRecordCache:e,transaction:t,intl:Y.default.getIntl()})}})})),!0}function Be(e){const{environment:t,setType:n,transaction:o}=e,{currentUserSettingsStore:r}=oe.default.state,i=j.qQ(t),a=ce.Z.state;if(!a.open)return;t.defaultRecordCache.inMemoryRecordCache.removeCacheOverride(a.temporaryRecordCache);const s=(0,H.NP)(a.integration.id).length>0;if(Ee({environment:t,type:n||a.currentOption.type,useTemporaryRecordCache:!1,transaction:o,intl:Y.default.getIntl()}),"preview"===a.currentOption.type)Z.Z5({environment:t,stores:[a.currentOption.externalObjectInstanceBlockStore]});else if("drive"===a.currentOption.type){var l,c,d,u,p;const e=A.Qc(a.url,{slashesDenoteHost:!0});let n=e.href;if(null!==(l=e.hostname)&&void 0!==l&&l.includes("docs.google.com")&&(null!==(c=e.pathname)&&void 0!==c&&c.includes("presentation")||null!==(d=e.pathname)&&void 0!==d&&d.includes("document")||null!==(u=e.pathname)&&void 0!==u&&u.includes("spreadsheets"))&&null!==(p=e.pathname)&&void 0!==p&&p.includes("/edit")){const t=e.pathname.replace("/edit","/preview");n=A.bf({url:`https://${e.hostname}${t}`,query:{...e.query},hash:e.hash||void 0})}B.I(t,{source:n,isDataURL:!1,store:a.stores.blockStore,pageWidth:i,preferredType:"drive"})}if(a.integration&&!s){(null==r?void 0:r.hasDismissedIntegrationPopup({integrationId:a.integration.id}))||le.Z.setState({open:!0,integration:a.integration,externalObjectInstanceBlockId:a.stores.externalObjectInstanceBlockStore.id,unfurlUrl:a.url})}ce.Z.setState({open:!1})}function Ee(e){const{environment:t,type:n,transaction:o,useTemporaryRecordCache:a}=e,s=ce.Z.state;if(!s.open)return;const l=t.currentUser.id;if(!l)return;const d=a?s.temporaryStores:s.stores;if(a){s.temporaryRecordCache.clearCache();for(const e in s.temporaryStores){const n=s.temporaryStores[e],o=Array.isArray(n)?n:[n];for(const e of o){const n={userId:l,pointer:e.pointer},o=t.defaultRecordCache.inMemoryRecordCache.getRecord(n);o?_e.Wl({environment:t,inMemoryRecordCache:s.temporaryRecordCache,pointer:e.pointer,model:g.kk5.fromValue(e.pointer.table,o.value),role:o.role,updatePaths:[[]],userId:l,force:!0,debugSource:"setUnfurlingOptionType"}):_e.uo({environment:t,inMemoryRecordCache:s.temporaryRecordCache,persistedRecordCache:void 0,pointer:e.pointer,userId:l})}}}const p=(0,c.x$)(s.url),{host:m}=(0,A.Qc)(p);if(m){if("preview"===n||"mention"===n){const e=d.blockParentStore.getRecordStoreAtRootPath().useCrdt(),n={original_url:p,domain:m};let r;const{unfurlResponse:a}=s;if(a){const s=(0,R.m8)(M.oA(a.relations.map(((n,r)=>{if(n.external_schema)return;const a=d.subExternalObjectInstanceBlockStores[r];return a?((0,C.T)(!a.isDefined()),F.j4({environment:t,id:a.id,type:i.Ti.externalObjectInstance,spaceId:(0,k.C)(d.blockStore.pointer.spaceId),format:n,inMemoryRecordCache:a.inMemoryRecordCache,transaction:o,useCrdt:e}),F.sW({store:a,data:{parent_table:h.iU,parent_id:d.externalObjectInstanceBlockStore.id,alive:!0},transaction:o}),[n.uri,a.id]):void 0})))),{external_object_id:l,uri:c,bot_id:p}=a.root;if(l&&c&&p){let e,t;const o=(0,u.o)(a.root.attributes,(0,G.o$)());o&&(e=o.block_width,t=o.block_height),r={...n,...{...a.root,block_width:e,block_height:t,external_schema:void 0},related_external_object_uris_to_instance_ids:s,external_object_id:l,uri:c,bot_id:p}}else{var f;r={...n,attributes:a.root.attributes,error:a.root.error,auth_refresh_in_progress:439===(null===(f=a.root.error)||void 0===f?void 0:f.status_code)||null}}}else r=n;(0,q.WP)()||(0,C.T)(!d.externalObjectInstanceBlockStore.isDefined()),F.j4({environment:t,id:d.externalObjectInstanceBlockStore.id,type:i.Ti.externalObjectInstance,format:r,inMemoryRecordCache:d.externalObjectInstanceBlockStore.inMemoryRecordCache,transaction:o,useCrdt:d.blockParentStore.getRecordStoreAtRootPath().useCrdt()})}else if("collection"===n){const{unfurlResponse:e}=s;let n=d.externalCollectionStore.pointer;const a=d.externalCollectionViewStores.map(((e,t)=>{var n,o,r;return{id:e.id,version:0,space_id:(0,k.C)(d.blockStore.pointer.spaceId),type:(null===(n=s.pattern.defaultViews)||void 0===n?void 0:n[t].type)||"table",format:null===(o=s.pattern.defaultViews)||void 0===o?void 0:o[t].format,query2:null===(r=s.pattern.defaultViews)||void 0===r?void 0:r[t].query2,parent_table:h.iU,parent_id:d.externalObjectInstanceBlockStore.id,alive:!0}}));let l;if(e){const{external_object_id:t,uri:r,bot_id:i}=e.root;if(t&&r&&i)if("collectionId"in e&&e.collectionId){l={id:e.collectionId,version:0,space_id:(0,k.C)(d.blockStore.pointer.spaceId),parent_table:h.iU,parent_id:d.externalObjectInstanceBlockStore.id,alive:!0,schema:{}},n={id:e.collectionId,table:y.vF,spaceId:(0,k.C)(d.blockStore.pointer.spaceId)}}else{const t={};e.relations.forEach(((e,n)=>{const r=d.subExternalCollectionStores[n],i=e,a={id:r.id,version:0,space_id:(0,k.C)(d.blockStore.pointer.spaceId),parent_table:y.vF,parent_id:d.externalCollectionStore.id,alive:!0,format:i,schema:{}};t[e.uri]=r.id,F.sW({store:r,data:a,transaction:o})}));l={id:d.externalCollectionStore.id,version:0,space_id:(0,k.C)(d.blockStore.pointer.spaceId),parent_table:h.iU,parent_id:d.externalObjectInstanceBlockStore.id,alive:!0,format:{original_url:p,domain:m,...e.root,related_external_object_uris_to_instance_ids:{...t}},schema:{}}}else{l={id:d.externalCollectionStore.id,version:0,space_id:(0,k.C)(d.blockStore.pointer.spaceId),parent_table:h.iU,parent_id:d.externalObjectInstanceBlockStore.id,alive:!0,format:{original_url:p,domain:m,error:e.root.error},schema:{}}}}else{l={id:d.externalCollectionStore.id,version:0,space_id:(0,k.C)(d.blockStore.pointer.spaceId),parent_table:h.iU,parent_id:d.externalObjectInstanceBlockStore.id,alive:!0,format:{original_url:p,domain:m},schema:{}}}(0,C.T)(!d.externalObjectInstanceBlockStore.isDefined());const c=F.j4({environment:t,id:d.externalObjectInstanceBlockStore.id,type:i.Ti.collectionView,format:{collection_pointer:n},spaceId:(0,k.C)(d.blockStore.pointer.spaceId),inMemoryRecordCache:d.externalObjectInstanceBlockStore.inMemoryRecordCache,transaction:o,useCrdt:d.blockParentStore.getRecordStoreAtRootPath().useCrdt()});F.sW({store:c,data:{collection_id:n.id,parent_table:h.iU,parent_id:d.blockParentStore.id,alive:!0,view_ids:d.externalCollectionViewStores.map((e=>e.id))},transaction:o});const u=He();d.externalCollectionViewStores.forEach(((t,n)=>{e&&"collectionId"in e&&e.collectionId&&a[n].format&&(a[n].format={collection_pointer:{id:e.collectionId,table:y.vF}}),u&&e&&"table"===a[n].type&&(a[n].format={...a[n].format,table_properties:$e(e.root.external_schema)}),F.sW({store:t,data:a[n],transaction:o})})),F.sW({store:d.externalCollectionStore,data:l,transaction:o});const g=s.integration;r.default.afterNextFlush((()=>{const e=ne.R.findCollectionViewBlockFromId(d.externalObjectInstanceBlockStore.id);if(e){const t=e.collectionContextStore.settingsStore;fe.wl({collectionSettingsStore:t,item:{type:"shareSyncedView",integrationName:g.name,integrationIcon:g.info.icon}})}}))}if("preview"===n){U.sO({environment:t,store:d.textStore,value:s.textValueBeforePaste,transaction:o});const e=se.G.createChildStore(d.blockParentStore,d.externalObjectInstanceBlockStore.pointer);if(E.BE({parentStore:d.blockParentStore,insertStore:e,afterStore:d.blockStore,transaction:o}),0===(0,x.QaF)(s.textValueBeforePaste).trim().length){const e=se.G.createChildStore(d.blockParentStore,s.stores.blockStore.pointer);E.Od({parentStore:d.blockParentStore,childToRemoveStore:e,transaction:o})}const r=se.G.createChildStore(s.stores.blockParentStore,s.stores.externalObjectInstanceBlockStore.pointer);Z.ZH({environment:t}),ce.Z.setState({...s,currentOption:{type:n,externalObjectInstanceBlockStore:r}})}else if("mention"===n){const e=(0,x.x36)(d.externalObjectInstanceBlockStore.id),n=(0,x.YCD)(e),r=(0,x.P$X)(s.textValueBeforePaste,[n],s.urlSelection.startIndex),i={startIndex:s.urlSelection.startIndex+1,endIndex:s.urlSelection.startIndex+1};U.sO({environment:t,store:d.textStore,value:r,transaction:o}),F.sW({store:d.externalObjectInstanceBlockStore,data:{parent_id:d.textStore.id,parent_table:h.iU,alive:!0},transaction:o}),Z.eP({environment:t,store:s.stores.blockStore}),V.setSelection({store:s.stores.textStore,selection:i}),ce.Z.setState({...s,currentOption:{type:"mention",mentionTokenSelection:i}})}else if("link"===n)ce.Z.setState({...s,currentOption:{type:"link"}}),Z.eP({environment:t,store:s.stores.blockStore}),V.setSelection({store:s.stores.textStore,selection:{startIndex:s.urlSelection.endIndex,endIndex:s.urlSelection.endIndex}});else if("drive"===n)ce.Z.setState({...s,currentOption:{type:"drive"}}),Z.eP({environment:t,store:s.stores.blockStore}),V.setSelection({store:s.stores.textStore,selection:{startIndex:s.urlSelection.endIndex,endIndex:s.urlSelection.endIndex}});else if("collection"===n){U.sO({environment:t,store:d.textStore,value:s.textValueBeforePaste,transaction:o});const e=se.G.createChildStore(d.blockParentStore,d.externalObjectInstanceBlockStore.pointer);if(E.BE({parentStore:d.blockParentStore,insertStore:e,afterStore:d.blockStore,transaction:o}),0===(0,x.QaF)(s.textValueBeforePaste).trim().length){const e=se.G.createChildStore(d.blockParentStore,s.stores.blockStore.pointer);E.Od({parentStore:d.blockParentStore,childToRemoveStore:e,transaction:o})}Z.ZH({environment:t}),ce.Z.setState({...s,currentOption:{type:n}})}else(0,P.t1)(n);if(!a){const{unfurlResponse:e}=s;pe.Mp(t,{integrationId:s.integration.id,type:n,entity:s.pattern.name,domain:m,from:"unfurl_menu",...e&&{status:null!=e&&e.root.error?"failure":"success"},collection_id:"collection"===n?d.externalCollectionStore.pointer.id:void 0,collection_view_block_id:"collection"===n&&d.blockStore.isCollectionView()?d.blockStore.id:void 0})}}}async function Fe(e){const{environment:t,notionState:n}=e,{externalObjectInstanceBlockId:o,spaceId:r}=n;if(o){const e=new se.G(t,{table:h.iU,id:o,spaceId:r});let n;if(await Promise.all([e.load(),re.Z.waitUntil((()=>re.Z.state.loaded))]),e.isExternalObjectInstanceBlockStore()||e.isExternalObjectInstancePageBlockStore())n=e.getFormat();else if(e.isCollectionView()){var i;n=null===(i=e.getCollectionViewSourceCollectionStore())||void 0===i?void 0:i.getFormat()}if(!n)throw new Error("External object instance has no value.");const a=n.original_url||n.uri;if(!a)throw new Error("External object instance has no original_url.");const s=(0,I.ny)({url:a,integrations:re.Z.integrations.state,currentSpaceId:r});if("success"!==s.type)throw new Error("Could not find integration.");const{integration:l}=s,c=(0,H.NP)(l.id);if(0===c.length)throw new Error("Could not find bot.");if(e.isExternalObjectInstanceBlockStore()||e.isExternalObjectInstancePageBlockStore())await Ze({environment:t,url:a,botIds:c.map((e=>{let{id:t}=e;return t})),integrationId:l.id,externalObjectInstanceBlockStore:e});else{if(!e.isCollectionView())throw new Error(`BlockStore is neither an ExternalObject nor a ExternalCollection. It has type: ${e.getType()}`);{const n=e.getCollectionViewSourceCollectionStore();if(!n)throw new Error("Could not find collection store.");await Ve({environment:t,url:a,botIds:c.map((e=>{let{id:t}=e;return t})),externalCollectionViewBlockStore:e,externalCollectionStore:n})}}}}async function Ze(e){const{environment:t,url:n,botIds:o,integrationId:r,externalObjectInstanceBlockStore:a}=e;de.Z.add(n);const s=await me.unfurlUrl(t,{url:n,botIds:o,integrationId:r,spaceId:ge.Bs()});de.Z.delete(n);const l=ce.Z.state,d="success"===s.type?s.data:{root:{error:{status_code:s.status}},relations:[]};if(l.open&&l.stores.externalObjectInstanceBlockStore===a){ce.Z.setState({...l,unfurlResponse:d});const e=function(e,t,n){if(we.includes(e)&&"collection"===n)return t.root.hasOwnProperty("external_schema")?"collection":"preview";if("import"===n)return"link";return n}(r,d,l.currentOption.type);N.createAndCommit({userAction:"unfurlingActions.startUnfurlRequest",environment:t,canUndo:!1,perform:n=>{Ee({environment:t,type:e,useTemporaryRecordCache:!0,transaction:n,intl:Y.default.getIntl()})}})}else if(a.isExternalObjectInstanceBlockStore())!function(e){const{environment:t,unfurlResponse:n,url:o,externalObjectInstanceBlockStore:r}=e,a=r.pointer.spaceId,s=t.currentUser.id;if(!s)return;const l=(0,c.x$)(o),{host:d}=(0,A.Qc)(l);if(!d)return;if("collectionId"in n)return;const p=r.getFormat().related_external_object_uris_to_instance_ids,m=(0,R.m8)(Object.entries(p||{}).map((e=>{let[t,n]=e;return[t,se.G.createChildStore(r,{id:n,table:h.iU,spaceId:r.getSpaceId()})]})));N.createAndCommit({userAction:"unfurlingActions.createExternalObjectInstanceFromInitialUnfurl",environment:t,perform:e=>{const s=(0,R.m8)(M.oA(n.relations.map((n=>{if(n.external_schema)return;let o=m[n.uri];return o?(F.sW({store:o,data:{type:i.Ti.externalObjectInstance,parent_table:h.iU,parent_id:r.id,alive:!0},transaction:e}),F.sW({store:o.getFormatStore(),data:n,transaction:e})):(o=F.j4({environment:t,type:i.Ti.externalObjectInstance,spaceId:a,format:n,inMemoryRecordCache:r.inMemoryRecordCache,transaction:e,useCrdt:r.useCrdt()}),F.sW({store:o,data:{parent_table:h.iU,parent_id:r.id,alive:!0},transaction:e})),[n.uri,o.id]})))),l=r.getFormatStore().getValue();let c,d;if(l&&(c=l.block_width,d=l.block_height),!c&&!d){const e=(0,u.o)(n.root.attributes,(0,G.o$)());e&&(c=e.block_width,d=e.block_height)}F.sW({store:r.getFormatStore(),data:{...{...n.root,block_width:c,block_height:d,external_schema:void 0,integration_id:null,original_url:o,is_placeholder:null,error:n.root.error??null},related_external_object_uris_to_instance_ids:s},transaction:e})}})}({environment:t,unfurlResponse:d,url:n,externalObjectInstanceBlockStore:a}),function(e){const{environment:t,url:n,spaceId:o,status:r}=e,i=(0,G.GQ)(n,o),a=(0,c.x$)(n),s=(0,A.Qc)(a);i&&s.host&&pe.Mp(t,{integrationId:i.integration.id,type:"preview",entity:i.pattern.name,domain:s.host,from:"link_preview_placeholder",...r&&{status:r}})}({environment:t,url:n,spaceId:a.getSpaceId(),...d&&{status:d.root.error?"failure":"success"}});else{if(!a.isCollectionView()){if(a.isExternalObjectInstancePageBlockStore())return;throw new Error(`BlockStore is neither an ExternalObject nor a ExternalCollection. It has type: ${a.getType()}`)}{const e=a.getCollectionViewSourceCollectionStore();if(!e)throw new Error("Could not find collection store.");N.createAndCommit({userAction:"unfurlingActions.startUnfurlRequest",environment:t,perform:o=>{Ne({environment:t,unfurlResponse:d,url:n,externalCollectionStore:e,externalCollectionViewBlockStore:a,transaction:o})}})}}}async function Ue(e){const{environment:t,url:n,botIds:o,userDefinedExternalCollectionStore:r,relatedPageId:a}=e,s=r.getFormat();if(!s.uri||void 0!==s.external_object_id)return;de.Z.add(n);const l=await me.unfurlUrl(t,{url:n,botIds:o,spaceId:r.getSpaceId(),targetCollectionId:r.id,relatedPageId:a});if("failed"===l.type)return void he.showError(l);de.Z.delete(n);const d=l.data;return"pageId"in d&&d.pageId?new se.G(t,{table:h.iU,id:d.pageId,spaceId:r.getSpaceId()}):function(e){const{environment:t,unfurlResponse:n,url:o,rootUserDefinedExternalCollectionStore:r}=e,a=r.pointer.spaceId,s=t.currentUser.id;if(!s)return;const l=(0,c.x$)(o),{host:d}=(0,A.Qc)(l);if(!d)return;if(!n.root.external_object_id)return;const u=n.root;return N.createAndCommit({userAction:"unfurlingActions.createExternalObjectInstancePageFromInitialUnfurl",environment:t,perform:e=>{const n=F.j4({environment:t,type:i.Ti.externalObjectInstancePage,spaceId:a,format:u,inMemoryRecordCache:r.inMemoryRecordCache,transaction:e,useCrdt:O.dy({source:"external_object_instance_page"})});return be.zw({parentStore:r,childStore:n,transaction:e}),new se.G(t,n.pointer)}}).performResult}({environment:t,unfurlResponse:d,url:n,rootUserDefinedExternalCollectionStore:r})}async function Ve(e){const{environment:t,url:n,botIds:o,externalCollectionStore:r,externalCollectionViewBlockStore:i}=e;de.Z.add(n);const a=await me.unfurlUrl(t,{url:n,botIds:o,spaceId:ge.Bs()});de.Z.delete(n);const s="success"===a.type?a.data:{root:{error:{status_code:a.status}},relations:[]};N.createAndCommit({userAction:"unfurlingActions.startUnfurlRequestForCollection",environment:t,perform:e=>{Ne({environment:t,unfurlResponse:s,url:n,externalCollectionStore:r,externalCollectionViewBlockStore:i,transaction:e})}})}function Ne(e){const{environment:t,unfurlResponse:n,url:o,externalCollectionStore:r,externalCollectionViewBlockStore:i,transaction:l}=e,d=(0,c.x$)(o),{host:u}=(0,A.Qc)(d);if(!u)return;const{external_object_id:p,uri:m,bot_id:g}=n.root;if(!p||!m||!g)return;const f=M.w6(I.wh).map((()=>new se.NW(t,(0,$.$x)({environment:t,table:y.vF,spaceId:(0,k.C)(i.pointer.spaceId)})))),v={};n.relations.forEach(((e,t)=>{const n=f[t],o=e,a={id:n.id,version:0,space_id:(0,k.C)(i.pointer.spaceId),parent_table:y.vF,parent_id:r.id,alive:!0,format:o,schema:{}};v[e.uri]=n.id,F.sW({store:n,data:a,transaction:l})}));const _={id:r.id,version:0,space_id:(0,k.C)(i.pointer.spaceId),parent_table:h.iU,parent_id:i.id,alive:!0,format:{original_url:d,domain:u,...n.root,property_visibility:(S=n.root.external_schema,S&&Object.keys(S).flatMap((e=>(0,s.HF)(e)?[]:{property:`${a.U}${e}`,visibility:"hide_if_empty"}))),related_external_object_uris_to_instance_ids:{...v},is_placeholder:void 0,integration_id:void 0},schema:{}};var S;F.sW({store:r,data:_,transaction:l});if(He()&&n){const e=i.getCollectionViewIds();null==e||e.forEach((e=>{const t=se.Xr.createChildStore(i,{table:b.np,id:e,spaceId:i.getSpaceId()});if("table"===t.getType()){const e={...t.getFormat(),table_properties:$e(n.root.external_schema)};F.sW({store:t,data:{format:e},transaction:l})}}))}}async function Oe(e){const{environment:t}=e,{externalObjectInstanceBlockPointersMap:n,externalCollectionInstancePointersMap:o}=ie.Z.state;await me.refetchExternalObjectInstanceBlocks(t,{recordPointers:[...Object.values(n),...Object.values(o)]}),ie.Z.reset()}async function Le(e){const{environment:t,externalAuthenticationValue:n}=e;let o=await me.getExternalIntegrationAccessToken(t,{botId:n.id,integrationId:n.integration_id,spaceId:n.space_id});if("failed"===o.type){const e=re.Z.integrations.state.find((e=>e.id===n.integration_id));if(!e)return;Se.oV({label:Y.default.formatMessage(Ce.userReAuth)}),await ve.hM({environment:t,integration:e,spaceId:n.space_id,from:"integration_file_picker"});const r=re.Z.bots.state.filter((e=>e.integration_id===n.integration_id))[0];if(!r)return;o=await me.getExternalIntegrationAccessToken(t,{botId:r.id,integrationId:r.integration_id,spaceId:r.space_id})}return o}function je(e){const{integration:t}=e;return t.id===d.YM&&"on"===z.default.getEligibleGroup({experimentId:"box_file_picker",defaultGroup:"control"})?Ke({integrationType:"box",...e}):t.id===d.f3&&(0,W.qH)()?Ke({integrationType:"drive",...e}):void 0}function Ke(e){const{integrationType:t,integration:n}=e;return"box"===t?{type:t,title:Y.default.formatMessage(Ce.browse,{appName:n.name}),accounts:re.Z.externalAuthentications.state.filter((e=>{let{integration_id:t}=e;return t===n.id})),onSelect:ze(e)}:"drive"===t?{type:t,title:Y.default.formatMessage(Ce.browse,{appName:n.name}),accounts:re.Z.externalAuthentications.state.filter((e=>{let{integration_id:t}=e;return t===n.id})),onSelect:ze(e)}:void 0}function ze(e){const{integration:t,environment:n,externalObjectTokenStore:o,externalObjectInstanceBlockStore:r}=e;return async e=>{let i=e?e.id:void 0;if(!e){const{currentSpaceStore:e}=oe.default.state,o=re.Z.integrations.state.find((e=>{let{id:n}=e;return n===t.id}));if(o&&e){const r=re.Z.bots.state;await ve.hM({environment:n,integration:o,spaceId:e.id,from:"integration_file_picker"});const a=function(e,t){const n=re.Z.bots.state;var o;if(e.length!==n.length)return null===(o=n.filter((e=>e.integration_id===t))[0])||void 0===o?void 0:o.id}(r,t.id);a&&(i=a)}}const a=re.Z.externalAuthentications.state.find((e=>e.id===i));if(a){const e=await async function(e,t,n,o,r){if(!re.Z.state.loaded)return;r.setState({error:!1,loading:!0});const i=await Le({environment:e,externalAuthenticationValue:o});if(r.setState({error:!i||"success"!==i.type,loading:!1}),i&&"failed"!==i.type)return i.data;he.showDialog({message:Y.default.formatMessage(Ce.somethingWentWrong),showCancel:!0,keepFocus:!0,items:[{label:Y.default.formatMessage(Ce.copyDebuggingInformation),color:void 0,onAccept:()=>{const t={statusCode:null==i?void 0:i.status,integrationId:n.id,botId:o.id};D.RD({environment:e,stringValue:JSON.stringify(t,null,2),copiedMessage:Ce.copiedDebuggingInfo})}}]})}(n,0,t,a,o);e&&(ye.Z(),await function(e){const{integration:t,tokenDetails:n,environment:o,externalObjectInstanceBlockStore:r,botId:i}=e;if(t.id===d.YM)return async function(e,t){const{access_token:n}=e;try{await(0,K.ZP)("https://cdn01.boxcdn.net/polyfills/core-js/2.5.3/core.min.js",{resourceType:K._g.Javascript});const e=[{url:"https://cdn01.boxcdn.net/platform/elements/15.0.0/en-US/picker.js",resourcetype:K._g.Javascript},{url:"https://cdn01.boxcdn.net/platform/elements/15.0.0/en-US/picker.css",resourcetype:K._g.Stylesheet}];await Promise.all(e.map((e=>{let{url:t,resourcetype:n}=e;return(0,K.ZP)(t,{resourceType:n})})))}catch(a){return void t(!0,"")}const o=document.createElement("div");o.setAttribute("id","box-app-container"),document.body.appendChild(o);const r=new Box.FilePicker;r.show("0",n,{size:"small",container:"#box-app-container",maxSelectable:1,logoUrl:"box"});const i=()=>{r.hide(),o.remove()};r.addListener("choose",(function(e){var n;const o=null==e||null===(n=e[0])||void 0===n?void 0:n.id;o&&t(!1,`https://app.box.com/file/${o}`),i()})),r.addListener("cancel",i)}(n,qe({environment:o,externalObjectInstanceBlockStore:r,botId:i}));if(t.id===d.f3)return(0,W.vE)({environment:o,accessToken:n.access_token,callback:qe({environment:o,externalObjectInstanceBlockStore:r,botId:i}),integration:t,from:"link_preview_placeholder"});return void function(){if(ke){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.warn("multiTextSelectionHelpers:",...t)}}(`no matching integration found for external file picker with integration ID ${t.id}}`)}({integration:t,environment:n,externalObjectInstanceBlockStore:r,externalObjectTokenStore:o,botId:a.id,tokenDetails:e}))}}}function qe(e){const{environment:t,externalObjectInstanceBlockStore:n,botId:o}=e;return(e,r)=>{if(e)return he.showDialog({message:Y.default.formatMessage(Ce.somethingWentWrong),showCancel:!0,keepFocus:!0,items:[{label:Y.default.formatMessage(Ce.copyDebuggingInformation),color:void 0,onAccept:()=>{const n={err:e,botId:o};D.RD({environment:t,stringValue:JSON.stringify(n,null,2),copiedMessage:Ce.copiedDebuggingInfo})}}]});We({environment:t,externalObjectInstanceBlockStore:n,url:r,botId:o})}}function He(){return z.default.checkGate({gateName:"is_visibility_enabled_for_db_sync"})}function Ge(e){const{environment:t,originRect:n,externalObjectInstanceBlockStore:o,integration:r}=e,i=[{type:"embed",onChange:n=>{We({environment:t,url:n,externalObjectInstanceBlockStore:o,placeholderIntegrationId:e.placeholderIntegrationId}),ye.Z()}}];if(z.default.checkGate({gateName:"ai_source_picker"})&&((null==r?void 0:r.id)===d.Gw||(null==r?void 0:r.id)===d.mC)){const n=(null==r?void 0:r.id)===d.Gw?"/images/external_integrations/github-icon.png":"/images/external_integrations/jira-icon.png";i.push({type:"aiSourcePicker",integration:null==r?void 0:r.id,defaultAvatar:n,onChange:n=>{We({environment:t,url:n,externalObjectInstanceBlockStore:o,placeholderIntegrationId:e.placeholderIntegrationId}),ye.Z()},getResults:async(e,n)=>await async function(e){const{environment:t,query:n,integrationId:o,botId:r}=e,i=r?[r]:re.Z.bots.state.filter((e=>e.integration_id===o)).map((e=>{let{id:t}=e;return t}));if(0===i.length)return{root:{error:{status_code:500,messages:["No bot found for this integration"]}},relations:[]};return await async function(e){const{environment:t,query:n,botIds:o}=e,r=await me.aiSourcePicker(t,{query:n,botIds:o,spaceId:ge.Bs()}),i="success"===r.type?r.data:{root:{error:{status_code:r.status}},relations:[]};return"failed"===r.type&&he.showError(r),i}({environment:t,query:n,botIds:i})}({environment:t,query:e,integrationId:n})})}if(r&&!t.device.isMobile){const n=je({integration:r,environment:t,externalObjectInstanceBlockStore:o,externalObjectTokenStore:e.externalObjectTokenStore});n&&i.push(n)}ye.$(t,{originGap:0,originRect:n,title:"Embed Link Preview",currentTab:"embed",tabs:i})}function We(e){const{environment:t,url:n,externalObjectInstanceBlockStore:o,placeholderIntegrationId:r,botId:a}=e,s=(0,I.ny)({url:n,integrations:re.Z.integrations.state,currentSpaceId:o.getSpaceId()});if("success"===s.type){const{integration:e,pattern:r}=s,l=a?[a]:re.Z.bots.state.filter((t=>t.integration_id===e.id)).map((e=>{let{id:t}=e;return t}));if(l.length>0){const a=o.getParentId(),s=(0,c.x$)(n),{host:d}=(0,A.Qc)(s);d&&a&&(N.createAndCommit({userAction:"unfurlingActions.startUnfurlFromPlaceholder",environment:t,perform:e=>{F.sW({store:o,data:{type:i.Ti.externalObjectInstance},transaction:e}),F.sW({store:o.getFormatStore(),data:{original_url:n,domain:d},transaction:e})}}),pe._x(t,{integrationId:e.id,entity:r.name,domain:d,from:"placeholder"})),Ze({environment:t,url:n,botIds:l,integrationId:e.id,externalObjectInstanceBlockStore:o})}else N.createAndCommit({userAction:"unfurlingActions.startUnfurlFromPlaceholder",environment:t,perform:e=>{F.sW({store:o.getFormatStore(),data:{integration_id:null,original_url:n,is_placeholder:null},transaction:e})}})}else if("partial"===s.type){const{integration:e}=s;N.createAndCommit({userAction:"unfurlingActions.startUnfurlFromPlaceholder",environment:t,perform:t=>{F.sW({store:o.getFormatStore(),data:{is_placeholder:null,integration_id:e.id,original_url:n,error:{status_code:m.Rl.UNPROCESSABLE_ENTITY}},transaction:t})}})}else"failure"===s.type?N.createAndCommit({userAction:"unfurlingActions.startUnfurlFromPlaceholder",environment:t,perform:e=>{F.sW({store:o.getFormatStore(),data:{is_placeholder:null,original_url:n,integration_id:r,error:{status_code:m.Rl.UNPROCESSABLE_ENTITY}},transaction:e})}}):(0,P.t1)(s)}function $e(e){return e&&Object.entries(e).flatMap((e=>{let[t,n]=e;return(0,s.HF)(t)?[]:"hidden"===(null==n?void 0:n.visibility)?{property:`${a.U}${t}`,visible:!1}:{property:`${a.U}${t}`,visible:!0}}))}function Ye(e){const{environment:t,block:n,transaction:o}=e;if(!n.isDefined()||!ue.M_(t)||!n.isType(i.Ti.externalObjectInstance))return;const r=(0,$.TS)({environment:t,table:h.iU,spaceId:n.getSpaceId()}),a=F.j4({environment:t,id:r,type:i.Ti.externalObjectInstance,spaceId:n.getSpaceId(),format:n.getFormat(),inMemoryRecordCache:n.inMemoryRecordCache,transaction:o,useCrdt:n.useCrdt()});F.sW({store:a,data:{parent_id:n.id,parent_table:n.table,alive:!0},transaction:o});const s=n.getFormatStore().getKeyStore("related_external_object_uris_to_instance_ids").getValue();if(s)for(const i of Object.values(s)){const e={table:h.iU,id:i,spaceId:n.getSpaceId()};N.applyOperation({store:(0,se.Kv)(n,e),operation:{pointer:e,path:[],command:"update",args:{parent_table:h.iU,parent_id:r}},transaction:o})}const c=[(0,x.YCD)((0,x.x36)(r))];F.sW({store:n,data:{type:i.Ti.text},transaction:o}),U.sO({environment:t,store:n.getBlockTitleStore(),value:c,transaction:o});const d=l.nY(n.getFormat());F.sW({store:n.getFormatStore(),data:(0,R.Q8)(d,(()=>null)),transaction:o})}function Qe(e){var t;const{block:n,transaction:o,token:r,parentStore:i}=e,{tokenIndex:a}=r;if(!n.isDefined())return;const s=null===(t=i.getParentBlockStore())||void 0===t?void 0:t.getContentStore();if(!s)return;U.gy({block:i,editorMode:"default",transaction:o,tokenIndex:a})&&E.BE({parentStore:s,insertStore:n,afterStore:i,transaction:o})}function Je(e){const{environment:t,spaceId:n,from:o,store:r,bypassCache:i}=e,a=(0,G.y6)(r),s=(null==a?void 0:a.original_url)||(null==a?void 0:a.uri);if(!s)return;const l=(0,G.GQ)(s,n),c=(0,G.Ue)(s,n);if(!l||0===c.length)return;const u=r.getCollectionViewCollectionStore(),{integration:p,pattern:m}=l;if(r.isCollectionView()&&u)me.refetchExternalObjectInstanceBlocks(t,{recordPointers:[{...u.pointer,spaceId:n}],bypassCache:i});else if(r.isExternalObjectInstancePageBlockStore()){d.tO.includes(p.id)?Ze({environment:t,url:s,botIds:c.map((e=>{let{id:t}=e;return t})),integrationId:p.id,externalObjectInstanceBlockStore:r}):me.refetchExternalObjectInstanceBlocks(t,{recordPointers:[{...r.pointer,spaceId:n}],bypassCache:i})}else r.isExternalObjectInstanceBlockStore()&&Ze({environment:t,url:s,botIds:c.map((e=>{let{id:t}=e;return t})),integrationId:p.id,externalObjectInstanceBlockStore:r});pe.B3(t,{integrationId:p.id,entity:m.name,from:o})}},977357:(e,t,n)=>{n.d(t,{Q7:()=>j,rX:()=>K,A3:()=>J,Xo:()=>N,nQ:()=>V,dm:()=>ie,K_:()=>ee,y:()=>Q,cR:()=>Y,W8:()=>X,yM:()=>H,cT:()=>q,IL:()=>L});n(21703),n(757658);var o=n(415095),r=n(643593),i=n(480632),a=n(568626),s=n(471924),l=n(23867),c=n(421838),d=n(182798),u=n(709291),p=n(657347),m=n(653965),g=n(937850),f=n(940470),h=n(602013),v=n(619584),y=n(855337),b=n(772770),_=n(833954),S=n(433929),k=n(352533),w=n(402414),x=n(385555),I=n(421051),C=n(453730),T=n(691551),M=n(188923),P=n(88893),A=n(535057),R=n(288280),D=n(476870);class B{constructor(e){this.environment=void 0,this.startTime=void 0,this.partialTime=void 0,this.bytesSuccessfullySent=void 0,this.curatedFileType=void 0,this.shouldReportMetrics=void 0,this.environment=e.environment,this.startTime=e.startTime,this.partialTime=e.startTime,this.bytesSuccessfullySent=0,this.curatedFileType=this.getCuratedFileType(e.fileType),this.shouldReportMetrics="image"===this.curatedFileType&&(0,D.lB)(1);const t=B.getCuratedFileSize(e.fileSize);(0,y.j)({environment:this.environment,event:{eventName:"client.file_upload.file_stats",eventProperties:{size:t,type:this.curatedFileType}}}),this.shouldReportMetrics&&(0,y.j)({environment:this.environment,event:{eventName:"client.file_upload.upload_session_start",eventProperties:{}}})}getCuratedFileType(e){return e?e.includes("image")?"image":"other":"unknown"}reportPermissionCheckCompleted(e){if(!this.shouldReportMetrics)return;const t=e.timeNow-this.partialTime;(0,y.j)({environment:this.environment,event:{eventName:"client.file_upload.latency_permission_check",eventProperties:{latency:t}}}),this.partialTime=e.timeNow}reportGetSignedUrlCompleted(e){if(!this.shouldReportMetrics)return;const t=e.timeNow-this.partialTime;(0,y.j)({environment:this.environment,event:{eventName:"client.file_upload.latency_get_signed_url",eventProperties:{latency:t,success:e.success}}}),this.partialTime=e.timeNow}updateProgress(e){this.bytesSuccessfullySent=e.bytesSuccessfullySent}startNewAttempt(e){this.partialTime=e.timeNow,this.bytesSuccessfullySent=0}reportAttemptFinished(e){if(!this.shouldReportMetrics)return;const t=e.timeNow-this.partialTime;(0,y.j)({environment:this.environment,event:{eventName:"client.file_upload.latency_attempt",eventProperties:{latency:t,success:e.success,attempt:e.retryCount}}}),this.partialTime=e.timeNow,e.success||(0,y.j)({environment:this.environment,event:{eventName:"client.file_upload.failed_attempt_progress",eventProperties:{progress:this.bytesSuccessfullySent}}})}reportUploadSessionEnd(e){let{timeNow:t,status:n,errorCode:o=-1}=e;if(!this.shouldReportMetrics)return;(0,y.j)({environment:this.environment,event:{eventName:"client.file_upload.upload_session_end",eventProperties:{status_code:o,status:n}}});const r=t-this.startTime;(0,y.j)({environment:this.environment,event:{eventName:"client.file_upload.latency_e2e",eventProperties:{latency:r,status:n}}})}static getCuratedFileSize(e){return e<0?-1:Math.pow(2,Math.ceil(Math.log2(e)))}}var E=n(757549),F=n(21359),Z=n(135253);const U=(0,u.defineMessages)({uploadFileFailed:{defaultMessage:"Upload failed.",id:"uploadActions.uploadFailedError.message"}});function V(e){return e.filter((e=>e.getAlive())).map((e=>{const{source:t,title:n,size:o}=e.getProperties()||{};return{type:"remote",id:e.id,source:c.QaF(t),name:c.QaF(n),size:c.QaF(o),store:e}}))}function N(e){return{...O(e),id:s.Il(),dataURL:URL.createObjectURL(e),type:"local"}}function O(e){return{file:e,name:e.name,size:`${(e.size/1024).toFixed(1)}KB`}}function L(e){var t;const n=e.files.map(O);null===(t=e.onBatchStart)||void 0===t||t.call(e,n);const o={};let r=0;g.jl(e.files,ne,(t=>Promise.all(t.map((t=>{const n=s.Il();return new Promise(((i,a)=>{const s={environment:e.environment,..."secure"===e.bucket?{bucket:e.bucket,record:e.record}:{bucket:e.bucket},file:t,onStart:(t,o)=>{var r;null===(r=e.onSingleFileStart)||void 0===r||r.call(e,t,n,o)},onProgress:t=>{var o,i;let{progressPercent:a,uploadedFiles:s}=t;null===(o=e.onBatchProgress)||void 0===o||o.call(e,{progressPercent:a,uploadedFiles:r}),null===(i=e.onSingleFileProgress)||void 0===i||i.call(e,{progressPercent:a,uploadedFiles:s},n)},onComplete:a=>{var s;r++,o[t.name]=a,null===(s=e.onSingleFileComplete)||void 0===s||s.call(e,a,n),i()},onError:t=>{var o;const r=new Error(t.message);null===(o=e.onSingleFileError)||void 0===o||o.call(e,r,n),a(r)},preventLimitFreeFileSize:e.preventLimitFreeFileSize,importFileUploadType:e.uploadType,formMetadata:e.formMetadata};"confluence"===e.uploadType||"genericImporter"===e.uploadType?async function(e){const{environment:t,file:n,preventLimitFreeFileSize:o}=e,r=n.type||"text/plain; charset=utf-8";if(j({preventLimitFreeFileSize:o,environment:t,file:n})){var i;null===(i=e.onStart)||void 0===i||i.call(e,O(n));const o=Math.floor(n.size/z)+1,d={bucket:e.bucket,name:n.name,contentType:r,supportExtraHeaders:!0,contentLength:n.size,numberOfFileChunks:o},u=await F.initiateMultipartUpload(t,d);var a;if("failed"===u.type)return void(null===(a=e.onError)||void 0===a||a.call(e,{message:u.error.message,offline:u.offline}));const g=await async function(e){const{file:t,signedUrlsForChunks:n}=e,o=[];let r,i,a,s=[];const l=[];for(let p=0;p<n.length;p++){r=p*z,i=(p+1)*z,a=p+1<n.length?t.slice(r,i):t.slice(r);const e=n[p],s=fetch(e,{method:"PUT",body:new Blob([a],{type:t.type})});o.push(s)}const c=m.yo(o,3);for(const[m,g]of c.entries()){var d;try{const e=await(0,h.Yb)((()=>Promise.all(g)),[100,1e3,3e3]);s=[...s,...e]}catch(u){return{error:(0,p.t)(u)}}null===(d=e.onProgress)||void 0===d||d.call(e,{progressPercent:Math.floor(m/c.length*100),uploadedFiles:0})}return s.forEach(((e,t)=>{const n=e.headers.get("etag");n&&l.push({ETag:n,PartNumber:t+1})})),{value:l}}({file:n,signedUrlsForChunks:u.data.signedUrlsForChunks,onProgress:e.onProgress});var s;if(f.x.isFail(g))return void(null===(s=e.onError)||void 0===s||s.call(e,{message:g.error.message,offline:void 0}));const v={...d,multipartUploadEtags:g.value,fileKey:u.data.key,uploadId:u.data.uploadId},y=await F.completeMultipartUpload(t,v);var l,c;if("success"===y.type)null===(l=e.onComplete)||void 0===l||l.call(e,u.data.url);else null===(c=e.onError)||void 0===c||c.call(e,{message:y.error.message,offline:y.offline})}else J(e.environment)}(s):e.formMetadata&&"temporary"===s.bucket?async function(e){const{environment:t,file:n,formMetadata:o}=e;if(!o)return;const r=n.type||"text/plain; charset=utf-8",i={name:n.name,contentType:r,supportExtraHeaders:!0,contentLength:n.size,spaceId:o.spaceId,formId:o.formId},a=await F.getFormUploadFileUrl(t,i);if(e.onStart&&"success"===a.type){const t={fileName:n.name,token:a.data.token};e.onStart(O(n),t)}if("success"===a.type)try{const t=await $({getUploadFileUrlResponse:{...a,data:{...a.data,signedUploadPostUrl:a.data.signedPostUrl,signedGetUrl:"",type:"POST"}},file:n,fileType:r,onProgress:e.onProgress,retryCount:0});t.error?e.onError&&e.onError(t.error):e.onComplete&&e.onComplete(a.data.url)}catch(s){e.onError&&e.onError({message:"File transmission failed",offline:!1})}else if(e.onError){const t=(0,_.wf)(S.default.getIntl(),a);e.onError({message:t,offline:a.offline})}}(s):G({...s,retryImmediatelyAfterFailure:!1})}))}))))).then((()=>{var t;const n=e.files.map((e=>o[e.name]));null===(t=e.onBatchComplete)||void 0===t||t.call(e,n)})).catch((t=>{var n;"confluence"===e.uploadType&&E.a1(e.environment,{import_source:"confluence",data:{import_type:"file",status:"failure",error:t,fileSize:e.files[0].size},flowId:e.flowId}),null===(n=e.onBatchError)||void 0===n||n.call(e,t)}))}function j(e){const{preventLimitFreeFileSize:t,environment:n,file:o}=e,r=R.subscriptionDataStoreInstance.state;let i=!1;if(n.device.isMobileNative){const e="personal"===P.M9(n);i=!((0,k.S$)({environment:n})&&e)}return!(!t&&r&&P.Bu(r)&&!i&&o.size>te)}function K(e){const t=(0,r.mD)(e.name);if(!t||!(0,i.gR)(t))return{canUpload:!1,reason:"fileExtensionNotAllowed"};if(e.size<=0)return{canUpload:!1,reason:"fileSizeIsZero"};const n=(0,A.QM)()?i.KC:i.Ew;return e.size>n?{canUpload:!1,reason:"fileSizeTooLarge"}:{canUpload:!0}}const z=20971520;function q(e){const{retryWhenOffline:t,backoffController:n=new w.h(void 0)}=e,o=n.getFailures()>0;G({...e,isOfflineBackoffRetry:o,onComplete:t=>{var r;o&&x.default.logEvent("upload_offline_success_after_retries",n.getFailures()),null===(r=e.onComplete)||void 0===r||r.call(e,t)},onError:o=>{var r;if(t&&o.offline){if(x.default.checkGate({gateName:"autoretry_file_uploads"}))return void n.backOffOnFailure(10*v.C0).then((()=>{q({...e,backoffController:n})}));x.default.logEvent("upload_offline_failure")}null===(r=e.onError)||void 0===r||r.call(e,o)}})}function H(e){const{retryWhenOffline:t,environment:n,backoffController:o=new w.h(void 0)}=e;!async function(e){const{environment:t,file:n,preventLimitFreeFileSize:o}=e,r=performance.now();e.importFileUploadType&&E.y6(t,{type:e.importFileUploadType,uploadFileSizeBytes:n.size,fromAssistantUpload:!0});const i=n.type||"text/plain; charset=utf-8";if(j({preventLimitFreeFileSize:o,environment:t,file:n})){e.onStart&&e.onStart(O(n));const o=await F.getUploadFileUrlForAssistantChatTranscriptUpload(t,{name:n.name,contentType:i,assistantChatTranscriptSessionPointer:e.assistantChatTranscriptSessionPointer,contentLength:n.size});if("failed"===o.type){if(e.onError){const t=(0,_.wf)(S.default.getIntl(),o);e.onError({message:t,offline:o.offline})}return}return W({...e,getUploadFileUrlResponse:{...o,data:{...o.data,type:"POST"}},fileType:i,performanceStartTime:r,isFromAssistant:!0,retryImmediatelyAfterFailure:!1})}J(e.environment)}({...e,onComplete:(t,n)=>{var o;null===(o=e.onComplete)||void 0===o||o.call(e,t,n)},onStart:(t,o)=>{var r;null===(r=e.onStart)||void 0===r||r.call(e,t,o),(0,y.j)({environment:n,event:{eventName:"assistant_attachment_upload_started",eventProperties:{}}})},onError:r=>{var i;if(t&&r.offline)return(0,y.j)({environment:n,event:{eventName:"assistant_attachment_upload_retry",eventProperties:{}}}),void o.backOffOnFailure(10*v.C0).then((()=>{H({...e,backoffController:o})}));null===(i=e.onError)||void 0===i||i.call(e,r),(0,y.j)({environment:n,event:{eventName:"assistant_attachment_upload_failed",eventProperties:{message:r.message,offline:r.offline??!1}}})}})}async function G(e){const{environment:t,file:n,preventLimitFreeFileSize:o}=e,r=performance.now(),i=!e.isOfflineBackoffRetry&&e.reportRichUploadMetrics?new B({environment:t,fileType:n.type,fileSize:n.size,startTime:r}):void 0;e.importFileUploadType&&E.y6(t,{type:e.importFileUploadType,uploadFileSizeBytes:n.size});const a=n.type||"text/plain; charset=utf-8",s=j({preventLimitFreeFileSize:o,environment:t,file:n}),c=performance.now();if(null==i||i.reportPermissionCheckCompleted({timeNow:c}),!s)return null==i||i.reportUploadSessionEnd({timeNow:c,status:"no_permission"}),void J(e.environment);e.onStart&&e.onStart(O(n));const d="secure"===e.bucket?{bucket:e.bucket,name:n.name,contentType:a,record:{table:e.record.table,id:e.record.id,spaceId:(0,l.C)(e.record.spaceId)},supportExtraHeaders:!0,contentLength:n.size}:{bucket:e.bucket,name:n.name,contentType:a,supportExtraHeaders:!0,contentLength:n.size};"secure"===e.bucket&&await C.transactionQueue.awaitRecordTransaction(e.record);const u=await F.getUploadFileUrl(t,d);null==i||i.reportGetSignedUrlCompleted({timeNow:performance.now(),success:"success"!==u.type});return W({...e,getUploadFileUrlResponse:u,fileType:a,performanceStartTime:r,fileUploadsAnalyticReporter:i})}async function W(e){const{getUploadFileUrlResponse:t,isFromAssistant:n,file:o,performanceStartTime:r,environment:i,fileUploadsAnalyticReporter:s}=e;if("success"!==t.type){if(e.onError){const n=(0,_.wf)(S.default.getIntl(),t);e.onError({message:n,offline:t.offline})}return}const{url:l,signedGetUrl:c}=t.data,d=function(e){if(e.isOfflineBackoffRetry)return!1;if(x.default.checkGate({gateName:"uploads_retry_all_immediately"}))return!0;return e.retryImmediatelyAfterFailure}(e);try{d?await(0,h.XD)({fn:(n,o)=>$({getUploadFileUrlResponse:t,file:e.file,fileType:e.fileType,onProgress:e.onProgress,retryCount:o,fileUploadsAnalyticReporter:s}),handleError:()=>({status:"retry"}),retryAttemptsMS:[1e3,2e3,4e3],retryAttemptRandomOffsetMS:200,initialInput:void 0}):await $({getUploadFileUrlResponse:t,file:e.file,fileType:e.fileType,onProgress:e.onProgress,retryCount:0,fileUploadsAnalyticReporter:s})}catch(p){if((0,v.hj)(p)){var u;null==s||s.reportUploadSessionEnd({timeNow:performance.now(),errorCode:p,status:"error"});const t={message:S.default.formatMessage(U.uploadFileFailed),offline:0===p};null===(u=e.onError)||void 0===u||u.call(e,t)}else null==s||s.reportUploadSessionEnd({timeNow:performance.now(),status:"error"}),console.log("failed to upload file ",p);return}if(null==s||s.reportUploadSessionEnd({timeNow:performance.now(),status:"success"}),e.onComplete&&(e.onComplete(l,c),a.log({level:"info",from:"uploadActions",type:"ClientUploadSuccess",data:{miscDataToConvertToString:{url:l}}}),e.importFileUploadType)){const t=performance.now()-r;E.lC(i,{type:e.importFileUploadType,totalTimeMs:t});const a=t/1e3,s=o.size/a,l=o.size/1048576,c=l<=10?"lt10MB":l>10&&l<=100?"lt100MB":"gt100MB";E.tc(i,{type:e.importFileUploadType,size:c,file_upload_latency:s,from_assistant_upload:Boolean(n)})}}async function $(e){const{getUploadFileUrlResponse:t,file:n,fileType:o,onProgress:r,retryCount:i,fileUploadsAnalyticReporter:s}=e;null==s||s.startNewAttempt({timeNow:performance.now()});const{type:l,url:c}=t.data;(0,d.T)("success"===t.type);const u=g.UZ(),p=new XMLHttpRequest;if(p.upload.addEventListener("progress",(e=>{if(!e.lengthComputable)return;null==s||s.updateProgress({bytesSuccessfullySent:e.loaded});const t=Math.round(100*e.loaded/e.total);null==r||r({progressPercent:t,uploadedFiles:0,isNetworkUnreliable:!!i&&i>0})})),p.onreadystatechange=function(){if(p.readyState!==XMLHttpRequest.DONE)return;const e=200===p.status||204===p.status;null==s||s.reportAttemptFinished({timeNow:performance.now(),retryCount:i,success:e}),e?u.resolve({value:c}):(a.log({level:"error",from:"uploadActions",type:"ClientUploadError",data:{miscDataToConvertToString:{status:p.status,responseText:p.responseText}}}),u.reject(p.status))},"POST"===l){const e=t.data.postHeaders,o=t.data.signedUploadPostUrl;p.open(l,o);for(const t of e)p.setRequestHeader(t.name,t.value);const r=new FormData;for(const n in t.data.fields)r.append(n,t.data.fields[n]);r.append("file",n),p.send(r)}else{const e=t.data.putHeaders,r=t.data.signedPutUrl;p.open(l,r);for(const t of e)p.setRequestHeader(t.name,t.value);p.setRequestHeader("Content-Type",o),p.send(n)}return u.promise}function Y(e){re({...e,onChange:t=>{if(!t.files||0===t.files.length)return;const n=Array.from(t.files);L({environment:e.environment,files:n,..."secure"===e.bucket?{bucket:e.bucket,record:e.record}:{bucket:e.bucket},onBatchStart:e.onStart,onBatchProgress:e.onProgress,onBatchComplete:e.onComplete,onBatchError:e.onError,preventLimitFreeFileSize:e.preventLimitFreeFileSize})}})}async function Q(e){const t=g.UZ();return re({...e,onChange:e=>{const n=o.p4(e.files);t.resolve(n)}}),t.promise}function J(e){Z.Bw({bannerStore:M.default.state.open?T.Z:I.Z,id:"SubscriptionEditingBlocker",styleKey:b.v.Red,contentKey:"upload_limit_exceeded"})}function X(){Z.qL({bannerStore:I.Z,id:"SubscriptionEditingBlocker"}),Z.qL({bannerStore:T.Z,id:"SubscriptionEditingBlocker"})}const ee=5,te=1e6*ee,ne=5;let oe;function re(e){oe&&oe.remove(),oe=document.createElement("input"),oe.type="file",oe.style.opacity="0",oe.style.pointerEvents="none",oe.style.position="fixed",oe.style.left="-1000px",oe.style.top="-1000px",oe.ariaHidden="true",document.body.appendChild(oe),e.multiple?oe.setAttribute("multiple",""):oe.removeAttribute("multiple"),e.accept&&oe.setAttribute("accept",e.accept),oe.addEventListener("change",(()=>{e.onChange&&e.onChange(oe)})),oe.addEventListener("blur",(()=>{e.onBlur&&e.onBlur(oe)})),oe.addEventListener("click",(e=>{e.stopPropagation()})),oe.click(),oe.focus({preventScroll:!0})}function ie(e){return e.filter(ae).map((e=>e.file))}function ae(e){return"local"===e.type}},970782:(e,t,n)=>{n.d(t,{f:()=>b,x:()=>y});var o=n(687997),r=n(815145),i=n(109852),a=n(554153),s=n(275754),l=n(512955),c=n(787381),d=n(32223),u=n(555081),p=n(775538),m=n(80444),g=n(385555),f=n(206258),h=n(696454),v=n(497977);async function y(e){const{newCurrentUserId:t,loggedOutUserId:n,environment:r}=e;await v.setLocalStorageUserId(r,t),(0,i.xj)(t),await l.setCookie(r,{name:"notion_user_id",value:t});const s=r.currentUser.loggedInUserIds.filter((e=>e!==n)),m=await l.getGhostAdminUserId(r),f={...r,currentUser:new o.CurrentUser({id:t,loggedInUserIds:s,adminUserId:m})};if(r.updateCurrentUserId){const e={environment:r,currentUserId:t,userIds:s};"on"!==g.default.getGroup("await-update-user-id")?await r.updateCurrentUserId(e):r.updateCurrentUserId(e)}a.Z.set(c.currentUserIdKey,t),d.resetRecordSubscriptions(),p.default.reset();return await u.zJ(r)&&u.yH(f),await h.KJ(f,t),f}async function b(e){const{newCurrentUserId:t,environment:n,store:o}=e,{mainEditorCurrentBlockStore:i}=m.default.state,a=await y({environment:n,newCurrentUserId:t});if(i){const e=new f.G(a,o.pointer);m.default.setState({...m.default.state,mainEditorCurrentBlockStore:void 0}),s._c({environment:a,store:e,pageVisitSource:r.tY.SwitchSpace})}}},712321:(e,t,n)=>{n.d(t,{j:()=>y,w:()=>b});n(21703),n(757658);var o=n(915157),r=n(145953),i=n(421202),a=n(475246),s=n(577858),l=n(766079),c=(n(95477),n(145950)),d=n(562449),u=n(205659),p=n(588310),m=n(788632),g=n(385555),f=n(729226),h=n(21359),v=n(504408);function y(e,t){!function(){_&&m.Z.removeListener(_);f.Z.reset()}();const n=new AbortController;!async function(e){const{environment:t,userId:n,abortSignal:o}=e,i=await u.A.measure("loadUserContent","(current user)",(()=>async function(e){const{environment:t,abortSignal:n}=e,{defaultRecordCache:o,currentUser:r}=t;if(!o.persistedRecordCache)return;const i=r.id;if(!i)return;const d=[],u=await c.yY({environment:t,recordPointers:[{table:l.dx,id:i}],recurFn:e=>{const t=[],n=e=>{e&&(e.table!==s.zU&&e.table!==l.dx||d.push(e),t.push(e))};return e.table===l.dx?(n(e.getUserPointer()),e.getSpaceViewPointers().forEach(n)):e.table===s.zU?(e.getBookmarkedPagePointers().forEach(n),e.getSharedPagePointers().forEach(n),e.getSharedPagesManualSortPointers().forEach(n),n(e.getSpacePointer())):e.table===a.bx&&e.getPagePointers().forEach(n),t},recordIsRequired:e=>e.table===l.dx||e.table===s.zU});if(n.aborted)return;for(const a of d){const e=u.getModel(a);if(u.getRole(a)&&!e)return void 0}return{recordMap:u.toJson({allowVersionDowngrade:!1})}}({environment:t,abortSignal:o})));if(!i)return;if(o.aborted)return;const d=r.PF.create(i.recordMap);v.fL({environment:t,inMemoryRecordCache:t.defaultRecordCache.inMemoryRecordCache,recordMap:d,debugSource:"fetchLocalUserContent"}),f.Z.setState({...f.Z.state,localSpaceInaccessiblePages:k(d,n)}),f.Z.state.readyPromise.resolve()}({environment:e,userId:t,abortSignal:n.signal}),S(e).then((()=>{n.abort()}));let o=m.Z.state.online;_=()=>{const t=m.Z.state.online;!t||o||f.Z.state.remoteSpaceInaccessiblePages||S(e),o=t},m.Z.addListener(_)}async function b(){await f.Z.state.readyPromise.promise}let _;async function S(e){const t=e.currentUser.id,n=g.default.checkGate({gateName:"multi_cell_aware_apis"});if(o.Z.set({userId:e.currentUser.id,key:(0,d.O)("prefetchGetSpaces"),value:n}),n){p.$L("await_get_spaces_end");const n=h.getSpacesMultiCell({environment:e,data:{},headers:{},prefetchCacheKey:"getSpaces"}),o={};for await(const e of n){if("success"!==e.type)throw new Error("Request failed");const t=e.data;for(const[e,n]of Object.entries(t.users))o[e]??=[],o[e].push(r.PF.create(n))}p.$L("await_get_spaces_end");for(const[i,a]of Object.entries(o)){const n=r.PF.merge(a);v.fL({environment:e,userId:i,inMemoryRecordCache:e.defaultRecordCache.inMemoryRecordCache,recordMap:n,debugSource:"fetchAllUserSpaces"}),i===t&&(f.Z.setState({...f.Z.state,remoteSpaceInaccessiblePages:k(n,i)}),f.Z.state.readyPromise.resolve())}}else{p.$L("await_get_spaces_start");const n=await h.getSpaces(e,{},void 0,void 0,void 0,"getSpaces");if(p.$L("await_get_spaces_end"),"success"!==n.type)throw n.error;for(const[o,i]of Object.entries(n.data)){const n=r.PF.create(i);v.fL({environment:e,userId:o,inMemoryRecordCache:e.defaultRecordCache.inMemoryRecordCache,recordMap:n,debugSource:"fetchAllUserSpaces"}),o===t&&(f.Z.setState({...f.Z.state,remoteSpaceInaccessiblePages:k(n,o)}),f.Z.state.readyPromise.resolve())}}}function k(e,t){const n={};for(const{pointer:o}of e.getByTable(a.bx)){const r=o.id,s=e.getValue({table:a.bx,id:r});if(s){const o=new Set;if(s.pages){for(const t of s.pages){e.getValue({table:i.iU,id:t})||o.add(t)}n[t]||(n[t]={}),n[t][r]=o}}}return n}},139634:(e,t,n)=>{n.d(t,{aw:()=>_,j_:()=>y,zm:()=>b});var o=n(313991),r=n(568626),i=n(924211),a=n(246074),s=n(95477),l=n(855337),c=n(721429),d=n(679897),u=n(433929),p=n(258455),m=n(80444),g=n(385555),f=n(288280),h=n(225888),v=n(412714);function y(e){const{environment:t,from:n}=e;h.Ot(t,{from:n});const i=p.default.state;if(t.device.isMobileNative){const e=(0,c.B7)(t),n=`${t.device.os} v${t.device.mobileAppVersion}(${t.device.version})`,o="team@makenotion.com",r=`Help with my account ${null==e?void 0:e.getEmail()} on ${n}`,i=()=>{const e=encodeURIComponent(r);v.D({environment:t,url:`mailto:${o}?subject=${e}`})},a=t.mobileNative;a&&a.api.submitUserFeedback?a.submitUserFeedback({sendToEmailAddress:o,subject:r},i):i()}else if(i.isZendeskEnabled&&(0,l.Ug)()){const{userHighestPlanType:n,isSalesAssistedPlan:s}=(0,d.rf)(t);g.default.checkGate({gateName:"decagon_launch"})?(0,a.g)({type:"decagon",locale:o.locale,analyticsSettings:i,decagonInitializeArgs:_({environment:t,isSalesAssistedPlan:s}),onError:e=>{r.log({level:"error",from:"decagonHelpers",type:"initializeDecagon",error:{message:e.message}})},userHighestPlanType:n,isSalesAssistedPlan:s,cookieService:t.cookieService,initialQuery:e.prepopulatedContent}):(0,a.g)({type:"forethought",locale:o.locale,analyticsSettings:i,forethoughtInitializeArgs:b(t),userHighestPlanType:n,isSalesAssistedPlan:s,cookieService:t.cookieService,initialQuery:e.prepopulatedContent,onError:e=>{r.log({level:"error",from:"forethoughtHelpers",type:"initializeForethought",error:{message:e.message}})}}),h.LS(t)}}function b(e){var t,n,o;const r=u.default.getIntl(),a=null===(t=m.default.state.currentUserStore)||void 0===t?void 0:t.getModel(),s=a?a.getFullName(r)??"":void 0,l=null===(n=f.subscriptionDataStoreInstance.state)||void 0===n?void 0:n.subscriptionTier,c=(null===(o=m.default.state.currentUserSettingsStore)||void 0===o||null===(o=o.getSettings())||void 0===o?void 0:o.preferred_locale)||i.al;return{fullName:s,email:(null==a?void 0:a.getEmail())??"",planType:l,locale:c,cookieService:e.cookieService}}function _(e){var t,n,o,r,a;const l=e.environment,c=u.default.getIntl(),d=null===(t=m.default.state.currentUserStore)||void 0===t?void 0:t.getModel(),p=(null===(n=m.default.state.currentSpaceViewStore)||void 0===n||null===(n=n.getModel())||void 0===n?void 0:n.getSpaceId().toString())??"",g=l.currentUser.id??"",h=(null==d?void 0:d.getFullName(c))??"",v=(null==d?void 0:d.getEmail())??"",y=null===(o=m.default.state.currentSpaceStore)||void 0===o?void 0:o.getRole(),b=null===(r=f.subscriptionDataStoreInstance.state)||void 0===r?void 0:r.subscriptionTier,_=(null===(a=m.default.state.currentUserSettingsStore)||void 0===a||null===(a=a.getSettings())||void 0===a?void 0:a.preferred_locale)||i.al,S=_.split("-")[0],k=_.split("-")[1];return{planType:b,workspaceId:p,userId:g,userName:h,email:v,userAccessLevel:y,locale:_,language:S,countryCode:k,appVersion:`Notion v${s.default.version}${l.device.desktopAppVersion?` desktop v${l.device.desktopAppVersion}`:""}${l.device.mobileAppVersion?` mobile v${l.device.mobileAppVersion}`:""}`,platform:l.device.deviceType,salesAssistedPlan:e.isSalesAssistedPlan}}},801742:(e,t,n)=>{n.d(t,{BW:()=>f,GD:()=>g,sA:()=>h,uO:()=>y});n(757658);var o=n(568626),r=n(476870),i=n(619584),a=n(268056),s=n(385555),l=n(924666),c=n(10910);const d=!1,u=15*i.C0,p={user_flow_edit_block:.005,user_flow_edit_page_title:.01,user_flow_create_block:.01,user_flow_delete_block:.01};function m(e){if(d)return!0;const t=p[e];if(void 0!==t)return(0,r.aw)(t);const n=s.default.getConfigKey("event_trail_events",e);if("object"==typeof n&&"number"==typeof n.sampleRate)return(0,r.aw)(n.sampleRate);const o=s.default.getConfigKey("event_trail_events","defaultSampleRateUserFlows");return"number"==typeof o&&(0,r.aw)(o)}class g{constructor(e){this.stage=void 0,this.timeout=void 0,this.error=void 0,this.logDataInCaseOfFailure=void 0,this.postFinishCallbacks=[],this.environment=void 0,this.userFlow=void 0,this.entryPointName=void 0,this.handleTimeout=()=>{this.fail("timeout")};const{environment:t,userFlow:n,entryPointName:o,timeoutMs:r}=e;this.environment=t,this.userFlow=n,this.entryPointName=o;e.isEnabled??m(n)?(this.stage="inProgress",this.timeout=window.setTimeout(this.handleTimeout,r??u),this.debugLog("constructed")):this.stage="disable"}isDisabled(){return"disable"===this.stage}updateLogDataInCaseOfFailure(e){this.logDataInCaseOfFailure={...this.logDataInCaseOfFailure,...e}}succeed(){"inProgress"===this.stage&&this.finish("success")}fail(e){"inProgress"===this.stage&&(this.error=e,this.finish("fail"))}finish(e){this.stage=e,this.debugLog("finish"),"number"==typeof this.timeout&&window.clearTimeout(this.timeout),this.timeout=void 0,c.rT(this.environment,this.userFlow,{status:e,error:this.error,entryPointName:this.entryPointName}),"fail"===e&&o.log({level:"error",from:"userFlowActions",type:"userFlowFailed",data:{userFlow:this.userFlow,userFlowEntrypointName:this.entryPointName,userFlowError:this.error,...this.logDataInCaseOfFailure}});for(const t of this.postFinishCallbacks)t()}debugLog(){if(d){const o=this.entryPointName?`${this.userFlow}.${this.entryPointName}`:this.userFlow;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.groupCollapsed(`${this.constructor.name} ${o} stage=${this.stage}`,...t),console.trace(),console.groupEnd()}}}class f extends g{constructor(e){super(e),this.pointer=void 0,this.succeedOnEnqueue=void 0,this.trackCallbacks=[];const{succeedOnEnqueue:t}=e;this.succeedOnEnqueue=t}track(e,t){if("inProgress"===this.stage&&void 0===this.pointer){this.pointer=e,v({tracker:this,transaction:t,succeedOnEnqueue:this.succeedOnEnqueue});for(const e of this.trackCallbacks)e();this.debugLog("track",e.id)}}}class h extends f{constructor(e,t){super({environment:e,userFlow:"user_flow_create_page",entryPointName:t,succeedOnEnqueue:!1}),this.handleTextSelectionChange=e=>{"inProgress"===this.stage&&this.pointer&&"editing"===e.state.mode&&(0,a.qS)(e.state.multiSelection)&&e.state.multiSelection.start.store.pointer.id===this.pointer.id&&this.succeed()},"inProgress"===this.stage&&this.trackCallbacks.push((()=>{l.default.addListener(this.handleTextSelectionChange),this.postFinishCallbacks.push((()=>{l.default.removeListener(this.handleTextSelectionChange)}))}))}}function v(e){const{tracker:t,transaction:n,succeedOnEnqueue:o}=e;"inProgress"===t.stage&&(t.updateLogDataInCaseOfFailure({transactionId:n.id,transactionUserAction:n.getUserActionForAnalyticsPurposesOnly()}),n.annotateWithUserFlow(t.userFlow),n.postCancelCallbacks.push((()=>{t.fail("cancelled_transaction")})),n.postEnqueueActions.push((()=>{n.isEmpty()?t.fail("empty_transaction"):o&&t.succeed()})))}function y(e,t,n,o){if(!m(t))return;v({tracker:new g({environment:e,userFlow:t,isEnabled:!0,entryPointName:o}),transaction:n,succeedOnEnqueue:!0})}},237181:(e,t,n)=>{n.d(t,{B1:()=>I,Be:()=>M,GK:()=>y,MQ:()=>x,N0:()=>P,Nb:()=>h,Q:()=>T,Y:()=>w,Zf:()=>g,ay:()=>A,d1:()=>k,d2:()=>m,dM:()=>b,f1:()=>S,f7:()=>C,fG:()=>p,g2:()=>_,rx:()=>f,zq:()=>v});n(757658);var o=n(730120),r=n(779946),i=n(842875),a=n(95477),s=n(215010),l=n(80444),c=n(206258),d=n(709953),u=n(210228);async function p(e){if(a.default.isAdminMode)return;const{currentUserSettingsStore:t}=l.default.state;if(!t)return;await t.load();const n=t.getSettings();if(!n)return;const{device:o}=e,r={};(0,i.r)()!==n.time_zone&&(r.time_zone=(0,i.r)()),o.isDesktopBrowser&&!n.used_desktop_web_app&&(r.used_desktop_web_app=!0),o.isMobileBrowser&&!n.used_mobile_web_app&&(r.used_mobile_web_app=!0),o.isElectron&&o.isMac&&!n.used_mac_app&&(r.used_mac_app=!0),o.isElectron&&o.isWindows&&!n.used_windows_app&&(r.used_windows_app=!0),o.isMobileNative&&o.isIOS&&!n.used_ios_app&&(r.used_ios_app=!0),o.isMobileNative&&o.isAndroid&&!n.used_android_app&&(r.used_android_app=!0),Object.keys(r).length>0&&u.createAndCommit({userAction:"userSettingsActions.updateUserSettingsOnReset",environment:e,perform:e=>{m({userSettingsStore:t,data:r,transaction:e})}})}function m(e){const{userSettingsStore:t,data:n,transaction:o}=e;d.sW({store:t.getSettingsStore(),data:n,transaction:o})}function g(e){u.createAndCommit({userAction:"userSettingsActions.setStartWeekToMonday",environment:e,perform:e=>{const{currentUserSettingsStore:t}=l.default.state;t&&m({userSettingsStore:t,data:{start_day_of_week:1},transaction:e})}})}function f(e){u.createAndCommit({userAction:"userSettingsActions.setStartWeekToSunday",environment:e,perform:e=>{const{currentUserSettingsStore:t}=l.default.state;t&&m({userSettingsStore:t,data:{start_day_of_week:0},transaction:e})}})}function h(e){const{transaction:t,userSettingsStore:n,spaceId:o,type:r}=e;d.sO({store:(0,c._J)(n,n.pointer,["settings","sidebar_outliner_settings",o,r,"has_pinned"]),value:!0,transaction:t})}function v(e){var t;const n=null===(t=l.default.state.currentSpaceStore)||void 0===t?void 0:t.id,o=l.default.state.currentUserSettingsStore,{collectionId:r,dbType:i,transaction:a}=e;if(n&&o){var s,c;const e=(null===(s=o.getSettings())||void 0===s?void 0:s.lastUsedTypedCollections)||{},t=(null===(c=o.getSettings())||void 0===c?void 0:c.lastUsedDatabases)||{},l=e[n]||{},d=t[n]||[],u=i?l[i]??[]:[],p=[r,...u.filter((e=>e!==r))].slice(0,2),g=[r,...d.filter((e=>e!==r))].slice(0,5);m({userSettingsStore:o,transaction:a,data:{lastUsedDatabases:{...t,[n]:g},...i?{lastUsedTypedCollections:{...e,[n]:{...l,[i]:p}}}:{}}})}}function y(e){const{transaction:t,userSettingsStore:n,integrationId:o}=e;d.sO({store:(0,c._J)(n,n.pointer,["settings","dismissed_link_preview_integration_popup",o]),value:!0,transaction:t})}function b(e,t){const n=(0,r.SY)(),o=(0,r.Q3)();if(!n||!o)return;const i={};o&&(i.fbp=o),n&&(i.click_ids=n),u.createAndCommit({userAction:"userSettingsActions.persistAdClick",environment:e,perform:e=>{e.postSubmitCallbacks.push((e=>{e||((0,r.iI)(),(0,r.HR)())})),m({userSettingsStore:t,data:i,transaction:e})}})}function _(e){const{currentUserSettingsStore:t}=l.default.state;if(!t)return;const{environment:n,dismissed:o}=e;u.createAndCommit({environment:n,userAction:"userSettingsActions.setDismissedSuggestModeTooltip",perform:e=>{m({userSettingsStore:t,transaction:e,data:{dismissed_suggest_mode_tooltip:o}})}})}function S(e,t){const{phase:n,transactionUserAction:o,userSettingsStore:r}=t;u.createAndCommit({environment:e,userAction:o,perform:e=>{m({userSettingsStore:r,transaction:e,data:{charts_launch_modal_phase:n}})}})}function k(e,t){const{phase:n,transactionUserAction:o,userSettingsStore:r}=t;u.createAndCommit({environment:e,userAction:o,perform:e=>{m({userSettingsStore:r,transaction:e,data:{forms_launch_modal_phase:n}})}})}function w(e){const t=(0,s.WD)(e);t&&u.createAndCommit({environment:e,userAction:"userSettingsActions.setDismissStudentOrgPrompt",perform:e=>{m({userSettingsStore:t,transaction:e,data:{dismissed_sidebar_student_org_prompt:!0}})}})}function x(e){const t=(0,s.WD)(e);t&&u.createAndCommit({environment:e,userAction:"userSettingsActions.setDismissSitesLaunchModal",perform:e=>{m({userSettingsStore:t,transaction:e,data:{sites_launch_dismissed_at:o.ou.now().toMillis()}})}})}function I(e){const{environment:t,userSettingsStore:n,dismissed:o}=e;u.createAndCommit({environment:t,userAction:"userSettingsActions.setDismissDictationNewPageNux",perform:e=>{m({userSettingsStore:n,transaction:e,data:{dismissed_dictation_new_page_nux:o}})}})}function C(e){let{environment:t,checklistItem:n,partialUpdates:o}=e;const{currentUserSettingsStore:r}=l.default.state;if(!r)return;const i=r.getPersonalHomeNewUserChecklistSettings(),a={...i,progress_data:{...i.progress_data,[n]:{...i.progress_data[n],...o}}};u.createAndCommit({userAction:"updatePersonalHomeNewUserChecklistItemProgress",environment:t,userId:r.id,perform:e=>{m({userSettingsStore:r,data:{personal_home_new_user_checklist_settings:a},transaction:e})}})}function T(e){const{environment:t}=e,{currentUserSettingsStore:n}=l.default.state;if(n){void 0===n.getSettingsStore().getKeyStore("ai_assistant_tutorial_dismissed_at").getValue()&&u.createAndCommit({environment:t,userAction:"userSettingsActions.setAssistantTutorialDismissed",perform:e=>{m({userSettingsStore:n,transaction:e,data:{ai_assistant_tutorial_dismissed_at:Date.now()}})}})}}function M(e){const{environment:t}=e,{currentUserSettingsStore:n}=l.default.state;if(n){void 0===n.getSettingsStore().getKeyStore("seen_asana_post_import_tour").getValue()&&u.createAndCommit({environment:t,userAction:"userSettingsActions.setSeenAsanaPostImportTutorial",perform:e=>{m({userSettingsStore:n,transaction:e,data:{seen_asana_post_import_tour:!0}})}})}}function P(e){const{environment:t}=e,{currentUserSettingsStore:n}=l.default.state;if(n){void 0===n.getSettingsStore().getKeyStore("seen_forms_share_form_tooltip").getValue()&&u.createAndCommit({environment:t,userAction:"userSettingsActions.setSeenFormsShareFormTooltip",perform:e=>{m({userSettingsStore:n,transaction:e,data:{seen_forms_share_form_tooltip:!0}})}})}}function A(e){var t;const n=(0,s.WD)(e);n&&(null!==(t=n.getSettings())&&void 0!==t&&t.inapp_gallery_first_visited_at||u.createAndCommit({environment:e,userAction:"userSettingsActions.setFirstMarketplaceVisitTime",perform:e=>{m({userSettingsStore:n,transaction:e,data:{inapp_gallery_first_visited_at:o.ou.now().toMillis()}})}}))}},165452:(e,t,n)=>{n.d(t,{h:()=>f,l:()=>h});n(21703);var o=n(915157),r=n(144615),i=n(145953),a=n(421202),s=n(653965),l=n(937850),c=n(145950),d=n(205659),u=n(702688),p=n(692425),m=n(21359),g=n(504408);async function f(e){const{environment:t,userId:n,spaceId:o}=e,i=(0,r.NP)({userId:n,spaceId:o});if(!b||b!==i){let n;!function(e){y&&u.ZP.removeListener(y,e)}(t);const o=(t,o)=>{void 0!==n&&n!==o&&h(e),n=o},r=s.P2(o,5e3);y=u.ZP.addListener(i,r,void 0,t),b=i;if(!p.Z.getSharedPagesState(e))return h(e)}}async function h(e){const{environment:t,userId:n,spaceId:r}=e,s=p.Z.getSharedPagesState(e);if(s&&s.loadingDone)return s.loadingDone;const u=(0,l.UZ)();p.Z.setSharedPagesState({spaceId:r,userId:n,state:{currentPageIds:null==s?void 0:s.currentPageIds,loadingDone:u.promise}});try{const s=async function*(e,t,n){try{const n=await d.A.measure("loadUserSharedPages","(current user)",(()=>async function(e,t){const{id:n}=e.currentUser;if(!n)throw new Error("Must be logged in.");if(!e.defaultRecordCache.persistedRecordCache)throw new Error("No local database found.");const r=o.Z.get({userId:n,key:v({userId:n,spaceId:t.spaceId})})||void 0;if(!r)throw new Error("No local shared pages found.");const i=await c.yY({environment:e,recordPointers:r.map((e=>({table:a.iU,id:e}))),recurFn:()=>[],recordIsRequired:()=>!1});return{pages:r,recordMap:i.toJson({allowVersionDowngrade:!1})}}(e,{spaceId:t})));g.fL({environment:e,inMemoryRecordCache:e.defaultRecordCache.inMemoryRecordCache,recordMap:i.PF.create(n.recordMap),debugSource:"loadUserSharedPagesInSpace"}),yield n}catch(s){}const r=await m.getUserSharedPagesInSpace(e,{spaceId:t,includeDeleted:!0},n);"success"===r.type&&(e.defaultRecordCache.persistedRecordCache&&o.Z.set({userId:e.currentUser.id,key:v({userId:n,spaceId:t}),value:r.data.pages}),yield r.data)}(t,r,n);for await(const e of s)p.Z.setSharedPagesState({spaceId:r,userId:n,state:{currentPageIds:e.pages,loadingDone:u.promise}});const l=p.Z.getSharedPagesState(e);l&&l.currentPageIds?p.Z.setSharedPagesState({spaceId:r,userId:n,state:{currentPageIds:l.currentPageIds,loadingDone:void 0}}):p.Z.setSharedPagesState({spaceId:r,userId:n,state:void 0})}catch(f){p.Z.setSharedPagesState({spaceId:r,userId:n,state:void 0})}}function v(e){return`UserSharedPagesInSpace:${e.userId}:${e.spaceId}`}let y,b},309377:(e,t,n)=>{n.d(t,{E:()=>k,j:()=>w});n(401898);var o=n(212847);n(250202);const r=["2021-05-11","2021-05-13","2021-08-16","2022-02-22","2022-06-28"],i=r[r.length-1];o.literals(...r);var a=n(177420),s=n(519889),l=n(35794),c=n(709291),d=n(653965),u=n(757549),p=n(741195),m=n(433929),g=n(80444),f=n(385555),h=n(206258),v=n(21359),y=n(547307),b=n(709953),_=n(210228);const S=(0,c.defineMessages)({webhookUrlError:{id:"webhookActions.webhookUrlError",defaultMessage:"Connection failed. Please wait and try again or try another URL."}});async function k(e){const{environment:t,integration:n,webhookUrl:o,webhookSecret:r,webhookHeaders:c,webhookSubscriptionId:f,onError:k,onSuccess:w=(()=>{})}=e,{currentUserRootStore:x,currentSpaceStore:I}=g.default.state;if(!x||!I)return{error:{success:!1}};const C={};c.map((e=>{const{key:t,value:n}=e;return{key:t.trim(),value:String(n).trim()}})).filter((e=>{let{key:t,value:n}=e;return t&&n})).forEach((e=>{let{key:t,value:n}=e;C[t]=n}));const T={headers:C};if("failed"===(await v.testWebhookConnection(t,{integrationId:n.id,webhookUrl:o,webhookSecret:r||void 0,webhookCustomization:T})).type)return y.showErrorMessage(m.default.formatMessage(S.webhookUrlError)),{error:{success:!1}};const{serverCommitResult:M}=_.createAndCommit({userAction:"webhookActions.createWebhookSubscription",environment:t,perform:c=>{c.postSubmitCallbacks=[k];const m=Date.now(),v=I.id;if(e.webhookSubscriptionId){const e=g.default.state.currentSpaceStore,i=f&&e?h.n4.createChildStore(e,{id:f,table:l.bf,spaceId:e.id}):void 0;if(i){const e=i.getWebhookUrl()!==o,a=i.getWebhookSecret()!==r,s=!d.Xy(i.getWebhookCustomization(),T);(e||a||s)&&(u.AS(t,{integration_id:n.id,has_updated_webhook_url:e||void 0,has_updated_webhook_secret:a||void 0}),b.sW({transaction:c,data:{webhook_url:o,webhook_secret:r,webhook_customization:T,health:{status:"active"}},store:i}))}}else{const e=(0,p.TS)({environment:t,table:a.cZ,spaceId:v});b.ae({environment:t,table:a.cZ,value:{id:e,space_id:v,parent_id:I.id,parent_table:"space",type:"external",alive:!0,name:n.getName(),icon:n.getInfo().icon,integration_id:n.id,capabilities:n.getCapabilities(),created_at:m,last_edited_at:m,last_edited_by_id:x.id,created_by_id:x.id,created_by_table:s.KJ,last_edited_by_table:s.KJ},inMemoryRecordCache:I.inMemoryRecordCache,transaction:c}),b.ae({environment:t,table:l.bf,value:{id:(0,p.TS)({environment:t,spaceId:v,table:l.bf}),bot_id:e,space_id:v,parent_id:I.id,api_version:i,webhook_url:o,webhook_secret:r,webhook_customization:T,parent_table:"space",last_edited_time:m,last_edited_by_id:x.id,created_by_id:x.id,created_time:m,created_by_table:s.KJ,last_edited_by_table:s.KJ,health:{status:"active"}},inMemoryRecordCache:I.inMemoryRecordCache,transaction:c}),u.eR(t,{integration_id:n.id,configuration_type:"manual",bot_id:e})}}});return await M,w(),{value:{success:!0}}}async function w(e){const t=f.default.checkGate({gateName:"webhooks_beta"}),{environment:n,spaceId:o}=e;if(!n.currentUser.isLoggedIn()||!t)return{webhookSubscriptionIds:[],recordMap:{}};const r=await v.getWebhookSubscriptions(n,{spaceId:o});if("failed"===r.type)throw r.error;return r.data}},512304:(e,t,n)=>{n.d(t,{Cq:()=>U,Y:()=>Z,Zi:()=>F});n(667294);var o=n(371663),r=n(846283),i=n(541432),a=n(471924),s=n(772141),l=n(421202),c=n(606287),d=n(213493),u=n(421838),p=n(249902),m=n(709291),g=n(307032),f=n(215828),h=n(710274),v=n(606854),y=n(855337),b=n(721429),_=n(708661),S=n(741195),k=n(433929),w=n(645010),x=n(385555),I=n(206258),C=n(801310),T=n(547307),M=n(709953),P=n(164964),A=n(800993),R=n(210228),D=n(668422),B=n(473060),E=n(785893);const F=(0,m.defineMessages)({home:{id:"wikiActions.collectionView.home",defaultMessage:"Home"},allPages:{id:"wikiActions.collectionView.allPages",defaultMessage:"All pages"},pagesIOwn:{id:"wikiActions.collectionView.pagesIOwn",defaultMessage:"Pages I own"},pagePropertyName:{id:"wikiActions.collectionView.pagePropertyName",defaultMessage:"Page"},ownerPropertyName:{id:"wikiActions.collectionView.ownerPropertyName",defaultMessage:"Owner"},tagsPropertyName:{id:"wikiActions.collectionView.tagsPropertyName",defaultMessage:"Tags"},tagsDesignValue:{id:"wikiActions.collectionView.tagsDesignValue",defaultMessage:"Design"},tagsOnboardingValue:{id:"wikiActions.collectionView.tagsOnboardingValue",defaultMessage:"Onboarding"},verificationPropertyName:{id:"wikiActions.collectionView.verificationPropertyName",defaultMessage:"Verification"},undoToast:{id:"wikiActions.convertToWiki.undo.toastMessage",defaultMessage:"Turned {pageName} into a wiki"}});function Z(e){const{blocks:t,transaction:n,environment:s,source:p}=e,m=a.Il(),h=t[0];if(!h||!h.isPageBlock())return;const T=h.getSpaceId(),A=(0,S.TS)({environment:s,table:c.vF,spaceId:T}),D=h.getFormat().page_icon,Z=(0,f.ZP)(),V=r.k.Owner,N=(0,f.ZP)(),O=(0,f.ZP)(),L={title:{name:k.default.formatMessage(F.pagePropertyName),type:"title"},[V]:{name:k.default.formatMessage(F.ownerPropertyName),type:"person",default:"created_by"},[O]:{name:k.default.formatMessage(F.tagsPropertyName),type:"multi_select",options:[{id:a.Il(),value:k.default.formatMessage(F.tagsOnboardingValue),color:"blue"},{id:a.Il(),value:k.default.formatMessage(F.tagsDesignValue),color:"green"}]},[Z]:{name:_.SO.last_edited_time,type:"last_edited_time",date_format:"relative"}},j=[{visible:!0,property:"title",width:300},{visible:!0,property:V,width:150},{visible:!0,property:N,width:150},{visible:!0,property:O,width:150},{visible:!0,property:Z,width:250}];L[N]={name:k.default.formatMessage(F.verificationPropertyName),type:"verification",verifier_property:V};const K={table:c.vF,id:A,spaceId:T};R.applyOperation({store:(0,I.Kv)(h,K),operation:{pointer:K,command:"set",path:[],args:{id:A,version:0,parent_table:l.iU,parent_id:h.id,space_id:T,name:h.getTitleValue(),schema:L,cover:h.getFormat().page_cover,format:{collection_mode:{type:"page_tree",root_page_pointer:{table:l.iU,id:h.id,spaceId:T}},app_config_uri:o.GZ,property_visibility:[{property:Z,visibility:"hide"},{property:O,visibility:"show"},{property:V,visibility:"show"},{property:N,visibility:"show"}],collection_page_properties:j,collection_cover_position:h.getFormat().page_cover_position},icon:D,alive:!0}},transaction:n});const z=(0,S.TS)({environment:s,table:d.np,spaceId:T}),q=(0,S.TS)({environment:s,table:d.np,spaceId:T}),H=(0,S.TS)({environment:s,table:d.np,spaceId:T});M.sW({store:h,data:{type:i.Ti.collectionViewPage,collection_id:A,view_ids:[z,q,H]},transaction:n}),M.sW({store:h.getFormatStore(),data:{collection_pointer:K,app_config_uri:o.jh,app_uri_map:{[o.GZ]:A},app_id:m},transaction:n});const G={table:d.np,id:z,spaceId:T};R.applyOperation({store:(0,I.Kv)(h,G),operation:{pointer:G,command:"set",path:[],args:{id:z,version:0,type:"page",name:k.default.formatMessage(F.home),parent_id:h.id,parent_table:"block",space_id:T,format:{page_pointer:{id:(0,g.Mt)(h.id),spaceId:T,table:"block"}},alive:!0}},transaction:n});const W={table:d.np,id:q,spaceId:T};R.applyOperation({store:(0,I.Kv)(h,W),operation:{pointer:W,command:"set",path:[],args:{id:q,version:0,type:"table",name:k.default.formatMessage(F.allPages),parent_id:h.id,parent_table:"block",space_id:T,format:{table_properties:j},query2:{sort:[{property:Z,direction:"descending"}]},alive:!0}},transaction:n});const $={table:d.np,id:H,spaceId:T};R.applyOperation({store:(0,I.Kv)(h,$),operation:{pointer:$,command:"set",path:[],args:{id:H,version:0,type:"table",name:k.default.formatMessage(F.pagesIOwn),parent_id:h.id,parent_table:"block",space_id:T,format:{table_properties:j,property_filters:[{id:a.Il(),filter:{filter:{value:{type:"relative",value:"me"},operator:"person_contains"},property:V}}]},query2:{sort:[{property:Z,direction:"descending"}]},alive:!0}},transaction:n});const Y=w.Z.PageScroller;Y&&Y.scrollToTop({animate:!0}),B.rm(n),function(e,t){y.K4(e,"wiki_convert",t),x.default.logEvent("wiki_convert",void 0,t)}(s,{source:p,root_page_id:h.id,collection_id:A}),function(e){const{environment:t,blocks:n}=e,o=n[0];if(!o||!o.isCollectionViewPageWithContent())return;const r=(0,u.QaF)(o.getTitleValue());C.ZP.setState({...C.ZP.state,shouldReset:!1});const i=(0,b.zj)()===o.id;P.oV({label:k.default.formatMessage(F.undoToast,{pageName:r}),durationMs:C.JY,right:(0,E.jsx)(v.wr,{blockToOpenStore:i?void 0:o,performUndo:()=>{R.createAndCommit({userAction:"wikiActions.wikiConversionToast.undo",environment:t,perform:e=>{P.rN(),U({environment:t,blocks:n,transaction:e,source:"snackbar"})}})}})})}({environment:s,blocks:t})}function U(e){var t;const{environment:n,blocks:o,transaction:r,source:a}=e,l=o[0];if(!l||!l.isCollectionView())return void T.deprecatedShowErrorMessage("Something went wrong");const c=l.getFormat().collection_pointer;if(!c)return void T.deprecatedShowErrorMessage("Something went wrong");const d=I.NW.createChildStore(l,c),u=null===(t=l.getCover())||void 0===t?void 0:t.cover,m=d.getFormat().collection_cover_position,g=d.getName();D.vs({environment:n,block:l,blockType:i.Ti.page,transaction:r}),M.sW({store:l.getFormatStore(),data:{app_config_uri:null,app_uri_map:null,app_id:null,page_cover:u??null,page_cover_position:m??null},transaction:r}),A.sO({environment:n,store:l.getBlockTitleStore(),value:g,transaction:r});for(const i of l.getPermissionItems())if(s.C2(i)&&"content_only_editor"===i.role&&!s.FB(i)){const e={...i,role:"read_and_write"};R.applyOperation({store:l.getPermissionItemsStore(),operation:{pointer:l.pointer,command:"setPermissionItem",path:l.getPermissionItemsStore().path,args:e},transaction:r})}h.A9({collectionViewBlockStore:l,collectionStore:d,transaction:r}),function(e,t){y.K4(e,"wiki_undo_conversion",t),x.default.logEvent("wiki_undo_conversion",void 0,t),p.j({name:"wiki_undo_conversion",args:t})}(n,{source:a,root_page_id:l.id,collection_id:c.id})}},473060:(e,t,n)=>{n.d(t,{B1:()=>s,FO:()=>c,Rg:()=>l,nX:()=>u,rm:()=>d});var o=n(328182),r=n(80444),i=n(210228),a=n(237181);function s(){const{currentUserSettingsStore:e}=r.default.state;if(!e||!e.isReady())return;const t=e.getSettings();return t?t.wiki_onboarding_phase??"unseen":void 0}function l(e){const t=s();if(void 0===t)return;const n=o.dF.indexOf(t);if(-1!==n&&n<o.dF.length-1){const{currentUserSettingsStore:t}=r.default.state;if(!t)return;i.createAndCommit({userAction:"wikiOnboardingActions.advanceOnboardingStep",environment:e,perform:e=>{a.d2({userSettingsStore:t,transaction:e,data:{wiki_onboarding_phase:o.dF[n+1]}})}})}}function c(e){const t=s();if(void 0===t)return;const n=o.dF.indexOf(t);if(-1!==n&&n>1){const{currentUserSettingsStore:t}=r.default.state;if(!t)return;i.createAndCommit({userAction:"wikiOnboardingActions.previousOnboardingStep",environment:e,perform:e=>{a.d2({userSettingsStore:t,transaction:e,data:{wiki_onboarding_phase:o.dF[n-1]}})}})}}function d(e){const{currentUserSettingsStore:t}=r.default.state;t&&"unseen"===s()&&a.d2({userSettingsStore:t,transaction:e,data:{wiki_onboarding_phase:"home"}})}function u(e){if("complete"===s())return;const{currentUserSettingsStore:t}=r.default.state;t&&i.createAndCommit({userAction:"wikiOnboardingActions.completeOnboarding",environment:e,perform:e=>{a.d2({userSettingsStore:t,transaction:e,data:{wiki_onboarding_phase:"complete"}})},userId:t.id})}},489626:(e,t,n)=>{n.d(t,{ON:()=>v,__:()=>f,fz:()=>y,lZ:()=>_,sy:()=>h,w9:()=>b});n(21703);var o=n(667294),r=n(800480),i=n(886628),a=n(749085),s=n(966673),l=n(328182),c=n(210228),d=n(237181),u=n(80444),p=n(521273),m=n(990827),g=n(244458);const f=a.default.createValue(void 0,{name:"AiOnboardingQueuedSelectedStore"});function h(){const e="space_for_ai",{currentUserSettingsStore:t}=u.default.state;if(!t||!t.isReady())return;const n=t.getSettings();return n?p.Z.showAssistantOnboardingAssets()?n.ai_assistant_tooltips_onboarding_phase??e:n.ai_onboarding_phase??e:void 0}function v(e){"space_for_ai"===h()&&y(e)}function y(e){const t=h();if(void 0===t)throw new Error("Assertion failure, AI onboarding state is undefined!");const n=l.AQ.indexOf(t);if(-1===n)throw new Error(`Assertion failure, ${t} is not a valid AI onboarding state!`);if(n<l.AQ.length-1){const{currentUserSettingsStore:t}=u.default.state;if(!t)return;const o=p.Z.showAssistantOnboardingAssets(),r=l.AQ[n+1];c.createAndCommit({userAction:"AiOnboardingActions.advanceAIOnboardingStage",environment:e,perform:e=>{d.d2({userSettingsStore:t,transaction:e,data:o?{ai_assistant_tooltips_onboarding_phase:r}:{ai_onboarding_phase:r}})},userId:t.id}),"complete"===r&&o&&(0,g.setAssistantOnboardingPhase)(e,{phase:"complete",transactionUserAction:"AiOnboardingActions.advanceAIAssistantOnboardingPhase.fromAiTooltips",userSettingsStore:t})}}function b(e){const t=(0,r.O7)(),n=(0,i.VK)((()=>{const e=(0,m.Js)();return!!e&&e.isStreaming()}),[]),a="completionPopup"===e.type&&"results"===e.stage&&!e.loading,l="assistantCompletionPopup"===e.type&&"results"===e.stage&&!n,c=a||l,d=(0,s.D9)(c);(0,o.useEffect)((()=>{d&&!c&&"refine_ai_response"===h()&&y(t)}),[c,d,t])}function _(e){const t=(0,r.O7)(),n="results"===e.stage&&e.loading,i=(0,s.D9)(n);(0,o.useEffect)((()=>{n&&!i&&"ask_ai_anything"===h()&&y(t)}),[n,i,t])}},244458:(e,t,n)=>{n.r(t),n.d(t,{navigateToGoogleDriveUniversalScreen:()=>g,navigateToSlackUniversalQnAOnboarding:()=>m,resetGoogleDriveQnaConnectionState:()=>h,resetSlackQnaConnectionState:()=>f,setAssistantOnboardingPhase:()=>d,setLastExposedToQnaAtToCurrentTimestamp:()=>u,setLastUsedAIWriterAtToCurrentTimestamp:()=>p,setQnaOnboardingPhase:()=>c,updateGoogleDriveQnAConnectionState:()=>y,updateSlackQnAConnectionState:()=>v});var o=n(471924),r=n(21359),i=n(210228),a=n(237181),s=n(390837),l=n(397788);function c(e,t){const{phase:n,transactionUserAction:o,userSettingsStore:r}=t;i.createAndCommit({environment:e,userAction:o,perform:e=>{a.d2({userSettingsStore:r,transaction:e,data:{ai_qna_intro_onboarding_phase:n}})}})}function d(e,t){const{phase:n,transactionUserAction:o,userSettingsStore:r}=t;i.createAndCommit({environment:e,userAction:o,perform:e=>{a.d2({userSettingsStore:r,transaction:e,data:{ai_assistant_onboarding_phase:n,ai_assistant_onboarding_phase_last_set_at:Date.now()}})}})}function u(e,t){const{userSettingsStore:n}=t;i.createAndCommit({environment:e,userAction:"aiQnaActions.setLastExposedToQnaAtToCurrentTimestamp",perform:e=>{a.d2({userSettingsStore:n,transaction:e,data:{last_exposed_to_ai_qna_at:Date.now()}})}})}function p(e,t){const{userSettingsStore:n}=t;i.createAndCommit({environment:e,userAction:"aiQnaActions.setLastUsedAIWriterAtToCurrentTimestamp",perform:e=>{a.d2({userSettingsStore:n,transaction:e,data:{last_used_ai_writer_at:Date.now()}})}})}function m(e){const{analyticsFrom:t}=e,n=e.sessionId??o.Il();s.y.setState({...s.y.state,currentScreen:"introduction",analyticsFrom:t,sessionId:n})}function g(e){const{screenToShow:t,analyticsFrom:n}=e,r=e.sessionId??o.Il();l.X.setState({...l.X.state,analyticsFrom:n,sessionId:r,screenToShow:t})}async function f(e){const{currentScreen:t,analyticsFrom:n}=s.y.state,o=s.y.getInitialState();s.y.setState({...o,analyticsFrom:n,currentScreen:t}),await v(e)}function h(e){const{analyticsFrom:t}=l.X.state,n=l.X.getInitialState();l.X.setState({...n,analyticsFrom:t})}async function v(e){const{environment:t,spaceStore:n}=e,o=await r.getSlackBulkIngestionStatus(t,{spaceId:n.id});"success"===o.type&&s.y.setState({...s.y.state,...o.data,ingestionProgress:o.data.isPublicSync?o.data.ingestionProgress||1:void 0});const i=await r.canUserQuerySlack(t,{spaceId:n.id});"success"===i.type&&s.y.setState({...s.y.state,canQuery:i.data.canQuery});const a=await r.getConnectedAppsForUniversalQna(t,{spaceId:n.getSpaceId()});"success"===a.type&&s.y.setState({...s.y.state,connectedApps:a.data.connectedApps})}async function y(e){const{environment:t,spaceStore:n}=e,o=await r.getGoogleDriveSyncProgress(t,{spaceId:n.id});"success"===o.type&&l.X.setState({...l.X.state,syncProgress:o.data.status,syncCurrent:o.data.current,syncTotal:o.data.total,ingestionProgress:o.data.ingestionProgress})}},432785:(e,t,n)=>{n.d(t,{b:()=>l});n(757658);var o=n(471924),r=n(598151),i=n(21359),a=n(80444);function s(e){try{let{environment:t,type:n,inputs:s}=e;return async function*(e){const l=null===(e=a.default.state.currentSpaceStore)||void 0===e?void 0:e.id;if(!l)return;const c=await i.streamCascadeInference(t,{type:n,inputs:s,spaceId:l,aiSessionId:o.Il()});if("success"===c.type&&r.H1.is(c.data))for await(const t of c.data){if("error"===t.type)return;yield t.output}}()}catch(t){return Promise.reject(t)}}async function l(e){let{environment:t,type:n,inputs:o}=e;for await(const r of s({environment:t,type:n,inputs:o}))return r}},492022:(e,t,n)=>{n.r(t),n.d(t,{closeInitialPromptAndEndSession:()=>x,closeInitialPromptButContinueSession:()=>I,openHelpMeWriteGenericPopup:()=>M,retryInitialPrompt:()=>w,showInitialPromptForAIBlock:()=>C,toggleInitialPrompt:()=>T});var o=n(701302),r=n(471924),i=n(401898),a=n(10910),s=n(21359),l=n(898104),c=n(778663),d=n(120315),u=n(268056),p=n(431559),m=n(80444),g=n(521273),f=n(798180),h=n(316772),v=n(385555),y=n(27724),b=n(924666),_=n(489626),S=n(457819);function k(e,t){if("completionPopup"!==t.type&&"assistantCompletionPopup"!==t.type||"results"!==t.stage&&"initialPrompt"!==t.stage||"textSelection"!==t.context.type&&"cursor"!==t.context.type)(0,S.Tq)(e);else if("results"===t.stage){const e=t.context.textSelection;o.default.afterNextFlush((()=>l.setSelection({store:e.start.store,selection:{startIndex:e.start.index,endIndex:e.start.index}})))}else l.setMultiSelection({multiSelection:t.context.textSelection})}function w(e){h.default.invalidateLastUpdater();const{environment:t}=e,{state:n}=h.default;if("completionPopup"!==n.type||"results"!==n.stage)return;t.defaultRecordCache.inMemoryRecordCache.removeCacheOverride(n.inMemoryRecordCache);const o={type:"completionPopup",stage:"initialPrompt",prefilledValue:"",context:n.context,aiSessionId:n.aiSessionId,from:n.from,futureRevisions:[...n.revisions,...n.futureRevisions]};h.default.setState(o)}function x(e){k(e,h.default.state),h.default.setState({type:"closed"})}function I(e){const{state:t}=h.default;k(e,t),"completionPopup"===t.type&&"initialPrompt"===t.stage&&h.default.setState({type:"closedWithContext",context:t.context,aiSessionId:t.aiSessionId,futureRevisions:t.futureRevisions}),setTimeout((()=>{"closedWithContext"===h.default.state.type&&h.default.reset()}),1)}function C(e){h.default.setState({...e,type:"completionPopup",stage:"initialPromptForAIBlock",from:"ai_block",prefilledValue:"",aiSessionId:r.Il()}),P({environment:e.environment,promptForAnalytics:e.clientPrompt})}async function T(e){const{environment:t,from:o}=e;let{context:i,prefilledValue:a,sessionId:l}=e;const{assistantDependency:d}=await Promise.resolve().then(n.bind(n,81598)),p=await d.load();if(!(await p.assistantMenuActions.closeAssistantRightHandSideMenu({environment:t})))return;let f={type:"closed"};if("closed"===h.default.state.type||"closedWithContext"===h.default.state.type){if(!i&&y.default.state.stores.length>0){const e=b.default.state;i="empty"===e.mode?(0,c.Xc)():(0,u.iG)(e.multiSelection)?(0,c.FD)():(0,c.Fu)()}i&&(a||(a=""),l||(l=r.Il()),f=g.Z.isAssistantInWriterEnabled()?{type:"assistantCompletionPopup",stage:"initialPrompt",context:i,from:o,prefilledValue:a,sessionId:l,loading:!1,hasErrored:!1}:{type:"completionPopup",stage:"initialPrompt",context:i,from:o,prefilledValue:a,aiSessionId:l,futureRevisions:[]},m.default.state.currentSpaceStore&&s.publishAiSession(t,{inference_type:"writer",spaceId:m.default.state.currentSpaceStore.id,id:"assistantCompletionPopup"===f.type?l:f.aiSessionId,metadata:{from:o}}),"spacebar"===o&&(0,_.ON)(t))}h.default.setState(f),P(e)}function M(e){const{title:t,environment:n,prefilledValue:o,from:a}=e,s=(0,c.FD)();if(!s)return;let l;if((0,i.$K)(t)){const e=t?(0,d.qB)({customPrompt:o??t,isPageEmpty:!0}):d.eL;l={promptForAnalytics:e,prefilledValue:(0,c.$W)(e)}}else l={prefilledValue:o,promptForAnalytics:void 0};T({environment:n,from:a??"page_menu",sessionId:r.Il(),context:s,...l})}function P(e){const{environment:t,promptForAnalytics:n}=e,{state:o}=h.default;if(("completionPopup"===o.type||"assistantCompletionPopup"===o.type)&&"results"!==o.stage){"initialPromptForAIBlock"===o.stage||v.default.checkGate({gateName:"mobile_assistant_prevent_clear_selection"})||l.clear({environment:t});const e="assistantCompletionPopup"===o.type?o.sessionId:o.aiSessionId,r=f.default.getSessionContext(e);a.Tl(t,{session_id:"assistantCompletionPopup"===o.type?o.sessionId:o.aiSessionId,prompt_key:(null==n?void 0:n.key)??("completionPopup"!==o.type||o.prefilledValue?"unknown":"alternative_ui_empty_input"),from:o.from,sessionContext:r}),p.xv()}}},271184:(e,t,n)=>{n.d(t,{Gl:()=>l,JS:()=>c,QC:()=>d,gC:()=>s,kg:()=>u});n(430541);var o=n(471924),r=n(237181),i=n(630793);function a(e,t){return e.id===t.id}function s(e,t,n){const o=c(t).slice(),s=o.findIndex((t=>a(e,t)));-1===s?o.unshift(e):o.splice(s,1,e),(0,i.lG)(e.action,t,n),r.d2({userSettingsStore:t,transaction:n,data:{favorite_ai_actions:o}})}function l(e,t){for(const n of c(e))if((0,i.YK)(n.action,t))return n}function c(e){var t;return(null===(t=e.getModel())||void 0===t||null===(t=t.getSettings())||void 0===t?void 0:t.favorite_ai_actions)??[]}function d(e,t,n){const o=c(t).filter((t=>!a(t,e)));r.d2({userSettingsStore:t,transaction:n,data:{favorite_ai_actions:o}})}function u(e){return{id:o.Il(),name:e.promptTitle??"",action:{...e,promptTitle:void 0}}}},762878:(e,t,n)=>{n.r(t),n.d(t,{importGtmFavorite:()=>g});n(667294);var o=n(709291),r=n(10910),i=n(547307),a=n(164964),s=n(210228),l=n(80444),c=n(271184),d=n(724405),u=n(785893);function p(e){const{favorite:t,isReplacingFavorite:n}=e,r=(0,d.yK)((e=>({title:{fontWeight:700,marginBottom:"1em"},prompt:{color:e.lightTextColor,maxHeight:"5em",overflowX:"hidden",overflowY:"scroll",whiteSpace:"pre-wrap"}})),[]),i=n?(0,u.jsx)(o.FormattedMessage,{defaultMessage:"Overwrite “{favoriteName}” AI action?",id:"ai.favoriteActions.importFavorite.overwriteMessage",values:{favoriteName:t.name}}):(0,u.jsx)(o.FormattedMessage,{defaultMessage:"Add “{favoriteName}” AI action?",id:"ai.favoriteActions.importFavorite.addMessage",values:{favoriteName:t.name}}),a=(0,u.jsx)(o.FormattedMessage,{defaultMessage:"“{favoritePrompt}”",id:"ai.favoriteActions.importFavorite.prompt",values:{favoritePrompt:t.action.prompt}});return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{style:r.title,children:i}),(0,u.jsx)("div",{style:r.prompt,children:a})]})}var m=n(13555);async function g(e){const{environment:t}=e,n=await(0,m.cx)({environment:t,blockId:e.importArgs.blockId});"error"!==n.type?await async function(e){const{environment:t,newFavorite:n}=e,{currentUserSettingsStore:d}=l.default.state;if(!d)return;const m=(0,c.JS)(d);let g=(0,u.jsx)(o.FormattedMessage,{defaultMessage:"Add AI action",id:"ai.favoriteActions.importFavorite.addAction"}),f=(0,u.jsx)(o.FormattedMessage,{defaultMessage:"Cancel",id:"ai.favoriteActions.importFavorite.cancelAction"}),h=(0,u.jsx)(o.FormattedMessage,{defaultMessage:"“{favoriteName}” AI action added to your Favorites.",id:"ai.favoriteActions.importFavorite.favoriteAdded",values:{favoriteName:n.name}}),v=!1;for(const r of m)if(r.name===n.name){if(r.action.type===n.action.type&&r.action.prompt===n.action.prompt)return void a.oV({label:(0,u.jsx)(o.FormattedMessage,{defaultMessage:"“{favoriteName}” AI action is already in your Favorites.",id:"ai.favoriteActions.importFavorite.alreadyInFavorites",values:{favoriteName:n.name}})});n.id=r.id,v=!0,g=(0,u.jsx)(o.FormattedMessage,{defaultMessage:"Overwrite existing AI action",id:"ai.favoriteActions.importFavorite.overwriteAction"}),f=(0,u.jsx)(o.FormattedMessage,{defaultMessage:"Keep existing AI action",id:"ai.favoriteActions.importFavorite.keepExistingAction"}),h=(0,u.jsx)(o.FormattedMessage,{defaultMessage:"“{favoriteName}” AI action updated in your Favorites.",id:"ai.favoriteActions.importFavorite.favoriteUpdated",values:{favoriteName:n.name}});break}if(!(await i.confirmUserAction({message:(0,u.jsx)(p,{favorite:n,isReplacingFavorite:v}),acceptLabel:g,cancelLabel:f})))return;s.createAndCommit({userAction:"favoriteActions.handleFavoriteImport",environment:t,perform(e){(0,c.gC)(n,d,e)}}),a.oV({label:h}),r.Vo(t,{type:"create_from_url",session_id:void 0,gtm_favorite_id:n.gtmFavoriteId})}({environment:t,newFavorite:n.favorite}):a.oV({label:(0,u.jsx)(o.FormattedMessage,{defaultMessage:"An error occurred when loading the AI action. ({errorCode})",id:"ai.favoriteActions.importFavorite.favoriteFailedToLoad",values:{errorCode:n.code}})})}},13555:(e,t,n)=>{n.d(t,{OF:()=>f,cx:()=>y});var o=n(471924),r=n(145953),i=n(421838),a=n(21359),s=(n(95477),n(985677)),l=n(385555);let c=function(e){return e[e.NoConfig=100]="NoConfig",e[e.LoadPageChunkFailed=101]="LoadPageChunkFailed",e[e.MissingPageRecord=103]="MissingPageRecord",e[e.InvalidPageParent=104]="InvalidPageParent",e[e.MissingTitle=105]="MissingTitle",e[e.MissingPromptText=106]="MissingPromptText",e[e.MissingCollectionSchema=107]="MissingCollectionSchema",e[e.MissingPromptType=108]="MissingPromptType",e[e.InvalidPromptType=109]="InvalidPromptType",e[e.FavoritesDisabled=110]="FavoritesDisabled",e}({});const d="Prompt type",u="Prompt text",p="Run immediately",m="Help me write",g="Help me edit";function f(){{const e=l.default.getConfigKey("gtm_ai_favorites","space_id"),t=l.default.getConfigKey("gtm_ai_favorites","collection_id");if(e&&t)return{spaceId:e,collectionId:t}}}function h(e,t,n){const o=function(e,t,n){for(const r in e){const i=e[r];var o;if(i&&i.name===n)return null===(o=t.properties)||void 0===o?void 0:o[r]}}(e,t,n);if(o)return(0,i.Jcv)(o)}function v(e){return{type:"error",code:e}}async function y(e){var t;const{environment:n,blockId:y}=e;if(await l.default.waitUntilStatsigReady(),!l.default.checkGate({gateName:"ai_favorites"}))return v(c.FavoritesDisabled);const b=f();if(!b)return v(c.NoConfig);const{spaceId:_,collectionId:S}=b,k=l.default.checkGate({gateName:"load_page_chunk_multi_cell_enabled"}),w={environment:n,data:{page:{spaceId:_,id:y},limit:0,chunkNumber:0,cursor:{stack:[]},verticalColumns:!1},headers:(0,s.Bb)({spaceId:_,recordId:y})},x=k?await a.loadCachedPageChunkV2(w):await a.loadCachedPageChunk(w);if("success"!==x.type)return v(c.LoadPageChunkFailed);const I=r.PF.create(x.data.recordMap),C=I.getValue({table:"block",id:y,spaceId:_});if(!C)return v(c.MissingPageRecord);if(C.parent_id!==S)return v(c.InvalidPageParent);const T=(0,i.Jcv)(null===(t=C.properties)||void 0===t?void 0:t.title);if(!T)return v(c.MissingTitle);const M=await async function(e){const{environment:t,recordMap:n,blockId:o,spaceId:r,collectionId:i}=e,s=n.getValue({table:"collection",id:i,spaceId:r});if(null!=s&&s.schema)return s.schema;const l=await a.getPublicPageData(t,{type:"block-space",blockId:o,spaceId:r});return"failed"!==l.type?l.data.collectionSchema:void 0}({environment:n,recordMap:I,blockId:y,spaceId:_,collectionId:S});if(!M)return v(c.MissingCollectionSchema);const P=h(M,C,u);if(!P)return v(c.MissingPromptText);const A=h(M,C,d);if(!A)return v(c.MissingPromptType);const R=(D=A)===g?"helpMeEdit":D===m?"helpMeWrite":void 0;var D;if(!R)return v(c.InvalidPromptType);const B=function(e,t,n){return"Yes"===h(e,t,n)}(M,C,p);return{type:"success",favorite:{id:o.Il(),name:T,executeImmediately:B,gtmFavoriteId:y,action:{type:R,prompt:P,promptTitle:void 0}}}}},457819:(e,t,n)=>{n.d(t,{$b:()=>x,Dj:()=>C,RR:()=>_,Tq:()=>w,VZ:()=>S,bJ:()=>b,jq:()=>I,rR:()=>k,yR:()=>T});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(842875),l=n(966673),c=n(882883),d=n(401898),u=n(800893),p=n(956518),m=n(743455),g=n(433929),f=n(389224),h=n(80444),v=n(417903),y=n(542057);function b(){const e=(0,r.O7)(),t=(0,i.VK)((()=>e.device.isPhone),[e]);return(0,a.yK)((e=>{const n="dark"===e.mode?e.accentColors.purple[900]:e.accentColors.purple[400];return{purpleButton:{padding:4,fontWeight:600,color:n},keyboardShortcut:{textTransform:"uppercase",fontWeight:500,fontSize:11,marginLeft:6,color:e.lightTextColor,display:t?"none":void 0},lightweightButton:{display:"flex",alignItems:"baseline",justifyContent:"center",fontSize:14,padding:"5px 8px",borderRadius:6,color:e.mediumTextColor,height:32,marginTop:2},returnIndicatorIconStyles:{width:14,height:14,paddingLeft:4,fill:e.lightIconColor},keyboardShortcutInverted:{color:e.mediumInvertedTextColor,paddingLeft:4},writingLabel:{flex:1,color:n,fontWeight:500,flexDirection:"row",gap:6,display:"flex",alignItems:"center"},inputActions:{height:36,display:"flex",alignSelf:"flex-end",alignItems:"center"},loadingDots:{backgroundColor:n}}}),[t])}function _(e){if("completionPopup"===e.type||"assistantCompletionPopup"===e.type)return e}function S(e){return"initialPromptForAIBlock"===e.stage?"aiBlock":e.context.type}function k(e){return"initialPromptForAIBlock"===e.stage?"write":function(e){switch(e.type){case"cursor":return"write";case"blockSelection":case"textSelection":return"edit"}}(e.context)}function w(e){f.clear(e)}function x(e){if("initialPromptForAIBlock"===e.stage){const t=e.originRef.current;if(!t)return;return{origin:t.getBoundingClientRect(),scrollerStore:C(e.store.getRecordStoreUIRoot())}}return e.context}function I(e){const{areWeLoading:t,scrollerStore:n,resetWhenScrolledToBottom:r}=e,a=(0,l.D9)(t);(0,o.useEffect)((()=>{t!==a&&c(!1)}),[t,a]);const[s,c]=(0,o.useState)(!1),d=(0,i.VK)((()=>null==n?void 0:n.state.scrollTop),[n]),u=(0,l.D9)(d),p=(0,i.VK)((()=>{const e=null==n?void 0:n.state.clientRect;if(e)return n.state.scrollHeight-e.height}),[n]);return(0,o.useEffect)((()=>{void 0!==u&&void 0!==d&&u-d>1&&c(!0)}),[d,u]),(0,o.useEffect)((()=>{r&&void 0!==d&&void 0!==p&&Math.abs(d-p)<1&&c(!1)}),[p,d,r]),s}function C(e){return e===h.default.state.mainEditorCurrentBlockStore?v.Z:y.Z}function T(e,t){const n=g.default.getIntl(),o=(0,c.Xh)({intl:n,textValue:t.getBlockTitleStore().getValue(),getRecordModel:t.getRecordModel,userTimeZone:(0,s.r)()}),r=t.getRenderableContentStores().map((e=>e.getValue())).filter(d.$K);return{title:o,content:[u.jm({rootBlock:{...t.pointer,spaceId:t.getSpaceId()},getRecordValue:t.getRecordValue}),(0,p.X4)({rootBlock:{...t.pointer,spaceId:t.getSpaceId()},getRecordValue:t.getRecordValue,blockValues:r,isWindows:e.device.isWindows,markdownSerializationOptions:(0,m.KF)(),markdownLinkifyIt:void 0}).markdown].filter(d.$K).join("\n\n")}}},772899:(e,t,n)=>{n.r(t),n.d(t,{LazyAiEligibilityUpdater:()=>a,LazyCompletionPopup:()=>i,aiDependency:()=>r});var o=n(277907);const r=new o.Ss("ai",(()=>Promise.all([n.e(62743),n.e(5242),n.e(31189),n.e(40017),n.e(99417),n.e(84654),n.e(58075),n.e(7515),n.e(31658),n.e(45741)]).then(n.bind(n,831658)))),i=(0,o.kF)(r,(e=>e.CompletionPopup)),a=(0,o.kF)(r,(e=>e.AiEligibilityUpdater))},630793:(e,t,n)=>{n.d(t,{BG:()=>c,Nv:()=>a,TE:()=>u,YK:()=>i,lG:()=>l,pz:()=>s});var o=n(237181);const r=100;function i(e,t){return e.prompt===t.prompt&&e.type===t.type}function a(e,t,n){const a=s(t).filter((t=>!i(t,e)));o.d2({userSettingsStore:t,transaction:n,data:{recent_ai_actions:[e,...a].slice(0,r)}})}function s(e){var t;return(null===(t=e.getModel())||void 0===t||null===(t=t.getSettings())||void 0===t?void 0:t.recent_ai_actions)??[]}function l(e,t,n){const r=s(t),a=r.filter((t=>!i(t,e)));r.length!==a.length&&o.d2({userSettingsStore:t,transaction:n,data:{recent_ai_actions:a}})}function c(e){const{clientPrompt:t,additionalContext:n,promptTitle:o}=e,r=null==n?void 0:n.prompt;if(("helpMeWrite"===t.key||"helpMeEdit"===t.key||"helpMeDraft"===t.key)&&r)return{type:"helpMeDraft"===t.key?"helpMeWrite":t.key,prompt:r,promptTitle:o};const i=function(e,t){if(!u(e.key))return;return null==t?void 0:t.topic}(t,n);return i?{type:"helpMeWrite",prompt:i,promptTitle:o}:void 0}const d={brainstormIdeas:!0,blogPost:!0,outline:!0,socialMediaPost:!0,pressRelease:!0,creativeStory:!0,essay:!0,poem:!0,todoList:!0,meetingAgenda:!0,prosConsList:!0,jobDescription:!0,salesEmail:!0,recruitingEmail:!0};function u(e){return d[e]}},665266:(e,t,n)=>{let o;function r(e){o=e}function i(){return o}n.d(t,{$:()=>r,K:()=>i})},438563:(e,t,n)=>{n.d(t,{M:()=>c,Z:()=>l});var o=n(667294),r=n(415095),i=n(653965),a=n(296994),s=n(924990);function l(){(0,o.useEffect)((()=>{c()}),[])}const c=i.IH((async function(){const e=await a.FF.emojiData.load();s.Z.setState((0,r.Lq)(e))}))},593951:(e,t,n)=>{n.d(t,{M:()=>i,Z:()=>s});var o=n(667294),r=n(800480);const i=new Set;function a(){for(const e of i)e()}function s(){const e=(0,r.Fy)();(0,o.useEffect)((()=>{if(e.isMobile)return document.addEventListener("scroll",a,!0),()=>{document.removeEventListener("scroll",a,!0)}}),[e.isMobile])}},885802:(e,t,n)=>{n.d(t,{IL:()=>s,ZP:()=>l});var o=n(667294),r=n(800480),i=n(525898),a=n(639500);let s={x:0,y:0,moved:!1,device:"mouse"};function l(){const e=(0,r.O7)();(0,o.useEffect)((()=>(e.device.isMobile?(window.addEventListener("touchstart",c),window.addEventListener("touchmove",d),window.addEventListener("mousedown",u),window.addEventListener("mousemove",p)):(window.addEventListener("mousedown",u),window.addEventListener("mousemove",p)),()=>{e.device.isMobile?(window.removeEventListener("touchstart",c),window.removeEventListener("touchmove",d),window.removeEventListener("mousedown",u),window.removeEventListener("mousemove",p)):(window.removeEventListener("mousedown",u),window.removeEventListener("mousemove",p))})),[e.device.isMobile])}function c(e){const t=e.touches[0];s={moved:!1,x:t.clientX,y:t.clientY,device:(0,a.Nf)(t)}}function d(e){const{x:t,y:n}=s,o=e.touches[0];(0,i.Z)(t,n,o.clientX,o.clientY)>a.Vc[(0,a.Nf)(o)]&&(s={...s,moved:!0})}function u(e){s={moved:!1,x:e.clientX,y:e.clientY,device:"mouse"}}function p(e){const{x:t,y:n}=s;(0,i.Z)(t,n,e.clientX,e.clientY)>a.Vc.mouse&&(s={...s,moved:!0})}},691851:(e,t,n)=>{n.d(t,{Q7:()=>K,NN:()=>j,vD:()=>N,w0:()=>z,RQ:()=>O});n(21703),n(757658);var o=n(667294),r=n(371663),i=n(172111),a=n(841892),s=n(12396),l=n(471924),c=n(421202),d=n(475246),u=n(429369),p=n(709291),m=n(531701),g=n(653965),f=n(401898),h=n(137810),v=n(108406),y=n(21359),b=n(316956),_=n(547307),S=n(496802),k=n(886628),w=n(724405),x=n(820616),I=n(940235),C=n(785893);function T(e){const{relatedDependencies:t}=e,n=(0,w.Fg)(),r=(0,k.VK)((()=>{const e=null==t?void 0:t.viewDeps;return e?e.map((e=>({name:e.getName(),icon:e.getFormat().collection_view_icon,type:e.getType()}))):[]}),[t.viewDeps]),i=o.useCallback((e=>(0,C.jsxs)("span",{style:{marginRight:10,display:"inline-block"},children:[(0,C.jsx)(x.F,{color:"light",viewIcon:e.icon,viewType:e.type,style:{display:"inline-block",verticalAlign:"middle",marginRight:2,marginBottom:2},size:13}),e.name]},e.name)),[]),a=[{key:"entity_type",header:void 0},{key:"entities",header:void 0}];return(0,C.jsx)(I.Z,{columns:a,rows:(()=>{const e=[],o=null==t?void 0:t.propertyDeps;if(o.length>0){const t=o.map((e=>(0,C.jsxs)("span",{style:{marginRight:10,display:"inline-block"},children:[(0,C.jsx)(s.ZP,{icon:e.icon,type:e.type,size:13,style:{display:"inline-block",verticalAlign:"middle",marginRight:2,marginBottom:2},theme:n}),e.name]},e.name))),r=(0,C.jsx)(p.FormattedMessage,{id:"appTemplates.featureBundleDelete.properties",defaultMessage:"{count, plural, one {1 property} other {{count} properties}}",values:{count:t.length}});e.push({key:"bundledProperties",columns:[[r],t]})}if(r.length>0){const t=r.map((e=>i(e))),n=(0,C.jsx)(p.FormattedMessage,{id:"appTemplates.featureBundleDelete.views",defaultMessage:"{count, plural, one {1 view} other {{count} views}}",values:{count:t.length}});e.push({key:"bundledViews",columns:[[n],t]})}return e})(),hideHeader:!0,cellStyle:{width:"40%"}})}var M=n(776798),P=n(296994),A=n(721214),R=n(433929),D=n(640357),B=n(454230),E=n(560682),F=n(95802),Z=n(206258),U=n(940663);const V=(0,p.defineMessages)({multiDBNameConnector:{id:"appTemplateHelpers.multiDBNameConnector",defaultMessage:"and"}});function N(e){const{environment:t,collectionViewBlockStore:n,collectionStore:o,databaseType:a,propertyMapping:s,typedPropertySchemas:c,transaction:d}=e;if(o.isTypedCollection())throw new Error("Collection is already typed");const u=r.LI[a].blockUri,p=a,m={};Object.entries(s).forEach((e=>{let[n,r]=e;if(!r||r===i.bK)return;const a=c[n],s=o.getSchema()[r];if(!s)throw new Error("Mapped property does not exist");a&&a.type!==s.type&&(b.LC({environment:t,collectionStore:o,property:r,type:a.type,transaction:d}),m[r]=s.type)}));const g=Object.entries(s).filter((e=>{let[t,n]=e;return n===i.bK})).map((e=>{let[t,n]=e;return t})),f={};g.forEach((e=>{const t=c[e];t&&(f[e]=t)})),Object.entries(f).forEach((e=>{let[n,r]=e;const i=b.G3({environment:t,collectionStore:o,collectionViewArgs:void 0,propertyName:r.name,propertyType:r.type,transaction:d});s[n]=i})),S.FH({stores:[n],update:{app_id:l.Il(),app_config_uri:u,app_uri_map:{[u]:n.id,[p]:o.id}},transaction:d}),S.FH({stores:[o],update:{app_config_uri:p,app_uri_map:s,mapped_property_types:m},transaction:d})}function O(e){var t;const{environment:n,collectionContextStore:o,transaction:r}=e,i=o.collectionStore(),a=o.collectionViewBlockStore();if(!i||!a)return;const s=(null===(t=i.getFormat())||void 0===t?void 0:t.mapped_property_types)??{};Object.entries(s).forEach((e=>{let[t,o]=e;b.LC({environment:n,collectionStore:i,property:t,type:o,transaction:r})})),S.FH({stores:[a],update:{app_id:void 0,app_config_uri:void 0,app_uri_map:void 0},transaction:r}),S.FH({stores:[i],update:{app_config_uri:void 0,app_uri_map:void 0,mapped_property_types:void 0},transaction:r}),v.g2({environment:n,database_type:void 0,collectionContextStore:o})}async function L(e){const{environment:t,blockStore:n}=e,o=n.getFormat().app_id;if(!o)return[n];const r=await y.getCollectionViewBlocksByAppId(t,{spaceId:n.getSpaceId(),appId:o}),i=n.getParentStore();return"success"!==r.type||void 0===i?[n]:r.data.result.map((e=>Z.G.createChildStore(i,{table:c.iU,id:e.blockId,spaceId:n.getSpaceId()})))}async function j(e){const{environment:t,block:n,action:o}=e,i=n.getFormat().app_config_uri||"";if(i===r.NB&&(A.y.locallyMutatedTasksDatabase=!0),U.rC.includes(i)){const e=await async function(e){const{environment:t,blockStore:n}=e,o=n.getParentStore();if(!o)return[n];const r=await L({environment:t,blockStore:n}),i=o.id;return r.filter((e=>{var t;return(null===(t=e.getParentStore())||void 0===t?void 0:t.id)===i}))}({environment:t,blockStore:n});if(e.length<=1)return[n];const r=function(e,t,n){if("delete"===e)return{message:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBDeleteAlert.message",defaultMessage:"Are you sure you want to delete {dbName}?",values:{dbName:t.getTitleValue()}}),description:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBDeleteAlert.description",defaultMessage:"{appName} work closely together. You can delete them together, or you might encounter issues after deletion.",values:{appName:n}}),allLabel:(0,C.jsx)("div",{style:{maxWidth:"300",textOverflow:"ellipsis",overflowX:"hidden"},children:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBDeleteAlert.allLabel",defaultMessage:"Delete {appName}",values:{appName:n}})}),cancelLabel:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBDeleteAlert.cancelLabel",defaultMessage:"Cancel"}),oneLabel:(0,C.jsx)("div",{style:{maxWidth:"300",textOverflow:"ellipsis",overflowX:"hidden"},children:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBDeleteAlert.oneLabel",defaultMessage:"Delete {dbName} only",values:{dbName:t.getTitleValue()}})}),actionIcon:E.y};if("move"===e)return{message:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBMoveAlert.message",defaultMessage:"Are you sure you want to move {dbName}?",values:{dbName:t.getTitleValue()}}),description:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBMoveAlert.description",defaultMessage:"{appName} work closely together. You can move them together, or you might encounter issues after separating.",values:{appName:n}}),allLabel:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBMoveAlert.allLabel",defaultMessage:"Move together"}),cancelLabel:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBMoveAlert.cancelLabel",defaultMessage:"Cancel"}),oneLabel:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBMoveAlert.oneLabel",defaultMessage:"Only move {dbName}",values:{dbName:t.getTitleValue()}}),actionIcon:D.n};if("duplicate"===e)return{message:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBDuplicateAlert.message",defaultMessage:"Are you sure you want to duplicate {dbName}?",values:{dbName:t.getTitleValue()}}),description:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBDuplicateAlert.description",defaultMessage:"{appName} work closely together. You can duplicate them together, or you might encounter issues after separating.",values:{appName:n}}),allLabel:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBDuplicateAlert.allLabel",defaultMessage:"Duplicate together"}),cancelLabel:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBDuplicateAlert.cancelLabel",defaultMessage:"Cancel"}),oneLabel:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.multiDBDuplicateAlert.oneLabel",defaultMessage:"Only duplicate {dbName}",values:{dbName:t.getTitleValue()}}),actionIcon:B.a};throw(0,f.t1)(e)}(o,n,function(e){if(1===e.length)return e[0].getTitleValue().toString();let t="";for(let n=0;n<e.length-1;n++)t+=e[n].getTitleValue(),e.length>2?t+=", ":t+=" ";return t+=`${R.default.formatMessage(V.multiDBNameConnector)} ${e[e.length-1].getTitleValue()}`,t}(e)),i=await function(e,t){const{message:n,description:o,allLabel:r,cancelLabel:i,oneLabel:s,actionIcon:l}=e;return new Promise((e=>{_.showDialog({showCancel:!1,keepFocus:!1,message:(0,C.jsxs)("div",{style:{textAlign:"center"},children:[(0,C.jsxs)("span",{style:{display:"inline-block",verticalAlign:"-0.15em",position:"relative"},children:[(0,C.jsx)("img",{src:a.Z.images.appPackages.projectsIconSvg,style:{width:"1.4em",height:"1.4em"}}),l({width:"0.9em",height:"0.9em",position:"absolute",fill:m.O9.red,right:"-0.3em",bottom:"0.05em"})]}),(0,C.jsx)("div",{style:{fontWeight:h.Z.fontWeight.semibold,margin:"0.7em"},children:n}),(0,C.jsx)("div",{style:{fontSize:14},children:o})]}),items:"delete"===t?[{label:s,color:"red",onAccept:()=>{e("one")}},{label:r,onAccept:()=>{e("all")}},{label:i,onAccept:()=>{e("cancel")}}]:[{label:r,color:"blue",onAccept:()=>{e("all")}},{label:s,onAccept:()=>{e("one")}},{label:i,onAccept:()=>{e("cancel")}}],handleCancel:()=>{e("cancel")}})}))}(r,o);if("cancel"===i)return"user_canceled";const s=[n];if("all"===i)for(const t of e)if(t.id!==n.id){const e=F.C.findSelectablesFromIds([t.id]);e.length>0?s.push(e[0].props.store):s.push(t)}return s}return[n]}async function K(e){const{environment:t,collectionViewBlockStore:n,appParentStore:o}=e,r=n.getFormat().app_id,i=r?await y.getCollectionViewBlocksByAppId(t,{spaceId:n.getSpaceId(),appId:r}):void 0;return"success"===(null==i?void 0:i.type)?i.data.result.map((e=>Z.G.createChildStore(o,{table:c.iU,id:e.blockId,spaceId:n.getSpaceId()}))):[n]}async function z(e){var t;let{environment:n,property:o,collectionContextStore:r,theme:i,from:a}=e;const{appTemplatesSetupActions:l,appConfigs:m}=await P.FF.AppTemplates.load(),f=r.collectionStore(),v=r.collectionViewBlockStore(),y=null==v?void 0:v.getCollectionViewStores();if(!(f&&v&&y&&v.getFormat().app_config_uri))return!1;const b=f.getSchema()[o],S=f.getFormat().app_config_uri;if(!b||!S)return!1;const k=(0,U.YB)(m(),S);if(!k)return!1;const w=g.oA([...Object.keys(f.getPropertyMapping()||{}),...Object.keys((null===(t=v.getFormat())||void 0===t?void 0:t.app_uri_map)||{})]),x=(0,U.cn)(w,k),I=g.oA([x.find((e=>e.uri===o))]),A=(0,U.Af)({validDependencies:I,dependencies:x,collectionStore:f,collectionViewBlockStore:v,viewStores:y}),{validDependencies:R}=A;if(0===R.length)return!1;const D=null==v?void 0:v.getParentStore();if(!f||!v||!D||D.table!==d.bx&&D.table!==c.iU&&D.table!==u.e0)return!1;const B=await K({environment:n,collectionViewBlockStore:v,appParentStore:D}),E=[{label:(0,C.jsx)(p.FormattedMessage,{id:"appTemplatesHelpers.bundledPropertyDelete.deleteMessage",defaultMessage:"{count, plural, one {Delete} other {Delete all}}",values:{count:R.length}}),color:"red",onAccept:()=>l.removeTypedDependencies({environment:n,dependencies:R,appCollectionViewBlockStores:B,from:a})}],F=R.length>1&&(0,C.jsx)(T,{relatedDependencies:A,collectionContextStore:r});return _.showDialog({message:(0,C.jsxs)("div",{style:{textAlign:"center"},children:[(0,C.jsx)("span",{style:{fontWeight:h.Z.fontWeight.medium},children:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.bundledPropertyDelete.message",defaultMessage:"Delete {property} property for everyone on {databaseName}?",values:{databaseName:(0,C.jsx)(M.Z,{style:{display:"inline",fontWeight:h.Z.fontWeight.medium},shouldWrap:!0,store:f}),property:(0,C.jsxs)("span",{children:[(0,C.jsx)(s.ZP,{icon:b.icon,type:b.type,size:18,style:{verticalAlign:"middle",display:"inline-block",marginRight:3,marginBottom:2},theme:i}),b.name]})}})}),R.length>1&&(0,C.jsx)("div",{style:{margin:"0.17em"},children:(0,C.jsx)("span",{style:{fontSize:13,fontWeight:h.Z.fontWeight.light},children:(0,C.jsx)(p.FormattedMessage,{id:"appTemplateHelpers.bundledPropertyDelete.description",defaultMessage:"These related entities will also be deleted since they work together."})})})]}),description:F,showCancel:!0,keepFocus:!0,innerStyle:{width:480},items:E}),!0}},940663:(e,t,n)=>{n.d(t,{$L:()=>F,Af:()=>X,Au:()=>B,BQ:()=>I,Dl:()=>x,EE:()=>L,EU:()=>C,Ep:()=>E,FQ:()=>Y,Hw:()=>O,JN:()=>U,KC:()=>w,Mi:()=>A,R8:()=>j,RN:()=>H,Th:()=>te,Wo:()=>b,YB:()=>k,YC:()=>ne,cR:()=>N,ck:()=>M,cn:()=>Z,fm:()=>D,h7:()=>V,hZ:()=>Q,iX:()=>_,kB:()=>W,kY:()=>S,os:()=>P,rC:()=>J,rm:()=>ee,tX:()=>K});n(757658),n(21703);var o=n(371663),r=n(846283),i=n(172111),a=n(576205),s=n(435011),l=n(10070),c=n(253877),d=n(977657),u=n(842875),p=n(396367),m=n(509844),g=n(653965),f=n(401898),h=n(426991),v=n(385555),y=n(530874);function b(e,t){return e.find((e=>e.uri===t))}function _(e,t){return e.find((e=>e.presets.some((e=>e.uri===t))))}function S(e,t){return e.flatMap((e=>e.presets)).find((e=>e.uri===t))}function k(e,t){if(!t)return;return e.find((e=>e.allFeatures.find((e=>{if(I(e))for(const n of e.dependencies)if("collection"===n.type&&n.uri===t)return!0}))))}function w(e,t){const n=_(e,t.uri);if(!n)return[];return[...t.requiredFeatures,...t.defaultOnFeatures].filter((e=>{const t=n.allFeatures.find((t=>t.uri===e.featureUri));if(!t)return!1;const{type:o}=e;return"simple"===o?"dependencies"in t:"with_variant"===o?"variants"in t:void(0,f.t1)(o)}))}function x(e){return"variants"in e&&(0,i.dD)(e.collectionUri)}function I(e){return"dependencies"in e&&(0,i.dD)(e.collectionUri)}function C(e){return"dependencies"in e&&(0,i.Tx)(e.collectionUri)}const T=[r.k.Owner];function M(e,t){const n=k(e,t);if(n)for(const o of n.allFeatures)if(I(o)){const e=o.dependencies.find((e=>"collection"===e.type&&e.uri===t));if(e)return e.value.schema??{}}}function P(e){let{featurePointers:t,appConfig:n}=e;const o=g.oA(t.map((e=>{const{type:t}=e;return"simple"===t?e.featureUri:"with_variant"===t?e.defaultVariantUri:void(0,f.t1)(t)}))),r={};for(const s of n.allFeatures)r[s.uri]=s;const i=o.map((e=>r[e])).filter((e=>I(e))),a={};for(const s of i)for(const e of s.dependencies)a[e.uri]=e;return Object.values(a)}function A(e){return e.endsWith(o.WN)}const R={[o.Es.Status]:["status","checkbox","select"]};function D(e,t,n){const o=t.type,r=e in R?R[e]:[o];return Object.entries(n).filter((e=>{let[t,n]=e;if(n)return r.includes(n.type)}))}function B(e,t){const n={};for(const[o,r]of Object.entries(e)){if(!o.startsWith("notion://"))continue;if(null==r?void 0:r.type){const e=D(o,r,t);1===e.length&&(n[o]=e[0][0])}}return n}function E(e){var t,n,o,r,s,c,d,u;const{environment:p,viewDependency:m,collectionStore:g}=e,v=l.aQ.derivePropertyUris((null==g?void 0:g.getSchema())??{},null==g?void 0:g.getPropertyMapping()),y=m.optionalProperties??[],b=e=>!y.includes(e)&&!v.has(e),_=m.value;switch(_.type){case"table":case"list":case"gallery":case"timeline":if(null!==(t=_.format)&&void 0!==t&&t.collection_group_by){const e=_.format.collection_group_by.property;if(!(0,i.Pf)(e)||b(e))return!1}if(null!==(n=_.query2)&&void 0!==n&&n.timeline_by){const e=_.query2.timeline_by;if(!(0,i.Pf)(e)||b(e))return!1}break;case"board":if(null!==(o=_.format)&&void 0!==o&&o.board_columns_by){const e=_.format.board_columns_by.property;if(!(0,i.Pf)(e)||b(e))return!1}if(null!==(r=_.format)&&void 0!==r&&r.collection_group_by){const e=_.format.collection_group_by.property;if(!(0,i.Pf)(e)||b(e))return!1}break;case"calendar":if(null!==(s=_.query2)&&void 0!==s&&s.calendar_by){const e=_.query2.calendar_by;if(!(0,i.Pf)(e)||b(e))return!1}break;case"chart":if(null!==(c=_.format)&&void 0!==c&&c.chart_config){var S;if("placeholder"===(null===(S=_.format)||void 0===S?void 0:S.chart_config.type))return!1;if("groups_reducer"===_.format.chart_config.dataConfig.type){const e=_.format.chart_config.dataConfig.groupBy;if(!(0,i.Pf)(e.property)||b(e.property))return!1}else{const e=_.format.chart_config.dataConfig.nameProperty;if(!(0,i.Pf)(e)||b(e))return!1}}break;case"page":case"form_editor":return!1;default:(0,f.t1)(_.type)}const k=e=>!!(0,a.Oo)(e)||(0,i.Pf)(e.property)&&!b(e.property);if(null!==(d=_.format)&&void 0!==d&&d.property_filters)for(const i of _.format.property_filters){if(!z(i.filter,k))return!1;if(!(0,h.qf)(p,i.filter,g))return!1}if(null!==(u=_.query2)&&void 0!==u&&u.filter){const e=_.query2.filter;if(e.filters)for(const t of e.filters){if(!q(t,k))return!1}}return!0}function F(e){const{environment:t,appConfig:n,collectionStore:o,collectionViewBlockStore:r}=e,i=n.allFeatures.filter((e=>(e=>{var n;if(!I(e)||1!==e.dependencies.length||"collection_view"!==e.dependencies[0].type)return!1;const i=e.dependencies[0],a=r.getFormat().app_config_uri,s=o.getFormat().app_config_uri,l=(null===(n=r.getFormat())||void 0===n?void 0:n.app_uri_map)??{};return!(!a||!s)&&i.collectionViewBlockUri===a&&i.collectionUri===s&&!(i.uri in l)&&!(!v.default.checkGate({gateName:"charts_mvp"})&&"notion://projects/task_by_status_feature"===e.uri)&&E({environment:t,viewDependency:i,collectionStore:o})})(e)));return g.mN(i,"uri")}function Z(e,t){return U(e,t.allFeatures)}function U(e,t){const n=[];for(const o of t)(I(o)||C(o))&&n.push(...o.dependencies);return g.mN(n.filter((t=>e.includes(t.uri))),(e=>e.uri))}function V(e){return"app_container"===e.getFormatStore().getKeyStore("collection_view_sub_type").getValue()}function N(e,t,n,i){if(t===o.GZ&&n===r.k.Owner)return!0;const a=l.aQ.derivePropertyUri(n,i.getPropertyMapping());if(!a)return!1;const s=function(e,t){if(t===o.GZ)return T;const n=M(e,t);return n?Object.keys(n):void 0}(e,t);return!!s&&s.includes(a)}function O(e,t,n){return(0,p.un)(e,t,n)}function L(e){return e===o.Kk||e===o.tD}function j(e){return e!==o.g3}function K(e,t){const n=[];for(const r of t)"property"===r.type||"database_template"===r.type?e.has(r.collectionUri)&&n.push(r):"block"===r.type?e.has(r.parentUri)&&n.push(r):"collection"!==r.type&&"collection_view"!==r.type||e.has(r.collectionViewBlockUri)&&n.push(r);let o=[];return n.length>0&&(o=K(new Set(n.map((e=>e.uri))),t)),[...n,...o]}function z(e,t){return!!t(e)}function q(e,t){if((0,a.aN)(e)){if(!z(e,t))return!1}else{if((0,a.Mm)(e))return!0;if(e.filters)for(const n of e.filters){if(!q(n,t))return!1}}return!0}function H(e,t){const n=[];if(e.filters)for(const o of e.filters){const e=G(o,t);if(!e)throw new Error("Invalid filter");n.push(e)}return{...e,filters:n}}function G(e,t){if((0,a.aN)(e))return null!=t&&t[e.property]?{...e,property:t[e.property]}:e;if((0,a.Mm)(e))return e;if((0,a.vA)(e)){if(e.filters){const n=[];for(const o of e.filters){const e=G(o,t);if(!e)throw new Error("Invalid filter");n.push(e)}return{operator:e.operator,filters:n}}}else(0,f.t1)(e)}function W(e){const{collectionViewBlockStore:t,dependencyUri:n}=e,o=null==t?void 0:t.getCollectionViewStores();if(!t)return;return null==o?void 0:o.find((e=>e.getAppConfigUri()===n))}function $(e){const{propertyDependency:t,viewDependency:n,collectionViewStore:o,collectionStore:r}=e;if(n.optionalProperties&&n.optionalProperties.includes(t.uri))return!1;const i=o.getQuery(r.getSchema()),s=o.getFormat(),l=null==i?void 0:i.sort;if(l){if(l.some((e=>t.uri===e.property)))return!0}const c=o.getFormat().property_filters;if(c){const e=e=>!(0,a.Oo)(e)&&e.property===t.uri;if(c.some((t=>z(t.filter,e))))return!0}const d=null==i?void 0:i.filter;if(void 0!==d&&d.filters){const e=e=>!!(0,a.Oo)(e)||e.property!==t.uri;for(const t of d.filters){if(!q(t,e))return!0}}switch(o.getType()){case"table":case"list":case"gallery":case"timeline":if(s.collection_group_by){if(s.collection_group_by.property===t.uri)return!0}if(null!=i&&i.timeline_by){if(i.timeline_by===t.uri)return!0}break;case"board":if(s.board_columns_by){if(s.board_columns_by.property===t.uri)return!0}if(s.collection_group_by){if(s.collection_group_by.property===t.uri)return!0}break;case"calendar":if(null!=i&&i.calendar_by){if(i.calendar_by===t.uri)return!0}}return!1}function Y(e,t){const n=(0,u.r)(),o=(0,c.em)(e,1,n);return(0,c.fZ)(o.valueOf(),o.plus({weeks:t}).minus({days:1}).valueOf(),n)}function Q(e,t){const n=(0,c.DF)(e,(0,u.r)()).plus({days:t});return(0,c.ME)(n)}const J=[o.NB,o.Aw,o.J1];function X(e){var t;const{dependencies:n,collectionStore:o,collectionViewBlockStore:r,viewStores:i,validDependencies:a}=e,c=n.filter((e=>"property"===e.type)),d=[...c.filter((e=>"rollup"===e.propertySchema.type)),...c.filter((e=>"formula"===e.propertySchema.type))],u=n.filter((e=>"collection_view"===e.type)),p=l.aQ.derivePropertyUris(o.getSchema(),o.getPropertyMapping()),m=null===(t=r.getFormat())||void 0===t?void 0:t.app_uri_map,g={validDependencies:a,propertyDeps:[],viewDeps:[]};if(!p||!m)return g;for(const l of d){if(!p.has(l.uri))continue;const e=o.getSchema()[l.uri];if(e){if("rollup"===e.type){const t=a.some((t=>t.uri===e.relation_property));t&&(a.push(l),g.propertyDeps.push(e))}if("formula"===e.type){const t=(0,s.pV)(e).some((e=>{for(const t of a)if(t.uri===e)return!0}));t&&(a.push(l),g.propertyDeps.push(e))}}}for(const s of u){if(!m[s.uri])continue;const e=i.find((e=>e.id===m[s.uri]));if(!e)continue;a.some((t=>"property"===t.type&&$({propertyDependency:t,viewDependency:s,collectionViewStore:e,collectionStore:o})))&&(a.push(s),g.viewDeps.push(e))}return g.validDependencies=a,g}function ee(){return v.default.checkGate({gateName:"typed_db_migration"})}function te(){return y.Z.getIntegrationsAsRecordMap().getModel({table:m.K2,id:d.Dv})&&v.default.checkGate({gateName:"cron_connected_relation"})}function ne(e,t){const n=S(e,t);if(!n)throw new Error(`Preset not found for URI: ${t}`);const{name:o,icon:r}=n;return{name:o,icon:r}}},51592:(e,t,n)=>{n.d(t,{A7:()=>S,Mn:()=>h,Q_:()=>y,sN:()=>v,tV:()=>_,x1:()=>b});n(667294);var o=n(172111),r=n(709291),i=n(401898),a=n(433929),s=n(798165),l=n(367669),c=n(738195),d=n(252942),u=n(382792),p=n(80444),m=n(206258),g=n(785893);c.a,u.w,d.D;const f=(0,r.defineMessages)({page:{defaultMessage:"Page",id:"dbTypesHelpers.singlePage.displayName"},tasks:{defaultMessage:"Task",id:"dbTypesHelpers.singleTask.displayName"},projects:{defaultMessage:"Project",id:"dbTypesHelpers.singleProject.displayName"}});f.page,f.tasks,f.projects;function h(e){return a.default.formatMessage((0,o.J2)(e))}function v(e,t){return a.default.formatMessage((0,o.tq)(e,t))}function y(e,t){return a.default.formatMessage((0,o.Xj)(e,t))}function b(e){var t;let{typedCollections:n,spaceStore:o,environment:r}=e;const a={},c={},d={},u={},g={},f=null===(t=p.default.state.currentUserStore)||void 0===t?void 0:t.id;for(const p of n){if(f){if("none"===(0,l.Dt)({userId:f,store:p}).role){c[p.id]=p;continue}}const e=(0,s.u3)(p);if(!e)continue;const t=_({environment:r,spaceStore:o,collectionStore:p});switch(t){case"team":u[e.id]=[...u[e.id]||[],p],e instanceof m.zX&&(g[e.id]=e);break;case"private":a[p.id]=p;break;case"shared":d[p.id]=p;break;default:(0,i.t1)(t)}}return{privateDatabases:a,restrictedDatabases:c,sharedDatabases:d,teamDatabases:u,teamStores:g}}function _(e){let{environment:t,spaceStore:n,collectionStore:o}=e;const r=(0,s.u3)(o);return r&&r.canRead()?r instanceof m.zX?"team":r.isTopLevelPrivatePage({spaceStore:n,environment:t})?"private":"shared":"shared"}function S(e,t){return(0,g.jsx)(r.FormattedMessage,{...t,defaultMessage:"This property is required for {databaseType}.",id:"database.requiredPropertyExplanation",description:"Educate the users on why this property cannot be deleted.",values:{databaseType:h(e)}})}},123924:(e,t,n)=>{n.d(t,{gD:()=>d,mL:()=>l,qJ:()=>c});n(757658);var o=n(10070),r=n(421202),i=n(344499),a=n(798165),s=n(51592);function l(e){let{environment:t,typedDatabases:n,spaceStore:o,joinedTeamIds:r,blocksToFilterParents:i}=e;const l=function(e){let{environment:t,typedDatabases:n,spaceStore:o,joinedTeamIds:r}=e;const{sharedDatabases:i,privateDatabases:a,restrictedDatabases:l,teamDatabases:c}=(0,s.x1)({environment:t,typedCollections:n,spaceStore:o}),d=Object.values(l),u=Object.values(a),p=Object.values(i),m=function(e){let{teamDatabases:t,joinedTeamIds:n}=e;const o=[];for(const[s,l]of Object.entries(t))for(const e of l)o.push([s,e]);if(0===o.length)return[];const r=Object.keys(t).filter((e=>!n.includes(e))),i=[...n,...r],a=o.sort(((e,t)=>{let[n,o]=e,[r,a]=t;return i.indexOf(n)-i.indexOf(r)||String(o.getName()).localeCompare(String(a.getName()))})).map((e=>{let[t,n]=e;return n}));return a}({teamDatabases:c,joinedTeamIds:r});return[...m,...p,...u,...d]}({environment:t,spaceStore:o,typedDatabases:n.filter((e=>{const t=(0,a.VP)(e);return!t||!t.isArchived()})),joinedTeamIds:r});return c({typedDatabases:l,blocksToFilterParents:i})}function c(e){let{typedDatabases:t,blocksToFilterParents:n}=e;const o=n?new Set((0,i.qB)(n)):void 0;return t.filter((e=>{if(!e.canEdit())return!1;if(!o)return!0;const t=e.getParentPointer();return!t||t.table!==r.iU||!o.has(t.id)}))}function d(e){const t=e.getPropertyMapping(),n=e.getSchema();return o.aQ.toViewSchema(n,t)}},828344:(e,t,n)=>{n.r(t),n.d(t,{trackAIChatTranscriptHistoryChatDeleted:()=>D,trackAIChatTranscriptHistoryItemRestored:()=>A,trackAIChatTranscriptHistoryNewChatCreated:()=>R,trackAcceptAllPill:()=>j,trackAiChatTranscriptHistoryOpenHistoryButtonSelected:()=>B,trackAiDetectedGetSupportPillClick:()=>P,trackAiDetectedGetSupportPillTriggered:()=>M,trackAssistantClosed:()=>u,trackAssistantFollowUpShareButtonClick:()=>ae,trackAssistantIntroModalClose:()=>w,trackAssistantIntroModalRead:()=>x,trackAssistantIntroModalTryNow:()=>C,trackAssistantLimitBlurSeen:()=>ie,trackAssistantOpened:()=>d,trackAssistantShareModalCopyImageFailure:()=>ce,trackAssistantShareModalCopyImageSuccess:()=>le,trackAssistantShareModalDismiss:()=>se,trackAssistantSkillSuggestedButtonClick:()=>$,trackAssistantSuggestedSkillGroupClick:()=>W,trackAssistantTutorialFollowupActionSelected:()=>oe,trackAssistantTutorialStarted:()=>te,trackAssistantTutorialStepChange:()=>ne,trackAtMentionClick:()=>G,trackCloseFullPageChatHistory:()=>F,trackDiscardAllPill:()=>z,trackExpandFullPageChatHistory:()=>E,trackInferenceEnd:()=>m,trackInferenceStart:()=>p,trackInsertPill:()=>L,trackLeapDismissed:()=>X,trackLeapLinkClick:()=>ee,trackLeapPreferenceSelect:()=>Y,trackLeapPresented:()=>J,trackLeapSubmit:()=>Q,trackLearnMoreAboutAssistantClicked:()=>I,trackLeavingFullPageChat:()=>H,trackOpeningHelpFromThreeDotMenu:()=>O,trackOpeningThreeDotMenu:()=>N,trackQnASilentRetry:()=>h,trackQnaBackToSearch:()=>b,trackQnaCitationsSeeMoreClick:()=>S,trackQnaCitationsToggle:()=>_,trackQnaFeedbackGiven:()=>v,trackQnaReminderShown:()=>T,trackQnaResultClicked:()=>y,trackQnaSessionInitialized:()=>k,trackSavePagePill:()=>K,trackScopeSearchMenuClose:()=>V,trackScopeSearchMenuOpen:()=>Z,trackScopeSearchToggle:()=>U,trackSeeAllSkillsPill:()=>q,trackUserClickedAssistantTryAgain:()=>g,trackUserStoppedAssistantOutput:()=>f});n(757658);var o=n(116638),r=n(249902),i=n(401898),a=n(855337),s=n(521273),l=n(728495),c=n(390837);function d(e,t){const{sessionId:n,startTimestamp:o,transcript:i,hasQuery:l,searchSessionId:c,from:d,isReminder:u,reminderType:p}=t,m=s.Z.isXMLAssistantEnabled(),g=s.Z.isLimitedQnaMode(),f=m?"assistant_open":"qna_open";a.K4(e,f,{qna_session_id:n,has_query:l,search_session_id:c,is_limited_qna_session:g,from:d,is_reminder:u,reminder_type:p}),r.j({name:f,args:{qna_session_id:n,from:d,duration:Date.now()-o,questions_asked_in_session:i.filter((e=>"human"===e.type)).length??0,is_reminder:u,reminder_type:p,is_limited_qna_session:g}})}function u(e,t){const{sessionContext:n,from:o}=t,i=null==n?void 0:n.assistantConfigurationState,l=s.Z.isXMLAssistantEnabled(),c=s.Z.isLimitedQnaMode(),d=l?"assistant_close":"qna_close",u=null==i?void 0:i.sessionStartTimestamp;a.K4(e,d,{qna_session_id:null==i?void 0:i.sessionId,qna_session_length:u?Date.now()-u:0,from:o,is_limited_qna_session:c}),r.j({name:d,args:{qna_session_id:(null==i?void 0:i.sessionId)??"",is_limited_qna_session:c,from:o,duration:u?Date.now()-u:-1,questions_asked_in_session:(null==n?void 0:n.evaluator.getTranscript().filter((e=>"human"===e.type)).length)??0}})}function p(e){var t;const{environment:n,configurationState:r,inferenceId:c,source:d,mentionsUsed:u,skillType:p,from:m}=e;let g;const f=r?r.searchScope:o.QA;if("everything"===f.type||"workspace"===f.type||"notion"===f.type||"slack"===f.type||"helpdocs"===f.type||"labeler"===f.type||"google-drive"===f.type||"github"===f.type||"universal-none"===f.type||"notion-none"===f.type||"web"===f.type||"slackbot"===f.type||"universal-workspace"===f.type);else if("teamspace"===f.type)g=f.teamId;else if("page"===f.type)g=f.pageId;else{if("collection"!==f.type)return(0,i.t1)(f);g=f.collectionId}const h=s.Z.isXMLAssistantEnabled(),v=s.Z.isLimitedQnaMode(),y=re(),b=(null==r||null===(t=r.temporaryUserInputData)||void 0===t?void 0:t.isRetrying)??!1,_=h?"assistant_inference_start":"qna_inference_start";a.K4(n,_,{qna_session_id:r?r.sessionId:void 0,qna_inference_id:c,is_limited_qna_session:v,is_retry:b,is_suggested_question:"suggested_question"===d,is_reminder_suggested_question:"reminder_suggested_question"===d,is_abandoned_search_suggested_question:"abandoned_search_suggested_question"===d,search_scope_type:f.type,search_scope_id:g,mentions_used:u,skill_type:p,from:m,search_sources:y,assistant_opened_from:l.d.state.from})}function m(e,t){const{configurationState:n,inferenceId:o,timeTook:r,numCitationsShown:i,numSearchResults:c,numSlackSearchResults:d,numGoogleDriveSearchResults:u,searchedHelpdocs:p,topCitationIndex:m,avgCitationIndex:g,citationsBySource:f,resultsBySource:h,selectedSkill:v,assistantActions:y,from:b}=t;if(!n)return;const _=s.Z.isXMLAssistantEnabled(),S=re();_?a.j({environment:e,event:{eventName:"assistant_inference_end",eventProperties:{session_id:n.sessionId,inference_id:o,time_took:r,num_citations_shown:i,num_search_results:c,num_slack_search_results:d,num_google_drive_search_results:u,searched_helpdocs:p,top_citation_index:m,avg_citation_index:g,citations_by_source:f,results_by_source:h,selected_skill:v,assistant_actions:(null==y?void 0:y.length)?y:["none"],search_sources:S,from:b,assistant_opened_from:l.d.state.from}}}):a.K4(e,"qna_inference_end",{qna_session_id:n.sessionId,qna_inference_id:o,time_took:r,num_citations_shown:i,num_search_results:c,num_slack_search_results:d,top_citation_index:m,avg_citation_index:g,citations_by_source:f,search_sources:S,from:b,assistant_opened_from:l.d.state.from})}function g(e,t){a.j({environment:e,event:{eventName:"assistant_user_clicked_try_again",eventProperties:{session_id:t.sessionId,assistant_surface_type:t.assistantSurfaceType}}})}function f(e,t){a.j({environment:e,event:{eventName:"assistant_output_stopped_by_user",eventProperties:{session_id:t.sessionId,assistant_surface_type:t.assistantSurfaceType}}})}function h(e,t){a.K4(e,"qna_silent_retry",{qna_session_id:t.sessionId,event:t.event})}function v(e,t,n,o){t&&a.K4(e,"qna_feedback_given",{qna_session_id:t.sessionId,qna_inference_id:n,sentiment:o})}function y(e,t){const{configurationState:n,clickedPageId:o,resultType:r,source:i}=t;n&&a.K4(e,"qna_result_clicked",{qna_session_id:n.sessionId,clicked_page_id:o,result_type:r,source:i})}function b(e,t){a.K4(e,"qna_back_to_search",{qna_session_id:t.sessionId})}function _(e,t){a.K4(e,"qna_citations_toggle",{qna_session_id:t.sessionId,shown:t.shown})}function S(e,t){a.K4(e,"qna_citations_see_more_click",{qna_session_id:t.sessionId})}function k(e,t){a.K4(e,"qna_session_initialized",{current_initialization_count:t.current_initialization_count})}function w(e,t){a.K4(e,"assistant_intro_modal_close",t)}function x(e,t){a.K4(e,"assistant_intro_modal_read",t)}function I(e,t){a.K4(e,"assistant_learn_more_about_assistant_clicked",t)}function C(e,t){a.K4(e,"assistant_intro_modal_continue",t),d(e,{hasQuery:!1,isReminder:!1,transcript:[],searchSessionId:void 0,sessionId:"",startTimestamp:Date.now(),reminderType:void 0,from:"assistant_intro_modal"})}function T(e,t){a.K4(e,"qna_reminder_shown",{number:t.number})}function M(e,t){a.K4(e,"ai_get_help_triggered",{sessionId:t.sessionId})}function P(e,t){a.K4(e,"ai_get_help_click",{sessionId:t.sessionId})}function A(e,t){a.K4(e,"ai_chat_transcript_history.restored",t)}function R(e,t){a.K4(e,"ai_chat_transcript_history.new_chat_created",t)}function D(e,t){a.K4(e,"ai_chat_transcript_history.chat_deleted",t)}function B(e,t){a.K4(e,"ai_chat_transcript_history.open_history_button_selected",t)}function E(e){a.K4(e,"ai_full_page_chat_history.expand")}function F(e){a.K4(e,"ai_full_page_chat_history.close")}function Z(e,t){a.K4(e,"ai_scoped_search_menu_open",t)}function U(e,t){const{from:n,scope:o}=t;let r;if("everything"===o.type||"workspace"===o.type||"notion"===o.type||"slack"===o.type||"helpdocs"===o.type||"labeler"===o.type||"google-drive"===o.type||"universal-none"===o.type||"github"===o.type||"notion-none"===o.type||"web"===o.type||"slackbot"===o.type||"universal-workspace"===o.type);else if("teamspace"===o.type)r=o.teamId;else if("page"===o.type)r=o.pageId;else{if("collection"!==o.type)return(0,i.t1)(o);r=o.collectionId}a.K4(e,"ai_scoped_search_toggle",{from:n,search_scope_type:o.type,search_scope_id:r})}function V(e,t){a.K4(e,"ai_scoped_search_menu_close",t)}function N(e,t){a.K4(e,"ai_three_dot_menu.open",t)}function O(e,t){a.K4(e,"ai_three_dot_menu.accessing_help",t)}function L(e,t){a.K4(e,"ai_action_pill.insert",t)}function j(e,t){a.K4(e,"ai_action_pill.accept_all_edits",t)}function K(e,t){a.K4(e,"ai_action_pill.save_page",t)}function z(e,t){a.K4(e,"ai_action_pill.discard_all_edits",t)}function q(e,t){a.K4(e,"ai_see_all_skills",t)}function H(e){a.K4(e,"ai_full_page_exit")}function G(e){a.K4(e,"ai_at_mention_click")}function W(e,t){a.K4(e,"assistant_suggested_skill_group_click",t)}function $(e,t){a.K4(e,"assistant_suggested_skill_option_click",t)}function Y(e,t){a.K4(e,"leap_select",t)}function Q(e,t){a.K4(e,"leap_submit",t)}function J(e){a.K4(e,"leap_presented")}function X(e){a.K4(e,"leap_dismissed")}function ee(e,t){a.K4(e,"leap_open_link",t)}function te(e,t){a.K4(e,"assistant_tutorial_started",t)}function ne(e,t){a.K4(e,"assistant_tutorial_step_change",t)}function oe(e,t){a.K4(e,"assistant_tutorial_followup_action_selected",t)}function re(){const e=["notion"];if(s.Z.canShowUniversalSearchScopes()){const{inProgress:t,connectedApps:n}=c.y.state;null!=n&&n.includes("slack-admin")&&!t&&e.push("slack")}if(s.Z.canShowUniversalGoogleDriveSearchScope()){const{connectedApps:t}=c.y.state;null!=t&&t.includes("google-drive")&&e.push("google-drive")}return(s.Z.canUseMaybeNotionHelpSearchArg()||s.Z.canShowHelpdocsScope())&&e.push("helpdocs"),e}function ie(e){const{environment:t}=e;a.j({environment:t,event:{eventName:"assistant_limit_blur_seen",eventProperties:{}}})}function ae(e){const{environment:t,sessionId:n,assistantSurfaceType:o}=e;a.j({environment:t,event:{eventName:"assistant_follow_up_share_action_user_clicked_button",eventProperties:{session_id:n,assistant_surface_type:o}}})}function se(e){const{environment:t,sessionId:n,assistantSurfaceType:o}=e;a.j({environment:t,event:{eventName:"assistant_follow_up_share_action_user_dismissed_share_modal",eventProperties:{session_id:n,assistant_surface_type:o}}})}function le(e){const{environment:t,sessionId:n,assistantSurfaceType:o}=e;a.j({environment:t,event:{eventName:"assistant_follow_up_share_action_user_copied_image_success",eventProperties:{session_id:n,assistant_surface_type:o}}})}function ce(e){const{environment:t,sessionId:n,assistantSurfaceType:o}=e;a.j({environment:t,event:{eventName:"assistant_follow_up_share_action_user_copied_image_failure",eventProperties:{session_id:n,assistant_surface_type:o}}})}},215342:(e,t,n)=>{n.d(t,{n:()=>s});n(667294);var o=n(818441),r=n(121278),i=n(785893);const a=16/(0,r.O)("small");function s(e){const{variant:t}=e,n=function(e){return(0,r.O)(e)*a}(t);return(0,i.jsx)(i.Fragment,{children:(0,o.t)({width:n,pointerEvents:"none"})})}},152183:(e,t,n)=>{n.d(t,{P:()=>s});n(667294);var o=n(724405),r=n(121278),i=n(168866),a=n(785893);function s(e){const{variant:t,imgSource:n,style:s,shadowVariant:l="strong"}=e,c=e.wrapWithPadding??!0,d=(0,o.yK)((e=>{const n=(0,r.O)(t);return{faceImgWrap:{width:n,height:n,borderRadius:"100%",background:e.assistantCornerButtonBackground,..."strong"===l&&{boxShadow:e.largeLightBoxShadow},..."light"===l&&{borderRadius:"50%",boxShadow:e.lightBoxShadow},overflow:"hidden"},faceImg:{height:n,width:n,...c&&{pointerEvents:"none"},...s}}}),[t,l,c,s]),u=(0,a.jsx)("img",{style:d.faceImg,src:n??i,alt:"Notion AI face"});return c?(0,a.jsx)("div",{style:{cursor:"pointer"},children:(0,a.jsx)("div",{style:d.faceImgWrap,children:u})}):u}},9353:(e,t,n)=>{n.d(t,{dX:()=>y,h9:()=>v,fy:()=>g,D_:()=>b,Oc:()=>f});var o=n(667294),r=n(886628),i=n(724405),a=n(818441),s=n(521273),l=n(215342),c=n(152183),d=n(993491);const u=n.p+"c9223887dcb57b7d.gif",p=n.p+"7e9cbd56b1eca7b9.gif";var m=n(785893);function g(e){const{variant:t,style:n,forceSparkles:o}=e;let i;return i=(0,r.VK)((()=>!o&&s.Z.shouldShowAssistantFace()),[o])?(0,m.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,m.jsx)(c.P,{variant:t,shadowVariant:"light"})}):(0,m.jsx)(l.n,{variant:o?"small":t}),(0,m.jsx)("div",{style:n,children:i})}function f(e){const{variant:t}=e,n=(0,r.VK)((()=>s.Z.shouldShowAssistantFace()),[]),o=(0,i.yK)((()=>({sparklesWrapper:{borderRadius:"100%",border:"2px solid RGB(182,208,240)",marginRight:8,marginLeft:8,padding:4},badge:{position:"absolute",left:"27px",top:"-5px"},faceWrapper:{marginRight:8}})),[]);return n?(0,m.jsx)("div",{style:o.faceWrapper,children:(0,m.jsx)(h,{variant:t})}):(0,m.jsxs)("div",{style:o.sparklesWrapper,children:[(0,m.jsx)(l.n,{variant:t}),(0,m.jsx)("div",{style:o.badge,children:(0,m.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:(0,m.jsx)("circle",{cx:"5",cy:"5.5",r:"4",fill:"#2383E2",stroke:"white",strokeWidth:"2"})})})]})}function h(e){const{variant:t}=e,n="dark"===(0,i.Fg)().mode,[r,a]=(0,o.useState)(!0);(0,o.useEffect)((()=>{setTimeout((()=>{a(!1)}),6e3)}),[]);const s=(0,o.useMemo)((()=>{if(r)return n?u:p}),[n,r]);return(0,m.jsx)("div",{style:{marginLeft:8},children:(0,m.jsx)(c.P,{variant:t,shadowVariant:"light",wrapWithPadding:!0,imgSource:s})})}function v(){const e=(0,r.VK)((()=>s.Z.shouldShowAssistantFace()),[]),t=(0,i.yK)((e=>({faceImgStyles:{width:20,height:20,background:e.assistantCornerButtonBackground,borderRadius:"50%",border:`1px solid ${e.tableDividerColor}`},sparklesIconStyle:{width:16,height:16,fill:e.icon.secondary}})),[]);return e?(0,m.jsx)("img",{style:t.faceImgStyles,src:d,role:"presentation",alt:"Notion AI Face"}):(0,a.t)(t.sparklesIconStyle)}function y(){const e=(0,r.VK)((()=>s.Z.shouldShowAssistantFace()),[]),t=(0,i.yK)((e=>({faceImgStyles:{width:22,height:22,background:e.assistantCornerButtonBackground,borderRadius:"50%",border:`1px solid ${e.tableDividerColor}`,marginLeft:-3,marginRight:-3},sparklesIconStyle:{width:16,height:16}})),[]);return e?(0,m.jsx)("img",{style:t.faceImgStyles,src:d,role:"presentation",alt:"Notion AI Face"}):(0,a.t)(t.sparklesIconStyle)}function b(){const e=(0,r.VK)((()=>s.Z.shouldShowAssistantFace()),[]),t=(0,i.yK)((e=>({faceImgStyles:{width:20,height:20,background:e.assistantCornerButtonBackground,borderRadius:"50%",border:`1px solid ${e.tableDividerColor}`,marginLeft:-2,marginRight:2},sparklesIconStyle:{width:16,height:16,marginRight:2},sparklesIconWrapper:{borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center"}})),[]);return e?(0,m.jsx)("img",{style:t.faceImgStyles,src:d,role:"presentation",alt:"Notion AI Face"}):(0,m.jsx)("div",{style:t.sparklesIconWrapper,children:(0,a.t)(t.sparklesIconStyle)})}},121278:(e,t,n)=>{n.d(t,{O:()=>i});var o=n(401898),r=n(486467);function i(e){return"avatar"===e?r.IX:"xsmall"===e?18:"small"===e?28:"medium"===e?36:"large"===e?50:(0,o.t1)(e)}},791683:(e,t,n)=>{n.d(t,{Bt:()=>b,Qz:()=>y,Tw:()=>_,lW:()=>k});n(252262);var o=n(730120),r=n(667294),i=n(886628),a=n(401898),s=n(619584),l=n(210228),c=n(237181),d=n(402551),u=n(80444),p=n(521273),m=n(85844),g=n(428956),f=n(828344);const h=[3,4],v=4*s.C0,y=h.length;function b(e){const[t,n]=(0,r.useState)(),[l,c]=(0,r.useState)((()=>o.ou.utc())),[u,f]=(0,r.useState)(!1),y=(0,i.VK)((()=>p.Z.showRemindersToUseQnA()),[]);return(0,r.useEffect)((()=>{const e=setTimeout((()=>{f(!0),c(o.ou.utc())}),v);return()=>clearTimeout(e)}),[]),(0,d.W)((()=>{c(o.ou.utc())}),5*s.hM,u&&y),(0,i.VK)((()=>{if(!y)return;if(!u)return;if((0,a.$K)(t))return;if(!m.Z.state.isVisible)return;if(e)return;const r=function(e){const{now:t}=e,n=_();if(!n)return;return function(e){var t;const{currentUserSettings:n,now:r}=e;if(null===(t=g.Z.state)||void 0===t||!t.isEligible)return;if(!(0,a.$K)(n.last_exposed_to_ai_qna_at))return;if(p.Z.showAssistantNotionAiCopy()&&"complete"!==n.ai_assistant_onboarding_phase)return;const i=n.qna_reminders_shown_at??[],s=i.length,l=h.at(s);if(!(0,a.$K)(l))return;if(0===s){if(r.diff(o.ou.fromMillis(n.last_exposed_to_ai_qna_at),"days").days<l)return}else{if(r.diff(o.ou.fromMillis(i[s-1]),"days").days<l)return;const e=i[s-1];if(n.last_exposed_to_ai_qna_at>=e)return}return{number:s+1,update:{qna_reminders_shown_at:[...i,r.toMillis()]}}}({currentUserSettings:n,now:t})}({now:l});(0,a.$K)(r)&&n(r)}),[y,u,t,l,e]),t}function _(){const{currentUserSettingsStore:e}=u.default.state;if(!e)return;return{last_exposed_to_ai_qna_at:e.getSettingsStore().getKeyStore("last_exposed_to_ai_qna_at").getValue(),qna_reminders_shown_at:e.getSettingsStore().getKeyStore("qna_reminders_shown_at").getValue(),ai_qna_abandoned_search_reminder_shown_at:e.getSettingsStore().getKeyStore("ai_qna_abandoned_search_reminder_shown_at").getValue(),ai_assistant_onboarding_phase:e.getSettingsStore().getKeyStore("ai_assistant_onboarding_phase").getValue(),assistant_summarize_this_page_shown_at:e.getSettingsStore().getKeyStore("assistant_summarize_this_page_shown_at").getValue()}}function S(){const{currentUserSettingsStore:e}=u.default.state;if(e)return e.getSettingsStore().getKeyStore("qna_sessions_initialized").getValue()??0}function k(e){const{currentUserSettingsStore:t}=u.default.state;if(!t)return;const n=S();void 0!==n&&(l.createAndCommit({environment:e,userAction:"useApplicableQnaReminder.updateQnaUsageCount",perform:e=>{c.d2({userSettingsStore:t,transaction:e,data:{qna_sessions_initialized:n+1}})}}),(0,f.trackQnaSessionInitialized)(e,{current_initialization_count:n+1}))}},81598:(e,t,n)=>{n.r(t),n.d(t,{LazyAssistantCollectionViewButton:()=>f,LazyAssistantFullPageChat:()=>i,LazyAssistantMenuPopup:()=>l,LazyAssistantOriginElement:()=>a,LazyAssistantScopedSearchMenuPopup:()=>u,LazyAssistantShareModal:()=>m,LazyMobileAssistantPendingOperationsCollapsedElement:()=>d,LazyModalOverlayCollectionListView:()=>s,LazyRelatedPageContentPopup:()=>g,LazyReportBadQnAForm:()=>p,LazySearchAssistantPane:()=>c,assistantDependency:()=>r});var o=n(277907);const r=new o.Ss("assistant",(()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(67120),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(30874),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(86621),n.e(94539),n.e(67899),n.e(32833),n.e(48721)]).then(n.bind(n,464212)))),i=(0,o.kF)(r,(e=>e.AssistantFullPageChat)),a=(0,o.kF)(r,(e=>e.AssistantOriginElement)),s=(0,o.kF)(r,(e=>e.ModalOverlayCollectionListView)),l=(0,o.kF)(r,(e=>e.AssistantMenuPopup)),c=(0,o.kF)(r,(e=>e.SearchAssistantPane)),d=(0,o.kF)(r,(e=>e.MobileAssistantPendingOperationsCollapsedElement)),u=(0,o.kF)(r,(e=>e.AssistantScopedSearchMenuPopup)),p=(0,o.kF)(r,(e=>e.ReportBadQnAForm)),m=(0,o.kF)(r,(e=>e.AssistantShareModal)),g=(0,o.kF)(r,(e=>e.RelatedPageContentPopup)),f=(0,o.kF)(r,(e=>e.AssistantCollectionViewButton))},995853:(e,t,n)=>{n.d(t,{l:()=>a});var o=n(749085),r=n(292595);class i extends o.default{getInitialState(){return{isActive:!1}}isPageTutorialPage(e){return!!this.state.isActive&&this.state.peekPageStore.id===e}commitEdits(){this.state.isActive&&this.setState({...this.state,editsAreCommitted:!0})}}const a=new i;(0,r.exposeDebugValue)("AssistantTutorialStore",a)},669128:(e,t,n)=>{n.d(t,{JV:()=>r,Pf:()=>a});var o=n(749085);const r=5;class i extends o.default{getInitialState(){return{type:"idle"}}isAvailable(){return"ready"===this.state.type&&this.state.questions.length>0}}const a=new i},266402:(e,t,n)=>{n.d(t,{j:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isOpen:!1}}open(e){const{collectionViewBlockId:t,collectionViewId:n,assistantSessionId:o}=e;this.setState({isOpen:!0,collectionViewBlockId:t,collectionViewId:n,assistantSessionId:o})}close(){this.setState({isOpen:!1})}}const i=new r},390837:(e,t,n)=>{n.d(t,{y:()=>a});var o=n(749085),r=n(471924);class i extends o.default{getInitialState(){return{inProgress:!1,isPublicSync:!1,isPrivateSync:!1,selection:{allSelected:!0,selectedChannels:[],excludedChannels:[],joinFutureChannels:!0,isDisconnecting:!1},isSyncCompleted:!1,currentScreen:"none",sessionId:r.Il(),analyticsFrom:"unknown",authUrl:void 0,canQuery:!1,connectedApps:void 0,noChannelsSelected:void 0,ingestionProgress:void 0}}}const a=new i},65994:(e,t,n)=>{n.d(t,{DZ:()=>g,Ep:()=>p,Jj:()=>u,YC:()=>m});n(21703);var o=n(667294),r=n(886628),i=n(14577),a=n(709291),s=n(849117),l=n(785893);const c=new WeakMap,d=(0,o.createContext)({automationStore:void 0,contextType:void 0,defined:!1,typecheckResult:void 0});d.displayName="AutomationContext";function u(e){const{automationStore:t,children:n,contextType:o}=e,u=(0,a.useIntl)(),p=(0,r.VK)((()=>{const e=function(e){const{automationStore:t,contextType:n,intl:o}=e,r=c.get(t);if(r)return r;{const e=new i.ZP((()=>(0,s.kP)({automationStore:t,contextType:n,intl:o})),{debugName:"automationContextTypecheckResultCachedStore"});return c.set(t,e),e}}({automationStore:t,contextType:o,intl:u});return e.state}),[t,o,u]);return(0,l.jsx)(d.Provider,{value:{automationStore:t,typecheckResult:p,contextType:o,defined:!0},children:n})}function p(e){var t;return null===(t=c.get(e))||void 0===t?void 0:t.state}function m(){const e=o.useContext(d);if(!1===e.defined)throw new Error("No automation context found!");return e}function g(){return o.useContext(d)}},241301:(e,t,n)=>{n.d(t,{Fp:()=>m,Mm:()=>p,So:()=>f,TU:()=>g});n(667294);var o=n(886628),r=n(724405),i=n(786433),a=n(709291),s=n(653965),l=n(401898),c=n(849117),d=n(65994),u=n(785893);const p=(0,a.defineMessages)({missingTargetDatabase:{id:"clientAutomationHelpers.errorMessages.missingTargetDatabase",defaultMessage:"Missing a target database"},missingNotificationCollectionPointer:{id:"clientAutomationHelpers.errorMessages.missingNotificationCollectionPointer",defaultMessage:"Missing database for property target"},missingNotificationTarget:{id:"clientAutomationHelpers.errorMessages.missingNotificationTarget",defaultMessage:"Missing notification recipients"},missingRecipients:{id:"clientAutomationHelpers.errorMessages.missingRecipients",defaultMessage:"Missing notification recipients"},missingEmailSubject:{id:"clientAutomationHelpers.errorMessages.missingEmailSubject",defaultMessage:"Missing email subject"},missingEmailBody:{id:"clientAutomationHelpers.errorMessages.missingEmailBody",defaultMessage:"Missing notification email body"},missingNotificationMessage:{id:"clientAutomationHelpers.errorMessages.missingNotificationMessage",defaultMessage:"Missing notification message"},missingNotificationPropertyId:{id:"clientAutomationHelpers.errorMessages.missingPropertyId",defaultMessage:"Missing target property"},missingNotificationFormulaValue:{id:"clientAutomationHelpers.errorMessages.missingFormulaValue",defaultMessage:"Missing recipients"},invalidNotificationFormulaValue:{id:"clientAutomationHelpers.errorMessages.invalidFormulaValue",defaultMessage:"Invalid recipients"},invalidNotificationPropertyId:{id:"clientAutomationHelpers.errorMessages.invalidPropertyId",defaultMessage:"Invalid property type"},deletedNotificationPropertyId:{id:"clientAutomationHelpers.errorMessages.deletedPropertyId",defaultMessage:"Property was deleted"},missingTargetPage:{id:"clientAutomationHelpers.errorMessages.missingTargetPage",defaultMessage:"Missing a target"},invalidTemplatePage:{id:"clientAutomationHelpers.errorMessages.invalidTemplatePage",defaultMessage:"Invalid template."},noActions:{id:"clientAutomationHelpers.errorMessages.noActions",defaultMessage:"This button has no actions"},createPageButtonError:{id:"clientAutomationHelpers.errorMessages.createPageButtonError",defaultMessage:"Add page is missing a target database"},collectionInTrashButtonError:{id:"clientAutomationHelpers.errorMessages.collectionInTrashButtonError",defaultMessage:"Target database is in trash"},blockInTrashButtonError:{id:"clientAutomationHelpers.errorMessages.blockInTrashButtonError",defaultMessage:"Target block is in trash"},createPageButtonTemplateError:{id:"clientAutomationHelpers.errorMessages.createPageWithTemplateError",defaultMessage:"Add page has an invalid template"},openPageButtonError:{id:"clientAutomationHelpers.errorMessages.openPageButtonError",defaultMessage:"Open page is missing a target"},openPageOrUrlButtonError:{id:"clientAutomationHelpers.errorMessages.openPageOrUrlButtonError",defaultMessage:"Open page or URL is missing a target"},updatePagesButtonError:{id:"clientAutomationHelpers.errorMessages.editPagesButtonError",defaultMessage:"Edit pages is missing a target database"},slackNotificationAuthenticationError:{id:"clientAutomationHelpers.errorMessages.slackNotificationError",defaultMessage:"Slack notification is missing an authentication."},slackNotificationTargetError:{id:"clientAutomationHelpers.errorMessages.slackNotificationTargetError",defaultMessage:"Slack notification is missing a target channel."},sendGmailNotificationAuthenticationError:{id:"clientAutomationHelpers.errorMessages.sendGmailNotificationError",defaultMessage:"Gmail notification is missing an authentication."},noInstructions:{id:"clientAutomationHelpers.errorMessages.noInstructionsError",defaultMessage:"AI action is missing instructions"},missingRequiredRecordError:{id:"clientAutomationHelpers.errorMessages.missingRequiredRecordError",defaultMessage:"Action is missing access to a record"},aiDisabledInSpace:{id:"clientAutomationHelpers.errorMessages.aiDisabledInSpace",defaultMessage:"AI is turned off"},aiDisabledInSpaceSubtitle:{id:"clientAutomationHelpers.errorMessages.aiDisabledInSpaceSubtitle",defaultMessage:"Ask admin to turn on in workspace settings"},aiDisabledForGuest:{id:"clientAutomationHelpers.errorMessages.aiDisabledForGuest",defaultMessage:"Only workspace members can use automations with AI actions"},unsupportedSkill:{id:"clientAutomationHelpers.errorMessages.unsupportedSkill",defaultMessage:"Unsupported settings"},invalidConfig:{id:"clientAutomationHelpers.errorMessages.invalidConfig",defaultMessage:"Unsupported settings"}});function m(e){if("create_page"===e.actionType)if("missing_required_config"===e.type){if("collection"===e.key)return{forAction:p.missingTargetDatabase,forButtonTooltip:p.createPageButtonError};(0,l.t1)(e)}else{if("invalid_optional_config"===e.type)return{forAction:p.invalidTemplatePage,forButtonTooltip:p.createPageButtonTemplateError};if("collection_in_trash"===e.type)return{forAction:p.invalidTemplatePage,forButtonTooltip:p.collectionInTrashButtonError};(0,l.t1)(e)}else if("update_pages"===e.actionType)if("missing_required_config"===e.type){if("target"===e.key)return{forAction:p.missingTargetDatabase,forButtonTooltip:p.updatePagesButtonError};(0,l.t1)(e)}else{if("collection_in_trash"===e.type)return{forAction:p.invalidTemplatePage,forButtonTooltip:p.collectionInTrashButtonError};if("block_in_trash"===e.type)return{forAction:p.invalidTemplatePage,forButtonTooltip:p.blockInTrashButtonError};(0,l.t1)(e)}else if("open_page"===e.actionType)if("missing_required_config"===e.type){if("target"===e.key)return{forAction:p.missingTargetPage,forButtonTooltip:(0,c.Ic)()?p.openPageOrUrlButtonError:p.openPageButtonError};(0,l.t1)(e)}else(0,l.t1)(e);else if("slack_notification"===e.actionType)if("missing_required_config"===e.type){if("external_bot_id"===e.key)return{forAction:p.slackNotificationAuthenticationError,forButtonTooltip:p.slackNotificationAuthenticationError};if("target"===e.key)return{forAction:p.slackNotificationTargetError,forButtonTooltip:p.slackNotificationTargetError};(0,l.t1)(e)}else if("missing_required_value"===e.type){if("external_bot_id"===e.key)return{forAction:p.slackNotificationAuthenticationError,forButtonTooltip:p.slackNotificationAuthenticationError};(0,l.t1)(e)}else(0,l.t1)(e);else if("send_in_app_notification"===e.actionType)if("missing_required_config"===e.type){if("target"===e.key)return{forAction:p.missingNotificationTarget,forButtonTooltip:p.missingNotificationTarget};if("notification_message"===e.key)return{forAction:p.missingNotificationMessage,forButtonTooltip:p.missingNotificationMessage};if("collectionPointer"===e.key)return{forAction:p.missingNotificationCollectionPointer,forButtonTooltip:p.missingNotificationCollectionPointer};if("propertyId"===e.key)return{forAction:p.missingNotificationPropertyId,forButtonTooltip:p.missingNotificationPropertyId};if("formulaValue"===e.key)return{forAction:p.missingNotificationFormulaValue,forButtonTooltip:p.missingNotificationFormulaValue};(0,l.t1)(e)}else if("invalid_required_config"===e.type){if("propertyId"===e.key)return{forAction:p.invalidNotificationPropertyId,forButtonTooltip:p.invalidNotificationPropertyId};if("formulaValue"===e.key)return{forAction:p.invalidNotificationFormulaValue,forButtonTooltip:p.invalidNotificationFormulaValue};(0,l.t1)(e)}else if("deleted_required_config"===e.type){if("propertyId"===e.key)return{forAction:p.deletedNotificationPropertyId,forButtonTooltip:p.deletedNotificationPropertyId};(0,l.t1)(e)}else(0,l.t1)(e);else if("send_gmail_notification"===e.actionType)if("missing_required_config"===e.type){if("to"===e.key)return{forAction:p.missingRecipients,forButtonTooltip:p.missingRecipients};if("email_subject"===e.key)return{forAction:p.missingEmailSubject,forButtonTooltip:p.missingEmailSubject};if("email_body"===e.key)return{forAction:p.missingEmailBody,forButtonTooltip:p.missingEmailBody};if("formulaValue"===e.key)return{forAction:p.missingNotificationFormulaValue,forButtonTooltip:p.missingNotificationFormulaValue};if("external_bot_id"===e.key)return{forAction:p.sendGmailNotificationAuthenticationError,forButtonTooltip:p.sendGmailNotificationAuthenticationError};(0,l.t1)(e)}else if("invalid_required_config"===e.type){if("to"===e.key)return{forAction:p.invalidNotificationFormulaValue,forButtonTooltip:p.invalidNotificationFormulaValue};if("cc"===e.key)return{forAction:p.invalidNotificationFormulaValue,forButtonTooltip:p.invalidNotificationFormulaValue};if("bcc"===e.key)return{forAction:p.invalidNotificationFormulaValue,forButtonTooltip:p.invalidNotificationFormulaValue};if("reply_to"===e.key)return{forAction:p.invalidNotificationFormulaValue,forButtonTooltip:p.invalidNotificationFormulaValue};(0,l.t1)(e)}else(0,l.t1)(e);else if("assistant_basic"===e.actionType){if("empty_instructions"===e.type)return{forAction:p.noInstructions,forButtonTooltip:p.noInstructions};if("ai_disabled_in_space"===e.type)return{forAction:p.aiDisabledInSpace,forButtonTooltip:p.aiDisabledInSpace,forButtonSubtitleTooltip:p.aiDisabledInSpaceSubtitle};if("ai_disabled_for_guest"===e.type)return{forAction:p.aiDisabledForGuest,forButtonTooltip:p.aiDisabledForGuest,forButtonSubtitleTooltip:void 0};if("invalid_config"===e.type)return{forAction:p.invalidConfig,forButtonTooltip:p.invalidConfig,forButtonSubtitleTooltip:void 0};if("unsupported_skill"===e.type)return{forAction:p.unsupportedSkill,forButtonTooltip:p.unsupportedSkill,forButtonSubtitleTooltip:void 0};(0,l.t1)(e)}else(0,l.t1)(e)}function g(e){const{actionId:t,shouldShow:n,errorKey:r}=e,{typecheckResult:l}=(0,d.DZ)();return(0,o.VK)((()=>{if(!n||!l)return;let e=(0,i.pM)(l,t);r&&(e=e.filter((e=>"key"in e&&e.key===r)));const o=(0,s.Ps)(e);if(!o)return;const c=m(o);return(0,u.jsx)(f,{content:(0,u.jsx)(a.FormattedMessage,{...c.forAction})})}),[n,l,t,r])}function f(e){const{content:t,subtitle:n}=e,o=(0,r.yK)((e=>({wrap:{display:"flex",flexDirection:"column",alignItems:"center"},subtitle:{color:e.mediumInvertedTextColor}})),[]);return(0,u.jsxs)("div",{style:o.wrap,children:[(0,u.jsx)("div",{children:t}),n&&(0,u.jsx)("div",{style:o.subtitle,children:n})]})}},358564:(e,t,n)=>{n.d(t,{k:()=>i});var o=n(52315),r=n(206258);function i(e,t){const n=r.Mz.createChildStore(e,t);if(!n||!n.isDefined())return!1;const i=n.getActionStores();for(const r of i){if(!r.isDefined())return!1;const e=r.getBlockStores();for(const t of e){if(!o.b(t))return!1}}return!0}},286420:(e,t,n)=>{n.d(t,{t:()=>r});var o=n(206258);function r(e){return Boolean(e.findRecordStoreUIAncestor((e=>e instanceof o.zq&&e.isType("duplicate_blocks"))).ancestor)}},100246:(e,t,n)=>{n.d(t,{N:()=>i});var o=n(886628),r=n(358564);function i(e,t){return(0,o.VK)((()=>!(!e||!t)&&(0,r.k)(e,t)),[t,e])}},793174:(e,t,n)=>{n.d(t,{GN:()=>l,IQ:()=>s,On:()=>a,_1:()=>i,qH:()=>c});var o=n(296994),r=n(277907);const i=o.FF.automations,a=(0,r.kF)(i,(e=>e.PlacedButtonBlockEditor)),s=(0,r.kF)(i,(e=>e.AutomationWorkflowEditor)),l=(0,r.kF)(i,(e=>e.AutomationWorkflowEditorActionSection)),c=(0,r.kF)(i,(e=>e.ButtonBlockUrlPreviewPopup))},287686:(e,t,n)=>{n.d(t,{f:()=>i});n(667294);var o=n(724405),r=n(785893);function i(){const e=(0,o.yK)((e=>({span:{marginLeft:2,marginRight:2,color:e.lightTextColor}})),[]);return(0,r.jsx)("span",{style:e.span,children:"/"})}},25238:(e,t,n)=>{n.d(t,{Z:()=>p});n(667294);var o=n(800480),r=n(886628),i=n(724405),a=n(137810),s=n(731278),l=n(776798),c=n(206258),d=n(274016),u=n(785893);function p(e){const{store:t,ignoreMaxLength:n,maxWidth:p,iconSize:m,emojiSize:g,titleStyle:f,iconStyle:h,highlighter:v}=e,{device:y}=(0,o.O7)(),b=m??(y.isMobile?24:20),_=g??b,{hasIcon:S,pageIcon:k,isEmptyPage:w}=(0,r.VK)((()=>({hasIcon:t.hasIcon(),pageIcon:t.getIcon(),isEmptyPage:t instanceof c.G&&t.isEmptyPage()})),[t]),x=(0,i.yK)((()=>({containerStyle:{display:"flex",alignItems:"center",minWidth:0},teamRecordTitle:{maxWidth:p,...f},pageRecordTitle:{maxWidth:n?"none":p,...f},recordIconStyle:{marginRight:6,fontWeight:a.Z.fontWeight.medium,...h}})),[n,p,f,h]);return t instanceof c.zX?(0,u.jsxs)("div",{style:x.containerStyle,children:[(0,u.jsx)(d.p,{disabled:!0,store:t,size:b,style:x.recordIconStyle}),(0,u.jsx)(l.Z,{store:t,style:x.teamRecordTitle,highlighter:v,enableHover:!0})]}):(0,u.jsxs)("div",{style:x.containerStyle,children:[S&&(0,u.jsx)(s.Z,{disabled:!0,icon:k,isEmptyPage:w,size:b,emojiSize:_,style:x.recordIconStyle,largeIcon:!0}),(0,u.jsx)(l.Z,{store:t,style:x.pageRecordTitle,highlighter:v,enableHover:!0})]},`breadcrumb-recordtitle-${t.id}`)}},607692:(e,t,n)=>{n.d(t,{Z:()=>v});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(815145),l=n(13084),c=n(210228),d=n(231945),u=n(489728),p=n(279954),m=n(484210),g=n(287686),f=n(25238),h=n(785893);function v(e){const t=(0,r.O7)(),{device:n}=t,{store:v,showDivider:y,maxWidth:b,popupRenderer:_,iconSize:S,emojiSize:k,titleStyle:w,iconStyle:x,highlighter:I,onClick:C}=e,T=(0,a.yK)((()=>({selectable:{display:"flex",alignItems:"center",minWidth:0},button:{display:"flex",minWidth:0,fontSize:"inherit",paddingTop:2,paddingBottom:2,paddingLeft:6,paddingRight:6}})),[]),{url:M,canEdit:P}=(0,i.VK)((()=>({url:(0,m.ZP)({store:v,fullyQualified:!1,pageVisitSource:s.tY.Breadcrumb}),canEdit:v.canEdit()})),[v]),A=(0,o.useCallback)((e=>{const{droppedDirection:n,droppedStores:o,duplicate:r}=e;c.createAndCommit({userAction:"SearchPathBreadcrumb.onDrop",environment:t,perform:e=>l.LQ({environment:t,targetParentStore:v.getContentStore(),targetStore:v,droppedDirection:n,droppedStores:o,duplicate:r,transaction:e})})}),[t,v]),R=(0,h.jsx)(f.Z,{store:v,maxWidth:b,iconSize:S,emojiSize:k,titleStyle:w,iconStyle:x,highlighter:I});return(0,h.jsxs)(o.Fragment,{children:[(0,h.jsx)(p.Z,{store:v,canDropOnto:P,onSelectableDrop:A,style:T.selectable,analyticsName:"breadcrumb",shouldShowDropZone:!0,children:_?(0,h.jsx)(d.ZP,{originGap:4,popupType:n.isMobile?d.Z4.SlideUp:d.Z4.Popup,render:_,renderOrigin:e=>(0,h.jsx)(u.Z,{...e,style:T.button,isSmall:!0,shouldShrink:!0,mobileFeedback:n.isMobile,children:R})}):(0,h.jsx)(u.Z,{href:M,external:!1,style:T.button,isSmall:!0,shouldShrink:!0,mobileFeedback:n.isMobile,onClick:C,children:R})}),y&&(0,h.jsx)(g.f,{})]},v.id)}},24946:(e,t,n)=>{n.d(t,{Z:()=>h});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(231945),l=n(568785),c=n(489728),d=n(808265),u=n(296994),p=n(195697),m=n(287686),g=n(25238),f=n(785893);function h(e){const{device:t}=(0,r.O7)(),{store:n,showDivider:h,popupRenderer:v,iconSize:y,iconStyle:b,highlighter:_}=e,S=(0,a.yK)((()=>({button:{fontSize:"inherit",padding:2},loadingPopupBackground:{width:280,paddingTop:8,paddingBottom:8,display:"flex",justifyContent:"center"}})),[]),{teamsEnabled:k,storeIsDefined:w}=(0,i.VK)((()=>({teamsEnabled:(0,p.bq)(),storeIsDefined:n.isDefined()})),[n]),x=(0,o.useRef)(null);if(!w||!k)return null;return(0,f.jsxs)(o.Fragment,{children:[(0,f.jsx)(s.ZP,{originGap:4,popupType:t.isMobile?s.Z4.SlideUp:s.Z4.Popup,render:v??(e=>(0,f.jsx)(u.Pe,{renderLoading:e=>(0,f.jsx)("div",{style:S.loadingPopupBackground,children:e&&(0,f.jsx)(l.Z,{})}),teamStore:n,parent:e})),renderOrigin:o=>(0,f.jsx)(f.Fragment,{children:(0,f.jsx)(c.Z,{style:S.button,ref:x,isSmall:!0,shouldShrink:!0,mobileFeedback:t.isMobile,...o,children:(0,f.jsx)(g.Z,{store:n,maxWidth:e.maxWidth,iconSize:y,titleStyle:e.titleStyle,iconStyle:b,highlighter:_})})})}),(0,f.jsx)(d.f,{origin:x}),h&&(0,f.jsx)(m.f,{})]},n.id)}},303043:(e,t,n)=>{n.d(t,{Qe:()=>s.Z,Yo:()=>a.Z,fY:()=>i.f,l2:()=>l});var o=n(296994),r=n(277907),i=n(287686),a=n(24946),s=n(607692);const l=(0,r.kF)(o.FF.Breadcrumb,(e=>e.Breadcrumb))},560328:(e,t,n)=>{n.d(t,{GS:()=>b,M5:()=>y,XD:()=>I,Pn:()=>C,Hh:()=>T,W3:()=>w,IW:()=>S,H3:()=>v,LM:()=>k});n(757658);var o=n(730120),r=n(79571),i=n(210228),a=n(237181),s=n(277907),l=n(80444),c=n(279827);class d{constructor(e){if(this.exposures=void 0,this.exposures=new Map,e)for(const t of e){const e=t.placement;if(r.nK.includes(e)&&t.timestamps){const n=this.exposures.get(e);n?n.push(...t.timestamps):this.exposures.set(e,[...t.timestamps])}}}get(e){return this.exposures.get(e)??[]}add(e,t){let n=this.get(e);n.push(t),n.sort(((e,t)=>e-t)),n.length>10&&(n=n.slice(n.length-10)),this.exposures.set(e,n)}exportUserSetting(){return Array.from(this.exposures.entries()).map((e=>{let[t,n]=e;return{placement:t,timestamps:n}}))}}var u=n(619584),p=n(385555);class m{constructor(e,t,n){this.placement=void 0,this.cap=void 0,this.window=void 0,this.placement=e,this.cap=t,this.window=n}check(e,t){var n;const r=null===(n=l.default.state.currentUserSettingsStore)||void 0===n?void 0:n.getSettings();if(!r)return!1;const i=new d(null==r?void 0:r.callout_placement_exposures);let a;a="all"===this.placement?Array.from(i.exposures.values()).flat():i.get(this.placement);const s=o.ou.now().toMillis()-this.window;return a.filter((e=>e>=s)).length<this.cap}}class g{constructor(e){this.maxConcurrent=void 0,this.maxConcurrent=e}check(e,t){const n=(0,r.QN)(t);return c.default.getCalloutsForPlacement(n).length<this.maxConcurrent}}const f=[new class{check(e,t){var n;if(r.xg[t].custom_dismissal)return!0;const o=null===(n=l.default.state.currentUserSettingsStore)||void 0===n?void 0:n.getSettings();if(!o)return!1;for(const r of o.callout_dismissal_timestamps??[])if(r.name===t)return!1;return!0}},new class{check(e,t){const n=p.default.getConfigKey("callout_config","callout_blocklist");return!n||!n.includes(t)}},new class{check(e,t){const n=(0,r.sv)(e.device);return r.xg[t].platforms.includes(n)}}],h={Modal:[new class{constructor(e){this.minimumAccountAge=void 0,this.minimumAccountAge=e}check(e,t){var n;const r=null===(n=l.default.state.currentUserSettingsStore)||void 0===n?void 0:n.getSettings();if(!r||!r.signup_time)return!1;return o.ou.now().toMillis()-r.signup_time>this.minimumAccountAge}}(4*u.A0),new m("Modal",1,u.DS),new g(1)],SidebarFooter:[new g(1)],Tooltip:[new m("Tooltip",1,u.A0)]};function v(e,t,n){return!(!n&&!function(e,t){for(const o of f)if(!o.check(e,t))return!1;const n=(0,r.QN)(t);for(const o of h[n])if(!o.check(e,t))return!1;return!0}(e,t))&&(!!l.default.state.inAppCalloutStore.updateCalloutStatus({calloutId:t,visible:!0,validateCanShow:!n})&&(function(e,t){const n=(0,r.QN)(e);"Modal"!==n&&"SidebarFooter"!==n||c.default.state.placementStores[n].clear();t&&c.default.state.forcedCalloutsStore.add(e);c.default.state.placementStores[n].add(e)}(t,n),!0))}function y(e,t){v(e,t,!0)}function b(e,t){if(c.default.isVisible(t)){const n=(0,r.QN)(t);_(t),function(e,t){const n=l.default.state.currentUserSettingsStore,r=null==n?void 0:n.getSettings();if(!r||!n)return;const s=new d(r.callout_placement_exposures);for(const i of t)s.add(i,o.ou.now().toMillis());i.createAndCommit({environment:e,userAction:"calloutActions.addPlacementExposures",perform:e=>{a.d2({userSettingsStore:n,transaction:e,data:{callout_placement_exposures:s.exportUserSetting()}})}})}(e,[n]),function(e,t){var n;const s=l.default.state.currentUserSettingsStore,c=null==s?void 0:s.getSettings();if(!s||!c)return;let d=c.callout_dismissal_timestamps??[];null!==(n=d)&&void 0!==n&&n.some((e=>e.name===t))||d.push({name:t,timestamp:o.ou.now().toMillis()});d=d.filter((e=>r.TB.has(e.name))),i.createAndCommit({environment:e,userAction:"calloutActions.addCalloutDismissal",perform:e=>{a.d2({userSettingsStore:s,transaction:e,data:{callout_dismissal_timestamps:d}})}})}(e,t),l.default.state.inAppCalloutStore.updateCalloutStatus({calloutId:t,visible:!1})}}function _(e){const t=(0,r.QN)(e);c.default.state.forcedCalloutsStore.delete(e),c.default.state.placementStores[t].delete(e)}function S(e){const t=l.default.state.currentUserSettingsStore;if(!t)return;const n=new d;i.createAndCommit({environment:e,userAction:"calloutActions.addPlacementExposures",perform:e=>{a.d2({userSettingsStore:t,transaction:e,data:{callout_placement_exposures:n.exportUserSetting()}})}})}function k(e){const t=e.callout_dismissal_timestamps??[];for(const n of t){if(!n.name)continue;const e=(0,r.CG)(n.name);e&&(c.default.isVisible(e)&&!c.default.isForced(e)&&_(e))}}function w(e,t){const n=l.default.state.currentUserSettingsStore,o=null==n?void 0:n.getSettings();if(n&&o&&o.callout_dismissal_timestamps){let s=o.callout_dismissal_timestamps;s=s.filter((e=>r.TB.has(e.name)&&e.name!==t)),i.createAndCommit({environment:e,userAction:"calloutActions.resetDismissal",perform:e=>{a.d2({userSettingsStore:n,transaction:e,data:{callout_dismissal_timestamps:s}})}})}}const x=new s.Ss("callouts",(()=>Promise.all([n.e(97491),n.e(16006)]).then(n.bind(n,690166))));async function I(e,t){const n=await x.load();await n.maybeShowCalloutImpl(e,t)}async function C(e,t){const n=await x.load();await n.maybeShowCalloutsImpl(e,t)}async function T(e){const t=await x.load();await t.recalculateEligibleCalloutsImpl(e)}},776757:(e,t,n)=>{n.d(t,{u:()=>i});var o=n(277907);const r=new o.Ss("codeBlockValue",(()=>n.e(84753).then(n.bind(n,690773)))),i=(0,o.kF)(r,(e=>e.CodeBlockValueWithDeps))},866:(e,t,n)=>{n.d(t,{Z:()=>s,t:()=>i});var o=n(749085),r=n(915157);let i=function(e){return e[e.Left=0]="Left",e[e.Right=1]="Right",e}({});class a extends o.default{getInitialState(){return{dayStoreMap:new Map,isDragging:!1,startingMonth:0}}static getLocalViewPreferenceKey(e){return`CalendarView:${e}`}static getLocalPreferences(e){let{collectionViewId:t,currentUserId:n}=e;return r.Z.get({userId:n,key:a.getLocalViewPreferenceKey(t)})}static getLocalDateRangeStart(e){let{collectionViewId:t,currentUserId:n}=e;const o=this.getLocalPreferences({collectionViewId:t,currentUserId:n});return o&&o.dateRangeStart?o.dateRangeStart:Date.now()}static setLocalDateRangeStart(e){let{collectionViewId:t,dateRangeStart:n,currentUserId:o}=e;const i=this.getLocalPreferences({collectionViewId:t,currentUserId:o})||{},s=a.getLocalViewPreferenceKey(t),l={...i,dateRangeStart:n};r.Z.set({userId:o,key:s,value:l})}static clearLocalDateRangeStart(e){let{collectionViewId:t,currentUserId:n}=e;const o=a.getLocalViewPreferenceKey(t);r.Z.remove({userId:n,key:o})}}const s=a},125241:(e,t,n)=>{n.d(t,{$Z:()=>u,$u:()=>h,I0:()=>g,MW:()=>m,Nb:()=>v,Pz:()=>b,eC:()=>p,jj:()=>_,s0:()=>f,sP:()=>y});var o=n(886628),r=n(815145),i=n(399036),a=n(401898),s=(n(95477),n(368585)),l=n(484210),c=n(385555),d=n(206258);function u(){return(0,o.VK)((()=>p()),[])}function p(){return c.default.checkGate({gateName:"forms_mvp"})}const m=["text","title","select","multi_select","relation","date","person","file","number","checkbox"];function g(e){return(!(0,i.qQ)(e)||!(0,i.q3)(e))&&f(e.type)}function f(e){return(0,a.DE)(m,e)}function h(){return new Set(["relation","person"])}function v(e,t){return t?"closed":e?"shared_to_web":"shared_to_space"}function y(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.getIsFormPublic()?(0,l.ZP)({store:e,preferPublicLink:!0,pageVisitSource:r.tY.FormPublicPage}):(0,l.ZP)({store:e,openInCenterPeek:t,pageVisitSource:r.tY.FormInternalPage})}function b(e){var t,n;let{collectionContextStore:o,propertyId:r,questionId:i}=e;const a=o?(0,s.Pn)(o):void 0,l=null==o?void 0:o.collectionViewStore(),c=null==l?void 0:l.getFormat(),d=null==c||null===(t=c.form_block_pointer)||void 0===t?void 0:t.id;return{question_type:null==o||null===(n=o.normalizedSchemaStore.state)||void 0===n||null===(n=n[r])||void 0===n?void 0:n.type,question_id:i,form_id:d,...a??{}}}function _(e){const t=null==e?void 0:e.getFormat().form_layout_pointer;if(t)return d.xj.createChildStore(e,t)}},237524:(e,t,n)=>{n.d(t,{AV:()=>g,OG:()=>I,Xx:()=>v,bp:()=>p,bu:()=>h,f2:()=>y,iZ:()=>w,lO:()=>_,lZ:()=>b,mH:()=>m,oc:()=>k,tA:()=>f,vf:()=>x,vg:()=>S});var o=n(712137),r=n(151454),i=n(531701),a=n(110906),s=n(607709),l=n(721429),c=n(277181),d=n(224646),u=n(27724);function p(e,t){return e.col===t.col&&e.row===t.row}const m="text/_notion-table";function g(e){return{minCol:Math.min(e.start.col,e.end.col),maxCol:Math.max(e.start.col,e.end.col),minRow:Math.min(e.start.row,e.end.row),maxRow:Math.max(e.start.row,e.end.row)}}const f=14,h=32,v=h+0;function y(e){let{columnIndex:t,titleColumnIndex:n,indentLevel:o,shouldShowBulkActionsToolbar:r,isSubitemToggleOnTitleColumn:i}=e;const a=0===t&&r?v:0;return b({columnIndex:t,titleColumnIndex:n,indentLevel:o,isSubitemToggleOnTitleColumn:i})+a}function b(e){let{columnIndex:t,titleColumnIndex:n,indentLevel:o,isSubitemToggleOnTitleColumn:r}=e;return _({columnIndex:t,titleColumnIndex:n,isSubitemToggleOnTitleColumn:r})&&o>0?c.Hw*o:0}function _(e){let{columnIndex:t,titleColumnIndex:n,isSubitemToggleOnTitleColumn:o}=e;return o?t===n:0===t}function S(e){let{collectionViewBlockId:t}=e;const n=u.default.state.stores;return 0!==n.length&&!(0,a.v_)(n,t)}function k(e){const{environment:t,collectionContextStore:n,isPhone:o,stickyLeft:a,theme:s}=e;if(o)return{};const l=n.collectionViewBlockStore(),c=null==l?void 0:l.getParentBlockStore();let u;const p=n.isInPeekRendererStore.state;if("dark"===s.mode&&p&&(u=s.peekModalBackground),c&&!n.isFullScreenStore.state&&(null==l||!l.isRootOrDirectChild())){var m;const e=null===(m=c.getModel())||void 0===m?void 0:m.getFormat().block_color;e&&(u=(0,i.fi)(e,s).background)}const g=n.frozoneStore.state.scrollerLeftOffset??0,f=(0,d.Wk)(t),h=Math.max(f-g,0),v=w(t,n)?h:0,y=n.frozoneStore.state.scrollerLeftPadding;return{background:u||s.contentBackground,position:"sticky",left:(a||0)+v-(y||0),zIndex:r.I5}}function w(e,t){const n=t.collectionViewBlockStore();return!!n&&(n.isRootOrDirectChild()&&(0,s.fg)(e,n)&&!(0,a._5)(n)&&!n.isCollectionViewPageWithContent())}function x(e){const{environment:t,propertyFormat:n}=e,o=n.width;if(!t.device.isPhone)return o;const r=t.WindowSizeStore.getSafePaddingLeftPx((0,l.ui)(t)),i=t.WindowSizeStore.getSafePaddingRightPx((0,l.ui)(t)),a=t.WindowSizeStore.state.width-r-i;return o?Math.min(o,a):a}function I(e,t,n){const r=t.length,i=n.length;return{start:{col:(0,o.Z)(e.start.col,0,r-1),row:(0,o.Z)(e.start.row,0,i-1)},end:{col:(0,o.Z)(e.end.col,0,r-1),row:(0,o.Z)(e.end.row,0,i-1)}}}},559183:(e,t,n)=>{n.d(t,{N:()=>i,Z:()=>s});var o=n(749085),r=n(653965);function i(e,t){return e.collectionViewBlockStore===t.collectionViewBlockStore&&r.Xy(e.groupFormat,t.groupFormat)}class a extends o.default{getInitialState(){return{isActive:!1}}cloneState(){return r.d9(this.state)}}const s=new a},504430:(e,t,n)=>{n.d(t,{AZ:()=>q,B8:()=>U,BJ:()=>C,C1:()=>W,DS:()=>j,EW:()=>J,GK:()=>O,Ge:()=>w,Gz:()=>A,H5:()=>M,HZ:()=>Se,Ii:()=>ce,Ip:()=>z,Ne:()=>ue,PF:()=>L,Qw:()=>fe,S7:()=>y,ST:()=>B,TW:()=>F,Tp:()=>ie,Wk:()=>b,XO:()=>Z,YE:()=>ve,YP:()=>le,Zn:()=>me,_Q:()=>ne,_e:()=>P,al:()=>V,bK:()=>N,bk:()=>E,cK:()=>K,d$:()=>G,e$:()=>R,fc:()=>te,fj:()=>$,i2:()=>S,lf:()=>_,lx:()=>x,pQ:()=>ae,pe:()=>de,ph:()=>ye,px:()=>k,qG:()=>X,rr:()=>re,vX:()=>he,x2:()=>D,xI:()=>Y,xJ:()=>Q,xP:()=>oe,xd:()=>ge,y1:()=>pe,yk:()=>ee});var o=n(730120),r=n(313991),i=n(749085),a=n(830823),s=n(399036),l=n(180951),c=n(640506),d=n(407057),u=n(253877),p=n(406695),m=n(842875),g=n(915157),f=n(401898),h=n(277181),v=n(677794);const y=5,b=3,_=2,S=21;let k=function(e){return e[e.LeftResizer=0]="LeftResizer",e[e.RightResizer=1]="RightResizer",e[e.ItemDrag=2]="ItemDrag",e}({});const w=4e3,x=w/4,I=864e5,C={hours:{snapUnit:"fifteen_minutes",primaryDisplayUnit:"fifteen_minutes",secondaryDisplayUnit:"day",activeRangeType:void 0,msPerPixel:I/7e3,primaryDisplayUnitAlignment:"range_start",verticalDividerUnit:"fifteen_minutes",showWeekendIndicators:!1,hidePrimaryIndicatorIntersectionOffset:9,getDateRangePlaceholderDuration:e=>e.plus({hour:1})},day:{snapUnit:"fifteen_minutes",primaryDisplayUnit:"hour",secondaryDisplayUnit:"day",activeRangeType:void 0,msPerPixel:69120,primaryDisplayUnitAlignment:"range_start",verticalDividerUnit:"hour",showWeekendIndicators:!1,hidePrimaryIndicatorIntersectionOffset:2,getDateRangePlaceholderDuration:e=>e.plus({hour:3})},week:{snapUnit:"day",primaryDisplayUnit:"day",secondaryDisplayUnit:"month",activeRangeType:"highlight_days",msPerPixel:48e4,primaryDisplayUnitAlignment:"range_middle",verticalDividerUnit:"day",showWeekendIndicators:!0,hidePrimaryIndicatorIntersectionOffset:void 0,getDateRangePlaceholderDuration:e=>e.plus({day:1})},bi_week:{snapUnit:"day",primaryDisplayUnit:"day",secondaryDisplayUnit:"month",activeRangeType:"highlight_days",msPerPixel:108e4,primaryDisplayUnitAlignment:"range_middle",verticalDividerUnit:void 0,showWeekendIndicators:!0,hidePrimaryIndicatorIntersectionOffset:void 0,getDateRangePlaceholderDuration:e=>e.plus({day:3})},month:{snapUnit:"day",primaryDisplayUnit:"day",secondaryDisplayUnit:"month",activeRangeType:"highlight_days",msPerPixel:216e4,primaryDisplayUnitAlignment:"range_middle",verticalDividerUnit:void 0,showWeekendIndicators:!0,hidePrimaryIndicatorIntersectionOffset:void 0,getDateRangePlaceholderDuration:e=>e.plus({day:5})},quarter:{snapUnit:"day",primaryDisplayUnit:"week",secondaryDisplayUnit:"month",activeRangeType:"display_range",msPerPixel:72e5,primaryDisplayUnitAlignment:"range_start",verticalDividerUnit:"month",showWeekendIndicators:!1,hidePrimaryIndicatorIntersectionOffset:35,getDateRangePlaceholderDuration:e=>e.plus({week:2})},year:{snapUnit:"day",primaryDisplayUnit:"week",secondaryDisplayUnit:"month",activeRangeType:"display_range",msPerPixel:I/5,primaryDisplayUnitAlignment:"range_start",verticalDividerUnit:"month",showWeekendIndicators:!1,hidePrimaryIndicatorIntersectionOffset:6,getDateRangePlaceholderDuration:e=>e.plus({week:4})}},T="month";function M(e){var t;return null===(t=P(e))||void 0===t?void 0:t.property}function P(e){const t=e.normalizedFormatStore.state.timeline_arrows_by;if(null==t||!t.property)return;const n=e.normalizedSchemaStore.state[t.property],o=e.collectionStore();return n&&"relation"===n.type&&n.property&&o&&(0,s.F0)(n)===o.id?{property:t.property,inverse:n.property}:void 0}function A(e){return{zoomLevel:i.default.createValue(T,{name:"zoomLevel"}),currentRange:i.default.createValue({startTimestamp:0,endTimestamp:0},{name:"currentRange"}),dragState:i.default.createValue(void 0,{name:"dragState"}),drawState:i.default.createValue(void 0,{name:"drawState"}),hoveredItem:i.default.createValue(void 0,{name:"hoveredItem"}),dateRangePlaceholder:i.default.createValue({active:!1},{name:"dateRangePlaceholder"}),scrollLeft:i.default.createValue(void 0,{name:"scrollLeft"}),outerSizeObserver:new v.E,timelineSizeObserver:new v.E,horizontalScroller:void 0,savePreference:void 0,isFullScreen:e.isFullScreen,isRootChild:e.isRootChild,destroyed:!1}}function R(e,t){return t/C[e].msPerPixel}function D(e,t){return t*C[e].msPerPixel}function B(e){return"fifteen_minutes"===e||"hour"===e}function E(e){const{store:t,query:n,schema:o,userId:r,intl:i}=e,l=t.getModel();if(!l)return;const c=t.getAssociatedCollectionStore(),{timeline_by:d,timeline_by_end:p}=n;if(!d)return;const g=o[d];if(!g||!(0,s.Lt)(g))return;const f=new Map,h=(0,a.FT)({property:d,schema:o,block:l,getRecordModel:t.getRecordModel,propertyMapping:null==c?void 0:c.getPropertyMapping(),collectionRequestContext:{userId:r,userTimeZone:(0,m.r)(),depth:0,intl:i,visitedProperties:new Set,resultCache:f}}).next().value;if("date"!==(null==h?void 0:h.type))return;const v=h.value;if(!p||d===p)return v;{const e=o[p];if(!e||!(0,s.Lt)(e))return;const n=(0,a.FT)({property:p,schema:o,block:l,getRecordModel:t.getRecordModel,propertyMapping:null==c?void 0:c.getPropertyMapping(),collectionRequestContext:{userId:r,userTimeZone:(0,m.r)(),depth:0,intl:i,visitedProperties:new Set,resultCache:f}}).next().value;if(n&&"date"===n.type){const e=n.value,t=u.rH(v,e);if(t)return u.Qq(t)}}}function F(e){const{store:t,dateValue:n,query:o}=e,{timeline_by:r,timeline_by_end:i}=o;if(!r)return;const a=t.getAssociatedCollectionStore(),d=(null==a?void 0:a.getSchema())??e.schema,u=(null==a?void 0:a.getMappedProperty(r))??r,p=i?(null==a?void 0:a.getMappedProperty(i))??i:void 0,m=d[u];if(m&&(0,s.Lt)(m)){if(!p||u===p)return{[u]:(0,l.d7)(n)};{const e=d[u];if(!e||!(0,s.Lt)(e))return;const o=(0,l.Gl)(t.getPropertyValue(u)),r=(0,l.Gl)(t.getPropertyValue(p));if("date"===n.type)return{[u]:(0,l.d7)({type:"date",start_date:n.start_date,reminder:c.V3(o)}),[p]:(0,l.d7)({type:"date",start_date:n.start_date,reminder:c.V3(r)})};if("daterange"===n.type)return{[u]:(0,l.d7)({type:"date",start_date:n.start_date,reminder:c.V3(o)}),[p]:(0,l.d7)({type:"date",start_date:n.end_date,reminder:c.V3(r)})};if("datetime"===n.type)return{[u]:(0,l.d7)({type:"datetime",start_date:n.start_date,start_time:n.start_time,time_zone:n.time_zone,reminder:c._3(o)}),[p]:(0,l.d7)({type:"datetime",start_date:n.start_date,start_time:n.start_time,time_zone:n.time_zone,reminder:c._3(r)})};if("datetimerange"===n.type)return{[u]:(0,l.d7)({type:"datetime",start_date:n.start_date,start_time:n.start_time,time_zone:n.time_zone,reminder:c._3(o)}),[p]:(0,l.d7)({type:"datetime",start_date:n.end_date,start_time:n.end_time,time_zone:n.time_zone,reminder:c._3(r)})};(0,f.t1)(n)}}}function Z(e,t){const n=B(t),o=u.NK(n?e:c.Dy(e),(0,m.r)()),r=j(o.start,t),i=n&&"date"===e.type?o.start.plus({days:1}).startOf("day"):o.end||r;return{start:r,end:n?j(i,t):z(i,t)}}function U(e){return`timeline:${e}`}function V(e){const{horizontalScroller:t,outerSizeObserver:n}=e,o=e.zoomLevel.state,{startTimestamp:r}=e.currentRange.state;return r+D(o,(t?t.scrollLeft:0)+n.rect.state.width/2)}function N(e){const{environment:t,timestamp:n,timelineState:o,paddingLeft:r,format:i}=e;return n-D(o.zoomLevel.state,Y({environment:t,paddingLeft:r,format:i,isFullScreen:o.isFullScreen,isRootChild:o.isRootChild})/2)}function O(e){const{environment:t,timestamp:n,timelineState:o,paddingLeft:r,format:i}=e;return n-D(o.zoomLevel.state,Y({environment:t,paddingLeft:r,format:i,isFullScreen:o.isFullScreen,isRootChild:o.isRootChild})-o.outerSizeObserver.rect.state.width/2)}function L(e){const{timestamp:t,timelineState:n}=e;return t+D(n.zoomLevel.state,-n.outerSizeObserver.rect.state.width/2)}function j(e,t){if("fifteen_minutes"===t){const t=15*Math.floor(e.minute/15);return e.set({minute:t}).startOf("minute")}return e.startOf(t)}function K(e,t){if("fifteen_minutes"===t){const t=15*Math.floor(e.minute/15)-15;return e.set({minute:t}).startOf("minute")}return e.startOf(t).minus({[t]:1}).startOf(t)}function z(e,t){if("fifteen_minutes"===t){const t=15*Math.floor(e.minute/15)+15;return e.set({minute:t}).startOf("minute")}return e.plus({[t]:1}).startOf(t)}function q(e){const{startValue:t,snapUnit:n,desiredStart:o,desiredEnd:r}=e;let i=t;const a=c.Ze(t)||(0,m.r)();if(o){const e=H(o,n,"start",a);if("datetime"===e.type)if("date"===i.type){const e={type:"daterange",start_date:i.start_date,end_date:i.start_date};i=u.bD(e,(0,m.r)())}else"daterange"===i.type&&(i=u.bD(i,(0,m.r)()));"date"===i.type?i={...i,type:"daterange",start_date:e.start_date,end_date:i.start_date}:"daterange"===i.type?i={...i,type:"daterange",start_date:e.start_date,end_date:i.end_date}:"datetime"===i.type?i={...i,type:"datetimerange",start_date:e.start_date,start_time:"datetime"===e.type?e.start_time:i.start_time,end_date:i.start_date,end_time:i.start_time}:"datetimerange"===i.type&&(i={...i,type:"datetimerange",start_date:e.start_date,start_time:"datetime"===e.type?e.start_time:i.start_time})}if(r){const e=H(r,n,"end",a);if("datetime"===e.type)if("date"===i.type){const e={type:"daterange",start_date:i.start_date,end_date:i.start_date};i=u.bD(e,(0,m.r)())}else"daterange"===i.type&&(i=u.bD(i,(0,m.r)()));"date"===i.type||"daterange"===i.type?i={...i,type:"daterange",end_date:e.start_date}:"datetime"!==i.type&&"datetimerange"!==i.type||(i={...i,type:"datetimerange",end_date:e.start_date,end_time:"datetime"===e.type?e.start_time:"datetimerange"===i.type?i.end_time:i.start_time})}return c.qW(i)}function H(e,t,n,o){const r=K(e,t),i=j(e,t),a=z(e,t),s=B(t);let l;return l="start"===n?e.valueOf()>=i.valueOf()+(i.valueOf()-r.valueOf())/2?a:i:e.valueOf()>=i.valueOf()+(i.valueOf()-r.valueOf())/2?s?a:i:s?i:r,function(e,t,n){return B(t)?u.CQ(e.valueOf(),n):u.hT(e.valueOf(),n)}(l,t,o)}function G(e){const{environment:t,isFullScreen:n,isRootChild:o}=e;return(t.device.isDesktop||t.device.isTablet)&&(n||o)}function W(e){const{environment:t,format:n,isFullScreen:o,isRootChild:r}=e;return G({environment:t,isFullScreen:o,isRootChild:r})&&Boolean(n.timeline_show_table)}function $(e){const{isFullScreen:t,isRootChild:n}=e;return!t&&n&&W(e)}function Y(e){const{environment:t,paddingLeft:n,format:o,isFullScreen:r,isRootChild:i}=e;if(!W({environment:t,format:o,isFullScreen:r,isRootChild:i}))return 0;return n+(o.timeline_table_properties||[]).reduce(((e,t)=>(t.width&&t.visible?t.width:0)+e),0)}function Q(){const e=o.ou.now().setLocale(r.locale);return e.toLocaleString(o.ou.TIME_SIMPLE)===e.toLocaleString(o.ou.TIME_24_SIMPLE)}function J(e,t,n){return"day"===n?(0,d.Yx)(t,"month_day_long",e):"month"===n?(0,d.Yx)(t,"month_long",e):void(0,f.t1)(n)}function X(e,t){return"day"===t?(0,d.Yx)(e,"long",r.locale):"month"===t?(0,d.Yx)(e,"month_year_long",r.locale):void(0,f.t1)(t)}function ee(e,t){const n=u.NK(e,c.Ze(e)||(0,m.r)(),r.locale),{primaryDisplayUnit:o}=C[t],i="fifteen_minutes"===o||"hour"===o?"month_day_time":"month_day";return(0,d.Yx)(n.start.valueOf(),i,r.locale)}function te(e,t){const n=u.NK(e,c.Ze(e)||(0,m.r)(),r.locale),{primaryDisplayUnit:o}=C[t],i=(n.end||n.start).valueOf(),a="fifteen_minutes"===o||"hour"===o?"month_day_time":"month_day";return(0,d.Yx)(i,a,r.locale)}function ne(e,t){const n=u.NK(e,c.Ze(e)||(0,m.r)(),r.locale),{primaryDisplayUnit:o}=C[t],i="fifteen_minutes"===o||"hour"===o?"medium_with_time":"medium",a=(0,d.Yx)(n.start.valueOf(),i,r.locale);return n.end?`${a} → ${(0,d.Yx)(n.end.valueOf(),i,r.locale)}`:a}function oe(e,t){return j(e,t)<e?z(e,t):e}function re(e){return e.device.nativeScrollbarWidth>0||e.device.isFirefox||e.device.isPhone}function ie(e){return!(e.device.isFirefox||e.device.isMobile)}function ae(e,t){const n=t.currentUser.id,o=e.getFormat().timeline_preference,r=U(e.id),i=g.Z.get({userId:n,key:r}),a={zoomLevel:T,centerTimestamp:Date.now()};return{zoomLevel:(se(i)||se(o)||a).zoomLevel,centerTimestamp:(se(i)||a).centerTimestamp}}function se(e){if(e&&"number"==typeof e.centerTimestamp&&p.H.includes(e.zoomLevel))return e}function le(e,t){let n=e.timeline_table_properties||[];if(t){n.find((e=>{let{visible:t}=e;return Boolean(t)}))||(n=(0,p.Rt)(n,"title",!0))}return{timeline_show_table:t,timeline_table_properties:n}}function ce(e){const{environment:t,collectionContextStore:n,timelineState:o,isFullScreen:r,isRootChild:i}=e,a=o.zoomLevel.state,s=n.normalizedFormatStore.state,l=W({environment:t,format:s,isFullScreen:r,isRootChild:i}),c=l&&s.timeline_table_properties?s.timeline_table_properties.length:0,d=s.timeline_properties||[],u=d.filter((e=>"title"!==e.property));return{zoom_level:a,show_table:l,show_table_properties_count:c,show_timeline_title:d.length!==u.length,show_timeline_properties_count:u.length}}const de=33,ue=66,pe=22,me=33,ge=4,fe=96;function he(e){return e?de:ue}function ve(e,t,n){if(!t)return[];const o=M(e);if(!o)return[];const r=t.getPropertyValue(o),i=n[o];return r&&i&&"relation"===i.type?(0,l.j$)({relationValue:(0,l.rq)(r),propertySchema:i,getRecordModel:t.getRecordModel}):[]}function ye(e,t,n){var o;if(!t)return[];const r=null===(o=(0,h.wf)(e))||void 0===o?void 0:o.property;if(!r)return[];const i=t.getPropertyValue(r),a=n[r];return i&&a&&"relation"===a.type?(0,l.j$)({relationValue:(0,l.rq)(i),propertySchema:a,getRecordModel:t.getRecordModel}):[]}const be=2,_e=40;function Se(e){const{timelineState:t,placeholderDate:n,subitemPlaceholderDate:o}=e,r=o??e.dateValue;if(!r)return;const i=t.zoomLevel.state,{snapUnit:a}=C[i],{startTimestamp:s,endTimestamp:l}=t.currentRange.state,{start:c,end:d}=Z(r,a),u=d.valueOf()>s&&c.valueOf()<l,p=R(i,c.valueOf()-s)+be,m=o?Math.max(p+_e,0):Math.max(p,0),g=R(i,d.valueOf()-s)-be,f=R(i,l-s),h=Math.min(g,f),v=h/R(i,l-s);return{visible:u,isPlaceholder:Boolean(n),isExistingSubitemPlaceholder:Boolean(o),left:m,right:h,maskPercent:v}}},710274:(e,t,n)=>{n.d(t,{zz:()=>Tt,TM:()=>It,wG:()=>Vt,MO:()=>Ot,ME:()=>dt,W9:()=>st,NZ:()=>Qt,rl:()=>Ct,HW:()=>Pt,dp:()=>ut,ob:()=>rt,IH:()=>Lt,tG:()=>ct,Vz:()=>tn,dj:()=>Dt,lG:()=>Kt,oh:()=>Et,rm:()=>Yt,C_:()=>At,K_:()=>en,mS:()=>Rt,fI:()=>jt,A9:()=>Mt,Wu:()=>pt,mc:()=>ot,n1:()=>wt,W1:()=>Ut,E7:()=>Ht,bu:()=>qt,f8:()=>Zt,t5:()=>it,Z5:()=>Nt,Rm:()=>ft,$N:()=>vt,$D:()=>Ft,xO:()=>ht,iG:()=>mt,Uy:()=>St,Es:()=>gt,yc:()=>xt,z2:()=>yt,Ug:()=>at});n(757658),n(21703),n(252262),n(324506);var o=n(730120),r=n(701302),i=n(815145),a=n(371663),s=n(541432),l=n(150475),c=n(107289),d=n(164945),u=n(482545),p=n(514248),m=n(576205),g=n(114714),f=n(399036),h=n(143690),v=n(10070),y=n(528155),b=n(253877),_=n(293824),S=n(320297),k=n(406695),w=n(568626),x=n(842875),I=n(471924),C=n(915157),T=n(959753),M=n(145953),P=n(396367),A=n(798963),R=n(421202),D=n(606287),B=n(213493),E=n(23867),F=n(554153),Z=n(709291),U=n(653965),V=n(476870),N=n(937850),O=n(215828),L=n(401898),j=n(619584),K=n(100952),z=n(21359),q=n(616241),H=n(554569),G=n(805149),W=n(141433),$=n(547307),Y=n(496802),Q=n(594419),J=n(792625),X=n(119785),ee=n(709953),te=n(504408),ne=n(275754),oe=n(132953),re=n(926999),ie=n(680402),ae=n(898104),se=n(210228),le=n(61202),ce=n(977357),de=n(866),ue=n(27105),pe=n(855337),me=n(721429),ge=n(700042),fe=n(397004),he=n(368585),ve=n(892918),ye=n(708661),be=n(426991),_e=n(277181),Se=n(741195),ke=n(721214),we=n(433929),xe=n(145950),Ie=n(989796),Ce=n(177546),Te=n(889014),Me=n(318245),Pe=n(514654),Ae=n(58202),Re=n(74948),De=n(80444),Be=n(925489),Ee=n(206776),Fe=n(519511),Ze=n(788632),Ue=n(385555),Ve=n(879167),Ne=n(453730),Oe=n(206258),Le=n(27724),je=n(897630);const Ke=["clientType","aggregationStatus","requestBackend","isLoadTest"],ze=["sort","reducerDependencies","upwardTraversalRelation","searchQuery","filter","currentPageInRelatedCollection","reducers","userId","filterToComputeDependencies","maxPreloadedRecords"],qe=["filter","searchQuery","loadContentCover"],He=["filter","aggregation","subGroup","hideEmptyAggregationGroups"],Ge=["filter"],We=["property","enforceMaxAggregationLimit"];function $e(e,t){for(const n of t)void 0===e[n]&&delete e[n]}var Ye=n(110906);const Qe=(0,Z.defineMessages)({importingCSV:{id:"databaseViewActions.importingCSV.loadingMessage",defaultMessage:"Importing"},uploadingCSV:{id:"databaseViewActions.uploadingCSV.loadingMessage",defaultMessage:"Uploading"},importFailed:{id:"databaseViewActions.importFailedError.message",defaultMessage:"Import failed."}}),Je=(0,Z.defineMessages)({renameButtonTitle:{defaultMessage:"Rename",id:"database.collectionEditViewButtonPopup.renameButtonTitle"},statusName:{defaultMessage:"Status",id:"database.collectionEditViewButtonPopup.statusNameProperty"},dateName:{defaultMessage:"Date",id:"database.collectionEditViewButtonPopup.dateNameProperty"}}),Xe=(0,Z.defineMessages)({currentSprintViewDefaultName:{defaultMessage:"Current Sprint",id:"collectionViewActions.typedView.currentSprintViewName"}}),et=10;function tt(e,t){if(e||t){if(!e)return"add_filter";if(!t)return"remove_filter";if(!U.Xy(e,t)){if((0,m.aN)(e)&&(0,m.aN)(t))return e.property!==t.property?"change_filter":e.filter.operator!==t.filter.operator?"change_filter_operator":U.Xy(e.filter,t.filter)?void 0:"change_filter_value";if((0,m.Mm)(e)&&(0,m.Mm)(t))return e.timestamp!==t.timestamp?"change_filter":e.filter.operator!==t.filter.operator?"change_filter_operator":U.Xy(e.filter,t.filter)?void 0:"change_filter_value";if(!(0,m.vA)(e)||!(0,m.vA)(t))return"change_filter";{if(e.operator!==t.operator)return"change_filter_operator";function n(e){return(0,m.aN)(e)?`property/${e.property}`:(0,m.Mm)(e)?`property/${e.timestamp}`:(0,m.vA)(e)?`combinator/${e.operator}`:void(0,L.t1)(e)}const o=U.MR(e.filters??[],n),r=U.MR(t.filters??[],n),i=o.length,a=r.length;if(i<a)return"add_filter";if(a<i)return"remove_filter";for(let s=0;s<a;s++){const l=tt(o[s],r[s]);if(l)return l}}}}}function nt(e,t){if(void 0===t)return;if(void 0===e)return"initial_load";if(!U.Xy(e.collectionView,t.collectionView))return"change_view";if(!U.Xy(e.loader.searchQuery,t.loader.searchQuery))return"change_search";if(!U.Xy(e.loader.sort,t.loader.sort))return"change_sort";const n=tt(e.loader.filter,t.loader.filter);if(n)return n;const o=e.loader.reducers??{},r=t.loader.reducers??{};if(Object.keys(r).find((e=>{const t=o[e],n=r[e];return n&&(!t||!U.Xy(t,n))})))return"change_group";const i={reducers:void 0,filter:void 0,sort:void 0,reducerDependencies:void 0},a={...null==e?void 0:e.loader,...i},s={...null==t?void 0:t.loader,...i};return U.Xy(a,s)?void 0:"change_loader"}function ot(e){const{environment:t,collectionViewBlockStore:n,collectionViewStore:a,collectionStore:s,collectionContextStore:c,isFullScreen:d,isRootChild:p,isInPeekRenderer:g,collectionViewModuleContextType:f,forceLocalQueryCollection:h}=e;rt({collectionContextStore:c});const v=t.currentUser.id;d&&(oe.Pg(t),oe.rM(t));const{remoteRequestStore:_,localResultStore:S}=c;if(a){var k;const e=Boolean(!c.isViewSpecificClientModeEnabledStore.state&&c.isClientModeEnabledStore.state&&s&&s.id===(null===(k=c.collectionStore())||void 0===k?void 0:k.id)),x=o.ou.fromMillis(de.Z.getLocalDateRangeStart({collectionViewId:a.id,currentUserId:t.currentUser.id}));let T,M=0,A=0;const R=()=>{r.default.afterNextFlush((()=>{const e=_.state;c.isViewSpecificClientModeEnabledStore.state&&T&&e&&!U.Xy(T.loader.filter,e.loader.filter)&&(c.isClientModeEnabledStore.setState(!1),c.isViewSpecificClientModeEnabledStore.setState(!1));const o=nt(T,e);void 0===o||c.isClientModeEnabledStore.state&&!function(e,t,n,o){if(!n)return!1;if(null!=t&&t.loader.filter&&(0,m.SH)(null==t?void 0:t.loader.filter,(e=>(0,m.aN)(e)&&(0,P.zy)(e,n.getSchema()))))return!0;return(0,be.ki)(null==t?void 0:t.loader.reducers,n.getSchema(),o)}(0,e,s,n)||(Date.now()-M<=1e3?A++:(M=Date.now(),A=1),A>=25&&Ue.default.checkGate({gateName:"collection_client_log_looping_remote_request"})&&w.log({level:"warning",from:"queryCollectionRemoteRequest",type:"queryCollectionRemoteRequest",data:{miscDataToConvertToString:{data:{viewId:a.id,collectionId:null==s?void 0:s.id,clientModeEnabled:c.isClientModeEnabledStore.state,changedReason:o,lastRemoteRequest:T,nextRemoteRequest:e}}}}),(A<25||Ue.default.checkGate({gateName:"collection_client_skip_looping_remote_request"}))&&Dt(t,c,{src:o},h)),T=e}))};_.addListener(R);const D=()=>{if((0,V.lB)(1)){const e=Me.default.DO_NOT_USE_markLegacy("database_update_lag");Me.default.DO_NOT_USE_measureAfterNextFlushLegacy(e,{environment:t})}};S.addListener(D);const B=function(e){const t=Gt(e.collectionViewId);return C.Z.get({userId:e.userId,key:t})}({userId:v,collectionViewId:a.id}),E=t.device.isPhone||B;c.remoteResultStore.setState(void 0),c.remoteCollectionIdsStore.setState([]),c.isLoadedStore.setState(!1),c.searchQueryStore.setState(""),c.searchOpenStore.setState(!1),c.isFullScreenStore.setState(d),c.isRootChildStore.setState(p),c.reducersStore.setState({}),c.groupsStore.reset(),c.groupsLimitStore.setState(ve.XD),c.boardColumnsLimitStore.setState(ve.XD),c.filtersBarOpenStore.setState(E),c.isInPeekRendererStore.setState(g),c.subitemExpandedStore.setState(new Map),c.chartErrorStore.setState(new Map),c.isClientModeEnabledStore.setState(e),c.wasServerResponseFromCache=void 0,c.requestBackend=void 0,c.isViewSpecificClientModeEnabledStore.setState(!1),c.throttleMsStore.setState(u.m),c.asyncAggregationStatusStore.reset(),c.collectionViewModuleContextStore.setState(f),c.dateRangeStartStore.setState((0,b.IS)(x.startOf("month").valueOf(),me.AK.state).valueOf()),c.dateRangeEndStore.setState(d&&!t.device.isMobile?(0,b.V7)(x.endOf("month").plus({month:1}).valueOf(),me.AK.state).valueOf():(0,b.V7)(x.endOf("month").valueOf(),me.AK.state).valueOf());const F=null==a?void 0:a.getFormat(),Z=null==F?void 0:F.collection_view_source;"typed"===(null==Z?void 0:Z.type)?c.setContext({type:"collectionTypedView",collectionViewBlockStore:n,databaseType:Z.databaseType,collectionViewStore:a,pageVisitSourceOverride:(0,Pe.ib)({blockOrCollectionId:n.id})}):(0,y.nx)(Z)?s&&c.setContext({type:"collectionVirtualView",collectionViewBlockStore:n,collectionViewStore:a,collectionStore:s,pageVisitSourceOverride:(0,Pe.ib)({blockOrCollectionId:a.id})}):Z&&"collection"!==Z.type?(0,L.t1)(Z):c.setContext({type:"collectionView",collectionViewBlockStore:n,collectionStore:s,collectionViewStore:a,pageVisitSourceOverride:(0,Pe.ib)({blockOrCollectionId:n.id})}),c.remoteRequestStoreCallback=R,c.localResultStoreCallback=D;const N=$t(a),O=ke.y.get(N);if(O){const e=0===O.resultSet.blockIds.size,t=c.getPageVisitSourceOverride();(t===i.tY.PersonalHomeTileTasks||t===i.tY.PersonalHomePageTasks)&&(e||ke.y.locallyMutatedTasksDatabase)?ke.y.locallyMutatedTasksDatabase=!1:(c.resetLoadingState(),c.resultSetStore.setState(U.Xh(O.resultSet)),c.remoteCollectionIdsStore.setState(U.Xh(O.collectionIds)),c.remoteResultStore.setState(U.Xh(O.remoteResult)),c.isLoadedStore.setState(!0))}const K=Ne.transactionQueue.isPendingTransactionForRecord(a.pointer);c.wasCreatedThisSessionStore.setState(K);const z=function(e){let{currentUserId:t,collectionViewId:n,collectionViewModuleCurrentPageId:o}=e;const r=C.Z.get({userId:t,key:Wt({collectionViewId:n,collectionViewModuleCurrentPageId:o})});if(r)return(0,j.dj)(r)}({currentUserId:t.currentUser.id,collectionViewId:a.id,collectionViewModuleCurrentPageId:c.collectionViewModuleContextStore.currentPageInRelatedCollectionId()});c.temporaryStateStore.setState(z||{});const{currentSpaceStore:q}=De.default.state;if(d&&!s&&c.hasSingleCollection()&&G.r$({collectionContextStore:c,collectionSettingsStore:c.settingsStore}),s&&q&&s.getSpaceId()===q.id&&s.isDefaultRecordCache()&&!(0,l.EW)(n.getSystemBlockTypeStore().getValue())&&!c.settingsStore.state.open){!function(e){let{currentUserId:t,spaceId:n,collectionId:o}=e;const r=Kt({currentUserId:t,spaceId:n}),i=U.jj([o,...r]).slice(0,et);C.Z.set({userId:t,key:zt(n),value:JSON.stringify(i)})}({currentUserId:t.currentUser.id,spaceId:q.id,collectionId:s.id})}c.frozoneStore.setState({isScrolled:!1,scrollerWidth:void 0,scrollerLeftOffset:void 0,scrollerLeftPadding:void 0,frozenIndex:void 0,tryShowHiddenFrozenColumn:!1}),c.visitSessionId=I.Il(),c.virtualizedModule.reset(),c.didFireLoadEventsStore.setState(!1)}}function rt(e){const{collectionContextStore:t}=e,{localResultStore:n,remoteRequestStore:o,remoteRequestStoreCallback:r,localResultStoreCallback:i}=t;r&&o.removeListener(r),i&&n.removeListener(i),t.infiniteScrollLongTaskObserver.disconnect()}function it(e){const{dateRangeStart:t,dateRangeEnd:n,collectionContextStore:o}=e;o.dateRangeStartStore.setState(t),o.dateRangeEndStore.setState(n)}function at(e){const{searchQuery:t,collectionContextStore:n}=e;n.collectionViewStore()&&(n.searchQueryStore.setState(t||""),n.groupsStore.resetAllLimits())}function st(e){const{environment:t,collectionViewBlockStore:n,collectionView:o,transaction:r}=e,i=ee.ae({environment:t,table:B.np,value:o,inMemoryRecordCache:n.inMemoryRecordCache,transaction:r}),a=Oe.Xr.createChildStore(n,{table:B.np,id:i.id,spaceId:n.getSpaceId()});return Q.R3({parentStore:n.getCollectionViewsStore(),appendStore:a,transaction:r}),a}function lt(e){const{environment:t,collectionStore:n,property:o,transaction:r}=e,i=n.getSchema()[o];if(!i||!f.D1(i))return;const a=(0,Se.TS)({environment:t,table:A.cv,spaceId:n.getSpaceId()});ee.ae({environment:t,table:A.cv,inMemoryRecordCache:n.inMemoryRecordCache,value:{id:a,parent_id:n.id,parent_table:n.table,alive:!0,space_id:n.getSpaceId(),status:"active",trigger:{id:I.Il(),type:"button"}},transaction:r}),ee.sW({store:n.getSchemaStore(),data:{[o]:{...i,automation_id:a}},transaction:r})}function ct(e){var t;const{environment:n,collectionViewBlockStore:o,collectionViewStore:r,intl:i,transaction:s,copyNameExactly:l=!1}=e;if(!o)return;const c=r.computeWithRecordValues((e=>{let{getRecordValueAndSubscribe:t}=e;return t(r)}));if(!c)return;let d;(null===(t=c.format)||void 0===t?void 0:t.app_config_uri)===a.g3?we.default.formatMessage(Xe.currentSprintViewDefaultName):d=l?c.name:(0,S.nM)(c.name||i.formatMessage(Ye.b1[c.type]));const u=(0,Se.TS)({environment:n,table:B.np,spaceId:o.getSpaceId()});return st({environment:n,collectionViewBlockStore:o,collectionView:{...c,id:u,name:d},transaction:s})}function dt(e){const{environment:t,collectionContextStore:n,newViewType:o="table",transaction:i,skipOpenSettings:a}=e,s=n.collectionViewBlockStore(),l=n.collectionViewStore(),c=n.settingsStore;if(!s)return;const d=function(e){var t,n;const{environment:o,collectionContextStore:r,collectionViewBlockStore:i,newViewType:a,existingCollectionViewStore:s,transaction:l}=e,c=r.collectionStore(),d=null==c||null===(t=c.getFormat())||void 0===t?void 0:t.collection_default_arrows_by,u=st({environment:o,collectionViewBlockStore:i,collectionView:{type:a??"table",parent_id:i.id,parent_table:R.iU,alive:!0,space_id:i.getSpaceId(),format:{table_properties:null==s||null===(n=s.getFormat())||void 0===n?void 0:n.table_properties,timeline_arrows_by:d?{property:d}:void 0,table_subitem_toggle_column:"title",...s&&"collectionTypedView"===r.contextType?{collection_view_source:s.getFormat().collection_view_source,property_filters:s.getFormat().property_filters}:{}}},transaction:l});return _t({environment:o,collectionContextStore:r,collectionViewStore:u,collectionStore:c,newViewType:a,transaction:l}),u}({environment:t,collectionContextStore:n,collectionViewBlockStore:s,newViewType:o,existingCollectionViewStore:l,transaction:i});"chart"===o&&q.Q({environment:t,collectionContextStore:n,collectionViewId:d.id,from:"new_view_button"}),Zt({environment:t,collectionContextStore:n,collectionViewId:d.id,isFullScreen:n.isFullScreenStore.state,isRootChild:n.isRootChildStore.state,isInPeekRenderer:n.isInPeekRendererStore.state}),a||r.default.afterNextFlush((()=>{s.getCollectionViewSourceCollectionStore()?(G.r$({collectionContextStore:n,collectionSettingsStore:c}),G.wl({collectionSettingsStore:c,item:{type:"createView"}})):G.r$({collectionContextStore:n,collectionSettingsStore:c})}))}function ut(e){const{collectionViewBlockStore:t,collectionViewStore:n,transaction:o}=e,r=Oe.Xr.createChildStore(t,{table:B.np,id:n.id,spaceId:t.getSpaceId()}),i=n.getFormat().app_config_uri;if(i){var a;const e=null===(a=t.getFormat())||void 0===a?void 0:a.app_uri_map;e&&delete e[i],Y.FH({stores:[t],update:{app_uri_map:e},transaction:o})}Q.Od({parentStore:t.getCollectionViewsStore(),childToRemoveStore:r,transaction:o})}function pt(e){const{collectionViewBlockStore:t,newViewIds:n,transaction:o}=e,r=t.getCollectionViewStores(),{beforeOps:i}=(0,_.q)(r.map((e=>e.id)).slice(0,n.length),n);U.Ed(i,((e,r)=>{const i=Oe.Xr.createChildStore(t,{table:B.np,id:r,spaceId:t.getSpaceId()});if(e)Q.Vt({parentStore:t.getCollectionViewsStore(),insertStore:i,beforeStore:Oe.Xr.createChildStore(t,{table:B.np,id:e,spaceId:t.getSpaceId()}),transaction:o});else{const e=U.Z$(n.filter((e=>e!==r)));Q.BE({parentStore:t.getCollectionViewsStore(),insertStore:i,afterStore:e?Oe.Xr.createChildStore(t,{table:B.np,id:e,spaceId:t.getSpaceId()}):void 0,transaction:o})}}))}function mt(e){const{collectionViewStore:t,update:n,transaction:o}=e;ee.sW({store:t,data:n,transaction:o})}function gt(e){const{collectionViewStore:t,update:n,transaction:o}=e;ee.sW({store:t.getQueryStore(),data:n,transaction:o})}function ft(e){const{environment:t,collectionStore:n,update:o,transaction:r}=e,i=n.getSchema();o.schema&&(o.schema=f.Fn(o.schema)),o.deleted_schema&&(o.deleted_schema=f.Fn(o.deleted_schema));const a={...o};if(o.deleted_schema){const e=n.getDeletedSchema(),t=(0,v.jf)({schemas:[e,o.deleted_schema],prioritizeLooserLimitRule:!0});t.error?w.log({level:"error",from:"collectionViewActions",type:"updateCollection",error:t.error}):a.deleted_schema=t.value}ee.sW({store:n,data:a,transaction:r}),o.schema&&At({environment:t,collectionStore:n,oldSchema:i,newSchema:o.schema,transaction:r})}function ht(e){const{environment:t,collectionStore:n,update:o,transaction:r}=e,i=n.getSchema(),a=f.Fn(o);ee.sW({store:n.getSchemaStore(),data:a,transaction:r}),At({environment:t,collectionStore:n,oldSchema:i,newSchema:n.getSchema(),transaction:r})}function vt(e){const{collectionStore:t,update:n,transaction:o}=e;ee.sW({store:(0,Oe._J)(t,t.pointer,["deleted_schema"]),data:n,transaction:o})}function yt(e){const{environment:t,collectionContextStore:n,newViewType:o,transaction:r}=e,i=n.collectionViewStore(),a=n.collectionViewBlockStore(),s=n.collectionStore();if(!i||!a)return;if(o===i.getType()||"page"===o||"form_editor"===o)return;"chart"===o&&q.Q({environment:t,collectionContextStore:n,collectionViewId:i.id,from:"collection_view_type_change"});const l=i.getType();ee.sW({store:i,data:{type:o},transaction:r}),_t({environment:t,collectionContextStore:n,collectionViewStore:i,collectionStore:s,oldViewType:l,newViewType:o,transaction:r}),kt({collectionContextStore:n})}function bt(e){var t;const{environment:n,collectionContextStore:o,collectionViewStore:r,collectionStore:i,newViewType:a,schema:s,transaction:l}=e,c=o.permissionScopesStore.state;switch(a){case"board":let e=(null===(t=r.getFormat().collection_group_by)||void 0===t?void 0:t.property)??Ye.Se(s);if(i&&!e){e=(0,O.ZP)();const t=(0,f.I4)("Status",we.default.getIntl());c.canConfigureCollection&&ht({environment:n,collectionStore:i,update:{[e]:t},transaction:l})}return e;case"calendar":let o=Ye.PD(s);if(i&&!o){o=(0,O.ZP)();const e={name:we.default.formatMessage(Je.dateName),type:"date"};c.canConfigureCollection&&ht({environment:n,collectionStore:i,update:{[o]:e},transaction:l})}return o;case"timeline":let a=Ye.HI(s);if(i&&!a){a=(0,O.ZP)();const e={name:we.default.formatMessage(Je.dateName),type:"date"};c.canConfigureCollection&&ht({environment:n,collectionStore:i,update:{[a]:e},transaction:l})}return a}}function _t(e){const{environment:t,collectionContextStore:n,collectionViewStore:o,collectionStore:r,oldViewType:i,newViewType:a="table",transaction:s}=e,l=n.normalizedSchemaStore.state,d=n.normalizedFormatStore.state,u=null==r?void 0:r.isSyncedCollection();switch(a){case"table":ee.sW({store:o.getQueryStore(),data:{aggregations:[]},transaction:s});break;case"board":const e=o.getFormat().board_columns_by,i=bt({environment:t,collectionContextStore:n,collectionViewStore:o,collectionStore:r,newViewType:a,schema:l,transaction:s}),p=n.normalizedSchemaStore.state,m=i&&p[i];if(!i||!m||!(0,g.LG)(m))break;Y.FH({stores:[o],update:{board_columns_by:{...(0,g.fw)({property:i,propertySchema:m,isCollectionTypedView:"collectionTypedView"===n.contextType}),disableBoardColorColumns:null==e?void 0:e.disableBoardColorColumns},collection_group_by:void 0},transaction:s});break;case"calendar":const h=bt({environment:t,collectionContextStore:n,collectionViewStore:o,collectionStore:r,newViewType:a,schema:l,transaction:s});ee.sW({store:o.getQueryStore(),data:{aggregations:[],calendar_by:h},transaction:s});break;case"gallery":Y.FH({stores:[o],update:{gallery_cover:{type:"page_content"}},transaction:s}),ee.sW({store:o.getQueryStore(),data:{aggregations:[]},transaction:s});break;case"timeline":const v=bt({environment:t,collectionContextStore:n,collectionViewStore:o,collectionStore:r,newViewType:a,schema:l,transaction:s});ee.sW({store:o.getQueryStore(),data:{aggregations:[],timeline_by:v},transaction:s});break;case"chart":if(!o.getFormat().chart_config){const e=(0,c.K0)({collectionSchema:n.normalizedSchemaStore.state});Y.FH({stores:[o],update:{chart_config:e,subitem_display_mode:"flattened"},transaction:s})}break;case"list":if(void 0===d.list_properties){const e=[{property:u?f.bf:f.iw,visible:!0}],t=Object.keys(l).find((e=>{const t=l[e];return Boolean(t&&(0,ye.Rb)(t))}));void 0!==t&&e.push({property:t,visible:!0}),Y.FH({stores:[o],update:{list_properties:e},transaction:s})}if(d.list_properties&&u){const e=d.list_properties.findIndex((e=>e.property===f.iw));if(-1!==e){const t=d.list_properties[e];d.list_properties[e]={...t,property:f.bf},Y.FH({stores:[o],update:{list_properties:d.list_properties},transaction:s})}}ee.sW({store:o.getQueryStore(),data:{aggregations:[]},transaction:s});break;default:(0,L.t1)(a)}const p=null==r?void 0:r.getFormat().subitem_property;if(p&&!(0,_e.Av)(a)){const e=i&&!(0,_e.Av)(a)?(0,k.oz)(i):void 0,t=(e?o.getFormat()[e]??[]:[]).find((e=>e.property===p))??{property:p,visible:!0},n=(0,k.oz)(a);if(n){const e=o.getFormat()[n]??[];Y.FH({stores:[o],update:{[n]:[...e,t]},transaction:s})}}}function St(e){const{icon:t,collectionViewStore:n,transaction:o}=e;Y.FH({stores:[n],update:{collection_view_icon:t},transaction:o})}function kt(e){const{collectionContextStore:t}=e,n=t.collectionViewBlockStore();if(!n)return;const o=Ae.R.findCollectionViewBlockFromStore(n);null!=o&&o.resetLeftScrollAfterFlush&&o.resetLeftScrollAfterFlush()}function wt(e){const{collectionContextStore:t}=e,n=t.collectionViewBlockStore();if(n){const e=Ae.R.findCollectionViewBlockFromStore(n);if(e){const t=e.getNode();t&&(0,Ce.Wr)(t,{edgeDist:0,animate:!1})}}}function xt(e){var t,n,o;const{collectionContextStore:r,collectionStore:i,transaction:a}=e,s=r.collectionViewStore();if(!s||!i.isDefined())return;const l=Ye.Vv(i),u=null===(t=i.getFormat())||void 0===t?void 0:t.collection_default_arrows_by,p=r.collectionStore(),m=(null==p?void 0:p.pointer.id)!==i.pointer.id,g=i.getSchema();let f=s.getChartConfig();m&&"chart"===s.getType()&&f&&"placeholder"!==f.type&&(f=function(e){let{chartConfig:t,collectionSchema:n}=e;return(0,d.u)(t)?(0,c.K0)({collectionSchema:n,axisChartType:t.type}):"donut"===t.type?(0,c.dq)({collectionSchema:n}):(0,c.K0)({collectionSchema:n,axisChartType:"column"})}({chartConfig:f,collectionSchema:g}));const h={table_properties:null==l||null===(n=l.getFormat())||void 0===n?void 0:n.table_properties,collection_pointer:{table:D.vF,id:i.id,spaceId:i.getSpaceId()},chart_config:f,timeline_arrows_by:u?{property:u}:void 0,table_subitem_toggle_column:"title"},v=null==r?void 0:r.normalizedSchemaStore.state;ee.sW({store:s,data:(0,j.Q2)({format:h,query2:{sort:null==l||null===(o=l.getQuery(v))||void 0===o?void 0:o.sort}}),transaction:a})}function It(e){var t;const{environment:n,name:o,collectionViewStore:r,collectionViewBlockStore:i,transaction:a,targetCollectionRecordPointerMap:l}=e,c=r.getType();if(!c||!i.isDefined())return;const d=i.getCollectionPointer(),u=i.getFormat(),p=null===(t=i.getTitleStore())||void 0===t?void 0:t.getValue(),m=d||o||!p?o:p,g=(0,ge.Yu)({environment:n,isInline:i.getType()===s.Ti.collectionView,name:m,viewType:c,chartType:r.getChartPlaceholderType()}),f=l??M.Ao.create();f.set({table:B.np,id:"view"},r.pointer),W.ZI({environment:n,sourceBlockId:"root",targetBlockPointer:i.pointer,sourceBlockSubtree:g?(0,M.R3)(g):M.Ak.create(),targetRecordCache:i.inMemoryRecordCache,transaction:a,recordPointerMap:f,deepCopyTransclusionContainers:!0,resolveTemplateVariables:!0,useCrdt:i.useCrdt()});const h=f.get({table:D.vF,id:"collection"});if(!h)return;Y.FH({stores:[i],update:{collection_pointer:h},transaction:a});const v=i.getCollectionStore();return v&&(ft({collectionStore:v,update:{icon:null==u?void 0:u.page_icon,cover:null==u?void 0:u.page_cover},environment:n,transaction:a}),Y.FH({stores:[v],update:{collection_cover_position:null==u?void 0:u.page_cover_position},transaction:a})),f}function Ct(e){const{environment:t,collectionViewBlockStore:n,transaction:o,collectionValue:r}=e,i=ee.ae({environment:t,table:D.vF,value:{...r,parent_id:n.id,parent_table:R.iU,alive:!0,space_id:n.getSpaceId()},inMemoryRecordCache:n.inMemoryRecordCache,transaction:o}),a=Oe.NW.createChildStore(n,i.pointer);return Tt({collectionViewBlockStore:n,collectionStore:a,transaction:o}),a}function Tt(e){const{collectionViewBlockStore:t,collectionStore:n,transaction:o}=e;if(!t.isDefined()||!n.isDefined())return;if(t.getCollectionPointer())throw new Error("CollectionViewBlock already has a collection");Y.FH({stores:[t],update:{collection_pointer:n.pointer},transaction:o})}function Mt(e){const{collectionViewBlockStore:t,collectionStore:n,transaction:o}=e;if(!t.isDefined()||!n.isDefined())return;[t].forEach((e=>{var t;e.getCollectionViewStores().filter((e=>{var t;return(null===(t=e.getCollectionStore())||void 0===t?void 0:t.id)===n.id})).forEach((t=>ut({collectionViewBlockStore:e,collectionViewStore:t,transaction:o}))),(null===(t=e.getFormat().collection_pointer)||void 0===t?void 0:t.id)===n.id&&(ee.sW({store:e,data:{collection_id:null},transaction:o}),ee.sW({store:e.getFormatStore(),data:{collection_pointer:null},transaction:o}))})),X.hh({childStore:n,transaction:o})}function Pt(e){const{environment:t,collectionStore:n,performTransaction:o}=e;return se.createAndCommit({userAction:"collectionViewActions.createSchemaUpdateTransaction",environment:t,perform:e=>{const r=n.getSchema(),i=o(e),a=n.getSchema();return At({environment:t,collectionStore:n,oldSchema:r,newSchema:a,transaction:e}),i}}).performResult}function At(e){const{environment:t,collectionStore:n,oldSchema:o,newSchema:r,transaction:i}=e,a=f.Fn(o),s=f.Fn(r),l=Object.keys(s),c=Ue.default.checkGate({gateName:"collections_property_type_change_rename_group"});for(const u of l){const e=a[u],o=s[u];if(o){if("status"===o.type&&"status"!==(null==e?void 0:e.type)){let r;r="select"===(null==e?void 0:e.type)||"multi_select"===(null==e?void 0:e.type)?(0,p.r9)(o.name,e.options??[],we.default.getIntl()):o.groups&&o.options&&o.defaultOption?o:f.I4(o.name,we.default.getIntl());const a={...s,[u]:r};if(ee.sW({store:n,data:{schema:a},transaction:i}),"checkbox"===(null==e?void 0:e.type)&&"status"===o.type){const e=r.groups??[],o=e[e.length-1];o&&H.hz({environment:t,collectionStore:n,property:u,oldValue:{type:"checkbox",value:!0},newValue:{type:"status",value:{type:"by_group",group:o.name}},transaction:i,preventPublishAppEventsForBlockUpdates:c})}}if("status"===(null==e?void 0:e.type)&&"checkbox"===o.type){const o=e.groups??[],r=e.options??[],a=o[o.length-1],s=r.filter((e=>{var t;return null==a||null===(t=a.optionIds)||void 0===t?void 0:t.includes(e.id)}));for(const e of s)H.hz({environment:t,collectionStore:n,property:u,newValue:{type:"checkbox",value:!0},oldValue:{type:"status",value:{type:"by_option",option:e.value}},transaction:i,preventPublishAppEventsForBlockUpdates:c})}}}for(const u of l){const e=a[u],o=s[u];!o||e&&f.cu(e)||!f.cu(o)||z.getSelectPropertyValues(t,{collection:{id:n.id,spaceId:(0,E.C)(n.pointer.spaceId)},property:u}).then((e=>{if("failed"===e.type)throw e.error;const{results:r}=e.data,i=o.options||[],a=f.Fn(n.getSchema()),s=U.mN([...i,...r.map((e=>({id:(0,O.ZP)(),value:e})))],(e=>e.value));for(const t of s)t.color||(t.color=f.TL(s));const l={...o,options:s},c={...a,[u]:l};se.createAndCommit({userAction:"collectionViewActions.handleCollectionSchemaUpdated",environment:t,perform:e=>{ee.sW({store:n,data:{schema:c},transaction:e})}})})).catch((()=>{}))}const d=U.jj([...Object.keys(a),...Object.keys(s)]);for(const u of d){const e=a[u],o=s[u],r=e&&f.cu(e)||"status"===(null==e?void 0:e.type),l=o&&f.cu(o)||"status"===(null==o?void 0:o.type);if(r&&l&&e.type===o.type){const r=o,a=e.options||[],s=r.options||[],l=U.jj([...a.map((e=>e.id)),...s.map((e=>e.id))]);for(const c of l){const r=a.find((e=>e.id===c)),l=s.find((e=>e.id===c));if(r&&l&&r.value!==l.value){const a="status"===e.type?{type:"status",value:{type:"by_option",option:r.value}}:{type:e.type,value:r.value},s="status"===o.type?{type:"status",value:{type:"by_option",option:l.value}}:{type:o.type,value:l.value};H.hz({environment:t,collectionStore:n,property:u,oldValue:a,newValue:s,transaction:i,preventPublishAppEventsForBlockUpdates:!1})}}}}for(const u of d){const e=s[u];"button"!==(null==e?void 0:e.type)||e.automation_id||lt({environment:t,collectionStore:n,property:u,transaction:i})}}function Rt(e){const{store:t,environment:n}=e;let o;const r={},i=performance.now();ce.cR({environment:n,bucket:"temporary",onStart:e=>{o=e,J.j({message:Qe.uploadingCSV})},onComplete:e=>{r.uploadTimeTaken=performance.now()-i,r.firstTimeNavigateToCollection=r.uploadTimeTaken,(async(e,o)=>{J.j({message:Qe.importingCSV});const r=t.getCollectionViewCollectionStore();if(!r)return;if(!Ae.R.findCollectionViewBlockFromStore(t))return;const i=(0,x.r)(),a=z.importFile(n,{importType:"MergeIntoCollection",fileURL:e,fileName:o,collection:{id:r.id,spaceId:(0,E.C)(r.pointer.spaceId)},spaceId:(0,E.C)(r.pointer.spaceId),userTimeZone:i}),s=Ue.default.checkGate({gateName:"csvimport_faster_navigate_to_page_enabled"});let l=!1;for await(const t of a){if(t.error)throw $.showErrorMessage(we.default.formatMessage(Qe.importFailed)),J.x(),t.error;!l&&s&&"status"in t.value&&"updated_collection"===t.value.status.message&&(l=!0,J.x())}J.x()})(e[0],o[0].name),r.overallTimeTaken=performance.now()-i;for(const[t,o]of Object.entries(r))(0,pe.j)({environment:n,event:{eventName:"import_file_finished",eventProperties:{importUploadType:"csv",importType:"MergeIntoCollection",importLatency:o,importSource:"file",importLatencyType:t,importFileCount:1}}});w.log({level:"info",from:"mergeWithCSV",type:"mergeWithCSVFinished",data:{miscDataToConvertToString:{data:{uploadType:"csv",importType:"MergeIntoCollection",importLatencies:r,importSource:"file",fileNames:[o[0].name]}}}})},onError:e=>{J.x(),$.showErrorMessage(we.default.formatMessage(Qe.importFailed))}})}async function Dt(e,t,n,o){const r=t.collectionViewStore(),{remoteRequestStore:i}=t;if(!i||!r)return;const s=i.state;if(!s)return;const l=t.createUpdateCounter(),c=t.remoteResultStore.state;Ze.Z.state.online&&c&&await Ne.transactionQueue.drain();const d=r.inMemoryRecordCache;if(!t.shouldUpdate(l))return;t.isLoadingStore.setState(!0),t.remoteErrorStore.setState(void 0);const u=Me.default.DO_NOT_USE_markLegacy("collections.remote_query_collection_latency"),p=d===e.defaultRecordCache.inMemoryRecordCache;let m;if(p&&!o&&Ze.Z.state.online){const o="initial_load"===n.src?function(e){const t=(0,U.Xh)(e);$e(t,Ke);const{loader:n}=t;if($e(n,ze),n.reducers)for(const o of Object.values(n.reducers))switch(o.type){case"results":$e(o,qe);break;case"groups":$e(o,He);break;case"aggregation":$e(o,Ge),$e(o.aggregation,We)}return t}(s):s,i="initial_load"===n.src&&"chart"!==r.getType()&&!Object.values(o.loader.reducers||{}).some((e=>"groups"===e.type)),a=null==r?void 0:r.id,c=(0,Ie.Z)(a),d=[];if(i){let r=!1;const i={};Object.entries(o.loader.reducers||{}).forEach((e=>{let[t,n]=e;"aggregation"!==n.type?i[t]=n:r=!0}));const a={...o,loader:{...o.loader,reducers:i},aggregationStatus:r?"stripped":void 0};if(m=z.queryCollection(e,a,void 0,n,void 0,c).then((o=>{const i=he.vS(t,n.src);if(Me.default.DO_NOT_USE_measureLegacy(u,{environment:e,data:i}),"success"===o.type)return"initial_load"===n.src&&F.Z.set((0,Ie.Z)(s.collectionView.id),a),t.timedOutRequestCounter=0,Bt({environment:e,remoteRequest:s,collectionContextStore:t,response:o.data,updateCounter:l,keepAggregationResults:r});"failed"===o.type&&(t.remoteErrorStore.setState({requestSrc:n.src,errorBody:o.body}),o.status>=500&&o.status<600&&Xt(t))})),d.push(m),r){t.asyncAggregationStatusStore.setState({...t.asyncAggregationStatusStore.state,calculating:!0});const o=m.then((()=>z.queryCollection(e,{...s,aggregationStatus:"full"},void 0,n,void 0,c).then((o=>{if("success"===o.type)return t.timedOutRequestCounter=0,Bt({environment:e,remoteRequest:s,collectionContextStore:t,response:o.data,updateCounter:l});"failed"===o.type&&(t.remoteErrorStore.setState({requestSrc:n.src,errorBody:o.body}),o.status>=500&&o.status<600&&Xt(t))})).finally((()=>{t.asyncAggregationStatusStore.setState({calculating:!1})}))));d.push(o)}}else m=z.queryCollection(e,o,void 0,n,void 0,c).then((o=>{const r=he.vS(t,n.src),i="success"===o.type||"failed"===o.type&&!o.offline?o.headers["X-Notion-Request-Id"]:void 0;if(Me.default.DO_NOT_USE_measureLegacy(u,{environment:e,data:{...r,request_ids:i?[i]:void 0}}),"success"===o.type)return"initial_load"===n.src&&F.Z.set((0,Ie.Z)(s.collectionView.id),s),t.asyncAggregationStatusStore.setState({calculating:!1}),t.timedOutRequestCounter=0,Bt({environment:e,remoteRequest:s,collectionContextStore:t,response:o.data,updateCounter:l});"failed"===o.type&&(t.remoteErrorStore.setState({requestSrc:n.src,errorBody:o.body}),o.status>=500&&o.status<600&&Xt(t))})),d.push(m);if(!(await(0,N.OI)(1e4,d)).timeout)return}else{!p&&o&&Ze.Z.state.online&&w.logWithSampleRate({samplePercentage:1,logMessage:{from:"collectionViewActions",type:"nonDefaultInMemoryRecordCacheQueryCollection",level:"info",data:{name:d.name}}});try{const n=await async function(e,t,n){const{source:o,collectionView:r,loader:i}=t,s=e.currentUser.id;let l;if("collection"!==o.type)throw new Error("TODO: support typed source");l={table:D.vF,id:o.id};const c=Date.now(),d=await xe.Ye({environment:e,pointer:l,inMemoryRecordCache:n});if(null==d||!d.model)throw new Error("Collection not found.");const u=d.model,p=await xe.Ye({environment:e,pointer:{table:B.np,id:r.id},inMemoryRecordCache:n});if(null==p||!p.model)throw new Error("Collection view not found.");const m=T.s85.fromMonomorphicFunctionUnsafe((async t=>{const n=await xe.Ye({environment:e,pointer:t});return null==n?void 0:n.model})),g=p.model,f=M.Ak.create(),v=T.omK.fromRecordMap(f),y=u.getNormalizedSchema(),{groupsReducerIds:b,reducerIdsWithNoGroupDependencies:_}=h.x3(i.reducers,i.reducerDependencies),S=Ue.default.getConfigKey("collection_request_settings","clientFormulaTimeoutMs"),k={schema:y,pageSort:(null==g?void 0:g.getPageSort())||[],collectionViewId:r.id,loader:i,userId:s,userStartOfWeek:me.AK.state,currentTime:c,getRecordModel:v,intl:we.default.getIntl(),isSorted:!1,relativeVariableResult:void 0,currentPageInRelatedCollection:i.currentPageInRelatedCollection,isSprintPlanningView:(null==g?void 0:g.getAppConfigUri())===a.sV,collectionSourceType:o.type,groupsReducerIds:b,reducerIdsWithNoGroupDependencies:_,formulaTimeoutMs:S,resultCache:new Map},w=u.__IM_SORRY__getValue(),x=h.fk(k),I=(await xe.ne({environment:e,collection:u,inMemoryRecordCache:n})).filter((e=>{let{model:t}=e;return null==t?void 0:t.alive})),C=U.oA(I.map((e=>{let{model:t}=e;return null==t?void 0:t.__IM_SORRY__getValue()}))),P=(i.reducers?Object.values(i.reducers):[]).some((e=>Boolean("results"===e.type&&e.loadContentCover))),A=new Map,E={};C.forEach((e=>E[e.id]=u));const F=g.getFormat(),Z=g.getType(),V=F&&Z&&h.ps(F,Z,y),N=await h.Ct({collectionValueOrModel:w,loader:i,loadAllProperties:!1,recordMap:f,loadRecordModel:m,dependencyCache:A,searchProperties:V});await h.c_({blocks:C,dependencies:N,blockIdToAssociatedCollectionModelCache:E,recordMap:f,loadRecordModel:m,dependencyCache:A,resultCache:k.resultCache}),P&&await h.jF({blocks:C,loadRecordModel:m,recordMap:f});for(const a of C)h.BW(a,w,k,x);const{result:O}=h.kk(k,x),L=M.PF.create(),j=h.aW({result:O});return await Promise.all(j.map((async t=>{const o=await xe.Ye({environment:e,pointer:{table:R.iU,id:t},inMemoryRecordCache:n});o&&L.setModelAndRole({table:R.iU,id:t},o.model,o.role)}))),L.setModelAndRole(l,d.model,d.role),L.setModelAndRole({table:B.np,id:r.id},p.model,p.role),{result:O,recordMap:L.toJson({allowVersionDowngrade:!1}),relativeVariableResult:void 0,collectionIds:void 0,shouldUseClientMode:!1,isViewSpecificClientMode:!1,allBlockIds:void 0}}(e,s,d),o=M.PF.create(n.recordMap);te.fL({environment:e,inMemoryRecordCache:d,recordMap:o,debugSource:"collectionViewActions.fetchRemoteResult (localResponse)"}),Bt({environment:e,collectionContextStore:t,remoteRequest:void 0,response:n,updateCounter:l})}catch(g){}finally{t.resetLoadingState()}}m&&m.catch((e=>{}))}function Bt(e){const{environment:t,remoteRequest:n,collectionContextStore:o,response:r,updateCounter:i,keepAggregationResults:a}=e,s=o.collectionViewStore();if(!o.shouldUpdate(i))return;const l=o.remoteResultStore.state;if(!l||!U.Xy(l,r.result)){var c;const e=r.result;if("reducer"===r.result.type){if(a){const t=Object.entries((null==l?void 0:l.reducerResults)||{}).filter((e=>{let[t,n]=e;return"aggregation"===n.type})).reduce(((e,t)=>{let[n,o]=t;return e[n]=o,e}),{});e.reducerResults={...t,...e.reducerResults}}o.remoteResultStore.setState(e)}if(void 0===o.wasServerResponseFromCache){var d,u;let e="NA";!0===(null===(d=r.tags)||void 0===d?void 0:d.isLoaded)?e="CACHED":!1===(null===(u=r.tags)||void 0===u?void 0:u.isLoaded)&&(e="UNCACHED"),o.wasServerResponseFromCache=e}var p;if(void 0===o.requestBackend)o.requestBackend=null===(p=r.tags)||void 0===p?void 0:p.backendUsed;const t=null===(c=r.clientSettings)||void 0===c?void 0:c.throttleMs;if(t&&t>o.throttleMsStore.state&&o.throttleMsStore.setState(t),r.shouldUseClientMode)o.isClientModeEnabledStore.setState(!0),o.isViewSpecificClientModeEnabledStore.setState(Boolean(r.isViewSpecificClientMode)),o.resultSetStore.resetWithRemote(r.allBlockIds);else{o.isClientModeEnabledStore.setState(!1),o.isViewSpecificClientModeEnabledStore.setState(Boolean(r.isViewSpecificClientMode));const e=new Set(h.aW({result:r.result,onlyTypes:["results"]}));o.resultSetStore.resetWithRemote(e)}}const m=o.remoteCollectionIdsStore.state,g=r.collectionIds||[];U.Xy(m,g)||o.remoteCollectionIdsStore.setState(g),Ve.Z.addFromRecordMapWithRoleJson(r.recordMap),Ve.Z.isEmpty()||le.dY({environment:t}),o.privateRelativeVariableStore.setState({...o.privateRelativeVariableStore.state,...r.relativeVariableResult});if(o.remoteResultStore.state&&(o.resetLoadingState(),o.isLoadedStore.setState(!0),o.lastRemoteRequestStore.setState(n),s)){const e=$t(s);ke.y.set(e,{remoteResult:o.remoteResultStore.state,resultSet:o.resultSetStore.state,collectionIds:o.remoteCollectionIdsStore.state})}}function Et(e,t){const n=t.collectionViewStore(),o=t.searchQueryStore.state;if(!n)return;const r=t.currentSubitemFormatStoreForUiDisplayStore.state,i=null==n?void 0:n.getType(),a=(0,fe.ze)(t,!0),s=t.currentSortsStore.state,l=function(e){const t=e.reducersStore.state,n={};return U.Ed(t,((e,t)=>{e&&(n[t]=e.reducer)})),n}(t);if(U.xb(l))return;let c;if(t.reducerDependencies.size>0){c={};for(const[e,n]of t.reducerDependencies)c[e]=[...n]}const d=(0,E.C)(n.pointer.spaceId),u=n.getCollectionSource();if(!u)return;const p=t.normalizedSchemaStore.state,m=(null==r?void 0:r.property)&&p[r.property],g=t.collectionViewModuleContextStore.currentPageInRelatedCollectionId();return{source:u,collectionView:{id:n.id,spaceId:d},loader:{reducers:l,filter:a,sort:s,searchQuery:o,userId:e.currentUser.id,userTimeZone:(0,x.r)(),...m&&(0,f.p_)(m)&&i&&(0,_e.Av)(i)&&{upwardTraversalRelation:m},reducerDependencies:c,currentPageInRelatedCollection:g}}}function Ft(e){const{reducerId:t,instanceId:n,reducer:o,collectionContextStore:r,groupsPointer:i}=e,a=r.reducersStore.state,s=a[t];let l,c;if(i&&i.length>0&&(l=(0,g.KW)(i)),o){if(c={instanceIds:U.jj([...(null==s?void 0:s.instanceIds)||[],n]),reducer:o},l){r.reducerDependencies.has(l)||r.reducerDependencies.set(l,new Set);const e=r.reducerDependencies.get(l);null==e||e.add(t)}}else{if(l){const e=r.reducerDependencies.get(l);e&&(e.delete(t),0===e.size&&r.reducerDependencies.delete(l))}const e=U.zu((null==s?void 0:s.instanceIds)||[],n);c=s&&e.length>0?{instanceIds:e,reducer:s.reducer}:void 0}U.Xy(s,c)||r.reducersStore.setState({...a,[t]:c})}function Zt(e){const{environment:t,collectionViewId:n,openInNew:o,collectionContextStore:r,isFullScreen:a,isRootChild:s,isInPeekRenderer:l}=e,c=r.collectionViewBlockStore();if(c){if(c===De.default.state.mainEditorCurrentBlockStore||o)ne._c({environment:t,store:c,openInNew:o,collectionViewId:n,pageVisitSource:i.tY.ChangeCollectionView});else{const e=new Oe.Xr(t,{table:B.np,id:n},{inMemoryRecordCache:c.inMemoryRecordCache}),o=e.getCollectionStore();ot({environment:t,collectionViewBlockStore:c,collectionViewStore:e,collectionStore:o,collectionContextStore:r,isFullScreen:a,isRootChild:s,isInPeekRenderer:l,collectionViewModuleContextType:r.collectionViewModuleContextStore.state,forceLocalQueryCollection:!1}),C.Z.set({userId:t.currentUser.id,key:Be.Z.getLocalViewPreferenceKey(c.id),value:n})}kt({collectionContextStore:r})}}function Ut(e){const{environment:t,collectionContextStore:n}=e;let o=n.collectionStore();const r=n.collectionViewBlockStore();if(!o||!r)return;const{mainEditorCurrentBlockStore:i}=De.default.state;i&&n.isFullScreenStore.state&&(o=Oe.NW.createChildStore(i,o.pointer)),ae.selectAllText({environment:t,store:o.getNameStore(),canSelectAllBlocks:!1})}function Vt(){ie.MO(),function(){const e=Fe.Z.state,t=Le.default.state;if(e.isActive&&1===t.stores.length&&t.stores[0].id===e.store.id)return;Ot()}()}function Nt(e){const{store:t,transient:n}=e;Fe.Z.setState({isActive:!0,store:t,transient:Boolean(n)})}function Ot(){Fe.Z.setState({...Fe.Z.state,isActive:!1})}function Lt(e){const{store:t}=e;"new"===Ee.Z.state.editMode&&Ee.Z.state.store.id===t.id&&Ee.Z.reset()}async function jt(e){const{environment:t,collectionContextStore:n,blockIdToMinimumVersion:o}=e;await async function(e,t){return await Promise.all((0,L.qP)(t).map((async t=>{let[n,o]=t;return te.bG({environment:e,inMemoryRecordCache:e.defaultRecordCache.inMemoryRecordCache,pointer:{table:R.iU,id:n},userId:e.currentUser.id,minimumVersion:o})})))}(t,o),n.resultSetStore.addLocalChange(Object.keys(o))}function Kt(e){let{currentUserId:t,spaceId:n}=e;const o=C.Z.get({userId:t,key:zt(n)});if(o){const e=(0,j.dj)(o);return Array.isArray(e)?e:[]}return[]}function zt(e){return`getRecentlyNavigatedCollections:${e}`}function qt(e){let{currentUserId:t,collectionViewId:n,collectionViewModuleCurrentPageId:o,temporaryState:r}=e;const i=Wt({collectionViewId:n,collectionViewModuleCurrentPageId:o});r?C.Z.set({userId:t,key:i,value:JSON.stringify(r)}):C.Z.remove({userId:t,key:i})}function Ht(e){const t=Gt(e.collectionViewId);C.Z.set({userId:e.userId,key:t,value:e.isOpen})}function Gt(e){return`collectionViewFilterBarOpenState:${e}`}function Wt(e){const{collectionViewId:t,collectionViewModuleCurrentPageId:n}=e;return n?`collectionViewTemporaryState:${t}:${n}`:`collectionViewTemporaryState2:${t}`}function $t(e){const t=e.id,n=e.getCollectionSource();return"trending"===(null==n?void 0:n.type)?{collectionViewId:t,teamId:n.teamId}:{collectionViewId:t}}function Yt(e){var t;const{store:n,typedDatabases:o,environment:r,event:i}=e,a=Ye.fm(n);if(!(0,je.M_)(r))return;r.device.isMobile&&Re.close();const s=null===(t=n.getCollectionViewStores().at(0))||void 0===t?void 0:t.id;if(!a&&!s)return;const l=a??new Be.Z(r);if(!a&&s){const e=Oe.Xr.createChildStore(n,{table:B.np,id:s});ot({environment:r,collectionViewBlockStore:n,collectionViewStore:e,collectionStore:void 0,collectionContextStore:l,isFullScreen:!0,isRootChild:!0,isInPeekRenderer:!1,collectionViewModuleContextType:void 0,forceLocalQueryCollection:!1}),l.remoteCollectionIdsStore.setState(o.map((e=>e.id)))}else 0===l.collectionStoresStore.state.length&&l.remoteCollectionIdsStore.setState(o.map((e=>e.id)));se.createAndCommit({userAction:"collectionViewActions.handleAddMultiSourceViewPageButtonClick",environment:r,perform:e=>{var t;Qt({transaction:e,store:n,collectionContextStore:l,environment:r,shouldCoerce:!0,showMoveTo:!0,peekModeOverride:"center_peek",from:"sidebar_new_page_button",useCrdt:(0,ue.SL)({event:i,source:"collection_unknown_view",contextualDefault:null===(t=l.defaultPageTemplateStore.getState())||void 0===t?void 0:t.useCrdt()})})}})}function Qt(e){const{transaction:t,store:n,collectionContextStore:o,environment:r,shouldCoerce:i,showMoveTo:a,peekModeOverride:s,from:l,useCrdt:c}=e,d=H.IW({environment:r,collectionContextStore:o,groupsPointer:[],insertAtIndex:0,shouldCoerce:i,initializeDefaultTemplate:i,transaction:t,from:l,useCrdt:c});if(!d)return;let u=Ye.kr(o);s&&(u=s),re.CH({environment:r,store:d.newStore,peekMode:u,showMoveTo:a,resultsStore:void 0,collectionContextStore:o,pageVisitSource:Jt({blockId:n.id,collectionContextStore:o})});const p="collectionTypedView"===o.contextType?d.newStore.getAssociatedCollectionId():void 0;return K.W(r,{from:l,type:"page",new_page_id:d.newStore.id,creating_block_id:d.newStore.id,...he.Pn(o,p)}),d.newStore}function Jt(e){const{blockId:t,collectionContextStore:n}=e,o=(0,me.qG)(t),r=(0,me.X)(t),a=n.isInHomeWidgetStore.state;return r?a?i.tY.PersonalHomeTileCustomDbCreate:i.tY.PersonalHomeCustomDbCreate:o?a?i.tY.PersonalHomeTileTasksCreate:i.tY.PersonalHomeTasksCreate:i.tY.Create}function Xt(e){if(e.timedOutRequestCounter++,e.timedOutRequestCounter>=3){const t=Ue.default.getConfigKey("query_collection_slow_mode","clientThrottleMs");t>e.throttleMsStore.state&&e.throttleMsStore.setState(t)}}function en(e){const{collectionStore:t,collectionViewStore:n,collectionViewBlockStore:o,collectionContextStore:r,environment:i}=e,a=null==n?void 0:n.id,s=a?(0,Te.x)(a):void 0,l=Ye.gL({collectionStore:t,sourceCollectionViewBlockStore:o,currentCollectionViewBlockStore:o,currentCollectionViewStore:n,constraints:(0,Te.x)(n.id)}).find((e=>{var t;return e.id===(null==s||null===(t=s.viewPointer)||void 0===t?void 0:t.id)}));l&&tn({viewToDuplicateStore:l,collectionContextStore:r,collectionViewStore:n,environment:i})}function tn(e){const{viewToDuplicateStore:t,collectionContextStore:n,collectionViewStore:o,environment:r,temporaryStore:i}=e,a=n.collectionStore(),s=t.getType();if(!s||!a)return;const l=t.getName(),c=t.getPageSort(),d=t.getFormat(),u=t.getKeyStore("query2").getValue();se.createAndCommit({userAction:"CollectionSettingsDuplicateExistingView.duplicateViewSettings",environment:r,perform:e=>{ee.sW({store:i??o,data:{name:l,type:s,page_sort:c,format:{...d,collection_pointer:a.pointer},query2:u},transaction:e})}}),kt({collectionContextStore:n})}},820616:(e,t,n)=>{n.d(t,{F:()=>c});n(667294);var o=n(800480),r=n(724405),i=n(562760),a=n(379362),s=n(708661),l=n(785893);function c(e){const{device:t}=(0,o.O7)(),n=(0,r.Fg)(),{color:c,viewIcon:d,viewType:u,size:p,style:m}=e,g=function(e){return{regular:e.regularTextColor,light:e.mediumTextColor,gray:a.Lr[e.mode].gray,lightGray:a.Lr[e.mode].lightgray,blue:e.blueColor}}(n)[c];return u?d?(0,l.jsx)(i.Z,{style:{fill:g,backfaceVisibility:void 0,...m},size:p??(t.isMobile?18:16),theme:n,icon:d}):s.aW[u]({width:p??(t.isMobile?18:16),height:p??(t.isMobile?18:16),backfaceVisibility:void 0,fill:g,...m}):null}},354851:(e,t,n)=>{n.d(t,{Z:()=>I});var o=n(667294),r=n(973935),i=n(800480),a=n(886628),s=n(815145),l=n(926249),c=n(458912),d=n(275754),u=n(800993),p=n(632741),m=n(668709),g=n(224813),f=n(466213),h=n(214976),v=n(783105),y=n(484210),b=n(99340),_=n(646735),S=n(222294),k=n(272014),w=n(785893);function x(e,t){const n=(0,i.O7)(),l=(0,o.useContext)(f.ZO),x=(0,o.useRef)(null),I=(0,o.useRef)(null),C=(0,b.PE)(e.store,e.disabled),T=(0,b.rv)(e.store),M=(0,o.useCallback)((()=>{_.Z.recordVisit({id:e.store.id,systemBlockType:e.store.getSystemBlockTypeStore().getValue(),type:v.vu.Link,currentUserId:n.currentUser.id}),c.SK(n,{page_visit_id:k.$g.getCurrentPageVisitId(),mentioned_page_id:e.store.id,source_type:"collection_view_page_block",hover_preview_enabled:!0,is_navigable_block:e.store.isNavigableBlock()})}),[n,e.store]),P=(0,o.useCallback)((()=>{if(!I||!I.current)return;const t=r.findDOMNode(I.current);return(0,h.We)(e.store,t)}),[e.store]),A=(0,o.useCallback)((t=>{const o=P(),r=e.store.getTitleStore();r&&o&&u.Nh({environment:n,event:t,interactiveToken:o,store:r,canEdit:C})}),[C,n,P,e.store]),R=(0,o.useCallback)((t=>{const o=P(),r=e.store.getTitleStore();r&&o&&u.Zl({environment:n,event:t,interactiveToken:o,store:r,canEdit:C})}),[C,n,P,e.store]),D=(0,o.useCallback)((()=>{if(l){const t=(0,y.ZP)({store:e.store,pageVisitSource:s.tY.Create});l(t)}else d._c({environment:n,store:e.store,visitType:v.vu.Link,pageVisitSource:s.tY.Create})}),[n,l,e.store]);(0,o.useEffect)((()=>()=>{p.qA(e.store.getTitleStore())}),[e.store]);const B=(0,a.VK)((()=>{const t=e.store.getCollectionViewSourceCollectionStore();return null==t?void 0:t.isSyncedCollection()}),[e.store]),E=(0,a.VK)((()=>e.store.isCollectionViewAlias()||e.store.recordStoreParentDiffersFromPersistedParent()),[e.store]);return(0,b.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"collection_view_page",getNode:()=>x.current,getBlockStore:()=>e.store,activate:D,handleCreated(){D(),S.Z.setKeyboardMode(!1)}})),[D,e.store]),(0,w.jsx)(m.p,{allowSelectionWithin:!1,onMouseOver:A,onMouseOut:R,children:(0,w.jsx)(g.Z,{ref:I,store:e.store,style:{...T,...e.style},isAlias:E,disabled:Boolean(e.disabled||B),onClick:M})}))}const I=o.memo(o.forwardRef(x),l.Z)},874051:(e,t,n)=>{function o(e){return"full_page"===(null==e?void 0:e.normalizedFormatStore.state.collection_peek_mode)}n.d(t,{Y:()=>o})},110906:(e,t,n)=>{n.d(t,{$l:()=>Ee,Bm:()=>Be,Bs:()=>ce,Cc:()=>ue,Ch:()=>ve,D:()=>ge,D2:()=>ie,D8:()=>$,HI:()=>G,Ks:()=>se,L5:()=>he,NG:()=>ne,NU:()=>ee,PD:()=>H,PI:()=>z,Ql:()=>Ae,SY:()=>Ie,Sc:()=>Se,Se:()=>q,VM:()=>re,Vv:()=>pe,XO:()=>ye,YL:()=>fe,_5:()=>le,ay:()=>we,az:()=>oe,b1:()=>De,bW:()=>Re,bd:()=>te,eD:()=>me,fk:()=>Me,fm:()=>Te,gL:()=>Fe,kr:()=>_e,mb:()=>xe,p1:()=>ae,pB:()=>ke,rD:()=>de,v_:()=>Pe,w0:()=>be,wK:()=>X,xy:()=>Y,zm:()=>W});n(757658),n(21703);var o=n(815145),r=n(841892),i=n(541432),a=n(399036),s=n(180951),l=n(143690),c=n(293824),d=n(320297),u=n(895538),p=n(406695),m=n(798963),g=n(421202),f=n(606287),h=n(213493),v=n(421838),y=n(709291),b=n(531701),_=n(653965),S=n(215828),k=n(51592),w=n(935541),x=n(721429),I=n(248543),C=n(484210),T=n(741195),M=n(433929),P=n(450627),A=n(785957),R=n(417311),D=n(635328),B=n(58202),E=n(849427),F=n(224646),Z=n(80444),U=n(385555),V=n(188923),N=n(206258),O=n(27724),L=n(951247),j=n(874051);new Set(["gallery","list","calendar"]);const K=(0,y.defineMessages)({addTypedItemTitle:{id:"collectionViewBlock.action.newItem.typedDatabaseTitle",defaultMessage:"New {singleItemName}"},addItemTitle:{id:"collectionViewBlock.action.newItem.nonTypedDatabaseTitle",defaultMessage:"New"}});function z(e){return"collectionTypedView"===e.contextType?M.default.formatMessage(K.addTypedItemTitle,{singleItemName:(0,k.sN)(e.databaseType)}):M.default.formatMessage(K.addItemTitle)}function q(e){const t=Object.keys(e);return t.find((t=>{const n=e[t];return Boolean(n&&"status"===n.type)}))||t.find((t=>{const n=e[t];return Boolean(n&&"select"===n.type)}))||t.find((t=>{const n=e[t];return Boolean(n&&"person"===n.type)}))||t.find((t=>{const n=e[t];return Boolean(n&&"multi_select"===n.type)}))||t.find((t=>{const n=e[t];return Boolean(n&&"relation"===n.type)}))}function H(e){const t=Object.keys(e);return t.find((t=>{const n=e[t];return Boolean(n&&"date"===n.type)}))||t.find((t=>{const n=e[t];return Boolean(n&&"created_time"===n.type)}))||t.find((t=>{const n=e[t];return Boolean(n&&"last_edited_time"===n.type)}))}function G(e){return Object.keys(e).find((t=>{const n=e[t];return Boolean(n&&"date"===n.type)}))}function W(e){const{collectionId:t,schema:n,property:o,targetCollectionStore:r,omitNewSchema:i}=e,l=n[o];if(!l)return;const c={newSchema:i?{}:{...n,[o]:void 0},deletedSchema:{[o]:n[o]}};if("relation"===l.type&&a.F0(l)&&l.property&&!(0,s.Kp)(l))if(a.F0(l)===t&&l.property!==o){const e=i?{}:{...c.newSchema,[l.property]:void 0},t={...c.deletedSchema,[l.property]:n[l.property]};c.newSchema=e,c.deletedSchema=t}else if(a.F0(l)!==t&&null!=r&&r.canEditCollection()&&r.isDefined()){const e=a.oC({id:r.id,schema:r.getSchema(),format:r.getFormat(),space_id:r.getSpaceId()}),t=i?{}:{...e,[l.property]:void 0},n={[l.property]:e[l.property]};c.otherCollectionId=r.id,c.otherCollectionSchema=t,c.otherCollectionDeletedSchema=n}return c}function $(e){const{deletedSchema:t,property:n}=e;if(t[n])return{updateSchema:{[n]:t[n]},updateDeletedSchema:{[n]:null}}}async function Y(e){const{schema:t,properties:n,property:o,parentStore:r,spaceId:i,environment:s}=e,l=t[o];if(!l)return;if(a.dx(l))return;const c=(0,S.ZP)(),u={...l,name:(0,d.nM)(l.name)};let p;if("button"===u.type&&u.automation_id){const e=N.Mz.createChildStore(r,{id:u.automation_id,spaceId:i,table:m.cv});await e.load();const t=e.getActionStores();await Promise.all(t.map((e=>e.load())));const n=(0,T.TS)({environment:s,table:m.cv,spaceId:i});u.automation_id=n,p={sourceAutomationStore:e,targetAutomationId:n}}return{newProperty:c,newPropertySchema:u,newProperties:(()=>{if(!n)return[];const e=n.findIndex((e=>e.property===o)),t=n[e],r={property:c,visible:!0,width:t&&t.width},i=[...n];return i.splice(e+1,0,r),i})(),automationUpdate:p}}function*Q(e){const{rootStore:t,depth:n=0}=e;if(t.getType()===i.Ti.transclusionReference){const e=t.getTransclusionReferenceTargetStore();e&&(yield*Q({rootStore:e,depth:n}))}else{const o=t.getContentStores();for(const t of o)yield{blockStore:t,depth:n},t.isNavigableBlock()||!e.goIntoToggles&&(0,D.BX)(t)||(yield*Q({rootStore:t,depth:t.getType()===i.Ti.columnList||t.getType()===i.Ti.column||t.getType()===i.Ti.transclusionContainer||t.getType()===i.Ti.transclusionReference?n:n+1}))}}function J(e){const{rootStore:t,renderAdditionalBlocks:n,startBlockId:o,tableRenderMode:r}=e,a={image:void 0,blocks:[],isDefined:!0},s=Q({rootStore:t,goIntoToggles:void 0!==o});let c=0,d=0,p=!1;for(const{blockStore:m,depth:g}of s){if(o&&!p){if(m.id!==o)continue;p=!0}if(c++,c>l.C7)return a;m.isDefined()||(a.isDefined=!1);const e=m.getType(),t=m.getModel();if(!e||!t)continue;const s=m.getProperties();if(t.isType(i.Ok)&&!a.image&&s){const t=(0,v.QaF)(s.source);if(t&&((0,u.SR)({url:t})||e===i.Ti.image))return a.image={pointer:{table:"block",id:m.id},url:t},a}const f=(0,i.nq)(e),h=m.isCalloutV2(),y=t.isType(i.MV)&&(!m.isEmptyTitle()||f||h);let b=m;o&&m.id===o&&"table_row"===e&&(b=b.getParentBlockStore());const _=n&&b&&void 0!==(0,w.u)({store:b,tableRenderMode:r});(y||_)&&d<l.Uo&&(a.blocks.push({blockStore:m,depth:g}),f||d++)}return a}function X(e){const{image:t,blocks:n,isDefined:o}=J(e);return t?{image:t,blockIds:[],isDefined:o}:{image:void 0,blockIds:n.map((e=>e.blockStore.id)),isDefined:o}}function ee(e){var t,n;const{rootStore:o,renderAdditionalBlocks:a,theme:s}=e;if(a&&o.isCollectionView()&&(null===(t=o.getModel())||void 0===t||!t.hasWikiBlockUri())&&(null===(n=o.getAssociatedCollectionStore())||void 0===n||!n.isPageTreeCollection()))return{image:{url:"dark"===s?r.Z.images.blockRendererCovers.collectionTableDarkPng:r.Z.images.blockRendererCovers.collectionTableLightPng,pointer:{id:o.id,table:o.table,spaceId:o.getSpaceId()}},blockIds:[],isDefined:!0};const{image:l,blocks:c,isDefined:d}=J({rootStore:o,renderAdditionalBlocks:a,tableRenderMode:"image"});if(l)return{image:l,blockIds:[],isDefined:d};return{image:void 0,blockIds:c.filter((e=>{const{blockStore:t,depth:n}=e;return 0===n&&t.getType()!==i.Ti.transclusionReference&&t.getType()!==i.Ti.transclusionContainer})).map((e=>e.blockStore.id)),isDefined:d}}function te(e){const t=e.isFullScreenStore.state,n=e.collectionViewStore();if(!n)throw new Error("Collection view store not defined.");const o=e.normalizedFormatStore.state,r=n.isDefined()&&n.getType(),i="board"===r,a="table"===r,s=o.collection_group_by;if(!t||s){const e=p.rx(o.inline_collection_first_load_limit,Boolean(s));if("load_limit"===e.type)return e.limit}if(i)return 20;if(t){if(a&&U.default.checkGate({gateName:"collections_virtualization"})){return U.default.getConfigKey("collection_virtualized_load_limits","table").initial_limit}return 50}return 20}function ne(e){const{collectionViewStore:t,isFullScreen:n,currentResultCount:o}=e,r=t.isDefined()&&t.getType();if("board"===r)return 20;if(n){if("table"===r&&U.default.checkGate({gateName:"collections_virtualization"})){return U.default.getConfigKey("collection_virtualized_load_limits","table").increment_limit}return 50}return o<=50?50:100}function oe(e,t){const n=e.collectionViewStore();if(!n)return!1;if("collectionVirtualView"===e.contextType)return!1;const o=n.getFormatStore().getKeyStore("collection_group_by").getValue();return!t||Boolean(o)}function re(e){const{collectionContextStore:t,isFullScreen:n,reducerResult:o}=e;return o&&o.blockIds.length>0&&!((r=o)&&!r.hasMore)&&oe(t,n);var r}function ie(e){const{query:t,schema:n}=e,{timeline_by:o,timeline_by_end:r}=t;if(o){const e=n[o];if(e&&"date"!==e.type)return!1}if(r){const e=n[r];if(e&&"date"!==e.type)return!1}return!0}function ae(e){const t=e.getParentBlockStore();return Boolean(t&&t.isLocked())}function se(e){return V.default.isSidePeekOpen()&&!(0,A.wq)(e)&&!e.isImmediateColumnChild()&&(e.isRootOrDirectChild()||"page"===e.getType())}function le(e){const t=e.getRecordStoreUIRoot();return!!(t&&t instanceof N.G)&&t.isFullWidth()}function ce(e){const{environment:t,isFullScreen:n,store:o,sizeObserver:r,viewType:i}=e,{device:a,WindowSizeStore:s}=t,l=o.isRootOrDirectChild(),c=!n&&!l,d=E.Z.isBlockInTemplate(o);if(c&&"gallery"===i)return{paddingLeft:1,paddingRight:1};if(l){if((0,A.wq)(o))return{paddingLeft:V.PeekModePadding.horizontal[V.default.state.mode],paddingRight:V.PeekModePadding.horizontal[V.default.state.mode]};if(a.isPhone)return{paddingLeft:s.getSafePaddingLeftPx((0,x.ui)(t)),paddingRight:s.getSafePaddingRightPx((0,x.ui)(t))};if(n)return{paddingLeft:96,paddingRight:96};if(!d&&!E.Z.isBlockInPageSnapshot(o)||E.Z.isBlockInWiki(o)){if(le(o)||function(e,t){const{WindowSizeStore:n}=e;return n.state.width-((0,F.Wk)(e)+(0,F.ll)(e,t)-(0,F.vJ)(e))<P.zL}(t,(0,A.wq)(o))||se(o)&&!V.default.isSidePeekClosingStore.state){const e=(0,x.ui)(t);return{paddingLeft:e,paddingRight:e}}{const e=r.rect.state.width;if(0===e)return;const n=(e-(P.zL-2*(0,x.ui)(t)))/2;return{paddingLeft:n,paddingRight:n}}}{const e=r.rect.state.width;if(0===e)return;const t=le(o)&&d?20+L.wN:20,n=Math.max((e-P.zL)/2,t);return{paddingLeft:n,paddingRight:n}}}return{paddingLeft:0,paddingRight:0}}function de(e){switch(e){case"large":return R.Z.card.desktop.large.width;case"small":return R.Z.card.desktop.small.width;default:return R.Z.card.desktop.medium.width}}function ue(e){let{collectionViewName:t,collectionViewType:n}=e;return t||M.default.formatMessage(De[n])}function pe(e){var t;return((null===(t=e.getParentBlockStore())||void 0===t?void 0:t.getCollectionViewsStore().getValue())||[]).map((t=>N.Xr.createChildStore(e,{table:h.np,id:t}))).find((e=>"table"===e.getType()))}function me(e){const{collectionStore:t,collectionViewBlockStore:n,checkNavigableAncestorLocked:o}=e;if(!n)return!1;if(o&&n.isNavigableAncestorNonEditableState())return!1;const r=null==t?void 0:t.canEditCollection(),i=null==t?void 0:t.getParentBlockStore(),a=null==i?void 0:i.isNonEditableState();return Boolean(r&&!a)}function ge(e,t){const n=e.getType();if(!n)return!1;if(""===t)return!0;return-1!==ue({collectionViewName:e.getName(),collectionViewType:n}).toUpperCase().indexOf(t.toUpperCase())}function fe(e){const{newOptions:t,collectionId:n,property:o,schema:r}=e,i=r[o];if(!i)return;if(!a.cu(i)&&"status"!==i.type)return;const s=i.options||[],l=[],d=_.xH(t),u=s.map((e=>e.value)),{beforeOps:p}=(0,c.q)(u,d);for(const[a,c]of Object.entries(p)){const e=s.find((e=>e.value===a));if(e)if(c){const t=s.find((e=>e.value===c));if(t){const r={pointer:{table:f.vF,id:n},command:"keyedObjectListBefore",path:["schema",o,"options"],args:{value:e,before:{id:t.id}}};l.push(r)}}else{const t={pointer:{table:f.vF,id:n},command:"keyedObjectListAfter",path:["schema",o,"options"],args:{value:e}};l.push(t)}}if("status"===i.type){const e=i.groups??[];for(const[r]of e.entries()){const e=t[r];if(!Array.isArray(e))return;const i=s.filter((t=>e.includes(t.value))).map((e=>e.id)),a={pointer:{table:f.vF,id:n},command:"set",path:["schema",o,"groups",r,"optionIds"],args:i};l.push(a)}}return l.length>0?l:void 0}function he(e){const{collectionId:t,property:n,propertySchema:o,schema:r,isAscending:i}=e;return fe({newOptions:[...o.options||[]].map((e=>e.value)).sort(((e,t)=>e.localeCompare(t,void 0,{sensitivity:"base"})*(i?1:-1))),collectionId:t,property:n,schema:r})}function ve(e){const{collectionId:t,property:n,propertySchema:o,newOption:r,isAscending:i}=e,a=o.options||[],s=_.cx(a,(e=>e.value.localeCompare(r.value,void 0,{sensitivity:"base"})*(i?1:-1)>=0));return-1!==s?{pointer:{table:f.vF,id:t},command:"keyedObjectListBefore",path:["schema",n,"options"],args:{value:r,before:a[s]}}:{pointer:{table:f.vF,id:t},command:"keyedObjectListAfter",path:["schema",n,"options"],args:{value:r}}}function ye(e){const{viewType:t,format:n}=e;return"board"===t?p.Lw(n.board_cover):"gallery"===t?p.Lw(n.gallery_cover):"timeline"===t&&p.vP(Boolean(n.timeline_show_table),n.timeline_table_properties||[])}function be(e){const{viewType:t,property:n}=e;return"table"===t||("board"===t||"gallery"===t?"title"!==n:"calendar"===t&&"title"===n)}function _e(e){var t;const n=null==e?void 0:e.collectionViewStore(),o=null==n?void 0:n.getType();return null!=n&&null!==(t=n.getUnlistedStatus())&&void 0!==t&&t.isUnlisted&&null!=e&&e.isInlineViewStore.state?"center_peek":(null==e?void 0:e.normalizedFormatStore.state.collection_peek_mode)??(o?I.Ls[o]:"side_peek")}function Se(e){const{stores:t,phase:n}=O.default.state;return!(n===O.SelectionPhase.Selected&&t.indexOf(e)>=0)&&(V.default.state.open&&V.default.isSidePeekOpen()&&V.default.state.targetStore.id===e.id)}function ke(e,t){return e?{background:b.ZP.blueWithAlpha(.025),boxShadow:t.collectionTableOutlineUltraThinBlueInputBoxShadow,borderRadius:6}:{}}function we(e){const t=e.collectionStore();if(!t)return;const n=t.getParentBlockStore();return n?(0,C.ZP)({store:n,fullyQualified:!1,pageVisitSource:o.tY.Breadcrumb}):void 0}function xe(e){const{store:t,mainEditorCurrentBlockStore:n,collectionContextStore:r,fullyQualified:i,overridePeekMode:a,showMoveTo:s}=e,l=null==r?void 0:r.collectionViewStore();if(!a&&(0,j.Y)(r))return(0,C.ZP)({store:t,fullyQualified:i,pageVisitSource:(null==r?void 0:r.getPageVisitSourceOverride())??o.tY.Expand,showMoveTo:s});if(n){const e=null==r?void 0:r.getViewType();let c;c=null!=r&&r.isUnlistedViewStore.state&&null!=r&&r.isInlineViewStore.state?"center_peek":(null==r?void 0:r.normalizedFormatStore.state.collection_peek_mode)??(e?I.Ls[e]:void 0);const d=a??(0,V.getPeekModeFromCollectionPeekModeFormat)(c);return(0,C.ZP)({store:n,collectionViewId:null!=r&&r.isFullScreenStore.state?null==l?void 0:l.id:void 0,fullyQualified:i,peekViewBlockId:t.id,peekMode:(0,V.getUrlParamFromPeekMode)(d),pageVisitSource:(null==r?void 0:r.getPageVisitSourceOverride())??o.tY.PeekOpen,showMoveTo:s})}}function Ie(e){var t;const n=null===(t=e.getCollectionViewStores().find((e=>"page"===e.getType())))||void 0===t?void 0:t.getFormat().page_pointer;if(n)return N.G.createChildStore(e,{table:g.iU,id:null==n?void 0:n.id,spaceId:e.getSpaceId()})}function Ce(e){const t=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return null==e?void 0:e.findRecordStoreUIAncestor((n=>n instanceof N.G&&n.isCollectionView()&&(t||n.id!==e.id))).ancestor}(e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]);if(t)return B.R.findCollectionViewBlockFromId(t.id)}function Te(e){const t=Ce(e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]);if(null!=t&&t.collectionContextStore)return t.collectionContextStore}function Me(e){var t,n;let{environment:o,collectionContextStore:r}=e;if(o.device.isMobile)return!1;const{currentUserStore:i}=Z.default.state,a=Boolean(r.permissionScopesStore.state.canEditContent||"collectionTypedView"===r.contextType&&(null===(t=r.collectionViewBlockStore())||void 0===t?void 0:t.canEdit()));return!!i&&a&&"table"===(null===(n=r.collectionViewStore())||void 0===n?void 0:n.getType())&&!r.isInHomeWidgetStore.state}function Pe(e,t){let n=t;return e.every((e=>{if(e.getType()===i.Ti.page||e.getType()===i.Ti.collectionViewPage){var t;const o=null===(t=Ce(e,!1))||void 0===t?void 0:t.props.store.id;return!!o&&(void 0===n&&(n=o),o===n)}return!1}))}function Ae(e){return void 0!==e&&e>=0}function Re(e){return void 0!==e?e+1:0}const De=(0,y.defineMessages)({board:{id:"database.collectionView.untitledName.board",defaultMessage:"Board"},gallery:{id:"database.collectionView.untitledName.gallery",defaultMessage:"Gallery"},timeline:{id:"database.collectionView.untitledName.timeline",defaultMessage:"Timeline"},calendar:{id:"database.collectionView.untitledName.calendar",defaultMessage:"Calendar"},list:{id:"database.collectionView.untitledName.list",defaultMessage:"List"},table:{id:"database.collectionView.untitledName.table",defaultMessage:"Table"},page:{id:"database.collectionView.untitledName.page",defaultMessage:"Page"},chart:{id:"database.collectionView.untitledName.chart",defaultMessage:"Chart"},form_editor:{id:"database.collectionView.untitledName.form_editor",defaultMessage:"Form"}});function Be(e){let{store:t,collectionContextStore:n}=e;return"collectionVirtualView"===n.contextType?n.collectionStore():t.getAssociatedCollectionStore()}function Ee(e){return"page"===e?"page_view":e}function Fe(e){const{collectionStore:t,sourceCollectionViewBlockStore:n,currentCollectionViewBlockStore:o,currentCollectionViewStore:r,constraints:i}=e;let a=_.mN([...o.getCollectionViewStores(),...n.getCollectionViewStores()],(e=>e.id)).filter((e=>{var n;return(null===(n=e.getCollectionStore())||void 0===n?void 0:n.id)===t.id&&e.id!==r.id&&"page"!==e.getType()&&"form_editor"!==e.getType()}));if(null!=i&&i.viewType&&(a=[...a.filter((e=>e.getType()===i.viewType)),...a.filter((e=>e.getType()!==i.viewType))]),null!=i&&i.viewPointer){const{id:e}=i.viewPointer,t=a.find((t=>t.pointer.id===e))||N.Xr.createChildStore(n,i.viewPointer);a=[t,...a.filter((t=>t.pointer.id!==e))]}return a}},584370:(e,t,n)=>{n.d(t,{t:()=>i});var o=n(210228),r=n(165598);function i(e){const{transaction:t,blockStore:n,discussionId:i}=e,a=r.x8(n);return o.applyOperation({store:a,operation:{pointer:a.pointer,path:a.path,command:"listAfter",args:{id:i}},transaction:t}),a}},559847:(e,t,n)=>{n.d(t,{X:()=>u});var o=n(870279),r=n(594419),i=n(709953),a=n(800993),s=n(741195),l=n(165598),c=n(835491),d=n(485444);function u(e){const{discussionStore:t,files:n,text:u,environment:p,transaction:m}=e,g=(0,s.TS)({environment:p,table:o.x_,spaceId:t.pointer.spaceId}),f=i.Ue({environment:p,table:o.x_,args:{id:g,parent:t.pointer},inMemoryRecordCache:t.inMemoryRecordCache,transaction:m}),h=l.ak(t);r.R3({parentStore:h,appendStore:f,transaction:m});const v=l.zP(f);return a.sO({environment:p,store:v,value:u,transaction:m}),(0,c.J)({commentStore:f,files:n,environment:p,transaction:m}),(0,d.Q)(f,m),f}},346420:(e,t,n)=>{n.d(t,{c:()=>l});var o=n(471924),r=n(23867),i=n(401898),a=n(709953),s=n(559847);function l(e){const{createDiscussionArgs:t,blockStore:n,environment:l,transaction:c,commentTextValue:d,files:u,discussionId:p}=e;let m;"default"===t.type?m={id:p,type:"default",parent_id:n.id,parent_table:n.table,resolved:!1,context:t.context,space_id:(0,r.C)(n.pointer.spaceId),property_id:t.property_id}:"suggestion"===t.type?m={id:p,type:"suggestion",parent_id:n.id,parent_table:n.table,resolved:!1,context:{rejected:!1,modifiedBlockIds:t.modifiedBlockIds,latestSessionId:o.Il(),snapshot:{data:t.snapshotTextValue?[{type:"textValue",value:t.snapshotTextValue}]:[]},splitFrom:t.splitFrom},space_id:(0,r.C)(n.pointer.spaceId)}:(0,i.t1)(t);const g=a.ae({environment:l,table:"discussion",value:m,inMemoryRecordCache:n.inMemoryRecordCache,transaction:c});return{discussionStore:g,commentStore:(0,s.X)({discussionStore:g,text:d,files:u,environment:l,transaction:c})}}},835491:(e,t,n)=>{n.d(t,{J:()=>l});var o=n(631781),r=n(594419),i=n(27105),a=n(721429),s=n(165598);function l(e){const{environment:t,files:n,commentStore:l,transaction:c}=e,d=a.qQ(t),u=s.ig(l);o.z({files:n,environment:t,inMemoryRecordCache:l.inMemoryRecordCache,transaction:c,pageWidth:d,ignoreOversizedFiles:!0,spaceId:u.pointer.spaceId,useCrdt:i.dy({source:"comment"})}).forEach((e=>{r.R3({parentStore:u,appendStore:e,transaction:c})}))}},855661:(e,t,n)=>{n.d(t,{d:()=>a});var o=n(721429),r=n(165598),i=n(5779);function a(e){const{discussionStore:t,transaction:n}=e,a=r.HK(t);a&&(0,i.Z)({discussionIds:[t.id],transaction:n,blockStore:a});const s=o.RM();if(s){const e=r.MI({blockStore:s,transclusionReferences:"recurseInto",childPages:"omit"});for(const o of e){if(a&&o.table===a.table&&o.id===a.id)continue;const e=r.x8(o).getValue();null!=e&&e.includes(t.id)&&(0,i.Z)({discussionIds:[t.id],transaction:n,blockStore:o})}}}},5779:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(933709),r=n(456452),i=n(421838),a=n(182798),s=n(800993),l=n(210228),c=n(165598),d=n(206258);function u(e){const{discussionIds:t,blockStore:n,transaction:i}=e,s=t.filter((e=>{const t=d.t1.createChildStore(n,{table:o.qF,id:e,spaceId:n.getSpaceId()}),i=(0,a.TO)(n.getModel());return"suggestion"!==t.getType()||!(0,r.xT)({blockModel:i,discussionId:e})}));!function(e){const{blockStore:t,discussionIds:n,transaction:o}=e,r=c.x8(t);for(const i of n)l.applyOperation({store:r,operation:{pointer:r.pointer,path:r.path,command:"listRemove",args:{id:i}},transaction:o})}({blockStore:n,discussionIds:s,transaction:i});for(const o of s)p({store:n,discussionId:o,transaction:i})}function p(e){const{store:t,transaction:n,discussionId:o}=e,r=["m",o],a=i.c14(r);s.ST({environment:t.environment,store:t.getBlockTitleStore(),selection:{startIndex:0,endIndex:1/0},annotationKey:a,transaction:n,updateSelection:!1});for(const i of Object.keys(t.getProperties())){if("title"===i)continue;const e=t.getPropertyStore(i);s.ST({environment:t.environment,store:e,selection:{startIndex:0,endIndex:1/0},annotationKey:a,transaction:n,updateSelection:!1})}}},575497:(e,t,n)=>{n.d(t,{L:()=>i});var o=n(222491),r=n(95802);function i(e){var t;let n,{discussionId:i,blockId:a}=e;const s=null===(t=document.getElementsByClassName(`${(0,o.dk)({discussionId:i})}`))||void 0===t?void 0:t[0];if(s&&(n=r.C.findSelectableFromChildNode(s)),!n){n=r.C.findScrollToSelectablesFromIds([a])[0]}return n}},199953:(e,t,n)=>{n.d(t,{D:()=>d});var o=n(845369),r=n(585344),i=n(709953),a=n(524229),s=n(304761),l=n(992120),c=n(169296);function d(e){var t,n,d;const{environment:u,commentStore:p,discussionStore:m,transaction:g,discussionLocation:f}=e;if(a.Z.state.open){var h;const e=null===(h=a.Z.state.discussionIds)||void 0===h?void 0:h.filter((e=>e!==m.id));a.Z.setState({...a.Z.state,discussionIds:e,open:((null==e?void 0:e.length)||0)>0})}i.sW({store:m,data:{resolved:!0},transaction:g}),l.Z.setState({...l.Z.state,discussionIds:(null===(t=l.Z.state)||void 0===t||null===(t=t.discussionIds)||void 0===t?void 0:t.filter((e=>e!==m.id)))||[]});const v=o.B7.includes(f),y=null==m||null===(n=m.getParentStore())||void 0===n?void 0:n.getNavigableBlockStore(),b=m.getPropertyId(),_=m.getParentStore(),{property_type:S,collection_id:k,collection_view_id:w,view_type:x,collection_view_block_id:I}=(0,c.o)(b,_);r.hJ(u,{comment_id:null==p?void 0:p.id,discussion_id:m.id,discussion_type:m.getType(),parent_block_id:m.getParentId(),resolution_type:e.resolutionType,from:e.discussionLocation,parent_collection_id:null===(d=m.getParentStore())||void 0===d?void 0:d.getParentCollectionIdUpToTwoLevels(),...v&&{inbox_session_id:s.ZP.state.sessionId,notification_page_id:null==y?void 0:y.id},property_type:S,collection_id:k,collection_view_id:w,view_type:x,collection_view_block_id:I})}},485444:(e,t,n)=>{n.d(t,{Q:()=>a});var o=n(619584),r=n(709953),i=n(165598);function a(e,t){const n=i.bQ(e);r.sO({store:n,value:(0,o.ud)(Date.now()),transaction:t})}},380351:(e,t,n)=>{n.d(t,{C:()=>i});var o=n(947002),r=n(948514);function i(e){const t=r.Z.state;t.open?(r.Z.setState({open:!1,rect:t.rect}),o.Z.reset()):r.Z.setState({...t,from:void 0})}},859134:(e,t,n)=>{n.d(t,{i:()=>w});var o=n(541432),r=n(435011),i=n(142613),a=n(335102),s=n(842875),l=n(933709),c=n(421838),d=n(940470),u=n(619584),p=n(585344),m=n(666771),g=n(977357),f=n(741195),h=n(433929),v=n(385555),y=n(948514),b=n(584370),_=n(346420),S=n(380351),k=n(169296);function w(e){const{environment:t,type:n,blockStore:w,commentTextValue:x,transaction:I,files:C,property_id:T}=e,M=e.discussionId??(0,f.TS)({environment:t,table:l.qF,spaceId:w.pointer.spaceId}),{id:P}=t.currentUser;if(!P)return;const A=y.Z.state;let R;const{property_type:D,collection_id:B,collection_view_id:E,view_type:F,collection_view_block_id:Z}=(0,k.o)(T,w);if(T&&A.open&&"block"===A.type){const e=A.blockStore.getPropertyStore(T);if(R=e.getValue()||[],"status"===D&&0===R.length&&(R=[[h.default.formatMessage(i.i9.statusOptionNotStarted)]]),"formula"===D&&(R=function(e,t,n){var o;const i=t.getAssociatedCollectionStore(),l=null==i?void 0:i.getModel(),c=null==l?void 0:l.getNormalizedSchema()[n],p=null==c||null===(o=c.formula2)||void 0===o?void 0:o.code,m=t.getModel(),g=1*u.hM,f=v.default.getConfigKey("collection_request_settings","clientFormulaTimeoutMs")??g;if(m&&p){const t=(0,r.NM)({block:m,property:n,formulaCode:p,getRecordModel:e.getRecordModel,intl:h.default.getIntl(),userTimeZone:(0,s.r)(),depth:0,visitedProperties:new Set,formulaTimeoutTimestampMs:Date.now()+f,resultCache:new Map});if(t&&d.x.isSuccess(t))return(0,a.j4)(t.value)}return[]}(e,w,T)),"text"===D){const n={startIndex:0,endIndex:(0,c.eeV)(R).length};m.WO({environment:t,store:e,selection:n,annotation:[c.GKr.Discussion,M],transaction:I})}}let U;const V=w.getType(),N=w.getFormat();if((0,o.XD)(V,N)&&!(0,o.S9)(V)){const e=w.getTitleValue();U=c.O1u(c.V3g(e,{removeSuggestionAnnotationsAndText:!0,removeSuggestionAnnotations:!0,removeDiscussions:!0}))}T&&R&&(U=R);const{discussionStore:O,commentStore:L}=(0,_.c)({createDiscussionArgs:"default"===n?{type:"default",context:U,property_id:T}:{type:"suggestion",modifiedBlockIds:[w.pointer.id]},blockStore:w,environment:t,transaction:I,commentTextValue:x,files:g.dm(C),discussionId:M});return(0,b.t)({transaction:I,blockStore:w,discussionId:O.id}),p.bR(t,{discussion_id:O.id,discussion_type:O.getType(),comment_id:L.id,parent_block_id:O.getParentId(),from:y.Z.state.open?void 0:y.Z.state.from,property_id:T,property_type:D,collection_view_id:E,view_type:F,collection_id:B,collection_view_block_id:Z}),(0,S.C)(t),O}},934959:(e,t,n)=>{n.d(t,{l:()=>a});var o=n(701302),r=n(524677),i=n(898104);async function a(e){const{discussionInputStore:t,environment:n}=e;await o.default.afterNextFlush(),r.ZH({preventDismissMobileKeyboard:!0,environment:n}),i.setSelectionAtEnd({store:t.state.textStore})}},169296:(e,t,n)=>{n.d(t,{o:()=>i});var o=n(180951),r=n(110906);function i(e,t){if(!t)return{property_type:void 0,collection_id:void 0,collection_view_id:void 0,view_type:void 0,collection_view_block_id:void 0};let n,i,a,s,l;const c=t.getAssociatedCollectionStore();if(c){var d,u;if(e){const t=(0,o.Qm)({schema:c.getSchema(),property:e});n=null==t?void 0:t.type}i=c.id,l=null===(d=c.getParentBlockStore())||void 0===d?void 0:d.id;const p=null===(u=(0,r.fm)(t))||void 0===u?void 0:u.collectionViewStore();p?(a=null==p?void 0:p.id,s=null==p?void 0:p.getType()):s="page"}return{property_type:n,collection_id:i,collection_view_id:a,view_type:s,collection_view_block_id:l}}},959151:(e,t,n)=>{n.d(t,{jl:()=>f,uK:()=>g});var o=n(709291),r=n(401898),i=n(585344),a=n(547307),s=n(433929),l=n(80444),c=n(385555),d=n(948514),u=n(380351),p=n(736974);const m=(0,o.defineMessages)({discardCommentConfirmationPrompt:{id:"newDiscussionMenu.discardCommentConfirmationDialog.prompt",defaultMessage:"Do you want to discard the comment?"},discardCommentButtonLabel:{id:"newDiscussionMenu.discardCommentConfirmationDialog.discardButton.label",defaultMessage:"Discard"},draftCommentConfirmationPromptTitle:{id:"newDiscussionMenu.draftCommentConfirmationDialogTitle.prompt",defaultMessage:"Finish your draft comment?"},draftCommentConfirmationStartingNewDescription:{id:"newDiscussionMenu.draftCommentConfirmationStartingNewDescription.prompt",defaultMessage:"You have a draft comment that will be lost if you start a new one"},draftCommentConfirmationNavigateAwayPromptDescription:{id:"newDiscussionMenu.draftCommentConfirmationNavigateAwayPromptDescription.prompt",defaultMessage:"You have a draft comment that will be lost if you leave the page"},returnToPageButtonLabel:{id:"newDiscussionMenu.discardCommentConfirmationDialog.returnToPage.label",defaultMessage:"Return to draft"}});function g(e){const{discussionInputStore:t,environment:n,discussionHelpers:o,reason:r}=e;"on"===c.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0})&&d.Z.isComposingNewDiscussion()?f({environment:n,reason:r??"navigating_away"}):o.hasCommentChanged(t)?(i.lL(n),a.showDialog({message:s.default.formatMessage(m.discardCommentConfirmationPrompt),showCancel:!0,handleCancel:()=>i.jX(n),keepFocus:!0,items:[{label:s.default.formatMessage(m.discardCommentButtonLabel),color:"red",onAccept:()=>{i.Yz(n),(0,u.C)(n)}}]})):(0,u.C)(n)}function f(e){const{environment:t}=e;if(!d.Z.isDraftCommentOnValidSelection())return;const n=d.Z.getDiscussionInputStore();i.lL(t),a.showDialog({message:s.default.formatMessage(m.draftCommentConfirmationPromptTitle),description:(()=>{switch(e.reason){case"starting_new":return s.default.formatMessage(m.draftCommentConfirmationStartingNewDescription);case"navigating_away":return s.default.formatMessage(m.draftCommentConfirmationNavigateAwayPromptDescription);default:(0,r.t1)(e.reason)}})(),keepFocus:!0,innerStyle:{textAlign:"center"},showCancel:!1,shouldRenderDraftCommentIcon:!0,messageStyle:{fontWeight:600},items:[{label:s.default.formatMessage(m.returnToPageButtonLabel),buttonType:"solid",color:"blue",onAccept:()=>{(0,p.U)({currentBlockStore:l.default.state.mainEditorCurrentBlockStore,discussionInputStore:n,environment:t,allowActionsWhileCommenting:!0}),i.jX(t)}},{label:s.default.formatMessage(m.discardCommentButtonLabel),color:"gray",buttonType:"plain",onAccept:()=>{i.Yz(t),(0,u.C)(t)}}]})}},171728:(e,t,n)=>{n.d(t,{Bf:()=>N,Dc:()=>L,Qu:()=>j,WD:()=>O,sY:()=>V});n(757658);var o=n(541432),r=n(421202),i=n(933709),a=n(23867),s=n(519889),l=n(421838),c=n(709291),d=n(585344),u=n(554564),p=n(627153),m=n(709953),g=n(756863),f=n(666771),h=n(210228),v=n(977357),y=n(938530),b=n(741195),_=n(433929),S=n(745162),k=n(645010),w=n(389224),x=n(524229),I=n(385555),C=n(206258),T=n(182994),M=n(947002),P=n(948514),A=n(584370),R=n(346420),D=n(521899),B=n(380351),E=n(859134),F=n(934959),Z=n(169296),U=n(959151);const V=(0,c.defineMessages)({emojiPicker:{defaultMessage:"Reaction",id:"ReactionBar.emojiModalMenu.title"},emojiTitle:{id:"recordIcon.emojiTab.title",defaultMessage:"Emojis"}});function N(e){const{environment:t,blockStore:n,multiSelection:o,rect:r}=e;let i=r;if(!i){const e=w.get();if(!e)return;i=w.getRect(e)}if(!i)return;const a=i.width,s=i.height,l=i.right-a;P.Z.setState({open:!0,rect:new DOMRect(l,i.top,a,s),type:"inline",content:"reaction",blockStore:n,blockId:n.id,multiSelection:o,emoji:void 0}),p.$(t,{originGap:4,originRect:i,popupWidth:y.FZ,popupHeight:y.kX,isSmallWidth:!1,title:_.default.formatMessage(V.emojiPicker),currentTab:"emoji",onCancel:()=>P.Z.reset(),tabs:[{type:"emoji",title:_.default.formatMessage(V.emojiTitle),hideRandomButton:!0,onChange:e=>{const n=P.Z.state;n.open&&"reaction"===n.content&&(P.Z.setState({...n,emoji:e}),L(t),p.Z())}}]})}async function O(e){const{environment:t,blockStore:n,multiSelection:o,rect:r,from:i,property_id:s}=e,l="on"===I.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control"});if(l&&P.Z.hasContent())return void(0,U.jl)({environment:t,reason:"starting_new"});let c=r;if(!c){const e=w.get();if(!e)return;c=w.getRect(e)}if(!c)return;const u=c.width,p=c.height,m=c.right-u,f=new T.Z(t,(0,a.C)(n.pointer.spaceId));var h;(P.Z.setState({open:!0,rect:new DOMRect(m,c.top,u,p),type:"inline",content:"comment",blockStore:n,lastKnownBlockStore:n,blockId:n.id,multiSelection:o,lastEditables:(0,S.L5)(o),discussionInputStore:f,property_id:s,from:i}),l)&&(null===(h=k.Z.UpdateSidebarCommentScroller)||void 0===h||h.scrollToTop({animate:!0}),M.Z.setActiveWithSource("text_annotation"));g.w(),await(0,F.l)({discussionInputStore:f,environment:t,allowActionsWhileCommenting:l}),d.$5(t,{from:i})}function L(e,t){const n=P.Z.state;if(n.open){const c="comment"===n.content?n.property_id:void 0,p=P.Z.getBlockStore()??P.Z.getLastKnownBlockStore();if(P.Z.hasContent()&&(!t||t&&p))if("inline"===n.type)h.createAndCommit({userAction:"newDiscussionMenuActions.submitNewDiscussion",environment:e,perform:u=>{const g=function(e){const{environment:t,multiSelection:n,transaction:a,allowActionsWhileCommenting:s}=e,{id:c}=t.currentUser;if(!c)return;const d=s?P.Z.getLastSelectedEditables():(0,S.L5)(n).filter((e=>{let{store:t}=e;return t.table===r.iU}));if(!d||0===d.length)return;const u=d[0].store.getRecordStoreAtRootPath(),p=(0,b.TS)({environment:t,table:i.qF,spaceId:u.pointer.spaceId}),m=[],g=new Set;d.forEach(((e,n)=>{let{store:r,selection:i}=e;g.add(r.id);const s=r.getRecordStoreAtRootPath();if(!(s instanceof C.G))return;const c=s.getType(),d=s.getFormat();if(c&&(0,o._T)(c,d))return;let u=r.getValue();const h=l.Ulv(u,i);f.WO({environment:t,store:r,selection:h,annotation:[l.GKr.Discussion,p],transaction:a}),u=r.getValue();const v=l.KU1(u,h.startIndex,h.endIndex),y=0===n?[]:[l.V3y("\n")];m.push(...y,...v)}));const h=(0,S.tp)({multiSelection:n,filterCommonAncestors:!1,focus:void 0});if(h)for(const r of h.stores){if(g.has(r.id))continue;const e=r.getType(),t=r.getFormat();e&&(0,o._T)(e,t)||(0,A.t)({blockStore:r,discussionId:p,transaction:a})}return{blockStore:u,context:m,discussionId:p}}({environment:e,multiSelection:n.multiSelection,transaction:u,allowActionsWhileCommenting:t});if(!g)return;const{context:h,blockStore:y,discussionId:_}=g;if("comment"===n.content){const o=n.discussionInputStore.state.textStore.getValue()||[],r=n.discussionInputStore.state.files,{discussionStore:i,commentStore:a}=(0,R.c)({createDiscussionArgs:{type:"default",context:h,property_id:c},blockStore:y,environment:e,transaction:u,commentTextValue:o,files:v.dm(r),discussionId:_}),{property_type:s,collection_id:l,collection_view_id:m,view_type:g,collection_view_block_id:f}=(0,Z.o)(c,p);d.x6(e,{discussion_id:i.id,discussion_type:i.getType(),comment_id:a.id,parent_block_id:i.getParentId(),from:P.Z.state.open&&"comment"===P.Z.state.content?P.Z.state.from:void 0,property_id:c,property_type:s,collection_view_id:m,view_type:g,collection_id:l,collection_view_block_id:f}),t&&x.Z.addNewDiscussionId(_)}else n.emoji&&function(e){const{context:t,blockStore:n,environment:o,transaction:r,icon:l}=e,c=e.discussionId??(0,b.TS)({environment:o,table:i.qF,spaceId:n.pointer.spaceId});if(void 0===o.currentUser.id)return;const d=m.ae({environment:o,table:"discussion",value:{type:"default",id:c,parent_id:n.id,parent_table:n.table,resolved:!1,context:t,space_id:(0,a.C)(n.pointer.spaceId)},inMemoryRecordCache:n.inMemoryRecordCache,transaction:r});(0,A.t)({transaction:r,blockStore:n,discussionId:d.id});const u={table:s.KJ,id:o.currentUser.id};D.createReaction({environment:o,transaction:r,store:d,icon:l,currentActorPointer:u,discussionLocation:"block_menu"})}({context:h,blockStore:y,environment:e,transaction:u,icon:n.emoji,discussionId:_})},skipUpdatingEditedMetadata:!0});else if("block"===n.type&&"comment"===n.content){const o=n.discussionInputStore.state.textStore.getValue()||[],r=n.discussionInputStore.state.files;t?p&&h.createAndCommit({userAction:"newDiscussionMenuActions.submitNewDiscussion",environment:e,perform:t=>{(0,E.i)({environment:e,type:"default",blockStore:p,commentTextValue:o||[],files:r,transaction:t,property_id:c})},skipUpdatingEditedMetadata:!0}):h.createAndCommit({userAction:"newDiscussionMenuActions.submitNewDiscussion",environment:e,perform:t=>{(0,E.i)({environment:e,type:"default",blockStore:n.blockStore,commentTextValue:o||[],files:r,transaction:t,property_id:c})},skipUpdatingEditedMetadata:!0})}(0,B.C)(e);const g=t?p&&p.getAssociatedCollectionStore():n.blockStore.getAssociatedCollectionStore();!c&&g&&u.Ib({environment:e,blockStore:t?p??n.blockStore:n.blockStore,shouldFocusDiscussion:!0,analyticsFrom:"db_page_comments",rect:P.Z.state.rect,recursivelyLoadAllDiscussions:!1})}}function j(e){const{environment:t}=e;if(!t.currentUser.id)return;const n=P.Z.getPropertyId();if(n){var r;const e=null===(r=P.Z.getBlockStore())||void 0===r?void 0:r.getPropertyStore(n);if(e)return{blockStore:e,context:e.getValue()}}const i=P.Z.getLastSelectedEditables();if(!i||0===i.length)return;const a=i[0].store.getRecordStoreAtRootPath(),s=[],c=new Set;return i.forEach(((e,t)=>{let{store:n,selection:r}=e;c.add(n.id);const i=n.getRecordStoreAtRootPath();if(!(i instanceof C.G))return;const a=i.getType(),d=i.getFormat();if(a&&(0,o._T)(a,d))return;const u=n.getValue(),p=l.Ulv(u,r),m=l.KU1(u,p.startIndex,p.endIndex),g=0===t?[]:[l.V3y("\n")];s.push(...g,...m)})),{blockStore:a,context:s}}},398740:(e,t,n)=>{n.d(t,{y:()=>m});var o=n(23867),r=n(585344),i=n(645010),a=n(58202),s=n(385555),l=n(182994),c=n(947002),d=n(948514),u=n(934959),p=n(959151);async function m(e){const{environment:t,blockStore:n,rect:m,property_id:g,from:f}=e,h="on"===s.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control"});if(h&&d.Z.hasContent())return void(0,p.jl)({environment:t,reason:"starting_new"});const v=a.R.getRect(n);if(!v)return;const y=new l.Z(t,(0,o.C)(n.pointer.spaceId)),b=v.width,_=v.height,S=v.right-b;var k;(d.Z.setState({open:!0,rect:m||new DOMRect(S,v.top,b,_),type:"block",content:"comment",blockStore:n,blockId:n.id,discussionInputStore:y,property_id:g,lastKnownBlockStore:n,from:f}),h)&&(null===(k=i.Z.UpdateSidebarCommentScroller)||void 0===k||k.scrollToTop({animate:!0}),c.Z.setActiveWithSource("text_annotation"));await(0,u.l)({discussionInputStore:y,environment:t,allowActionsWhileCommenting:h}),r.yr(t,{from:f})}},736974:(e,t,n)=>{n.d(t,{U:()=>h,m:()=>f});var o=n(701302),r=n(761045),i=n(303898),a=n(843250),s=n(177546),l=n(700933),c=n(95802),d=n(224646),u=n(607709),p=n(947002),m=n(948514),g=n(934959);function f(e){let{animate:t}=e;const n=l.Z.filter((()=>!0));if(n&&n.length>0){const e=n[0].getNode();if(e&&e.parentElement){const n=Array.from(e.parentElement.children).indexOf(e);s.Wr(e,{edgeDist:0===n?0:-1,animate:t??!1})}}}async function h(e){let{currentBlockStore:t,discussionInputStore:n,environment:s,allowActionsWhileCommenting:l,dontAffectCursor:f,animateScroll:h}=e;if(!n||!t)return;function v(e){const t=function(e){var t;let n,{blockId:o}=e;const r=null===(t=document.getElementsByClassName(a.dXl))||void 0===t?void 0:t[0];r&&(n=c.C.findSelectableFromChildNode(r)),n||(n=c.C.findScrollToSelectablesFromIds([o])[0]);return n}({blockId:e});if(!t)return;const n=document.getElementsByClassName(a.dXl)[0];return n?r.bx({element:n,scrollers:{verticalScroller:t.getContextVerticalScroller(),horizontalScroller:t.getContextHorizontalScroller()},vertical:{reveal:"top"},horizontal:{reveal:"closest"},animate:h??!1,centerVertically:!0}):r.XW({handle:t,vertical:{reveal:"top"},horizontal:{reveal:"closest"},animate:h??!1}),t.displaySelectionHalo(750),t}const y=m.Z.state.open?m.Z.state.blockId:null;if(!y)return;v(y)||(await i.Nz(t,[y]),await o.default.afterNextFlush(),v(y));const b=m.Z.getBlockStore();b&&(0,u.az)(s,b)?p.Z.setActiveWithSource("margin_comments"):(0,d.vK)(s)?p.Z.setActiveWithSource("comments_pane"):p.Z.setActiveWithSource("popover_comments"),f||(0,g.l)({discussionInputStore:n,environment:s,allowActionsWhileCommenting:l})}},521899:(e,t,n)=>{n.r(t),n.d(t,{createReaction:()=>b,toggleReaction:()=>y});var o=n(845369),r=n(933709),i=n(480396),a=n(23867),s=n(519889),l=n(401898),c=n(585344),d=n(594419),u=n(709953),p=n(210228),m=n(741195),g=n(206258),f=n(304761),h=n(855661),v=n(169296);function y(e){const{discussionLocation:t,environment:n,transaction:d,store:u,icon:m}=e,v=function(e){let{store:t,icon:n}=e;const o=(0,g.Vh)(t,t.pointer,"reactions").getValue();if(void 0===o)return;return o.map((e=>{const n=g.t1.createChildStore(t,{table:i.yo,id:e,spaceId:(0,a.C)(t.pointer.spaceId)});if(n.isDefined())return n})).filter(l.$K).find((e=>e.getIcon()===n))}({store:u,icon:m});if(void 0===n.currentUser.id)return;const y={table:s.KJ,id:n.currentUser.id};return null!=v&&v.isDefined()?function(e){var t;let{store:n,actorPointer:i,transaction:a,environment:s,discussionLocation:l}=e;const d={store:n,actorPointer:i,transaction:a,environment:s,discussionLocation:l},u=(null===(t=n.getActors())||void 0===t?void 0:t.some((e=>e.id===i.id)))??!1;return u?(function(e){var t,n;const{store:i,actorPointer:a,discussionLocation:s,transaction:l,environment:d}=e;if(!i.isDefined())return;const u=i.getParentStore(),m=(null==u?void 0:u.table)===r.qF?u:null==u?void 0:u.getParentStore(),v=o.B7.includes(s),y=null==m||null===(t=m.getParentStore())||void 0===t?void 0:t.getNavigableBlockStore(),b=1===g.bh.getUserVisibleReactions(u).length&&1===i.getActors().length&&i.getActors()[0].id===d.currentUser.id;c.Em({environment:d,reaction_value:i.getIcon(),comment_id:i.getParentId(),discussion_id:null==m?void 0:m.id,discussion_type:null==m?void 0:m.getType(),parent_block_id:null==m?void 0:m.getParentId(),parent_collection_id:null==m||null===(n=m.getParentStore())||void 0===n?void 0:n.getParentCollectionIdUpToTwoLevels(),reaction_count:i.getActors().length??0,from:s,...v&&{inbox_session_id:f.ZP.state.sessionId,notification_page_id:null==y?void 0:y.id}});const _=i.getModel();p.applyOperation({transaction:l,store:i,operation:_.ops.removeActor(a)}),b&&u&&u.table===r.qF&&(0,h.d)({environment:d,discussionStore:u,transaction:l})}(d),"Removed"):(function(e){var t,n;const{store:i,actorPointer:a,discussionLocation:s,transaction:l,environment:d}=e;if(!i.isDefined())return;const u=i.getParentStore(),m=(null==u?void 0:u.table)===r.qF?u:null==u?void 0:u.getParentStore(),g=o.B7.includes(s),h=null==m||null===(t=m.getParentStore())||void 0===t?void 0:t.getNavigableBlockStore();c.pP({environment:d,reaction_value:i.getIcon(),comment_id:i.getParentId(),discussion_id:null==m?void 0:m.id,discussion_type:null==m?void 0:m.getType(),parent_block_id:null==m?void 0:m.getParentId(),parent_collection_id:null==m||null===(n=m.getParentStore())||void 0===n?void 0:n.getParentCollectionIdUpToTwoLevels(),reaction_count:i.getActors().length??0,from:s,...g&&{inbox_session_id:f.ZP.state.sessionId,notification_page_id:null==h?void 0:h.id}});const v=i.getModel();p.applyOperation({transaction:l,store:i,operation:v.ops.appendActor(a)})}(d),"Added")}({environment:n,store:v,actorPointer:y,transaction:d,discussionLocation:t}):(b({environment:n,transaction:d,store:u,icon:m,currentActorPointer:y,discussionLocation:t}),"Added")}function b(e){var t,n;let{environment:s,transaction:l,store:p,icon:h,currentActorPointer:y,discussionLocation:b}=e;const _=(0,m.$x)({environment:s,table:i.yo,spaceId:(0,a.C)(p.pointer.spaceId)}),S=p.table===r.qF?p:p.getParentStore(),k=o.B7.includes(b),w=null==S||null===(t=S.getParentStore())||void 0===t?void 0:t.getNavigableBlockStore(),x=null==S?void 0:S.getPropertyId(),I=null==S?void 0:S.getParentStore(),{property_type:C,collection_id:T,collection_view_id:M,view_type:P,collection_view_block_id:A}=(0,v.o)(x,I);c.pP({environment:s,reaction_value:h,comment_id:p.id,discussion_id:null==S?void 0:S.id,discussion_type:null==S?void 0:S.getType(),parent_block_id:null==S?void 0:S.getParentId(),parent_collection_id:null==S||null===(n=S.getParentStore())||void 0===n?void 0:n.getParentCollectionIdUpToTwoLevels(),reaction_count:0,from:b,...k&&{inbox_session_id:f.ZP.state.sessionId,notification_page_id:null==w?void 0:w.id},property_type:C,collection_id:T,collection_view_id:M,view_type:P,collection_view_block_id:A});const R=u.Ue({environment:s,table:_.table,args:{id:_.id,spaceId:_.spaceId,commentId:p.id,icon:h,actorPointer:y},inMemoryRecordCache:p.inMemoryRecordCache,transaction:l}),D=(0,g.Vh)(p,p.pointer,"reactions");d.R3({parentStore:D,appendStore:R,transaction:l})}},95306:(e,t,n)=>{n.d(t,{Cd:()=>m,UZ:()=>p,oK:()=>u});var o=n(701302),r=n(23867),i=n(937850),a=n(585344),s=n(524677),l=n(898104),c=n(182994),d=n(209080);async function u(e){const{environment:t,discussionStore:n,rect:u,blockStore:p,discussionLocation:m,activityId:g,notificationId:f}=e,h=new c.Z(t,(0,r.C)(p.pointer.spaceId));d.Z.setState({open:!0,rect:u,discussionStore:n,discussionInputStore:h,blockStore:p,discussionLocation:m,activityId:g,notificationId:f}),s.ZH({preventDismissMobileKeyboard:!0,environment:t}),await o.default.afterNextFlush(),await(0,i.Vs)(10),l.setSelectionAtEnd({store:h.state.textStore}),a.Je({environment:t,from:m,activityId:g,notificationId:f})}function p(e){const t=d.Z.state;if(t.open){const{discussionLocation:n,activityId:o,notificationId:r}=t;d.Z.setState({open:!1,rect:t.rect}),s.ZH({environment:e}),a.Rn({environment:e,from:n,activityId:o,notificationId:r})}}function m(e){const t=d.Z.state;if(t.open){0===t.discussionStore.getComments().length&&p(e)}}},601600:(e,t,n)=>{n.d(t,{DH:()=>$,JK:()=>q,LC:()=>H,N$:()=>G,P5:()=>Y,Sz:()=>re,Yo:()=>j,_T:()=>ie,iT:()=>ae,n1:()=>ee,oG:()=>ne,vh:()=>Q});n(757658);var o=n(840376),r=n(541432),i=n(159730),a=n(471924),s=n(421202),l=n(933709),c=n(23867),d=n(519889),u=n(456452),p=n(421838),m=n(182798),g=n(653965),f=n(401898),h=n(585344),v=n(65028),y=n(554564),b=n(594419),_=n(709953),S=n(311712),k=n(800993),w=n(56971),x=n(210228),I=n(451165),C=n(100754),T=n(741195),M=n(745162),P=n(798165),A=n(669645),R=n(273959),D=n(489086),B=n(80444),E=n(400807),F=n(206258),Z=n(607709),U=n(584370),V=n(346420),N=n(5779),O=n(199953),L=n(859134);function j(e){const{action:t,environment:n,commentStore:o,discussionStore:r,transaction:s,discussionLocation:l,currentPageStore:c}=e;if(!c)throw new i.p8("Expected current page store to be defined");const u=r.getSuggestModifiedBlockStores()??[],{currentUserStore:f}=B.default.state;if(!f)throw new i.p8("Expected current user store to be defined");const h=u.filter((e=>{const t=P.fM(e);return c.id===(null==t?void 0:t.id)}));if(h.length!==u.length)return void function(e){const{action:t,blockStoresInPage:n,discussionStore:o,transaction:r,environment:s,discussionLocation:l,currentPageStore:c}=e,d=o.getParentStore();if(!d)throw new i.p8("Suggestion should have parent block store");const u=o.getRawContextStore(),f=u.getValue(),h=n.map((e=>e.id));_.sO({store:u,value:{...f,modifiedBlockIds:g.zu(o.getSuggestModifiedBlockIds(),...h),resolvedBlockIds:h},transaction:r});const{discussionStore:v,commentStore:y}=W({environment:s,transaction:r,blockStore:d,modifiedBlockIds:h,splitFrom:o.id,skipAnnotatingTransaction:!0});(function(e){const{environment:t,blockStores:n,oldDiscussionStore:o,newDiscussionStore:r,transaction:i}=e;n.forEach((n=>{(0,N.Z)({transaction:i,blockStore:n,discussionIds:[o.id]}),(0,U.t)({transaction:i,blockStore:n,discussionId:r.id});const s=X(n,o.id);s&&(te({environment:t,transaction:i,blockStore:n,blockSuggestionId:s.id,removeDiscussionId:{discussionId:s.discussionId}}),Q({environment:t,transaction:i,discussionStore:o}),ee(i,n,{id:a.Il(),type:s.type,discussionId:r.id})),function(e){const{blockStore:t,oldDiscussionStore:n,newDiscussionStore:o,transaction:r,environment:i}=e,a=(0,m.TO)(t.getTitleStore()),s=t.getTitleValue();for(let l=0;l<s.length;l++){const e=p.hDy(s[l]);for(const t of e)if(p.BIG(t)&&p.fgJ(t)===n.id){const e=(0,m.TO)(D.Ts(s,l)),n=p.c1u(t,o.id);k.yJ({selection:e,titleStore:a,environment:i,transaction:r,annotationKeysToRemove:[p.c14(t)],annotationsToAdd:[n]})}}}({...e,blockStore:n})}))})({blockStores:n,oldDiscussionStore:o,newDiscussionStore:v,transaction:r,environment:s}),j({action:t,environment:s,commentStore:y,discussionStore:v,transaction:r,discussionLocation:l,currentPageStore:c})}({action:t,discussionLocation:l,blockStoresInPage:h,discussionStore:r,transaction:s,environment:n,currentPageStore:c});(0,O.D)({environment:n,commentStore:o,discussionStore:r,transaction:s,discussionLocation:l,resolutionType:t}),function(e){const{blockStores:t,discussionStore:n,environment:o,transaction:r,action:i}=e;for(const a of t){const e=X(a,n.id);if(e&&(te({environment:o,transaction:r,blockStore:a,blockSuggestionId:e.id}),("reject"===i&&"insert"===e.type||"accept"===i&&"remove"===e.type)&&S.Cl({environment:o,blocks:[a],transaction:r}),"reject"===i&&"add_line_break"===e.type||"accept"===i&&"remove_line_break"===e.type)){const e=(0,m.TO)(a.getTitleStore()),t=(0,C.z)(e),n=t?(0,R.sQ)(t):void 0;if(t&&n){w.We({environment:o,transaction:r,store:t,block:n,targetStore:e,targetBlock:a});const i=n.getContentStores(),s=(0,m.TO)((0,R.sQ)(a));for(const e of i)b.Vt({parentStore:s.getContentStore(),beforeStore:n,insertStore:e,transaction:r}),b.Od({parentStore:n.getContentStore(),childToRemoveStore:e,transaction:r});S.Cl({environment:o,transaction:r,blocks:[n]})}}}}({environment:n,transaction:s,blockStores:u,discussionStore:r,action:t});for(const a of u){if(a.isType("table_row")){var v;const e=(null===(v=a.getParentBlockStore())||void 0===v?void 0:v.getFormat().table_block_column_order)??[];for(const o of e){K({environment:n,transaction:s,discussionStore:r,titleStore:a.getPropertyStore(o),action:t})}}else{const e=a.getTitleStore(),o=a.getCaptionStore();if(!e&&!o)throw new i.p8("Could not get title store or caption store for block");e&&K({environment:n,transaction:s,discussionStore:r,titleStore:e,action:t}),o&&K({environment:n,transaction:s,discussionStore:r,titleStore:o,action:t})}(0,U.t)({transaction:s,blockStore:a,discussionId:r.id})}const y=(0,m.TO)(r.getSuggestionRawContextStore());_.sW({store:y,data:{rejected:"reject"===t,resolvedBy:{id:f.id,table:d.KJ}},transaction:s})}function K(e){const{environment:t,transaction:n,discussionStore:o,titleStore:r,action:a}=e,s=r.getValue();if(s)for(let l=s.length-1;l>=0;l--){const e=p.hDy(s[l]);for(const c of e)if(p.BIG(c)&&p.fgJ(c)===o.id){const e=D.Ts(s,l);if(!e)throw new i.p8("Could not generate selection for token");z({annotation:c,action:a,selection:e,environment:t,transaction:n,titleStore:r})}}}function z(e){const{annotation:t,action:n,selection:o,environment:r,transaction:i,titleStore:a}=e;if("accept"===n)if(p.pGj(t)){const e=p.c14(t);k.yJ({selection:o,titleStore:a,annotationKeysToRemove:[e],environment:r,transaction:i})}else if(p.$b8(t))k.pe({environment:r,store:a,selection:o,transaction:i});else if(p.u2m(t)||p.Jeu(t)){const e=p.EpE(t);p.u2m(t)?k.yJ({selection:o,titleStore:a,annotationsToAdd:[e],annotationKeysToRemove:[p.c14(t)],environment:r,transaction:i}):k.yJ({selection:o,titleStore:a,annotationKeysToRemove:[p.c14(e),p.c14(t)],environment:r,transaction:i})}else(0,f.t1)(t);else if("reject"===n)if(p.$b8(t)||p.u2m(t)||p.Jeu(t)){const e=p.c14(t);k.yJ({selection:o,titleStore:a,annotationKeysToRemove:[e],environment:r,transaction:i})}else p.pGj(t)?k.pe({environment:r,store:a,selection:o,transaction:i}):(0,f.t1)(t);else(0,f.t1)(n)}function q(e){const{environment:t,transaction:n,blockStore:o,type:r,removeDiscussionId:i}=e;let a;"add_line_break"===r?a=o.getAddLineBreakSuggestion():"remove_line_break"===r?a=o.getRemoveLineBreakSuggestion():"insert"===r?a=o.getInsertSuggestion():"remove"===r?a=o.getRemoveSuggestion():(0,f.t1)(r),a&&te({environment:t,transaction:n,blockStore:o,blockSuggestionId:a.id,removeDiscussionId:i?{discussionId:a.discussionId}:void 0})}function H(e){const{environment:t,transaction:n,blockStores:o}=e;if(0===o.length)return;const r=(0,L.i)({environment:t,blockStore:o[0],commentTextValue:[[""]],transaction:n,files:[],type:"suggestion"});if(!r)throw new i.p8("Discussion must be created when creating a block with suggestion");return o.forEach((e=>{ee(n,e,{id:a.Il(),type:"remove",discussionId:r.id}),Q({environment:t,transaction:n,discussionStore:r,addModifiedBlockIdsAfter:[e.id]})})),r}function G(e){const{environment:t,transaction:n,blockStore:o,type:r,createDiscussionStore:s}=e;if(o.getAddLineBreakSuggestion()||o.getRemoveLineBreakSuggestion())return;const l=s();if(ee(n,o,{id:a.Il(),type:r,discussionId:l.id}),!l)throw new i.p8("Discussion must be created when creating a block with suggestion");return Q({environment:t,transaction:n,discussionStore:l,addModifiedBlockIdsAfter:[o.id]}),l}function W(e){var t;const{environment:n,transaction:o,blockStore:r,modifiedBlockIds:a,splitFrom:s,skipAnnotatingTransaction:c}=e;if(!c&&o.getSuggestionDiscussionStore())throw new i.p8("Calling createSuggestionDiscussion when already have a suggestion discussion store in the transaction.");const d={createDiscussionArgs:{type:"suggestion",modifiedBlockIds:a,splitFrom:s},blockStore:r,environment:n,transaction:o,commentTextValue:[[""]],files:[],discussionId:(0,T.TS)({environment:n,table:l.qF,spaceId:r.pointer.spaceId})},u=(0,V.c)(d);return c||o.annotationWithSuggestionDiscussionStore(u.discussionStore),h.x6(n,{comment_id:u.commentStore.id,discussion_id:u.discussionStore.id,discussion_type:"suggestion",parent_block_id:u.discussionStore.getParentId(),parent_collection_id:null===(t=u.discussionStore.getParentStore())||void 0===t?void 0:t.getParentCollectionIdUpToTwoLevels()}),u}function $(e){return(0,R.sQ)(e.start.store)}function Y(e,t){const n=(0,R.sQ)(e.start.store);if(n)return F.t1.createChildStore(n,{table:l.qF,id:t,spaceId:(0,c.C)(n.pointer.spaceId)})}function Q(e){var t,n;const{environment:o,transaction:r,discussionStore:a,addModifiedBlockIdsBefore:s=[],addModifiedBlockIdsAfter:l=[],removeModifiedBlockIds:c=[],addModifiedBlockIdsAfterAnchor:d}=e;if("suggestion"!==a.getType())throw new i.p8("This fn only used for suggestion");const p=a.getContext(),f=(0,m.TO)(a.getSuggestionRawContextStore());if(s.length>0||l.length>0||c.length>0){const e=a.getSuggestModifiedBlockIds()??[],t=g.zu(s,...e),n=g.zu(l,...e),{first:o,second:i}=(0,u.gb)(e,d),p=[...t,...o,...n,...i].filter((e=>!c.includes(e)));_.sW({store:f,data:{modifiedBlockIds:p},transaction:r})}let h;const y=a.getSuggestModifiedBlockStores()??[];if(0===y.length)h=void 0;else{const e=y[0],t=P.fM(e);h=t?E.Z.getSessionId(t):void 0}h&&(null===(t=f.getValue())||void 0===t?void 0:t.latestSessionId)!==h&&_.sW({store:f,data:{latestSessionId:h},transaction:r});const b=a.getSuggestionSnapshotStore();if(!b)throw new i.p8("Suggestion discussion snapshot store required to update context");const S=null===(n=a.getModel())||void 0===n?void 0:n.getLiveContext(a.getRecordModel);S&&_.sW({store:b,data:{data:S},transaction:r}),p&&p.length>0?v.Kx({environment:o,suggesting_session_id:h,discussion_id:a.id,suggestion_types:J(a),target_block_id:a.getParentId()}):v.eO({environment:o,suggesting_session_id:h,discussion_id:a.id,suggestion_types:J(a),target_block_id:a.getParentId()})}function J(e){const t=e.getContext();if(!t)return[];const n=e.id,o=new Set;for(const r of t)if("textValue"===r.type){const e=r.value.flatMap((e=>p.hDy(e))).filter((e=>p.BIG(e)&&p.fgJ(e)===n));let t=!1,i=!1;for(const n of e)n[0]===p.GKr.SuggestionInsertText?t=!0:n[0]===p.GKr.SuggestionRemoveText?i=!0:n[0]===p.GKr.SuggestionAnnotate?o.add("add_annotation"):n[0]===p.GKr.SuggestionUnannotate&&o.add("remove_annotation");t&&i?o.add("replace_text"):(t&&o.add("add_text"),i&&o.add("remove_text"))}else if("blockSuggestion"===r.type){const e=r.value.type;switch(e){case"insert":o.add("add_block");break;case"remove":o.add("remove_block");break;case"remove_line_break":o.add("remove_line_break");break;case"add_line_break":o.add("add_line_break");break;default:(0,f.t1)(e)}}else(0,f.t1)(r);return Array.from(o)}function X(e,t){const n=e.getSuggestionsStore().getValue();return null==n?void 0:n.find((e=>e.discussionId===t))}function ee(e,t,n){const o=t.getFormatStore().getKeyStore("suggestions");x.applyOperation({store:t,operation:{pointer:o.pointer,command:"keyedObjectListAfter",path:o.path,args:{value:n}},transaction:e}),(0,U.t)({transaction:e,blockStore:t,discussionId:n.discussionId})}function te(e){const{transaction:t,blockStore:n,blockSuggestionId:o,removeDiscussionId:r}=e,i=n.getFormatStore().getKeyStore("suggestions");x.applyOperation({store:n,operation:{pointer:i.pointer,command:"keyedObjectListRemove",path:i.path,args:{remove:{id:o}}},transaction:t}),r&&(0,N.Z)({transaction:t,blockStore:n,discussionIds:[r.discussionId]})}function ne(e,t,n,o,r){const{discussionStore:a,blockStore:s}=function(e,t,n,o,r){let a;if(n instanceof F.G)a=n;else{const e=n.start.store.getAncestorRecordStoreAtRootPath();if(!(e&&e instanceof F.G))throw new i.p8("Cannot create a suggestion on a RecordStore that's not a block.");a=e}const s=t.getSuggestionDiscussionStore();if(s)return{discussionStore:s,blockStore:a};const d=a.getInsertSuggestion();if(d){const n=F.t1.createChildStore(a,{table:l.qF,id:d.discussionId,spaceId:(0,c.C)(a.pointer.spaceId)});if((0,I.Ld)(n,e.currentUser))return t.annotationWithSuggestionDiscussionStore(n),{discussionStore:n,blockStore:a}}if(o)for(const i of o.annotationTypes){const e=(0,I.k$)(a,o.annotations,o.currentUser,i);if(e)return{discussionStore:e.discussionStore,blockStore:a}}if(r)for(const i of r.suggestionTypes){const e=r.blockStore.getAllBlockSuggestions().find((e=>{if(e.type===i){const t=F.t1.createChildStore(r.blockStore,{table:l.qF,id:e.discussionId,spaceId:(0,c.C)(r.blockStore.pointer.spaceId)});return(0,I.Ld)(t,r.currentUser)}}));if(e)return{discussionStore:F.t1.createChildStore(r.blockStore,{table:l.qF,id:e.discussionId,spaceId:(0,c.C)(r.blockStore.pointer.spaceId)}),blockStore:a}}const u=W({transaction:t,blockStore:a,modifiedBlockIds:[a.id],environment:e});return{discussionStore:u.discussionStore,blockStore:a}}(e,t,n,o,r);return Z.az(e,s)&&y.Ib({environment:e,blockStore:s,shouldFocusDiscussion:!0,analyticsFrom:"new_suggestion",discussionIds:[a.id],recursivelyLoadAllDiscussions:!1}),a}function oe(e){const{environment:t,store:n,discussionStore:o,selection:r,transaction:i}=e,a=p.Sfs({textValue:n.getValue(),startIndex:r.startIndex,endIndex:r.endIndex,groupingKey:p.GKr.SuggestionInsertText}).map((e=>{let{annotation:o,startIndex:i,endIndex:a}=e;const s=p.fgJ(o),l=(0,I.cC)({store:n,discussionId:s});if(l&&(0,I.Ld)(l,t.currentUser))return{startIndex:Math.max(i,r.startIndex),endIndex:Math.min(a,r.endIndex),annotation:o}}));k.WO({environment:t,store:n,annotation:[p.GKr.SuggestionRemoveText,o.id],selection:r,transaction:i}),a.reverse().forEach((e=>{if(e){k.pe({environment:t,store:n,selection:{startIndex:e.startIndex,endIndex:e.endIndex},transaction:i});const o=p.fgJ(e.annotation),r=(0,I.cC)({store:n,discussionId:o});r&&Q({environment:t,transaction:i,discussionStore:r})}}))}function re(e){const{environment:t,multiSelection:n,transaction:o,discussionStore:i}=e,s=(0,M.L5)(n);if(0===s.length)return;if(1===s.length){const{store:e,selection:n}=s[0];return oe({environment:t,store:e,selection:n,transaction:o,discussionStore:i}),void Q({environment:t,transaction:o,discussionStore:i,addModifiedBlockIdsAfter:[e.id]})}const{start:l,end:c}=n;oe({environment:t,store:l.store,selection:{startIndex:l.index,endIndex:1/0},transaction:o,discussionStore:i}),Q({environment:t,transaction:o,discussionStore:i,addModifiedBlockIdsAfter:[l.store.id]});const d=[n.start.store.id],u=(0,M.Nj)({multiSelection:n,includeNonSelectable:!0});if(!u)return;const{treeRange:p}=u;for(const g of p.iterateDeletion())"delete"===g.operation&&(0,A.XL)({treeOperation:g,deleteFrom:"record-store-parent"}).forEach((e=>{let{childToRemove:t}=e;t.id===n.start.store.id||t.id===n.end.store.id||(0,r.S9)((0,m.TO)(t.getType()))||(d.push(t.id),ee(o,t,{id:a.Il(),type:"remove",discussionId:i.id}))}));Q({environment:t,transaction:o,discussionStore:i,addModifiedBlockIdsAfter:d}),oe({environment:t,store:c.store,selection:{startIndex:0,endIndex:n.end.index},transaction:o,discussionStore:i}),Q({environment:t,transaction:o,discussionStore:i,addModifiedBlockIdsAfter:[c.store.id]})}function ie(e){const{environment:t,sourceBlockStore:n,targetBlockStore:r,transaction:i,selectionIsExpanded:d,editorMode:u}=e,m=n.getAddLineBreakSuggestion()??n.getRemoveLineBreakSuggestion();if(m){const e=F.t1.createChildStore(n,{id:m.discussionId,table:l.qF,spaceId:(0,c.C)(n.pointer.spaceId)});_.sW({store:e,data:{parent_id:r.id,parent_table:s.iU},transaction:i}),ee(i,r,m),Q({environment:t,transaction:i,discussionStore:e,addModifiedBlockIdsBefore:[r.id],removeModifiedBlockIds:[n.id],addModifiedBlockIdsAfterAnchor:n.id}),te({environment:t,transaction:i,blockStore:n,blockSuggestionId:m.id,removeDiscussionId:{discussionId:m.discussionId}})}if("suggest"===u){var g,f;const e=null===(g=(0,I.YT)({blockStore:n,currentUser:t.currentUser,type:p.GKr.SuggestionInsertText}))||void 0===g?void 0:g.discussionStore;if(null!==(f=r.getNavigableBlockStore())&&void 0!==f&&f.isCommentOnly()){const e=i.getSuggestionDiscussionStore()??ne(t,i,n,{annotations:o.u.fromArray(p.Rkp(n.getTitleValue())),annotationTypes:[p.GKr.SuggestionInsertText],currentUser:t.currentUser});ee(i,r,{type:"insert",id:a.Il(),discussionId:e.id}),Q({environment:t,transaction:i,discussionStore:e,addModifiedBlockIdsAfter:[r.id],addModifiedBlockIdsAfterAnchor:n.id})}if(!e){const e=i.getSuggestionDiscussionStore()??W({transaction:i,blockStore:n,modifiedBlockIds:[n.id],environment:t}).discussionStore;ee(i,n,{id:a.Il(),type:"add_line_break",discussionId:e.id});Q({environment:t,transaction:i,discussionStore:e,addModifiedBlockIdsAfter:d?[n.id,r.id]:[n.id],addModifiedBlockIdsAfterAnchor:n.id})}if(0===r.getTitleValue().length||e){const o=i.getSuggestionDiscussionStore()??e??W({transaction:i,blockStore:r,modifiedBlockIds:[r.id],environment:t}).discussionStore;ee(i,r,{id:a.Il(),type:"insert",discussionId:o.id}),Q({environment:t,transaction:i,discussionStore:o,addModifiedBlockIdsAfter:[r.id],addModifiedBlockIdsAfterAnchor:n.id})}}}function ae(e){const{environment:t,transaction:n,currentPageStore:o,blockStore:r}=e,i=g.jj([...r.getAllBlockSuggestions().map((e=>e.discussionId)),...r.getInlineSuggestionDiscussionIds()]);for(const a of i){const e=F.jQ.createChildStore(r,{table:l.qF,id:a,spaceId:r.getSpaceId()});if(!e.isDefined())continue;const i=e.getCommentStores()[0];i&&j({environment:t,transaction:n,action:"reject",discussionStore:e,commentStore:i,discussionLocation:"ai_reject_all_suggestions",currentPageStore:o})}}},625487:(e,t,n)=>{n.d(t,{I4:()=>g,TW:()=>m,ZP:()=>h});n(667294);var o=n(724405),r=n(709291),i=n(137810),a=n(831103),s=n(668709),l=n(573063),c=n(944461),d=n(406120),u=n(598997),p=n(785893);const m=3;let g=function(e){return e[e.PushContent=0]="PushContent",e[e.FloatRight=1]="FloatRight",e}({});const f=(0,r.defineMessages)({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"}});function h(e){const t=(0,r.useIntl)(),{store:n,recursivelyLoadAllDiscussions:s,onlyCountBlockLevelDiscussions:g,property_id:h}=e,{showIndicator:y,formattedReactionCount:b,onlySuggestions:_,icon:S,showReactionsIcon:k,onlyHasDraftIndicator:w,formattedCommentCount:x,handleClick:I,discussionIsSelected:C,commentsCount:T,shouldShowDraftIndicator:M}=(0,d.Z)({store:n,recursivelyLoadAllDiscussions:s,onlyCountBlockLevelDiscussions:g,propertyId:h}),P=(0,o.yK)((e=>({iconButton:{position:"relative",alignSelf:"flex-start",marginLeft:4,marginTop:m,background:C?e.selectLightGray[100]:void 0},draftIconButton:{position:"relative",alignSelf:"flex-start",marginTop:3,background:C?e.selectLightGray[100]:void 0,width:24,marginLeft:5},icon:{height:14,width:14,color:e.lightTextColor},commentCount:{marginLeft:2,color:e.lightTextColor,fontWeight:i.Z.fontWeight.semibold},draftCommentCount:{marginLeft:2,color:e.icon.tertiary,fontWeight:i.Z.fontWeight.semibold},reactIcon:{width:16,height:16,marginLeft:"-2px"},relativeDiv:{position:"relative"}})),[C]);return(0,p.jsx)(a.Z,{name:"DiscussionIndicatorInner",children:y&&(0,p.jsxs)(v,{format:e.getFormat(),children:[(T>0||w)&&(0,p.jsxs)("div",{style:P.relativeDiv,children:[(0,p.jsx)(l.Z,{ariaLabel:_?t.formatMessage(f.suggestionsAriaLabel,{count:x}):t.formatMessage(f.commentsAriaLabel,{count:x}),icon:S,style:P.iconButton,iconStyle:P.icon,onClick:I,caption:(0,p.jsx)("span",{style:M?P.draftCommentCount:P.commentCount,children:x})}),M&&(0,p.jsx)(u.Z,{onlyShowDraftDot:!0})]}),k&&(0,p.jsx)(l.Z,{ariaLabel:t.formatMessage(f.reactionsAriaLabel,{count:b}),icon:c.a,style:P.iconButton,iconStyle:P.reactIcon,onClick:I,caption:(0,p.jsx)("span",{style:P.commentCount,children:b})})]})})}function v(e){return e.format===g.FloatRight?(0,p.jsx)(s.p,{allowSelectionWithin:!1,style:{width:0,height:0},children:e.children}):(0,p.jsx)(p.Fragment,{children:e.children})}},598997:(e,t,n)=>{n.d(t,{Z:()=>l});n(667294);var o=n(724405),r=n(279680),i=n(799826),a=n(785893);const s="#CB9433";function l(e){const{onlyShowDraftDot:t,customTop:n,customLeft:l,withBackgroundFill:c}=e,d=(0,o.yK)((e=>({icon:{height:24,width:24,color:e.lightTextColor},sharedDotStyles:{position:"absolute",borderRadius:"50%",color:s,stroke:e.whiteButtonBackground,strokeWidth:"1.2px",pointerEvents:"none"},absoluteDot:{top:n??20,left:l??"calc(50% + 4px)",height:12,width:12},absoluteOnlyDot:{top:n??6,left:l??19,height:8,width:8},withBackgroundFill:{backgroundColor:s,fill:"transparent"},container:{width:"100%",display:"flex",justifyContent:"center",marginBottom:10}})),[l,n]);return t?(0,r.h)({...d.sharedDotStyles,...d.absoluteOnlyDot,...c&&d.withBackgroundFill}):(0,a.jsxs)("div",{style:d.container,children:[(0,i.s)(d.icon),(0,r.h)({...d.sharedDotStyles,...d.absoluteDot})]})}},808549:(e,t,n)=>{n.d(t,{SO:()=>p,VS:()=>g,c_:()=>u,nZ:()=>m});var o=n(541432),r=n(286420),i=n(721429),a=n(450627),s=n(873153),l=n(646124),c=n(990827),d=n(599757);function u(e){let{blocks:t}=e;return!!p({blocks:t})&&(!function(e){let{blocks:t}=e;return t.some((e=>{const t=i.np();return!(!t||!(0,a.Wt)(t))||!!(t&&((0,c.Eo)(t)||null!=t&&t.pathIsDead())&&t.uiContains(e)&&t!==e)}))}({blocks:t})&&(!!(0,s.c)({blocks:t})&&(!!m({blocks:t})&&(!!g({blocks:t})&&(!!function(e){let{blocks:t}=e;if(t.some((e=>e.getAssociatedCollectionStore())))return!0;return t.length>1||!function(e){if(!e)return!1;const t=e.getType(),n=e.getFormat();return Boolean((0,o.XD)(t,n)&&e.isEmptyTitle())}(t[0])}({blocks:t})&&(!(1!==t.length&&!(0,l.K)())&&!t.some(r.t)))))))}function p(e){let{blocks:t}=e;return!d.n.state&&t.every((e=>e.canComment()))}function m(e){let{blocks:t}=e;return!!t.some((e=>e.getAssociatedCollectionStore()))||t.every((e=>!e.isNavigableBlock()))}function g(e){let{blocks:t}=e;return t.every((e=>{const t=e.getType(),n=e.getFormat();return Boolean(!t||!(0,o._T)(t,n))}))}},607709:(e,t,n)=>{n.d(t,{EM:()=>G,H0:()=>Q,QB:()=>Z,Uj:()=>q,Vs:()=>B,Z:()=>L,az:()=>W,fS:()=>N,fg:()=>$,gC:()=>z,oS:()=>H,wo:()=>P});n(757658);var o=n(118466),r=n(14577),i=n(541432),a=n(222491),s=n(421202),l=n(870279),c=n(653965),d=n(401898),u=n(110906),p=n(721429),m=n(843250),g=n(111599),f=n(785957),h=n(165598),v=n(58202),y=n(849427),b=n(95802),_=n(48276),S=n(224646),k=n(626765),w=n(80444),x=n(417903),I=n(188923),C=n(206258),T=n(947002),M=n(948514);const P=10,A=10,R="temp-margin-comment-discussion",D="temp-margin-comment-discussion-in-toggle",B=50,E=`.${m.x9t} .notion-collection_view-block`,F=`.${m.OE$}`,Z=372,U=10,V=14,N=16,O=1150,L=Z-4*N,j=1500,K=1600;function z(e,t,n){const o=q(e,t);return o>=j||n&&!I.default.isSidePeekClosingStore.state||t?0:(j-o)/2}function q(e,t){return t&&I.default.isSidePeekOpen()?(0,S.vJ)(e):e.WindowSizeStore.state.width-(0,S.Wk)(e)-(0,S.ll)(e,!1)-_.VV()}function H(e,t,n){return(q(e,t)-K)/2+2*N+z(e,t,n)}const G=new r.ZP((()=>{var e;let t=w.default.state.mainEditorCurrentBlockStore;return null!==(e=t)&&void 0!==e&&e.isCollectionView()&&(t=(0,u.SY)(t)||t),t?(0,h.vV)(t,{recursivelyLoadAllDiscussions:!0,includePropertyDiscussions:!0}).filter((e=>{var n;return e.getParentId()!==(null===(n=t)||void 0===n?void 0:n.id)||void 0!==e.getPropertyId()})):[]}),{debugName:"mainEditorBlockUnresolvedDiscussionStore"});function W(e,t){return(!t.getAssociatedCollectionStore()||!t.getRecordStoreUIParent()||t.id===(0,p.zj)())&&Boolean(!e.device.isMobile&&q(e,(0,f.wq)(t))>=O&&!(0,S.vK)(e)&&!I.default.isSidePeekOpen()&&(y.Z.isBlockInFrame(t)||t.id===(0,p.zj)())&&(0,g.A$)("margin_comments","inline"))}function $(e,t){const n=G.state.length>0,o=M.Z.state.open&&M.Z.state.rect;return Boolean(W(e,t)&&(n||o))}function Y(e,t){return e.offsetTop!==t.offsetTop?e.offsetTop<t.offsetTop?-1:1:e.createdTimeMs&&t.createdTimeMs&&e.createdTimeMs!==t.createdTimeMs?e.createdTimeMs<t.createdTimeMs?-1:1:e.id<t.id?-1:1}const Q=(0,c.Ds)((function(e){let{discussionStores:t,pageContentStores:n,marginDiscussionItemRefs:r,selectedDiscussionId:l,newMarginDiscussionArgs:c,marginContainerElement:u,pageViewBlockElement:g,onComputeComplete:f,computedOnce:h,prevSelectedDiscussionId:y,isFullWidth:_,topbarHeight:S,windowHeight:w,previousDiscussionElements:I,allowActionsWhileCommenting:P}=e;const D=new Map;let B=0,Z=0;if(!u||!g)return;if(0===t.length&&!c)return;const N=o.Z.withListenerIgnored((()=>x.Z.state.scrollTop)),O=u.getBoundingClientRect(),L=J({currentScrollTop:N,rect:O}),j=t.map((e=>function(e){let{discussionStore:t,currentScrollTop:n,topbarHeight:o,windowHeight:r,pageViewBlockElement:i,previousDiscussionElements:l,currentDiscussionElements:c,selectedDiscussionId:d}=e;const u=t.id,m=function(e){const{topbarHeight:t,windowHeight:n,pageViewBlockElement:o,discussionId:r,previousDiscussionElements:i,currentDiscussionElements:s,selectedDiscussionId:l}=e,c=o.getElementsByClassName((0,a.dk)({discussionId:r})),d=e=>(s.set(r,e),e);if(c.length>0){if(l===r){let e;for(let o=0;o<c.length;o++){const r=c[o];if(r instanceof HTMLElement){const o=r.getBoundingClientRect();if(o.bottom<t||o.top>n){if(e)return d(e)}else{if(o.top>t)return d(r);e=r}}}}const e=i.get(r);return e&&Array.from(c).includes(e)?d(e):d(c[0])}}({topbarHeight:o,windowHeight:r,pageViewBlockElement:i,discussionId:u,previousDiscussionElements:l,currentDiscussionElements:c,selectedDiscussionId:d}),g=t.recordStoreUIParentStore;if(!(g&&g.id&&g.table===s.iU&&g instanceof C.G))return;if(!g.isReady())return;const f={offsetTop:0,discussionStore:t,parentBlockStore:g,type:"existing",id:t.id,createdTimeMs:ee(t)};if(m instanceof HTMLElement)return f.offsetTop=J({rect:m.getBoundingClientRect(),currentScrollTop:n}),f;const h=b.C.findNodeFromStore(g);if(h instanceof HTMLElement&&g.id!==(0,p.zj)())return f.offsetTop=J({rect:h.getBoundingClientRect(),currentScrollTop:n}),f;const{node:v,blockStore:y}=b.C.findClosestVisibleParent(g);if(v instanceof HTMLElement&&y)return f.offsetTop=J({rect:v.getBoundingClientRect(),currentScrollTop:n})+U,f.parentBlockStore=y,f.shouldGroup=!0,f.closestVisibleParentId=y.id,f}({discussionStore:e,currentScrollTop:N,topbarHeight:S,windowHeight:w,pageViewBlockElement:g,previousDiscussionElements:I,currentDiscussionElements:D,selectedDiscussionId:l}))).filter(d.$K),K=c&&function(e){var t;let n,{blockStore:o,discussionInputStore:r,currentScrollTop:i,pageViewBlockElement:a,allowActionsWhileCommenting:s}=e;const l=null===(t=a.getElementsByClassName(m.dXl))||void 0===t?void 0:t[0];let c=!1,d=o;if(l instanceof HTMLElement)n=l.getBoundingClientRect();else if(s){const e=M.Z.getBlockStore();if(e)n=v.R.getRect(e);else{const e=M.Z.getClosestBlockStore();if(e){const{node:t,parentBlockStore:o}=e;t instanceof HTMLElement&&o&&(n=t.getBoundingClientRect(),c=!0,d=o)}}}else n=v.R.getRect(o);if(!n)return;return{offsetTop:J({rect:n,currentScrollTop:i})+V,parentBlockStore:d,discussionInputStore:r,type:"new",id:R,createdTimeMs:Date.now(),shouldGroup:c}}({...c,currentScrollTop:N,pageViewBlockElement:g,allowActionsWhileCommenting:P});let z=P&&null!=K&&K.shouldGroup?X(j,K):X(j);P&&null!=K&&K.shouldGroup||K&&z.push(K);const q=K&&(!P||T.Z.state.isActivelyComposing)?K.id:l;let H;const G=q||y?void 0:function(e){let{pageContentStores:t,currentScrollTop:n,marginContainerRect:o,isFullWidth:r}=e;return t.map((e=>{const t=e.getType();if(!t)return;let n;var a;if((0,d.qg)(i.Ok,t)||"column_list"===t)n=null===(a=b.C.findSelectableFromStore(e))||void 0===a||null===(a=a.getNode())||void 0===a?void 0:a.getBoundingClientRect();else if(t===i.Ti.table){var s,l;const t=null===(s=b.C.findSelectableFromStore(e))||void 0===s?void 0:s.getNode(),o=null==t?void 0:t.getBoundingClientRect(),i=null==t||null===(l=t.querySelector(F))||void 0===l?void 0:l.getBoundingClientRect();n=r?o:o&&i?o.width<i.width?o:i:o||i}else if(e.isInlineCollectionView()){var c,u;const t=null===(c=b.C.findSelectableFromStore(e))||void 0===c?void 0:c.getNode();n=r?null==t?void 0:t.getBoundingClientRect():null==t||null===(u=t.querySelector(E))||void 0===u?void 0:u.getBoundingClientRect()}return n&&n.right>o.left?n:void 0})).filter(d.$K).map((e=>{const t=J({rect:e,currentScrollTop:n});return new DOMRect(e.left,t,e.width,e.height)}))}({pageContentStores:n,currentScrollTop:N,marginContainerRect:O,isFullWidth:_}).sort((e=>-e.top));z=z.sort(Y).map(((e,t)=>{e.offsetTop-L>=18&&(e.offsetTop-=18);const n=e.id,o=r.get(e.id);if(!o)return"new"===e.type||h||(e.offsetTop=-9999,e.hide=!0),e;const i=o.getBoundingClientRect(),a=i.height;let s=e.offsetTop;return s<=B&&(s=B),G&&(s=function(e,t){const n={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,left:e.left,bottom:e.bottom,right:e.right};let o=t[t.length-1];for(;o;)if((0,k.dQ)(n,o))n.top=o.bottom+A,n.bottom=n.top+n.height,t.pop(),o=t[t.length-1];else{if(n.bottom<o.top)return n.top;t.pop(),o=t[t.length-1]}return n.top}(new DOMRect(i.left,s,i.width,i.height),G)),n===q&&0===Z&&(Z+=s-e.offsetTop,e.selected=!0,H=t),e.offsetTop=s,e.height=a,B=e.offsetTop+a,e}));const W=z.map((e=>(e.offsetTop=e.offsetTop-L,e)));let $;if(Z>0&&void 0!==H)for(let o=H;o>=0;o--){const e=W[o];if(e.height){if(e.id===q)e.offsetTop-=Z;else{if(!($&&$.offsetTop<=e.offsetTop+e.height))break;e.offsetTop-=Z}$=e}}f({data:W,hasNewDiscussion:Boolean(K),selectedDiscussion:l},D)}),100);function J(e){let{rect:t,currentScrollTop:n}=e;return t.top+n}function X(e,t){const n=new Map,o=[];e.forEach((e=>{if(e.shouldGroup){const t=n.get(e.parentBlockStore.id)||[];t.push(e),n.set(e.parentBlockStore.id,t)}else o.push(e)}));const r=null==t?void 0:t.parentBlockStore.id,i=r&&n.get(r)||[];return n.forEach((e=>{o.push({offsetTop:e[0].offsetTop,groupedDiscussionsData:e,parentBlockStore:e[0].parentBlockStore,type:"grouped",id:e[0].id,createdTimeMs:e[0].createdTimeMs,newDiscussionData:t})})),t&&0===i.length&&o.push({offsetTop:t.offsetTop,groupedDiscussionsData:[],parentBlockStore:t.parentBlockStore,type:"grouped",id:D,createdTimeMs:t.createdTimeMs,newDiscussionData:t}),o}function ee(e){const t=h.ak(e),n=t.getValue()||[];if(0===n.length)return;const o=n[0];return C.t1.createChildStore(t,{table:l.x_,id:o,spaceId:t.pointer.spaceId}).getCreatedTime()}},406120:(e,t,n)=>{n.d(t,{Z:()=>S});var o=n(667294),r=n(800480),i=n(886628),a=n(554564),s=n(524677),l=n(721429),c=n(165598),d=n(799826),u=n(452452),p=n(745238),m=n(785893);const g=(0,p.IU)("suggestionDiscussionCombo",{viewBox:"0 0 14 13",svg:(0,m.jsxs)("g",{children:[(0,m.jsx)("path",{fillRule:"evenodd",d:"M1.427 7.748c.314.172.674.259 1.081.259h.43V6.963H2.66c-.366 0-.64-.091-.822-.273-.179-.184-.268-.457-.268-.817V2.524c0-.36.09-.631.268-.813.182-.184.456-.276.822-.276h5.682c.363 0 .634.092.813.276.18.18.27.447.272.8h1.127V2.37c0-.446-.087-.83-.26-1.152a1.753 1.753 0 00-.738-.742C9.235.299 8.85.21 8.401.21H2.583c-.448 0-.833.088-1.156.264-.32.172-.565.42-.738.742-.173.323-.26.706-.26 1.152v3.48c0 .445.089.83.264 1.151.18.323.424.572.734.748z",clipRule:"evenodd"}),(0,m.jsx)("path",{d:"M6.492 12.557c-.217 0-.387-.07-.51-.207-.123-.138-.185-.327-.185-.567v-.975h-.28c-.408 0-.768-.087-1.082-.26a1.895 1.895 0 01-.734-.747c-.176-.322-.264-.706-.264-1.151V5.17c0-.446.087-.83.26-1.152.173-.322.419-.57.738-.743.322-.175.708-.263 1.156-.263h5.818c.448 0 .834.088 1.156.263.322.173.568.42.738.743.173.322.26.706.26 1.151v3.48c0 .446-.087.83-.26 1.152a1.78 1.78 0 01-.738.747c-.322.173-.708.26-1.156.26H8.882l-1.485 1.3a2.497 2.497 0 01-.479.343.91.91 0 01-.426.106zm.272-1.257L8.14 9.946a.938.938 0 01.294-.215.96.96 0 01.365-.057h2.544c.364 0 .634-.091.813-.273.182-.184.273-.457.273-.817V5.235c0-.36-.091-.631-.273-.813-.179-.184-.45-.276-.813-.276H5.661c-.366 0-.64.092-.822.276-.178.182-.268.453-.268.813v3.349c0 .36.09.633.268.817.182.182.456.273.822.273h.699c.132 0 .231.03.299.092.07.062.105.166.105.312V11.3zm-.343-3.696a.685.685 0 01-.496-.202.68.68 0 01-.202-.492.67.67 0 01.202-.493.677.677 0 01.496-.206c.194 0 .358.069.493.206a.67.67 0 01.202.493.68.68 0 01-.202.492.67.67 0 01-.493.202zm2.083 0a.685.685 0 01-.496-.202.68.68 0 01-.202-.492.67.67 0 01.202-.493.677.677 0 01.496-.206c.194 0 .358.069.493.206a.663.663 0 01.206.493c0 .19-.069.354-.206.492a.67.67 0 01-.493.202zm2.083 0a.68.68 0 01-.492-.202.68.68 0 01-.202-.492.67.67 0 01.202-.493.672.672 0 01.492-.206c.194 0 .358.069.493.206a.663.663 0 01.206.493c0 .19-.069.354-.206.492a.67.67 0 01-.493.202z"})]})});var f=n(80444),h=n(524229),v=n(385555),y=n(736974),b=n(947002),_=n(948514);function S(e){const t=(0,r.O7)(),{store:n,recursivelyLoadAllDiscussions:p,onlyCountBlockLevelDiscussions:m,propertyId:S}=e,k=(0,i.VK)((()=>"on"===v.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0})),[]),w=(0,i.VK)((()=>{const e=_.Z.state.open?_.Z.state.blockId:null;return!!p&&(0,c.MI)({blockStore:n,transclusionReferences:"recurseInto",childPages:"omit"}).some((t=>t.id===e))}),[n,p]),x=(0,i.VK)((()=>_.Z.state.open&&_.Z.state.blockId===n.id&&"comment"===_.Z.state.content&&(!_.Z.state.property_id||_.Z.state.property_id===S)),[S,n.id]),I=(0,i.VK)((()=>_.Z.getDiscussionInputStore()),[]),C=k&&(x||w),T=(0,i.VK)((()=>{const e=c.vV(n,{recursivelyLoadAllDiscussions:p,onlyIncludeBlockLevelDiscussions:m,onlyIncludePropertyDiscussions:Boolean(S)}).filter((e=>e.getPropertyId()===S));if(0===e.length)return{commentsCount:0,numberOfReactions:0,discussionIsSelected:C&&b.Z.state.isActivelyComposing,hasSuggestionDiscussions:!1,hasDefaultDiscussions:!1};const t=new Set(e.map((e=>e.id))),o=h.Z.getFramePageFirstSelectedDiscussionId(),r=Boolean(o&&t.has(o)),i=l.RM();if(i){const e=c.MI({blockStore:i,transclusionReferences:"recurseInto",childPages:"omit"}),o=e.indexOf(n),r=new Set(t);for(let n=o-1;n>=0;n--){const o=e[n],i=c.vV(o,{recursivelyLoadAllDiscussions:!1,excludeSelf:!1,onlyIncludeBlockLevelDiscussions:!1,includeLoadingDiscussions:!0}).map((e=>e.id));for(const e of r)i.includes(e)?t.delete(e):r.delete(e);if(0===t.size)return{commentsCount:0,numberOfReactions:0,discussionIsSelected:!1,hasSuggestionDiscussions:!1,hasDefaultDiscussions:!1};if(0===r.size)break}}const{comments:a,reactions:s,hasSuggestionDiscussions:d,hasDefaultDiscussions:u}=c.c3(n,{recursivelyLoadAllDiscussions:p,onlyIncludeBlockLevelDiscussions:m,onlyIncludePropertyDiscussions:Boolean(S)},S);return{commentsCount:a,numberOfReactions:s,discussionIsSelected:r,hasSuggestionDiscussions:d,hasDefaultDiscussions:u}}),[m,S,p,C,n]),{commentsCount:M,numberOfReactions:P,hasSuggestionDiscussions:A,hasDefaultDiscussions:R}=T,D=(0,o.useCallback)((()=>{if(h.Z.state.open)a.LZ();else if(s.ZH({preventDismissMobileKeyboard:!0,environment:t}),C){if(M>0)b.Z.setActiveWithSource("popover_comments"),b.Z.setState({...b.Z.state,overlapsExistingDiscussionMenu:!0}),a.Ib({environment:t,blockStore:e.store,analyticsFrom:"discussion_indicator",shouldFocusDiscussion:!0,recursivelyLoadAllDiscussions:e.recursivelyLoadAllDiscussions,property_id:e.propertyId});else if(I){const e=f.default.state.mainEditorCurrentBlockStore;(0,y.U)({currentBlockStore:e,discussionInputStore:I,environment:t,allowActionsWhileCommenting:k})}}else a.Ib({environment:t,blockStore:e.store,analyticsFrom:"discussion_indicator",shouldFocusDiscussion:!0,recursivelyLoadAllDiscussions:e.recursivelyLoadAllDiscussions,property_id:e.propertyId})}),[k,t,C,M,I,e.store,e.recursivelyLoadAllDiscussions,e.propertyId]),B=M>0||P>0||C,E=P>9?"9+":`${P}`,F=A&&!R,Z=F?u.I:A&&R?g:d.s,U=M+(C?1:0);return{showIndicator:B,formattedReactionCount:E,onlySuggestions:F,icon:Z,showReactionsIcon:P>0&&!C&&0===M,onlyHasDraftIndicator:C&&0===M,commentCountWithDraft:U,formattedCommentCount:U>9?"9+":`${U}`,handleClick:D,discussionIsSelected:T.discussionIsSelected,commentsCount:M,shouldShowDraftIndicator:C}}},133767:(e,t,n)=>{n.r(t),n.d(t,{LazyComment:()=>i,LazyCommentFileBlock:()=>g,LazyDiscussion:()=>a,LazyDiscussionIndicator:()=>s,LazyDiscussionInput:()=>l,LazyDiscussionReactionBar:()=>m,LazyMarginCommentsSection:()=>c,LazyNewDiscussionMenu:()=>d,LazyPropertyDiscussionIndicator:()=>h,LazyReactionBar:()=>p,LazyReplyDiscussionMenu:()=>u,LazySuggestionContext:()=>f,commentsDependency:()=>r});var o=n(277907);const r=new o.Ss("comments",(()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(97372),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(98530),n.e(80672),n.e(58324)]).then(n.bind(n,774177)))),i=(0,o.kF)(r,(e=>e.Comment)),a=(0,o.kF)(r,(e=>e.Discussion)),s=(0,o.kF)(r,(e=>e.DiscussionIndicator)),l=(0,o.kF)(r,(e=>e.DiscussionInput)),c=(0,o.kF)(r,(e=>e.MarginCommentsSection)),d=(0,o.kF)(r,(e=>e.NewDiscussionMenu)),u=(0,o.kF)(r,(e=>e.ReplyDiscussionMenu)),p=(0,o.kF)(r,(e=>e.ReactionBar)),m=(0,o.kF)(r,(e=>e.DiscussionReactionBar)),g=(0,o.kF)(r,(e=>e.CommentFileBlock)),f=(0,o.kF)(r,(e=>e.SuggestionContext)),h=(0,o.kF)(r,(e=>e.PropertyDiscussionIndicator))},992120:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(749085),r=n(292595);class i extends o.default{getInitialState(){}getFirstSelectedDiscussionId(){var e;return null===(e=this.state)||void 0===e||null===(e=e.discussionIds)||void 0===e?void 0:e[0]}}const a=new i;(0,r.exposeDebugValue)("DiscussionHoverStore",a);const s=a},182994:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(126263),r=n(749085),i=n(870279),a=n(421838),s=n(741195),l=n(206258);class c extends r.default{constructor(e,t){super(),this.environment=void 0,this.spaceId=void 0,this.environment=e,this.spaceId=t,this.reset()}getInitialState(){if(!this.environment)return;const e=new o.Z({name:"DiscussionInputStore",isTemporaryData:!0});return{textStore:new l.ST({environment:this.environment,pointer:(0,s.Ii)({environment:this.environment,table:i.x_,spaceId:this.spaceId}),path:["text"],recordStoreOptions:{inMemoryRecordCache:e}}),localRecordCache:e,files:[],showAttachFileIntro:!1,renderFileAttachIntro:!1}}isEmpty(){const e=this.state.textStore.getValue();return!e||0===e.length}hasNewLineCharacter(){const e=this.state.textStore.getValue();return a.QaF(e).includes("\n")}}const d=c},947002:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isHovered:!1,isActivelyComposing:!1}}setHoverWithSource(e){this.setState({...this.state,isHovered:!0,hoverEntryPoint:e})}setActiveWithSource(e){this.setState({...this.state,isActivelyComposing:!0,clickEntryPoint:e})}resetHoverSource(e){var t;e===(null===(t=this.state)||void 0===t?void 0:t.hoverEntryPoint)&&this.setState({...this.state,isHovered:!1,hoverEntryPoint:void 0})}resetActiveSource(e){var t;e===(null===(t=this.state)||void 0===t?void 0:t.clickEntryPoint)&&this.setState({...this.state,isActivelyComposing:!1,clickEntryPoint:void 0})}resetAllHoverSources(){this.setState({...this.state,isHovered:!1,hoverEntryPoint:void 0})}resetAllActiveSources(){this.setState({...this.state,isActivelyComposing:!1,clickEntryPoint:void 0})}resetEditorActiveSources(){"comments_pane"!==this.state.clickEntryPoint&&this.resetAllActiveSources()}resetEditorHoverSources(){"comments_pane"!==this.state.hoverEntryPoint&&this.resetAllHoverSources()}}const i=new r},948514:(e,t,n)=>{n.d(t,{Z:()=>h});var o=n(455010),r=n(749085),i=n(541432),a=n(292595),s=n(421202),l=n(421838),c=n(58202),d=n(828685),u=n(95802),p=n(626765),m=n(80444);class g extends r.default{getInitialState(){return{open:!1,rect:p.bM}}hasContent(){if(this.state.open){if("comment"===this.state.content)return Boolean(this.state.discussionInputStore.state.textStore.getValue())||this.state.discussionInputStore.state.files.length>0;if("reaction"===this.state.content)return void 0!==this.state.emoji}}isComposingNewDiscussion(){return!(!this.state.open||"comment"!==this.state.content)&&!!this.hasContent()}getBlockStore(){if(this.state.open&&this.state.blockId){var e;const t=null===(e=c.R.findBlockFromId(this.state.blockId))||void 0===e?void 0:e.getBlockStore();return t&&"comment"===this.state.content&&t!==this.state.lastKnownBlockStore&&this.setState({...this.state,lastKnownBlockStore:t}),t}}isDraftCommentOnValidSelection(){return this.isTextWithCommentStillPresent()&&this.isBlockStillAlive()}getClosestBlockStore(){if(this.state.open&&"comment"===this.state.content){const{node:e,blockStore:t}=u.C.findClosestVisibleParent(this.state.lastKnownBlockStore);return{node:e,parentBlockStore:t}}}getLastKnownBlockStore(){if(this.state.open&&"comment"===this.state.content)return this.state.lastKnownBlockStore}getLastSelectedEditables(){if(this.state.open&&"inline"===this.state.type&&this.state.multiSelection&&"comment"===this.state.content)return this.state.lastEditables.filter((e=>{let{store:t}=e;return t.table===s.iU}))}getDiscussionInputStore(){if(this.state.open&&"comment"===this.state.content)return this.state.discussionInputStore}getType(){if(this.state.open)return this.state.type}getMultiSelection(){if(this.state.open&&"inline"===this.state.type)return this.state.multiSelection}getPropertyId(){if(this.state.open&&"comment"===this.state.content&&this.state.property_id)return this.state.property_id}isPropertyComment(){return Boolean(this.state.open&&"comment"===this.state.content&&this.state.property_id)}shouldShowPropertyComment(){var e;return Boolean(this.isPropertyComment()&&(null===(e=m.default.state.mainEditorCurrentBlockStore)||void 0===e?void 0:e.isInsideCollection()))}ifPropertyCommentShouldDisplay(){return!this.isPropertyComment()||this.shouldShowPropertyComment()}isPropertyWithDraftDiscussion(e){const{blockId:t,propertyId:n}=e;return!(!t||!n)&&(this.state.open&&"comment"===this.state.content&&this.state.blockId===t&&this.isPropertyComment()&&this.state.property_id===n)}updateRect(){const e=this.getBlockStore();if(!this.state.open||!e||this.isPropertyComment())return;if(e.isType("code"))return;const t=c.R.getRect(e);if(!t)return;const n=this.state.rect.left,o=this.state.rect.width,r=this.state.rect.height;this.setState({...this.state,rect:new DOMRect(n,t.top,o,r)})}calculateMultitextSelection(){if(this.state.open&&"inline"===this.state.type&&this.state.multiSelection&&!this.getPropertyId()){var e,t;const n=this.state.multiSelection.start.store.id,r=null===(e=c.R.findBlockFromId(n))||void 0===e?void 0:e.getBlockStore(),a=null==r?void 0:r.getTitleStore(),s=this.state.multiSelection.end.store.id,l=null===(t=c.R.findBlockFromId(s))||void 0===t?void 0:t.getBlockStore().getTitleStore();if(a&&l){const e=d.E.findEditableWithStore(a),t=d.E.findEditableWithStore(l);if(n===s&&r&&r.isType(i.oe))return;t&&e&&-1===(0,o.Z)(t.getNode(),e.getNode())?(this.state.multiSelection.start.store=l,this.state.multiSelection.end.store=l):(this.state.multiSelection.start.store=a,this.state.multiSelection.end.store=l)}}}isBlockStillAlive(){if(this.state.open&&"comment"===this.state.content&&this.state.lastKnownBlockStore){const e=this.state.lastKnownBlockStore.pathIsDead();return e&&this.reset(),!e}}isTextWithCommentStillPresent(){if(!this.state.open||"inline"!==this.state.type)return!0;const e=this.getLastSelectedEditables()??[];if(!e.length)return!1;const t=e[0].store.getValue(),n=l.eeV(t),o=this.state.multiSelection.start.index>n.length-1;return o&&this.reset(),!o}}const f=new g;(0,a.exposeDebugValue)("NewDiscussionMenuStore",f);const h=f},209080:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(626765);class i extends o.default{getInitialState(){return{open:!1,rect:r.bM}}}const a=new i},705894:(e,t,n)=>{n.d(t,{Z:()=>X});var o=n(667294),r=n(973935),i=n(800480),a=n(886628),s=n(724405),l=n(815145),c=n(421202),d=n(933709),u=n(23867),p=n(709291),m=n(926249),g=n(137810),f=n(458912),h=n(966324),v=n(275754),y=n(800993),b=n(632741),_=n(624844),S=n(668709),k=n(573063),w=n(296994),x=n(735948),I=n(464939),C=n(349434),T=n(767996),M=n(785893);function P(e){const[t,n]=(0,x.C)(),o=(0,s.yK)((e=>({formBlockWrapper:{border:`1px solid ${e.darkDividerColor}`,borderRadius:6,overflow:"hidden",position:"relative"}})),[]);return(0,M.jsxs)(S.p,{ref:t,allowSelectionWithin:!0,style:o.formBlockWrapper,children:[n&&(0,M.jsx)(A,{store:e.store}),(0,M.jsx)(w.DH,{store:e.store,isEmbed:!0})]})}function A(e){const t=(0,p.useIntl)(),n=(0,o.useRef)(null);return(0,M.jsx)("div",{className:"notion-fadein-fast",ref:n,children:(0,M.jsxs)(_.G,{align:"right",containerRef:n,style:{position:"absolute",borderRadius:1},children:[(0,M.jsx)(k.Z,{style:{height:"auto"},icon:T.L,iconStyle:{width:16,height:16},ariaLabel:t.formatMessage(R.comment)}),(0,M.jsx)(k.Z,{style:{height:"auto"},icon:C.N,iconStyle:{width:14,height:14},ariaLabel:t.formatMessage(R.link)}),(0,M.jsx)(k.Z,{style:{height:"auto"},icon:I.o,iconStyle:{width:14,height:14},ariaLabel:t.formatMessage(R.more)})]})})}const R=(0,p.defineMessages)({comment:{id:"FormEmbedActionButtons.comment",defaultMessage:"Comment"},link:{id:"FormEmbedActionButtons.link",defaultMessage:"Copy link"},more:{id:"FormEmbedActionButtons.more",defaultMessage:"More"}});var D=n(133767),B=n(95477),E=n(466213),F=n(214976),Z=n(783105),U=n(484210),V=n(798165),N=n(99340);const O=(0,n(745238).IU)("commentAlert",{viewBox:"0 0 34 28",svg:(0,M.jsx)("path",{d:"M8.99023 25.3516C9.55957 25.3516 9.94629 25.1582 10.6338 24.5566L14.2324 21.3232C15.0059 22.1719 16.1768 22.6338 17.6699 22.6338H21.376L24.9639 25.7061C25.6191 26.2646 25.9736 26.5547 26.4893 26.5547C27.2305 26.5547 27.6494 26.0283 27.6494 25.2119V22.6338H28.1006C30.7969 22.6338 32.5908 21.001 32.5908 18.1973V11.8486C32.5908 9.03418 30.7969 7.40137 28.1006 7.40137H26.4141V6.58496C26.4141 3.67383 24.6846 1.97656 21.7627 1.97656H6.39062C3.58691 1.97656 1.73926 3.67383 1.73926 6.58496V16.4785C1.73926 19.4004 3.58691 21.0869 6.39062 21.0869H7.80859V24.0303C7.80859 24.8574 8.22754 25.3516 8.99023 25.3516ZM9.43066 20.3672C9.43066 19.7549 9.06543 19.4756 8.59277 19.4756H6.49805C4.59668 19.4756 3.46875 18.4336 3.46875 16.4355V6.64941C3.46875 4.65137 4.59668 3.59863 6.49805 3.59863H21.6553C23.5566 3.59863 24.6846 4.65137 24.6846 6.64941V7.40137H17.6699C14.8555 7.40137 13.1904 9.03418 13.1904 11.8486V18.1973C13.1904 18.7773 13.2549 19.3037 13.3945 19.7764L9.43066 23.4395V20.3672ZM26.0381 24.6104L22.5898 21.5166C22.1602 21.1406 21.9023 21.0117 21.3115 21.0117H17.7773C15.9834 21.0117 14.9092 20.0449 14.9092 18.1436L14.9199 11.9023C14.9199 10.0117 15.9834 9.02344 17.7773 9.02344H28.0039C29.7871 9.02344 30.8613 10.0117 30.8613 11.9023V18.1436C30.8613 20.0449 29.7871 21.0117 28.0039 21.0117H26.8652C26.4033 21.0117 26.0381 21.291 26.0381 21.8926V24.6104ZM22.9014 16.3389C23.3955 16.3389 23.6641 16.0596 23.6855 15.5225L23.8359 11.7734C23.8574 11.2148 23.4277 10.8174 22.8906 10.8174C22.3428 10.8174 21.9346 11.2041 21.9561 11.7627L22.0957 15.5225C22.1172 16.0488 22.3857 16.3389 22.9014 16.3389ZM22.8906 19.6045C23.4814 19.6045 23.9971 19.1318 23.9971 18.541C23.9971 17.9395 23.4922 17.4775 22.8906 17.4775C22.2891 17.4775 21.7842 17.9502 21.7842 18.541C21.7842 19.1318 22.2998 19.6045 22.8906 19.6045Z"})});var L=n(385555),j=n(646735),K=n(272014),z=n(206258),q=n(584076),H=n(731278),G=n(776798),W=n(224813),$=n(277907);const Y={PagePreview:new $.Ss("PagePreview",(async()=>await Promise.all([n.e(62743),n.e(44832),n.e(65496),n.e(46910)]).then(n.bind(n,121806))))},Q=(0,$.kF)(Y.PagePreview,(e=>e.PagePreview));function J(e,t){const{store:n,disabled:m,style:f}=e,h=(0,i.O7)(),[_,k]=(0,o.useState)(!1),w=(0,N.PE)(n,m),x=(0,N.rv)(n),I=(0,s.Fg)(),C=(0,o.createRef)(),T=(0,o.createRef)(),A=(0,o.useRef)(null);(0,o.useEffect)((()=>()=>{b.qA(n.getTitleStore())}),[n]);const R=(0,o.useCallback)((()=>{const e=n.getAliasTargetStore();if(!(C&&C.current&&e instanceof z.G))return;const t=r.findDOMNode(C.current);return(0,F.We)(e,t)}),[C,n]),j=(0,o.useCallback)((e=>{const t=R(),o=n.getTitleStore();o&&t&&y.Nh({environment:h,event:e,interactiveToken:t,store:o,canEdit:w})}),[h,n,w,R]),K=(0,o.useCallback)((e=>{const t=R(),o=n.getTitleStore();o&&t&&y.Zl({environment:h,event:e,interactiveToken:t,store:o,canEdit:w})}),[h,n,w,R]),$=(0,o.useCallback)((()=>k(!0)),[]),Y=(0,o.useCallback)((()=>k(!1)),[]),J=(0,o.useContext)(E.ZO),X=(0,o.useCallback)((()=>{if(J){const e=(0,U.ZP)({store:n,pageVisitSource:l.tY.LinkInPage});J(e)}else v._c({environment:h,store:n,visitType:Z.vu.Link,pageVisitSource:l.tY.LinkInPage})}),[h,n,J]),ee=(0,o.useMemo)((()=>({renderedType:"alias",getBlockStore:()=>n,activate:X,getNode:()=>A.current})),[n,X]),oe=(0,s.yK)((e=>({noAccessWrapper:{border:`1px solid ${e.darkDividerColor}`,borderRadius:4}})),[]),re=(0,a.VK)((()=>{const e=n.getAliasTargetStore(),t=n.getFormat().alias_page_preview;if(!e)return;if(e instanceof z.G)return e.isType("form")&&L.default.checkGate({gateName:"forms_embed"})?(0,M.jsx)(P,{store:e}):(0,M.jsx)(S.p,{allowSelectionWithin:!1,onMouseOver:j,onMouseOut:K,ref:A,children:t?(0,M.jsx)(Q,{store:e,style:{...x,...f},isAlias:!0,aliasStore:n,disabled:m,onClick:()=>te(n,h)}):(0,M.jsx)(W.Z,{ref:C,store:e,style:{...x,...f},isAlias:!0,aliasStore:n,disabled:m,onClick:()=>te(n,h)})});if("none"===e.getRole())return(0,M.jsx)(S.p,{allowSelectionWithin:!1,ref:A,children:(0,M.jsx)("div",{style:oe.noAccessWrapper,children:(0,M.jsx)(q.Z,{ref:T,style:{width:"100%"},onMouseEnter:$,onMouseLeave:Y,children:(0,M.jsxs)("div",{style:{display:"flex",padding:9},children:[O({width:30,height:30,marginRight:10,marginLeft:5}),(0,M.jsxs)("div",{style:{fontSize:14},children:[(0,M.jsx)("div",{style:{fontWeight:g.Z.fontWeight.medium},children:(0,M.jsx)(p.FormattedMessage,{defaultMessage:"No access to page comments",id:"aliasBlock.comment.noAccess.title"})}),(0,M.jsx)(p.FormattedMessage,{defaultMessage:"You don't have permission to view this page and its comments",id:"aliasBlock.comment.noAccess.subtitle"})]})]})})})});const o=V.Dg(e);if(!o||!e.isDefined())return(0,M.jsx)(ne,{});const r=z.t1.createChildStore(o,{table:d.qF,id:e.getParentId(),spaceId:(0,u.C)(o.pointer.spaceId)});if(null==r||!r.isDefined())return;const i=r.getModel(),a=z.G.createChildStore(o,i.getParentPointer()).getModel(),s=a&&"table_row"===a.getType()?a.getParentId():i.getParentId(),v=z.t1.createChildStore(o,{table:c.iU,id:s,spaceId:(0,u.C)(o.pointer.spaceId)});if(!v.isDefined())return;const y=o.isDefined()?v.getModel().getRenderUrl({getRecordModel:n.getRecordModel,baseUrl:B.default.domainBaseUrl,discussionId:r.id,pageVisitSource:l.tY.LinkInPage}):void 0;return(0,M.jsx)(S.p,{allowSelectionWithin:!1,ref:A,children:(0,M.jsx)("div",{style:{border:`1px solid ${I.darkDividerColor}`,cursor:"pointer",borderRadius:4},children:(0,M.jsxs)(q.Z,{ref:T,style:{display:"flex",flexDirection:"column"},href:y,onMouseEnter:$,onMouseLeave:Y,children:[(0,M.jsx)("div",{style:{display:"flex",pointerEvents:"none"},children:(0,M.jsx)(D.LazyComment,{store:e,discussionStore:r,showResolveButtonByDefaultIfPossible:!1,blockStore:n,hoveringDiscussion:!1,discussionLocation:"comment_unfurl",collapsed:!0,maxLines:2,shouldShowThreadLine:!1,discussionContext:"suggestion"===r.getType()&&(0,M.jsx)(D.LazySuggestionContext,{discussionStore:r,collapsed:!0})},e.id)}),o&&(0,M.jsxs)("div",{style:{display:"flex",alignItems:"center",paddingLeft:"42px",marginBottom:"10px"},children:[(0,M.jsx)(H.Z,{disabled:!0,icon:o.getIcon(),isEmptyPage:o.isEmptyPage(),size:14,style:{marginLeft:2,marginRight:2}}),(0,M.jsx)(G.Z,{store:o,style:{color:"gray",fontSize:"smaller"}})]})]})})})}),[n,I.darkDividerColor,_,T,$,Y,j,K,x,f,m,C,oe.noAccessWrapper,h]);return(0,N.ez)(n,t,ee,re)}const X=o.memo(o.forwardRef(J),m.Z);function ee(e){let{style:t}=e;const n=(0,s.Fg)();return(0,M.jsx)("div",{style:{overflow:"hidden",position:"relative",background:n.selectLightGray[30],...t},children:(0,M.jsx)("div",{style:{position:"absolute",height:"100%",width:"100%",zIndex:1,animation:"shimmer 1s infinite",background:`linear-gradient(to right, ${n.selectLightGray[30]} 0%, ${n.selectLightGray[50]} 20%, ${n.selectLightGray[30]} 40%, ${n.selectLightGray[30]} 100%)`}})})}function te(e,t){h.Se(t),j.Z.recordVisit({id:e.id,systemBlockType:e.getSystemBlockTypeStore().getValue(),type:Z.vu.Link,currentUserId:t.currentUser.id}),f.SK(t,{page_visit_id:K.$g.getCurrentPageVisitId(),mentioned_page_id:e.id,source_type:"alias_block",hover_preview_enabled:!0,is_navigable_block:e.isNavigableBlock()})}function ne(){return(0,M.jsxs)(q.Z,{external:!0,style:{flexGrow:1,minWidth:0},children:[(0,M.jsx)(ee,{style:{width:38,height:38}}),(0,M.jsxs)("div",{style:{display:"flex",flexDirection:"column",flexGrow:1},children:[(0,M.jsx)(ee,{style:{width:"50%",height:14,margin:4}}),(0,M.jsx)(ee,{style:{width:"40%",height:12,margin:4}})]})]})}},977933:(e,t,n)=>{n.d(t,{Z:()=>U});var o=n(667294),r=n(800480),i=n(886628),a=n(749085),s=n(709291),l=n(143976),c=n(464939),d=n(724405),u=n(815145),p=n(137810),m=n(484210),g=n(367669),f=n(918514),h=n(317105),v=n(80444),y=n(584076),b=n(731278),_=n(776798),S=n(994096),k=n(78454),w=n(32469),x=n(785893);const I=function(e){let{currentBlockStore:t,backlinkStore:n,scrollToBlockId:o,discussionId:a,showOriginalToken:l,disableCurrentPageToken:c,disableArrow:p}=e;const h=(0,d.Fg)(),b=(0,r.O7)(),w=(0,i.VK)((()=>!(0,g.yi)(b,t)&&(0,g.yi)(b,n)),[b,t,n]),I=(0,i.VK)((()=>v.default.state.mainEditorCurrentBlockStore),[]),R=I&&I.id===n.id,D=(0,i.VK)((()=>(0,m.ZP)({store:n,scrollToBlockId:o,discussionId:a,fullyQualified:!0,preferPublicLink:(0,f.Sr)(b),pageVisitSource:u.tY.LinkInPage})),[n,o,a,b]);return(0,x.jsx)(y.Z,{href:D,external:!1,innerStyle:{paddingLeft:8,paddingRight:16},children:(0,x.jsx)(k.ZP,{childrenStyle:{padding:"4px 2px"},alignment:k.v2.Center,style:{marginBottom:2,marginRight:4},right:(0,x.jsxs)(x.Fragment,{children:[l&&(0,x.jsx)("div",{style:M(b,h),children:(0,x.jsx)(s.FormattedMessage,{defaultMessage:"Original",id:"backlink.originalTokenLabel"})}),R&&!c&&(0,x.jsx)("div",{style:M(b,h),children:(0,x.jsx)(s.FormattedMessage,{defaultMessage:"This page",id:"backlink.currentPageTokenLabel"})})]}),children:(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[!p&&(0,x.jsx)(P,{}),(0,x.jsx)(C,{backlinkStore:n}),(0,x.jsx)(_.Z,{store:n,style:T(h)}),(0,x.jsxs)("div",{style:{marginTop:-2,minWidth:0,display:"flex",alignItems:"baseline",flex:"2 0 40%",paddingTop:"0.1em"},children:[(0,x.jsx)(S.Z,{store:n,style:{paddingLeft:8}}),(0,x.jsx)(A,{isPrivate:w})]})]})})})};function C(e){let{backlinkStore:t}=e;const n=(0,i.VK)((()=>t.getIcon()),[t]),o=(0,i.VK)((()=>t.isEmptyPage()),[t]);return(0,x.jsx)(b.Z,{disabled:!0,icon:n,isEmptyPage:o,size:20,style:{marginLeft:4,marginRight:4}})}function T(e){return{fontWeight:p.Z.fontWeight.medium,fontSize:p.Z.fontSize.UIRegular.desktop,lineHeight:1.3,borderBottom:`1px solid ${e.darkDividerColor}`,flexShrink:1}}function M(e,t){const{device:n}=e;return{padding:"2px 6px",borderRadius:4,color:t.mediumTextColor,background:t.legacyDefaultSelectColor,fontSize:n.isMobile?11:9,lineHeight:n.isAndroid?1.5:1,textTransform:"uppercase",letterSpacing:"0.04em",whiteSpace:"nowrap",marginLeft:4}}function P(){const e=(0,d.Fg)();return(0,x.jsx)("div",{style:{marginLeft:4,transform:"rotate(180deg)",fill:e.regularIconColor},children:(0,h.J)({width:15,height:15})})}function A(e){let{isPrivate:t}=e;return t?(0,x.jsx)(w.Z,{style:{paddingRight:4,marginLeft:12}}):null}var R=n(489728),D=n(526388),B=n(164369);const E=10,F=a.default.createClass(E,{name:"ShowMoreStore"}),Z=a.default.createClass(!1,{name:"HoveredStore"});const U=function(e){let{store:t,originalTransclusionStore:n,disableInaccessiblePages:a,headerText:d,disableArrow:u,disableCurrentPageToken:p}=e;const m=(0,r.O7)(),g=(0,i.qz)(void 0,Z),f=(0,i.qz)(void 0,F),h=(0,i.VK)((()=>(0,l.L)(t,m)),[t,m]),v=(0,o.useCallback)((()=>function(e){e.setState(e.state+E)}(f)),[f]),y=(0,o.useCallback)((()=>function(e){e.setState(!1)}(g)),[g]),b=(0,o.useCallback)((()=>function(e){e.setState(!0)}(g)),[g]),_=(0,i.VK)((()=>f.state),[f]),S=(0,i.VK)((()=>n?n.getNavigableBlockStore():void 0),[n]);if(0===h.backlinks.length&&!n)return null;const k=h.backlinks.length>_,w=h.inaccessibleBacklinkCount>0&&!a;return(0,x.jsxs)("div",{onMouseMove:b,onMouseLeave:y,children:[d&&(0,x.jsx)(V,{headerText:d}),n&&S&&(0,x.jsx)(I,{currentBlockStore:t,disableArrow:u,disableCurrentPageToken:p,backlinkStore:S,scrollToBlockId:n.id,showOriginalToken:!0}),h.backlinks.slice(0,_).map((e=>(0,x.jsx)(I,{currentBlockStore:t,disableArrow:u,disableCurrentPageToken:p,...e},e.backlinkStore.id))),(k||w)&&(0,x.jsx)(D.Z,{disableTooltip:k,renderTooltip:()=>(0,x.jsx)(s.FormattedMessage,{defaultMessage:"Synced in pages that you don't have access to.",id:"page.backlinks.privatePagesTooltip"}),render:e=>(0,x.jsx)(R.Z,{icon:c.o,isGray:!0,onClick:v,style:{padding:`2px ${u?17:14}px`,width:"100%"},disabled:!k,...e,children:k?(0,x.jsx)(s.FormattedMessage,{defaultMessage:"{count} more",id:"page.backlinks.more",values:{count:h.backlinks.length-_}}):(0,x.jsx)(s.FormattedMessage,{id:"page.backlinks.privatePages",defaultMessage:"{count, plural, one {{count} private page} other {{count} private pages}}",values:{count:h.inaccessibleBacklinkCount}})})})]})};function V(e){let{headerText:t}=e;return(0,x.jsx)("div",{style:{display:"flex"},children:(0,x.jsx)(B.Z,{isSmall:!0,style:{marginTop:12,marginBottom:8,marginLeft:4,flex:1,paddingLeft:8},children:t})})}},13966:(e,t,n)=>{n.d(t,{Z:()=>f});n(667294);var o=n(800480),r=n(724405),i=n(106404),a=n(524677),s=n(843250),l=n(98742),c=n(645803),d=n(385555),u=n(27724),p=n(164921),m=n(526388),g=n(785893);const f=function(e){let{tooltipContent:t,fadeIn:n,style:o,hoveredStyle:r,store:i,onClick:a,extraAnalyticsData:s,hideFilterActionsInput:l,actionSectionGroupKey:c,onFocus:d,onBlur:u,iconStyle:p,isFromCollectionView:f}=e;return t?(0,g.jsx)(m.Z,{renderTooltip:()=>t,delayThreshold:300,render:e=>(0,g.jsx)(v,{tooltipEvents:e,fadeIn:n,style:o,hoveredStyle:r,store:i,onClick:a,extraAnalyticsData:s,hideFilterActionsInput:l,actionSectionGroupKey:c,onFocus:d,onBlur:u,iconStyle:p,isFromCollectionView:f})}):(0,g.jsx)(v,{fadeIn:n,style:o,hoveredStyle:r,store:i,onClick:a,extraAnalyticsData:s,hideFilterActionsInput:l,actionSectionGroupKey:c,onFocus:d,onBlur:u,iconStyle:p,tooltipEvents:{},isFromCollectionView:f})};function h(e,t,n){const{device:o}=e;return{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:26,height:26,fill:o.isMobile?t.lightIconColor:t.mediumIconColor,transition:"opacity 200ms ease-in",...n}}function v(e){let{tooltipEvents:t,fadeIn:n,style:m,hoveredStyle:f,store:v,onClick:y,extraAnalyticsData:b,hideFilterActionsInput:_,actionSectionGroupKey:S,onFocus:k,onBlur:w,iconStyle:x,isFromCollectionView:I}=e;const C=(0,r.Fg)(),T=(0,o.O7)();return(0,g.jsx)(p.Z,{className:n?s.JiD:void 0,style:h(T,C,m),hoveredStyle:f,onClick:e=>function(e,t,n,o,r,s,l,c){a.Ys({environment:n,store:t}),i.Qn({environment:n,stores:u.default.state.stores,left:e.clientX,top:e.clientY,showInput:!s,actionSectionGroupKey:Boolean(c)&&d.default.checkGate({gateName:"db_comments"})?"block_in_collection":l||"default",analyticsFrom:"block_more_menu",optionalAnalyticsProperties:{isFromBulkActionsToolbar:r?r.isFromBulkActionsToolbar:void 0}}),null==o||o()}(e,v,T,y,b,_,S,I),...(0,l.Z)(t,{onFocus:k,onBlur:w}),children:(0,c.O)({width:16,height:16,...x})})}},391893:(e,t,n)=>{n.d(t,{Z:()=>S});n(667294);var o=n(800480),r=n(886628),i=n(724405),a=n(949271),s=n(709291),l=n(137810),c=n(988150),d=n(607709),u=n(249394),p=n(268056),m=n(224646),g=n(825464),f=n(924666),h=n(164921),v=n(526388),y=n(965187),b=n(785893);const _=(0,s.defineMessages)({imageCaption:{defaultMessage:"Write a caption…",id:"block.imageCaption.placeholder"},altText:{defaultMessage:"Add alt text",id:"block.imageCaption.altText.tooltip"}});function S(e){let{captionAriaId:t,disabled:n,store:S}=e;const k=(0,o.O7)(),w=(0,o.Fy)(),x=(0,s.useIntl)(),I=(0,r.VK)((()=>S.getPropertyStore("caption")),[S]),{shouldShowCaption:C,shouldShowAltTextButton:T}=(0,r.VK)((()=>{var e;const t=I.getValue(),n=!t||0===t.length,o="editing"===f.default.state.mode&&(null===(e=(0,p.QY)(f.default.state.multiSelection))||void 0===e?void 0:e.store)===I;return{shouldShowCaption:!n||o,shouldShowAltTextButton:o&&n&&"image"===S.getType()&&!S.getPropertyValue("alt_text")}}),[I,S]),M=(0,r.VK)((()=>{const{block_full_width:e,block_width:t,block_page_width:n}=S.getFormat();if(w.isMobile)return!1;if(n)return!1;if(e)return!0;const o=(0,d.fg)(k,S);return(t||0)>=k.WindowSizeStore.state.width-(0,m.Wk)(k)-(o&&S.isFullWidth()?d.QB:0)}),[w.isMobile,k,S]),P=(0,i.yK)((e=>({root:{fontSize:14,lineHeight:1.4,color:e.mediumTextColor,paddingTop:6,paddingBottom:6,paddingLeft:a.ZD.paddingLeft,...M&&{paddingLeft:26,paddingRight:26}},buttonWrapper:{position:"absolute",top:3.5,right:0,background:e.tint.regular,color:e.text.secondary,borderRadius:6,opacity:T?1:0,transition:w.isSafari?void 0:"opacity 300ms ease-in",overflow:"hidden"},button:{padding:"4px 6px",fontSize:12,fontWeight:l.Z.fontWeight.medium,letterSpacing:.2}})),[M,w.isSafari,T]);return C?(0,b.jsxs)("div",{style:{position:"relative"},children:[(0,b.jsx)(y.Z,{id:t,disabled:n,style:P.root,placeholderStyle:P.root,placeholder:x.formatMessage(_.imageCaption),disableSlashCommands:!0,disableEmbedMenu:!0,disableRightMarginHoverStyling:!0,store:I,pasteBehavior:"block",inPageFind:u.B3.block_match}),(0,b.jsx)("div",{style:P.buttonWrapper,children:(0,b.jsx)(v.Z,{renderTooltip:()=>x.formatMessage(_.altText),placement:g.u.Bottom,disableTooltip:!T,render:e=>(0,b.jsx)(h.Z,{...e,ariaLabel:x.formatMessage(_.altText),style:P.button,disabled:!T,onClick:()=>{c.b({blockStore:S,entrypoint:"caption",environment:k})},children:"ALT"})})})]}):null}},541216:(e,t,n)=>{n.d(t,{Z:()=>f});var o=n(667294),r=n(800480),i=n(724405),a=n(531701),s=n(137810),l=n(880025),c=n(433929),d=n(485103),u=n(552275),p=n(58261),m=n(785893);function g(e,t){const n=(0,r.Fy)(),{color:g,overrideDisplayName:f,right:h,shortcuts:v,selected:y}=e,b=f||c.default.formatMessage((0,l.qf)(g)),_=!n.isMobile&&v&&v[0],S=(0,i.yK)((e=>({icon:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,textAlign:"center",fontSize:16,borderRadius:4,fontWeight:s.Z.fontWeight.medium,boxShadow:e.innerBorderBoxShadow,...(0,a.fi)(g,e)},selected:{width:16,padding:"1px 1px"},shortcut:{color:e.lightTextColor,fontSize:12,whiteSpace:"nowrap"}})),[g]),k=(0,o.useCallback)((()=>(0,m.jsx)("div",{style:S.icon,"aria-hidden":"true",children:"A"})),[S.icon]);return(0,m.jsx)(u.Z,{...e,ref:t,title:b,icon:k(),dontShrinkRight:!0,right:h||_&&(0,m.jsx)(p.Z,{name:_,style:S.shortcut})||y&&(0,m.jsx)("div",{style:S.selected,children:(0,d.k)()})})}const f=o.forwardRef(g)},523864:(e,t,n)=>{n.d(t,{Z:()=>_});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(541432),l=n(133767),c=n(625487),d=n(607709),u=n(948514),p=n(478175),m=n(798165),g=n(224646),f=n(385555),h=n(206258),v=n(104029),y=n(831103),b=n(785893);function _(e){let{disableCommentMenu:t,hideContent:n,hideIfSidebarOrMarginCommentsVisible:_,recursivelyLoadAllDiscussions:S,store:k,property_id:w}=e;const x=(0,r.O7)(),I=(0,r.Fy)(),C=(0,i.VK)((()=>{const e=k.getModel();return Boolean(null==e?void 0:e.isType(s.eh))}),[k]),T=(0,i.VK)((()=>{const e=(0,m.qA)(k);let t,n,o,r;for(const i of e){if(i instanceof h.G&&t){const e=i.getType();if(e&&(0,s.S9)(e)&&i.id!==k.id)break;if("column_list"===e){const e=i.getContentStore().getValue()||[];n=e.indexOf(t.id),o=e.length,r=(0,p.Po)(i,x)}}t=i}return{columnListIndex:n,columnListColumnCount:o,columnListResizable:r}}),[x,k]),M=(0,o.useCallback)((()=>{if(!I.isMobile){if(void 0===T.columnListIndex)return c.I4.FloatRight;if(!T.columnListResizable&&T.columnListColumnCount&&T.columnListIndex===T.columnListColumnCount-1)return c.I4.FloatRight}return c.I4.PushContent}),[T.columnListColumnCount,T.columnListIndex,T.columnListResizable,I.isMobile]),P=(0,i.VK)((()=>(0,g.vK)(x)),[x]),A=(0,i.VK)((()=>(0,d.fg)(x,k)),[x,k]),{blockInsetRight:R}=(0,o.useContext)(v.a),D=(0,a.yK)((e=>({wrapper:M()===c.I4.FloatRight?{position:"relative",left:R}:{}})),[M,R]),B=(0,i.VK)((()=>"on"===f.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0})&&u.Z.getPropertyId()===w),[w]),E=t||n||(C||_)&&(P||A)||B&&P;return(0,b.jsx)(y.Z,{name:"BlockDiscussionIndicator",children:!E&&(0,b.jsx)("div",{style:D.wrapper,children:(0,b.jsx)(l.LazyDiscussionIndicator,{store:k,getFormat:M,recursivelyLoadAllDiscussions:Boolean(S),onlyCountBlockLevelDiscussions:P,property_id:w},"DiscussionIndicator")})})}},30994:(e,t,n)=>{n.d(t,{Q:()=>x,Z:()=>C});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(325666),l=n(709291),c=n(531701),d=n(847853),u=n(98742),p=n(818441),m=n(485103),g=n(825464),f=n(27724),h=n(915560),v=n(552275),y=n(973420),b=n(634406),_=n(974420),S=n(526388),k=n(760442),w=n(785893);let x=function(e){return e[e.Insert=0]="Insert",e[e.TurnInto=1]="TurnInto",e}({});function I(e,t){const n=(0,r.Fy)(),I=(0,r.O7)(),{description:C,format:T,selected:M,title:P,thumbnail:A,tooltipPhoto:R,thumbnailPadding:D,isDisabled:B,disabledTooltipMessage:E}=e,F=T===x.Insert,Z=(0,i.VK)((()=>!!B&&B({environment:I,blocks:f.default.state.stores,publicEditMode:void 0})),[I,B]),U=(0,a.yK)((e=>({thumbnail:{display:"block",width:F?46:22,height:F?46:22,borderRadius:4,flexGrow:0,flexShrink:0,padding:D||0,boxShadow:e.borderBoxShadow,background:c.ZP.white},selected:{width:16,padding:"1px 1px"},titleDiv:{display:"flex",alignItems:"center"}})),[F,D]),V=(0,o.useCallback)((()=>{const e=(0,d.D)(A)||s.T;return(0,w.jsx)(b.Z,{src:e,style:U.thumbnail})}),[A,U.thumbnail]),{badge:N,...O}=e,L=(0,o.useCallback)((e=>(0,w.jsx)(v.Z,{...(0,u.Z)(e||{},O),ref:t,right:M&&(0,w.jsx)("div",{style:U.selected,children:(0,m.k)()}),title:(0,w.jsxs)("div",{style:U.titleDiv,children:[(0,w.jsx)("span",{style:{marginRight:6},children:P}),!M&&"new"===N&&(0,w.jsx)(_.Z,{style:{marginLeft:0}}),!M&&"beta"===N&&(0,w.jsx)(h.Z,{}),!M&&"ai"===N&&(0,w.jsx)("div",{style:{color:c.FN.light.purple[500]},children:(0,w.jsxs)(y.X2,{gap:4,alignItems:"center",children:[(0,p.t)({fill:c.FN.light.purple[500],width:14,height:14}),(0,w.jsx)(l.FormattedMessage,{id:"blockMenuItem.aiBadge",defaultMessage:"AI"})]})})]}),icon:V(),caption:F&&C,disabled:Z,disabledFeedback:Z})),[O,t,M,U.selected,U.titleDiv,P,N,V,F,C,Z]),j=(0,o.useCallback)((()=>{if(Z)return(0,w.jsx)("div",{children:E});const e=R?(0,d.D)(R):void 0;return(0,w.jsx)(k.Z,{imageURL:e,imageWidth:e?140:void 0,imageHeight:100,caption:C})}),[Z,R,C,E]);return n.isMobile?L():(0,w.jsx)(S.Z,{renderTooltip:j,placement:g.u.Right,delayThreshold:0,render:e=>L(e)})}const C=o.forwardRef(I)},104029:(e,t,n)=>{n.d(t,{a:()=>o});const o=(0,n(667294).createContext)({blockInsetRight:0});o.displayName="BlockRenderingContext"},370518:(e,t,n)=>{n.d(t,{IS:()=>P,ZP:()=>R,bZ:()=>A});n(21703);var o=n(667294),r=n(800480),i=n(886628),a=n(541432),s=n(895538),l=n(653965),c=n(288864),d=n(496802),u=n(524677),p=n(210228),m=n(721429),g=n(843250),f=n(177546),h=n(58202),v=n(849427),y=n(568859),b=n(206258),_=n(891681),S=n(27724),k=n(706685),w=n(785893);const x={[a.Ti.image]:36,[a.Ti.audio]:24,[a.Ti.video]:96,[a.Ti.embed]:96,[a.Ti.drive]:96,[a.Ti.tweet]:96,[a.Ti.framer]:96,[a.Ti.maps]:96,[a.Ti.gist]:96,[a.Ti.invision]:96,[a.Ti.pdf]:96,[a.Ti.drawing]:200},I={[a.Ti.image]:36,[a.Ti.video]:96,[a.Ti.embed]:246,[a.Ti.maps]:96,[a.Ti.framer]:96,[a.Ti.tweet]:250,[a.Ti.gist]:96,[a.Ti.audio]:96,[a.Ti.drive]:300,[a.Ti.invision]:96,[a.Ti.pdf]:96,[a.Ti.columnList]:"page_width",[a.Ti.drawing]:300},C={display:"contents"},T=96,M=96;let P=function(e){return e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.Corner=2]="Corner",e}({}),A=function(e){return e[e.Left=0]="Left",e[e.Right=1]="Right",e}({});const R=function(e){const t=(0,o.useRef)(void 0),n=(0,r.O7)(),m=(0,o.useRef)(null),x=(0,i.qz)(e.blockResizerStore,y.Z),I=(0,o.useCallback)((o=>{o.preventDefault();const r=e.resizeComponent.getNode();if(!(r&&r instanceof Element))return;let i=0;if(m.current){const e=(0,f.VW)(m.current);e&&(i=e.getBoundingClientRect().width)}let s=0;const c=e.store.getRecordStoreUIParent(),d=c&&c.findRecordStoreUIAncestor((e=>e instanceof b.G)).ancestor;if(d){const e=h.R.getRect(d);e&&(s=e.width);const t=d.getRecordStoreUIParent(),n=t&&t.findRecordStoreUIAncestor((e=>e instanceof b.G)).ancestor;if("tab"===(null==n?void 0:n.getType())){const e=h.R.getRect(n);e&&(s=e.width)}}const p=function(e){const t=e.getRecordStoreUIRoot(),n=v.Z.find((e=>e.props.store===t));if(n)return n.getContentInnerWidth()}(e.store)||0,g=S.default.state.stores.filter((e=>function(e){const t=e&&e.getType();return t&&a.Ok[t]}(e)));let y;y=l.q9(g,e.store)?g:[e.store];const{block_width:k,block_height:w,block_full_width:I,block_page_width:C}=e.store.getFormat();x.setState({...x.state,dragging:!0,temporaryHeight:w,temporaryWidth:k,temporaryFullWidth:I,temporaryPageWidth:C}),_.Z.setState({..._.Z.state,isResizing:!0}),u.ZH({environment:n});const T=r.getBoundingClientRect();t.current={resizingBlocks:y,startWidth:T.width,startHeight:T.height,parentWidth:s,pageWidth:p,isRootChild:e.store.isChildOfRecordStoreUIRoot(),startScrollerWidth:i,didDragMove:!1}}),[x,n,e.resizeComponent,e.store]),T=(0,o.useCallback)((o=>{let{diffX:r}=o;if(!t.current)return;t.current.didDragMove=!0;const{temporaryHeight:i}=x.state,{width:a,isFullWidth:l,isPageWidth:c}=E({diffX:r,dragState:t.current,resizeHorizontally:e.resizeHorizontally,store:e.store,resizerAlignment:e.resizerAlignment,environment:n});if(e.preserveScale){const e=l?i||s.QA:i;x.setState({...x.state,temporaryWidth:a,temporaryFullWidth:l,temporaryPageWidth:c,temporaryHeight:e})}else x.setState({...x.state,temporaryWidth:a,temporaryFullWidth:l,temporaryPageWidth:c})}),[x,n,e.preserveScale,e.resizeHorizontally,e.resizerAlignment,e.store]),M=(0,o.useCallback)((n=>{let{diffY:o}=n;if(!t.current)return;t.current.didDragMove=!0;const{height:r}=D({diffY:o,dragState:t.current,resizeVertically:e.resizeVertically,store:e.store});x.setState({...x.state,temporaryHeight:r})}),[x,e.resizeVertically,e.store]),A=(0,o.useCallback)((o=>{let{diffX:r,diffY:i}=o;if(!t.current)return;t.current.didDragMove=!0;const{width:a,isFullWidth:s,isPageWidth:l}=E({diffX:r,resizeHorizontally:e.resizeHorizontally,store:e.store,resizerAlignment:e.resizerAlignment,dragState:t.current,environment:n}),{height:c}=D({diffY:i,dragState:t.current,resizeVertically:e.resizeVertically,store:e.store});x.setState({...x.state,temporaryWidth:a,temporaryHeight:c,temporaryFullWidth:s,temporaryPageWidth:l})}),[x,n,e.resizeHorizontally,e.resizeVertically,e.resizerAlignment,e.store]),R=(0,o.useCallback)((t=>e.resizerType===P.Horizontal?T(t):e.resizerType===P.Vertical?M(t):e.resizerType===P.Corner?A(t):void 0),[A,T,M,e.resizerType]),B=(0,o.useCallback)((()=>{x.setState({...x.state,dragging:!1,temporaryPageWidth:void 0,temporaryFullWidth:void 0,temporaryWidth:void 0,temporaryHeight:void 0}),u.ZH({environment:n}),_.Z.setState({..._.Z.state,isResizing:!1}),t.current=void 0}),[x,n]),F=(0,o.useCallback)((o=>{if(!t.current)return;const r=x.state;if(t.current.didDragMove&&r.dragging){const{temporaryPageWidth:o,temporaryFullWidth:r,temporaryWidth:i,temporaryHeight:a}=x.state;p.createAndCommit({userAction:"BlockResizer.handleDragEnd",environment:n,perform:e=>{t.current&&d.FH({stores:t.current.resizingBlocks,update:{block_height:a,block_width:i,block_full_width:r,block_page_width:o},transaction:e})}});const s=e.store.getType();s&&c.Wl(n,{block_type:s,block_height:a,block_width:i,block_full_width:r,block_page_width:o})}B()}),[x,B,n,e.store]);return(0,w.jsx)(k.Z,{onDraggableDragStart:I,onDraggableDragMove:R,onDraggableDragEnd:F,onDraggableDragCancel:B,preventSidebar:!0,render:t=>(0,w.jsx)("div",{ref:m,style:C,className:g.Ep8,...t,children:e.children})})};function D(e){const t=function(e){const{dragState:t,diffY:n,resizeVertically:o,store:r}=e;if(t){if(o){const e=r.getType(),o=e&&x[e]||T;return Math.max(t.startHeight+n,o)}return t.startHeight}return 0}(e);return{height:Math.min(t,s.Kz)}}function B(e){const{dragState:t,resizeHorizontally:n,store:o,resizerAlignment:r}=e;let i=e.diffX;if(!t)throw new Error("No start rect.");(function(e){const t=e.getModel();return e.isChildOfRecordStoreUIRoot()&&(null==t?void 0:t.isType(a.ib))})(o)&&(i*=2);let s=t.startWidth;n&&(r===A.Left?s-=i:r===A.Right&&(s+=i));const l=o.getType(),c=l&&I[l]||M,d="page_width"===c?Math.min(t.parentWidth,t.pageWidth):c;return d&&s<d&&(s=d),s}function E(e){const{dragState:t,store:n,environment:o}=e,r=B(e),i=r<144?12:48;const s=Math.round(r/i)*i,l=function(e,t,n){if(e)return e.isRootChild?e.pageWidth<t+n&&e.pageWidth>t-n:e.parentWidth<t+n;return!1}(e.dragState,r,i),c=function(e){const{dragState:t,width:n,round:o,environment:r,store:i}=e;if(t&&t.isRootChild){let e=t.startScrollerWidth;const s=i.getModel();return s&&!s.isType(a.GP)&&(e-=2*(0,m.ui)(r)),e<n+o}return!1}({dragState:t,width:r,round:i,environment:o,store:n})&&!l;return{width:s,isFullWidth:c,isPageWidth:l}}},7825:(e,t,n)=>{n.d(t,{Z:()=>_});var o=n(667294),r=n(886628),i=n(724405),a=n(949271),s=n(222491),l=n(709291),c=n(926249),d=n(249394),u=n(433929),p=n(99340),m=n(523864),g=n(630915),f=n(78454),h=n(965187),v=n(785893);const y=(0,l.defineMessages)({listPlaceholder:{defaultMessage:"List",id:"bulletedListBlock.placeholder.label"}});function b(e,t){const n=(0,o.useRef)(null),l=(0,r.VK)((()=>{var t;const n=null===(t=e.bulletedListFormatStore)||void 0===t?void 0:t.getState();return function(e,t){switch(e){case"disc":return'"•"';case"circle":return'"◦"';case"square":return'"▪"';default:return t%3==0?'"•"':t%3==1?'"◦"':'"▪"'}}(null==n?void 0:n.blockIdFormats.get(e.store.id),(null==n?void 0:n.depth)||0)}),[e.bulletedListFormatStore,e.store.id]),c=(0,r.VK)((()=>e.store.getBlockTitleStore()),[e.store]),b=(0,r.VK)((()=>e.store.getContentStore()),[e.store]),_=(0,p.rv)(e.store,!0),S=(0,r.VK)((()=>Boolean(e.store.getInsertSuggestion())),[e.store]),k=(0,i.yK)((t=>({root:{...{paddingLeft:a.ZD.paddingLeft},..._,...e.style},titlePlaceHolder:{...S?{color:t.text.uiBlueTertiary,WebkitTextFillColor:"initial"}:{}}})),[_,S,e.style]),w=(0,v.jsxs)(f.ZP,{style:k.root,left:(0,v.jsx)("div",{...(0,s.iv)({fontSize:"1.5em",lineHeight:1,marginBottom:0,pseudoBefore:{fontFamily:"Arial",content:l}})}),childrenStyle:{display:"flex",flexDirection:"column"},ref:n,children:[(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)(h.Z,{style:f.R8,disabled:e.disabled,store:c,placeholder:u.default.formatMessage(y.listPlaceholder),placeholderStyle:k.titlePlaceHolder,pasteBehavior:"block",legacyTransclusionParentStore:e.legacyTransclusionParentStore,inPageFind:d.B3.block_match,renderWhiteSpaceWhenEmptyOnAndroid:!0}),(0,v.jsx)(m.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store})]}),!e.hideContent&&(0,v.jsx)(g.Z,{disabled:e.disabled,store:b,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,disableDrag:e.disableDrag,bulletedListFormatStore:e.bulletedListFormatStore})]});return(0,p.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"bulleted_list",getNode:()=>n.current,getBlockStore:()=>e.store})),[e.store]),w)}const _=o.memo(o.forwardRef(b),c.Z)},27755:(e,t,n)=>{n.d(t,{y:()=>q,Z:()=>W});n(757658);var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(102647),l=n(709291),c=n(531701),d=n(653965),u=n(926249),p=n(401898),m=n(137810),g=n(524677),f=n(898104),h=n(793174),v=n(241301),y=n(100246),b=n(849117),_=n(433929),S=n(98742),k=n(99340),w=n(135314),x=n(563474),I=n(607155),C=n(756903),T=n(825464),M=n(749085);class P extends M.default{getInitialState(){return{editing:!1,suppressErrorsForActionIds:[]}}startEditing(e){this.setState({editing:!0,suppressErrorsForActionIds:[],placement:e.placement})}stopEditing(){this.setState({editing:!1,suppressErrorsForActionIds:[]})}suppressErrorsForAction(e){this.setState({...this.state,suppressErrorsForActionIds:d.jj([...this.state.suppressErrorsForActionIds,e])})}}const A=P;var R=n(206258),D=n(897630),B=n(13966),E=n(523864),F=n(668709),Z=n(573063),U=n(568785),V=n(863296),N=n(731278),O=n(526388),L=n(159557),j=n(633831),K=n(785893);const z=function(){const e=(0,a.yK)((e=>({settingsIcon:{fill:e.mediumIconColor},notificationBadge:{fill:e.blueColor,stroke:e.buttonBackground}})),[]);return(0,K.jsxs)(j.Z,{className:"settingsIconWithNotificationBadge",viewBox:"0 0 16 16",style:{width:16,height:16},children:[(0,K.jsx)("path",{d:"M6.406 15.36c-.492 0-.867-.299-.978-.762l-.24-1.037-.159-.059-.902.557c-.404.258-.885.193-1.23-.152l-.82-.82c-.347-.346-.411-.827-.153-1.231l.562-.896-.058-.147-1.032-.24a.981.981 0 01-.761-.979V8.44c0-.48.293-.861.761-.979l1.02-.246.064-.152-.562-.897c-.258-.404-.193-.878.152-1.236l.82-.82a.972.972 0 011.231-.153l.902.551.165-.064.24-1.037c.111-.463.486-.762.978-.762H7.59c.486 0 .867.299.978.762l.24 1.037.165.064.902-.55c.404-.252.885-.188 1.225.152l.82.82c.346.358.41.832.152 1.236l-.556.897.058.152 1.026.246a.981.981 0 01.761.979v1.154c0 .48-.304.862-.761.979l-1.037.24-.053.146.556.897c.258.404.2.885-.152 1.23l-.82.82c-.34.346-.82.41-1.23.153l-.903-.557-.152.059-.24 1.037a.972.972 0 01-.98.762H6.407zm.14-1.06h.903c.1 0 .147-.042.158-.136l.352-1.44c.387-.089.72-.235 1.008-.417l1.265.78c.07.046.141.04.217-.03l.621-.627c.065-.058.065-.129.018-.205l-.773-1.265a3.85 3.85 0 00.404-.997l1.447-.345c.088-.018.135-.065.135-.164v-.88c0-.105-.041-.146-.135-.17l-1.441-.34a3.878 3.878 0 00-.405-1.007l.774-1.26c.053-.082.053-.152-.018-.216l-.627-.616c-.07-.07-.129-.076-.217-.029l-1.26.768a3.782 3.782 0 00-1.013-.41L7.607 3.84c-.011-.093-.058-.134-.158-.134h-.902c-.1 0-.147.046-.164.134l-.346 1.442a4.07 4.07 0 00-1.02.416l-1.26-.768c-.087-.047-.146-.035-.222.03l-.62.615c-.071.07-.071.14-.019.222l.774 1.26a3.94 3.94 0 00-.399 1.008l-1.447.34c-.088.023-.129.064-.129.17v.879c0 .1.041.146.13.164l1.446.345c.088.37.247.721.41.997l-.779 1.265c-.052.076-.047.147.018.211l.621.621c.076.07.147.076.217.03l1.265-.78a3.35 3.35 0 001.014.416l.346 1.441c.017.088.064.135.164.135zm.452-3.071a2.233 2.233 0 01-2.227-2.227c0-1.212 1.008-2.214 2.227-2.214a2.23 2.23 0 012.22 2.214 2.232 2.232 0 01-2.22 2.227zm0-1.002c.656 0 1.201-.557 1.201-1.225 0-.662-.545-1.207-1.2-1.207a1.22 1.22 0 00-1.22 1.207c0 .674.551 1.225 1.22 1.225z",...e.settingsIcon}),(0,K.jsx)("circle",{cx:"12",cy:"4",r:"3.5",...e.notificationBadge})]})},q=(0,l.defineMessages)({addIconButtonAriaLabel:{defaultMessage:"Add icon",id:"buttonBlock.button.addIconButtonAriaLabel"},editButtonAriaLabel:{defaultMessage:"Edit button",id:"buttonBlock.button.editButtonAriaLabel"},buttonPlaceholder:{defaultMessage:"New button",id:"buttonBlock.button.placeholder"},buttonInsufficientPermissions:{defaultMessage:"You don’t have permission to run this button",id:"buttonBlock.button.insufficientPermissions"},clickToEdit:{defaultMessage:"Click to edit button",id:"buttonBlock.button.clickToEdit"}});function H(e,t){const{store:n}=e,a=(0,i.qz)(void 0,A),s=(0,r.O7)(),[l,c]=(0,w.e)(),d=(0,o.useRef)(null),u=(0,i.VK)((()=>!n.canEdit()||e.disabled),[n,e.disabled]),p=(0,i.VK)((()=>n.getAutomationPointer()),[n]);(0,y.N)(n,p);const m=(0,o.useCallback)((e=>{var t;f.clear({environment:s}),g.ZH({environment:s});(c||(null===(t=l.current)||void 0===t?void 0:t.getBoundingClientRect().width)||0)<300&&!s.device.isPhone&&e?a.startEditing({placement:{type:"popup",originRect:e}}):a.startEditing({placement:{type:"inline"}})}),[a,l,c,s]),v=(0,K.jsxs)(F.p,{allowSelectionWithin:!0,style:{display:"flex"},ref:l,children:[(0,K.jsxs)("div",{style:{flexGrow:1,flexShrink:1,minWidth:0},children:[(0,K.jsx)(G,{store:n,buttonBlockStore:a,onConfigure:m,ref:d,disabledFromEditing:u}),(0,K.jsx)(h.On,{store:n,disabled:u,buttonBlockStore:a})]}),(0,K.jsx)(E.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store,recursivelyLoadAllDiscussions:!0})]});return(0,k.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"button",getNode:()=>l.current,getBlockStore:()=>e.store,activate(){var e;null===(e=d.current)||void 0===e||e.activate()},handleCreated(){var e;m(null===(e=d.current)||void 0===e?void 0:e.getBoundingClientRect())}})),[l,m,e.store]),v)}const G=o.forwardRef((function(e,t){const{store:n,buttonBlockStore:u,onConfigure:y,disabledFromEditing:w}=e,M=(0,l.useIntl)(),P=(0,r.O7)(),{isMobile:A}=(0,r.Fy)(),[E,F]=(0,o.useState)(!1),[j,H]=(0,o.useState)(!1),G=(0,i.VK)((()=>n.getAutomationStore()),[n]),W=(0,i.VK)((()=>(null==G?void 0:G.getNameStore().getValue())??""),[G]),$=(0,i.VK)((()=>n.getFormat().block_color||"default"),[n]),Y=(0,i.VK)((()=>(0,D.M_)(P)),[P]),Q=(0,c.p6)($,(0,a.Fg)()),J=Q.background,X=Q.color,ee=Q.hoveredBackground,te=Q.pressedBackground,ne=(0,i.VK)((()=>null==G?void 0:G.getIconStore().getValue()),[G]),oe=function(e){const{store:t,automationStore:n,buttonBlockStore:o}=e,a=function(e){const{store:t,automationStore:n}=e,o=(0,r.O7)(),a=o.currentUser.id;return(0,i.VK)((()=>{const e=t.getRecordStoreUIRoot();if(n&&e instanceof R.G)return(0,b.Gb)({type:"button_block",automationStore:n,blockStore:t,pageStore:e,intl:_.default.getIntl(),parentRecordStore:n,currentUserId:a})}),[n,t,a])}({store:t,automationStore:n});return(0,i.VK)((()=>{const e=null==a?void 0:a.state;if(!e)return{type:"disabled"};if("unknown"===e.executionPermissionStatus)return{type:"disabled",tooltip:q.buttonInsufficientPermissions};if("insufficient"===e.executionPermissionStatus){if("insufficient"===e.editPermissionStatus)return{type:"disabled",tooltip:q.buttonInsufficientPermissions};{var t;const n=(null===(t=e.typecheckResult)||void 0===t?void 0:t.value.actionValidationFailures)??{},o=Object.values(n).flatMap((e=>e)).find((e=>!1===(null==e?void 0:e.execute))),r=o?(0,v.Fp)(o):void 0;return{type:"disabled",tooltip:(null==r?void 0:r.forButtonTooltip)??q.buttonInsufficientPermissions,subtitleTooltip:null==r?void 0:r.forButtonSubtitleTooltip}}}if("sufficient"===e.executionPermissionStatus){if(0===((null==n?void 0:n.getActionIds())??[]).length)return{type:"error",tooltip:v.Mm.noActions,hideErrorIconWhenEditorIsOpen:!0};const t=e.typecheckResult.value.actionValidationFailures,r=Object.entries(t).filter((e=>{let[t]=e;return!o.state.suppressErrorsForActionIds.includes(t)})).flatMap((e=>{let[,t]=e;return t})),i=d.Ps(r);if(i)return{type:"error",tooltip:(0,v.Fp)(i).forButtonTooltip};return{type:"enabled",urlToPreview:(0,b.JS)(n)}}(0,p.t1)(e)}),[a,n,o])}({store:n,automationStore:G,buttonBlockStore:u}),re=(0,k.cR)(n),ie=(0,k.xb)(n),ae=!Y||re||ie||"disabled"===oe.type||E||"error"===oe.type&&w,se=(0,i.VK)((()=>"error"===oe.type&&!(oe.hideErrorIconWhenEditorIsOpen&&u.state.editing)),[oe,u]),{showFactoryButtonDeprecationBadge:le,setHasSeenFactoryButtonDeprecationBadge:ce}=(0,L.N)({blockStore:n}),de=(0,a.yK)((e=>{const t=A?"52px":"28px";return{wrap:{display:"flex",alignItems:"center",padding:"2px 0"},configureWrap:{display:"flex",alignItems:"center",marginLeft:4},label:{pointerEvents:"none",color:X,...m.Z.textOverflowStyle},button:{display:"flex",gap:6,minWidth:50,maxWidth:`calc(100% - ${t})`,padding:"8px 12px",fontWeight:500,...ae?{cursor:"not-allowed"}:{}},labelPlaceholder:{color:e.lightTextColor},warningIcon:{width:16,height:16,fill:e.errorText,color:e.errorText},spinnerWrap:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",marginLeft:-4}}}),[ae,A,X]),ue=(0,x.D)(),pe=(0,o.useRef)(null),me=(0,o.useCallback)((()=>{H(!0)}),[]),ge=(0,o.useCallback)((()=>{H(!1)}),[]),fe=(0,o.useCallback)((()=>{var e;y(null===(e=pe.current)||void 0===e?void 0:e.getBoundingClientRect())}),[y,pe]),he=(0,o.useCallback)((()=>{Y||(0,D.ne)(),u.state.editing?(u.stopEditing(),(0,s.lN)(ue,{block_id:n.id,automation_id:null==G?void 0:G.id})):(fe(),ce(),(0,s.yK)(ue,{block_id:n.id,automation_id:null==G?void 0:G.id}))}),[u,ue,n.id,null==G?void 0:G.id,fe,ce,Y]),ve=(0,i.VK)((()=>{const e=n.getRecordStoreUIRoot();if(!(G&&e instanceof R.G))return;const t=e.isPageBlock()?e:void 0;return{automationStore:G,blockStore:n,currentUserId:P.currentUser.id,intl:_.default.getIntl(),pageStore:t,parentRecordStore:G,type:"button_block"}}),[G,P.currentUser.id,n]),ye=(0,o.useCallback)((async()=>{if(ve)if(f.clear({environment:P}),g.ZH({environment:P}),"error"===oe.type)w||fe();else if("enabled"===oe.type)try{F(!0);const{automationExecutionActions:e}=await h._1.load();await e.executeClientAutomation({clientContext:ve,environment:P})}finally{F(!1)}else"disabled"===oe.type||(0,p.t1)(oe)}),[P,oe,w,fe,ve]);(0,o.useImperativeHandle)(t,(()=>({activate:()=>{ye()},getBoundingClientRect:()=>{var e;return null===(e=pe.current)||void 0===e?void 0:e.getBoundingClientRect()}})),[ye]);const be=()=>(0,K.jsx)("div",{style:de.spinnerWrap,children:(0,K.jsx)(U.Z,{})}),_e=[];var Se;ne&&(E?_e.push({key:"left",comp:be()}):_e.push({key:"left",comp:(Se=ne,(0,K.jsx)(N.Z,{largeIcon:!0,disabled:!0,isEmptyPage:!1,size:20,icon:{icon:Se,pointer:n.pointer},style:{marginLeft:W?-4:0}}))})),W?_e.push({key:"name",comp:(0,K.jsx)("div",{style:de.label,children:W})}):ne||_e.push({key:"placeholder",comp:(0,K.jsx)("div",{style:de.labelPlaceholder,children:(0,K.jsx)(l.FormattedMessage,{...q.buttonPlaceholder})})}),!ne&&E&&_e.push({key:"right",comp:be()}),se&&_e.push({key:"error",comp:(0,K.jsx)("div",{children:(0,C.t)(de.warningIcon)})});const ke=e=>(0,K.jsx)(V.Z,{disabled:ae,disabledFeedback:!0,style:de.button,ref:pe,...(0,S.Z)(e??{},{onClick:ye}),backgroundColor:J,hoveredBackgroundColor:ee,pressedBackgroundColor:te,children:_e.map((e=>{let{key:t,comp:n}=e;return(0,K.jsx)(o.Fragment,{children:n},t)}))});return(0,K.jsxs)("div",{style:de.wrap,onMouseMove:me,onMouseLeave:ge,children:[oe.tooltip?(0,K.jsx)(O.Z,{renderTooltip:()=>{const e=(0,K.jsx)(l.FormattedMessage,{...oe.tooltip});let t=null;return oe.subtitleTooltip?t=(0,K.jsx)(l.FormattedMessage,{...oe.subtitleTooltip}):"error"!==oe.type||w||(t=(0,K.jsx)(l.FormattedMessage,{...q.clickToEdit})),(0,K.jsx)(v.So,{content:e,subtitle:t})},delayThreshold:0,render:ke,placement:T.u.Bottom}):oe.urlToPreview?(0,K.jsx)(h.qH,{parentStore:n,renderOrigin:ke,urlToPreview:oe.urlToPreview}):ke(),!w&&(P.device.isMobile||j)&&(0,K.jsxs)("div",{style:de.configureWrap,children:[!ae&&(0,K.jsx)(O.Z,{renderTooltip:()=>(0,K.jsx)(l.FormattedMessage,{defaultMessage:"Edit button",id:"buttonBlock.configureTemplate.button.label"}),delayThreshold:300,render:e=>(0,K.jsx)(Z.Z,{ariaLabel:M.formatMessage(q.editButtonAriaLabel),icon:le?()=>(0,K.jsx)(z,{}):I.H,onClick:he,...e})}),P.device.isMobile&&(0,K.jsx)(B.Z,{tooltipContent:(0,K.jsx)(l.FormattedMessage,{defaultMessage:"More actions…",id:"buttonBlock.moreActions.button.label"}),store:n,fadeIn:!1})]})]})}));const W=o.memo(o.forwardRef(H),u.Z)},638376:(e,t,n)=>{n.d(t,{Z:()=>R});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(949271),l=n(541432),c=n(915157),d=n(709291),u=n(531701),p=n(926249),m=n(141433),g=n(709953),f=n(429373),h=n(210228),v=n(212534),y=n(249394),b=n(639500),_=n(798165),S=n(99340),k=n(523864),w=n(104029),x=n(668709),I=n(731278),C=n(630915),T=n(965187),M=n(785893);const P=(0,d.defineMessages)({inputPlaceholder:{defaultMessage:"Type something…",id:"calloutBlock.inputPlaceholder"},changeIconLabel:{defaultMessage:"Change callout icon",id:"calloutBlock.changeIconLabel"},disabledIconLabel:{defaultMessage:"Callout icon",id:"calloutBlock.disabledIconLabel"}});function A(e,t){const n=(0,r.O7)(),p=(0,d.useIntl)(),A=(0,o.useRef)(null),R=(0,S.PE)(e.store,e.disabled),D=(0,i.VK)((()=>e.store.getBlockTitleStore()),[e.store]),B=(0,i.VK)((()=>e.store.getContentStore()),[e.store]),E=(0,i.VK)((()=>e.store.getFormat().block_color||"default"),[e.store]),F=(0,i.VK)((()=>e.store.getIcon()),[e.store]),Z=(0,i.VK)((()=>e.store.isCalloutV2()),[e.store]),U=(0,o.useCallback)((async t=>{const o=e.store.getIconStore();if(o){const{serverCommitResult:e}=h.createAndCommit({userAction:"CalloutBlock.handleEmojiChange",environment:n,perform:e=>{g.sO({store:o,value:t,transaction:e}),c.Z.set({userId:n.currentUser.id,key:m.nF,value:t??""})}});await e}}),[n,e.store]),V=(0,a.yK)((e=>({root:{display:"flex",width:"100%",borderRadius:4,border:(0,u.jS)(E)&&"default_background"!==E?void 0:`1px solid ${e.darkDividerColor}`,backgroundColor:"transparent",paddingLeft:12,paddingTop:Z?12:16,paddingBottom:Z?12:16,paddingRight:16,...(0,u.x7)(E,e)}})),[E,Z]),{blockInsetRight:N}=(0,o.useContext)(w.a),O=(0,i.VK)((()=>{var t;return null===(t=(0,_.fM)(e.store))||void 0===t?void 0:t.getFormat().page_small_text}),[e.store]),L=(0,i.VK)((()=>{var t;return null===(t=e.store.getContentStores())||void 0===t?void 0:t[0]}),[e.store]),j=(0,i.VK)((()=>null==L?void 0:L.getType()),[L]),K=(0,o.useMemo)((()=>{if(Z)return j===l.Ti.header?O?8:10:j===l.Ti.subHeader?O?4:6:j===l.Ti.subSubHeader?O?2:3:O?3:4}),[Z,j,O]),z=(0,M.jsxs)("div",{role:"note",style:{display:"flex"},ref:A,onClick:t=>{!e.store.hasContent()&&Z&&(0,v.ZP)({event:t,context:v.Af.EditorClick,callback:()=>{R&&!(0,b.uG)(t)&&h.createAndCommit({userAction:"CalloutBlock.handleEmptyClick",environment:n,perform:t=>{f.ls({environment:n,store:e.store,transaction:t})}})}})},children:[(0,M.jsxs)("div",{style:{...e.style,...V.root},children:[void 0!==F&&(0,M.jsx)("div",{style:{marginTop:K},children:R?(0,M.jsx)(x.p,{allowSelectionWithin:!1,children:(0,M.jsx)(I.Z,{bucket:"secure",store:e.store,isEmptyPage:!1,onChange:U,isCallout:!0,icon:F,size:24,disabled:!1,label:p.formatMessage(P.changeIconLabel)})}):(0,M.jsx)(I.Z,{icon:F,isEmptyPage:!1,size:24,disabled:!0,label:p.formatMessage(P.disabledIconLabel)})}),(0,M.jsxs)("div",{style:{display:"flex",flexDirection:"column",minWidth:0,marginLeft:8,width:"100%",minHeight:Z?32:void 0},children:[!Z&&(0,M.jsx)(T.Z,{style:{paddingLeft:s.ZD.paddingLeft,paddingRight:s.ZD.paddingRight},disabled:e.disabled,store:D,placeholder:p.formatMessage(P.inputPlaceholder),pasteBehavior:"block",inPageFind:y.B3.block_match,renderWhiteSpaceWhenEmptyOnAndroid:!0}),!e.hideContent&&(0,M.jsx)(w.a.Provider,{value:{blockInsetRight:N+16},children:(0,M.jsx)(C.Z,{disabled:e.disabled,store:B,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,disableFirstItemHoverMenu:Z,disableDrag:e.disableDrag})})]})]}),(0,M.jsx)(k.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store,hideIfSidebarOrMarginCommentsVisible:!0})]});return(0,S.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"callout",getNode:()=>A.current,getBlockStore:()=>e.store})),[e.store]),z)}const R=o.memo(o.forwardRef(A),p.Z)},328385:(e,t,n)=>{n.d(t,{Z:()=>z});n(252262),n(324506);var o=n(667294),r=n(883355),i=n(701302),a=n(313991),s=n(415095),l=n(662193),c=n(820852),d=n(606746),u=n(421838),p=n(744805),m=n(653965),g=n(137810),f=n(800893),h=n(800993),v=n(498724),y=n(56971),b=n(274284),_=n(210228),S=n(947002),k=n(948514),w=n(296994),x=n(214976),I=n(162619),C=n(249394),T=n(268056),M=n(367669),P=n(455227),A=n(489086),R=n(766638),D=n(277907),B=n(400807),E=n(385555),F=n(469316),Z=n(152689),U=n(186486),V=n(924666),N=n(129595),O=n(693262),L=n(487929),j=n(785893);class K extends r.Z{constructor(){super(...arguments),this.editor=null,this.mergeEditorRefs=(0,l.sH)(),this.shouldRenderEditable2Store=this.createComputedStore((()=>E.default.checkGate({gateName:"docs_function_editable"}))),this.renderContentContainer=(e,t,n)=>{let{leafRef:o,wrapperRef:r,...i}=e;return(0,j.jsx)("div",{ref:r,style:{display:"flex",...!this.props.codeWrap&&{overflowX:"auto",WebkitOverflowScrolling:"touch"},...this.props.wrapStyle},className:"line-numbers notion-code-block",...i,children:(0,j.jsx)(N.Z,{ref:this.mergeEditorRefs(this.editorRef,o),style:{...(s=this.theme,l=this.props.style,{flexGrow:1,flexShrink:1,textAlign:"left",fontFamily:g.Z.getCompositeFontFamily(a.locale).githubMono,fontSize:"85%",tabSize:2,padding:"34px 16px 32px 32px",minHeight:"1em",color:s.regularTextColor,...l}),...this.props.isQuickFind&&{paddingTop:12},...this.props.codeWrap?{whiteSpace:"pre-wrap",wordBreak:"break-all",minWidth:0}:{whiteSpace:"pre"}},getDisabled:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_getDisabled,getHtml:this.getHtml,getSelection:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_getContainerSelection,onMutation:e=>function(e,t,n,o,r){const{newValue:i}=e;H("typing_lag",t,n,o);const a=null!=r&&r.pageStore?B.Z.getMode(null==r?void 0:r.pageStore):"default";_.createAndCommit({userAction:"CodeBlockValue.handleMutation",environment:o,perform:e=>{h.aS({environment:o,editorMode:a,store:n,newValue:i,disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,disableFilters:!0,transaction:e})}})}(e,this.props.blockStore,this.props.store,this.environment,this.pageContext),spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",onSelect:t,onMouseOver:this.handleMouseOver,onMouseOut:this.handleMouseOut,suppressNewlineEvents:!1,placeholder:" ",disableContentEditableWhenNotEditingTextOnMobile:!0,expandSelectionOnTripleClick:!1})});var s,l},this.handleClick=e=>{x.SD({environment:this.environment,event:e,textValue:Q({store:this.props.store,blockStore:this.props.blockStore,inPageFindDetails:this.inPageFindDetailsStore.state,isNewDiscussionMenuTargetStore:this.isNewDiscussionMenuTargetStore,isRightMarginCommentActionHoveredStore:this.isRightMarginCommentActionHoveredStore}),editorNode:this.getEditorNode(),store:this.props.store,canEdit:J(this.props.disabled,this.props.store,this.pageContext)})},this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleDelete=e=>function(e,t,n,o,r,i){if(!J(n,o,i))return;H("typing_delete",r,o,t);const a=V.default.state;if("editing"===a.mode&&a.multiSelection.start.store===o){const n=null!=i&&i.pageStore?B.Z.getMode(null==i?void 0:i.pageStore):"default";_.createAndCommit({userAction:"CodeBlockValue.handleDelete",environment:t,perform:o=>{y.as({environment:t,multiSelection:a.multiSelection,deleteForwards:!0,transaction:o,event:e,editorMode:n})}})}}(e,this.environment,this.props.disabled,this.props.store,this.props.blockStore,this.pageContext),this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleBackspace=e=>function(e,t,n,o,r,i){if(!J(n,o,i))return;H("typing_backspace",r,o,t);const a=V.default.state;if("editing"===a.mode&&a.multiSelection.start.store===o){if(y.YV({device:t.device,event:e,multiSelection:a.multiSelection}))return;const n=null!=i&&i.pageStore?B.Z.getMode(null==i?void 0:i.pageStore):"default";_.createAndCommit({userAction:"CodeBlockValue.handleBackspace",environment:t,perform:o=>{y.as({environment:t,multiSelection:a.multiSelection,deleteForwards:!1,transaction:o,event:e,editorMode:n})}})}}(e,this.environment,this.props.disabled,this.props.store,this.props.blockStore,this.pageContext),this.handleEnter=e=>{var t;if(!J(this.props.disabled,this.props.store,this.pageContext))return;if(H("typing_enter",this.props.blockStore,this.props.store,this.environment),null===(t=e.preventDefault)||void 0===t||t.call(e),this.editor&&this.editor.isComposing())return;const n=V.default.state,o="editing"===n.mode&&(0,T.QY)(n.multiSelection);if(o){var r,i;const e=null!==(r=this.pageContext)&&void 0!==r&&r.pageStore?B.Z.getMode(null===(i=this.pageContext)||void 0===i?void 0:i.pageStore):"default";!function(e){const{environment:t,editorMode:n,store:o,selection:r}=e;let i="";if(E.default.checkGate({gateName:"code_block_preserve_indent"})){const e=u.KU1(o.getValue(),0,r.startIndex),t=u.QaF(e).split("\n").at(-1),n=null==t?void 0:t.match(/^[ \t]+/);n&&(i=n[0])}_.createAndCommit({userAction:"CodeBlockValue.handleEnter",environment:t,perform:e=>{h.hJ({environment:t,editorMode:n,store:o,string:`\n${i}`,selection:r,disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,transaction:e})}})}({environment:this.environment,store:this.props.store,editorMode:e,selection:o.selection})}},this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleShiftEnter=e=>function(e,t,n,o,r,i){var a;if(!J(n,o,i))return;H("typing_enter",r,o,t),null===(a=e.preventDefault)||void 0===a||a.call(e);const s=V.default.state;if("editing"===s.mode){const e=null!=i&&i.pageStore?B.Z.getMode(i.pageStore):"default";_.createAndCommit({userAction:"CodeBlockValue.handleShiftEnter",environment:t,perform:n=>{b.IO({environment:t,editorMode:e,multiSelection:s.multiSelection,transaction:n})}}),q()}}(e,this.environment,this.props.disabled,this.props.store,this.props.blockStore,this.pageContext),this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleTab=e=>function(e,t,n,o,r,i){if(!J(n,o,i))return;H("typing_tab",r,o,t),e.preventDefault();const a=V.default.state,s="editing"===a.mode&&(0,T.QY)(a.multiSelection);if(s){const e=null!=i&&i.pageStore?B.Z.getMode(i.pageStore):"default";_.createAndCommit({userAction:"CodeBlockValue.handleTab",environment:t,perform:n=>{h.wA({environment:t,editorMode:e,store:o,selection:s.selection,transaction:n,shouldStripTokens:!0})}})}}(e,this.environment,this.props.disabled,this.props.store,this.props.blockStore,this.pageContext),this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleUntab=e=>function(e,t,n,o,r,i){if(!J(n,o,i))return;H("typing_untab",r,o,t),e.preventDefault();const a=V.default.state,s="editing"===a.mode&&(0,T.QY)(a.multiSelection);if(s){const e=null!=i&&i.pageStore?B.Z.getMode(i.pageStore):"default";_.createAndCommit({userAction:"CodeBlockValue.handleUntab",environment:t,perform:n=>{h.O5({environment:t,editorMode:e,store:o,selection:s.selection,transaction:n,shouldStripTokens:!0})}})}}(e,this.environment,this.props.disabled,this.props.store,this.props.blockStore,this.pageContext),this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleCut=e=>function(e,t,n,o,r,i){if(!J(o,r,i))return void e.preventDefault();f.by({environment:t,event:e,markdownLinkifyIt:n})}(e,this.environment,this.props.markdownLinkifyIt,this.props.disabled,this.props.store,this.pageContext),this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handlePaste=e=>function(e,t,n,o,r,i,a){if(!J(r,i,a))return void e.preventDefault();_.createAndCommit({userAction:"CodeBlockValue.handlePaste",environment:t,perform:r=>{f.v({environment:t,event:e,disableEmbedMenu:!0,transaction:r,onPasteFiles:f.AL,markdownLinkifyIt:n,tinyMceMicrosoftWordPasteFilter:o})}})}(e,this.environment,this.props.markdownLinkifyIt,this.props.tinyMceMicrosoftWordPasteFilter,this.props.disabled,this.props.store,this.pageContext),this.handleMouseOver=e=>{x.vO({environment:this.environment,event:e,textValue:Q({store:this.props.store,blockStore:this.props.blockStore,inPageFindDetails:this.inPageFindDetailsStore.state,isNewDiscussionMenuTargetStore:this.isNewDiscussionMenuTargetStore,isRightMarginCommentActionHoveredStore:this.isRightMarginCommentActionHoveredStore}),editorNode:this.getEditorNode(),store:this.props.store,canEdit:J(this.props.disabled,this.props.store,this.pageContext)})},this.handleMouseOut=e=>{x.kV({environment:this.environment,event:e,textValue:Q({store:this.props.store,blockStore:this.props.blockStore,inPageFindDetails:this.inPageFindDetailsStore.state,isNewDiscussionMenuTargetStore:this.isNewDiscussionMenuTargetStore,isRightMarginCommentActionHoveredStore:this.isRightMarginCommentActionHoveredStore}),editorNode:this.getEditorNode(),store:this.props.store,canEdit:J(this.props.disabled,this.props.store,this.pageContext)})},this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_getDisabled=()=>{return e=this.props.disabled,t=this.props.store,n=this.pageContext,!J(e,t,n);var e,t,n},this.getHtml=()=>{const{store:e,Prism:t}=this.props,n=Q({store:this.props.store,blockStore:this.props.blockStore,inPageFindDetails:this.inPageFindDetailsStore.state,isNewDiscussionMenuTargetStore:this.isNewDiscussionMenuTargetStore,isRightMarginCommentActionHoveredStore:this.isRightMarginCommentActionHoveredStore}),r=u.QaF(n),i=t.languages[this.props.language];if(this.props.language!==c.PrismLanguages.html&&this.props.language!==c.PrismLanguages.markup||(t.languages.markup.tag.addInlined("style","css"),t.languages.markup.tag.addInlined("script","javascript")),r&&i&&r.length<1e4){const a=document.createElement("div"),s=t.highlight(r,i,this.props.language);a.innerHTML=P.g7(s);const l=Array.from(a.childNodes).map(G),c=function(e){let{syntaxTokens:t,textValue:n,parentSpaceId:o,store:r,theme:i}=e;const a=p.Mw(n&&{value:n,spaceId:o},r.getRecordModel),s=P.kF(a,t),l=a.map(u.hDy).map((e=>p.fn({annotations:e,theme:i,spaceId:o,getRecordModel:r.getRecordModel})));return s.map(((e,t)=>(0,j.jsx)("span",{className:[e.classNames||"",...l[e.textTokenIndex].classNames].join(" "),style:l[e.textTokenIndex].style,"data-token-index":e.textTokenIndex,children:e.value},t)))}({parentSpaceId:this.props.parentSpaceId,store:e,syntaxTokens:m.oA(l),textValue:n,theme:this.theme}),g=(0,j.jsxs)(o.Fragment,{children:[c,(0,j.jsx)("span",{children:"\n"})]});return d.Z.renderToStaticMarkup(g)}{const t=x.IY({environment:this.environment,textValue:n&&{value:n,spaceId:this.props.parentSpaceId},parentStore:e,disableHover:!1,disableStyleAnnotations:!1,disableInsertedDeletedAnnotations:!1,disableDateStyleAnnotations:!0,disableSuggestionAnnotations:!1,disabled:!J(this.props.disabled,this.props.store,this.pageContext),theme:this.theme,emojiType:"raw",katex:void 0,formulaValueTypes:[]});return d.Z.renderToStaticMarkup((0,j.jsx)(j.Fragment,{children:t}))}},this.clearBrowserSelection=()=>{var e;null===(e=this.getEditorNode())||void 0===e||e.blur()},this.isEditingStore=this.createComputedStore((()=>{var e;const t=V.default.state;return"editing"===t.mode&&(null===(e=(0,T.QY)(t.multiSelection))||void 0===e?void 0:e.store)===this.props.store})),this.isNewDiscussionMenuTargetStore=this.createComputedStore((()=>{var e;const t=k.Z.state;return t.open&&"inline"===t.type&&(null===(e=(0,T.QY)(t.multiSelection))||void 0===e?void 0:e.store)===this.props.store})),this.isRightMarginCommentActionHoveredStore=this.createComputedStore((()=>{if(!S.Z.state.isHovered||"right_margin_button"!==S.Z.state.hoverEntryPoint)return!1;const e=U.default.state,t=e.isOpen?e.currentStore:void 0;return(null==t?void 0:t.id)===this.props.store.id})),this.inPageFindDetailsStore=this.createComputedStore((()=>{const e=F.l9.state,t=F.V8.state;return{query:e,focusedResult:(0,C.yy)(t)&&t.id===this.props.store.id?t:void 0}}),{debugName:"CodeBlockValue.inPageFindDetailsStore"}),this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_getContainerSelection=()=>function(e,t){if(t.state)return(0,A.HE)(e)}(this.props.store,this.isEditingStore),this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_getEndSelection=()=>function(e){const{store:t,blockStore:n,inPageFindDetails:o,isNewDiscussionMenuTargetStore:r,isRightMarginCommentActionHoveredStore:i}=e,a=s.p4(u.QaF(Q({store:t,blockStore:n,inPageFindDetails:o,isNewDiscussionMenuTargetStore:r,isRightMarginCommentActionHoveredStore:i})));return{startIndex:a.length,endIndex:a.length}}({store:this.props.store,blockStore:this.props.blockStore,inPageFindDetails:this.inPageFindDetailsStore.state,isNewDiscussionMenuTargetStore:this.isNewDiscussionMenuTargetStore,isRightMarginCommentActionHoveredStore:this.isRightMarginCommentActionHoveredStore}),this.editorRef=e=>{this.editor=e}}renderComponent(){const{disabled:e}=this.props;return this.shouldRenderEditable2Store.state?(0,j.jsx)(L.Z,{store:this.props.store,disabled:e,clearBrowserSelection:this.clearBrowserSelection,getEndSelection:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_getEndSelection,onClick:this.handleClick,onDelete:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleDelete,onBackspace:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleBackspace,onEnter:this.handleEnter,onShiftEnter:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleShiftEnter,onCommandEnter:m.yR,onCommandShiftEnter:m.yR,onTab:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleTab,onUntab:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleUntab,onToggleHighlight:e=>X(["h",Z.Z.state.color],e,this.environment,this.props.disabled,this.props.store,this.pageContext),onToggleBold:e=>X(["b"],e,this.environment,this.props.disabled,this.props.store,this.pageContext),onToggleItalics:e=>X(["i"],e,this.environment,this.props.disabled,this.props.store,this.pageContext),onToggleUnderline:e=>X(["_"],e,this.environment,this.props.disabled,this.props.store,this.pageContext),onToggleStrike:e=>X(["s"],e,this.environment,this.props.disabled,this.props.store,this.pageContext),onToggleCode:m.yR,onCopy:e=>Y(e,this.props.markdownLinkifyIt,this.environment),onCut:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleCut,onPaste:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handlePaste,onMoveUp:e=>W(e,this.environment),onMoveDown:e=>$(e,this.environment),render:this.renderContentContainer,disableMentions:!0,disableSlashCommands:!0,canSelectAllBlocks:!0,canInsertText:!0,canSelectionDrag:!0,topBottomPadding:40,pasteBehavior:"inline"}):(0,j.jsx)(O.Z,{store:this.props.store,disabled:e,clearBrowserSelection:this.clearBrowserSelection,getEndSelection:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_getEndSelection,onClick:this.handleClick,onDelete:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleDelete,onBackspace:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleBackspace,onEnter:this.handleEnter,onShiftEnter:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleShiftEnter,onCommandEnter:m.yR,onCommandShiftEnter:m.yR,onTab:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleTab,onUntab:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleUntab,onToggleHighlight:e=>X(["h",Z.Z.state.color],e,this.environment,this.props.disabled,this.props.store,this.pageContext),onToggleBold:e=>X(["b"],e,this.environment,this.props.disabled,this.props.store,this.pageContext),onToggleItalics:e=>X(["i"],e,this.environment,this.props.disabled,this.props.store,this.pageContext),onToggleUnderline:e=>X(["_"],e,this.environment,this.props.disabled,this.props.store,this.pageContext),onToggleStrike:e=>X(["s"],e,this.environment,this.props.disabled,this.props.store,this.pageContext),onToggleCode:m.yR,onCopy:e=>Y(e,this.props.markdownLinkifyIt,this.environment),onCut:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleCut,onPaste:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handlePaste,onMoveUp:e=>W(e,this.environment),onMoveDown:e=>$(e,this.environment),render:this.renderContentContainer,disableMentions:!0,disableSlashCommands:!0,canSelectAllBlocks:!0,canInsertText:!0,canSelectionDrag:!0,topBottomPadding:40,pasteBehavior:"inline"})}getEditorNode(){var e;return(null===(e=this.editor)||void 0===e?void 0:e.getNode())||void 0}}function z(e){const{value:t}=(0,D.XJ)(w.FF.prismjs),{value:n}=(0,D.XJ)(w.FF.markdownLinkifyIt),{value:o}=(0,D.XJ)(w.FF.tinyMceMicrosoftWordPasteFilter);return t?(0,j.jsx)(K,{...e,Prism:t,markdownLinkifyIt:n,tinyMceMicrosoftWordPasteFilter:o}):null}function q(){i.default.flush()}function H(e,t,n,o){(0,R.u)({type:e,environment:o,blockStore:t,store:n,isInCollectionView:!1})}function G(e){return I.Gs(e)?[e.data]:I.kK(e)?[e.textContent||"",e.className]:void 0}function W(e,t){_.createAndCommit({userAction:"CodeBlockValue.handleMoveUp",environment:t,perform:e=>{h.fs({environment:t,transaction:e,direction:"up"})}})}function $(e,t){_.createAndCommit({userAction:"CodeBlockValue.handleMoveDown",environment:t,perform:e=>{h.fs({environment:t,transaction:e,direction:"down"})}})}function Y(e,t,n){f.JG({environment:n,event:e,markdownLinkifyIt:t})}function Q(e){const{store:t,blockStore:n,inPageFindDetails:o,isNewDiscussionMenuTargetStore:r,isRightMarginCommentActionHoveredStore:i}=e;let a=t.getValue();if(o.query&&(a=x.cD({textValue:a,blockId:null==n?void 0:n.id,find:o.query,textProps:{type:"block_match"},currentFocusedResult:o.focusedResult})),i.state){const e=u.eeV(a);return x.fm({store:t,temporaryAnnotation:u.GKr.TemporarySelection,multiSelection:{start:{store:t,index:0},end:{store:t,index:e.length}}})}return r.state?x.Gj({store:t}):a}function J(e,t,n){const o=n&&n.publicEditModeStore.state;if((0,M.YF)(o))return!1;const r=null!=n&&n.pageStore?B.Z.getMode(null==n?void 0:n.pageStore):"default";return!(e||"suggest"!==r||!t.canComment())||Boolean(!e&&t.canEdit())}function X(e,t,n,o,r,i){J(o,r,i)&&(t.preventDefault(),v.aS({environment:n,annotation:e}),q())}K.displayName="CodeBlockValue"},922843:(e,t,n)=>{n.d(t,{b:()=>c,Z:()=>y});var o=n(667294),r=n(701302),i=n(800480),a=n(653965),s=n(214976),l=n(401898);let c=function(e){return e.Inline="Inline",e.InlineWrap="InlineWrap",e.Textarea="Textarea",e}({}),d=function(e){return e.Submit="Submit",e.Newline="Newline",e}({});function u(e){const{device:t,e:n,action:o,onSubmit:r}=e;if(o===d.Submit)r&&r(n);else if(o===d.Newline){if(!t.isIOS)return;n.preventDefault&&n.preventDefault(),document.execCommand("insertLineBreak")}else(0,l.t1)(o)}var p=n(973744),m=n(389224),g=n(924666),f=n(129595),h=n(203386),v=n(785893);const y=(0,o.forwardRef)((function(e,t){const[n,y]=(0,o.useState)(),b=(0,o.useRef)(null),_=(0,i.Fy)(),S=(0,i.O7)(),{onBlur:k,onCancel:w,type:x,onSubmit:I,onLeft:C,onRight:T,onChange:M,getHtml:P}=e;(0,o.useEffect)((()=>{const e=e=>{var t;const n=null===(t=b.current)||void 0===t?void 0:t.getNode();n&&e.target instanceof Node&&!n.contains(e.target)&&k&&k()};return p.lj(window,"mousedown",e),()=>p.ZV(window,"mousedown",e)}),[k]),(0,o.useEffect)((()=>{e.focus&&!n&&(e.selectAll?y({startIndex:0,endIndex:e.value.length}):y({startIndex:e.value.length,endIndex:e.value.length}))}),[e.focus,e.selectAll,e.value.length,n]);const A=(0,o.useCallback)((()=>{const t=a.YU(e.value+(e.value.length>0?"\n":""));return P?P(t):t}),[P,e.value]),R=(0,o.useCallback)((()=>!!e.disabled||!e.focus),[e.disabled,e.focus]),D=(0,o.useCallback)((()=>n&&{type:"contain",selection:n}),[n]);(0,o.useImperativeHandle)(t,(()=>({getSelection:D})),[D]);const B=(0,o.useCallback)((()=>{const e=s.Ut(S,m.get());e&&(a.Xy(e.selection,n)||y(e.selection),e.forceEmitSelectionStore&&g.default.emit())}),[S,n]),E=(0,o.useCallback)((()=>{r.default.afterNextFlush((()=>{B()}))}),[B]),F=(0,o.useCallback)((e=>{E(),null==w||w(e)}),[E,w]),Z=(0,o.useCallback)((e=>{if(R())return;const t=function(e){const{device:t,type:n,e:o}=e;return n===c.Inline?d.Submit:n===c.InlineWrap?t.isPhone?d.Submit:"altKey"in o&&o.altKey||"shiftKey"in o&&o.shiftKey?d.Newline:d.Submit:n===c.Textarea?d.Newline:void(0,l.t1)(n)}({device:_,type:x,e});u({device:_,e,action:t,onSubmit:I})}),[_,R,I,x]),U=(0,o.useCallback)((e=>{_.isIOS&&!("shiftKey"in e)?u({device:_,e,action:d.Newline}):Z(e)}),[_,Z]),V=(0,o.useCallback)((e=>{R()||(E(),null==C||C(e))}),[R,E,C]),N=(0,o.useCallback)((e=>{R()||(E(),null==T||T(e))}),[R,E,T]),O=(0,o.useCallback)((e=>{let{newValue:t}=e;B(),M(t)}),[M,B]);return(0,v.jsx)(h.Z,{debugName:"ContentEditableInput",capture:!R(),onDelete:E,onBackspace:E,onEnter:Z,onShiftEnter:U,onCommandEnter:E,onCommandShiftEnter:E,onUp:E,onDown:E,onLeft:V,onRight:N,onTab:E,onUntab:E,onSelectAll:E,onToggleBold:E,onToggleItalics:E,onToggleStrike:E,onToggleCode:E,onUndo:E,onRedo:E,onEsc:F,onCut:E,onCopy:E,onPaste:E,onKeypress:E,onHome:E,onEnd:E,onGoToBeginningOfLine:E,onGoToEndOfLine:E,onGoForwardOneChar:E,onGoBackwardOneChar:E,children:(0,v.jsx)(f.Z,{ref:b,style:{...e.style,whiteSpace:"pre-wrap"},placeholder:e.placeholder,placeholderStyle:e.placeholderStyle,spellCheck:!1,autoCorrect:e.autoCorrect,autoCapitalize:e.autoCapitalize,getDisabled:R,getHtml:A,getSelection:D,onMutation:O,suppressNewlineEvents:x===c.Inline,expandSelectionOnTripleClick:!0})})}))},129595:(e,t,n)=>{n.d(t,{Z:()=>k,y:()=>w});n(21703);var o=n(667294),r=n(460177),i=n(118466),a=n(701302),s=n(800480),l=n(533125),c=n(720294),d=n(886628),u=n(222491),p=n(401898),m=n(214976),g=n(146150),f=n(162619),h=n(745162),v=(n(560846),n(389224)),y=n(385555),b=n(924666),_=n(785893);let S=!1;const k=o.forwardRef((function(e,t){const n=(0,s.Fy)(),k=(0,s.O7)(),I=(0,o.useRef)(null),C=(0,o.useRef)(!1),T=(0,o.useRef)(!1),M=(0,r.Dl)(),{onContextMenu:P,onDoubleClick:A,onMouseDown:R,onTouchStart:D,placeholder:B,onBlur:E,onFocus:F,onMouseOver:Z,onMouseOut:U,suppressNewlineEvents:V,getDisabled:N,getHtml:O,getSelection:L,expandSelectionOnTripleClick:j}=e,K=(0,d.VK)(N,[N],{recomputeSchedule:"eager"}),z=(0,d.VK)(O,[O],{recomputeSchedule:"eager"}),q=(0,d.VK)((()=>n.isAndroid&&y.default.checkGate({gateName:"android_ei_gboard_delete_over_selection_fix"})),[n]),H=(0,o.useCallback)((()=>Boolean(C.current||(null==M?void 0:M.isComposing()))),[M]),G=(0,o.useCallback)((()=>K),[K]),W=(0,d.VK)((()=>y.default.checkGate({gateName:"force_update_celeaf_oncompositionend"})),[]),$=(0,c.k)(),Y=(0,o.useCallback)((()=>{W&&T.current&&(T.current=!1,$());const t=e.onCompositionEnd;null==t||t()}),[$,W,e.onCompositionEnd]),Q=(0,o.useCallback)((t=>{const n=e.onKeyDown;null==n||n(t)}),[e.onKeyDown]),{onSelect:J,onMutation:X}=e,ee=(0,o.useCallback)((e=>{H()||null==J||J({endpoint:e,component:me.current})}),[H,J]),te=(0,o.useCallback)((()=>m.n$(k,I.current)),[k]),ne=(0,o.useCallback)((()=>I.current),[]),oe=!(0,h.ri)(n)&&e.spellCheck,re=e.tagName??"div",ie=(0,o.useCallback)((e=>{null==X||X(e),a.default.flush()}),[X]),ae=(0,o.useCallback)((()=>{ie({newValue:te(),insertedLine:!1,isComposing:H()})}),[te,ie,H]),se=(0,o.useCallback)((()=>{if(n.isAndroid)return;C.current=!0;const t=e.onCompositionStart;null==t||t()}),[n.isAndroid,e.onCompositionStart]),le=(0,o.useCallback)((()=>{if(n.isAndroid)return;C.current=!1,ae();const t=e.onCompositionEnd;null==t||t()}),[n.isAndroid,ae,e.onCompositionEnd]),ce=(0,o.useCallback)((e=>function(e){const{event:t,suppressNewlineEvents:n,rootRef:o,getText:r,handleMutation:i,isComposing:a,device:s,fixGboardDeleteOverSelection:l}=e;if(!f.kA(t))throw new Error("Invalid event");S;l&&"insertText"===t.inputType&&""===t.data&&t.preventDefault();if(n){var c;if("insertLineBreak"!==t.inputType&&"insertParagraph"!==t.inputType||t.preventDefault(),s.isAndroid&&"insertCompositionText"===t.inputType&&null!==(c=t.data)&&void 0!==c&&c.endsWith("\n")&&t.target===o.current){var d;S;const e=()=>{var t;i({insertedLine:!0,deletedLine:!1,newValue:r(),multiSelection:void 0,isComposing:a()}),null===(t=o.current)||void 0===t||t.removeEventListener("input",e)};null===(d=o.current)||void 0===d||d.addEventListener("input",e)}}}({event:e,suppressNewlineEvents:V,rootRef:I,getText:te,handleMutation:ie,isComposing:H,device:n,fixGboardDeleteOverSelection:q})),[n,te,ie,H,V,q]),de=(0,o.useCallback)((()=>{ee("contain")}),[ee]),ue=(0,o.useCallback)((t=>{var o;3===t.nativeEvent.detail&&j&&(m.TQ(n),ee("contain")),null===(o=e.onClick)||void 0===o||o.call(e,t)}),[ee,n,e,j]);(0,o.useEffect)((()=>{const e=I.current;if(e&&f.OW)return e.addEventListener("beforeinput",ce),()=>e.removeEventListener("beforeinput",ce)}),[ce]);const pe=Boolean(!z),me=function(e,t){const n=(0,r.Dl)(),{getNode:i,delegateCompositionEnd:a,delegateKeyDown:s,delegateBeforeInput:c,delegateMutation:d,delegateSelection:u,getText:p,isComposing:m,isDisabled:g}=t,f=(0,o.useRef)(null);f.current||(f.current={isComposing:m,getText:p,delegateCompositionEnd:a,delegateKeyDown:s,delegateBeforeInput:c,delegateMutation:d,delegateSelection:u,getNode:i,isDisabled:g});return(0,o.useLayoutEffect)((()=>{f.current.getNode=i,f.current.delegateCompositionEnd=a,f.current.delegateKeyDown=s,f.current.delegateBeforeInput=c,f.current.delegateMutation=d,f.current.delegateSelection=u,f.current.getText=p,f.current.isComposing=m,f.current.isDisabled=g}),[c,a,s,d,u,i,p,m,g]),(0,l.c)(null==n?void 0:n.contentEditableLeafRegistry,(()=>f.current),[]),(0,o.useImperativeHandle)(e,(()=>f.current),[]),f}(t,{getNode:ne,delegateCompositionEnd:Y,delegateKeyDown:Q,delegateBeforeInput:ce,delegateMutation:ie,delegateSelection:ee,getText:te,isComposing:H,isDisabled:G});return function(e,t,n,a,l,c,u){const g=(0,o.useRef)(!1),h=(0,o.useRef)(null);h.current||(h.current=document.createElement("div"));const y=(0,o.useRef)(),_=(0,r.Dl)(),S=(0,s.Fy)(),k=(0,s.O7)(),I=(0,d.VK)((()=>c()),[c]),C=function(e){const{disableContentEditableWhenNotEditingTextOnMobile:t=!1,disabled:n,rootRef:a}=e,l=(0,s.Fy)(),c=(0,r.Dl)(),d=l.isMobile&&t,u=(0,o.useRef)(null);null===u.current&&(u.current=!!d&&i.Z.withListenerIgnored((()=>!b.default.isEditingStore.state)));return(0,o.useEffect)((()=>{if(d){function e(){u.current=!b.default.isEditingStore.state,a.current&&x(a.current,c,n||u.current)}return b.default.isEditingStore.addListener(e),()=>b.default.isEditingStore.removeListener(e)}u.current=!1}),[c,n,a,d]),u}({disabled:a,rootRef:e,disableContentEditableWhenNotEditingTextOnMobile:l});(0,o.useLayoutEffect)((()=>{const o=!g.current;g.current=!0;const r=e.current;if(r)if(x(r,_,a||C.current),n)u.current=!0;else{if(o)w(_,(()=>{r.innerHTML=t}));else{y.current!==t&&(y.current=t,h.current.innerHTML=t);const e=r.innerHTML,n=h.current.innerHTML??"";e!==n&&w(_,(()=>{r.innerHTML=t}))}if(a)return;if(v.isMouseSelecting())return;if(v.isMouseRightClicking())return void v.resetMouseRightClicking();if(I)switch(I.type){case"start":case"end":{null==_||_.tryEnableMultiSelection();const e=m.bD(r,I.index),t={endpoint:I.type,onlyIfEqual:_,position:e};v.setDOMEndpoint(t,S),function(e,t,n){const o=v.get(),r=v.getIncompleteDOMEndpoint();if(o&&r===n)switch(n.endpoint){case"start":return void v.setDOMEndpoint({endpoint:"end",onlyIfEqual:t,position:{container:o.endContainer,offset:o.endOffset}},e);case"end":return void v.setDOMEndpoint({endpoint:"start",onlyIfEqual:t,position:{container:o.startContainer,offset:o.startOffset}},e);default:(0,p.t1)(n.endpoint)}}(S,_,t);break}case"contain":{const e=m.lw(r,I.selection.startIndex,I.selection.endIndex),t=v.get();m.Dn(t,e)||(S.isAndroid&&document.activeElement!==r&&r.focus(),v.set(e,S));break}default:(0,p.t1)(I)}else if(!o){const e=v.get(),t=!S.isAndroid||i.Z.withListenerIgnored((()=>"empty"===b.default.state.mode));e&&e.commonAncestorContainer&&f.UG(e.commonAncestorContainer)&&r.contains(e.commonAncestorContainer)&&t&&v.clear(k)}}}))}(I,z,H(),K,e.disableContentEditableWhenNotEditingTextOnMobile,L,T),(0,_.jsx)(re,{id:e.id,ref:I,...(0,u.iv)(e.className,pe&&e.placeholderStyle?e.placeholderStyle:e.style,!K&&"notranslate"),onCompositionStart:se,onCompositionEnd:le,onInput:ae,spellCheck:oe,autoCorrect:e.autoCorrect,autoCapitalize:e.autoCapitalize,onSelect:de,onClick:ue,onBlur:E,onFocus:F,onContextMenu:P,onKeyDown:Q,onDoubleClick:A,onMouseDown:R,onTouchStart:D,onMouseOver:Z,onMouseOut:U,placeholder:B,...g.GF})}));function w(e,t){const n=null==e?void 0:e.domLock;return n?n.mutate(t):t()}function x(e,t,n){const o=e.getAttribute("contenteditable");n?"false"!==o&&w(t,(function(){e.contentEditable="false"})):"true"!==o&&w(t,(function(){e.contentEditable="true"}))}},215201:(e,t,n)=>{n.d(t,{O:()=>z});n(757658),n(21703);var o=n(427537),r=n.n(o),i=n(667294),a=n(460177),s=n(118466),l=n(964338),c=n(800480),d=n(886628),u=n(724405),p=n(541432),m=n(222491),g=n(744805),f=n(653965),h=n(401898),v=n(662134),y=n(898104),b=n(95477),_=n(214976),S=n(146150),k=n(162619),w=n(389224);const x=["initial","keyDown","compositionStart","beforeInput","compositionUpdate","domMutations","input","compositionEnd","keyUp"],I={keyDown:"keyUp",beforeInput:"input",input:"domMutations",domMutations:"input",compositionStart:"compositionEnd"},C={compositionUpdate:"beforeInput"};class T{constructor(){this.flowData=new Map,this.nextFlow=new M,this.currentFlow=void 0,this.previousFlow=void 0,this.listeners=new Set,this.handleSelectionChange=()=>{this.nextFlow.beforeRange=w.toStaticRange(w.get())},this.handleKeyDown=e=>{this.advanceToPhase("keyDown").keyDown={event:e},this.emitUpdate(),this.endIfComplete()},this.handleCompositionStart=e=>{this.advanceToPhase("compositionStart").compositionStart={event:e},this.emitUpdate(),this.endIfComplete()},this.handleBeforeInput=e=>{var t;if(!(0,k.kA)(e))return;const n=(null===(t=e.getTargetRanges)||void 0===t?void 0:t.call(e))||[];this.advanceToPhase("beforeInput").beforeInput={event:e,targetRanges:n},this.emitUpdate(),this.endIfComplete()},this.handleCompositionUpdate=e=>{this.advanceToPhase("compositionUpdate").compositionUpdate={event:e},this.emitUpdate()},this.handleInput=e=>{this.advanceToPhase("input").input={event:e},this.emitUpdate(),this.endIfComplete()},this.handleCompositionEnd=e=>{this.advanceToPhase("compositionEnd").compositionEnd={event:e},this.emitUpdate(),this.endIfComplete()},this.handleKeyUp=e=>{this.advanceToPhase("keyUp").keyUp={event:e},this.emitUpdate(),this.endFlow()},this.handleMutations=e=>{let{currentFlow:t}=this;t&&!t.domMutations||(t=this.advanceToPhase("initial")),t.domMutations={afterPhase:t.phase,mutations:e},this.emitUpdate(),this.endIfComplete()}}attachEventListeners(e){const{div:t,document:n}=e;return n.addEventListener("selectionchange",this.handleSelectionChange),t.addEventListener("input",this.handleInput),t.addEventListener("keydown",this.handleKeyDown),t.addEventListener("keyup",this.handleKeyUp),t.addEventListener("beforeinput",this.handleBeforeInput),t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionupdate",this.handleCompositionUpdate),t.addEventListener("compositionend",this.handleCompositionEnd),()=>{n.removeEventListener("selectionchange",this.handleSelectionChange),t.removeEventListener("input",this.handleInput),t.removeEventListener("keydown",this.handleKeyDown),t.removeEventListener("keyup",this.handleKeyUp),t.removeEventListener("beforeinput",this.handleBeforeInput),t.removeEventListener("compositionstart",this.handleCompositionStart),t.removeEventListener("compositionupdate",this.handleCompositionUpdate),t.removeEventListener("compositionend",this.handleCompositionEnd)}}onInputFlowChange(e){return this.listeners.add(e),()=>this.listeners.delete(e)}isComposing(){var e;return this.currentFlow&&!this.currentFlow.isPhase("initial")?this.currentFlow.isComposing():(null===(e=this.previousFlow)||void 0===e?void 0:e.isComposing())||!1}reset(){this.nextFlow=new M,this.currentFlow=void 0,this.previousFlow=void 0,this.flowData=new Map}getCurrentFlow(){const e=this.currentFlow;if(!e)return;return{flow:e,data:this.getData(e)}}getData(e){const t=this.flowData.get(e);if(t)return t;const n={};return this.flowData.set(e,n),n}endIfComplete(){const{currentFlow:e}=this;e&&e.isComplete()&&this.endFlow()}emitUpdate(){const{currentFlow:e}=this;if(e){const t={type:"update",flow:e,data:this.getData(e)};this.listeners.forEach((e=>e(t)))}}endFlow(){const{currentFlow:e}=this;if(e){const t=this.previousFlow;this.previousFlow=e,this.currentFlow=void 0;const n={type:"end",flow:e,data:this.getData(e)};this.listeners.forEach((e=>e(n))),t&&this.flowData.delete(t)}}advanceToPhase(e){return this.currentFlow&&this.currentFlow.canTransitionToPhase(e)||(this.endFlow(),this.currentFlow=this.nextFlow,this.nextFlow=new M),this.currentFlow.phase=e,this.currentFlow}}class M{constructor(){this.phase="initial",this.beforeRange=w.toStaticRange(w.get()),this.initial=void 0,this.keyDown=void 0,this.compositionStart=void 0,this.beforeInput=void 0,this.compositionUpdate=void 0,this.input=void 0,this.compositionEnd=void 0,this.domMutations=void 0,this.keyUp=void 0}isPhase(e){return this.phase===e}hasEvents(){return Boolean(this.compositionStart||this.compositionEnd||this.compositionUpdate||this.keyDown||this.keyUp||this.beforeInput||this.input)}isComposing(){var e;switch(this.phase){case"compositionStart":case"compositionUpdate":return!0;case"compositionEnd":case"initial":return!1;case"beforeInput":case"input":case"keyDown":case"keyUp":return Boolean(null===(e=this[this.phase])||void 0===e?void 0:e.event.isComposing);default:(0,h.t1)(this.phase)}}transitionToPhase(e,t){return!!this.canTransitionToPhase(e)&&(this.phase=e,this[e]=t,!0)}canTransitionToPhase(e){return!this[e]&&(!(!(0,h.qg)(C,this.phase)||C[this.phase]!==e)||1===function(e,t){const n=x.indexOf(e),o=x.indexOf(t),r=n-o;if(r<0)return-1;if(r>0)return 1;return 0}(e,this.phase))}isComplete(){for(const[e,t]of(0,h.qP)(I))if(this[e]&&!this[t])return!1;return!0}getTargetRanges(){var e;const t=null===(e=this.beforeInput)||void 0===e?void 0:e.targetRanges;return null!=t&&t.length?t:this.beforeRange?[this.beforeRange]:[]}}var P=n(268056),A=n(745162),R=n(455010),D=n(535431),B=n(159730);let E,F;E=Symbol.iterator;class Z{constructor(e){if(this.leftToRight=new Map,this.rightToLeft=new Map,e)for(const[t,n]of e)this.assoc(t,n)}assoc(e,t){const n=[];if(this.leftToRight.has(e)){const t=this.leftToRight.get(e);n.push((()=>this.rightToLeft.delete(t)))}if(this.rightToLeft.has(t)){const e=this.rightToLeft.get(t);n.push((()=>this.leftToRight.delete(e)))}for(const o of n)o();return this.leftToRight.set(e,t),this.rightToLeft.set(t,e),this}getLeft(e){return this.leftToRight.get(e)}getRight(e){return this.rightToLeft.get(e)}hasLeft(e){return this.leftToRight.has(e)}hasRight(e){return this.rightToLeft.has(e)}deleteLeft(e){if(this.leftToRight.has(e)){const t=this.leftToRight.get(e);return this.leftToRight.delete(e),this.rightToLeft.delete(t),!0}return!1}deleteRight(e){if(this.rightToLeft.has(e)){const t=this.rightToLeft.get(e);return this.leftToRight.delete(t),this.rightToLeft.delete(e),!0}return!1}*[E](){for(const[e,t]of this.leftToRight)yield[e,t]}}F=Symbol.iterator;class U{constructor(e,t,n){if(this.leftName=void 0,this.rightName=void 0,this.biMap=void 0,e===t)throw new B.D3("NamedBiMap left and right names are equal",{data:{name:e}});if(this.leftName=e,this.rightName=t,this.biMap=new Z,n)for(const[o,r]of n)this.biMap.assoc(o,r)}assoc(e){const t=e[this.leftName],n=e[this.rightName];return this.biMap.assoc(t,n),this}get(e){if(this.leftName in e){const t=e[this.leftName];return this.biMap.getLeft(t)}if(this.rightName in e){const t=e[this.rightName];return this.biMap.getRight(t)}throw new B.D3("NamedBiMap.get fallthrough should never occur",{data:e})}delete(e){if(this.leftName in e){const t=e[this.leftName];return this.biMap.deleteLeft(t)}if(this.rightName in e){const t=e[this.rightName];return this.biMap.deleteRight(t)}throw new B.D3("NamedBiMap.delete fallthrough should never occur",{data:e})}has(e){if(this.leftName in e){const t=e[this.leftName];return this.biMap.hasLeft(t)}if(this.rightName in e){const t=e[this.rightName];return this.biMap.hasRight(t)}throw new B.D3("NamedBiMap.has fallthrough should never occur",{data:e})}[F](){return this.biMap[Symbol.iterator]()}}class V extends D.Z{constructor(){super(...arguments),this.nodeMap=new U("node","ref",new Z)}register(e){const t=super.register(e),n=e.getNode();return n?this.nodeMap.assoc({node:n,ref:e}):this.nodeMap.delete({ref:e}),t}unregister(e){super.unregister(e),this.nodeMap.delete({ref:e})}getByDOMOrder(){const e=Array.from(this.nodeMap.biMap.rightToLeft.entries());return e.sort(((e,t)=>{const n=e[1],o=t[1];return(0,R.Z)(n,o)})),e.map((e=>{let[t,n]=e;return{node:n,leaf:t}}))}getParentContentEditableLeaf(e){const t=(0,S.X1)(e),n=t&&this.nodeMap.get({node:t});if(t&&n)return{node:t,leaf:n}}}var N=n(905162),O=n(206258),L=n(924666),j=n(785893);const K=!1,z=(0,i.forwardRef)((function(e,t){const{children:n,style:o,displayName:k,shouldSelectOnEnter:x}=e,I=!e.disabled,C=(0,i.useRef)(null),M=(0,i.useRef)(0),[R,D]=(0,i.useState)(null),B=(0,i.useRef)(!1),E=(0,i.useRef)(!1),[F]=(0,i.useState)((()=>function(e){return`${e}-${W++}`}(k))),Z=(0,i.useRef)(void 0),U=(0,i.useRef)({displayName:F}),[z]=(0,i.useState)((()=>new T)),[$]=(0,i.useState)((()=>new V)),[Y]=(0,i.useState)((()=>new l.T({onMutations(e){s.Z.withListenerIgnored((()=>{z.handleMutations(e)}))},enableLogging:!1}))),Q=(0,i.useRef)(!1),J=(0,i.useCallback)((e=>{Q.current!==e&&(Q.current=e,Y.mutate((()=>{var t,n;e?null===(t=C.current)||void 0===t||t.setAttribute(S.HM,"true"):null===(n=C.current)||void 0===n||n.removeAttribute(S.HM)})))}),[Y]),X=(0,i.useRef)(!1),ee=(0,i.useCallback)((e=>{X.current!==e&&(X.current=e,Y.mutate((()=>{var t,n;e?null===(t=C.current)||void 0===t||t.setAttribute(S._F,"true"):null===(n=C.current)||void 0===n||n.removeAttribute(S._F)})))}),[Y]),te=(0,i.useCallback)((e=>{C.current=e,Y.setNode(e),D(e)}),[Y]);(0,i.useImperativeHandle)(t,(()=>C.current));const ne=(0,c.O7)(),oe=(0,d.VK)((()=>(0,A.Aw)(ne)),[ne]);(0,i.useEffect)((()=>{if(R)return z.attachEventListeners({div:R,document:window.document})}),[z,R]);const{isAndroid:re}=ne.device;(0,i.useEffect)((()=>{const e=e=>{var t;const n=w.get(),o=(0,A.Zb)({range:n,contentEditableLeafRegistry:$,allowInvisibleEndSelection:!0,constraintToContentEditableRootNode:C.current||void 0}),r=L.default.state,i="editing"===r.mode?r.multiSelection:void 0;return{leafs:o,multiSelection:re&&e.isPhase("beforeInput")&&(!i||(0,P.iG)(i))&&w.isExpanded(n)?null===(t=(0,A.fx)({range:n,contentEditableLeafRegistry:$,allowInvisibleEndSelection:!0}))||void 0===t?void 0:t.multiSelection:i,range:w.toStaticRange(n)}};return z.onInputFlowChange((t=>{var n,o,i,a;ee(z.isComposing());const{flow:s,type:c,data:d}=t;if("end"===c)return void H("flow ended",d,s);if(K){const t=d.log||=[],n={phase:s.phase,hasMutations:Boolean(s.domMutations),target:e(s),isComposing:s.isComposing()};t.push(n),H("flow updated",s.phase,n)}const u=s.hasEvents(),p=K||b.default.isLocalhost||!u;var m;if("update"!==c||!s.isPhase("beforeInput")&&d.target||(d.target=e(s)),re&&"update"===c&&(0,N.Y)("supportsAlwaysMultiTextSelectionBehavior")&&"Unidentified"===(null===(n=s.keyDown)||void 0===n?void 0:n.event.key)&&"deleteContentBackward"===(null===(o=s.beforeInput)||void 0===o?void 0:o.event.inputType)&&null!==(i=d.target)&&void 0!==i&&i.multiSelection&&(0,P.ko)(null===(a=d.target)||void 0===a?void 0:a.multiSelection))s.isPhase("beforeInput")?(null===(m=s.beforeInput)||void 0===m||m.event.preventDefault(),s.domMutations&&(d.handledMutations=!0,H("deleteContentBackward: revertDOMMutation"),s.domMutations.mutations.forEach((e=>{(0,l.A)(e,p)})))):s.isPhase("keyUp")&&(H("deleteContentBackward: propagateShortcut backspace"),y.setMultiSelection({multiSelection:d.target.multiSelection}),v.dJ(ne,new KeyboardEvent("keydown"),"backspace"));else if("update"===c&&s.domMutations&&!d.handledMutations){var g,f;d.handledMutations=!0;const t=s.domMutations.mutations,n=d.target||e(s),o=null===(g=n.leafs)||void 0===g?void 0:g.start,i=null===(f=n.leafs)||void 0===f?void 0:f.start,a=null==o?void 0:o.leaf.getText();H("onMutations",d,a,s,o);let c=!1,m=!1,v=!1;for(let e=t.length-1;e>=0;e--){const n=t[e];G(n,o);const r=(0,S.xp)(n.target),i=(0,S.X1)(n.target);if(r===C.current){if((u||"attributes"!==n.type||"style"!==n.attributeName)&&("attributes"!==n.type||"dir"!==n.attributeName))if(o){if("childList"===n.type){const e=Array.from(n.removedNodes);m||=e.some(S.eD)||e.some(S.C7);const t=Array.from(n.addedNodes);v||=t.some(S.eD)}if(i&&i===o.node){switch(n.type){case"attributes":(0,l.A)(n,p);continue;case"characterData":case"childList":break;default:(0,h.t1)(n.type)}c=!0}else(0,l.A)(n,p)}else(0,l.A)(n,p)}else H("allowed mutation on interior region",r,n)}if(i&&(c||m)){var _,k,w,x;if("string"!=typeof a)throw new Error("focusedLeafText must be string");const e=null===(_=s.beforeInput)||void 0===_?void 0:_.event,t=null===(k=s.keyDown)||void 0===k?void 0:k.event.keyCode,n="enter"!==(void 0!==t&&r()(t))&&("insertLineBreak"===(null==e?void 0:e.inputType)||"insertParagraph"===(null==e?void 0:e.inputType)||"insertCompositionText"===(null==e?void 0:e.inputType)&&(null==e||null===(w=e.data)||void 0===w?void 0:w.endsWith("\n"))||re&&v),o={multiSelection:null===(x=d.target)||void 0===x?void 0:x.multiSelection,newValue:a,deletedLine:m,insertedLine:n,isComposing:z.isComposing()};H("delegateMutation",o),i.leaf.delegateMutation(o)}}}))}),[$,ne,z,re,ee]),(0,i.useEffect)((()=>{const e=C.current;e&&B.current&&Y.mutate((()=>{I?e.contentEditable="true":e.removeAttribute("contentEditable")}))}),[I,Y]);const ie=(0,i.useCallback)((()=>{const e=C.current;return!!e&&(B.current?("always"===oe&&J(!0),!1):(Y.mutate((()=>{I?e.contentEditable="true":e.removeAttribute("contentEditable"),(0,A.ri)(ne.device)&&(e.spellcheck=!1)})),Y.lock(U.current),B.current=!0,J("gesture"===oe),H("enableMultiSelection"),!0))}),[Y,oe,J,ne.device,I]),ae=(0,i.useCallback)((()=>{const e=C.current;return!(!B.current||!e)&&("always"===oe?(J(!1),!1):!z.isComposing()&&(Y.unlock(U.current),e.removeAttribute("contenteditable"),J(!1),H("disableMultiSelection"),B.current=!1,!0))}),[Y,oe,J,z]),se=(0,i.useCallback)((()=>{const e=C.current;if(!e)return;const t=w.get();if(null!=t&&t.collapsed&&(0,S.xp)(t.commonAncestorContainer)===e){const e=(0,S.X1)(t.commonAncestorContainer),n=t.startContainer,o=t.startOffset;if(e&&n&&(0,_.Lc)(e,n,o)){const r=e.getElementsByClassName(g.DK)[0];r&&(H("Move collapsed selection before EOL marker",{parentLeafNode:e,caretContainer:n,caretOffset:o}),t.setStartBefore(r),t.setEndBefore(r),w.set(t,ne.device))}}}),[ne.device]);(0,i.useEffect)((()=>{let e=w.get();function t(){var t;const n=null===(t=w.get())||void 0===t?void 0:t.cloneRange(),o=e;e=n;const r=C.current;r&&w.isExpanded(n)&&!w.isExpanded(o)&&(0,S.xp)(n.commonAncestorContainer)===r&&(0,S.X1)(n.commonAncestorContainer)&&ie()&&(r.focus(),w.isExpanded(w.get())||w.set(n,ne.device))}return document.addEventListener("selectionchange",t),document.addEventListener("selectionchange",se),()=>{document.removeEventListener("selectionchange",t),document.removeEventListener("selectionchange",se)}}),[ie,se,ne.device]);const le=(0,i.useCallback)((function(){const e=w.get();if(!w.isExpanded(e)&&ae()&&e){const t=q($,C.current,e);t&&t.node&&t.node instanceof HTMLElement&&t.node.focus(),w.set(e,ne.device)}}),[$,ae,ne.device]),ce=(0,i.useMemo)((()=>f.Ds(le,50)),[le]),{KeyboardShortcutStackStore:de}=ne,ue=(0,i.useRef)(),pe=(0,i.useCallback)((function(e){const t=C.current;if(!t)return;if(!B.current)return;if(y.maybeHandleExpectedBrowserSelectionUpdate("reactSelectionChange"))return void H("maybeHandleExpectedBrowserSelectionUpdate() returned true");const n=w.get();if(H("onSelect (react selection)",w.toStaticRange(n)),!ue.current&&n&&be.current&&n.commonAncestorContainer===be.current)w.clear(ne);else if(!(ue.current&&n&&w.areRangesEqual(n,ue.current))){if(ue.current=w.toStaticRange(n),n){const o=n.startContainer===t&&0===n.startOffset&&n.endContainer===t&&0===n.endOffset,r=be.current&&n.startContainer===be.current&&Se.current&&n.endContainer===Se.current,i=ne.device.isIOS&&ne.device.isMobileNative&&e.timeStamp-M.current>500&&function(e,t,n){if(!e.collapsed||0!==e.startOffset)return!1;const o=(0,A.Zb)({range:e,contentEditableLeafRegistry:t,allowInvisibleEndSelection:!0,constraintToContentEditableRootNode:n}),r=t.getByDOMOrder()[0];return Boolean(r&&o&&o.start.leaf===r.leaf)}(n,$,t);if(o||r||i)return H("onSelect: propagateShortcut selectAll"),void v.dJ({KeyboardShortcutStackStore:de},new KeyboardEvent("keydown"),"selectAll")}if("contextmenu"!==e.nativeEvent.type){if(n&&(w.isExpanded(n)||"always"===oe)&&(0,S.xp)(n.commonAncestorContainer)===t){if(E.current)return void(Z.current=e);const t=q($,C.current,n);t&&(H("onSelect: delegateSelection",t),t.leaf.delegateSelection("start"))}w.isExpanded(n)||ce()}}}),[oe,$,ce,de,ne]);(0,i.useEffect)((()=>{if(!I){function e(){const e=w.get(),t=C.current;if(!t||!e)return;const n=(0,A.fx)({contentEditableLeafRegistry:$,range:e,allowInvisibleEndSelection:!0});n&&(0,S.xp)(e.commonAncestorContainer)===t&&y.selectAndEditMultiSelection({...n,environment:ne,focus:"start",readOnly:"infer"})}return document.addEventListener("selectionchange",e),()=>document.removeEventListener("selectionchange",e)}}),[ne,I,$]);const me=(0,i.useCallback)((()=>{E.current=!0,Z.current=void 0}),[]),ge=(0,i.useCallback)((e=>{const t=Z.current;if(E.current=!1,Z.current=void 0,M.current=e.timeStamp,t){const e=q($,C.current);H("handleTouchEnd: delegateSelection",e),null==e||e.leaf.delegateSelection("start")}}),[$]),fe=(0,i.useCallback)((e=>{if(M.current=e.timeStamp,!B.current)return;e.target!==C.current||"Enter"!==e.key||!1!==e.ctrlKey||!1!==e.metaKey||!1!==e.altKey||!1!==e.shiftKey||x&&!x()||void 0!==w.get()||!be.current||w.setOnNode(be.current,ne.device);const t=q($,C.current);H("handleKeyDown: delegateKeyDown",t),null==t||t.leaf.delegateKeyDown(e)}),[$,ne.device,x]);(0,i.useEffect)((()=>{const e=C.current;if(e)return e.addEventListener("beforeinput",t),()=>e.removeEventListener("beforeinput",t);function t(e){if(!B.current)return;const t=q($,C.current);null==t||t.leaf.delegateBeforeInput(e)}}),[$]),(0,i.useEffect)((()=>{"always"!==oe||B.current||ie()}),[ie,oe]);const he=(0,i.useCallback)((()=>{const e=w.get();return!w.isExpanded(e)&&ae()}),[ae]),ve=(0,i.useCallback)((()=>!re&&Boolean(z.isComposing())),[z,re]),ye=(0,u.yK)((e=>{const t={height:1,width:1,caretColor:"transparent"};return{div:{caretColor:e.regularTextColor,...o},whenContentEditable:{WebkitUserModify:"read-write-plaintext-only"},selectionTrapStart:{...t,marginTop:-1},selectionTrapEnd:t}}),[o]),be=(0,i.useRef)(null),_e=(0,j.jsx)("span",{style:ye.selectionTrapStart,ref:be,...S.d_}),Se=(0,i.useRef)(null),ke=(0,j.jsx)("span",{style:ye.selectionTrapEnd,ref:Se,...S.d_}),we=(0,i.useCallback)((()=>{if(!w.get()&&"editing"===L.default.state.mode){const e=L.default.state.multiSelection.start.store;if(e instanceof O.G){const t=e.getType();if(t===p.Ti.linkToPage||t===p.Ti.linkToCollection)return}y.clear({environment:ne})}}),[ne]),xe=(0,i.useCallback)((()=>{!C.current||w.get()&&"empty"!==L.default.state.mode||C.current.blur()}),[]);return(0,j.jsx)("div",{onBlur:ne.device.isIOS?we:void 0,onFocus:ne.device.isIOS?xe:void 0,onTouchStart:me,onTouchEnd:ge,onTouchCancel:ge,onKeyDown:fe,onCompositionEnd:function(e){if(!B.current)return;const t=q($,C.current);null==t||t.leaf.delegateCompositionEnd(e)},ref:te,...(0,m.iv)(ye.div,{whenContentEditable:ye.whenContentEditable}),onSelect:pe,...S.GZ,children:(0,j.jsxs)(a.c1,{id:F,tryEnableMultiSelection:ie,tryDisableMultiSelection:he,isComposing:ve,domLock:Y,contentEditableLeafRegistry:$,children:[_e,n,ke]})})}));function q(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w.get();const o=(0,A.Zb)({range:n,contentEditableLeafRegistry:e,allowInvisibleEndSelection:!0,constraintToContentEditableRootNode:t||void 0});if(o)return o.start}function H(){if(K){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.warn("ContentEditableRoot:",...t)}}function G(e){const t={};if(t.type=e.type,t.target=e.target,t.targetIsText=e.target.nodeType===Node.TEXT_NODE,t.targetIsLeaf=(0,S.eD)(e.target),e.addedNodes.length){const n=Array.from(e.addedNodes);t.added=n,t.addedALeaf=n.some(S.eD),t.addedAText=n.some((e=>e.nodeType===Node.TEXT_NODE))}if(e.removedNodes.length){const n=Array.from(e.removedNodes);t.removed=n,t.removedALeaf=n.some(S.eD),t.removedAText=n.some((e=>e.nodeType===Node.TEXT_NODE))}"characterData"===e.type&&(t.newChars=e.target.textContent,t.oldChars=e.oldValue),t.mutation=e;for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];H("mutation: ",t,...o)}let W=0},668709:(e,t,n)=>{n.d(t,{p:()=>c});var o=n(667294),r=n(460177),i=n(222491),a=n(146150),s=n(785893);const l={WebkitUserSelect:"none",userSelect:"none",pseudoSelection:{background:"transparent"}},c=o.forwardRef(((e,t)=>{const{allowSelectionWithin:n,style:o,className:c,...d}=e,u=(0,r.Dl)(),p=(0,s.jsx)("div",{ref:t,contentEditable:!1,...(0,i.iv)(c,!n&&l,o),...a.G0,...d});return u?(0,s.jsx)(r.c1,{void:!0,children:p}):p}));c.displayName="ContentEditableVoid"},110182:(e,t,n)=>{n.d(t,{Z:()=>C});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(686658),l=n(853028),c=n(709291),d=n(950950),u=n(843250),p=n(460709),m=n(461893),g=n(960709),f=n(552275),h=n(231945),v=n(478140),y=n(632163),b=n(489728),_=n(672495),S=n(824006),k=n(164369),w=n(785893);function x(e){let{hasDismissButton:t,onDismiss:n}=e;const i=(0,r.O7)(),g=(0,a.Fg)(),f=(0,c.useIntl)(),[h,S]=(0,o.useState)(!1);(0,o.useEffect)((()=>()=>{t||h&&d.qo()}),[f,h,t]);const x=[{key:"trackingTypes",render:e=>(0,w.jsx)(_.Z,{...e,topBorder:0!==e.index}),items:l.m4.map((e=>({key:e,render:t=>(0,w.jsx)(I,{menuListItemProps:t,trackingType:e,setShowReloadOnMenuClose:S,isNativeiOSApp:i.device.isMobileNative&&i.device.isIOS}),action:()=>d.Nh(i,e)})))}];return(0,w.jsxs)(v.Z,{className:u.N7t,menuType:p.og.Popup,width:260,children:[(0,w.jsx)("div",{style:{display:"flex",alignItems:"center",paddingTop:t?4:0},children:t&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(k.Z,{isSmall:!0,isMultiline:!0,style:{width:"80%",paddingLeft:14},children:(0,w.jsx)("b",{children:(0,w.jsx)(c.FormattedMessage,{...s.ze.customizeCookiesHeader})})}),(0,w.jsx)(b.Z,{style:{float:"right",marginLeft:-8,paddingLeft:8,paddingRight:8,color:g.blueColor},onClick:()=>{d.OM(i,m.Z.getPermission()),n&&n()},children:(0,w.jsx)(c.FormattedMessage,{...s.ze.cookieDismissButtonLabel})})]})}),(0,w.jsx)(y.Z,{type:y.i.Vertical,initialFocus:void 0,sections:x})]})}function I(e){const{menuListItemProps:t,trackingType:n,setShowReloadOnMenuClose:o,isNativeiOSApp:l}=e,{title:u,caption:p,subtitle:g}=(0,s.G_)(n,l),[{permission:h}]=(0,i.AF)(m.Z),v=(0,a.Fg)(),y=(0,r.O7)();return(0,w.jsx)(f.Z,{...t,title:(0,w.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,w.jsx)("div",{style:{marginRight:0},children:(0,w.jsx)(c.FormattedMessage,{...u})})}),caption:(0,w.jsxs)("div",{children:[g&&(0,w.jsx)("div",{children:(0,w.jsx)("span",{style:{color:v.errorText},children:(0,w.jsx)(c.FormattedMessage,{...g})})}),(0,w.jsx)("div",{children:(0,w.jsx)("span",{style:{color:v.mediumTextColor},children:(0,w.jsx)(c.FormattedMessage,{...p})})})]}),shouldWrapCaption:!0,right:(0,w.jsx)("div",{style:{display:"flex",width:"100%",alignItems:"center",cursor:"pointer"},children:(0,w.jsx)(S.Z,{on:h[n],disabled:"necessary"===n,onClick:()=>{o(!0),d.Nh(y,n)}})})})}const C=function(e){let{renderOrigin:t,hasDismissButton:n,onDismiss:o}=e;return(0,w.jsx)(h.ZP,{popupType:h.Z4.Popup,placementToOrigin:g.Iw.Bottom,alignmentToOrigin:g.lU.Start,renderOrigin:t,render:()=>(0,w.jsx)(x,{hasDismissButton:n,onDismiss:o})})}},442918:(e,t,n)=>{n.d(t,{Z:()=>l});n(667294);var o=n(800480),r=n(886628),i=n(667946),a=n(95477),s=n(785893);const l=function(e){let{emojiStore:t,size:n}=e;const l=(0,o.O7)();return(0,r.VK)((()=>{const e=null==t?void 0:t.getModel();return e&&e.alive?(0,s.jsx)(i.Z,{emojiId:t.id,emojiName:e.name,emojiUrl:e.url,spaceId:e.space_id,size:n,baseUrl:a.default.domainBaseUrl,currentUserId:l.currentUser.id}):(0,s.jsx)(s.Fragment,{})}),[t,n,l.currentUser.id])}},693262:(e,t,n)=>{n.d(t,{Z:()=>V});var o=n(667294),r=n(883355),i=n(701302),a=n(421838),s=n(401898),l=n(42239),c=n(587420),d=n(452423),u=n(524677),p=n(898104),m=n(884064),g=n(214976),f=n(212534),h=n(928314),v=n(98742),y=n(639500),b=n(745162),_=n(273959),S=n(389224),k=n(489086),w=n(828685),x=n(95802),I=n(626765),C=n(155367),T=n(400807),M=n(385555),P=n(222294),A=n(188923),R=n(569784),D=n(27724),B=n(924666),E=n(706685),F=n(203386),Z=n(785893);class U extends r.Z{constructor(){super(...arguments),this.isSelected=!1,this.shouldEditOnClick=!0,this.shouldDisableMultiSelectionOnDragEnd=!1,this.contentEditableLeafRef=o.createRef(),this.wrapperRef=o.createRef(),this.handleDragStart=e=>{const t=this.getContextClosestSelectableStore();e.shiftKey&&!this.isEditingStore.state&&t?(e.preventDefault(),u.Ys({environment:this.environment,store:t,toggle:u.ji(this.environment),selectBetween:u.OS()}),this.shouldEditOnClick=!1):this.shouldEditOnClick=!0},this.handleDragMove=e=>{if(C.ZP.state.isDragging)l.td(this.environment,{currentX:e.currentX,currentY:e.currentY});else if(e.shiftKey)y.X9()&&l.f$(this.environment,{startX:e.startX,startY:e.startY,stores:D.default.state.stores,isNativeDrag:!1,getGhostElement:void 0});else if(!R.default.state.isActive){var t;if(!this.props.canSelectionDrag)return;const n=this.getNode();if(!n)return;const o=I.jn(n.getBoundingClientRect(),20);if(I.uh(o,e.currentX,e.currentY))return;"mouse"===e.device&&null!==(t=this.contentEditableContext)&&void 0!==t&&t.tryEnableMultiSelection()&&(this.shouldDisableMultiSelectionOnDragEnd=!0)}},this.handleDragEnd=e=>{var t;this.shouldDisableMultiSelectionOnDragEnd&&(null===(t=this.contentEditableContext)||void 0===t||t.tryDisableMultiSelection(),this.shouldDisableMultiSelectionOnDragEnd=!1);C.ZP.state.isDragging?l.fX({environment:this.environment,shiftKey:e.shiftKey,optionKey:e.optionKey,commandKey:e.commandKey,analyticsFrom:"page_content"}):p.clearForceExtendAnnotations()},this.handleClick=e=>{const{device:t}=this.environment;(0,f.ZP)({event:e,context:f.Af.EditorClick,callback:()=>{if(this.props.onClick&&this.props.onClick(e),e.defaultPrevented)return;const n=D.default.getDefaultContainerFromTarget(e.target);if(!A.default.isSidePeekOpen()||null!=n&&n.isPeekRenderer()||c.E5(this.environment),this.shouldEditOnClick){const n=this.getContextClosestSelectableStore();if(n?u.eP({environment:this.environment,store:n}):(u.Af({stores:[]}),u.$Y({environment:this.environment,phase:D.SelectionPhase.Selected,preventClearEditingText:!0})),t.isMobile&&!this.isEditingStore.state&&!this.isPartOfSelectionStore.state){const t=this.getNode();if(t){let n;if(this.mutateDOM((()=>{t.classList.add("editor-force-select"),n=S.rangeFromPoint(e.clientX,e.clientY),t.classList.remove("editor-force-select")})),n){const e=function(e,t){return(0,g.Ut)(t,e)}(n,this.environment);var o;if(e)p.setSelection({store:this.props.store,selection:e.selection,readOnly:M.default.checkGate({gateName:"mobile_fix_ai_message_click"})?this.props.disabled||(null===(o=this.getContentEditableLeaf())||void 0===o?void 0:o.isDisabled()):void 0}),e.forceEmitSelectionStore&&B.default.emit()}}}this.saveSerializedTextSelectionAfterFlush()}else this.shouldEditOnClick=!0}})},this.handleContextMenu=e=>{this.props.onContextMenu&&(0,f.ZP)({event:e,context:f.Af.EditorContextMenu,callback:()=>{var t,n;if(null===(t=(n=this.props).onContextMenu)||void 0===t||t.call(n,e),!e.defaultPrevented)return"unhandled"}}),(0,f.ZP)({event:e,context:f.Af.EditorContextMenu,callback:()=>{this.saveSerializedTextSelectionAfterFlush()}})},this.handleSelect=e=>{const{device:t}=this.environment;t.isMobile?this.handleMobileSelect(e):this.handleDesktopSelect(e)},this.handleMobileSelect=e=>{if(!this.props.disabled){if(!S.get())return;const t=this.getContextClosestSelectableStore();this.isEditingStore.state||u.eP({environment:this.environment,store:t}),this.saveSerializedTextSelection(e),i.default.flush()}},this.handleDesktopSelect=e=>{this.props.disabled||!this.isEditingStore.state&&"contain"===e.endpoint||this.saveSerializedTextSelection(e)},this.defaultShortcutHandlers={onEsc:e=>{if(this.props.disabled)return;e.preventDefault();const t="empty"!==B.default.state.mode&&B.default.state.multiSelection,n=t&&(0,b.tp)({multiSelection:t,filterCommonAncestors:!0,focus:void 0});if(n)return void u.Z5({environment:this.environment,...n});const o=this.getContextClosestSelectableStore();if(o){const e=x.C.findSelectableFromStore(o);e&&e.props.canSelect&&u.Z5({environment:this.environment,stores:[o]})}},onUp:e=>{var t;this.props.disabled||p.arrowUpMultiText({environment:this.environment,topBottomPadding:this.props.topBottomPadding,event:e,contentEditableLeafRegistry:null===(t=this.contentEditableContext)||void 0===t?void 0:t.contentEditableLeafRegistry})},onDown:e=>{var t;this.props.disabled||p.arrowDownMultiText({environment:this.environment,topBottomPadding:this.props.topBottomPadding,event:e,contentEditableLeafRegistry:null===(t=this.contentEditableContext)||void 0===t?void 0:t.contentEditableLeafRegistry})},onLeft:e=>{if(this.props.disabled)return;const t=this.getNode();var n,o;M.default.checkGate({gateName:"editor_basic_rtl"})&&t&&"rtl"===getComputedStyle(t).direction?p.arrowRightMultiText({environment:this.environment,event:e,contentEditableLeafRegistry:null===(n=this.contentEditableContext)||void 0===n?void 0:n.contentEditableLeafRegistry,editorMode:j(this.props.isDiscussionInput,this.props.store)}):p.arrowLeftMultiText({environment:this.environment,event:e,contentEditableLeafRegistry:null===(o=this.contentEditableContext)||void 0===o?void 0:o.contentEditableLeafRegistry})},onRight:e=>{if(this.props.disabled)return;const t=this.getNode();var n,o;M.default.checkGate({gateName:"editor_basic_rtl"})&&t&&"rtl"===getComputedStyle(t).direction?p.arrowLeftMultiText({environment:this.environment,event:e,contentEditableLeafRegistry:null===(n=this.contentEditableContext)||void 0===n?void 0:n.contentEditableLeafRegistry}):p.arrowRightMultiText({environment:this.environment,event:e,contentEditableLeafRegistry:null===(o=this.contentEditableContext)||void 0===o?void 0:o.contentEditableLeafRegistry,editorMode:j(this.props.isDiscussionInput,this.props.store)})},onSelectAll:e=>{var t;this.props.disabled||(e.preventDefault(),p.selectAllTextMulti({environment:this.environment,store:this.props.store,canSelectAllBlocks:this.props.canSelectAllBlocks,contentEditableContextId:null===(t=this.contentEditableContext)||void 0===t?void 0:t.id}))},onUndo:e=>{e.preventDefault(),d.Yw(this.environment)},onRedo:e=>{e.preventDefault(),d.KX(this.environment)},onGoToBeginningOfLine:e=>{N("start",e.shiftKey)},onGoToEndOfLine:e=>{N("end",e.shiftKey)}},this.saveSerializedTextSelectionAfterFlush=()=>{i.default.afterNextFlush((()=>{this.saveSerializedTextSelection()}))},this.isPartOfSelectionStore=this.createComputedStore((()=>(0,k.ZZ)(this.props.store)),{debugName:"isPartOfSelection"}),this.isEditingStore=this.createComputedStore((()=>(0,k.J5)(this.props.store)),{debugName:"isEditing"})}get registries(){return[w.E]}getContentEditableLeaf(){return this.contentEditableLeafRef.current||void 0}getNode(){return this.wrapperRef.current?this.wrapperRef.current:this.contentEditableLeafRef.current?this.contentEditableLeafRef.current.getNode():super.getNode()}didMountOrUpdate(){this.isEditingStore.state?this.isSelected||(this.isSelected=!0,this.props.onSelected&&this.props.onSelected()):this.isSelected&&(this.isSelected=!1,function(e){e()}(this.props.clearBrowserSelection),this.props.onDeselected&&this.props.onDeselected())}willUnmount(){if(this.isSelected){this.isSelected=!1,this.props.onDeselected&&this.props.onDeselected();const e=this.isEditingStore.state;i.default.afterNextFlush((()=>{const t=w.E.findEditableWithStore(this.props.store),n=this.isEditingStore.state;e&&n&&!this.componentIsMounted&&!t&&p.clear({environment:this.environment})}))}}shouldComponentUpdate(e){return!0}getContextClosestSelectable(){var e;return null===(e=this.context.selectable)||void 0===e?void 0:e.closestSelectable}getContextClosestSelectableStore(){var e;return null===(e=this.context.selectable)||void 0===e||null===(e=e.closestSelectable)||void 0===e||null===(e=e.props)||void 0===e?void 0:e.store}renderComponent(){const{disabled:e,disableUpDownArrows:t,disableEnter:n}=this.props,o=this.isEditingStore.state;return(0,Z.jsx)(F.Z,{debugName:"Editable",capture:o&&!e,onDelete:this.getShortcutHandler("onDelete"),onDeleteToEndOfLine:this.getShortcutHandler("onDeleteToEndOfLine"),onDeleteNextWord:this.getShortcutHandler("onDeleteNextWord"),onBackspace:this.getShortcutHandler("onBackspace"),onEnter:n?void 0:this.getShortcutHandler("onEnter"),onShiftEnter:this.getShortcutHandler("onShiftEnter"),onCommandEnter:this.getShortcutHandler("onCommandEnter"),onCommandShiftEnter:this.getShortcutHandler("onCommandShiftEnter"),onUp:t?void 0:this.getShortcutHandler("onUp"),onDown:t?void 0:this.getShortcutHandler("onDown"),onLeft:this.getShortcutHandler("onLeft"),onRight:this.getShortcutHandler("onRight"),onCommandLeft:this.getShortcutHandler("onCommandLeft"),onCommandRight:this.getShortcutHandler("onCommandRight"),onTab:this.getShortcutHandler("onTab"),onUntab:this.getShortcutHandler("onUntab"),onSelectAll:this.getShortcutHandler("onSelectAll"),onToggleUnderline:this.getShortcutHandler("onToggleUnderline"),onToggleHighlight:this.getShortcutHandler("onToggleHighlight"),onToggleBold:this.getShortcutHandler("onToggleBold"),onToggleItalics:this.getShortcutHandler("onToggleItalics"),onToggleStrike:this.getShortcutHandler("onToggleStrike"),onToggleCode:this.getShortcutHandler("onToggleCode"),onUndo:this.getShortcutHandler("onUndo"),onRedo:this.getShortcutHandler("onRedo"),onEsc:this.getShortcutHandler("onEsc"),onCut:this.getShortcutHandler("onCut"),onCopy:this.getShortcutHandler("onCopy"),onPaste:this.getShortcutHandler("onPaste"),onKeypress:this.getShortcutHandler("onKeyPress"),onMoveUp:this.getShortcutHandler("onMoveUp"),onMoveDown:this.getShortcutHandler("onMoveDown"),onHome:this.saveSerializedTextSelectionAfterFlush,onEnd:this.saveSerializedTextSelectionAfterFlush,onGoToBeginningOfLine:this.getShortcutHandler("onGoToBeginningOfLine"),onGoToEndOfLine:this.getShortcutHandler("onGoToEndOfLine"),onGoForwardOneChar:this.saveSerializedTextSelectionAfterFlush,onGoBackwardOneChar:this.saveSerializedTextSelectionAfterFlush,children:this.renderDraggable()})}renderDraggable(){const e=this.isEditingStore.state;return(0,Z.jsx)(E.Z,{disabled:this.props.disableDrag,onDraggableDragStart:this.handleDragStart,onDraggableDragMove:this.handleDragMove,onDraggableDragEnd:this.handleDragEnd,onDraggableDragCancel:e=>{return t=this.environment,void(C.ZP.state.isDragging&&(l.cQ(t),u.ZH({environment:t})));var t},cursor:"text",render:t=>this.props.render((0,v.Z)(t,{leafRef:this.contentEditableLeafRef,wrapperRef:this.wrapperRef,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onKeyDown:O,onDoubleClick:L}),this.handleSelect,Boolean(e)),enableAndroidContextMenu:this.props.disabled,disableHorizontalEdgeScroll:this.props.disableHorizontalEdgeScroll})}getShortcutHandler(e){const t=this.props[e],n=this.defaultShortcutHandlers[e];return t??n}saveSerializedTextSelection(e){var t;const n=S.get(),o=(0,b.fx)({contentEditableLeafRegistry:null===(t=this.contentEditableContext)||void 0===t?void 0:t.contentEditableLeafRegistry,range:n,allowInvisibleEndSelection:(0,h.yA)().shift});o&&p.selectAndEditMultiSelection({environment:this.environment,...o,readOnly:"infer",focus:void 0})}}U.displayName="Editable",U.contextTypes={...m.Tf,...r.w};const V=U;function N(e,t){const n=B.default.state;"empty"!==n.mode&&i.default.afterNextFlush((()=>{const{start:o,end:r}=n.multiSelection;switch(e){case"start":{const e=o.store.getValue();if(!e)return;const n=a.Oqk({textValue:e,substring:"\n",ignoreCase:!1}).reverse().find((e=>{let{endIndex:t}=e;return t<=o.index})),i=(null==n?void 0:n.endIndex)??0,s={store:o.store,index:i};p.setMultiSelection({multiSelection:{start:s,end:t?r:s}});break}case"end":{const e=(0,k.x0)(r.store);if(!e)return;const n=o.store.getValue();if(!n)return;const i=a.Oqk({textValue:n,substring:"\n",ignoreCase:!1}).find((e=>{let{startIndex:t}=e;return t>=r.index})),s=(null==i?void 0:i.startIndex)??e.endIndex,l={store:r.store,index:s};p.setMultiSelection({multiSelection:{start:t?o:l,end:l}});break}default:(0,s.t1)(e)}}))}function O(e){e.metaKey||e.ctrlKey||e.altKey||P.Z.setKeyboardMode(!0)}function L(e){(0,f.ZP)({event:e,context:f.Af.EditorDoubleClick,callback:()=>{}})}function j(e,t){if(e)return"default";const n=(0,_.sQ)(t);return n?T.Z.getMode(n):"default"}},487929:(e,t,n)=>{n.d(t,{Z:()=>z});var o=n(667294),r=n(460177),i=n(701302),a=n(800480),s=n(81234),l=n(533125),c=n(886628),d=n(421838),u=n(926249),p=n(401898),m=n(42239),g=n(587420),f=n(452423),h=n(524677),v=n(898104),y=n(884064),b=n(214976),_=n(212534),S=n(928314),k=n(98742),w=n(639500),x=n(745162),I=n(273959),C=n(389224),T=n(489086),M=n(828685),P=n(95802),A=n(626765),R=n(155367),D=n(400807),B=n(385555),E=n(222294),F=n(188923),Z=n(569784),U=n(27724),V=n(924666),N=n(129595),O=n(706685),L=n(203386),j=n(785893);function K(e){var t;const{canSelectAllBlocks:n,canSelectionDrag:d,clearBrowserSelection:u,disabled:p,disableUpDownArrows:I,disableDrag:D,disableEnter:E,disableHorizontalEdgeScroll:K,isDiscussionInput:z,onClick:$,onContextMenu:Y,onDeselected:Q,onSelected:J,render:X,store:ee}=e,te=(0,a.O7)(),ne=(0,o.useRef)(null),oe=(0,o.useRef)(null),re=(0,o.useRef)(!1),ie=(0,o.useRef)(!0),ae=(0,o.useRef)(!1),se=(0,o.useRef)(!1);(0,o.useEffect)((()=>{se.current?re.current||(re.current=!0,J&&J()):re.current&&(re.current=!1,u(),Q&&Q())}),[u,Q,J]),(0,s.L)((()=>{if(re.current){re.current=!1,Q&&Q();const e=se.current;i.default.afterNextFlush((()=>{const t=M.E.findEditableWithStore(ee),n=se.current;e&&n&&!t&&v.clear({environment:te})}))}}));const le=(0,r.Dl)(),ce=(0,o.useContext)(y.aT),de=null===(t=ce.closestSelectable)||void 0===t||null===(t=t.props)||void 0===t?void 0:t.store,ue=(0,c.VK)((()=>(0,T.ZZ)(e.store)),[e.store],{debugName:"isPartOfSelection"}),pe=(0,c.VK)((()=>(0,T.J5)(e.store)),[e.store],{debugName:"isEditing"});(0,o.useEffect)((()=>{se.current=Boolean(pe)}),[pe]);const me=(0,o.useCallback)((()=>ne.current?ne.current:oe.current?oe.current.getNode():null),[]),ge=(0,o.useCallback)((()=>oe.current||void 0),[]),fe=(0,o.useCallback)((e=>{const t=C.get(),n=(0,x.fx)({contentEditableLeafRegistry:null==le?void 0:le.contentEditableLeafRegistry,range:t,allowInvisibleEndSelection:(0,S.yA)().shift});n&&v.selectAndEditMultiSelection({environment:te,...n,readOnly:"infer",focus:void 0})}),[null==le?void 0:le.contentEditableLeafRegistry,te]),he=(0,o.useCallback)((()=>{i.default.afterNextFlush((()=>{fe()}))}),[fe]),ve=(0,o.useCallback)((e=>{e.shiftKey&&!pe&&de?(e.preventDefault(),h.Ys({environment:te,store:de,toggle:h.ji(te),selectBetween:h.OS()}),ie.current=!1):ie.current=!0}),[de,te,pe]),ye=(0,o.useCallback)((e=>{if(R.ZP.state.isDragging)m.td(te,{currentX:e.currentX,currentY:e.currentY});else if(e.shiftKey)w.X9()&&m.f$(te,{startX:e.startX,startY:e.startY,stores:U.default.state.stores,isNativeDrag:!1,getGhostElement:void 0});else if(!Z.default.state.isActive){if(!d)return;const t=me();if(!t)return;const n=A.jn(t.getBoundingClientRect(),20);if(A.uh(n,e.currentX,e.currentY))return;"mouse"===e.device&&null!=le&&le.tryEnableMultiSelection()&&(ae.current=!0)}}),[d,le,te,me]),be=(0,o.useCallback)((e=>{ae.current&&(null==le||le.tryDisableMultiSelection(),ae.current=!1),R.ZP.state.isDragging?m.fX({environment:te,shiftKey:e.shiftKey,optionKey:e.optionKey,commandKey:e.commandKey,analyticsFrom:"page_content"}):v.clearForceExtendAnnotations()}),[le,te]),_e=(0,o.useCallback)((e=>{const{device:t}=te;(0,_.ZP)({event:e,context:_.Af.EditorClick,callback:()=>{if($&&$(e),e.defaultPrevented)return;const n=U.default.getDefaultContainerFromTarget(e.target);if(!F.default.isSidePeekOpen()||null!=n&&n.isPeekRenderer()||g.E5(te),ie.current){if(de?h.eP({environment:te,store:de}):(h.Af({stores:[]}),h.$Y({environment:te,phase:U.SelectionPhase.Selected,preventClearEditingText:!0})),t.isMobile&&!pe&&!ue){const t=me();if(t){let n;if((0,N.y)(le,(()=>{t.classList.add("editor-force-select"),n=C.rangeFromPoint(e.clientX,e.clientY),t.classList.remove("editor-force-select")})),n){const e=function(e,t){return(0,b.Ut)(t,e)}(n,te);var o;if(e)v.setSelection({store:ee,selection:e.selection,readOnly:B.default.checkGate({gateName:"mobile_fix_ai_message_click"})?p||(null===(o=ge())||void 0===o?void 0:o.isDisabled()):void 0}),e.forceEmitSelectionStore&&V.default.emit()}}}he()}else ie.current=!0}})}),[de,le,p,te,ge,me,pe,ue,$,he,ee]),Se=(0,o.useCallback)((e=>{Y&&(0,_.ZP)({event:e,context:_.Af.EditorContextMenu,callback:()=>{if(null==Y||Y(e),!e.defaultPrevented)return"unhandled"}}),(0,_.ZP)({event:e,context:_.Af.EditorContextMenu,callback:()=>{he()}})}),[Y,he]),ke=(0,o.useCallback)((e=>{if(!p){if(!C.get())return;pe||h.eP({environment:te,store:de}),fe(e),i.default.flush()}}),[de,p,te,pe,fe]),we=(0,o.useCallback)((e=>{p||!pe&&"contain"===e.endpoint||fe(e)}),[p,pe,fe]),xe=(0,o.useCallback)((e=>{const{device:t}=te;t.isMobile?ke(e):we(e)}),[te,we,ke]),Ie=(0,o.useMemo)((()=>({onEsc:e=>{if(p)return;e.preventDefault();const t="empty"!==V.default.state.mode&&V.default.state.multiSelection,n=t&&(0,x.tp)({multiSelection:t,filterCommonAncestors:!0,focus:void 0});if(n)h.Z5({environment:te,...n});else if(de){const e=P.C.findSelectableFromStore(de);e&&e.props.canSelect&&h.Z5({environment:te,stores:[de]})}},onUp:t=>{p||v.arrowUpMultiText({environment:te,topBottomPadding:e.topBottomPadding,event:t,contentEditableLeafRegistry:null==le?void 0:le.contentEditableLeafRegistry})},onDown:t=>{p||v.arrowDownMultiText({environment:te,topBottomPadding:e.topBottomPadding,event:t,contentEditableLeafRegistry:null==le?void 0:le.contentEditableLeafRegistry})},onLeft:e=>{if(p)return;const t=me();B.default.checkGate({gateName:"editor_basic_rtl"})&&t&&"rtl"===getComputedStyle(t).direction?v.arrowRightMultiText({environment:te,event:e,contentEditableLeafRegistry:null==le?void 0:le.contentEditableLeafRegistry,editorMode:W(z,ee)}):v.arrowLeftMultiText({environment:te,event:e,contentEditableLeafRegistry:null==le?void 0:le.contentEditableLeafRegistry})},onRight:e=>{if(p)return;const t=me();B.default.checkGate({gateName:"editor_basic_rtl"})&&t&&"rtl"===getComputedStyle(t).direction?v.arrowLeftMultiText({environment:te,event:e,contentEditableLeafRegistry:null==le?void 0:le.contentEditableLeafRegistry}):v.arrowRightMultiText({environment:te,event:e,contentEditableLeafRegistry:null==le?void 0:le.contentEditableLeafRegistry,editorMode:W(z,ee)})},onSelectAll:e=>{p||(e.preventDefault(),v.selectAllTextMulti({environment:te,store:ee,canSelectAllBlocks:n,contentEditableContextId:null==le?void 0:le.id}))},onUndo:e=>{e.preventDefault(),f.Yw(te)},onRedo:e=>{e.preventDefault(),f.KX(te)},onGoToBeginningOfLine:e=>{q("start",e.shiftKey)},onGoToEndOfLine:e=>{q("end",e.shiftKey)}})),[n,de,null==le?void 0:le.contentEditableLeafRegistry,null==le?void 0:le.id,p,te,me,z,e.topBottomPadding,ee]),Ce=(0,o.useCallback)((t=>{const n=e[t],o=Ie[t];return n??o}),[Ie,e]);(0,l.c)(M.E,(()=>({props:e,contentEditableContext:le,getContentEditableLeaf:ge,getNode:me,getContextClosestSelectable:()=>ce.closestSelectable,getContextClosestSelectableStore(){var e;return null===(e=ce.closestSelectable)||void 0===e||null===(e=e.props)||void 0===e?void 0:e.store},handleClick:_e})),[]);const Te=(0,c.VK)((()=>(0,j.jsx)(O.Z,{disabled:D,onDraggableDragStart:ve,onDraggableDragMove:ye,onDraggableDragEnd:be,onDraggableDragCancel:e=>function(e,t){R.ZP.state.isDragging&&(m.cQ(t),h.ZH({environment:t}))}(0,te),cursor:"text",render:e=>X((0,k.Z)(e,{leafRef:oe,wrapperRef:ne,onClick:_e,onContextMenu:Se,onKeyDown:H,onDoubleClick:G}),xe,Boolean(pe)),enableAndroidContextMenu:p,disableHorizontalEdgeScroll:K})),[D,K,p,te,_e,Se,be,ye,ve,xe,pe,X]);return(0,j.jsx)(L.Z,{debugName:"Editable",capture:pe&&!p,onDelete:Ce("onDelete"),onDeleteToEndOfLine:Ce("onDeleteToEndOfLine"),onDeleteNextWord:Ce("onDeleteNextWord"),onBackspace:Ce("onBackspace"),onEnter:E?void 0:Ce("onEnter"),onShiftEnter:Ce("onShiftEnter"),onCommandEnter:Ce("onCommandEnter"),onCommandShiftEnter:Ce("onCommandShiftEnter"),onUp:I?void 0:Ce("onUp"),onDown:I?void 0:Ce("onDown"),onLeft:Ce("onLeft"),onRight:Ce("onRight"),onCommandLeft:Ce("onCommandLeft"),onCommandRight:Ce("onCommandRight"),onTab:Ce("onTab"),onUntab:Ce("onUntab"),onSelectAll:Ce("onSelectAll"),onToggleUnderline:Ce("onToggleUnderline"),onToggleHighlight:Ce("onToggleHighlight"),onToggleBold:Ce("onToggleBold"),onToggleItalics:Ce("onToggleItalics"),onToggleStrike:Ce("onToggleStrike"),onToggleCode:Ce("onToggleCode"),onUndo:Ce("onUndo"),onRedo:Ce("onRedo"),onEsc:Ce("onEsc"),onCut:Ce("onCut"),onCopy:Ce("onCopy"),onPaste:Ce("onPaste"),onKeypress:Ce("onKeyPress"),onMoveUp:Ce("onMoveUp"),onMoveDown:Ce("onMoveDown"),onHome:he,onEnd:he,onGoToBeginningOfLine:Ce("onGoToBeginningOfLine"),onGoToEndOfLine:Ce("onGoToEndOfLine"),onGoForwardOneChar:he,onGoBackwardOneChar:he,children:Te})}const z=o.memo(K,u.Z);function q(e,t){const n=V.default.state;"empty"!==n.mode&&i.default.afterNextFlush((()=>{const{start:o,end:r}=n.multiSelection;switch(e){case"start":{const e=o.store.getValue();if(!e)return;const n=d.Oqk({textValue:e,substring:"\n",ignoreCase:!1}).reverse().find((e=>{let{endIndex:t}=e;return t<=o.index})),i=(null==n?void 0:n.endIndex)??0,a={store:o.store,index:i};v.setMultiSelection({multiSelection:{start:a,end:t?r:a}});break}case"end":{const e=(0,T.x0)(r.store);if(!e)return;const n=o.store.getValue();if(!n)return;const i=d.Oqk({textValue:n,substring:"\n",ignoreCase:!1}).find((e=>{let{startIndex:t}=e;return t>=r.index})),a=(null==i?void 0:i.startIndex)??e.endIndex,s={store:r.store,index:a};v.setMultiSelection({multiSelection:{start:t?o:s,end:s}});break}default:(0,p.t1)(e)}}))}function H(e){e.metaKey||e.ctrlKey||e.altKey||E.Z.setKeyboardMode(!0)}function G(e){(0,_.ZP)({event:e,context:_.Af.EditorDoubleClick,callback:()=>{}})}function W(e,t){if(e)return"default";const n=(0,I.sQ)(t);return n?D.Z.getMode(n):"default"}},959062:(e,t,n)=>{n.d(t,{P9:()=>Zn,M1:()=>zn,ZP:()=>Ln,ar:()=>Fn,c2:()=>Vn,lI:()=>Kn,V1:()=>En});var o=n(667294),r=n(460177),i=n(800480),a=n(706740),s=n(886628),l=n(724405),c=n(541432),d=n(895538),u=n(630845),p=n(23210),m=n(421838),g=n(182798),f=n(709291),h=n(531701),v=n(653965),y=n(926249),b=n(137810),_=n(988150),S=n(288864),k=n(757549),w=n(800893),x=n(547307),I=n(631781),C=n(627153),T=n(311712),M=n(524677),P=n(898104),A=n(210228),R=n(95477),D=n(721429),B=n(843250),E=n(214976),F=n(433929),Z=n(917504),U=n(99340),V=n(745238),N=n(785893);const O=(0,V.IU)("compass",{viewBox:"0 0 30 30",svg:(0,N.jsx)("path",{d:"M18,4.361V3c0-1.657-1.343-3-3-3s-3,1.343-3,3v1.361C6.27,5.718,2,10.854,2,17c0,7.18,5.82,13,13,13s13-5.82,13-13 C28,10.854,23.73,5.718,18,4.361z M14,3c0-0.552,0.448-1,1-1s1,0.448,1,1v1.051C15.669,4.025,15.338,4,15,4s-0.669,0.025-1,0.051V3z M16,27.949V26h-2v1.949C8.724,27.474,4.526,23.276,4.051,18H6v-2H4.051C4.526,10.724,8.724,6.526,14,6.051V8h2V6.051 c5.276,0.476,9.474,4.673,9.949,9.949H24v2h1.949C25.474,23.276,21.276,27.474,16,27.949z M8,24l10-4l4-10l-10,4L8,24z M18.41,13.59 l-1.949,4.871L11.59,20.41l1.949-4.871L18.41,13.59z"})});var L=n(838805),j=n(277907);const K=new j.Ss("imageHyperlink",(()=>n.e(55798).then(n.bind(n,629038)))),z=(0,j.kF)(K,(e=>e.ImageHyperlinkPreview)),q=(0,j.kF)(K,(e=>e.ImageHyperlinkOverlay));var H=n(318245),G=n(825464),W=n(568859),$=n(61766),Y=n(788632),Q=n(480796),J=n(749085);class X extends J.default{getInitialState(){return{hovered:!1,focused:!1,isInFrame:!1}}}const ee=X;var te=n(27411),ne=n(569784),oe=n(212534),re=n(896049),ie=n(874587),ae=n(635021);let se=null;const le=J.default.createClass(void 0,{name:"ErrorStore"});function ce(e){let{source:t,contentWrapStyle:n,handleEmbedComp:r,contentStyle:i}=e;const a=(0,s.qz)(void 0,le),l=(0,o.useCallback)((e=>function(e,t,n){const o=(0,ie.K9)(e.currentTarget,t);o&&n.setState(o)}(e,t,a)),[t,a]),c=(0,s.VK)((()=>function(e){return{...e,pointerEvents:re.Z.state?"none":"auto",position:"relative"}}(i)),[i]);return(0,N.jsx)("div",{style:n,onMouseDown:oe.$0,onTouchStart:oe.$0,children:(0,N.jsxs)("div",{style:c,children:[(0,N.jsx)("audio",{ref:e=>r(e),style:c,controls:!0,preload:"none",onError:l,onPlay:ue,onPause:pe,src:t}),(0,N.jsx)(me,{errorStore:a})]})})}const de={render:function(e){const{contentStyle:t,contentWrapStyle:n,handleEmbedComp:o}=e;return(0,N.jsx)(ae.Z,{url:e.source,permissionRecord:e.store.pointer,useS3Url:e.useS3Url,render:(e,r,i)=>i?r?(0,N.jsx)(ce,{contentStyle:t,contentWrapStyle:n,source:r,handleEmbedComp:o}):void 0:(0,N.jsx)("div",{})})},resizable:!1,hideActions:!0,rendererType:"audio"};function ue(e){se&&se.pause(),se=e.currentTarget}function pe(e){se===e.currentTarget&&(se=null)}function me(e){let{errorStore:t}=e;const n=(0,s.VK)((()=>t.state),[t]);return n?(0,N.jsx)(ie.ZP,{family:"audio",error:n,isSmall:!0}):null}var ge=n(13966),fe=n(391893),he=n(523864),ve=n(370518),ye=n(668709),be=n(164921),_e=n(489728),Se=n(526388),ke=n(296994),we=n(724098),xe=n(273959),Ie=n(27724),Ce=n(301743);function Te(e){const t=(0,i.O7)(),n=(0,s.VK)((()=>(0,xe.iZ)(e.store)),[e.store]),r=(0,l.yK)((t=>({sizer:{height:e.height,display:"flex",borderRadius:3,paddingTop:2,paddingLeft:10,paddingRight:10,paddingBottom:10},border:{display:"flex",flex:1,margin:2,padding:3,boxShadow:n?t.outlineBlueInputBoxShadow:void 0,outline:`1px solid ${t.regularDividerColor}`,transition:"box-shadow 0.1s ease-in-out",willChange:"box-shadow",borderRadius:3},ignoreClickArea:{flex:1,position:"relative"}})),[n,e.height]),a=(0,o.useCallback)((()=>{P.clear({environment:t}),M.Z5({environment:t,stores:[e.store],phase:Ie.SelectionPhase.Editing})}),[t,e.store]),c=(0,o.useCallback)((t=>(0,N.jsx)("div",{...t,style:r.ignoreClickArea,className:"notion-disable-webkit-user-select",children:(0,N.jsx)(ke.hJ,{...e,isEditing:n})})),[r.ignoreClickArea,e,n]);return(0,N.jsx)("div",{style:r.sizer,onPointerDown:a,children:(0,N.jsx)("div",{style:r.border,children:(0,N.jsx)(Ce.Z,{debugName:"DrawingBox",capture:n,allowEsc:!0,children:(0,N.jsx)(we.Z,{capture:!0,render:c})})})})}const Me={render:e=>(0,N.jsx)(Te,{...e}),resizable:!0,hideActions:!0,rendererType:"drawing"};var Pe=n(313991),Ae=n(659301),Re=n(554564),De=n(496802),Be=n(934959),Ee=n(398740),Fe=n(598997),Ze=n(947002),Ue=n(948514),Ve=n(98742),Ne=n(165598),Oe=n(92994),Le=n(305971),je=n(317105),Ke=n(760439),ze=n(656992),qe=n(982216),He=n(886760),Ge=n(224434),We=n(948955),$e=n(235153),Ye=n(72982),Qe=n(799826),Je=n(553824),Xe=n(364424),et=n(185529),tt=n(231945),nt=n(963085),ot=n(825777),rt=n(949271),it=n(369721);const at=function(e){const{signedUrl:t,dataSize:n,dataName:o,contentWrapStyle:r,disabled:i,viewOriginal:a}=e,s={paddingTop:rt.ZD.paddingTop,paddingBottom:rt.ZD.paddingBottom,paddingLeft:rt.ZD.paddingLeft};return(0,N.jsx)("div",{style:r,onClick:void 0,onMouseDown:oe.$0,children:(0,N.jsx)("div",{style:{position:"relative"},children:t&&(0,N.jsx)(it.S,{title:o,url:t,size:n,onClick:i?void 0:a,style:s})})})};var st=n(395530),lt=n(213542),ct=n(761149);function dt(e){let{url:t,metadata:n}=e;const o=(0,l.yK)((e=>({previewWrapper:{display:"flex",flexDirection:"column",border:`1px solid ${e.darkDividerColor}`,borderRadius:"3px",height:"100%"},previewImageArea:{flex:1,backgroundColor:e.embedPlaceholderBackground},previewInfoArea:{padding:"0.75em 1em",backgroundColor:e.regularInvertedTextColor,display:"flex",flexDirection:"column",gap:"0.25em"},previewTitle:{fontWeight:b.Z.fontWeight.medium,color:e.darkTextColor},previewUrl:{display:"flex",alignItems:"center",gap:"0.75em"},previewUrlText:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.lightTextColor},previewUrlFavicon:{width:"1.25em",height:"1.25em"}})),[]),r=null!=n&&n.images&&n.images.length>0?n.images[0].url:void 0;return(0,N.jsxs)("div",{style:o.previewWrapper,children:[(0,N.jsx)("div",{style:o.previewImageArea,children:r?(0,N.jsx)(ut,{imageUrl:r}):(0,N.jsx)(pt,{})}),(0,N.jsxs)("div",{style:o.previewInfoArea,children:[(null==n?void 0:n.title)&&(0,N.jsx)("div",{style:o.previewTitle,children:n.title}),(0,N.jsxs)("div",{style:o.previewUrl,children:[(null==n?void 0:n.favicon_url)&&(0,N.jsx)("img",{style:o.previewUrlFavicon,src:n.favicon_url}),(0,N.jsx)("div",{style:o.previewUrlText,children:t})]})]})]})}function ut(e){let{imageUrl:t}=e;const n=(0,l.yK)((e=>({wrapper:{display:"flex",flexDirection:"column",justifyContent:"flex-end",alignItems:"flex-start",height:"100%",backgroundSize:"cover",backgroundImage:`url(${t})`},pill:{backgroundColor:e.accentColors.gray[800],color:e.accentColors.gray[50],borderRadius:"99em",padding:"0.5em 1em",margin:"1em",display:"flex",alignItems:"center",gap:"0.75em",fontWeight:b.Z.fontWeight.medium},playButton:{width:"1em",height:"1em",fill:e.accentColors.gray[50]}})),[t]);return(0,N.jsx)("div",{style:n.wrapper,children:(0,N.jsxs)("div",{style:n.pill,children:[(0,ct.I)(n.playButton),(0,N.jsx)("span",{children:(0,N.jsx)(f.FormattedMessage,{defaultMessage:"Load embed",id:"iFramePreview.pillLabel"})})]})})}function pt(){const e=(0,l.yK)((e=>({wrapper:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",color:e.mediumTextColor,height:"100%"},message:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"0.75em",fontWeight:b.Z.fontWeight.medium},playButtonWrapper:{backgroundColor:e.mediumTextColor,borderRadius:"2em",width:"2.5em",height:"2.5em",display:"flex",justifyContent:"center",alignItems:"center"},playButton:{marginLeft:"0.1em",width:"1em",height:"1em",fill:e.embedPlaceholderBackground}})),[]);return(0,N.jsx)("div",{style:e.wrapper,children:(0,N.jsxs)("div",{style:e.message,children:[(0,N.jsx)("div",{style:e.playButtonWrapper,children:(0,ct.I)(e.playButton)}),(0,N.jsx)("span",{children:(0,N.jsx)(f.FormattedMessage,{defaultMessage:"Tap to load embed",id:"iFramePreview.imagelessAreaLabel"})})]})})}function mt(e){let{source:t}=e;const n=(0,i.O7)(),o={request:t,performRequest:e=>async function(e,t){return(0,nt.W4)(t,e)}(e,n),render:(e,n,o)=>(0,N.jsx)(gt,{error:e,result:n,ready:o,source:t})};return(0,N.jsx)(lt.Z,{...o})}function gt(e){let{error:t,result:n,ready:o,source:r}=e;return o?(0,N.jsx)(dt,{url:r,metadata:n}):null}const ft={position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:1};function ht(e){const{render:t,style:n,errorStyle:o,...r}=e,i=(0,nt.NX)(e.url);return(0,N.jsx)(ae.Z,{...r,render:(r,a,s)=>{let l=i;return r&&!l&&(l=(0,nt.sj)(r)??{type:"unknown",source:e.url}),(0,N.jsx)("div",{style:n,children:(0,N.jsx)(ot.Z,{innerStyle:{height:"100%",width:"100%"},loaded:s,style:ft,spinnerSize:"1em",showSpinnerTimeout:500,children:l?(0,N.jsx)("div",{style:o,children:(0,N.jsx)(ie.ZP,{family:"embed",error:l})}):t(a)})})}})}function vt(e){const{height:t,source:n,contentStyle:r,dataName:i,dataSize:a,width:s}=e,[l,c]=(0,o.useState)(!1);return(0,N.jsx)(ht,{url:n,permissionRecord:e.store.pointer,useS3Url:e.useS3Url,style:{width:"100%",height:"100%"},errorStyle:{height:t,width:s},render:n=>l&&i&&a?(0,N.jsx)(at,{...e,dataName:i,dataSize:a,signedUrl:n}):n&&(0,N.jsx)(st.Z,{source:n,isFullWidth:!0,isFullHeight:!0,height:t,style:r,background:!0,onContentLoadTimeout:()=>c(!0)})})}const yt={render:function(e){const{disabled:t,contentStyle:n,contentWrapStyle:r,handleFullScreen:i,handleEmbedComp:a,height:s,preserveScale:l,isFullWidth:c,source:d,dataName:u,dataSize:p}=e,[m,g]=(0,o.useState)(!1),f=(0,nt.kl)({height:s,isFullWidth:c,preserveScale:l});return(0,N.jsx)(ht,{url:d,permissionRecord:e.store.pointer,useS3Url:e.useS3Url,style:f,errorStyle:{position:"relative",height:s},render:o=>m&&u&&p?(0,N.jsx)(at,{...e,dataName:u,dataSize:p,signedUrl:o}):(0,N.jsx)("div",{style:r,onClick:t?i:void 0,onMouseDown:oe.$0,children:(0,N.jsx)("div",{style:{position:"relative"},children:o&&(0,N.jsx)(st.Z,{ref:e=>a(e),source:o,height:s,style:n,preserveScale:l,isFullWidth:c,background:!0,renderPreview:()=>(0,N.jsx)(mt,{source:(0,nt.cJ)(e)}),onContentLoadTimeout:()=>g(!0)})})})})},embedGhost:!0,renderFullScreen:e=>(0,N.jsx)(vt,{...e}),resizable:!0},bt=yt,_t=230,St=(0,f.defineMessages)({embedButtonText:{defaultMessage:"Embed link",id:"embedBlock.embedButton.label"},embedCaption:{defaultMessage:"Works with links of PDFs, Google Drive, Google Maps, CodePen…",id:"embedBlock.linkPrompt.caption"},pastePrompt:{defaultMessage:"Paste in https://…",id:"embedBlock.pastePrompt"},validLink:{defaultMessage:"Please enter a valid link.",id:"embedBlock.invalidLinkError.message"},embedTitle:{defaultMessage:"Embed",id:"embedBlock.embedTab.title"},actionComment:{defaultMessage:"Comment",id:"embedBlock.actionButton.tooltip.comment"},actionDownload:{defaultMessage:"Download",id:"embedBlock.actionButton.tooltip.download"},actionOriginal:{defaultMessage:"Original",id:"embedBlock.actionButton.tooltip.original"},actionAlign:{defaultMessage:"Align",id:"embedBlock.actionButton.tooltip.align"},actionCaption:{defaultMessage:"Caption",id:"embedBlock.actionButton.tooltip.caption"},actionExpand:{defaultMessage:"Expand",id:"embedBlock.actionButton.tooltip.expand"},actionMore:{defaultMessage:"More actions",id:"embedBlock.actionButton.tooltip.blockActionMenu"},actionEditImage:{defaultMessage:"Crop image",id:"embedBlock.actionButton.tooltip.cropImage"},actionViewAltText:{defaultMessage:"Click to view alt text",id:"embedBlock.actionButton.tooltip.viewAltText"},actionEditAltText:{defaultMessage:"Click to view and edit alt text",id:"embedBlock.actionButton.tooltip.editAltText"}});function kt(e){const t=(0,i.O7)(),{device:n}=t,r=(0,i.MO)(),a=(0,f.useIntl)(),{store:u,blockLocation:p,mediaType:m,source:g,blockResizerStore:v,fileUploadState:y,isStoreNavigableAncestorNonEditableState:_,embedBlockStore:k,alignmentPopupStore:w,canEdit:x,dimensions:C}=e,{hasEditPermission:A,hasCommentPermission:D,isExternalObjectInstanceBlockStore:B,blockType:E,originalImageSourceFromStore:F,pathIsDead:Z}=(0,s.VK)((()=>({hasEditPermission:u.canEdit(),hasCommentPermission:u.canComment(),isExternalObjectInstanceBlockStore:u.isExternalObjectInstanceBlockStore(),blockType:u.getType(),originalImageSourceFromStore:u.getOriginalImageSource(),pathIsDead:u.pathIsDead(),imageHyperlink:u.getImageHyperlink()})),[u]),{block_alignment:U}=(0,s.VK)((()=>u.getFormat()),[u]),{isFullWidth:V,width:O,isPageWidth:j}=C,K=B,z=(0,s.VK)((()=>function(e,t,n,o){var r;return function(e,t,n){if(t)return Vn.image;if(e){if(e.startsWith("data:")||e.startsWith("<img"))return;const t=(0,d.Dz)({url:e,baseUrl:R.default.domainBaseUrl,publicDomainName:R.default.publicDomainName,preferredType:n});if("embed"!==t)return Vn[t]}if(n&&e)return Vn[n];return bt}(e,null==o?void 0:o.dataURL,t??(null===(r=n)||void 0===r?void 0:r.getType()))}(g,m,u,y)),[y,m,g,u]),q=(0,s.VK)((()=>function(e,t){const{block_width:n}=e.getFormat(),{temporaryWidth:o}=t.state;if(void 0!==o)return o<=_t;if(void 0!==n)return n<=_t;return!1}(u,v)),[v,u]),H=(0,s.VK)((()=>et.Z.getStatus(u.id)),[u.id]),W=(0,s.VK)((()=>v.getState().dragging),[v]),$=I.qC(p),Y=!n.isMobile&&!$&&!K,Q=O&&!j&&!V&&!r&&!$,J=!n.isMobile&&((null==z?void 0:z.renderFullScreen)&&K||"image"===E),X="on"===(0,Oe.a)("dcu_allow_actions_while_commenting"),ee=(0,Le.E)("image_cropping"),te=(0,s.VK)((()=>X&&Ue.Z.state.open&&"comment"===Ue.Z.state.content?Ue.Z.state.discussionInputStore:null),[X]),ne=(0,s.VK)((()=>X&&Ue.Z.state.open&&"comment"===Ue.Z.state.content&&Ue.Z.state.blockId===u.id),[X,u.id]),oe=(0,s.VK)((()=>Ne.Xp(u,{recursivelyLoadAllDiscussions:!1})),[u]),{focused:re,hovered:ie}=(0,s.VK)((()=>k.state),[k]),ae=(0,s.VK)((()=>Ze.Z),[]),se=(0,s.VK)((()=>Xe.Z),[]),le=(0,s.VK)((()=>u.isRootOrDirectChild()),[u]),ce=(0,o.useCallback)((()=>U||(le?"center":"left")),[le,U]),de=(0,l.yK)((e=>{const{device:n}=t,{isMobile:o}=n;return{wrapper:{position:"absolute",top:4,right:4,borderRadius:4,color:h.ZP.white,fill:h.ZP.white,fontSize:11.5,background:zn(t),display:"flex",whiteSpace:"nowrap",height:26,maxWidth:"calc(100% - 16px)",overflow:"hidden",pointerEvents:re||ie||o?"auto":"none",opacity:re||ie||o?1:0,transition:n.isSafari?void 0:Zn,fontFamily:b.Z.getCompositeFontFamily(Pe.locale).sans,zIndex:2}}}),[re,ie,t]);if(y&&"uploading"!==H)return null;if(W||z&&z.hideActions)return null;{let e=oe;if(ne&&(e+=1),"image"!==E||!_&&x){if(_)return(0,N.jsx)("div",{style:de.wrapper,children:(0,N.jsx)(be.Z,{style:Fn,hoveredStyle:En,onClick:()=>wt(u,t),children:(0,N.jsx)(f.FormattedMessage,{defaultMessage:"View original",id:"embedBlock.viewOriginalLink.button.label"})})});if(q)return(0,N.jsx)("div",{style:de.wrapper,children:(0,N.jsx)(xt,{blockLocation:p,store:u})});{const o=300,r=G.u.Top;let i,s;"image"===E&&(s=F);const l=ee&&!n.isMobile&&!$&&"image"===E&&A&&s&&(0,Je.fA)(s)&&!Z;return i=E&&(0,c.VB)(E)?(0,N.jsx)(Se.Z,{renderTooltip:()=>a.formatMessage(St.actionDownload),placement:r,delayThreshold:o,render:e=>(0,N.jsx)(be.Z,{...e,ariaLabel:a.formatMessage(St.actionDownload),style:Fn,hoveredStyle:En,onClick:()=>function(e,t){const n=e;if(n){I.TH({environment:t,store:n});const o=n.getType();o&&S.Fn(t,{type:"download",block_type:o,block_id:e.id})}}(u,t),children:(0,$e.a)({width:14,height:14,marginRight:0,fill:h.ZP.white})})}):(0,N.jsx)(Se.Z,{renderTooltip:()=>a.formatMessage(St.actionOriginal),placement:r,delayThreshold:o,render:e=>(0,N.jsx)(be.Z,{...e,ariaLabel:a.formatMessage(St.actionOriginal),style:Fn,hoveredStyle:En,onClick:()=>wt(u,t),children:(0,je.J)({width:14,height:14,marginRight:0,fill:h.ZP.white})})}),(0,N.jsxs)("div",{style:de.wrapper,children:[!$&&!K&&D&&(0,N.jsx)(Se.Z,{renderTooltip:()=>a.formatMessage(St.actionComment),placement:r,delayThreshold:o,render:o=>(0,N.jsxs)(be.Z,{...o,ariaLabel:a.formatMessage(St.actionComment),style:{...Fn,...n.isMobile&&{paddingLeft:8,paddingRight:8}},hoveredStyle:En,onClick:()=>{M.ZH({environment:t}),e>0?ne&&te?(ae.setActiveWithSource("text_annotation"),(0,Be.l)({discussionInputStore:te,environment:t,allowActionsWhileCommenting:X})):Re.Ib({environment:t,blockStore:u,analyticsFrom:"embed_menu",shouldFocusDiscussion:!0,recursivelyLoadAllDiscussions:!1}):(0,Ee.y)({environment:t,blockStore:u})},children:[(0,Qe.s)({width:14,height:14,marginRight:e>0?4:0,fill:h.ZP.white}),ne&&(0,N.jsx)(Fe.Z,{onlyShowDraftDot:!0,customTop:4,customLeft:15,withBackgroundFill:!0}),e>0&&e]})}),A&&Q&&(0,N.jsx)(Se.Z,{renderTooltip:()=>a.formatMessage(St.actionAlign),placement:r,delayThreshold:o,render:e=>(0,N.jsx)(tt.ZP,{popupType:tt.Z4.Popup,buttonPopupStore:w,originGap:1,renderOrigin:t=>(0,N.jsxs)(be.Z,{ariaLabel:a.formatMessage(St.actionAlign),style:Fn,hoveredStyle:En,...(0,Ve.Z)(t,e),children:[It(ce()),(0,Ge.i)({width:8,fill:h.ZP.white,marginLeft:4})]}),borderRadius:6,render:e=>(0,N.jsx)(Ct,{store:u,alignmentPopupStore:w,buttonPopupParent:e}),popupWrapStyle:{background:zn(t),display:"flex"}})}),A&&Y&&(0,N.jsx)(Se.Z,{renderTooltip:()=>a.formatMessage(St.actionCaption),placement:r,delayThreshold:o,render:e=>(0,N.jsx)(be.Z,{...e,ariaLabel:a.formatMessage(St.actionCaption),style:Fn,hoveredStyle:En,onClick:()=>function(e,t){const n=e.getPropertyStore("caption");M.eP({environment:t,store:e}),P.setSelectionAtEnd({store:n});const o=e.getType();o&&S.Fn(t,{type:"caption",block_type:o,block_id:e.id})}(u,t),children:(0,He.o)({width:14,height:14,marginRight:0,fill:h.ZP.white})})}),l&&(0,N.jsx)(Se.Z,{renderTooltip:()=>a.formatMessage(St.actionEditImage),placement:r,render:e=>(0,N.jsx)(be.Z,{...e,ariaLabel:a.formatMessage(St.actionEditImage),style:Fn,hoveredStyle:En,onClick:()=>{s&&(T.DQ(t,[]),se.openModal({blockStore:u,originalSource:s}),Ae.Z(t,{from:"tooltip"}))},children:(0,We.s)({width:14,height:14,marginRight:0,fill:h.ZP.white})})}),J&&(0,N.jsx)(Se.Z,{renderTooltip:()=>a.formatMessage(St.actionExpand),placement:r,delayThreshold:o,render:e=>(0,N.jsx)(be.Z,{...e,ariaLabel:a.formatMessage(St.actionExpand),style:Fn,hoveredStyle:En,onClick:()=>function(e,t,n){T.dK({blocks:[e],blockLocationOfTargetBlock:t});const o=e.getType();o&&S.Fn(n,{type:"full_screen",block_type:o,block_id:e.id})}(u,p,t),children:"image"===E?(0,Ye.v)({width:14,height:14,marginRight:0,fill:h.ZP.white}):(0,L.s)({width:14,height:14,marginRight:0,fill:h.ZP.white})})}),!n.isMobile&&i,(0,N.jsx)(xt,{blockLocation:p,store:u})]})}}return(0,N.jsx)("div",{style:de.wrapper,children:(0,N.jsx)(xt,{blockLocation:p,store:u})})}}function wt(e,t){const n=e;if(n){I.qL(t,{store:n,from:"view_original"});const o=n.getType();o&&S.Fn(t,{type:"original",block_type:o,block_id:e.id})}}function xt(e){let{isPlaceholder:t,blockLocation:n,store:o}=e;const r=(0,f.useIntl)(),i=I.qC(n),a=i?"comment_media":"default";return(0,N.jsx)(ge.Z,{store:o,fadeIn:!1,iconStyle:t?void 0:{fill:h.ZP.white},actionSectionGroupKey:a,hideFilterActionsInput:i,hoveredStyle:En,tooltipContent:r.formatMessage(St.actionMore)})}function It(e){const t={left:ze.$,center:Ke.L,right:qe.g},n={width:14,height:14,marginRight:0,fill:h.ZP.white};return t[e](n)}function Ct(e){const{store:t,alignmentPopupStore:n}=e,r=(0,i.O7)(),a=(0,s.VK)((()=>t.getFormat()),[t]),l=(0,s.VK)((()=>t.isRootOrDirectChild()),[t]),c=(0,o.useCallback)((()=>{const{block_alignment:e}=a;return e||(l?"center":"left")}),[a,l]),d=(0,o.useCallback)((e=>{let t=.6;return c()===e&&(t=1),{width:26,height:26,opacity:t}}),[c]);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(be.Z,{style:{...Fn,...d("left"),borderRight:"none"},hoveredStyle:{...En,opacity:1},onClick:()=>Tt("left",r,t,n),children:It("left")}),(0,N.jsx)("span",{style:{borderRight:`1px solid ${h.ZP.whiteWithAlpha(.2)}`}}),(0,N.jsx)(be.Z,{style:{...Fn,...d("center"),borderRight:"none"},hoveredStyle:{...En,opacity:1},onClick:()=>Tt("center",r,t,n),children:It("center")}),(0,N.jsx)("span",{style:{borderRight:`1px solid ${h.ZP.whiteWithAlpha(.2)}`}}),(0,N.jsx)(be.Z,{style:{...Fn,...d("right"),borderRight:"none"},hoveredStyle:{...En,opacity:1},onClick:()=>Tt("right",r,t,n),children:It("right")})]})}function Tt(e,t,n,o){const r=n;o.reset(),r&&A.createAndCommit({userAction:"EmbedBlock.handleAlignment",environment:t,perform:n=>{De.hc({environment:t,store:r,alignment:e,transaction:n})}});const i=n.getType(),a=n.getFormat(),s=a.block_alignment,l=a.block_width,c=a.block_height,d=n.isRootOrDirectChild()?"center":"left";i&&S.Fn(t,{type:"alignment",block_type:i,block_id:n.id,block_alignment:e,block_height:c,block_width:l,previous_alignment:s,default_alignment:d}),M.Jy()}function Mt(e){const{store:t,mediaType:n,fileUploadState:o,source:r,getRenderArgs:i}=e,a=(0,s.VK)((()=>function(e,t,n,o){var r;return function(e,t,n){if(t)return Vn.image;if(e){if(e.startsWith("data:")||e.startsWith("<img"))return;const t=(0,d.Dz)({url:e,baseUrl:R.default.domainBaseUrl,publicDomainName:R.default.publicDomainName,preferredType:n});if("embed"!==t)return Vn[t]}if(n&&e)return Vn[n];return bt}(e,null==o?void 0:o.dataURL,t??(null===(r=n)||void 0===r?void 0:r.getType()))}(r,n,t,o)),[o,n,r,t]),l=(0,s.VK)((()=>t.getProperties()),[t]);if(a){const e=i({source:r,store:t,properties:l}),n=a.render;return(0,N.jsx)(n,{...e})}return null}var Pt=n(997466);const At=(0,V.IU)("cornerResize",{viewBox:"0 0 16 16",svg:(0,N.jsx)("path",{fillRule:"evenodd",strokeWidth:"1.5",d:"M 14 0C 12.8955 0 12 0.895447 12 2L 12 12L 2 12C 0.895508 12 0 12.8954 0 14C 0 15.1046 0.895508 16 2 16L 14 16C 15.1045 16 16 15.1046 16 14L 16 2C 16 0.895447 15.1045 0 14 0Z"})});function Rt(e){let{store:t,resizerType:n,resizerAlignment:r,resizeComponent:a,preserveScale:l,isHovered:c,blockResizerStore:d}=e;const u=(0,i.O7)(),p=(0,i.Fy)(),m=(0,s.qz)(d,W.Z),g=(0,s.VK)((()=>!p.isMobile&&c),[p.isMobile,c]),f=(0,s.VK)((()=>{const e={position:"absolute",pointerEvents:g?"auto":"none",display:"flex",alignItems:"center",justifyContent:"center"};return r===ve.bZ.Right?e.right=0:r===ve.bZ.Left&&(e.left=0),n===ve.IS.Horizontal?(e.top=0,e.zIndex=1,e.height="100%",e.width=Dt,e.cursor="col-resize"):n===ve.IS.Vertical?(e.bottom=0,e.zIndex=1,e.width="100%",e.height=Dt,e.cursor="row-resize"):n===ve.IS.Corner&&(e.zIndex=2,e.bottom=0,e.width=e.height=Et,r===ve.bZ.Left?e.cursor="nesw-resize":r===ve.bZ.Right&&(e.cursor="nwse-resize")),e}),[r,n,g]),v=(0,o.useMemo)((()=>{const e={position:"absolute"};return n===ve.IS.Vertical||n===ve.IS.Corner?e.bottom=Bt:n===ve.IS.Horizontal&&(e.top=Bt),r===ve.bZ.Left?e.left=Bt:r===ve.bZ.Right&&(e.right=Bt),{...f,style:e}}),[r,f,n]),y=(0,s.VK)((()=>{const{ThemeStore:e}=u,t=e.state.mode,o={opacity:g?1:0,transition:Zn,borderRadius:20,background:(0,Pt.Fq)(h.se[t].black,.6),border:`1px solid ${h.ZP.whiteWithAlpha(.9)}`};return n===ve.IS.Horizontal?(o.width=6,o.height=48,o.maxHeight="50%"):n===ve.IS.Vertical&&(o.height=6,o.width=48,o.maxWidth="50%"),o}),[u,n,g]),b=(0,o.useMemo)((()=>n===ve.IS.Corner?At({stroke:h.ZP.whiteWithAlpha(.5),fill:h.ZP.blackWithAlpha(.65),width:Et,height:Et,transition:`opacity ${Zn}`,opacity:g?1:0,position:"relative",bottom:3,left:r===ve.bZ.Left?3:-3,transform:r===ve.bZ.Left?"rotate(90deg)":"none"}):(0,N.jsx)("div",{style:y})),[r,y,n,g]),_=(0,o.useMemo)((()=>({getNode:()=>a.current})),[a]);return(0,N.jsx)(ve.ZP,{store:t,preserveScale:l,resizerType:n,resizerAlignment:r,resizeComponent:_,blockResizerStore:m,resizeHorizontally:!0,resizeVertically:!0,disabled:!1,children:(0,N.jsx)("div",{style:v,children:b})})}const Dt=15,Bt=0,Et=20;var Ft=n(186329),Zt=n(559054),Ut=n(218265),Vt=n(937850);let Nt=0;const Ot="notion_jsonp_callback_";function Lt(e){const t=Vt.UZ(),n=document.createElement("script");n.type="text/javascript";const o=function(){const e=Ot+Nt;return Nt++,e}();window[o]=e=>{delete window[o],n.parentNode&&n.parentNode.removeChild(n),t.resolve(e)};const r=Ut.SK(e,{callback:o});return n.src=r,n.onerror=e=>{delete window[o],n.parentNode&&n.parentNode.removeChild(n),t.reject(e)},document.head&&document.head.appendChild(n),t.promise}var jt=n(134232),Kt=n(568785);const zt={userSelect:"none",padding:"6px 10px",borderRadius:4,border:"1px solid #dddddd",fontSize:14,width:"100%"},qt={loading:!0,error:!1,html:void 0};function Ht(e){const[t,n]=(0,o.useState)(qt),r=(0,s.VK)((()=>re.Z.getState()),[]);(0,Zt.r5)((async()=>{const t=`https://gist.github.com/${function(e){const{pathname:t}=Ut.Qc(e);return(t||"").split("/").pop()}(e.source)}.json`;try{const e=await Lt(t);n({loading:!1,error:!1,html:e.div});if(!document.querySelector(`link[href="${e.stylesheet}"]`)){const t=document.createElement("link");t.type="text/css",t.rel="stylesheet",t.href=e.stylesheet,document.head&&document.head.appendChild(t)}}catch(o){n({loading:!1,error:!0,html:void 0})}}),[e.source]);const i=(0,l.yK)((()=>({container:{width:"100%",marginBottom:"-1em",...t.html&&{overflowY:"auto"},...t.html&&{height:"100%"},...t.html&&{pointerEvents:r?"none":"auto"}}})),[t.html,r]);return(0,N.jsx)("div",{children:(0,N.jsx)(we.Z,{capture:!0,render:n=>(0,N.jsx)("div",{...n,ref:e.handleEmbedComp,style:i.container,children:(0,N.jsx)(Wt,{gistBoxState:t})})})})}const Gt={render:function(e){const{source:t,handleEmbedComp:n}=e;return(0,N.jsx)(Ht,{source:t,handleEmbedComp:n})},renderFullScreen:void 0,resizable:!0,embedGhost:!0,hideActions:!0};function Wt(e){let{gistBoxState:t}=e;const{error:n,html:o,loading:r}=(0,s.VK)((()=>{const{error:e,html:n,loading:o}=t;return{error:e,html:n,loading:o}}),[t]),i=(0,jt.Z)(r,1e3,500);return i||r?(0,N.jsx)("div",{style:{marginBottom:"1em"},children:(0,N.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",opacity:i?1:0,...zt},children:[(0,N.jsx)(Kt.Z,{}),(0,N.jsx)("div",{style:{marginLeft:8},children:(0,N.jsx)(f.FormattedMessage,{defaultMessage:"Loading gist",id:"githubGistRenderer.loading.message"})})]})}):n?(0,N.jsx)("div",{style:{marginBottom:"1em"},children:(0,N.jsx)("div",{style:zt,children:(0,N.jsx)(f.FormattedMessage,{defaultMessage:"Error loading gist",id:"githubGistRenderer.errorLoading.message"})})}):(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:o??""},className:"notion-gist-block"})}var $t=n(310517),Yt=n.n($t),Qt=n(643593),Jt=n(21359),Xt=n(979947),en=n(424042),tn=n(634406),nn=n(532854),on=n(81865),rn=n(918121);function an(e){const{file:t,fileName:n,fileSize:o,progressPercent:r}=e;return(0,N.jsx)(Ft.Z,{disabled:!0,iconSvg:rn.y,isLoading:!0,progressPercent:r,file:t,name:n,size:o,onClick:()=>{}})}const sn=J.default.createClass(void 0,{name:"ErrorStore"});function ln(e){const{store:t,dataURL:n,source:r,isFullWidth:a,isRootChild:c,aspectRatio:d,height:u,dragging:p,blockWidth:m,isFullScreen:g,imageBoxRef:f,isPageWidth:v,pageWidth:y,onSrcFailedToLoad:b,onSrcLoad:_}=e,S=(0,i.O7)(),k=(0,s.qz)(void 0,sn),w=(0,s.VK)((()=>k.state),[k]),x=(0,s.VK)((()=>te.default.getKeyState(te.default.getBlockKey(t.id))),[t]),I=(0,s.VK)((()=>et.Z.getStatus(t.id)),[t.id]),C=(0,s.VK)((()=>{if("uploading"===I||"completed"===I&&r===et.Z.getSecureFileURL(t.id))return et.Z.getDataURL(t.id)}),[I,t.id,r]),T=(0,o.useRef)(r),M=(0,o.useRef)(void 0),P=(0,o.useRef)(void 0),D=(0,o.useRef)(void 0),B=(0,o.useRef)(!1),E=Boolean("image/heic"===P.current),F=E&&(null==n?void 0:n.startsWith("blob:"))&&Boolean(!S.device.isSafari),Z=function(e){const t=e.isFullWidth&&!e.dragging?void 0:e.blockWidth,n=window.innerWidth,o=t?Math.min(t,window.innerWidth):window.innerWidth;return e.isFullScreen?n:o}({isFullWidth:e.isFullWidth,isFullScreen:e.isFullScreen,isRootChild:e.isRootChild,isPageWidth:e.isPageWidth,pageWidth:e.pageWidth,blockWidth:e.blockWidth,dragging:e.dragging});async function U(t,n){const o=Qt.E$(e.source,[R.default.secureFileS3.url,R.default.secureFileS3V2.url])?n:e.source;if(null==b||b(),n){const e=await(0,Xt.default)({url:n,environment:S,method:"HEAD",format:"text"});if("failed"===e.type){const t=(0,ie.cT)(e.error,o);if(t)return k.setState(t),void H.default.DO_NOT_USE_measureLegacy("image_load",{environment:S,data:{success:!1,status:e.status}})}}k.setState({type:"unknown",source:o}),H.default.DO_NOT_USE_measureLegacy("image_load",{environment:S,data:{success:!1,status:0}})}function V(e){e||(null==_||_(),k.setState(void 0),H.default.DO_NOT_USE_measureLegacy("image_load",{environment:S,data:{success:!0}}))}(0,o.useEffect)((()=>{D.current=H.default.DO_NOT_USE_markLegacy("image_load")}),[]),(0,o.useEffect)((()=>{null!=x&&x.file.type&&!Boolean(P.current)&&(P.current=null==x?void 0:x.file.type)}),[x]),(0,o.useEffect)((()=>{if(n||!r||!S.mobileNative)return;if(M.current&&r===T.current)return;T.current=r;Qt.E$(r,[R.default.secureFileS3.url,R.default.secureFileS3V2.url])&&Jt.getSignedFileUrl(S,{url:r,download:!1,downloadName:"image",permissionRecord:t.pointer},Boolean(en.Z.state.isNotionProtocolBugFixed)).then((e=>{M.current=e}))}),[S,T,M,r,t.pointer,n]),(0,o.useLayoutEffect)((()=>{var e;const n=null===(e=f.current)||void 0===e||null===(e=e.elementRef)||void 0===e?void 0:e.current;n&&!x&&(n.onload=()=>{const e=n.getBoundingClientRect().width;e<=1||e!==m&&(E||m===n.naturalWidth&&e!==n.naturalWidth&&!B.current&&t.canEdit()&&(A.createAndCommit({userAction:"ImageRenderer.updateBlockWidth",environment:S,perform:n=>{De.FH({stores:[t],update:{block_width:e},transaction:n})}}),B.current=!0))})}),[E,m,S,f,t,x]);const O=(0,l.yK)((e=>{const t={},n={},o=v?y:Math.min(m??0,y??0);if(a&&c||!d||!o)a&&c||!d?u&&(t.height=u,t.background=h.ZP.contentGrayBackground):(t.paddingBottom=100*d+"%",t.background=h.ZP.contentGrayBackground);else{const e=o*d;t.height=e,t.background=h.ZP.contentGrayBackground}return g||a||p||m&&d&&!C&&(n.maxHeight=m*d),{content:n,placeholder:t,contentWrap:{}}}),[C,a,c,d,u,g,m,p,v,y]);if(F&&x){const{file:e,name:t,size:n,progressPercent:o}=x;return(0,N.jsx)(an,{file:e,fileName:t,fileSize:n,progressPercent:o})}return n?(0,N.jsx)(cn,{...e,proxyError:void 0,renderURL:n,embedError:w,environment:S,signedOriginalURLRef:M,onImageError:U,onImageLoad:V,styles:O}):(0,N.jsx)(on.Z,{url:r,width:Z,render:(t,n)=>{var o;let r=n;return void 0===n&&void 0!==P.current&&null!==(o=T.current)&&void 0!==o&&o.startsWith("blob:")&&(r=T.current),C&&(r=C),(0,N.jsx)(cn,{...e,proxyError:t,renderURL:r,embedError:w,environment:S,signedOriginalURLRef:M,onImageError:U,onImageLoad:V,styles:O})},isAuthenticated:!0,permissionRecord:t.pointer},`width-${e.contentStyle.width}`)}function cn(e){const{proxyError:t,renderURL:n,isFullScreen:r}=e,[i,a]=(0,o.useState)(n);(0,o.useEffect)((()=>{void 0!==n&&n!==i&&a(n)}),[i,n]);const s=(0,ie.cT)(t,void 0)||(0,nt.sj)(t)||e.embedError;return r?(0,N.jsx)(un,{...e,embedError:s,renderURL:i}):(0,N.jsx)(dn,{...e,embedError:s,renderURL:i})}function dn(e){var t;const{embedError:n,renderURL:r,progressPercent:i,disabled:a,isLoading:l,contentStyle:c,contentWrapStyle:d,handleFullScreen:u,handleEmbedComp:p,isFullWidth:m,isRootChild:g,inlineContentStyle:f,blockLocation:h,imageBoxRef:v,environment:y,onImageError:b,onImageLoad:_,signedOriginalURLRef:k,styles:w,store:x}=e,[C,T]=(0,o.useState)(!1),A=I.qC(h),D=()=>{var e;if(S.QI(y,{from:"embedded_block_click",type:"image"}),!r)return;const t=0===r.indexOf("https:")?r:`${R.default.domainBaseUrl}${r}`;null===(e=y.mobileNative)||void 0===e||e.showLightBox({items:[{type:"image",previewUrl:Yt()(t),originalUrl:Yt()(k.current??t)}],startingIndex:0,from:"embedded_block_click"}),M.ZH({environment:y}),P.blurActiveElement()},B=y.mobileNative&&!1===(null==r?void 0:r.startsWith("data:")),F=B?D:A?void 0:u,Z=B?D:A?t=>mn(t,e.handleFullScreen):void 0,U=A?t=>mn(t,e.handleFullScreen):u,V=(0,s.VK)((()=>(0,E.Xh)(x.getPropertyValue("alt_text"),x)),[x]),O=(0,s.VK)((()=>{const e=x.getImageHyperlink()||"";return"placeholder"===e?void 0:e}),[x]),L=(0,s.VK)((()=>!!l&&"uploading"!==et.Z.getStatus(x.id)),[l,x.id]),j=(K={isFullWidth:e.isFullWidth,isRootChild:e.isRootChild,height:e.height,renderURL:r,isLoaded:C,embedContainerHeight:null===(t=e.embedContainerDimensions)||void 0===t?void 0:t.height}).isFullWidth&&K.isRootChild?K.height:K.renderURL&&K.isLoaded?void 0:K.embedContainerHeight;var K;return(0,N.jsx)("div",{ref:e=>p(e),style:{...d,...w.contentWrap},onClick:a&&!B?U:void 0,children:(0,N.jsxs)("div",{children:[(0,N.jsx)(tn.Z,{alt:V,ref:v,src:r,loading:"lazy",isFullScreen:!1,style:{...c,...w.content,...f},href:O,placeholderStyle:w.placeholder,onDoubleClick:F,onClick:Z,height:j,capMaxHeight:m&&g,onError:b,onLoad:e=>{_(e),r&&T(!0)}}),n&&(0,N.jsx)(ie.ZP,{error:n,family:"image"}),L&&(0,N.jsxs)("div",{style:tn.I,children:[(0,N.jsx)(Kt.Z,{style:{width:16,height:16,marginRight:4}}),(0,N.jsx)("div",{style:{minWidth:30,textAlign:"right"},children:(0,N.jsx)(nn.Z,{percentage:i})})]})]})})}function un(e){const{contentStyle:t,embedError:n,renderURL:o,onImageError:r,onImageLoad:i,styles:a}=e,s=Math.min(500,window.innerWidth-50);return(0,N.jsx)("div",{style:{alignSelf:"center",margin:0,position:"relative",minWidth:n?s:void 0},children:(0,N.jsxs)("div",{children:[(0,N.jsx)(tn.Z,{src:o,isFullScreen:!0,style:{...t,...a.content},placeholderStyle:a.placeholder,capMaxHeight:!1,onError:r,onLoad:i}),n&&(0,N.jsx)(ie.ZP,{error:n,family:"image"})]})})}const pn={rendererType:"image",render:e=>(0,N.jsx)(ln,{...e,isFullScreen:!1}),renderFullScreen:e=>(0,N.jsx)(ln,{...e,isFullScreen:!0}),resizable:!0};function mn(e,t){e.stopPropagation(),t()}const gn={render:function(e){const{disabled:t,contentStyle:n,contentWrapStyle:o,handleFullScreen:r,source:i,handleEmbedComp:a,height:s}=e;return(0,N.jsx)("div",{style:o,onClick:t?r:void 0,children:(0,N.jsx)("div",{style:{position:"relative"},children:(0,N.jsx)(st.Z,{ref:e=>a(e),source:i,height:s,style:n,background:!1,renderPreview:()=>(0,N.jsx)(mt,{source:(0,nt.cJ)(e)})})})})},renderFullScreen:function(e){const{source:t,height:n,contentStyle:o}=e;return(0,N.jsx)(st.Z,{source:t,isFullWidth:!0,height:n,style:o,background:!0})},resizable:!0},fn=gn;var hn=n(15950),vn=n(973935),yn=n(483785);function bn(e){const{handleEmbedComp:t,source:r,fullScreen:i}=e,a=(0,l.Fg)(),s=(0,l.yK)((e=>({main:{width:i?520:"100%",minWidth:"100%",pointerEvents:"auto",margin:i?"-10px auto":"-10px 0"},loading:{userSelect:"none",borderRadius:4,border:"1px solid #dddddd",fontSize:14,width:"100%",padding:"6px 10px"}})),[i]),c=(0,o.useCallback)((async e=>{if(!e)return;const{pathname:t}=Ut.Qc(r),n=(t||"").split("/")[3],o={dnt:!0,lang:"en",width:"100%",theme:"dark"===a.mode?"dark":"light"};if(n&&window.twttr){e.innerHTML="";if(await window.twttr.widgets.createTweetEmbed(n,e,o))return}vn.render((0,N.jsx)("div",{style:s.loading,children:"Error loading tweet"}),e)}),[r,s.loading,a.mode]);return(0,N.jsx)("div",{style:{display:"flex"},children:(0,N.jsx)("div",{style:{marginLeft:"auto",marginRight:"auto",maxWidth:420,minWidth:0,width:"100%"},children:(0,N.jsx)(we.Z,{capture:!0,render:e=>(0,N.jsx)("div",{...e,ref:e=>e&&t(e),style:s.main,children:(0,N.jsx)(yn.Z,{fetch:()=>n.e(50898).then(n.bind(n,922062)),loading:e=>e?(0,N.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",...s.loading},children:[(0,N.jsx)(Kt.Z,{}),(0,N.jsx)("div",{style:{marginLeft:8},children:(0,N.jsx)(f.FormattedMessage,{id:"tweetRenderer.loadingTweet.message",defaultMessage:"Loading Tweet"})})]}):null,render:()=>(0,N.jsx)("div",{ref:c})})})})})})}const _n={render:function(e){const{source:t,handleEmbedComp:n}=e;return(0,N.jsx)(bn,{source:t,handleEmbedComp:n,fullScreen:!1})},renderFullScreen:function(e){const{source:t,handleEmbedComp:n}=e;return(0,N.jsx)(bn,{source:t,handleEmbedComp:n,fullScreen:!0})},resizable:!1,embedGhost:!0,hideActions:!0},Sn={position:"absolute",left:"50%",top:"50%",transform:"translate(-30%, -50%)",height:0,width:0,borderStyle:"solid",borderColor:h.ZP.uiBlack,borderRightWidth:0,borderLeftWidth:24.5,borderTopWidth:16.1,borderBottomWidth:16.1,borderTopColor:h.ZP.transparent,borderBottomColor:h.ZP.transparent},kn={position:"relative",height:70,width:70,borderWidth:3,borderStyle:"solid",borderColor:h.ZP.uiBlack,borderRadius:70},wn={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},xn=J.default.createClass(!1,{name:"PlayedStore"}),In=J.default.createClass(void 0,{name:"ErrorStore"});function Cn(e){let{store:t,source:n,contentWrapStyle:r,handleFullScreen:i,aspectRatio:a,height:c,handleEmbedComp:u,isFullWidth:p,preserveScale:m,mediaType:g,useS3Url:f,isRootChild:h,contentStyle:v,blockLocation:y}=e;const b=(0,l.Fg)(),_=(0,o.useRef)(null),S=(0,o.useCallback)((e=>{u(e),_.current=e}),[u]),k=(0,s.qz)(void 0,In),w=(0,s.qz)(void 0,xn),x=(0,s.VK)((()=>Bn("embed_url",b,p,h,m,c,v,y,w)),[b,p,h,m,c,v,y,w]);return(0,N.jsx)(ae.Z,{url:n,permissionRecord:t.pointer,useS3Url:f,render:(e,t,o)=>{if(!o)return(0,N.jsx)("div",{});const s=(0,ie.cT)(e,void 0)||k.state;return t?"video"===g||(0,d.xL)({url:n})?(0,N.jsx)("div",{style:r,onMouseDown:oe.$0,children:(0,N.jsxs)("div",{style:{position:"relative"},onDoubleClick:i,children:[(0,N.jsx)(Dn,{videoRef:_,setVideoRef:S,source:n,isFullWidth:p,isRootChild:h,preserveScale:m,height:c,contentStyle:v,blockLocation:y,playedStore:w,errorStore:k,signedUrl:t}),s&&(0,N.jsx)(Pn,{error:s}),(0,N.jsx)(Rn,{videoRef:_,playedStore:w,errorStore:k})]})}):(0,N.jsx)("div",{style:r,onDoubleClick:i,children:(0,N.jsx)("div",{style:{position:"relative"},children:(0,N.jsx)(st.Z,{ref:e=>u(e),source:t,height:c,style:x,isFullWidth:p,preserveScale:m,aspectRatio:a,background:!0})})}):void 0}})}function Tn(e){return(0,N.jsx)("div",{style:{...kn,...e.style},children:(0,N.jsx)("div",{style:Sn})})}const Mn={render:e=>(0,N.jsx)(Cn,{...e}),resizable:!0,embedGhost:!0};function Pn(e){let{error:t}=e;return(0,N.jsx)(ie.ZP,{family:"video",error:t})}function An(){const e=(0,i.O7)(),{device:t}=e;return t.isFirefox||t.isMobile?null:(0,N.jsx)(Tn,{})}function Rn(e){let{videoRef:t,playedStore:n,errorStore:r}=e;const i=(0,o.useCallback)((e=>{const n=t.current;n&&(0,oe.ZP)({event:e,context:oe.Af.EditorClick,callback:()=>{n.play()}})}),[t]);return(0,s.VK)((()=>n.state||r.state),[n,r])?null:(0,N.jsx)("div",{onClick:i,style:wn,children:(0,N.jsx)(An,{})})}function Dn(e){let{signedUrl:t,source:n,isFullWidth:r,isRootChild:a,preserveScale:c,height:d,contentStyle:u,blockLocation:p,playedStore:m,errorStore:g,videoRef:f,setVideoRef:h}=e;const v=(0,l.Fg)(),y=(0,i.O7)(),b=(0,o.useCallback)((e=>{const{device:t}=y;t.isMobile&&m.setState(!1)}),[y,m]),_=(0,o.useCallback)((()=>{m.setState(!0)}),[m]),S=(0,o.useCallback)((()=>{const{device:e}=y;e.isAndroid&&document.fullscreenElement&&document.exitFullscreen()}),[y]),k=(0,o.useCallback)((()=>{const{device:e}=y,t=f.current;e.isIOS&&t&&t.pause()}),[y,f]),w=(0,o.useCallback)((e=>{const t=(0,ie.K9)(e.currentTarget,n);t&&g.setState(t)}),[n,g]),x=(0,s.VK)((()=>Bn("video_file",v,r,a,c,d,u,p,m)),[v,r,a,c,d,u,p,m]);return(0,N.jsx)("video",{ref:h,style:x,autoPlay:y.device.isIOS,playsInline:!0,controls:!0,preload:"metadata",onPause:b,onPlay:_,onEnded:S,onLoadStart:k,onError:w,src:t})}function Bn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"embed_url",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>5?arguments[5]:void 0,o=arguments.length>7?arguments[7]:void 0,r=arguments.length>8?arguments[8]:void 0;const i={...arguments.length>6?arguments[6]:void 0};return(arguments.length>2?arguments[2]:void 0)&&(arguments.length>3?arguments[3]:void 0)&&(arguments.length>4?arguments[4]:void 0)&&(i.height=n),"video_file"!==e||r.state||(i.pointerEvents="none"),I.qC(o)&&(i.maxHeight=240),i.backgroundColor=t.embedPlaceholderBackground,i}const En={background:"rgba(255, 255, 255, 0.055)"},Fn={display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRight:`1px solid ${h.ZP.whiteWithAlpha(.2)}`},Zn="opacity 200ms ease-in-out",Un=230,Vn={tweet:_n,gist:Gt,video:Mn,image:pn,audio:de,invision:fn,mixpanel:bt,maps:bt,drive:bt,framer:bt,figma:bt,loom:bt,typeform:bt,codepen:bt,embed:bt,pdf:hn.Z,whimsical:bt,miro:bt,abstract:bt,sketch:bt,excalidraw:bt,replit:bt,hex:bt,deepnote:bt,drawing:Me},Nn=new Set(["pdf","drive"]);function On(e,t){const{store:n,disableMediaMenu:r,disabled:c,mediaType:f,blockLocation:h,preserveScale:y,inlineContentStyle:b,centerWrappedContent:_}=e,k=(0,o.useRef)(null),T=(0,U.PE)(n,c),R=(0,i.O7)(),{device:B}=R,[E,Z]=(0,o.useState)(null),[V,O]=(0,o.useState)(0),[L,j]=(0,o.useState)(!1),K=(0,o.useRef)(null),z=(0,s.VK)((()=>n.getType()),[n]),q=(0,s.VK)((()=>n.isNavigableAncestorNonEditableState()),[n]),H=(0,s.VK)((()=>qn(e.source,n)),[e.source,n]),G=(0,s.VK)((()=>{const{block_aspect_ratio:e}=n.getFormat();if(e&&!(V<=0))return V*e}),[n,V]),Y=(0,o.useId)(),J=(0,s.qz)(e.blockResizerStore??void 0,W.Z),X=(0,s.qz)(void 0,$.Z),oe=(0,s.qz)(void 0,ee),re=(0,s.VK)((()=>te.default.getKeyState(te.default.getBlockKey(n.id))),[n.id]),ie=(0,s.VK)((()=>$n(H,f,n,re)),[re,f,H,n]),ae=(0,s.VK)((()=>{const{block_height:e,block_width:t,block_preserve_scale:o,block_full_width:r,block_page_width:i,block_aspect_ratio:a}=n.getFormat(),{dragging:s,temporaryHeight:l,temporaryWidth:c,temporaryFullWidth:u,temporaryPageWidth:p}=J.state,m=s?c:t??V,g=s?l:e,h=Boolean(s?u:r),v=Boolean(s?p:i);return{blockWidth:t,blockHeight:e,width:m,height:n.isExternalObjectInstanceBlockStore()&&"image"!==f?g||d.QA:g,dragging:s,preserveScale:Boolean(y||o),isFullWidth:h,isPageWidth:v,aspectRatio:a}}),[J,V,f,y,n]),se=(0,o.useCallback)((()=>{if(!r&&T){const{popupWidth:t,maxHeight:o,mediaMenuCurrentTab:r,mediaMenuTabs:i,embedButtonText:a,mediaMenuEmbedCaption:s,urlInputPlaceholder:l}=e,c=r||"embed",d=(i||[{type:"embed"},{type:"file",fileUpload:!0,imageUpload:B.isAndroid,videoUpload:B.isAndroid}]).map((e=>function(e,t,n,o,r,i){switch(e.type){case"embed":const a=n||F.default.formatMessage(St.embedButtonText);return{type:"embed",caption:o||F.default.formatMessage(St.embedCaption),buttonText:a,inputPlaceholder:r||F.default.formatMessage(St.pastePrompt),onChange:e=>{const n=(0,p.D)(e);u.B(n,"url")?(C.Z(),Gn(n,i,t)):x.showErrorMessage(F.default.formatMessage(St.validLink))}};case"file":return{type:"file",fileUpload:Boolean(e.fileUpload),imageUpload:Boolean(e.imageUpload),videoUpload:Boolean(e.videoUpload),onUpload:e=>function(e,t,n){(0,g.T)(e.length>0,"Files can't be empty.");const o=t;if(!o)return;const r=D.qQ(n);if(I.cT({environment:n,store:o,file:e[0],pageWidth:r,preferredType:o.getType()}),e.length<=1)return;const i=e.slice(1);A.createAndCommit({userAction:"EmbedBlock.insertOtherFiles",environment:n,perform:e=>{w.AL({environment:n,files:i,transaction:e,insertBelowBlockStore:t})}})}(e,i,t)};case"unsplash":return{type:"unsplash",onChange:e=>{let{url:n}=e;C.Z(),Gn(n,i,t)}};case"giphy":return{type:"giphy",onChange:e=>{let{url:n}=e;C.Z(),Gn(n,i,t)}}}}(e,R,a,s,l,n))),m=k.current;if(m&&m instanceof Element){const e=m.getBoundingClientRect();C.$(R,{originRect:e,originGap:0,isSmallWidth:!1,showArrow:!0,currentTab:c,tabs:d,title:F.default.formatMessage(St.embedTitle),...t?{popupWidth:t}:{},...o?{maxHeight:o}:{}})}}}),[T,B.isAndroid,r,R,e,n]),le=(0,o.useCallback)((()=>{se()}),[se]),ce=(0,o.useCallback)((()=>{se()}),[se]),de=(0,o.useCallback)((()=>{se(),z&&S.Fn(R,{type:"replace",block_type:z,block_id:n.id})}),[z,R,se,n.id]),ue=(0,o.useCallback)((()=>{!function(e,t){const n=e.getPropertyStore("caption");M.eP({environment:t,store:e}),P.setSelectionAtEnd({store:n});const o=e.getType();o&&S.Fn(t,{type:"caption",block_type:o,block_id:e.id})}(n,R)}),[R,n]),pe=(0,o.useCallback)((e=>{Gn(e,n,R)}),[R,n]),me=(0,o.useCallback)((async()=>!!e.onRemoveBlockFromComment&&(await e.onRemoveBlockFromComment(n),!0)),[e,n]),ge=(0,o.useCallback)((()=>{$n(qn(H,n),f,n,re)?Yn(n,h,R):de()}),[h,R,re,f,de,H,n]),fe=(0,o.useCallback)((()=>{const{isFullWidth:e,aspectRatio:t}=ae;if(E){if(E&&E instanceof Element){const n=E.getBoundingClientRect();return e&&t?{...v.Go(n),width:n.width,height:n.width*t}:n}}}),[ae,E]),he=(0,o.useCallback)((()=>!(!ie||!ie.renderFullScreen)),[ie]),ve=(0,s.VK)((()=>n.getProperties()),[n]),be=(0,s.VK)((()=>n.isRootOrDirectChild()),[n]),_e=(0,s.VK)((()=>D.qQ(R)),[R]),Se=(0,s.VK)((()=>J.state),[J]),ke=(0,l.yK)((e=>{const t={position:"relative"};return _&&(t.display="flex",t.justifyContent="center",t.alignItems="center",t.minHeight=220),{content:{display:"block",pointerEvents:Se.dragging?"none":"auto",width:"100%"},wrapper:t}}),[Se,_]),we=(0,o.useCallback)((e=>{const{source:t,store:n,properties:o}=e,r=m.Jcv(o&&o.title),i=m.Jcv(o&&o.size),{blockWidth:a,blockHeight:s,width:l,height:c,dragging:d,preserveScale:u,isFullWidth:p,isPageWidth:g,aspectRatio:v}=ae,y=_e,_=be,{device:k}=R,w=V&&G?{width:V,height:G}:void 0,x={store:n,source:t,blockWidth:a,blockHeight:s,aspectRatio:v,width:l,height:c,dragging:d,preserveScale:u,isFullWidth:p,isPageWidth:g,pageWidth:y,isRootChild:_,dataURL:re?re.dataURL:void 0,dataName:r,dataSize:i,disabled:!T,contentStyle:ke.content,contentWrapStyle:ke.wrapper,isLoading:Boolean(re),progressPercent:re?re.progressPercent:0,handleFullScreen:()=>Yn(n,h,R),handleEmbedComp:e=>Z(e),onSrcFailedToLoad:()=>j(!0),onSrcLoad:()=>j(!1),viewOriginal:()=>function(e,t){const n=e;if(n){I.qL(t,{store:n,from:"view_original"});const o=n.getType();o&&S.Fn(t,{type:"original",block_type:o,block_id:e.id})}}(n,R),inlineContentStyle:b,blockLocation:h,mediaType:f,imageBoxRef:K,useS3Url:k.isIOS&&k.isMobileNative,embedContainerDimensions:w};return x}),[ae,_e,be,R,V,G,re,T,ke.content,ke.wrapper,b,h,f,K,j]),xe=(0,o.useCallback)((()=>{if(!H)return;const e=we({source:H,properties:ve,store:n});return ie&&ie.renderFullScreen?ie.renderFullScreen(e):void 0}),[we,ve,ie,H,n]),Ie=(0,s.VK)((()=>Q.Z.state.isDragging),[]),Ce=(0,s.VK)((()=>ne.default.state.isActive),[]),Te=(0,o.useCallback)((()=>{Ie||Ce||oe.setState({...oe.state,hovered:!0})}),[oe,Ce,Ie]),Me=(0,o.useCallback)((()=>{Ie||Ce||oe.setState({...oe.state,hovered:!1})}),[oe,Ce,Ie]),Pe=(0,o.useCallback)((e=>{const t=e.target;t instanceof HTMLElement&&(0,a.E)(t)&&oe.setState({...oe.state,focused:!0})}),[oe]),Ae=(0,o.useCallback)((()=>{oe.setState({...oe.state,focused:!1})}),[oe]),Re=re&&re.dataURL||H,De=Re?(0,N.jsx)(ye.p,{allowSelectionWithin:!0,ref:k,children:(0,N.jsx)(Qn,{store:n,fileUploadState:re,blockResizerStore:J,embedBlockStore:oe,alignmentPopupStore:X,isStoreNavigableAncestorNonEditableState:q,captionAriaId:Y,srcFailedToLoad:L,dimensions:ae,handleMouseEnter:Te,handleMouseLeave:Me,handleFocus:e=>Pe(e),handleBlur:Ae,setEmbedContainerWidth:O,source:Re,mediaType:f,blockLocation:h,preserveScale:y,disableResizers:e.disableResizers,hideContent:e.hideContent,disableCommentMenu:e.disableCommentMenu,disableActions:e.disableActions,disabled:c,contentBelowSource:e.contentBelowSource,showExpandButton:e.showExpandButton,getRenderArgs:we,canEdit:T})}):(0,N.jsx)(ye.p,{allowSelectionWithin:!1,ref:k,children:(0,N.jsx)(jn,{embedBlockStore:oe,fileUploadState:re,canEdit:T,store:n,openMenu:se,handleMouseEnter:Te,handleMouseLeave:Me,disabled:e.disabled,iconSvg:e.iconSvg,children:e.children})});return(0,U.ez)(n,t,(0,o.useMemo)((()=>({renderedType:"embed",getBlockStore:()=>n,getNode:()=>k.current,handleCreated:le,caption:ue,edit:ce,activate:ge,replace:de,embed:pe,canRenderFullScreen:he,getFullScreenNodeRect:fe,handleRemoveBlockFromComment:me,renderFullScreenNode:xe,getBlockLocation:()=>e.blockLocation})),[le,ue,ce,ge,de,pe,he,fe,me,xe,n,e.blockLocation]),De)}const Ln=o.memo(o.forwardRef(On),y.Z);function jn(e){const{embedBlockStore:t,fileUploadState:n,blockLocation:o,canEdit:r,iconSvg:a,store:c,openMenu:d,disableCommentMenu:u,hideContent:p,centerWrappedContent:m,handleMouseEnter:g,handleMouseLeave:h}=e,v=(0,i.O7)(),{device:y}=v,b=(0,s.VK)((()=>!Y.Z.state.online),[]),_=(0,s.VK)((()=>y.isMobile||t.state.hovered),[y,t]),S=I.qC(o),k=(0,l.yK)((e=>{const t={position:"relative"};m&&(t.display="flex",t.justifyContent="center",t.alignItems="center",t.minHeight=220);const n={display:"flex"};return I.qC(o)&&(n.borderWidth=1,n.borderColor=e.regularDividerColor,n.borderRadius=3,n.marginBottom=0,n.width=214,n.color=e.text.secondary),{placeholder:t,container:n}}),[o,m]);return(0,N.jsxs)("div",{style:k.container,onMouseEnter:g,onMouseLeave:h,children:[(0,N.jsx)(Ft.Z,{style:k.placeholder,disabled:!r||b,iconSvg:void 0!==a?a:O,shouldHideRight:!_,right:r&&(0,N.jsx)(Hn,{blockLocation:o,store:c,isPlaceholder:!0}),onClick:d,isLoading:Boolean(n),progressPercent:n?n.progressPercent:0,file:n?n.file:void 0,name:n?n.name:void 0,size:n?n.size:void 0,isInComment:S,children:e.children||(0,N.jsx)(f.FormattedMessage,{defaultMessage:"Embed anything (PDFs, Google Docs, Google Maps, Spotify…)",id:"embedBlock.embedAnything.placeholder"})}),(0,N.jsx)(he.Z,{disableCommentMenu:u,hideContent:p,store:c})]})}function Kn(e){const t=e.getProperties(),n=null==t?void 0:t.source,o=m.QaF(n),{display_source:r}=e.getFormat();return(0,d.Z8)(r||o)}function zn(e){const{device:t}=e;return t.isMobile?h.ZP.blackWithAlpha(.3):h.ZP.blackWithAlpha(.6)}function qn(e,t){return e||Kn(t)}function Hn(e){let{isPlaceholder:t,blockLocation:n,store:o}=e;const r=I.qC(n),i=r?"comment_media":"default";return(0,N.jsx)(ge.Z,{store:o,fadeIn:!1,iconStyle:t?void 0:{fill:h.ZP.white},actionSectionGroupKey:i,hideFilterActionsInput:r,hoveredStyle:En,tooltipContent:F.default.formatMessage(St.actionMore)})}function Gn(e,t,n){const o=t;if(!o)return;const r=D.qQ(n);k.bO(n,{pastedText:e,source:"embed_block_menu"});const i=H.default.mark("embed_render_complete");I.I(n,{source:e,isDataURL:!1,store:o,pageWidth:r,preferredType:t.getType(),metric:i})}function Wn(e){const{renderer:t,blockLocation:n,isFullWidth:o,dragging:r,srcFailedToLoad:i}=e,a={display:"flex"};return I.qC(n)&&(a.display="inline-flex",a.maxHeight=240),"audio"===t.rendererType&&(a.display="flex"),"image"===t.rendererType&&(i?a.width="100%":o||r||(a.width="fit-content")),a}function $n(e,t,n,o){var r;return function(e,t,n){if(t)return Vn.image;if(e){if(e.startsWith("data:")||e.startsWith("<img"))return;const t=(0,d.Dz)({url:e,baseUrl:R.default.domainBaseUrl,publicDomainName:R.default.publicDomainName,preferredType:n});if("embed"!==t)return Vn[t]}return n&&e?Vn[n]:bt}(e,null==o?void 0:o.dataURL,t??(null===(r=n)||void 0===r?void 0:r.getType()))}function Yn(e,t,n){T.dK({blocks:[e],blockLocationOfTargetBlock:t});const o=e.getType();o&&S.Fn(n,{type:"full_screen",block_type:o,block_id:e.id})}function Qn(e){const{store:t,blockLocation:n,fileUploadState:a,mediaType:l,source:d,blockResizerStore:u,isStoreNavigableAncestorNonEditableState:p,embedBlockStore:m,alignmentPopupStore:g,captionAriaId:f,srcFailedToLoad:h,disableResizers:v,disableCommentMenu:y,hideContent:b,disableActions:_,disabled:S,contentBelowSource:k,showExpandButton:w,dimensions:x,handleMouseEnter:C,handleMouseLeave:T,handleFocus:M,handleBlur:P,setEmbedContainerWidth:A,getRenderArgs:R,canEdit:D}=e,E=(0,i.O7)(),{device:F}=E,{hasEditPermission:U,blockType:V,altText:O}=(0,s.VK)((()=>({hasEditPermission:t.canEdit(),isExternalObjectInstanceBlockStore:t.isExternalObjectInstanceBlockStore(),blockType:t.getType(),altText:t.getPropertyValue("alt_text")})),[t]),{preserveScale:L,isFullWidth:j,dragging:K}=x,[H,G]=(0,o.useState)(!0),W=(0,s.VK)((()=>m.state.hovered),[m]),$=(0,o.useRef)(null),Y=(0,s.VK)((()=>t.isRootOrDirectChild()),[t]),Q=(0,o.useCallback)((e=>{if(V&&(0,c.OY)(V)&&Nn.has(V))return{leftSide:!1,rightSide:!1,bottom:!1,rightCorner:!0,leftCorner:!0};const t=U,n=Y,{preserveScale:o,isFullWidth:r}=x,{resizable:i}=e,a=t&&i&&!v&&!h,s=a&&(!o||r&&n)&&!h,l=s&&!r&&!h;return{leftSide:a&&n&&!h,rightSide:a,bottom:s,rightCorner:l,leftCorner:l&&n&&!h}}),[V,x,v,U,Y,h]),J=(0,s.VK)((()=>$n(d,l,t,a)),[a,l,d,t]),X=(0,r.Dl)(),ee=(0,o.useCallback)(((e,t)=>{e&&J&&J.embedGhost&&function(e,t){const n=null==e?void 0:e.domLock;n?n.mutate(t):t()}(X,(()=>e.setAttribute("embed-ghost","")))}),[X,J]),te=(0,s.VK)((()=>function(e,t){const{block_width:n}=e.getFormat(),{temporaryWidth:o}=t.state;return void 0!==o?o<=Un:void 0!==n&&n<=Un}(t,u)),[u,t]);if(J){const{resizable:e}=J,{leftSide:o,rightSide:r,bottom:i,leftCorner:s,rightCorner:c}=Q(J),v="external_object_instance"===V,E="video"===V,Y="image"===V,X=O&&"image"===V&&!te&&!I.qC(n);return(0,Z.Z)((I=>(0,N.jsxs)("div",{role:"figure","aria-labelledby":f,ref:e=>{if(e){ee(e,d);const{width:t}=e.getBoundingClientRect();A(t),G((e=>e||t>0))}},...I,children:[H?(0,N.jsxs)("div",{style:Wn({renderer:J,blockLocation:n,isFullWidth:j,dragging:K,srcFailedToLoad:h}),ref:$,children:[(0,N.jsxs)("div",{className:B.QSt,style:{position:"relative",overflow:e?"hidden":"visible",flexGrow:1},onFocus:M,onBlur:P,onMouseLeave:T,onMouseEnter:C,children:[(0,N.jsx)(Mt,{store:t,mediaType:l,fileUploadState:a,source:d,getRenderArgs:R}),o&&(0,N.jsx)(Rt,{store:t,resizerType:ve.IS.Horizontal,resizerAlignment:ve.bZ.Left,resizeComponent:$,preserveScale:L,isHovered:W,blockResizerStore:u},"LeftResizer"),r&&(0,N.jsx)(Rt,{store:t,resizerType:ve.IS.Horizontal,resizerAlignment:ve.bZ.Right,resizeComponent:$,preserveScale:L,isHovered:W,blockResizerStore:u},"RightResizer"),c&&(0,N.jsx)(Rt,{store:t,resizerType:ve.IS.Corner,resizerAlignment:ve.bZ.Right,resizeComponent:$,preserveScale:L,isHovered:W,blockResizerStore:u},"RightCornerResizer"),s&&(0,N.jsx)(Rt,{store:t,resizerType:ve.IS.Corner,resizerAlignment:ve.bZ.Left,resizeComponent:$,preserveScale:L,isHovered:W,blockResizerStore:u},"LeftCornerResizer"),i&&(0,N.jsx)(Rt,{store:t,resizerType:ve.IS.Vertical,resizeComponent:$,preserveScale:L,isHovered:W,blockResizerStore:u},"BottomResizer"),!_&&(0,N.jsx)(kt,{store:t,alignmentPopupStore:g,blockResizerStore:u,embedBlockStore:m,fileUploadState:a,isStoreNavigableAncestorNonEditableState:p,mediaType:l,source:d,blockLocation:n,dimensions:x,canEdit:D}),_&&w&&J.renderFullScreen&&(0,N.jsx)(Jn,{store:t,blockLocation:n}),k,Y&&(0,N.jsx)(q,{isHovered:W,store:t}),Y&&(0,N.jsx)(z,{isHovered:W,store:t,hideText:te,disableActions:p}),!(v||E)&&(0,N.jsx)(Xn,{canEdit:U&&!p,store:t,show:Boolean(X)})]}),!j&&!F.isMobile&&(0,N.jsx)(he.Z,{disableCommentMenu:y,hideContent:b,store:t,hideIfSidebarOrMarginCommentsVisible:!0})]}):null,(0,N.jsx)(fe.Z,{store:t,captionAriaId:f,disabled:S})]})))}return null}function Jn(e){let{store:t,blockLocation:n}=e;const o=(0,i.O7)(),r=(0,l.yK)((e=>({button:{position:"absolute",right:12,top:12,background:e.buttonBackground},hovered:{background:e.buttonHoveredBackground},pressed:{background:e.buttonPressedBackground}})),[]);return(0,N.jsx)(_e.Z,{style:r.button,icon:e=>(0,L.s)({...e,width:16,height:16}),hoveredStyle:r.hovered,pressedStyle:r.pressed,onClick:()=>Yn(t,n,o),children:(0,N.jsx)(f.FormattedMessage,{id:"embedBlock.expandFullScreen.button.label",defaultMessage:"Expand"})})}function Xn(e){let{store:t,canEdit:n,show:o}=e;const r=(0,i.O7)(),{device:a}=r,c=(0,l.yK)((e=>({buttonWrapper:{position:"absolute",bottom:"8px",right:"8px",background:zn(r),borderRadius:4,opacity:o?1:0,transition:a.isSafari?void 0:Zn,overflow:"hidden"},button:{padding:"4px 6px",fontSize:12,fontWeight:b.Z.fontWeight.medium,letterSpacing:.2,color:"white"},tooltipText:{overflow:"hidden",textOverflow:"ellipsis"},tooltipSecondaryText:{color:e.mediumInvertedTextColor}})),[r,o,a.isSafari]),{altText:d,isTruncated:u}=(0,s.VK)((()=>{const e=(0,E.Xh)(t.getPropertyValue("alt_text"),t);return{altText:e,isTruncated:e.length>100}}),[t]);return(0,N.jsx)("div",{style:c.buttonWrapper,children:(0,N.jsx)(Se.Z,{renderTooltip:()=>(0,N.jsxs)("div",{children:[(0,N.jsx)("div",{style:c.tooltipText,children:u?`${d.slice(0,100)}...`:d}),(0,N.jsx)("div",{style:c.tooltipSecondaryText,children:F.default.formatMessage(n?St.actionEditAltText:St.actionViewAltText)})]}),placement:G.u.Bottom,disableTooltip:!o,render:e=>(0,N.jsx)(be.Z,{className:"altTextBlockButton",...e,ariaLabel:F.default.formatMessage(n?St.actionEditAltText:St.actionViewAltText),style:c.button,hoveredStyle:En,disabled:!o,onClick:()=>{_.b({blockStore:t,entrypoint:"block_button",environment:r})},children:"ALT"})})})}},874587:(e,t,n)=>{n.d(t,{ZP:()=>P,cT:()=>x,K9:()=>I});var o=n(667294),r=n(800480),i=n(724405),a=n(643593),s=n(709291),l=n(401898),c=n(218265),d=n(288864),u=n(225888),p=n(95477),m=n(979947),g=n(918514),f=n(927783),h=n(745238),v=n(785893);const y=(0,h.IU)("imageError",{viewBox:"0 0 32 32",svg:(0,v.jsxs)(o.Fragment,{children:[(0,v.jsx)("path",{d:"M6.39515 31.0485c3.44161 0 6.29115-2.8495 6.29115-6.2911 0-3.4355-2.8557-6.2912-6.29732-6.2912-3.43544 0-6.28495 2.8557-6.28495 6.2912 0 3.4416 2.85568 6.2911 6.29112 6.2911zm-.00617-5.366c-.32689 0-.50575-.1912-.51809-.5181l-.08635-3.0468c-.01233-.3393.24671-.5798.59828-.5798.34539 0 .61677.2467.60444.5859l-.09252 3.0407c-.01233.3331-.1912.5181-.50576.5181zm0 2.2698c-.35773 0-.69078-.2838-.69078-.6662s.32689-.6661.69078-.6661c.3639 0 .69079.2776.69079.6661 0 .3886-.33305.6662-.69079.6662z"}),(0,v.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 17.5539V3h26v26H12.6862c.4113-.6095.7364-1.282.9578-2H28v-4H13.7749c-.1687-.7106-.4373-1.3825-.7902-2H28V5H6v12.1798c-.69548.0352-1.36626.164-2 .3741zM11.3329 19c-.6875-.5905-1.48192-1.0601-2.35027-1.3757L13 12l2 1 5-5 6 11H11.3329zM12 9c0 1.104-.896 2-2 2s-2-.896-2-2 .896-2 2-2 2 .896 2 2zm3.395 6.434l-1.76-.881L11.887 17h10.744l-3.107-5.695-4.129 4.129z"})]})}),b=(0,h.IU)("lockedDocument",{viewBox:"0 0 27 33",svg:(0,v.jsx)("path",{d:"M9.281 26.605c0 .878.406 1.318 1.216 1.318h6.02c.811 0 1.216-.44 1.216-1.318V21.99c0-.79-.327-1.216-.981-1.274v-1.348c0-1.084-.298-1.958-.894-2.622-.595-.664-1.377-.996-2.343-.996-.967 0-1.748.332-2.344.996-.596.664-.894 1.538-.894 2.622v1.348c-.664.058-.996.483-.996 1.274v4.615zm2.359-5.919v-1.45c0-.654.17-1.176.512-1.567.342-.4.796-.6 1.363-.6.566 0 1.015.2 1.347.6.342.39.513.913.513 1.567v1.45H11.64zM5.692 32.288h15.601c1.572 0 2.759-.41 3.56-1.23.8-.81 1.2-2.002 1.2-3.575V14.197c0-.683-.038-1.26-.117-1.728a3.829 3.829 0 00-.454-1.304c-.214-.4-.537-.815-.966-1.245L16.84 2.112c-.41-.42-.81-.737-1.201-.952a3.822 3.822 0 00-1.275-.454 8.661 8.661 0 00-1.611-.132h-7.06c-1.573 0-2.76.41-3.56 1.23C1.332 2.616.932 3.808.932 5.38v22.104c0 1.582.4 2.779 1.2 3.59.802.81 1.988 1.215 3.56 1.215zm.235-2.886c-.703 0-1.23-.18-1.582-.542-.352-.361-.528-.879-.528-1.552V5.569c0-.673.176-1.196.528-1.567.351-.371.884-.557 1.596-.557h6.24v8.028c0 1.045.255 1.826.762 2.343.518.518 1.3.777 2.344.777h7.896v12.715c0 .673-.176 1.191-.528 1.552-.351.362-.884.542-1.596.542H5.927zm9.638-17.343c-.302 0-.522-.069-.659-.205-.127-.137-.19-.357-.19-.66V3.841l8.071 8.218h-7.222z"})}),_=(0,h.IU)("playbackError",{viewBox:"0 0 32 32",svg:(0,v.jsxs)(o.Fragment,{children:[(0,v.jsx)("path",{d:"M6.39515 29.0485c3.44161 0 6.29115-2.8495 6.29115-6.2911 0-3.4355-2.8557-6.2912-6.29732-6.2912-3.43544 0-6.28495 2.8557-6.28495 6.2912 0 3.4416 2.85568 6.2911 6.29112 6.2911zm-.00617-5.366c-.32689 0-.50575-.1912-.51809-.5181l-.08635-3.0468c-.01233-.3393.24671-.5798.59828-.5798.34539 0 .61677.2467.60444.5859l-.09252 3.0407c-.01233.3331-.1912.5181-.50576.5181zm0 2.2698c-.35773 0-.69078-.2838-.69078-.6662s.32689-.6661.69078-.6661c.3639 0 .69079.2776.69079.6661 0 .3886-.33306.6662-.69079.6662z"}),(0,v.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.1373 16.1987c0 6.7017-5.542 12.2437-12.2436 12.2437-1.622 0-3.1761-.3246-4.6001-.9118.3323-.4107.6226-.8567.8644-1.3316 1.1612.4325 2.4197.6687 3.7357.6687 5.9082 0 10.6689-4.7608 10.6689-10.669-.0122-5.9082-4.7729-10.65671-10.6812-10.65671-5.5497 0-10.08288 4.20726-10.5961 9.62871-.55173.0075-1.08925.0738-1.60656.193.4362-6.32082 5.78156-11.40862 12.20266-11.40862 6.7139 0 12.2559 5.54199 12.2559 12.24362zm-15.4585 4.4372a7.628 7.628 0 00-.0797-.2566.65573.65573 0 01-.0013-.0424v-8.2764c0-.5004.5859-.7202 1.0498-.4516l6.7016 4.0161c.4395.2686.4517.8911 0 1.1597l-6.7016 3.9917c-.3763.2257-.796.1398-.9688-.1405z"})]})});var S=n(316354),k=n(164369);function w(e,t){switch(e){case"image":return y;case"pdf":return"document_locked"===t?b:f.l;case"audio":case"video":return _;default:return f.l}}function x(e,t){if(e&&e instanceof m.HttpRequestError){let n=t||e.data.url;return c.j3(n)&&(n=c.O_({relativeUrl:n,baseUrl:p.default.domainBaseUrl})),e.data.offline?c.j3(e.data.url)||e.data.url.startsWith(p.default.domainBaseUrl)?{type:"offline"}:{type:"unknown",source:n}:{type:"http",source:n,statusCode:e.data.status}}}function I(e,t){const n=e.error,o=t||e.src;if(n)return n.code===n.MEDIA_ERR_DECODE||n.code===n.MEDIA_ERR_SRC_NOT_SUPPORTED?{type:"unsupported_content_type",extension:o&&(0,a.mD)(o)}:n.code===n.MEDIA_ERR_NETWORK?{type:"offline"}:void 0}function C(){return(0,v.jsx)(s.FormattedMessage,{id:"embedError.extension.unknown",defaultMessage:"unknown"})}function T(e){const{source:t,statusCode:n}=e,o=c.Qc(t).hostname;return(0,v.jsx)(s.FormattedMessage,{defaultMessage:"{hostname} (Error {statusCode})",id:"embedError.hostnameAndStatusCode",values:{hostname:o,statusCode:n}})}function M(e){switch(e){case"audio":return(0,g.UY)("guides.audioFaqs");case"video":return(0,g.UY)("guides.videosFaqs");case"image":return(0,g.UY)("guides.imagesFaqs");default:return(0,g.UY)("guides.embedsFaqs")}}const P=function(e){let{style:t,error:n,family:a,isSmall:p,onClickLink:m}=e;const g=(0,i.Fg)(),f=(0,r.O7)(),h={background:g.embedPlaceholderBackground,cursor:"default",...t||{},position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",alignContent:"center",alignItems:"center",justifyContent:p?"flex-start":"center",padding:p?"7px 14px":"0.5em 1em",textAlign:"center",flexDirection:p?"row":"column",overflow:"hidden"},y=p?25:48,b=p?"0px 14px 0 0":"0 0 14px 0",_=function(e,t){return"image"===t?"unsupported_content_type"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This image format ({extension}) can't be played on this device.",id:"embedError.image.unsupportedContentType",values:{extension:e.extension||C()}}):"offline"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"Go online to view this image",id:"embedError.image.offline"}):"unknown"===e.type||"invalid_protocol"===e.type||"invalid_url"===e.type||"document_locked"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This image couldn't be loaded.",id:"embedError.image.unknown"}):404===e.statusCode?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This image couldn't be found.",id:"embedError.image.notFound"}):401===e.statusCode||403===e.statusCode?(0,v.jsx)(s.FormattedMessage,{id:"embedError.image.permissionDenied",defaultMessage:"Permission denied."}):413===e.statusCode?(0,v.jsx)(s.FormattedMessage,{id:"embedError.image.imageTooBig",defaultMessage:"Image too big to display."}):(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This image couldn't be loaded.",id:"embedError.image.serverError"}):"audio"===t?"unsupported_content_type"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This audio format ({extension}) can't be played on this device.",id:"embedError.audio.unsupportedContentType",values:{extension:e.extension||C()}}):"offline"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"Go online to view this audio",id:"embedError.audio.offline"}):"unknown"===e.type||"invalid_protocol"===e.type||"invalid_url"===e.type||"document_locked"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This audio couldn't be loaded.",id:"embedError.audio.unknown"}):404===e.statusCode?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This audio couldn't be found.",id:"embedError.audio.notFound"}):401===e.statusCode||403===e.statusCode?(0,v.jsx)(s.FormattedMessage,{id:"embedError.audio.permissionDenied",defaultMessage:"Permission denied."}):(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This audio couldn't be loaded.",id:"embedError.audio.serverError"}):"video"===t?"unsupported_content_type"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This video format ({extension}) can't be played on this device.",id:"embedError.video.unsupportedContentType",values:{extension:e.extension||C()}}):"offline"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"Go online to view this video",id:"embedError.video.offline"}):"unknown"===e.type||"invalid_protocol"===e.type||"invalid_url"===e.type||"document_locked"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This video couldn't be loaded.",id:"embedError.video.unknown"}):404===e.statusCode?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This video couldn't be found.",id:"embedError.video.notFound"}):401===e.statusCode||403===e.statusCode?(0,v.jsx)(s.FormattedMessage,{id:"embedError.video.permissionDenied",defaultMessage:"Permission denied."}):(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This video couldn't be loaded.",id:"embedError.video.serverError"}):"file"===t?"unsupported_content_type"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This file format ({extension}) can't be played on this device.",id:"embedError.file.unsupportedContentType",values:{extension:e.extension||C()}}):"offline"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"Go online to view this file",id:"embedError.file.offline"}):"unknown"===e.type||"invalid_protocol"===e.type||"invalid_url"===e.type||"document_locked"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This file couldn't be loaded.",id:"embedError.file.unknown"}):404===e.statusCode?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This file couldn't be found.",id:"embedError.file.notFound"}):401===e.statusCode||403===e.statusCode?(0,v.jsx)(s.FormattedMessage,{id:"embedError.file.permissionDenied",defaultMessage:"Permission denied."}):(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This file couldn't be loaded.",id:"embedError.file.serverError"}):"embed"===t?"unsupported_content_type"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This embed format ({extension}) can't be played on this device.",id:"embedError.embed.unsupportedContentType",values:{extension:e.extension||C()}}):"offline"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"Go online to view this embed",id:"embedError.embed.offline"}):"unknown"===e.type||"invalid_protocol"===e.type||"invalid_url"===e.type||"document_locked"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This embed couldn't be loaded.",id:"embedError.embed.unknown"}):404===e.statusCode?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This embed couldn't be found.",id:"embedError.embed.notFound"}):401===e.statusCode||403===e.statusCode?(0,v.jsx)(s.FormattedMessage,{id:"embedError.embed.permissionDenied",defaultMessage:"Permission denied."}):(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This embed couldn't be loaded.",id:"embedError.embed.serverError"}):"pdf"===t?"document_locked"===e.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This PDF is locked",id:"embedError.pdf.locked"}):(0,v.jsx)(s.FormattedMessage,{defaultMessage:"This embed couldn't be loaded.",id:"embedError.embed.unknown"}):void(0,l.t1)(t)}(n,a);return(0,o.useEffect)((()=>{d.QU(f,{embedType:a,embedErrorType:n.type})}),[f,n.type,a]),(0,v.jsxs)("div",{style:h,children:[w(a,n.type)({fill:g.lightTextColor,width:y,height:y,margin:b}),(0,v.jsxs)(k.Z,{isSecondaryColor:!0,isMultiline:!p,style:{margin:b},children:[(0,v.jsx)("div",{style:{display:p?"inline-block":"block",marginRight:p?"14px":void 0},children:_}),"offline"!==n.type&&(0,v.jsx)(S.Z,{style:{display:"inline",pointerEvents:"auto",cursor:"auto",borderBottom:`1px solid ${g.lightTextColor}`},href:"document_locked"===n.type?void 0:M(a),external:!0,onClick:()=>{u.Fs(f,{from:"embed_error"}),null==m||m()},children:"document_locked"===n.type?(0,v.jsx)(s.FormattedMessage,{defaultMessage:"Unlock Document",id:"embedError.unlock"}):(0,v.jsx)(s.FormattedMessage,{defaultMessage:"Learn more",id:"embedError.learnMore"})})]}),!p&&"http"===n.type&&(0,v.jsx)(k.Z,{isSmall:!0,isSecondaryColor:!0,children:T(n)}),!p&&"unknown"===n.type&&n.source&&(0,v.jsx)(k.Z,{isSmall:!0,isSecondaryColor:!0,children:c.Qc(n.source).hostname})]})}},186329:(e,t,n)=>{n.d(t,{Z:()=>p});n(667294);var o=n(724405),r=n(137810),i=n(133767),a=n(277907),s=n(164921),l=n(568785),c=n(532854),d=n(140148),u=n(785893);const p=function(e){let{isLoading:t,file:n,name:r,size:i,progressPercent:a,style:l,iconSvg:c,onClick:p,disabled:g,right:f,shouldHideRight:h,isInComment:v,children:y}=e;const b=(0,o.yK)((e=>({container:{background:e.embedPlaceholderBackground,width:"100%",borderRadius:4},hoveredStyle:v?{background:e.surface.wash}:{}})),[v]);return t?(0,u.jsx)(m,{file:n,name:r,size:i,progressPercent:a,style:l,iconSvg:c,isInComment:v}):(0,u.jsx)("div",{style:b.container,children:(0,u.jsx)(s.Z,{onClick:p,disabled:g,hoveredStyle:b.hoveredStyle,children:(0,u.jsx)(d.ZP,{style:{background:void 0,...l},iconSvg:c,right:f,shouldHideRight:h,isInComment:v,children:y})})})};function m(e){let{file:t,name:n,size:s,progressPercent:p,style:m,iconSvg:g,isInComment:f}=e;const h=(0,o.Fg)(),{value:v}=(0,a.XJ)(i.commentsDependency);let y;if(t){if(!v)return null;const e=v.discussionHelpers.formatFileSize(s);y=(0,u.jsxs)("div",{children:[(0,u.jsx)("div",{style:f?{fontWeight:r.Z.fontWeight.medium,color:h.text.primary,fontSize:14,lineHeight:"18px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{},children:n}),(0,u.jsx)("div",{style:f?{fontSize:12,lineHeight:"15px"}:d.Lw,children:(0,u.jsxs)("div",{style:{display:"flex",alignItems:"center",...f?{gap:4}:{}},children:[(0,u.jsx)("div",{style:f?{color:h.text.secondary}:{},children:e}),(0,u.jsx)("div",{style:f?{color:h.text.tertiary}:{marginLeft:3},children:f?"—":" – "}),(0,u.jsx)(l.Z,{style:f?{}:{marginLeft:3,marginRight:3}}),(0,u.jsx)(c.Z,{style:f?{color:h.text.tertiary}:{},percentage:p})]})})]},"FileLoadingSpinner")}else y=(0,u.jsx)("div",{children:(0,u.jsx)(l.Z,{style:{marginLeft:3,marginRight:3}})},"LoadingSpinner");return(0,u.jsx)(d.ZP,{style:{...m,...f?{borderRadius:12,background:h.surface.wash}:{}},iconSvg:g,isInComment:f,children:y})}},303702:(e,t,n)=>{n.d(t,{Z:()=>M});var o=n(667294),r=n(313991),i=n(800480),a=n(886628),s=n(724405),l=n(820852),c=n(421838),d=n(709291),u=n(531701),p=n(653965),m=n(137810),g=n(225888),f=n(83631),h=n(918514),v=n(788752),y=n(922843),b=n(436488),_=n(316354),S=n(953437),k=n(158297),w=n(322492),x=n(785893);const I={mobilePreview:{padding:"4px 8px",height:80,display:"flex",alignItems:"center",justifyContent:"center"},mobilePreviewValue:{overflow:"auto"},submitButton:{alignSelf:"flex-start"},enterIcon:{height:14,width:14,fill:"currentColor",marginLeft:6,marginTop:2},errorContainer:{color:u.ZP.redWithAlpha(.8),fontSize:12,padding:"8px 10px"}},C=o.forwardRef((function(e,t){const n=(0,o.useRef)(null),r=(0,i.O7)(),{isOpen:l,onDismiss:d,origin:u,originRect:p,originGap:m,popupStyle:g}=e,f=(0,a.VK)((()=>A(r)),[r]),h=(0,s.yK)((e=>({inputWrapper:{display:"flex",alignItems:"center",padding:"8px 10px",width:"100%",background:e.inputBackground},popup:{width:400,display:"flex",flexDirection:"column"}})),[]);(0,o.useEffect)((()=>{r.KatexStore.loadIfNeeded((()=>[(0,c.qZ6)("")]))}),[r.KatexStore]),(0,o.useImperativeHandle)(t,(()=>({getSelection:()=>{if(!n)return;if(!n.current)return;const e=n.current.getSelection();return"contain"===(null==e?void 0:e.type)?e.selection:void 0}})),[]);const v=(0,x.jsxs)("div",{style:h.inputWrapper,children:[(0,x.jsx)(T,{ref:n,...e}),(0,x.jsx)(D,{error:e.error,disabled:e.disabled,isOpen:e.isOpen,onSubmit:e.onSubmit,onDismiss:e.onDismiss})]}),y=(0,a.VK)((()=>A(r)===S.kQ.SlideUp),[r]);return(0,x.jsx)(S.ZP,{popupType:f,open:l,origin:u,originRect:p,originGap:m,keepFocus:f===S.kQ.SlideUp,onDismiss:d,style:{...h.popup,...g},render:()=>(0,x.jsx)(b.Z,{capture:l,allowEsc:!0,render:()=>y?(0,x.jsxs)(o.Fragment,{children:[(0,x.jsx)(E,{equationValue:e.equationValue,error:e.error,displayMode:e.displayMode,isOpen:e.isOpen}),v]}):(0,x.jsxs)(o.Fragment,{children:[v,(0,x.jsx)(B,{isOpen:e.isOpen,error:e.error})]})})})})),T=o.forwardRef((function(e,t){const{disabled:n,isOpen:o,equationValue:c,onLeft:d,onRight:u,onDismiss:g,displayMode:h}=e,v=(0,i.O7)(),b=(0,a.VK)((()=>A(v)===S.kQ.SlideUp),[v]),_=!n&&!b,k=b?{type:y.b.Textarea}:{type:y.b.InlineWrap,onSubmit:t=>R(t,e.isOpen,e.disabled,e.error,e.onSubmit,e.onDismiss)},w=(0,s.yK)((e=>({base:{fontFamily:m.Z.getCompositeFontFamily(r.locale).mono,fontSize:14,marginRight:8,flex:1,wordBreak:"break-word",maxHeight:"50vh",overflow:"auto",..."block"===h&&{minHeight:60},...b&&{height:100}},placeHolder:{color:e.lightTextColor}})),[h,b]);return(0,x.jsx)(y.Z,{ref:t,...k,disabled:n,focus:o,selectAll:_,value:c||"",placeholder:P(e.displayMode),getHtml:t=>function(e,t){return t.highlight(p.AK(e),t.languages[l.PrismLanguages.latex],l.PrismLanguages.latex)}(t,e.Prism),onChange:t=>function(e,t,n,o,r){if(!t)return;n(e,f.by({environment:r,equation:e,displayMode:o}))}(t,e.isOpen,e.onChange,e.displayMode,v),onCancel:g,onLeft:d,onRight:u,placeholderStyle:{...w.base,...w.placeHolder},style:w.base,autoCorrect:"off",autoCapitalize:"off"})})),M=C;function P(e){return"block"===e?"|x| = \\begin{cases}             \n  x, &\\quad x \\geq 0 \\\\           \n -x, &\\quad x < 0             \n\\end{cases}":"E = mc^2"}function A(e){const{device:t}=e,n=t.isPhone&&t.isIOS&&t.isMobileBrowser;return t.isPhone&&!n?S.kQ.SlideUp:S.kQ.Popup}function R(e,t,n,o,r,i){e.preventDefault&&e.preventDefault(),n||t&&(o||(r(),i()))}function D(e){let{error:t,disabled:n,isOpen:o,onSubmit:r,onDismiss:i}=e;return n?null:(0,x.jsxs)(k.Z,{onClick:e=>R(e,o,n,t,r,i),disabled:n||Boolean(t),style:I.submitButton,children:[(0,x.jsx)(d.FormattedMessage,{defaultMessage:"Done",id:"equationInput.submitButton.label"}),(0,v.U)(I.enterIcon)]})}function B(e){let{isOpen:t,error:n}=e;const o=(0,i.O7)(),r=(0,a.VK)((()=>A(o)===S.kQ.Popup),[o]),l=(0,s.yK)((e=>({container:{color:u.ZP.redWithAlpha(.8),fontSize:12,padding:"8px 10px",...r&&{boxShadow:`0 -1px ${e.lightDividerColor}`}},label:{fontWeight:600},learnMoreLink:{display:"inline",textDecoration:"underline"}})),[r]);if(!t)return null;if(!n)return null;const c=n.message.replace("KaTeX parse error: ","");return(0,x.jsxs)("div",{role:"alert",style:l.container,children:[(0,x.jsx)("span",{style:l.label,children:(0,x.jsx)(d.FormattedMessage,{defaultMessage:"Invalid equation:",id:"equationInput.inputError.label"})})," ",c,". ",(0,x.jsx)(_.Z,{href:(0,h.UY)("guides.equations"),external:!0,onClick:()=>{g.Fs(o,{from:"equation_input"})},style:l.learnMoreLink,children:(0,x.jsx)(d.FormattedMessage,{defaultMessage:"Learn more",id:"equationInput.inputError.learnMore"})})]})}function E(e){let{equationValue:t,error:n,displayMode:o,isOpen:r}=e;const i=(0,s.Fg)();return t?(0,x.jsx)("div",{style:I.mobilePreview,children:n?(0,x.jsx)(B,{isOpen:r,error:n}):"block"===o?(0,x.jsx)(w.Z,{display:o,equation:t,style:I.mobilePreviewValue,theme:i}):(0,x.jsx)(w.Z,{display:o,equation:t,style:I.mobilePreviewValue,theme:i,index:0,isTemporary:!1})}):null}},322492:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(667294),r=n(598923),i=n(709291),a=n(296994),s=n(83631),l=n(277907),c=n(785893);function d(e){(0,o.useEffect)((()=>{s.bc()}),[]);const t=(0,i.useIntl)();return(0,c.jsx)(l.ev,{dependency:a.FF.katex,children:n=>(0,c.jsx)(r.MW,{intl:t,katex:n,...e})})}},842782:(e,t,n)=>{n.d(t,{Z:()=>y});var o=n(667294),r=n(973935),i=n(800480),a=n(98742),s=n(223196),l=n(203386),c=n(953437);const d=function(){const[e,t]=o.useState({x:0,y:0});return o.useEffect((()=>{const e=e=>{t({x:e.clientX,y:e.clientY})};return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}}),[]),e};var u=n(785893);function p(e){let{x:t,mouseX:n}=e;return n>t?void 0:-Math.max(t-n,10)+"px"}function m(e){let{x:t,width:n,mouseX:o}=e;return o>t?-Math.max(o-(t+n),10)+"px":void 0}function g(e){let{x:t,width:n,mouseX:o}=e;return o>t?`${Math.max(o-(t+n),10)}px`:`${Math.max(t-o,10)}px`}function f(e){let{x:t,y:n,height:o,mouseX:r,mouseY:i}=e;return r>t?`polygon(0% 0%, 0% 100%, 100% ${100*(i-n)/o}%)`:`polygon(100% 0%, 0% ${100*(i-n)/o}%, 100% 100%)`}function h(e){const{x:t=0,y:n=0,height:o=0,width:r=0}=e.el.getBoundingClientRect()||{},{x:i,y:a}=d(),s={x:t,y:n,height:o,width:r,mouseX:i,mouseY:a},l={right:m(s),left:p(s),height:o,width:g(s),clipPath:f(s)};return(0,u.jsx)("div",{style:{cursor:"pointer",position:"absolute",top:0,...l}})}function v(e,t){let{onClick:n,renderOrigin:d,renderExtension:p,allowOptionalExtensionMenu:m,...g}=e;const{disableDefaultClick:f,onFocus:v,focused:y,openOnFocus:b}=g,_=(0,i.Fy)(),[S,k]=(0,o.useState)(!1),w=(0,o.useRef)(null),x=(0,o.useRef)(null),I=(0,o.useRef)(null),C=(0,o.useRef)(null),T=(0,o.useCallback)((()=>{I.current&&window.clearTimeout(I.current),C.current&&window.clearTimeout(C.current),I.current=null,C.current=null}),[]),M=(0,o.useCallback)((()=>{T(),S||k(!0)}),[S,T]),P=(0,o.useCallback)((()=>{T(),S&&k(!1)}),[S,T]),A=(0,o.useCallback)((e=>{T(),S||(e&&e.preventDefault&&e.preventDefault(),I.current=window.setTimeout(M,120))}),[S,T,M]),R=(0,o.useCallback)((()=>{T(),S&&(C.current=window.setTimeout(P,100))}),[S,P,T]),D=(0,o.useCallback)((e=>{v(),M(),m&&(null==n||n(e),P())}),[v,M,m,n,P]),B=(0,o.useCallback)((()=>{A()}),[A]),E=(0,o.useCallback)((()=>{v(),A()}),[v,A]),F=(0,o.useCallback)((e=>{if(_.isPhone)return;const t=r.findDOMNode(w.current);S&&t&&!t.contains(e.target)&&P()}),[S,P,_.isPhone]),Z=(0,o.useCallback)((e=>{13===e.keyCode&&S&&P()}),[S,P]);(0,o.useEffect)((()=>{if(!Boolean(f))return window.addEventListener("click",F),()=>{window.removeEventListener("click",F)}}),[f,F]),(0,o.useEffect)((()=>(window.addEventListener("keydown",Z),()=>{window.removeEventListener("keydown",Z)})),[Z]);const U=(0,o.useRef)(y);(0,o.useEffect)((()=>{b&&!U.current&&y?A():!y&&U.current&&R(),U.current=y}),[y,b,A,R,_.isMobile]);const V={...(0,a.Z)({onMouseEnter:B,onClick:D},g),showExtensionArrow:!0};return(0,u.jsx)(l.Z,{debugName:"ExtensionMenuItem",capture:y,onEnter:S?void 0:A,onRight:A,onLeft:S?R:void 0,onEsc:S?R:void 0,children:(0,u.jsx)(c.ZP,{popupType:_.isPhone?s.k.SlideUp:s.k.Popup,open:S,origin:d(V,t),placementToOrigin:c.ZP.Placement.Right,alignmentToOrigin:c.ZP.Alignment.Center,originGap:0,disableMouseCapture:!0,preventBlockRenderQueueOnEnter:!0,preventScaleTransition:!_.isPhone,preventCaptureEsc:!0,ref:w,render:()=>(0,u.jsxs)(u.Fragment,{children:[x.current&&(0,u.jsx)(h,{el:x.current}),(0,u.jsx)("div",{ref:x,children:p({onMouseEnter:E},{close:R})})]}),style:{overflow:"visible"},trapFocus:!0,onDismiss:P})})}const y=o.forwardRef(v)},819987:(e,t,n)=>{n.d(t,{Z:()=>X});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(977657),l=n(590965),c=n(709291),d=n(997466),u=n(531701),p=n(137810),m=n(757549),g=n(389475),f=n(311712),h=n(210228),v=n(61202),y=(n(95477),n(296994)),b=n(970764),_=n(341232),S=n(433929),k=n(883165),w=n(224434),x=n(464939),I=n(831501),C=n(330881),T=n(756903),M=n(80444),P=n(530874),A=n(960709),R=n(1634),D=n(164921),B=n(231945),E=n(751077),F=n(489728),Z=(n(757658),n(800893)),U=n(547307),V=n(412714),N=n(460709),O=n(918514),L=n(220239),j=n(560682),K=n(552275),z=n(478140),q=n(632163),H=n(672495),G=n(785893);const W=(0,c.defineMessages)({copiedDebuggingInfo:{id:"externalObjectBlock.errorDropdown.copiedDebuggingInfo",defaultMessage:"Copied to clipboard."}});function $(e){const{state:t,store:n,onUpdate:o,onReplace:l,onAuthenticate:d,onRemove:p,description:g,statusCode:f,errorDescription:h,isInlineMenu:v}=e,{userHasBotForIntegration:y,pattern:b,integration:_,botIds:S,originalUrl:k}=t,w=(0,r.Fy)(),x=(0,r.O7)(),I=(0,a.yK)((e=>({menuIcon:{fill:e.regularIconColor,width:16},redThemeColor:(0,u.fi)("red",e)})),[]),T=(0,i.VK)((()=>{var e;return Boolean(null===(e=M.default.state.currentSpaceStore)||void 0===e?void 0:e.canEdit())}),[]),P=(0,i.VK)((()=>n.isExternalObjectInstanceBlockStore()),[n]),A=(0,i.VK)((()=>n.isExternalObjectInstancePageBlockStore()),[n]);let R;R=w.isMobile?{menuType:N.og.ActionSheet}:{menuType:N.og.Popup,minWidth:220};const D={key:"learn",render:e=>(0,G.jsx)(K.Z,{title:(0,G.jsx)(c.FormattedMessage,{defaultMessage:"Learn more about this error",id:"unfurling.errorOptions.learnMore.title"}),icon:(0,L.u)(I.menuIcon),...e}),action:()=>{U.showDialog({items:[{label:(0,G.jsx)(c.FormattedMessage,{id:"externalObjectInstanceBlockErrorDropdown.dialogItem.reviewGuide",defaultMessage:"View guide"}),color:"blue",onAccept:()=>{V.D({environment:x,url:(0,O.UY)("guides.unfurling")}),m.SC(x,{integrationId:_.id,entity:null==b?void 0:b.name,statusCode:f})}},{label:(0,G.jsx)(c.FormattedMessage,{id:"externalObjectInstanceBlockErrorDropdown.dialogItem.copyDebugData",defaultMessage:"Copy debugging information"}),color:void 0,onAccept:()=>{const e={statusCode:f,integrationId:_.id,botIds:S,url:k,debugMessage:h};Z.RD({environment:x,stringValue:JSON.stringify(e,null,2),copiedMessage:W.copiedDebuggingInfo})}}],showCancel:!0,keepFocus:!1,message:g})}},B={key:"remove",render:e=>(0,G.jsx)(K.Z,{title:(0,G.jsx)(c.FormattedMessage,{defaultMessage:"Remove",id:"unfurling.errorOptions.removeAction.title"}),style:{color:I.redThemeColor.color},icon:(0,j.y)({fill:I.redThemeColor.fill,width:16}),...e}),action:()=>{null==p||p()}},F={key:"replace",render:e=>(0,G.jsx)(K.Z,{title:(0,G.jsx)(c.FormattedMessage,{defaultMessage:"Change URL",id:"unfurling.errorOptions.replace.title"}),icon:(0,C.b)(I.menuIcon),...e}),action:()=>{l()}},$={key:"update",render:e=>(0,G.jsx)(K.Z,{title:(0,G.jsx)(c.FormattedMessage,{defaultMessage:"Try again",id:"unfurling.errorOptions.tryAgainAction.title"}),icon:(0,C.b)(I.menuIcon),...e}),action:()=>{null==o||o()}},Y={key:"authenticate",render:e=>(0,G.jsx)(K.Z,{title:y?401===f||439===f?(0,G.jsx)(c.FormattedMessage,{defaultMessage:"Re-authenticate account",id:"unfurling.errorOptions.authenticateAction.reAuthenticate.title"}):v?(0,G.jsx)(c.FormattedMessage,{defaultMessage:"Connect a different account",id:"unfurling.errorOptions.authenticateAction.alreadyAuthenticatedCompact.title"}):(0,G.jsx)(c.FormattedMessage,{defaultMessage:"Connect a different {integration} account",id:"unfurling.errorOptions.authenticateAction.alreadyAuthenticated.title",values:{integration:_.name}}):(0,G.jsx)(c.FormattedMessage,{defaultMessage:"Connect {integration} account",id:"unfurling.errorOptions.authenticateAction.notAuthenticated.title",values:{integration:_.name}}),icon:(0,G.jsx)(E.Z,{type:"image_url",imageURL:_.icon,size:16}),...e}),action:()=>{null==d||d()}},Q=[D];return T&&("error"===t.type?Q.push(F):("placeholder"===t.type?Q.push(F):Q.push($),(P||A&&[s.f3,s.mQ].includes(_.id))&&Q.push(Y))),p&&Q.push(B),(0,G.jsx)(z.Z,{...R,children:(0,G.jsx)(q.Z,{type:q.i.Vertical,initialFocus:v?void 0:0,sections:[{key:0,render:e=>(0,G.jsx)(H.Z,{...e,disableDesktopPadding:v,title:(0,G.jsx)(c.FormattedMessage,{defaultMessage:"Try these options",id:"unfurling.errorOptions.menuTitle"})}),items:Q}]})})}function Y(e){const t=(0,i.VK)((()=>{var t;return e.isCollectionView()?null===(t=e.getCollectionViewCollectionStore())||void 0===t||null===(t=t.getFormat().error)||void 0===t?void 0:t.status_code:e.getFormatStore().getKeyStore("error").getKeyStore("status_code").getValue()}),[e]),n=(0,i.VK)((()=>{let t;var n;e.isCollectionView()?t=null===(n=e.getCollectionViewCollectionStore())||void 0===n?void 0:n.getFormat().bot_id:t=e.getFormat().bot_id;const o=P.Z.bots.state.find((e=>e.id===t));if(o)return(0,s.s9)(o.integration_id)}),[e]),{message:r,description:a}=o.useMemo((()=>(0,b.xt)(t,n)),[t,n]);return{statusCode:t,message:r,description:a}}function Q(e){const{onAuthenticate:t,onReplace:n,onUpdate:o,state:r,store:i,onRemove:s,style:l}=e,c=(0,a.yK)((e=>({orangeThemeColor:(0,u.fi)("orange",e),dropdownIcon:{width:10,marginLeft:4,fill:e.lightIconColor}})),[]),{statusCode:d,message:p,description:m}=Y(i);return(0,G.jsx)(B.ZP,{popupType:B.Z4.Popup,originGap:4,renderOrigin:e=>439!==d?(0,G.jsxs)(F.Z,{style:l,icon:e=>(0,T.t)({...e,fill:c.orangeThemeColor.fill}),...e,children:[(0,G.jsx)("span",{children:S.default.formatMessage(p)}),(0,w.i)(c.dropdownIcon)]}):(0,G.jsx)(F.Z,{style:l,...e,children:(0,w.i)(c.dropdownIcon)}),render:e=>(0,G.jsx)($,{state:r,store:i,onUpdate:o?()=>{o(),e.close()}:void 0,onAuthenticate:t?()=>{t(),e.close()}:void 0,onReplace:()=>{n(),e.close()},onRemove:s?()=>{s(),e.close()}:void 0,statusCode:d,errorDescription:m.description,description:S.default.formatMessage(m,{integrationName:r.integration.name,statusCode:d})})})}function J(e){const{onAuthenticate:t,onReplace:n,onUpdate:o,state:r,store:i,onRemove:s}=e,l=(0,a.yK)((e=>({orangeThemeColor:(0,u.fi)("orange",e)})),[]),{statusCode:c,message:d,description:m}=Y(i);return(0,G.jsxs)("div",{style:{alignSelf:"stretch"},children:[(0,G.jsxs)("div",{style:{display:"flex",alignItems:"center",fontSize:p.Z.fontSize.UIRegular.desktop,fontWeight:p.Z.fontWeight.medium,marginBottom:4},children:[(0,T.t)({width:18,height:18,marginRight:6,fill:l.orangeThemeColor.fill}),(0,G.jsx)("span",{children:S.default.formatMessage(d)})]}),(0,G.jsx)("div",{style:{margin:"0 -14px"},children:(0,G.jsx)($,{state:r,store:i,onUpdate:o,onAuthenticate:t,onReplace:n,onRemove:s,statusCode:c,errorDescription:m.description,description:S.default.formatMessage(m,{integrationName:r.integration.name,statusCode:c}),isInlineMenu:!0})})]})}const X=function(e){let{store:t,canEdit:n,forceActionForUIDoc:o,postActionCallback:s,openPlaceholderMenu:u,buttonStyle:p,isHoverPreview:g,renderDefaultAction:v}=e;const y=(0,a.Fg)(),S=(0,r.O7)(),w=(0,i.VK)((()=>(0,_._l)({store:t,isInDarkMode:ee(S),canEdit:n,currentUserId:S.currentUser.id,showAction:o})),[t,S,n,o]),x=(0,i.VK)((()=>ee(S)),[S]),I=(0,k.r_)(),C=(0,i.VK)((()=>Boolean(null==I?void 0:I.isMember())),[I]),T=(0,i.VK)((()=>Boolean(null==I?void 0:I.isWorkspaceOwner())),[I]),P=(0,i.VK)((()=>{var e;return null===(e=M.default.state.currentSpaceStore)||void 0===e?void 0:e.getBotSettingsStore().getValue()}),[]);if(!w)return null;const{integration:A,action:R}=w,{r:D,g:B,b:Z}=A.accentColor,U=`rgba(${D},${B},${Z},${x?.6:1})`,V=T||(0,l.hU)({spaceBotSettings:P,integrationId:A.id,env:"production"}),N={state:w,store:t,onUpdate:()=>{oe({from:"external_object_instance_block_error_dropdown"},t,S,s)},onAuthenticate:()=>{ie({from:"external_object_instance_block_error_dropdown"},S,t,w,s)},onReplace:()=>{null==u||u()}},O={...N,onRemove:()=>{!function(e,t,n,o){var r;h.createAndCommit({userAction:"ExternalObjectInstanceAction.handleRemove",environment:e,perform:n=>{f.Cl({environment:e,blocks:[t],transaction:n})}}),m.oQ(e,{integrationId:n.integration.id,entity:null===(r=n.pattern)||void 0===r?void 0:r.name}),null==o||o()}(S,t,w,s)}};return(0,G.jsxs)(G.Fragment,{children:["authenticate"===R&&(0,b.sw)(S)&&C&&V&&(0,G.jsx)(F.Z,{icon:e=>(0,G.jsx)(E.Z,{type:"image_url",imageURL:A.accentIcon,size:20,style:{...e,width:16,height:16,marginRight:8,marginLeft:2}}),onClick:()=>ie({from:"external_object_instance_block"},S,t,w,s),style:{...te(y,p),background:U,fontSize:14,height:32,paddingRight:12,color:x?y.regularTextColor:y.regularInvertedTextColor},hoveredStyle:{background:(0,d._j)(U,.4)},pressedStyle:{background:(0,d._j)(U,.9)},children:(0,G.jsx)(c.FormattedMessage,{defaultMessage:"Connect to {integration} to update",id:"unfurling.authenticateButton.title",values:{integration:w.integration.name}})}),"update"===R&&(0,G.jsx)(re,{store:t,postActionCallback:s,buttonStyle:p,isHoverPreview:g}),"error"===R&&(g?(0,G.jsx)(J,{...N}):(0,G.jsx)(Q,{...O,style:te(y,p)})),!R&&v?(0,G.jsx)(ne,{renderDefaultAction:v,buttonStyle:p,store:t}):null]})};function ee(e){return"dark"===e.ThemeStore.state.mode}function te(e,t){return{marginRight:4,color:e.mediumTextColor,...t}}function ne(e){let{renderDefaultAction:t,buttonStyle:n,store:o}=e;const i=(0,a.Fg)(),s=(0,r.O7)(),{isMobile:l}=s.device;return(0,G.jsx)(B.ZP,{popupType:l?B.Z4.SlideUp:B.Z4.Popup,renderOrigin:e=>(0,G.jsx)(D.Z,{...e,mobileFeedback:l,style:{display:"flex",alignItems:"center",justifyContent:"center",width:l?36:28,height:l?36:28,borderRadius:4,flexShrink:0,opacity:"shown"===t?1:0,...te(i,n)},children:(0,x.o)({width:l?18:14,color:i.mediumIconColor})}),placementToOrigin:A.Iw.Bottom,render:e=>(0,G.jsx)(y.by,{titleForReloadMenuOption:(0,G.jsx)(c.FormattedMessage,{id:"linkPreview.reload",defaultMessage:"Reload preview"}),store:o,onAccept:()=>e.close(),extraSecondaryItemKey:"preview_to_mention"})})}function oe(e,t,n,o){var r;const{from:i}=e,a=null===(r=M.default.state.currentSpaceStore)||void 0===r?void 0:r.id;a&&(v.qK({environment:n,from:i,store:t,spaceId:a,bypassCache:"external_object_instance_block_error_dropdown"===i}),null==o||o())}function re(e){let{store:t,postActionCallback:n,buttonStyle:o,isHoverPreview:i}=e;const s=(0,a.Fg)(),l=(0,r.O7)(),d=(0,G.jsx)(F.Z,{onClick:()=>oe({from:"external_object_instance_block"},t,l,n),style:te(s,o),icon:e=>(0,C.b)({...e}),children:(0,G.jsx)(c.FormattedMessage,{defaultMessage:"Update",id:"unfurling.updateButton.title"})});return i?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("div",{style:{display:"flex",alignItems:"center",fontSize:p.Z.fontSize.UIRegular.desktop,marginBottom:4},children:[(0,I.D)({width:18,height:18,marginRight:6}),(0,G.jsx)("span",{children:(0,G.jsx)(c.FormattedMessage,{defaultMessage:"This link preview is out-of-date.",id:"unfurling.updateButton.header"})})]}),d]}):d}function ie(e,t,n,o,r){var i;const{from:a}=e,s=o.originalUrl,{currentSpaceStore:l}=M.default.state;if(!l)return;const c=null===(i=(0,_.GQ)(s,l.id))||void 0===i?void 0:i.integration;c&&s&&(g.hM({environment:t,integration:c,spaceId:l.id,unfurlUrl:s,externalObjectInstanceBlockId:n.id,from:a}),R.Z.reset(),null==r||r())}},936347:(e,t,n)=>{n.d(t,{Z:()=>H});var o=n(667294),r=n(800480),i=n(886628),a=n(926249),s=n(401898),l=n(61202),c=n(341232),d=n(99340),u=n(568859),p=n(749085);class m extends p.default{getInitialState(){return{error:!1,loading:!1}}}const g=m;var f=n(668709),h=n(724405),v=n(250906),y=n(959062),b=n(676725),_=n(544876),S=n(531701),k=n(653965),w=n(137810),x=n(277907);const I=new x.Ss("TooltipOnSlackEmbed",(async()=>await Promise.all([n.e(62743),n.e(5242),n.e(31189),n.e(40017),n.e(99417),n.e(84654),n.e(58075),n.e(77793)]).then(n.bind(n,98380)))),C=(0,x.kF)(I,(e=>e.TooltipOnSlackEmbed));var T=n(206398),M=n(279827),P=n(751077),A=n(634406),R=n(828451),D=n(584076),B=n(568785),E=n(81865),F=n(819987),Z=n(785893);const U=o.forwardRef((function(e,t){var n;const{state:a,store:l,style:u,externalObjectTokenStore:p,canEdit:m,forceActionForUIDoc:g,onClick:f,showDefaultAction:y}=e,{originalUrl:S,renderConfig:k,integration:x,updating:I,status_code:P}=a,A=(0,r.O7)(),E=(0,o.useRef)(null),U="placeholder"===a.type,L="error"===a.type,j=(0,i.VK)((()=>S&&(0,c.pI)(S,l.pointer.spaceId)),[l.pointer,S]),{botId:K,externalObjectId:z}=(0,i.VK)((()=>{const e=l.getFormat();return{botId:(null==e?void 0:e.bot_id)||"",externalObjectId:(null==e?void 0:e.external_object_id)||""}}),[l]),q=(0,i.VK)((()=>M.default.isVisible("ai_slack_qna_embed_tooltip")),[]),H=(0,i.VK)((()=>p.state.loading),[p]);(0,o.useEffect)((()=>{v.K9(A,{integrationName:x.name,integrationId:x.id,botId:K,externalObjectId:z})}),[x,K,z,A]);const G=(0,d.rv)(l),W=(0,h.yK)((e=>{const t=!(!Boolean(k.previewAttributes)||!k.previewAttributes)&&(0,s.Of)(k.previewAttributes);return{linkBox:{flexGrow:1,minWidth:0,...(U||L)&&{background:e.embedPlaceholderBackground}},linkBoxInner:{display:"flex",alignItems:"center",border:`1px solid ${e.tableDividerColor}`,borderRadius:t?"0px 0px 4px 4px":4,borderLeft:t?"none":`1px solid ${e.tableDividerColor}`,borderRight:t?"none":`1px solid ${e.tableDividerColor}`,padding:"8px 12px",...G,...u},title:{fontWeight:w.Z.fontWeight.medium,...w.Z.textOverflowStyle,color:e.regularTextColor},subHeaderContainer:{display:"flex",alignItems:"center",color:e.mediumTextColor,fontSize:12}}}),[U,L,k.previewAttributes,G,u]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(D.Z,{style:W.linkBox,innerStyle:W.linkBoxInner,...U||L?{onClick:f}:{href:j,external:!0},children:[(0,Z.jsx)("div",{style:{display:"flex",alignSelf:"start",height:32,width:32,marginRight:12,marginLeft:4,marginTop:3,marginBottom:3,position:"relative"},children:(0,Z.jsx)(V,{renderConfig:k,integrationIcon:x.icon})}),(0,Z.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",flexGrow:1,flexShrink:1,overflow:"hidden"},children:[(0,Z.jsxs)("div",{style:{display:"flex",alignItems:"baseline",fontSize:14},children:[(0,b.Z)((null===(n=k.headerAttributes)||void 0===n?void 0:n.map(((e,t)=>(0,Z.jsx)(T.ox,{...e,store:l,style:0===t?W.title:{}},`attribute-${t}`))))||[],(e=>(0,Z.jsx)("span",{style:{marginRight:6}},`spacer-${e}`))),(I||439===P||H)&&(0,Z.jsx)(B.Z,{style:{marginLeft:6}})]}),k.bodyAttribute&&((0,_.O0)(k.bodyAttribute)?(0,Z.jsx)(T.t9,{attribute:k.bodyAttribute}):(0,Z.jsx)(T.hx,{attribute:k.bodyAttribute,store:l})),(0,Z.jsxs)("div",{style:W.subHeaderContainer,children:[k.subheaderIcon&&(0,Z.jsx)(N,{attribute:k.subheaderIcon}),k.subheaderAttributes&&(0,b.Z)(k.subheaderAttributes.map((e=>(0,Z.jsx)(O,{attributeConfig:e,store:l},e.attribute.id))),(e=>(0,Z.jsx)("span",{style:{marginLeft:3,marginRight:3},children:"•"},e)))]})]}),(0,Z.jsx)(F.Z,{canEdit:m,forceActionForUIDoc:g,store:l,renderDefaultAction:y?"shown":"invisible",buttonStyle:k.bodyAttribute?{alignSelf:"flex-start",marginTop:4}:{},openPlaceholderMenu:f})]}),(0,Z.jsx)(R.g,{shouldShow:q,calloutId:"ai_slack_qna_embed_tooltip",children:(0,Z.jsx)(C,{origin:E,originalUrl:S})})]})}));function V(e){let{renderConfig:t,integrationIcon:n}=e;const o=(0,h.Fg)(),r=k.mN(t.icons||[],(e=>`${e.type}:${e.values[0].toString()}`));return r.length>=2?(0,Z.jsxs)("div",{style:{width:32,height:32},children:[(0,Z.jsx)(T.lf,{attribute:r[0],isSmall:!0}),(0,Z.jsx)(T.lf,{attribute:r[1],isSmall:!0,style:{position:"absolute",bottom:0,right:2}}),(0,Z.jsx)(P.Z,{type:"image_url",imageURL:n,size:16,style:{position:"absolute",bottom:-3,right:-3},imageStyle:L(o)})]}):1===r.length?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(T.lf,{attribute:r[0],isSmall:!1}),(0,Z.jsx)(P.Z,{type:"image_url",imageURL:n,size:16,style:{position:"absolute",bottom:-2,right:-2},imageStyle:L(o)})]}):(0,Z.jsx)(P.Z,{type:"image_url",imageURL:n,size:38})}function N(e){let{attribute:t}=e;const n=(0,h.Fg)();if((0,_.li)(t)){const e=t.values[0];return(0,Z.jsx)(E.Z,{isAuthenticated:!1,url:e,width:32,render:(e,t)=>(0,Z.jsx)(A.Z,{src:t,height:12,placeholderLoadedStyle:{width:12,height:12,marginRight:4}})})}if((0,_.hW)(t)){const e=t.values[0],o=e?`rgb(${e.r},${e.g},${e.b})`:"gray",{colorName:r,shade:i}=(0,S.lL)(o);return(0,Z.jsx)("div",{style:{width:12,height:12,marginRight:4,background:n.accentColors[r][i],borderRadius:4,flexShrink:0}})}return null}function O(e){let{attributeConfig:t,store:n}=e;return(0,Z.jsx)(T.ox,{...t,store:n})}function L(e){return{filter:`\n            drop-shadow(0px 0px 1px ${e.contentBackground})\n            drop-shadow(0px 0px 1px ${e.contentBackground})\n            drop-shadow(0px 0px 1px ${e.contentBackground})\n        `}}const j=o.forwardRef((function(e,t){const{attributes:n,state:a,store:l,blockResizerStore:c,externalObjectTokenStore:d,canEdit:u,forceActionForUIDoc:p,onClick:m,showDefaultAction:g}=e,f=n[0],{values:b,mimeType:_}=f,S=b[0],k=(0,r.O7)(),w=(0,i.VK)((()=>l.isExternalObjectInstanceBlockStore()?l:void 0),[l]),{botId:x,externalObjectId:I}=(0,i.VK)((()=>{const e=l.getFormat();return{botId:(null==e?void 0:e.bot_id)||"",externalObjectId:(null==e?void 0:e.external_object_id)||""}}),[l]);(0,o.useEffect)((()=>{v.K9(k,{integrationName:a.integration.name,integrationId:a.integration.id,botId:x,externalObjectId:I})}),[a.integration,x,I,k]);const C=(0,h.yK)((e=>({container:{overflow:"hidden",borderRadius:6,border:`1px solid ${e.tableDividerColor}`,borderBottom:void 0,position:"relative"}})),[]);let T;"image/*"===_?T="image":"audio/*"===_?T="audio":"video/*"===_?T="video":"application/pdf"===_?T="pdf":"text/html"===_?T="embed":(0,s.t1)(_);const M="image"===T||"pdf"===T||"embed"===T;return w?(0,Z.jsx)("div",{style:C.container,children:(0,Z.jsx)(y.ZP,{store:w,source:S,showExpandButton:M,mediaType:T,disabled:!1,preserveScale:"image"===T,blockResizerStore:c,contentBelowSource:(0,Z.jsx)(U,{state:a,store:l,canEdit:u,externalObjectTokenStore:d,forceActionForUIDoc:p,ref:t,onClick:m,showDefaultAction:g})})}):null}));function K(e){const{originalUrl:t,store:n}=e,o=(0,d.rv)(n),r=(0,h.yK)((e=>({linkBox:{display:"flex",alignItems:"center",border:`1px solid ${e.tableDividerColor}`,borderRadius:4,borderLeft:`1px solid ${e.tableDividerColor}`,borderRight:`1px solid ${e.tableDividerColor}`,padding:"8px 12px",...o}})),[o]);return(0,Z.jsxs)(D.Z,{href:t,external:!0,style:{flexGrow:1,minWidth:0},innerStyle:r.linkBox,children:[(0,Z.jsx)(z,{style:{width:38,height:38}}),(0,Z.jsxs)("div",{style:{display:"flex",flexDirection:"column",flexGrow:1},children:[(0,Z.jsx)(z,{style:{width:"50%",height:14,margin:4}}),(0,Z.jsx)(z,{style:{width:"40%",height:12,margin:4}})]})]})}function z(e){let{style:t}=e;const n=(0,h.yK)((e=>({container:{overflow:"hidden",position:"relative",background:e.selectLightGray[30],...t},shimmerDiv:{position:"absolute",height:"100%",width:"100%",zIndex:1,animation:"shimmer 1s infinite",background:`linear-gradient(to right, ${e.selectLightGray[30]} 0%, ${e.selectLightGray[50]} 20%, ${e.selectLightGray[30]} 40%, ${e.selectLightGray[30]} 100%)`}})),[t]);return(0,Z.jsx)("div",{style:n.container,children:(0,Z.jsx)("div",{style:n.shimmerDiv})})}function q(e,t){const{store:n}=e,a=(0,o.useRef)(null),p=(0,r.O7)(),m=(0,d.PE)(n,e.disabled),[h,v]=(0,o.useState)(!1),y=h||p.device.isMobile,b=(0,i.qz)(void 0,g),_=(0,i.qz)(void 0,u.Z),S=(0,o.useCallback)((()=>{v(!0)}),[]),k=(0,o.useCallback)((()=>{v(!1)}),[]),w=(0,i.VK)((()=>(0,c._l)({store:n,isInDarkMode:G(p),canEdit:m,currentUserId:p.currentUser.id,showAction:e.forceActionForUIDoc})),[m,p,e.forceActionForUIDoc,n],{useDeepEqual:!0}),x=(0,i.VK)((()=>(0,c.y6)(n)),[n]),I=(0,o.useCallback)((()=>{if("placeholder"===(null==w?void 0:w.type)||"error"===(null==w?void 0:w.type)){const e=a.current;if(e&&e instanceof Element)return e}}),[w]),C=(0,o.useCallback)((()=>{const e=I();e&&function(e,t,n,o,r){const i=(0,c.y6)(n);l.os({originRect:e.getBoundingClientRect(),environment:t,externalObjectInstanceBlockStore:n,placeholderIntegrationId:null==i?void 0:i.integration_id,integration:null==r?void 0:r.integration,externalObjectTokenStore:o})}(e,p,n,b,w)}),[p,b,I,n,w]),T=w?"error"!==w.type||null!=x&&x.integration_id?(0,Z.jsx)(f.p,{allowSelectionWithin:!0,ref:a,onMouseEnter:S,onMouseLeave:k,children:w.renderConfig.previewAttributes&&(0,s.Of)(w.renderConfig.previewAttributes)?(0,Z.jsx)(j,{attributes:w.renderConfig.previewAttributes,blockResizerStore:_,canEdit:m,externalObjectTokenStore:b,state:w,store:n,forceActionForUIDoc:e.forceActionForUIDoc,onClick:C,ref:a,showDefaultAction:y}):(0,Z.jsx)(U,{canEdit:m,externalObjectTokenStore:b,state:w,store:n,forceActionForUIDoc:e.forceActionForUIDoc,style:e.style,onClick:C,ref:a,showDefaultAction:y})}):(0,Z.jsx)(f.p,{allowSelectionWithin:!0,ref:a,children:(0,Z.jsx)(K,{store:n,style:e.style,originalUrl:w.originalUrl})}):(0,Z.jsx)(f.p,{allowSelectionWithin:!0,ref:a,children:(0,Z.jsx)(K,{store:n,style:e.style,originalUrl:void 0})});return(0,d.ez)(n,t,(0,o.useMemo)((()=>({renderedType:"external_object_instance",getBlockStore:()=>n,getNode:()=>a.current,handleCreated:C})),[C,n]),T)}const H=o.memo(o.forwardRef(q),a.Z);function G(e){return"dark"===e.ThemeStore.state.mode}},369721:(e,t,n)=>{n.d(t,{S:()=>V,Z:()=>O});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(949271),l=n(643593),c=n(559054),d=n(421838),u=n(709291),p=n(653965),m=n(926249),g=n(137810),f=n(757549),h=n(631781),v=n(762365),y=n(627153),b=n(524677),_=n(898104),S=n(210228),k=n(133767),w=n(843250),x=n(99340),I=n(735948),C=n(972631),T=n(27411),M=n(13966),P=n(391893),A=n(523864),R=n(164921),D=n(164369),B=n(186329),E=n(78454),F=n(785893);const Z=(0,u.defineMessages)({fileTitle:{defaultMessage:"File",id:"fileBlock.fileTab.title"},embedButtonText:{defaultMessage:"Embed link",id:"fileBlock.embedButton.label"},embedFilePrompt:{defaultMessage:"Paste a file link…",id:"fileBlock.linkPrompt.placeholder"},embedCaption:{defaultMessage:"Works with links of PDFs, Google Drive, Google Maps, CodePen…",id:"fileBlock.linkPrompt.caption"}});function U(e,t){var n,a;const s=Boolean(e.commentProps),c=null===(n=e.commentProps)||void 0===n?void 0:n.onRemoveBlockFromComment,m=(0,u.useIntl)(),g=(0,r.O7)(),w=(0,r.Fy)(),I=(0,o.useRef)(null),R=(0,o.useId)(),[D,E]=(0,o.useState)(!1),U=(0,x.PE)(e.store,e.disabled),O=(0,x.rv)(e.store),L=(0,i.VK)((()=>{const t=e.store.getProperties(),n=t&&t.source,o=d.QaF(n),{display_source:r}=e.store.getFormat();return r||o}),[e.store]),j=(0,i.VK)((()=>T.default.getKeyState(T.default.getBlockKey(e.store.id))),[e.store.id]),K=w.isMobile||D,z=(0,i.VK)((()=>e.store.getProperties()),[e.store]),q=(0,o.useMemo)((()=>d.Jcv(z&&z.title)),[z]),H=(0,o.useMemo)((()=>d.Jcv(z&&z.size)),[z]),G=K&&U&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(N,{fileBlockStore:e.store}),(0,F.jsx)(M.Z,{style:{marginRight:4},store:e.store,fadeIn:!0})]}),W=(0,o.useCallback)((()=>{const t=e.store.getPropertyStore("caption");b.eP({environment:g,store:e.store}),_.setSelectionAtEnd({store:t})}),[g,e.store]),$=(0,o.useCallback)((t=>{const n=t[0];S.createAndCommit({userAction:"FileBlock.handleUpload",environment:g,perform:t=>{v.v({environment:g,store:e.store,source:void 0,name:void 0,size:void 0,transaction:t})}}),f.re(g,{source:"upload",file:n.name}),v.c({environment:g,store:e.store,file:n})}),[g,e.store]),Y=(0,o.useCallback)((()=>{const t=I.current;if(U&&t){const n=t.getBoundingClientRect();y.$(g,{originRect:n,originGap:0,isSmallWidth:!0,showArrow:!0,title:m.formatMessage(Z.fileTitle),currentTab:"file",tabs:[{type:"file",fileUpload:!0,imageUpload:w.isAndroid,videoUpload:w.isAndroid,onUpload:$},{type:"embed",buttonText:m.formatMessage(Z.embedButtonText),inputPlaceholder:m.formatMessage(Z.embedFilePrompt),caption:m.formatMessage(Z.embedCaption),onChange:t=>{y.Z(),S.createAndCommit({userAction:"FileBlock.handleOpenMenu",environment:g,perform:n=>{v.v({environment:g,store:e.store,source:t,name:void 0,size:void 0,transaction:n})}}),f.re(g,{file:t,source:"embed"}),f.bO(g,{pastedText:t,source:"file_block_menu"})}}]})}}),[U,w.isAndroid,g,$,m,e.store]),Q=(0,o.useCallback)((()=>{h.qL(g,{store:e.store,from:"embedded_block_click"})}),[g,e.store]),J=(0,o.useMemo)((()=>({flexGrow:1,minWidth:0,borderRadius:4,...p.CE(O,["fontSize","lineHeight"])})),[O]),X=(0,F.jsxs)("div",{role:"figure","aria-labelledby":R,ref:I,children:[(0,F.jsxs)("div",{onMouseMove:()=>E(!0),onMouseLeave:()=>E(!1),style:{display:"flex"},children:[s?(0,F.jsx)(k.LazyCommentFileBlock,{title:l.rF({title:q,source:L}),source:L,size:H,store:e.store,onClick:Q,showBlockActionMenuButton:!(null!==(a=e.commentProps)&&void 0!==a&&a.shouldHideBlockActionMenu)??!1}):(0,F.jsx)(V,{title:q,url:L,size:H,onClick:Q,right:G,style:J}),(0,F.jsx)(A.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store})]}),(0,F.jsx)(P.Z,{store:e.store,captionAriaId:R,disabled:e.disabled})]}),ee=(0,F.jsxs)("div",{onMouseMove:()=>E(!0),onMouseLeave:()=>E(!1),style:{display:"flex"},ref:I,children:[(0,F.jsx)(B.Z,{disabled:e.disabled,iconSvg:C.R,shouldHideRight:!K,right:U&&(0,F.jsx)(M.Z,{store:e.store,fadeIn:!1}),isLoading:Boolean(j),progressPercent:j?j.progressPercent:0,file:j?j.file:void 0,name:j?j.name:void 0,size:j?j.size:void 0,onClick:Y,children:(0,F.jsx)(u.FormattedMessage,{defaultMessage:"Upload or embed a file",id:"fileBlock.uploadOrEmbed.placeholder"})}),(0,F.jsx)(A.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store})]}),te=L?X:ee;return(0,x.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"file",getNode:()=>I.current,getBlockStore:()=>e.store,caption:W,handleCreated:Y,edit:Y,activate:Y,replace:Y,...c&&{handleRemoveBlockFromComment:()=>c(e.store)}})),[W,Y,c,e.store]),te)}function V(e){const{style:t,right:n,title:o,url:r,size:i,onClick:a}=e,c={paddingTop:s.ZD.paddingTop,paddingBottom:s.ZD.paddingBottom,paddingLeft:s.ZD.paddingLeft};return(0,F.jsx)(R.Z,{style:t,onClick:a,children:(0,F.jsx)(E.ZP,{style:c,left:(0,C.R)(),leftStyle:{width:"1.35em",height:"1.35em"},alignment:E.v2.Center,right:n,children:(0,F.jsxs)("div",{style:{display:"flex",alignItems:"baseline"},children:[(0,F.jsx)("div",{style:{...g.Z.textOverflowStyle},children:l.rF({title:o,source:r})}),i&&(0,F.jsx)(D.Z,{isSmall:!0,style:{marginLeft:6,whiteSpace:"nowrap"},children:i})]})})})}function N(e){const{fileBlockStore:t}=e,[{value:s}]=(0,c.r5)((async()=>{const e=await Promise.resolve().then(n.bind(n,81598));return(await e.assistantDependency.load()).assistantActions}),[]),[l,d]=(0,I.C)(),p=(0,a.yK)((e=>({askAiText:{fontSize:14,color:e.aiPurpleColor,marginRight:4,paddingTop:4,paddingBottom:4,paddingRight:6,paddingLeft:6,borderRadius:6,background:d?e.buttonHoveredBackground:void 0}})),[d]),m=(0,i.VK)((()=>s&&s.isSelectionValidAttachmentSelection([t])),[s,t]),g=(0,r.O7)(),f=(0,o.useCallback)((e=>{s&&(s.initializeSessionFromAttachmentBlockSelection({environment:g,selectedAttachmentStore:t}),e.preventDefault(),e.stopPropagation())}),[s,g,t]);return m?(0,F.jsx)("div",{style:p.askAiText,onClick:f,className:w.JiD,ref:l,children:(0,F.jsx)(u.FormattedMessage,{defaultMessage:"Ask AI",id:"FileBlock.AssistantChatWithAiTextButton"})}):null}const O=o.memo(o.forwardRef(U),m.Z)},865453:(e,t,n)=>{n.d(t,{Z:()=>S});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(949271),l=n(176490),c=n(709291),d=n(926249),u=n(249394),p=n(635328),m=n(99340),g=n(445131),f=n(523864),h=n(965187),v=n(17377),y=n(785893);const b=(0,c.defineMessages)({placeholder:{defaultMessage:"Heading 1",id:"header1Block.placeholder"}});function _(e,t){const n=(0,c.useIntl)(),d=(0,r.O7)(),_=(0,r.Fy)(),S=(0,o.useRef)(null),k=(0,m.rv)(e.store,!0),w=(0,m.Iy)(e.store),x=(0,i.VK)((()=>e.store.getBlockTitleStore()),[e.store]),I=(0,i.VK)((()=>g.Z.isOpen(e.store.id)&&!e.hideContent),[e.hideContent,e.store.id]),C=(0,i.VK)((()=>Boolean(e.store.getInsertSuggestion())),[e.store]),T=(0,a.yK)((t=>{const n=(_.isMobile||e.smallerHeaders?1.5:l.eV)*l.u9,o=_.isMobile||e.smallerHeaders?1.5:l.eV;return{root:{display:"flex",width:"100%",...k},toggle:{height:`${n}em`,marginTop:3},headerText:{...s.ZD,...(0,l.DK)({fontSizeValue:o,fontFamily:w})},headerTextPlaceholder:{...C?{color:t.text.uiBlueTertiary,WebkitTextFillColor:"initial"}:{WebkitTextFillColor:t.headerBlockPlaceholderTextColor}}}}),[k,C,_.isMobile,w,e.smallerHeaders]);return(0,m.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"header",getNode:()=>S.current,getBlockStore:()=>e.store,activate(){p.th(d,e.store,e.hideContent)}})),[d,e.hideContent,e.store]),(0,y.jsx)("div",{ref:S,style:{...T.root,...e.style},children:(0,y.jsxs)(v.Z,{store:e.store,toggleStyle:T.toggle,childrenStyleWhenToggleable:{display:"flex"},hideContent:e.hideContent,disabled:e.disabled,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,disableDrag:e.disableDrag,children:[(0,y.jsx)(h.Z,{tagName:"h2",disabled:e.disabled,store:x,placeholder:n.formatMessage(b.placeholder),placeholderStyle:T.headerTextPlaceholder,style:T.headerText,pasteBehavior:"block",legacyTransclusionParentStore:e.legacyTransclusionParentStore,inPageFind:u.B3.block_match,renderWhiteSpaceWhenEmptyOnAndroid:!0}),(0,y.jsx)(f.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store,recursivelyLoadAllDiscussions:!I})]})}))}const S=o.memo(o.forwardRef(_),d.Z)},483182:(e,t,n)=>{n.d(t,{Z:()=>u});n(667294);var o=n(800480),r=n(886628),i=n(724405),a=n(225888),s=n(831358),l=n(552275),c=n(316354),d=n(785893);function u(e){const t=(0,o.O7)();return(0,d.jsx)(c.Z,{href:e.href,external:!0,onClick:()=>a.Fs(t,{from:e.analyticsFrom}),children:(0,d.jsx)(l.Z,{icon:!e.left&&(0,d.jsx)(m,{left:e.left}),title:(0,d.jsx)(p,{title:e.title,left:e.left}),focused:!1})})}function p(e){const t=(0,o.O7)(),n=(0,r.VK)((()=>t.device.isPhone),[t]),a=(0,i.yK)((e=>({title:{fontSize:n?14:12,verticalAlign:1,color:e.lightTextColor}})),[n]);return e.left?(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,d.jsx)("span",{style:{...a.title,marginRight:"auto"},children:e.left}),(0,d.jsx)(m,{left:e.left}),(0,d.jsx)("span",{style:a.title,children:e.title})]}):(0,d.jsx)("span",{style:a.title,children:e.title})}function m(e){let{left:t}=e;const n=(0,i.Fg)(),r=(0,o.MO)();return(0,s.m)({width:r?16:14,fill:n.lightIconColor,marginRight:t?6:0})}},474523:(e,t,n)=>{n.d(t,{Z:()=>g});var o=n(667294),r=n(800480),i=n(724405),a=n(137810),s=n(225888),l=n(831358),c=n(573063),d=n(316354),u=n(489728),p=n(785893);function m(e){let{title:t,href:n,analyticsFrom:m,shouldShrink:g,style:f,buttonStyle:h,iconStyle:v,isBlue:y,onClick:b,onFocus:_,onBlur:S,onMouseDown:k,onMouseEnter:w,onMouseLeave:x,textSize:I,isMobile:C}=e;const T=(0,r.O7)(),M={onFocus:_,onBlur:S,onMouseDown:k,onMouseEnter:w,onMouseLeave:x},P=(0,o.useCallback)((()=>{void 0!==b&&b(),s.Fs(T,{from:m})}),[m,T,b]),A=C?"small"!==I?a.Z.fontSize.UIRegular.mobile:a.Z.fontSize.UISmall.mobile:"small"!==I?a.Z.fontSize.UIRegular.desktop:a.Z.fontSize.UISmall.desktop;let R="1.2";void 0!==I&&(R=C?"small"!==I?a.Z.lineHeight.UIRegular.mobile:a.Z.lineHeight.UISmall.mobile:"small"!==I?a.Z.lineHeight.UIRegular.desktop:a.Z.lineHeight.UISmall.desktop);const D=(0,i.yK)((()=>({link:{display:"flex",marginLeft:-6,...f}})),[f]);return(0,p.jsx)(d.Z,{style:D.link,className:"notion-print-ignore",href:n,external:!0,onClick:P,...M,children:t?(0,p.jsx)(u.Z,{icon:l.m,iconStyle:v,isSmall:!0,isBlue:y,isLightGray:!y,shouldShrink:g,style:{...h,fontSize:A,lineHeight:R},children:t}):(0,p.jsx)(c.Z,{icon:l.m,iconStyle:v,isBlue:y,style:h,...M})})}const g=o.memo(m)},395530:(e,t,n)=>{n.d(t,{Z:()=>S});n(782801);var o=n(667294),r=n(800480),i=n(188464),a=n(724405),s=n(426198),l=n(963085),c=n(212534),d=n(92994),u=n(155367),p=n(480796),m=n(385555),g=n(569784),f=n(825777),h=n(785893);const v={position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:1};function y(e,t){const n=(0,o.useRef)(null),[r,i]=(0,o.useState)(!1),a=(0,o.useCallback)((()=>{document.activeElement&&document.activeElement===n.current&&document.activeElement.blur()}),[]);(0,o.useEffect)((()=>{a()}));const s=(0,o.useCallback)((()=>{const e=u.ZP.state.isDragging,t=p.Z.state.isDragging,n=g.default.state.isActive;i(e||t||n)}),[]);return(0,h.jsx)("div",{ref:t,style:e.style,onMouseMove:s,onMouseEnter:s,onMouseLeave:a,children:(0,h.jsx)("div",{style:(0,l.kl)(e),children:(0,h.jsx)(b,{ref:n,...e,disabled:r})})})}const b=o.forwardRef((function(e,t){const{background:n,disabled:r,onContentLoadTimeout:i,renderPreview:s,allow:u,source:p}=e,[m,g]=(0,o.useState)(!1),[y,b]=(0,o.useState)(!1),S="on"===(0,d.a)("embed-previews"),k=(0,o.useCallback)((e=>{e.preventDefault(),(0,c.ZP)({event:e,context:c.Af.EditorClick,callback:()=>{b(!0)}})}),[]),w=(0,o.useCallback)((()=>{g(!0)}),[]),x=(0,a.yK)((e=>({iframe:{...v,pointerEvents:r?"none":"auto",backgroundColor:n?e.contentBackground:"none"}})),[n,r]);if(function(e,t,n){if(!window.__webViewTerminatedWhileAppActive&&!t)return!1;return!e&&Boolean(n)}(y,S,s))return(0,h.jsx)("div",{style:{...x.iframe,backgroundColor:"none"},onMouseDown:k,children:null==s?void 0:s()});const I=(0,l.I$)(p);return(0,h.jsx)(f.Z,{innerStyle:{height:"100%",width:"100%"},loaded:m,style:v,spinnerSize:"1em",showSpinnerTimeout:500,children:I&&(0,h.jsx)(_,{ref:t,sourceUrl:I,wrapperStyle:{...x.iframe,backgroundColor:"none"},style:x.iframe,allow:u,onLoad:w,onContentLoadTimeout:i})})})),_=o.forwardRef((function(e,t){const{sourceUrl:n,style:a,allow:l,onLoad:c,onContentLoadTimeout:d,wrapperStyle:u}=e,p=(0,r.O7)(),[g,f]=(0,s.jo)(),v=(0,o.useRef)(void 0),y=(0,i.Z)(t,v),b=(0,o.useRef)(void 0),_=p.device.isElectron?"allow-scripts allow-popups allow-forms allow-same-origin":"allow-scripts allow-popups allow-top-navigation-by-user-activation allow-forms allow-same-origin allow-storage-access-by-user-activation allow-popups-to-escape-sandbox",S=(0,o.useCallback)((()=>{if(m.default.checkGate({gateName:"embed_block_fallback"})){let t;try{t=Boolean(v.current&&v.current.contentWindow&&"about:blank"!==v.current.contentWindow.location.href)}catch(e){if(e instanceof DOMException)return;throw e}t||null==d||d()}}),[d]),k=(0,o.useCallback)((()=>{c(),S()}),[S,c]);return(0,o.useEffect)((()=>(b.current=setTimeout(S,7e3),()=>{clearTimeout(b.current)})),[S]),(0,h.jsx)("div",{ref:g,style:u,children:f&&(0,h.jsx)("iframe",{ref:y,style:a,src:n,frameBorder:"0",onLoad:()=>{clearTimeout(b.current),k()},sandbox:_,allowFullScreen:!0,allow:l})})})),S=o.forwardRef(y)},942402:(e,t,n)=>{n.d(t,{Z:()=>s});n(667294);var o=n(531701),r=n(316354),i=n(785893);const a={red:"notion-link",purple:"notion-link-ai-version",blue:"notion-link-blue"};const s=function(e){let{href:t,external:n,disableHover:s,onClick:l,onMouseDown:c,onMouseEnter:d,onMouseLeave:u,disableUnderline:p,style:m,hoverColor:g="red",children:f,color:h}=e;const v={display:"inline",textDecoration:"underline",color:h??o.ZP.inherit},y=g?a[g]:a.red;return(0,i.jsx)(r.Z,{href:t,external:n,style:{...v,...m,...p&&{textDecoration:"none"}},onClick:l,className:s?void 0:y,onMouseDown:c,onMouseEnter:d,onMouseLeave:u,children:f})}},483785:(e,t,n)=>{n.d(t,{Z:()=>f});n(667294);var o=n(184747),r=n(886628),i=n(568626),a=n(552629),s=n(937850),l=n(134232),c=n(788632),d=n(749085);class u extends d.default{getInitialState(){return{loaded:!1}}}const p=u;var m=n(568785),g=n(785893);const f=function(e){let{fetch:t,willRender:n,render:d,loading:u}=e;const f=(0,r.qz)(void 0,p),h=(0,r.VK)((()=>f.state),[f]);(0,o.Z)((()=>{!async function(e,t){let n=1e3;for(;;)try{const n=await e();t.setState({loaded:!0,result:n});break}catch(o){i.log({level:"warning",from:"LazyLoader",type:"fetchError",error:(0,a.Ui)(o),data:{miscDataToConvertToString:{waitMs:n}}}),await s.Vs(n),await c.Z.waitUntil((()=>c.Z.state.online)),n=Math.min(2*n,3e4)}}(t,f)}));const v=(0,l.Z)(!h.loaded,300,0);return h.loaded?(n&&n(),d(h.result)):u?u(v):v?(0,g.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%"},children:(0,g.jsx)(m.Z,{})}):null}},630915:(e,t,n)=>{n.d(t,{Z:()=>Ve});n(757658);var o=n(667294),r=n(427531),i=n(800480),a=n(797511),s=n(886628),l=n(541432),c=n(421202),d=n(653965),u=n(307032),p=n(401898),m=n(13084),g=n(210228),f=n(798165),h=n(367669),v=n(400807),y=n(385555),b=n(723883),_=n(206258),S=n(599757),k=n(831103),w=n(883355),x=n(45060),I=n(600606),C=n(718844),T=n(475246),M=n(619584),P=n(103022),A=n(594419),R=n(164964),D=n(801742),B=n(110906),E=n(808549),F=n(607709),Z=n(21404),U=n(27105),V=n(119037),N=n(721429),O=n(478175),L=n(341232),j=n(278429),K=n(450627),z=n(917504),q=n(165598),H=n(273959),G=n(635328),W=n(529294),$=n(334017),Y=n(849427),Q=n(224646),J=n(427534),X=n(568859),ee=n(304926),te=n(273024),ne=n(188923),oe=n(226664),re=n(27724),ie=n(445131),ae=n(951247),se=n(515355),le=n(153223),ce=n(623063),de=n(645952),ue=n(279954),pe=n(505595),me=n(785893);const ge=5*M.C0,fe=4,he=4,ve={quote:he,code:he,header:he,bookmark:he,external_object_instance:he,file:void 0,video:he,embed:he,tweet:he,drive:he,audio:he,gist:he,maps:he,framer:he,invision:he,figma:he,loom:he,typeform:he,mixpanel:he,codepen:he,equation:he,pdf:he,image:he,sub_header:void 0,sub_sub_header:void 0,page:void 0,collection_view:void 0,collection_view_page:void 0,form:void 0,column_list:void 0,column:void 0,personal_home_page:void 0,breadcrumb:void 0,text:void 0,bulleted_list:void 0,numbered_list:void 0,to_do:void 0,toggle:void 0,factory:void 0,copy_indicator:void 0,divider:void 0,link_to_collection:void 0,link_to_page:void 0,alias:void 0,transclusion_container:1,transclusion_reference:1,callout:he,table_of_contents:he,whimsical:he,miro:he,abstract:he,sketch:he,excalidraw:he,replit:he,hex:he,deepnote:he,table:1,table_row:void 0,tab:he,external_object_instance_page:he,button:void 0,ai_block:1,drawing:he,slide:he,post:he},ye={quote:fe,code:fe,bookmark:fe,external_object_instance:fe,file:void 0,video:fe,embed:fe,tweet:fe,audio:fe,drive:fe,gist:fe,maps:fe,framer:fe,invision:fe,figma:fe,loom:fe,typeform:fe,codepen:fe,equation:fe,pdf:fe,header:"2em",sub_header:"1.4em",sub_sub_header:"1em",image:fe,page:void 0,personal_home_page:void 0,collection_view:void 0,collection_view_page:void 0,form:void 0,column_list:void 0,column:void 0,breadcrumb:void 0,text:void 0,bulleted_list:void 0,numbered_list:void 0,to_do:void 0,toggle:void 0,factory:void 0,copy_indicator:void 0,divider:void 0,link_to_collection:void 0,link_to_page:void 0,alias:void 0,transclusion_container:1,transclusion_reference:1,callout:fe,table_of_contents:fe,whimsical:fe,miro:fe,abstract:fe,mixpanel:fe,sketch:fe,excalidraw:fe,replit:fe,table:1,table_row:void 0,tab:fe,hex:fe,deepnote:fe,external_object_instance_page:fe,button:void 0,ai_block:1,drawing:fe,slide:fe,post:fe},be={left:"flex-start",center:"center",right:"flex-end"};class _e extends w.Z{constructor(){super(...arguments),this.legacyTransclusionTimeout=void 0,this.blockRef=o.createRef(),this.storeTypes={blockResizerStore:X.Z},this.renderPreventSidebar=()=>{const{isInlineCollectionView:e}=this.renderStateStore.state;return e?this.renderSelectable():(0,z.Z)(this.renderSelectable)},this.renderSelectable=e=>{const{store:t,canEditList:n,isFirstItem:o,isLastItem:r}=this.props,{canDropOnto:i,canDropLeftRight:a,shouldShowParentHalo:s,showHoverMenu:l,canDrag:c,canSelect:d,shouldShowSelectionHalo:u,isSimpleTable:p,shouldShowCommentMenu:m,preventBackgroundDrag:g,disableForceTouch:f,canTriggerContextMenu:h}=this.renderStateStore.state;return(0,me.jsx)(ue.Z,{style:this.getStyleStore.state,store:t,canSelect:d,canEditText:this.canEdit(),shouldShowHalo:u,shouldShowParentHalo:s,canDrag:c,canDropAbove:n&&o,canDropBelow:n,canDropLeft:a,canDropRight:a,canDropOnto:n&&i,isLastItem:r,canNativeDropAbove:n&&o,canNativeDropBelow:n,canNativeDropLeft:a,canNativeDropRight:a,onSelectableDrop:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleDrop,onNativeDrop:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleNativeDrop,canTriggerContextMenu:h,onInsertBelow:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleInsertBelow,onInsertAbove:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleInsertAbove,canInsertAbove:n,canInsertBelow:n,onEditText:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleEditText,onEnter:this.handleEnter,onRemove:this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleRemove,showBlockMenuInput:!0,shouldShowSuggestRemoveHalo:!0,shouldShowSuggestInsertBorder:!0,shouldShowHoverMenu:l,disableForceTouch:f,shouldShowCommentMenu:m,shouldShowDropZone:!p,isListContainer:!0,preventBackgroundDrag:g,analyticsName:"page_content",...e,ignoreForTocSelectionIntersection:"table"===t.getType(),children:this.renderBlock()})},this.handleEnter=e=>{this.blockRef.current&&this.blockRef.current.edit?this.blockRef.current.edit():m.Bm({environment:this.environment,targetStore:this.props.store,targetParentStore:this.props.listStore,isAtStartOfLine:!1,isClick:!1,transaction:e.transaction})},this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleDrop=e=>{!function(e,t,n,o){const{droppedDirection:r,droppedStores:i,duplicate:a}=e;if((0,U.iG)(n,i))return void R.oV({label:(0,U.s8)(n)});g.createAndCommit({userAction:"ListItemBlock.handleDrop",environment:o,perform:e=>{m.LQ({environment:o,targetParentStore:t,targetStore:n,droppedDirection:r,droppedStores:i,duplicate:a,transaction:e})}})}(e,this.props.listStore,this.props.store,this.environment)},this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleNativeDrop=e=>{!function(e,t,n,o){const{files:r,droppedDirection:i}=e;g.createAndCommit({userAction:"ListItemBlock.handleNativeDrop",environment:o,perform:e=>m.uQ({environment:o,files:r,targetParentStore:t,targetStore:n,droppedDirection:i,transaction:e})})}(e,this.props.listStore,this.props.store,this.environment)},this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleInsertBelow=e=>function(e,t,n){const{insertStores:o,transaction:r}=e;return d.d9(o).reverse().map((e=>A.BE({parentStore:t,insertStore:e,afterStore:n,transaction:r}).childStore))}(e,this.props.listStore,this.props.store),this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleInsertAbove=e=>function(e,t,n){const{insertStores:o,transaction:r}=e;return d.d9(o).reverse().map((e=>A.Vt({parentStore:t,insertStore:e,beforeStore:n,transaction:r}).childStore))}(e,this.props.listStore,this.props.store),this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleEditText=e=>{!function(e,t,n,o){m.DC({environment:o,targetStore:t,targetParentStore:n,isAtStartOfLine:e.isAtStartOfLine,isAtStartOfContainer:e.isAtStartOfContainer,isClick:e.isClick,transaction:e.transaction})}(e,this.props.store,this.props.listStore,this.environment)},this.CLASS_COMPONENT_CONVERSION_DO_NOT_TOUCH_handleRemove=e=>{!function(e,t,n){const{transaction:o}=e,r=t.getRecordStoreUIParent();r&&(r.table!==c.iU&&r.table!==T.bx&&r.table!==C.Xj||!r.valueIs(oe.i)||(D.uO(n,"user_flow_delete_block",o,"ListItemBlock.handleRemove"),A.Od({parentStore:r,childToRemoveStore:t,transaction:o})))}(e,this.props.store,this.environment)},this.legacyTransclusionParentStore=this.createComputedStore((()=>{if(!this.isPhantomSyncedBlockStore.state)return;const e=this.props.listStore.getRecordStoreAtRootPath();return(0,q.OY)(e)?e:void 0})),this.isPageFullWidthStore=this.createComputedStore((()=>{var e;return null===(e=this.pageContext)||void 0===e?void 0:e.pageStore.isFullWidth()})),this.canEditStore=this.createComputedStore((()=>{const e=this.pageContext&&this.pageContext.publicEditModeStore.state;return!this.props.disabled&&(!(0,h.YF)(e)&&this.props.store.canEdit())})),this.isPhantomSyncedBlockStore=this.createComputedStore((()=>{const e=this.props.store.getParentId();return Boolean(e&&this.props.listStore.id!==e)})),this.isQuasiAliveBlockStore=this.createComputedStore((()=>Boolean(!this.props.store.getAlive()))),this.isReadOnlyBlockInReadWritePageStore=this.createComputedStore((()=>{const e=this.pageContext&&this.pageContext.publicEditModeStore.state;return this.props.canEditList&&!V.OOI({environment:this.environment,blocks:[this.props.store],publicEditMode:e})})),this.editorModeStore=this.createComputedStore((()=>v.Z.getMode(this.props.store))),this.editorWidthStore=this.createComputedStore((()=>te.Z.getEditorWidth())),this.disableEditForUnsupportedBlockInSuggestModeStore=this.createComputedStore((()=>{const e=this.props.store;if("suggest"===v.Z.getMode(e)){const t=e.getType();return!t||!l.BA[t]}return!1})),this.renderStateStore=this.createComputedStore((()=>{const{device:e}=this.environment,{isFirstItem:t,isInsideMarginCollapseContainer:n,store:o,canEditList:r,disableSelection:i,disableHoverMenu:a,disableCommentMenu:s}=this.props,d=o.getFormat(),u=o.getType(),{dragging:p,temporaryFullWidth:m}=this.stores.blockResizerStore.state,g=(0,se.h)(this.props.store),f=p?m:d.block_full_width,v=u===l.Ti.page||u===l.Ti.collectionViewPage||d.alias_pointer&&(0,I.$O)(d.alias_pointer,c.iU)||u&&(0,G._A)(u,d)&&!ie.Z.isOpen(o.id),b=Boolean(u&&(0,l.dM)(u)),_=u===l.Ti.table,S=u===l.Ti.columnList,k=g===le.DZ,w=t&&n&&o.isType(l.D1),x=k,C=ke(this.props.store),T=this.props.store.getParentStore(),M="block"===(null==T?void 0:T.table)&&T.isType(l.Ti.toggle),P=(C||M)&&!S&&!_&&r&&!e.isPhone,A=this.pageContext&&this.pageContext.publicEditModeStore.state,R=(0,h.BZ)(A),D=k&&o.getCollectionStore();let B=k;if(D){void 0===D.getKeyStore("version").getValue()&&(B=!1)}const F=!i&&o.canRead()&&!_&&!B&&(!this.isReadOnlyBlockInReadWritePageStore.state||"suggest"===this.editorModeStore.state),Z=!R&&F&&!k&&!_,U=Z,V="on"===y.default.getEligibleGroup({experimentId:"right_gutter_comment_action",defaultGroup:"control",disableExposureLogging:!0}),N=(u===l.Ti.transclusionContainer||u===l.Ti.transclusionReference||u===l.Ti.aiBlock)&&function(e){return re.default.state.stores.some((t=>t!==e&&e.uiContains(t)))}(this.props.store),O=!(R||a||S||k||_||N),L=V&&o.canComment()&&!a,j=("comment_only"===o.getRole()||"comment"===(null==A?void 0:A.permission))&&!r,K=!s&&!b&&!S&&!_&&this.environment.currentUser.isLoggedIn()&&(L||j)&&(0,E.c_)({blocks:[o]}),z=_?J.Xp({simpleTableStore:o,environment:this.environment,includeInline:!this.marginCommentsVisibleStore.state}):0;return{type:u,isFullWidth:f,canDropOnto:v,canDropLeftRight:P,shouldShowParentHalo:U,showHoverMenu:O,canDrag:r&&!S&&!this.props.disableDrag,canSelect:F,shouldShowSelectionHalo:Z,shouldShowCommentMenu:K,numSimpleTableComments:z,isInlineCollectionView:k,isSimpleTable:_,shouldCollapseTopMargin:w,isInPeekRenderer:Boolean(this.props.store.findRecordStoreUIAncestor((e=>e===ne.default.peekTargetStore.state)).ancestor),isMediaWithoutSource:u&&(0,l.OY)(u)&&!o.getProperties().source,preventBackgroundDrag:x,disableForceTouch:"drawing"===u&&(0,H.iZ)(o),alignStyle:d.block_alignment,canTriggerContextMenu:!(0,l.XD)(u,d)&&r&&!S&&!o.inMemoryRecordCache.isSyntheticAssistantData}}),{useDeepEqual:!0,debugName:"renderStateStore"}),this.blockRendererStore=this.createComputedStore((()=>(0,se.h)(this.props.store))),this.appRenderStore=this.createComputedStore((()=>N.h1(this.environment))),this.getStyleStore=this.createComputedStore((()=>{const{device:e}=this.environment,{store:t}=this.props,{type:n,isInPeekRenderer:o,isFullWidth:r,isInlineCollectionView:i,isSimpleTable:a,shouldCollapseTopMargin:s,numSimpleTableComments:c,isMediaWithoutSource:d,alignStyle:u}=this.renderStateStore.state,p={};if(this.externalObjectStateStore.state){"image/*"!==this.externalObjectStateStore.state&&(p.width="100%")}else p.width="100%";if(p.maxWidth=this.getFullWidth(),(e.isMobile&&!r||this.isInColumnList()||!ke(this.props.store))&&(p.maxWidth="100%"),u&&!r&&!e.isPhone&&be[u]?p.alignSelf=be[u]:ke(this.props.store)&&n&&l.ib[n]?p.alignSelf="center":n&&l.Ok[n]&&(p.alignSelf="flex-start"),p.marginTop=this.props.isFirstItem?2:1,p.marginBottom=this.props.isLastItem?0:1,d?p.marginTop=fe:n&&ye[n]&&(p.marginTop=ye[n]),d&&!this.props.isLastItem?p.marginBottom=he:!this.props.isLastItem&&n&&ve[n]&&(p.marginBottom=ve[n]),a&&0===c&&(ke(this.props.store)||e.isPhone)){const e=this.getFullWidth();p.maxWidth=o?`calc(100vw - ${2*ne.PeekModeOuterPadding-ee.Z.state}px)`:(0,B.Ks)(t)&&!this.isPageFullWidthStore.state?K.zL:e,p.width=(0,B.Ks)(t)&&!this.isPageFullWidthStore.state?K.zL:e,p.alignSelf="center"}return s&&(p.marginTop=0),ke(this.props.store)&&this.marginCommentsVisibleStore.state&&i&&(p.zIndex=1),(0,j.aX)()&&this.isPhantomSyncedBlockStore.state&&(p.border="3px dashed deeppink"),(0,j.hF)()&&this.isQuasiAliveBlockStore.state&&(p.outline="3px dashed deepSkyBlue"),p})),this.externalObjectStateStore=this.createComputedStore((()=>{if(this.props.store.isExternalObjectInstanceBlockStore()){var e;const t=(0,L._l)({store:this.props.store,canEdit:this.canEdit(),currentUserId:this.environment.currentUser.id,isInDarkMode:"dark"===this.environment.ThemeStore.state.mode,showAction:void 0});return(null==t?void 0:t.renderConfig.previewAttributes)&&(null===(e=t.renderConfig.previewAttributes[0])||void 0===e?void 0:e.mimeType)}}),{useDeepEqual:!0}),this.marginCommentsVisibleStore=this.createComputedStore((()=>(0,F.fg)(this.environment,this.props.store))),this.sidePeekWidthStore=this.createComputedStore((()=>(0,Q.vJ)(this.environment)))}UNSAFE_willMount(e){super.UNSAFE_willMount(e),this.isCopyIndicatorWithoutPendingTransaction=(0,N.hq)(e.store)}didMount(){this.isPhantomSyncedBlockStore.state&&(this.legacyTransclusionTimeout=window.setTimeout((()=>{this.legacyTransclusionTimeout=void 0,this.isPhantomSyncedBlockStore.state&&(P.vk(this.environment,{block_type:this.props.store.getType()}),(0,x.XY)("Found a potential legacy transclusion--a block's parent is not its rendered parent!",[["block",this.props.store],["block parent id = ",this.props.store.getParentId()],["rendered parent id = ",this.props.listStore.id]]))}),ge))}willUnmount(){"number"==typeof this.legacyTransclusionTimeout&&(window.clearTimeout(this.legacyTransclusionTimeout),this.legacyTransclusionTimeout=void 0)}renderComponent(){if(!this.isCopyIndicatorWithoutPendingTransaction||this.renderStateStore.state.type!==l.Ti.copyIndicator)return function(e,t,n){const o=n.state.type;return!!o&&(Boolean(l.Ok[o])||t.isType("column_list")&&(0,O.Po)(t,e)||t.isType("external_object_instance"))}(this.environment,this.props.store,this.renderStateStore)?(0,me.jsx)(ce.Z,{isVisible:!0,animationStyle:this.getResizeAnimationStyle(),render:()=>this.renderPreventSidebar()}):this.renderPreventSidebar()}renderBlock(){const{renderItem:e,disabled:t,store:n,disableHoverMenu:o,disableDrag:r,disableCommentMenu:i,numberedListCounterStore:a,bulletedListFormatStore:s}=this.props,l=this.blockRendererStore.state;return!f.Pj(n)&&y.default.checkGate({gateName:"hide_orphan_blocks"})?null:e?e(n):l?(0,me.jsx)(l,{ref:this.blockRef,store:this.props.store,disabled:t||this.disableEditForUnsupportedBlockInSuggestModeStore.state,isFirstItem:this.props.isFirstItem,isLastItem:this.props.isLastItem,blockResizerStore:this.stores.blockResizerStore,disableCommentMenu:i,numberedListCounterStore:a,bulletedListFormatStore:s,disableHoverMenu:o,disableDrag:r,legacyTransclusionParentStore:this.legacyTransclusionParentStore.state,fullWidth:this.getFullWidth()}):void 0}isInColumnList(){return this.context.isInColumnList}canEdit(){return this.canEditStore.state}getResizeAnimationStyle(){const{type:e}=this.renderStateStore.state;if(e&&(0,de.x)({environment:this.environment,type:e}))return{width:"100%"};const{dragging:t,temporaryWidth:n,temporaryFullWidth:o,temporaryPageWidth:r}=this.stores.blockResizerStore.state,{block_width:i,block_full_width:a,block_page_width:s}=this.props.store.getFormat(),l=t?n:i,c=t?r:s;return{width:(t?o:a)?this.getFullWidth():c?"100%":l}}getFullWidth(){const{device:e}=this.environment,{isInPeekRenderer:t}=this.renderStateStore.state,n=this.environment.WindowSizeStore.state.width,o=(0,Q.ll)(this.environment,t)-this.sidePeekWidthStore.state,r=n-ee.Z.state-o;if(i=this.props.store,Boolean(i.inMemoryRecordCache.snapshotData)&&!e.isPhone)return n*(pe.rp/100)-pe.mD-ee.Z.state;if(!Y.Z.isBlockInTemplate(this.props.store)||this.isInColumnList()||e.isPhone){if($.Z.state.isOpen&&"site-settings-editor"===$.Z.state.mode&&this.editorWidthStore.state){const e=we(this.environment,this.props.store,this.renderStateStore)?2*(0,N.ui)(this.environment):0;return this.editorWidthStore.state+e}if(this.isInColumnList()||!ke(this.props.store))return"100%";if(t){const e=(0,W.rb)();return ne.default.getPeekModeWidth(n)-ee.Z.state-e}if((0,Q.Jr)(this.environment)){let n=r;const{state:{shouldShowSidebar:o}}=this.appRenderStore;return e.isMobile&&!e.isTablet||!o||(n-=(0,Q.Wk)(this.environment)),!this.renderStateStore.state.isInlineCollectionView&&this.marginCommentsVisibleStore.state&&(this.isPageFullWidthStore.state?n-=F.QB:n-=2*(0,F.gC)(this.environment,t,(0,B.Ks)(this.props.store))),we(this.environment,this.props.store,this.renderStateStore)||(n-=2*(0,N.ui)(this.environment)),n}return r}return n*(ae.E2/100)-ae.dm-ee.Z.state;var i}}_e.displayName="ListItemBlock",_e.contextTypes={...w.w,...Z.Ht};const Se=_e;function ke(e){return e.isRootOrDirectChild()}function we(e,t,n){const o=n.state.type;return!!o&&(l.GP[o]||t.isType("column_list")&&(0,O.Po)(t,e)&&t.getFormat().block_full_width)}var xe=n(118466),Ie=n(926249),Ce=n(38689);M.C0;const Te=4,Me=4,Pe={quote:Me,code:Me,header:Me,bookmark:Me,external_object_instance:Me,file:void 0,video:Me,embed:Me,tweet:Me,drive:Me,audio:Me,gist:Me,maps:Me,framer:Me,invision:Me,figma:Me,loom:Me,typeform:Me,mixpanel:Me,codepen:Me,equation:Me,pdf:Me,image:Me,sub_header:void 0,sub_sub_header:void 0,page:void 0,collection_view:void 0,collection_view_page:void 0,form:void 0,column_list:void 0,column:void 0,personal_home_page:void 0,breadcrumb:void 0,text:void 0,bulleted_list:void 0,numbered_list:void 0,to_do:void 0,toggle:void 0,factory:void 0,copy_indicator:void 0,divider:void 0,link_to_collection:void 0,link_to_page:void 0,alias:void 0,transclusion_container:1,transclusion_reference:1,callout:Me,table_of_contents:Me,whimsical:Me,miro:Me,abstract:Me,sketch:Me,excalidraw:Me,replit:Me,hex:Me,deepnote:Me,table:1,table_row:void 0,tab:Me,external_object_instance_page:Me,button:void 0,ai_block:1,drawing:Me,slide:Me,post:Me},Ae={quote:Te,code:Te,bookmark:Te,external_object_instance:Te,file:void 0,video:Te,embed:Te,tweet:Te,audio:Te,drive:Te,gist:Te,maps:Te,framer:Te,invision:Te,figma:Te,loom:Te,typeform:Te,codepen:Te,equation:Te,pdf:Te,header:"2em",sub_header:"1.4em",sub_sub_header:"1em",image:Te,page:void 0,personal_home_page:void 0,collection_view:void 0,collection_view_page:void 0,form:void 0,column_list:void 0,column:void 0,breadcrumb:void 0,text:void 0,bulleted_list:void 0,numbered_list:void 0,to_do:void 0,toggle:void 0,factory:void 0,copy_indicator:void 0,divider:void 0,link_to_collection:void 0,link_to_page:void 0,alias:void 0,transclusion_container:1,transclusion_reference:1,callout:Te,table_of_contents:Te,whimsical:Te,miro:Te,abstract:Te,mixpanel:Te,sketch:Te,excalidraw:Te,replit:Te,table:1,table_row:void 0,tab:Te,hex:Te,deepnote:Te,external_object_instance_page:Te,button:void 0,ai_block:1,drawing:Te,slide:Te,post:Te},Re={left:"flex-start",center:"center",right:"flex-end"};function De(e){const t=(0,i.O7)(),n=(0,a.l)(),r=(0,o.useContext)(Z.fC.context),u=(0,o.useRef)(),[p]=(0,o.useState)((()=>xe.Z.withListenerIgnored((()=>N.hq(e.store))))),b=(0,s.qz)(void 0,X.Z),_=(0,s.VK)((()=>{const t=e.store.getParentId();return Boolean(t&&e.listStore.id!==t)}),[e.listStore.id,e.store]),S=(0,s.VK)((()=>Boolean(!e.store.getAlive())),[e.store]),k=(0,s.VK)((()=>{if(!_)return;const t=e.listStore.getRecordStoreAtRootPath();return(0,q.OY)(t)?t:void 0}),[_,e.listStore]),w=(0,s.VK)((()=>null==n?void 0:n.pageStore.isFullWidth()),[null==n?void 0:n.pageStore]),x=(0,s.VK)((()=>{const t=n&&n.publicEditModeStore.state;return!e.disabled&&(!(0,h.YF)(t)&&e.store.canEdit())}),[n,e.disabled,e.store]),M=(0,s.VK)((()=>{const o=n&&n.publicEditModeStore.state;return e.canEditList&&!V.OOI({environment:t,blocks:[e.store],publicEditMode:o})}),[t,n,e.canEditList,e.store]),P=(0,s.VK)((()=>v.Z.getMode(e.store)),[e.store]),K=(0,s.VK)((()=>te.Z.getEditorWidth()),[]),ge=(0,s.VK)((()=>{const t=e.store;if("suggest"===v.Z.getMode(t)){const e=t.getType();return!e||!l.BA[e]}return!1}),[e.store]),fe=(0,s.VK)((()=>(0,F.fg)(t,e.store)),[t,e.store]),he=(0,s.VK)((()=>{const{device:o}=t,{isFirstItem:r,isInsideMarginCollapseContainer:i,store:a,canEditList:s,disableSelection:d,disableHoverMenu:u,disableCommentMenu:p}=e,m=a.getFormat(),g=a.getType(),{dragging:f,temporaryFullWidth:v}=b.state,_=(0,se.h)(e.store),S=f?v:m.block_full_width,k=g===l.Ti.page||g===l.Ti.collectionViewPage||m.alias_pointer&&(0,I.$O)(m.alias_pointer,c.iU)||g&&(0,G._A)(g,m)&&!ie.Z.isOpen(a.id),w=Boolean(g&&(0,l.dM)(g)),x=g===l.Ti.table,C=g===l.Ti.columnList,T=_===le.DZ,A=r&&i&&a.isType(l.D1),R=T,D=Ee(e.store),B=e.store.getParentStore(),F="block"===(null==B?void 0:B.table)&&B.isType(l.Ti.toggle),Z=(D||F)&&!C&&!x&&s&&!o.isPhone,U=n&&n.publicEditModeStore.state,V=(0,h.BZ)(U),N=T&&a.getCollectionStore();let O=T;if(N){void 0===N.getKeyStore("version").getValue()&&(O=!1)}const L=!d&&a.canRead()&&!x&&!O&&(!M||"suggest"===P),j=!V&&L&&!T&&!x,K=j,z="on"===y.default.getEligibleGroup({experimentId:"right_gutter_comment_action",defaultGroup:"control",disableExposureLogging:!0}),q=y.default.checkGate({gateName:"hide_orphan_blocks"}),W=(g===l.Ti.transclusionContainer||g===l.Ti.transclusionReference||g===l.Ti.aiBlock)&&function(e){return re.default.state.stores.some((t=>t!==e&&e.uiContains(t)))}(e.store),$=!(V||u||C||T||x||W),Y=z&&a.canComment()&&!u,Q=("comment_only"===a.getRole()||"comment"===(null==U?void 0:U.permission))&&!s,X=!p&&!w&&!C&&!x&&t.currentUser.isLoggedIn()&&(Y||Q)&&(0,E.c_)({blocks:[a]}),ee=x?J.Xp({simpleTableStore:a,environment:t,includeInline:!fe}):0;return{type:g,isFullWidth:S,canDropOnto:k,canDropLeftRight:Z,shouldShowParentHalo:K,showHoverMenu:$,canDrag:s&&!C&&!e.disableDrag,canSelect:L,shouldShowSelectionHalo:j,shouldShowCommentMenu:X,numSimpleTableComments:ee,isInlineCollectionView:T,isSimpleTable:x,shouldCollapseTopMargin:A,isInPeekRenderer:Boolean(e.store.findRecordStoreUIAncestor((e=>e===ne.default.peekTargetStore.state)).ancestor),isMediaWithoutSource:g&&(0,l.OY)(g)&&!a.getProperties().source,preventBackgroundDrag:R,disableForceTouch:"drawing"===g&&(0,H.iZ)(a),alignStyle:m.block_alignment,canTriggerContextMenu:!(0,l.XD)(g,m)&&s&&!C&&!a.inMemoryRecordCache.isSyntheticAssistantData,canHideOrphanedBlocks:q}}),[b,P,t,M,fe,n,e],{useDeepEqual:!0,debugName:"renderStateStore"}),ve=(0,s.VK)((()=>(0,se.h)(e.store)),[e.store]),ye=(0,s.VK)((()=>N.h1(t)),[t]),be=(0,s.VK)((()=>{if(e.store.isExternalObjectInstanceBlockStore()){var n;const o=(0,L._l)({store:e.store,canEdit:x,currentUserId:t.currentUser.id,isInDarkMode:"dark"===t.ThemeStore.state.mode,showAction:void 0});return(null==o?void 0:o.renderConfig.previewAttributes)&&(null===(n=o.renderConfig.previewAttributes[0])||void 0===n?void 0:n.mimeType)}}),[x,t.ThemeStore,t.currentUser.id,e.store],{useDeepEqual:!0}),_e=(0,s.VK)((()=>(0,Q.vJ)(t)),[t]),Se=(0,s.VK)((()=>{const{device:n}=t,{isInPeekRenderer:o}=he,i=t.WindowSizeStore.state.width,a=(0,Q.ll)(t,o)-_e,s=i-ee.Z.state-a;if(l=e.store,Boolean(l.inMemoryRecordCache.snapshotData)&&!n.isPhone)return i*(pe.rp/100)-pe.mD-ee.Z.state;if(!Y.Z.isBlockInTemplate(e.store)||r||n.isPhone){if($.Z.state.isOpen&&"site-settings-editor"===$.Z.state.mode&&K){const n=Fe(t,e.store,he)?2*N.ui(t):0;return K+n}if(r||!Ee(e.store))return"100%";if(o){const e=(0,W.rb)();return ne.default.getPeekModeWidth(i)-ee.Z.state-e}if((0,Q.Jr)(t)){let r=s;const{shouldShowSidebar:i}=ye;return n.isMobile&&!n.isTablet||!i||(r-=(0,Q.Wk)(t)),!he.isInlineCollectionView&&fe&&(r-=w?F.QB:2*(0,F.gC)(t,o,(0,B.Ks)(e.store))),Fe(t,e.store,he)||(r-=2*N.ui(t)),r}return s}return i*(ae.E2/100)-ae.dm-ee.Z.state;var l}),[ye,K,t,r,w,fe,e.store,he,_e]),ke=(0,s.VK)((()=>{const{type:n}=he;if(n&&(0,de.x)({environment:t,type:n}))return{width:"100%"};const{dragging:o,temporaryWidth:r,temporaryFullWidth:i,temporaryPageWidth:a}=b.state,{block_width:s,block_full_width:l,block_page_width:c}=e.store.getFormat();return{width:(o?i:l)?Se:(o?a:c)?"100%":o?r:s}}),[b,t,Se,e.store,he]),we=(0,s.VK)((()=>{const{device:n}=t,{store:o}=e,{type:i,isInPeekRenderer:a,isFullWidth:s,isInlineCollectionView:c,isSimpleTable:d,shouldCollapseTopMargin:u,numSimpleTableComments:p,isMediaWithoutSource:m,alignStyle:g}=he,f={};if(be){"image/*"!==be&&(f.width="100%")}else f.width="100%";if(f.maxWidth=Se,(n.isMobile&&!s||r||!Ee(e.store))&&(f.maxWidth="100%"),g&&!s&&!n.isPhone&&Re[g]?f.alignSelf=Re[g]:Ee(e.store)&&i&&l.ib[i]?f.alignSelf="center":i&&l.Ok[i]&&(f.alignSelf="flex-start"),f.marginTop=e.isFirstItem?2:1,f.marginBottom=e.isLastItem?0:1,m?f.marginTop=Te:i&&Ae[i]&&(f.marginTop=Ae[i]),m&&!e.isLastItem?f.marginBottom=Me:!e.isLastItem&&i&&Pe[i]&&(f.marginBottom=Pe[i]),d&&0===p&&(Ee(e.store)||n.isPhone)){const e=Se;f.maxWidth=a?`calc(100vw - ${2*ne.PeekModeOuterPadding-ee.Z.state}px)`:(0,B.Ks)(o)&&!w?Ce.z:e,f.width=(0,B.Ks)(o)&&!w?Ce.z:e,f.alignSelf="center"}return u&&(f.marginTop=0),Ee(e.store)&&fe&&c&&(f.zIndex=1),(0,j.aX)()&&_&&(f.border="3px dashed deeppink"),(0,j.hF)()&&S&&(f.outline="3px dashed deepSkyBlue"),f}),[t,be,Se,r,_,S,w,fe,e,he]),Ie=(0,s.VK)((()=>function(e,t,n){const o=n.type;return!!o&&(Boolean(l.Ok[o])||t.isType("column_list")&&(0,O.Po)(t,e)||t.isType("external_object_instance"))}(t,e.store,he)),[t,e.store,he]),De=(0,s.VK)((()=>e.store.getType()),[e.store]),Be=(0,s.VK)((()=>f.Pj(e.store)),[e.store]),Ze=(0,o.useCallback)((n=>{u.current&&u.current.edit?u.current.edit():m.Bm({environment:t,targetStore:e.store,targetParentStore:e.listStore,isAtStartOfLine:!1,isClick:!1,transaction:n.transaction})}),[u,t,e.listStore,e.store]),Ue=(0,o.useCallback)((n=>{const{droppedDirection:o,droppedStores:r,duplicate:i}=n;(0,U.iG)(e.store,r)?R.oV({label:(0,U.s8)(e.store)}):g.createAndCommit({userAction:"ListItemBlock.handleDrop",environment:t,perform:n=>{m.LQ({environment:t,targetParentStore:e.listStore,targetStore:e.store,droppedDirection:o,droppedStores:r,duplicate:i,transaction:n})}})}),[t,e.listStore,e.store]),Ve=(0,o.useCallback)((n=>{const{files:o,droppedDirection:r}=n;g.createAndCommit({userAction:"ListItemBlock.handleNativeDrop",environment:t,perform:n=>m.uQ({environment:t,files:o,targetParentStore:e.listStore,targetStore:e.store,droppedDirection:r,transaction:n})})}),[t,e.listStore,e.store]),Ne=(0,o.useCallback)((t=>{const{insertStores:n,transaction:o}=t;return d.d9(n).reverse().map((t=>A.BE({parentStore:e.listStore,insertStore:t,afterStore:e.store,transaction:o}).childStore))}),[e.listStore,e.store]),Oe=(0,o.useCallback)((t=>{const{insertStores:n,transaction:o}=t;return d.d9(n).reverse().map((t=>A.Vt({parentStore:e.listStore,insertStore:t,beforeStore:e.store,transaction:o}).childStore))}),[e.listStore,e.store]),Le=(0,o.useCallback)((n=>{m.DC({environment:t,targetStore:e.store,targetParentStore:e.listStore,isAtStartOfLine:n.isAtStartOfLine,isAtStartOfContainer:n.isAtStartOfContainer,isClick:n.isClick,transaction:n.transaction})}),[t,e.listStore,e.store]),je=(0,o.useCallback)((n=>{{const{transaction:o}=n,r=e.store.getRecordStoreUIParent();r&&(r.table!==c.iU&&r.table!==T.bx&&r.table!==C.Xj||!r.valueIs(oe.i)||(D.uO(t,"user_flow_delete_block",o,"ListItemBlock.handleRemove"),A.Od({parentStore:r,childToRemoveStore:e.store,transaction:o})))}}),[t,e.store]),Ke=()=>{const{isInlineCollectionView:e}=he;return e?ze():(0,z.Z)(ze)},ze=t=>{const{store:n,canEditList:o,isFirstItem:r,isLastItem:i}=e,{canDropOnto:a,canDropLeftRight:s,shouldShowParentHalo:l,showHoverMenu:c,canDrag:d,canSelect:u,shouldShowSelectionHalo:p,isSimpleTable:m,shouldShowCommentMenu:g,preventBackgroundDrag:f,disableForceTouch:h,canTriggerContextMenu:v}=he;return(0,me.jsx)(ue.Z,{style:we,store:n,canSelect:u,canEditText:x,shouldShowHalo:p,shouldShowParentHalo:l,canDrag:d,canDropAbove:o&&r,canDropBelow:o,canDropLeft:s,canDropRight:s,canDropOnto:o&&a,isLastItem:i,canNativeDropAbove:o&&r,canNativeDropBelow:o,canNativeDropLeft:s,canNativeDropRight:s,onSelectableDrop:Ue,onNativeDrop:Ve,canTriggerContextMenu:v,onInsertBelow:Ne,onInsertAbove:Oe,canInsertAbove:o,canInsertBelow:o,onEditText:Le,onEnter:Ze,onRemove:je,showBlockMenuInput:!0,shouldShowSuggestRemoveHalo:!0,shouldShowSuggestInsertBorder:!0,shouldShowHoverMenu:c,disableForceTouch:h,shouldShowCommentMenu:g,shouldShowDropZone:!m,isListContainer:!0,preventBackgroundDrag:f,analyticsName:"page_content",...t,ignoreForTocSelectionIntersection:"table"===De,children:qe()})},qe=()=>{const{renderItem:t,disabled:n,store:o,disableHoverMenu:r,disableDrag:i,disableCommentMenu:a,numberedListCounterStore:s,bulletedListFormatStore:l}=e,c=ve;return!Be&&he.canHideOrphanedBlocks?null:t?t(o):c?(0,me.jsx)(c,{ref:u,store:e.store,disabled:n||ge,isFirstItem:e.isFirstItem,isLastItem:e.isLastItem,blockResizerStore:b,disableCommentMenu:a,numberedListCounterStore:s,bulletedListFormatStore:l,disableHoverMenu:r,disableDrag:i,legacyTransclusionParentStore:k,fullWidth:Se}):void 0};return p&&he.type===l.Ti.copyIndicator?null:Ie?(0,me.jsx)(ce.Z,{isVisible:!0,animationStyle:ke,render:()=>Ke()}):Ke()}const Be=o.memo(De,Ie.Z);function Ee(e){return e.isRootOrDirectChild()}function Fe(e,t,n){const o=n.type;return!!o&&(l.GP[o]||t.isType("column_list")&&(0,O.Po)(t,e)&&t.getFormat().block_full_width)}const Ze="emptyDroppableKey",Ue="placeholder";const Ve=function(e){const t=(0,o.useContext)(r.ep),n=(0,s.VK)((()=>null==t?void 0:t.state),[t]),w=(0,i.O7)(),x=(0,a.l)(),I=(0,s.VK)((()=>{if(e.disabled)return!1;if(S.n.state)return!1;const t=(0,f.n3)(e.store)&&x&&x.publicEditModeStore.state;return!(0,h.YF)(t)&&e.store.canEdit()}),[x,e.disabled,e.store]),C=(0,s.VK)((()=>!e.disabled&&(!S.n.state&&Boolean(e.store.isCommentOnly()&&(null==x?void 0:x.pageStore)&&"suggest"===v.Z.getMode(null==x?void 0:x.pageStore)))),[e.store,null==x?void 0:x.pageStore,e.disabled]),T=(0,s.VK)((()=>{const t=Ne(e.store.id,e.store);return(0,l.nY)(t.getType(),t.getFormat())}),[e.store]),M=(0,s.VK)((()=>y.default.checkGate({gateName:"docs_function_list_item_block2"})),[]),P=(t,n,r)=>{if(t===Ze)return(0,me.jsx)(o.Fragment,{children:A()},t);if(t===Ue)return(0,me.jsx)(o.Fragment,{children:e.emptyPlaceholder},t);{const i=Ne(t,e.store),a=d.qr(r,(e=>(0,u.e)(e)));return(0,me.jsx)(o.Fragment,{children:M?(0,me.jsx)(Be,{store:i,renderItem:e.renderItem,listStore:e.store,isFirstItem:0===n,isInsideMarginCollapseContainer:T,isLastItem:n===a,disabled:e.disabled,disableLayout:e.disableLayout,canEditList:I||C,disableSelection:e.disableSelection,disableHoverMenu:!(!e.disableFirstItemHoverMenu||0!==n)||e.disableHoverMenu,disableCommentMenu:e.disableCommentMenu,disableDrag:e.disableDrag,numberedListCounterStore:B,bulletedListFormatStore:D}):(0,me.jsx)(Se,{store:i,renderItem:e.renderItem,listStore:e.store,isFirstItem:0===n,isInsideMarginCollapseContainer:T,isLastItem:n===a,disabled:e.disabled,disableLayout:e.disableLayout,canEditList:I||C,disableSelection:e.disableSelection,disableHoverMenu:!(!e.disableFirstItemHoverMenu||0!==n)||e.disableHoverMenu,disableCommentMenu:e.disableCommentMenu,disableDrag:e.disableDrag,numberedListCounterStore:B,bulletedListFormatStore:D})},t)}};function A(){const t=_.G.createChildStore(e.store,{table:c.iU,id:e.store.id});return(0,me.jsx)(ue.Z,{store:t,canDropBelow:I,canNativeDropBelow:I,onSelectableDrop:t=>function(e,t,n){const{droppedDirection:o,droppedStores:r,duplicate:i}=e;g.createAndCommit({userAction:"List.handleEmptyDrop",environment:n,perform:e=>{m.LQ({environment:n,targetParentStore:t,targetStore:void 0,droppedDirection:o,droppedStores:r,duplicate:i,transaction:e})}})}(t,e.store,w),onNativeDrop:t=>function(e,t,n){const{files:o,droppedDirection:r}=e;g.createAndCommit({userAction:"List.handleEmptyNativeDrop",environment:n,perform:e=>{m.uQ({environment:n,files:o,targetParentStore:t,targetStore:void 0,droppedDirection:r,transaction:e})}})}(t,e.store,w),style:e.emptyDroppableStyle,analyticsName:"page_content",shouldShowDropZone:!0})}const R=(0,s.VK)((()=>{const t=e.store.getValue()||[];let n=t;const o=function(e){const{limitParents:t}=b.Z.state,n=e.id;let o;return e.findRecordStoreUIAncestor((e=>{const r=t.get(e);return!(!r||!r.hasOwnProperty(n))&&(o=r[n],!0)})),o}(e.store),r=0===t.length;return void 0!==o&&(n=d.tP(n,0,o)),I&&r&&n.push(Ze),I&&r&&e.emptyPlaceholder&&n.push(Ue),n}),[I,e.emptyPlaceholder,e.store]),D=(0,s.SI)((()=>{var t;const n=null===(t=e.bulletedListFormatStore)||void 0===t?void 0:t.getState().depth,o="number"==typeof n?n+1:0,r=new Map;let i;for(const a of R){const t=Ne(a,e.store);i=t.getType()===l.Ti.bulletedList?t.getFormat().bullet_list_format||i:void 0,i&&r.set(a,i)}return{depth:o,blockIdFormats:r}}),[R,e.bulletedListFormatStore,e.store]);(0,s.Kw)(D);const B=(0,s.SI)((()=>{var t;const n=[],o=R.length?R[0]:void 0,r=o?Ne(o,e.store):void 0,i=null==r?void 0:r.getParentId(),a=null===(t=e.numberedListCounterStore)||void 0===t?void 0:t.state.numberedListBlockIdsWithFormat.find((e=>e.id===i)),s=null==a?void 0:a.format;let c=void 0===(null==a?void 0:a.depth)?0:(null==a?void 0:a.depth)+1,d=s,u=0;for(const m of R)if(m!==Ze&&m!==Ue){const t=Ne(m,e.store),o=t.getType(),r=t.getFormat();if(d=(null==r?void 0:r.list_format)??d,o===l.Ti.numberedList){let e=r.list_start_index;(0,p.$K)(e)&&0!==u&&(e=void 0),u=(0,p.$K)(e)?e:u+1,n.push({id:m,format:d,depth:c||0,index:u})}else d=void 0,n.push({id:void 0,format:d,depth:0,index:u}),c=0,u=0}return{depth:c||0,numberedListBlockIdsWithFormat:n}}),[R,e.numberedListCounterStore,e.store]);return(0,s.Kw)(B),e.disableContent?null:(0,me.jsx)(k.Z,{name:"List",children:n?R.reduce(((e,t,o,r)=>(n.indexOf(t)>=0&&e.push(P(t,o,r)),e)),[]):R.map(P)})};function Ne(e,t){return _.G.createChildStore(t,{table:c.iU,id:e})}},78454:(e,t,n)=>{n.d(t,{LK:()=>y,R8:()=>b,ZP:()=>C,v2:()=>c});var o=n(667294),r=n(949271),i=n(619584),a=n(489086),s=n(668709),l=n(785893);let c=function(e){return e[e.Start=0]="Start",e[e.Center=1]="Center",e[e.End=2]="End",e}({});const{Start:d,Center:u,End:p}=c,m=o.forwardRef((function(e,t){return(0,l.jsxs)("div",{onClick:e.onClick,onMouseMove:e.onMouseMove,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onMouseDown:e.onMouseDown,style:S(e),ref:t,children:[e.left&&g(e),e.children&&(0,l.jsx)("div",{style:I(e),children:e.children}),e.right&&f(e)]})}));function g(e){return(0,l.jsx)(s.p,{...(0,a.td)("start"),allowSelectionWithin:!1,style:w(e),children:e.left})}function f(e){return(0,l.jsx)(s.p,{...(0,a.td)("end"),allowSelectionWithin:!1,style:x(e),children:e.right})}const h=4,v=2,y=24,b={...r.ZD,textAlign:"start"},_={[d]:"flex-start",[u]:"center",[p]:"flex-end"};function S(e){return{display:"flex",alignItems:i.z4(e.alignment)?_[c.Start]:_[e.alignment],width:"100%",...e.style}}function k(e){const t={display:"flex",alignItems:"center",justifyContent:"center",flexGrow:0,flexShrink:0};return(e.leftRightMinHeight||i.z4(e.leftRightMinHeight))&&(t.minHeight=`calc(1.5em + ${r.ZD.paddingTop}px + ${r.ZD.paddingTop}px)`),t}function w(e){return{marginRight:v,width:y,...k(e),...e.leftStyle}}function x(e){return{marginLeft:h,...k(e),...e.rightStyle}}function I(e){return{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:1,...e.childrenStyle}}const C=m},140148:(e,t,n)=>{n.d(t,{Lw:()=>c,ZP:()=>d});var o=n(667294),r=n(313991),i=n(706740),a=n(724405),s=n(137810),l=n(785893);const c={fontSize:12,paddingTop:2,paddingBottom:2};function d(e){const[t,n]=(0,o.useState)(!1),{isInComment:c}=e,d=(0,a.yK)((n=>({root:{width:"100%",fontSize:14,fontFamily:s.Z.getCompositeFontFamily(r.locale).sans,color:n.mediumTextColor,borderRadius:4,background:n.embedPlaceholderBackground,position:"relative",...e.style},right:{position:"absolute",top:4,right:4,transition:"opacity 200ms ease-in",opacity:e.shouldHideRight&&!t?0:1},inner:{padding:12,paddingRight:36,display:"flex",alignItems:"center",textAlign:"left",width:"100%",overflow:"hidden",...c?{padding:"8px 10px 10px 8px",paddingRight:10,gap:10}:{}},iconContainer:c?{background:n.tint.regular,height:32,width:32,borderRadius:6,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}:{},icon:{width:25,height:25,flexShrink:0,marginRight:12,fill:n.mediumIconColor,...e.iconStyle},children:c?{color:n.text.secondary}:{}})),[e.style,e.shouldHideRight,e.iconStyle,t,c]);return(0,l.jsxs)("div",{style:d.root,onFocus:e=>{const t=e.target;t instanceof HTMLElement&&(0,i.E)(t)&&n(!0)},onBlur:()=>n(!1),children:[(0,l.jsxs)("div",{style:d.inner,children:[(0,l.jsx)("div",{style:d.iconContainer,children:e.iconSvg(d.icon)}),(0,l.jsx)("div",{style:{...s.Z.textOverflowStyle,...d.children},children:e.children})]}),e.right&&(0,l.jsx)("div",{style:d.right,children:e.right})]})}},365085:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(667294),r=n(724405),i=n(942402),a=n(785893);function s(e){const{children:t,maxLines:n,onMore:i,onLess:s,clampOverride:c}=e,d=(0,o.useRef)(null),u=(0,o.useRef)(null),p=(0,o.useRef)(null),[m,g]=(0,o.useState)(!1),[f,h]=(0,o.useState)(!n),[v,y]=(0,o.useState)(0),[b,_]=(0,o.useState)(0),S=c&&n&&c.fontSize*c.lineHeight*n+.5,k=Boolean(c);(0,o.useEffect)((()=>{if(m){var e;const t=null===(e=u.current)||void 0===e?void 0:e.getClientRects()[0];y((null==t?void 0:t.height)??0),_((null==t?void 0:t.width)??0)}}),[m]);const w=(0,o.useCallback)((()=>{d.current&&g(d.current.scrollHeight>d.current.clientHeight+5)}),[]);(0,o.useEffect)((()=>{!f&&n&&w()}),[f,n,w]),(0,o.useEffect)((()=>{if(p.current){const e=new MutationObserver((()=>{f||w()})),t=new ResizeObserver((()=>{f||w()}));return t.observe(p.current),e.observe(p.current,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),e.disconnect()}}}),[f,w]);const x=(0,o.useCallback)((e=>{i?i(e):(e.preventDefault(),e.stopPropagation(),h(!0))}),[i]),I=(0,o.useCallback)((e=>{s?s(e):(e.preventDefault(),e.stopPropagation(),h(!1))}),[s]),C=(0,o.useMemo)((()=>(0,a.jsx)(l,{style:{position:"absolute",right:0,bottom:0},onClick:x,children:(0,a.jsx)("div",{ref:u,children:e.moreElement})})),[e.moreElement,x]),T=(0,o.useMemo)((()=>(0,a.jsx)(l,{onClick:I,children:e.lessElement})),[e.lessElement,I]),M=(0,r.yK)((e=>({base:{display:"-webkit-box",WebkitBoxOrient:"vertical",...!k&&{WebkitLineClamp:f?void 0:n},...k&&{maxHeight:f?void 0:S}},clamped:{WebkitMaskPosition:"right bottom",WebkitMask:`linear-gradient(0deg,transparent 0,transparent ${v}px,#000 ${v}px),\n\t\t\t\t\t\t\t linear-gradient(270deg,transparent 0,transparent ${b}px,#000 ${2*b}px)`}})),[n,f,v,b,S,k]);return(0,a.jsxs)("div",{style:{position:"relative"},dir:"auto",children:[(0,a.jsxs)("div",{ref:d,style:{...M.base,...m&&!f&&M.clamped,...e.style},children:[(0,a.jsx)("div",{ref:p,children:t}),m&&f&&T]}),m&&!f&&C]})}function l(e){let{onClick:t,style:n,children:o}=e;return(0,a.jsx)(i.Z,{disableUnderline:!0,style:n,onClick:e=>{t(e)},children:o})}},254321:(e,t,n)=>{n.d(t,{Z:()=>k});var o=n(667294),r=n(886628),i=n(724405),a=n(949271),s=n(709291),l=n(926249),c=n(249394),d=n(99340),u=n(523864),p=n(630915),m=n(78454),g=n(222491),f=n(799445),h=n(785893);function v(e){const{rank:t,index:n,listFormat:o}=e;if("numbers"===o)return{index:n,listFormat:o};if("letters"===o)return{index:(0,f.yt)(n),listFormat:o};if("roman"===o)return{index:(0,f.bW)(n),listFormat:o};{const e=t%3;return 0===e?{index:n,listFormat:"numbers"}:1===e?{index:(0,f.yt)(n),listFormat:"letters"}:{index:(0,f.bW)(n),listFormat:"roman"}}}const y=function(e){const t=(0,r.VK)((()=>{if(!e.numberedListCounterStore)return v({rank:0,index:1,listFormat:void 0});const t=e.numberedListCounterStore.state.numberedListBlockIdsWithFormat.find((t=>t.id===e.store.id));return v({rank:(null==t?void 0:t.depth)||0,index:(null==t?void 0:t.index)||0,listFormat:null==t?void 0:t.format})}),[e.numberedListCounterStore,e.store.id]);if("roman"===t.listFormat){const e=t.index;return(0,h.jsx)("span",{...(0,g.iv)({pseudoBefore:{content:`"${e}."`},textAlign:"left",width:(0,f.A8)(e),whiteSpace:"nowrap"})})}{const e=t.index.toString().length;let n=24;return 3===e?n=32:4===e?n=42:e>4&&(n="unset"),(0,h.jsx)("span",{...(0,g.iv)({pseudoBefore:{content:`"${t.index}."`},width:n,textAlign:"center",whiteSpace:"nowrap"})})}};var b=n(965187);const _=(0,s.defineMessages)({listPlaceholder:{defaultMessage:"List",id:"numberedListBlock.placeholder.label"}});function S(e,t){const n=(0,s.useIntl)(),l=o.useRef(null),g=(0,r.VK)((()=>e.store.getBlockTitleStore()),[e.store]),f=(0,r.VK)((()=>e.store.getContentStore()),[e.store]),v=(0,d.rv)(e.store,!0),S=(0,r.VK)((()=>Boolean(e.store.getInsertSuggestion())),[e.store]),k=(0,i.yK)((t=>({root:{paddingLeft:a.ZD.paddingLeft,...v,...e.style},titlePlaceHolder:{...S?{color:t.text.uiBlueTertiary,WebkitTextFillColor:"initial"}:{}}})),[v,S,e.style]),w=(0,h.jsxs)(m.ZP,{style:k.root,left:(0,h.jsx)(y,{store:e.store,numberedListCounterStore:e.numberedListCounterStore}),leftStyle:{width:"unset"},childrenStyle:{display:"flex",flexDirection:"column"},ref:l,children:[(0,h.jsxs)("div",{style:{display:"flex"},children:[(0,h.jsx)(b.Z,{style:m.R8,disabled:e.disabled,store:g,placeholder:n.formatMessage(_.listPlaceholder),placeholderStyle:k.titlePlaceHolder,pasteBehavior:"block",legacyTransclusionParentStore:e.legacyTransclusionParentStore,inPageFind:c.B3.block_match,renderWhiteSpaceWhenEmptyOnAndroid:!0}),(0,h.jsx)(u.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store})]}),!e.hideContent&&(0,h.jsx)(p.Z,{disabled:e.disabled,store:f,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,disableDrag:e.disableDrag,numberedListCounterStore:e.numberedListCounterStore})]});return(0,d.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"numbered_list",getNode:()=>l.current,getBlockStore:()=>e.store})),[e.store]),w)}const k=o.memo(o.forwardRef(S),l.Z)},645952:(e,t,n)=>{n.d(t,{Z:()=>v,x:()=>f});var o=n(667294),r=n(800480),i=n(886628),a=n(709291),s=n(926249),l=n(99340),c=n(14735),d=n(568859),u=n(959062),p=n(369721),m=n(785893);const g=(0,a.defineMessages)({embedButtonText:{defaultMessage:"Embed PDF",id:"pdfBlock.embeds.button.label"}});function f(e){const{type:t,environment:n}=e;return"pdf"===t&&n.device.isMobile}function h(e,t){const n=(0,r.O7)(),s=(0,a.useIntl)(),h=(0,o.useRef)(null),v=(0,i.qz)(e.blockResizerStore,d.Z),y=(0,i.VK)((()=>{const t=e.store.getType();return t&&f({environment:n,type:t})}),[n,e.store])?(0,m.jsx)(p.Z,{store:e.store,disabled:e.disabled}):(0,m.jsx)(u.ZP,{...e,blockResizerStore:v,ref:h,store:e.store,iconSvg:c.B,mediaMenuCurrentTab:"file",mediaMenuTabs:[{type:"file",fileUpload:!0},{type:"embed"}],mediaMenuEmbedCaption:(0,m.jsx)(a.FormattedMessage,{defaultMessage:"Embed a PDF file",id:"pdfBlock.embeds.caption"}),embedButtonText:s.formatMessage(g.embedButtonText),urlInputPlaceholder:"https://...",children:(0,m.jsx)(a.FormattedMessage,{defaultMessage:"Embed a PDF",id:"pdfBlock.placeholder"})});return(0,l.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"pdf",getNode:()=>{const e=h.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),y)}const v=o.memo(o.forwardRef(h),s.Z)},15950:(e,t,n)=>{n.d(t,{Z:()=>U});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(643593),l=n(517755),c=n(559054),d=n(531701),u=n(653965),p=n(21359),m=n(631781),g=n(524677),f=n(95477),h=n(296994),v=n(724098),y=n(98742),b=n(918514),_=n(277907),S=n(434859),k=n(304926),w=n(424042),x=n(453730),I=n(568785),C=n(953336),T=n(543145),M=n(874587),P=n(785893);const A={position:"absolute",top:"calc(50% - 9px)",left:"calc(50% - 9px)",width:18,height:18},R=200,D=8,B=16,E={PASSWORD_REQUIRED:1,INVALID_PASSWORD:2};function F(e){const{value:t}=(0,_.XJ)(h.FF.reactPDF),n=(0,r.O7)(),{device:l}=n,[c,p]=(0,o.useState)(null),[m,f]=(0,o.useState)({ready:!1,pages:0,showPages:0}),[w,x]=(0,o.useState)(e.width),{showPages:F,pages:Z}=m,U=(0,a.yK)((()=>({scroller:{position:"relative",height:e.height,maxHeight:l.isMobile?"75vh":void 0,background:d.ZP.uiExtraLightGray,paddingTop:D,paddingBottom:D,paddingLeft:B,paddingRight:B,overflow:"visible"},lockIcon:{width:18,height:18,paddingRight:4},passwordContainer:{minWidth:80}})),[l.isMobile,e.height]);function V(){g.ZH({environment:n})}(0,o.useEffect)((()=>{const t=setTimeout((()=>{x(e.width)}),1e3);return()=>clearTimeout(t)}),[e.width]);const N=(0,i.VK)((()=>Math.min(window.innerWidth,w)-2*B-k.Z.state),[w]);function O(e,t){const n=parseInt(t,10);if(n===E.INVALID_PASSWORD){e(prompt("Invalid password. Please try again.")??"")}else p({status:"required",onPassword:e,reason:n})}function L(){if(!c)return;const e=prompt("Enter the password to open this PDF file.");c.onPassword(e??"")}function j(e){e&&e._pdfInfo&&(f({...m,pages:e._pdfInfo.numPages,showPages:1}),p(null))}function K(){f({...m,ready:!0})}function z(e){e<R&&m.ready&&F<Z&&f({...m,ready:!1,showPages:F+1})}const{source:q}=e,H=(0,i.VK)((()=>(0,s.x$)(q)&&!(0,b.Sr)(n)),[q,n]);if(!t)return null;const{Document:G,Page:W}=t,$=Boolean(c);return(0,P.jsx)(v.Z,{capture:!0,render:e=>(0,P.jsxs)(C.Z,{type:S.Z.All,style:U.scroller,...(0,y.Z)(e,{onMouseDown:V}),children:[$&&(0,P.jsx)("div",{style:U.passwordContainer,children:(0,P.jsx)(M.ZP,{family:"pdf",error:{type:"document_locked"},onClickLink:L})}),q&&(0,P.jsx)(G,{file:q,loading:$?(0,P.jsx)("div",{}):(0,P.jsx)(I.Z,{style:A}),onPassword:O,onLoadSuccess:j,options:{cMapUrl:"/notion-assets/cmaps/",cMapPacked:!0,withCredentials:H,isEvalSupported:!1},children:u.w6(m.showPages).map((e=>(0,P.jsx)(W,{pageNumber:e+1,width:N,loading:"",renderAnnotationLayer:!1,renderInteractiveForms:!1,onRenderSuccess:K},e+1)))}),(0,P.jsx)(T.Z,{onChange:z})]})})}function Z(e){const{contentWrapStyle:t,width:n,height:o,blockLocation:i,source:a}=e,d=e.store.pointer,u=(0,r.O7)(),[{value:g}]=(0,c.r5)((async()=>{if(await x.transactionQueue.awaitRecordTransaction(d),(0,s.E$)(a,[f.default.secureFileS3.url,f.default.secureFileS3V2.url])){const e=u.device;return await p.getSignedFileUrl(u,{url:a,permissionRecord:d,useS3Url:e.isIOS&&e.isMobileNative},Boolean(w.Z.state.isNotionProtocolBugFixed))}return(0,l.EK)({url:a,permissionRecord:d,baseUrl:f.default.domainBaseUrl,fullyQualified:!1,userId:u.currentUser.id})}),[u,d,a]);return(0,P.jsx)("div",{style:t,children:(0,P.jsx)(F,{source:g,width:n||500,height:o||(m.qC(i)?240:500)})})}const U={render:e=>(0,P.jsx)(Z,{...e}),embedGhost:!0,resizable:!0}},224813:(e,t,n)=>{n.d(t,{Z:()=>U});var o=n(294184),r=n.n(o),i=n(667294),a=n(800480),s=n(797511),l=n(886628),c=n(724405),d=n(815145),u=n(949271),p=n(950655),m=n(421838),g=n(744805),f=n(709291),h=n(137810),v=n(709953),y=n(210228),b=n(484210),_=n(798165),S=n(367669),k=n(99340),w=n(305971),x=n(719861),I=n(825464),C=n(469316),T=n(188923),M=n(13966),P=n(584076),A=n(731278),R=n(776798),D=n(526388),B=n(78454),E=n(785893);const F={paddingTop:u.ZD.paddingTop,paddingBottom:u.ZD.paddingBottom,paddingLeft:u.ZD.paddingLeft};function Z(e,t){const{store:n,onClick:o}=e,a=(0,c.Fg)(),s=(0,f.useIntl)(),[u,v]=(0,i.useState)(!1),y=(0,w.E)("enable_deleted_page_indicator"),S=(0,w.E)("trash_page_mention_pill"),x=(0,l.VK)((()=>{const e=_.wf(n);return y&&e}),[y,n]),M=(0,l.VK)((()=>n.inMemoryRecordCache.isTemporaryData),[n]),A=(0,l.VK)((()=>{const e=C.l9.state;if(!e)return!1;return(0,m.QaF)(n.getTitleValue()).toLowerCase().includes(e.toLowerCase())}),[n]),D=(0,l.VK)((()=>{const e=C.V8.state;return!!e&&("block"===e.type&&e.id===n.id)}),[n.id]),Z=(0,k.cR)(n)&&!M,U=(0,c.yK)((t=>({title:{fontWeight:h.Z.fontWeight.medium,lineHeight:1.3,borderBottom:e.disableUnderline?"none":`1px solid ${A?"transparent":t.darkDividerColor}`,...x&&{color:t.mediumTextColor}}})),[A,e.disableUnderline,x]),V=(0,i.useCallback)((()=>v(!0)),[]),N=(0,i.useCallback)((()=>v(!1)),[]),L=(0,l.VK)((()=>(0,b.Hu)({store:n,fullyQualified:!1,pageVisitSource:d.tY.LinkInPage})),[n]),K=(0,l.VK)((()=>(0,b.Hu)({store:e.store,openInSidePeek:!0,fullyQualified:!1,pageVisitSource:d.tY.PeekOpen})),[e.store]),z=(0,l.VK)((()=>T.default.isSidePeekOpen()),[]);return(0,E.jsx)(P.Z,{ref:t,href:L,altHref:K,forceAltHref:z,external:!1,onClick:o,style:{borderRadius:4,...e.style},children:(0,E.jsx)(B.ZP,{childrenStyle:F,alignment:I.v.Center,right:(0,E.jsx)(O,{aliasStore:e.aliasStore,disabled:e.disabled,store:e.store,hovered:u}),onMouseMove:V,onMouseLeave:N,children:(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,E.jsx)(j,{store:e.store,disabled:e.disabled,isAlias:e.isAlias,showDeletedPageIndicator:x}),(0,E.jsx)("span",{className:r()(D&&g.qp),style:{overflow:"auto",...A&&(0,g.ni)({theme:a,isSelectedMatch:D})},children:(0,E.jsx)(R.Z,{store:n,style:U.title})}),(0,E.jsx)(p.Z,{theme:a,intl:s,isPageInTrash:Z,enableNewTrashPageMentionPill:S})]})})})}const U=i.forwardRef(Z);function V(e){let{isAlias:t}=e;return t?(0,E.jsx)("div",{children:(0,x.Y)({position:"absolute",width:"50%",height:"50%",right:0,bottom:0})}):null}function N(e,t,n){const o=n&&n.publicEditModeStore.state;return!(0,S.YF)(o)&&(e.canEdit()&&!t)}function O(e){let{aliasStore:t,store:n,disabled:o,hovered:r}=e;const i=(0,s.l)(),c=(0,a.O7)(),{device:d}=c;return(0,l.VK)((()=>N(n,o,i)&&(r||d.isMobile)),[d.isMobile,o,r,i,n])?(0,E.jsx)(M.Z,{store:t??n,tooltipContent:(0,E.jsx)(f.FormattedMessage,{defaultMessage:"Rename, delete, and more…",id:"page.blockActionMenu.tooltip"}),style:{marginRight:4},fadeIn:!0}):(0,E.jsx)("div",{style:{width:28}})}function L(e){let{store:t,disabled:n}=e;const o=(0,s.l)(),r=(0,a.O7)(),i=(0,l.VK)((()=>t.getIcon()),[t]),c=(0,l.VK)((()=>t.getRole()),[t]),d=(0,l.VK)((()=>t.isEmptyPage()),[t]),u=(0,l.VK)((()=>t.getType()),[t]),p=(0,l.VK)((()=>N(t,n,o)),[n,o,t]);return(0,E.jsx)(D.Z,{renderTooltip:()=>(0,E.jsx)(f.FormattedMessage,{defaultMessage:"Change icon",id:"page.changeIcon.tooltip"}),placement:I.u.Top,disableTooltip:n||!p,render:e=>n||!p?(0,E.jsx)(A.Z,{disabled:!0,icon:i,isEmptyPage:d,role:c,size:22,style:{width:"100%",height:"100%"},...e,largeIcon:!0}):(0,E.jsx)(A.Z,{disabled:!1,bucket:"secure",store:t,icon:i,role:c,isEmptyPage:d,size:22,style:{width:"100%",height:"100%"},iconLoggingData:{recordTable:t.table,source:"subpage",block_type:u},onChange:e=>function(e,t,n){const o=t.getIconStore();o&&y.createAndCommit({userAction:"Page.handleRecordIconChange",environment:n,perform:t=>{v.sO({store:o,value:e,transaction:t})}})}(e,t,r),...e,largeIcon:!0})})}function j(e){let{showDeletedPageIndicator:t,store:n,disabled:o,isAlias:r}=e;const i=(0,c.Fg)(),s=(0,a.O7)();if(t){const e=s.device.isSafari||s.device.isIOS;return(0,g.tr)({isSafariOrIOS:e,theme:i})}return(0,E.jsxs)("div",{style:{position:"relative",width:24,height:24,marginRight:4},children:[(0,E.jsx)(L,{store:n,disabled:o}),(0,E.jsx)(V,{isAlias:r})]})}},804382:(e,t,n)=>{n.d(t,{Z:()=>T});var o=n(667294),r=n(973935),i=n(800480),a=n(886628),s=n(815145),l=n(926249),c=n(458912),d=n(966324),u=n(275754),p=n(800993),m=n(632741),g=n(466213),f=n(214976),h=n(783105),v=n(484210),y=n(99340),b=n(646735),_=n(222294),S=n(272014),k=n(188923),w=n(668709),x=n(224813),I=n(785893);function C(e,t){const n=(0,i.O7)(),l=(0,o.useContext)(g.ZO),C=(0,o.useRef)(null),T=(0,o.useRef)(null),M=(0,y.PE)(e.store,e.disabled),P=(0,y.rv)(e.store),A=(0,o.useCallback)((()=>{d.Se(n),c.SK(n,{page_visit_id:S.$g.getCurrentPageVisitId(),mentioned_page_id:e.store.id,source_type:"page_block",hover_preview_enabled:!0,is_navigable_block:e.store.isNavigableBlock()}),b.Z.recordVisit({id:e.store.id,systemBlockType:e.store.getSystemBlockTypeStore().getValue(),type:h.vu.Link,currentUserId:n.currentUser.id})}),[n,e.store]),R=(0,o.useCallback)((()=>{if(!T||!T.current)return;const t=r.findDOMNode(T.current);return(0,f.We)(e.store,t)}),[e.store]),D=(0,o.useCallback)((t=>{const o=R(),r=e.store.getTitleStore();r&&o&&p.Nh({environment:n,event:t,interactiveToken:o,store:r,canEdit:M})}),[M,n,R,e.store]),B=(0,o.useCallback)((t=>{const o=R(),r=e.store.getTitleStore();r&&o&&p.Zl({environment:n,event:t,interactiveToken:o,store:r,canEdit:M})}),[M,n,R,e.store]),E=(0,o.useCallback)((()=>{if(l){const t=(0,v.ZP)({store:e.store,pageVisitSource:s.tY.Create});l(t)}else u._c({environment:n,store:e.store,visitType:h.vu.Link,openInSidePeek:k.default.isSidePeekOpen(),pageVisitSource:s.tY.Create})}),[n,l,e.store]);(0,o.useEffect)((()=>()=>{m.qA(e.store.getTitleStore())}),[e.store]);const F=(0,a.VK)((()=>e.store.recordStoreParentDiffersFromPersistedParent()),[e.store]);return(0,y.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"page",getNode:()=>C.current,getBlockStore:()=>e.store,activate:E,handleCreated(){E(),_.Z.setKeyboardMode(!1)}})),[E,e.store]),(0,I.jsx)(w.p,{allowSelectionWithin:!1,onMouseOver:D,onMouseOut:B,ref:C,children:(0,I.jsx)(x.Z,{ref:T,store:e.store,style:{...P,...e.style},isAlias:F,disabled:e.disabled,onClick:A})}))}const T=o.memo(o.forwardRef(C),l.Z)},935541:(e,t,n)=>{n.d(t,{u:()=>A});n(667294);var o=n(800480),r=n(886628),i=n(724405),a=n(841892),s=n(421838),l=n(401898),c=n(354851),d=n(629071),u=n(705894),p=n(7825),m=n(638376),g=n(751077),f=n(634406),h=n(636596),v=n(865453),y=n(254321),b=n(804382),_=n(916472),S=n(699571),k=n(551704),w=n(817970),x=n(306684),I=n(804859),C=n(25157),T=n(691497),M=n(785893);let P;function A(e){const{store:t,restrictedBlockIds:n,tableRenderMode:o}=e,r=t.getType();if(r){if(!P||n){const e={text:w.Z,page:b.Z,collection_view_page:c.Z,bulleted_list:p.Z,numbered_list:y.Z,toggle:I.ZP,quote:_.ZP,to_do:x.Z,header:v.Z,sub_header:S.Z,sub_sub_header:k.Z,callout:m.Z,transclusion_container:C.Z,transclusion_reference:T.Z,alias:u.Z},t=(0,l.Yd)({abstract:!0,audio:!0,code:!0,codepen:!0,deepnote:!0,drive:!0,equation:!0,excalidraw:!0,figma:!0,file:!0,framer:!0,gist:!0,hex:!0,invision:!0,loom:!0,maps:!0,miro:!0,mixpanel:!0,pdf:!0,replit:!0,sketch:!0,tweet:!0,typeform:!0,video:!0,whimsical:!0}),r=Object.keys(t).reduce(((e,t)=>(e[t]=R,e)),{}),i={collection_view:B,table:"image"===o?B:D(n)};P={...e,...r,...i,copy_indicator:void 0,personal_home_page:void 0,button:void 0,image:void 0,link_to_page:void 0,link_to_collection:void 0,table_row:void 0,external_object_instance_page:void 0,external_object_instance:void 0,bookmark:void 0,table_of_contents:void 0,tab:void 0,column_list:void 0,column:void 0,embed:void 0,drawing:void 0,slide:void 0,divider:void 0,breadcrumb:void 0,factory:void 0,ai_block:void 0,form:void 0,post:void 0}}return P[r]}}function R(e){let{store:t}=e;const[n,o]=(0,r.VK)((()=>{var e;const n=t.getType(),o=null===(e=t.getTitleStore())||void 0===e?void 0:e.getValue();return[n,s.QaF(o)]}),[t]),l=(0,i.yK)((e=>({card:{display:"flex",padding:10,borderRadius:6,boxShadow:e.inputBoxShadow,marginBottom:6,gap:10},shimmer:{backgroundColor:e.largeShimmerColor,width:150,borderRadius:6}})),[]),c=function(e){const t=e&&E[e];if("string"==typeof t)return t;return a.Z.images.icons.unknownTypePng}(n);return(0,M.jsxs)("div",{style:l.card,children:[(0,M.jsx)(g.Z,{type:"image_url",imageURL:c,size:25,imageStyle:{marginLeft:4,marginRight:4}}),o.length>0?(0,M.jsx)("span",{children:o}):(0,M.jsx)(h.Z,{emphasized:!0,style:l.shimmer})]})}function D(e){return t=>{let{store:n,...o}=t;const{tableStore:i,isPartialTable:a}=(0,r.VK)((()=>{if(n.isType("table"))return{tableStore:n,isPartialTable:!1};const e=n.getParentBlockStore();return e&&e.isType("table")?{tableStore:e,isPartialTable:!0}:{tableStore:void 0,isPartialTable:!1}}),[n]);return i?(0,M.jsx)(d.W,{...o,store:i,showRowIds:a?e:void 0}):null}}function B(e){let{store:t}=e;const n=(0,o.O7)(),s="collection_view"===(0,r.VK)((()=>t.getType()),[t]),l=(0,i.yK)((e=>({image:{width:"100%",borderRadius:4,border:`1px solid ${e.lightDividerColor}`},container:{marginBottom:6}})),[]),c=(0,r.VK)((()=>"dark"===n.ThemeStore.state.mode),[n.ThemeStore]),d=c?a.Z.images.blockRendererCovers.collectionTableDarkPng:a.Z.images.blockRendererCovers.collectionTableLightPng,u=c?a.Z.images.blockRendererCovers.plainTableDarkPng:a.Z.images.blockRendererCovers.plainTableLightPng;return(0,M.jsx)("div",{style:l.container,children:(0,M.jsx)(f.Z,{src:s?d:u,style:l.image})})}const E={equation:a.Z.images.blocks.texPng,audio:a.Z.images.blocks.audioPng,file:a.Z.images.blocks.filePng,pdf:a.Z.images.blocks.pdfPng,code:a.Z.images.blocks.codePng,video:a.Z.images.blocks.videoPng,abstract:a.Z.images.blocks.abstractPng,codepen:a.Z.images.blocks.codepenPng,deepnote:a.Z.images.blocks.deepnotePng,drive:a.Z.images.blocks.drivePng,excalidraw:a.Z.images.blocks.excalidrawPng,figma:a.Z.images.externalIntegrations.figmaIconPng,framer:a.Z.images.blocks.framerPng,gist:a.Z.images.blocks.githubPng,hex:a.Z.images.blocks.hexPng,invision:a.Z.images.blocks.invisionPng,loom:a.Z.images.blocks.loomPng,maps:a.Z.images.blocks.mapsPng,miro:a.Z.images.blocks.miroPng,mixpanel:a.Z.images.blocks.mixpanelPng,replit:a.Z.images.blocks.replitPng,sketch:a.Z.images.blocks.sketchPng,typeform:a.Z.images.blocks.typeformPng,tweet:a.Z.images.blocks.twitterPng,whimsical:a.Z.images.blocks.whimsicalPng}},32469:(e,t,n)=>{n.d(t,{Z:()=>c});n(667294);var o=n(709291),r=n(531701),i=n(137810),a=n(978877),s=n(526388),l=n(785893);const c=function(e){let{style:t}=e;return(0,l.jsx)(s.Z,{renderTooltip:()=>(0,l.jsx)(o.FormattedMessage,{defaultMessage:"Only you can see this page",id:"privatePageBadge.tooltip"}),render:e=>(0,l.jsx)("div",{style:{display:"flex",alignItems:"flex-start",...t||{}},...e,children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,l.jsx)("div",{style:{flexShrink:0,marginTop:-1,marginRight:4,fill:r.ZP.red},children:(0,a.b)({width:12})}),(0,l.jsx)("span",{style:{fontSize:12,fontWeight:i.Z.fontWeight.semibold,color:r.ZP.red},children:(0,l.jsx)(o.FormattedMessage,{defaultMessage:"Private",id:"privatePageBadge.label"})})]})})})}},916472:(e,t,n)=>{n.d(t,{NE:()=>y,ZP:()=>S,nr:()=>b});var o=n(667294),r=n(886628),i=n(724405),a=n(949271),s=n(709291),l=n(926249),c=n(249394),d=n(433929),u=n(99340),p=n(523864),m=n(104029),g=n(630915),f=n(965187),h=n(785893);const v=(0,s.defineMessages)({emptyPlaceholder:{defaultMessage:"Empty quote",id:"quoteBlock.emptyQuote.placeholder"}}),y=3,b=14;function _(e,t){let{disabled:n,disableCommentMenu:s,disableDrag:l,disableHoverMenu:_,hideContent:S,store:k,style:w}=e;const x=(0,o.useRef)(null),I=(0,u.rv)(k),C=(0,r.VK)((()=>{var e;return null===(e=k.getFormat())||void 0===e?void 0:e.quote_size}),[k]),T=(0,r.VK)((()=>k.getBlockTitleStore()),[k]),M=(0,r.VK)((()=>k.getContentStore()),[k]),P=(0,i.yK)((()=>({root:{margin:0,fontSize:"large"===C?"1.2em":"1em",...a.ZD,...I,display:"flex",...w},padding:{paddingLeft:a.ZD.paddingLeft,paddingRight:a.ZD.paddingRight},innerStyle:{borderLeft:`${y}px solid currentColor`,paddingLeft:b,paddingRight:b,width:"100%"}})),[I,C,w]),{blockInsetRight:A}=(0,o.useContext)(m.a),R=(0,h.jsxs)("blockquote",{style:P.root,ref:x,children:[(0,h.jsxs)("div",{style:P.innerStyle,children:[(0,h.jsx)(f.Z,{style:P.padding,placeholderStyle:{left:b,width:"auto",right:b},disabled:n,store:T,placeholder:d.default.formatMessage(v.emptyPlaceholder),pasteBehavior:"block",inPageFind:c.B3.block_match,renderWhiteSpaceWhenEmptyOnAndroid:!0}),!S&&(0,h.jsx)(m.a.Provider,{value:{blockInsetRight:A+b},children:(0,h.jsx)(g.Z,{disabled:n,store:M,disableCommentMenu:s,disableHoverMenu:_,disableDrag:l})})]}),(0,h.jsx)(p.Z,{disableCommentMenu:s,hideContent:S,store:k})]});return(0,u.ez)(k,t,(0,o.useMemo)((()=>({renderedType:"quote",getNode:()=>x.current,getBlockStore:()=>k})),[k]),R)}const S=o.memo(o.forwardRef(_),l.Z)},279954:(e,t,n)=>{n.d(t,{Z:()=>W});var o=n(667294),r=n(883355),i=n(800480),a=n(724405),s=n(14577),l=n(541432),c=n(151454),d=n(531701),u=n(619584),p=n(106404),m=n(42239),g=n(587420),f=n(52989),h=n(524677),v=n(210228),y=n(457819),b=n(110906),_=n(311368),S=n(884064),k=n(843250),w=n(212534),x=n(98742),I=n(639500),C=n(745162),T=n(273959),M=n(389224),P=n(489086),A=n(95802),R=n(316772),D=n(155367),B=n(510084),E=n(480796),F=n(385555),Z=n(720144),U=n(569784),V=n(749085);class N extends V.default{getInitialState(){return{shouldShowSelectionHalo:!1,shouldShowDropParentHalo:!1,shouldShowDropZone:!1,shouldShowDropZoneHint:!1,forceRenderSelectionHalo:!1,showActionIsInFlight:!1}}}const O=N;var L=n(27724),j=n(924666),K=n(623063),z=n(706685),q=n(785893);const H=4;class G extends r.Z{constructor(){super(...arguments),this.lastDropZoneHintIndex=void 0,this.selectableDivRef=o.createRef(),this.storeTypes={draggableStore:B.Z,selectableStore:O},this.computedStore=this.createComputedStore((()=>{const e=function(e){const t=D.ZP.state;if(!t.isDragging)return;const{currentHintDropZones:n}=t;if(n)return n.findIndex((t=>t.type===D.Dl.Selectable&&t.store===e))}(this.props.store);!u.z4(e)&&e>=0&&(this.lastDropZoneHintIndex=e);const t=function(e,t,n){const{device:o}=t;if(!n)return!1;if(!(0,T.Mn)(o)&&!oe.state)return!1;if(ne.state!==L.SelectionPhase.Selected)return!1;const{stores:r}=L.default.state;if(r.indexOf(e)>=0&&!D.ZP.state.isDragging)return!0;return!1}(this.props.store,this.environment,this.props.shouldShowHalo),n=function(e,t){if(!t)return!1;const n=D.ZP.state;if(!n.isDragging)return!1;const{currentParentStore:o,currentHintDropZones:r,currentDropZone:i}=n;if(i&&i.type===D.Dl.DropTarget)return!1;return r.some((e=>e.direction===D.vh.Left||e.direction===D.vh.Right))?Boolean(i&&i.store===e):o===e}(this.props.store,Boolean(this.props.shouldShowHalo)),o=function(e,t){const n=D.ZP.state;if(!n.isDragging)return;const{currentDropZone:o}=n;if(o&&o.type===D.Dl.Selectable&&o.store===e&&t)return o.direction}(this.props.store,Boolean(this.props.shouldShowDropZone)),r=function(e,t){const n=D.ZP.state;if(!n.isDragging)return;const{currentHintDropZones:o}=n;if(o&&t){const t=o.find((t=>t.type===D.Dl.Selectable&&t.store===e));if(t)return t.direction}}(this.props.store,Boolean(this.props.shouldShowDropZone)),i=this.lastDropZoneHintIndex,a=this.stores.draggableStore.state.dragging,s=this.stores.draggableStore.hasDragged(),l=this.stores.draggableStore.state.initiator,c=this.stores.selectableStore.state,d=this.props.store.getType()||"unknown";return{isDragging:a,initiator:l,hasDragged:s,shouldShowSelectionHalo:t||c.forceRenderSelectionHalo||Boolean(this.props.shouldForceRenderSelectionHalo),shouldShowDropParentHalo:n,currentDropZone:o,dropZoneHint:r,dropZoneHintIndex:i,shouldRenderSelectionHalo:t||c.shouldShowSelectionHalo||c.forceRenderSelectionHalo||Boolean(this.props.shouldForceRenderSelectionHalo),shouldRenderDropParentHalo:n||c.shouldShowDropParentHalo,shouldRenderDropZoneHint:!u.z4(r)||c.shouldShowDropZoneHint,shouldRenderDropZone:!u.z4(o)||c.shouldShowDropZone,propStoreType:d,showActionIsInFlight:c.showActionIsInFlight}}))}get registries(){return[A.C]}getNode(){return this.props.nodeRef?this.props.nodeRef.current:this.selectableDivRef.current}getContextClosestSelectable(){var e;return null===(e=this.context.selectable)||void 0===e?void 0:e.closestSelectable}getContextSelectableContainer(){var e;return null===(e=this.context.selectable)||void 0===e?void 0:e.selectableContainer}getContextVerticalScroller(){var e;return null===(e=this.context.scrollerContext)||void 0===e?void 0:e.verticalScroller}getContextHorizontalScroller(){var e;return null===(e=this.context.scrollerContext)||void 0===e?void 0:e.horizontalScroller}renderComponent(){var e;const{isDragging:t,initiator:n,hasDragged:o,shouldShowDropParentHalo:r,shouldShowSelectionHalo:i,currentDropZone:a,dropZoneHint:s,dropZoneHintIndex:c,shouldRenderSelectionHalo:d,shouldRenderDropParentHalo:u,shouldRenderDropZoneHint:m,shouldRenderDropZone:f,propStoreType:y,showActionIsInFlight:_}=this.computedStore.state,A=Boolean(this.props.shouldShowSuggestRemoveHalo&&!this.props.store.isType(l.fb)&&this.props.store.getRemoveSuggestion()),R=Boolean(this.props.shouldShowSuggestInsertBorder&&!this.props.store.isType(l.zq)&&this.props.store.getInsertSuggestion()),D=d||u||m||f||A||R,B=`${k.euV} notion-${y}-block`,E=this.renderDraggable((e=>(0,q.jsxs)("div",{ref:this.selectableDivRef,style:re({isPositionRelative:D,isDragging:t,hasDragged:o,initiator:n,showActionIsInFlight:_,shouldRenderSuggestInsertBorder:R},this.theme,this.props.canDrag,this.props.style),"data-block-id":this.props.store.id,dir:F.default.checkGate({gateName:"editor_basic_rtl"})?"auto":void 0,className:this.props.className?`${B} ${this.props.className}`:B,...(0,x.Z)(e||{},{onDoubleClick:e=>function(e,t,n){t||(0,w.ZP)({event:e,context:w.Af.EditorDoubleClick,callback:()=>{n&&n(e)}})}(e,this.props.canSelect,this.props.onDoubleClick),onContextMenu:e=>function(e,t,n,o,r,i,a){const{device:s}=n;if(s.isAndroid){const n=j.default.state,o=(0,T.mh)(t),r=o&&"empty"!==n.mode&&(0,C.r)(n.multiSelection,o);if("editing"!==n.mode||!r)return M.isExpanded(M.get())||e.preventDefault(),e.stopPropagation(),!1}if(o){var l;const o=(0,b.fm)(t),s=void 0!==t.getAssociatedCollectionStore(),c=null==o||null===(l=o.collectionViewStore())||void 0===l?void 0:l.getType();(0,w.ZP)({event:e,context:w.Af.EditorContextMenu,callback:()=>{e.preventDefault(),h.Ys({environment:n,store:t}),p.Qn({environment:n,stores:r||L.default.state.stores,left:e.clientX,top:e.clientY,actionSectionGroupKey:s&&F.default.checkGate({gateName:"db_comments"})?"timeline"===c?"block_in_collection_timeline_view":"block_in_collection":i||"default",showInput:Boolean(a),analyticsFrom:"content_block_menu",optionalAnalyticsProperties:{collectionContextStore:o}})}})}}(e,this.props.store,this.environment,this.props.canTriggerContextMenu,this.props.contextMenuAndDragStores,this.props.actionSectionGroupKey,this.props.showBlockMenuInput),onMouseOver:e=>function(e,t,n){n&&(0,w.ZP)({event:e,context:w.Af.EditorMouseOver,callback:()=>{Z.Z.setState({...Z.Z.state,hoveredStore:t,lastHoveredStore:t})}})}(e,this.props.store,this.props.canSelect),onMouseOut:()=>{return e=this.props.store,void(Z.Z.state.hoveredStore===e&&Z.Z.setState({...Z.Z.state,hoveredStore:void 0}));var e},onClick:e=>function(e,t,n,o,r,i){(0,w.ZP)({event:e,context:w.Af.EditorClick,callback:()=>{var a;if(null!==(a=L.default.getDefaultContainerFromTarget(e.target))&&void 0!==a&&a.isPeekRenderer()||g.E5(n),(0,T.Mn)(n.device))I.X9()||!o||t.isInlineCollectionView()||h.Ys({environment:n,store:t,toggle:h.ji(n),selectBetween:h.OS()});else if(r){const t=(0,P.Rb)(e.target);t&&v.createAndCommit({userAction:"Selectable.handleClick",environment:n,perform:e=>{r({isAtStartOfLine:"start"===t,isClick:!0,transaction:e})}})}i&&i(e)}})}(e,this.props.store,this.environment,this.props.canSelect,this.props.onEditText,this.props.onClick),onMouseMove:this.props.onMouseMove,onMouseDown:this.props.onMouseDown,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave}),children:[this.props.children,d&&(0,q.jsx)($,{selectableStore:this.stores.selectableStore,style:this.props.haloStyle,isVisible:i}),A&&(0,q.jsx)(Q,{}),u&&(0,q.jsx)(Y,{selectableStore:this.stores.selectableStore,isVisible:r}),m&&(0,q.jsx)(te,{selectableStore:this.stores.selectableStore,direction:s,index:c,aboveDropZoneMargin:this.props.aboveDropZoneMargin,belowDropZoneMargin:this.props.belowDropZoneMargin,dropzoneGap:this.props.dropzoneGap}),f&&(0,q.jsx)(ee,{selectableStore:this.stores.selectableStore,direction:a,aboveDropZoneMargin:this.props.aboveDropZoneMargin,belowDropZoneMargin:this.props.belowDropZoneMargin,dropzoneGap:this.props.dropzoneGap})]})));return(0,q.jsx)(S.ld,{value:{selectableContainer:null===(e=this.context.selectable)||void 0===e?void 0:e.selectableContainer,closestSelectable:this},children:E})}displaySelectionHalo(e){this.stores.selectableStore.state.forceRenderSelectionHalo||(this.stores.selectableStore.update((e=>({...e,forceRenderSelectionHalo:!0}))),window.setTimeout((()=>{this.stores.selectableStore.update((e=>({...e,forceRenderSelectionHalo:!1})))}),e))}renderDraggable(e){const{device:t}=this.environment;return this.props.canDrag?(0,q.jsx)(z.Z,{draggableStore:this.stores.draggableStore,forceTouch:t.isMobile&&!this.props.disableForceTouch,touchDragOnly:this.props.touchDragOnly,onDraggableDragStart:e=>function(e,t,n,o){const{mobileNative:r}=t;n&&(e.preventDefault(),r&&r.buzz());o&&o(e)}(e,this.environment,this.props.canDrag,this.props.onDraggableDragStart),onDraggableDragMove:e=>function(e,t,n,o,r,i,a,s,l){const{device:c}=n;o&&!r?D.ZP.state.isDragging?m.td(n,{currentX:e.currentX,currentY:e.currentY}):I.X9()&&(h.Ys({environment:n,store:t,toggle:h.ji(n),selectBetween:h.OS()}),m.f$(n,{startX:e.startX,startY:e.startY,stores:i||L.default.state.stores,isNativeDrag:!1,getGhostElement:a})):U.default.state.isActive||c.isPhone||f.AI({environment:n,target:e.target,startX:e.startX,startY:e.startY,showSelectionRect:!0,preventSelectStores:[],allowVerticalEdgeScroll:!0,allowHorizontalEdgeScroll:!s});l&&l(e)}(e,this.props.store,this.environment,this.props.canDrag,this.props.preventBackgroundDrag,this.props.contextMenuAndDragStores,this.props.getGhostElement,this.props.disableScrollToRevealHorizontal,this.props.onDraggableDragMove),onDraggableDragEnd:e=>function(e,t,n,o,r){const{device:i}=n;i.isMobile&&E.Z.state.isDragging&&e.preventDefault();o&&D.ZP.state.isDragging&&m.fX({environment:n,shiftKey:e.shiftKey,optionKey:e.optionKey,commandKey:e.commandKey,analyticsFrom:t});r&&r(e)}(e,this.props.analyticsName,this.environment,this.props.canDrag,this.props.onDraggableDragEnd),onDraggableDragCancel:e=>function(e,t,n,o){n&&D.ZP.state.isDragging&&(m.cQ(t),h.ZH({environment:t}));o&&o(e)}(e,this.environment,this.props.canDrag,this.props.onDraggableDragCancel),disableHorizontalEdgeScroll:this.props.disableHorizontalDragEdgeScroll,render:e}):e(void 0)}}G.displayName="Selectable",G.contextTypes={..._.I3,...S.Tf,...r.w};const W=G;function $(e){return(0,q.jsx)(K.Z,{isVisible:e.isVisible,enterAnimationStyle:{opacity:0},animationStyle:{opacity:1},exitAnimationStyle:{opacity:0},onAnimationStart:()=>{e.selectableStore.setState({...e.selectableStore.state,shouldShowSelectionHalo:!0})},onAnimationEnd:()=>{e.isVisible||e.selectableStore.setState({...e.selectableStore.state,shouldShowSelectionHalo:!1})},render:()=>(0,q.jsx)("div",{className:k.No6,style:{position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,background:d.ZP.blueWithAlpha(.14),zIndex:c.py,borderRadius:4,...e.style}})},"halo")}function Y(e){return(0,q.jsx)(K.Z,{isVisible:e.isVisible,enterAnimationStyle:{opacity:0},animationStyle:{opacity:1},exitAnimationStyle:{opacity:0},onAnimationStart:()=>{e.selectableStore.setState({...e.selectableStore.state,shouldShowDropParentHalo:!0})},onAnimationEnd:()=>{e.isVisible||e.selectableStore.setState({...e.selectableStore.state,shouldShowDropParentHalo:!1})},render:()=>(0,q.jsx)("div",{className:k.No6,style:{position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,background:d.ZP.blueWithAlpha(.07),borderRadius:4}})},"parent")}function Q(){const e=(0,a.yK)((e=>({halo:{position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,background:e.accentColors.gray[90],borderRadius:4}})),[]);return(0,q.jsx)("div",{className:k.a1k,style:e.halo})}function J(e,t,n){if(void 0===n)return{};const o=e.isMobile?3:2;return n===D.vh.Above||n===D.vh.Below?{position:"relative",left:-o,width:o,height:H,background:t.contentBackground,transform:"translateZ(100px)"}:{position:"relative",top:-o,width:H,height:o,background:t.contentBackground,transform:"translateZ(100px)"}}function X(e,t,n,o,r){const i={position:"absolute",pointerEvents:"none",background:d.ZP.blueWithAlpha(.43),zIndex:c.S1-t};if(e===D.vh.Onto)i.left=0,i.top=0,i.right=0,i.bottom=0,i.background=d.ZP.blueWithAlpha(.14);else if(e===D.vh.Above||e===D.vh.Below){const t=4;i.left=0,i.right=0,e===D.vh.Above?(i.top=-t,n&&(i.top-=n)):(i.bottom=-t,o&&(i.bottom-=o)),i.height=H}else{const t=8;i.top=0,i.bottom=0,e===D.vh.Left?i.left=r?-r:-t:i.right=r?-r:-t,i.width=H}return i}function ee(e){const t=(0,i.Fy)(),n=(0,a.Fg)(),o=void 0!==e.direction;return(0,q.jsx)(K.Z,{isVisible:o,enterAnimationStyle:{opacity:0},animationStyle:{opacity:1},exitAnimationStyle:{opacity:0},onAnimationStart:()=>{e.selectableStore.setState({...e.selectableStore.state,shouldShowDropZone:!0})},onAnimationEnd:()=>{o||e.selectableStore.setState({...e.selectableStore.state,shouldShowDropZone:!1})},render:()=>(0,q.jsx)("div",{style:X(e.direction,0,e.aboveDropZoneMargin,e.belowDropZoneMargin,e.dropzoneGap),children:e.direction!==D.vh.Onto&&(0,q.jsx)("div",{style:J(t,n,e.direction)})})},"dropZone")}function te(e){const t=(0,i.Fy)(),n=(0,a.Fg)(),o=!u.z4(e.direction);return(0,q.jsx)(K.Z,{isVisible:o,enterAnimationStyle:{opacity:0},animationStyle:{opacity:1},exitAnimationStyle:{opacity:0},onAnimationStart:()=>{e.selectableStore.setState({...e.selectableStore.state,shouldShowDropZoneHint:!0})},onAnimationEnd:()=>{o||e.selectableStore.setState({...e.selectableStore.state,shouldShowDropZoneHint:!1})},render:()=>(0,q.jsx)("div",{style:X(e.direction,(e.index||0)+1,e.aboveDropZoneMargin,e.belowDropZoneMargin,e.dropzoneGap),children:(0,q.jsx)("div",{style:J(t,n,e.direction)})})},"hint")}const ne=new s.ZP((()=>L.default.state.phase),{debugName:"SelectionPhaseStore"}),oe=new s.ZP((()=>{const e=(0,y.RR)(R.default.state);return Boolean(e)}),{debugName:"isCompletionsActiveStore"});function re(e,t,n,o){const{isPositionRelative:r,isDragging:i,hasDragged:a,showActionIsInFlight:s,initiator:l,shouldRenderSuggestInsertBorder:c}=e,d={};return"touch"===l&&(d.transition="transform 200ms ease-out",n&&i&&!a&&(d.boxShadow=t.mediumBoxShadow,d.transform="scale(1.05)",d.borderRadius=3)),r&&(d.position="relative"),s&&(d.opacity=.5),c&&(d.borderWidth=8,d.borderStyle="solid",d.borderColor=t.accentColors.blue[50]),{...d,...o}}},592015:(e,t,n)=>{n.d(t,{Z:()=>U});var o=n(667294),r=n(118466),i=n(701302),a=n(800480),s=n(533125),l=n(886628),c=n(724405),d=n(531701),u=n(653965),p=n(587420),m=n(52989),g=n(524677),f=n(898104),h=n(210228),v=n(710274),y=n(884064),b=n(843250),_=n(212534),S=n(639500),k=n(316339),w=n(277907);const x={SelectableHoverMenuOverlay:new w.Ss("SelectableHoverMenuOverlay",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,552211))))},I=(0,w.kF)(x.SelectableHoverMenuOverlay,(e=>e.default));var C=n(598794),T=n(990827),M=n(206258),P=n(569784),A=n(650628),R=n(27724),D=n(804827),B=n(785893);const E=10;function F(e){let t=!0;if(e.length<=E){const{selectableElementRectMap:n}=r.Z.withListenerIgnored((()=>A.Z.getState()));t=e.some((e=>function(e,t){const n=t.target instanceof Element?t.target:t.target.parentElement;if(!n)return!0;if(n.closest(`.${b.$Ot}`))return!1;const o=n.closest(`.${b.euV}`);if(!o)return!0;const r=e.get(o);if(!r)return!0;const i=o.getBoundingClientRect();return!(r.x===i.x&&r.y===i.y&&r.width===i.width&&r.height===i.height)}(n,e)))}t&&g.Ch()}function Z(e){const{isDefaultContainer:t}=e,{currentRect:n,isActive:o,showSelectionRect:r}=(0,l.VK)((()=>P.default.state.isActive?P.default.state:{currentRect:void 0,isActive:!1,showSelectionRect:!1}),[]),i=(0,c.yK)((()=>({selection:{position:"absolute",pointerEvents:"none",backgroundColor:d.ZP.blueWithAlpha(.14),border:"1px solid transparent",left:null==n?void 0:n.left,top:null==n?void 0:n.top,width:n?n.right-n.left:0,height:n?n.bottom-n.top:0}})),[n]);return o&&r&&t?(0,B.jsx)("div",{style:i.selection}):null}const U=function(e){const t=(0,o.useRef)(null),n=(0,o.useRef)({isPeekRenderer:()=>e.isPeekRenderer??!1,getProps:()=>e,getNode:()=>t.current});(0,o.useLayoutEffect)((()=>{n.current.isPeekRenderer=()=>e.isPeekRenderer??!1,n.current.getProps=()=>e,n.current.getNode=()=>t.current}),[e]);const r=(0,a.O7)();(0,s.c)(k.Z,(()=>n.current),[]),(0,o.useLayoutEffect)((()=>{const o=n.current;if(e.isDefaultContainer){const t=e.isRootContainer?u.G0([o],R.default.state.defaultContainerStack||[]):u.G0(R.default.state.defaultContainerStack||[],[o]);R.default.setState({...R.default.state,defaultContainerStack:t,pivot:void 0,anchor:void 0,anchorContainer:void 0})}if(e.droppable){const t=e.isRootContainer?u.G0([o],R.default.state.droppableContainerStack||[]):u.G0(R.default.state.droppableContainerStack||[],[o]);R.default.setState({...R.default.state,droppableContainerStack:t})}let r;return g.Jy(),t.current&&(r=new MutationObserver(F),r.observe(t.current,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),()=>{if(e.isDefaultContainer){const e=u.zu(R.default.state.defaultContainerStack||[],o);R.default.setState({...R.default.state,defaultContainerStack:e,pivot:void 0,anchor:void 0,anchorContainer:void 0})}if(e.droppable){const e=u.zu(R.default.state.droppableContainerStack||[],o);R.default.setState({...R.default.state,droppableContainerStack:e})}r&&r.disconnect()}}),[n,e.droppable,e.isDefaultContainer,e.isRootContainer]);const{closestSelectable:c}=(0,o.useContext)(y.aT)??{},d=(0,o.useCallback)((t=>{const{device:n}=r;e.disableRectangularSelection||0!==t.button||(n.isPhone?(0,_.ZP)({event:t,context:_.Af.EditorMouseDown,callback:()=>{g.ZH({environment:r}),v.wG(),C.MO()}}):(0,_.ZP)({event:t,context:_.Af.EditorMouseDown,callback:()=>{if(t.target instanceof Element){if(t.target.closest("button")||t.target.closest('[role="button"]'))return}1!==t.button&&(t.preventDefault(),m.AI({environment:r,target:t.target,startX:t.clientX,startY:t.clientY,showSelectionRect:!0,preventSelectStores:[],allowVerticalEdgeScroll:!0,allowHorizontalEdgeScroll:!1}))}}))}),[r,e.disableRectangularSelection]),b=(0,o.useCallback)((t=>{(function(e){return A.Z.hasBeenUpdatedSince(e.timeStamp)})(t)||!e.store.canEdit()||e.store instanceof M.G&&(0,T.Eo)(e.store)||(0,_.ZP)({event:t,context:_.Af.EditorClick,callback:()=>{var n;if(null!==(n=R.default.getDefaultContainerFromTarget(t.target))&&void 0!==n&&n.isPeekRenderer()||p.E5(r),!S.X9()&&!e.disableEditNearestBlock){const{clientX:e,clientY:n,target:o}=t;i.default.afterNextFlush((()=>{h.createAndCommit({userAction:"SelectableContainer.click",environment:r,perform:t=>f.editNearestBlockOrInsertIfAtBottomOfPage(r,{x:e,y:n,target:o instanceof Element?o:void 0},t)})}))}}})}),[r,e.disableEditNearestBlock,e.store]),w=(0,l.VK)((()=>Boolean(P.default.state.isActive&&P.default.state.defaultContainer===n.current)),[]),x=(0,l.VK)((()=>(0,B.jsx)("div",{style:{display:"contents"},ref:t,children:e.render({selectableEvents:{onMouseDown:d,onClick:b},selectableHoverMenuOverlay:(0,B.jsx)(I,{selectableContainer:n.current})})})),[b,d,e]);return(0,B.jsx)(y.ld,{value:{selectableContainer:n.current,closestSelectable:c},children:(0,B.jsx)(D.Z,{open:w,origin:x,children:(0,B.jsx)(Z,{isDefaultContainer:e.isDefaultContainer})})})}},635021:(e,t,n)=>{n.d(t,{Z:()=>p});var o=n(667294),r=n(800480),i=n(643593),a=n(21359),s=n(95477),l=n(213542),c=n(424042),d=n(453730),u=n(785893);function p(e){const t=(0,r.O7)(),n=(0,o.useCallback)((async e=>i.E$(e.url,[s.default.secureFileS3.url,s.default.secureFileS3V2.url])?(e.permissionRecord&&await d.transactionQueue.awaitRecordTransaction(e.permissionRecord),a.getSignedFileUrl(t,e,Boolean(c.Z.state.isNotionProtocolBugFixed))):e.url),[t]);return(0,u.jsx)(l.Z,{request:{url:e.url,permissionRecord:e.permissionRecord,useS3Url:e.useS3Url},performRequest:n,render:e.render})}},606854:(e,t,n)=>{n.d(t,{Pn:()=>b,k$:()=>S,ow:()=>_,wr:()=>k});var o=n(667294),r=n(800480),i=n(724405),a=n(815145),s=n(709291),l=n(452423),c=n(275754),d=n(608055),u=n(164964),p=(n(584076),n(489728)),m=n(973744),g=n(783105),f=n(568839),h=n(172360),v=n(785893);const y=(0,s.defineMessages)({open:{defaultMessage:"Open",id:"automations.buttonTrigger.open"},undo:{defaultMessage:"Undo",id:"automations.buttonTrigger.undo"}});function b(e){const t=(0,i.Fg)();return(0,v.jsx)(p.Z,{...e,style:{color:t.regularInvertedTextColor,fontWeight:500,height:void 0,marginLeft:0,...e.style}})}function _(e){const{onUndo:t}=e,n=(0,r.O7)();return(0,v.jsx)(b,{onClick:()=>{l.Yw(n,!0),u.rN(),null==t||t()},children:(0,v.jsx)(s.FormattedMessage,{defaultMessage:"Undo",id:"snackbar.undo.title"})})}function S(){const e=(0,r.O7)(),t=(0,o.useCallback)((()=>{d.c4({environment:e,url:"https://notion.so/help/audio-dictation"})}),[e]);return(0,v.jsx)(b,{onClick:t,children:(0,v.jsx)(s.FormattedMessage,{defaultMessage:"Get help",id:"snackbar.goToGetHelpButton.title"})})}function k(e){const{blockToOpenStore:t,performUndo:n}=e,l=(0,r.O7)(),d=(0,i.yK)((e=>({icon:{fill:e.regularInvertedTextColor},wrap:{display:"flex",columnGap:8}})),[]),u=(0,o.useMemo)((()=>t?e=>{c._c({environment:l,openInNew:(0,m.DJ)(e),store:t,visitType:g.vu.Link,pageVisitSource:a.tY.ButtonAutomation})}:void 0),[t,l]);return(0,v.jsxs)("div",{style:d.wrap,children:[u&&(0,v.jsx)(b,{onClick:u,icon:e=>(0,f.g)({...e,...d.icon,width:16,height:16}),style:{paddingRight:0},children:(0,v.jsx)(s.FormattedMessage,{...y.open})}),n&&(0,v.jsx)(b,{onClick:n,icon:e=>(0,h.s)({...e,...d.icon,marginTop:-2,width:16,height:16}),children:(0,v.jsx)(s.FormattedMessage,{...y.undo})})]})}},699571:(e,t,n)=>{n.d(t,{Z:()=>_});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(949271),l=n(176490),c=n(709291),d=n(926249),u=n(249394),p=n(635328),m=n(99340),g=n(523864),f=n(965187),h=n(17377),v=n(785893);const y=(0,c.defineMessages)({placeholder:{defaultMessage:"Heading 2",id:"subheaderBlock.placeholder"}});function b(e,t){const n=(0,c.useIntl)(),d=(0,r.O7)(),b=(0,r.Fy)(),_=(0,o.useRef)(null),S=(0,m.rv)(e.store,!0),k=(0,m.Iy)(e.store),w=(0,i.VK)((()=>e.store.getBlockTitleStore()),[e.store]),x=(0,i.VK)((()=>Boolean(e.store.getInsertSuggestion())),[e.store]),I=(0,a.yK)((t=>{const n=(b.isMobile||e.smallerHeaders?1.25:l.Lh)*l.u9,o=b.isMobile||e.smallerHeaders?1.25:l.Lh;return{root:{display:"flex",width:"100%",...S},toggle:{height:`${n}em`,marginTop:b.isMobile?1:s.ZD.paddingTop,marginBottom:s.ZD.paddingBottom},headerText:{...s.ZD,...(0,l.HV)({fontSizeValue:o,fontFamily:k})},headerTextPlaceholder:{...x?{color:t.text.uiBlueTertiary,WebkitTextFillColor:"initial"}:{WebkitTextFillColor:t.headerBlockPlaceholderTextColor}}}}),[S,x,b.isMobile,k,e.smallerHeaders]);return(0,m.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"sub_header",getNode:()=>_.current,getBlockStore:()=>e.store,activate(){p.th(d,e.store,e.hideContent)}})),[d,e.hideContent,e.store]),(0,v.jsx)("div",{ref:_,style:{...I.root,...e.style},children:(0,v.jsxs)(h.Z,{store:e.store,toggleStyle:I.toggle,childrenStyleWhenToggleable:{display:"flex"},hideContent:e.hideContent,disabled:e.disabled,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,disableDrag:e.disableDrag,children:[(0,v.jsx)(f.Z,{tagName:"h3",disabled:e.disabled,store:w,placeholder:n.formatMessage(y.placeholder),placeholderStyle:I.headerTextPlaceholder,style:I.headerText,pasteBehavior:"block",legacyTransclusionParentStore:e.legacyTransclusionParentStore,inPageFind:u.B3.block_match,renderWhiteSpaceWhenEmptyOnAndroid:!0}),(0,v.jsx)(g.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store})]})}))}const _=o.memo(o.forwardRef(b),d.Z)},551704:(e,t,n)=>{n.d(t,{Z:()=>_});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(949271),l=n(176490),c=n(709291),d=n(926249),u=n(249394),p=n(635328),m=n(99340),g=n(523864),f=n(965187),h=n(17377),v=n(785893);const y=(0,c.defineMessages)({placeholder:{defaultMessage:"Heading 3",id:"subsubheaderBlock.placeholder"}});function b(e,t){const n=(0,c.useIntl)(),d=(0,r.O7)(),b=(0,r.Fy)(),_=(0,o.useRef)(null),S=(0,m.rv)(e.store,!0),k=(0,m.Iy)(e.store),w=(0,i.VK)((()=>e.store.getBlockTitleStore()),[e.store]),x=(0,i.VK)((()=>Boolean(e.store.getInsertSuggestion())),[e.store]),I=(0,a.yK)((t=>{const n=(b.isMobile||e.smallerHeaders?1.17:l.C)*l.u9,o=b.isMobile||e.smallerHeaders?1.17:l.C;return{root:{display:"flex",width:"100%",...S},toggle:{height:`${n}em`,marginTop:b.isMobile?1:s.ZD.paddingTop,marginBottom:s.ZD.paddingBottom},headerText:{...s.ZD,...(0,l.Jr)({fontSizeValue:o,fontFamily:k})},headerTextPlaceholder:{...x?{color:t.text.uiBlueTertiary,WebkitTextFillColor:"initial"}:{WebkitTextFillColor:t.headerBlockPlaceholderTextColor}}}}),[S,x,b.isMobile,k,e.smallerHeaders]);return(0,m.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"sub_sub_header",getNode:()=>_.current,getBlockStore:()=>e.store,activate(){p.th(d,e.store,e.hideContent)}})),[d,e.hideContent,e.store]),(0,v.jsx)("div",{ref:_,style:{...I.root,...e.style},children:(0,v.jsxs)(h.Z,{store:e.store,toggleStyle:I.toggle,childrenStyleWhenToggleable:{display:"flex"},hideContent:e.hideContent,disabled:e.disabled,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,disableDrag:e.disableDrag,children:[(0,v.jsx)(f.Z,{tagName:"h4",disabled:e.disabled,store:w,placeholder:n.formatMessage(y.placeholder),placeholderStyle:I.headerTextPlaceholder,style:I.headerText,pasteBehavior:"block",legacyTransclusionParentStore:e.legacyTransclusionParentStore,inPageFind:u.B3.block_match,renderWhiteSpaceWhenEmptyOnAndroid:!0}),(0,v.jsx)(g.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store})]})}))}const _=o.memo(o.forwardRef(b),d.Z)},940235:(e,t,n)=>{n.d(t,{Z:()=>d});n(667294);var o=n(724405),r=n(137810),i=n(164369),a=n(785893);const s={height:32,width:"100%"},l={paddingTop:8,paddingBottom:8},c={fontWeight:r.Z.fontWeight.regular,textAlign:"left",paddingTop:8,paddingBottom:8};const d=function(e){let{columns:t,rows:n,cellStyle:r,getCellStyle:d,tableStyle:m,rowStyle:g,tableBodyStyle:f,hideHeader:h,hideTopBorderForFirstRow:v,hideTopBorderForHeader:y}=e;const b=(0,o.Fg)();return(0,a.jsxs)("table",{style:{...u(b,y),...m},children:[!h&&(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{style:s,children:t.map((e=>(0,a.jsx)("th",{style:{...c,...e.style},children:(0,a.jsx)(i.Z,{isSmall:!0,children:e.header})},e.key)))})}),(0,a.jsx)("tbody",{style:f,children:n.map(((e,n)=>(0,a.jsx)("tr",{style:{...p(b),...0===n&&v?{borderTop:void 0}:{},...g},children:e.columns.map(((e,o)=>{const i=t[o];return(0,a.jsx)("td",{style:{...l,...r,...null==d?void 0:d({rowIndex:n,columnIndex:o})},children:e},i.key)}))},e.key)))})]})};function u(e,t){return{width:"100%",fontSize:13,borderTop:t?void 0:`1px solid ${e.regularDividerColor}`,borderBottom:`1px solid ${e.regularDividerColor}`}}function p(e){return{width:"100%",borderTop:`1px solid ${e.regularDividerColor}`}}},965187:(e,t,n)=>{n.d(t,{Z:()=>we});var o=n(667294),r=n(883355),i=n(701302),a=n(541432),s=n(222491),l=n(253877),c=n(842875),d=n(662193),u=n(449143),p=n(606746),m=n(421202),g=n(23867),f=n(421838),h=n(744805),v=n(116275),y=n(709291),b=n(531701),_=n(653965),S=n(619584),k=n(250906),w=n(800893),x=n(865770),I=n(800993),C=n(498724),T=n(56971),M=n(274284),P=n(617269),A=n(898104),R=n(632741),D=n(210228),B=n(801742),E=n(492022),F=n(286420),Z=n(947002),U=n(948514),V=n(296994),N=n(922705),O=n(360682),L=n(214976),j=n(120315),K=n(162619),z=n(249394),q=n(433929),H=n(268056),G=n(745162),W=n(489086),$=n(766638),Y=n(277907),Q=n(431559),J=n(704266),X=n(905162),ee=n(798180),te=n(708949),ne=n(316772),oe=n(400807),re=n(966949),ie=n(385555),ae=n(469316),se=n(152689),le=n(623178),ce=n(319111),de=n(206258),ue=n(186486),pe=n(599757),me=n(924666),ge=n(587244),fe=n(2679),he=n(129595),ve=n(693262),ye=n(487929),be=n(942402),_e=n(785893);const Se=(0,y.defineMessages)({typeTextPlaceholder:{defaultMessage:"Press ‘/’ for commands…",id:"text.commandsMenuNotOpen.placeholder"},horizon1Placeholder:{defaultMessage:"Write something, or press 'space' for AI, ' / ' for commands…",id:"text.horizon1.placeholder"},typeAiTextPlaceholder:{defaultMessage:"Press ‘space’ for AI, ‘/’ for commands…",id:"text.commandsMenuNotOpen.placeholder.ai"},typeTextAiPlaceholder:{defaultMessage:"Press ‘/’ for commands, ‘space’ for AI…",id:"text.commandsMenuNotOpen.placeholder.textAi"},filterPlaceholder:{defaultMessage:"Type to filter…",id:"text.commandsMenuOpen.placeholder"},nativeMABFilterInsert:{defaultMessage:"Insert",id:"text.nativeMABFilter.insert"},nativeMABFilterTurnInto:{defaultMessage:"Turn into",id:"text.nativeMABFilter.turnInto"}});class ke extends r.Z{constructor(e){super(e),this.editor=null,this.mergeEditorRefs=(0,d.sH)(),this.triggeredAnalytics=!1,this.reminderTimers={},this.shouldRenderEditable2Store=this.createComputedStore((()=>ie.default.checkGate({gateName:"docs_function_editable"}))),this.onTutorialNextButtonClick=()=>{if(!J.Z.state.open&&!this.props.disableSlashCommands){const e=me.default.state;"editing"===e.mode&&D.createAndCommit({userAction:"TourTutorial.slashTooltip",environment:this.environment,perform:t=>{I.hJ({environment:this.environment,editorMode:this.getEditorMode(),string:Q.$t,multiSelection:e.multiSelection,disableMentions:!0,disableSlashCommands:!1,disableEmojiCommands:!0,transaction:t})}})}},this.renderContentContainer=(e,t)=>{const n=(0,_e.jsx)(he.Z,{...this.classNameAndStyleStore.state,onBlur:this.props.onBlur,onFocus:this.props.onFocus,getDisabled:this.getDisabled,spellCheck:!this.canExclusivelyComment(),getHtml:this.getHtml,getSelection:this.getContainerSelection,onMutation:this.handleMutation,onCompositionStart:()=>{return e=this.props.onChange,t=this.environment,A.setSelectionComposing(t,!0),void(e&&e());var e,t},onCompositionEnd:this.handleCompositionEnd,onSelect:t,placeholder:this.getCurrentPlaceholder(),onMouseOver:this.handleMouseOver,onMouseOut:this.handleMouseOut,suppressNewlineEvents:!0,disableContentEditableWhenNotEditingTextOnMobile:!0,expandSelectionOnTripleClick:!0,id:this.props.id,tagName:this.props.tagName,...e,ref:this.mergeEditorRefs(this.handleEditorRef,e.leafRef)});return this.isPageContentForTourTutorial()?(0,_e.jsx)(ge.N,{step:"create_page_type_slash",showSidebarOverlays:!1,onNextButtonClick:this.onTutorialNextButtonClick,children:n}):n},this.handleEditorRef=e=>{this.editor=e},this.isSpaceComposition=()=>{if(!this.shouldRenderInteractiveAiPlaceholderStore.state)return!1;const e=f.eeV(this.getTextValue());return 1===e.length&&(" "===e[0]||" "===e[0])},this.handleCompositionEnd=()=>{A.setSelectionComposing(this.environment,!1),"suggest"!==this.getEditorMode()&&I.g2({environment:this.environment,store:this.props.store,usingMultiSelection:!0}),this.props.onChange&&this.props.onChange(),this.isSpaceComposition()?E.toggleInitialPrompt({from:"spacebar",environment:this.environment}):D.createAndCommit({userAction:"Text.runAllFiltersAfterCompositionEnd",environment:this.environment,perform:e=>{this.props.disableFilters||P.G({environment:this.environment,store:this.props.store,editorMode:this.getEditorMode(),transaction:e})}})},this.handleDelete=e=>{if(!this.canEditStore.state)return;if(this.editor&&this.editor.isComposing())return;this.logTypingLag("typing_delete");const{store:t}=this.props,n=me.default.state;if("editing"===n.mode){const o=n.multiSelection;if(o.start.store===t){const t=this.getEditorMode();D.createAndCommit({userAction:"Text.handleDelete",environment:this.environment,perform:n=>{T.as({environment:this.environment,multiSelection:o,deleteForwards:!0,transaction:n,event:e,editorMode:t})}})}}Ie(),this.props.onChange&&this.props.onChange()},this.handleForwardDeleteAtEndOfLine=e=>{if(!this.canEditStore.state)return;if(this.editor&&this.editor.isComposing())return;const{store:t}=this.props,n=me.default.state;if("editing"!==n.mode)return;const o=n.multiSelection;(0,H.iG)(o)&&(0,W.J_)(t,{startIndex:o.start.index,endIndex:o.end.index})&&this.handleDelete(e)},this.handleBackspace=e=>{if(!this.canEditStore.state||this.editor&&this.editor.isComposing())return;this.logTypingLag("typing_backspace");const{store:t}=this.props,n=me.default.state;if("editing"===n.mode){const o=n.multiSelection;if(o.start.store===t){if(T.YV({device:this.environment.device,event:e,multiSelection:o}))return;const t=this.getEditorMode();D.createAndCommit({userAction:"Text.handleBackspace",environment:this.environment,perform:n=>{T.as({environment:this.environment,multiSelection:o,deleteForwards:!1,transaction:n,event:e,editorMode:t})}})}}Ie(),this.props.onChange&&this.props.onChange(e)},this.handleEnter=e=>{if(!this.canEditStore.state)return;if(this.logTypingLag("typing_enter"),K.IL(e),this.editor&&this.editor.isComposing())return;const t=me.default.state;if("editing"===t.mode)if(this.props.onEnter)this.props.onEnter(e);else{const{multiSelection:e}=t;D.createAndCommit({userAction:"Text.handleEnter",environment:this.environment,perform:t=>{M.IO({environment:this.environment,editorMode:this.getEditorMode(),multiSelection:e,transaction:t})}}),Ie()}this.props.onChange&&this.props.onChange(e)},this.handleShiftEnter=e=>{if(!this.canEditStore.state)return;if(this.editor&&this.editor.isComposing())return;const t=me.default.state;if("editing"===t.mode){const{device:n}=this.environment;if(!("shiftKey"in e)||e.shiftKey&&!n.isIOS){if(this.props.disableShiftEnter)return;D.createAndCommit({userAction:"Text.handleShiftEnter",environment:this.environment,perform:e=>{I.hJ({environment:this.environment,editorMode:this.getEditorMode(),string:"\n",multiSelection:t.multiSelection,disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,transaction:e,mentionSectionOrdering:this.props.mentionSectionOrdering})}}),this.props.onChange&&this.props.onChange(e)}else this.handleEnter(e)}},this.handleTab=e=>{if(this.canEditStore.state)if("suggest"!==this.getEditorMode()){if(this.logTypingLag("typing_tab"),this.props.onTab){this.props.onTab(e)||e.preventDefault()}else e.preventDefault(),D.createAndCommit({userAction:"Text.handleTab",environment:this.environment,perform:e=>{I.n2({environment:this.environment,shiftKey:!1,transaction:e})}}),Ie();this.props.onChange&&this.props.onChange()}else e.preventDefault()},this.handleUntab=e=>{if(this.canEditStore.state)if("suggest"!==this.getEditorMode()){if(this.logTypingLag("typing_untab"),this.props.onUntab){this.props.onUntab(e)||e.preventDefault()}else e.preventDefault(),D.createAndCommit({userAction:"Text.handleUntab",environment:this.environment,perform:e=>{I.n2({environment:this.environment,shiftKey:!0,transaction:e})}}),Ie();this.props.onChange&&this.props.onChange()}else e.preventDefault()},this.handleAnnotation=(e,t)=>{this.canEditStore.state&&(t.preventDefault(),C.aS({environment:this.environment,annotation:e}),Ie(),this.props.onChange&&this.props.onChange(),k.du(this.environment,{type:f.J7s(e)}))},this.handleToggleHighlight=e=>this.handleAnnotation(["h",se.Z.state.color],e),this.handleToggleBold=e=>this.handleAnnotation(["b"],e),this.handleToggleItalics=e=>this.handleAnnotation(["i"],e),this.handleToggleStrike=e=>this.handleAnnotation(["s"],e),this.handleToggleUnderline=e=>this.handleAnnotation(["_"],e),this.handleToggleCode=e=>this.handleAnnotation(["c"],e),this.handleClick=e=>{this.handleClickActions(e),this.props.onClick&&this.props.onClick(e)},this.handleContextMenu=e=>{const t=this.parentBlockStore.state;t&&L.li({environment:this.environment,event:e,textValue:this.getTextValue(),editorNode:this.getEditorNode(),store:this.props.store,parentStore:t,canEdit:this.canEditStore.state})},this.handleMouseOver=e=>{L.vO({environment:this.environment,event:e,textValue:this.getTextValue(),editorNode:this.getEditorNode(),store:this.props.store,parentStore:this.props.parentStore,canEdit:this.canEditStore.state})},this.handleMouseOut=e=>{L.kV({environment:this.environment,event:e,textValue:this.getTextValue(),editorNode:this.getEditorNode(),store:this.props.store,parentStore:this.props.parentStore,canEdit:this.canEditStore.state})},this.handleCut=e=>{if(this.canEditStore.state){if(this.props.onCut)return this.props.onCut(e),void Ie();w.by({environment:this.environment,event:e,markdownLinkifyIt:this.props.markdownLinkifyIt}),Ie(),this.props.onChange&&this.props.onChange()}else e.preventDefault()},this.handlePaste=e=>{this.canEditStore.state&&(D.createAndCommit({userAction:"Text.handlePaste",environment:this.environment,perform:t=>{w.v({environment:this.environment,event:e,disableEmbedMenu:Boolean(this.props.disableEmbedMenu),transaction:t,onPasteFiles:this.props.onPasteFiles||w.AL,markdownLinkifyIt:this.props.markdownLinkifyIt,tinyMceMicrosoftWordPasteFilter:this.props.tinyMceMicrosoftWordPasteFilter})}}),Ie(),this.props.onChange&&this.props.onChange())},this.handleKeyPress=e=>{const t=this.parentBlockStore.state,n=t&&t.getType(),o=Boolean(n&&(0,a.hD)(n));if(" "===e.key&&!e.shiftKey&&!e.ctrlKey&&!e.altKey&&this.isEmpty()&&(this.shouldRenderInteractiveAiPlaceholderStore.state||this.isHorizon1PlaceholderEnabledStore.state)&&!this.props.store.inMemoryRecordCache.isMockTextStore&&o)return e.preventDefault(),void E.toggleInitialPrompt({from:"spacebar",environment:this.environment});this.canEditStore.state||e.metaKey&&"c"===e.key||e.preventDefault()},this.handleCopy=e=>{!function(e,t,n,o){if(t)return void t(e);w.JG({environment:o,event:e,markdownLinkifyIt:n})}(e,this.props.onCopy,this.props.markdownLinkifyIt,this.environment)},this.handleMoveUp=e=>{!function(e,t){e.preventDefault(),D.createAndCommit({userAction:"Text.handleMoveUp",environment:t,perform:e=>{I.fs({environment:t,transaction:e,direction:"up"})}})}(e,this.environment)},this.handleMoveDown=e=>{var t;t=this.environment,D.createAndCommit({userAction:"Text.handleMoveDown",environment:t,perform:e=>{I.fs({environment:t,transaction:e,direction:"down"})}})},this.aiTextPlaceholderMessageStore=this.createComputedStore((()=>"on"===ie.default.getEligibleGroup({experimentId:"prioritize_slash_menu_block_placeholder",defaultGroup:"control"})?q.default.formatMessage(Se.typeTextAiPlaceholder):q.default.formatMessage(Se.typeAiTextPlaceholder)),{debugName:"aiTextPlaceholderMessageStore"}),this.isRightMarginCommentActionHoveredStore=this.createComputedStore((()=>{if(!Z.Z.state.isHovered||"right_margin_button"!==Z.Z.state.hoverEntryPoint)return!1;const e=ue.default.state,t=e.isOpen?e.currentStore:void 0;return(null==t?void 0:t.id)===this.props.store.id})),this.inPageFindFocusedResultStore=this.createComputedStore((()=>{if("none"===this.props.inPageFind.type)return;const e=ae.V8.state;return(0,z.yy)(e)&&e.id===this.props.store.id?e:void 0}),{debugName:"inPageFindFocusedResultStore"}),this.canEditStore=this.createComputedStore((()=>{if(this.props.disabled)return!1;if(pe.n.state)return!1;const e=this.pageContext&&this.pageContext.publicEditModeStore.state;return(!this.props.isDiscussionInput||null==e||!e.hasPublicPermission||"view"!==e.permission)&&(!(!this.props.isDiscussionInput&&null!=e&&e.hasPublicPermission&&"edit"!==e.permission)&&(!(!this.props.store.canComment()||"suggest"!==this.getEditorMode())||this.props.store.canEdit()))}),{debugName:"canEditStore"}),this.getDisabled=()=>!this.canEditStore.state,this.getHtml=()=>{var e,t,n;const r=Boolean(this.addLineBreakSuggestionStore.state),i=(null===(e=this.addLineBreakSuggestionStore.state)||void 0===e?void 0:e.discussionId)||(null===(t=this.removeLineBreakSuggestionStore.state)||void 0===t?void 0:t.discussionId);let a=this.getTextValue(),s=!1;if(this.props.canTruncate&&void 0!==this.props.maxChars){f.eeV(a).length>this.props.maxChars&&(a=f.KU1(this.getTextValue(),0,this.props.maxChars),s=!0)}if(Boolean(this.props.renderWhiteSpaceWhenEmptyOnAndroid)&&this.environment.device.isAndroid&&(0,X.Y)("supportsAndroidEmptyLineSelectionNode")&&this.isEmpty())return"<br />";const l=L.IY({environment:this.environment,textValue:a&&{value:a,spaceId:(0,g.C)(this.props.store.pointer.spaceId)},parentStore:this.props.parentStore||this.props.store,disableHover:!1,disableStyleAnnotations:Boolean(this.props.disableStyleAnnotations),disableInsertedDeletedAnnotations:Boolean(this.props.disableInsertedDeletedAnnotations),disableDateStyleAnnotations:Boolean(this.disabledMentionTypesStore.state.date),disableSuggestionAnnotations:Boolean(this.props.disableSuggestionAnnotations),disableCommentAnnotations:this.props.disableComment??!1,disabled:!this.canEditStore.state,theme:this.theme,emojiType:(0,O.e_)(this.environment),katex:this.environment.KatexStore.getKatex(),parentBlockId:Ce(this.props.store),renderedPageBlockId:null===(n=this.pageContext)||void 0===n?void 0:n.pageStore.id,formulaValueTypes:this.props.formulaValueTypes??[]}),c=(0,_e.jsxs)(o.Fragment,{children:[l,s&&(d=this.theme,(0,_e.jsxs)(be.Z,{disableUnderline:!0,style:{color:d.mediumTextColor},onClick:e=>{e.preventDefault(),e.stopPropagation()},children:["…",(0,_e.jsx)("span",{children:(0,_e.jsx)(y.FormattedMessage,{id:"text.truncated.showMoreLabel",defaultMessage:"more"})})]})),i&&Te(this.theme,r?"add":"remove",i)]});var d;return p.Z.renderToStaticMarkup(c)},this.clearBrowserSelection=()=>{var e;null===(e=this.getEditorNode())||void 0===e||e.blur()},this.getTextValue=()=>[this.getTextValueHelper()].map((e=>L.Rl({store:this.props.store,textValue:e}))).map(this.applyTemporarySuggestRemovalAnnotation).map(this.applyTemporarySuggestInsertAnnotation)[0],this.applyTemporarySuggestRemovalAnnotation=e=>{const t=this.blockRemoveSuggestionStore.state;return e&&t?L.XG({textValue:e,discussionId:t.discussionId}):e},this.applyTemporarySuggestInsertAnnotation=e=>{const t=this.blockInsertSuggestionStore.state;return e&&t?L.zO({textValue:e,discussionId:t.discussionId}):e},this.getTextValueHelper=()=>{if(this.isNewDiscussionMenuTargetStore.state)return L.Gj({store:this.props.store});if(this.props.hasTemporaryDiscussionOnProperty){const e=U.Z.getMultiSelection(),t=this.props.store.getValue();if(e)return f.WO0({textValue:t,selection:{startIndex:e.start.index,endIndex:e.end.index},annotation:[f.GKr.TemporaryComment]});if("block"===U.Z.getType()){const e=f.eeV(this.props.store.getValue());return f.WO0({textValue:t,selection:{startIndex:0,endIndex:e.length},annotation:[f.GKr.TemporaryComment]})}}if(this.isInlineEquationOverlayTargetStore.state)return L.PY({store:this.props.store,equationStore:re.Z});if(this.isMentionMenuTargetStore.state)return L.Ob({store:this.props.store,mentionMenuState:this.isMentionMenuTargetStore.state});if(this.isRightMarginCommentActionHoveredStore.state&&!this.props.disableRightMarginHoverStyling){const e=f.eeV(this.props.store.getValue());return L.fm({store:this.props.store,temporaryAnnotation:f.GKr.TemporarySelection,multiSelection:{start:{store:this.props.store,index:0},end:{store:this.props.store,index:e.length}}})}if(this.isMobileNativeSlashMenuTargetStore.state)return L.R9({store:this.props.store,slashMenuState:this.isMobileNativeSlashMenuTargetStore.state,hint:q.default.formatMessage(this.isMobileNativeSlashMenuTargetStore.state.isAddMenu?Se.nativeMABFilterInsert:Se.nativeMABFilterTurnInto)});if(this.linkingMenuSelectionStore.state)return L.So({store:this.props.store,selection:this.linkingMenuSelectionStore.state});if(ae.l9.state&&"none"!==this.props.inPageFind.type&&!this.props.store.inMemoryRecordCache.isSyntheticAssistantData){return L.cD({textValue:this.props.store.getValue(),blockId:this.props.store.id,textProps:this.props.inPageFind,find:ae.l9.state,currentFocusedResult:this.inPageFindFocusedResultStore.state})}if(this.isCompletionPopupTargetStore.state)return L.fm({store:this.props.store,temporaryAnnotation:f.GKr.TemporarySelection,multiSelection:xe()});const e=this.pageAnnotationBlockMenuStore.state;if(e)return e;if(this.isEditingStore.state){const e=me.default.state;if("editing"===e.mode){const t=(0,H.QY)(e.multiSelection);if(t)return L.xX({store:this.props.store,selection:t.selection})}}return this.props.store.getValue()},this.parentBlockStore=this.createComputedStore((()=>{const{store:e}=this.props;if(e.pointer.table===m.iU)return de.G.createChildStore(e,e.pointer)}),{debugName:"parentBlockStore"}),this.isEditingStore=this.createComputedStore((()=>(0,W.J5)(this.props.store)),{debugName:"isEditing"}),this.isSelectionEndpointStore=this.createComputedStore((()=>Boolean(this.isEditingStore.state)),{debugName:"isSelectionEndpoint"}),this.isCompletionsEnabledStore=this.createComputedStore((()=>{var e;const t=null===(e=this.pageContext)||void 0===e?void 0:e.publicEditModeStore.state;return(0,j.GD)(t)}),{debugName:"isCompletionsEnabledStore"}),this.shouldRenderInteractiveAiPlaceholderStore=this.createComputedStore((()=>{if(this.isHorizon1PlaceholderEnabledStore.state)return!1;if(this.environment.device.isMobile||this.environment.device.isMobileNative)return!1;if(this.props.disabled)return!1;if(!this.isCompletionsEnabledStore.state)return!1;const e=this.parentBlockStore.state,t=e&&e.getType();return Boolean(t&&(0,a.hD)(t))&&"contains-selection"===this.isEditingStore.state&&!(e&&(0,F.t)(e))}),{debugName:"shouldRenderInteractiveAiPlaceholder"}),this.isHorizon1PlaceholderEnabledStore=this.createComputedStore((()=>!!this.isCompletionsEnabledStore.state&&!this.environment.device.isMobile),{debugName:"isHorizon1PlaceholderEnabled"}),this.isNewDiscussionMenuTargetStore=this.createComputedStore((()=>{const e=U.Z.state;return"on"===ie.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0})&&U.Z.calculateMultitextSelection(),e.open&&"inline"===e.type&&Boolean((0,G.r)(e.multiSelection,this.props.store))}),{debugName:"isNewDiscussionMenuTarget"}),this.blockInsertSuggestionStore=this.createComputedStore((()=>{var e;return null===(e=this.parentBlockStore.state)||void 0===e?void 0:e.getInsertSuggestion()}),{debugName:"blockInsertSuggestion"}),this.blockRemoveSuggestionStore=this.createComputedStore((()=>{var e;return null===(e=this.parentBlockStore.state)||void 0===e?void 0:e.getRemoveSuggestion()}),{debugName:"blockRemoveSuggestion"}),this.addLineBreakSuggestionStore=this.createComputedStore((()=>{var e;return null===(e=this.parentBlockStore.state)||void 0===e?void 0:e.getAddLineBreakSuggestion()}),{debugName:"addLineBreakSuggestionStore"}),this.removeLineBreakSuggestionStore=this.createComputedStore((()=>{var e;return null===(e=this.parentBlockStore.state)||void 0===e?void 0:e.getRemoveLineBreakSuggestion()}),{debugName:"removeLineBreakSuggestionStore"}),this.isCompletionPopupTargetStore=this.createComputedStore((()=>{const e=xe();if(!e)return!1;const t=ne.default.state;if("assistantCompletionPopup"===t.type){const e=ee.default.getSessionContext(t.sessionId);if(e&&(e.getCombinedSteps().length>0||e.getAllPendingOperations().length>0))return!1}return Boolean((0,G.r)(e,this.props.store))}),{debugName:"isCompletionPopupTarget"}),this.isInlineEquationOverlayTargetStore=this.createComputedStore((()=>{var e;return re.Z.isOpen()&&(null===(e=(0,H.QY)(re.Z.state.savedTextSelectionState.multiSelection))||void 0===e?void 0:e.store)===this.props.store}),{debugName:"isInlineEquationOverlayTarget"}),this.isMentionMenuTargetStore=this.createComputedStore((()=>{const e=ce.Z.state;return!!e.open&&(e.textStore===this.props.store&&e)}),{debugName:"isMentionMenuTarget"}),this.isMobileNativeSlashMenuTargetStore=this.createComputedStore((()=>{if(!(0,X.Y)("supportsNativeMobileDynamicActionBar"))return!1;const e=J.Z.state;return!!e.open&&e}),{debugName:"isMobileNativeSlashMenuTarget"}),this.linkingMenuSelectionStore=this.createComputedStore((()=>{const e=le.Z.state;if(!e.open)return!1;if(!e.focusLinkInput&&!e.focusTitleInput)return!1;if(!this.isEditingStore.state)return!1;const t=(0,H.QY)(e.savedTextSelectionState.multiSelection);return!!t&&t.selection}),{debugName:"linkingMenuSelectionStore"}),this.pageAnnotationBlockMenuStore=this.createComputedStore((()=>{const e=te.Z.state;if(!e.isActive)return;const{clickedPageAnnotation:t}=e;if(!t)return;const{parentStore:n,pageAnnotation:o}=t;if(n!==this.parentBlockStore.state)return;const r=this.props.store.getValue();return r?null==r?void 0:r.map((e=>f.km_(e)?[e[0],e[1].flatMap((e=>f.STW(e)&&e===o?[o,f.EPB()]:[e]))]:e)):void 0}),{debugName:"pageAnnotationBlockMenuStore"}),this.disabledMentionTypesStore=this.createComputedStore((()=>(0,u.lU)(this.props.disabledMentionTypes)),{useDeepEqual:!0}),this.getContainerSelection=()=>{const e=Boolean(this.linkingMenuSelectionStore.state);if(this.isSelectionEndpointStore.state){if(e)return;if(ie.default.checkGate({gateName:"show_slash_menu_v2"})&&J.Z.state.open)return;return(0,W.HE)(this.props.store)}if(this.isEditingStore.state&&!e){const{store:e}=this.props,t=me.default.state;if("editing"===t.mode){const n=(0,G.xI)("Text",t.multiSelection);if(n){const{selection:t}=n,o=e.getValue(),r=f.eeV(o).length;return{type:"contain",selection:{startIndex:Math.min(t.startIndex,r),endIndex:Math.min(t.endIndex,r)}}}}}},this.getEndSelection=()=>{const e=f.eeV(this.getTextValue());return{startIndex:e.length,endIndex:e.length}},this.classNameAndStyleStore=this.createComputedStore((()=>(0,s.iv)(this.getStyle(),this.props.className)),{debugName:"classNameAndStyleStore"}),this.handleMutation=this.handleMutation.bind(this)}UNSAFE_willMountOrUpdate(){this.createReminderTimers(),this.environment.KatexStore.loadIfNeeded(this.getTextValue)}willUnmount(){this.clearReminderTimers(),R.qA(this.props.store)}isComposing(){return this.editor&&this.editor.isComposing()}createReminderTimers(){const e=this.getTextValue(),t=f.nai(e),n=_.oA(t.map((e=>{const t=(0,l.KR)(e,(0,c.r)());return null==t?void 0:t.toMillis()}))),o=Date.now();for(const r of n){const e=r-o;e>0&&e<S.A0&&(r in this.reminderTimers||(this.reminderTimers[r]=setTimeout(this.enqueueForceUpdate,e)))}for(const r in this.reminderTimers)n.includes(parseInt(r))||(clearTimeout(this.reminderTimers[r]),delete this.reminderTimers[r])}clearReminderTimers(){for(const e in this.reminderTimers)clearTimeout(this.reminderTimers[e]),delete this.reminderTimers[e]}renderComponent(){const{disableInsertText:e,disableStyleAnnotations:t,disableSelectAllBlocks:n,disableSelectionDrag:o,disableDrag:r,disabled:i}=this.props;return this.shouldRenderEditable2Store.state?(0,_e.jsx)(ye.Z,{...this.props,clearBrowserSelection:this.clearBrowserSelection,getEndSelection:this.getEndSelection,canInsertText:!i&&!e,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onDelete:this.handleDelete,onDeleteToEndOfLine:this.handleForwardDeleteAtEndOfLine,onDeleteNextWord:this.handleForwardDeleteAtEndOfLine,onBackspace:this.handleBackspace,onEnter:this.handleEnter,onShiftEnter:this.handleShiftEnter,onTab:this.handleTab,onUntab:this.handleUntab,onToggleHighlight:this.handleToggleHighlight,onToggleBold:this.handleToggleBold,onToggleItalics:this.handleToggleItalics,onToggleStrike:this.handleToggleStrike,onToggleUnderline:this.handleToggleUnderline,onToggleCode:this.handleToggleCode,onCopy:this.handleCopy,onCut:this.handleCut,onPaste:this.handlePaste,onKeyPress:this.handleKeyPress,onMoveUp:this.handleMoveUp,onMoveDown:this.handleMoveDown,render:this.renderContentContainer,disableStyleAnnotations:t,canSelectAllBlocks:!n,canSelectionDrag:!o,disableDrag:r,topBottomPadding:9}):(0,_e.jsx)(ve.Z,{...this.props,clearBrowserSelection:this.clearBrowserSelection,getEndSelection:this.getEndSelection,canInsertText:!i&&!e,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onDelete:this.handleDelete,onDeleteToEndOfLine:this.handleForwardDeleteAtEndOfLine,onDeleteNextWord:this.handleForwardDeleteAtEndOfLine,onBackspace:this.handleBackspace,onEnter:this.handleEnter,onShiftEnter:this.handleShiftEnter,onTab:this.handleTab,onUntab:this.handleUntab,onToggleHighlight:this.handleToggleHighlight,onToggleBold:this.handleToggleBold,onToggleItalics:this.handleToggleItalics,onToggleStrike:this.handleToggleStrike,onToggleUnderline:this.handleToggleUnderline,onToggleCode:this.handleToggleCode,onCopy:this.handleCopy,onCut:this.handleCut,onPaste:this.handlePaste,onKeyPress:this.handleKeyPress,onMoveUp:this.handleMoveUp,onMoveDown:this.handleMoveDown,render:this.renderContentContainer,disableStyleAnnotations:t,canSelectAllBlocks:!n,canSelectionDrag:!o,disableDrag:r,topBottomPadding:9})}getCurrentPlaceholder(){var e;const{device:t}=this.environment;if(this.shouldRenderInteractiveAiPlaceholderStore.state)return this.aiTextPlaceholderMessageStore.state;if(this.props.placeholder)return this.props.placeholder;if(this.props.disabled||N.TI.state&&this.props.store.id===(null===(e=N.P7.state)||void 0===e?void 0:e.id))return" ";if(!this.props.disableSlashCommands&&"contains-selection"===this.isEditingStore.state&&this.canEditStore.state){if(J.Z.state.open)return q.default.formatMessage(Se.filterPlaceholder);if(!t.isMobile)return this.isHorizon1PlaceholderEnabledStore.state?q.default.formatMessage(Se.horizon1Placeholder):q.default.formatMessage(Se.typeTextPlaceholder)}return" "}isPageContentForTourTutorial(){const{device:e}=this.environment;return!!(0,fe.tourIsActive)(fe.default.state)&&!(this.props.disableSlashCommands||"contains-selection"!==this.isEditingStore.state||!this.canEditStore.state||e.isMobile)}handleMutation(e){if(this.logTypingLag("typing_lag"),!this.canEditStore.state)return;D.createAndCommit({userAction:"Text.handleMutation",environment:this.environment,perform:t=>{let n=this.props.store;const{multiSelection:o}=e;if(o&&!(0,H.qS)(o))n=o.start.store;else if(this.props.legacyTransclusionParentStore&&!e.insertedLine&&!e.isComposing&&!e.deletedLine){const e=x.Z({environment:this.environment,store:n,parentStore:this.props.legacyTransclusionParentStore,transaction:t});e&&(n=e)}if(I.YV({environment:this.environment,store:n,newValue:e.newValue,editorMode:this.getEditorMode(),disableMentions:Boolean(this.props.disableMentions),disabledMentionTypes:this.disabledMentionTypesStore.state,disableSlashCommands:Boolean(this.props.disableSlashCommands),disableEmojiCommands:Boolean(this.props.disableEmojiCommands),disableFilters:this.props.disableFilters||e.isComposing,transaction:t,multiSelection:o,usePopupForMentionOnMobile:this.props.usePopupForMentionOnMobile,mentionSectionOrdering:this.props.mentionSectionOrdering}),e.insertedLine){const e="editing"===me.default.state.mode&&me.default.state.multiSelection;e&&M.IO({environment:this.environment,editorMode:this.getEditorMode(),multiSelection:e,transaction:t})}this.props.trackEditsToUserFlow&&!t.isEmpty()&&B.uO(this.environment,this.props.trackEditsToUserFlow,t)}});const{store:t}=this.props,n=this.parentBlockStore.state;if(n){if(n.getType()){const e=n.getSchema()||{};if("properties"===t.path[0]&&t.path[1]){e[t.path[1]]&&!this.triggeredAnalytics&&(this.triggeredAnalytics=!0)}}}this.props.onChange&&this.props.onChange()}getEditorMode(){var e,t;return this.props.isDiscussionInput||this.props.disableSuggestEdit?"default":null!==(e=this.pageContext)&&void 0!==e&&e.pageStore?oe.Z.getMode(null===(t=this.pageContext)||void 0===t?void 0:t.pageStore):"default"}handleClickActions(e){L.SD({environment:this.environment,event:e,textValue:this.getTextValue(),editorNode:this.getEditorNode(),store:this.props.store,parentStore:this.props.parentStore,canEdit:this.canEditStore.state,disableEquationInteraction:this.props.disableEquationInteraction})}canExclusivelyComment(){return e=this.props.disabled,t=this.props.store,!e&&t.canComment()&&!this.canEditStore.state;var e,t}focus(){this.isEditingStore.state||this.props.disableMoveCursorToEndOnFocus||A.setSelectionAtEnd({store:this.props.store})}getEditorNode(){var e;return(null===(e=this.editor)||void 0===e?void 0:e.getNode())||void 0}isEmpty(){return 0===f.lzi(this.getTextValue()).length}logTypingLag(e){const t=!this.props.disabled&&"inline"===this.props.pasteBehavior;(0,$.u)({type:e,environment:this.environment,blockStore:this.parentBlockStore.state,store:this.props.store,isInCollectionView:t})}getStyle(){const{device:e}=this.environment;let t={maxWidth:"100%",width:"100%",whiteSpace:"pre-wrap",wordBreak:"break-word",caretColor:this.canExclusivelyComment()?b.ZP.transparent:this.theme.regularTextColor,...this.props.style};return this.isEmpty()&&(t.minHeight="1em",t={...t,color:this.theme.regularTextColor,WebkitTextFillColor:this.theme.lightTextColor,...this.props.placeholderStyle}),e.isMobile&&this.canEditStore.state&&(this.isEditingStore.state?t.WebkitUserModify="read-write-plaintext-only":(t.userSelect="none",t.WebkitUserSelect="none",t.whenFocusedEditable={userSelect:"text",WebkitUserSelect:"text",WebkitUserModify:"read-write-plaintext-only"})),t}}ke.displayName="Text";const we=o.forwardRef((function(e,t){const{value:n}=(0,Y.XJ)(V.FF.markdownLinkifyIt),{value:o}=(0,Y.XJ)(V.FF.tinyMceMicrosoftWordPasteFilter);return(0,_e.jsx)(ke,{...e,ref:t,markdownLinkifyIt:n,tinyMceMicrosoftWordPasteFilter:o})}));function xe(){const e=ne.default.state;return("closedWithContext"===e.type||"completionPopup"===e.type&&"initialPromptForAIBlock"!==e.stage||"assistantCompletionPopup"===e.type)&&"textSelection"===e.context.type?e.context.textSelection:void 0}function Ie(){i.default.flush()}function Ce(e){if(e.table===m.iU)return e.id;const{ancestor:t}=e.findRecordStoreUIAncestor((e=>{let{table:t}=e;return t===m.iU}));return t?t.id:void 0}function Te(e,t,n){const o={textDecoration:"add"===t?"":"line-through",WebkitTextFillColor:"initial",..."add"===t?(0,h.sZ)(e):(0,h.sM)(e)},r=(0,s.Ws)({type:"add"===t?"update":"remove"}),i=(0,s.dk)({discussionId:n});return(0,_e.jsx)("span",{style:o,className:`${v.DK} ${v.kB} ${r} ${i}`,children:`${f.aVG}`})}},817970:(e,t,n)=>{n.d(t,{Z:()=>h});var o=n(667294),r=n(886628),i=n(724405),a=n(949271),s=n(926249),l=n(249394),c=n(99340),d=n(385555),u=n(523864),p=n(630915),m=n(965187),g=n(785893);function f(e,t){let{disabled:n,disableCommentMenu:s,disableHoverMenu:f,disableDrag:h,hideContent:y,isFirstItem:b,legacyTransclusionParentStore:_,store:S,style:k}=e;const w=(0,r.VK)((()=>S.getBlockTitleStore()),[S]),x=(0,r.VK)((()=>S.getContentStore()),[S]),I=(0,o.useRef)(null),C=(0,r.VK)((()=>x.getValue()||[]),[x]),T=(0,r.VK)((()=>{if(!d.default.checkGate({gateName:"text_align"}))return{};const{block_alignment:e}=S.getFormat();switch(e){case"right":case"center":return{textAlign:S.getFormat().block_alignment};default:return{textAlign:"left"}}}),[S]),M=(0,r.VK)((()=>{if(!d.default.checkGate({gateName:"text_align"}))return{};const{block_alignment:e}=S.getFormat();switch(e){case"center":return{textAlign:"left",paddingLeft:"50%"};case"right":return{textAlign:"right"};default:return{textAlign:"left"}}}),[S]),P=(0,c.rv)(S),A=(0,r.VK)((()=>{if(d.default.checkGate({gateName:"display_crdt_block_client"})&&S.useCrdt())return{border:"1px dashed green"}}),[S]),R=(0,i.yK)((()=>({root:{...T,...P,...A,...k}})),[T,P,A,k]),D=C.length>0?(0,g.jsx)("div",{style:v,children:(0,g.jsx)(p.Z,{disabled:n,store:x,disableCommentMenu:s,disableHoverMenu:f,disableDrag:h})}):(0,g.jsx)(p.Z,{disabled:!0,store:x}),B=(0,r.VK)((()=>{var e,t;if(!d.default.checkGate({gateName:"docs_simplify_placeholder_new_users"})&&!d.default.checkGate({gateName:"docs_simplify_placeholder_existing_users"}))return;return b&&(null===(e=S.getParentBlockStore())||void 0===e?void 0:e.isPageBlock())&&1===(null===(t=S.getParentBlockStore())||void 0===t?void 0:t.getContentLength())?void 0:" "}),[b,S]),E=(0,g.jsxs)("div",{style:R.root,ref:I,children:[(0,g.jsxs)("div",{style:{display:"flex"},children:[(0,g.jsx)(m.Z,{style:a.ZD,placeholder:B,placeholderStyle:M,disabled:n,store:w,pasteBehavior:"block",legacyTransclusionParentStore:_,trackEditsToUserFlow:"user_flow_edit_block",inPageFind:l.B3.block_match,renderWhiteSpaceWhenEmptyOnAndroid:!0}),(0,g.jsx)(u.Z,{disableCommentMenu:s,hideContent:y,store:S})]}),!y&&D]});return(0,c.ez)(S,t,(0,o.useMemo)((()=>({renderedType:"text",getBlockStore:()=>S,getNode:()=>I.current})),[S]),E)}const h=o.memo(o.forwardRef(f),s.Z),v={paddingLeft:"1.5em",display:"flex",flexDirection:"column"}},306684:(e,t,n)=>{n.d(t,{Z:()=>I});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(949271),l=n(180951),c=n(709291),d=n(653965),u=n(926249),p=n(295982),m=n(210228),g=n(249394),f=n(99340),h=n(27724),v=n(523864),y=n(260458),b=n(630915),_=n(78454),S=n(965187),k=n(785893);const w=(0,c.defineMessages)({placeholder:{defaultMessage:"To-do",id:"todoBlock.placeholder"}});function x(e,t){const n=(0,c.useIntl)(),u=(0,r.Fy)(),x=(0,r.O7)(),I=(0,o.useRef)(null),C=(0,o.useId)(),T=(0,f.PE)(e.store,e.disabled),M=(0,f.rv)(e.store,!0),P=(0,i.VK)((()=>e.store.getBlockTitleStore()),[e.store]),A=(0,i.VK)((()=>e.store.getContentStore()),[e.store]),R=(0,i.VK)((()=>{const t=e.store.getProperties();return!!t&&l.Ml(t.checked)}),[e.store]),D=(0,i.VK)((()=>Boolean(e.store.getInsertSuggestion())),[e.store]),B=(0,o.useCallback)((()=>{if(T){let t;t=d.q9(h.default.state.stores,e.store)?h.default.state.stores:[e.store],x.mobileNative&&x.mobileNative.buzz(),R?m.createAndCommit({userAction:"TodoBlock.toggleChecked",environment:x,perform:e=>{p.c({environment:x,blocks:t,transaction:e})}}):m.createAndCommit({userAction:"TodoBlock.toggleChecked",environment:x,perform:e=>{p.B({environment:x,blocks:t,transaction:e})}})}}),[T,x,R,e.store]),E=(0,a.yK)((e=>({root:{paddingLeft:s.ZD.paddingLeft,...M},title:{..._.R8,width:void 0,flexGrow:1,...R&&{textDecoration:"line-through",textDecorationColor:D?e.text.uiBlueSecondary:e.strikethroughLineColor,opacity:1,color:e.mediumTextColor}},titlePlaceHolder:{...D?{color:e.text.uiBlueTertiary,WebkitTextFillColor:"initial"}:{}}})),[M,D,R]),F=(0,k.jsxs)(_.ZP,{style:{...E.root,...e.style},left:(0,k.jsx)(y.Z,{"aria-labelledby":C,checked:R,onClick:B,disabled:!T,size:16,fill:M.color,tapArea:u.isMobile?{size:30}:void 0}),childrenStyle:{display:"flex",flexDirection:"column"},ref:I,children:[(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)(S.Z,{id:C,style:E.title,disabled:e.disabled,store:P,placeholder:n.formatMessage(w.placeholder),placeholderStyle:E.titlePlaceHolder,pasteBehavior:"block",legacyTransclusionParentStore:e.legacyTransclusionParentStore,inPageFind:g.B3.block_match,renderWhiteSpaceWhenEmptyOnAndroid:!0}),(0,k.jsx)(v.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store})]}),!e.hideContent&&(0,k.jsx)(b.Z,{disabled:e.disabled,store:A,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,disableDrag:e.disableDrag})]});return(0,f.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"to_do",getNode:()=>I.current,getBlockStore:()=>e.store,activate:B})),[e.store,B]),F)}const I=o.memo(o.forwardRef(x),u.Z)},804859:(e,t,n)=>{n.d(t,{J9:()=>R,ZP:()=>A,kA:()=>D});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(949271),l=n(709291),c=n(653965),d=n(926249),u=n(250906),p=n(429373),m=n(210228),g=n(721429),f=n(249394),h=n(52315),v=n(99340),y=n(27724),b=n(445131),_=n(523864),S=n(164921),k=n(825777),w=n(630915),x=n(78454),I=n(965187),C=n(605210),T=n(785893);const M=(0,l.defineMessages)({placeholder:{defaultMessage:"Toggle",id:"toggleBlock.placeholder"}});function P(e,t){const n=(0,r.O7)(),d=(0,l.useIntl)(),P=(0,o.useRef)(!0);(0,o.useLayoutEffect)((()=>{P.current&&(P.current=!1,p.nz({blockId:e.store.id,currentUserId:n.currentUser.id}),e.store.isDefaultRecordCache()&&p.LO(n,e.store.pointer))}));const A=(0,o.useRef)(null),R=(0,i.VK)((()=>e.store.getBlockTitleStore()),[e.store]),D=(0,i.VK)((()=>e.store.getContentStore()),[e.store]),B=(0,i.VK)((()=>Boolean(e.store.getInsertSuggestion())),[e.store]),E=(0,i.VK)((()=>b.Z.isOpen(e.store.id)&&!e.hideContent),[e.hideContent,e.store.id]),F=(0,i.VK)((()=>!e.store.hasContent()),[e.store]),Z=(0,o.useId)(),U=(0,o.useId)(),V=(0,i.VK)((()=>h.b(e.store)||!e.store.isDefaultRecordCache()),[e.store]),N=(0,o.useCallback)((()=>{let t;t=c.q9(y.default.state.stores,e.store)?y.default.state.stores:[e.store];const o=!E;for(const e of t)p.rd({blockId:e.id,state:o,currentUserId:n.currentUser.id});u.jR(n,{is_toggled:o})}),[n,E,e.store]),O=(0,o.useCallback)((()=>{m.createAndCommit({userAction:"ToggleBlock.handlePlaceholderClick",environment:n,perform:t=>{p.ls({environment:n,store:e.store,transaction:t})}})}),[n,e.store]),L=(0,o.useCallback)((e=>{if(e.shiftKey){const e=g.np();e&&p.X_(n,e)}else N()}),[n,N]),j=(0,v.rv)(e.store,!0),K=(0,a.yK)((t=>({root:{paddingLeft:s.ZD.paddingLeft,...j,...e.style},placeholderButton:{fontSize:"inherit",width:"100%",borderRadius:4,caretColor:t.lightTextColor,...s.ZD,marginTop:2},placeholderText:{color:t.lightTextColor},titlePlaceHolder:{...B?{color:t.text.uiBlueTertiary,WebkitTextFillColor:"initial"}:{}}})),[j,B,e.style]),z=(0,T.jsx)(S.Z,{style:K.placeholderButton,onClick:O,disabled:e.disabled,children:(0,T.jsx)("span",{style:K.placeholderText,children:(0,T.jsx)(l.FormattedMessage,{defaultMessage:"Empty toggle. Click or drop blocks inside.",id:"toggleBlock.emptyBlock.placeholderText"})})}),q=(0,T.jsxs)(x.ZP,{style:K.root,left:(0,T.jsx)(C.Z,{"aria-describedby":Z,"aria-controls":U,isSidebar:!1,open:E,fill:!F,onClick:L,tapArea:n.device.isMobile?{size:30}:void 0}),leftStyle:{paddingRight:2},ref:A,children:[(0,T.jsxs)("div",{style:{display:"flex"},children:[(0,T.jsx)(I.Z,{id:Z,style:x.R8,disabled:e.disabled,store:R,placeholder:d.formatMessage(M.placeholder),placeholderStyle:K.titlePlaceHolder,pasteBehavior:"block",inPageFind:f.B3.block_match,legacyTransclusionParentStore:e.legacyTransclusionParentStore,renderWhiteSpaceWhenEmptyOnAndroid:!0}),(0,T.jsx)(_.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store,recursivelyLoadAllDiscussions:!E})]}),E?(0,T.jsx)(k.Z,{id:U,loaded:V,spinnerSize:"1em",showSpinnerTimeout:500,innerStyle:{display:"flex",flexDirection:"column",width:"100%"},style:{display:"flex"},children:(0,T.jsx)(w.Z,{store:D,emptyPlaceholder:z,disabled:e.disabled,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,disableDrag:e.disableDrag})}):(0,T.jsx)(w.Z,{store:D,disabled:e.disabled,disableContent:!0})]});return(0,v.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"toggle",getNode:()=>A.current,getBlockStore:()=>e.store,activate(){N()}})),[e.store,N]),q)}const A=o.memo(o.forwardRef(P),d.Z);function R(){return{display:"flex"}}function D(){return{display:"flex",flexDirection:"column",width:"100%"}}},605210:(e,t,n)=>{n.d(t,{Z:()=>p});var o=n(667294),r=n(800480),i=n(724405),a=n(709291),s=n(528515),l=n(39400),c=n(164921),d=n(785893);const u=(0,a.defineMessages)({open:{defaultMessage:"Open",id:"toggleButton.open"},close:{defaultMessage:"Close",id:"toggleButton.close"}}),p=o.memo((function(e){const t=(0,r.Fy)(),n=(0,a.useIntl)(),p=(0,o.useMemo)((()=>function(e){let{isSidebar:t,isMobile:n}=e;return t&&!n?20:24}({isSidebar:e.isSidebar,isMobile:t.isMobile})),[t.isMobile,e.isSidebar]),m=(0,i.yK)((()=>{const n=e.color||"inherit",o="chevron"===e.icon?`rotateZ(${e.open?0:-90}deg)`:`rotateZ(${e.open?180:90}deg)`,r="chevron"===e.icon,i=r&&t.isMobile;return{button:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:p,height:p,borderRadius:4,...e.style},arrow:{width:i?14:r?12:"0.6875em",height:i?14:r?12:"0.6875em",transition:"transform 200ms ease-out",transform:o,fill:n,opacity:e.fill?1:.5}}}),[t.isMobile,e.color,e.fill,e.icon,e.open,e.style,p]),g=(0,o.useMemo)((()=>"chevron"===e.icon?(0,s.A)(m.arrow):(0,l.L)(m.arrow)),[e.icon,m.arrow]);return(0,d.jsxs)(c.Z,{ariaLabel:e.open?n.formatMessage(u.close):n.formatMessage(u.open),"aria-describedby":e["aria-describedby"],"aria-expanded":e.open,"aria-controls":e.open?e["aria-controls"]:void 0,style:m.button,onClick:e.onClick,onMouseDown:e.onMouseDown,disabled:e.disabled,allowShiftClick:!0,children:[e.tapArea&&(0,d.jsx)("div",{style:{position:"absolute",opacity:0,width:e.tapArea.size,height:e.tapArea.size,top:-(e.tapArea.size-p)/2,left:-(e.tapArea.size-p)/2}}),g]})}))},685567:(e,t,n)=>{n.d(t,{Z:()=>f});var o=n(667294),r=n(724405),i=n(984619),a=n(997466),s=n(531701),l=n(137810),c=n(243224),d=n(792628),u=n(825464),p=n(164921),m=n(526388),g=n(785893);const f=function(e){let{format:t,isSingle:n,showRemoveButton:l,shouldShrink:d,isRound:f,disabled:h,disabledFeedback:v,color:y,backgroundColor:_,style:S,shouldWrap:k,showFullValueTooltip:w,tooltip:x,tooltipPlacement:I,value:C,isStrikedThrough:T,showColoredDot:M,onClickRemove:P,onClick:A}=e;const R=(0,r.Fg)(),D=(0,o.useRef)(null),B=(0,o.useMemo)((()=>{const{height:e,fontSize:o,paddingLeft:r,margin:a}=(0,i.e1)(t),c=f?r+1:r;return{display:n?"inline-flex":"flex",alignItems:"center",flexShrink:n||d?1:0,minWidth:0,maxWidth:"100%",height:e,borderRadius:f?e/2:3,paddingLeft:c,paddingRight:l?0:f?c+2:c,fontSize:o,lineHeight:"120%",opacity:h&&v?.4:void 0,color:y||("light"===R.mode?R.regularTextColor:s.ZP.whiteWithAlpha(.7)),background:_||R.legacyDefaultSelectColor,margin:n?0:a,...k&&{height:void 0,paddingTop:4,paddingBottom:4},...S}}),[R,t,n,l,d,f,h,v,y,_,S,k]);if(w||void 0!==x)return(0,g.jsx)(m.Z,{placement:I??u.u.Right,renderTooltip:e=>(0,g.jsxs)("div",{...e,style:c.F6,children:[w&&(0,g.jsx)("div",{children:C}),void 0!==x&&(0,g.jsx)("div",{style:{color:w?R.mediumInvertedTextColor:void 0},children:x})]}),originGap:20,textWrap:!0,render:e=>(0,g.jsx)("div",{style:B,...e,onMouseEnter:t=>{(function(e,t){return Boolean(t&&e.current&&e.current.offsetWidth<e.current.scrollWidth)}(D,w)||void 0!==x)&&e.onMouseEnter&&e.onMouseEnter(t)},children:(0,g.jsx)(b,{ref:D,format:t,shouldWrap:k,isStrikedThrough:T,showColoredDot:M,value:C,showRemoveButton:l,onClickRemove:P,disabled:h})})});if(A){const e=_?{background:(0,a._j)(_,1)}:void 0,n=_?{background:(0,a._j)(_,2)}:void 0;return(0,g.jsx)(p.Z,{style:B,hoveredStyle:e,pressedStyle:n,onClick:A,children:(0,g.jsx)(b,{format:t,shouldWrap:k,isStrikedThrough:T,showColoredDot:M,value:C,showRemoveButton:l,onClickRemove:P,disabled:h})})}return(0,g.jsx)("div",{style:B,children:(0,g.jsx)(b,{format:t,shouldWrap:k,isStrikedThrough:T,showColoredDot:M,value:C,showRemoveButton:l,onClickRemove:P,disabled:h})})};function h(e){let{format:t,showRemoveButton:n,onClickRemove:o,disabled:r}=e;const a=function(e){switch(e){case i.lo.Large:return 10;case i.lo.ExtraSmall:case i.lo.Small:case i.lo.Medium:case i.lo.Inline:default:return 8}}(t),{height:s}=(0,i.e1)(t),l={display:"flex",alignItems:"center",justifyContent:"center",flexGrow:0,flexShrink:0,marginLeft:2,marginRight:2};return n?(0,g.jsx)(p.Z,{onClick:o,style:{...l,width:s,height:s},disabled:r,disabledFeedback:!1,mobileFeedback:!0,className:"notion-token-remove-button",children:(0,d.b)({width:a,height:a,opacity:.5})}):null}function v(e,t,n){const o=(0,i.Nv)(t),r="default"===e?"gray":e;return void 0===r?{}:{marginRight:5,borderRadius:99,height:o,width:o,backgroundColor:"light"===n.mode?n.accentColors[r][400]:n.accentColors[r][700],display:"inline-flex",flexShrink:0}}function y(e){let{showColoredDot:t,format:n}=e;const o=(0,r.Fg)();return t?(0,g.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,g.jsx)("div",{style:v(t,n,o)})}):null}const b=o.forwardRef((function(e,t){let{format:n,shouldWrap:o,isStrikedThrough:r,showColoredDot:a,value:s,showRemoveButton:c,onClickRemove:d,disabled:u}=e;const{height:p}=(0,i.e1)(n);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{style:{...o?{overflowWrap:"anywhere"}:l.Z.textOverflowStyle,textDecoration:r?"line-through":void 0,display:"inline-flex",alignItems:"center",height:p,lineHeight:`${p}px`},children:[(0,g.jsx)(y,{showColoredDot:a,format:n}),(0,g.jsx)("span",{style:{...l.Z.textOverflowStyle},ref:t,children:s})]}),(0,g.jsx)(h,{format:n,showRemoveButton:c,onClickRemove:d,disabled:u})]})}))},760442:(e,t,n)=>{n.d(t,{Z:()=>a});n(667294);var o=n(137810),r=n(847853),i=n(785893);const a=function(e){let{imageURL:t,imageWidth:n,imageHeight:o,caption:a,title:l,imageContainerStyle:c}=e;if(t){const e=(0,r.D)(t);return(0,i.jsxs)("div",{style:{width:n||200,marginTop:4,marginBottom:4},children:[(0,i.jsx)("div",{style:{width:"100%",height:o||100,borderRadius:4,backgroundImage:`url(${e})`,backgroundSize:"cover",marginBottom:6,...c}}),(0,i.jsx)(s,{caption:a,title:l})]})}return(0,i.jsx)(s,{caption:a,title:l,style:{width:n}})};function s(e){let{style:t,caption:n,title:r}=e;return(0,i.jsxs)("div",{style:{whiteSpace:"normal",lineHeight:1.4,...t},children:[r&&(0,i.jsx)("header",{style:{fontWeight:o.Z.fontWeight.bold,marginBottom:4},children:r}),n]})}},25157:(e,t,n)=>{n.d(t,{Z:()=>_e});var o=n(667294),r=n(313991),i=n(800480),a=n(886628),s=n(724405),l=n(749085),c=n(815145),d=n(541432),u=n(186517),p=n(772141),m=n(151454),g=n(709291),f=n(531701),h=n(926249),v=n(401898),y=n(137810),b=n(800893),_=n(547307),S=n(524677),k=n(164964),w=n(898104),x=n(429373),I=n(210228),C=n(95477),T=n(855337),M=n(143976),P=n(843250),A=n(484210),R=n(212534),D=n(187290),B=n(433929),E=n(460709),F=n(639500),Z=n(367669),U=n(918514),V=n(389224),N=n(99340),O=n(317105),L=n(224434),j=n(344161),K=n(831501),z=n(756903),q=n(990827),H=n(788632),G=n(155367),W=n(480796),$=n(222294),Y=n(188923),Q=n(206258),J=n(569784),X=n(249557),ee=n(977933),te=n(23867),ne=n(80444);const oe=function(e){const t=(0,i.O7)(),n=(0,a.VK)(re,[]);return(0,o.useEffect)((()=>{if(!n)return t.LocalBacklinkStore.initializeBacklinks({block:{id:e.store.pointer.id,spaceId:(0,te.C)(e.store.pointer.spaceId)},currentUserId:t.currentUser.id,environment:t}),()=>{t.LocalBacklinkStore.destroyBacklinks(e.store.id,t)}}),[t,n,e.store.id,e.store.pointer.id,e.store.pointer.spaceId]),null};function re(){const{mainEditorCurrentBlockStore:e}=ne.default.state;return Boolean(e&&"15776535-3f2c-4705-bd45-474e5ba8b46c"===e.id)}var ie=n(13966),ae=n(668709),se=n(623063),le=n(164921),ce=n(231945),de=n(584076),ue=n(478140),pe=n(776798),me=n(672495),ge=n(483182),fe=n(629551),he=n(630915),ve=n(785893);const ye=(0,g.defineMessages)({copySuccessMessage:{defaultMessage:"Copied! Now paste in any page to sync content.",id:"transclusionContainerBlock.actions.copySuccessMessage"}});function be(e,t){const n=(0,i.O7)(),r=(0,s.Fg)(),c=(0,o.createRef)(),m=(0,o.useMemo)((()=>l.default.createValue(!1)),[]),h=(0,o.useMemo)((()=>l.default.createValue(!1)),[]),v=(0,o.useMemo)((()=>l.default.createValue(!1)),[]),y=(0,a.VK)((()=>m.state),[m]),_=(0,a.VK)((()=>{const t=xe(e.store,e.referenceStore);return(0,D.B)(t,y)}),[y,e.referenceStore,e.store]),A=(0,a.VK)((()=>!(_!==D.x.Selected&&_!==D.x.SelectedDescendant||X.Z.state.isActive||G.ZP.state.isDragging||J.default.state.isActive||$.Z.state.isKeyboardMode)),[_]),E=(0,a.VK)((()=>{const t=(0,M.L)(e.store,n);return t.backlinks.length+t.inaccessibleBacklinkCount}),[n,e.store]),j=(0,a.VK)((()=>{const{referenceStore:t}=e;return!(!t||!t.pathIsDead())||!(!t||!(0,q.Eo)(t))}),[e]),K=(0,a.VK)((()=>{if(C.default.isAdminMode)return!1;const{disabled:t}=e;if(t&&!j)return!0;const n=xe(e.store,e.referenceStore);if(!n.canEdit())return!0;const o=n.findRecordStoreUIAncestor((e=>e!==n&&e instanceof Q.G&&e.getType()===d.Ti.transclusionContainer));return Boolean(o.ancestor)}),[j,e]),Y=(0,a.VK)((()=>{const{store:t,referenceStore:n}=e;if(!n||!t.canEdit()||!n.canEdit())return!1;const o=(0,Z.YO)(t).map((e=>{let{permissionItem:t}=e;return t})),r=(0,Z.YO)(n).map((e=>{let{permissionItem:t}=e;return t})),i=(0,u.L2)(o,r).created.find((e=>!(0,p.FB)(e)));return Boolean(i)}),[e]),ee=(0,a.VK)((()=>H.Z.state.online),[]),te=(0,o.useCallback)((()=>{S.Z5({environment:n,stores:[xe(e.store,e.referenceStore)]});const t=c.current;t&&n.device.isSafari?(V.setOnNode(t,n.device),b.f4(),V.clear(n)):b.f4(),function(e){T.K4(e,"transclusion_container_copy_button")}(n),k.oV({label:B.default.formatMessage(ye.copySuccessMessage),helpUrl:(0,U.UY)("guides.transclusions")})}),[n,c,e.referenceStore,e.store]),ne=(0,o.useCallback)((()=>(0,ve.jsx)(De,{store:e.store,hasDifferingReadPermissionsFromSource:Y})),[Y,e.store]),re=(0,o.useCallback)((()=>{W.Z.state.isDragging||J.default.state.isActive||K||m.setState(!0)}),[K,m]),de=(0,o.useCallback)((()=>{W.Z.state.isDragging||J.default.state.isActive||K||m.setState(!1)}),[K,m]),ue=(0,o.useCallback)((()=>{m.setState(!1),S.ZH({environment:n});const t=e.store.getContentStores()[0];t&&t.getType()===d.Ti.text&&(S.eP({environment:n,store:t}),w.setSelectionAtStart({store:t.getBlockTitleStore()}))}),[n,m,e.store]),pe=(0,o.useCallback)((async()=>{if(0===E)return{canRemove:!0,canUndo:!0};const e=await Se({header:(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.remove.header",defaultMessage:"Delete original?"}),text:(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.remove.text",defaultMessage:"These blocks are synced in {numberOfBacklinks, plural, one {{numberOfBacklinks} other page} other {{numberOfBacklinks} other pages}}. If you delete the original, the blocks will no longer be synced.",values:{numberOfBacklinks:E}}),acceptLabel:(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.remove.confirm",defaultMessage:"Delete and unsync copies"})});return{canRemove:e,canUndo:e}}),[E]),me=(0,o.useCallback)((async()=>0===E||Se({header:(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.unsyncTransclusionReference.header",defaultMessage:"Unsync this?"}),text:(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.unsyncTransclusionReference.text",defaultMessage:"The selected blocks will no longer be synced with the original."}),acceptLabel:(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.unsyncTransclusionReference.confirm",defaultMessage:"Unsync"})})),[E]),ge=(0,o.useCallback)((async()=>0===E||Se({header:(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.unsyncTransclusionContainer.header",defaultMessage:"Unsync all?"}),text:(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.unsyncTransclusionContainer.text",defaultMessage:"{numberOfBacklinks, plural, one {{numberOfBacklinks} other page} other {{numberOfBacklinks} other pages}} will no longer sync with these blocks.",values:{numberOfBacklinks:E}}),acceptLabel:(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.unsyncTransclusionContainer.confirm",defaultMessage:"Unsync all"})})),[E]),fe=(0,o.useRef)(null),be=()=>{const{isDesktop:t}=n.device;return(0,ve.jsxs)("div",{style:Ie(r),children:[ee&&(0,ve.jsx)(ce.ZP,{popupType:ce.Z4.Popup,onClick:()=>function(e,t,n){S.Z5({environment:t,stores:[xe(e,n)]}),function(e,t){T.K4(e,"transclusion_container_open_backlinks",t)}(t,{from:"action_bar"})}(e.store,n,e.referenceStore),originGap:4,renderOrigin:e=>(0,ve.jsxs)(le.Z,{style:Ce(r),...e,children:[E>0?(0,ve.jsx)(g.FormattedMessage,{defaultMessage:"Editing in {icon} {numberOfBacklinks, plural, one {{numberOfBacklinks} other page} other {{numberOfBacklinks} other pages}}",id:"transclusionContainerBlock.editingMultiple",values:{icon:(0,O.J)({width:14,transform:"rotate(180deg)",marginLeft:4,marginRight:4}),numberOfBacklinks:E}}):(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.editingOriginal",defaultMessage:"Editing original"}),Y&&(0,z.t)({width:14,fill:(0,f.fi)("orange",r).fill,marginLeft:6}),(0,L.i)({width:10,fill:r.mediumIconColor,marginLeft:4})]}),render:ne}),t&&(0,ve.jsx)(le.Z,{style:Ce(r),onClick:te,children:(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.copy",defaultMessage:"Copy and sync"})}),(0,ve.jsx)(ie.Z,{store:xe(e.store,e.referenceStore),fadeIn:!1,style:{width:30,height:void 0},iconStyle:{marginTop:1,fill:r.regularTextColor}})]})},_e=(0,a.VK)((()=>e.store.pathIsDead()),[e.store]),ke=(0,a.VK)((()=>_!==D.x.Default||h.state||v.state),[_,h,v]),we=(0,a.VK)((()=>!e.store.hasContent()),[e.store]),Me=(()=>{const{store:t}=e,{device:o}=n,r=Boolean(e.referenceStore);return _e&&r?(0,ve.jsx)(Te,{store:e.store,blockType:"transclusion_container"}):K?(0,ve.jsx)(he.Z,{disabled:e.disabled,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,store:e.store.getContentStore()}):(0,ve.jsxs)("div",{ref:fe,className:P.H9Z,style:{display:"flex"},children:[(0,ve.jsx)("span",{ref:c,style:{height:"1px",width:"1px"}}),(0,ve.jsxs)("div",{style:{display:"flex",flexDirection:"column",position:ke?"relative":void 0,paddingTop:3,paddingBottom:3,width:"100%"},onMouseLeave:de,onMouseEnter:re,onClick:we?t=>function(e,t,n){(0,R.ZP)({event:e,context:R.Af.EditorClick,callback:()=>{(0,F.uG)(e)||I.createAndCommit({userAction:"TransclusionContainerBlock.handleEmptyClick",environment:n,perform:e=>{x.ls({environment:n,store:t,transaction:e})}})}})}(t,e.store,n):void 0,children:[(0,ve.jsx)(he.Z,{disabled:e.disabled,store:e.store.getContentStore(),emptyPlaceholder:(0,ve.jsx)(Pe,{}),disableHoverMenu:e.disableHoverMenu||_!==D.x.SelectedDescendant||j,disableDrag:o.isMobile}),(0,ve.jsx)(oe,{store:t},t.id),ke&&(0,ve.jsx)(Re,{haloShouldBeVisibleStore:h,state:_}),ke&&(0,ve.jsx)(ae.p,{allowSelectionWithin:!1,children:(0,ve.jsx)(se.Z,{isVisible:A,enterAnimationStyle:{opacity:0},animationStyle:{opacity:1},exitAnimationStyle:{opacity:0},onAnimationStart:()=>{v.setState(!0)},onAnimationEnd:()=>{A||v.setState(!1)},render:be})})]})]})})();return(0,N.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"transclusion_container",getBlockStore:()=>e.store,getNode:()=>fe.current,handleCreated:ue,canRemoveBlock:pe,confirmUnsyncTransclusionReference:me,confirmUnsyncTransclusionContainer:ge})),[pe,ge,me,ue,e.store]),Me)}const _e=o.memo(o.forwardRef(be),h.Z);function Se(e){const{header:t,text:n,acceptLabel:o}=e;return new Promise((e=>{_.showDialog({showCancel:!0,keepFocus:!1,message:(0,ve.jsxs)("div",{children:[(0,ve.jsx)("div",{style:{fontWeight:y.Z.fontWeight.semibold},children:t}),n]}),items:[{label:o,color:"red",onAccept:()=>{e(!0)}}],handleCancel:()=>{e(!1)}})}))}function ke(){return(0,ve.jsx)(g.FormattedMessage,{defaultMessage:"Learn more about Synced blocks",id:"transclusionContainerBlock.learnMoreLabel"})}function we(){return(0,ve.jsx)(me.Z,{topBorder:!0,children:(0,ve.jsx)(ge.Z,{title:(0,ve.jsx)(ke,{}),href:(0,U.UY)("guides.transclusions"),analyticsFrom:"transclusion_container_block"})})}function xe(e,t){return t||e}function Ie(e){return{position:"absolute",zIndex:m.t8,top:-40,right:-2,borderRadius:6,height:32,fontSize:14,lineHeight:1.2,display:"flex",whiteSpace:"nowrap",fontFamily:y.Z.getCompositeFontFamily(r.locale).sans,background:e.popoverBackground,boxShadow:e.mediumBoxShadow}}function Ce(e){return{display:"flex",alignItems:"center",padding:"0 8px",borderRight:`1px solid ${f.ZP.whiteWithAlpha(.2)}`,boxShadow:`1px 0 0 ${e.regularDividerColor}`,marginRight:1}}function Te(e){let{store:t,blockType:n}=e;const o=(0,s.Fg)(),r=(0,a.VK)((()=>(0,A.ZP)({store:t,fullyQualified:!1,pageVisitSource:c.tY.LinkInPage})),[t]),i=(0,a.VK)((()=>(0,A.ZP)({store:t,openInSidePeek:!0,fullyQualified:!1,pageVisitSource:c.tY.PeekOpen})),[t]),l=(0,a.VK)((()=>Y.default.isSidePeekOpen()),[]),d=(0,ve.jsx)(de.Z,{href:r,altHref:i,forceAltHref:l,external:!1,inline:!0,underline:!0,children:(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.deletedContainerBanner.viewDeletedPage",defaultMessage:"View deleted page"})});return(0,ve.jsxs)(fe.gq,{style:{color:o.text.secondary,background:o.accentColors.gray[30],padding:"16px 16px 16px 12px",borderRadius:4},alignItems:"center",children:[(0,K.D)({width:24,height:24,flexShrink:0,marginRight:10,padding:2}),(0,ve.jsx)("div",{style:{fontSize:14},children:(0,ve.jsx)(Me,{pageLink:d,blockType:n})})]})}function Me(e){const{pageLink:t,blockType:n}=e;return n===d.Ti.collectionView?(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.deletedContainerBanner.syncedContentPageDeleted.collection",defaultMessage:"The original database has been deleted and cannot be edited. {pageLink}",values:{pageLink:t}}):n===d.Ti.transclusionContainer?(0,ve.jsx)(g.FormattedMessage,{id:"transclusionContainerBlock.deletedContainerBanner.syncedContentPageDeleted.syncedBlock",defaultMessage:"The page with the original synced block has been deleted. {pageLink}",values:{pageLink:t}}):void(0,v.t1)(n)}function Pe(){const e=(0,s.Fg)();return(0,ve.jsx)("div",{style:{caretColor:e.lightTextColor,color:e.lightTextColor,paddingTop:4,paddingBottom:4},children:(0,ve.jsx)(g.FormattedMessage,{defaultMessage:"Click or drag blocks here, then paste in another page to sync content.",id:"transclusionContainerBlock.emptyEditingPlaceholder"})})}function Ae(){const e=(0,s.Fg)();return(0,ve.jsx)("div",{className:P.Lzk,style:{position:"absolute",left:-6,right:-6,top:-3,bottom:-3,pointerEvents:"none",borderRadius:8,border:`2px solid ${e.transclusionBorderColor}`}})}function Re(e){let{state:t,haloShouldBeVisibleStore:n}=e;const o=t!==D.x.Default;return(0,ve.jsx)(se.Z,{isVisible:o,enterAnimationStyle:{opacity:0},animationStyle:{opacity:t===D.x.Hovered?.45:1,scale:1},exitAnimationStyle:{opacity:0},onAnimationStart:()=>{n.setState(!0)},onAnimationEnd:()=>{o||n.setState(!1)},render:()=>(0,ve.jsx)(Ae,{})})}function De(e){let{store:t,hasDifferingReadPermissionsFromSource:n}=e;const o=(0,s.Fg)(),r={menuType:E.og.Popup,width:400},i=(0,a.VK)((()=>t.getNavigableBlockStore()),[t]),l=(0,a.VK)((()=>i&&(0,A.ZP)({store:i,fullyQualified:!1,pageVisitSource:c.tY.Breadcrumb})),[i]),d=n&&i?(0,ve.jsx)(de.Z,{underline:!0,inline:!0,href:l,style:{color:o.mediumTextColor},children:(0,ve.jsx)(pe.Z,{store:i,style:{display:"inline"},shouldWrap:!0,maxLength:30})}):void 0;return(0,ve.jsxs)(ue.Z,{...r,children:[n&&i&&(0,ve.jsx)(me.Z,{style:{background:o.sidebarSecondaryBackground},children:(0,ve.jsxs)("div",{style:{display:"flex",fontSize:12,padding:"6px 16px"},children:[(0,j.B)({width:16,marginTop:6,marginRight:8,color:o.regularIconColor}),(0,ve.jsx)("div",{style:{flexGrow:1,minWidth:0},children:(0,ve.jsx)("span",{style:{overflowWrap:"break-word"},children:(0,ve.jsx)(g.FormattedMessage,{defaultMessage:"Viewership permissions on this page are different from the original page <page></page>. Some members might not have access.",id:"transclusionContainerBlock.differingPermissionsWarning",values:{page:()=>d}})})})]})}),(0,ve.jsx)(me.Z,{topBorder:n,children:(0,ve.jsx)(ee.Z,{type:"transclusion_container",store:t,originalTransclusionStore:t,disableArrow:!0})}),(0,ve.jsx)(we,{})]})}},691497:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(667294),r=n(886628),i=n(709291),a=n(926249),s=n(99340),l=n(215201),c=n(668709),d=n(25157),u=n(785893);function p(e,t){const n=(0,i.useIntl)(),a=(0,o.useRef)(null),p=(0,r.VK)((()=>e.store.getTransclusionReferenceTargetStore()),[e.store]),m=(0,r.VK)((()=>p&&p.canRead()),[p]),g=(0,r.VK)((()=>e.store.useCrdt()!==(null==p?void 0:p.useCrdt())),[e.store,p]);return(0,s.ez)(e.store,t,(0,o.useMemo)((()=>({renderedType:"transclusion_reference",getNode:()=>{const e=a.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),void 0!==p&&m?g?(0,u.jsx)(c.p,{allowSelectionWithin:!0,children:(0,u.jsx)(l.O,{displayName:"TransclusionReferenceBlock.mixedCrdtTransclusion",disabled:!1,children:(0,u.jsx)(d.Z,{store:p,disabled:e.disabled,intl:n,referenceStore:e.store,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,ref:a})})}):(0,u.jsx)(d.Z,{store:p,disabled:e.disabled,intl:n,referenceStore:e.store,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,ref:a}):null)}const m=o.memo(o.forwardRef(p),a.Z)},515355:(e,t,n)=>{n.d(t,{h:()=>ns});var o=n(354851),r=n(629071),i=n(667294),a=n(886628),s=n(709291),l=n(926249),c=n(99340),d=n(745238),u=n(785893);const p=(0,d.IU)("abstract",{viewBox:"0 0 32 32",svg:(0,u.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 16C0 3.199 3.199 0 16 0s16 3.199 16 16-3.199 16-16 16S0 28.801 0 16zm9.976 7.71a6.128 6.128 0 003.398 1.043 6.14 6.14 0 006.146-6.127 6.126 6.126 0 10-9.544 5.085zm11.521.79h3.004v-17H7.499v2.997h13.998V24.5zm-5-5.874a3.123 3.123 0 11-6.246 0 3.123 3.123 0 016.246 0z"})});var m=n(568859),g=n(959062);const f=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Abstract",id:"abstractBlock.embeds.button.label"}});function h(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"abstract",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:p,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Abstract links with public access enabled",id:"abstractBlock.embeds.caption"}),embedButtonText:n.formatMessage(f.embedButtonText),urlInputPlaceholder:"https://abstract.com/…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed Abstract",id:"abstractBlock.placeholder"})}))}const v=i.memo(i.forwardRef(h),l.Z);var y=n(313991),b=n(800480),_=n(797511),S=n(724405),k=n(151454),w=n(531701),x=n(137810),I=n(10910),C=n(772899),T=n(843250),M=n(214976),P=n(120315),A=n(187290),R=n(249394),D=n(433929),B=n(816402),E=n(277907),F=n(628267),Z=n(224434),U=n(818441),V=n(316772),N=n(155367),O=n(480796),L=n(222294),j=n(569784),K=n(249557),z=n(831103),q=n(668709),H=n(623063),G=n(164921),W=n(973420),$=n(863296),Y=n(630915),Q=n(965187);const J=(0,s.defineMessages)({summarize:{id:"aiBlock.summarize",defaultMessage:"Summarize this page with AI"},findActionItems:{id:"aiBlock.findActionItems",defaultMessage:"Find action items on this page with AI"},helpMeWrite:{id:"aiBlock.helpMeWrite",defaultMessage:"Tell the AI what to write…"},summarizeMeetingTranscript:{id:"aiBlock.summarizeMeetingTranscript",defaultMessage:"Summarize this meeting with any action items and decisions taken"}}),X=i.forwardRef((function(e,t){const{store:n,disabled:o,disableHoverMenu:r,ai:{completionActions:l,completionInitialPromptActions:d}}=e,p=(0,b.O7)(),m=(0,b.Fy)(),g=(0,c.PE)(n,o),f=(0,_.l)(),[h,v]=(0,i.useState)(!1),[C,E]=(0,i.useState)(!1),[z,X]=(0,i.useState)(!1),[ee,te]=(0,i.useState)(!1),ne=(0,i.useRef)(null),oe=(0,S.yK)((e=>({actionBar:{position:"absolute",zIndex:k.t8,top:-40,right:-2,borderRadius:6,height:32,fontSize:14,lineHeight:1.2,display:"flex",whiteSpace:"nowrap",fontFamily:x.Z.getCompositeFontFamily(y.locale).sans,background:e.popoverBackground,boxShadow:e.mediumBoxShadow},actionButton:{display:"flex",alignItems:"center",padding:"0 8px",borderRight:`1px solid ${w.ZP.whiteWithAlpha(.2)}`,boxShadow:`1px 0 0 ${e.regularDividerColor}`,marginRight:1},icon:{fill:e.accentColors.purple[300],width:21,height:21,position:"relative",top:5},haloContent:{position:"absolute",left:-6,right:-6,top:-3,bottom:-3,pointerEvents:"none",borderRadius:8,border:`2px solid ${e.aiBlockBorderColor}`}})),[]),re=(0,S.Fg)(),ie=(0,F.X)(ne),ae=!ie||ie.width<400,se=(0,a.VK)((()=>!n.hasContent()),[n]),le=(0,a.VK)((()=>se?A.x.Hovered:(0,A.B)(n,C)),[se,C,n]),ce=le!==A.x.Default||z||ee,de=(0,a.VK)((()=>"completionPopup"===V.default.state.type&&"results"===V.default.state.stage&&V.default.state.loading),[]),ue=(0,a.VK)((()=>{const e=(0,P.z1)(),t=e.summarize,o=n.getFormat().ai_prompt_key;if(!o)return t;const r=e[o];return r||t}),[n]),pe=(0,a.VK)((()=>n.getBlockTitleStore()),[n]),me=(0,a.VK)((()=>pe.getValue()),[pe]),ge=(0,a.VK)((()=>{const e=me;if(e)return{prompt:(0,M.Xh)(e,n)}}),[me,n]),fe=(0,a.VK)((()=>n.getFormat().ai_last_edited),[n]),he=(0,a.VK)((()=>{const e=f&&f.publicEditModeStore.state;return!(0,P.GD)(e)||(!!h||(!(n.canEdit()&&!n.isNonEditableState())||"helpMeWrite"===ue.key&&(null==ge||!ge.prompt)))}),[h,n,ue.key,null==ge?void 0:ge.prompt,f]),ve=(0,a.VK)((()=>!(le!==A.x.Selected&&le!==A.x.SelectedDescendant||K.Z.state.isActive||N.ZP.state.isDragging||j.default.state.isActive||L.Z.state.isKeyboardMode)),[le]),ye=(0,i.useCallback)((()=>{O.Z.state.isDragging||j.default.state.isActive||E(!0)}),[]),be=(0,i.useCallback)((()=>{O.Z.state.isDragging||j.default.state.isActive||E(!1)}),[]),_e=(0,i.useCallback)((()=>{I.RL(p,{type:"generate",prompt_key:ue.key}),v(!0),l.triggerCompletionForAiBlock({environment:p,store:n,prompt:ue,additionalContext:ge}).then((()=>{v(!1)}))}),[l,p,n,ue,ge]),Se=(0,i.useCallback)((()=>{I.RL(p,{type:"edit_prompt"}),d.showInitialPromptForAIBlock({environment:p,store:n,originRef:ne,prompt:null==ge?void 0:ge.prompt,clientPrompt:ue})}),[d,p,n,ue,null==ge?void 0:ge.prompt]),ke=(0,i.useCallback)((()=>{d.showInitialPromptForAIBlock({environment:p,store:n,originRef:ne,prompt:null==ge?void 0:ge.prompt,clientPrompt:ue})}),[d,p,n,ue,null==ge?void 0:ge.prompt]),we=()=>(0,u.jsx)("div",{style:oe.haloContent}),xe=()=>{const e=le!==A.x.Default;return(0,u.jsx)(H.Z,{isVisible:e,enterAnimationStyle:{opacity:0,scale:.995},animationStyle:{opacity:le===A.x.Hovered?.45:1,scale:1},exitAnimationStyle:{opacity:0,scale:.995},onAnimationStart:()=>{X(!0)},onAnimationEnd:()=>{e||X(!1)},render:we})},Ie=()=>(0,u.jsxs)("div",{style:oe.actionBar,children:[(0,u.jsxs)(G.Z,{style:{...oe.actionButton,display:"flex",gap:4},onClick:Se,disabled:he,children:[(0,U.t)({width:16,height:16,fill:re.accentColors.purple[400]}),(0,u.jsx)("span",{style:{color:re.accentColors.purple[500],fontWeight:500},children:(0,u.jsx)(s.FormattedMessage,{id:"aiBlock.generated",defaultMessage:"Generated by AI"})}),fe?(0,u.jsx)("span",{style:{color:re.accentColors.purple[300]},children:(0,B.IS)(fe,{useLowercase:!0,useCompactFormat:!0,roundDownYears:!0})}):null,he?null:(0,Z.i)({width:10,marginLeft:4,fill:re.lightIconColor})]}),(0,u.jsx)(G.Z,{onClick:_e,disabled:he,style:{...oe.actionButton,opacity:he?.5:1,cursor:he?"not-allowed":"pointer"},children:h?(0,u.jsx)(s.FormattedMessage,{id:"aiBlockBlock.update.loading",defaultMessage:"Updating…"}):(0,u.jsx)(s.FormattedMessage,{id:"aiBlockBlock.update",defaultMessage:"Update"})})]}),Ce=(0,u.jsx)("div",{className:T.zov,style:{display:"flex"},ref:ne,children:(0,u.jsx)("div",{style:{position:ce?"relative":void 0,paddingTop:3,paddingBottom:3,width:"100%",marginTop:4,marginBottom:4},onMouseLeave:be,onMouseEnter:ye,children:se?(0,u.jsxs)(q.p,{allowSelectionWithin:!0,children:[(0,u.jsxs)(W.X2,{justifyContent:"space-between",padding:8,gap:8,wrap:ae?"wrap":"initial",children:[(0,u.jsxs)(W.X2,{gap:12,alignItems:"baseline",grow:1,children:[(null===(Te=ue.svg)||void 0===Te?void 0:Te.call(ue,oe.icon))??(0,U.t)(oe.icon),"helpMeWrite"===ue.key?(0,u.jsx)(Q.Z,{onFocus:ke,disabled:!g,store:pe,placeholder:D.default.formatMessage(J.helpMeWrite),pasteBehavior:"block",style:{flexGrow:1,flexBasis:0},onEnter:_e,inPageFind:R.B3.block_match}):"helpMeWrite"===ue.key?(null==ge?void 0:ge.prompt)||D.default.formatMessage(J.helpMeWrite):D.default.formatMessage(J[ue.key])]}),(0,u.jsx)($.Z,{disabled:he,onClick:_e,style:{fontWeight:500,color:re.accentColors.purple[500],opacity:he?.5:1,cursor:he?"not-allowed":"pointer"},children:h?(0,u.jsx)(s.FormattedMessage,{id:"aiBlock.generate.loading.label",defaultMessage:"Generating…"}):(0,u.jsx)(s.FormattedMessage,{id:"aiBlock.generate.label",defaultMessage:"Generate"})})]}),xe()]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Y.Z,{disabled:o,store:n.getContentStore(),disableHoverMenu:r||le!==A.x.SelectedDescendant,disableDrag:m.isMobile}),ce&&xe(),!de&&ce&&(0,u.jsx)(H.Z,{isVisible:ve,enterAnimationStyle:{opacity:0},animationStyle:{opacity:1},exitAnimationStyle:{opacity:0},onAnimationStart:()=>{te(!0)},onAnimationEnd:()=>{ve||te(!1)},render:Ie})]})})});var Te;return(0,c.ez)(n,t,(0,i.useMemo)((()=>({renderedType:"ai_block",getBlockStore:()=>n,getNode:()=>ne.current})),[n]),Ce)}));const ee=i.memo(i.forwardRef((function(e,t){const{value:n}=(0,E.XJ)(C.aiDependency);return(0,u.jsx)(z.Z,{name:"LazyAiBlock",children:n&&(0,u.jsx)(X,{...e,ai:n,ref:t})})})),l.Z);var te=n(705894),ne=n(882745);const oe=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed audio",id:"audioBlock.embedAudio.button.label"}});function re(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"audio",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:ne.l,mediaMenuCurrentTab:"file",mediaMenuTabs:[{type:"file",fileUpload:!0},{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with .MP3s, .WAVs, and .OGGs",id:"audioBlock.embed.caption"}),embedButtonText:n.formatMessage(oe.embedButtonText),urlInputPlaceholder:"https://…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Add an audio file",id:"audioBlock.placeholder"})}))}const ie=i.memo(i.forwardRef(re),l.Z);var ae=n(630845),se=n(23210),le=n(421838),ce=n(218265),de=n(619584),ue=n(757549),pe=n(448948),me=n(547307),ge=n(627153),fe=n(412714),he=n(524677),ve=n(898104),ye=n(304708),be=n(475024),_e=n(576732),Se=n(13966),ke=n(391893),we=n(523864),xe=n(751077),Ie=n(634406),Ce=n(584076),Te=n(568785),Me=n(707124),Pe=n(81865),Ae=n(164369),Re=n(186329),De=n(629551),Be=n(635021);const Ee={width:16,height:16,minWidth:16,marginRight:6},Fe={flexGrow:4,flexShrink:1,flexBasis:180,padding:14,paddingTop:12,overflow:"hidden",textAlign:"left"},Ze=2*de.hM,Ue=(0,s.defineMessages)({linkPlaceholder:{defaultMessage:"Paste in https://…",id:"bookmarkBlock.editBookmark.linkPlaceholder"},bookmarkTitle:{defaultMessage:"Bookmark",id:"bookmarkBlock.bookmark.title"},errorMessage:{defaultMessage:"Please enter a valid link",id:"bookmarkBlock.invalidLinkError.message"}});function Ve(e,t){const{store:n}=e,o=(0,i.useRef)(null),r=(0,b.O7)(),l=(0,b.Fy)(),d=(0,c.PE)(e.store,e.disabled),p=(0,a.VK)((()=>n.getProperties()),[n]),[m,g]=(0,i.useState)(!1),f=l.isMobile||m,h=(0,a.VK)((()=>(0,ye.no)()),[]),v=(0,i.useCallback)((()=>{const e=n.getPropertyStore("caption");he.eP({environment:r,store:n}),ve.setSelectionAtEnd({store:e})}),[r,n]),y=(0,i.useCallback)((e=>(ue.bO(r,{pastedText:e,source:"bookmark_block_menu"}),pe.Ke({environment:r,store:n,url:e}))),[r,n]),_=(0,i.useCallback)((()=>{const e=le.QaF((null==p?void 0:p.link)??[]);e&&fe.D({environment:r,url:e})}),[r,p]),S=(0,i.useCallback)((e=>y(e)),[y]),k=(0,i.useCallback)((()=>{const e=o.current;if(d){if(!(e&&e instanceof Element))return;const t=e.getBoundingClientRect();ge.$(r,{originRect:t,originGap:0,isSmallWidth:!0,showArrow:!0,title:D.default.formatMessage(Ue.bookmarkTitle),currentTab:"embed",tabs:[{type:"embed",caption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Create a visual bookmark from a link.",id:"bookmarkBlock.visualBookmark.prompt"}),buttonText:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Create bookmark",id:"bookmarkBlock.visualBookmark.create"}),inputPlaceholder:D.default.formatMessage(Ue.linkPlaceholder),onChange:e=>{const t=se.D(e);ae.B(t,"url")?(ge.Z(),S(t)):me.showErrorMessage(D.default.formatMessage(Ue.errorMessage))}}]})}}),[d,r,S]),w=null!=p&&p.link?h?(0,u.jsx)(Ke,{ref:o,store:n,canEdit:d,showActionButton:f,setHover:g,hideContent:e.hideContent,disableCommentMenu:e.disableCommentMenu,disabled:e.disabled}):(0,u.jsx)(je,{ref:o,store:n,canEdit:d,showActionButton:f,setHover:g,hideContent:e.hideContent,disableCommentMenu:e.disableCommentMenu,disabled:e.disabled}):(0,u.jsx)(Le,{ref:o,store:e.store,hideContent:e.hideContent,disableCommentMenu:e.disableCommentMenu,canEdit:d,disabled:e.disabled,showActionButton:f,onClick:k,setHover:g});return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"bookmark",getBlockStore:()=>n,getNode:()=>o.current,handleCreated:k,edit:k,caption:v,embed:y,activate:_})),[_,v,y,k,n]),w)}const Ne=i.memo(i.forwardRef(Ve),l.Z);function Oe(e){let{imageURL:t,store:n}=e;const o={display:"block",width:"100%",height:"100%",objectFit:"cover"};return(0,u.jsx)("div",{style:{flexGrow:1,flexShrink:1,flexBasis:180,display:"block",position:"relative"},children:(0,u.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0},children:(0,u.jsx)(Pe.Z,{url:t,isAuthenticated:!0,permissionRecord:n.pointer,width:250,render:(e,t)=>t&&(0,u.jsx)(Ie.Z,{style:o,src:t})})})})}const Le=i.forwardRef((function(e,t){const{store:n,hideContent:o,disableCommentMenu:r,canEdit:i,disabled:a,showActionButton:l,onClick:c,setHover:d}=e;return(0,u.jsxs)(q.p,{ref:t,allowSelectionWithin:!1,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{display:"flex"},children:[(0,u.jsx)(Re.Z,{iconSvg:_e.Q,disabled:a,shouldHideRight:!l,right:i&&(0,u.jsx)(Se.Z,{store:e.store,fadeIn:!1}),onClick:c,isLoading:!1,progressPercent:0,children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Add a web bookmark",id:"bookmarkBlock.addWebBookmark.placeholder"})}),(0,u.jsx)(we.Z,{disableCommentMenu:r,hideContent:o,store:n})]})})),je=i.forwardRef((function(e,t){const{store:n,setHover:o,showActionButton:r,canEdit:l}=e,d=(0,b.O7)(),p=(0,i.useId)(),m=(0,c.rv)(n),f=(0,a.VK)((()=>n.getProperties()),[n]),h=(0,a.VK)((()=>n.getFormat()),[n]),v=le.Jcv(null==f?void 0:f.description),y=h.bookmark_cover,_=h.bookmark_icon,k=h.bookmark_loading_ttl,x=k?k-Date.now()-Ze:0,[I,C]=(0,i.useState)(x>0),T=(0,i.useCallback)((()=>o(!0)),[o]),M=(0,i.useCallback)((()=>o(!1)),[o]);(0,i.useEffect)((()=>{let e;return x>0&&(e=setTimeout((()=>{C(!1)}),x+1e3)),()=>clearTimeout(e)}),[I,x]);const P=(0,S.yK)((e=>({content:{display:"flex",flexWrap:"wrap-reverse",alignItems:"stretch",textAlign:"left",overflow:"hidden",border:`1px solid ${e.darkDividerColor}`,borderRadius:4,position:"relative",...m},loadingLabel:{minHeight:24,marginBottom:2,display:"inline-flex",alignItems:"center",color:e.mediumTextColor},link:{color:e.regularTextColor},menuButton:{position:"absolute",top:4,right:4,background:(0,g.M1)(d)}})),[m,d]),A=le.Jcv(null==f?void 0:f.link);let R=le.Jcv(null==f?void 0:f.title);if(A===R||!R){const e=ce.Qc(A);e.hostname&&(R=e.hostname)}return(0,u.jsxs)(q.p,{role:"figure",ref:t,"aria-labelledby":p,allowSelectionWithin:!0,children:[(0,u.jsxs)("div",{style:{display:"flex"},children:[(0,u.jsx)(Be.Z,{permissionRecord:n.pointer,url:A,render:(t,n)=>(0,u.jsxs)(Ce.Z,{href:n,external:!0,style:{flexGrow:1,minWidth:0},innerStyle:P.content,onMouseMove:T,onMouseLeave:M,children:[(0,u.jsxs)("div",{style:Fe,children:[I?(0,u.jsxs)(Ae.Z,{style:P.loadingLabel,children:[(0,u.jsx)(Te.Z,{style:{marginRight:8}})," ",(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Fetching preview",id:"bookmarkBlock.loadWhileFetching.message"})]}):(0,u.jsx)(Ae.Z,{style:{minHeight:24,marginBottom:2},children:R}),v&&(0,u.jsx)(Ae.Z,{isSmall:!0,isMultiline:!0,style:{height:32,overflow:"hidden"},children:v}),(0,u.jsxs)("div",{style:{display:"flex",marginTop:6},children:[_&&_.length>0&&(0,u.jsx)(Pe.Z,{url:_,isAuthenticated:!0,permissionRecord:e.store.pointer,render:(e,t)=>t&&(0,u.jsx)("img",{src:t,style:Ee})}),(0,u.jsx)(Ae.Z,{style:P.link,isSmall:!0,children:A})]})]}),y&&(0,u.jsx)(Oe,{store:e.store,imageURL:y}),r&&l&&(0,u.jsx)(Se.Z,{store:e.store,style:P.menuButton,iconStyle:{fill:w.ZP.white},fadeIn:!0})]})}),(0,u.jsx)(we.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store})]}),(0,u.jsx)(ke.Z,{store:e.store,captionAriaId:p,disabled:e.disabled})]})})),Ke=i.forwardRef((function(e,t){const{store:n,setHover:o,showActionButton:r,canEdit:s}=e,l=(0,i.useId)(),d=(0,b.Fy)(),p=(0,c.rv)(n),m=(0,a.VK)((()=>n.getProperties()),[n]),{imageURL:g,faviconURL:f,loadingTtl:h}=(0,a.VK)((()=>{const e=n.getFormat();return{imageURL:e.bookmark_cover,faviconURL:e.bookmark_icon,loadingTtl:e.bookmark_loading_ttl}}),[n]),v=le.Jcv(null==m?void 0:m.description),y=h?h-Date.now()-Ze:0,[_,k]=(0,i.useState)(y>0),x=(0,i.useCallback)((()=>o(!0)),[o]),I=(0,i.useCallback)((()=>o(!1)),[o]);(0,i.useEffect)((()=>{let e;return y>0&&(e=setTimeout((()=>{k(!1)}),y+1e3)),()=>clearTimeout(e)}),[_,y]);const C=(0,S.yK)((e=>({content:{display:"flex",flexWrap:"wrap-reverse",alignItems:"stretch",textAlign:"left",overflow:"hidden",border:`1px solid ${e.darkDividerColor}`,borderRadius:4,position:"relative",...p},loadingLabel:{minHeight:24,marginBottom:2,display:"inline-flex",alignItems:"center",color:e.mediumTextColor},link:{color:e.regularTextColor},menuButton:{position:"absolute",top:4,right:4,border:"1px solid var(--Stroke-Deemphasized, rgba(227, 226, 224, 0.50))",background:"dark"===e.mode?e.accentColors.gray[100]:e.buttonBackground,zIndex:1,cursor:"pointer",transition:"box-shadow 0.1s ease, background 0.1s ease",borderRadius:6},mainContainer:{display:"flex",flexDirection:d.isMobile?"column":"row",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",borderRadius:4,border:`1px solid ${e.tableDividerColor}`,position:"relative",...p},imageContainer:{height:154,position:"relative",flexGrow:1,flexShrink:1,flexBasis:100,overflow:"hidden",display:"block",width:"-webkit-fill-available"},contentContainer:{display:"flex",width:"--webkit-fill-available",padding:"18px 24px 14px 24px",gap:8,flexDirection:"column",flex:"1 0 0",justifyContent:"space-between",alignItems:"flex-start",alignSelf:"stretch",flexGrow:4,flexShrink:1,flexBasis:d.isMobile?145:180,overflow:"hidden",textAlign:"left"}})),[p,d]),T=le.Jcv(null==m?void 0:m.link);let M=le.Jcv(null==m?void 0:m.title);if(T===M||!M){const e=ce.Qc(T);e.hostname&&(M=e.hostname)}return(0,u.jsxs)(q.p,{role:"figure",ref:t,"aria-labelledby":l,allowSelectionWithin:!0,children:[(0,u.jsxs)(Ce.Z,{href:T,external:!0,style:C.mainContainer,onMouseMove:x,onMouseLeave:I,children:[g&&(0,u.jsx)("div",{style:C.imageContainer,children:(0,u.jsx)("div",{style:{position:"absolute",inset:0},children:(0,u.jsx)(Ie.Z,{src:g,style:{width:"100%",height:"100%",borderTopLeftRadius:3,borderBottomLeftRadius:3,position:"relative",objectFit:"cover"}})})}),(0,u.jsxs)(De.Ht,{style:C.contentContainer,children:[(0,u.jsxs)(De.Ht,{style:{alignSelf:"stretch",gap:3},children:[f&&f.length>0&&(0,u.jsx)(xe.Z,{type:"image_url",imageURL:f,size:24,style:{margin:1}}),(0,u.jsx)(Me.q,{styleName:"UIHeader-17px/Medium",colorName:"primary",customStyles:{...(0,be.pd)(1),textOverflow:"ellipsis"},children:M}),v&&(0,u.jsx)(Me.q,{styleName:"UIMedium-13px/Regular",colorName:"primary",customStyles:{...(0,be.pd)(2),textOverflow:"ellipsis"},children:v})]}),(0,u.jsx)(De.Ht,{style:{alignSelf:"stretch"},children:(0,u.jsx)(Me.q,{styleName:"UIMedium-13px/Regular",colorName:"secondary",customStyles:{...(0,be.pd)(1)},children:T})})]}),r&&s&&(0,u.jsx)(Se.Z,{store:e.store,style:C.menuButton,iconStyle:{fill:w.ZP.uiGray},fadeIn:!0})]}),(0,u.jsx)(ke.Z,{store:e.store,captionAriaId:l,disabled:e.disabled})]})}));var ze=n(949271),qe=n(303043);function He(e,t){const n=(0,i.useRef)(null),o=(0,b.Fy)(),r=(0,c.PE)(e.store,e.disabled),s=(0,a.VK)((()=>e.store.getNavigableBlockStore()),[e.store]),l=s?(0,u.jsxs)(q.p,{allowSelectionWithin:!0,style:{display:"flex",paddingTop:ze.ZD.paddingTop,paddingBottom:ze.ZD.paddingBottom},ref:n,children:[(0,u.jsx)(qe.l2,{showCurrentPageControls:!1,ancestorMaxWidth:200,currentPageMaxWidth:300,store:s,maxAncestorCount:3,isMobile:o.isMobile,style:{flexGrow:1,minWidth:0,fontSize:"inherit"}}),o.isMobile&&r&&(0,u.jsx)(Se.Z,{store:e.store,fadeIn:!0,style:{marginTop:2,marginRight:4}}),(0,u.jsx)(we.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store})]}):null;return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"breadcrumb",getNode:()=>n.current,getBlockStore:()=>e.store})),[e.store]),l)}const Ge=i.memo(i.forwardRef(He),l.Z);var We=n(7825),$e=n(27755),Ye=n(638376),Qe=n(706740),Je=n(117397),Xe=n(180951),et=n(719233),tt=n(23867),nt=n(542297),ot=n(776757),rt=n(583960),it=n(385555),at=n(800893),st=n(867040),lt=n(462385);function ct(e){const t=(0,b.O7)(),n=(0,b.Fy)(),o=(0,S.Fg)(),r=(0,c.PE)(e.store,e.disabled),a=(0,i.useCallback)((()=>{const n=le.Jcv(e.store.getBlockTitleStore().getValue());at.RD({environment:t,stringValue:n,copiedMessage:at.tq.copiedCodeToClipboard})}),[t,e.store]),l={height:25,background:o.codeBlockButtonBackground,color:o.regularTextColor,fontWeight:x.Z.fontWeight.regular,padding:"4px 6px",fontSize:11.5};return(0,u.jsxs)("div",{style:{color:o.mediumTextColor,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,marginTop:4,marginRight:4},children:[!n.isMobile&&(0,u.jsxs)(lt.Z,{onClick:a,style:{...l,borderTopRightRadius:0,borderBottomRightRadius:0},children:[(0,st.U)({height:16,width:16,paddingRight:4}),(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Copy",id:"codeBlock.copyToClipboard.button"})]}),!n.isMobile&&r&&(0,u.jsx)(lt.Z,{onClick:e.handleEditCaption,style:{...l,marginLeft:1,marginRight:1,borderRadius:0},children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Caption",id:"codeBlock.caption.button"})}),r&&(0,u.jsx)(Se.Z,{style:{height:25,background:o.codeBlockButtonBackground,borderTopLeftRadius:n.isMobile?3:0,borderBottomLeftRadius:n.isMobile?3:0,paddingLeft:8,paddingRight:8},store:e.store,fadeIn:!1})]})}var dt=n(401898),ut=n(442274),pt=n(672495),mt=n(132502);const gt=(0,d.IU)("codePreviewOnly",{viewBox:"0 0 24 20",svg:(0,u.jsx)("path",{d:"M2.608 11.906h1.21v1.032c0 1.463.766 2.215 2.243 2.215h9.33c1.477 0 2.243-.758 2.243-2.215V6.444c0-1.463-.766-2.221-2.242-2.221H14.12V3.197c0-1.463-.772-2.221-2.242-2.221h-9.27C1.132.976.366 1.734.366 3.197v6.494c0 1.457.766 2.215 2.242 2.215zm.082-1.34c-.635 0-.984-.328-.984-.99v-6.27c0-.662.349-.99.984-.99h9.106c.629 0 .984.328.984.99v.917H6.06c-1.476 0-2.242.758-2.242 2.221v4.122H2.69zm3.453 3.254c-.636 0-.985-.335-.985-.998V6.561c0-.664.349-.998.985-.998h9.167c.628 0 .984.334.984.998v6.261c0 .663-.356.998-.984.998H6.143zm2.713-1.77c0 .307.335.437.595.287l3.972-2.324a.372.372 0 00-.007-.643L9.451 7.046c-.26-.15-.595-.027-.595.287v4.717z"})}),ft=(0,d.IU)("splitView",{viewBox:"0 0 24 20",svg:(0,u.jsx)("path",{d:"M13.456 11.143V2.864c0-1.476-.766-2.242-2.222-2.242H2.915C1.452.622.693 1.388.693 2.864v8.278c0 1.477.76 2.243 2.222 2.243h8.32c1.462 0 2.221-.766 2.221-2.242zm-1.34-.083c0 .636-.335.985-.998.985H3.024c-.663 0-.99-.349-.99-.985V7.663h10.082v3.397zM2.033 2.946c0-.629.328-.984.991-.984h8.094c.663 0 .998.355.998.984v3.405H2.033V2.946z"})});var ht=n(62967);const vt=(0,s.defineMessages)({showCodePreviewSection:{id:"action.codePreviewSection.name",defaultMessage:"Show in block"}}),yt=(0,ht.cN)({key:"show code",displayName:ht.RE.showOnlyCodeFormat,analyticsName:ht.RE.showOnlyCodeFormat.defaultMessage,svg:mt._,validators:[],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;ut.pZ({environment:n,blocks:t,previewFormat:"code"})}}),bt=(0,ht.cN)({key:"show preview on code block",displayName:ht.RE.showCodePreviewFormat,analyticsName:ht.RE.showCodePreviewFormat.defaultMessage,svg:gt,validators:[],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;ut.pZ({environment:n,blocks:t,previewFormat:"preview"})}}),_t=(0,ht.cN)({key:"show code and preview",displayName:ht.RE.showSplitViewFormat,analyticsName:ht.RE.showSplitViewFormat.defaultMessage,svg:ft,validators:[],closeParentMenu:!0,action:e=>{let{blocks:t,environment:n}=e;ut.pZ({environment:n,blocks:t,previewFormat:"split_view"})}}),St=[{key:"code preview actions block",render:e=>(0,u.jsx)(pt.Z,{isTitleUppercase:!1,...e}),title:D.default.formatMessage(vt.showCodePreviewSection),actions:[yt,bt,_t]}];var kt=n(460709),wt=n(61766),xt=n(960709),It=(n(21703),n(966673)),Ct=n(471924),Tt=n(657347),Mt=n(296994);const Pt="\n---\n";var At=n(942402);const Rt=(()=>{try{return"true"===new URLSearchParams(window.location.search).get("disableMermaid")}catch(e){return!1}})(),Dt={lineHeight:1.16};function Bt(e){const{mermaidAPI:t,source:n}=e,o=(0,i.useRef)(null),r=(0,i.useRef)(`mermaid-${Ct.Il()}`),[a,s]=(0,i.useState)(),l=(0,S.yK)((e=>({diagram:(0,De.xk)({alignContent:"center",justifyContent:"center"})})),[]),c=function(e){switch(e){case"dark":return"dark";case"light":return"neutral";default:(0,dt.t1)(e)}}((0,S.Fg)().mode),d=(0,i.useMemo)((()=>function(e){const{source:t,theme:n}=e,o=`%%{init: {'theme':'${n}'}}%%\n`;return t.startsWith("---\n")&&t.includes(Pt)?t.replace(Pt,`${Pt}${o}`):`${o}${t}`}({source:n,theme:c})),[n,c]);return(0,i.useLayoutEffect)((()=>{if(!t)return;let e=!1;try{t.render(r.current,d).then((t=>{const n=t.svg,r=t.bindFunctions;if(e)return;if(!o.current)return;o.current.innerHTML=n;const i=o.current.firstChild;i&&i instanceof SVGSVGElement&&i.removeAttribute("height");try{r&&r(o.current),s(void 0)}catch(a){s((0,Tt.t)(a))}}),(e=>{s((0,Tt.t)(e))}))}catch(n){s((0,Tt.t)(n))}return()=>{e=!0}}),[d,t]),(0,u.jsxs)(u.Fragment,{children:[a&&(0,u.jsx)(Et,{error:a}),(0,u.jsx)("div",{style:l.diagram,ref:o})]})}function Et(e){const{error:t}=e,n=(0,S.yK)((e=>({label:{color:e.errorText,marginBottom:4,whiteSpace:"pre-wrap"}})),[]);return"str"in t?(0,u.jsx)("div",{children:(0,u.jsxs)(Ae.Z,{isMultiline:!0,style:n.label,children:[t.str,(0,u.jsx)("div",{children:(0,u.jsx)(At.Z,{external:!0,href:"https://mermaid-js.github.io/mermaid/#/examples",children:(0,u.jsx)(s.FormattedMessage,{id:"mermaidRenderer.error.seeMermaidExamples",defaultMessage:"See Mermaid examples"})})})]})}):(0,u.jsx)(Ae.Z,{isMultiline:!0,style:n.label,children:(0,u.jsx)(s.FormattedMessage,{id:"mermaidRenderer.error.unknownError",defaultMessage:"Syntax error in Mermaid diagram: {error}",values:{error:`${t.name}: ${t.message}`}})})}function Ft(e){const t=(0,a.VK)((()=>e.store.getBlockTitleStore()),[e.store]),n="code"===e.currentCodePreviewFormat,o=(0,i.useMemo)((()=>Ut(e.currentLanguage)),[e.currentLanguage]),r=(0,a.VK)((()=>t.getValue()),[t]);if(n||!r||!o)return null;const s=o.component;return(0,u.jsx)("div",{style:Nt(e.currentCodePreviewFormat),children:(0,u.jsx)(s,{source:M.Xh(r,t)})})}const Zt={Mermaid:{component:function(e){const{source:t}=e,n=(0,It.Kt)(t,300,Object.is),o=(0,E.XJ)(Mt.FF.mermaidAPI),r=Rt?new Error("Mermaid is disabled because 'disableMermaid=true' was in the query string when the page loaded. Reload the page to re-enable Mermaid."):o.error;return(0,u.jsx)("div",{style:r?void 0:Dt,children:r?(0,u.jsx)(Et,{error:r}):(0,u.jsx)(Bt,{mermaidAPI:o.value,source:n})})}}};function Ut(e){const t=(0,dt.qg)(Zt,e)?Zt[e]:void 0;if(t)return t}function Vt(e){return Boolean(Ut(e))}function Nt(e){switch(e){case"split_view":return{padding:16,flexGrow:1,flexShrink:0};case"preview":return{padding:16,paddingTop:40,alignSelf:"center",flexGrow:1,flexShrink:0};case"code":return{};default:(0,dt.t1)(e)}}var Ot=n(748019),Lt=n(231945),jt=n(478140);function Kt(e){const t=(0,b.O7)(),n=(0,b.Fy)(),o=(0,S.Fg)(),r=(0,c.PE)(e.store,e.disabled),s=(0,a.qz)(void 0,wt.Z),l=(0,i.useCallback)((o=>{const r=(0,u.jsx)(Ot.Z,{context:{blocks:[e.store],environment:t,publicEditMode:void 0},sections:St,initialFocus:["code","preview","split_view"].findIndex((t=>t===e.currentCodePreviewFormat)),onAccept:o.close});let i;return i=n.isMobile?{menuType:kt.og.ActionSheet}:{menuType:kt.og.Popup,width:167,maxHeight:"50vh"},(0,u.jsx)(jt.Z,{...i,children:r})}),[n.isMobile,t,e.currentCodePreviewFormat,e.store]);return Vt(e.currentLanguage)?(0,u.jsx)(Lt.ZP,{popupType:n.isMobile?Lt.Z4.SlideUp:Lt.Z4.Popup,renderOrigin:t=>(0,u.jsxs)(lt.Z,{disabled:!r,style:{marginRight:5},...t,children:[zt(e.currentCodePreviewFormat),r&&(0,Z.i)({width:10,marginLeft:4,fill:o.lightIconColor})]}),buttonPopupStore:s,placementToOrigin:xt.Iw.Bottom,render:l}):null}function zt(e){let t;switch(e){case"split_view":t=ht.RE.showSplitViewFormat;break;case"preview":t=ht.RE.showCodePreviewFormat;break;case"code":t=ht.RE.showOnlyCodeFormat;break;default:(0,dt.t1)(e)}return(0,u.jsx)(s.FormattedMessage,{...t})}var qt=n(915157),Ht=n(210228),Gt=n(552275),Wt=n(268894);function $t(e){const t=(0,s.useIntl)(),n=(0,b.O7)(),o=(0,b.Fy)(),r=(0,S.Fg)(),l=(0,c.PE)(e.store,e.disabled),[d,p]=(0,i.useState)(""),m=(0,a.qz)(void 0,wt.Z),g=(0,i.useCallback)((e=>{p(e.target.value)}),[]),f=(0,i.useCallback)((()=>{p("")}),[]),h=(0,i.useCallback)((t=>{Ht.createAndCommit({userAction:"CodeBlock.setPersistedLanguage",environment:n,perform:n=>{ut.E5({blocks:[e.store],language:t,transaction:n})}}),qt.Z.set({userId:n.currentUser.id,key:rt.T.localLanguagePreferenceKey,value:t})}),[n,e.store]),v=(0,i.useCallback)((r=>{const i=Je.X0.filter((e=>"Java/C/C++/C#"!==e)),a=[{key:0,render:e=>(0,u.jsx)(pt.Z,{...e}),actions:i.map((e=>{const t={key:e,displayName:e,analyticsName:e,searchName:e,render:t=>(0,u.jsx)(Gt.Z,{title:e,...t}),action:()=>{h(e),r.close()},closeParentMenu:!0};return t}))}],l=(0,u.jsx)(Ot.Z,{filter:d,context:{blocks:[],environment:n,publicEditMode:void 0},sections:a,initialFocus:d?0:i.findIndex((t=>t===e.currentLanguage))}),c=(0,u.jsx)(pt.Z,{isInput:!0,children:(0,u.jsx)(Wt.ZP,{value:d,onChange:g,focus:!o.isMobile||void 0,placeholder:t.formatMessage(ht.RE.searchPlaceholder),focusAfterAnimation:!0})});let p;return p=o.isMobile?{menuType:kt.og.Modal,title:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Language",id:"codeBlock.mobileLanguageMenu.title"}),right:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Done",id:"codeBlock.mobileLanguageMenu.doneButton.label"}),onClickRight:r.close,header:c}:{menuType:kt.og.Popup,width:240,maxHeight:"50vh",header:c},(0,u.jsx)(jt.Z,{...p,children:l})}),[e.currentLanguage,o.isMobile,n,g,t,d,h]);return(0,u.jsx)(Lt.ZP,{popupType:o.isMobile?Lt.Z4.SlideUp:Lt.Z4.Popup,renderOrigin:t=>(0,u.jsxs)(lt.Z,{disabled:!l,style:{marginRight:5},...t,children:[e.currentLanguage,l&&(0,Z.i)({width:10,marginLeft:4,fill:r.lightIconColor})]}),buttonPopupStore:m,placementToOrigin:xt.Iw.Bottom,render:v,onClose:f})}var Yt=n(328385);const Qt="opacity 300ms ease-in";function Jt(e,t){const n=(0,b.O7)(),{isMobile:o}=(0,b.Fy)(),r=(0,i.useId)(),s=(0,i.useRef)(null),{store:l,disabled:d}=e,p=(0,a.VK)((()=>{const e=l.getProperties()||{},t=Xe.Sj(e.language,nt.eg);return t&&(0,Je.L9)(t)?t:rt.T.defaultLanguage}),[l]),m=et.W[p],g=(0,a.VK)((()=>Vt(p)?l.getFormat().code_preview_format??"split_view":rt.T.defaultCodePreviewFormat),[p,l]),f=(0,a.VK)((()=>l.getFormat().code_wrap),[l]),h=(0,a.VK)((()=>l.getBlockTitleStore()),[l]),[v,y]=(0,i.useState)(!1),[_,k]=(0,i.useState)(!1),w=(0,a.VK)((()=>L.Z.state.isKeyboardMode),[]),x=(0,a.VK)((()=>it.default.checkGate({gateName:"docs_function_code_block_value"})),[]),I=(0,S.yK)((t=>({wrapper:{flexGrow:1,borderRadius:4,textAlign:"left",position:"relative",background:t.codeBlockBackground,minWidth:0,width:"100%",...e.style},languageSelector:{position:"absolute",top:8,left:8,zIndex:1,color:t.mediumTextColor,display:"flex",alignItems:"center",justifyContent:"flex-end",opacity:v||_||o?1:0,transition:Qt},header:{position:"absolute",top:3,right:1,zIndex:1,color:t.mediumTextColor,display:"flex",alignItems:"center",justifyContent:"flex-end",height:25,fontSize:11.5,opacity:o||_||!w&&v?1:0,transition:Qt},captionContainer:{background:t.contentBackground,paddingRight:105}})),[_,v,w,o,e.style]),C=(0,i.useCallback)((()=>{const e=l.getPropertyStore("caption");he.eP({environment:n,store:l}),ve.setSelectionAtEnd({store:e})}),[n,l]),T=(0,i.useCallback)((e=>{const t=e.target;t instanceof HTMLElement&&(0,Qe.E)(t)&&k(!0)}),[]),M=(0,i.useCallback)((e=>{k(!1)}),[]),P=(0,i.useCallback)((()=>{y(!0)}),[]),A=(0,i.useCallback)((()=>{y(!1)}),[]),R=(0,u.jsxs)("div",{ref:s,style:{display:"flex"},children:[(0,u.jsxs)(q.p,{role:"figure","aria-labelledby":r,allowSelectionWithin:!0,style:I.wrapper,onMouseMove:P,onMouseLeave:A,children:[(0,u.jsxs)("div",{onFocus:T,onBlur:M,style:I.languageSelector,children:[(0,u.jsx)($t,{disabled:e.disabled,store:e.store,currentLanguage:p}),(0,u.jsx)(Kt,{disabled:e.disabled,store:e.store,currentLanguage:p,currentCodePreviewFormat:g})]}),(0,u.jsx)("div",{onFocus:T,onBlur:M,style:I.header,children:(0,u.jsx)(ct,{store:e.store,disabled:e.disabled,handleEditCaption:C})}),(0,u.jsxs)("div",{children:[en(p,g)&&(x?(0,u.jsx)(ot.u,{store:h,blockStore:l,language:m,disabled:d,codeWrap:Boolean(f),isQuickFind:Boolean(e.isQuickFind),parentSpaceId:(0,tt.C)(l.pointer.spaceId)}):(0,u.jsx)(Yt.Z,{store:h,blockStore:l,language:m,disabled:d,codeWrap:Boolean(f),isQuickFind:Boolean(e.isQuickFind),parentSpaceId:(0,tt.C)(l.pointer.spaceId)})),(0,u.jsx)(Ft,{store:l,disabled:d,currentCodePreviewFormat:g,currentLanguage:p})]}),(0,u.jsx)("div",{style:I.captionContainer,children:(0,u.jsx)(ke.Z,{store:e.store,captionAriaId:r,disabled:e.disabled})})]}),(0,u.jsx)(we.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store,hideIfSidebarOrMarginCommentsVisible:!0}),"​"]});return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"code",getBlockStore:()=>l,getNode:()=>s.current,caption:C})),[C,l]),R)}const Xt=i.memo(i.forwardRef(Jt),l.Z);function en(e,t){return!Vt(e)||"preview"!==t}const tn=(0,d.IU)("codepen",{viewBox:"0 0 40 40",svg:(0,u.jsx)("path",{d:"M39.9834,13.7071 C39.8236,12.6665 38.6647,12.1063 37.8655,11.586 C36.4269,10.6255 35.0283,9.70502 33.5897,8.74452 C30.1931,6.46334 26.7564,4.18216 23.3598,1.90098 C22.5606,1.38071 21.7613,0.820424 20.9621,0.300155 C20.4027,-0.100052 19.6434,-0.100052 19.044,0.300155 C16.7663,1.82094 14.4485,3.38175 12.1708,4.90253 L2.10066,11.626 C1.22152,12.1863 0.0626603,12.7466 0.0226996,13.9472 C-0.0172612,15.2679 0.0226996,16.6286 0.0226996,17.9493 L0.0226996,24.3526 C0.0226996,25.5132 -0.217065,26.8739 0.861875,27.5943 C3.41936,29.3552 6.01681,31.036 8.61426,32.7569 C11.8111,34.878 15.008,37.0391 18.2048,39.1602 C19.084,39.7606 19.9631,40.4009 21.0421,39.6805 C21.9611,39.0802 22.8403,38.4799 23.7594,37.8796 C27.3159,35.5184 30.8724,33.1171 34.4289,30.7559 L38.385,28.1145 C38.6248,27.9544 38.9045,27.7944 39.1443,27.5943 C39.7037,27.1941 39.9435,26.6338 39.9435,25.9534 L39.9435,14.9477 C39.9834,14.5075 40.0234,14.1073 39.9834,13.7071 C39.9834,13.7871 39.9834,13.6671 39.9834,13.7071 Z M21.7214,4.94255 L35.1882,13.9472 L29.194,17.9893 L21.7214,12.9867 L21.7214,4.94255 Z M18.2848,4.94255 L18.2848,12.9467 L10.8521,17.9493 L4.81799,13.9472 L18.2848,4.94255 Z M3.45932,17.1489 L7.73512,20.0304 L3.45932,22.9118 L3.45932,17.1489 Z M18.2848,35.1182 L4.81799,26.1135 L10.8121,22.0714 L18.2448,27.074 L18.2448,35.1182 L18.2848,35.1182 Z M20.0031,24.1125 L13.929,20.0304 L20.0031,15.9482 L26.0771,20.0304 L20.0031,24.1125 Z M21.7214,35.1182 L21.7214,27.114 L29.1541,22.1114 L35.1482,26.1535 L21.7214,35.1182 Z M36.5468,22.9118 L32.271,20.0304 L36.5868,17.1489 L36.5468,22.9118 Z"})});function nn(e,t){const n=(0,i.useRef)(null),o=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"codepen",getNode:()=>{const e=n.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:o,ref:n,store:e.store,iconSvg:tn,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with any public CodePen link…",id:"codepenBlock.embed.caption"}),children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed CodePen",id:"codepenBlock.placeholder"})}))}const on=i.memo(i.forwardRef(nn),l.Z);var rn=n(153223),an=n(701302),sn=n(653965),ln=n(13084),cn=n(52989),dn=n(478175),un=n(212534),pn=n(639500),mn=n(650628),gn=n(128651),fn=n(896049);const hn={width:46,handleWidth:4};function vn(e){const t=(0,a.qz)(e.mouseStore,gn.Z),{showHandle:n,onMouseDown:o,onTouchStart:r,onContextMenu:s,onDoubleClick:l}=e,c=(0,b.O7)(),d=(0,a.VK)((()=>n&&(t.state.mouseEntered||c.device.isMobile&&fn.Z.state)),[n,t,c.device]),p=(0,i.useCallback)((()=>{t.setState({...t.state,mouseEntered:!1}),fn.Z.removeListener(p)}),[t]),m=(0,i.useCallback)((()=>{fn.Z.removeListener(p),fn.Z.state||t.setState({...t.state,mouseEntered:!0})}),[p,t]),g=(0,i.useCallback)((()=>{fn.Z.state?fn.Z.addListener(p):t.setState({...t.state,mouseEntered:!1})}),[p,t]),f=(0,S.yK)((e=>{const t={position:"relative",width:hn.width,flexGrow:0,flexShrink:0,transition:"opacity 200ms ease-out",opacity:0};return{base:t,hovered:{...t,opacity:1,cursor:"col-resize"},handle:{position:"absolute",top:0,bottom:0,left:hn.width/2-hn.handleWidth/2,width:hn.handleWidth,height:"100%",background:e.darkDividerColor}}}),[]),h=d?f.hovered:f.base;return(0,u.jsx)("div",{style:h,onDoubleClick:l,onMouseDown:o,onTouchStart:r,onContextMenu:s,onMouseEnter:m,onMouseLeave:g,children:n&&(0,u.jsx)("div",{style:f.handle})})}const yn=i.memo(vn);var bn=n(279954);function _n(e,t){const{ratio:n,store:o,isLastItem:r,disabled:s,numColumns:l}=e,d=(0,b.O7)(),p=(0,i.useRef)(!1),m=(0,c.PE)(o,s),g=i.useRef(null),f=(0,a.VK)((()=>1===o.getContentLength()),[o]),h=(0,a.VK)((()=>{const e={width:"100%"};return l>1&&(e.width=`calc((100% - ${hn.width*(l-1)}px) * ${n})`),(0,dn.zE)(o,d)||(e.width="100%"),e}),[d,l,n,o]),v=e=>{(0,dn.zE)(o,d)&&(0,un.ZP)({event:e,context:un.Af.EditorMouseDown,callback:()=>{p.current=!0,e.preventDefault(),cn.AI({environment:d,target:e.target,startX:e.clientX,startY:e.clientY,showSelectionRect:!0,preventSelectStores:[],allowVerticalEdgeScroll:!0,allowHorizontalEdgeScroll:!1})}})},y=e=>{if(p.current&&!pn.uG(e)){const{clientX:t,clientY:n,target:o}=e;an.default.afterNextFlush((()=>{ve.editNearestBlock(d,{x:t,y:n,target:o instanceof Element?o:void 0}),p.current=!1}))}},_=(0,u.jsx)(H.Z,{isVisible:!0,animationStyle:h,render:()=>(0,u.jsx)("div",{ref:g,style:wn(e.store,d),onMouseDown:v,onMouseUp:y,onClick:t=>function(e,t,n){if(mn.Z.hasBeenUpdatedSince(e.timeStamp))return;if(t.canEdit()){const{clientX:o,clientY:r,target:i}=e;an.default.afterNextFlush((()=>{Ht.createAndCommit({userAction:"Column.handleClick",environment:n,perform:e=>{ve.insertIfAtBottomOfColumn(n,{x:o,y:r,target:i instanceof Element?i:void 0},t,e)}})}))}}(t,e.store,d),children:(0,u.jsx)(bn.Z,{store:o,canDropLeft:m&&(0,dn.zE)(e.store,d),canDropRight:r&&m&&(0,dn.zE)(e.store,d),onSelectableDrop:t=>function(e,t,n,o){const{droppedDirection:r,droppedStores:i,duplicate:a}=e;Ht.createAndCommit({userAction:"Column.handleDrop",environment:o,perform:e=>{ln.LQ({environment:o,droppedDirection:r,droppedStores:i,targetParentStore:t.getContentStore(),targetStore:n,duplicate:a,transaction:e})}})}(t,e.columnListStore,e.store,d),analyticsName:"column",style:{display:"flex",flexDirection:"column"},shouldShowDropZone:!0,isListContainer:!0,children:(0,u.jsx)(Y.Z,{store:o.getContentStore(),disabled:s,disableLayout:f,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,disableDrag:e.disableDrag})})})});return(0,c.ez)(o,t,(0,i.useMemo)((()=>({renderedType:"column",getBlockStore:()=>o,getNode:()=>g.current})),[o]),_)}const Sn=i.memo(i.forwardRef(_n),l.Z),kn=12;function wn(e,t){const n={paddingTop:kn,paddingBottom:kn};return(0,dn.zE)(e,t)&&sn.f0(n,{flexGrow:0,flexShrink:0}),n}n(757658);var xn=n(541432),In=n(496802),Cn=n(21404),Tn=n(749085);class Mn extends Tn.default{getInitialState(){return{dragging:!1}}}const Pn=Mn;var An=n(723883),Rn=n(370518),Dn=n(712137),Bn=n(58202),En=n(250906);function Fn(e){const{columnListStore:t}=e;t.setState({dragging:!1})}function Zn(e){const{columnListBlockStore:t,diffX:n,columnListStore:o,leftColumnStore:r,rightColumnStore:i}=e;if(o.state.dragging){const{leftColumnStartWidth:e}=o.state,a=(0,Dn.Z)(o.state.leftColumnStartRatio,0,1),{rightColumnStartWidth:s}=o.state,l=(0,Dn.Z)(o.state.rightColumnStartRatio,0,1),c=e+s,d=a+l,u=(0,Dn.Z)(e+n,0,c),p=(0,Dn.Z)(s-n,0,c),m=d*(u/c),g=d*(p/c);if(0===u&&0===p)return o.setState({...o.state,temporaryRatios:{}}),{leftColumnNewRatio:a,rightColumnNewRatio:l};{const e=1/(8*t.getContentLength());let n=Math.round(m/e)*e,s=g+(m-n);return n<e&&(n=e,s=a+l-e),s<e&&(s=e,n=l+a-e),o.setState({...o.state,temporaryRatios:{[r.id]:n,[i.id]:s}}),{leftColumnNewRatio:n,rightColumnNewRatio:s}}}}var Un=n(706685);function Vn(e){const t=(0,a.qz)(e.mouseStore,gn.Z),{canDrag:n,columnListBlockStore:o,leftColumnBlockStore:r,rightColumnBlockStore:s,columnListStore:l}=e,c=(0,b.O7)(),d=(0,i.useCallback)((e=>{n&&(e.preventDefault(),function(e){const{environment:t,columnListStore:n,leftColumnStore:o,rightColumnStore:r}=e,i=Bn.R.getRect(o),a=Bn.R.getRect(r);i&&a&&(n.setState({dragging:!0,temporaryRatios:{},leftColumnStartWidth:i.width,leftColumnStartRatio:o.getColumnRatio(),rightColumnStartWidth:a.width,rightColumnStartRatio:r.getColumnRatio()}),he.ZH({environment:t}),ve.clear({environment:t}))}({environment:c,columnListStore:l,leftColumnStore:r,rightColumnStore:s}),he.ZH({environment:c}),ve.blurActiveElement())}),[n,c,r,l,s]),p=(0,i.useCallback)((e=>{n&&Zn({columnListBlockStore:o,columnListStore:l,leftColumnStore:r,rightColumnStore:s,diffX:e.diffX})}),[n,o,l,r,s]),m=(0,i.useCallback)((e=>{Ht.createAndCommit({userAction:"ColumnDivider.handleDragEnd",environment:c,perform:t=>{n&&function(e){const{environment:t,columnListStore:n,transaction:o,leftColumnStore:r,rightColumnStore:i}=e,a=Zn(e);if(a){const{leftColumnNewRatio:e,rightColumnNewRatio:s}=a;In.FH({stores:[r],update:{column_ratio:e},transaction:o}),In.FH({stores:[i],update:{column_ratio:s},transaction:o}),n.state.dragging&&n.setState({...n.state,temporaryRatios:{}}),En.wy(t)}}({environment:c,columnListBlockStore:o,columnListStore:l,leftColumnStore:r,rightColumnStore:s,diffX:e.diffX,transaction:t})}}),Fn({columnListStore:l})}),[n,o,l,c,r,s]),g=(0,i.useCallback)((()=>{Fn({columnListStore:l})}),[l]),f=(0,i.useCallback)((()=>{Ht.createAndCommit({userAction:"ColumnDivider.handleDoubleClick",environment:c,perform:e=>{n&&function(e){const{columnListBlockStore:t,transaction:n,environment:o}=e,r=1/t.getContentLength();In.FH({stores:t.getContentStores(),update:{column_ratio:r},transaction:n}),En.n2(o)}({environment:c,columnListBlockStore:o,transaction:e})}})}),[n,o,c]);return n?(0,u.jsx)(Un.Z,{allowDragWhileTextEditing:!0,onDraggableDragStart:d,onDraggableDragMove:p,onDraggableDragEnd:m,onDraggableDragCancel:g,disableHorizontalEdgeScroll:!0,disableVerticalEdgeScroll:!0,render:e=>(0,u.jsx)(yn,{showHandle:!0,mouseStore:t,onDoubleClick:f,...e})}):(0,u.jsx)(yn,{mouseStore:t,showHandle:!1})}const Nn=i.memo(Vn),On={display:"flex",position:"relative",flexGrow:1};function Ln(e,t){const n=(0,b.O7)(),o=(0,c.PE)(e.store,e.disabled),r=(0,i.useRef)(null),s=(0,a.qz)(void 0,Pn),l=(0,a.qz)(void 0,m.Z),{store:d}=e,p=(0,a.VK)((()=>(0,dn.zE)(d,n)),[n,d]),g=(0,i.useCallback)((()=>{const e=d.getContentStores()[0];if(e&&e.getType()===xn.Ti.column){const t=e.getContentStores()[0];t&&t.getType()===xn.Ti.text&&(he.eP({environment:n,store:t}),ve.setSelectionAtStart({store:t.getBlockTitleStore()}))}}),[n,d]),f=(0,i.useCallback)((()=>{Ht.createAndCommit({userAction:"ColumnList.handleResizeDoubleClick",environment:n,perform:e=>{if(d.canEdit()){const t=!d.getFormat().block_full_width;In.FH({stores:[d],transaction:e,update:{block_full_width:t}})}}})}),[n,d]),h=(0,a.VK)((()=>{const{limitParents:t}=An.Z.state;let n;return e.store.findRecordStoreUIAncestor((o=>{const r=t.get(o);return!!r&&(n=r[e.store.id],!0)})),n}),[e.store]),v=(0,a.VK)((()=>o&&(0,dn.Po)(e.store,n)),[o,n,e.store]);let y=(0,a.VK)((()=>e.store.getContentStores()),[e.store]);const{disabled:_}=e;sn.hj(h)&&(y=sn.tP(y,0,h));let S=(0,a.VK)((()=>y.map(((e,t)=>{let n;return n=s.state.dragging&&s.state.temporaryRatios.hasOwnProperty(e.id)?s.state.temporaryRatios[e.id]:e.getColumnRatio(),n}))),[s,y]);const k=sn.Sm(S);S=sn.UI(S,(e=>e/k));const w=[];y.forEach(((t,n)=>{const r=0===n,i=n===y.length-1;w.push((0,u.jsx)(Sn,{store:t,isFirstItem:r,isLastItem:i,numColumns:y.length,ratio:S[n],disabled:_,columnListStore:e.store},t.id)),i||w.push((0,u.jsx)(Nn,{canDrag:o,columnListBlockStore:e.store,leftColumnBlockStore:t,rightColumnBlockStore:y[n+1],columnListStore:s},`divider${t.id}`))}));const x=(0,a.VK)((()=>{const e=Boolean(d.getFormat().block_full_width),t=e&&l.state.dragging?l.state.temporaryFullWidth:e;return{position:"relative",transition:"padding 0.2s linear",paddingLeft:t?hn.width:void 0,paddingRight:t?hn.width:void 0}}),[l,d]),I=(0,i.useMemo)((()=>({getNode:()=>r.current})),[]);let C;return C=v?(0,u.jsx)("div",{ref:r,style:x,children:(0,u.jsxs)("div",{style:On,children:[(0,u.jsx)(Rn.ZP,{disabled:!o,blockResizerStore:l,resizeComponent:I,resizerType:Rn.IS.Horizontal,resizerAlignment:Rn.bZ.Left,preserveScale:!0,resizeHorizontally:!0,resizeVertically:!1,store:e.store,children:(0,u.jsx)("div",{style:Kn("left"),children:(0,u.jsx)(yn,{onDoubleClick:f,showHandle:o})})},"divider-left-edge"),w,(0,u.jsx)(Rn.ZP,{disabled:!o,resizeComponent:I,resizerType:Rn.IS.Horizontal,resizerAlignment:Rn.bZ.Right,preserveScale:!0,resizeHorizontally:!0,resizeVertically:!1,store:e.store,blockResizerStore:l,children:(0,u.jsx)("div",{style:Kn("right"),children:(0,u.jsx)(yn,{onDoubleClick:f,showHandle:o})})},"divider-right-edge")]})}):(0,u.jsx)("div",{ref:r,style:{display:p?"flex":"block"},children:w}),(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"column_list",getBlockStore:()=>e.store,getNode:()=>r.current,handleCreated:g})),[g,e.store]),(0,u.jsx)(Cn.pT,{value:!0,children:C}))}const jn=i.memo(i.forwardRef(Ln),l.Z);function Kn(e){return{display:"flex",position:"absolute",top:0,bottom:0,right:"left"===e?"100%":"auto",left:"right"===e?"100%":"auto"}}var zn=n(591948);function qn(e,t){const n=i.useRef(null),o=(0,S.yK)((()=>({root:{minHeight:"1.5em",display:"flex",alignItems:"center"},wrapper:{...ze.ZD},progressBar:{flex:1,margin:"0 8px"}})),[]);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"copy_indicator",getNode:()=>n.current,getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(q.p,{allowSelectionWithin:!1,style:o.wrapper,ref:n,children:(0,u.jsxs)("div",{style:o.root,children:[(0,u.jsx)(Te.Z,{}),(0,u.jsx)("div",{style:o.progressBar,children:(0,u.jsx)(zn.Z,{targetRecordId:e.store.id})})]})}))}const Hn=i.memo(i.forwardRef(qn),l.Z),Gn=(0,d.IU)("deepnote",{viewBox:"0 0 92 92",svg:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("path",{fill:"#fff",d:"M0 0h92v92H0z"}),(0,u.jsx)("path",{fill:"#0265B4",fillRule:"evenodd",d:"M20 73h22.153l12.461-4.673-4.673-18.346-14.365 1.558L20 73z",clipRule:"evenodd"}),(0,u.jsx)("path",{fill:"#002868",fillRule:"evenodd",d:"M42.153 73s7.004-3.695 8.3-10.242c1.296-6.546-5.1-11.22-14.876-11.22 0-.172 8.582-12.114 8.582-12.114l20.84.605-4.622 24.407-8.628 6.74L42.153 73z",clipRule:"evenodd"}),(0,u.jsx)("path",{fill:"#3793EF",fillRule:"evenodd",d:"M20 44.615l17.307-25.614s.424.004 1.385 0c6.784-.03 34.268 1.315 34.268 25.467 0 27.57-30.807 28.53-30.807 28.53s12.865-2.463 12.865-14.687-11.619-13.696-19.095-13.696H20z",clipRule:"evenodd"})]})}),Wn=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Deepnote",id:"deepnoteBlock.embeds.button.label"}});function $n(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"deepnote",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:Gn,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Deepnote blocks with public links",id:"deepnoteBlock.embeds.caption"}),embedButtonText:n.formatMessage(Wn.embedButtonText),urlInputPlaceholder:"https://deepnote.com/…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed Deepnote",id:"deepnoteBlock.placeholder"})}))}const Yn=i.memo(i.forwardRef($n),l.Z);var Qn=n(106404),Jn=n(27724),Xn=n(661519);function eo(e,t){let{store:n}=e;const o=(0,b.Fy)(),r=(0,b.O7)(),a=(0,i.useRef)(null),s=(0,S.yK)((e=>({root:{color:e.darkDividerColor,pointerEvents:"auto"}})),[]),l=(0,i.useCallback)((e=>{o.isMobile&&(he.Ys({environment:r,store:n}),Qn.Qn({environment:r,stores:Jn.default.state.stores,left:e.clientX,top:e.clientY,actionSectionGroupKey:"default",showInput:!0,analyticsFrom:"content_block_menu"}))}),[o.isMobile,r,n]);return(0,c.ez)(n,t,(0,i.useMemo)((()=>({renderedType:"divider",getNode:()=>a.current,getBlockStore:()=>n,handleCreated(){Ht.createAndCommit({userAction:"DividerBlock.handleCreated",environment:r,perform:e=>ln.Bm({environment:r,targetStore:n,targetParentStore:n.getRecordStoreUIParent(),isAtStartOfLine:!1,isClick:!1,transaction:e})})}})),[r,n]),(0,u.jsx)(Xn.Z,{className:T.QSt,size:13,style:s.root,onClick:l,ref:a}))}const to=i.memo(i.forwardRef(eo),l.Z);function no(e,t){const n=(0,i.useRef)(null),o=(0,b.O7)(),r=(0,ye.A3)()?{source:"https://www.notion.so/product/drawing"}:{};return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"drawing",getNode:()=>{const e=n.current;return e?e.getNode():null},getBlockStore:()=>e.store,handleCreated(){ve.clear({environment:o}),he.Z5({environment:o,stores:[e.store],phase:Jn.SelectionPhase.Editing})}})),[o,e.store]),(0,u.jsx)(g.ZP,{...e,...r,ref:n,mediaMenuTabs:[],disableMediaMenu:!0,preserveScale:!1,showURLInput:!1}))}const oo=i.memo(i.forwardRef(no),l.Z);var ro=n(953150),io=n(407057),ao=n(191584),so=n(800993),lo=n(668422),co=n(963085),uo=n(328415),po=n(643012);class mo extends Tn.default{getInitialState(){return{error:!1,loading:!1}}}const go=mo,fo={flexGrow:1,flexShrink:1,flexBasis:180,overflow:"hidden",textAlign:"left",justifyContent:"center",display:"flex",flexDirection:"column"},ho={display:"block",width:"100%",height:"100%",objectFit:"cover",objectPosition:"top"},vo={position:"absolute",top:0,left:0,right:0,bottom:0},yo={display:"block",position:"relative",width:"100%",paddingBottom:"55%"},bo=(0,s.defineMessages)({menuTitle:{defaultMessage:"Embed",id:"googleDriveBlock.mediaMenuActions.embedTab.title"}});function _o(e,t){const{store:n}=e,o=(0,ro.Z)(),r=(0,i.useRef)(null),l=(0,b.O7)(),d=(0,c.PE)(e.store,e.disabled),{properties:p,format:m}=(0,a.VK)((()=>({properties:n.getProperties(),format:n.getFormat()})),[n]),g=(0,a.qz)(void 0,go),[f,h]=(0,i.useState)(!1),v=(0,i.useCallback)((async e=>{const t=co.id(e);if(!t)return void Co(e,n,l);const o=await ao.Ui({environment:l,store:n,fileId:t});o&&o.auth_error&&(ao.cR(l,{onSuccess:e=>{Zo(t,e,l,n,g)},onFailure:()=>{Co(e,n,l)}}),To("url_embed",l))}),[g,l,n]),y=(0,i.useCallback)((()=>{const{device:e}=l,t=[];return t.push({type:"embed",caption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with any file in your Google Drive",id:"googleDriveBlock.embedTab.caption"}),buttonText:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed Google Drive file",id:"googleDriveBlock.embedTab.embedButton.label"}),onChange:e=>{ge.Z(),v(e)}}),e.isMobile||t.push({type:"drive",title:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Browse Google Drive",id:"googleDriveBlock.mediaPicker.googleDriveTab.title"}),onSelect:async e=>{if(ge.Z(),e&&e.token)Uo(e.token,l,n,g),ue.uu(l);else{const e=await ao.qN(l);e&&e.token&&Uo(e.token,l,n,g),To("drive_file_picker",l)}}}),t}),[g,l,v,n]),_=(0,i.useCallback)((()=>{const{device:e}=l;if(d){const t=r.current;if(t&&t instanceof Element){const n=t.getBoundingClientRect();ge.$(l,{originRect:n,originGap:0,isSmallWidth:!1,showArrow:!0,currentTab:e.isMobile?"embed":"drive",tabs:y(),title:D.default.formatMessage(bo.menuTitle),popupWidth:320,maxHeight:420})}}}),[d,l,y]);(0,i.useEffect)((()=>{m&&m.drive_properties&&m.drive_properties.file_id&&m.drive_status&&m.drive_status.last_fetched+5*de.hM<Date.now()&&ao.WO(l,{id:n.id,spaceId:(0,tt.C)(n.pointer.spaceId)})}),[l,m,n.id,n.pointer.spaceId]);const S=(0,i.useCallback)((()=>h(!0)),[h]),k=(0,i.useCallback)((()=>h(!1)),[h]),w=(0,u.jsx)(q.p,{allowSelectionWithin:!0,ref:r,style:{position:"relative"},children:m&&m.drive_properties&&m.drive_status?(0,u.jsx)(ko,{...e,store:n,canEdit:d,captionAriaId:o,fileData:m.drive_properties,driveStore:g,shouldShowActionButton:Fo(l,f),handleMouseEnter:S,handleMouseLeave:k}):p&&p.source?(0,u.jsx)(xo,{...e,store:n,handleMouseEnter:S,handleMouseLeave:k}):(0,u.jsx)(wo,{...e,store:n,onClick:_,shouldShowActionButton:Fo(l,f),canEdit:d,driveStore:g,handleMouseEnter:S,handleMouseLeave:k})});return(0,c.ez)(n,t,(0,i.useMemo)((()=>({renderedType:"drive",getBlockStore:()=>n,getNode:()=>r.current,handleCreated:_,initializeGoogleDriveBlockFromUrl:v})),[_,v,n]),w)}const So=i.memo(i.forwardRef(_o),l.Z);function ko(e){const{store:t,fileData:n,captionAriaId:o,driveStore:r,canEdit:i,disableCommentMenu:a,hideContent:s,disabled:l,shouldShowActionButton:d,handleMouseEnter:p,handleMouseLeave:m}=e,g=(0,c.rv)(t),f=(0,S.yK)((t=>({linkBox:{display:"flex",alignItems:"center",border:`1px solid ${t.tableDividerColor}`,borderRadius:4,borderTopLeftRadius:0,borderTopRightRadius:0,flexDirection:"column",width:"100%",...e.style,...g},title:{fontWeight:x.Z.fontWeight.medium,...x.Z.textOverflowStyle,color:t.regularTextColor},uiLabel:{color:t.mediumTextColor,fontSize:12}})),[e,g]);return(0,u.jsxs)("div",{role:"figure","aria-labelledby":o,children:[(0,u.jsxs)("div",{style:{display:"flex"},children:[(0,u.jsxs)(Ce.Z,{href:n.url,external:!0,style:f.linkBox,onMouseLeave:m,onMouseEnter:p,children:[(0,u.jsx)(Eo,{store:t,driveStore:r,fileData:n}),(0,u.jsx)(Bo,{fileData:n}),d&&i&&(0,u.jsx)(Mo,{store:t})]}),(0,u.jsx)(we.Z,{disableCommentMenu:a,hideContent:s,store:t})]}),(0,u.jsx)(ke.Z,{store:t,captionAriaId:o,disabled:l})]})}function wo(e){const{disabled:t,store:n,canEdit:o,driveStore:r,disableCommentMenu:i,hideContent:l,onClick:c,shouldShowActionButton:d,handleMouseEnter:p,handleMouseLeave:m}=e,g=(0,a.VK)((()=>n.getFormat().drive_status),[n]),f=!(!g||!g.authed),h=(0,a.VK)((()=>r.getState().loading),[r]);return(0,u.jsxs)("div",{onMouseEnter:p,onMouseLeave:m,style:{display:"flex"},children:[(0,u.jsx)(Re.Z,{iconSvg:po.c,disabled:t,shouldHideRight:d,right:o&&(0,u.jsx)(Se.Z,{store:n,fadeIn:!1}),onClick:c,isLoading:h,progressPercent:0,children:f?(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Choose a file to embed from Google Drive",id:"googleDriveBlock.placeholder.authenticated"}):(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Connect Google Drive to Notion to embed a file",id:"googleDriveBlock.placeholder.notAuthenticated"})}),(0,u.jsx)(we.Z,{disableCommentMenu:i,hideContent:l,store:n})]})}function xo(e){const{store:t,handleMouseEnter:n,handleMouseLeave:o}=e,r=(0,S.yK)((e=>({container:{overflow:"hidden",borderRadius:6,border:`1px solid ${e.tableDividerColor}`,borderBottom:void 0,position:"relative"}})),[]);return(0,u.jsx)("div",{style:r.container,children:(0,u.jsx)(g.ZP,{...e,store:t,iconSvg:po.c,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Google Docs, Google Sheets…",id:"googleDriveBlock.legacyLinkInput.caption"}),contentBelowSource:(0,u.jsx)(Io,{...e,handleMouseLeave:o,handleMouseEnter:n}),children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed a file from Google Drive",id:"googleDriveBlock.legacy.placeholder"})})})}function Io(e){const{store:t,handleMouseEnter:n,handleMouseLeave:o}=e,{properties:r,format:i}=(0,a.VK)((()=>({properties:t.getProperties(),format:t.getFormat()})),[t]),s=(0,c.rv)(t),l=(0,S.yK)((t=>({linkBox:{display:"flex",alignItems:"center",border:`1px solid ${t.tableDividerColor}`,borderRadius:4,borderLeft:"none",borderRight:"none",borderTopLeftRadius:0,borderTopRightRadius:0,padding:"8px 12px",...e.style,...s},title:{fontWeight:x.Z.fontWeight.medium,...x.Z.textOverflowStyle,color:t.regularTextColor},uiLabel:{color:t.mediumTextColor,fontSize:12}})),[e,s]),d=le.Jcv(r&&r.source);let p=i.link_title;const m=i.link_provider?`${i.link_provider} Embed`:"Google Drive Embed";d!==p&&p||(p=d.includes("spreadsheets")?"A Google Sheets file":d.includes("document")?"A Google Docs file":d.includes("presentation")?"A Google Slides file":"A Google Drive file");return(0,u.jsxs)(Ce.Z,{href:d,external:!0,style:{flexGrow:1,minWidth:0},innerStyle:l.linkBox,onMouseMove:n,onMouseLeave:o,children:[(0,u.jsx)("div",{style:{display:"flex",alignSelf:"start",height:32,width:32,marginRight:12,marginLeft:4,marginTop:3,marginBottom:3,position:"relative"},children:(0,u.jsx)(xe.Z,{type:"image_url",imageURL:"https://s3-us-west-2.amazonaws.com/public.notion-static.com/8fb58690-ee50-4584-b9fd-ca9b524f56aa/google-drive-icon-19632.png",size:38})}),(0,u.jsxs)("div",{style:fo,children:[(0,u.jsx)(Ae.Z,{style:l.title,children:p}),(0,u.jsx)("div",{style:{display:"flex"},children:(0,u.jsx)(Ae.Z,{style:l.uiLabel,isSmall:!0,children:m})})]})]})}function Co(e,t,n){Ht.createAndCommit({userAction:"DriveBlock.convertToTextBlock",environment:n,perform:o=>{so.sO({environment:t.environment,store:t.getBlockTitleStore(),value:[le.V3y(e,[le.edl(e)])],transaction:o}),lo.Cj({environment:n,blocks:[t],blockType:"text",transaction:o})}})}function To(e,t){ue.SO(t,{integration_name:"google",from:e})}function Mo(e){let{store:t}=e;const n=(0,b.O7)();return(0,u.jsx)(Se.Z,{store:t,style:{position:"absolute",top:4,right:4,background:(0,g.M1)(n)},iconStyle:{fill:w.ZP.white},fadeIn:!0})}function Po(e){return{...yo,paddingBottom:"20%",minHeight:80,background:e.embedPlaceholderBackground}}function Ao(e){return{width:"100%",minHeight:60,padding:14,paddingTop:12,overflow:"hidden",borderTop:`1px solid ${e.darkDividerColor}`}}function Ro(e){return{fontSize:12,lineHeight:1.3,color:e.mediumTextColor,maxHeight:32,overflow:"hidden"}}function Do(e){let{fileData:t}=e;const n=(0,S.Fg)(),o=t.user_name||t.modified_time?(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Last modified {hasUserName, select, true {by {userName}} other {}} {hasLastModifiedTime, select, true {{lastModifiedTime}} other {}}",id:"googleDriveBlock.pageDescription",values:{hasUserName:Boolean(t.user_name),userName:t.user_name,hasLastModifiedTime:Boolean(t.modified_time),lastModifiedTime:t.modified_time&&(0,io.tv)(t.modified_time,y.locale)}}):void 0;return(0,u.jsxs)("div",{style:Ro(n),children:[t.trashed&&(0,u.jsx)(s.FormattedMessage,{defaultMessage:"This file is in trash.",id:"googleDriveBlock.pageDeleted.caption"}),o]})}function Bo(e){let{fileData:t}=e;const n=(0,S.Fg)(),o=t.title,r=t.url,i=ce.Qc(r).hostname;return(0,u.jsxs)("div",{style:Ao(n),children:[o&&(0,u.jsx)(Ae.Z,{style:{marginBottom:2},children:o}),(0,u.jsx)(Do,{fileData:t}),(0,u.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[t.icon&&(0,u.jsx)("div",{style:(a=t.icon,{flexShrink:0,backgroundImage:`url(${a})`,backgroundSize:"cover",width:16,height:16,marginRight:6})}),(0,u.jsx)(Ae.Z,{style:{color:n.regularTextColor},isSmall:!0,children:i})]})]});var a}function Eo(e){let{fileData:t,store:n,driveStore:o}=e;const r=(0,S.Fg)(),i=(0,a.qz)(o,go),s=t.thumbnail,l=(0,a.VK)((()=>i.state.error),[i]);return s&&!l?(0,u.jsx)("div",{style:yo,children:(0,u.jsx)("div",{style:vo,children:(0,u.jsx)(Pe.Z,{url:s,width:1e3,isAuthenticated:!0,permissionRecord:n.pointer,render:(e,n)=>{if(n){const e=ce.SK(n,{v:t.version});return(0,u.jsx)("img",{src:e,style:ho,onError:e=>{i.setState({error:!0,loading:!1})}})}e&&i.setState({error:!0,loading:!1})}})})}):(0,u.jsx)("div",{style:Po(r)})}function Fo(e,t){const{device:n}=e;return n.isMobile||t}async function Zo(e,t,n,o,r){r.setState({loading:!0,error:!1});const i=await ao.Ui({environment:n,store:o,fileId:e,token:t});r.setState({loading:!1,error:!i||!!i.auth_error})}function Uo(e,t,n,o){uo.vE({environment:t,accessToken:e.accessToken,callback:r=>{Zo(r,e,t,n,o)}})}var Vo=n(83631);const No=(0,d.IU)("tex",{viewBox:"0 0 32 21",svg:(0,u.jsxs)("g",{children:[" ",(0,u.jsxs)("g",{id:"d7fc5246-3c04-467c-8f25-6c129c5642ac","data-name":"tex",children:[" ",(0,u.jsxs)("g",{id:"ec363c67-067d-4da0-8c27-f8d029e068bd","data-name":"E",children:[" ",(0,u.jsx)("path",{id:"e1948427-1829-4c96-a9f4-14a99a3d5b97","data-name":"path0 fill",d:"M497.33,497.82c-1.2,0-2.11-.06-3-0.06a0.5,0.5,0,0,0-.55.27c0,0.15.17,0.23,0.57,0.32a1.08,1.08,0,0,1,1.06,1.23c0,0.55,0,1,0,3.32s-0.08,4.43-.13,5.21c-0.08,1-.42,1.2-1.39,1.41a0.59,0.59,0,0,0-.53.32c0,0.21.23,0.25,0.59,0.25,0.7,0,1.08-.09,2.13-0.09,2.76,0,6,.13,6.21.13a0.7,0.7,0,0,0,.36-0.21,14.63,14.63,0,0,0,.68-2.07c0-.21,0-0.53-0.15-0.53a0.78,0.78,0,0,0-.48.55,2.41,2.41,0,0,1-1.54,1.41,9,9,0,0,1-1.8.15,10.57,10.57,0,0,1-1.69-.13,0.74,0.74,0,0,1-.38-0.44,7,7,0,0,1-.15-1.56c0-.78,0-2.49.06-2.93a0.26,0.26,0,0,1,.17-0.17c0.53,0,1.29,0,1.9,0,1.06,0.06,1.18.13,1.44,1a0.52,0.52,0,0,0,.32.4c0.15,0,.23-0.19.23-0.53s-0.06-.68-0.06-1.2,0-.84.06-1.35c0-.17,0-0.46-0.17-0.46a0.54,0.54,0,0,0-.36.42c-0.34.87-.38,0.93-2.09,0.93h-1.27a0.18,0.18,0,0,1-.17-0.17c0-.44,0-3.84.08-4.29a0.5,0.5,0,0,1,.27-0.55,21.09,21.09,0,0,1,2.7.1,1.4,1.4,0,0,1,1.25,1.31,0.54,0.54,0,0,0,.3.47,0.46,0.46,0,0,0,.3-0.51c0-.38,0-1.08,0-1.84a0.28,0.28,0,0,0-.17-0.23,14.12,14.12,0,0,1-1.75.08h-2.81Z",transform:"translate(-484.44 -490.06)"})," "]})," ",(0,u.jsxs)("g",{id:"8dfbf0a9-85f0-49da-99d8-6229354b9534","data-name":"T",children:[" ",(0,u.jsx)("path",{id:"8602b8e9-f5d6-42d3-88c6-0649b350ce04","data-name":"path1 fill",d:"M490.48,490.82c-2.18,0-3.91-.06-4.39-0.11a1.32,1.32,0,0,1-.68-0.34,0.85,0.85,0,0,0-.3-0.3,0.39,0.39,0,0,0-.28.32,19.85,19.85,0,0,1-.38,2.55,0.4,0.4,0,0,0,.23.42c0.08,0,.19,0,0.38-0.42a5.64,5.64,0,0,1,.61-1,1.72,1.72,0,0,1,1.35-.44c0.32,0,1.94,0,2.3.09a0.26,0.26,0,0,1,.17.25v2.26c0,1.46-.09,5.3-0.13,6.44-0.06,1.41-.11,1.71-1.41,2a0.47,0.47,0,0,0-.38.34c0,0.11.19,0.23,0.57,0.23s1.33-.13,2.22-0.13,2.13,0.1,2.28.1,0.53,0,.53-0.25a0.65,0.65,0,0,0-.49-0.34c-1.22-.25-1.31-0.53-1.39-1.33s-0.1-2.6-.1-4.81c0-1.63,0-3.61,0-4.5a0.35,0.35,0,0,1,.15-0.25c0.29-.06,2.26-0.06,2.6,0,1.12,0.06,1.37.15,1.5,1.16,0.06,0.48.15,0.61,0.28,0.61a0.43,0.43,0,0,0,.32-0.38,11.69,11.69,0,0,1,.42-2.2c0.1-.27,0-0.44-0.09-0.44a0.72,0.72,0,0,0-.28.13,2.49,2.49,0,0,1-1.33.32C494,490.8,491.49,490.82,490.48,490.82Z",transform:"translate(-484.44 -490.06)"})," "]})," ",(0,u.jsxs)("g",{id:"88168da7-a35d-4a6e-af2a-2bab78b9d062","data-name":"X",children:[" ",(0,u.jsx)("path",{id:"f33958e3-fb20-476c-b2a8-674ffe821a96","data-name":"path2 fill",d:"M504,491a0.52,0.52,0,0,0,.51.36,3,3,0,0,1,1.84,1.14,53.54,53.54,0,0,1,3,4.73,0.22,0.22,0,0,1-.06.27c-1.14,1.58-2.22,2.87-3,3.72a4.47,4.47,0,0,1-2.22,1.27c-0.51.1-.7,0.27-0.7,0.44s0.15,0.21.51,0.21,1.2-.1,2-0.1c0.61,0,1.48.06,2,.06,0.25,0,.46-0.08.46-0.27a0.53,0.53,0,0,0-.46-0.32c-0.74-.27-1-0.47-0.17-1.82,0.53-.78,1.44-2,2.05-2.72a0.15,0.15,0,0,1,.19,0c0.23,0.21,2.09,3.17,2.53,4a0.26,0.26,0,0,1-.08.34,3.18,3.18,0,0,1-.68.23c-0.32.11-.42,0.19-0.42,0.34s0.11,0.25.47,0.25,1-.08,1.58-0.08c1.12,0,2.17.11,2.79,0.11,0.42,0,.57-0.09.57-0.25a0.49,0.49,0,0,0-.44-0.36,3.37,3.37,0,0,1-2.34-1.73c-0.49-.67-2.7-4-2.83-4.31a0.45,0.45,0,0,1,0-.23c0.91-1.27,2.17-2.7,2.85-3.52a3.79,3.79,0,0,1,2.38-1.41,0.5,0.5,0,0,0,.44-0.34,0.44,0.44,0,0,0-.46-0.21c-0.44,0-1.56.06-2,.06s-1.12,0-1.69,0c-0.36,0-.53.1-0.53,0.25a0.49,0.49,0,0,0,.48.34c0.67,0.13,1,.34.72,0.89a32.86,32.86,0,0,1-2.53,3.44,0.14,0.14,0,0,1-.19,0,33.44,33.44,0,0,1-2.3-3.63c-0.21-.38,0-0.59.34-0.68s0.46-.21.46-0.36a0.43,0.43,0,0,0-.47-0.21c-0.55,0-.91,0-1.63,0s-2-.1-2.39-0.1S504,490.84,504,491Z",transform:"translate(-484.44 -490.06)"})," "]})," "]})," "]})});var Oo=n(303702),Lo=n(322492),jo=n(140148);function Ko(e,t){const n=(0,b.Fy)(),o=(0,S.Fg)(),r=(0,b.O7)(),{store:l}=e,d=(0,c.PE)(l,e.disabled),p=(0,c.rv)(l),m=(0,i.useRef)(null),[g,f]=(0,i.useState)(!1),[h,v]=(0,i.useState)(!1),[y,_]=(0,i.useState)(!1),k=(0,a.VK)((()=>{const e=l.getBlockTitleStore().getValue();return le.Jcv(e)}),[l]),x=Boolean(k),I=(0,i.useCallback)((()=>{f(!0)}),[]),C=(0,i.useCallback)((()=>{f(!1)}),[]),T=(0,i.useCallback)((()=>{v(!0)}),[]),M=(0,i.useCallback)((()=>{v(!1)}),[]),P=(0,i.useCallback)((()=>{_(!0)}),[]),A=(0,i.useCallback)((()=>{_(!1),he.Ys({environment:r,store:l})}),[r,l]),R=(0,i.useCallback)((()=>{En.Py(r,{equation:k})}),[r,k]),D=(0,i.useCallback)((e=>{Ht.createAndCommit({userAction:"EquationBlock.handleChange",environment:r,perform:t=>{so.sO({environment:r,store:l.getBlockTitleStore(),value:le.TPx(e),transaction:t})}})}),[r,l]),B=(0,i.useCallback)((()=>{y?A():P()}),[A,P,y]),F=(0,a.VK)((()=>Vo.by({environment:r,equation:k,displayMode:"block"})),[r,k]),Z=(0,S.yK)((e=>{const t=n.isMobile||h||g;return{container:{display:"flex",padding:"4px 8px",width:"100%",flexDirection:x?"column":void 0,overflow:x?"auto":void 0,color:x?void 0:w.ZP.contentPlaceholder,...p},error:{background:e.equationErrorPlaceholderBackground},actionMenuButton:{position:"absolute",top:4,right:4,color:e.mediumTextColor,opacity:t?1:0},button:{position:"relative",width:"100%",borderRadius:4,background:x?void 0:e.surface.wash}}}),[p,n.isMobile,g,h,x]),U=y?{isOpen:!0,equationValue:k,error:F}:{isOpen:!1,equationValue:void 0,error:void 0},V=!d,N=(0,u.jsxs)(q.p,{ref:m,allowSelectionWithin:!0,style:{display:"flex",position:"relative"},children:[(0,u.jsx)(E.ev,{dependency:Mt.FF.prismjs,children:e=>(0,u.jsx)(Oo.Z,{...U,Prism:e,displayMode:"block",disabled:V,origin:(0,u.jsxs)(G.Z,{onMouseMove:T,onMouseLeave:M,onClick:P,style:Z.button,children:[k?(0,u.jsx)(Lo.Z,{theme:o,display:"block",equation:k,style:Z.container,errorStyle:{...Z.container,...Z.error}}):(0,u.jsx)(jo.ZP,{iconSvg:No,iconStyle:{width:28,height:28,marginRight:8},style:{background:void 0},children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Add a TeX equation",id:"equationBlock.empty.placeholder"})},"button"),d&&(0,u.jsx)(Se.Z,{onFocus:I,onBlur:C,store:l,tooltipContent:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Rename, delete, and more…",id:"equationBlock.actions.tooltip"}),style:Z.actionMenuButton,fadeIn:!1})]}),onDismiss:A,onChange:D,onSubmit:R})}),(0,u.jsx)(we.Z,{disableCommentMenu:e.disableCommentMenu,hideContent:e.hideContent,store:e.store,hideIfSidebarOrMarginCommentsVisible:!0})]});return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"equation",getBlockStore:()=>e.store,getNode:()=>m.current,handleCreated:P,edit:P,activate:B})),[B,P,e.store]),N)}const zo=i.memo(i.forwardRef(Ko),l.Z),qo=(0,d.IU)("excalidraw",{viewBox:"0 0 32 32",svg:(0,u.jsxs)("g",{children:[(0,u.jsx)("path",{d:"m14.2933 1.41174c-.8308.66246-2.1108 1.78526-3.1214 2.75088l-.7972.75228.146.98807c.0786.53895.2246 1.59439.3144 2.33544.101.74105.2021 1.43719.2358 1.53825.0449.13473 0 .2021-.1235.2021-.2134 0-.2246-.05614.3593 1.79654.2133.7073.4154 1.3586.4379 1.4259.0224.0786.1122.1123.2133.0786.1011-.0449.1572-.1347.1235-.2133-.0337-.0898.0225-.1797.1123-.2133.1235-.045.1123-.1348-.0786-.4604-.3032-.5053-1.0779-4.81685-1.1228-6.20913-.0337-.98807-.0337-.9993.3817-1.5607.4043-.55018 1.3362-1.38105 2.7734-2.43649.4042-.30316.8084-.64.9207-.75228.1684-.20211.247-.14597 1.6617 1.35859.8197.86456 1.7292 1.75158 2.0211 1.97614l.5389.40422-.4154.87579c-.2246.47157-1.134 2.29052-2.0323 4.01966-1.8751 3.6379-1.4933 3.2898-3.6716 3.3235l-1.4147.0112-.4716.539c-.494.5726-.5614.7859-.3256 1.1452.0898.1235.1572.3257.1572.4492 0 .2021.0786.2358.5277.2582.2807.0112.539.0449.5726.0786.0337.0337.0786.7298.1123 1.5495l.0449 1.4821-.7522 1.6168c-1.2464 2.6948-1.74039 3.9299-1.74039 4.3341 0 .2133.04491.3929.08982.3929.11227 0 .11227-.0112 4.68207-9.5438 2.1221-4.4239 4.132-8.5895 4.4688-9.27441.3369-.68491.64-1.31369.6625-1.40351.0224-.10105-.7523-.87579-1.9874-1.96491-1.1116-.98807-2.0884-1.88632-2.1782-1.98737-.2583-.314389-.64-.213336-1.325.33684zm.3818 12.91226c-.5165.9993-.539 1.0106-1.9537 1.0779-1.2463.0674-1.2688.0562-1.2688-.1796 0-.1348-.0449-.3144-.101-.4042-.0674-.1011-.0225-.2807.1347-.5278l.247-.3817h1.1228c.6176-.0112 1.325-.0562 1.572-.1011s.4603-.0673.4828-.0561c.0224.0112-.0898.2695-.2358.5726zm-.9432 1.7965c-.0898.2358-.3256.7298-.5165 1.1004-.3143.6287-.348.6512-.4266.393-.0449-.1572-.0786-.6176-.0898-1.033-.0113-.8197-.0337-.8084.9094-.8646l.3032-.0112z"}),(0,u.jsx)("path",{d:"m14.6302 4.08401c-.2021.14597-.2583.29193-.2583.66246 0 .43789.0337.50526.3369.62877s.3817.11228.7298-.12351c.4604-.31439.4716-.39298.1348-.89824-.292-.4379-.5839-.51649-.9432-.26948zm.64.40421c.1796.31439.0674.55018-.2695.55018-.3031 0-.4379-.30316-.2695-.60632.1348-.24701.393-.22456.539.05614z"}),(0,u.jsx)("path",{d:"m21.6702 6.61034c0 .05614-.0674.11228-.146.11228-.0674 0-.2582.31439-.4042.69614-.4491 1.16772-4.9404 10.04914-4.9516 9.76844 0-.146-.0673-.247-.1796-.247-.1572 0-.1797.0898-.1123.5277.0674.5053.0224.6175-1.5719 3.7165-.8983 1.7628-1.8639 3.6042-2.1446 4.0982-.2919.5165-.5165 1.0779-.5389 1.3137-.0337.4042.0112.4604.988 1.3025.5614.494 1.28 1.1115 1.5944 1.3922 1.4147 1.2913 2.0772 1.8078 2.2569 1.7741.2694-.0449 4.435-4.4127 4.4463-4.6597 0-.1122-.2021-1.8189-.4492-3.7951-.4266-3.3684-.8308-7.3094-.7859-7.6912.0337-.2358-.1348-1.4259-.2583-1.9424-.101-.4043-.0561-.5727.7523-2.4141.4716-1.0891 1.0891-2.42524 1.3586-2.96419.2583-.53894.4828-1.01052.4828-1.04421 0-.03368-.0786-.05614-.1684-.05614s-.1684.04492-.1684.11228zm-2.5825 8.38736c.1235.786.3705 2.6723.5502 4.1881.3481 2.7845.7523 5.8723.8646 6.6582.0673.393.0224.4716-.7074 1.28-1.2688 1.426-2.6162 2.8295-3.0765 3.1888l-.4267.3368-2.1894-2.0435c-2.0211-1.8638-2.1895-2.0547-2.066-2.2793.0674-.1235.64-1.1677 1.2688-2.3129.6287-1.1453 1.4596-2.6723 1.8414-3.3909.3929-.7299.7522-1.3586.8196-1.3923.0786-.0449.1011 1.0891.0786 3.5032-.0449 3.6042-.0337 3.6154.3256 3.5368.0449 0 .0786-1.819.0786-4.0309v-4.0196l1.179-2.3579c.6512-1.3025 1.1901-2.3467 1.2126-2.3355.0225.0113.1347.6737.247 1.4709z"})]})}),Ho=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Excalidraw",id:"excalidrawBlock.embeds.button.label"}});function Go(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"excalidraw",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:qo,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Excalidraw whiteboards.",id:"excalidrawBlock.embeds.caption"}),embedButtonText:n.formatMessage(Ho.embedButtonText),urlInputPlaceholder:"https://excalidraw.com/…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed Excalidraw",id:"excalidrawBlock.placeholder"})}))}const Wo=i.memo(i.forwardRef(Go),l.Z);var $o=n(936347),Yo=n(842875),Qo=n(311712),Jo=n(756903),Xo=n(825464),er=n(526388);const tr=(0,s.defineMessages)({tombstoneLabelNoPermission:{id:"factoryBlock.tombstoneLabelNoPermission",defaultMessage:"Template buttons are no longer supported"},tombstoneLabel:{id:"factoryBlock.tombstoneLabel",defaultMessage:"Template buttons are no longer supported. Click to turn into a button block."},titlePlaceholder:{id:"factoryBlock.titlePlaceholder",defaultMessage:"New button"}});function nr(e,t){const{store:n,disabled:o}=e,r=(0,b.O7)(),l=(0,i.useRef)(null),d=(0,Yo.r)(),p=(0,s.useIntl)(),m=(0,a.VK)((()=>{var e;return null===(e=n.getModel())||void 0===e?void 0:e.getRenderTitle({getRecordModel:n.getRecordModel,userTimeZone:d,intl:p})}),[p,n,d]),g=(0,a.VK)((()=>o||!n.canEdit()),[n,o]),f=(0,i.useCallback)((()=>{Ht.createAndCommit({userAction:"FactoryBlock.handleClickUpgrade",environment:r,perform:e=>{var t;const o=Qo.yt({environment:r,blocks:[n],transaction:e,preferDuplicateLocation:"local",useCrdt:n.useCrdt()});Qo.Cl({environment:r,blocks:[n],transaction:e}),En.nX(r,{factory_block_id:n.id,button_block_id:null===(t=o[0])||void 0===t?void 0:t.id})}})}),[r,n]),h=(0,S.yK)((e=>({iconStyle:{fill:e.errorText},buttonStyle:{overflowX:"auto",...g?{cursor:"not-allowed"}:{},...x.Z.textOverflowStyle,fontWeight:500,margin:"2px 0"}})),[g]),v=(0,u.jsx)(er.Z,{placement:Xo.u.Bottom,renderTooltip:()=>(0,u.jsx)(s.FormattedMessage,{...g?tr.tombstoneLabelNoPermission:tr.tombstoneLabel}),render:e=>(0,u.jsx)($.Z,{disabled:g,disabledFeedback:!0,style:h.buttonStyle,ref:l,icon:Jo.t,iconStyle:h.iconStyle,onClick:f,...e,children:m??(0,u.jsx)(s.FormattedMessage,{...tr.titlePlaceholder})})});return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"factory",getBlockStore:()=>e.store,getNode:()=>l.current})),[e.store]),v)}const or=i.memo(i.forwardRef(nr),l.Z),rr=(0,d.IU)("figma",{viewBox:"0 0 36 55",svg:(0,u.jsx)("path",{d:"M19.5,27.5 C19.5,23.08142 23.08142,19.5 27.5,19.5 C31.9186,19.5 35.5,23.08142 35.5,27.5 C35.5,31.9186 31.9186,35.5 27.5,35.5 C23.08142,35.5 19.5,31.9186 19.5,27.5 Z M0.5,46.5 C0.5,42.08142 4.08142,38.5 8.5,38.5 L16.5,38.5 L16.5,46.5 C16.5,50.9186 12.9186,54.5 8.5,54.5 C4.08142,54.5 0.5,50.9186 0.5,46.5 Z M19.5,16.5 L19.5,0.5 L27.5,0.5 C31.9186,0.5 35.5,4.08142 35.5,8.5 C35.5,12.9186 31.9186,16.5 27.5,16.5 L19.5,16.5 Z M8.5,16.5 C4.08142,16.5 0.5,12.9186 0.5,8.5 C0.5,4.08142 4.08142,0.5 8.5,0.5 L16.5,0.5 L16.5,16.5 L8.5,16.5 Z M8.5,35.5 C4.08142,35.5 0.5,31.9186 0.5,27.5 C0.5,23.08142 4.08142,19.5 8.5,19.5 L16.5,19.5 L16.5,35.5 L8.5,35.5 Z"})});function ir(e,t){const n=(0,i.useRef)(null),o=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"figma",getNode:()=>{const e=n.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,ref:n,blockResizerStore:o,store:e.store,iconSvg:rr,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with any public Figma shareable link",id:"figmaBlock.caption"}),children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed Figma",id:"figmaBlock.placeholder"})}))}const ar=i.memo(i.forwardRef(ir),l.Z);var sr=n(369721);const lr=(0,d.IU)("framer",{viewBox:"0 0 32 32",svg:(0,u.jsx)("g",{children:(0,u.jsx)("path",{d:"m9 6h14v7h-7zm0 7h7l7 7h-14zm0 7h7v7z"})})}),cr=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Framer",id:"framerBlock.embedFramer.button.label"}});function dr(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"framer",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:lr,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Framer prototypes",id:"framerBlock.linkInput.caption"}),embedButtonText:n.formatMessage(cr.embedButtonText),urlInputPlaceholder:"https://framer.com/…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed a Framer prototype",id:"framerBlock.placeholder"})}))}const ur=i.memo(i.forwardRef(dr),l.Z);var pr=n(708294);const mr=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Gist",id:"gistBlock.embedButton.label"}});function gr(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"gist",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:pr.f,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with links to Gists on GitHub",id:"gistBlock.linkInput.caption"}),embedButtonText:n.formatMessage(mr.embedButtonText),urlInputPlaceholder:"https://gist.github.com/…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed a Gist",id:"gistBlock.placeholder"})}))}const fr=i.memo(i.forwardRef(gr),l.Z);var hr=n(865453);const vr=(0,d.IU)("hex",{viewBox:"0 0 92 92",svg:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("path",{fill:"#fff",d:"M0 0h92v92H0z"}),(0,u.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.8 34v8.368h-2.4V34H15v24h8.4V46h2.4v12h8.4V34h-8.4Zm10.7995 24h19.2v-9.6h-8.4v6h-2.4V46h10.8V34h-19.2v24Zm8.4-15.6v-4.8h2.4v4.8h-2.4Zm24.0007 0V34h8.4v6l-3.6 4.2 3.6 4.2V58h-8.4V45.968h-2.4V58h-8.4v-9.6l3.6-4.2-3.6-4.2v-6h8.4v8.4h2.4Z",fill:"#473982"})]})}),yr=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Hex",id:"hexBlock.embeds.button.label"}});function br(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"hex",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:vr,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Hex cell links with public access.",id:"hexBlock.embeds.caption"}),embedButtonText:n.formatMessage(yr.embedButtonText),urlInputPlaceholder:"https://hex.tech/…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed Hex",id:"hexBlock.placeholder"})}))}const _r=i.memo(i.forwardRef(br),l.Z);var Sr=n(631781),kr=n(164964),wr=n(400949),xr=n(721429),Ir=n(145567);const Cr=(0,d.IU)("picture",{viewBox:"0 0 30 30",svg:(0,u.jsx)("path",{d:"M1,4v22h28V4H1z M27,24H3V6h24V24z M18,10l-5,6l-2-2l-6,8h20L18,10z M11.216,17.045l1.918,1.918l4.576-5.491L21.518,20H9 L11.216,17.045z M7,12c1.104,0,2-0.896,2-2S8.104,8,7,8s-2,0.896-2,2S5.896,12,7,12z"})}),Tr=(0,s.defineMessages)({urlPlaceholder:{defaultMessage:"Paste the image link…",id:"imageBlock.linkInput.placeholder"},embedButtonText:{defaultMessage:"Embed image",id:"imageBlock.embedImage.button.label"}});function Mr(e,t){const n=(0,s.useIntl)(),o=(0,b.O7)(),r=(0,i.useRef)(null),l=(0,a.qz)(e.blockResizerStore,m.Z),d=(0,a.VK)((()=>{const e=[{type:"file",imageUpload:!0},{type:"embed"},{type:"unsplash"}];return it.default.checkGate({gateName:"enable_giphy_feature_gate"})&&e.push({type:"giphy"}),e}),[]);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"image",getNode:()=>r.current,getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)("div",{ref:r,children:(0,u.jsx)(wr.Q,{type:Ir.LR,dropTargetKey:`image-block-${e.store.id}`,onDropFile:t=>{if("invalidFileDrop"===t.type)return void kr.oV({label:(0,u.jsx)(s.FormattedMessage,{id:"imageBlock.invalidImageDrop.wrongTypeErrorMessage",defaultMessage:"Sorry, that file type is not supported."})});const n=xr.qQ(o);Sr.cT({environment:o,store:e.store,file:t.file,pageWidth:n,preferredType:e.store.getType()})},children:(0,u.jsx)(g.ZP,{...e,blockResizerStore:l,store:e.store,urlInputPlaceholder:n.formatMessage(Tr.urlPlaceholder),iconSvg:Cr,preserveScale:!0,mediaMenuCurrentTab:"file",mediaMenuTabs:d,mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with any image from the web",id:"imageBlock.linkInput.caption"}),embedButtonText:n.formatMessage(Tr.embedButtonText),popupWidth:540,maxHeight:420,children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Add an image",id:"imageBlock.placeholder"})})})}))}const Pr=i.memo(i.forwardRef(Mr),l.Z),Ar=(0,d.IU)("invision",{viewBox:"0 0 215 182",svg:(0,u.jsxs)("g",{stroke:"none",strokeWidth:"1",children:[" ",(0,u.jsxs)("g",{transform:"translate(0.000000, -222.000000)",children:[" ",(0,u.jsxs)("g",{children:[" ",(0,u.jsx)("path",{d:"M98.9196618,401.249534 L67.23738,401.249534 C69.0283748,394.069758 70.787323,387.019973 72.4415558,380.387695 C68.8636285,384.425558 65.4170469,389.032134 61.2582199,392.866884 C50.6503674,402.647395 38.1012175,405.941417 24.0797327,402.23079 C13.9819165,399.55829 7.92421985,391.917675 6.61663119,381.562133 C5.46837247,372.464529 7.41824578,363.782628 9.57890401,355.080416 C13.7219334,338.391847 17.8017725,321.687933 21.9028255,304.989434 C22.0454551,304.409889 22.1339216,303.817254 22.2995706,302.96283 L-0.0003,302.96283 C2.30975824,294.403698 4.53721769,286.151943 6.78995327,277.806756 L60.5229552,277.806756 C60.3491817,278.642223 60.2273147,279.357627 60.0512844,280.059943 C53.0231647,308.023022 45.9535198,335.97572 39.0057421,363.95911 C38.1427426,367.435481 37.6331576,371.059899 37.479244,374.638277 C37.2535643,379.877659 40.2013936,382.783512 45.4935844,382.824134 C53.5440336,382.885068 60.4588621,379.769784 66.3955944,374.554776 C72.743064,368.979131 77.1564578,362.201967 79.1663619,353.808936 C83.0828089,337.452117 87.2971531,321.167064 91.379249,304.850416 C91.5232327,304.276286 91.5715282,303.678686 91.6933952,302.909569 L69.2513464,302.909569 C69.6155936,301.479211 69.9089773,300.269116 70.2316994,299.067145 C71.9843286,292.540938 73.758623,286.020597 75.4882328,279.488522 C75.7789084,278.389461 76.0555918,277.645621 77.5008451,277.651037 C92.8448135,277.709714 108.18833,277.692562 123.531847,277.702492 C123.75166,277.702492 123.97102,277.781931 124.411096,277.867238 C122.458966,286.803255 120.511801,295.717606 118.565087,304.631958 C118.656261,304.671226 118.747887,304.710043 118.838611,304.749311 C120.277996,302.605804 121.639297,300.404524 123.17076,298.328721 C129.752485,289.408051 137.659853,281.997178 148.043831,277.728671 C168.022811,269.515732 188.005402,280.685076 192.142563,302.283534 C193.975534,311.851454 193.064691,321.305631 190.553778,330.628914 C187.175803,343.16994 183.622249,355.664024 180.318748,368.224458 C179.661569,370.722733 179.467484,373.448493 179.624106,376.035235 C179.988804,382.073072 185.463796,384.737899 190.442292,381.268749 C192.360119,379.932273 194.120421,378.060937 195.308399,376.052387 C197.438816,372.450086 199.08989,368.563429 200.922861,364.787355 C201.278532,364.054347 201.552056,363.281168 201.937066,362.346854 C206.06836,363.936993 210.106223,365.491476 214.381049,367.137584 C210.178891,380.337594 205.268551,393.058261 192.248181,399.864312 C181.021966,405.732889 169.389528,405.395272 158.535233,398.5987 C151.013326,393.889214 148.484358,386.186312 148.027131,377.697592 C147.620005,370.133709 149.656088,362.968376 151.693976,355.800786 C154.30148,346.629159 157.031754,337.485517 159.315182,328.232646 C160.272516,324.353211 160.657977,320.20973 160.534756,316.210233 C160.26394,307.425422 153.949871,301.479211 145.147908,301.094201 C135.701404,300.681207 128.636273,304.704626 123.601357,312.562796 C119.514296,318.940958 117.721496,326.162711 115.917863,333.384916 C110.367494,355.603993 104.804488,377.819911 99.2455434,400.036731 C99.157077,400.390597 99.0564238,400.741303 98.9196618,401.249534 Z M28.7006165,241.023028 C28.6658618,230.356047 37.1446512,221.982425 47.9637399,222.000028 C58.6717942,222.017631 67.1365914,230.335285 67.169992,240.873176 C67.2033927,251.467488 58.5991253,259.984192 47.8874602,259.958916 C37.2349231,259.934091 28.7349198,251.545573 28.7006165,241.023028 Z"})," "]})," "]})," "]})}),Rr=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Invision",id:"invisionBlock.embeds.button.label"}});function Dr(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"invision",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:Ar,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Invision projects",id:"invisionBlock.embeds.caption"}),embedButtonText:n.formatMessage(Rr.embedButtonText),urlInputPlaceholder:"https://invis.io/…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed an Invision project",id:"invisionBlock.placeholder"})}))}const Br=i.memo(i.forwardRef(Dr),l.Z);var Er=n(213542),Fr=n(268056),Zr=n(232556),Ur=n(675822),Vr=n(80444);class Nr extends Tn.default{getInitialState(){return{query:""}}}const Or=Nr;var Lr=n(924666),jr=n(203386),Kr=n(606287),zr=n(472711),qr=n(898377),Hr=n(206258),Gr=n(632163),Wr=n(743765),$r=n(511470),Yr=n(533125),Qr=n(875987),Jr=n(223196),Xr=n(436488),ei=n(915316),ti=n(953437);function ni(e){const{autocompleteStore:t,disableMouseCapture:n,focus:o,format:r,inputPlaceholder:s,inputStyle:l,isOpen:c,onBgClick:d,onInputBlur:p,onInputClick:m,onInputFocus:g,onQueryUpdate:f,popupStyle:h,preventCaptureEsc:v,queryUpdateDebounce:y,renderPopup:_}=e,S=(0,b.Fy)(),k=(0,a.VK)((()=>t.state.query),[t]);(0,Yr.c)(Qr.Z,(()=>({isOpen:c})),[c]);const w=(0,i.useMemo)((()=>sn.Ds((e=>{f&&f({query:e,autocompleteStore:t})}),y)),[f,y,t]);return(0,u.jsx)(ti.ZP,{alignmentToOrigin:ti.ZP.Alignment.Start,disableDarkOverlayBackground:S.isPhone,disableMouseCapture:n,onDismiss:d,open:c,origin:(0,u.jsx)(oi,{isOpen:c,value:k,inputPlaceholder:s,focus:o,handleInputChange:e=>{const n=e.target.value;t.setState({...t.state,query:n}),w(n)},handleInputClick:m,handleInputFocus:g,handleInputBlur:p,inputStyle:l,format:r}),originGap:4,placementToOrigin:ti.ZP.Placement.Bottom,popupType:S.isPhone?Jr.k.SlideUp:Jr.k.Popup,preventCaptureEsc:v,render:_,style:h})}function oi(e){const{focus:t,format:n,handleInputChange:o,inputPlaceholder:r,inputStyle:i,isOpen:a,handleInputBlur:s,handleInputClick:l,handleInputFocus:c,value:d}=e;return(0,u.jsx)(Xr.Z,{allowMenuList:!0,capture:a,render:e=>(0,u.jsx)(q.p,{allowSelectionWithin:!0,...e,children:(0,u.jsx)(ei.Z,{focus:t,format:void 0!==n?n:ei.B.Transparent,onBlur:s,onChange:o,onClick:l,onFocus:c,placeholder:r,style:i,value:d})})})}const ri=(0,s.defineMessages)({inputPlaceholder:{defaultMessage:"Search for a database…",id:"linkToCollectionBlock.input.placeholder"}});function ii(e){const t=(0,s.useIntl)(),n=(0,b.O7)(),o=(0,b.Fy)(),r=(0,i.useRef)(!1),a=(0,qr.I)(),l=(0,i.useCallback)((()=>{const t=(e.results||[]).map((t=>{const o=Hr.NW.createChildStore(e.store,{table:Kr.vF,id:t});return{key:t,render:e=>(0,u.jsx)($r.Z,{...e,store:o}),action:()=>{r.current||(r.current=!0,Ht.createAndCommit({userAction:"LinkToCollectionBlock.menuListItem",environment:n,perform:t=>{const r=zr.Y_({environment:n,store:e.store,collectionStore:o,collectionViewStore:void 0,transaction:t});r&&he.Z5({environment:n,stores:[r]})}}))}}}));let i,l;return i=e.results&&0===t.length?(0,u.jsx)(pt.Z,{title:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Select a database",id:"linkToCollectionBlock.menuItem.noResults.title"}),loading:!e.ready,children:(0,u.jsx)(Wr.Z,{title:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"No results",id:"linkToCollectionBlock.menuItem.noResults.label"})})}):(0,u.jsx)(Gr.Z,{type:Gr.i.Vertical,initialFocus:0,sections:[{key:0,render:t=>(0,u.jsx)(pt.Z,{...t,title:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Select a database",id:"linkToCollectionBlock.menuItem.showResults.title"}),loading:!e.ready}),items:t}]}),l=o.isPhone?{menuType:kt.og.ActionSheet,disableBottomPadding:!0,maxHeight:`calc(70vh - ${a}px)`}:{menuType:kt.og.Popup,width:460,maxHeight:"40vh"},(0,u.jsx)(jt.Z,{...l,children:i})}),[o.isPhone,n,e.ready,e.results,e.store,a]),c=(0,i.useCallback)((()=>{ve.clear({environment:n}),r.current||(r.current=!0,Ht.createAndCommit({userAction:"LinkToCollectionBlock.handleBlur",environment:n,perform:t=>{Qo.Od({store:e.store,transaction:t})}}))}),[n,e.store]);return(0,u.jsx)(ni,{loading:!e.ready,isOpen:!0,autocompleteStore:e.autocompleteStore,queryUpdateDebounce:Ur.vp,inputPlaceholder:t.formatMessage(ri.inputPlaceholder),focus:!0,inputStyle:{...ai(),borderBottom:void 0},onBgClick:c,renderPopup:l})}function ai(){return{lineHeight:1.3}}function si(e,t){const n=(0,b.O7)(),o=(0,i.useRef)(null),r=(0,a.qz)(void 0,Or),s=(0,a.VK)((()=>r.state.query),[r]),l=(0,a.VK)((()=>{const t=Lr.default.state;return Boolean("editing"===t.mode&&(0,Fr.qS)(t.multiSelection)&&t.multiSelection.start.store.id===e.store.id)}),[e.store.id]);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"link_to_collection",getNode:()=>o.current,getBlockStore:()=>e.store,handleCreated(){he.$Y({environment:n,phase:Jn.SelectionPhase.Editing}),ve.setSelection({store:e.store,selection:void 0})}})),[n,e.store]),l?(0,u.jsx)(Er.Z,{request:s,performRequest:t=>async function(e,t,n){if(t.isDefaultRecordCache()){const t=await Zr.x.searchActions.load(),{currentSpaceStore:o}=Vr.default.state;return(await t.searchCollections(n,{query:e,limit:20,source:"link_to_collection_block",spaceStore:o,searchSessionId:void 0})).results}return[]}(t,e.store,n),debounce:Ur.vp,render:(t,n,o)=>(0,u.jsx)(jr.Z,{debugName:"LinkToCollectionBlock",capture:l,children:(0,u.jsx)(ii,{store:e.store,results:n,ready:o,autocompleteStore:r})})}):null)}const li=i.memo(i.forwardRef(si),l.Z);var ci=n(772141),di=n(421202),ui=n(761045),pi=n(367669),mi=n(869454);const gi=(0,s.defineMessages)({inputPlaceholder:{defaultMessage:"Search for a page…",id:"linkToPageBlock.searchPlaceholder"}});function fi(e){const t=(0,s.useIntl)(),n=(0,b.O7)(),o=(0,b.Fy)(),r=(0,qr.I)(),a=(0,i.useRef)(!1),l=(0,i.useCallback)((()=>{const t=(e.results||[]).map((t=>{const o=Hr.G.createChildStore(e.store,{table:di.iU,id:t});return{key:t,render:e=>(0,u.jsx)($r.Z,{...e,store:o}),action:()=>{a.current||(a.current=!0,Ht.createAndCommit({userAction:"LinkToPageBlock.menuListItem",environment:n,perform:t=>{const r=zr.hc({environment:n,store:e.store,targetStore:o,transaction:t});r&&he.Z5({environment:n,stores:[r]})}}))}}}));let i,l;return i=e.results&&0===t.length?(0,u.jsx)(pt.Z,{title:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Select a page",id:"linkToPageBlock.selectPrompt"}),loading:!e.ready,children:(0,u.jsx)(Wr.Z,{title:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"No results",id:"linkToPageBlock.noSearchResults"})})}):(0,u.jsx)(Gr.Z,{type:Gr.i.Vertical,initialFocus:0,sections:[{key:0,render:t=>(0,u.jsx)(pt.Z,{...t,title:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Select a page",id:"linkToPageBlock.selectPrompt.withContents"}),loading:!e.ready}),items:t}]}),l=o.isPhone?{menuType:kt.og.ActionSheet,disableBottomPadding:!0,maxHeight:`calc(70vh - ${r}px)`}:{menuType:kt.og.Popup,width:460,maxHeight:"40vh"},(0,u.jsx)(jt.Z,{...l,children:i})}),[n,o.isPhone,r,e.ready,e.results,e.store]),c=(0,i.useCallback)((()=>{ve.clear({environment:n}),a.current||(a.current=!0,Ht.createAndCommit({userAction:"LinkToPageBlock.handleBlur",environment:n,perform:t=>{Qo.Od({store:e.store,transaction:t})}}))}),[n,e.store]);return(0,u.jsx)(ni,{loading:!e.ready,isOpen:!0,autocompleteStore:e.autocompleteStore,queryUpdateDebounce:Ur.vp,inputPlaceholder:t.formatMessage(gi.inputPlaceholder),focus:!0,inputStyle:{...hi(),borderBottom:void 0},onBgClick:c,renderPopup:l})}function hi(){return{lineHeight:1.3}}function vi(e,t){const n=(0,b.Fy)(),o=(0,b.O7)(),r=(0,i.useRef)(null),s=(0,a.qz)(void 0,Or),l=(0,a.VK)((()=>s.state.query),[s]),d=(0,a.VK)((()=>{const t=Lr.default.state;return Boolean("editing"===t.mode&&(0,Fr.qS)(t.multiSelection)&&t.multiSelection.start.store.id===e.store.id)}),[e.store]);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"link_to_page",getNode:()=>r.current,getBlockStore:()=>e.store,handleCreated(){he.$Y({environment:o,phase:Jn.SelectionPhase.Editing}),ve.setSelection({store:e.store,selection:void 0}),n.isMobile&&mi.Z.onShow((()=>ui.hQ(o)))}})),[n.isMobile,o,e.store]),d?(0,u.jsx)(Er.Z,{request:l,performRequest:t=>async function(e,t,n){const{currentSpaceStore:o,mainEditorCurrentBlockStore:r}=Vr.default.state,i=(0,pi.YO)(t).find((e=>{let{permissionItem:t}=e;return(0,ci.$D)(t)}));if(t.isDefaultRecordCache()&&(o||i)){if(!e)return i&&!o&&r?[r.id]:xr._u(n).map((e=>e.id));{const t=await Zr.x.searchActions.load();if(o){return(await t.searchPageIds({environment:n,query:e,limit:20,spaceId:o.id,requireEditPermissions:!1,excludeTemplates:!1,source:"link_to_page_block",boostRecentlyViewedPages:!0})).results}if(i&&i.from.table===di.iU){return(await t.searchPageIdsInAncestor({environment:n,query:e,limit:20,ancestorId:i.from.blockId,excludeTemplates:!1,source:"link_to_page_block"})).results}}}return[]}(t,e.store,o),debounce:Ur.vp,render:(t,n,o)=>(0,u.jsx)(jr.Z,{debugName:"LinkToPageBlock",capture:d,children:(0,u.jsx)(fi,{store:e.store,results:n,ready:o,autocompleteStore:s})})}):null)}const yi=i.memo(i.forwardRef(vi),l.Z),bi=(0,d.IU)("loom",{viewBox:"0 0 190 190",svg:(0,u.jsx)("path",{d:"M189.611 84.2622H134.166L182.184 56.539L171.639 38.2692L123.621 65.9923L151.338 17.9781L133.068 7.42678L105.351 55.4409V0H84.2598V55.4462L56.5322 7.42678L38.2681 17.9728L65.9904 65.987L17.9723 38.2692L7.42658 56.5337L55.4447 84.2569H0V105.349H55.4394L7.42658 133.072L17.9723 151.342L65.9851 123.624L38.2628 171.638L56.5322 182.184L84.2545 134.165V189.611H105.346V134.17L133.063 182.184L151.332 171.638L123.61 123.619L171.628 151.342L182.174 133.072L134.161 105.354H189.6V84.2622H189.611ZM94.8055 123.491C78.9021 123.491 66.0116 110.601 66.0116 94.6968C66.0116 78.7929 78.9021 65.9021 94.8055 65.9021C110.709 65.9021 123.599 78.7929 123.599 94.6968C123.599 110.601 110.709 123.491 94.8055 123.491Z"})});function _i(e,t){const n=(0,i.useRef)(null),o=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"loom",getNode:()=>{const e=n.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:o,ref:n,store:e.store,iconSvg:bi,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with any Loom shareable link",id:"loomBlock.embed.caption"}),children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed Loom",id:"loomBlock.placeholder"})}))}const Si=i.memo(i.forwardRef(_i),l.Z),ki=(0,d.IU)("maps",{viewBox:"0 0 160 164",svg:(0,u.jsxs)("g",{children:[" ",(0,u.jsx)("polyline",{points:"16 163.155 76.159 103 136.314 163.155 16 163.155"})," ",(0,u.jsx)("path",{d:"M91.1523093,12 C89.1061243,15.5558234 87.6020864,19.4206238 86.7688642,23.441 C84.8448642,33.084 86.5958642,43.241 91.3038642,51.836 C91.8382207,52.8588753 92.3925227,53.8704894 92.9644441,54.8718184 L0,147.839 L0,24.942 C0,17.799 5.796,12 12.942,12 L91.1523093,12 L91.1523093,12 Z M27.8186945,28.8787927 C20.9826945,31.9947927 15.9026945,38.8067927 15.1686945,46.3227927 C13.7376945,56.9777927 21.5856945,67.7337927 32.0706945,69.9057927 C40.5536945,71.9007927 50.5746945,68.4527927 54.8196945,60.5497927 C57.5256945,56.1347927 57.8816945,50.7917927 57.3626945,45.7587927 C50.5816945,45.0857927 43.5296945,45.6577927 36.6486945,45.4797927 C36.5946945,48.0237927 36.6096945,50.5677927 36.7256945,53.1037927 C40.8396945,53.0417927 44.9526945,53.0807927 49.0736945,53.0727927 C47.8296945,58.9497927 41.9446945,62.9007927 36.0456945,62.2127927 C27.0296945,62.0967927 20.6586945,51.4727927 24.4936945,43.3927927 C27.4236945,35.1807927 39.1766945,32.2347927 45.4326945,38.4437927 C47.4426945,36.5027927 49.4526945,34.5547927 51.4096945,32.5597927 C45.1536945,26.7907927 35.5196945,25.3527927 27.8186945,28.8787927 Z"})," ",(0,u.jsx)("path",{d:"M124.80036,20.6120969 C120.325021,21.6105482 116.569675,25.5689693 116.191987,30.2012296 C115.721991,34.5142624 118.24735,38.8911407 122.112695,40.7949674 C126.304191,43.0118678 131.806442,42.332644 135.307176,39.1288306 C138.574835,36.2380909 139.764822,31.2458343 138.057917,27.2058756 C136.037937,22.1505427 130.041845,19.2713414 124.80036,20.6120969 Z M129.322621,0 C138.754833,0.539994477 147.978584,5.14840888 153.696218,12.7298698 C157.440026,17.5182824 159.529236,23.4620677 160,29.4989291 L160,31.7396754 C159.779233,43.4418634 152.290848,53.047919 145.807068,62.1501336 C138.528681,72.435413 131.801058,83.6445291 129.937231,96.3213226 C129.438005,98.4697621 129.034302,102.445875 127.470333,102.445875 C124.80036,102.3677 123.210376,86.842958 120.185792,80.3707165 C116.755058,72.8300244 111.978183,66.0154787 107.125156,59.3463161 C104.17134,55.3471262 101.384446,51.2079378 99.0798538,46.7964445 C95.4583524,40.1849736 94.1114431,32.3719766 95.591428,24.9543602 C96.8052617,19.097497 99.8698458,13.6698602 104.112879,9.47298004 C109.830513,3.88303721 117.561972,0.499225663 125.538045,0 L129.322621,0 Z"})," ",(0,u.jsx)("path",{d:"M151.652474,72 L151.652474,148.672145 C135.535571,132.464045 127.553192,124.419378 127.705338,124.538145 C131.041338,123.277145 130.263338,119.369145 130.912338,116.576145 C133.335338,100.096145 142.081338,85.5241452 151.543338,72.1531452 C151.579693,72.102109 151.616072,72.0510607 151.652474,72 Z"})," ",(0,u.jsx)("path",{d:"M106.040648,74 L92,88.0399478 L125.952845,121.992793 C123.906994,113.374953 121.723258,103.970177 117.61803,95.9459594 C114.174293,88.3766869 110.811044,80.7912134 106.040648,74 Z"})," "]})}),wi=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Map",id:"googleMapsBlock.embedButton.label"}});function xi(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"maps",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:ki,urlInputPlaceholder:"https://www.google.com/maps…",embedButtonText:n.formatMessage(wi.embedButtonText),mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with places on Google Maps",id:"googleMapsBlock.embed.caption"}),children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed a Google Map",id:"googleMapsBlock.placeholder"})}))}const Ii=i.memo(i.forwardRef(xi),l.Z),Ci=(0,d.IU)("miro",{viewBox:"0 0 32 32",svg:(0,u.jsx)("path",{d:"M13.75 20.895l1.761.359v-7.82l-1.76.344v7.117zm4.604-4.28v4.28l1.761.359V16.88c0-.993.56-1.441 1.432-1.607l1.015-.186v-1.835l-1.015.164c-1.935.44-3.193 1.073-3.193 3.197zm-7.446-.256c0-2.313-1.539-3.085-2.777-3.068-.984.014-1.785.423-2.265 1.047-.478-.685-1.325-1.068-2.016-1.068-.85 0-1.597.373-2.09.97v-.806L0 13.778v7.117l1.76.359v-4.895c0-.776.568-1.328 1.418-1.328.836 0 1.403.552 1.403 1.328v4.536l1.76.359v-4.895c0-.776.568-1.328 1.404-1.328.835 0 1.402.552 1.402 1.328v4.536l1.76.359v-4.895h.001zm17.176 5.059c2.356 0 3.916-1.636 3.916-4.081 0-2.446-1.56-4.067-3.916-4.067-2.446 0-4.082 1.62-4.082 4.067 0 2.445 1.636 4.08 4.082 4.08zm0-1.65c-1.366 0-2.281-.976-2.281-2.431 0-1.456.915-2.416 2.281-2.416 1.275 0 2.115.96 2.115 2.416 0 1.455-.84 2.43-2.115 2.43zm-13.416-7.552c.641 0 1.065-.445 1.065-1.11S15.31 10 14.668 10c-.665 0-1.11.44-1.11 1.106 0 .665.445 1.11 1.11 1.11"})}),Ti=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Miro",id:"miroBlock.embeds.button.label"}});function Mi(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"miro",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:Ci,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Miro links with public access enabled",id:"miroBlock.embeds.caption"}),embedButtonText:n.formatMessage(Ti.embedButtonText),urlInputPlaceholder:"https://miro.com/app/board/…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed Miro",id:"miroBlock.placeholder"})}))}const Pi=i.memo(i.forwardRef(Mi),l.Z),Ai=(0,d.IU)("mixpanel",{viewBox:"0 0 101 106",svg:(0,u.jsx)("g",{children:(0,u.jsx)("path",{d:"M31.008 41.412h13.385c-3.342-2.09-4.593-5.021-6.272-10.454l-5.022-18.613C30.803 3.982 28.918.005 19.714.005H.484v5.022H3.21c5.639 0 6.273 2.091 7.952 8.364l4.387 16.315c2.297 7.952 5.861 11.706 15.476 11.706h-.016zm30.968 0h13.37c9.614 0 12.956-3.77 15.27-11.706l4.387-16.315c1.679-6.273 2.502-8.364 7.952-8.364h2.724V.006H86.655c-9.41 0-11.294 3.77-13.385 12.34l-5.02 18.611c-1.68 5.639-2.93 8.363-6.273 10.454zM44.393 58.963h17.584l-.001-17.55H44.393v17.55zM.484 100.369h19.23c9.204 0 11.088-3.976 13.385-12.34l5.022-18.611c1.679-5.434 2.93-8.364 6.272-10.455H31.008c-9.615 0-13.179 3.77-15.475 11.706l-4.388 16.315c-1.68 6.273-2.297 8.364-7.952 8.364H.484v5.021zm86.14 0h19.023v-5.021h-2.724c-5.433 0-6.273-2.091-7.952-8.364L90.583 70.67c-2.296-7.952-5.639-11.706-15.27-11.706H61.976c3.343 2.091 4.546 4.816 6.225 10.455l5.022 18.612c2.09 8.57 3.975 12.339 13.385 12.339h.015z"})})}),Ri=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Mixpanel",id:"mixpanelBlock.embeds.button.label"}});function Di(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"mixpanel",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:Ai,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Mixpanel projects",id:"mixpanelBlock.embeds.caption"}),embedButtonText:n.formatMessage(Ri.embedButtonText),urlInputPlaceholder:"https://mixpanel.com/…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed a Mixpanel project",id:"mixpanelBlock.placeholder"})}))}const Bi=i.memo(i.forwardRef(Di),l.Z);var Ei=n(254321),Fi=n(804382),Zi=n(645952),Ui=n(916472);const Vi=(0,d.IU)("replit",{viewBox:"0 0 793.8 871.5",svg:(0,u.jsx)("g",{children:(0,u.jsx)("path",{d:"M396.9 356.1H227.2c-16.6 0-30-13.4-30-30v-99.8c0-16.6 13.4-30 30-30h139.7c16.6 0 30 13.4 30 30v129.8zm169.7 159.7H396.9V356.1h169.7c16.5 0 29.9 13.4 29.9 29.9v99.8c0 16.6-13.4 30-29.9 30zM366.9 675.6H227.2c-16.5 0-29.9-13.4-29.9-29.9v-99.8c0-16.5 13.4-29.9 29.9-29.9h169.7v129.8c0 16.3-13.4 29.8-30 29.8z"})})}),Ni=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed a repl",id:"replitBlock.embeds.button.label"}});function Oi(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"replit",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:Vi,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Replit.",id:"replitBlock.embeds.caption"}),embedButtonText:n.formatMessage(Ni.embedButtonText),urlInputPlaceholder:"https://replit.com/…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed a repl",id:"replitBlock.placeholder"})}))}const Li=i.memo(i.forwardRef(Oi),l.Z),ji=(0,d.IU)("sketch",{viewBox:"0 0 46 46",svg:(0,u.jsx)("g",{fillRule:"evenodd",children:(0,u.jsx)("path",{d:"M23.0831783 10.0045301l8.1450351.8960958c.2099814.0231017.4008968.1324906.5270123.3019626l6.0917147 8.1859511c.2137793.2872733.1982297.6847539-.0373384.9544486L23.4296391 36.806161c-.2072579.2372831-.5676296.2616233-.8049127.0543654l-.0543655-.0543654L8.19039805 20.3429882c-.23556813-.2696947-.25111774-.6671753-.03733843-.9544486l6.09171468-8.1859511c.1261155-.169472.3170309-.2788609.5270123-.3019626l8.1450351-.8960958a.76060447.76060447 0 01.1663566 0zm2.0141776 2.4229231c-.0693405-.0648437-.1764661-.0687976-.2504897-.0092454-.081512.0655766-.0939018.1841651-.0276733.2648747l3.8573181 4.7007387c.055083.0671271.085151.1509825.085151.2374739 0 .207984-.1702805.3765884-.3803321.3765884H17.6186701c-.0873512 0-.1720402-.0297721-.2398346-.0843129-.163024-.1311532-.1878035-.3683301-.0553465-.5297494l3.8573181-4.7007387c.0601442-.073295.0561509-.1793661-.0093373-.2480242-.0721132-.0756035-.1924706-.0790085-.2688257-.0076051l-5.750016 5.3771171c-.0774384.0724164-.1819972.1093609-.2882425.1018466-.2095178-.0148182-.3672335-.1950067-.352268-.4024622l.2753824-3.8174045c.0064096-.0888512-.0509385-.1699933-.1374402-.1944648-.1009848-.0285688-.206239.0293302-.2350918.129321L13.1553109 17.98681c-.0869135.3012032-.3194364.539875-.62031.6367138l-2.76499194.8899366c-.07834118.0252148-.13137885.0975058-.13137885.1790711 0 .1039921.08514024.1882942.19016605.1882942h2.66553224c.3250892 0 .6276464.1644528.8021788.4360184L20.3459621 31.28552c.0777639.1209976.2347663.165079.3651002.1025088.1417556-.0680534.2009545-.2370061.1322245-.3773663l-5.0526479-10.3185107c-.0376144-.0768161-.0571558-.1610746-.0571558-.2464434 0-.3119761.2554207-.5648827.5704981-.5648827h13.3920376c.0862174 0 .1713136.0193492.2488932.0565933.2835111.1361069.401909.4740123.2644491.7547328l-5.0526479 10.3185107c-.0631922.129051-.0186726.2845081.1035279.3615065.1329093.0837462.3092182.0449521.3937968-.086649l7.0494549-10.9686759c.1745324-.2715656.4770896-.4360184.8021788-.4360184h2.5849257c.0818532 0 .1545231-.0518618.1804073-.1287503.0332121-.0986555-.0206353-.2052903-.1202715-.2381755l-2.6912281-.888246c-.2977515-.0982735-.5273437-.3357047-.6135671-.6345159l-1.2609059-4.3697316c-.0247148-.0856502-.1066636-.1424338-.196398-.1360873-.1047589.0074091-.1836168.0975033-.176134.2012311l.2753824 3.8174045c.0075889.1051994-.0297228.2087291-.1028592.2854053-.1442263.1512071-.3849411.158017-.5376513.0152103z"})})}),Ki=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Sketch",id:"sketchBlock.embeds.button.label"}});function zi(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"sketch",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:ji,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Sketch links with Public Link Access enabled",id:"sketchBlock.embeds.caption"}),embedButtonText:n.formatMessage(Ki.embedButtonText),urlInputPlaceholder:"https://sketch.com/…",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed Sketch",id:"sketchBlock.placeholder"})}))}const qi=i.memo(i.forwardRef(zi),l.Z),Hi={SlideBlock:new E.Ss("SlideBlock",(async()=>await n.e(19985).then(n.bind(n,255351))))},Gi=(0,E.iS)(Hi.SlideBlock,(e=>e.default));var Wi=n(699571),$i=n(551704),Yi=n(415690),Qi=n(52315),Ji=n(825777),Xi=n(933709),ea=n(594419),ta=n(552771),na=n(992120),oa=n(798165),ra=n(661614),ia=n(95802),aa=n(434859),sa=n(226664),la=n(279131),ca=n(489728),da=n(731278),ua=n(776798),pa=n(953336);function ma(e){const t=(0,s.useIntl)(),n=(0,b.O7)(),o=(0,S.Fg)(),r=(0,S.yK)((e=>({baseStyle:{paddingLeft:0,paddingRight:0,marginTop:-6,marginBottom:14},mobileStyle:ya(e),desktopStyle:va(e),scrollerOverlayStyle:ba(e)})),[]),a=(0,i.useRef)(null);return(0,u.jsxs)(q.p,{allowSelectionWithin:!0,style:{...n.device.isMobile?r.mobileStyle:r.desktopStyle,...r.baseStyle},children:[(0,u.jsx)(pa.Z,{role:"tablist","aria-label":t.formatMessage(ha.tabListLabel),type:aa.Z.X,ref:a,showLeftRightOverlay:!0,rightOverlayStyle:r.scrollerOverlayStyle,children:(0,u.jsx)(la.ZP,{disabled:e.disabled,direction:"horizontal",keys:e.tabs.map((e=>e.id)),renderKey:(t,n)=>(0,u.jsx)(ga,{index:n,...e}),onDrop:(t,o)=>function(e){const{environment:t,parentStore:n,onDropArgs:o,newTabs:r}=e;Ht.createAndCommit({userAction:"TabBlockMenu.handleTabReorder",environment:t,perform:e=>{const{key:t,endPosition:i}=o,a=n.getContentStores().find((e=>e.id===t)),s=r[i-1],l=n.getContentStores().find((e=>e.id===s));a&&ea.HP({parentStore:n.getContentStore(),afterStore:l,currentStore:a,transaction:e})}})}({environment:n,newTabs:t,parentStore:e.parentStore,onDropArgs:o}),disableHorizontalEdgeScroll:!1})}),!e.disabled&&(0,u.jsx)(ca.Z,{"aria-label":t.formatMessage(ha.addTab),style:{height:28,width:28,marginTop:6,display:"flex",justifyContent:"center"},onClick:()=>{!function(e,t,n){const{performResult:o}=Ht.createAndCommit({userAction:"TabBlockMenu.newTab",environment:e,perform:n=>Yi.gG({environment:e,store:t,transaction:n})}),r=()=>{const e=t.getContentStores(),n=e[e.length-1];ta.$({blockStore:o,renderDelete:!0,originRect:n?ia.C.getRectFromStore(n):void 0})};n.current?n.current.scrollToRight({animate:!0,animationCallback:()=>{r()}}):r()}(n,e.parentStore,a)},children:(0,ra.R)({fill:o.mediumIconColor,width:16,height:16})})]})}function ga(e){const t=(0,b.O7)(),n=(0,s.useIntl)(),{index:o,parentStore:r,selectedIndex:i,tabs:l}=e,c=l[o],d=(0,S.yK)((e=>({selectedTab:{...{paddingTop:6,paddingBottom:12,whiteSpace:"nowrap",minWidth:0,flexShrink:0,fontWeight:500},position:"relative"},tab:{paddingTop:6,paddingBottom:12,whiteSpace:"nowrap",minWidth:0,flexShrink:0,fontWeight:500},border:_a(e)})),[]),p=(0,a.VK)((()=>{const e=na.Z.getFirstSelectedDiscussionId();if(!e)return!1;const t=Hr.jQ.createChildStore(c,{table:Xi.qF,id:e,spaceId:c.getSpaceId()});return(0,oa.qA)(t).map((e=>e.id)).includes(c.id)}),[c]),{device:m}=t,g=i===o,f=o===l.length-1,h=0===o,v=l.length;return(0,u.jsx)(bn.Z,{store:c,analyticsName:"tab",canSelect:!0,canDrag:!1,canDropBelow:!1,canDropLeft:!h,canDropAbove:!1,canNativeDropBelow:!1,canNativeDropLeft:!h,canNativeDropRight:!f,canDropOnto:!0,dropzoneShouldNeverUseOrigin:!0,dropzoneMustBeWithinHorizontalBound:!0,canInsertAbove:!h,canDropRight:!f,canInsertBelow:!f,shouldShowHalo:!0,shouldShowDropZone:!0,shouldShowParentHalo:!0,dropzoneGap:10,onSelectableDrop:e=>{const{droppedDirection:n,droppedStores:o,duplicate:r}=e;Ht.createAndCommit({userAction:"TabBlockMenu.dropOntoTab",environment:t,perform:e=>{ln.LQ({environment:t,targetParentStore:c.getContentStore(),targetStore:c,droppedDirection:n,droppedStores:o,duplicate:r,transaction:e})}})},onRemove:()=>{!function(e){const{environment:t,parentStore:n,tabStore:o,index:r}=e;Ht.createAndCommit({userAction:"TabBlockMenu.handleRemoveTab",environment:t,perform:e=>{const i=n.getContentStores();if(1===i.length){const t=n.getRecordStoreUIParent();"block"!==(null==t?void 0:t.table)&&"space"!==(null==t?void 0:t.table)||null==t||!t.valueIs(sa.i)||ea.Od({parentStore:t,childToRemoveStore:n,transaction:e})}else{const e=r<i.length-1?i[r+1]:i[r-1];Yi.x2({store:n,id:e.id,currentUserId:t.currentUser.id})}ea.Od({parentStore:n.getContentStore(),childToRemoveStore:o,transaction:e})}})}({environment:t,parentStore:r,tabStore:c,index:o})},children:(0,u.jsxs)("div",{style:{...g?d.selectedTab:d.tab},children:[(0,u.jsxs)(ca.Z,{role:"tab","aria-selected":g,"aria-controls":g?e.contentAriaId:void 0,"aria-posinset":o+1,"aria-setsize":v,id:g?e.selectedTabAriaId:void 0,style:{fontSize:16},onClick:()=>function(e,t,n){if(e.onChange(t),n&&!e.disabled){const n=e.parentStore.getContentStores()[t];ta.$({blockStore:n,renderDelete:!0})}}(e,o,g),disabled:e.readOnly,mobileFeedback:m.isMobile,hovered:p,isGray:!g,children:[(0,u.jsx)(fa,{store:c}),(0,u.jsx)(ua.Z,{store:c,placeholder:n.formatMessage(ha.untitledTab)})]}),g&&(0,u.jsx)("div",{style:d.border})]},o)},o)}function fa(e){const{store:t}=e,{icon:n,isEmptyPage:o}=(0,a.VK)((()=>({icon:t.hasIcon()&&t.getIcon(),isEmptyPage:t.isEmptyPage()})),[t]);return n?(0,u.jsx)(da.Z,{disabled:!0,icon:n,isEmptyPage:o,size:20,style:{marginRight:6}}):null}const ha=(0,s.defineMessages)({untitledTab:{id:"tabMenuBlock.title.placeholder",defaultMessage:"Untitled"},addTab:{id:"tabMenuBlock.addTab",defaultMessage:"Add tab"},tabListLabel:{defaultMessage:"Tab block",id:"tabBlockMenu.tabListLabel"}});function va(e){return{display:"flex",fontSize:14,width:"100%",paddingLeft:8,paddingRight:8,boxShadow:`0 1px 0 ${e.regularDividerColor}`,position:"relative",zIndex:1}}function ya(e){return{display:"flex",fontSize:16,width:"100%",paddingTop:2,paddingLeft:16,paddingRight:16,boxShadow:`0 1px 0 ${e.regularDividerColor}`,position:"relative",zIndex:2,height:44,background:e.popoverBackground}}function ba(e){return{background:e.regularDividerColor,right:28,opacity:1,marginTop:6,marginBottom:12,width:1}}function _a(e){return{borderBottom:`2px solid ${e.regularTextColor}`,position:"absolute",bottom:0,left:0,right:0}}function Sa(e,t){const{store:n,style:o,disabled:r,disableCommentMenu:s,hideContent:l}=e,d=(0,b.O7)(),p=(0,c.rv)(n,!0),m=(0,S.yK)((()=>({root:{paddingLeft:ze.ZD.paddingLeft,flex:1,...p,...o},tabContainer:{display:"flex",flexDirection:"column"}})),[o,p]);(0,i.useEffect)((()=>{Yi.nz({blockId:n.id,currentUserId:d.currentUser.id})}),[d,n]);const g=(0,i.useId)(),f=(0,i.useId)(),h=(0,a.VK)((()=>n.getContentStores()),[n]),v=(0,a.VK)((()=>Yi.jL(n)),[n]),y=(0,c.PE)(n,r),_=(0,a.VK)((()=>Qi.b(n)),[n]),k=(0,i.useRef)(null),w=(0,u.jsxs)("div",{style:m.root,ref:k,children:[(0,u.jsx)("div",{style:m.tabContainer,children:(0,u.jsx)(ma,{contentAriaId:g,selectedTabAriaId:f,disabled:!y,parentStore:n,tabs:h,selectedIndex:v,onChange:e=>Yi.a({store:n,index:e,currentUserId:d.currentUser.id})})}),(0,u.jsx)("div",{role:"tabpanel",id:g,"aria-labelledby":f,style:{position:"relative"},children:(0,u.jsx)(Ji.Z,{loaded:_,spinnerSize:"1em",showSpinnerTimeout:500,innerStyle:{display:"flex",flexDirection:"column"},children:(0,u.jsx)(ka,{...e})})}),(0,u.jsx)(we.Z,{disableCommentMenu:s,hideContent:l,store:n,hideIfSidebarOrMarginCommentsVisible:!0})]});return(0,c.ez)(n,t,(0,i.useMemo)((()=>({renderedType:"tab",getNode:()=>k.current,getBlockStore:()=>n})),[n]),w)}function ka(e){const{store:t,disabled:n}=e,{selectedContentStore:o,contentStore:r}=(0,a.VK)((()=>{const e=Yi.z7(t),n=e.getContentStore();return{selectedContentStore:e,contentStore:n}}),[t]),i=(0,S.yK)((()=>({selectable:{display:"flex",flexDirection:"column"}})),[]),s=(0,c.PE)(t,n);return(0,u.jsx)(bn.Z,{store:o,analyticsName:"page_content",canSelect:!1,canDrag:!1,isListContainer:!0,style:i.selectable,children:(0,u.jsx)(Y.Z,{store:r,disabled:n,disableContent:!1,emptyPlaceholder:(0,u.jsx)(wa,{store:o,canEdit:s})})},o.id)}function wa(e){const{store:t,canEdit:n}=e,o=(0,S.yK)((e=>({button:{fontSize:"inherit",width:"100%",borderRadius:4,caretColor:e.lightTextColor,...ze.ZD,marginTop:2},text:{color:e.lightTextColor}})),[]),r=(0,b.O7)(),a=(0,i.useCallback)((()=>{Ht.createAndCommit({userAction:"TabBlock.handlePlaceholderClick",environment:r,perform:e=>{Yi.ls({environment:r,store:t,transaction:e})}})}),[t,r]);return(0,u.jsx)(G.Z,{style:o.button,onClick:a,disabled:!n,children:(0,u.jsx)("span",{style:o.text,children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Empty tab. Click or drop blocks inside.",id:"tabBlock.emptyBlock.placeholderText"})})})}const xa=i.memo(i.forwardRef(Sa),l.Z);var Ia=n(585031),Ca=n(225888),Ta=n(918514),Ma=n(328662),Pa=n(789579),Aa=n(78454);function Ra(e,t){const n=(0,b.O7)(),o=(0,b.Fy)(),r=(0,i.useRef)(null),a=(0,c.PE)(e.store,e.disabled),l=e.disabled||!a,{navigableAncestorStore:d,headerStores:p}=(0,Ma.m)({parentStore:e.store}),m=(0,S.yK)((e=>({root:{position:"relative"},placeholder:{...Ea,paddingTop:ze.ZD.paddingTop,paddingBottom:ze.ZD.paddingBottom,color:e.lightTextColor,...!l&&o.isMobile&&{marginRight:36}},actionMenuButton:{position:"absolute",top:3,right:6}})),[o.isMobile,l]),g=(0,u.jsx)("div",{style:m.placeholder,children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Add headings to create a table of contents. <linktohelpbutton>Learn more</linktohelpbutton>.",id:"tableOfContentsBlock.placeholder",values:{linktohelpbutton:e=>(0,u.jsx)(At.Z,{href:(0,Ta.UY)("guides.tableOfContents"),external:!0,onClick:()=>Ca.Fs(n,{from:"table_of_contents_placeholder"}),children:e})}})}),f=(0,u.jsxs)(q.p,{allowSelectionWithin:!0,style:m.root,ref:r,children:[p.map((t=>(0,u.jsx)(Ba,{headerStore:t,index:p.indexOf(t),headerStores:p,store:e.store,navigableAncestorStore:d,style:e.style},t.id))),0===p.length&&g,!l&&o.isMobile&&(0,u.jsx)(Se.Z,{style:m.actionMenuButton,tooltipContent:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"More actions…",id:"tableOfContentsBlock.mobileActionMenu.button.label"}),store:e.store,fadeIn:!1})]});return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"table_of_contents",getNode:()=>r.current,getBlockStore:()=>e.store})),[e.store]),f)}const Da=i.memo(i.forwardRef(Ra),l.Z);function Ba(e){const t=(0,a.VK)((()=>Ia.y({headerBlockId:e.headerStore.id,headerBlockIds:e.headerStores.map((e=>e.id)),index:e.index,getRecordModel:e.store.getRecordModel})),[e.headerStore.id,e.headerStores,e.index,e.store.getRecordModel]),n=(0,c.rv)(e.store),o=(0,S.yK)((()=>({container:n,innerHeader:{...Ea,display:"flex",alignItems:"center",marginLeft:Aa.LK*t,paddingTop:2*ze.ZD.paddingTop,paddingBottom:2*ze.ZD.paddingBottom}})),[n,t]),r=(0,Pa.R)({scrollToBlockId:e.headerStore.id,pageStore:e.navigableAncestorStore});return e.navigableAncestorStore?(0,u.jsx)("div",{style:{...o.container,...e.style},children:(0,u.jsx)(Ce.Z,{href:r.href,external:!1,children:(0,u.jsx)("div",{style:o.innerHeader,children:(0,u.jsx)(ua.Z,{store:e.headerStore,shouldWrap:!1,underline:!0})})})}):null}const Ea={paddingRight:ze.ZD.paddingRight,paddingLeft:ze.ZD.paddingLeft,fontSize:14,lineHeight:1.3};var Fa=n(817970),Za=n(306684),Ua=n(804859),Va=n(25157),Na=n(691497),Oa=n(319191);const La=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Tweet",id:"tweetBlock.embedTweet.button.label"}});function ja(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"tweet",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:Oa.l,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with links to Tweets",id:"tweetBlock.linkInput.caption"}),embedButtonText:n.formatMessage(La.embedButtonText),urlInputPlaceholder:"https://twitter.com/… or https://x.com/",children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed a Tweet from X",id:"tweetBlock.placeholder"})}))}const Ka=i.memo(i.forwardRef(ja),l.Z),za=(0,d.IU)("typeform",{viewBox:"0 0 30 31",svg:(0,u.jsx)("path",{d:"M15.027 30.53c-4.294-.036-8.467-2.247-11.47-5.222C.553 22.333-.09 19.78.009 15.654.107 11.53 1.2 7.81 4.047 4.68 6.895 1.55 10.121.11 14.25.006c4.129-.103 7.291 1.046 10.44 4.156 3.15 3.11 5.242 7.127 5.31 11.392.067 4.266-1.978 6.94-4.972 9.936-2.994 2.995-5.706 5.077-10 5.04zm-4.891-19.66h3.818v10.304h1.903V10.87h3.818V9.071h-9.54v1.798z"})});function qa(e,t){const n=(0,i.useRef)(null),o=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"typeform",getNode:()=>{const e=n.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:o,ref:n,store:e.store,iconSvg:za,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with any public Typeform link",id:"typeformBlock.embed.caption"}),children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed Typeform",id:"typeformBlock.placeholder"})}))}const Ha=i.memo(i.forwardRef(qa),l.Z),Ga=(0,d.IU)("video",{viewBox:"0 0 30 30",svg:(0,u.jsx)("path",{d:"M2,2v26h26V2H2z M26,6h-2V4h2V6z M22,14H8V4h14V14z M6,10H4V8h2V10z M6,12v2H4v-2H6z M6,16v2H4v-2H6z M6,20v2H4v-2H6z M8,16 h14v10H8V16z M24,20h2v2h-2V20z M24,18v-2h2v2H24z M24,14v-2h2v2H24z M24,10V8h2v2H24z M6,4v2H4V4H6z M4,24h2v2H4V24z M24,26v-2h2v2 H24z"})}),Wa=(0,s.defineMessages)({urlPlaceholder:{defaultMessage:"Paste the video link…",id:"videoBlock.linkInput.placeholder"},embedButtonText:{defaultMessage:"Embed video",id:"videoBlock.embedVideo.button.label"}});function $a(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"video",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,blockResizerStore:r,ref:o,store:e.store,iconSvg:Ga,preserveScale:!0,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"},{type:"file",videoUpload:!0}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with YouTube, Vimeo, and more",id:"videoBlock.linkInput.caption"}),embedButtonText:n.formatMessage(Wa.embedButtonText),urlInputPlaceholder:n.formatMessage(Wa.urlPlaceholder),children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed or upload a video",id:"videoBlock.placeholder"})}))}const Ya=i.memo(i.forwardRef($a),l.Z),Qa=(0,d.IU)("whimsical",{viewBox:"0 0 32 32",svg:(0,u.jsxs)("g",{children:[(0,u.jsx)("path",{opacity:".8",fillRule:"evenodd",clipRule:"evenodd",d:"M12.807 9.772a.497.497 0 00-.705 0L5.76 16.146a.502.502 0 000 .708l6.343 6.374c.195.195.51.195.705 0l6.343-6.374a.503.503 0 000-.708l-6.343-6.374zm.352-2.479a.993.993 0 00-1.41 0l-8.457 8.499a1.005 1.005 0 000 1.416l8.458 8.499a.993.993 0 001.41 0l8.457-8.499c.39-.391.39-1.025 0-1.416l-8.458-8.499z",fill:"#A7A6A2"}),(0,u.jsx)("mask",{id:"a",maskUnits:"userSpaceOnUse",x:"3",y:"7",width:"19",height:"19",children:(0,u.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.807 9.772a.497.497 0 00-.705 0L5.76 16.146a.502.502 0 000 .708l6.343 6.374c.195.195.51.195.705 0l6.343-6.374a.503.503 0 000-.708l-6.343-6.374zm.352-2.479a.993.993 0 00-1.41 0l-8.457 8.499a1.005 1.005 0 000 1.416l8.458 8.499a.993.993 0 001.41 0l8.457-8.499c.39-.391.39-1.025 0-1.416l-8.458-8.499z",fill:"#fff"})}),(0,u.jsx)("g",{filter:"url(#filter0_d)",mask:"url(#a)",children:(0,u.jsx)("path",{d:"M18.84 7.293a.993.993 0 011.41 0l8.458 8.499c.39.39.39 1.025 0 1.416l-8.458 8.499a.993.993 0 01-1.41 0l-8.457-8.499a1.005 1.005 0 010-1.416l8.457-8.499z",fill:"#000",fillOpacity:".01"})}),(0,u.jsx)("path",{d:"M18.84 7.293a.993.993 0 011.41 0l8.458 8.499c.39.39.39 1.025 0 1.416l-8.458 8.499a.993.993 0 01-1.41 0l-8.457-8.499a1.005 1.005 0 010-1.416l8.457-8.499z",fill:"#A7A6A2"}),(0,u.jsx)("defs",{children:(0,u.jsxs)("filter",{id:"filter0_d",x:"8.055",y:"4.964",width:"22.98",height:"23.071",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,u.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,u.jsx)("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),(0,u.jsx)("feOffset",{}),(0,u.jsx)("feGaussianBlur",{stdDeviation:"1.018"}),(0,u.jsx)("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0"}),(0,u.jsx)("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow"}),(0,u.jsx)("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})]})})]})}),Ja=(0,s.defineMessages)({embedButtonText:{defaultMessage:"Embed Whimsical",id:"whimsicalBlock.embeds.button.label"}});function Xa(e,t){const n=(0,s.useIntl)(),o=(0,i.useRef)(null),r=(0,a.qz)(e.blockResizerStore,m.Z);return(0,c.ez)(e.store,t,(0,i.useMemo)((()=>({renderedType:"whimsical",getNode:()=>{const e=o.current;return e?e.getNode():null},getBlockStore:()=>e.store})),[e.store]),(0,u.jsx)(g.ZP,{...e,ref:o,store:e.store,iconSvg:Qa,mediaMenuCurrentTab:"embed",mediaMenuTabs:[{type:"embed"}],mediaMenuEmbedCaption:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Works with Whimsical links with Public Link Access enabled",id:"whimsicalBlock.embeds.caption"}),embedButtonText:n.formatMessage(Ja.embedButtonText),urlInputPlaceholder:"https://whimsical.com/…",blockResizerStore:r,children:(0,u.jsx)(s.FormattedMessage,{defaultMessage:"Embed Whimsical",id:"whimsicalBlock.placeholder"})}))}const es=i.memo(i.forwardRef(Xa),l.Z);let ts;function ns(e){const t=e.getType();if(t)return"collection_view"===t&&e.recordStoreParentDiffersFromPersistedParent()?o.Z:(ts||(ts={text:Fa.Z,image:Pr,video:Ya,bookmark:Ne,drive:So,audio:ie,tweet:Ka,gist:fr,maps:Ii,framer:ur,invision:Br,file:sr.Z,page:Fi.Z,to_do:Za.Z,toggle:Ua.ZP,bulleted_list:We.Z,numbered_list:Ei.Z,code:Xt,factory:or,button:$e.Z,divider:to,column_list:jn,copy_indicator:Hn,embed:g.ZP,breadcrumb:Ge,equation:zo,header:hr.Z,sub_header:Wi.Z,sub_sub_header:$i.Z,quote:Ui.ZP,collection_view:rn.DZ,collection_view_page:o.Z,link_to_page:yi,link_to_collection:li,figma:ar,loom:Si,codepen:on,typeform:Ha,column:Sn,pdf:Zi.Z,callout:Ye.Z,table_of_contents:Da,whimsical:es,miro:Pi,abstract:v,sketch:qi,excalidraw:Wo,alias:te.Z,transclusion_container:Va.Z,transclusion_reference:Na.Z,replit:Li,external_object_instance:$o.Z,table:r.W,table_row:r.f,tab:xa,hex:_r,deepnote:Yn,mixpanel:Bi,external_object_instance_page:$o.Z,ai_block:ee,drawing:oo,slide:Gi,personal_home_page:void 0,form:void 0,post:void 0}),ts[t])}},159557:(e,t,n)=>{n.d(t,{N:()=>d});var o=n(667294),r=n(800480),i=n(886628),a=n(401898),s=n(210228),l=n(237181),c=n(80444);function d(e){const{blockStore:t}=e,n=(0,r.O7)(),d=(0,i.VK)((()=>c.default.state.currentUserSettingsStore),[]),u=(0,i.VK)((()=>{var e;return(0,a.$K)(null===(e=t.getModel())||void 0===e?void 0:e.getProperty("title"))}),[t]),p=(0,o.useCallback)((()=>{d&&s.createAndCommit({userAction:"FactoryButtonDeprecation.updateUserSettings",environment:n,perform:e=>{l.d2({userSettingsStore:d,transaction:e,data:{dismissed_factory_button_deprecation_banner:!0}})}})}),[d,n]),m=(0,o.useCallback)((()=>{if(!d)return;d.getSettingsStore().getKeyStore("seen_factory_button_deprecation_badge").getValue()||s.createAndCommit({userAction:"FactoryButtonDeprecation.updateUserSettings",environment:n,perform:e=>{l.d2({userSettingsStore:d,transaction:e,data:{seen_factory_button_deprecation_badge:!0}})}})}),[d,n]);return{showFactoryButtonDeprecationBadge:(0,i.VK)((()=>u&&!Boolean(null==d?void 0:d.getSettingsStore().getKeyStore("seen_factory_button_deprecation_badge").getValue())),[d,u]),showFactoryButtonDeprecationBanner:(0,i.VK)((()=>u&&!Boolean(null==d?void 0:d.getSettingsStore().getKeyStore("dismissed_factory_button_deprecation_banner").getValue())),[d,u]),handleDismissFactoryButtonMigrationBanner:p,setHasSeenFactoryButtonDeprecationBadge:m}}},808265:(e,t,n)=>{n.d(t,{BB:()=>c,BZ:()=>s,LS:()=>d,f:()=>u,ny:()=>i,uI:()=>l});var o=n(277907);const r={PostImportIntroPopup:new o.Ss("PostImportInfoPopup",(async()=>await Promise.all([n.e(52774),n.e(10074)]).then(n.bind(n,913699))))},i=(0,o.kF)(r.PostImportIntroPopup,(e=>e.PostImportIntroPopup)),a={AllProjectsTooltip:new o.Ss("AllProjectsTooltip",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(92199)]).then(n.bind(n,649638)))),ProjectCustomizationTooltip:new o.Ss("ProjectCustomizationTooltip",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(92199)]).then(n.bind(n,649638)))),NavigateToProjectTasksTooltip:new o.Ss("NavigateToProjectTasksTooltip",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(92199)]).then(n.bind(n,649638)))),TasksDatabaseViewsTooltip:new o.Ss("TasksDatabaseViewsTooltip",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(92199)]).then(n.bind(n,649638)))),YourCurrentTeamspaceTooltip:new o.Ss("YourCurrentTeamspaceTooltip",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(92199)]).then(n.bind(n,649638))))},s=(0,o.kF)(a.AllProjectsTooltip,(e=>e.AllProjectsTooltip)),l=(0,o.kF)(a.ProjectCustomizationTooltip,(e=>e.ProjectCustomizationTooltip)),c=(0,o.kF)(a.NavigateToProjectTasksTooltip,(e=>e.NavigateToProjectTasksTooltip)),d=(0,o.kF)(a.TasksDatabaseViewsTooltip,(e=>e.TasksDatabaseViewsTooltip)),u=(0,o.kF)(a.YourCurrentTeamspaceTooltip,(e=>e.YourCurrentTeamspaceTooltip))},629551:(e,t,n)=>{n.d(t,{Ht:()=>d,Vg:()=>u,gq:()=>c,xk:()=>s});var o=n(667294),r=n(206258),i=n(785893);function a(e){const{style:t,row:n,column:o,reverse:r,inline:i,...a}=e,s={display:i?"inline-flex":"flex"};return o?s.flexDirection=r?"column-reverse":"column":n?s.flexDirection=r?"row-reverse":"row":r&&(s.flexDirection="row-reverse"),Object.assign(s,a,t)}function s(){return a({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},row:!0})}function l(){return a({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},column:!0})}function c(e){const{children:t,className:n,...o}=e;return(0,i.jsx)("div",{className:n,style:s(o),children:t})}const d=o.forwardRef((function(e,t){const{children:n,className:o,...r}=e;return(0,i.jsx)("div",{className:o,style:l(r),ref:t,children:n})}));function u(e){let{environment:t,pageBlockStore:n,pathToBlockId:o}=e;const i=new r.ST({environment:t,pointer:n.pointer,path:o}).getValue();return new r.G(t,{table:"block",spaceId:n.getSpaceId(),id:i})}},505595:(e,t,n)=>{n.d(t,{_Y:()=>r,mD:()=>o,rp:()=>i});const o=275,r=90,i=90},17377:(e,t,n)=>{n.d(t,{Z:()=>S});var o=n(667294),r=n(800480),i=n(886628),a=n(724405),s=n(949271),l=n(709291),c=n(429373),d=n(210228),u=n(52315),p=n(635328),m=n(445131),g=n(164921),f=n(825777),h=n(630915),v=n(78454),y=n(804859),b=n(605210),_=n(785893);function S(e){const t=(0,r.O7)(),n=(0,a.Fg)(),S=(0,o.useRef)(!0);(0,o.useLayoutEffect)((()=>{S.current&&(S.current=!1,c.nz({blockId:e.store.id,currentUserId:t.currentUser.id}),e.store.isDefaultRecordCache()&&c.LO(t,e.store.pointer))}));const k=(0,i.VK)((()=>e.store.getContentStore()),[e.store]),w=(0,i.VK)((()=>m.Z.isOpen(e.store.id)&&!e.hideContent),[e.hideContent,e.store.id]),x=(0,i.VK)((()=>!e.store.hasContent()),[e.store]),I=(0,o.useId)(),C=(0,o.useId)(),T=(0,i.VK)((()=>u.b(e.store)||!e.store.isDefaultRecordCache()),[e.store]),M=(0,o.useCallback)((()=>{p.th(t,e.store,e.hideContent)}),[t,e.hideContent,e.store]),P=(0,i.VK)((()=>p.fn(e.store)),[e.store]),A=(0,i.VK)((()=>{var t;return null===(t=e.store.getFormat())||void 0===t?void 0:t.toggleable}),[e.store]),R=(0,o.useCallback)((()=>{d.createAndCommit({userAction:"FormatToggleable.handlePlaceholderClick",environment:t,perform:n=>{c.ls({environment:t,store:e.store,transaction:n})}})}),[t,e.store]),D=(0,_.jsx)(g.Z,{style:{fontSize:"inherit",width:"100%",borderRadius:4,caretColor:n.lightTextColor,...s.ZD,marginTop:2},onClick:R,disabled:e.disabled,children:(0,_.jsx)("span",{style:{color:n.lightTextColor},children:(0,_.jsx)(l.FormattedMessage,{defaultMessage:"Empty toggle. Click or drop blocks inside.",id:"toggleBlockFormat.emptyBlock.placeholderText"})})}),B=(0,_.jsx)(b.Z,{"aria-describedby":I,"aria-controls":C,isSidebar:!1,open:w,fill:!x,onClick:M,tapArea:t.device.isMobile?{size:30}:void 0}),E=w?(0,_.jsx)(f.Z,{id:C,loaded:T,spinnerSize:"1em",showSpinnerTimeout:500,innerStyle:(0,y.kA)(),style:(0,y.J9)(),children:(0,_.jsx)(h.Z,{store:k,emptyPlaceholder:P?D:void 0,disabled:e.disabled,disableCommentMenu:e.disableCommentMenu,disableHoverMenu:e.disableHoverMenu,disableDrag:e.disableDrag})}):(0,_.jsx)(h.Z,{store:k,disabled:e.disabled,disableContent:!0});return P?(0,_.jsxs)(v.ZP,{style:{paddingLeft:s.ZD.paddingLeft},left:B,leftStyle:{paddingRight:2,...e.toggleStyle},children:[(0,_.jsx)("div",{id:I,style:e.childrenStyleWhenToggleable,children:e.children}),E]}):A?(0,_.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,_.jsx)("div",{style:e.childrenStyleWhenToggleable,children:e.children}),E]}):(0,_.jsx)(_.Fragment,{children:e.children})}},486467:(e,t,n)=>{n.d(t,{IX:()=>N,ZP:()=>O,qh:()=>z,dY:()=>$});n(757658);var o=n(667294),r=n(313991),i=n(800480),a=n(886628),s=n(724405),l=n(407057),c=n(519889),d=n(307928),u=n(709291),p=n(531701),m=n(653965),g=n(761045),f=n(107401),h=n(461953),v=n(934700),y=n(220095),b=n(424042),_=n(385555),S=n(206258),k=n(164921),w=n(526388),x=n(164369),I=n(729302),C=n(45653),T=n(540107),M=n(144615),P=n(325320),A=n(702688),R=n(453730);function D(e){const t=(0,i.O7)(),n=(0,o.useRef)(),r=(0,T.t)(),a=(0,o.useCallback)((async()=>{if(await R.transactionQueue.awaitRecordTransaction(e.blockStore.pointer),!r())return;const o=(0,M.pb)(e.blockStore.id);n.current=A.ZP.addListener(o,m.P2((()=>P.Ri(t,{blockStore:e.blockStore,pageVisitStore:e.pageVisitStore,incremental:!0,limit:e.limit})),1e3),void 0,t)}),[t,r,e.blockStore,e.limit,e.pageVisitStore]),s=(0,o.useCallback)((()=>{n.current&&(A.ZP.removeListener(n.current,t),n.current=void 0)}),[t]);return(0,o.useEffect)((()=>(a(),s)),[a,s]),null}var B=n(785893);const E=5,F=25,Z=5,U=23,V=6,N=22;const O=function(e){let{pageVisitStore:t,presenceStore:n,rootStore:o,maxUsers:r}=e;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(f.at,{rootStore:o}),(0,B.jsx)(Q,{rootStore:o,pageVisitStore:t,presenceStore:n,maxUsers:r}),(0,B.jsx)(D,{blockStore:o,pageVisitStore:t,limit:1+j(r)+F})]})};function L(e){return m.MR(e,(e=>e.activityTimestampNearestMinuteMs))}function j(e){return e??E}function K(e,t){return S.U6.createChildStore(t,{table:c.KJ,id:e})}function z(e,t,n){const o=n?V:Z;return{...(0,v.X)({noDrag:e.device.isElectron&&!t}),display:"flex",alignItems:"center",position:"relative",flexDirection:"row-reverse",marginLeft:4+o,paddingRight:o,transform:"translateZ(0)"}}function q(e){return{color:e.mediumInvertedTextColor,fontSize:10,textTransform:"uppercase",letterSpacing:"0.015em"}}function H(e){let{userData:t,isPresent:n,rootStore:o}=e;const c=(0,s.Fg)(),p=(0,i.O7)(),m=(0,u.useIntl)(),g=p.currentUser.id,f=(0,a.VK)((()=>K(t.userId,o)),[t,o]),h=(0,a.VK)((()=>f.isDefined()),[f]),v=(0,a.VK)((()=>(0,d.Nz)(m,f.getModel())),[m,f]),y=(0,a.VK)((()=>f.getEmail()),[f]);if(!h)return null;let b;return n?g!==f.id&&(b=t.blockId?(0,B.jsx)(u.FormattedMessage,{defaultMessage:"Viewing now. Click to see where they are.",id:"topbar.presenceIndicator.viewingNowWithLocation.tooltip"}):(0,B.jsx)(u.FormattedMessage,{defaultMessage:"Viewing now",id:"topbar.presenceIndicator.viewingNow.tooltip"})):g!==f.id&&t.activityTimestampNearestMinuteMs&&(b=(0,B.jsx)(u.FormattedMessage,{defaultMessage:"Last viewed {timeFromNow}",id:"topbar.presenceIndicator.lastViewedTime.tooltip",values:{timeFromNow:(0,l.tv)(Math.min(t.activityTimestampNearestMinuteMs,Date.now()),r.locale)}})),(0,B.jsxs)("div",{children:[(0,B.jsx)("div",{className:"notranslate",children:v}),(0,B.jsx)("div",{style:{fontWeight:400},children:y}),b&&(0,B.jsx)("div",{style:{color:c.mediumInvertedTextColor,minWidth:150,paddingTop:2,paddingBottom:2,lineHeight:1.3},children:b})]})}function G(e){let{userData:t,index:n,rootStore:o}=e;const c=(0,s.Fg)(),d=(0,i.O7)(),u=(0,a.VK)((()=>_.default.checkGate({gateName:"deprecate_presence_expiration"})),[]),p=(0,y.MR)(d,t,u),m=(0,a.VK)((()=>K(t.userId,o)),[t,o]);if(!(0,a.VK)((()=>m.isDefined()),[m]))return null;let f;!p&&t.activityTimestampNearestMinuteMs&&(f=(0,l.tv)(t.activityTimestampNearestMinuteMs,r.locale));const h=(0,B.jsxs)("div",{style:{display:"flex",alignContent:"flex-end",minWidth:140,width:"100%",marginTop:4},children:[(0,B.jsx)(I.Z,{userStore:m,avatarSize:18,style:{flexGrow:1}}),(0,B.jsx)("div",{style:{marginLeft:"auto",paddingLeft:12,textAlign:"right",flexShrink:1,color:c.mediumInvertedTextColor},children:f})]});if(p&&t.blockId){const e=t.blockId;return(0,B.jsx)(k.Z,{onClick:()=>g.hl([e],!0),style:{display:"flex",alignItems:"center"},children:h})}return(0,B.jsx)("div",{style:{display:"flex",alignItems:"center"},children:h})}function W(e){let{hiddenUsers:t,rootStore:n,areColorfulBordersEnabled:o}=e;const r=(0,s.Fg)(),l=(0,i.O7)(),c=o?V:Z,d=(0,a.VK)((()=>_.default.checkGate({gateName:"deprecate_presence_expiration"})),[]);return(0,B.jsx)(w.Z,{allowHover:!0,originGap:7,renderTooltip:e=>{const o=[],i=[];for(const n of t)(0,y.MR)(l,n,d)?o.push(n):i.push(n);const a=i.slice(0,F-o.length);return(0,B.jsxs)("div",{...e,children:[o.length>0&&(0,B.jsxs)("div",{style:{marginBottom:4},children:[(0,B.jsx)(x.Z,{style:q(r),children:(0,B.jsx)(u.FormattedMessage,{defaultMessage:"Viewing now",id:"topbar.presenceIndicator.hiddenUsers.viewingNow.tooltip"})}),o.map(((e,t)=>(0,B.jsx)(G,{userData:e,index:t,rootStore:n},t)))]}),a.length>0&&(0,B.jsxs)("div",{style:{marginBottom:4},children:[(0,B.jsx)(x.Z,{style:{...q(r)},children:(0,B.jsx)(u.FormattedMessage,{defaultMessage:"Last viewed by",id:"topbar.presenceIndicator.hiddenUsers.lastViewedBy.tooltip"})}),a.map(((e,t)=>(0,B.jsx)(G,{userData:e,index:t,rootStore:n},t)))]}),i.length>a.length&&(0,B.jsx)("div",{style:{marginLeft:2,marginTop:2,color:r.mediumInvertedTextColor},children:(0,B.jsx)(u.FormattedMessage,{defaultMessage:"{notViewingMoreUsersCount} more…",id:"topbarPresence.presenceIndicator.hiddenUsers.moreUsersNotViewing.tooltip",values:{notViewingMoreUsersCount:i.length-a.length}})})]})},render:e=>(0,B.jsx)("div",{style:{color:r.mediumTextColor,fontSize:14,marginLeft:2*c,marginRight:-c,whiteSpace:"nowrap"},...e,children:(0,B.jsx)(u.FormattedMessage,{defaultMessage:"{hiddenUsersCount, plural, one {+{hiddenUsersCount}} other {+{hiddenUsersCount}}}",id:"topbar.presenceIndicator.hiddenUsers.otherCount.message",values:{hiddenUsersCount:t.length}})})})}function $(e,t){return(0,s.yK)((n=>{const o={width:N,height:N,borderRadius:N},r=e(n);return{button:{transition:"all 0.2s ease",transform:"scale(1)"},buttonHovered:{transform:"scale(1.15)",background:"none"},buttonPressed:{transform:"scale(0.9)",background:"none"},uiUserAvatarStyles:{...o},avatarInnerOutline:{...o,outlineStyle:"solid",outlineColor:n.UIUserAvatarInnerOutline,outlineWidth:.5,outlineOffset:-.5},avatarBorder:t?{...o,outlineStyle:"solid",outlineColor:r,outlineWidth:1.5,outlineOffset:-.5}:{},avatarOuterOutline:{...o,outlineStyle:"solid",outlineColor:t?n.UIUserAvatarOuterOutline:n.UIUserAvatarIdleOutline,outlineWidth:.5,outlineOffset:t?1:0,marginRight:-6,position:"relative"},initialColor:{color:t?r:n.icon.secondary},legacyAvatarStyle:{width:U,height:U,borderRadius:U,marginRight:-Z,position:"relative"}}}),[e,t])}function Y(e){let{userData:t,rootStore:n,areColorfulBordersEnabled:r}=e;const s=(0,i.O7)(),{userId:l}=t,c=(0,a.VK)((()=>_.default.checkGate({gateName:"deprecate_presence_expiration"})),[]),d=(0,y.MR)(s,t,c),u=K(l,n),m=(0,a.VK)((()=>u.isDefined()&&!u.getIsSuspended()),[u]),f=$((0,o.useCallback)((e=>l===s.currentUser.id?e.UIUserAvatarSelfBorder:(0,p.iY)(l,e)),[s.currentUser.id,l]),d);return m?(0,B.jsx)(w.Z,{textWrap:!0,renderTooltip:()=>(0,B.jsx)(H,{rootStore:n,userData:t,isPresent:d}),render:e=>{const n=r?(0,B.jsx)("div",{style:f.avatarOuterOutline,children:(0,B.jsx)("div",{style:f.avatarBorder,children:(0,B.jsx)(C.Z,{iconStyle:f.avatarInnerOutline,userStore:u,style:f.uiUserAvatarStyles,isOffline:!d,size:N,avatarShouldShowShadow:!0,initialOverrideStyle:f.initialColor})})}):(0,B.jsx)(C.Z,{userStore:u,style:f.legacyAvatarStyle,isOffline:!d,size:U,avatarShouldShowShadow:!0});if(d&&t.blockId){const o=t.blockId;return(0,B.jsx)(k.Z,{...e,onClick:()=>g.hl([o],!0),style:f.button,hoveredStyle:f.buttonHovered,pressedStyle:f.buttonPressed,children:n})}return(0,B.jsx)("div",{...e,children:n})}}):null}function Q(e){let{rootStore:t,pageVisitStore:n,presenceStore:o,maxUsers:r}=e;const s=(0,i.O7)(),l=s.currentUser.id,c=(0,a.VK)((()=>{const e=s.currentUser.id;if(!e)return;const t=_.default.checkGate({gateName:"deprecate_presence_expiration"}),i=(0,y.AQ)(n,o),a=[],l=[];for(const n of i)n.userId!==e&&((0,y.MR)(s,n,t)?a.push(n):l.push(n));const c=[...L(a).reverse(),...L(l).reverse()],d=j(r)-1;return{visibleUsers:c.slice(0,d),hiddenUsers:c.slice(d)}}),[n,o,s,r]),{visibleUsers:d,hiddenUsers:u,isEveryUserStoreReady:p}=(0,a.VK)((()=>{if(!l)return{};const{visibleUsers:e=[],hiddenUsers:n=[]}=c??{},o=[l,...e.map((e=>e.userId)),...n.map((e=>e.userId))];return{visibleUsers:e,hiddenUsers:n,isEveryUserStoreReady:o.map((e=>K(e,t))).every((e=>e.isReady()))}}),[l,c,t]),m=(0,a.VK)((()=>Boolean(b.Z.state.isShowingTabBar)),[]),g=(0,a.VK)((()=>_.default.checkGate({gateName:"colorful_presence_avatars"})),[]),v=(0,h.useIsDictatingToPage)(t);if(!l||!c||!p)return null;if(0===d.length&&0===u.length)return v?(0,B.jsx)("div",{style:z(s,m,g),children:(0,B.jsx)(f.ew,{enableClickToScroll:!0,rootStore:t})}):null;{const e=[...d];return e.reverse(),(0,B.jsxs)("div",{style:z(s,m,g),children:[u.length>0&&(0,B.jsx)(W,{rootStore:t,hiddenUsers:u,areColorfulBordersEnabled:g}),e.map((e=>(0,B.jsx)(Y,{userData:e,rootStore:t,areColorfulBordersEnabled:g},e.userId))),(0,B.jsx)(Y,{rootStore:t,userData:{userId:l,present:!0},areColorfulBordersEnabled:g}),(0,B.jsx)(f.ew,{enableClickToScroll:!0,rootStore:t})]})}}},566890:(e,t,n)=>{n.d(t,{DK:()=>u,L1:()=>c,Y$:()=>d,cu:()=>s,xm:()=>l});n(21703);var o=n(667294),r=n(67381);const i="collectionContextStore",a=(0,r.Q)({displayName:i,legacyContextKey:i,modernContextDefaultValue:void 0}),s=a.context,l=a.legacyPropTypes,c=a.Provider;function d(){const e=o.useContext(s);if(void 0===e)throw new Error(`No context provided: ${i}`);return e}function u(){return o.useContext(s)}},21404:(e,t,n)=>{n.d(t,{Ht:()=>i,fC:()=>o,pT:()=>r});const o=(0,n(67381).Q)({displayName:"ColumnListContext",legacyContextKey:"isInColumnList",modernContextDefaultValue:!1}),r=o.Provider,i=o.legacyPropTypes},426198:(e,t,n)=>{n.d(t,{Lr:()=>a,jo:()=>l,uf:()=>i});var o=n(667294),r=n(67381);const i={track(e,t){t(!0)},untrack(e){}},a=(0,r.Q)({modernContextDefaultValue:i,displayName:"IFrameManagerContext",legacyContextKey:"iFrameManagerContext"}),s=(a.legacyPropTypes,a.context);function l(){const e=(0,o.useContext)(s),[t,n]=(0,o.useState)(!1),r=(0,o.useRef)(null);return[(0,o.useCallback)((t=>{r.current&&(e.untrack(r.current),r.current=null),t&&(r.current=t,e.track(t,n))}),[e]),t]}},466213:(e,t,n)=>{n.d(t,{LF:()=>r,ZO:()=>a,wK:()=>i});const o=(0,n(67381).Q)({modernContextDefaultValue:void 0,displayName:"OverrideLinkClickContext",legacyContextKey:"overrideLinkClick"}),r=o.Provider,i=o.legacyPropTypes,a=o.context},311368:(e,t,n)=>{n.d(t,{I3:()=>i,Ue:()=>a,zR:()=>r});const o=(0,n(67381).Q)({displayName:"ScrollerContext",legacyContextKey:"scrollerContext",modernContextDefaultValue:void 0}),r=o.Provider,i=o.legacyPropTypes,a=o.context},884064:(e,t,n)=>{n.d(t,{Tf:()=>s,aT:()=>a,ld:()=>l});const o={selectableContainer:void 0,closestSelectable:void 0},r="selectable",i=(0,n(67381).Q)({modernContextDefaultValue:o,displayName:r,legacyContextKey:r}),a=i.context,s=i.legacyPropTypes,l=i.Provider},969098:(e,t,n)=>{n.d(t,{j:()=>d,o:()=>o});var o={};n.r(o),n.d(o,{showAsyncModal:()=>p,showAsyncModalComponent:()=>m,testOnly:()=>S});var r=n(667294),i=n(886628),a=n(749085);class s extends a.default{getInitialState(){return{asyncModals:[]}}}const l=new s;var c=n(785893);const d=r.memo((function(e){const{store:t=l}=e,n=(0,i.VK)((()=>t.state.asyncModals),[t]);return(0,c.jsx)(c.Fragment,{children:n.map((e=>{const{id:t,internalRenderModal:n,isOpen:o}=e,i=n(o);return(0,c.jsx)(r.Fragment,{children:i},t)}))})}));var u=n(471924);function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return new Promise(((n,o)=>{try{g({asyncModal:y({renderModal:e,promiseResolve:n,promiseReject:o,store:t}),store:t})}catch(r){o(r)}}))}function m(e){return p((t=>r.createElement(e,t)),arguments.length>1&&void 0!==arguments[1]?arguments[1]:l)}function g(e){const{asyncModal:t,store:n=l}=e;n.update((e=>({asyncModals:[...e.asyncModals,t]})))}function f(e){const{id:t,promiseResolve:n,store:o=l}=e;return e=>{const r=b({id:t,store:o});null!=r&&r.isOpen&&(_({id:t,store:o,update:{isOpen:!1}}),n(e))}}function h(e){const{id:t,promiseResolve:n,store:o=l}=e;return()=>{const e=b({id:t,store:o});null!=e&&e.isOpen&&(_({id:t,store:o,update:{isOpen:!1}}),n())}}function v(e){const{id:t,store:n=l}=e;return()=>{n.update((e=>({asyncModals:e.asyncModals.filter((e=>e.id!==t))})))}}function y(e){const{renderModal:t,promiseResolve:n,promiseReject:o,store:r=l}=e,i=u.Il(),a=v({id:i,store:r}),s=h({id:i,promiseResolve:n,store:r}),c=f({id:i,promiseResolve:n,store:r});return{id:i,internalRenderModal:e=>{try{return t({isOpen:e,onClosed:a,onDismiss:s,resolve:c})}catch(n){throw o(n),n}},isOpen:!0}}function b(e){const{id:t,store:n=l}=e;return n.state.asyncModals.find((e=>e.id===t))}function _(e){const{id:t,update:n,store:o=l}=e;o.update((e=>({asyncModals:e.asyncModals.map((e=>e.id!==t?e:{...e,...n}))})))}const S={addAsyncModal:g,createAsyncModal:y,createOnClosed:v,createOnDismiss:h,createResolve:f,getAsyncModal:b,updateAsyncModal:_}},327340:(e,t,n)=>{n.d(t,{y:()=>s});var o=n(653965),r=n(401898),i=n(847882);function a(e){let t=0,n=Number.MAX_SAFE_INTEGER;for(const r of e){if(!r)continue;const e=(0,i.r)(r),a=(0,o.uZ)(e.max,0,Number.MAX_SAFE_INTEGER),s=(0,o.uZ)(e.min,0,a);t=Math.max(t,s),n=Math.min(n,a)}const a=function(e){let t;for(const n of e){const e=null==n?void 0:n.scroll;switch(e){case"disallow":return"disallow";case"allow":t="allow";break;case void 0:break;default:(0,r.t1)(e)}}return t}(e);return{type:"range",min:(0,o.uZ)(t,0,n),max:n,scroll:a}}function s(e){const t=e.filter(Boolean);return{width:a(t.map((e=>null==e?void 0:e.width))),height:a(t.map((e=>null==e?void 0:e.height)))}}},847882:(e,t,n)=>{n.d(t,{F:()=>i,r:()=>r});var o=n(401898);function r(e){if(!e)return{type:"range",min:0,max:Number.MAX_SAFE_INTEGER};if("range"===e.type)return e;let t=0,n=Number.MAX_SAFE_INTEGER;switch(e.type){case"fill":t=Number.MAX_SAFE_INTEGER;break;case"fixed":t=e.length,n=e.length;break;case"unlimited":break;case"min":t=e.length;break;case"max":n=e.length;break;default:(0,o.t1)(e)}return{type:"range",min:t,max:n,scroll:e.scroll}}function i(e){return{width:r(null==e?void 0:e.width),height:r(null==e?void 0:e.height)}}},431322:(e,t,n)=>{n.d(t,{pp:()=>p,Wf:()=>a,tg:()=>f,Mb:()=>v});var o=n(667294),r=n(800480),i=n(724405);const a=(0,o.createContext)({constrainedSize:{minWidth:0,minHeight:0,maxWidth:void 0,maxHeight:void 0},actualSize:{width:0,height:0},isWidthScrollbarVisible:!1,isHeightScrollbarVisible:!1});a.displayName="ConstrainSizeContext";var s=n(619584);var l=n(847882);var c=n(926249),d=n(536420);var u=n(785893);function p(e){const{children:t,isSizeTransitionAnimated:n,onSizeChanged:p}=e,m=(0,l.F)(e.areaConstraint),{preferredSize:g,ref:f}=function(e){const t=(0,o.useRef)(null),[n,r]=(0,o.useState)(),i=(0,d.y)(t),a=e.width.min,s=e.width.max,l=e.height.min,u=e.height.max;return(0,o.useLayoutEffect)((()=>{const e=t.current;if(!e)return;const n=function(e){const{div:t,minWidth:n,maxWidth:o,minHeight:r,maxHeight:i}=e,a={minWidth:t.style.minWidth,maxWidth:t.style.maxWidth,minHeight:t.style.minHeight,maxHeight:t.style.maxHeight,width:t.style.width,height:t.style.height,overflow:t.style.overflow};t.style.width="fit-content",t.style.height="fit-content",t.style.overflow="hidden",t.style.minWidth=`${n}px`,t.style.maxWidth=`${o}px`,t.style.minHeight=`${r}px`,t.style.maxHeight=`${i}px`;const s={width:t.scrollWidth,height:t.scrollHeight};return t.style.width=a.width,t.style.height=a.height,t.style.overflow=a.overflow,t.style.minWidth=a.minWidth,t.style.maxWidth=a.maxWidth,t.style.minHeight=a.minHeight,t.style.maxHeight=a.maxHeight,s}({div:e,minWidth:a,maxWidth:s,minHeight:l,maxHeight:u});r((e=>(0,c.Z)(e,n)?e:n))}),[i,a,s,l,u]),{ref:t,preferredSize:n}}(m),h=function(e){const{areaConstraint:t,preferredSize:n}=e;return{width:(0,s.uZ)((null==n?void 0:n.width)??0,t.width.min,t.width.max),height:(0,s.uZ)((null==n?void 0:n.height)??0,t.height.min,t.height.max)}}({areaConstraint:m,preferredSize:g}),v=function(e){const{actualSize:t,preferredSize:n,areaConstraint:o}=e,r="allow"===o.width.scroll,i="allow"===o.height.scroll,a=r&&void 0!==(null==n?void 0:n.width)&&t.width<n.width,s=i&&void 0!==(null==n?void 0:n.width)&&t.height<n.height,l={minWidth:o.width.min,maxWidth:r?void 0:o.width.max,minHeight:o.height.min,maxHeight:i?void 0:o.height.max};return{actualSize:t,constrainedSize:l,isWidthScrollbarVisible:a,isHeightScrollbarVisible:s}}({actualSize:h,preferredSize:g,areaConstraint:m}),y=function(e){const{actualSize:t,areaConstraint:n,isSizeTransitionAnimated:a}=e,s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const[n,r]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{r(!1)}),[...t]),(0,o.useEffect)((()=>{const t=setTimeout((()=>{r(!0)}),e);return()=>{clearTimeout(t)}})),n}(100),{prefersReducedMotion:l}=(0,r.Fy)();return(0,i.yK)((()=>({wrapper:{position:"relative"},content:{height:null==t?void 0:t.height,overflowX:n.width.scroll?"auto":"clip",overflowY:n.height.scroll?"auto":"clip",WebkitOverflowScrolling:"touch",width:null==t?void 0:t.width,transition:a&&s&&!l?"0.25s ease width, 0.25s ease height":void 0},measure:{display:"flex",flexDirection:"column",height:"fit-content",maxHeight:n.height.max,maxWidth:n.width.max,minHeight:n.height.min,minWidth:n.width.min,width:"fit-content"}})),[t,n,a,s,l])}({actualSize:h,areaConstraint:m,isSizeTransitionAnimated:n});return(0,o.useEffect)((()=>{null==p||p(h,g)}),[h,p,g]),(0,u.jsx)(a.Provider,{value:v,children:(0,u.jsx)("div",{style:y.wrapper,children:(0,u.jsx)("div",{style:y.content,children:(0,u.jsx)("div",{ref:f,className:"measure",style:y.measure,children:t})})})})}var m=n(886628),g=n(304926);function f(){const e=(0,o.useContext)(a),t=(0,m.VK)((()=>g.Z.state),[]);return null!=e&&e.isHeightScrollbarVisible?t:0}var h=n(535630);function v(e){const{paddingPixelsPerEdge:t}=e,n=(0,h.iP)();return(0,o.useMemo)((()=>{const e={type:"max",length:n.width-2*t},o={type:"max",length:n.height-2*t};return(0,l.F)({width:e,height:o})}),[t,n.height,n.width])}},679872:(e,t,n)=>{n.d(t,{U:()=>p});var o=n(667294),r=n(724405),i=n(709291),a=n(573063),s=n(433929),l=n(397876),c=n(431322),d=n(257043),u=n(785893);function p(e){const{onClick:t,onDismiss:n,style:i,showBackground:p=!0}=e,g=function(e,t){const n=(0,c.tg)();return(0,r.yK)((o=>({button:{alignItems:"center",background:t?o.buttonHoveredBackground:"none",borderRadius:"100%",display:"flex",height:22,justifyContent:"center",position:"absolute",right:10+n,top:10,width:22,zIndex:10,...e},buttonHovered:{background:t?o.buttonPressedBackground:o.buttonHoveredBackground}})),[t,e,n])}(i,p),f=(0,o.useContext)(d.g),h=function(e){const{onClick:t,onDismiss:n}=e,r=(0,o.useCallback)((e=>{null==t||t(e),null==n||n()}),[t,n]);return t||n?r:void 0}({onClick:t,onDismiss:n??f});return h?(0,u.jsx)(a.Z,{ariaLabel:s.default.formatMessage(m.dismissModalAriaLabel),hoveredStyle:g.buttonHovered,icon:l.D,onClick:h,style:g.button}):null}const m=(0,i.defineMessages)({dismissModalAriaLabel:{id:"dismiss.dismissButton.label",defaultMessage:"Dismiss"}})},195688:(e,t,n)=>{n.d(t,{a:()=>u});var o=n(667294),r=n(709291),i=n(401898),a=n(478140),s=n(460709),l=n(257043),c=n(679872),d=n(785893);function u(e){const{children:t,title:n,displayMode:u}=e,p=(0,o.useContext)(l.g);switch(u){case"phone":return(0,d.jsx)(a.Z,{menuType:s.og.Modal,onClickRight:p,title:n,whiteBackground:!0,disableBottomPadding:!0,right:p?(0,d.jsx)(r.FormattedMessage,{defaultMessage:"Done",id:"appearanceSettings.modal.done"}):null,children:t});case"desktop":return(0,d.jsxs)(d.Fragment,{children:[t,(0,d.jsx)(c.U,{})]});default:(0,i.t1)(u)}}},257043:(e,t,n)=>{n.d(t,{g:()=>o});const o=(0,n(667294).createContext)(void 0);o.displayName="DismissContext"},976940:(e,t,n)=>{n.d(t,{U4:()=>r.U,a5:()=>o.a,gv:()=>i.g});var o=n(195688),r=n(679872),i=n(257043)},536420:(e,t,n)=>{n.d(t,{n:()=>l,y:()=>s});n(21703);var o=n(667294),r=(n(277744),n(926249));let i,a;function s(e){i=i??new Map,a=a??function(e){let t=!1,n=[];return new ResizeObserver((o=>{n=n.concat(o),t||(t=!0,window.requestAnimationFrame((()=>{const o=new Set;[...n].reverse().filter((e=>{const t=o.has(e.target);return o.add(e.target),!t})).forEach((t=>{const n=e.get(t.target);null==n||n.forEach((e=>{const n=t.borderBoxSize[0];e({width:n.inlineSize,height:n.blockSize})}))})),n=[],t=!1})))}))}(i);const[t,n]=(0,o.useState)(void 0),s=(0,o.useCallback)((e=>{n((t=>(0,r.Z)(t,e)?t:e))}),[]);return(0,o.useLayoutEffect)((()=>{const t=e.current;if(!t)return;a.observe(t);const n=[...i.get(t)??[],s];return i.set(t,n),()=>{a.unobserve(t);const e=(i.get(t)??[]).filter((e=>e!==s));0===e.length?i.delete(t):i.set(t,e)}}),[s,e]),t}function l(e){const{children:t,onSizeChange:n}=e,r=(0,o.useRef)(null),i=s(r);(0,o.useEffect)((()=>{n&&i&&n(i)}),[i,n]);const a=o.Children.only(t);return o.cloneElement(a,{ref:r})}},668350:(e,t,n)=>{n.d(t,{U:()=>r});var o=n(250680);class r{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;this.value=e,this.textInstanceId=t;const n=r.overrides.get(t);n&&e>n&&this.updateOverride()}get(){return r.overrides.get(this.textInstanceId)??this.value}set(e){const t=this.get();(0,o.T)(e>=t),this.value=e,this.updateOverride()}updateOverride(){r.overrides.set(this.textInstanceId,this.value)}static TEST_ONLY__clearOverrides(){this.overrides.clear()}}r.overrides=new Map},312422:(e,t,n)=>{n.d(t,{y:()=>u});n(21703);var o=n(300482),r=n(421202),i=n(167175),a=n(653965),s=n(709953),l=n(800993),c=n(210228),d=n(206258);function u(e){const{environment:t,operation:n,transaction:u,inMemoryRecordCache:p}=e;if(n.pointer.table!==r.iU)throw new Error("Expected block operation");const m=new d.G(t,n.pointer,{inMemoryRecordCache:p});(0,o.V_)(n)?function(e){const{environment:t,operation:n,store:o,transaction:r}=e;if("update"===n.command&&a.Xy(n.path,["properties"])&&"title"in n.args){const{title:e,...i}=n.args;l.sO({environment:t,store:o.getBlockTitleStore(),value:e,transaction:r}),Object.keys(i).length>0&&s.sW({store:o.getPropertiesStore(),data:i,transaction:r})}else if("set"===n.command&&a.Xy(n.path,["properties","title"]))l.sO({environment:t,store:o.getBlockTitleStore(),value:n.args,transaction:r});else{if("update"===n.command&&0===n.path.length&&"properties"in n.args||"set"===n.command&&a.Xy(n.path,["properties"]))throw new Error("Woah woah woah - this is a collaborative app here. We can't just overwrite the entire properties object!");c.applyOperation({store:o,operation:n,transaction:r})}}({environment:t,operation:n,store:m,transaction:u}):(0,i.Qf)(n)?c.applyCrdtTextOperation({store:m,operation:n,invertedOperation:void 0,transaction:u}):c.applyOperation({store:m,operation:n,transaction:u})}},678791:(e,t,n)=>{n.d(t,{Cf:()=>g,Wc:()=>f,tE:()=>m});var o=n(541432),r=n(250680),i=n(415095),a=n(159730),s=n(421838),l=n(800993),c=n(210228),d=n(165598),u=n(273959),p=n(27105);function m(e){const{transaction:t,targetStore:n,sourceBlockStore:o}=e,i=(0,r.TO)(o.getTextSliceTree()),s=(0,u.sQ)(n);if(!s||!p.Ls({store:n,blockStore:s}))throw new a.p8("Previous block should exist and use CRDT");const l=i.getOperationsForSplitForMerge();(0,r.T)(0===l.textSliceTreesToMove.length,"Root nodes should have no siblings to move"),h({sourceBlockStore:o,targetBlockStore:s,splitInfo:l,isMerge:!0,transaction:t})}function g(e){const{environment:t,transaction:n,multiSelection:i,removedBlocks:a,movedBlocks:s}=e,c=i.start.store;function g(e){if((0,r.T)(!s.has(e),"Block being reparented should not be deleted"),!(0,o.XD)(e.getType(),e.getFormat()))return;const i=e.getBlockTitleStore();(0,r.T)(p.FX(i)),l.pe({environment:t,transaction:n,selection:{startIndex:0,endIndex:1/0},store:i}),m({transaction:n,sourceBlockStore:e,targetStore:c})}(0,r.T)(p.FX(c));const f=(0,u.sQ)(i.end.store);for(const o of a){if(o===f)return;g(o);for(const e of(0,d.MI)({blockStore:o,transclusionReferences:"omit",childPages:"omit"})){if(e===f)return;g(e)}}}function f(e){const{sourceBlockStore:t,targetBlockStore:n,splitAtGraphemeIndex:o,transaction:a,moveIntoNewBlock:l}=e;(0,r.T)(t.useCrdt()&&n.useCrdt());const d=t.getBlockTitleStore().getValue(),u=new i.W3(s.eeV(d)).getStringStartIndex(o),p=(0,r.TO)(t.getTextSliceTree()).getOperationsForSplitAtIndex(u);!function(e){const{blockStore:t,splitInfo:n,transaction:o}=e,r=t.getBlockTitleStore().getValue()??[],i=n.textSliceTreesToMove,a="splitWithinNode"===n.type?n.textSliceTreeToSplit:n.newTextSliceTree;for(const s of i){const e=t.id,n=a.getTextSlice().textInstanceId,i=a.getTextSlice().getEndItem().id;c.applyCrdtTextOperation({transaction:o,store:t,operation:{command:"moveTextSlice",pointer:t.pointer,path:[],args:{textInstanceId:s.getTextSlice().textInstanceId,textSliceStartItemId:s.getTextSlice().getStartItem().id,targetBlockId:e,targetTextInstanceId:n,targetTextSliceEndItemId:i,forDowngrade:{fullSourceTextValue:r,fullTargetTextValue:r}}},invertedOperation:void 0})}}({blockStore:t,splitInfo:p,transaction:a}),l?function(e){const{sourceBlockStore:t,targetBlockStore:n,splitInfo:o,transaction:i}=e;let a,l,d,u;if("splitNodeEnd"===o.type){const e=o.newTextSliceTree;a=e.getTextSlice().textInstanceId,l=e.getTextSlice().getStartItem().id;const t=o.previousTextSliceTree.getTextSlice();d=t.textInstanceId,u=t.getEndItem().id}else c.applyCrdtTextOperation({transaction:i,store:t,operation:{command:"splitText",pointer:t.pointer,path:[],args:o.splitOp},invertedOperation:void 0}),a=o.splitOp.textInstanceId,l=o.splitOp.id,d=o.splitOp.textInstanceId,u=o.splitOp.id;const p=(0,r.TO)(t.getTextSliceTree()),m=(0,r.TO)(p.getGraphemeIndicesOfSlice({boundary:"start",textInstanceId:a,start:l})).startIndex,g=p.getTextValue(),f=s.KU1(g,0,m),h=s.KU1(g,m,s.VrM(g));c.applyCrdtTextOperation({transaction:i,store:t,operation:{command:"moveTextSliceIntoBlock",path:[],pointer:t.pointer,args:{textInstanceId:a,textSliceStartItemId:l,targetBlockId:n.id,forDowngrade:{fullSourceTextValue:f,fullTargetTextValue:h}}},invertedOperation:{command:"invertedMoveTextSlice",path:[],pointer:t.pointer,args:{textInstanceId:a,textSliceStartItemId:l,targetTextInstanceId:d,targetTextSliceEndItemId:u,sourceBlockId:n.id,previousSourceTextValue:n.getBlockTitleStore().getValue()??[],targetBlockId:t.id,previousTargetTextValue:t.getBlockTitleStore().getValue()??[]}}})}({sourceBlockStore:t,targetBlockStore:n,splitInfo:p,transaction:a}):h({sourceBlockStore:t,targetBlockStore:n,splitInfo:p,isMerge:!1,transaction:a})}function h(e){const{sourceBlockStore:t,targetBlockStore:n,splitInfo:o,isMerge:i,transaction:a}=e;let l,d,u,p;if("splitNodeEnd"===o.type){const e=o.newTextSliceTree;l=e.getTextSlice().textInstanceId,d=e.getTextSlice().getStartItem().id;const t=o.previousTextSliceTree.getTextSlice();u=t.textInstanceId,p=t.getEndItem().id}else c.applyCrdtTextOperation({transaction:a,store:t,operation:{command:"splitText",pointer:t.pointer,path:[],args:o.splitOp},invertedOperation:void 0}),l=o.splitOp.textInstanceId,d=o.splitOp.id,u=o.splitOp.textInstanceId,p=o.splitOp.id;const m=(0,r.TO)(t.getTextSliceTree()),g=(0,r.TO)(m.getGraphemeIndicesOfSlice({boundary:"start",textInstanceId:l,start:d})).startIndex,f=m.getTextValue(),h=s.KU1(f,0,g),v=s.KU1(f,g,s.VrM(f)),y=n.getBlockTitleStore().getValue()??[],b=s.Zxt(s.P$X(y,v,s.VrM(y))),_=(0,r.TO)(n.getTextSliceTree()).getLastTextSliceTreeInPreOrderTraversal();c.applyCrdtTextOperation({transaction:a,store:t,operation:{command:"moveTextSlice",path:[],pointer:t.pointer,args:{textInstanceId:l,textSliceStartItemId:d,targetBlockId:n.id,targetTextInstanceId:_.getTextSlice().textInstanceId,targetTextSliceEndItemId:_.getTextSlice().getEndItem().id,isMerge:i,forDowngrade:{fullSourceTextValue:h,fullTargetTextValue:b}}},invertedOperation:{command:"invertedMoveTextSlice",path:[],pointer:t.pointer,args:{textInstanceId:l,textSliceStartItemId:d,targetTextInstanceId:u,targetTextSliceEndItemId:p,sourceBlockId:n.id,previousSourceTextValue:y,targetBlockId:t.id,previousTargetTextValue:t.getBlockTitleStore().getValue()??[]}}})}},521100:(e,t,n)=>{n.d(t,{b:()=>i});var o=n(709953),r=n(800993);function i(e){const{environment:t,store:n,properties:i,transaction:a}=e;"title"in i&&r.sO({environment:t,store:n.getBlockTitleStore(),value:i.title??void 0,transaction:a});const{title:s,...l}=i;Object.keys(l).length>0&&o.sW({store:n.getPropertiesStore(),data:l,transaction:a})}},27105:(e,t,n)=>{n.d(t,{FX:()=>d,Ls:()=>u,S9:()=>b,SL:()=>v,Sy:()=>h,be:()=>g,dy:()=>f,iG:()=>p,p8:()=>k,s8:()=>m,tO:()=>S});var o=n(961238),r=(n(719056),n(159730)),i=n(421202),a=n(273959),s=n(80444),l=n(385555),c=n(206258);n(668350);function d(e){if(!e.isTable(i.iU))return!1;const t=(0,a.sQ)(e);return!!t&&(t.useCrdt()&&t.getBlockTitleStore()===e)}function u(e){const{store:t,blockStore:n}=e;return n.useCrdt()&&n.getBlockTitleStore()===t}function p(e,t){var n;if(null!==(n=s.default.state.currentSpaceStore)&&void 0!==n&&n.isCrdtEnabled())return!1;return e.useCrdt()!==t.some((e=>e.useCrdt()))}function m(e){return e.useCrdt()?"Cannot move a non-CRDT block into a CRDT parent":"Cannot move a CRDT block into a non-CRDT parent"}function g(e){const{parentStore:t,childStore:n}=e,o=t.getRecordStoreAtRootPath(),i=n.getRecordStoreAtRootPath();if(o instanceof c.G&&i instanceof c.G&&p(o,[i]))throw new r.p8("A CRDT block cannot be parented to a non-CRDT block or vice versa!")}function f(e){return y({invertDefault:!1,...e})}function h(e){const{event:t,...n}=e;return y({invertDefault:"click"===(null==t?void 0:t.type)&&"altKey"in t&&t.altKey,...n})}function v(e){const{event:t,...n}=e;return y({invertDefault:"click"===(null==t?void 0:t.type)&&t.altKey,...n})}function y(e){const{invertDefault:t,contextualDefault:n}=e;if(!l.default.checkGate({gateName:"enable_text_crdt_client"}))return!1;const o="source"in e&&(l.default.checkGate({gateName:"enable_default_create_crdt_page"})&&l.default.getConfigKey("default_create_crdt_page_config",e.source))||n;return o&&!t||!o&&t}function b(e){return l.default.checkGate({gateName:"enable_text_crdt_client"})&&l.default.checkGate({gateName:"enable_default_create_crdt_page"})&&l.default.getConfigKey("default_create_crdt_page_config",e)}function _(e){switch(e){case"space-private-pages":return"private";case"collection":return"collection_unknown_view";case"space":return"space";case"team":return"team"}}function S(e){const{event:t,type:n,parentStore:o}=e;return"page"===n?o instanceof c.G&&o.useCrdt():v({event:t,source:_(n)})}function k(e){var t;return(0,o.c)()?(null===(t=s.default.state.currentSpaceStore)||void 0===t?void 0:t.getSetting("crdt_enabled"))??!1:e}},296994:(e,t,n)=>{n.d(t,{$C:()=>Ve,$i:()=>we,AM:()=>m,AU:()=>A,Ao:()=>he,B$:()=>W,Bq:()=>X,C6:()=>at,CT:()=>ut,D8:()=>B,DG:()=>K,DH:()=>Ke,EN:()=>Ae,F7:()=>f,FD:()=>Ce,FF:()=>l,FN:()=>me,Fj:()=>rt,GM:()=>ct,GS:()=>d,GZ:()=>St,Gr:()=>se,H1:()=>vt,Ie:()=>Ze,J3:()=>Se,Jc:()=>gt,Js:()=>ae,KA:()=>H,KO:()=>ue,Ke:()=>Ye,Ki:()=>k,Lf:()=>Ue,Lq:()=>R,M3:()=>ze,OG:()=>E,Ov:()=>u,P$:()=>tt,Pe:()=>We,Pl:()=>bt,Q3:()=>P,R7:()=>Ne,S:()=>Je,SG:()=>$e,Ss:()=>je,T3:()=>g,TG:()=>Oe,Tz:()=>Pe,UM:()=>pe,Uk:()=>q,V8:()=>Q,WI:()=>Y,WK:()=>Me,WW:()=>ie,Wh:()=>c,Wq:()=>ne,XQ:()=>mt,XY:()=>ke,ZH:()=>Z,_C:()=>L,_e:()=>z,_k:()=>dt,aJ:()=>ot,aL:()=>T,aP:()=>Re,bI:()=>Fe,bJ:()=>re,bj:()=>_,by:()=>Ie,c4:()=>h,c5:()=>lt,d5:()=>F,dK:()=>Ge,db:()=>I,eU:()=>le,es:()=>He,ev:()=>nt,f:()=>b,fe:()=>kt,fo:()=>_t,g0:()=>S,gM:()=>Le,gS:()=>ft,gW:()=>pt,hJ:()=>Ee,hq:()=>p,i4:()=>j,iL:()=>De,jF:()=>w,jK:()=>x,jZ:()=>G,kC:()=>ge,lG:()=>be,lr:()=>it,mN:()=>Te,nP:()=>te,o9:()=>N,oC:()=>V,oX:()=>yt,op:()=>ee,pD:()=>fe,pj:()=>y,pn:()=>D,pt:()=>et,q4:()=>C,qP:()=>M,qV:()=>ce,qb:()=>_e,r1:()=>J,r4:()=>v,rA:()=>Xe,rZ:()=>oe,t$:()=>U,t2:()=>xe,t5:()=>$,u8:()=>Be,vJ:()=>Qe,vK:()=>ht,vO:()=>qe,w3:()=>ve,w_:()=>wt,x1:()=>st,xm:()=>de,yG:()=>ye,yM:()=>O});var o=n(841892),r=n(265454),i=n(937850),a=n(95477),s=n(277907);const l={mutiny:new s.Ss("mutiny",(async()=>{const[e]=await Promise.allSettled([(0,r.ZP)(`https://client-registry.mutinycdn.com/personalize/client/${a.default.mutiny.personalKey}.js`)]);return e})),googleOneTap:new s.Ss("googleOneTap",(async()=>await i.de([(0,r.ZP)("https://accounts.google.com/gsi/client"),i.Xb(1e4,void 0)]))),katex:new s.Ss("katex",(async()=>{const[e]=await Promise.all([Promise.all([n.e(41008),n.e(12793)]).then(n.bind(n,541008)),(0,r.ZP)(o.Z.katex.katexMinCss,{resourceType:r._g.Stylesheet})]);return await Promise.all([n.e(41008),n.e(12793)]).then(n.bind(n,967854)),e.default})),reactPDF:new s.Ss("react-pdf",(async()=>{const[e]=await Promise.all([Promise.all([n.e(61329),n.e(39295)]).then(n.bind(n,461329)),Promise.all([n.e(61329),n.e(39295)]).then(n.bind(n,211366))]);return e})),imageEdit:new s.Ss("imageEdit",(()=>n.e(78138).then(n.bind(n,684564)))),SpaceSettings:new s.Ss("SpaceSettings",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,646578)))),AddonUpgradeModal:new s.Ss("AddOnUpgradeModal",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,28833)))),AiAssistantIntroModal:new s.Ss("AiAssistantIntroModal",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,391405)))),GenerateSocialMediaPreviewImageWrapper:new s.Ss("GenerateSocialMediaPreviewImageWrapper",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,623801)))),CollapsiblePropertyGroupsModule:new s.Ss("CollapsiblePropertyGroupsModule",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,266594)))),ChartsLaunchModal:new s.Ss("ChartsLaunchModal",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,400182)))),DummyModal:new s.Ss("DummyModal",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,981663)))),NotionCalendarLaunchModal:new s.Ss("NotionCalendarLaunchModal",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,364371)))),calendarDateIcons:new s.Ss("notionCalendarIcons",(async()=>n.e(192).then(n.bind(n,709785)))),SidebarConnectionsModal:new s.Ss("SidebarConnectionsModal",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,230761)))),SpaceSubscriptionUpdateModal:new s.Ss("SpaceSubscriptionUpdateModal",(async()=>Promise.all([n.e(62743),n.e(17100),n.e(22741),n.e(93301)]).then(n.bind(n,564514)))),AppComponents:new s.Ss("AppComponents",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,58135)))),AdminReactJson:new s.Ss("AdminReactJson",(async()=>Promise.all([n.e(69343),n.e(40782),n.e(83e3)]).then(n.bind(n,606191)))),BannersRenderer:new s.Ss("BannersRenderer",(async()=>Promise.all([n.e(62743),n.e(17444),n.e(28971),n.e(43102),n.e(35353),n.e(59475),n.e(5054)]).then(n.bind(n,585369)))),AppTemplates:new s.Ss("AppTemplates",(async()=>{const[{AppInitializationOverlay:e},t,o,r,i,{appConfigs:a},{default:s},{ExperimentalHorizontalTemplatePicker:l}]=await Promise.all([Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(16732),n.e(11002),n.e(16536),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(88833),n.e(65496),n.e(21847),n.e(22291),n.e(67310)]).then(n.bind(n,692053)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(16732),n.e(11002),n.e(16536),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(88833),n.e(65496),n.e(21847),n.e(22291),n.e(67310)]).then(n.bind(n,417202)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(16732),n.e(11002),n.e(16536),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(88833),n.e(65496),n.e(21847),n.e(22291),n.e(67310)]).then(n.bind(n,288833)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(16732),n.e(11002),n.e(16536),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(88833),n.e(65496),n.e(21847),n.e(22291),n.e(67310)]).then(n.bind(n,933089)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(16732),n.e(11002),n.e(16536),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(88833),n.e(65496),n.e(21847),n.e(22291),n.e(67310)]).then(n.bind(n,486095)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(16732),n.e(11002),n.e(16536),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(88833),n.e(65496),n.e(21847),n.e(22291),n.e(67310)]).then(n.bind(n,416536)),Promise.all([n.e(62743),n.e(84885),n.e(16732),n.e(11002),n.e(16536),n.e(4617),n.e(16929),n.e(94039)]).then(n.bind(n,827981)),Promise.all([n.e(62743),n.e(5242),n.e(31189),n.e(40017),n.e(62451),n.e(23029),n.e(63327),n.e(99417),n.e(84654),n.e(58075),n.e(95203),n.e(7515),n.e(81726),n.e(46225),n.e(75819)]).then(n.bind(n,267229))]);return{AppInitializationOverlay:e,templatePickerItems:t,appTemplatesSetupActions:o,untypedFeaturesSetupActions:r,appTemplatesSprintBoardActions:i,appConfigs:a,TemplatePickerTemplateList:s,ExperimentalHorizontalTemplatePicker:l}})),TransferWorkspaceModal:new s.Ss("TransferWorkspaceModal",(async()=>n.e(34114).then(n.bind(n,689045)))),ConfirmOverwriteModal:new s.Ss("ConfirmOverwriteModal",(async()=>n.e(41346).then(n.bind(n,234236)))),ConfigureIntegrationModal:new s.Ss("ConfigureIntegrationModal",(async()=>Promise.all([n.e(14931),n.e(15116)]).then(n.bind(n,345007)))),GuestUpsellModal:new s.Ss("GuestUpsellModal",(async()=>Promise.all([n.e(62743),n.e(27844)]).then(n.bind(n,612970)))),ConnectOAuthIntegrationModal:new s.Ss("ConnectOAuthIntegrationModal",(async()=>n.e(14931).then(n.bind(n,491364)))),ConfirmPrivilegedActionModal:new s.Ss("ConfirmPrivilegedActionModal",(async()=>n.e(2293).then(n.bind(n,722204)))),SearchModal:new s.Ss("SearchModal",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(90424),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(99417),n.e(84654),n.e(58075),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(83264),n.e(15362),n.e(30874),n.e(17444),n.e(68452),n.e(67899),n.e(66464)]).then(n.bind(n,333991)))),menus:new s.Ss("menus",(async()=>{const[{default:e},{TopbarPageAnalyticsOptOutMenu:t},{default:o},{default:r},{default:i},{default:a},{default:s},{default:l},{default:c},{default:d},{default:u},{default:p},{SidebarTeamModal:m},{SidebarCreateTeamModal:g},{CreateTeamFromPageConfirmModal:f},{CollectionTypedDatabaseMigrationModal:h},{default:v},{default:y},{default:b}]=await Promise.all([Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,642607)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,248603)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,990185)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,901176)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,573085)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,533535)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,679027)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,113787)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,785324)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,682767)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,581070)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,200001)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,383150)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,714982)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,515418)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,928971)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,374661)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,299662)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,225228))]);return{CustomizePageMenuRenderer:e,TopbarPageAnalyticsOptOutMenu:t,ImportModal:o,ExportModal:r,PageTemplateModal:i,TemplateGalleryModal:a,GoogleAuthPromptModal:s,StudentNotEligibleModal:l,CookieModal:c,ForkPagePopup:d,DatePropertyMenu:u,ReportPageModal:p,SidebarCreateTeamModal:g,SidebarTeamModal:m,CreateTeamFromPageConfirmModal:f,CollectionTypedDatabaseMigrationModal:h,OpenInDesktopAppPopup:v,BlockMenu:y,ImportIntoNewPageModal:b}})),shareMenuContainer:new s.Ss("shareMenuContainer",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,497864)))),topbarMoreMenu:new s.Ss("topbarMoreMenu",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,790658)))),topbarMoreButton:new s.Ss("topbarMoreButton",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,192599)))),topbarShareButton:new s.Ss("topbarShareButton",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,501549)))),topbarStopSuggestModeButton:new s.Ss("topbarStopSuggestModeButton",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,942975)))),publicTopbarMoreMenu:new s.Ss("publicTopbarMoreMenu",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,453706)))),teamPermissionsInvite:new s.Ss("teamPermissionsInvite",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,438680)))),permissionsInviteWithModal:new s.Ss("permissionsInviteWithModal",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,374743)))),HelpButtonContent:new s.Ss("HelpButtonContent",(async()=>await n.e(53060).then(n.bind(n,104160)))),teamPermissionsInviteWithModal:new s.Ss("teamPermissionsInviteWithModal",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,671015)))),mobile:new s.Ss("mobile",(async()=>{const[{TopLevelMobileComponents:e},{default:t},{default:o},{default:r},{default:i},{default:a},{default:s},{default:l},{default:c}]=await Promise.all([Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(50526),n.e(70588),n.e(69053),n.e(80672),n.e(92557),n.e(91377),n.e(31282),n.e(3728),n.e(46225),n.e(32427),n.e(62985),n.e(94974),n.e(13225),n.e(81223),n.e(25008)]).then(n.bind(n,530439)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(50526),n.e(70588),n.e(69053),n.e(80672),n.e(92557),n.e(91377),n.e(31282),n.e(3728),n.e(46225),n.e(32427),n.e(62985),n.e(94974),n.e(13225),n.e(81223),n.e(25008)]).then(n.bind(n,850664)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(50526),n.e(70588),n.e(69053),n.e(80672),n.e(92557),n.e(91377),n.e(31282),n.e(3728),n.e(46225),n.e(32427),n.e(62985),n.e(94974),n.e(13225),n.e(81223),n.e(25008)]).then(n.bind(n,420444)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(50526),n.e(70588),n.e(69053),n.e(80672),n.e(92557),n.e(91377),n.e(31282),n.e(3728),n.e(46225),n.e(32427),n.e(62985),n.e(94974),n.e(13225),n.e(81223),n.e(25008)]).then(n.bind(n,181446)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(50526),n.e(70588),n.e(69053),n.e(80672),n.e(92557),n.e(91377),n.e(31282),n.e(3728),n.e(46225),n.e(32427),n.e(62985),n.e(94974),n.e(13225),n.e(81223),n.e(25008)]).then(n.bind(n,339755)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(50526),n.e(70588),n.e(69053),n.e(80672),n.e(92557),n.e(91377),n.e(31282),n.e(3728),n.e(46225),n.e(32427),n.e(62985),n.e(94974),n.e(13225),n.e(81223),n.e(25008)]).then(n.bind(n,161735)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(50526),n.e(70588),n.e(69053),n.e(80672),n.e(92557),n.e(91377),n.e(31282),n.e(3728),n.e(46225),n.e(32427),n.e(62985),n.e(94974),n.e(13225),n.e(81223),n.e(25008)]).then(n.bind(n,203713)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(50526),n.e(70588),n.e(69053),n.e(80672),n.e(92557),n.e(91377),n.e(31282),n.e(3728),n.e(46225),n.e(32427),n.e(62985),n.e(94974),n.e(13225),n.e(81223),n.e(25008)]).then(n.bind(n,822168)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(50526),n.e(70588),n.e(69053),n.e(80672),n.e(92557),n.e(91377),n.e(31282),n.e(3728),n.e(46225),n.e(32427),n.e(62985),n.e(94974),n.e(13225),n.e(81223),n.e(25008)]).then(n.bind(n,840721))]);return{TopLevelMobileComponents:e,MobileNativeFullPageComponents:t,MobileBottomBar:o,MobileActionBarWrapper:r,MobileActionBar:i,NativeMobileActionBar:a,TopbarMobile:s,MobileCalendarDayMenu:l,MobileModal:c}})),desktop:new s.Ss("desktop",(async()=>{const[{Notification:e},{default:t}]=await Promise.all([Promise.all([n.e(55061),n.e(99380)]).then(n.bind(n,60951)),Promise.all([n.e(55061),n.e(99380)]).then(n.bind(n,81346))]);return{Notification:e,ElectronContextMenu:t}})),mermaidAPI:new s.Ss("mermaidAPI",(async()=>{const e=(await Promise.all([n.e(37706),n.e(95552)]).then(n.bind(n,435793))).default;return e.initialize({startOnLoad:!1,securityLevel:"strict"}),e})),tinyMceMicrosoftWordPasteFilter:new s.Ss("tinymce-word-paste-filter",(async()=>(await n.e(51109).then(n.t.bind(n,46585,23))).default)),exportJsxRenderer:new s.Ss("exportJsxRenderer",(async()=>await n.e(59293).then(n.bind(n,515499)))),markdownLinkifyIt:new s.Ss("markdown-linkify-it",(async()=>{const[e,t]=await Promise.all([n.e(31189).then(n.t.bind(n,809980,23)),n.e(31189).then(n.t.bind(n,968337,23))]);return{MarkdownIt:e.default,LinkifyIt:t.default}})),formulaStringHelpers:new s.Ss("formula-string-helpers",(async()=>{const[e,t]=await Promise.all([Promise.all([n.e(43165),n.e(53878)]).then(n.bind(n,698025)),Promise.all([n.e(43165),n.e(53878)]).then(n.bind(n,968703))]);return{formulaToString:e.formulaToString,stringToFormula:t.stringToFormula}})),prismjs:new s.Ss("prismjs",(async()=>{const e=await Promise.resolve().then(n.bind(n,820852));return await e.importPrism()})),payments:new s.Ss("payments",(async()=>{const[{CheckoutUpgradeModal:e},{default:t},{PlansModalContent:o},{BillingModalContent:r},i,a]=await Promise.all([Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(20594),n.e(64752),n.e(25676),n.e(84689),n.e(87983)]).then(n.bind(n,873943)),Promise.all([n.e(62743),n.e(17100),n.e(12486),n.e(22741),n.e(46550)]).then(n.bind(n,979097)),Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(20594),n.e(64752),n.e(25676),n.e(84689),n.e(87983)]).then(n.bind(n,439230)),Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(20594),n.e(64752),n.e(25676),n.e(84689),n.e(87983)]).then(n.bind(n,591309)),Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(20594),n.e(64752),n.e(25676),n.e(84689),n.e(87983)]).then(n.bind(n,439230)),Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(20594),n.e(64752),n.e(25676),n.e(84689),n.e(87983)]).then(n.bind(n,591309)),Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(20594),n.e(64752),n.e(25676),n.e(84689),n.e(87983)]).then(n.t.bind(n,629756,23)),Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(20594),n.e(64752),n.e(25676),n.e(84689),n.e(87983)]).then(n.bind(n,67518))]);return{CheckoutUpgradeModal:e,ClaimAndUpgradeModal:t,PlansModalContent:o,BillingModalContent:r,plans:i,billing:a}})),SubscriptionDebugCommands:new s.Ss("SubscriptionDebugCommands",(async()=>await Promise.all([n.e(99417),n.e(84654),n.e(95126)]).then(n.bind(n,700173)))),recurrence:new s.Ss("recurrence",(async()=>{const[e,t,{default:o}]=await Promise.all([Promise.all([n.e(62743),n.e(84885),n.e(62069),n.e(43627),n.e(90653)]).then(n.bind(n,603992)),Promise.all([n.e(62743),n.e(84885),n.e(62069),n.e(43627),n.e(90653)]).then(n.bind(n,954061)),Promise.all([n.e(62743),n.e(84885),n.e(62069),n.e(43627),n.e(90653)]).then(n.bind(n,469317))]);return{recurrenceActions:e,recurrenceHelpers:t,RecurrenceConfigMenu:o}})),integrations:new s.Ss("integrations",(async()=>{const[{default:e},{default:t},{default:o},{default:r}]=await Promise.all([Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(62451),n.e(23029),n.e(97372),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(12867),n.e(95203),n.e(65496),n.e(55649),n.e(44313),n.e(1170),n.e(50801)]).then(n.bind(n,667229)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(62451),n.e(23029),n.e(97372),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(12867),n.e(95203),n.e(65496),n.e(55649),n.e(44313),n.e(1170),n.e(50801)]).then(n.bind(n,612265)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(62451),n.e(23029),n.e(97372),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(12867),n.e(95203),n.e(65496),n.e(55649),n.e(44313),n.e(1170),n.e(50801)]).then(n.bind(n,456305)),Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(62451),n.e(23029),n.e(97372),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(12867),n.e(95203),n.e(65496),n.e(55649),n.e(44313),n.e(1170),n.e(50801)]).then(n.bind(n,90704))]);return{DeveloperIntegrationsList:e,DeveloperIntegrationViewV2:t,DeveloperIntegrationCreateV2:o,DeveloperIntegrationLab:r}})),reactDayPicker:new s.Ss("react-day-picker",(async()=>await Promise.all([n.e(39658),n.e(81369)]).then(n.bind(n,209909)))),ActivityUpdate:new s.Ss("activityUpdate",(async()=>await Promise.all([n.e(62743),n.e(5242),n.e(98530),n.e(84727),n.e(70588),n.e(55061),n.e(57866)]).then(n.bind(n,448212)))),ActivityNotification:new s.Ss("activityNotification",(async()=>await Promise.all([n.e(62743),n.e(44832),n.e(5242),n.e(62451),n.e(23029),n.e(97372),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(12867),n.e(98530),n.e(95203),n.e(65496),n.e(55649),n.e(84727),n.e(70588),n.e(73254),n.e(55061),n.e(5947),n.e(6215)]).then(n.bind(n,50343)))),Invoice:new s.Ss("invoice",(async()=>await n.e(15149).then(n.bind(n,8812)))),TimeSeries:new s.Ss("time-series",(async()=>await Promise.all([n.e(52774),n.e(37706),n.e(59216),n.e(26056),n.e(27994)]).then(n.bind(n,330251)))),formulas:new s.Ss("formulas",(async()=>await Promise.resolve().then(n.bind(n,446725)))),MessageStoreDebugPanel:new s.Ss("message-store-debug-panel",(async()=>await Promise.all([n.e(37706),n.e(59216),n.e(51308)]).then(n.bind(n,383606)))),CrdtDebuggingOverlay:new s.Ss("crdt-debugging-overlay",(async()=>await n.e(87125).then(n.bind(n,432025)))),ExternalObjectInstanceBlockMenu:new s.Ss("ExternalObjectInstanceBlockMenu",(()=>Promise.all([n.e(62743),n.e(62451),n.e(23029),n.e(63327),n.e(95203),n.e(47509)]).then(n.bind(n,269255)))),assistantAnimatedFace:new s.Ss("assistantAnimatedFace",(()=>Promise.all([n.e(98905),n.e(37598)]).then(n.bind(n,781076)))),dictation:new s.Ss("dictation",(()=>Promise.all([n.e(99417),n.e(69053),n.e(31282),n.e(81223),n.e(45830)]).then(n.bind(n,181223)))),automations:new s.Ss("automations",(()=>Promise.all([n.e(62743),n.e(52774),n.e(5242),n.e(31189),n.e(40017),n.e(84885),n.e(16732),n.e(97372),n.e(67180),n.e(99417),n.e(84654),n.e(58075),n.e(83264),n.e(86621),n.e(24252),n.e(87266),n.e(43627),n.e(87683),n.e(16929),n.e(45534),n.e(2216),n.e(31655)]).then(n.bind(n,771272)))),moveTo:new s.Ss("moveTo",(()=>Promise.all([n.e(62743),n.e(32759),n.e(94670)]).then(n.bind(n,983564)))),notifications:new s.Ss("notifications",(()=>Promise.all([n.e(62743),n.e(52774),n.e(5242),n.e(31189),n.e(40017),n.e(37706),n.e(59216),n.e(26056),n.e(99417),n.e(84654),n.e(58075),n.e(67120),n.e(98530),n.e(83264),n.e(84727),n.e(70588),n.e(80672),n.e(55061),n.e(3728),n.e(2918),n.e(33809),n.e(13225),n.e(51909)]).then(n.bind(n,962121)))),UpdatesPopup:new s.Ss("UpdatesPopup",(()=>Promise.all([n.e(62743),n.e(52774),n.e(5242),n.e(31189),n.e(40017),n.e(37706),n.e(59216),n.e(26056),n.e(99417),n.e(84654),n.e(58075),n.e(67120),n.e(98530),n.e(83264),n.e(84727),n.e(70588),n.e(80672),n.e(55061),n.e(3728),n.e(2918),n.e(33809),n.e(13225),n.e(51909)]).then(n.bind(n,923154)))),SecondarySidebar:new s.Ss("SecondarySidebar",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(67120),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(30874),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(86621),n.e(94539),n.e(67899),n.e(32833),n.e(73173),n.e(2918),n.e(46101)]).then(n.bind(n,533675)))),Tldraw:new s.Ss("Tldraw",(()=>Promise.all([n.e(41668),n.e(96991)]).then(n.bind(n,899392)))),tourTutorial:new s.Ss("tourTutorial",(()=>Promise.all([n.e(62743),n.e(68306),n.e(50467)]).then(n.bind(n,387223)))),AboutNotionDevelopersModal:new s.Ss("AboutNotionDevelopersModal",(()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(97372),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(65496),n.e(21847),n.e(22291),n.e(93636)]).then(n.bind(n,218608)))),thirdPartyScripts:new s.Ss("thirdPartyScripts",(()=>n.e(39765).then(n.bind(n,200202)))),PageError:new s.Ss("PageError",(async()=>Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(4226),n.e(96672),n.e(53628),n.e(66942)]).then(n.bind(n,756358)))),BlankPage:new s.Ss("BlankPage",(async()=>n.e(92434).then(n.bind(n,486266)))),FeatureIntroPopup:new s.Ss("FeatureIntroPopup",(async()=>n.e(44843).then(n.bind(n,741458)))),aliasBlockPopupMenu:new s.Ss("aliasBlockPopupMenu",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,187493)))),CollectionItemCover:new s.Ss("CollectionItemCover",(async()=>{const{CollectionItemCover:e}=await Promise.all([n.e(62743),n.e(80064)]).then(n.bind(n,980064));return{CollectionItemCover:e}})),FormBlock:new s.Ss("FormBlock",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(97372),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(65496),n.e(21847),n.e(22291),n.e(81726),n.e(93455)]).then(n.bind(n,702378)))),CollectionFormEditorView:new s.Ss("CollectionFormEditorView",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(16732),n.e(11002),n.e(16536),n.e(97372),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(65496),n.e(21847),n.e(22291),n.e(81726),n.e(42308),n.e(15746)]).then(n.bind(n,614555)))),CollectionChartView:new s.Ss("CollectionChartView",(async()=>await Promise.all([n.e(62743),n.e(62789),n.e(16732),n.e(97372),n.e(67180),n.e(38637),n.e(73254),n.e(61244),n.e(19287),n.e(79308)]).then(n.bind(n,481920)))),AxisChart:new s.Ss("CollectionChartView",(async()=>await Promise.all([n.e(62743),n.e(62789),n.e(16732),n.e(97372),n.e(67180),n.e(38637),n.e(73254),n.e(61244),n.e(19287),n.e(79308)]).then(n.bind(n,345313)))),DonutChart:new s.Ss("CollectionChartView",(async()=>await Promise.all([n.e(62743),n.e(62789),n.e(16732),n.e(97372),n.e(67180),n.e(38637),n.e(73254),n.e(61244),n.e(19287),n.e(79308)]).then(n.bind(n,10317)))),CollectionTasksEmptyStateModal:new s.Ss("CollectionTasksEmptyStateModal",(async()=>await Promise.all([n.e(62743),n.e(91798),n.e(36751)]).then(n.bind(n,91798)))),TimelineItemDateRange:new s.Ss("TimelineItemDateRange",(async()=>await Promise.all([n.e(62743),n.e(44832),n.e(97372),n.e(67180),n.e(38637),n.e(24115),n.e(27974),n.e(67197)]).then(n.bind(n,982119)))),NewPageInMenu:new s.Ss("NewPageInMenu",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(87597),n.e(63690),n.e(19527),n.e(16732),n.e(11002),n.e(16536),n.e(32252),n.e(15362),n.e(38636),n.e(73173),n.e(82386),n.e(32759),n.e(14156),n.e(68306),n.e(97491),n.e(24541)]).then(n.bind(n,239193)))),CreatorProfile:new s.Ss("CreatorProfile",(async()=>{const{default:e}=await Promise.all([n.e(62743),n.e(52774),n.e(5242),n.e(31189),n.e(40017),n.e(11002),n.e(99417),n.e(84654),n.e(58075),n.e(44313),n.e(1170),n.e(20591),n.e(60613)]).then(n.bind(n,902946));return{CreatorProfile:e}})),CreatorProfileIntegrations:new s.Ss("CreatorProfileIntegrations",(async()=>{const{default:e}=await Promise.all([n.e(62743),n.e(52774),n.e(5242),n.e(31189),n.e(40017),n.e(11002),n.e(99417),n.e(84654),n.e(58075),n.e(44313),n.e(1170),n.e(20591),n.e(60613)]).then(n.bind(n,794672));return{CreatorProfileIntegrations:e}})),CreatorProfileIntegrationsDetail:new s.Ss("CreatorProfileIntegrationsDetail",(async()=>{const{default:e}=await Promise.all([n.e(62743),n.e(52774),n.e(5242),n.e(31189),n.e(40017),n.e(11002),n.e(99417),n.e(84654),n.e(58075),n.e(44313),n.e(1170),n.e(20591),n.e(60613)]).then(n.bind(n,922703));return{CreatorProfileIntegrationsDetail:e}})),LocalizedTemplates:new s.Ss("LocalizedTemplates",(async()=>{const{default:e}=await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(16732),n.e(11002),n.e(16536),n.e(97372),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(65496),n.e(21847),n.e(22291),n.e(32427),n.e(20591),n.e(54801)]).then(n.bind(n,150989));return{LocalizedTemplates:e}})),Marketplace:new s.Ss("Marketplace",(async()=>{const{default:e}=await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(16732),n.e(11002),n.e(16536),n.e(97372),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(65496),n.e(21847),n.e(22291),n.e(32427),n.e(20591),n.e(54801)]).then(n.bind(n,401007));return{Marketplace:e}})),isTemplateHelper:new s.Ss("isTemplate",(async()=>await n.e(96047).then(n.bind(n,462992)))),isSinglePlayerTemplateHelper:new s.Ss("isSinglePlayerTemplate",(async()=>Promise.all([n.e(11002),n.e(4774)]).then(n.bind(n,79637)))),StudentGroupSignup:new s.Ss("StudentGroupSignup",(async()=>Promise.all([n.e(62743),n.e(6873),n.e(16928)]).then(n.bind(n,771069)))),StartupsApplication:new s.Ss("StartupsApplication",(async()=>Promise.all([n.e(62743),n.e(6873),n.e(25606)]).then(n.bind(n,912728)))),Onboarding:new s.Ss("Onboarding",(async()=>Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(67053)]).then(n.bind(n,926488)))),onboardingStateActions:new s.Ss("onboardingStateActions",(async()=>Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(67053)]).then(n.bind(n,510085)))),outlinerViewAll:new s.Ss("outlinerViewAll",(async()=>{const{OutlinerViewAllButton:e}=await Promise.all([n.e(62743),n.e(54826)]).then(n.bind(n,373358)),{OutlinerViewAllPopup:t}=await Promise.all([n.e(62743),n.e(54826)]).then(n.bind(n,519174));return{OutlinerViewAllButton:e,OutlinerViewAllPopup:t}})),PagePropertiesRowNameMenu:new s.Ss("PagePropertiesRowNameMenu",(async()=>Promise.all([n.e(16732),n.e(11002),n.e(16536),n.e(43627),n.e(97583)]).then(n.bind(n,336510)))),pageCovers:new s.Ss("pageCovers",(async()=>n.e(1642).then(n.bind(n,504323)))),WikiPromoPopup:new s.Ss("WikiPromoPopup",(async()=>await n.e(30137).then(n.bind(n,231523)))),AIAddOnDiscountPopup:new s.Ss("AIAddOnDiscountPopup",(async()=>await n.e(1352).then(n.bind(n,308956)))),TimedTrialPopup:new s.Ss("TimedTrialPopup",(async()=>await Promise.all([n.e(52774),n.e(33705),n.e(74787)]).then(n.bind(n,410074)))),marketplacePaymentPage:new s.Ss("marketplacePaymentPage",(async()=>await Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(4226),n.e(96672),n.e(88889),n.e(32196)]).then(n.bind(n,988889)))),login:new s.Ss("login",(async()=>{const{default:e}=await Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(4226),n.e(96672),n.e(54535)]).then(n.bind(n,46420)),{default:t}=await Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(4226),n.e(96672),n.e(54535)]).then(n.bind(n,520243)),{default:o}=await Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(4226),n.e(96672),n.e(54535)]).then(n.bind(n,758891)),{default:r}=await Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(4226),n.e(96672),n.e(54535)]).then(n.bind(n,749077)),{default:i}=await Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(4226),n.e(96672),n.e(54535)]).then(n.bind(n,448787));return{LoginPage:e,LoginDesktop:t,LoginMobileNative:o,FrontLoginPage:r,LoginModalContent:i}})),emojiData:new s.Ss("emojiData",(async()=>(await n.e(65616).then(n.bind(n,315821))).default)),teamspaceMenus:new s.Ss("teamspaceMenus",(async()=>{const[{default:e},{OutlinerTeamOverflow:t,TeamOverflowMenu:o}]=await Promise.all([Promise.all([n.e(16732),n.e(11002),n.e(16536),n.e(4617),n.e(38636),n.e(66860)]).then(n.bind(n,146611)),Promise.all([n.e(16732),n.e(11002),n.e(16536),n.e(4617),n.e(38636),n.e(66860)]).then(n.bind(n,146276))]);return{TeamBreadcrumbPopup:e,OutlinerTeamOverflow:t,TeamOverflowMenu:o}})),RelationPropertyCustomizeLayoutMenu:new s.Ss("RelationPropertyCustomizeLayoutMenu",(async()=>{const{default:e}=await Promise.all([n.e(44832),n.e(75203)]).then(n.bind(n,875203));return{RelationPropertyCustomizeLayoutMenu:e}})),RelationPropertyMenu:new s.Ss("RelationPropertyMenu",(async()=>{const{default:e}=await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(70621)]).then(n.bind(n,170621));return{RelationPropertyMenu:e}})),RelationMenuRow:new s.Ss("RelationMenuRow",(async()=>{const{default:e}=await Promise.all([n.e(62743),n.e(44832),n.e(97372),n.e(67180),n.e(38637),n.e(24115),n.e(56245)]).then(n.bind(n,568139));return{RelationMenuRow:e}})),Breadcrumb:new s.Ss("Breadcrumb",(async()=>{const{default:e}=await n.e(65548).then(n.bind(n,202517));return{Breadcrumb:e}})),FloatingTableOfContents:new s.Ss("floatingTableOfContents",(async()=>await n.e(26534).then(n.bind(n,603286)))),WorkspaceSettingsConsole:new s.Ss("settingsConsole",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(37706),n.e(59216),n.e(26056),n.e(16732),n.e(11002),n.e(16536),n.e(4617),n.e(67120),n.e(30874),n.e(28971),n.e(50526),n.e(23212),n.e(53628),n.e(44313),n.e(12273),n.e(97314),n.e(3867)]).then(n.bind(n,252987)))),OrganizationSettingsConsole:new s.Ss("settingsConsole",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(37706),n.e(59216),n.e(26056),n.e(16732),n.e(11002),n.e(16536),n.e(4617),n.e(67120),n.e(30874),n.e(67899),n.e(28971),n.e(50526),n.e(23212),n.e(53628),n.e(44313),n.e(12273),n.e(97314),n.e(27718),n.e(73207)]).then(n.bind(n,391205)))),ForkPageModalWrapper:new s.Ss("ForkPageModalWrapper",(async()=>await Promise.all([n.e(62743),n.e(11002),n.e(15362),n.e(8129)]).then(n.bind(n,41717)))),SlackImportsInviteWithModal:new s.Ss("SlackImportsInviteWithModal",(async()=>await Promise.all([n.e(62743),n.e(16732),n.e(11002),n.e(16536),n.e(4617),n.e(35691),n.e(54843)]).then(n.bind(n,735691)))),minisearch:new s.Ss("minisearch",(async()=>await n.e(65370).then(n.bind(n,565370)))),SitesSettingsTab:new s.Ss("SitesSettingsTab",(async()=>await Promise.all([n.e(62743),n.e(44832),n.e(5242),n.e(62451),n.e(23029),n.e(97372),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(12867),n.e(98530),n.e(95203),n.e(65496),n.e(55649),n.e(84727),n.e(16809),n.e(79582)]).then(n.bind(n,571373)))),ScrollableSitesBannerContainer:new s.Ss("ScrollableSitesBannerContainer",(async()=>await Promise.all([n.e(62743),n.e(59475),n.e(65670)]).then(n.bind(n,864302)))),SitesDomainsSection:new s.Ss("SitesDomainsSection",(async()=>await Promise.all([n.e(62743),n.e(44832),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(12867),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(95203),n.e(65496),n.e(55649),n.e(20594),n.e(64752),n.e(36760),n.e(40226)]).then(n.bind(n,942575)))),UpdateSidebarTabInfo:new s.Ss("UpdateSidebarTabInfo",(async()=>await Promise.all([n.e(62743),n.e(44832),n.e(97372),n.e(67180),n.e(38637),n.e(24115),n.e(12867),n.e(21847),n.e(60895)]).then(n.bind(n,671049)))),PropertyModulePersonProperty:new s.Ss("PropertyModulePersonProperty",(async()=>await Promise.all([n.e(62743),n.e(44832),n.e(16732),n.e(67180),n.e(83264),n.e(24252),n.e(87266),n.e(72001)]).then(n.bind(n,971086)))),FilePropertyModule:new s.Ss("FilePropertyModule",(async()=>await Promise.all([n.e(62743),n.e(44832),n.e(80841)]).then(n.bind(n,97310)))),JiraSyncModals:new s.Ss("JiraSyncModals",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,974584)))),PageLayoutEditor:new s.Ss("PageLayoutEditor",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,414353)))),topbarSidebarButton:new s.Ss("topbarSidebarButton",(async()=>await n.e(37206).then(n.bind(n,444332)))),NewDomainModal:new s.Ss("NewDomainModal",(async()=>await Promise.all([n.e(62743),n.e(17100),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(20594),n.e(64752),n.e(36760),n.e(59002)]).then(n.bind(n,95312)))),OutlinerDropdownMenuButton:new s.Ss("OutlinerDropdownMenuButton",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(84885),n.e(90424),n.e(7312),n.e(69343),n.e(46293),n.e(37706),n.e(59216),n.e(26056),n.e(11846),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(97372),n.e(4617),n.e(67180),n.e(38637),n.e(63327),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(88833),n.e(98530),n.e(12486),n.e(60317),n.e(83264),n.e(95203),n.e(55649),n.e(15362),n.e(21847),n.e(30874),n.e(22291),n.e(62069),n.e(17444),n.e(7515),n.e(68452),n.e(31658),n.e(84727),n.e(86621),n.e(94539),n.e(67899),n.e(81726),n.e(32833),n.e(20594),n.e(28971),n.e(24252),n.e(50526),n.e(4226),n.e(87266),n.e(80672),n.e(23212),n.e(53628),n.e(12273),n.e(92557),n.e(91377),n.e(25676),n.e(87683),n.e(32759),n.e(42308),n.e(86993),n.e(62985),n.e(96582),n.e(35691),n.e(5947),n.e(58586)]).then(n.bind(n,697976)))),SiteSettingsLayoutEditor:new s.Ss("SiteSettingsLayoutEditor",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(44832),n.e(39938),n.e(5242),n.e(31189),n.e(40017),n.e(97372),n.e(67180),n.e(38637),n.e(24115),n.e(99417),n.e(84654),n.e(12867),n.e(58075),n.e(98530),n.e(65496),n.e(21847),n.e(22291),n.e(84727),n.e(16809),n.e(46483),n.e(13449),n.e(72510)]).then(n.bind(n,786985)))),AssistantBasicStandalone:new s.Ss("AssistantBasicStandalone",(async()=>await Promise.all([n.e(62743),n.e(52774),n.e(3928)]).then(n.bind(n,98156))))},c=(0,s.kF)(l.ActivityUpdate,(e=>e.default)),d=(0,s.kF)(l.ActivityNotification,(e=>e.default)),u=((0,s.kF)(l.WorkspaceSettingsConsole,(e=>e.WorkspaceSettingsConsole)),(0,s.kF)(l.FloatingTableOfContents,(e=>e.FloatingTableOfContents))),p=(0,s.kF)(l.OrganizationSettingsConsole,(e=>e.OrganizationSettingsConsole)),m=(0,s.kF)(l.Invoice,(e=>e.default)),g=(0,s.kF)(l.AppComponents,(e=>e.default)),f=(0,s.kF)(l.AiAssistantIntroModal,(e=>e.AiAssistantIntroModal)),h=(0,s.kF)(l.NotionCalendarLaunchModal,(e=>e.default)),v=(0,s.kF)(l.ChartsLaunchModal,(e=>e.default)),y=(0,s.kF)(l.DummyModal,(e=>e.default)),b=(0,s.kF)(l.SpaceSettings,(e=>e.default)),_=(0,s.kF)(l.AddonUpgradeModal,(e=>e.default)),S=((0,s.kF)(l.SidebarConnectionsModal,(e=>e.default)),(0,s.kF)(l.TransferWorkspaceModal,(e=>e.TransferWorkspaceModal))),k=(0,s.kF)(l.AdminReactJson,(e=>e.default)),w=(0,s.kF)(l.SpaceSubscriptionUpdateModal,(e=>e.default)),x=(0,s.kF)(l.ConfirmPrivilegedActionModal,(e=>e.default)),I=(0,s.kF)(l.menus,(e=>e.CustomizePageMenuRenderer)),C=(0,s.kF)(l.menus,(e=>e.TopbarPageAnalyticsOptOutMenu)),T=(0,s.kF)(l.menus,(e=>e.PageTemplateModal)),M=(0,s.kF)(l.menus,(e=>e.TemplateGalleryModal)),P=(0,s.kF)(l.menus,(e=>e.ImportModal)),A=(0,s.kF)(l.menus,(e=>e.ExportModal)),R=(0,s.kF)(l.menus,(e=>e.ReportPageModal)),D=(0,s.kF)(l.menus,(e=>e.GoogleAuthPromptModal)),B=(0,s.kF)(l.AppTemplates,(e=>e.AppInitializationOverlay)),E=(0,s.kF)(l.AppTemplates,(e=>e.TemplatePickerTemplateList)),F=(0,s.kF)(l.AppTemplates,(e=>e.ExperimentalHorizontalTemplatePicker)),Z=(0,s.kF)(l.menus,(e=>e.StudentNotEligibleModal)),U=(0,s.kF)(l.BannersRenderer,(e=>e.default)),V=(0,s.kF)(l.menus,(e=>e.CookieModal)),N=(0,s.kF)(l.PagePropertiesRowNameMenu,(e=>e.default)),O=(0,s.kF)(l.SearchModal,(e=>e.default)),L=(0,s.kF)(l.Onboarding,(e=>e.default)),j=(0,s.kF)(l.menus,(e=>e.BlockMenu)),K=(0,s.kF)(l.menus,(e=>e.ForkPagePopup)),z=((0,s.kF)(l.menus,(e=>e.DatePropertyMenu)),(0,s.kF)(l.shareMenuContainer,(e=>e.default))),q=((0,s.kF)(l.UpdatesPopup,(e=>e.default)),(0,s.kF)(l.topbarMoreMenu,(e=>e.TopbarMoreMenu))),H=(0,s.kF)(l.topbarMoreButton,(e=>e.default)),G=(0,s.kF)(l.topbarShareButton,(e=>e.default)),W=(0,s.kF)(l.topbarStopSuggestModeButton,(e=>e.default)),$=(0,s.kF)(l.publicTopbarMoreMenu,(e=>e.default)),Y=(0,s.kF)(l.OutlinerDropdownMenuButton,(e=>e.OutlinerDropdownMenuButton)),Q=(0,s.kF)(l.teamPermissionsInvite,(e=>e.default)),J=(0,s.kF)(l.permissionsInviteWithModal,(e=>e.default)),X=(0,s.kF)(l.teamPermissionsInviteWithModal,(e=>e.default)),ee=(0,s.kF)(l.menus,(e=>e.CollectionTypedDatabaseMigrationModal)),te=(0,s.kF)(l.mobile,(e=>e.TopLevelMobileComponents)),ne=(0,s.kF)(l.mobile,(e=>e.MobileNativeFullPageComponents)),oe=(0,s.iS)(l.mobile,(e=>e.MobileModal)),re=(0,s.kF)(l.mobile,(e=>e.MobileCalendarDayMenu)),ie=(0,s.kF)(l.mobile,(e=>e.TopbarMobile)),ae=(0,s.kF)(l.mobile,(e=>e.MobileActionBar)),se=(0,s.kF)(l.mobile,(e=>e.MobileActionBarWrapper)),le=(0,s.kF)(l.mobile,(e=>e.NativeMobileActionBar)),ce=(0,s.kF)(l.mobile,(e=>e.MobileBottomBar)),de=(0,s.kF)(l.payments,(e=>e.CheckoutUpgradeModal)),ue=(0,s.kF)(l.payments,(e=>e.ClaimAndUpgradeModal)),pe=(0,s.kF)(l.integrations,(e=>e.DeveloperIntegrationsList)),me=(0,s.kF)(l.integrations,(e=>e.DeveloperIntegrationViewV2)),ge=(0,s.kF)(l.integrations,(e=>e.DeveloperIntegrationCreateV2)),fe=(0,s.kF)(l.integrations,(e=>e.DeveloperIntegrationLab)),he=(0,s.kF)(l.menus,(e=>e.SidebarCreateTeamModal)),ve=(0,s.kF)(l.menus,(e=>e.SidebarTeamModal)),ye=(0,s.kF)(l.reactDayPicker,(e=>e.default)),be=(0,s.kF)(l.menus,(e=>e.CreateTeamFromPageConfirmModal)),_e=(0,s.iS)(l.recurrence,(e=>e.RecurrenceConfigMenu)),Se=(0,s.kF)(l.TimeSeries,(e=>e.TimeSeries)),ke=(0,s.kF)(l.AxisChart,(e=>e.default)),we=(0,s.kF)(l.DonutChart,(e=>e.default)),xe=(0,s.kF)(l.MessageStoreDebugPanel,(e=>e.MessageStoreDebugPanel)),Ie=((0,s.kF)(l.CrdtDebuggingOverlay,(e=>e.CrdtDebuggingOverlay)),(0,s.kF)(l.ExternalObjectInstanceBlockMenu,(e=>e.default))),Ce=(0,s.kF)(l.HelpButtonContent,(e=>e.default)),Te=((0,s.kF)(l.AboutNotionDevelopersModal,(e=>e.default)),(0,s.kF)(l.menus,(e=>e.OpenInDesktopAppPopup))),Me=(0,s.kF)(l.thirdPartyScripts,(e=>e.InjectThirdPartyScripts)),Pe=(0,s.kF)(l.ConfirmOverwriteModal,(e=>e.ConfirmOverwriteModal)),Ae=(0,s.kF)(l.GuestUpsellModal,(e=>e.GuestUpsellModal)),Re=(0,s.kF)(l.ConfigureIntegrationModal,(e=>e.ConfigureIntegrationModal)),De=(0,s.kF)(l.ConnectOAuthIntegrationModal,(e=>e.ConnectOAuthIntegrationModal)),Be=(0,s.kF)(l.FeatureIntroPopup,(e=>e.FeatureIntroPopup)),Ee=(0,s.kF)(l.Tldraw,(e=>e.TldrawAdapter)),Fe=(0,s.iS)(l.NewPageInMenu,(e=>e.default)),Ze=(0,s.kF)(l.PageError,(e=>e.default)),Ue=(0,s.kF)(l.BlankPage,(e=>e.default)),Ve=(0,s.kF)(l.desktop,(e=>e.ElectronContextMenu)),Ne=(0,s.kF)(l.login,(e=>e.LoginPage)),Oe=((0,s.kF)(l.login,(e=>e.LoginDesktop)),(0,s.kF)(l.login,(e=>e.LoginMobileNative)),(0,s.kF)(l.login,(e=>e.FrontLoginPage))),Le=(0,s.kF)(l.login,(e=>e.LoginModalContent)),je=((0,s.kF)(l.marketplacePaymentPage,(e=>e.MarketplacePaymentPage)),(0,s.kF)(l.aliasBlockPopupMenu,(e=>e.default)),(0,s.kF)(l.CollectionItemCover,(e=>e.CollectionItemCover))),Ke=(0,s.kF)(l.FormBlock,(e=>e.default)),ze=(0,s.kF)(l.CollectionFormEditorView,(e=>e.default)),qe=(0,s.kF)(l.CollectionChartView,(e=>e.default)),He=(0,s.kF)(l.TimelineItemDateRange,(e=>e.default)),Ge=(0,s.kF)(l.CollectionTasksEmptyStateModal,(e=>e.default)),We=(0,s.kF)(l.teamspaceMenus,(e=>e.TeamBreadcrumbPopup)),$e=(0,s.kF)(l.teamspaceMenus,(e=>e.OutlinerTeamOverflow)),Ye=(0,s.kF)(l.outlinerViewAll,(e=>e.OutlinerViewAllButton)),Qe=(0,s.kF)(l.outlinerViewAll,(e=>e.OutlinerViewAllPopup)),Je=(0,s.kF)(l.teamspaceMenus,(e=>e.TeamOverflowMenu)),Xe=(0,s.kF)(l.PropertyModulePersonProperty,(e=>e.PersonPropertyModule)),et=(0,s.kF)(l.FilePropertyModule,(e=>e.FilePropertyModule)),tt=(0,s.kF)(l.RelationPropertyCustomizeLayoutMenu,(e=>e.RelationPropertyCustomizeLayoutMenu)),nt=(0,s.kF)(l.RelationPropertyMenu,(e=>e.RelationPropertyMenu)),ot=(0,s.kF)(l.RelationMenuRow,(e=>e.RelationMenuRow)),rt=(0,s.kF)(l.SecondarySidebar,(e=>e.SecondarySidebar)),it=(0,s.kF)(l.WikiPromoPopup,(e=>e.WikiPromoPopup)),at=(0,s.kF)(l.AIAddOnDiscountPopup,(e=>e.AIAddOnDiscountPopup)),st=(0,s.kF)(l.TimedTrialPopup,(e=>e.TimedTrialPopup)),lt=(0,s.kF)(l.SubscriptionDebugCommands,(e=>e.SubscriptionDebugCommands)),ct=(0,s.kF)(l.ForkPageModalWrapper,(e=>e.default)),dt=(0,s.kF)(l.SlackImportsInviteWithModal,(e=>e.default)),ut=(0,s.kF)(l.SitesSettingsTab,(e=>e.default)),pt=(0,s.kF)(l.ScrollableSitesBannerContainer,(e=>e.default)),mt=(0,s.kF)(l.SitesDomainsSection,(e=>e.default)),gt=(0,s.kF)(l.UpdateSidebarTabInfo,(e=>e.UpdateSidebarTabInfo)),ft=(0,s.kF)(l.menus,(e=>e.ImportIntoNewPageModal)),ht=(0,s.kF)(l.JiraSyncModals,(e=>e.default)),vt=(0,s.kF)(l.PageLayoutEditor,(e=>e.PageLayoutEditor)),yt=(0,s.kF)(l.topbarSidebarButton,(e=>e.TopbarSidebarButton)),bt=(0,s.kF)(l.NewDomainModal,(e=>e.default)),_t=(0,s.kF)(l.SiteSettingsLayoutEditor,(e=>e.SiteSettingsLayoutEditor)),St=(0,s.kF)(l.GenerateSocialMediaPreviewImageWrapper,(e=>e.default)),kt=(0,s.kF)(l.CollapsiblePropertyGroupsModule,(e=>e.CollapsiblePropertyGroupsModule)),wt=(0,s.kF)(l.AssistantBasicStandalone,(e=>e.AssistantBasicStandalone))},595645:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(883355),r=n(531701),i=n(607709),a=n(367669),s=n(165598),l=n(58202),c=n(599757);class d extends o.Z{constructor(){super(...arguments),this.renderedType="block",this.getBlockStore=()=>this.props.store,this.canEditComputedStore=this.createComputedStore((()=>{if(this.props.disabled)return!1;if(c.n.state)return!1;const e=this.pageContext&&this.pageContext.publicEditModeStore.state;return!(0,a.YF)(e)&&this.props.store.canEdit()})),this.marginCommentsVisibleStore=this.createComputedStore((()=>(0,i.fg)(this.environment,this.props.store)))}get registries(){return[l.R]}canEdit(){return this.canEditComputedStore.state}canEditCollection(){if(this.props.disabled)return!1;if(c.n.state)return!1;const e=this.pageContext&&this.pageContext.publicEditModeStore.state;return!(0,a.YF)(e)&&this.props.store.canEditCollection()}canComment(){return!this.props.disabled&&(!c.n.state&&this.props.store.canComment())}canAdmin(){return!this.props.disabled&&(!c.n.state&&this.props.store.canAdmin())}canView(){const{store:e}=this.props;return e.canRead()}isRootOrDirectChild(){return this.props.store.isRootOrDirectChild()}renderComponent(){const{store:e}=this.props;if(e)return e?(0,s.SJ)(e)?void 0:this.renderPersisted():void 0}renderPersisted(){}getBlockColorStyle(){const e=this.props.store.getFormat().block_color||"default";return(0,r.fi)(e,this.theme)}}d.displayName="Block";const u=d},724098:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(886628),r=n(426344);function i(e){let{capture:t,render:n}=e;const i=(0,r.Z)(t);return(0,o.VK)((()=>n(i)),[i,n])}},155856:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(330117);function r(e){let{children:t,...n}=e;return(0,o.Z)(n),t}},499768:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(886628),r=n(635622);function i(e){let{capture:t,render:n}=e;const i=(0,r.Z)(t);return(0,o.VK)((()=>n(i)),[i,n])}},213542:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(883355),r=n(653965),i=n(85844),a=n(672087);class s extends o.Z{constructor(){super(...arguments),this.debounce=void 0,this.throttle=void 0,this.interval=void 0,this.browserInterval=void 0,this.requestCounter=0,this.storeTypes={requestStore:a.Z},this.handlePageVisibilityChange=()=>{i.Z.state.isVisible?this.interval||this.setRequestInterval():this.clearRequestInterval()},this.performRequest=async()=>{const{requestStore:e}=this.stores,{performRequest:t}=this.props,{request:n}=e.state;this.requestCounter++;const o=this.requestCounter;this.stores.requestStore.setState({...this.stores.requestStore.state,ready:!1,loading:!0}),await t(n).then((t=>{this.requestCounter===o&&e.setState({...e.state,error:void 0,result:t,ready:!0,loading:!1})})).catch((t=>{console.error(t),this.requestCounter===o&&e.setState({...e.state,error:t,result:void 0,ready:!0,loading:!1})}))},this.performRequestDebouncedWrapped=()=>{this.stores.requestStore.setState({...this.stores.requestStore.state,ready:!1,loading:!0}),this.performRequestDebounced()},this.performRequestDebounced=this.performRequest}async fetch(){return this.performRequest()}UNSAFE_willMount(e){super.UNSAFE_willMount(e),i.Z.addListener(this.handlePageVisibilityChange)}UNSAFE_willMountOrUpdate(e){super.UNSAFE_willMountOrUpdate(e);const{requestStore:t}=this.stores,{request:n,debounce:o,throttle:i,interval:a}=e;o!==this.debounce&&(this.debounce=o,this.performRequestDebounced=o?r.Ds(this.performRequest,o):this.performRequest),i!==this.throttle&&(this.throttle=i,this.performRequestDebounced=i?r.P2(this.performRequest,i):this.performRequest),a!==this.interval&&(this.interval=a,this.clearRequestInterval(),this.setRequestInterval()),r.Xy(n,t.state.request)||(t.setState({...t.state,request:n}),0!==this.requestCounter||e.performFirstRequestAsync?this.performRequestDebouncedWrapped():this.performRequest()),t.refresh=this.performRequest}willUnmount(){super.willUnmount(),i.Z.removeListener(this.handlePageVisibilityChange),this.clearRequestInterval()}shouldComponentUpdate(e){return!0}renderComponent(){const{requestStore:e}=this.stores,{render:t}=this.props,{error:n,result:o,ready:r}=e.state;return this.handlePageVisibilityChange(),t(n,o,r)}clearRequestInterval(){this.browserInterval&&(clearInterval(this.browserInterval),this.browserInterval=null)}setRequestInterval(){this.props.interval&&(this.browserInterval=setInterval(this.performRequest,this.props.interval))}}s.displayName="Request";const l=s},128651:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{mouseEntered:!1,mousePressed:!1}}enter(){this.setState({...this.state,mouseEntered:!0})}exit(){this.setState({...this.state,mouseEntered:!1})}}const i=r},17277:(e,t,n)=>{n.d(t,{LB:()=>o,Zh:()=>r,gg:()=>i,oB:()=>a});const o=n(471924).Il(),r="denied",i="no_devices",a="unknown_error"},68688:(e,t,n)=>{n.d(t,{d:()=>i});var o=n(80444),r=n(385555);function i(){const{currentSpaceStore:e}=o.default.state;return Boolean(window.isSecureContext&&(null==e?void 0:e.canRead())&&e.isAiEnabledOnSpace()&&"on"===r.default.getEligibleGroup({experimentId:"dictation_experiment_v2",defaultGroup:"control"}))}},461953:(e,t,n)=>{n.r(t),n.d(t,{useIsDictatingToPage:()=>i});var o=n(886628),r=n(922705);function i(e){return(0,o.VK)((()=>r.TI.state&&(null==e?void 0:e.id)===r.mn.state),[e])}},107401:(e,t,n)=>{n.d(t,{AZ:()=>s,at:()=>a,ew:()=>d,vo:()=>c,wI:()=>l});var o=n(296994),r=n(277907);const i=o.FF.dictation,a=(0,r.kF)(i,(e=>e.StopDictationButton)),s=(0,r.kF)(i,(e=>e.StopDictationListener)),l=(0,r.kF)(i,(e=>e.StopDictationButtonMobile)),c=(0,r.kF)(i,(e=>e.DictationBubble)),d=(0,r.kF)(i,(e=>e.DictationAvatar))},922705:(e,t,n)=>{n.d(t,{CX:()=>u,P7:()=>p,QH:()=>c,TI:()=>l,ZP:()=>h,dg:()=>f,ht:()=>g,mn:()=>d,w7:()=>m});var o=n(59391),r=n(14577),i=n(749085);class a extends i.default{getInitialState(){return{audioRecorder:void 0,audioSessionBlockWriters:new Map,pageBlock:void 0,block:void 0,enabled:!1,talking:!1,environment:void 0,transcribedTexts:[],blockRenderedInPage:!1,blockRenderedInPeekView:!1,loading:!1,isDictationBubbleOnScreen:!1,dictationBubbleScrollPosition:void 0,dictationBubbleRelativeToScreen:void 0}}}const s=new a,l=(new r.ZP((()=>s.state.loading),{debugName:"DictationLoadingStore"}),new r.ZP((()=>s.state.enabled),{debugName:"DictationEnabledStore"})),c=new r.ZP((()=>s.state.pageBlock),{debugName:"DictationPageBlock"}),d=new r.ZP((()=>{var e;return null===(e=s.state.pageBlock)||void 0===e?void 0:e.id}),{debugName:"DictationPageBlockIdStore"}),u=new r.ZP((()=>{var e;return null===(e=s.state.block)||void 0===e?void 0:e.id}),{debugName:"DictationBlockIdStore"}),p=new r.ZP((()=>s.state.block),{debugName:"DictationBlockStore"}),m=new r.ZP((()=>s.state.blockRenderedInPage||s.state.blockRenderedInPeekView),{debugName:"DictationBlockVisibleStore"}),g=new r.ZP((()=>s.state.blockRenderedInPage),{debugName:"DictationBlockInPageStore"}),f=(new r.ZP((()=>s.state.talking),{debugName:"IsTalkingStore"}),new r.ZP((()=>s.state.blockRenderedInPeekView),{debugName:"DictationBlockInPeekViewStore"}),new r.ZP((()=>!s.state.blockRenderedInPeekView&&"inScreen"!==s.state.dictationBubbleRelativeToScreen),{debugName:"showScrollToFaceButtonStore"}),new r.ZP((()=>s.state.dictationBubbleRelativeToScreen),{debugName:"DictationBubbleRelativeToScreenStore"}),new r.ZP((()=>s.state.audioSessionBlockWriters.size>0),{debugName:"IsInferencingStore"})),h=((0,o.Z)(),s)},444388:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n(749085).default.createValue(!1)},711059:(e,t,n)=>{n.d(t,{Z:()=>p});n(667294);var o=n(800480),r=n(886628),i=n(122377),a=n(415095),s=n(442918),l=n(922145),c=n(360682),d=n(924990),u=n(785893);const p=function(e){let{char:t,size:n,sprite:p}=e;const m=(0,o.O7)(),g=(0,r.VK)((()=>p||(0,c.e_)(m)),[m,p]),f=(0,r.VK)((()=>d.Z.state),[]),h=a.xo.isCustomEmojiString(t),v=(0,r.VK)((()=>{if(h){const e=a.xo.fromCustomEmojiString(t),n=(0,l.Jy)();return null==n?void 0:n.getRecordStore(n,e.pointer)}}),[t,h]);return h?v?(0,u.jsx)(s.Z,{emojiStore:v,size:n??"1em"}):null:(0,u.jsx)(i.Z,{char:t,size:n,type:g,emojiData:f})}},938530:(e,t,n)=>{n.d(t,{$P:()=>b,FZ:()=>f,II:()=>a,IQ:()=>o,Nm:()=>i,PS:()=>g,T8:()=>l,VJ:()=>y,WB:()=>c,d8:()=>m,fG:()=>v,jo:()=>u,kX:()=>p,mz:()=>d,pq:()=>s,qJ:()=>_,tg:()=>r,vP:()=>h});const o=12,r=9,i=2,a=12,s=16,l=32,c=24,d=44,u=32,p=356,m=390,g=12,f=l*o+2*g,h=9,v=f,y=270,b=10,_=2},360682:(e,t,n)=>{n.d(t,{e_:()=>a,kw:()=>s,sg:()=>l});var o=n(800480),r=n(886628),i=n(80444);function a(e){const{device:t}=e;return t.isAndroid&&t.browserVersion.startsWith("73.")&&t.browserName.startsWith("Chrome")||t.isAndroid?"google":t.isWindows||t.isLinux?"twitter":"raw"}function s(){const e=(0,o.O7)();return(0,r.VK)((()=>a(e)),[e])}function l(){var e;return null===(e=i.default.state)||void 0===e||null===(e=e.currentUserSettingsStore)||void 0===e||null===(e=e.getSettings())||void 0===e?void 0:e.emoji_picker_skin_tone}},924990:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(438563);class i extends o.default{getInitialState(){return{positionalEmojiData:{},emojiByName:{},emojiByCategory:{},emojiByColorRaw:{},emojiByColorProcessed:{}}}async waitUntilLoaded(){await(0,r.M)()}}const a=new i},269783:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},476795:(e,t,n)=>{n.d(t,{JI:()=>_,Ki:()=>b,QQ:()=>y});n(21703);var o=n(815145),r=n(366004),i=n(937850),a=n(940470),s=n(981193),l=n(547307),c=n(403297),d=n(792625),u=n(275754),p=n(29974),m=n(783105),g=n(433929),f=n(80444),h=n(385555),v=n(930106);async function y(e){const{spaceViewStore:t}=e;await p.y3({...e,userSettingsStore:f.default.state.currentUserSettingsStore,userRootStore:f.default.state.currentUserRootStore,pageVisitSource:o.tY.DuplicateTemplateSwitchSpace,navigationType:"switchingToOrLoadingSpace"}),v.Z.setState({...v.Z.state,spaceStore:t.getSpaceStore(),spaceViewStore:t,teamStore:void 0})}async function b(e){const{open:t,blockStore:n,teamStore:o,spaceStore:r,spaceViewStore:i}=v.Z.state;if(t&&n&&r&&i)return _({environment:e,blockStore:n,spaceStore:r,spaceViewStore:i,teamStore:o})}async function _(e){const{environment:t,blockStore:n,spaceStore:y,spaceViewStore:b,teamStore:_,hideModal:S=!1,disableRedirect:k=!1,from:w,templateId:x}=e,I=Date.now();let C=!1;const T=v.Z.state.isFromTemplateGallery||"inApp"===w;S||c.yR({store:n,spaceStore:y});try{await Promise.all([p.y3({environment:t,spaceViewStore:b,userSettingsStore:f.default.state.currentUserSettingsStore,userRootStore:f.default.state.currentUserRootStore,pageVisitSource:o.tY.DuplicateTemplateSwitchSpace,navigationType:"switchingToOrLoadingSpace"}),(0,i.Vs)(0).then((()=>{v.Z.setState({...v.Z.state,open:!1})}))]);const e=h.default.checkGate({gateName:"enable_template_installation_imprinting"})&&T?{id:t.idCreator.idInMain(r.m),table:r.m}:void 0,s={duplicateOnlyCollectionSchema:!1,addCopyName:!1,appendWithoutAfter:!0,unlockPage:!0,event:void 0,installationImprint:e},l=await c.fD({environment:t,store:n,newParentStore:_||y,...s});if(!l||a.x.isFail(l))throw new Error("Failed to duplicate template");const d=a.x.unwrap(l);if(null==d||!d.length)throw new Error("Failed to duplicate template");return C=!0,k||u._c({environment:t,store:d[0],visitType:m.vu.Link,pageVisitSource:o.tY.Duplicate}),T&&await c.Qk({environment:t,blockId:n.id,spaceId:y.id,templateId:x,installationId:null==e?void 0:e.id}),d[0]}catch(M){const e=g.default.getIntl();l.showErrorMessage(e.formatMessage({id:"forkPageModalActions.duplicateToHelper.failed",defaultMessage:"Template duplication failed"}))}finally{const e=Date.now()-I;s.Xy(t,{from:w??"publicPage",success:C,template_block_id:n.id,target_space_id:y.id,context:"public_page_duplicate_multiple_workspace",template_duplication_duration_ms:e,template_duplication_duration_with_minimum_ms:e}),d.x()}}},930106:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},121830:(e,t,n)=>{n.d(t,{XH:()=>b,pz:()=>h,qv:()=>f,vZ:()=>p,zp:()=>g});n(21703);var o=n(337599),r=n(292595),i=n(568626),a=n(709291),s=n(657347),l=n(552629),c=n(937850),d=n(619584),u=n(433929);const p="NotionTransactionTimeout",m=(0,a.defineMessages)({ReloadAllTabs:{defaultMessage:"Try closing and re-opening all Notion tabs or windows. Contact support if that doesn’t fix the issue.",id:"localDatabase.errorFixes.reloadAllTabs"},ReloadThisTab:{defaultMessage:"Try reloading Notion. Contact support if that doesn’t fix the issue.",id:"localDatabase.errorFixes.reloadThisTab"},AppProfileCorrupted:{defaultMessage:"Notion's local storage may be damaged. See (?) > Help & documentation > Reset Notion. Contact support if that doesn’t fix the issue.",id:"localDatabase.errorFixes.helpAndSupportPrompt"},FirefoxProfileCorrupted:{defaultMessage:"Your Firefox profile may be damaged. Visit https://firefox-storage-test.glitch.me/ to diagnose. Contact support if that doesn’t fix the issue.",id:"localDatabase.errorFixes.firefoxSettingsDamaged"},ChromeProfileCorrupted:{defaultMessage:"Your Chrome profile may be damaged. If you changed any chrome://flags then please reset them, then restart your browser. If issues persist, try making a new Chrome user. Contact support if that doesn’t fix the issue.",id:"localDatabase.errorFixes.chromeSettingsDamaged"},ChromeIndexedDBBucketError:{defaultMessage:"Your Chrome profile may be damaged. For a more consistent experience download the Notion desktop app: https://notion.so/desktop",id:"localDatabase.errorFixes.chromeUpgradeCorruptedSettings"},noDiskSpace:{defaultMessage:"No disk space remaining. Contact support if that doesn’t fix the issue.",id:"localDatabase.erroMessages.noDiskSpaceRemaining"},noDiskSpaceBrowserLimit:{defaultMessage:"No disk space remaining. Your browser settings may restrict the storage Notion can use. Contact support if that doesn’t fix the issue.",id:"localDatabase.erroMessages.noDiskSpaceRemainingBrowserLimit"}});function g(e){return e}function f(e){return Promise.all(e)}class h{constructor(e,t,n,o){this.databaseName=void 0,this.databaseVersion=void 0,this.debugLogger=new i.BatchedLogger({from:"IndexedDBWrapper",type:"BulkDebug",level:"info",maxLength:100,logToConsole:false}),this.latestTransactionId=0,this.openDbCallbacks=void 0,this.db=void 0,this.getDBPromise=void 0,this.environment=e,this.databaseName=t,this.databaseVersion=n,this.openDbCallbacks=o}async reset(){try{return await(0,o.Lj)(this.databaseName),{value:void 0}}catch(e){return{error:v({environment:this.environment,error:(0,s.t)(e),details:`Failed to reset database ${this.databaseName}`,closed:!1,aborted:!1})}}finally{this.teardown()}}async startTransaction(e,t){const n="startTransaction";let o,r=0;const i=`${e.name}.${this.latestTransactionId++}`;do{try{const s=`${i} attempt #${r+1}`;if(this.debugLogInfo(n,`${s} starting`),o=await this.startTransactionAttempt({...e,name:i},t),!o.error){this.debugLogInfo(n,`${s} succeeded`);break}const l=`${s} errored, type=${o.error.type}`;if(!o.error.closed){this.debugLogInfo(n,`${l}, closed=false`);break}if(this.debugLogInfo(n,`${l}, closed=true`),this.db)try{this.db.close()}catch(a){this.debugLogInfo(n,`db.close() threw ${a}`)}if(this.teardown(),4===r)break;await c.Vs(250)}catch(a){return{error:a}}r++}while(r<5);return o}async startTransactionAttempt(e,t){const{storeNames:n,name:o,mode:r,timeoutMs:a}=e,c=`${o} failed`,d="startTransactionAttempt",u=await this.getDB();if(u.error)return u;const p=u.value,m=[];let g;try{g=p.transaction(n,r);const e=Date.now(),t=window.setTimeout((()=>{const t=Date.now()-e,n=`${o} has not completed after ${t} ms, which may prevent other transactions from running.`;this.debugLogInfo(d,n),i.log({from:"IndexedDBWrapper",type:"LongRunningTransactionWarning",level:"warning",data:{message:n,miscDataToConvertToString:{transactionLog:m}}})}),h.longRunningTimeoutMs);g.addEventListener("complete",(function(){window.clearTimeout(t)}));const a=e=>{e.stopPropagation(),window.clearTimeout(t)};g.addEventListener("error",a),g.addEventListener("abort",a)}catch(y){const e=(0,s.t)(y);return{error:v({environment:this.environment,details:`Failed to create ${r} transaction on ${this.databaseName}.${n}`,error:e,aborted:!0,closed:"InvalidStateError"===e.name})}}const f=await this.runTransaction(g,t,o,a,(e=>{i.pushWithMaxLength(m,e,100)}));if("error"in f||f.abort){this.debugLogInfo(d,`${o} command returned failed/aborted status`);try{g.abort()}catch(b){this.debugLogInfo(d,`transaction.abort() threw ${b}`)}return g.done.catch((e=>{e&&i.log({from:"IndexedDBWrapper",type:"TransactionFailure",level:"error",error:(0,l.Ui)(v({environment:this.environment,details:c,error:e,aborted:!0,closed:!1}))})})),f}if(this.debugLogInfo(d,`${o} command returned successful status`),"readwrite"===r)try{await g.done}catch(b){return{error:v({environment:this.environment,error:(0,s.t)(b),details:`In await transaction.done: ${c}`,aborted:null===b,closed:!1})}}else g.done.catch((e=>{i.log({from:"IndexedDBWrapper",type:"ReadOnlyTransactonFailureIgnored",level:"error",error:(0,l.Ui)(v({environment:this.environment,error:e,details:c,aborted:null===e,closed:!1}))})}));return{value:f.value}}freezeListener(){Boolean(this.db)&&(this.debugLogInfo("freezeListener"),i.log({level:"warning",from:"IndexedDBWrapper",type:"document.freeze",data:{dbName:this.databaseName,dbVersion:this.databaseVersion}}))}teardown(){this.debugLogInfo("teardown"),this.db=void 0,this.getDBPromise=void 0,document.removeEventListener("freeze",this.freezeListener)}debugLogInfo(e,t){this.debugLogger.log({from:"IndexedDBWrapper",level:"info",type:e,data:{message:t}})}async initDB(){try{this.debugLogInfo("initDB","Starting openDB()");const e=await(0,o.X3)(this.databaseName,this.databaseVersion,this.openDbCallbacks);return this.debugLogInfo("initDB","Completed openDB()"),document.addEventListener("freeze",this.freezeListener),e.addEventListener("close",(e=>{i.log({level:"warning",from:"IndexedDBWrapper",type:"db.onclose",data:{dbName:this.databaseName,dbVersion:this.databaseVersion},error:(0,l.Ui)(y(e))}),this.teardown()})),e.addEventListener("abort",(e=>{i.log({level:"warning",from:"IndexedDBWrapper",type:"db.onabort",data:{dbName:this.databaseName,dbVersion:this.databaseVersion}})})),e.addEventListener("error",(e=>{i.log({level:"error",from:"IndexedDBWrapper",type:"db.onerror",data:{dbName:this.databaseName,dbVersion:this.databaseVersion},error:(0,l.Ui)(y(e))})})),e.addEventListener("versionchange",(()=>{i.log({level:"warning",from:"IndexedDBWrapper",type:"db.onversionchange",data:{dbName:this.databaseName,dbVersion:this.databaseVersion}}),e.close(),this.teardown()})),{value:e}}catch(e){return{error:v({environment:this.environment,details:"Unable to initialize database",error:(0,s.t)(e),aborted:!1,closed:!1})}}}async getDB(){let e=this.db;if(!e){this.getDBPromise||(this.getDBPromise=this.initDB().then((e=>(e.error?this.teardown():(this.db=e.value,this.getDBPromise=void 0),e)),(e=>(this.teardown(),{error:{type:"InitDBException",message:"An unexpected error occurred trying to create the database.",details:"Exception in initDB",error:e,closed:!1,aborted:!1}}))));const t=await this.getDBPromise;if(t&&t.error)return t;e=t.value}return{value:e}}async runTransaction(e,t,n,o,r){try{const i=Date.now(),a=t(e,(e=>{this.debugLogInfo("runTransaction",`${n} command: ${e}`),r(e)}));if(void 0!==o&&o>=0){const e=await c.aM(a,o);if(e.timeout){const e=Date.now()-i,t=new Error(`Timeout after ${e}ms: exceeded limit ${o}ms by ${e-o}ms`);throw t.name=p,this.debugLogInfo("runTransaction",`${n} ${t.name}: ${t.message}`),this.debugLogger.flush(),t}return e.result}r("Awaiting commandResultPromise.");const s=await a;return r("Done awaiting commandResultPromise."),s}catch(i){return{error:v({environment:this.environment,error:(0,s.t)(i),details:`In runTransaction catch: ${n} failed`,closed:!1,aborted:!1})}}}}function v(e){const{environment:t,error:n,details:o,closed:r,aborted:i}=e;if(n){if(n.name===p)return{type:p,details:o,message:`Storage operation did not complete. ${u.default.formatMessage(m.ReloadAllTabs)}`,error:n,closed:!1,aborted:!1};if("TimeoutError"===n.name&&"Transaction timed out due to inactivity."===n.message)return{type:"TransactionTimeout",details:o,message:`IndexedDB access attempt timed out. ${u.default.formatMessage(m.ReloadThisTab)}`,error:n,closed:r,aborted:i};if("VersionError"===n.name)return{type:"OutdatedSchemaVersion",details:o,message:`This tab is running an outdated version of Notion. ${u.default.formatMessage(m.ReloadThisTab)}`,error:n,closed:r,aborted:i};if("UnknownError"===n.name&&"Internal error opening backing store for indexedDB.open."===n.message)return{type:"ChromeUnknownInternalError",details:o,message:`Cannot open IndexedDB. ${t.device.isNative?u.default.formatMessage(m.AppProfileCorrupted):u.default.formatMessage(m.ChromeProfileCorrupted)}`,error:n,closed:r,aborted:i};if(t.device.isBrowser&&"UnknownError"===n.name&&"Internal error retrieving bucket data directory."===n.message)return{type:"ChromeUnknownInternalError",details:o,message:u.default.formatMessage(m.ChromeIndexedDBBucketError),error:n,closed:r,aborted:i};if("SecurityError"===n.name&&"IDBFactory.open() called in an invalid security context"===n.message)return{type:"SafariIframeSecurityError",details:o,message:"Cannot access IndexedDB in an iframe in your browser. Try opening Notion in a new window or use a different browser.",error:n,closed:r,aborted:i};if("UnknownError"===n.name&&"Connection to Indexed Database server lost. Refresh the page to try again"===n.message)return{type:"SafariIndexedDatabaseServerLost",details:o,message:`Cannot access IndexedDB due to a bug in Safari/WebKit. ${u.default.formatMessage(m.ReloadThisTab)}`,error:n,closed:r,aborted:i};if("InvalidStateError"===n.name&&"A mutation operation was attempted on a database that did not allow mutations."===n.message)return{type:"FirefoxPrivateBrowsing",details:o,message:"Firefox does not allow IndexedDB in Private Browsing. Try opening Notion in a normal window.",error:n,closed:r,aborted:i};if("NotFoundError"===n.name&&"The operation failed because the requested database object could not be found. For example, an object store did not exist but was being opened."===n.message)return{type:"FirefoxObjectStoreNotFound",details:o,message:`An IndexedDB object store does not exist. ${u.default.formatMessage(m.ReloadAllTabs)} ${u.default.formatMessage(m.FirefoxProfileCorrupted)}`,error:n,closed:!0,aborted:i};if("QuotaExceededError"===n.name){let e=u.default.formatMessage(m.noDiskSpace);return t.device.isBrowser&&(e=u.default.formatMessage(m.noDiskSpaceBrowserLimit)),{type:"QuotaFull",details:o,message:e,error:n,closed:r,aborted:i}}if(window.navigator.userAgent.includes("WindowsWechat")&&"AbortError"===n.name&&"Version change transaction was aborted in upgradeneeded event handler."===n.message)return{type:"UnsupportedWechat",details:o,message:"This device or application is unsupported.",error:n,closed:r,aborted:i}}return{type:"UnknownIndexedDBError",details:o,message:`An unknown IndexedDB error occurred. ${u.default.formatMessage(m.ReloadThisTab)}`,error:n||new Error("createIndexedDBError: error was falsy"),closed:r,aborted:i}}function y(e){if(e&&e.target&&"error"in e.target){const t=e.target.error;if(!t)return;return`${t.name}: ${t.message}`}}function b(e,t){if(e.stack)return e;try{const n=new Error(`${e.message} (${t})`);throw n.name=e.name,n}catch(n){return e.stack=(0,s.t)(n).stack,e}}h.longRunningTimeoutMs=5*d.hM,(0,r.exposeDebugValue)("idbUnwrap",o.Wg)},292283:(e,t,n)=>{n.d(t,{$s:()=>d,Eg:()=>l,K6:()=>a,dv:()=>s,pv:()=>c});var o=n(371663),r=n(399036),i=n(385555);function a(){return"on"===i.default.getEligibleGroup({experimentId:"jira_import_and_sync",defaultGroup:"control"})}function s(){return"on"===i.default.getEligibleGroup({experimentId:"jira_sync_data_center_integration",defaultGroup:"control"})}function l(){return i.default.checkGate({gateName:"disable_jira_sync_source_for_members"})}function c(){return i.default.checkGate({gateName:"jira_onboarding_tour"})}function d(e){let t=null,n=null;if(!e)return{projectCollectionPointer:t,taskCollectionPointer:n};const i=e.getFormat();if(i.app_config_uri===o.wW){t=e.pointer;const i=e.getSchema()[o.zI.ProjectToTaskRelation];i&&(0,r.p_)(i)&&i.collection_pointer&&(n=i.collection_pointer)}else if(i.app_config_uri===o.Ym){n=e.pointer;const i=e.getSchema()[o.Es.TaskToProjectRelation];i&&(0,r.p_)(i)&&i.collection_pointer&&(t=i.collection_pointer)}return{projectCollectionPointer:t,taskCollectionPointer:n}}},503932:(e,t,n)=>{n.d(t,{F:()=>l,Y:()=>c});n(757658);var o=n(516691),r=n(159730),i=n(471924),a=n(511799),s=n(145953);const l=[n(421202).iU];class c{constructor(e){this.id=i.Il(),this.spaceId=void 0,this.userId=void 0,this.committed=!1,this.isLocal=!1,this.useSudoMode=void 0,this.deadlockWarningTimeout=void 0,this.operations=[],this.stores=[],this.initialRecordMap=s.PF.create(),this.debugLogging=void 0,this.debugLog=[],this.invertedOperations=[],this.postPerformAssertions=[],this.preEnqueueActions=[],this.postEnqueueActions=[],this.postSubmitCallbacks=[],this.postCancelCallbacks=[],this.newlyCreatedStoresForPermissionInference=new a.Z({getKey:e=>(0,o.dn)(e)}),this.userAction=void 0,this.userFlow=void 0,this.tags=void 0,this.suggestionDiscussionStore=void 0;const{spaceId:t,userId:n,deadlockTimeoutMs:r,onDeadlockWarning:l,debugLogging:c}=e;t&&n&&(this.spaceId=t,this.userId=n),l&&(this.deadlockWarningTimeout=window.setTimeout(l,r)),this.debugLogging=c}getDebugLog(){return this.debugLog}logDebugMessage(e){var t,n;if(null!==(t=this.debugLogging)&&void 0!==t&&t.collect&&this.debugLog.push({operationsIndex:this.operations.length,message:e}),null!==(n=this.debugLogging)&&void 0!==n&&n.logToConsole){for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];console.log(e,...r)}}isEmpty(){return 0===this.operations.length}annotateWithUserAction(e){this.userAction=e}annotationWithSuggestionDiscussionStore(e){if(this.suggestionDiscussionStore)throw new r.p8("Already annotated with DiscussionStore");this.suggestionDiscussionStore=e}getSuggestionDiscussionStore(){return this.suggestionDiscussionStore}getUserActionForAnalyticsPurposesOnly(){return this.userAction}annotateWithUserFlow(e){this.userFlow=e}getUserFlowForAnalyticsPurposesOnly(){return this.userFlow}annotateWithDebugTag(e){this.tags||(this.tags=new Set),this.tags.add(e)}copyDebugTagsFrom(e){if(e.tags)for(const t of e.tags)this.annotateWithDebugTag(t)}getDebugTagsForAnalyticsPurposesOnly(){if(this.tags)return Array.from(this.tags)}cancelDeadlockWarning(){void 0!==this.deadlockWarningTimeout&&(window.clearTimeout(this.deadlockWarningTimeout),this.deadlockWarningTimeout=void 0)}done(e){this.cancelDeadlockWarning();for(const t of this.postSubmitCallbacks)t(e)}}},402414:(e,t,n)=>{n.d(t,{h:()=>r});var o=n(937850);class r{constructor(e){this.SCALE=1.5,this.MAX=15,this.waitable=new o.a6,this.failures=0,this.observer=e}getDelay(e){return Math.min(this.MAX,Math.pow(this.SCALE,e))}reset(){var e;this.waitable.trigger(),this.waitable=new o.a6,this.failures=0,null===(e=this.observer)||void 0===e||e.onReset()}async backOffOnFailure(e,t){var n;const r=this.failures;this.failures++;const i=e*this.getDelay(r)-e;null===(n=this.observer)||void 0===n||n.onBackoff(i,t),await this.waitable.wait(e,i),this.waitable=new o.a6}getFailures(){return this.failures}}},863037:(e,t,n)=>{n.d(t,{CE:()=>s,Os:()=>r,Ud:()=>i,V_:()=>a,xd:()=>l});var o=n(619584);function r(e,t){t.startsWith("offline -")?t="offline":t.startsWith("mobileNativeError -")&&(t="mobileNativeError");const n=e[t]||0;e[t]=n+1,e._total+=1}const i=1*o.C0,a=.5*o.C0,s=10*o.C0,l=5*o.C0},68204:(e,t,n)=>{n.d(t,{E$:()=>s,L1:()=>c,RP:()=>l,sG:()=>a,vG:()=>d});n(757658);var o=n(158573),r=n(653965);const i=25;function a(e){const{sections:t,context:n,query:a}=e;let s=a.trim().toLowerCase();if(s.startsWith("/")&&(s=s.slice(1)),!s)return c(t,n);const l=function(e){return e.map((e=>({...e,actions:e.actions.map((t=>{const n=t.searchName||t.displayName||"",o=[n,e.searchTitle||e.title||"",n].join(" ");return{...t,searchName:o}}))})))}(c(function(e,t){const n=[];for(const o of e){const e={...o,actions:[]};for(const r of o.actions)if(r.subActions){if(r.collapseSubActionsIntoParent){for(const n of r.subActions(t))for(const t of n.actions)e.actions.push(t);continue}const i=r.subActions(t).map((e=>({...e,key:`${o.key} ${r.key} ${e.key}`,title:e.title||r.displayName,searchTitle:[r.searchName||r.displayName,e.searchTitle||e.title].filter(Boolean).join(" ")})));for(const e of i)n.push(e)}else e.actions.push(r);e.actions.length&&n.push(e)}return n}(t,n),n)),d=[],u=new Map;for(const o of l)for(const e of o.actions)u.set(e,o),d.push(e);const p=(0,o.ZP)(s,d,(e=>e.searchName||""),{minThreshold:i,getSortScore:e=>-e.score*(e.original.sortScoreMultiplier??1)}),m=new Set(p),g=d.filter((e=>Boolean(e.alwaysShowInSearch)&&!m.has(e))),f=g.filter((e=>"start"===e.alwaysShowInSearch)),h=g.filter((e=>"end"===e.alwaysShowInSearch)),v=r.vM([...f,...p,...h],(e=>{const t=u.get(e);if(t)return t.title})),y=[];for(const o of Object.keys(v)){const e=v[o],t=u.get(e[0]);t&&y.push({...t,actions:e})}return y}function s(e,t){if(!t)return e;let n=0;const o=[];for(const r of e){if(n>=t)break;const e=r.actions.slice(0,t-n);e.length>0&&(n+=e.length,o.push({...r,actions:e}))}return o}function l(e,t){const n=[];for(const o of e){const e=o.actions.filter(t);e.length>0&&n.push({...o,actions:e})}return n}function c(e,t){return l(e,(e=>d(e,t)))}function d(e,t){if(e.validators){return e.validators.every((e=>e(t)))}return!0}},119037:(e,t,n)=>{n.d(t,{S4z:()=>yn,xDy:()=>ke,AKv:()=>Rn,j2U:()=>En,Eok:()=>_t,v_H:()=>Bn,wFS:()=>ut,rol:()=>mt,WCc:()=>Pn,sRS:()=>sn,O4s:()=>an,cWe:()=>ln,nWT:()=>Ke,zzA:()=>je,U4I:()=>tn,Jji:()=>Io,U_8:()=>Ee,eot:()=>Ze,OOI:()=>Ln,J5S:()=>Be,k5s:()=>Fe,iBZ:()=>xo,KEd:()=>Pe,MaU:()=>Me,NWv:()=>Wt,vyP:()=>$t,Zk8:()=>Nn,ITt:()=>St,FSO:()=>Xe,YBx:()=>bt,iR0:()=>Re,EWv:()=>De,iJI:()=>Gt,TKz:()=>Ht,IC9:()=>yo,Zuh:()=>Mo,xks:()=>Ge,ryx:()=>He,KbU:()=>Un,Jlb:()=>Vn,Khw:()=>Yt,T29:()=>Qt,lrK:()=>So,OTA:()=>oo,W3A:()=>ao,p4X:()=>io,zOn:()=>lo,OoW:()=>To,l$5:()=>lt,OOd:()=>rt,z22:()=>ro,EJd:()=>so,W5_:()=>to,y9X:()=>Dn,iKo:()=>vn,_Tt:()=>Bt,lA5:()=>tt,b47:()=>nt,DtP:()=>Tt,k6d:()=>Gn,xDj:()=>Oe,CJE:()=>cn,tls:()=>Qe,UI7:()=>fn,W2t:()=>st,fy9:()=>uo,xwj:()=>Vt,YGm:()=>jt,f7f:()=>Nt,dM3:()=>qt,p5B:()=>vo,YO6:()=>An,OOv:()=>hn,Vfv:()=>et,uY7:()=>Cn,mjl:()=>ht,VBw:()=>at,P5O:()=>fo,muB:()=>dt,FYR:()=>ct,DaG:()=>en,ROK:()=>Zn,daU:()=>kt,ar_:()=>wt,VcC:()=>bo,QLY:()=>vt,K5G:()=>Ue,LHu:()=>Ve,Jtb:()=>Le,$H4:()=>ot,J8b:()=>yt,MpE:()=>Sn,Mgm:()=>zt,nJQ:()=>rn,UQV:()=>ft,gnQ:()=>Ct,Or$:()=>Co,US8:()=>no,Vc5:()=>Lt,NnH:()=>wn,vjj:()=>Kt,OXD:()=>_o,ESL:()=>Je,OPg:()=>Ye,sVB:()=>Ot,wTx:()=>zn,GzT:()=>gt,szW:()=>Te,HBU:()=>ho,p1d:()=>We,b1c:()=>un,jlf:()=>Ft,V5r:()=>It,E5p:()=>kn,Cjo:()=>it,Iay:()=>Fn,tqC:()=>Pt,Fxc:()=>Mt,_z:()=>$e,ECq:()=>Ce,q4$:()=>Mn,tYA:()=>Rt,Hjo:()=>dn,DFt:()=>In,KHO:()=>nn,$w6:()=>Ie,vdd:()=>pn,YZb:()=>Dt,Id2:()=>Xn,$I3:()=>Ut,lvA:()=>bn,vM3:()=>co,Ggh:()=>Zt,Q_M:()=>Ne,hrD:()=>Et,Mnk:()=>At,$bF:()=>_n,ATo:()=>ko,lPL:()=>wo,Xa0:()=>ze,_nA:()=>eo,U7o:()=>xe,j61:()=>Po,zqE:()=>Hn,plk:()=>po,c2G:()=>qe,STD:()=>Ao,ypk:()=>Ae,$cr:()=>qn,Zi3:()=>on,P99:()=>pt,EDF:()=>xt,OFQ:()=>Yn,YPq:()=>$n,urk:()=>Qn,Rd2:()=>Jn,tJc:()=>Wn,DUX:()=>Jt,ffD:()=>we,or:()=>Se,Txk:()=>xn,eMw:()=>On,uqO:()=>jn,zME:()=>Kn,m1H:()=>Do,J6K:()=>Ro,cFU:()=>Tn,jp9:()=>go,KSG:()=>mo,QYD:()=>Xt,zl0:()=>gn});n(252262),n(324506);var o=n(541432),r=n(150475),i=n(180951),a=n(642509),s=n(643593),l=n(474181),c=n(186517),d=n(772141);const u=["TypeScript","JavaScript","GraphQL","HTML","CSS","Scss","JSON","XML","Rust"];var p=n(421202),m=n(606287),g=n(870279),f=n(475246),h=n(429369),v=n(590965),y=n(364684),b=n(421838),_=n(653965),S=n(619584),k=n(286420),w=n(110906),x=n(95477),I=n(269783),C=n(721429),T=n(278429),M=n(175770),P=n(785957),A=n(367669),R=n(918514),D=n(195697),B=n(883165),E=n(553824),F=n(62682),Z=n(394841),U=n(58202),V=n(681844),N=n(440134),O=n(427534),L=n(363208),j=n(356437),K=n(704266),z=n(600051),q=n(80444),H=n(990827),G=n(316772),W=n(788632),$=n(400807),Y=n(424042),Q=n(964233),J=n(385555),X=n(319111),ee=n(188923),te=n(896026),ne=n(281236),oe=n(206258),re=(n(249557),n(155320)),ie=n(27724),ae=n(599757),se=n(924666),le=n(535057),ce=n(304708),de=n(277181),ue=n(111599),pe=n(792783),me=n(292283),ge=n(35026),fe=n(450627),he=n(798165),ve=n(128187),ye=n(548779),be=n(489086),_e=n(385644);function Se(e){return t=>e.some((e=>e(t)))}function ke(e){return t=>e.every((e=>e(t)))}function we(e){return t=>!e(t)}function xe(e){return e.blocks&&1===e.blocks.length}function Ie(e){if(!xe(e))return!1;const{currentUserRootStore:t}=q.default.state,{publicPageData:n}=z.Z.state;return(0,C.KW)({store:e.blocks[0],publicPageData:n,currentUserRootStore:t})}function Ce(e){return e.blocks&&e.blocks.length>1}function Te(e){return!!(0,T.aX)()&&e.blocks.every((e=>{const t=e.getParentId(),n=e.recordStoreUIParentStore,o=null==n?void 0:n.id;return t&&o&&t!==o}))}function Me(e){return e.blocks.every((t=>{const n=t.recordStoreUIParentStore;if(!n)return!1;const o=e.publicEditMode?e.publicEditMode:(0,he.n3)(n)&&te.Z.getMode(e.environment,n);return!A.YF(o)&&n.canEdit()}))}function Pe(e){const{environment:t}=e;return e.blocks.every((e=>A.KE({environment:t,blockStore:e})))}function Ae(e){return void 0!==e.blocks.find((e=>"suggest"===$.Z.getMode(e)))}function Re(e){if(ae.n.state)return!1;if(Bo())return!1;if(e.publicEditMode){const t=e.publicEditMode.permission;return"edit"===t||"comment"===t}return e.blocks.every((e=>!e.pathIsDead()&&(!(0,H.Eo)(e)&&e.canComment())))}function De(e){if(ae.n.state)return!1;if(Bo())return!1;if(e.publicEditMode){const t=e.publicEditMode.permission;return"edit"===t||"comment"===t}return e.blocks.every((e=>"suggest"===$.Z.getMode(e)&&(!e.pathIsDead()&&(!(0,H.Eo)(e)&&e.canComment()))))}function Be(e){return!ae.n.state&&(!Bo()&&e.blocks.every((t=>"suggest"!==$.Z.getMode(t)&&(!A.YF(e.publicEditMode)&&(!t.pathIsDead()&&(!(0,H.Eo)(t)&&(!(0,fe.Ow)(t)&&t.canEdit())))))))}function Ee(e){return!ae.n.state&&e.blocks.every((t=>{if(A.YF(e.publicEditMode))return!1;const n=ue.$0();return n?n.canEditCollection():t.canEdit()}))}function Fe(e){return!ae.n.state&&(!Bo()&&e.blocks.every((t=>!A.YF(e.publicEditMode)&&(!t.pathIsDead()&&(t.isCollectionView()?t.canEditCollection():t.canEdit())))))}function Ze(e){let{environment:t,publicEditMode:n,blocks:o}=e;if(ae.n.state)return!1;const{id:r}=t.currentUser;return!!r&&(!A.YF(n)&&o.every((e=>{const n=(0,A.WE)({userId:r,store:e}).filter((t=>{let{type:n,role:o}=t;if(!o)return!1;const r=e.isCollectionView()||e.isTemplate()?d.D7(o):d.J5(o);return"public_permission"!==n&&r}));return n.length>0&&A.KE({environment:t,blockStore:e})})))}function Ue(e){if(e.blocks&&1===e.blocks.length){const[n]=e.blocks;if(n.isCollectionView()){var t;const e=null===(t=n.getCollectionViewCollectionStore())||void 0===t?void 0:t.getValue();if(e)return(0,a.Gq)(e)||(0,a.Ev)(e)||(0,a.OY)(e)}}return!1}function Ve(e){if(e.blocks&&1===e.blocks.length){const[n]=e.blocks;if(n.isCollectionView()){var t;const e=null===(t=n.getCollectionViewCollectionStore())||void 0===t?void 0:t.getValue();if(e)return(0,a.Ev)(e)}}return!1}function Ne(e){return e.blocks.every((e=>(0,fe.Wt)(e)))}function Oe(e){return e.blocks.every((e=>(0,fe.Ow)(e)))}function Le(e){return!!(0,me.K6)()&&e.blocks.every((e=>{if(!e.isCollectionView())return!1;const t=e.getCollectionViewCollectionStore();return!!t&&t.isExternallyImportedAndSyncedCollection()}))}function je(e){return!ae.n.state&&e.blocks.every((e=>e.canAdmin()))}function Ke(e){return e.blocks.some((e=>Boolean(U.R.findBlockFromStoreWithMethod(e,"activate"))))}function ze(e){return e.blocks.every((e=>e.isRestricted()))}function qe(e){var t;const{currentSpaceStore:n}=q.default.state,{currentUser:o}=e.environment;return void 0!==o.id&&Boolean(null===(t=(0,B._P)(n,o.id))||void 0===t?void 0:t.isWorkspaceOwner())}function He(){const e=C.np();return!e||!e.isLocked()}function Ge(){const e=C.np();return Boolean(null==e?void 0:e.getAssociatedCollectionStore())}function We(e){return e.blocks.length>0&&e.blocks.some((e=>e.isLocked()))}function $e(e){return e.blocks.length>0}function Ye(e){return e.blocks.some((e=>{const t=C.np();return!(!t||!(0,fe.Wt)(t))||!!(t&&t.isNonEditableState()&&t.uiContains(e)&&t!==e)}))}function Qe(e){return!!Bo()||e.blocks.some((e=>e.pathIsDead()))}function Je(e){return e.blocks.some((e=>{var t;const{mainEditorCurrentBlockStore:n}=q.default.state,o=null===(t=U.R.findCollectionViewBlockFromStore(e))||void 0===t?void 0:t.collectionContextStore;return!(!o||o.permissionScopesStore.state.canEditContent)||Boolean(n&&n.isCollectionView()&&n.isNonEditableState()&&n.uiContains(e)&&n!==e)}))}function Xe(e){return e.blocks.every((e=>{const t=e.getType(),n=e.getFormat();return Boolean((0,o.XD)(t,n)&&!(0,o.S9)(t))}))}function et(e){var t;const n=null===(t=q.default.state.mainEditorCurrentBlockStore)||void 0===t?void 0:t.id,r=e.blocks.at(0);if(r){const e=r.getType(),t=r.getFormat(),i=r.id;return Boolean(i===n&&(0,o.XD)(e,t))}return!1}function tt(e){return e.blocks.every((e=>{const t=e.getRecordStoreUIParent();return Boolean(t&&e.isDefined()&&e.getParentId()!==t.id)}))}function nt(e){return e.blocks.every((e=>{const t=e.getRecordStoreUIParent();return Boolean(t&&t.canEdit()&&e.isDefined()&&e.getParentId()!==t.id)}))}function ot(e){if(e.blocks){const t=e.blocks.at(0);return Boolean(t&&t.isDefined()&&t.getType()===o.Ti.file&&t.getProperties().source)}return!1}function rt(e){if(!e.blocks)return!1;const t=e.blocks.at(0),n=t&&t.getProperties().source;if(!n)return!1;const o=i.zB(n);return!!o&&s.E$(o,[x.default.secureFileS3.url,x.default.secureFileS3V2.url])}function it(e){if(e.blocks){const t=e.blocks.at(0);return Boolean((null==t?void 0:t.isType(o.Ok))&&t.getProperties())}return!1}function at(e){if(e.blocks){const t=e.blocks.at(0),n=null==t?void 0:t.getType();return Boolean(n&&(0,o.VB)(n))}return!1}function st(e){if(e.blocks){var t;const n=e.blocks.at(0);return Boolean(null==n||null===(t=n.getModel())||void 0===t?void 0:t.isType(o.oe))}return!1}function lt(e){return t=>{if(t.blocks){const n=t.blocks.at(0);return Boolean(null==n?void 0:n.getProperties()[e])}return!1}}lt("source");function ct(e){if(e.blocks){const t=e.blocks.at(0);if(!t)return!1;if(t.pathIsDead())return!1;if((0,H.Eo)(t))return!1;if(t.getType()===o.Ti.transclusionReference){const e=t.getTransclusionReferenceTargetStore();return Boolean(e&&e.canEdit())}return!1}return!1}function dt(e){if(e.blocks){const t=e.blocks.at(0);return!!t&&(!t.pathIsDead()&&(!(0,H.Eo)(t)&&t.getType()===o.Ti.transclusionContainer))}return!1}function ut(e){return e.blocks.every((e=>{const t=e.getModel(),n=e.getRecordStoreUIParent();return Boolean(t&&t.isType(o.Zi)&&t.getType()!==o.Ti.transclusionContainer&&e.getParentTable()!==m.vF&&n&&n.id===e.getParentId())}))}function pt(e){return t=>{if(!t.blocks)return!1;const n=t.blocks.at(0);return Boolean(n&&_.mf(n.getType)&&n.getType()===e)}}function mt(e){return t=>_.yW(t.blocks,(t=>t&&_.mf(t.getType)&&t.getType()===e))}function gt(e){const t=e.blocks.at(0);if(!t)return!1;const{language:n}=t.getProperties(),o=(0,b.QaF)(n);return u.includes(o)}function ft(e){const t=e.blocks.at(0);if(!t)return!1;const{language:n}=t.getProperties();return"HTML"===(0,b.QaF)(n)}function ht(e){return!1}function vt(e){return()=>J.default.checkGate({gateName:e})}function yt(e){return t=>{if(1!==t.blocks.length)return!1;const n=t.blocks.at(0);if(!n)return!1;const o=n.getParentBlockStore(),r=null==o?void 0:o.getContentStores(),i=null==r?void 0:r.map((t=>t.getType()===e));if(!i||0===(null==i?void 0:i.length))return!1;const a=null==r?void 0:r.map((e=>e.id)).indexOf(n.id);return void 0!==a&&(0===a||!i[a-1])}}function bt(e){return e.blocks.every((e=>{const t=null==e?void 0:e.getModel();return Boolean((null==t?void 0:t.isType(o.Zj))&&e.getParentTable()!==m.vF)}))}function _t(e){const t=C.RM();return!!t&&e.blocks.every((e=>t.uiContains(e)&&t.id!==e.id))}function St(e){return e.blocks.every((e=>{const t=U.R.findBlockFromStoreWithMethod(e,"canRenderFullScreen");return Boolean(t&&t.canRenderFullScreen())}))}function kt(e){let{environment:{device:t}}=e;return t.isElectron}function wt(){return Boolean(Y.Z.state.isElectronHandlingZoom)}function xt(e){let{environment:{device:t}}=e;return t.isWindows}function It(e){let{environment:{device:t}}=e;return t.isMac}function Ct(e){let{environment:{device:t}}=e;return t.isIOS}function Tt(e){let{environment:{device:t}}=e;return t.isAndroid}function Mt(e){let{environment:{device:t}}=e;return t.isMobileNative}function Pt(e){let{environment:{device:t}}=e;return t.isMobile}function At(e){let{environment:{device:t}}=e;return t.isPhone}function Rt(e){let{environment:{device:t}}=e;return t.isNative}function Dt(e){let{environment:{device:t}}=e;return!t.isMobile}function Bt(){return x.default.isAdminMode}function Et(){const e=C.np();return(0,Z.WE)(e)}function Ft(e){let{environment:t}=e;return Boolean(t.currentUser.isLoggedIn()||t.publicDomainUserId)}function Zt(){return W.Z.state.online}function Ut(e){return!e.blocks.every((t=>{const n=t.inMemoryRecordCache===e.environment.defaultRecordCache.inMemoryRecordCache,o=t.inMemoryRecordCache.cacheFallbacks.has(e.environment.defaultRecordCache.inMemoryRecordCache);return n||o}))}function Vt(e){return e.blocks.some((e=>e.isTemplate()))}function Nt(e){return e.blocks.some((e=>e.isCollectionViewPageWithContent()))}function Ot(e){return e.blocks.some((e=>e.isAssociatedCollectionAPageTree()))}function Lt(e){return e.blocks.every((()=>!function(){const e=C.np();return null==e?void 0:e.isCollectionViewPageWithContent()}()||En("page",!1)(e)))}function jt(e){if(e.blocks&&1===e.blocks.length){const[t]=e.blocks;return t.isCollectionView()}return!1}function Kt(e){if(e.blocks&&1===e.blocks.length){const[t]=e.blocks;return t.isType(o.Ti.collectionView)}return!1}function zt(e){if(e.blocks&&1===e.blocks.length){const[t]=e.blocks;return t.isType(o.Ti.collectionViewPage)}return!1}function qt(e){return t=>{if(t.blocks&&1===t.blocks.length){const[n]=t.blocks,o=U.R.findCollectionViewBlockFromStore(n);return!!o&&o.collectionContextStore.getViewType()===e}return!1}}function Ht(e){if(e.blocks&&1===e.blocks.length){const[t]=e.blocks;return 1===t.getCollectionViewStores().length}return!1}function Gt(e){if(e.blocks&&1===e.blocks.length){const[t]=e.blocks,n=t.getCollectionViewCollectionStore();if(!n)return!1;const o=n.getSchema();return Object.values(o).map((e=>null==e?void 0:e.type)).every((e=>e&&O.k7[e]))}return!0}function Wt(e){return R.NW(e.environment)}function $t(e){return R.vy(e.environment)}function Yt(){return Q.Z.state.open}function Qt(){return I.Z.state.open}function Jt(){return X.Z.state.open}function Xt(){return K.Z.state.open}function en(){return"editing"===se.default.state.mode}function tn(){return!((0,be.J6)(b.GKr.User)||(0,be.J6)(b.GKr.Bot)||(0,be.J6)(b.GKr.Date)||(0,be.J6)(b.GKr.Page))}function nn(){return ie.default.state.stores.length>0}function on(e){return e.blocks.every((e=>e.isTopLevel()))}function rn(e){const t=q.default.state.currentSpaceStore;return(0,ye.Cx)(t)}function an(e){return e.blocks.every((e=>Boolean(V.Z.findOutlinerItemFromStore(e))))}function sn(e){return e.blocks.every((e=>{const t=V.Z.findOutlinerItemFromStore(e);return Boolean(t&&t.isTopLevelItem&&"bookmarks"===t.type)}))}function ln(e){return e.blocks.every((e=>{const t=V.Z.findOutlinerItemFromStore(e);return Boolean(t&&t.isTopLevelItem&&"shared"===t.type)}))}function cn(e){const t=e.blocks.at(0);if(!t)return!1;const n=t.getParentBlockStore();return!!n&&n.isNonEditableState()}function dn(e){return e.blocks.some((e=>e.isNavigableBlockLocked()))}function un(e){return!pn(e)}function pn(e){if(!(0,D.bq)())return!0;const t=e.blocks.at(0);if(t){if(t.getParentTable()===h.e0){const n=(0,he.VP)(t);if(!n||!(0,ge.si)({teamStore:n,environment:e.environment}))return!1}}return!0}function mn(e){if(!e)return;const t=e.getParentPointer(),n=e.getRecordStoreUIParent();return(null==t?void 0:t.table)===h.e0&&n?oe.zX.createChildStore(n,t):mn(e.getParentBlockStore())}function gn(e){const{id:t}=e.environment.currentUser;return!!t&&e.blocks.every((e=>{const n=e.getPermissionItems();return(0,c.ws)(n,t)}))}function fn(e){const{currentSpaceViewStore:t}=q.default.state,n=e.blocks.at(0);return Boolean(t&&n&&(0,pe.Z)({spaceViewStore:t,pageId:n.id}))}function hn(e){const t=C.np(),n=e.blocks.at(0);return Boolean(n&&n===t)}function vn(e){return e.blocks.every((t=>Boolean(A.IJ(e.environment,t))))}function yn(e){return e.blocks.every((e=>A.S4(e)))}function bn(e){return Boolean(q.default.state.mainEditorCurrentBlockStore)}function _n(){var e,t;const n=C.np(),o=null==n||null===(e=n.getSiteStore())||void 0===e?void 0:e.getModel();return!!o&&Boolean(null===(t=o.getHeader())||void 0===t?void 0:t.hideSearch)}function Sn(e){const t=e.environment.RouterStore.state.route;return Boolean("chat"===t.name)}function kn(e){const t=e.environment.RouterStore.state.route;return Boolean("gallery"===t.name)}function wn(e){const t=e.blocks.at(0);return Boolean(P.Tx()&&t&&t===ee.default.peekTargetStore.state)}function xn(e){return P.Tx()}function In(e){return e.blocks.every((e=>e.isNavigableBlock()))}function Cn(e){return e.blocks.some((e=>e.pathIsDead()))}function Tn(e){const t=e.blocks.at(0);return!!t&&(!!x.default.isAdminMode||!!t.canEdit()&&!e.environment.device.isMobile)}function Mn(e){if(1!==e.blocks.length)return!1;const t=e.blocks.at(0);return!!t&&(0,C.qG)(t.id)}function Pn(e){return!e.blocks.some((e=>{const t=null==e?void 0:e.getSystemBlockTypeStore().getValue();return(0,r.u7)(t)}))}function An(e){return e.blocks.some((e=>{e.useCrdt()}))}function Rn(e){return e.blocks.every((e=>Boolean(e.findRecordStoreUIAncestor((e=>e instanceof oe.Xr||e instanceof oe.G&&e.isCollectionView())).ancestor)))}function Dn(e){let{blocks:t}=e;const n=null==t?void 0:t.at(0);return Boolean(n&&(0,de.bX)(n))}function Bn(e){let{blocks:t}=e;return w.v_(t)}function En(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>n.blocks.every((n=>{const o=w.fm(n,t),r=null==o?void 0:o.collectionViewStore();return(null==r?void 0:r.getType())===e}))}function Fn(){const{currentSpaceStore:e}=q.default.state;return Boolean(e&&e.canRead())}function Zn(){const{currentSpaceStore:e}=q.default.state;return Boolean(e&&e.canEdit())}function Un(e){if(x.default.isAdminMode)return!0;if(e.blocks.some((e=>{const t=(0,N.B)({blockId:e.id,setting:"disableExport"});return Boolean(null==t?void 0:t.disabled)})))return!1;if(rn()&&!je(e))return!1;const t=function(e){let{environment:t}=e;const{currentSpaceStore:n}=q.default.state;if(!n)return!1;const o=ne.Z.getData(t,{spaceId:n.id});return n.isDefined()?!n.getDisableExport():o?!o.disableExport:Bt()}(e),{environment:n,blocks:o}=e;return o.every((e=>{const o=(0,he.VP)(e),r=null==o?void 0:o.getModel();return o&&r?(!n.currentUser.id||!(0,y.s8)({team:r,userId:n.currentUser.id}))&&!o.getDisableExport():t}))}function Vn(){const{currentSpaceStore:e}=q.default.state;return!!e&&!e.getDisableMoveToSpace()}function Nn(e){return!ae.n.state&&(!!e.blocks.every((e=>e.canEdit()))&&!!vn(e))}function On(e){return e.blocks.every((t=>{var n;return"edit"===(null===(n=te.Z.getMode(e.environment,t))||void 0===n?void 0:n.permission)}))}function Ln(e){if(!Me(e))return!1;const t=e.blocks.filter((e=>{const t=e.recordStoreUIParentStore,n=e.getParentStore();return t&&n&&t.id===n.id}));return 0===t.length||Be({...e,blocks:t})}function jn(e){let{environment:t}=e;const n=(0,C.k_)(t).state;return Boolean(n&&n.showSharedOverflowButton)}function Kn(){return(0,ce.yT)()}function zn(e){let{blocks:t}=e;return t.some((e=>Boolean(e.findRecordStoreUIAncestor((e=>e instanceof oe.G&&e.isTransclusionType())).ancestor)))}function qn(e){let{environment:t}=e;return J.default.checkGate({gateName:"lucy-in-the-sky-with-tab-blocks"})}function Hn(e){let{environment:t}=e;return J.default.checkGate({gateName:"slide_block"})}function Gn(e){let{blocks:t}=e;const n=t.at(0);if(!n)return!1;const r=n.getType(),i=n.getFormat();return Boolean(i.block_width)&&!Boolean(i.block_page_width)&&!Boolean(i.block_full_width)&&Boolean(r&&(0,o._7)(r))}function Wn(e){var t;let{blocks:n}=e;const o=n.at(0);return!!o&&Boolean(null===(t=(0,ve.Jk)(o))||void 0===t||null===(t=t.slackIntegrationStore)||void 0===t?void 0:t.isReady())}function $n(){var e;const{currentSpaceStore:t}=q.default.state,n=null==t||null===(e=t.getBotSettingsStore())||void 0===e?void 0:e.getValue();return!(0,v.CJ)(n)||Boolean((null==n?void 0:n.integration_approval_statuses)&&n.integration_approval_statuses[l.T0])}function Yn(e){var t;let{blocks:n}=e;const o=n.at(0);if(!o)return!1;const{slackIntegrationStore:r}=(0,ve.Jk)(o);return Boolean(r.isReady()&&!(null!=r&&null!==(t=r.getKeyStore("enabled"))&&void 0!==t&&t.getValue()))}function Qn(e){var t;let{blocks:n}=e;const o=n.at(0);if(!o)return!1;const{blockStore:r,slackIntegrationStore:i}=(0,ve.Jk)(o);return Boolean(i.isReady()&&(null==i||null===(t=i.getKeyStore("enabled"))||void 0===t?void 0:t.getValue())&&r.id!==o.id)}function Jn(e){var t;let{blocks:n}=e;const o=n.at(0);if(!o)return!1;const{blockStore:r,slackIntegrationStore:i}=(0,ve.Jk)(o);return Boolean(i.isReady()&&(null==i||null===(t=i.getKeyStore("enabled"))||void 0===t?void 0:t.getValue())&&r.id===o.id)}function Xn(e){var t;let{blocks:n}=e;return(null===(t=n.at(0))||void 0===t?void 0:t.getSpaceId())!==f.N3}function eo(e){var t;return 1===e.blocks.length&&(null===(t=e.blocks.at(0))||void 0===t?void 0:t.getType())===o.Ti.table}function to(e){const t=L.Z.state;return t.isActive&&1===e.blocks.length&&e.blocks.at(0)===t.simpleTableStore}function no(e){let{blocks:t}=e;return t.some((e=>Boolean(e.isImmediateColumnChild())))}function oo(e){const t=L.Z.state;if(!t.isActive)return!1;const{simpleTableStore:n}=t;return O.WN(n)>1}function ro(e){const t=L.Z.state;if(!t.isActive)return!1;const{simpleTableStore:n,selection:o}=t,r=0===o.start.row&&o.end.row===O.bm(n)-1,i=0<=o.start.col&&o.start.col<=o.end.col&&o.start.col<=O.WN(n)-1;return"column"===o.type&&i&&r}function io(e){const t=L.Z.state;if(!t.isActive)return!1;const{simpleTableStore:n,selection:o}=t,r=0===o.start.row&&o.end.row===O.bm(n)-1,i=0===o.start.col&&0===o.end.col;return"column"===o.type&&i&&r}function ao(e){const t=L.Z.state;if(!t.isActive)return!1;const{simpleTableStore:n}=t;return O.bm(n)>1}function so(e){const t=L.Z.state;if(!t.isActive)return!1;const{simpleTableStore:n,selection:o}=t,r=0===o.start.col&&o.end.col===O.WN(n)-1,i=0<=o.start.row&&o.start.row<=o.end.row&&o.start.row<=O.bm(n)-1;return"row"===o.type&&i&&r}function lo(e){const t=L.Z.state;if(!t.isActive)return!1;const{simpleTableStore:n,selection:o}=t,r=0===o.start.col&&o.end.col===O.WN(n)-1,i=0===o.start.row&&0===o.end.row;return"row"===o.type&&i&&r}function co(e){let{environment:t}=e;return(0,le.QM)()}function uo(e){if(1!==e.blocks.length)return!1;const t=e.blocks.at(0);if(!t)return!1;const n=t.getParentStore();return!(!n||n.table!==p.iU)&&n.isType(o.Ti.tab)}function po(e){const t=e.blocks.at(0);return Boolean(t&&t.isCollectionView()&&t.getCollectionViewSourceCollectionStore())}function mo(e){if(!xe(e))return!1;const t=e.blocks.at(0);return!!t&&(0,_e.z)(t)}function go(e){return function(e){let{environment:t,blocks:n}=e;if(!(0,D.bq)())return!1;if(!M.lQ({environment:t,blocks:n}))return!1;const o=t.currentUser.id,{currentSpaceStore:r}=q.default.state;if(!o||null==r||!r.isDefined())return!1;if(!D.Xq({environment:t,spaceStore:r}))return!1;for(const a of n){var i;if(!a.isPageBlock())return!1;if("team"!==(null===(i=V.Z.findOutlinerItemFromStore(a))||void 0===i?void 0:i.type))return!1;const e=mn(a);if(null==e||!e.isOwner(o))return!1}return!0}(e)&&Dt(e)}function fo(){const{currentSpaceStore:e}=q.default.state,t=null==e?void 0:e.getBotSettingsStore().getValue();return!(0,v.CJ)(t)||Boolean((null==t?void 0:t.integration_approval_statuses)&&t.integration_approval_statuses[l._o])}function ho(e){var t;return Boolean(null===(t=e.blocks.at(0))||void 0===t?void 0:t.getFormat().is_placeholder)}function vo(e){var t;return Boolean((null===(t=e.blocks.at(0))||void 0===t||null===(t=t.getFormat().alias_pointer)||void 0===t?void 0:t.table)===g.x_)}function yo(){const e=C.np();if(!e||!e.hasContent())return!1;if(1===e.getContentLength()){const t=e.getContentStores()[0].getTitleStore();if(K.Z.state.open&&K.Z.state.textStore===t)return!1;if(G.default.isEditingEmptyBlock())return!1}return!0}function bo(){return Boolean(Y.Z.state.isElectronUsingCommandNumber)}function _o(e){return e.blocks.some(k.t)}function So(e){return e.blocks.every((e=>{const t=null==e?void 0:e.getModel();return Boolean(null==t?void 0:t.isType(o.Nn))}))}function ko(){return re.default.state.open}function wo(e){const{environment:t}=e,{device:n}=t,o="quickSearch"===t.RouterStore.state.route.name;return n.isElectron&&o}function xo(e){const{environment:t}=e;return e.blocks.some((e=>(0,F.N)({environment:t,blockStore:e})))}function Io(e){const t=e.blocks.at(0);return Boolean((null==t?void 0:t.isType("image"))&&(0,E.fA)(t.getOriginalImageSource()))}function Co(e){const t=e.blocks.at(0);return Boolean(null==t?void 0:t.isType("image"))}function To(e){const t=e.blocks.at(0);return Boolean(null==t?void 0:t.getFormat().image_hyperlink)}function Mo(){const e=C.np();return"page"===(null==e?void 0:e.getType())}function Po(e){var t;return Boolean(1===e.blocks.length&&(null===(t=e.blocks.at(0))||void 0===t?void 0:t.isDictatableBlock()))}function Ao(e){const t=e.blocks.at(0);return Boolean((null==t?void 0:t.isType("copy_indicator"))&&Date.now()-t.getCreatedTime()>S.A0)}function Ro(e){const t=e.blocks.at(0);return!!t&&!j.pq(t)}function Do(e){const t=e.blocks.at(0);return!!t&&!j.iZ(t)}function Bo(){const e=C.np();return Boolean(null==e?void 0:e.pathIsDead())}},855337:(e,t,n)=>{n.d(t,{K4:()=>xe,NM:()=>ye,ls:()=>Ve,mc:()=>Ce,Cd:()=>qe,of:()=>Pe,Ts:()=>De,eR:()=>Be,ZQ:()=>ke,cG:()=>Oe,nZ:()=>Ue,Vi:()=>Se,nB:()=>ze,oT:()=>Ne,fK:()=>he,$A:()=>ve,Jq:()=>be,pH:()=>Fe,Ug:()=>Ke,ci:()=>He,j:()=>we,fW:()=>Ie,lu:()=>Me,Zf:()=>_e});var o=n(701302),r=n(782496),i=n(372933),a=n(401898);const s="v2";function l(e){let t=[];if(e.length>0){if(t=e.filter((e=>{let{code:t}=e;return(0,i.Qh)(t)})),0===t.length)return"en-US";const n=t[0].quality,o=t.filter((e=>{let{quality:t}=e;return t===n}));let r=o.find((e=>"en"===e.code));return r||(r=o[0]),function(e){let t=(0,a.qg)(i.vi,e.code)?i.vi[e.code]:i.vi.en;return"es"===e.code?t="ES"===e.region?"es-ES":"es-LA":"zh"===e.code&&(t="TW"===e.region||"HK"===e.region?"zh-TW":"zh-CN"),t}(r)}return"en-US"}function c(e){const t=function(e){return l(r.parse(e))}(e);return`${s}/${t}`}var d=n(853504);function u(e){return n=["user_id","device_id"],(t=e)?(n.forEach((e=>{e in t&&(t[e]=t[e]?t[e].replace(/-/g,""):void 0)})),(0,d.Z)(t,"ignore-class-instances")):t;var t,n}var p=n(460341),m=n(292595),g=n(225972),f=n(568626),h=n(471924),v=n(915157),y=n(109852),b=n(647425),_=n(364684),S=n(653965),k=n(476870),w=n(307032),x=n(218265),I=n(21359),C=n(95477),T=n(721429),M=n(775538),P=n(112252),A=n(258455),R=n(80444),D=n(385555),B=n(88893),E=(n(757658),n(593214));const F="not_defined";let Z=function(e){return e.BASE_SPACE_DATA="base_space_data",e.SPACE_MEMBER_DATA="space_member_data",e.SPACE_NONMEMBER_DATA="space_nonmember_data",e.SPACE_DATA_NOT_LOADED="space_data_not_loaded",e}({});var U=n(772141),V=n(573123),N=n(937850),O=n(665266),L=n(296994),j=n(798165),K=n(785957),z=n(600051),q=n(188923),H=n(281236),G=n(206258),W=n(787956),$=n(535057),Y=n(288280),Q=n(512955),J=n(374503),X=n(557491),ee=n(720162),te=n(367669),ne=n(548779);async function oe(e,t,n){const o=await Pe(e),{preboot:r,dontWait:i}=n||{},s="currentUser"in e;i||r||!s||await async function(e){e.currentUser.isLoggedIn()&&R.default.state.mainEditorCurrentBlockStore&&(await R.default.waitUntil((()=>Boolean(R.default.state.mainEditorCurrentBlockStore&&R.default.state.mainEditorCurrentBlockStore.isReady))),R.default.state.currentSpaceStore&&await Y.subscriptionDataStoreInstance.waitUntilLoaded());A.default.shouldRefresh(e.currentUser.id)&&await Fe(e)}(e);const l=!i&&s?await le(e):void 0,c=Be(),{currentUserStore:d,currentSpaceStore:u}=R.default.state,p=(0,X.getMobileNativeDeviceInfo)(),m=(0,ee.getMobileNativeSessionInfo)(),g=await(0,J.getDesktopDeviceInfo)(),f=await async function(e,t){const n=await(0,Q.hasPermissionForThirdPartyService)("amplitude",e),o=(0,E.l$)(t);return{is_user_consent_to_track:n,tid:o}}(e,t),h=await async function(){const e=q.default.state,t=K.mH(),n=T.np();if(n){const o=te.YO(n).map((e=>{let{permissionItem:t}=e;return t})),r=o.find((e=>"public_permission"===e.type)),i=o.find((e=>"space_permission"===e.type)),s=o.filter((e=>"user_permission"===e.type&&(0,U.rz)(e.role))),l=o.filter((e=>"user_permission"===e.type&&(0,U.J5)(e.role))),c=await async function(e){const t=await L.FF.isTemplateHelper.load(),n=j.uJ(e),o=[],r=S.xH(n.map((e=>{if(e instanceof G.zX)return;const n=e.getCopiedFromPointer();return n&&t.isTemplate(n)&&o.push(n.id),o})).filter(a.$K));return r}(n),d=Boolean(c)&&c.length>0,u=e.open?void 0:R.default.state.currentCollectionViewStore,{publicPageData:p}=z.Z.state,m=await L.FF.isTemplateHelper.load(),g=n.getCopiedFromPointer();let f;return f=o.some(U.gG)?"deleted_from_trash":n.pathIsDead()?"in_trash":"live",{page_id:n.id,page_public_role:r?r.role:F,page_space_role:i?i.role:F,page_all_collaborator_count:l.length+s.length,page_editor_collaborator_count:l.length,page_read_only_collaborator_count:s.length,page_content_count:n.getContentLength(),page_current_user_role:n.getRole(),page_is_peek:t,page_copied_from:g?(0,w.F9)(g.id):void 0,page_is_notion_template:!!g&&m.isTemplate(g),page_is_template:n.isTemplate(),page_is_prepopulated:d,page_prepopulated_template_ids:c,page_is_database:n.isCollectionView(),page_view_type:u?u.getType():void 0,page_user_has_explicit_access:p?p.userHasExplicitAccess:F,page_deletion_status:f}}}(),v=(null==l?void 0:l.space_id)||void 0;return{data:{...ae(),...o,...l,...h,...De(),...se(),...ie(),...re({userId:null==d?void 0:d.id,spaceId:null==u?void 0:u.id}),...g,...p,...m,...c,...f,...ue(),...(y={spaceId:v,userId:Ne(),deviceId:o.device_id,eventName:t},{unique_event_marker:de(y)})},spaceId:null==l?void 0:l.space_id};var y}function re(e){const{userId:t,spaceId:n}=e;if(!t||!n)return;const o=qe({userId:t,spaceId:n});return o?{notion_session_id:o.id,notion_session_start_ts:o.sessionStartTime,tab_id:(0,y.c$)(),tab_count:(0,O.K)()}:void 0}function ie(){const e=W.Z.state;if(e)return{queryId:e.queryId}}function ae(){const{currentSpaceViewStore:e}=R.default.state;return e&&e.isDefined()?{notify_desktop:e.getNotifyDesktop(),notify_email:e.getNotifyEmail(),notify_mobile:e.getNotifyMobile(),notify_email_digest:e.getNotifyEmailDigest()}:{}}function se(){const{mainEditorCurrentBlockStore:e}=R.default.state;if(e){const t=j.VP(e);if(t)return{team_id:(0,w.cj)(t.id)}}return{}}async function le(e){var t;await(0,N.OI)(2e3,Promise.all([Y.subscriptionDataStoreInstance.waitUntilLoaded(),z.Z.waitUntilLoaded()]));const n=Y.subscriptionDataStoreInstance.state,{currentUserStore:o,currentSpaceStore:r}=R.default.state,{publicPageData:i}=z.Z.state,a=(0,T.zj)(),s=a?(0,w.F9)(a):void 0,{mainEditorCurrentBlockStore:l}=R.default.state,c=null!=r&&r.isDefined()?{id:null==r?void 0:r.id,settings:null==r?void 0:r.getSettings(),email_domains:null==r?void 0:r.getEmailDomains(),plan_type:null==r?void 0:r.getPlanType(),initial_use_cases:null==r?void 0:r.getInitialUseCases(),invite_link_enabled:null==r?void 0:r.getInviteLinkEnabled(),created_by_id:null==r?void 0:r.getCreatedById(),created_time:r.getCreatedTime()}:void 0,d=(null==r?void 0:r.id)||(null==i?void 0:i.spaceId)||(null==l?void 0:l.getSpaceId()),u=Boolean(null==c||null===(t=c.settings)||void 0===t?void 0:t.is_teams_enabled),{currentUserRootStore:p}=R.default.state,m=p&&p.isReady()?S.jj(p.getSpaceViewStores().map((e=>e.getSpaceId()))).length:void 0;if(d&&o&&r&&n){const t=H.Z.getData(e,{spaceId:d}),o=B.YK(n),i=B.CM(n).length||0,a=B.su(n),l=B.lk(n),p=n.hasPaidNonzero,g=t?t.domain:void 0,f=c&&c.email_domains?c.email_domains:void 0,h=B.zl(e,n),v=(0,ne.Ib)(t),y=(0,ne.ww)(t),b=S.hj(h)&&!Number.isNaN(h)&&h!==1/0?h:0;return{space_analytics_data_type:Z.SPACE_MEMBER_DATA,subscription_tier:(0,$.zt)(),page_id:s,space_id:(0,w.F9)(d),space_is_subscribed:o,space_visible_total:i,space_visible_members:a,space_visible_guests:l,space_visible_members_bucketized:(0,V.aT)(a),space_block_usage:B.Lz(e,n),space_block_usage_over_limit:B.Ln(e,n),space_role:r.getRole(),space_block_usage_percent:b,space_timeline_view_usage:B._9(n)?n.timelineViewUsage:void 0,space_created_time:v,available_credit:0,space_domain:g,space_email_domains:f,space_has_paid_nonzero:p,space_plan_type:y,space_initial_use_cases:c?c.initial_use_cases:void 0,space_invite_link_enabled:null==c?void 0:c.invite_link_enabled,space_created_by:null!=c&&c.created_by_id?(0,w.F9)(c.created_by_id):void 0,teams_is_enabled:u,current_space_view_count:m}}if(i){const t=i.spaceId?H.Z.getData(e,{spaceId:i.spaceId}):void 0,n=(0,ne.Ib)(t),o=(0,ne.ww)(t);return{space_analytics_data_type:Z.SPACE_NONMEMBER_DATA,space_id:d?(0,w.F9)(d):void 0,space_domain:i.spaceDomain,page_id:s,subscription_tier:(0,$.zt)(),space_created_time:n,space_plan_type:o,space_invite_link_enabled:null==c?void 0:c.invite_link_enabled,space_created_by:null!=c&&c.created_by_id?(0,w.F9)(c.created_by_id):void 0,teams_is_enabled:u,current_space_view_count:m}}return c?{space_analytics_data_type:Z.BASE_SPACE_DATA,space_id:(0,w.F9)(c.id),space_created_time:c.created_time,space_plan_type:c.plan_type,space_invite_link_enabled:c.invite_link_enabled,space_created_by:c.created_by_id?(0,w.F9)(c.created_by_id):void 0,teams_is_enabled:u,current_space_view_count:m}:{space_analytics_data_type:Z.SPACE_DATA_NOT_LOADED,space_id:null!=r&&r.id?(0,w.F9)(null==r?void 0:r.id):void 0,current_space_view_count:m}}const ce={};function de(e){const{spaceId:t,userId:n,deviceId:o,eventName:r}=e,i=(0,w.Ul)(`${t}:${n}:${o}:${r}`),a=ce[i],s=Date.now();if(!a)return ce[i]=s,!0;const l=new Date(a),c=new Date(s);return l.getUTCDate()!==c.getUTCDate()?(ce[i]=s,!0):void 0}function ue(){let e;return D.default.state.isLoaded&&(e=D.default.getStatsigExperimentsMap()),{experiments:e,experimentStoreLoaded:D.default.state.isLoaded}}var pe=n(436867);const me=18e5;let ge=!1;function fe(){return C.default.isAdminMode||ge}async function he(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=fe();if(await g.fK({traits:e}),t)for(const n of e)console.log("track:%c identify","font-weight: bold;",n)}async function ve(e){const{environment:t,userId:n,traits:o}=e,r=A.default.shouldRefresh(n)?await Fe(t):A.default.state,i=function(e){const t=Be();if(!t.user_id)return;const{user_id:n,email:o,name:r,...i}=e;return{...i,user_id:t.user_id,email:t.email,name:t.name}}(o);if(!i)return void f.rateLimitedLog({level:"warning",from:"analyticsHelpers",type:"noCleanAnalyticsUser"});const a=(0,w.F9)(i.user_id);if(null!=r&&r.isLoggingEnabled){const e=T.VU().map(w.F9),n=await le(t),o=await Pe(t),{accept_language_raw:r,accept_language_preference:s}=o,l=(0,d.Z)({accept_language_raw:r,accept_language_preference:s},"ignore-class-instances"),c={...o,space_has_paid_nonzero:!(!n||!("space_has_paid_nonzero"in n))&&n.space_has_paid_nonzero,integrations:{All:!0}},u={...i,user_email:i.email,...l,...c};g.$A({userId:a,traits:u,spaceIds:e})}fe()&&console.log("identify:",JSON.stringify(o))}async function ye(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fe();await g.HX(),e&&console.log("deidentify user")}async function be(e){const t=await le(e);t&&A.default.state.isLoggingEnabled&&g.Jq({spaceId:t.space_id,spaceData:t})}async function _e(e,t){if(!e.currentUser.id)return;const n=(0,w.F9)(e.currentUser.id);return ve({environment:e,userId:n,traits:{...t,user_id:n}})}(0,m.exposeDebugValue)("enableVerboseAnalytics",(function(){ge=!0}));async function Se(e){const{eventName:t,eventProperties:n,sampling:r}=e;if("custom"===r.behavior)return(0,k.aw)(r.sampleRate);await o.default.afterNextFlush();const i=D.default.getConfigKey("event_trail_events",t);if("object"==typeof i&&"object"==typeof i.sampleRateByProperty){const{sampleRateByProperty:e}=i;for(const[t,o]of Object.entries(e)){const e=o[null==n?void 0:n[t]];if(void 0!==e)return(0,k.aw)(e)}}if("object"==typeof i&&"number"==typeof i.sampleRate)return(0,k.aw)(i.sampleRate);if("custom"===r.fallbackBehavior)return(0,k.aw)(r.fallbackSampleRate);const s=ke();if("number"==typeof s)return(0,k.aw)(s);const{statsigNotAvailableBehavior:l}=r;switch(l){case"track":return!0;case"drop":return!1;default:(0,a.t1)(l)}}function ke(){return D.default.getConfigKey("event_trail_events","defaultSampleRate")}function we(e){const{environment:t,event:n,opts:o}=e,{eventName:r,eventProperties:i}=n;xe(t,r,i,o)}async function xe(e,t,n,o){try{const i=fe(),a=(null==o?void 0:o.sampling)||{behavior:"statsig",fallbackBehavior:"custom",fallbackSampleRate:1};if(!(await Se({eventName:t,eventProperties:n,sampling:a})))return;0;const{data:s,spaceId:l}=await oe(e,t,o);!function(e,t,n){if(!n)return;for(const[o,r]of Object.entries(n))t[o]!==r&&f.log({level:"info",from:"analyticsHelpers",type:"forceOverrideMismatch",data:{eventName:e,miscDataToConvertToString:{forceOverrideKey:o,forceOverrideValue:r,autoTrackedValue:t[o]}}})}(t,s,null==o?void 0:o.forceOverrideAutomaticEventData);const c={eventName:t,eventData:{...u((0,d.Z)(S.Xh({...n,...s,...null==o?void 0:o.forceOverrideAutomaticEventData}),"ignore-class-instances")),__context:{locale:s.preferred_locale,page:{referrer:window.document.referrer,search:window.location.search}},sharedUUID:h.Il()},spaceId:l};var r;if(g.j(c),i&&console.log(`track:%c ${t}`,"font-weight: bold;",n),e.device.isMobileNative&&D.default.checkGate({gateName:"debug_analytics"}))null===(r=e.mobileNative)||void 0===r||r.debugLog(`🦁 analytic event: ${t} | ${JSON.stringify(n)}`)}catch(i){f.log({level:"error",from:"analyticsHelpers",type:"track",data:{eventName:t,miscDataToConvertToString:{e:i}}})}}function Ie(e){const{environment:t,eventName:n,eventProperties:o,opts:r}=e;xe(t,n,o,{...r,sampling:(null==r?void 0:r.sampling)||{behavior:"statsig",fallbackBehavior:"statsig",statsigNotAvailableBehavior:"drop"}})}function Ce(e){return{trackEvent:t=>{xe(e,t.eventName,t.properties)}}}const Te={};function Me(e,t,n,o,r,i){const a=Te[n],s=Date.now();return(!a||s-a>1e3*o)&&(Te[n]=s,xe(e,t,r,i),!0)}async function Pe(e){var t,n,o,r;const{device:i}=e,a="currentUser"in e,s=a?e.RouterStore:void 0,l=null==s||null===(t=s.getState())||void 0===t||null===(t=t.route)||void 0===t?void 0:t.name,c=a?e.WindowSizeStore:void 0,d=null==c?void 0:c.state.width,u=null==c?void 0:c.state.height,m=!!a&&function(e){const t=function(e){var t;return(null==e||null===(t=e.currentUser)||void 0===t?void 0:t.id)||e.publicDomainUserId}(e);return Boolean(t)}(e),g=await Oe(e),{pathname:f,...h}=(0,x.nx)(null===(n=document.location)||void 0===n?void 0:n.href,(0,y.x6)())||{},v={app_version:i.version,desktop_app_version:i.desktopAppVersion,mobile_app_version:i.mobileAppVersion,is_desktop_app_or_browser:!i.isMobile,is_desktop:i.isElectron,is_mobile:i.isMobile,is_tablet:i.isTablet,is_react_native:i.isMobileNative,is_ios:i.isIOS,is_logged_in:m,deviceType:i.os,device_type:i.deviceType,device_os:i.os,platform:i.platform,browser:i.browserName,browser_version:i.browserVersion,browser_version_bucketized:Re(i.browserVersion,i.browserName),dnt:i.doNotTrackEnabled,device_id:g&&(0,w.F9)(g),tags:(0,y.mM)(),host:null===(o=document.location)||void 0===o?void 0:o.host,route_name:l,notion_top_level_domain:(0,p.Q)(null===(r=document.location)||void 0===r?void 0:r.hostname),referrer:document.referrer||"none",accept_language_raw:Le(),accept_language_preference:je(),...h,windowWidth:d,windowHeight:u,isActive:P.Z.state.active,is_foreground:document.hasFocus(),fired_during_onboarding:M.default.state.isOnboarding,is_experimental_build:"clientExperimental"===C.default.buildTarget};return{...S.GM(v,S.o8),appSource:"client"}}const Ae=new Set(["Safari","Mobile Safari"]);function Re(e,t){const n=e.split(".");return Ae.has(t)?n.slice(0,2).join("."):n[0]}function De(){const{currentUserSettingsStore:e}=R.default.state;if(e&&e.isDefined()){let n={};const o=e.getSettings();return o&&(n={user_persona:o.persona,user_source:o.source,user_use_case:o.use_case,time_zone:o.time_zone,time_zone_region:"string"==typeof o.time_zone?(t=o.time_zone,"N/A"===t?t:t.split("/")[0]):void 0,locale:o.locale,preferred_locale:o.preferred_locale,signup_time:o.signup_time,used_desktop_web_app:o.used_desktop_web_app,used_mobile_web_app:o.used_mobile_web_app,used_mac_app:o.used_mac_app,used_windows_app:o.used_windows_app,used_ios_app:o.used_ios_app,used_android_app:o.used_android_app,user_session_count:(0,pe.g)(e.id)}),S.GM(n,S.o8)}var t}function Be(){const e={user_id:Ne(),user_email:A.default.state.user_email,email:A.default.state.user_email,name:A.default.state.user_name};return S.GM(e,S.o8)}const Ee=new Map;async function Fe(e){const t=e.currentUser.id;if(t){if(!Ee.has(t)){const n=Ze(e,{loggedIn:!0});Ee.set(t,n),n.then((()=>{Ee.delete(t)})).catch((e=>{throw Ee.delete(t),e}))}return Ee.get(t)}return Ze(e,{loggedIn:!1})}async function Ze(e,t){t.loggedIn&&await R.default.waitUntilRendered();const n=await I.getUserAnalyticsSettings(e,{});if("success"!==n.type)return void f.log({level:"warning",from:"analyticsHelpers",type:"fetchAnalyticsSettings",data:{miscDataToConvertToString:{response:n}}});const o=n.data;return A.default.setState(o),o}function Ue(e){return e.map((e=>(0,ne.cD)(e))).filter(a.lm).some((e=>b.QM(e)))}function Ve(e){const t=e.map((e=>(0,ne.cD)(e))),n=new Set(S.oA(t));return n.has("enterprise")?"enterprise":n.has("business")?"business":n.has("plus")?"plus":n.has("personal")?"personal_pro":n.has("team_free")?"team_free":n.has("personal_free")?"personal_free":n.has("free")?"free":"none"}function Ne(){const e=A.default.state.user_id;return e?(0,w.F9)(e):void 0}async function Oe(e){const t=await(0,Q.getBrowserId)(e);return t&&(0,w.F9)(t)}function Le(){return D.default.getAcceptLanguageHeader()}function je(){return c(Le()||"")}function Ke(){return"on"===D.default.getEligibleGroup({experimentId:"zendesk",defaultGroup:"unassigned"})}function ze(e){var t;const n=e.id,o=e.getSettingsStore().getValue();if(!e.isDefined()||void 0===o)return{team_id:(0,w.cj)(n),no_team_value:!0};const r=e.getMemberInfoUsingSpaceMembers((0,B.Io)())??[];return{team_id:(0,w.cj)(n),team_current_size:r.length,team_current_num_users:r.filter((e=>"user"===e.entity_type)).length,team_current_num_groups:r.filter((e=>"group"===e.entity_type)).length,team_access_level:(0,_.B5)(o),team_is_default:e.isDefault(),team_has_description:Boolean(e.getDescription()),team_has_icon:Boolean(e.getIcon()),team_top_pages:(null===(t=e.getTeamPagesStore().getValue())||void 0===t?void 0:t.length)??0}}function qe(e){const t=v.Z.get({userId:e.userId,key:`${e.spaceId}:analytics_session`});if(!(t&&Date.now()-t.lastFocusedTime>me))return t}function He(e){v.Z.set({userId:e.userId,key:`${e.spaceId}:analytics_session`,value:e.session})}},721429:(e,t,n)=>{n.d(t,{h1:()=>be,_H:()=>de,p5:()=>Ve,qQ:()=>Re,sH:()=>Ae,zj:()=>ce,Fv:()=>se,np:()=>le,RF:()=>me,RM:()=>pe,Xb:()=>Se,VU:()=>Ee,B7:()=>ue,_u:()=>ke,Zy:()=>Ue,CP:()=>Pe,ui:()=>Me,Pw:()=>Oe,o:()=>Fe,hq:()=>we,VV:()=>Be,JE:()=>De,X:()=>he,YO:()=>ge,qG:()=>fe,KW:()=>ve,kw:()=>Ie,rq:()=>Le,tu:()=>_e,_O:()=>Ne,R3:()=>Te,k_:()=>xe,AK:()=>Ze,cX:()=>Ce});var o=n(14577),r=n(541432),i=n(253877),a=n(535061),s=n(211342);function l(e,t){const n=t.deviceType,o=t.mobileAppVersion;if(!(0,a.wv)(e)||"local"===e||!t.isMobileNative||!o)return!1;const r=function(e){const{environmentName:t,deviceType:n,mobileAppVersion:o,androidVersions:r,iosVersions:i}=e,a=(0,s.parseMobileAppVersion)(o,"android"===n);if(!a)return!1;if("android"===n&&!r||"ios"===n&&!i)return!1;let l;if("android"===n){if(!r)return!1;l=(0,s.parseMobileAppVersion)(r[t],!0)}else{if(!i)return!1;l=(0,s.parseMobileAppVersion)(i[t],!1)}return!!l&&(0,s.isLessThanVersion)(a,l)}({environmentName:e,deviceType:n,mobileAppVersion:o,iosVersions:{staging:"0.1.1022",development:"0.5.1168",production:"0.4.1021"}});return r}var c=n(269246),d=n(772141),u=n(599405),p=(n(421202),n(23867)),m=n(519889),g=n(653965),f=n(95477),h=n(922705),v=n(353323),y=n(38689),b=n(334017),_=n(394841),S=n(849427),k=n(704266),w=n(905162),x=n(434859),I=n(600051),C=n(80444),T=n(780641),M=n(33784),P=n(155367),A=n(964233),R=n(469316),D=n(421051),B=n(803418),E=n(242653),F=n(348863),Z=n(222294),U=n(319111),V=n(453730),N=n(619671),O=n(813023),L=n(188923),j=n(206258),K=n(569784),z=n(313105),q=n(682187),H=n(155320),G=n(27724),W=n(924666),$=n(216194),Y=n(88893),Q=n(956203),J=n(304708),X=n(35026),ee=n(785957),te=n(367669),ne=n(165598),oe=n(918514),re=n(177546),ie=n(548779),ae=n(195697);function se(){if(C.default.state.mainEditorCurrentBlockStore)return{id:C.default.state.mainEditorCurrentBlockStore.id,spaceId:(0,p.C)(C.default.state.mainEditorCurrentBlockStore.pointer.spaceId)}}function le(){const e=L.default.state,t=ee.mH();return e.open&&t?e.targetStore:C.default.state.mainEditorCurrentBlockStore}function ce(){if(C.default.state.mainEditorCurrentBlockStore)return C.default.state.mainEditorCurrentBlockStore.id}function de(){return ee.Tx()?O.Z:N.Z}function ue(e){let t;return C.default.state.currentUserStore?t=C.default.state.currentUserStore:e.currentUser.id&&(t=new j.U6(e,{table:m.KJ,id:e.currentUser.id})),t}function pe(){const e=G.default.getCurrentRootStore();if(e&&e instanceof j.G)return e}function me(){const e=G.default.getCurrentRootStore();if(e&&e instanceof j.G)return e;const{currentSpaceStore:t}=C.default.state;return t||void 0}function ge(e){return!e&&(0,_.WE)(C.default.state.mainEditorCurrentBlockStore)}function fe(e){return"myTasks"===(0,_.G)({blockOrCollectionId:e})}function he(e){return"customDb"===(0,_.G)({blockOrCollectionId:e})}function ve(e){const{store:t,publicPageData:n,currentUserRootStore:o}=e,r=null==o?void 0:o.getSpaceViewStores(),i=void 0!==r&&r.filter((e=>e.getSpaceId()===t.getSpaceId())).length>0;return Boolean(t&&(null==n?void 0:n.isTrustedDomainPage)&&!i)}const ye=new z.P({debugName:"getAppRenderState",memoizeRecursion:!0,deepEquals:!1,compute:function(e){var t;const{mainEditorCurrentBlockStore:n,initialized:o}=C.default.state,r=e.currentUser.isLoggedIn(),i=e.RouterStore.state.route,a=Boolean(n&&n.canRead()&&n.isDefined()),s=Boolean(n&&n.canEdit()&&n.isDefined()),l=Boolean(n&&(0,ne.Oh)(n)),c=n&&a&&(0,te.IJ)(e,n),p=Boolean(c),m=c&&(0,d.J5)(c.permissionItem.role),g=s&&!m,f=(null==n||null===(t=n.getModel())||void 0===t?void 0:t.isNonverifiedContentClassification())&&!(n&&T.Z.bypassedPage(n.id))&&!g,{publicPageData:h}=I.Z.state,v=!o||!l,y=Boolean(n&&n.isReady()&&!a),S=(0,_.WE)(n),k=Boolean((0,u.shouldShowErrorForRoute)(i)&&(!n||y&&!S||f||(null==h?void 0:h.requireInterstitial)||(null==h?void 0:h.requireLogin)&&!r)),w=y&&S;return{shouldShowSidebar:function(){if((0,oe.Sr)(e))return Boolean(null==h?void 0:h.template);const{currentUserRootStore:t}=C.default.state,n=le(),o=n&&ve({store:n,publicPageData:h,currentUserRootStore:t}),c="quickSearch"===i.name,d=b.Z.getState().isOpen;return Boolean(!d&&!c&&!k&&r&&(v||a&&(s&&!p||l&&!p)&&!f&&!(null!=h&&h.requireInterstitial)&&!o))}(),shouldShowFrame:"team"===i.name||"chat"===i.name||!k,shouldShowError:k,shouldRedirectFromHome:w}}});function be(e){return ye.getStateFor(e)}const _e=new o.ZP((()=>{const{mainEditorCurrentBlockStore:e}=C.default.state,t=e&&e.isCollectionView();return Z.Z.state.isKeyboardMode&&!$.Z.state&&!q.Z.isActive()&&!t&&!H.default.state.open&&!R.ZP.state.open&&!(0,v.n)()&&0===D.Z.state.banners.length&&!h.TI.state}),{debugName:"appHelpers.shouldHideTopbarStore"});function Se(e){const{currentSpaceViewStore:t}=C.default.state;if(t){return g.G0(t.getWorkspacePages(),(0,ie.KA)(e,t),t.getPrivatePages(e)).filter((e=>e.isNavigableBlock()))}return[]}function ke(e){const{currentSpaceViewStore:t}=C.default.state;return t?g.mN([...t.getBookmarkedPages(),...t.getWorkspacePages(),...(0,ie.KA)(e,t),...t.getPrivatePages(e)],"id"):[]}function we(e){return e.getType()===r.Ti.copyIndicator&&!V.transactionQueue.isPendingTransactionForRecord(e.pointer)}const xe=g.HP((e=>new o.ZP((()=>function(e){const{currentSpaceStore:t,currentSpaceViewStore:n,currentUserRootStore:o,currentUserSettingsStore:r}=C.default.state;if(!(n&&o&&t&&r))return;const i=(0,J.mq)(e),a=(0,Y.Io)(),s=n.getBookmarkedPages(),l=n.getWorkspacePages(),d=n.getTeamsStores(),{allPagesStores:u,visiblePagesStores:p}=(0,ie._o)({environment:e,spaceViewStore:n,userSettingsStore:r,type:"shared"}).state,{allPagesStores:m,visiblePagesStores:g}=(0,ie._o)({environment:e,spaceViewStore:n,userSettingsStore:r,type:"private"}).state,f=n.getPrivatePages(e),h=(0,ie.Cx)(t),v=1===a.length&&0===l.length&&"personal"===t.getPlanType(),y=s.length>0,b=Te({isGuest:h,numWorkspacePages:l.length}),_=u.length>0,S=r.hasUserPinnedToOutliner({spaceId:t.id,type:"shared"}),k=(0,X.S4)({spaceViewStore:n,type:"teamspaces"}),w=k.truncationLimit===c.Ng?d:d.slice(0,k.truncationLimit),x=(0,ae.bq)()&&w.length>0,I=(0,X.S4)({spaceViewStore:n,type:"shared"}),T=i?u.length>I.truncationLimit&&I.truncationLimit!==c.Ng:u.length>ie.G$||S,M=(0,X.S4)({spaceViewStore:n,type:"private"}),P=m.length>M.truncationLimit&&M.truncationLimit!==c.Ng,A=!h,R=!(y||b||_||x),D=s.length+u.length+l.length+f.length>=8,B=[y,b,_,A,x].filter(Boolean).length;return{isGuest:h,isPersonalSpace:v,showBookmarksSection:y,showWorkspaceSection:b,showSharedSection:_,showPrivateSection:A,showOnlyPrivateSection:R,showSharedOverflowButton:T,showPrivateOverflowButton:P,shownSidebarSectionCount:B,stickTemplateItemsToBottom:D,allSharedPagesStores:u,allPrivatePagesStores:m,visibleSharedPagesStores:p,visiblePrivatePagesStores:g,showTeamSection:x,userJoinedTeamsStores:d,visibleTeamsStores:w}}(e)),{useDeepEqual:!0,debugName:"sidebarStateStore"}))),Ie=new o.ZP((()=>Z.Z.state.isKeyboardMode||K.default.state.isActive||P.ZP.state.isDragging||k.Z.state.open||U.Z.state.open||A.Z.state.open||F.Z.state.open||B.Z.hasOpenMouseCapturePopup()||N.Z.state.isOpen&&!L.default.isCenterPeekOpen()||O.Z.state.isOpen||M.Z.state.open||E.Z.state.isPinned||Q.Z.state.isHovered),{debugName:"menuIsOpenStore"}),Ce=new o.ZP((()=>{const{currentSpaceViewStore:e,currentUserStore:t}=C.default.state,n=new Set;if(!e||!t)return n;for(const o of e.getTeamsStores()){o.isMemberOrGuest(t.id)&&n.add(o.id)}return n}),{useDeepEqual:!0,debugName:"userTeamsInCurrentSpace"});function Te(e){let{isGuest:t,numWorkspacePages:n}=e;return!t&&!(0,ae.bq)()&&n>0}function Me(e){return e.device.isPhone?24:96}function Pe(e){return Me(e)}function Ae(e){const t=G.default.getCurrentDefaultContainer();if(t)return S.Z.find((e=>e.props.store===t.getProps().store))}function Re(e){const t=y.z-2*Me(e),n=Ae();if(n){const e=n.getContentInnerWidth();if(e)return Math.min(t,e)}return t}function De(){const e=le(),t=W.default.state;if("editing"!==t.mode)return!1;const n=t.multiSelection.start.store;return Boolean(e&&e.id===n.id&&(e.getBlockTitleStore()===n||g.Xy(e.getBlockTitleStore().path,n.path)))}function Be(){const e=W.default.state;if("editing"!==e.mode)return!1;const t=e.multiSelection.start.store,n="collection"===t.table;return t.path.includes("name")&&n||!1}function Ee(){const{currentUserRootStore:e}=C.default.state;if(e){const t=e.getSpaceViewStores();return g.oA(t.map((e=>e.getSpaceId())))}return[]}function Fe(e){return g.mN(e.getSpaceViewStores(),(e=>e.getSpaceId())).filter((e=>{const t=e.getSpaceStore();return e.isDefined()&&t&&t.canEdit()}))}const Ze=new o.ZP((function(){const{currentUserSettingsStore:e}=C.default.state,t=(0,i.aN)();if(e){const n=e.getSettings();return void 0===(null==n?void 0:n.start_day_of_week)?t:null==n?void 0:n.start_day_of_week}return t}),{debugName:"userSettingsStartOfWeek"});function Ue(e){const{environment:t,store:n}=e;return n.isCollectionView()?(0,re.eA)(t)?x.Z.All:x.Z.Y:!ee.wq(n)&&L.default.isSidePeekOpen()?x.Z.All:x.Z.Y}function Ve(e){const{isFullScreen:t,environment:n}=e;return t&&(0,re.eA)(n)?x.Z.None:x.Z.X}function Ne(e){return l("production",e.device)||!(0,w.Y)("supportsNativeSearch")}function Oe(e){const{currentUserRootStore:t,mainEditorCurrentBlockStore:n}=C.default.state,o=e.RouterStore.state.route;return"nativeTab"===o.name&&t||"quickSearch"===o.name&&t||t||n}function Le(){f.default.isAdminMode||console.log("%c\n\tnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn\n\tnnnn                         nnnn\n\tnnnnnnn                          nnnn\n\tnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn\n\tnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn\n\tnnnnnnnn                           nnn\n\tnnnnnnnn    nnnnnnnn     nnnnnnn   nnn\n\tnnnnnnnn      nnnnnnn      nnn     nnn\n\tnnnnnnnn      nnnnnnnn     nnn     nnn\n\tnnnnnnnn      nnnnnnnnnn   nnn     nnn\n\tnnnnnnnn      nnn nnnnnnn  nnn     nnn\n\tnnnnnnnn      nnn  nnnnnnnnnnn     nnn\n\tnnnnnnnn      nnn   nnnnnnnnnn     nnn\n\tnnnnnnnn      nnn     nnnnnnnn     nnn\n\tnnnnnnnn      nnn      nnnnnnn     nnn\n\tnnnnnnnn    nnnnnnnn    nnnnnn     nnn\n\t  nnnnnn                           nnn\n\t\tnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn\t\tWe're hiring!\n\t\t  nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn\t\tnotion.so/careers\n\t\t\t\t ","font-family: monospace")}},691924:(e,t,n)=>{n.d(t,{HU:()=>u,IJ:()=>c,Q7:()=>l,eC:()=>d,k2:()=>p});var o=n(535061),r=n(203303),i=n(95477),a=n(385555),s=n(918514);function l(e){return!!e.device.isMobileNative&&(e.device.isIOS&&"on"===a.default.getEligibleGroup({experimentId:"ios_3rd_party_login_with_external_browser",defaultGroup:"control"})||e.device.isAndroid&&"on"===a.default.getEligibleGroup({experimentId:"android_3rd_party_login_with_external_browser",defaultGroup:"control"}))}function c(e){const{device:t}=e,n=l(e);if(t.isMobileNative){return{redirectToAuth:!1,callbackType:n?"nativeredirect":"native"}}if(t.isElectron||t.isElectronMail){return{redirectToAuth:!1,callbackType:t.isElectronMail?"nativemailredirect":"nativeredirect"}}return{redirectToAuth:!0,callbackType:"redirect"}}function d(e){const{device:t}=e,n=l(e);if(t.isMobileNative){return{redirectToAuth:!1,callbackType:n?"nativeredirect":"native"}}if(t.isElectron||t.isElectronMail){return{redirectToAuth:!1,callbackType:t.isElectronMail?"nativemailredirect":"nativeredirect"}}if(t.isMobileBrowser||(0,s.Sr)(e)){return{redirectToAuth:!0,callbackType:"redirect"}}return{redirectToAuth:!0,callbackType:"popup"}}async function u(e,t,n){if(e.device.isHttpApp){const e=await fetch(t);return(await e.json()).url}{const e=await fetch(r.NV({httpUrl:t,protocol:i.default.protocol,includePort:n}));return(await e.json()).url}}function p(e){return r.jP({url:o.tu[e],isLocalHost:"local"===e})}},143976:(e,t,n)=>{n.d(t,{L:()=>h});var o=n(266897),r=n(736576),i=n(291627);function a(e){const t=new i.X;return e&&e.forEach((e=>{e&&t.add(e.pointer)})),t}var s=n(421202),l=n(870279),c=n(23867),d=n(519889),u=n(653965),p=n(401898),m=n(918402),g=n(206258);function f(e,t){const n=u.oA(e.map((e=>function(e,t){if("comment_mention"===e.mentioned_from.type){const n=g.t1.createChildStore(t,{table:l.x_,id:e.mentioned_from.comment_id,spaceId:(0,c.C)(void 0)});if(!n.isDefined())return;const o=g.t1.createChildStore(t,n.getParentPointer());if(!o.isDefined())return;const r=g.G.createChildStore(t,{table:s.iU,id:o.getParentId()}),i=r.getNavigableBlockStore();if(!i)return;return r.id===i.id?{backlinkStore:i,timestamp:n.getLastEditedTime()}:{backlinkStore:i,scrollToBlockId:r.id,discussionId:o.id,timestamp:n.getLastEditedTime()}}if("reference"===e.mentioned_from.type){const n=g.G.createChildStore(t,{table:s.iU,id:e.mentioned_from.parent_block_id}).getNavigableBlockStore();if(!n)return;const o=n.getLastEditedTime();return{backlinkStore:n,scrollToBlockId:e.block_id,timestamp:o||0}}if("property_mention"===e.mentioned_from.type){const{block_id:n}=e.mentioned_from,o=g.G.createChildStore(t,{table:s.iU,id:n});if(!o.isDefined())return;const r=o.getNavigableBlockStore();if(!r)return;return r.id===o.id?{backlinkStore:r,timestamp:o.getLastEditedTime()}:{backlinkStore:r,scrollToBlockId:o.id,timestamp:o.getLastEditedTime()}}if("collection_reference"===e.mentioned_from.type){const{block_id:n}=e.mentioned_from,o=g.G.createChildStore(t,{table:s.iU,id:n});if(!o.isDefined())return;const r=o.getNavigableBlockStore();if(!r)return;return r.id===o.id?{backlinkStore:r,timestamp:o.getLastEditedTime()}:{backlinkStore:r,scrollToBlockId:o.id,timestamp:o.getLastEditedTime()}}if("alias"===e.mentioned_from.type||"transclusion_reference"===e.mentioned_from.type){const n=g.G.createChildStore(t,{table:s.iU,id:e.mentioned_from.pointer.id}),o=n.getNavigableBlockStore();if(!o)return;return{backlinkStore:o,scrollToBlockId:n.id,timestamp:o.getLastEditedTime()}}(0,p.t1)(e.mentioned_from)}(e,t)))),o=u.vM(n,(e=>{let{backlinkStore:t}=e;return t.id})),r=Object.values(o).map((e=>u.MR(e,(e=>e.discussionId?2:e.scrollToBlockId?1:0))[0]));return r.sort(((e,t)=>t.timestamp-e.timestamp)),r}function h(e,t){const{id:n}=t.currentUser;let s;if(n){const t=e.getRecordValue({table:d.KJ,id:n});t&&(s=(0,o.dp)(t))}const l=t.LocalBacklinkStore.getBacklinkState({blockId:e.id,currentUserId:t.currentUser.id}),c=e.pointer,u=l.backlinks.map(r.dq).concat([c]),p=(0,m.bi)({actorPointers:a([s]),recordPointers:new i.X(u),getRecordModel:e.getRecordModel}),g=(0,r.I3)({actor:s,backlinks:l.backlinks,getRecordModel:e.getRecordModel,actorHasPermissionViaPublicAccessOnlyFn:e=>{const{actor:t,recordPointer:n}=e;return(0,m.r$)({actor:t,recordPointer:n,permissionsContext:p})},sourceBlockRecordPointer:c});return 0===g.length?{backlinks:[],inaccessibleBacklinkCount:l.inaccessibleBacklinkCount}:{backlinks:f(g,e),inaccessibleBacklinkCount:l.inaccessibleBacklinkCount}}},772770:(e,t,n)=>{n.d(t,{X:()=>r,v:()=>o});let o=function(e){return e.Red="red",e.Blue="blue",e.Beige="beige",e.White="white",e.Purple="purple",e.LightRed="light-red",e.Yellow="yellow",e.PageNotification="page-notification",e.ImportNotification="import-notification",e.LightBlue="light-blue",e.LightGray="light-gray",e}({});function r(e){switch(e){case o.Red:return"red";case o.Blue:return"blue";case o.Beige:return"yellow";case o.White:return"gray";case o.Purple:return"blue";case o.LightRed:return"red";case o.Yellow:return"yellow";case o.PageNotification:return"gray";case o.ImportNotification:case o.LightBlue:return"blue";case o.LightGray:default:return"gray"}}},700042:(e,t,n)=>{n.d(t,{Fr:()=>z,Jy:()=>U,S7:()=>N,UG:()=>j,W_:()=>T,Xq:()=>C,Yu:()=>B,ZW:()=>L,_Z:()=>Z,ax:()=>w,dq:()=>q,iC:()=>E,iD:()=>K,n_:()=>V,sU:()=>F,sw:()=>k});n(252262),n(324506);var o=n(730120),r=n(107289),i=n(399036),a=n(180951),s=n(142613),l=n(253877),c=n(842875),d=n(471924),u=n(145953),p=n(421202),m=n(606287),g=n(421838),f=n(709291),h=n(653965),v=n(215828),y=n(401898),b=n(433929),_=n(385555);const S=(0,f.defineMessages)({addNewTodoTitle:{defaultMessage:"Add a new to-do",id:"blockTemplates.templateButton.addNewTodoTitle"}});function k(){return u.Ao.create({block:{root:{id:"root",version:27,type:"factory",properties:{title:[[b.default.formatMessage(S.addNewTodoTitle)]]},content:["to_do"]},to_do:{id:"to_do",version:4,type:"to_do",parent_table:"block",parent_id:"root",alive:!0}}})}function w(){return u.Ao.create({block:{root:{id:"root",version:0,type:"button",format:{automation_id:"automation"}}},automation:{automation:{id:"automation",parent_id:"root",parent_table:p.iU,alive:!0,status:"active",trigger:{id:d.Il(),type:"button"},action_ids:[],properties:{name:""}}}})}const x=(0,f.defineMessages)({namePropertyTitle:{defaultMessage:"Name",id:"blockTemplates.table.namePropertyTitle"},tagsPropertyTitle:{defaultMessage:"Tags",id:"blockTemplates.table.tagsPropertyTitle"}});const I=(0,f.defineMessages)({responderPropertyTitle:{defaultMessage:"Respondent",id:"blockTemplates.form.responderPropertyTitle"},createdTimePropertyName:{defaultMessage:"Created time",id:"blockTemplates.form.createdTimePropertyName"},formInitialQuestionPropertyTitle:{defaultMessage:"Question 1",id:"blockTemplates.form.formInitialQuestionPropertyTitle"},formInitialQuestionPropertySelect:{defaultMessage:"Question 2",id:"blockTemplates.form.formInitialQuestionPropertySelect"},formInitialQuestionPropertySelectOption1:{defaultMessage:"Option 1",id:"blockTemplates.form.formInitialQuestionPropertySelectOption1"},formInitialQuestionPropertySelectOption2:{defaultMessage:"Option 2",id:"blockTemplates.form.formInitialQuestionPropertySelectOption2"},formInitialQuestionPropertySelectOption3:{defaultMessage:"Option 3",id:"blockTemplates.form.formInitialQuestionPropertySelectOption3"}});function C(e){const{isInline:t,name:n}=e,o=(0,v.ZP)(),r=(0,v.ZP)(),i=(0,v.ZP)(),a=(0,v.ZP)(),s=(0,v.ZP)(),l=(0,v.ZP)();return u.Ao.create({block:{root:{id:"root",type:t?"collection_view":"collection_view_page",collection_id:"collection",format:{collection_pointer:{table:m.vF,id:"collection"}},view_ids:[],alive:!0}},collection:{collection:{id:"collection",name:n,schema:{title:{name:b.default.formatMessage(I.formInitialQuestionPropertyTitle),type:"title"},[o]:{name:b.default.formatMessage(I.responderPropertyTitle),type:"created_by"},[r]:{name:b.default.formatMessage(I.createdTimePropertyName),type:"created_time"},[i]:{name:b.default.formatMessage(I.formInitialQuestionPropertySelect),type:"select",options:[{id:a,value:b.default.formatMessage(I.formInitialQuestionPropertySelectOption1),color:"blue"},{id:s,value:b.default.formatMessage(I.formInitialQuestionPropertySelectOption2),color:"yellow"},{id:l,value:b.default.formatMessage(I.formInitialQuestionPropertySelectOption3),color:"red"}]}},format:{},parent_id:"root",parent_table:"block",alive:!0}}})}function T(e){const{isInline:t,name:n}=e,o=(0,v.ZP)();return u.Ao.create({block:{root:{id:"root",type:t?"collection_view":"collection_view_page",collection_id:"collection",format:{collection_pointer:{table:m.vF,id:"collection"}},view_ids:["view"],alive:!0},item_1:{id:"item_1",type:"page",parent_id:"collection",parent_table:"collection",alive:!0},item_2:{id:"item_2",type:"page",parent_id:"collection",parent_table:"collection",alive:!0},item_3:{id:"item_3",type:"page",parent_id:"collection",parent_table:"collection",alive:!0}},collection_view:{view:{id:"view",version:0,type:"table",format:{collection_pointer:{table:m.vF,id:"collection"},table_properties:[{property:"title",visible:!0,width:276},{property:o,visible:!0}],table_wrap:!0},page_sort:["item_1","item_2","item_3"],parent_id:"root",parent_table:"block",alive:!0}},collection:{collection:{id:"collection",name:n,schema:{title:{name:b.default.formatMessage(x.namePropertyTitle),type:"title"},[o]:{name:b.default.formatMessage(x.tagsPropertyTitle),type:"multi_select"}},format:{collection_page_properties:[{property:o,visible:!0}]},parent_id:"root",parent_table:"block",alive:!0}}})}const M=(0,f.defineMessages)({viewTitle:{defaultMessage:"Board view",id:"blockTemplates.board.viewTitle"},namePropertyTitle:{defaultMessage:"Name",id:"blockTemplates.board.namePropertyTitle"},assignPropertyTitle:{defaultMessage:"Assign",id:"blockTemplates.board.assignPropertyTitle"},statusPropertyTitle:{defaultMessage:"Status",id:"blockTemplates.board.statusPropertyTitle"},card1Title:{defaultMessage:"Card 1",id:"blockTemplates.board.card1Title"},card2Title:{defaultMessage:"Card 2",id:"blockTemplates.board.card2Title"},card3Title:{defaultMessage:"Card 3",id:"blockTemplates.board.card3Title"}});const P=(0,f.defineMessages)({viewTitle:{defaultMessage:"Calendar view",id:"blockTemplates.calendar.viewTitle"},namePropertyTitle:{defaultMessage:"Name",id:"blockTemplates.calendar.namePropertyTitle"},datePropertyTitle:{defaultMessage:"Date",id:"blockTemplates.calendar.datePropertyTitle"},tagsPropertyTitle:{defaultMessage:"Tags",id:"blockTemplates.calendar.tagsPropertyTitle"}});const A=(0,f.defineMessages)({viewTitle:{defaultMessage:"Timeline view",id:"blockTemplates.timeline.viewTitle"},datePropertyTitle:{defaultMessage:"Date",id:"blockTemplates.timeline.datePropertyTitle"}});const R=(0,f.defineMessages)({viewTitle:{defaultMessage:"Gallery view",id:"blockTemplates.gallery.viewTitle"},namePropertyTitle:{defaultMessage:"Name",id:"blockTemplates.gallery.namePropertyTitle"},tagsPropertyTitle:{defaultMessage:"Tags",id:"blockTemplates.gallery.tagsPropertyTitle"},createdPropertyTitle:{defaultMessage:"Created",id:"blockTemplates.gallery.createdPropertyTitle"},page1Title:{defaultMessage:"Page 1",id:"blockTemplates.gallery.page1Title"},page2Title:{defaultMessage:"Page 2",id:"blockTemplates.gallery.page2Title"},page3Title:{defaultMessage:"Page 3",id:"blockTemplates.gallery.page3Title"},page1TodoTitle:{defaultMessage:"To-do",id:"blockTemplates.gallery.page1TodoTitle"},page1CompletedTodoTitle:{defaultMessage:"Completed To-do",id:"blockTemplates.gallery.page1CompletedTodoTitle"}});const D=(0,f.defineMessages)({viewTitle:{defaultMessage:"List view",id:"blockTemplates.list.viewTitle"},namePropertyTitle:{defaultMessage:"Name",id:"blockTemplates.list.namePropertyTitle"},tagsPropertyTitle:{defaultMessage:"Tags",id:"blockTemplates.list.tagsPropertyTitle"},createdPropertyTitle:{defaultMessage:"Created",id:"blockTemplates.list.createdPropertyTitle"},page1Title:{defaultMessage:"Page 1",id:"blockTemplates.list.page1Title"},page2Title:{defaultMessage:"Page 2",id:"blockTemplates.list.page2Title"},page3Title:{defaultMessage:"Page 3",id:"blockTemplates.list.page3Title"}});function B(e){const{environment:t,isInline:n,viewType:d,name:p,chartType:g}=e;return"table"===d?T({environment:t,isInline:n,name:p}):"board"===d?function(e){const{isInline:t,name:n}=e,o=(0,v.ZP)(),r=(0,v.ZP)();return u.Ao.create({block:{root:{id:"root",type:t?"collection_view":"collection_view_page",collection_id:"collection",format:{collection_pointer:{table:m.vF,id:"collection"}},view_ids:["view"],alive:!0},item_1:{id:"item_1",type:"page",parent_id:"collection",parent_table:"collection",alive:!0,properties:{title:[[b.default.formatMessage(M.card1Title)]]}},item_2:{id:"item_2",type:"page",parent_id:"collection",parent_table:"collection",alive:!0,properties:{title:[[b.default.formatMessage(M.card2Title)]]}},item_3:{id:"item_3",type:"page",parent_id:"collection",parent_table:"collection",alive:!0,properties:{title:[[b.default.formatMessage(M.card3Title)]]}}},collection_view:{view:{id:"view",version:0,type:"board",name:b.default.formatMessage(M.viewTitle),query2:{aggregations:[{aggregator:"count"}]},format:{collection_pointer:{table:m.vF,id:"collection"},board_columns_by:{property:o,type:"status",groupBy:"option",sort:{type:"ascending"}},board_columns:[{property:o,value:{type:"status",value:{type:"by_option",option:b.default.formatMessage(s.i9.statusOptionNotStarted)}}},{property:o,value:{type:"status",value:{type:"by_option",option:b.default.formatMessage(s.i9.statusOptionInProgress)}}},{property:o,value:{type:"status",value:{type:"by_option",option:b.default.formatMessage(s.i9.statusOptionDone)}}}],board_properties:[{property:o,visible:!1},{property:r,visible:!0}]},page_sort:["item_1","item_2","item_3"],parent_id:"root",parent_table:"block",alive:!0}},collection:{collection:{id:"collection",name:n,schema:{title:{name:b.default.formatMessage(M.namePropertyTitle),type:"title"},[r]:{name:b.default.formatMessage(M.assignPropertyTitle),type:"person"},[o]:(0,i.I4)(b.default.formatMessage(M.statusPropertyTitle),b.default.getIntl())},format:{collection_page_properties:[{property:o,visible:!0},{property:r,visible:!0}]},parent_id:"root",parent_table:"block",alive:!0}}})}({environment:t,isInline:n,name:p}):"calendar"===d?function(e){const{isInline:t,name:n}=e,o=(0,v.ZP)(),r=(0,v.ZP)();return u.Ao.create({block:{root:{id:"root",type:t?"collection_view":"collection_view_page",collection_id:"collection",format:{collection_pointer:{table:m.vF,id:"collection"}},view_ids:["view"],alive:!0}},collection_view:{view:{id:"view",version:0,type:"calendar",name:b.default.formatMessage(P.viewTitle),format:{collection_pointer:{table:m.vF,id:"collection"}},query2:{calendar_by:o},parent_id:"root",parent_table:"block",alive:!0}},collection:{collection:{id:"collection",name:n,schema:{title:{name:b.default.formatMessage(P.namePropertyTitle),type:"title"},[o]:{name:b.default.formatMessage(P.datePropertyTitle),type:"date"},[r]:{name:b.default.formatMessage(P.tagsPropertyTitle),type:"multi_select"}},parent_id:"root",parent_table:"block",alive:!0}}})}({environment:t,isInline:n,name:p}):"list"===d?function(e){const{isInline:t,name:n}=e,o=(0,v.ZP)(),r=(0,v.ZP)();return u.Ao.create({block:{root:{id:"root",type:t?"collection_view":"collection_view_page",collection_id:"collection",format:{collection_pointer:{table:m.vF,id:"collection"}},view_ids:["view"],alive:!0},item_1:{id:"item_1",type:"page",parent_id:"collection",parent_table:"collection",alive:!0,properties:{title:[[b.default.formatMessage(D.page1Title)]]}},item_2:{id:"item_2",type:"page",parent_id:"collection",parent_table:"collection",alive:!0,properties:{title:[[b.default.formatMessage(D.page2Title)]]}},item_3:{id:"item_3",type:"page",parent_id:"collection",parent_table:"collection",alive:!0,properties:{title:[[b.default.formatMessage(D.page3Title)]]}}},collection_view:{view:{id:"view",version:0,type:"list",name:b.default.formatMessage(D.viewTitle),query2:{aggregations:[{aggregator:"count"}]},format:{collection_pointer:{table:m.vF,id:"collection"},list_properties:[{property:o,visible:!0}]},page_sort:["item_1","item_2","item_3"],parent_id:"root",parent_table:"block",alive:!0}},collection:{collection:{id:"collection",name:n,schema:{title:{name:b.default.formatMessage(D.namePropertyTitle),type:"title"},[o]:{name:b.default.formatMessage(D.tagsPropertyTitle),type:"multi_select",options:[]},[r]:{name:b.default.formatMessage(D.createdPropertyTitle),type:"created_time"}},format:{collection_page_properties:[{property:r,visible:!0},{property:o,visible:!0}]},parent_id:"root",parent_table:"block",alive:!0}}})}({environment:t,isInline:n,name:p}):"gallery"===d?function(e){const{isInline:t,name:n}=e,o=(0,v.ZP)(),r=(0,v.ZP)();return u.Ao.create({block:{root:{id:"root",type:t?"collection_view":"collection_view_page",collection_id:"collection",format:{collection_pointer:{table:m.vF,id:"collection"}},view_ids:["view"],alive:!0},item_1:{id:"item_1",type:"page",parent_id:"collection",parent_table:"collection",alive:!0,properties:{title:[[b.default.formatMessage(R.page1Title)]]},content:["to_do_1","to_do_2"]},item_2:{id:"item_2",type:"page",parent_id:"collection",parent_table:"collection",alive:!0,properties:{title:[[b.default.formatMessage(R.page2Title)]]}},item_3:{id:"item_3",type:"page",parent_id:"collection",parent_table:"collection",alive:!0,properties:{title:[[b.default.formatMessage(R.page3Title)]]}},to_do_1:{id:"to_do_1",type:"to_do",parent_id:"item_1",parent_table:"block",alive:!0,properties:{title:[[b.default.formatMessage(R.page1TodoTitle)]]}},to_do_2:{id:"to_do_2",type:"to_do",parent_id:"item_1",parent_table:"block",alive:!0,properties:{title:[[b.default.formatMessage(R.page1CompletedTodoTitle)]],checked:[["Yes"]]}}},collection_view:{view:{id:"view",version:0,type:"gallery",name:b.default.formatMessage(R.viewTitle),query2:{aggregations:[{aggregator:"count"}]},format:{collection_pointer:{table:m.vF,id:"collection"},gallery_cover:{type:"page_content"}},page_sort:["item_1","item_2","item_3"],parent_id:"root",parent_table:"block",alive:!0}},collection:{collection:{id:"collection",name:n,schema:{title:{name:b.default.formatMessage(R.namePropertyTitle),type:"title"},[o]:{name:b.default.formatMessage(R.tagsPropertyTitle),type:"multi_select",options:[]},[r]:{name:b.default.formatMessage(R.createdPropertyTitle),type:"created_time"}},format:{collection_page_properties:[{property:r,visible:!0},{property:o,visible:!0}]},parent_id:"root",parent_table:"block",alive:!0}}})}({environment:t,isInline:n,name:p}):"timeline"===d?function(e){const{isInline:t,name:n}=e,r=(0,v.ZP)(),s=(0,v.ZP)(),d=(0,v.ZP)();return u.Ao.create({block:{root:{id:"root",type:t?"collection_view":"collection_view_page",collection_id:"collection",format:{collection_pointer:{table:m.vF,id:"collection"}},view_ids:["view"],alive:!0},item_1:{id:"item_1",type:"page",parent_id:"collection",parent_table:"collection",properties:{title:[[b.default.formatMessage(M.card1Title)]],[r]:(0,a.d7)((0,l.fZ)(o.ou.now().minus({days:5}).startOf("day").valueOf(),o.ou.now().minus({days:1}).startOf("day").valueOf(),(0,c.r)()))},alive:!0},item_2:{id:"item_2",type:"page",parent_id:"collection",parent_table:"collection",properties:{title:[[b.default.formatMessage(M.card2Title)]],[r]:(0,a.d7)((0,l.fZ)(o.ou.now().minus({days:3}).startOf("day").valueOf(),o.ou.now().plus({days:1}).startOf("day").valueOf(),(0,c.r)()))},alive:!0},item_3:{id:"item_3",type:"page",parent_id:"collection",parent_table:"collection",properties:{title:[[b.default.formatMessage(M.card3Title)]],[r]:(0,a.d7)((0,l.fZ)(o.ou.now().minus({days:1}).startOf("day").valueOf(),o.ou.now().plus({days:3}).startOf("day").valueOf(),(0,c.r)()))},alive:!0}},collection_view:{view:{id:"view",version:0,type:"timeline",name:b.default.formatMessage(A.viewTitle),format:{collection_pointer:{table:m.vF,id:"collection"},timeline_show_table:!t,timeline_properties:[{property:"title",visible:!0}],timeline_table_properties:[{property:"title",visible:!0,width:280},{property:r,visible:!1,width:180},{property:s,visible:!1,width:180},{property:d,visible:!1,width:180}]},page_sort:["item_1","item_2","item_3"],parent_id:"root",parent_table:"block",alive:!0}},collection:{collection:{id:"collection",name:n,schema:{title:{name:b.default.formatMessage(M.namePropertyTitle),type:"title"},[r]:{name:b.default.formatMessage(A.datePropertyTitle),type:"date"},[s]:{name:b.default.formatMessage(M.assignPropertyTitle),type:"person"},[d]:(0,i.I4)(b.default.formatMessage(M.statusPropertyTitle),b.default.getIntl())},format:{collection_page_properties:[{property:r,visible:!0},{property:s,visible:!0},{property:d,visible:!0}]},parent_id:"root",parent_table:"block",alive:!0}}})}({environment:t,isInline:n,name:p}):"page"!==d?"chart"===d?function(e){const{isInline:t,name:n,chartType:o}=e,s=(0,v.ZP)(),d=(0,v.ZP)(),p=(0,i.I4)(b.default.formatMessage(M.statusPropertyTitle),b.default.getIntl()),g="line"===o?{title:{name:b.default.formatMessage(x.namePropertyTitle),type:"title"},[d]:{name:b.default.formatMessage(P.datePropertyTitle),type:"date"}}:{title:{name:b.default.formatMessage(x.namePropertyTitle),type:"title"},[s]:p},f="donut"===o?(0,r.dq)({collectionSchema:g}):(0,r.K0)({collectionSchema:g,axisChartType:o}),h=(0,c.r)(),y={type:"date",start_date:(0,l.BC)((0,l.Uu)(h).minus({days:4}))},_={type:"date",start_date:(0,l.BC)((0,l.Uu)(h).minus({days:3}))},S={type:"date",start_date:(0,l.BC)((0,l.Uu)(h).minus({days:2}))},k={type:"date",start_date:(0,l.BC)((0,l.Uu)(h).minus({days:1}))},w="line"===o?[{[d]:(0,a.d7)(y)},{[d]:(0,a.d7)(_)},{[d]:(0,a.d7)(S)},{[d]:(0,a.d7)(S)},{[d]:(0,a.d7)(S)},{[d]:(0,a.d7)(k)}]:[{[s]:[[p.options.at(0).value]]},{[s]:[[p.options.at(1).value]]},{[s]:[[p.options.at(1).value]]},{[s]:[[p.options.at(2).value]]}];return u.Ao.create({block:{root:{id:"root",type:t?"collection_view":"collection_view_page",collection_id:"collection",format:{collection_pointer:{table:m.vF,id:"collection"}},view_ids:["view"],alive:!0},item_1:{id:"item_1",type:"page",parent_id:"collection",parent_table:"collection",properties:w[0],alive:!0},item_2:{id:"item_2",type:"page",parent_id:"collection",parent_table:"collection",properties:w[1],alive:!0},item_3:{id:"item_3",type:"page",parent_id:"collection",parent_table:"collection",properties:w[2],alive:!0},item_4:{id:"item_4",type:"page",parent_id:"collection",parent_table:"collection",properties:w[3],alive:!0},..."line"===o&&{item_5:{id:"item_5",type:"page",parent_id:"collection",parent_table:"collection",properties:w[4],alive:!0},item_6:{id:"item_6",type:"page",parent_id:"collection",parent_table:"collection",properties:w[5],alive:!0}}},collection_view:{view:{id:"view",version:0,type:"chart",format:{collection_pointer:{table:m.vF,id:"collection"},chart_config:f,subitem_display_mode:"flattened",hide_linked_collection_name:!0},page_sort:[],parent_id:"root",parent_table:"block",alive:!0}},collection:{collection:{id:"collection",name:n,schema:g,format:{collection_page_properties:[{property:s,visible:!0}]},parent_id:"root",parent_table:"block",alive:!0}}})}({environment:t,isInline:n,name:p,chartType:g}):void("form_editor"!==d&&(0,y.t1)(d)):void 0}function E(e){const{isInline:t,viewType:n,chartType:o}=e;return u.Ao.create({block:{root:{id:"root",type:t?"collection_view":"collection_view_page",view_ids:["view"],alive:!0}},collection_view:{view:{id:"view",version:0,type:n,parent_id:"root",parent_table:"block",alive:!0,format:o?{chart_config:{type:"placeholder",placeHolderType:o}}:{}}}})}function F(e){const{isInline:t,viewType:n,integrationId:o}=e;return u.Ao.create({block:{root:{id:"root",type:t?"collection_view":"collection_view_page",collection_id:"collection",format:{collection_pointer:{table:m.vF,id:"collection"}},view_ids:["view"],alive:!0}},collection:{collection:{id:"collection",name:void 0,schema:{},format:{is_placeholder:!0,integration_id:o},parent_id:"root",parent_table:"block",alive:!0}},collection_view:{view:{id:"view",version:0,type:n,format:{collection_pointer:{table:m.vF,id:"collection"}},parent_id:"root",parent_table:"block",alive:!0}}})}function Z(){return u.Ao.create({block:{root:{id:"root",type:"transclusion_container",content:["empty_text"],alive:!0},empty_text:{id:"empty_text",type:"text",parent_id:"root",parent_table:"block",alive:!0}}})}function U(e){return u.Ao.create({block:{root:{id:"root",type:"ai_block",content:[],alive:!0,format:{ai_prompt_key:e}}}})}function V(e){const t=h.DZ(e,(e=>`column${e+1}`));return u.Ao.create({block:{root:{id:"root",type:"column_list",content:t,alive:!0},...Object.assign({},...t.map((t=>{const n=`${t}_text`;return{[t]:{id:t,type:"column",parent_id:"root",parent_table:"block",content:[n],alive:!0,format:{column_ratio:1/e}},[n]:{id:n,type:"text",parent_id:t,parent_table:"block",alive:!0}}})))}})}function N(){const e=[(0,v.ZP)(),(0,v.ZP)()];return u.Ao.create({block:{root:{id:"root",type:"table",content:["row_1","row_2","row_3"],alive:!0,format:{table_block_column_order:e}},row_1:{id:"row_1",type:"table_row",parent_id:"root",parent_table:"block",alive:!0},row_2:{id:"row_2",type:"table_row",parent_id:"root",parent_table:"block",alive:!0},row_3:{id:"row_3",type:"table_row",parent_id:"root",parent_table:"block",alive:!0}}})}const O=(0,f.defineMessages)({tab1Title:{defaultMessage:"Tab 1",id:"blockTemplates.list.tab1Title"},tab2Title:{defaultMessage:"Tab 2",id:"blockTemplates.list.tab2Title"},tab3Title:{defaultMessage:"Tab 3",id:"blockTemplates.list.tab3Title"}});function L(){return u.Ao.create({block:{root:{id:"root",type:"tab",alive:!0,content:["tab1","tab2","tab3"]},tab1:{id:"tab1",parent_id:"root",parent_table:"block",type:"text",alive:!0,properties:{title:[[b.default.formatMessage(O.tab1Title)]]}},tab2:{id:"tab2",parent_id:"root",parent_table:"block",type:"text",alive:!0,properties:{title:[[b.default.formatMessage(O.tab2Title)]]}},tab3:{id:"tab3",parent_id:"root",parent_table:"block",type:"text",alive:!0,properties:{title:[[b.default.formatMessage(O.tab3Title)]]}}}})}function j(e){return u.Ao.create({[p.iU]:{root:{id:"root",type:e,format:{toggleable:!0}}}})}function K(e,t){return u.Ao.create({[p.iU]:{root:{id:"root",type:"code",properties:{title:g.TPx(t),language:g.TPx(e)}}}})}function z(){return u.Ao.create({[p.iU]:{root:{id:"root",type:"drawing",format:{drawing_value:void 0,block_page_width:!0,block_height:480}}}})}function q(){return _.default.checkGate({gateName:"create_v2_callouts"})?u.Ao.create({block:{root:{id:"root",type:"callout",content:["empty_text"],format:{callout_version:2},alive:!0},empty_text:{id:"empty_text",type:"text",parent_id:"root",parent_table:"block",alive:!0}}}):u.Ao.create({block:{root:{id:"root",type:"callout",alive:!0}}})}},843250:(e,t,n)=>{n.d(t,{$Ot:()=>T,$ji:()=>en,$nY:()=>It,AWi:()=>$t,A_D:()=>F,Apy:()=>pn,Aur:()=>bt,B8p:()=>Z,BEs:()=>Te,BKn:()=>He,BaY:()=>We,C18:()=>ze,CZG:()=>ye,C_N:()=>tn,Cjq:()=>gt,D$4:()=>it,Dkf:()=>Wt,EGJ:()=>Zt,Ep8:()=>b,F4o:()=>De,FJA:()=>G,FSd:()=>Je,FoE:()=>he,G6g:()=>le,GNl:()=>$,GZn:()=>In,GbT:()=>L,Gcz:()=>Bt,GfL:()=>Y,H9Z:()=>Sn,HKr:()=>re,HwD:()=>nn,I2F:()=>ne,I9j:()=>et,IAq:()=>vt,IG:()=>rn,Iiy:()=>gn,J2F:()=>_t,JR_:()=>Et,JiD:()=>i,JkF:()=>Me,K3y:()=>O,K4T:()=>Ot,KA2:()=>te,KLh:()=>N,LoZ:()=>se,Lzk:()=>kn,MD7:()=>V,MU2:()=>Ee,M_0:()=>mn,Mdu:()=>Ke,Mfh:()=>we,Mpz:()=>yt,MsS:()=>p,N7t:()=>fe,NFf:()=>ve,Nn$:()=>y,No6:()=>C,OE$:()=>vn,OK_:()=>g,Oau:()=>K,PBs:()=>h,Phn:()=>An,QS0:()=>A,QSt:()=>o,Qcf:()=>x,Qgj:()=>ut,Quo:()=>d,RG3:()=>Ve,RIA:()=>Xt,S94:()=>W,S9A:()=>_n,SD8:()=>xt,TAd:()=>Ge,TFu:()=>cn,TYv:()=>qe,U9U:()=>Pn,UBk:()=>U,Uhm:()=>mt,Uwd:()=>Ne,V6y:()=>Tt,VMO:()=>At,Voi:()=>ht,Wh_:()=>P,Wiy:()=>R,Wy1:()=>pt,Xgx:()=>st,Xj_:()=>m,Xjk:()=>xn,Xsh:()=>tt,Y3l:()=>Tn,Y6l:()=>Le,YHn:()=>J,YOJ:()=>Cn,YPt:()=>S,Z87:()=>ft,ZHw:()=>B,ZmO:()=>X,Zp2:()=>ln,_so:()=>Ct,a1k:()=>M,a6i:()=>pe,aL4:()=>Fe,afv:()=>Q,aiP:()=>a,alX:()=>r,b_f:()=>q,blN:()=>Ae,boI:()=>Xe,bqq:()=>kt,c7X:()=>Ut,cFM:()=>ot,dXl:()=>bn,euV:()=>I,exn:()=>ke,f0e:()=>un,f8P:()=>ce,fHd:()=>k,fOh:()=>yn,fe0:()=>Ce,gGc:()=>ee,gec:()=>ct,gjL:()=>oe,gug:()=>c,hBn:()=>v,hIF:()=>on,hKO:()=>me,hzx:()=>ie,i25:()=>St,irE:()=>Lt,j35:()=>Be,jWx:()=>Oe,kDE:()=>Kt,kUP:()=>Pt,l24:()=>Re,lIT:()=>D,lmr:()=>Mn,mJW:()=>_,mSZ:()=>E,mWS:()=>Dt,myM:()=>at,nM$:()=>Vt,nU_:()=>be,o4s:()=>qt,ovr:()=>zt,p0b:()=>j,p1Q:()=>w,p4m:()=>de,pMC:()=>l,pg$:()=>sn,q1J:()=>Pe,qSF:()=>Qe,qnV:()=>fn,qr0:()=>$e,qxR:()=>je,rIE:()=>Ue,rIj:()=>rt,rIs:()=>an,rKl:()=>s,rTm:()=>Qt,rVO:()=>Jt,rcG:()=>_e,rli:()=>xe,s$o:()=>nt,sbt:()=>Nt,sqL:()=>jt,srZ:()=>z,tQh:()=>H,tXr:()=>ge,tfM:()=>Mt,ulv:()=>wn,wFE:()=>ae,wG0:()=>dn,wKH:()=>f,wXs:()=>Ft,wnm:()=>lt,x2W:()=>dt,x4y:()=>u,x9t:()=>Gt,xvU:()=>Yt,y4j:()=>hn,yNE:()=>Ze,ykc:()=>Se,zYS:()=>Ie,z_z:()=>Ht,zar:()=>Ye,zov:()=>ue,zrM:()=>wt,zwY:()=>Rt});const o="notion-cursor-default",r="hidden",i="notion-fadein",a="notion-mobile",s="notion-fadein-fast",l="notion-desktop-drag-area",c="notion-front-page",d="analytics-scroll-point",u="notion-login",p="notion-light-theme",m="notion-dark-theme",g="notion-scroller",f="vertical",h="horizontal",v="ignore-scrolling-container",y="notion-history-modal",b="notion-block-resizer",_="notion-overlay-container",S="notion-default-overlay-container",k="notion-page-template-modal",w="notion-peek-renderer",x="notion-text-action-menu",I="notion-selectable",C="notion-selectable-halo",T="notion-selectable-hover-menu-item",M="notion-suggest-remove",P="notion-focusable-within",A="notion-page-content",R="notion-frame",D="notion-topbar",B="notion-topbar-mobile",E="notion-topbar-more-button",F="notion-topbar-action-buttons",Z="notion-share-menu",U="notion-share-menu-publish-tab",V="notion-topbar-share-menu",N="notion-updates-menu",O="notion-topbar-updates-button",L="notion-topbar-favorite-button",j="notion-topbar-comments-button",K="notion-search-menu",z="notion-embed-menu",q="notion-unfurling-menu",H="notion-media-menu",G="notion-invite",W="notion-record-icon",$="notion-calendar-header-days",Y="notion-board-group",Q="notion-block-permission-settings-workspace-access",J="notion-block-permission-settings-team-access",X="notion-block-permission-settings-team-access",ee="notion-block-permission-settings-group-access",te="notion-page-view-discussion",ne="notion-updates-button-mentions",oe="notion-updates-button-all-updates",re="notion-updates-button-archive",ie="notion-discussion-input-edit-existing-comment",ae="notion-discussion-input",se="notion-discussion-reply-menu",le="notion-comment-overflow-menu",ce="notion-shimmer",de="notion-link",ue="ai-block",pe="notion-sharing-permission-role-select",me="notion-language-picker",ge="notion-dictation-language-picker",fe="notion-cookie-selector",he="notion-activity-section-icon",ve="notion-activity-section-header",ye="notion-activity-section-time",be="notion-activity-section-children",_e="notion-sidebar",Se="notion-sidebar-mobile",ke="notion-open-sidebar",we="notion-close-sidebar",xe="notion-sidebar-switcher",Ie="notion-space-settings",Ce="notion-outliner-bookmarks",Te="notion-outliner-workspace",Me="notion-outliner-shared",Pe="notion-outliner-private",Ae="notion-outliner-offline",Re="notion-outliner-team",De="notion-outliner-bookmarks-header",Be="notion-outliner-workspace-header",Ee="notion-outliner-shared-header",Fe="notion-outliner-private-header",Ze="notion-outliner-offline-header",Ue="notion-outliner-team-header",Ve="notion-outliner-joined-team-header",Ne="notion-outliner-unjoined-team-header",Oe="notion-outliner-search-team-header",Le="notion-outliner-public-page-template-includes-header",je="notion-outliner-team-context-menu-button",Ke="notion-outliner-team-context-menu",ze="notion-updates-menu",qe="notion-sidebar-trash-menu",He="notion-password-modal",Ge="notion-scim-table-revoke-button",We="notion-subscription-checkout-title",$e="notion-subscription-checkout-description",Ye="notion-update-sidebar",Qe="notion-update-sidebar-tab-comments-filter-control",Je="notion-update-sidebar-tab-comments-filter-button-open",Xe="notion-update-sidebar-tab-comments-filter-button-resolved",et="notion-update-sidebar-tab-comments-header",tt="notion-update-sidebar-tab-comments-comments-scroller",nt="notion-update-sidebar-tab-comments-discussion-item",ot="notion-update-sidebar-tab-updates-header",rt="notion-team-settings-modal",it="notion-add-members-modal",at="notion-new-team",st="notion-use-case-onboarding-profile",lt="notion-use-case-onboarding-persona-survey",ct="notion-workspace-choose",dt="notion-workspace-plan-choose",ut="notion-workspace-create",pt="notion-workspace-invite",mt="notion-onboarding-error",gt="notion-onboarding-popup",ft="notion-onboarding-button",ht="notion-onboarding-plan-type-team",vt="notion-onboarding-persona-survey-persona",yt="notion-onboarding-persona-survey-role",bt="notion-onboarding-persona-survey-companysize",_t="notion-onboarding-persona-survey-usecases",St="notion-onboarding-timed-trial-upsell",kt="notion-onboarding-select-tools",wt="notion-onboarding-workflow-template-properties",xt="notion-onboarding-workflow-template-views",It="notion-onboarding-workflow-template-record-titles",Ct="notion-table-view",Tt="notion-table-view-add-column",Mt="notion-table-view-add-row",Pt="notion-table-view-header-row",At="notion-table-view-header-cell",Rt="notion-table-view-row",Dt="notion-table-view-cell",Bt="notion-table-view-empty-placeholder",Et="notion-table-view-drag-and-fill-handle",Ft="notion-table-view-frozen-column-repositioner",Zt="notion-board-view",Ut="notion-calendar-view",Vt="notion-list-view",Nt="notion-gallery-view",Ot="notion-collection-item",Lt="notion-calendar-view-day",jt="notion-collection-view-item-add",Kt="notion-timeline-view",zt="notion-timeline-item",qt="notion-timeline-item-row",Ht="notion-timeline-item-properties",Gt="notion-collection-view-body",Wt="notion-view-settings-sidebar",$t="notion-layout-add-module-button",Yt="notion-collection-edit-view",Qt="notion-collection-view-tab-button",Jt="notion-collection-add-view",Xt="notion-collection-automation-edit-view",en="notion-template-picker-item",tn="notion-template-picker-item-action-menu",nn="draggable-ghost-section",on="forms-properties-load-more",rn="forms-share-menu",an="developer-integrations-container",sn="developer-integrations-list",ln="developer-integration-create",cn="developer-integration-view",dn="developer-integration-not-found",un="notion-table-row-selector",pn="notion-table-column-selector",mn="notion-table-row",gn="notion-table-cell",fn="notion-table-cell-text",hn="notion-table-selection-overlay",vn="notion-table-tbody-selectable",yn="notion-table-content",bn="notion-temporary-comment",_n="notion-margin-discussion-item",Sn="notion-transclusion-block-component",kn="notion-transclusion-block-halo",wn="search-query-result-item",xn="search-result-body-section-title",In="search-result-mobile-body-scroller",Cn="notion-completions-feedback-popup",Tn="assistant-grouped-edit-chat-container",Mn="notion-help-button",Pn="notion-ai-button",An="notion-assistant-corner-origin-container"},847853:(e,t,n)=>{n.d(t,{D:()=>i});var o=n(313991),r=n(325666);function i(e){return r.D(e,o.locale)}},849117:(e,t,n)=>{n.d(t,{$5:()=>I,$N:()=>P,Cf:()=>T,Gb:()=>w,Ic:()=>M,JS:()=>A,Rr:()=>C,kP:()=>S,pZ:()=>_,uV:()=>x});var o=n(14577),r=n(925785),i=n(881730),a=n(761202),s=n(786433),l=n(901274),c=n(842875),d=n(186517),u=n(709291),p=n(940470),m=n(401898),g=n(385555),f=n(206258),h=n(535057),v=n(721429),y=n(120315);const b=(0,u.defineMessages)({openPageOrUrl:{id:"automations.actions.openPageOrUrl",defaultMessage:"Open page or URL"},openPageOrUrlDescription:{id:"automations.actions.openPageOrUrlDescription",defaultMessage:"Opens a specified page or URL."}}),_=30;function S(e){const{automationStore:t,contextType:n,intl:o}=e,r=t.getModel();if(!(0,m.$K)(r))return{error:new i.MO("Missing automation model")};const a=t.getActionStores().map((e=>e.getModel())).filter(m.$K);if(a.length!==r.getActionIds().length)return{error:new i.MO("Missing automation action models")};let l;if("button_block"===n){const e=function(){const e=(0,v.np)();if(!e)return;if((e.isPageBlock()||e.isCollectionViewPageWithContent())&&e.isDefined())return e.getModel()}();if(!e)return{error:new i.MO("Missing page block model")};l={actionModels:a,automationModel:r,contextType:n,getRecordModel:t.getRecordModel,getRecordRole:t.getRecordRole,intl:o,pageBlockModel:e,userTimeZone:(0,c.r)(),valueTypes:[]}}else l={actionModels:a,automationModel:r,contextType:n,getRecordModel:t.getRecordModel,getRecordRole:t.getRecordRole,intl:o,userTimeZone:(0,c.r)(),valueTypes:[]};return(0,s.E_)(l)}const k=new WeakMap;function w(e){const t=k.get(e.automationStore);if(t)return t;{const t=new o.ZP((()=>function(e){const t=e.automationStore.getModel();if(!t)return{editPermissionStatus:"unknown",executionPermissionStatus:"unknown",typecheckResult:void 0};const n=e.automationStore.getActionStores().map((e=>e.getModel()));if(!n.every((0,m.AO)((e=>(0,m.$K)(e)?{true:e}:{false:e}))))return{editPermissionStatus:"insufficient",executionPermissionStatus:"insufficient",typecheckResult:void 0};const o=S({automationStore:e.automationStore,contextType:e.type,intl:e.intl});if(p.x.isFail(o))return{editPermissionStatus:"unknown",executionPermissionStatus:"unknown",typecheckResult:o};const i={automationModel:t};for(const s of n){const t=(0,r.z)(s.getType()).getExecutionDependencies(i,s),n=(0,a.TD)({getRecordModel:e.parentRecordStore.getRecordModel,permissions:t,typecheckContextValues:o.value.valueTypes});for(const r of n){const t=(0,f.Kv)(e.parentRecordStore,r.pointer).getRole();if(!t||(0,d.gr)(t,r.minimumRole))return{editPermissionStatus:"insufficient",executionPermissionStatus:"insufficient",typecheckResult:o}}}return{editPermissionStatus:"sufficient",executionPermissionStatus:Object.values(o.value.actionValidationFailures).some((e=>{const t=e??[];return 0!==t.length&&t.some((e=>(0,m.$K)(e.execute)&&!e.execute))}))?"insufficient":"sufficient",typecheckResult:o}}(e)),{debugName:"buttonAutomationAnalysisCachedStore"});return k.set(e.automationStore,t),t}}function x(e,t){var n;const o=e.getModel(),r=null===(n=e.getSpaceStore())||void 0===n?void 0:n.getModel(),i=e.getActionStores(),a=i.filter((e=>e.isDefined())).map((e=>e.getModel())).filter(m.$K);if(!o||a.length!==i.length)return;const s=(0,y.gM)(e.environment);return{automation:o,automationActions:a,checkExperimentGate:e=>g.default.checkGate({gateName:e}),checkExperimentGroup:e=>g.default.getGroup(e),contextType:t,checkType:"canAddAction",isSubscribed:(0,h.sX)(),spaceModel:r,assistantFeatureGate:s}}function I(e){const{automationStore:t,contextType:n,intl:o}=e,i=t.getValue(),s=t.getModel();if(!s||!i)return{editPermissionStatus:"unknown",reason:"missing_automation_model"};const c=t.getActionStores().map((e=>e.getModel()));if(!c.every((0,m.AO)((e=>(0,m.$K)(e)?{true:e}:{false:e}))))return{editPermissionStatus:"unknown",reason:"missing_automation_action_model"};const u=S({automationStore:t,contextType:n,intl:o});if(p.x.isFail(u))return{editPermissionStatus:"unknown",reason:"typecheck_error"};const g=c.length>0&&c.some((e=>!e.isType("slack_notification")));if(s.isType("event")&&g&&!(0,h.sX)())return{editPermissionStatus:"insufficient",reason:"free_workspace"};const v={automationModel:s},y=c.filter((e=>e.isType("slack_notification")));for(const l of y){const e=(0,r.z)(l.getType()).getExecutionDependencies(v,l),n=(0,a.TD)({getRecordModel:t.getRecordModel,permissions:e,typecheckContextValues:u.value.valueTypes});for(const o of n){const e=(0,f.Kv)(t,o.pointer).getRole();if(!e||(0,d.gr)(e,o.minimumRole))return{actionId:l.id,editPermissionStatus:"insufficient",reason:"missing_permissions"}}}const b=(0,l.fz)({automationValue:i,actionValues:t.getActionStores().map((e=>({config:e.getConfig(),type:e.getType()})))});for(const r of b){const e=t.getRecordRole(r.pointer);if(!e||(0,d.gr)(e,r.minimumRequiredRole))return{editPermissionStatus:"insufficient",reason:"missing_permissions"}}return{editPermissionStatus:"sufficient"}}function C(e){const{contextType:t,environment:n}=e,{device:o}=n,r=o.isIOS&&o.isMobileNative;return"event"===t&&!r}function T(e){const{tab:t}=e;return"automationSettings"===(null==t?void 0:t.type)||"automationCreateSettings"===(null==t?void 0:t.type)||"automationEditSettings"===(null==t?void 0:t.type)}function M(){return g.default.checkGate({gateName:"automations_open_url_action"})}function P(e){const t=(0,r.z)(e);return"open_page"===e&&M()?{...t.display,name:b.openPageOrUrl,description:b.openPageOrUrlDescription}:t.display}function A(e){const t=(null==e?void 0:e.getActionStores())??[];for(const o of t)if(o.isType("open_page")){var n;const e=o.getConfig();if("url"===(null==e||null===(n=e.target)||void 0===n?void 0:n.type))return e.target.url}}},397004:(e,t,n)=>{n.d(t,{CN:()=>P,Gz:()=>M,H_:()=>b,IX:()=>A,Me:()=>C,Mj:()=>I,Nq:()=>w,OC:()=>v,Pi:()=>T,RL:()=>S,Zh:()=>k,m1:()=>R,mu:()=>E,ox:()=>_,qd:()=>y,tJ:()=>D,yU:()=>x,ze:()=>B});n(757658);var o=n(576205),r=n(399036),i=n(143690),a=n(10070),s=n(853504),l=n(293824),c=n(842875),d=n(653965),u=n(401898),p=n(940663),m=n(721429),g=n(717335),f=n(277181),h=n(433929);const v="notion://database/hide_subitems_filter";function y(e){const{schema:t,filters:n,getRecordModel:r}=e,i=[];for(const o of Object.keys(t)){const e=b({property:o,schema:t,getRecordModel:r});e&&i.push(e)}const a=i.filter((e=>!n.find((t=>(0,o.aN)(t.filter)&&t.filter.property===e.property))));return d.MR(a,(e=>{const n=t[e.property];return(null==n?void 0:n.name)||""}))}function b(e){const{property:t,schema:n,getRecordModel:o}=e;return{property:t,filter:(0,g.zZ)({property:t,schema:n,getRecordModel:o})}}function _(){return(e,t)=>{const n=!(0,o.Oo)(e.filter),r=!(0,o.Oo)(t.filter);return n&&r?0:n?-1:1}}function S(e){var t;const{collectionContextStore:n,applySubitemFilter:i,filterOutHideSubitemsQuickFilter:a}=e;let s=n.currentPropertyFiltersStore.state;const l=n.currentCombinatorFilterStore.state,c=i&&n.currentSubitemFormatStoreForUiDisplayStore.state,u=n.normalizedSchemaStore.state,p=c&&u[c.property],m=p&&"relation"===p.type&&(0,r.F0)(p)===(null===(t=n.collectionStore())||void 0===t?void 0:t.id)&&p.property,g=m?{property:m,filter:{operator:"is_empty"}}:void 0;a&&(s=s.filter((e=>e.id!==v)));const f=(0,o.OH)({propertyFilters:s,combinatorFilter:l,schema:u});return d.oA([g,...f])}function k(e,t){var n,r,a;const c=e.collectionViewStore();if(!c)return{combinatorFilter:void 0,filters:{moveOps:[],removed:[],updated:[],moved:[],added:[]},sorts:void 0};const u="persisted"===t?c.getQueryStore().getKeyStore("sort").getValue()||[]:(null===(n=e.normalizedQueryStore.state)||void 0===n?void 0:n.sort)||[],p=e.currentSortsStore.state,m="persisted"===t?c.getQueryStore().getKeyStore("filter").getValue():null===(r=e.normalizedQueryStore.state)||void 0===r?void 0:r.filter,g=e.currentCombinatorFilterStore.state,f="persisted"===t?(null===(a=c.getPropertyFiltersStore().getValue())||void 0===a?void 0:a.sort(_()))||[]:function(e){const t=e.normalizedSchemaStore.state,n=e.normalizedFormatStore.state.property_filters||[];return d.oA(n.filter((n=>{const r=(0,i.dN)(n.filter,t),a=e.collectionViewBlockStore();if(t[n.filter.property]&&r&&(0,o.J5)(t,n.filter.property,r.filter,null==a?void 0:a.getRecordModel))return r&&{id:n.id,filter:r}})).sort(_()))}(e),h=e.currentPropertyFiltersStore.state,v=f.map((e=>e.id)),y=h.map((e=>e.id)),{beforeOps:b,removeOps:S}=(0,l.q)(v,y),k=Array.from(S).filter((e=>!y.includes(e))),w=Object.keys(b).map((e=>({id:e,beforeId:b[e]}))),x=w.filter((e=>{let{id:t}=e;return v.includes(t)})).map((e=>{let{id:t}=e;return t})),I=w.filter((e=>{let{id:t}=e;return!v.includes(t)})).map((e=>{let{id:t}=e;return t})),C=h.filter((e=>f.find((t=>{if(e.id!==t.id)return!1;const n=d.Xh(t),o=d.Xh(e);return!d.Xy((0,s.Z)(o,"ignore-class-instances"),(0,s.Z)(n,"ignore-class-instances"))})))).map((e=>e.id));return{combinatorFilter:d.Xy(m,g)?void 0:{value:g},filters:{moveOps:w,removed:k,updated:C,moved:x,added:I},sorts:d.Xy(u,p)?void 0:{value:p}}}function w(e){const t=e.localStateDiffStore.state;return Boolean(t.filters.moved.length>0||t.filters.added.length>0||t.filters.removed.length>0||t.filters.updated.length>0||void 0!==t.combinatorFilter||void 0!==t.sorts)}function x(e){const t=e.localStateDiffStore.state;return Boolean(t.filters.moved.length>0||t.filters.added.length>0||t.filters.removed.length>0||t.filters.updated.length>0||void 0!==t.combinatorFilter)}function I(e){const t=e.localStateDiffStore.state;return Boolean(void 0!==t.sorts)}function C(e){return{property:(0,r.uS)(e),filter:{operator:"string_contains",value:{type:"exact",value:void 0}}}}function T(e){const t=e.currentCombinatorFilterStore.state,n=e.currentPropertyFiltersStore.state.filter((e=>!E(e.id))).map((e=>e.filter)),o=[...(null==t?void 0:t.filters)||[],...n];return{...t,filters:o,operator:"and"}}function M(e,t){const n=e.currentCombinatorFilterStore.state,o=e.currentPropertyFiltersStore.state.filter((e=>e.id!==t.id)),r=[...(null==n?void 0:n.filters)||[],t.filter];return{combinatorFilter:{operator:"and",...n,filters:r},propertyFilters:o}}function P(e,t,n,o){let r=n.filter((e=>"is_group"===e.type)).map((t=>e.find((e=>e.name===t.value)))).filter(u.$K),i=n.filter((e=>"is_option"===e.type)).map((e=>t.find((t=>t.value===e.value)))).filter(u.$K);for(const a of e){const e=a.optionIds??[];if(r.some((e=>e.id===a.id)))i=i.filter((t=>!e.includes(t.id)));else if(e.length>0){const t=i.filter((t=>!e.includes(t.id)));t.length+e.length===i.length&&(i=t,r=[...r,a])}}if("is_option"===o.type){const n=t.find((e=>e.value===o.value));if(!n)return;const a=i.filter((e=>e.id!==n.id));if(a.length<i.length)i=a;else{const o=e.find((e=>{var t;return null===(t=e.optionIds)||void 0===t?void 0:t.includes(n.id)})),a=r.find((e=>e.id===(null==o?void 0:o.id)));if(a){const e=t.filter((e=>{var t;return(null===(t=a.optionIds)||void 0===t?void 0:t.includes(e.id))&&e.id!==n.id}));r=r.filter((e=>e.id!==a.id)),i=[...i,...e]}else{i=[...i,n];const e=(null==o?void 0:o.optionIds)??[];if(o&&e.length>0){const t=i.filter((t=>!e.includes(t.id)));t.length+e.length===i.length&&(i=t,r=[...r,o])}}}}else if("is_group"===o.type){const t=e.find((e=>e.name===o.value));if(!t)return;const n=r.filter((e=>e.id!==t.id));if(n.length<r.length)r=n;else{const e=t.optionIds??[];r=[...r,t],i=i.filter((t=>!e.includes(t.id)))}}else(0,u.t1)(o.type);return[...r.map((e=>({type:"is_group",value:e.name}))),...i.map((e=>({type:"is_option",value:e.value})))]}function A(e){const{group:t,options:n,filterValues:o}=e,r=o.some((e=>"is_group"===e.type&&e.value===t.name)),i=n.filter((e=>{var n;return null===(n=t.optionIds)||void 0===n?void 0:n.includes(e.id)})),a=new Map;for(const d of i){const e=o.some((e=>"is_option"===e.type&&e.value===d.value))||r;a.set(d.id,e)}const s=Array.from(a.values()),l=s.some((e=>e)),c=s.every((e=>e))&&s.length>0;return{groupCheckState:!(!r&&!c)||!!l&&"partial",optionCheckedInfo:a}}function R(e){var t;const{collectionStore:n,collectionContextStore:r,environment:i}=e,s=r.relativeVariableStore.state,l=r.currentPropertyFiltersStore.state,d=r.currentCombinatorFilterStore.state,u=l.filter((e=>!(0,o.Oo)(e.filter))).map((e=>e.filter));if(0===u.length&&!d)return;const p=null==n?void 0:n.getModel(),g=null===(t=r.collectionViewStore())||void 0===t?void 0:t.getCollectionSource(),f=r.normalizedSchemaStore.state,v=r.collectionViewModuleContextStore.currentPageInRelatedCollectionId(),y={schema:p&&g?(0,a.Hs)(g.type,f,p):f,userId:i.currentUser.id,userTimeZone:(0,c.r)(),userStartOfWeek:m.AK.state,intl:h.default.getIntl(),relativeVariableResult:s,currentPageInRelatedCollection:v};return{filter:{filters:d?[...u,d]:u,operator:"and"},propertyMapping:void 0,context:y}}function D(e,t,n){const{property:o}=t,i=e[o];if(!(i&&"rollup"===i.type&&i.relation_property&&i.target_property))return i;{const t=e[i.relation_property];if(t&&(0,r.p_)(t)){const e=(0,r.j0)(t);if(e){const t=n.getRecordModel(e);if(!t)return;const o=t.getNormalizedSchema();if(o){const e=o[i.target_property];if(e&&"rollup"!==e.type)return e}}}}}function B(e,t){const n=e.collectionViewStore(),r=e.currentSubitemFormatStoreForUiDisplayStore.state,i=null==n?void 0:n.getType(),a=S({collectionContextStore:e,applySubitemFilter:t&&Boolean(r)&&!(i&&(0,f.Av)(i)),filterOutHideSubitemsQuickFilter:!t});return(0,o.kk)(a)}function E(e){return(0,p.EE)(e)||e===v}},304708:(e,t,n)=>{n.d(t,{$t:()=>M,A3:()=>x,Cl:()=>O,En:()=>I,F$:()=>_,H3:()=>h,L0:()=>E,Mo:()=>C,Or:()=>v,Rv:()=>y,WP:()=>j,Ye:()=>m,b9:()=>f,d3:()=>B,eu:()=>g,hN:()=>U,k1:()=>Z,k8:()=>L,mS:()=>V,mg:()=>P,mq:()=>R,no:()=>F,oj:()=>A,p1:()=>p,rd:()=>b,s$:()=>w,u3:()=>k,wE:()=>S,wd:()=>T,xf:()=>N,yT:()=>D});var o=n(133728),r=n(947969),i=(n(95477),n(80444)),a=n(385555),s=n(206258),l=n(88893),c=n(535057),d=n(548779),u=n(195697);function p(){return l.ye()&&"on"===a.default.getEligibleGroup({experimentId:"request_membership",defaultGroup:"control"})}function m(){return l.ye()&&!(0,c.wP)()}function g(e){let{environment:t,spaceStore:n,userRootStore:o}=e;return f({spaceStore:n,userRootStore:o,environment:t})&&"on"===a.default.getEligibleGroup({experimentId:"guest_sidebar_locked_v2",defaultGroup:"control"})}function f(e){let{environment:t,spaceStore:n,userRootStore:o}=e;const r=null==n?void 0:n.getPublicSpaceData();return!(!(n&&o&&r&&(0,d.Cx)(n))||(0,c.wP)()||t.device.isMobile||!m()||r.disableGuestMembershipRequests||h({userRootStore:o}))&&"on"===a.default.getEligibleGroup({experimentId:"guest_sidebar_locked",defaultGroup:"control"})}function h(e){let{userRootStore:t}=e;return t.getSpaceViewStores().some((e=>s.y3.createChildStore(e,r.v8({userId:t.id,spaceId:e.getSpaceId()})).isMember()))}function v(){return w()}function y(){return(0,c.Mk)()}function b(){return"on"===a.default.getEligibleGroup({experimentId:"import_google_contacts",defaultGroup:"control"})&&(0,c.Mk)()}function _(){return(0,u.bq)()&&"on"===a.default.getEligibleGroup({experimentId:"teamspace_guests",defaultGroup:"control"})}function S(e){return!e.device.isMobile&&!(0,c.wP)()}function k(){return(0,u.bq)()&&"on"===a.default.getEligibleGroup({experimentId:"teams_invite_link",defaultGroup:"control"})}function w(){return(0,u.bq)()&&"on"===a.default.getEligibleGroup({experimentId:"team_invite_link_ms2",defaultGroup:"control"})}function x(){return a.default.checkGate({gateName:"drawing_block"})}function I(){return!1}function C(){return a.default.checkGate({gateName:"recover_user_content_in_product"})}function T(){return a.default.checkGate({gateName:"guest_invite_requests"})}function M(){return"on"===a.default.getEligibleGroup({experimentId:"grant_access_via_mentions",defaultGroup:"control"})}function P(e){if(e.device.isMobile)return!1;return a.default.getEligibleGroup({experimentId:"settings_in_space_switcher",defaultGroup:"control"}).includes("settings")}function A(e){return!(!e.device.isMobileNative||e.device.isTablet)&&a.default.checkGate({gateName:"mobile_quick_capture_icons_redesign"})}function R(e){return!e.device.isMobile&&D()}function D(){return a.default.checkGate({gateName:"horizon_1_sidebar_panel_rollout"})}function B(){return a.default.checkGate({gateName:"enable_link_mention_hover"})}function E(){return a.default.checkGate({gateName:"hyperlink_hovers"})}function F(){return a.default.checkGate({gateName:"new_bookmark"})}function Z(){return a.default.checkGate({gateName:"new_hover_designs_lp"})}function U(e){return!e.device.isMobile&&a.default.checkGate({gateName:"persisted_secondary_sidebar_state"})}function V(){var e;const t=null===(e=i.default.state.currentUserStore)||void 0===e?void 0:e.getEmail();return"makenotion.com"===(0,o.Gd)(t??"")}function N(e){const{environment:t}=e;return!(!t.device.isMobileNative||t.device.isTablet)&&a.default.checkGate({gateName:"mobile_user_activation_template_gallery_refresh_gate"})}function O(e){const{environment:t}=e;return!(!t.device.isMobileNative||!t.device.isAndroid||t.device.isTablet)&&"on"===a.default.getEligibleGroup({experimentId:"mobile_user_activation_android_template_pills",defaultGroup:"control"})}function L(){return a.default.checkGate({gateName:"gmail_automation_action"})}function j(){return a.default.checkGate({gateName:"unfurl_disable_store_verify"})}},451165:(e,t,n)=>{n.d(t,{Ld:()=>p,YT:()=>g,cC:()=>u,k$:()=>d,qM:()=>m,xU:()=>f});var o=n(840376),r=n(421202),i=n(933709),a=n(23867),s=n(519889),l=n(421838),c=n(206258);function d(e,t,n,o){for(const r of t.findByGroupingKey(o)){if(!l.BIG(r))continue;const t=l.fgJ(r),o=c.t1.createChildStore(e,{table:i.qF,id:t,spaceId:(0,a.C)(e.pointer.spaceId)});if(p(o,n))return{discussionStore:o,annotation:r}}}function u(e){const{store:t,discussionId:n}=e,o=t.getAncestorRecordStoreAtRootPath();if(!o||o.table!==r.iU)return;return o.getDiscussionStores().find((e=>e.id===n))}function p(e,t){const n=e.getCommentStores();if(!n[0])return!1;const o=n[0].getCreatedByPointer();return(null==o?void 0:o.table)===s.KJ&&(null==o?void 0:o.id)===t.id}function m(e){const{blockStore:t,suggestionType:n,currentUser:o}=e;let r;if("insert"===n?r=t.getInsertSuggestion():"remove"===n?r=t.getRemoveSuggestion():"add_line_break"===n?r=t.getAddLineBreakSuggestion():"remove_line_break"===n&&(r=t.getRemoveSuggestion()),r){return p(c.t1.createChildStore(t,{table:i.qF,id:r.discussionId,spaceId:(0,a.C)(t.pointer.spaceId)}),o)}}function g(e){const{blockStore:t,currentUser:n,type:r}=e,i=t.getTitleValue(),a=l.Rkp(i);return d(t,o.u.fromArray(a),n,r)}function f(e){const{blockStore:t,currentUser:n}=e,o=t.getInsertSuggestion();if(o){return p(c.t1.createChildStore(t,{table:i.qF,id:o.discussionId,spaceId:(0,a.C)(t.pointer.spaceId)}),n)}return!1}},214976:(e,t,n)=>{n.d(t,{Dn:()=>ae,Gj:()=>pe,IY:()=>G,Lc:()=>te,Ob:()=>ve,PY:()=>fe,Qb:()=>ne,R9:()=>_e,Rl:()=>ke,SD:()=>se,So:()=>Se,TQ:()=>xe,Ut:()=>oe,We:()=>Ie,XG:()=>ye,Xh:()=>W,bD:()=>H,cD:()=>me,fm:()=>ge,kV:()=>de,li:()=>le,lw:()=>re,n$:()=>ee,vO:()=>ce,xX:()=>he,zO:()=>be});var o=n(122377),r=n(415095),i=n(842875),a=n(882883),s=n(421202),l=n(421838),c=n(744805),d=n(653965),u=n(619584),p=n(800993),m=n(632741),g=n(948514),f=n(95477),h=n(17277),v=n(924990),y=n(433929),b=n(268056),_=n(70853),S=n(431559),k=n(385555),w=n(530874),x=n(206258),I=n(924666),C=n(146150),T=n(541056),M=n(162619),P=n(83631),A=n(249394),R=n(745162),D=n(165598),B=n(731352),E=n(389224);function F(e){return M.kK(e)&&e.classList.contains(c.Eu)}function Z(e){return M.kK(e)&&e.classList.contains(c.DK)}function U(e){return M.kK(e)&&e.classList.contains(c.tL)}function V(e){return function(e){const t=M.sh(e,(e=>(0,P.Xu)(e)||(0,C.eD)(e)));if(t&&F(t))return t}(e)||O(e)||function(e){const t=M.sh(e,(e=>U(e)||(0,C.eD)(e)));if(t&&U(t))return t}(e)}function N(e){return M.kK(e)&&e.classList.contains(o.P)}function O(e){const t=M.sh(e,(e=>(0,P.Xu)(e)||(0,C.eD)(e)));if(t&&(0,P.Xu)(t))return t}function L(e){return M.kK(e)&&e.classList.contains(c.mb)}function j(e){if(L(e))return!0;try{return L(e.parentNode)}catch(t){return!1}}function K(e){try{const t=M.sh(e,(e=>Boolean(e.getAttribute&&e.getAttribute("contenteditable"))||(0,C.eD)(e)));return t&&t.isContentEditable}catch(t){return!1}}function z(e,t){if(e===t.container){if(M.Gs(e)){const n=e.textContent||"";return(0,r.p4)(n.substring(0,t.offset)).length}{const n=Array.from(e.childNodes).slice(0,t.offset).map((e=>Q($(e)))).join("");return(0,r.p4)(n).length}}let n=0;for(const o of Array.from(e.childNodes)){if(o.contains(t.container))return n+z(o,t);n+=(0,r.p4)(Q($(o))).length}return n}function q(e,t){const n=(0,C.X1)(e);if(!n)return 0;const o=function(e,t){const n=V(e);if(n){const e=n.parentNode,o=Array.from(e.childNodes).indexOf(n);return{container:e,offset:0===t?o:o+1}}if(L(e)||L(e.parentNode))return{container:e,offset:(e.textContent||" ").length-1};return{container:e,offset:t}}(e,t);return z(n,o)}function H(e,t){if(0===t)return!(e.childNodes.length>0)||F(e.childNodes[0])||N(e.childNodes[0])||(0,P.Xu)(e.childNodes[0])||U(e.childNodes[0])||Z(e.childNodes[0])?{container:e,offset:0}:{container:e.childNodes[0],offset:0};const n=d.cx(e.childNodes,Z),o=n>=0?n-1:e.childNodes.length-1;let i=t;for(let a=0;a<=o;a++){const t=e.childNodes[a],n=Q($(t)),s=(0,r.p4)(n).length;if(a===o?i-s<=0:i-s<0){if(F(t)||(0,P.Xu)(t)||N(t)||L(t)||U(t)){const e=M.oG(t.parentNode,t);return{container:t.parentNode,offset:e}}if(t.nodeType===Node.TEXT_NODE){return{container:t,offset:d.tP((0,r.p4)(n),0,i).join("").length}}return H(t,i)}i-=s}return{container:e,offset:0}}function G(e){const{environment:t,textValue:n,parentStore:o,disableHover:r,disableStyleAnnotations:a,disableInsertedDeletedAnnotations:s,disableDateStyleAnnotations:l,disableSuggestionAnnotations:d,disableCommentAnnotations:u,disabled:p,emojiType:m,highlightDiscussionId:g,renderedPageBlockId:b,parentBlockId:S,theme:x,katex:I,disableLinks:C,formulaValueTypes:M,stopLinkPropagation:P,linkTargetBlank:A}=e,{device:R,currentUser:D}=t,B=k.default.checkGate({gateName:"enable_deleted_page_indicator"}),E=k.default.checkGate({gateName:"trash_page_mention_pill"});return c.IY({textValue:n,getRecordModel:o.getRecordModel,getRecordRole:o.getRecordRole,disableHover:r,disableStyleAnnotations:a,disableInsertedDeletedAnnotations:s,disableDateStyleAnnotations:l,disableSuggestionAnnotations:d,disableCommentAnnotations:u,disableLinks:C||!1,userTimeZone:(0,i.r)(),disabled:p,isAndroid:R.isAndroid,isSafariOrIOS:R.isSafari||R.isIOS,isWindows:R.isWindows,showEmojiInline:R.isWindows,emojiType:m,highlightDiscussionId:g,theme:x,intl:y.default.getIntl(),renderedPageBlockId:b,parentBlockId:S,katex:I,isClient:!0,baseUrl:f.default.domainBaseUrl,publicDomainName:f.default.publicDomainName,currentUserId:D.id,getPublicBaseUrlForPage:_.aR(t),externalIntegrations:w.Z.integrations.state,formulaValueTypes:M,enableDeletedPageIndicator:B,enableNewTrashPageMentionPill:E,stopLinkPropagation:P,linkTargetBlank:A,emojiData:v.Z.state,getToday:T.HL,isMobileNative:R.isMobileNative,isMobileNativeExternalLinkFixEnabled:k.default.checkGate({gateName:"mobile_native_external_link_fix"}),displayInUserTimezone:k.default.checkGate({gateName:"display_date_in_user_timezone"}),dictationId:h.LB})}function W(e,t){return(0,a.Xh)({textValue:e,getRecordModel:t.getRecordModel,userTimeZone:(0,i.r)(),intl:y.default.getIntl()})}function $(e){let t="";if(F(e))t+=l.qyI;else if((0,P.Xu)(e))t=l.fuX;else if(N(e))t+=e.alt;else if(function(e){return M.kK(e)&&"br"===e.tagName.toLowerCase()}(e))t+="\n";else if(M.Gs(e))t+=e.textContent;else if(U(e));else for(const n of Array.from(e.childNodes))t+=$(n);return Z(e)&&(t=t.replace(X,"")),t}const Y=new RegExp(c.U3,"g");function Q(e){return e.replace(Y,"")}const J={[l.qyI]:{deleteEndToken:new RegExp(`${l.qyI}$`,"g"),deleteToken:new RegExp(`(${l.qyI})([^${c.U3}])`,"g"),existingToken:new RegExp(`${l.qyI}${c.U3}`,"g")},[l.fuX]:{deleteEndToken:new RegExp(`${l.fuX}$`,"g"),deleteToken:new RegExp(`(${l.fuX})([^${c.U3}])`,"g"),existingToken:new RegExp(`${l.fuX}${c.U3}`,"g")}},X=new RegExp(`${l.aVG}$`,"g");function ee(e,t){if(!t)return"";let n=$(t);if(e.device.isAndroid)for(const[o,r]of Object.entries(J))n=n.replace(r.deleteEndToken,"").replace(r.deleteToken,"$2").replace(r.existingToken,o);return"\n"===n[n.length-1]&&(n=n.substring(0,n.length-1)),n}function te(e,t,n){if(!e)return!1;let o=t;for(;o!==e&&!Z(o);){const{parentNode:e}=o;if(!e)break;o=e}if(Z(o))return n>0;const r=d.cx(e.childNodes,Z);return!(r<0)&&(t===e&&n>r)}function ne(e,t){const n=(0,C.X1)(e);if(!n)return;const o=q(e,t),r=V(e);return{index:o,forceEmit:Boolean(r),afterEndOfLine:te(n,e,t)}}function oe(e,t){if(t||(t=E.get()),t){const e=q(t.startContainer,t.startOffset),n=q(t.endContainer,t.endOffset),o=V(t.startContainer)||V(t.endContainer);return{selection:{startIndex:e,endIndex:n},forceEmitSelectionStore:Boolean(o)}}}function re(e,t,n){const o=H(e,t),r=H(e,n);return E.rangeFromContainerOffsets({start:o,end:r})}function ie(e,t,n,o){if(e===n&&t===o)return!0;if(j(e)!==j(n))return!1;if(O(e)!==O(n))return!1;const r=(0,C.X1)(e),i=(0,C.X1)(n);if(r!==i)return!1;if(q(e,t)!==q(n,o))return!1;return te(r,e,t)===te(i,n,o)}function ae(e,t){return!e&&!t||!(!e||!t)&&(e.startOffset===t.startOffset&&e.endOffset===t.endOffset&&e.startContainer===t.startContainer&&e.endContainer===t.endContainer||K(e.startContainer)&&K(t.startContainer)&&ie(e.startContainer,e.startOffset,t.startContainer,t.startOffset)&&ie(e.endContainer,e.endOffset,t.endContainer,t.endOffset))}function se(e){const{environment:t,event:n,textValue:o,editorNode:r,store:i,canEdit:a,disableEquationInteraction:s}=e,l=ue({event:n,textValue:o,editorNode:r});(t.device.isFirefox||"editing"!==I.default.state.mode||I.default.isEmptySelection()||l&&(0,P.Xu)(l.node))&&l&&(s&&(0,P.Xu)(l.node)||p.VO({environment:t,event:n,interactiveToken:l,store:i,canEdit:a}))}function le(e){const{environment:t,event:n,textValue:o,editorNode:r,store:i,parentStore:a,canEdit:s}=e,l=ue({event:n,textValue:o,editorNode:r});l&&p.ON({environment:t,event:n,interactiveToken:l,store:i,parentStore:a,canEdit:s})}function ce(e){const{environment:t,event:n,textValue:o,editorNode:r,store:i,canEdit:a}=e,s=ue({event:n,textValue:o,editorNode:r});s&&p.Nh({environment:t,event:n,interactiveToken:s,store:i,canEdit:a})}function de(e){const{environment:t,event:n,textValue:o,editorNode:r,store:i,canEdit:a}=e;if(n.target===r)return void m.lY({relatedNode:r});const s=ue({event:n,textValue:o,editorNode:r});s&&p.Zl({environment:t,event:n,interactiveToken:s,store:i,canEdit:a})}function ue(e){const{event:t,textValue:n,editorNode:o}=e,r=M.sh(t.target,(e=>Boolean(e.getAttribute&&e.getAttribute("data-token-index"))));if(r&&null!=o&&o.contains(r)){const e=r.getAttribute("data-token-index");if(e){const t=parseInt(e,10);if(n){const e=n[t];if(e)return{textValue:n,tokenIndex:t,textToken:e,node:r}}}}}function pe(e){return ge({store:e.store,temporaryAnnotation:l.GKr.TemporaryComment,multiSelection:g.Z.getMultiSelection()})}function me(e){const{blockId:t,textProps:n,find:o,currentFocusedResult:r}=e;let{textValue:i}=e;if(!i||"none"===n.type||0===o.length)return i;return(0,A.ub)({textValue:i,find:o,intl:y.default.getIntl()}).forEach(((e,o)=>{let{selection:a}=e,s=!1;if("block_match"===n.type&&"block"===(null==r?void 0:r.type)){s=t===r.id&&d.Xy(a,r.selection)}else if("comment_match"===n.type&&"comment"===(null==r?void 0:r.type)){s=n.commentId===r.id&&d.Xy(a,r.selection)}else if("page_property_value_match"===n.type&&"page_property_value"===(null==r?void 0:r.type)){s=r.propertyId===n.propertyId&&d.Xy(a,r.selection)&&r.id===t}else if("simple_table_cell_match"===n.type&&"simple_table_cell"===(null==r?void 0:r.type)){const e=n.propertyId===r.propertyId&&r.id===t;d.Xy(a,r.selection),s=e}const c=s?l.GKr.TemporarySelectedFindHighlight:l.GKr.TemporaryFindHighlight;i=l.WO0({textValue:i,selection:a,annotation:[c]})})),i}function ge(e){const{store:t,temporaryAnnotation:n,multiSelection:o}=e,r=t.getValue();if(o){const e=(0,R.L5)(o).find((e=>{let{store:n}=e;return n===t}));if(e){const{selection:t}=e;return l.WO0({textValue:r,selection:t,annotation:[n]})}}return r}function fe(e){const{store:t,equationStore:n}=e;if(!n.isOpen())return;const o=(0,b.QY)(n.state.savedTextSelectionState.multiSelection);if(!o)return;const{store:r,selection:i}=o;if(t!==r)return;const a=r.getValue(),s=i.startIndex===i.endIndex?a:l._QS(a,i.startIndex,i.endIndex),c=P.qZ({equationState:n.state,isTemporary:!0});return c?l.P$X(s,[c],i.startIndex):void 0}function he(e){const{store:t,selection:n}=e,o=t.getValue();if(n.startIndex+1!==n.endIndex)return o;const r=l.b1T(o,n.startIndex);if(!r||!l.eOb(r))return o;const i=n.startIndex===n.endIndex?o:l._QS(o,n.startIndex,n.endIndex),a=(0,u.uh)(r[1],l.rIb),s=[r[0],[...a,l.EPB()]];return l.P$X(i,[s],n.startIndex)}function ve(e){const{store:t,mentionMenuState:n}=e,o=t.getValue();if(n.textStore!==t)return o;const r=n.temporaryInputData.state;if(!r)return o;const i=(0,B.O2)(t,n.oldTextValue,r.prefix);if(i&&i.prefix){const{tokensBeforeRange:e,tokensInsideRange:t,tokensAfterRange:n}=l.xrQ(o,i.prefix.startIndex,i.filter.endIndex),a=l.QaF(t);return[...e,l.V3y(a,[l.mF$(r)]),...n]}return o}function ye(e){const{textValue:t,discussionId:n}=e;return l.WO0({textValue:t,selection:{startIndex:0,endIndex:1/0},annotation:[l.GKr.SuggestionRemoveText,n]})}function be(e){const{textValue:t,discussionId:n}=e;return l.WO0({textValue:t,selection:{startIndex:0,endIndex:1/0},annotation:[l.GKr.SuggestionInsertText,n]})}function _e(e){const{store:t,slashMenuState:n,hint:o}=e,r=t.getValue();if(n.textStore!==t)return r;if(n.filter.length>0)return r;const i=(0,B.O2)(t,n.oldTextValue,S.pZ());if(i&&i.prefix){const{tokensBeforeRange:e,tokensInsideRange:t,tokensAfterRange:n}=l.xrQ(r,i.prefix.startIndex,i.filter.endIndex),a=l.QaF(t);return[...e,l.V3y(a,[l.rB1({hint:o})]),...n]}return r}function Se(e){const{store:t,selection:n}=e,o=t.getValue(),{tokensBeforeRange:r,tokensInsideRange:i,tokensAfterRange:a}=l.xrQ(o,n.startIndex,n.endIndex),s=l.QaF(i);return[...r,l.V3y(s,[[l.GKr.TemporarySelection]]),...a]}function ke(e){let{store:t,textValue:n}=e;if(!n)return n;if(t.table!==s.iU)return n;const o=x.G.createChildStore(t,{table:t.table,id:t.id});if(o.isInsideCollection()||o.isType("callout")||o.isType("code"))return n;let r=n;return(0,D.bB)((0,D.yJ)(o)).unresolved.forEach((e=>{const t=["m",e.id];r=l.WO0({textValue:r,annotation:t,selection:{startIndex:0,endIndex:1/0}})})),r}function we(e){if(e.nodeType===Node.TEXT_NODE)return e;if(M.kK(e)&&"false"===e.getAttribute("contentEditable"))return e;let t;const n=M.kd(e);return n.forEach((e=>{null!==e.textContent&&e.textContent.indexOf("\n")>=0&&(t=e)})),t||(n.length>0?n[n.length-1]:e)}function xe(e){const t=E.get();if(!t)return;const n=t.startContainer,o=(0,C.X1)(n),r=null==o?void 0:o.childNodes,i=!E.isExpanded(t);if(r&&(r.length>1||i)){const i=(0,C.g4)(n,o),f=d.cx(r,(e=>e===i));let h,v,y=!0,b=n,_=t.startOffset;if(0===_)for(let e=f-1;y&&e>=0;e--){const t=we(r[e]);if(t.nodeType===Node.TEXT_NODE){var a;const e=null===(a=t.textContent)||void 0===a?void 0:a.lastIndexOf("\n");var s,l;if(void 0!==e&&e>=0)null!==(s=t.textContent)&&void 0!==s&&s.length&&e+1<(null===(l=t.textContent)||void 0===l?void 0:l.length)&&(b=t,_=e+1),y=!1;else b=t,_=0}else b=t,_=0}y=!0;for(let e=f;y&&e<r.length;e++){const t=we(r[e]);if(t.nodeType===Node.TEXT_NODE){let e;var c,u,p,m;if(b===t)e=null===(c=t.textContent)||void 0===c?void 0:c.indexOf("\n",_);else e=null===(u=t.textContent)||void 0===u?void 0:u.indexOf("\n");if(void 0!==e&&e>=0)h=t,v=e+1===(null===(p=t.textContent)||void 0===p?void 0:p.length)?e:e+1,y=!1;else h=t,v=(null===(m=t.textContent)||void 0===m?void 0:m.length)||0}else{var g;h=t,v=(null===(g=t.textContent)||void 0===g?void 0:g.length)||0}}if(b&&h){const t=E.rangeFromContainerOffsets({start:{container:b,offset:_},end:{container:h,offset:v||0}});E.set(t,e)}}}function Ie(e,t){const n=l.$0A(e.id,e.getSpaceId()),o=l.YCD(n);return{textValue:[o],tokenIndex:0,textToken:o,node:t}}},970764:(e,t,n)=>{n.d(t,{NP:()=>s,QS:()=>g,mO:()=>c,sw:()=>m,xt:()=>p});var o=n(520270),r=n(709291),i=(n(95477),n(385555)),a=n(530874);function s(e){const t=a.Z.state;return t.loaded?t.bots.filter((t=>t.integration_id===e)):[]}const l=(0,r.defineMessages)({invalidRequest:{id:"unfurlingHelpers.authenticatedErrorDescription.invalidRequest",defaultMessage:"The authentication request is invalid. Please contact support if issue persists."},unauthorizedClient:{id:"unfurlingHelpers.unauthorizedClient.",defaultMessage:"The client is not authorized to request an authorization code using this method. Please contact support if issue persists."},accessDenied:{id:"unfurlingHelpers.authenticatedErrorDescription.accessDenied",defaultMessage:"The resource owner or authorization server denied the request. Check with your organization or resource owner to ensure OAuth installation is enabled."},unsupportedResponseType:{id:"unfurlingHelpers.authenticatedErrorDescription.unsupportedResponseType",defaultMessage:"The authorization server does not support obtaining an authorization code using this method. Please contact support if issue persists."},invalidScope:{id:"unfurlingHelpers.authenticatedErrorDescription.invalidScope",defaultMessage:"The requested scope is invalid. Please contact support if issue persists."},serverError:{id:"unfurlingHelpers.authenticatedErrorDescription.serverError",defaultMessage:"The authorization server encountered an unexpected condition that prevented it from fulfilling the request. Please contact support if issue persists."},temporarilyUnavailable:{id:"unfurlingHelpers.authenticatedErrorDescription.temporarilyUnavailable",defaultMessage:"The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server. Please contact support if issue persists."},githubAppRequestAccessUnsupported:{id:"unfurlingHelpers.authenticatedErrorDescription.githubAppRequestAccessUnsupported",defaultMessage:"Request Access is not supported. You must be both a GitHub Admin and Notion Workspace Admin to connect the two apps."},unknownError:{id:"unfurlingHelpers.authenticatedErrorDescription.unknownError",defaultMessage:"The authorization server responded with an unknown error (`{value}`). Please contact support if issue persists."}});function c(e){return"invalid_request"===e?l.invalidRequest:"unauthorized_client"===e?l.unauthorizedClient:"access_denied"===e?l.accessDenied:"unsupported_response_type"===e?l.unsupportedResponseType:"invalid_scope"===e?l.invalidScope:"server_error"===e?l.serverError:"temporarily_unavailable"===e?l.temporarilyUnavailable:"github_app_request_access_unsupported"===e?l.githubAppRequestAccessUnsupported:l.unknownError}const d=(0,r.defineMessages)({unknownError:{id:"unfurlingHelpers.unfurlResponseError.unknownError",defaultMessage:"Can't load preview"},accessDenied:{id:"unfurlingHelpers.unfurlResponseError.accessDenied",defaultMessage:"Access denied"},reAuthenticate:{id:"unfurlingHelpers.unfurlResponseError.reAuthenticate",defaultMessage:"Re-authentication necessary"},notFound:{id:"unfurlingHelpers.unfurlResponseError.notFound",defaultMessage:"Content not found"},unprocessableEntity:{id:"unfurlingHelpers.unfurlResponseError.unprocessableEntity",defaultMessage:"Unrecognized URL"},rateLimited:{id:"unfurlingHelpers.unfurlResponseError.rateLimited",defaultMessage:"Too many requests"},serverError:{id:"unfurlingHelpers.unfurlResponseError.serverError",defaultMessage:"Can't load preview"},invalidRequest:{id:"unfurlingHelpers.unfurlResponseError.invalidRequest",defaultMessage:"Can't load preview"},authRefresh:{id:"unfurlingHelpers.unfurlResponseError.authRefresh",defaultMessage:"Fetching Preview"},githubNotAcceptable:{id:"unfurlingHelpers.unfurlResponseError.githubNotAcceptable",defaultMessage:"Need owner role"},jiraNotAcceptable:{id:"unfurlingHelpers.unfurlResponseError.jiraNotAcceptable",defaultMessage:"Synced in another workspace"},notAcceptable:{id:"unfurlingHelpers.unfurlResponseError.notAcceptable",defaultMessage:"Not Acceptable"},databaseSyncLimit:{id:"unfurlingHelpers.unfurlResponseError.databaseSyncLimit",defaultMessage:"Synced Database limit reached"}}),u=(0,r.defineMessages)({unknownError:{id:"unfurlingHelpers.unfurlResponseErrorDescription.unknownError",defaultMessage:'There was an error trying to get information for this resource. Received error code "{statusCode}".'},accessDenied:{id:"unfurlingHelpers.unfurlResponseErrorDescription.accessDenied",defaultMessage:"You do not have appropriate permission to access this resource."},reAuthenticate:{id:"unfurlingHelpers.unfurlResponseErrorDescription.reAuthenticate",defaultMessage:"You need to re-authenticate your account to access this resource."},notFound:{id:"unfurlingHelpers.unfurlResponseErrorDescription.notFound",defaultMessage:"The resource information for this link could not be found. It may no longer exist or you may not have appropriate permission to access it."},unprocessableEntity:{id:"unfurlingHelpers.unfurlResponseErrorDescription.unprocessableEntity",defaultMessage:"This url is not currently embedable by this integration."},rateLimited:{id:"unfurlingHelpers.unfurlResponseErrorDescription.rateLimited",defaultMessage:'"{integrationName}" received too many requests for you or your organization. Please wait a few minutes and try again.'},serverError:{id:"unfurlingHelpers.unfurlResponseErrorDescription.serverError",defaultMessage:'Oh no! Seems like there was a "{integrationName}" server error. Received error code "{statusCode}".'},invalidRequest:{id:"unfurlingHelpers.unfurlResponseErrorDescription.invalidRequest",defaultMessage:'There was an error trying to get information for this resource. Received error code "{statusCode}".'},authRefresh:{id:"unfurlingHelpers.unfurlResponseErrorDescription.authRefresh",defaultMessage:"Fetching Preview via Login Update, please wait."},githubNotAcceptable:{id:"unfurlingHelpers.unfurlResponseErrorDescription.githubNotAcceptable",defaultMessage:"You do not have appropriate permission to sync this resource. You need to have an owner role."},jiraNotAcceptable:{id:"unfurlingHelpers.unfurlResponseErrorDescription.jiraNotAcceptable",defaultMessage:"You have synced this resource in another workspace."},notAcceptable:{id:"unfurlingHelpers.unfurlResponseErrorDescription.notAcceptable",defaultMessage:"You do not have appropriate permission to sync this resource. You need to have an owner role."},databaseSyncLimit:{id:"unfurlingHelpers.unfurlResponseErrorDescription.databaseSyncLimit",defaultMessage:"Your workspace has hit the Synced Database limit."}});function p(e,t){return void 0===e?{message:d.unknownError,description:u.unknownError}:401===e?{message:d.reAuthenticate,description:u.reAuthenticate}:439===e?{message:d.authRefresh,description:u.authRefresh}:403===e?{message:d.accessDenied,description:u.accessDenied}:404===e?{message:d.notFound,description:u.notFound}:422===e?{message:d.unprocessableEntity,description:u.unprocessableEntity}:429===e?{message:d.rateLimited,description:u.rateLimited}:406===e?"jira"===t?{message:d.jiraNotAcceptable,description:u.jiraNotAcceptable}:"github"===t?{message:d.githubNotAcceptable,description:u.githubNotAcceptable}:{message:d.notAcceptable,description:u.notAcceptable}:417===e?{message:d.databaseSyncLimit,description:u.databaseSyncLimit}:(0,o.Ms)(e)?{message:d.serverError,description:u.serverError}:{message:d.invalidRequest,description:u.invalidRequest}}function m(e){return!e.device.isMobileBrowser}function g(){return i.default.checkGate({gateName:"beta-developers-external"})}},215010:(e,t,n)=>{n.d(t,{JF:()=>a,QZ:()=>i,WD:()=>l,e2:()=>s});var o=n(44317),r=(n(940663),n(80444));function i(){const{currentUserSettingsStore:e,currentSpaceStore:t}=r.default.state,n=(null==e?void 0:e.getSettings())||{},o=null==t?void 0:t.getPlanType();return"professional"===n.domain_type&&"team"===o}function a(){const{currentUserSettingsStore:e}=r.default.state;return((null==e?void 0:e.getSettings())||{}).domain_type}function s(e){const t=e.getSettings(),n=null==t?void 0:t.signup_time;return n?(0,o.O5)(n):null}function l(e){const{currentUserSettingsStore:t}=r.default.state;if(t&&t.id===e.currentUser.id)return t}},956518:(e,t,n)=>{n.d(t,{Ef:()=>w,FQ:()=>x,Gp:()=>v,IU:()=>g,Li:()=>f,X4:()=>b,ZI:()=>S,ax:()=>k,nZ:()=>y,tt:()=>h,xF:()=>m});var o=n(815145),r=n(401800),i=n(842875),a=n(225718),s=n(300482),l=n(74446),c=n(421202),d=n(401898),u=n(95477),p=n(433929);const m="paste";function g(e){let t,n;const o=new Set,r=new Set;for(const i of e){const e=i.getParentBlockStore();if(e&&"column"===e.getType()){o.add(e.id),r.add(i.id);const a=e.getParentBlockStore();if(a&&"column_list"===a.getType()){n=a.getSpaceId();const e=a.id;if(void 0===t&&(t=e),t!==e)return}}}if(t&&o.size>1&&n)return{columnListId:t,columnIds:o,blockIds:r,spaceId:n}}function f(e,t){if(!e.clipboardData)return;const n=e.clipboardData.getData("text/html");e.clipboardData.setData("text/html",`${n}${v(t)}`)}function h(e){if(!e.clipboardData)return;return y(e.clipboardData.getData("text/html"))}function v(e){return`\x3c!-- notionvc: ${e} --\x3e`}function y(e){const t=e.match(/\<\!-- notionvc\: ([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}) --\>$/i);return t?t[1]:void 0}function b(e){const{blockValues:t,rootBlock:n,getRecordValue:o,isWindows:r,markdownSerializationOptions:i,markdownLinkifyIt:s}=e;let l=a.on(t,{...k({rootBlock:n,getRecordValue:o}),transformAnnotation:null==i?void 0:i.transformAnnotation,transformBlockMapping:null==i?void 0:i.transformBlockMapping});const c={markdown:void 0,html:void 0};if(l){l=l.replaceAll(_,"$1"),c.markdown=S(r,l);const e=s&&a.c8({...s,markdown:l});e&&(c.html=S(r,e))}return c}const _=/\[(https?:\/\/[^\])]+)\]\(\1\)/g;function S(e,t){return e?t.split("\r\n").reduce(((e,t)=>[...e,...t.split("\n")]),[]).join("\r\n"):t}function k(e){const{rootBlock:t,getRecordValue:n}=e;return{root:t,navigableBlockId:t.id,renderParentBlockId:void 0,blockId:t.id,userTimeZone:(0,i.r)(),intl:p.default.getIntl(),getRecordValue:n,numberedListCache:{},bulletedListCache:{},getRecordsWithParent:()=>[],getExportedPathToFile:e=>{let{toFileURI:t}=e;return t},getExportedRenderAsset:e=>{let{toFileURI:t}=e;return t},getExportedPathToPage:e=>{let{toPageId:t}=e;return(0,r.Z)({pageId:t,pageValue:n({table:c.iU,id:t}),baseUrl:u.default.domainBaseUrl,pageVisitSource:o.tY.Export})},baseUrl:u.default.domainBaseUrl,publicDomainName:u.default.publicDomainName,resultCache:new Map}}function w(e){const{rootBlock:t,clipboardData:n,isWindows:o,fallbackGetRecordValue:r,markdownSerializationOptions:i,markdownLinkifyIt:a}=e,{tree:s,blockSelection:c}=n,u=l.mF.tryUntilFound(...c.blocks.map((e=>e.blockSubtree&&l.mF.fromRecordMap(e.blockSubtree))).filter(d.$K),r),p=s.value,m=c.blocks.map((e=>u({...p,id:e.blockId}))).filter(d.$K);return b({rootBlock:t,getRecordValue:u,blockValues:m,isWindows:o,markdownSerializationOptions:i,markdownLinkifyIt:a})}function x(e){const t=e.pointerPath[e.pointerPath.length-1];return[s.op.set({pointer:t,path:e.attributePath,args:e.copiedText})]}},368585:(e,t,n)=>{n.d(t,{aL:()=>C,Pn:()=>v,vS:()=>_,yr:()=>x,Pp:()=>I,ZO:()=>S,Y5:()=>w});var o=n(815145),r=n(805809),i=n(401898),a=n(576205);function s(e,t,n){return void 0!==e&&((0,a.vA)(e)?Boolean(null===(o=e.filters)||void 0===o?void 0:o.some((e=>s(e,t,n)))):!!(0,a.aN)(e)&&n.has(e.property));var o}function l(e,t,n,o){const r=(0,i.Yd)(e),a=new Set;for(const i of r){var l;(null===(l=e[i])||void 0===l?void 0:l.type)===o&&a.add(i)}const c=s(t,e,a),d=Boolean(n&&n.some((e=>a.has(e.property))));return c&&d?"in_filter_and_sort":d?"in_sort":c?"in_filter":void 0}var c=n(143690),d=n(463087),u=n(382138),p=n(80444),m=n(658421),g=n(385555),f=n(577144),h=n(989796);function v(e,t){const n=null==e?void 0:e.collectionViewBlockStore(),r=null==e?void 0:e.collectionStore(),i=null==e?void 0:e.collectionViewStore(),a=null==e?void 0:e.filtersBarOpenStore.state,s=null==i?void 0:i.getType(),l=(null==e?void 0:e.settingsStore)&&(0,m.n)(null==e?void 0:e.settingsStore),c=null==i?void 0:i.getChartType(),d=null==i?void 0:i.getChartPlaceholderType(),u=null==i?void 0:i.getFormId(),p=null==n?void 0:n.id,g=null==e?void 0:e.getPageVisitSourceOverride();return{view_type:s,context_type:null==e?void 0:e.contextType,is_full_screen:null==e?void 0:e.isFullScreenStore.state,settings_menu:null!=e&&e.settingsStore.state.open&&l?l.type:void 0,collection_id:t||(null==r?void 0:r.id),collection_view_id:null==i?void 0:i.id,collection_view_block_id:p,filters_bar_open:a,is_in_wiki:null==n?void 0:n.isCollectionViewPageWithContent(),personal_home_type:g?(0,o.xt)(g):void 0,database_visit_id:null==e?void 0:e.visitSessionId,chart_type:"placeholder"===c?d:c,is_chart_placeholder:"placeholder"===c,form_id:u}}const y="missing_context_store",b="missing_schema";function _(e,t){var n,o,r,i,a,s,d;if(!e)return{view_type:y,row_count_category:y,column_count_category:y,has_relation_column:y,has_rollup_column:y,has_formula_column:y,formula_property_state:y,rollup_property_state:y,is_client_mode_enabled:y,tracking_source:void 0,collection_view_block_id:y,collection_view_id:y,collection_id:y,collection_type:y,collection_request_backend:y,has_groups:y,has_aggregations:y,database_visit_id:y,is_full_screen:y,is_multi_source_view:y};const u=e.isClientModeEnabledStore.state,p=e.isFullScreenStore.state,m=(null===(n=e.collectionViewBlockStore())||void 0===n?void 0:n.id)||"missing",g=(null===(o=e.collectionViewStore())||void 0===o?void 0:o.id)||"missing",f=(null===(r=e.collectionStore())||void 0===r?void 0:r.id)||"missing",h=null===(i=e.collectionViewStore())||void 0===i?void 0:i.getCollectionSource(),v=null===(a=e.collectionStore())||void 0===a?void 0:a.getSchema(),_=e.requestBackend,w=e.isMultiSourceView;if(!v)return{view_type:b,row_count_category:b,column_count_category:b,has_relation_column:b,has_rollup_column:b,has_formula_column:b,formula_property_state:b,rollup_property_state:b,is_client_mode_enabled:u,tracking_source:t,collection_view_block_id:m,collection_view_id:g,collection_id:f,collection_type:(null==h?void 0:h.type)||"missing",collection_request_backend:_,has_groups:b,has_aggregations:b,database_visit_id:e.visitSessionId,is_full_screen:p,is_multi_source_view:w};const{has_relation_column:x,has_rollup_column:I,has_formula_column:C}=function(e){if(void 0===e)return{has_relation_column:b,has_rollup_column:b,has_formula_column:b};let t=!1,n=!1,o=!1;for(const r of Object.values(e))if("relation"===(null==r?void 0:r.type)&&(t=!0),"rollup"===(null==r?void 0:r.type)&&(n=!0),"formula"===(null==r?void 0:r.type)&&(o=!0),t&&n&&o)break;return{has_relation_column:t,has_rollup_column:n,has_formula_column:o}}(v),T=null===(s=e.remoteRequestStore.state)||void 0===s?void 0:s.loader;let M="missing",P="missing";return T&&(M=c.LU(T),P=c.NM(T)),{view_type:e.getViewType()||"unknown",row_count_category:S(null===(d=e.remoteResultStore.state)||void 0===d?void 0:d.sizeHint),column_count_category:k(v),has_relation_column:x,has_rollup_column:I,has_formula_column:C,formula_property_state:l(v,null==T?void 0:T.filter,null==T?void 0:T.sort,"formula"),rollup_property_state:l(v,null==T?void 0:T.filter,null==T?void 0:T.sort,"rollup"),is_client_mode_enabled:u,tracking_source:t,collection_view_block_id:m,collection_view_id:g,collection_id:f,collection_type:(null==h?void 0:h.type)||"missing",collection_request_backend:_,has_groups:M,has_aggregations:P,database_visit_id:e.visitSessionId,is_full_screen:p,is_multi_source_view:w}}function S(e){return void 0===e?"unknown":(t=e)<=1e3?"0-1K":t<=2500?"1K-2.5K":t<=5e3?"2.5K-5K":t<=1e4?"5K-10K":t<=25e3?"10K-25K":t<=5e4?"25K-50K":t<=1e5?"50K-100K":t<=2e5?"100K-200K":t<=5e5?"200K-500K":t<=1e6?"500K-1M":"1M+";var t}function k(e){const t=Object.keys(e).length;return t<=10?"0-10":t<=20?"10-20":t<=50?"20-50":"51_or_more"}function w(e){const{from:t,collectionContextStore:n,sizeHintAtStart:o}=e,r=_(n),{row_count_category:i,...a}=r;return{...a,from:t,property_type:"property_type"in e?e.property_type:void 0,did_trigger_fetch:n?n.isLoadingStore.state:y,row_count_category:S(o)}}function x(e){const{collectionContextStore:t,is_native_drop:n,is_empty:o}=e;return{..._(t),is_native_drop:n,is_empty:o}}function I(e){var t,n;const{environment:o,collectionContextStore:i,visibleItemsCount:a}=e,s=_(i),l=i.remoteResultStore.state?c.aW({result:i.remoteResultStore.state}).length:0,m=0===l?void 0:a/l,v=null===(t=p.default.state.currentSpaceStore)||void 0===t?void 0:t.getSpaceId(),y=i.collectionViewStore(),b=null==y?void 0:y.id,S=(0,h.Z)(b);return{...s,percentage_of_remote_result_visible:void 0===m?"empty_remote_result":0===m?"0":m<=.25?"0-25":m<=.5?"25-50":m<=.75?"50-75":m<1?"75-100":1===m?"100":"greater_than_100",wasm_sqlite_initialized:f.Z.state.metricDataStore.state.wasm_sqlite_initialized,wasm_sqlite_storage:f.Z.state.metricDataStore.state.wasm_sqlite_storage,did_prefetch:"hit-match"===(null===(n=o.prefetchCache)||void 0===n||null===(n=n.getPrefetchAnalytic(S))||void 0===n?void 0:n.type),is_mobile_background_launch:(0,u.Z)(),was_server_response_from_cache:i.wasServerResponseFromCache,was_initial_render_empty:e.wasInitialRenderEmpty,collection_request_backend:i.requestBackend,workspace_tag:void 0!==v?d.aX[v]:void 0,time_origin_to_app_start:r.getAppStartTime(),functional_component_page_loading_container:g.default.checkGate({gateName:"functional_component_page_loading_container"})}}function C(e){const t=e.collectionViewStore(),n=null==t?void 0:t.getChartConfig();return{new_data_config:"placeholder"===(null==n?void 0:n.type)||null==n?void 0:n.dataConfig,chart_type:null==t?void 0:t.getChartType()}}},717335:(e,t,n)=>{n.d(t,{$7:()=>_,D0:()=>w,Fc:()=>S,HL:()=>C,IF:()=>A,KV:()=>W,Qz:()=>$,SW:()=>Q,Sb:()=>k,Sj:()=>b,WC:()=>v,_T:()=>R,cq:()=>E,ip:()=>T,li:()=>q,qh:()=>K,rn:()=>m,x:()=>I,xe:()=>J,zZ:()=>f});var o=n(202032),r=n(576205),i=n(334299),a=n(335102),s=n(604308),l=n(709291),c=n(653965),d=n(401898),u=n(433929);const p={text:{operator:"string_contains",value:{type:"exact",value:void 0}},relation:{operator:"relation_contains",value:{type:"exact",value:void 0}},url:{operator:"string_contains",value:{type:"exact",value:void 0}},checkbox:{operator:"checkbox_is",value:{type:"exact",value:void 0}},created_by:{operator:"person_contains",value:{type:"exact",value:void 0}},last_edited_by:{operator:"person_contains",value:{type:"exact",value:void 0}},select:{operator:"enum_is",value:{type:"exact",value:void 0}},multi_select:{operator:"enum_contains",value:{type:"exact",value:void 0}},status:{operator:"status_is",value:{type:"is_group",value:void 0}},person:{operator:"person_contains",value:{type:"exact",value:void 0}},number:{operator:"number_equals",value:{type:"exact",value:void 0}},auto_increment_id:{operator:"number_equals",value:{type:"exact",value:void 0}},date:{operator:"date_is_relative_to",value:{type:"relative",value:"surrounding",unit:"week"}},created_time:{operator:"date_is",value:{type:"exact",value:void 0}},last_edited_time:{operator:"date_is",value:{type:"exact",value:void 0}},last_visited_time:{operator:"date_is",value:{type:"exact",value:void 0}},email:{operator:"string_contains",value:{type:"exact",value:void 0}},phone_number:{operator:"string_contains",value:{type:"exact",value:void 0}},title:{operator:"string_contains",value:{type:"exact",value:void 0}},file:{operator:"is_not_empty"},location:{operator:"location_is",value:{type:"exact",value:void 0}},verification:{operator:"verification_is",value:{type:"exact",value:void 0}}};function m(e){return p[e]}function g(e){return"v2"===e.version?function(e){if(!e.formula2)return{operator:"is_empty"};const t=e.formula2.result_type;if("array"===t.type){const e=(0,a.B8)(t.of);return"array"===e.type||"function"===e.type?{operator:"is_empty"}:"block"===e.type||"unknown"===e.type?{operator:"any",subfilter:m("text")}:{operator:"any",subfilter:m(e.type)}}if("unknown"===t.type||"block"===t.type)return m("text");return m(t.type)}(e):function(e){return e.formula&&e.formula.result_type?m(e.formula.result_type):{operator:"is_empty"}}(e)}function f(e){const{property:t,schema:n}=e,a=n[t];if(!a||"button"===a.type)return{operator:"is_empty"};if("formula"===a.type)return g(a);if("rollup"===a.type){if(a.aggregation&&"show_unique"!==a.aggregation){return m((0,o.W6)((0,o.gu)(a.aggregation)))}{const t=(0,i.gT)(e);if(!t){return{operator:"any",subfilter:{operator:"is_empty"}}}if("rollup"===t.targetPropertySchema.type){return{operator:"any",subfilter:{operator:"is_empty"}}}if("formula"===t.targetPropertySchema.type){const e=g(t.targetPropertySchema);if((0,r.a_)(e))return e;return{operator:"any",subfilter:e}}if("button"===t.targetPropertySchema.type)return{operator:"is_empty"};return{operator:"any",subfilter:m(t.targetPropertySchema.type)}}}return m(a.type)}const h=(0,l.defineMessages)({date_is_within:{defaultMessage:"Is between",id:"collectionFilterMenuHelpers.operator.dateIsWithin"},date_is_relative_to:{defaultMessage:"Is relative to today",id:"collectionFilterMenuHelpers.operator.dateIsRelativeTo"},is_empty:{defaultMessage:"Is empty",id:"collectionFilterMenuHelpers.operator.isEmpty"},is_not_empty:{defaultMessage:"Is not empty",id:"collectionFilterMenuHelpers.operator.isNotEmpty"},string_is:{defaultMessage:"Is",id:"collectionFilterMenuHelpers.operator.stringIs"},string_is_not:{defaultMessage:"Is not",id:"collectionFilterMenuHelpers.operator.stringIsNot"},string_contains:{defaultMessage:"Contains",id:"collectionFilterMenuHelpers.operator.stringContains"},string_does_not_contain:{defaultMessage:"Does not contain",id:"collectionFilterMenuHelpers.operator.stringDoesNotContain"},string_starts_with:{defaultMessage:"Starts with",id:"collectionFilterMenuHelpers.operator.stringStartsWith"},string_ends_with:{defaultMessage:"Ends with",id:"collectionFilterMenuHelpers.operator.stringEndsWith"},checkbox_is:{defaultMessage:"Is",id:"collectionFilterMenuHelpers.operator.checkboxIs"},checkbox_is_not:{defaultMessage:"Is not",id:"collectionFilterMenuHelpers.operator.checkboxIsNot"},enum_is:{defaultMessage:"Is",id:"collectionFilterMenuHelpers.operator.enumIs"},enum_is_not:{defaultMessage:"Is not",id:"collectionFilterMenuHelpers.operator.enumIsNot"},enum_contains:{defaultMessage:"Contains",id:"collectionFilterMenuHelpers.operator.enumContains"},enum_does_not_contain:{defaultMessage:"Does not contain",id:"collectionFilterMenuHelpers.operator.enumDoesNotContain"},status_is:{defaultMessage:"Is",id:"collectionFilterMenuHelpers.operator.statusIs"},status_is_not:{defaultMessage:"Is not",id:"collectionFilterMenuHelpers.operator.statusIsNot"},person_contains:{defaultMessage:"Contains",id:"collectionFilterMenuHelpers.operator.personContains"},person_does_not_contain:{defaultMessage:"Does not contain",id:"collectionFilterMenuHelpers.operator.personDoesNotContain"},relation_contains:{defaultMessage:"Contains",id:"collectionFilterMenuHelpers.operator.relationContains"},relation_does_not_contain:{defaultMessage:"Does not contain",id:"collectionFilterMenuHelpers.operator.relationDoesNotContain"},location_is:{defaultMessage:"Is",id:"collectionFilterMenuHelpers.operator.locationIs"},location_is_not:{defaultMessage:"Is not",id:"collectionFilterMenuHelpers.operator.locationIsNot"},number_equals:{defaultMessage:"=",id:"collectionFilterMenuHelpers.operator.numberEquals"},number_does_not_equal:{defaultMessage:"≠",id:"collectionFilterMenuHelpers.operator.numberDoesNotEqual"},number_greater_than:{defaultMessage:">",id:"collectionFilterMenuHelpers.operator.numberGreaterThan"},number_less_than:{defaultMessage:"<",id:"collectionFilterMenuHelpers.operator.numberLessThan"},number_greater_than_or_equal_to:{defaultMessage:"≥",id:"collectionFilterMenuHelpers.operator.numberGreaterThanOrEqualTo"},number_less_than_or_equal_to:{defaultMessage:"≤",id:"collectionFilterMenuHelpers.operator.numberLessThanOrEqualTo"},date_is:{defaultMessage:"Is",id:"collectionFilterMenuHelpers.operator.dateIs"},date_is_before:{defaultMessage:"Is before",id:"collectionFilterMenuHelpers.operator.dateIsBefore"},date_is_after:{defaultMessage:"Is after",id:"collectionFilterMenuHelpers.operator.dateIsAfter"},date_is_on_or_before:{defaultMessage:"Is on or before",id:"collectionFilterMenuHelpers.operator.dateIsOnOrBefore"},date_is_on_or_after:{defaultMessage:"Is on or after",id:"collectionFilterMenuHelpers.operator.dateIsOnOrAfter"},any:{defaultMessage:"Any",id:"collectionFilterMenuHelpers.operator.any"},none:{defaultMessage:"None",id:"collectionFilterMenuHelpers.operator.none"},every:{defaultMessage:"Every",id:"collectionFilterMenuHelpers.operator.every"},string_has_no_alphabet_prefix:{defaultMessage:"(Not used)",id:"collectionFilterMenuHelpers.operator.stringHasNoAlphabetPrefix"},verification_is:{defaultMessage:"Is",id:"collectionFilterMenuHelpers.operator.verificationStateIs"},verification_is_not:{defaultMessage:"Is not",id:"collectionFilterMenuHelpers.operator.verificationStateIsNot"}});function v(e){return u.default.formatMessage(h[e])}const y=(0,l.defineMessages)({today:{defaultMessage:"Today",id:"collectionFilterMenuHelpers.relativeDates.today"},tomorrow:{defaultMessage:"Tomorrow",id:"collectionFilterMenuHelpers.relativeDates.tomorrow"},yesterday:{defaultMessage:"Yesterday",id:"collectionFilterMenuHelpers.relativeDates.yesterday"},one_week_ago:{defaultMessage:"One week ago",id:"collectionFilterMenuHelpers.relativeDates.oneWeekAgo"},one_week_from_now:{defaultMessage:"One week from now",id:"collectionFilterMenuHelpers.relativeDates.oneWeekFromNow"},one_month_ago:{defaultMessage:"One month ago",id:"collectionFilterMenuHelpers.relativeDates.oneMonthAgo"},one_month_from_now:{defaultMessage:"One month from now",id:"collectionFilterMenuHelpers.relativeDates.oneMonthFromNow"}}),b=(0,l.defineMessages)({past:{defaultMessage:"Past",id:"collectionFilterMenuHelpers.relativeDates.past"},future:{defaultMessage:"Next",id:"collectionFilterMenuHelpers.relativeDates.next"}}),_=(0,l.defineMessages)({direction:{defaultMessage:"Direction",id:"collectionFilterMenuHelpers.relativeDates.direction"},unit:{defaultMessage:"Unit",id:"collectionFilterMenuHelpers.relativeDates.unit"}}),S=(0,l.defineMessages)({this:{defaultMessage:"This",id:"collectionFilterMenuHelpers.relativedates.this"}}),k=(0,l.defineMessages)({day:{defaultMessage:"day",id:"collectionFilterMenuHelpers.relativeDates.day"},week:{defaultMessage:"week",id:"collectionFilterMenuHelpers.relativeDates.week"},month:{defaultMessage:"month",id:"collectionFilterMenuHelpers.relativeDates.month"},year:{defaultMessage:"year",id:"collectionFilterMenuHelpers.relativeDates.year"}}),w=(0,l.defineMessages)({day:{defaultMessage:"days",id:"collectionFilterMenuHelpers.relativeDates.days"},week:{defaultMessage:"weeks",id:"collectionFilterMenuHelpers.relativeDates.weeks"},month:{defaultMessage:"months",id:"collectionFilterMenuHelpers.relativeDates.months"},year:{defaultMessage:"years",id:"collectionFilterMenuHelpers.relativeDates.years"}}),x=(0,l.defineMessages)({exactDate:{defaultMessage:"Custom date",id:"collectionFilterMenuHelpers.relativeDates.exactDate"},exactDateRange:{defaultMessage:"Exact dates",id:"collectionFilterMenuHelpers.relativeDates.exactDateRange"}});function I(e){return"exact"===e.type?u.default.formatMessage(x.exactDate):u.default.formatMessage(y[e.value])}const C=(0,l.defineMessages)({custom:{defaultMessage:"Relative range",id:"collectionFilterMenuHelpers.relativeDates.range"},surrounding:{defaultMessage:"Surrounding range",id:"collectionFilterMenuHelpers.relativeDates.customRange"},this_week:{defaultMessage:"This week",id:"collectionFilterMenuHelpers.relativeDates.thisWeek"},the_past_week:{defaultMessage:"The past week",id:"collectionFilterMenuHelpers.relativeDates.thePastWeek"},the_past_month:{defaultMessage:"The past month",id:"collectionFilterMenuHelpers.relativeDates.thePastMonth"},the_past_year:{defaultMessage:"The past year",id:"collectionFilterMenuHelpers.relativeDates.thePastYear"},the_next_week:{defaultMessage:"The next week",id:"collectionFilterMenuHelpers.relativeDates.theNextWeek"},the_next_month:{defaultMessage:"The next month",id:"collectionFilterMenuHelpers.relativeDates.theNextMonth"},the_next_year:{defaultMessage:"The next year",id:"collectionFilterMenuHelpers.relativeDates.theNextYear"}});function T(e){return"custom"===e.value?function(e){const t=u.default.formatMessage(b[e.direction]),n=1===e.count?u.default.formatMessage(k[e.unit]):u.default.formatMessage(w[e.unit]);return 1===e.count?`${t} ${n}`:`${t} ${e.count} ${n}`}(e):"surrounding"===e.value?function(e){const t=u.default.formatMessage(k[e.unit]);return`${u.default.formatMessage(S.this)} ${t}`}(e):"exact"===e.type?u.default.formatMessage(x.exactDateRange):"relative"===e.type?u.default.formatMessage(C[e.value]):void(0,d.t1)(e)}const M=(0,l.defineMessages)({start_date:{defaultMessage:"Start date",id:"collectionFilterMenuHelpers.dateFilterModes.start_date"},end_date:{defaultMessage:"End date",id:"collectionFilterMenuHelpers.dateFilterModes.end_date"}}),P=(0,l.defineMessages)({start_date:{defaultMessage:"For date ranges, filters on the start date. For individual dates, filters on the date.",id:"collectionFilterMenuHelpers.dateFilterModesTooltip.start_date"},end_date:{defaultMessage:"For date ranges, filters on the end date. For individual dates, filters on the date.",id:"collectionFilterMenuHelpers.dateFilterModesTooltip.end_date"}});function A(e){return u.default.formatMessage(M[e])}function R(e){return u.default.formatMessage(P[e])}const D=(0,l.defineMessages)({and:{defaultMessage:"And",id:"collectionFilterMenuHelpers.combinatorOperators.and"},or:{defaultMessage:"Or",id:"collectionFilterMenuHelpers.combinatorOperators.or"}}),B=(0,l.defineMessages)({checked:{defaultMessage:"Checked",id:"collectionFilterMenuHelpers.checkbox.checked"},unchecked:{defaultMessage:"Unchecked",id:"collectionFilterMenuHelpers.checkbox.unchecked"}});function E(e){return e.value?u.default.formatMessage(s.A3(e.value)):""}function F(e){let{filter:t,schema:n}=e;return j({filter:t.subfilter,schema:n})}function Z(e){let{filter:t}=e;return I(t.value)}function U(e){let{filter:t}=e;return T(t.value)}function V(e){let{filter:t}=e;return`"${t.value.value||""}"`}function N(e){let{filter:t}=e;return void 0===t.value.value?void 0:t.value.value.toString()}function O(e){let{filter:t}=e;return function(e){const t=e.value?B.checked:B.unchecked;return u.default.formatMessage(t)}(t.value)}const L={is_empty:()=>{},is_not_empty:()=>{},string_is:V,string_is_not:V,string_contains:V,string_does_not_contain:V,string_starts_with:V,string_ends_with:V,checkbox_is:O,checkbox_is_not:O,enum_is:V,enum_is_not:V,enum_contains:V,enum_does_not_contain:V,status_is:V,status_is_not:V,relation_contains:()=>{},relation_does_not_contain:()=>{},person_contains:()=>{},person_does_not_contain:()=>{},location_is:()=>{},location_is_not:()=>{},number_equals:N,number_does_not_equal:N,number_greater_than:N,number_less_than:N,number_greater_than_or_equal_to:N,number_less_than_or_equal_to:N,date_is:Z,date_is_before:Z,date_is_after:Z,date_is_on_or_before:Z,date_is_on_or_after:Z,date_is_within:U,date_is_relative_to:U,any:F,none:F,every:F,string_has_no_alphabet_prefix:()=>{},verification_is:V,verification_is_not:V};function j(e){const{filter:t}=e,n=v(t.operator),o=L[t.operator](e);return c.oA([n,o]).join(" ")}function K(e){const{filter:t,schema:n}=e;if((0,r.vA)(t)){const e=t.filters||[],o=c.oA(e.map((e=>{const t=K({filter:e,schema:n});if(t)return(0,r.vA)(e)?`(${t})`:t}))),i=u.default.formatMessage(D[t.operator]);return o.join(` ${i} `)}if((0,r.aN)(t)){const e=n[t.property];if(!e)return;const o=t.filter,r=e.name,i=j({filter:o,schema:n});return c.oA([r,i]).join(" ")}}const z={text:function(e,t){return(0,r._N)(t)?{operator:t}:(0,r.mv)(e)?{operator:t,value:{type:"exact",value:void 0}}:"string_has_no_alphabet_prefix"===e.operator?{operator:t}:{operator:t,value:e.value}},number:function(e,t){return(0,r._N)(t)?{operator:t}:(0,r.mv)(e)?{operator:t,value:{type:"exact",value:void 0}}:{operator:t,value:e.value}},checkbox:function(e,t){return{operator:t,value:e.value}},select:function(e,t){return(0,r._N)(t)?{operator:t}:(0,r.mv)(e)?{operator:t,value:{type:"exact",value:void 0}}:{operator:t,value:e.value}},multi_select:function(e,t){return(0,r._N)(t)?{operator:t}:(0,r.mv)(e)?{operator:t,value:{type:"exact",value:void 0}}:{operator:t,value:e.value}},status:function(e,t){return(0,r._N)(t)?{operator:t}:(0,r.mv)(e)?{operator:t,value:{type:"is_option",value:void 0}}:{operator:t,value:e.value}},relation:function(e,t){return(0,r._N)(t)?{operator:t}:(0,r.mv)(e)?{operator:t,value:{type:"exact",value:void 0}}:{operator:t,value:e.value}},person:function(e,t){return(0,r._N)(t)?{operator:t}:(0,r.mv)(e)?{operator:t,value:{type:"exact",value:void 0}}:{operator:t,value:e.value}},date:function(e,t,n){if((0,r._N)(t))return{operator:t};const o=(0,r.mv)(e)?void 0:e.use_end;return"date_is_within"===t?"date_is_within"!==e.operator?{operator:t,value:{type:"exact",value:void 0},use_end:o}:e:"date_is_relative_to"===t?"date_is_relative_to"!==e.operator?{operator:t,value:{type:"relative",value:"surrounding",unit:"week"},use_end:o}:e:(0,r.TQ)(e)?"combinator"===n?{operator:t,value:{type:"relative",value:"today"},use_end:o}:{operator:t,value:{type:"exact",value:void 0},use_end:o}:(0,r.mv)(e)?{operator:t,value:{type:"exact",value:void 0}}:{operator:t,value:e.value,use_end:o}},file:function(e,t){return{operator:t}},location:function(e,t){return{operator:t,value:e.value}},verification:function(e,t){return{operator:t,value:e.value}}};function q(e,t,n,o){return(0,z[e])(t,n,o)}const H=(0,l.defineMessages)({and:{defaultMessage:"And",id:"database.filterOperators.and"},or:{defaultMessage:"Or",id:"database.filterOperators.or"}}),G=(0,l.defineMessages)({and:{defaultMessage:"All filters must match",id:"database.filterOperators.andCaption"},or:{defaultMessage:"At least one filter must match",id:"database.filterOperators.orCaption"}});function W(e,t){return"and"===e?t.formatMessage(H.and):t.formatMessage(H.or)}function $(e,t){return"and"===e?t.formatMessage(G.and):t.formatMessage(G.or)}const Y=(0,l.defineMessages)({any:{defaultMessage:"Any",id:"database.filterOperators.any"},every:{defaultMessage:"Every",id:"database.filterOperators.every"},none:{defaultMessage:"None",id:"database.filterOperators.none"}});function Q(e,t){return"any"===e?t.formatMessage(Y.any):"every"===e?t.formatMessage(Y.every):t.formatMessage(Y.none)}const J=(0,l.defineMessages)({number:{id:"collectionFilterMenuFilter.filterOperators.number.order",defaultMessage:"{operator}{operatorValue}"},text:{id:"collectionFilterMenuFilter.filterOperators.text.order",defaultMessage:"{operator}{operatorValue}"},checkbox:{id:"collectionFilterMenuFilter.filterOperators.checkbox.order",defaultMessage:"{operator}{operatorValue}"},select:{id:"collectionFilterMenuFilter.filterOperators.select.order",defaultMessage:"{operator}{operatorValue}"},multi_select:{id:"collectionFilterMenuFilter.filterOperators.multi_select.order",defaultMessage:"{operator}{operatorValue}"},status:{id:"collectionFilterMenuFilter.filterOperators.status.order",defaultMessage:"{operator}{operatorValue}"},relation:{id:"collectionFilterMenuFilter.filterOperators.relation.order",defaultMessage:"{operator}{operatorValue}"},location:{id:"collectionFilterMenuFilter.filterOperators.location.order",defaultMessage:"{operator}{operatorValue}"},person:{id:"collectionFilterMenuFilter.filterOperators.person.order",defaultMessage:"{operator}{operatorValue}"},date:{id:"collectionFilterMenuFilter.filterOperators.date.order",defaultMessage:"{operator}{operatorValue}"},file:{id:"collectionFilterMenuFilter.filterOperators.file.order",defaultMessage:"{operator}{operatorValue}"},verification:{id:"collectionFilterMenuFilter.filterOperators.verification.order",defaultMessage:"{operator}{operatorValue}"}})},892918:(e,t,n)=>{n.d(t,{Cz:()=>R,F6:()=>Z,II:()=>E,XD:()=>S,_1:()=>F,ar:()=>P,ej:()=>T,ew:()=>w,fZ:()=>I,h6:()=>B,h8:()=>V,kW:()=>k,nX:()=>x,nr:()=>M,qW:()=>A,xg:()=>C});n(757658);var o=n(371663),r=n(435011),i=n(114714),a=n(399036),s=n(897058),l=n(407057),c=n(253877),d=n(238297),u=n(842875),p=n(423512),m=n(709291),g=n(531701),f=n(653965),h=n(401898),v=n(708661),y=n(426991),b=n(433929),_=n(729376);const S=10,k=10,w=50,x=(0,m.defineMessages)({unsupportedGroupAction:{id:"collectionGroupHelpers.unsupportedGroupAction",defaultMessage:"Selected group is not available for this task."},emptyGroupLabel:{id:"database.boardView.uncategorizedColumnTitle",defaultMessage:"No {name}"},today:{id:"database.collectionGroupValue.dateGroup.today",defaultMessage:"Today"},yesterday:{id:"database.collectionGroupValue.dateGroup.yesterday",defaultMessage:"Yesterday"},last_7_days:{id:"database.collectionGroupValue.dateGroup.last7Days",defaultMessage:"Last 7 days"},last_30_days:{id:"database.collectionGroupValue.dateGroup.last_30Days",defaultMessage:"Last 30 days"},tomorrow:{id:"database.collectionGroupValue.dateGroup.tomorrow",defaultMessage:"Tomorrow"},next_7_days:{id:"database.collectionGroupValue.dateGroup.next7Days",defaultMessage:"Next 7 days"},next_30_days:{id:"database.collectionGroupValue.dateGroup.next30Days",defaultMessage:"Next 30 days"},week_differingStartAndEndYear:{id:"database.collectionGroupValue.dateGroup.week.differingStartAndEndYear",defaultMessage:"{startMonth} {startDay} {startYear} – {endMonth} {endDay} {endYear}"},week_differingStartAndEndMonth:{id:"database.collectionGroupValue.dateGroup.week.differingStartAndEndMonth",defaultMessage:"{startMonth} {startDay} – {endMonth} {endDay} {startYear}"},week_sameStartAndEndMonth:{id:"database.collectionGroupValue.dateGroup.week.sameStartAndEndMonth",defaultMessage:"{startMonth} {startDay} – {endDay} {startYear}"},out_of_range:{id:"database.collectionGroupValue.numberGroup.outOfRange",defaultMessage:"Out of range"},range:{id:"database.collectionGroupValue.numberGroup.range",defaultMessage:"{start} to {end}"}});function I(e){let{intl:t,value:n}=e;if("today"===n.type)return t.formatMessage(x.today);if("yesterday"===n.type)return t.formatMessage(x.yesterday);if("last_7_days"===n.type)return t.formatMessage(x.last_7_days);if("last_30_days"===n.type)return t.formatMessage(x.last_30_days);if("tomorrow"===n.type)return t.formatMessage(x.tomorrow);if("next_7_days"===n.type)return t.formatMessage(x.next_7_days);if("next_30_days"===n.type)return t.formatMessage(x.next_30_days);if("day"===n.type){const e=(0,c.NK)(n.range,(0,u.r)(),t.locale);return(0,l.ZW)(e.start,"medium")}if("week"===n.type){const e=(0,c.NK)(n.range,(0,u.r)(),t.locale),o=(0,l.ZW)(e.start,"month_short"),r=(0,l.ZW)(e.start,"day"),i=e.start.year,a=(0,l.ZW)(e.end,"month_short"),s=(0,l.ZW)(e.end,"day"),d=e.end.year;return i!==d?t.formatMessage(x.week_differingStartAndEndYear,{startMonth:o,startDay:r,endMonth:a,endDay:s,startYear:i,endYear:d}):o!==a?t.formatMessage(x.week_differingStartAndEndMonth,{startMonth:o,startDay:r,endMonth:a,endDay:s,startYear:i}):t.formatMessage(x.week_sameStartAndEndMonth,{startMonth:o,startDay:r,endDay:s,startYear:i})}if("month"===n.type){const e=(0,c.NK)(n.range,(0,u.r)(),t.locale);return(0,l.ZW)(e.start,"month_year_short")}if("year"===n.type){return(0,c.NK)(n.range,(0,u.r)(),t.locale).start.year.toString()}(0,h.t1)(n)}function C(e){let{intl:t,value:n,format:o}=e;if("out_of_range"===n.type)return t.formatMessage(x.out_of_range);if("range"===n.type){const e=p.uf(n.start,o,t),r=p.uf(n.end,o,t);return t.formatMessage(x.range,{start:e,end:r})}if("unique"===n.type){return p.uf(n.value,o,t)}(0,h.t1)(n)}function T(e){const{groupBy:t,schema:n,format:o,filter:r,groupsFormatKey:a,limit:s}=e,l=n[t.property];if(!l||!(0,i.LG)(l))return;const c=o[a]||[],d=c.reduce(((e,t)=>(0,i.eF)(t)?e+1:e),0);return{type:"groups",groupBy:t,filter:r,groupSortPreference:c.map((e=>e.value)),limit:s+d}}function M(e,t,n){const o=e.filter((e=>!(0,i.ZH)(e,t))),r=o.filter((e=>!(0,i.eF)(e))),a=o.filter((e=>(0,i.eF)(e)));return[...r.slice(0,n-1),t,...r.slice(n-1),...a]}function P(e,t){const n=e.filter((e=>!(0,i.ZH)(e,t))),o=n.filter((e=>!(0,i.eF)(e))),r=n.filter((e=>(0,i.eF)(e)));return[...o,t,...r]}function A(e){return!e.device.isPhone&&(e.isFullScreen||e.isRootChild)}function R(e){const{schema:t,groupBy:n,schemaGroups:a,reducerResults:l,relativeVariableResult:c,getRecordModel:d,viewAppConfigUri:u,allowedCollectionStores:p,renderGroupsFromAggregationArgs:m,removeUncategorized:g}=e;if(!n)return[];const h=t[n.property];if(!h||!(0,i.LG)(h))return[];const y=new Set(p.map((e=>e.id))),b=[...e.formatGroups,...a&&!l?a.map((e=>({property:n.property,value:e}))):[]];let _;if("manual"!==(0,i.mu)(n).type||m){let e=l;l&&m&&(e=function(e,t){const n=t.aggregationResults,o=t.yAxisSortOrder;return n&&o?f.Xo(e,(e=>{var n;const o=e.value,r=(0,i.Hd)(o);return null===(n=t.groupTotals.get(r))||void 0===n?void 0:n.total}),[o]):e}(l,m));const t=new Map;for(const n of b)t.set((0,i.mD)(n),n);_=e?e.map((e=>{let{value:o}=e;return t.get((0,i.Hd)(o))||{property:n.property,value:o}})):[];for(const n of b)_.push(n)}else{if(_=b,l)for(const{value:e}of l){const t={property:n.property,value:e};_.push(t)}u===o.sV&&(_=(0,s.gd)(_,e.formatGroups.map((e=>e.value))))}if(l){if(n.hideEmptyGroups){const e=new Set,t=new Set;for(const n of l){const o=(0,i.Hd)(n.value);0===n.total?t.add(o):e.add(o)}_=_.map((n=>{const o=(0,i.mD)(n);if(t.has(o))return{...n,emptyHidden:!0};if(e.has(o)){const e={...n};return delete e.emptyHidden,e}return n}))}else _=_.map((e=>{if(e.emptyHidden){const t={...e};return delete t.emptyHidden,t}return e}));_=u===o.sV&&n.property===o.Es.TaskToSprintRelation?_.map((e=>"relation"===e.value.type&&(0,i.t2)(e.value.value)||void 0===e.value||void 0===e.value.value?e:{...e,hiddenByDefault:!0})):_.map((e=>{if(e.hiddenByDefault){const t={...e};return delete t.hiddenByDefault,t}return e}))}const S=_.filter((e=>{if(e.property!==n.property)return!1;const t=e.value;if(t.type!==h.type)return!1;if(g&&void 0===t.value)return!1;if(m&&m.hideZeroAggregations){var o;const e=(0,i.Hd)(t),n=null===(o=m.groupTotals.get(e))||void 0===o?void 0:o.total;if(void 0!==n&&0===n)return!1}if(void 0===t.value)return!(0,v.Dt)(h);if("formula"===h.type){const t=(0,r.mm)(h);if(!h.formula&&!h.formula2||"unknown"===t)return!1;if("formula"!==e.value.type||"formula"!==n.type)return!1;const o=e.value.value;if(!o)return!0;if("block"===t&&"text"===o.type)return!0;if(o.type!==t)return!1;const a=n.groupBy;return"relation"===a.type?function(e,t,n){if(!e||!e.value)return!0;if("relation"!==t.type||"relation"!==e.type)return!1;if((0,i.t2)(e.value))return!1;const o=n(e.value);return null==o?void 0:o.alive}(o,{...a,property:n.property},d):D({groupValue:o,groupBy:{property:n.property,...a},getRecordModel:d,relativeVariableResult:c})}return!("location"===t.type&&t.value&&!y.has(t.value.id))&&D({groupValue:t,groupBy:n,getRecordModel:d,relativeVariableResult:c,propertySchema:h})}));return f.mN(S,(e=>(0,i.mD)(e)))}function D(e){const{groupValue:t,groupBy:n,getRecordModel:o,relativeVariableResult:r,propertySchema:a}=e;if(!t.value)return!0;const s=n.type;if("formula"===s)return!1;if("select"===s){if("select"!==(null==a?void 0:a.type))return!1;return(a.options??[]).some((e=>e.value===t.value))}if("multi_select"===s){if("multi_select"!==(null==a?void 0:a.type))return!1;return(a.options??[]).some((e=>e.value===t.value))}if("status"===s){if("status"!==(null==a?void 0:a.type))return!1;const e=a.options??[],o=a.groups??[];if("status"!==t.type)return!1;const{value:r}=t;return"by_group"===r.type?("status"!==s||"group"===n.groupBy)&&o.some((e=>e.name===r.group)):"by_option"===r.type&&(("status"!==s||"option"===n.groupBy)&&e.some((e=>e.value===r.option)))}return(0,i.A1)(s)?function(e,t){if(!e||!e.value)return!0;if(!(0,i.ib)(t)||!(0,i.Mc)(e)||!t.groupBy)return!1;const n=e.value.type;if("relative"===t.groupBy)return"today"===n||"yesterday"===n||"last_7_days"===n||"last_30_days"===n||"tomorrow"===n||"next_7_days"===n||"next_30_days"===n||"month"===n;if("day"===t.groupBy)return"day"===n;if("week"===t.groupBy)return"week"===n;if("month"===t.groupBy)return"month"===n;if("year"===t.groupBy)return"year"===n;(0,h.t1)(t.groupBy)}(t,n):(0,i.HB)(s)?function(e,t){if(!e||!e.value)return!0;if(!(0,i.aB)(t)||!(0,i.R7)(e)||!t.groupBy)return!1;const n=e.value.type;if("alphabet_prefix"===t.groupBy)return"alphabet_prefix"===n||"other"===n;if("exact"===t.groupBy)return"exact"===n;(0,h.t1)(t.groupBy)}(t,n):"number"===s?function(e,t){if(!e||!e.value)return!0;if("number"!==t.type||"number"!==e.type)return!1;const n=e.value;if("out_of_range"===n.type)return n.start===t.start&&n.end===t.end;if("range"===n.type){const e=(0,i.n6)(n.start,t.start,t.end,t.size);return e&&"range"===e.type&&e.start===n.start}if("unique"===n.type){const e=(0,i.n6)(n.value,t.start,t.end,t.size,t.groupBy);return e&&"unique"===e.type&&e.value===n.value}(0,h.t1)(n)}(t,n):"relation"===s?"relation"===(null==a?void 0:a.type)&&function(e,t,n,o,r){var a;if(!t||!t.value)return!0;if("relation"!==n.type||"relation"!==t.type)return!1;if((0,i.t2)(t.value)){var s,l;const n=e.collection_pointer&&o(e.collection_pointer);if(!r||!n)return!1;const i=null==n||null===(s=n.getFormat())||void 0===s?void 0:s.app_config_uri,a=null===(l=r[n.id])||void 0===l?void 0:l[t.value.value.variable],c=null==n?void 0:n.getSchema();return(0,y.Sh)(c,i)&&a}const c=o(t.value);if(!c)return!1;const u=(0,d.ky)({block:c,getRecordModel:o});if(r&&u){if((0,i.qQ)({relativeVariableValues:r[null==u?void 0:u.id],pointer:c.pointer}).length>0)return!1}return Boolean(c.alive&&((null==u?void 0:u.id)===e.collection_id||(null==u?void 0:u.id)===(null===(a=e.collection_pointer)||void 0===a?void 0:a.id)))}(a,t,n,o,r):"location"===s?function(e,t,n){if(!e||!e.value)return!0;if("location"!==t.type||"location"!==e.type)return!1;const o=n(e.value);return Boolean(o)}(t,n,o):!(!(0,i.pd)(s)&&"checkbox"!==s)||void(0,h.t1)(s)}function B(e){var t;const n=null===(t=e.board_columns_by)||void 0===t?void 0:t.disableBoardColorColumns;return void 0===n||n}function E(e){const{environment:t,groupFormat:n,schema:r,format:s,theme:l,ignoreDisableColorColumns:c}=e,d=!c&&B(s);if(s.collection_group_by||!d){if(n){const e=r[n.property];if(e&&!d){const r=n.value;if((0,a.cu)(e)){const t=(e.options||[]).find((e=>e.value===r.value));return(0,g.bw)(l,null==t?void 0:t.color)}if("status"===e.type&&"status"===r.type){var u,p;let t;if("by_group"===(null===(u=r.value)||void 0===u?void 0:u.type)){var m;const n=r.value.group;var f;if(t=null===(m=e.groups)||void 0===m||null===(m=m.find((e=>e.name===n)))||void 0===m?void 0:m.color,void 0===t)t=null===(f=(0,a.I4)(e.name,b.default.getIntl()).groups)||void 0===f||null===(f=f.find((e=>e.name.toLowerCase()===n.toLowerCase())))||void 0===f?void 0:f.color}else if("by_option"===(null===(p=r.value)||void 0===p?void 0:p.type)){var h;const n=r.value.option;t=null===(h=e.options)||void 0===h||null===(h=h.find((e=>e.value===n)))||void 0===h?void 0:h.color}return(0,g.bw)(l,t)}if("relation"===e.type&&"relation"===r.type&&(0,i.t2)(r.value)){const n=(0,_.gO)(e,t),i=(0,_.uJ)(e,t),a=null==n?void 0:n.getPropertyMapping(),s=null==a?void 0:a[o.b0.StatusV2],c=i&&s&&i[s];if(c&&"status"===c.type){var v;const e=r.value.value.variable,t=null===(v=c.options)||void 0===v||null===(v=v.find((t=>t.id===e)))||void 0===v?void 0:v.color;if(t)return(0,g.bw)(l,t)}}}}return(0,g.bw)(l,"default")}}function F(e){return!("board"===e.viewType&&"board_columns_by"===e.groupByKey)&&"chart"!==e.viewType}function Z(e){const{stores:t,collectionContextStore:n}=e,o=n.collectionStoresStore.state.map((e=>e.id));return"collectionTypedView"===n.contextType?t.filter((e=>{const t=e.getAssociatedCollectionStore();return t&&o.includes(t.id)})):t}const U=(0,m.defineMessages)({manual:{defaultMessage:"Manual",id:"database.viewSettings.groupTab.sortType.manual"},oldestFirst:{defaultMessage:"Oldest first",id:"database.viewSettings.groupTab.sortType.chronological"},alphabetical:{defaultMessage:"Alphabetical",id:"database.viewSettings.groupTab.sortType.alphabetical"},ascending:{defaultMessage:"Ascending",id:"database.viewSettings.groupTab.sortType.ascending"},newestFirst:{defaultMessage:"Newest first",id:"database.viewSettings.groupTab.sortType.reverseChronological"},reverseAlphabetical:{defaultMessage:"Reverse alphabetical",id:"database.viewSettings.groupTab.sortType.reverseAlphabetical"},descending:{defaultMessage:"Descending",id:"database.viewSettings.groupTab.sortType.descending"}});function V(e,t){return"manual"===t?U.manual:"ascending"===t?(0,i.ib)(e)||"formula"===e.type&&"date"===e.groupBy.type?U.oldestFirst:(0,i.aB)(e)||"relation"===e.type||"select"===e.type||"multi_select"===e.type||"formula"===e.type&&"text"===e.groupBy.type?U.alphabetical:U.ascending:"descending"===t?(0,i.ib)(e)||"formula"===e.type&&"date"===e.groupBy.type?U.newestFirst:(0,i.aB)(e)||"relation"===e.type||"select"===e.type||"multi_select"===e.type||"formula"===e.type&&"text"===e.groupBy.type?U.reverseAlphabetical:U.descending:void(0,h.t1)(t)}},708661:(e,t,n)=>{n.d(t,{yZ:()=>A,_W:()=>W,Sb:()=>G,_Y:()=>O,DL:()=>V,oy:()=>N,Km:()=>L,Bh:()=>Z,aW:()=>U,r_:()=>$,W3:()=>q,TP:()=>H,k4:()=>Y,BX:()=>X,JI:()=>j,K8:()=>K,Dt:()=>Q,tH:()=>ee,Rb:()=>E,Gu:()=>J,SO:()=>D});var o=n(541432),r=n(598953),i=n(399036),a=n(180951),s=n(709410),l=n(519889),c=n(803791),d=n(421838),u=n(709291),p=n(433929),m=n(481364),g=n(179973),f=n(517215),h=n(626701),v=n(102656),y=(n(667294),n(745238)),b=n(785893);const _=(0,y.IU)("collectionPieChart",{viewBox:"0 0 18 17",svg:(0,b.jsx)("path",{d:"M9 16.4297C4.58594 16.4297 0.929688 12.7812 0.929688 8.35938C0.929688 3.94531 4.57812 0.289062 8.99219 0.289062C13.4141 0.289062 17.0703 3.94531 17.0703 8.35938C17.0703 12.7812 13.4141 16.4297 9 16.4297ZM9 14.8438C10.5469 14.8438 11.9688 14.3047 13.0781 13.4062L8.59375 9.03125C8.44531 8.88281 8.38281 8.73438 8.38281 8.52344V1.90625C5.07812 2.21094 2.52344 4.96875 2.52344 8.35938C2.52344 11.9531 5.40625 14.8438 9 14.8438ZM9.625 7.57031L14.4375 4.8125C13.3828 3.21094 11.6484 2.10156 9.625 1.90625V7.57031ZM10.1406 8.71094L13.9922 12.5078C14.9219 11.3828 15.4844 9.9375 15.4844 8.35938C15.4844 7.49219 15.3125 6.67188 15.0078 5.92188L10.1406 8.71094Z"})});var S=n(175453),k=n(297856),w=n(334017),x=n(80444),I=n(896026),C=n(288280),T=n(120315),M=n(637034),P=n(195697);const A=32,R=(0,u.defineMessages)({title:{defaultMessage:"Title",id:"database.propertyTypeName.title"},text:{defaultMessage:"Text",id:"database.propertyTypeName.text"},number:{defaultMessage:"Number",id:"database.propertyTypeName.number"},url:{defaultMessage:"URL",id:"database.propertyTypeName.url"},select:{defaultMessage:"Select",id:"database.propertyTypeName.select"},multi_select:{defaultMessage:"Multi-select",id:"database.propertyTypeName.multi_select"},status:{defaultMessage:"Status",id:"database.propertyTypeName.status"},person:{defaultMessage:"Person",id:"database.propertyTypeName.person"},email:{defaultMessage:"Email",id:"database.propertyTypeName.email"},phone_number:{defaultMessage:"Phone",id:"database.propertyTypeName.phone_number"},date:{defaultMessage:"Date",id:"database.propertyTypeName.date"},file:{defaultMessage:"Files & media",id:"database.propertyTypeName.file"},checkbox:{defaultMessage:"Checkbox",id:"database.propertyTypeName.checkbox"},formula:{defaultMessage:"Formula",id:"database.propertyTypeName.formula"},relation:{defaultMessage:"Relation",id:"database.propertyTypeName.relation"},rollup:{defaultMessage:"Rollup",id:"database.propertyTypeName.rollup"},created_time:{defaultMessage:"Created time",id:"database.propertyTypeName.created_time"},created_by:{defaultMessage:"Created by",id:"database.propertyTypeName.created_by"},last_edited_time:{defaultMessage:"Last edited time",id:"database.propertyTypeName.last_edited_time"},last_edited_by:{defaultMessage:"Last edited by",id:"database.propertyTypeName.last_edited_by"},last_visited_time:{defaultMessage:"Last visited time",id:"database.propertyTypeName.last_visited_time"},button:{defaultMessage:"Button",id:"database.propertyTypeName.button"},auto_increment_id:{defaultMessage:"ID",id:"database.propertyTypeName.auto_increment_id"},location:{defaultMessage:"Location",id:"database.propertyTypeName.location"},verification:{defaultMessage:"Verification",id:"database.propertyTypeName.verification"},ai_summary:{defaultMessage:"AI summary",id:"database.propertyTypeName.text.summarizeWithAi"},ai_custom_prompt:{defaultMessage:"AI custom autofill",id:"database.propertyTypeName.text.customPromptWithAI"},ai_extract:{defaultMessage:"AI key info",id:"database.propertyTypeName.text.extractInfoWithAI"},ai_translate:{defaultMessage:"AI translation",id:"database.propertyTypeName.text.translateWithAI"},ai_keywords:{defaultMessage:"AI keywords",id:"database.propertyTypeName.text.keywordsWithAI"}}),D={title:p.default.formatMessage(R.title),text:p.default.formatMessage(R.text),number:p.default.formatMessage(R.number),url:p.default.formatMessage(R.url),select:p.default.formatMessage(R.select),multi_select:p.default.formatMessage(R.multi_select),status:p.default.formatMessage(R.status),person:p.default.formatMessage(R.person),email:p.default.formatMessage(R.email),phone_number:p.default.formatMessage(R.phone_number),date:p.default.formatMessage(R.date),file:p.default.formatMessage(R.file),checkbox:p.default.formatMessage(R.checkbox),formula:p.default.formatMessage(R.formula),relation:p.default.formatMessage(R.relation),rollup:p.default.formatMessage(R.rollup),created_time:p.default.formatMessage(R.created_time),created_by:p.default.formatMessage(R.created_by),last_edited_time:p.default.formatMessage(R.last_edited_time),last_edited_by:p.default.formatMessage(R.last_edited_by),last_visited_time:p.default.formatMessage(R.last_visited_time),button:p.default.formatMessage(R.button),auto_increment_id:p.default.formatMessage(R.auto_increment_id),location:p.default.formatMessage(R.location),verification:p.default.formatMessage(R.verification),ai_summary:p.default.formatMessage(R.ai_summary),ai_custom_prompt:p.default.formatMessage(R.ai_custom_prompt),ai_extract:p.default.formatMessage(R.ai_extract),ai_translate:p.default.formatMessage(R.ai_translate),ai_keywords:p.default.formatMessage(R.ai_keywords)};(0,u.defineMessages)({text:{defaultMessage:"A single line of text.",id:"database.propertyTypeDescription.text"},number:{defaultMessage:"A number, with options to format as currency, percent, and more.",id:"database.propertyTypeDescription.number"},url:{defaultMessage:"A link to a page on the web.",id:"database.propertyTypeDescription.url"},select:{defaultMessage:"Select from a list of options.",id:"database.propertyTypeDescription.select"},multi_select:{defaultMessage:"Tag with values from a list of options.",id:"database.propertyTypeDescription.multi_select"},status:{defaultMessage:"Tag with a list of custom options with groups",id:"database.propertyTypeDescription.status"},person:{defaultMessage:"Reference a person on your team.",id:"database.propertyTypeDescription.person"},email:{defaultMessage:"Reference an email address.",id:"database.propertyTypeDescription.email"},phone_number:{defaultMessage:"Reference a phone number.",id:"database.propertyTypeDescription.phone_number"},date:{defaultMessage:"A date, with options to format and include time.",id:"database.propertyTypeDescription.date"},file:{defaultMessage:"Upload files and images.",id:"database.propertyTypeDescription.file"},checkbox:{defaultMessage:"Track status with a single checkbox.",id:"database.propertyTypeDescription.checkbox"},formula:{defaultMessage:"Compute a formula using other properties of a page.",id:"database.propertyTypeDescription.formula"},relation:{defaultMessage:"Allow pages in this database to reference pages in another.",id:"database.propertyTypeDescription.relation"},rollup:{defaultMessage:"Display and summarize data from a relation.",id:"database.propertyTypeDescription.rollup"},created_time:{defaultMessage:"Reference the date and time a page was created.",id:"database.propertyTypeDescription.created_time"},created_by:{defaultMessage:"Reference the person that created a page.",id:"database.propertyTypeDescription.created_by"},last_edited_time:{defaultMessage:"Reference the date and time a page was last edited.",id:"database.propertyTypeDescription.last_edited_time"},last_edited_by:{defaultMessage:"Reference the person that last edited a page.",id:"database.propertyTypeDescription.last_edited_by"},last_visited_time:{defaultMessage:"Reference the date and time a page was last visited by you.",id:"database.propertyTypeDescription.last_visited_time"},button:{defaultMessage:"A clickable button that can be configured to perform any action.",id:"database.propertyTypeDescription.button"},auto_increment_id:{defaultMessage:"An auto-increment ID.",id:"database.propertyTypeDescription.auto_increment_id"},location:{defaultMessage:"A location.",id:"database.propertyTypeDescription.location"},verification:{defaultMessage:"Verified status.",id:"database.propertyTypeDescription.verification"}});const B=["select","multi_select","status","person","date","created_time","created_by","last_edited_time","last_edited_by"];function E(e){return B.includes(e.type)}const F=(0,u.defineMessages)({tableDisplayName:{defaultMessage:"Table",id:"collectionHelpers.table.displayName"},boardDisplayName:{defaultMessage:"Board",id:"collectionHelpers.board.displayName"},calendarDisplayName:{defaultMessage:"Calendar",id:"collectionHelpers.calendar.displayName"},listDisplayName:{defaultMessage:"List",id:"collectionHelpers.list.displayName"},galleryDisplayName:{defaultMessage:"Gallery",id:"collectionHelpers.gallery.displayName"},timelineDisplayName:{defaultMessage:"Timeline",id:"collectionHelpers.timline.displayName"},pageDisplayName:{defaultMessage:"Page",id:"collectionHelpers.page.displayName"},chartDisplayName:{defaultMessage:"Chart",id:"collectionHelpers.chart.displayName"},formEditorDisplayName:{defaultMessage:"Form",id:"collectionHelpers.formEditor.displayName"}}),Z={table:p.default.formatMessage(F.tableDisplayName),board:p.default.formatMessage(F.boardDisplayName),calendar:p.default.formatMessage(F.calendarDisplayName),list:p.default.formatMessage(F.listDisplayName),gallery:p.default.formatMessage(F.galleryDisplayName),timeline:p.default.formatMessage(F.timelineDisplayName),page:p.default.formatMessage(F.pageDisplayName),chart:p.default.formatMessage(F.chartDisplayName),form_editor:p.default.formatMessage(F.formEditorDisplayName)},U={table:S.t,board:m.i,calendar:g.N,list:v.O,gallery:h.n,timeline:k._,page:v.O,chart:_,form_editor:f.E},V={table:void 0,board:"board_cover",calendar:void 0,list:void 0,gallery:"gallery_cover",timeline:void 0,page:void 0,chart:void 0,form_editor:void 0},N={table:void 0,board:"board_cover_size",calendar:void 0,list:void 0,gallery:"gallery_cover_size",timeline:void 0,page:void 0,chart:void 0,form_editor:void 0},O={table:void 0,board:"board_cover_aspect",calendar:void 0,list:void 0,gallery:"gallery_cover_aspect",timeline:void 0,page:void 0,chart:void 0,form_editor:void 0},L={table:!0,board:!1,calendar:!1,list:!0,gallery:!0,timeline:!0,page:!1,chart:!0,form_editor:!1};function j(e){const t=e.getType(),n=e.getTitleStore();return t&&(0,o.dM)(t)&&n?n:e.getBlockTitleStore()}function K(e,t){let n=[];switch(t){case"gallery":e&&e.gallery_properties&&(n=e.gallery_properties);break;case"board":e&&e.board_properties&&(n=e.board_properties)}const o=n.find((e=>{let{property:t}=e;return"title"===t}));return!!o&&Boolean(o.visible)}const z=["text","number","select","multi_select","status","date","person","file","checkbox","url","email","phone_number","formula","relation","rollup","created_time","created_by","last_edited_time","last_edited_by","button","auto_increment_id","location","verification"];function q(e){let{collectionContextStore:t,environment:n}=e;const o=t.collectionStore();if(!o)return[];const r=I.Z.getMode(n,o);return(0,T.mX)(n,r,o)?["ai_summary","ai_custom_prompt","ai_translate",(0,T.KZ)()?"ai_keywords":"ai_extract"]:[]}function H(e){return z.filter((t=>{if("location"===t&&(!(0,P.QI)()||"collectionTypedView"!==e.contextType))return!1;if("verification"===t){const t=e.collectionViewBlockStore(),n=null==t?void 0:t.getSchema();if(null==t||!t.isCollectionViewPageWithContent())return!1;if(!n||function(e,t){for(const o in e){var n;if((null===(n=e[o])||void 0===n?void 0:n.type)===t)return!0}return!1}(n,"verification"))return!1}return"auto_increment_id"!==t&&"button"!==t||!w.Z.state.isOpen}))}function G(e){let{propertySchema:t,property:n,blockStores:o,collectionSchema:s}=e;return!(0===o.length||!(0,a.GL)(t))&&((0,i.iE)(t)?o.every((e=>W(t,e,s))):!(0,i.ZY)(t.type)&&!(0,r.w)(n))}function W(e,t,n){const o=e.verifier_property;if(!o)return!1;const r=t.getPropertyValue(o),i=(0,a.DW)({textValue:r,propertySchema:n[o],blockCreatorPointer:t.getCreatedByPointer()}),s=x.default.state.currentUserRootStore;return!!s&&i.some((e=>e.id===s.id&&e.table===l.KJ))}function $(e){const{collectionStore:t,environment:n,intl:o,queryForFilter:r}=e;if(""===r)return!0;return(0,M.vU)({environment:n,intl:o,store:t}).toUpperCase().includes(r.toUpperCase())}function Y(){var e;const t=(null===(e=C.subscriptionDataStoreInstance.state)||void 0===e?void 0:e.addOns)??[];return(0,c.de)(t)}function Q(e){return"status"===e.type&&void 0!==e.defaultOption||"person"===e.type&&void 0!==e.default}function J(e){const{collectionContextStore:t,newValue:n,property:o}=e,r=X(t),i=Object.keys(r).find((e=>{var t;return e!==o&&(null===(t=r[e])||void 0===t?void 0:t.name)===n}));return Boolean(i)}function X(e){const t=e.collectionStore();return t?t.getSchema():e.normalizedSchemaStore.state||{}}function ee(e,t,n,o){var r;const i=n.getAssociatedCollectionStore();if(!i||"collection"!==i.table||!i.getSchema())return!1;if("text"!==(null===(r=(0,a.Qm)({schema:i.getSchema(),property:o}))||void 0===r?void 0:r.type))return!0;return(0,d.eeV)((0,s.Bb)({discussionContextData:e.getContext()??[],discussionType:e.getType()??"default",discussionId:e.id,intl:t})).length===(0,d.eeV)(n.getPropertyStore(o).getValue()).length}},248543:(e,t,n)=>{n.d(t,{LQ:()=>u,Ls:()=>l,RI:()=>p,RO:()=>m});var o=n(709291),r=n(907746),i=n(220300),a=n(392582),s=n(433929);const l={table:"side_peek",board:"side_peek",calendar:"center_peek",list:"side_peek",gallery:"center_peek",timeline:"side_peek",page:"side_peek",chart:"side_peek",form_editor:"side_peek"},c=(0,o.defineMessages)({side_peek:{defaultMessage:"Side peek",id:"database.viewPropertiesMenu.peekMode.sidePeek"},center_peek:{defaultMessage:"Center peek",id:"database.viewPropertiesMenu.peekMode.centerPeek"},full_page:{defaultMessage:"Full page",id:"database.viewPropertiesMenu.peekMode.fullPage"}}),d=(0,o.defineMessages)({side_peek:{defaultMessage:"Open pages on the side. Keeps the view behind interactive.",id:"database.viewPropertiesMenu.peekMode.description.sidePeek"},center_peek:{defaultMessage:"Open pages in a focused, centered modal.",id:"database.viewPropertiesMenu.peekMode.description.centerPeek"},full_page:{defaultMessage:"Open pages in full page.",id:"database.viewPropertiesMenu.peekMode.description.fullPage"}});function u(e){switch(e){case"side_peek":return s.default.formatMessage(c.side_peek);case"center_peek":return s.default.formatMessage(c.center_peek);case"full_page":return s.default.formatMessage(c.full_page)}}function p(e){switch(e){case"side_peek":return s.default.formatMessage(d.side_peek);case"center_peek":return s.default.formatMessage(d.center_peek);case"full_page":return s.default.formatMessage(d.full_page)}}function m(e){switch(e){case"side_peek":return a.y;case"center_peek":return r.Q;case"full_page":return i.M}}},277181:(e,t,n)=>{n.d(t,{A7:()=>P,Af:()=>D,Av:()=>k,CJ:()=>x,Cr:()=>Q,EK:()=>z,F0:()=>_,Hw:()=>b,JR:()=>V,Kg:()=>$,Ll:()=>L,Ns:()=>A,SM:()=>R,T2:()=>H,bX:()=>w,dI:()=>I,fd:()=>U,g0:()=>N,gY:()=>y,kC:()=>T,kG:()=>O,ko:()=>j,ls:()=>Y,nK:()=>G,qb:()=>W,uU:()=>F,vJ:()=>K,wI:()=>J,wP:()=>q,wf:()=>S,xb:()=>C,yU:()=>E,yr:()=>M,zV:()=>B});n(757658);var o=n(541432),r=n(576205),i=n(399036),a=n(180951),s=n(560246),l=n(842875),c=n(95371),d=n(653965),u=n(110906),p=n(58202),m=n(95802),g=n(925489),f=n(206258),h=n(721429),v=n(433929);const y=4,b=24,_=10;function S(e){var t;const n=null===(t=e.collectionStore())||void 0===t?void 0:t.getFormat().subitem_property,o=e.collectionStore();if(!o||!o.getSchema()||!n)return;const r=o.getSchema()[n];if(!r||"relation"!==r.type||i.F0(r)!==o.id)return;const a=r.property;if(!a)return;const s=o.getSchema()[a];return s&&"relation"===s.type?{property:n,inverse:a}:void 0}function k(e){return"table"===e||"timeline"===e||"list"===e}function w(e){var t;const n=(0,u.fm)(e),o=null==n||null===(t=n.collectionViewStore())||void 0===t?void 0:t.getType();return Boolean((null==n?void 0:n.currentSubitemFormatStoreForUiDisplayStore.state)&&o&&k(o))}function x(e){const{store:t,subitemFormat:n,propertySchema:o}=e,r=t.getPropertyValue(n.property),i=(0,a.rq)(r),s=t.getRecordModel;return a.j$({relationValue:i,propertySchema:o,getRecordModel:s})}function I(e){const{store:t,subitemFormat:n,originAction:o}=e,r=t.getPropertyValue(n.property),i=(0,a.rq)(r),s=t.getRecordModel;return a.kc({relationValue:i,getRecordModel:s,originAction:o})}function C(e){const{store:t,subitemFormat:n,propertySchema:o}=e,r=t.getPropertyValue(n.inverse),i=(0,a.rq)(r),s=t.getRecordModel;return a.j$({relationValue:i,propertySchema:o,getRecordModel:s})}function T(e){const{store:t,collectionStore:n,collectionContextStore:o,subitemFormat:i,subitemPathKey:a,propertyFilters:s,combinatorFilter:c,currentUserId:d,resultCache:u}=e,p=n.getSchema()[i.property];if(!p||"relation"!==p.type)return[];const m=x({store:t,subitemFormat:i,propertySchema:p});if(0===m.length)return[];let g=m.filter((e=>!a.includes(e.id))).map((e=>f.G.createChildStore(t,e)));const y=o.relativeVariableStore.state,b={schema:o.normalizedSchemaStore.state,userId:d,userTimeZone:(0,l.r)(),userStartOfWeek:h.AK.state,intl:v.default.getIntl(),relativeVariableResult:y,currentPageInRelatedCollection:o.collectionViewModuleContextStore.currentPageInRelatedCollectionId()};if(s&&s.length>0||c){const e=(0,r.q)({filter:{filters:c?[...s.filter((e=>!(0,r.Oo)(e.filter))).map((e=>e.filter)),c]:s.filter((e=>!(0,r.Oo)(e.filter))).map((e=>e.filter)),operator:"and"},propertyMapping:void 0,context:b});g=g.filter((t=>Z({blockStore:t,compiledFilter:e,subitemFormat:i,propertySchema:p,visitedIds:new Set,resultCache:u})))}return g}function M(e,t){var n,o;const r=e.currentSubitemFormatStoreForUiDisplayStore.state;if(!r)return new c.DG([]);const a=e.collectionStore();if(!a)return new c.DG([]);const u=e.currentSortsStore.state,p=a.getRecordModel,m=s.$m({userTimeZone:(0,l.r)(),intl:v.default.getIntl(),userSorts:u,userId:e.getCurrentUserId(),apiSorts:[],schema:e.normalizedSchemaStore.state}),g=e.normalizedSchemaStore.state[r.property],f=g&&"relation"===g.type&&i.F0(g)===(null===(n=e.collectionStore())||void 0===n?void 0:n.id)&&g.property,h=null===(o=e.collectionViewStore())||void 0===o?void 0:o.getType(),y=!f||h&&k(h)?void 0:{property:f,filter:{operator:"is_empty"}},b=[...y&&f?[{id:f,filter:y}]:[],...e.currentPropertyFiltersStore.state],_=e.currentCombinatorFilterStore.state,S=e.subitemExpandedStore.state,w=d.xH(e.groupsStore.getAllGroupStates().map((e=>e.resultsStore.state))),x=new Map;return new c.DG(w.map((n=>{const o=R(n);return(0,c.MW)(o,(n=>{let{store:o,pathKey:i}=n;const l=S.get(i);if(!l)return{value:{store:o,pathKey:i},children:[]};const c=function(e){const{store:t,collectionStore:n,collectionContextStore:o,subitemFormat:r,querySorts:i,limit:a,subitemPathKey:l,propertyFilters:c,combinatorFilter:u,currentUserId:p,getRecordModel:m,resultCache:g}=e,f=T({store:t,collectionStore:n,collectionContextStore:o,subitemFormat:r,subitemPathKey:l,propertyFilters:c,combinatorFilter:u,currentUserId:p,resultCache:g});if(!f)return[];const h=new s.EO([...i,...s.Xm(f.map((e=>e.id))??[])]);f.forEach((e=>{h.updateBlock({block:e.getModel(),schema:n.getSchema(),propertyMapping:void 0,getRecordModel:m,resultCache:g})}));const v=f.map((e=>e.id))??[],y=s.Qx(v,h),b={};return y.forEach(((e,t)=>{b[e]=t})),d.MR(f,(e=>b[e.id])).slice(0,a)}({store:o,collectionStore:a,collectionContextStore:e,subitemFormat:r,querySorts:m,limit:l.limit,subitemPathKey:i,propertyFilters:b,combinatorFilter:_,currentUserId:t,getRecordModel:p,resultCache:x}).map((e=>({store:e,pathKey:B(i,e)})));return{value:{store:o,pathKey:i},children:c}}))})))}function P(e,t){const n=e?[e]:[],o=t.groupsStore.getGroupState(n);if(!o)return[];const r=o.resultsStore.state;if(!t.currentSubitemFormatStoreForUiDisplayStore.state)return r;const i=[],a=t.subitemTreeStore.state.children.filter((e=>r.includes(e.value.store)));for(const s of a)E({results:i,tree:s});return i}function A(e){return(0,c.CY)(e.children[e.children.length-1])}function R(e){return{store:e,pathKey:D([e.pointer])}}function D(e){return e.map((e=>e.id)).join(",")}function B(e,t){return e?`${e},${t.id}`:t.id}function E(e){const{results:t,tree:n}=e;t.push(n.value.store);for(const o of n.children)E({results:t,tree:o})}function F(e){var t,n;const{block:o,collectionContextStore:r}=e,s=null==r||null===(t=r.currentSubitemFormatStoreForUiDisplayStore.state)||void 0===t?void 0:t.inverse;if(!s)return!1;const l=r.normalizedSchemaStore.state[s];if(!l||!(0,i.p_)(l))return!1;const c=null===(n=r.collectionViewBlockStore())||void 0===n?void 0:n.getRecordModel;if(!c)return!1;return(0,a.Ds)({block:o,propertySchema:l,getRecordModel:c}).length>0}function Z(e){const{blockStore:t,compiledFilter:n,subitemFormat:o,propertySchema:r,visitedIds:i,resultCache:a}=e;i.add(t.id);const s=t.getModel();if(!s)return!1;if(n({block:s,getRecordModel:t.getRecordModel,propertyMapping:void 0,resultCache:a}))return!0;const l=x({store:t,subitemFormat:o,propertySchema:r});return 0!==l.length&&l.map((e=>f.G.createChildStore(t,e))).filter((e=>!i.has(e.id))).some((e=>Z({blockStore:e,compiledFilter:n,subitemFormat:o,propertySchema:r,visitedIds:i,resultCache:a})))}async function U(e){const{blockStore:t,compiledFilter:n,subitemFormat:o,propertySchema:r,subitemExpandedStore:i,pathKey:s,forceStoresToLoad:l,visitedIds:c,resultCache:d}=e;if(await t.load(),c.has(t.id))return;c.add(t.id);const u=l?await async function(e){const{store:t,subitemFormat:n,propertySchema:o}=e,r=t.getPropertyValue(n.property),i=(0,a.rq)(r);await Promise.all(i.map((e=>f.G.createChildStore(t,e).load())));const s=t.getRecordModel;return a.j$({relationValue:i,propertySchema:o,getRecordModel:s})}({store:t,subitemFormat:o,propertySchema:r}):x({store:t,subitemFormat:o,propertySchema:r});if(0!==u.length){i.state.set(s,{isExpanded:!0,limit:20});for(const e of u){const a=f.G.createChildStore(t,e),u=a.getModel();if(!u)continue;n({block:u,getRecordModel:a.getRecordModel,propertyMapping:void 0,resultCache:d})||await U({blockStore:a,compiledFilter:n,subitemFormat:o,propertySchema:r,subitemExpandedStore:i,pathKey:B(s,a),forceStoresToLoad:l,visitedIds:c,resultCache:d})}}}function V(e){if(!e.collectionStore())return;const t=e.currentSubitemFormatStoreForCollectionStore.state,n=e.normalizedSchemaStore.state,o=(null==t?void 0:t.inverse)&&n[t.inverse],r=(null==t?void 0:t.property)&&n[t.property];if(!(r&&(0,i.p_)(r)&&o&&(0,i.p_)(o)))return;const a=o.property,s=r.property;return a&&s?{childRelationProperty:a,parentRelationProperty:s,childRelationSchema:o,parentRelationSchema:r,subitemFormat:t}:void 0}function N(e){const t=(0,u.fm)(e);if(t)return V(t)}function O(e,t){const n=L(e,t);if(n)return V(n)}function L(e,t){if(!e)return;if(!(e.isType(o.Ti.collectionViewPage)||e.isType(o.Ti.page)))return;const n=e.getAssociatedCollectionStore();if(!n)return;const r=new g.Z(t);return r.setContext({type:"collectionPage",collectionViewBlockStore:void 0,collectionStore:n}),r}function j(e){const t=e.getFormat().subitem_property;if(!t)return;const n=e.getSchema()[t];if(!n||"relation"!==n.type)return;const o=n.property;return o?{property:t,inverse:o}:void 0}function K(e,t){if(!e.isType("page")||e.isTemplate())return!1;if(!t)return!1;return!!t.collectionStore()&&Boolean(t.currentSubitemFormatStoreForCollectionStore.state)}function z(e){var t,n;const{blockId:o,collectionContextStore:r}=e,i=null===(t=r.currentSubitemFormatStoreForCollectionStore)||void 0===t?void 0:t.state,a=null==i?void 0:i.inverse;if(!i||!a)return!1;const s=e.blockStore??(null===(n=p.R.findBlockFromId(o))||void 0===n?void 0:n.getBlockStore());if(!s)return!1;const l=s.getSchema();if(!l)return!1;const c=l[a];return!(!c||"relation"!==c.type)&&C({store:s,subitemFormat:i,propertySchema:c}).length>0}function q(e){var t;const{collectionContextStore:n,blockStore:o}=e,r=null===(t=n.currentSubitemFormatStoreForCollectionStore)||void 0===t?void 0:t.state,i=null==r?void 0:r.property;if(!r||!i)return!1;const a=o.getSchema();if(!a)return!1;const s=a[i];return!(!s||"relation"!==s.type)&&x({store:o,subitemFormat:r,propertySchema:s}).length>0}function H(e){let{blocks:t,parentRelationProperty:n,parentRelationSchema:o,collectionViewBlockStore:r}=e;const i=new Set;for(const a of t)i.add(a.id);return d.xH(t.map((e=>{const t=(e=>{const t=e.getPropertyValue(n);return a.j$({relationValue:a.rq(t),propertySchema:o,getRecordModel:e.getRecordModel})})(e),s=t.map((e=>e.id));if(0===t.length)return[f.G.createChildStore(r,e.pointer)];return m.C.findAllSelectablesFromIds(s.filter((e=>!i.has(e)))).map((e=>e.props.store)).map((t=>f.G.createChildStore(t,e.pointer)))})))}function G(e,t){const n=e.subitemTreeStore,o=(0,c.DY)(n.state.children,(e=>e.value.store===t)),r=o?D(o.map((e=>e.value.store))):"";return e.subitemExpandedStore.state.get(r)}function W(e,t){const n=$(e,t);return e.filter(((e,t)=>n.includes(t)))}function $(e,t){const n=new Set;e.forEach((e=>{n.add(e.pointer.id)}));const o=[];return e.forEach(((e,r)=>{const i=e.getPropertyValue(t.inverse);a.rq(i).some((e=>n.has(e.id)))||o.push(r)})),o}function Y(e){var t;let{collectionContextStore:n}=e;return S(n)&&"flattened"===(null===(t=n.collectionViewStore())||void 0===t?void 0:t.getFormat().subitem_display_mode)}function Q(e){let{collectionContextStore:t,blockId:n,blockStore:o}=e;return Y({collectionContextStore:t})&&z({blockId:n,collectionContextStore:t,blockStore:o})}function J(e){let{collectionContextStore:t,blockStore:n}=e;return function(e){var t;let{collectionContextStore:n}=e;return S(n)&&"hidden"===(null===(t=n.collectionViewStore())||void 0===t?void 0:t.getFormat().subitem_display_mode)}({collectionContextStore:t})&&q({collectionContextStore:t,blockStore:n})}},966603:(e,t,n)=>{n.d(t,{BM:()=>l,F4:()=>g,GC:()=>f,HV:()=>c,L2:()=>h,S7:()=>v,WY:()=>u,gw:()=>s,jI:()=>d,nt:()=>y,vw:()=>p});n(21703),n(667294);var o=n(406695),r=n(709291),i=n(188923),a=n(785893);const s="300px",l="44px";let c=function(e){return e[e.ViewSettings=0]="ViewSettings",e[e.FilterBar=1]="FilterBar",e[e.TopbarFilterPopup=2]="TopbarFilterPopup",e[e.TopbarSortPopup=3]="TopbarSortPopup",e[e.ViewBlock=4]="ViewBlock",e}({});function d(e){const{timelineViewTab:t,collectionContextStore:n}=e,r=u({collectionContextStore:n}),i=p({collectionContextStore:n});return"timeline"===r?"timeline"===t?"timeline_properties":i?"timeline_table_properties":void 0:(0,o.oz)(u({collectionContextStore:n}))}function u(e){var t;const{collectionContextStore:n}=e,o=null===(t=n.collectionViewStore())||void 0===t?void 0:t.getType();if(!o)throw new Error("View type was not defined.");return o}function p(e){const{collectionContextStore:t}=e,n=t.normalizedFormatStore.state;return Boolean(n.timeline_show_table)}const m=600;function g(e,t,n){const o=n||0,r=e.settingsStore.state;if(r.open&&!0!==r.hideSettingsPopup)return f(e,t,o)}function f(e,t,n){const o=n||0,r=e.settingsStore.state,a=u({collectionContextStore:e});return r.open&&"form_editor"===a||t||i.default.isSidePeekOpen()||e.isInHomeWidgetStore.state||e.isInlineViewStore.state||o<=m?"popup":"sidebar"}function h(e,t,n){return t?n?(0,a.jsx)(r.FormattedMessage,{defaultMessage:"Unlock wiki",id:"action.unlockWikiName.name"}):(0,a.jsx)(r.FormattedMessage,{defaultMessage:"Lock wiki",id:"action.lockWikiName.name"}):e?n?(0,a.jsx)(r.FormattedMessage,{defaultMessage:"Unlock database",id:"database.viewSettings.mainTab.unlockDatabase.title"}):(0,a.jsx)(r.FormattedMessage,{defaultMessage:"Lock database",id:"database.viewSettings.mainTab.lockDatabase.title"}):n?(0,a.jsx)(r.FormattedMessage,{defaultMessage:"Unlock views",id:"database.viewSettings.mainTab.unlockViews.title"}):(0,a.jsx)(r.FormattedMessage,{defaultMessage:"Lock views",id:"database.viewSettings.mainTab.lockViews.title"})}let v=function(e){return e[e.Source=0]="Source",e[e.Relation=1]="Relation",e[e.Automation=2]="Automation",e}({});const y=6},243224:(e,t,n)=>{n.d(t,{F6:()=>r,aB:()=>a,pT:()=>i});var o=n(709291);const r={maxWidth:280,width:"max-content",overflowWrap:"break-word",textWrap:"wrap",whiteSpace:"pre-line"},i=280,a=(0,o.defineMessages)({addPropertyDescriptionTooltip:{id:"database.viewSettings.propertyTab.description.addDescriptionTooltip",defaultMessage:"Add property description"},editPropertyDescriptionTooltip:{id:"database.viewSettings.propertyTab.description.editDescriptionTooltip",defaultMessage:"Edit property description"}})},426991:(e,t,n)=>{n.d(t,{As:()=>p,Sh:()=>u,iL:()=>m,ki:()=>f,qf:()=>g});var o=n(576205),r=n(830823),i=n(399036),a=n(396367),s=n(421202),l=n(606287),c=n(206258),d=n(729376);function u(e,t){return(0,a.oN)(e,t)}function p(e,t,n,o){const r=e.relativeVariableStore.state;if(r){const e=r[n.id],i=null==e?void 0:e[t];if(i){return c.G.createChildStore(o,{table:s.iU,id:i,spaceId:n.spaceId})}}}function m(e){var t;const{blockStore:n,collectionId:i,appConfigUri:s,variable:l,schema:c}=e;if((null===(t=n.getAssociatedCollectionStore())||void 0===t?void 0:t.id)!==i)return!1;const d=a.qB[s][l].reducer,u=d.getProperty(),p=c[u],m=n.getPropertyValue(u),g=d.getPropertyFilter(c,l);return!!(0,o.CA)({filter:g,filterType:"status",relativeVariableValues:void 0})((0,r.yK)({propertySchema:p,propertyValue:m}))}function g(e,t,n){if((0,o.e)(t.filter)){if(((0,o.vR)(t.filter)?(0,o.YO)(t.filter):[]).some((e=>"relative"===e.type)))return function(e,t,n){const o=n.getSchema()[t];return!(!o||!(0,i.p_)(o))&&(0,a.oN)((0,d.uJ)(o,e),(0,d.ke)(o,n))}(e,t.property,n)}return!0}function f(e,t,n){return!!e&&Object.values(e).some((e=>{if("groups"===e.type&&"relation"===e.groupBy.type){const o=e.groupBy.property,r=t[o];if(r.collection_pointer){const e=c.NW.createChildStore(n,{table:l.vF,id:r.collection_pointer.id}),t=e.getFormat().app_config_uri;return t&&a.qB[t]&&e.isDefined()&&(0,a.oN)(e.getSchema(),t)}}return!1}))}},880025:(e,t,n)=>{n.d(t,{Vn:()=>a,qf:()=>c});var o=n(709291),r=n(433929);const i=(0,o.defineMessages)({default:{defaultMessage:"Light gray",id:"colors.select.lightGray"},gray:{defaultMessage:"Gray",id:"colors.select.gray"},translucentGray:{defaultMessage:"Gray",id:"colors.select.gray"},brown:{defaultMessage:"Brown",id:"colors.select.brown"},orange:{defaultMessage:"Orange",id:"colors.select.orange"},yellow:{defaultMessage:"Yellow",id:"colors.select.yellow"},green:{defaultMessage:"Green",id:"colors.select.green"},blue:{defaultMessage:"Blue",id:"colors.select.blue"},purple:{defaultMessage:"Purple",id:"colors.select.purple"},pink:{defaultMessage:"Pink",id:"colors.select.pink"},red:{defaultMessage:"Red",id:"colors.select.red"}});function a(e){const t=i[e]||i.gray;return r.default.formatMessage(t)}const s=(0,o.defineMessages)({foregroundColorDefault:{id:"action.foregroundColor.default.name",defaultMessage:"Default"},foregroundColorGray:{id:"action.foregroundColor.gray.name",defaultMessage:"Gray"},foregroundColorBrown:{id:"action.foregroundColor.brown.name",defaultMessage:"Brown"},foregroundColorOrange:{id:"action.foregroundColor.orange.name",defaultMessage:"Orange"},foregroundColorYellow:{id:"action.foregroundColor.yellow.name",defaultMessage:"Yellow"},foregroundColorGreen:{id:"action.foregroundColor.green.name",defaultMessage:"Green"},foregroundColorBlue:{id:"action.foregroundColor.blue.name",defaultMessage:"Blue"},foregroundColorPurple:{id:"action.foregroundColor.purple.name",defaultMessage:"Purple"},foregroundColorPink:{id:"action.foregroundColor.pink.name",defaultMessage:"Pink"},foregroundColorRed:{id:"action.foregroundColor.red.name",defaultMessage:"Red"},backgroundColorGray:{id:"action.backgroundColor.gray.name",defaultMessage:"Gray background"},backgroundColorBrown:{id:"action.backgroundColor.brown.name",defaultMessage:"Brown background"},backgroundColorOrange:{id:"action.backgroundColor.orange.name",defaultMessage:"Orange background"},backgroundColorYellow:{id:"action.backgroundColor.yellow.name",defaultMessage:"Yellow background"},backgroundColorGreen:{id:"action.backgroundColor.green.name",defaultMessage:"Green background"},backgroundColorBlue:{id:"action.backgroundColor.blue.name",defaultMessage:"Blue background"},backgroundColorPurple:{id:"action.backgroundColor.purple.name",defaultMessage:"Purple background"},backgroundColorPink:{id:"action.backgroundColor.pink.name",defaultMessage:"Pink background"},backgroundColorRed:{id:"action.backgroundColor.red.name",defaultMessage:"Red background"},backgroundColorDefault:{id:"action.backgroundColor.default.name",defaultMessage:"Default background"}}),l={default:{...s.foregroundColorDefault},gray:{...s.foregroundColorGray},brown:{...s.foregroundColorBrown},orange:{...s.foregroundColorOrange},yellow:{...s.foregroundColorYellow},teal:{...s.foregroundColorGreen},blue:{...s.foregroundColorBlue},purple:{...s.foregroundColorPurple},pink:{...s.foregroundColorPink},red:{...s.foregroundColorRed},default_background:{...s.backgroundColorDefault},gray_background:{...s.backgroundColorGray},brown_background:{...s.backgroundColorBrown},orange_background:{...s.backgroundColorOrange},yellow_background:{...s.backgroundColorYellow},teal_background:{...s.backgroundColorGreen},blue_background:{...s.backgroundColorBlue},purple_background:{...s.backgroundColorPurple},pink_background:{...s.backgroundColorPink},red_background:{...s.backgroundColorRed}};function c(e){return l[e]}},478175:(e,t,n)=>{n.d(t,{Po:()=>l,hF:()=>a,zE:()=>s});n(95477);var o=n(385555),r=n(188923),i=n(785957);function a(e){let t=e;for(;t&&(!t||!t.isNavigableBlock());){if("column"===t.getType())return!0;t=t.getParentBlockStore()}return!1}function s(e,t){const{device:n}=t;if(n.isPhone)return!1;if((0,i.wq)(e)){return r.default.getSidePeekWidth(t.WindowSizeStore.state.width)>=r.SIDEPEEK_NO_COLUMN_WIDTH}return!0}function l(e,t){return!t.device.isMobile&&("on"===o.default.getGroup("columns-full-width")&&(e.isType("column_list")&&e.isChildOfRecordStoreUIRoot()&&s(e,t)&&!(null!==(n=e.getParentBlockStore())&&void 0!==n&&n.isFullWidth())&&!(0,i.wq)(e)));var n}},778663:(e,t,n)=>{n.d(t,{$W:()=>m,FD:()=>f,Fu:()=>h,Xc:()=>g});var o=n(653965),r=n(401898),i=n(457819),a=n(630793),s=n(828685),l=n(206258),c=n(27724),d=n(924666),u=n(433929),p=n(273959);function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.getIntl();if("helpMeEdit"===e.key||"helpMeDraft"===e.key||"helpMeWrite"===e.key){var n;const o=null===(n=e.steps)||void 0===n?void 0:n[0],r="text"===(null==o?void 0:o.type)&&o.prefilledValue;return r?t.formatMessage({id:"completionPopup.prefilledValue",defaultMessage:"Write about {prefilledValue} "},{prefilledValue:r}):""}if(!(0,a.TE)(e.key))return"";switch(e.key){case"brainstormIdeas":return t.formatMessage({id:"completionPopup.brainStorm.prefilledValue",defaultMessage:"Brainstorm ideas on "});case"blogPost":return t.formatMessage({id:"completionPopup.blogPost.prefilledValue",defaultMessage:"Write a blog post about "});case"outline":return t.formatMessage({id:"completionPopup.outline.prefilledValue",defaultMessage:"Write an outline about "});case"socialMediaPost":return t.formatMessage({id:"completionPopup.socialMediaPost.prefilledValue",defaultMessage:"Write a social media post about "});case"pressRelease":return t.formatMessage({id:"completionPopup.pressRelease.prefilledValue",defaultMessage:"Write a press release about "});case"creativeStory":return t.formatMessage({id:"completionPopup.creativeStory.prefilledValue",defaultMessage:"Write a creative story about "});case"essay":return t.formatMessage({id:"completionPopup.essay.prefilledValue",defaultMessage:"Write an essay about "});case"poem":return t.formatMessage({id:"completionPopup.poem.prefilledValue",defaultMessage:"Write a poem about "});case"todoList":return t.formatMessage({id:"completionPopup.todoList.prefilledValue",defaultMessage:"Write a todo list about "});case"meetingAgenda":return t.formatMessage({id:"completionPopup.meetingAgenda.prefilledValue",defaultMessage:"Write a meeting agenda about "});case"prosConsList":return t.formatMessage({id:"completionPopup.prosConsList.prefilledValue",defaultMessage:"Write a pros and cons list about "});case"jobDescription":return t.formatMessage({id:"completionPopup.jobDescription.prefilledValue",defaultMessage:"Write a job description about "});case"salesEmail":return t.formatMessage({id:"completionPopup.salesEmail.prefilledValue",defaultMessage:"Write a sales email about "});case"recruitingEmail":return t.formatMessage({id:"completionPopup.recruitingEmail.prefilledValue",defaultMessage:"Write a recruiting email about "});default:(0,r.t1)(e.key)}}function g(){const{stores:e}=c.default.state,t=e[0],n=o.Z$(e),r=t?t.getRecordStoreUIRoot():void 0;if(r&&r instanceof l.G&&n){return{type:"blockSelection",stores:e,currentPage:r,origin:n,scrollerStore:(0,i.Dj)(r)}}}function f(){const e=d.default.state;if("editing"!==e.mode)return;const t=e.multiSelection,n=t.start.store,o=n.getRecordStoreUIRoot(),r=s.E.findNodeFromStore(n),a=(0,p.sQ)(n),c=null==a?void 0:a.getRecordStoreUIParent(),u=(0,i.Dj)(o),m=a&&a instanceof l.G&&a!==o?a:void 0,g=m??r;if(!(o&&o instanceof l.G&&g))return;return{type:"cursor",textSelection:t,currentPage:o,currentBlock:m,origin:g,currentParent:c,scrollerStore:u,isPageTitle:o.id===n.id}}function h(){const{stores:e}=c.default.state,t=d.default.state,n="empty"!==t.mode?t.multiSelection:void 0,o="empty"!==t.mode?t.multiSelection.start.store:void 0;let r=o?o.getRecordStoreUIRoot():void 0;if(!(r instanceof l.G)){let e,t=null==o?void 0:o.getRecordStoreUIParent();for(;null!=t;)t instanceof l.G&&(e=t),t=t.getRecordStoreUIParent();e&&(r=e)}if(n&&r&&r instanceof l.G){const t=(0,p.sQ)(n.end.store),o=null==t?void 0:t.getRecordStoreUIParent(),a=(0,i.Dj)(r);if(t&&o){return{type:"textSelection",stores:e,textSelection:n,currentPage:r,origin:t,endBlock:t,endBlockParent:o,scrollerStore:a}}}}},743455:(e,t,n)=>{n.d(t,{$A:()=>_,Ie:()=>I,KF:()=>y,N9:()=>x});n(757658);var o=n(940591),r=n.n(o),i=n(541432),a=n(719531),s=n(522808),l=n(225718),c=n(519889),d=n(421838),u=n(307928),p=n(433929),m=n(483089);const g=!1;function f(){if(g){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.log("completionMarkdownHelpers:",...t)}}function h(e,t){return(0,u.Nz)(e,t).replace(/ /g,"")}function v(e,t){const{getRecordValue:n,intl:o}=t;let r;if(d.IWo(e)){const t=d.zEN(e);r=`@${h(o,n({table:c.KJ,id:t}))}`}else if(d.fpG(e)){r=d.zyO(e).start_date}return r&&f(`Transforming annotation for completion: ${r}`),r}function y(){let e=0,t=0;function n(n){e+=1,e>t&&(t=e);try{return l.Lk(n)}finally{e-=1}}function o(){return":".repeat(t-e+2)}return{transformAnnotation:v,transformBlockMapping:{callout(e){var t;const{block:r,exportArgs:i}=e,a=l.WB({block:r,exportArgs:i}),c=null===(t=r.format)||void 0===t?void 0:t.page_icon,d=(0,s.Z)(c)?c:"",u=n(e),p=o();return{text:`${p} aside ${d}\n\n${a}`.trim(),breakLines:!0,children:u,suffix:p}},toggle(e){const{block:t,exportArgs:r}=e,i=l.WB({block:t,exportArgs:r}),a=n(e),s=o();return{text:`${s} ▶ ${i}\n\n`.trim(),breakLines:!0,children:a,suffix:s}}}}}const b=(0,m.V9)({unicode:()=>/@\p{Letter}+/gu,fallback:/@[A-Za-z]+/g});async function _(e,t,n){const o=e.matchAll(b),r=[];for(const i of o){const e=i[0].slice(1);if(void 0===n.get(e)){const o=async()=>{const o=await S(t,e);o?(f(`Found user result for mention "${e}": ${o.email}`),n.set(e,o)):(f(`Found no user result for mention "${e}".`),n.set(e,null))};r.push(o())}}await Promise.all(r)}async function S(e,t){const n=await e(t),o=p.default.getIntl();let r;for(const i of n){if(h(o,i)===t){if(r)return;r=i}}return r}function k(e){const{md:t,name:n,regex:o,createTokens:r}=e,{arrayReplaceAt:i}=t.utils;function a(e,t,i){let a=0;const s=[];if(e.replace(o,(function(o){const l=Array.from(arguments);let c=l.length-1;"string"!=typeof l[c]&&(c-=1);const d=l[c],u=l[c-1];if(u>0&&(0,m.D_)(d[u-1]))return"";if(u+o.length<d.length&&(0,m.D_)(d[u+o.length]))return"";const p=r(o,t);if(!p)return"";if(u>a){const t=new i("text","",0);t.content=e.slice(a,u),s.push(t)}for(const{type:e,attrs:t,tag:r,level:a,content:m}of p){const o=new i(e,"",0);if(t)for(const[e,n]of Object.entries(t))o.attrPush([e,n]);r&&(o.tag=r,o.markup=n),void 0!==a&&(o.level=a),m&&(o.content=m),s.push(o)}return a=u+o.length,""})),a<e.length){const t=new i("text","",0);t.content=e.slice(a),s.push(t)}return s}t.core.ruler.after("linkify",n,(e=>{let t=0;const n=e.tokens;for(let r=0;r<n.length;r++){const s=n[r].children;if("inline"===n[r].type&&s)for(let l=s.length-1;l>=0;l--){const c=s[l];"link_open"!==c.type&&"link_close"!==c.type||"auto"===c.info&&(t-=c.nesting),"text"===c.type&&0===t&&o.test(c.content)&&(n[r].children=i(s,l,a(c.content,c.level,e.Token)))}}return!0}))}function w(e){return t=>{!function(e){k({md:e,name:"date_mentions",regex:/20\d\d-\d\d-\d\d/g,createTokens:(e,t)=>[{type:"date_mention_open",tag:"time",attrs:{datetime:e,[a.KD.dateFormat]:"relative"},level:t+1},{type:"text",content:e},{type:"date_mention_close",tag:"/time",level:t}]})}(t),function(e,t){k({md:e,name:"user_mentions",regex:b,createTokens(e,n){const o=e.slice(1),r=t.get(o);if(r)return[{type:"user_mention_open",tag:"a",level:n+1,attrs:{[a.KD[d.GKr.User]]:r.id}},{type:"text",content:e},{type:"user_mention_close",tag:"/a",level:n}]}})}(t,e),function(e){const t=/^aside\s+(.*)$/,n={validate:e=>Boolean(e.trim().match(t)),render(n,o){if(1===n[o].nesting){const r=n[o].info.trim().match(t);let l=(null==r?void 0:r[1])??"";(0,s.Z)(l)||(l="");const c="gray_background",d=function(e,t){const n=[];for(const[o,r]of t)n.push(`${o}="${e.utils.escapeHtml(r)}"`);return n.join(" ")}(e,[[a.KD[i.Ti.callout],""],[a.KD.calloutBackground,c],[a.KD.calloutIcon,l]]);return`<div ${d}>`}return"</div>"}};e.use(r(),"callout_block",n)}(t),function(e){const t=/^▶\s+(.*)$/,n={validate:e=>Boolean(e.trim().match(t)),render(n,o){if(1===n[o].nesting){const r=n[o].info.trim().match(t),i=(null==r?void 0:r[1])??"";return`<details><summary>${e.utils.escapeHtml(i)}</summary>`}return"</details>"}};e.use(r(),"toggle_block",n)}(t)}}function x(e){return{plugin:w(e)}}function I(e){return/\[.+\]\([^)]*$/.test(e)}},895083:(e,t,n)=>{n.d(t,{D:()=>r,d:()=>o});const o={text:!0,bulleted_list:!0,numbered_list:!0,quote:!0,to_do:!0,header:!0,sub_header:!0,sub_sub_header:!0,callout:!0,toggle:!0,table:!0,equation:!0,code:!0,file:!0,pdf:!0,image:!0},r={...o}},120315:(e,t,n)=>{n.d(t,{eL:()=>b,It:()=>y,kL:()=>M,GD:()=>x,qB:()=>_,G9:()=>S,z1:()=>k,gM:()=>A,AC:()=>R,RT:()=>C,Zt:()=>I,mX:()=>P,Gw:()=>D,lV:()=>B,KZ:()=>T});const o="5ee0e0b5-7f0a-4788-a438-f37644514636";var r=n(938823),i=n(709291),a=n(531701),s=n(653965),l=(n(95477),n(322981)),c=n(697491),d=n(112350),u=n(818441),p=n(80444),m=n(521273),g=n(385555),f=n(896026),h=n(548779);const v=(0,i.defineMessages)({helpMeWrite:{defaultMessage:"Ask AI to write...",id:"id.completions.helpMeWrite"},helpMeWritePlaceholder:{defaultMessage:'What would you like to write about?\nFor example, "5 reasons why we should hire a dedicated designer"',id:"id.completions.helpMeWritePlaceholder"},helpMeDraftPlaceholder:{defaultMessage:'What would you like to write about?\nFor example, "article about the benefits of learning a new language"',id:"id.completions.helpMeDraftPlaceholder"},summarize:{defaultMessage:"Summarize",id:"id.completions.summarize"},findActionItems:{defaultMessage:"Find action items",id:"id.completions.findActionItems"},summarizeMeetingTranscript:{id:"id.completions.summarizeMeetingTranscript",defaultMessage:"Summarize meeting"}}),y={key:"helpMeWrite",category:"writeWithAI",name:v.helpMeWrite,svg:u.t,svgFill:a.FN.light.purple[400],requiresContent:!0,steps:[{key:"prompt",name:v.helpMeWritePlaceholder,placeholder:v.helpMeWritePlaceholder,type:"text"}]},b={key:"helpMeDraft",category:"draftWithAI",name:v.helpMeWrite,svg:u.t,svgFill:a.FN.light.purple[400],requiresNoContent:!0,steps:[{key:"prompt",name:v.helpMeDraftPlaceholder,placeholder:v.helpMeDraftPlaceholder,type:"text"}]};function _(e){const{customPrompt:t,isPageEmpty:n}=e;return{key:n?"helpMeDraft":"helpMeWrite",category:"writeWithAI",name:v.helpMeWrite,svg:l.d,svgFill:a.FN.light.purple[400],steps:[{key:"prompt",name:v.helpMeWritePlaceholder,placeholder:v.helpMeWritePlaceholder,type:"text",prefilledValue:t}]}}function S(){return[{key:"summarize",category:"extractFromContent",name:v.summarize,svg:d.Y,svgFill:a.FN.light.purple[400]},{key:"findActionItems",category:"extractFromContent",name:v.findActionItems,svg:c.O,svgFill:a.FN.light.purple[400]},y]}function k(){return s.KX(S(),"key")}function w(){const e=p.default.state.currentSpaceStore;return!!e&&e.isAiEnabledOnSpace()}function x(e){if(g.default.checkGate({gateName:"disable_ai_big_red_button"}))return!1;const t=p.default.state.currentSpaceStore;if((0,h.Cx)(t))return!1;const n=null==t?void 0:t.canRead();return!(e&&e.hasPublicPermission&&!n)&&w()}function I(e){return w()}function C(e,t){return x(e)&&t.canEdit()}function T(){return g.default.checkGate({gateName:"autofill_tags"})}function M(){return x(void 0)&&g.default.checkGate({gateName:"enable_ai_suggested_properties"})}function P(e,t,n){return x(t)&&n.canEditCollection()}function A(e){return new r.m9({isInitialized:!0,getEligibleGroup:e=>g.default.getEligibleGroup({experimentId:e}),isAiEnabled:()=>{const t=p.default.state.mainEditorCurrentBlockStore;return x(t&&f.Z.getMode(e,t))},isZeroRetentionEnabled:()=>{const e=p.default.state.currentSpaceStore;return!!e&&e.getZeroRetentionEnabled()},getCanSearchWorkspaceWithCollectionIdFilter:()=>{var e;if(null!==(e=p.default.state.currentSpaceStore)&&void 0!==e&&null!==(e=e.getSettings())&&void 0!==e&&e.embedding_index_is_live){var t;return(null===(t=p.default.state.currentSpaceStore)||void 0===t?void 0:t.getSettingsStore().getKeyStore("embedding_index_generation").getValue())===r.v4}return g.default.checkGate({gateName:"enable_limited_qna"}),!1},getIsAssistantSpaceSettingEnabled:()=>{var e;return(null===(e=p.default.state.currentSpaceStore)||void 0===e||null===(e=e.getSettings())||void 0===e?void 0:e.is_assistant_experience_enabled)??!1},getSearchBackend:()=>{var e;return null!==(e=p.default.state.currentSpaceStore)&&void 0!==e&&null!==(e=e.getSettings())&&void 0!==e&&e.embedding_index_is_live?"vector":g.default.checkGate({gateName:"enable_limited_qna"})?"limited_qna":void 0},checkGate:e=>g.default.checkGate({gateName:e}),getSubscriptionTier:()=>{var e;return null===(e=p.default.state.currentSpaceStore)||void 0===e?void 0:e.getSubscriptionTier()}})}function R(e){m.Z.getIsInitialized()||m.Z.setState(A(e))}function D(){var e;return(null===(e=p.default.state.currentSpaceStore)||void 0===e?void 0:e.id)===o}function B(){return!1}},672340:(e,t,n)=>{n.d(t,{$6:()=>a,CN:()=>r,SL:()=>s,Tc:()=>i});var o=n(385555);const r=5;function i(e){return"on"===o.default.getEligibleGroup({experimentId:"parallel_confluence_importer_via_api",defaultGroup:"control"})}function a(e){return o.default.getEligibleGroup({experimentId:"special_case_confluence_file_size",defaultGroup:r.toString()})}function s(e){return"on"===o.default.getEligibleGroup({experimentId:"migrate_confluence_into_teamspace",defaultGroup:"control"})}},353323:(e,t,n)=>{n.d(t,{L:()=>s,n:()=>l});var o=n(619584),r=n(788632),i=n(599757);const a=1*o.hM;function s(){var e;if(r.Z.state.online){if(null!==(e=i.Z.state.connectionError)&&void 0!==e&&e.startTime){var t;if(Date.now()-(null===(t=i.Z.state.connectionError)||void 0===t?void 0:t.startTime)<a)return}return i.Z.state.connectionError}}function l(){return Boolean(s())}},146150:(e,t,n)=>{n.d(t,{C7:()=>h,D1:()=>_,G0:()=>m,GF:()=>i,GZ:()=>s,HM:()=>d,Hd:()=>f,X1:()=>y,_F:()=>u,d_:()=>c,eD:()=>g,g4:()=>b,xp:()=>S});var o=n(162619);const r="data-content-editable-leaf",i={[r]:!0},a="data-content-editable-root",s={[a]:!0},l="data-content-editable-root-tiny-selection-trap",c={[l]:!0},d="data-content-editable-selecting",u="data-content-editable-composing",p="data-content-editable-void",m={[p]:!0};function g(e){return o.kK(e)&&e.hasAttribute(r)}function f(e){return o.kK(e)&&e.hasAttribute(l)}function h(e){return Boolean(o.kK(e)&&e.querySelector(`[${r}]`))}function v(e){return o.kK(e)&&e.hasAttribute(a)}function y(e){return o.sh(e,g)}function b(e,t){return e.parentElement===t?e:o.sh(e,(e=>e.parentElement===t))||e}function _(e,t){if(!e||!t)return!1;const n=S(e),o=S(t);return Boolean(n&&n===o)}function S(e){const t=o.sh(e,(e=>v(e)||function(e){return o.kK(e)&&e.hasAttribute(p)}(e)));if(t&&v(t))return t}},840959:(e,t,n)=>{n.d(t,{Hc:()=>M,MU:()=>I,O5:()=>P,tg:()=>T});var o=n(701302),r=n(841892),i=n(541432),a=n(145953),s=n(421202),l=n(709291),c=n(433929),d=n(95802),u=n(385555),p=n(992083),m=n(119037),g=n(700042),f=n(304708),h=n(478175),v=n(120315),y=n(908989),b=n(556335),_=n(268056),S=n(105749),k=n(273959),w=n(489086);const x=(0,l.defineMessages)({textTitle:{id:"newBlock.text.title",defaultMessage:"Text"},textDescription:{id:"newBlock.text.description",defaultMessage:"Just start writing with plain text."},textKeywords:{id:"newBlock.text.fuzzySearchKeywords",defaultMessage:"Plain Text"},pageTitle:{id:"newBlock.page.title",defaultMessage:"Page"},pageDescription:{id:"newBlock.page.description",defaultMessage:"Embed a sub-page inside this page."},pageKeywords:{id:"newBlock.page.fuzzySearchKeywords",defaultMessage:"Page"},linkToPageTitle:{id:"newBlock.linkToPage.title",defaultMessage:"Link to page"},linkToPageDescription:{id:"newBlock.linkToPage.description",defaultMessage:"Link to an existing page."},linkToPageKeywords:{id:"newBlock.linkToPage.fuzzySearchKeywords",defaultMessage:"Link to page ltp"},linkedDatabaseDescription:{id:"newBlock.linkToCollection.description",defaultMessage:"Add an existing database to this page."},transclusionContainerTitle:{id:"newBlock.transclusionContainer.title",defaultMessage:"Synced block"},transclusionContainerDescription:{id:"newBlock.transclusionContainer.description",defaultMessage:"Sync content across pages."},transclusionContainerKeywords:{id:"newBlock.transclusionContainer.fuzzySearchKeywords",defaultMessage:"Create synced block reference transclusion portal block embed group"},toDoTitle:{id:"newBlock.toDo.title",defaultMessage:"To-do list"},toDoDescription:{id:"newBlock.toDo.description",defaultMessage:"Track tasks with a to-do list."},toDoKeywords:{id:"newBlock.toDo.fuzzySearchKeywords",defaultMessage:"Todo To-Do Checkbox List"},headerTitle:{id:"newBlock.header.title",defaultMessage:"Heading 1"},headerDescription:{id:"newBlock.header.description",defaultMessage:"Big section heading."},headerKeywords:{id:"newBlock.header.fuzzySearchKeywords",defaultMessage:"Heading 1 # h1"},subHeaderTitle:{id:"newBlock.subHeader.title",defaultMessage:"Heading 2"},subHeaderDescription:{id:"newBlock.subHeader.description",defaultMessage:"Medium section heading."},subHeaderKeywords:{id:"newBlock.subHeader.fuzzySearchKeywords",defaultMessage:"sub heading 2 ## h2 two"},subSubHeaderTitle:{id:"newBlock.subSubHeader.title",defaultMessage:"Heading 3"},subSubHeaderDescription:{id:"newBlock.subSubHeader.description",defaultMessage:"Small section heading."},subSubHeaderKeywords:{id:"newBlock.subSubHeader.fuzzySearchKeywords",defaultMessage:"subsub heading 3 ### h3 three"},imageTitle:{id:"newBlock.image.title",defaultMessage:"Image"},imageDescription:{id:"newBlock.image.description",defaultMessage:"Upload or embed with a link."},imageKeywords:{id:"newBlock.image.fuzzySearchKeywords",defaultMessage:"Image Picture Gif Giphy"},bookmarkTitle:{id:"newBlock.bookmark.title",defaultMessage:"Web bookmark"},bookmarkDescription:{id:"newBlock.bookmark.description",defaultMessage:"Save a link as a visual bookmark."},bookmarkKeywords:{id:"newBlock.bookmark.fuzzySearchKeywords",defaultMessage:"Web Link Bookmark"},dividerTitle:{id:"newBlock.divider.title",defaultMessage:"Divider"},dividerDescription:{id:"newBlock.divider.description",defaultMessage:"Visually divide blocks."},dividerKeywords:{id:"newBlock.divider.fuzzySearchKeywords",defaultMessage:"Horizontal Rule Divider line section separator --- —-"},codeTitle:{id:"newBlock.code.title",defaultMessage:"Code"},codeDescription:{id:"newBlock.code.description",defaultMessage:"Capture a code snippet."},codeKeywords:{id:"newBlock.code.fuzzySearchKeywords",defaultMessage:"Code ```"},quoteTitle:{id:"newBlock.quote.title",defaultMessage:"Quote"},quoteDescription:{id:"newBlock.quote.description",defaultMessage:"Capture a quote."},quoteKeywords:{id:"newBlock.quote.fuzzySearchKeywords",defaultMessage:"Quote"},bulletedListTitle:{id:"newBlock.bulletedList.title",defaultMessage:"Bulleted list"},bulletedListDescription:{id:"newBlock.bulletedList.description",defaultMessage:"Create a simple bulleted list."},bulletedListKeywords:{id:"newBlock.bulletedList.fuzzySearchKeywords",defaultMessage:"Bulleted Unordered List"},numberedListTitle:{id:"newBlock.numberedList.title",defaultMessage:"Numbered list"},numberedListDescription:{id:"newBlock.numberedList.description",defaultMessage:"Create a list with numbering."},numberedListKeywords:{id:"newBlock.numberedList.fuzzySearchKeywords",defaultMessage:"Numbered Ordered List"},toggleTitle:{id:"newBlock.toggle.title",defaultMessage:"Toggle list"},toggleDescription:{id:"newBlock.toggle.description",defaultMessage:"Toggles can hide and show content inside."},toggleKeywords:{id:"newBlock.toggle.fuzzySearchKeywords",defaultMessage:"Toggle list expand collapse details"},fileTitle:{id:"newBlock.file.title",defaultMessage:"File"},fileDescription:{id:"newBlock.file.description",defaultMessage:"Upload or embed with a link."},fileKeywords:{id:"newBlock.file.fuzzySearchKeywords",defaultMessage:"File upload attach"},videoTitle:{id:"newBlock.video.title",defaultMessage:"Video"},videoDescription:{id:"newBlock.video.description",defaultMessage:"Embed from YouTube, Vimeo..."},videoKeywords:{id:"newBlock.video.fuzzySearchKeywords",defaultMessage:"Video"},audioTitle:{id:"newBlock.audio.title",defaultMessage:"Audio"},audioDescription:{id:"newBlock.audio.description",defaultMessage:"Embed from SoundCloud, Spotify..."},audioKeywords:{id:"newBlock.audio.fuzzySearchKeywords",defaultMessage:"Audio Sound Music"},embedTitle:{id:"newBlock.embed.title",defaultMessage:"Embed"},embedDescription:{id:"newBlock.embed.description",defaultMessage:"For PDFs, Google Maps, and more."},embedKeywords:{id:"newBlock.embed.fuzzySearchKeywords",defaultMessage:"Embed iFrame"},driveTitle:{id:"newBlock.drive.title",defaultMessage:"Google Drive"},driveDescription:{id:"newBlock.drive.description",defaultMessage:"Embed a Google Doc, Google Sheet..."},driveKeywords:{id:"newBlock.drive.fuzzySearchKeywords",defaultMessage:"Google Drive"},figmaTitle:{id:"newBlock.figma.title",defaultMessage:"Figma"},figmaDescription:{id:"newBlock.figma.description",defaultMessage:"Embed a Figma file."},figmaKeywords:{id:"newBlock.figma.fuzzySearchKeywords",defaultMessage:"Figma"},loomTitle:{id:"newBlock.loom.title",defaultMessage:"Loom"},loomDescription:{id:"newBlock.loom.description",defaultMessage:"Embed a Loom recording."},loomKeywords:{id:"newBlock.loom.fuzzySearchKeywords",defaultMessage:"Loom"},typeformTitle:{id:"newBlock.typeform.title",defaultMessage:"Typeform"},typeformDescription:{id:"newBlock.typeform.description",defaultMessage:"Embed a Typeform."},typeformKeywords:{id:"newBlock.typeform.fuzzySearchKeywords",defaultMessage:"Typeform"},codepenTitle:{id:"newBlock.codepen.title",defaultMessage:"CodePen"},codepenDescription:{id:"newBlock.codepen.description",defaultMessage:"Embed a CodePen."},codepenKeywords:{id:"newBlock.codepen.fuzzySearchKeywords",defaultMessage:"CodePen"},tweetTitle:{id:"newBlock.tweet.title",defaultMessage:"Tweet"},tweetDescription:{id:"newBlock.tweet.description",defaultMessage:"Embed a Tweet."},tweetKeywords:{id:"newBlock.tweet.fuzzySearchKeywords",defaultMessage:"Tweet"},gistTitle:{id:"newBlock.gist.title",defaultMessage:"GitHub Gist"},gistDescription:{id:"newBlock.gist.description",defaultMessage:"Embed a Gist from GitHub."},gistKeywords:{id:"newBlock.gist.fuzzySearchKeywords",defaultMessage:"GitHub Gist"},mapsTitle:{id:"newBlock.maps.title",defaultMessage:"Google Maps"},mapsDescription:{id:"newBlock.maps.description",defaultMessage:"Embed a Google Map."},mapsKeywords:{id:"newBlock.maps.fuzzySearchKeywords",defaultMessage:"Google Maps"},framerTitle:{id:"newBlock.framer.title",defaultMessage:"Framer"},framerDescription:{id:"newBlock.framer.description",defaultMessage:"Embed a Framer prototype."},framerKeywords:{id:"newBlock.framer.fuzzySearchKeywords",defaultMessage:"Framer"},invisionTitle:{id:"newBlock.invision.title",defaultMessage:"Invision"},invisionDescription:{id:"newBlock.invision.description",defaultMessage:"Embed an Invision project."},invisionKeywords:{id:"newBlock.invision.fuzzySearchKeywords",defaultMessage:"Invision"},mixpanelTitle:{id:"newBlock.mixpanel.title",defaultMessage:"Mixpanel"},mixpanelDescription:{id:"newBlock.mixpanel.description",defaultMessage:"Embed a Mixpanel project."},mixpanelKeywords:{id:"newBlock.mixpanel.fuzzySearchKeywords",defaultMessage:"Mixpanel"},equationTitle:{id:"newBlock.equation.title",defaultMessage:"Block equation"},equationDescription:{id:"newBlock.equation.description",defaultMessage:"Display a standalone math equation."},equationKeywords:{id:"newBlock.equation.fuzzySearchKeywords",defaultMessage:"LaTeX Math Block Equation $$ Formula"},pdfTitle:{id:"newBlock.pdf.title",defaultMessage:"PDF"},pdfDescription:{id:"newBlock.pdf.description",defaultMessage:"Embed a PDF."},pdfKeywords:{id:"newBlock.pdf.fuzzySearchKeywords",defaultMessage:"PDF"},factoryTitle:{id:"newBlock.factory.title",defaultMessage:"Template button"},factoryDescription:{id:"newBlock.factory.description",defaultMessage:"Duplicate blocks with a click."},factoryKeywords:{id:"newBlock.factory.fuzzySearchKeywords",defaultMessage:"Template Duplicate Button"},buttonTitle:{id:"newBlock.button.title",defaultMessage:"Button"},buttonDescription:{id:"newBlock.button.description",defaultMessage:"Run custom automations with a click."},buttonKeywords:{id:"newBlock.button.fuzzySearchKeywords",defaultMessage:"Button automation template duplicate"},breadcrumbTitle:{id:"newBlock.breadcrumb.title",defaultMessage:"Breadcrumb"},breadcrumbDescription:{id:"newBlock.breadcrumb.description",defaultMessage:"Show the current page location."},breadcrumbKeywords:{id:"newBlock.breadcrumb.fuzzySearchKeywords",defaultMessage:"Breadcrumb"},calloutTitle:{id:"newBlock.callout.title",defaultMessage:"Callout"},calloutDescription:{id:"newBlock.callout.description",defaultMessage:"Make writing stand out."},calloutKeywords:{id:"newBlock.callout.fuzzySearchKeywords",defaultMessage:"Callout"},table_of_contentsTitle:{id:"newBlock.tableOfContents.title",defaultMessage:"Table of contents"},table_of_contentsDescription:{id:"newBlock.tableOfContents.description",defaultMessage:"Show an outline of your page."},table_of_contentsKeywords:{id:"newBlock.tableOfContents.fuzzySearchKeywords",defaultMessage:"TOC Table of Contents"},whimsicalTitle:{id:"newBlock.whimsical.title",defaultMessage:"Whimsical"},whimsicalDescription:{id:"newBlock.whimsical.description",defaultMessage:"Embed a Whimsical board."},whimsicalKeywords:{id:"newBlock.whimsical.fuzzySearchKeywords",defaultMessage:"Whimsical"},hexTitle:{id:"newBlock.hex.title",defaultMessage:"Hex"},hexDescription:{id:"newBlock.hex.description",defaultMessage:"Embed a Hex cell."},hexKeywords:{id:"newBlock.hex.fuzzySearchKeywords",defaultMessage:"Hex"},deepnoteTitle:{id:"newBlock.deepnote.title",defaultMessage:"Deepnote"},deepnoteDescription:{id:"newBlock.deepnote.description",defaultMessage:"Embed a Deepnote block."},deepnoteKeywords:{id:"newBlock.deepnote.fuzzySearchKeywords",defaultMessage:"Deepnote"},miroTitle:{id:"newBlock.miro.title",defaultMessage:"Miro"},miroDescription:{id:"newBlock.miro.description",defaultMessage:"Embed a Miro board."},miroKeywords:{id:"newBlock.miro.fuzzySearchKeywords",defaultMessage:"Miro"},abstractTitle:{id:"newBlock.abstract.title",defaultMessage:"Abstract"},abstractDescription:{id:"newBlock.abstract.description",defaultMessage:"Embed an Abstract project."},abstractKeywords:{id:"newBlock.abstract.fuzzySearchKeywords",defaultMessage:"Abstract"},sketchTitle:{id:"newBlock.sketch.title",defaultMessage:"Sketch"},sketchDescription:{id:"newBlock.sketch.description",defaultMessage:"Embed a Sketch document."},sketchKeywords:{id:"newBlock.sketch.fuzzySearchKeywords",defaultMessage:"Sketch"},excalidrawTitle:{id:"newBlock.excalidraw.title",defaultMessage:"Excalidraw"},excalidrawDescription:{id:"newBlock.excalidraw.description",defaultMessage:"Embed an Excalidraw whiteboard."},excalidrawKeywords:{id:"newBlock.excalidraw.fuzzySearchKeywords",defaultMessage:"Excalidraw"},replitTitle:{id:"newBlock.replit.title",defaultMessage:"Replit"},replitDescription:{id:"newBlock.replit.description",defaultMessage:"Embed a repl."},replitKeywords:{id:"newBlock.replit.fuzzySearchKeywords",defaultMessage:"Replit"},databaseTitle:{id:"newBlock.database.title",defaultMessage:"Database"},databaseDescription:{id:"newBlock.database.description",defaultMessage:"Create a new database."},inlineTimelineDatabaseTitle:{id:"newBlock.inlineTimelineDatabase.title",defaultMessage:"Timeline database - Inline"},inlineTimelineDatabaseDescription:{id:"newBlock.inlineTimelineDatabase.description",defaultMessage:"Add a Timeline database to this page."},inlineTimelineDatabaseKeywords:{id:"newBlock.inlineTimelineDatabase.fuzzySearchKeywords",defaultMessage:"Timeline database - Inline"},fullPageTableDatabaseTitle:{id:"newBlock.fullPageTableDatabase.title",defaultMessage:"Table database - Full page"},fullPageTableDatabaseDescription:{id:"newBlock.fullPageTableDatabase.description",defaultMessage:"Add a Table database as a sub-page."},fullPageTableDatabaseKeywords:{id:"newBlock.fullPageTableDatabase.fuzzySearchKeywords",defaultMessage:"Table database - Full page"},fullPageBoardDatabaseTitle:{id:"newBlock.fullPageBoardDatabase.title",defaultMessage:"Board database - Full page"},fullPageBoardDatabaseDescription:{id:"newBlock.fullPageBoardDatabase.description",defaultMessage:"Add a Board database as a sub-page."},fullPageBoardDatabaseKeywords:{id:"newBlock.fullPageBoardDatabase.fuzzySearchKeywords",defaultMessage:"Board database - Full page"},fullPageGalleryDatabaseTitle:{id:"newBlock.fullPageGalleryDatabase.title",defaultMessage:"Gallery database - Full page"},fullPageGalleryDatabaseDescription:{id:"newBlock.fullPageGalleryDatabase.description",defaultMessage:"Add a Gallery database as a sub-page."},fullPageGalleryDatabaseKeywords:{id:"newBlock.fullPageGalleryDatabase.fuzzySearchKeywords",defaultMessage:"Gallery database - Full page"},fullPageListDatabaseTitle:{id:"newBlock.fullPageListDatabase.title",defaultMessage:"List database - Full page"},fullPageListDatabaseDescription:{id:"newBlock.fullPageListDatabase.description",defaultMessage:"Add a List database as a sub-page."},fullPageListDatabaseKeywords:{id:"newBlock.fullPageListDatabase.fuzzySearchKeywords",defaultMessage:"List database - Full page"},fullPageCalendarDatabaseTitle:{id:"newBlock.fullPageCalendarDatabase.title",defaultMessage:"Calendar database - Full page"},fullPageCalendarDatabaseDescription:{id:"newBlock.fullPageCalendarDatabase.description",defaultMessage:"Add a Calendar database as a sub-page."},fullPageCalendarDatabaseKeywords:{id:"newBlock.fullPageCalendarDatabase.fuzzySearchKeywords",defaultMessage:"Calendar database - Full page"},fullPageTimelineDatabaseTitle:{id:"newBlock.fullPageTimelineDatabase.title",defaultMessage:"Timeline database - Full page"},fullPageTimelineDatabaseDescription:{id:"newBlock.fullPageTimelineDatabase.description",defaultMessage:"Add a Timeline database as a sub-page."},fullPageTimelineDatabaseKeywords:{id:"newBlock.fullPageTimelineDatabase.fuzzySearchKeywords",defaultMessage:"Timeline database - Full page"},simpleTableTitle:{id:"newBlock.simple_table.title",defaultMessage:"Table"},simpleTableDescription:{id:"newBlock.simple_table.description",defaultMessage:"Add simple tabular content to your page."},simpleTableKeywords:{id:"newBlock.simple_table.fuzzySearchKeywords",defaultMessage:"Table"},tabTitle:{id:"newBlock.tab.title",defaultMessage:"Tabs"},tabDescription:{id:"newBlock.tab.description",defaultMessage:"Organize content in tabs."},tabKeywords:{id:"newBlock.tab.keywords",defaultMessage:"tab tabs tabbed switch toggle"},toggleFormatHeaderTitle:{id:"newBlock.toggleFormatHeader.title",defaultMessage:"Toggle heading 1"},toggleFormatHeaderDescription:{id:"newBlock.toggleFormatHeader.description",defaultMessage:"Hide content inside a large heading."},toggleFormatHeaderKeywords:{id:"newBlock.toggleFormatHeader.fuzzySearchKeywords",defaultMessage:"toggle heading expand 1 # h1"},toggleFormatSubHeaderTitle:{id:"newBlock.toggleFormatSubHeader.title",defaultMessage:"Toggle heading 2"},toggleFormatSubHeaderDescription:{id:"newBlock.toggleFormatSubHeader.description",defaultMessage:"Hide content inside a medium heading."},toggleFormatSubHeaderKeywords:{id:"newBlock.toggleFormatSubHeader.fuzzySearchKeywords",defaultMessage:"toggle sub heading expand 2 ## h2 two"},toggleFormatSubSubHeaderTitle:{id:"newBlock.toggleFormatSubSubHeader.title",defaultMessage:"Toggle heading 3"},toggleFormatSubSubHeaderDescription:{id:"newBlock.toggleFormatSubSubHeader.description",defaultMessage:"Hide content inside a small heading."},toggleFormatSubSubHeaderKeywords:{id:"newBlock.toggleFormatSubSubHeader.fuzzySearchKeywords",defaultMessage:"toggle subsub heading expand 3 ### h3 three"},columnListTitle:{id:"newBlock.columnList.title",defaultMessage:"Columns"},columnListDescription:{id:"newBlock.columnList.description",defaultMessage:"Create columns of blocks."},columnListKeywords:{id:"newBlock.columnList.fuzzySearchKeywords",defaultMessage:"col Create column columns block vertical"},column2Title:{id:"newBlock.column2.title",defaultMessage:"2 columns"},column2Description:{id:"newBlock.column2.description",defaultMessage:"Create 2 columns of blocks."},column2Keywords:{id:"newBlock.column2.fuzzySearchKeywords",defaultMessage:"col Create c2 col2 columns block vertical 2col two"},column3Title:{id:"newBlock.column3.title",defaultMessage:"3 columns"},column3Description:{id:"newBlock.column3.description",defaultMessage:"Create 3 columns of blocks."},column3Keywords:{id:"newBlock.column3.fuzzySearchKeywords",defaultMessage:"col c3 col3 column3 columns 3col three"},column4Title:{id:"newBlock.column4.title",defaultMessage:"4 columns"},column4Description:{id:"newBlock.column4.description",defaultMessage:"Create 4 columns of blocks."},column4Keywords:{id:"newBlock.column4.fuzzySearchKeywords",defaultMessage:"col c4 col4 column4 columns 4col four"},column5Title:{id:"newBlock.column5.title",defaultMessage:"5 columns"},column5Description:{id:"newBlock.column5.description",defaultMessage:"Create 5 columns of blocks."},column5Keywords:{id:"newBlock.column5.fuzzySearchKeywords",defaultMessage:"col c5 col5 column5 columns 5col five"},mermaidCodeTitle:{id:"newBlock.mermaidCode.title",defaultMessage:"Code - Mermaid"},mermaidCodeDescription:{id:"newBlock.mermaidCode.description",defaultMessage:"Create a diagram by writing code."},mermaidCodeKeywords:{id:"newBlock.mermaidCode.fuzzySearchKeywords",defaultMessage:"mermaid diagram graphviz flowchart code"},aiFreePromptBlockTitle:{id:"newBlock.aiFreePromptBlock.title",defaultMessage:"Custom AI Block"},aiFreePromptDescription:{id:"newBlock.aiFreePromptBlock.description",defaultMessage:"Generate content from any instruction."},aiFreePromptKeywords:{id:"newBlock.aiFreePromptBlock.fuzzySearchKeywords",defaultMessage:"ask help question prompt ai custom block content"},drawingTitle:{id:"newBlock.drawing.title",defaultMessage:"Drawing"},drawingDescription:{id:"newBlock.drawing.description",defaultMessage:"Draw and diagram on an infinite canvas."},drawingKeywords:{id:"newBlock.drawing.fuzzySearchKeywords",defaultMessage:"drawing diagram canvas illustration draw sketch tldraw doodle mindmap architecture paint pen"},slideTitle:{id:"newBlock.slide.title",defaultMessage:"Slide"},slideDescription:{id:"newBlock.slide.description",defaultMessage:"Create a presentable slide."},slideKeywords:{id:"newBlock.slide.fuzzySearchKeywords",defaultMessage:"slide present presentation"},aiSectionBlockTitle:{id:"newBlock.aiSection.title",defaultMessage:"AI Section"},aiSectionKeywords:{id:"newBlock.aiSection.fuzzySearchKeywords",defaultMessage:"ai section heading meeting note summary action items"},asanaImportTitle:{id:"newBlock.asanaImport.import",defaultMessage:"Asana"},asanaImportDescription:{id:"newBlock.asanaImport.description",defaultMessage:"Bring projects and tasks form Asana into Notion."},asanaImportKeywords:{id:"newBlock.asanaImport.fuzzySearchKeywords",defaultMessage:"Asana Projects Tasks Import"},confluenceApiImportTitle:{id:"newBlock.confluenceApiImport.import",defaultMessage:"Confluence"},confluenceApiImportDescription:{id:"newBlock.confluenceApiImport.description",defaultMessage:"Bring documents from Confluence via API into Notion."},confluenceApiImportKeywords:{id:"newBlock.confluenceApiImport.fuzzySearchKeywords",defaultMessage:"Confluence"},googleDocsImportTitle:{id:"newBlock.googleDocsImport.import",defaultMessage:"Google Docs"},googleDocsImportDescription:{id:"newBlock.googleDocsImport.description",defaultMessage:"Bring documents from Google Docs into Notion."},googleDocsImportKeywords:{id:"newBlock.googleDocsImport.fuzzySearchKeywords",defaultMessage:"Google Docs Import"},dropboxPaperImportTitle:{id:"newBlock.dropboxPaperImport.import",defaultMessage:"Dropbox Paper"},dropboxPaperImportDescription:{id:"newBlock.dropboxPaperImport.description",defaultMessage:"Bring documents from Dropbox Paper into Notion."},dropboxPaperImportKeywords:{id:"newBlock.dropboxPaperImport.fuzzySearchKeywords",defaultMessage:"Dropbox Paper Import"},evernoteImportTitle:{id:"newBlock.evernoteImport.import",defaultMessage:"Evernote"},evernoteImportDescription:{id:"newBlock.evernoteImport.description",defaultMessage:"Bring notes from Evernote into Notion."},evernoteImportKeywords:{id:"newBlock.evernoteImport.fuzzySearchKeywords",defaultMessage:"Evernote Import"},wordImportTitle:{id:"newBlock.wordImport.import",defaultMessage:"Word"},wordImportDescription:{id:"newBlock.wordImport.description",defaultMessage:"Bring documents from Microsoft Word into Notion."},wordImportKeywords:{id:"newBlock.wordImport.fuzzySearchKeywords",defaultMessage:"Word Import"},workflowyImportTitle:{id:"newBlock.workflowyImport.import",defaultMessage:"Workflowy"},workflowyImportDescription:{id:"newBlock.workflowyImport.description",defaultMessage:"Bring documents from Workflowy into Notion."},workflowyImportKeywords:{id:"newBlock.workflowyImport.fuzzySearchKeywords",defaultMessage:"Workflowy Import"},mondayImportTitle:{id:"newBlock.mondayImport.import",defaultMessage:"Monday"},mondayImportDescription:{id:"newBlock.mondayImport.description",defaultMessage:"Bring projects & tasks from Monday into Notion."},mondayImportKeywords:{id:"newBlock.mondayImport.fuzzySearchKeywords",defaultMessage:"Monday Import"},trelloImportTitle:{id:"newBlock.trelloImport.import",defaultMessage:"Trello"},trelloImportDescription:{id:"newBlock.trelloImport.description",defaultMessage:"Bring projects & tasks from Trello into Notion."},trelloImportKeywords:{id:"newBlock.trelloImport.fuzzySearchKeywords",defaultMessage:"Trello Import"},quipImportTitle:{id:"newBlock.quipImport.import",defaultMessage:"Quip"},quipImportDescription:{id:"newBlock.quipImport.description",defaultMessage:"Bring documents from Quip into Notion."},quipImportKeywords:{id:"newBlock.quipImport.fuzzySearchKeywords",defaultMessage:"Quip Import"},csvImportTitle:{id:"newBlock.csvImport.import",defaultMessage:"CSV"},csvImportDescription:{id:"newBlock.csvImport.description",defaultMessage:"Bring data from CSV into Notion."},csvImportKeywords:{id:"newBlock.csvImport.fuzzySearchKeywords",defaultMessage:"CSV Import"},genericImportTitle:{id:"newBlock.genericImport.import",defaultMessage:"ZIP"},genericImportDescription:{id:"newBlock.genericImport.description",defaultMessage:"Bring data from other tools into Notion."},genericImportKeywords:{id:"newBlock.genericImport.fuzzySearchKeywords",defaultMessage:"Generic Universal Zip Import"},htmlImportTitle:{id:"newBlock.htmlImport.import",defaultMessage:"HTML"},htmlImportDescription:{id:"newBlock.htmlImport.description",defaultMessage:"Bring data from HTML into Notion."},htmlImportKeywords:{id:"newBlock.htmlImport.fuzzySearchKeywords",defaultMessage:"HTML Import"},markdownImportTitle:{id:"newBlock.markdownImport.import",defaultMessage:"Text and Markdown"},markdownImportDescription:{id:"newBlock.markdownImport.description",defaultMessage:"Bring data from text and markdown into Notion."},markdownImportKeywords:{id:"newBlock.markdownImport.fuzzySearchKeywords",defaultMessage:"Text Markdown Import"},pdfImportTitle:{id:"newBlock.pdfImport.import",defaultMessage:"PDF"},pdfImportDescription:{id:"newBlock.pdfImport.description",defaultMessage:"Bring data from PDF into Notion."},pdfImportKeywords:{id:"newBlock.pdfImport.fuzzySearchKeywords",defaultMessage:"PDF Import"}});function I(e){const{key:t,displayName:n,fuzzySearchKeywords:o,blockType:r,thumbnail:i,thumbnailPadding:l,tooltipPhoto:d,description:u,createTemplate:p,shouldShow:m,isDisabled:g,disabledTooltipMessage:f,badge:h,postCreateCallback:v,collectionViewType:y,isToggleable:b}=e,_=c.default.formatMessage(o),S=_!==o.defaultMessage?`${_} ${o.defaultMessage}`:_;return{key:t,displayName:c.default.formatMessage(n),analyticsName:n.defaultMessage,searchName:S,thumbnail:i,thumbnailPadding:l,tooltipPhoto:d,description:u?c.default.formatMessage(u):void 0,templateRootBlockId:"root",blockType:r,createTemplate:p||(()=>a.Ao.create({[s.iU]:{root:{id:"root",type:r}}})),shouldShow:m,isDisabled:g,disabledTooltipMessage:f,badge:h,postCreateCallback:v,collectionViewType:y,isToggleable:b}}function C(e){const{key:t,displayName:n,fuzzySearchKeywords:o,thumbnail:r,tooltipPhoto:i,description:a,shouldShow:s,badge:l,postCreateCallback:d,collectionViewType:u,isToggleable:p,action:m}=e,g=c.default.formatMessage(o),f=g!==o.defaultMessage?`${g} ${o.defaultMessage}`:g;return{key:t,displayName:c.default.formatMessage(n),analyticsName:n.defaultMessage,searchName:f,thumbnail:r,tooltipPhoto:i,description:a?c.default.formatMessage(a):void 0,templateRootBlockId:"root",shouldShow:s,badge:l,postCreateCallback:d,collectionViewType:u,isToggleable:p,action:m}}const T={[i.tD.asanaImport]:C({key:i.tD.asanaImport,displayName:x.asanaImportTitle,fuzzySearchKeywords:x.asanaImportKeywords,thumbnail:r.Z.images.import.asanaPng,description:x.asanaImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"asana",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.confluenceApiImport]:C({key:i.tD.confluenceApiImport,displayName:x.confluenceApiImportTitle,fuzzySearchKeywords:x.confluenceApiImportKeywords,thumbnail:r.Z.images.import.confluencePng,description:x.confluenceApiImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"confluenceApi",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.googleDocsImport]:C({key:i.tD.googleDocsImport,displayName:x.googleDocsImportTitle,fuzzySearchKeywords:x.googleDocsImportKeywords,thumbnail:r.Z.images.import.googleDocsPng,description:x.googleDocsImportDescription,badge:"new",action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"gdocs",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.dropboxPaperImport]:C({key:i.tD.dropboxPaperImport,displayName:x.dropboxPaperImportTitle,fuzzySearchKeywords:x.dropboxPaperImportKeywords,thumbnail:r.Z.images.import.dropboxPaperPng,description:x.dropboxPaperImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"dropbox",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.evernoteImport]:C({key:i.tD.evernoteImport,displayName:x.evernoteImportTitle,fuzzySearchKeywords:x.evernoteImportKeywords,thumbnail:r.Z.images.import.evernotePng,description:x.evernoteImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"evernote",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.mondayImport]:C({key:i.tD.mondayImport,displayName:x.mondayImportTitle,fuzzySearchKeywords:x.mondayImportKeywords,thumbnail:r.Z.images.import.mondayPng,description:x.mondayImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"monday",openedFrom:"slash_command"})},shouldShow:e=>A()&&(0,b.d)()}),[i.tD.quipImport]:C({key:i.tD.quipImport,displayName:x.quipImportTitle,fuzzySearchKeywords:x.quipImportKeywords,thumbnail:r.Z.images.import.quipPng,description:x.quipImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"quip",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.trelloImport]:C({key:i.tD.trelloImport,displayName:x.trelloImportTitle,fuzzySearchKeywords:x.trelloImportKeywords,thumbnail:r.Z.images.import.trelloPng,description:x.trelloImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"trello",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.workflowyImport]:C({key:i.tD.workflowyImport,displayName:x.workflowyImportTitle,fuzzySearchKeywords:x.workflowyImportKeywords,thumbnail:r.Z.images.import.workflowyPng,description:x.workflowyImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"workflowy",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.wordImport]:C({key:i.tD.wordImport,displayName:x.wordImportTitle,fuzzySearchKeywords:x.wordImportKeywords,thumbnail:r.Z.images.import.wordPng,description:x.wordImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"docx",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.csvImport]:C({key:i.tD.csvImport,displayName:x.csvImportTitle,fuzzySearchKeywords:x.csvImportKeywords,thumbnail:r.Z.images.import.csvPng,description:x.csvImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"csv",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.htmlImport]:C({key:i.tD.htmlImport,displayName:x.htmlImportTitle,fuzzySearchKeywords:x.htmlImportKeywords,thumbnail:r.Z.images.import.htmlPng,description:x.htmlImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"html",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.markdownImport]:C({key:i.tD.markdownImport,displayName:x.markdownImportTitle,fuzzySearchKeywords:x.markdownImportKeywords,thumbnail:r.Z.images.import.textPng,description:x.markdownImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"markdown",openedFrom:"slash_command"})},shouldShow:e=>A()}),[i.tD.genericImport]:C({key:i.tD.genericImport,displayName:x.genericImportTitle,fuzzySearchKeywords:x.genericImportKeywords,thumbnail:r.Z.images.import.importPng,description:x.genericImportDescription,action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"genericImporter",openedFrom:"slash_command"})},shouldShow:e=>A()&&(0,y.tt)()}),[i.tD.pdfImport]:C({key:i.tD.pdfImport,displayName:x.pdfImportTitle,fuzzySearchKeywords:x.pdfImportKeywords,thumbnail:r.Z.images.import.pdfSvg,description:x.pdfImportDescription,badge:"beta",action:()=>{p.Z.setState({...p.Z.state,open:!0,currentTab:"imports",highlightedSetting:void 0,defaultSubtab:"pdf",openedFrom:"slash_command"})},shouldShow:e=>A()&&(0,S.n)()})},M={[i.Ti.text]:I({key:i.Ti.text,blockType:i.Ti.text,displayName:x.textTitle,fuzzySearchKeywords:x.textKeywords,thumbnail:r.Z.images.blocks.textPng,description:x.textDescription,tooltipPhoto:r.Z.images.tooltips.blocks.textPng}),[i.Ti.page]:I({key:i.Ti.page,blockType:i.Ti.page,displayName:x.pageTitle,fuzzySearchKeywords:x.pageKeywords,thumbnail:r.Z.images.blocks.pagePng,description:x.pageDescription,tooltipPhoto:r.Z.images.tooltips.blocks.pagePng}),[i.Ti.linkToPage]:I({key:i.Ti.linkToPage,blockType:i.Ti.linkToPage,displayName:x.linkToPageTitle,fuzzySearchKeywords:x.linkToPageKeywords,thumbnail:r.Z.images.blocks.linkPng,description:x.linkToPageDescription,tooltipPhoto:r.Z.images.tooltips.blocks.linkToPagePng}),[i.Ti.transclusionContainer]:I({key:i.Ti.transclusionContainer,blockType:i.Ti.transclusionContainer,displayName:x.transclusionContainerTitle,fuzzySearchKeywords:x.transclusionContainerKeywords,thumbnail:r.Z.images.blocks.transclusionPng,description:x.transclusionContainerDescription,tooltipPhoto:r.Z.images.tooltips.blocks.transclusionPng,shouldShow:e=>!(0,m.wTx)(e),createTemplate:e=>g._Z()}),[i.Ti.toDo]:I({key:i.Ti.toDo,blockType:i.Ti.toDo,displayName:x.toDoTitle,fuzzySearchKeywords:x.toDoKeywords,thumbnail:r.Z.images.blocks.toDoPng,description:x.toDoDescription,tooltipPhoto:r.Z.images.tooltips.blocks.toDoListPng}),[i.Ti.header]:I({key:i.Ti.header,blockType:i.Ti.header,displayName:x.headerTitle,fuzzySearchKeywords:x.headerKeywords,thumbnail:r.Z.images.blocks.headerPng,description:x.headerDescription,tooltipPhoto:r.Z.images.tooltips.blocks.headerPng}),[i.Ti.subHeader]:I({key:i.Ti.subHeader,blockType:i.Ti.subHeader,displayName:x.subHeaderTitle,fuzzySearchKeywords:x.subHeaderKeywords,thumbnail:r.Z.images.blocks.subheaderPng,description:x.subHeaderDescription,tooltipPhoto:r.Z.images.tooltips.blocks.subHeaderPng}),[i.Ti.subSubHeader]:I({key:i.Ti.subSubHeader,blockType:i.Ti.subSubHeader,displayName:x.subSubHeaderTitle,fuzzySearchKeywords:x.subSubHeaderKeywords,thumbnail:r.Z.images.blocks.subsubheaderPng,description:x.subSubHeaderDescription,tooltipPhoto:r.Z.images.tooltips.blocks.subsubheaderPng}),[i.Ti.image]:I({key:i.Ti.image,blockType:i.Ti.image,displayName:x.imageTitle,fuzzySearchKeywords:x.imageKeywords,description:x.imageDescription,tooltipPhoto:r.Z.images.tooltips.blocks.imagePng,thumbnail:r.Z.images.blocks.imagePng}),[i.Ti.bookmark]:I({key:i.Ti.bookmark,blockType:i.Ti.bookmark,displayName:x.bookmarkTitle,fuzzySearchKeywords:x.bookmarkKeywords,thumbnail:r.Z.images.blocks.webBookmarkPng,description:x.bookmarkDescription,tooltipPhoto:r.Z.images.tooltips.blocks.webBookmarkPng}),[i.Ti.divider]:I({key:i.Ti.divider,blockType:i.Ti.divider,displayName:x.dividerTitle,fuzzySearchKeywords:x.dividerKeywords,thumbnail:r.Z.images.blocks.dividerPng,description:x.dividerDescription,tooltipPhoto:r.Z.images.tooltips.blocks.dividerPng}),[i.Ti.code]:I({key:i.Ti.code,blockType:i.Ti.code,displayName:x.codeTitle,fuzzySearchKeywords:x.codeKeywords,thumbnail:r.Z.images.blocks.codePng,description:x.codeDescription,tooltipPhoto:r.Z.images.tooltips.blocks.codePng}),[i.Ti.quote]:I({key:i.Ti.quote,blockType:i.Ti.quote,displayName:x.quoteTitle,fuzzySearchKeywords:x.quoteKeywords,thumbnail:r.Z.images.blocks.quotePng,description:x.quoteDescription,tooltipPhoto:r.Z.images.tooltips.blocks.quotePng}),[i.Ti.bulletedList]:I({key:i.Ti.bulletedList,blockType:i.Ti.bulletedList,displayName:x.bulletedListTitle,fuzzySearchKeywords:x.bulletedListKeywords,thumbnail:r.Z.images.blocks.bulletedListPng,description:x.bulletedListDescription,tooltipPhoto:r.Z.images.tooltips.blocks.bulletedListPng}),[i.Ti.numberedList]:I({key:i.Ti.numberedList,blockType:i.Ti.numberedList,displayName:x.numberedListTitle,fuzzySearchKeywords:x.numberedListKeywords,thumbnail:r.Z.images.blocks.numberedListPng,description:x.numberedListDescription,tooltipPhoto:r.Z.images.tooltips.blocks.numberedListPng}),[i.Ti.toggle]:I({key:i.Ti.toggle,blockType:i.Ti.toggle,displayName:x.toggleTitle,fuzzySearchKeywords:x.toggleKeywords,thumbnail:r.Z.images.blocks.togglePng,description:x.toggleDescription,tooltipPhoto:r.Z.images.tooltips.blocks.toggleListPng,isToggleable:!0}),[i.Ti.file]:I({key:i.Ti.file,blockType:i.Ti.file,displayName:x.fileTitle,fuzzySearchKeywords:x.fileKeywords,thumbnail:r.Z.images.blocks.filePng,tooltipPhoto:r.Z.images.tooltips.blocks.filePng,description:x.fileDescription}),[i.Ti.video]:I({key:i.Ti.video,blockType:i.Ti.video,displayName:x.videoTitle,fuzzySearchKeywords:x.videoKeywords,thumbnail:r.Z.images.blocks.videoPng,tooltipPhoto:r.Z.images.tooltips.blocks.videoPng,description:x.videoDescription}),[i.Ti.audio]:I({key:i.Ti.audio,blockType:i.Ti.audio,displayName:x.audioTitle,fuzzySearchKeywords:x.audioKeywords,thumbnail:r.Z.images.blocks.audioPng,description:x.audioDescription}),[i.Ti.embed]:I({key:i.Ti.embed,blockType:i.Ti.embed,displayName:x.embedTitle,fuzzySearchKeywords:x.embedKeywords,thumbnail:r.Z.images.blocks.embedPng,description:x.embedDescription}),[i.Ti.drive]:I({key:i.Ti.drive,blockType:i.Ti.drive,displayName:x.driveTitle,fuzzySearchKeywords:x.driveKeywords,thumbnail:r.Z.images.blocks.drivePng,description:x.driveDescription,shouldShow:e=>(0,m.P5O)()}),[i.Ti.figma]:I({key:i.Ti.figma,blockType:i.Ti.figma,displayName:x.figmaTitle,fuzzySearchKeywords:x.figmaKeywords,thumbnail:r.Z.images.blocks.figmaPng,description:x.figmaDescription}),[i.Ti.loom]:I({key:i.Ti.loom,blockType:i.Ti.loom,displayName:x.loomTitle,fuzzySearchKeywords:x.loomKeywords,thumbnail:r.Z.images.blocks.loomPng,thumbnailPadding:2,description:x.loomDescription}),[i.Ti.typeform]:I({key:i.Ti.typeform,blockType:i.Ti.typeform,displayName:x.typeformTitle,fuzzySearchKeywords:x.typeformKeywords,thumbnail:r.Z.images.blocks.typeformPng,description:x.typeformDescription}),[i.Ti.codepen]:I({key:i.Ti.codepen,blockType:i.Ti.codepen,displayName:x.codepenTitle,fuzzySearchKeywords:x.codepenKeywords,thumbnail:r.Z.images.blocks.codepenPng,description:x.codepenDescription}),[i.Ti.tweet]:I({key:i.Ti.tweet,blockType:i.Ti.tweet,displayName:x.tweetTitle,thumbnailPadding:8,fuzzySearchKeywords:x.tweetKeywords,thumbnail:r.Z.images.blocks.twitterPng,description:x.tweetDescription}),[i.Ti.gist]:I({key:i.Ti.gist,blockType:i.Ti.gist,displayName:x.gistTitle,fuzzySearchKeywords:x.gistKeywords,thumbnail:r.Z.images.blocks.githubPng,thumbnailPadding:2,description:x.gistDescription}),[i.Ti.maps]:I({key:i.Ti.maps,blockType:i.Ti.maps,displayName:x.mapsTitle,fuzzySearchKeywords:x.mapsKeywords,thumbnail:r.Z.images.blocks.mapsPng,description:x.mapsDescription}),[i.Ti.framer]:I({key:i.Ti.framer,blockType:i.Ti.framer,displayName:x.framerTitle,fuzzySearchKeywords:x.framerKeywords,thumbnail:r.Z.images.blocks.framerPng,description:x.framerDescription}),[i.Ti.invision]:I({key:i.Ti.invision,blockType:i.Ti.invision,displayName:x.invisionTitle,fuzzySearchKeywords:x.invisionKeywords,thumbnail:r.Z.images.blocks.invisionPng,description:x.invisionDescription}),[i.Ti.equation]:I({key:i.Ti.equation,blockType:i.Ti.equation,displayName:x.equationTitle,fuzzySearchKeywords:x.equationKeywords,thumbnail:r.Z.images.blocks.texPng,tooltipPhoto:r.Z.images.tooltips.blocks.mathPng,description:x.equationDescription}),[i.Ti.pdf]:I({key:i.Ti.pdf,blockType:i.Ti.pdf,displayName:x.pdfTitle,fuzzySearchKeywords:x.pdfKeywords,thumbnail:r.Z.images.blocks.pdfPng,thumbnailPadding:6,description:x.pdfDescription}),[i.Ti.factory]:I({displayName:x.factoryTitle,fuzzySearchKeywords:x.factoryKeywords,thumbnail:r.Z.images.blocks.templateButtonPng,key:i.Ti.factory,blockType:i.Ti.factory,description:x.factoryDescription,tooltipPhoto:r.Z.images.tooltips.blocks.templateButtonPng,createTemplate:g.sw,shouldShow:()=>!1}),[i.Ti.button]:I({displayName:x.buttonTitle,fuzzySearchKeywords:x.buttonKeywords,thumbnail:r.Z.images.blocks.templateButtonPng,key:i.Ti.button,blockType:i.Ti.button,description:x.buttonDescription,tooltipPhoto:r.Z.images.tooltips.blocks.templateButtonPng,createTemplate:g.ax}),[i.Ti.breadcrumb]:I({displayName:x.breadcrumbTitle,thumbnail:r.Z.images.blocks.breadcrumbPng,tooltipPhoto:r.Z.images.tooltips.blocks.breadcrumbPng,description:x.breadcrumbDescription,fuzzySearchKeywords:x.breadcrumbKeywords,key:i.Ti.breadcrumb,blockType:i.Ti.breadcrumb}),[i.Ti.callout]:I({key:i.Ti.callout,blockType:i.Ti.callout,displayName:x.calloutTitle,thumbnail:r.Z.images.blocks.calloutPng,description:x.calloutDescription,fuzzySearchKeywords:x.calloutKeywords,tooltipPhoto:r.Z.images.tooltips.blocks.calloutPng,createTemplate:g.dq}),[i.Ti.tableOfContents]:I({displayName:x.table_of_contentsTitle,fuzzySearchKeywords:x.table_of_contentsKeywords,thumbnail:r.Z.images.blocks.tableOfContentsPng,tooltipPhoto:r.Z.images.tooltips.blocks.tableOfContentsPng,description:x.table_of_contentsDescription,key:i.Ti.tableOfContents,blockType:i.Ti.tableOfContents}),[i.Ti.slide]:I({key:i.Ti.slide,blockType:i.Ti.slide,displayName:x.slideTitle,thumbnail:r.Z.images.blocks.slideblockPng,description:x.slideDescription,fuzzySearchKeywords:x.slideKeywords,tooltipPhoto:r.Z.images.blocks.slideblockPng,shouldShow:e=>(0,m.zqE)(e)}),[i.Ti.whimsical]:I({key:i.Ti.whimsical,blockType:i.Ti.whimsical,displayName:x.whimsicalTitle,fuzzySearchKeywords:x.whimsicalKeywords,thumbnail:r.Z.images.blocks.whimsicalPng,description:x.whimsicalDescription}),[i.Ti.mixpanel]:I({key:i.Ti.mixpanel,blockType:i.Ti.mixpanel,displayName:x.mixpanelTitle,fuzzySearchKeywords:x.mixpanelKeywords,thumbnail:r.Z.images.blocks.mixpanelPng,thumbnailPadding:10,description:x.mixpanelDescription}),[i.Ti.miro]:I({key:i.Ti.miro,blockType:i.Ti.miro,displayName:x.miroTitle,fuzzySearchKeywords:x.miroKeywords,thumbnail:r.Z.images.blocks.miroPng,description:x.miroDescription}),[i.Ti.abstract]:I({key:i.Ti.abstract,blockType:i.Ti.abstract,displayName:x.abstractTitle,thumbnail:r.Z.images.blocks.abstractPng,description:x.abstractDescription,fuzzySearchKeywords:x.abstractKeywords}),[i.Ti.sketch]:I({key:i.Ti.sketch,blockType:i.Ti.sketch,displayName:x.sketchTitle,thumbnail:r.Z.images.blocks.sketchPng,description:x.sketchDescription,fuzzySearchKeywords:x.sketchKeywords}),[i.Ti.excalidraw]:I({key:i.Ti.excalidraw,blockType:i.Ti.excalidraw,displayName:x.excalidrawTitle,thumbnail:r.Z.images.blocks.excalidrawPng,thumbnailPadding:6,description:x.excalidrawDescription,fuzzySearchKeywords:x.excalidrawKeywords}),[i.Ti.replit]:I({key:i.Ti.replit,blockType:i.Ti.replit,displayName:x.replitTitle,thumbnail:r.Z.images.blocks.replitPng,thumbnailPadding:2,description:x.replitDescription,fuzzySearchKeywords:x.replitKeywords}),[i.Ti.table]:I({key:i.Ti.table,blockType:i.Ti.table,displayName:x.simpleTableTitle,thumbnail:r.Z.images.blocks.simpleTablePng,description:x.simpleTableDescription,fuzzySearchKeywords:x.simpleTableKeywords,tooltipPhoto:r.Z.images.tooltips.blocks.simpleTablePng,createTemplate:()=>g.S7()}),[i.Ti.tab]:I({key:i.Ti.tab,blockType:i.Ti.tab,displayName:x.tabTitle,thumbnail:r.Z.images.blocks.tabsPng,tooltipPhoto:r.Z.images.tooltips.blocks.tabsPng,description:x.tabDescription,fuzzySearchKeywords:x.tabKeywords,createTemplate:()=>g.ZW(),shouldShow:e=>(0,m.$cr)(e)}),[i.Ti.hex]:I({key:i.Ti.hex,blockType:i.Ti.hex,displayName:x.hexTitle,thumbnail:r.Z.images.blocks.hexPng,description:x.hexDescription,fuzzySearchKeywords:x.hexKeywords}),[i.Ti.deepnote]:I({key:i.Ti.deepnote,blockType:i.Ti.deepnote,displayName:x.deepnoteTitle,thumbnail:r.Z.images.blocks.deepnotePng,description:x.deepnoteDescription,fuzzySearchKeywords:x.deepnoteKeywords}),[i.MF.toggleFormatHeaderBlock]:I({key:i.MF.toggleFormatHeaderBlock,blockType:i.Ti.header,displayName:x.toggleFormatHeaderTitle,fuzzySearchKeywords:x.toggleFormatHeaderKeywords,thumbnail:r.Z.images.blocks.toggleHeading1Png,description:x.toggleFormatHeaderDescription,tooltipPhoto:r.Z.images.tooltips.blocks.toggleH1Png,createTemplate:()=>g.UG(i.Ti.header),isToggleable:!0}),[i.MF.toggleFormatSubHeaderBlock]:I({key:i.MF.toggleFormatSubHeaderBlock,blockType:i.Ti.subHeader,displayName:x.toggleFormatSubHeaderTitle,fuzzySearchKeywords:x.toggleFormatSubHeaderKeywords,thumbnail:r.Z.images.blocks.toggleHeading2Png,description:x.toggleFormatSubHeaderDescription,tooltipPhoto:r.Z.images.tooltips.blocks.toggleH2Png,createTemplate:()=>g.UG(i.Ti.subHeader),isToggleable:!0}),[i.MF.toggleFormatSubSubHeaderBlock]:I({key:i.MF.toggleFormatSubSubHeaderBlock,blockType:i.Ti.subSubHeader,displayName:x.toggleFormatSubSubHeaderTitle,fuzzySearchKeywords:x.toggleFormatSubSubHeaderKeywords,thumbnail:r.Z.images.blocks.toggleHeading3Png,description:x.toggleFormatSubSubHeaderDescription,tooltipPhoto:r.Z.images.tooltips.blocks.toggleH3Png,createTemplate:()=>g.UG(i.Ti.subSubHeader),isToggleable:!0}),[i.Ti.columnList]:I({key:i.Ti.columnList,blockType:i.Ti.columnList,displayName:x.columnListTitle,fuzzySearchKeywords:x.columnListKeywords,thumbnail:r.Z.images.blocks.columnListPng,description:x.columnListDescription,tooltipPhoto:r.Z.images.tooltips.blocks.columnListPng,createTemplate:()=>g.n_(2),shouldShow:e=>!e.environment.device.isPhone}),[i.MF.column2Block]:I({key:i.MF.column2Block,blockType:i.Ti.columnList,displayName:x.column2Title,fuzzySearchKeywords:x.column2Keywords,thumbnail:r.Z.images.blocks.columnListPng,description:x.column2Description,tooltipPhoto:r.Z.images.tooltips.blocks.columnListPng,createTemplate:()=>g.n_(2),shouldShow:e=>!e.environment.device.isPhone&&!e.blocks.some(h.hF)}),[i.MF.column3Block]:I({key:i.MF.column3Block,blockType:i.Ti.columnList,displayName:x.column3Title,fuzzySearchKeywords:x.column3Keywords,thumbnail:r.Z.images.blocks.columnListPng,description:x.column3Description,tooltipPhoto:r.Z.images.tooltips.blocks.columnListPng,createTemplate:()=>g.n_(3),shouldShow:e=>!e.environment.device.isPhone&&!e.blocks.some(h.hF)}),[i.MF.column4Block]:I({key:i.MF.column4Block,blockType:i.Ti.columnList,displayName:x.column4Title,fuzzySearchKeywords:x.column4Keywords,thumbnail:r.Z.images.blocks.columnListPng,description:x.column4Description,tooltipPhoto:r.Z.images.tooltips.blocks.columnListPng,createTemplate:()=>g.n_(4),shouldShow:e=>!e.environment.device.isPhone&&!e.blocks.some(h.hF)}),[i.MF.column5Block]:I({key:i.MF.column5Block,blockType:i.Ti.columnList,displayName:x.column5Title,fuzzySearchKeywords:x.column5Keywords,thumbnail:r.Z.images.blocks.columnListPng,description:x.column5Description,tooltipPhoto:r.Z.images.tooltips.blocks.columnListPng,createTemplate:()=>g.n_(5),shouldShow:e=>!e.environment.device.isPhone&&!e.blocks.some(h.hF)}),[i.MF.mermaidCodeBlock]:I({key:i.MF.mermaidCodeBlock,blockType:i.Ti.code,displayName:x.mermaidCodeTitle,fuzzySearchKeywords:x.mermaidCodeKeywords,thumbnail:r.Z.images.blocks.codePng,description:x.mermaidCodeDescription,tooltipPhoto:r.Z.images.tooltips.blocks.codePng,createTemplate:()=>g.iD("Mermaid","graph TD\n  Mermaid --\x3e Diagram"),postCreateCallback:e=>{o.default.afterNextFlush((()=>{o.default.afterNextFlush((async()=>{const t=await Promise.resolve().then(n.bind(n,898104)),o=d.C.find((t=>t.props.store.id===e.id)),r=null==o?void 0:o.props.store,i=r&&(0,k.mh)(r);if(i){var a;const e=(0,_.TD)({store:i,selection:{startIndex:0,endIndex:(null===(a=(0,w.x0)(i))||void 0===a?void 0:a.endIndex)??0}});t.setMultiSelection({multiSelection:e})}}))}))}}),[i.MF.aiFreePromptBlock]:I({key:i.MF.aiFreePromptBlock,blockType:i.Ti.aiBlock,displayName:x.aiFreePromptBlockTitle,fuzzySearchKeywords:x.aiFreePromptKeywords,thumbnail:r.Z.images.blocks.calloutPng,description:x.aiFreePromptDescription,badge:"ai",createTemplate:()=>g.Jy("helpMeWrite"),shouldShow:e=>!e.environment.device.isPhone&&function(e){let{publicEditMode:t}=e;return(0,v.GD)(t)}(e)}),[i.Ti.drawing]:I({key:i.Ti.drawing,blockType:i.Ti.drawing,displayName:x.drawingTitle,fuzzySearchKeywords:x.drawingKeywords,thumbnailPadding:8,thumbnail:r.Z.images.externalIntegrations.acmeIconPng,description:x.drawingDescription,shouldShow:e=>(0,f.A3)(),createTemplate:()=>g.Fr()})},P=(M[i.Ti.callout],M[i.Ti.toggle],[i.MF.aiFreePromptBlock]);function A(){return"on"===u.default.getEligibleGroup({experimentId:"slash_command_import",defaultGroup:"control"})}},641741:(e,t,n)=>{n.d(t,{Im:()=>d,NX:()=>c,xK:()=>u});var o=n(730120),r=n(886628),i=n(749085),a=n(842875);function s(){const e=(0,a.m)(),t=o.vF.create(e);return Object.freeze({timeZone:e,zone:t})}const l=i.default.createValue(s(),{name:"currentTimeZoneStore"});function c(){return l.state}function d(){return(0,r.VK)((()=>c()),[])}function u(){const e=s();l.state.timeZone!==e.timeZone&&l.setState(e)}},922145:(e,t,n)=>{n.d(t,{Jy:()=>i,KX:()=>a,Zr:()=>s});var o=n(80444),r=n(721429);function i(){const e=(0,r.np)(),t=o.default.state.currentSpaceStore;return e&&e.getSpaceId()!==(null==t?void 0:t.id)?null==e?void 0:e.getSpaceStore():t}function a(e){const t=e.parentStore??i();return null==t?void 0:t.getRecordStore(t,e.pointer)}function s(e){const{spaceStore:t}=e;return!t||(t.canAdmin()||!t.getSetting("custom_emoji_creation_only_admin"))}},111599:(e,t,n)=>{n.d(t,{$0:()=>p,A$:()=>d,ab:()=>c,dy:()=>u,kq:()=>g,p1:()=>m});var o=n(180951),r=n(401898),i=n(80444),a=n(188923);function s(){const e=p(),{mainEditorCurrentBlockStore:t}=i.default.state,n=a.default.state.open&&a.default.state.targetStore||t;return e||n}const l={backlinks:"section_collapsed",comments:"section_show",margin_comments:"inline"};function c(e,t){const n=s(),o=null==n?void 0:n.getFormat(),i=e&&(0,r.qg)(e,t)?e[t]:void 0,a=(null==o?void 0:o.collection_page_sections)||[];if(!i){if("backlinks"===t)return l.backlinks;if("comments"===t)return l.comments;if("margin_comments"===t)return l.margin_comments;if(a&&a.filter((e=>e.section===t))){const e=a.find((e=>e.section===t));if(e)return e.visibility}return"inline"}return i}function d(e,t){const n=s();if(!n)return!1;return c(n.getFormat().page_section_visibility,e)===t}function u(e){const t=s();if(!t)return!0;return"section_show"===c(t.getFormat().page_section_visibility,e)}function p(){const{mainEditorCurrentBlockStore:e}=i.default.state,t=a.default.state.open&&a.default.state.targetStore||e;return null==t?void 0:t.getAssociatedCollectionStore()}function m(){const e=p();if(!e)return!1;const t=e.getParentBlockStore();return Boolean(t&&(t.isLocked()||t.isNavigableAncestorNonEditableState()))}function g(e){const{propertySchema:t}=e,{type:n}=t,r=(0,o.gC)(t);return!(["created_time","created_by","last_edited_time","last_edited_by"].includes(n)||r)}},541056:(e,t,n)=>{n.d(t,{Fp:()=>c,HL:()=>l,u6:()=>d});var o=n(886628),r=n(749085),i=n(253877),a=n(641741);const s=new Map;function l(e){if(!s.has(e)){const t=r.default.createValue((()=>(0,i.Uu)(e)),{name:"store"});s.set(e,t)}return s.get(e).state}function c(){return(0,o.VK)((()=>{const{zone:e}=(0,a.NX)();return l(e)}),[])}function d(){for(const[e,t]of s){const n=(0,i.Uu)(e);t.state.equals(n)||t.setState(n)}}},321969:(e,t,n)=>{n.d(t,{H:()=>a,W:()=>i});var o=n(680310),r=n(218265);function i(e){const t=(0,r.Qc)(e);return t.query[o.JF]="true",(0,r.bf)({url:(0,r.WU)(t),query:t.query,hash:t.hash||void 0})}function a(e){const t=(0,r.Qc)((0,r.T1)(e));return t.query[o.f6]="true",(0,r.bf)({url:(0,r.WU)(t),query:t.query,hash:t.hash||void 0})}},374503:(e,t,n)=>{async function o(){const e={};if(!window.__isElectron)return{};const t=window.__desktopDeviceInfo;if(t)e.desktopOsVersion=t.os,e.desktopKernelVersion=t.kernel,e.desktopElectronVersion=t.electron,e.desktopChromiumVersion=t.chromium,e.desktopArch=t.arch,e.desktopPlatform=t.platform;else{const t=["architecture","fullVersionList","platformVersion"],o=await navigator.userAgentData.getHighEntropyValues(t);e.desktopArch="arm"===(n=o.architecture)?"arm64":n,e.desktopOsVersion=o.platformVersion,e.desktopPlatform=window.__platform;const r=navigator.userAgent.match(/Chrome\/([\d.]+)/);e.desktopChromiumVersion=r?r[1]:"Unknown";const i=navigator.userAgent.match(/Electron\/([\d.]+)/);e.desktopElectronVersion=i?i[1]:"Unknown"}var n;return e}n.r(t),n.d(t,{getDesktopDeviceInfo:()=>o})},971776:(e,t,n)=>{n.d(t,{$Z:()=>s,GU:()=>i,OS:()=>l,cr:()=>a});n(757658);var o=n(177420),r=n(509844);function i(e){const{ids:t,table:n,userStore:o}=e,r=[];for(const i of t){const e=o.getRecordModel({id:i,table:n});e&&r.push(e)}return a(r)}function a(e){return e.slice().sort(((e,t)=>t.created_at-e.created_at))}const s=["all","internal","public"],l={[o.cZ]:"internal",[r.K2]:"public"}},525898:(e,t,n)=>{function o(e,t,n,o){return Math.sqrt((e-n)*(e-n)+(t-o)*(t-o))}n.d(t,{Z:()=>o})},162619:(e,t,n)=>{n.d(t,{Gs:()=>a,IL:()=>p,OW:()=>u,UG:()=>i,kA:()=>m,kK:()=>s,kd:()=>c,oG:()=>d,r3:()=>g,sh:()=>l});n(757658);var o=n(415095),r=n(653965);function i(e){try{return Boolean(e&&void 0!==e.nodeType)}catch(t){return!1}}function a(e){return i(e)&&e.nodeType===Node.TEXT_NODE}function s(e){return i(e)&&e.nodeType===Node.ELEMENT_NODE}function l(e,t){for(;i(e)&&!t(e);)e=e.parentNode;return e}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(i(e)){for(const n of o.p4(e.childNodes))a(n)?t.push(n):n.childNodes&&c(n,t);return t}return[]}function d(e,t){return i(e)&&i(t)?r.cx(e.childNodes,(e=>e===t)):-1}const u=function(){if("undefined"==typeof window)return!0;if(window.InputEvent&&"function"==typeof window.InputEvent.prototype.getTargetRanges)return!0;const e=window.document.createElement("div");return e.contentEditable="true","onbeforeinput"in e}();function p(e){!u&&e.preventDefault&&e.preventDefault()}function m(e){return"inputType"in e}function g(e,t){return e!==t&&e.contains(t)}},643045:(e,t,n)=>{let o;n.d(t,{N:()=>a});let r=!1;function i(){r||(r=!0,window.requestAnimationFrame((()=>{r=!1,(o||(o=document.createElement("div"),o.style.position="fixed",o.style.top="-9999px",o.style.left="-9999px",o.style.zIndex="-9999",document.body.appendChild(o)),o).style.height=`${Math.random()}px`})))}function a(){const e=window.getSelection();e&&e.anchorNode&&i()}},100754:(e,t,n)=>{n.d(t,{i:()=>a,z:()=>i});var o=n(653965),r=n(828685);function i(e){const t=r.E.getMembersByDOMOrder({filter:e=>!e.props.store.inMemoryRecordCache.isMockTextStore}),n=o.cx(t,(t=>t.props.store===e)),i=t.find(((e,t)=>t>n&&e.props.canInsertText));return null==i?void 0:i.props.store}function a(e){const t=r.E.getMembersByDOMOrder({filter:e=>!e.props.store.inMemoryRecordCache.isMockTextStore}),n=o.cx(t,(t=>t.props.store===e)),i=o.dF(t,((e,t)=>t<n&&e.props.canInsertText));return null==i?void 0:i.props.store}},934700:(e,t,n)=>{function o(e){return"drag"in e&&e.drag?{WebkitAppRegion:"drag"}:"noDrag"in e&&e.noDrag?{WebkitAppRegion:"no-drag"}:{}}n.d(t,{X:()=>o})},963085:(e,t,n)=>{n.d(t,{bf:()=>S,kl:()=>w,NX:()=>_,sj:()=>b,W4:()=>m,id:()=>f,cJ:()=>h,I$:()=>k,YG:()=>y});n(21703);var o=n(180951),r=n(568626),i=(n(757658),n(218265));var a=n(937850),s=n(95477),l=n(385555),c=n(979947);const d=3,u=1e4;async function p(e){const{environment:t,sourceURL:n}=e;let o;o=`https://embed.notion.co/api/iframely?key=${s.default.iframely_prod.key}&url=${n}`;const l={environment:t,method:"GET",url:o,format:"json"},{result:p}=await a.W(d,u,(()=>(0,c.default)(l)));if(p&&"success"===p.type)return function(e,t){const n=e;return Object.keys(e).forEach((o=>{if("meta"===o&&(e[o].title&&(n.title=e[o].title),e[o].description&&(n.description=e[o].description),e[o].site&&(n.provider_name=e[o].site),e[o].author&&(n.author_name=e[o].author)),"html"===o){const r=/<iframe[^>]+src="([^"]+)/,i=e[o].match(r);if(i){const e=i[1];n.iframe=e}const a=/height:\s*([^px;]+)/,s=e[o].match(a),l=s?parseInt(s[1].trim()):null,c=/padding-bottom:\s*([^%;]+)/,d=e[o].match(c),u=d?parseInt(d[1].trim()):null,p=/padding-top:\s*([^px;]+)/,m=e[o].match(p),g=m?parseInt(m[1].trim()):null;l&&t&&(n.height=l),u&&t&&(n.padding=u),g&&t&&(n.padding_top=g)}if("url"===o&&(n.url=e[o]),"links"===o){if(e[o].thumbnail&&e[o].thumbnail.length>0){n.images=[];const t={width:Number,height:Number,url:String};t.width=e[o].thumbnail[0].media&&e[o].thumbnail[0].media.width?e[o].thumbnail[0].media.width:480,t.height=e[o].thumbnail[0].media&&e[o].thumbnail[0].media.height?e[o].thumbnail[0].media.height:1080,t.url=e[o].thumbnail[0]&&e[o].thumbnail[0].href?e[o].thumbnail[0].href:"",n.images.push(t)}e[o].icon&&e[o].icon.length>0&&(n.favicon_url=e[o].icon[0].href)}})),t||(n.title||(n.title=i.Qc(n.url).hostname),delete n.author_name,delete n.provider_name,delete n.iframe),n}(p.data);r.log({level:"error",from:"embedHelpers",type:"getExtractedData",error:null==p?void 0:p.error,data:{miscDataToConvertToString:{provider:"iframely"}}})}async function m(e,t){const n=encodeURIComponent(t.trim());return"on"===l.default.getEligibleGroup({experimentId:"iframely_switch",defaultGroup:"control"})?await p({environment:e,sourceURL:n}):await async function(e,t){const n={environment:e,method:"GET",url:`https://api.embed.ly/1/extract?key=${s.default.embedly.key}&url=${t}`,format:"json"},{result:o}=await a.W(d,u,(()=>(0,c.default)(n)));if(o&&"success"===o.type)return o.data;r.log({level:"error",from:"embedHelpers",type:"getExtractedData",error:null==o?void 0:o.error,data:{miscDataToConvertToString:{provider:"embedly"}}})}(e,n)}const g=/(\/d\/|id=)([-\w]{25,})/;function f(e){const t=e.match(g);if(t&&!(t.length<3))return t[2]}function h(e){return o.zB(e.store.getProperties().source)||e.source}const v=new Set(["http:","https:","blob:","data:"]);function y(e){const t=new URL(e,s.default.domainBaseUrl).protocol;return v.has(t)}function b(e){if(e&&e instanceof S)return{type:"invalid_protocol",protocol:e.protocol}}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.protocol;const n=k(e);if(!n)return{type:"invalid_url",source:e};const o=new URL(n).protocol;return"https:"===t&&"http:"===o?{type:"invalid_protocol",protocol:o}:void 0}class S extends Error{constructor(e){const t=new URL(e,s.default.domainBaseUrl).protocol;super(`Invalid URL protocol: "${t}"`),this.name=void 0,this.protocol=void 0,this.protocol=t,this.name="InvalidUrlProtocolError"}}function k(e){let t=i.yn(e);if(t||e.includes(":")||(t=i.yn(`https:${e}`)),t&&new URL(t).origin!==location.origin)return t}function w(e){const{aspectRatio:t,isFullWidth:n,isFullHeight:o,preserveScale:r,height:i,paddingTop:a}=e,s={position:"relative",display:"flex",justifyContent:"center",width:"100%",minHeight:100};return o?(s.height="100%",s.position=void 0):n||!r?s.height=i:(s.height=0,s.paddingBottom=100*(t||.75)+"%",s.paddingTop=a),s}},83631:(e,t,n)=>{n.d(t,{D9:()=>y,JT:()=>w,Jf:()=>x,ND:()=>b,TJ:()=>S,Xu:()=>_,bc:()=>v,by:()=>k,nk:()=>I,qZ:()=>C});var o=n(841892),r=n(598923),i=n(415095),a=n(265454),s=n(421838),l=n(744805),c=n(653965),d=n(401898),u=n(619584),p=n(250906),m=n(162619),g=n(268056),f=n(389224),h=n(489086);function v(){return(0,a.ZP)(o.Z.katex.katexMinCss,{resourceType:a._g.Stylesheet})}function y(e){const{source:t,currentEquationToken:n,selectedText:o}=e;return"rich_text_menu"===t?n?{type:"edit",source:t}:{type:"create",source:t,selection:!0}:"input_keyboard_shortcut"===t?n?{type:"edit",source:t}:{type:"create",source:t,selection:Boolean(o)}:"slash_menu"===t?{type:"create",source:t,selection:!1}:"click_token"===t||"arrow_keys"===t?{type:"edit",source:t}:"text_filter"===t?{type:"create",source:t,selection:!0}:void(0,d.t1)(t)}function b(e){const{environment:t,equation:n,from:o}=e;p.iA(t,{equation:n,equationNewlineCount:n.split("\n").length-1,equationBackslashCount:n.split("\\").length-1,equationLength:i.p4(n).length,from:o})}function _(e){return m.kK(e)&&e.classList.contains(l.et)}function S(e){const{selection:t,environment:n}=e,o=f.getRect(t);if(!o){return m.sh(t.startContainer,m.kK).getBoundingClientRect()}if(n.device.isChrome){const e=t.startContainer.childNodes[t.startOffset];return e&&_(e)?e.getBoundingClientRect():m.kK(t.startContainer)?new DOMRect(o.left,o.top,o.width,t.startContainer.getBoundingClientRect().height):new DOMRect(o.left,o.top,o.width,22)}return o}function k(e){const{environment:t,equation:n,displayMode:o}=e,i=t.KatexStore.getKatex();return i&&(0,r.CY)({katex:i,equation:n,options:{displayMode:"block"===o}}).error}function w(e){if("editing"!==e.mode)return;const t=(0,g.QY)(e.multiSelection);if(!t)return;const{store:n,selection:o}=t,{tokensBeforeRange:r,tokensInsideRange:i}=s.xrQ(n.getValue(),o.startIndex,o.endIndex);let a=c.Sm(r.map(s.J1x));for(const l of i){const e=s.J1x(l),t={startIndex:a,endIndex:a+e};if(s.YrK(l))return{token:l,position:t};a+=e}}function x(e){let t=e;for(let n=0;n<2;n+=1){const e=/^\$(.*)\$$/m.exec(t);if(!e||!e[1])break;t=e[1]}return t}function I(e){const t=(0,g.QY)(e.multiSelection);if(!t)return[];const{selection:n,store:o}=t,r=o.getValue();if(!r)return[];const i=h.wd(n)&&n.startIndex>0?[n.startIndex-1]:[n.startIndex];return h.oc(i,r)[0]||[]}function C(e){const{equationState:t,isTemporary:n}=e,o=t.editingToken?u.uh(s.hDy(t.editingToken),(e=>s.kuv(e)||s.QVC(e))):u.uh(t.annotations,(e=>s.kuv(e)||s.QVC(e)||s.ZAl(e))),r=c.oA([n&&s.W9d(),...o]);return s.qZ6(t.value,r)}},973744:(e,t,n)=>{n.d(t,{DJ:()=>a,ZV:()=>i,lj:()=>r});let o=!1;try{const e=Object.defineProperty({},"passive",{get:function(){o=!0}});window.addEventListener("test",(()=>{}),e)}catch(s){}function r(e,t,n,r){o?e.addEventListener(t,n,{passive:!0,capture:Boolean(r)}):e.addEventListener(t,n,Boolean(r))}function i(e,t,n,o){e.removeEventListener(t,n,Boolean(o))}function a(e){if(void 0!==e)return"shiftKey"in e&&"altKey"in e&&e.shiftKey&&e.altKey?"window":"button"in e&&1===e.button||"metaKey"in e&&e.metaKey||"ctrlKey"in e&&e.ctrlKey?"tab":void 0}},341232:(e,t,n)=>{n.d(t,{GQ:()=>g,Ue:()=>m,_F:()=>h,_l:()=>f,o$:()=>y,pI:()=>v,y6:()=>p});var o=n(217215),r=n(478601),i=n(402864),a=n(544876),s=n(401898),l=n(80444),c=n(385555),d=n(530874),u=n(240671);function p(e){if(e.isCollectionView()){var t,n;if(null===(t=e.getCollectionViewCollectionStore())||void 0===t||!t.isSyncedCollection())return;return null===(n=e.getCollectionViewCollectionStore())||void 0===n?void 0:n.getFormat()}return e.getFormat()}function m(e,t){const n=d.Z.state;if(!e||!n.loaded)return[];const o=(0,a.ny)({url:e,integrations:d.Z.integrations.state,currentSpaceId:t});return"success"!==o.type?[]:n.bots.filter((e=>e.integration_id===o.integration.id))}function g(e,t){if(!e)return;const n=(0,a.ny)({url:e,integrations:d.Z.integrations.state,currentSpaceId:t});return"success"===n.type?n:void 0}function f(e){const{store:t,isInDarkMode:n}=e,r=p(t);if(null!=r&&r.is_placeholder||null!=r&&r.error){const e=d.Z.integrations.state.find((e=>{let{id:t}=e;return r.integration_id===t}));if(e){const t=d.Z.bots.state.filter((t=>t.integration_id===e.id)).map((e=>{let{id:t}=e;return t})),{icon:s,dark_icon:c,accent_color:u,accent_icon:p}=e.info,m=n&&c?c:s;if(!m||!u||!p)return;const g=r.original_url;let f;if(g){var i;const t=(0,a.ny)({url:g,integrations:[e],currentSpaceId:null===(i=l.default.state.currentSpaceStore)||void 0===i?void 0:i.id});"success"===t.type&&(f=t.pattern)}return{type:null!=r&&r.is_placeholder?"placeholder":"error",userHasBotForIntegration:t.length>0,renderConfig:{headerAttributes:[{formatter:o.V1.placeholder,attribute:{id:"title",name:"Title",type:"inline",values:[e.name],format:{type:"title"}}}]},action:g&&!f?"error":void 0,updating:!1,originalUrl:g,pattern:f,integration:{id:e.id,icon:m,name:e.name,accentColor:u,accentIcon:p},botIds:t}}}return h({...e,getRenderFn:e=>e.block})}function h(e){var t;const{store:n,isInDarkMode:o,canEdit:i,currentUserId:c,showAction:d,getRenderFn:f}=e,h=p(n);if(!h||h.is_placeholder)return;if(void 0===h.external_object_id&&void 0!==h.uri)return;const v=h.original_url||h.uri;if(!n.isDefined())return;const y=g(v,n.getSpaceId()??(null===(t=l.default.state.currentSpaceStore)||void 0===t?void 0:t.id));if(!v||!y)return;const b=m(v,n.getSpaceId()),_=b.length>0,S=n.getExternalObjectSubInstanceStores(),k=S.map((e=>e.getFormat())).filter(s.$K);if(k.length!==S.length)return;const{integration:w,pattern:x}=y,{icon:I,dark_icon:C,accent_color:T,accent_icon:M}=w.info,P=o&&C?C:I;if(!P||!T||!M)return;const A=(0,r.U)(x.name),R=(0,a.Tf)({url:v,integration:w}),D=f(A)({integrationIcon:P,root:h,relations:k,parsedAttributes:R});if(!D)return;const B=u.Z.state.updatingUrls.has(v);let E;var F;n.isCollectionView()?E=null===(F=n.getCollectionViewCollectionStore())||void 0===F||null===(F=F.getFormat().error)||void 0===F?void 0:F.status_code:E=n.getFormatStore().getKeyStore("error").getKeyStore("status_code").getValue();const Z=Date.now(),U=Boolean(n.getCreatedById()!==c&&n.getCreatedTime()&&Z-n.getCreatedTime()<6e4);let V;return!B&&i&&c&&(d?V=d:h.error?V="error":(null==h||!h.stale)&&h.attributes||U||(V=_?"update":"authenticate")),{type:"active",renderConfig:D,action:V,updating:B,status_code:E,originalUrl:v,integration:{id:w.id,icon:P,name:w.name,accentColor:T,accentIcon:M},pattern:x,userHasBotForIntegration:_,botIds:b.map((e=>{let{id:t}=e;return t}))}}function v(e,t){if(!t)return e;const n=g(e,t);return"success"!==(null==n?void 0:n.type)?e:(0,i.l)({url:e,integration:n.integration,pattern:n.pattern})}function y(){return"on"===c.default.getEligibleGroup({experimentId:"link_preview_resizing_api",defaultGroup:"control"})}},206398:(e,t,n)=>{n.d(t,{hx:()=>O,lf:()=>U,ox:()=>F,r4:()=>Z,t9:()=>V});var o=n(667294),r=n(313991),i=n(800480),a=n(886628),s=n(724405),l=n(606906),c=n(117397),d=n(984619),u=n(407057),p=n(253877),m=n(842875),g=n(719233),f=n(544876),h=n(709291),v=n(531701),y=n(401898),b=n(137810),_=n(362896),S=n(751077),k=n(756496),w=n(634406),x=n(81865),I=n(365085),C=n(685567),T=n(296994),M=n(360682),P=n(277907),A=n(214976),R=n(433929),D=n(785893);function B(e){const{title:t,color:n,icon:o}=e,r=(0,s.Fg)(),i=n?(0,v.MJ)(`rgb(${n.r},${n.g},${n.b})`):void 0,a=(0,v.KR)(r,i);return(0,D.jsx)(C.Z,{format:d.lo.Medium,value:o?(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,D.jsx)(x.Z,{isAuthenticated:!1,url:o,width:32,render:(e,t)=>(0,D.jsx)(w.Z,{src:t,height:12,placeholderLoadedStyle:{width:12,height:12,marginRight:4}})}),(0,D.jsx)(_.Z,{children:(0,l.Z)(t)})]}):(0,D.jsx)(_.Z,{children:(0,l.Z)(t)}),showRemoveButton:!1,color:a.textColor,backgroundColor:a.backgroundColor,isSingle:!0,style:{display:"flex",whiteSpace:"break-spaces",flex:"0 0 auto"}})}function E(e){var t,n,o;const{uri:r,store:i,...s}=e,l=(0,a.VK)((()=>{const e=i.getExternalObjectSubInstanceStores().find((e=>{const t=e.getKeyStore("format").getKeyStore("uri").getValue();return t&&t===r}));if(e)return e.getFormat()}),[i,r]);if(!l)return null;const c=null===(t=l.attributes)||void 0===t?void 0:t.find(f.Id),d=null===(n=l.attributes)||void 0===n?void 0:n.find(f.li),u=null===(o=l.attributes)||void 0===o?void 0:o.find(f.hW);return c?u?(0,D.jsx)(B,{title:c.values[0],color:u.values[0],icon:null==d?void 0:d.values[0]}):c?(0,D.jsxs)("span",{style:{display:"flex",alignItems:"center"},children:[d&&(0,D.jsx)(S.Z,{type:"image_url",imageURL:d.values[0],size:16,style:{marginRight:4},imageStyle:s.avatarStyle}),(0,D.jsx)(F,{attribute:c,store:i,...s})]},r):null:null}function F(e){const{attribute:t,formatter:n,store:o,style:r,avatarStyle:i}=e,a=(0,s.Fg)();if(!t)return null;if((0,f.Id)(t)){var l;const e=t.values[0];if("enum"===(null===(l=t.format)||void 0===l?void 0:l.type)){const{color:n}=t.format;return(0,D.jsx)(B,{title:e,color:n})}{const t=e.replace(/[\r\n]/g,"").trim(),o=n?R.default.formatMessage(n,{value:t}):t;return(0,D.jsx)("div",{spellCheck:!1,style:{whiteSpace:"nowrap",color:a.mediumTextColor,...r},children:o})}}if((0,f.OM)(t))return(0,D.jsx)(E,{uri:t.values[0],store:o,style:r,avatarStyle:i});if((0,f.Gc)(t))return(0,D.jsx)(Z,{attribute:t,formatter:e.formatter,style:e.style,dateStyle:"relative"});if((0,f.An)(t)){const e=t.values[0];return(0,D.jsx)("div",{style:{color:a.mediumTextColor,fontSize:12,...r},children:n?R.default.formatMessage(n,{value:e}):String(e)})}return null}function Z(e){const{attribute:t,formatter:n,style:o,dateStyle:i}=e,a=(0,h.useIntl)(),l=(0,s.Fg)(),c=t.values[0];let d;if("datetimerange"===c.type)d=(0,u.ZV)({allowRelativeDates:!1,displayInUserTimezone:!0,intl:a,value:c});else{const e=(0,p.uO)(c,(0,m.r)());i&&"relative"!==i?"exact_time"===i?d=(0,u.Yx)(e,"medium_with_time",r.locale):"exact_date"===i?d=(0,u.Yx)(e,"medium",r.locale):(0,y.t1)(i):d=(0,u.tv)(e,r.locale)}const g=n?R.default.formatMessage(n,{value:d}):d;return(0,D.jsx)("div",{style:{color:l.mediumTextColor,fontSize:12,whiteSpace:"nowrap",...o},children:g})}function U(e){const t=(0,s.Fg)(),{attribute:n,isSmall:o,isUltraSmall:r}=e,i=r?16:o?22:34,a={...e.style,borderRadius:i,boxShadow:t.avatarBoxShadow};return(0,f.li)(n)?(0,D.jsx)(S.Z,{type:"image_url",imageURL:n.values[0],size:i,imageStyle:a}):(0,f.Id)(n)?(0,D.jsx)("div",{style:{...a,borderRadius:i,overflow:"hidden",boxShadow:t.avatarBoxShadow,height:30,width:30},children:(0,D.jsx)(k.Z,{size:i,title:n.values[0]})}):null}function V(e){var t;const{attribute:n}=e,{value:i}=(0,P.XJ)(T.FF.prismjs),a=(0,s.yK)((e=>({code:{whiteSpace:"pre-wrap",wordBreak:"break-all",fontFamily:b.Z.getCompositeFontFamily(r.locale).githubMono,fontSize:"12px",tabSize:2,minWidth:0,textAlign:"left",lineHeight:1.5},text:{fontSize:"85%",flexGrow:1,flexShrink:1,minHeight:"1em"},buttons:{fontWeight:b.Z.fontWeight.medium}})),[]),l=n.values[0],d=null===(t=n.format)||void 0===t?void 0:t.language,u=o.useMemo((()=>{if(i&&d&&(0,c.L9)(d)&&"Plain Text"!==d){const e=g.W[d],t=i.highlight(l,i.languages[e],d);return(0,D.jsx)("div",{spellCheck:!1,style:a.code,dangerouslySetInnerHTML:{__html:t}})}return(0,D.jsx)("div",{spellCheck:!1,style:a.code,children:(0,D.jsx)("code",{children:l})})}),[i,l,d,a.code]);return(0,D.jsx)("div",{style:{marginTop:4,marginRight:4,marginBottom:4,width:"100%"},children:(0,D.jsx)(I.Z,{moreElement:(0,D.jsxs)(D.Fragment,{children:["…"," ",(0,D.jsx)("span",{style:{...a.text,...a.buttons},children:(0,D.jsx)(h.FormattedMessage,{id:"externalObjectInstance.bodyAttribute.moreLabel",defaultMessage:"more"})})]}),lessElement:(0,D.jsx)(D.Fragment,{children:(0,D.jsx)("span",{style:{...a.text,...a.buttons},children:(0,D.jsx)(h.FormattedMessage,{id:"externalObjectInstance.bodyAttribute.showLessLabel",defaultMessage:"show less"})})}),maxLines:16,clampOverride:{fontSize:12,lineHeight:1.5},children:u})})}function N(e){const{attribute:t,store:n}=e,o=(0,s.Fg)(),r=(0,i.O7)(),l=(0,a.VK)((()=>(0,f.Id)(t)?t.values[0]:(0,A.IY)({environment:r,textValue:{value:t.values,spaceId:n.id},disableHover:!0,disableStyleAnnotations:!1,disableInsertedDeletedAnnotations:!1,disableDateStyleAnnotations:!1,disableSuggestionAnnotations:!1,disableLinks:!1,disabled:!1,katex:r.KatexStore.getKatex(),parentStore:n,emojiType:(0,M.e_)(r),formulaValueTypes:[],theme:o})),[r,n,o,t]);return(0,D.jsx)("div",{children:l})}function O(e){const t=(0,s.yK)((e=>({text:{color:e.regularTextColor,fontSize:12,lineHeight:1.45},buttons:{fontWeight:b.Z.fontWeight.medium}})),[]);return(0,D.jsx)("div",{style:{marginRight:4,marginBottom:4,width:"100%"},children:(0,D.jsx)(I.Z,{moreElement:(0,D.jsxs)(D.Fragment,{children:["…"," ",(0,D.jsx)("span",{style:{...t.text,...t.buttons},children:(0,D.jsx)(h.FormattedMessage,{id:"externalObjectInstance.bodyAttribute.moreLabel",defaultMessage:"more"})})]}),lessElement:(0,D.jsx)(D.Fragment,{children:(0,D.jsx)("span",{style:{...t.text,...t.buttons},children:(0,D.jsx)(h.FormattedMessage,{id:"externalObjectInstance.bodyAttribute.showLessLabel",defaultMessage:"show less"})})}),maxLines:3,clampOverride:{fontSize:t.text.fontSize,lineHeight:t.text.lineHeight},children:(0,D.jsx)("div",{spellCheck:!1,style:t.text,children:(0,D.jsx)(N,{attribute:e.attribute,store:e.store})})})})}},469988:(e,t,n)=>{n.d(t,{LX:()=>c,Vu:()=>d,XT:()=>p,ZP:()=>m,fe:()=>u,il:()=>l});n(757658);var o=n(492338),r=n(653965),i=(n(401898),n(619584));function a(e){const t=[];let n=!1,r=e;for(;""!==r;){const e=n?o.dK:o.Um,i=r.indexOf(e);if(-1===i)return t.push(s(r,!1)),t;const a=r.substring(0,i),l=r.slice(i+e.length);""!==a&&t.push(s(a,n)),r=l,n=!n}return t}function s(e,t){return t?[e,"highlight"]:[e]}function l(e){return 2===e.length&&"highlight"===e[1]}function c(e){return e[0]}function d(e){return e.reduce(((e,t)=>{if(0===e.length)return[t];const n=e[e.length-1];return l(n)===l(t)?[...e.slice(0,e.length-1),s(c(n)+c(t),l(t))]:[...e,t]}),[])}function u(e){if(!e)return[];let t=a(e);t.some((e=>l(e)&&1===c(e).length))&&(t=d(t));const n=t.filter(l).map(c);return r.jj(n)}function p(e){const{text:t,patterns:n,uniqueTokenHighlighterContext:o}=e,a=r.jj(n.filter((e=>e.length>0)));if(0===a.length)return[s(t,!1)];const l=r.MR(a,(e=>-e.length)).map(r.hr);return function(e,t,n){const o=(0,i.uO)(t,e);if(0===o.length)return[s(e,!1)];let r=0;const a=[];for(let i=0;i<o.length;i++){const t=o[i];if(!t)continue;let l;void 0===n||!n.has(t[0].toLowerCase())?(void 0!==n&&n.add(t[0].toLowerCase()),r!==t.index&&a.push(s(e.slice(r,t.index),!1)),a.push(s(t[0],!0)),l=t.index+t[0].length):l=r;o[i+1]||l===e.length||a.push(s(e.slice(l),!1)),r=l}return a}(t,new RegExp(l.join("|"),"ig"),o)}const m=a},344486:(e,t,n)=>{n.d(t,{W:()=>i});var o=n(541432),r=n(206258);function i(e){return e.findRecordStoreUIAncestor((e=>e instanceof r.G&&e.getType()===o.Ti.factory)).ancestor}},679897:(e,t,n)=>{n.d(t,{A3:()=>c,rf:()=>l});var o=n(667294),r=n(653965),i=n(80444),a=n(281236),s=n(548779);function l(e){const{currentUserRootStore:t}=i.default.state,n=null==t?void 0:t.getSpaceViewStores(),o=r.oA(null==n?void 0:n.map((e=>e.getSpaceId()))).map((t=>a.Z.getData(e,{spaceId:t}))),l=function(e){const t=e.map((e=>(0,s.cD)(e))),n=new Set(r.oA(t));return n.has("enterprise")?"enterprise":n.has("business")?"business":n.has("plus")?"plus":n.has("team_free")?"team_free":n.has("student")?"student":n.has("personal")?"personal":n.has("personal_free")?"personal_free":(n.has("free"),"free")}(o);return{userHighestPlanType:l,isSalesAssistedPlan:r.hX(o,{subscriptionTier:l}).some((e=>{if("none"!==(null==e?void 0:e.role)&&!0===(null==e?void 0:e.is_sales_assisted))return!0}))}}function c(){const[e,t]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{function e(e){var n,o;"forethoughtWidgetOpened"===(null==e||null===(n=e.data)||void 0===n?void 0:n.event)?t(!0):"forethoughtWidgetClosed"===(null==e||null===(o=e.data)||void 0===o?void 0:o.event)&&t(!1)}return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}})),e}},408304:(e,t,n)=>{n.d(t,{A1:()=>a,M5:()=>i,sY:()=>r});var o=n(842875);const r=(0,n(709291).defineMessages)({whereToDuplicate:{id:"forkPageModal.title",defaultMessage:"Where would you like to add {blockTitle}?"},selectWorkspace:{id:"forkPageModal.selectWorkspace",defaultMessage:"Select a workspace"},untitledBlockRecordTitle:{defaultMessage:"Untitled",id:"forkPageActions.untitledBlockRecordTitle"},untitledSpaceRecordTitle:{defaultMessage:"Untitled",id:"forkPageActions.untitledSpaceRecordTitle"},loadingStateDisplayText:{defaultMessage:"Duplicating {blockTitle} to {spaceTitle}…",id:"forkPageActions.loadingStateDisplayText"}});function i(e,t){var n;const i=null==e||null===(n=e.getModel())||void 0===n?void 0:n.getRenderTitleWithPlaceholder({getRecordModel:e.getRecordModel,userTimeZone:(0,o.r)(),intl:t});return i||t.formatMessage(r.untitledBlockRecordTitle)}function a(e,t){var n;const o=null==e||null===(n=e.getModel())||void 0===n?void 0:n.getRenderTitleWithEmojiOrPlaceholder({intl:t});return o||t.formatMessage(r.untitledSpaceRecordTitle)}},419306:(e,t,n)=>{n.d(t,{W:()=>a});var o=n(709291),r=n(433929);const i=(0,o.defineMessages)({twoItems:{id:"formatSettings.twoItems",defaultMessage:"{item1} and {item2}"},threeOrMoreItems:{id:"formatSettings.threeOrMoreItems",defaultMessage:"{item1}, and {numberOfOther} others"},twoItemsWithAmpersand:{id:"formatSettings.twoItems.withAmpersand",defaultMessage:"{item1} & {item2}"},threeOrMoreItemsWithRemoveComma:{id:"formatSettings.threeOrMoreItems.withRemoveComma",defaultMessage:"{item1} and {numberOfOther} others"},threeOrMoreItemsWithAmpersand:{id:"formatSettings.threeOrMoreItems.withAmpersand",defaultMessage:"{item1}, & {numberOfOther} others"},threeOrMoreItemsWithAmpersandAndRemoveComma:{id:"formatSettings.threeOrMoreItems.withAmpersandAndRemoveComma",defaultMessage:"{item1} & {numberOfOther} others"}});function a(e,t){const{removeComma:n,useAmpersand:o}=t||{};if(0===e.length)return"";const a=e[0];if(1===e.length)return a;const s=e[1];if(2===e.length)return o?r.default.formatMessage(i.twoItemsWithAmpersand,{item1:a,item2:s}):r.default.formatMessage(i.twoItems,{item1:a,item2:s});const l=e.length-1;return o?n?r.default.formatMessage(i.threeOrMoreItemsWithAmpersandAndRemoveComma,{item1:a,numberOfOther:l}):r.default.formatMessage(i.threeOrMoreItemsWithAmpersand,{item1:a,numberOfOther:l}):r.default.formatMessage(i.threeOrMoreItems,{item1:a,numberOfOther:l})}},783105:(e,t,n)=>{n.d(t,{_R:()=>d,uP:()=>l,vu:()=>s});n(757658);var o=n(730120),r=n(18201),i=n(653965),a=n(401898);let s=function(e){return e.Default="Default",e.Link="Link",e.Favorite="Favorite",e.Search="Search",e}({});const l=3,c={BONUS:{DEFAULT:100,LINK:120,SEARCH:200,FAVORITE:140},BONUS_NORMALIZER:100,TIME_BUCKETS:[{days:4,weight:100},{days:14,weight:70},{days:31,weight:50},{days:90,weight:30}],DEFAULT_BUCKET_WEIGHT:10};class d{constructor(e){var t=this;this.maxStoredVisits=void 0,this.visits=void 0,this.recordVisit=e=>{const{id:t,type:n,timestampForTestingOnly:o}=e,r=this.createVisit(n,o),a=this.visits.get(t);if(a.error)return;const s=a.value||this.createVisitCacheEntry();var l,c,d;s.totalVisits+=1,s.recentVisits=(l=s.recentVisits,c=r,d=this.maxStoredVisits,[...(0,i.pm)(l,d-1),c]),this.visits.set(t,s)},this.getVisits=e=>{const t=this.visits.get(e);if(!t.error)return t.value},this.getVisitedIds=()=>{const e=this.visits.keys();return e.error?[]:e.value},this.getFrecencyScore=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();const r=t.getVisits(e);if(!r)return d.UNVISITED_FRECENCY_SCORE;const{totalVisits:l,recentVisits:u}=r;if(0===l||0===u.length)return d.UNVISITED_FRECENCY_SCORE;const p=u.map((e=>{const{type:t,timestamp:r}=e,i=function(e){const{BONUS:t}=c;switch(e){case s.Default:return t.DEFAULT;case s.Link:return t.LINK;case s.Favorite:return t.FAVORITE;case s.Search:return t.SEARCH;default:(0,a.t1)(e)}}(t),l=function(e,t){const{TIME_BUCKETS:n,DEFAULT_BUCKET_WEIGHT:r}=c,i=o.ou.fromMillis(e).diff(o.ou.fromMillis(t),"days").get("days");return i<=n[0].days?n[0].weight:i<=n[1].days?n[1].weight:i<=n[2].days?n[2].weight:i<=n[3].days?n[3].weight:r}(n,r);return l*(i/c.BONUS_NORMALIZER)})),m=(0,i.Sm)(p)/p.length;return Math.ceil(l*m)};const{maxBlocks:n,maxStoredVisits:l,store:u,version:p}=e;this.maxStoredVisits=l,this.visits=new r.Z({prefix:e.prefix||"FrecencyStore",maxSize:n,store:u,version:p})}initialize(){this.visits.updateVersionAndGC()}sortFrecencyHighToLow(e){const{items:t,now:n,recordFrecency:o}=e;return(0,i.MR)(t,(e=>{const t="number"==typeof e.score?e.score:1,r=this.getFrecencyScore(e.id,n);o&&(e.frecencyScore=r);const i=e.personalizationBoost??1;return-1*t*Math.max(r,i)}))}createVisitCacheEntry(){return{totalVisits:0,recentVisits:[]}}createVisit(e,t){return{type:e,timestamp:"number"==typeof t?t:Date.now()}}clear(){const e=[];this.visits.scan((t=>e.push(t)));for(const t of e)this.visits.remove(t)}}d.UNVISITED_FRECENCY_SCORE=1},44819:(e,t,n)=>{n.d(t,{Us:()=>i,XR:()=>a});var o=n(313991),r=n(813559);n(653965),n(95477);Boolean("en-US"===o.locale);function i(e){const t="https://www.notion.so";return"en-US"!==o.locale?`${t}/${o.locale.toLocaleLowerCase()}${e}`:`${t}${e}`}function a(e,t){if(e.device.isElectron||e.device.isMobileNative)return!1;const n=(0,r.XU)(t,e.currentUser.isLoggedIn());return!!n&&"devOnly"!==n}},908989:(e,t,n)=>{n.d(t,{RT:()=>a,bk:()=>s,tt:()=>i});var o=n(385555),r=n(672340);function i(){return"on"===o.default.getEligibleGroup({experimentId:"generic_importer",defaultGroup:"control"})}function a(){return o.default.checkGate({gateName:"zip_importer_enabled"})}function s(e){const t=o.default.getEligibleGroup({experimentId:"special_case_generic_file_size",defaultGroup:r.CN.toString()});return Number(t)}},484210:(e,t,n)=>{n.d(t,{Hu:()=>v,Lr:()=>y,ZP:()=>b});var o=n(401800),r=n(915157),i=n(463306),a=n(570096),s=n(218265),l=n(95477),c=n(70853),d=n(356437),u=n(80444),p=n(925489),m=n(188923),g=n(798165),f=n(918514);function h(e){let t,n;const{store:o}=e,r=(o.getSpaceId()&&o.getSpaceStore())??u.default.state.currentSpaceStore,a=(0,g.fJ)(o),s=(0,i.$t)(a),p=(0,f.Sr)(o.environment);return s&&(e.preferPublicLink||p)?(e.fullyQualified||e.preferPublicLink&&!p||d.fx(o))&&(n=c.Lr(o)):(t=null==r?void 0:r.getEditDomain(),e.fullyQualified&&(n=l.default.domainBaseUrl)),{spaceDomain:t,baseUrl:n}}function v(e){const{store:t,collectionViewId:n,showMoveTo:i,saveParent:s,duplicate:l,pageVisitSource:c,queryId:d}=e;let f;if(n)f=n;else if(t&&t.isCollectionView()){const e=r.Z.get({userId:t.environment.currentUser.id,key:p.Z.getLocalViewPreferenceKey(t.id)});if(e)f=e;else{const e=t.getCollectionViewsStore().getValue();e&&(f=e[0])}}const{spaceDomain:v,baseUrl:y}=h({fullyQualified:!0,...e});let b=t,_=e.scrollToBlockId;if(t.isReady()&&!t.isNavigableBlock()){const e=(0,g.Dg)(t);e&&(b=e,_=t.id)}const S=u.default.state.mainEditorCurrentBlockStore;let k,w,x;return b.canRead()?S&&e.openInSidePeek?(k=S,w=b.id,x=(0,m.getUrlParamFromPeekMode)(a.R)):S&&e.openInCenterPeek?(k=S,w=b.id,x=(0,m.getUrlParamFromPeekMode)(a.l)):(k=b,w=e.peekViewBlockId,x=e.peekMode):(k=b,w=e.peekViewBlockId,x=e.peekMode),(0,o.Z)({pageId:k.id,pageModel:k.getModel(),pageVisitSource:c,queryId:d,scrollToBlockId:_,peekViewBlockId:w,peekMode:x,collectionViewId:f,discussionId:e.discussionId,spaceDomain:v,baseUrl:y,showMoveTo:i,saveParent:s,duplicate:l,templateGalleryItem:e.templateGalleryItem,projectManagementLaunch:e.projectManagementLaunch})}function y(e){let t;const n=u.default.state.mainEditorCurrentBlockStore,o=null==n?void 0:n.getRecordStore(n,e);if(o){const{baseUrl:e,spaceDomain:n}=h({store:o,fullyQualified:!0});e&&(t=(0,s.DB)(e,n||""))}return t}const b=v},787078:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(626765);const r=function(){const e=document.documentElement;return new o.iL(0,0,e.clientWidth,e.clientHeight)}},328415:(e,t,n)=>{n.d(t,{I2:()=>p,qH:()=>u,vE:()=>c});var o=n(265454),r=n(599405),i=n(757549),a=n(247839),s=n(95477),l=n(385555);async function c(e){const{environment:t,accessToken:n}=e;if(i.D6(t,{from:e.from}),t.device.isElectron){const t=await a.openGoogleDrivePickerPopup({url:(0,r.createGoogleDrivePicker)(s.default.domainBaseUrl,{token:n,viewType:e.viewType})});if(!t)return;"integration"in e?e.callback(!1,t.url):e.callback(t.id)}else await(0,o.ZP)("https://apis.google.com/js/api.js"),"integration"in e?window.gapi.load("picker",(()=>d({environment:t,accessToken:n,callback:e.callback,integration:e.integration,viewType:e.viewType}))):window.gapi.load("picker",(()=>d({environment:t,accessToken:n,callback:e.callback,viewType:e.viewType})))}function d(e){const{environment:t,accessToken:n}=e,o=`${window.location.protocol}//${window.location.host}`;(new window.google.picker.PickerBuilder).enableFeature(window.google.picker.Feature.SUPPORT_DRIVES).setOAuthToken(n).hideTitleBar().addView(new window.google.picker.DocsView(e.viewType)).setOrigin(o).setCallback((n=>{if(n.action===window.google.picker.Action.PICKED&&n.docs&&n.docs.length>0){const o=n.docs[0];"integration"in e?e.callback(!1,o.url):e.callback(o.id),i.D6(t,{from:"link_preview_placeholder"})}})).build().setVisible(!0)}function u(){return"on"===l.default.getEligibleGroup({experimentId:"google_external_integration_file_picker",defaultGroup:"control"})}function p(){return l.default.checkGate({gateName:"google_doc_importer"})}},212534:(e,t,n)=>{n.d(t,{$0:()=>s,Af:()=>o,Jx:()=>a,Wi:()=>l,ZP:()=>c,sg:()=>i});let o=function(e){return e[e.ButtonMouseDown=0]="ButtonMouseDown",e[e.EditorMouseDown=1]="EditorMouseDown",e[e.EditorMouseUp=2]="EditorMouseUp",e[e.EditorClick=3]="EditorClick",e[e.MenuListClick=4]="MenuListClick",e[e.EditorContextMenu=5]="EditorContextMenu",e[e.EditorMouseOver=6]="EditorMouseOver",e[e.EditorHoverMouseMove=7]="EditorHoverMouseMove",e[e.EditorDropMouseMove=8]="EditorDropMouseMove",e[e.EditorDoubleClick=9]="EditorDoubleClick",e[e.SidebarMouseMove=10]="SidebarMouseMove",e[e.ManageTeamsRowClick=11]="ManageTeamsRowClick",e[e.MobileTap=12]="MobileTap",e[e.CollectionSettingsClick=13]="CollectionSettingsClick",e[e.BaseTableRowClick=14]="BaseTableRowClick",e[e.NotificationClick=15]="NotificationClick",e[e.CollectionAutomationSettingsClick=16]="CollectionAutomationSettingsClick",e[e.PageTitleClick=17]="PageTitleClick",e[e.AssistantGroupedEditClick=18]="AssistantGroupedEditClick",e[e.PermissionItemClick=19]="PermissionItemClick",e[e.ToggleTrustedDomainPermission=20]="ToggleTrustedDomainPermission",e[e.PerformanceToolbarMouseMove=21]="PerformanceToolbarMouseMove",e}({});const r={};function i(e){const t=r[e.context],n=e.event.nativeEvent||e.event;if(t!==n){var o;r[e.context]=n;"unhandled"===(null===(o=e.callback)||void 0===o?void 0:o.call(e))&&(r[e.context]=t)}}async function a(e){const t=r[e.context],n=e.event.nativeEvent||e.event;if(t!==n){var o;r[e.context]=n;"unhandled"===await(null===(o=e.callback)||void 0===o?void 0:o.call(e))&&(r[e.context]=t)}}function s(e){i({event:e,context:o.EditorMouseDown,callback:()=>{}})}function l(e){i({event:e,context:o.EditorClick,callback:()=>{}})}const c=i},187290:(e,t,n)=>{n.d(t,{B:()=>l,x:()=>s});var o=n(155367),r=n(222294),i=n(186486),a=n(27724);let s=function(e){return e[e.Default=0]="Default",e[e.Hovered=1]="Hovered",e[e.Selected=2]="Selected",e[e.SelectedDescendant=3]="SelectedDescendant",e}({});function l(e,t){var n;const l=a.default.state.stores,c=i.default.state;if(1===l.length&&l.includes(e))return s.Selected;if(l.length>0&&l.every((t=>e.uiContains(t))))return s.SelectedDescendant;const d=o.ZP.state;return d&&d.isDragging&&d.currentParentStore&&e.uiContains(d.currentParentStore)||d&&d.isDragging&&d.currentDropZone&&d.currentDropZone.type===o.Dl.Selectable&&null!==(n=d.currentDropZone)&&void 0!==n&&n.store&&e.uiContains(d.currentDropZone.store)||c.isOpen&&c.currentStore===e||t&&!r.Z.state.isKeyboardMode?s.Hovered:s.Default}},741195:(e,t,n)=>{n.d(t,{$x:()=>d,Ii:()=>c,TS:()=>l,l5:()=>u,ov:()=>s});n(21703);var o=n(471924),r=n(600606),i=n(676462),a=(n(712139),n(250906),n(985677));const s={track:void 0};function l(e){var t;const{environment:n,table:r,spaceId:l}=e;if(!(0,i.LV)(r))return n.idCreator.idInMain(r);if(!l)return o.Il();const c=(0,a.aV)({defaultRecordCache:n.defaultRecordCache,currentUser:n.currentUser,spaceId:l});return c&&c.short_id_str?(null===(t=s.track)||void 0===t||t.call(s,{environment:n,spaceId:l,shortId:c.short_id_str,debugMessage:"randomUuidV8"}),n.idCreator.idWithSpaceShortId(Number(c.short_id_str),r)):o.Il()}function c(e){const{environment:t,table:n,spaceId:o}=e;return r.dr.fromPointerLike({table:n,id:l({table:n,spaceId:o,environment:t}),spaceId:o})}function d(e){const{environment:t,table:n,spaceId:o}=e;return{table:n,id:l({table:n,spaceId:o,environment:t}),spaceId:o}}function u(e){const{environment:t,spaceId:n}=e;if(void 0===n)return;const o=(0,a.aV)({defaultRecordCache:t.defaultRecordCache,currentUser:t.currentUser,spaceId:n});return o&&o.short_id_str?Number(o.short_id_str):void 0}},145567:(e,t,n)=>{n.d(t,{G7:()=>a,Gh:()=>l,LR:()=>i,gU:()=>s,jo:()=>r});var o=n(401898);const r="fileTypeAnyFiles",i="fileTypeImages",a="fileTypeVideos",s="fileTypeNone";function l(e){let{fileMimeType:t,allowedType:n}=e;switch(n){case r:return!0;case i:return function(e){return e.startsWith("image")&&!e.includes("photoshop")}(t);case a:return function(e){return e.startsWith("video")}(t);case s:return!1;default:(0,o.t1)(n)}}},137772:(e,t,n)=>{n.d(t,{Cz:()=>p,Gq:()=>u,az:()=>m,eT:()=>l,hi:()=>c,jl:()=>g,z_:()=>d});var o=n(21359),r=n(922756),i=n(325775),a=n(369122),s=n(328415);async function l(e){const t=await o.getTrelloAccount(e,{});return"success"===t.type?t.data:(console.error(t.error),{})}async function c(e){return Promise.resolve({areAccountsFetched:i.Z.state.areAccountsFetched,accountsResponse:i.Z.state.accountsResponse,isGoogleDocImporterEnabled:(0,s.I2)(),selectedFileId:i.Z.state.selectedFileId})}async function d(e){r.Z.setState({...r.Z.state,isFetchingAsanaAccount:!0});const t=await o.getAsanaAccount(e,{});if("success"===t.type){const{account:e}=t.data;return r.Z.setState({...r.Z.state,account:e,isFetchingAsanaAccount:!1}),e?t.data:{}}return console.error(t.error),r.Z.setState({...r.Z.state,isFetchingAsanaAccount:!1}),{}}async function u(e){try{const t=await o.getEvernoteAccount(e,{});if("success"===t.type){const{userInfo:e}=t.data;return{userInfo:e}}return console.error(t.error),{userInfo:void 0}}catch(t){return console.error(t),{userInfo:void 0}}}async function p(e,t){const n=await o.getConfluenceAccount(e,{spaceId:t});return"success"===n.type?n.data:(console.error(n.error),{})}async function m(e,t){a.Z.setState({...a.Z.state,isFetchingMondayAccount:!0});const n=await o.getMondayUser(e,{spaceId:t});var r,i;return"success"===n.type?null!==(r=n.data.user)&&void 0!==r&&r.email?(a.Z.setState({...a.Z.state,isFetchingMondayAccount:!1,account:null===(i=n.data.user)||void 0===i?void 0:i.email}),n.data):{user:void 0}:(a.Z.setState({...a.Z.state,isFetchingMondayAccount:!1}),console.error(n.error),{user:void 0})}async function g(e,t){const n=await o.getJiraAccount(e,{spaceId:t});return"success"===n.type?n.data:(console.error(n.error),{})}},249394:(e,t,n)=>{n.d(t,{B3:()=>_,En:()=>C,jd:()=>x,tn:()=>w,ub:()=>S,uk:()=>I,yy:()=>T});n(757658);var o=n(541432),r=n(143690),i=n(415095),a=n(295519),s=n(421838),l=n(744805),c=n(653965),d=n(401898),u=n(110906),p=n(431183),m=n(427534),g=n(80444),f=n(896026),h=n(826842),v=n(595256),y=n(820454),b=n(165598);const _={none:{type:"none"},block_match:{type:"block_match"}};function S(e){const{find:t,textValue:n,intl:o}=e,r=function(e){const{textValue:t,substring:n}=e;let o=0,r=0;const a=[];if(!t)return a;const l=(0,i.p4)(n.toLowerCase()),d=(0,s.O1u)(t);return(0,s.lzi)(d).forEach((e=>{r=o+(0,s.J1x)(e);if(!((0,s.QJH)(e)||(0,s.AJd)(e)))return void(o=r);const t=(0,s.WiV)(e).toString(),n=function(e){const{subsetArray:t,fullArray:n,offset:o=0}=e,r=[];for(let i=0;i<n.length&&!(t.length+i>n.length);i++){c.Xy(c.tP(n,i,i+t.length),t)&&r.push({startIndex:i+o,endIndex:i+t.length+o})}return r}({fullArray:(0,i.p4)(t.toLowerCase()),subsetArray:l,offset:o});a.push(...n),o=r})),a}({textValue:n,substring:t}).map((e=>({selection:e,allowReplace:!0}))),a=function(e){const{textValue:t,find:n,intl:o}=e,r=(0,s.P0m)(t),i=g.default.state.currentUserStore;if(0===r.length||!i)return[];const a=r.map((e=>{let t,{pointer:r,selection:a}=e;if("notion_user"===r.table)t=y.U.createChildStore(i,r);else{if("bot"!==r.table)return void r.table;t=v.Q.createChildStore(i,r)}if(t.getDisplayName(o).toLowerCase().includes(n.toLowerCase()))return a}));return c.oA(a)}({textValue:n,intl:o,find:t}).map((e=>({selection:e,allowReplace:!1}))),u=(0,s.Un8)({textValue:n,find:t,intl:o}).map((e=>({selection:e,allowReplace:!1}))),p=function(e){const{find:t,textValue:n}=e,o=(0,s.HC)(n),r=g.default.state.currentSpaceStore;if(!r)return[];const i=o.map((e=>{let{pointer:n,selection:o}=e;const i=h.G.createChildStore(r,n);if((0,s.QaF)(i.getTitleValue()).substring(0,l.l0).toLowerCase().includes(t.toLowerCase()))return o}));return c.oA(i)}({textValue:n,find:t}).map((e=>({selection:e,allowReplace:!1}))),m=function(e){const{find:t,textValue:n}=e,o=(0,s.Xyp)(n);if(!g.default.state.currentSpaceStore||0===o.length||0===t.length)return[];const r=o.map((e=>{let{metadata:n,selection:o}=e;const r=Object.values(n).filter(d.$K);if(Boolean(r.find((e=>e.toLowerCase().includes(t.toLowerCase())))))return o}));return c.oA(r)}({textValue:n,find:t}).map((e=>({selection:e,allowReplace:!1})));return[...r,...a,...p,...u,...m].sort(((e,t)=>e.selection.startIndex-t.selection.startIndex))}function k(e){const{block:t,find:n,intl:o}=e;if("table_row"!==t.getType())return[];const r=t.getParentBlockStore(),i=[],a=t.getProperties(),s=r?(0,m.h4)(r):Object.keys(a);return null==s||s.forEach((e=>{const r=a[e];if(!r)return;const s=S({find:n,intl:o,textValue:r}).map((n=>({allowReplace:n.allowReplace,selection:n.selection,blockStore:t,type:"simple_table_cell",propertyId:e})));s.length>0&&i.push(...s)})),i}function w(e){const{find:t,childBlocks:n,intl:i}=e;if(!n||0===t.length)return[];const a=[];for(const l of n){const e=l.getType(),n=l.getFormat();if(!e)continue;const m=(0,o.XD)(e,n)||(0,o.W2)(e);if(!(m||"table_row"===e||"collection_view"===e))continue;const g=l.getProperties(),{title:f,caption:h,description:v}=g;if("table_row"===e){const e=c.oA(k({block:l,find:t,intl:i}));e&&a.push(...e)}else if(m){const e={title:f,caption:h,description:v};(0,d.qP)(e).forEach((e=>{let[n,o]=e;if(!o)return;const r={type:"block",blockId:l.id,propertyType:n,blockStore:l},s=S({textValue:o,find:t,intl:i}).map((e=>({...e,...r,allowReplace:!l.isNavigableBlock()&&e.allowReplace})));a.push(...s)}))}else if("collection_view"===e){var s;const e=(0,u.fm)(l);if(!e)continue;const n=e.collectionViewStore();if(!n)continue;const o=n.getType();if(!o)continue;const d=n.getFormat(),m=e.normalizedSchemaStore.state,f=Object.keys(m).filter((e=>{var t,n;return"text"===(null===(t=m[e])||void 0===t?void 0:t.type)||"title"===(null===(n=m[e])||void 0===n?void 0:n.type)})),h=c.jj((0,r.ps)(d,o,m));if(!h)continue;const v=h.filter((e=>f.includes(e))),y={};((null===(s=n.getCollectionStore())||void 0===s?void 0:s.getFormat().property_visibility)??[]).forEach((e=>{const t=e.property;if(!v.includes(t))return;const n="show"===e.visibility||"hide_if_empty"===e.visibility&&Boolean(null==g?void 0:g[t]);y[t]=n}));e.groupsStore.state.forEach((e=>{const o=e.resultsStore.state.flatMap((e=>{var o;const r=e.getPropertiesStore().getValue();if(!r)return[];const a=null==e||null===(o=e.getAssociatedCollectionStore())||void 0===o?void 0:o.getLayoutStore();return v.flatMap((o=>{const s=r[o];if(!s)return[];const c=S({textValue:s,intl:i,find:t}),{isPropertyInPageDetails:d,isPropertyInGroup:u}=a?(0,p.Uo)({layoutStore:a,propertyId:o}):{isPropertyInPageDetails:!1,isPropertyInGroup:!1};return c.map((t=>({propertyId:o,selection:t.selection,allowReplace:!1,type:"page_property_value",inlineCollectionId:l.id,inlineCollectionViewId:n.id,blockStore:e,visible:Boolean(y[o]),isMatchInLayoutPageDetails:d,isPropertyInGroup:u})))}))}));a.push(...c.jj(o))}))}}return a}function x(e){var t;const{find:n,pageStore:o,intl:r}=e,i=o.getAssociatedCollectionStore();if(0===n.length||!i)return[];const s=o.getProperties(),l=(null===(t=o.getAssociatedCollectionStore())||void 0===t?void 0:t.getFormat().property_visibility)??[],c=o.getSchema(),d=(0,a.n)({schema:c,propertyFormats:l,titleProperty:"disallow"}),u={};l.forEach((e=>{const t=e.property,n="show"===e.visibility||"hide_if_empty"===e.visibility&&Boolean(null==s?void 0:s[t]);u[t]=n}));const m=[],g=null==i?void 0:i.getLayoutStore();return d.forEach(((e,t)=>{var i,a;let{property:l}=e;const d=null===(i=c[l])||void 0===i?void 0:i.name.toLowerCase(),f=null==d?void 0:d.includes(n.toLowerCase()),{isPropertyInPageDetails:h,isPropertyInGroup:v}=g?(0,p.Uo)({layoutStore:g,propertyId:l}):{isPropertyInPageDetails:!1,isPropertyInGroup:!1};f&&m.push({type:"page_property_name",allowReplace:!1,propertyId:l,visible:u[l]??!0,isMatchInLayoutPageDetails:h,isPropertyInGroup:v});const y="text"===(null===(a=c[l])||void 0===a?void 0:a.type)?null==s?void 0:s[l]:void 0;if(!y)return;const b=S({textValue:y,find:n,intl:r}),_=o.getAssociatedCollectionId();_&&b.forEach((e=>{m.push({type:"page_property_value",inlineCollectionId:_,selection:e.selection,visible:u[l]??!0,propertyId:l,blockStore:o,allowReplace:!1,isMatchInLayoutPageDetails:h,isPropertyInGroup:v})}))})),m}function I(e){const{match:t,pageStore:n,environment:o}=e;if(!t.allowReplace||!n)return!1;const{blockStore:r}=t,i=r.canEdit(),a=n.isLocked(),s=f.Z.getMode(o,n),l=!s.hasPublicPermission||s.hasPublicPermission&&"edit"===s.permission;return!(!i||a||!l)}function C(e){const{pageStore:t,find:n,intl:o}=e,r=[],i=[];if(0===n.length)return[];const a=(0,b.al)(t,{recursivelyLoadAllDiscussions:!0});return(0,b.bB)(a).unresolved.forEach((e=>{r.push(...e.getCommentStores())})),r.forEach((e=>{const t=e.getText(),r=e.getParentBlockStore(),a=e.getParentId();if(!t||!r||!a)return;S({find:n,textValue:t,intl:o}).forEach((t=>i.push({type:"comment",selection:t.selection,commentId:e.id,allowReplace:!1,blockStore:r,discussionId:a})))})),i}function T(e){return!!e&&("block"===e.type||"comment"===e.type||"simple_table_cell"===e.type||"page_property_value"===e.type)}},411253:(e,t,n)=>{function o(e,t){const{device:n}=e;n.isAndroid&&t.focus(),t.select()}n.d(t,{O:()=>o})},626907:(e,t,n)=>{n.d(t,{B:()=>a,H:()=>r});n(757658);var o=n(133728);function r(e){const{target:t,inviteTargetsStore:n}=e;return n.state.inviteTargets.some((e=>"newUser"===t.type?e.type===t.type&&t.value.email===e.value.email:"invalidUser"===t.type?e.type===t.type&&t.value.text===e.value.text:e.type===t.type&&e.value.id===t.value.id))}function i(e){return"invalidUser"!==e.type}function a(e){const{inviteTargetsStore:t,includeInputFieldText:n}=e,a=[...t.state.inviteTargets];if(n){const e=function(e){const t=e.state.tokenQuery.trim();if(!(0,o.oH)(t))return;const n={type:"newUser",value:{email:t},source:"email"};return r({target:n,inviteTargetsStore:e})?void 0:n}(t);e&&a.push(e)}return a.filter(i)}},245023:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(427537),r=n.n(o),i=n(653965);const a=function e(t,n,o){if(Array.isArray(o))return o.some((o=>e(t,n,o)));{const e=o.toLowerCase().split("+");if(t.device.isWindows||t.device.isLinux){if((i.q9(e,"command")||i.q9(e,"ctrl"))!==n.ctrlKey)return!1}else{if(i.q9(e,"command")!==n.metaKey)return!1;if(i.q9(e,"ctrl")!==n.ctrlKey)return!1}return i.q9(e,"shift")===n.shiftKey&&(i.q9(e,"alt")===n.altKey&&i.yW(e,(e=>{if("command"===e||"shift"===e||"ctrl"===e||"alt"===e)return!0;const t="code:";if(e.startsWith(t)&&n.code){const t=e.substr(5);return n.code.toLowerCase()===t}return r()(n.keyCode)===e})))}}},792783:(e,t,n)=>{n.d(t,{Z:()=>o});const o=function(e){const{spaceViewStore:t,pageId:n}=e;return!(!t||!n)&&-1!==t.getBookmarkedPageIds().indexOf(n)}},928314:(e,t,n)=>{n.d(t,{lF:()=>a,yA:()=>r});var o=n(749085);function r(){return i}const i={shift:!1,option:!1,control:!1,command:!1},a=o.default.createValue(i,{name:"keyboardStateStore"});function s(e){i.shift=Boolean(e.shiftKey),i.option=Boolean(e.altKey),i.control=Boolean(e.ctrlKey),i.command=Boolean(e.metaKey),a.emit()}window.addEventListener("keydown",s),window.addEventListener("keyup",s),window.addEventListener("focus",(function(e){i.shift=!1,i.option=!1,i.control=!1,i.command=!1,a.emit()}))},711985:(e,t,n)=>{n.d(t,{Nt:()=>s,mB:()=>l});var o=n(8263),r=n(606906),i=n(653965),a=n(401898);function s(e){const{environment:t,forTooltip:n}=e;let o;return o=n?t.device.isMac?"command":"control":t.device.isMac?"⌘":"ctrl",{command:o,enter:"↵",delete:"del",backspace:"del",esc:"escape",left:"←",right:"→",up:"↑",down:"↓",tab:"⇥",alt:t.device.isMac?"⌥":"alt"}}function l(e){const{name:t,environment:n,onlyShowFirst:l,forTooltip:c}=e,d=function(e,t){let n=(0,o.b)(t.device,e);return Array.isArray(n)||(n=[n]),i.UI(n,(e=>e.split("+")))}(t,n),u=s({environment:n,forTooltip:c});return d.map((e=>e.map((e=>function(e){const{shortcut:t,shortcutItemMap:n}=e;let o=t;return(0,a.qg)(n,t)&&(o=n[t]),(0,r.Z)(o)}({shortcutItemMap:u,shortcut:e}))).join("+"))).slice(0,l?1:void 0).join(" or ")}},278429:(e,t,n)=>{n.d(t,{aX:()=>i,hC:()=>s,hF:()=>a});var o=n(95477),r=n(385555);function i(){return o.default.isAdminMode||"on"===r.default.getEligibleGroup({experimentId:"highlight_legacy_transclusions",defaultGroup:"control"})}function a(){return o.default.isAdminMode||r.default.checkGate({gateName:"highlight_quasi_alive_blocks_enabled"})}function s(){return r.default.checkGate({gateName:"fix_legacy_transclusions_on_duplicate"})}},148709:(e,t,n)=>{n.d(t,{FV:()=>m,Fs:()=>v,Ts:()=>y,Z8:()=>u,ZG:()=>h,cX:()=>g,dY:()=>_,hy:()=>f,ny:()=>d,uP:()=>b});var o=n(599405),r=n(421838),i=n(401898),a=n(218265),s=n(95477),l=n(795714),c=n(623178);function d(){const e=c.Z.state,t=l.Z.state;return e.open?e:t.open?t:void 0}function u(e){switch(e.type){case"text":return!!e.editingToken;case"image":return!!e.imageHyperlink;default:(0,i.t1)(e)}}function p(e,t){const n=d();if(n&&n.focusLinkInput!==e)switch(n.type){case"text":c.Z.setState({...n,focusLinkInput:e,url:t?"":n.url});break;case"image":l.Z.setState({...n,focusLinkInput:e,url:t?"":n.url});break;default:(0,i.t1)(n)}}function m(){p(!0);const e=d();e&&"text"===e.type&&h(!1)}function g(){p(!1)}function f(){p(!1,!0)}function h(e){const t=c.Z.state;t.open&&t.focusTitleInput!==e&&c.Z.setState({...t,focusTitleInput:e})}function v(e){if("image"===e.type)return e.imageHyperlink;const t="text"===e.type?e.editingToken:void 0;if(!t)return;const n=r.hDy(t),o=r.rlz(n);return o?r.zW$(o):void 0}function y(e){if(!e)return;const t=r.hDy(e);return r.rlz(t)?r.WiV(e):void 0}function b(e){return e.url||""}function _(e){const t=r.rOz(e);if(t&&"url"===t.type){const e=(0,o.parseRoute)({url:t.href,baseUrl:s.default.domainBaseUrl,publicDomainName:s.default.publicDomainName,isMobile:!1,protocol:void 0,currentUrl:void 0});return"page"===e.name?{type:"notion",url:t.href,notionPage:e}:{type:"web",url:t.href}}const n=(0,a.yn)(e);if(n)return{type:"other",url:n}}},721214:(e,t,n)=>{n.d(t,{y:()=>r});function o(e){return e.teamId?`${e.collectionViewId}-${e.teamId}`:e.collectionViewId}const r=new class{constructor(){this.cache=new Map,this._locallyMutatedTasksDatabase=!1}get locallyMutatedTasksDatabase(){return this._locallyMutatedTasksDatabase}set locallyMutatedTasksDatabase(e){this._locallyMutatedTasksDatabase=e}get(e){const t=o(e);return this.cache.get(t)}set(e,t){const n=o(e);for(this.cache.delete(n),this.cache.set(n,t);this.cache.size>25;){const e=this.cache.keys().next().value;this.cache.delete(e)}}}},828125:(e,t,n)=>{n.d(t,{S:()=>s,k:()=>a});var o=n(313991),r=n(385555),i=n(512955);function a(e){const{mobileNative:t}=e;if(t){const n=Boolean(t.sqliteConnection),o=i.canSetCookie(e);return n&&o}return!0}function s(e){return"en-US"===o.locale&&(e.device.isElectron&&r.default.checkGate({gateName:"desktop_app_signup_hide_passcode"})||e.device.isMobileNative&&e.device.isIOS&&r.default.checkGate({gateName:"ios_app_signup_hide_passcode"}))}},460709:(e,t,n)=>{n.d(t,{Xp:()=>s,og:()=>r,qW:()=>l});var o=n(67381);let r=function(e){return e[e.Modal=0]="Modal",e[e.ActionSheet=1]="ActionSheet",e[e.Popup=2]="Popup",e}({});const i="menu",a=(0,o.Q)({modernContextDefaultValue:{menuType:void 0},displayName:i,legacyContextKey:i}),s=a.context,l=(a.legacyPropTypes,a.Provider)},385818:(e,t,n)=>{n.d(t,{$6:()=>a,Ds:()=>r,_K:()=>i,tM:()=>s});var o=n(653965);function r(e,t){let n=0;for(let o=0;o<t.length;o+=1){const r=t[o];if(e>n+r.items.length-1){n+=r.items.length;continue}const i=e-n,a=r.items[i];if(!a)return;return{item:a,index:{section:o,indexLocal:i}}}}function i(e,t){const n=t[e.section];if(!n)return;const o=n.items[e.indexLocal];return o||void 0}function a(e,t){return o.Sm(t.slice(0,e.section).map((e=>e.items.length)))+e.indexLocal}function s(e){return e.reduce(((e,t)=>e+t.items.length),0)}},98742:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(277744),r=n(653965);function i(e,t){const n={...e};return Object.keys(t).forEach((i=>{const a=t[i],s=e[i];s&&i.startsWith("on")&&r.mf(a)?n[i]=function(){s(...arguments),a(...arguments)}:s&&("ref"===i||i.endsWith("Ref"))&&a?n[i]=(0,o.lq)(s,a):s||(n[i]=a||s)})),n}},551783:(e,t,n)=>{n.d(t,{Bo:()=>se,eQ:()=>le,QG:()=>fe,ol:()=>ke,fn:()=>me,_W:()=>we,vs:()=>xe,O2:()=>ce,UF:()=>Se,Z3:()=>ge,w1:()=>Ie,rZ:()=>pe,s0:()=>ue,GH:()=>be,hc:()=>ve,hD:()=>ye,pk:()=>he,i2:()=>_e,$$:()=>de,LQ:()=>ee,$3:()=>oe,y6:()=>ae,Tz:()=>re,oQ:()=>ie,Oh:()=>Ce,zd:()=>ne});n(21703);var o=n(701302),r=n(427328),i=n(180951),a=n(568626),s=n(421838),l=n(211342),c=n(483249),d=n(106404),u=n(536280),p=n(245990),m=n(567060),g=n(721429),f=n(27724),h=n(631781),v=n(311712),y=n(524677),b=n(210228),_=n(977357);var S=n(119785),k=n(452423),w=n(800993),x=n(498724),I=n(898104),C=n(492022),T=n(457819),M=n(171728),P=n(398740),A=n(922705),R=n(745162),D=n(224646),B=n(938676),E=n(598794),F=n(427534),Z=n(431559),U=n(905162),V=n(80444),N=n(798180),O=n(316772),L=n(385555),j=n(803418),K=n(319111),z=n(619671),q=n(156638),H=n(155320),G=n(924666),W=n(119037),$=n(268056),Y=n(367669),Q=n(918514),J=n(273959),X=n(489086);function ee(e){const{environment:t}=e,{isMobileNative:n,osVersion:o,isIOS:r}=t.device;return!!n&&(!r||!l.isLessThanVersion(o,[14,0]))}let te=!1;function ne(e){te=e}function oe(e,t,n){var o,a;const{NativeMobileActionBarStore:s}=e,l=te||Boolean(null==s?void 0:s.state.enableShouldShowDebugging);if(!function(e,t,n){var o;const{device:a,NativeMobileActionBarStore:s,TabbedRouterStore:l}=e,c=te||Boolean(null==s?void 0:s.state.enableShouldShowDebugging);if(!a.isMobile)return Te(c,"canShowMobileActionBar = false (reason: !device.isMobile)"),!1;if((0,Q.__)(e)&&L.default.checkGate({gateName:"mab_consider_navigation_top_page"})){const e=(0,r.w_)(l.state);if("web"!==e.type||"page"!==(0,r._r)(e).route.name)return Te(c,"canShowMobileActionBar = false (reason: top page is not a web page)"),!1}if(H.default.state.open)return Te(c,"canShowMobileActionBar = false (reason: quickFindOpen)"),!1;if(!a.isMobileNative&&K.Z.state.open)return Te(c,"canShowMobileActionBar = false (reason: !device.isMobileNative && MentionMenuStore.state.open)"),!1;if(a.isMobileNative&&A.ZP.state.enabled)return Te(c,"canShowMobileActionBar = false (reason: !device.isMobileNative && DictationStore.state.open)"),!1;if(G.default.isEditingComment())return Te(c,"canShowMobileActionBar = false (reason: TextSelectionStore.isEditingComment())"),!1;const d=(0,T.RR)(O.default.state),u=null===(o=N.default.getActiveSession())||void 0===o?void 0:o.hasPendingOperations();if(d||u)return Te(c,"canShowMobileActionBar = false (reason: isCompletionsPopupActive || hasPendingEdits)"),!1;if(!z.Z.state.isOpen&&ee({environment:e})&&j.Z.hasOpenPopups())return Te(c,"canShowMobileActionBar = false (reason: !PageTemplateModalStore.state.open && isNativeMobileActionBarAvailable({ environment }) && GlobalPopupStore.hasOpenPopups() > 0)"),!1;if(z.Z.state.isOpen){var p;const e=z.Z.state,t=null===(p=e.collectionContextStore)||void 0===p?void 0:p.normalizedSchemaStore.state;if(!t)return Te(c,"canShowMobileActionBar = false (reason: !collectionSchema)"),!1;const n=(0,i.Qm)({schema:t,property:e.property});if(!n||"text"!==n.type||n.ai_inference)return Te(c,"canShowMobileActionBar = false (reason: PageBlockPropertyValueOverlayStore.state.isOpen && propertySchema.type !== text)"),!1}return!t.isFormBlock()&&(D.in(e)&&B.sidebarOpenStore.state?(Te(c,"canShowMobileActionBar = false (reason: sidebarHelpers.sidebarIsExpanded(environment) && sidebarOpenStore.get()"),!1):(0,W.ryx)()?!!(0,W.J5S)({environment:e,blocks:[t],publicEditMode:n})||(Te(c,"canShowMobileActionBar = false (reason: !_canEdit)"),!1):(Te(c,"canShowMobileActionBar = false (reason: !currentPageIsNotLocked())"),!1))}(e,t,n))return Te(l,"shouldShowMobileActionBar = false (reason: !canShowMobileActionBar)"),{canShow:!1,canShowNativeBar:!1,shouldShow:!1};const c=ee({environment:e});if(s&&null!==(o=s.state.menu)&&void 0!==o&&o.type&&!(0,g.JE)())return Te(l,"shouldShowMobileActionBar = true (reason: NativeMobileActionBarStore && NativeMobileActionBarStore.state.menu?.type"),{canShow:!0,canShowNativeBar:c,shouldShow:!0};const d=G.default.state;if("editing"!==d.mode)return Te(l,"shouldShowMobileActionBar = false (reason: TextSelectionStore.state.mode !== editing"),{canShow:!0,canShowNativeBar:c,shouldShow:!1};const u=d.multiSelection,p=(0,R.L5)(u),m=p.some((e=>e.editable.props.disableStyleAnnotations)),f=p.some((e=>e.editable.props.disableMobileActionBar)),h=p.some((e=>e.editable.props.disableComment));return p&&f?(Te(l,"shouldShowMobileActionBar = false (reason: !renderedBlocks || !disableMobileActionBar)"),{canShow:!0,canShowNativeBar:c,shouldShow:!1}):(Te(l,"shouldShowMobileActionBar = true"),{shouldShow:!0,canShowNativeBar:c,disableStyleAnnotations:m,disableComment:h,isEmpty:(0,$.iG)(u)&&0===u.end.index&&0===(null===(a=(0,X.x0)(u.end.store))||void 0===a?void 0:a.endIndex)})}function re(e){const{environment:t,store:n}=e,{isPhone:o}=t.device,r=V.default.state.currentLoadingContainerStore,i=Boolean(null==n?void 0:n.isCollectionView()),a=Boolean(null==n?void 0:n.getAssociatedCollectionStore()),s=t.currentUser.isLoggedIn(),l=q.Z.state.open;return Boolean(!a&&!i&&!l&&o&&n&&r&&n.isDefined()&&n.canEdit()&&!n.hasContent()&&s&&r.state.ready)}function ie(e,t,n,o){const r=(0,U.Y)("supportsNativeMobileDynamicActionBar"),i=n?n.getType():void 0,a=G.default.state;if("editing"===a.mode)return!t.state.isComposing&&!(0,$.iG)(a.multiSelection)||!r&&F.UQ()||o&&("quote"===i||"table"===i);const s=e.state.savedTextSelectionStoreState;return!(!s||"editing"!==s.mode)&&!(0,$.iG)(s.multiSelection)}function ae(e){var t;const{NativeMobileActionBarStore:n,device:o}=e;return Boolean(n&&(null===(t=n.state.menu)||void 0===t?void 0:t.type)&&!o.isTablet&&!o.isAndroid&&!(0,U.Y)("supportsMobileActionBarNativeActionMenuWithoutIgnoreSelectionArea"))}function se(e){if((0,Y.YF)(e))return!1;const{stores:t}=f.default.state;return t.length>0&&t[0].canEdit()&&!t[0].isNavigableBlock()&&!Boolean(F.UQ())}function le(e,t){return!(0,Y.YF)(e)&&t.canEdit()}function ce(e){"editing"===G.default.state.mode&&(b.createAndCommit({userAction:"mobileActionBarHelpers.handleIndent",environment:e,perform:t=>{w.n2({environment:e,transaction:t,shiftKey:!1})}}),Ce(e,"indent"))}function de(e){"editing"===G.default.state.mode&&(b.createAndCommit({userAction:"mobileActionBarHelpers.handleUnindent",environment:e,perform:t=>{w.n2({environment:e,transaction:t,shiftKey:!0})}}),Ce(e,"unindent"))}function ue(e){b.createAndCommit({userAction:"mobileActionBarHelpers.handleMoveUp",environment:e,perform:t=>{w.fs({environment:e,transaction:t,direction:"up"})}}),Ce(e,"move-up")}function pe(e){b.createAndCommit({userAction:"mobileActionBarHelpers.handleMoveDown",environment:e,perform:t=>{w.fs({environment:e,transaction:t,direction:"down"})}}),Ce(e,"move-down")}function me(e){const t=f.default.state.stores[0],n=G.default.state;if(t&&"editing"===n.mode){const{multiSelection:o}=n,r=(0,X.hn)(o.end.store)||(0,X.mK)(o.start.store),i=t.getParentBlockStore(),a=i&&i.isCalloutV2()&&1===i.getContentLength();b.createAndCommit({userAction:"mobileActionBarHelpers.handleDelete",environment:e,perform:e=>{if(a){const t=i.getParentBlockStore();t&&S.hr({childStore:i,parentStore:t,transaction:e})}else v.Od({store:t,transaction:e})}});if(F.UQ())b.createAndCommit({userAction:"mobileActionBarHelpers.handleDelete",environment:e,perform:t=>{E.W5({environment:e,transaction:t})}});else if(r){const t=(0,J.sQ)(r);y.eP({environment:e,store:t}),y.Db(e)}else y.ZH({environment:e});Ce(e,"remove")}}function ge(e){m.lZ({environment:e,mentionTypes:{page:!0,heading:!0,createPage:!0,user:!0,inviteUserToWorkspace:!1,inviteUserToPage:!0,bot:!0,date:!0,reminder:!0,templateVariable:!0,group:!0,formulaContextVariable:!0}}),Ce(e,"mention")}function fe(e){const t=G.default.state;if("empty"===t.mode){const t=(0,g.RM)();if(!t)throw new Error("No root store.");y.Ys({environment:e,store:t})}else if((0,$.iG)(t.multiSelection)){const n=(0,J.sQ)(t.multiSelection.start.store);y.Ys({environment:e,store:n})}(0,C.toggleInitialPrompt)({from:"mobile_action_bar",environment:e}),Ce(e,"ai")}function he(e,t){x.aS({environment:e,annotation:t}),Ce(e,t[0])}function ve(e,t,n){const{NativeMobileActionBarStore:o}=e;null==o||o.update((e=>({...e,menu:t,shouldRestoreSelectionForMenu:n})))}function ye(e,t,n){const{NativeMobileActionBarStore:o}=e;null==o||o.update((e=>({...e,isSubMenuOverridden:n,subMenu:t}))),void 0===t?Z.xv():Ce(e,t.type)}function be(e){k.KX(e),Ce(e,"redo")}function _e(e){k.Yw(e),Ce(e,"undo")}function Se(e){p.dz({type:"focusOnly",focus:!0}),Ce(e,s.GKr.Link)}function ke(e,t){const n=f.default.state.stores[0];if(!n)return;const o=G.default.state,r="empty"!==o.mode&&o.multiSelection;r&&!(0,$.iG)(r)?(M.WD({environment:e,blockStore:n,multiSelection:r}),Ce(e,"comment",t)):((0,P.y)({environment:e,blockStore:n}),Ce(e,"discuss",t))}function we(e){u.qn({environment:e,analyticsFrom:"rich_text_menu"}),Ce(e,"equation")}function xe(e){!async function(e){const t=f.default.state.stores,n=await _.y({multiple:!0,accept:e.device.isIOS?"image/*, video/*":"image/*"}),o=f.default.getCurrentRecordCache(),r=g.qQ(e);0!==n.length&&o&&b.createAndCommit({userAction:"mobileActions.takePicture",environment:e,perform:i=>{var a,s;const l=h.z({environment:e,files:n,inMemoryRecordCache:o,pageWidth:r,transaction:i,spaceId:0!==t.length?t[0].pointer.spaceId:null===(a=(0,g.RM)())||void 0===a?void 0:a.pointer.spaceId,useCrdt:0!==t.length?t[0].useCrdt():(null===(s=(0,g.RM)())||void 0===s?void 0:s.useCrdt())??!1});v.BM({environment:e,blocksToInsert:l,target:t,transaction:i,replaceEmptyTextBlock:!0}),y.ZH({environment:e})}})}(e),Ce(e,"take_picture")}function Ie(e,t,n){const{device:r}=e,i=r.isMobileNative&&r.isIOS&&r.isPhone;i||y.Z5({environment:e,stores:f.default.state.stores}),t&&n?d.Qn({environment:e,stores:f.default.state.stores,actionSectionGroupKey:"default",left:t,top:n,showInput:!1,analyticsFrom:"mobile_more_menu"}):d.$Z({environment:e,stores:f.default.state.stores,actionSectionGroupKey:"default",showInput:!1,analyticsFrom:"mobile_more_menu"}),Ce(e,"more"),o.default.afterNextFlush((()=>{i&&I.blurActiveElement()}))}function Ce(e,t,n){c.YO(e,{itemName:t,from:n})}function Te(e,t){e&&(console.log(t),a.log({level:"info",from:"mobileActionBarHelpers.ts",type:"logShouldShowReason",data:{message:t}}))}},352533:(e,t,n)=>{n.d(t,{S$:()=>a,Y2:()=>i,nd:()=>r});var o=n(211342);n(401898),n(95477);let r=function(e){return e[e.Bottom=0]="Bottom",e[e.Floating=1]="Floating",e}({});function i(e){const{environment:t}=e;return!t.device.isIOS&&!t.device.isAndroid}function a(e){const{environment:t}=e;if(!t.device.isIOS)return!1;if(!t.mobileNative||!t.mobileNative.api.openUpgradeModal)return!1;{if(!t.device.mobileAppVersion)return!1;const e=o.parseVersion(t.device.mobileAppVersion),n=o.parseVersion("0.4.165");if(!e||!n)return!1;return!o.isLessThanVersion(e,n)}}},720162:(e,t,n)=>{n.r(t),n.d(t,{getMobileNativeSessionInfo:()=>r,mobileNativeSessionInfoKey:()=>o});const o="__mobileNativeSessionInfo";function r(){return window[o]??{}}},556335:(e,t,n)=>{n.d(t,{d:()=>r});var o=n(385555);function r(){return"on"===o.default.getEligibleGroup({experimentId:"monday_importer",defaultGroup:"control"})}},639500:(e,t,n)=>{n.d(t,{N9:()=>s,Nf:()=>l,Vc:()=>r,X9:()=>c,uG:()=>d});var o=n(885802);const r={mouse:6,finger:0,stylus:6},i=3,a=4;function s(e){return e.button===i||e.button===a}function l(e){return e&&"stylus"===e.touchType?"stylus":"finger"}function c(){return o.IL.moved}function d(e){return!!e.isTrusted&&c()}},175770:(e,t,n)=>{n.d(t,{Kg:()=>P,lQ:()=>V,hD:()=>U,cJ:()=>O,HE:()=>E,uw:()=>N,EC:()=>R,ah:()=>D,vz:()=>Z,ru:()=>L,ed:()=>j});n(21703),n(667294);var o=n(541432),r=n(253877),i=n(269246),a=n(421202),s=n(606287),l=n(475246),c=n(429369),d=n(709291),u=n(401898),p=n(547307),m=n(474523),g=n(80444),f=n(155367),h=n(206258),v=n(599757),y=n(855337),b=n(433929),_=n(35026),S=n(798165),k=n(367669),w=n(918514),x=n(548779),I=n(385644),C=n(137810),T=n(785893);async function M(){return p.confirmUserAction({message:(0,T.jsx)("span",{children:(0,T.jsx)(d.FormattedMessage,{defaultMessage:"Are you sure you want to make this page private? <boldtext>Only you will be able to access it.</boldtext>",id:"confirmDialog.movePageToPrivate.message",values:{boldtext:e=>(0,T.jsx)("span",{style:{fontWeight:C.Z.fontWeight.semibold},children:e})}})}),acceptLabel:(0,T.jsx)(d.FormattedMessage,{defaultMessage:"Move to private",id:"confirmDialog.movePageToPrivate.confirmButton.label"})})}const P=20,A=(0,d.defineMessages)({privateDestinationName:{id:"moveToHelpers.destinationName.private",defaultMessage:"Private"},numPagesDescriptorString:{id:"moveToHelpers.movePageDescriptorString",defaultMessage:"{numPagesMoved, plural, one {# page} other {# pages}}"},numPagesWithSubitemsDescriptorString:{id:"moveToHelpers.movePagesWithSubitemsDescriptorString",defaultMessage:"{numPagesMoved, plural, one {# page} other {# pages}} and {numSubitemsMoved, plural, one {# sub-item} other {# sub-items}}"},numBlocksDescriptorString:{id:"moveToHelpers.moveBlocksDescriptorString",defaultMessage:"{numBlocksMoved, plural, one {# block} other {# blocks}}"},bookmarksDestinationName:{id:"moveToHelpers.destinationName.favorites",defaultMessage:"Favorites"},movedMessagesWithDestinationToast:{id:"moveToHelpers.afterBulkMoveCompleteToastMessageWithDestination",defaultMessage:"Moved {pageDescriptor} to {destinationName}"},movedToDestinationShortToast:{id:"moveToHelpers.afterMoveCompleteOnMobileToastMessageWithDestination",defaultMessage:"Moved to {destinationName}"},movedMessagesToast:{id:"moveToHelpers.afterBulkMoveCompleteToastMessage",defaultMessage:"Moved {pageDescriptor}"}});function R(e){const{movedItems:t,numSubitems:n}=e;if(!(t.filter((e=>e.isNavigableBlock())).length===t.length))return b.default.formatMessage(A.numBlocksDescriptorString,{numBlocksMoved:t.length});if(1===t.length){const e=B(t[0]);if(e)return e}return n?b.default.formatMessage(A.numPagesWithSubitemsDescriptorString,{numPagesMoved:t.length-n,numSubitemsMoved:n}):b.default.formatMessage(A.numPagesDescriptorString,{numPagesMoved:t.length})}function D(e){const{environment:t,movedItems:n,moveToLocation:o,numSubitems:r}=e,i=R({movedItems:n,numSubitems:r}),a=function(e){const{environment:t,moveToLocation:n}=e,{currentSpaceStore:o}=g.default.getState();if(void 0===n||void 0===o)return;switch(n.type){case"moveToBlock":return B(n.blockStore);case"moveToCollection":return B(n.collectionStore);case"moveToCurrentWorkspace":return(0,x.rn)(t,o);case"moveToPrivatePages":return b.default.formatMessage(A.privateDestinationName);case"moveToTeam":return B(n.teamStore);case"moveToOtherWorkspace":return(0,x.rn)(t,n.spaceStore);case"moveToBookmarks":case"moveToShared":return;default:(0,u.t1)(n)}}({environment:t,moveToLocation:o});return a?t.device.isPhone?b.default.formatMessage(A.movedToDestinationShortToast,{destinationName:a}):b.default.formatMessage(A.movedMessagesWithDestinationToast,{pageDescriptor:i,destinationName:a}):b.default.formatMessage(A.movedMessagesToast,{pageDescriptor:i})}function B(e){var t;const n=b.default.getIntl();if(e)return null===(t=e.getModel())||void 0===t?void 0:t.getRenderTitle({getRecordModel:e.getRecordModel,userTimeZone:r.x7,intl:n})}function E(e,t){const{currentSpaceStore:n}=g.default.getState(),o=("space"===e.type?e.id:e.spaceId)??(null==n?void 0:n.id);if(void 0===n||void 0===o)return;const r=function(e){var t;const{currentUserRootStore:n,currentSpaceStore:o}=g.default.state;return(null==o?void 0:o.id)===e?o:null==n||null===(t=n.getSpaceViewStores())||void 0===t||null===(t=t.find((t=>{var n;return(null===(n=t.getSpaceStore())||void 0===n?void 0:n.id)===e})))||void 0===t?void 0:t.getSpaceStore()}(o);if(r){if(r.id!==n.id)return{type:"moveToOtherWorkspace",spaceStore:r,targetParentId:"space-private-pages"!==e.type?e.id:r.id};switch(e.type){case"page":{const t=g.default.state.mainEditorCurrentBlockStore;if(!t)return;return{type:"moveToBlock",blockStore:h.G.createChildStore(t,{table:a.iU,id:e.id})}}case"collection":return{type:"moveToCollection",collectionStore:h.NW.createChildStore(r,{table:s.vF,id:e.id})};case"space":return{type:"moveToCurrentWorkspace"};case"space-private-pages":return{type:"moveToPrivatePages"};case"team":return{type:"moveToTeam",teamStore:h.zX.createChildStore(r,{table:c.e0,id:e.id})};default:(0,u.t1)(e)}}}function F(e){switch(e){case"workspace":return{type:"moveToCurrentWorkspace"};case"bookmarks":return{type:"moveToBookmarks"};case"private":return{type:"moveToPrivatePages"};case"shared":return{type:"moveToShared"};case"team":case i.kg:case i.PT:case i.cz:case i.mu:case i.g$:return;default:(0,u.t1)(e)}}function Z(e){const{droppedDirection:t,targetStore:n,outlinerSectionType:o}=e,{currentSpaceStore:r}=g.default.getState();if(!r||!o)return;let i=n;if("block"===(null==n?void 0:n.table)&&t!==f.vh.Onto){if("bookmarks"===o)return{type:"moveToBookmarks"};if("shared"===o)return{type:"moveToShared"};i=null==n?void 0:n.getParentStore()}if(void 0===i)return;if(r.id===i.id)return F(o);switch(i.table){case"block":return{type:"moveToBlock",blockStore:i};case"team":return{type:"moveToTeam",teamStore:i};case"space":return F(o)}}function U(e){let{environment:t,blocks:n}=e;if(v.n.state)return{canMoveBlocks:!1,reason:{key:"unknown"}};for(const o of n){if(o.getParentTable()===c.e0){const e=(0,S.VP)(o);if(!e||!(0,_.si)({teamStore:e,environment:t}))return{canMoveBlocks:!1,reason:{key:"lockedTopLevelTeamPage"}}}if(!o.canAdmin())return{canMoveBlocks:!1,reason:{key:"needsFullAccess"}};if(!k.KE({environment:t,blockStore:o})){const e=o.getParentStore();return{canMoveBlocks:!1,reason:{key:"needsEditAccessOnParent",parentStore:e instanceof h.G?e:void 0}}}}return{canMoveBlocks:!0}}function V(e){let{environment:t,blocks:n}=e;return U({environment:t,blocks:n}).canMoveBlocks}function N(e){const{type:t}=e,{mainEditorCurrentBlockStore:n,currentSpaceStore:o}=g.default.state;if(!o)throw new Error("currentSpaceStore not found");const r=n||o;if("space"!==t&&e.spaceId&&e.spaceId!==o.id)return h.H2.createChildStore(r,{table:l.bx,id:e.spaceId});switch(t){case"space-private-pages":return h.H2.createChildStore(r,{table:l.bx,id:o.id});case"space":return h.H2.createChildStore(r,{table:l.bx,id:e.id});case"page":return h.G.createChildStore(r,{table:a.iU,id:e.id});case"collection":return h.NW.createChildStore(r,{table:s.vF,id:e.id});case"team":return h.zX.createChildStore(o,{table:c.e0,id:e.id,spaceId:o.id});default:(0,u.t1)(t)}}async function O(){return await p.confirmUserAction({message:(0,T.jsx)("b",{children:(0,T.jsx)(d.FormattedMessage,{id:"moveToHelpers.duplicateToSpaceConfirmTitle",defaultMessage:"Some content and settings may be broken on the duplicated page."})}),description:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{style:{marginBottom:8},children:(0,T.jsx)(d.FormattedMessage,{id:"moveToHelpers.duplicateToSpaceConfirmDescription1",defaultMessage:"This may include: links, relations, permissions, page history, and more."})}),(0,T.jsx)(d.FormattedMessage,{id:"moveToHelpers.duplicateToSpaceConfirmDescription2",defaultMessage:"This page will remain unchanged in the current workspace, and a duplicate version will be created in the workspace you have chosen."}),(0,T.jsx)(m.Z,{title:(0,T.jsx)("div",{children:(0,T.jsx)(d.FormattedMessage,{id:"moveToHelpers.duplicateToSpaceConfirmHelpLink",defaultMessage:"Learn more"})}),href:(0,w.UY)("guides.duplicateToSpace"),analyticsFrom:"move_to_confirm_duplicate_to_space",style:{marginTop:12}})]}),acceptLabel:(0,T.jsx)(d.FormattedMessage,{id:"moveToHelpers.duplicateToSpaceConfirmAcceptLabel",defaultMessage:"I understand, duplicate"})})}function L(e){let{targets:t,destination:n,direction:r,draggingOutlinerType:i}=e;if(r===f.vh.Onto&&t.some((e=>e.id===n.id)))return!0;const a=void 0!==(0,S._A)(n);return!(!t.some((e=>(0,I.A)(e)))||!a)||(!("bookmarks"===i||!function(e){let{targets:t,destination:n,direction:r}=e;const i=t.some((e=>e.isCollectionView()||!e.isType(o.Zi)));if(!i)return!1;if(n.isCollectionView()&&!(0,I.A)(n)){if(r===f.vh.Onto)return!0;if(!n.getRecordStoreUIParent())return!0}const a=n.getAssociatedCollectionStore();if(r!==f.vh.Onto&&a&&!a.isPageTreeCollection())return!0;return!1}({targets:t,destination:n,direction:r}))||!(!n.isLocked()||!n.isPageBlock()))}async function j(e){const t=function(e){const{from:t,environment:n}=e;if("moveTo"===t){const{moveToValue:t}=e.moveToArgs;return E(t)}if("dragAndDrop"===t){const{destination:t,direction:o,destinationOutlinerType:r}=e.dropArgs;return Z({targetStore:t,droppedDirection:o,outlinerSectionType:r,environment:n})}}(e),n=await async function(e){const{blocks:t,environment:n,moveToLocation:o,from:r}=e;if(!o||"moveToOtherWorkspace"===o.type||"moveToBookmarks"===o.type)return{confirmed:!0,shouldClearPagePermissions:!1};const i="moveToPrivatePages"===o.type,a="moveTo"===r?e.moveToArgs.destination:e.dropArgs.destination,s=a&&K({stores:[a],environment:n});if(!i&&!s)return{confirmed:!0,shouldClearPagePermissions:!1};if(!K({stores:t,environment:n})){return await M()?{confirmed:!0,shouldClearPagePermissions:!0}:{confirmed:!1}}if(t.every((e=>e.isTopLevel())))return{confirmed:!0,shouldClearPagePermissions:!1};if(!i)return{confirmed:!0,shouldClearPagePermissions:!1};const l=n.currentUser.id;if(t.some((e=>{const t=e.getPermissionItems();return 0!==t.length&&(1!==t.length||"user_permission"!==t[0].type||t[0].user_id!==l)}))){return await M()?{confirmed:!0,shouldClearPagePermissions:!0}:{confirmed:!1}}return{confirmed:!0,shouldClearPagePermissions:!1}}({...e,moveToLocation:t});if(!n.confirmed)return{confirmed:!1};const o=await async function(e){const{environment:t,moveToLocation:n,from:o,blocks:r}=e;if(!n)return{confirmed:!0,shouldUpdateToManualSort:!1};if("moveTo"===o)return{confirmed:!0,shouldUpdateToManualSort:!1};const i="moveToPrivatePages"===n.type||"moveToShared"===n.type;if(!i)return{confirmed:!0,shouldUpdateToManualSort:!1};const a="moveToPrivatePages"===n.type?"private":"shared";if("private"===a){if(!K({stores:r,environment:t}))return{confirmed:!0,shouldUpdateToManualSort:!1}}const{currentSpaceViewStore:s}=g.default.state;if(!s||"lastEdited"!==(0,_.S4)({spaceViewStore:s,type:a}).sortOption)return{confirmed:!0,shouldUpdateToManualSort:!1};(0,y.j)({environment:t,event:{eventName:"sidebar_manual_sort_modal_open",eventProperties:{outliner_type:a}}});const{accept:l}=await async function(e){return p.confirmUserActionV2({message:(0,T.jsx)(d.FormattedMessage,{defaultMessage:"Would you like to switch to manual sort?",id:"confirmDialog.manualSortForSidebarSection.message"}),description:"private"===e?(0,T.jsx)(d.FormattedMessage,{defaultMessage:"This will discard your previous manual sort in Private.",id:"confirmDialog.manualSortForPrivate.description"}):(0,T.jsx)(d.FormattedMessage,{defaultMessage:"This will discard your previous manual sort in Shared.",id:"confirmDialog.manualSortForShared.description"}),acceptLabel:(0,T.jsx)(d.FormattedMessage,{defaultMessage:"Switch to manual",id:"confirmDialog.manualSortForSidebarSection.confirmButton.label"})})}(a);if(!l)return(0,y.j)({environment:t,event:{eventName:"sidebar_manual_sort_modal_cancel",eventProperties:{outliner_type:a}}}),{confirmed:!1};return(0,y.j)({environment:t,event:{eventName:"sidebar_manual_sort_modal_confirm",eventProperties:{outliner_type:a}}}),{confirmed:!0,shouldUpdateToManualSort:!0}}({...e,moveToLocation:t});if(!o.confirmed)return{confirmed:!1};const{shouldClearPagePermissions:r}=n,{shouldUpdateToManualSort:i}=o;return{confirmed:!0,shouldClearPagePermissions:r,shouldUpdateToManualSort:i}}function K(e){const{stores:t,environment:n}=e,{currentSpaceStore:o}=g.default.state;if(!o)return!1;for(const r of t){const e=(0,S.u3)(r);if(!((null==e?void 0:e.table)===a.iU&&e.isTopLevelPrivatePage({spaceStore:o,environment:n})))return!1}return!0}},344499:(e,t,n)=>{n.d(t,{Hn:()=>g,XQ:()=>p,Xk:()=>u,qB:()=>m});n(757658);var o=n(371663),r=n(541432),i=n(421202),a=n(606287),s=n(155367),l=n(242330),c=n(206258),d=n(175770);function u(e,t){return!(!e.isNavigableBlock()&&e.getType()!==r.Ti.alias)&&(!e.isLinkedCollectionView()&&(!e.getMovedStore().getValue()&&!(0,d.ru)({targets:t,destination:e,direction:s.vh.Onto})))}function p(e){let{recentPageResults:t,blockResults:n,suggestedPages:o}=e;const r=new Set;for(const i of o){const e=i instanceof c.NW?i.getParentId():i.id;e&&r.add(e)}return[...t.filter((e=>!r.has(e.blockId))),...n.filter((e=>!r.has(e.blockId)))]}function m(e){const t=[];for(const o of e){const e=o.getParentPointer();if(e)if(e.table===i.iU)t.push(e.id);else if(e.table===a.vF){var n;const e=null===(n=o.getAssociatedCollectionStore())||void 0===n?void 0:n.getParentPointer();e&&e.table===i.iU&&t.push(e.id)}}return t}function g(){const e=l.ZP.getTargetsDatabaseType();return l.ZP.getVariant()===o.ii&&e&&e!==o.GZ}},268056:(e,t,n)=>{n.d(t,{NV:()=>u,QY:()=>m,TD:()=>g,_v:()=>a,e6:()=>p,iG:()=>c,k_:()=>s,ko:()=>d,qS:()=>l,yt:()=>h});var o=n(401898),r=n(489086);function i(e,t){return e.store===t.store&&e.index===t.index}function a(e,t){return!e&&!t||!(!e||!t)&&(i(e.start,t.start)&&i(e.end,t.end))}function s(e){return{start:{...e.start},end:{...e.end}}}function l(e){return!e||e.start.store===e.end.store}function c(e){return l(e)&&e.start.index===e.end.index}function d(e){return 0===e.start.index&&c(e)}function u(e){return c(e)&&(0,r.J_)(e.start.store,{startIndex:e.start.index,endIndex:e.end.index})}function p(e,t){const n=[e.start.store,e.end.store];return n.includes(t.start.store)||n.includes(t.end.store)}function m(e){if(e)return l(e)?{store:e.start.store,selection:{startIndex:e.start.index,endIndex:e.end.index}}:void 0}function g(e){const{store:t,selection:n}=e;if(t&&n)return{start:{store:t,index:n.startIndex},end:{store:t,index:n.endIndex}}}const f=(0,o.AO)((e=>e&&"object"==typeof e&&"store"in e&&"index"in e?{true:e}:{false:e})),h=(0,o.AO)((e=>{if("object"==typeof e&&e&&"start"in e&&"end"in e){const{start:t,end:n}=e;if(f(t)&&f(n))return{true:e}}return{false:e}}))},745162:(e,t,n)=>{n.d(t,{$r:()=>Z,Aw:()=>V,L5:()=>I,Nj:()=>D,W9:()=>A,Zb:()=>T,fx:()=>E,r:()=>x,ri:()=>N,tp:()=>R,uZ:()=>U,xI:()=>k});n(21703);var o=n(455010),r=n(45060),i=n(541432),a=n(292595),s=n(568626),l=n(873597),c=n(570842),d=n(828685),u=n(905162),p=n(826842),m=n(214976),g=n(146150),f=n(268056),h=n(669645),v=n(273959),y=n(389224),b=n(489086);const _=!1;function S(){if(_){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.warn("multiTextSelectionHelpers:",...t)}}function k(e,t){const n=(0,f.QY)(t);return n||s.rateLimitedLog({from:"multiTextSelectionHelpers",type:"TODO",level:"warning",data:{name:e,message:e}}),n}const w={startIndex:0,endIndex:1/0};function x(e,t){const{start:n,end:r}=e;if((0,f.qS)(e))return n.store===t?"contained-within":void 0;if(n.store===t)return"starts-at";if(r.store===t)return"ends-at";const i=d.E.findNodeFromStore(n.store),a=d.E.findNodeFromStore(r.store),s=d.E.findNodeFromStore(t);return i&&a&&s&&1===(0,o.Z)(s,i)&&-1===(0,o.Z)(s,a)?"covers":void 0}function I(e){const{start:t,end:n}=e,o=(0,f.QY)(e);if(o){const e=d.E.findEditableWithStore(o.store);if(e){return[{editable:e,...o}]}return[]}const r=C(t),i=C(n);if(!r||!i){const e=r||i;if(!e)return[];return[{editable:e.editable,store:e.position.store,selection:{startIndex:e.position.index,endIndex:e.position.index}}]}const a=(0,b.yR)(r.editable).filter((e=>{var t,n,o;return(null===(t=e.contentEditableContext)||void 0===t?void 0:t.id)===(null===(n=r.editable.contentEditableContext)||void 0===n?void 0:n.id)&&(null===(o=e.getNode())||void 0===o?void 0:o.isConnected)})),s=a.findIndex((e=>e.props.store.id===r.editable.props.store.id)),l=a.findIndex((e=>e.props.store.id===i.editable.props.store.id));if(-1===s){throw Object.assign(new Error("Start editable not found in DOM order array"),r)}if(-1===l){throw Object.assign(new Error("End editable not found in DOM order array"),i)}if(!(s<=l))throw new Error(`Start (index ${s}) must be before end (index ${l}) in DOM`);const c=a.slice(s,l+1);return c.map(((e,t)=>{if(0===t){const{position:t}=r;return{editable:e,store:e.props.store,selection:{startIndex:t.index,endIndex:1/0}}}if(t===c.length-1){const{position:t}=i;return{editable:e,store:e.props.store,selection:{startIndex:0,endIndex:t.index}}}return{editable:e,store:e.props.store,selection:w}}))}function C(e){const t=d.E.findEditableWithStore(e.store);if(t)return{editable:t,position:e}}function T(e){var t;const{range:n,contentEditableLeafRegistry:o,allowInvisibleEndSelection:r,constraintToContentEditableRootNode:i,avoidEdgesOfContentEditableRoot:a}=e;if(!n)return;if(i&&i!==(0,g.xp)(n.commonAncestorContainer))return;if(a&&(0,g.Hd)(n.commonAncestorContainer))return void S("not snapping - range is at edge of content editable root");let s,l=!1,c=o.getParentContentEditableLeaf(n.startContainer);c||(s??=o.getByDOMOrder(),c=(0,y.snapContainerOffsetToNode)({nodesInDomOrder:s,containerOffset:{container:n.startContainer,offset:n.startOffset},snapTowards:"end"}),l=!0,S("snapped start",n.startContainer,n.startOffset,"to",c));let d=o.getParentContentEditableLeaf(n.endContainer);if(!d||!r&&d&&0===n.endOffset&&n.endContainer===d.node&&d.node!==(null===(t=c)||void 0===t?void 0:t.node)){s??=o.getByDOMOrder();const e=s.findIndex((e=>{var t;let{node:n}=e;return n===(null===(t=c)||void 0===t?void 0:t.node)})),t=-1!==e?s.slice(e):s,i=d&&!r?t.filter((e=>{var t;let{node:n}=e;return n!==(null===(t=d)||void 0===t?void 0:t.node)})):t;d=(0,y.snapContainerOffsetToNode)({nodesInDomOrder:i,containerOffset:{container:n.endContainer,offset:n.endOffset},snapTowards:"start"}),l=!0,S("snapped end",n.endContainer,n.endOffset,"inside",t,"to",d)}if(!c||!d){const e=c??d;if(!e)return;return{start:e,end:e,forceEmit:!0}}return{start:c,end:d,forceEmit:l}}function M(e){const t=e.getTitleStore();if(t){if(d.E.findNodeFromStore(t))return t}}function P(e){for(const t of e){const e=M(t);if(e&&t.getType()!==i.Ti.code)return{blockStore:t,titleStore:e}}}function A(e){const t=P(e);if(!t)return;const n=function(e){return P([...e].reverse())}(e);if(!n)return;const o=(0,h.dq)({includeNonSelectableListContainer:!1,root:t.blockStore.getHighestContentBlockUIAncestor()});if(!o)return;const r=(0,h.Ib)(n.blockStore,o);if(!r)return;let i;for(const a of(0,l.JK)(r)){const e=a.value.store.getTitleStore();if(e){const t=(0,b.x0)(e);t&&(i={store:e,index:t.endIndex})}}if(!i)return;return{start:{store:t.titleStore,index:0},end:i}}function R(e){var t;const{multiSelection:n,filterCommonAncestors:o,focus:r}=e;if((0,f.qS)(n)){var a;let e=(0,v.sQ)(n.start.store);if((null===(a=e)||void 0===a?void 0:a.getType())===i.Ti.tableRow){var s;const t=null===(s=e.getRecordStoreUIParent())||void 0===s?void 0:s.recordStoreUIParentStore;t&&t instanceof p.G&&(e=t)}if(!e)return;return{stores:[e]}}const c=D({multiSelection:n,includeNonSelectable:!1});if(!c)return;const d=o?(0,l.tL)(c.treeRange):(0,l.bu)(c.treeRange),u=Array.from(d),m=u[0],g=null==m||null===(t=m.value.component)||void 0===t||null===(t=t.contentEditableContext)||void 0===t?void 0:t.id,h=u.filter((e=>{var t;return(null===(t=e.value.component)||void 0===t||null===(t=t.contentEditableContext)||void 0===t?void 0:t.id)===g||e.value.store.getType()===i.Ti.table})).map((e=>e.value.store));return{stores:h,pivot:"end"===r||r===n.end||void 0===r&&!(0,y.selectionIsBackwards)()?h[h.length-1]:h[0]}}function D(e){const{multiSelection:t,includeNonSelectable:n}=e,o=(0,v.sQ)(t.start.store),r=(0,v.sQ)(t.end.store);if(!o||!r)return;const i=o.getHighestContentBlockUIAncestor(),a=(0,h.dq)({includeNonSelectableListContainer:n,root:i});if(!a)return;const s=(0,h.v5)(o,[a]),l=(0,h.v5)(r,[a]);if(!s||!l)return;const d=c.T.fromNearestCommonAncestor(s,l);return d?{tree:a,treeRange:d}:void 0}function B(e){const{leafNode:t,rangeContainer:n,defaultEndIndex:r}=e;S("Range outside of leaf, attempting to recover",t,n);const i=(0,o.Z)(t,n);let a=0;if(-1===i)a=r;else{if(1!==i)throw new Error("Invalid relativeStartPosition. index should not be inside leaf");a=0}return{index:a,forceEmit:!0,afterEndOfLine:!1}}function E(e){var t,n,o,r;const{range:i,contentEditableLeafRegistry:a,allowInvisibleEndSelection:s,avoidEdgesOfContentEditableRoot:l}=e;if(!i)return;let c,u,p=!1;if(a&&a.hasMembers()){const e=T({range:i,contentEditableLeafRegistry:a,allowInvisibleEndSelection:s,constraintToContentEditableRootNode:void 0,avoidEdgesOfContentEditableRoot:l});e&&(c=e.start.node,u=e.end.node,p||=e.forceEmit),S("getMultiTextSelectionFromRange: snapped to leafs",e,i)}else c=(0,g.X1)(i.startContainer),u=(0,g.X1)(i.endContainer),S("getMultiTextSelectionFromRange: found parent leafs",c,u,i);const f=c?d.E.find((e=>{var t;return(null===(t=e.getContentEditableLeaf())||void 0===t?void 0:t.getNode())===c})):void 0,h=u?d.E.find((e=>{var t;return(null===(t=e.getContentEditableLeaf())||void 0===t?void 0:t.getNode())===u})):void 0;if(!f||!h)return void S("getMultiTextSelectionFromRange: missing editable",{startMissing:!f,endMissing:!h});const v=!i.collapsed,y=f.props.store;let _=h.props.store;const{startContainer:k,endContainer:w}=i,x=(null===(t=(n=h.props).getEndSelection)||void 0===t?void 0:t.call(n).endIndex)??0,I=(null===(o=c)||void 0===o?void 0:o.contains(i.startContainer))&&(0,m.Qb)(i.startContainer,i.startOffset)||B({leafNode:c,rangeContainer:k,defaultEndIndex:x});let C=(null===(r=u)||void 0===r?void 0:r.contains(i.endContainer))&&(0,m.Qb)(i.endContainer,i.endOffset)||B({leafNode:u,rangeContainer:w,defaultEndIndex:x});if(v&&C.afterEndOfLine){const e=(0,b.hn)(_);e&&(S("end after EOL",i.endContainer,i.endOffset),_=e,C={index:0,forceEmit:!0,afterEndOfLine:!1})}return{multiSelection:{start:{store:y,index:I.index},end:{store:_,index:C.index}},forceEmit:p||I.forceEmit||C.forceEmit}}function F(e,t){if(!e&&!t)return 0;if(!t)return-1;if(!e)return 1;if(e.store===t.store)return e.index-t.index;const n=d.E.findNodeFromStore(e.store),r=d.E.findNodeFromStore(t.store);return(0,o.Z)(n,r)}function Z(e,t){const[n,o]=[e,t].sort(F);return{start:n,end:o}}function U(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,y.selectionIsBackwards)())?{focus:e.start,anchor:e.end}:{focus:e.end,anchor:e.start}}function V(e){return e.device.isAndroid?(0,u.Y)("supportsAlwaysMultiTextSelectionBehavior")?"always":"gesture":"always"}function N(e){return e.isChrome&&96===parseInt(e.browserVersion,10)}(0,a.exposeDebugValue)("multiTextSelectionToBlockSelection",R),(0,r.Rw)({canFormat:e=>(0,f.yt)(e),header(e){const{table:t,tr:n,td:o,object:i,CONTAINER_STYLE:a}=r.TI,s=d.E.findNodeFromStore(e.start.store),l=d.E.findNodeFromStore(e.end.store);return t(a,n({},o({},"start:"),o({},i(e.start.index)," in"),o({},i(e.start.store)),o({},i(s))),n({},o({},"end:"),o({},i(e.end.index)," in"),o({},i(e.end.store)),o({},i(l))))},hasBody:e=>!1,body:e=>null})},799445:(e,t,n)=>{n.d(t,{A8:()=>y,AM:()=>b,UF:()=>p,bW:()=>u,yk:()=>c,yt:()=>l});n(757658);var o=n(541432),r=n(415095),i=n(421202),a=n(401898),s=n(206258);function l(e){if(0===e)return"a";let t=0,n=0,o="";for(;e>0;)t=(e-1)/26,n=(e-1)%26,e=Math.floor(t),o=String.fromCharCode(97+n)+o;return o}function c(e){let t=0,n=0;const o=e.split("").reverse();for(const r of o){t+=(r.charCodeAt(0)-96)*26**n,n+=1}return t}const d={"m̄":1e6,"d̄":5e5,"c̄":1e5,"l̄":5e4,"x̄":1e4,"v̄":5e3,m:1e3,cm:900,d:500,cd:400,c:100,xc:90,l:50,xl:40,x:10,ix:9,v:5,iv:4,i:1};function u(e){let t="";if(0===e)return"0";for(const n of(0,a.Yd)(d)){const o=Math.floor(e/d[n]);if(o>=0)for(let e=0;e<o;e++)t+=n;e%=d[n]}return t}function p(e){const t=r.p4(e);let n,o,i,a,s=0;for(let r=0;r<t.length;r++){if(n=t[r],o=n?d[n]:void 0,i=t[r+1],a=i?d[i]:void 0,!o)return-1;a&&o<a?s-=o:s+=o}return s}const m=4.44,g={i:3.64,v:8.36,x:8.08,l:3.73,c:8.64,d:9.52,m:13.61,"m̄":13.61,"d̄":9.52,"c̄":8.64,"l̄":3.73,"x̄":8.08,"v̄":8.36};function f(e){const t=r.p4(e);let n=0;for(const o of t)n+=g[o];return n+m}const h=[24],v=14;function y(e){const t=p(e);if(t<=h.length)return h[t-1];let n=h[h.length-1];for(let o=h.length+1;o<=t;o++){const e=f(u(o));e>n&&(n=e+v),h.push(n)}return n}function b(e){const{blockIds:t,parentStore:n}=e,r=[];let a=0;for(;a<t.length;){let e=t[a],l=s.G.createChildStore(n,{table:i.iU,id:e});if(l.getType()===o.Ti.numberedList){const c=[{blockId:e,idx:1}],d=[{id:e,format:void 0,depth:c.length-1,index:c[0].idx}];for(a+=1;a<t.length&&(e=t[a],l=s.G.createChildStore(n,{table:i.iU,id:e}),l.getType()===o.Ti.numberedList);){{const t=l.getParentId();if(l.getParentId()===c[c.length-1].blockId)c.push({blockId:e,idx:1});else{let n=c[c.length-1].idx;for(;c.length>0&&c[c.length-1].blockId!==t;)n=c[c.length-1].idx,c.pop();c.push({blockId:e,idx:n+1})}d.push({id:e,format:void 0,depth:c.length-1,index:c[c.length-1].idx})}a+=1}r.push(d)}else a+=1}return r}},145950:(e,t,n)=>{n.d(t,{Dx:()=>m,Ye:()=>p,ne:()=>g,yY:()=>u});n(21703),n(757658);var o=n(844772),r=n(959753),i=n(145953),a=n(33361),s=n(421202),l=n(653965),c=n(318245),d=n(385555);async function u(e){const{environment:t,recordPointers:n,recurFn:s,recordIsRequired:l}=e,c=i.PF.create();return await a.uf({recordPointers:n,recordMap:c,recurFn:(e,t)=>s(e,t),loadRecordModel:async e=>{const n=t.defaultRecordCache.inMemoryRecordCache.getModelAndRole({pointer:e,userId:t.currentUser.id});if(n)return n;const i=t.defaultRecordCache.persistedRecordCache;if(i&&(0,o.t)(e)){const n=await i.get(e,t.currentUser.id);if(n)return{model:r.kk5.fromValue(e.table,n.value),role:n.role}}if(l(e))throw new Error(`Failed to load a required record: ${e.table}, ${e.id}, ${e.spaceId}.`)}}),c}async function p(e){const{environment:t,abortSignal:n}=e,i=e.environment.currentUser.id;if(e.inMemoryRecordCache)return e.inMemoryRecordCache.getModelAndRole({pointer:e.pointer,userId:i});let a=t.defaultRecordCache.inMemoryRecordCache.getModelAndRole({pointer:e.pointer,userId:i});if(void 0!==a)return a;if(e.useInMemoryCacheOnly)return;if(e.prefetchPromise&&"pending"===e.prefetchPromise.state.status&&(await e.prefetchPromise.wrappedPromise,a=t.defaultRecordCache.inMemoryRecordCache.getModelAndRole({pointer:e.pointer,userId:i}),void 0!==a))return a;const{persistedRecordCache:s}=e.environment.defaultRecordCache;if(s&&(0,o.t)(e.pointer)){const t=await s.get(e.pointer,i);if(null!=n&&n.aborted)throw new Error("Abort signal received");if(t)return{model:r.kk5.fromValue(e.pointer.table,t.value),role:t.role}}}async function m(e){const{parent:t,inMemoryRecordCache:n,environment:o}=e,i=[],a=e.environment.currentUser.id,l=e.environment.defaultRecordCache.persistedRecordCache;if(l&&n===o.defaultRecordCache.inMemoryRecordCache){return(await l.getBlocksWithParent({parent:t,userId:a})).map((e=>({model:r.kk5.fromValue(s.iU,e.value),role:e.role})))}return n.forEachRecord(a,(e=>{let{model:n,role:o}=e;n.table===s.iU&&n.parent_table===t.table&&n.parent_id===t.id&&i.push({model:n,role:o})})),i}async function g(e){const{environment:t,inMemoryRecordCache:n}=e,o=r.kk5.fromCollection(e.collection);if(!o)return[];const i=o.pointer;if(!o.isPageTreeCollection()){const e=c.default.DO_NOT_USE_markLegacy("collections.get_local_pages_in_collection"),o=m({environment:t,parent:i,inMemoryRecordCache:n});return c.default.DO_NOT_USE_measureLegacy(e,{environment:t}),o}const a=o.getRootPagePointer(),p=d.default.checkGate({gateName:"wiki_perf_improvement_local_enabled"}),g=c.default.DO_NOT_USE_markLegacy("collections.get_local_pages_in_collection_wiki"),f=p?await async function(e){const{rootPagePointer:t,environment:n}=e,o=[],r=(e,n)=>e.table!==s.iU?[]:(e.pointer.id===t.id||"page"!==e.type&&"collection_view_page"!==e.type||o.push({model:e,role:n}),e.getContentIds().map((t=>({table:s.iU,id:t,spaceId:e.spaceId}))));return await u({environment:n,recordPointers:[t],recurFn:r,recordIsRequired:()=>!1}),o}({environment:t,rootPagePointer:a}):await async function(e){const{rootPagePointer:t,environment:n,inMemoryRecordCache:o}=e;let r=[t];const i=[];for(;r.length>0;){const e=r.map((e=>m({environment:n,parent:e,inMemoryRecordCache:o}))),t=(await Promise.all(e)).flat();for(const n of t){var a;const e=null==n||null===(a=n.model)||void 0===a?void 0:a.type;"page"!==e&&"collection_view_page"!==e||i.push(n)}r=l.oA(t.map((e=>{var t;return null===(t=e.model)||void 0===t?void 0:t.pointer})))}return i}({environment:t,rootPagePointer:a,inMemoryRecordCache:n});return c.default.DO_NOT_USE_measureLegacy(g,{environment:t,data:{status:p?"v2":"v1"}}),f}},35026:(e,t,n)=>{n.d(t,{B8:()=>J,BY:()=>O,DP:()=>X,EE:()=>E,N:()=>Z,Nb:()=>H,P4:()=>F,Pl:()=>D,Ps:()=>V,Q2:()=>P,S4:()=>z,TM:()=>G,Wu:()=>q,Yz:()=>U,iE:()=>W,jz:()=>L,l6:()=>T,si:()=>B,vs:()=>M});n(757658),n(430541);var o=n(815145),r=n(541432),i=n(253877),a=n(842875),s=n(915157),l=n(269246),c=n(421202),d=n(870279),u=n(429369),p=n(421838),m=n(709291),g=n(653965),f=n(401898),h=(n(95477),n(80444)),v=n(646735),y=n(206258),b=n(313105),_=n(721429),S=n(783105),k=n(433929),w=n(175770),x=n(548779);const I=new Set([r.Ti.page,r.Ti.collectionView,r.Ti.collectionViewPage,r.Ti.alias]),C=new Set([r.Ti.factory]);function T(e){const{allPages:t,state:n,intl:o}=e,{query:r}=n;return t.map((e=>{if(!e.isDefined())return;const t=e.getLastEditedTime()||e.getCreatedTime();if(!t)return;const n=e.getLastEditedByPointer()??e.getCreatedByPointer();return(0,l.fY)({block:e.getModel(),query:r,getRecordModel:e.getRecordModel,userTimeZone:(0,a.r)(),intl:o})?{blockId:e.id,store:e,timestamp:t,authorPointer:n}:void 0})).filter(f.$K)}function M(e){const{pageItems:t}=e;return g.MR(t,(e=>{let{timestamp:t}=e;return t})).reverse()}function P(e){const{rootStore:t}=e,n=e.shouldSkipItemTypes??C,o=e.shouldShowItemTypes??I,r=[],i=new Set,a=[t];for(;a.length>0;){const e=a.shift();if(i.has(e.id))continue;i.add(e.id);const s=R(e,t,n,o);r.push(...s.outlinerItems),a.unshift(...s.subtree)}return r}const A=new b.P({debugName:"getOutlinerItemsStoresInSubtreePageMentions",memoizeRecursion:!1,deepEquals:!1,compute(e){var t;const n=null===(t=e.getTitleStore())||void 0===t?void 0:t.getValue(),o=p.cCA(n);return e.getRecordStoreArray(e,o).filter((t=>t.getParentId()===e.id)).concat(e.getContentStores())}});function R(e,t,n,o){var i;const a=e.getType();if(a&&n.has(a)||(null===(i=e.getModel())||void 0===i||null===(i=i.getAliasTargetPointer())||void 0===i?void 0:i.table)===d.x_)return{outlinerItems:[],subtree:[]};if(a&&e!==t&&o.has(a))return{outlinerItems:[e],subtree:[]};const s=e.getType()===r.Ti.transclusionReference?e.getTransclusionReferenceTargetStore():e;if(!s)return{outlinerItems:[],subtree:[]};return{outlinerItems:[],subtree:A.getStateFor(s)}}function D(e){let{environment:t,draggingStores:n,parentStore:o,currentSpaceStore:r}=e;if(!t.currentUser.id)return!1;if(!n.every((e=>e.isNavigableBlock())))return!1;if(!(0,w.lQ)({environment:t,blocks:n}))return!1;if((null==o?void 0:o.table)===u.e0){return B({environment:t,teamStore:y.zX.createChildStore(r,{table:u.e0,id:o.id,spaceId:r.id})})}return!0}function B(e){let{environment:t,teamStore:n}=e;const o=t.currentUser.id;if(!n.isDefined())return!1;return!(n.getDisableTeamPageEdits()&&o&&!n.isOwner(o))&&n.canAddOrRemoveTopLevelPages()}function E(e){let{typeWithTeam:t,currentSpaceViewStore:n,sidebarState:o}=e;switch(t.type){case"team":return t.teamStore.getTeamPagesStores();case"bookmarks":return n.getBookmarkedPages();case"workspace":return n.getWorkspacePages();case"shared":return o.visibleSharedPagesStores;case"private":return o.visiblePrivatePagesStores;default:(0,f.t1)(t)}}function F(e){let{typeWithTeam:t,currentSpaceStore:n,currentSpaceViewStore:o}=e;switch(t.type){case"team":return t.teamStore.getTeamPagesStore();case"bookmarks":return o.getBookmarkedPagesStore();case"workspace":return n.getPagesStore();case"shared":return o.getSharedPagesStore();case"private":return o.getPrivatePagesStore();default:(0,f.t1)(t)}}function Z(e){let{type:t,from:n}=e;switch(t){case"bookmarks":return o.tY.SidebarBookmark;case"workspace":return o.tY.SidebarWorkspace;case"shared":return"main_sidebar"===n?o.tY.SidebarShared:o.tY.SidebarSharedPane;case"private":return"main_sidebar"===n?o.tY.SidebarPrivate:o.tY.SidebarPrivatePane;case"team":return o.tY.SidebarTeam;case"teamSidebar":case"teamBrowserSearch":case"teamBrowserUnjoinedTeams":case"teamBrowserJoinedTeams":return o.tY.SidebarTeamBrowser;case l.g$:return o.tY.SidebarPublicPageTemplateIncludes;default:(0,f.t1)(t)}}function U(e){return P({rootStore:y.G.createChildStore(e,{table:c.iU,id:e.id}),shouldSkipItemTypes:C,shouldShowItemTypes:I})}function V(e){const{store:t,toOpen:n,environment:o,isTopLevelItem:r}=e;r&&s.Z.set({userId:o.currentUser.id,key:`Outliner-${t.id}`,value:n})}const N=(0,m.defineMessages)({updatedToday:{id:"sharedWithMePopover.updatedTodaySection.label",defaultMessage:"Updated today"},today:{id:"sharedWithMePopover.todaySection.label",defaultMessage:"Today"},updatedPastWeek:{id:"sharedWithMePopover.updatedPastWeekSection.label",defaultMessage:"Updated in the past week"},pastWeek:{id:"sharedWithMePopover.pastWeekSection.label",defaultMessage:"Past week"},updatedEarlier:{id:"sharedWithMePopover.updatedEarlierSection.label",defaultMessage:"Updated earlier"},earlier:{id:"sharedWithMePopover.earlierSection.label",defaultMessage:"Earlier"}});function O(e){const{section:t,isFirst:n}=e;switch(t){case"today":return n?k.default.formatMessage(N.updatedToday):k.default.formatMessage(N.today);case"past-week":return n?k.default.formatMessage(N.updatedPastWeek):k.default.formatMessage(N.pastWeek);case"earlier":return n?k.default.formatMessage(N.updatedEarlier):k.default.formatMessage(N.earlier);case"all":return;default:throw(0,f.t1)(t)}}function L(e){const t="today",n="past-week",o="earlier",r=(0,i.Uu)((0,a.r)()),s=r.valueOf(),l=r.minus({week:1}).valueOf(),c=g.vM(e,(e=>{let{timestamp:r}=e;return r>s?t:r>l?n:o}));let d=-1;return g.oA([t,n,o].map((e=>{const t=c[e];if(t&&0!==t.length)return{key:e,pages:t.map((e=>(d+=1,{...e,index:d})))}})))}const j=new Date("May 16 2024 08:00:00 GMT+0000").getTime();function K(){var e;const{currentUserSettingsStore:t,currentSpaceStore:n}=h.default.state;if(!n)return!0;const o=null==t||null===(e=t.getSettings())||void 0===e?void 0:e.signup_time,r=null==n?void 0:n.getCreatedTime();return(0,f.$K)(o)&&o>j||(0,f.$K)(r)&&r>j}function z(e){const{spaceViewStore:t,type:n}=e,{currentUserSettingsStore:o}=h.default.state,r=t.getSpaceStore(),i=((null==r?void 0:r.getMemberCountFromPublicSpaceData())||0)<=1?10:5,a=r&&(null==o?void 0:o.hasUserPinnedToOutliner({spaceId:r.id,type:"shared"})),s={sortOption:{private:K()?"lastEdited":"manual",shared:a?"manual":"lastEdited"},truncationLimit:{private:i,shared:i,teamspaces:i}},l=g.TS(g.Xh(s),null==t?void 0:t.getSidebarSectionMenuConfig());return{sortOption:l.sortOption[n]??"manual",truncationLimit:l.truncationLimit[n]??5}}function q(e){const{spaceViewStore:t}=e;return"lastEdited"===z({spaceViewStore:t,type:"private"}).sortOption}function H(e){let t,{environment:n,store:o,type:r}=e;switch(r){case"bookmarks":t=S.vu.Favorite;break;case"team":case"workspace":case"shared":case"private":t=S.vu.Link;break;default:(0,f.t1)(r)}v.Z.recordVisit({id:o.id,systemBlockType:o.getSystemBlockTypeStore().getValue(),type:t,currentUserId:n.currentUser.id})}const G={bookmarks:"favorites",team:"teamspaces",workspace:"workspace",shared:"shared",private:"private",teamSidebar:void 0,teamBrowserSearch:void 0,teamBrowserUnjoinedTeams:void 0,teamBrowserJoinedTeams:void 0,publicPageTemplateIncludes:void 0},W={favorites:"bookmarks",teamspaces:"team",workspace:"workspace",shared:"shared",private:"private"},$=["favorites","workspace","teamspaces","shared","private"],Y=["favorites","private","teamspaces","shared"],Q=["favorites","teamspaces","shared","private"];function J(){const{currentSpaceStore:e,currentSpaceViewStore:t}=h.default.state,n=K(),o=(0,_.R3)({isGuest:(0,x.Cx)(e),numWorkspacePages:(null==t?void 0:t.getWorkspacePages().length)||0})?$:n?Y:Q;if(!t)return o;const r=t.getSidebarOrder(),i=g.jj(r);if(r.length<4)return o;if(i.length<4){return[...o.filter((e=>!i.includes(e))),...i]}return i}function X(e){let{sidebarOrder:t,sidebarState:n}=e;if(!n)return t;return t.filter((e=>{switch(e){case"workspace":return n.showWorkspaceSection;case"favorites":return n.showBookmarksSection;case"private":return n.showPrivateSection;case"shared":return n.showSharedSection;case"teamspaces":return n.showTeamSection;default:(0,f.t1)(e)}}))}},950659:(e,t,n)=>{n.d(t,{G$:()=>a,MF:()=>s,PP:()=>r,Z3:()=>i});const o=4,r="150ms ease";function i(){return{borderRadius:6}}function a(e){let{isMobile:t}=e;return t?{}:{borderRadius:6,display:"flex",marginLeft:0,marginRight:0,transition:`background ${r}`}}function s(){return{paddingLeft:12-o,paddingRight:12-o}}},38689:(e,t,n)=>{n.d(t,{z:()=>o});const o=900},450627:(e,t,n)=>{n.d(t,{CX:()=>_,OZ:()=>x,Ow:()=>b,RH:()=>I,Wt:()=>y,a_:()=>v,di:()=>M,du:()=>k,kC:()=>S,mO:()=>w,uU:()=>T,y6:()=>h,yp:()=>C,zL:()=>f});n(757658);var o=n(541432),r=n(406695),i=n(295519),a=n(606287),s=n(785957),l=n(177546),c=n(282136),d=n(188923),u=n(206258),p=n(721429),m=n(292283),g=n(798165);const f=900;function h(e){const t=e.getAssociatedCollectionStore();if(!t)return;const n=e.getSchema(),o=t.getFormat();return(0,i.i)(o,n,void 0,r.j5.Collection)}function v(e){if(e.isCollectionView()){const t=e.getCollectionViewSourceCollectionStore();return!!t&&t.isSyncedCollection()}return e.isType(o.Ti.externalObjectInstancePage)}function y(e){if(!(0,m.K6)())return!1;const t=e.getParentStore();if((null==t?void 0:t.table)===a.vF){const e=t.getFormat();return!(null==e||!e.external_collection_type)}return!1}function b(e){if(!(0,m.K6)())return!1;const t=g.uJ(e),n=[];t.forEach((e=>{e instanceof u.zX||n.push(e)}));const o=n.find((e=>y(e)));return Boolean(o)}function _(e){return!e.hasContent()&&(!e.isCollectionView()||e.isType("collection_view_page")&&e.isCollectionViewPageWithContent())}function S(e,t){const n={width:"100%",display:"flex",flexDirection:"column",alignItems:"center",flexShrink:0,flexGrow:0};return e.isCollectionView()&&(e.isNonEditableState()&&(n.cursor="default"),l.eA(t)&&(n.position="sticky",n.left=0)),n}function k(e,t,n){return w(e,t,n)?"100%":f}function w(e,t,n){if(t===c.S.CollectionPageView)return!0;const{device:o}=n,{isPhone:r}=o,i=e.isFullWidth(),a=e.isCollectionView(),s=x(t);return i&&!r||a||s||r}function x(e){return e===c.S.PeekView}function I(e,t){if(e===c.S.PeekView){const e=d.default.getPeekMode();return d.PeekModePadding.horizontal[e]}return(0,p.ui)(t)}function C(e){return(0,s.wq)(e)&&(d.default.isSidePeekOpen()||d.default.isSidePeekClosingStore.state)}function T(e,t){return t.device.isMobile?16:x(e)||e===c.S.Form?32:80}function M(e){return e.device.isMobile?12:4}},778873:(e,t,n)=>{n.d(t,{E:()=>s,c:()=>l});var o=n(21359),r=n(397799),i=n(369503),a=n(992083);function s(e){const{environment:t,onSubmit:n,onCancel:o}=e;t.device.isMobile?r.Z.setState({open:!0}):a.Z.setState({open:!0,openedFrom:"login",currentTab:"profile",defaultSubtab:void 0,highlightedSetting:void 0}),i.Z.setState({open:!0,setNewPassword:!0,password:"",repeatPassword:"",isSet:!1,onSubmit:n,onCancel:o})}async function l(e){const{environment:t,userEmail:n}=e,r=await o.getLoginOptions(t,{email:n});if("failed"===r.type)return{error:r.error};const i=r.data;return{value:{isSamlEnforced:"required"===i.samlSignIn,didLogInWithSaml:"available"===i.samlSignIn&&i.hasAccount&&"saml"===i.lastLoginMethod,hasPassword:"required"!==i.samlSignIn&&i.hasAccount&&i.passwordSignIn}}}},798165:(e,t,n)=>{n.d(t,{AT:()=>P,D0:()=>Q,Dg:()=>V,Eb:()=>B,KU:()=>K,Om:()=>F,Pj:()=>L,RC:()=>X,VP:()=>j,YV:()=>H,_A:()=>z,e3:()=>$,fJ:()=>D,fM:()=>N,fl:()=>q,n3:()=>Y,nR:()=>G,oZ:()=>J,qA:()=>R,s:()=>E,u3:()=>O,uJ:()=>Z,wf:()=>U,yI:()=>W});n(757658);var o=n(541432),r=n(463306),i=n(772141),a=n(673360),s=n(74446),l=n(145953),c=n(600606),d=n(798963),u=n(718844),p=n(421202),m=n(606287),g=n(213493),f=n(870279),h=n(933709),v=n(611318),y=n(91644),b=n(475246),_=n(429369),S=n(653965),k=n(401898),w=n(80444),x=n(206258),I=n(313105),C=n(165598);function T(e,t){const{table:n,id:o,spaceId:r}=t,i=r||e.pointer.spaceId;if(n===m.vF)return x.NW.createChildStore(e,{table:m.vF,id:o});if(n===b.bx)return x.H2.createChildStore(e,{table:b.bx,id:o});if(n===p.iU)return x.G.createChildStore(e,{table:p.iU,id:o});if(n===g.np)return x.Xr.createChildStore(e,{table:g.np,id:o,spaceId:i});if(n===f.x_){if(i)return x.T5.createChildStore(e,{table:f.x_,id:o,spaceId:i})}else if(n===h.qF){if(i)return x.jQ.createChildStore(e,{table:h.qF,id:o,spaceId:i})}else if(n===_.e0){if(i)return x.zX.createChildStore(e,{table:_.e0,id:o,spaceId:i})}else if(n===u.Xj){if(i)return x.zq.createChildStore(e,{table:u.Xj,id:o,spaceId:i})}else if(n===d.cv&&i)return x.Mz.createChildStore(e,{table:d.cv,id:o,spaceId:i})}function M(e){const t=w.default.state.mainEditorCurrentBlockStore;return t?t.inMemoryRecordCache!==e.inMemoryRecordCache?e:t:e}function P(e){const t=M(e);return((n=e)instanceof x.G||n instanceof x.H2||n instanceof x.NW||n instanceof x.T5||n instanceof x.jQ||n instanceof x.zX||n instanceof x.zq||n instanceof x.Mz)&&e.getRecordStoreUIParent()===t?e:T(t,e.pointer);var n}const A=new I.P({debugName:"getPathStores",memoizeRecursion:!0,deepEquals:!1,compute:function(e,t){const n=e.getValue();if(!n||!(0,a.oK)(n))return[e];const o=c.dr.getParentPointerFromRecordWithParent(n),r=T(M(e),o);return r?[e].concat(t(r)):[e]}});function R(e){const t=P(e);return t?A.getStateFor(t):[]}function D(e){return S.oA(R(e).map((e=>{if("space"===e.table){if(!(0,C.Mm)(e))return;return e.getModel()}if("block"===e.table){const{pointer:t}=e,n=(0,x.Vh)(e,t,"alive").getValue(),o=(0,x.Vh)(e,t,"parent_id").getValue(),r=(0,x.Vh)(e,t,"type").getValue();if(void 0!==n&&void 0!==o&&void 0!==r)return e.getModel()}else if(e.table===_.e0){const{pointer:t}=e;if(!(0,x.Vh)(e,t,"settings").getValue())return;return e.getModel()}})))}function B(e){const{store:t,teamPermissionItems:n}=e,o=l.Ak.create(),r=L(t)||w.default.state.currentSpaceStore;return r&&n.forEach((e=>{const t=x.zX.createChildStore(r,{table:_.e0,id:e.team_id,spaceId:r.id});o.setModel({id:t.id,table:_.e0,spaceId:r.id},t.getModel())})),o}async function E(e){const t=[];return await r.ne(e.pointer,s.zF.fromMonomorphicFunctionUnsafe((async n=>{let o;if(n.table===m.vF?o=x.NW.createChildStore(e,n):n.table===b.bx?o=x.H2.createChildStore(e,n):n.table===p.iU?o=x.G.createChildStore(e,n):n.table===g.np?o=x.Xr.createChildStore(e,n):n.table===f.x_?o=x.T5.createChildStore(e,n):n.table===h.qF&&(o=x.jQ.createChildStore(e,n)),o)return t.push(o),await o.load(),o.getValue()}))),t}function F(e){const t=x.t1.fromV1(e);if(t instanceof x.G||t instanceof x.NW){const e=t.getParentTable(),n=t.getParentId();if(e&&n){if(e===m.vF)return x.NW.createChildStore(t,{table:m.vF,id:n});if(e===b.bx)return x.H2.createChildStore(t,{table:b.bx,id:n});if(e===p.iU)return x.G.createChildStore(t,{table:p.iU,id:n});if(e===f.x_)return x.T5.createChildStore(t,{table:f.x_,id:n,spaceId:t.getSpaceId()});if(e===_.e0)return x.zX.createChildStore(t,{table:_.e0,id:n});if(e===u.Xj)return x.zq.createChildStore(t,{table:u.Xj,id:n,spaceId:t.getSpaceId()});if(e===y.AT)return x.Vf.createChildStore(t,{table:y.AT,id:n,spaceId:t.getSpaceId()});if(e===g.np)return x.Xr.createChildStore(t,{table:g.np,id:n,spaceId:t.getSpaceId()});if(e===v.Bh)return x.xj.createChildStore(t,{table:v.Bh,id:n,spaceId:t.getSpaceId()});(0,k.t1)(e)}}}function Z(e){return R(e).filter((e=>{if(!e.canRead())return!1;if(e instanceof x.G){const t=e.getType();return t&&(0,o.S9)(t)}return e instanceof x.zX}))}function U(e){const t=R(e).find((e=>{let t;return(e instanceof x.G||e instanceof x.NW)&&(t=e.getAlive()),!1===t}));return Boolean(t)}function V(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=Z(e)[t];return n instanceof x.zX?V(n,t+1):n}function N(e){return e.findRecordStoreUIAncestor((e=>e instanceof x.G&&(0,o.S9)(e.getType()))).ancestor}function O(e){const t=Z(e);return t[t.length-1]}function L(e){return R(e).find((e=>e.table===b.bx))}function j(e){const t=R(e);return t.find((e=>e.table===_.e0))}function K(e){return e.find((e=>e.table===_.e0))}function z(e){return R(e).find((e=>{var t;return e.table===p.iU&&(null===(t=e.getCollectionStore())||void 0===t?void 0:t.isPageTreeCollection())}))}function q(e){for(const t of e)if((t instanceof x.G||t instanceof x.NW)&&(!t.isDefined()||!t.getAlive()))return!1;return!0}function H(e){for(const t of e)if(t instanceof x.G||t instanceof x.NW){if(!t.isDefined())continue;if(!t.getAlive())return t}}function G(e){for(const t of e)if(t instanceof x.G){if(!t.isDefined())continue;if(t.getPermissionItems().some(i.gG))return t}}function W(e){return Boolean(H(e))}function $(e){for(const t of e)if(t instanceof x.G){if(!t.isDefined())continue;const e=t.getMovedStore().getValue();if(void 0!==e)return{store:t,moved:e}}}function Y(e){return"block"===e.table||"space"===e.table||"collection"===e.table||"comment"===e.table||"discussion"===e.table}function Q(e){const t=R(e).find((e=>{if(e.table===_.e0)return Boolean(e.getArchivedBy())}));return Boolean(t)}function J(e){const t=R(e);for(const n of t)if(n.table===b.bx)return n.getSettings().space_request}function X(e){const{environment:t,store:n}=e,o=t.currentUser.id;if(!o)return!1;const r=R(n),a=r.every((e=>Boolean(e.isReady())));if(!a)return;const s=!r.some((e=>Boolean(e instanceof x.G&&!e.isDefined())));if(!s)return!1;const l=r.some((e=>{if(e instanceof x.G){const t=(e.getPermissionItemsStore().getValue()||[]).find((e=>(0,i.$D)(e)||(0,i.hV)(e)||(0,i.Ir)(e)||(0,i.RI)(e)||(0,i.ZQ)(e)||(0,i.jg)(e)&&e.user_id!==o));return Boolean(t)}return e instanceof x.zX}));return!l}},105749:(e,t,n)=>{n.d(t,{n:()=>r});var o=n(385555);function r(){return"on"===o.default.getEligibleGroup({experimentId:"pdf_importer",defaultGroup:"control"})}},785957:(e,t,n)=>{n.d(t,{Tx:()=>i,mH:()=>a,my:()=>l,wq:()=>s});n(224646),n(304926);var o=n(188923),r=n(27724);function i(){return o.default.isCenterPeekOpen()||r.default.isInPeekRenderer()}function a(){const e=o.default.state;return e.open&&(i()||e.isOpening)}function s(e){return Boolean(e.findRecordStoreUIAncestor((e=>e===o.default.peekTargetStore.state)).ancestor)}function l(){const e=window.innerWidth;return e>2*o.SIDEPEEK_MIN_WIDTH?e*(2/3):e}},367669:(e,t,n)=>{n.d(t,{Aw:()=>de,BZ:()=>Q,Dt:()=>ne,EY:()=>ce,IJ:()=>V,JI:()=>z,KE:()=>J,Oc:()=>j,RL:()=>re,S4:()=>L,SO:()=>W,U7:()=>X,UK:()=>K,WE:()=>ie,Xu:()=>H,YF:()=>Y,YO:()=>U,Z9:()=>G,mU:()=>ee,r_:()=>$,rc:()=>te,uY:()=>ae,yi:()=>q,zT:()=>le});n(867635),n(757658);var o=n(39593),r=n.n(o),i=n(14577),a=n(568626),s=n(959753),l=n(463306),c=n(834687),d=n(186517),u=n(772141),p=n(145953),m=n(291627),g=n(421202),f=n(475246),h=n(665635),v=n(947969),y=n(429369),b=n(519889),_=n(653965),S=n(307032),k=n(401898),w=n(619584),x=n(883165),I=n(918402),C=n(80444),T=n(655899),M=n(896026),P=n(206258),A=n(88893),R=n(535057),D=n(288280),B=n(721429),E=n(798165),F=n(165598),Z=n(548779);function U(e){const t=E.fJ(e),n=d.KJ(t);return d.YO(n)}function V(e,t){if(e.defaultRecordCache.inMemoryRecordCache!==t.inMemoryRecordCache)return O(e,t);const n=`${e.currentUser.id}:${t.table}:${t.id}`,o=N.get(n);if(o)return o.state;const r=new i.ZP((()=>O(e,t)),{debugName:`userHasPermissionViaPublicAccess:${t.id}`});return N.set(n,r),r.state}const N=new(r())({max:30,maxAge:w.hM,updateAgeOnGet:!0});function O(e,t){const{id:n}=e.currentUser;if((0,Z.C)()&&(0,Z.Fn)(e))return;let o;n&&(o={table:b.KJ,id:n});const r=(0,E.AT)(t)||t,i=(0,I.bi)({recordPointers:new m.X([t.pointer]),actorPointers:new m.X(void 0===o?[]:[o]),getRecordModel:r.getRecordModel}),{currentUserStore:a}=C.default.state;return(0,I.r$)({actor:null==a?void 0:a.getModel(),recordPointer:t.pointer,permissionsContext:i})}function L(e){return U(e).map((e=>{let{permissionItem:t}=e;return t})).some((e=>u.$D(e)&&u.YX(e.role)&&(void 0===e.allow_duplicate||!0===e.allow_duplicate)))}function j(e){return U(e).map((e=>{let{permissionItem:t}=e;return t})).some((e=>u.$D(e)))}function K(e){return U(e).map((e=>{let{permissionItem:t}=e;return t})).some((e=>u.Ir(e)))}async function z(e){const{currentUserRootStore:t}=C.default.state;if(!t)return!1;if(!(0,S.e)(e))return!1;const n=P.G.createChildStore(t,{table:g.iU,id:e});return await n.load(),j(n)}function q(e,t){const n=U(t);if(1===n.length){const t=n[0].permissionItem;return"user_permission"===t.type&&u.zz(t.role)&&t.user_id===e.currentUser.id}return!1}function H(e){const{subscriptionData:t,newGuestIds:n}=e;if(!t)return!1;const o=(0,R.c4)(t);if(void 0===o)return!1;const r=A.ND(t).map((e=>e.userId)),i=A.hn(t).map((e=>e.userId)),a=new Set([...r,...n]);for(const l of i)a.delete(l);const s=Math.max(o,r.length);return a.size>s}function G(e){if(!e)return!1;const t=(0,R.c4)(e);if(void 0===t)return!0;return A.ND(e).map((e=>e.userId)).length<t}function W(e){const{store:t,permissionItems:n}=e;if(t instanceof P.H2)return!1;const o=D.subscriptionDataStoreInstance.state;if(!o)return!1;return H({subscriptionData:o,newGuestIds:n.filter(u.jg).filter((e=>"none"!==e.role)).map((e=>e.user_id))})}function $(e){return{editor:"Full access",read_and_write:"Can edit",comment_only:"Can comment",reader:"Can read",none:"No access"}[e]}function Y(e){return!!e&&(e.hasPublicPermission&&"edit"!==e.permission)}function Q(e){return!!e&&(e.hasPublicPermission&&"view"===e.permission)}function J(e){let{environment:t,blockStore:n}=e;const o=n.getParentStore();if(!o)return!1;return!Y(E.n3(o)&&M.Z.getMode(t,o))&&o.canEdit()}function X(){const{currentSpaceStore:e}=C.default.state;return"enterprise"===(null==e?void 0:e.getSubscriptionTier())}async function ee(e,t){const n=new Set;var o;if((0,F.Y)(e))null===(o=e.getPermissionItems())||void 0===o||o.forEach((e=>{u.jg(e)&&n.add(e.user_id)}));else if(e instanceof P.G)e.getPermissionItems().forEach((e=>{u.jg(e)&&n.add(e.user_id)}));else if(e instanceof P.H2){const o=t.filter(T.fZ).map((t=>(0,x.VK)(e,t.value.id)));for(const e of o)await e.load(),e.isDefined()&&e.isMember()&&n.add(e.getUserId())}else(0,k.t1)(e);return t.filter((e=>"existingUser"!==e.type||!n.has(e.value.id)))}function te(e){const t=(0,B.np)();if(!t||!e)return;const n=ne({userId:e,store:t}).role;return n&&!d.oF(n)?n:void 0}function ne(e){let{userId:t,store:n}=e;return ie({userId:t,store:n})[0]}function oe(e){const{explicitTeamsRecordMap:t,actorPointers:n,getRecordModelFnFallback:o,logErrorFn:r}=e,i=e.ancestorsRecordMap?e.ancestorsRecordMap:p.Ak.create(),l=s.omK.fromRecordMap(i),d=s.omK.fromRecordMap(t),u=s.omK.tryUntilFound(l,d,o),g=new m.X(n),f=(0,c.GK)({recordMap:i,getRecordModelFnWithMaybeMissingRecords:u,actorPointers:g,logErrorFn:r??(e=>{const{from:t,type:n,error:o,data:r}=e;a.log({level:"error",from:t,type:n,error:{name:o.name,message:o.message,stack:o.stack},data:{miscDataToConvertToString:r}})})});return{ancestorsRecordMap:i,explicitTeamsRecordMap:t,actorPointersSet:g,actorMemberships:f,spacesForSpaceMemberComputation:re({ancestorsRecordMap:i,getRecordModel:u})}}function re(e){const{ancestorsRecordMap:t,getRecordModel:n}=e,o=new Set;for(const{pointer:a}of t)if(a.table===v.WU){const{spaceId:e}=(0,v.KQ)(a.id);o.add(e)}else if(a.table===h.Zx){const{spaceId:e}=(0,h.td)(a.id);o.add(e)}for(const a of o){const e={table:f.bx,id:a};t.has(e)&&o.delete(a)}if(o.size<=0)return;const r=Array.from(o),i=p.Ak.create();return r.forEach((e=>{const t={table:f.bx,id:e},o=n(t);o&&i.addModel(o)})),i}function ie(e){let{userId:t,store:n}=e;const o=l.DW(n.pointer,n.getRecordModel),r=E.Pj(n)||C.default.state.currentSpaceStore,i=r&&r.isDefined()&&!o.findLast(d.zX)?[...o,r.getModel()]:o,a=p.Ak.create();i.forEach((e=>{a.setModel(e.pointer,e)}));const s=U(n),c=E.VP(n),m=s.filter((e=>{let{permissionItem:t}=e;return(u.zU(t)||u.LW(t))&&t.team_id!==(null==c?void 0:c.id)})).map((e=>e.permissionItem)),g=E.Eb({store:n,teamPermissionItems:m}),f={table:b.KJ,id:t},h=oe({actorPointers:[f],explicitTeamsRecordMap:g,ancestorsRecordMap:a,getRecordModelFnFallback:n.getRecordModel}),v=d.qY({actorPointer:f,ancestors:i,permissionsContext:h}).map((e=>e.permissionItem));if(0===v.length)return[{type:"user_permission",role:"none",user_id:t}];const y=_.oA(v.map((e=>e.role))),S=d.nl(...y);return v.filter((e=>e.role===S)).sort(se)}function ae(e){let{userId:t,store:n}=e;const o=l.DW(n.pointer,n.getRecordModel),r=E.Pj(n)||C.default.state.currentSpaceStore,i=r&&r.isDefined()&&!o.findLast(d.zX)?[...o,r.getModel()]:o,a=p.Ak.create();i.forEach((e=>{a.setModel(e.pointer,e)}));const s=U(n),c=E.VP(n),m=s.filter((e=>{let{permissionItem:t}=e;return(u.zU(t)||u.LW(t))&&t.team_id!==(null==c?void 0:c.id)})).map((e=>e.permissionItem)),f=E.Eb({store:n,teamPermissionItems:m}),h={table:b.KJ,id:t},v=oe({actorPointers:[h],explicitTeamsRecordMap:f,ancestorsRecordMap:a,getRecordModelFnFallback:n.getRecordModel}),_=d.qY({actorPointer:h,ancestors:i,permissionsContext:v}),S=[..._];_.find((e=>"user_permission"===e.permissionItem.type))||S.push({permissionItem:{type:"user_permission",role:"none",user_id:t},from:{table:g.iU,blockId:n.id}});const k=D.subscriptionDataStoreInstance.state,w=new Set(k?A.ND(k).map((e=>e.userId)):[]);if(null!=w&&w.has(t))return S.sort(((e,t)=>se(e.permissionItem,t.permissionItem))).reverse().sort(((e,t)=>u.xm[t.permissionItem.role??"none"]-u.xm[e.permissionItem.role??"none"]));!_.find((e=>"explicit_team_permission"===e.permissionItem.type&&e.permissionItem.team_id===(null==c?void 0:c.id)))&&c&&c.isNonGuestMember(t)&&S.push({permissionItem:{type:"explicit_team_permission",role:"none",team_id:c.id},from:{table:y.e0,teamId:c.id}});!_.find((e=>"explicit_team_owner_permission"===e.permissionItem.type&&e.permissionItem.team_id===(null==c?void 0:c.id)))&&c&&c.isOwner(t)&&S.push({permissionItem:{type:"explicit_team_owner_permission",role:"none",team_id:c.id},from:{table:y.e0,teamId:c.id}});return _.find((e=>"space_permission"===e.permissionItem.type))||S.push({permissionItem:{type:"space_permission",role:"none"},from:{table:g.iU,blockId:n.id}}),S.sort(((e,t)=>se(e.permissionItem,t.permissionItem))).reverse().sort(((e,t)=>u.xm[t.permissionItem.role??"none"]-u.xm[e.permissionItem.role??"none"]))}function se(e,t){const n=u.jg(e),o=u.jg(t);if(n||o)return n&&o?0:n?-1:1;const r=u.hV(e),i=u.hV(t);if(r||i)return r&&i?0:r?-1:1;const a=u.Lq(e),s=u.Lq(t);return a||s?a&&s?0:a?-1:1:0}function le(e){const{botStore:t,addPermission:n}=e,o=n?d.uH(t.getCapabilities()):"none",r=t.getParentId(),i=t.getParentTable();let a={type:"bot_permission",bot_id:t.id,role:o};return r&&i&&(a={type:"bot_permission",bot_id:t.id,role:o,parent_id:r,parent_table:i}),a}function ce(e){const t=e.getParentBlockStore();return!t||t.pathIsDead()}function de(e){const t=e.getParentBlockStore();return(null==t?void 0:t.isLocked())??!0}},75472:(e,t,n)=>{n.d(t,{Aw:()=>T,Bu:()=>R,DF:()=>D,Ji:()=>O,NN:()=>A,Nd:()=>M,OA:()=>U,ZK:()=>N,Zp:()=>B,a_:()=>Z,cm:()=>P,fR:()=>K,gQ:()=>L,t0:()=>j,xT:()=>F,z5:()=>E});n(757658),n(667294);var o=n(715070),r=n(471924),i=n(772141),a=n(421202),s=n(475246),l=n(307928),c=n(709291),d=n(531701),u=n(401898),p=n(137810),m=n(891219),g=n(547307),f=n(883165),h=n(80444),v=n(429677),y=n(206258),b=n(88893),_=n(535057),S=n(288280),k=n(721429),w=n(433929),x=n(165598),I=n(516639),C=n(785893);async function T(e){let{environment:t,permissionsInviteStoreState:n,from:o}=e;const r=(0,C.jsx)(c.FormattedMessage,{id:"permissionsInvite.closeInviteDialog.confirmationMessage",defaultMessage:"Your changes have not been saved. Discard changes?"}),i=(0,C.jsx)(c.FormattedMessage,{id:"permissionsInvite.closeInviteDialog.confirmationButton.label",defaultMessage:"Yes"}),a=(0,C.jsx)(c.FormattedMessage,{id:"permissionsInvite.closeInviteDialog.cancelButton.label",defaultMessage:"Cancel"});if(n.inviteTargets.length>0){const e=await g.confirmUserAction({message:r,acceptLabel:i,cancelLabel:a});return m.q_(t,{...Z(t,n),from:o,discard_changes:e}),!e}return!1}function M(e){const{target:t,permissionsInviteStore:n}=e;return n.state.inviteTargets.find((e=>"newUser"===t.type?"newUser"===e.type&&t.value.email===e.value.email:e.type===t.type&&e.value.id===t.value.id))}function P(e){const{targetStore:t,permissionsInviteStore:n,userTarget:o}=e;return!!M({permissionsInviteStore:n,target:o})||"existingUser"===o.type&&B({target:o,store:t})}function A(e){const{targetStore:t,permissionsInviteStore:n,currentInviteActors:r}=e;if(!r)return{inviteUsers:[],inviteGroups:[],inviteBots:[]};if((0,x.R$)(t))return r;const i=r.inviteUsers.filter((e=>!P({targetStore:t,permissionsInviteStore:n,userTarget:e})));return{inviteBots:r.inviteBots.filter((e=>!(!e.value.alive||M({permissionsInviteStore:n,target:e})||!(0,o.oA)(e.value)&&!(0,o.c9)(e.value))&&!B({target:e,store:t}))),inviteGroups:r.inviteGroups.filter((e=>!M({permissionsInviteStore:n,target:e})&&!B({target:e,store:t}))),inviteUsers:i,importedContacts:r.importedContacts}}function R(e,t){if(!e||!t||0===e.length||0===t.length)return t;const n=new Set(e.map((e=>e.value.email.toLowerCase())));return t.filter((e=>!n.has(e.value.email.toLowerCase())))}function D(e){const{intl:t,target:n}=e;switch(n.type){case"newUser":return n.value.email;case"existingUser":return(0,l.Nz)(t,n.value);case"bot":return(0,o.Mh)(n.value);case"group":return(0,I.kF)({intl:t,group:n.value});default:(0,u.t1)(n)}}function B(e){const{target:t,store:n}=e;if(!n.isDefined())return!1;if((0,x.Y)(n)){const e=t.type;return"existingUser"===e?Boolean(n.isMemberOrGuest(t.value.id)):"group"===e?n.getRawMembership().some((e=>"group"===e.entity_type&&e.group_id===t.value.id)):("bot"===e||"newUser"===e||(0,u.P)(e),!1)}return n instanceof y.G?n.getPermissionItems().some((e=>{switch(t.type){case"existingUser":return(0,i.jg)(e)&&e.user_id===t.value.id;case"bot":return(0,i.FB)(e)&&e.bot_id===t.value.id;case"group":return(0,i.hV)(e)&&e.group_id===t.value.id;case"newUser":return!1;default:return(0,u.t1)(t)}})):n instanceof y.H2?"existingUser"===t.type?Boolean((0,f.VK)(n,t.value.id).isMember()):"bot"===t.type&&Boolean((0,f.Wz)(n,t.value.id).isMember()):!(0,x.R$)(n)&&void(0,u.t1)(n)}function E(e){const{environment:t,permissionsInviteStore:n,store:o,renderInShareModal:i}=e;n.setState({modalOpen:!i,tokenQuery:"",inviteTargets:[],inviteRole:F(e),isInviteTargetsEmpty:!0,table:(0,x.Mm)(o)?s.bx:a.iU,flowId:r.Il(),inputFocus:"invitee",emailMessage:""}),(0,x.Mm)(o)?m.$z(t):m.Mq(t,{...Z(t,e.permissionsInviteStore.state)})}function F(e){const{store:t,isSubscribed:n}=e;return(0,x.Mm)(t)?n?"read_and_write":"editor":(0,_.Mk)()?"editor":"read_and_write"}function Z(e,t){var n;const{isInviteTargetsEmpty:o,inviteRole:r,flowId:i}=t,a=(0,k.np)(),s=null==a?void 0:a.getRole(),l=null===(n=h.default.state.currentSpaceStore)||void 0===n?void 0:n.getRole(),{inviteTargets:c,emailMessage:d}=t,u=(0,_.zt)(),p={invite_flow_id:i,user_count:0,is_bot:!1,invite_message_length:(null==d?void 0:d.length)??0,...s&&{page_current_user_role:s},...l&&{space_role:l},...u&&{subscription_tier:u}};if(o)return p;if(0===c.length)return p;if(function(e){return e.length>0&&"bot"===e[0].type}(c))return{...p,is_bot:!0};const m=c.filter(v.cl).length,g=c.filter(v.fZ).length+m;return{...p,role:r,user_count:g,new_user_count:m}}function U(e){return"newUser"===e.type||"existingUser"===e.type&&("none"===e.spaceRole||"not_in_space"===e.spaceRole)}const V=(0,c.defineMessages)({workspaceOwnerTooltip:{id:"inviteUserModal.userRole.workspaceOwnerBadge.tooltip",defaultMessage:"{ userNameAndEmail} is a workspace owner in this workspace"},workspaceOwnerBadge:{id:"inviteUserModal.userRole.workspaceOwnerBadge.label",defaultMessage:"Workspace Owner"},adminTooltip:{id:"inviteUserModal.userRole.adminBadge.tooltip",defaultMessage:"{ userNameAndEmail} is an admin in this workspace"},adminBadge:{id:"inviteUserModal.userRole.adminBadge.label",defaultMessage:"Admin"},membershipAdminTooltip:{id:"inviteUserModal.userRole.membershipAdminBadge.tooltip",defaultMessage:"{ userNameAndEmail} is a membership admin in this workspace"},membershipAdminBadge:{id:"inviteUserModal.userRole.membershipAdminBadge.label",defaultMessage:"Membership admin"},memberTooltip:{id:"inviteUserModal.userRole.memberBadge.tooltip",defaultMessage:"{ userNameAndEmail} is a member in this workspace"},memberBadge:{id:"inviteUserModal.userRole.memberBadge.label",defaultMessage:"Member"},guestTooltip:{id:"inviteUserModal.userRole.guest.tooltip",defaultMessage:"{ userNameAndEmail} is a guest in this workspace"},guestBadge:{id:"inviteUserModal.userRole.guestBadge.label",defaultMessage:"Guest"}});function N(e){const{environment:t,customStyle:n}=e,{device:o}=t;return{display:"inline-flex",height:18,textTransform:"uppercase",fontSize:10,marginBottom:2,fontWeight:p.Z.fontWeight.medium,letterSpacing:1,color:d.ZP.uiLightGray,border:`1px solid ${d.ZP.uiLightGray}`,minWidth:70,alignItems:"center",justifyContent:"center",paddingTop:o.isAndroid?2:1,paddingBottom:1,paddingLeft:3,paddingRight:3,borderRadius:4,...n}}function O(e){const{role:t,intl:n,nameOrEmail:o}=e,r=o||n.formatMessage({id:"userTypeTooltip.generalPerson",defaultMessage:"This person"});switch(t){case"editor":return{tooltip:n.formatMessage(V.workspaceOwnerTooltip,{userNameAndEmail:r}),userRoleBadge:n.formatMessage(V.workspaceOwnerBadge)};case"membership_admin":return{tooltip:n.formatMessage(V.membershipAdminTooltip,{userNameAndEmail:r}),userRoleBadge:n.formatMessage(V.membershipAdminBadge)};case"read_and_write":return{tooltip:n.formatMessage(V.memberTooltip,{userNameAndEmail:r}),userRoleBadge:n.formatMessage(V.memberBadge)};case"none":return{tooltip:n.formatMessage(V.guestTooltip,{userNameAndEmail:r}),userRoleBadge:n.formatMessage(V.guestBadge)};default:(0,u.t1)(t)}}function L(e){return U(e)?"rgba(246, 192, 80, 0.26)":void 0}function j(e){var t;const{inviteTargets:n,recordStore:o,canEditSpaceMembership:r}=e;if(0===n.length)return null;if(!o)return null;const{inviteTargetGuests:i,inviteTargetMembers:a}=function(e){const t=[],n=[];return e.forEach((e=>{U(e)?t.push(e):n.push(e)})),{inviteTargetGuests:t,inviteTargetMembers:n}}(n),s=r?[...a,...i]:a,l=r?[]:i,d=w.default.getIntl(),u=(0,x.OY)(o)?null===(t=o.getBlockTitleStore())||void 0===t?void 0:t.getValue():o.getName();return r||0===l.length?(0,C.jsx)(c.FormattedMessage,{id:"permissionsInvite.inviteConfirmationToast.usersAddedMessage",defaultMessage:"{numberOfTargets, plural, one {Added {targetName} to {recordName}} other {Added {numberOfTargets} people to {recordName}}}",values:{numberOfTargets:s.length,targetName:D({intl:d,target:s[0]}),recordName:u}}):0===s.length?(0,C.jsx)(c.FormattedMessage,{id:"permissionsInvite.inviteConfirmationToast.inviteRequestedMessage",defaultMessage:"{numberOfTargets, plural, one {Requested {targetName} for approval} other {Requested {numberOfTargets} invites for approval}}",values:{numberOfTargets:l.length,targetName:D({intl:d,target:l[0]})}}):(0,C.jsx)(c.FormattedMessage,{id:"permissionsInvite.inviteConfirmationToast.userAddedAndRequestedText",defaultMessage:"{numberOfAddedTargets, plural, one {Added {addedTargetName}} other {Added {numberOfAddedTargets} people}} & {numberOfRequestedTargets, plural, one {requested {requestedTargetName} for approval} other {requested {numberOfRequestedTargets} people for approval}}",values:{numberOfAddedTargets:s.length,addedTargetName:D({intl:d,target:s[0]}),numberOfRequestedTargets:l.length,requestedTargetName:D({intl:d,target:l[0]})}})}function K(e){if("existingUser"!==e.type)return;const t=S.subscriptionDataStoreInstance.state,n=(t?b.CM(t):[]).find((t=>t.userId===e.value.id));return n?n.role:"not_in_space"}},613273:(e,t,n)=>{n.d(t,{Xt:()=>i,al:()=>l,eO:()=>c,jM:()=>s,yT:()=>a});var o=n(843250),r=n(162619);function i(e){const{menuElement:t,clickedElement:n}=e;return t!==n&&!t.contains(n)&&(!n.classList.contains("notion-link")&&!(n.closest(`.${o.mJW}`)&&!n.closest(`.${o.p1Q}`)&&!n.closest(`.${o.Nn$}`)&&!n.closest(`.${o.fHd}`)))}function a(e){if((0,r.sh)(e,(e=>e.classList&&(e.classList.contains(o.p1Q)||e.classList.contains(o.Nn$)||e.classList.contains(o.fHd)))))return!1;const t=(0,r.sh)(e,(e=>e.classList&&e.classList.contains(o.mJW)));return Boolean(t)}function s(e){const t=(0,r.sh)(e,(e=>e.classList&&e.classList.contains(o.Dkf)));return Boolean(t)}function l(e){const t=(0,r.sh)(e,(e=>e.classList&&e.classList.contains(o.RIA)));return Boolean(t)}function c(e){const t=(0,r.sh)(e,(e=>e.classList&&e.classList.contains(o.AWi)));return Boolean(t)}},220095:(e,t,n)=>{n.d(t,{AQ:()=>p,EB:()=>d,MR:()=>u});n(757658);var o=n(772141),r=n(653965),i=n(619584),a=n(88893),s=n(288280),l=n(367669);const c=18e4;function d(e){if(e&&e.blockId)return e.blockId}function u(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=e.currentUser.id;if(t.userId===o)return!0;{const e=Date.now();return n?t.present:Boolean(t.present&&t.activityTimestampNearestMinuteMs&&e-t.activityTimestampNearestMinuteMs<=c)}}function p(e,t){const n=s.subscriptionDataStoreInstance.state,{remotePresenceData:c,rootStore:d}=t.state;if(!d||!d.canEdit()||!n)return[];let u=[];c&&r.M6(c,(e=>{e&&e.userId&&u.push(e)}));const{pageId:p,lastViewTime:m,lastExitTime:g,...f}=e.state;r.M6(f,(e=>{e.isDefined()&&u.push({userId:e.getUserId(),activityTimestampNearestMinuteMs:(0,i.ud)(e.getVisitedAt()),present:!1})})),u=r.mN(u,(e=>e.userId));const h=(0,l.YO)(d).map((e=>{let{permissionItem:t}=e;return t})).filter(o.jg).map((e=>e.user_id)),v=(0,a.CM)(n).map((e=>e.userId)),y=r.G0(h,v);return u=u.filter((e=>!!y.includes(e.userId)&&!(!e.present&&!f[e.userId]))),u=r.MR(u,(e=>{let{activityTimestampNearestMinuteMs:t}=e;return t?-t:0})),u}},917504:(e,t,n)=>{n.d(t,{V:()=>i,Z:()=>a});var o=n(74948),r=n(212534);function i(e){(0,r.ZP)({event:e,context:r.Af.SidebarMouseMove,callback:()=>{o.close()}})}const a=function(e){return e({onMouseMove:i})}},455227:(e,t,n)=>{n.d(t,{g7:()=>a,kF:()=>l});n(757658);var o=n(421838),r=n(653965),i=n(162619);function a(e){let t="";const n=document.createElement("div");n.innerHTML=e;const o=i.kd(n);for(const i of o){const e=r.YU(i.data);if(null!==i.parentElement&&i.parentElement!==n){t+=`<span class="${s({parent:i.parentElement,root:n}).join(" ")}">${e}</span>`}else t+=e}return t}function s(e){const{parent:t,root:n}=e,o=new Set;let r=t;for(;r&&r!==n;)r.classList.forEach((e=>{o.add(e)})),r=r.parentElement??void 0;return Array.from(o)}function l(e,t){const n={text:c(e),syntax:c(t)},r=function(e){let t=0;return e.reduce(((e,n)=>(e.push([t,n]),t+=n,e)),[])}(function(e,t){const n=e.slice(),o=t.slice(),r=[];let i=0,a=0;for(;i<n.length&&a<o.length;){const e=n[i],t=o[a];e===t?(r.push(e),i+=1,a+=1):e<t?(r.push(e),i+=1,o[a]-=e):(r.push(t),n[i]-=t,a+=1)}return r}(n.text,n.syntax)),i={text:0,syntax:0},a={text:0,syntax:0},s=[],l=e.map(o.WiV).join("");for(const[o,c]of r){const e=o+c,r=t[i.syntax],u={value:l.substring(o,e),textTokenIndex:i.text,classNames:(d=r,d&&d[1])};s.push(u);const p=n.text[i.text],m=n.syntax[i.syntax];e>=a.text+p&&(i.text+=1,a.text+=p),e>=a.syntax+m&&(i.syntax+=1,a.syntax+=m)}var d;return s}function c(e){return e.map((e=>e[0].length))}},658239:(e,t,n)=>{n.d(t,{ZT:()=>c,lX:()=>a,rq:()=>s});var o=n(915157),r=n(421202),i=n(475246);async function a(e){let{currentUserId:t,spaceStore:n}=e;const r=o.Z.get({userId:t,key:l(n.id)});return u(n,n.loadRecordModel,r)}function s(e){let{currentUserId:t,spaceId:n,value:r}=e;o.Z.set({userId:t,key:l(n),value:r})}function l(e){return`quickAddParent3:${e}`}function c(e){let{currentUserId:t,spaceId:n,parent:r,databaseType:i}=e;o.Z.set({userId:t,key:d(n,i),value:r})}function d(e,t){return`quickAddTypedParent:${e}:${t||"default"}`}async function u(e,t,n){let o;if(n)if("page"===n.type){await t({table:r.iU,id:n.id})&&(o=n)}else if("space"===n.type){await t({table:i.bx,id:n.id})&&(o=n)}return o||{type:"space-private-pages",spaceId:e.id}}},615447:(e,t,n)=>{n.d(t,{Od:()=>h,Wk:()=>b,X4:()=>p,_5:()=>y,_k:()=>v,eJ:()=>g,h_:()=>f,rw:()=>m});n(757658);var o=n(14577),r=n(653965),i=n(21359),a=n(318245),s=n(80444),l=n(385555),c=n(269327),d=n(629026);const u=1e3,p=new o.ZP((()=>{const{currentSpaceStore:e}=s.default.state;if(!e)return[];return c.Z.getWithoutSubscribing(e.id).slice(0,u).filter((e=>!e.store.pathIsDead()))}),{debugName:"recentAlivePagesStore"});function m(e,t){if("object"==typeof t&&t){const{spaceId:e,blockId:n,visitedAt:o}=t.userPageVisit||{};if(!e||!n||!o)return;g({spaceId:e,pageId:n,visitedAt:o})}}function g(e){let{spaceId:t,pageId:n,visitedAt:o}=e;const r=function(e){let{newRecentPage:t,currentRecentPages:n}=e;const o=n.filter((e=>e.pageId!==t.pageId)),r=o;let i=0;for(;i<o.length;i++)if(t.visitedAt>=o[i].visitedAt){r.splice(i,0,t);break}i===o.length&&r.push(t);return r}({newRecentPage:{pageId:n,visitedAt:o},currentRecentPages:c.Z.getWithoutSubscribing(t)});c.Z.set(t,r),p.recompute()}async function f(e){let{environment:t,userId:n,spaceId:o}=e;const s=l.default.getGroup("search-more-recent-pages-in-local"),d="lazy-";let u;s.startsWith(d)&&(u=r.o5(s.slice(5))||void 0);const m=s.startsWith(d),g=a.default.DO_NOT_USE_markLegacy("load_global_recent_pages_initial_load"),f=a.default.DO_NOT_USE_markLegacy("load_global_recent_pages");async function h(e,r){const l=await i.getRecentPageVisits(t,{userId:n,spaceId:o,limit:e},n);"success"===l.type&&(a.default.DO_NOT_USE_measureLegacy(r,{environment:t,data:{experiment_group:s}}),c.Z.set(o,l.data.pages.map((e=>({pageId:e.id,visitedAt:e.visitedAt}))))),p.recompute()}m?(h(u,f),await h(void 0,g)):await h(u,f)}async function h(e,t){var n,o;let{environment:r,userId:a,spaceId:s}=t;if(c.Z.getWithoutSubscribing(s).length>u)return!1;const l=await i.getRecentPageVisits(r,{userId:a,spaceId:s,beforeTimestamp:e,limit:d.Xv},a);if("success"!==l.type||l.data.pages.length<=0)return!1;const m=l.data.pages.map((e=>({pageId:e.id,visitedAt:e.visitedAt}))),g=null===(n=c.Z.get(s))||void 0===n?void 0:n.length;c.Z.mergeRecentPages(m,s);const f=null===(o=c.Z.get(s))||void 0===o?void 0:o.length;return p.recompute(),g!==f}const v=["today","yesterday","past_week","past_30_days","older"];function y(e){const t=Date.now(),n=864e5,o=t-e,r=new Date(e).getDay(),i=new Date(t).getDay(),a=new Date(t);a.setDate(a.getDate()-1);const s=a.getDay();return r===i&&o<=n?"today":r===s&&o<=1728e5?"yesterday":o<=6048e5?"past_week":o<=2592e6?"past_30_days":"older"}function b(e){return null==e?void 0:e.map((e=>({visitedAt:e.visitedAt,pageId:e.pageId}))).sort(((e,t)=>t.visitedAt-e.visitedAt)).slice(0,50)}},244133:(e,t,n)=>{n.r(t),n.d(t,{getDebugSourcesForIdsInOperations:()=>c,setBlockIdDebugSource:()=>s,setupRecordCacheDebugging:()=>a});var o=n(39593);let r=!1;const i=new(n.n(o)())({max:1e4});function a(e){e.isMobile||(r=!0)}function s(e,t){r&&(i.has(e)||i.set(e,t))}const l=/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/g;function c(e,t){const n={blocks:{},isIdSourceCacheFull:i.itemCount===i.max},o=JSON.stringify(t),r=new Set(Array.from(o.matchAll(l)).map((e=>e[0])));for(const s of r){var a;let t=!1;const o={},r=i.get(s);r&&(t=!0,o.debugSource=r);const l=e.defaultRecordCache.inMemoryRecordCache.getRecord({pointer:{table:"block",id:s},userId:e.currentUser.id});null!=l&&null!==(a=l.value)&&void 0!==a&&a.type&&(t=!0,o.blockType=l.value.type),t&&(n.blocks[s]=o)}return n}},165598:(e,t,n)=>{n.d(t,{D4:()=>q,De:()=>ae,GP:()=>Q,HK:()=>H,M1:()=>re,MI:()=>D,Mm:()=>ee,Nm:()=>j,No:()=>J,OY:()=>I,Oh:()=>oe,PF:()=>K,R$:()=>te,SJ:()=>M,Sd:()=>B,Xp:()=>O,Y:()=>x,ak:()=>z,al:()=>Z,bB:()=>N,bQ:()=>$,c3:()=>L,dv:()=>F,dz:()=>ie,ig:()=>W,le:()=>G,mY:()=>V,sl:()=>X,vV:()=>U,x8:()=>T,yJ:()=>C,zP:()=>Y});var o=n(292595),r=n(709410),i=n(568626),a=n(600606),s=n(570921),l=n(421202),c=n(870279),d=n(933709),u=n(361220),p=n(475246),m=n(429369),g=n(421838),f=n(182798),h=n(653965),v=n(401898),y=n(385555),b=n(206258),_=n(313105),S=n(433929),k=n(798165);const w=128;function x(e){return e.table===m.e0}function I(e){return e.table===l.iU}function C(e){return Z(e,{recursivelyLoadAllDiscussions:!1}).filter(ae)}function T(e){return(0,b.Vh)(e,e.pointer,"discussions")}function M(e){let t=0;return e.findRecordStoreUIAncestor((n=>(n!==e&&e.id&&n.id===e.id&&n.table===e.table&&h.Xy(e.path,n.path)&&t++,!1))),t>1}const P=new _.P({debugName:"recursiveChildBlocks",memoizeRecursion:!0,deepEquals:!1,compute:function(e,t){return A({blockStore:e,traverseTransclusionReferences:!0}).flatMap((e=>[e,..."page"===e.getType()?[]:t(e)]))}});function A(e){const{blockStore:t,traverseTransclusionReferences:n}=e;if(M(t))return[];return t.getContentStores().map((e=>{const t=e.getType();if(t){if("transclusion_reference"===t){if(!n)return;const t=e.getTransclusionReferenceTargetStore();return t||void 0}return e}})).filter(v.$K)}const R=new _.P({debugName:"recursiveWihTransclusionChildBlocks",memoizeRecursion:!0,deepEquals:!1,compute:function(e,t){return A({blockStore:e,traverseTransclusionReferences:!1}).flatMap((e=>[e,..."page"===e.getType()?[]:t(e)]))}});function D(e){const{blockStore:t,transclusionReferences:n,childPages:o}=e,r=("recurseInto"===n?P:R).getStateFor(t);return"includeWithoutRecursion"===o?r:r.filter((e=>!e.isType("page")))}function*B(e){const{blockStores:t,traverseTransclusionReferences:n}=e;for(const o of t){yield o;for(const e of D({blockStore:o,transclusionReferences:n?"recurseInto":"omit",childPages:"omit"}))yield e}}const E=new _.P({debugName:"loadedDiscussionStores",memoizeRecursion:!1,deepEquals:!1,compute:function(e){const t=T(e),n=((null==t?void 0:t.getValue())||[]).map((t=>b.t1.createChildStore(e,a.dr.fromPointerLike({table:d.qF,id:t,spaceId:e.pointer.spaceId}))));return n.reverse(),n}});function F(e){return e.table===c.x_}function Z(e,t){const n=t.excludeSelf?[]:[e],o=null!=t&&t.recursivelyLoadAllDiscussions?[...n,...D({blockStore:e,transclusionReferences:"recurseInto",childPages:"omit"})]:n,r=y.default.checkGate({gateName:"collections_inline_text_property_comment"}),i=new Set;return o.flatMap(E.getStateFor).filter((e=>{if(!(null!=t&&t.includeLoadingDiscussions||e.isDefined()))return!1;if(i.has(e.id))return!1;if(!r&&void 0!==e.getPropertyId())return!1;if(null!=t&&t.onlyIncludePropertyDiscussions){if(void 0===e.getPropertyId())return!1}else if((null==t||!t.includePropertyDiscussions)&&void 0!==e.getPropertyId())return!1;return i.add(e.id),!0}))}function U(e,t){return N(Z(e,t)).unresolved}function V(e,t){return N(Z(e,t)).resolved}function N(e){const t=e.filter((e=>e.isDefined())),[n,o]=h.uK(t,(e=>e.getResolved()));return{resolved:n,unresolved:o}}function O(e,t){return(Array.isArray(e)?e:U(e,t)).reduce(((e,n)=>{const o=n.getModel();return o?t.onlyIncludeBlockLevelDiscussions&&!ae(n)?e:e+(o.getComments()||[]).length:e}),0)}function L(e,t,n){let o=Array.isArray(e)?e:U(e,t);return n&&(o=o.filter((e=>e.getPropertyId()===n))),o.reduce(((e,n)=>{const o=n.getModel();return o?t.onlyIncludeBlockLevelDiscussions&&!ae(n)?e:{comments:e.comments+(o.getComments()||[]).length,reactions:e.reactions+b.bh.getUserVisibleReactions(n).length,hasSuggestionDiscussions:!!e.hasSuggestionDiscussions||"suggestion"===o.getType(),hasDefaultDiscussions:!!e.hasDefaultDiscussions||"default"===o.getType()}:e}),{comments:0,reactions:0,hasSuggestionDiscussions:!1,hasDefaultDiscussions:!1})}function j(e){return!!K(e)&&0===function(e,t){return U(e,t).length}(e,{recursivelyLoadAllDiscussions:!1})}function K(e){if("text"!==e.getType())return!1;const t=e.getBlockTitleStore().getValue();return(!t||!t.length)&&!e.hasContent()}function z(e){return(0,b.Vh)(e,e.pointer,"comments")}function q(e){if(!e)return[];const t=z(e);return(t.getValue()||[]).map((e=>b.T5.createChildStore(t,{table:c.x_,id:e,spaceId:t.pointer.spaceId})))}function H(e){if(e.isDefined())return b.t1.createChildStore(e,e.getParentPointer())}function G(e){const t=W(e);return(t.getValue()||[]).map((n=>b.G.createChildStore(t,a.dr.fromPointerLike({table:l.iU,id:n,spaceId:e.pointer.spaceId}))))}function W(e){return(0,b.Vh)(e,e.pointer,"content")}function $(e){return(0,b.Vh)(e,e.pointer,"last_edited_time")}function Y(e){return(0,b.Vh)(e,e.pointer,"text")}function Q(e){if(e.isDefined())return b.t1.createChildStore(e,e.getParentPointer())}function J(e,t,n){return b.t1.createChildStore(e,{table:s.TY,id:t,spaceId:n})}function X(e){if(e.isDefined())return J(e,e.getActivityId(),e.getSpaceId())}function ee(e){return e.table===p.bx}function te(e){return e.table===u.V7}(0,o.exposeDebugValue)("getDiscussionStores",Z);const ne=h.P2((e=>{i.log(e)}),500);function oe(e){let t=e,n=0;for(;t;){if(!t.isReady())return!1;if(n>=w)return ne({level:"error",from:"recordStoreHelpers",type:"areAncestorsLoaded",data:{message:"max depth reached",miscDataToConvertToString:{maxDepth:w,id:e.id,table:e.table,currentStoreId:t.id,currentTable:t.table}}}),!1;n+=1,t=(0,k.Om)(t)}return!0}async function re(e){let t=e,n=0;for(;t;){if(t.isReady()||await t.load(),n>=w)return ne({level:"error",from:"recordStoreHelpers",type:"loadAncestors",data:{message:"max depth reached",miscDataToConvertToString:{maxDepth:w,id:e.id,table:e.table,currentStoreId:t.id,currentTable:t.table}}}),!1;n+=1,t=(0,k.Om)(t)}}function ie(e){return e.table===l.iU&&h.Xy(e.path,["content"])}function ae(e){if(!e.isDefined())return!1;if("suggestion"===e.getType())return!1;if(e.getPropertyId())return!1;const t=e.getContext(),n=t?(0,r.Bb)({discussionContextData:t,discussionType:(0,f.TO)(e.getType()),discussionId:e.id,intl:S.default.getIntl()}):void 0;if(!n)return!0;return function(e){return 0===g.llS(e).length}(g.VP_(n,(t=>!g.xw5(t)||g.h19(t)===e.id)))}},637034:(e,t,n)=>{n.d(t,{JL:()=>p,NO:()=>m,V:()=>g,vU:()=>f});var o=n(217215),r=n(842875),i=n(882883),a=n(213493),s=n(401898),l=n(110906),c=n(206258),d=n(708661),u=n(548779);const p=(0,s.AO)((e=>e instanceof c.G||e instanceof c.H2||e instanceof c.NW||e instanceof c.Xr||e instanceof c.zX?{true:e}:{false:e}));function m(e,t){if(e.isDefined())return e.getModel().getEmptyTitlePlaceholder({getRecordModel:e.getRecordModel,userTimeZone:(0,r.r)(),intl:t})}function g(e,t,n,a){if(e instanceof c.zX)return e.getName();if(e instanceof c.H2)return(0,u.rn)(n,e);if(e instanceof c.Xr){const t=e.getName();if(t)return t;const n=e.getType();return n?d.Bh[n]:void 0}if(!e||!e.isDefined())return;if("none"===e.getRole())return o.x(t);const s=e instanceof c.G?e.getTitleValue():e.getName();return(0,i.Xh)({textValue:s,getRecordModel:e.getRecordModel,userTimeZone:(0,r.r)(),intl:t,disableInsertedAnnotations:a})}function f(e){const{environment:t,intl:n,untitledFallback:r,store:i}=e,s=r?n.formatMessage(r):function(e,t){if(e.table===a.np){const n=e.getType();if(n&&"page"!==n&&l.b1[n])return t.formatMessage(l.b1[n])}return o.Q2(t)}(i,n);return g(i,n,t,!1)||m(i,n)||s}},531062:(e,t,n)=>{n.d(t,{Bq:()=>x,l7:()=>g,W3:()=>f,uM:()=>w,qi:()=>b,Gt:()=>y,cn:()=>I,OH:()=>_,g3:()=>S,K9:()=>k,vi:()=>C,nB:()=>v,Tq:()=>h,dH:()=>m});var o=n(709291),r=n(401898),i=n(51592),a=n(851153),s=(n(667294),n(745238)),l=n(785893);const c=(0,s.IU)("hand",{viewBox:"0 0 28 28",svg:(0,l.jsx)("path",{d:"M13.6572 23.1553C16.918 23.1553 19.1943 21.415 20.416 17.9873L21.9893 13.584C22.1035 13.2588 22.1562 12.9512 22.1562 12.6611C22.1562 11.6592 21.4092 10.9209 20.416 10.9209C19.7832 10.9209 19.2119 11.2812 18.9131 11.9668L18.4385 13.1182C18.4209 13.1533 18.4033 13.1709 18.3682 13.1709C18.3242 13.1709 18.3066 13.1445 18.3066 13.1006V6.35059C18.3066 5.23438 17.5771 4.51367 16.4961 4.51367C16.1621 4.51367 15.8545 4.61914 15.6172 4.82129C15.4414 3.93359 14.8174 3.38867 13.9121 3.38867C13.0332 3.38867 12.3916 3.94238 12.207 4.80371C11.9873 4.61035 11.7061 4.51367 11.4072 4.51367C10.3965 4.51367 9.70215 5.2168 9.70215 6.2627V7.08008C9.48242 6.86914 9.16602 6.75488 8.83203 6.75488C7.82129 6.75488 7.10938 7.51074 7.10938 8.58301V16.2822C7.10938 20.5361 9.72852 23.1553 13.6572 23.1553ZM13.6133 21.6523C10.4668 21.6523 8.54199 19.6484 8.54199 16.124V8.75C8.54199 8.41602 8.75293 8.1875 9.06934 8.1875C9.39453 8.1875 9.62305 8.41602 9.62305 8.75V13.2764C9.62305 13.6543 9.93066 13.918 10.2822 13.918C10.6426 13.918 10.9502 13.6543 10.9502 13.2764V6.48242C10.9502 6.14844 11.1611 5.91992 11.4863 5.91992C11.8027 5.91992 12.04 6.14844 12.04 6.48242V12.8105C12.04 13.1885 12.3389 13.4609 12.6904 13.4609C13.0508 13.4609 13.3584 13.1885 13.3584 12.8105V5.36621C13.3584 5.04102 13.5869 4.79492 13.9033 4.79492C14.2197 4.79492 14.4482 5.04102 14.4482 5.36621V12.7051C14.4482 13.0654 14.7383 13.3467 15.0986 13.3467C15.4678 13.3467 15.7666 13.0654 15.7666 12.7051V6.48242C15.7666 6.14844 15.9863 5.91992 16.3115 5.91992C16.6279 5.91992 16.8564 6.14844 16.8564 6.48242V15.2451C16.8564 15.7549 17.1816 16.0449 17.6035 16.0361C17.9551 16.0361 18.2715 15.8779 18.4824 15.4121L19.748 12.5732C19.8975 12.2305 20.1963 12.125 20.4688 12.2217C20.7676 12.3359 20.8643 12.626 20.7236 13.0039L19.0889 17.5127C17.999 20.501 16.1621 21.6523 13.6133 21.6523Z"})}),d=(0,s.IU)("overlap",{viewBox:"0 0 20 20",svg:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("path",{d:"M4.917 14.496h1.729v-1.1H4.93c-.342 0-.604-.091-.786-.274-.182-.182-.273-.45-.273-.806V5.52c0-.356.09-.625.273-.807.182-.182.444-.273.786-.273h6.83c.336 0 .596.09.779.273.186.182.28.451.28.807v1.497h1.1V5.459c0-.702-.18-1.23-.54-1.586-.355-.355-.888-.533-1.6-.533H4.918c-.716 0-1.254.178-1.614.533-.355.351-.533.88-.533 1.586v6.918c0 .707.178 1.237.533 1.593.36.35.898.526 1.614.526zm3.315 3.165h6.863c.711 0 1.244-.177 1.6-.533.36-.355.54-.884.54-1.586V8.624c0-.702-.18-1.23-.54-1.586-.356-.355-.889-.533-1.6-.533H8.232c-.716 0-1.253.178-1.613.533-.356.351-.534.88-.534 1.586v6.918c0 .707.178 1.235.534 1.586.36.356.897.533 1.613.533zm.014-1.1c-.342 0-.604-.091-.787-.274-.182-.182-.273-.45-.273-.806V8.686c0-.356.091-.625.273-.807.183-.182.445-.273.787-.273h6.829c.337 0 .597.09.779.273.187.182.28.451.28.807v6.795c0 .355-.093.624-.28.806-.182.183-.442.274-.78.274H8.247z"}),(0,l.jsx)("path",{d:"M13.976 12.448l-1.832 1.36c-.192.147-.379.183-.561.11-.182-.073-.273-.225-.273-.458v-.848H9.7a.533.533 0 01-.383-.15.521.521 0 01-.157-.383c0-.145.053-.27.157-.376s.233-.157.383-.157h1.61v-.827c0-.246.093-.401.28-.465.187-.068.371-.034.554.103l1.832 1.374a.43.43 0 01.184.362.423.423 0 01-.184.356z"})]})}),u=(0,o.defineMessages)({dependenciesPropertySelectDefaultOptionCaption:{id:"database.viewSettings.relationFeatures.dependencies.propertySelectPopup.default.caption",defaultMessage:"This property will be used for dependencies in new views, and will set date shifting behavior across all views."},deleteDependenciesAcceptModalTitle:{id:"collectionSettings.relationFeatures.deleteDependenciesAcceptModal.title",defaultMessage:"Turn off dependencies?"},dependenciesMenuTitle:{id:"database.viewSettings.dependenciesTab.title",defaultMessage:"Dependencies"},dateShiftingSectionCaption:{id:"collectionSettings.dependenciesView.dateShiftingSection.caption",defaultMessage:"Automatic date shifting"},datePropertyPickerTitle:{id:"database.viewSettings.relationFeatures.datePropertyPicker.title",defaultMessage:"Shift using"},startDate:{id:"database.viewSettings.relationFeatures.datePropertyPicker.startDate",defaultMessage:"Start date"},endDate:{id:"database.viewSettings.relationFeatures.datePropertyPicker.endDate",defaultMessage:"End date"},advancedSettings:{id:"database.viewSettings.dependenciesAdvancedSettingsTab.title",defaultMessage:"Advanced settings"},newDateProperty:{id:"collectionSettings.dependenciesFeature.newDateProperty.name",defaultMessage:"Date"},doNotShiftButton:{id:"collectionSettings.dependenciesView.dateShiftingButton.doNotShift.label",defaultMessage:"Do not automatically shift"},consumeGapButton:{id:"collectionSettings.dependenciesView.dateShiftingButton.consumeGap.label",defaultMessage:"Shift only when dates overlap"},avoidWeekendsSwitcherTitle:{id:"collectionSettings.dependenciesView.dateShiftingSection.avoidWeekends.switcher.title",defaultMessage:"Avoid weekends"},hideDependenciesInView:{id:"CollectionSettingsViewRelationFeatures.hideDependenciesInView",defaultMessage:"Hide dependencies in view"},showDependenciesInView:{id:"CollectionSettingsViewRelationFeatures.showDependenciesInView",defaultMessage:"Show dependencies in view"},turnOnDependenciesButton:{id:"collectionSettings.dependenciesView.turnOnDependenciesButton.label",defaultMessage:"Turn on dependencies"},turnOffDependenciesButton:{id:"database.viewSettings.relationsPropertyTab.removeDependenciesButton.title",defaultMessage:"Turn off dependencies"},dateShiftSuccess:{id:"collectionDateActions.dateShiftSuccess",defaultMessage:"Shifted the dates of {numDependenciesUpdated, plural, one {1 dependent {item}} other {{numDependenciesUpdated} dependent {items}}}"},dateShiftSomeNotUpdatedDueToPermissions:{id:"collectionDateActions.dateShiftSomeNotUpdatedDueToPermissions",defaultMessage:"Shifted the dates of {numDependenciesUpdated, plural, one {1 dependent {item}} other {{numDependenciesUpdated} dependent {items}}}. Others could not be shifted because you do not have permission"},dateShiftAllNotUpdatedDueToPermissions:{id:"collectionDateActions.dateShiftAllNotUpdatedDueToPermissions",defaultMessage:"The dates of dependent {items} could not be shifted because you do not have permission"},shiftingNotApplicableNoShiftingMessage:{id:"CollectionSettingsViewRelationFeatures.shiftingNotApplicableNoShiftingMessage",defaultMessage:"The dates of dependent {items} in this view will not automatically shift. To change the date shifting behavior, update the default relation property in Advanced settings."},shiftingNotApplicableConsumeGapMessage:{id:"CollectionSettingsViewRelationFeatures.shiftingNotApplicableConsumeGapMessage",defaultMessage:"The dates of dependent {items} in this view will shift when {item} dates overlap. To change the date shifting behavior, update the default relation property in Advanced settings."},shiftingNotApplicablePreserveGapMessage:{id:"CollectionSettingsViewRelationFeatures.shiftingNotApplicablePreserveGapMessage",defaultMessage:"The dates of dependent {items} in this view will shift maintaining the time between {items}. To change the date shifting behavior, update the default relation property in Advanced settings."},preserveGapButton:{id:"collectionSettings.dependenciesView.dateShiftingButton.preserveGap.label",defaultMessage:"Shift & maintain time between {items}"},avoidWeekendsSwitcherCaption:{id:"collectionSettings.dependenciesView.dateShiftingSection.avoidWeekends.switcher.description",defaultMessage:"Prevent shifted {items} from starting or ending on weekends"},dependenciesMenuDescription:{id:"database.viewSettings.relationsPropertyTab.dependencies.description",defaultMessage:"Use dependencies to show {items} that are blocking — or blocked by — other {items}."},dependenciesPropertyPickerCaption:{id:"database.viewSettings.relationsPropertyTab.dependencies.relationPropertyPicker.caption",defaultMessage:"Choose the relation property that represents the {items} that are blocked. We use “Blocking” as our default."}}),p=(0,o.defineMessages)({hideSubitemsInView:{id:"CollectionSettingsViewRelationFeatures.hideSubitemsInView",defaultMessage:"Hide sub-{items} in view"},showSubitemsInView:{id:"CollectionSettingsViewRelationFeatures.showSubitemsInView",defaultMessage:"Show sub-{items} in view"},turnOnSubItemsButton:{id:"collectionSettings.subitemsView.turnOnSubitemsButton.label",defaultMessage:"Turn on sub-{items}"},turnOffSubItemsButton:{id:"database.viewSettings.relationsPropertyTab.removeSubItemsButton.title",defaultMessage:"Turn off sub-{items}"},subItemsMenuTitle:{id:"database.viewSettings.subItemsTab.title",defaultMessage:"Sub-{items}"},subItemsMenuDescription:{id:"database.viewSettings.relationsPropertyTab.subitems.description",defaultMessage:"Break down {items} in toggles"},deleteSubItemsAcceptModalTitle:{id:"collectionSettings.relationFeatures.deleteSubItemsAcceptModal.title",defaultMessage:"Turn off sub-{items}?"},subItemsPropertyPickerCaption:{id:"database.viewSettings.relationsPropertyTab.subitems.relationPropertyPicker.caption",defaultMessage:"Choose the relation property that represents the sub-{items}. We use “Sub-{item}” as our default."},subItemsPropertySelectDefaultOptionCaption:{id:"database.viewSettings.relationFeatures.subitems.propertySelectPopup.default.caption",defaultMessage:"This property will be used for sub-{items} in new views."},toggleNestingOnTitleMenuItemTooltip:{id:"database.viewSettings.relationFeatures.subitems.toggleNestingOnTitleMenuItemTooltip.default.caption",defaultMessage:"Whether nesting and the toggle button should always be on the title column or the left-most column. Only relevant for table views"}}),m=(0,o.defineMessages)({relationFeatureShownMessage:{id:"database.viewSettings.mainTab.feature.shown",defaultMessage:"Shown"},relationFeatureOnMessage:{id:"database.viewSettings.mainTab.feature.on",defaultMessage:"On"},relationFeatureOffMessage:{id:"database.viewSettings.mainTab.feature.off",defaultMessage:"Off"},relationFeatureHiddenMessage:{id:"database.viewSettings.mainTab.relationFeatureHidden",defaultMessage:"Hidden"},turnOffAndDelete:{id:"collectionSettings.relationFeatures.turnOffFeatureAllViewsButton.label",defaultMessage:"Turn off & delete properties"},turnOffFeature:{id:"collectionSettings.relationFeatures.turnOffFeatureWithoutDeleteButton.label",defaultMessage:"Turn off & keep properties"},turnOffFeatureDeletedProperties:{id:"collectionSettings.relationFeatures.turnOffFeature.deletedProperties.description",defaultMessage:"This will also delete the properties <span>{propertyName}</span> and <span>{inversePropertyName}</span>."},...u,...p});function g(e){return"consume_gap"===e?d:"preserve_gap"===e?a.$:c}function f(e){let t;return t="consume_gap"===e.dateShiftingMode?m.consumeGapButton:"preserve_gap"===e.dateShiftingMode?m.preserveGapButton:m.doNotShiftButton,{...t,values:{items:(0,i.Q_)(e.databaseType,!0)}}}function h(e){let t;return"timeline_arrows_by"===e.feature?t=m.turnOnDependenciesButton:"subitem"===e.feature?t=m.turnOnSubItemsButton:(0,r.t1)(e.feature),{...t,values:{items:(0,i.Q_)(e.databaseType,!0)}}}function v(e){let t;return"timeline_arrows_by"===e.feature?t=m.turnOffDependenciesButton:"subitem"===e.feature?t=m.turnOffSubItemsButton:(0,r.t1)(e.feature),{...t,values:{items:(0,i.Q_)(e.databaseType,!0)}}}function y(e){let t;return"timeline_arrows_by"===e.feature?t=m.dependenciesMenuTitle:"subitem"===e.feature?t=m.subItemsMenuTitle:(0,r.t1)(e.feature),{...t,values:{items:(0,i.Q_)(e.databaseType,!0)}}}function b(e){let t;return"timeline_arrows_by"===e.feature?t=m.dependenciesMenuDescription:"subitem"===e.feature?t=m.subItemsMenuDescription:(0,r.t1)(e.feature),{...t,values:{items:(0,i.Q_)(e.databaseType,!0)}}}function _(e){let t;return"timeline_arrows_by"===e.feature?t=m.deleteDependenciesAcceptModalTitle:"subitem"===e.feature?t=m.deleteSubItemsAcceptModalTitle:(0,r.t1)(e.feature),{...t,values:{items:(0,i.Q_)(e.databaseType,!0)}}}function S(e){let t;return"timeline_arrows_by"===e.feature?t=m.dependenciesPropertyPickerCaption:"subitem"===e.feature?t=m.subItemsPropertyPickerCaption:(0,r.t1)(e.feature),{...t,values:{item:(0,i.sN)(e.databaseType,!0),items:(0,i.Q_)(e.databaseType,!0)}}}function k(e){let t;return"timeline_arrows_by"===e.feature?t=m.dependenciesPropertySelectDefaultOptionCaption:"subitem"===e.feature?t=m.subItemsPropertySelectDefaultOptionCaption:(0,r.t1)(e.feature),{...t,values:{item:(0,i.sN)(e.databaseType,!0),items:(0,i.Q_)(e.databaseType,!0)}}}function w(e){let t;return(0,r.$K)(e.currentDateShiftConfig)?"preserve_gap"===e.currentDateShiftConfig.mode?t=m.shiftingNotApplicablePreserveGapMessage:"consume_gap"===e.currentDateShiftConfig.mode?t=m.shiftingNotApplicableConsumeGapMessage:(0,r.t1)(e.currentDateShiftConfig.mode):t=m.shiftingNotApplicableNoShiftingMessage,{...t,values:{items:(0,i.Q_)(e.databaseType,!0)}}}function x(e){return{...m.avoidWeekendsSwitcherCaption,values:{items:(0,i.Q_)(e,!0)}}}function I(e){const{feature:t,isOn:n,databaseType:o}=e;let a;return"timeline_arrows_by"===t?a=n?m.hideDependenciesInView:m.showDependenciesInView:"subitem"===t?a=n?m.showSubitemsInView:m.hideSubitemsInView:(0,r.t1)(t),{...a,values:{items:(0,i.Q_)(o,!0)}}}function C(e){const t={numDependenciesUpdated:e.result.numDependenciesUpdated,item:(0,i.sN)(e.databaseType,!0),items:(0,i.Q_)(e.databaseType,!0)};return e.result.numCouldNotUpdateDueToPermissions>0?e.result.numDependenciesUpdated>0?{message:{...m.dateShiftSomeNotUpdatedDueToPermissions,values:t},canUndo:!0}:{message:{...m.dateShiftAllNotUpdatedDueToPermissions,values:{}},canUndo:!1}:e.result.numDependenciesUpdated>0?{message:{...m.dateShiftSuccess,values:t},canUndo:!0}:void 0}},729376:(e,t,n)=>{n.d(t,{BI:()=>_,DB:()=>E,KV:()=>h,Mu:()=>f,NA:()=>P,ND:()=>A,OP:()=>v,Pi:()=>y,U1:()=>T,ZI:()=>C,aI:()=>x,gO:()=>B,gZ:()=>k,ke:()=>R,m8:()=>I,ny:()=>S,pR:()=>b,rj:()=>w,uJ:()=>D});n(757658);var o=n(399036),r=n(595200),i=n(977657),a=n(406695),s=n(842875),l=n(295519),c=n(522808),d=n(959753),u=n(401898),p=n(51592),m=(n(504430),n(110906)),g=n(206258);const f=32;function h(e,t){return e.normalizedSchemaStore.state[t]}function v(e,t,n){const r=h(e,t);if(!r||"relation"!==r.type||!r.property)return!1;const i=e.collectionStore(),a=n.getSchema();return o.$u({propertySchema:r,sourceCollectionId:null==i?void 0:i.id,property:t,targetCollectionSchema:a})}function y(e){const t=(0,u.qP)(e).find((e=>{let[t,n]=e;if(n&&(0,o.NK)(n))return n.connectedRelation.integration_id===i.U9}));if(t&&t[1]&&(0,o.NK)(t[1]))return t[1]}function b(e){return Boolean(y(e))}function _(e,t){if(!e)return!1;const n=e[t];return Boolean(n&&(0,o.NK)(n)&&n.connectedRelation.integration_id===i.U9)}function S(e,t){if("relation"!==(null==t?void 0:t.type))return;const n=null==t?void 0:t.collection_pointer,o=e.collectionViewBlockStore();return n&&o?g.NW.createChildStore(o,n):void 0}function k(e){return m.eD({collectionStore:e,collectionViewBlockStore:e.getParentBlockStore(),checkNavigableAncestorLocked:!1})}function w(e){const{inverseName:t,collectionStore:n,propertySchema:o,intl:r,targetCollectionStore:i,from:a}=e;return t||(n.isDefined()&&o?x(r,{sourceCollection:n.getModel(),isSelfRelation:n.id===i.id,targetCollectionStore:i,createUnique:!0,from:a}):"")}function x(e,t){var n;const{sourceCollection:o,isSelfRelation:i,targetCollectionStore:a,createUnique:l,from:u}=t,m=d.kk5.fromCollection(o),g=e.formatMessage({id:"relationHelpers.autoInverseRelation.untitledDatabase",defaultMessage:"Untitled Database"}),f=null===(n=m.getRenderIcon({getRecordModel:d.omK.constant(void 0)}))||void 0===n?void 0:n.icon,h=m.getRenderTitle({getRecordModel:a.getRecordModel,userTimeZone:(0,s.r)(),intl:e})||g,v=m.getDatabaseType();let y;if(i)if("subitem"===u){const t=(0,p.sN)(v,!0);y=e.formatMessage({defaultMessage:"Parent {item}",id:"relationHelpers.autoSelfRelationInverseToggle.typedName"},{item:t})}else y="timeline_arrows_by"===u?e.formatMessage({defaultMessage:"Blocked by",id:"relationHelpers.autoSelfRelationInverseArrow.name"},{sourceCollectionName:h}):e.formatMessage({defaultMessage:"Related back to {sourceCollectionName}",id:"relationHelpers.autoSelfRelationInverse.name"},{sourceCollectionName:h});else y=f&&(0,c.Z)(f)?e.formatMessage({defaultMessage:"{sourceCollectionIcon} {sourceCollectionName}",id:"relationHelpers.autoInverseRelationWithIcon.name"},{sourceCollectionIcon:f,sourceCollectionName:h}):e.formatMessage({defaultMessage:"{sourceCollectionName}",id:"relationHelpers.autoInverseRelationSimple.name"},{sourceCollectionName:h});const b=a.getSchema();return b&&l?(0,r.Z)(y,(e=>!Object.values(b).find((t=>Boolean(t&&t.name===e))))):y}function I(e,t){var n,o;const{targetCollectionStore:i,isSelfRelation:a,sourceSchema:l,createUnique:u,from:m}=t,g=null===(n=i.getModel())||void 0===n||null===(n=n.getRenderIcon({getRecordModel:d.omK.constant(void 0)}))||void 0===n?void 0:n.icon,f=e.formatMessage({id:"relationHelpers.autoInverseRelation.untitledDatabase",defaultMessage:"Untitled Database"}),h=(null===(o=i.getModel())||void 0===o?void 0:o.getRenderTitle({getRecordModel:i.getRecordModel,userTimeZone:(0,s.r)(),intl:e}))||f,v=i.getDatabaseType();let y;if(a)if("subitem"===m){const t=(0,p.sN)(v,!0);y=e.formatMessage({defaultMessage:"Sub-{item}",id:"relationHelpers.autoSelfRelationNest.typedName"},{item:t})}else y="timeline_arrows_by"===m?e.formatMessage({defaultMessage:"Blocking",id:"relationHelpers.autoSelfRelationTimelineArrow.name"},{targetCollectionName:h}):e.formatMessage({defaultMessage:"Related {targetCollectionName}",id:"relationHelpers.autoSelfRelation.name"},{targetCollectionName:h});else y=g&&(0,c.Z)(g)?e.formatMessage({defaultMessage:"{targetCollectionIcon} {targetCollectionName}",id:"relationHelpers.autoRelationWithIcon.name"},{targetCollectionIcon:g,targetCollectionName:h}):e.formatMessage({defaultMessage:"{targetCollectionName}",id:"relationHelpers.autoRelation.name"},{targetCollectionName:h});const b=Object.values(l);return u?(0,r.Z)(y,(e=>!b.find((t=>Boolean(t&&t.name===e))))):y}function C(e){const t=(0,l.i)(e.getFormat(),e.getSchema(),void 0,a.j5.Relation);return t?t.collection_relation_options??{}:{}}function T(e){var t;const{collectionStore:n,property:o}=e;return(null===(t=C(n)[o])||void 0===t?void 0:t.related_properties)??[]}function M(e,t){return Object.entries(t).map((n=>{let[r,i]=n;if(!i||!(0,o.p_)(i))return;const a=(0,o.j0)(i),s=e.collectionStore();if(!a||a.id!==(null==s?void 0:s.pointer.id)||!s||!v(e,r,s))return;const l=i.property;if(!l)return;const c=t[l];if(!c||"relation"!==c.type)return;const d=(0,o.j0)(c);return d&&d.id===(null==s?void 0:s.pointer.id)?{propertyID:r,inversePropertyID:l}:void 0})).filter(u.$K)}function P(e,t){return M(e,t).map((e=>e.propertyID))}function A(e,t){const n=M(e,t),o=new Set,r=[];for(const{propertyID:i,inversePropertyID:a}of n)o.has(i)||o.has(a)||(r.push([i,a]),o.add(i),o.add(a));return r}function R(e,t){const n=(0,o.j0)(e);if(!n)return;const r=g.NW.createChildStore(t,n);return r?null==r?void 0:r.getFormat().app_config_uri:void 0}function D(e,t){const n=(0,o.j0)(e);if(!n)return;const r=new g.NW(t,n);return r?null==r?void 0:r.getSchema():void 0}function B(e,t){const n=(0,o.j0)(e);if(!n)return;const r=new g.NW(t,n);return r||void 0}function E(e){var t;if(e.patternName)return null===(t=e.integration.info)||void 0===t||null===(t=t.original_url_patterns)||void 0===t?void 0:t.filter((t=>{var n;return t.name===e.patternName&&(null===(n=t.additional_types)||void 0===n?void 0:n.connectedRelation)})).find((t=>{let{regex:n}=t;return new RegExp(n).test(e.url)}))}},177546:(e,t,n)=>{n.d(t,{Ez:()=>g,Gf:()=>v,Oc:()=>u,SD:()=>s,VW:()=>l,Wr:()=>p,eA:()=>h,hI:()=>d,n5:()=>y,xH:()=>c});n(757658);var o=n(869454),r=n(843250);const i=8,a={auto:!0,scroll:!0};function s(e){return e&&e instanceof HTMLElement?e:e&&e.parentElement?e.parentElement:void 0}function l(e){const t=s(e);if(t)return f(t,r.wKH)}function c(e){const t=s(e);if(t)return f(t,r.PBs)}function d(e){let t=e;const n=[];do{const e=window.getComputedStyle(t);e&&(e.overflow&&a[e.overflow]||e.overflowY&&a[e.overflowY]||e.overflowX&&a[e.overflowX])&&n.push(t),t=t.parentElement}while(t);return n}function u(e){const{environment:t,el:n,windowHeight:r,minEdgeDist:a=i}=e,s=l(n);if(!s||!s.getBoundingClientRect)return;const c=n.getBoundingClientRect(),d=s.getBoundingClientRect(),u=r-o.Z.mobileNativeBottomPadding(t),p=Math.min(d.bottom,u);c.top<d.top?s.scrollTop=s.scrollTop-(d.top-c.top)-a:c.bottom>p&&(s.scrollTop=s.scrollTop+(c.bottom-p)+a)}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{edgeDist:0,animate:!1};const n=l(e),{animate:o,edgeDist:r}=t;if(!n||!n.getBoundingClientRect)return;const i=e.getBoundingClientRect(),a=n.getBoundingClientRect();if(o){const e=500,t=n.scrollTop-(a.top-i.top)-r,o=n.scrollTop,s=t-o,l=16;let c=0;const d=()=>{var t,r,i;c+=l,n.scrollTop=(t=c,r=o,i=s,(t/=e/2)<1?i/2*t*t+r:-i/2*(--t*(t-2)-1)+r),c<e&&requestAnimationFrame(d)};d()}else n.scrollTop=n.scrollTop-(a.top-i.top)-r}function m(e){return e&&e.overflowY&&a[e.overflowY]}function g(e){if(!e)return;let t=e;if(t)do{const e=t.parentElement&&window.getComputedStyle(t.parentElement);if(e&&m(e))return t;t=t.parentElement||void 0}while(t);return document.body}function f(e,t){if(!e)return;let n=e;if(n)do{const e=window.getComputedStyle(n);if((n.classList&&n.classList.contains(r.OK_)&&n.classList.contains(t)||m(e))&&(!n.classList||!n.classList.contains(r.hBn)))return n;n=n.parentElement||void 0}while(n);return document.body}function h(e){return e.device.isDesktop&&!e.device.isSafari}function v(e){return e.device.isDesktop}function y(e){const{element:t,...n}=e,o=d(t),r=t.getBoundingClientRect();o.every((e=>{const t=e.getBoundingClientRect();return r.top>=t.top&&r.bottom<=t.bottom&&r.left>=t.left&&r.right<=t.right}))||t.scrollIntoView(n)}},645010:(e,t,n)=>{n.d(t,{Z:()=>o});const o={}},259139:(e,t,n)=>{function o(){return!1}function r(e){return"quickSearch"===e.RouterStore.state.route.name}n.d(t,{X:()=>o,b:()=>r})},897638:(e,t,n)=>{n.d(t,{AX:()=>K,De:()=>k,FN:()=>w,IV:()=>N,MQ:()=>j,MS:()=>R,Nu:()=>V,VA:()=>x,VD:()=>S,YB:()=>F,_Q:()=>M,b9:()=>E,bC:()=>L,dy:()=>z,g8:()=>O,gC:()=>A,oO:()=>Z,p6:()=>I,pG:()=>U,uL:()=>B,zD:()=>P});n(757658);var o=n(640506),r=n(407057),i=n(253877),a=n(842875),s=n(421202),l=n(492338),c=n(709291),d=n(653965),u=n(21359),p=n(80444),m=n(646735),g=n(843250),f=n(798165),h=n(367669),v=n(615447);function y(e){return Boolean(e&&e.length>0)}function b(e){return Boolean(e.starting||e.ending)}function _(e){return Boolean(e)}const S={requireEditPermissions:_,isDeletedOnly:_,excludeTemplates:_,navigableBlockContentOnly:_,ancestors:y,parentId:function(e){return void 0!==e},createdBy:y,editedBy:y,lastEditedTime:b,createdTime:b,isAdminModeDeletedPageSearch:_,blockTypes:function(e){return Boolean(e&&e.length>0)},inTeams:function(e){return y(l.iY(e))},includePublicPagesWithoutExplicitAccess:_,audience:function(e){return Boolean(e)},dev_excludedPages:y,dev_excludedTeams:y,databaseType:y,adminContentSearchDeletionStatus:y};function k(e){return e?{requireEditPermissions:S.requireEditPermissions(e.requireEditPermissions),isDeletedOnly:S.isDeletedOnly(e.isDeletedOnly),excludeTemplates:S.excludeTemplates(e.excludeTemplates),navigableBlockContentOnly:S.navigableBlockContentOnly(e.navigableBlockContentOnly),ancestors:S.ancestors(e.ancestors),parentId:S.parentId(e.parentId),createdBy:S.createdBy(e.createdBy),editedBy:S.editedBy(e.editedBy),createdTime:S.createdTime(e.createdTime),lastEditedTime:S.lastEditedTime(e.lastEditedTime),blockTypes:S.blockTypes(e.blockTypes),inTeams:S.inTeams(e.inTeams),dev_excludedPages:S.dev_excludedPages(e.dev_excludedPages),dev_excludedTeams:S.dev_excludedTeams(e.dev_excludedTeams)}:{requireEditPermissions:!1,isDeletedOnly:!1,excludeTemplates:!1,navigableBlockContentOnly:!1,ancestors:!1,parentId:!1,createdBy:!1,editedBy:!1,createdTime:!1,lastEditedTime:!1,blockTypes:!1,inTeams:!1,dev_excludedPages:!1,dev_excludedTeams:!1}}function w(e){const t=k(e);return Object.values(t).some((e=>Boolean(e)))}function x(e){const t=k(e),{navigableBlockContentOnly:n,...o}=t;return Object.values(o).some((e=>Boolean(e)))}function I(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.sF;const a=i.OQ.notionDateToLuxon(e,{locale:t.locale});return(0,r.Cp)(a,n)}function C(e,t){const n=i.OQ.notionDateTimeToLuxon(e,t.locale);return(0,r.ZW)(n,"medium_with_time")}const T=(0,c.defineMessages)({startAndEnd:{defaultMessage:"{startDate} - {endDate}",id:"searchHelpers.betweenStartAndEndDates"},afterStart:{defaultMessage:"After {startDate}",id:"searchHelpers.afterStartDate"},beforeEnd:{defaultMessage:"Before {endDate}",id:"searchHelpers.beforeEndDate"}});function M(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.sF,r="",i="";return e.starting&&(r="date"===e.starting.type?I(e.starting,t,n):C(e.starting,t)),e.ending&&(i="date"===e.ending.type?I(e.ending,t,n):C(e.ending,t)),r&&i?t.formatMessage(T.startAndEnd,{startDate:r,endDate:i}):r?t.formatMessage(T.afterStart,{startDate:r}):t.formatMessage(T.beforeEnd,{endDate:i})}function P(e){return Boolean(e.target&&e.target instanceof HTMLElement&&e.target.classList.contains("rdp-day"))}function A(e){const{input:t,spaceId:n,publicAccessPermissionAncestorBlockId:o,searchSessionId:r,searchSessionFlowNumber:i,source:a,forcedClusterPattern:s,searchExperimentOverrides:c,recentPagesForBoosting:d,forcedBlockIds:u,excludedBlockIds:p}=e,{query:m,limit:g,debug:f}=t;return n?{type:l.n8.BlocksInSpace,query:m.text.trim(),spaceId:n,limit:g,filters:m.filters,sort:m.sort,source:a||"quick_find",debug:f,searchExperimentOverrides:c,searchSessionId:r,searchSessionFlowNumber:i,forcedClusterPattern:s,recentPagesForBoosting:(0,v.Wk)(d),forcedBlockIds:u,excludedBlockIds:p}:o?{type:l.n8.BlocksInAncestor,query:m.text.trim(),ancestorId:o,filters:m.filters,sort:m.sort,limit:g,source:a||"quick_find_public",debug:f,searchExperimentOverrides:c,searchSessionId:r,searchSessionFlowNumber:i,forcedClusterPattern:s,forcedBlockIds:u,excludedBlockIds:p}:void 0}function R(e){const{environment:t}=e,n=A(e);return!!n&&u.search(t,n)}class D{constructor(e){this.startingTimestamp=void 0,this.endingTimestamp=void 0,this.startingTimestamp=e.starting&&i.uO(e.starting,(0,a.r)()),this.endingTimestamp=e.ending&&i.uO(e.ending,(0,a.r)())}matches(e){return void 0!==e&&(!(void 0!==this.startingTimestamp&&e<this.startingTimestamp)&&!(void 0!==this.endingTimestamp&&e>this.endingTimestamp))}}class B{constructor(e){this.filters=void 0,this.activeFilters=void 0,this.ancestorFilterIds=void 0,this.parentFilterId=void 0,this.createdTimeMatcher=void 0,this.lastEditedTimeMatcher=void 0,this.teamFilterIds=void 0,this.dev_notInTeamFilterIds=void 0,this.dev_notInPagesFilterIds=void 0,this.filters=e,this.activeFilters=k(e),this.ancestorFilterIds=new Set(e.ancestors),this.parentFilterId=e.parentId,this.createdTimeMatcher=new D(e.createdTime),this.lastEditedTimeMatcher=new D(e.lastEditedTime),this.teamFilterIds=new Set(l.iY(e.inTeams)??[]),this.dev_notInTeamFilterIds=new Set(e.dev_excludedTeams),this.dev_notInPagesFilterIds=new Set(e.dev_excludedPages)}matches(e){let{blockModel:t,path:n}=e;if(!Boolean(this.activeFilters.isDeletedOnly)!==t.alive)return!1;if(this.activeFilters.excludeTemplates&&t.is_template)return!1;if(this.activeFilters.editedBy){const e=t.last_edited_by_id||t.last_edited_by;if(!e||!this.filters.editedBy.includes(e))return!1}if(this.activeFilters.createdBy){const e=t.created_by_id||t.created_by;if(!e||!this.filters.createdBy.includes(e))return!1}if(this.activeFilters.ancestors&&!n.some((e=>{let{value:t}=e;return this.ancestorFilterIds.has(t.id)})))return!1;if(this.activeFilters.parentId){if(n.length<2)return!1;const[e,{value:{id:t}}]=n;return this.parentFilterId===t}if(this.activeFilters.lastEditedTime&&!this.lastEditedTimeMatcher.matches(t.last_edited_time))return!1;if(this.activeFilters.createdTime&&!this.createdTimeMatcher.matches(t.created_time))return!1;if(this.activeFilters.inTeams){var o;const e=f.KU(n),t=null==e||null===(o=e.value)||void 0===o?void 0:o.id;if(!t||!this.teamFilterIds.has(t))return!1}if(this.activeFilters.blockTypes){const e=this.filters.blockTypes;if(!e)return!0;if(!e.includes(t.type))return!1}return!0}}function E(e){if(e&&!e.error)return e.value}function F(e){let{sort:t,unsorted:n,batchSize:o,currentUserId:r}=e;const i=Date.now();if("relevance"!==t.field)return n;const a=d.yo(n,o).map((e=>m.Z.sortFrecencyHighToLow({items:e,now:i,currentUserId:r,recordFrecency:!0})));return d.xH(a)}function Z(e){const{localResults:t,serverResults:n}=e;if(t||n){if(t&&n){const e=new Set(t.map((e=>e.id)));return t.map((e=>{const t=(o=e.id,null==n?void 0:n.find((e=>e.id===o)));var o;const r=(null==(i=t)?void 0:i.originalPosition)??e.originalPosition;var i;const a=[...new Set([...e.badges??[],...(null==t?void 0:t.badges)??[]])];return{...e,originalPosition:r,serverEventProperties:(null==t?void 0:t.serverEventProperties)??e.serverEventProperties,sources:[...e.sources,...(s=t,(null==s?void 0:s.sources)??[])],badges:a};var s})).concat(n.filter((t=>!e.has(t.id))))}return t??n}}function U(e){var t,n,o,r;const{focusedIndexStore:i,searchResultStore:a}=e,s=Z({localResults:null===(t=a.state.localResults)||void 0===t?void 0:t.results,serverResults:null===(n=a.state.serverResults)||void 0===n?void 0:n.results}),l=null===(o=i.state)||void 0===o?void 0:o.global,c=null===(r=i.state)||void 0===r?void 0:r.local;if(void 0===l||void 0===c)return;const d=[...a.state.fixedActionResults??[],...a.state.queryBasedActionResults??[]],u=l<d.length?d[l]:void 0;if(u)return u;const p=l-d.length;if(!s||s.length<=0||p<0)return;const m=s[p];return m?{type:"page_result",value:{index:{global:l,local:c},selectedResult:m,allSearchResults:s}}:void 0}function V(e){const{existingResults:t,newPageResults:n}=e;if(void 0!==t||void 0!==n){if(t&&n){const e=[...t.results],o=new Set(t.results.map((e=>e.id)));return e.push(...n.results.filter((e=>!(e.sources.includes(l.vp.ElasticsearchRandom)&&e.originalPosition<t.results.length)&&!o.has(e.id)))),{...n,results:e,total:n.total}}return t??n}}function N(e){const{intentBasedGrouping:t,localResults:n,serverResults:o}=e,r=Z({localResults:n,serverResults:o})??[],i=r.filter((e=>e.sources.includes(l.vp.ElasticsearchUniqueID))),a=r.filter((e=>!e.sources.includes(l.vp.ElasticsearchUniqueID)));return t?{type:"intent-based-grouping",sections:{uniqueIdSearchResults:i,jumpBackInSearchResults:a.filter((e=>e.sources.includes(l.vp.Local))),serverOnlySearchResults:a.filter((e=>!e.sources.includes(l.vp.Local)))},allSearchResults:r}:i.length>0?{type:"unique-id",sections:{uniqueIdSearchResults:i,nonUniqueIdSearchResults:a},allSearchResults:r}:{type:"all",sections:{allSearchResults:r},allSearchResults:r}}function O(e,t){const n=e.device.isMobile?2:5;return t.slice(0,n)}function L(e){const{mainEditorCurrentBlockStore:t}=p.default.state,n=t&&h.IJ(e,t);return{hasPublicAccessPermission:Boolean(n),publicAccessPermissionAncestorBlockId:(null==n?void 0:n.from.table)===s.iU?null==n?void 0:n.from.blockId:void 0}}function j(e){let{environment:t,searchResultsSection:n,modalBodyMenu:o,searchFilterMenu:r,actionItemCount:i}=e;if(!n)return 0;let a=0;if(t.device.isMobile){if(o instanceof Element&&null!==r){const e=o.getElementsByClassName(g.GZn)[0];e instanceof Element&&(a=e.clientHeight-r.getClientHeight()+e.scrollTop)}}else a=n.getBoundingClientRect().height+n.scrollTop;let s=0,l=0;const c=n.getElementsByClassName(g.Xjk);for(let u=0;u<c.length;u++){l+=c[u].clientHeight}const d=n.getElementsByClassName(g.ulv);for(let u=0;u<d.length;u++){const e=d[u];if(!(a-l>e.clientHeight/2))break;s+=1,l+=e.clientHeight}return s-i}function K(e){if(void 0===e)return[];return e.map((e=>({id:e.id,score:e.score,localSource:e.localSource,sources:e.sources,spaceId:e.spaceId})))}function z(e){var t;if(void 0!==(null==e?void 0:e.highlightBlockId)&&void 0===(null===(t=e.highlight)||void 0===t?void 0:t.title))return e.highlightBlockId}},669645:(e,t,n)=>{n.d(t,{Bj:()=>h,D_:()=>_,Ib:()=>f,XL:()=>b,dq:()=>v,kC:()=>y,v5:()=>g});n(757658);var o=n(455010),r=n(45060),i=n(421202),a=n(95371),s=n(500374),l=n(401898),c=n(594419),d=n(95802),u=n(27724),p=n(721429),m=n(162619);function g(e,t){return(0,a.DY)(t,(t=>t.value.store===e))}function f(e,t){const n=g(e,[t]);if(n&&n.length>0)return n[n.length-1]}function h(e){const t=e.container??u.default.getCurrentDefaultContainer();if(!t)return new a.DG([]);const n=[];d.C.forEach((o=>{const r=o.getNode(),i=o.props.store;if(!r)return;if(o.getContextSelectableContainer()!==t)return;(o.props.canSelect||e.includeNonSelectableListContainer&&o.props.isListContainer)&&n.push({node:r,store:i,component:o})}));var r;return(r=n,(0,a.Yc)({values:r,compareOrder:(e,t)=>(0,o.Z)(e.node,t.node),isAncestor:(e,t)=>m.r3(e.node,t.node)}))||new a.DG([])}function v(e){const t=e.root||(0,p.RM)();if(t){const n=h(e);return new a.mp({store:t,node:void 0,component:void 0},n.children)}}function y(e){const{rootStore:t,root:n,target:o}=e,r=(0,a.DY)(n.children,(e=>e===o));if(void 0===r)return;const i=[t];let s=t;for(const a of r){const e=a.value.store;if(!e)return;const t=s.getTransclusionReferenceTargetStore()??s;let n=t.getContentStores();const o=t.getAutomationStore();if(o){const e=o.getActionStores();n=n.concat(e.flatMap((e=>e.getBlockStores())))}const r=n.find((t=>t.id===e.id));if(!r)return;i.push(r),s=r}return i}function b(e){var t;const{treeOperation:n,deleteFrom:o}=e,r=[],a=null===(t=n.deleteFromParent.value.store)||void 0===t?void 0:t.getContentStore(),s=n.deletingChildren.map((e=>e.value.store)).filter(l.$K);for(const l of s){const e=l.getRecordStoreUIParent(),t=e&&e.table===i.iU&&1===e.path.length&&"content"===e.path[0]&&e,n="record-store-parent"===o&&t||a;n&&r.push({parent:n,childToRemove:l})}return r}function _(e){const{transaction:t,treeOperation:n,deleteFrom:o,observer:r,preferHighLevelOperations:i}=e;switch(n.operation){case"delete":return void b({treeOperation:n,deleteFrom:o}).forEach((e=>{let{parent:o,childToRemove:i}=e;const a={parentStore:o,childToRemoveStore:i,transaction:t};c.Od(a),null==r||r.onRemove(n,a)}));case"insert":{var a;const e=n.insertIntoParent.value.store,o="transclusion_reference"===(null==e?void 0:e.getType())?e.getTransclusionReferenceTargetStore():e,r=null==o?void 0:o.getContentStore(),s=null===(a=n.adjacentSibling)||void 0===a?void 0:a.value.store,l=n.insertChildren.map((e=>e.value.store));("listAfter"===n.direction&&s||"listBefore"===n.direction&&!s)&&l.reverse();for(const a of l)if(r&&a)if("listAfter"===n.direction){const e={insertStore:a,parentStore:r,transaction:t,afterStore:s,preferHighLevelOperations:i};c.BE(e)}else{const e={insertStore:a,parentStore:r,transaction:t,beforeStore:s};c.Vt(e)}return}case"move":for(const e of(0,s.Z)(n))_({transaction:t,treeOperation:e,deleteFrom:o,observer:void 0,preferHighLevelOperations:i});return void(null==r||r.onMove(n));default:(0,l.t1)(n)}}!function(){const{span:e,object:t,div:n,CONTAINER_STYLE:o}=r.TI;(0,r.Rw)({canFormat:e=>Boolean(e&&e instanceof a.mp),header:(r,i)=>e(o,e({},t(r,{useDefaultFormatter:!0})),n({},t(r.value.store)),r.children.length?n({},t(r.children)):void 0),hasBody:(e,t)=>!1,body:e=>null})}()},273959:(e,t,n)=>{n.d(t,{J2:()=>m,Mn:()=>u,iZ:()=>h,mh:()=>g,sQ:()=>p,sY:()=>v,x7:()=>f});var o=n(541432),r=n(427534),i=n(80444),a=n(155367),s=n(188923),l=n(206258),c=n(27724),d=n(798165);function u(e){return!e.isPhone}function p(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&e instanceof l.G)return e;let t=e;for(;;){if(t=t.getRecordStoreUIParent(),!t)return;if(t&&t instanceof l.G&&t!==e)return t}}function m(e){const t=p(e);if(t)return d.Dg(t)}function g(e){const t=e.getType(),n=e.getFormat(),i=e.getModel(),a=e.getProperties();if(t&&i)return t&&(0,o.XD)(t,n)&&"factory"!==t&&!(0,o.S9)(t)?e.getBlockTitleStore():i.isInlineCollectionView()?e.getTitleStore():i.isType(o.oe)&&a&&a.caption?e.getCaptionStore():t===o.Ti.table?r.f8({simpleTableStore:e,rowIndex:0,columnIndex:0}):void 0}function f(e){const t=p(e);if(t)return t&&(t===i.default.state.mainEditorCurrentBlockStore||s.default.state.open&&t===s.default.state.targetStore)}function h(e){const{stores:t,phase:n}=c.default.state;return 1===t.length&&t[0]===e&&n===c.SelectionPhase.Editing}function v(e){const{stores:t,phase:n}=c.default.state,o=new Set(t.map((e=>e.id))),r=d.qA(e),i=o.has(e.id),s=r.some((e=>o.has(e.id))),l=i||s;return!(n!==c.SelectionPhase.Selected||!l||a.ZP.state.isDragging)}},889014:(e,t,n)=>{n.d(t,{u:()=>i,x:()=>r});const o=new Map;function r(e){return o.get(e)}function i(e,t){o.set(e,t)}},341984:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(606287);const r=function(e){return!(e.getParentTable()===o.vF)||e.isTemplate()}},128187:(e,t,n)=>{n.d(t,{F6:()=>m,Jk:()=>d,SG:()=>p,kC:()=>g,oI:()=>f});n(757658);var o=n(977657),r=n(563787),i=n(590965),a=(n(95477),n(80444)),s=n(385555),l=n(206258),c=n(798165);function d(e){const t=c.qA(e),n=[];for(const o of t)"block"===o.table&&n.push({blockStore:o,slackIntegrationStore:(0,l.Kv)(e,{table:r.s_,id:o.id})});for(const{blockStore:o,slackIntegrationStore:r}of n)if(r.isReady()){if(r.getKeyStore("enabled").getValue())return{blockStore:o,slackIntegrationStore:r}}return{blockStore:e,slackIntegrationStore:(0,l.Kv)(e,{table:r.s_,id:e.id})}}function u(){var e;const t=null===(e=a.default.state.currentSpaceStore)||void 0===e?void 0:e.getBotSettingsStore().getValue();return(0,i.hU)({spaceBotSettings:t,integrationId:o.nO,env:"production"})}function p(){return s.default.checkGate({gateName:"legacy_slack_notifications"})}function m(){return!!u()&&"on"===s.default.getGroup("notion-to-slack")}function g(){return!!u()&&"on"===s.default.getGroup("notion-mentions-to-slack")}function f(){return!!u()&&s.default.checkGate({gateName:"enable_notion_activity_notifications_in_slack"})}},548779:(e,t,n)=>{n.d(t,{G$:()=>Y,cJ:()=>le,zP:()=>_e,Q6:()=>Te,w3:()=>de,rg:()=>W,ly:()=>ce,g4:()=>ue,a2:()=>X,_o:()=>J,kO:()=>Me,KA:()=>ne,Wd:()=>re,ns:()=>ae,XD:()=>se,rn:()=>ie,TC:()=>he,lQ:()=>fe,C:()=>ye,Fn:()=>ve,di:()=>ge,Q9:()=>Se,kt:()=>Ce,Cx:()=>pe,XY:()=>Ae,Dj:()=>Pe,j9:()=>be,CV:()=>me,iX:()=>oe,Ib:()=>we,QS:()=>Ie,ww:()=>ke,cD:()=>xe});n(21703);var o=n(14577),r=n(815145),i=n(44317),a=n(977657),s=n(662193),l=n(959753),c=n(269246),d=n(421202),u=n(475246),p=n(519889),m=n(766079),g=n(328182),f=n(109852),h=n(590965),v=n(860949),y=n(653965),b=n(401898),_=n(403297),S=n(294273),k=n(640277),w=n(712321),x=n(165452),I=n(95477),C=n(883165),T=n(797448),M=n(775538);var P=n(394841),A=n(588310),R=n(80444),D=n(692425),B=n(385555),E=n(281236),F=n(206258),Z=n(313105),U=n(729226),V=n(88893),N=n(721429),O=n(304708),L=n(484210),j=n(433929),K=n(396691),z=n(35026),q=n(798165),H=n(165598),G=n(195697);async function W(e,t){var n;const o=e.currentUser.id,r=t.getSpaceStore();if(!r||!o)return;await t.load();t.hasRemoteSharedPages()||await x.l({environment:e,spaceId:r.id,userId:o});const i=(0,N.k_)(e).state;if(!i)return;const a=(0,z.B8)(),s=(0,z.DP)({sidebarOrder:a,sidebarState:i});for(const d of s)switch(d){case"favorites":return t.getBookmarkedPages()[0];case"teamspaces":const e=$(t);if(e)return e;break;case"shared":return i.visibleSharedPagesStores[0];case"private":const n=i.visiblePrivatePagesStores;if(n.length>0)return n[0];break;case"workspace":return t.getWorkspacePages()[0];default:(0,b.t1)(d)}const l=$(t);if(l)return l;const c=D.Z.getSharedPagesState({spaceId:r.id,userId:o}),u=null==c||null===(n=c.currentPageIds)||void 0===n?void 0:n[0];return u?F.G.createChildStore(r,{table:d.iU,id:u,spaceId:r.id}):void 0}function $(e){const t=e.getTeamsStores();for(const n of t){const e=n.getTeamPageStores();if(e.length>0)return e[0]}}const Y=7,Q=new s.Uw;function J(e){return Q.memo((()=>new o.ZP((()=>X(e)),{debugName:"pageContextStore"})),[e.environment,e.spaceViewStore,e.userSettingsStore,e.type])}function X(e){const{environment:t,spaceViewStore:n,userSettingsStore:o,type:r}=e,i=n.getSpaceId(),a="shared"===r?ne(t,n):function(e,t){const n=t.getPrivatePages(e),o=(0,z.Wu)({spaceViewStore:t});if(o)return ee(n);return n}(t,n);if(!i)return{allPagesStores:a,visiblePagesStores:a};if("private"===r||"shared"===r&&(0,O.mq)(t)){const e=(0,z.S4)({spaceViewStore:n,type:r});return{allPagesStores:a,visiblePagesStores:e.truncationLimit===c.Ng?a:a.slice(0,e.truncationLimit)}}if(!o.hasUserPinnedToOutliner({type:z.iE[r],spaceId:i}))return{allPagesStores:a,visiblePagesStores:a.slice(0,Y)};const s=new Set(a.map((e=>{let{id:t}=e;return t})));return{allPagesStores:a,visiblePagesStores:n.getPinnedSharedPages().filter((e=>{let{id:t}=e;return s.has(t)}))}}function ee(e){const t=e.map((e=>{if(!e.isDefined())return;const t=e.getLastEditedTime()||e.getCreatedTime();return t?{store:e,timestamp:t}:void 0})).filter(b.$K);return y.MR(t,(e=>{let{timestamp:t}=e;return t})).reverse().map((e=>e.store))}const te=new s.Uw;function ne(e,t){const n=e.currentUser.id,o=t.getSpaceStore();if(o&&n){const r=D.Z.getSharedPagesState({spaceId:o.id,userId:n}),i=r&&r.currentPageIds?r.currentPageIds:[],a=te.memo((()=>function(e,t){return new Z.P({debugName:"isValidSharedRemotePage",memoizeRecursion:!1,deepEquals:!1,compute:function(n){const o=e.currentUser.id;if(!o)return!1;const r=(0,C.VK)(t,o),i=(0,q.u3)(n);let a=!1;return i&&((0,H.OY)(i)?a=!(0,G.bq)()&&e.currentUser.id&&t.isDefined()&&n.hasSpacePermission()?Boolean(r.isMember()):i.id!==n.id&&i.canRead():(0,H.Y)(i)&&(a=Boolean(i.isMemberOrGuest(e.currentUser.id))&&i.canRead())),!(!((0,H.Oh)(n)&&n.canRead()&&n.isNavigableBlock()&&n.isSharedPage(t,e))||(0,q.wf)(n)||a)}})}(e,o)),[e,o]),s=y.oA(i.map((e=>{const t=F.G.createChildStore(o.getPagesStore(),{table:d.iU,id:e,spaceId:o.id});if(a.getStateFor(t))return t}))),l=new Set(s.map((e=>e.id)));let c;const u=t.getSharedPageStores(),p=0===u.length;if(p){c=se(e,o).filter((e=>{l.has(e.id)}))}else c=u.filter((e=>!(0,q.wf)(e)&&l.has(e.id)));(0,A.As)({use_legacy_shared_pages_ordering:p&&c.length>0});const m=[...c,...s],g=y.mN(m,(e=>e.id));if((0,O.mq)(e)){const{sortOption:e}=(0,z.S4)({spaceViewStore:t,type:"shared"});if("lastEdited"===e)return ee(g)}return g}return[]}async function oe(e){const{disableRedirectUrl:t,environment:n,blockNoAccessRedirect:o}=e;n.device.isMobileNative&&(0,T.fastCheckGate)("mobile_app_launch_blank_page")||await w.w();const{id:i}=n.currentUser,{url:a,spaceId:s,route:c}=await S.Ie(n),d=_.qd(i),h=k.th(i),v=f.DD();if(!i)throw new Error("User not logged in.");const x=new F.U6(n,{table:p.KJ,id:i}),I=new F.r9(n,{table:m.dx,id:i}),C=new F.vO(n,{table:g.Sr,id:i}),[M,A]=await Promise.all([x.awaitNonNullValue(),I.awaitNonNullValue(),C.awaitNonNullValue()]),R=s?de(s):void 0,D=function(e){const{environment:t,lastVisitedUrl:n}=e,o=t.RouterStore.state.initialRoute;if("page"===o.name)return{url:n,isPersonalHomeUrl:!1};if(t.device.isMobileNative&&t.device.isPhone&&(0,T.fastCheckGate)("mobile_app_launch_blank_page"))return{url:"/blank",isPersonalHomeUrl:!1};return function(e){const{environment:t,lastVisitedUrl:n,lastVisitedSpaceView:o,lastVisitedSpace:i}=e,a=ue(t,{space:null==i?void 0:i.getModel(),spaceView:null==o?void 0:o.getModel()});switch(a){case"last_visited_page":return n?{url:n,isPersonalHomeUrl:!1}:void 0;case"first_page":case"chat":return;case"personal_home":if(!o)return;const e=P.Al(o);if(!e)return;return{url:(0,L.ZP)({store:e,preferPublicLink:!1,pageVisitSource:r.tY.DefaultHome}),isPersonalHomeUrl:!0};default:(0,b.t1)(a)}}(e)}({environment:n,lastVisitedUrl:a,lastVisitedSpaceView:R,lastVisitedSpace:s?F.H2.createChildStore(I,{table:u.bx,id:s}):void 0}),E=null==D?void 0:D.url,Z=!!M&&Boolean(M.onboarding_completed),U=function(e){const{userValue:t}=e;if(!t)return!1;if(Boolean(t.mobile_onboarding_completed))return!0;const n=t.email,o=B.default.getConfigKey("qa_skip_mobile_onboarding","subaddress");if(!o||0===o.length)return!1;const r=n.split("@");if(r.length<2)return!1;const i=r[0].split("+");if(i.length<2)return!1;return i[1].includes(o)}({userValue:M}),V=function(e,t){const n=l.kk5.fromValue(m.dx,e),o=n.getSpaceViewPointers();return o&&o.length>0?F.V9.createChildStore(t,o[0]):void 0}(A,I);V&&await V.load();const N=V?V.getSpaceStore():void 0;if(c&&!t){const e=await k.Jv({environment:n,request:{type:"block-space",...c}}).next();if(e.value){const t=e.value,r="page"===c.name?c.blockId:void 0;let i=!1;if(o&&"page"===c.name){const{blockId:e,spaceId:t}=c,o=new F.G(n,{table:"block",id:e,spaceId:t});await o.load(),i="none"===o.getRole()}const s=["read_and_write","comment_only","reader"].includes(t.publicAccessRole);if(!i&&t&&!y.xb(t)&&(t.canJoinSpace||t.userHasExplicitAccess||!s))return{userStore:x,userSettingsStore:C,userRootStore:I,firstSpace:N,firstSpaceView:V,lastVisitedSpaceView:R,redirectUrl:E,forkPageBlockId:d,publicAccessPageId:h,oauthAuthorizationParams:v,redirectPageId:r,hasExplicitAccessToRedirectPage:t.userHasExplicitAccess,canRequestAccessToRedirectPage:t.canRequestAccess,redirectSpaceName:t.spaceName,redirectSpaceId:t.spaceId,canJoinRedirectSpace:t.canJoinSpace,onboardingCompleted:Z,mobileOnboardingCompleted:U,isPersonalHomeRedirect:(null==D?void 0:D.isPersonalHomeUrl)??!1,lastVisitedUrl:a}}}return{userStore:x,userSettingsStore:C,userRootStore:I,firstSpace:N,firstSpaceView:V,lastVisitedSpaceView:R,forkPageBlockId:d,publicAccessPageId:h,oauthAuthorizationParams:v,redirectUrl:void 0,redirectPageId:void 0,hasExplicitAccessToRedirectPage:void 0,canRequestAccessToRedirectPage:void 0,redirectSpaceId:void 0,canJoinRedirectSpace:void 0,onboardingCompleted:Z,mobileOnboardingCompleted:U,redirectSpaceName:void 0,isPersonalHomeRedirect:!1,lastVisitedUrl:void 0}}function re(e,t){return F.t1.fromV1(t).getIcon()}function ie(e,t){const n=t.getName(),o=j.default.getIntl().formatMessage({defaultMessage:"Untitled workspace",id:"spaceHelpers.getSpaceName.untitledWorkspace.name"});if(n)return n||o;{const n=E.Z.getData(e,{spaceId:t.id});if(n)return n.name||o}return o}function ae(e,t){const n=e.currentUser.id,o=t.getPagesStore().getValue();if(o&&n){const e=U.Z.getSpaceInaccessiblePages(t.id,n);return e?o.filter((t=>!e.has(t))):o}return[]}function se(e,t){const n=t.getPagesStore();return ae(e,t).map((e=>F.G.createChildStore(n,{table:d.iU,id:e})))}function le(e,t,n){const o=E.Z.getData(e,{spaceId:t}),r=!Boolean(null==o?void 0:o.domainIsAutogenerated),i=y.oA([r&&(null==o?void 0:o.domain),"invite",n]).join("/");return`${I.default.domainBaseUrl}/${i}`}function ce(e){let{environment:t,spaceStore:n,subscriptionData:o}=e;if(!n.canEditMembership())return;const r=n.id,i=o&&("subscribed_admin"===o.type||"unsubscribed_admin"===o.type||"subscribed_membership_admin"===o.type)&&o.inviteLinkCode;return i?le(t,r,i):void 0}function de(e){const{currentUserRootStore:t}=R.default.state;return null==t?void 0:t.getSpaceViewStores().find((t=>t.getSpaceId()===e))}function ue(e,t){var n;let{space:o,spaceView:r}=t;const i=function(e,t){var n,o;if(null!==(n=e.mobileNative)&&void 0!==n&&n.supportsNativeHomeOnPhone())return{setting:"last_visited_page",fromExplicitSetting:!1};const r=null==t||null===(o=t.getSettings())||void 0===o?void 0:o.on_app_start;if((0,b.$K)(r))return{setting:r,fromExplicitSetting:!0};const{isPhone:i,isMobileNative:a}=e.device,s=!(i&&a||function(){const e=R.default.state.spaceTransitionStatus;let t;switch(e){case"joiningOrCreatingSpace":t=!0;break;case"switchingToOrLoadingSpace":case"notTransitioning":t=!1;break;default:(0,b.t1)(e)}return t||M.default.state.isOnboarding}());return{setting:s?"personal_home":"last_visited_page",fromExplicitSetting:!1}}(e,r);if("personal_home"!==i.setting){const e=i.setting;return(0,K.pJ)({spaceView:r,preference:e}),e}const a=null==r?void 0:r.getSpaceId(),s=null==r?void 0:r.getUserId(),l=!B.default.isStatsigEnabledAndInitialized()||!a||!s||a!==(null===(n=R.default.state.currentSpaceStore)||void 0===n?void 0:n.id)||s!==e.currentUser.id;let c;c=i.fromExplicitSetting?l?function(e){var t;const n=null==e||null===(t=e.getPersonalHomeSettings())||void 0===t?void 0:t.home_landing_page_enabled;switch(n){case"home_landing_page_with_default":case"home_landing_page_without_default":return!0;case"no_home_landing_page":case void 0:return!1;default:(0,b.t1)(n)}}(r):(0,G.QI)():l?function(e){var t;const n=null==e||null===(t=e.getPersonalHomeSettings())||void 0===t?void 0:t.home_landing_page_enabled;switch(n){case"home_landing_page_with_default":return!0;case"home_landing_page_without_default":case"no_home_landing_page":case void 0:return!1;default:(0,b.t1)(n)}}(r):(0,G.MS)(o);const d=c?"personal_home":"last_visited_page";return(0,K.pJ)({spaceView:r,preference:d}),d}function pe(e){return!!e&&!e.canRead()}function me(e){return!!e&&e.getZeroRetentionEnabled()}function ge(e,t){const n=(0,V.CM)(t)||[],o=e.currentUser.id;for(const r of n)if(r.userId===o&&"none"===r.role&&r.isTeamGuest)return!0;return!1}function fe(e){return!!e&&e.canAdmin()}function he(e){let{spaceStore:t,groupId:n}=e;return((null==t?void 0:t.getPermissionGroups())||[]).find((e=>e.id===n))}function ve(e){const t=R.default.state.currentSpaceStore,n=e.currentUser.id;return Boolean(t&&n&&(0,C.VK)(t,n).isWorkspaceOwner())}function ye(){const e=R.default.state.currentSpaceStore;return!(null==e||!e.isDefined())&&"enterprise"===e.getSubscriptionTier()}function be(e){const t=e.getSubscriptionTier();return"plus"===t||"business"===t||"enterprise"===t}function _e(e){const t=null==e?void 0:e.getCreatedTime();return t?(0,i.O5)(t):null}function Se(e){const t=_e(e);return null!==t&&t<=7}function ke(e){return(0,b.lm)(e)&&"none"!==e.role?e.planType:void 0}function we(e){return(0,b.lm)(e)&&"none"!==e.role?e.createdTime:void 0}function xe(e){return(0,b.lm)(e)&&"none"!==e.role?e.subscriptionTier:void 0}function Ie(e){return(0,b.lm)(e)&&"none"!==e.role?e.memberCount:void 0}function Ce(e){return B.default.checkGate({gateName:"guest_invite_requests"})&&(null==e?void 0:e.getEnableGuestInviteRequest())}function Te(e){return Boolean(Ce(e))&&!Boolean(null==e?void 0:e.canAdmin())}function Me(){const e="on"===B.default.getEligibleGroup({experimentId:"read_persona_survey_data_from_space",defaultGroup:"control"}),{currentUserSettingsStore:t,currentSpaceStore:n,currentSpaceViewStore:o}=R.default.state;if(e){var r,i,a,s,l,c,d,u;const e=null==n?void 0:n.getSpaceSurveyData(),t=null==o?void 0:o.getUserSurveyData();return{function:null==t||null===(r=t.function)||void 0===r?void 0:r.value,role:(0,v.Bt)(null==t||null===(i=t.role)||void 0===i?void 0:i.value),educationRole:null==t||null===(a=t.education_role)||void 0===a?void 0:a.value,educationLevel:null==t||null===(s=t.education_level)||void 0===s?void 0:s.value,useCases:null==e||null===(l=e.use_cases)||void 0===l?void 0:l.value,companySize:null==e||null===(c=e.company_size)||void 0===c?void 0:c.value,intent:"planSelection"in M.default.state?M.default.state.planSelection:(null==e||null===(d=e.intent)||void 0===d?void 0:d.value)??void 0,categories:null==t||null===(u=t.categories)||void 0===u?void 0:u.value}}var p,m,g,f;return{intent:"planSelection"in M.default.state?M.default.state.planSelection:void 0,function:null==t||null===(p=t.getSettings())||void 0===p?void 0:p.persona,role:null==t||null===(m=t.getSettings())||void 0===m?void 0:m.team_role,useCases:null==t||null===(g=t.getSettings())||void 0===g?void 0:g.use_cases,companySize:null==t||null===(f=t.getSettings())||void 0===f?void 0:f.company_size,educationRole:void 0,educationLevel:void 0,categories:void 0}}function Pe(e){return e.getSetting("disable_notion_calendar")}function Ae(e){let{env:t,spaceStore:n}=e;return!(0,h.hU)({spaceBotSettings:n.getBotSettings(),integrationId:a.Dv,env:t})||pe(n)||Pe(n)}},516639:(e,t,n)=>{n.d(t,{N5:()=>m,kF:()=>d,kQ:()=>u,rm:()=>p});var o=n(772141),r=n(519889),i=n(709291),a=n(653965),s=n(883165),l=n(820454);const c=(0,i.defineMessages)({untitledGroupName:{defaultMessage:"Untitled",id:"spaceBasicSettings.spacePermissionsSettings.groupsTab.defaultNewGroupName"}});function d(e){const{intl:t,group:n}=e;return n.name||t.formatMessage(c.untitledGroupName)}function u(e){const{group:t,spaceStore:n}=e;return(t.user_ids||[]).filter((e=>{var t;return null===(t=(0,s._P)(n,e))||void 0===t?void 0:t.isMember()}))}function p(e){const{group:t,spaceStore:n,limit:o}=e,i=u({group:t,spaceStore:n}),s=i.length;if(!n)return{countRemainingUsers:0,totalNumberMembers:s,limitedUserStores:[]};const c=o?i.slice(0,o):i;return{limitedUserStores:a.oA(i.map((e=>l.U.createChildStore(n,{table:r.KJ,id:e})))),countRemainingUsers:i.length-c.length,totalNumberMembers:s}}function m(e){let{userStores:t,spaceStore:n,intl:r}=e;return a.MR(t,(e=>e.getSearchName(r))).sort(((e,t)=>{if(!n)return 0;const r=(0,s.VK)(n,e.id).getMembershipTypeAsRoleOrNone(),i=(0,s.VK)(n,t.id).getMembershipTypeAsRoleOrNone();return r&&i?o.Av.indexOf(i)-o.Av.indexOf(r):0}))}},915517:(e,t,n)=>{n.d(t,{ZL:()=>m,lr:()=>c,mn:()=>p,sK:()=>l});var o=n(568626),r=n(915157),i=n(619584),a=n(30021),s=n(646735);async function l(){if("storage"in navigator&&"estimate"in navigator.storage){const{quota:e,usage:t}=await navigator.storage.estimate();if("number"==typeof e&&"number"==typeof t)return{quota:e,usage:t}}if("webkitPersistentStorage"in navigator){const e=navigator.webkitPersistentStorage;if("queryUsageAndQuota"in e)return new Promise((t=>{e.queryUsageAndQuota(((e,n)=>{t("number"==typeof n&&"number"==typeof e?{usage:e,quota:n}:void 0)}),(()=>t(void 0)))}))}}async function c(){if(navigator.storage&&navigator.storage.persist)try{const e=await navigator.storage.persist();return o.clientLogglyEnvironmentData.isPersistent=e,e}catch(e){console.trace("Persistence is disabled",e)}}const d=.9,u=15*i.js;function p(e){const{quota:t,usage:n}=e;return n/t<=d&&t>=u}function m(e){const t=a.Z.state;e?(s.Z.clearForUser(e),r.Z.clearStorageForUser(e)):localStorage.clear(),a.Z.setState(t)}},475024:(e,t,n)=>{n.d(t,{Dp:()=>s,jy:()=>u,mK:()=>i,pd:()=>l,wK:()=>c,x6:()=>d,yv:()=>a});var o=n(401898),r=n(137810);const i={listStyleType:"none",padding:0,margin:0};r.Z.fontWeight.regular;function a(e,t){const n="UIRegular"===t?r.Z.fontSize.UIRegular:"UISmall"===t?r.Z.fontSize.UISmall:(0,o.t1)(t);return e.device.isMobile?n.mobile:n.desktop}function s(e,t){const n="UIRegular"===t?r.Z.lineHeight.UIRegular:"UISmall"===t?r.Z.lineHeight.UISmall:(0,o.t1)(t);return e.device.isMobile?n.mobile:n.desktop}function l(e){return{display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical",WebkitLineClamp:e}}function c(e){let{topLeft:t,topRight:n,bottomLeft:o,bottomRight:r}=e;return[t,n,r,o].map((e=>e?`${e}px`:"0")).join(" ")}function d(e){let{width:t,color:n}=e;if(t>1){const e=(t-.5)/2;return{boxShadow:`0px 0px 0px ${e}px ${n}, inset 0px 0px 0px ${e}px ${n}`,borderWidth:.5,borderColor:n}}return{boxShadow:`0px 0px 0px 0px ${n}, inset 0px 0px 0px 0.5px ${n}`,borderWidth:.5,borderColor:n}}const u={position:"absolute",overflow:"hidden",clip:"rect(1px, 1px, 1px, 1px)",whiteSpace:"nowrap",height:1,width:1}},52315:(e,t,n)=>{function o(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e.isReady())return!1;if(n[e.id])return!0;if(n[e.id]=!0,i(e,t))return!0;const r=e.getContentStores();let a=!0;for(const i of r)o(i,!1,n)||(a=!1);return a}async function r(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(await e.load(),n[e.id])return;if(n[e.id]=!0,i(e,t))return;const o=e.getContentStores();await Promise.all(o.map((e=>r(e,!1,n))))}function i(e,t){return!(!e.isPageBlock()||t)||!!e.isCollectionView()}n.d(t,{b:()=>o,r:()=>r})},932363:(e,t,n)=>{n.d(t,{Ng:()=>f,ni:()=>g,wY:()=>u});n(667294);var o=n(977657),r=n(959753),i=n(544876),a=n(709291),s=n(401898),l=n(530874),c=n(433929),d=n(785893);function u(e,t){const n=p(e),o=null==n?void 0:n.name,r=function(e,t){if(!e)return;const n=(0,i.ny)({url:e,integrations:l.Z.integrations.state,currentSpaceId:t});if("success"!==n.type)return;if(!n.pattern.collectionItemType)return;switch(n.pattern.collectionItemType){case"project":return(0,d.jsx)(a.FormattedMessage,{defaultMessage:"Project",id:"syncedCollectionIndicators.project.label"});case"pull_request":return(0,d.jsx)(a.FormattedMessage,{defaultMessage:"Pull Requests",id:"syncedCollectionIndicators.pullRequests.label"});case"issue":return(0,d.jsx)(a.FormattedMessage,{defaultMessage:"Issues",id:"syncedCollectionIndicators.issues.label"});case"calendar":return(0,d.jsx)(a.FormattedMessage,{defaultMessage:"Calendar",id:"syncedCollectionIndicators.calendar.label"});case"release":return(0,d.jsx)(a.FormattedMessage,{defaultMessage:"Releases",id:"syncedCollectionIndicators.releases.label"});default:(0,s.t1)(n.pattern.collectionItemType)}}(e,t);return r?o?(0,d.jsx)(a.FormattedMessage,{id:"syncedCollectionIndicators.originalUrlWithIntegration",defaultMessage:"{collectionType} in {integrationName}",values:{integrationName:o,collectionType:r}}):(0,d.jsx)("span",{children:o}):(0,d.jsx)(a.FormattedMessage,{defaultMessage:"Link to original url",id:"syncedCollectionIndicators.originalUrl"})}function p(e,t){if(!e)return;const n=(0,i.ny)({url:e,integrations:l.Z.integrations.state,currentSpaceId:t});return"success"===n.type?n.integration:void 0}const m=(0,a.defineMessages)({github_pull:{defaultMessage:"Oauth Pull Request",id:"syncedCollectionIndicators.oauthGithubPullRequest.label"},github_issue:{defaultMessage:"Oauth Issue",id:"syncedCollectionIndicators.oauthGithubIssue.label"},Event:{defaultMessage:"Event",id:"syncedCollectionIndicators.event.label"},figma_file:{defaultMessage:"File",id:"syncedCollectionIndicators.figmaFile.label"},google_drive_file:{defaultMessage:"File",id:"syncedCollectionIndicators.googleDriveFile.label"},zendesk_ticket:{defaultMessage:"Ticket",id:"syncedCollectionIndicators.zendeskTicket.label"},salesforce_account:{defaultMessage:"Account",id:"syncedCollectionIndicators.salesforceAccount.label"},salesforce_contact:{defaultMessage:"Contact",id:"syncedCollectionIndicators.salesforceContact.label"},salesforce_opportunity:{defaultMessage:"Opportunity",id:"syncedCollectionIndicators.salesforceOpportunity.label"}});function g(e){const{pattern:t,integration:n}=e;return`${r.kk5.isAnyModel(n)?n.getName():n.name} ${function(e){switch(e.name){case"Event":return c.default.formatMessage(m.Event);case"figma_file":return c.default.formatMessage(m.figma_file);case"github_pull":return c.default.formatMessage(m.github_pull);case"github_issue":return c.default.formatMessage(m.github_issue);case"google_drive_file":return c.default.formatMessage(m.google_drive_file);case"zendesk_ticket":return c.default.formatMessage(m.zendesk_ticket);default:return e.name}}(t)}`}function f(e){const t=p(e);return(null==t?void 0:t.id)===o.mC}},178122:(e,t,n)=>{n.d(t,{A8:()=>d,Bj:()=>v,Bt:()=>_,Fy:()=>g,T0:()=>p,Xg:()=>b,ZH:()=>u,hC:()=>y,hL:()=>h,iT:()=>m,wG:()=>f});n(667294);var o=n(709291),r=n(653965),i=n(401898),a=n(986080),s=n(547307),l=n(195697),c=n(785893);async function d(e){let{isCurrentUser:t,teamName:n,memberName:r}=e;return await s.confirmUserAction({message:t?(0,c.jsx)(o.FormattedMessage,{defaultMessage:"Are you sure you want to leave {teamName}?",id:"teamActions.leaveTeam.confirmDialogMessage.removingYourself",values:{teamName:n}}):(0,c.jsx)(o.FormattedMessage,{id:"teamActions.leaveTeam.confirmDialogMessage.removingSomeoneElse",defaultMessage:"Are you sure you want to remove {memberName} from {teamName}?",values:{memberName:r,teamName:n}}),description:t?(0,c.jsx)(o.FormattedMessage,{id:"teamActions.leaveTeam.confirmDialogDescription.removingYourself",defaultMessage:"You'll no longer see this teamspace in your sidebar and you may lose permissions to the teamspace's pages."}):(0,c.jsx)(o.FormattedMessage,{id:"teamActions.leaveTeam.confirmDialogDescription.removingSomeoneElse",defaultMessage:"This change won't apply to any restricted pages in the teamspace."}),acceptLabel:t?(0,c.jsx)(o.FormattedMessage,{defaultMessage:"Leave Teamspace",id:"teamActions.leaveTeam.confirmDialogAcceptLabel.removingYourself"}):(0,c.jsx)(o.FormattedMessage,{defaultMessage:"Remove",id:"teamActions.leaveTeam.confirmDialogAcceptLabel"}),cancelLabel:(0,c.jsx)(o.FormattedMessage,{id:"teamActions.leaveTeam.confirmDialogCancelLabel.removingSomeoneElse",defaultMessage:"Cancel"})})}function u(){s.showMessage({message:(0,c.jsx)(o.FormattedMessage,{id:"teamActions.leaveTeam.onlyTeamMemberLeftDialogMessage",defaultMessage:"Invite another teamspace owner to leave this teamspace"})})}function p(e){s.showMessage({message:(0,c.jsx)(o.FormattedMessage,{id:"teamActions.leaveTeam.userMembershipFromGroupDialogMessage",defaultMessage:"You can't leave this teamspace because you're a member of {groupNames}.",values:{groupNames:r.oA(e.map((e=>`"${e.name}"`))).join(", ")}})})}function m(e){var t;let{group:n,onAccept:r}=e;s.showDialog({message:n.name?(0,c.jsx)(o.FormattedMessage,{id:"TeamSettings.groups.removeGroupModal.title",defaultMessage:"Are you sure you want to remove {groupName}?",values:{groupName:n.name}}):(0,c.jsx)(o.FormattedMessage,{id:"TeamSettings.groups.removeGroupModal.title.noGroupName",defaultMessage:"Are you sure you want to remove this group?"}),description:(0,c.jsx)(o.FormattedMessage,{id:"TeamSettings.groups.removeGroupModal.description",defaultMessage:"{numGroupMembers} {numGroupMembers, plural, one {member} other {members}} from this group will be removed from this teamspace.",values:{numGroupMembers:(null===(t=n.user_ids)||void 0===t?void 0:t.length)||0}}),showCancel:!0,keepFocus:!1,handleCancel:s.dismissDialog,items:[{label:(0,c.jsx)(o.FormattedMessage,{id:"TeamSettings.groups.removeGroupModal.confirmationButton",defaultMessage:"Remove group"}),color:"red",onAccept:r}]})}async function g(e,t){return await a.b({title:(0,c.jsx)(o.FormattedMessage,{id:"teamActions.archiveTeam.confirmDialogTitle",defaultMessage:"Are you sure you want to archive this teamspace?"}),message:t?(0,c.jsx)(o.FormattedMessage,{id:"teamActions.archiveTeam.transitionToZeroTeams.confirmDialogDescription",defaultMessage:'This is your last default teamspace. Archiving will remove the "Teamspaces" section in your sidebar. Type the teamspace name to confirm.'}):(0,c.jsx)(o.FormattedMessage,{id:"teamActions.archiveTeam.confirmDialogDescription",defaultMessage:"Archiving this teamspace will remove access and hide it in the sidebar for all teamspace members. Type the teamspace name to confirm."}),acceptLabel:(0,c.jsx)(o.FormattedMessage,{id:"teamActions.archiveTeam.confirmDialogAcceptLabel",defaultMessage:"Archive teamspace"}),requiredInputValue:e,width:432})}async function f(e){return await s.confirmUserAction({message:(0,c.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:(0,c.jsx)(o.FormattedMessage,{id:"teamActions.movePagesFromArchivedTeam.confirmDialogTitle",defaultMessage:'Would you like to move pages under {teamName} to the "Private" and "Shared" sections in your sidebar?',values:{teamName:e}})}),acceptLabel:(0,c.jsx)(o.FormattedMessage,{id:"teamActions.movePagesFromArchivedTeam.confirmDialogAcceptLabel",defaultMessage:"Move pages"}),cancelLabel:(0,c.jsx)(o.FormattedMessage,{id:"teamActions.movePagesFromArchivedTeam.confirmDialogCancelLabel",defaultMessage:"Proceed without moving pages"})})}async function h(e){let{teamName:t,currentIsDefault:n,accessLevel:r,isDefault:a,numberOfTeamGuests:l}=e;const d=(0,c.jsx)("div",{style:{marginTop:8},children:(0,c.jsx)(o.FormattedMessage,{id:"teamActions.confirmTeamAccessDialog.disableDefaultTeamLabel",defaultMessage:"{teamName} will also no longer be a default teamspace and auto-add workspace members.",values:{teamName:t}})});let u,p;return"private"===r?(u=(0,c.jsx)(o.FormattedMessage,{defaultMessage:"Are you sure you want to make {teamName} private?",id:"teamActions.confirmTeamAccessChangeDialog.privateTeam.titleWithName",values:{teamName:t}}),p=(0,c.jsxs)("div",{children:[(0,c.jsx)(o.FormattedMessage,{id:"teamActions.teamScreen.privateTeam.description",defaultMessage:"Only members will be able to see the teamspace and its content."}),n&&d]})):a?l>0?(u=(0,c.jsx)(o.FormattedMessage,{id:"teamActions.confirmTeamAccessChangeDialog.defaultTeamWithGuests.titleWithName",defaultMessage:"Are you sure you want to make {teamName} a default teamspace?",values:{teamName:t}}),p=(0,c.jsx)(o.FormattedMessage,{id:"teamActions.teamScreen.defaultTeamWithGuests.description",defaultMessage:"Everyone in the workspace and future workspace members will be added to this teamspace. Additionally, {numberOfTeamGuests} teamspace guests will be removed.",values:{numberOfTeamGuests:l}})):(u=(0,c.jsx)(o.FormattedMessage,{id:"teamActions.confirmTeamAccessChangeDialog.defaultTeam.titleWithName",defaultMessage:"Are you sure you want to make {teamName} a default teamspace?",values:{teamName:t}}),p=(0,c.jsx)(o.FormattedMessage,{id:"teamActions.teamScreen.defaultTeam.description",defaultMessage:"Everyone in the workspace and future workspace members will be added to this teamspace."})):"open"===r?(u=(0,c.jsx)(o.FormattedMessage,{defaultMessage:"Are you sure you want to make {teamName} open?",id:"teamActions.confirmTeamAccessChangeDialog.openTeam.titleWithName",values:{teamName:t}}),p=(0,c.jsxs)("div",{children:[!n&&(0,c.jsx)(o.FormattedMessage,{id:"teamActions.teamScreen.openTeam.description",defaultMessage:"Everyone in the workspace will have access to the teamspace and its content."}),n&&d]})):"closed"===r?(u=(0,c.jsx)(o.FormattedMessage,{defaultMessage:"Are you sure you want to make {teamName} closed?",id:"teamActions.confirmTeamAccessChangeDialog.closedTeam.titleWithName",values:{teamName:t}}),p=(0,c.jsxs)("div",{children:[(0,c.jsx)(o.FormattedMessage,{id:"teamActions.teamScreen.closedTeam.description",defaultMessage:"The teamspace will still be discoverable, but joining will be invite-only."}),n&&d]})):(0,i.t1)(r),await s.confirmUserAction({message:u,description:p})}async function v(e){let t;switch(e){case"disable_guests":t=(0,c.jsx)(o.FormattedMessage,{id:"teamSettings.disableGuests.confirmationTitle",defaultMessage:"Are you sure? All page guests in this teamspace will be removed."});break;case"disable_public_access":t=(0,c.jsx)(o.FormattedMessage,{id:"teamSettings.disablePublicPages.confirmationTitle",defaultMessage:"Are you sure? This will remove access for anyone who is not a member or guest of the workspace from all pages in this teamspace."});break;case"disable_export":case"disable_team_page_edits":return!0;default:(0,i.t1)(e)}return await s.confirmUserAction({message:t})}async function y(e){let t;switch(e){case"disable_guests":t=(0,c.jsx)(o.FormattedMessage,{id:"teamSettings.disableGuestsOverride.confirmationTitle",defaultMessage:"Are you sure you want to allow guests on this teamspace? By default, guests are not allowed on teamspaces in this workspace."});break;case"disable_public_access":t=(0,c.jsx)(o.FormattedMessage,{id:"teamSettings.disablePublicPagesOverride.confirmationTitle",defaultMessage:"Are you sure you want to allow teamspace pages to be made public? By default, pages in this workspace cannot be made public."});break;case"disable_export":t=(0,c.jsx)(o.FormattedMessage,{id:"teamSettings.disableExportOverride.confirmationTitle",defaultMessage:"Are you sure you want to allow teamspace pages to be exported? By default, pages in this workspace cannot be exported."});break;case"disable_team_page_edits":return!0;default:(0,i.t1)(e)}return await s.confirmUserAction({message:t,acceptLabel:(0,c.jsx)(o.FormattedMessage,{id:"teamSettings.workspaceSettingOverride.confirmationButtonLabel",defaultMessage:"Override workspace setting"})})}async function b(e){let{environment:t,spaceStore:n,teamName:r}=e;const i=t.currentUser.id;if(!i||!n)return!0;return!(await(0,l.F0)({environment:t,spaceStore:n,currentUserId:i})).some((e=>{var t;return(null===(t=e.getName())||void 0===t?void 0:t.trim())===r.trim()}))||await s.confirmUserAction({message:(0,c.jsx)(o.FormattedMessage,{id:"teamSettings.confirmDuplicateTeamName.message",defaultMessage:"A teamspace with the same name already exists. Are you sure you want to name this teamspace “{teamName}”?",values:{teamName:r}}),cancelLabel:(0,c.jsx)(o.FormattedMessage,{id:"teamSettings.confirmDuplicateTeamName.cancelLabel",defaultMessage:"Cancel"})})}async function _(){return await s.confirmUserAction({message:(0,c.jsx)(o.FormattedMessage,{id:"teamSettings.setTeamPermissions.ClearCustomTeamPermissionsDialogMessage",defaultMessage:"Raising the permission level for all teamspace members will remove some custom permissions. Are you sure you want to proceed?"}),cancelLabel:(0,c.jsx)(o.FormattedMessage,{id:"teamSettings.setTeamPermissions.cancelLabel",defaultMessage:"Cancel"})})}},621115:(e,t,n)=>{n.d(t,{$$:()=>u,CC:()=>f,JB:()=>h,K9:()=>m,Ke:()=>v,_t:()=>d,e6:()=>p,zs:()=>g});var o=n(709291),r=n(164964),i=n(801310),a=n(419306),s=n(433929);const l=(0,o.defineMessages)({leftTeam:{id:"teamPermissionsActions.leftTeam",defaultMessage:"Left {teamName}"},leftTeamNoName:{id:"teamPermissionsActions.leftTeamNoName",defaultMessage:"Left teamspace"},leftYetStillInTeam:{id:"teamPermissionsActions.leftYetStillInTeam",defaultMessage:"You are still in {hasTeamName, select, true {{teamName}} other {the teamspace}} because you are a member of the following groups: {groupsString}"},removedYetStillInTeam:{id:"teamPermissionsActions.removedYetStillInTeam",defaultMessage:"{hasMemberName, select, true {{memberName}} other {The removed user}} is still in {hasTeamName, select, true {{teamName}} other {the teamspace}} because they are a member of the following groups: {groupsString}"},joinedTeam:{id:"teamPermissionsActions.joinedTeam",defaultMessage:"Joined {teamName}"},joinedTeamUsingAdminPrivileges:{id:"teamPermissionsActions.joinedTeamUsingAdminPrivileges",defaultMessage:"Joined {teamName} using admin privileges"},upgradedSelfToOwner:{id:"teamPermissionsActions.upgradedSelfToOwnerUsingAdminPrivileges",defaultMessage:"Became owner of {teamName} using admin privileges"},archivedTeam:{id:"teamPermissionsActions.archivedTeam",defaultMessage:"Archived {teamName}"},restoredTeam:{id:"teamPermissionsActions.restoredTeam",defaultMessage:"Restored {teamName}"},restoredTeamNoName:{id:"teamPermissionsActions.restoredTeamNoName",defaultMessage:"Restored teamspace"},duplicatedTeam:{id:"teamPermissionsActions.duplicatedTeam",defaultMessage:"Duplicated {teamName}"},duplicatedTeamNoName:{id:"teamPermissionsActions.duplicatedTeamNoName",defaultMessage:"Duplicated teamspace"}});function c(e,t,n){const o=s.default.formatMessage(e,{...t});r.oV({label:o,durationMs:n})}function d(e){return c(l.upgradedSelfToOwner,{teamName:e})}function u(e){let{teamName:t,usingAdminPrivileges:n}=e;return c(n?l.joinedTeamUsingAdminPrivileges:l.joinedTeam,{teamName:t})}function p(e){return e?c(l.leftTeam,{teamName:e}):c(l.leftTeamNoName)}function m(e,t){const n=(0,a.W)(t.flatMap((e=>e.name||[])));c(l.leftYetStillInTeam,{hasTeamName:void 0!==e,teamName:e,groupsString:n},i.JY)}function g(e,t,n){const o=(0,a.W)(n.flatMap((e=>e.name||[])));c(l.removedYetStillInTeam,{hasMemberName:void 0!==e,hasTeamName:void 0!==t,memberName:e,teamName:t,groupsString:o},i.JY)}function f(e){return c(l.archivedTeam,{teamName:e})}function h(e){return e?c(l.restoredTeam,{teamName:e}):c(l.restoredTeamNoName)}function v(e){return e?c(l.duplicatedTeam,{teamName:e}):c(l.duplicatedTeamNoName)}},195697:(e,t,n)=>{n.d(t,{q9:()=>te,$r:()=>J,ZN:()=>X,oI:()=>E,Xq:()=>q,KP:()=>Q,W8:()=>ne,Pr:()=>H,qX:()=>V,F0:()=>j,sj:()=>N,tu:()=>ie,Mf:()=>O,xo:()=>Y,y2:()=>le,W9:()=>se,ku:()=>B,MS:()=>R,QI:()=>D,U2:()=>oe,bq:()=>U,Hu:()=>z,tV:()=>re,C2:()=>K,$:()=>W,Gc:()=>Z,OX:()=>$});n(757658);var o=n(800480),r=n(886628),i=n(14577),a=n(937850);const s=Symbol("unset");class l{constructor(e){this.timeoutMs=void 0,this.fetch=void 0,this.useLastValue=void 0,this.promise=void 0,this.lastFetched=void 0,this.lastValue=void 0,this.changeTrigger=a.UZ();const{timeoutMs:t,fetch:n,useLastValue:o}=e;this.timeoutMs=t,this.fetch=n,this.promise=void 0,this.useLastValue=o,this.lastValue=s}async getWithState(){if(this.isReady()&&this.lastValue!==s)return{value:this.lastValue,state:"cached"};if(this.promise)return{value:await this.promise,state:"cached"};this.promise=this.fetch().catch((e=>{if(this.useLastValue&&this.lastValue!==s)return this.lastValue;throw e}));try{const e=await this.promise;return this.lastFetched=Date.now(),e!==this.lastValue&&(this.changeTrigger.resolve(e),this.changeTrigger=a.UZ()),this.lastValue=e,{value:e,state:"fetched"}}finally{this.promise=void 0}}async get(){const{value:e}=await this.getWithState();return e}isReady(){const e=Date.now();return Boolean(this.lastFetched&&this.lastValue!==s&&this.lastFetched>e-this.timeoutMs)}waitUntilChange(){return this.changeTrigger.promise}}var c=n(568626),d=n(186517),u=n(772141),p=n(145953),m=n(429369),g=n(519889),f=n(364684),h=n(709291),v=n(653965),y=n(401898),b=n(21359),_=n(95477),S=n(883165),k=n(80444),w=n(385555),x=n(206258),I=n(30397),C=n(88893),T=n(288280),M=n(560396),P=n(367669),A=n(548779);function R(e){return!!D()&&(!!D("dev_only")||Boolean(null==e?void 0:e.getSettings().was_in_personal_home_default_treatment))}function D(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dev_beta_and_ga";if(!(null===(e=k.default.state.currentSpaceStore)||void 0===e?void 0:e.canRead()))return!1;switch(t){case"dev_beta_and_ga":return!0;case"dev_only":return!1;default:(0,y.t1)(t)}}function B(){return w.default.checkGate({gateName:"sidebar_pages_hide_toggles"})}function E(){return _.default.isAdminMode||!1}const F=v.HP((()=>new i.ZP((()=>{const{currentSpaceStore:e}=k.default.state;return!!e&&e.isTeamsEnabled()}),{debugName:"teamsEnabledStore"})));function Z(){return(0,r.VK)((()=>F().state),[])}function U(){return F().state}async function V(e){let{environment:t,spaceStore:n,includeArchived:o=!1,currentUserId:r}=e;const i=await b.getTeams(t,{spaceId:n.id,includeArchived:o},r);return"failed"===i.type?(c.rateLimitedLog({from:"teamsHelpers",level:"error",type:"getTeamsFailed"}),[]):i.data.teamIds.map((e=>x.zX.createChildStore(n,{table:m.e0,id:e})))}async function N(e){let{spaceStore:t,currentUserId:n,includeArchived:o,minRoleOnTeamStores:r,environment:i}=e;if(!t||!n)return[];const a=await b.getAllTeamsInSpaceForAdmin(i,{spaceId:t.id,includeArchived:o},n);if("failed"===a.type)return[];const s=a.data.teamIds.map((e=>x.zX.createChildStore(t,{table:m.e0,id:e}))),l=[],c=[];for(const p of s){const e=p.getRole()??"none";(0,d.gr)(e,r)?c.push(p.id):l.push(p)}const u=p.Ak.create(a.data.recordMap);M.Z.initialize({environment:i,userId:n,spaceId:t.id,teamIds:a.data.teamIds,getRecordWithRole:e=>({role:r,value:u.getValue(e)})});const g=c.map((e=>M.Z.createTeamStoreFromCache({environment:i,teamId:e,spaceId:t.id,userId:n}))).filter(y.$K);return[...l,...g]}function O(e){return I.Z.state.teams.filter((t=>t.isMemberOrGuest(e)))}const L=new Map;async function j(e){let{environment:t,spaceStore:n,includeArchived:o=!1,currentUserId:r}=e;const i=`${n.id}:${o}`,a=L.get(i);if(a)return a.get();const s=new l({timeoutMs:3e4,fetch:async()=>V({environment:t,spaceStore:n,includeArchived:o,currentUserId:r}),useLastValue:!0});return L.set(i,s),s.get()}function K(e){return!!e&&"private"===(0,f.B5)(e)}function z(e){return e&&(0,f.jI)(e)}function q(e){let{environment:t,spaceStore:n}=e;return!!n&&(!(0,A.Cx)(n)&&((0,A.Fn)(t)||!n.getDisableTeamCreation()))}function H(e){const t=(0,P.YO)(e).map((e=>e.permissionItem)),n=t.find(u.Ir),o=(null==n?void 0:n.role)??"none",r=(0,C.Io)().reduce(((e,t)=>(e.add(t.userId),e)),new Set),i=t.filter((e=>!(!(0,u.jg)(e)||!r.has(e.user_id))||!!(0,u.hV)(e))),a=function(e){if(0===e.length)return;return e.reduce(((e,t)=>(0,d.SL)(t,e)?t:e),e[0])}(i.map((e=>e.role)))??"read_and_write";return{accessLevel:"none"===o?"private":"closed",spacePermissionRole:o,teamPermissionRole:(0,d.nl)(a,o),members:i.map((e=>{const{type:t}=e;return"user_permission"===t?{entity_type:"user",type:"member",user_id:e.user_id}:"group_permission"===t?{entity_type:"group",type:"member",group_id:e.group_id}:void(0,y.t1)(t)}))}}function G(e){let{environment:t,currentSpaceStore:n,subscriptionData:o}=e;return!!n&&(!t.device.isMobile&&!n.isTeamsEnabled()&&!(0,C.wY)(o)&&(0,A.lQ)(n))}function W(e){const{currentSpaceStore:t}=k.default.state;return G({environment:e,currentSpaceStore:t,subscriptionData:T.subscriptionDataStoreInstance.state})}function $(){const e=(0,o.O7)();return(0,r.VK)((()=>{const{currentSpaceStore:t}=k.default.state,n=T.subscriptionDataStoreInstance.state;return G({environment:e,currentSpaceStore:t,subscriptionData:n})}),[e])}function Y(){return I.Z.state.teams.flatMap((e=>e.getTeamPages()))}function Q(e,t){return e.isDefault()?-1:t.isDefault()?1:0}const J=["owner","member"],X=["owner","member","team_level_guest"],ee=(0,h.defineMessages)({ownerLabel:{id:"teamPermissionsMenu.ownerItem.label",defaultMessage:"Teamspace owner"},ownerCaption:{id:"teamPermissionsMenu.ownerItem.caption",defaultMessage:"Can edit teamspace settings and full access to teamspace pages."},memberLabel:{id:"teamPermissionsMenu.memberItem.label",defaultMessage:"Teamspace member"},memberCaption:{id:"teamPermissionsMenu.memberItem.caption",defaultMessage:"Cannot edit teamspace settings and can access teamspace pages."},guestLabel:{id:"teamPermissionsMenu.guestItem.label",defaultMessage:"Teamspace guest"},guestCaption:{id:"teamPermissionsMenu.guestItem.caption",defaultMessage:"Only has access to invited teamspaces."}}),te={owner:{label:ee.ownerLabel,caption:ee.ownerCaption},member:{label:ee.memberLabel,caption:ee.memberCaption},team_level_guest:{label:ee.guestLabel,caption:ee.guestCaption}};function ne(e){return`${_.default.domainBaseUrl}/team/${e}/join`}function oe(e){var t;return!(null===(t=e.getSettings())||void 0===t||!t.disable_invite_link)}function re(e){const t=[],n=[];for(const o of e)o.isDefined()&&(void 0===o.getArchivedBy()?n.push(o):t.push(o));return{archivedTeams:t,unarchivedTeams:n}}function ie(e){let{currentUserStore:t,currentSpaceStore:n,teamStore:o,members:r}=e;return v.oA(r.map((e=>{const{entity_type:r}=e;return"user"===r?function(e){let{currentUserStore:t,teamStore:n,member:o}=e;if(!t)return;const r=ae({teamStore:n,member:o}),i=x.U6.createChildStore(t,{table:g.KJ,id:o.user_id});return{type:"user",memberInfo:o,permissionItem:{type:"user_permission",user_id:o.user_id,role:r},userStore:i}}({currentUserStore:t,teamStore:o,member:e}):"group"===r?function(e){let{currentSpaceStore:t,teamStore:n,member:o}=e;const r=(0,A.TC)({spaceStore:t,groupId:o.group_id});if(!r)return;const i=ae({teamStore:n,member:o});return{type:"group",memberInfo:o,permissionItem:{type:"group_permission",group_id:r.id,role:i},permissionGroup:r}}({currentSpaceStore:n,teamStore:o,member:e}):void(0,y.t1)(r)})))}function ae(e){let{teamStore:t,member:n}=e;const o=t.getPermissionItems();if(!o)return"none";const r=function(e){let{permissions:t,member:n}=e;const o=null==t?void 0:t.find((e=>(0,u.hV)(e)&&"group"===n.entity_type&&e.group_id===n.group_id||(0,u.jg)(e)&&"user"===n.entity_type&&n.user_id===e.user_id));return null==o?void 0:o.role}({permissions:o,member:n});return r||(0,f.xC)({id:t.id,permissions:t.getPermissionItems()})}function se(e){const{teamStore:t,spaceStore:n,userId:o}=e;return!(t.getOwnerUserIds().length>0)&&(!!(0,S.VK)(n,o).isWorkspaceOwner()&&("private"!==t.getTeamAccessLevel()||("enterprise"===n.getSubscriptionTier()||Boolean(t.isNonGuestMember(o)))))}function le(e){const{currentSpaceStore:t}=k.default.state,n=T.subscriptionDataStoreInstance.state;return t&&!t.isTeamsEnabled()&&(0,A.lQ)(t)&&!(0,C.wY)(n)}},560846:(e,t,n)=>{n.d(t,{D$:()=>l,JZ:()=>c,NL:()=>s,UZ:()=>d});n(21703);var o=n(452027),r=n.n(o),i=n(415095);const a=new(r()),{DIFF_DELETE:s,DIFF_INSERT:l,DIFF_EQUAL:c}=r();function d(e,t){const n=u(e,{count:0,encoding:{},decoding:{}}),o=n.encodedString,r=u(t,n.cypher),i=r.encodedString,s=r.cypher,l=function(e,t){return e.map((e=>{let[n,o]=e;return[n,p(o,t)]}))}(a.diff_main(o,i),s);return l.filter((e=>{let[t,n]=e;return""!==n}))}function u(e,t){const n=i.p4(e).map((e=>{const n=t.encoding[e];if(n)return n;{const n=String.fromCharCode(t.count);return t.count++,t.encoding[e]=n,t.decoding[n]=e,n}}));if(t.count>65535)throw new Error("This string has way too many different characters.");const o=n.join("");return{cypher:t,encodedString:o}}function p(e,t){return e.split("").map((e=>t.decoding[e])).join("")}},731352:(e,t,n)=>{n.d(t,{O2:()=>a,Ye:()=>c,ug:()=>s,zK:()=>l});var o=n(415095),r=n(421838),i=n(653965);function a(e,t,n){const a=e.getValue(),s=r.eeV(t),l=r.eeV(a);if(0===s.length&&0===l.length)return""===n?{filter:{startIndex:0,endIndex:0}}:void 0;const c=i.d9(s).reverse(),d=i.d9(l).reverse(),u=l.findIndex(((e,t)=>e!==s[t])),p=d.findIndex(((e,t)=>e!==c[t]));if(-1===u||-1===p)return;const m=o.p4(n),g={filter:{startIndex:u+(m.length>0?1:0),endIndex:u+l.length-s.length}};if(m.length>0){const e=g.filter.startIndex-m.length,t=g.filter.startIndex;l.slice(e,t).join("")===n&&(g.prefix={startIndex:e,endIndex:t})}return g}function s(e,t){if(!t)return;const n=e.getValue();return r.eeV(n).slice(t.filter.startIndex,t.filter.endIndex).join("")}function l(e,t,n){return s(e,a(e,t,n?"@":""))}function c(e,t,n,o,a){if(void 0===e)return!0;if(t&&0===n&&o>3)return!0;if(1===e.length){const t=i.Z$(e);if(t){if(/\s/g.test(t)){const e=a.getValue();if(e&&1===e.length){const t=r.QaF(e);return!(2===t.length&&t.startsWith("/"))}}}}else if(e.length>=2){return e.endsWith("  ")}return!1}},389224:(e,t,n)=>{n.r(t),n.d(t,{areRangesEqual:()=>E,clear:()=>w,containerOffsetIsBetweenNodes:()=>D,get:()=>y,getIncompleteDOMEndpoint:()=>S,getRect:()=>x,getSelectionRect:()=>I,isExpanded:()=>M,isMouseRightClicking:()=>j,isMouseSelecting:()=>L,rangeFromContainerOffsets:()=>P,rangeFromPoint:()=>C,rangeToContainerOffsets:()=>R,resetMouseRightClicking:()=>K,selectionIsBackwards:()=>V,set:()=>b,setDOMEndpoint:()=>k,setOnNode:()=>T,snapContainerOffsetToNode:()=>B,startListeners:()=>U,toStaticRange:()=>A});n(21703);var o=n(455010),r=n(45060),i=n(701302),a=n(292595),s=n(568626),l=n(657347),c=n(653965),d=n(905162),u=n(626765);const p=!1;new WeakMap;let m;const g=c.HP((()=>window.__isElectron?f:()=>window))();function f(){return!m||window.document.hasFocus()?(h("getWindow(): Returning main window because it has focus."),window):m?(h("getWindow(): Returning focused child window."),m):(h("getWindow(): Returning main window because nothing has focus"),window)}function h(){p&&console.log(...arguments)}var v=n(973744);function y(){const e=g().getSelection();if(e&&e.rangeCount>0){return e.getRangeAt(0)}}function b(e,t){_.reset();const n=window.getSelection();if(n){if((0,d.Y)("supportsBrowserSelectionUpdateShortCircuit")){const t=y();if(t&&E(t,e))return}if(!(t.isFirefox&&parseFloat(t.browserVersion)<92))try{return function(e,t){const{focus:n,anchor:o}=R(t);e.collapse(o.container,o.offset),e.extend(n.container,n.offset)}(n,e)}catch(o){s.log({from:"textSelection",type:"textSelectionSet",level:"error",error:(0,l.t)(o)})}return function(e,t){const n=document.createRange();n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset),e.removeAllRanges(),e.addRange(n)}(n,e)}}const _=new class{constructor(e){this.state=void 0,this.debugName=e,(0,a.exposeDebugInstance)("endpointLatch",this)}complete(e){if(this.state&&this.state.endpoint!==e.endpoint&&this.state.onlyIfEqual===e.onlyIfEqual){const t="start"===this.state.endpoint?this.state:e,n="end"===this.state.endpoint?this.state:e;return this.state=void 0,{start:t,end:n}}if(this.state){let t=`${this.debugName}: cannot complete latch:`;const n=this.state.endpoint===e.endpoint,o=this.state.onlyIfEqual!==e.onlyIfEqual;n&&(t+=` same endpoint ${e.endpoint}`),o&&(t+=" different tokens"),s.log({level:"warning",from:"EndpointLatch",type:"cannotCompleteLatch",data:{name:this.debugName,message:t,miscDataToConvertToString:{sameEndpoint:n,differentTokens:o}}})}this.state=e}reset(){this.state&&(s.log({level:"warning",from:"EndpointLatch",type:"resetPartialLatch",data:{name:this.debugName,message:`reset latch with endpoint ${this.state.endpoint}`}}),this.state=void 0)}}("domSelection");function S(){return _.state}function k(e,t){const n=_.complete(e);if(!n)return;const{start:o,end:r}=n;b(P({start:o.position,end:r.position}),t)}function w(e){_.reset();const t=window.getSelection();t&&(e.device.isMobile&&e.device.isAndroid?t.collapse(null,void 0):t.removeAllRanges())}function x(e){if(e){if(e.collapsed&&e.getClientRects){const t=c.Go(e.getClientRects()[0]);if(!c.xb(t))return t}else if(e.getBoundingClientRect){const t=c.Go(e.getBoundingClientRect());if(!c.xb(t))return t}if(e.startContainer.nodeType===Node.ELEMENT_NODE){if(0===e.startOffset){const t=e.startContainer.getBoundingClientRect();return new u.iL(t.left,t.top,0,t.height)}const t=e.startContainer.childNodes[e.startOffset-1];if(t&&t.nodeType===Node.ELEMENT_NODE){const e=t.getBoundingClientRect();return new u.iL(e.left,e.top,0,e.height)}const n=e.startContainer.childNodes[e.startOffset];if(n&&n.nodeType===Node.ELEMENT_NODE){const e=n.getBoundingClientRect();return new u.iL(e.left,e.top,0,e.height)}}}}function I(){const e=y();if(e)return x(e)}function C(e,t){if(document.caretRangeFromPoint){return document.caretRangeFromPoint(e,t)??void 0}if(document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t),o=document.createRange();return o.setStart(n.offsetNode,n.offset),o.setEnd(n.offsetNode,n.offset),o}throw new Error("Browser does not support method caretRangeFromPoint or caretPositionFromPoint")}function T(e,t){const n=document.createRange();n.selectNode(e),b(n,t)}function M(e){return Boolean(e&&!e.collapsed)}function P(e){const{start:t,end:n}=e,o=document.createRange();if(t.container)try{o.setStart(t.container,t.offset)}catch(r){console.info(r)}if(n.container)try{o.setEnd(n.container,n.offset)}catch(r){console.info(r)}return o}function A(e){if(!e)return;const{startContainer:t,startOffset:n,endContainer:o,endOffset:r,collapsed:i}=e;return{startContainer:t,startOffset:n,endContainer:o,endOffset:r,collapsed:i}}function R(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V();const n={container:e.startContainer,offset:e.startOffset},o={container:e.endContainer,offset:e.endOffset},[r,i]=t?[n,o]:[o,n];return{start:n,end:o,focus:r,anchor:i}}function D(e,t,n){if(!t&&!n)return!1;if(!t&&n){const t=document.createRange();return t.selectNode(n),-1===t.comparePoint(e.container,e.offset)}if(t&&!n){const n=document.createRange();return n.selectNode(t),1===n.comparePoint(e.container,e.offset)}if(t&&n){const o=document.createRange();return o.setStartAfter(t),o.setEndBefore(n),0===o.comparePoint(e.container,e.offset)}return!1}function B(e){const{nodesInDomOrder:t,containerOffset:n,snapTowards:o}=e;for(let r=0;r<=t.length;r++){const e=t[r-1],i=t[r];if(D(n,null==e?void 0:e.node,null==i?void 0:i.node))return"start"===o?e:i}}function E(e,t){return e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset&&e.collapsed===t.collapsed}const F=new class{constructor(){this.currentHasNonEmptySelection=!1,this.currentIsBackwards=void 0,this.mouseDownSelection=void 0}selectionIsBackwards(){return Boolean(this.currentHasNonEmptySelection&&this.currentIsBackwards)}updateSelectionDirection(e,t){if(!e||!t||t.collapsed)return this.currentHasNonEmptySelection=!1,void(this.currentIsBackwards=void 0);if(this.currentHasNonEmptySelection=!0,void 0===this.currentIsBackwards){const n=1===t.startContainer.childNodes.length&&t.startContainer.childNodes[0].TEXT_NODE&&t.startContainer.childNodes[0]===e.startContainer;if(e.startContainer===t.startContainer||n)this.currentIsBackwards=t.startOffset<e.startOffset;else{const n=(0,o.Z)(t.startContainer,e.startContainer);this.currentIsBackwards=-1===n}}}startListeners(){window.addEventListener("mousedown",(()=>{i.default.afterNextFlush((()=>{this.mouseDownSelection=y()}))})),window.addEventListener("mouseup",(()=>{i.default.afterNextFlush((()=>{const e=y();this.updateSelectionDirection(this.mouseDownSelection,e)}))})),window.addEventListener("keydown",(()=>{const e=y();i.default.afterNextFlush((()=>{const t=y();this.updateSelectionDirection(e,t)}))}))}},Z=new class{constructor(){this.mouseDown=!1,this.keysDown=0,this.wasBackwards=!1,this.device=void 0,this.debugDrawRects=()=>{const e=y();if(M(e)){const{focus:t,anchor:n}=R(e,this.wasBackwards),o=x(P({start:t,end:t}));o&&(0,r.yX)(o,"FOCUS","red");const i=x(P({start:n,end:n}));i&&(0,r.yX)(i,"ANCHOR","blue")}},this.handleSelectionChange=()=>{var e;(this.mouseDown||this.keysDown||null!==(e=this.device)&&void 0!==e&&e.isAndroid)&&(this.wasBackwards=function(){const e=window.getSelection();if(!e)return!1;const{focusNode:t,focusOffset:n,anchorNode:r,anchorOffset:i}=e;if(t===r)return n<i;return-1===(0,o.Z)(t,r)}())},this.handleKeyDown=()=>{this.keysDown++},this.handleKeyUp=()=>{this.keysDown--},this.handleMouseDown=()=>{this.mouseDown=!0},this.handleMouseUp=()=>{this.mouseDown=!1}}startListeners(e){return this.device=e,document.addEventListener("selectionchange",this.handleSelectionChange),window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("keyup",this.handleKeyUp),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("mouseup",this.handleMouseUp),()=>{document.removeEventListener("selectionchange",this.handleSelectionChange),window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("keyup",this.handleKeyUp),window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("mouseup",this.handleMouseUp)}}};function U(e){F.startListeners(),Z.startListeners(e)}function V(){return F.currentIsBackwards||Z.wasBackwards}(0,a.exposeDebugGetter)("selectionIsBackwards",V);let N=!1,O=!1;function L(){return N}function j(){return O}function K(){return O=!1}(0,v.lj)(window,"mousedown",(e=>{0===e.button?N=!0:2===e.button&&(O=!0)}),!0),(0,v.lj)(window,"mouseup",(e=>{0===e.button?N=!1:2===e.button&&(O=!1)}),!0)},489086:(e,t,n)=>{n.d(t,{HE:()=>te,J5:()=>ee,J6:()=>A,J_:()=>O,KF:()=>P,Ld:()=>M,Mz:()=>F,OT:()=>R,Ov:()=>j,P2:()=>Z,Q3:()=>$,Rb:()=>x,ST:()=>B,Ts:()=>re,W8:()=>E,ZZ:()=>X,bj:()=>D,dQ:()=>ne,e7:()=>V,fM:()=>Q,fu:()=>N,fx:()=>W,hn:()=>H,iB:()=>L,lV:()=>J,mK:()=>q,oc:()=>T,qK:()=>oe,qh:()=>Y,td:()=>w,wd:()=>I,x0:()=>U,yR:()=>K});n(757658);var o=n(455010),r=n(840376),i=n(541432),a=n(415095),s=n(421202),l=n(421838),c=n(95371),d=n(182798),u=n(653965),p=n(401898),m=n(828685),g=n(95802),f=n(626765),h=n(650628),v=n(27724),y=n(924666),b=n(268056),_=n(745162),S=n(669645);const k="data-text-edit-side";function w(e){return{[k]:e}}function x(e){if(e instanceof HTMLElement){const t=e.closest(`[${k}]`),n=null==t?void 0:t.getAttribute(k);if("start"===n||"end"===n)return n}}function I(e){return e.startIndex===e.endIndex}function C(e){const{startIndex:t}=e;let n;return n=I(e)?[t-1]:function(e){return u.w6(e.startIndex,e.endIndex)}(e),n}function T(e,t){const n=l.lzi(t),o=n.map((e=>a.p4(l.WiV(e))));if(1===e.length&&-1===e[0]){const e=n[0];if(e){return[l.hDy(e).filter((e=>l.$z2(l.J7s(e))))]}return[]}return e.map((e=>{let t=0;const r=o.findIndex((n=>(t+=n.length,t>e))),i=n[r];return i?l.hDy(i):[]}))}function M(e){if("editing"===y.default.state.mode)return function(e,t,n){const o=l.F7H(e),r=P(o,t,n);for(const i of o){const e=r[i];if(e)return e}}(e,y.default.state.multiSelection,y.default.state.forceExtendAnnotations)}function P(e,t,n){const o={};if(0===e.length)return o;if((0,b.iG)(t)){for(const t of e){const e=n[(0,l.DgZ)(t)];if(null!=e&&e.extend){const n=e.annotation;o[t]=n}}return o}const r=new Set(e);let i=!0;const a=(0,_.L5)(t);for(const{store:s,selection:c}of a){const e=s.getValue(),t=l.Ulv(e,c),{tokensInsideRange:n}=l.xrQ(e,t.startIndex,t.endIndex);for(const a of n){const e=l.hDy(a);for(const t of r){const n=e.find((e=>l.gOH(e)===t));if(i&&n)(0,d.T)(void 0===o[t]),o[t]=n;else if(n);else if(delete o[t],r.delete(t),0===r.size)return o}i=!1}}return o}function A(e){const t=y.default.state;if("editing"!==t.mode)return!1;const{multiSelection:n}=t;if((0,b.iG)(n))return!1;const o=(0,_.L5)(n);for(const{store:r,selection:i}of o){const t=r.getValue();if(!t)continue;const n=l.lzi(t);let o=0;for(const r of n){const t=a.p4(l.WiV(r));if(o>=i.startIndex&&o<i.endIndex||o<i.startIndex&&o+t.length>i.startIndex){if(l.hDy(r).some((t=>l.J7s(t)===e)))return!0}o+=t.length}}return!1}function R(e,t,n){const o=C(e),i=t.getValue()||[];return function(e,t,n,o){const i=new r.u,a=e[0]||[];for(const r of a)if(!l.ZAl(r))if("suggest"===o)if(l.dlu(r)){const e=B(t,n.endIndex,l.J7s(r));l.$b8(r)&&!e?i.add([l.GKr.SuggestionInsertText,l.fgJ(r)]):i.add(r)}else l.V6J(r)||l.vX7(r)?B(t,n.startIndex,l.J7s(r))&&i.add(r):(0,p.t1)(r);else if("default"!==o&&"translate"!==o&&o)(0,p.t1)(o);else if(l.Nxc(r))i.add(r);else if(l.lFw(r)||l.EqZ(r)){const e=l.J7s(r);!l.$nX(e)&&B(t,n.startIndex,e)&&i.add(r)}else(0,p.t1)(r);return i}(T(o,i),i,e,n)}function D(e){const t=y.default.state;if("editing"!==t.mode)return new r.u;const{multiSelection:n,forceExtendAnnotations:o}=t,i=(0,_.L5)(n);if(0===i.length)return new r.u;const{store:a,selection:s}=i[0],c=a.getValue(),d=c?l.VrM(c):0,p=R(s.endIndex===1/0?{startIndex:s.startIndex,endIndex:d}:s,a,e);return u.M6(o,((e,t)=>{e&&(e.extend?p.add(e.annotation):p.remove(e.annotation))})),p}function B(e,t,n){return Boolean(E(e,t,n))}function E(e,t,n){return F(e,t).find((e=>l.J7s(e)===n))}function F(e,t){const n=l.b1T(e,t);return l.hDy(n)??[]}function Z(e){const t=U(e);if(t)return{startIndex:0,endIndex:t.endIndex}}function U(e){const t=m.E.findEditableWithStore(e);if(t)return t.props.getEndSelection?t.props.getEndSelection():void 0;{const t=l.eeV(e.getValue());return{startIndex:t.length,endIndex:t.length}}}function V(e,t){return e.store===t&&0===e.index}function N(e,t){return!e&&!t||e&&t&&(e.startIndex===t.startIndex||!e.startIndex&&!t.startIndex)&&(e.endIndex===t.endIndex||!e.endIndex&&!t.endIndex)}function O(e,t){return N(t,U(e))}function L(e,t){var n;return e.store===t&&e.index===(null===(n=U(t))||void 0===n?void 0:n.endIndex)}function j(){const e=v.default.getCurrentDefaultContainer();return m.E.getMembersByDOMOrder({filter:t=>{const n=t.getContextClosestSelectable();if(!n)return!1;const o=n.getContextSelectableContainer();return o&&o===e}})}function K(e){const t=e.getNode(),n=t?v.default.getDefaultContainerFromTarget(t):v.default.getCurrentDefaultContainer();return m.E.getMembersByDOMOrder({filter:e=>{const t=e.getContextClosestSelectable();if(!t)return!1;const o=t.getContextSelectableContainer();return o&&o===n}})}function z(e){return j().filter((e=>!e.props.disabled)).map((e=>e.props.store))}function q(e){const t=z(),n=t.indexOf(e);return-1===n?null:t[n-1]}function H(e){const t=z(),n=t.indexOf(e);return-1===n?null:t[n+1]}function G(e){const t=[];for(const n of e){const e=u.cx(t,(e=>{const t=e[0];return f.Kr(n.rect,t.rect)}));e>=0?t[e].push(n):t.push([n])}return t}function W(e,t,n){const{selectableRectMap:r}=h.Z.state,i=n?v.default.getDefaultContainerFromTarget(n):void 0,a=v.default.getCurrentDefaultContainer(),s=i||a,l=g.C.getMembersByDOMOrder({filter:e=>e.props.canSelect&&e.props.canEditText&&e.getContextSelectableContainer()===s}),c=[];for(const o of l){const e=r.get(o);e&&c.push({selectable:o,rect:e})}const d=c.filter((e=>{let{rect:n}=e;return n.top<=t}));d.reverse();const p=G(d),m=u.UI(p,(e=>e.sort(((e,t)=>-1*(0,o.Z)(e.selectable.getNode(),t.selectable.getNode())))[0])),f=u.F(m,(t=>{let{rect:n}=t;return Math.min(Math.abs(n.left-e),Math.abs(n.right-e))}));if(f)return f;const y=G(c.filter((e=>e.rect.bottom>=t&&d.indexOf(e)<0))),b=u.UI(y,(e=>e.sort(((e,t)=>(0,o.Z)(e.selectable.getNode(),t.selectable.getNode())))[0])),_=u.F(b,(t=>{let{rect:n}=t;return Math.min(Math.abs(n.left-e),Math.abs(n.right-e))}));return _||void 0}function $(e,t){const{selectableRectMap:n}=h.Z.state,o=g.C.getMembersByDOMOrder({filter:e=>e.getContextSelectableContainer()===t});for(let r=o.length-1;r>=0;r--){const t=n.get(o[r]);if(t&&t.bottom>e)return!1}return!0}function Y(e,t){const n=(0,S.dq)({includeNonSelectableListContainer:!0});if(!n)return!1;const o=u.Z$((0,c.DY)([n],(e=>e.value.component===t)));if(!o)return!1;const{selectableRectMap:r}=h.Z.state;return!(0,c.Yz)(o,(n=>{const o=n.component&&r.get(n.component);return!!(o&&e<=o.bottom&&n.component!==t)}))}function Q(e,t,n){const o=e.getValue(),r=[],i=n?l.Jcv(o):l.QaF(o),{startIndex:s,endIndex:c}=t,d=a.p4(i),p=u.tP(d,0,s),m=u.qr(p,(e=>"\n"===e));m>=0?r.push(m):r.push(0);for(let a=s;a<c;a++){"\n"===d[a]&&r.push(a)}return r}function J(e){const{multiSelection:t}=e;return(0,_.L5)(t).map((e=>{let{store:t,selection:n}=e;const o=l.lzi(t.getValue()),r=l.Ulv(o,n),{tokensInsideRange:i}=l.xrQ(o,r.startIndex,r.endIndex);return l.QaF(i)})).join("\n\n")}function X(e){const t=y.default.state;return"empty"!==t.mode&&Boolean((0,_.r)(t.multiSelection,e))}function ee(e){return y.default.editingStartStore.state===e&&(y.default.editingEndStore.state===e?"contains-selection":"contains-selection-start")}function te(e){const t=y.default.state;if("empty"===t.mode)return;const n=(0,b.QY)(t.multiSelection);if(n)return n.store===e?{type:"contain",selection:l.Ulv(e.getValue(),n.selection)}:void 0;const{start:o,end:r}=t.multiSelection;if(o.store===e){const t=l.eeV(e.getValue()).length;return{type:"start",index:Math.min(o.index,t)}}if(r.store===e){const t=l.eeV(e.getValue()).length;return{type:"end",index:Math.min(r.index,t)}}}function ne(e){if(!(0,b.iG)(e))return!1;const{store:t,index:n}=e.start;return 0===n||"\n"===l.eeV(t.getValue())[n-1]}function oe(){if("editing"!==y.default.state.mode)return!1;const e=(0,b.QY)(y.default.state.multiSelection);if(!e)return!1;if(!e.store.isTable(s.iU))return!1;if(0===v.default.state.stores.length)return!1;return e.store.getRecordStoreAtRootPath().getType()===i.Ti.code&&(y.default.isEditingCaption()?"caption":"body")}function re(e,t){const n=l.lzi(e);if(t<0||t>=n.length)return;let o=0;for(let r=0;r<n.length;r++){if(r===t)return{startIndex:o,endIndex:o+l.J1x(n[r])};o+=l.J1x(n[r])}}},417311:(e,t,n)=>{n.d(t,{Z:()=>o});const o={unit:8,borderRadius:4,card:{desktop:{small:{width:180,height:100},medium:{width:260,height:148},large:{width:320,height:180}},mobile:{width:"100%"}},vertical:{micro:2,tiny:4,small:8,medium:12,large:24},horizontal:{micro:2,tiny:4,small:8,medium:12,large:24}}},816402:(e,t,n)=>{n.d(t,{IS:()=>d,gs:()=>m,hH:()=>u,uy:()=>p});var o=n(44317),r=n(709291),i=n(619584),a=n(433929);const s=(0,r.defineMessages)({year:{id:"timeUtils.durationDescriptor.year",defaultMessage:"{numYears, plural, one {{numYears} year ago} other {{numYears} years ago}}"},day:{id:"timeUtils.durationDescriptor.day",defaultMessage:"{numDays, plural, one {{numDays} day ago} other {{numDays} days ago}}"},week:{id:"timeUtils.durationDescriptor.week",defaultMessage:"{numWeeks, plural, one {{numWeeks} week ago} other {{numWeeks} weeks ago}}"},hour:{id:"timeUtils.durationDescriptor.hour",defaultMessage:"{numHours, plural, one {{numHours} hour ago} other {{numHours} hours ago}}"},minute:{id:"timeUtils.durationDescriptor.minute",defaultMessage:"{numMinutes, plural, one {{numMinutes} minute ago} other {{numMinutes} minutes ago}}"},second:{id:"timeUtils.durationDescriptor.second",defaultMessage:"Just now"}}),l=(0,r.defineMessages)({year:{id:"timeUtils.durationDescriptor.ultraCompactYear",defaultMessage:"{numYears}y"},day:{id:"timeUtils.durationDescriptor.ultraCompactDay",defaultMessage:"{numDays}d"},week:{id:"timeUtils.durationDescriptor.ultraCompactWeek",defaultMessage:"{numWeeks}w"},hour:{id:"timeUtils.durationDescriptor.ultraCompactHour",defaultMessage:"{numHours}h"},minute:{id:"timeUtils.durationDescriptor.ultraCompactMinute",defaultMessage:"{numMinutes}m"},second:{id:"timeUtils.durationDescriptor.ultraCompactSeconds",defaultMessage:"Just now"}}),c=(0,r.defineMessages)({year:{id:"timeUtils.durationDescriptor.compactYear",defaultMessage:"{numYears}y ago"},day:{id:"timeUtils.durationDescriptor.compactDay",defaultMessage:"{numDays}d ago"},week:{id:"timeUtils.durationDescriptor.compactWeek",defaultMessage:"{numWeeks}w ago"},hour:{id:"timeUtils.durationDescriptor.compactHour",defaultMessage:"{numHours}h ago"},minute:{id:"timeUtils.durationDescriptor.compactMinute",defaultMessage:"{numMinutes}m ago"},second:{id:"timeUtils.durationDescriptor.compactSecond",defaultMessage:"Just now"}});function d(e){let{useCompactFormat:t,useUltraCompactFormat:n,useLowercase:o,roundDownYears:r,useWeeks:d}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const u=n?l:t?c:s,p=new Date(e),m=a.default.getIntl().locale,g=new Date,f=+g-e;if(f>=i._I&&r){const e=Math.floor(f/i._I);return a.default.formatMessage(u.year,{numYears:e})}if(p.getFullYear()!==g.getFullYear()){const e={year:"numeric",month:"short",day:"numeric"},t={year:"numeric",month:"2-digit",day:"2-digit"};return p.toLocaleDateString(m,n?t:e)}const h=Math.floor(f/i.A0);if(h<28&&h>7&&d){const e=Math.floor(h/7);return a.default.formatMessage(u.week,{numWeeks:e})}if(h>=3)return p.toLocaleDateString(m,{month:"short",day:"numeric"});if(h>=1)return a.default.formatMessage(u.day,{numDays:h});const v=Math.floor(f/i.U6);if(v>=1)return a.default.formatMessage(u.hour,{numHours:v});const y=Math.floor(f/i.hM);return y>=1?a.default.formatMessage(u.minute,{numMinutes:y}):o?a.default.formatMessage(u.second).toLocaleLowerCase():a.default.formatMessage(u.second)}function u(e,t){const n=t-e,r=Math.floor(n/i._I),s=Math.floor(n/i.A0),l=Math.floor(n/i.U6),c=Math.floor(n/i.hM),d=Math.floor(n/i.C0);return r>=1?a.default.formatMessage(o.eG.year,{numYears:r}):s>=1?a.default.formatMessage(o.eG.day,{numDays:s}):l>=1?a.default.formatMessage(o.eG.hour,{numHours:l}):c>=1?a.default.formatMessage(o.eG.minute,{numMinutes:c}):a.default.formatMessage(o.eG.second,{numSeconds:d})}function p(e,t){return new Date(e).toLocaleDateString(a.default.getIntl().locale,{month:"long",year:"numeric",day:"2-digit",hour:"numeric",minute:"2-digit",second:t?void 0:"2-digit"})}function m(e){return new Date(e).toLocaleDateString(a.default.getIntl().locale,{month:"short",year:"numeric",day:"numeric"})}},635328:(e,t,n)=>{n.d(t,{BX:()=>p,JO:()=>c,_A:()=>l,fn:()=>m,ih:()=>s,m1:()=>u,tZ:()=>d,th:()=>g});var o=n(541432),r=n(429373),i=n(27724),a=n(445131);function s(e){return Boolean(o.ZY[e])}function l(e,t){return Boolean("toggle"===e||o.wZ[e]&&(null==t?void 0:t.toggleable))}function c(e){return Boolean(o.wZ[e])}function d(e){return o.ZY[e]}function u(e){return o.wZ[e]}function p(e){return"toggle"===e.getType()||m(e)}function m(e){const t=e.getType(),n=e.getFormat();return Boolean(void 0!==t&&(0,o.eJ)(t,n))}function g(e,t,n){let o;o=i.default.state.stores.includes(t)?i.default.state.stores:[t];const s=!(a.Z.isOpen(t.id)&&!n);for(const i of o)r.rd({blockId:i.id,state:s,currentUserId:e.currentUser.id})}},516861:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(568626);n(95477);const r={provider:void 0,logInvertedTextOperationError(e){const{invertedOperation:t,maybeRemappedInvertedOperation:n,transaction:r,errorCode:i}=e;if(this.provider)return this.provider.logInvertedTextOperationError(e);const a=r.getUserActionForAnalyticsPurposesOnly(),{command:s}=t,l=`Applying inverted text operation "${s}" from transaction "${a}" failed with error "${i}".`;o.log({level:"error",from:"transactionDebugHelpers",type:"crdt:logInvertedTextOperationError",error:{message:l},data:{userAction:a,operation:s,errorName:i}})},isDebuggingEnabled(){return Boolean(this.provider&&!0)}}},199341:(e,t,n)=>{n.d(t,{JG:()=>i,_V:()=>s,jQ:()=>a,w:()=>r});n(757658);var o=n(653965);function r(e){if(0===e.length)return{tasks:[]};const t={tasks:[],userId:e[0].userId};for(const n of e){if(t.userId!==n.userId)return t;const e=JSON.stringify(o.VS(t.tasks,(e=>e.operations))).length;if(e>=s)return 0===t.tasks.length&&t.tasks.push(n),t;t.tasks.push(n)}return t}function i(e){const{transaction:t,timestamp:n,callback:o}=e;return{id:t.id,userId:t.userId,spaceId:t.spaceId,debug:{userAction:t.getUserActionForAnalyticsPurposesOnly(),userFlow:t.getUserFlowForAnalyticsPurposesOnly(),tags:t.getDebugTagsForAnalyticsPurposesOnly()},timestamp:n,operations:t.operations,callback:o,useSudoMode:t.useSudoMode}}function a(e){const t=i({transaction:e,timestamp:Date.now(),callback:void 0});return JSON.stringify(t).length>s}const s=1e5},164856:(e,t,n)=>{n.d(t,{AK:()=>a,IJ:()=>c,W$:()=>i,Xv:()=>s,ox:()=>l,wF:()=>d});var o=n(509163),r=n(653965);function i(e,t){return a(d(e,t))}function a(e){return void 0!==e&&(e===o.FW||e===o.lR)}function s(e,t){if(a(t))return;const n=o.eU[e],r=n.steps.findIndex((e=>e.id===t));return-1===r?n.steps[0].id:r===n.steps.length-1?o.FW:n.steps[r+1].id}function l(e,t){const n=d(e,t);if(n&&!a(n))return s(t,n)}function c(e,t){const n=d(e,t);if(n)return function(e,t){const n=o.eU[e];var i;if(a(t))return null===(i=(0,r.Z$)(n.steps))||void 0===i?void 0:i.id;const s=n.steps.findIndex((e=>e.id===t));return-1!==s&&0!==s?n.steps[s-1].id:void 0}(t,n)}function d(e,t){var n;if(!e)return;const r=((null===(n=e.getSettings())||void 0===n?void 0:n.tutorials)||{})[t];return void 0===r?o.eU[t].steps[0].id:r}},766638:(e,t,n)=>{n.d(t,{u:()=>a});var o=n(318245),r=n(188923),i=n(994134);function a(e){const{environment:t,type:n,blockStore:a,store:s,isInCollectionView:l}=e,c=o.default.DO_NOT_USE_markLegacy(n),d=null==a?void 0:a.getType(),u=null==a?void 0:a.useCrdt();o.default.DO_NOT_USE_measureAfterNextFlushLegacy(c,{environment:t,getData:()=>{const e=null==a?void 0:a.getType(),t=a&&"properties"===s.path[0]&&"title"===s.path[1],n=a&&"properties"===s.path[0]&&"caption"===s.path[1];return{table:s.table,block_property:t?"title":n?"caption":void 0,block_type:e,use_crdt:u,block_type_initial:e!==d?d:void 0,peek_mode:r.default.state.mode,is_in_collection_view:l,profiling_tool:i.getProfilingToolForSession()}}})}},483089:(e,t,n)=>{function o(e){const{unicode:t,fallback:n}=e;try{return t()}catch(o){return n}}n.d(t,{D_:()=>i,Ff:()=>r,V9:()=>o});const r=o({unicode:()=>/\p{L}/u,fallback:/[a-zA-Z]/});function i(e){return r.test(e)}},436867:(e,t,n)=>{n.d(t,{_:()=>a,g:()=>s});var o=n(407057),r=n(915157);const i="userSessionCount";function a(e){const t=c(e);if(!t)return void l({userId:e,count:1});const{count:n,updatedAt:r}=t;(0,o.$6)(r,!0)!==(0,o.$6)(Date.now(),!0)&&l({userId:e,count:n+1})}function s(e){if(!e)return 0;const t=c(e);return(null==t?void 0:t.count)||0}function l(e){let{userId:t,count:n}=e;const o={count:n,updatedAt:Date.now()};r.Z.set({userId:t,key:i,value:o})}function c(e){return r.Z.get({userId:e,key:i})}},873153:(e,t,n)=>{n.d(t,{c:()=>o});n(252262),n(324506);function o(e){let{blocks:t}=e;const n=t.at(0),o=null==n?void 0:n.getRecordStoreUIRoot();return!!o&&t.every((e=>o.uiContains(e)&&o.id!==e.id))}},646124:(e,t,n)=>{n.d(t,{K:()=>r});var o=n(924666);function r(){return!o.default.isEmptySelection()}},385644:(e,t,n)=>{function o(e){return e.isType("page")&&!e.isNonEditableState()&&!e.isCollectionView()&&!e.isInsideCollection()&&!e.isAssociatedCollectionAPageTree()&&e.canAdmin()}function r(e){var t;return(null===(t=e.getCollectionStore())||void 0===t?void 0:t.isPageTreeCollection())??!1}n.d(t,{A:()=>r,z:()=>o})},99340:(e,t,n)=>{n.d(t,{FS:()=>A,Iy:()=>M,Jy:()=>I,PE:()=>w,Pl:()=>x,cR:()=>P,ez:()=>k,rv:()=>T,tJ:()=>C,xb:()=>R});var o=n(667294),r=n(313991),i=n(800480),a=n(797511),s=n(533125),l=n(886628),c=n(724405),d=n(744805),u=n(531701),p=n(137810),m=n(607709),g=n(831103),f=n(367669),h=n(165598),v=n(58202),y=n(990827),b=n(206258),_=n(599757),S=n(785893);function k(e,t,n,r){(0,o.useImperativeHandle)(t,(()=>n),[n]),(0,s.c)(v.R,(()=>n),[n]);const i=e&&!(0,h.SJ)(e);return(0,S.jsx)(g.Z,{name:n.renderedType,children:i?r:null})}function w(e,t){const n=(0,a.l)();return(0,l.VK)((()=>{if(t)return!1;if(_.n.state)return!1;const o=n&&n.publicEditModeStore.state;return!(0,f.YF)(o)&&e.canEdit()}),[t,n,e])}function x(e){const t=(0,i.O7)();return(0,l.VK)((()=>(0,m.fg)(t,e)),[t,e])}function I(e,t){const n=(0,a.l)();return(0,l.VK)((()=>{if(t)return!1;if(_.n.state)return!1;const o=n&&n.publicEditModeStore.state;return!(0,f.YF)(o)&&e.canEditCollection()}),[t,n,e])}function C(e,t){return(0,l.VK)((()=>!t&&(!_.n.state&&e.canComment())),[t,e])}function T(e,t){const n=(0,c.Fg)();return(0,l.VK)((()=>{if(t&&e.getInsertSuggestion())return{color:(0,d.sZ)(n).color};const o=e.getFormat().block_color||"default";return(0,u.fi)(o,n)}),[t,e,n])}function M(e){return(0,l.VK)((()=>{const t=e.getRecordStoreUIRoot();if(!(t instanceof b.G))return;const n=t.getFormatStore().getKeyStore("page_font").getValue();return p.Z.getHeaderFontFamily({pageFont:n,locale:r.locale})}),[e])}function P(e){return(0,l.VK)((()=>Boolean(e&&e.pathIsDead())),[e])}function A(e){return(0,l.VK)((()=>e&&e.getClosestNonAliveAncestor()),[e])}function R(e){return(0,l.VK)((()=>Boolean(e&&(0,y.Eo)(e))),[e])}},135314:(e,t,n)=>{n.d(t,{e:()=>a});var o=n(667294),r=n(886628),i=n(677794);function a(){const[e,t]=(0,o.useState)(0),[n]=(0,o.useState)((()=>new i.E)),a=(0,o.createRef)();return(0,o.useEffect)((()=>{if(a.current)return n.observe(a.current),()=>{n.destroy()}}),[a,n]),(0,r.VK)((()=>{e!==n.rect.state.width&&t(n.rect.state.width)}),[e,n.rect]),[a,e]}},628267:(e,t,n)=>{n.d(t,{X:()=>i});var o=n(667294),r=n(677794);function i(e,t){const[n,i]=(0,o.useState)(void 0),a=e.current;return(0,o.useEffect)((()=>{if(!a)return;const e=new r.E({throttleMs:t});return e.observe(a),e.rect.addListener((e=>{i(e.state)})),()=>{e.destroy()}}),[a,t]),n}},563474:(e,t,n)=>{n.d(t,{D:()=>a});var o=n(667294),r=n(800480),i=n(855337);function a(){const e=(0,r.O7)();return(0,o.useMemo)((()=>(0,i.mc)(e)),[e])}},92994:(e,t,n)=>{n.d(t,{a:()=>i});var o=n(886628),r=n(385555);function i(e){return(0,o.VK)((()=>r.default.getGroup(e)),[e])}},305971:(e,t,n)=>{n.d(t,{E:()=>i});var o=n(886628),r=n(385555);function i(e){return(0,o.VK)((()=>r.default.checkGate({gateName:e})),[e])}},426344:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(667294),r=n(653965),i=n(212534);function a(e){return(0,o.useMemo)((()=>({onMouseDown:t=>{e&&(0,i.ZP)({event:t,context:i.Af.EditorMouseDown,callback:r.yR})},onClick:t=>{e&&(0,i.ZP)({event:t,context:i.Af.EditorClick,callback:r.yR})},onDoubleClick:t=>{e&&(0,i.ZP)({event:t,context:i.Af.EditorDoubleClick,callback:r.yR})},onContextMenu:t=>{e&&(0,i.ZP)({event:t,context:i.Af.EditorContextMenu,callback:r.yR})}})),[e])}},330117:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(667294),r=n(701302),i=n(465686);function a(e){let{capture:t,preventType:n}=e;(0,o.useEffect)((()=>{if(t){const e={preventType:n};return r.default.afterNextFlush((()=>{i.Z.state.capturingAreas.add(e),i.Z.emit()})),()=>{r.default.afterNextFlush((()=>{i.Z.state.capturingAreas.delete(e),i.Z.emit()}))}}}),[t,n])}},735948:(e,t,n)=>{n.d(t,{C:()=>r});var o=n(667294);function r(){const e=(0,o.useRef)(null),[t,n]=(0,o.useState)(!1),[r,i]=(0,o.useState)(!1),a=(0,o.useCallback)((()=>{const t=e.current;t&&i(t.matches(":hover"))}),[]),s=(0,o.useCallback)((t=>{e.current=t,a(),n(!0)}),[a]);return(0,o.useEffect)((()=>{const n=e.current;if(n&&t)return n.addEventListener("mouseenter",a),n.addEventListener("mouseleave",a),()=>{n.removeEventListener("mouseenter",a),n.removeEventListener("mouseleave",a)}}),[a,t]),[s,r,e]}},635622:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(667294);function r(e){return(0,o.useMemo)((()=>({onMouseDown:t=>{if(e){if(i(t.target))return;i(document.activeElement)&&t.preventDefault()}}})),[e])}function i(e){return e instanceof HTMLElement&&("true"===e.contentEditable||"input"===e.tagName.toLowerCase())}},402551:(e,t,n)=>{n.d(t,{W:()=>r});var o=n(667294);function r(e,t,n){const r=(0,o.useRef)(e),i=(0,o.useRef)(null);(0,o.useEffect)((()=>{r.current=e}),[e]),(0,o.useEffect)((()=>{const e=async()=>{i.current&&(clearTimeout(i.current),i.current=null),n&&(await r.current(),i.current=setTimeout(e,t))};return n&&e(),()=>{i.current&&(clearTimeout(i.current),i.current=null)}}),[n,t])}},883165:(e,t,n)=>{n.d(t,{VK:()=>d,Wz:()=>p,_P:()=>u,r_:()=>c});var o=n(800480),r=n(886628),i=n(665635),a=n(947969),s=n(80444),l=n(206258);function c(e){const t=(0,o.O7)();return(0,r.VK)((()=>{var n;const o=null===(n=t.currentUser)||void 0===n?void 0:n.id;return o?u(e??s.default.state.currentSpaceStore,o):void 0}),[t,e])}function d(e,t){return l.y3.createChildStore(e,a.v8({userId:t,spaceId:e.id}))}function u(e,t){return e?d(e,t):void 0}function p(e,t){return l.vs.createChildStore(e,i.HY({botId:t,spaceId:e.id}))}},134232:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(667294);function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const[i,a]=(0,o.useState)(r),s=(0,o.useRef)(null),l=(0,o.useRef)(null);return(0,o.useLayoutEffect)((()=>{null!==l.current&&window.clearTimeout(l.current),null!==s.current&&window.clearTimeout(s.current),l.current=null,s.current=null,e?0===t?a(!0):s.current=window.setTimeout((()=>{s.current=null,a(!0)}),t):0===n?a(!1):l.current=window.setTimeout((()=>{l.current=null,a(!1)}),n)}),[e,t,n]),i}},535630:(e,t,n)=>{n.d(t,{AS:()=>s,iP:()=>l});var o=n(667294),r=n(800480),i=n(886628);const a=(0,o.createContext)(void 0);function s(e){const t=(0,i.VK)((()=>e.state.height),[e]),n=(0,o.useContext)(a)||window;return n!==window?n.innerHeight:t}function l(){const{WindowSizeStore:e}=(0,r.O7)();return(0,i.VK)((()=>{const{width:t,height:n}=e.state;return{width:t,height:n}}),[e])}a.displayName="ModalWindowContext"},322981:(e,t,n)=>{n.d(t,{d:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("aiImproveWriting",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M8.68359 1.22168V3.32031C8.68359 3.68945 8.36914 4.00391 7.99316 4.00391C7.62402 4.00391 7.30957 3.68945 7.30957 3.32031V1.22168C7.30957 0.845703 7.62402 0.53125 7.99316 0.53125C8.36914 0.53125 8.68359 0.845703 8.68359 1.22168ZM10.8506 4.22266L12.3203 2.75293C12.5801 2.48633 13.0244 2.48633 13.2842 2.74609C13.5508 3.0127 13.5508 3.45703 13.291 3.7168L11.8213 5.18652C11.5615 5.45312 11.1104 5.45312 10.8506 5.19336C10.5908 4.92676 10.584 4.48242 10.8506 4.22266ZM4.16504 5.18652L2.70898 3.70996C2.44922 3.4502 2.44922 3.00586 2.70898 2.74609C2.96875 2.48633 3.41309 2.49316 3.67969 2.75293L5.13574 4.22266C5.39551 4.48242 5.39551 4.92676 5.12891 5.19336C4.86914 5.45312 4.4248 5.44629 4.16504 5.18652ZM13.4414 14.7705L6.94727 8.24219C6.62598 7.91406 6.61914 7.37402 6.94727 7.02539C7.26855 6.69043 7.83594 6.69043 8.16406 7.02539L14.6582 13.5537C14.9863 13.8887 14.9863 14.4287 14.6582 14.7705C14.3438 15.1055 13.7764 15.1055 13.4414 14.7705ZM1.1709 7.35352H3.27637C3.65234 7.35352 3.9668 7.66797 3.9668 8.03711C3.9668 8.40625 3.65234 8.7207 3.27637 8.7207H1.1709C0.801758 8.7207 0.487305 8.40625 0.487305 8.03711C0.487305 7.66797 0.801758 7.35352 1.1709 7.35352ZM14.8154 8.7207H12.7168C12.3477 8.7207 12.0332 8.40625 12.0332 8.03711C12.0332 7.66797 12.3477 7.35352 12.7168 7.35352H14.8154C15.1914 7.35352 15.5059 7.66797 15.5059 8.03711C15.5059 8.40625 15.1914 8.7207 14.8154 8.7207ZM9.5791 10.04L9.96191 9.65723L7.91113 7.60645C7.76758 7.46289 7.59668 7.42871 7.47363 7.54492C7.33691 7.68164 7.38477 7.8457 7.52148 7.98242L9.5791 10.04ZM2.70215 12.3506L4.17188 10.8945C4.43164 10.6348 4.87598 10.6348 5.13574 10.8945C5.39551 11.1611 5.39551 11.5986 5.12891 11.8652L3.66602 13.3281C3.39941 13.5879 2.95508 13.5811 2.68848 13.3145C2.43555 13.0547 2.43555 12.6104 2.70215 12.3506ZM8.68359 12.7607V14.8594C8.68359 15.2354 8.36914 15.5498 7.99316 15.5498C7.62402 15.5498 7.30957 15.2354 7.30957 14.8594V12.7607C7.30957 12.3916 7.62402 12.0771 7.99316 12.0771C8.36914 12.0771 8.68359 12.3916 8.68359 12.7607Z"})})},317105:(e,t,n)=>{n.d(t,{J:()=>o.J});var o=n(509999)},760439:(e,t,n)=>{n.d(t,{L:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("alignCenter",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M14.44 15.325H1.554a.598.598 0 01-.602-.602c0-.335.267-.601.602-.601H14.44c.334 0 .608.266.608.601a.604.604 0 01-.608.602zm0-13.447H1.554a.598.598 0 01-.602-.601c0-.335.267-.602.602-.602H14.44c.334 0 .608.267.608.602a.604.604 0 01-.608.601zm-8.736 10.34h4.738c1.12 0 1.776-.65 1.776-1.905V5.687c0-1.254-.656-1.905-1.922-1.905H5.704c-1.266 0-1.922.65-1.922 1.905v4.626c0 1.254.656 1.905 1.922 1.905zm.07-1.149c-.545 0-.843-.28-.843-.85V5.78c0-.568.298-.85.843-.85h4.452c.539 0 .843.282.843.85v4.44c0 .568-.304.85-.697.85H5.774z"})})},656992:(e,t,n)=>{n.d(t,{$:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("alignLeft",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M14.44 15.325H1.554a.598.598 0 01-.602-.602c0-.335.267-.601.602-.601H14.44c.334 0 .608.266.608.601a.604.604 0 01-.608.602zm0-13.447H1.554a.598.598 0 01-.602-.601c0-.335.267-.602.602-.602H14.44c.334 0 .608.267.608.602a.604.604 0 01-.608.601zM3.372 12.218H8.11c1.12 0 1.776-.65 1.776-1.905V5.687c0-1.254-.657-1.905-1.922-1.905H3.372c-1.266 0-1.922.65-1.922 1.905v4.626c0 1.254.656 1.905 1.922 1.905zm.07-1.149c-.545 0-.844-.28-.844-.85V5.78c0-.568.3-.85.844-.85h4.451c.54 0 .844.282.844.85v4.44c0 .568-.305.85-.697.85H3.442z"})})},982216:(e,t,n)=>{n.d(t,{g:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("alignRight",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M14.44 15.325H1.554a.598.598 0 01-.602-.602c0-.335.267-.601.602-.601H14.44c.334 0 .608.266.608.601a.604.604 0 01-.608.602zm0-13.447H1.554a.598.598 0 01-.602-.601c0-.335.267-.602.602-.602H14.44c.334 0 .608.267.608.602a.604.604 0 01-.608.601zm-6.408 10.34h4.738c1.12 0 1.776-.65 1.776-1.905V5.687c0-1.254-.657-1.905-1.922-1.905H8.032c-1.266 0-1.922.65-1.922 1.905v4.626c0 1.254.656 1.905 1.922 1.905zm.07-1.149c-.545 0-.844-.28-.844-.85V5.78c0-.568.3-.85.844-.85h4.451c.54 0 .844.282.844.85v4.44c0 .568-.305.85-.697.85H8.102z"})})},640357:(e,t,n)=>{n.d(t,{n:()=>o.n});var o=n(733907)},697491:(e,t,n)=>{n.d(t,{O:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("assistFindActionItems",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M3.17383 7.13477C1.52637 7.13477 0.15918 5.76758 0.15918 4.12695C0.15918 2.47266 1.51953 1.10547 3.17383 1.10547C4.81445 1.10547 6.18164 2.47266 6.18164 4.12695C6.18164 5.76758 4.81445 7.13477 3.17383 7.13477ZM2.81152 5.74023C2.96875 5.74023 3.09863 5.66504 3.1875 5.53516L4.64355 3.27246C4.71191 3.16992 4.73242 3.08105 4.73242 2.98535C4.73242 2.79395 4.56152 2.63672 4.35645 2.63672C4.21973 2.63672 4.10352 2.70508 4.01465 2.8418L2.79785 4.79688L2.27148 4.14062C2.18262 4.01758 2.08691 3.96289 1.9502 3.96289C1.74512 3.96289 1.58105 4.12695 1.58105 4.33887C1.58105 4.45508 1.6084 4.53711 1.68359 4.62598L2.44922 5.54199C2.55176 5.66504 2.66113 5.74023 2.81152 5.74023ZM8.34863 4.72852C8.01367 4.72852 7.75391 4.46191 7.75391 4.12695C7.75391 3.79199 8.01367 3.52539 8.34863 3.52539H15.2256C15.5605 3.52539 15.834 3.79199 15.834 4.12695C15.834 4.46191 15.5605 4.72852 15.2256 4.72852H8.34863ZM3.17383 15.0371C1.52637 15.0371 0.15918 13.6699 0.15918 12.0225C0.15918 10.375 1.51953 9.00781 3.17383 9.00781C4.81445 9.00781 6.18164 10.3682 6.18164 12.0225C6.18164 13.6699 4.81445 15.0371 3.17383 15.0371ZM3.17383 13.875C4.17188 13.875 5.02637 13.0273 5.02637 12.0225C5.02637 11.0176 4.17188 10.1631 3.17383 10.1631C2.16895 10.1631 1.32129 11.0176 1.32129 12.0225C1.32129 13.0273 2.16211 13.875 3.17383 13.875ZM8.34863 12.6377C8.01367 12.6377 7.75391 12.3711 7.75391 12.0361C7.75391 11.7012 8.01367 11.4346 8.34863 11.4346H15.2256C15.5605 11.4346 15.834 11.7012 15.834 12.0361C15.834 12.3711 15.5605 12.6377 15.2256 12.6377H8.34863Z"})})},112350:(e,t,n)=>{n.d(t,{Y:()=>o.Y});var o=n(591856)},882745:(e,t,n)=>{n.d(t,{l:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("audio",{viewBox:"0 0 23.5 24",svg:(0,r.jsx)("path",{d:"M5.258 14.008a.661.661 0 01-.485-.203.702.702 0 01-.195-.492v-2.899c0-.187.065-.351.195-.492a.65.65 0 01.485-.211.67.67 0 01.5.21.694.694 0 01.203.493v2.899a.687.687 0 01-.203.492.68.68 0 01-.5.203zm2.695 3.148a.684.684 0 01-.688-.695V7.266c0-.193.066-.357.196-.493a.66.66 0 01.492-.21c.198 0 .362.07.492.21a.67.67 0 01.203.493v9.195a.67.67 0 01-.203.492.654.654 0 01-.492.203zm2.688 3.032a.645.645 0 01-.485-.204.667.667 0 01-.195-.492V4.234c0-.198.065-.364.195-.5a.645.645 0 01.485-.203.68.68 0 01.5.203.68.68 0 01.203.5v15.258a.654.654 0 01-.203.492.68.68 0 01-.5.203zm2.695-4.047a.684.684 0 01-.492-.196.684.684 0 01-.196-.492v-7.18a.684.684 0 01.688-.695.67.67 0 01.492.203.67.67 0 01.203.492v7.18a.684.684 0 01-.695.688zm2.695 2.328a.68.68 0 01-.695-.696V5.953c0-.193.065-.357.195-.492a.667.667 0 01.5-.211c.193 0 .354.07.485.21a.67.67 0 01.203.493v11.82a.67.67 0 01-.203.493.645.645 0 01-.485.203zm2.688-3.852a.654.654 0 01-.492-.203.675.675 0 01-.196-.484V9.797c0-.188.065-.35.196-.485.13-.14.294-.21.492-.21a.66.66 0 01.492.21.661.661 0 01.203.485v4.133a.661.661 0 01-.203.484.67.67 0 01-.492.203z"})})},829281:(e,t,n)=>{n.d(t,{U:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("blockColor",{viewBox:"0 0 30 30",svg:(0,r.jsx)("path",{d:"M25,5c0-2.2-1.8-4-4-4H6C3.8,1,2,2.8,2,5H1v2h1c0,2.2,1.8,4,4,4h15c2.2,0,4-1.8,4-4h2v6H14v4h-2v9c0,1.657,1.344,3,3,3 s3-1.343,3-3v-9h-2v-2h13V5H25z M23,7c0,1.103-0.896,2-2,2H6C4.896,9,4,8.103,4,7V5c0-1.103,0.896-2,2-2h15c1.104,0,2,0.897,2,2V7z M16,26c0,0.552-0.449,1-1,1s-1-0.448-1-1v-7h2V26z"})})},576732:(e,t,n)=>{n.d(t,{Q:()=>o.Q});var o=n(383096)},886760:(e,t,n)=>{n.d(t,{o:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("caption",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.87 8.975h6.74c1.119 0 1.775-.65 1.775-1.904V2.444c0-1.254-.656-1.904-1.922-1.904H2.871C1.605.54.949 1.19.949 2.444V7.07c0 1.254.656 1.904 1.922 1.904zm.07-1.148c-.544 0-.843-.282-.843-.85v-4.44c0-.568.299-.849.844-.849h6.451c.54 0 .844.281.844.85v4.44c0 .567-.305.849-.697.849H2.94zm-1.39 4.386h12.893a.604.604 0 00.608-.601.604.604 0 00-.608-.602H1.55a.598.598 0 00-.601.602c0 .335.266.601.601.601zm8.49 3.247H1.55a.598.598 0 01-.601-.601c0-.335.266-.602.601-.602h8.49c.336 0 .609.267.609.602a.604.604 0 01-.608.601z"})})},83475:(e,t,n)=>{n.d(t,{e:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("check",{viewBox:"0 0 14 14",svg:(0,r.jsx)("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})},565376:(e,t,n)=>{n.d(t,{g:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("checkPartial",{viewBox:"0 0 14 14",svg:(0,r.jsx)("rect",{x:"1.75",y:"6.125",width:"10.5",height:"1.75"})})},369622:(e,t,n)=>{n.d(t,{v:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("checkboxCircle",{viewBox:"0 0 22 23",svg:(0,r.jsx)("circle",{cx:"11",cy:"11.5",r:"10",stroke:"#E2E1DE",strokeWidth:"2"})})},706670:(e,t,n)=>{n.d(t,{z:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("checkboxSquare",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M1.5,1.5 L1.5,14.5 L14.5,14.5 L14.5,1.5 L1.5,1.5 Z M0,0 L16,0 L16,16 L0,16 L0,0 Z"})})},224434:(e,t,n)=>{n.d(t,{i:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("chevronDown",{viewBox:"0 0 30 30",svg:(0,r.jsx)("polygon",{points:"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 "})})},528515:(e,t,n)=>{n.d(t,{A:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("chevronDownRoundedThick",{viewBox:"0 0 12 12",svg:(0,r.jsx)("path",{d:"M6.02734 8.80274C6.27148 8.80274 6.47168 8.71484 6.66211 8.51465L10.2803 4.82324C10.4268 4.67676 10.5 4.49609 10.5 4.28125C10.5 3.85156 10.1484 3.5 9.72363 3.5C9.50879 3.5 9.30859 3.58789 9.15234 3.74902L6.03223 6.9668L2.90722 3.74902C2.74609 3.58789 2.55078 3.5 2.33105 3.5C1.90137 3.5 1.55469 3.85156 1.55469 4.28125C1.55469 4.49609 1.62793 4.67676 1.77441 4.82324L5.39258 8.51465C5.58789 8.71973 5.78808 8.80274 6.02734 8.80274Z"})})},340840:(e,t,n)=>{n.d(t,{o:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("chevronRight",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M12.375 8.06445C12.375 7.83203 12.2861 7.63379 12.1084 7.45605L6.77637 2.24023C6.62598 2.08984 6.44141 2.01465 6.22266 2.01465C5.77832 2.01465 5.42285 2.35645 5.42285 2.80078C5.42285 3.01953 5.51172 3.21777 5.66211 3.375L10.4746 8.06445L5.66211 12.7539C5.51855 12.9043 5.42285 13.1025 5.42285 13.3213C5.42285 13.7725 5.77832 14.1143 6.22266 14.1143C6.44141 14.1143 6.62598 14.0391 6.77637 13.8887L12.1084 8.67285C12.293 8.49512 12.375 8.29688 12.375 8.06445Z"})})},302073:(e,t,n)=>{n.d(t,{X:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("clearInput",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M7.993 15.528a7.273 7.273 0 01-2.923-.593A7.633 7.633 0 012.653 13.3a7.797 7.797 0 01-1.633-2.417 7.273 7.273 0 01-.593-2.922c0-1.035.198-2.01.593-2.922A7.758 7.758 0 015.063.99 7.273 7.273 0 017.985.395a7.29 7.29 0 012.93.593 7.733 7.733 0 012.417 1.64 7.647 7.647 0 011.64 2.41c.396.914.594 1.888.594 2.923 0 1.035-.198 2.01-.593 2.922a7.735 7.735 0 01-4.058 4.05 7.272 7.272 0 01-2.922.594zM5.59 11.06c.2 0 .371-.066.513-.198L8 8.951l1.904 1.911a.675.675 0 00.498.198.667.667 0 00.491-.198.67.67 0 00.205-.49.64.64 0 00-.205-.491L8.981 7.969l1.92-1.911a.686.686 0 00.204-.491.646.646 0 00-.205-.484.646.646 0 00-.483-.205.67.67 0 00-.49.205L8 6.995 6.081 5.083a.696.696 0 00-.49-.19.682.682 0 00-.491.198.651.651 0 00-.198.49c0 .181.068.342.205.484l1.912 1.904-1.912 1.92a.646.646 0 00-.205.483c0 .19.066.354.198.49.136.132.3.198.49.198z"})})},397876:(e,t,n)=>{n.d(t,{D:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("closeSmall",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M3.732 11.052c-.303.308-.32.877.011 1.202.33.33.894.32 1.203.011L8 9.21l3.05 3.05c.32.325.872.32 1.197-.011a.857.857 0 00.01-1.197L9.21 8.002l3.05-3.056a.857.857 0 00-.01-1.197.857.857 0 00-1.198-.01L8 6.788 4.946 3.732c-.31-.303-.878-.32-1.203.01-.325.331-.314.895-.01 1.203l3.055 3.056-3.056 3.05z"})})},792628:(e,t,n)=>{n.d(t,{b:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("closeThick",{viewBox:"0 0 8 8",svg:(0,r.jsx)("polygon",{points:"8 1.01818182 6.98181818 0 4 2.98181818 1.01818182 0 0 1.01818182 2.98181818 4 0 6.98181818 1.01818182 8 4 5.01818182 6.98181818 8 8 6.98181818 5.01818182 4"})})},132502:(e,t,n)=>{n.d(t,{_:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("codeOnly",{viewBox:"0 0 24 20",svg:(0,r.jsx)("path",{d:"M8.093 13.62c.458.123.875-.123 1.011-.58l3.364-11.533c.13-.43-.082-.855-.54-.978-.451-.123-.848.075-.998.581L7.58 12.595c-.137.465.041.895.513 1.025zM.115 7.064c0 .233.103.472.301.643l4.423 3.992c.362.328.848.322 1.148-.02.308-.342.267-.834-.082-1.149L2.077 7.064l3.828-3.472c.349-.315.39-.8.082-1.142-.3-.342-.786-.348-1.148-.02L.416 6.415a.879.879 0 00-.3.65zm19.763 0a.878.878 0 00-.3-.649L15.153 2.43c-.362-.328-.847-.322-1.148.02-.308.342-.267.827.082 1.142l3.828 3.472-3.828 3.466c-.349.315-.39.807-.082 1.149.3.341.786.348 1.148.02l4.423-3.992c.198-.17.3-.41.3-.643z"})})},481364:(e,t,n)=>{n.d(t,{i:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("collectionBoard",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.39697 14.4634H13.5964C15.0532 14.4634 15.8311 13.6921 15.8311 12.2485V4.24609C15.8311 2.80249 15.0532 2.03125 13.5964 2.03125H2.39697C0.940186 2.03125 0.162354 2.7959 0.162354 4.24609V12.2485C0.162354 13.6987 0.940186 14.4634 2.39697 14.4634ZM2.52222 12.9934C1.94214 12.9934 1.63232 12.7034 1.63232 12.0969V4.39771C1.63232 3.79126 1.94214 3.50122 2.52222 3.50122H4.92822V12.9934H2.52222ZM6.34546 12.9934V3.50122H9.64795V12.9934H6.34546ZM13.4712 3.50122C14.0447 3.50122 14.3611 3.79126 14.3611 4.39771V12.0969C14.3611 12.7034 14.0447 12.9934 13.4712 12.9934H11.0652V3.50122H13.4712Z"})})},179973:(e,t,n)=>{n.d(t,{N:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("collectionCalendar",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M3.29688 14.4561H12.7031C14.1797 14.4561 14.9453 13.6904 14.9453 12.2344V3.91504C14.9453 2.45215 14.1797 1.69336 12.7031 1.69336H3.29688C1.82031 1.69336 1.05469 2.45215 1.05469 3.91504V12.2344C1.05469 13.6973 1.82031 14.4561 3.29688 14.4561ZM3.27637 13.1162C2.70898 13.1162 2.39453 12.8154 2.39453 12.2207V5.9043C2.39453 5.30273 2.70898 5.00879 3.27637 5.00879H12.71C13.2842 5.00879 13.6055 5.30273 13.6055 5.9043V12.2207C13.6055 12.8154 13.2842 13.1162 12.71 13.1162H3.27637ZM6.68066 7.38086H7.08398C7.33008 7.38086 7.41211 7.30566 7.41211 7.05957V6.66309C7.41211 6.41699 7.33008 6.3418 7.08398 6.3418H6.68066C6.44141 6.3418 6.35938 6.41699 6.35938 6.66309V7.05957C6.35938 7.30566 6.44141 7.38086 6.68066 7.38086ZM8.92285 7.38086H9.31934C9.56543 7.38086 9.64746 7.30566 9.64746 7.05957V6.66309C9.64746 6.41699 9.56543 6.3418 9.31934 6.3418H8.92285C8.67676 6.3418 8.59473 6.41699 8.59473 6.66309V7.05957C8.59473 7.30566 8.67676 7.38086 8.92285 7.38086ZM11.1582 7.38086H11.5547C11.8008 7.38086 11.8828 7.30566 11.8828 7.05957V6.66309C11.8828 6.41699 11.8008 6.3418 11.5547 6.3418H11.1582C10.9121 6.3418 10.8301 6.41699 10.8301 6.66309V7.05957C10.8301 7.30566 10.9121 7.38086 11.1582 7.38086ZM4.44531 9.58203H4.84863C5.09473 9.58203 5.17676 9.50684 5.17676 9.26074V8.86426C5.17676 8.61816 5.09473 8.54297 4.84863 8.54297H4.44531C4.20605 8.54297 4.12402 8.61816 4.12402 8.86426V9.26074C4.12402 9.50684 4.20605 9.58203 4.44531 9.58203ZM6.68066 9.58203H7.08398C7.33008 9.58203 7.41211 9.50684 7.41211 9.26074V8.86426C7.41211 8.61816 7.33008 8.54297 7.08398 8.54297H6.68066C6.44141 8.54297 6.35938 8.61816 6.35938 8.86426V9.26074C6.35938 9.50684 6.44141 9.58203 6.68066 9.58203ZM8.92285 9.58203H9.31934C9.56543 9.58203 9.64746 9.50684 9.64746 9.26074V8.86426C9.64746 8.61816 9.56543 8.54297 9.31934 8.54297H8.92285C8.67676 8.54297 8.59473 8.61816 8.59473 8.86426V9.26074C8.59473 9.50684 8.67676 9.58203 8.92285 9.58203ZM11.1582 9.58203H11.5547C11.8008 9.58203 11.8828 9.50684 11.8828 9.26074V8.86426C11.8828 8.61816 11.8008 8.54297 11.5547 8.54297H11.1582C10.9121 8.54297 10.8301 8.61816 10.8301 8.86426V9.26074C10.8301 9.50684 10.9121 9.58203 11.1582 9.58203ZM4.44531 11.7832H4.84863C5.09473 11.7832 5.17676 11.708 5.17676 11.4619V11.0654C5.17676 10.8193 5.09473 10.7441 4.84863 10.7441H4.44531C4.20605 10.7441 4.12402 10.8193 4.12402 11.0654V11.4619C4.12402 11.708 4.20605 11.7832 4.44531 11.7832ZM6.68066 11.7832H7.08398C7.33008 11.7832 7.41211 11.708 7.41211 11.4619V11.0654C7.41211 10.8193 7.33008 10.7441 7.08398 10.7441H6.68066C6.44141 10.7441 6.35938 10.8193 6.35938 11.0654V11.4619C6.35938 11.708 6.44141 11.7832 6.68066 11.7832ZM8.92285 11.7832H9.31934C9.56543 11.7832 9.64746 11.708 9.64746 11.4619V11.0654C9.64746 10.8193 9.56543 10.7441 9.31934 10.7441H8.92285C8.67676 10.7441 8.59473 10.8193 8.59473 11.0654V11.4619C8.59473 11.708 8.67676 11.7832 8.92285 11.7832Z"})})},517215:(e,t,n)=>{n.d(t,{E:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("collectionForm",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M5.50195 4.75635C5.37435 4.75635 5.26953 4.71305 5.1875 4.62646C5.10547 4.53988 5.06445 4.43734 5.06445 4.31885C5.06445 4.1958 5.10547 4.09326 5.1875 4.01123C5.26953 3.9292 5.37435 3.88818 5.50195 3.88818H10.5059C10.6289 3.88818 10.7314 3.9292 10.8135 4.01123C10.8955 4.09326 10.9365 4.1958 10.9365 4.31885C10.9365 4.43734 10.8955 4.53988 10.8135 4.62646C10.7314 4.71305 10.6289 4.75635 10.5059 4.75635H5.50195ZM5.50195 7.0874C5.37435 7.0874 5.26953 7.04639 5.1875 6.96436C5.10547 6.87777 5.06445 6.77295 5.06445 6.6499C5.06445 6.53141 5.10547 6.43115 5.1875 6.34912C5.26953 6.26709 5.37435 6.22607 5.50195 6.22607H10.5059C10.6289 6.22607 10.7314 6.26709 10.8135 6.34912C10.8955 6.43115 10.9365 6.53141 10.9365 6.6499C10.9365 6.77295 10.8955 6.87777 10.8135 6.96436C10.7314 7.04639 10.6289 7.0874 10.5059 7.0874H5.50195ZM5.50195 9.42529C5.37435 9.42529 5.26953 9.38428 5.1875 9.30225C5.10547 9.22021 5.06445 9.11995 5.06445 9.00146C5.06445 8.87842 5.10547 8.77588 5.1875 8.69385C5.26953 8.60726 5.37435 8.56396 5.50195 8.56396H7.92188C8.04948 8.56396 8.1543 8.60726 8.23633 8.69385C8.31836 8.77588 8.35938 8.87842 8.35938 9.00146C8.35938 9.11995 8.31836 9.22021 8.23633 9.30225C8.1543 9.38428 8.04948 9.42529 7.92188 9.42529H5.50195ZM2.13867 13.1577V2.84229C2.13867 2.10856 2.32552 1.55257 2.69922 1.17432C3.07292 0.791504 3.62663 0.600098 4.36035 0.600098H11.6406C12.3743 0.600098 12.9281 0.791504 13.3018 1.17432C13.6755 1.55257 13.8623 2.10856 13.8623 2.84229V13.1577C13.8623 13.896 13.6755 14.4543 13.3018 14.8325C12.9281 15.2108 12.3743 15.3999 11.6406 15.3999H4.36035C3.62663 15.3999 3.07292 15.2108 2.69922 14.8325C2.32552 14.4543 2.13867 13.896 2.13867 13.1577ZM3.48535 13.0757C3.48535 13.3901 3.56738 13.6317 3.73145 13.8003C3.89551 13.9689 4.14388 14.0532 4.47656 14.0532H11.5312C11.8639 14.0532 12.1123 13.9689 12.2764 13.8003C12.4404 13.6317 12.5225 13.3901 12.5225 13.0757V2.93115C12.5225 2.61214 12.4404 2.36833 12.2764 2.19971C12.1123 2.02653 11.8639 1.93994 11.5312 1.93994H4.47656C4.14388 1.93994 3.89551 2.02653 3.73145 2.19971C3.56738 2.36833 3.48535 2.61214 3.48535 2.93115V13.0757Z"})})},626701:(e,t,n)=>{n.d(t,{n:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("collectionGallery",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.0542 7.75952H5.96973C7.00464 7.75952 7.50562 7.25854 7.50562 6.19727V3.58691C7.50562 2.53223 7.00464 2.03125 5.96973 2.03125H2.0542C1.01929 2.03125 0.518311 2.53223 0.518311 3.58691V6.19727C0.518311 7.25854 1.01929 7.75952 2.0542 7.75952ZM10.0303 7.75952H13.9392C14.9741 7.75952 15.4751 7.25854 15.4751 6.19727V3.58691C15.4751 2.53223 14.9741 2.03125 13.9392 2.03125H10.0303C8.98877 2.03125 8.48779 2.53223 8.48779 3.58691V6.19727C8.48779 7.25854 8.98877 7.75952 10.0303 7.75952ZM2.06079 6.55322C1.83008 6.55322 1.71802 6.44116 1.71802 6.20386V3.58032C1.71802 3.34961 1.83008 3.23755 2.06079 3.23755H5.96313C6.18726 3.23755 6.30591 3.34961 6.30591 3.58032V6.20386C6.30591 6.44116 6.18726 6.55322 5.96313 6.55322H2.06079ZM10.0369 6.55322C9.79956 6.55322 9.69409 6.44116 9.69409 6.20386V3.58032C9.69409 3.34961 9.79956 3.23755 10.0369 3.23755H13.9392C14.1633 3.23755 14.2754 3.34961 14.2754 3.58032V6.20386C14.2754 6.44116 14.1633 6.55322 13.9392 6.55322H10.0369ZM2.0542 14.4634H5.96973C7.00464 14.4634 7.50562 13.969 7.50562 12.9077V10.2974C7.50562 9.24268 7.00464 8.7417 5.96973 8.7417H2.0542C1.01929 8.7417 0.518311 9.24268 0.518311 10.2974V12.9077C0.518311 13.969 1.01929 14.4634 2.0542 14.4634ZM10.0303 14.4634H13.9392C14.9741 14.4634 15.4751 13.969 15.4751 12.9077V10.2974C15.4751 9.24268 14.9741 8.7417 13.9392 8.7417H10.0303C8.98877 8.7417 8.48779 9.24268 8.48779 10.2974V12.9077C8.48779 13.969 8.98877 14.4634 10.0303 14.4634ZM2.06079 13.2637C1.83008 13.2637 1.71802 13.1516 1.71802 12.9143V10.2974C1.71802 10.0601 1.83008 9.94141 2.06079 9.94141H5.96313C6.18726 9.94141 6.30591 10.0601 6.30591 10.2974V12.9143C6.30591 13.1516 6.18726 13.2637 5.96313 13.2637H2.06079ZM10.0369 13.2637C9.79956 13.2637 9.69409 13.1516 9.69409 12.9143V10.2974C9.69409 10.0601 9.79956 9.94141 10.0369 9.94141H13.9392C14.1633 9.94141 14.2754 10.0601 14.2754 10.2974V12.9143C14.2754 13.1516 14.1633 13.2637 13.9392 13.2637H10.0369Z"})})},102656:(e,t,n)=>{n.d(t,{O:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("collectionList",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.08716 5.15576C2.64087 5.15576 3.08911 4.70752 3.08911 4.15381C3.08911 3.6001 2.64087 3.15186 2.08716 3.15186C1.53345 3.15186 1.08521 3.6001 1.08521 4.15381C1.08521 4.70752 1.53345 5.15576 2.08716 5.15576ZM5.29736 4.85254H14.2161C14.605 4.85254 14.9148 4.54272 14.9148 4.15381C14.9148 3.76489 14.605 3.45508 14.2161 3.45508H5.29736C4.90845 3.45508 4.59863 3.7583 4.59863 4.15381C4.59863 4.54272 4.90186 4.85254 5.29736 4.85254ZM2.08716 9.24927C2.64087 9.24927 3.08911 8.80103 3.08911 8.24731C3.08911 7.6936 2.64087 7.24536 2.08716 7.24536C1.53345 7.24536 1.08521 7.6936 1.08521 8.24731C1.08521 8.80103 1.53345 9.24927 2.08716 9.24927ZM5.29736 8.94604H14.2161C14.605 8.94604 14.9148 8.64282 14.9148 8.24731C14.9148 7.8584 14.605 7.54858 14.2161 7.54858H5.29736C4.90845 7.54858 4.59863 7.8584 4.59863 8.24731C4.59863 8.63623 4.90186 8.94604 5.29736 8.94604ZM2.08716 13.3428C2.64087 13.3428 3.08911 12.8945 3.08911 12.3408C3.08911 11.7937 2.64087 11.3389 2.08716 11.3389C1.53345 11.3389 1.08521 11.7937 1.08521 12.3408C1.08521 12.8945 1.53345 13.3428 2.08716 13.3428ZM5.29736 13.0396H14.2161C14.605 13.0396 14.9148 12.7363 14.9148 12.3408C14.9148 11.9519 14.605 11.6487 14.2161 11.6487H5.29736C4.90845 11.6487 4.59863 11.9519 4.59863 12.3408C4.59863 12.7297 4.90186 13.0396 5.29736 13.0396Z"})})},175453:(e,t,n)=>{n.d(t,{t:()=>o.t});var o=n(742696)},297856:(e,t,n)=>{n.d(t,{_:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("collectionTimeline",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5964 14.4634H2.39697C0.940186 14.4634 0.162354 13.6987 0.162354 12.2485V4.24609C0.162354 2.7959 0.940186 2.03125 2.39697 2.03125H13.5964C15.0532 2.03125 15.8311 2.80249 15.8311 4.24609V12.2485C15.8311 13.6921 15.0532 14.4634 13.5964 14.4634ZM1.63232 12.0969C1.63232 12.7034 1.94214 12.9934 2.52222 12.9934H13.4712C14.0447 12.9934 14.3611 12.7034 14.3611 12.0969V4.39771C14.3611 3.79126 14.0447 3.50122 13.4712 3.50122H2.52222C1.94214 3.50122 1.63232 3.79126 1.63232 4.39771V12.0969ZM8.92711 6.13826H2.71776C2.44986 6.13826 2.23645 5.91123 2.23645 5.64787C2.23645 5.37997 2.44986 5.15747 2.71776 5.15747H8.92711C9.19955 5.15747 9.40842 5.37542 9.40842 5.64787C9.40842 5.91577 9.19955 6.13826 8.92711 6.13826ZM11.3757 8.49036H4.75992C4.49201 8.49036 4.2786 8.26332 4.2786 7.99996C4.2786 7.73206 4.49201 7.50957 4.75992 7.50957H11.3757C11.6482 7.50957 11.857 7.72752 11.857 7.99996C11.857 8.26332 11.6482 8.49036 11.3757 8.49036ZM13.2822 10.8424H8.24608C7.97818 10.8424 7.76477 10.6109 7.76477 10.352C7.76477 10.0841 7.97818 9.85711 8.24608 9.85711H13.2822C13.5547 9.85711 13.7636 10.0796 13.7636 10.352C13.7636 10.6154 13.5547 10.8424 13.2822 10.8424Z"})})},867040:(e,t,n)=>{n.d(t,{U:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("copy",{viewBox:"0 0 14 16",svg:(0,r.jsx)("path",{d:"M2.404 15.322h5.701c1.26 0 1.887-.662 1.887-1.927V12.38h1.154c1.254 0 1.91-.662 1.91-1.928V5.555c0-.774-.158-1.266-.626-1.74L9.512.837C9.066.387 8.545.21 7.865.21H5.463c-1.254 0-1.91.662-1.91 1.928v1.084H2.404c-1.254 0-1.91.668-1.91 1.933v8.239c0 1.265.656 1.927 1.91 1.927zm7.588-6.62c0-.792-.1-1.161-.592-1.665L6.225 3.814c-.452-.462-.844-.58-1.5-.591V2.215c0-.533.28-.832.843-.832h2.38v2.883c0 .726.386 1.113 1.107 1.113h2.83v4.998c0 .539-.276.832-.844.832H9.992V8.701zm-.79-4.29c-.206 0-.288-.088-.288-.287V1.594l2.771 2.818H9.201zM2.503 14.15c-.563 0-.844-.293-.844-.832V5.232c0-.539.281-.837.85-.837h1.91v3.187c0 .85.416 1.26 1.26 1.26h3.14v4.476c0 .54-.28.832-.843.832H2.504zM5.79 7.816c-.24 0-.346-.105-.346-.345V4.547l3.223 3.27H5.791z"})})},948955:(e,t,n)=>{n.d(t,{s:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("crop",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M15.571 11.703c0 .187-.063.34-.191.458a.68.68 0 01-.492.177H4.21a.573.573 0 01-.424-.157.573.573 0 01-.157-.424V1.127c0-.205.064-.371.191-.499A.646.646 0 014.306.43c.196 0 .357.066.485.198a.675.675 0 01.191.5v9.734c0 .127.066.191.199.191h9.707c.205 0 .369.06.492.178a.613.613 0 01.191.472zM.43 4.306c0-.187.061-.34.184-.458a.68.68 0 01.492-.184h10.692a.56.56 0 01.581.588v10.622a.67.67 0 01-.198.506.658.658 0 01-.486.192.657.657 0 01-.485-.192.684.684 0 01-.191-.506V5.147c0-.132-.066-.198-.199-.198H1.106c-.2 0-.364-.06-.492-.178a.616.616 0 01-.184-.465z"})})},851153:(e,t,n)=>{n.d(t,{$:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("dateInterval",{viewBox:"0 0 20 20",svg:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("path",{d:"M4.345 10.359l1.832 1.36c.191.146.378.182.56.11.183-.074.274-.226.274-.459v-.847H8.96a.52.52 0 00.54-.533.513.513 0 00-.157-.376.521.521 0 00-.383-.158H7.01V8.63c0-.246-.093-.4-.28-.465-.186-.068-.371-.034-.553.103L4.345 9.64a.43.43 0 00-.185.362c0 .146.062.264.185.356zm11.31 0l-1.832 1.36c-.191.146-.378.182-.56.11-.183-.074-.274-.226-.274-.459v-.847H11.04a.533.533 0 01-.383-.15.521.521 0 01-.157-.383c0-.146.052-.272.157-.376a.521.521 0 01.383-.158h1.95V8.63c0-.246.093-.4.28-.465.186-.068.371-.034.553.103l1.832 1.374a.43.43 0 01.185.362.423.423 0 01-.185.356zM3.378 15.16c.183 0 .33-.051.445-.16a.553.553 0 00.17-.42V5.449a.592.592 0 00-.17-.438.601.601 0 00-.445-.17.592.592 0 00-.437.17.592.592 0 00-.171.438v9.132c0 .173.057.31.17.42s.26.16.438.16zm13.24 0c.183 0 .33-.051.445-.16a.552.552 0 00.17-.42V5.447a.592.592 0 00-.17-.437.6.6 0 00-.445-.17.592.592 0 00-.437.17.593.593 0 00-.171.437v9.132c0 .173.057.31.17.42.115.11.26.16.438.16z"})})})},279680:(e,t,n)=>{n.d(t,{h:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("dot",{viewBox:"0 0 5 4",svg:(0,r.jsx)("circle",{cx:"2.5",cy:"2",r:"2"})})},464939:(e,t,n)=>{n.d(t,{o:()=>o.o});var o=n(356666)},235153:(e,t,n)=>{n.d(t,{a:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("download",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M8.215 15.126c3.862 0 7.061-3.192 7.061-7.062 0-3.862-3.199-7.061-7.068-7.061-3.862 0-7.055 3.2-7.055 7.061 0 3.87 3.2 7.062 7.062 7.062zm0-1.388a5.654 5.654 0 01-5.667-5.674 5.642 5.642 0 015.66-5.667 5.66 5.66 0 015.68 5.667 5.66 5.66 0 01-5.673 5.674zm0-9.174c-.342 0-.602.247-.602.588v3.234l.062 1.401-.622-.766-.766-.8a.557.557 0 00-.41-.177.54.54 0 00-.56.547c0 .164.054.3.163.41l2.256 2.283c.15.157.294.226.479.226.191 0 .335-.075.485-.226l2.256-2.283a.557.557 0 00.164-.41.539.539 0 00-.56-.547.523.523 0 00-.41.178l-.766.793-.622.779.054-1.408V5.152c0-.341-.253-.588-.601-.588z"})})},847848:(e,t,n)=>{n.d(t,{D:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("dragHandle",{viewBox:"0 0 10 10",svg:(0,r.jsx)("path",{d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z"})})},454230:(e,t,n)=>{n.d(t,{a:()=>o.a});var o=n(388437)},645803:(e,t,n)=>{n.d(t,{O:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("ellipsis",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.887 9.014c.273 0 .52-.064.738-.192.219-.132.394-.307.526-.526.133-.219.199-.46.199-.725 0-.405-.142-.747-.424-1.025a1.41 1.41 0 00-1.04-.417c-.264 0-.505.066-.724.198a1.412 1.412 0 00-.718 1.244c0 .265.064.506.192.725.132.219.307.394.526.526.219.128.46.192.725.192zm5.113 0a1.412 1.412 0 001.244-.718c.132-.219.198-.46.198-.725 0-.405-.14-.747-.423-1.025A1.386 1.386 0 008 6.129c-.264 0-.506.066-.725.198a1.412 1.412 0 00-.718 1.244c0 .265.064.506.192.725.132.219.308.394.526.526.22.128.46.192.725.192zm5.106 0c.265 0 .506-.064.725-.192.219-.132.394-.307.526-.526.133-.219.199-.46.199-.725 0-.405-.142-.747-.424-1.025a1.394 1.394 0 00-1.026-.417 1.474 1.474 0 00-1.265.718c-.127.218-.19.46-.19.724 0 .265.063.506.19.725.133.219.308.394.527.526.223.128.47.192.738.192z"})})},788752:(e,t,n)=>{n.d(t,{U:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("enter",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M5.38965 14.1667C5.81812 14.1667 6.10156 13.8767 6.10156 13.468C6.10156 13.2571 6.01587 13.0989 5.89062 12.967L4.18994 11.3125L3.02979 10.3369L4.55908 10.4028H12.7922C14.4402 10.4028 15.1389 9.65796 15.1389 8.04297V4.13403C15.1389 2.48608 14.4402 1.78735 12.7922 1.78735H9.13379C8.70532 1.78735 8.4021 2.11035 8.4021 2.50586C8.4021 2.90137 8.69873 3.22437 9.13379 3.22437H12.7593C13.4316 3.22437 13.7151 3.50781 13.7151 4.17358V7.99683C13.7151 8.67578 13.425 8.95923 12.7593 8.95923H4.55908L3.02979 9.03174L4.18994 8.04956L5.89062 6.39502C6.01587 6.26978 6.10156 6.11157 6.10156 5.89404C6.10156 5.48535 5.81812 5.19531 5.38965 5.19531C5.21167 5.19531 5.01392 5.27441 4.8689 5.41943L1.08521 9.1438C0.933594 9.28882 0.854492 9.48657 0.854492 9.68433C0.854492 9.87549 0.933594 10.0732 1.08521 10.2183L4.8689 13.9492C5.01392 14.0876 5.21167 14.1667 5.38965 14.1667Z"})})},838805:(e,t,n)=>{n.d(t,{s:()=>o.s});var o=n(237240)},344161:(e,t,n)=>{n.d(t,{B:()=>o.B});var o=n(561061)},972631:(e,t,n)=>{n.d(t,{R:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("file",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M4.35645 15.4678H11.6367C13.0996 15.4678 13.8584 14.6953 13.8584 13.2256V7.02539C13.8584 6.0752 13.7354 5.6377 13.1406 5.03613L9.55176 1.38574C8.97754 0.804688 8.50586 0.667969 7.65137 0.667969H4.35645C2.89355 0.667969 2.13477 1.44043 2.13477 2.91016V13.2256C2.13477 14.7021 2.89355 15.4678 4.35645 15.4678ZM4.46582 14.1279C3.80273 14.1279 3.47461 13.7793 3.47461 13.1436V2.99219C3.47461 2.36328 3.80273 2.00781 4.46582 2.00781H7.37793V5.75391C7.37793 6.73145 7.86328 7.20312 8.83398 7.20312H12.5186V13.1436C12.5186 13.7793 12.1836 14.1279 11.5205 14.1279H4.46582ZM8.95703 6.02734C8.67676 6.02734 8.56055 5.9043 8.56055 5.62402V2.19238L12.334 6.02734H8.95703ZM8.59473 12.7266V10.6279L8.54004 9.56152L9.06641 10.1152L9.59277 10.6484C9.68848 10.7646 9.8457 10.833 9.98926 10.833C10.2969 10.833 10.5293 10.6143 10.5293 10.3066C10.5293 10.1357 10.4678 10.0127 10.3379 9.90332L8.45117 8.16699C8.29395 8.02344 8.16406 7.96191 7.99316 7.96191C7.8291 7.96191 7.69922 8.02344 7.54199 8.16699L5.65527 9.90332C5.52539 10.0127 5.46387 10.1357 5.46387 10.3066C5.46387 10.6143 5.68945 10.833 6.00391 10.833C6.14746 10.833 6.29785 10.7646 6.40039 10.6484L6.92676 10.1152L7.45312 9.56152L7.39844 10.6279V12.7266C7.39844 13.0547 7.67188 13.3008 7.99316 13.3008C8.32129 13.3008 8.59473 13.0547 8.59473 12.7266Z"})})},927783:(e,t,n)=>{n.d(t,{l:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("genericError",{viewBox:"0 0 32 32",svg:(0,r.jsx)("path",{d:"M16.0242 29.0485c7.1251 0 13.0243-5.8992 13.0243-13.0243C29.0485 8.91198 23.1365 3 16.0115 3 8.89922 3 3 8.91198 3 16.0242c0 7.1251 5.91198 13.0243 13.0242 13.0243zm-.0127-11.1089c-.6768 0-1.0471-.3959-1.0726-1.0726l-.1788-6.3078c-.0255-.70232.5108-1.20031 1.2386-1.20031.7151 0 1.2769.51076 1.2514 1.21301l-.1916 6.2951c-.0255.6895-.3958 1.0726-1.047 1.0726zm0 4.6989c-.7406 0-1.4301-.5874-1.4301-1.379 0-.7917.6767-1.3791 1.4301-1.3791.7533 0 1.4301.5746 1.4301 1.3791 0 .8044-.6895 1.379-1.4301 1.379z"})})},708294:(e,t,n)=>{n.d(t,{f:()=>o.f});var o=n(269578)},643012:(e,t,n)=>{n.d(t,{c:()=>o.c});var o=n(184869)},831358:(e,t,n)=>{n.d(t,{m:()=>o.m});var o=n(584169)},220239:(e,t,n)=>{n.d(t,{u:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("helpButtonGuide",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M8 2.77344C7.39844 2.0625 6.05859 1.42676 4.48633 1.42676C2.3877 1.42676 0.692383 2.51367 0.241211 3.5459V13.8066C0.241211 14.4766 0.678711 14.7363 1.16406 14.7363C1.52637 14.7363 1.73145 14.627 1.96387 14.4561C2.42871 14.0801 3.1875 13.6426 4.48633 13.6426C5.79199 13.6426 6.68066 14.0801 7.07715 14.415C7.2959 14.5791 7.54883 14.7363 8 14.7363C8.45117 14.7363 8.69727 14.5654 8.92285 14.415C9.34668 14.1006 10.208 13.6426 11.5137 13.6426C12.8125 13.6426 13.585 14.0869 14.0361 14.4561C14.2686 14.627 14.4736 14.7363 14.8359 14.7363C15.3213 14.7363 15.7588 14.4766 15.7588 13.8066V3.5459C15.3076 2.51367 13.6191 1.42676 11.5137 1.42676C9.94141 1.42676 8.6084 2.0625 8 2.77344ZM1.72461 4.01758C1.90918 3.56641 2.9209 2.80078 4.48633 2.80078C6.05176 2.80078 7.09766 3.57324 7.26172 4.01758V13.0342C6.55762 12.5283 5.55273 12.2549 4.48633 12.2549C3.41309 12.2549 2.41504 12.5283 1.72461 13.0547V4.01758ZM14.2754 4.01758V13.0547C13.585 12.5283 12.5869 12.2549 11.5137 12.2549C10.4473 12.2549 9.44238 12.5283 8.73828 13.0342V4.01758C8.90234 3.57324 9.94824 2.80078 11.5137 2.80078C13.0791 2.80078 14.0908 3.56641 14.2754 4.01758Z"})})},918121:(e,t,n)=>{n.d(t,{y:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("image",{viewBox:"0 0 30 30",svg:(0,r.jsx)("path",{d:"M2,2v26h26V2H2z M26,26H4v-4h22V26z M26,20H4V4h22V20z M8,10c1.104,0,2-0.896,2-2S9.104,6,8,6S6,6.896,6,8S6.896,10,8,10z M18,7l-5,5l-2-1l-5,7h18L18,7z M11.635,13.553l1.76,0.881l4.129-4.129L20.631,16H9.887L11.635,13.553z"})})},831501:(e,t,n)=>{n.d(t,{D:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("info",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M7.97266 14.9453C11.7871 14.9453 14.9453 11.7803 14.9453 7.97266C14.9453 4.1582 11.7803 1 7.96582 1C4.1582 1 1 4.1582 1 7.97266C1 11.7803 4.16504 14.9453 7.97266 14.9453ZM7.97266 13.7832C4.74609 13.7832 2.16895 11.1992 2.16895 7.97266C2.16895 4.74609 4.73926 2.16211 7.96582 2.16211C11.1924 2.16211 13.7764 4.74609 13.7832 7.97266C13.79 11.1992 11.1992 13.7832 7.97266 13.7832ZM7.91113 5.53906C8.41016 5.53906 8.7998 5.14258 8.7998 4.64355C8.7998 4.14453 8.41016 3.74805 7.91113 3.74805C7.41895 3.74805 7.02246 4.14453 7.02246 4.64355C7.02246 5.14258 7.41895 5.53906 7.91113 5.53906ZM6.77637 11.7324H9.55859C9.83887 11.7324 10.0576 11.5273 10.0576 11.2471C10.0576 10.9805 9.83887 10.7686 9.55859 10.7686H8.71094V7.28906C8.71094 6.91992 8.52637 6.67383 8.17773 6.67383H6.89258C6.6123 6.67383 6.39355 6.88574 6.39355 7.15234C6.39355 7.43262 6.6123 7.6377 6.89258 7.6377H7.62402V10.7686H6.77637C6.49609 10.7686 6.27734 10.9805 6.27734 11.2471C6.27734 11.5273 6.49609 11.7324 6.77637 11.7324Z"})})},915339:(e,t,n)=>{n.d(t,{N:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("infoFilled",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M7.99634 15.5659C6.96118 15.5659 5.98706 15.3682 5.07397 14.9727C4.16089 14.582 3.35522 14.0376 2.65698 13.3394C1.96362 12.6411 1.41919 11.8354 1.02368 10.9224C0.628174 10.0093 0.43042 9.03516 0.43042 8C0.43042 6.96484 0.628174 5.99072 1.02368 5.07764C1.41919 4.16455 1.96362 3.36133 2.65698 2.66797C3.35522 1.96973 4.15845 1.42285 5.06665 1.02734C5.97974 0.631836 6.95386 0.434082 7.98901 0.434082C9.02905 0.434082 10.0056 0.631836 10.9187 1.02734C11.8318 1.42285 12.6375 1.96973 13.3357 2.66797C14.0339 3.36133 14.5808 4.16455 14.9763 5.07764C15.3718 5.99072 15.5696 6.96484 15.5696 8C15.5696 9.03516 15.3718 10.0093 14.9763 10.9224C14.5808 11.8354 14.0339 12.6411 13.3357 13.3394C12.6375 14.0376 11.8318 14.582 10.9187 14.9727C10.0056 15.3682 9.03149 15.5659 7.99634 15.5659ZM6.65601 12.2114H9.7395C9.91528 12.2114 10.0618 12.1577 10.179 12.0503C10.2961 11.938 10.3547 11.7939 10.3547 11.6182C10.3547 11.4521 10.2961 11.313 10.179 11.2007C10.0618 11.0835 9.91528 11.0249 9.7395 11.0249H8.89722V7.43604C8.89722 7.20654 8.84106 7.021 8.72876 6.87939C8.61646 6.73779 8.45288 6.66699 8.23804 6.66699H6.78784C6.61694 6.66699 6.4729 6.72559 6.35571 6.84277C6.23853 6.95996 6.17993 7.09912 6.17993 7.26025C6.17993 7.43604 6.23853 7.58008 6.35571 7.69238C6.4729 7.7998 6.61694 7.85352 6.78784 7.85352H7.55688V11.0249H6.65601C6.48511 11.0249 6.33862 11.0835 6.21655 11.2007C6.09937 11.313 6.04077 11.4521 6.04077 11.6182C6.04077 11.7939 6.09937 11.938 6.21655 12.0503C6.33862 12.1577 6.48511 12.2114 6.65601 12.2114ZM7.95239 5.48779C8.24536 5.48779 8.49194 5.38525 8.69214 5.18018C8.89233 4.9751 8.99243 4.73096 8.99243 4.44775C8.99243 4.1499 8.89233 3.90088 8.69214 3.70068C8.49194 3.49561 8.24536 3.39307 7.95239 3.39307C7.66431 3.39307 7.41772 3.49561 7.21265 3.70068C7.00757 3.90088 6.90503 4.1499 6.90503 4.44775C6.90503 4.73096 7.00757 4.9751 7.21265 5.18018C7.41772 5.38525 7.66431 5.48779 7.95239 5.48779Z"})})},349434:(e,t,n)=>{n.d(t,{N:()=>o.N});var o=n(727714)},978877:(e,t,n)=>{n.d(t,{b:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("locked",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M4.79395 14.7227H11.1992C12.252 14.7227 12.7783 14.1963 12.7783 13.0479V8.20801C12.7783 7.19629 12.3682 6.66992 11.541 6.56055V4.96094C11.541 2.36328 9.81152 1.1123 7.99316 1.1123C6.18164 1.1123 4.45215 2.36328 4.45215 4.96094V6.56055C3.625 6.66992 3.21484 7.19629 3.21484 8.20801V13.0479C3.21484 14.1963 3.73438 14.7227 4.79395 14.7227ZM5.75098 4.83105C5.75098 3.22461 6.76953 2.35645 7.99316 2.35645C9.2168 2.35645 10.2422 3.22461 10.2422 4.83105V6.54004H5.75098V4.83105ZM4.99219 13.5059C4.69141 13.5059 4.54102 13.3623 4.54102 13V8.25586C4.54102 7.89355 4.69141 7.76367 4.99219 7.76367H11.0078C11.3086 7.76367 11.4521 7.89355 11.4521 8.25586V13C11.4521 13.3623 11.3086 13.5059 11.0078 13.5059H4.99219Z"})})},471859:(e,t,n)=>{n.d(t,{Q:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("lockedFilled",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M4.69141 14.6338H11.3018C12.2178 14.6338 12.6689 14.1826 12.6689 13.1914V8.08496C12.6689 7.18945 12.293 6.72461 11.541 6.64941V4.96094C11.541 2.36328 9.81152 1.1123 7.99316 1.1123C6.18164 1.1123 4.45215 2.36328 4.45215 4.96094V6.67676C3.74805 6.78613 3.32422 7.2373 3.32422 8.08496V13.1914C3.32422 14.1826 3.77539 14.6338 4.69141 14.6338ZM5.75098 4.83105C5.75098 3.22461 6.76953 2.35645 7.99316 2.35645C9.2168 2.35645 10.2422 3.22461 10.2422 4.83105V6.64258L5.75098 6.64941V4.83105Z"})})},975463:(e,t,n)=>{n.d(t,{z:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("loop",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M5.80371 3.12305C5.81006 3.50391 6.05762 3.74512 6.47656 3.74512H11.3643C11.9546 3.74512 12.2783 4.0498 12.2783 4.66553V11.2925L11.377 10.3149L10.8628 9.80078C10.5962 9.54688 10.2344 9.52783 9.96777 9.78809C9.71387 10.0483 9.72021 10.4229 9.98047 10.6831L12.145 12.8413C12.6211 13.311 13.167 13.311 13.6431 12.8413L15.8076 10.6831C16.0679 10.4229 16.0742 10.0483 15.8203 9.78809C15.5537 9.52783 15.1919 9.54688 14.9253 9.80078L14.4111 10.3149L13.5161 11.2861V4.56396C13.5161 3.20557 12.8052 2.50098 11.4341 2.50098H6.47656C6.05762 2.50098 5.79736 2.74219 5.80371 3.12305ZM0.186035 7.05859C0.446289 7.3252 0.808105 7.30615 1.07471 7.0459L1.59521 6.53809L2.48389 5.56689V12.2891C2.48389 13.6475 3.19482 14.3521 4.56592 14.3521H9.52344C9.94238 14.3521 10.2026 14.1108 10.1963 13.73C10.1899 13.3428 9.94238 13.1079 9.52344 13.1079H4.64209C4.05176 13.1079 3.72803 12.7969 3.72803 12.1812V5.5542L4.62305 6.53809L5.14355 7.0459C5.40381 7.30615 5.77197 7.3252 6.03223 7.05859C6.29248 6.79834 6.28613 6.43018 6.01953 6.16992L3.85498 4.01172C3.37891 3.53564 2.83936 3.53564 2.36328 4.01172L0.19873 6.16992C-0.0678711 6.43018 -0.0742188 6.79834 0.186035 7.05859Z"})})},72982:(e,t,n)=>{n.d(t,{v:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("magnifyingGlass",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M1.321 6.28c0 .751.142 1.458.424 2.118a5.52 5.52 0 001.176 1.737 5.51 5.51 0 001.736 1.175 5.326 5.326 0 002.12.424c.592 0 1.157-.09 1.695-.273a5.639 5.639 0 001.476-.752l3.364 3.37a.8.8 0 00.266.171c.1.041.205.062.315.062a.766.766 0 00.683-.397.83.83 0 00.041-.718.715.715 0 00-.164-.253L11.11 9.581c.351-.456.625-.964.82-1.524.201-.56.301-1.153.301-1.778 0-.752-.14-1.456-.423-2.112a5.497 5.497 0 00-2.92-2.919A5.284 5.284 0 006.777.824c-.752 0-1.458.141-2.119.424a5.52 5.52 0 00-2.912 2.919 5.284 5.284 0 00-.424 2.112zm1.17 0A4.204 4.204 0 013.74 3.25a4.286 4.286 0 011.367-.923 4.179 4.179 0 011.668-.335 4.13 4.13 0 011.662.335 4.19 4.19 0 011.367.923c.392.392.7.848.922 1.367a4.13 4.13 0 01.335 1.661c0 .593-.111 1.149-.335 1.668a4.357 4.357 0 01-2.29 2.283 4.13 4.13 0 01-1.66.335 4.179 4.179 0 01-1.669-.335 4.357 4.357 0 01-2.29-2.283A4.254 4.254 0 012.49 6.28zM6.79 9.15c.114 0 .187-.066.219-.198.068-.369.137-.683.205-.943.068-.26.153-.474.253-.643.1-.173.23-.314.39-.424a2.01 2.01 0 01.628-.26 8.31 8.31 0 01.964-.184c.137-.018.205-.091.205-.219 0-.127-.068-.205-.205-.232a8.214 8.214 0 01-.97-.178 2.217 2.217 0 01-.643-.266 1.355 1.355 0 01-.403-.417 2.49 2.49 0 01-.246-.643 10.063 10.063 0 01-.178-.93c-.023-.136-.096-.205-.219-.205s-.2.066-.232.198c-.073.374-.144.69-.212.95A2.49 2.49 0 016.1 5.2c-.1.169-.233.308-.397.417a2.14 2.14 0 01-.622.26c-.255.064-.574.12-.957.17-.141.028-.212.106-.212.233 0 .123.07.196.212.22.479.05.864.12 1.155.211.292.087.518.216.677.39.164.173.287.41.37.71.086.297.163.675.232 1.135.009.06.034.11.075.15a.228.228 0 00.157.055z"})})},623461:(e,t,n)=>{n.d(t,{q:()=>o.q});var o=n(526789)},188592:(e,t,n)=>{n.d(t,{S:()=>o.S});var o=n(954851)},738195:(e,t,n)=>{n.d(t,{a:()=>o.a});var o=n(554855)},719861:(e,t,n)=>{n.d(t,{Y:()=>o.Y});var o=n(439567)},14735:(e,t,n)=>{n.d(t,{B:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("pdf",{viewBox:"0 0 23.5 23.5",svg:(0,r.jsx)("path",{d:"M8.61 10.922a.44.44 0 01-.313-.11.422.422 0 01-.117-.312.9.9 0 01.054-.273l1.07-2.985c.12-.354.342-.531.665-.531.338 0 .568.177.687.531l1.07 2.985c.032.114.047.205.047.273a.44.44 0 01-.109.313c-.073.072-.18.109-.32.109-.219 0-.365-.133-.438-.399l-.242-.68H9.281l-.226.68c-.068.266-.216.399-.446.399zm.85-1.75h1.032L10 7.609h-.047l-.492 1.563zm3.657-1.11a.514.514 0 01-.367-.14.503.503 0 01-.14-.36c0-.14.046-.257.14-.351a.514.514 0 01.367-.14h2.195a.477.477 0 01.5.492c0 .14-.046.26-.14.359a.487.487 0 01-.36.14h-2.195zm0 2.618a.514.514 0 01-.367-.14.503.503 0 01-.14-.36c0-.14.046-.258.14-.352a.514.514 0 01.367-.14h2.195a.477.477 0 01.5.492c0 .14-.046.26-.14.36a.487.487 0 01-.36.14h-2.195zm-4.953 6.234V13.25c0-.333.089-.583.266-.75.182-.172.435-.258.758-.258h5.632c.677 0 1.016.336 1.016 1.008v3.586h-.547l-1.492-1.719a.58.58 0 00-.242-.172.84.84 0 00-.282-.047c-.177 0-.348.073-.515.22l-1.547 1.366-.617-.562a.68.68 0 00-.461-.188.617.617 0 00-.438.188l-.984.992h-.547zm2.492-1.797a.78.78 0 00.57-.242.78.78 0 00.243-.57c0-.23-.081-.42-.242-.57a.823.823 0 00-.57-.243.737.737 0 00-.579.227.812.812 0 00-.234.586c0 .218.078.409.234.57a.79.79 0 00.578.242zm-5.36 2.64V5.97c0-.839.214-1.474.641-1.907.428-.437 1.06-.656 1.899-.656h8.32c.839 0 1.472.219 1.899.656.427.433.64 1.068.64 1.907v11.789c0 .844-.213 1.482-.64 1.914-.427.432-1.06.648-1.899.648h-8.32c-.839 0-1.471-.216-1.899-.648-.427-.432-.64-1.07-.64-1.914zm1.54-.093c0 .36.094.635.281.828.188.193.472.29.852.29h8.062c.38 0 .664-.097.852-.29.187-.193.281-.469.281-.828V6.07c0-.364-.094-.643-.281-.836-.188-.198-.471-.296-.852-.296H7.97c-.38 0-.664.098-.852.296-.187.193-.281.472-.281.836v11.594z"})})},907746:(e,t,n)=>{n.d(t,{Q:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("peekModeCenter",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.1416 14.4492H13.8516C15.3281 14.4492 16.0938 13.6904 16.0938 12.2344V3.9082C16.0938 2.45215 15.3281 1.69336 13.8516 1.69336H2.1416C0.665039 1.69336 -0.100586 2.44531 -0.100586 3.9082V12.2344C-0.100586 13.6904 0.665039 14.4492 2.1416 14.4492ZM2.22363 13.1094C1.58789 13.1094 1.23926 12.7812 1.23926 12.1182V4.02441C1.23926 3.36133 1.58789 3.02637 2.22363 3.02637H13.7695C14.3984 3.02637 14.7539 3.36133 14.7539 4.02441V12.1182C14.7539 12.7812 14.3984 13.1094 13.7695 13.1094H2.22363ZM4.33594 11.0654H11.6504C12.0742 11.0654 12.2588 10.8809 12.2588 10.4502V5.69238C12.2588 5.25488 12.0742 5.07715 11.6504 5.07715H4.33594C3.91211 5.07715 3.72754 5.25488 3.72754 5.69238V10.4502C3.72754 10.8809 3.91211 11.0654 4.33594 11.0654Z"})})},220300:(e,t,n)=>{n.d(t,{M:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("peekModeFull",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.1416 14.4492H13.8516C15.3281 14.4492 16.0938 13.6904 16.0938 12.2344V3.9082C16.0938 2.45215 15.3281 1.69336 13.8516 1.69336H2.1416C0.665039 1.69336 -0.100586 2.44531 -0.100586 3.9082V12.2344C-0.100586 13.6904 0.665039 14.4492 2.1416 14.4492ZM2.22363 13.1094C1.58789 13.1094 1.23926 12.7812 1.23926 12.1182V4.02441C1.23926 3.36133 1.58789 3.02637 2.22363 3.02637H13.7695C14.3984 3.02637 14.7539 3.36133 14.7539 4.02441V12.1182C14.7539 12.7812 14.3984 13.1094 13.7695 13.1094H2.22363ZM2.77734 12.1113H13.2158C13.5645 12.1113 13.7559 11.9131 13.7559 11.5645V4.57812C13.7559 4.22949 13.5645 4.02441 13.2158 4.02441H2.77734C2.42871 4.02441 2.2373 4.22949 2.2373 4.57812V11.5645C2.2373 11.9131 2.42871 12.1113 2.77734 12.1113Z"})})},392582:(e,t,n)=>{n.d(t,{y:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("peekModeSide",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.1416 14.4492H13.8516C15.3281 14.4492 16.0938 13.6904 16.0938 12.2344V3.9082C16.0938 2.45215 15.3281 1.69336 13.8516 1.69336H2.1416C0.665039 1.69336 -0.100586 2.44531 -0.100586 3.9082V12.2344C-0.100586 13.6904 0.665039 14.4492 2.1416 14.4492ZM2.22363 13.1094C1.58789 13.1094 1.23926 12.7812 1.23926 12.1182V4.02441C1.23926 3.36133 1.58789 3.02637 2.22363 3.02637H13.7695C14.3984 3.02637 14.7539 3.36133 14.7539 4.02441V12.1182C14.7539 12.7812 14.3984 13.1094 13.7695 13.1094H2.22363ZM8.51953 12.1113H13.2158C13.5986 12.1113 13.7559 11.9541 13.7559 11.5645V4.57812C13.7559 4.18848 13.5986 4.02441 13.2158 4.02441H8.51953C8.13672 4.02441 7.98633 4.18848 7.98633 4.57812V11.5645C7.98633 11.9541 8.13672 12.1113 8.51953 12.1113Z"})})},629628:(e,t,n)=>{n.d(t,{f:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("person",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M7.7832 8.00195C9.27344 8.00195 10.5381 6.67578 10.5381 4.95996C10.5381 3.28516 9.2666 2 7.7832 2C6.29297 2 5.01465 3.30566 5.02148 4.97363C5.02148 6.67578 6.28613 8.00195 7.7832 8.00195ZM3.51758 14.3594H12.0352C13.1631 14.3594 13.5527 14.0176 13.5527 13.3887C13.5527 11.6318 11.3242 9.21191 7.77637 9.21191C4.23535 9.21191 2 11.6318 2 13.3887C2 14.0176 2.38965 14.3594 3.51758 14.3594Z"})})},822762:(e,t,n)=>{n.d(t,{X:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("personCrossedOut",{viewBox:"0 0 44 44",svg:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("path",{d:"M5.4857 44H0L44 8.56549V13.0061L5.4857 44Z"}),(0,r.jsx)("path",{d:"M39.8048 44H8.66491L25.6448 30.4378C26.9394 30.6489 28.1581 30.9719 29.3009 31.4067C31.5362 32.2374 33.4346 33.326 34.9964 34.6723C36.5725 36.0044 37.7761 37.4367 38.6071 38.9692C39.4525 40.5018 39.8752 41.9555 39.8752 43.3305C39.8752 43.5675 39.8517 43.7906 39.8048 44Z"}),(0,r.jsx)("path",{d:"M30.3971 16.7973C30.3971 16.8668 30.3965 16.9359 30.3952 17.0048L19.3828 25.9192C18.7467 25.7134 18.1339 25.4228 17.5446 25.0473C16.2408 24.2023 15.1876 23.0708 14.3853 21.6528C13.5972 20.2205 13.2032 18.6163 13.2032 16.8403C13.2032 15.0929 13.5972 13.5174 14.3853 12.1137C15.1876 10.7101 16.2408 9.60007 17.5446 8.78366C18.8485 7.96725 20.267 7.55905 21.8001 7.55905C23.3332 7.55905 24.7517 7.96009 26.0556 8.76218C27.3595 9.56426 28.4054 10.6671 29.1935 12.0708C29.9959 13.4601 30.3971 15.0356 30.3971 16.7973Z"})]})})},761149:(e,t,n)=>{n.d(t,{I:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("play",{viewBox:"0 0 14 16",svg:(0,r.jsx)("path",{d:"M1.34699 16C1.73805 16 2.07697 15.8756 2.52017 15.6089L12.8703 9.47556C13.6437 9.01333 14 8.62222 14 8C14 7.37778 13.6437 6.98667 12.8703 6.52444L2.52017 0.391111C2.07697 0.133333 1.73805 0 1.34699 0C0.582247 0 0 0.595556 0 1.57333V14.4356C0 15.4044 0.582247 16 1.34699 16Z"})})},661614:(e,t,n)=>{n.d(t,{R:()=>o.R});var o=n(747453)},252942:(e,t,n)=>{n.d(t,{D:()=>o.D});var o=n(286793)},944461:(e,t,n)=>{n.d(t,{a:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("reaction",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M7.99414 14.0723C7.16602 14.0723 6.38672 13.9141 5.65625 13.5977C4.92578 13.2852 4.28125 12.8496 3.72266 12.291C3.16797 11.7324 2.73242 11.0879 2.41602 10.3574C2.09961 9.62695 1.94141 8.84766 1.94141 8.01953C1.94141 7.19141 2.09961 6.41211 2.41602 5.68164C2.73242 4.95117 3.16797 4.30859 3.72266 3.75391C4.28125 3.19531 4.92383 2.75781 5.65039 2.44141C6.38086 2.125 7.16016 1.9668 7.98828 1.9668C8.82031 1.9668 9.60156 2.125 10.332 2.44141C11.0625 2.75781 11.707 3.19531 12.2656 3.75391C12.8242 4.30859 13.2617 4.95117 13.5781 5.68164C13.8945 6.41211 14.0527 7.19141 14.0527 8.01953C14.0527 8.84766 13.8945 9.62695 13.5781 10.3574C13.2617 11.0879 12.8242 11.7324 12.2656 12.291C11.707 12.8496 11.0625 13.2852 10.332 13.5977C9.60156 13.9141 8.82227 14.0723 7.99414 14.0723ZM7.99414 12.877C8.66992 12.877 9.30078 12.752 9.88672 12.502C10.4727 12.252 10.9883 11.9043 11.4336 11.459C11.8789 11.0137 12.2266 10.498 12.4766 9.91211C12.7266 9.32617 12.8516 8.69531 12.8516 8.01953C12.8516 7.34766 12.7266 6.71875 12.4766 6.13281C12.2266 5.54297 11.8789 5.02539 11.4336 4.58008C10.9883 4.13477 10.4707 3.78711 9.88086 3.53711C9.29492 3.28711 8.66406 3.16211 7.98828 3.16211C7.31641 3.16211 6.68555 3.28711 6.0957 3.53711C5.50977 3.78711 4.99609 4.13477 4.55469 4.58008C4.11328 5.02539 3.76758 5.54297 3.51758 6.13281C3.26758 6.71875 3.14258 7.34766 3.14258 8.01953C3.14258 8.69531 3.26758 9.32617 3.51758 9.91211C3.76758 10.498 4.11328 11.0137 4.55469 11.459C5 11.9043 5.51562 12.252 6.10156 12.502C6.69141 12.752 7.32227 12.877 7.99414 12.877ZM7.98828 10.9023C7.58203 10.9023 7.22266 10.8301 6.91016 10.6855C6.60156 10.5371 6.36133 10.3672 6.18945 10.1758C6.02148 9.98438 5.9375 9.82422 5.9375 9.69531C5.9375 9.625 5.96484 9.57617 6.01953 9.54883C6.07812 9.51758 6.14062 9.51758 6.20703 9.54883C6.42188 9.66211 6.66602 9.77148 6.93945 9.87695C7.21289 9.98242 7.5625 10.0352 7.98828 10.0352C8.41406 10.0352 8.76367 9.98242 9.03711 9.87695C9.31445 9.77148 9.55859 9.66211 9.76953 9.54883C9.83594 9.51758 9.89844 9.51758 9.95703 9.54883C10.0156 9.57617 10.0449 9.625 10.0449 9.69531C10.0449 9.82422 9.95898 9.98438 9.78711 10.1758C9.61523 10.3672 9.375 10.5371 9.06641 10.6855C8.75781 10.8301 8.39844 10.9023 7.98828 10.9023ZM6.25977 7.49219C6.07617 7.49219 5.91602 7.41797 5.7793 7.26953C5.64648 7.12109 5.58008 6.92969 5.58008 6.69531C5.58008 6.46484 5.64648 6.27539 5.7793 6.12695C5.91602 5.97461 6.07617 5.89844 6.25977 5.89844C6.44336 5.89844 6.60547 5.97461 6.74609 6.12695C6.88672 6.27539 6.95703 6.46484 6.95703 6.69531C6.95703 6.92969 6.88672 7.12109 6.74609 7.26953C6.60547 7.41797 6.44336 7.49219 6.25977 7.49219ZM9.7168 7.49219C9.5332 7.49219 9.37305 7.41797 9.23633 7.26953C9.10352 7.12109 9.03711 6.92969 9.03711 6.69531C9.03711 6.46484 9.10352 6.27539 9.23633 6.12695C9.37305 5.97461 9.5332 5.89844 9.7168 5.89844C9.90039 5.89844 10.0625 5.97461 10.2031 6.12695C10.3438 6.27539 10.4141 6.46484 10.4141 6.69531C10.4141 6.92969 10.3438 7.12109 10.2031 7.26953C10.0625 7.41797 9.90039 7.49219 9.7168 7.49219Z"})})},414726:(e,t,n)=>{n.d(t,{V:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("reactionAdd",{viewBox:"0 0 20 20",svg:(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M12 14.3516C12 14.1875 12.0573 14.0482 12.1719 13.9336C12.2891 13.8164 12.4297 13.7578 12.5938 13.7578H14.7617V11.5938C14.7617 11.4297 14.819 11.2904 14.9336 11.1758C15.0482 11.0586 15.1875 11 15.3516 11C15.5156 11 15.6549 11.0586 15.7695 11.1758C15.8867 11.2904 15.9453 11.4297 15.9453 11.5938V13.7578H18.1133C18.2747 13.7578 18.4128 13.8164 18.5273 13.9336C18.6445 14.0482 18.7031 14.1875 18.7031 14.3516C18.7031 14.5156 18.6445 14.6562 18.5273 14.7734C18.4128 14.888 18.2747 14.9453 18.1133 14.9453H15.9453V17.1133C15.9453 17.2747 15.8867 17.4128 15.7695 17.5273C15.6549 17.6445 15.5156 17.7031 15.3516 17.7031C15.1875 17.7031 15.0482 17.6445 14.9336 17.5273C14.819 17.4128 14.7617 17.2747 14.7617 17.1133V14.9453H12.5938C12.4297 14.9453 12.2891 14.888 12.1719 14.7734C12.0573 14.6562 12 14.5156 12 14.3516Z"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0615 17.123C9.09538 17.123 8.1862 16.9385 7.33398 16.5693C6.48177 16.2048 5.72982 15.6966 5.07812 15.0449C4.43099 14.3932 3.92285 13.6413 3.55371 12.7891C3.18457 11.9368 3 11.0277 3 10.0615C3 9.09538 3.18457 8.1862 3.55371 7.33398C3.92285 6.48177 4.43099 5.7321 5.07812 5.08496C5.72982 4.43327 6.47949 3.92285 7.32715 3.55371C8.17936 3.18457 9.08854 3 10.0547 3C11.0254 3 11.9368 3.18457 12.7891 3.55371C13.6413 3.92285 14.3932 4.43327 15.0449 5.08496C15.6966 5.7321 16.207 6.48177 16.5762 7.33398C16.9453 8.1862 17.1299 9.09538 17.1299 10.0615C17.1299 10.6193 17.0684 11.1581 16.9453 11.678V11.5938C16.9453 11.1646 16.7813 10.7706 16.4767 10.4687C16.2657 10.2558 16.0099 10.1116 15.7285 10.0441C15.7263 9.26677 15.5805 8.53887 15.291 7.86035C14.9993 7.1722 14.5938 6.56836 14.0742 6.04883C13.5547 5.5293 12.9508 5.1237 12.2627 4.83203C11.5791 4.54036 10.8431 4.39453 10.0547 4.39453C9.27083 4.39453 8.53483 4.54036 7.84668 4.83203C7.16309 5.1237 6.5638 5.5293 6.04883 6.04883C5.53385 6.56836 5.13053 7.1722 4.83887 7.86035C4.5472 8.54395 4.40137 9.27767 4.40137 10.0615C4.40137 10.8499 4.5472 11.5859 4.83887 12.2695C5.13053 12.9531 5.53385 13.5547 6.04883 14.0742C6.56836 14.5938 7.16992 14.9993 7.85352 15.291C8.54167 15.5827 9.27767 15.7285 10.0615 15.7285C10.5739 15.7285 11.0641 15.6669 11.5321 15.5438C11.8272 15.8056 12.1958 15.9453 12.5938 15.9453H13.7617V16.0641C13.4535 16.2554 13.1293 16.4238 12.7891 16.5693C11.9368 16.9385 11.0277 17.123 10.0615 17.123ZM10.0547 13.4248C9.58073 13.4248 9.16146 13.3405 8.79688 13.1719C8.43685 12.9987 8.15658 12.8005 7.95605 12.5771C7.76009 12.3538 7.66211 12.167 7.66211 12.0166C7.66211 11.9346 7.69401 11.8776 7.75781 11.8457C7.82617 11.8092 7.89909 11.8092 7.97656 11.8457C8.22721 11.9779 8.51204 12.1055 8.83105 12.2285C9.15006 12.3516 9.55794 12.4131 10.0547 12.4131C10.5514 12.4131 10.9593 12.3516 11.2783 12.2285C11.6019 12.1055 11.8867 11.9779 12.1328 11.8457C12.2103 11.8092 12.2832 11.8092 12.3516 11.8457C12.4199 11.8776 12.4541 11.9346 12.4541 12.0166C12.4541 12.167 12.3538 12.3538 12.1533 12.5771C11.9528 12.8005 11.6725 12.9987 11.3125 13.1719C10.9525 13.3405 10.5332 13.4248 10.0547 13.4248ZM8.03809 9.44629C7.82389 9.44629 7.63704 9.3597 7.47754 9.18652C7.32259 9.01335 7.24512 8.79004 7.24512 8.5166C7.24512 8.24772 7.32259 8.02669 7.47754 7.85352C7.63704 7.67578 7.82389 7.58691 8.03809 7.58691C8.25228 7.58691 8.44141 7.67578 8.60547 7.85352C8.76953 8.02669 8.85156 8.24772 8.85156 8.5166C8.85156 8.79004 8.76953 9.01335 8.60547 9.18652C8.44141 9.3597 8.25228 9.44629 8.03809 9.44629ZM12.0713 9.44629C11.8571 9.44629 11.6702 9.3597 11.5107 9.18652C11.3558 9.01335 11.2783 8.79004 11.2783 8.5166C11.2783 8.24772 11.3558 8.02669 11.5107 7.85352C11.6702 7.67578 11.8571 7.58691 12.0713 7.58691C12.2855 7.58691 12.4746 7.67578 12.6387 7.85352C12.8027 8.02669 12.8848 8.24772 12.8848 8.5166C12.8848 8.79004 12.8027 9.01335 12.6387 9.18652C12.4746 9.3597 12.2855 9.44629 12.0713 9.44629Z"})]})})},602499:(e,t,n)=>{n.d(t,{N:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("redo",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M1.45117 10.6826C1.45117 13.4102 3.24219 15.208 6.29785 15.208H7.93848C8.38281 15.208 8.69727 14.873 8.69727 14.4629C8.69727 14.0459 8.38281 13.7109 7.93848 13.7109H6.3457C4.14453 13.7109 2.92773 12.4053 2.92773 10.6211C2.92773 8.84375 4.14453 7.59277 6.3457 7.59277H10.7002L12.2793 7.52441L11.0762 8.53613L9.31934 10.252C9.18262 10.3887 9.10059 10.5527 9.10059 10.7715C9.10059 11.1953 9.39453 11.5029 9.83203 11.5029C10.0234 11.5029 10.2285 11.4141 10.3721 11.2705L14.3027 7.40137C14.46 7.25098 14.542 7.05273 14.542 6.84766C14.542 6.64258 14.46 6.4375 14.3027 6.29395L10.3721 2.4248C10.2285 2.28125 10.0234 2.19238 9.83203 2.19238C9.39453 2.19238 9.10059 2.5 9.10059 2.91699C9.10059 3.14258 9.18262 3.30664 9.31934 3.43652L11.0762 5.15234L12.2793 6.1709L10.7002 6.10254H6.38672C3.2832 6.10254 1.45117 7.96875 1.45117 10.6826Z"})})},698246:(e,t,n)=>{n.d(t,{H:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("rename",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M14.7881 2.5752L15.3008 2.04199C15.5605 1.76855 15.5742 1.39941 15.3213 1.13965L15.1436 0.955078C14.9111 0.722656 14.5283 0.763672 14.2754 1.00977L13.749 1.5293L14.7881 2.5752ZM6.68066 9.87598L8.0752 9.28809L14.2891 3.06738L13.25 2.03516L7.03613 8.25586L6.4209 9.60254C6.35254 9.75977 6.52344 9.9375 6.68066 9.87598ZM4.09668 14.4355H12.0674C13.373 14.4355 14.1387 13.6768 14.1387 12.2207V4.99512L12.7988 6.33496V12.1045C12.7988 12.7676 12.4434 13.1025 11.9854 13.1025H4.17871C3.54297 13.1025 3.19434 12.7676 3.19434 12.1045V4.49609C3.19434 3.83301 3.54297 3.49805 4.17871 3.49805H10.0234L11.3633 2.1582H4.09668C2.62695 2.1582 1.85449 2.91699 1.85449 4.37988V12.2207C1.85449 13.6836 2.62695 14.4355 4.09668 14.4355Z"})})},607155:(e,t,n)=>{n.d(t,{H:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("settings",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M7.30957 15.4814H8.69043C9.25781 15.4814 9.70215 15.1328 9.83203 14.5928L10.1123 13.3828L10.29 13.3145L11.3428 13.9639C11.8213 14.2646 12.3818 14.1895 12.7783 13.7861L13.7354 12.8291C14.1455 12.4258 14.2139 11.8652 13.9131 11.3936L13.2637 10.3477L13.3252 10.1768L14.5352 9.89648C15.0684 9.75977 15.4238 9.31543 15.4238 8.75488V7.4082C15.4238 6.84766 15.0752 6.40332 14.5352 6.2666L13.3389 5.97949L13.2705 5.80176L13.9199 4.75586C14.2207 4.28418 14.1455 3.73047 13.7422 3.31348L12.7852 2.35645C12.3887 1.95996 11.8281 1.88477 11.3564 2.17871L10.3037 2.82129L10.1123 2.74609L9.83203 1.53613C9.70215 0.996094 9.25781 0.647461 8.69043 0.647461H7.30957C6.73535 0.647461 6.29785 0.996094 6.16797 1.53613L5.8877 2.74609L5.69629 2.82129L4.64355 2.17871C4.16504 1.88477 3.60449 1.95996 3.20801 2.35645L2.25098 3.31348C1.84766 3.73047 1.77246 4.28418 2.07324 4.75586L2.72949 5.80176L2.6543 5.97949L1.46484 6.2666C0.917969 6.40332 0.576172 6.84766 0.576172 7.4082V8.75488C0.576172 9.31543 0.924805 9.75977 1.46484 9.89648L2.66797 10.1768L2.73633 10.3477L2.08008 11.3936C1.7793 11.8652 1.85449 12.4258 2.25781 12.8291L3.21484 13.7861C3.61816 14.1895 4.17871 14.2646 4.65039 13.9639L5.70312 13.3145L5.8877 13.3828L6.16797 14.5928C6.29785 15.1328 6.73535 15.4814 7.30957 15.4814ZM7.47363 14.2441C7.35742 14.2441 7.30273 14.1895 7.28223 14.0869L6.87891 12.4053C6.44141 12.3027 6.03125 12.1318 5.69629 11.9199L4.21973 12.8291C4.1377 12.8838 4.05566 12.877 3.9668 12.7949L3.24219 12.0703C3.16699 11.9951 3.16016 11.9131 3.22168 11.8242L4.13086 10.3477C3.93945 10.0264 3.75488 9.61621 3.65234 9.18555L1.96387 8.78223C1.86133 8.76172 1.81348 8.70703 1.81348 8.59082V7.56543C1.81348 7.44238 1.86133 7.39453 1.96387 7.36719L3.65234 6.9707C3.75488 6.5127 3.95312 6.08887 4.11719 5.79492L3.21484 4.3252C3.15332 4.22949 3.15332 4.14746 3.23535 4.06543L3.95996 3.34766C4.04883 3.27246 4.11719 3.25879 4.21973 3.31348L5.68945 4.20898C5.99707 4.02441 6.44824 3.83301 6.87891 3.72363L7.28223 2.04199C7.30273 1.93945 7.35742 1.88477 7.47363 1.88477H8.52637C8.64258 1.88477 8.69727 1.93262 8.71094 2.04199L9.12109 3.7373C9.56543 3.83984 9.96875 4.02441 10.3037 4.21582L11.7734 3.32031C11.876 3.26562 11.9443 3.27246 12.0264 3.35449L12.7578 4.07227C12.8398 4.14746 12.8398 4.22949 12.7783 4.3252L11.876 5.79492C12.04 6.08887 12.2451 6.5127 12.3477 6.9707L14.0293 7.36719C14.1387 7.39453 14.1865 7.44238 14.1865 7.56543V8.59082C14.1865 8.70703 14.1318 8.76172 14.0293 8.78223L12.3408 9.18555C12.2383 9.61621 12.0537 10.0264 11.8691 10.3477L12.7715 11.8242C12.8262 11.9131 12.8262 11.9951 12.751 12.0635L12.0264 12.7949C11.9375 12.877 11.8555 12.8838 11.7734 12.8291L10.2969 11.9199C9.96191 12.1318 9.57227 12.3027 9.12109 12.4053L8.71094 14.0869C8.69727 14.1963 8.64258 14.2441 8.52637 14.2441H7.47363ZM8 10.6621C9.42188 10.6621 10.5908 9.49316 10.5908 8.06445C10.5908 6.64941 9.42188 5.48047 8 5.48047C6.57812 5.48047 5.40234 6.64941 5.40234 8.06445C5.40234 9.49316 6.57129 10.6621 8 10.6621ZM8 9.49316C7.2207 9.49316 6.57812 8.85059 6.57812 8.06445C6.57812 7.29199 7.2207 6.65625 8 6.65625C8.76562 6.65625 9.40137 7.29199 9.40137 8.06445C9.40137 8.84375 8.76562 9.49316 8 9.49316Z"})})},568839:(e,t,n)=>{n.d(t,{g:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("settingsConnectedApps",{viewBox:"0 0 20 20",svg:(0,r.jsx)("path",{d:"M16.492 3.922C15.695 3.125 14.57 3 13.234 3H7.148c-1.312 0-2.437.125-3.234.922C3.117 4.719 3 5.836 3 7.14v6.03c0 1.337.117 2.446.914 3.243.797.797 1.922.922 3.25.922h6.07c1.336 0 2.461-.125 3.258-.922.797-.797.914-1.906.914-3.242V7.164c0-1.336-.117-2.453-.914-3.242zm-.344 3.023v6.438c0 .812-.101 1.64-.578 2.117-.468.469-1.312.578-2.117.578h-6.5c-.805 0-1.648-.11-2.125-.578-.469-.477-.57-1.305-.57-2.117V6.969c0-.82.101-1.664.57-2.133.477-.477 1.328-.578 2.149-.578h6.476c.805 0 1.649.11 2.117.578.477.476.578 1.305.578 2.11zm-3.492 5.149c.344 0 .57-.266.57-.625V7.78c0-.46-.25-.64-.648-.64h-3.71c-.368 0-.602.226-.602.57s.242.57.617.57h1.422l1.156-.125-1.219 1.133-2.875 2.883a.62.62 0 00-.187.422c0 .351.226.578.57.578.188 0 .336-.07.445-.18l2.875-2.875 1.125-1.203-.117 1.219v1.351c0 .368.227.61.578.61z"})})},818441:(e,t,n)=>{n.d(t,{t:()=>o.t});var o=n(11751)},799826:(e,t,n)=>{n.d(t,{s:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("speechBubbleFilled",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M4.32 15.424c.39 0 .677-.192 1.149-.609l2.344-2.064h4.116c2.057 0 3.213-1.19 3.213-3.22V4.22c0-2.03-1.156-3.22-3.213-3.22H3.213C1.163 1 0 2.19 0 4.22V9.53c0 2.037 1.196 3.22 3.165 3.22h.28v1.675c0 .608.322.998.875.998zm.342-1.531v-1.949c0-.403-.178-.56-.56-.56H3.26c-1.285 0-1.9-.65-1.9-1.894V4.26c0-1.243.615-1.893 1.9-1.893h8.627c1.278 0 1.893.65 1.893 1.894v5.23c0 1.243-.615 1.893-1.893 1.893h-4.15c-.417 0-.622.068-.909.369l-2.167 2.14zm-.567-8.668h6.884a.433.433 0 00.423-.438.425.425 0 00-.423-.417H4.095a.419.419 0 00-.417.417c0 .24.184.438.417.438zm0 2.167h6.884a.427.427 0 000-.855H4.095a.425.425 0 00-.417.424c0 .24.184.43.417.43zm0 2.173h4.484c.24 0 .424-.191.424-.423 0-.24-.185-.431-.424-.431H4.095a.422.422 0 00-.417.43.42.42 0 00.417.424z"})})},965353:(e,t,n)=>{n.d(t,{n:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("sub",{viewBox:"0 0 30 30",svg:(0,r.jsx)("path",{d:"M5 3V20H23.187L19.594 16.406L21 15L27 21L21 27L19.594 25.594L23.187 22H3V3H5Z"})})},452452:(e,t,n)=>{n.d(t,{I:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("suggestion",{viewBox:"0 0 16 16",svg:(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M8.651 8.465l-1.397.54c-.088.035-.17.018-.244-.053-.07-.07-.086-.15-.046-.237l.567-1.378 5.945-5.939 1.127 1.12-5.952 5.947zm6.447-6.427L13.97.91l.567-.567a.702.702 0 01.474-.217.615.615 0 01.468.165l.198.184c.136.14.2.306.191.495a.718.718 0 01-.217.494l-.554.574z"}),(0,r.jsx)("path",{d:"M14.084 5.065V9.65c0 .611-.152 1.072-.455 1.384-.299.308-.76.462-1.384.462h-4.1a1.37 1.37 0 00-.488.072 1.147 1.147 0 00-.389.277l-2.09 2.07v-1.879c0-.197-.043-.336-.131-.415-.084-.083-.218-.125-.402-.125H3.74c-.62 0-1.08-.154-1.384-.462-.299-.312-.448-.773-.448-1.384V4.62c0-.606.15-1.063.448-1.37.303-.313.765-.469 1.384-.469h6.36l1.3-1.298H3.71c-.664 0-1.227.123-1.688.369-.457.246-.806.6-1.048 1.061C.73 3.37.61 3.926.61 4.581v5.115c0 .655.121 1.213.363 1.675.246.457.595.808 1.048 1.054.457.246 1.004.37 1.641.37h.356v1.621c0 .294.073.527.218.699.15.171.356.257.62.257.184 0 .358-.049.52-.145a3.65 3.65 0 00.58-.435l2.255-1.998h4.073c.66 0 1.22-.123 1.681-.369a2.492 2.492 0 001.055-1.054c.242-.462.363-1.02.363-1.675V4.581c0-.267-.02-.518-.06-.752l-.208.215-1.031 1.021z"})]})})},330881:(e,t,n)=>{n.d(t,{b:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("sync",{viewBox:"0 0 30 30",svg:(0,r.jsx)("path",{d:"M27.93 13.81h-1.54c-.606-5.717-5.536-10.265-11.387-10.265-3.425 0-6.514 1.55-8.625 3.987-.427.483-.37 1.078.079 1.392.438.315.965.214 1.336-.202a9.57 9.57 0 017.21-3.268 9.503 9.503 0 019.456 8.356h-1.673c-.798 0-1 .539-.573 1.156l2.516 3.583c.359.516.898.528 1.269 0l2.504-3.572c.45-.628.236-1.167-.573-1.167zM2.064 16.202h1.55c.607 5.716 5.526 10.253 11.388 10.253 3.425 0 6.525-1.561 8.636-3.987.416-.483.36-1.09-.078-1.404-.438-.314-.977-.202-1.337.214-1.74 2.01-4.324 3.268-7.221 3.268a9.496 9.496 0 01-9.467-8.344H7.22c.798 0 1-.55.573-1.157l-2.516-3.583c-.359-.516-.898-.527-1.269 0l-2.515 3.572c-.438.617-.236 1.168.572 1.168z"})})},581750:(e,t,n)=>{n.d(t,{s:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("tableHeaderColumn",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M13.7847 14H2.21528C0.756437 14 0 13.2862 0 11.9164V4.0836C0 2.7074 0.756437 2 2.21528 2H13.7847C15.2436 2 16 2.71383 16 4.0836V11.9164C16 13.2862 15.2436 14 13.7847 14ZM14.6762 4.19293C14.6762 3.56913 14.325 3.25402 13.7037 3.25402H7V5.60772H14.6762V4.19293ZM7 6.81672V9.18328H14.6762V6.81672H7ZM13.7037 12.7395C14.325 12.7395 14.6762 12.4309 14.6762 11.8071V10.3923H7V12.7395H13.7037Z"})})},247482:(e,t,n)=>{n.d(t,{f:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("tableHeaderRow",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M13.7847 14H2.21528C0.756437 14 0 13.2862 0 11.9164V4.0836C0 2.7074 0.756437 2 2.21528 2H13.7847C15.2436 2 16 2.71383 16 4.0836V11.9164C16 13.2862 15.2436 14 13.7847 14ZM1.32377 6.81672V9.18328H7.34825V6.81672H1.32377ZM8.645 6.81672V9.18328H14.6762V6.81672H8.645ZM1.32377 11.8071C1.32377 12.4309 1.66821 12.7395 2.29633 12.7395H7.34825V10.3923H1.32377V11.8071ZM13.7037 12.7395C14.325 12.7395 14.6762 12.4309 14.6762 11.8071V10.3923H8.645V12.7395H13.7037Z"})})},382792:(e,t,n)=>{n.d(t,{w:()=>o.w});var o=n(959960)},485103:(e,t,n)=>{n.d(t,{k:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("thinCheck",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M6.385 14.162c.362 0 .642-.15.84-.444L13.652 3.71c.144-.226.205-.417.205-.602 0-.485-.341-.82-.833-.82-.335 0-.54.123-.746.444l-5.926 9.4-3.042-3.903c-.205-.267-.417-.376-.718-.376-.492 0-.848.348-.848.827 0 .212.075.417.253.629l3.541 4.416c.24.3.492.437.848.437z"})})},994980:(e,t,n)=>{n.d(t,{H:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("thinCheckboxCircle",{viewBox:"0 0 22 23",svg:(0,r.jsx)("circle",{cx:"11",cy:"11.5",r:"10",stroke:"#E2E1DE",strokeWidth:"1"})})},249400:(e,t,n)=>{n.d(t,{E:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("thinCheckboxCircleDark",{viewBox:"0 0 22 23",svg:(0,r.jsx)("circle",{cx:"11",cy:"11.5",r:"10",stroke:"#5A5A5A",strokeWidth:"1"})})},767996:(e,t,n)=>{n.d(t,{L:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("topbarComment",{viewBox:"0 0 20 20",svg:(0,r.jsx)("path",{d:"M5.9375 18.4844C6.38281 18.4844 6.71094 18.2656 7.25 17.7891L9.92969 15.4297H14.6328C16.9844 15.4297 18.3047 14.0703 18.3047 11.75V5.67969C18.3047 3.35938 16.9844 2 14.6328 2H4.67188C2.32812 2 1 3.35938 1 5.67969V11.75C1 14.0781 2.36719 15.4297 4.61719 15.4297H4.9375V17.3438C4.9375 18.0391 5.30469 18.4844 5.9375 18.4844ZM6.32812 16.7344V14.5078C6.32812 14.0469 6.125 13.8672 5.6875 13.8672H4.72656C3.25781 13.8672 2.55469 13.125 2.55469 11.7031V5.72656C2.55469 4.30469 3.25781 3.5625 4.72656 3.5625H14.5859C16.0469 3.5625 16.75 4.30469 16.75 5.72656V11.7031C16.75 13.125 16.0469 13.8672 14.5859 13.8672H9.84375C9.36719 13.8672 9.13281 13.9453 8.80469 14.2891L6.32812 16.7344Z"})})},560682:(e,t,n)=>{n.d(t,{y:()=>o.y});var o=n(937612)},39400:(e,t,n)=>{n.d(t,{L:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("triangle",{viewBox:"0 0 100 100",svg:(0,r.jsx)("polygon",{points:"5.9,88.2 50,11.8 94.1,88.2 "})})},319191:(e,t,n)=>{n.d(t,{l:()=>o.l});var o=n(77926)},172360:(e,t,n)=>{n.d(t,{s:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("undo",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M14.542 10.6826C14.542 7.96875 12.71 6.10254 9.59961 6.10254H5.29297L3.70703 6.1709L4.91016 5.15234L6.67383 3.43652C6.80371 3.30664 6.89258 3.14258 6.89258 2.91699C6.89258 2.5 6.59863 2.19238 6.1543 2.19238C5.96973 2.19238 5.76465 2.28125 5.61426 2.4248L1.69043 6.29395C1.5332 6.4375 1.45117 6.64258 1.45117 6.84766C1.45117 7.05273 1.5332 7.25098 1.69043 7.40137L5.61426 11.2705C5.76465 11.4141 5.96973 11.5029 6.1543 11.5029C6.59863 11.5029 6.89258 11.1953 6.89258 10.7715C6.89258 10.5527 6.80371 10.3887 6.67383 10.252L4.91016 8.53613L3.70703 7.52441L5.29297 7.59277H9.64746C11.8486 7.59277 13.0586 8.84375 13.0586 10.6211C13.0586 12.4053 11.8486 13.7109 9.64746 13.7109H8.05469C7.60352 13.7109 7.2959 14.0459 7.2959 14.4629C7.2959 14.873 7.61035 15.208 8.05469 15.208H9.69531C12.751 15.208 14.542 13.4102 14.542 10.6826Z"})})},621386:(e,t,n)=>{n.d(t,{T:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("unsync",{viewBox:"0 0 30 30",svg:(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.768 23.295l1.353 1.351a11.298 11.298 0 01-6.118 1.81c-5.862 0-10.781-4.538-11.387-10.254h-1.55c-.809 0-1.011-.55-.573-1.168l2.516-3.572c.37-.527.91-.516 1.269 0l2.515 3.583c.427.606.225 1.157-.572 1.157H5.536a9.496 9.496 0 009.467 8.344c1.74 0 3.366-.454 4.765-1.251zM10.233 6.723l-1.361-1.36a11.26 11.26 0 016.131-1.818c5.851 0 10.782 4.548 11.388 10.265h1.539c.808 0 1.021.539.572 1.167l-2.504 3.572c-.37.528-.91.516-1.27 0l-2.515-3.583c-.427-.617-.224-1.156.573-1.156h1.673a9.503 9.503 0 00-9.456-8.356 9.55 9.55 0 00-4.77 1.27z"}),(0,r.jsx)("path",{d:"M27.067 28.551c.41.41 1.094.41 1.49 0 .41-.41.41-1.08 0-1.49L2.937 1.454a1.06 1.06 0 00-1.505 0c-.396.396-.396 1.08 0 1.49l25.635 25.607z"})]})})},756903:(e,t,n)=>{n.d(t,{t:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("warning",{viewBox:"0 0 14 14",svg:(0,r.jsx)("path",{d:"M1.619 12.581h9.96c.983 0 1.618-.73 1.618-1.625 0-.266-.07-.54-.21-.793L7.998 1.25a1.593 1.593 0 00-2.8 0L.217 10.163c-.14.26-.216.527-.216.793 0 .895.635 1.625 1.619 1.625zm4.989-4.367c-.375 0-.59-.21-.603-.584l-.089-3.174c-.013-.394.267-.666.686-.666.406 0 .704.279.691.672l-.101 3.162c-.013.387-.222.59-.584.59zm0 2.196c-.432 0-.787-.31-.787-.73 0-.419.349-.73.787-.73.432 0 .78.311.78.73 0 .425-.355.73-.78.73z"})})},553824:(e,t,n)=>{n.d(t,{fA:()=>c,tc:()=>d});var o=n(643593),r=n(182798),i=n(81865),a=n(95477),s=n(296994);const l=["png","jpg","jpeg","webp","heic","heif"];function c(e){if(!e)return!1;const t=o.mD(e);if(!t)return!1;const n=o.E$(e,[a.default.secureFileS3.url,a.default.secureFileS3V2.url]),r=l.includes(t.toLowerCase());return n&&r}async function d(e,t){const n=e.getOriginalImageSource();if((0,r.TO)(n),!n)return;const o=await(0,i.b)({url:n,isAuthenticated:!0,permissionRecord:e.pointer},t),{imageEditActions:a}=await s.FF.imageEdit.load();return a.cropAndUploadImage({store:e,environment:t,proxiedOriginalUrl:o})}},398115:(e,t,n)=>{n.d(t,{$s:()=>c,KB:()=>l,kJ:()=>d,rm:()=>u});n(264572),n(421202),n(218265);var o=n(496802),r=n(800993),i=n(210228),a=(n(95477),n(58202)),s=(n(206258),n(795714));function l(e){const{store:t}=e,n=t.getImageHyperlink()||"",o="placeholder"!==n?n:void 0,r=a.R.getRect(t);s.Z.setState({open:!0,url:"",type:"image",selectionRect:r,store:t,imageHyperlink:o,focusLinkInput:!0})}function c(){s.Z.setState({open:!1,type:"image"})}function d(e){const{url:t,transaction:n}=e,i=s.Z.state;if(!i.open)return;const a=r.bY(t);o.FH({stores:[i.store],update:{image_hyperlink:a},transaction:n}),s.Z.setState({...i,imageHyperlink:a,url:""})}function u(e){const t=s.Z.state;t.open&&(i.createAndCommit({userAction:"imageHyperlink.unlinkImage",environment:e,perform:e=>{o.FH({stores:[t.store],update:{image_hyperlink:null},transaction:e})}}),s.Z.reset())}},795714:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1,type:"image"}}}const i=new r},205659:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(292595),r=n(255652),i=n(504408),a=n(145950);const s=(0,o.exposeDebugValue)("offlineDebugger",new class{constructor(){var e=this;this.enableLogging=!1,this.operationLatency={},this.log=function(t){if(e.enableLogging){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];console.groupCollapsed(t,...o),console.trace(),console.groupEnd()}},this.generateLocalRecordMap=a.yY,this.getLocalRecord=a.Ye,this.getLocalBlocksWithParent=a.Dx}async measure(e,t,n){var o=this;const i=`OFFLINE: ${e}:`;return this.operationLatency[e]||(this.operationLatency[e]=new r.s((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o.log(i,...t)}))),this.operationLatency[e].measureErrors(t,"hit","miss",n)}trace(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.log("OFFLINE:",...t)}debug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.log("OFFLINE:",...t)}traceMiss(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];this.trace(`missed: record ${e}:${t}`,...o)}clearMemory(){i.LK(window.__console.environment)}})},976856:(e,t,n)=>{function o(e,t,n,o,r){const i="y"===r?"scrollTop":"scrollLeft",a=e[i],s=t-a,l=+new Date;let c=!0,d=null;const u=()=>{if(!c)return;window.requestAnimationFrame(u);const r=+new Date,p=Math.floor(function(e,t,n,o){return(e/=o/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}(r-l,a,s,n));d?d===e[i]?(e[i]=p,d=e[i]):c=!1:(e[i]=p,d=e[i]),r>l+n&&(e[i]=t,c=!1,o&&o())};window.requestAnimationFrame(u)}n.d(t,{Z:()=>o})},774482:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isBuyerProfileEnabled:!1,isModalOpen:!1}}}const i=new r},785751:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isMarketplaceCheckoutEnabled:!1,isModalOpen:!1,marketplaceListingId:""}}}const i=new r},775233:(e,t,n)=>{n.d(t,{Z:()=>r});n(21703);var o=n(126263);const r=new class{constructor(){this.pendingEvictions=void 0,this.environmentProvider=void 0,this.environmentProvider=()=>{throw new Error("Environment not ready")},this.pendingEvictions=new Map}getPendingEvictionCount(){return this.pendingEvictions.size}updateEnvironment(e){this.environmentProvider=()=>e}addToPendingEvictions(e,t){const n=(0,o.R)(e),r={...e,timestamp:t};this.pendingEvictions.set(n,r)}removeFromPendingEvictions(e){this.pendingEvictions.delete((0,o.R)(e))}forEachPendingEviction(e){for(const{pointer:t,userId:n,timestamp:o}of this.pendingEvictions.values())e({userId:n,pointer:t,timestamp:o,environment:this.environmentProvider()})}}},679420:(e,t,n)=>{n.d(t,{Z:()=>i});n(21703);var o=n(126263),r=n(421202);const i=new class{constructor(){this.subscribedRecords=void 0,this.pendingUnsubscribeRecords=void 0,this.environmentProvider=void 0,this.environmentProvider=()=>{throw new Error("Environment not ready")},this.subscribedRecords=new Map,this.pendingUnsubscribeRecords=new Map}getPendingUnsubscribeCount(){return this.pendingUnsubscribeRecords.size}updateEnvironment(e){this.environmentProvider=()=>e}getSubscriptionForRecord(e){return this.subscribedRecords.get((0,o.R)(e))}isSubscribedToRecord(e){const t=this.subscribedRecords.get((0,o.R)(e));return Boolean(t)}addToSubscribedRecords(e){const t=(0,o.R)(e),n={...e};this.subscribedRecords.set(t,n)}removeFromSubscribedRecords(e){const t=(0,o.R)(e);this.subscribedRecords.delete(t)}addToPendingUnsubscribeRecords(e,t){const n=(0,o.R)(e),r={...e,timestamp:t};this.pendingUnsubscribeRecords.set(n,r)}removeFromPendingUnsubscribeRecords(e){this.pendingUnsubscribeRecords.delete((0,o.R)(e))}forEachPendingUnsubscribeRecord(e){for(const{pointer:t,userId:n,timestamp:o}of this.pendingUnsubscribeRecords.values())e({userId:n,pointer:t,timestamp:o,environment:this.environmentProvider()})}reset(){this.subscribedRecords=new Map,this.pendingUnsubscribeRecords=new Map}safelyGetEnvironment(){try{return this.environmentProvider()}catch(e){return}}getSubscribedBlockDebuggingData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.safelyGetEnvironment();if(!t)return;const n={loadedBlockTypes:{},loaded:0,notLoaded:0};for(const[o,i]of this.subscribedRecords.entries())if((e||!this.pendingUnsubscribeRecords.has(o))&&i.pointer.table===r.iU){const e=t.defaultRecordCache.inMemoryRecordCache.getRecord(i);if(e&&e.value){const t=e.value.type;t in n.loadedBlockTypes||(n.loadedBlockTypes[t]=0),n.loadedBlockTypes[t]+=1,n.loaded+=1}else n.notLoaded+=1}return n}}},32223:(e,t,n)=>{n.r(t),n.d(t,{isConnected:()=>i.Mb,isConnecting:()=>i.J9,resetRecordSubscriptions:()=>a,updateEnvironment:()=>s});var o=n(775233),r=n(679420),i=n(851013);function a(){r.Z.reset()}function s(e){r.Z.updateEnvironment(e),o.Z.updateEnvironment(e)}},851013:(e,t,n)=>{n.d(t,{vj:()=>Fe,mb:()=>V,cO:()=>De,C$:()=>N,EM:()=>be,ZN:()=>_e,Tm:()=>ye,gE:()=>Se,Mb:()=>pe,J9:()=>me,id:()=>ge,Ap:()=>Ee,eg:()=>Ze,Tg:()=>Me,Ji:()=>Re,Ld:()=>Ve,hd:()=>Ue,r1:()=>Oe,L4:()=>Ae,g4:()=>fe});n(757658),n(21703);var o=n(568626),r=n(471924),i=n(990038),a=n(657347),s=n(937850),l=n(701525);const c=class{constructor(e){this.performRequests=void 0,this.batchSize=void 0,this.maxWorkers=void 0,this.maxDelayMs=void 0,this.timeSource=void 0,this.queue=[],this.workerTasks=new Map,this.nextWorkerId=0,this.currentWorkers=0,this.requestsRunning=0,this.awaitingTimeout=!1,this.dequeue=async()=>{if(this.currentWorkers>=this.maxWorkers||0===this.queue.length)return;const e=this.nextWorkerId;this.nextWorkerId++,this.currentWorkers++;const t=this.queue.splice(0,this.batchSize),n=t.map((e=>e[0]));let o,r;this.workerTasks.set(e,t),this.requestsRunning+=t.length;try{o=await this.performRequests(n)}catch(i){r=(0,a.t)(i)}try{if(r)for(let e=0;e<t.length;e++){t[e][1].reject(r)}else if(o)for(let e=0;e<t.length;e++){const n=t[e],r=o[e];n[1].resolve(r)}}catch(i){}this.currentWorkers--,this.workerTasks.delete(e),this.requestsRunning-=t.length,this.dequeueAfterFilledBatchOrTimeout()};const{performRequests:t,batchSize:n,maxWorkers:o,maxDelayMs:r}=e;this.performRequests=t,this.batchSize=n,this.maxWorkers=o,this.maxDelayMs=r,this.timeSource=l.O}getStats(){return{queue:this.queue.length,running:this.requestsRunning,workers:this.currentWorkers}}updateTimeSource(e){this.timeSource=e}updateBatchSize(e){this.batchSize=e}updateMaxDelayMs(e){this.maxDelayMs=e}updateMaxWorkers(e){this.maxWorkers=e,this.dequeueAfterFilledBatchOrTimeout()}enqueue(e){const t=s.UZ();return this.queue.push([e,t]),this.dequeueAfterFilledBatchOrTimeout(),(0,i.m)({promise:t.promise,canCancel:()=>this.queue.some((e=>e[1]===t)),cancel:e=>{const n=this.queue.findIndex((e=>e[1]===t));n>=0&&(this.queue.splice(n,1),t.reject(e))}})}dequeueAfterFilledBatchOrTimeout(){this.queue.length>=this.batchSize?this.dequeue():this.awaitingTimeout||(this.awaitingTimeout=!0,this.timeSource.setTimeout((()=>{this.awaitingTimeout=!1,this.dequeue()}),this.maxDelayMs))}cancel(){const e=this.workerTasks,t=this.queue;this.workerTasks=new Map,this.queue=[];for(const n of e.values())for(const e of n)e[1].reject(new Error("CanceledTask."));for(const n of t)n[1].reject(new Error("CanceledTask."))}};var d=n(575189),u=n(144615),p=n(712139),m=n(653965),g=n(552629),f=n(476870),h=n(619584),v=n(63811),y=n(855337),b=n(385555),_=n(198720);var S=n(95477),k=n(318245),w=n(788632);const x=window.location.host.endsWith(S.default.publicDomainName);var I=n(701302);function C(e,t){I.default.afterNextFlush((()=>{b.default.checkGate({gateName:"message_store_client_send_request_metric_enabled"})&&y.K4(e,"message_store.client.send_request",t)}))}const T=async()=>Promise.all([n.e(69053),n.e(87168)]).then(n.bind(n,614854)),M=!1,P=90*h.C0,A=.5*h.C0,R=30*h.C0,D=3e3,B=10*h.C0,E={versions:!0,collection:!0,activity:!0,notification:!0,teams_in_space:!0,user_page_visit:!0,backlinks:!0,user_content:!0,page_visit:!0,user_shared_pages_in_space:!0,presence:!0,user_joined_teams_in_space:!0,teams_migration_completed_in_space:!0,diagnosticPing:!0,_other:!0};function F(e){const t=e.indexOf("/");if(-1===t)return"_other";const n=e.substring(0,t);return n in E?n:"_other"}function Z(e,t){var n;const o=F(t),r=null===(n=(0,u.pz)(t))||void 0===n?void 0:n.table,i=e[o];if(i){if(r){const e=i[r];if(!e)return void Je(`Warning: "${o}.${r}" has no existing counters!`);i[r]=e-1}i._total-=1,e._total-=1}else Je(`Warning: "${o}" has no existing counters!`)}function U(e){return{_id:e,charactersSent:0,requestsSent:0,requestsTimedOut:0,responsesReceivedWithoutHandlers:0,successfulResponsesReceived:0,unsuccessfulResponsesReceived:0,invalidMessagesReceived:0,notificationsReceived:0,messagesReceived:0}}function V(){return{...ae}}function N(e){const t=ae;if(e._id===t._id)return{charactersSent:t.charactersSent-e.charactersSent,requestsSent:t.requestsSent-e.requestsSent,requestsTimedOut:t.requestsTimedOut-e.requestsTimedOut,responsesReceivedWithoutHandlers:t.responsesReceivedWithoutHandlers-e.responsesReceivedWithoutHandlers,successfulResponsesReceived:t.successfulResponsesReceived-e.successfulResponsesReceived,unsuccessfulResponsesReceived:t.unsuccessfulResponsesReceived-e.unsuccessfulResponsesReceived,invalidMessagesReceived:t.invalidMessagesReceived-e.invalidMessagesReceived,notificationsReceived:t.notificationsReceived-e.notificationsReceived,messagesReceived:t.messagesReceived-e.messagesReceived}}const O=new Map,L=new Map;class j extends Map{isCancelable(e){return Boolean(this.getCancelable(e))}getCancelable(e){const t=this.get(e);if(null!=t&&t.canCancel())return t}}const K=new j,z=new j,q=new Map,H=new Map,G=Date.now();let W={_total:0};const $="messageStoreInternals",Y=new o.BatchedLogger({from:$,type:"BulkDebug",level:"info",maxLength:250,logToConsole:M});let Q,J,X,ee,te,ne=0,oe=0,re=0,ie=0,ae=U(0),se=0,le=l.O,ce=!1,de="uninitialized",ue=!0;function pe(){return"open"===de}function me(){return"uninitialized"===de||"opening"===de}const ge=!0;function fe(e,t){let n=H.get(e);n||(n={},H.set(e,n)),Object.assign(n,t)}function he(e){Y.log({level:"info",from:$,type:e})}function ve(){J=xe(this),he(`ping:${J}`),Q=Date.now(),Je(`Incoming primus ping received from server via ${J}.`)}function ye(){return W}function be(){return{...Le.getStats(),batchSubscribeQueue:Ke.getStats(),batchUnsubscribeQueue:ze.getStats()}}function _e(e){const{lastOfflineTimestamp:t}=w.Z.getState(),n=be(),{batchSubscribeQueue:o,batchUnsubscribeQueue:r}=n;return{currentConnectionCounters:ae,timeSinceLastIncomingPing:Q&&e-Q,lastIncomingPingTransportType:J,timeSinceLastResponseReceived:X&&e-X,timeSinceLastReadyStateChange:ee&&e-ee,timeSinceLastOffline:t&&e-t,largestMessageSize:se||void 0,messageStoreRequestsQueued:n.queue,messageStoreRequestsRunning:n.running,batchSubscribeQueue:o,batchUnsubscribeQueue:r,messageStoreConnectionState:de,uptime:e-G,subscriptionCounters:W,primusEndEventsReceived:oe,primusErrorEventsReceived:re,connectionResetsDueToFailedRequests:ie}}function Se(){const e=[];L.forEach(((t,n,o)=>{const r=(0,u.pz)(n);r&&t.value&&e.push({id:r.id,table:r.table,version:t.value})}));const t=m.vM(e,(e=>e.table)),n={};return Object.entries(t).map((e=>{let[t,n]=e;const o={};return n.forEach((e=>{o[e.id]=e.version})),{table:t,value:o}})).forEach((e=>{n[e.table]=e.value})),n}function ke(e){switch(Y.log({level:"info",from:$,type:"readyStateChange",data:{message:e}}),ee=Date.now(),e){case"end":de="closed";break;case"open":de="open";break;case"opening":de="opening"}}const we=m.HP((e=>async function(e){if(x)return;ne+=1;const{createClient:t}=await T(),n=t({minReconnectDelayMs:4*h.C0,maxReconnectDelayMs:8*h.C0});return n.on("data",(t=>function(e,t){ae.messagesReceived+=1;const n=(0,v.Gu)(d.yx,e);if(n)return ae.invalidMessagesReceived+=1,void o.rateLimitedLog({level:"warning",from:$,type:"ValidationError",data:{miscDataToConvertToString:e},error:(0,g.Ui)(n)});const i=e;if("response"===i.type){var a;const{requestId:e,status:t,result:n}=i,o=q.get(e);if(q.delete(e),Y.log({level:"info",from:$,type:"responseReceived",data:{requestId:e,response:t,time:o&&Date.now()-o.sendTime,internalProcessingTimeMs:null===(a=i.result)||void 0===a?void 0:a.internalProcessingTimeMs}}),!o)return void(ae.responsesReceivedWithoutHandlers+=1);X=Date.now(),window.clearTimeout(o.timeout),"ok"===t?(ae.successfulResponsesReceived+=1,o.resolve(n)):(ae.unsuccessfulResponsesReceived+=1,o.reject(new Qe(n)))}else{ae.notificationsReceived+=1;const{ackId:e,key:n,value:a,version:l,passThroughData:c}=i;e&&async function(e){if(x)return;const{method:t,request:n,environment:o}=e,i=await $e(o);(function(e,t){I.default.afterNextFlush((()=>{b.default.checkGate({gateName:"send_request_ack_metric_enabled"})&&y.j({environment:e,event:{eventName:"message_store.client.send_request_ack",eventProperties:t}})}))})(o,{primus_transport_type:i}),Le.enqueue((()=>(Ye({message:{type:`${S.default.messageStore.api}/${t}`,requestId:r.Il(),...n},environment:o}),Promise.resolve({}))))}({method:"ackNotification",request:{ackId:e},environment:t});const d=O.get(n);if(!d)return;L.set(n,{version:l,value:a,passThroughData:c});for(const{listener:t}of d)try{t(n,a,c,l)}catch(s){o.log({level:"warning",from:$,type:"ListenerError",error:(0,g.Ui)(s)})}}}(t,e))),n.on("open",(()=>{he("open"),function(e){(function(e){const t=_.Z.state.numConnectionAttempts;b.default.checkGate({gateName:"log_messagestore_attempts"})&&(0,y.j)({environment:e,event:{eventName:"message_store.client.num_connection_attempts",eventProperties:{num_connection_attempts:t}}}),_.Z.setState({isConnected:!0,numConnectionAttempts:0})})(e),ae=U(ae._id+1),ue?(ue=!1,Ie(e)):(te&&window.clearTimeout(te),te=window.setTimeout((()=>{pe()&&Ie(e)}),1e3));M&&function(){const e=Date.now(),t=20;function n(){const o=be();function r(e){return 0===e.queue&&0===e.running}if(r(o)&&r(o.batchSubscribeQueue)&&r(o.batchUnsubscribeQueue))return Je(`Queues emptied after ${Date.now()-e} ms`),void(Ce=void 0);Ce=window.setTimeout(n,t)}Ce&&window.clearTimeout(Ce);Je("Starting measurement of time until send queues are empty."),n()}()}(e)})),n.on("reconnected",(e=>{Pe(),Y.log({level:"info",from:$,type:"reconnected",data:{message:`Reconnected in ${null==e?void 0:e.duration} ms`}})})),n.on("reconnect",(()=>{he("reconnect")})),n.on("reconnect scheduled",(e=>{_.Z.update((e=>({isConnected:!1,numConnectionAttempts:e.numConnectionAttempts+1}))),Y.log({level:"info",from:$,type:"reconnect scheduled",data:{message:`Reconnecting in ${null==e?void 0:e.scheduled} ms, attempt ${null==e?void 0:e.attempt} of ${null==e?void 0:e.retries}`}})})),n.on("reconnect timeout",(()=>{he("reconnect timeout")})),n.on("reconnect failed",(()=>{he("reconnect failed")})),n.on("timeout",(()=>{he("timeout")})),n.on("destroy",(()=>{he("destroy")})),n.on("close",(()=>{he("close")})),n.on("online",(()=>{he("online")})),n.on("offline",(()=>{he("offline")})),n.on("error",(e=>{let t;t="TransportError"===e.type?{level:"info",from:$,type:"primusTransportError",error:(0,g.Ui)(e)}:{level:"error",from:$,type:"unknownPrimusError",error:(0,g.Ui)(e)};(0,f.lB)(1)&&o.rateLimitedLog(t),Y.log(t),re+=1})),n.on("incoming::ping",ve),n.on("readyStateChange",ke),n.on("end",(()=>{he("end"),n.off("readyStateChange",ke),oe+=1,async function(e,t){var n,r;o.log({level:"info",from:$,type:"messageStoreEnd",error:{message:`SocketId: ${null==e||null===(n=e.socket)||void 0===n?void 0:n.id} Query:${null==e||null===(r=e.transport)||void 0===r?void 0:r.query}`}}),te&&(window.clearTimeout(te),te=void 0);Pe(),le.setTimeout((()=>{void 0!==e&&e.destroy()}),0);const i=await we(t);if(e!==i)return;we.cache.clear(),le.setTimeout((()=>{we(t)}),2*h.C0)}(n,e)})),window.__primusClient=n,n}(e)),(function(){return"primus"}));function xe(e){var t;const n=null==e||null===(t=e.socket)||void 0===t||null===(t=t.transport)||void 0===t||null===(t=t.query)||void 0===t?void 0:t.transport;if("websocket"===n||"polling"===n)return n}function Ie(e){te&&(window.clearTimeout(te),te=void 0),O.forEach(((t,n)=>{const r=L.get(n);Be(n,r?r.version:-1,e).catch((e=>{o.log({level:"warning",from:$,type:"ReconnectSubscriptionError",error:(0,g.Ui)(e)})}))}))}let Ce,Te;function Me(e){if(Te)throw new Error("Having more than one onRestartMessageStoreConnectionHandler is not currently supported");Te=e}function Pe(){var e;ce=!1,Ke.cancel(),ze.cancel(),function(){for(const e of q.values())window.clearTimeout(e.timeout);q.clear()}(),K.clear(),z.clear(),qe.cancel(),Le.cancel(),H.clear(),W={_total:0},null===(e=Te)||void 0===e||e()}async function Ae(e){var t;const{key:n,field:o,updates:r,ttl:i,environment:a,onDisconnectFields:s}=e,l=await $e(a);await(null===(t=We({method:"updateField",request:{key:n,field:o,updates:r,ttl:i,onDisconnectFields:s},environment:a,primusTransportType:l}))||void 0===t?void 0:t.response)}async function Re(e){var t;const{key:n,field:o,value:r,ttl:i,environment:a}=e,s=await $e(a);await(null===(t=We({method:"setField",request:{key:n,field:o,value:r,ttl:i},environment:a,primusTransportType:s}))||void 0===t?void 0:t.response)}async function De(e){if(x)return{type:"messageStoreDisabled"};const t=r.Il(),{environment:n}=e,o=(0,u.JK)(t),i="diagnosticPing",a=s.UZ(),l=e.logToConsole??M,c={};function d(e,t){c[e]=t,l&&console.log(`diagnosticPing ${e}=${t}`)}const m=await s.aM(async function(){var e;const r=await $e(n),s=performance.now();await Ve(o,((e,t)=>{t&&a.resolve(performance.now())}),i,n);const l=performance.now(),u=l-s;d("registerSubscriptionResponseMs",u);const p=await(null===(e=We({method:"diagnosticPing",request:{id:t},environment:n,primusTransportType:r,onRequestSent:()=>{d("diagnosticPingEnqueuedMs",performance.now()-l)}}))||void 0===e?void 0:e.response);if(!p)return{type:"canceled",key:o,...c};const m=function(e){const t=c[e];if(void 0===t)throw new Error(`Assertion failure, expected timing for "${e}" to be defined`);return t}("diagnosticPingEnqueuedMs"),g=p.setValueTime;d("diagnosticPingServerSideSetValueMs",g);const f=performance.now()-l;d("diagnosticPingResponseMs",f);const h=await a.promise-l;d("diagnosticPingNotificationMs",h);const v=performance.now();await Oe(o,i,n);const y=performance.now();return{type:"success",key:o,registerSubscriptionResponseMs:u,diagnosticPingEnqueuedMs:m,diagnosticPingServerSideSetValueMs:g,diagnosticPingResponseMs:f,diagnosticPingNotificationMs:h,unregisterSubscriptionResponseMs:y-v,totalMs:y-s}}().catch((e=>(p.rn(e,{from:$,type:"diagnosticPingError",data:{key:o}}),{type:"error",key:o,...c}))),R);return m.timeout?{type:"timeout",key:o,...c}:m.result}async function Be(e,t,n){ge&&fe(e,{latestRegisterSubscriptionRequestTimestamp:Date.now()}),function(e,t){var n;const o=F(t),r=null===(n=(0,u.pz)(t))||void 0===n?void 0:n.table;let i=e[o];if(i||(i={_total:0},e[o]=i),r){const e=i[r]||0;i[r]=e+1}i._total+=1,e._total+=1}(W,e);const o=z.getCancelable(e);if(o)o.cancel(new Error("Cancelled by sendRegisterSubscription()"));else{const o={key:e,version:t},r=Ke.enqueueCancelable({request:o,environment:n});if(r){K.set(e,r.asyncQueuePromise);try{await r.response}finally{K.delete(e)}}}ge&&fe(e,{latestRegisterSubscriptionResponseTimestamp:Date.now()})}function Ee(e){return K.isCancelable(e)}function Fe(e,t){const n=K.getCancelable(e);if(!n)throw new Error(`Assertion failure, subscription request for key ${e} does not exist or is not cancelable`);Ne(e,t)&&(Z(W,e),n.cancel(new Error("Cancelled by cancelRegisterSubscription()")),ge&&H.delete(e))}async function Ze(e,t,n){var o;const r=await $e(n);await(null===(o=We({method:"registerOnDisconnect",request:{disconnectId:e,operations:t},environment:n,primusTransportType:r}))||void 0===o?void 0:o.response)}async function Ue(e,t){var n;const o=await $e(t);await(null===(n=We({method:"unregisterOnDisconnect",request:{disconnectId:e},environment:t,primusTransportType:o}))||void 0===n?void 0:n.response)}async function Ve(e,t,n,o){if(x)return;let r=O.get(e);if(!r||0===r.length)return r=[{listener:t,listenerId:n}],O.set(e,r),void(pe()?await Be(e,-1,o):"uninitialized"===de&&await we(o));if(r.find((e=>e.listenerId===n)))r=[...r.filter((e=>e.listenerId!==n)),{listener:t,listenerId:n}],O.set(e,r);else{r=[...r,{listener:t,listenerId:n}],O.set(e,r);const o=L.get(e);o&&t(e,o.value,o.passThroughData)}}function Ne(e,t){if(x)return!1;const n=O.get(e);if(!n)return!1;const o=n.filter((e=>e.listenerId!==t));return o.length!==n.length&&(0===o.length?(O.delete(e),L.delete(e),!0):(O.set(e,o),!1))}async function Oe(e,t,n){Ne(e,t)&&pe()&&await async function(e,t){ge&&fe(e,{latestUnregisterSubscriptionRequestTimestamp:Date.now()}),Z(W,e);const n=K.getCancelable(e);if(n)n.cancel(new Error("Cancelled by sendUnregisterSubscription()"));else{const n={key:e},o=ze.enqueueCancelable({request:n,environment:t});if(o){z.set(e,o.asyncQueuePromise);try{await o.response}finally{z.delete(e)}}}ge&&H.delete(e)}(e,n)}const Le=new i.z(20);class je{constructor(e,t){this.queue=void 0,this.wrappedPerformRequests=async e=>{const t=e[0].environment;Je(`Sending a batch of ${e.length} ${this.methodName} requests.`);const n=this.performRequests(t,e.map((e=>e.request)));if(!n)throw new Error("MessageStore is disabled.");const o=await n;if(!o)throw new Error("Request cancelled.");return o},this.methodName=e,this.performRequests=t,this.queue=new c({performRequests:this.wrappedPerformRequests,batchSize:250,maxDelayMs:A,maxWorkers:1})}updateTimeSource(e){this.queue.updateTimeSource(e)}getStats(){return this.queue.getStats()}cancel(){this.queue.cancel()}enqueueCancelable(e){if(x)return;const t=this.queue.enqueue(e),n=t.catch((e=>{Je(`enqueueCancelable() for ${this.methodName} cancelled (${e.message})`)}));return{asyncQueuePromise:t,response:n}}}const Ke=new je("registerSubscription",((e,t)=>qe.enqueue((async()=>{var n;const o=await $e(e),r=We({method:"registerBatchSubscriptions",request:{subscriptions:t},environment:e,primusTransportType:o});return null===(n=await(null==r?void 0:r.response))||void 0===n?void 0:n.responses})))),ze=new je("unregisterSubscription",((e,t)=>qe.enqueue((async()=>{var n;const o=await $e(e),r=We({method:"unregisterBatchSubscriptions",request:{keys:t.map((e=>e.key))},environment:e,primusTransportType:o});return null===(n=await(null==r?void 0:r.response))||void 0===n?void 0:n.keys.map((e=>({key:e})))})))),qe=new i.z(1);let He;function Ge(){if(!He)return;const{totalRequests:e,requestCounts:t,startTime:n}=He;Je("checkRequestThroughputForBurstWarning requestCounts =",t),e>D&&o.log({level:"warning",from:$,type:"BurstThroughputExceeded",data:{time:Date.now()-n,totalRequests:e,requestCounts:t}}),He=void 0}function We(e){if(x)return;const{method:t,request:n,environment:o,primusTransportType:i}=e,a=k.default.DO_NOT_USE_markLegacy("message_store.client.send_request.in_queue_time");C(o,{status:"enqueued",primus_transport_type:i,endpoint:t}),ge&&function(e){He||(He={startTime:Date.now(),totalRequests:0,requestCounts:{}},le.setTimeout(Ge,B)),He.totalRequests+=1,He.requestCounts[e]=(He.requestCounts[e]||0)+1}(t);const l=Le.enqueue((()=>{var l;const c=r.Il();!function(e,t){I.default.afterNextFlush((()=>{b.default.checkGate({gateName:"message_store_client_send_request_metric_enabled"})&&(y.K4(e,"message_store.client.send_request.queue_running_size",{value:t.running}),y.K4(e,"message_store.client.send_request.queue_backup_size",{value:t.queue}))}))}(o,Le.getStats());const d=k.default.DO_NOT_USE_markLegacy("message_store.client.send_request.round_trip_time");k.default.DO_NOT_USE_measureLegacy(a,{environment:o,data:{endpoint:t}});const u=s.UZ(),p=Date.now(),m=ge?window.setTimeout((()=>{"open"===de&&(ae.requestsTimedOut+=1,Y.log({level:"info",from:$,type:"requestTimeout",data:{requestId:c,time:Date.now()-p}}))}),P):void 0;q.set(c,{resolve:u.resolve,reject:u.reject,timeout:m,sendTime:p}),Y.log({level:"info",from:$,type:"requestSent",data:{requestId:c,method:t}});const g={type:`${S.default.messageStore.api}/${t}`,requestId:c,...n};return ae.requestsSent+=1,Ye({message:g,environment:o}),null===(l=e.onRequestSent)||void 0===l||l.call(e),u.promise.then((e=>{k.default.DO_NOT_USE_measureLegacy(d,{environment:o,data:{endpoint:t}}),C(o,{status:"success",primus_transport_type:i,endpoint:t})})).catch((e=>{const n=Le.getStats();C(o,{status:"failure",primus_transport_type:i,endpoint:t,queue_running_size:n.running,queue_backup_size:n.queue})})),u.promise}));return{response:l.catch((e=>{e instanceof Qe&&!ce?(ce=!0,ie+=1,he("connectionResetDueToFailedRequest"),we(o).then((e=>{null==e||e.end()})),Je(`sendRequest() for ${t} returned server error (${e.message}), resetting connection`,n)):Je(`sendRequest() cancelled or errored for ${t} (${e.message})`,n)})),asyncQueuePromise:l}}async function $e(e){const t=await we(e);if(t){const e=xe(t);if(e)return e}return"unknown"}async function Ye(e){const{message:t,environment:n}=e,o=JSON.stringify(t);ae.charactersSent+=o.length,se<o.length&&(se=o.length);const r=await we(n);null==r||r.write(t)}class Qe extends Error{constructor(e){super(e),this.name="FailedMessageStoreRequestError"}}function Je(){if(M){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.info("messageStoreInternals:",...t)}}},702688:(e,t,n)=>{n.d(t,{Qk:()=>c,ZP:()=>l});var o=n(89101),r=n(841641),i=n(851013);class a{constructor(){this.uniqueIdCounter=0}addListener(e,t,n,o){if((0,r.Z)(e))return n||(n=this.computeNewSubscriptionId()),i.Ld(e,t,n,o),{key:e,subscriptionId:n}}removeListener(e,t){let{key:n,subscriptionId:o}=e;(0,r.Z)(n)&&i.r1(n,o,t)}async updateField(e,t,n,o,r,a){await i.L4({key:e,field:t,updates:n,ttl:o,environment:r,onDisconnectFields:a})}async setField(e,t,n,o,r){await i.Ji({key:e,field:t,value:n,ttl:o,environment:r})}async onDisconnect(e,t,n,o){const r=`${n}/${e}`;await i.eg(r,t,o)}async clearOnDisconnect(e,t,n){const o=`${t}/${e}`;await i.hd(o,n)}computeNewSubscriptionId(){return this.uniqueIdCounter+=1,`subscription:${this.uniqueIdCounter}`}}class s{constructor(){this.isQueuingListeners=!0,this.queuedListeners=[],this.defaultMessageDispatcher=new a}addListener(e,t,n,o){return this.isQueuingListeners?(n||(n=this.defaultMessageDispatcher.computeNewSubscriptionId()),this.queuedListeners=[...this.queuedListeners.filter((t=>t.key!==e||t.subscriptionId!==n)),{key:e,listener:t,subscriptionId:n}],{key:e,subscriptionId:n}):this.defaultMessageDispatcher.addListener(e,t,n,o)}removeListener(e,t){let{key:n,subscriptionId:o}=e;this.isQueuingListeners?this.queuedListeners=this.queuedListeners.filter((e=>e.key!==n&&e.subscriptionId!==o)):this.defaultMessageDispatcher.removeListener({key:n,subscriptionId:o},t)}updateField(e,t,n,o,r){return Promise.resolve()}setField(e,t,n,o,r){return Promise.resolve()}onDisconnect(e,t,n,o){return Promise.resolve()}clearOnDisconnect(e,t,n){return Promise.resolve()}stopQueueingSubscriptions(e){this.isQueuingListeners&&(this.queuedListeners.forEach((t=>{this.defaultMessageDispatcher.addListener(t.key,t.listener,t.subscriptionId,e)})),this.queuedListeners=[],this.isQueuingListeners=!1)}}const l=window.location.pathname===o.VP.quickSearch?new s:new a;function c(e){let t=!1;return function(){if(t)return e(...arguments);t=!0}}},169151:(e,t,n)=>{n.r(t),n.d(t,{cancelEviction:()=>R,subscribe:()=>P,unsubscribe:()=>F,unsubscribeAfterDelay:()=>V,unsubscribeForAllUsers:()=>B});n(21703);var o=n(701302),r=n(292595),i=n(568626),a=n(144615),s=n(841641),l=n(619584),c=n(504408),d=(n(95477),n(385555)),u=n(453730),p=(n(757658),n(471924),n(476870),n(937850),n(103022),n(21359),n(679420)),m=n(851013);const g=!1,f=!1,h=60*l.C0,v=15*l.C0;l.C0;class y{constructor(e){this.map=new Map,this.timeoutMs=e}set(e){const{key:t,onTimeout:n,onClear:o,value:r}=e;this.clear(t);const i=window.setTimeout((()=>{this.map.delete(t),null==n||n()}),this.timeoutMs);this.map.set(t,{timeout:i,value:r,onClear:o})}get(e){var t;return null===(t=this.map.get(e))||void 0===t?void 0:t.value}clear(e){const t=this.map.get(e);var n;void 0!==t&&(window.clearTimeout(t.timeout),this.map.delete(e),null===(n=t.onClear)||void 0===n||n.call(t))}has(e){return this.map.has(e)}}const b=new y(h),_=new y(v);var S=n(600606),k=n(182798);var w=n(775233),x=n(702688);const I="recordSubscriptionActions";function C(e,t,n){const o=a.pz(t);o?null===n||"number"==typeof n?(m.id&&((0,m.g4)(t,{latestUpdateTimestamp:Date.now()}),function(e){if(g&&f)return;const t=b.get(e);t&&(t.latestUpdate=Date.now()),_.clear(e)}(t)),T({environment:e,pointer:o,version:n})):i.rateLimitedLog({level:"warning",from:"handleRemoteVersionUpdate",type:"ValidationError",data:{key:t,miscDataToConvertToString:{pointer:o,version:n}}}):i.rateLimitedLog({level:"warning",from:"handleRemoteVersionUpdate",type:"ValidationError",data:{key:t,miscDataToConvertToString:{version:n}}})}function T(e){const{environment:t,pointer:n,version:o}=e,r=[void 0,...t.currentUser.loggedInUserIds];for(const i of r){if(p.Z.getSubscriptionForRecord({userId:i,pointer:n})){const r=t.defaultRecordCache.inMemoryRecordCache.getVersion({pointer:n,userId:i});if(u.transactionQueue.isPendingTransactionForRecord(n))return void(d.default.checkGate({gateName:"defer_remote_version_update_for_pending_tx"})&&M.deferUntilTransactionIsDone(e));if(d.default.getConfigKey("always_force_refetch_for_specific_tables","tables").includes(n.table))return void c.HB({environment:t,inMemoryRecordCache:t.defaultRecordCache.inMemoryRecordCache,pointer:n,userId:i});(null===o||o>r)&&c.bG({environment:t,inMemoryRecordCache:t.defaultRecordCache.inMemoryRecordCache,pointer:n,userId:i})}}}const M=new class{constructor(e){this.recordUpdates=new Map,this.handleRemoteVersionUpdateForPointer=e}deferUntilTransactionIsDone(e){const{pointer:t,version:n}=e,o=S.dr.toKey(t).toString(),r=this.recordUpdates.get(o);if(r)null===r.version||(null===n||n>r.version)&&this.recordUpdates.set(o,e);else{if(!u.transactionQueue.isPendingTransactionForRecord(t))throw new Error("Pending transaction must exist for record");this.recordUpdates.set(o,e),u.transactionQueue.awaitRecordTransaction(t).then((()=>{const e=(0,k.TO)(this.recordUpdates.get(o),"Pending record update for key must exist");this.recordUpdates.delete(o),this.handleRemoteVersionUpdateForPointer(e)}))}}}(T);function P(e){const{pointer:t,userId:n,environment:r}=e,i={pointer:t,userId:n};A(t)||(R({pointer:t,userId:n}),p.Z.isSubscribedToRecord(i)||(p.Z.addToSubscribedRecords(i),o.default.afterNextFlush((()=>{const o=r.defaultRecordCache.inMemoryRecordCache.getRecord(i);o?D({record:o,...e}):c.bG({environment:r,inMemoryRecordCache:r.defaultRecordCache.inMemoryRecordCache,userId:n,pointer:t}).then((t=>{D({record:t,...e})}),(()=>{p.Z.removeFromSubscribedRecords(i)}))}))))}function A(e){return!e.id||!e.table||("emptyDroppableKey"===e.id||"placeholder"===e.id)}function R(e){const{pointer:t,userId:n}=e,o={pointer:t,userId:n};A(t)||(p.Z.removeFromPendingUnsubscribeRecords(o),w.Z.removeFromPendingEvictions(o))}function D(e){const{environment:t,pointer:n,userId:o,record:r}=e,l={pointer:n,userId:o};if(!p.Z.isSubscribedToRecord(l))return;const c=a.ZS(n);(0,s.Z)(c)&&(n.id&&n.table?x.ZP.addListener(c,((e,n)=>C(t,e,n)),I,t):i.rateLimitedLog({level:"warning",from:"recordSubscriptionActions:subscribe",type:"KeyValidationError",data:{pointer:n,miscDataToConvertToString:{record:r,key:l,versionsKey:c}}}))}function B(e){for(const t of e.environment.currentUser.loggedInUserIds)F({...e,userId:t})}function E(e){const{pointer:t}=e;if(A(t))return!1;if(!p.Z.isSubscribedToRecord(e))return!1;p.Z.removeFromSubscribedRecords(e);const n=a.ZS(t);return!!(0,s.Z)(n)&&(!(!t.id||!t.table)||(i.rateLimitedLog({level:"warning",from:"recordSubscriptionActions:unsubscribe",type:"KeyValidationError",data:{pointer:t,miscDataToConvertToString:{versionsKey:n}}}),!1))}function F(e){const{environment:t}=e;E(e)&&x.ZP.removeListener({key:a.ZS(e.pointer),subscriptionId:I},t)}const Z=2*l.hM,U=Z;function V(e){const{pointer:t,environment:n,userId:o}=e;if(A(t))return;if(n.defaultRecordCache.inMemoryRecordCache.hasListener(t))return;const r=a.ZS(t);if((0,m.Ap)(r)){const e={pointer:t,userId:o};return w.Z.addToPendingEvictions(e,Date.now()+U),void(E(e)&&(0,m.vj)(r,I))}p.Z.addToPendingUnsubscribeRecords(e,Date.now()+Z)}function N(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p.Z.forEachPendingUnsubscribeRecord((n=>{let{pointer:o,userId:r,timestamp:i,environment:a}=n;if(i<e){p.Z.removeFromPendingUnsubscribeRecords({pointer:o,userId:r});const e={pointer:o,userId:r};t&&console.log("Unsubscribing and evicting",JSON.stringify(o)),F({pointer:o,userId:r,environment:a}),a.defaultRecordCache.inMemoryRecordCache.deleteRecord(e)}})),w.Z.forEachPendingEviction((n=>{let{pointer:o,userId:r,timestamp:i,environment:a}=n;if(i<e){w.Z.removeFromPendingEvictions({pointer:o,userId:r});const e={pointer:o,userId:r};t&&console.log("Evicting",JSON.stringify(o)),E(e),a.defaultRecordCache.inMemoryRecordCache.deleteRecord(e)}}))}setInterval((()=>{N(Date.now())}),1e4),(0,r.exposeDebugValue)("forceUnsubscribeAndEvictPendingRecords",(()=>{N(1/0,!0)})),setTimeout((()=>{(0,m.Tg)((()=>{p.Z.forEachPendingUnsubscribeRecord((e=>{let{pointer:t,userId:n,timestamp:o,environment:r}=e;F({pointer:t,userId:n,environment:r});const i={pointer:t,userId:n};w.Z.addToPendingEvictions(i,o),p.Z.removeFromPendingUnsubscribeRecords(i)}))}))}),0)},898377:(e,t,n)=>{n.d(t,{I:()=>u,a:()=>p});var o=n(667294),r=n(800480),i=n(886628),a=n(898104),s=n(268056),l=n(964233),c=n(869454),d=n(924666);function u(){const e=(0,r.O7)();return(0,i.VK)((()=>c.Z.mobileNativeBottomPadding(e)),[e])}function p(){const e=(0,r.O7)(),{isMobileNative:t,isAndroid:n}=(0,r.Fy)(),{RouterStore:u,NativeMobileActionBarStore:p}=e,m=(0,i.VK)((()=>{var e;if(!t||!n)return;if("page"!==u.state.route.name)return!1;if(c.Z.state.phase!==c.i.hidden)return!1;if(l.Z.state.open)return!1;if(Boolean(null==p||null===(e=p.state)||void 0===e?void 0:e.menu))return!1;const o=d.default.state,r="editing"===o.mode?o.multiSelection:void 0;return!(r&&!(0,s.iG)(r))||void 0}),[u,n,t,p]);(0,o.useEffect)((()=>{m&&a.clear({environment:e})}),[e,m])}},591948:(e,t,n)=>{n.d(t,{Z:()=>s});n(667294);var o=n(886628),r=n(385248),i=n(917294),a=n(785893);function s(e){let{targetRecordId:t,style:n}=e;const s=(0,o.VK)((()=>i.Z.state[t]),[t]);if(!s)return null;const{taskStatus:l,completeBlocks:c,totalBlocks:d}=s,u=(()=>{switch(l){case"not_started":case"failure":return;case"success":return 100;case"in_progress":if("number"!=typeof c||"number"!=typeof d)return;if(0===d)return;const e=c/d;return 1===e?99:Math.round(100*e)}})();return"number"!=typeof u?null:(0,a.jsx)(r.k,{percentage:u,style:n})}},698110:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(667294),r=n(800480),i=n(886628),a=n(815145),s=n(709291),l=n(275754),c=n(606854),d=n(973744),u=n(783105),p=n(785893);function m(e){const t=(0,r.O7)(),n=(0,i.VK)((()=>!t.device.isPhone),[t]);return(0,p.jsxs)(p.Fragment,{children:[n&&(0,p.jsx)(g,{...e}),(0,p.jsx)(c.ow,{onUndo:void 0})]})}function g(e){let{moveToLocation:t,movedItems:n}=e;const i=(0,r.O7)(),m=(0,o.useCallback)((e=>{var o;if(t&&"moveToBlock"===t.type)l._c({environment:i,openInNew:d.DJ(e),store:t.blockStore,scrollToBlockId:null===(o=n[0])||void 0===o?void 0:o.id,visitType:u.vu.Link,pageVisitSource:a.tY.Move})}),[i,t,n]);return t&&"moveToBlock"===t.type?(0,p.jsx)(c.Pn,{onClick:m,children:(0,p.jsx)(s.FormattedMessage,{defaultMessage:"Visit",id:"moveToHelpers.afterMoveToast.viewButton"})}):null}},641549:(e,t,n)=>{n.d(t,{$x:()=>s,Fz:()=>l,T6:()=>m,h_:()=>c,mx:()=>p});n(757658);var o=n(137810),r=n(619584),i=n(116746),a=n(966353);function s(e,t){const n=r.vM(e,(e=>{let{notification:t}=e;return t.navigable_block_id??t.id}));return n.forEach(((e,o)=>{const r=[],i=new Set;e.forEach((e=>{const{activity:t}=e;"commented"!==t.type&&r.push(e);const n=t.discussion_id;void 0===n||i.has(n)||(r.push(e),i.add(n))}));const a=r.filter((e=>{let{notification:n}=e;return("mentions"!==t||!n.visited)&&!("archive"===t&&!n.visited)}));0!==a.length?n.set(o,a):n.delete(o)})),n}function l(){const e=a.ZP.state.filter||a.uZ;return a.j5.includes(e)?e:a.uZ}function c(){return{fontWeight:o.Z.fontWeight.medium}}function d(e,t){const n=void 0===e?new Date:new Date(e);return n.setDate(n.getDate()-t),n.setHours(0,0,0,0),n.getTime()}function u(e,t){const n=void 0===e?new Date:new Date(e),o=n.getDay();return n.setDate(n.getDate()-o-7*t),n.setHours(0,0,0,0),n.getTime()}function p(e){return[{name:"today",cutoffTime:d(e,0)},{name:"this_week",cutoffTime:u(e,0)},{name:"last_week",cutoffTime:u(e,1)},{name:"older"}]}function m(){const{contentType:e,openState:t}=i.default.state;return"inbox"===e?t:"closed"}},584437:(e,t,n)=>{n.d(t,{B9:()=>M,N$:()=>A,WS:()=>D,eC:()=>S,fW:()=>I,jt:()=>P,sT:()=>x,sh:()=>w,tE:()=>R,vn:()=>k});var o=n(471924),r=n(89101),i=n(653965),a=n(307032),s=n(218265),l=n(86615),c=n(21359),d=n(247839),u=n(412714),p=n(210228),m=n(237181),g=n(560328),f=n(95477),h=n(855337),v=n(394841),y=n(385555),b=n(671574),_=n(159110);async function S(e){const{environment:t,from:n,notionAnalyticsSessionId:o}=e;await M({environment:t,url:await x({environment:t,baseUrl:f.default.calendar.createEventUrl,spaceStore:void 0,collectionViewStore:void 0,from:n,notionAnalyticsSessionId:o}),from:n})}async function k(e){const{environment:t,from:n}=e;await M({environment:t,url:await x({environment:t,baseUrl:f.default.calendar.calendarSettingsUrl,spaceStore:void 0,collectionViewStore:void 0,from:n}),from:n})}async function w(e){const{environment:t,spaceStore:n,collectionViewStore:i,from:l}=e;if(!!n&&!(0,b.tE)())return void async function(e){const{environment:t,spaceStore:n,collectionViewStore:i,from:l}=e,c=await T({environment:t,spaceStore:n,collectionViewStore:i,from:l});if("homeSignupClick"===l&&t.device.isElectron){const e=v.J2("main"),n=s.bf({url:f.default.calendar.notionAuthUrl,query:{...c,csrf:"",autolink:"false",notionDesktopRedirectPageId:e?(0,a.cj)(e.id):void 0}});return void u.D({environment:t,url:n})}if(t.device.isElectron){const e=s.bf({url:`${f.default.domainBaseUrl}${r._j.signup}`,query:{showNotionCalendarModal:"true"}});return void u.D({environment:t,url:e})}const d=o.Il(),p=s.bf({url:f.default.calendar.notionAuthUrl,query:{...c,csrf:d}});await(0,b.PQ)({environment:t,csrf:d}),_.Z.setState({isConnectingCalendar:!0}),u.D({environment:t,url:p})}(e);const c=i?f.default.calendar.openNotionDatabaseUrl:f.default.calendar.domainBaseUrl;M({environment:t,url:await x({environment:t,baseUrl:c,spaceStore:n,collectionViewStore:i,from:l}),from:l})}async function x(e){const{environment:t,baseUrl:n,spaceStore:o,collectionViewStore:r,from:i,notionAnalyticsSessionId:a}=e,l=await T({environment:t,collectionViewStore:r,spaceStore:o,from:i,notionAnalyticsSessionId:a});return s.bf({url:n,query:l})}async function I(e){const{environment:t,csrf:n,calendarCsrf:o,spaceId:r,integration:a,redirectUri:s,state:d}=e;if(!(await(0,b.Bs)({environment:t,csrf:n})))return void C({environment:t,redirectUri:s,query:i.GM({state:d},i.o8)});const u=await c.createOauthAuthorizationCode(t,{integrationId:a.id,spaceId:r,redirectUri:s,acceptedIntegrationCapabilities:a.capabilities});if("failed"===u.type)return void C({environment:t,redirectUri:s,query:i.GM({state:d},i.o8)});await l.dl(t);const p={code:u.data.code,calendarCsrf:o,state:d};C({environment:t,redirectUri:s,query:i.GM(p,i.o8)})}function C(e){const{environment:t,redirectUri:n,query:o}=e,r=s.bf({url:n,query:o});u.D({environment:t,url:r,targetSelf:!0})}async function T(e){const{environment:t,spaceStore:n,collectionViewStore:o,from:r,notionAnalyticsSessionId:a}=e,s=await(0,h.cG)(t);if(!n&&!o)return{notionDeviceId:s,from:r,notionAnalyticsSessionId:a};const l={env:"production",collection_view_id:null==o?void 0:o.id,user_id:null==n?void 0:n.userId,workspace_id:null==n?void 0:n.id,notionDeviceId:s,from:r,notionAnalyticsSessionId:a};return i.GM(l,i.o8)}async function M(e){const{environment:t,url:n,targetSelf:o}=e;if((0,h.K4)(e.environment,"open_notion_calendar",{from:e.from}),!t.device.isElectron)return u.D({environment:t,url:n,targetSelf:o});const{desktopProtocol:r}=f.default.calendar;if(!(await d.isProtocolRegistered(r)))return u.D({environment:t,url:n,targetSelf:o});const i=n.replace(/^https?:/,`${r}:`);d.openExternalUrl(i)}async function P(e){let t,{environment:n,url:o}=e;if(!n.device.isElectron||!y.default.checkGate({gateName:"calendar_home_tile_open_in_zoom_app"}))return!1;try{t=new URL(o)}catch{return!1}const r=t.pathname.split("/").filter(Boolean).pop();if(!r||!r.match(/\d{9,11}/))return!1;const{desktopProtocol:i}=f.default.zoom,a=new URLSearchParams(t.search);a.set("confno",r);const s=`${i}://${t.host}/join?${a.toString()}`;return await d.openExternalUrl(s)}function A(e){g.M5(e,"notion_calendar_launch_promo")}function R(e){const{environment:t,userSettingsStore:n}=e;p.createAndCommit({environment:t,userAction:"NotionCalendarLaunchModal.clickCancel",perform:e=>{m.d2({userSettingsStore:n,transaction:e,data:{notion_calendar_launch_modal_dismissed_at:Date.now(),notion_calendar_launch_modal_phase:"dismissed_modal"}})}})}function D(e,t){const{phase:n,transactionUserAction:o,userSettingsStore:r}=t;p.createAndCommit({environment:e,userAction:o,perform:e=>{m.d2({userSettingsStore:r,transaction:e,data:{notion_calendar_launch_modal_phase:n}})}})}},671574:(e,t,n)=>{n.d(t,{Bs:()=>g,PQ:()=>m,RI:()=>c,ZH:()=>d,tE:()=>u});var o=n(977657),r=n(307032),i=(n(95477),n(512955)),a=n(918514),s=n(548779),l=n(530874);function c(){return l.Z.bots.state.filter((e=>e.integration_id===o.Dv))}function d(e){const{environment:t,collectionContextType:n,spaceStore:o}=e;return!!o&&(!(0,s.XY)({env:"production",spaceStore:o})&&(!t.device.isMobile&&(!(0,a.Sr)(t)&&("collectionTypedView"!==n&&"collectionVirtualView"!==n))))}function u(){const{bots:e,externalAuthentications:t}=l.Z,n=e.state.find((e=>e.integration_id===o.Dv));if(!n)return!1;const r=t.state.find((e=>e.parent_id===n.id));return Boolean(r)}const p="notion_calendar_csrf";async function m(e){const{environment:t,csrf:n}=e;await(0,i.setCookie)(t,{name:p,value:n})}async function g(e){const{environment:t,csrf:n}=e,o=await(0,i.getCookie)(t,p),a=!!o&&(0,r.t)(o)&&o===n;return(0,i.removeCookie)(p),a}},159110:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}}const i=new r},555081:(e,t,n)=>{n.d(t,{EV:()=>G,Ex:()=>j,I1:()=>z,Mf:()=>K,Qt:()=>$,VW:()=>W,lp:()=>q,op:()=>H,xN:()=>L,yH:()=>O,zJ:()=>V});var o=n(369282),r=n.n(o),i=(n(667294),n(568626)),a=n(159730),s=n(915157),l=n(597213),c=n(89101),d=n(475246),u=n(577858),p=n(519889),m=n(709291),g=n(657347),f=n(232317),h=n(738208),v=n(547307),y=n(294273),b=n(792625),_=n(497977),S=n(709953),k=n(608055),w=n(901357),x=n(970782),I=n(164369),C=n(296994),T=n(833954),M=n(979947),P=n(433929),A=n(548779),R=n(318245),D=n(74948),B=n(80444),E=n(206258),F=n(710929),Z=n(775538),U=n(785893);async function V(e,t){if(!e.currentUser.id)return!1;const n=N(e);return!!F.BB(n)||(t||(t=new E.U6(e,{table:p.KJ,id:e.currentUser.id}),await t.awaitNonNullValue()),!t.getOnboardingCompleted())}function N(e){return{...s.Z.get({userId:e.currentUser.id,key:Z.onboardingPreferenceKey}),currentUserId:e.currentUser.id,stageStats:{startedTimeStampMs:Date.now()}}}async function O(e,t){const{state:n}=Z.default;if(n.isLoading||n.isOnboarding||!e.currentUser.id)return;const o=N(e);if(!o.isOnboarding)return;if(F.NT(o)&&t&&(null==t?void 0:t.id)!==o.spaceViewId)return;const{flow:r}=o,a="desktop_join_or_create_space"===r||"mobile_join_or_create_space"===r,s=await F.dD({environment:e,disableRedirects:a});s&&(o.onboardingData=s),Z.default.setState(o);const{spaceId:l}=o;if(l&&(e.device.isMobileNative&&i.log({level:"info",from:"onboardingActions",type:"SpaceSwitchingDebug",data:{message:"onboardingActions.restoreOnboardingState setting space",spaceId:l}}),B.default.setState({...B.default.state,currentSpaceStore:new E.H2(e,{table:d.bx,id:l})})),o.isOnboarding&&"spaceViewId"in o&&o.spaceViewId){const t=new E.V9(e,{table:u.zU,id:o.spaceViewId});B.default.setState({...B.default.state,currentSpaceViewStore:t})}Y(e,o)}async function L(e){await z(e,{type:"create-or-join"})}function j(e){const{userStore:t,transaction:n}=e;S.sW({store:t,data:{onboarding_completed:!0},transaction:n})}function K(e){const{userStore:t,transaction:n}=e;S.sW({store:t,data:{mobile_onboarding_completed:!0},transaction:n})}async function z(e,t){try{k.c4({environment:e,url:c._j.onboarding});const n=R.default.DO_NOT_USE_markLegacy("onboarding.load_dependencies"),o=await F.dD({environment:e,disableRedirects:Boolean(t.disableRedirectUrl)||"create-or-join"===t.type}),r=F.Pn(o),i=await C.FF.onboardingStateActions.load(),a=await i.getInitialState({environment:e,startOnboardingArgs:t,onboardingData:o,redirectData:r});if(R.default.DO_NOT_USE_measureLegacy(n,{environment:e,data:{flow:"flow"in a?a.flow:void 0}}),a&&a.isOnboarding){"invalid"===r.type&&(a.stage="error"),Z.default.setState(a);const t=F.jn(a);h.NG(e,t),h.y6(e,t),Y(e,a),a.isNewUser&&f.Io(e)}}catch(n){const t=(0,g.t)(n);!function(e,t,n){Z.default.setState({...Z.default.state,isLoading:!1}),h.Gk(e,{...F.jn(Z.default.state),errorMessage:t.message}),i.log({level:"error",from:"onboardingActions",type:"handleError",error:{message:`Found onboarding error: ${t.message}`}});const o=n?async()=>await _.actuallyLogoutAndDeleteMostLocalData({environment:e,logoutOrigin:l.F.OnboardingError}):void 0;v.showMessage({message:t.message,onAccept:o})}(e,t,"WorkspaceCreationError"===t.name&&(0,a.Zw)(t)&&t.data.newUser)}}async function q(e,t){if(t.isOnboarding)try{h.jB(e,F.jn(t));const n=await C.FF.onboardingStateActions.load();let o=await n.updateAndGetNextState(t,e);o.isOnboarding?(o={...o,stageStats:{startedTimeStampMs:Date.now()}},Z.default.setState(o),Y(e,o)):Z.default.setState(o),h.y6(e,F.jn(o))}catch(n){G(e,(0,g.t)(n))}}async function H(e,t){if(t.isOnboarding)try{h.jB(e,F.jn(t),!0);let n=(await C.FF.onboardingStateActions.load()).updateAndGetPreviousState(t,e);r()(null!==n),n.isOnboarding?(n={...n,stageStats:{startedTimeStampMs:Date.now()}},Z.default.setState(n),Y(e,n,!0)):Z.default.setState(n),h.qq(e,{...F.jn(t)}),h.y6(e,F.jn(n))}catch(n){G(e,(0,g.t)(n))}}async function G(e,t){if(Z.default.setState({...Z.default.state,isLoading:!1}),i.log({level:"error",from:"onboardingActions",type:"handleOnboardingError",error:{message:`Found onboarding error: ${t.message}`,stack:String(t.stack)}}),b.x(),t instanceof M.HttpRequestError&&(0,a.Rp)(t.data.responseBody)&&"UnauthorizedError"===t.data.responseBody.name)return void h.ho(e,{...F.jn(Z.default.state),errorMessage:t.message,debugMessage:"UnauthorizedError"});let n;if(t instanceof M.HttpRequestError){var o;const e=null==t||null===(o=t.data)||void 0===o||null===(o=o.responseBody)||void 0===o?void 0:o.clientData;e&&(n=(0,T.XN)(P.default.getIntl(),e))}h.ho(e,{...F.jn(Z.default.state),errorMessage:t.message,debugMessage:n||"undefined"});await v.confirmUserAction({message:(0,U.jsxs)("div",{children:[(0,U.jsx)(I.Z,{style:{fontSize:17,fontWeight:500,lineHeight:"24px",paddingBottom:8},children:(0,U.jsx)(m.FormattedMessage,{defaultMessage:"Oops, something went wrong.",id:"onboardingActions.onboardingErrorDialog.message"})}),(0,U.jsx)("div",{children:n??t.message})]}),acceptLabel:(0,U.jsx)(m.FormattedMessage,{defaultMessage:"Start over",id:"onboardingActions.onboardingErrorDialog.startOverButton.label"}),cancelLabel:(0,U.jsx)(m.FormattedMessage,{defaultMessage:"Close",id:"onboardingActions.onboardingErrorDialog.closeButton.label"})})&&function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:z;const o=Z.default.state;F.n0(o)?n(e,{type:"new-user",disableRedirectUrl:!0}):F.y7(o)?n(e,{type:"create-or-join",disableRedirectUrl:!0}):e.device.isMobile?n(e,{type:"mobile-onboarding",disableRedirectUrl:!0}):i.log({level:"error",from:"onboardingActions",type:"handleOnboardingError",error:{message:`Could not redirect onboarding: ${t.message}`,stack:String(t.stack)}})}(e,t)}async function W(e){const{state:t}=Z.default;if(F.n0(t)){if(!(await v.confirmUserAction({message:(0,U.jsxs)("div",{style:{display:"block"},children:[(0,U.jsx)("div",{style:{fontWeight:600},children:(0,U.jsx)(m.FormattedMessage,{defaultMessage:"Cancel new account setup?",id:"onboardingActions.closeOnboardingDialog.newUser.title"})}),(0,U.jsx)("div",{children:(0,U.jsx)(m.FormattedMessage,{defaultMessage:"You'll be taken back to the Notion home page.",id:"onboardingActions.closeOnboardingDialog.newUser.subtitle"})})]}),acceptLabel:(0,U.jsx)(m.FormattedMessage,{defaultMessage:"Return to home page",id:"onboardingActions.closeOnboardingDialog.newUser.confirmCloseButton.label"}),cancelLabel:(0,U.jsx)(m.FormattedMessage,{defaultMessage:"Continue setup",id:"onboardingActions.closeOnboardingDialog.newUser.continueButton.label"})})))return;h.jw(e,F.jn(t)),await _.actuallyLogoutAndDeleteMostLocalData({environment:e,logoutOrigin:l.F.OnboardingExit})}else{if(!(await v.confirmUserAction({message:(0,U.jsxs)("div",{style:{display:"block"},children:[(0,U.jsxs)("div",{style:{fontWeight:600},children:[" ",(0,U.jsx)(m.FormattedMessage,{defaultMessage:"Cancel new workspace setup?",id:"onboardingActions.closeOnboardingDialog.existingUser.title"})]}),(0,U.jsx)("div",{style:{wordBreak:"keep-all"},children:(0,U.jsx)(m.FormattedMessage,{defaultMessage:"You'll be taken back to your previous workspace.",id:"onboardingActions.closeOnboardingDialog.existingUser.subtitle"})})]}),acceptLabel:(0,U.jsx)(m.FormattedMessage,{defaultMessage:"Back to previous workspace",id:"onboardingActions.closeOnboardingDialog.existingUser.confirmCloseButton.label"}),cancelLabel:(0,U.jsx)(m.FormattedMessage,{defaultMessage:"Continue setup",id:"onboardingActions.closeOnboardingDialog.existingUser.continueButton.label"})})))return;h.jw(e,F.jn(t));const{mainEditorCurrentBlockStore:o}=B.default.state,r=null==o?void 0:o.getSpaceId(),a=r&&(0,A.w3)(r);if(a){const t=a.getSpaceStore();e.device.isMobileNative&&i.log({level:"info",from:"onboardingActions",type:"SpaceSwitchingDebug",data:{message:"onboardingActions.handleCloseOnboarding set space",spaceId:null==t?void 0:t.id}}),B.default.setState({...B.default.state,currentSpaceStore:t,currentSpaceViewStore:a})}const{url:s,userId:l}=y.Vr(e);let c=e;if(l&&l!==e.currentUser.id&&(c=await x.x({environment:e,newCurrentUserId:l})),s){var n;D.close();const e=()=>{const e={isOnboarding:!1,isLoading:!1,currentUserId:l};Z.default.setState(e)};k.c4({environment:c,url:s}),null!==(n=c.mobileNative)&&void 0!==n&&n.supportsNativeHomeOnPhone()?w.d(c,e):e()}}}function $(e){const{state:t}=Z.default;h.J7(e,F.jn(t)),Z.default.setState({isOnboarding:!1,isLoading:!1,currentUserId:e.currentUser.id})}function Y(e,t,n){if(!t.isOnboarding)return;if(t.isOnboarding){const o=[...t.historicalStages||[],{stageName:t.stage,stageNumber:t.stageNumber,timestamp:Date.now()}];Z.default.setState({...t,historicalStages:o.length>20?[{stageName:"truncated",stageNumber:-1,timestamp:Date.now()}]:o}),h.o7(e,"onboarding_stage",{...F.jn(t),historical_stages:o,back:n})}}},710929:(e,t,n)=>{n.d(t,{$U:()=>Q,At:()=>$,BB:()=>F,Bu:()=>U,Ck:()=>O,Fz:()=>ce,NT:()=>Z,Pn:()=>G,SN:()=>Y,VW:()=>N,Vb:()=>le,WX:()=>J,YH:()=>oe,_J:()=>W,bM:()=>se,bN:()=>X,bm:()=>ae,dD:()=>L,eW:()=>E,ey:()=>z,fz:()=>D,iF:()=>j,jF:()=>K,jn:()=>H,lr:()=>V,n0:()=>R,og:()=>ne,pd:()=>re,rT:()=>te,tr:()=>P,uO:()=>ie,vA:()=>ee,y7:()=>A});var o=n(780994),r=n(133728),i=n(568626),a=n(475246),s=n(860949),l=n(709291),c=n(531701),d=n(653965),u=n(401898),p=n(137810),m=n(738208),g=n(21359),f=n(497977),h=n(476464),v=n(709953),y=n(29974),b=n(310259),_=n(210228),S=n(855337),k=n(433929),w=n(548779),x=n(905162),I=n(80444),C=n(385555),T=n(206258),M=n(775538);function P(e,t){return`/tutorial/${e}${"dark"===t.state.mode?"-dark":""}.png`}function A(e){return e.isOnboarding&&("desktop_join_or_create_space"===e.flow||"mobile_join_or_create_space"===e.flow)}function R(e){return e.isOnboarding&&("desktop_cold_start"===e.flow||"mobile_cold_start"===e.flow||"desktop_joinable_spaces"===e.flow||"mobile_joinable_spaces"===e.flow||"desktop_redirect"===e.flow||"mobile_redirect"===e.flow)}function D(e){const{state:t}=e;return R(t)}const B=(0,l.defineMessages)({personalWorkspaceName:{defaultMessage:"{userName}'s Notion",id:"onboardingHelpers.personalWorkspaceName"}});function E(e,t){return t.formatMessage(B.personalWorkspaceName,{userName:e.trim()})}function F(e){return e.isOnboarding&&Boolean(M.InAppOnboardingStages.find((t=>t===e.stage)))}function Z(e){return e.isOnboarding&&(Boolean(M.InAppOnboardingStages.find((t=>t===e.stage)))||"invite"===e.stage)}function U(e){return e.isOnboarding&&"template_optout"===e.stage}function V(e){const t=e.userStore.getEmail();if(t&&e.isUserDomainJoinable)return(0,r.Gd)(t)}function N(e){return"team"===e}function O(e){return e.device.isMobileNative&&(0,x.Y)("supportsNativeHome")&&"on"===C.default.getGroup("mobile_user_activation_android_land_on_home_v2_exp")}async function L(e){M.default.setState({...M.default.state,isLoading:!0});const{disableRedirects:t,environment:n}=e;i.log({level:"info",from:"onboardingHelpers",type:"loadOnboardingData",data:{message:"initializeOnboardingDataLoad"}});const[r,a,s,l,c,d,p]=await Promise.all([g.getJoinableSpaces(n,{}),(0,w.iX)({environment:n,disableRedirectUrl:t}),g.isUserDomainJoinable(n,{}),g.isEmailEducation(n,{}),g.validateUserCanCreateWorkspace(n,{}),g.getVerifiedEmailDomain(n,{}),g.getGeoIpLocation(n,{})]);i.log({level:"info",from:"onboardingHelpers",type:"loadOnboardingData",data:{message:"completedOnboardingDataLoad",miscDataToConvertToString:{joinableSpacesResponseType:r.type,joinableSpacesResponseStatus:r.status,userRedirectDataId:a.userRootStore.id,isUserDomainJoinableResponseType:s.type,isUserDomainJoinableResponseStatus:s.status,validateUserCanCreateWorkspaceStatus:c.status}}}),M.default.setState({...M.default.state,isLoading:!1});const m={isUserDomainJoinable:"success"===s.type&&s.data.isJoinable,isEducationPlanEligible:"success"===l.type&&l.data.isEligible,canUserCreateSpace:"success"!==c.type||c.data.canUserCreateSpace,isUserUsingVerifiedDomain:"success"===d.type&&(0,u.$K)(d.data.id),...a,countryCode:"success"===p.type&&(0,o.GC)(p.data.countryCodeFromIp)?p.data.countryCodeFromIp:void 0};return"success"===r.type?{joinableSpaceData:r.data,...m}:{joinableSpaceData:{results:[]},...m}}async function j(e){const t=await g.getGeoIpLocation(e,{});return"success"===t.type&&(0,o.GC)(t.data.countryCodeFromIp)?t.data.countryCodeFromIp:void 0}function K(e){if(A(e)){const{userRootStore:t}=e.onboardingData;if("timed_trial_upsell"===e.stage)return!1;const n=t.getSpaceViewPointers();if(n)return n.length>0}return!1}function z(e){const{onboardingData:t,isNewUserFlow:n}=e,{userRootStore:o}=t,{results:r}=t.joinableSpaceData,i=o.getSpaceViewStores().map((e=>e.getSpaceId()));return n?r:r.filter((e=>i.indexOf(e.id)<0))}function q(e){return e.isOnboarding&&"profile"!==e.stage&&"error"!==e.stage}function H(e){var t,n,o;const{currentSpaceStore:r}=I.default.state,{function:i,role:a,companySize:s,intent:l,useCases:c,categories:d}=(0,w.kO)();return{flow_name:e.isOnboarding?e.flow:"not_defined",flow_id:e.isOnboarding?e.flowId:void 0,stage:e.isOnboarding?e.stage:"not_defined",initial_workspace_type:q(e)?e.spaceJoinOrCreate:void 0,is_new_onboarding:te(e),is_create_or_join:A(e),stage_number:e.isOnboarding?e.stageNumber:void 0,num_of_joinable_spaces:e.isOnboarding&&"workspace_choose"===e.stage?(null===(t=e.joinableSpaces)||void 0===t?void 0:t.length)||0:void 0,historical_stages:e.isOnboarding?e.historicalStages:void 0,selectedPresets:e.isOnboarding&&"workspace_setup"===e.stage?e.selectedPresets:void 0,user_persona:i,user_team_role:a,user_use_cases:c,user_categories:d,user_company_size:s,plan_selection:l,plan_type:null==r?void 0:r.getPlanType(),stage_duration_in_ms:e.isOnboarding&&null!==(n=e.stageStats)&&void 0!==n&&n.startedTimeStampMs?Date.now()-(null===(o=e.stageStats)||void 0===o?void 0:o.startedTimeStampMs):void 0,onboarding_templates:void 0,trial_id:e.isOnboarding?e.trialId:"undefined"}}function G(e){const{redirectSpaceId:t,redirectPageId:n,forkPageBlockId:o,hasExplicitAccessToRedirectPage:r,canJoinRedirectSpace:i,publicAccessPageId:a,oauthAuthorizationParams:s}=e;return s?{type:"oauth_authorization_redirect",...s}:o?{type:"fork_page",pageId:o}:!a||r||i?!t||r||i?t&&n&&r&&!i?{type:"guest_redirect",pageId:n,spaceId:t}:t&&n&&i?{type:"redirect_page",pageId:n,spaceId:t}:t&&i?{type:"redirect_space",spaceId:t}:{type:"getting_started_page"}:{type:"invalid"}:{type:"public_access_page_redirect",pageId:a}}async function W(e,t){const{onboardingData:n,name:o,profilePhoto:r,password:i,emailOptIn:a}=e,s=n.userStore;S.Zf(t,{email_optin_product_tips_and_news:a,email_optin_resources_and_events:a,email_optin_notion_for_startups:a}),_.createAndCommit({userAction:"onboardingHelpers.setProfileData",environment:t,perform:e=>{const t={...r&&{profile_photo:r}};t.name=o,v.sW({store:s,data:t,transaction:e})}});const l=await f.shouldCreatePassword(t)&&!ee();i&&l&&await g.setPassword(t,{newPassword:i,sendEmail:!1})}function $(e){if(!C.default.checkGate({gateName:"survey_data_writes"}))return;const{environment:t,state:n,spaceStore:o,spaceViewStore:r}=e,i=(new Date).getTime();if(r){const e=s.Dh({maybeFunction:n.userPersona,guessedFunctionVersion:4,maybeRole:n.userRole,guessedRoleVersion:2,maybeCategories:n.categories,guessedCategoriesVersion:1,maybeEducationRole:n.userEducationRole,guessedEducationRoleVersion:1,maybeEducationLevel:n.userEducationLevel,guessedEducationLevelVersion:1,collectedFrom:"onboarding",collectedAt:i});void 0!==e&&b.Q1(t,e,r)}if(o){const e=s.K0({maybeIntent:n.planSelection,guessedIntentVersion:1,maybeCompanySize:n.companySize,guessedCompanySizeVersion:2,maybeUseCases:n.useCases,guessedUseCasesVersion:3,collectedFrom:"onboarding",collectedAt:i});void 0!==e&&y.wg(t,e,o)}}async function Y(e,t){const{spaceId:n,onboardingData:o}=e;if(!n)return;const r=T.H2.createChildStore(o.userRootStore,{table:a.bx,id:n});await async function(e,t,n){t.isChecked&&t.joinableUserEmailDomain&&await y.$F({environment:e,emailDomains:[t.joinableUserEmailDomain],spaceStore:n})}(t,e,r);const{emails:i}=e,s=d.jj(i).map((e=>({type:"newUser",value:{email:e},source:"email"})));i.length>0&&(await h.n_({environment:t,store:r,inviteTargets:s,inviteRole:"editor",isOnboarding:!0,invite:{inviteOrigin:"onboarding_invite"}}),m.qJ(t,{...H(e),emails:e.emails,auto_join_space:e.isChecked,is_bulk_invite:e.isBulkInvite}))}function Q(e){const{userStore:t}=e,n=k.default.getIntl(),o=t.getFullName(n),r=t.getProfilePhoto()||null;if(o)return{name:o,profilePhoto:r,password:null,prefilled:!0}}const J="inviteCode";function X(e){return(e.isBulkInvite?e.emailTokens:e.emailInputs.filter((e=>""!==e.sanitizedEmail))).length>0}function ee(){var e;const{currentUserSettingsStore:t}=I.default.state;return t&&t.isReady()&&"email-password"===(null===(e=t.getSettings())||void 0===e?void 0:e.mobile_ads_signup_variant)}function te(e){return e.isOnboarding&&e.isNewUser}function ne(e){return e.device.isMobileBrowser}const oe={fontSize:12,color:c.ZP.mediumTextColor,fontWeight:p.Z.fontWeight.medium,lineHeight:"135%",marginTop:20,marginBottom:4},re={marginTop:14,marginBottom:14},ie={marginTop:8,marginBottom:8};function ae(e){return{color:e.mediumTextColor}}const se={width:60},le={marginTop:14,marginBottom:8,fontSize:16,fontWeight:600},ce={boxShadow:`0 0 0 1px ${c.ZP.red}`}},775538:(e,t,n)=>{n.r(t),n.d(t,{InAppOnboardingStages:()=>i,default:()=>c,onboardingPreferenceKey:()=>s,onboardingStagesWithBack:()=>a});var o=n(749085),r=n(915157);const i=["template_optout","workspace_setup"],a=["workspace_plan_choose","persona_survey","workspace_create","timed_trial_upsell","mobile_editor","mobile_sidebar","mobile_desktop","mobile_web_clipper","mobile_app_download","select_tools","workflow_template_record_titles","workflow_template_properties","workflow_template_views"],s="lastOnboardingStateKeyV1";class l extends o.default{setState(e){super.setState(e),function(e){if(e.isOnboarding)if("profile"===e.stage){const{onboardingData:t,isLoading:n,password:o,passwordErrorData:i,currentUserId:a,...l}=e;r.Z.set({userId:a,key:s,value:l})}else{const{onboardingData:t,isLoading:n,currentUserId:o,...i}=e;delete i.password,r.Z.set({userId:o,key:s,value:i})}else{const{currentUserId:t,...n}=e;r.Z.set({userId:t,key:s,value:n})}}(e)}constructor(){super();const e={isOnboarding:!1,isLoading:!1,currentUserId:void 0};super.setState(e)}}const c=new l},408655:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n(749085).default.createValue({open:!1,isExistingUser:!0},{name:"PerfmarkTrialIneligibleToastStore"})},843199:(e,t,n)=>{n.d(t,{Q:()=>a,V:()=>s});var o=n(401898),r=n(143333),i=n(854346);function a(e){const t=e.collectionViewModuleContextStore.collectionViewModule();if(t)return s(t)}function s(e){const t=e.getUnderlyingTypeForActionsOnly();switch(t){case"collectionView":return r.M;case"collectionViewV2":return i.V}(0,o.t1)(t)}},143333:(e,t,n)=>{n.d(t,{M:()=>g,f:()=>m});var o=n(541432),r=n(399036),i=n(471924),a=n(213493),s=n(215828),l=n(709953),c=n(210228),d=n(710274),u=n(741195),p=n(206258);function m(e){const{environment:t,collectionStore:n,collectionSchema:o,propertyId:d}=e,m=o[d];if(!m||!(0,r.p_)(m))return;const g=m.collection_pointer;if(!g)return;const f=m.property;if(!f)return;const h=p.NW.createChildStore(n,g);if(!h)return;const v=h.getParentBlockStore();if(!v)return;const y=(0,s.ZP)(),b=(0,u.$x)({environment:t,table:a.np,spaceId:v.getSpaceId()}),_=b.id,S={id:y,propertyId:d,type:"collectionView",collectionViewBlockPointer:v.getSpaceShardedPointer(),collectionViewPointer:b},k={id:_,type:"table",parent_id:v.id,parent_table:v.table,space_id:v.getSpaceId(),alive:!0,format:{property_filters:[{id:i.Il(),filter:{property:f,filter:{operator:"relation_contains",value:{type:"relative",value:{type:"current_page_in_related_collection"}}}}}],hide_linked_collection_name:!0,is_unlisted:!0}};return c.createAndCommit({environment:t,perform:e=>{l.ae({environment:t,table:a.np,value:k,inMemoryRecordCache:v.inMemoryRecordCache,transaction:e})},userAction:"collectionViewModuleActions.createCollectionViewModule"}),S}const g={customizeForPage(e){var t;const{environment:n,collectionContextStore:r,intl:i}=e,a=r.collectionViewStore(),s=null==a||null===(t=a.getModel())||void 0===t?void 0:t.getVersion(),u=r.collectionViewBlockStore(),p=r.collectionViewModuleContextStore.collectionViewModule(),m=r.collectionViewModuleContextStore.currentPageInRelatedCollectionStore();if(!(u&&m&&a&&s&&p))return;const g=a.getSpaceId();c.createAndCommit({userAction:"collectionSettingsActions.customizeCollectionViewModuleV1ForPage",environment:n,perform:e=>{var t;const r=l.j4({environment:n,type:o.Ti.collectionView,format:{collection_pointer:u.getCollectionPointer(),is_customized_collection_view_module:!0},spaceId:g,inMemoryRecordCache:u.inMemoryRecordCache,transaction:e,useCrdt:m.useCrdt()});l.sW({store:r,data:{parent_id:m.id,parent_table:m.table,alive:!0},transaction:e});const f=d.tG({environment:n,collectionViewStore:a,intl:i,transaction:e,collectionViewBlockStore:r,copyNameExactly:!0}),h=null===(t=m.getCollectionViewModulesMapStore())||void 0===t?void 0:t.getKeyStore(p.getId());return l.sW({store:h,data:{collection_view_block_pointer:r.pointer,base_version:s,has_customized:!1},transaction:e}),c.applyOperation({store:m,operation:{pointer:m.pointer,path:["non_content_children"],command:"listAfter",args:{id:r.id}},transaction:e}),{newCollectionViewBlockStore:r,newCollectionViewStore:f}}})},resetCustomizationForPage(e){var t;const{environment:n,collectionContextStore:o}=e,r=o.collectionViewStore(),i=o.collectionViewBlockStore(),a=o.collectionViewModuleContextStore.collectionViewModule(),s=o.collectionViewModuleContextStore.currentPageInRelatedCollectionStore(),d=a?null==s||null===(t=s.getCollectionViewModulesMapStore())||void 0===t?void 0:t.getKeyStore(a.getId()):void 0;i&&r&&a&&d&&s&&c.createAndCommit({userAction:"collectionSettingsActions.resetCustomizedCollectionViewModule",environment:n,perform:e=>{l.sW({store:i,data:{alive:!1},transaction:e}),l.sO({store:d,value:void 0,transaction:e}),c.applyOperation({store:s,operation:{pointer:s.pointer,path:["non_content_children"],command:"listRemove",args:{id:i.id}},transaction:e})}})},deleteDependencies(e){}}},854346:(e,t,n)=>{n.d(t,{V:()=>y,r:()=>v});var o=n(541432),r=n(399036),i=n(471924),a=n(421202),s=n(213493),l=n(182798),c=n(215828),d=n(119785),u=n(709953),p=n(210228),m=n(710274),g=n(27105),f=n(741195),h=n(206258);function v(e){const{environment:t,layoutStore:n,collectionStore:o,collectionSchema:l,propertyId:m}=e,v=l[m];if(!v||!(0,r.p_)(v))return;const y=v.collection_pointer;if(!y)return;const b=v.property;if(!b)return;const _=h.NW.createChildStore(o,y);if(!_)return;const S=_.getParentBlockStore();if(!S)return;const{performResult:k}=p.createAndCommit({environment:t,perform:e=>{const{inMemoryRecordCache:o}=S,r=u.j4({environment:t,type:"collection_view",inMemoryRecordCache:o,transaction:e,useCrdt:(0,g.S9)("collection_unknown_view")}),l=S.getSpaceId(),m=(0,c.ZP)(),h=(0,f.$x)({environment:t,table:s.np,spaceId:l}).id,v=r.pointer,y={id:h,type:"table",parent_id:v.id,parent_table:a.iU,space_id:l,alive:!0,format:{collection_pointer:_.pointer,property_filters:[{id:i.Il(),filter:{property:b,filter:{operator:"relation_contains",value:{type:"relative",value:{type:"current_page_in_related_collection"}}}}}],hide_linked_collection_name:!0}};p.applyOperation({store:r,operation:{pointer:r.pointer,path:["view_ids"],command:"listAfter",args:{id:h}},transaction:e}),d.jG({childStore:r,parentStore:n,transaction:e}),u.ae({environment:t,table:s.np,value:y,inMemoryRecordCache:o,transaction:e});return{id:m,type:"collectionViewV2",collectionViewBlockPointer:{...v,spaceId:l}}},userAction:"collectionViewModuleV2Actions.createCollectionViewModuleV2"});return k}const y={customizeForPage(e){var t;const{environment:n,collectionContextStore:r,intl:i}=e,a=r.collectionViewStore(),s=null==a||null===(t=a.getModel())||void 0===t?void 0:t.getVersion(),l=r.collectionViewBlockStore(),c=r.collectionViewModuleContextStore.collectionViewModule(),d=r.collectionViewModuleContextStore.currentPageInRelatedCollectionStore();if(!(l&&d&&a&&s&&c))return;const g=a.getSpaceId();p.createAndCommit({userAction:"collectionViewModuleV2Actions.customizeCollectionViewModuleForPage",environment:n,perform:e=>{var t;const r=u.j4({environment:n,type:o.Ti.collectionView,format:{is_customized_collection_view_module:!0},spaceId:g,inMemoryRecordCache:l.inMemoryRecordCache,transaction:e,useCrdt:d.useCrdt()});u.sW({store:r,data:{parent_id:d.id,parent_table:d.table,alive:!0},transaction:e});const f=(0,m.tG)({environment:n,collectionViewStore:a,intl:i,transaction:e,collectionViewBlockStore:r,copyNameExactly:!0}),h=null===(t=d.getCollectionViewModulesMapStore())||void 0===t?void 0:t.getKeyStore(c.getId());return u.sW({store:h,data:{collection_view_block_pointer:r.pointer,base_version:s,has_customized:!1},transaction:e}),p.applyOperation({store:d,operation:{pointer:d.pointer,path:["non_content_children"],command:"listAfter",args:{id:r.id}},transaction:e}),{newCollectionViewBlockStore:r,newCollectionViewStore:f}}})},resetCustomizationForPage(e){var t;const{environment:n,collectionContextStore:o}=e,r=o.collectionViewStore(),i=o.collectionViewBlockStore(),a=o.collectionViewModuleContextStore.collectionViewModule(),s=o.collectionViewModuleContextStore.currentPageInRelatedCollectionStore(),l=a?null==s||null===(t=s.getCollectionViewModulesMapStore())||void 0===t?void 0:t.getKeyStore(a.getId()):void 0;i&&r&&a&&l&&s&&p.createAndCommit({userAction:"collectionViewModuleV2Actions.resetCustomizedCollectionViewModuleForPage",environment:n,perform:e=>{u.sW({store:i,data:{alive:!1},transaction:e}),u.sO({store:l,value:void 0,transaction:e}),p.applyOperation({store:s,operation:{pointer:s.pointer,path:["non_content_children"],command:"listRemove",args:{id:i.id}},transaction:e})}})},deleteDependencies(e){const{layoutStore:t,module:n,transaction:o}=e,r=(0,l.TO)(n.getCollectionViewBlockStore());d.hr({childStore:r,parentStore:t,transaction:o})}}},978201:(e,t,n)=>{n.d(t,{H:()=>m});n(21703);var o=n(834566),r=n(278702),i=n(652136);var a=n(225985),s=n(940470),l=n(210228),c=n(108464),d=n(843199),u=n(282356),p=n(571960);function m(e){var t;let{environment:n,transaction:m,layoutStore:g,position:f,sessionId:h}=e;const v=(0,r.eJ)(f.area);if(!(null===(t=g.getRawModules())||void 0===t?void 0:t[v]))throw new Error("Unable to find modules");const y=g.getModuleById(f.moduleId);if(!y)throw new Error("Unable to find module being removed.");const b=function(e){let{module:t}=e;return"cover"===t.type?{error:new Error("Unable to delete the cover module")}:"titleWithIcon"===t.type?{error:new Error("Unable to delete the title with icon module")}:"editor"===t.type?{error:new Error("Unable to delete the editor module")}:"discussions"===t.type?{error:new Error("Unable to delete the discussions module")}:"bottomControls"===t.type?{error:new Error("Unable to delete the bottom controls module")}:"expandedBacklinks"===t.type?{error:new Error("Unable to delete the backlinks module")}:{value:!0}}({module:(0,i.cm)(y),area:f.area});if(!s.x.isSuccess(b))throw b.error;var _;(l.createAndCommitOrAppend({environment:n,transaction:m,perform(e){!function(e,t,n,r,i){(0,a.f)(i)&&(0,u.B3)({environment:e,transaction:t,layoutStore:n,property:i.propertyId,ignoreModuleType:"property",showInCanonicalGroup:!0});if((0,a.o1)(i)){const e=(0,c.l)(n,i);(0,d.V)(e).deleteDependencies({layoutStore:n,module:e,transaction:t})}l.applyOperation({transaction:t,store:n,operation:o.C.deleteModule(n.pointer,r,i.id)})}(n,e,g,v,y)},userAction:"pageLayout.deleteActions.deleteModuleAtPosition"}),h)&&p.DZ({environment:n,module:y,sessionId:h,collectionId:null===(_=g.getCollectionModel())||void 0===_?void 0:_.id,layoutId:g.id});return y}},601381:(e,t,n)=>{n.d(t,{U:()=>l,n:()=>c});var o=n(74948),r=n(436391),i=n(170210),a=n(529294),s=n(87863);function l(e){d({...e,state:"open"})}function c(e){d({...e,state:"closed"})}function d(e){let{environment:t,layoutStore:n,savePreference:l,from:c,state:d}=e;if(l&&(0,a.Jx)({environment:t,layoutStore:n,state:d}),"sidebar"!==s.Z.state.displayStyle)if("popup"!==s.Z.state.displayStyle)if("static_sidebar"!==s.Z.state.displayStyle);else if("open"===d){if(s.Z.state.isOpen)return;const{clampedWidth:e,hadEffect:n}=(0,a.NL)("open");s.Z.setSidebarIncreasedSizeOfPeekView(n),n?(o.setPeekWidth({width:e,environment:t}),window.requestAnimationFrame((()=>{s.Z.setOpen()}))):s.Z.setOpen()}else{if(s.Z.setClosed(),s.Z.state.detailsSidebarIncreasedSizeOfPeekView){const{clampedWidth:e}=(0,a.NL)("close");o.setPeekWidth({width:e,environment:t})}s.Z.setSidebarIncreasedSizeOfPeekView(!1)}else"open"===d?(i.Z.setState({open:!0}),s.Z.setOpen()):(i.Z.setState({open:!1}),s.Z.setClosed());else"open"===d?(o.setUpdateSidebarTab(r.gY.Info),s.Z.setOpen(),o.setUpdateExpand({environment:t,isExpanded:!0,from:c,saveDetailsSidebarPreference:l})):(s.Z.setClosed(),o.setUpdateExpand({environment:t,isExpanded:!1,from:c,saveDetailsSidebarPreference:l}))}},282356:(e,t,n)=>{n.d(t,{B3:()=>Z,IR:()=>D,JH:()=>M,L0:()=>E,MF:()=>B,gm:()=>F,hp:()=>V,iQ:()=>U,m2:()=>P});n(21703),n(757658);var o=n(815145),r=n(406695),i=n(295519),a=n(471924),s=n(959753),l=n(278702),c=n(15167),d=n(888250),u=n(606287),p=n(611318),m=n(579257),g=n(587420),f=n(608055),h=n(210228),v=n(484210),y=n(741195),b=n(74948),_=n(80444),S=n(188923),k=n(206258),w=n(748528),x=n(334017),I=n(978201),C=n(571960),T=n(339861);function M(e){let{layoutStore:t,rawModules:n,transaction:o,area:r}=e;if(!n)throw new Error(`Expected layout schema to be defined when updating ${r}`);h.applyOperation({transaction:o,store:t,operation:s.CIp.setModulesArea(t.pointer,r,n)})}function P(e){let{environment:t,transaction:n,collectionStore:o,userId:r,modules:i}=e;const a=(0,y.Ii)({environment:t,spaceId:o.getSpaceId(),table:p.Bh}),l=k.t1.createChildStore(o,a),{model:d,operations:[u]}=s.rp4.create({pointer:a,parent:o.pointer,createdByUserId:r,modules:i??(0,c._P)()});h.applyOperation({transaction:n,store:l,operation:u});const m=s.kj1.setLayout(o.pointer,a);return h.applyOperation({transaction:n,store:o,operation:m}),{model:d,store:l}}function A(e){let t;return e?t=e:S.default.state.open&&S.default.state.targetStore?t=S.default.state.targetStore:_.default.state.mainEditorCurrentBlockStore&&(t=_.default.state.mainEditorCurrentBlockStore),t}function R(e){g.xv(e,"open_page_layout_editor"),b.setUpdateExpand({environment:e,isExpanded:!1,from:"keyboard_default",saveDetailsSidebarPreference:!1})}function D(e){var t;let{environment:n,blockStore:o,collectionStore:r,from:i}=e;const s=function(e){var t;let n=A(e);return null!==(t=n)&&void 0!==t&&t.isCollectionView()&&(n=void 0),n}(o);R(n);const l=a.Il();x.Z.setState({isOpen:!0,mode:"layout-editor",collectionStore:r,pageStore:s,siteRootBlockStore:void 0,sessionId:l}),(0,C.Rt)({environment:n,from:i,sessionId:l,collectionId:null==r?void 0:r.id,existingLayoutId:null==r||null===(t=r.getLayoutStore())||void 0===t?void 0:t.id})}function B(e){let{environment:t,store:n,siteRootBlockStore:o,from:r}=e;const i=A(n);R(t);const s=a.Il();x.Z.setState({isOpen:!0,mode:"site-settings-editor",collectionStore:void 0,pageStore:i,siteRootBlockStore:o,sessionId:s}),(0,C.Rt)({environment:t,from:r,sessionId:s,collectionId:void 0,existingLayoutId:void 0})}function E(e){x.Z.getState().isOpen&&F(e)}function F(e){let{environment:t}=e;const n=x.Z.getState();if(!n.isOpen)throw new Error("Cannot close page layout editor. Page layout editor is not open.");const{pageStore:r}=n,{mainEditorCurrentBlockStore:i}=_.default.getState();if(r&&(null==i?void 0:i.id)!==r.id){const e=(0,v.ZP)({store:r,pageVisitSource:o.tY.PageLayoutEditor});f.c4({environment:t,url:e})}x.Z.setState({isOpen:!1})}function Z(e){let{environment:t,transaction:n,property:o,layoutStore:a,ignoreModuleType:s,showInCanonicalGroup:l}=e;U({environment:t,transaction:n,property:o,layoutStore:a,ignoreModuleType:s});const c=a.getParentStore();if((null==c?void 0:c.table)===u.vF&&void 0!==l){const e=(0,i.i)(c.getFormat(),c.getSchema(),void 0,r.j5.Collection);m.M0({property:o,visibility:l?"show":"hide",store:c,format:e,transaction:n})}}function U(e){var t;let{environment:n,transaction:o,property:r,layoutStore:i,ignoreModuleType:a}=e;const s=null===(t=i.getModel())||void 0===t?void 0:t.getRawModules();if(s)for(const u of p.g9){var c;const e=s[u];if(!e)return;const t=[];"property"!==a&&t.push(...e.filter((e=>"property"===e.type&&e.propertyId===r)).map((e=>e.id)));const p=e.find((e=>"titleWithIcon"===e.type));if("titleWithIcon"===(null==p?void 0:p.type)&&null!==(c=p.propertyIds)&&void 0!==c&&c.includes(r)&&"titleWithIcon"!==a){const e={...p,type:"titleWithIcon",propertyIds:p.propertyIds.filter((e=>e!==r))};(0,T.U)({environment:n,transaction:o,layoutStore:i,position:{area:(0,l.Gc)(u),moduleId:p.id},updatedModule:(0,d.V)(e,!0)})}for(const r of t)(0,I.H)({environment:n,transaction:o,layoutStore:i,position:{area:(0,l.Gc)(u),moduleId:r}})}}async function V(e){if(!(0,w.CA)())return;await e.load();const t=e.getAssociatedCollectionStore();if(!t)return;await t.load();const n=null==t?void 0:t.getLayoutStore();return n?(await n.load(),n):void 0}},571960:(e,t,n)=>{n.d(t,{If:()=>c,Ry:()=>p,DZ:()=>u,m_:()=>m,Rt:()=>l,r$:()=>d});var o=n(15167),r=n(653965),i=n(855337),a=n(225985);function s(e){let{module:t,sessionId:n}=e;const o={type:t.type,session_id:n};return(0,a.f)(t)?{...o,property_id:t.propertyId,property_type:t.type}:o}function l(e){let{environment:t,from:n,sessionId:o,collectionId:r,existingLayoutId:a}=e;i.K4(t,"page_builder_opened",{from:n,sessions_id:o,collection_id:r,existing_layout_id:a})}function c(e){let{environment:t,sessionId:n,collectionId:o,existingLayoutId:r}=e;i.K4(t,"page_builder_closed",{layout_saved:!1,sessions_id:n,collection_id:o,existing_layout_id:r})}function d(e){let{environment:t,sessionId:n,modules:a,collectionId:s,layoutId:l}=e;return new Promise((e=>{const c=(0,r.Xy)((0,o.x9)().page_main,a);i.K4(t,"page_builder_closed",{layout_saved:!0,did_revert_layout_to_default:c,sessions_id:n,collection_id:s,layout_id:l}),e()}))}function u(e){let{environment:t,sessionId:n,module:o,collectionId:r,layoutId:a}=e;i.K4(t,"page_builder_module_removed",{...s({module:o,sessionId:n}),collection_id:r,layout_id:a})}function p(e){let{environment:t,module:n,sessionId:o,collectionId:r,layoutId:a}=e;i.K4(t,"page_builder_module_added",{...s({module:n,sessionId:o}),collection_id:r,layout_id:a})}function m(e){let{environment:t,sessionId:n,collectionId:o,layoutId:r}=e;i.K4(t,"page_builder_module_reordered",{session_id:n,collection_id:o,layout_id:r})}},123347:(e,t,n)=>{n.d(t,{CE:()=>h,D_:()=>v,K$:()=>u,N7:()=>m,N8:()=>p,Nk:()=>d,Xh:()=>f,xN:()=>g});n(21703);var o=n(3093),r=n(542297),i=n(215828),a=n(385555),s=n(748528),l=n(496802);class c extends Error{constructor(e,t){super();const n=`Collection with id ${t} had no property groups on format.property_groups`;this.message=`${e} -- ${n}`}}function d(e){var t;let{collectionStore:n,groupId:r,propertyId:i,transaction:s}=e;if(!a.default.checkGate({gateName:"page_layouts"}))return;const d=null===(t=n.getFormat())||void 0===t?void 0:t.property_groups;if(!d)throw new c("cannot reorder properties",n.id);const u=(0,o.zh)({propertyGroups:d,groupId:r,propertyIds:[i]});l.FH({stores:[n],update:{property_groups:u},transaction:s})}function u(e){let{collectionStore:t,propertyId:n,transaction:r}=e;if(!a.default.checkGate({gateName:"page_layouts"}))return;const i=t.getNormalizedPropertyGroups();if(!i)return;const s=(0,o.O4)({propertyGroups:i,propertyId:n});l.FH({stores:[t],update:{property_groups:s},transaction:r})}function p(e){let{collectionStore:t,newPartialPropertyIds:n,groupId:r,transaction:i}=e;if(!a.default.checkGate({gateName:"page_layouts"}))return;const s=t.getNormalizedPropertyGroups();if(!s)throw new c("cannot reorder properties",t.id);const d=(0,o.en)({propertyGroups:s,groupId:r,errorMessageIfMissing:"cannot reorder properties"}),{id:u,...p}=(0,o.oH)({propertyGroup:d,newPartialProperties:n}),m=(0,o.x8)({propertyGroups:s,groupId:u,newValue:p});l.FH({stores:[t],update:{property_groups:m},transaction:i})}function m(e){let{collectionStore:t,newGroups:n,transaction:o}=e;l.FH({stores:[t],update:{property_groups:n},transaction:o})}function g(e){let{collectionStore:t,newGroupTitle:n,transaction:o}=e;if(!a.default.checkGate({gateName:"page_layouts"}))return;const s=t.getNormalizedPropertyGroups(),c={title:n,id:(0,i.ZP)()};if(!s){const e=Object.keys(t.getSchema()).filter((e=>!(0,r.S4)(e)));c.propertyIds=e}const d=[c,...s||[]];return l.FH({stores:[t],update:{property_groups:d},transaction:o}),c.id}function f(e){let{collectionStore:t,groupId:n,transaction:r}=e;if(!(0,s.aF)())return;const i=t.getNormalizedPropertyGroups();if(!i)return;const a=(0,o.tZ)({propertyGroups:i,groupId:n});l.FH({stores:[t],update:{property_groups:a},transaction:r})}function h(e){let{collectionStore:t,groupId:n,transaction:r}=e;if(!(0,s.aF)())return;const i=t.getNormalizedPropertyGroups();if(!i)return;const a=(0,o.oC)({propertyGroups:i,groupId:n});l.FH({stores:[t],update:{property_groups:a},transaction:r})}function v(e){let{collectionStore:t,groupId:n,transaction:r}=e;if(!(0,s.aF)())return;const i=t.getNormalizedPropertyGroups();if(!i)return;const a=(0,o.ln)({propertyGroups:i,groupId:n});l.FH({stores:[t],update:{property_groups:a},transaction:r})}},339861:(e,t,n)=>{n.d(t,{U:()=>s});n(21703);var o=n(959753),r=n(278702),i=n(652136),a=n(210228);function s(e){var t;let{environment:n,transaction:s,layoutStore:l,position:c,updatedModule:d,sessionId:u}=e;const p=(0,r.eJ)(c.area),m=null===(t=l.getRawModules())||void 0===t?void 0:t[p];if(!m)throw new Error("Unable to find modules");if(-1===m.findIndex((e=>e.id===c.moduleId)))throw new Error("Unable to find module being updated.");a.createAndCommitOrAppend({environment:n,transaction:s,perform(e){a.applyOperation({transaction:e,store:l,operation:o.CIp.updateModule(l.pointer,p,(0,i.cm)(d))})},userAction:"BuilderLayoutModules.updateModule"})}},60217:(e,t,n)=>{n.d(t,{C_:()=>R,D9:()=>E,GB:()=>F,L2:()=>B,Nr:()=>P,Qg:()=>D,WJ:()=>U,h9:()=>M,m4:()=>T,mj:()=>A,n1:()=>Z});var o=n(800480),r=n(797511),i=n(886628),a=n(541432),s=n(406695),l=n(606287),c=n(761045),d=n(457819),u=n(110906),p=n(607709),m=n(922705),g=n(120315),f=n(212534),h=n(292283),v=n(785957),y=n(861931),b=n(80444),_=n(316772),S=n(385555),k=n(319111),w=n(594896),x=n(282136),I=n(188923),C=n(417963);function T(e){(0,f.ZP)({event:e,context:f.Af.EditorMouseDown,callback:()=>{}})}function M(e){(0,f.ZP)({event:e,context:f.Af.EditorClick,callback:()=>{}})}function P(e){return(0,i.VK)((()=>Boolean(C.Z.state.pageMap[e.id])||w.Z.state.pages.has(e.id)),[e.id])}function A(e,t){const n=(0,o.O7)(),a=(0,r.l)(),s=P(e),l=(0,i.VK)((()=>t===x.S.Frame?b.default.state.currentLoadingContainerStore:t===x.S.PeekView&&I.default.state.open?I.default.state.loadingContainerStore:void 0),[t]),c=D(e);return(0,i.VK)((()=>{const t=n.currentUser.isLoggedIn(),o=a&&a.publicEditModeStore.state;return Boolean(e&&l&&e.isDefined()&&!e.isNonEditableState()&&e.canEdit()&&!e.hasContent()&&t&&(!(null!=o&&o.hasPublicPermission)||"edit"===(null==o?void 0:o.permission))&&!s&&l.state.ready&&!c&&(!(0,g.GD)(o)||"completionPopup"!==_.default.state.type))}),[n.currentUser,c,l,a,s,e])}function R(e,t){const n=(0,o.O7)(),a=(0,r.l)();return(0,i.VK)((()=>{if(t===x.S.SitePreview)return!1;if(n.device.isMobile)return!1;if(!n.currentUser.isLoggedIn())return!1;const o=a&&a.publicEditModeStore.state;if(null!=o&&o.hasPublicPermission&&"edit"!==(null==o?void 0:o.permission))return!1;if(e.getContentLength()>1)return!1;if(!e.canEdit()||e.isNonEditableState())return!1;const r=e.getContentStores()[0];if(r&&!r.isEmptyTextBlock())return!1;if(e.getAssociatedCollectionStore())return!1;const i=m.TI.state,s=m.mn.state;return!i||e.id!==s}),[n,a,e,t])}function D(e){return(0,i.VK)((()=>{if(e.isCollectionView()){const t=e.getCollectionViewSourceCollectionStore();return!!t&&t.isSyncedCollection()}return e.isType(a.Ti.externalObjectInstancePage)}),[e])}function B(e){return(0,i.VK)((()=>{if(!(0,h.K6)())return!1;const t=e.getParentStore();if((null==t?void 0:t.table)===l.vF){const e=t.getFormat();return!(null==e||!e.external_collection_type)}return!1}),[e])}function E(e){return(0,i.VK)((()=>{if(!(0,h.K6)())return!1;var t;return!!e.isCollectionView()&&((null===(t=e.getCollectionStore())||void 0===t||null===(t=t.getFormat())||void 0===t?void 0:t.external_collection_type)??!1)}),[e])}function F(e){return(0,i.VK)((()=>{if(!S.default.checkGate({gateName:"csvimport_faster_navigate_to_page_enabled"}))return!1;var t;return!!e.isCollectionView()&&((null===(t=e.getCollectionStore())||void 0===t||null===(t=t.getFormat())||void 0===t?void 0:t.static_import_collection_type)===s.gH.CsvImport??!1)}),[e])}function Z(e){const t=(0,o.O7)(),{device:n,WindowSizeStore:r}=t,a=(0,i.VK)((()=>{const e=r.state.height,o=n.isMobile&&k.Z.state.open?e:0;return c._4(t)+o}),[t,r,n.isMobile]);return(0,i.VK)((()=>Boolean((0,d.RR)(_.default.state))?600:"home-phone"===e?y.jq:n.isTablet?380:n.isIOS?Math.max(350,a):n.isMobile?400:"side-peek"===e||"center-peek"===e?80:"home"===e?y.XX:"30vh"),[n,a,e])}function U(e){const t=(0,o.O7)(),n=(0,i.VK)((()=>(0,p.fg)(t,e)),[t,e]);return(0,i.VK)((()=>n&&!e.isFullWidth()?(0,p.gC)(t,(0,v.wq)(e),(0,u.Ks)(e)):0),[t,n,e])}},108464:(e,t,n)=>{n.d(t,{l:()=>a});var o=n(206258);class r{constructor(e,t){this.parentStore=e,this.impl=t}getUnderlyingTypeForActionsOnly(){return this.impl.type}getCollectionViewPointer(){return this.impl.collectionViewPointer}getId(){return this.impl.id}isUnlistedView(){return!0}getInfoForPage(e){var t;const n=null===(t=e.getCollectionViewModulesMapStore())||void 0===t||null===(t=t.getValue())||void 0===t||null===(t=t[this.impl.id])||void 0===t?void 0:t.collection_view_block_pointer;if(n){const t=o.G.createChildStore(e,n);return{type:"pageWithCustomizedModule",collectionViewBlockStore:t,collectionViewId:t.getCollectionViewIds()[0]}}return{type:"pageWithLayoutModule",collectionViewBlockStore:o.G.createChildStore(e,this.impl.collectionViewBlockPointer),collectionViewId:this.impl.collectionViewPointer.id}}getCollectionViewBlockStore(){const e=o.G.createChildStore(this.parentStore,this.impl.collectionViewBlockPointer);if(null!=e&&e.isCollectionView())return e}getCollectionViewContext(){const e=this.getCollectionViewBlockStore();if(!e)return;const t=e.getCollectionPointer();if(!t)return;const n=o.Xr.createChildStore(e,this.impl.collectionViewPointer);if(!n)return;return{type:"collectionView",collectionViewBlockStore:e,collectionStore:o.NW.createChildStore(e,t),collectionViewStore:n,pageVisitSourceOverride:void 0}}}class i{constructor(e,t){this.parentStore=e,this.impl=t}getUnderlyingTypeForActionsOnly(){return this.impl.type}getCollectionViewBlockStoreWithParent(e){return o.G.createChildStore(e,this.impl.collectionViewBlockPointer)}getCollectionViewBlockStore(){return this.getCollectionViewBlockStoreWithParent(this.parentStore)}getCollectionViewPointer(){const e=this.getCollectionViewBlockStoreWithParent(this.parentStore).getCollectionViewPointers();if(e.length>0)return e[0]}getId(){return this.impl.id}isUnlistedView(){return!1}getInfoForPage(e){var t,n;const r=null===(t=e.getCollectionViewModulesMapStore())||void 0===t||null===(t=t.getValue())||void 0===t||null===(t=t[this.impl.id])||void 0===t?void 0:t.collection_view_block_pointer;if(r){const t=o.G.createChildStore(e,r);return{type:"pageWithCustomizedModule",collectionViewBlockStore:t,collectionViewId:t.getCollectionViewIds()[0]}}return{type:"pageWithLayoutModule",collectionViewBlockStore:this.getCollectionViewBlockStoreWithParent(e),collectionViewId:null===(n=this.getCollectionViewPointer())||void 0===n?void 0:n.id}}getCollectionViewContext(){const e=this.getCollectionViewBlockStoreWithParent(this.parentStore),t=this.getCollectionViewPointer();if(!t)return;const n=o.Xr.createChildStore(e,t);return{type:"collectionView",collectionViewBlockStore:e,collectionStore:n.getCollectionStore(),collectionViewStore:n,pageVisitSourceOverride:void 0}}}function a(e,t){return"collectionView"===t.type?new r(e,t):new i(e,t)}},529294:(e,t,n)=>{n.d(t,{GH:()=>f,Iy:()=>g,Jx:()=>b,NL:()=>S,TE:()=>y,rb:()=>h,tR:()=>_,xx:()=>w});var o=n(667294),r=n(886628),i=n(966673),a=n(915157),s=n(653965),l=n(785957),c=n(385555),d=n(188923),u=n(87863);const p=370,m=280;function g(){return d.SIDEPEEK_MIN_WIDTH+f()}function f(){return"center_peek"===d.default.state.mode||c.default.checkGate({gateName:"stacked_properties_in_sidebar"})?m:p}function h(){var e;const t=null===(e=d.default.peekTargetStore.state)||void 0===e||null===(e=e.getAssociatedCollectionStore())||void 0===e?void 0:e.getLayoutStore();return t&&"static_sidebar"===u.Z.state.displayStyle&&u.Z.state.isOpen&&0!==t.getModules({excludeDeletedProperties:!0}).page_details.length?f():0}const v="DetailsSidebarOverrides";function y(e){const t=a.Z.get({userId:e.currentUser.id,key:v})??{};u.Z.update((e=>({...e,detailsPanelOverridesMap:t})))}function b(e){let{environment:t,layoutStore:n,state:o}=e;u.Z.setOverrideForLayout(n,o),a.Z.set({userId:t.currentUser.id,key:v,value:{...u.Z.state.detailsPanelOverridesMap}})}function _(e,t){const n=(0,r.VK)((()=>d.default.state.open),[]),a=(0,r.VK)((()=>e.WindowSizeStore.state.width),[e.WindowSizeStore]),s=(0,r.VK)((()=>d.default.state.preferredSidePeekWidth),[]),l=(0,r.VK)((()=>g()),[]),c=(0,r.VK)((()=>l),[l]),p=(0,r.VK)((()=>{if(t)return u.Z.getOverrideForLayout(t)}),[t]),m=(0,r.VK)((()=>u.Z.state.displayStyle),[]),f=(0,i.D9)(s),h=(0,i.D9)(a),v=(0,i.D9)(m);(0,o.useEffect)((()=>{n&&t&&void 0!==f&&f!==s&&(s<l?u.Z.setClosed():"closed"!==p&&u.Z.setOpen())}),[e,n,p,t,l,s,f]),(0,o.useEffect)((()=>{if(!n||!t)return;if(void 0===h||h===a)return;const e="center_peek"===d.default.getPeekMode();a<c||e&&s<c?(u.Z.setDisplayStyle("popup"),u.Z.setClosed()):(u.Z.setDisplayStyle("static_sidebar"),"popup"===v&&s<l&&u.Z.setClosed())}),[n,t,c,l,a,s,v,h])}function S(e){let t;return t=k("open"===e?d.default.state.preferredSidePeekWidth+f():d.default.state.preferredSidePeekWidth-f()),{clampedWidth:t,hadEffect:t!==d.default.state.preferredSidePeekWidth}}function k(e){return(0,s.uZ)(e,d.SIDEPEEK_MIN_WIDTH,(0,l.my)())}function w(e){const t=e.getLayoutStore();return!!t&&t.getModules({excludeDeletedProperties:!0}).page_details.length>0}},62682:(e,t,n)=>{n.d(t,{N:()=>s,V:()=>l});var o=n(886628),r=n(450627),i=n(400807),a=n(748528);function s(e){let{environment:t,blockStore:n,from:o}=e;const{device:s}=t;if(s.isMobile)return!1;if(!(0,a.aF)())return!1;if("suggest"===i.Z.getMode(n))return!1;if(n.pathIsDead())return!1;if(n.isCollectionView()&&"topControls"!==o)return Boolean(n.canEditCollection()&&n.getCollectionViewSourceCollectionStore()&&!n.isCollectionViewPageWithContent());if(n.isPageBlock()){const e=n.getAssociatedCollectionStore();return Boolean(e&&e.canEditCollection()&&!e.isPageTreeCollection()&&!(0,r.a_)(n)&&!(0,r.Wt)(n))}return!1}function l(e){let{environment:t,blockStore:n}=e;return(0,o.VK)((()=>!!n&&s({environment:t,blockStore:n})),[n,t])}},748528:(e,t,n)=>{n.d(t,{CA:()=>s,Ey:()=>c,_6:()=>a,aF:()=>i,u4:()=>l});var o=n(305971),r=n(385555);function i(){return r.default.checkGate({gateName:"page_layouts"})}function a(){return(0,o.E)("page_layouts")}function s(){return i()&&r.default.checkGate({gateName:"default_open_sidebar"})}function l(){const e=a(),t=(0,o.E)("page_backlinks_refresh");return e&&t}function c(){const e=a(),t=(0,o.E)("layout_property_style_refresh");return e&&t}},431183:(e,t,n)=>{n.d(t,{Uo:()=>m,WM:()=>p,d0:()=>g,nJ:()=>f,zD:()=>h});var o=n(886628),r=n(180951),i=n(406695),a=n(842875),s=n(295519),l=n(3093),c=n(225985),d=n(542297),u=n(385555);function p(e){let{store:t,format:n,schema:o,collectionStore:c,propertyIds:d,propertyGroupId:p,intl:m,environment:g}=e;const f=t.getModel(),h=function(e){let{propertyGroups:t,propertyIds:n,propertyGroupId:o,format:r,layoutsWipEnabled:i}=e;const a=n?n.map((e=>({property:e,visible:!0}))):void 0;if(a)return a;if(o&&i){if(!t)return[];const e=(0,l.vX)({propertyGroups:t,groupId:o});return null!=e&&e.propertyIds?e.propertyIds.map((e=>({property:e,visible:!0}))):[]}return(r.collection_page_properties||[]).filter((e=>{var t;return null===(t=r.collection_page_sections)||void 0===t||!t.some((t=>t.section===e.property&&("inline"===t.visibility||"minimal"===t.visibility)))}))}({propertyGroups:c.getNormalizedPropertyGroups(),propertyIds:d,propertyGroupId:p,format:n,layoutsWipEnabled:u.default.checkGate({gateName:"page_layouts"})}),v="on"===u.default.getGroup("default-new-page-property-to-hide-when-empty")?(0,s.i)(n,o,void 0,i.j5.Collection):c.getFormat(),y=v&&v.property_visibility;if(y){return h.map((e=>{var n;return{visibility:"show",hasValue:!Boolean(f&&r.wV({block:f,property:e.property,schema:o,getRecordModel:t.getRecordModel,userId:g.currentUser.id,userTimeZone:(0,a.r)(),intl:m})),name:(null===(n=o[e.property])||void 0===n?void 0:n.name)??"",...e,...y.find((t=>t.property===e.property))}}))}return h?h.map((e=>{var n;return{...e,visibility:"show",hasValue:Boolean(t.getPropertyValue(e.property)),name:(null===(n=o[e.property])||void 0===n?void 0:n.name)??""}})):[]}function m(e){const{layoutStore:t,propertyId:n}=e;let o=!1,r=!1;const i=t.getModules(),a=Boolean(i.page_main.some((e=>(0,c.f)(e)?n===e.propertyId:"normalizedTitleWithIcon"===e.type&&(e.supportsPinnedProperties&&e.propertyIds.includes(n)))));return a||(r=!!i.page_details.some((e=>!!(0,c.f)(e)&&n===e.propertyId))),o=!a&&!r,o&&(r=!!i.page_details.find((e=>{let{type:t}=e;return"properties"===t}))),{isPropertyInPageDetails:r,isPropertyInGroup:o}}function g(e){const{propertyId:t,store:n}=e;return(0,o.VK)((()=>{var e;const o=null==n||null===(e=n.getAssociatedCollectionStore())||void 0===e?void 0:e.getLayoutStore();return o&&t?m({layoutStore:o,propertyId:t}):{isPropertyInPageDetails:!1,isPropertyInGroup:!1}}),[t,n])}function f(e){const{collectionStore:t}=e,n=t.getParentBlockStore(),o=t.getLayoutStore();if(!o)return 0;let r=!1;const i=new Set,a=new Set,s=o.getModules();if(s.page_main.forEach((e=>{(0,c.f)(e)&&i.add(e.propertyId),"normalizedTitleWithIcon"===e.type&&e.supportsPinnedProperties&&e.propertyIds.forEach((e=>{i.add(e)}))})),s.page_details.forEach((e=>{"properties"!==e.type?(0,c.f)(e)&&a.add(e.propertyId):r=!0})),!n)return 0;const l=t.getSchema();return Object.keys(l).reduce(((e,t)=>{const n=l[t];return!n||(0,d.S4)(n.type)?e:a.has(t)||!i.has(t)&&r?e+1:e}),0)}function h(e){const{module:t,collectionSchema:n}=e;return(t.supportsPinnedProperties?t.propertyIds:[]).filter((e=>Boolean(n[e])))}},87863:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{detailsPanelOverridesMap:{},isOpen:!1,displayStyle:void 0,isMouseHoveringPanel:!1}}setOpen(){this.state.isOpen||this.setState({...this.state,isOpen:!0})}setClosed(){this.state.isOpen&&this.setState({...this.state,isOpen:!1})}setDisplayStyle(e){this.state.displayStyle!==e&&this.setState({...this.state,displayStyle:e})}setOverrideForLayout(e,t){return this.setState({...this.state,detailsPanelOverridesMap:{...this.state.detailsPanelOverridesMap,[e.id]:t}})}getOverrideForLayout(e){var t;return null===(t=this.state.detailsPanelOverridesMap)||void 0===t?void 0:t[e.id]}setSidebarIncreasedSizeOfPeekView(e){e!==this.state.detailsSidebarIncreasedSizeOfPeekView&&this.setState({...this.state,detailsSidebarIncreasedSizeOfPeekView:e})}}const i=new r},334017:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isOpen:!1}}}const i=new r},450734:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(453809),r=n(749085),i=n(430548);const a=new o.D({key:"property_groups_module_state",namespace:i.$p,important:!0,trackingType:"necessary"});class s extends r.default{constructor(){super();const e=a.getState();if(e){const t=this.getInitialState();super.setState({...t,propertyGroupOpenOverridesMap:e.propertyGroupOpenOverridesMap??t.propertyGroupOpenOverridesMap})}}setState(e){super.setState(e),a.setState(e)}setPropertyGroupExpandedOverride(e){var t;const{groupId:n,override:o}=e;this.setState({...this.state,propertyGroupOpenOverridesMap:{...null==this||null===(t=this.state)||void 0===t?void 0:t.propertyGroupOpenOverridesMap,[n]:o}})}getPropertyGroupExpandedOverride(e){var t;const{groupId:n}=e;return null==this||null===(t=this.state)||void 0===t||null===(t=t.propertyGroupOpenOverridesMap)||void 0===t?void 0:t[n]}isPropertyGroupExpanded(e){const{groupId:t}=e,n=this.getPropertyGroupExpandedOverride({groupId:t});return void 0===n||"open"===n}togglePropertyGroupExpanded(e){const{groupId:t}=e,n=this.isPropertyGroupExpanded({groupId:t})?"closed":"open";this.setPropertyGroupExpandedOverride({groupId:t,override:n})}}const l=new s},971384:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(749085),r=n(401898),i=n(619584),a=n(21359);class s extends o.default{getInitialState(){return{pageSignals:new Map}}getKey(e,t){return`${e}:${t}`}getPageSignals(e){let{spaceId:t,userId:n}=e;if(!t||!n)return;const o=this.getKey(t,n),r=this.state.pageSignals.get(o);return r||void 0}async updatePageSignals(e){const{spaceId:t,userId:n,blocks:o}=e;if(!t||!n)return;const s=this.getPageSignals(e),c=void 0===s?o:o.filter((e=>!s.hasOwnProperty(e.blockModel.id)));if(c.length>0&&await async function(e){const{spaceId:t,userId:n,blocks:o,environment:s}=e,c=o.map((e=>e.blockModel.id));if(!t||!n||!(0,r.Of)(c))return;const d=await a.getPageSignals(s,{spaceId:t,pageIds:c,includeRecords:!0,signals:[{name:"pageAuthorityV1"}]});if("success"===d.type){const e=c.map((e=>({})));d.data.signals.forEach((t=>{if("success"===t.status){const{name:n,data:o}=t;o.forEach(((t,o)=>{e[o][n]=t}))}}));const o=(0,i.m8)(e.map(((e,t)=>[c[t],e]))),r=l.getKey(t,n);l.update((e=>{const t=e.pageSignals.get(r),n=e.pageSignals.set(r,{...t,...o});return{...e,pageSignals:n}}))}}({...e,blocks:c}),s){const e=Object.keys(s).length+c.length;if(e>2048){const r=e-2048,i=new Set(o.map((e=>e.blockModel.id)));!function(e){const{spaceId:t,userId:n,pageIds:o}=e,r=l.getKey(t,n);l.update((e=>{const t={...e.pageSignals.get(r)};o.forEach((e=>delete t[e]));const n=e.pageSignals.set(r,t);return{...e,pageSignals:n}}))}({spaceId:t,userId:n,pageIds:Object.keys(s).filter((e=>!i.has(e))).slice(0,r)})}}}}const l=new s},377282:(e,t,n)=>{n.d(t,{Z:()=>g});var o=n(516691),r=n(511799),i=n(182798),a=(n(430541),n(21703),n(757658),n(541432)),s=n(933147),l=n(653965),c=n(554843);class d extends s.Z{constructor(e){super(),this.blocks=void 0,this.liveBlocks=void 0,this.rootBlock=void 0,this.detachedRootBlocks=void 0,this.blocks=new Map,this.liveBlocks=new Map,this.rootBlock=this.createBlock(e,"page"),this.detachedRootBlocks=new Map}hasBlock(e){return this.blocks.has(e)}getBlock(e){return(0,i.TO)(this.blocks.get(e))}createBlock(e,t){(0,i.T)(!this.hasBlock(e.id));const n=new u({blockStore:e,tracker:this,reference:t,onCreated:e=>{this.blocks.set(e.getId(),e)}});return n.hasLiveReference()&&this.addLiveBlock(n),n}removeBlock(e){(0,i.T)(this.hasBlock(e)),(0,i.T)(!this.liveBlocks.has(e),"Should not be possible to remove a live block."),this.blocks.delete(e)}getLiveBlocks(){return[...this.liveBlocks.values()]}addLiveBlock(e){(0,i.T)(!this.liveBlocks.has(e.getId())),this.liveBlocks.set(e.getId(),e),this.emit({type:"add_block",blockStore:e.blockStore})}removeLiveBlock(e){this.liveBlocks.delete(e.getId()),this.emit({type:"remove_block",blockId:e.getId()})}destroy(){for(const e of this.blocks.values())e.destroy();this.blocks.clear(),this.liveBlocks.clear(),this.detachedRootBlocks.clear()}getClosestPageAndTransclusionReferenceAncestorIds(e){const t=this.liveBlocks.get(e);return t?t.getClosestPageAndTransclusionReferenceAncestors().map((e=>e.getId())):[]}getPathToBlock(e){const t=this.liveBlocks.get(e);if(!t)return;const n=[];let o=t;for(;o;){n.unshift(o.getId());const e=o.liveReferences.values().next().value;if("page"===e)return n;o=e}throw new Error("Block should have a page ancestor")}}class u{constructor(e){this.tracker=void 0,this.blockStore=void 0,this.liveReferences=void 0,this.detachedReferences=void 0,this.childBlocks=void 0,this.childBlocksList=void 0,this.contentStoreListener=void 0;const{blockStore:t,tracker:n,reference:o,onCreated:r}=e;this.tracker=n,this.blockStore=t,this.liveReferences=new Set,this.detachedReferences=new Set,"page"===o||o.hasLiveReference()?this.liveReferences.add(o):this.detachedReferences.add(o),this.childBlocks=new Map,this.childBlocksList=[],r(this),this.contentStoreListener=()=>this.handleContentStoreChange(),this.blockStore.getKeyStore("type").addListener(this.contentStoreListener),this.blockStore.getContentStore().addListener(this.contentStoreListener),this.blockStore.getFormatStore().getKeyStore("transclusion_reference_pointer").addListener(this.contentStoreListener),this.handleContentStoreChange()}handleContentStoreChange(){const e=[...this.childBlocks.keys()],t=new Map,n=this.blockStore.getType();if(this.liveReferences.has("page")||n&&!(0,a.S9)(n))for(const i of(0,c.y)(this.blockStore))t.set(i.id,i);const o=[...t.keys()],r=l.e5(o,e),s=l.e5(e,o);for(const a of r)if(this.tracker.hasBlock(a)){const e=this.tracker.getBlock(a);e.addReference(this),this.childBlocks.set(a,e)}else{const e=this.tracker.createBlock((0,i.TO)(t.get(a)),this);this.childBlocks.set(a,e)}for(const a of s){const e=(0,i.TO)(this.childBlocks.get(a));this.childBlocks.delete(a),e.removeReference(this)}this.childBlocksList=[...t.keys()].map((e=>(0,i.TO)(this.childBlocks.get(e))))}getId(){return this.blockStore.id}hasLiveReference(){return this.liveReferences.size>0}addReference(e){e.hasLiveReference()?this.addLiveReference(e):this.addDetachedReference(e)}addLiveReference(e){if((0,i.T)(!this.liveReferences.has(e)),this.liveReferences.add(e),1===this.liveReferences.size){this.tracker.addLiveBlock(this);for(const e of this.childBlocks.values())e.updateReference(this)}}addDetachedReference(e){this.detachedReferences.add(e)}removeReference(e){e.hasLiveReference()?this.removeLiveReference(e):this.removeDetachedReference(e)}removeLiveReference(e){if(this.liveReferences.delete(e),this.detachedReferences.add("detached"),this.tracker.detachedRootBlocks.set(this.getId(),this),0===this.liveReferences.size){this.tracker.removeLiveBlock(this);for(const e of this.childBlocks.values())e.updateReference(this)}return this}removeDetachedReference(e){if(this.detachedReferences.delete(e),0===this.liveReferences.size&&0===this.detachedReferences.size){for(const[e,t]of this.childBlocks.entries())this.childBlocks.delete(e),t.removeReference(this);this.tracker.removeBlock(this.getId()),this.destroy()}}updateReference(e){const t=this.hasLiveReference();this.liveReferences.has(e)&&!e.hasLiveReference()?(this.liveReferences.delete(e),this.detachedReferences.add(e)):this.detachedReferences.has(e)&&e.hasLiveReference()&&(this.liveReferences.add(e),this.detachedReferences.delete(e));const n=this.hasLiveReference();if(t!==n){n?this.tracker.addLiveBlock(this):this.tracker.removeLiveBlock(this);for(const e of this.childBlocks.values())e.updateReference(this)}return this}getClosestPageAndTransclusionReferenceAncestors(){if(0===this.liveReferences.size)return[];if(this===this.tracker.rootBlock)return[this];const e=new Set,t=new Set,n=[this];for(;n.length>0;){const o=(0,i.TO)(n.shift());if(t.has(o))continue;const r=o.liveReferences;for(const t of r)"page"===t?e.add(o):"transclusion_reference"===t.blockStore.getType()?e.add(t):n.push(t);t.add(o)}return(0,i.T)(e.size>0),[...e]}destroy(){this.contentStoreListener&&(this.blockStore.getKeyStore("type").removeListener(this.contentStoreListener),this.blockStore.getContentStore().removeListener(this.contentStoreListener),this.blockStore.getFormatStore().getKeyStore("transclusion_reference_pointer").removeListener(this.contentStoreListener),this.contentStoreListener=void 0)}}var p=n(401898);class m{constructor(e){this.blockTextInstanceMap=void 0,this.textInstanceBlockMap=void 0,this.blockTextSliceTreeListenerMap=void 0,this.pageBlockTracker=void 0,this.pageBlockTrackerListener=void 0,this.blockTextInstanceMap=new Map,this.textInstanceBlockMap=new Map,this.blockTextSliceTreeListenerMap=new Map,this.pageBlockTracker=e,this.pageBlockTrackerListener=e=>this.handlePageEvent(e),this.pageBlockTracker.addListener(this.pageBlockTrackerListener);for(const{blockStore:t}of e.getLiveBlocks())this.addBlock(t)}handlePageEvent(e){const t=e.type;switch(t){case"add_block":this.addBlock(e.blockStore);break;case"remove_block":this.removeBlock(e.blockId);break;default:(0,p.t1)(t)}}addBlock(e){const t=e.id;if(this.blockTextSliceTreeListenerMap.has(t))return;const n=()=>{this.handleTextSliceTreeChange(t,e.getTextSliceTree())};e.getSerializedTextSliceTreeStore().addListener(n),this.blockTextSliceTreeListenerMap.set(t,{blockStore:e,textSliceTreeListener:n}),this.handleTextSliceTreeChange(t,e.getTextSliceTree())}removeBlock(e){this.removeMappingForBlock(e);const{blockStore:t,textSliceTreeListener:n}=(0,i.TO)(this.blockTextSliceTreeListenerMap.get(e));t.getSerializedTextSliceTreeStore().removeListener(n),this.blockTextSliceTreeListenerMap.delete(e)}handleTextSliceTreeChange(e,t){if(this.removeMappingForBlock(e),t)for(const n of t.getTextInstanceIds())this.addBlockTextInstanceMapping(e,n)}removeMappingForBlock(e){const t=this.blockTextInstanceMap.get(e);if(t)for(const n of t)this.removeBlockTextInstanceMapping(e,n)}addBlockTextInstanceMapping(e,t){const n=this.blockTextInstanceMap.get(e)??new Set;n.add(t),this.blockTextInstanceMap.set(e,n);const o=this.textInstanceBlockMap.get(t)??new Set;o.add(e),this.textInstanceBlockMap.set(t,o)}removeBlockTextInstanceMapping(e,t){const n=(0,i.TO)(this.blockTextInstanceMap.get(e));n.delete(t),0===n.size&&this.blockTextInstanceMap.delete(e);const o=(0,i.TO)(this.textInstanceBlockMap.get(t));o.delete(e),0===o.size&&this.textInstanceBlockMap.delete(t)}getTextInstanceIdsForBlock(e){return this.blockTextInstanceMap.has(e)?[...(0,i.TO)(this.blockTextInstanceMap.get(e))]:[]}getBlockIdsForTextInstance(e){return this.textInstanceBlockMap.has(e)?[...(0,i.TO)(this.textInstanceBlockMap.get(e))]:[]}getBlockIdForTextInstanceItemId(e,t,n){const o=this.getBlockIdsForTextInstance(e);for(const r of o){const o=(0,i.TO)(this.blockTextSliceTreeListenerMap.get(r)).blockStore;if((0,i.TO)(o.getTextSliceTree()).findTextSliceTreeContainingItemWithId(e,t,n))return o.id}}destroy(){for(const e of this.blockTextSliceTreeListenerMap.keys())this.removeBlock(e);this.pageBlockTracker.removeListener(this.pageBlockTrackerListener)}}const g=new class{constructor(){this.pageInfoMap=new r.Z({getKey:e=>(0,o.dn)(e)})}trackPage(e){if(this.pageInfoMap.has(e.pointer))return void(0,i.TO)(this.pageInfoMap.get(e.pointer)).pageStores.add(e);const t=new d(e),n=new m(t),o=new Set([e]);this.pageInfoMap.set(e.pointer,{pageBlockTracker:t,pageTextInstanceTracker:n,pageStores:o})}untrackPage(e){const t=e.pointer,n=(0,i.TO)(this.pageInfoMap.get(t));var o;(n.pageStores.delete(e),0===n.pageStores.size)&&(n.pageBlockTracker.destroy(),null===(o=n.pageTextInstanceTracker)||void 0===o||o.destroy(),this.pageInfoMap.delete(t))}clear(){for(const[t,n]of this.pageInfoMap){var e;n.pageBlockTracker.destroy(),null===(e=n.pageTextInstanceTracker)||void 0===e||e.destroy(),this.pageInfoMap.delete(t)}}getPageStoreForBlockStore(e){for(const[t,n]of this.pageInfoMap)for(const o of n.pageStores)if(o.uiLocation.contains(e.uiLocation))return o;for(const[t,n]of this.pageInfoMap)for(const o of n.pageStores){const t=this.pageInfoMap.get(o.pointer);if(null!=t&&t.pageBlockTracker&&t.pageBlockTracker.hasBlock(e.pointer.id))return o}}getPageBlockTrackerForPage(e){var t;return null===(t=this.pageInfoMap.get(e))||void 0===t?void 0:t.pageBlockTracker}getPageTextInstanceTrackerForPage(e){var t;return null===(t=this.pageInfoMap.get(e))||void 0===t?void 0:t.pageTextInstanceTracker}}},554843:(e,t,n)=>{n.d(t,{y:()=>r});var o=n(401898);function r(e){const t=e.getType();if(!t)return[];const n=e.getRenderableContentStores();if(n.length>0)return n;switch(t){case"transclusion_reference":const n=e.getTransclusionReferenceTargetStore();return n?[n]:[];case"text":case"page":case"personal_home_page":case"bulleted_list":case"numbered_list":case"toggle":case"quote":case"factory":case"button":case"to_do":case"column_list":case"column":case"embed":case"framer":case"tweet":case"gist":case"drive":case"audio":case"maps":case"invision":case"mixpanel":case"image":case"video":case"file":case"bookmark":case"equation":case"code":case"header":case"sub_header":case"sub_sub_header":case"collection_view":case"collection_view_page":case"breadcrumb":case"copy_indicator":case"divider":case"link_to_page":case"link_to_collection":case"figma":case"loom":case"typeform":case"codepen":case"pdf":case"callout":case"table_of_contents":case"whimsical":case"miro":case"abstract":case"sketch":case"excalidraw":case"replit":case"alias":case"transclusion_container":case"external_object_instance":case"table":case"table_row":case"tab":case"external_object_instance_page":case"hex":case"deepnote":case"ai_block":case"drawing":case"slide":case"form":case"post":return[];default:(0,o.t1)(t)}}},318245:(e,t,n)=>{n.r(t),n.d(t,{NotionPerformanceClass_TEST_ONLY:()=>S,default:()=>_});n(757658);var o=n(701302),r=n(805809),i=n(568626),a=n(382138),s=n(712139),l=(n(653965),n(401898)),c=n(855337),d=n(153410),u=n(994134),p=n(85844),m=n(14577),g=n(476870),f=n(385555);const h=Object.entries({jsHeapSizeLimit:"browser.mem.heap_size_limit",totalJSHeapSize:"browser.mem.total_heap_size",usedJSHeapSize:"browser.mem.used_heap_size"});function v(e,t,n,o){var r;const i=o??Math.random(),a=f.default.getConfigKey("event_trail_events",n.eventName),s=a&&"sampleRatesByMetric"in a&&"object"==typeof a.sampleRatesByMetric&&(null===(r=a.sampleRatesByMetric)||void 0===r?void 0:r[t])||0;(0,g.aw)(s,(()=>i))&&(0,c.j)({environment:e,event:n,opts:{sampling:{behavior:"custom",sampleRate:1}}})}const y=new Set(["navigation_page_render","navigation_database_render","typing_lag"]);class b{constructor(){this.startTimesByMetricName={},this.lastVisibilityChange=0,p.Z.addListener((()=>{this.lastVisibilityChange=performance.now()}))}DO_NOT_USE_markLegacy(e){return this.mark(e)}mark(e){var t;let n;if(Boolean(null===(t=performance)||void 0===t?void 0:t.mark)){const t=performance.mark(e);if(t)n=t.startTime;else{const t=performance.getEntriesByName(e);n=t[t.length-1].startTime}}else n=performance.now();const o="sentry"===u.getProfilingToolForSession()&&y.has(e)?s.Yr({name:e}):void 0;return this.startTimesByMetricName[e]={startTime:n,sentryTransaction:o},{metricName:e,startTime:n,sentryTransaction:o}}DO_NOT_USE_markAllOfLegacy(e){this.markAllOf(e)}markAllOf(e){if(0===e.length)return;const t=performance.now();for(const n of e)this.startTimesByMetricName[n]={startTime:t,sentryTransaction:"sentry"===u.getProfilingToolForSession()&&y.has(n)?s.Yr({name:n}):void 0}}DO_NOT_USE_measureLegacy(e,t){this.measure(e,t)}measure(e,t){this._measure(e,t)}DO_NOT_USE_measureAfterNextFlushLegacy(e,t){this.measureAfterNextFlush(e,t)}measureAfterNextFlush(e,t){o.default.afterNextFlush((()=>{const n="getData"in t?t.getData():void 0;"getData"in t&&void 0===n||this._measure(e,{...t,data:n})}))}DO_NOT_USE_measureFromAppStartLegacy(e,t){this.measureFromAppStart(e,t)}measureFromAppStart(e,t){if((0,a.Z)())return;const n="object"==typeof e?e.metricName:e,o=r.getAppStartTime();"number"==typeof o&&this.measure({metricName:n,startTime:o,..."object"==typeof e?{endTime:e.endTime}:{}},t)}DO_NOT_USE_measureFromAppStartAfterNextFlushLegacy(e,t){this.measureFromAppStartAfterNextFlush(e,t)}measureFromAppStartAfterNextFlush(e,t){if((0,a.Z)())return;const n="object"==typeof e?e.metricName:e;o.default.afterNextFlush((()=>{const o="getData"in t?t.getData():void 0;if("getData"in t&&void 0===o)return;const i=r.getAppStartTime();"number"==typeof i&&this._measure({metricName:n,startTime:i,..."object"==typeof e?{endTime:e.endTime}:{}},{...t,data:o})}))}_measure(e,t){const{shouldExcludeFromTimeline:n}=t;if("object"==typeof e){const{startTime:o,endTime:r,metricName:i,sentryTransaction:a}=e;this.startTimesByMetricName[i]=void 0;const s=this.getDuration({metricName:i,startTime:o,endTime:r,shouldExcludeFromTimeline:n});a&&a.finish(r),this.trackDuration({metricName:i,startTime:o,duration:s,options:t})}else if("string"==typeof e){const o=e,r=this.startTimesByMetricName[o];if(!r)return;const{startTime:i,sentryTransaction:a}=r;this.clearStartTimesByMetricName(o);const s=this.getDuration({metricName:o,startTime:i,shouldExcludeFromTimeline:n});a&&a.finish(),this.trackDuration({metricName:o,startTime:i,duration:s,options:t})}else(0,l.t1)(e)}clearStartTimesByMetricName(e){this.startTimesByMetricName[e]&&(this.startTimesByMetricName[e]=void 0)}getDuration(e){const{metricName:t,startTime:n,shouldExcludeFromTimeline:o}=e,r="number"==typeof e.endTime?e.endTime:performance.now();if(!o)try{return performance.measure(t,{start:n,end:r}).duration}catch(i){}return r-n}async trackDuration(e){const{metricName:t,duration:n,startTime:o,options:r}=e,{environment:a,preboot:s}=r,l="data"in r?r.data:void 0;if(!document.hidden&&!("number"==typeof this.lastVisibilityChange&&o<this.lastVisibilityChange)&&await c.Vi({eventName:t,eventProperties:l,sampling:{behavior:"statsig",fallbackBehavior:"statsig",statsigNotAvailableBehavior:r.shouldSendIfStatsigNotInitialized?"track":"drop"}})){if(a.device.isElectron&&d.C&&d.C.windowIsVisible){if(!(await d.C.windowIsVisible()))return}if(a.device.isElectron&&d.C&&d.C.isActiveTab){if(!(await d.C.isActiveTab.get()))return}"navigation_database_render"===t&&n>=6e4&&i.log({level:"info",from:"collections",type:"navigationPageRenderSlow",error:{message:`Got a slow navigation page render that took: ${n/1e3}s`},data:{miscDataToConvertToString:l}}),c.j({environment:a,event:{eventName:t,eventProperties:{time:n,...l}},opts:{preboot:s,sampling:{behavior:"custom",sampleRate:1}}}),function(e,t,n){if(!("memory"in(window.performance||{})))return;const o=Math.random();h.forEach((r=>{let[i,a]=r;if(!(i in window.performance.memory))return;const s={eventName:a,eventProperties:{bytes:window.performance.memory[i],collected_during:t,...n}};v(e,t,s,o)}))}(a,t,l),function(e,t,n){v(e,t,{eventName:"computed_store.instances.total",eventProperties:{count:(0,m.QW)(),collected_during:t,...n}})}(a,t,l)}}}const _=new b;class S extends b{}},918402:(e,t,n)=>{n.d(t,{ZO:()=>m,bi:()=>g,r$:()=>f});n(867635);var o=n(568626),r=n(463306),i=n(834687),a=n(186517),s=n(772141),l=n(145953),c=n(291627),d=n(429369),u=n(367669),p=n(80444);function m(e){const{actor:t,ancestors:n,updatedPermissionItem:o,permissionsContext:r}=e;return(0,a.X0)({actor:t,ancestors:n,permissionsContext:r}).some((e=>{const t=(0,a.Kf)(e.permissionItem,o)?o.role:e.permissionItem.role;return!!t&&(0,s.zz)(t)}))}function g(e){const{actorPointers:t,getRecordModel:n,recordPointers:a}=e,s=l.Ak.create();for(const o of a)if(!s.has(o)){(0,r.DW)(o,n).forEach((e=>{s.setModel(e.pointer,e)}))}const p=l.Ak.create(),m=(0,i.QZ)({recordMapFromWhichToFindRelevantEntities:s});for(const o in m.relevantTeamIds){const e={table:d.e0,id:o};s.has(e)||p.setModel(e,n(e))}const g=(0,i.GK)({recordMap:s,getRecordModelFnWithMaybeMissingRecords:n,actorPointers:t,logErrorFn:e=>{const{from:t,type:n,error:r,data:i}=e;o.log({level:"error",from:t,type:n,error:{name:r.name,message:r.message,stack:r.stack},data:{miscDataToConvertToString:i}})}});return{actorPointersSet:new c.X(t),actorMemberships:g,ancestorsRecordMap:s,explicitTeamsRecordMap:p,spacesForSpaceMemberComputation:(0,u.RL)({ancestorsRecordMap:s,getRecordModel:n})}}function f(e){const{actor:t,recordPointer:n,permissionsContext:o}=e,i=(0,r.uv)(n,o.ancestorsRecordMap),l=p.default.state.currentSpaceStore,c=l&&l.isDefined()&&!i.findLast(a.zX)?[...i,l.getModel()]:i,d=(0,a.X0)({actor:t,ancestors:c,permissionsContext:o});if(1===d.length){const e=d[0];if((0,s.$D)(e.permissionItem)&&(0,s.YX)(e.permissionItem.role))return e}}},830806:(e,t,n)=>{n.d(t,{$X:()=>i,Ai:()=>v,Aq:()=>u,Ay:()=>d,BX:()=>c,PQ:()=>g,Rt:()=>p,SJ:()=>m,cY:()=>l,g8:()=>f,gF:()=>y,lj:()=>s,uD:()=>h,uY:()=>a,x8:()=>b});var o=n(855337),r=n(224646);function i(e){let{environment:t,from:n}=e;(0,o.K4)(t,"open_home",{from:n,...(0,r.UF)({environment:t})})}function a(e){let{environment:t,args:n}=e;(0,o.K4)(t,"home_loaded",n)}function s(e){let{environment:t}=e;(0,o.K4)(t,"open_home_more_menu",{})}function l(e){const{environment:t,show:n,feature:r,from:i}=e;(0,o.K4)(t,"toggle_home_feature",{show:n,feature:r,from:i})}function c(e){let{environment:t,oldValue:n,newValue:r,from:i}=e;(0,o.K4)(t,"change_start_page",{old_value:n,new_value:r,from:i})}function d(e){let{environment:t,index:n,teamId:r}=e;(0,o.K4)(t,"change_home_trending_source",{source_type:r?"team":"space",selected_index:n,selected_team_id:r})}function u(e){let{environment:t,from:n}=e;(0,o.K4)(t,"click_empty_my_tasks",{from:n})}function p(e){let{environment:t,from:n}=e;(0,o.j)({environment:t,event:{eventName:"click_empty_custom_db",eventProperties:{from:n}}})}function m(e){let{environment:t,from:n}=e;(0,o.K4)(t,"close_task_migration_modal",{from:n})}function g(e,t){(0,o.K4)(e,"open_home_tip",t)}function f(e,t){(0,o.K4)(e,"check_home_tip",t)}function h(e,t){(0,o.K4)(e,"show_completed_home_tips",t)}function v(e,t){(0,o.K4)(e,"home_tips_modal_error",t)}function y(e){let{environment:t}=e;(0,o.K4)(t,"visit_home_help_page")}function b(e){let{environment:t,firstUnloadedCachePageIndex:n}=e;(0,o.j)({environment:t,event:{eventName:"home.recents.first_unloaded_cache_page_index",eventProperties:{first_unloaded_cache_page_index:n}}})}},361673:(e,t,n)=>{n.d(t,{H3:()=>m,OA:()=>b,WC:()=>w,bl:()=>h,c5:()=>f,cP:()=>u,io:()=>y,jC:()=>_,uR:()=>g,ud:()=>k,z$:()=>p});var o=n(760310),r=n(815978),i=n(210228),a=n(237181),s=n(80444),l=n(385555),c=n(981829),d=n(570747);function u(e){let{environment:t,checklistItem:n}=e;if(l.default.checkGate({gateName:"enable_write_personal_home_checklist_user_setting"})){var o;if(!(null===(o=s.default.state.currentUserSettingsStore)||void 0===o||null===(o=o.getPersonalHomeNewUserChecklistSettings().progress_data[n])||void 0===o?void 0:o.isCompleted)){a.f7({environment:t,checklistItem:n,partialUpdates:{isCompleted:!0}});const e=c.Wn();r.f1(t,n,e),v(t,e)}}}function p(e){var t;const n=null===(t=s.default.state.currentUserSettingsStore)||void 0===t?void 0:t.getSettings();(null!=n&&n.used_mac_app||null!=n&&n.used_windows_app)&&m({environment:e,appCheckedOut:"desktop"}),(null!=n&&n.used_android_app||null!=n&&n.used_ios_app)&&m({environment:e,appCheckedOut:"mobile"})}function m(e){var t;let{environment:n,appCheckedOut:o}=e;const i=null===(t=s.default.state.currentUserSettingsStore)||void 0===t?void 0:t.getPersonalHomeNewUserChecklistSettings().progress_data.get_apps;if(null!=i&&i.isCompleted)return;const l={...i};"mobile"===o&&(l.isMobileAppCheckedOut=!0),"desktop"===o&&(l.isDesktopAppCheckedOut=!0);const d=!!l.isMobileAppCheckedOut&&!!l.isDesktopAppCheckedOut;if(a.f7({environment:n,checklistItem:"get_apps",partialUpdates:{...l,isCompleted:d}}),d){const e=c.Wn();r.f1(n,"get_apps",e),v(n,e)}}function g(e){S(e)}function f(e,t){const n=s.default.state.currentSpaceViewStore;n&&(r.b5(e,t),i.createAndCommit({userAction:"personalHomeNewUserChecklist.hideChecklist",environment:e,perform:e=>{i.applyOperation({store:n,operation:{pointer:n.pointer,path:["settings","personal_home","enabled_features"],command:"update",args:{checklist:!1}},transaction:e}),i.applyOperation({store:n,operation:{pointer:n.pointer,path:["settings","personal_home","checklist","has_auto_hide_checklist"],command:"set",args:!0},transaction:e})}}))}function h(e,t){const{currentUserSettingsStore:n}=s.default.state;n&&(r.yu(e,t),i.createAndCommit({userAction:"personalHomeNewUserChecklist.hideChecklist",environment:e,perform:e=>{i.applyOperation({store:n,operation:{pointer:n.pointer,path:["settings","personal_home_new_user_checklist_settings","showed_home_topbar_tooltip"],command:"set",args:!0},transaction:e})}}))}function v(e,t){c.Mc(t)&&(!function(e){var t;let{environment:n,checklistType:o,timestamp:r}=e;const{currentUserSettingsStore:l}=s.default.state;if(!l)return;const c=l.getPersonalHomeNewUserChecklistSettings();if(null!==(t=c.finished_timestamp_data)&&void 0!==t&&t[o])return;const d={...c,finished_timestamp_data:{...c.finished_timestamp_data,[o]:r}};i.createAndCommit({userAction:"setPersonalHomeNewUserChecklistFinishedTimestamp",environment:n,userId:l.id,perform:e=>{a.d2({userSettingsStore:l,data:{personal_home_new_user_checklist_settings:d},transaction:e})}})}({environment:e,checklistType:t,timestamp:Date.now()}),r.m0(e,t))}function y(e,t){if(!t)return null;const{explore_team_template:n,explore_private_template:o,explore_personal_template:r,explore_getting_started_template:i}=t;return n&&n===e?"explore_team_template":o&&o===e?"explore_private_template":r&&r===e?"explore_personal_template":i&&i===e?"explore_getting_started_template":null}function b(e){const{blockId:t,environment:n}=e,r=c.PT();if(r)for(const i of o.ie){if(t===(null==r?void 0:r[i])){u({environment:n,checklistItem:i});break}}}function _(e){const{blockId:t,environment:n}=e,r=c.PT();if(r)for(const i of o.ie){if(t===(null==r?void 0:r[i])){S({checklistItem:i,blockId:void 0,environment:n});break}}}function S(e){let{checklistItem:t,blockId:n,environment:o,transaction:r}=e;const{currentSpaceViewStore:a}=s.default.state;if(!a)return;i.createAndCommitOrAppend({userAction:"updatePersonalHomeNewUserChecklistExistingTemplatesBlocks",environment:o,transaction:r,perform:e=>(e=>i.applyOperation({store:a,operation:{pointer:a.pointer,path:["settings","personal_home","checklist","template_id_by_checklist_item"],command:"update",args:{[t]:n}},transaction:e}))(e)})}function k(e,t){d.Z.setState({isOpen:!0,mobileOsType:e,rect:t})}function w(){d.Z.setState({isOpen:!1})}},981829:(e,t,n)=>{n.d(t,{MC:()=>M,Mc:()=>g,Mj:()=>C,PT:()=>P,Qu:()=>k,Wn:()=>v,ZR:()=>S,fU:()=>w,g5:()=>I,gF:()=>T,gM:()=>h,mZ:()=>y});var o=n(760310),r=n(89101),i=n(421202),a=n(421838),s=n(218265),l=n(619584),c=n(215010),d=n(80444),u=n(385555),p=n(206258);const m={multipleplayer_creator:["workspace_tour","explore_team_template","create_page","collaborate","chat_ai","get_apps"],multipleplayer_joiner:["workspace_tour","explore_private_template","create_page","explore_community_templates","chat_ai","get_apps"],single_player:["explore_getting_started_template","explore_personal_template","create_page","explore_community_templates","chat_ai","get_apps"]};function g(e){var t;const n=m[e],o=null===(t=d.default.state.currentUserSettingsStore)||void 0===t?void 0:t.getPersonalHomeNewUserChecklistSettings().progress_data;if(!o)return!1;for(const i of n){var r;if(!(null!==(r=o[i])&&void 0!==r&&r.isCompleted||f(i)))return!1}return!0}function f(e){return!!(0,o.gs)(e)&&!M(e)}function h(e,t,n){const o=T(e);return{workspace_tour:{type:"workspace_tour",title:t.formatMessage({id:"home.landingTipsChecklist.tourYourWorkspace",defaultMessage:"Tour your workspace"})},explore_private_template:{type:"explore_private_template",title:t.formatMessage({id:"home.landingTipsChecklist.explorePrivateTemplate",defaultMessage:"Explore your 1:1 notes template"})},explore_team_template:{type:"explore_team_template",title:t.formatMessage({id:"home.landingTipsChecklist.exploreTeamTemplate",defaultMessage:"Explore your docs template"})},explore_personal_template:{type:"explore_personal_template",title:o?t.formatMessage({id:"home.landingTipsChecklist.explorePersonalTemplate",defaultMessage:"Explore your “{template_title}” template"},{template_title:T(e)}):t.formatMessage({id:"home.landingTipsChecklist.explorePersonalTemplate.more",defaultMessage:"Explore more templates"})},explore_getting_started_template:{type:"explore_getting_started_template",title:t.formatMessage({id:"home.landingTipsChecklist.exploreGettingStartedTemplate",defaultMessage:'Read "Getting started"'})},create_page:{type:"create_page",title:t.formatMessage({id:"home.landingTipsChecklist.createFirstPage",defaultMessage:"Create your first page"})},collaborate:{type:"collaborate",title:t.formatMessage({id:"home.landingTipsChecklist.collaborate",defaultMessage:"Invite a collaborator"})},explore_community_templates:{type:"explore_community_templates",title:t.formatMessage({id:"home.landingTipsChecklist.exploreTemplates",defaultMessage:"Explore community templates"})},chat_ai:{type:"chat_ai",title:t.formatMessage({id:"home.landingTipsChecklist.chatWithNotionAI",defaultMessage:"Try Q&A"})},get_apps:{type:"get_apps",title:t.formatMessage({id:"home.landingTipsChecklist.getTheApps",defaultMessage:"Get the apps"}),progress:b(null==n?void 0:n.get_apps)}}}function v(){var e;const t=d.default.state.currentSpaceStore,n=null===(e=d.default.state.currentUserStore)||void 0===e?void 0:e.userId;if(!t)return"single_player";const o=t.getPlanType()??"personal",r=!!n&&t.getCreatedById()===n;return"personal"===o?"single_player":r?"multipleplayer_creator":"multipleplayer_joiner"}function y(e,t,n){return m[t].filter((e=>!(0,o.gs)(e)||!(null==n||!n[e]))).map((t=>e[t]))}function b(e){return null!=e&&e.isCompleted?"2/2":null!=e&&e.isMobileAppCheckedOut||null!=e&&e.isDesktopAppCheckedOut?"1/2":"0/2"}const _={utm_source:"notion_app",utm_campaign:"home_checklist",utm_medium:"landing_home_tips_checklist"};function S(){const e=`https://notion.so${r._j.mobile}`,t=s.SK(e,_);window.open(t,"_blank")}function k(e){if(e.device.isDesktopBrowser)if(e.device.isMac){const e=`https://notion.so${r._j.downloadMacUniversal}`;window.open(s.SK(e,_),"_blank")}else if(e.device.isWindows){const e=`https://notion.so${r._j.downloadWindows}`;window.open(s.SK(e,_),"_blank")}}function w(e){if(e.isMobile)return!1;if(!function(){const{currentUserSettingsStore:e}=d.default.state;if(e&&e.isReady()){var t;const n=u.default.getConfigKey("home_new_user_checklist_config","launchDateMs"),o=null===(t=e.getSettings())||void 0===t?void 0:t.signup_time;if(o&&o>n)return!0}return!1}())return!1;return!x(u.default.getConfigKey("home_new_user_checklist_config","daysSinceSignupToHide"))&&function(){const e=u.default.getEligibleGroup({experimentId:"landing_home_page_tips_checklist",defaultGroup:"control"});return"land_on_home_with_checklist"===e||"land_on_getting_started_with_checklist"===e}()}function x(e){const{currentUserSettingsStore:t}=d.default.state;if(!t)return!0;const n=(0,c.e2)(t);return!("number"==typeof n&&n<e)}function I(){var e,t;const{currentUserSettingsStore:n,currentSpaceViewStore:o}=d.default.state,r=v(),i=null==o||null===(e=o.getPersonalHomeSettings())||void 0===e||null===(e=e.checklist)||void 0===e?void 0:e.has_auto_hide_checklist,a=null==n||null===(t=n.getPersonalHomeNewUserChecklistSettings())||void 0===t||null===(t=t.finished_timestamp_data)||void 0===t?void 0:t[r];return!(i||!a)&&Date.now()-a>1*l.A0}function C(){var e;return!(null!==(e=d.default.state.currentUserSettingsStore)&&void 0!==e&&null!==(e=e.getPersonalHomeNewUserChecklistSettings())&&void 0!==e&&e.showed_home_topbar_tooltip)}function T(e){const t=M("explore_personal_template");if(!t)return;const n=new p.G(e,{table:i.iU,id:t});return a.QaF(n.getTitleValue())}function M(e){var t;return null===(t=d.default.state.currentSpaceViewStore)||void 0===t||null===(t=t.getPersonalHomeSettings())||void 0===t||null===(t=t.checklist)||void 0===t||null===(t=t.template_id_by_checklist_item)||void 0===t?void 0:t[e]}function P(){var e;return null===(e=d.default.state.currentSpaceViewStore)||void 0===e||null===(e=e.getPersonalHomeSettings())||void 0===e||null===(e=e.checklist)||void 0===e?void 0:e.template_id_by_checklist_item}},514654:(e,t,n)=>{n.d(t,{ib:()=>s,t3:()=>l});var o=n(815145),r=n(401898),i=n(80444),a=n(394841);function s(e){let{blockOrCollectionId:t}=e;const n=l({blockOrCollectionId:t});switch(n){case"home":return o.tY.PersonalHomePage;case"home_tile_recents":return o.tY.PersonalHomeTileRecents;case"home_tile_trending":return o.tY.PersonalHomeTileTrending;case"home_tile_tips":return o.tY.PersonalHomeTileTips;case"home_tile_tasks":return o.tY.PersonalHomeTileTasks;case"home_tasks":return o.tY.PersonalHomePageTasks;case"home_tile_custom_db":return o.tY.PersonalHomeTileCustomDb;case"home_custom_db":return o.tY.PersonalHomePageCustomDb;case"home_tile_similar_users":return o.tY.PersonalHomeTileSimilarUsers;case"home_tile_most_visited":return o.tY.PersonalHomeTileMostVisited;case"home_tile_last_edited":return o.tY.PersonalHomeTileLastEdited;case"home_tile_favorites":return o.tY.PersonalHomeTileFavorites;case"home_unknown":return o.tY.PersonalHomeUnknown;case"home_tile_notes":return o.tY.PersonalHomeNotes;case void 0:return;default:(0,r.t1)(n)}}function l(e){let{blockOrCollectionId:t}=e;const n=(0,a.G)({blockOrCollectionId:t}),{mainEditorCurrentBlockStore:o}=i.default.state;if(n)switch(n){case"main":return"home";case"myTasksAssignedToMeCollectionView":case"myTasks":return(0,a.WE)(o)?"home_tile_tasks":"home_tasks";case"customDbCollectionView":case"customDb":return(0,a.WE)(o)?"home_tile_custom_db":"home_custom_db";case"trendingCollectionView":return"home_tile_trending";case"similarUsersCollectionView":return"home_tile_similar_users";case"mostVisitedCollectionView":return"home_tile_most_visited";case"lastEditedCollectionView":return"home_tile_last_edited";case"favoritesCollectionView":return"home_tile_favorites";case"trending":case"trendingCollection":case"similarUsers":case"similarUsersCollection":case"mostVisited":case"mostVisitedCollection":case"lastEdited":case"lastEditedCollection":case"favorites":case"favoritesCollection":return"home_unknown";default:(0,r.t1)(n)}}},394841:(e,t,n)=>{n.d(t,{Al:()=>y,Ep:()=>b,G:()=>f,J2:()=>_,Kj:()=>h,WE:()=>v,_B:()=>S,su:()=>k});var o=n(760310),r=n(570096),i=n(421202),a=n(606287),s=n(213493),l=n(653965),c=n(401898),d=n(918514),u=n(80444),p=n(206258);const m=(0,l.HP)(((e,t)=>o.hH({userId:e,spaceId:t})),(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return JSON.stringify(t)})),g=(0,l.HP)(((e,t,n)=>{if(!e||!t||!n)return;const[o]=(0,c.qP)(m(t,n)).find((t=>{let[n,o]=t;return o===e}))??[];return o}),(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return JSON.stringify(t)}));function f(e){var t,n;let{blockOrCollectionId:o}=e;const r=null===(t=u.default.state.currentUserStore)||void 0===t?void 0:t.id,i=null===(n=u.default.state.currentSpaceStore)||void 0===n?void 0:n.id;if(r&&i&&o)return g(o,r,i)}function h(e){return(0,c.$K)(f({blockOrCollectionId:e}))}function v(e){return!!e&&"main"===f({blockOrCollectionId:e.id})}function y(e){const t=null==e?void 0:e.getParentId(),n=null==e?void 0:e.getSpaceId();if(!t||!n||!e)return;const o=m(t,n).main,r=e.getSpaceStore();return o&&r?p.G.createChildStore(r,{table:i.iU,id:o,spaceId:r.id}):void 0}function b(e){var t,n;const o=null===(t=u.default.state.currentUserStore)||void 0===t?void 0:t.id,r=null===(n=u.default.state.currentSpaceStore)||void 0===n?void 0:n.id;if(o&&r)return m(o,r)[e]}function _(e){const t=u.default.state.currentSpaceStore;if(!t)return;const n=t.id;switch(e){case"main":case"myTasks":case"customDb":case"trending":case"similarUsers":case"mostVisited":case"lastEdited":case"favorites":const o=b(e);return o?p.G.createChildStore(t,{table:i.iU,id:o,spaceId:n}):void 0;case"myTasksAssignedToMeCollectionView":case"customDbCollectionView":case"similarUsersCollectionView":case"trendingCollectionView":case"mostVisitedCollectionView":case"lastEditedCollectionView":case"favoritesCollectionView":const r=b(e);return r?p.Xr.createChildStore(t,{table:s.np,id:r,spaceId:n}):void 0;case"trendingCollection":case"similarUsersCollection":case"mostVisitedCollection":case"lastEditedCollection":case"favoritesCollection":const l=b(e);return l?p.NW.createChildStore(t,{table:a.vF,id:l,spaceId:n}):void 0;default:(0,c.t1)(e)}}function S(){return{hide_linked_collection_name:!0,collection_peek_mode:r.l,inline_collection_first_load_limit:{type:"load_limit",limit:20}}}const k=(0,d.UY)("guides.taskDatabases")},861931:(e,t,n)=>{n.d(t,{$1:()=>k,$K:()=>_,A0:()=>f,A5:()=>g,Cm:()=>u,EP:()=>l,Er:()=>w,KI:()=>I,Ng:()=>m,QF:()=>p,Uf:()=>d,XX:()=>i,_U:()=>T,bS:()=>b,cc:()=>C,d_:()=>c,iO:()=>s,jO:()=>S,jX:()=>v,jq:()=>a,pW:()=>h});var o=n(653965),r=n(401898);const i=160,a=40,s=24,l=20,c=600,d=270,u=405,p=480,m=500,g=16,f=10,h=8,v=44,y={backdropFilter:"blur(48px)",WebkitBackdropFilter:"blur(48px)"},b=4;function _(e){return{icon:e.mediumIconColor,text:e.mediumTextColor}}function S(e){return{width:48,height:48,fill:e.lightIconColor}}function k(e){let{theme:t,isPhone:n}=e;return n?t.personalHomeBackgroundPhone:t.personalHomeBackgroundDesktop}function w(e){let{theme:t,isPhone:n,buttonState:o}=e,r=t.whiteButtonBackground;switch(o){case"hovered":r=t.whiteButtonHoveredBackground;break;case"pressed":r=t.whiteButtonPressedBackground}return n&&(r=void 0),{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",background:r,...y,boxShadow:T({isPhone:n,theme:t,borderOnly:!0}),width:28,height:28,borderRadius:4}}const x=1;function I(e){let{isPhone:t,theme:n}=e;return{zIndex:1,position:"relative",display:"flex",flexDirection:"column",borderRadius:12,background:n.home.tile.background,boxShadow:T({isPhone:t,theme:n}),...y}}function C(e){let{mode:t,isPhone:n}=e;switch(t){case"dark":return 0;case"light":return x;default:return(0,r.P)(t),0}}function T(e){let{isPhone:t,theme:n,borderOnly:r}=e;if("dark"===n.mode)return"unset";n.mode;const i=C({mode:n.mode,isPhone:t});return(0,o.oA)([r||t?void 0:"0 12px 32px rgba(0, 0, 0, 0.02)",`0 0 0 ${i}px rgba(0, 0, 0, 0.05)`]).join(", ")}},570747:(e,t,n)=>{n.d(t,{M:()=>r,Z:()=>a});var o=n(749085);const r=["iPhone","Android"];class i extends o.default{getInitialState(){return{isOpen:!1}}}const a=new i},811265:(e,t,n)=>{n.d(t,{U:()=>r});var o=n(385555);function r(e){const t=(null==e?void 0:e.disableExposureLogging)??!1;return"on"===o.default.getEligibleGroup({experimentId:"posts_prototype",defaultGroup:"control",disableExposureLogging:t})}},442092:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(535431),r=n(401898),i=n(162619);class a extends o.Z{containedByAssistantEditCard(e){return Boolean(this.find((t=>{const n=t.getNode();return n instanceof HTMLElement&&(0,i.r3)(n,e)})))}getEditById(e){for(const t of this.members)for(const n of t.getGroups())if("updatedPage"===n.type){if(!n.didCreatePage)for(const t of n.groupedEdits)if(t.editId===e)return t}else"removedPage"===n.type||(0,r.t1)(n)}}const s=new a},358299:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(76796);class r extends o.B{findBlockPropertyValue(e,t,n){return this.find((o=>{const r=o.getProps();return r.store===e&&r.property===t&&(!n||r.format===n)}))}findBlockPropertyValueByBlockId(e,t,n){return this.find((o=>{const r=o.getProps();return r.store.id===e&&r.property===t&&(!n||r.format===n)}))}getRect(e,t){const n=this.findBlockPropertyValue(e,t);if(n){const e=n.getNode();if(e&&e instanceof Element)return e.getBoundingClientRect()}}}const i=new r},58202:(e,t,n)=>{n.d(t,{R:()=>s});var o=n(535431),r=n(292595),i=n(153223);class a extends o.Z{findBlockFromStore(e){return this.find((t=>t.getBlockStore()===e))}findAllBlocksFromStore(e){return this.filter((t=>t.getBlockStore()===e))}findBlockFromStoreWithMethod(e,t){return this.find((n=>n.getBlockStore()===e&&"function"==typeof n[t]))}findBlockFromId(e){return this.find((t=>{const n=t.getBlockStore();return n&&n.id===e}))}findNodeFromStore(e){const t=this.findBlockFromStore(e);if(t)return t.getNode()}getRect(e){const t=this.findNodeFromStore(e);if(t&&t instanceof Element)return t.getBoundingClientRect()}findCollectionViewBlockFromStore(e){return this.find((t=>t.getBlockStore()===e&&(0,i.wA)(t)))}findCollectionViewBlockFromId(e){return this.find((t=>{var n;return Boolean((null===(n=t.getBlockStore())||void 0===n?void 0:n.id)===e&&(0,i.wA)(t))}))}}const s=new a;(0,r.exposeDebugValue)("GlobalBlockRegistry",s)},989574:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(535431);class r extends o.Z{}const i=new r},246351:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(535431);class r extends o.Z{}const i=new r},747372:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(535431);class r extends o.Z{}const i=new r},827406:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(535431),r=n(292595);class i extends o.Z{constructor(){super(...arguments),this.isDropTargetForKey=(e,t)=>e.props.dropTargetKey===t}findDropTargetFromKey(e){return this.find((t=>this.isDropTargetForKey(t,e)))}findDropTargetsFromKey(e){return this.filter((t=>this.isDropTargetForKey(t,e)))}}const a=new i;(0,r.exposeDebugValue)("GlobalDropTargetRegistry",a);const s=a},828685:(e,t,n)=>{n.d(t,{E:()=>i});var o=n(535431);class r extends o.Z{findEditableWithinSelectable(e){return this.find((t=>t.getContextClosestSelectable()===e))}findEditableWithStore(e){return this.find((t=>t.props.store===e))}findNodeFromStore(e){const t=this.findEditableWithStore(e);if(t)return t.getNode()}findStoreFromNode(e){const t=this.find((t=>t.getNode()===e));if(t)return t.props.store}}const i=new r},303994:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(76796);class r extends o.B{shouldPreventMobileAutoScroll(e){const t=this.find((t=>t.capture&&!(t.allowMobileAutoScroll&&e.device.isMobile)));return Boolean(t)}}const i=new r},875987:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(76796);class r extends o.B{isInlineAutocompleteOpen(){const e=this.find((e=>e.isOpen));return Boolean(e)}}const i=new r},700933:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(535431);class r extends o.Z{}const i=new r},681844:(e,t,n)=>{n.d(t,{Z:()=>i});n(757658);var o=n(535431);class r extends o.Z{findOutlinerItemFromStore(e){if(e)return this.find((t=>t.store===e))}findOutlinerItemsFromId(e){const t=[];return this.forEach((n=>{n.store.id===e&&t.push(n)})),t}}const i=new r},849427:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(535431),r=n(385644),i=n(282136);class a extends o.Z{isBlockInFrame(e){const t=e.getRecordStoreUIRoot();return Boolean(this.find((e=>e.props.context===i.S.Frame&&e.props.store===t)))}isBlockInTemplate(e){const t=e.getRecordStoreUIRoot();return Boolean(this.find((e=>e.props.context===i.S.InAppTemplatePreview&&e.props.store===t)))}isBlockInPageSnapshot(e){const t=e.getRecordStoreUIRoot();return Boolean(this.find((e=>e.props.context===i.S.InPageSnapShot&&e.props.store===t)))}isBlockInWiki(e){const t=e.getRecordStoreUIRoot();return Boolean(this.find((e=>(0,r.A)(e.props.store)&&e.props.store===t)))}openNewPageDiscussionInput(e){const t=this.find((t=>t.props.store.id===e.id));if(!t)return;const{pageViewBlockStore:n}=t;n.setState({...n.state,forceDiscussionOpen:!0})}}const s=new a},164815:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(535431);class r extends o.Z{}const i=new r},316339:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(535431);class r extends o.Z{}const i=new r},95802:(e,t,n)=>{n.d(t,{C:()=>c});var o=n(535431),r=n(292595),i=n(653965),a=n(828685),s=n(27724);class l extends o.Z{getMembersByDOMOrder(e){let{filter:t}=e;return super.getMembersByDOMOrder({filter:e=>!e.props.isHoverMenu&&t(e)})}findSelectableFromStore(e){return this.find((t=>t.props.store===e))}findScrollToSelectableFromStore(e){return this.find((t=>t.props.store===e&&t.props.canSelect&&!t.props.disableScrollToReveal&&t.getContextSelectableContainer()===s.default.getCurrentDefaultContainer()))}findScrollToSelectablesFromIds(e){return this.filter((t=>e.includes(t.props.store.id)&&t.props.canSelect&&!t.props.disableScrollToReveal&&t.getContextSelectableContainer()===s.default.getCurrentDefaultContainer()))}findSelectablesFromStore(e){return this.filter((t=>t.props.store===e))}findNodeFromStore(e){const t=this.findSelectableFromStore(e);if(t)return t.getNode()}getRectFromStore(e){const t=this.findNodeFromStore(e);if(t&&t instanceof Element)return t.getBoundingClientRect()}findEditableStoreWithin(e){const t=this.findSelectableFromStore(e);if(t){const e=a.E.findEditableWithinSelectable(t);if(e)return e.props.store}}findSelectablesFromIds(e){const t=s.default.getCurrentDefaultContainer(),n=this.getMembersByDOMOrder({filter:()=>!0});return i.oA(e.map((e=>n.find((n=>{const o=n.props.store,r=n.getContextSelectableContainer();return Boolean(o&&o.id===e&&r===t)})))))}findAllSelectablesFromIds(e){const t=s.default.getCurrentDefaultContainer(),n=this.getMembersByDOMOrder({filter:()=>!0});return i.xH(e.map((e=>n.filter((n=>{const o=n.props.store,r=n.getContextSelectableContainer();return Boolean(o&&o.id===e&&r===t)})))))}findNodeFromBlockId(e){var t;const n=this.findSelectablesFromIds([e]);return null==n||null===(t=n[0])||void 0===t?void 0:t.getNode()}findSelectableFromChildNode(e){const t=this.getMembersByDOMOrder({filter:t=>{var n;return null===(n=t.getNode())||void 0===n?void 0:n.contains(e)}});return t[t.length-1]}findClosestVisibleParent(e){let t=e.getParentBlockStore();for(;t;){const e=t.getParentBlockStore();if(!e)return{};const n=this.findNodeFromBlockId(t.id);if(n)return{node:n,blockStore:t};t=e}return{}}}const c=new l;(0,r.exposeDebugValue)("GlobalSelectableRegistry",c)},675822:(e,t,n)=>{n.d(t,{E5:()=>r,rE:()=>i,vp:()=>o});const o=300,r=75,i=225},232556:(e,t,n)=>{n.d(t,{x:()=>o});const o={searchActions:new(n(277907).Ss)("searchActions",(async()=>Promise.all([n.e(62743),n.e(52774),n.e(5242),n.e(31189),n.e(40017),n.e(17100),n.e(90424),n.e(16732),n.e(11002),n.e(16536),n.e(62451),n.e(23029),n.e(4617),n.e(63327),n.e(99417),n.e(84654),n.e(58075),n.e(88833),n.e(67120),n.e(12486),n.e(60317),n.e(83264),n.e(15362),n.e(30874),n.e(17444),n.e(68452),n.e(67899),n.e(66464)]).then(n.bind(n,278159))))}},343759:(e,t,n)=>{n.d(t,{Qu:()=>a,RA:()=>m,U3:()=>p,pv:()=>u});var o=n(158573),r=n(653965),i=n(296994);const a=3,s=5,l=new Set(["a","an","and","are","as","at","be","but","by","for","if","in","is","it","of","on","or","that","the","to","was","will","with"]);function c(e,t,n){return e.length>=a}function d(e,t,n){return e.length>=s&&.2}function u(e){return e.split(/[^\w]+/g).filter((e=>!l.has(e)))}async function p(){const{default:e}=await i.FF.minisearch.load(),t=new e({fields:["text","id","inits"],storeFields:["block"],searchOptions:{prefix:c,fuzzy:d},tokenize:(e,t)=>e.split(/\s/g),processTerm:(e,t)=>{const n=e.toLowerCase();if(!l.has(e))switch(t){case"text":{const e=u(n).filter((e=>e.length>a));return(0,r.jj)([n,...e])}case"inits":return[...Array(e.length).keys()].slice(0,e.length-a+1).map(((e,t)=>n.slice(t)));default:return n}}});return{index:t,getAllBlocks:()=>t.search(e.wildcard)}}function m(e,t){const n=e.toLowerCase(),r=t.toLowerCase();if(n===r)return o.DF;const i=r.indexOf(n);return 0===i?o.uI:" "===r[i-1]?o.V5:i>-1?o.T6:1}},596820:(e,t,n)=>{n.d(t,{S:()=>R});n(757658);var o=n(541432),r=n(180951),i=n(959753),a=n(421202),s=n(606287),l=n(421838);function c(e){const{getRecordValue:t,blockValue:n}=e;let c="";const d={user:new Map},u=i.kk5.fromBlock(n),p=i.omK.fromGetRecordValueFn(t);if(u.isCollectionView()){const e=function(e){const{getRecordModel:t,model:n}=e,o=n.getRenderFormatPointer(t);if(!o)return;const i=t(o);if(!i)return;if(i.table===a.iU)return(0,r.wS)(i,"title")||[];if(i.table===s.vF)return i.getNormalizedName()}({model:u,getRecordModel:p});e&&e.length>0&&(c=l.Qh7(e,p,d).text)}else if(u.isType("file")){c=`${l.Qh7(u.getProperty("title"),p,d).text} ${l.Qh7(u.getProperty("caption"),p,d).text}`}else if(u.isType("bookmark")){c=`${l.Qh7(u.getProperty("title"),p,d).text} ${l.Qh7(u.getProperty("description"),p,d).text} ${l.Qh7(u.getProperty("caption"),p,d).text}`}else if(u.isType(o.Ok)){const e=u.getProperty("caption");c=l.Qh7(e,p,d).text}else if(u.isType(o.Ti.tableRow)){const e=function(e){const{blockModel:t,getRecordModel:n}=e,o=n({table:a.iU,id:t.getParentId(),spaceId:t.getSpaceId()});return null==o?void 0:o.getFormatValue("table_block_column_order")}({blockModel:u,getRecordModel:p});if(e){c=e.map((e=>l.Qh7(u.getProperty(e),p,d).text)).join(" ")}}else{const e=(0,r.wS)(n,"title");c=l.Qh7(e,p,d).text}return{text:c.trim()||void 0,mentions:d}}var d=n(758203),u=n(463306),p=n(673360),m=n(74446),g=n(145953),f=n(33361),h=n(653965),v=n(721429),y=n(145950),b=n(798165),_=n(548779),S=n(195697),k=n(971384),w=n(385555),x=n(646735),I=n(269327),C=n(206258),T=n(342198),M=n(343759);const P=432e5,A=1e3;async function R(e){var t,n;const{environment:r,currentSpaceStore:s,currentSpaceViewStore:l,excludeCurrentPage:R}=e,{id:D}=s,B=new Map,E=new Set;function F(e,t){var n;B.has(e)?null===(n=B.get(e))||void 0===n||n.add(t):B.set(e,new Set([t]))}const Z=(new Date).getTime();if(l)for(const o of l.getBookmarkedPageIds())F(o,"bookmarkedPage");const U=(0,_.ns)(r,s);for(const o of U)F(o,"spacePage");const V=(0,S.xo)();for(const o of V)F(o,"teamPage");const N=r.currentUser.id;if(l){for(const{id:t}of(0,_.KA)(r,l))F(t,"sharedPage");const e=Z-P;r.defaultRecordCache.inMemoryRecordCache.forEachRecord(N,(t=>{let{model:n}=t;if(n.table===a.iU&&D===s.id){const{id:t,last_edited_time:r,last_edited_by_id:i,type:a}=n;(0,o.S9)(a)&&i===N&&r&&r>e&&(F(t,"defaultRecordCache"),E.add(t))}}))}const O=x.Z.getVisitedIds(N);for(const o of O)F(o,"frecencyStore"),E.add(o);const L=T.default.getUserSignals({spaceId:D,userId:N});var j,K;(null==L||null===(t=L.similarUserRecentPages)||void 0===t||t.forEach((e=>{let{pageId:t}=e;F(t,"similarUser1dRecentPages"),E.add(t)})),null==L||null===(n=L.topPages7dPageView)||void 0===n||n.forEach((e=>{let{pageId:t}=e;F(t,"topPages7dPageView"),E.add(t)})),"on"===w.default.getGroup("search-include-all-local-sources"))&&(null==L||null===(j=L.editedPages)||void 0===j||j.forEach((e=>{let{pageId:t}=e;F(t,"editedPages1d"),E.add(t)})),null==L||null===(K=L.similarUsersEditedPages)||void 0===K||K.forEach((e=>{let{pageId:t}=e;F(t,"similarUsersEditedPages1d"),E.add(t)})));const z=I.Z.get(D),q=null==L?void 0:L.recentPages,H=q&&"on"===w.default.getGroup("search-use-recent-pages-signal")?q:z;if(H&&H.forEach((e=>{let{pageId:t}=e;F(t,"recentVisit"),E.add(t)})),R){const e=(0,v.np)();e&&B.delete(e.id)}const G=g.PF.create();await(0,f.uf)({recordPointers:Array.from(B.keys()).map((e=>({table:a.iU,id:e}))),recordMap:G,loadRecordModel:e=>(0,y.Ye)({environment:r,pointer:e}),recurFn:e=>h.oA([(0,p.tz)(e)&&e.getParentPointer(),e.table===a.iU&&e.getCollectionPointer()])});const W=m.mF.fromRecordMapWithRole(G),$=i.omK.fromGetRecordValueFn(W),Y=new Array;for(const[o,i]of B.entries()){const e={table:a.iU,id:o};let t,n;if(E.has(o)?(t=C.t1.createChildStore(s,e),n=t.getModel()):n=$(e),!n)continue;const r=(0,u.Wq)(e,G);if(0===r.length)continue;if(n.getSpaceId()!==s.id)continue;const l=(0,d.$B)(c({blockValue:n,getRecordValue:W}).text);if(!l)continue;if(!i)continue;const p=(0,b.KU)(r);if(p&&Boolean(p.value.archived_by))continue;const m=l.substring(0,A).trim();Y.push({blockModel:n,text:m,path:r,source:i,blockStore:t})}const{index:Q,getAllBlocks:J}=await(0,M.U3)(),X=Y.map((e=>{return{id:e.blockModel.id,text:e.text,inits:(t=e.text,t.split(" ").map((e=>Array.from(e).slice(0,1))).join("")),block:e};var t})),ee={spaceId:s.id,userId:N,blocks:Y,environment:r},te=Q.addAllAsync(X),ne=k.Z.updatePageSignals(ee);return await Promise.all([te,ne]),{spaceId:s.id,blocks:Q,getAllBlocks:J,recordMap:G}}},823376:(e,t,n)=>{n.d(t,{TN:()=>b,DD:()=>y,bP:()=>S,AP:()=>_,rQ:()=>k});var o=n(471924),r=n(401898),i=n(519719),a=n(587420),s=n(304708),l=n(74948),c=n(224646),d=n(938676),u=n(188923),p=n(828161),m=n(116746),g=n(966324),f=n(117224);function h(e){const{environment:t,contentType:n,autoLoaded:o}=e,s=d.sidebarExpandedStore.state;d.sidebarOpenStore.state&&!s&&l.close(),c.Sx(t)&&l.setUpdateExpand({environment:t,isExpanded:!1,from:"close_for_space",saveDetailsSidebarPreference:!1}),u.default.isSidePeekOpen()&&a.xv(t,"secondary_sidebar_expand"),function(e){const{environment:t,contentType:n,autoLoaded:o}=e;switch(n){case"inbox":i.l2({environment:t,auto_loaded:o});break;case"private_pages":g.PR(t,{outliner_type:"private",auto_loaded:o});break;case"shared_pages":g.PR(t,{outliner_type:"shared",auto_loaded:o});break;case"assistant":g.P0(t,{auto_loaded:o});break;case"teams":f.pi(t,{from:"sidebar_browse_team_item",auto_loaded:o});break;case"none":break;default:(0,r.t1)(n)}}({environment:t,contentType:n,autoLoaded:o})}function v(e){const{environment:t,contentType:n}=e;switch(n){case"inbox":i.Br({environment:t});break;case"private_pages":case"shared_pages":case"assistant":case"teams":case"none":break;default:(0,r.t1)(n)}}function y(e){const{environment:t,contentType:n,skipAnimation:r,autoLoaded:i}=e;m.default.isVisible()&&v({environment:t,contentType:m.default.state.contentType}),h({environment:t,contentType:n,autoLoaded:Boolean(i)});const{modeByContentType:a}=p.ZP.state,l=a[n],c="assistant"===n&&"panel"===l,d=(0,s.hN)(t)||c?l:"peek";m.default.setState({...m.default.state,contentType:n,openState:r?"open":"opening",mode:d,flowId:o.Il()}),p.ZP.setState({...p.ZP.state,openState:"open",contentType:n,mode:d})}function b(e){const{environment:t,skipAnimation:n,autoClose:o}=e;m.default.isVisible()&&(m.default.setState({...m.default.state,openState:n?"closed":"closing",autoClosed:Boolean(o)}),p.ZP.setState({...p.ZP.state,openState:"closed"}),v({environment:t,contentType:m.default.state.contentType}))}function _(e){const{environment:t,contentType:n}=e,o=m.default.isOpen(),r=m.default.state.contentType;o&&r===n?b({environment:t}):y({environment:t,contentType:n})}function S(){const{mode:e,contentType:t}=m.default.state;let n;switch(e){case"peek":n="panel";break;case"panel":n="peek";break;default:(0,r.t1)(e)}const{modeByContentType:o}=p.ZP.state;return m.default.setState({...m.default.state,mode:n,modeByContentType:{...o,[t]:n}}),p.ZP.setState({...p.ZP.state,mode:n,modeByContentType:{...o,[t]:n}}),n}function k(e){const{environment:t}=e;m.default.isOpen()&&"peek"===m.default.state.mode&&b({environment:t})}},48276:(e,t,n)=>{n.d(t,{EA:()=>c,VV:()=>s,dc:()=>l,l_:()=>a});var o=n(724405),r=n(828161),i=n(116746);function a(){return r.ZP.getWidth()}function s(){const e=i.default.state.openState,t=i.default.state.mode;return"closed"===e||"closing"===e||"peek"===t?0:a()}function l(){return(0,o.yK)((e=>({button:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,height:28,width:28},icon:{fill:e.mediumIconColor,width:16,height:16}})),[])}function c(){return i.default.isOpen()&&"assistant"===i.default.state.contentType}},828161:(e,t,n)=>{n.d(t,{ZP:()=>f,o$:()=>c,um:()=>l});var o=n(749085),r=n(554153),i=n(653965),a=n(966353),s=n(116746);const l=320,c=470,d="secondary_sidebar",u={openState:"closed",contentType:"none",mode:"peek",modeByContentType:{none:"peek",inbox:"peek",private_pages:"peek",shared_pages:"peek",assistant:"peek",teams:"peek"},widths:{none:320,inbox:390,private_pages:320,shared_pages:320,assistant:320,teams:320}};function p(e){r.Z.set(d,e)}class m extends o.default{getInitialState(){return function(){const e=r.Z.get(d),t=void 0===i.U2(e,["widths","inbox"]),n=i.TS(i.Xh(u),e);if(t){const e=r.Z.get(a.Jr),t=i.U2(e,["width"]);if(void 0!==t){n.widths.inbox=t;try{p(n)}catch{}}}return n}()}getWidth(){const e=s.default.state.contentType,t=this.state.widths[e];return t<=l?l:t>=c?c:t}setWidth(e){const t=s.default.state.contentType;this.setState({...this.state,widths:{...this.state.widths,[t]:e}})}}const g=new m;g.addListener((e=>{try{p(e.state)}catch{}}));const f=g},116746:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var o=n(749085),r=n(471924),i=n(401898);class a extends o.default{getInitialState(){return{mode:"peek",modeByContentType:{none:"peek",inbox:"peek",private_pages:"peek",shared_pages:"peek",assistant:"peek",teams:"peek"},openState:"closed",contentType:"none",isResizerHovered:!1,isResizing:!1,isMouseEntered:!1,flowId:r.Il(),autoClosed:!1}}isOpen(){const{openState:e}=this.state;switch(e){case"open":case"opening":return!0;case"closed":case"closing":return!1;default:(0,i.t1)(e)}}isVisible(){const{openState:e}=this.state;switch(e){case"open":case"opening":case"closing":return!0;case"closed":return!1;default:(0,i.t1)(e)}}isTransitioningState(){const{openState:e}=this.state;switch(e){case"opening":case"closing":return!0;case"open":case"closed":return!1;default:(0,i.t1)(e)}}isPeekDismissableState(){return"peek"===this.state.mode&&this.isVisible()}isPanelPinnedState(){return"panel"===this.state.mode&&this.isOpen()}isTogglingToPanelModeState(){return"open"===this.state.openState&&"panel"===this.state.mode}}const s=new a},440134:(e,t,n)=>{n.d(t,{B:()=>r});var o=n(600051);function r(e){var t;let{blockId:n,setting:r}=e;const{publicPageData:i}=o.Z.state;if((null==i?void 0:i.pageId)!==n)return;return null===(t=i.securitySettings)||void 0===t?void 0:t[r]}},457345:(e,t,n)=>{n.d(t,{a6:()=>m,lG:()=>p,zd:()=>g});n(667294),n(133728),n(568626),n(471924),n(772141);var o=n(709291),r=(n(552629),n(250906)),i=n(547307),a=(n(476464),n(164964),n(419306),n(626907),n(367669),n(318245),n(426016)),s=n(188923),l=n(799332),c=(n(429677),n(766708)),d=n(28578),u=n(785893);function p(e){d.ZP.reset(),s.default.state.open?l.Z.setState({...l.Z.state,open:!0}):c.Z.setState({...c.Z.state,open:!0}),r.DB(e,{share_menu_session_id:d.ZP.state.sessionId})}function m(e){s.default.state.open?l.Z.setState({...l.Z.state,open:!1}):c.Z.setState({...c.Z.state,open:!1}),a.Z.setState({...a.Z.state,siteSettingContentType:"initial"}),r.Rb(e,{share_menu_session_id:d.ZP.state.sessionId})}async function g(e){const{inviteTargetsStore:t}=e,n=(0,u.jsx)(o.FormattedMessage,{id:"shareMenu.closeInviteDialog.confirmationMessage",defaultMessage:"Your changes have not been saved. Discard changes?"}),r=(0,u.jsx)(o.FormattedMessage,{id:"shareMenu.closeInviteDialog.confirmationButton.label",defaultMessage:"Yes"}),a=(0,u.jsx)(o.FormattedMessage,{id:"shareMenu.closeInviteDialog.cancelButton.label",defaultMessage:"Cancel"});if(t.state.inviteTargets.length>0){return(await i.confirmUserActionV2({message:n,acceptLabel:r,cancelLabel:a})).accept}return!1}},723404:(e,t,n)=>{n.d(t,{E:()=>i,w:()=>r});var o=n(385555);function r(){return"on"===o.default.getEligibleGroup({experimentId:"share_menu_cleanup_experiment",defaultGroup:"control"})}function i(){return o.default.checkGate({gateName:"share_menu_cleanup_ga"})}},190335:(e,t,n)=>{n.d(t,{HB:()=>y,Np:()=>v,Xz:()=>w,bQ:()=>h,gi:()=>b,mk:()=>x,pR:()=>_,up:()=>f});var o=n(186517),r=n(772141),i=n(421202),a=n(475246),s=n(429369),l=n(653965),c=n(798165),d=n(367669),u=n(80444),p=n(385555),m=n(206258),g=n(723404);function f(e){const{store:t,showRestrictedPermissionBanner:n}=e,{canAccessParent:o}=y({store:t});return o&&(n||v({store:t}))}function h(e){const{store:t}=e;if(t.getParentTable()===a.bx)return;const n=(0,c.Om)(t);if(!n)return;const i=(0,o.Wo)((0,c.fJ)(n));for(const o of i)if((0,r.Ir)(o))return o}function v(e){const{store:t}=e;if(t.getParentTable()===a.bx)return!1;const n=(0,c.Om)(t),i=n?(0,o.Wo)((0,c.fJ)(n)):[],s=t.getPermissionItems(),l={};for(const r of i)l[(0,o.OC)(r)]=r;for(const a of s){const e=a.role,t=l[(0,o.OC)(a)];if(t){if((0,r.iC)(e)&&(0,r.iC)(t.role)&&(0,o.xO)(e,t.role))return!0;if(r.tx(t)&&!r.tx(a))return!0}else if((0,r.Ir)(a)||(0,r.ZQ)(a)||(0,r.RI)(a)||(0,r.RO)(a))return!0}return!1}function y(e){const{store:t}=e,n=(0,c.uJ)(t)[1];return{parentStore:n,canAccessParent:n&&n.canRead()}}function b(e){const{store:t}=e,n=(0,c.uJ)(t),o=n.find((e=>e instanceof m.G&&e.isRestricted())),r=n[n.length-1];return o||r&&r.getParentTable()===a.bx&&r.canRead()}function _(e){const{store:t}=e,n=(0,c.VP)(t),o=u.default.state.currentSpaceStore;return Boolean((null==o?void 0:o.getDisableGuests())||(null==n?void 0:n.getDisableGuests()))}function S(e){const{mostPermissivePermissions:t,store:n,ancestorTeamId:o,type:a}=e;if(!o)return;const s=t.find((e=>{let{permissionItem:t}=e;return t.type===a&&t.team_id===o}));if(s)return s;const l=t.find((e=>{let{permissionItem:t}=e;return r.Le(t)}));return"explicit_team_guest_permission"!==a||l?{permissionItem:{type:a,role:"none",team_id:o},from:(null==l?void 0:l.from)??{table:i.iU,blockId:n.id}}:void 0}function k(){return p.default.checkGate({gateName:"share_show_dls_permission"})&&p.default.checkGate({gateName:"trusted_domain_pages"})}function w(e){const{permissionItem:t,store:n}=e,o=t.from,r=o.table===i.iU?o.blockId:o.teamId;return!(o.table===n.table&&r===n.id)}function x(e){const{spaceStore:t,store:n,environment:o}=e,a=(0,d.YO)(n);let u=[];t&&(u=t.getPermissionGroups());const p=c.VP(n),m=function(e){let{mostPermissivePermissions:t,store:n}=e;const o=t.find((e=>{let{permissionItem:t}=e;return r.$D(t)}));return o||{permissionItem:{type:"public_permission",role:"none"},from:{table:i.iU,blockId:n.id}}}({mostPermissivePermissions:a,store:n}),f=function(e){let{mostPermissivePermissions:t,store:n}=e;const o=t.find((e=>{let{permissionItem:t}=e;return r.RO(t)}));return o||{permissionItem:{type:"trusted_domain_permission",role:"none"},from:{table:i.iU,blockId:n.id}}}({mostPermissivePermissions:a,store:n}),h=function(e){let{mostPermissivePermissions:t,mostPermissiveTrustedDomainItem:n,store:o,teamStore:a}=e;const l=t.find((e=>{let{permissionItem:t}=e;return r.Ir(t)}));if(l)return l;const c=t.find((e=>r.Le(e.permissionItem)));return k()&&"none"!==n.permissionItem.role?{permissionItem:{type:"space_permission",role:"reader",unlisted_timestamp:Date.now()},from:{...n.from}}:{permissionItem:{type:"space_permission",role:"none"},from:null!=c&&c.from||!a||"none"!==a.getSpacePermissionRole()?(null==c?void 0:c.from)??{table:i.iU,blockId:o.id}:{table:s.e0,teamId:a.id}}}({mostPermissivePermissions:a,mostPermissiveTrustedDomainItem:f,store:n,teamStore:p}),v=S({mostPermissivePermissions:a,store:n,ancestorTeamId:null==p?void 0:p.id,type:"explicit_team_guest_permission"}),y=S({mostPermissivePermissions:a,store:n,ancestorTeamId:null==p?void 0:p.id,type:"explicit_team_permission"}),_=S({mostPermissivePermissions:a,store:n,ancestorTeamId:null==p?void 0:p.id,type:"explicit_team_owner_permission"});let w=a.filter((e=>{let{permissionItem:t}=e;return r.hV(t)}));w=l.MR(w,(e=>{if(t){return t.getPermissionGroups().findIndex((t=>t.id===e.permissionItem.group_id))}return e.permissionItem.group_id}));let x=a.filter((e=>{let{permissionItem:t}=e;return(r.zU(t)||r.LW(t))&&t.team_id!==(null==p?void 0:p.id)}));const I=new Map;x.forEach(((e,t)=>{let{permissionItem:n}=e;I.has(n.team_id)||I.set(n.team_id,t)})),x=l.MR(x,[e=>{let{permissionItem:t}=e;return I.get(t.team_id)||0},e=>{let{permissionItem:t}=e;return"explicit_team_owner_permission"===t.type?0:1}]);const C=function(e){var t;let{store:n,currentUserId:o,mostPermissivePermissions:a}=e;const s=a.filter((e=>{let{permissionItem:t}=e;return r.jg(t)})),c=s.find((e=>{let{permissionItem:t}=e;return t.user_id===o}));if(!(0,g.w)()||c||!o)return s;const u=(0,d.Dt)({userId:o,store:n}),p=null===(t=a.find((e=>{let{permissionItem:t}=e;return l.Xy(t,u)})))||void 0===t?void 0:t.from,m={from:p??{table:i.iU,blockId:n.id},permissionItem:{type:"user_permission",role:u.role,user_id:o}};return[...s,m]}({store:n,currentUserId:o.currentUser.id,mostPermissivePermissions:a}),T=Boolean(null==p?void 0:p.isDefined()),M="none"!==h.permissionItem.role,P=k()&&(M||"none"!==f.permissionItem.role),A=M||(0,g.w)(),R="none"!==m.permissionItem.role,D=(0,g.w)()||A||T||R||C.length>1||C.length&&!r.zz(C[0].permissionItem.role)||w.length||r.YX(h.permissionItem.role)||!b({store:n});return{showRestrictedPermissionBanner:a.some((e=>r.Le(e.permissionItem)&&e.from.table===i.iU&&e.from.blockId===n.id)),showTeamPermission:T,showPublicPermission:R,showSpacePermission:A,showTrustedDomainPermission:P,mostPermissivePublicItem:m,mostPermissiveTrustedDomainItem:f,mostPermissiveAncestorTeamOwnerItem:_,mostPermissiveAncestorTeamMemberItem:y,mostPermissiveAncestorTeamGuestItem:v,mostPermissiveSpaceItem:h,pagePermissionUIModel:{showUserPermissions:D,mostPermissiveGroupPermissions:w,mostPermissiveTeamPermissions:x,mostPermissiveUserPermissions:C,spacePermissionGroups:u},permissionItemsCount:(D?C.length:0)+x.length+w.length+(A?1:0)+(T?1:0)}}},28578:(e,t,n)=>{n.d(t,{Sw:()=>c,T5:()=>l,XF:()=>i,Xd:()=>s,ZP:()=>u,wV:()=>a});var o=n(749085),r=n(471924);let i=function(e){return e.Share="share",e.Publish="publish",e}({}),a=function(e){return e.MainShareMenu="mainShareMenu",e.Invite="invite",e.Publish="publish",e}({}),s=function(e){return e.InviteBackButton="invite_back_navigation",e.ShareTopbarButton="share_topbar_button_click",e.ShareTab="share_tab_click",e}({}),l=function(e){return e.Notion="notion",e.Slack="slack",e}({}),c=function(e){return e.Search="search",e.Message="message",e}({});class d extends o.default{getInitialState(){return{sessionId:r.Il(),display:a.MainShareMenu,tab:i.Share,isInitialized:!1,source:s.ShareTopbarButton}}getIsInitialized(){return this.state.isInitialized}}const u=new d},74948:(e,t,n)=>{n.r(t),n.d(t,{AssistantChatHistoryWidthThreshold:()=>de,OnlyOneSidebarVisibleWidthThreshold:()=>le,SidePeekCloseLeftSidebarFrameWidthThreshold:()=>ce,bookmarkPage:()=>Se,cancelSidebarInitialRenderLog:()=>Ve,close:()=>pe,closeAssistantChatHistoryIfTooNarrow:()=>Oe,handleSidebarButtonClick:()=>ge,initialize:()=>Be,leaveBlocks:()=>_e,newPageMessages:()=>Te,open:()=>ue,openAssistantChatHistoryIfWideEnough:()=>Ne,pinSharedPage:()=>we,quickAddPage:()=>Ce,setExpand:()=>me,setPeekWidth:()=>be,setUpdateExpand:()=>fe,setUpdateSidebarCommentsMode:()=>Fe,setUpdateSidebarCommentsTypeMode:()=>Ze,setUpdateSidebarTab:()=>Ee,setUpdateWidth:()=>ye,setWidth:()=>ve,toggleBothSidebars:()=>Ue,toggleLeftSidebarByWindowSize:()=>he,unbookmarkPage:()=>ke,unpinSharedPage:()=>xe});var o=n(701302),r=n(815145),i=n(421202),a=n(23867),s=n(554153),l=n(709291),c=n(100952),d=n(966324),u=n(21359),p=n(554564),m=n(498834),g=n(594419),f=n(211302),h=n(889858),v=n(587420),y=n(709953),b=n(275754),_=n(608055),S=n(210228),k=n(801742),w=n(237181),x=n(27105),I=n(304708),C=n(175770),T=n(658239),M=n(918514),P=n(548779),A=n(529294),R=n(87863),D=n(318245),B=n(361673),E=n(827406),F=n(823376),Z=n(48276),U=n(828161),V=n(116746),N=n(905162),O=n(80444),L=n(708949),j=n(966949),K=n(385555),z=n(803418),q=n(100475),H=n(242330),G=n(869254),W=n(979689),$=n(188923),Y=n(224864),Q=n(206258),J=n(569784),X=n(682187),ee=n(562820),te=n(897630),ne=n(2679),oe=n(224646),re=n(938676),ie=n(997852),ae=n(136896),se=n(436391);const le=1024,ce=430,de=600;function ue(e){let{fromElectron:t}=e;re.sidebarOpenStore.state||J.default.state.isActive||j.Z.isOpen()||V.default.isOpen()||(re.sidebarOpenStore.setState(!0),t&&re.sidebarElectronMousePeekStore.setState(!0))}function pe(){!re.sidebarOpenStore.state||q.Z.state.open||ee.Z.state.open||ae.Z.state.open||ie.Z.state.open||L.Z.state.isActive||X.Z.state.clonedBlockStore||re.sidebarResizingStore.state.isResizing||G.Z.state.open||!(0,W.c)()||z.Z.state.namedOpenPopups.has("team_more_actions")||(re.sidebarMousePeekXStore.setState(0),re.sidebarOpenStore.setState(!1),re.sidebarElectronMousePeekStore.setState(!1))}function me(e){if((0,N.Y)("supportsNativeHome"))return;(0,ne.tourIsActiveInSidebarStep)(ne.default.state)&&!e.isExpanded&&ne.default.setState({type:"inactive"});const t=D.default.DO_NOT_USE_markLegacy("sidebar.toggle_expanded_lag");re.sidebarExpandedStore.setState(e.isExpanded),Re(),$.default.setSidebarExpandedStoreState(e.isExpanded),e.isExpanded&&e.environment.WindowSizeStore.state.width<le&&(0,oe.Sx)(e.environment)&&fe({environment:e.environment,isExpanded:!1,from:"close_for_space",saveDetailsSidebarPreference:e.saveDetailsSidebarPreference}),e.isExpanded&&(0,oe.$3)(e.environment)<ce&&v.xv(e.environment,"sidebar_expand"),e.isExpanded?d.LM(e.environment):d.Qd(e.environment),D.default.DO_NOT_USE_measureAfterNextFlushLegacy(t,{environment:e.environment,getData:()=>({is_expanded:e.isExpanded,from:e.from})})}function ge(e,t,n,o){const i=$.default.state.open,{currentTab:a}=se.ZP.state,s=a!==n||a===n&&!(0,oe.Sx)(e),l=n===se.gY.Comments&&(a!==n||!(0,oe.Sx)(e));Ee(n),l&&se.ZP.update((e=>({...e,timeOpenedComments:Date.now()}))),i?(b._c({environment:e,store:t,pageVisitSource:r.tY.Expand}),fe({environment:e,isExpanded:!0,from:o,saveDetailsSidebarPreference:!0})):fe({environment:e,isExpanded:s,from:o,saveDetailsSidebarPreference:!0})}function fe(e){var t;const{isExpanded:n,environment:o,from:r}=e;if(n||p.LZ(),n){o.WindowSizeStore.state.width<le&&(0,oe.in)(o)&&me({environment:o,isExpanded:!1,from:`set_update_expand_${e.from}`,saveDetailsSidebarPreference:!1}),V.default.isOpen()&&F.TN({environment:o});const t=se.ZP.state.currentTab,n={origin:$.default.state.open?"peek_view":"page",from:r};t===se.gY.Comments?d.v$(o,n):t===se.gY.Updates&&d.ph(o,n)}const a=$.default.state.open&&$.default.state.targetStore.id||(null===(t=O.default.state.mainEditorCurrentBlockStore)||void 0===t?void 0:t.id);se.ZP.setState({...se.ZP.state,expanded:n,mouseEntered:!!n||se.ZP.state.mouseEntered,openedOnBlockId:a,canRender:!0});const s=function(e){const t=O.default.state.mainEditorCurrentBlockStore;if(t&&e){const n=Q.G.createChildStore(t,{id:e,table:i.iU});if(!n)return;const o=n.getAssociatedCollectionStore();if(!o)return;return o.getLayoutStore()}}(a);n?se.ZP.state.currentTab===se.gY.Info&&(R.Z.setOpen(),s&&e.saveDetailsSidebarPreference&&(0,A.Jx)({environment:o,layoutStore:s,state:"open"})):(R.Z.setClosed(),s&&se.ZP.state.currentTab===se.gY.Info&&e.saveDetailsSidebarPreference&&(0,A.Jx)({environment:o,layoutStore:s,state:"closed"})),De()}function he(e){$.default.state.savedSidebarExpandedStoreState&&!re.sidebarExpandedStore.state&&function(e){if(re.sidebarExpandedStore.state||!$.default.state.savedSidebarExpandedStoreState)return;$.default.isSidePeekOpen()&&(0,oe.$3)(e)-(0,oe.qG)(e)>=ce&&re.sidebarExpandedStore.setState(!0)}(e),re.sidebarExpandedStore.state&&function(e){const t=re.sidebarExpandedStore.state&&0===(0,oe.Wk)(e),n=t?e.WindowSizeStore.state.width-re.sidebarWidthStore.state-(0,oe.ll)(e,!1):(0,oe.$3)(e);$.default.isSidePeekOpen()&&$.default.state.savedSidebarExpandedStoreState&&re.sidebarExpandedStore.state&&n<ce&&(re.sidebarExpandedStore.setState(!1),$.default.setSidebarExpandedStoreState(!0))}(e)}function ve(e){re.sidebarWidthStore.setState(e.width),(0,oe.$3)(e.environment)<ce&&v.xv(e.environment,"sidebar_expand"),Re()}function ye(e){se.ZP.setState({...se.ZP.state,width:e.width}),De()}function be(e){if($.default.state.open&&$.default.isSidePeekOpen()){const t=e.environment.WindowSizeStore.state.width;$.default.setSidePeekWidth(e.width,t),function(){const{preferredSidePeekWidth:e}=$.default.state,t={width:e};s.Z.set(Ae,t)}(),he(e.environment)}}async function _e(e){const{blocks:t,transaction:n,environment:o}=e,{currentSpaceViewStore:r}=O.default.state;if(r)for(const i of t)g.Od({parentStore:r.getSharedPagesStore(),childToRemoveStore:i,transaction:n});_.CZ({environment:o,blocks:t}),await Promise.all(t.map((e=>u.leaveBlock(o,{block:{id:e.id,spaceId:(0,a.C)(e.pointer.spaceId)}}))))}function Se(e){const{store:t,spaceViewStore:n,transaction:o}=e,r=n.getBookmarkedPagesStore(),i=Q.G.createChildStore(r,t.pointer);K.default.checkGate({gateName:"append_favorites"})?g.R3({parentStore:r,appendStore:i,transaction:o}):g.Ce({parentStore:r,prependStore:i,transaction:o})}function ke(e){const{store:t,spaceViewStore:n,transaction:o}=e,r=n.getBookmarkedPagesStore(),i=Q.G.createChildStore(r,t.pointer);g.Od({parentStore:r,childToRemoveStore:i,transaction:o})}function we(e){const{store:t,spaceViewStore:n,transaction:o}=e;Ie(e);const r=n.getSharedPagesStore(),i=Q.G.createChildStore(r,t.pointer);g.Ce({parentStore:r,prependStore:i,transaction:o})}function xe(e){const{store:t,spaceViewStore:n,transaction:o}=e;Ie(e);const r=n.getSharedPagesStore(),i=Q.G.createChildStore(r,t.pointer);g.Od({parentStore:r,childToRemoveStore:i,transaction:o})}function Ie(e){const{environment:t,spaceViewStore:n,userSettingsStore:o,transaction:r}=e,i=n.getSpaceId();if(!i||o.hasUserPinnedToOutliner({spaceId:i,type:"shared"}))return;const{visiblePagesStores:a}=(0,P.a2)({environment:t,spaceViewStore:n,userSettingsStore:o,type:"shared"}),s=a.map((e=>{let{id:t}=e;return t}));y.sW({store:n,data:{shared_pages:s},transaction:r}),w.Nb({userSettingsStore:o,spaceId:i,type:"shared",transaction:r})}async function Ce(e){const{from:t,environment:n,redirect:i,event:a,pageVisitSource:s,navigateOnCreate:l=!0}=e,{currentSpaceStore:d,currentSpaceViewStore:u}=O.default.state,p=new k.sA(n,"quickAddPage");if(!(te.M_(n)&&d&&d.canEdit()&&u))return te.M_(n)||te.ne(),void p.fail("invalid_state");H.ZP.setState({...H.ZP.state,lastPageId:O.default.state.mainEditorCurrentBlockStore?O.default.state.mainEditorCurrentBlockStore.id:void 0});const g=await async function(e){const{newPageTracker:t,quickAddParentOverride:n,environment:o,event:r}=e,{currentSpaceStore:i}=O.default.state;if(!i)return void t.fail("invalid_state");const a=n||await(0,T.lX)({spaceStore:i,currentUserId:o.currentUser.id}),s=C.uw(a),l=(0,x.tO)({event:r,parentStore:s,type:a.type});if("space-private-pages"===a.type||s.canAdmin()){const e=await S.createAndCommitAsync({environment:o,userAction:"sidebarActions.quickAddPage.directMoveToAdd",waitForServerCommit:!1,perform:async e=>{const n=y.j4({environment:o,type:"page",inMemoryRecordCache:o.defaultRecordCache.inMemoryRecordCache,transaction:e,spaceId:i.id,tracker:t,useCrdt:l}),r=await f.Ws({environment:o,targets:[n],value:a,transaction:e});if(r&&"collection"===r.table){const t=r.getDefaultTemplatePageStore();t&&m.ob({title:"template",environment:o,store:n,templateStore:t,isKeyboard:!1,isCreateIn:!1,transaction:e,from:"sidebar_actions"})}return{createdPage:n}}});return e.performResult.createdPage}if(!s.canAdmin()&&s.canEdit()){const{performResult:{createdPage:e}}=await S.createAndCommitAsync({environment:o,userAction:"sidebarActions.quickAddPage.moveToAdd",waitForServerCommit:!1,perform:async e=>{const n=y.j4({environment:o,type:"page",inMemoryRecordCache:o.defaultRecordCache.inMemoryRecordCache,transaction:e,spaceId:i.id,useCrdt:l});return t.track(n.pointer,e),await f.Ws({environment:o,targets:[n],value:{type:"space-private-pages",spaceId:i.id},transaction:e}),{createdPage:n}}});return await S.createAndCommitAsync({environment:o,userAction:"sidebarActions.quickAddPage.moveToMove",waitForServerCommit:!1,perform:async t=>{const n=await f.kj({environment:o,targets:[e],value:a,transaction:t});if(n&&"collection"===n.table){const r=n.getDefaultTemplatePageStore();r&&m.ob({title:"template",environment:o,store:e,templateStore:r,isKeyboard:!1,isCreateIn:!1,transaction:t,from:"sidebar_actions"})}}}),e}t.fail("invalid_state")}({...e,newPageTracker:p,event:a});return g?(B.cP({environment:n,checklistItem:"create_page"}),n.device.isMobile?(b._c({environment:n,store:g,showMoveTo:!0,saveParent:!0,redirect:i,pageVisitSource:s||r.tY.SidebarQuickAdd}),pe()):l&&(b.Rp(g),b._c({environment:n,store:g,showMoveTo:!0,saveParent:!0,redirect:i,pageVisitSource:s||r.tY.SidebarQuickAdd}),pe()),h.Eo({environment:n,spaceViewStore:u,type:"private",newIsHidden:!1,outlinerToggleButtonStore:Y.Z,shouldPersistToggleState:!0}),c.W(n,{from:t,type:"page",new_page_id:g.id,creating_block_id:g.id}),o.default.afterNextFlush((()=>{const e=E.Z.findDropTargetFromKey("Outliner-private"),t=null==e?void 0:e.getNode();t&&t instanceof HTMLElement&&t.scrollIntoView({behavior:"smooth",block:"nearest"})})),g):void 0}const Te=(0,l.defineMessages)({label:{id:"sidebar.newPage.button",defaultMessage:"New page"},tooltip:{id:"sidebar.newPage.tooltip",defaultMessage:"Create a new page"}}),Me="sidebar",Pe="updateSidebar",Ae="sidePeek";function Re(){const e={expanded:re.sidebarExpandedStore.state,width:re.sidebarWidthStore.state};s.Z.set(Me,e)}function De(){const{expanded:e,width:t,openedOnBlockId:n,currentTab:o,currentSubTab:r}=se.ZP.state,i={expanded:e,width:t,openedOnBlockId:n,currentTab:o,currentSubTab:r};s.Z.set(Pe,i)}function Be(e){const t=s.Z.get(Me),n=s.Z.get(Pe),o=s.Z.get(Ae),r=U.ZP.state;if((0,N.Y)("supportsNativeHome")?(re.sidebarExpandedStore.setState(!1),re.sidebarWidthStore.setState(0)):t?(void 0!==t.expanded&&re.sidebarExpandedStore.setState(t.expanded),void 0!==t.width&&t.width>=re.SIDEBAR_MIN_WIDTH&&re.sidebarWidthStore.setState(t.width)):(0,M.jt)()||re.sidebarExpandedStore.setState(!1),n){const e=n.width&&n.width>=se.AO?n.width:se.AO;se.ZP.setState({...se.ZP.state,...n,width:e}),window.innerWidth<le&&re.sidebarExpandedStore.setState(!1)}if(o&&$.default.setSidePeekWidth(o.width,window.innerWidth),(0,I.hN)(e)){const{openState:t,mode:n,contentType:o}=r;"open"===t&&"panel"===n&&(0,F.DD)({environment:e,contentType:o,skipAnimation:!0,autoLoaded:!0})}(0,A.TE)(e)}function Ee(e){const{currentTab:t}=se.ZP.state;se.ZP.setState({...se.ZP.state,currentTab:e}),e!==se.gY.Info&&R.Z.setClosed(),t===se.gY.Comments&&e!==t&&p.LZ()}function Fe(e){se.ZP.setState({...se.ZP.state,commentsMode:e})}function Ze(e){se.ZP.setState({...se.ZP.state,commentsTypeMode:e})}function Ue(e){(0,oe.Sx)(e)||re.sidebarExpandedStore.state?(me({environment:e,isExpanded:!1,from:"toggle_both_sidebars",saveDetailsSidebarPreference:!0}),fe({environment:e,isExpanded:!1,from:"keyboard_default",saveDetailsSidebarPreference:!0})):(fe({environment:e,isExpanded:!0,from:"keyboard_default",saveDetailsSidebarPreference:!0}),me({environment:e,isExpanded:!0,from:"toggle_both_sidebars",saveDetailsSidebarPreference:!0}))}function Ve(){re.sidebarShouldLogInitialRenderStore.setState(!1)}function Ne(e){const{environment:t,isResizing:n}=e;if((0,Z.EA)()||Boolean(n)&&!V.default.state.autoClosed)return;(0,oe.z5)(t)>=de&&((0,F.DD)({environment:t,contentType:"assistant",skipAnimation:!0}),V.default.isPanelPinnedState()||(0,F.bP)())}function Oe(e){if(!(0,Z.EA)())return;(0,oe.z5)(e)<de&&((0,oe.in)(e)?re.sidebarExpandedStore.setState(!1):F.TN({environment:e,autoClose:!0}))}},224646:(e,t,n)=>{n.d(t,{$3:()=>Z,Bb:()=>H,Fl:()=>Y,GD:()=>W,H3:()=>C,J5:()=>B,Jr:()=>A,L:()=>V,MY:()=>I,Nc:()=>k,O6:()=>M,Q$:()=>T,Sx:()=>F,UF:()=>J,Wk:()=>N,YR:()=>j,Yj:()=>E,em:()=>q,hr:()=>P,in:()=>R,js:()=>z,ll:()=>O,qG:()=>U,vF:()=>$,vJ:()=>L,vK:()=>D,wE:()=>G,z5:()=>K});var o=n(800480),r=n(886628),i=n(724405),a=n(915157),s=n(380503),l=n(709291),c=n(137810),d=n(721429),u=n(950659),p=n(918514),m=n(529294),g=n(48276),f=n(116746),h=n(80444),v=n(188923),y=n(938676),b=n(436391),_=n(621853);const S=320,k=800,w=24,x=20,I=22,C=30,T=8,M=4;function P(){const e=(0,o.Fy)().isMobile;return(0,i.yK)((t=>({topButtonIcon:{fill:e?t.mediumIconColor:t.sidebarSecondaryColor,width:e?x:w,height:e?x:w},bottomButtonIcon:{fill:e?t.mediumIconColor:t.sidebarSecondaryColor,width:e?x:w,height:e?x:w},baseSidebarItem:{...(0,u.G$)({isMobile:e}),fontWeight:c.Z.fontWeight.medium},currentSelectedSidebarItem:{background:t.sidebarItemSelectedBackground,color:t.text.primary,...e&&{boxShadow:`\n                            0 1px 0 ${t.buttonHoveredBackground}\n                        `}},currentSelectedSidebarIcon:{fill:t.sidebarSecondaryColor}})),[e])}function A(e){return!!e.device.isDesktop||!!e.device.isTablet&&e.WindowSizeStore.isLandscape()}function R(e){return((0,p.Sr)(e)||e.currentUser.isLoggedIn())&&y.sidebarExpandedStore.state}function D(e){return F(e)&&b.ZP.state.currentTab===b.gY.Comments}function B(e){return F(e)&&b.ZP.state.currentTab===b.gY.Updates}function E(e){const{tab:t}=e,n=(0,o.O7)();return(0,r.VK)((()=>F(n)&&b.ZP.state.currentTab===t),[n,t])}function F(e){var t;return(null===(t=h.default.state.mainEditorCurrentBlockStore)||void 0===t?void 0:t.id)===b.ZP.state.openedOnBlockId&&(e.currentUser.isLoggedIn()&&!e.device.isMobile&&b.ZP.state.expanded||_.Z.state.open)}function Z(e){return e.WindowSizeStore.state.width-N(e)-O(e,!1)}function U(e){const{isDesktop:t,isMobile:n,isTablet:o}=e.device,{WindowSizeStore:r}=e,i=r.isLandscape(),a=n&&!o&&i;return t?y.sidebarWidthStore.state:o||a?Math.min(S,.87*e.WindowSizeStore.state.width):.87*e.WindowSizeStore.state.width}function V(e){const{shouldShowSidebar:t}=(0,d.h1)(e),n=R(e);return t&&n&&A(e)?U(e):0}function N(e){const{shouldShowSidebar:t}=(0,d.h1)(e),n=R(e);return t&&n&&A(e)?U(e)+g.VV():t&&!n&&f.default.isOpen()?g.VV():0}function O(e,t){return t&&v.default.state.open?0:function(e){if(e.device.isMobile)return 0;if(L(e)>0){return(0,m.rb)()}return F(e)?b.ZP.state.width:0}(e)+L(e)}function L(e){if(v.default.isSidePeekOpen()){const t=(0,m.rb)();return v.default.getSidePeekWidth(e.WindowSizeStore.state.width)-t}return 0}function j(e){return e.device.isAndroid&&!e.device.isTablet||e.device.isTablet&&e.WindowSizeStore.isPortrait()}function K(e){const t=N(e)+g.VV()+L(e);return e.WindowSizeStore.state.width-t}const z=(0,l.defineMessages)({createOrJoinWorkspace:{defaultMessage:"Create or join workspace",id:"sidebarSwitcher.createOrJoinWorkspaceButton.prompt"},personalPlan:{defaultMessage:"Personal Plan",id:"sidebarSwitcher.personalPlan.label"},proPlan:{defaultMessage:"Personal Pro Plan",id:"sidebarSwitcher.proPlan.label"},educationPlan:{defaultMessage:"Personal Pro Plan (Education)",id:"educationPlan.title"},educationPlusPlan:{defaultMessage:"Education Plus Plan",id:"sidebarSwitcher.educationPlusPlan.label"},freePlan:{defaultMessage:"Free Plan",id:"sidebarSwitcher.freePlan.label"},teamTrialPlan:{defaultMessage:"Team Plan (Trial)",id:"teamTrialPlan.title"},teamPlan:{defaultMessage:"Team Plan",id:"teamPlan.title"},plusPlan:{defaultMessage:"Plus Plan",id:"plusPlan.title"},businessPlan:{id:"businessPlan.title",defaultMessage:"Business Plan"},enterprisePlan:{defaultMessage:"Enterprise Plan",id:"sidebarSwitcher.enterprisePlan.label"},legacyPlan:{defaultMessage:"Legacy Plan",id:"sidebarSwitcher.legacyPlan.label"},workspaceSubtitleWithMembers:{id:"sidebarSwitcher.workspaceSubtitleWithMembers.label",defaultMessage:"{planType} · {numberOfWorkspaceMembers, plural, one {{numberOfWorkspaceMembers} member} other {{numberOfWorkspaceMembers} members}}"},workspaceSubtitleWithoutMembers:{id:"sidebarSwitcher.workspaceSubtitleWithoutMembers.label",defaultMessage:"{planType}"}});function q(e){switch(e){case"team_free":case"personal_free":case"free":return z.freePlan;case"personal":case"plus":return z.plusPlan;case"student":return z.educationPlusPlan;case"business":return z.businessPlan;case"enterprise":return z.enterprisePlan;default:return z.legacyPlan}}function H(e){return e.canRead()&&"copy_indicator"!==e.getType()}function G(e){let{isExpanded:t,isFullScreenDesktop:n,isShowingTabBar:o,isElectron:r}=e;return!o&&function(e){let{isExpanded:t,isFullScreenDesktop:n,isElectron:o}=e;return o&&t&&!n}({isExpanded:t,isFullScreenDesktop:n,isElectron:r})}function W(e){let{isExpanded:t,isFullScreenDesktop:n,isShowingTabBar:o,isElectron:r}=e;return t&&!o&&!G({isExpanded:t,isFullScreenDesktop:n,isShowingTabBar:o,isElectron:r})}function $(e){return s.R6(e.device.isElectronMac)+15}function Y(e,t){return`${e.id}:${t}`}function Q(e){let{environment:t,section:n,isSectionShown:o,spaceViewId:r}=e;if(!o)return null;return!0!==a.Z.get({userId:t.currentUser.id,key:Y({id:r},n)})}function J(e){var t;let{environment:n}=e;const o=null===(t=h.default.state.currentSpaceViewStore)||void 0===t?void 0:t.id,r=(0,d.k_)(n).state,i=y.sidebarExpandedStore.state;if(!o||!r)return{is_sidebar_open:i};const{showBookmarksSection:a,showSharedSection:s,showTeamSection:l,showPrivateSection:c}=r;return{is_sidebar_open:i,sidebar_state:{is_bookmark_expanded:Q({environment:n,isSectionShown:a,section:"bookmarks",spaceViewId:o}),is_team_expanded:Q({environment:n,isSectionShown:l,section:"teamSidebar",spaceViewId:o}),is_shared_expanded:Q({environment:n,isSectionShown:s,section:"shared",spaceViewId:o}),is_private_expanded:Q({environment:n,isSectionShown:c,section:"private",spaceViewId:o})}}}},588310:(e,t,n)=>{n.d(t,{$L:()=>s,As:()=>c,hV:()=>d,ls:()=>u});var o=n(805809),r=n(653965),i=n(583055);const a={};function s(e){void 0===a[e]&&(a[e]=performance.now())}const l={};function c(e){Object.assign(l,e)}function d(){return l}function u(){const{app_start_to_main_start:e,main_start_to_prefetch_initiated:t,prefetch_initiated_to_render_start:n,render_start_to_render_end:s}=(0,i.getSubMetricsAndMetricDataForTracking)().sub_metrics,l=(0,o.getAppStartTime)(),c={app_start_to_await_get_spaces_start:p(l,a.await_get_spaces_start),app_start_to_await_get_spaces_end:p(l,a.await_get_spaces_end),app_start_to_browser_repaint_start:p(l,a.browser_repaint_start),app_start_to_browser_repaint_end:p(l,a.browser_repaint_end)},d=r.GM({app_start_to_main_start:e,main_start_to_prefetch_initiated:t,prefetch_initiated_to_render_start:n,render_start_to_render_end:s,...c},r.o8),u=[e,t,n,s];return u.some(r.o8)||(d.app_start_to_render_end=r.Sm(u)),d}function p(e,t){return void 0===e||void 0===t?void 0:t-e}},568418:(e,t,n)=>{n.d(t,{F:()=>i,Z:()=>s});var o=n(749085),r=n(471924);let i=function(e){return e[e.Team=0]="Team",e[e.Members=1]="Members",e}({});class a extends o.default{getInitialState(){return{open:!1,screen:i.Team,description:"",accessLevel:"open",isDefault:!1,name:"",icon:void 0,flowId:r.Il(),pageNumber:1,onClose:void 0}}}const s=new a},397799:(e,t,n)=>{n.d(t,{Y:()=>r,Z:()=>i});var o=n(61766);let r=function(e){return e.Updates="updates",e.Home="home",e}({});const i=new o.Z},455521:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{touching:!1,swiping:!1}}}const i=new r},819034:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(80444);class i extends o.default{getInitialState(){return{results:[]}}getUnreadCountForCurrentSpace(){const{currentSpaceStore:e}=r.default.state,{results:t}=this.state;if(e){const n=t.find((t=>t.spaceId===e.id));if(n)return n.unread}return{mentions:0,following:0,highPriority:0}}getUnreadMentionsCountForOtherSpaces(){const{currentSpaceStore:e}=r.default.state,t=e&&e.id,{results:n}=this.state;let o=0;for(const r of n)r.spaceId!==t&&(o+=r.unread.mentions);return o}getTotalUnreadMentionsCount(){const{results:e}=this.state;let t=0;for(const n of e)t+=n.unread.mentions;return t}}const a=new i},938676:(e,t,n)=>{n.r(t),n.d(t,{SIDEBAR_MIN_WIDTH:()=>i,sidebarElectronMousePeekStore:()=>f,sidebarExpandedStore:()=>d,sidebarMouseEnterYStore:()=>c,sidebarMouseEnteredStore:()=>u,sidebarMousePeekXStore:()=>l,sidebarOpenStore:()=>s,sidebarResizingStore:()=>p,sidebarShouldLogInitialRenderStore:()=>g,sidebarSizeObserver:()=>m,sidebarWidthStore:()=>a});var o=n(749085),r=n(677794);const i=248,a=o.default.createValue(240,{name:"sidebarWidthStore"}),s=o.default.createValue(!1,{name:"sidebarOpenStore"}),l=o.default.createValue(0,{name:"sidebarMousePeekXStore"}),c=o.default.createValue(0,{name:"sidebarMouseEnterYStore"}),d=o.default.createValue(!0,{name:"sidebarExpandedStore"}),u=o.default.createValue(!1,{name:"sidebarMouseEnteredStore"}),p=o.default.createValue({isResizing:!1,isResizerHovered:!1},{name:"sidebarResizingStore"}),m=new r.E,g=o.default.createValue(!0,{name:"sidebarShouldLogInitialRenderStore"}),f=o.default.createValue(!1,{name:"sidebarElectronMousePeekStore"})},997852:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},478861:(e,t,n)=>{n.d(t,{Z:()=>p});var o=n(749085),r=n(519889),i=n(766079),a=n(653965),s=n(619584),l=n(692425),c=n(281236),d=n(206258);class u extends o.default{getInitialState(){return{createType:void 0}}getAllSpaceViewStores(e){return e.currentUser.loggedInUserIds.reduce(((t,n)=>[...t,...this.getSpaceViewStores(e,n)]),[])}hasAtLeastOneTeamPlan(e){return this.getAllSpaceViewStores(e).map((e=>{const t=e.getSpaceStore();if(t)return t.getPlanType()})).some((e=>"team"===e))}getSpaceViewStores(e,t){const n=new d.r9(e,{table:i.dx,id:t},{userId:t}).getSpaceViewStores();return a.mN(n,(e=>e.isDefined()&&e.getSpaceId())).filter((t=>Boolean(t.isDefined())&&Boolean(t.getAlive())&&!this.isSpaceDeleted(e,t)))}isSpaceDeleted(e,t){const n=t.getSpaceStore();if(null!=n&&n.isDefined())return!1;const o=t.getSpaceId(),r=c.Z.getData(e,{spaceId:o});return(0,s.z4)(r)}isGuestWithZeroSharedPages(e){const t=e.getUserRootParentId(),n=e.getSpaceStore();if(!t||!n)return!1;if(n.canRead())return!1;const o=l.Z.getSharedPagesState({spaceId:n.id,userId:t});if(!o)return!1;return 0===(o.currentPageIds??[]).length}getUserEmailAddress(e,t){return new d.U6(e,{table:r.KJ,id:t},{userId:t}).getEmail()}}const p=new u},455838:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>r});var o=n(749085);let r=function(e){return e[e.General=0]="General",e[e.Members=1]="Members",e[e.Security=2]="Security",e}({});class i extends o.default{getInitialState(){return{open:!1,limitMembers:!0,memberFilterQuery:"",tab:void 0}}getTeamStore(){return this.state.open?this.state.viewingUnjoinedPrivateTeamAsEnterpriseAdmin?this.state.unjoinedPrivateTeamStore:this.state.teamStore:void 0}}const a=new i},136896:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},44604:(e,t,n)=>{n.d(t,{AD:()=>r,Lz:()=>a,ZP:()=>s});var o=n(749085);const r=["all_pages","in_current_page","last_edited_by_me"];class i extends o.default{constructor(){super(...arguments),this.loadMoreOffset=200,this.startLimit=20,this.limitIncrement=20}getInitialState(){return{filter:"",teamspaceIds:[],lastEditedByIds:[],inPageIds:[],currentTab:"all_pages",loading:!0,limit:this.startLimit,excludePages:new Set,isInitialLastEditedByState:!0}}}function a(e,t,n){return"last_edited_by_me"===e.currentTab?t?[t]:[]:n?e.isInitialLastEditedByState&&t?[t]:e.lastEditedByIds:[]}const s=new i},436391:(e,t,n)=>{n.d(t,{AO:()=>l,IT:()=>i,ZP:()=>u,gY:()=>a,uF:()=>s});var o=n(749085),r=n(292595);const i={comments:"default",suggestions:"suggestion"};let a=function(e){return e[e.Comments=0]="Comments",e[e.Updates=1]="Updates",e[e.Info=2]="Info",e}({}),s=function(e){return e[e.Updates=0]="Updates",e[e.Analytics=1]="Analytics",e}({});const l=385;class c extends o.default{getInitialState(){return{width:l,expanded:!1,isResizerHovered:!1,isResizing:!1,mouseEntered:!1,currentTab:a.Comments,currentSubTab:s.Updates,commentsMode:"unresolved",commentsTypeMode:"commentsAndSuggestions",isAnimating:!1,canRender:!0}}}const d=new c;(0,r.exposeDebugValue)("UpdateSidebarStore",d);const u=d},621853:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},598794:(e,t,n)=>{n.d(t,{FV:()=>ge,Fi:()=>ye,Fn:()=>te,Fv:()=>Oe,Hf:()=>re,Hh:()=>ve,I9:()=>se,Iu:()=>oe,Jc:()=>Ce,LB:()=>we,M5:()=>Be,MO:()=>Y,Md:()=>_e,Or:()=>ne,Ps:()=>$,Q:()=>Ee,Qs:()=>me,W5:()=>Ue,WO:()=>Ve,_C:()=>Se,ce:()=>ae,co:()=>pe,eh:()=>Q,fT:()=>W,fn:()=>ee,g4:()=>Re,gP:()=>Pe,hh:()=>Te,iH:()=>z,ih:()=>Ae,il:()=>xe,iz:()=>fe,lm:()=>je,m1:()=>ce,m6:()=>G,n5:()=>q,nS:()=>he,p2:()=>Ie,pB:()=>H,pj:()=>K,rS:()=>X,sR:()=>Le,sr:()=>Ke,uM:()=>le,vk:()=>ze,x$:()=>ie,xy:()=>de,y1:()=>Me,ys:()=>qe});n(757658),n(21703);var o=n(701302),r=n(541432),i=n(990559),a=n(399036),s=n(180951),l=n(421202),c=n(606287),d=n(213493),u=n(23867),p=n(421838),m=n(709291),g=n(653965),f=n(215828),h=n(619584),v=n(100952),y=n(276725),b=n(496802),_=n(594419),S=n(119785),k=n(709953),w=n(524677),x=n(800993),I=n(898104),C=n(210228),T=n(95477),M=n(521100),P=n(214976),A=n(741195),R=n(433929),D=n(165598),B=n(222294),E=n(206258),F=n(27724),Z=n(924666),U=n(427534),V=n(84139),N=n(164359),O=n(305676),L=n(363208);const j=(0,m.defineMessages)({turnIntoCollectionTitle:{defaultMessage:"Title",id:"simpleTableActions.collectionTitle"},turnIntoCollectionColumnTitle:{defaultMessage:"Column {columnIndex}",id:"simpleTableActions.collectionColumnTitle"}});function K(e){const{environment:t,index:n,simpleTableStore:o}=e,r=U.bm(o);if(0===r)return Y(),void I.clear({environment:t});const i=(0,h.uZ)(n,0,r-1);L.Z.setState({isActive:!0,simpleTableStore:o,selection:{start:{col:0,row:i},end:{col:U.WN(o)-1,row:i},type:"row"}}),w.Z5({environment:t,stores:[o],phase:F.SelectionPhase.Editing}),I.clear({environment:t})}function z(e){const{environment:t,index:n,simpleTableStore:o}=e,r=U.WN(o);if(0===r)return Y(),void I.clear({environment:t});const i=(0,h.uZ)(n,0,r-1);L.Z.setState({isActive:!0,simpleTableStore:o,selection:{start:{col:i,row:0},end:{col:i,row:U.bm(o)-1},type:"column"}}),w.Z5({environment:t,stores:[o],phase:F.SelectionPhase.Editing}),I.clear({environment:t})}function q(e){const{environment:t,rowIndex:n,columnIndex:o,simpleTableStore:r}=e;L.Z.setState({isActive:!0,simpleTableStore:r,selection:{start:{col:o,row:n},end:{col:o,row:n},type:"cell"}}),w.Z5({environment:t,stores:[r],phase:F.SelectionPhase.Editing})}function H(e){const{environment:t,start:n,end:o,simpleTableStore:r}=e;L.Z.setState({isActive:!0,simpleTableStore:r,selection:{start:n,end:o,type:"cell"}}),w.Z5({environment:t,stores:[r],phase:F.SelectionPhase.Editing}),I.clear({environment:t})}function G(e){const{environment:t,rowIndex:n,columnIndex:o,simpleTableStore:r}=e;H({environment:t,start:L.Z.state.isActive?L.Z.state.selection.start:{col:o,row:n},end:{col:o,row:n},simpleTableStore:r})}function W(e){q(e);const t=U.f8(e);t&&I.setSelectionAtEnd({store:t})}function $(){if("editing"!==Z.default.state.mode)return;const e=U.UQ();if(!e)return void Y();const{columnIndex:t,rowIndex:n,simpleTableStore:o}=e.getProps(),r=L.Z.state;if(r.isActive){const{start:e,end:i}=r.selection;!(e.col===i.col&&e.row===i.row)||e.col===t&&e.row===n&&r.simpleTableStore===o||q({environment:o.environment,rowIndex:n,columnIndex:t,simpleTableStore:o})}else q({environment:o.environment,rowIndex:n,columnIndex:t,simpleTableStore:o})}function Y(){L.Z.setState({isActive:!1})}function Q(e){const{environment:t,direction:n,bypassExistingTextSelection:o,expandSelection:r}=e;if(!o&&U.UQ())return;const i=L.Z.state;if(i.isActive){const{selection:e,simpleTableStore:a}=i;if(r){const{rowIndex:o,columnIndex:r}=J({selection:e,simpleTableStore:a,direction:n,wrapRow:!1});return void G({environment:t,rowIndex:o,columnIndex:r,simpleTableStore:a})}if(U.u({selection:e,columnIndex:e.start.col,simpleTableStore:a})){const{columnIndex:o}=J({selection:e,simpleTableStore:a,direction:n,wrapRow:!1});z({environment:t,index:o,simpleTableStore:a})}else{const r="editing"===Z.default.state.mode;o&&I.clear({environment:t});const{rowIndex:i,columnIndex:s}=J({selection:e,simpleTableStore:a,direction:n,wrapRow:!0});if(r)return void W({environment:t,rowIndex:i,columnIndex:s,simpleTableStore:a});q({environment:t,rowIndex:i,columnIndex:s,simpleTableStore:a})}}B.Z.setKeyboardMode(!0)}function J(e){const{selection:t,simpleTableStore:n,direction:o,wrapRow:r}=e,i=U.WN(n)-1,a=U.bm(n)-1,{col:s,row:l}=t.end;return"right"===o?s===i&&l===a?{columnIndex:i,rowIndex:a}:s===i?r?{columnIndex:0,rowIndex:l+1}:{columnIndex:s,rowIndex:l}:{columnIndex:s+1,rowIndex:l}:0===s&&0===l?{columnIndex:0,rowIndex:0}:0===s?r?{columnIndex:i,rowIndex:l-1}:{columnIndex:s,rowIndex:l}:{columnIndex:s-1,rowIndex:l}}function X(e){const{environment:t,direction:n,bypassExistingTextSelection:o,expandSelection:r}=e;if(!o&&U.UQ())return;const i=L.Z.state;if(i.isActive){const{selection:e,simpleTableStore:a}=i,{rowIndex:s,columnIndex:l}=function(e){const{selection:t,simpleTableStore:n,direction:o}=e,r=U.bm(n)-1,{col:i,row:a}=t.end,s="down"===o?Math.min(r,a+1):Math.max(0,a-1);return{columnIndex:i,rowIndex:s}}({selection:e,simpleTableStore:a,direction:n});if(r)return void G({environment:t,rowIndex:s,columnIndex:l,simpleTableStore:a});U.Ax({selection:e,rowIndex:e.start.row,simpleTableStore:a})?K({environment:t,index:s,simpleTableStore:a}):(o&&I.clear({environment:t}),q({environment:t,rowIndex:s,columnIndex:l,simpleTableStore:a}))}B.Z.setKeyboardMode(!0)}function ee(e){if(U.UQ())return;const t=L.Z.state;if(!t.isActive)return;const{environment:n,transaction:o}=e,{selection:r,simpleTableStore:i}=t;if(U.u({selection:r,columnIndex:r.start.col,simpleTableStore:i}))Ve(e),De({index:r.start.col,simpleTableStore:i,transaction:o}),z({environment:n,index:r.start.col,simpleTableStore:i});else if(U.Ax({selection:r,rowIndex:r.start.row,simpleTableStore:i})){Fe({rowID:i.getRenderableContentIds()[r.start.row],simpleTableStore:i,transaction:o}),K({environment:n,index:r.start.row,simpleTableStore:i})}else U.ok(r)?Ue({environment:n,transaction:o}):Ve({environment:n,transaction:o})}function te(e){if(U.UQ())return;const t=L.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,r=o.getContentStores()[n.end.row],i=U.h4(o);if(!i)return;const{environment:a,transaction:s,key:l}=e,c=r.getPropertyStore(i[n.end.col]);if(l&&1===l.length){const e=c.getValue(),t=p.TPx(l);x.sO({environment:a,store:c,value:e?e.concat(t):t,transaction:s}),I.setSelectionAtEnd({store:c})}}function ne(e){if(U.UQ())return;const t=L.Z.state;if(!t.isActive)return;const{environment:n,transaction:o}=e,{selection:r,simpleTableStore:i}=t;U.u({selection:r,columnIndex:r.start.col,simpleTableStore:i})?ve({transaction:o}):U.Ax({selection:r,rowIndex:r.start.row,simpleTableStore:i})&&ye({environment:n,transaction:o})}function oe(e){const{simpleTableStore:t,annotation:n}=e,o=L.Z.state;if(!o.isActive||o.simpleTableStore!==t)return;const{selection:r}=o,i=[],a=Math.min(r.start.row,r.end.row),s=Math.max(r.start.row,r.end.row),l=Math.min(r.start.col,r.end.col),c=Math.max(r.start.col,r.end.col);for(let p=a;p<=s;p++)for(let e=l;e<=c;e++){const n=U.f8({simpleTableStore:t,rowIndex:p,columnIndex:e}),o=null==n?void 0:n.getValue();n&&o&&i.push({textStore:n,textValue:o})}const d=p.J7s(n),u=i.every((e=>{let{textValue:t}=e;return t.every((e=>p.hDy(e).some((e=>p.J7s(e)===d))))}));for(const{textStore:p}of i)x.QT({...e,textStore:p,action:u?"removeAnnotationType":"annotate"})}function re(e){if(ke())return;const{x:t,y:n,simpleTableStore:o}=e;N.Z.setState({isActive:!0,simpleTableStore:o,hover:{x:t,y:n,showResizer:!1,resizing:!1,type:"cell"}})}function ie(e){if(ke())return;const{type:t,simpleTableStore:n,index:o}=e;N.Z.setState({isActive:!0,simpleTableStore:n,hover:{type:t,index:o}})}function ae(e){const{simpleTableStore:t,resizer:n}=e;N.Z.setState({isActive:!0,simpleTableStore:t,hover:{type:"resizer",resizer:n}})}function se(){ke()||N.Z.setState({isActive:!1})}function le(e){const t=L.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,{environment:r,transaction:i}=e;ue({index:n.start.col,simpleTableStore:o,transaction:i}),W({environment:r,rowIndex:0,columnIndex:n.start.col,simpleTableStore:o})}function ce(e){const{count:t,simpleTableStore:n,transaction:o}=e;if(t<1)return;const r=U.WN(n);for(let i=0;i<t;i++)ue({index:r+i,simpleTableStore:n,transaction:o})}function de(e){const t=L.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,{environment:r,transaction:i}=e;ue({index:n.end.col+1,simpleTableStore:o,transaction:i}),W({environment:r,rowIndex:0,columnIndex:n.end.col+1,simpleTableStore:o})}function ue(e){const{index:t,simpleTableStore:n,transaction:o,columnID:r,format:i}=e,a=U.h4(n)||[],s=U.FA(n),l=r||(0,f.ZP)(),c=[...a.slice(0,t),l,...a.slice(t)],d=i?{...s,[l]:i}:s;b.FH({stores:[n],update:{table_block_column_order:c,table_block_column_format:d},transaction:o})}function pe(e){const t=L.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,{environment:r,transaction:i}=e;fe({environment:r,index:n.start.row,simpleTableStore:o,transaction:i}),W({environment:r,rowIndex:n.start.row,columnIndex:0,simpleTableStore:o})}function me(e){const t=L.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,{environment:r,transaction:i}=e;fe({environment:r,index:n.end.row+1,simpleTableStore:o,transaction:i}),W({environment:r,rowIndex:n.end.row+1,columnIndex:0,simpleTableStore:o})}function ge(e){const{environment:t,count:n,simpleTableStore:o,transaction:r,analyticsFrom:i}=e;if(n<1)return;const a=U.bm(o);for(let s=0;s<n;s++)fe({environment:t,index:a+s,simpleTableStore:o,transaction:r,analyticsFrom:i})}function fe(e){const{environment:t,index:n,simpleTableStore:o,transaction:r,analyticsFrom:i}=e,a=o.getContentStore();if(!(0,D.dz)(a))throw new Error("Block has an invalid parent.");const s=k.j4({environment:t,type:"table_row",properties:{},inMemoryRecordCache:t.defaultRecordCache.inMemoryRecordCache,transaction:r,spaceId:o.pointer.spaceId,useCrdt:o.useCrdt()}),l=E.G.createChildStore(a,s.pointer);if(i&&v.W(t,{from:i,type:"table_row",creating_block_id:s.id}),n<=0)S.SH({parentStore:a,childStore:l,transaction:r});else{const e=o.getContentStores();S.jG({parentStore:a,childStore:l,transaction:r,after:e[n-1].id})}return l}function he(e){const{environment:t,simpleTableStore:n,transaction:o}=e,r=n.getContentStore();if(!(0,D.dz)(r))throw new Error("Block has an invalid parent.");const i=k.j4({environment:t,type:"table_row",properties:{},inMemoryRecordCache:t.defaultRecordCache.inMemoryRecordCache,transaction:o,spaceId:n.pointer.spaceId,useCrdt:n.useCrdt()}),a=E.G.createChildStore(r,i.pointer);return S.jG({parentStore:r,childStore:a,transaction:o}),a}function ve(e){const t=L.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,r=U.h4(o),i=U.FA(o);if(!r)return;const a=r.slice(n.start.col,n.end.col+1);if(!a)return;const s=[],{transaction:l}=e;for(let c=n.start.col;c<=n.end.col;c++){const e=a[c-n.start.col],t=(0,f.ZP)();s.push(t),ue({index:n.end.col+1,simpleTableStore:o,transaction:l,columnID:t,format:i?i[e]:void 0})}for(const c of o.getContentStores())be({rowStore:c,columnIDs:a,newColumnIDs:s,transaction:l})}function ye(e){const t=L.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,r=o.getRenderableContentIds(),{environment:i,transaction:a}=e;for(let s=n.start.row;s<=n.end.row;s++){const e=E.G.createChildStore(o,{table:l.iU,id:r[s]}),[t]=y.Qi({environment:i,stores:[e],addCopyName:!1,transaction:a,deepCopyTransclusionContainers:!0,resolveTemplateVariables:!1,targetSpaceId:(0,u.C)(e.pointer.spaceId),baseUrl:T.default.domainBaseUrl,publicDomainName:T.default.publicDomainName,preferDuplicateLocation:"local",useCrdt:o.useCrdt()}),n=t[0];_.BE({parentStore:o.getContentStore(),insertStore:n,afterStore:e,transaction:a})}}function be(e){const{rowStore:t,columnIDs:n,newColumnIDs:o,transaction:r}=e,i={...t.getPropertiesStore().getValue(),...(0,h.m8)(o.map(((e,o)=>[e,t.getPropertyValue(n[o])])))};M.b({environment:t.environment,store:t,properties:i,transaction:r})}function _e(e){const t=N.Z.state;if(!t.isActive)return;const{hover:n}=t;"cell"===n.type&&N.Z.setState({...t,hover:{...n,showResizer:e}})}function Se(e){const t=N.Z.state;if(!t.isActive)return;const{hover:n}=t;"cell"===n.type&&N.Z.setState({...t,hover:{...n,resizing:e}})}function ke(){const e=N.Z.state;return e.isActive&&"resizing"in e.hover&&e.hover.resizing}function we(e){const{tableBlockColumnFormat:t,simpleTableStore:n,transaction:o}=e;b.FH({stores:[n],update:{table_block_column_format:t},transaction:o})}function xe(e){const t=L.Z.state;if(!t.isActive||"row"!==t.selection.type)return;const{selection:n}=t;L.Z.setState({...t,selection:{...n,end:{col:e,row:n.end.row}}})}function Ie(e){const t=L.Z.state;if(!t.isActive||"column"!==t.selection.type)return;const{selection:n}=t;L.Z.setState({...t,selection:{...n,end:{col:n.end.col,row:e}}})}function Ce(e){const{environment:t,simpleTableStore:n,id:o,index:r,type:i,rowStore:a,theme:s,selectorStartPx:l,mouseOffsetPx:c}=e;let d=[];"column"===i?(z({environment:t,index:r,simpleTableStore:n}),d=V.Z.findCellsInColumnFromStore(n,o)):(K({environment:t,index:r,simpleTableStore:n}),d=V.Z.findCellsInRowFromStore(a));const u=U.To({cells:d,type:i,theme:s});O.Z.setState({isActive:!0,simpleTableStore:n,source:{id:o,type:i,index:r,draggedCells:u,selectorStartPx:l,mouseOffsetPx:c},destIndex:r,selectorDragPx:l,moved:!1})}function Te(e){const{destIndex:t,selectorDragPx:n}=e,o=O.Z.state;o.isActive&&O.Z.setState({...o,destIndex:t,selectorDragPx:n,moved:!0})}function Me(){O.Z.reset()}function Pe(e){const{event:t,environment:n,format:r,simpleTableStore:i,transaction:a,type:s,onNoChange:l}=e,c=O.Z.state;if(!c.isActive)return;const{source:d,destIndex:u}=c;d.type===s&&c.simpleTableStore===i&&("column"===s?function(e){const{environment:t,columnOrder:n,source:r,destIndex:i,simpleTableStore:a,transaction:s}=e;if(!n)return;Y();const l=[...n.slice(0,r.index),...n.slice(r.index+1)],c=[...l.slice(0,i),r.id,...l.slice(i)];b.FH({stores:[a],update:{table_block_column_order:c},transaction:s}),o.default.afterNextFlush((()=>{z({environment:t,index:i,simpleTableStore:a})}))}({environment:n,columnOrder:r.table_block_column_order,source:d,destIndex:u,simpleTableStore:i,transaction:a}):function(e){const{environment:t,source:n,destIndex:r,simpleTableStore:i,transaction:a}=e,s=i.getRenderableContentIds(),l=r>n.index?r:r-1;let c=r>0?s[l]:void 0;c===n.id&&(c=s[l+1]);Y();const d=i.getContentStores().find((e=>e.id===n.id)),u=i.getContentStores().find((e=>e.id===c));if(d){const e=i;u?S.jG({parentStore:e,after:u.id,childStore:d,transaction:a}):S.SH({parentStore:e,childStore:d,transaction:a}),o.default.afterNextFlush((()=>{K({environment:t,index:r,simpleTableStore:i})}))}}({environment:n,source:d,destIndex:u,simpleTableStore:i,transaction:a}),d.index===u&&(null==l||l(t)))}function Ae(e){const t=L.Z.state;if(!t.isActive)return;Ve(e);const{selection:n,simpleTableStore:o}=t,{environment:r,transaction:i}=e;for(let a=n.start.col;a<=n.end.col;a++)De({index:a,simpleTableStore:o,transaction:i});z({environment:r,index:n.start.col,simpleTableStore:o})}function Re(e){const{simpleTableStore:t,columnOrder:n,transaction:o}=e;b.FH({stores:[t],update:{table_block_column_order:n},transaction:o})}function De(e){const{index:t,simpleTableStore:n,transaction:o}=e,r=U.h4(n);if(!r||1===r.length)return;const i=[...r.slice(0,t),...r.slice(t+1)];b.FH({stores:[n],update:{table_block_column_order:i},transaction:o})}function Be(e){const t=L.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,r=o.getRenderableContentIds(),{environment:i,transaction:a}=e;for(let s=n.start.row;s<=n.end.row;s++)Fe({rowID:r[s],simpleTableStore:o,transaction:a});K({environment:i,index:n.start.row,simpleTableStore:o})}function Ee(e){const{simpleTableStore:t,numRowsToDelete:n,transaction:o}=e,r=t.getRenderableContentIds();for(let i=r.length-n;i<r.length;i++)Fe({rowID:r[i],simpleTableStore:t,transaction:o})}function Fe(e){const{rowID:t,simpleTableStore:n,transaction:o}=e,r=n.getContentStore();if(!(0,D.dz)(r))throw new Error("Block has an invalid parent.");if(U.bm(n)<=1)return;const i={table:l.iU,id:t};Ze({rowStore:E.G.createChildStore(r,i),simpleTableStore:n,transaction:o})}function Ze(e){const{rowStore:t,simpleTableStore:n,transaction:o}=e,r=n.getContentStore();S.hr({parentStore:r,childStore:t,transaction:o})}function Ue(e){const t=L.Z.state;if(!t.isActive)return;const{selection:n}=t;if(!U.ok(n))return;const{environment:o,transaction:r}=e;Ve({environment:o,transaction:r})}function Ve(e){const t=L.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,r=U.h4(o);if(!r)return;const i=o.getContentStores(),{environment:a,transaction:s}=e,l=Math.min(n.start.row,n.end.row),c=Math.max(n.start.row,n.end.row),d=Math.min(n.start.col,n.end.col),u=Math.max(n.start.col,n.end.col);for(let p=l;p<=c;p++)Ne({rowStore:i[p],startIndex:d,endIndex:u,columnOrder:r,transaction:s});I.clear({environment:a})}function Ne(e){const{rowStore:t,startIndex:n,endIndex:o,columnOrder:r,transaction:i}=e,a=r.slice(n,o+1);if(!a)return;const s=(0,h.m8)(a.map((e=>[e,null])));M.b({environment:t.environment,store:t,properties:s,transaction:i})}function Oe(e){const{environment:t,simpleTableStore:n,transaction:o}=e,i=U.h4(n)||[],s=U.FA(n)||{},{headerRow:u}=U._j(n),p=n.getContentStores();if(!i.length)return;const m=i[0],g=n.getSpaceId(),f=(0,A.TS)({environment:t,table:c.vF,spaceId:g}),v=(0,A.TS)({environment:t,table:d.np,spaceId:g}),y=u?p[0]:void 0,b=(0,h.m8)(i.map(((e,t)=>function(e){const{columnID:t,columnIndex:n,titleColumnID:o,headerRowStore:r}=e;let i=t,a="text",s=j.turnIntoCollectionColumnTitle;t===o&&(i="title",a="title",s=j.turnIntoCollectionTitle);const l=R.default.getIntl();return[i,{name:r?P.Xh(r.getPropertyValue(t),r):l.formatMessage(s,{columnIndex:n}),type:a}]}({columnID:e,columnIndex:t,titleColumnID:m,headerRowStore:y})))),_={id:f,version:0,parent_table:l.iU,parent_id:n.id,space_id:g,name:void 0,schema:b,alive:!0},w=k.ae({environment:t,table:"collection",value:_,inMemoryRecordCache:t.defaultRecordCache.inMemoryRecordCache,transaction:o});k.sW({store:n,data:{type:r.Ti.collectionView,view_ids:[v],collection_id:f},transaction:o}),k.sW({store:n.getFormatStore(),data:{collection_pointer:{table:c.vF,id:f,spaceId:g}},transaction:o}),p.map(((e,i)=>{if(u&&0===i)return void Ze({rowStore:e,simpleTableStore:n,transaction:o});const a=e.getProperties();k.sW({store:e,data:{type:r.Ti.page},transaction:o}),x.sO({environment:t,store:e.getBlockTitleStore(),value:a[m],transaction:o}),k.sW({store:e.getPropertiesStore(),data:{[m]:void 0},transaction:o}),S.zw({childStore:e,parentStore:w,transaction:o})}));const I={id:v,version:0,type:"table",name:void 0,parent_id:n.id,parent_table:"block",space_id:g,format:{table_properties:i.map((e=>({visible:!0,property:e===m?"title":e,width:s&&e in s?s[e].width:void 0})))},page_sort:p.map((e=>e.id)).slice(0,a.gq),alive:!0},T={table:d.np,id:v,spaceId:g};C.applyOperation({store:(0,E.Kv)(n,T),operation:{pointer:T,command:"set",path:[],args:I},transaction:o})}function Le(e){var t;const{environment:n,collectionViewBlockStore:o,pageStores:a,transaction:l}=e,c=o.getCollectionViewSourceCollectionStore();if(!c)return;if(a.length>U.HY||a.some((e=>e.hasContent())))return;const[d]=o.getCollectionViewStores(),u=c.getSchema(),p=(d.getFormat().table_properties||[]).filter((e=>e.visible&&e.property in u));if(!p)return;const m=o.getContentStore(),g=(0,f.ZP)();k.sW({store:o,data:{type:r.Ti.table,collection_id:null},transaction:l}),k.sW({store:o.getFormatStore(),data:{table_block_column_order:p.map((e=>"title"===e.property?g:e.property)),table_block_column_format:(0,h.m8)(p.map((e=>["title"===e.property?g:e.property,{width:e.width}]))),table_block_column_header:!0,collection_pointer:null},transaction:l});const v=k.j4({environment:n,type:"table_row",properties:(0,h.m8)(p.map((e=>{const t=e.property,n=t in u?u[t]:void 0;return["title"===t?g:t,n?[[n.name]]:[]]}))),inMemoryRecordCache:n.defaultRecordCache.inMemoryRecordCache,transaction:l,spaceId:o.pointer.spaceId,useCrdt:o.useCrdt()}),y=E.G.createChildStore(m,v.pointer);S.SH({parentStore:m,childStore:y,transaction:l});const b=(0,i.$z)(u),_=b.length>0?null===(t=c.getRecordKeyStore())||void 0===t?void 0:t.getRecordKey():void 0;a.map(((e,t)=>{const o=E.G.createChildStore(m,e.pointer),a=e.getProperties(),c=b.reduce((function(e,t){const n=(0,i.wf)(_,s.ah(a[t]));return e[t]=[[n]],e}),{});k.sW({store:o,data:{type:r.Ti.tableRow},transaction:l}),k.sW({store:o.getPropertiesStore(),data:{...c,[g]:o.getBlockTitleStore().getValue()},transaction:l}),x.sO({environment:n,store:o.getBlockTitleStore(),value:void 0,transaction:l}),S.jG({parentStore:m,childStore:o,transaction:l})})),k.sW({store:c,data:{alive:!1},transaction:l}),k.sW({store:d,data:{alive:!1},transaction:l})}function je(e){const{simpleTableStore:t,transaction:n}=e,o=t.getFormat(),r=!Boolean(o.table_block_column_header);b.FH({stores:[t],update:{table_block_column_header:r},transaction:n})}function Ke(e){const{simpleTableStore:t,transaction:n}=e,o=t.getFormat(),r=!Boolean(o.table_block_row_header);b.FH({stores:[t],update:{table_block_row_header:r},transaction:n})}function ze(e,t,n){const o=L.Z.state;if(!o.isActive)return;const r="default"===t?void 0:t,{selection:i,simpleTableStore:a}=o;if("row"===i.type){const e=a.getContentStores()[i.start.row];b.FH({stores:[e],update:{block_color:r},transaction:n})}if("column"===i.type){const e=U.h4(a),t=(0,g.Xh)(U.FA(a)||{});if(!e)return;const o=e[i.start.col];o in t?t[o].color=r:t[o]={color:r},b.FH({stores:[a],update:{table_block_column_format:t},transaction:n})}F.default.state.phase!==F.SelectionPhase.Selected||e.device.isMobile||w.ZH({environment:e})}function qe(e){const{simpleTableStore:t,parentWidth:n,transaction:o}=e,r=U.h4(t);if(!r)return;const i=U.FA(t),a=(n-18)/r.length,s=(0,h.m8)(r.map((e=>[e,{width:a,color:i&&i[e]?i[e].color:void 0}])));b.FH({stores:[t],update:{table_block_column_format:s},transaction:o})}},427534:(e,t,n)=>{n.d(t,{Ax:()=>M,FA:()=>x,HY:()=>N,KA:()=>U,Mp:()=>C,Q8:()=>L,To:()=>D,Ts:()=>B,UQ:()=>A,WN:()=>k,Xp:()=>F,ZB:()=>O,_j:()=>I,a5:()=>j,bm:()=>w,f7:()=>E,f8:()=>R,h4:()=>S,k7:()=>V,ok:()=>P,u:()=>T,zi:()=>Z});var o=n(842875),r=n(421202),i=n(23867),a=n(531701),s=n(937850),l=n(401898),c=n(21359),d=n(42239),u=n(360682),p=n(843250),m=n(214976),g=n(165598),f=n(489086),h=n(224646),v=n(206258),y=n(924666),b=n(84139),_=n(429574);function S(e){var t;return null===(t=e.getFormat())||void 0===t?void 0:t.table_block_column_order}function k(e){var t;return(null===(t=S(e))||void 0===t?void 0:t.length)||0}function w(e){return e.getContentLength()}function x(e){var t;return null===(t=e.getFormat())||void 0===t?void 0:t.table_block_column_format}function I(e){var t,n;return{headerColumn:null==e||null===(t=e.getFormat())||void 0===t?void 0:t.table_block_row_header,headerRow:null==e||null===(n=e.getFormat())||void 0===n?void 0:n.table_block_column_header}}function C(e){const t=["table","table_row"];return e.map((e=>e.getType())).some((e=>e&&t.includes(e)))}function T(e){const{selection:t,columnIndex:n,simpleTableStore:o}=e,r=t.start.col<=n&&n<=t.end.col;return"column"===t.type&&r&&0===t.start.row&&t.end.row===w(o)-1}function M(e){const{selection:t,rowIndex:n,simpleTableStore:o}=e,r=t.start.row<=n&&n<=t.end.row;return"row"===t.type&&r&&0===t.start.col&&t.end.col===k(o)-1}function P(e){return e.start.col===e.end.col&&e.start.row===e.end.row}function A(){const e="editing"===y.default.state.mode&&y.default.state.multiSelection;if(e)return b.Z.findCellFromTextStore(e.start.store)}function R(e){const{simpleTableStore:t,rowIndex:n,columnIndex:o}=e,r=t.getContentStores()[n];if(!r)return;const i=S(t);if(!i)return;const a=i[o];return a?r.getPropertyStore(a):void 0}function D(e){const{cells:t,type:n,theme:o}=e;return t.map((e=>function(e){const{cell:t,type:n,theme:o}=e,r=t.getNode();if(!r)return;const i=d.eN(t.getNode()),s=i.cloned.querySelector(`.${p.Apy}`),l=i.cloned.querySelector(`.${p.f0e}`);"column"===n?(s&&(s.style.left="calc(50% - 15px)",s.style.fill=a.ZP.white,s.style.background=o.simpleTableSelectionBorder),l&&(l.style.visibility="hidden")):(l&&(l.style.top="calc(50% - 15px)",l.style.left="-7px",l.style.fill=a.ZP.white,l.style.background=o.simpleTableSelectionBorder),s&&(s.style.visibility="hidden"));return{cloned:i.cloned,rect:DOMRect.fromRect(i.rect)}}({cell:e,type:n,theme:o}))).filter(l.$K)}function B(e,t){const n=_.Z.state;if(n.isActive&&n.simpleTableStore===e&&(!t||n.resize===t))return n}function E(e){const{environment:t,cellValue:n,spaceId:o,parentStore:r,theme:i,disableStyleAnnotations:a,disableSuggestionAnnotations:s}=e;return m.IY({environment:t,textValue:n?{value:n,spaceId:o}:void 0,parentStore:r,disableStyleAnnotations:a??!0,disableInsertedDeletedAnnotations:!0,disableDateStyleAnnotations:!0,disableSuggestionAnnotations:s??!1,disableHover:!0,disabled:!0,theme:i,emojiType:(0,u.e_)(t),katex:t.KatexStore.getKatex(),formulaValueTypes:[]})}function F(e){const{simpleTableStore:t,environment:n,includeInline:o}=e;return g.Xp(t,{recursivelyLoadAllDiscussions:o,onlyIncludeBlockLevelDiscussions:(0,h.Sx)(n)})}function Z(e){const{simpleTableStore:t,lastN:n}=e,o=t.getContentStores(),r=S(t);if(!o||!r)return!1;for(let i=o.length-1;i>Math.max(o.length-1-n,0);i--){const e=o[i].getProperties();if(e&&r.some((t=>t in e&&e[t])))return!0}return!1}function U(e){const{simpleTableStore:t,lastN:n}=e,o=t.getContentStores(),r=S(t);if(!o||!r)return!1;const i=r.slice(-n);return o.some((e=>{const t=e.getProperties();return t&&i.some((e=>e in t&&t[e]))}))}const V={title:!0,text:!0,url:!0,email:!0,person:!0,number:!0,date:!0,phone_number:!0,select:!0,multi_select:!0,status:!0,auto_increment_id:!0,file:!1,checkbox:!1,relation:!1,rollup:!1,formula:!1,created_by:!1,created_time:!1,last_edited_by:!1,last_edited_time:!1,last_visited_time:!1,button:!1,location:!1,verification:!1},N=200;async function O(e){const{environment:t,collectionViewBlockStore:n}=e,a=n.getCollectionViewSourceCollectionStore();if(!a)return[];const[l]=n.getCollectionViewStores(),d={source:{type:"collection",id:a.id,spaceId:(0,i.C)(a.pointer.spaceId)},collectionView:{id:l.id,spaceId:(0,i.C)(l.pointer.spaceId)},loader:{reducers:{results:{type:"results",limit:N+1,loadContentCover:!1}},searchQuery:void 0,userId:t.currentUser.id,userTimeZone:(0,o.r)()}},u=c.queryCollection(t,d,void 0,{src:"simple_tbl_transform"}),p=await(0,s.OI)(1e4,u);if(!p.timeout){const{result:e}=p;if("success"===e.type){const t=e.data.result.reducerResults.results;return(t&&"results"===t.type?t.blockIds:[]).map((e=>v.G.createChildStore(a,{id:e,table:r.iU})))}}return[]}function L(e){let t;if(0===e.getProps().rowIndex){const n=R({simpleTableStore:e.getProps().simpleTableStore,rowIndex:0,columnIndex:0});n&&(t=(0,f.mK)(n))}else t=R({simpleTableStore:e.getProps().simpleTableStore,rowIndex:e.getProps().rowIndex-1,columnIndex:e.getProps().columnIndex});return t}function j(e){let t;const n=w(e.getProps().simpleTableStore);if(e.getProps().rowIndex===n-1){const o=k(e.getProps().simpleTableStore),r=R({simpleTableStore:e.getProps().simpleTableStore,rowIndex:n-1,columnIndex:o-1});r&&(t=(0,f.hn)(r))}else t=R({simpleTableStore:e.getProps().simpleTableStore,rowIndex:e.getProps().rowIndex+1,columnIndex:e.getProps().columnIndex});return t}},629071:(e,t,n)=>{n.d(t,{W:()=>Mt,f:()=>$e});var o=n(667294),r=n(886628),i=n(926249),a=n(385555),s=n(883355),l=n(701302),c=n(712137),d=n(401898),u=n(52989),p=n(761045),m=n(110906),g=n(523864),f=n(668709),h=n(953336),v=n(279954),y=n(21404),b=n(595645),_=n(843250),S=n(212534),k=n(548779),w=n(224646),x=n(434859),I=n(677794),C=n(598794),T=n(427534);const M=18;var P=n(749085);class A extends P.default{getInitialState(){return{}}setTemporaryFormat(e){this.update((t=>({...t,temporaryFormat:e})))}updateColumnOrder(e){this.update((t=>({...t,temporaryFormat:{...t.temporaryFormat,table_block_column_order:e}})))}}const R=A;var D=n(164359),B=n(305676),E=n(363208),F=n(313991),Z=n(800480),U=n(724405),V=n(151454),N=n(709291),O=n(531701),L=n(137810),j=n(210228),K=n(13966),z=n(623063),q=n(164921),H=n(552275),G=n(231945),W=n(478140),$=n(632163),Y=n(672495),Q=n(824006),J=n(526388),X=n(460709),ee=n(745238),te=n(785893);const ne=(0,ee.IU)("arrowsOut",{viewBox:"0 0 30 30",svg:(0,te.jsx)("path",{d:"M7.09101 20.6434C7.50813 20.2263 7.49239 19.6124 7.07527 19.1953L6.41418 18.5342L3.51009 15.9449L7.75998 16.0551L12.6237 16.0709C12.8992 16.0787 13.1353 15.9685 13.3242 15.7797C13.7728 15.3311 13.8121 14.7093 13.3714 14.2686C13.1589 14.0561 12.8992 13.938 12.6159 13.938L7.75998 13.9459L3.51009 14.0561L6.42205 11.4589L7.07527 10.8057C7.49239 10.3886 7.52387 9.77473 7.09888 9.34974C6.6739 8.92476 6.06002 8.9405 5.63503 9.36548L1.2671 13.7334C0.464339 14.5362 0.464339 15.4649 1.2671 16.2676L5.63503 20.6356C6.04428 21.0448 6.6739 21.0605 7.09101 20.6434ZM24.3739 20.6592L28.7418 16.2912C29.5446 15.4885 29.5524 14.5519 28.7497 13.7492L24.3818 9.38123C23.9725 8.97198 23.3429 8.95624 22.9179 9.38123C22.5087 9.79047 22.5165 10.4122 22.9336 10.8293L23.5947 11.4904L26.5067 14.0718L22.2489 13.9695L17.3931 13.9459C17.1176 13.938 16.8736 14.0561 16.6847 14.245C16.244 14.6857 16.1968 15.3153 16.6375 15.7561C16.85 15.9685 17.1176 16.0787 17.4009 16.0787L22.2489 16.0787L26.5067 15.9607L23.5947 18.5578L22.9336 19.2189C22.5165 19.636 22.485 20.2499 22.91 20.6749C23.335 21.0999 23.9568 21.0763 24.3739 20.6592Z"})});var oe=n(224434),re=n(581750),ie=n(247482),ae=n(95802),se=n(825464),le=n(222294),ce=n(27724),de=n(429574);function ue(e){var t;const{simpleTableStore:n,rootSizeObserver:o,offset:i,hoverSizeObserver:a}=e,s=(0,Z.O7)(),l=(0,U.Fg)(),c=(0,r.VK)((()=>ae.C.findScrollToSelectableFromStore(n)),[n]),d=null==c||null===(t=c.getNode())||void 0===t?void 0:t.getBoundingClientRect(),u=(0,r.VK)((()=>o.rect.state.width),[o]),p=(0,r.VK)((()=>a.rect.state.width),[a]),m=(0,r.VK)((()=>Math.min((null==d?void 0:d.width)||0,u,p)+i),[d,u,p,i]);return d?(0,te.jsx)("div",{style:{width:0,position:"absolute",left:m,zIndex:V.t8},onMouseDown:S.$0,children:(0,te.jsx)("div",{style:{position:"relative"},children:(0,te.jsxs)("div",{style:me(l),children:[(0,te.jsx)(J.Z,{placement:se.u.Top,render:e=>(0,te.jsx)(q.Z,{...e,style:ge(l),onClick:()=>{j.createAndCommit({userAction:"SimpleTableActionBar.ActionBarContent",environment:s,perform:e=>{C.ys({simpleTableStore:n,parentWidth:a.rect.state.width,transaction:e})}})},children:ne({width:20,fill:l.regularIconColor})}),renderTooltip:()=>(0,te.jsx)(N.FormattedMessage,{defaultMessage:"Fit table to page width",id:"simpleTable.actionBar.fitToPage"})}),(0,te.jsx)(G.ZP,{popupType:G.Z4.Popup,originGap:4,renderOrigin:e=>(0,te.jsxs)(q.Z,{style:ge(l),...e,children:[(0,te.jsx)(N.FormattedMessage,{id:"simpleTable.actionBar.options",defaultMessage:"Options"}),(0,oe.i)({width:10,fill:l.mediumIconColor,marginLeft:4})]}),render:()=>(0,te.jsx)(pe,{simpleTableStore:n})}),(0,te.jsx)(K.Z,{store:n,fadeIn:!1,style:{display:"flex",justifyContent:"center",alignSelf:"center",width:30,height:void 0,padding:"9px 8px"},iconStyle:{fill:l.regularTextColor}})]})})}):null}function pe(e){const{simpleTableStore:t}=e,n=(0,Z.O7)(),o=(0,U.Fg)(),r=[{key:"header row",action:()=>{j.createAndCommit({userAction:"SimpleTableActionBar.menuItems",environment:n,perform:e=>{C.lm({simpleTableStore:t,transaction:e})}})},render:e=>(0,te.jsx)(H.Z,{...e,icon:(0,ie.f)({width:16,fill:o.regularIconColor}),title:(0,te.jsx)(N.FormattedMessage,{id:"action.columnHeader.title",defaultMessage:"Header row"}),right:(0,te.jsx)(Q.Z,{on:T._j(t).headerRow||!1,onClick:e.onClick})})},{key:"header column",action:()=>{j.createAndCommit({userAction:"SimpleTableActionBar.menuItems",environment:n,perform:e=>{C.sr({simpleTableStore:t,transaction:e})}})},render:e=>(0,te.jsx)(H.Z,{...e,icon:(0,re.s)({width:16,fill:o.regularIconColor}),title:(0,te.jsx)(N.FormattedMessage,{id:"SimpleTableActionBar.action.rowHeader.title",defaultMessage:"Header column"}),right:(0,te.jsx)(Q.Z,{on:T._j(t).headerColumn||!1,onClick:e.onClick})})}];return(0,te.jsx)(W.Z,{menuType:X.og.Popup,width:240,maxHeight:n.device.isMobile?70:void 0,children:(0,te.jsx)($.Z,{type:$.i.Vertical,sections:[{key:"appearance section",render:e=>(0,te.jsx)(Y.Z,{...e}),items:r}],initialFocus:void 0})})}function me(e){return{position:"absolute",top:-40,right:0,borderRadius:4,height:32,fontSize:14,lineHeight:1.2,display:"flex",whiteSpace:"nowrap",fontFamily:L.Z.getCompositeFontFamily(F.locale).sans,background:e.popoverBackground,boxShadow:e.mediumBoxShadow}}function ge(e){return{display:"flex",alignItems:"center",padding:"0 8px",borderRight:`1px solid ${O.ZP.whiteWithAlpha(.2)}`,boxShadow:`1px 0 0 ${e.regularDividerColor}`}}const fe=function(e){const{disabled:t,canEdit:n,simpleTableStore:o}=e,i=(0,r.VK)((()=>{const e=E.Z.state,t=D.Z.state,n=de.Z.state,r=le.Z.state,i=ce.default.state,a=e.isActive&&e.simpleTableStore===o,s=1===i.stores.length&&i.stores[0]===o,l=t.isActive&&t.simpleTableStore===o&&"cell"===t.hover.type&&t.hover.resizing,c=n.isActive&&n.simpleTableStore===o;return(a||s)&&!l&&!c&&!r.isKeyboardMode}),[o]);return t||!n?null:(0,te.jsx)(z.Z,{isVisible:i,enterAnimationStyle:{opacity:0},animationStyle:{opacity:1},exitAnimationStyle:{opacity:0},render:()=>(0,te.jsx)(ue,{...e})})};var he=n(278429),ve=n(99340),ye=n(533125),be=n(800893),_e=n(680402),Se=n(800993),ke=n(898104),we=n(965187),xe=n(296994),Ie=n(268056),Ce=n(277907),Te=n(924666),Me=n(84139),Pe=n(406695),Ae=n(653965),Re=n(706685),De=n(389224);const Be=function(e){const t=(0,o.useRef)(),n=(0,Z.O7)(),i=(0,r.VK)((()=>Boolean(T.Ts(e.simpleTableStore))),[e.simpleTableStore]),{columnIndex:a,simpleTableStore:s,columnID:l,getWidth:c,onTemporaryResize:d,onAccept:u,onCancel:p}=e,m=(0,r.VK)((()=>{const e=D.Z.state;return!!e.isActive&&(e.simpleTableStore===s&&("cell"===e.hover.type&&(!i&&(e.hover.x===a&&(e.hover.showResizer||e.hover.resizing)))))}),[a,i,s]),g=(0,U.yK)((e=>({wrapper:{position:"absolute",right:0,width:0,top:0,flexGrow:0,height:"100%",zIndex:1},innerStyle:{position:"absolute",width:3,marginLeft:-1,marginTop:-1,height:"calc(100% + 2px)",transition:"background 150ms ease 50ms",cursor:i?void 0:"col-resize",background:m?e.simpleTableSelectionBorder:O.ZP.blueWithAlpha(0)}})),[i,m]),f=(0,o.useCallback)((e=>{e.preventDefault();const n=T.FA(s);t.current=n&&l in n?n[l]:{},t.current.width=c(),C._C(!0)}),[l,c,s]),h=(0,o.useCallback)((e=>{const t=S(e);t&&d(t)}),[d]),v=(0,o.useCallback)((e=>{const t=S(e);t&&u(t),C._C(!1)}),[u]),y=(0,o.useCallback)((()=>{p(),t.current=void 0,C._C(!1)}),[p]),b=(0,o.useCallback)((()=>{const t=Me.Z.findCellsInColumnFromStore(e.simpleTableStore,e.columnId),o=Ae.oA(t.map((e=>{var t;const n=null===(t=e.getNode())||void 0===t?void 0:t.querySelector(`.${_.Iiy}`);if(n)return function(e){const t=window.getComputedStyle(e),n=e.cloneNode(!0),o=n;o.id="notion-table-cell-shadow",Array.from(t).forEach((e=>o.style.setProperty(e,t.getPropertyValue(e),t.getPropertyPriority(e)))),o.style.opacity="0",o.style.width="100%",o.style.pointerEvents="none",document.body.appendChild(n);const r=o.querySelector(`.${_.qnV}`);if(!r)return void o.remove();r.style.width="",r.style.display="inline-block";const i=window.document.createRange();i.selectNode(r);const a=De.getRect(i);return o.remove(),null!=a&&a.width?a.width+He:void 0}(n)})));j.createAndCommit({userAction:"SimpleTableColumnResizer.handleDoubleClick",environment:n,perform:t=>{C.LB({tableBlockColumnFormat:{...Ee(e.format,e.formatStore).table_block_column_format,[e.columnId]:{width:Math.max(...o)}},simpleTableStore:e.simpleTableStore,transaction:t})}})}),[n,e.columnId,e.format,e.formatStore,e.simpleTableStore]);function S(e){var n;if(null!==(n=t.current)&&void 0!==n&&n.width){const n=Math.max(t.current.width+e.diffX,Pe.lw);return{...t.current,width:n}}}return(0,te.jsx)("div",{style:g.wrapper,onMouseMove:()=>C.Md(!0),onMouseLeave:()=>C.Md(!1),children:(0,te.jsx)(Re.Z,{onDraggableDragStart:f,onDraggableDragMove:h,onDraggableDragEnd:v,onDraggableDragCancel:y,disableVerticalEdgeScroll:!0,disableHorizontalEdgeScroll:!0,render:e=>(0,te.jsx)("div",{style:g.innerStyle,onDoubleClick:b,...e})})})};function Ee(e,t){const{temporaryFormat:n}=t;return n||e}const Fe=function(e){const{rowIndex:t,columnIndex:n,simpleTableStore:o}=e,i=(0,r.VK)((()=>{const e=B.Z.state;if(e.isActive&&e.simpleTableStore===o&&e.moved&&e.source.index!==e.destIndex)return{destIndex:e.destIndex,sourceIndex:e.source.index,type:e.source.type}}),[o],{useDeepEqual:!0}),{destIndex:a,sourceIndex:s,type:l}=i||{destIndex:0,sourceIndex:0},c=(0,U.yK)((e=>({sharedStyle:{position:"absolute",flexGrow:0,zIndex:2,background:e.simpleTableSelectionBorder},rowStyle:{top:s>a?0:void 0,bottom:s<a?0:void 0,left:-1,width:"calc(100% + 2px)",height:3},columnStyle:{top:-1,left:s>a?0:void 0,right:s<a?0:void 0,width:3,height:"calc(100% + 2px)"}})),[s,a]);return i?"row"===l&&a===t?(0,te.jsx)("div",{style:{...c.sharedStyle,...c.rowStyle}}):"column"===l&&a===n?(0,te.jsx)("div",{style:{...c.sharedStyle,...c.columnStyle}}):null:null};var Ze=n(250906),Ue=n(106404),Ve=n(847848),Ne=n(708949),Oe=n(535431);class Le extends Oe.Z{findSelectorsOfTypeFromStore(e,t){return this.filter((n=>{const o=n.getProps();return o.simpleTableStore===t&&o.type===e}))}}const je=new Le;const Ke=function(e){const t=(0,Z.O7)(),n=(0,o.useRef)(),i=(0,o.useRef)(null),a=(0,U.Fg)();(0,ye.c)(je,(()=>({getProps:()=>e,getNode:()=>i.current??null})),[e]);const s=()=>{n.current=void 0,C.y1()},l=n=>{Ue.Qn({environment:t,stores:[e.simpleTableStore],left:n.startX,top:n.startY,showInput:!0,actionSectionGroupKey:"simple_table",analyticsFrom:"simple_table_menu"})},c=(0,r.VK)((()=>{const{isMobile:n}=t.device;if(n)return function(e,t,n){const o=E.Z.state;if(!o.isActive)return!1;if(o.simpleTableStore!==e)return!1;const{selection:r}=o;if(T.ok(r)){if("column"===t)return r.start.col===n;if("row"===t)return r.start.row===n}return!1}(e.simpleTableStore,e.type,e.index);const{isKeyboardMode:o}=le.Z.state;if(o)return!1;const{simpleTableStore:r,type:i,index:a}=e;if(B.Z.state.isActive)return!1;const s=D.Z.state;if(!s.isActive)return!1;if(s.simpleTableStore!==r)return!1;if(T.Ts(r))return!1;const l=ce.default.state;if(l.stores[0]===r&&l.phase===ce.SelectionPhase.Selected)return!1;const c=s.hover;return"cell"!==c.type?c.type===i&&c.index===a:"column"===i?c.x===a:"row"===i&&c.y===a}),[t.device,e],{useDeepEqual:!0}),u=e.isSelected||c;return(0,te.jsx)(Re.Z,{allowDragWhileTextEditing:!0,onDraggableDragStart:u?o=>{var r;const{type:s}=e;o.preventDefault();const l=null===(r=i.current)||void 0===r?void 0:r.parentNode;if(!(l&&l instanceof Element))return;const c=l.getBoundingClientRect();n.current="column"===s?c.x:c.y;const d="column"===s?o.startX-c.x:o.startY-c.y;C.Jc({...e,environment:t,theme:a,selectorStartPx:n.current,mouseOffsetPx:d})}:void 0,onDraggableDragMove:u?t=>{const{type:o}=e;if(!n.current)return;const r=B.Z.state;if(!r.isActive)return;const i="column"===o?t.diffX:t.diffY;if(0!==i){const t=n.current+i,o=function(e,t,n){const{delta:o,selectorDragPx:r}=e,i=je.findSelectorsOfTypeFromStore(n,t);if(o>0){const e=i.map((e=>{var t;const o=null===(t=e.getNode())||void 0===t?void 0:t.parentNode;if(!(o&&o instanceof Element))return;const r=o.getBoundingClientRect();return"column"===n?null==r?void 0:r.x:null==r?void 0:r.y})).filter(d.$K);e.sort(((e,t)=>e-t));for(let t=e.length-1;t>=0;t--)if(r>e[t])return t;return 0}const a=i.map((e=>{var t;const o=null===(t=e.getNode())||void 0===t?void 0:t.parentNode;if(!(o&&o instanceof Element))return;const r=o.getBoundingClientRect();return"column"===n?r.x+r.width:r.y+r.height})).filter(d.$K);return a.sort(((e,t)=>e-t)),a.filter(d.$K).findIndex((e=>r<e))}({delta:i,selectorDragPx:t+r.source.mouseOffsetPx},e.simpleTableStore,e.type);C.hh({destIndex:o,selectorDragPx:t})}}:void 0,onDraggableDragEnd:u?n=>{const{isMobile:o}=t.device,{simpleTableStore:r,type:i,format:a}=e;j.createAndCommit({userAction:"SimpleTableRowColumnSelector.handleDragEnd",environment:t,perform:e=>{C.gP({event:n,environment:t,simpleTableStore:r,transaction:e,format:a,type:i,onNoChange:o?void 0:l})}}),"row"===i&&Ze.RO(t,{from:"selection_menu",draggedTypes:["table_row"],asCopy:!1}),s()}:void 0,onDraggableDragCancel:u?()=>{s()}:void 0,disableVerticalEdgeScroll:!0,disableHorizontalEdgeScroll:!0,render:t=>(0,te.jsx)(ze,{ref:i,enabled:u,isSelected:e.isSelected,draggableEvents:t,type:e.type,index:e.index,simpleTableStore:e.simpleTableStore})})},ze=(0,o.forwardRef)((function(e,t){const{type:n,enabled:o,isSelected:i,draggableEvents:a}=e,s=(0,Z.O7)(),l=(0,r.VK)((()=>B.Z.state.isActive),[],{useDeepEqual:!0}),c=()=>{const{simpleTableStore:t,type:n,index:o}=e;C.x$({type:n,simpleTableStore:t,index:o})},d=()=>{C.I9()},u=(0,U.yK)((t=>({base:{opacity:o?1:0,pointerEvents:o?void 0:"none",transition:"opacity 150ms ease",fill:t.lightIconColor,position:"absolute",display:"flex",alignItems:"center",cursor:l?"grab":"pointer",justifyContent:"center",borderRadius:4,background:t.whiteButtonBackground,boxShadow:e.isSelected?void 0:t.lightBoxShadow,zIndex:4},column:{...qe(e.isSelected,t),top:-8,left:"calc(50% - 13px)",height:16,width:26,padding:"2px 4px"},row:{...qe(e.isSelected,t),top:"calc(50% - 13px)",left:-8,width:16,height:26,padding:"4px 2px"},hovered:{background:t.whiteButtonHoveredBackground,...qe(e.isSelected,t)},pressed:{...qe(e.isSelected,t,!0)}})),[o,l,e.isSelected]);return(0,te.jsx)(q.Z,{ref:t,className:"column"===n?_.Apy:_.f0e,style:{...u.base,...u[n]},hoveredStyle:u.hovered,pressedStyle:u.pressed,onClick:t=>function(e,t,n,o,r){const{isMobile:i}=r.device;Ne.Z.state.isActive||Ue.Qn({environment:r,stores:[o],left:e.clientX,top:e.clientY,showInput:!0,actionSectionGroupKey:"simple_table",analyticsFrom:"simple_table_menu"});i&&("column"===t?C.iH({environment:r,index:n,simpleTableStore:o}):C.pj({environment:r,index:n,simpleTableStore:o}))}(t,e.type,e.index,e.simpleTableStore,s),onTouchStart:c,onTouchEnd:d,onMouseEnter:c,onMouseLeave:d,...a,disallowTabbing:!0,children:(0,Ve.D)({fill:i?O.ZP.white:void 0,width:14,height:14,transform:"column"===n?"rotate(90deg)":void 0})})}));function qe(e,t){return e||arguments.length>2&&void 0!==arguments[2]&&arguments[2]?{background:t.simpleTableSelectionBorder}:void 0}const He=1;function Ge(e){const t=(0,o.useRef)(null),n=(0,o.useRef)(null),{value:i}=(0,Ce.XJ)(xe.FF.exportJsxRenderer),{value:a}=(0,Ce.XJ)(xe.FF.markdownLinkifyIt),{columnID:s,columnIndex:l,simpleTableStore:c,rowIndex:d,store:u,format:p,disabled:m,canEdit:g,legacyTransclusionParentStore:f,selection:h}=e,v=(0,Z.Fy)(),y=(0,Z.O7)(),b=!m&&g,k=(0,r.VK)((()=>null==u?void 0:u.getPropertyStore(s)),[s,u]);(0,ye.c)(Me.Z,(()=>({getProps:()=>e,getNode:()=>t.current,getTextStore:()=>k})),[e,k]);const w=(0,r.VK)((()=>e.formatStore.state.temporaryFormat||e.format),[e.format,e.formatStore]),x=e=>{const t=E.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,r=T.h4(o);if(!r)return;be.JG({environment:y,event:e,markdownLinkifyIt:a});const s="editing"===Te.default.state.mode&&Te.default.state.multiSelection;s&&!(0,Ie.iG)(s)||_e.qn({environment:y,simpleTableStore:o,selection:n,currentRows:o.getContentStores(),columnOrder:r,event:e,exportJsxRenderer:i})},I=(0,r.VK)((()=>{if(!u)return!1;const e=B.Z.state;if(!e.isActive||e.simpleTableStore!==c||!e.moved)return!1;const{type:t,id:n}=e.source;return"column"===t?n===s:n===u.id}),[s,c,u]),{headerColumn:M,headerRow:P}=(0,r.VK)((()=>function(e){return T._j(e)}(e.simpleTableStore)),[e.simpleTableStore]),{blockColor:A,columnFormat:R}=(0,r.VK)((()=>({blockColor:null==u?void 0:u.getFormat().block_color,columnFormat:T.FA(c)})),[u,c]),D=(0,o.useMemo)((()=>({type:"simple_table_cell_match",propertyId:s})),[s]),F=(0,U.yK)((e=>{var t,n;const o=function(e){const{columnFormat:t,rowIndex:n,columnIndex:o,columnID:r,theme:i,headerColumn:a,headerRow:s,blockColor:l}=e;let c=l||"default";if(t&&r in t){var d;const e=null===(d=t[r])||void 0===d?void 0:d.color;e&&(c=e)}if(0===n&&s||0===o&&a)return"default"!==c?{...(0,O.fi)(c,i),fontWeight:L.Z.fontWeight.medium}:{background:i.tableHeaderRowColumnBackground,fontWeight:L.Z.fontWeight.medium};return(0,O.fi)(c,i)}({columnFormat:R,rowIndex:d,columnIndex:l,headerColumn:M,headerRow:P,columnID:s,blockColor:A,theme:e}),r=w.table_block_column_format;return{cell:{...o,border:`${He}px solid ${e.tableDividerColor}`,position:"relative",verticalAlign:"top",textAlign:"start",minWidth:(null==r||null===(t=r[s])||void 0===t?void 0:t.width)??120,maxWidth:(null==r||null===(n=r[s])||void 0===n?void 0:n.width)??240,minHeight:32},contents:{width:"100%",height:"100%",...o},text:{padding:"7px 9px",backgroundColor:"transparent",fontSize:14,lineHeight:"20px"}}}),[A,R,s,l,w.table_block_column_format,M,P,d]),{isColumnSelected:V,isRowSelected:N}=(0,r.VK)((()=>h?{isColumnSelected:T.u({selection:h,columnIndex:l,simpleTableStore:c}),isRowSelected:T.Ax({selection:h,rowIndex:d,simpleTableStore:c})}:{isColumnSelected:!1,isRowSelected:!1}),[l,d,h,c]),K=(0,te.jsxs)(te.Fragment,{children:[I&&(0,te.jsx)("div",{style:F.contents}),(0,te.jsxs)("div",{className:_.Iiy,style:{visibility:I?"hidden":void 0},children:[u&&0===d&&b&&(0,te.jsx)(Ke,{index:l,type:"column",simpleTableStore:c,isSelected:V,id:s,format:p,rowStore:u}),u&&0===l&&b&&(0,te.jsx)(Ke,{index:d,type:"row",simpleTableStore:c,isSelected:N,id:u.id,format:p,rowStore:u}),k?(0,te.jsx)(we.Z,{ref:n,disabled:m,store:k,disableSlashCommands:!0,onClick:t=>{const{rowIndex:n,columnIndex:o,simpleTableStore:r,disabled:i,canEdit:a}=e;i||a&&t.shiftKey&&C.m6({environment:y,rowIndex:n,columnIndex:o,simpleTableStore:r})},onEnter:t=>{var o;if(t.preventDefault(),null===(o=n.current)||void 0===o||!o.isComposing())if(v.isMobile){const{disabled:t,canEdit:n}=e;if(t||!n)return;const o=Te.default.state;if("editing"===o.mode){const e="default";j.createAndCommit({userAction:"SimpleTableCell.mobileEnter",environment:y,perform:t=>{Se.hJ({environment:y,editorMode:e,string:"\n",multiSelection:o.multiSelection,disableMentions:!0,disableSlashCommands:!0,disableEmojiCommands:!0,transaction:t})}})}}else{"editing"===Te.default.state.mode&&C.rS({environment:y,direction:"down",bypassExistingTextSelection:!0})}},onTab:e=>{e.preventDefault(),C.eh({environment:y,direction:"right",bypassExistingTextSelection:!0})},onUntab:e=>{e.preventDefault(),C.eh({environment:y,direction:"left",bypassExistingTextSelection:!0})},onEsc:t=>{e.disabled||(t.preventDefault(),ke.clear({environment:y}))},onCut:t=>{const{disabled:n,canEdit:o}=e;if(n||!o)return;x(t);const r="editing"===Te.default.state.mode&&Te.default.state.multiSelection;r&&!(0,Ie.iG)(r)?j.createAndCommit({userAction:"SimpleTableCell.handleCut",environment:y,perform:e=>{Se.pz({environment:y,multiSelection:r,transaction:e})}}):j.createAndCommit({userAction:"SimpleTableCell.handleCut",environment:y,perform:e=>{C.W5({environment:y,transaction:e})}})},onCopy:x,style:F.text,pasteBehavior:"inline",className:_.qnV,disableDrag:!0,legacyTransclusionParentStore:f,inPageFind:D}):(0,te.jsx)("div",{style:F.text,children:" "}),!v.isMobile&&b&&(0,te.jsx)(Be,{format:e.format,formatStore:e.formatStore,columnId:e.columnID,columnIndex:l,columnID:s,simpleTableStore:c,getWidth:()=>{var e;return(null===(e=t.current)||void 0===e?void 0:e.getBoundingClientRect().width)||0},onTemporaryResize:t=>{const{formatStore:n}=e;n.setTemporaryFormat({...w,table_block_column_format:{...p.table_block_column_format,[s]:t}})},onAccept:()=>{const{simpleTableStore:t,formatStore:n}=e,o=w.table_block_column_format;j.createAndCommit({userAction:"SimpleTableCell.handleColumnResizeAccept",environment:y,perform:e=>{C.LB({tableBlockColumnFormat:o||{},simpleTableStore:t,transaction:e})}}),n.setTemporaryFormat(void 0)},onCancel:()=>{const{formatStore:t}=e;t.setTemporaryFormat(void 0)}}),!v.isMobile&&b&&(0,te.jsx)(Fe,{simpleTableStore:c,rowIndex:d,columnIndex:l})]})]}),z={style:F.cell,onClick:t=>{const{columnIndex:n,simpleTableStore:o,rowIndex:r,disabled:i,canEdit:a}=e;i||(0,S.ZP)({event:t,context:S.Af.EditorClick,callback:()=>{a&&t.shiftKey?C.m6({environment:y,rowIndex:r,columnIndex:n,simpleTableStore:o}):a?C.fT({environment:y,rowIndex:r,columnIndex:n,simpleTableStore:o}):C.n5({environment:y,rowIndex:r,columnIndex:n,simpleTableStore:o})}})},onContextMenu:t=>{const{columnIndex:n,simpleTableStore:o,rowIndex:r,disabled:i}=e;i||(0,S.ZP)({event:t,context:S.Af.EditorContextMenu,callback:()=>{C.n5({environment:y,rowIndex:r,columnIndex:n,simpleTableStore:o})}})},onMouseEnter:()=>{const{rowIndex:t,columnIndex:n,simpleTableStore:o,disabled:r}=e;r||C.Hf({x:n,y:t,simpleTableStore:o})},onMouseLeave:()=>{e.disabled||C.I9()}};return P&&0===d?(0,te.jsx)("th",{ref:t,scope:"col",...z,children:K}):M&&0===l?(0,te.jsx)("th",{ref:t,scope:"row",...z,children:K}):(0,te.jsx)("td",{ref:t,...z,children:K})}function We(e,t){let{columnOrder:n,store:i,rowIndex:a,rowStore:s,selection:l,formatStore:c,disabled:d}=e;const u=(0,o.useRef)(null),p=(0,ve.PE)(i,d),m=(0,r.VK)((()=>i.getFormat()),[i]),g=(0,r.VK)((()=>Boolean(s)&&s.getParentId()!==i.id),[s,i.id]),f=(0,r.VK)((()=>(0,he.aX)()&&g?{border:"3px dashed deeppink"}:{}),[g]);return(0,ve.ez)(i,t,(0,o.useMemo)((()=>({renderedType:"table",getNode:()=>u.current,getBlockStore:()=>i})),[i]),n?(0,te.jsx)("tr",{className:_.M_0,style:f,ref:u,children:n.map(((e,t)=>(0,te.jsx)(Ge,{disabled:d,canEdit:p,columnID:e,columnIndex:t,rowIndex:a,store:s,simpleTableStore:i,selection:l,formatStore:c,format:m,legacyTransclusionParentStore:g?i:void 0},e)))}):null)}const $e=o.memo(o.forwardRef(We),i.Z);var Ye=n(237524),Qe=n(508958),Je=n(155367),Xe=n(524677),et=n(203386),tt=n(152689);function nt(e){const{store:t,children:n,selection:r,disabled:i,canEdit:a}=e,s=(0,Z.O7)(),l=(0,o.useCallback)((e=>{e.preventDefault&&e.preventDefault(),C.eh({environment:s,direction:"left",bypassExistingTextSelection:!1,expandSelection:e.shiftKey})}),[s]),c=(0,o.useCallback)((e=>{e.preventDefault&&e.preventDefault(),C.eh({environment:s,direction:"right",bypassExistingTextSelection:!1,expandSelection:e.shiftKey})}),[s]),d=(0,o.useCallback)((e=>{e.preventDefault&&e.preventDefault(),C.rS({environment:s,direction:"up",bypassExistingTextSelection:!1,expandSelection:e.shiftKey})}),[s]),u=(0,o.useCallback)((e=>{e.preventDefault&&e.preventDefault(),C.rS({environment:s,direction:"down",bypassExistingTextSelection:!1,expandSelection:e.shiftKey})}),[s]),p=(0,o.useCallback)((e=>{e.preventDefault&&e.preventDefault();const t=E.Z.state;if(t.isActive){const{selection:e,simpleTableStore:n}=t;T.ok(e)&&C.fT({environment:s,rowIndex:e.start.row,columnIndex:e.start.col,simpleTableStore:n})}}),[s]),m=(0,o.useCallback)((e=>{var t;null===(t=e.preventDefault)||void 0===t||t.call(e);const n=E.Z.state;if(!n.isActive)return;const{selection:o,simpleTableStore:r}=n;T.ok(o)&&o.end.row===T.bm(r)-1&&j.createAndCommit({userAction:"SimpleTableSelectionOverlay.handleShiftEnter",environment:s,perform:e=>{const t=o.end.row+1;C.iz({environment:s,transaction:e,index:t,simpleTableStore:r}),C.fT({environment:s,rowIndex:t,columnIndex:o.start.col,simpleTableStore:r})}})}),[s]),g=(0,o.useCallback)((e=>{e.preventDefault&&e.preventDefault();const n=E.Z.state;if(!n.isActive)return;const{selection:o,simpleTableStore:r}=n;T.UQ()?ke.clear({environment:s}):T.ok(o)?C.pj({environment:s,index:o.start.row,simpleTableStore:r}):(C.MO(),Xe.Z5({environment:s,stores:[t]}))}),[s,t]),f=(0,o.useCallback)((e=>{j.createAndCommit({userAction:"SimpleTableSelectionOverlay.handleDelete",environment:s,perform:e=>{C.fn({environment:s,transaction:e})}})}),[s]),h=(0,o.useCallback)((e=>{!e.key||e.metaKey||e.ctrlKey||(le.Z.setKeyboardMode(!0),j.createAndCommit({userAction:"SimpleTableSelectionOverlay.handleKeypress",environment:s,perform:t=>{C.Fn({environment:s,editorMode:"default",transaction:t,key:e.key})}}))}),[s]),{value:v}=(0,Ce.XJ)(xe.FF.exportJsxRenderer),y=(0,o.useCallback)((e=>{const t=E.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,r=T.h4(o);r&&_e.qn({environment:s,simpleTableStore:o,selection:n,currentRows:o.getContentStores(),columnOrder:r,event:e,exportJsxRenderer:v})}),[s,v]),b=(0,o.useCallback)((e=>{!i&&a&&(y(e),j.createAndCommit({userAction:"SimpleTableSelectionOverlay.handleCut",environment:s,perform:e=>{C.WO({environment:s,transaction:e})}}))}),[s,i,a,y]),{value:_}=(0,Ce.XJ)(xe.FF.markdownLinkifyIt),{value:S}=(0,Ce.XJ)(xe.FF.tinyMceMicrosoftWordPasteFilter),k=(0,o.useCallback)((e=>{if(i||!a)return;const t=E.Z.state;if(!t.isActive)return;const{selection:n,simpleTableStore:o}=t,r=T.h4(o);r&&j.createAndCommit({userAction:"SimpleTableSelectionOverlay.handlePaste",environment:s,perform:t=>{_e.j0({environment:s,simpleTableStore:o,selection:n,currentRows:o.getContentStores(),columnOrder:r,event:e,transaction:t,markdownLinkifyIt:_,tinyMceMicrosoftWordPasteFilter:S})}})}),[s,i,a,_,S]),w=(0,o.useCallback)((e=>{e.preventDefault(),j.createAndCommit({userAction:"SimpleTableSelectionOverlay.handleDuplicate",environment:s,perform:e=>{C.Or({environment:s,transaction:e})}})}),[s]),x=(0,o.useCallback)(((e,n)=>{!i&&a&&(n.preventDefault(),j.createAndCommit({userAction:"SimpleTableSelectionOverlay.handleAnnotation",environment:s,perform:n=>{C.Iu({environment:s,editorMode:"default",simpleTableStore:t,annotation:e,transaction:n})}}))}),[s,i,a,t]),I=(0,o.useCallback)((e=>x(["h",tt.Z.state.color],e)),[x]),M=(0,o.useCallback)((e=>x(["b"],e)),[x]),P=(0,o.useCallback)((e=>x(["i"],e)),[x]),A=(0,o.useCallback)((e=>x(["s"],e)),[x]),R=(0,o.useCallback)((e=>x(["_"],e)),[x]),D=(0,o.useCallback)((e=>x(["c"],e)),[x]);return(0,te.jsx)(et.Z,{debugName:"SimpleTableKeyboardArea",capture:Boolean(r)&&!i&&a,onLeft:l,onRight:c,onUntab:l,onTab:c,onUp:d,onDown:u,onEnter:p,onShiftEnter:m,onEsc:g,onDelete:f,onBackspace:f,onKeypress:h,onCut:b,onCopy:y,onPaste:k,onDuplicate:w,onToggleHighlight:I,onToggleBold:M,onToggleItalics:P,onToggleStrike:A,onToggleUnderline:R,onToggleCode:D,children:n})}var ot=n(706740),rt=n(215828),it=n(661614);const at=(0,N.defineMessages)({tooltipContent:{id:"simpleTable.resizer.dimensions",defaultMessage:"{num_columns} × {num_rows}"}});const st=function(e){const t=(0,o.useRef)(null),n=(0,Z.O7)(),{store:i,type:a,formatStore:s}=e,[l,c]=(0,o.useState)(!1),d=()=>{j.createAndCommit({userAction:"SimpleTableResizer.handleResizeClick",environment:n,perform:e=>{"row"!==a&&C.m1({count:1,simpleTableStore:i,transaction:e}),"column"!==a&&C.FV({environment:n,count:1,simpleTableStore:i,transaction:e,analyticsFrom:"resize_click"})}})},u=(0,r.VK)((()=>Boolean(T.Ts(i,a))),[i,a]),p=(0,r.VK)((()=>{const e=T.Ts(i,a);return null==e?void 0:e.tooltipOriginRect}),[i,a]),m=(0,r.VK)((()=>{const e=i.getFormat(),{temporaryFormat:t}=s.state;return(t||e).table_block_column_order}),[s,i]),g=(0,r.VK)((()=>{const t=T.Ts(e.store);return t?t.rowsDelta:0}),[e.store]),f=(0,r.VK)((()=>{const t=D.Z.state,n=T.Ts(e.store,e.type);return!le.Z.state.isKeyboardMode&&(function(e,t,n){if(!e.isActive||e.simpleTableStore!==n)return!1;const{hover:o}=e;if("cell"===o.type){const e=o.y===T.bm(n)-1,r=o.x===T.WN(n)-1;return"row"===t?e:("column"===t||e)&&r}return"resizer"===o.type&&o.resizer===t}(t,e.type,e.store)||Boolean(n))||l}),[l,e.store,e.type]),h=(0,U.yK)((e=>({button:{height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:u?e.simpleTableSelectionBorder:e.lightDividerColor},plusIcon:{width:12,height:12,fill:u?O.ZP.white:e.mediumIconColor,padding:"auto"},outer:{},inner:{display:"flex",flexDirection:"row"===a?"row":void 0,width:"100%",height:"100%",opacity:f?1:0,pointerEvents:f?void 0:"none",transition:"opacity 150ms ease 50ms"}})),[u,f,a]);return(0,te.jsx)("div",{style:dt(e.type),onFocus:e=>{const t=e.target;t instanceof HTMLElement&&(0,ot.E)(t)&&c(!0)},onBlur:()=>{c(!1)},onMouseEnter:()=>{const{store:t,type:n}=e;C.ce({simpleTableStore:t,resizer:n})},onMouseLeave:()=>{C.I9()},ref:t,children:(0,te.jsx)(Re.Z,{onDraggableDragStart:e=>{var n;e.preventDefault();const o=null===(n=t.current)||void 0===n?void 0:n.getBoundingClientRect();de.Z.setState({isActive:!0,simpleTableStore:i,resize:a,rowsDelta:0,columnsDelta:0,tooltipOriginRect:o}),s.setTemporaryFormat(i.getFormat())},onDraggableDragMove:n=>{var o;const r=T.Ts(i,a);if(!r)return;const l=null===(o=t.current)||void 0===o?void 0:o.getBoundingClientRect();if("row"!==a){const t=n.diffX>0?Math.ceil((n.diffX-30)/120):Math.floor((n.diffX+30)/120);if(t<0&&T.KA({simpleTableStore:i,lastN:Math.abs(t)}))return;de.Z.setState({...r,columnsDelta:t,tooltipOriginRect:l});const o=function(t){const{store:n}=e,o=m||[],r=T.h4(n)||[];if(t>0){const e=t-(o.length-r.length);if(e>0){const t=[...Array(e).keys()].map((e=>(0,rt.ZP)()));return[...o,...t]}return o.slice(0,o.length+e)}return r.slice(0,Math.max(1,r.length-Math.abs(t)))}(t);s.updateColumnOrder(o),C.il(o.length-1)}if("column"!==a){const e=n.diffY>0?Math.ceil((n.diffY-8)/32):Math.max(-(T.bm(i)-1),Math.floor((n.diffY+8)/32));if(e<0&&T.zi({simpleTableStore:i,lastN:Math.abs(e)}))return;de.Z.setState({...r,rowsDelta:e,tooltipOriginRect:l}),C.p2(T.bm(i)+e-1)}},onDraggableDragEnd:t=>{const o=T.WN(i);j.createAndCommit({userAction:"SimpleTableResizer.handleDragEnd",environment:n,perform:e=>{"row"!==a&&m&&(m.length>o?C.m1({count:m.length-o,simpleTableStore:i,transaction:e}):m.length<o&&C.g4({simpleTableStore:i,columnOrder:m,transaction:e})),"column"!==a&&(g>0?C.FV({environment:n,count:g,simpleTableStore:i,transaction:e,analyticsFrom:"resize_drag"}):g<0&&C.Q({numRowsToDelete:Math.abs(g),simpleTableStore:i,transaction:e}))}}),ct(e.formatStore)},onDraggableDragCancel:()=>{ct(e.formatStore)},disableVerticalEdgeScroll:!0,disableHorizontalEdgeScroll:!0,render:t=>(0,te.jsx)("div",{style:h.inner,...t,children:(0,te.jsx)(J.Z,{renderTooltip:()=>(0,te.jsx)(lt,{type:a,isResizing:u,columnOrder:m||[],rowCount:T.bm(i)+g}),placement:se.u.Bottom,delayThreshold:0,originRect:p,forceVisibleState:!0===u||void 0,render:t=>(0,te.jsx)(q.Z,{onClick:d,style:ut(!0,e.type),hoveredStyle:ut(!0,e.type),...t,children:(0,te.jsx)("div",{style:h.button,children:(0,it.R)(h.plusIcon)})})})})})})};function lt(e){const t=(0,N.useIntl)(),{type:n,isResizing:o,columnOrder:r,rowCount:i}=e,a=(0,U.yK)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"center",color:e.mediumInvertedTextColor},boldText:{color:e.regularInvertedTextColor}})),[]);if(!o){const e=e=>(0,te.jsx)("b",{style:a.boldText,children:e});return(0,te.jsxs)("div",{style:a.wrapper,children:[(0,te.jsxs)("div",{children:["row"===n&&(0,te.jsx)(N.FormattedMessage,{id:"simpleTable.resizer.tooltipRow",defaultMessage:"<b>Click</b> to add a new row",values:{b:e}}),"column"===n&&(0,te.jsx)(N.FormattedMessage,{id:"simpleTable.resizer.tooltipColumn",defaultMessage:"<b>Click</b> to add a new column",values:{b:e}}),"corner"===n&&(0,te.jsx)(N.FormattedMessage,{id:"simpleTable.resizer.tooltipCorner",defaultMessage:"<b>Click</b> to add a new row and column",values:{b:e}})]}),(0,te.jsxs)("div",{children:["row"===n&&(0,te.jsx)(N.FormattedMessage,{id:"simpleTable.resizer.tooltipSubtitleRow",defaultMessage:"<b>Drag</b> to quickly add or remove rows",values:{b:e}}),"column"===n&&(0,te.jsx)(N.FormattedMessage,{id:"simpleTable.resizer.tooltipSubtitleColumn",defaultMessage:"<b>Drag</b> to quickly add or remove columns",values:{b:e}}),"corner"===n&&(0,te.jsx)(N.FormattedMessage,{id:"simpleTable.resizer.tooltipSubtitleCorner",defaultMessage:"<b>Drag</b> to quickly add or remove rows and columns",values:{b:e}})]})]})}const s=r||[],l=t.formatMessage(at.tooltipContent,{num_columns:s.length,num_rows:i});return(0,te.jsx)("div",{children:l})}function ct(e){e.reset(),de.Z.reset()}function dt(e){const t={position:"absolute",display:"flex"};return"row"===e?{...t,flexDirection:"row",bottom:-M,left:0,right:0}:"column"===e?{...t,right:-M,top:0,bottom:0}:{...t,bottom:-M,right:-M}}function ut(e,t){const n=e?16:20,o="100%";return"column"===t?{flex:1,width:n,height:o,cursor:"col-resize",borderRadius:4,overflow:"hidden"}:"row"===t?{flex:1,width:o,height:n,cursor:"row-resize",borderRadius:4,overflow:"hidden"}:{flex:1,width:n,height:n,cursor:"nwse-resize",borderRadius:"50%",overflow:"hidden"}}const pt=9,mt=26;function gt(e){const{position:t,onDraggableDragStart:n,onDraggableDragMove:o,onDraggableDragEnd:r,onDraggableDragCancel:i}=e,a=(0,Z.Fy)().isMobile?mt:pt,s=(0,U.yK)((e=>({tapArea:{position:"absolute",top:"top-left"===t?-a/2:void 0,left:"top-left"===t?-a/2:void 0,bottom:"bottom-right"===t?-a/2:void 0,right:"bottom-right"===t?-a/2:void 0,width:a,height:a,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",pointerEvents:"auto",cursor:"nwse-resize",zIndex:10},dragHandle:{width:pt,height:pt,border:`2px solid ${O.ZP.blueWithAlpha(.57)}`,background:e.contentBackground,borderRadius:"50%"}})),[t,a]);return(0,te.jsx)(Re.Z,{allowDragWhileTextEditing:!0,onDraggableDragStart:n,onDraggableDragMove:o,onDraggableDragEnd:r,onDraggableDragCancel:i,render:e=>(0,te.jsx)("div",{...e,style:s.tapArea,children:(0,te.jsx)("div",{style:s.dragHandle})})})}const ft=function(e){const t=(0,Z.O7)(),n=(0,o.useRef)(null),i=(0,o.useRef)(void 0),{children:a,store:s,selection:l,formatStore:d,disabled:u,canEdit:p,columnOrder:m}=e,g=(0,r.VK)((()=>{const{disabled:n,canEdit:o}=e,{device:r}=t;return!(n||!o||r.isMobile)&&!(Je.ZP.state.isDragging||function(e){const t=D.Z.state;if(!t.isActive)return!1;if(t.simpleTableStore!==e)return!1;if("cell"!==t.hover.type)return!1;return t.hover.resizing}(e.store)||function(e){const t=B.Z.state;return t.isActive&&t.simpleTableStore===e}(e.store))}),[t,e]),f=(0,r.SI)((()=>{if(l&&n.current&&m)return ht({cell:l.start,tableElement:n.current,store:s,columnOrder:m})}),[m,l,s],{useDeepEqual:!0}),h=(0,r.SI)((()=>{if(l&&n.current&&m)return ht({cell:l.end,tableElement:n.current,store:s,columnOrder:m})}),[m,l,s],{useDeepEqual:!0}),v=(0,r.Kw)(f),y=(0,r.Kw)(h);(0,o.useEffect)((()=>{const e=()=>{f.enqueueRecompute(),h.enqueueRecompute()};if(n.current){const t=new MutationObserver(e);return t.observe(n.current,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),()=>t.disconnect()}}),[h,f]);const b=(0,r.VK)((()=>{const t=B.Z.state;if(!t.isActive)return;if(t.simpleTableStore!==e.store)return;if(!n.current)return;const{source:o,selectorDragPx:r,moved:i}=t;if(o.selectorStartPx===r&&!i)return;if(!o.draggedCells[0])return;const a=o.draggedCells[0].rect,s=n.current.getBoundingClientRect(),l="column"===o.type?0:(0,c.Z)(r-s.top,-8,s.height-32);return{left:"column"===o.type?(0,c.Z)(r-s.left,-a.width/3,s.width-2/3*a.width):0,top:l,draggedCells:o.draggedCells,type:o.type}}),[e.store]),_=(0,r.VK)((()=>!e.disabled&&(v&&y||b)),[b,e.disabled,y,v]);return(0,te.jsx)(nt,{store:s,selection:l,disabled:u,canEdit:p,children:(0,te.jsx)(Re.Z,{onDraggableDragStart:t=>{e.canEdit&&(t.shiftKey&&e.selection?i.current=e.selection.start:i.current=St(t.startX,t.startY,e.store))},onDraggableDragMove:n=>{if(!e.canEdit||!i.current)return;const o=i.current,r=St(n.currentX,n.currentY,e.store);(0,Ye.bp)(o,r)?C.n5({environment:t,rowIndex:o.row,columnIndex:o.col,simpleTableStore:e.store}):C.pB({environment:t,start:o,end:r,simpleTableStore:e.store})},render:e=>(0,te.jsxs)("div",{ref:n,style:{position:l||g?"relative":void 0},...e,children:[a,_&&(0,te.jsxs)("div",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[(0,te.jsx)(vt,{store:s,dragState:b,tableElement:n.current}),v&&y&&(0,te.jsx)(yt,{startRect:v,endRect:y,dragState:b,canEdit:p,selection:l,store:s})]}),g&&(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(st,{store:s,type:"column",formatStore:d},"column"),(0,te.jsx)(st,{store:s,type:"row",formatStore:d},"row"),(0,te.jsx)(st,{store:s,type:"corner",formatStore:d},"corner")]})]})})})};function ht(e){const{cell:t,tableElement:n,store:o,columnOrder:r}=e,i=o.getContentStores()[t.row],a=Me.Z.findCellsInRowFromStore(i,o,t.row),s=(l=a,c=r[t.col],null===(d=l.find((e=>e.getProps().columnID===c)))||void 0===d||null===(d=d.getNode())||void 0===d?void 0:d.getBoundingClientRect());var l,c,d;if(!s)return;const u=n.getBoundingClientRect(),p=s.top-u.top,m=s.left-u.left,g=s.width,f=function(e){return Math.max(...e.map((e=>{var t;return(null===(t=e.getNode())||void 0===t||null===(t=t.getBoundingClientRect())||void 0===t?void 0:t.height)||0})))}(a);return new DOMRect(m-2,p-2,g+4,f+4)}function vt(e){const{tableElement:t,dragState:n}=e,r=(0,o.useMemo)((()=>{const e=null==t?void 0:t.getBoundingClientRect();if(!n||!e)return null;const{draggedCells:o,type:r}=n;return o.map((t=>"column"===r?{cloned:t.cloned,rect:new DOMRect(0,t.rect.top-e.top,t.rect.width,t.rect.height)}:{cloned:t.cloned,rect:new DOMRect(t.rect.left-e.left,0,t.rect.width,t.rect.height)}))}),[n,t]);return r&&n&&t?(0,te.jsx)("div",{"data-drag-overlay":!0,style:{position:"absolute",left:n.left,top:n.top,zIndex:5},children:r.map(((e,t)=>(0,te.jsx)(Qe.Z,{element:e,opacity:.9},t)))}):null}function yt(e){const{startRect:t,endRect:n,dragState:r,selection:i,store:a}=e,s=(0,Z.O7)(),l=(0,Z.Fy)(),c=Math.min(t.left,n.left),d=Math.min(t.top,n.top),u=Math.max(t.right,n.right),p=Math.max(t.top+t.height,n.top+n.height),m=(0,o.useRef)(void 0);function g(e){if(!i)return;const{start:t,end:n}=i;m.current={col:"top-left"===e?Math.max(t.col,n.col):Math.min(t.col,n.col),row:"top-left"===e?Math.max(t.row,n.row):Math.min(t.row,n.row)}}const f=t=>{if(!m.current)return;const n=St(t.currentX,t.currentY,a);C.pB({environment:s,start:m.current,end:n,simpleTableStore:e.store})},h=(0,U.yK)((e=>({base:{position:"absolute",left:r&&"column"===r.type?r.left:c+1.5,top:r&&"row"===r.type?r.top:d+1.5,width:u-c-3,height:p-d-3},wrapper:{zIndex:r?4:2,backgroundColor:r?e.contentBackground:void 0,opacity:r?.9:void 0,boxShadow:r?e.mediumBoxShadow:void 0,borderRadius:2},inner:{border:`solid ${e.simpleTableSelectionBorder}`,borderWidth:2,borderRadius:2,zIndex:r?5:3}})),[3,r,p,u,c,d]);return t&&n?(0,te.jsxs)("div",{className:_.y4j,children:[(0,te.jsx)("div",{style:{...h.base,...h.wrapper}}),(0,te.jsx)("div",{style:{...h.base,...h.inner},children:e.canEdit&&(0,te.jsxs)(te.Fragment,{children:[!l.isMobile&&(0,te.jsx)(gt,{position:"top-left",onDraggableDragStart:()=>g("top-left"),onDraggableDragMove:f}),(0,te.jsx)(gt,{position:"bottom-right",onDraggableDragStart:()=>g("bottom-right"),onDraggableDragMove:f})]})})]}):null}function bt(e,t){const n=Me.Z.findCellsInRowFromStore(void 0,t,0).sort(((e,t)=>e.getProps().columnIndex-t.getProps().columnIndex));for(let o=0;o<n.length;o++){if(e<=n[o].getNode().getBoundingClientRect().right)return o}return n.length-1}function _t(e,t){const n=Me.Z.findCellsInColumnFromStore(t,0).sort(((e,t)=>e.getProps().rowIndex-t.getProps().rowIndex));for(let o=0;o<n.length;o++){if(e<=n[o].getNode().getBoundingClientRect().bottom)return o}return n.length-1}function St(e,t,n){return{col:bt(e,n),row:_t(t,n)}}const kt=M;class wt extends b.Z{constructor(){super(...arguments),this.storeTypes={formatStore:R},this.rootSizeObserver=new I.E,this.hoverSizeObserver=new I.E,this.nodeRef=o.createRef(),this.handleMount=e=>{e&&this.rootSizeObserver.observe(e)},this.handleHoverMount=e=>{const t=null==e?void 0:e.getNode();t&&this.hoverSizeObserver.observe(t)},this.getSelectableStyleStore=this.createComputedStore((()=>{const{device:e}=this.environment,t={width:"100%",position:"relative",alignSelf:"center"};return(e.isMobile||this.isInColumnList()||!this.isRootOrDirectChild())&&(t.maxWidth=this.numberOfCommentsStore.state?"calc(100% - 40px)":"100%"),t})),this.columnOrderStore=this.createComputedStore((()=>{const{store:e}=this.props,t=e.getFormat(),{temporaryFormat:n}=this.stores.formatStore.state;return(n||t).table_block_column_order})),this.simpleTableSelectionStore=this.createComputedStore((()=>{const e=E.Z.state,{store:t}=this.props;if(e.isActive&&e.simpleTableStore===t){var n;const o=(null===(n=this.columnOrderStore.state)||void 0===n?void 0:n.length)||T.WN(t),r=T.bm(t)+this.numTempRowsStore.state,{selection:i}=e;return{start:{col:(0,c.Z)(i.start.col,0,o-1),row:(0,c.Z)(i.start.row,0,r-1)},end:{col:(0,c.Z)(i.end.col,0,o-1),row:(0,c.Z)(i.end.row,0,r-1)},type:i.type}}}),{useDeepEqual:!0}),this.numTempRowsStore=this.createComputedStore((()=>{const e=T.Ts(this.props.store);return e?e.rowsDelta:0})),this.resizeCursorStore=this.createComputedStore((()=>{const{store:e}=this.props,t=D.Z.state;if(t.isActive&&t.simpleTableStore===e){const{hover:e}=t;if("cell"===e.type&&e.resizing)return"col-resize"}const n=T.Ts(e);if(n){if("column"===n.resize)return"col-resize";if("row"===n.resize)return"row-resize";if("corner"===n.resize)return"nwse-resize"}const o=B.Z.state;if(o.isActive&&o.simpleTableStore===e)return"grab"})),this.numberOfBlockCommentsStore=this.createComputedStore((()=>T.Xp({simpleTableStore:this.props.store,environment:this.environment,includeInline:!1})),{useDeepEqual:!0}),this.numberOfCommentsStore=this.createComputedStore((()=>T.Xp({simpleTableStore:this.props.store,environment:this.environment,includeInline:!0})),{useDeepEqual:!0})}willUnmount(){this.rootSizeObserver.destroy(),this.hoverSizeObserver.destroy()}renderPersisted(){var e,t;const{store:n,disabled:o,disableHoverMenu:r}=this.props,i=this.numberOfCommentsStore.state,a=this.numberOfBlockCommentsStore.state,s=i>0&&0===a,l=(0,te.jsx)(g.Z,{disableCommentMenu:this.props.disableCommentMenu,hideContent:this.props.hideContent,store:this.props.store,recursivelyLoadAllDiscussions:!this.marginCommentsVisibleStore.state,hideIfSidebarOrMarginCommentsVisible:s}),c=Boolean(l)&&i>0||this.isInColumnList(),d=(0,te.jsx)(h.Z,{type:x.Z.X,preventType:p.Q7(this.environment),style:{flexGrow:1},showLeftRightOverlay:!0,leftOverlayStyle:{left:c?0:-((null===(e=this.getLeftRightPadding())||void 0===e?void 0:e.paddingLeft)||0),top:8,bottom:kt},rightOverlayStyle:{top:8,bottom:kt},children:this.renderContent(c)}),m=(0,k.Fn)(this.environment),y=!o&&("comment_only"===this.props.store.getRole()||"comment"===(null===(t=this.pageContext)||void 0===t?void 0:t.publicEditModeStore.state.permission))&&this.environment.currentUser.isLoggedIn();return(0,te.jsxs)(f.p,{allowSelectionWithin:!0,style:this.getStyle(),ref:this.handleMount,onMouseDown:e=>function(e,t){const{device:n}=t;n.isMobile||(0,S.ZP)({event:e,context:S.Af.EditorMouseDown,callback:()=>{e.preventDefault(),u.AI({environment:t,target:e.target,startX:e.clientX,startY:e.clientY,showSelectionRect:!0,preventSelectStores:[],allowVerticalEdgeScroll:!0,allowHorizontalEdgeScroll:!0})}})}(e,this.environment),children:[c?(0,te.jsx)(v.Z,{store:n,shouldShowHoverMenu:!r&&(this.canEdit()||m),shouldShowCommentMenu:y,style:this.getSelectableStyleStore.state,analyticsName:"page_content",ref:this.handleHoverMount,ignoreForTocSelectionIntersection:!0,children:d}):d,l,(0,te.jsx)(fe,{disabled:o,canEdit:this.canEdit(),simpleTableStore:n,rootSizeObserver:this.rootSizeObserver,offset:c?0:this.getOffset()||0,hoverSizeObserver:this.hoverSizeObserver})]})}renderContent(e){var t;const{store:n,disabled:o,disableHoverMenu:r}=this.props,i=n.getContentStores(),a=this.columnOrderStore.state;if(!a)return;const s=this.numTempRowsStore.state,l=s<0?i.length+s:i.length,c=((0,d.$K)(this.props.showRowIds)?i.filter((e=>{var t;return null===(t=this.props.showRowIds)||void 0===t?void 0:t.includes(e.id)})):i).slice(0,l),u=this.simpleTableSelectionStore.state,{device:p}=this.environment,m=!p.isPhone,g=!o&&("comment_only"===this.props.store.getRole()||"comment"===(null===(t=this.pageContext)||void 0===t?void 0:t.publicEditModeStore.state.permission))&&this.environment.currentUser.isLoggedIn(),f=(0,te.jsx)("div",{style:{display:"flex"},children:(0,te.jsx)("div",{style:{paddingTop:8,paddingBottom:kt,paddingRight:kt},children:(0,te.jsx)(v.Z,{store:n,shouldShowHalo:!0,canSelect:!0,canDropLeft:m,canDropRight:m,canDropAbove:!1,canDropBelow:!1,aboveDropZoneMargin:4,belowDropZoneMargin:4,analyticsName:"page_content",shouldShowDropZone:!0,style:{position:"relative"},className:_.OE$,shouldShowCommentMenu:g,nodeRef:this.nodeRef??void 0,children:(0,te.jsx)(ft,{store:n,selection:u,columnOrder:a,formatStore:this.stores.formatStore,disabled:o,canEdit:this.canEdit(),children:(0,te.jsx)("table",{children:(0,te.jsxs)("tbody",{ref:this.nodeRef,children:[c.map(((e,t)=>(0,te.jsx)($e,{rowIndex:t,rowStore:e,store:n,disabled:o,columnOrder:a,selection:u,formatStore:this.stores.formatStore},e.id))),s>0&&void 0===this.props.showRowIds&&[...Array(s).keys()].map(((e,t)=>(0,te.jsx)($e,{rowIndex:T.bm(n)+t,store:n,rowStore:void 0,disabled:o,columnOrder:a,selection:u,formatStore:this.stores.formatStore},t)))]})})})})})}),h=(0,k.Fn)(this.environment);return(0,te.jsx)("div",{className:_.fOh,style:{cursor:this.resizeCursorStore.state,...e?{paddingRight:20}:this.getLeftRightPadding()},children:e?f:(0,te.jsx)(v.Z,{store:n,shouldShowCommentMenu:g,shouldShowHoverMenu:!r&&(this.canEdit()||h),style:this.getSelectableStyleStore.state,analyticsName:"page_content",ref:this.handleHoverMount,children:f})})}handleCreated(){l.default.afterNextFlush((()=>{C.fT({environment:this.environment,rowIndex:0,columnIndex:0,simpleTableStore:this.props.store})}))}getStyle(){const{store:e}=this.props;return{...this.getBlockColorStyle(),...this.props.style,position:"relative",display:"flex",...(0,m.Ks)(e)&&{width:(0,w.$3)(this.environment),position:"sticky",left:0}}}isInColumnList(){return this.context.isInColumnList??!1}getLeftRightPadding(){const{store:e}=this.props;return(0,m.Bs)({environment:this.environment,store:e,isFullScreen:!1,sizeObserver:this.rootSizeObserver})}getOffset(){var e;return null===(e=this.getLeftRightPadding())||void 0===e?void 0:e.paddingLeft}}wt.contextTypes={...s.w,...y.Ht};const xt=wt;var It=n(797511);const Ct=M,Tt=(0,o.memo)((0,o.forwardRef)((function(e,t){const{store:n,disabled:i,disableHoverMenu:a,showRowIds:s,style:l,disableCommentMenu:b,hideContent:C}=e,M=(0,Z.O7)(),{currentUser:P}=M,A=(0,Z.Fy)(),F=(0,ve.PE)(n,i),U=(0,It.l)(),V=(0,o.useContext)(y.fC.context),N=(0,r.qz)(void 0,R),L=(0,ve.Pl)(n),j=(0,o.useRef)(null),K=(0,o.useRef)(null),z=(0,o.useMemo)((()=>new I.E),[]),q=(0,o.useRef)(null),H=(0,o.useMemo)((()=>new I.E),[]);(0,o.useEffect)((()=>(K.current&&z.observe(K.current),()=>z.destroy())),[z,K]),(0,o.useEffect)((()=>{var e;const t=null===(e=q.current)||void 0===e?void 0:e.getNode();return t&&H.observe(t),()=>H.destroy()}),[H,q]);const G=(0,r.VK)((()=>T.Xp({simpleTableStore:n,environment:M,includeInline:!0})),[n,M],{useDeepEqual:!0}),W=(0,r.VK)((()=>T.Xp({simpleTableStore:n,environment:M,includeInline:!1})),[n,M],{useDeepEqual:!0}),$=(0,r.VK)((()=>{const e={width:"100%",position:"relative",alignSelf:"center"};return(A.isMobile||V||!n.isRootOrDirectChild())&&(e.maxWidth=G?"calc(100% - 40px)":"100%"),e}),[A,G,n,V]),Y=(0,r.VK)((()=>n.getFormat().block_color||"default"),[n]),Q=(0,r.VK)((()=>({...(0,O.fi)(Y,(0,O.gh)({theme:"light"})),...l,position:"relative",display:"flex",...(0,m.Ks)(n)&&{width:(0,w.$3)(M),position:"sticky",left:0}})),[n,M,l,Y]),J=(0,r.VK)((()=>{const e=n.getFormat();return(N.state.temporaryFormat||e).table_block_column_order}),[n,N]),X=(0,r.VK)((()=>{const e=T.Ts(n);return e?e.rowsDelta:0}),[n]),ee=(0,r.VK)((()=>T.bm(n)),[n]),ne=(0,r.VK)((()=>{const e=E.Z.state;if(e.isActive&&e.simpleTableStore===n){const t=(null==J?void 0:J.length)||T.WN(n),o=ee+X,{selection:{start:r,end:i,type:a}}=e;return{start:{col:(0,c.Z)(r.col,0,t-1),row:(0,c.Z)(r.row,0,o-1)},end:{col:(0,c.Z)(i.col,0,t-1),row:(0,c.Z)(i.row,0,o-1)},type:a}}}),[null==J?void 0:J.length,ee,X,n],{useDeepEqual:!0}),oe=(0,r.VK)((()=>{const e=D.Z.state;if(e.isActive&&e.simpleTableStore===n){const{hover:t}=e;if("cell"===t.type&&t.resizing)return"col-resize"}const t=T.Ts(n);if(t){if("column"===t.resize)return"col-resize";if("row"===t.resize)return"row-resize";if("corner"===t.resize)return"nwse-resize"}const o=B.Z.state;if(o.isActive&&o.simpleTableStore===n)return"grab"}),[n]),re=(0,r.VK)((()=>(0,m.Bs)({environment:M,store:n,isFullScreen:!1,sizeObserver:z})),[M,n,z]),ie=(0,r.VK)((()=>(null==re?void 0:re.paddingLeft)||0),[re]),ae=(0,r.VK)((()=>(0,k.Fn)(M)),[M]),se=(0,r.VK)((()=>!i&&("comment_only"===n.getRole()||"comment"===(null==U?void 0:U.publicEditModeStore.state.permission))&&P.isLoggedIn()),[n,i,U,P]),le=(0,r.VK)((()=>{const e=n.getContentStores(),t=X<0?e.length+X:e.length,o=(0,d.$K)(s)?e.filter((e=>null==s?void 0:s.includes(e.id))):e;return o.slice(0,t)}),[n,X,s]),ce=(0,r.VK)((()=>p.Q7(M)),[M]),de=(0,o.useCallback)((e=>{A.isMobile||(0,S.ZP)({event:e,context:S.Af.EditorMouseDown,callback:()=>{e.preventDefault(),u.AI({environment:M,target:e.target,startX:e.clientX,startY:e.clientY,showSelectionRect:!0,preventSelectStores:[],allowVerticalEdgeScroll:!0,allowHorizontalEdgeScroll:!0})}})}),[M,A.isMobile]);const ue=G>0&&0===W,pe=(0,te.jsx)(g.Z,{disableCommentMenu:b,hideContent:C,store:n,recursivelyLoadAllDiscussions:!L,hideIfSidebarOrMarginCommentsVisible:ue}),me=Boolean(pe)&&G>0||V,ge=(0,te.jsx)(h.Z,{type:x.Z.X,preventType:ce,style:{flexGrow:1},showLeftRightOverlay:!0,leftOverlayStyle:{left:me?0:-ie,top:8,bottom:Ct},rightOverlayStyle:{top:8,bottom:Ct},children:function(e){if(!J)return;const t=!A.isPhone,o=(0,te.jsx)("div",{style:{display:"flex"},children:(0,te.jsx)("div",{style:{paddingTop:8,paddingBottom:Ct,paddingRight:Ct},children:(0,te.jsx)(v.Z,{store:n,shouldShowHalo:!0,canSelect:!0,canDropLeft:t,canDropRight:t,canDropAbove:!1,canDropBelow:!1,aboveDropZoneMargin:4,belowDropZoneMargin:4,analyticsName:"page_content",shouldShowDropZone:!0,style:{position:"relative"},className:_.OE$,shouldShowCommentMenu:se,nodeRef:j,children:(0,te.jsx)(ft,{store:n,selection:ne,columnOrder:J,formatStore:N,disabled:i,canEdit:F,children:(0,te.jsx)("table",{children:(0,te.jsxs)("tbody",{ref:j,children:[le.map(((e,t)=>(0,te.jsx)($e,{rowIndex:t,rowStore:e,store:n,disabled:i,columnOrder:J,selection:ne,formatStore:N},e.id))),X>0&&void 0===s&&[...Array(X).keys()].map(((e,t)=>(0,te.jsx)($e,{rowIndex:ee+t,store:n,rowStore:void 0,disabled:i,columnOrder:J,selection:ne,formatStore:N},t)))]})})})})})});return(0,te.jsx)("div",{className:_.fOh,style:{cursor:oe,...e?{paddingRight:20}:re},children:e?o:(0,te.jsx)(v.Z,{store:n,shouldShowCommentMenu:se,shouldShowHoverMenu:!a&&(F||ae),style:$,analyticsName:"page_content",ref:q,children:o})})}(me)}),he=(0,te.jsxs)(f.p,{allowSelectionWithin:!0,style:Q,ref:K,onMouseDown:de,children:[me?(0,te.jsx)(v.Z,{store:n,shouldShowHoverMenu:!a&&(F||ae),shouldShowCommentMenu:se,style:$,analyticsName:"page_content",ref:q,ignoreForTocSelectionIntersection:!0,children:ge}):ge,pe,(0,te.jsx)(fe,{disabled:i,canEdit:F,simpleTableStore:n,rootSizeObserver:z,offset:me?0:ie,hoverSizeObserver:H})]});return(0,ve.ez)(n,t,(0,o.useMemo)((()=>({renderedType:"table",getNode:()=>K.current,getBlockStore:()=>n})),[n]),he)})),i.Z),Mt=o.memo(o.forwardRef((function(e,t){const n=(0,r.VK)((()=>a.default.checkGate({gateName:"functional_component_simple_table_block"})),[])?Tt:xt;return(0,te.jsx)(n,{ref:t,...e})})),i.Z)},84139:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(535431);class r extends o.Z{findCellsInRowFromStore(e,t,n){return this.filter((o=>{const r=o.getProps();return e?r.store===e:r.simpleTableStore===t&&r.rowIndex===n}))}findCellsInColumnFromStore(e,t){return this.filter((n=>{const o=n.getProps();return o.simpleTableStore===e&&("number"==typeof t&&o.columnIndex===t||"string"==typeof t&&o.columnID===t)}))}findCellFromTextStore(e){return this.find((t=>t.getTextStore()===e))}findCellFromElement(e,t){return this.find((n=>n.getProps().simpleTableStore===t&&n.getNode()===e))}}const i=new r},164359:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(653965);class i extends o.default{getInitialState(){return{isActive:!1}}cloneState(){return r.d9(this.state)}}const a=new i},305676:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(653965);class i extends o.default{getInitialState(){return{isActive:!1}}cloneState(){return r.d9(this.state)}}const a=new i},429574:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(653965);class i extends o.default{getInitialState(){return{isActive:!1}}cloneState(){return r.d9(this.state)}}const a=new i},363208:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(653965);class i extends o.default{getInitialState(){return{isActive:!1}}cloneState(){return r.d9(this.state)}}const a=new i},356437:(e,t,n)=>{n.d(t,{LC:()=>f,Mo:()=>p,UM:()=>u,fx:()=>m,gR:()=>d,iZ:()=>v,pZ:()=>g,pq:()=>h});n(757658);var o=n(186517),r=n(772141),i=n(421202),a=n(798165),s=n(70853),l=n(600051),c=n(206258);function d(e){const t=e.getSpaceStore();if(!t)return;const n=t.id,s=a.fJ(e);let l;const d=o.KJ(s);for(const o of d){const{from:e,permissions:a}=o;if(e.table===i.iU){if(a.find((e=>(0,r.$D)(e)))){const o=e.blockId,r=c.t1.createChildStore(t,{id:o,table:i.iU,spaceId:n});l=r;if(r.getSiteStore())return r}}}return l}function u(e){var t;const n=null===(t=d(e))||void 0===t?void 0:t.getSiteStore();if(n&&n.isDefined()){const t=null==n?void 0:n.getDomainId(),o=s.Nc(e.getSpaceStore(),t);return o?o.id:void 0}}function p(e){var t;const n=null===(t=d(e))||void 0===t?void 0:t.getSiteStore();if(n&&n.isDefined()){const t=null==n?void 0:n.getDomainId();return s.Nc(e.getSpaceStore(),t)}}function m(e){var t;const{publicPageData:n}=l.Z.state;if(!n)return!1;if(n.spaceId!==e.getSpaceId())return!0;const o=null===(t=p(e))||void 0===t?void 0:t.domain_name;return!(!o||!n.publicDomainName||n.publicDomainName===o)}function g(e,t,n,o,i){const a=i?[...i]:[];return n||a.push("search"),t&&a.push("duplicate"),r.RF(e.role)&&a.push("comment"),r.J5(e.role)&&a.push("edit"),a.push("more"),o||a.push("signUpOrLogIn"),a}function f(e,t){const n=null==e?void 0:e.getSiteStore();if(!n)return t.allow_search_engine_indexing;return void 0!==n.isSearchEngineIndexingEnabled()?n.isSearchEngineIndexingEnabled():t.allow_search_engine_indexing}function h(e){var t;const n=d(e),o=null==n?void 0:n.getSiteStore();return!!o&&(!o.isDefined()||(null===(t=o.getHeader())||void 0===t?void 0:t.hideWatermark))}function v(e){var t;const n=d(e),o=null==n?void 0:n.getSiteStore();return!!o&&(!o.isDefined()||(null===(t=o.getHeader())||void 0===t?void 0:t.hideSearch))}},426016:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{siteSettingContentType:"initial"}}}const i=new r},817856:(e,t,n)=>{n.d(t,{D:()=>s});var o=n(937850),r=n(721429),i=n(80444),a=n(269327);async function s(){let e=r.np();return e&&e.canAdmin()&&"personal_home_page"!==e.getType()||(e=await async function(){const e=i.default.state.currentSpaceStore,t=null==e?void 0:e.id;if(await Promise.race([(async()=>{await a.Z.waitUntil((()=>a.Z.getIsInitialized()))})(),o.Vs(3e3)]),a.Z.getIsInitialized()&&t){await a.Z.waitUntil((()=>Boolean(a.Z.get(t))));const e=a.Z.get(t);if(!e)return;const n=e.find((e=>e.store.canAdmin()));return null==n?void 0:n.store}}()),e}},70853:(e,t,n)=>{n.d(t,{Bk:()=>d,Co:()=>p,DY:()=>_,Lr:()=>m,Nc:()=>v,Or:()=>f,VA:()=>b,Vg:()=>h,aR:()=>g,g2:()=>u,ih:()=>y,rl:()=>S});var o=n(401800),r=n(886854),i=n(653965),a=n(95477),s=n(918514),l=n(356437),c=n(80444);function d(e){let{domainName:t,domainType:n="default"}=e;return"default"===n?`${t}${u()}`:t}function u(){return`.${a.default.publicDomainName}`}function p(e){const{spaceStore:t,domainId:n}=e;if(!t)return"";const o=v(t,n);return d(o?{domainName:o.getDomainName()||"",domainType:o.getDomainType()}:{domainName:(null==t?void 0:t.getPublicContentDomain())||"",domainType:"default"})}function m(e,t){const n=e.getSpaceStore(),r=l.Mo(e);if(r)return(0,o.P)({config:a.default,domainName:r.domain_name,isCustomHostname:"custom"===r.domain_type});{const e=null==n?void 0:n.getPublicContentDomain();if(e)return(0,o.P)({config:a.default,domainName:e,isCustomHostname:!1})}}function g(e){return t=>{if((0,s.Sr)(e)){const e=c.default.state.mainEditorCurrentBlockStore,n=null==e?void 0:e.getRecordStore(e,t);return n?m(n):void 0}}}function f(e,t){if((0,s.Sr)(e))return m(t)}function h(e){if(!e)return[];return(0,i.oA)(e.getPublicDomainIds().map((t=>e.getRecordModel({id:t,table:r.X,spaceId:e.id})))).sort(((e,t)=>{const n=null==e?void 0:e.getCreatedTime(),o=null==t?void 0:t.getCreatedTime();return n&&o?n-o:n?1:o?-1:0}))}function v(e,t){var n;if(e)return null===(n=_(e))||void 0===n?void 0:n.find((e=>e.id===t))}function y(e,t){var n;if(e)return null===(n=_(e))||void 0===n?void 0:n.find((e=>e.getDomainName()===t))}function b(e){var t;if(e)return null===(t=_(e))||void 0===t?void 0:t.find((e=>e.isDefault()))}function _(e){return e?(0,i.oA)(e.getPublicDomainIds().map((t=>e.getRecordModel({id:t,table:r.X,spaceId:e.id})))):[]}function S(e,t){var n;return null===(n=_(e))||void 0===n?void 0:n.find((e=>e.getPublicHomePage()===t))}},431559:(e,t,n)=>{n.d(t,{$t:()=>S,RL:()=>M,_P:()=>C,hb:()=>T,jC:()=>R,nZ:()=>A,pZ:()=>I,xv:()=>P});var o=n(313991),r=n(421838),i=n(250906),a=n(524677),s=n(800993),l=n(898104),c=n(210228),d=n(269783),u=n(273959),p=n(389224),m=n(95802),g=n(905162),f=n(964233),h=n(385555),v=n(319111),y=n(117431),b=n(2679),_=n(704266);const S="/",k=";",w=new Set([S,"/"]),x={"ja-JP":new Set([k])};function I(){return"ja-JP"===o.locale?k:S}function C(e){const{environment:t,textStore:n,oldSelection:a,oldTextValue:l,transaction:c,isAddMenu:u=!!(0,g.Y)("supportsNativeMobileDynamicActionBar")}=e,m=r.eeV(n.getValue()||[]),S=a.startIndex,k=m[S],I=x[o.locale]||new Set;if(!w.has(k)&&!I.has(k))return;const C=r.gPn(m,S-10,S).join("");if(/[0-9]$/.test(C[C.length-1]))return;if(C.endsWith("http:")||C.endsWith("http:/")||C.endsWith("https:")||C.endsWith("https:/"))return;if(_.Z.state.open||d.Z.state.open||v.Z.state.open||f.Z.state.open)return;if(!(0,g.Y)("supportsNativeMobileDynamicActionBar")&&t.device.isPhone)return;const T=p.get();if(!T)return;let M=p.getRect(T);M&&(h.default.checkGate({gateName:"show_slash_menu_v2"})&&(w.has(k)||I.has(k))&&(s.pe({environment:t,transaction:c,store:n,selection:{startIndex:a.endIndex,endIndex:a.endIndex+1}}),M={...M,left:M.left-11}),(0,b.tourIsActive)(b.default.state)&&"create_page_type_slash"===b.default.state.step&&y.V(),_.Z.setState({open:!0,isAddMenu:u,textStore:n,oldTextValue:l,oldSelection:a,selectionRect:M,lettersAtLastResult:0,filter:"",input:u?"":"/"}),i.V_(t))}function T(e){const{environment:t,blockStore:n}=e,o=_.Z.state;if(a.eP({environment:t,store:n}),l.setSelectionAtStart({store:n.getBlockTitleStore()}),!o.open&&!t.device.isPhone){const e=n.getBlockTitleStore(),t=m.C.getRectFromStore(n);t&&_.Z.setState({open:!0,isAddMenu:!0,textStore:e,oldTextValue:e.getValue(),oldSelection:{startIndex:0,endIndex:0},selectionRect:t,lettersAtLastResult:0,filter:"",input:""})}}function M(e){const{transaction:t,environment:n}=e,o=_.Z.state;if(o.open){const{textStore:e,oldTextValue:r,oldSelection:i}=o;s.sO({environment:n,store:e,value:r,transaction:t}),P();const c=(0,u.sQ)(e);c&&a.eP({environment:n,store:c}),l.setSelection({store:e,selection:i})}}function P(){_.Z.setState({open:!1,previousFilter:_.Z.state.open?_.Z.state.input.replace(/^\//,""):void 0})}function A(e){const{environment:t,isEsc:n}=e,o=_.Z.state;h.default.checkGate({gateName:"show_slash_menu_v2"})&&n&&o.open&&c.createAndCommit({userAction:"textActions.insertString",environment:t,perform:e=>{s.hJ({environment:t,transaction:e,store:o.textStore,string:o.input,selection:o.oldSelection,disableSlashCommands:!1,disableEmojiCommands:!1,disableMentions:!1,editorMode:"default"})}}),P()}function R(e){const t=_.Z.state;t.open&&_.Z.setState({...t,input:e})}},704266:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},297393:(e,t,n)=>{n.d(t,{Y3:()=>O,y6:()=>A,G$:()=>L,lR:()=>V,GF:()=>N,Q6:()=>U});n(21703),n(757658);var o=n(673360),r=n(600606),i=n(421202),a=n(280873),s=n(344381),l=n(308523),c=n(653965),d=n(401898),u=n(797448);const p={table:i.iU,recordColumnTypes:{id:a.Z.UUID,space_id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,type:a.Z.String,properties:a.Z.JSON,content:a.Z.StringArray,non_content_children:a.Z.UUIDArray,discussions:a.Z.StringArray,view_ids:a.Z.StringArray,collection_id:a.Z.UUID,permissions:a.Z.JSON,created_time:a.Z.Number,last_edited_time:a.Z.Number,copied_from:a.Z.UUID,file_ids:a.Z.StringArray,ignore_block_count:a.Z.Boolean,is_template:a.Z.Boolean,parent_id:a.Z.UUID,parent_table:a.Z.String,alive:a.Z.Boolean,moved:a.Z.JSON,format:a.Z.JSON,created_by:a.Z.UUID,last_edited_by:a.Z.UUID,created_by_table:a.Z.String,created_by_id:a.Z.UUID,last_edited_by_table:a.Z.String,last_edited_by_id:a.Z.UUID,content_classification:a.Z.String,moved_to_trash_table:a.Z.String,moved_to_trash_id:a.Z.UUID,moved_to_trash_time:a.Z.Number,deleted_from_trash_time:a.Z.Number,deleted_from_trash_table:a.Z.String,deleted_from_trash_id:a.Z.UUID},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_last_access_timestamp:a.Z.Number,meta_role:a.Z.String}};const m={table:n(606287).vF,recordColumnTypes:{id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,name:a.Z.JSON,description:a.Z.JSON,icon:a.Z.String,cover:a.Z.String,schema:a.Z.JSON,format:a.Z.JSON,parent_id:a.Z.UUID,parent_table:a.Z.String,alive:a.Z.Boolean,file_ids:a.Z.StringArray,template_pages:a.Z.StringArray,copied_from:a.Z.UUID,migrated:a.Z.Boolean,space_id:a.Z.UUID,deleted_schema:a.Z.JSON},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const g={table:n(213493).np,recordColumnTypes:{id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,type:a.Z.String,name:a.Z.String,page_sort:a.Z.UUIDArray,parent_id:a.Z.UUID,parent_table:a.Z.String,alive:a.Z.Boolean,format:a.Z.JSON,query2:a.Z.JSON,space_id:a.Z.UUID},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const f={table:n(870279).x_,recordColumnTypes:{id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,parent_id:a.Z.UUID,parent_table:a.Z.String,text:a.Z.JSON,created_time:a.Z.Number,last_edited_time:a.Z.Number,alive:a.Z.Boolean,created_by_table:a.Z.String,created_by_id:a.Z.UUID,space_id:a.Z.UUID,content:a.Z.UUIDArray,reactions:a.Z.UUIDArray},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const h={table:n(933709).qF,recordColumnTypes:{id:a.Z.UUID,type:a.Z.String,version:a.Z.Number,last_version:a.Z.Number,parent_id:a.Z.UUID,parent_table:a.Z.String,context:a.Z.JSON,resolved:a.Z.Boolean,comments:a.Z.StringArray,space_id:a.Z.UUID,reactions:a.Z.UUIDArray,property_id:a.Z.String},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const v={table:n(865311).uX,recordColumnTypes:{id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,user_id:a.Z.UUID,activity_id:a.Z.UUID,received:a.Z.Boolean,read:a.Z.Boolean,visited:a.Z.Boolean,emailed:a.Z.Boolean,invalid:a.Z.Boolean,space_id:a.Z.UUID,navigable_block_id:a.Z.UUID,collection_id:a.Z.UUID,discussion_id:a.Z.UUID,type:a.Z.String,end_time:a.Z.String,channel:a.Z.String,archived_at:a.Z.Number},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const y={table:n(519889).KJ,recordColumnTypes:{id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,email:a.Z.String,given_name:a.Z.String,family_name:a.Z.String,profile_photo:a.Z.String,onboarding_completed:a.Z.Boolean,mobile_onboarding_completed:a.Z.Boolean,clipper_onboarding_completed:a.Z.Boolean,reverify:a.Z.Boolean,name:a.Z.String,is_banned:a.Z.Boolean,suspended_time:a.Z.Number},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const b={table:n(480396).yo,recordColumnTypes:{id:a.Z.UUID,space_id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,created_time:a.Z.Number,parent_id:a.Z.UUID,parent_table:a.Z.String,icon:a.Z.String,actors:a.Z.JSON},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const _={table:n(307591).Py,recordColumnTypes:{id:a.Z.String,space_id:a.Z.UUID,space_permission_group_id:a.Z.UUID,user_id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,removed_at:a.Z.Number},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const S={table:n(591937).GQ,recordColumnTypes:{id:a.Z.String,version:a.Z.Number,last_version:a.Z.Number,name:a.Z.String,icon:a.Z.String,space_id:a.Z.UUID,group_id:a.Z.UUID,created_by_id:a.Z.UUID,created_by_table:a.Z.String,created_at:a.Z.Number,last_edited_by_table:a.Z.String,last_edited_by_id:a.Z.UUID,last_edited_at:a.Z.Number,deleted_at:a.Z.Number},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const k={table:n(475246).bx,recordColumnTypes:{id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,name:a.Z.String,permissions:a.Z.JSON,permission_groups:a.Z.JSON,email_domains:a.Z.StringArray,pages:a.Z.StringArray,icon:a.Z.String,disable_public_access:a.Z.Boolean,disable_public_access_requests:a.Z.Boolean,disable_guests:a.Z.Boolean,disable_move_to_space:a.Z.Boolean,disable_export:a.Z.Boolean,disable_space_page_edits:a.Z.Boolean,beta_enabled:a.Z.Boolean,created_time:a.Z.Number,last_edited_time:a.Z.Number,deleted_by:a.Z.UUID,permanently_deleted_time:a.Z.Number,created_by_table:a.Z.String,created_by_id:a.Z.UUID,last_edited_by_table:a.Z.String,last_edited_by_id:a.Z.UUID,admin_disable_public_access:a.Z.Boolean,space_pages:a.Z.UUIDArray,plan_type:a.Z.String,invite_link_enabled:a.Z.Boolean,initial_use_cases:a.Z.String,public_home_page:a.Z.String,bot_settings:a.Z.JSON,settings:a.Z.JSON,subscription_tier:a.Z.String,disable_team_creation:a.Z.Boolean,overdue_subscription:a.Z.JSON,short_id:a.Z.Number,short_id_str:a.Z.String},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const w={table:n(577858).zU,recordColumnTypes:{id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,space_id:a.Z.UUID,bookmarked_pages:a.Z.StringArray,shared_pages:a.Z.StringArray,shared_pages_manual_sort:a.Z.StringArray,visited_templates:a.Z.StringArray,sidebar_hidden_templates:a.Z.StringArray,notify_mobile:a.Z.Boolean,notify_desktop:a.Z.Boolean,notify_email:a.Z.Boolean,notify_email_always:a.Z.Boolean,created_getting_started:a.Z.Boolean,parent_id:a.Z.UUID,parent_table:a.Z.String,alive:a.Z.Boolean,created_onboarding_templates:a.Z.Boolean,private_pages:a.Z.UUIDArray,joined:a.Z.Boolean,joined_teams:a.Z.UUIDArray,settings:a.Z.JSON,ai_suggestions:a.Z.JSON,assistant_session_starters:a.Z.UUIDArray,sidebar_order:a.Z.StringArray,first_joined_space_time:a.Z.Number},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const x={table:n(429369).e0,recordColumnTypes:{id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,space_id:a.Z.UUID,name:a.Z.String,description:a.Z.String,icon:a.Z.String,created_time:a.Z.Number,created_by_table:a.Z.String,created_by_id:a.Z.UUID,last_edited_time:a.Z.Number,last_edited_by_table:a.Z.String,last_edited_by_id:a.Z.UUID,archived_by:a.Z.UUID,archived_at:a.Z.Number,team_pages:a.Z.UUIDArray,pinned_pages:a.Z.UUIDArray,parent_id:a.Z.UUID,parent_table:a.Z.String,settings:a.Z.JSON,is_default:a.Z.Boolean,membership:a.Z.JSON,permissions:a.Z.JSON},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const I={table:n(766079).dx,recordColumnTypes:{id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,space_views:a.Z.StringArray,space_view_pointers:a.Z.JSON,left_spaces:a.Z.StringArray,deleted_email:a.Z.String},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}};const C={table:n(328182).Sr,recordColumnTypes:{id:a.Z.UUID,version:a.Z.Number,last_version:a.Z.Number,settings:a.Z.JSON},metaColumnTypes:{meta_user_id:a.Z.UUID,meta_role:a.Z.String}},T=[p,k,w,I,y,g,m,x,C,v,f,h,b,S,_],M=new Set(T.map((e=>e.table))),P=Object.keys({record_table:!0,record_id:!0,record_value:!0,space_id:!0,timestamp:!0,parent_table:!0,parent_id:!0,importance:!0,user_id:!0});async function A(e,t){await(0,s.G$)({connection:e,statements:[{sql:"\n\t\t\t\tUPDATE records SET user_id = ? WHERE user_id is null\n\t\t\t\t",args:[t]}],queryName:"backfillRecordsWithUserId"})}function R(e){const t=c.vM(e.records,(e=>e.pointer.table)),n=[];return Object.entries(t).forEach((t=>{let[o,r]=t;const i=T.find((e=>e.table===o));if(!i)return;const a=(0,d.Yd)(i.recordColumnTypes),l=(0,d.Yd)(i.metaColumnTypes),u=[...a,...l];c.yo(r,Math.floor(s.mz/u.length)).forEach((t=>{const r=`(${u.join(",")})`,i=Array(t.length).fill(`(${"?, ".repeat(u.length-1)}?)`).join(",");let s;s=e.maybeStaleRecords&&u.includes("version")?`INSERT INTO ${o} ${r} VALUES ${i}`.concat("ON CONFLICT (id, meta_user_id) DO UPDATE SET").concat("\n").concat(u.map((e=>`${e} = excluded.${e}`)).join(",")).concat("\n").concat(`WHERE excluded.version > ${o}.version`):`INSERT OR REPLACE INTO ${o} ${r} VALUES ${i}`;const p=c.xH(t.map((e=>{let{value:t,timestamp:n,userId:o}=e;if(!t)return[];const r=t.value;if(!r)return[];const i=a.map((e=>function(e){if(null==e)return null;if("string"==typeof e||"number"==typeof e)return e;if("boolean"==typeof e)return e?1:0;return JSON.stringify(e)}((0,d.qg)(r,e)?r[e]:void 0))),s=l.map((e=>{switch(e){case"meta_user_id":return o;case"meta_role":return t.role;case"meta_last_access_timestamp":return n;default:throw new Error(`Unknown meta column ${e}`)}}));return i.concat(s)})));n.push({sql:s,args:p})}))})),n}function D(e){const[t,n]=c.uK(e.records,(e=>j(e))),r=R({records:t,maybeStaleRecords:e.maybeStaleRecords}),i=function(e){const{records:t,maybeStaleRecords:n}=e;return c.yo(t,Math.floor(s.mz/P.length)).map((e=>{let t=`\n\t\t\tINSERT INTO records\n\t\t\t(\n\t\t\t\trecord_table,\n\t\t\t\trecord_id,\n\t\t\t\trecord_value,\n\t\t\t\ttimestamp,\n\t\t\t\tparent_table,\n\t\t\t\tparent_id,\n\t\t\t\timportance,\n\t\t\t\tuser_id,\n\t\t\t\tspace_id\n\t\t\t)\n\t\t\tVALUES ${Array(e.length).fill("(?, ?, ?, ?, ?, ?, ?, ?, ?)").join(",")}`;return t=n?t.concat("\n\t\t\t\tON CONFLICT (record_table, record_id, user_id) DO UPDATE SET\n\t\t\t\t\trecord_value =\n\t\t\t\t\t\tCASE WHEN json_extract(excluded.record_value, '$.value.version') > json_extract(records.record_value, '$.value.version')\n\t\t\t\t\t\tTHEN excluded.record_value\n\t\t\t\t\t\tELSE records.record_value\n\t\t\t\t\t\tEND,\n\t\t\t\t\ttimestamp =\n\t\t\t\t\t\tCASE WHEN json_extract(excluded.record_value, '$.value.version') > json_extract(records.record_value, '$.value.version')\n\t\t\t\t\t\tTHEN excluded.timestamp\n\t\t\t\t\t\tELSE records.timestamp\n\t\t\t\t\t\tEND,\n\t\t\t\t\tparent_table =\n\t\t\t\t\t\tCASE WHEN json_extract(excluded.record_value, '$.value.version') > json_extract(records.record_value, '$.value.version')\n\t\t\t\t\t\tTHEN excluded.parent_table\n\t\t\t\t\t\tELSE records.parent_table\n\t\t\t\t\t\tEND,\n\t\t\t\t\tparent_id =\n\t\t\t\t\t\tCASE WHEN json_extract(excluded.record_value, '$.value.version') > json_extract(records.record_value, '$.value.version')\n\t\t\t\t\t\tTHEN excluded.parent_id\n\t\t\t\t\t\tELSE records.parent_id\n\t\t\t\t\t\tEND,\n\t\t\t\t\timportance =\n\t\t\t\t\t\tCASE WHEN json_extract(excluded.record_value, '$.value.version') > json_extract(records.record_value, '$.value.version')\n\t\t\t\t\t\tTHEN excluded.importance\n\t\t\t\t\t\tELSE records.importance\n\t\t\t\t\t\tEND,\n\t\t\t\t\tuser_id =\n\t\t\t\t\t\tCASE WHEN json_extract(excluded.record_value, '$.value.version') > json_extract(records.record_value, '$.value.version')\n\t\t\t\t\t\tTHEN excluded.user_id\n\t\t\t\t\t\tELSE excluded.user_id\n\t\t\t\t\t\tEND,\n\t\t\t\t\t-- space_id never changes.\n\t\t\t\t\tspace_id = COALESCE(records.space_id, excluded.space_id)"):t.concat("\n\t\t\t\tON CONFLICT (record_table, record_id, user_id) DO UPDATE SET\n\t\t\t\t\trecord_value = excluded.record_value,\n\t\t\t\t\ttimestamp = excluded.timestamp,\n\t\t\t\t\tparent_table = excluded.parent_table,\n\t\t\t\t\tparent_id = excluded.parent_id,\n\t\t\t\t\timportance = excluded.importance,\n\t\t\t\t\tuser_id = excluded.user_id,\n\t\t\t\t\t-- space_id never changes.\n\t\t\t\t\tspace_id = COALESCE(records.space_id, excluded.space_id)"),{sql:t,args:c.xH(e.map((e=>{let{pointer:t,value:n,timestamp:r,importance:i,userId:a}=e,l=null,c=null;return n&&n.value&&(0,o.oK)(n.value)&&(l=n.value.parent_id,c=n.value.parent_table),[t.table,t.id,(0,s.gI)(n),r,c,l,"number"==typeof i?i:null,a,t.spaceId||null]})))}}))}({records:n,maybeStaleRecords:e.maybeStaleRecords});return[...B(t),...E(n.filter((e=>M.has(e.pointer.table)))),...r,...i]}function B(e){return c.yo(e,Math.floor(s.mz/(2*e.length))).map((e=>{const t=l.v.or(e.map((e=>l.v`(records.record_id = ${e.pointer.id} AND records.user_id = ${e.userId})`)));return l.v`DELETE FROM records WHERE ${t}`.asWrite()}))}function E(e){const t=c.vM(e,(e=>e.pointer.table)),n=[];return Object.entries(t).forEach((e=>{let[t,o]=e;c.yo(o,Math.floor(s.mz/(2*o.length))).forEach((e=>{const o=l.v.or(e.map((e=>l.v`(id = ${e.pointer.id} AND meta_user_id = ${e.userId})`)));n.push(l.v`DELETE FROM ${l.v.ident(t)} WHERE ${o}`.asWrite())}))})),n}async function F(e,t){if(0===t.length)return[];const n=c.vM(t,(e=>e.pointer.table)),o=[];Object.entries(n).forEach((t=>{let[n,i]=t;const a=T.find((e=>e.table===n));if(!a)return;const l=Array(i.length).fill("(id = ? AND meta_user_id = ?)").join(" OR "),d=c.VS(i,(e=>{let{pointer:{table:t,id:n},userId:o}=e;return[n,o]}));o.push(async function(){const[t]=await(0,s.G$)({connection:e,statements:[{sql:`\n\t\t\t\tSELECT * FROM ${n}\n\t\t\t\tWHERE ${l}`,args:d,getData:!0}],queryName:"getRecordsFromSeparateTables"});return t.data.map((e=>function(e,t,n){return{pointer:r.dr.fromPointerLike({table:e,id:t.id,spaceId:t.space_id||void 0}),value:{role:t.meta_role,value:Z(t,n)},timestamp:t.meta_last_access_timestamp,importance:0,userId:t.meta_user_id}}(n,e,a)))}())}));const i=await Promise.all(o);return c.xH(i)}function Z(e,t){const n={};return(0,d.Yd)(t.recordColumnTypes).forEach((o=>{const r=t.recordColumnTypes[o];if(null!==e[o])switch(r){case a.Z.UUID:case a.Z.String:case a.Z.Number:n[o]=e[o];break;case a.Z.StringArray:case a.Z.JSON:n[o]=JSON.parse(e[o]);break;case a.Z.XML:n[o]=e[o];break;case a.Z.UUIDArray:n[o]=JSON.parse(e[o]);break;case a.Z.Boolean:n[o]=1===e[o];break;case a.Z.CIDR:n[o]=e[o];break;case a.Z.NumberArray:n[o]=JSON.parse(e[o]);break;case a.Z.Blob:n[o]=e[o];break;default:(0,d.t1)(r)}})),n}async function U(e,t){const[n,o]=c.uK(t,(e=>M.has(e.pointer.table))),i=await F(e,n),a=new Set(i.map((e=>r.P2.toKey({pointer:e.pointer,userId:e.userId})))),l=n.filter((e=>!a.has(r.P2.toKey(e)))),d=await async function(e,t){if(0===t.length)return[];const n=Array(t.length).fill("(record_table = ? AND record_id = ? AND user_id = ?)").join(" OR "),o=c.VS(t,(e=>{let{pointer:{table:t,id:n},userId:o}=e;return[t,n,o]})),[i]=await(0,s.G$)({connection:e,statements:[{sql:`\n\t\t\t\tSELECT * FROM records\n\t\t\t\tWHERE ${n}`,args:o,getData:!0}],queryName:"getRecordsFromRecordsTable"});return i.data.map((e=>({pointer:r.dr.fromPointerLike({table:e.record_table,id:e.record_id,spaceId:e.space_id||void 0}),value:JSON.parse(e.record_value),timestamp:e.timestamp,importance:"number"==typeof e.importance?e.importance:void 0,userId:e.user_id})))}(e,o.concat(l)),u=d.filter((e=>!j(e)));return i.concat(u)}async function V(e,t){const n=l.v`
  SELECT * FROM block
  WHERE parent_table = ${t.parent.table}
  AND parent_id = ${t.parent.id}
  AND meta_user_id = ${t.userId}
  `.asRead(),o=l.v`
  UPDATE block
  SET meta_last_access_timestamp = ${t.timestamp}
  WHERE parent_table = ${t.parent.table}
  AND parent_id = ${t.parent.id}
  AND meta_user_id = ${t.userId}
  `.asWrite(),[a]=await(0,s.G$)({connection:e,statements:[n,o],queryName:"getBlocksWithParent"});return a.data.map((e=>({pointer:r.dr.fromPointerLike({table:i.iU,id:e.id,spaceId:e.space_id||void 0}),value:{role:e.meta_role,value:Z(e,p)},userId:t.userId})))}async function N(e,t){const n=l.v`
    WITH RECURSIVE page_blocks AS (
      SELECT * FROM block
      WHERE id = ${t.page.id}
      AND meta_user_id = ${t.userId}

      UNION

      SELECT block.*
      FROM
        block INDEXED BY block_parent_id,
        page_blocks
      WHERE
      (
        page_blocks.id = ${t.page.id}
        OR page_blocks.type NOT IN ('page', 'toggle')
      )
      AND block.parent_table = 'block'
      AND block.parent_id = page_blocks.id
      AND block.meta_user_id = ${t.userId}
    )
    SELECT * FROM page_blocks
    `,o=await n.all(e,"getPageBlocksByParent");return 0===o.length?[]:o.map((e=>({pointer:r.dr.fromPointerLike({table:i.iU,id:e.id,spaceId:e.space_id||void 0}),value:{role:e.meta_role,value:Z(e,p)},userId:t.userId})))}async function O(e,t,n){const o=n.filter((e=>"set"===e.type&&!e.maybeStaleRecord)),r=n.filter((e=>"set"===e.type&&e.maybeStaleRecord)),a=n.filter((e=>{let{type:t}=e;return"access"===t})),c=n.filter((e=>{let{type:t}=e;return"delete"===t})),d=[],p=[];if(a.forEach((e=>{const t=e.record.pointer.table;j(e.record)?t===i.iU&&p.push(l.v`
	        UPDATE block
	        SET meta_last_access_timestamp = ${e.record.timestamp}
	        WHERE id = ${e.record.pointer.id}
	        AND meta_user_id = ${e.record.userId}
	        `.asWrite()):p.push({sql:"UPDATE records\n          SET timestamp = ?\n          WHERE record_table = ?\n          AND record_id = ?\n          AND user_id = ?",args:[e.record.timestamp,t,e.record.pointer.id,e.record.userId]})})),o.length>0||r.length>0){if(o.length>0){const e=[];for(const t of o)e.push(t.record),t.debugListeners&&d.push(t.debugListeners);p.push(...D({records:e,maybeStaleRecords:!1}))}if(r.length>0){const e=[];for(const t of r)e.push(t.record),t.debugListeners&&d.push(t.debugListeners);p.push(...D({records:e,maybeStaleRecords:!0}))}(0,u.fastCheckGate)("persistence_status_indicator")||(p.push(l.v`
			DELETE FROM records
			WHERE rowid IN (
				SELECT rowid FROM records
				ORDER BY importance DESC, timestamp DESC
				LIMIT -1
				OFFSET ${t}
			)
			`.asWrite()),p.push(l.v`
			DELETE FROM block
			WHERE rowid in (
				SELECT rowid FROM block
				ORDER BY meta_last_access_timestamp DESC
				LIMIT -1
				OFFSET ${t}
			)
			`.asWrite()))}if(c.length>0){const e=c.map((e=>e.record));p.push(...function(e){const t=E(e.filter((e=>M.has(e.pointer.table)))),n=B(e);return t.concat(n)}(e))}if(0!==p.length)try{await(0,s.G$)({connection:e,statements:p,queryName:"applyRecordCacheOperations"});for(const e of d)e.onSuccess()}catch(m){for(const e of d)e.onError();throw m}}async function L(e){await async function(e){const t=[];M.forEach((e=>{t.push(l.v`DELETE FROM ${l.v.ident(e)}`.asWrite())})),await(0,s.G$)({connection:e,statements:t,queryName:"deleteAllCachedRecordsFromSeparateTables"})}(e),await async function(e){await(0,s.sf)({connection:e,sql:"DELETE FROM records",queryName:"deleteAllCachedRecordsFromRecordsTable"})}(e)}function j(e){return M.has(e.pointer.table)&&void 0!==e.value&&void 0!==e.value.value}},825464:(e,t,n)=>{n.d(t,{u:()=>o,v:()=>r});let o=function(e){return e[e.Top=0]="Top",e[e.Bottom=1]="Bottom",e[e.Left=2]="Left",e[e.Right=3]="Right",e[e.Center=4]="Center",e}({}),r=function(e){return e[e.Start=0]="Start",e[e.Center=1]="Center",e[e.End=2]="End",e}({})},770726:(e,t,n)=>{n.d(t,{Z:()=>r});var o=function(e){return e[e.Preview=0]="Preview",e[e.Mention=1]="Mention",e[e.Link=2]="Link",e}(o||{});const r=o},434859:(e,t,n)=>{n.d(t,{Z:()=>r});var o=function(e){return e[e.All=0]="All",e[e.X=1]="X",e[e.Y=2]="Y",e[e.None=3]="None",e}(o||{});const r=o},583960:(e,t,n)=>{n.d(t,{T:()=>o,l:()=>r});const o={localLanguagePreferenceKey:"CodeBlockDefaultLanguage",localCodeWrapPreferenceKey:"CodeBlockDefaultCodeWrap",defaultLanguage:"JavaScript",defaultCodePreviewFormat:"code"},r={localSizePreferenceKey:"QuoteBlockDefaultSize"}},296198:(e,t,n)=>{n.d(t,{O:()=>o});const o=44},792303:(e,t,n)=>{function o(e,t){return{x:e.x-t.x,y:e.y-t.y}}function r(e,t){return{x:e.x+t.x,y:e.y+t.y}}function i(){return{x:0,y:0}}n.d(t,{T7:()=>o,qe:()=>r,xS:()=>i}),(0,n(292595).exposeDebugValue)("Point",{pointMinus:o,pointPlus:r,pointZero:i})},223196:(e,t,n)=>{n.d(t,{k:()=>o});let o=function(e){return e[e.Popup=0]="Popup",e[e.SlideUp=1]="SlideUp",e}({})},626765:(e,t,n)=>{n.d(t,{iL:()=>s,jn:()=>v,kK:()=>m,Kr:()=>g,dQ:()=>f,Ep:()=>c,MU:()=>y,em:()=>k,uh:()=>d,TF:()=>u,kL:()=>p,bM:()=>l});n(757658);var o=n(292595);class r{constructor(e){this.parentOf=void 0,this.sizeOf=void 0,this.parentOf=[],this.sizeOf=[],this.ensureCapacity(e)}get capacity(){return this.parentOf.length}ensureCapacity(e){if(!(e<=this.capacity))for(let t=this.parentOf.length;t<e;t++)this.parentOf[t]=t,this.sizeOf[t]=1}getNodeSize(e){return this.ensureCapacity(e+1),this.sizeOf[e]}getSets(){const e=[],t=[];for(let n=0;n<this.capacity;n++){const o=this.findRoot(n);o===n&&e.push(n),t[o]??=[],t[o].push(n)}return e.map((e=>t[e]))}unionContainingSets(e,t){return this.ensureCapacity(Math.max(e,t)+1),this.unionContainingSetsInternal(e,t)}unionContainingSetsInternal(e,t){if((e=this.findRootInternal(e))===(t=this.findRootInternal(t)))return e;const[n,o]=this.sizeOf[e]>this.sizeOf[t]?[e,t]:[t,e];return this.parentOf[o]=n,this.sizeOf[n]=this.sizeOf[n]+this.sizeOf[o],n}findRoot(e){return this.ensureCapacity(e+1),this.findRootInternal(e)}findRootInternal(e){for(;this.parentOf[e]!==e;){const t=this.parentOf[e];this.parentOf[e]=this.parentOf[this.parentOf[e]],e=t}return e}isRoot(e){return this.parentOf[e]===e}}var i=n(653965),a=n(792303);class s{static from(e){return new s(e.left,e.top,e.width,e.height)}constructor(e,t,n,o){this.x=e,this.y=t,this.width=n,this.height=o,this.top=this.height<0?this.y+this.height:this.y,this.bottom=this.height<0?this.y:this.y+this.height,this.left=this.width<0?this.x+this.width:this.x,this.right=this.width<0?this.x:this.x+this.width}toJSON(){return{...this}}}const l=new s(0,0,0,0);function c(e){return Boolean(e&&(i.hj(e.top)||i.hj(e.left)))}function d(e,t,n){return e.left<=t&&t<=e.right&&e.top<=n&&n<=e.bottom}function u(e,t){return e.left<=t.left&&e.right>=t.right}function p(e,t){return e.top<=t.top&&e.bottom>=t.bottom}function m(e,t){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)}function g(e,t){return!(e.right<=t.left||t.right<=e.left)}function f(e,t){return!(e.bottom<=t.top||t.bottom<=e.top)}function h(e,t,n){return new s(e.left+t,e.top+n,e.width,e.height)}function v(e,t){return new s(e.left-t,e.top-t,e.width+2*t,e.height+2*t)}function y(e){const t=e.top+e.height/2,n=e.left+e.width/2;return new s(n,t,0,0)}function b(e){const t=e.slice();return t.sort(((e,t)=>{const n=e.top-t.top;if(0!==n)return n;const o=e.left-t.left;if(0!==o)return o;const r=t.width-e.width;return 0!==r?r:t.height-e.height})),t}function _(e,t){const n=Math.min(e.left,t.left),o=Math.min(e.top,t.top),r=Math.max(e.right,t.right),i=Math.max(e.bottom,t.bottom);return new s(n,o,r-n,i-o)}function S(e){const t=new r(e.length),n=b(e);for(let o=0;o<n.length;o++)for(let e=o+1;e<n.length;e++)m(n[o],n[e])&&t.unionContainingSets(o,e);return b(t.getSets().map((e=>e.map((e=>n[e])).reduce(((e,t)=>_(e,t))))))}function k(e){const t=S(e);if(0===t.length)return{total:new s(0,0,0,0),rects:[]};if(1===t.length){const e=s.from(t[0]);return{total:e,rects:[{original:e,translate:(0,a.xS)(),translated:e}]}}const[n,...o]=t;let r=s.from(n);const i=[{original:n,translate:(0,a.xS)(),translated:n}];for(const s of o){if(f(n,s)){r=_(r,s),i.push({original:s,translate:(0,a.xS)(),translated:s});continue}const e={x:r.right,y:r.top},t=(0,a.T7)(e,s),o=h(s,t.x,t.y);i.push({original:s,translate:t,translated:o}),r=_(r,o)}return{total:r,rects:i}}(0,o.exposeDebugValue)("Rect",{ComparableRect:s,simplifyIntersectingRects:S,intersects:m,undoTextWrapping:k})},112252:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(653965);class i extends o.default{constructor(){super(...arguments),this.pause=()=>{this.setState({active:!1,onActive:[]})},this.resume=()=>{this.state.onActive.map((e=>e())),this.setState({active:!0,onActive:[]})}}getInitialState(){return{active:!0,onActive:[]}}whenActive(e){this.state.active?e():this.setState({...this.state,onActive:r.jj([...this.state.onActive,e])})}}const a=new i},885305:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},258455:(e,t,n)=>{n.r(t),n.d(t,{default:()=>a});var o=n(749085),r=n(307032);class i extends o.default{getInitialState(){return{isLoaded:!1,isLoggingEnabled:!1,isAmplitudeEnabled:!1,isSegmentEnabled:!1,isZendeskEnabled:!1,isIntercomEnabled:!1,intercomAppId:void 0,intercomUserHash:void 0,noIntercomUserId:!1,isSprigEnabled:!1,zendeskToken:void 0}}shouldRefresh(e){return!this.state.isLoaded||Boolean(e)!==Boolean(this.state.user_id)||Boolean(e&&this.state.user_id&&(0,r.cj)(this.state.user_id)!==(0,r.cj)(e))}}const a=new i},660606:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{}const i=new r},600051:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}waitUntilLoaded(){return this.waitUntil((()=>Boolean(this.state.publicPageData)))}}const i=new r},880148:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{}const i=new r},692425:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}getSharedPagesState(e){const{userId:t,spaceId:n}=e;let o=this.state[t];o||(o={},this.state[t]=o);return o[n]}setSharedPagesState(e){const{userId:t,spaceId:n,state:o}=e;let r=this.state[t];r||(r={},this.state[t]=r),r[n]=o,this.emit()}}const i=new r},30021:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(453809),r=n(430548);const i=new o.D({key:"appearanceSettingStorageKey",namespace:r.$p,important:!0,trackingType:"necessary"})},922756:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(749085),r=n(292595);class i extends o.default{getInitialState(){return{isModalOpen:!1,currentTab:"selectData",account:void 0,isAccountLinkingInProgress:!1,isAccountDelinkingInProgress:!1,workspaces:[],teamsAndProjects:[],selectedWorkspace:void 0,selectedProjectsAndTeamspaces:{},selectedTeamspacesAndProperties:{},importCompletedTasks:!0,teams:void 0,loadMoreClicks:0,isLoadingProjects:!1,isLoadingAsanaWorkspaces:!1,result:void 0,isComplete:!1,loggerPageId:void 0,templateCreationInProgress:!1,isFetchingAsanaAccount:!1,useSectionAsStatus:!1,choosingWorkspacesCompleted:!1,showOnboardingTour:!1}}resetImport(){const{account:e,workspaces:t}=this.getState();this.setState({...this.getInitialState(),account:e,workspaces:t})}}const a=new i,s=a;(0,r.exposeDebugValue)("AsanaImportStore",a)},521273:(e,t,n)=>{n.d(t,{Z:()=>c,g:()=>l});var o=n(749085),r=n(938823),i=n(476870),a=n(385555);class s extends o.default{getInitialState(){return new r.m9({isInitialized:!1,getEligibleGroup:()=>"control",isAiEnabled:()=>!1,isZeroRetentionEnabled:()=>!1,getCanSearchWorkspaceWithCollectionIdFilter:()=>!1,getSearchBackend(){},checkGate:()=>!1,getSubscriptionTier(){},getIsAssistantSpaceSettingEnabled:()=>!1})}getIsInitialized(){return Boolean(this.state.getIsInitialized()&&a.default.isStatsigReady())}isAiEnabled(){return this.state.isAiEnabled()}isMobileWebExperienceEnabled(){return this.modeIsNotControl()}isQnaRightSideDeeplinkEnabled(){return this.modeIsNotControl()}isEphemeralViewDatabaseQueryingEnabled(){return this.modeIsAtMost("assistant_0.3")}isDatabaseQueryingEnabled(){return this.modeIsAtMost("assistant_0.3")}isQnATooltipsVisible(e,t){if(!t||!t.isReady())return!1;if(e.isMobile)return!1;if(this.isXMLAssistantEnabled())return!1;const n=t.getSettings();return!!n&&"tooltip"===n.ai_qna_intro_onboarding_phase}shouldDisableForMobileBrowser(e){return e.isMobileBrowser&&!this.isMobileWebExperienceEnabled()}shouldShowSearchMenuItemAskAI(e){return this.modeIsNotControl()&&!this.shouldDisableForMobileBrowser(e)}isAssistantThumbsUpDownFeedbackBarActionEnabled(e){return e&&this.modeIsAtMost("assistant_0.2")}shouldShowAssistantInCorner(e){return!(e.isMobileNative&&e.isPhone)&&(this.modeIsNotControl()&&!this.shouldDisableForMobileBrowser(e))}isShowingAssistantInsteadOfHelpCenterInBottomRight(){return this.modeIsNotControl()}isShowingQNAOnMobile(){return this.modeIsNotControl()}showAiQnaOnboardingModalForBetaLaunch(){return this.modeIsNotControl()}showSearchAiFeatures(){return this.modeIsNotControl()}showRemindersToUseQnA(){return this.state.showRemindersToUseQnA()}canSeeAssistantFeaturePromotionalModal(){return this.modeIsAtMost("assistant_0.25_with_marketing")}canSeeSlackUniversalQnaAnnouncementModal(){return this.state.canSeeSlackUniversalQnaAnnouncementModal()}canSeeGoogleDriveUniversalQnaAnnouncementModal(){return this.state.canUseUniversalGoogleDriveSearchScope()}isWorkspaceLeapEligible(){return this.state.isWorkspaceLeapEligible()}showAssistantNotionAiCopy(){return this.isXMLAssistantEnabled()}isSlackQnaNotificationEnabled(){return this.state.isSlackQnaNotificationEnabled()}showAssistantOnboardingAssets(){return this.isXMLAssistantEnabled()}shouldShowAnimatedAssistantFace(e){return e.isMobile?this.modeIsAtMost("development"):this.modeIsAtMost("assistant_0.25_with_marketing")}shouldShowAssistantFace(){return this.modeIsAtMost("assistant_0.25_with_marketing")}shouldShowGroupedEdits(e){return this.modeIsAtMost("assistant_0.2")&&!e.isMobile}shouldEnablePageTitleDiffs(e){return this.modeIsAtMost("assistant_0.2")&&!e.isMobile}canShowWebSearchScope(){return this.modeIsAtMost("development")&&a.default.checkGate({gateName:"ai_assistant_universal_qna_web_search"})}isQuizSkillModeEnabled(){return this.modeIsAtMost("assistant_0.3")}shouldUseMarkdown(){return a.default.checkGate({gateName:"ai_assistant_markdown"})}isAssistantTutorialEnabledForUser(){return this.modeIsAtMost("development")}isAssistantSummarizeThisPageEnabledForUser(){return this.state.isAssistantSummarizeThisPageEnabledForUser()}isQnaAbandonedSearchReminderEnabledForUser(){if(!this.modeIsNotControl())return!1;const e=a.default.getConfigKey("qna_ai_reminders","abandonedSearchReminderProbability");return(0,i.aw)(e)&&"on"===a.default.getEligibleGroup({experimentId:"qna_abandoned_search_reminders",defaultGroup:"unassigned"})}isInPageFindQnaOptionEnabledForUser(){return this.modeIsNotControl()}isXMLAssistantEnabled(){return this.state.isXMLAssistantEnabled()}isAttachmentUploadEnabledForUser(){return this.state.isAttachmentUploadEnabledForUser()}getNamespace(){return this.state.getNamespace()}isFullPageAssistantChatEnabled(e){return this.modeIsAtMost("assistant_0.25")&&!e.isMobile}isFullPageAssistantInStartOptions(){return this.modeIsAtMost("assistant_0.25")}isAssistantInWriterEnabled(){return this.modeIsAtMost("assistant_0.25")}isWebSearchEnabled(){return a.default.checkGate({gateName:"ai_assistant_universal_qna_web_search"})&&this.modeIsAtMost("development")}isAssistantInitialSuggestionsEnabled(){return!1}isAssistantFollowupSuggestionsEnabled(){return!1}showAiSearchQueryRecommendationTreatment(e){const{disableExposureLogging:t}=e,n=a.default.getEligibleGroup({experimentId:"ai_search_query_expansion",disableExposureLogging:t});return n||"control"}showSearchDebugTools(){return this.modeIsAtMost("development")}showsLimitedQnaLabel(){return"control"!==a.default.getEligibleGroup({experimentId:"qna_vectorless_enabled",defaultGroup:"control"})&&a.default.checkGate({gateName:"show_limited_qna_label"})&&this.isLimitedQnaMode()}isLimitedQnaMode(){return"limited_qna"===this.state.getSearchBackend()}isParameterizationAndEmptyStateEnabled(){return this.modeIsAtMost("assistant_0.25")&&a.default.checkGate({gateName:"0524_assistant_empty_state"})}isRichTextMenuSuggestionEnabled(){return this.isAssistantInWriterEnabled()}isBottomBarSuggestionsEnabled(){return this.isAssistantInWriterEnabled()}isNewFindInExperienceEnabled(){return this.state.isNewFindInExperienceEnabled()}isMoveToCornerEnabled(){return this.state.isMoveToCornerEnabled()}canShowUniversalSearchScopes(){return this.state.canUseUniversalSearchScopes()}canUseMaybeNotionHelpSearchArg(){return this.state.canUseMaybeNotionHelpSearchArg()}isGoogleDriveQnaEnabled(){return this.state.isGoogleDriveQnaEnabled()}isMarketPlaceExpEnabled(){return this.state.isMarketPlaceExpEnabled()}isGoogleDriveDelayedIngestionEnabled(){return this.state.isGoogleDriveDelayedIngestionEnabled()}canShowUniversalGoogleDriveSearchScope(){return this.state.canUseUniversalGoogleDriveSearchScope()}canUseUniversalGithubSearchScope(){return this.state.canUseUniversalGithubSearchScope()}shouldShowCollectionViewAiButton(e){let{device:t,isLeapEnabled:n}=e;return!t.isMobile&&(!!this.isAiEnabled()&&(!!this.modeIsAtMost("development")||!!n&&a.default.checkGate({gateName:"collection_view_ai_button"})))}canShowHelpdocsScope(){return a.default.checkGate({gateName:"ai_assistant_helpdocs_scoped_search"})}sessionStartersEnabledInChat(){return!1}getMode(){return this.state.getMode()}isMode(e){return this.state.isMode(e)}modeIsAtMost(e){return this.state.modeIsAtMost(e)}modeIsNotControl(){return this.state.modeIsNotControl()}}function l(){return a.default.checkGate({gateName:"ai_assistant_simplified_writer_routing"})}const c=new s},62740:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(749085),r=n(292595),i=n(442092);class a extends o.default{getInitialState(){return{edits:[],hoveredEditId:void 0}}getHoveredEdit(){if(this.state.hoveredEditId)return i.Z.getEditById(this.state.hoveredEditId)}}const s=new a,l=s;(0,r.exposeDebugValue)("AssistantHoverStore",s)},728495:(e,t,n)=>{n.d(t,{d:()=>a});var o=n(749085),r=n(292595);class i extends o.default{getInitialState(){return{open:!1,currentView:"chat",from:void 0}}}const a=new i;(0,r.exposeDebugValue)("AssistantMenuStore",a)},798180:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});n(21703);var o=n(749085),r=n(241154),i=n(292595);const a=10*n(619584).hM;class s extends o.default{constructor(){super(...arguments),this.nextSessionId=void 0}getInitialState(){return{activeAiSessionId:void 0,sessions:{},lastSessionInitializedUnixEpochTime:Date.now()}}clearAllSessions(){this.reset()}getActiveSessionId(){return this.state.activeAiSessionId}getNextSessionId(){return this.nextSessionId||(this.nextSessionId=(0,r.Oy)()),this.nextSessionId}getNextSessionIdAndIncrement(){const e=this.getNextSessionId();return this.nextSessionId=(0,r.Oy)(),e}getActiveSession(){const e=this.state.activeAiSessionId;if(e)return this.state.sessions[e]}getActiveAssistantConfigurationStore(){var e;return null===(e=this.getActiveSession())||void 0===e?void 0:e.assistantConfigurationStore}getActiveAssistantConfigurationState(){var e;return null===(e=this.getActiveAssistantConfigurationStore())||void 0===e?void 0:e.state}getSessionContext(e){return this.state.sessions[e]}getSessionContextOrThrow(e){const t=this.getSessionContext(e);if(!t)throw new Error("No assistant context for given session");return t}setActiveSessionId(e){this.update((t=>({...t,activeAiSessionId:e})))}setNewActiveSession(e){const{sessionId:t,context:n}=e;this.update((e=>({...e,activeAiSessionId:t,sessions:{...e.sessions,[t]:n},lastSessionInitializedUnixEpochTime:Date.now()})))}addNewSession(e){const{sessionId:t,context:n}=e;this.update((e=>({...e,sessions:{...e.sessions,[t]:n}})))}endCurrentSession(){this.update((e=>({...e,activeAiSessionId:void 0})))}setLastSessionInitializedUnixEpochTime(){this.update((e=>({...e,lastSessionInitializedUnixEpochTime:Date.now()})))}wasActiveSessionLastOpenedOutsideOfHistorySavedWindow(){const e=this.state.lastSessionInitializedUnixEpochTime;return!e||Date.now()-e>=a}}const l=new s,c=l;(0,i.exposeDebugValue)("AssistantRegistryStore",l),(0,i.exposeDebugValue)("getTranscript",(()=>{var e;const t=(null===(e=l.getActiveSession())||void 0===e?void 0:e.evaluator.getTranscript())??[];return JSON.stringify(t)}))},308297:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{banners:[]}}}const i=r},194160:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(730120),r=n(292595),i=n(464793);const a=new(n(551444).q)((e=>{let{spaceId:t}=e;return t}),(async(e,t)=>{var r,i;let{spaceId:a}=t;const s=await Promise.resolve().then(n.bind(n,21359)),l=await s.getBillingData(e,{spaceId:a});if("success"!==l.type)return;const d=function(e){var t,n,r,i,a;e.now=o.ou.fromISO(e.now),null!==(t=e.subscription)&&void 0!==t&&t.trialEnd&&(e.subscription.trialEnd=o.ou.fromISO(null===(i=e.subscription)||void 0===i?void 0:i.trialEnd));null!==(n=e.subscription)&&void 0!==n&&n.currentPeriodEnd&&(e.subscription.currentPeriodEnd=o.ou.fromISO(e.subscription.currentPeriodEnd));null!==(r=e.subscription)&&void 0!==r&&null!==(r=r.pending)&&void 0!==r&&r.startDate&&(e.subscription.pending.startDate=o.ou.fromISO(null===(a=e.subscription)||void 0===a||null===(a=a.pending)||void 0===a?void 0:a.startDate));e.invoices&&(e.invoices=e.invoices.map((e=>({...e,createdAt:o.ou.fromISO(e.createdAt)}))));return e}(l.data.billingData);return null!==(r=d.subscription)&&void 0!==r&&r.items&&(d.subscription.items=c(d.subscription.items)),null!==(i=d.subscription)&&void 0!==i&&null!==(i=i.pending)&&void 0!==i&&i.items&&(d.subscription.pending.items=c(d.subscription.pending.items)),d}));r.exposeDebugValue("BillingDataStore",a);const s=a;function l(e){const t=e.price.unitAmount.amount,n=e.price.unitAmount.currencyValue.currencyCode;return new i.tA({external_id:e.price.externalId,product:e.price.product,billing_interval:e.price.billingInterval,unit_amount:t,currency:n,state:e.price.state,regions:e.price.regions})}function c(e){return e.map((e=>({...e,price:l(e)})))}},524229:(e,t,n)=>{n.d(t,{Z:()=>u,u:()=>l});var o=n(749085),r=n(292595),i=n(849427),a=n(626765),s=n(80444);let l=function(e){return e[e.Open=0]="Open",e[e.Resolved=1]="Resolved",e[e.NewThread=2]="NewThread",e}({});class c extends o.default{getInitialState(){return{open:!1,rect:a.bM,recursivelyLoadAllDiscussions:!1}}getFramePageFirstSelectedDiscussionId(){var e,t;return this.state.open&&(i.Z.isBlockInFrame(this.state.blockStore)||this.state.blockStore.id===(null===(e=s.default.state.mainEditorCurrentBlockStore)||void 0===e?void 0:e.id))?null===(t=this.state.discussionIds)||void 0===t?void 0:t[0]:void 0}addNewDiscussionId(e){this.state.open&&this.setState({...this.state,discussionIds:[...this.state.discussionIds??[],e],keepNewDiscussionAtBottom:!0})}}const d=new c;(0,r.exposeDebugValue)("BlockDiscussionMenuStore",d);const u=d},708949:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isActive:!1}}}const i=new r},561207:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},458484:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isOpen:!1}}}const i=r},568859:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{dragging:!1}}}const i=r},61766:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=r},279827:(e,t,n)=>{n.r(t),n.d(t,{CalloutGroupStore:()=>i,default:()=>s});var o=n(749085),r=n(79571);class i extends o.default{getInitialState(){return new Set}add(e){this.setState(new Set(this.state).add(e))}delete(e){const t=new Set(this.state);t.delete(e),this.setState(t)}has(e){return this.state.has(e)}clear(){this.setState(new Set)}}class a extends o.default{getInitialState(){return{placementStores:{Modal:new i,SidebarFooter:new i,Tooltip:new i},forcedCalloutsStore:new i}}isVisible(e){const t=(0,r.QN)(e);return this.state.placementStores[t].has(e)}isForced(e){return this.state.forcedCalloutsStore.has(e)}getCalloutsForPlacement(e){return Array.from(this.state.placementStores[e].state)}}const s=new a},304926:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n(749085).default.createValue(0)},487143:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{active:!1,stringValue:""}}}const i=new r},925489:(e,t,n)=>{n.d(t,{Z:()=>ie});n(757658);var o=n(14577),r=n(749085),i=n(371663),a=n(541432),s=n(482545),l=n(576205),c=n(114714),d=n(399036),u=n(143690),p=n(10070),m=n(528155),g=n(933147),f=n(406695),h=n(471924),v=n(396367),y=n(421202),b=n(606287),_=n(542297),S=n(531701),k=n(653965),w=n(401898),x=n(51592),I=n(123924),C=n(504430),T=n(710274);function M(e){switch(e){case"trending":case"similarUsers":case"mostVisited":case"lastEdited":case"favorites":return{title:{name:"Name",type:"title"}};case"myTasks":case"customDb":return{};default:(0,w.t1)(e)}}function P(e){let{source:t,collectionId:n}=e;const{type:o}=t;return{id:n,parent_table:y.iU,parent_id:o,version:1,alive:!0,space_id:t.spaceId,format:{},schema:M(o)}}var A=n(760310),R=n(959753),D=n(721429),B=n(368585),E=n(277181),F=n(433929),Z=n(318245),U=n(394841),V=n(385555),N=n(437598),O=n(206258);var L=n(110906),j=(n(21703),n(712139));function K(e,t,n){j.vd("collections"),j.rn(new Error("Callback waited over time limit for item to be rendered"),{from:"CollectionItemMountedCallbacks",type:e,data:{miscDataToConvertToString:{blockPointer:t,delayMs:n}}})}class z{constructor(){this.callbackMap=void 0,this.storeTimeoutMap=void 0,this.callbackMap=new WeakMap,this.storeTimeoutMap=new WeakMap}registerCallback(e,t){var n;this.callbackMap.has(e)||this.callbackMap.set(e,[]),null===(n=this.callbackMap.get(e))||void 0===n||n.push(t);const o=this.storeTimeoutMap.get(e);o&&clearTimeout(o.timeoutId);const r=window.setTimeout((()=>{this.callbackMap.has(e)&&K("TimeoutError",e.pointer,15e3)}),15e3);this.storeTimeoutMap.set(e,{timeoutId:r,registeredAt:performance.now()})}executeCallbacks(e){const t=this.callbackMap.get(e)??[],n=performance.now();for(const r of t)r();this.callbackMap.delete(e);const o=this.storeTimeoutMap.get(e);if(o){clearTimeout(o.timeoutId);const t=n-o.registeredAt;t>5e3&&K("SlowExecutionError",e.pointer,t),this.storeTimeoutMap.delete(e)}}}class q{constructor(e){this.virtualizer=void 0,this.collectionContextStore=void 0,this.collectionContextStore=e}reset(){this.virtualizer=void 0}setVirtualizer(e){this.virtualizer=e}async waitToScrollToBlock(e,t){if(!this.virtualizer)return;const n=this.collectionContextStore.groupsStore.getGroupState(e);if(!n)return;const o=n.resultsStore.state.findIndex((e=>e===t));if(!(o>=0))return new Promise((e=>{const o=r=>{if(!this.virtualizer)return n.resultsStore.removeListener(o),void e();const i=r.state.findIndex((e=>e===t));i>=0&&(this.virtualizer.scrollToIndex(i,{behavior:"smooth"}),n.resultsStore.removeListener(o),e())};n.resultsStore.addListener(o)}));this.virtualizer.scrollToIndex(o,{behavior:"smooth"})}}var H=n(855337),G=n(397004),W=n(892918),$=n(426991);class Y{constructor(e){this.supportsLongTask=void 0,this.entriesObserved=void 0,this.observer=void 0,this.observing=!1,this.supportsLongTask=PerformanceObserver.supportedEntryTypes.includes("longtask"),this.entriesObserved=[],this.observer=new PerformanceObserver((t=>{this.entriesObserved.push(...t.getEntries()),e&&e(t,this.observer)}))}observe(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.supportsLongTask&&(this.observer.observe({type:"longtask",buffered:e}),this.observing=!0)}get isObserving(){return this.observing}disconnect(){this.observer.disconnect(),this.observing=!1}takeRecords(){const e=this.entriesObserved;return this.entriesObserved=[],e}}var Q=n(849427),J=n(80444),X=n(61766);class ee extends r.default{constructor(e){super(),this.collectionContextStore=e}getInitialState(){return new Map}getGroupState(e){const t=Array.isArray(e)?e:void 0!==e?[e]:[],n=(0,c.KW)(t),i=this.state.get(n);if(i)return i;const a=function(e,t){const n=r.default.createValue(void 0,{name:"reducerResultStore"}),i=e.collectionViewBlockStore();if(!i)return;let a;t.length>0?(a=i.clone(),a.setRecordStoreUIParent(i)):a=i;const s=L.bd(e),l=new o.ZP((()=>{const e=n.state;return(e&&"results"===e.type?e.blockIds:[]).map((e=>O.G.createChildStore(a,{id:e,table:y.iU})))}),{debugName:"resultsStore"});return{groupsPointer:t,groupUiParentStore:a,reducerResultStore:n,resultsStore:l,currentLimit:r.default.createValue(s,{name:"currentLimit"}),toggleStateStore:r.default.createValue(!1,{name:"toggleStateStore"})}}(this.collectionContextStore,t);return a?(this.state.set(n,a),this.emit(),a):void 0}getAllGroupStates(){return[...this.state.values()]}anyGroupHasResults(){for(const e of this.state.values())if(e.reducerResultStore.state)return!0;return!1}anyGroupHasNonEmptyResults(){for(const t of this.state.values()){var e;if(null!==(e=t.reducerResultStore.state)&&void 0!==e&&null!==(e=e.blockIds)&&void 0!==e&&e.length)return!0}return!1}anySpecifiedGroupHasResults(e){for(const t of e){const e=this.getGroupState(t);if(null!=e&&e.reducerResultStore.state)return!0}return!1}resetAllLimits(){const e=L.bd(this.collectionContextStore);for(const t of this.state.values())t.currentLimit.setState(e)}setLimitIfGreater(e,t){const n=this.getGroupState(e),o=null==n?void 0:n.currentLimit;o&&t>o.state&&o.setState(t)}incrementLimit(e){const{isFullScreen:t,currentResultCount:n,groupsPointer:o,incrementLimitsInRelatedGroups:r}=e,i=this.collectionContextStore.collectionViewStore();if(!i)return;const a=this.getGroupState(o);if(!a)return;const s=r?[...this.state.values()].filter((e=>1===o.length?1===e.groupsPointer.length:2===o.length&&(0,c.ZH)(o[0],e.groupsPointer[0]))):[a];for(const l of s){const e=l.currentLimit,o=e.state+L.NG({collectionViewStore:i,isFullScreen:t,currentResultCount:n});e.setState(o)}}}class te extends r.default{getInitialState(){return{hasLocalUpdates:!1,blockIds:new Set}}addLocalChange(e){for(const t of e)this.state.blockIds.add(t);this.state.hasLocalUpdates=!0,this.emit()}resetWithRemote(){const e=this.getInitialState();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];e.blockIds=new Set(...n),this.setState(e)}}class ne extends r.default{getInitialState(){}isInLayoutBuilder(){var e;return"layoutBuilder"===(null===(e=this.state)||void 0===e?void 0:e.type)}currentPageInRelatedCollectionStore(){var e;return null===(e=this.state)||void 0===e?void 0:e.currentPageInRelatedCollectionStore}currentPageInRelatedCollectionId(){var e;return null===(e=this.state)||void 0===e?void 0:e.currentPageInRelatedCollectionStore.id}canEditCollectionView(){return!this.state||("layoutBuilder"===this.state.type||"pageWithLayoutModule"!==this.state.type&&("pageWithCustomizedModule"===this.state.type||void(0,w.t1)(this.state)))}type(){var e;return null===(e=this.state)||void 0===e?void 0:e.type}collectionViewModule(){var e;return null===(e=this.state)||void 0===e?void 0:e.collectionViewModule}}var oe=n(896026);class re{static getLocalViewPreferenceKey(e){return`${re.PREFERENCE_KEY_PREFIX}${e}`}constructor(e){this.contextStore=r.default.createValue(void 0,{name:"contextStore"}),this.reducersStore=r.default.createValue({},{name:"reducersStore"}),this.reducerDependencies=new Map,this.resultSetStore=new te,this.remoteResultStore=r.default.createValue(void 0,{name:"remoteResultStore"}),this.remoteErrorStore=r.default.createValue(void 0,{name:"remoteErrorStore"}),this.remoteCollectionIdsStore=r.default.createValue([],{name:"remoteCollectionIdsStore"}),this.lastRemoteRequestStore=r.default.createValue(void 0,{name:"lastRemoteRequestStore"}),this.searchOpenStore=r.default.createValue(!1,{name:"searchOpenStore"}),this.searchQueryStore=r.default.createValue("",{name:"searchQueryStore"}),this.isLoadingStore=r.default.createValue(!1,{name:"isLoadingStore"}),this.isLoadedStore=r.default.createValue(!1,{name:"isLoadedStore"}),this.didFireLoadEventsStore=r.default.createValue(!1,{name:"didFireLoadEvents"}),this.isCreatingNewChartCollectionStore=r.default.createValue(!1,{name:"isCreatingNewChartCollectionStore"}),this.loadingDetailsStore=r.default.createValue({type:"load_general"},{name:"loadingDetailsStore"}),this.wasCreatedThisSessionStore=r.default.createValue(!1,{name:"wasCreatedThisSessionStore"}),this.isFullScreenStore=r.default.createValue(!1,{name:"isFullScreenStore"}),this.isRootChildStore=r.default.createValue(!1,{name:"isRootChildStore"}),this.isInPeekRendererStore=r.default.createValue(!1,{name:"isInPeekRendererStore"}),this.relationResultsCacheStore=r.default.createValue(new Map,{name:"relationResultsCacheStore"}),this.privateRelativeVariableStore=r.default.createValue({},{name:"privateRelativeVariableStore"}),this.groupsStore=new ee(this),this.groupsLimitStore=r.default.createValue(W.XD,{name:"groupsLimitStore"}),this.boardColumnsLimitStore=r.default.createValue(W.XD,{name:"boardColumnsLimitStore"}),this.settingsStore=r.default.createValue({open:!1,stack:[]},{name:"settingsStore"}),this.filtersBarOpenStore=r.default.createValue(void 0,{name:"filtersBarOpenStore"}),this.temporaryStateStore=r.default.createValue({},{name:"temporaryStateStore"}),this.filterBarItemSettingsStoreMap=new Map,this.frozoneStore=r.default.createValue({isScrolled:!1,scrollerWidth:void 0,scrollerLeftOffset:void 0,scrollerLeftPadding:void 0,frozenIndex:void 0,tryShowHiddenFrozenColumn:!1},{name:"frozoneStore"}),this.filterBarSortSettingsStore=r.default.createValue({open:!1,stack:[]},{name:"filterBarSortSettingsStore"}),this.filterBarCombinatorFilterSettingsStore=r.default.createValue({open:!1,stack:[]},{name:"filterBarCombinatorFilterSettingsStore"}),this.filterOptionsItemSettingsStoreMap=new Map,this.filterOptionsCombinatorFilterSettingsStore=r.default.createValue({open:!1,stack:[]},{name:"filterOptionsCombinatorFilterSettingsStore"}),this.dateRangeStartStore=r.default.createValue(Date.now(),{name:"dateRangeStartStore"}),this.dateRangeEndStore=r.default.createValue(Date.now(),{name:"dateRangeEndStore"}),this.subitemExpandedStore=r.default.createValue(new Map,{name:"subitemExpandedStore"}),this.chartErrorStore=r.default.createValue(new Map,{name:"chartErrorStore"}),this.updateFreeChartsResultStore=r.default.createValue(new Map,{name:"updateFreeChartsResultStore"}),this.numberChildrenReceivedStore=r.default.createValue(0,{name:"numberChildrenReceivedStore"}),this.numberChildrenUnfurledStore=r.default.createValue(0,{name:"numberChildrenUnfurledStore"}),this.formsBaseLayoutEditorContextValueStore=r.default.createValue(void 0,{name:"formsBaseLayoutEditorContextValueStore"}),this.formsSpecificLayoutEditorContextValueStore=r.default.createValue(void 0,{name:"formsSpecificLayoutEditorContextValueStore"}),this.formShareMenuButtonPopupStore=new X.Z,this.renderEmitter=new g.Z,this.remoteRequestStoreCallback=void 0,this.localResultStoreCallback=void 0,this.updateCounter=0,this.isClientModeEnabledStore=r.default.createValue(!1,{name:"isClientModeEnabledStore"}),this.wasServerResponseFromCache=void 0,this.requestBackend=void 0,this.isViewSpecificClientModeEnabledStore=r.default.createValue(!1,{name:"isViewSpecificClientModeEnabledStore"}),this.throttleMsStore=r.default.createValue(s.m,{name:"throttleMsStore"}),this.timedOutRequestCounter=0,this.asyncAggregationStatusStore=r.default.createValue({calculating:!1,aggregation:void 0,changingType:!1},{name:"asyncAggregationStatusStore"}),this.infiniteScrollLongTaskObserver=new Y,this.visitSessionId=h.Il(),this.collectionViewModuleContextStore=new ne,this.collectionStoresStore=new o.ZP((()=>{const e=this.collectionViewBlockStore();if(!e)return[];const t=this.collectionStore();return t?[t]:this.remoteCollectionIdsStore.state.map((t=>O.NW.createChildStore(e,{table:b.vF,id:t})))}),{debugName:"collectionStoresStore"}),this.localResultStore=new o.ZP((()=>function(e,t){const{blockIds:n,hasLocalUpdates:o}=t.resultSetStore.state,r=t.collectionViewStore(),a=e.currentUser.id,s=t.remoteRequestStore.state,l=t.remoteResultStore.state;if(!r||!r.isDefined()||!s)return;const c=Date.now(),d=F.default.getIntl(),g=r.getRecordModel,f=r.getFormat(),h=r.getType(),v=r.getCollectionSource();if(!v)return;const b=t.collectionStoresStore.state,_=[];for(const i of b){const e=g(i);e&&_.push(e)}if(0===_.length)return;if(t.isLoadedStore.setState(!1),!_.some((e=>N.Z.getEditedBlocksForCollection(e.id).size>0))&&l&&!o&&(0,k.Xy)(t.lastRemoteRequestStore.state,s))return t.isLoadedStore.setState(!0),l;const S=Z.default.DO_NOT_USE_markLegacy("collections.compute_local_result_latency");let x={};switch(t.contextType){case"collectionTypedView":const e=(t.databaseType&&(0,i.uV)(d))??{},n=(0,p.jf)({schemas:[..._.map((e=>{var t;const n=null==e||null===(t=e.getFormat())||void 0===t?void 0:t.app_uri_map,o=e.getNormalizedSchema();return p.aQ.toViewSchema(o,n)})),e],onlyPropertyIds:Object.keys(e),prioritizeLooserLimitRule:!0});if(n.error)throw n.error;x=n.value;break;case"collectionVirtualView":case"collectionView":case"collectionViewBlock":case"collectionPage":case void 0:x=_[0].getNormalizedSchema();break;default:(0,w.t1)(t.contextType)}const I=u.ps(f,h,x),C=t.relativeVariableStore.state,{groupsReducerIds:T,reducerIdsWithNoGroupDependencies:M}=u.x3(s.loader.reducers,s.loader.reducerDependencies),L=V.default.getConfigKey("collection_request_settings","clientFormulaTimeoutMs"),j={pageSort:r.getPageSort(),schema:x,loader:s.loader,userId:a,userStartOfWeek:D.AK.state,currentTime:c,getRecordModel:g,intl:F.default.getIntl(),isSorted:!1,visibleProperties:I,relativeVariableResult:C,currentPageInRelatedCollection:t.collectionViewModuleContextStore.currentPageInRelatedCollectionId(),isSprintPlanningView:f.app_config_uri===i.sV,collectionSourceType:v.type,groupsReducerIds:T,reducerIdsWithNoGroupDependencies:M,formulaTimeoutMs:L,resultCache:new Map},K={...j,loader:{...s.loader,filter:void 0}},z=l?new Set(u.aW({result:l,onlyTypes:["results"]})):new Set,q=u.fk(j);for(const i of n){const e=O.G.createChildStore(r,{table:y.iU,id:i}),n=e.getAssociatedCollectionStore();if(m.Sl.hasCollections(v)&&(!n||!b.find((e=>{let{id:t}=e;return n.id===t}))))continue;const o=g(e);let a;switch(t.contextType){case"collectionVirtualView":if((0,m.nx)(v)){const e=(0,U.Ep)((0,A.Eq)(v));a=e&&R.kk5.fromCollection(P({source:v,collectionId:e}))}break;case"collectionTypedView":case"collectionView":case"collectionPage":case"collectionViewBlock":case void 0:a=n&&g(n);break;default:(0,w.t1)(t.contextType)}if(!a||!o)continue;const l={...s.loader.upwardTraversalRelation&&z.has(i)&&(0,E.uU)({block:R.kk5.fromBlock(o),collectionContextStore:t})&&!t.isClientModeEnabledStore.state?K:j,schema:(0,p.Hs)(v.type,x,a)};u.BW(o,a,l,q)}for(const i of _){const e=N.Z.getEditedBlocksForCollection(i.id),t=(0,p.Hs)(v.type,x,i);for(const o of e){if(n.has(o))continue;const e=g(O.G.createChildStore(r,{table:y.iU,id:o}));e&&u.BW(e,i,{...j,schema:t},q)}}const{result:H}=u.kk(j,q);if(t.isLoadedStore.setState(!0),"reducer"!==H.type)return;const G=B.vS(t);return Z.default.DO_NOT_USE_measureLegacy(S,{environment:e,data:G}),H}(this.environment,this)),{useDeepEqual:!0,debugName:"localResultStore"}),this.isEmptyStore=new o.ZP((()=>{var e;if(this.isLoadingStore.state||this.shouldShowSpinnerStore.state||k.xb(this.reducersStore.state))return!1;const t=this.localResultStore.state,n=this.remoteResultStore.state,o=this.wasCreatedThisSessionStore.state;if(!t&&n&&0===this.collectionStoresStore.state.length)return!0;if((0,m.nx)(null===(e=this.collectionViewStore())||void 0===e?void 0:e.getCollectionSource())&&n){if(Object.values(n.reducerResults).every((e=>"results"===e.type&&0===e.blockIds.length)))return!0}if(!t||"reducer"!==t.type||!n||"reducer"!==n.type)return!1;const r=Object.values(t.reducerResults).filter((e=>"results"===e.type)),i=Object.values(n.reducerResults).filter((e=>"results"===e.type));return!(!o&&0===i.length)&&(0!==r.length&&r.every((e=>"results"===e.type&&0===e.blockIds.length)))}),{debugName:"isEmptyStore"}),this.remoteRequestStore=new o.ZP((()=>T.oh(this.environment,this)),{debugName:"remoteRequestStore"}),this.normalizedFormatStore=new o.ZP((()=>{const e=this.collectionViewBlockStore(),t=this.collectionViewStore(),n=null==t?void 0:t.getType(),o=this.normalizedQueryStore.state,r=this.normalizedSchemaStore.state,i=null==t?void 0:t.getNormalizedFormat(r);return e&&t&&n&&o&&i?this.isInHomeWidgetStore.state?{...i,...(0,U._B)()}:i:{}}),{useDeepEqual:!0,debugName:"normalizedFormatStore"}),this.normalizedSchemaStore=new o.ZP((()=>{const e=this.contextStore.state;switch(null==e?void 0:e.type){case"collectionTypedView":const t=e.databaseType===i.Ym?(0,i.uV)(F.default.getIntl()):{};if(!this.collectionViewBlockStore())return t;const n=this.collectionStoresStore.state;if(0===n.length)return t;const o=(0,p.jf)({schemas:[...n.map(I.gD),t],onlyPropertyIds:Object.keys(t),prioritizeLooserLimitRule:!0});return o.error?t:o.value;case"collectionVirtualView":case"collectionView":case"collectionPage":case"collectionViewBlock":case void 0:const r=this.collectionStore();return r?r.getSchema():(0,_.Kc)(F.default.getIntl());default:(0,w.t1)(e)}}),{useDeepEqual:!0,debugName:"normalizedSchemaStore"}),this.normalizedDeletedSchemaStore=new o.ZP((()=>{if("collectionTypedView"===this.contextType)return{};const e=this.collectionStore();return e?e.getDeletedSchema():(0,_.Kc)(F.default.getIntl())}),{useDeepEqual:!0,debugName:"normalizedDeletedSchemaStore"}),this.normalizedQueryStore=new o.ZP((()=>{const e=this.collectionViewStore();if(e){const t=e.getType();if(t){const n=V.default.checkGate({gateName:"aggregation_improvements"}),o=this.normalizedSchemaStore.state;return(0,u.Qo)({type:t,query2:e.getQueryStore().getValue()},o,n)}}}),{useDeepEqual:!0,debugName:"normalizedQueryStore"}),this.subitemTreeStore=new o.ZP((()=>(0,E.yr)(this,this.environment.currentUser.id)),{debugName:"subitemTreeStore"}),this.shouldShowSpinnerStore=new o.ZP((()=>{var e,t,n,o;if(!this.isLoadingStore.state)return!1;const r=null===(e=this.lastRemoteRequestStore.state)||void 0===e?void 0:e.loader,i=null===(t=this.remoteRequestStore.state)||void 0===t?void 0:t.loader;if(!k.Xy(null==r?void 0:r.filter,null==i?void 0:i.filter))return!0;if(!k.Xy(null==r?void 0:r.sort,null==i?void 0:i.sort))return!0;if(!k.Xy(null==r?void 0:r.searchQuery,null==i?void 0:i.searchQuery))return!0;if(!k.Xy(null===(n=this.lastRemoteRequestStore.state)||void 0===n?void 0:n.source,null===(o=this.remoteRequestStore.state)||void 0===o?void 0:o.source))return!0;const a=(null==r?void 0:r.reducers)||{},s=(null==i?void 0:i.reducers)||{};for(const l in s){const e=s[l],t=a[l];if(!k.Xy(e,t))return!0}return!1}),{debugName:"shouldShowSpinner"}),this.shouldShowSourceStore=new o.ZP((()=>{const e=this.collectionViewBlockStore(),t=this.collectionViewStore(),n=this.collectionStore();if(!e||!t||!n)return!1;if("form_editor"===t.getType())return!1;return!(e.getCollectionViewSourceCollectionStore()&&this.isFullScreenStore.state||this.normalizedFormatStore.state.hide_linked_collection_name)}),{debugName:"shouldShowSource"}),this.isInlineViewStore=new o.ZP((()=>!this.isFullScreenStore.state),{debugName:"isInlineView"}),this.isUnlistedViewStore=new o.ZP((()=>{var e;return(null===(e=this.collectionViewStore())||void 0===e||null===(e=e.getUnlistedStatus())||void 0===e?void 0:e.isUnlisted)??!1}),{debugName:"isUnlistedView"}),this.isInHomeWidgetStore=new o.ZP((()=>{const e=this.collectionViewBlockStore();return!!e&&((0,D.YO)(this.isInPeekRendererStore.state)&&!Q.Z.isBlockInTemplate(e))}),{debugName:"isInHomeWidget"}),this.isEditableHomeCollectionStore=new o.ZP((()=>{var e;const t=null===(e=this.collectionViewBlockStore())||void 0===e?void 0:e.id;return!!t&&((0,D.qG)(t)||(0,D.X)(t))}),{debugName:"isEditableHomeCollection"}),this.isInTrashStore=new o.ZP((()=>{const e=this.collectionStore(),t=null==e?void 0:e.getParentBlockStore(),n=Boolean(null==t?void 0:t.pathIsDead()),o=this.collectionViewBlockStore(),r=Boolean(null==o?void 0:o.pathIsDead());return n||r}),{debugName:"isInTrash"}),this.permissionScopesStore=new o.ZP((()=>{const e=this.collectionStore(),t=this.collectionViewStore(),n=this.collectionViewBlockStore(),o=this.isFullScreenStore.state,r=null==e?void 0:e.getParentBlockStore(),i=Boolean(null==r?void 0:r.pathIsDead()),a=Boolean(null==n?void 0:n.pathIsDead()),s=i||a;let l=!s&&(L.eD({collectionStore:e,collectionViewBlockStore:n,checkNavigableAncestorLocked:!o})||"collectionTypedView"===this.contextType);this.collectionViewModuleContextStore.isInLayoutBuilder()&&(l=!1);const c=Boolean(null==n?void 0:n.isLocked()),d=Boolean(null==e?void 0:e.isSyncedCollection()),u=Boolean(null==e?void 0:e.isExternallyImportedAndSyncedCollection())&&"on"===V.default.getEligibleGroup({experimentId:"jira_import_and_sync",defaultGroup:"control"});if(!t||!n)return{canConfigureCollection:l,canConfigureBlock:Boolean((null==n?void 0:n.canEditCollection())&&!n.isNonEditableState()),canEditContent:Boolean((null==n?void 0:n.canEditCollection())||(null==n?void 0:n.canEditContentOnly()))&&!s,isLocked:c,isSyncedCollection:d,isExternallyImportedAndSyncedCollection:u};if(!this.collectionViewModuleContextStore.canEditCollectionView())return{canConfigureCollection:!1,canConfigureBlock:!1,canEditContent:Boolean((null==n?void 0:n.canEditCollection())||(null==n?void 0:n.canEditContentOnly()))&&!s,isLocked:c,isSyncedCollection:d,isExternallyImportedAndSyncedCollection:u};const p=!o&&n.isNavigableAncestorNonEditableState(),m=Boolean(n.inMemoryRecordCache.snapshotData),g=oe.Z.getMode(this.environment,n);if(p||m||"comment"===(null==g?void 0:g.permission)||"view"===(null==g?void 0:g.permission))return{canConfigureCollection:l,canConfigureBlock:!1,canEditContent:!1,isLocked:c,isSyncedCollection:d,isExternallyImportedAndSyncedCollection:u};return{canConfigureCollection:l,canConfigureBlock:n.canEditCollection()&&!(c||a),canEditContent:!s&&("collectionTypedView"===this.contextType||Boolean(e&&e.canEdit())),isLocked:c,isSyncedCollection:d,isExternallyImportedAndSyncedCollection:u}}),{debugName:"permissionScopes"}),this.localStateDiffStore=new o.ZP((()=>(0,G.Zh)(this,"normalized")),{useDeepEqual:!0,debugName:"localStateDiffStore"}),this.currentCombinatorFilterStore=new o.ZP((()=>{var e;const t=this.temporaryStateStore.state.combinatorFilter;return t?t.value:null===(e=this.normalizedQueryStore.state)||void 0===e?void 0:e.filter}),{useDeepEqual:!0,debugName:"currentCombinatorFilterStore"}),this.currentSubitemFormatStoreForUiDisplayStore=new o.ZP((()=>{var e,t;const n=null===(e=this.collectionViewStore())||void 0===e?void 0:e.getFormat().subitem_display_mode;if("flattened"===n||"hidden"===n)return;const o=(0,E.wf)(this),r=null===(t=this.collectionViewStore())||void 0===t?void 0:t.getType(),i=(0,G.RL)({collectionContextStore:this,applySubitemFilter:!1,filterOutHideSubitemsQuickFilter:!1}),a=(0,l.kk)(i);return a&&(0,l.SH)(a,(e=>!!(0,l.aN)(e)&&(e.property===(null==o?void 0:o.property)||e.property===(null==o?void 0:o.inverse))))&&r&&!(0,E.Av)(r)?void 0:o}),{useDeepEqual:!0,debugName:"currentSubitemFormatStoreForUiDisplay"}),this.currentSubitemFormatStoreForCollectionStore=new o.ZP((()=>(0,E.wf)(this)),{useDeepEqual:!0,debugName:"currentSubitemFormatStoreForCollection"}),this.currentArrowsByFormatStore=new o.ZP((()=>(0,C.H5)(this)),{useDeepEqual:!0,debugName:"currentArrowsByFormatStore"}),this.currentPropertyFiltersStore=new o.ZP((()=>{const e=this.normalizedSchemaStore.state,t=this.temporaryStateStore.state.propertyFilters;return(t?t.value||[]:this.normalizedFormatStore.state.property_filters||[]).map((t=>{const n=(0,u.dN)(t.filter,e),o=this.collectionViewBlockStore();if(e[t.filter.property]&&n&&(0,l.J5)(e,t.filter.property,n.filter,null==o?void 0:o.getRecordModel))return n&&{id:t.id,filter:n}})).filter(w.$K).sort((0,G.ox)())}),{useDeepEqual:!0,debugName:"currentPropertyFiltersStore"}),this.currentSortsStore=new o.ZP((()=>{var e;const t=this.temporaryStateStore.state.sorts;return t?t.value||[]:(null===(e=this.normalizedQueryStore.state)||void 0===e?void 0:e.sort)||[]}),{useDeepEqual:!0,debugName:"currentSortsStore"}),this.inheritedBlockColorStore=new o.ZP((()=>{const e=this.collectionViewBlockStore(),{ThemeModeStore:t}=this.environment;if(!e)return;const n=e.findRecordStoreUIAncestor((e=>Boolean(e instanceof O.G&&e.getRecordStoreUIParent()&&e.getFormat().block_color&&!e.isCollectionView()))).ancestor;if(n&&n instanceof O.G){const e=n.getType(),o=n.getFormat().block_color;if(o){const n=(0,S.gh)({theme:t.state});return e===a.Ti.callout?(0,S.x7)(o,n):(0,S.fi)(o,n)}}}),{useDeepEqual:!0,debugName:"inheritedBlockColorStore"}),this.defaultPageTemplateStore=new o.ZP((()=>{var e,t;const n=this.collectionStore(),o=this.collectionViewStore(),r=k.oA([null==o||null===(e=o.getFormat())||void 0===e?void 0:e.collection_view_default_template,null==n||null===(t=n.getFormat())||void 0===t?void 0:t.collection_default_template]),i=null==n?void 0:n.getTemplatePageStores();for(const a of r){if("empty"===a)return;const e=null==i?void 0:i.find((e=>e.id===a.template_page_id));if(null!=e&&e.getAlive())return e}}),{debugName:"defaultPageTemplateStore"}),this.relativeVariableStore=new o.ZP((()=>{const e=this.contextStore.state;if(!e)return;const t=e.collectionViewBlockStore;if(!t)return;const n={},o=this.privateRelativeVariableStore.state;for(const[r,i]of(0,w.qP)(o)){const e=O.NW.createChildStore(t,{id:r,table:b.vF}),o=e.getSchema(),a=null==e?void 0:e.getFormat().app_config_uri;if(a&&(0,v.oN)(o,a)){n[r]={};for(const[t,s]of(0,w.qP)(i)){const i=O.G.createChildStore(e,{id:s,table:y.iU});i.isDefined()&&((0,$.iL)({blockStore:i,collectionId:r,appConfigUri:a,variable:t,schema:o})&&(n[r][t]=s))}}}return n}),{useDeepEqual:!0,debugName:"relativeVariableStore"}),this.relativeVariablesAreStaleStore=new o.ZP((()=>{const e=this.contextStore.state;if(!e)return!1;const t=e.collectionViewBlockStore;if(!t)return!1;const n=this.privateRelativeVariableStore.state;for(const[o,r]of(0,w.qP)(n)){const e=O.NW.createChildStore(t,{id:o,table:b.vF}),n=e.getSchema(),i=null==e?void 0:e.getFormat().app_config_uri;if(i&&(0,v.oN)(n,i))for(const[t,a]of(0,w.qP)(r)){const r=O.G.createChildStore(e,{id:a,table:y.iU});if(r.isDefined()&&!(0,$.iL)({blockStore:r,collectionId:o,appConfigUri:i,variable:t,schema:n}))return!0}}return!1}),{debugName:"relativeVariablesAreStale"}),this.aliveAutomationCountStore=new o.ZP((()=>{const e=this.collectionStore();if(!e)return 0;const t=e.getAutomationStores();let n=0;for(const o of t)(o.isTriggerType("notification_event")||o.isTriggerType("event"))&&o.getAlive()&&(n+=1);return n}),{debugName:"aliceAutomationCount"}),this.completeSprintButtonContextStore=new o.ZP((()=>{var e,t;if((null===(e=this.collectionViewStore())||void 0===e?void 0:e.getFormatStore().getKeyStore("app_config_uri").getValue())!==i.g3)return;const n=this.sprintSettingsContextStore.state;if(!n||!n.sprintCollectionStore)return;if(!n.automationContext)return;const{sprintCollectionStore:o,taskCollectionStore:r,automationContext:a}=n,s=this.getAutomationCollectionValue(r),l=this.getAutomationCollectionValue(o),c=null==l||null===(t=l.format)||void 0===t?void 0:t.app_config_uri,d=o.getSchema();return(0,v.PB)({appUri:c,collectionSchema:d})&&s&&l?{...n,sprintCollectionStore:o,taskCollectionValue:s,sprintCollectionValue:l,sprintCollectionSchema:d,automationContext:a}:void 0}),{useDeepEqual:!0,debugName:"getCompleteSprintButtonContext"}),this.sprintSettingsContextStore=new o.ZP((()=>{const e=(()=>{const e=this.collectionStore(),t=this.collectionViewBlockStore();if(!t||!e)return;const n=e.getParentBlockStore();if(!n||!Boolean(n.pathIsAccessibleAndAlive()))return;const o=e.getDatabaseType();if(o!==i.p$&&o!==i.Ym)return;let r,a,s,l;if(o===i.Ym){var c;r=e,a=n;const o=null===(c=r.getFormatStore().getKeyStore("app_uri_map").getValue())||void 0===c?void 0:c[i.Es.TaskToSprintRelation];if(!o)return{currentCollectionViewBlockStore:t,taskCollectionStore:r,taskCollectionViewBlockStore:a,sprintCollectionStore:void 0,sprintCollectionViewBlockStore:void 0,automationContext:void 0};const u=r.getSchemaStore().getKeyStore(o).getValue();if(!u||!d.p_(u))return;const p=d.j0(u);if(!p)return{currentCollectionViewBlockStore:t,taskCollectionStore:r,taskCollectionViewBlockStore:a,sprintCollectionStore:void 0,sprintCollectionViewBlockStore:void 0,automationContext:void 0};if(s=O.NW.createChildStore(t,p),l=s.getParentBlockStore(),!l)return{currentCollectionViewBlockStore:t,taskCollectionStore:r,taskCollectionViewBlockStore:a,sprintCollectionStore:void 0,sprintCollectionViewBlockStore:void 0,automationContext:void 0};if(s.getDatabaseType()!==i.p$)return}else if(o===i.p$){var u;s=e,l=n;const o=null===(u=s.getFormatStore().getKeyStore("app_uri_map").getValue())||void 0===u?void 0:u[i.b0.SprintToTaskRelation];if(!o)return;const c=s.getSchemaStore().getKeyStore(o).getValue();if(!c||!d.p_(c))return;const p=d.j0(c);if(!p)return;if(r=O.NW.createChildStore(t,p),a=r.getParentBlockStore(),r.getDatabaseType()!==i.Ym||!a)return}else(0,w.t1)(o);if(s.getAutomationStores().some((e=>!e.isDefined())))return{currentCollectionViewBlockStore:t,taskCollectionStore:r,taskCollectionViewBlockStore:a,sprintCollectionStore:void 0,sprintCollectionViewBlockStore:void 0,automationContext:void 0};const p=s?k.Ps(k.oA(s.getAutomationStores().map((e=>{if(!Boolean(e.getAlive()))return;const t=e.getActionStores();return e.isTriggerType("recurrence")&&1===t.length&&Boolean(t[0].getAlive())&&t[0].isType("complete_sprint")?{automationStore:e,automationActionStore:t[0]}:void 0})))):void 0;return Boolean(r.getAlive())&&a.pathIsAccessibleAndAlive()?Boolean(s.getAlive())&&l.pathIsAccessibleAndAlive()?{currentCollectionViewBlockStore:t,taskCollectionStore:r,taskCollectionViewBlockStore:a,sprintCollectionStore:s,sprintCollectionViewBlockStore:l,automationContext:p}:{currentCollectionViewBlockStore:t,taskCollectionStore:r,taskCollectionViewBlockStore:a,sprintCollectionStore:void 0,sprintCollectionViewBlockStore:void 0,automationContext:void 0}:void 0})(),t=(e=>{var t;if(!e)return;if(!e.taskCollectionViewBlockStore.canEditCollection())return{canEdit:!1};const n=e.sprintCollectionViewBlockStore,o=Boolean(null===(t=e.sprintCollectionViewBlockStore)||void 0===t?void 0:t.canEditCollection());return n&&!o?{canEdit:!1}:!e.sprintCollectionViewBlockStore||o&&!e.automationContext?{canEdit:!0,sprintsEnabled:!1}:o&&e.automationContext?{canEdit:!0,sprintsEnabled:!0}:void 0})(e);return e&&t?{...e,permissionsContext:t}:void 0}),{useDeepEqual:!0,debugName:"sprintSettingsContextStore"}),this.itemMountedCallbacks=new z,this.databaseItemsVisibleTracker=void 0,this.onItemMount=e=>{var t;null===(t=this.databaseItemsVisibleTracker)||void 0===t||t.handleItemMount(),this.trackInfiniteScrollLongTasksDebounced(),e&&this.itemMountedCallbacks.executeCallbacks(e)},this.trackInfiniteScrollLongTasksDebounced=k.Ds(this.trackInfiniteScrollLongTasks,1e3),this.groupsForTypedDatabasesStore=new o.ZP((()=>{const e=J.default.state.currentSpaceStore;if(e&&"collectionTypedView"===this.contextType)return(0,x.x1)({environment:this.environment,typedCollections:this.collectionStoresStore.state,spaceStore:e})}),{debugName:"groupsForTypedDatabasesStore"}),this._virtualizedModule=new q(this),this.environment=e}setContext(e){this.contextStore.setState(e)}get contextType(){var e;return null===(e=this.contextStore.state)||void 0===e?void 0:e.type}get isMultiSourceView(){return"collectionTypedView"===this.contextType}get databaseType(){const e=this.contextStore.state;if(e){if("collectionTypedView"===e.type)return e.databaseType;if("collectionView"===e.type){const t=e.collectionStore;return null==t?void 0:t.getDatabaseType()}}}collectionViewStore(){const e=this.contextStore.state,t=null==e?void 0:e.type;if(t)switch(t){case"collectionTypedView":case"collectionView":case"collectionVirtualView":return e.collectionViewStore;case"collectionPage":case"collectionViewBlock":return;default:(0,w.t1)(t)}}collectionStore(){const e=this.contextStore.state;if(e&&"collectionTypedView"!==e.type)return"collectionVirtualView"===e.type||"collectionView"===(null==e?void 0:e.type)||"collectionPage"===(null==e?void 0:e.type)?e.collectionStore:void("collectionViewBlock"!==(null==e?void 0:e.type)&&(0,w.t1)(e))}hasSingleCollection(){switch(this.contextType){case"collectionTypedView":case"collectionVirtualView":return!1;case"collectionPage":case"collectionViewBlock":case"collectionView":case void 0:return!0;default:(0,w.t1)(this.contextType)}}collectionViewBlockStore(){const e=this.contextStore.state;return null==e?void 0:e.collectionViewBlockStore}formatStore(){const e=this.contextStore.state;if(e)return"collectionPage"===e.type?e.collectionStore:"collectionView"===e.type||"collectionTypedView"===e.type||"collectionVirtualView"===e.type?e.collectionViewStore:void("collectionViewBlock"!==e.type&&(0,w.t1)(e))}getPropertyFormatKey(){const e=this.contextStore.state;if("collectionPage"===(null==e?void 0:e.type))return"collection_page_properties";if("collectionView"===(null==e?void 0:e.type)||"collectionTypedView"===(null==e?void 0:e.type)){const t=e.collectionViewStore.getType();if(!t)return;return f.oz(t)}}getPropertyFormat(e){var t;const n=null===(t=this.formatStore())||void 0===t?void 0:t.getFormat(),o=null==this?void 0:this.getPropertyFormatKey();if(!n||!o)return;return(n[o]??[]).find((t=>t.property===e))}createUpdateCounter(){return this.updateCounter++,this.updateCounter}shouldUpdate(e){return this.updateCounter===e}getCurrentUserId(){return this.environment.currentUser.id}getViewType(){const e=this.collectionViewStore();if(null!=e&&e.isDefined())return e.getType();const t=this.contextStore.state;return"collectionPage"===(null==t?void 0:t.type)?"page":void 0}currentViewHasSort(){const e=this.normalizedQueryStore.state;return Boolean(e&&e.sort&&e.sort.length>0)}resetLoadingState(){this.isLoadingStore.setState(!1),this.loadingDetailsStore.reset()}getCollectionViewBlockSourceState(){const e=this.collectionViewBlockStore();if(!e)return"uninitialized";if(e.getCollectionViewSourceCollectionStore())return"source";return e.getCollectionViewStores().some((e=>Boolean(e.getCollectionStore())))||this.isEditableHomeCollectionStore.state?"linked":"uninitialized"}getFilterBarItemSettingsStore(e){let t=this.filterBarItemSettingsStoreMap.get(e.id);return t||(t=r.default.createValue({open:!1,stack:[]}),this.filterBarItemSettingsStoreMap.set(e.id,t)),t}getFilterOptionsItemSettingsStore(e){let t=this.filterOptionsItemSettingsStoreMap.get(e.id);return t||(t=r.default.createValue({open:!1,stack:[]}),this.filterOptionsItemSettingsStoreMap.set(e.id,t)),t}allowScrollingWhenCollectionSettingsSidebarOpen(){return"form_editor"===this.getViewType()}viewIsFlushToTopbar(){if(!this.collectionStore())return!1;if(this.shouldShowSourceStore.state)return!1;if(this.filtersBarOpenStore.state)return!1;return void 0===this.completeSprintButtonContextStore.state}shouldAllowNewItemCreation(e){var t;const n=this.permissionScopesStore.state,o="collectionTypedView"===this.contextType;return(null===(t=this.collectionStore())||void 0===t||!t.isExternallyImportedAndSyncedCollection()||"on"!==V.default.getEligibleGroup({experimentId:"jira_import_and_sync",defaultGroup:"control"}))&&(!n.isSyncedCollection&&(n.canEditContent||o&&(null==e?void 0:e.overrideAllowForTypedViews)))}shouldShowPageIcon(){var e;return(null===(e=this.collectionViewStore())||void 0===e?void 0:e.shouldShowPageIcon())??!0}getAutomationCollectionValue(e){if(e.isDefined())return{id:e.id,space_id:e.getSpaceId(),schema:e.getSchema(),format:e.getFormat()}}registerCallbackForItemMounted(e,t){this.itemMountedCallbacks.registerCallback(e,t)}async trackInfiniteScrollLongTasks(){if(!this.infiniteScrollLongTaskObserver.isObserving)return;this.infiniteScrollLongTaskObserver.disconnect();const e=this.infiniteScrollLongTaskObserver.takeRecords(),t=B.vS(this);if(!(await H.Vi({eventName:"collections.infinite_scroll_long_tasks.max_duration",eventProperties:t,sampling:{behavior:"statsig",fallbackBehavior:"statsig",statsigNotAvailableBehavior:"drop"}})))return;const n=e.reduce(((e,t)=>(e.entryCount++,e.maxDuration=Math.max(e.maxDuration,t.duration),e)),{maxDuration:0,entryCount:0});H.K4(this.environment,"collections.infinite_scroll_long_tasks.count",{count:n.entryCount,...t},{sampling:{behavior:"custom",sampleRate:1}}),n.entryCount>0&&H.K4(this.environment,"collections.infinite_scroll_long_tasks.max_duration",{time:n.maxDuration,...t},{sampling:{behavior:"custom",sampleRate:1}})}getPageVisitSourceOverride(){var e;switch(null===(e=this.contextStore.state)||void 0===e?void 0:e.type){case"collectionTypedView":case"collectionVirtualView":case"collectionView":return this.contextStore.state.pageVisitSourceOverride;case"collectionPage":case"collectionViewBlock":case void 0:return;default:(0,w.t1)(this.contextStore.state)}}resultsInViewOrder(e){var t;const n=this.collectionViewBlockStore(),o=this.collectionViewStore(),r=this.collectionStoresStore.state;if(!n||!o||!r.length)return[];const i=this.normalizedFormatStore.state,a="board"===this.getViewType()?{groupByKey:"board_columns_by",groupsFormatKey:"board_columns"}:{groupByKey:"collection_group_by",groupsFormatKey:"collection_groups"},s=this.normalizedSchemaStore.state,l=i[a.groupByKey],d=(0,w.$K)(l)?(0,c.Qq)({schema:s,groupBy:l}):[],u=Object.values((null===(t=this.localResultStore.state)||void 0===t?void 0:t.reducerResults)??{}).find((e=>"groups"===e.type)),p=(0,W.Cz)({getRecordModel:n.getRecordModel,schema:s,groupBy:l,formatGroups:i[a.groupsFormatKey]??[],schemaGroups:d,reducerResults:(null==u?void 0:u.results)??[],relativeVariableResult:this.relativeVariableStore.state,viewAppConfigUri:o.getFormat().app_config_uri,allowedCollectionStores:r});let m,g;if(0===p.length){const e=this.localResultStore.state;if(e){const t=Object.values(e.reducerResults).find((e=>"results"===e.type));m=((null==t?void 0:t.blockIds)??[]).map((e=>O.G.createChildStore(o,{table:"block",id:e})))}else m=[]}else{m=[];for(const e of p){const t=this.groupsStore.getGroupState(e),n=null==t?void 0:t.resultsStore.state;m.push(...n??[])}}if(m=k.mN(m,(e=>e.id)),this.currentSubitemFormatStoreForUiDisplayStore.state){g=[];const t=this.subitemTreeStore.state;for(const n of m){if(void 0!==e&&g.length>=e)break;const o=t.children.find((e=>e.value.store.id===n.id));if(o){const e=[];(0,E.yU)({results:e,tree:o}),g.push(...e)}}}else g=m;return void 0!==e?g.slice(0,e):g}collectionStoreResultsInViewOrder(){if("collectionTypedView"!==this.contextType){const e=this.collectionStore();return e?[e]:[]}const e=this.resultsInViewOrder(void 0);return k.oA(k.mN(e.map((e=>e.getAssociatedCollectionStore())),"id"))}get virtualizedModule(){return this._virtualizedModule}}re.PREFERENCE_KEY_PREFIX="CollectionView:",re.incrementScrollOffset=600;const ie=re},658421:(e,t,n)=>{n.d(t,{n:()=>r});var o=n(653965);function r(e){const t=e.state;return o.Z$(t.stack)}},206776:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(653965);class i extends o.default{getInitialState(){return{editMode:void 0,store:void 0}}cloneState(){return r.d9(this.state)}}const a=new i},519511:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(653965);class i extends o.default{getInitialState(){return{isActive:!1}}cloneState(){return r.d9(this.state)}}const a=new i},316772:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});n(21703);var o=n(749085),r=n(292595),i=n(712139);class a extends o.default{constructor(){super(...arguments),this.lastUpdater=0}getInitialState(){return{type:"closed"}}setState(e){if("completionPopup"===this.state.type&&"results"===this.state.stage&&("completionPopup"!==e.type||"results"!==e.stage)){const{inMemoryRecordCache:e,context:t}=this.state;if(e.cacheUsingThisInstanceAsAnOverride){const n=`CompletionsStore transitioning away from completionPopup results while inMemoryRecord cache is still overriding ${e.cacheUsingThisInstanceAsAnOverride===t.currentPage.inMemoryRecordCache?"page's in-memory cache":"an unknown cache"}!`;i.rn(new Error(n),{from:"CompletionsStore",type:"dangerousStateTransition"})}}super.setState(e)}createUpdater(){const e=++this.lastUpdater;return t=>{if(e===this.lastUpdater)return t()}}invalidateLastUpdater(){this.lastUpdater+=1}resetStore(e){const{environment:t}=e;this.invalidateLastUpdater();const n=this.state;"completionPopup"!==n.type&&"assistantCompletionPopup"!==n.type||("completionPopup"===n.type&&"initialPromptForAIBlock"!==n.stage&&"initialPrompt"!==n.stage&&t.defaultRecordCache.inMemoryRecordCache.removeCacheOverride(n.inMemoryRecordCache),this.setState({type:"closed"}))}getExistingAISessionId(){return"closed"!==this.state.type?"assistantCompletionPopup"===this.state.type?this.state.sessionId:this.state.aiSessionId:void 0}isEditingEmptyBlock(){var e;const t=this.state;return Boolean(("completionPopup"===t.type||"assistantCompletionPopup"===t.type)&&"initialPrompt"===t.stage&&"cursor"===t.context.type&&(null===(e=t.context.currentBlock)||void 0===e?void 0:e.isEmptyEditableBlock()))}}const s=new a;(0,r.exposeDebugValue)("CompletionsStore",s);const l=s},372371:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(14577),r=n(749085),i=n(292595);class a extends r.default{constructor(){super(...arguments),this.integrations=new o.ZP((()=>{const e=this.state;return e.loaded?e.integrations:[]}),{debugName:"ComplianceIntegrationStore.integrations"}),this.webhookSubscriptions=new o.ZP((()=>{const e=this.state;return e.loaded?e.webhookSubscriptions:[]}),{debugName:"ComplianceIntegrationStore.webhookSubscriptions"})}getInitialState(){return{loaded:!1,loading:!1}}}const s=new a;(0,i.exposeDebugValue)("ComplianceIntegrationStore",s);const l=s},481700:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},780641:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{bypassedPageIds:new Set}}bypassedPage(e){return this.state.bypassedPageIds.has(e)}bypassPage(e){this.state.bypassedPageIds.add(e),this.emit()}}const i=new r},461893:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(749085),r=n(686658),i=n(512955);class a extends o.default{getInitialState(){return{permission:r.UE}}getId(){return this.getState().id}getPermission(){return this.getState().permission}setPermission(e){this.setState({...this.state,permission:e})}async setCookieConsent(e,t){this.setState(t),await(0,i.setCookieConsentCookie)(e,t)}clearCookieConsent(){this.reset(),(0,i.removeCookieConsentCookie)()}}const s=new a},45293:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},156681:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{pageId:void 0,lastInteractionTimes:{}}}resetIfNotCurrentPage(e){e!==this.state.pageId&&this.reset()}markDiscussionsInteractedWith(e){const t={};e.forEach((e=>{t[e]=Date.now()})),this.setState({...this.state,lastInteractionTimes:t})}}const i=new r},485680:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isOpen:!1}}}const i=new r},328748:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},382246:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(861364).Z)},155367:(e,t,n)=>{n.d(t,{Dl:()=>i,ZP:()=>s,vh:()=>r});var o=n(749085);let r=function(e){return e[e.Above=0]="Above",e[e.Below=1]="Below",e[e.Left=2]="Left",e[e.Right=3]="Right",e[e.Onto=4]="Onto",e}({}),i=function(e){return e[e.Selectable=0]="Selectable",e[e.DropTarget=1]="DropTarget",e}({});class a extends o.default{getInitialState(){return{isDragging:!1}}}const s=new a},245452:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isDragging:!1,willDrag:!1}}}const i=r},510084:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(653965);class i extends o.default{getInitialState(){return{initiator:"none",dragging:!1,waiting:!1}}hasDragged(){return this.state.dragging&&!r.Xy(this.state.startingPoint,this.state.currentPoint)}}const a=i},480796:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{initiator:"none",isDragging:!1,disableVerticalEdgeScroll:!1,disableHorizontalEdgeScroll:!1}}}const i=new r},312211:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(749085),r=n(292595);class i extends o.default{getInitialState(){return{dropTargetRectMap:new Map}}}const a=new i;(0,r.exposeDebugValue)("GlobalDropTargetRectStore",a);const s=a},400807:(e,t,n)=>{n.d(t,{Z:()=>c});n(21703);var o=n(749085),r=n(292595),i=n(80444),a=n(188923);class s extends o.default{getInitialState(){return{blockStoreMode:{}}}getStateForBlock(e){if(e in this.state.blockStoreMode)return this.state.blockStoreMode[e]}setStateForBlock(e,t){this.update((n=>({...n,blockStoreMode:{...n.blockStoreMode,[e]:t}})))}clearStateForBlock(e){e in this.state.blockStoreMode&&(delete this.state.blockStoreMode[e],this.emit())}getMode(e,t){var n;if(t)return(null===(n=this.getStateForBlock(e.id))||void 0===n?void 0:n.mode)??"default";let o;var r,s,l;a.default.state.open?o=null===(r=e.getNavigableBlockStore())||void 0===r?void 0:r.id:o=null===(s=i.default.state.mainEditorCurrentBlockStore)||void 0===s?void 0:s.id;return o?(null===(l=this.getStateForBlock(o))||void 0===l?void 0:l.mode)??"default":"default"}hasModeSet(e){let t=e;if(!e.isNavigableBlock()){const n=e.getNavigableBlockStore();if(!n)throw new Error("Store doesn't have a navigable block store.");t=n}return Boolean(this.getStateForBlock(t.id))}getSessionId(e){var t;if(!e.isNavigableBlock())throw new Error("getSessionId must be called with a navigable block.");return null===(t=this.getStateForBlock(e.id))||void 0===t?void 0:t.sessionId}}const l=new s;(0,r.exposeDebugValue)("EditorModeStore",l);const c=l},273024:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{editorWidth:void 0,peekViewEditorWidth:void 0}}setWidth(e,t){t?this.setPeekViewEditorWidth(e):this.setEditorWidth(e)}setEditorWidth(e){this.setState({...this.state,editorWidth:e})}setPeekViewEditorWidth(e){this.setState({...this.state,peekViewEditorWidth:e})}getWidth(e){return e?this.getPeekViewEditorWidth():this.getEditorWidth()}getEditorWidth(){return this.state.editorWidth}getPeekViewEditorWidth(){return this.state.peekViewEditorWidth}}const i=new r},424042:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}}const i=new r},833110:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{tabs:[],currentTab:{isPinned:!1}}}}const i=new r},964233:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1,loading:!1}}}const i=new r},966949:(e,t,n)=>{n.d(t,{P:()=>i,Z:()=>l});var o=n(749085),r=n(292595);let i=function(e){return e.Forward="Forward",e.Backward="Backward",e}({});class a extends o.default{getInitialState(){return{open:!1}}isOpen(){if(this.state.open){this.state;return!0}return!1}}const s=new a;r.exposeDebugValue("EquationAnnotationStore",s);const l=s},385555:(e,t,n)=>{n.r(t),n.d(t,{ExperimentStoreV3:()=>b,default:()=>_,localExperimentsV2Key:()=>v});n(21703);var o=n(14577),r=n(749085),i=(n(832294),n(512174)),a=n(568626),s=n(915157),l=n(197715),c=n(519889),d=n(653965),u=n(401898);function p(e){const t={};return e?((0,u.qP)(e).forEach((e=>{let[n,o]=e;null!=n&&null!=o&&(t[String(n)]=d.HD(o)?o:JSON.stringify(o))})),t):t}var m=n(95477),g=n(797448),f=n(80444),h=n(807339);const v="experimentsSettingsV2";class y extends r.default{getInitialState(){return{isLoaded:!1}}updateState(e,t){!e.test&&this.state.isLoaded&&this.state.test||(this.setState(e),s.Z.set({userId:e.userId,key:v,value:e}))}setState(e){super.setState(e)}getExperimentsForCurrentSpace(){if(!this.state.isLoaded)return[];if(this.state.test)return this.state.experiments;const e=f.default.state.currentSpaceStore;return e&&this.state.experimentsBySpace[e.id]||this.state.experimentsWithoutSpace}getGroup(e){if(i.TS.has(e))return l.Le;let t;if(this.state.isLoaded){const n=this.getExperimentsForCurrentSpace().find((t=>t.experimentId===e));if(!n)return l.Le;t=n.group}return t||l.Le}getExperimentsMap(){const e={};return this.state.isLoaded&&this.getExperimentsForCurrentSpace().forEach((t=>{e[t.experimentId]=t.group})),e}getExperimentMap(){const e=new Map;return this.state.isLoaded&&this.getExperimentsForCurrentSpace().forEach((t=>{e.set(t.experimentId,t)})),e}getUsedNonControlExperimentsMap(){const e={};return this.state.isLoaded&&this.getExperimentsForCurrentSpace().forEach((t=>{"control"!==t.group&&(0,i.DP)(t.experimentId)&&(e[t.experimentId]=t.group)})),e}getAcceptLanguageHeader(){if(this.state.isLoaded)return this.state.acceptLanguageHeader}}class b extends y{constructor(){super(),this.statsigExposureCacheForAnalytics={},this.computedStoreMap=new Map,this.isStatsigEnabled()&&h.C.addListener((()=>{this.recomputeAllGroupStores()}))}isStatsigEnabled(){var e;return Boolean(null===(e=m.default.statsig)||void 0===e?void 0:e.apiKey)}isStatsigEnabledAndInitialized(){return this.isStatsigEnabled()&&h.C.isInitialized()}isLoaded(){return this.state.isLoaded}getGroup(e,t){if(!(0,i.YY)(e)){return this.createComputedGroupStore(`group-${e}`,(()=>super.getGroup(e))).state.group||l.Le}return this.getEligibleGroup({experimentId:e,defaultGroup:l.Le,disableExposureLogging:null==t?void 0:t.disableExposureLogging})}getEligibleGroup(e){const{experimentId:t,defaultGroup:n,parameter:o=h.Z,disableExposureLogging:r=!1}=e,i=(null==o?void 0:o.toLowerCase())===h.Z,a=this.getExperimentOverrideForBrowserTest(t);if((0,u.$K)(a))return a[o];const s=e.actor;this.validateActor(s),this.state.isLoaded;const l=`eligible-group-${t}-${o}`;return this.createComputedGroupStore(l,(()=>{if(!this.isStatsigEnabledAndInitialized())return;const e=this.validateGroupIsString(h.C.getGroup(t,r));return void 0!==e&&(this.statsigExposureCacheForAnalytics[`statsig-${t}`]=e),i?e:h.C.getGroup(t,r,o,n)})).state.group??n}manuallyLogExperimentExposure(e){h.C.manuallyLogExperimentExposure(e)}validateActor(e){if(void 0!==e&&e!==i.pX){const t=this.isStatsigEnabledAndInitialized()&&h.C.state.currentUserId?{table:c.KJ,id:h.C.state.currentUserId}:void 0;if(t&&e!==t)throw new Error("Invalid user: actor does not match currentUser")}}checkGate(e){const{gateName:t,disableExposureLogging:n=!1}=e,o=e.actor;this.validateActor(o);const r=this.getFeatureGateOverrideForBrowserTest(t);if((0,u.$K)(r))return r;const i=this.getFeatureGateOverrideForUnitTest(t);if((0,u.$K)(i))return i;return this.createComputedGateStore(t,(()=>{if(!this.isStatsigEnabledAndInitialized())return!1;const e=h.C.checkGate(t,n);return this.statsigExposureCacheForAnalytics[`statsig-${t}`]=e,e})).state.gate}getConfigKey(e,t,n){const o=i.LI[e][t];return this.createComputedDynamicConfigKeyStore(e,t,(()=>{var r;return this.isStatsigEnabledAndInitialized()&&(null===(r=h.C.getConfig(e,n))||void 0===r?void 0:r.get(String(t),o))||o})).state.value}logEvent(e,t,n){return this.isStatsigEnabledAndInitialized()?h.C.logEvent(e,t,p(n)):(a.log({level:"error",from:"ExperimentStore.ts",type:"statsigIsNotInitialized",data:{miscDataToConvertToString:{eventName:e,value:t,metadata:p(n),isStatsigEnabled:this.isStatsigEnabled(),isInitialized:h.C.isInitialized()}}}),!1)}getExperimentsMap(){return{...super.getExperimentsMap(),...this.statsigExposureCacheForAnalytics}}getStatsigExperimentsMap(){return this.statsigExposureCacheForAnalytics}updateState(e,t){(void 0===e.userId||this.state.isLoaded&&this.state.userId!==e.userId)&&(this.statsigExposureCacheForAnalytics={}),super.updateState(e,t)}reset(){super.reset(),this.statsigExposureCacheForAnalytics={},this.recomputeAllGroupStores()}async waitUntilStatsigReady(){this.isStatsigEnabled()&&await h.C.waitUntil((()=>h.C.state.ready))}isStatsigReady(){return h.C.state.ready}recomputeAllGroupStores(){this.computedStoreMap.forEach((e=>{e.enqueueRecompute()}))}createComputedGroupStore(e,t){return this.createComputedStore(e,(()=>({group:t(),lastUpdatedMinute:(new Date).getMinutes()})))}createComputedGateStore(e,t){return this.createComputedStore(`gate-${e}`,(()=>({gate:t(),lastUpdatedMinute:(new Date).getMinutes()})))}createComputedDynamicConfigKeyStore(e,t,n){return this.createComputedStore(`config-${e}-${String(t)}`,(()=>({value:n(),lastUpdatedMinute:(new Date).getMinutes()})))}createComputedStore(e,t){const n=(new Date).getMinutes();let r=this.computedStoreMap.get(e);return r?r.state.lastUpdatedMinute===n||(0,g.shouldUseNewStatsigInit)()||r.setShouldRecompute():(r=new o.ZP(t,{debugName:`ExperimentStore.${e}`}),r.addListener(d.ZT),this.computedStoreMap.set(e,r)),r}getFeatureGateOverrideForBrowserTest(e){}getExperimentOverrideForBrowserTest(e){}getFeatureGateOverrideForUnitTest(e){}validateGroupIsString(e){return"string"==typeof e?e:void 0}}const _=new b},530874:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(14577),r=n(749085),i=n(292595),a=n(145953),s=n(177420),l=n(509844);class c extends r.default{constructor(){super(...arguments),this.integrations=new o.ZP((()=>{const e=this.state;return e.loaded?e.integrations:[]}),{debugName:"ExternalIntegrationStore.integrations"}),this.bots=new o.ZP((()=>{const e=this.state;return e.loaded?e.bots:[]}),{debugName:"ExternalIntegrationStore.bots"}),this.externalAuthentications=new o.ZP((()=>{const e=this.state;return e.loaded?e.externalAuthentications:[]}),{debugName:"ExternalIntegrationStore.externalAuthentications"}),this.completeSlackAuthentications=new o.ZP((()=>{const e=this.state;return e.loaded?e.completeSlackAuthentications:[]}),{debugName:"ExternalIntegrationStore.completeSlackAuthentications"})}getInitialState(){return{loaded:!1,loading:!1}}getIntegrationsAsRecordMap(){const e=a.Ak.create();return this.integrations.state.forEach((t=>e.setValue({table:l.K2,id:t.id},t))),e}getBotsAsRecordMap(){const e=a.Ak.create();return this.bots.state.forEach((t=>e.setValue({table:s.cZ,id:t.id},t))),e}}const d=new c;(0,i.exposeDebugValue)("ExternalIntegrationStore",d);const u=d},879167:(e,t,n)=>{n.d(t,{Z:()=>f});var o=n(749085),r=n(541432),i=n(977657),a=n(145953),s=n(421202),l=n(177420),c=n(606287),d=n(653965),u=n(401898),p=n(619584),m=n(530874);class g extends o.default{getInitialState(){return{externalObjectInstanceBlockPointersMap:{},externalCollectionInstancePointersMap:{}}}addFromRecordMapWithRoleJson(e){this.addFromRecordMapWithRole(a.PF.create(e))}addFromRecordMapWithRole(e){const t=e.getByTable(c.vF).filter((e=>{var t;let{value:n}=e;return null==n||null===(t=n.value)||void 0===t||null===(t=t.format)||void 0===t?void 0:t.external_object_id})).map((e=>{let{value:t}=e;return(null==t?void 0:t.value)&&{id:t.value.id,table:c.vF,spaceId:t.value.space_id}})).filter(u.$K),n=m.Z.getBotsAsRecordMap(),o=e.getByTable(s.iU).filter((e=>{let{value:t}=e;if(!(t&&t.value&&t.value.format&&t.value.format.external_object_id))return!1;if(t.value.type!==r.Ti.externalObjectInstancePage&&t.value.type!==r.Ti.externalObjectInstance)return!1;const o=t.value.format.bot_id;if(!o)return!1;if(!0===m.Z.state.loaded){const e=n.getValue({table:l.cZ,id:o});if(e&&e.integration_id&&e.integration_id===i.U9)return!1}return!0})).map((e=>{let{value:t}=e;return null==t?void 0:t.value})).filter(u.$K),a=d.oA(o.map((e=>{if(e.type===r.Ti.externalObjectInstancePage&&e.parent_table===c.vF)return{id:e.parent_id,table:e.parent_table,spaceId:e.space_id}}))),g=(0,p.m8)(o.map((e=>{const t={id:e.id,table:s.iU,spaceId:e.space_id};return[e.id,t]}))),f=(0,p.m8)([...t,...a].map((e=>[e.id,e])));this.setState({externalObjectInstanceBlockPointersMap:{...this.state.externalObjectInstanceBlockPointersMap,...g},externalCollectionInstancePointersMap:{...this.state.externalCollectionInstancePointersMap,...f}})}reset(){this.setState({externalObjectInstanceBlockPointersMap:{},externalCollectionInstancePointersMap:{}})}isEmpty(){return 0===Object.keys(this.state.externalCollectionInstancePointersMap).length&&0===Object.keys(this.state.externalObjectInstanceBlockPointersMap).length}}const f=new g},635150:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(292595);const r=new(n(551444).q)((e=>{let{spaceId:t}=e;return t}),(async(e,t)=>{let{spaceId:o}=t;const r=await Promise.resolve().then(n.bind(n,21359)),i=await r.getFeatureBillingData(e,{spaceId:o});if("success"===i.type)return i.data.billingData}));o.exposeDebugValue("FeatureBillingDataStore",r);const i=r},551444:(e,t,n)=>{n.d(t,{X:()=>a,q:()=>i});var o=n(749085),r=n(915157);class i{constructor(e,t){this.nextVersion=1,this.keyFn=void 0,this.promiseMap=void 0,this.versionMap=void 0,this.storeMap=void 0,this.fetchFn=void 0,this.fetch=async(e,t,n)=>{const o=this.keyFn(t),r=this.nextVersion++;this.versionMap[o]=r;const i=await this.fetchFn(e,t,n);return this.versionMap[o]!==r?this.promiseMap[o]:(this.storeMap[o].setState(i),i)},this.storeMap={},this.promiseMap={},this.versionMap={},this.fetchFn=t,this.keyFn=e}getData(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=this.keyFn(t);return r&&(this.promiseMap[i]=void 0),this.storeMap[i]??=o.default.createValue(void 0),this.promiseMap[i]??=this.fetch(e,t,r),null===(n=this.storeMap[i])||void 0===n?void 0:n.state}awaitData(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=this.keyFn(t);return n&&(this.promiseMap[r]=void 0),this.storeMap[r]??=o.default.createValue(void 0),this.promiseMap[r]??=this.fetch(e,t,n),this.promiseMap[r]}resetData(e,t){const n=this.keyFn(t),o=this.storeMap[n];if(o&&o.listenerCount()>0){const o=this.fetch(e,t,!0);return this.promiseMap[n]=o,o.then((()=>{}))}return this.promiseMap[n]=void 0,Promise.resolve(void 0)}TEST_ONLY__setData(e,t){const n=this.keyFn(e);this.promiseMap[n]=Promise.resolve(t),this.storeMap[n]??=o.default.createValue(void 0),this.storeMap[n].setState(t)}TEST_ONLY__getData(e){var t;const n=this.keyFn(e);return null===(t=this.storeMap[n])||void 0===t?void 0:t.state}TEST_ONLY__hasData(e){const t=this.keyFn(e);return void 0!==this.storeMap[t]}TEST_ONLY__addListener(e,t){const n=this.keyFn(e);this.storeMap[n]??=o.default.createValue(void 0),this.storeMap[n].addListener(t)}}async function a(e){let{environment:t,namespace:n,key:o,getValue:i,forceRefetch:a}=e;const s=t.currentUser.id,l=`{${n}}:${o}`;a&&r.Z.set({userId:t.currentUser.id,key:l,value:null});const c=r.Z.get({userId:s,key:l});if(c)return c;const d=await i();return r.Z.set({userId:t.currentUser.id,key:l,value:d}),d??void 0}},583279:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isLoading:!1,progressPercent:0}}}const i=r},469316:(e,t,n)=>{n.d(t,{V8:()=>d,ZP:()=>s,l9:()=>l});var o=n(14577),r=n(749085);class i extends r.default{getInitialState(){return{open:!1,findQuery:"",focused:!1,showReplaceInput:!1,textSelection:void 0}}isOpen(){return this.state.open}hasFindQuery(){return this.state.findQuery.length>0}isFocused(){return this.state.focused}}const a=new i,s=a,l=new o.ZP((()=>{const e=a.state;return e.open&&e.findQuery.length>0?e.findQuery:void 0}),{debugName:"FindAndReplaceOpenQueryStore"});class c extends r.default{getInitialState(){}}const d=new c},189256:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},698255:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}}const i=new r},421051:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(308297).Z)},417903:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(292595);const r=new(n(745589).Z);(0,o.exposeDebugValue)("FrameScrollerStore",r);const i=r},646735:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(150475),r=n(292595),i=n(783105),a=n(80444);const s=new class{constructor(){this.frecencyStore=void 0,this.spaceId=void 0,this.userId=void 0}get(e){const{currentSpaceStore:t}=a.default.state,n=t&&t.id;return void 0===n||void 0===e?(this.userId=void 0,this.spaceId=void 0,void(this.frecencyStore=void 0)):(this.spaceId===n&&this.userId===e||(this.spaceId=n,this.userId=e,this.frecencyStore=new i._R({store:localStorage,prefix:`BlockFrecency:${e}:${n}`,maxBlocks:100,maxStoredVisits:10,version:i.uP}),this.frecencyStore.initialize()),this.frecencyStore)}};const l={lazyFrecencyStore:s,recordVisit:function(e){const{id:t,type:n,timestampForTestingOnly:r,currentUserId:i,systemBlockType:a}=e;if((0,o.EW)(a))return;const l=s.get(i);return l?l.recordVisit({id:t,type:n,timestampForTestingOnly:r}):void 0},sortFrecencyHighToLow:function(e){const{currentUserId:t,items:n,now:o,recordFrecency:r}=e,i=s.get(t);return i?i.sortFrecencyHighToLow({items:n,now:o,recordFrecency:r}):n},getVisitedIds:function(e){const t=s.get(e);return t?t.getVisitedIds():[]},clearForUser:function(e){for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);n&&n.startsWith(`BlockFrecency:${e}`)&&localStorage.removeItem(n)}}};(0,r.exposeDebugValue)("FrecencyStore",l);const c=l},138302:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(749085),r=n(292595);class i extends o.default{getInitialState(){return{isOpen:!1,backgroundAnimationComplete:!0,fullscreenNodeAnimationComplete:!0,startScrollTop:0,skipAnimations:!1,isSaving:!1,zoomScale:1,panStartPosition:{x:0,y:0},panOffset:{x:0,y:0}}}}const a=new i;(0,r.exposeDebugValue)("GlobalFullScreenStore",a);const s=a},781258:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},27411:(e,t,n)=>{n.r(t),n.d(t,{GlobalFileUploadStore:()=>r,default:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}getKeyState(e){return this.state[e]}setKeyState(e,t){const n=this.state;let o;if(t){var r;const a=t.file.type.indexOf("image")>=0;var i;if(t.file!==(null===(r=n[e])||void 0===r?void 0:r.file)&&a)o=null===(i=n[e])||void 0===i?void 0:i.dataURL,t.dataURL=URL.createObjectURL(t.file);n[e]={...t,dataURL:t.dataURL}}else{var a;o=null===(a=n[e])||void 0===a?void 0:a.dataURL,delete n[e]}if(o){const e=o;setTimeout((()=>{URL.revokeObjectURL(e)}),1e3)}this.emit()}isUploading(e){const t=this.state,n=Object.keys(t);for(const o of n){if(e&&!e(o))continue;if(t[o])return!0}return!1}getBlockKey(e){return e}}const i=new r},896049:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(14577),r=n(155367),i=n(480796),a=n(569784),s=n(259238);const l=new o.ZP((()=>i.Z.state.isDragging||r.ZP.state.isDragging||s.Z.state.isDragging||a.default.state.isActive),{debugName:"GlobalIsDraggingStore"})},745483:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(749085),r=n(292595);class i extends o.default{getInitialState(){return{openModals:new Set}}}const a=new i,s=a;(0,r.exposeDebugValue)("GlobalModalStore",a)},803418:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(749085),r=n(292595),i=n(223196);class a extends o.default{getInitialState(){return{openPopups:new Set,namedOpenPopups:new Set}}hasOpenPopups(){const{openPopups:e,namedOpenPopups:t}=this.getState();return e.size>0||t.size>0}hasOpenMobileSlideUps(){const{openPopups:e,namedOpenPopups:t}=this.getState();if(t.size>0)return!0;for(const n of e){if(n.props.hidesMobileNativeBottomBar)return!0;if(n.props.popupType===i.k.SlideUp&&!n.props.preventSlideUpTransition)return!0}return!1}hasOpenMouseCapturePopup(){const{openPopups:e}=this.state;return e.size>0&&Array.from(e.values()).some((e=>!e.props.disableMouseCapture))}closeAll(){for(const n of this.state.openPopups){var e,t;null===(e=(t=n.props).onDismiss)||void 0===e||e.call(t,null)}}addNamedPopup(e){this.state.namedOpenPopups.add(e),this.emit()}removeNamedPopup(e){this.state.namedOpenPopups.delete(e),this.emit()}}const s=new a;(0,r.exposeDebugValue)("GlobalPopupStore",s);const l=s},269327:(e,t,n)=>{n.d(t,{Z:()=>g});var o=n(118466),r=n(749085),i=n(144615),a=n(421202),s=n(653965),l=n(619584),c=n(615447),d=n(702688),u=n(80444),p=n(206258);class m extends r.default{constructor(){super(...arguments),this.userPageVisitListenerReference=void 0,this.recentPageRefreshTimer=void 0,this.reinitializeState=async(e,t,n)=>{this.cleanup(e),await(0,c.h_)({environment:e,userId:t,spaceId:n}),this.update((e=>({...e,initialized:!0})));const o=5*l.hM;this.recentPageRefreshTimer=window.setTimeout((()=>{(0,c.h_)({environment:e,userId:t,spaceId:n})}),o),this.userPageVisitListenerReference=d.ZP.addListener((0,i.Ns)(t),s.P2(((e,n)=>(0,c.rw)(t,n)),100),void 0,e)}}getInitialState(){return{recentPages:new Map,initialized:!1}}getIsInitialized(){return this.state.initialized}cleanup(e){this.userPageVisitListenerReference&&(d.ZP.removeListener(this.userPageVisitListenerReference,e),this.userPageVisitListenerReference=void 0),this.recentPageRefreshTimer&&(clearTimeout(this.recentPageRefreshTimer),this.recentPageRefreshTimer=void 0)}getRecentPagesWithStores(e,t){const n=u.default.state.currentSpaceStore;return n?t.map((t=>({...t,store:p.G.createChildStore(n.getPagesStore(),{table:a.iU,id:t.pageId,spaceId:e})}))):[]}set(e,t){const n=this.getRecentPagesWithStores(e,t);this.update((t=>(t.recentPages.set(e,n),t.initialized=!0,t))),this.emit()}get(e){return this.state.recentPages.get(e)}getWithoutSubscribing(e){return o.Z.withListenerIgnored((()=>this.get(e)))||[]}mergeRecentPages(e,t){const n=this.getRecentPagesWithStores(t,e),o=(this.state.recentPages.get(t)??[]).concat(n),r=s.mN(o,"pageId");this.set(t,r)}}const g=new m},107844:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},325775:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{loading:!1,areAccountsFetched:!1,accountsResponse:{accounts:[]}}}}const i=new r},397788:(e,t,n)=>{n.d(t,{X:()=>a});var o=n(749085),r=n(471924);class i extends o.default{getInitialState(){return{screenToShow:"none",availableSyncControlOptions:[],syncControlSelection:void 0,initialSyncState:"none",isDisconnecting:!1,isEditing:!1,sessionId:r.Il(),analyticsFrom:"unknown",syncProgress:"not_started",syncCurrent:0,syncTotal:0,ingestionProgress:void 0,connectedSpaceId:""}}}const a=new i},997156:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1,stage:"landing"}}open(){this.setState({open:!0,stage:"landing"})}close(){this.setState({open:!1,stage:"landing"})}}const i=new r},100475:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n(61766).Z.createValue({open:!1},{})},152689:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(749085),r=n(554153);const i="currentHighlightColor";class a extends o.default{getInitialState(){return{color:Boolean(localStorage)&&r.Z.get(i)||"yellow_background"}}setHighlightColor(e){r.Z.set(i,e),this.setState({color:e})}}const s=new a},242653:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isPinned:!1}}}const i=new r},720144:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}}const i=new r},465686:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(434859);class i extends o.default{getInitialState(){return{capturingAreas:new Set}}getPreventScrollType(){let e=!1,t=!1,n=!1;return this.state.capturingAreas.forEach((o=>{o.preventType===r.Z.All?e=!0:o.preventType===r.Z.X?t=!0:o.preventType===r.Z.Y&&(n=!0)})),e||t&&n?r.Z.All:t?r.Z.X:n?r.Z.Y:r.Z.None}}const a=new i},141577:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{loaded:!1,error:!1}}}const i=r},364424:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(749085),r=n(318970),i=n(401898),a=n(296994),s=n(185529);const l={open:!0,isImageLoaded:!1,saveButtonLoading:!1,imageRef:void 0,fixedAspectSelection:void 0,aspectSelectionFlipped:!1,outerContainerSize:void 0,innerContainerSize:void 0};class c extends o.default{getInitialState(){return{open:!1}}openModal(e){const{originalSource:t,blockStore:n}=e,o="uploading"===s.Z.getStatus(n.id)&&s.Z.getMetadataByBlockId(n.id)||{...r.Wm,...n.getImageEditMetadata()};this.setState({...l,blockStore:n,originalSource:t,editMetadata:o,cropAspect:"Circle"===o.mask?1:void 0})}setSaveButtonLoading(e){this.state.open&&this.setState({...this.state,saveButtonLoading:e})}closeModal(e){var t;null==e||null===(t=e.onClose)||void 0===t||t.call(e),this.setState({open:!1})}getEditMetadata(){return this.state.open&&this.state.editMetadata||r.Wm}getIsImageLoaded(){return!!this.state.open&&this.state.isImageLoaded}setIsImageLoaded(e){this.state.open&&this.setState({...this.state,isImageLoaded:!0,imageRef:e})}setCrop(e){if(this.state.open){const t={...this.state.editMetadata,crop:e};this.setState({...this.state,editMetadata:t})}}setMask(e){if(this.state.open)switch(this.setState({...this.state,fixedAspectSelection:void 0,aspectSelectionFlipped:!1}),e){case"None":return void this.setFreeform();case"Circle":return void this.setCircleMask();default:(0,i.t1)(e)}}async setFixedAspectRatio(e,t){if(!this.state.open)return;const{width:n,height:o}=r.V3[e],i=t?o/n:n/o,a=this.state.editMetadata,s=await this.getAspectCrop(a,i);s&&this.setState({...this.state,cropAspect:i,editMetadata:{...a,crop:s,mask:"None"},fixedAspectSelection:e,aspectSelectionFlipped:t})}setFreeform(){if(!this.state.open)return;const e=this.state.editMetadata;this.setState({...this.state,cropAspect:void 0,editMetadata:{...e,mask:"None"}})}async setCircleMask(){if(!this.state.open)return;const e=this.state.editMetadata,t=await this.getAspectCrop(e,1);t&&this.setState({...this.state,cropAspect:1,editMetadata:{crop:t,mask:"Circle"}})}async getAspectCrop(e,t){if(this.state.open){var n;const o=null===(n=this.state.imageRef)||void 0===n?void 0:n.current,r=null==e?void 0:e.crop;if(!o||!r)return;const{makeAspectCrop:i}=await a.FF.imageEdit.load();return i(r,t,o.width,o.height)}}resetCrop(){this.state.open&&(this.setCrop(r.Wm.crop),this.setMask(r.Wm.mask))}}const d=new c},185529:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{images:{}}}getMetadataByBlockId(e){if(!this.hasKey(e))return;return this.state.images[e].editMetadata}setStatusPending(e,t){const n={editMetadata:t,editStatus:"pending"};this.setState({images:{...this.state.images,[e]:n}})}getStatus(e){if(!this.hasKey(e))return"completed";return this.state.images[e].editStatus}setStatusDrawing(e){if(!this.hasKey(e))return;const t={...this.state.images[e],editStatus:"drawing"};this.setState({images:{...this.state.images,[e]:t}})}setStatusUploading(e,t){if(!this.hasKey(e))return;const n={...this.state.images[e],editStatus:"uploading",dataURL:t};this.setState({images:{...this.state.images,[e]:n}})}setStatusCompleted(e,t){if(!this.hasKey(e))return;const n=this.state.images[e];if("uploading"!==n.editStatus)return;const o={...n,editStatus:"completed",secureFileURL:t};this.setState({images:{...this.state.images,[e]:o}})}setStatusError(e){if(!this.hasKey(e))return!1;const t={...this.state.images[e],editStatus:"error"};this.setState({images:{...this.state.images,[e]:t}})}getDataURL(e){if(!this.hasKey(e))return;const t=this.state.images[e];return"uploading"===t.editStatus||"completed"===t.editStatus?t.dataURL:void 0}getSecureFileURL(e){if(!this.hasKey(e))return;const t=this.state.images[e];return"completed"===t.editStatus?t.secureFileURL:void 0}hasKey(e){return this.state.images.hasOwnProperty(e)}}const i=new r},695424:(e,t,n)=>{n.d(t,{H:()=>a});var o=n(292595),r=n(554153),i=n(619584);class a{static getNumber(e){const t=r.Z.get(e);if("number"==typeof t&&!isNaN(t))return t}static getLatest(){return this.getNumber(this.LAST_TIMEOUT_STORAGE_KEY)}static trackPersistently(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();r.Z.set(this.LAST_TIMEOUT_STORAGE_KEY,e);const t=this.getTotal()??0;r.Z.set(this.TOTAL_TIMEOUTS_STORAGE_KEY,t+1)}static getTotal(){return this.getNumber(this.TOTAL_TIMEOUTS_STORAGE_KEY)}static clear(){r.Z.remove(this.LAST_TIMEOUT_STORAGE_KEY),r.Z.remove(this.TOTAL_TIMEOUTS_STORAGE_KEY)}static hasOccurredRecently(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();const t=this.getLatest();return"number"==typeof t&&e-t<this.RECENT_TIME_WINDOW_MS}}a.LAST_TIMEOUT_STORAGE_KEY="latestNotionTransactionTimeout",a.TOTAL_TIMEOUTS_STORAGE_KEY="totalNotionTransactionTimeouts",a.RECENT_TIME_WINDOW_MS=7*i.A0,(0,o.exposeDebugValue)("IndexedDBTimeoutTracker",a)},796826:(e,t,n)=>{n.d(t,{Z:()=>w});var o,r=n(354064),i=n(568626),a=n(600606),s=n(712139),l=n(653965),c=n(552629),d=n(937850),u=n(619584),p=(n(95477),n(121830)),m=n(915517),g=n(402414),f=n(863037),h=n(788632),v=n(385555),y=n(599757),b=n(626634),_=n(809425);class S{constructor(e){this.debug=!1,this.shouldStopLooping=!1,this.attemptedToClaimSessions=!1,this.isProcessingTask=!1,this.lastTaskTimestamp=0,this.events=new r.Z,this.waiter=void 0,this.transactionBackoffController=new g.h(b._W),this.retryReasonCounters={_total:0},this.errorCounts={},this.startTime=Date.now(),this.disableStorageManagerEstimate=!1,this.dependencies=void 0,this.transactionStore=void 0,this.sessionId=void 0,this.debugLogger=void 0,this.enableHeartbeatTimeout=void 0;const{dependencies:t,transactionStore:n,sessionId:o,debugLogger:a,enableHeartbeatTimeout:s}=e;this.dependencies=t,this.transactionStore=n,this.sessionId=o,this.debugLogger=a,this.enableHeartbeatTimeout=s,i.clientLogglyEnvironmentData.idbSessionId=this.sessionId,this.disableStorageManagerEstimate=v.default.checkGate({gateName:"disable_storage_manager_estimate",disableExposureLogging:!0}),this.debugLogger.log({level:"debug",from:"IndexedDBTransactionQueue",type:"createdIndexedDBTransactionQueue",data:{sessionId:this.sessionId}})}startLoop(){setTimeout((()=>{this.heartbeatLoop()}),1),setTimeout((()=>{this.txLoop()}),1),setTimeout((()=>{this.healthcheckLoop()}),1)}stopLoop(){this.debugLogger.log({level:"debug",from:"IndexedDBTransactionQueue",type:"stopLoop",data:{message:"Stopping loop."}}),this.shouldStopLooping=!0}hasAttemptedToClaimSessions(){return this.attemptedToClaimSessions}logEmptyTaskForDebugging(e){this.debugLogger.log({level:"debug",from:"IndexedDBTransactionQueue",type:"logEmptyTaskForDebugging",data:{message:`Task created by ${e} was empty.`}})}async enqueueTask(e){const t=await this.transactionStore.saveTask(this.sessionId,e,this.getIndexedDBTimeoutMs());if(this.lastTaskTimestamp=Math.max(e.timestamp,this.lastTaskTimestamp),t.error)throw this.incrementErrors(t.error,"enqueueTask"),this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:"enqueueTask",error:(0,c.Ui)(t.error)}),t.error;this.clearErrors("enqueueTask"),this.getWaitable(!1).trigger()}unpause(){this.transactionBackoffController.reset(),this.getWaitable(!1).trigger()}pause(){}getLastTaskTimestamp(){return this.lastTaskTimestamp}hasTasks(){return!!this.transactionStore&&this.transactionStore.hasTasks()}async hasTasksForUser(e){const t=await this.transactionStore.hasTasksForUser(e,this.getIndexedDBTimeoutMs());return t.error?(this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:"IndexedDBTransactionStore.hasTasksForUser",error:(0,c.Ui)(t.error)}),!1):t.value}async anySessionHasTasks(){const e=await this.transactionStore.anySessionHasTasks(this.getIndexedDBTimeoutMs());return e.error?(this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:"IndexedDBTransactionStore.anySessionHasTasks",error:(0,c.Ui)(e.error)}),!1):e.value}async drain(){return this.hasTasks()||this.isProcessingTask?new Promise((e=>{this.events.addOnceListener("drain",e)})):void 0}async awaitRecordTransaction(e){this.isPendingTransactionForRecord(e)&&await this.drain()}isPendingTransactionForRecord(e){return this.hasTask((t=>t.operations.some((t=>(0,a.qo)(t.pointer,e)))))}async reset(){await this.transactionStore.reset()}async clearForUser(e){await this.transactionStore.clearTasksForUser(e)}async checkObjectStores(){return await this.transactionStore.checkObjectStores()}async getTotalNumberOfTasks(){const e=await this.transactionStore.getTotalNumberOfTasks(this.getIndexedDBTimeoutMs());return e.error?(i.log({level:"error",from:"IndexedDBTransactionQueue",type:"getTotalNumberOfTasks",error:(0,c.Ui)(e.error)}),0):e.value}startSyncing(){h.Z.setState({...h.Z.state,syncing:!0})}updateDependencies(e){this.dependencies=e}DEV_ONLY_deadlockDb(e){return this.transactionStore.DEV_ONLY_deadlockDb(e)}debugLog(){if(this.debug){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.log("IndexedDBTransactionQueue:",...t)}}async wait(e,t){await this.getWaitable(!1).wait(e,t),this.getWaitable(!0)}async txLoop(){for(;!this.shouldStopLooping;)try{await this.txLoopIteration(),this.clearErrors("txLoop")}catch(e){this.incrementErrors(e,"txLoop"),(0,f.Os)(this.retryReasonCounters,"txLoopException"),this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:"txLoopIteration",error:(0,c.Ui)(e)}),s.IE(e),await d.Vs(15e3)}}async txLoopIteration(){const e=await this.getTasks();if(!e)return this.events.emit("drain"),void(await this.wait(...this.getMinMaxLoopDelay(!1)));const{tasks:t,sessionId:n}=e;if(0===t.length){const e=await this.transactionStore.deleteSession({currentSessionId:this.sessionId,sessionId:n});return void(e.error&&(this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:"IndexedDBTransactionStore.deleteSession",data:{sessionId:n},error:(0,c.Ui)(e.error)})))}this.startSyncing(),this.debugLogger.log({level:"debug",from:"IndexedDBTransactionQueue",type:"handleSubmitTransactionAttempt",data:{message:`for session ${n}: attempt submitTransaction with ${t.length} tasks`,sessionId:n,taskIds:k(t)}}),await this.useSaveTransactionsApi(t,n);const o=this.hasTasks();o||(this.doneSyncing(),this.events.emit("drain")),await this.wait(...this.getMinMaxLoopDelay(o))}getMinMaxLoopDelay(e){const[t,n]=(0,_.Z)()?[f.xd,f.CE]:[f.V_,f.Ud];return Boolean(e)?[t,t]:[t,n]}async useSaveTransactionsApi(e,t){const n=await this.dependencies.handleSaveTransactions(e);if(n.error){const{savedTasks:e,failedTasks:o,message:r,retryDelay:a,retryReason:s}=n.error;s?(0,f.Os)(this.retryReasonCounters,s):this.retryReasonCounters={_total:0},e.length>0&&(this.debugLogger.log({level:"debug",from:"IndexedDBTransactionQueue",type:"handlePartialSaveTransactionsSuccess",data:{message:`for session ${t}: will delete ${e.length} saved tasks`,taskIds:k(e),sessionId:t}}),await this.cleanupTasks(e,void 0)),o.length>0?(this.debugLogger.flush(),i.log({level:"warning",from:"IndexedDBTransactionQueue",type:"handleSaveTransactionsError",data:{message:`for session ${t}: ${r}`,taskIds:k(o),sessionId:t},error:(0,c.Ui)(n.error)}),await this.cleanupTasks(o,n.error)):this.debugLogger.log({level:"debug",from:"IndexedDBTransactionQueue",type:"handleSaveTransactionsRetryableError",data:{message:`for session ${t}: ${r}`,sessionId:t}}),a>0?await this.transactionBackoffController.backOffOnFailure(a-f.V_,n.error.retryReason):this.transactionBackoffController.reset()}else{const e=n.value;this.retryReasonCounters={_total:0},this.debugLogger.log({level:"debug",from:"IndexedDBTransactionQueue",type:"handleSaveTransactionsSuccess",data:{message:`for session ${t}: will delete ${e.length} saved tasks`,taskIds:k(e),sessionId:t}}),await this.cleanupTasks(e,void 0),this.transactionBackoffController.reset()}}incrementErrors(e,t){this.debugLog("incrementErrors",e,t),void 0===this.errorCounts[t]?this.errorCounts[t]=1:this.errorCounts[t]+=1;const n=l.Fp(Object.values(this.errorCounts))||0;this.errorCounts[t]===S.maxErrors+1&&(this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:`maxErrors.${t}`,error:(0,c.Ui)(e)})),n>S.maxErrors&&y.Z.setState({...y.Z.state,transactionQueueError:e}),e.type===p.vZ&&this.events.emit("timeout")}clearErrors(e){this.errorCounts[e]&&delete this.errorCounts[e];(l.Fp(Object.values(this.errorCounts))||0)<=S.maxErrors&&y.Z.setState({...y.Z.state,transactionQueueError:void 0})}async heartbeatLoop(){for(;!this.shouldStopLooping;)try{await this.heartbeat(),await d.Vs(S.heartbeatInterval)}catch(e){this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:"heartbeatLoopIteration",error:(0,c.Ui)(e)}),await d.Vs(S.heartbeatInterval)}}async heartbeat(){const e=this.enableHeartbeatTimeout?this.getIndexedDBTimeoutMs():void 0;{this.debugLog("heartbeat");const t=await this.transactionStore.heartbeat({currentSessionId:this.sessionId,isActive:!0,timeoutMs:e});if(t.error)return this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:"IndexedDBTransactionStore.heartbeat",error:(0,c.Ui)(t.error)}),void this.incrementErrors(t.error,"heartbeat");this.clearErrors("heartbeat")}{const t=Date.now()-S.claimSessionDelay,n=await this.transactionStore.claimSessions({currentSessionId:this.sessionId,staleSessionTimeoutMs:t,transactionTimeoutMs:e});if(n.error)return this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:"IndexedDBTransactionStore.claimSessions",error:(0,c.Ui)(n.error)}),void(n.error.type===p.vZ&&this.incrementErrors(n.error,"claimSessions"));this.clearErrors("claimSessions"),this.attemptedToClaimSessions=!0}this.checkStorageQuota()}async checkStorageQuota(){if(this.disableStorageManagerEstimate)return;const e=await(0,m.sK)();e&&(i.clientLogglyEnvironmentData.storageQuotaEstimate=e.quota,i.clientLogglyEnvironmentData.storageUsageEstimate=e.usage,y.Z.setState({...y.Z.state,storageUsageEstimate:e}))}doneSyncing(){h.Z.setState({...h.Z.state,syncing:!1})}hasTask(e){return this.transactionStore.hasTask(e)}async getTasks(){const e=await this.transactionStore.getTasks(this.sessionId,!0);if(e.error)throw e.error;return e.value}async cleanupTasks(e,t){for(const r of e)if(r.callback)try{r.callback(t)}catch(o){this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:"cleanupTask",data:{taskId:r.id},error:(0,c.Ui)(o)})}const n=await this.transactionStore.deleteTasks(e);n.error&&(this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:"IndexedDBTransactionStore.deleteTasks",error:(0,c.Ui)(n.error)}))}getWaitable(e){return this.waiter&&!e||(this.waiter=new d.a6),this.waiter}async healthcheckLoop(){for(;!this.shouldStopLooping;){try{var e;const t=await this.transactionStore.getTotalNumberOfTasks(S.defaultIndexedDBTimeoutMs),n={queue_type:"IndexedDBTransactionQueue",uptime:Date.now()-this.startTime,queue_size:t.error?void 0:t.value,error_type:null===(e=t.error)||void 0===e?void 0:e.type,is_considered_online:h.Z.state.online,retry_reasons:this.retryReasonCounters};(n.queue_size&&n.queue_size>S.transactionSizeHealthcheckThreshold||n.error_type)&&(this.debugLogger.flush(),i.log({level:"info",from:"IndexedDBTransactionQueue",type:"transactionSizeHealthcheck",data:{miscDataToConvertToString:n}}),this.dependencies.handleHealthcheck(n))}catch(t){this.debugLogger.flush(),i.log({level:"error",from:"IndexedDBTransactionQueue",type:"healthcheckLoopIteration",error:(0,c.Ui)(t)}),s.IE(t)}await d.Vs(S.healthcheckInterval)}}getIndexedDBTimeoutMs(){if("on"===this.dependencies.getExperimentGroup("indexeddb-transaction-timeout-v2"))return S.defaultIndexedDBTimeoutMs}}function k(e){return e.map((e=>{var t;return null!==(t=e.debug)&&void 0!==t&&t.userAction?`${e.id} (${e.debug.userAction})`:e.id}))}o=S,S.heartbeatInterval=2.5*u.C0,S.claimSessionDelay=5*o.heartbeatInterval,S.healthcheckInterval=15*u.hM,S.transactionSizeHealthcheckThreshold=1e3,S.defaultIndexedDBTimeoutMs=180*u.C0,S.maxErrors=5;const w=S},50619:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(568626),r=n(182798),i=n(796826),a=n(599757);class s{constructor(e,t){this.activeQueue=void 0,this.inMemoryTransactionQueue=void 0,this.handleIndexedDbTimeout=()=>{const e=(0,r.R9)(this.activeQueue,i.Z);e.hasTasks()||(e.stopLoop(),e.events.removeListener("timeout",this.handleIndexedDbTimeout),a.Z.reset(),this.inMemoryTransactionQueue.startLoop(),this.activeQueue=this.inMemoryTransactionQueue,o.log({level:"warning",from:"IndexedDBWithInMemoryFallbackTransactionQueue",type:"handleIndexedDbTimeout",data:{message:"IndexedDB timeout occurred while the transaction queue is empty. Switching over to InMemoryTransactionQueue."}}))},this.activeQueue=e,this.inMemoryTransactionQueue=t,e.events.addListener("timeout",this.handleIndexedDbTimeout)}startLoop(){this.activeQueue.startLoop()}logEmptyTaskForDebugging(e){var t,n;null===(t=(n=this.activeQueue).logEmptyTaskForDebugging)||void 0===t||t.call(n,e)}enqueueTask(e){return this.activeQueue.enqueueTask(e)}unpause(){this.activeQueue.unpause()}pause(){this.activeQueue.pause()}getLastTaskTimestamp(){return this.activeQueue.getLastTaskTimestamp()}hasTasks(){return this.activeQueue.hasTasks()}anySessionHasTasks(){return this.activeQueue.anySessionHasTasks()}getTotalNumberOfTasks(){return this.activeQueue.getTotalNumberOfTasks()}hasTasksForUser(e){return this.activeQueue.hasTasksForUser(e)}drain(){return this.activeQueue.drain()}awaitRecordTransaction(e){return this.activeQueue.awaitRecordTransaction(e)}isPendingTransactionForRecord(e){return this.activeQueue.isPendingTransactionForRecord(e)}reset(){return this.activeQueue.reset()}clearForUser(e){return this.activeQueue.clearForUser(e)}updateDependencies(e){this.activeQueue.updateDependencies(e),this.inMemoryTransactionQueue!==this.activeQueue&&this.inMemoryTransactionQueue.updateDependencies(e)}getIndexedDBTransactionQueue(){if(this.activeQueue instanceof i.Z)return this.activeQueue}}},964113:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{focused:!1}}}const i=r},348863:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},655899:(e,t,n)=>{n.d(t,{KU:()=>i,ZP:()=>s,fZ:()=>r});var o=n(749085);function r(e){return"existingUser"===e.type}function i(e){return"newUser"===e.type&&"email"!==e.source}class a extends o.default{getInitialState(){return{tokenQuery:"",inviteTargets:[]}}}const s=a},13086:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(749085),r=n(292595);class i extends o.default{getInitialState(){}}const a=new i;(0,r.exposeDebugValue)("ItemHoverStore",a);const s=a},121039:(e,t,n)=>{n.d(t,{L:()=>a,Z:()=>c});var o=n(749085),r=n(292595),i=n(471924);let a=function(e){return e.Cloud="Cloud",e.DataCenter="DataCenter",e}({});class s extends o.default{getInitialState(){return{open:!1,loading:!1,adminTokenError:!1,site:void 0,flowId:void 0,botId:void 0,defaultExternalCollectionSetting:void 0,spaceId:void 0,teamSpaceId:void 0,projectKeys:[],instanceValue:a.Cloud}}createNewFlowId(){const e=(0,i.Il)();return this.setState({...this.state,flowId:e}),e}getFlowId(){return this.state.flowId?this.state.flowId:this.createNewFlowId()}}const l=new s,c=l;(0,r.exposeDebugValue)("jiraImportStore",l)},222294:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isEnabled:!0,isKeyboardMode:!1}}setEnabled(e){this.setState({...this.state,isEnabled:e})}setKeyboardMode(e){this.state.isEnabled&&this.setState({isEnabled:!0,isKeyboardMode:e})}}const i=new r},623178:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1,type:"text"}}}const i=new r},723883:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{limitParents:new WeakMap}}setLimitParents(e,t){this.state.limitParents.set(e,t),this.emit()}removeLimitParents(e){this.state.limitParents.delete(e),this.emit()}}const i=new r},231104:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},437598:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}getEditedBlocksForCollection(e){const t=this.state[e];if(t)return t;{const t=new Set;return this.state[e]=t,t}}setEditedBlock(e,t){this.getEditedBlocksForCollection(e).add(t),this.emit()}}const i=new r},184166:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{}const i=new r},791390:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isActive:!1}}}const i=new r},319111:(e,t,n)=>{n.d(t,{K:()=>a,Z:()=>l});var o=n(749085),r=n(421202),i=n(672087);const a=["date","user","page","group","heading","bot","formula"];class s extends o.default{getInitialState(){return{open:!1,sessionId:void 0,userRequestStore:new i.Z,botRequestStore:new i.Z,pageRequestStore:new i.Z,mentionTypes:{page:!1,heading:!1,createPage:!1,user:!1,inviteUserToWorkspace:!1,inviteUserToPage:!1,bot:!1,date:!1,reminder:!1,templateVariable:!1,group:!1,formulaContextVariable:!1}}}updateOpenState(e){const t=this.state;t.open&&this.setState({...t,...e})}getMentionMenuContext(){const e=this.state;if(e.open)return e.textStore.table===r.iU?"block":"comment"}getInviteOrigin(){return"comment"===this.getMentionMenuContext()?"comment_mention":"inline_mention"}getIsMockText(){var e;const t=this.state;return t.open&&(null===(e=t.textStore)||void 0===e?void 0:e.inMemoryRecordCache.isMockTextStore)}}const l=new s},374510:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{numServerRequests:0,numLocalRequests:0}}}const i=new r},229798:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{focus:{section:void 0,indexLocal:void 0,indexGlobal:void 0,isInitialized:!1}}}setState(e){super.setState({...e,focus:{...e.focus,isInitialized:!0}})}update(e){this.setState(e({...this.state}))}unsetFocus(){this.setState({...this.state,focus:{section:void 0,indexLocal:void 0,indexGlobal:void 0}})}}const i=r},198720:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isConnected:!1,numConnectionAttempts:1}}}const i=new r},869454:(e,t,n)=>{n.d(t,{Z:()=>d,i:()=>l});var o=n(749085),r=n(653965),i=n(905162),a=n(924666),s=n(803418);let l=function(e){return e[e.willHide=0]="willHide",e[e.hidden=1]="hidden",e[e.willShow=2]="willShow",e[e.shown=3]="shown",e}({});class c extends o.default{constructor(){super(...arguments),this.updateKeyboardPhaseDebounced=r.Ds(((e,t)=>{this.setState({...this.state,phase:e,estimatedKeyboardWebViewOverlap:t})}),300),this.updateKeyboardPhase=(e,t,n)=>{if(!(0,i.Y)("supportsAlwaysMultiTextSelectionBehavior")){const{device:o,RouterStore:r}=e,i="page"===r.state.route.name,s=o.isAndroid&&o.isMobileNative,l="editing"===a.default.state.mode;if(i&&s&&!l)return void this.updateKeyboardPhaseDebounced(t,n)}this.setState({...this.state,phase:t,estimatedKeyboardWebViewOverlap:n})},this.keyboardHeight=()=>this.state.estimatedKeyboardWebViewOverlap,this.mobileNativeBottomPadding=e=>{const t=(0,i.Y)("supportsFixedSizeWebView")?this.state.estimatedKeyboardWebViewOverlap:0;if(t>0)return t;const{WindowSizeStore:n,TabbedRouterStore:o}=e;let r=0;if((0,i.Y)("supportsNativeBottomBarOverlappingWebView")){const e=s.Z.hasOpenMobileSlideUps(),t=o.state.modal.length>0;e||t||(r=this.state.nativeBottomBarHeight??48)}return n.state.paddingBottom+r}}getInitialState(){return{phase:l.hidden,estimatedKeyboardWebViewOverlap:0,nativeBottomBarHeight:void 0}}async onShow(e){await this.waitUntil((()=>this.state.phase===l.shown)),e()}async onHide(e){await this.waitUntil((()=>this.state.phase===l.hidden)),e()}}const d=new c},361254:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1,openAnimationCompleted:!0,closeAnimationCompleted:!0}}}const i=r},369122:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isModalOpen:!1,account:void 0,workspaces:[],isLoadingProjects:!1,mondayFoldersAndBoards:[],selectedProjectsAndTeamspaces:{},templateCreationInProgress:!1,currentTab:"selectData",loggerPageId:void 0,showAuthPopup:!1,email:void 0,APIToken:void 0,result:void 0,isComplete:!1,selectedWorkspace:void 0,isLoadingMondayWorkspaces:!1,isFetchingMondayAccount:!1}}resetImport(){const{account:e,workspaces:t}=this.getState();this.setState({...this.getInitialState(),account:e,workspaces:t})}}const i=new r},917294:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}}const i=new r},242330:(e,t,n)=>{n.d(t,{ZP:()=>s,o1:()=>r,rJ:()=>a});var o=n(749085);const r=["page","space","team","space-private-pages"];class i extends o.default{getInitialState(){return{isOpen:!1,lastPageId:void 0}}getVariant(){if(this.state.isOpen)return this.state.variant}getTargetsDatabaseType(){if(this.state.isOpen)return a(this.state.targets)}}function a(e){var t;if(0===e.length)return;const n=null===(t=e[0].getAssociatedCollectionStore())||void 0===t?void 0:t.getDatabaseType();if(n){for(const t of e){var o;if(n!==(null===(o=t.getAssociatedCollectionStore())||void 0===o?void 0:o.getDatabaseType()))return}return n}}const s=new i},453730:(e,t,n)=>{n.r(t),n.d(t,{TEST_ONLY__setTransactionQueue:()=>ne,isIndexedDbGracefulFallbackToInMemoryEnabled:()=>J,setupTransactionQueue:()=>te,transactionQueue:()=>ee});n(757658),n(21703);var o=n(336769),r=n(568626),i=n(471924),a=n(657347),s=n(653965),l=n(552629),c=n(937850),d=n(619584),u=n(300482),p=n(401898),m=n(599757),g=n(121830);const f="Transaction",h="bySessionId",v="byTimestamp",y="byId",b="byUserId",_="Session",S="bySessionId",k="byUpdatedAt",w="byOwnerSessionId";const x=45*d.C0;class I{constructor(e,t){this.db=void 0,this.debugLogger=void 0,this.runOptimizedScans=!0,this.activeTasks=new Map,this.ownedSessionIds=new Set,this.db=new g.pz(t,"TransactionStore",2,{upgrade(e,t,n,o){if(t<1&&function(e){const t=e.createObjectStore(_,{keyPath:p.MN("index"),autoIncrement:!0});t.createIndex(k,p.MN("updatedAt"),{unique:!1}),t.createIndex(w,p.MN("ownerSessionId"),{unique:!1}),t.createIndex(S,p.MN("sessionId"),{unique:!0});const n=e.createObjectStore(f,{keyPath:p.MN("index"),autoIncrement:!0});n.createIndex(v,p.MN("timestamp"),{unique:!1}),n.createIndex(h,[p.MN("sessionId"),p.MN("timestamp")],{unique:!1}),n.createIndex(y,p.MN("id"),{unique:!0})}(e),t<2){o.objectStore(f).createIndex(b,p.MN("userId"))}}}),this.debugLogger=e,this.runOptimizedScans=!t.device.isEdgeHTML}async DEV_ONLY_deadlockDb(e){throw new Error("This function is only available in development builds.")}async heartbeat(e){const{currentSessionId:t,isActive:n,timeoutMs:o}=e,i=n?[_,f]:[_],a=await this.db.startTransaction({storeNames:i,mode:"readwrite",name:"IndexedDBTransactionStore.heartbeat",timeoutMs:o},(async(e,o)=>{const i=new Set,a=e.objectStore(_);let s=await a.index(w).openCursor(t);o("Obtained session cursor.");let c=0;for(;s;){c+=1;const e=s.value;e.sessionId!==t&&i.add(e.sessionId);const n={...e,updatedAt:Date.now()};s.update(n),s=await s.continue()}if(o(`Finished processing ${c} sessions.`),n){const t=e.objectStore(f).index(y),n=Date.now()-x;o(`Processing ${this.activeTasks.size} active tasks.`),this.activeTasks.forEach((async e=>{if(e.timestamp>=n)return;if(!(await t.get(e.id))){if(e.callback)try{e.callback(void 0)}catch(o){this.debugLogger.flush(),r.log({level:"error",from:"IndexedDBTransactionStore",type:"activeTaskGarbageCollectCleanupError",error:(0,l.Ui)(o)})}this.debugLogger.flush(),r.log({level:"warning",from:"IndexedDBTransactionStore",type:"activeTaskGarbageCollect",data:{miscDataToConvertToString:{task:e,expireTime:n}}}),this.activeTasks.delete(e.id)}}))}return{value:i}}));return a.error?a:(this.ownedSessionIds=a.value,{value:void 0})}async claimSessions(e){const{currentSessionId:t,staleSessionTimeoutMs:n,transactionTimeoutMs:o}=e,r=await this.db.startTransaction({storeNames:[_],mode:"readwrite",name:"IndexedDBTransactionStore.claimSessions",timeoutMs:o},(async(e,o)=>{const r=[],i=e.objectStore(_);let a=await i.index(k).openCursor(IDBKeyRange.upperBound(n));for(o("Obtained session cursor.");a;){const e=a.value,n={...e,ownerSessionId:t,updatedAt:Date.now()};r.push(e.sessionId),o(`Taking ownership of session ${e.sessionId}.`);const i=Date.now()-e.updatedAt;this.debugLogger.log({from:"IndexedDBTransactionStore",level:"debug",type:"claimSession",data:{message:`claimed ${e.sessionId} updated ${i}ms ago`,sessionId:e.sessionId,sinceLastUpdate:i}}),a.update(n),a=await a.continue()}return{value:r}}));if(r.error)return r;for(const i of r.value)this.ownedSessionIds.add(i);return{value:void 0}}getTasks(e,t){return this.db.startTransaction({storeNames:[_,f],mode:"readonly",name:"IndexedDBTransactionStore.getTasks",timeoutMs:void 0},(async(n,o)=>{let r;const i=[],a=n.objectStore(_);let s=await a.index(w).openCursor(e);for(o("Obtained session cursor.");s;){const e=s.value;i.push(e),s=await s.continue()}if(o(`Found ${i.length} owned sessions.`),0===i.length)return{value:void 0};i.sort(((e,t)=>e.index-t.index));const l=i[0].sessionId,c=[];let d=await this.createTransactionCursor(n,l);for(;d;){const e=d.value;(0,u.dj)(e.operations);const t=this.activeTasks.get(e.id);e.sessionId===l&&c.push({...e,callback:t&&t.callback}),d=await d.continue()}return o(`Found ${c.length} tasks.`),r={sessionId:l,tasks:c},t?r.tasks.sort(((e,t)=>e.index&&t.index?e.index-t.index:e.timestamp-t.timestamp)):r.tasks.sort(((e,t)=>e.timestamp-t.timestamp)),{value:r}}))}saveTask(e,t,n){const o={id:t.id,userId:t.userId,spaceId:t.spaceId,sessionId:e,timestamp:t.timestamp,debug:t.debug,operations:t.operations,useSudoMode:t.useSudoMode};return m.Z.setOrIncTotal(this.activeTasks.size+1),this.activeTasks.set(o.id,t),this.db.startTransaction({storeNames:[_,f],mode:"readwrite",name:"IndexedDBTransactionStore.saveTask",timeoutMs:n},(async(t,n)=>{const r=t.objectStore(_),i=await r.index(S).get(e);if(n("Obtained session cursor."),!i){const t={sessionId:e,updatedAt:Date.now(),ownerSessionId:e};n(`Adding session ${t.sessionId}.`);try{await r.add(t)}catch(s){throw(0,g.XH)((0,a.t)(s),`session ${t.sessionId}`)}}try{await t.objectStore(f).add(o)}catch(s){throw(0,g.XH)((0,a.t)(s),`task ${o.id}`)}return this.debugLogger.log({from:"IndexedDBTransactionStore",type:"saveTask",level:"debug",data:{message:`create task ${o.id} in ${i?"existing":"NEW"} session ${e}`,sessionId:e,taskId:o.id,isNewSession:!Boolean(i)}}),{value:void 0}}))}async deleteSession(e){const{currentSessionId:t,sessionId:n}=e,o=await this.db.startTransaction({storeNames:[_,f],mode:"readwrite",name:"IndexedDBTransactionStore.deleteSession",timeoutMs:void 0},(async(e,o)=>{let r=await this.createTransactionCursor(e,n);for(o("Obtained transaction cursor.");r;){if(r.value.sessionId===n)return{value:`Attempt to delete non-empty session: has task ${r.value.id}`,abort:!0};r=await r.continue()}const i=e.objectStore(_),a=await i.index(S).get(n);if(!a)return{value:"Session is missing",abort:!0};const s=a;return s.ownerSessionId!==t?{value:`Attempt to delete another tab's session: owned by ${s.ownerSessionId}`,abort:!0}:(i.delete(s.index),{value:void 0})}));return o.error?o:o.value?{error:{type:"LogicalError",message:o.value,userDetails:"Could not perform an operation due to a logical error."}}:{value:void 0}}hasTasks(){return this.activeTasks.size>0||this.ownedSessionIds.size>0}getTotalNumberOfTasks(e){return this.db.startTransaction({storeNames:[f],mode:"readonly",name:"IndexedDBTransactionStore.getTotalNumberOfTasks",timeoutMs:e},(async e=>{const t=e.objectStore(f);return{value:await t.count()}}))}getTotalNumberOfTasksForUser(e,t){return this.db.startTransaction({storeNames:[f],mode:"readonly",name:"IndexedDBTransactionStore.getTotalNumberOfTasksForUser",timeoutMs:t},(async t=>{const n=t.objectStore(f).index(b);return{value:await n.count(e)}}))}async anySessionHasTasks(e){const t=await this.getTotalNumberOfTasks(e);return t.error?t:{value:t.value>0}}async hasTasksForUser(e,t){const n=await this.getTotalNumberOfTasksForUser(e,t);return n.error?n:{value:n.value>0}}hasTask(e){for(const[,t]of this.activeTasks)if(e(t))return!0;return!1}async deleteTasks(e){const t=await this.db.startTransaction({storeNames:[f,_],mode:"readwrite",name:"IndexedDBTransactionStore.deleteTasks",timeoutMs:void 0},(async(t,n)=>{const o=[],i=[],a=new Set,s=t.objectStore(f),l=s.index(y),c=t.objectStore(_);await(0,g.qv)(e.map((0,g.zp)((async e=>{o.push(e.id);const t=await l.openCursor(e.id);if(n(`Obtained transaction cursor for task ${e.id}.`),t){a.add(t.value.sessionId),await t.delete(),n(`Deleted task ${e.id}.`);const o=String(e.id);this.debugLogger.log({from:"IndexedDBTransactionStore",type:"deleteTasksDeleteTask",level:"debug",data:{message:`delete task ${e.id}`,taskId:o}})}else this.debugLogger.flush(),r.log({from:"IndexedDBTransactionStore",type:"deleteTasksTaskNotExist",level:"warning",data:{message:`could not delete task not stored in indexeddb ${e.id}`,taskId:e.id}})}))));const d=s.index(h);return a.forEach((async e=>{let n=0;if(this.runOptimizedScans)n=await d.count(this.getTransactionRange(e));else{let o=await this.createTransactionCursor(t,e);for(;o;){if(o.value.sessionId===e){n++;break}o=await o.continue()}}if(0===n){const t=await c.index(S).openCursor(e);t&&(i.push(t.value.sessionId),t.delete(),this.debugLogger.log({from:"IndexedDBTransactionStore",type:"deleteTasksDeleteSession",level:"debug",data:{message:`delete empty session ${e}`,sessionId:e}}))}})),{value:{deletedTaskIds:o,deletedSessionIds:i}}}));if(t.error)return t;const{deletedTaskIds:n,deletedSessionIds:o}=t.value;for(const r of n)this.activeTasks.delete(r);for(const r of o)this.ownedSessionIds.delete(r);return m.Z.updateRemaining(this.activeTasks.size),{value:void 0}}async checkObjectStores(){const e="IndexedDBTransactionStore.checkObjectStores",t=this.db.startTransaction({storeNames:["Session"],mode:"readonly",name:`${e}: read from Session object store`,timeoutMs:void 0},(async()=>Promise.resolve({value:"created IndexedDB transaction"}))),n=this.db.startTransaction({storeNames:["Transaction"],mode:"readonly",name:`${e}: read from Transaction object store`,timeoutMs:void 0},(async()=>Promise.resolve({value:"created IndexedDB transaction"}))),[o,r]=await Promise.all([t,n]);return{session:o,transaction:r}}async reset(){await this.db.reset(),this.activeTasks.clear(),this.ownedSessionIds.clear(),m.Z.updateRemaining(0)}async clearTasksForUser(e){const t=await this.db.startTransaction({storeNames:[f],mode:"readwrite",name:"IndexedDBTransactionStore.clearTasksForUser",timeoutMs:void 0},(async(t,n)=>{const o=[],r=t.objectStore(f);let i=await r.index(b).openCursor(IDBKeyRange.only(e));for(n("Obtained transaction cursor.");i;)o.push(i.value.id),await i.delete(),i=await i.continue();return{value:{deletedTaskIds:o}}}));if(t.error)return t;const{deletedTaskIds:n}=t.value;for(const o of n)this.activeTasks.delete(o);m.Z.updateRemaining(this.activeTasks.size)}getTransactionRange(e){return IDBKeyRange.bound([e,0],[e,Number.MAX_VALUE],!0,!0)}createTransactionCursor(e,t){const n=e.objectStore("Transaction");return this.runOptimizedScans?n.index(h).openCursor(this.getTransactionRange(t),"next"):n.openCursor()}}var C=n(915517),T=n(797448),M=n(354064),P=n(600606),A=n(712139),R=n(863037),D=n(788632),B=n(626634),E=n(344381),F=n(308523);const Z="NativeBackedTransactionQueue";class U{constructor(e,t,n){this.lastTaskTimestamp=0,this.tasks=new Map,this.sessionId="00000000-0000-0000-0000-000000000000",this.events=new M.Z,this.retryReasonCounters={_total:0},this.startTime=Date.now(),this.debugLogger=new r.BatchedLogger({from:Z,type:"BulkDebug",level:"info",maxLength:250}),this.connection=e,this.dependencies=t,r.log({from:Z,level:"debug",type:"NativeBackedTransactionQueueCreated"}),n.subscribeToUpdateTransactionState((e=>this.updateTransactionState(e)))}async enqueueTask(e){this.lastTaskTimestamp=Math.max(e.timestamp,this.lastTaskTimestamp);const t=0===this.tasks.size;var n;(this.tasks.set(e.id,{...e,sessionId:this.sessionId}),this.hasTooManyOperations(e))&&r.log({from:Z,type:"enqueueTask",level:"warning",data:{message:`enqueing task with operation count > ${U.operationCountWarningThreshold}`,sessionId:this.sessionId,taskId:e.id,isNewSession:t,userAction:null===(n=e.debug)||void 0===n?void 0:n.userAction,miscDataToConvertToString:{operationsCount:e.operations.length}}});const o=JSON.stringify(e.operations).length;var i;this.stringifiedOperationSizeIsTooLarge(o)&&r.log({from:Z,type:"enqueueTask",level:"warning",data:{message:`enqueing task with stringified operation count > ${U.stringifiedOperationSizeByteThreshold} bytes`,sessionId:this.sessionId,taskId:e.id,isNewSession:t,userAction:null===(i=e.debug)||void 0===i?void 0:i.userAction,miscDataToConvertToString:{operationsCount:e.operations.length,stringifiedOperationsSize:o}}});await async function(e,t){await F.v`
		INSERT OR REPLACE INTO transactions (
		    id,
		    user_id,
		    space_id,
		    operations,
		    timestamp,
			debug
		)
		VALUES (
		    ${t.id},
		    ${t.userId||null},
		    ${t.spaceId||null},
		    ${JSON.stringify(t.operations)},
		    ${t.timestamp},
			${t.debug?JSON.stringify(t.debug):null}
		)
	`.run(e)}(this.connection,e),this.debugLogger.log({from:Z,type:"enqueueTask",level:"debug",data:{message:`save task ${e.id} in memory (${this.tasks.size} total now)`,sessionId:this.sessionId,taskId:e.id,isNewSession:t}})}startLoop(){this.dependencies.timeSource.setTimeout((()=>this.healthcheckLoop()),1)}unpause(){}pause(){}getLastTaskTimestamp(){return this.lastTaskTimestamp}hasTasks(){return this.tasks.size>0}async hasTasksForUser(e){const t=await async function(e,t){return(await(0,E.gU)({connection:e,sql:"SELECT COUNT(*) AS count FROM transactions WHERE user_id = ?",args:[t]}))[0].count}(this.connection,e);return t>0}async getTotalNumberOfTasks(){return await async function(e){return(await(0,E.gU)({connection:e,sql:"SELECT COUNT(*) AS count FROM transactions"}))[0].count}(this.connection)}async anySessionHasTasks(){return await this.getTotalNumberOfTasks()>0}async reset(){await async function(e){await F.v`DELETE FROM transactions`.run(e)}(this.connection),this.tasks.clear()}async clearForUser(e){const t=await async function(e,t){const[n]=await(0,E.G$)({connection:e,statements:[{sql:"SELECT * FROM transactions WHERE user_id = ?",args:[t],getData:!0},{sql:"DELETE FROM transactions WHERE user_id = ?",args:[t]}],queryName:"deleteTransactionsForUser"});return n.data.map((e=>e.id))}(this.connection,e);for(const n of t)this.tasks.delete(n)}updateDependencies(e){this.dependencies=e}async awaitRecordTransaction(e){this.isPendingTransactionForRecord(e)&&await this.drain()}isPendingTransactionForRecord(e){return Array.from(this.tasks.values()).some((t=>t.operations.some((t=>(0,P.qo)(t.pointer,e)))))}hasTooManyOperations(e){return e.operations.length>=U.operationCountWarningThreshold}stringifiedOperationSizeIsTooLarge(e){return e>=U.stringifiedOperationSizeByteThreshold}async drain(){return this.tasks.size>0?new Promise((e=>{this.events.addOnceListener("drain",e)})):void 0}async healthcheckLoop(){for(;;){try{const e=await this.getTotalNumberOfTasks();e>U.transactionSizeHealthcheckThreshold&&(this.debugLogger.flush(),r.log({level:"info",from:"NativeBackedSqliteTransactionQueue",type:"transactionSizeHealthcheck",data:{miscDataToConvertToString:{queueSize:e}}}),this.dependencies.handleHealthcheck({queue_type:"NativeBackedSqliteTransactionQueue",uptime:Date.now()-this.startTime,queue_size:e,error_type:void 0,is_considered_online:D.Z.state.online,retry_reasons:this.retryReasonCounters}))}catch(e){this.debugLogger.flush(),r.log({level:"error",from:"NativeBackedSqliteTransactionQueue",type:"healthcheckLoopIteration",error:(0,l.Ui)(e)}),A.IE(e)}await c.Vs(U.healthcheckInterval,this.dependencies.timeSource)}}updateTransactionState(e){(e.syncing||this.hasTasks())&&D.Z.setState({...D.Z.state,syncing:!0});let t=[],n=[];if(e.saveTransactionResult)if(e.saveTransactionResult.error){const{retryReason:o}=e.saveTransactionResult.error;o?(0,R.Os)(this.retryReasonCounters,o):this.retryReasonCounters={_total:0},t=e.saveTransactionResult.error.savedTasks.map((e=>this.tasks.get(e.id))).filter(p.$K),n=e.saveTransactionResult.error.failedTasks.map((e=>this.tasks.get(e.id))).filter(p.$K),(0,B.o)({backoffEstimate:void 0,retryReason:o})}else this.retryReasonCounters={_total:0},t=e.saveTransactionResult.value.map((e=>this.tasks.get(e.id))).filter(p.$K),n=[],(0,B.Om)();t.forEach((e=>{if(e.callback)try{e.callback(void 0)}catch(t){this.debugLogger.flush(),r.log({level:"error",from:"NativeBackedTransactionQueue",type:"updateTransactionStateSavedTask",data:{taskId:e.id},error:(0,l.Ui)(t)})}this.tasks.delete(e.id)})),n.forEach((e=>{if(e.callback)try{e.callback(new Error(`Failed to save transaction with id: ${e.id}`))}catch(t){this.debugLogger.flush(),r.log({level:"error",from:"NativeBackedTransactionQueue",type:"updateTransactionStateFailedTask",data:{taskId:e.id},error:(0,l.Ui)(t)})}this.tasks.delete(e.id),this.dependencies.rollbackTask(e)})),e.syncing||this.hasTasks()||(D.Z.setState({...D.Z.state,syncing:!1}),this.events.emit("drain"))}}U.healthcheckInterval=5*d.hM,U.transactionSizeHealthcheckThreshold=1e3,U.operationCountWarningThreshold=500,U.stringifiedOperationSizeByteThreshold=1e5;var V=n(695424),N=n(182798),O=n(796826);class L{constructor(e,t){this.activeQueue=void 0,this.inMemoryTransactionQueue=void 0,this.indexedDBDrainListener=void 0,this.debugLogger=void 0,this.activeQueue=e,this.inMemoryTransactionQueue=t,this.indexedDBDrainListener=()=>this.handleIndexedDBQueueDrain(),this.debugLogger=new r.BatchedLogger({from:"IndexedDBToInMemoryTransactionQueue",type:"BulkDebug",level:"info",maxLength:250}),setTimeout((()=>{this.activeQueue instanceof O.Z&&(this.debugLogger.log({level:"error",from:"IndexedDBToInMemoryTransactionQueue",type:"constructor",data:{message:"IndexedDBTransactionQueue has not drained after 5 minutes."}}),this.debugLogger.flush())}),5*d.hM)}startLoop(){if(this.activeQueue instanceof O.Z){this.activeQueue.events.addListener("drain",this.indexedDBDrainListener)}this.activeQueue.startLoop()}handleIndexedDBQueueDrain(){const e=(0,N.R9)(this.activeQueue,O.Z);e.hasAttemptedToClaimSessions()&&(e.stopLoop(),e.events.removeListener("drain",this.indexedDBDrainListener),this.inMemoryTransactionQueue.startLoop(),this.activeQueue=this.inMemoryTransactionQueue,this.debugLogger.log({level:"info",from:"IndexedDBToInMemoryTransactionQueue",type:"constructor",data:{message:"Switching over from IndexedDBTransactionQueue to InMemoryTransactionQueue."}}))}logEmptyTaskForDebugging(e){var t,n;null===(t=(n=this.activeQueue).logEmptyTaskForDebugging)||void 0===t||t.call(n,e)}enqueueTask(e){return this.activeQueue.enqueueTask(e)}unpause(){this.activeQueue.unpause()}pause(){this.activeQueue.pause()}getLastTaskTimestamp(){return this.activeQueue.getLastTaskTimestamp()}hasTasks(){return this.activeQueue.hasTasks()}anySessionHasTasks(){return this.activeQueue.anySessionHasTasks()}getTotalNumberOfTasks(){return this.activeQueue.getTotalNumberOfTasks()}hasTasksForUser(e){return this.activeQueue.hasTasksForUser(e)}drain(){return this.activeQueue.drain()}awaitRecordTransaction(e){return this.activeQueue.awaitRecordTransaction(e)}isPendingTransactionForRecord(e){return this.activeQueue.isPendingTransactionForRecord(e)}reset(){return this.activeQueue.reset()}clearForUser(e){return this.activeQueue.clearForUser(e)}updateDependencies(e){this.activeQueue.updateDependencies(e),this.inMemoryTransactionQueue!==this.activeQueue&&this.inMemoryTransactionQueue.updateDependencies(e)}}var j=n(50619),K=n(402414),z=n(809425);const q="InMemoryTransactionQueue";class H{constructor(e){this.isProcessingTask=!1,this.lastTaskTimestamp=0,this.tasks=new Map,this.events=new M.Z,this.waiter=void 0,this.transactionBackoffController=new K.h(B._W),this.sessionId="00000000-0000-0000-0000-000000000000",this.retryReasonCounters={_total:0},this.startTime=Date.now(),this.debugLogger=new r.BatchedLogger({from:q,type:"BulkDebug",level:"info",maxLength:250}),this.dependencies=e}startLoop(){this.dependencies.timeSource.setTimeout((()=>this.txLoop()),1),this.dependencies.timeSource.setTimeout((()=>this.healthcheckLoop()),1)}enqueueTask(e){this.lastTaskTimestamp=Math.max(e.timestamp,this.lastTaskTimestamp);const t=0===this.tasks.size;return this.tasks.set(e.id,{...e,sessionId:this.sessionId}),m.Z.setOrIncTotal(this.tasks.size),this.debugLogger.log({from:q,type:"saveTask",level:"debug",data:{message:`save task ${e.id} in memory (${this.tasks.size} total now)`,sessionId:this.sessionId,taskId:e.id,isNewSession:t}}),this.getWaitable(!1).trigger(),Promise.resolve()}unpause(){this.transactionBackoffController.reset(),this.getWaitable(!1).trigger()}pause(){}getLastTaskTimestamp(){return this.lastTaskTimestamp}hasTasks(){return this.tasks.size>0}async hasTasksForUser(e){return Promise.resolve(Array.from(this.tasks.values()).some((t=>t.userId===e)))}updateDependencies(e){this.dependencies=e}async getTotalNumberOfTasks(){return Promise.resolve(this.tasks.size)}async anySessionHasTasks(){return Promise.resolve(this.hasTasks())}async drain(){return this.hasTasks()||this.isProcessingTask?new Promise((e=>{this.events.addOnceListener("drain",e)})):void 0}async awaitRecordTransaction(e){this.isPendingTransactionForRecord(e)&&await this.drain()}isPendingTransactionForRecord(e){return Array.from(this.tasks.values()).some((t=>t.operations.some((t=>(0,P.qo)(t.pointer,e)))))}async reset(){return this.tasks=new Map,m.Z.updateRemaining(0),Promise.resolve()}async clearForUser(e){const t=Array.from(this.tasks.values()).filter((t=>t.userId===e));for(const n of t)this.tasks.delete(n.id);return m.Z.updateRemaining(this.tasks.size),Promise.resolve()}async txLoop(){for(;;)try{await this.txLoopIteration()}catch(e){(0,R.Os)(this.retryReasonCounters,"txLoopException"),this.debugLogger.flush(),r.log({level:"error",from:q,type:"txLoopIteration",error:(0,l.Ui)(e)}),A.IE(e),await c.Vs(15e3,this.dependencies.timeSource)}}async txLoopIteration(){const e=this.hasTasks();e||(this.doneSyncing(),this.events.emit("drain"));const[t,n]=(0,z.Z)()?[R.xd,R.CE]:[R.V_,R.Ud];await this.wait(t,e?t:n);const o=Array.from(this.tasks.values()),i=Array.from(o).sort(((e,t)=>e.timestamp-t.timestamp));if(0===i.length)return;const a=[];for(let r=0;r<i.length;r++)i[r]!==o[r]&&a.push(r);a.length>0&&r.log({from:q,level:"warning",type:"TasksNotOrdered",data:{miscDataToConvertToString:{unsortedTaskIds:o.map((e=>e.id)),mismatch:a},taskIds:i.map((e=>e.id))}}),this.startSyncing(),await this.useSaveTransactionsApi(i)}async useSaveTransactionsApi(e){const t=await this.dependencies.handleSaveTransactions(e);if(t.error){const{savedTasks:e,failedTasks:o,message:i,retryDelay:a,retryReason:s}=t.error;var n;if(s?(0,R.Os)(this.retryReasonCounters,s):this.retryReasonCounters={_total:0},e.length>0&&(this.debugLogger.log({level:"debug",from:q,type:"handlePartialSaveTransactionsSuccess",data:{message:`will delete ${e.length} saved tasks`,taskIds:e.map((e=>e.id))}}),await this.cleanupTasks(e,void 0)),o.length>0?(this.debugLogger.flush(),r.log({level:"warning",from:q,type:"handleSaveTransactionsError",data:{message:i,taskIds:o.map((e=>e.id))},error:(0,l.Ui)(t.error)}),await this.cleanupTasks(o,t.error)):this.debugLogger.log({level:"debug",from:q,type:"handleSaveTransactionsRetryableError",data:{message:i}}),a>0)await this.transactionBackoffController.backOffOnFailure(a-R.V_,null===(n=t.error)||void 0===n?void 0:n.retryReason);else this.transactionBackoffController.reset()}else{const e=t.value;this.retryReasonCounters={_total:0},this.debugLogger.log({level:"debug",from:q,type:"handleSaveTransactionsSuccess",data:{message:`will clean up ${e.length} submitted tasks`,taskIds:e.map((e=>e.id))}}),this.transactionBackoffController.reset(),await this.cleanupTasks(e,void 0)}}async cleanupTasks(e,t){for(const o of e)if(o.callback)try{o.callback(t)}catch(n){this.debugLogger.flush(),r.log({level:"error",from:"InMemoryTransactionQueue",type:"cleanupTask",data:{taskId:o.id},error:(0,l.Ui)(n)})}for(const o of e)this.debugLogger.log({from:q,type:"deleteTasksDeleteTask",level:"debug",data:{message:`delete task ${o.id}`,taskId:o.id}}),this.tasks.delete(o.id);return m.Z.updateRemaining(this.tasks.size),Promise.resolve()}getWaitable(e){return this.waiter&&!e||(this.waiter=new c.a6(this.dependencies.timeSource)),this.waiter}async wait(e,t){await this.getWaitable(!1).wait(e,t),this.getWaitable(!0)}startSyncing(){D.Z.setState({...D.Z.state,syncing:!0})}doneSyncing(){D.Z.setState({...D.Z.state,syncing:!1})}async healthcheckLoop(){for(;;){try{const e=await this.getTotalNumberOfTasks();if(e>H.transactionSizeHealthcheckThreshold){const t={queue_type:"InMemoryTransactionQueue",uptime:Date.now()-this.startTime,queue_size:e,error_type:void 0,is_considered_online:D.Z.state.online,retry_reasons:this.retryReasonCounters};this.debugLogger.flush(),r.log({level:"info",from:"InMemoryTransactionQueue",type:"transactionSizeHealthcheck",data:{miscDataToConvertToString:{queueSize:e}}}),this.dependencies.handleHealthcheck(t)}}catch(e){this.debugLogger.flush(),r.log({level:"error",from:"InMemoryTransactionQueue",type:"healthcheckLoopIteration",error:(0,l.Ui)(e)}),A.IE(e)}await c.Vs(H.healthcheckInterval,this.dependencies.timeSource)}}}H.healthcheckInterval=15*d.hM,H.transactionSizeHealthcheckThreshold=1e3;const G=H;var W=n(368026);const $="FeatureFlagTransactionQueue",Y="00000000-0000-0000-0000-000000000000";async function Q(e){if(!window.indexedDB)return{available:!1,message:"The IndexedDB API is missing or disabled on this platform."};if(e.device.isFirefox){const e="FirefoxFeatureCheck";if(!(await new Promise((t=>{const n=window.indexedDB.open(e);n.onerror=()=>t(!1),n.onsuccess=()=>{t(!0),window.indexedDB.deleteDatabase(e)}}))))return{available:!1,message:"IndexedDB is disabled in Firefox Private Browsing."}}if(e.device.isChrome&&parseInt(e.device.browserVersion,10)>=99){const e="Chrome99FeatureCheck";let n=!1;try{if(n=await new Promise((t=>{const n=window.indexedDB.open(e);n.onerror=()=>t(!1),n.onsuccess=()=>{t(!0),window.indexedDB.deleteDatabase(e)}})),!n)return{available:!1,message:"IndexedDB is unstable in Chrome 99."}}catch(t){return{available:!1,message:(0,a.t)(t).message}}}return J()&&V.H.hasOccurredRecently()?{available:!1,message:"A NotionTransactionTimeout has happened recently, avoiding use of IndexedDB.",previousTimeouts:V.H.getTotal()}:{available:!0}}const J=s.HP((()=>"on"===(0,T.fastGetGroup)("indexeddb_graceful_fallback_to_in_memory_queue")));async function X(e){const t=new W.TransactionQueueDependenciesImpl(e);async function n(){const n=await Q(e);if(!n.available)return r.log({from:$,level:"warning",type:"preferIndexedDBUnavailable",data:{previousTimeouts:n.previousTimeouts,miscDataToConvertToString:{message:n.message,userAgent:navigator.userAgent}}}),o();r.log({from:$,type:"preferIndexedDB",level:"info"});const a=function(e,t){const n="react-native"===e.device.platform?Y:i.Il(),o=new r.BatchedLogger({from:"IndexedDBTransactionQueue",type:"BulkDebug",level:"info",maxLength:250}),a=new I(o,e);return new O.Z({dependencies:t,transactionStore:a,sessionId:n,debugLogger:o,enableHeartbeatTimeout:J()})}(e,t),c=await(0,C.sK)();if(c&&!(0,C.mn)(c)){let e=!1;try{e=await a.anySessionHasTasks(),r.log({from:$,type:"indexedDBStorageVeryFull",level:"warning",data:{storage:{hasTasks:e,...c}}})}catch(d){r.log({from:$,level:"error",type:"indexedDBStorageReadError",data:{storage:c},error:(0,l.Ui)(d)})}if(!e)return new G(t)}if(e.device.isFirefox)try{const e=await a.checkObjectStores(),n=s.oA([e.transaction,e.session].map((e=>e.error)));if(n.length>0){const o=[];return e.transaction.error&&o.push("Transaction"),e.session.error&&o.push("Session"),r.log({from:$,level:"error",type:"FirefoxHealthCheckFailed",error:{miscErrorString:(0,l.LK)(n)},data:{message:`Can't read ${o}. Using InMemoryTransactionQueue instead.`}}),new G(t)}}catch(d){return r.log({from:$,level:"error",type:"indexedDBHealthCheckError",error:(0,l.Ui)(d)}),new G(t)}return J()?(a.events.addListener("timeout",(()=>{V.H.trackPersistently()})),new j.Z(a,new G(t))):a}function o(){return r.log({from:$,type:"preferInMemory",level:"info"}),new G(t)}const{device:a,mobileNative:u}=e;if(a.isBrowser&&a.isDesktop){if(a.isChrome||a.isFirefox)return n();if(a.isSafari){if(parseInt(a.browserVersion,10)<17)return n();const e=await n();if(e instanceof O.Z){if((await c.OI(15*d.C0,e.anySessionHasTasks())).result)return r.log({from:$,type:"Safari17.usingIndexedDBToInMemoryTransactionQueue",level:"info"}),new L(e,o())}return r.log({from:$,type:"Safari17.usingInMemoryTransactionQueue",level:"info"}),o()}return o()}return a.isBrowser&&a.isMobile?o():a.isElectron?n():a.isMobileNative&&u&&u.sqliteConnection?new U(u.sqliteConnection,t,u):o()}(0,o.exposeDebugEnvironmentValue)("getIndexedDBAvailability",(e=>()=>Q(e)));let ee=new class{constructor(e,t){this.getActiveQueueName=void 0,this.queues=void 0,this.createQueues=void 0,this.getActiveQueueName=e,this.createQueues=t}getQueues(){const e=this.queues?this.queues:this.createQueues();return this.queues=e,e}applyToAllQueues(e){return Object.values(this.getQueues()).map(e)}applyToActiveQueue(e){return e(this.getQueues()[this.getActiveQueueName()])}startLoop(){this.applyToAllQueues((e=>e.startLoop()))}enqueueTask(e){return this.applyToActiveQueue((t=>t.enqueueTask(e)))}unpause(){this.applyToAllQueues((e=>e.unpause()))}pause(){this.applyToAllQueues((e=>e.pause()))}getLastTaskTimestamp(){return this.applyToActiveQueue((e=>e.getLastTaskTimestamp()))}hasTasks(){return this.applyToAllQueues((e=>e.hasTasks())).some(Boolean)}async hasTasksForUser(e){return(await Promise.all(this.applyToAllQueues((t=>t.hasTasksForUser(e))))).some((e=>e))}updateDependencies(e){this.applyToAllQueues((t=>t.updateDependencies(e)))}async anySessionHasTasks(){for(const e of this.applyToAllQueues((e=>e.anySessionHasTasks())))if(await e)return!0;return!1}async getTotalNumberOfTasks(){return s.Sm(await Promise.all(this.applyToAllQueues((e=>e.getTotalNumberOfTasks()))))}async drain(){await Promise.all(this.applyToAllQueues((e=>e.drain())))}awaitRecordTransaction(e){return this.applyToActiveQueue((t=>t.awaitRecordTransaction(e)))}isPendingTransactionForRecord(e){return this.applyToAllQueues((t=>t.isPendingTransactionForRecord(e))).some(Boolean)}async reset(){await Promise.all(this.applyToAllQueues((e=>e.reset())))}async clearForUser(e){await Promise.all(this.applyToAllQueues((t=>t.clearForUser(e))))}}((()=>"error"),(()=>{throw new Error("Need to await setupTransactionQueue")}));async function te(e){return ee=await X(e),ee}function ne(e){ee=e}},141737:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isMeasuring:!1}}}const i=new r},661802:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(153223),r=n(80444);function i(){var e;const t=null===(e=r.default.state.mainEditorCurrentBlockStore)||void 0===e?void 0:e.getType();if(t)return"collection_view_page"===t||"collection_view"===t?"collection":"page"}function a(e){const t=null===(n=o.Xm.CollectionViewBlock.getLoadingMetrics())||void 0===n?void 0:n.resolvedAt;var n;return!!t&&(e?e<t:void 0)}const s=new class{constructor(){this._navigationStartTime=void 0,this._navigatingFrom=void 0,this._switchingView=void 0}popNavigationStartTime(){const e=this._navigationStartTime;return this._navigationStartTime=void 0,e}markNavigationStartTime(e,t){this._navigationStartTime=performance.now(),this._navigatingFrom=void 0,this._switchingView=void 0,"page"===e.name&&"page"===t.name&&e.blockId&&e.blockId&&(this._navigatingFrom=i(),this._switchingView=e.blockId===t.blockId&&e.collectionViewId!==t.collectionViewId)}getDatabaseNavigationMetrics(e){return{cvb_bundle_loaded:a(e),navigating_from:this._navigatingFrom,navigating_to:i(),switching_view:this._switchingView}}}},966353:(e,t,n)=>{n.d(t,{Jr:()=>l,ZP:()=>d,j5:()=>a,uZ:()=>i});var o=n(749085),r=n(554153);const i="unread_and_read",a=["unread_and_read","unread_only","archived_only","all_updates"],s={filter:i},l="notification_inbox_panel";const c=o.default.createValue(function(){const e=r.Z.get(l);return{...s,...e}}(),{name:"preferenceStore"});c.addListener((e=>{try{t=e.state,r.Z.set(l,t)}catch{}var t}));const d=c},945946:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(453809),r=n(430548);const i=new o.D({key:"openInDesktopApp",namespace:r.$p,important:!0,trackingType:"necessary"})},864970:(e,t,n)=>{n.d(t,{m:()=>o});const o=n(749085).default.createValue(!1,{name:"OpenPageUpdatesTabFromEmailStore"})},869254:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},470704:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isHidden:!1}}}const i=r},979689:(e,t,n)=>{n.d(t,{L:()=>i,c:()=>a});var o=n(749085);const r=new Map;function i(e){const t=r.get(e);if(t)return t;{const t=o.default.createValue(!1,{name:"newStore"});return r.set(e,t),t}}function a(){const e=Array.from(r.entries());return 0===e.length||e.every((e=>!e[1].state))}},861364:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{constructor(){super(...arguments),this.containerDomNodeStore=o.default.createValue(null,{name:"containerDomNodeStore"})}getInitialState(){return{overlays:new Set}}}const i=r},619671:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(458484).Z)},193220:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{ready:!1,initialRequestCompleted:!1,loading:!1,endOfResultsReached:!1,error:void 0,currentCursor:void 0,currentCursors:[],currentChunkNumber:void 0}}}const i=r},985526:(e,t,n)=>{n.d(t,{UK:()=>s,my:()=>a,pB:()=>r});var o=n(749085);class r extends o.default{getInitialState(){return{forceShowProperties:!1,searchOpen:!1,searchQuery:""}}}class i extends o.default{getInitialState(){return{}}getNewEditorPagePropertiesStore(){const e=new r;return this.setState({pagePropertiesStore:e}),e}}const a=new i,s=new i},594896:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{pages:new Set}}setStatus(e,t){t?this.state.pages.add(e):this.state.pages.delete(e),this.emit()}}const i=new r},156638:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},282136:(e,t,n)=>{n.d(t,{S:()=>r,Z:()=>a});var o=n(749085);let r=function(e){return e[e.Frame=0]="Frame",e[e.PeekView=1]="PeekView",e[e.InAppTemplatePreview=2]="InAppTemplatePreview",e[e.InPageSnapShot=3]="InPageSnapShot",e[e.CollectionPageView=4]="CollectionPageView",e[e.SitePreview=5]="SitePreview",e[e.Form=6]="Form",e}({});class i extends o.default{getInitialState(){return{forceDiscussionOpen:!1}}}const a=i},85844:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isVisible:!0}}}const i=new r},272014:(e,t,n)=>{n.d(t,{$g:()=>a,jx:()=>s});var o=n(749085),r=n(471924);class i extends o.default{getInitialState(){return{visitId:void 0,startMilliseconds:void 0}}initializeNewPageVisitId(){this.setState({visitId:r.Il(),startMilliseconds:Date.now()})}getCurrentPageVisitId(){return this.getState().visitId}getCurrentPageVisitDuration(){const e=this.getState().startMilliseconds;return void 0===e?void 0:Date.now()-e}}const a=new i,s=new i},369503:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1,hasPassword:!1}}isSetNewPasswordModal(){const e=this.state;return!0===e.setNewPassword&&!1===e.isSet}isPasswordSetModal(){const e=this.state;return!0===e.setNewPassword&&!0===e.isSet}isRemovePasswordModal(){const e=this.state;return!0===e.removePassword&&!1===e.isSuccess}isRemovePasswordSuccessModal(){const e=this.state;return!0===e.removePassword&&!0===e.isSuccess}isVerifyIdentityWithMfaModal(){return!0===this.state.verifyIdentity}isPasswordModalClosed(){return!this.state.open}}const i=new r},691551:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(308297).Z)},813023:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(458484).Z)},188923:(e,t,n)=>{n.r(t),n.d(t,{CenterPeekModeOuterWidth:()=>l,PeekModeOuterPadding:()=>s,PeekModePadding:()=>a,SIDEPEEK_INITIAL_MAX_WIDTH:()=>p,SIDEPEEK_MIN_WIDTH:()=>g,SIDEPEEK_NO_COLUMN_WIDTH:()=>m,default:()=>h,getPeekModeFromCollectionPeekModeFormat:()=>d,getPeekModeFromUrlParam:()=>c,getUrlParamFromPeekMode:()=>u});var o=n(14577),r=n(749085),i=n(570096);const a={horizontal:{center_peek:126,side_peek:48}},s=72,l=708+2*a.horizontal[i.l];function c(e){switch(e){case"s":return i.R;case"c":return i.l}}function d(e){switch(e){case"side_peek":return i.R;case"center_peek":return i.l}}function u(e){switch(e){case i.R:return"s";case i.l:return"c"}}const p=980,m=640,g=564;class f extends r.default{constructor(){super(...arguments),this.isSidePeekOpeningStore=new o.ZP((()=>this.state.open&&this.isSidePeekOpen()&&this.state.isOpening),{debugName:"isSidePeekOpening"}),this.isSidePeekClosingStore=new o.ZP((()=>this.state.open&&this.state.isClosing),{debugName:"isSidePeekClosing"}),this.peekTargetStore=new o.ZP((()=>this.state.open?this.state.targetStore:void 0),{debugName:"peekTarget"})}getInitialState(){return{open:!1,mode:i.l,preferredSidePeekWidth:0,savedSidebarExpandedStoreState:!1}}getCollectionModeFormat(){switch(this.state.mode){case i.R:return"side_peek";case i.l:return"center_peek"}}getPeekMode(){return this.state.open?this.state.mode:i.R}getPeekModeWidth(e){return this.isCenterPeekOpen()?l:this.getSidePeekWidth(e)}getSidePeekWidth(e){const t=Math.min(e/2,p),n=this.state.preferredSidePeekWidth||t,o=Math.max(n,g);return Math.min(o,e)}setSidePeekWidth(e,t){const n=Math.min(Math.max(e,g),t);this.setState({...this.state,preferredSidePeekWidth:n})}isCenterPeekOpen(){return this.state.open&&this.state.mode===i.l}isSidePeekOpen(){return this.state.open&&this.state.mode===i.R&&!this.state.isClosing}setSidebarExpandedStoreState(e){this.setState({...this.state,savedSidebarExpandedStoreState:e})}}const h=new f},170210:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},398452:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},799332:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},724612:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},542057:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(292595),r=n(745589);const i=(0,o.exposeDebugValue)("PeekViewScrollerStore",new r.Z)},429677:(e,t,n)=>{n.d(t,{Db:()=>s,cl:()=>r,fZ:()=>o,oM:()=>i,ow:()=>a});n(749085),n(421202);function o(e){return"existingUser"===e.type}function r(e){return"newUser"===e.type}function i(e){return"newUser"===e.type||"existingUser"===e.type}function a(e){const t=e.inviteTargets[0];return!(!t||"bot"!==t.type)}function s(e){return e.inviteTargets.every((e=>"existingUser"===e.type||"newUser"===e.type||"group"===e.type))}},960709:(e,t,n)=>{n.d(t,{FJ:()=>m,Iw:()=>u,ZP:()=>f,lU:()=>p});var o=n(749085),r=n(825464),i=n(626765);const{Top:a,Bottom:s,Left:l,Right:c,Center:d}=r.u,u=r.u,p=r.v;function m(e){switch(e){case a:return s;case s:return a;case l:return c;case c:return l;case d:return d}}class g extends o.default{getInitialState(){return{open:!1,placementFlipped:!1,offsetX:0,offsetY:0,originRect:i.bM}}}const f=g},224864:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(470704).Z)},896026:(e,t,n)=>{n.d(t,{Z:()=>l,m:()=>a});var o=n(749085),r=n(772141),i=n(367669);const a={disabled:{hasPublicPermission:!1},view:{hasPublicPermission:!0,permission:"view"},comment:{hasPublicPermission:!0,permission:"comment"},edit:{hasPublicPermission:!0,permission:"edit"}};Object.freeze(a),Object.freeze(a.disabled),Object.freeze(a.view),Object.freeze(a.comment),Object.freeze(a.edit);class s extends o.default{getInitialState(){return{editing:!1,commenting:!1}}getMode(e,t){const n=this.getModeType(e,t)||"disabled";return a[n]}getModeType(e,t){if(!t.isDefaultRecordCache()||!(0,i.IJ)(e,t))return;const n=t.getRole(),o=!n||(0,r.J5)(n),a=!n||(0,r.RF)(n),s=e.currentUser.isLoggedIn();return o&&s&&this.state.editing?"edit":a&&s?"comment":"view"}}const l=new s},281236:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(292595),r=n(170060),i=n(551444);const a=new i.q((e=>{let{spaceId:t}=e;return t}),(async function(e,t){let{spaceId:o}=t,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const s=await Promise.resolve().then(n.bind(n,21359));if((0,r.sd)()){const t=await s.getPublicSpaceData(e,{type:"space-ids",spaceIds:[o]});return"success"===t.type?t.data.results[0]??void 0:void 0}return(0,i.X)({environment:e,namespace:"PublicSpaceData",key:o,forceRefetch:a,getValue:async()=>{const t=await s.getPublicSpaceData(e,{type:"space-ids",spaceIds:[o]});return"success"===t.type?t.data.results[0]??void 0:void 0}})}));o.exposeDebugValue("PublicSpaceDataStore",a);const s=a},140061:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(292595),r=n(18201),i=n(80444);const a=new class{constructor(){this.recentlyMentionedPagesStore=void 0,this.spaceId=void 0,this.userId=void 0}get(e){const{currentSpaceStore:t}=i.default.state,n=t&&t.id;return void 0===n||void 0===e?(this.userId=void 0,this.spaceId=void 0,void(this.recentlyMentionedPagesStore=void 0)):(this.spaceId===n&&this.userId===e||(this.spaceId=n,this.userId=e,this.recentlyMentionedPagesStore=new s({maxPages:50,prefix:`RecentlyMentioned:${e}:${n}`,store:localStorage,version:l}),this.recentlyMentionedPagesStore.initialize()),this.recentlyMentionedPagesStore)}};class s{constructor(e){this.mentions=void 0;const{maxPages:t,prefix:n,store:o,version:i}=e;this.mentions=new r.Z({maxSize:t,prefix:n,store:o,version:i})}initialize(){this.mentions.updateVersionAndGC()}recordMention(e,t){this.mentions.set(e,t)}getMentionedIds(){const e=this.mentions.entries();if(e.error)return[];const t=Date.now()-864e5;return Array.from(e.value).filter((e=>{let[n,o]=e;return o>=t})).map((e=>{let[t,n]=e;return t}))}}const l=1,c={lazyRecentlyMentionedPagesStore:a,recordMention:function(e){const{id:t,timestamp:n,currentUserId:o}=e,r=a.get(o);if(r)return r.recordMention(t,n)},getMentionedIds:function(e){const t=a.get(e);return t?t.getMentionedIds():[]}};(0,o.exposeDebugValue)("RecentlyMentionedPagesStore",c);const d=c},569784:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isActive:!1}}}const i=new r},313105:(e,t,n)=>{n.d(t,{P:()=>i});var o=n(14577),r=n(292595);class i{constructor(e){this.memo=new WeakMap,this.debugName=void 0,this.hits=0,this.misses=0,this.getStateFor=e=>this.computeMemo(e),this.computeMemo=e=>{let t=this.memo.get(e);return t?this.hits++:(this.misses++,t=new o.ZP((()=>this.options.compute(e,this.options.memoizeRecursion?this.computeMemo:this.computeNonMemo)),{debugName:this.debugName}),this.memo.set(e,t)),t.getState()},this.computeNonMemo=e=>this.options.compute(e,this.computeNonMemo),this.options=e,this.debugName=`RecursiveComputedStore.${e.debugName}`,(0,r.exposeDebugInstance)(this.debugName,this)}}},264951:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}isActive(){return Boolean(this.state.blockStore)}}const i=new r},682187:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}isActive(){return Boolean(this.state.clonedBlockStore)}}const i=new r},672087:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{ready:!1,loading:!1}}}const i=r},891681:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isResizing:!1}}}const i=new r},370354:(e,t,n)=>{n.r(t),n.d(t,{default:()=>u,groupIntervalMs:()=>c});var o=n(749085),r=n(250680),i=n(511799),a=n(653965),s=n(401898);class l{constructor(){this.idMap=new i.Z({getKey:e=>{let{textInstanceId:t,opId:n}=e;return`${t},${n[0]},${n[1]}`}})}remapIdsForReinsertedText(e,t){(0,r.T)(t.args.textInstanceId===e.args.textInstanceId),(0,r.T)(a.Xy(t.args.originId,e.args.originId)),(0,r.T)(t.args.content.length===e.args.deletedIds.length);const n=t.args.id,o=t.args.content;for(let r=0;r<o.length;r++)this.addMapping({textInstanceId:e.args.textInstanceId,opId:e.args.deletedIds[r]},{textInstanceId:t.args.textInstanceId,opId:[n[0],n[1]+r]})}addMapping(e,t){(0,r.T)(!this.idMap.has(e)),(0,r.T)(!this.idMap.has(t)),(0,r.T)(e.textInstanceId===t.textInstanceId,"IDs can only be remapped within the same text instance"),this.idMap.set(e,t)}getMappedId(e){let t,n=e;for(;n=this.idMap.get(n);)t=n;return t}getInvertedTextOperationWithMaybeRemappedIds(e){switch(e.command){case"invertedInsertText":{var t,n;const o=null===(t=this.getMappedId({textInstanceId:e.args.textInstanceId,opId:e.args.startId}))||void 0===t?void 0:t.opId,r=null===(n=this.getMappedId({textInstanceId:e.args.textInstanceId,opId:e.args.endId}))||void 0===n?void 0:n.opId;return o||r?{...e,args:{...e.args,startId:o??e.args.startId,endId:r??e.args.endId}}:e}case"invertedAddAnnotation":case"invertedRemoveAnnotation":{var o,r;const t=null===(o=this.getMappedId({textInstanceId:e.args.startTextInstanceId,opId:e.args.startId}))||void 0===o?void 0:o.opId,n=null===(r=this.getMappedId({textInstanceId:e.args.endTextInstanceId,opId:e.args.endId}))||void 0===r?void 0:r.opId;if("invertedAddAnnotation"===e.command)return t||n?{...e,args:{...e.args,startId:t??e.args.startId,endId:n??e.args.endId}}:e;if("invertedRemoveAnnotation"===e.command)return t||n?{...e,args:{...e.args,startId:t??e.args.startId,endId:n??e.args.endId}}:e;(0,s.t1)(e);break}case"invertedDeleteText":{var i;const t=null===(i=this.getMappedId({textInstanceId:e.args.textInstanceId,opId:e.args.originId}))||void 0===i?void 0:i.opId;return t?{...e,args:{...e.args,originId:t??e.args.originId}}:e}case"invertedMoveTextSlice":return e;default:(0,s.t1)(e)}}}const c=700;class d extends o.default{getInitialState(){return{undoStack:[],redoStack:[],invertedTextOperationIdMapper:new l}}}const u=new d},249557:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(292595);class i extends o.default{getInitialState(){return{isActive:!1,isAnimatingClosed:!1,top:0,left:0}}}const a=(0,r.exposeDebugValue)("RichTextMenuStore",new i)},904935:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},745589:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isScrolling:!1,scrollTop:0,scrollHeight:0,scrollLeft:0,scrollWidth:0,clientWidth:0}}}const i=r},832470:(e,t,n)=>{n.d(t,{BJ:()=>m,ZP:()=>h,gq:()=>f,lO:()=>g,v_:()=>p});var o=n(749085),r=n(915157),i=n(153772),a=n(653965),s=n(95477);const l="SearchDebugStorePersistenceKey";class c extends o.default{setState(e){super.setState(e),function(e){let{newState:t,key:n}=e;r.Z.set({userId:"global",key:n,value:t})}({newState:e,key:this.getPersistenceKey()})}setStateWithoutPersisting(e){super.setState(e)}reloadFromDisk(){const e=r.Z.get({userId:"global",key:this.getPersistenceKey()});super.setState({...this.getInitialState(),...e})}}class d extends c{constructor(e){super(),this.column=void 0,this.getPersistenceKey=()=>`${l}:${this.column}`,this.updateForcedClusterPattern=e=>{this.setState({...this.state,forcedClusterPattern:e})},this.updateForcedBlockIds=e=>{this.setState({...this.state,forcedBlockIds:e})},this.column=e}getInitialState(){return{forcedClusterPattern:void 0,forcedBlockIds:void 0,searchExperimentOverrides:{},visible:!0}}hasDebugOverrides(){return!a.xb(this.state.forcedClusterPattern)||!a.xb(this.state.searchExperimentOverrides)||!a.xb(this.state.forcedBlockIds)}}const u=new class extends c{constructor(){super(...arguments),this.getPersistenceKey=()=>l}getInitialState(){return{showDebugInfo:!1,debug:void 0}}getDebugLevel(){return this.state.debug??(this.state.showDebugInfo?"explain":void 0)}},p=new d("left"),m=new d("right");function g(){u.reloadFromDisk(),p.reloadFromDisk(),m.reloadFromDisk()}function f(e){let{device:t}=e;return(0,i.x)(s.default)&&!t.isMobile&&(p.hasDebugOverrides()||m.hasDebugOverrides()||p.state.forcedClusterPattern||m.state.forcedClusterPattern)&&m.state.visible}const h=u},155320:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1,openAsPage:!1,openedTimeMs:void 0,sessionId:void 0,isPublicPageSearch:!1}}closeAndResetMetricsState(){this.update((e=>({...e,open:!1,openAsPage:!1,openedTimeMs:void 0,sessionId:void 0})))}isOpen(){return this.state.open||this.state.openAsPage}}const i=new r},530857:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{selectedQueryResult:!1,numKeystrokes:0,numServerRequests:0,numLocalRequests:0,hadMetaClick:!1,firstKeyStrokeTimeMs:void 0}}}const i=new r},787956:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){}}const i=new r},629026:(e,t,n)=>{n.d(t,{Xv:()=>l,ZP:()=>u});var o=n(749085),r=n(915157),i=n(494804),a=n(492338),s=n(80444);const l=20;let c=function(e){return e.Default="Default",e.Results="Results",e}({});class d extends o.default{constructor(){super(...arguments),this.resetQuery=e=>{let{resetFilters:t}=e;this.setState({...this.state,query:{...this.state.query,text:"",...t&&{filters:(0,a.u4)()}},limit:l,source:"quick_find_input_change"})},this.resetFilters=()=>{this.update((e=>({...e,query:{...e.query,filters:(0,a.u4)()}})))},this.updateFilters=e=>{const t=this.state.query.filters,n=(0,a.jl)(t,e);this.setState({...this.state,query:{...this.state.query,filters:n},limit:l,source:"quick_find_filters"})},this.setIsAnyPopupOpen=e=>{this.update((t=>({...t,isPopupOpen:e})))},this.expandFilterBar=()=>{this.updateFilterBarVisibilityState(!0)},this.collapseFilterBar=()=>{this.updateFilterBarVisibilityState(!1)},this.updateFilterBarVisibilityState=e=>{var t;this.update((t=>({...t,filterBar:{...t.filterBar,show:e}})));const n=null===(t=s.default.state.currentUserStore)||void 0===t?void 0:t.id;n&&r.Z.set({userId:n,key:i.rE,value:e})},this.updateQueryText=e=>{this.setState({...this.state,query:{...this.state.query,text:e},limit:l,source:"quick_find_input_change"})},this.switchToSearchPane=()=>{this.setState({...this.state,mode:"search"})}}getInitialState(){return{mode:"search",isSidePeekPanelOpen:!1,isDebugSidebarOpen:!1,query:{text:"",filters:(0,a.u4)(),sort:{field:"relevance"}},limit:l,source:"quick_find",hasScrolled:!1,filterBar:{order:["titleToggle","personFilter","teamsFilter","pageFilter","dateFilter","dev_notInPageFilter","dev_notInTeamFilter"],show:!0},isPopupOpen:!1}}updateFilterOrder(e){this.setState({...this.state,filterBar:{...this.state.filterBar,order:e}})}hasQuery(){return Boolean(this.state.query.text)}isDebugSidebarOpen(){return this.state.isDebugSidebarOpen}}d.Mode=c;const u=new d},186486:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isOpen:!1}}isRightMarginCommentHovered(){const e=this.state,t=e.isOpen&&e.selectableBoundingRect;if(t){if(e.currentStore.isImmediateColumnChild())return!1;const n=.7*t.width+t.x;return e.mouseX>n}return!1}}const i=new r},650628:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(749085),r=n(292595);class i extends o.default{getInitialState(){return{selectableRectMap:new Map,selectableContainerRectMap:new Map,selectableElementRectMap:new Map,lastUpdate:0}}hasBeenUpdatedSince(e){return this.state.lastUpdate>e}}const a=new i;(0,r.exposeDebugValue)("SelectableRectStore",a);const s=a},27724:(e,t,n)=>{n.r(t),n.d(t,{SelectionPhase:()=>c,default:()=>u});var o=n(749085),r=n(401898),i=n(316339),a=n(95802),s=n(188923),l=n(206258);let c=function(e){return e[e.Selected=0]="Selected",e[e.Editing=1]="Editing",e}({});class d extends o.default{getInitialState(){return{stores:[],phase:c.Selected}}cloneState(){return{stores:[...this.state.stores],phase:this.state.phase}}getEditing(){if(this.state.phase===c.Editing)return this.state.stores[0]}isSelected(){return this.state.stores.length>0&&this.state.phase===c.Selected}getNodes(){return this.state.stores.map((e=>a.C.findNodeFromStore(e)||void 0)).filter(r.$K)}getCurrentRootStore(){var e,t;const n=null===(e=this.getCurrentDefaultContainer())||void 0===e?void 0:e.getProps().store;return n&&n instanceof l.G?n:null===(t=this.getDefaultContainer())||void 0===t||null===(t=t.getProps())||void 0===t?void 0:t.store}getCurrentRecordCache(){const e=this.getCurrentRootStore();if(e)return e.inMemoryRecordCache}getDefaultContainerFromTarget(e){return i.Z.find((t=>{const n=t.getNode();return Boolean(n&&n.contains(e))}))}getCurrentDefaultContainer(){const e=this.state.anchorContainer;return e||this.getDefaultContainer()}getDefaultContainer(){const e=this.state.defaultContainerStack;if(e&&e.length>0)return e[e.length-1]}isInPeekRenderer(){if(this.state.anchorContainer)return Boolean(this.state.anchorContainer.isPeekRenderer());{var e;const t=Boolean(null===(e=this.state.anchor)||void 0===e?void 0:e.isPageBlock()),n=s.default.state.open&&this.state.anchor===s.default.state.targetStore;return t&&n}}}const u=new d},677794:(e,t,n)=>{n.d(t,{E:()=>a});var o=n(749085),r=n(653965),i=n(626765);class a{constructor(e){this.rect=o.default.createValue(i.bM,{name:"rect"}),this.el=void 0,this.resizeObserver=void 0,this.options=void 0,this.recomputeThrottled=void 0,this.recompute=()=>{var e;const t=(null===(e=this.el)||void 0===e?void 0:e.getBoundingClientRect())??i.bM;return this.rect.setState(t),t},this.options=e||{},this.options.throttleMs&&(this.recomputeThrottled=r.P2(this.recompute,this.options.throttleMs))}observe(e){this.el=e,"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.getRecomputeFn()),this.resizeObserver.observe(this.el)),this.recompute()}destroy(){this.resizeObserver&&this.resizeObserver.disconnect()}getRecomputeFn(){return this.recomputeThrottled||this.recompute}}},801310:(e,t,n)=>{n.d(t,{JY:()=>i,Ty:()=>r,ZP:()=>s});var o=n(749085);const r=5e3,i=1e4;class a extends o.default{getInitialState(){return{currentItem:void 0,shouldReset:!0}}}const s=new a},64404:(e,t,n)=>{n.d(t,{Q:()=>r,Z:()=>a});var o=n(749085);let r=function(e){return e.Members="members",e.Groups="groups",e.Guests="guests",e.Reprovisioning="reprovisioning",e.Requests="requests",e}({});class i extends o.default{getInitialState(){return{currentTab:r.Members,limitMembers:!0,limitGuests:!0,limitTeamGuests:!0,membersFilter:"",guestsFilter:"",teamGuestsFilter:"",groupsFilter:"",groupNameInputValue:"",upsellModalOpen:!1,sorts:{members:{group:"members",by:"role",asc:!1},guests:void 0,team_guests:void 0}}}}const a=i},992083:(e,t,n)=>{n.d(t,{R:()=>r,Z:()=>a});var o=n(749085);let r=function(e){return e[e.OpenInDesktopApp=0]="OpenInDesktopApp",e[e.TwoStepVerification=1]="TwoStepVerification",e[e.LanguageSetting=2]="LanguageSetting",e}({});class i extends o.default{getInitialState(){return{open:!1,currentTab:"settings",defaultSubtab:void 0,highlightedSetting:void 0,openedFrom:void 0}}}const a=new i},327242:(e,t,n)=>{n.d(t,{U:()=>r,Z:()=>a});var o=n(749085);let r=function(e){return e.CurrentSpace="current-space",e.TargetSpace="domain-claim-upgrade-team-plan-workspace",e}({});class i extends o.default{getInitialState(){return{open:!1,type:r.CurrentSpace}}closeWithSuccess(){this.setState({open:!1,succeeded:!0})}closeWithFailure(){this.setState({open:!1,succeeded:!1})}open(e){const{subscriptionTier:t,addOnFeature:n,billingInterval:o,coupon:i,isTrial:a,sessionId:s,dismissMobilePlansModal:l}=e;this.setState({open:!0,temporaryBillingInterval:o,temporaryAddress:{name:"",businessName:"",addressLine1:"",addressLine2:"",zipCode:"",city:"",state:"",country:""},appliedPromo:void 0,error:void 0,subscriptionTier:t,vatApplicable:!1,calculatingTax:!1,payButtonState:"enabled",type:r.CurrentSpace,addOnFeature:n,onlyShowAddOn:void 0!==n,sessionId:s,coupon:i,isTrial:a,dismissMobilePlansModal:l})}setAddressField(e){this.state.open&&this.setState({...this.state,temporaryAddress:{...this.state.temporaryAddress,...e},taxCalculationError:void 0})}}const a=new i},909209:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},599757:(e,t,n)=>{n.d(t,{Z:()=>l,n:()=>s});var o=n(14577),r=n(749085);class i extends r.default{constructor(){super(...arguments),this.updateRemaining=e=>{this.state.remainingPending!==e&&(0===e?this.setState({...this.state,totalPending:0,remainingPending:0}):this.setState({...this.state,remainingPending:e}))}}getInitialState(){return{totalPending:0,remainingPending:0,transactionQueueError:void 0,storageUsageEstimate:void 0,connectionError:void 0}}percentComplete(e){if(this.state.totalPending>0){const t=1-this.state.remainingPending/this.state.totalPending;return e.formatNumber(t,{style:"percent",maximumFractionDigits:0})}return e.formatNumber(1,{style:"percent"})}setOrIncTotal(e){this.state.totalPending>e?this.setState({...this.state,totalPending:this.state.totalPending+1}):this.setState({...this.state,totalPending:e})}}const a=new i,s=new o.ZP((()=>Boolean(a.state.transactionQueueError)),{debugName:"transactionQueueUnhealthyStore"}),l=a},626634:(e,t,n)=>{n.d(t,{Om:()=>r,_W:()=>a,o:()=>i});var o=n(599757);function r(){o.Z.setState({...o.Z.state,connectionError:void 0})}function i(e){const{connectionError:t}=o.Z.state,n=Date.now(),r=void 0===e.backoffEstimate?void 0:e.backoffEstimate+n;o.Z.setState({...o.Z.state,connectionError:{startTime:(null==t?void 0:t.startTime)??n,numAttempts:t?t.numAttempts+1:1,approximateBackoffDelayEndTime:r,retryReason:e.retryReason??(null==t?void 0:t.retryReason)}})}const a={onReset:r,onBackoff(e,t){i({backoffEstimate:e,retryReason:t})}}},342185:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n(749085).default.createValue(void 0,{name:"TeamHighlightStore"})},30397:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{teams:[],lastEmitData:{value:"no value saved yet",spaceId:void 0,userId:void 0}}}shouldRefetchTeamsInSpace(e){let{currentUserId:t,currentSpaceId:n,emitValue:o}=e;const{spaceId:r,userId:i,value:a}=this.state.lastEmitData;return n!==r||(t!==i||o!==a)}}const i=new r},924666:(e,t,n)=>{n.r(t),n.d(t,{TextSelectionStore:()=>d,default:()=>u});var o=n(548317),r=n(14577),i=n(749085),a=n(653965),s=n(926249),l=n(268056),c=n(206258);class d extends i.default{constructor(){super(...arguments),this.isEditingStore=new r.ZP((()=>"editing"===this.state.mode),{debugName:"isEditingStore"}),this.isExpandedStore=new r.ZP((()=>"empty"!==this.state.mode&&!(0,l.iG)(this.state.multiSelection)),{debugName:"TextSelectionStore.isExpandedStore"}),this.editingStartStore=new r.ZP((()=>{if("editing"===this.state.mode)return this.state.multiSelection.start.store}),{debugName:"TextSelectionStore.editingStartStore"}),this.editingEndStore=new r.ZP((()=>{if("editing"===this.state.mode)return this.state.multiSelection.end.store}),{debugName:"TextSelectionStore.editingEndStore"})}getInitialState(){return{mode:"empty"}}setState(e){if("empty"===e.mode||"empty"===this.instanceState.mode)return super.setState(e);if(!(0,s.Z)(this.instanceState,e)){const{savedSelectionXPosition:t,...n}=this.instanceState,{savedSelectionXPosition:r,...i}=e;this.instanceState=e,o.logStoreSet(this,e),(0,s.Z)(n,i)||this.emit()}}cloneState(){return"editing"===this.state.mode?{mode:"editing",multiSelection:(0,l.k_)(this.state.multiSelection),savedSelectionXPosition:this.state.savedSelectionXPosition,forceExtendAnnotations:a.Xh(this.state.forceExtendAnnotations)}:"readOnly"===this.state.mode?{mode:"readOnly",multiSelection:(0,l.k_)(this.state.multiSelection),savedSelectionXPosition:this.state.savedSelectionXPosition}:{mode:"empty"}}isEmptySelection(){if(!this.hasSelection())return!0;const{multiSelection:e}=this.state;return(0,l.iG)(e)}isEditingComment(){return"editing"===this.state.mode&&("comment"===this.state.multiSelection.start.store.table||"comment"===this.state.multiSelection.end.store.table)}isEditingFormQuestion(){return"editing"===this.state.mode&&("form_question"===this.state.multiSelection.start.store.table||"form_question"===this.state.multiSelection.end.store.table)}isEditingCaption(){return"editing"===this.state.mode&&(a.Xy(this.state.multiSelection.start.store.path,["properties","caption"])||a.Xy(this.state.multiSelection.end.store.path,["properties","caption"]))}hasSelection(){return"empty"!==this.state.mode}isEditingEmptyBlock(){return!(!this.hasSelection()||!this.isEmptySelection())&&!this.state.multiSelection.start.store.isDefined()}getRootBlockStoreOfSelection(){const e=this.hasSelection()&&this.state.multiSelection&&this.state.multiSelection.start.store.getAncestorRecordStoreAtRootPath();return e&&e instanceof c.G?e:void 0}getRootFormQuestionStoreOfSelection(){const e=this.hasSelection()&&this.isEditingFormQuestion()&&this.state.multiSelection.start.store.getAncestorRecordStoreAtRootPath();return e&&e instanceof c.cq?e:void 0}}const u=new d},469694:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{toasts:{}}}}const i=new r},445131:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}setOpen(e,t){this.setState({...this.state,[e]:t})}toggle(e){this.setState({...this.state,[e]:!this.isOpen(e)})}isOpen(e){return!!this.state[e]}}const i=new r},858948:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{focused:!1,hovered:!1}}}const i=r},216194:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n(749085).default.createValue(!1)},452258:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},766708:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},977503:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},259238:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isDragging:!1}}}const i=new r},368026:(e,t,n)=>{n.r(t),n.d(t,{TransactionQueueDependenciesImpl:()=>U});var o=n(568626),r=n(552629),i=n(701525),a=n(103022),s=(n(21703),n(757658),n(292595)),l=n(159730),c=n(471924),d=n(709291),u=n(653965),p=n(937850),m=n(401898),g=n(21359),f=n(547307),h=n(385555),v=n(956518),y=n(833954),b=n(979947),_=n(433929),S=n(244133),k=n(300482),w=n(504408);async function x(e,t){const n=u.mN(t.operations.flatMap((e=>[e.pointer,...(0,k.SH)(e)?e.additionalUpdatedPointers??[]:[]])),(e=>e.id));await Promise.all(n.map((n=>w.HB({environment:e,inMemoryRecordCache:e.defaultRecordCache.inMemoryRecordCache,pointer:n,userId:t.userId}))))}var I=n(516861),C=n(199341);let T=0;const M=(0,d.defineMessages)({requestTooLarge:{id:"transactionHelpers.requestTooLargeError.message",defaultMessage:"Sorry, that request was too large."},requestTooLargeTryImportInstead:{id:"transactionHelpers.requestTooLargeError.message.tryImportInstead",defaultMessage:"Sorry, that request was too large. Try import instead?"}});let P=!1;(0,s.exposeDebugValue)("toggleTransactionQueue",(()=>{P=!P,console.info(P?"Transactions paused":"Transactions resumed")}));let A=0;(0,s.exposeDebugValue)("setTransactionQueueApiLatencyMs",(e=>{A=e,0===e?console.info("Disabling saveTransactions API latency simulation."):console.info(`Simulating saveTransactions API latency of ${e} ms.`)}));class R extends Error{constructor(e){super(e.message),this.retryDelay=void 0,this.retryReason=void 0,this.savedTasks=void 0,this.failedTasks=void 0,this.clientData=void 0,this.name="HandleSaveTransactionsError",this.retryDelay=e.retryDelay,this.retryReason=e.retryReason,this.savedTasks=e.savedTasks,this.failedTasks=e.failedTasks,this.clientData=e.clientData}}async function D(e){var t;if(P)return{value:[]};const{environment:n,tasks:i}=e,s=function(e,t){const n=new Set(t.map((e=>e.timestamp))),o=t.length-n.size;return o>0&&a.LA(e,{collision_count:o}),o}(n,i),{userId:d,tasks:k}=C.w(i),w=k.map((e=>({id:e.id,spaceId:e.spaceId,debug:e.debug,operations:e.operations,inSudoMode:e.useSudoMode}))),x=c.Il(),D=h.default.checkGate({gateName:"client_http_gzip"})?"gzip":void 0,U=null===(t=I.Z.provider)||void 0===t?void 0:t.onSaveTransactions(i,w),V=await g.saveTransactions(n,{requestId:x,transactions:w},d,void 0,void 0,void 0,D);if(A>0&&(console.info(`saveTransactions returned; simulating ${A}ms extra latency.`),await(0,p.Vs)(A)),null==U||U(V),"success"===V.type)return T=0,{value:k};const N="Notion is unavailable, please try again later."===V.error.message;if(!N&&!V.error.data.offline||Math.random()<.01){const e=[...new Set(w.map((e=>e.spaceId??"NO_SPACE_ID")))];o.log({level:"error",from:"transactionActions",type:"ClientTransactionError",error:{miscErrorString:(0,r.LK)(V)},data:{requestId:x,miscDataToConvertToString:{transactions:w},userId:n.currentUser.id,spaceIds:e}})}if(413===V.status){let e,t;const r=k.length;k.forEach((n=>{var o,r;null!==(o=n.debug)&&void 0!==o&&o.userAction&&(e=n.debug.userAction),null!==(r=n.debug)&&void 0!==r&&r.userFlow&&(t=n.debug.userFlow)})),o.log({level:"error",from:"transactionActions",type:"ClientTransaction413Error",data:{totalTaskCount:r,userId:n.currentUser.id,requestId:x,userAction:e,userFlow:t}});const i=JSON.stringify(w);a.F4(n,{totalTaskCount:r,payloadLength:i.length,userAction:e});const s=Math.ceil(i.length/C._V);for(let a=0;a<s;a++)o.log({level:"error",from:"transactionActions",type:"ClientTransaction413ErrorRecovery",data:{userId:n.currentUser.id,totalTaskCount:r,requestId:x,miscDataToConvertToString:{chunkTotal:s,chunkIndex:a,operationChunk:i.slice(a*C._V,(a+1)*C._V)}}});f.showErrorMessage(_.default.formatMessage(e===v.xF?M.requestTooLargeTryImportInstead:M.requestTooLarge))}const O=e=>{const t=T;if(e.failedTasks.length>0&&(T+=1),!N&&!V.error.data.offline){var i,l,c;const d=e.failedTasks.length>0?e.failedTasks[0]:void 0;d&&"space_not_found_in_record_path"===(null===(i=e.clientData)||void 0===i?void 0:i.type)&&o.log({level:"error",from:"transactionActions",type:"ClientTransactionSpaceNotFoundError",error:(0,r.Ui)(e),data:{userId:n.currentUser.id,requestId:x,miscDataToConvertToString:(0,S.getDebugSourcesForIdsInOperations)(n,d.operations)}}),a.mc(n,{status:V.status,message:(0,b.getDebugMessageForApiRequestFailure)(V),previous_consecutive_rollbacks:t,saved_tasks:e.savedTasks.length,failed_tasks:e.failedTasks.length,first_failed_task_user_action:null==d||null===(l=d.debug)||void 0===l?void 0:l.userAction,first_failed_task_debug_tags:null==d||null===(c=d.debug)||void 0===c?void 0:c.tags,will_retry:e.retryDelay>0,retry_reason:e.retryReason,timestamp_collision_count:s})}return{error:e}};if((0,l.Rp)(V.body)){if((0,l.oE)(V.body.clientData)){const{errors:e}=V.body.clientData,t=e[0],o=k.findIndex((e=>e.id===t.id));if(o<0)return E(n,x,t),O(new R({message:t.name,clientData:t.clientData,retryDelay:0,retryReason:void 0,savedTasks:[],failedTasks:[]}));const r=k.slice(0,o),i=[],a=[],s=[];let l=o,c=0,d=0;for(const m of e){const e=k[l];m.id===e.id?(m.retryable?(a.push({error:m,task:e}),d+=1):(c+=1,await B(n,e,x),i.push(e),s.push({error:m,task:e})),l++):E(n,x,m)}const u=[`${r.length} successful`,c>0?`${c} failed unretryable (data loss)`:void 0,d>0?`${d} retryable`:void 0].filter(m.$K).join(", "),p=[`API error for ${k.length} transactions: ${u}.`,F(s,"unretryable"),F(a,"retryable"),V.body.debugMessage?`Debug message: "${V.body.debugMessage}"`:void 0].filter(m.$K).join(" ");let g,f=0;return a.length>0&&(f=2e3,g=a[0].error.name),O(new R({savedTasks:r,failedTasks:i,message:p,retryDelay:f,retryReason:g,clientData:t.clientData}))}if(u.q9(Z,V.status))return await Promise.all(k.map((e=>B(n,e,x)))),O(new R({savedTasks:[],failedTasks:k,message:(0,y.wf)(_.default.getIntl(),V),retryDelay:0,retryReason:void 0}))}let L=`http${V.status}`;return V.error.data.offline?L="offline":N&&(L="notionUnavailable"),O(new R({savedTasks:[],failedTasks:[],message:(0,y.wf)(_.default.getIntl(),V),retryDelay:5e3,retryReason:L}))}async function B(e,t,n){try{await x(e,t)}catch(i){o.log({level:"error",from:"transactionActions",type:"ClientTransactionCleanupError",error:(0,r.Ui)(i),data:{userId:e.currentUser.id,requestId:n}})}}function E(e,t,n){o.log({level:"error",from:"transactionActions",type:"ClientTransactionNotFoundError",error:(0,r.Ui)(n),data:{userId:e.currentUser.id,requestId:t}})}function F(e,t){if(e.length>0){var n;const{error:o,task:r}=e[0];return`First ${t} error: ${o.name} for transaction ${r.id} created by ${null===(n=r.debug)||void 0===n?void 0:n.userAction}.`}}const Z=[400,413];class U{constructor(e){this.timeSource=i.O,this.environment=e}getExperimentGroup(e){return h.default.getGroup(e)}handleSaveTransactions(e){return D({environment:this.environment,tasks:e})}handleHealthcheck(e){a.h2(this.environment,e)}async rollbackTask(e){try{await x(this.environment,e)}catch(t){o.log({level:"error",from:"TransactionQueueDependencies",type:"ClientTransactionCleanupError",error:(0,r.Ui)(t),data:{userId:this.environment.currentUser.id}})}}}},809425:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(88893),r=n(288280),i=n(385555);function a(){const e=r.subscriptionDataStoreInstance.state;return!(!e||(0,o.CM)(e).length>1)&&i.default.checkGate({gateName:"optimize_single_workspace"})}},1634:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},880064:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},240671:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{updatingUrls:new Set}}add(e){this.state.updatingUrls.add(e),this.emit()}delete(e){this.state.updatingUrls.delete(e),this.emit()}}const i=new r},185703:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(292595);const r=new(n(551444).q)((e=>{let{spaceId:t}=e;return t}),(async(e,t)=>{let{spaceId:o}=t;const r=await Promise.resolve().then(n.bind(n,21359)),i=await r.getInvoiceData(e,{spaceId:o,type:"upcoming"});return"success"===i.type?i.data.invoiceData:void 0}));o.exposeDebugValue("UpcomingInvoiceStore",r);const i=r},562820:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(61766).Z)},304761:(e,t,n)=>{n.d(t,{ZP:()=>l,g0:()=>a,n_:()=>c});var o=n(749085),r=n(471924),i=n(401898);function a(e){return"mentions"===e||"allPages"!==e&&"archive"!==e&&void(0,i.t1)(e)}class s extends o.default{getInitialState(){return{currentTab:"mentions",isCurrentTabEmpty:!0,containsBothReadAndUnreadNotifications:!1,containsUnreadNotifications:!1,loadingId:void 0,sessionId:void 0,showOnlyUnreadNotifications:!1,unreadNotificationIds:[]}}startSession(){let{forceRestart:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(void 0===this.state.sessionId||e)&&this.setState({...this.state,sessionId:r.Il()})}endSession(){this.setState({...this.state,sessionId:void 0})}startLoading(){const e=Math.random().toString();return this.setState({...this.state,loadingId:e}),e}endLoading(e){e===this.state.loadingId&&this.setState({...this.state,loadingId:void 0})}isFilteredToUnreadOnly(){if("mentions"===this.state.currentTab)return this.state.showOnlyUnreadNotifications}}const l=new s,c=o.default.createValue(!0,{name:"UpdatesScrolledToTopStore"})},729226:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(749085),r=n(937850);class i extends o.default{getInitialState(){return{readyPromise:(0,r.UZ)(),localSpaceInaccessiblePages:void 0,remoteSpaceInaccessiblePages:void 0}}getSpaceInaccessiblePages(e,t){const n=this.state;return n.remoteSpaceInaccessiblePages&&n.remoteSpaceInaccessiblePages[t]?n.remoteSpaceInaccessiblePages[t][e]:n.localSpaceInaccessiblePages&&n.localSpaceInaccessiblePages[t]?n.localSpaceInaccessiblePages[t][e]:void 0}}const a=new i},176117:(e,t,n)=>{n.d(t,{O:()=>i});var o=n(749085);class r extends o.default{getInitialState(){}waitUntilLoaded(){return this.waitUntil((()=>Boolean(this.state)))}}const i=new r},417963:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{pageMap:{}}}setStatus(e,t){const{pageMap:n}=this.state;t?n[e]=!0:delete n[e],this.emit()}}const i=new r},990827:(e,t,n)=>{n.d(t,{D:()=>p,Eo:()=>c,Js:()=>d,f9:()=>s,wY:()=>u,xR:()=>l});var o=n(653965),r=n(995853),i=n(798180),a=n(316772);function s(){return o.oA([i.default.getActiveSession(),d()])}function l(e){if(r.l.isPageTutorialPage(e))return!0;return s().some((t=>t.groupedPendingOperations.state.some((t=>t.pageId===e))))}function c(e){const t=e.getNavigableBlockStore();return Boolean(t&&l(t.id))}function d(){const e=a.default.state;if("assistantCompletionPopup"===e.type)return i.default.getSessionContext(e.sessionId)}function u(){const e=i.default.getActiveSession();if(!e)return;return e.groupedPendingOperations.state.filter((e=>"updatedPage"===e.type&&e.didCreatePage)).map((e=>e.pageId))}function p(){return s().some((e=>e.getAllPendingNonCreateExecutableOperations().length>0))}},633759:(e,t,n)=>{n.d(t,{Z:()=>o});const o=new(n(485974).Z)},389403:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{}}}const i=new r},596071:(e,t,n)=>{n.d(t,{Z:()=>a,v:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r,a=r},485974:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{loginType:"email",email:"",password:"",hasAccount:!1,showPassword:!1,signUpLinkSent:!1,hiddenPasscode:!1,forceAdminSamlLogin:!1}}isGoogle(){return"google"===this.state.loginType}isEmail(){return"email"===this.state.loginType}isReverifying(){return"reverify"===this.state.loginType}isTemporaryPasscode(){return"temporary"===this.state.loginType}isExclusiveLoginLinkTemporaryPasscode(){return"temporary"===this.state.loginType&&Boolean(this.state.hiddenPasscode)}isPassword(){return"password"===this.state.loginType}isForgotPassword(){return"forgot"===this.state.loginType}isPasswordResetSent(){return"reset"===this.state.loginType}isSaml(){return"saml"===this.state.loginType}isMfa(){return"mfa"===this.state.loginType}}const i=r},807339:(e,t,n)=>{n.d(t,{C:()=>S,Z:()=>y});n(21703);var o=n(730120),r=n(468695),i=n.n(r),a=n(749085),s=n(512174),l=n(568626),c=n(657347),d=n(552629),u=n(401898),p=n(855337),m=n(512955),g=n(548779),f=n(797448),h=n(535057),v=n(80444);const y="group";class b extends a.default{constructor(){super(...arguments),this.environment=void 0}getInitialState(){return{currentUserId:void 0,currentSpaceId:void 0,ready:!!(0,f.shouldUseNewStatsigInit)()}}isInitialized(){return f.StatsigInitializer.isComplete}async initialize(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,f.shouldUseNewStatsigInit)()||await this.initializeOld(e,t)}isReadyWithUserAndSpaceId(){const{currentSpaceId:e,currentUserId:t}=super.getState();return!!(0,f.shouldUseNewStatsigInit)()||Boolean(this.state.ready&&t&&e)}async initializeOld(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Date.now();this.environment=e;const{userId:o,spaceId:r}=_(e);if(this.isInitialized()&&void 0!==o)await this.updateUserAndSpace(e,t);else try{this.setStateBeforeInitOrUpdate(o,r),await this.confirmInitializeDidSucceed(),await this.updateStatsigUserWithAllKnownFields({environment:e,stage:"initialize"}),this.setStateAfterInitOrUpdate(o,r),this.trackMetric("statsig_client_init_success")}catch(i){this.logError("initialize",i,{nextUserId:o}),this.trackMetric("statsig_client_init_error")}finally{this.trackMetric("statsig_client_init_duration",{time:Date.now()-n})}}async updateUserAndSpace(e,t){(0,f.shouldUseNewStatsigInit)()||await this.updateUserAndSpaceOld(e,t)}async updateUserAndSpaceOld(e,t){const{userId:n,spaceId:o}=_(e);(this.state.currentUserId!==n||this.state.currentSpaceId!==o||t)&&(this.setStateBeforeInitOrUpdate(n,o),await this.updateStatsigUserWithAllKnownFields({environment:e,stage:"updateUserAndSpace"}),this.setStateAfterInitOrUpdate(n,o))}async confirmInitializeDidSucceed(){if(!f.StatsigInitializer.initializePromise)throw new Error("`statsig.initialize` was not called on app bootstrap");if(await f.StatsigInitializer.initializePromise,f.StatsigInitializer.error)throw f.StatsigInitializer.error}async updateStatsigUserWithAllKnownFields(e){let{environment:t,stage:n}=e;const o=Date.now();try{const e=await this.createStatsigUser(t);await i().updateUser(e),this.trackMetric("statsig_client_update_user_success")}catch(r){this.logError("updateUser",r,{nextUserId:t.currentUser.id,err:(0,c.t)(r).message,stage:n}),this.trackMetric("statsig_client_update_user_error")}finally{this.trackMetric("statsig_client_update_user_duration",{time:Date.now()-o})}}setStateBeforeInitOrUpdate(e,t){super.setState({currentUserId:e,currentSpaceId:t,ready:!1})}setStateAfterInitOrUpdate(e,t){const{currentSpaceId:n,currentUserId:o}=super.getState();n===t&&o===e&&super.setState({currentUserId:e,currentSpaceId:t,ready:!0})}getGroup(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y;const o=Date.now();if(!this.isInitialized())return;let r;try{return r=t?i().getExperimentWithExposureLoggingDisabled(e):i().getExperiment(e),this.trackMetric("statsig_client_get_group_success",{experiment_id:e}),(0,s.NC)(r,n)}catch(a){this.trackMetric("statsig_client_get_group_error",{experiment_id:e}),this.logError("getGroup",a,{experimentId:e,expConfig:JSON.stringify(r)})}finally{this.trackMetric("statsig_client_get_group_duration",{time:Date.now()-o})}}manuallyLogExperimentExposure(e){i().manuallyLogExperimentExposure(e)}checkGate(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Date.now();if(!this.isInitialized())return!1;let o;try{return o=t?i().checkGateWithExposureLoggingDisabled(e):i().checkGate(e),this.trackMetric("statsig_client_check_gate_success",{gate_name:e}),o}catch(r){const t=r instanceof Error?r.message:void 0;return this.logError("checkGate",r,{gateName:e,...t&&{errorMessage:t}}),this.trackMetric("statsig_client_check_gate_error",{gate_name:e}),!1}finally{this.trackMetric("statsig_client_check_gate_duration",{time:Date.now()-n})}}getConfig(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Date.now();if(!this.isInitialized())return;let o;try{return o=t?i().getConfig(e):i().getConfigWithExposureLoggingDisabled(e),this.trackMetric("statsig_client_get_config_success",{config_name:e}),o}catch(r){const t=r instanceof Error?r.message:void 0;return this.logError("getConfig",r,{dynamicConfigName:e,...t&&{errorMessage:t}}),void this.trackMetric("statsig_client_get_config_error",{config_name:e})}finally{this.trackMetric("statsig_client_get_config_duration",{time:Date.now()-n})}}logEvent(e,t,n){const o=Date.now();if(!this.isInitialized())return!1;try{return i().logEvent(e,t,n),this.trackMetric("statsig_client_log_event_success",{event_name:e}),!0}catch(r){const o=r instanceof Error?r.message:void 0;return this.logError("logEvent",r,{eventName:e,value:String(t),...n,...o&&{errorMessage:o}}),this.trackMetric("statsig_client_log_event_error",{event_name:e}),!1}finally{this.trackMetric("statsig_client_log_event_duration",{time:Date.now()-o})}}getLocalOverride(e){if(!this.isInitialized())return;const t=i().getAllOverrides().configs[e];return null==t?void 0:t[y]}getAllLocalOverrides(){if(this.isInitialized())return i().getAllOverrides()}updateLocalOverrideConfig(e,t){this.isInitialized()&&(i().overrideConfig(e,{[y]:t}),super.emit())}updateLocalOverrideGate(e,t){this.isInitialized()&&(i().overrideGate(e,"true"===t),super.emit())}getIsExperimentActive(e){return Boolean(i().getExperiment(e).getIsExperimentActive())}removeAllLocalOverrides(){const e=this.getAllLocalOverrides();e&&((0,u.Yd)(e.configs).forEach((e=>i().removeConfigOverride(e))),(0,u.Yd)(e.gates).forEach((e=>i().removeGateOverride(e))),super.emit())}async createStatsigUser(e){var t,n,r;const{device:i}=e,{currentUserSettingsStore:a,currentSpaceStore:s}=v.default.getState(),{userId:l,userEmail:c,spaceId:d}=_(e),u=await m.getBrowserId(e),p=await m.getExperimentDeviceId(e),{function:y,role:b,companySize:S,useCases:k}=(0,g.kO)();return(0,f.createStatsigUser)({userId:l,device:i,spaceId:d,userEmail:c,deviceId:p,browserId:u,locale:null==a||null===(t=a.getSettings())||void 0===t?void 0:t.preferred_locale,spaceCreatedTime:null==s?void 0:s.getCreatedTime(),spaceCreatedDate:null!=s&&s.getCreatedTime()?o.ou.fromMillis(null==s?void 0:s.getCreatedTime()).toFormat("yyyy-MM-dd"):void 0,subscriptionTier:(0,h.zt)(),isSalesAssistedPlan:(0,h.lz)(),planType:null==s?void 0:s.getPlanType(),signupTime:null==a||null===(n=a.getSettings())||void 0===n?void 0:n.signup_time,domainType:null==a||null===(r=a.getSettings())||void 0===r?void 0:r.domain_type,persona:y,teamRole:b,useCases:k,companySize:S})}logError(e,t,n){l.log({level:"error",from:"statsig",type:e,error:(0,d.Ui)(t),data:{miscDataToConvertToString:{...n,...this.state}}})}trackMetric(e,t){this.environment&&e.endsWith("_error")&&p.K4(this.environment,e,{...t,statsig_init_method:"classic"})}}function _(e){const{currentUser:t}=e,{currentSpaceStore:n,currentUserStore:o}=v.default.getState(),r=t.id,i=null==o?void 0:o.getEmail();return{userId:r,spaceId:null==n?void 0:n.id,userEmail:i}}const S=new b},757118:(e,t,n)=>{n.d(t,{j:()=>c,n:()=>l});var o=n(21359),r=n(548779),i=n(710929),a=n(80444),s=n(530221);function l(e){let{initialQuestion:t,openedFrom:n}=e;s.Z.setState({open:!0,initialQuestion:t,openedFrom:n})}async function c(e){let{environment:t,data:n,urlAnalytics:s}=e;const{utm_source:l,utm_medium:c,utm_content:m,utm_campaign:g,utm_term:f,gclid:h}=s??{},v={gclid:h,utm_source:p(l),utm_medium:p(c),utm_content:p(m),utm_campaign:p(g),utm_term:p(f)},y=await(0,i.iF)(t),b=a.default.state.currentSpaceStore;return await o.submitMarketoForm(t,{type:"contactSalesInApp",firstName:n.firstName,lastName:n.lastName,email:n.email,companyName:b?(0,r.rn)(t,b):"Untitled",companySize:d(n.companySize),country:y??"US",demoReason:u(n.question),message:n.additionalFeedback??void 0,ipCountry:y,...v})}function d(e){switch(e){case"<100":return 1;case"100-299":return 100;case"300-1999":return 300;case"2000+":return 2e3}}function u(e){switch(e){case"interest_in_enterprise":case"interest_in_business":return"enterprise";case"live_demo":return"demo";case"plan_help":return"pricing";case"manage_guests":case"other":return"other"}}function p(e){return"none"!==e?e:void 0}},43960:(e,t,n)=>{n.d(t,{n:()=>r});var o=n(21359);async function r(e){const t=await o.getExternalOrgData(e,{});if("failed"===t.type)return!1;const n=t.data;return"company_employee_count"in n&&parseInt(n.company_employee_count)>99}},622616:(e,t,n)=>{n.d(t,{Zz:()=>s,aQ:()=>c,yD:()=>l});n(21703);var o=n(464793),r=n(712139),i=n(21359),a=(n(95477),n(170060),n(333493));async function s(e){const{environment:t,spaceId:n}=e;if("init"!==a.Z.state.status)return;a.Z.didStartLoading();const s=await i.listPrices(t,{spaceId:n});if("success"!==s.type)return void a.Z.resetExceptSelectedCurrencyCode();const l=s.data.prices;l&&0!==l.length||r.IE(new Error("Received empty price list")),a.Z.setPrices(l.map((e=>new o.tA(e))))}function l(e){a.Z.availableCurrencyCodes.includes(e)&&a.Z.update((t=>({...t,selectedCurrencyCode:e})))}async function c(e){let{environment:t,spaceId:n}=e;return await s({environment:t,spaceId:n}),a.Z.state.prices}},897630:(e,t,n)=>{n.d(t,{EO:()=>ye,$B:()=>xe,Fp:()=>Ee,KD:()=>Ve,sv:()=>Ue,I0:()=>Be,Xb:()=>Fe,qg:()=>he,bi:()=>Ce,zb:()=>Me,ne:()=>Ae,eS:()=>ge,y3:()=>ve,OR:()=>Ie,TV:()=>fe,Mg:()=>me,r7:()=>we,M_:()=>Re});n(21703);var o=n(730120),r=(n(667294),n(841892),n(568626)),i=n(471924),a=(n(265454),n(915157)),s=n(909182),l=n(306995);var c=n(181886),d=n(102438),u=n(709291),p=n(653965),m=n(286572),g=n(21359),f=n(135253),h=n(547307),v=n(792625),y=n(497977),b=n(164964),_=n(772899),S=(n(95477),n(772770)),k=n(215010),w=n(433929),x=n(778873),I=n(195697),C=n(660606),T=n(80444),M=n(880148),P=n(749085);class A extends P.default{}const R=new A;var D=n(194160),B=n(421051),E=n(453730),F=n(281236),Z=n(206258),U=n(992083),V=n(327242),N=n(909209),O=n(185703),L=n(176117),j=n(170060),K=n(228517),z=n(342198),q=n(622616);var H=n(88893),G=n(535057),W=n(962142),$=n(333493),Y=n(288280),Q=n(144615),J=n(702688);async function X(e){const{environment:t,spaceId:n}=e,o=(0,Q.TA)({spaceId:n});if(!ne||ne!==o){let n;!function(e){te&&J.ZP.removeListener(te,e)}(t);const r=(t,o)=>{void 0!==n&&n!==o&&ee(e),n=o},i=p.P2(r,5e3);te=J.ZP.addListener(o,i,void 0,t),ne=o;if(!M.Z.state.visible_banners)return ee(e)}}async function ee(e){const{environment:t,spaceId:n}=e,o=await g.getSubscriptionBanner(t,{spaceId:n});var r;"success"===o.type&&((null===(r=T.default.state.currentSpaceStore)||void 0===r?void 0:r.id)===n&&M.Z.setState({visible_banners:o.data.bannerIds}))}let te,ne,oe,re;async function ie(e){const{environment:t,spaceId:n}=e,o=(0,Q.Ap)({spaceId:n});if(!re||re!==o){let n;!function(e){oe&&J.ZP.removeListener(oe,e)}(t);const r=(t,o)=>{void 0!==n&&n!==o&&ae(e),n=o},i=p.P2(r,5e3);oe=J.ZP.addListener(o,i,void 0,t),re=o;const a=C.Z.state;if(!Object.keys(a).length)return ae(e)}}async function ae(e){const{environment:t,spaceId:n}=e;if((0,H.ro)(t,n))return;const o=await g.getBillingSubscriptionBannerData(t,{spaceId:n});var r;"success"===o.type&&((null===(r=T.default.state.currentSpaceStore)||void 0===r?void 0:r.id)===n&&C.Z.setState(o.data.bannerData));const i=await g.getSubscriptionEntitlements(t,{spaceId:n});var a;"success"===i.type&&((null===(a=T.default.state.currentSpaceStore)||void 0===a?void 0:a.id)===n&&R.setState(i.data))}var se=n(43960),le=n(864891),ce=n(785893);const de="SubscriptionData";let ue;const pe=(0,u.defineMessages)({updatingSubscription:{id:"subscriptionSettings.updatingSubscriptionMessage",defaultMessage:"Updating your subscription…"},paymentMethodUpdateAuthFailed:{id:"subscriptionSettings.paymentMethodUpdateAuthFailedMessage",defaultMessage:"We could not update your payment method. Please try again or contact support."},verifyingEligibility:{id:"subscriptionSettings.verifyingEligibilityMessage",defaultMessage:"Verifying eligibility…"},personalFree:{id:"subscriptionSettings.personalFreeMessage",defaultMessage:"You are now subscribed to Notion’s Personal Pro Plan for free."},educationPlusFree:{id:"subscriptionSettings.educationPlusFreeMessage",defaultMessage:"You are now subscribed to Notion's Education plan for free"},finishingUp:{id:"subscription.upgrade.finishing",defaultMessage:"Finishing up..."}});async function me(e){const{from:t,environment:n,spaceStore:o,billingEmail:r,paymentData:i,vatId:a,coupon:c,customerName:d,businessName:u,addressLine1:p,addressZip:m,addressCity:y,addressState:b,addressCountry:_,promoCodeId:S,useTestClock:k,sessionId:w,inAppOffer:x,desiredState:I,trialData:C}=e;f.Js({bannerStore:B.Z}),v.j({message:pe.updatingSubscription});if(!Y.subscriptionDataStoreInstance.state)throw new Error("Subscription data not loaded.");const T=await D.Z.awaitData(n,{spaceId:null==o?void 0:o.id});if(!T)throw new Error("Billing data not loaded");const M=(0,s.iv)(T),{plan:P,addOns:A,isTrial:R}=function(e,t){if(!t)return{plan:void 0,addOns:[],isTrial:void 0};const n=e.items.filter((e=>"plan"!==(0,s.tw)(e))),o=t.items.find((e=>"plan"===(0,s.tw)(e))),r=t.items.filter((e=>"plan"!==(0,s.tw)(e)));return{isTrial:Boolean(t.trialEnd),plan:null==o?void 0:o.price.externalId,addOns:(0,l.dK)(n,r).map((e=>{let[t,n]=e;return{isCancellation:!n,priceId:(n??t).price.externalId,quantity:null==n?void 0:n.quantity}}))}}(M,I),E=await g.updateSubscription(n,{spaceId:o.id,plan:P,addOns:A,billingEmail:r,paymentMethodId:Ze(i),vatId:a,coupon:c,customerName:d,businessName:u,addressLine1:p,addressZip:m,addressCity:y,addressState:b,addressCountry:_,promoCodeId:S,useTestClock:k,modalSessionId:w,inAppOffer:x,isTrial:R,clientVersion:n.device.version,trialData:C});if(v.x(),"failed"===E.type)throw h.showError(E),new Error("An error occurred while updating subscription");await ke({environment:n,spaceStore:o,newDefaultTeamId:E.data.newDefaultTeamId});const F=Y.subscriptionDataStoreInstance.state,Z=o.id,U=o.getPlanType(),V=await D.Z.awaitData(n,{spaceId:null==o?void 0:o.id});if(!V)throw new Error("Billing data not loaded");if(ge({environment:n,context:{spaceId:Z,planType:U,from:t,isMmOrEnt:await(0,se.n)(n),trialData:C,modalId:w},oldData:T,newData:V,desiredState:I}),!F)throw new Error("Subscription data not loaded.");return E.data}function ge(e){var t,n;let{environment:o,context:r,oldData:i,newData:a,desiredState:l}=e;const c=(0,s.F6)(i.subscription),d=(0,s.zt)(i.subscription),u=(0,s.xi)(i.subscription),p=(0,s.Hw)(i.subscription),g=(0,s.bs)(i.subscription),f=i.email,h=(0,s.F6)(l),v=(0,s.zt)(l),y=(0,s.xi)(l),b=(0,s.Hw)(l),_=(0,s.bs)(l),S=Boolean(null==l?void 0:l.trialEnd),w=a.email,x=i.subscription,I=!(0,s.YK)(x)&&(0,s.YK)(l),C=(0,s.YK)(x)&&(0,s.YK)(l),T=(0,s.YK)(x)&&!(0,s.YK)(l);I&&h?m.k6(o,{plan:h,credit_amount:0}):C?m.wl(o,{billing_email_changed:f!==w,plan_changed:h!==c,plan_current:h,plan_old:c,currency_code:_,billing_address_changed:!1}):T&&c&&m.rx(o,{plan:c}),m._j(o,{from:r.from,action:T?"cancel":"update",spaceId:r.spaceId,isMmOrEnt:r.isMmOrEnt,planType:r.planType,addressCountry:null===(t=a.address)||void 0===t?void 0:t.country,oldSubscriptionTier:d,newSubscriptionTier:v,oldCurrency:g,newCurrency:_,oldPriceId:c,newPriceId:h,oldAddOns:u,newAddOns:y,oldBillingInterval:p,newBillingInterval:b,creditAmount:0,isProfessionalTeamUser:(0,k.QZ)(),isTrial:S,trialEndDate:null===(n=i.subscription)||void 0===n?void 0:n.trialEnd,trialData:r.trialData,modalId:r.modalId})}async function fe(e){const{environment:t,stripe:n,spaceStore:o,paymentMethodId:r}=e,i=await g.updatePaymentMethod(t,{spaceId:o.id,paymentMethodId:r});if("failed"!==i.type){if(i.data.clientSecret&&"requires_action"===i.data.status){if("succeeded"!==await Ne({stripe:n,clientSecret:i.data.clientSecret}))return void h.showErrorMessage(w.default.formatMessage(pe.paymentMethodUpdateAuthFailed));const e=await g.setDefaultPaymentMethod(t,{spaceId:o.id,paymentMethodId:r});if("failed"===e.type)return void h.showError(e)}await Ce(t)}else h.showError(i)}async function he(e){const{environment:t,invoiceId:n,paymentMethodId:o}=e,r=await g.payInvoice(t,{invoiceId:n,paymentMethodId:o});"failed"!==r.type||h.showError(r)}async function ve(e){const{environment:t,spaceStore:n,address:o}=e;f.Js({bannerStore:B.Z}),v.j({message:pe.updatingSubscription});const r=await g.updateSubscription(t,{spaceId:n.id,customerName:o.name,businessName:o.businessName,addressLine1:o.addressLine1,addressLine2:o.addressLine2,addressZip:o.zipCode,addressCity:o.city,addressState:o.state,addressCountry:o.country});if("failed"===r.type)throw v.x(),h.showError(r),r.error;m.wl(t,{billing_email_changed:!1,plan_changed:!1,billing_address_changed:!0}),await Te(t),await Ce(t),v.x()}async function ye(e){const{environment:t,spaceStore:n,planType:r,from:i}=e,a=Y.subscriptionDataStoreInstance.state;if(!a)throw new Error("Subscription data not loaded.");f.Js({bannerStore:B.Z}),v.j({message:pe.updatingSubscription});const s=be(t,a),l=a.addOns,c=H.XX(a),u=null==c?void 0:c.plan,p=await q.aQ({environment:t,spaceId:n.id}),y=u?(0,d.qH)(p,u):void 0,b=await g.cancelSubscription(t,{spaceId:n.id,planType:r,cancelImmediately:e.cancelImmediately});if("failed"===b.type)return v.x(),void h.showError(b);const _=H.XX(a);let S;"subscribed_admin"===a.type&&_&&(S=!0,m.rx(t,{plan:_.plan})),await ke({environment:t,spaceStore:n,newDefaultTeamId:void 0});const w=Y.subscriptionDataStoreInstance.state;if(!w)throw new Error("Subscription data not loaded.");return m._j(t,{from:i,action:"cancel",spaceId:n.id,oldSubscriptionTier:s,newSubscriptionTier:be(t,w),oldPriceId:_e(a,_),oldCurrency:Se(a),newCurrency:Se(w),oldAddOns:l.map((e=>e.feature)),oldBillingInterval:y,newBillingInterval:void 0,isCancelSubscription:S,isProfessionalTeamUser:(0,k.QZ)(),trialEndDate:null!=_&&_.trialEnd?o.ou.fromSeconds(_.trialEnd):void 0}),v.x(),!0}function be(e,t){const n=(0,G.zt)();if(!t)return n;return(0,H.DH)(t)?"free":n}function _e(e,t){if(!e)return;return(0,H.DH)(e)||null==t?void 0:t.plan}function Se(e){if(e)return"currencyCode"in e?e.currencyCode:void 0}async function ke(e){let{environment:t,newDefaultTeamId:n,spaceStore:o}=e;if(await Ce(t),await Te(t),$.Z.reset(),(0,I.bq)()&&t.currentUser.id&&void 0!==n){await K.m({userId:t.currentUser.id,spaceId:o.id,environment:t});const e=Z.zX.createChildStore(o,{table:"team",id:n,spaceId:o.id});await e.load()}}const we=(0,p.Ds)((async function(e){const{environment:t,spaceStore:n,code:o}=e;v.j({message:pe.verifyingEligibility});const r=Y.subscriptionDataStoreInstance.state;if(!r)throw new Error("Subscription data not loaded.");const i=await g.updateSubscriptionToEducationPlan(t,{spaceId:n.id,code:o});"failed"===i.type?h.showError(i):i.data.isEligible?Pe(r,t):N.Z.setState({open:!0,handlePromoCode:async e=>{v.j({message:pe.updatingSubscription});const o=await g.updateSubscriptionToEducationPlan(t,{spaceId:n.id,code:e});"failed"===o.type?h.showError(o):o.data.isEligible?Pe(r,t):h.showErrorMessage((0,ce.jsx)(u.FormattedMessage,{id:"subscriptionSettings.invalidPromoCodeError.message",defaultMessage:"This promo code is not valid."})),v.x()}}),v.x()}),1e3,{leading:!0,trailing:!1});function xe(){ue&&ue.close()}async function Ie(e){const{environment:t,spaceId:n,isNewlyCreatedSpace:o}=e,r=Y.subscriptionDataStoreInstance.spaceId;if(!t.currentUser.isLoggedIn()||r&&r===n)await Y.subscriptionDataStoreInstance.waitUntilLoaded();else if(M.Z.setState({}),X({environment:t,spaceId:n}),C.Z.setState({}),R.setState({}),ie({environment:t,spaceId:n}),o){const e={type:"unsubscribed_admin",users:[],joinedMemberIds:[],blockUsage:0,hasPaidNonzero:!1,accountBalance:0,timelineViewUsage:0,inviteLinkCode:"",userSimilarity:{},spaceUsers:[],members:[],customerData:void 0,revenueCatEnabled:!1,addOns:[],currencyCode:void 0};Y.subscriptionDataStoreInstance.setState(e),Y.subscriptionDataStoreInstance.spaceId=n,L.O.setState(e.userSimilarity),Ce(t)}else Ce(t)}async function Ce(e){var t;const n=null===(t=T.default.state.currentSpaceStore)||void 0===t?void 0:t.id,o=e.currentUser.id;if(!n)throw new Error("No spaceId.");{const t=`${de}:${n}:v2`,i=a.Z.get({userId:o,key:t});i&&(Y.subscriptionDataStoreInstance.setState(i),Y.subscriptionDataStoreInstance.spaceId=n,L.O.setState(i.userSimilarity)),await async function(e){let{environment:t,spaceId:n,currentUserId:o,localKey:i}=e;o&&z.default.initializeAndLoadAllUserSignals({environment:t,userId:o,spaceId:n});await E.transactionQueue.drain();const[s,l]=await Promise.all([g.getSubscriptionData(t,{spaceId:n}),g.getVisibleUsers(t,{spaceId:n})]);if("success"===s.type&&"success"===l.type){var c;const e={...s.data,...l.data};try{a.Z.set({userId:o,key:i,value:e})}catch{r.log({level:"error",from:"subscriptionActions",type:"subscriptionDataTooLarge",data:{miscDataToConvertToString:{subscriptionDataJsonSize:JSON.stringify(e).length}}})}(null===(c=T.default.state.currentSpaceStore)||void 0===c?void 0:c.id)===n&&(Y.subscriptionDataStoreInstance.setState(e),Y.subscriptionDataStoreInstance.spaceId=n,L.O.setState(e.userSimilarity),H.YK(e)&&m.jw(t))}else r.log({level:"error",from:"subscriptionActions",type:"fetchSubscriptionDataFailed",data:{miscDataToConvertToString:{getSubscriptionDataResponseType:s.type,getSubscriptionDataResponseStatus:s.status,getVisibleUserResponseType:l.type,getVisibleUserResponseStatus:l.status}}});await Promise.all([F.Z.awaitData(t,{spaceId:n},!0),_.aiDependency.load().then((e=>{let{completionActions:o}=e;return o.updateAiEligibility(t,n)}))])}({environment:e,spaceId:n,currentUserId:o,localKey:t}),await D.Z.resetData(e,{spaceId:n})}}function Te(e){var t;const n=null===(t=T.default.state.currentSpaceStore)||void 0===t?void 0:t.id;if(!n)throw new Error("No spaceId.");return O.Z.resetData(e,{spaceId:n})}async function Me(e,t){const n=T.default.state.currentSpaceStore;if(!n)return;const o=await g.getBillingHistory(e,{spaceId:n.id,limit:t.state.billingEventsLimit});"success"===o.type&&t.update((e=>({...e,billingEvents:o.data.events})))}async function Pe(e,t){await Ce(t),await Te(t),$.Z.reset();const n=()=>{h.showMessage({message:w.default.formatMessage(pe.educationPlusFree)}),U.Z.setState({...U.Z.state,currentTab:"billing",defaultSubtab:void 0});const n=H.XX(e);m.jh(t,{plan:"student_free",old_plan:n?n.plan:void 0})};await y.shouldCreatePassword(t)?x.E({environment:t,onSubmit:n,onCancel:n}):n()}function Ae(){b.oV({label:(0,ce.jsx)(u.FormattedMessage,{id:"subscriptionActions.overBlockLimit.snackbar",defaultMessage:"Upgrade to add content to your workspace"})})}function Re(e){const t=T.default.state.currentSpaceStore,n=Y.subscriptionDataStoreInstance.state,o=(0,j.vT)(),r=(0,j.fQ)(),i=M.Z.state.visible_banners;if(n){if((0,j.du)())return De(e),!0;if(o&&null!==r)return De(e),!1;if(H.Ln(e,n))return m.lj(e),De(e),!1;H.XZ(e,n)&&m.z2(e)}if(t&&i&&i.length>0){const e=i[0];if("uncollectible_unpaid"===Z.$I.createChildStore(t,{id:e,table:"subscription_banner",spaceId:t.id}).getBannerKey())return!1}return!R.state.editsBlocked&&(f.qL({bannerStore:B.Z,id:"SubscriptionEditingBlocker"}),!0)}function De(e){f.Bw({id:"SubscriptionEditingBlocker",bannerStore:B.Z,styleKey:S.v.Red,contentKey:"over_free_block_limit"})}function Be(e,t){const{subscriptionTier:n,from:o,addOnFeature:r,coupon:a,isTrial:s,dismissMobilePlansModal:l}=t,c=i.Il();m.Lc(e,{subscriptionTier:n,from:o,addOnFeature:r,currency_code:$.Z.state.selectedCurrencyCode,isTrial:s,modal_id:c}),V.Z.open({subscriptionTier:n,billingInterval:"month",addOnFeature:r,coupon:a,isTrial:s,sessionId:c,dismissMobilePlansModal:l})}function Ee(e){const t=V.Z.state;t.open&&(m.LY(e,{modal_id:t.sessionId}),V.Z.setState({open:!1}))}function Fe(e){W.Z.open(e)}function Ze(e){return"paymentMethodId"===(null==e?void 0:e.type)?e.value:void 0}async function Ue(e){var t;const{environment:n,product:o,spaceStore:r,data:i,from:a,pageSection:d,churnState:u}=e,m=await q.aQ({environment:n,spaceId:r.id}),g=await D.Z.awaitData(n,{spaceId:null==r?void 0:r.id});if(!g)throw new Error("Billing data not loaded");const f=(null===(t=(0,s.a7)(null==g?void 0:g.subscription,"sites_custom_hostnames"))||void 0===t?void 0:t.quantity)??0,h=g.subscription;if(!(h&&H.MM(i)||"free"===o))return void Be(n,{subscriptionTier:o,from:a});const v=(0,s.Lg)(g),y=(0,s.bs)(h),b=(0,s.Hw)(v),_=(0,s.Hw)(h),S=b??_,k=(0,s.ry)(v),w=(0,s.ry)(h),x=k??w;let I;if("free"===o)I=(0,l.t4)(v,"plan");else{if(!(y&&S&&x))throw new Error("Trying to update plan on a subscription with no items");{const e={product:o,currency:y,interval:S};I=(0,l.dP)((0,c.Vj)({prices:m,quantity:x,domainsQuantity:f}),v,e)}}if(!p.Xy(v,I)){if((0,l._D)(v,I)){if("no_churn"===u||!u)return;return 0===I.items.length?await ye({environment:n,spaceStore:r,planType:"personal",from:a,cancelImmediately:"churn_immediately"===u}):await me({environment:n,spaceStore:r,desiredState:I,from:a})}return le.af({environment:n,from:a,view:"plans",temporarySubscriptionTier:o,billingInterval:S,pageSection:d})}}async function Ve(e){v.j({message:pe.finishingUp});const{paymentIntentData:t,stripe:n,onSuccess:o,onFailure:r}=e,i=t.paymentIntentClientSecret;let a=t.paymentIntentStatus;i&&"requires_action"===a&&(a=await Ne({stripe:n,clientSecret:i})),"succeeded"===a||"processing"===a?null==o||o():function(e){let{status:t}=e;return["requires_payment_method","requires_source"].includes(t)}({status:a})&&(null==r||r()),v.x()}async function Ne(e){let{stripe:t,clientSecret:n}=e;const{paymentIntent:o,setupIntent:r,error:i}=await t.handleNextAction({clientSecret:n});if(o)return o.status;if(r)return r.status;if(i.payment_intent)return i.payment_intent.status;if(i.setup_intent)return i.setup_intent.status;throw new Error(`Unexpected error handling intent: ${i.message}`)}},140469:(e,t,n)=>{n.d(t,{SP:()=>v,W_:()=>g,km:()=>y,l_:()=>f,nf:()=>h});var o=n(319234),r=n(398724),i=n(647425),a=n(21359),s=n(327242),l=n(88893),c=n(163423),d=n(962142),u=n(333493),p=n(925692),m=n(288280);async function g(e){const t=s.Z.state,n=m.subscriptionDataStoreInstance.state;if(!t.open||!n)return;const r=t.temporaryAddress;if(!(0,o.A)(r))return;s.Z.update((e=>({...e,calculatingTax:!0})));const{planAmount:i,promoInfo:c,accountBalance:d}=(0,l.uN)({promo:t.appliedPromo,currencyCode:u.Z.selectedCurrencyCode,data:n,addOnFeature:t.addOnFeature,onlyShowAddOn:t.onlyShowAddOn,subscriptionTier:t.subscriptionTier,taxAmount:t.taxAmount,calculatingTax:t.calculatingTax,billingInterval:t.temporaryBillingInterval??"year",coupon:t.coupon}),p=Math.max(0,i-c.amount+d),g=await a.calculateTax(e,{address:r,price:p,vatId:t.vatApplicable?t.temporaryVatCode:void 0,customerId:"subscribed_admin"===n.type?n.customerData.stripe.customerId:void 0});if("failed"===g.type)s.Z.update((e=>({...e,taxAmount:void 0,calculatingTax:!1})));else{const e=g.data;e.valid?s.Z.update((t=>({...t,taxAmount:e.taxAmount,calculatingTax:!1,taxCalculationError:void 0}))):s.Z.update((t=>({...t,taxAmount:void 0,calculatingTax:!1,taxCalculationError:e.error})))}}async function f(e){var t;const n=d.Z.state,i=m.subscriptionDataStoreInstance.state;if(!n.open||!i)return;const s=n.temporaryAddress;if(!(0,o.A)(s))return;d.Z.update((e=>({...e,calculatingTax:!0})));const l=(null===(t=n.totalUpgradeCost)||void 0===t?void 0:t.amount)||0,c=await a.calculateTax(e,{address:s,price:l,vatId:n.vatApplicable?n.temporaryVatCode:void 0,customerId:"subscribed_admin"===i.type?i.customerData.stripe.customerId:void 0});if("failed"===c.type)d.Z.update((e=>({...e,taxAmount:void 0,calculatingTax:!1})));else{const e=c.data;e.valid?d.Z.update((t=>({...t,taxAmount:r.n.fromValue({amount:e.taxAmount,currencyCode:u.Z.selectedCurrencyCode}),calculatingTax:!1,taxCalculationError:void 0}))):d.Z.update((t=>({...t,taxAmount:void 0,calculatingTax:!1,taxCalculationError:e.error})))}}async function h(e){const{environment:t,priceForTaxCalculation:n,address:o,customerId:r,vatId:i}=e,s=c.Z.state,l=await a.calculateTax(t,{address:o,customerId:r,vatId:i,price:n});if("failed"===l.type);else{const e=l.data;e.valid&&s.open&&c.Z.update((t=>({...t,tax:Math.max(0,e.taxAmount)})))}}async function v(e){var t;const n=p.Z.state,r=m.subscriptionDataStoreInstance.state;if(!n.open||!r)return;if("subscribed_admin"!==r.type&&"unsubscribed_admin"!==r.type)return;const s=null===(t=r.customerData)||void 0===t?void 0:t.stripe;if(!s)return;const c=s.address;if(!c||!(0,o.A)(c))return;p.Z.update((e=>({...e,calculatingTax:!0})));const d=n.temporarySubscriptionTier??n.subscriptionTier,g=(0,i.QM)(d)&&n.addOnFeature?"month":"year",f=n.temporaryBillingInterval??n.billingInterval??g,h=!(0,i.QM)(d)&&Boolean(n.addOnFeature),{payAmount:v}=(0,l.uN)({promo:void 0,currencyCode:u.Z.selectedCurrencyCode,data:r,addOnFeature:n.addOnFeature,onlyShowAddOn:h,subscriptionTier:d,taxAmount:n.taxAmount,calculatingTax:n.calculatingTax,billingInterval:f,coupon:n.coupon}),y=await a.calculateTax(e,{address:c,price:v.amount,vatId:s.vatId,customerId:s.customerId});if("failed"===y.type)return void p.Z.update((e=>({...e,taxAmount:void 0,calculatingTax:!1,taxCalculationError:y.error})));const b=y.data;b.valid?p.Z.update((e=>({...e,taxAmount:b.taxAmount,calculatingTax:!1}))):p.Z.update((e=>({...e,taxAmount:void 0,calculatingTax:!1})))}async function y(e){const{environment:t,stripeData:n,taxableAmount:r}=e,{address:i,customerId:s,vatId:l}=n||e;if(!i||!(0,o.A)(i))return;const c=await a.calculateTax(t,{address:i,price:r.amount,vatId:l,customerId:s});if("failed"===c.type)return;const d=c.data;return d.valid?d.taxAmount:void 0}},864891:(e,t,n)=>{n.d(t,{Mg:()=>M,OT:()=>T,Zo:()=>A,af:()=>x,bX:()=>C,cM:()=>I,y5:()=>P});n(21703);var o=n(471924),r=n(909182),i=n(306995),a=n(181886),s=n(286572),l=n(547307),c=n(792625),d=n(91376),u=n(164964),p=n(80444),m=n(194160),g=n(740670),f=n(88893),h=n(535057),v=n(587598),y=n(333493),b=n(925692),_=n(288280),S=n(622616),k=n(897630),w=n(140469);function x(e){const{environment:t,from:n,view:r,temporarySubscriptionTier:i,temporaryBillingInterval:a,billingInterval:l,addOnFeature:c,pageSection:d,onSuccess:u,legacyAnnualPrice:p}=e,m=o.Il();s.YT(t,{from:n,pageSection:d,view:r,modal_id:m,currency_code:y.Z.selectedCurrencyCode}),b.Z.setState({open:!0,modalId:m,view:r,subscriptionTier:(0,h.zt)(),temporarySubscriptionTier:i,billingInterval:l,temporaryBillingInterval:a,calculatingTax:!1,isExpandedView:!1,addOnFeature:c,legacyAnnualPrice:p,onSuccess:u}),w.SP(t)}function I(e){const t=b.Z.state;t.open&&(s.q7(e,{state:t}),b.Z.setState({open:!1}))}function C(e){const t=b.Z.state;t.open&&(s.y$(e,{state:t}),b.Z.setState({...t,isExpandedView:!0}))}function T(e){const t=b.Z.state;t.open&&(s.k1(e,{state:t}),b.Z.setState({...t,isExpandedView:!1}))}async function M(e,t,n){var o;const l=p.default.state.currentSpaceStore;if(!l)return;const c=b.Z.state;if(!c.open)return;s.nd(e,{state:c});const{view:d,onSuccess:h}=c,v=_.subscriptionDataStoreInstance.state,w=await S.aQ({spaceId:l.id,environment:e}),x=await m.Z.awaitData(e,{spaceId:null==l?void 0:l.id});if(!x)throw new Error("Billing data not loaded");const C=(0,r.Lg)(x),T=c.temporarySubscriptionTier,M=c.addOnFeature,P=c.temporaryBillingInterval??"year",A=(0,r.Hw)(C)??c.billingInterval??"year",R=y.Z.selectedCurrencyCode,D=v?(0,f.su)(v):1,B=null===(o=(0,r.a7)(x.subscription,"sites_custom_hostnames"))||void 0===o?void 0:o.quantity;let E,F=C;const Z=(0,a.Vj)({prices:w,quantity:D,domainsQuantity:B??0});if("add_ons"===d&&M){const e={product:M,interval:A,currency:R};F=(0,i.dP)(Z,F,e),E=g.aQ({addOnFeature:M})}else if("billing_interval"===d||"annual_lock_in"===d)F=(0,i.Zl)(w,F,P),E=g.Nj({billingInterval:P});else{if("plans"!==d||!T)return void I(e);{const e={product:T,interval:A,currency:R};F=(0,i.dP)(Z,F,e),E=g.s6({newTier:T})}}const U=await k.Mg({environment:e,from:"space_settings-plans_tab",spaceStore:l,desiredState:F,inAppOffer:n});await k.KD({paymentIntentData:U,stripe:t,onSuccess:h}),I(e),E&&u.oV(E)}async function P(e){var t;const{environment:n,billingData:o}=e,i=p.default.state.currentSpaceStore;if(!i)return;if(null===(t=o.subscription)||void 0===t||!t.pending)return l.showErrorMessage((0,g.iS)());if(!i)return l.showErrorMessage((0,g.iS)());const a=(0,r.iv)(o);return await k.Mg({environment:n,from:"space_settings-billing_tab",spaceStore:i,desiredState:a}),u.oV({label:(0,g.UW)()}),await k.bi(n)}async function A(e){const t=p.default.state.currentSpaceStore;t&&(c.j({message:v.z.cancellingTrial}),await k.EO({environment:e,spaceStore:t,planType:t.getPlanType()??"personal",from:"space_settings-plans_tab"}),c.x(),d.r$({currentTab:"billing"}))}},575649:(e,t,n)=>{n.d(t,{y:()=>T});n(667294);var o=n(647425),r=n(709291),i=n(286572),a=n(547307),s=n(91376),l=n(296994),c=n(352533),d=n(80444),u=n(170060),p=n(88893),m=n(535057),g=n(288280),f=n(755130),h=n(864307),v=n(636127),y=n(382914),b=n(699884),_=n(969098),S=n(785893);async function k(){return await _.o.showAsyncModal((e=>(0,S.jsx)(b.c,{isOpen:e.isOpen,onDismiss:e.onDismiss,onClosed:e.onClosed,areaConstraint:{width:{type:"min",length:270},height:{type:"unlimited",scroll:"allow"}},render:()=>(0,S.jsx)(y.sR,{header:(0,S.jsx)(y.vI,{iconAndTitle:(0,S.jsx)(y.kC,{iconGroup:v.b,title:(0,S.jsx)(r.FormattedMessage,{id:"ineligibleForTrialDialog.message",defaultMessage:"This workspace is not eligible for a free trial"})})}),footer:(0,S.jsx)(y.a6,{layout:"vertical",primaryButtons:[{label:(0,S.jsx)(r.FormattedMessage,{id:"ineligibleForTrialDialog.close",defaultMessage:"Got it"}),buttonType:"outline",onClick:e.onDismiss}]})})})))}var w=n(757118),x=n(43960),I=n(897630),C=n(864891);async function T(e,t){var n;i.sA(e,{from:t.from,for_subscription_tier:t.for,addOnFeature:t.addOnFeature});if((0,m.QM)()&&["block_limit_sidebar","block_limit_settings","block_limit_banner","database_chart_paywall","delete_blocks_modal","slash_menu"].includes(t.from)&&!t.addOnFeature){if(e.device.isMobileBrowser){const n=await l.FF.payments.load();return void(await n.plans.showPlans({environment:e,from:t.from}))}return void s.r$({openedFrom:"upsell",upsellType:t.from,currentTab:"plans"})}if(!t.addOnFeature&&(0,o.QM)(t.for))return;const v=(0,c.S$)({environment:e})&&"personal"===t.for;if(e.device.isMobileNative){if("ai"===t.addOnFeature){const t=(0,c.Y2)({environment:e})?(0,S.jsx)(r.FormattedMessage,{id:"upsellActions.noIAPForAIWithExternalPurchaseOption",defaultMessage:"Your workspace does not have unlimited AI. Visit on desktop to purchase Notion AI and go unlimited."}):(0,S.jsx)(r.FormattedMessage,{id:"upsellActions.noIAPForAIWithoutExternalPurchaseOption",defaultMessage:"Your workspace does not have unlimited AI. Unfortunately, unlimited AI cannot be purchased on mobile."});return void a.showErrorMessage(t)}if(!v)return}const y=d.default.state.currentSpaceStore;if(!y)return;if(!y.canAdmin())return;await I.bi(e);const b=g.subscriptionDataStoreInstance.state;if(!b)return;if("unsubscribed_admin"!==b.type&&"subscribed_admin"!==b.type)return void(t.dontOpenPlansOnCancel||s.r$({openedFrom:"upsell",upsellType:t.from,currentTab:"plans"}));if(p.ri(b))return void a.showErrorMessage((0,S.jsx)(r.FormattedMessage,{id:"subscriptions.paymentMethodUnverified",defaultMessage:"Your payment is being processed. Please try again when your payment has completed."}));if(p.ff(b)){const e=(0,S.jsx)(r.FormattedMessage,{id:"upsellActions.referToSalesRep",defaultMessage:"This workspace is part of a managed account. Please contact your account representative to discuss any changes to your subscription."});return void a.showErrorMessage(e)}if((0,o.wP)(t.for)){if(await(0,x.n)(e))return void(0,w.n)({initialQuestion:"interest_in_enterprise",openedFrom:t.from})}if(v)return void(e.mobileNative&&y.id&&e.mobileNative.openUpgradeModal(y.id));if("revenueCat"===(null===(n=b.customerData)||void 0===n?void 0:n.activeSubscriptionPlatform)){const e=(0,S.jsx)(r.FormattedMessage,{id:"upsellActions.switchPlanFromInAppPurchase",defaultMessage:"You're currently subscribed through an in-app purchase with Apple. To switch plans, cancel your subscription with Apple first."});return void a.showErrorMessage(e)}const _=p.XX(b);if(t.addOnFeature&&(0,h.Fk)(_)){const e=(0,S.jsx)(r.FormattedMessage,{id:"upsellActions.noAddOnPurchaseDuringFreeTrial",defaultMessage:"Unfortunately, additional {addOn, select, ai {AI responses} other {features}} cannot be purchased while a workspace is on a free trial.",values:{addOn:t.addOnFeature}});a.showErrorMessage(e)}else{if(_&&p.MM(b))return(0,u.rD)()&&t.isTrial?void k():t.addOnFeature?void C.af({environment:e,from:t.from,view:"add_ons",addOnFeature:t.addOnFeature,billingInterval:_.interval,pageSection:t.pageSection}):void C.af({environment:e,from:t.from,view:"plans",temporarySubscriptionTier:t.for,billingInterval:_.interval,pageSection:t.pageSection});{const n=(0,u.px)(e,t.for)?"ai_fifty_percent":void 0;if((0,u.rD)()&&t.isTrial&&"trial_deeplink"===t.from){const t=await f.I.trialActions.load();if(!(await t.isEligibleForBlockLimitTimedTrial(e,y)))return void k()}I.I0(e,{subscriptionTier:t.for,from:t.from,addOnFeature:t.addOnFeature,coupon:n,isTrial:t.isTrial,dismissMobilePlansModal:t.dismissMobilePlansModal})}}}},740670:(e,t,n)=>{n.d(t,{Nj:()=>T,Tg:()=>S,UW:()=>_,YZ:()=>x,Z_:()=>k,aQ:()=>M,iS:()=>b,rO:()=>w,s6:()=>C});n(757658),n(667294);var o=n(313991),r=n(407057),i=n(909182),a=n(647425),s=n(709291),l=n(401898),c=n(433929),d=n(83475),u=n(88893),p=n(785893);const m=(0,s.defineMessages)({cancellationError:{id:"midtermSubscriptionHelpers.cancellationFailed",defaultMessage:"There was an error attempting to cancel your pending changes. Please try again."},unableToCancelError:{id:"midtermSubscriptionHelpers.unableToCancel",defaultMessage:"We cannot cancel your scheduled changes right now. Please contact support for more help."},cancellationSuccess:{id:"midtermSubscriptionHelpers.cancellationSucceeded",defaultMessage:"Pending changes have been canceled"},invalidSubscriptionId:{id:"midtermSubscriptionHelpers.invalidSubscriptionId",defaultMessage:"Unable to cancel your pending changes. Something was wrong with your pending subscription changes."}});function g(e){return(0,a.QM)(e)?"free":(0,a.iJ)(e)?"education":(0,a.Aw)(e)?"singlePlayerPlus":(0,a.eR)(e)?"plus":(0,a.NG)(e)?"business":(0,u.gG)(e)?"enterprise":"legacy"}const f=(0,s.defineMessages)({personalFreePlan:{defaultMessage:"Personal Plan",id:"personalFreePlan.title"},personalFree:{defaultMessage:"Personal",id:"personalFree.title"},teamTrialPlan:{defaultMessage:"Team Plan (Trial)",id:"teamTrialPlan.title"},freePlan:{defaultMessage:"Free Plan",id:"freePlan.title"},free:{defaultMessage:"Free",id:"free.title"},personalPlan:{defaultMessage:"Personal Pro Plan",id:"personalPlan.label"},personal:{defaultMessage:"Personal Pro",id:"personal.label"},singlePlayerPlusPlan:{defaultMessage:"Plus Plan with a 1-member limit",id:"singlePlayerPlusPlan.title"},educationPlan:{defaultMessage:"Personal Pro Plan (Education)",id:"personalEducationPlan.title"},educationPlusPlan:{defaultMessage:"Education Plus Plan",id:"educationPlusPlan.title"},teamPlan:{defaultMessage:"Team Plan",id:"teamPlan.title"},team:{defaultMessage:"Team",id:"team.title"},plusPlan:{defaultMessage:"Plus Plan",id:"plusPlan.title"},plus:{defaultMessage:"Plus",id:"plus.title"},businessPlan:{id:"businessPlan.title",defaultMessage:"Business Plan"},business:{id:"business.title",defaultMessage:"Business"},enterprisePlan:{defaultMessage:"Enterprise Plan",id:"enterprisePlan.label"},enterprise:{defaultMessage:"Enterprise",id:"enterprise.label"},legacyPlan:{defaultMessage:"Legacy Plan",id:"legacyPlan.label"}}),h={free:{planTitle:f.freePlan},singlePlayerPlus:{planTitle:f.plusPlan},education:{planTitle:f.educationPlusPlan},plus:{planTitle:f.plusPlan},business:{planTitle:f.businessPlan},enterprise:{planTitle:f.enterprisePlan},legacy:{planTitle:f.legacyPlan}},v=(0,s.defineMessages)({notionAI:{defaultMessage:"Notion AI",id:"notionAI.title"},removeAI:{defaultMessage:"Remove AI",id:"notionAI.remove.title"}}),y=(0,s.defineMessages)({month:{defaultMessage:"Monthly billing",id:"billingInterval.monthly"},year:{defaultMessage:"Annual billing",id:"billingInterval.annual"}});function b(){return c.default.formatMessage(m.unableToCancelError)}function _(){return c.default.formatMessage(m.cancellationSuccess)}function S(e){const t=function(e){var t;const n=null==e||null===(t=e.subscription)||void 0===t?void 0:t.pending;if(!n)return;const o=(0,i.iv)(e),r=(0,i.Lg)(e);return{oldTier:(0,i.zt)(o)??"free",newTier:(0,i.zt)(r)??"free",oldAIAddOn:(0,i.xi)(o).find((e=>"ai"===e)),newAIAddOn:(0,i.xi)(r).find((e=>"ai"===e)),oldInterval:(0,i.Hw)(o),newInterval:(0,i.Hw)(r),phaseOneEndDate:n.startDate}}(e),n=[];if(!t)return{scheduledChanges:n,periodEndDate:null};const{newTier:o,oldTier:r,oldAIAddOn:a,newAIAddOn:s,oldInterval:l,newInterval:d,phaseOneEndDate:u}=t;var p,m;return r!==o&&n.push(function(e,t){const n=g(e),o=c.default.formatMessage(h[n].planTitle);if(!t)return"";const r=g(t);return`${o} → ${c.default.formatMessage(h[r].planTitle)}`}(r,o)),a!==s&&n.push((p=a,m=s,`${c.default.formatMessage(p?v.notionAI:v.removeAI)} → ${c.default.formatMessage(m?v.notionAI:v.removeAI)}`)),l!==d&&n.push(function(e,t){return e&&t?`${c.default.formatMessage("month"===e?y.month:y.year)} → ${c.default.formatMessage("month"===t?y.month:y.year)}`:""}(l,d)),{scheduledChanges:n,periodEndDate:u}}function k(e,t,n){return"billing_interval"===e&&"year"===t&&"month"===n}function w(e,t,n){return"plans"===e||"add_ons"===e||"billing_interval"===e&&"month"===t&&"year"===n}function x(e,t){if(!e)return;const n=(0,i.iv)(e).items,o=(0,i.Lg)(e).items;var r;return(0,i.dK)(n,o).some((e=>{let[n,o]=e;return(0,i.tw)(n??o)===t&&n&&!o}))?null===(r=e.subscription)||void 0===r||null===(r=r.pending)||void 0===r?void 0:r.startDate:void 0}function I(e){return(0,p.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,d.e)({width:12}),e.children]})}function C(e){const{newTier:t}=e;switch(t){case"plus":return{label:(0,p.jsx)(I,{children:(0,p.jsx)(s.FormattedMessage,{id:"midtermChangeHelpers.snackbar.upgradePlan.plus",defaultMessage:"You have successfully upgraded to the Plus plan"})})};case"business":return{label:(0,p.jsx)(I,{children:(0,p.jsx)(s.FormattedMessage,{id:"midtermChangeHelpers.snackbar.upgradePlan.business",defaultMessage:"You have successfully upgraded to the Business plan"})})};case"enterprise":return{label:(0,p.jsx)(I,{children:(0,p.jsx)(s.FormattedMessage,{id:"midtermChangeHelpers.snackbar.upgradePlan.enterprise",defaultMessage:"You have successfully upgraded to the Enterprise plan"})})};case"student":return{label:(0,p.jsx)(I,{children:(0,p.jsx)(s.FormattedMessage,{id:"midtermChangeHelpers.snackbar.upgradePlan.student",defaultMessage:"You have successfully upgraded to the Student plan"})})};case"free":case"personal":case"personal_free":case"team_free":return;default:(0,l.t1)(t)}}function T(e){const{billingInterval:t,effectiveDateEpochMs:n}=e,i=n?(0,r.Yx)(n,"medium",o.locale):void 0;return i?{label:(0,p.jsx)(s.FormattedMessage,{id:"midtermChangeHelpers.snackbar.billingInterval.future",defaultMessage:"{billingInterval, select, year {Yearly} other {Monthly}} billling will be effective {date}",values:{billingInterval:t,date:i}})}:{label:(0,p.jsx)(I,{children:(0,p.jsx)(s.FormattedMessage,{id:"midtermChangeHelpers.snackbar.billingInterval.success",defaultMessage:"You have successfully changed to {billingInterval, select, year {yearly} other {monthly}} billing",values:{billingInterval:t}})})}}function M(e){const{addOnFeature:t}=e;switch(t){case"ai":return{label:(0,p.jsx)(I,{children:(0,p.jsx)(s.FormattedMessage,{id:"midtermChangeHelpers.snackbar.purchaseAddOn.ai",defaultMessage:"You have successfully added Notion AI"})})};case"sites_custom_hostnames":return{label:(0,p.jsx)(I,{children:(0,p.jsx)(s.FormattedMessage,{id:"midtermChangeHelpers.snackbar.purchaseAddOn.sites",defaultMessage:"Successfully purchased Custom domain add-on"})})};default:(0,l.t1)(t)}}},170060:(e,t,n)=>{n.d(t,{EN:()=>B,EQ:()=>x,G2:()=>C,H:()=>A,Iy:()=>b,Og:()=>D,ZX:()=>h,_v:()=>I,bQ:()=>w,du:()=>m,fD:()=>M,fQ:()=>g,fX:()=>R,fc:()=>_,gi:()=>S,ho:()=>k,px:()=>v,rD:()=>T,sd:()=>y,vT:()=>f,zS:()=>P});var o=n(44317),r=n(647425),i=n(80444),a=n(385555),s=n(288280),l=n(88893),c=n(535057);const d=3,u=-1;function p(){const{currentSpaceStore:e}=i.default.state,t=null==e?void 0:e.getSettings().reach_block_limit_time;return t?(0,o.O5)(t):null}function m(){const{currentSpaceStore:e}=i.default.state;if(!(null==e?void 0:e.getSettings().exposed_to_block_management))return!1;const t=p();return null!==t&&(!(null!==t&&t>=d)&&f())}function g(){const e=p();return null!==e&&d-e>0?d-e:u}function f(){const{currentSpaceStore:e}=i.default.state,t=null==e?void 0:e.getSettings().exposed_to_block_management;return 1!==(0,l.qX)()&&(!!(0,c.QM)()&&(!!t&&"on"===a.default.getEligibleGroup({experimentId:"block_management",defaultGroup:"control"})))}function h(){return Boolean(a.default.checkGate({gateName:"in_app_contact_sales_marketo"}))}function v(e,t){var n;if(e.device.isMobile)return!1;const o=s.subscriptionDataStoreInstance.state;if(!o)return!1;if(("subscribed_admin"===o.type||"unsubscribed_admin"===o.type)&&null!==(n=o.customerData)&&void 0!==n&&n.stripe&&Boolean(o.customerData.stripe.promo))return!1;const i=t??(0,c.zt)();return!!((0,r.mq)(i)&&(0,l.su)(o)<100&&Boolean("on"===a.default.getGroup("largesse")))}function y(){return Boolean(a.default.checkGate({gateName:"public_space_data_store_local_cache_disabled"}))}function b(e){const t=function(e){return!e.device.isMobile&&a.default.getEligibleGroup({experimentId:"settings_in_space_switcher",defaultGroup:"control"}).includes("corner")}(e);return(0,c.QM)()?t?"invite_and_upgrade":"upgrade":!t||(0,c.Aw)()?"none":"invite"}function _(){return Boolean(a.default.checkGate({gateName:"low_guest_limit"}))}function S(){return Boolean(a.default.checkGate({gateName:"mso"}))}function k(){return Boolean(a.default.checkGate({gateName:"mtb"}))}function w(){return Boolean("on"===a.default.getGroup("mobile_web_subscriptions"))}function x(){return Boolean(a.default.checkGate({gateName:"native_invoice_payment"}))}function I(){return a.default.checkGate({gateName:"202407_price_update_is_enabled"})}function C(){return Boolean(a.default.checkGate({gateName:"test_clocks"}))}function T(){return Boolean(a.default.checkGate({gateName:"tt_bl"}))}function M(e){return!e.device.isMobile&&Boolean("on"===a.default.getGroup("tt_popup"))}function P(e,t){switch(e){case"affiliates":return function(e){return!e.device.isMobile&&Boolean(a.default.checkGate({gateName:"tt_affiliates"}))}(t);case"marketing":return function(e){return!e.device.isMobile&&Boolean(a.default.checkGate({gateName:"tt_marketing"}))}(t);case"upwork":return function(e){return!e.device.isMobile&&Boolean(a.default.checkGate({gateName:"tt_upwork"}))}(t);case"perfmark":return function(e){return!e.device.isMobile&&Boolean(a.default.checkGate({gateName:"tt_smbs"}))}(t);case"plus":case"business":return!0}}function A(){return Boolean("on"===a.default.getGroup("trial_polish"))}function R(){return Boolean(a.default.checkGate({gateName:"advanced_security_in_enterprise"}))}function D(){return Boolean(a.default.checkGate({gateName:"high_watermark_pricing_ui"}))}function B(e){return Boolean(a.default.checkGate({gateName:"pshwm_high_water_mark"}))}},88893:(e,t,n)=>{n.d(t,{A7:()=>ge,AX:()=>te,AY:()=>C,Bu:()=>O,CM:()=>ve,DB:()=>N,DH:()=>U,Et:()=>$,Fu:()=>we,GD:()=>ee,GJ:()=>A,Gh:()=>G,Io:()=>he,KU:()=>P,Ln:()=>Se,Lz:()=>Q,M9:()=>ne,MM:()=>W,Md:()=>J,ND:()=>ce,NW:()=>ie,Nf:()=>Me,Ns:()=>fe,SX:()=>q,VF:()=>I,XX:()=>T,XZ:()=>H,YK:()=>V,_9:()=>_e,aS:()=>M,cA:()=>se,ff:()=>ye,gG:()=>E,h1:()=>D,hn:()=>ue,lk:()=>de,lo:()=>re,m_:()=>ke,o9:()=>xe,pu:()=>X,qF:()=>L,qX:()=>me,qb:()=>z,ri:()=>Z,ro:()=>be,su:()=>pe,uN:()=>ae,v$:()=>Ce,vS:()=>B,wY:()=>F,wl:()=>R,xP:()=>x,xR:()=>Y,y$:()=>Ie,ye:()=>K,zl:()=>le});n(757658),n(667294);var o=n(772141),r=n(960897),i=n(590965),a=n(803791),s=n(909182),l=n(398724),c=n(102438),d=n(647425),u=n(709291),p=n(653965),m=n(401898),g=n(95477),f=n(352533),h=n(80444),v=n(635150),y=n(281236),b=(n(327242),n(288280)),_=n(170060),S=n(733941),k=n(535057),w=n(785893);const x=.75,I=1;function C(e){var t;if(A(e))return null===(t=e.customerData)||void 0===t||null===(t=t.stripe)||void 0===t?void 0:t.paymentMethodTrustLevel}function T(e){if(e&&"subscribed_admin"===e.type&&function(e){return void 0!==e.billing}(e.customerData.stripe))return e.customerData.stripe}function M(e){var t;if(A(e))return null===(t=e.customerData)||void 0===t?void 0:t.stripe}function P(e){const t=M(e);return null==t?void 0:t.customerId}function A(e){return"subscribed_admin"===(null==e?void 0:e.type)||"unsubscribed_admin"===(null==e?void 0:e.type)}function R(e){return e&&function(e){const t=T(e);if(t)return t.productId}(e)===g.default.pricing.student.productId}function D(e){const t=T(e),n=t?t.plan:void 0;return Boolean(n&&r.VJ.includes(n))}function B(e){const t=T(e),n=t?t.plan:void 0;return Boolean(n&&r.Du.includes(n))}function E(e){return e.startsWith("enterprise")}function F(e){return Boolean(e&&"subscribed_admin"===e.type&&e.customerData&&"revenueCat"===e.customerData.activeSubscriptionPlatform&&e.customerData.revenueCat&&!0===e.customerData.revenueCat.isSubscribed)}function Z(e){return"verifying"===C(e)}function U(e){const t=T(e);return t&&"number"==typeof t.canceledAt&&"number"==typeof t.willCancelAt}function V(e){return Boolean(e&&"unsubscribed_admin"!==e.type&&"unsubscribed_member"!==e.type&&"unsubscribed_guest"!==e.type)}function N(e){return!!e&&(V(e)||(0,a.E3)(e.addOns))}function O(e){return!V(e)}function L(e){return!Te(e,["personal","student","personal_free"])}function j(e){return(0,k.QM)()}function K(){return(0,k.mq)()}function z(e,t){return t===(0,k.zt)()}function q(e,t){const n=(0,_.vT)(),o=(0,_.fQ)();return!(!n||null===o)||le(e,t)>=x}function H(e,t){return le(e,t)>=x}async function G(e){const{environment:t,userRootStore:n}=e;if(!n)return;const o=n.getAdminSpaceIds().map((async e=>{const n=await y.Z.awaitData(t,{spaceId:e});return n&&n.productId})),r=await Promise.all(o);return p.oA(r)}function W(e){var t;const n="subscribed_admin"===(null==e?void 0:e.type)||"unsubscribed_admin"===(null==e?void 0:e.type)?null===(t=e.customerData)||void 0===t?void 0:t.stripe:void 0;return Boolean(null==n?void 0:n.paymentMethodType)}function $(e){const t=T(e);return"unsubscribed_admin"===e.type||"unsubscribed_member"===e.type?e.accountBalance:t?t.accountBalance:0}function Y(e){const{environment:t,userRootStore:n}=e;if(!n)return;const o=n.getAdminSpaceIds().map((e=>{const n=y.Z.getData(t,{spaceId:e});return n&&n.productId}));return p.oA(o)}function Q(e,t){const n=pe(t)>1;return O(t)&&j()&&n?t.blockUsage:0}function J(e,t){const{currentUserStore:n}=h.default.state,o=T(t),r=null!=n&&n.isDefined()?n.getEmail():void 0;return e.temporaryBillingEmail||("subscribed_admin"===t.type&&o?o.billingEmail:void 0)||r}function X(){const e=b.subscriptionDataStoreInstance.state,{currentUserStore:t}=h.default.state,n=null!=t&&t.isDefined()?null==t?void 0:t.getEmail():void 0;if(!e)return n;const o=T(e);return"subscribed_admin"===e.type&&null!=o&&o.billing?o.billingEmail:n}function ee(e){return e||"month"}function te(e){var t;return(null===(t=T(e))||void 0===t?void 0:t.interval)??"year"}function ne(e){return!!(0,k.QM)()&&((0,f.S$)({environment:e})?"personal":"plus")}function oe(e){const{memberCount:t,subscriptionTier:n,addOnFeature:o,isAddOnFeature:r,billingInterval:i,coupon:a}=e,s=function(e){const{subscriptionTier:t,addOnFeature:n,isAddOnFeature:o}=e;if(!g.default.pricing)return;if(o&&void 0!==n)return g.default.pricing[n].productId;const r=g.default.pricing[t];if("productId"in r)return r.productId}({subscriptionTier:n,addOnFeature:o,isAddOnFeature:r});let l,c,d;return s===g.default.pricing.ai.productId?(l=g.default.pricing.ai.yearlyPricePerMember,c=g.default.pricing.ai.monthlyPricePerMember,"ai_fifty_percent"===a&&(l-=4800,c-=500),d="year"===i?l*t:c*t):s===g.default.pricing.personal.productId?(l=g.default.pricing.personal.yearlyPrice,c=g.default.pricing.personal.monthlyPrice,d="year"===i?l:c):s===g.default.pricing.plus.productId?(l=g.default.pricing.plus.yearlyPricePerMember,c=g.default.pricing.plus.monthlyPricePerMember,d="year"===i?l*t:c*t):s===g.default.pricing.business.productId?(l=g.default.pricing.business.yearlyPricePerMember,c=g.default.pricing.business.monthlyPricePerMember,d="year"===i?l*t:c*t):(l=g.default.pricing.enterprise.yearlyPricePerMember,c=g.default.pricing.enterprise.monthlyPricePerMember,d="year"===i?l*t:c*t),{yearlyUnitPrice:l,monthlyUnitPrice:c,planAmount:d}}function re(e){var t;if(e&&e.isLoaded)return null===(t=e.result)||void 0===t||null===(t=t.getMonthlyUnitCost())||void 0===t?void 0:t.toMoneyValue()}function ie(e){const t=b.subscriptionDataStoreInstance.state;return e===g.default.pricing.personal.productId||F(t)?"personal":e===g.default.pricing.student.productId?"personal_education":e===g.default.pricing.plus.productId?"plus":e===g.default.pricing.business.productId?"business":e===g.default.pricing.enterprise.productId?"enterprise":e===g.default.pricing.ai.productId?"ai":e===g.default.pricing.sites_custom_hostnames.productId?"sites_custom_hostnames":"legacy"}function ae(e){const{subscriptionTier:t,currencyCode:n,promo:o,data:r,onlyShowAddOn:i,calculatingTax:a,taxAmount:s,addOnFeature:d,billingInterval:p,coupon:m}=e,g=pe(r),f=Math.min(0,$(r));let h=0,v=0,y=0;const b=void 0!==d;if(!i){const e=oe({subscriptionTier:t,memberCount:g,isAddOnFeature:!1,billingInterval:p});h+=e.yearlyUnitPrice,v+=e.monthlyUnitPrice,y+=e.planAmount}if(b){const e=oe({subscriptionTier:t,memberCount:g,isAddOnFeature:!0,addOnFeature:d,billingInterval:p,coupon:m});h+=e.yearlyUnitPrice,v+=e.monthlyUnitPrice,y+=e.planAmount}const _=(0,c.uN)(y,o),S=l.n.fromValue({amount:y-_.amount+f+(s&&!a?s:0),currencyCode:n}).zeroIfNegative(),k=[{type:"standard",name:(0,w.jsx)(u.FormattedMessage,{id:"subscriptionHelpers.lineItems.subTotal",defaultMessage:"Subtotal"}),price:l.n.fromValue({amount:y,currencyCode:n})}];return k.push({type:a?"calculating":"standard",name:(0,w.jsx)(u.FormattedMessage,{id:"subscriptionHelpers.lineItems.taxIfApplicable.title",defaultMessage:"Tax if applicable"}),price:l.n.fromValue({amount:y,currencyCode:n})}),0!==_.amount&&k.push({type:"promotion",name:(0,w.jsx)(u.FormattedMessage,{id:"subscriptionHelpers.lineItems.promo",defaultMessage:"Coupon"}),price:l.n.fromValue({amount:_.amount,currencyCode:n}),subtitle:_.monthsRemaining?(0,w.jsx)(u.FormattedMessage,{id:"subscriptionHelpers.lineItems.promo.subtitle",defaultMessage:"Valid for {durationInMonths} months",values:{durationInMonths:_.monthsRemaining}}):void 0}),f<0&&k.push({type:"promotion",name:(0,w.jsx)(u.FormattedMessage,{id:"subscriptionHelpers.lineItems.balance",defaultMessage:"Balance"}),price:l.n.fromValue({amount:-f,currencyCode:n})}),{yearlyUnitPrice:h,monthlyUnitPrice:v,planAmount:y,payAmount:S,accountBalance:f,lineItems:k,promoInfo:_}}function se(e,t){if((0,_.du)()&&Se(e,t)){const e=(0,_.fQ)(),t=0===e?(0,w.jsx)(u.FormattedMessage,{id:"subscriptionSettings.subscriptionStatus.gracePeriodBlockLimitToday",defaultMessage:"to upgrade today"}):(0,w.jsx)(u.FormattedMessage,{id:"subscriptionSettings.subscriptionStatus.gracePeriodBlockLimitNumDays",defaultMessage:"{remainingDays, plural, one {1 day to upgrade} other {{remainingDays} days to upgrade}}",values:{remainingDays:e}});return(0,w.jsx)(u.FormattedMessage,{id:"subscriptionSettings.subscriptionStatus.gracePeriodBlockLimit",defaultMessage:"You've hit Notion's trial block limit, and you have {remainingDaysMessage} before we limit new content creation.",values:{remainingDaysMessage:t}})}return(0,w.jsx)(u.FormattedMessage,{id:"subscriptionSettings.subscriptionStatus.reachedFreeBlockLimit",defaultMessage:"This workspace has used {usedBlocks} of its {freeBlockLimit} block storage limit ({utilizationPercentage}).",values:{usedBlocks:Q(0,t),freeBlockLimit:(0,d.v5)(),utilizationPercentage:(0,w.jsx)(u.FormattedNumber,{value:le(e,t),style:"percent",maximumSignificantDigits:2,maximumFractionDigits:0})}})}function le(e,t){return Q(0,t)/(0,d.v5)()}function ce(e){return ve(e).filter(i.FN)}function de(e){return ce(e).length}function ue(e){return ve(e).filter((e=>(0,o.Jy)(e.role)))}function pe(e){return ue(e).length}function me(){const e=b.subscriptionDataStoreInstance.state;return e?pe(e):1}function ge(){const e=b.subscriptionDataStoreInstance.state;return e?ce(e):[]}function fe(){const e=me();return e<=99?"SMB":e<=1999?"Mid-Market":"Enterprise"}function he(){const e=b.subscriptionDataStoreInstance.state;return e?ue(e):[]}function ve(e){return"visibleUsers"in e?e.visibleUsers:e.users}function ye(e){return Boolean(e&&"subscribed_admin"===e.type&&e.customerData&&e.customerData.stripe.isSubscribed&&r.Sf.includes(e.customerData.stripe.plan))}function be(e,t){if(!t)return!1;const n=v.Z.getData(e,{spaceId:t});return!!n&&(0,s.Rd)(n.subscription)}function _e(e){return"unsubscribed_member"===e.type||"unsubscribed_admin"===e.type||"subscribed_member"===e.type||"subscribed_admin"===e.type||"subscribed_membership_admin"===e.type}function Se(e,t){return Q(0,t)>=(0,d.v5)()}function ke(e){return d.wP(e)?"interest_in_enterprise":d.NG(e)?"interest_in_business":void 0}function we(e){return!1}function xe(e){return d.QM(e)}function Ie(){return(0,k.sX)()}function Ce(e,t){switch(e){case"personal_free":case"team_free":case"free":return t.formatMessage(S.a.free);case"personal":return t.formatMessage(S.a.personal);case"student":return t.formatMessage(S.a.educationPlus);case"plus":return t.formatMessage(S.a.plus);case"business":return t.formatMessage(S.a.business);case"enterprise":return t.formatMessage(S.a.enterprise);case"ai":return t.formatMessage(S.a.ai);case"sites_custom_hostnames":return t.formatMessage(S.a.sites);default:(0,m.t1)(e)}}function Te(e,t){const n=(0,k.zt)();return!!n&&t.includes(n)}function Me(e){const{subscriptionData:t,spaceStore:n}=e;return!F(t)&&((null==n?void 0:n.canAdmin())??!1)}},733941:(e,t,n)=>{n.d(t,{D:()=>i,a:()=>r});var o=n(709291);const r=(0,o.defineMessages)({ai:{defaultMessage:"AI",id:"ai.title"},sites:{defaultMessage:"Custom Hostnames",id:"sites.title"},personalFreePlan:{defaultMessage:"Personal Plan",id:"personalFreePlan.title"},personalFree:{defaultMessage:"Personal",id:"personalFree.title"},teamTrialPlan:{defaultMessage:"Team Plan (Trial)",id:"teamTrialPlan.title"},freePlan:{defaultMessage:"Free Plan",id:"freePlan.title"},free:{defaultMessage:"Free",id:"free.title"},personalPlan:{defaultMessage:"Personal Pro Plan",id:"personalPlan.label"},personal:{defaultMessage:"Personal Pro",id:"personal.label"},personalForIos:{defaultMessage:"iOS Personal Pro",id:"personal.ios.label"},singlePlayerPlusPlan:{defaultMessage:"Plus Plan with a 1-member limit",id:"singlePlayerPlusPlan.title"},educationPlan:{defaultMessage:"Personal Pro Plan (Education)",id:"personalEducationPlan.title"},educationPlusPlan:{defaultMessage:"Education Plus Plan",id:"educationPlusPlan.title"},educationPlus:{defaultMessage:"Education Plus",id:"educationPlus.title"},student:{defaultMessage:"Education Plus",id:"educationPlus.title"},teamPlan:{defaultMessage:"Team Plan",id:"teamPlan.title"},team:{defaultMessage:"Team",id:"team.title"},plusPlan:{defaultMessage:"Plus Plan",id:"plusPlan.title"},plus:{defaultMessage:"Plus",id:"plus.title"},businessPlan:{id:"businessPlan.title",defaultMessage:"Business Plan"},business:{id:"business.title",defaultMessage:"Business"},enterprisePlan:{defaultMessage:"Enterprise Plan",id:"enterprisePlan.label"},enterprise:{defaultMessage:"Enterprise",id:"enterprise.label"},legacyPlan:{defaultMessage:"Legacy Plan",id:"legacyPlan.label"}}),i=(0,o.defineMessages)({ai:{defaultMessage:"Notion AI",id:"spaceSubscriptionUpgradeModal.orderSummary.ai.addOn"},sites_custom_hostnames:{defaultMessage:"Custom domains",id:"spaceSubscriptionUpgradeModal.orderSummary.sites.addOn"},personal:{defaultMessage:"Plus plan with a 1-member limit",id:"spaceSubscriptionUpgradeModal.orderSummary.singlePlayerPlusPlan"},plus:{defaultMessage:"Plus plan",id:"spaceSubscriptionUpgradeModal.orderSummary.plusPlan"},business:{defaultMessage:"Business plan",id:"spaceSubscriptionUpgradeModal.orderSummary.businessPlan"},enterprise:{defaultMessage:"Enterprise plan",id:"spaceSubscriptionUpgradeModal.orderSummary.enterprisePlan"}})},535057:(e,t,n)=>{n.d(t,{Aw:()=>f,Mk:()=>m,QM:()=>p,Rs:()=>d,c4:()=>y,iJ:()=>h,lz:()=>l,mq:()=>g,p4:()=>v,sX:()=>c,wP:()=>u,zt:()=>s});var o=n(647425),r=n(288280),i=n(170060),a=n(88893);function s(){var e;return o.O9(null===(e=r.subscriptionDataStoreInstance.state)||void 0===e?void 0:e.subscriptionTier)}function l(){return(0,a.ff)(r.subscriptionDataStoreInstance.state)}function c(){return o.sX(s())}function d(){return o.Rs(s())}function u(){return o.wP(s())}function p(){return o.QM(s())}function m(){return o.Mk(s())}function g(){return o.mq(s())}function f(){return o.Aw(s())}function h(){return o.iJ(s())}function v(e){return o.eZ(s(),e)}function y(e){return e?(0,i.fc)()?o.lu:o.kE(e.subscriptionTier??"free"):0}},587598:(e,t,n)=>{n.d(t,{z:()=>o});const o=(0,n(709291).defineMessages)({cancellingTrial:{defaultMessage:"Cancelling your trial.",id:"cancelTrial.error.message"},cancellationConfirmationMessage:{defaultMessage:"Are you sure you want to cancel your trial?",id:"cancelTrial.confirmation.message"},yes:{defaultMessage:"Yes, cancel my trial",id:"cancelTrial.yes.confirmation.message"}})},428956:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){}didRequest(){const e=this.state;return!(!e||e.isEligible)&&Boolean(e.requestedAccess)}}const i=new r},163423:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},962142:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(749085),r=n(471924),i=n(327242);class a extends o.default{getInitialState(){return{open:!1,succeeded:!1}}close(){this.setState({open:!1,succeeded:!1})}closeWithSuccess(){this.setState({open:!1,succeeded:!0})}open(e){this.setState({open:!0,temporaryBillingInterval:"month",temporaryAddress:{name:"",businessName:"",addressLine1:"",addressLine2:"",zipCode:"",city:"",state:"",country:""},appliedPromo:void 0,error:void 0,vatApplicable:!1,calculatingTax:!1,payButtonState:"disabled",subscriptionTier:"enterprise",targetPlan:void 0,targetSpace:e,totalUpgradeCost:void 0,onlyShowAddOn:!1,sessionId:r.Il(),type:i.U.TargetSpace})}setAddressField(e){this.state.open&&this.setState({...this.state,temporaryAddress:{...this.state.temporaryAddress,...e},taxCalculationError:void 0})}}const s=new a},530221:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n(749085).default.createValue({open:!1},{name:"ContactSalesModalStore"})},333493:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(749085),r=n(292595),i=n(464793),a=n(80444),s=n(622616);class l extends o.default{constructor(){var e;let t,n;super(),e=this;const o=()=>{if("ready"!==this.state.status)return;const e=this.state.prices.map((e=>{const t=Math.floor(100*Math.random()),n=Math.floor(e.unitAmount.amount/100);return new i.tA({external_id:e.externalId,product:e.product,billing_interval:e.billingInterval,currency:e.currencyCode,state:e.state,regions:e.regions,unit_amount:100*n+t})}));this.setPrices(e)};(0,r.exposeDebugValue)("randomizePrices",(function(){let r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if("ready"!==e.state.status)return;r!==Boolean(n)&&(n&&(clearInterval(n),n=void 0),r?(t=e.state.prices,n=setInterval(o,1e3),o()):t&&e.setPrices(t))}))}getInitialState(){return{status:"init",prices:[],availableCurrencyCodes:["USD"],selectedCurrencyCode:void 0}}resetExceptSelectedCurrencyCode(){this.update((e=>({...this.getInitialState(),selectedCurrencyCode:e.selectedCurrencyCode})))}waitUntilReady(){return this.waitUntil((()=>"ready"===this.state.status))}setPrices(e){this.update((t=>{const n=Array.from(new Set(e.map((e=>e.currencyCode))));n.sort();const o=t.selectedCurrencyCode&&n.includes(t.selectedCurrencyCode)?t.selectedCurrencyCode:n.find((e=>"USD"!==e))??"USD";return{...t,status:"ready",prices:e,availableCurrencyCodes:n,selectedCurrencyCode:o}}))}didStartLoading(){this.update((e=>({...e,status:"loading"})))}getPrice(e,t){const{status:n,selectedCurrencyCode:o}=this.state;if("init"===n){var r;const t=null===(r=a.default.state.currentSpaceStore)||void 0===r?void 0:r.id;t&&s.Zz({environment:e,spaceId:t})}if("ready"!==n)return{isLoaded:!1,result:void 0};const i=this.state.prices.filter((e=>e.currencyCode===o));return{isLoaded:!0,result:i.find(t)}}get selectedCurrencyCode(){return this.state.selectedCurrencyCode??"USD"}get availableCurrencyCodes(){return this.state.availableCurrencyCodes}get prices(){return this.state.prices}}const c=new l},925692:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},288280:(e,t,n)=>{n.r(t),n.d(t,{SubscriptionDataStore:()=>r,subscriptionDataStoreInstance:()=>i});var o=n(749085);class r extends o.default{constructor(){super(...arguments),this.spaceId=void 0}getInitialState(){}waitUntilLoaded(){return this.waitUntil((()=>Boolean(this.state)))}}const i=new r},864307:(e,t,n)=>{n.d(t,{Fk:()=>s,U6:()=>d,aG:()=>l,nx:()=>c});var o=n(730120),r=n(313991),i=n(407057),a=n(95477);function s(e){return!(null==e||!e.trialEnd)&&e.trialEnd>=o.ou.now().toSeconds()}function l(e){if(!s(e))return;const t=1e3*(null==e?void 0:e.trialEnd);return null!=e&&e.periodEnd&&e.periodEnd>=o.ou.now().toSeconds()&&e.periodEnd<t?e.periodEnd:t}function c(e){const t="trialEndDate"in e?e.trialEndDate:l(e.stripeData);return t?(0,i.Yx)(t,e.dateFormat??"long",r.locale):void 0}function d(e){return e?a.default.trials[e.id].duration:a.default.trials.default.duration}},965928:(e,t,n)=>{n.d(t,{Hy:()=>g,yt:()=>f,O1:()=>d,pV:()=>v,Re:()=>h,XG:()=>p,zQ:()=>u});var o=n(109852),r=n(518212),i=n(218265),a=n(170060),s=n(453809),l=n(430548);const c=new s.D({key:"trialUpsell",namespace:l.$p,important:!1,trackingType:"preference"});function d(e){return Boolean(e&&["affiliates","marketing","upwork"].includes(e))}function u(e,t){(0,a.zS)(e,t)&&c.setState(e)}function p(){const e=(0,i.nx)(new URL(window.location.href).toString(),(0,o.x6)());null!=e&&e.trial_source&&(e.trial_source=void 0,(0,o.NW)(e)),c.setState(void 0)}function m(){var e;const t=null===(e=(0,o.x6)())||void 0===e?void 0:e.trial_source;return t&&d(t)?t:c.getState()??"plus"}function g(){return"business"===m()?"business":"plus"}function f(e){const t=m(),n=(0,r.Rk)();if(e&&"upwork"!==t)return n.enterprise;if(!t)return n.default;switch(t){case"affiliates":return n.affiliates;case"marketing":return n.marketing;case"upwork":return n.upwork;default:return n.default}}function h(){return"upwork"===m()}function v(){return"perfmark"===m()}},755130:(e,t,n)=>{n.d(t,{I:()=>r,u:()=>i});var o=n(277907);const r={trialActions:new o.Ss("trialActions",(()=>n.e(37554).then(n.bind(n,378306)))),TrialInfoModal:new o.Ss("TrialInfoModal",(()=>n.e(27127).then(n.bind(n,460926))))},i=(0,o.kF)(r.TrialInfoModal,(e=>e.TrialInfoModal))},328662:(e,t,n)=>{n.d(t,{m:()=>d});var o=n(667294),r=n(797511),i=n(886628),a=n(421202),s=n(585031),l=n(385555),c=n(206258);function d(e){const{parentStore:t}=e,n=(0,r.l)(),d=e.pageStore??(null==n?void 0:n.pageStore),u=t.getRecordModel,p=(0,i.VK)((()=>l.default.checkGate({gateName:"toc_nested_headings"})),[]),m=(0,i.VK)((()=>d?s.Q(d.id,u,p):[]),[d,u,p]),g=(0,o.useMemo)((()=>m.map((e=>c.G.createChildStore(t,{table:a.iU,id:e})))),[t,m]);return{navigableAncestorStore:d,headerStores:g}}},789579:(e,t,n)=>{n.d(t,{R:()=>d});var o=n(886628),r=n(815145),i=n(570096),a=n(484210),s=n(785957),l=n(305971),c=n(188923);function d(e){const{scrollToBlockId:t,pageStore:n,isFloatingToc:d}=e,u=(0,o.VK)((()=>Boolean(n&&(0,s.wq)(n))),[n]),p=(0,o.VK)((()=>c.default.getPeekMode()),[]),m=(0,l.E)("floating_table_of_contents");return{href:(0,o.VK)((()=>{if(void 0!==n&&void 0!==t)return(0,a.Hu)({store:n,scrollToBlockId:t,fullyQualified:!1,pageVisitSource:d?r.tY.PageTableOfContents:r.tY.LinkInPage,...m?{openInSidePeek:u&&p===i.R,openInCenterPeek:u&&p===i.l}:{openInSidePeek:u}})}),[u,m,d,n,p,t]),replaceHistoryState:!0}}},956203:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{isHovered:!1}}}const i=new r},109867:(e,t,n)=>{n.d(t,{wT:()=>ae,aQ:()=>ye,ED:()=>xe,mX:()=>J,w6:()=>pe,Ui:()=>Se,Xy:()=>Ie,Uj:()=>ue,Cj:()=>de,um:()=>le,s:()=>fe,Dv:()=>ge,lo:()=>ie,hI:()=>we,mN:()=>ve,WO:()=>he,X0:()=>ne,YH:()=>be,JX:()=>ke,Ju:()=>oe,$J:()=>Q,jg:()=>re,xI:()=>Y,lH:()=>W,fs:()=>H,$x:()=>G,d:()=>_e,W8:()=>ee,Ce:()=>X,RF:()=>me});n(21703),n(757658);var o=n(815145),r=n(105220),i=n(568626),a=n(186517),s=n(772141),l=n(475246),c=n(429369),d=n(519889),u=n(364684),p=n(552629),m=n(401898),g=n(619584),f=n(91536),h=n(117224),v=n(21359),y=n(547307),b=n(476464),_=n(709953),S=n(275754),k=n(29974),w=n(400150),x=n(210228),I=n(165452),C=n(721429),T=n(433929),M=n(645010),P=n(178122),A=n(621115),R=n(883165),D=n(827406),B=n(568418),E=n(455838),F=n(80444),Z=n(803418),U=n(206258),V=n(342185),N=n(897630),O=n(88893),L=n(535057),j=n(2679),K=n(530297),z=n(560396),q=n(36225);function H(e){const{store:t,update:n,transaction:o}=e;_.sW({store:t,data:(0,g.Q2)(n),transaction:o})}function G(e){let{environment:t,store:n,update:o,transaction:r}=e;const i=function(e){let{store:t,update:n}=e;const o=t.getSettingsStore().getValue();if(!o)return{};const r={};for(const i in n)r[i]=o[i];return r}({store:n,update:o});_.sW({store:n.getSettingsStore(),data:(0,g.Q2)(o),transaction:r}),h.OR(t,{store:n,old_settings:i,updated_settings:o})}async function W(e){let{environment:t,spaceStore:n,addedStores:o,removedStores:r,createNewTeamFlowId:i,from:a}=e;const s=t.currentUser.id;if(!s||o.some((e=>!e.isDefined())))return!1;const l=(0,R.VK)(n,s);if(await l.load(),!l.isWorkspaceOwner())throw new Error("Only admins can update default teams");const{performResult:{results:c},serverCommitResult:d}=x.createAndCommit({environment:t,userAction:"teamActions.updateDefaultTeams",perform:e=>{const n=[];for(const r of o){const o=$({environment:t,transaction:e,teamStore:r,isDefault:!0,from:a,createNewTeamFlowId:i});n.push(o)}for(const o of r){const r=$({environment:t,transaction:e,teamStore:o,isDefault:!1,from:a,createNewTeamFlowId:i});n.push(r)}return{results:n}}});return await d,await N.bi(t),c.every((e=>e))}function $(e){let{environment:t,transaction:n,teamStore:o,isDefault:r,from:i,createNewTeamFlowId:a}=e;return o.isDefault()===r||(_.sW({store:o,data:{is_default:r},transaction:n}),n.postSubmitCallbacks.push((e=>{e||h.cX(t,{store:o,is_default_team:r,create_new_team_flow_id:a,from:i})}))),!0}function Y(e){var t;const{environment:n,teamStore:o,newRole:r,transaction:i,permissionsToClear:a}=e,l=a.map((e=>({...e,role:"none"}))),c=(null===(t=o.getTeamPermission())||void 0===t?void 0:t.role)??"none",d={type:"explicit_team_permission",team_id:o.id,role:r};l.push(d),b.$G({environment:n,store:o,permissionItems:l,transaction:i}),o.isDefault()&&b.$G({environment:n,store:o,permissionItems:[{type:"space_permission",role:r}],transaction:i}),(0,s.J5)(c)||!(0,s.J5)(r)||o.getDisableTeamPageEdits()||G({environment:n,store:o,update:{disable_team_page_edits:!0},transaction:i})}function Q(e){const{environment:t,teamStore:n,newRole:o,transaction:r,permissionsToClear:i}=e,a=i.map((e=>({...e,role:"none"}))),s={type:"explicit_team_guest_permission",team_id:n.id,role:o};a.push(s),b.$G({environment:t,store:n,permissionItems:a,transaction:r})}function J(e){let{userId:t,teamStore:n,transaction:o,environment:r,permissionRole:i}=e;const s=n.getMembershipDefinedOnTeam(),l=s.find((e=>"user"===e.entity_type&&e.user_id===t));if(!l)throw new Error("Specified user is not on the team");if("member"===l.type)return!1;if(!n.isDefined())return!1;const c=n.getPermissionItems(),d=n.id;if(i&&(0,a.bk)({teamValue:{id:d,permissions:c},permissionRole:i}))throw new Error("Cannot set member's permission to be lower than default team permission.");if(!(0,u.XO)({membership:s}).includes(t))throw new Error("Specified user is not an owner of the team");let p=!1;if(s.length>0){const e=s.filter((e=>!("user"===e.entity_type&&e.user_id===t)));p=s.length!==e.length;const i=[{entity_type:"user",type:"member",user_id:t},...e];x.applyOperation({store:n,operation:{pointer:n.pointer,path:["membership"],command:"set",args:i},transaction:o}),f.Pd(r,{store:n,permission_user_id:t,team_role:"member"})}let m=i||"none";const g=(0,u.xC)({id:d,permissions:c});g&&i===g&&(m="none");const h={type:"user_permission",role:m,user_id:t};return b.$G({environment:r,store:n,permissionItems:[h],transaction:o,skipAnalytics:p})}function X(e){var t;let{environment:n,userId:o,teamStore:r,spaceStore:i,transaction:a,newTeamRole:s}=e;if(!r.isDefined())return!1;const l=null===(t=r.getMemberInfoForUser(o))||void 0===t?void 0:t[0];return!!l&&(l.type!==s&&(x.applyOperation({store:r,operation:{pointer:r.pointer,path:["membership"],command:"setTeamMembershipItem",args:{entity_type:"user",type:s,user_id:o}},transaction:a}),b.tQ({environment:n,spaceStore:i,permissionItems:[{type:"user_permission",role:"read_and_write",user_id:o}],transaction:a}),ne({environment:n,memberInfo:l,teamStore:r,transaction:a}),!0))}function ee(e){var t;let{environment:n,userId:o,teamStore:r,transaction:i}=e;const a=null===(t=r.getMemberInfoForUser(o))||void 0===t?void 0:t[0];if(!a)throw new Error("Specified user is not on the team");if("owner"===a.type)return!1;if(!r.isDefined())return!1;const s=r.getMembershipDefinedOnTeam().filter((e=>!("user"===e.entity_type&&e.user_id===o))),l=[{entity_type:"user",type:"owner",user_id:o},...s];return x.applyOperation({store:r,operation:{pointer:r.pointer,path:["membership"],command:"set",args:l},transaction:i}),f.Pd(n,{store:r,permission_user_id:o,team_role:"owner"}),ne({environment:n,memberInfo:a,teamStore:r,transaction:i}),!0}function te(e){let{memberInfo:t,newRole:n}=e;return"user"===t.entity_type?{type:"user_permission",user_id:t.user_id,role:n}:{type:"group_permission",group_id:t.group_id,role:n}}function ne(e){let{environment:t,memberInfo:n,teamStore:o,transaction:r}=e;return!!o.getPermissionItems()&&(b.$G({environment:t,store:o,permissionItems:[te({memberInfo:n,newRole:"none"})],transaction:r}),!0)}async function oe(e){let{store:t,environment:n,accessLevel:o,teamName:r,from:i,isDefault:a}=e;const{currentSpaceStore:s}=F.default.getState();if(!s)throw new Error("currentSpaceStore does not exist");const l=t.isDefault()??!1,c=t.getTeamAccessLevel(),d=(0,u.Hf)({membership:t.getRawMembership()}).length;if(o===c&&a===l)return!1;if(!(await P.hL({teamName:r,accessLevel:o,currentIsDefault:l,isDefault:a,numberOfTeamGuests:d})))return!1;const p=t.getPermissionItems(),m=t.getSettingsStore().getValue();if(!m||!p)return!1;const g=(0,u.AW)({teamValue:{id:t.id,permissions:p,settings:m},accessLevel:o,isDefault:a}),{performResult:{result:f}}=x.createAndCommit({userAction:"teamActions.setTeamAccessLevel",environment:n,perform:e=>{$({environment:n,transaction:e,teamStore:t,isDefault:"invite_only"!==g.settings.space_member_join_access&&a,from:i,createNewTeamFlowId:void 0});const o=b.$G({environment:n,store:t,permissionItems:g.permissions,transaction:e});return _.sW({store:t.getSettingsStore(),data:g.settings,transaction:e}),{result:o}}});return f&&h.BW(n,{store:t,old_access_level:c,new_access_level:o,from:i}),f}function re(e){let{memberInfo:t,teamStore:n,transaction:o,environment:r,permissionRole:i}=e;if("owner"===t.type&&"user"===t.entity_type)return J({userId:t.user_id,teamStore:n,transaction:o,environment:r,permissionRole:i});if(!n.isDefined())return!1;const s=n.id,l=n.getPermissionItems();if(i&&(0,a.bk)({teamValue:{id:s,permissions:l},permissionRole:i}))throw new Error("Cannot set member's permission to be lower than default team permission.");const c="user"===t.entity_type&&n.isMemberOrGuest(t.user_id),d="group"===t.entity_type&&n.getRawMembership().some((e=>"group"===e.entity_type&&e.group_id===t.group_id));if(!c&&!d)throw new Error("Specified memberInfo not found on team");let p=i||"none";const m=(0,u.xC)({id:s,permissions:l});return m&&i===m&&(p="none"),b.$G({environment:r,store:n,permissionItems:[te({memberInfo:t,newRole:p})],transaction:o})}function ie(e,t){B.Z.setState({...B.Z.state,open:!0,from:e}),B.Z.state.onClose=null==t?void 0:t.onClose}async function ae(e){let{environment:t,currentSpaceStore:n,teamStore:o,from:r,action:i}=e;const a=t.currentUser.id;if(!a||!n||!(0,K.o)({userId:a,spaceStore:n,entrypoint:r}))return!1;if(!(await async function(e){return!q.Z.state.open&&await new Promise((t=>{q.Z.setState({open:!0,type:e,onAccept:()=>t(!0),onCancel:()=>t(!1)})}))}(i)))return!1;const s=await v.setAdminPrivilegedTeamMembership(t,{spaceId:n.id,teamId:o.id,teamRole:se(i)});if("failed"===s.type)return Ie(s),!1;switch(i){case"joinTeamAsOwner":case"joinClosedOrPrivateTeamAsMember":ce({environment:t,teamStore:o,from:r,newRole:"joinTeamAsOwner"===i?"owner":"member",usingAdminPrivileges:!0,andNavigateToTeamHome:!1});break;case"upgradeToOwner":f.Pd(t,{permission_user_id:a,team_role:"owner",store:o});const e=o.getName();e&&(0,A._t)(e);break;default:(0,m.t1)(i)}return!0}function se(e){switch(e){case"joinTeamAsOwner":case"upgradeToOwner":return"owner";case"joinClosedOrPrivateTeamAsMember":return"member";default:(0,m.t1)(e)}}async function le(e){let{environment:t,currentSpaceStore:n,teamStore:o,from:r,andNavigateToTeamHome:i}=e;const a=t.currentUser.id;if(!a)return!1;const s=await v.updateTeamMembers(t,{spaceId:n.id,teamId:o.id,newMembersOrGuestsToAdd:[{type:"member",entity_type:"user",user_id:a}]});return"failed"===s.type?(Ie(s),!1):(ce({environment:t,teamStore:o,from:r,newRole:"member",usingAdminPrivileges:!1,andNavigateToTeamHome:i}),!0)}function ce(e){let{environment:t,teamStore:n,from:o,newRole:r,usingAdminPrivileges:i,andNavigateToTeamHome:a}=e;const s=t.currentUser.id,l=F.default.state.currentSpaceStore,c=F.default.state.currentSpaceViewStore;if(!s||!l||!c)return!1;!function(e){var t;let{environment:n,currentSpaceViewStore:o,teamId:r}=e;const i=null===(t=(0,C.k_)(n).state)||void 0===t?void 0:t.userJoinedTeamsStores;if(!i||!o)return!1;const a=[...i.map((e=>{let{id:t}=e;return t})).filter((e=>e!==r)),r];w.Ct({environment:n,currentSpaceViewStore:o,orderedTeamIds:a,userAction:"TeamBrowserOutliner",isExplicitUserAction:!1})}({environment:t,currentSpaceViewStore:c,teamId:n.id}),h.UD(t,{store:n,joined_role:r,from:o}),I.l({environment:t,userId:s,spaceId:l.id});const d=n.getName();a?(we({environment:t,teamStore:n,shouldScroll:!1}),d&&new Promise((e=>setTimeout(e,500))).then((()=>{(0,A.$$)({teamName:d,usingAdminPrivileges:i})}))):d&&(0,A.$$)({teamName:d,usingAdminPrivileges:i})}async function de(e){let{environment:t,teamId:n,spaceId:o,teamMemberInfos:r,isSettingDefaultTeam:i,inviterId:a}=e;const s=t.currentUser.id;if(!o||!s)return!1;return"failed"!==(await v.updateTeamMembers(t,{spaceId:o,teamId:n,newMembersOrGuestsToAdd:r,isSettingDefaultTeam:i,addNewMembersToSpace:!1},a)).type}async function ue(e){let{environment:t,teamStore:n,teamMemberInfos:o,isSettingDefaultTeam:r,createNewTeamFlowId:i}=e;const a=n.getSpaceId();if(!a)return!1;const s=t.currentUser.id;if(!a||!s)return!1;if("failed"===(await v.updateTeamMembers(t,{spaceId:a,teamId:n.id,newMembersOrGuestsToAdd:o,isSettingDefaultTeam:r,addNewMembersToSpace:(0,L.Mk)()},s)).type)return!1;if(!r){const e=o.flatMap((e=>"user"!==e.entity_type?[]:e.user_id)),r=e.length,a=o.filter((e=>"group"===e.entity_type)).length;r>0&&h.ix(t,{store:n,num_members_invited:r,create_new_team_flow_id:i,members_invited:e}),a>0&&h.$1(t,{store:n,num_groups_invited:a,create_new_team_flow_id:i})}return!0}function pe(e){switch(e){case"team_browser":case"duplicate_team":case"create_team_from_page":case"permission_item":case"teams_dropdown_for_team_guest":case"teams_dropdown_for_team_member":case"teams_dropdown_for_group":case"teamSidebar":case"teamBrowserSearch":case"teamBrowserUnjoinedTeams":case"teamBrowserJoinedTeams":case"team_breadcrumb_popup":case"team_menu_header":case"sidebar_team_modal":case"team_invite_link":case"teams_dropdown_space_settings_people":case"share_menu":return!1;case"manage_teams_table":return!0;default:(0,m.t1)(e)}}function me(e){let{environment:t,teamId:n,tab:o,from:r,buttonPopupStore:i}=e;const a=F.default.state.currentSpaceStore;if(!a)return;const s=U.zX.createChildStore(a,{table:c.e0,id:n});if(s.canRead())E.Z.update((e=>({...e,open:!0,tab:o,teamStore:s,viewingUnjoinedPrivateTeamAsEnterpriseAdmin:!1})));else{const e=ge({environment:t,spaceStore:a,teamId:n,from:r});if(!e)return;E.Z.update((t=>({...t,open:!0,tab:o,unjoinedPrivateTeamStore:e,viewingUnjoinedPrivateTeamAsEnterpriseAdmin:!0})))}i&&(Z.Z.removeNamedPopup("team_more_actions"),i.setState({...i.state,open:!1}))}function ge(e){var t;let{environment:n,spaceStore:o,teamId:i,from:a}=e;if(!pe(a))return;const s=o.getModel(),l=null===(t=F.default.state.currentUserStore)||void 0===t?void 0:t.id;if(!l)return;const c=(0,R.VK)(o,l).getModel();if(!(0,r.RI)({space:s,spaceUser:c}))return;const d=z.Z.createTeamStoreFromCache({environment:n,teamId:i,spaceId:o.id,userId:l}),p=null==d?void 0:d.getModel();return null!=d&&d.canRead()&&p&&(0,u.Ei)({spaceUserModel:c,teamModel:p,spaceModel:s})?d:void 0}async function fe(e){let{environment:t,teamStore:n,currentSpaceStore:o,from:r}=e;const i=t.currentUser.id;return!!i&&await he({environment:t,teamStore:n,currentSpaceStore:o,userId:i,from:r})}async function he(e){var t;let{environment:n,teamStore:o,currentSpaceStore:r,userId:i,from:a}=e;const s=o.getSpaceId();if(!(o.isDefined()&&null!=r&&r.isDefined()&&n.currentUser.id&&s))return!1;const l=o.getOwnerUserIds(),c=o.isOwner(i);if(c&&1===l.length)return P.ZH(),!1;const p=(0,u.x4)({rawMembers:o.getRawMembership(),groups:r.getPermissionGroups()}).filter((e=>{var t;return null===(t=e.user_ids)||void 0===t?void 0:t.includes(i)}));if(!(null===(t=o.getMemberInfoForUser(i))||void 0===t?void 0:t[0]))return P.T0(p),!1;const m=U.t1.createChildStore(o,{table:d.KJ,id:i}),g=i===n.currentUser.id,f=o.getName()??"",y=m.getDisplayName(T.default.getIntl());if(!(await P.A8({isCurrentUser:g,teamName:f,memberName:y})))return!1;const b=[{entity_type:"user",type:c?"owner":"member",user_id:i}],_=await v.updateTeamMembers(n,{spaceId:s,teamId:o.id,existingMembersOrGuestsToRemove:b});return"failed"===_.type?(Ie(_),!1):(h.$(n,{store:o,is_leaving_team:g,num_members_removed:b.length,from:a}),p.length>0?g?(0,A.K9)(f,p):(0,A.zs)(y,f,p):g&&(0,A.e6)(f),I.l({environment:n,userId:i,spaceId:s}),!0)}function ve(e){let{environment:t,teamStore:n,group:o}=e;const r=n.getSpaceId();if(!r)return;const i=n.getRawMembership().find((e=>"group"===e.entity_type&&e.group_id===o.id));i&&P.iT({group:o,onAccept:async()=>{const e=[i],o=await v.updateTeamMembers(t,{spaceId:r,teamId:n.id,existingMembersOrGuestsToRemove:e});"failed"!==o.type?h.mi(t,{store:n,num_groups_removed:e.length}):Ie(o)}})}async function ye(e){const{currentSpaceStore:t,currentSpaceViewStore:n}=F.default.getState();if(!t)throw new Error("currentSpaceStore does not exist");if(!n)throw new Error("currentSpaceViewStore does not exist");const{environment:o,teamStore:r,from:i}=e,c=o.currentUser.id,d=r.getName()||"",u=t.getSettingsStore();if(!c)return;const p=(0,a.wN)({userId:c,teamsThatUserIsANonGuestMemberOf:n.getNonGuestTeamsStores().map((e=>e.getModel())).filter(m.$K),spaceMembers:(0,O.Io)()});if(await P.Fy(d,p)){if(p){const e=await P.wG(d);x.createAndCommit({userAction:"teamsHelpers.archiveLastTeam",environment:o,perform:n=>{if(H({store:r,update:{archived_by:c,archived_at:Date.now()},transaction:n}),_.sW({store:u,data:{is_teams_enabled:!1},transaction:n}),k.oy({planType:"personal",spaceStore:t,transaction:n}),e){const e=r.getTeamPagesStores()??[];for(const o of e){const e=o.getRole();if(!e)continue;const r={type:"user_permission",user_id:c,role:e},i=[...o.getPermissionItems().filter((e=>!s.fG(e)&&!s.Le(e)&&!s.Ir(e))),r];_.sW({store:o,data:{parent_id:t.id,parent_table:l.bx,permissions:i},transaction:n})}_.sW({store:r,data:{team_pages:[]},transaction:n})}}}),h.mF(o,{store:r,from:i})}else x.createAndCommit({userAction:"teamsHelpers.archiveTeam",environment:o,perform:e=>{H({store:r,update:{archived_by:c,archived_at:Date.now()},transaction:e})}});h.Gp(o,{store:r,from:i}),(0,j.tourIsActiveInSidebarStep)(j.default.state)&&j.default.setState({type:"inactive"}),E.Z.setState({open:!1,limitMembers:!0,memberFilterQuery:"",tab:void 0}),(0,A.CC)(d)}}function be(e){let{environment:t,teamStore:n,teamName:o,from:r}=e;x.createAndCommit({userAction:"teamsHelpers.restoreArchivedTeam",environment:t,perform:e=>{H({store:n,update:{archived_by:void 0,archived_at:void 0},transaction:e})}}),h.IW(t,{store:n,from:r}),(0,A.JB)(o)}async function _e(e){let{settingName:t,newTeamSettingValue:n,spaceSettingValue:o,environment:r,store:i}=e;let a=!0;return"disable"===o&&"allow"===n?a=await P.hC(t):"disable"===n&&(a=await P.Bj(t)),!!a&&(x.createAndCommit({userAction:"teamsHelpers.changeTeamSetting",environment:r,perform:e=>{G({environment:r,store:i,update:{[t]:"disable"===n},transaction:e})}}),!0)}function Se(e){return`TeamToggle_${e.id}`}function ke(e){let{teamStore:t,environment:n}=e;if(n.device.isMobile)return;const o=Se(t),r=D.Z.findDropTargetFromKey(o);if(r){const e=r.getNode();if(!(e instanceof HTMLElement))return;if(M.Z.SidebarScroller){var i;const n=(null===(i=M.Z.SidebarScroller.scrollerEl())||void 0===i?void 0:i.offsetTop)||0;M.Z.SidebarScroller.scrollTo(e.offsetTop-n,0,{animate:!0}),V.Z.setState(t.id),setTimeout((()=>{V.Z.state===t.id&&V.Z.setState(void 0)}),1500)}}}function we(e){const{environment:t,teamStore:n,shouldScroll:r}=e;r&&ke({teamStore:n,environment:t});const i=n.getTeamPagesStores();!i||i.length<1||(S._c({environment:t,store:i[0],pageVisitSource:o.tY.JoinTeam}),h.SJ(t,{store:n}))}function xe(e){let{environment:t,from:n,teamStore:o}=e;const{state:r}=B.Z;var i,a;(h.Pr(t,{screen:r.screen,team_id:r.teamId,team_has_icon:Boolean(r.icon),team_has_name:Boolean(r.name),team_has_description:Boolean(r.description),team_access_level:r.accessLevel,flow_id:r.flowId,from:n,store:o}),r.teamId)&&(null===(i=(a=B.Z.state).onClose)||void 0===i||i.call(a,r.teamId));B.Z.reset()}function Ie(e){y.showError(e),i.log({level:"error",from:"teamActions",type:"TeamApiError",error:(0,p.Ui)(e.error),data:{miscDataToConvertToString:{body:e.body,status:e.status}}})}},273292:(e,t,n)=>{n.d(t,{RW:()=>l,k7:()=>s,oO:()=>c});var o=n(915157),r=n(966324),i=n(470704),a=n(2679);function s(e){const{environment:t,spaceViewStore:n,teamStore:i,outlinerToggleButtonStore:s,newIsHidden:c,shouldPersistToggleState:d,isExplicitUserAction:u}=e;s.setState({...s.state,isHidden:c}),u&&r.MR(t,{store:i,is_toggled:!c,outliner_type:e.teamOutlinerType}),d&&o.Z.set({userId:n.environment.currentUser.id,key:l(n,i.id),value:c}),c&&a.default.setState({type:"inactive"})}function l(e,t){return`Team_Outliner_Item_${e.id}:${t}`}function c(e){let{oldState:t,teamIds:n,spaceId:r,userId:a}=e;return n.reduce(((e,n)=>{if(n in e)return e;if(n in t)return e[n]=t[n],e;const s=l({id:r},n),c=o.Z.get({userId:a,key:s});return e[n]=new i.Z,e[n].setState({isHidden:c??!1}),e}),{})}},228517:(e,t,n)=>{n.d(t,{I:()=>s,m:()=>l});n(21703);var o=n(653965),r=n(21359),i=n(195697),a=n(869911);async function s(e){let{environment:t,spaceId:n,userId:o}=e;if(!t.currentUser.loggedInUserIds.includes(o))throw new Error("Must be logged in user.");(0,i.bq)()&&(a.Z.getUserJoinedTeamsState({userId:o,spaceId:n})||await l({environment:t,spaceId:n,userId:o}))}async function l(e){var t;let{environment:n,spaceId:i,userId:s,emitValue:l}=e;if(!n.currentUser.loggedInUserIds.includes(s))throw new Error("Must be logged in user.");a.Z.setHasFetched({userId:s,spaceId:i});const c=await r.getTeams(n,{spaceId:i,onlyJoined:!0},s);if("failed"===c.type)return;const d=c.data.teamIds,u=(null===(t=a.Z.getUserJoinedTeamsState({userId:s,spaceId:i}))||void 0===t?void 0:t.joinedTeamsIds)||[];d.length===u.length&&0===o.e5(d,u).length&&0===o.e5(u,d).length||a.Z.setUserJoinedTeamsState({userId:s,spaceId:i,state:{joinedTeamsIds:d,lastEmitValue:l}})}},274016:(e,t,n)=>{n.d(t,{p:()=>m});n(667294);var o=n(800480),r=n(886628),i=n(724405),a=n(379362),s=n(522808),l=n(731278),c=n(548779),d=n(80444),u=n(206258),p=n(785893);function m(e){const{store:t,size:n=16,innerInitialSize:m,innerEmojiOrFlatIconSize:g,style:f,iconContainerStyles:h,iconBoxStyles:v,disabled:y=!1,onChange:b=(()=>{})}=e,_=(0,o.O7)(),{name:S,icon:k}=(0,r.VK)((()=>{const n=d.default.state.currentSpaceStore;return t?t instanceof u.zX?{name:t.getName(),icon:e.icon??t.getIcon()}:{name:(0,c.rn)(_,t),icon:e.icon??(0,c.Wd)(_,t)}:{name:n&&`team-icon-${n.id}`,icon:e.icon}}),[t,_,e.icon]),w=!(null!=k&&k.icon)||(0,a.V2)(k.icon)||(0,s.Z)(k.icon),x=!(null!=k&&k.icon),I=(0,i.yK)((e=>({backgroundContainer:{...w?{background:k&&(0,a.V2)(k.icon)?(0,a.Pk)({icon:k.icon,mode:e.mode,useLightGrayColor:!1}):e.regularDividerColor,width:n,height:n,...h}:{},...f},iconBox:{background:"unset",...v}})),[k,v,h,w,n,f]),C=e.iconLoggingData||t&&{recordTable:t.table,source:"team_settings"},T=w&&(!x||m);return(0,p.jsx)(l.Z,{title:S,icon:k,size:T?m??.9*n:n,emojiSize:w?g??.78*n:n,isEmptyPage:!1,style:I.backgroundContainer,iconBoxStyles:I.iconBox,isLarge:!0,largeIcon:!0,iconLoggingData:C,...y?{disabled:!0}:{disabled:!1,onChange:b,bucket:"public"}})}},530297:(e,t,n)=>{n.d(t,{o:()=>c,r:()=>d});var o=n(800480),r=n(886628),i=n(105220),a=n(883165),s=n(80444),l=n(109867);function c(e){var t;let{entrypoint:n,userId:o,spaceStore:r}=e;const s=null==r?void 0:r.getModel();if(!o||!s)return!1;const c=null===(t=(0,a._P)(r,o))||void 0===t?void 0:t.getModel();if(!c)return!1;return(0,i.RI)({space:s,spaceUser:c})&&l.w6(n)}function d(e){const t=(0,o.O7)().currentUser.id;return(0,r.VK)((()=>{const{currentSpaceStore:n}=s.default.state;return c({entrypoint:e,spaceStore:n,userId:t})}),[t,e])}},560396:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(126263),r=n(749085),i=n(429369),a=n(401898),s=n(120431);class l extends r.default{getInitialState(){return{initialized:!1}}createTeamStoreFromCache(e){let{environment:t,teamId:n,spaceId:o,userId:r}=e;if(this.state.initialized&&o&&r&&this.state.spaceId===o&&this.state.userId===r)return new s.z(t,{table:i.e0,id:n},{inMemoryRecordCache:this.state.inMemoryCache})}initialize(e){let{environment:t,userId:n,spaceId:r,teamIds:s,getRecordWithRole:l}=e;const c=new o.Z({name:"GlobalEnterpriseAdminTeamsStore"});for(const o of s){const e={table:i.e0,id:o};c.setRecord({pointer:e,userId:n},l(e))}return this.setState({initialized:!0,spaceId:r,userId:n,inMemoryCache:c}),s.map((e=>this.createTeamStoreFromCache({environment:t,teamId:e,spaceId:r,userId:n}))).filter(a.$K)}}const c=new l},36225:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{open:!1}}}const i=new r},869911:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{joinedTeamsStates:{},hasFetched:new Set}}getKey(e){let{userId:t,spaceId:n}=e;return`${t}:${n}`}getUserJoinedTeamsState(e){let{userId:t,spaceId:n}=e;const o=this.getKey({userId:t,spaceId:n});return this.state.joinedTeamsStates[o]}setUserJoinedTeamsState(e){let{userId:t,spaceId:n,state:o}=e;const r=this.getKey({userId:t,spaceId:n});this.state.joinedTeamsStates[r]=o,this.emit()}getHasFetched(e){let{userId:t,spaceId:n}=e;const o=this.getKey({userId:t,spaceId:n});return this.state.hasFetched.has(o)}setHasFetched(e){let{userId:t,spaceId:n}=e;const o=this.getKey({userId:t,spaceId:n});this.state.hasFetched.add(o)}}const i=new r},934593:(e,t,n)=>{n.d(t,{Cf:()=>c,Wo:()=>d,qE:()=>l});var o=n(89101),r=n(608055),i=n(361673),a=n(385555),s=n(429949);function l(){return a.default.checkGate({gateName:"inapp_mui"})}function c(e){const{analyticsFrom:t,cloneTo:n,selectedTemplate:a,selectedTeamStore:c,environment:d}=e;i.cP({environment:d,checklistItem:"explore_community_templates"}),l()?r.c4({environment:d,url:o._j.gallery,redirect:!1}):s.Z.setState({...s.Z.state,status:"opening",analyticsFrom:t,cloneTo:n,selectedTemplate:a,selectedTeam:c})}function d(){s.Z.setState({...s.Z.state,status:"closed"})}},951247:(e,t,n)=>{n.d(t,{E2:()=>r,YQ:()=>o,dm:()=>i,wN:()=>a});const o=90,r=90,i=275,a=32},429949:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(749085);class r extends o.default{getInitialState(){return{status:"closed"}}}const i=new r},424161:(e,t,n)=>{n.d(t,{N:()=>a,v:()=>i});var o=n(401898);const r={invertedInsertText:!0,invertedDeleteText:!0,invertedMoveTextSlice:!0,invertedAddAnnotation:!0,invertedRemoveAnnotation:!0};function i(e){return Boolean(r[e.command])}function a(e){const{pointer:t,invertedCrdtOperation:n,previousTextValue:r}=e,i=n.type;switch(i){case"invertedInsertText":return{command:"invertedInsertText",pointer:t,path:[],args:{...n,previousTextValue:r}};case"invertedDeleteText":return{command:"invertedDeleteText",pointer:t,path:[],args:{...n,previousTextValue:r}};case"invertedAddAnnotation":return{command:"invertedAddAnnotation",pointer:t,path:[],args:{...n,previousTextValue:r}};case"invertedRemoveAnnotation":return{command:"invertedRemoveAnnotation",pointer:t,path:[],args:{...n,previousTextValue:r}};default:(0,o.t1)(i)}}},365663:(e,t,n)=>{n.d(t,{F:()=>a});var o=n(167175),r=n(210228),i=n(424161);function a(e){const{transaction:t,store:n,crdtOperations:a,invertedOperations:s,fullTextValue:l}=e;r.applyCrdtTextOperations({transaction:t,store:n,operations:a.map((e=>(0,o.W5)({pointer:n.pointer,crdtOperation:e,fullTextValue:l}))),invertedOperations:s.map((e=>(0,i.N)({pointer:n.pointer,invertedCrdtOperation:e,previousTextValue:n.getBlockTitleStore().getValue()??[]})))})}},117431:(e,t,n)=>{n.d(t,{P:()=>c,V:()=>l});var o=n(74948),r=n(938676),i=n(80444),a=n(306908),s=n(2679);function l(){var e;if(!(0,s.tourIsActive)(s.default.state))return;const t=s.default.state.type,n=s.default.state.step,o=(0,a.zr)(t),r={teamStoreIds:((null===(e=i.default.state.currentSpaceViewStore)||void 0===e?void 0:e.getTeamsStores())||[]).map((e=>e.id)),initialTeamStoreId:s.default.state.initialTeamStoreId},l=(0,a.Q)(o,n,r);var c,d;null===l?(null===(c=(d=s.default.state).onCompleteOrClose)||void 0===c||c.call(d),s.default.setState({type:"inactive"})):s.default.setState({...s.default.state,type:t,step:l})}function c(e){let{environment:t,type:n,onCompleteOrClose:i}=e;const l=(0,a.zr)(n)[0];if(!l)return;const c=r.sidebarOpenStore.state,d=()=>{s.default.setState({type:n,step:l,onCompleteOrClose:i})};c?d():(o.setExpand({environment:t,isExpanded:!0,from:"home_checklist",saveDetailsSidebarPreference:!1}),setTimeout((()=>{d()}),200))}},587244:(e,t,n)=>{n.d(t,{N:()=>m});var o=n(667294),r=n(886628),i=n(724405),a=n(151454),s=n(531701),l=n(296994);const c=(0,n(277907).kF)(l.FF.tourTutorial,(e=>e.TourTutorialContent));var d=n(828451),u=n(2679),p=n(785893);function m(e){let{children:t,step:n,wrapperStyle:l={},highlightStyle:m={},isFullWidth:f=!0,showSidebarOverlays:h=!0,showContentOverlays:v=!0,onBackButtonClick:y,onNextButtonClick:b,tutorialMetadata:_}=e;const S=(0,r.VK)((()=>u.default.state),[]),k=o.useRef(null),w=(0,i.yK)((e=>({highlight:{background:"dark"===e.mode?s.ZP.whiteWithAlpha(.05):s.ZP.blackWithAlpha(.05),boxShadow:e.outlineBlueInputBoxShadow,borderRadius:4,position:"relative",zIndex:a.u8,...m},opacityLayer:{position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:a.mJ,background:e.surface.wash,opacity:.6}})),[m]);return"inactive"===S.type||S.step!==n?t:(0,p.jsxs)(p.Fragment,{children:[f?(0,p.jsx)(g,{ref:k,style:l,children:t}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:w.highlight,children:(0,p.jsx)(g,{ref:k,style:l,children:t})}),v&&(0,p.jsx)("div",{style:w.opacityLayer})]}),(0,p.jsx)(d.g,{calloutId:"sidebar_tour",shouldShow:!0,children:(0,p.jsx)(c,{step:S.step,contentRef:k,showSidebarOverlays:!!f&&h,onNextButtonClick:b,onBackButtonClick:y,tutorialMetadata:_})})]})}const g=o.forwardRef((function(e,t){let{children:n,style:o}=e;return(0,p.jsx)("div",{ref:t,style:o,children:n})}))},306908:(e,t,n)=>{n.d(t,{Q:()=>u,fc:()=>g,zr:()=>m});var o=n(667294),r=n(886628),i=n(401898),a=n(80444),s=n(2679);const l={prebuilt_templates:e=>!!e.initialTeamStoreId&&e.teamStoreIds.some((t=>t===e.initialTeamStoreId))};function c(e,t){const n=l[e];return!n||n(t)}function d(e,t){return e.filter((e=>c(e,t)))}function u(e,t,n){const o=e.indexOf(t);if(o<=-1||o>=e.length-1)return null;const r=e[o+1];return c(r,n)?r:u(e,r,n)}function p(e,t,n){const o=e.indexOf(t);if(o<=0)return null;const r=e[o-1];return c(r,n)?r:p(e,r,n)}function m(e){let t;switch(e){case"team_creator":t=s.orderedTeamSidebarTourSteps;break;case"home_checklist_workspace_tour":t=s.orderedHomeChecklistWorkspaceTourSteps;break;case"home_available":t=["home"];break;case"create_page":t=s.orderedCreatePageHomeChecklistTourSteps;break;case"chat_with_ai":t=s.orderedChatWithAiHomeChecklistTourSteps;break;case"collaborate":t=s.orderedCollaborateTourSteps;break;case"explore_community_templates":t=s.orderedExploreCommunityTemplatesTourSteps;break;case"explore_template_marketplace":t=s.orderedExploreCommunityTemplatesInAppTourSteps;break;case"explore_team_template":t=s.orderedExploreDocsTemplateTourSteps;break;case"explore_private_template":t=s.orderedExplorePrivateTemplateTourSteps;break;case"explore_personal_template":t=s.orderedExplorePersonalTemplateTourSteps;break;case"explore_getting_started_template":t=s.orderedExploreGettingStartedTemplateTourSteps;break;case"home_topbar_action_button":t=s.orderedHomeTopbarActionButtonTourSteps;break;case"try_notion_sites_new_page":t=s.orderedTryNotionSitesNewPageTourSteps;break;case"try_notion_sites_published_page":t=s.orderedTryNotionSitesPublishedPageTourSteps;break;default:(0,i.t1)(e)}return t}function g(e,t){const n=(0,r.VK)((()=>{var e;return((null===(e=a.default.state.currentSpaceViewStore)||void 0===e?void 0:e.getTeamsStores())||[]).map((e=>e.id))}),[]),i=(0,r.VK)((()=>s.default.state.initialTeamStoreId),[]);return o.useMemo((()=>{const o=m(e),r={teamStoreIds:n,initialTeamStoreId:i};return[d(o,r),p(o,t,r),u(o,t,r)]}),[n,i,t,e])}},2679:(e,t,n)=>{n.r(t),n.d(t,{default:()=>k,orderedChatWithAiHomeChecklistTourSteps:()=>s,orderedCollaborateTourSteps:()=>l,orderedCreatePageHomeChecklistTourSteps:()=>a,orderedExploreCommunityTemplatesInAppTourSteps:()=>m,orderedExploreCommunityTemplatesTourSteps:()=>p,orderedExploreDocsTemplateTourSteps:()=>c,orderedExploreGettingStartedTemplateTourSteps:()=>g,orderedExplorePersonalTemplateTourSteps:()=>u,orderedExplorePrivateTemplateTourSteps:()=>d,orderedHomeChecklistWorkspaceTourSteps:()=>i,orderedHomeTopbarActionButtonTourSteps:()=>f,orderedTeamSidebarTourSteps:()=>r,orderedTryNotionSitesNewPageTourSteps:()=>h,orderedTryNotionSitesPublishedPageTourSteps:()=>v,tourIsActive:()=>b,tourIsActiveInSidebarStep:()=>_});var o=n(749085);const r=["welcome","actions","teamspaces","prebuilt_templates","private","ai_assistant"],i=["actions","teamspaces","private"],a=["create_page_sidebar","create_page_start_with_title","create_page_type_slash","create_page_beyond_text"],s=["chat_with_ai"],l=["collaborate","collaborate_copy_link","collaborate_add_member"],c=["explore_team_template"],d=["explore_private_template"],u=["explore_personal_template"],p=["explore_templates","browse_templates"],m=["explore_templates"],g=["explore_getting_started_template"],f=["home_topbar_action_button"],h=["sites_share_page","sites_publishing_experience"],v=["sites_settings_button","sites_publishing_experience"],y=["welcome","actions","teamspaces","prebuilt_templates","private","explore_templates","home","create_page_sidebar","chat_with_ai","explore_team_template"];function b(e){return"inactive"!==e.type}function _(e){return"inactive"!==e.type&&y.includes(e.step)}class S extends o.default{getInitialState(){return{type:"inactive"}}dismissTourTutorial(){this.setState({...this.state,type:"inactive"})}isTutorialStepActive(e){return"inactive"!==this.state.type&&this.state.step===e}}const k=new S},342198:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var o=n(749085),r=n(653965),i=n(619584),a=n(21359),s=n(398730),l=n(385555);function c(e){const t=l.default.getEligibleGroup({experimentId:e,parameter:"editedPagesLookbackDays",defaultGroup:"control"});return void 0===t?"1":t}async function d(e){const{spaceId:t,userId:n,environment:o}=e,r=c("search-local-edited-pages-max"),i=c("search-local-sim-users-edited-pages-max"),l=parseInt(i),d=parseInt(r),u=await a.getUserSignals(o,{spaceId:t,signals:[{name:"recentPages",includeRecords:!0},{name:"similarUserRecentPages",includeRecords:!0},{name:"topPages7dPageView",includeRecords:!0},{name:"editedPages",includeRecords:!0,lookbackDays:d},{name:"similarUsersEditedPages",includeRecords:!0,lookbackDays:l}]});if("success"===u.type){const e={recentPages:[],similarUserRecentPages:[],topPages7dPageView:[],editedPages:[],similarUsersEditedPages:[]};u.data.signals.forEach((t=>{if("error"===t.status)return;const n="similarUserRecentPages"===t.name?t.data.flatMap((e=>{let{recentPages:t}=e;return t})):t.data;e[t.name]=n})),m.update((o=>({...o,userSignals:o.userSignals.set(m.getKey(t,n),e)}))),s.S(o)}}const u=5*i.hM;class p extends o.default{constructor(){super(...arguments),this.refreshTimer=void 0,this.getKeyMemoized=(0,r.HP)(this.getKey)}getInitialState(){return{userSignals:new Map}}getKey(e,t){return`${e}:${t}`}getUserSignals(e){let{spaceId:t,userId:n}=e;if(!t||!n)return;const o=this.getKeyMemoized(t,n),r=this.state.userSignals.get(o);return r||void 0}initializeAndLoadAllUserSignals(e){this.refreshTimer&&window.clearTimeout(this.refreshTimer),d(e),this.refreshTimer=window.setTimeout((()=>{d(e)}),u)}}const m=new p},990038:(e,t,n)=>{n.d(t,{m:()=>i,z:()=>r});n(757658),n(21703);var o=n(937850);class r{static async map(e,t,n){const o=new r(e);return await Promise.all(Array.from(t).map(((e,t,r)=>o.enqueue((()=>n(e,t,r))))))}constructor(e){this.queue=[],this.waitingList=[],this.running=[],this.afterFlushes=[],this.afterClogs=[],this.waiting=!1,this.parallel=e}getStats(){return{running:this.running.length,queue:this.queue.length,waitingList:this.queue.length}}isEmpty(){return 0===this.running.length&&0===this.waitingList.length&&0===this.queue.length}isWaiting(){return this.waiting}setParallelism(e){this.parallel=e,this.flush()}getParallelism(){return this.parallel}enqueue(e){const t=o.UZ(),n=()=>e().then(t.resolve).catch((e=>{t.reject(e)}));this.waiting?this.waitingList.push({deferred:t,action:n}):this.queue.push({deferred:t,action:n}),this.flush();return i({promise:t.promise,canCancel:()=>this.queue.some((e=>e.deferred===t))||this.waitingList.some((e=>e.deferred===t)),cancel:e=>{const n=this.queue.findIndex((e=>e.deferred===t));if(n>=0)return this.queue.splice(n,1),void t.reject(e);return this.waitingList.findIndex((e=>e.deferred===t))>=0?(this.waitingList.splice(n,1),void t.reject(e)):void 0}})}wait(){this.waiting=!0;for(let e=0;e<this.queue.length;e++)this.waitingList.push(this.queue[e]);this.queue.length=0}resume(){this.waiting=!1;for(let e=0;e<this.waitingList.length;e++)this.queue.push(this.waitingList[e]);this.waitingList.length=0,this.flush()}async*mapAsyncIterable(e,t){const n=new Set,o=new Set;e.map((e=>{const r=this.enqueue((()=>t(e)));n.add(r);const i=r.finally((()=>{n.delete(r),o.delete(i)}));return o.add(i),i}));try{for(;o.size>0;)yield await Promise.race(o)}catch(r){throw n.forEach((e=>e.cancel(r))),r}finally{n.forEach((e=>e.cancel(new Error("CanceledTask."))))}}wrap(e){var t=this;return function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.enqueue((()=>e(...o)))}}enqueueImmediate(e){const t=e(),n=o.UZ();return t.then(n.resolve).catch(n.reject),this.queue.push({action:()=>t,deferred:n}),this.flush(),t}flush(){if(0===this.queue.length){if(0===this.running.length&&0===this.waitingList.length){for(const e of this.afterFlushes)e.resolve(null);this.afterFlushes=[]}if(this.running.length<this.parallel){for(const e of this.afterClogs)e.resolve(null);this.afterClogs=[]}return}if(this.running.length>=this.parallel)return;const e=this.queue.splice(0,this.parallel-this.running.length);for(const t of e)this.running.push(t);for(const t of e)t.action().then((()=>{this.running.splice(this.running.indexOf(t),1),this.flush()}))}afterFlush(){const e=o.UZ();return this.afterFlushes.push(e),this.flush(),e.promise}afterClog(){const e=o.UZ();return this.afterClogs.push(e),this.flush(),e.promise}cancel(){const e=this.running,t=this.queue,n=this.waitingList;this.running=[],this.queue=[],this.waitingList=[];for(const o of e)o.deferred.reject(new Error("CanceledTask."));for(const o of t)o.deferred.reject(new Error("CanceledTask."));for(const o of n)o.deferred.reject(new Error("CanceledTask."))}}function i(e){const{promise:t,canCancel:n,cancel:o}=e,r=t;return r.canCancel=n,r.cancel=o,r}},997466:(e,t,n)=>{n.d(t,{Fq:()=>l,HI:()=>d,Vi:()=>o.Vi,_j:()=>c});var o=n(16765),r=n(992942),i=n(523588),a=n(757426),s=n(883933);function l(e,t){return d((0,o.Vi)(e).alpha(t))}function c(e,t){const n=(0,o.Vi)(e).toLab();return n.l-=16*t,d((0,o.Vi)(n))}function d(e){return e.minify({hex:!1,hsl:!1})}(0,o.l7)([a.Z,r.Z,i.Z,s.Z])},531701:(e,t,n)=>{n.d(t,{AP:()=>I,A_:()=>Q,CY:()=>w,DB:()=>D,E_:()=>S,FN:()=>h,Hu:()=>A,J1:()=>V,KR:()=>L,MJ:()=>F,O9:()=>f,Vx:()=>B,ZE:()=>j,ZP:()=>X,_K:()=>x,_o:()=>P,bw:()=>K,fi:()=>G,fn:()=>U,gh:()=>_,hI:()=>R,iY:()=>W,jS:()=>q,lL:()=>Z,nR:()=>k,p6:()=>$,se:()=>c,wo:()=>J,x7:()=>Y});var o=n(997466),r=n(653965),i=n(296902),a=n(401898);function s(e){return`rgba(55, 53, 47, ${e})`}function l(e){return{black:(0,o.Vi)({r:15,g:15,b:15}),darkgray:(0,o.Vi)({h:e,s:8,l:20}),gray:(0,o.Vi)({h:e,s:6,l:50}),lightgray:(0,o.Vi)({h:e,s:4,l:80}),white:(0,o.Vi)({h:e,s:2,l:100})}}const c={light:l(45),dark:l(205)},d={whiteWithAlpha:function(){return`rgba(255, 255, 255, ${arguments.length>0&&void 0!==arguments[0]?arguments[0]:1})`},blackWithAlpha:function(){return`rgba(0, 0, 0, ${arguments.length>0&&void 0!==arguments[0]?arguments[0]:1})`},redWithAlpha:function(){return`rgba(235, 87, 87, ${arguments.length>0&&void 0!==arguments[0]?arguments[0]:1})`},blueWithAlpha:function(){return`rgba(35, 131, 226, ${arguments.length>0&&void 0!==arguments[0]?arguments[0]:1})`}},u={blue:"#2383E2",red:"#EB5757",contentBorder:"#E4E3E2",contentGrayBackground:"#F7F6F5",contentPlaceholder:"#C4C4C4",defaultText:"rgb(66, 66, 65)",uiBlack:"#333",uiExtraLightGray:"#E2E2E2",uiGray:"#A5A5A5",uiLightBlack:"#888",uiLightBorder:"#F2F1F0",uiLightGray:"#C4C4C4"},p={frontText:"#040404",frontTextLight:"rgba(0,0,0,0.4)",frontTextMedium:"rgba(0,0,0,0.6)",frontTextDark:"#111111",frontBorder:"rgba(0, 0, 0, 0.1)",frontCreamBackground:"#FFFEFC",frontCreamBackgroundDark:"#F9F5F1",frontCreamText:"#463D34",frontCreamBorder:"#D4CFCB",frontBlueBackground:"#EFF3F5",frontBlueBackgroundDark:"#D7E3E8",frontBlueText:"#2383E2",frontBlueBorder:"#B5C7D8",frontPurpleBackground:"#E7E6EA",frontPurpleBackgroundDark:"#D9D7DF",frontPurpleText:"#382F49",frontPurpleBorder:"#ACA8BD",frontOrangeBackground:"#F8EDE7",frontOrangeBackgroundDark:"#F2DCCF",frontOrangeText:"#5B3322",frontOrangeBorder:"#DEBEAC",frontRed:"#eb5757",frontPrimaryButtonBackground:"#E16259",frontPrimaryButtonBackgroundHovered:"#CF534A",frontPrimaryButtonBackgroundPressed:"#BF4D45",frontPrimaryButtonBorder:"#BE5643",frontRedButtonBackground:"#E16259",frontRedButtonBackgroundHovered:"#CF534A",frontRedButtonBackgroundPressed:"#BF4D45",frontRedButtonBorder:"#BE5643",frontSecondaryButtonBackground:"#FDF5F2",frontSecondaryButtonBackgroundHovered:"#FBEBE8",frontSecondaryButtonBackgroundPressed:"#F9E5E2",frontTertiaryButtonBackground:"transparent",frontTertiaryButtonBackgroundHovered:(0,o.Fq)(c.light.darkgray,.08),frontTertiaryButtonBackgroundPressed:(0,o.Fq)(c.light.darkgray,.16),frontQuaternaryButtonBackground:"#2383E2",frontQuaternaryButtonBackgroundHovered:"#2383E2",frontQuaternaryButtonBackgroundPressed:"#2383E2",frontQuaternaryButtonBorder:"#2383E2",frontMobilePhoneBackground:"#1d1d1d",frontLiveDemoSidebarText:"#777",frontLiveDemoSidebarLabelText:"rgba(55, 53, 47, 0.3)",frontTransparent:"transparent",frontBlackButtonBackground:"#323232",frontBlackButtonBackgroundHovered:"#404040",frontBlackButtonBackgroundPressed:"#4B4B4B",frontBlueButtonBackground:"#2383E2",frontBlueButtonHoveredBackground:(0,o._j)("#2383E2",.3),frontBlueButtonPressedBackground:(0,o._j)("#2383E2",.6)},m={regularTextColor:s(1),mediumTextColor:s(.7),lightTextColor:s(.4),regularIconColor:(0,o.Fq)(c.light.darkgray,.8),mediumIconColor:(0,o.Fq)(c.light.darkgray,.4),lightIconColor:(0,o.Fq)(c.light.darkgray,.2),dividerColor:(0,o.Fq)(c.light.darkgray,.09),invertedTextColor:(0,o.Fq)("white",.9),selectionColor:"rgba(35, 131, 226, 0.28)"},g={halfWhite:"rgba(255, 255, 255, 0.5)",diffTextColor:u.blue,diffBackground:(0,o.Fq)(u.blue,.1),diffBackgroundHover:(0,o.Fq)(u.blue,.2)},f={inherit:"inherit",transparent:"transparent",black:"black",white:"white",...d,...u,EmailBaseColor:"#333333",EmailBorderColor:"#EEEEEE",EmailCaptionColor:"#AAAAAA",EmailPasswordBackground:"#F4F4F4",EmailSecondaryTextColor:"#787774",EmailLinkBackground:"#F9F9F8",EmailTitleColor:"#1D1B16",EmailFooterSecondaryTextColor:"#ACABA9",PendingInvitationTextColor:"#ACABA9",twitterBrandBlueColor:"#1da1f2",UIDocNotificationsDarkGrayColor:"#6A6A6A",UIDocNotificationsLightGrayBackground:"#F1F1F1",UIDocNotificationsMediumGrayBackground:"#D7D7D7",UIDocNotificationsMediumLightGrayBackground:"#E9E9E9",...p,...m,...g},h={light:{uiBlue:{50:"rgba(35, 131, 226, .035)",75:"rgba(35, 131, 226, .05)",100:"rgba(35, 131, 226, .07)",150:"rgba(35, 131, 226, .1)",200:"rgba(35, 131, 226, .14)",300:"rgba(35, 131, 226, .20)",400:"rgba(35, 131, 226, .35)",500:"rgba(35, 131, 226, .57)",600:"rgba(35, 131, 226, 1)",700:"rgba(16, 95, 173, 1)"},pink:{900:"rgba(44, 20, 32, 1)",800:"rgba(76, 35, 55, 1)",700:"rgba(111, 49, 81, 1)",600:"rgba(162, 51, 111, 1)",500:"rgba(193, 76, 138, 1)",400:"rgba(205, 116, 159, 1)",300:"rgba(223, 149, 183, 1)",200:"rgba(227, 188, 205, 1)",100:"rgba(245, 224, 233, 1)",50:"rgba(249, 238, 243, 0.8)",30:"rgba(251, 245, 251, 0.7)"},purple:{900:"rgba(38, 21, 46, 1)",800:"rgba(65, 36, 84, 1)",700:"rgba(90, 56, 114, 1)",600:"rgba(117, 77, 146, 1)",500:"rgba(144, 101, 176, 1)",400:"rgba(167, 130, 195, 1)",300:"rgba(188, 161, 207, 1)",200:"rgba(209, 192, 221, 1)",100:"rgba(232, 222, 238, 1)",50:"rgba(244, 240, 247, 0.8)",30:"rgba(249, 246, 252, 0.7)"},green:{900:"rgba(16, 36, 22, 1)",800:"rgba(28, 56, 41, 1)",700:"rgba(31, 79, 59, 1)",600:"rgba(51, 104, 78, 1)",500:"rgba(68, 131, 97, 1)",400:"rgba(108, 155, 125, 1)",300:"rgba(147, 181, 156, 1)",200:"rgba(184, 207, 187, 1)",100:"rgba(219, 237, 219, 1)",50:"rgba(237, 243, 236, 1)",30:"rgba(244, 248, 243, 0.7)"},gray:{900:"rgba(29, 27, 22, 1)",800:"rgba(50, 48, 44, 1)",700:"rgba(72, 71, 67, 1)",600:"rgba(95, 94, 91, 1)",500:"rgba(120, 119, 116, 1)",400:"rgba(145, 145, 142, 1)",300:"rgba(172, 171, 169, 1)",200:"rgba(199, 198, 196, 1)",100:"rgba(227, 226, 224, 1)",90:"rgba(227, 226, 224, 0.7)",75:"rgba(227, 226, 224, 0.5)",50:"rgba(241, 241, 239, 1)",30:"rgba(247, 247, 245, 1)",0:"rgba(255, 255, 255, 1)"},transparentGray:{900:"rgba(29, 27, 22, 0)",800:"rgba(50, 48, 44, 0)",700:"rgba(72, 71, 67, 0)",600:"rgba(95, 94, 91, 0)",500:"rgba(120, 119, 116, 0)",400:"rgba(145, 145, 142, 0)",300:"rgba(172, 171, 169, 0)",200:"rgba(199, 198, 196, 0)",100:"rgba(227, 226, 224, 0)",90:"rgba(227, 226, 224, 0.3)",75:"rgba(227, 226, 224, 0.5)",50:"rgba(241, 241, 239, 0)",30:"rgba(249, 249, 248, 0)",0:"rgba(255, 255, 255, 0)"},translucentGray:{30:"rgba(0, 0, 0, 0.01",50:"rgba(0, 0, 0, 0.04)",75:"rgba(0, 0, 0, 0.05)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.07)",300:"rgba(0, 0, 0, 0.11)",400:"rgba(0, 0, 0, 0.155)",500:"rgba(0, 0, 0, 0.335)",600:"rgba(0, 0, 0, 0.46)",700:"rgba(0, 0, 0, 0.62)",800:"rgba(0, 0, 0, 0.815)",850:"rgba(0, 0, 0, 0.89)",900:"rgba(0, 0, 0, 0.9875)"},orange:{900:"rgba(40, 24, 9, 1)",800:"rgba(73, 41, 14, 1)",700:"rgba(106, 59, 18, 1)",600:"rgba(141, 78, 23, 1)",500:"rgba(217, 115, 13, 1)",400:"rgba(215, 129, 58, 1)",300:"rgba(228, 155, 98, 1)",200:"rgba(236, 189, 155, 1)",100:"rgba(250, 222, 201, 1)",50:"rgba(251, 236, 221, 1)",30:"rgba(252, 245, 242, 0.7)"},brown:{900:"rgba(45, 21, 6, 1)",800:"rgba(68, 42, 30, 1)",700:"rgba(97, 62, 46, 1)",600:"rgba(128, 84, 63, 1)",500:"rgba(159, 107, 83, 1)",400:"rgba(187, 132, 108, 1)",300:"rgba(208, 161, 140, 1)",200:"rgba(218, 194, 183, 1)",100:"rgba(238, 224, 218, 1)",50:"rgba(244, 238, 238, 1)",30:"rgba(250, 246, 245, 0.7)"},red:{900:"rgba(48, 19, 15, 1)",800:"rgba(93, 23, 21, 1)",700:"rgba(134, 33, 32, 1)",600:"rgba(174, 47, 46, 1)",500:"rgba(212, 76, 71, 1)",400:"rgba(225, 111, 100, 1)",300:"rgba(227, 152, 142, 1)",200:"rgba(239, 186, 179, 1)",100:"rgba(255, 226, 221, 1)",50:"rgba(253, 235, 236, 1)",30:"rgba(253, 245, 243, 0.7)"},yellow:{900:"rgba(37, 25, 16, 1)",800:"rgba(64, 44, 27, 1)",700:"rgba(95, 64, 35, 1)",600:"rgba(131, 94, 51, 1)",500:"rgba(203, 145, 47, 1)",400:"rgba(203, 148, 51, 1)",300:"rgba(223, 175, 73, 1)",200:"rgba(228, 189, 106, 1)",100:"rgba(249, 228, 188, 1)",50:"rgba(251, 237, 214, 1)",30:"rgba(251, 245, 228, 1)"},blue:{900:"rgba(12, 29, 43, 1)",800:"rgba(24, 51, 71, 1)",700:"rgba(31, 74, 104, 1)",600:"rgba(45, 99, 135, 1)",500:"rgba(51, 126, 169, 1)",400:"rgba(91, 151, 189, 1)",300:"rgba(132, 177, 206, 1)",200:"rgba(170, 203, 223, 1)",100:"rgba(211, 229, 239, 1)",50:"rgba(231, 243, 248, 1)",30:"rgba(241, 248, 251, 0.7)"},pageGlass:{0:"rgba(255, 255, 255, 0.8)"},washGlass:{0:"rgba(249, 249, 248, 0.8)"}},dark:{uiBlue:{50:"rgba(35, 131, 226, .035)",75:"rgba(35, 131, 226, .05)",100:"rgba(35, 131, 226, .07)",150:"rgba(35, 131, 226, .1)",200:"rgba(35, 131, 226, .14)",300:"rgba(35, 131, 226, .20)",400:"rgba(35, 131, 226, .35)",500:"rgba(35, 131, 226, .57)",600:"rgba(35, 131, 226, 1)",700:"rgba(79, 167, 255)"},pink:{30:"rgba(246, 218, 247, 1)",50:"rgba(35, 28, 31, 1)",75:"rgba(42, 32, 36, 1)",100:"rgba(48, 34, 40, 1)",200:"rgba(59, 39, 48, 1)",300:"rgba(78, 44, 60, 1)",400:"rgba(105, 49, 76, 1)",500:"rgba(144, 58, 101, 1)",600:"rgba(185, 65, 128, 1)",700:"rgba(196, 67, 135, 1)",800:"rgba(201, 75, 140, 1)",900:"rgba(209, 87, 150, 1)"},purple:{30:"rgba(232, 222, 246, 1)",50:"rgba(31, 29, 33, 1)",75:"rgba(38, 33, 42, 1)",100:"rgba(43, 36, 49, 1)",200:"rgba(48, 39, 57, 1)",300:"rgba(60, 45, 73, 1)",400:"rgba(73, 47, 100, 1)",500:"rgba(112, 74, 150, 1)",600:"rgba(128, 83, 175, 1)",700:"rgba(141, 91, 193, 1)",800:"rgba(157, 103, 210, 1)",900:"rgba(157, 104, 211, 1)"},green:{30:"rgba(215, 232, 217, 1)",50:"rgba(29, 34, 32, 1)",75:"rgba(32, 38, 35, 1)",100:"rgba(34, 43, 38, 1)",200:"rgba(35, 49, 42, 1)",300:"rgba(36, 61, 48, 1)",400:"rgba(43, 89, 63, 1)",500:"rgba(45, 118, 80, 1)",600:"rgba(42, 142, 92, 1)",700:"rgba(45, 153, 100, 1)",800:"rgba(60, 157, 106, 1)",900:"rgba(82, 158, 114, 1)"},gray:{0:"rgba(0, 0, 0, 1)",30:"rgba(21, 21, 21, 1)",50:"rgba(25, 25, 25, 1)",75:"rgba(28, 28, 28, 1)",90:"rgba(30, 30, 30, 1)",100:"rgba(32, 32, 32, 1)",200:"rgba(37, 37, 37, 1)",300:"rgba(47, 47, 47, 1)",400:"rgba(55, 55, 55, 1)",500:"rgba(90, 90, 90, 1)",600:"rgba(127, 127, 127, 1)",700:"rgba(155, 155, 155, 1)",800:"rgba(211, 211, 211, 1)",850:"rgba(225, 225, 225, 1)",900:"rgba(246, 246, 246, 1)"},transparentGray:{30:"rgba(21, 21, 21, 0)",50:"rgba(25, 25, 25, 0)",75:"rgba(28, 28, 28, 0)",100:"rgba(32, 32, 32, 0)",200:"rgba(37, 37, 37, 0)",300:"rgba(47, 47, 47, 0)",400:"rgba(55, 55, 55, 0)",500:"rgba(90, 90, 90, 0)",600:"rgba(127, 127, 127, 0)",700:"rgba(155, 155, 155, 0)",800:"rgba(211, 211, 211, 0)",850:"rgba(225, 225, 225, 0)",900:"rgba(246, 246, 246, 0)"},translucentGray:{30:"rgba(21, 21, 21, 1)",50:"rgba(25, 25, 25, 1)",75:"rgba(255, 255, 255, 0.015)",100:"rgba(255, 255, 255, 0.03)",200:"rgba(255, 255, 255, 0.055)",300:"rgba(255, 255, 255, 0.095)",400:"rgba(255, 255, 255, 0.13)",500:"rgba(255, 255, 255, 0.283)",600:"rgba(255, 255, 255, 0.445)",700:"rgba(255, 255, 255, 0.565)",800:"rgba(255, 255, 255, 0.81)",850:"rgba(255, 255, 255, 0.87)",900:"rgba(255, 255, 255, 0.96)"},orange:{30:"rgba(240, 224, 200, 1)",50:"rgba(37, 31, 27, 1)",75:"rgba(44, 35, 30, 1)",100:"rgba(56, 40, 30, 1)",200:"rgba(66, 47, 34, 1)",300:"rgba(92, 59, 35, 1)",400:"rgba(133, 76, 29, 1)",500:"rgba(167, 91, 26, 1)",600:"rgba(205, 108, 20, 1)",700:"rgba(216, 118, 32, 1)",800:"rgba(228, 133, 56, 1)",900:"rgba(199, 125, 72, 1)"},brown:{30:"rgba(244, 224, 211, 1)",50:"rgba(35, 30, 28, 1)",75:"rgba(41, 34, 31, 1)",100:"rgba(47, 39, 35, 1)",200:"rgba(54, 40, 34, 1)",300:"rgba(74, 50, 40, 1)",400:"rgba(96, 59, 44, 1)",500:"rgba(132, 86, 65, 1)",600:"rgba(153, 103, 80, 1)",700:"rgba(170, 117, 95, 1)",800:"rgba(178, 126, 103, 1)",900:"rgba(186, 133, 111, 1)"},red:{30:"rgba(253, 218, 218, 1)",50:"rgba(36, 30, 29, 1)",75:"rgba(42, 32, 31, 1)",100:"rgba(54, 36, 34, 1)",200:"rgba(62, 40, 37, 1)",300:"rgba(82, 46, 42, 1)",400:"rgba(110, 54, 48, 1)",500:"rgba(143, 58, 53, 1)",600:"rgba(180, 65, 60, 1)",700:"rgba(205, 73, 69, 1)",800:"rgba(222, 85, 80, 1)",900:"rgba(223, 84, 82, 1)"},yellow:{30:"rgba(240, 226, 203, 1)",50:"rgba(35, 31, 26, 1)",75:"rgba(43, 37, 31, 1)",100:"rgba(55, 44, 28, 1)",200:"rgba(67, 54, 35, 1)",300:"rgba(86, 69, 47, 1)",400:"rgba(131, 94, 51, 1)",500:"rgba(155, 110, 35, 1)",600:"rgba(191, 134, 24, 1)",700:"rgba(202, 142, 27, 1)",800:"rgba(217, 158, 53, 1)",900:"rgba(202, 152, 73, 1)"},blue:{30:"rgba(203, 230, 247, 1)",50:"rgba(27, 31, 34, 1)",75:"rgba(31, 37, 41, 1)",100:"rgba(29, 40, 46, 1)",200:"rgba(27, 45, 56, 1)",300:"rgba(20, 58, 78, 1)",400:"rgba(40, 69, 108, 1)",500:"rgba(41, 90, 149, 1)",600:"rgba(38, 111, 192, 1)",700:"rgba(46, 124, 209, 1)",800:"rgba(70, 148, 242, 1)",900:"rgba(94, 135, 201, 1)"},pageGlass:{0:"rgba(25, 25, 25, 0.8)"},washGlass:{0:"rgba(32, 32, 32, 0.8)"}}},v={light:s(.65),dark:h.dark.translucentGray[600]};function y(e){const t={mode:{light:"light",dark:"dark"},invertedMode:{light:"dark",dark:"light"},primaryBlack:{light:f.black,dark:f.white},regularTextColor:{light:s(1),dark:h.dark.translucentGray[800]},darkTextColor:{light:s(.8),dark:h.dark.translucentGray[700]},mediumTextColor:v,lightTextColor:{light:s(.5),dark:h.dark.translucentGray[500]},actionMenuButtonTextColor:{light:s(.65),dark:h.dark.gray[700]},pageTitlePlaceholderTextColor:{light:"rgba(55, 53, 47, 0.15)",dark:h.dark.gray[400]},headerBlockPlaceholderTextColor:{light:"rgba(55, 53, 47, 0.2)",dark:h.dark.gray[400]},regularInvertedTextColor:{light:(0,o.Fq)(c.light.white,.9),dark:h.dark.gray[800]},mediumInvertedTextColor:{light:(0,o.Fq)(c.light.lightgray,.6),dark:h.dark.gray[600]},regularIconColor:{light:s(.85),dark:h.dark.translucentGray[800]},mediumIconColor:{light:s(.45),dark:h.dark.translucentGray[600]},lightIconColor:{light:s(.35),dark:h.dark.translucentGray[500]},lightDividerColor:{light:(0,o.Fq)(c.light.darkgray,.06),dark:h.dark.translucentGray[200]},regularDividerColor:{light:(0,o.Fq)(c.light.darkgray,.09),dark:h.dark.translucentGray[300]},darkDividerColor:{light:(0,o.Fq)(c.light.darkgray,.16),dark:h.dark.translucentGray[400]},chartGridLineColor:{light:h.light.gray[100],dark:h.dark.gray[400]},chartAxisLineColor:{light:h.light.gray[100],dark:h.dark.gray[400]},chartLegendItemHiddenColor:{light:h.light.gray[100],dark:h.dark.gray[400]},chartInactiveLegendNavigationColor:{light:h.light.gray[100],dark:h.dark.gray[200]},chartRowLeftColor:{light:h.light.gray[500],dark:v.dark},chartRowRightColor:{light:h.light.gray[300],dark:h.dark.translucentGray[500]},chartAvatarBorderColor:{light:h.light.gray[100],dark:h.dark.translucentGray[400]},chartAvatarBackgroundColor:{light:f.white,dark:h.dark.gray[50]},chartAvatarColor:{light:h.light.gray[500],dark:h.dark.gray[600]},aiActionButtonBorderColor:{light:(0,o.Fq)(c.light.darkgray,.12),dark:h.dark.translucentGray[300]},tableDividerColor:{light:"rgb(233,233,231)",dark:h.dark.gray[300]},tableHomeDividerColor:{light:s(.15),dark:h.dark.translucentGray[400]},tableFrozenFilterDividerColor:{light:"rgb(213, 212, 210)",dark:"rgb(70, 70, 70)"},tableFrozenSelectedDividerColor:{light:"rgb(202,212,225)",dark:"rgb(47,58,72)"},tableLightDividerColor:{light:"rgb(238,238,237)",dark:h.dark.gray[200]},largePopupBorder:{light:(0,o.Fq)(c.light.darkgray,.1),dark:(0,o.Fq)(f.white,.13)},largeShimmerColor:{light:(0,o.Fq)(c.light.darkgray,.04),dark:h.dark.translucentGray[200]},linkDecorationColor:{light:(0,o.Fq)(c.light.darkgray,.25),dark:h.dark.gray[400]},strikethroughLineColor:{light:(0,o.Fq)(c.light.darkgray,.25),dark:h.dark.gray[600]},opacityLinkDecorationColor:{light:(0,o.Fq)(c.light.darkgray,.4),dark:h.dark.translucentGray[500]},inlineInputBackground:{light:"rgba(148, 148, 148, 0.15)",dark:h.dark.translucentGray[200]},regularEmojiColor:{light:f.black,dark:h.dark.gray[900]},sidebarTextColor:{light:"#5F5E5B",dark:h.dark.gray[700]},sidebarSecondaryColor:{light:"#91918E",dark:h.dark.gray[700]},cardSidebarBackground:{light:"#FBFBFA",dark:h.dark.translucentGray[100]},androidSidebarBackground:{light:f.white,dark:h.dark.gray[100]},groupedFormBackground:{light:f.blackWithAlpha(.025),dark:h.dark.gray[100]},groupedFormBorder:{light:(0,o.Fq)(c.light.darkgray,.09),dark:h.dark.gray[200]},sidebarItemSelectedBackground:{light:"rgba(0, 0, 0, 0.03)",dark:h.dark.translucentGray[200]},groupedFormLabel:{light:"#6B6B6B",dark:"#6B6B6B"},sidebarSecondaryBackground:{light:f.blackWithAlpha(.025),dark:f.blackWithAlpha(.025)},sidebarSwitcherBackground:{light:"#FBFAF9",dark:h.dark.gray[200]},sidebarSwitcherSettingsBackground:{light:f.blackWithAlpha(.03),dark:f.blackWithAlpha(.12)},sidebarSwitcherSettingsColor:{light:h.dark.gray[500],dark:h.dark.gray[600]},sidebarHideButtonHoveredBackground:{light:(0,o._j)("#E8E7E4",.3),dark:h.dark.gray[300]},sidebarHideButtonPressedBackground:{light:(0,o._j)("#E8E7E4",.6),dark:h.dark.gray[200]},mobileSidebarIOSBackground:{light:"rgb(247, 246, 243)",dark:h.dark.gray[100]},mobileSidebarAndroidBackground:{light:f.white,dark:h.dark.gray[100]},onboardingSidebarOverlay:{light:"rgba(251, 251, 250, 0.6)",dark:"rgba(15, 15, 15, 0.7)"},onboardingContentOverlay:{light:"rgba(255, 255, 255, 0.8)",dark:"rgba(15, 15, 15, 0.7)"},onboardingFlatBackground:{light:"rgb(246, 246, 245)",dark:"rgb(55, 60, 63)"},onboardingExpandIconColor:{light:"rgb(176, 175, 172)",dark:"rgb(176, 175, 172)"},contentBackground:{light:f.white,dark:h.dark.gray[50]},cardContentBackground:{light:f.white,dark:h.dark.gray[100]},contentBackgroundTransparent:{light:"rgba(255,255,255,0)",dark:h.dark.transparentGray[50]},aiPurpleTranslucentRadialGradientBackground:{light:"radial-gradient(489.87% 137.22% at 50.14% 0%, rgba(130, 33, 202, 0.09) 0%, rgba(213, 174, 241, 0.00) 93.23%), rgba(255, 255, 255, 0.90)",dark:"radial-gradient(68.25% 108.34% at 25.14% 0%, rgba(130, 33, 202, 0.78) 9.07%, rgba(213, 174, 241, 0.40) 93.23%), rgba(0, 0, 0, 1)"},cardContentBackgroundTransparent:{light:"rgba(255, 255, 255, 0)",dark:h.dark.transparentGray[100]},overlaySmokescreen:{light:"rgba(15, 15, 15, 0.6)",dark:"rgba(15, 15, 15, 0.8)"},calendarItemBackground:{light:f.white,dark:h.dark.gray[300]},calendarItemHoveredBackground:{light:h.light.gray[50],dark:h.dark.gray[400]},popoverBackground:{light:f.white,dark:h.dark.gray[200]},popoverWaxPaperBackground:{light:"rgba(255,255,255,0.9)",dark:"rgba(32, 32, 32, 0.9)"},popoverHoveredBackground:{light:f.white,dark:h.dark.gray[300]},peekModalBackground:{light:f.white,dark:h.dark.gray[100]},boardItemDefaultBackground:{light:f.white,dark:h.dark.translucentGray[200]},boardItemDefaultHoveredBackground:{light:(0,o.Fq)(c.light.darkgray,.08),dark:h.dark.translucentGray[300]},collectionGalleryPreviewCardBackground:{light:f.white,dark:h.dark.translucentGray[200]},collectionGalleryPreviewCardCover:{light:"rgba(55, 53, 47, 0.025)",dark:h.dark.translucentGray[100]},collectionUnsetDependencyArrow:{light:h.light.gray[200],dark:h.dark.gray[600]},collectionValidDependencyArrow:{light:h.light.yellow[300],dark:h.dark.yellow[600]},collectionInvalidDependencyArrow:{light:h.light.red[300],dark:h.dark.red[600]},modalBackground:{light:f.white,dark:h.dark.gray[100]},modalUnderlayBackground:{light:(0,o.Fq)(c.light.black,.6),dark:"rgba(15, 15, 15, 0.8)"},altTextPopupBackground:{light:(0,o.Fq)(f.white,.97),dark:(0,o.Fq)(h.dark.gray[200],.97)},tooltipBackground:{light:(0,o.HI)(c.light.black),dark:h.dark.gray[300]},filterGroupBackground:{light:f.blackWithAlpha(.02),dark:h.dark.translucentGray[100]},calendarHomeWidget:{light:{base:{blue:"rgba(45, 152, 234, 1)",green:"rgba(97, 189, 142, 1)",yellow:"rgba(231, 181, 51, 1)",purple:"rgba(165, 121, 217, 1)",orange:"rgba(234, 139, 66, 1)",pink:"rgba(222, 101, 165, 1)",gray:h.light.gray[300],red:"rgba(224, 94, 88, 1)"}},dark:{base:{blue:"rgba(45, 152, 234, 1)",green:"rgba(97, 189, 142, 1)",yellow:"rgba(231, 181, 51, 1)",purple:"rgba(165, 121, 217, 1)",orange:"rgba(234, 139, 66, 1)",pink:"rgba(222, 101, 165, 1)",gray:h.light.gray[300],red:"rgba(224, 94, 88, 1)"}}},beigeBannerBackground:{light:"#FBF8F3",dark:"rgb(55, 60, 63)"},darkBannerBackground:{light:"#EAE9E7",dark:"rgb(55, 60, 63)"},keyboardDoneBarBackground:{light:"#F0F1F2",dark:"#27292B"},keyboardActionBarBackground:{light:f.white,dark:"#272829"},UIUserAvatarBackground:{light:f.white,dark:h.dark.gray[50]},UIUserAvatarInnerOutline:{light:(0,o.Fq)(f.white,.3),dark:"rgba(25, 25, 25, 0.3)"},UIUserAvatarSelfBorder:{light:h.light.gray[500],dark:h.dark.gray[700]},UIUserAvatarOuterOutline:{light:f.white,dark:h.dark.gray[50]},UIUserAvatarIdleOutline:{light:"rgb(241, 241, 239)",dark:"rgb(85, 85, 83)"},suspendedUIUserAvatarBackground:{light:h.light.gray[50],dark:h.dark.gray[400]},selectorBorderUnselected:{light:h.light.gray[100],dark:h.dark.gray[500]},codeBlockBackground:{light:"rgb(247, 246, 243)",dark:h.dark.translucentGray[100]},codeBlockButtonBackground:{light:"#EAE9E5",dark:h.dark.gray[200]},tableHeaderRowColumnBackground:{light:"rgb(247, 246, 243)",dark:h.dark.translucentGray[100]},embedPlaceholderBackground:{light:(0,o._j)("rgb(247, 246, 243)",.1),dark:h.dark.translucentGray[100]},defaultBadgeBackground:{light:(0,o.Fq)(c.light.lightgray,.5),dark:h.dark.translucentGray[200]},redBadgeBackground:{light:f.red,dark:h.dark.red[600]},inputBackground:{light:"rgba(242,241,238,0.6)",dark:h.dark.translucentGray[200]},tokenInputMenuItemBackground:{light:"rgba(242,241,238,0.6)",dark:h.dark.translucentGray[100]},marginDiscussionBackground:{light:f.white,dark:h.dark.gray[100]},hoveredDiscussionBackground:{light:(0,o.Fq)(c.light.darkgray,.03),dark:h.dark.gray[100]},hoveredMarginDiscussionBackground:{light:"rgb(249, 249, 248)",dark:h.dark.gray[100]},selectedMarginDiscussionBackground:{light:f.white,dark:h.dark.gray[200]},focusDiscussionBackground:{light:"rgba(255, 212, 0, 0.065)",dark:h.dark.gray[200]},focusDiscussionInputBackground:{light:(0,o.Fq)(c.light.darkgray,.06),dark:h.dark.translucentGray[200]},discussionInputActivatedBackground:{light:f.white,dark:"transparent"},blueColor:{light:"rgba(35, 131, 226, 1)",dark:"rgba(35, 131, 226, 1)"},buttonBackground:{light:f.white,dark:h.dark.gray[100]},filterPillBackground:{light:"rgba(35, 131, 226, 0.03)",dark:"rgba(35, 131, 226, 0.07)"},filterPillBorder:{light:"rgba(35, 131, 226, 0.35)",dark:"rgba(35, 131, 226, 0.35)"},buttonHoveredBackground:{light:(0,o.Fq)(c.light.darkgray,.06),dark:h.dark.translucentGray[200]},outlineButtonHoveredBackground:{light:(0,o.Fq)(c.light.darkgray,.06),dark:h.dark.translucentGray[200]},outlineButtonPressedBackground:{light:(0,o.Fq)(c.light.darkgray,.16),dark:h.dark.gray[200]},buttonPressedBackground:{light:(0,o.Fq)(c.light.darkgray,.16),dark:h.dark.translucentGray[100]},buttonPressedBackgroundLight:{light:(0,o.Fq)(c.light.darkgray,.1),dark:h.dark.translucentGray[100]},cardBackground:{light:(0,o.Fq)(c.light.darkgray,.03),dark:h.dark.gray[200]},cardHoveredBackground:{light:(0,o.Fq)(c.light.darkgray,.04),dark:h.dark.gray[300]},cardPressedBackground:{light:(0,o.Fq)(c.light.darkgray,.06),dark:h.dark.gray[200]},blueButtonBackground:{light:f.blue,dark:h.dark.blue[600]},blueButtonHoveredBackground:{light:(0,o._j)(f.blue,.3),dark:(0,o._j)(f.blue,.3)},blueButtonPressedBackground:{light:(0,o._j)(f.blue,.6),dark:(0,o._j)(f.blue,.6)},commentFileDropZoneBackground:{light:f.whiteWithAlpha(.8),dark:h.dark.translucentGray[100]},searchSidebarButtonBackground:{light:(0,o.Fq)(c.light.darkgray,.03),dark:h.dark.translucentGray[300]},searchSidebarButtonBackgroundHovered:{light:(0,o.Fq)(c.light.darkgray,.05),dark:h.dark.translucentGray[100]},searchSidebarButtonBackgroundPressed:{light:(0,o.Fq)(c.light.darkgray,.1),dark:h.dark.translucentGray[50]},white:{light:f.white,dark:f.black},whiteButtonBackground:{light:f.white,dark:h.dark.gray[200]},assistantCornerButtonBackground:{light:f.white,dark:h.dark.gray[800]},assistantCornerButtonBackgroundHovered:{light:"rgb(239, 239, 238)",dark:"rgb(239, 239, 238)"},assistantCornerButtonBackgroundPressed:{light:"rgb(223, 223, 222)",dark:"rgb(223, 223, 222)"},assistantTintedActionButtonBackground:{light:h.light.translucentGray[50],dark:h.dark.translucentGray[200]},assistantTintedActionButtonBackgroundHovered:{light:h.light.translucentGray[100],dark:h.dark.translucentGray[400]},assistantTintedActionButtonBackgroundPressed:{light:h.light.translucentGray[200],dark:h.dark.translucentGray[300]},redButtonBackground:{light:f.red,dark:h.dark.red[600]},redButtonHoveredBackground:{light:(0,o._j)(f.red,.3),dark:(0,o._j)(h.dark.red[600],.3)},redButtonPressedBackground:{light:(0,o._j)(f.red,.6),dark:(0,o._j)(h.dark.red[600],.6)},grayButtonBackground:{light:f.uiGray,dark:h.dark.gray[600]},grayButtonHoveredBackground:{light:(0,o._j)(f.uiGray,.3),dark:(0,o._j)(h.dark.gray[600],.3)},grayButtonPressedBackground:{light:(0,o._j)(f.uiGray,.6),dark:(0,o._j)(h.dark.gray[600],.6)},buttonGroupBackground:{light:f.white,dark:h.dark.gray[300]},checkboxBackground:{light:h.light.uiBlue[600],dark:h.dark.uiBlue[600]},checkboxHoveredBackground:{light:(0,o._j)(h.light.uiBlue[600],.1),dark:(0,o._j)(h.dark.uiBlue[600],.1)},checkboxPressedBackground:{light:(0,o._j)(h.light.uiBlue[600],.2),dark:(0,o._j)(h.dark.uiBlue[600],.2)},uncheckedCheckboxHoveredBackground:{light:(0,o.Fq)(f.black,.04),dark:(0,o.Fq)(f.white,.055)},uncheckedCheckboxPressedBackground:{light:(0,o.Fq)(f.black,.1),dark:(0,o.Fq)(f.white,.13)},propertyButtonsBackground:{light:f.white,dark:h.dark.gray[200]},whiteButtonHoveredBackground:{light:"rgb(239, 239, 238)",dark:h.dark.gray[300]},whiteButtonPressedBackground:{light:"rgb(223, 223, 222)",dark:h.dark.gray[200]},segmentedControlActiveBackground:{light:f.white,dark:h.dark.gray[500]},outlineBlueButtonHoveredBackground:{light:"rgba(35, 131, 226, 0.07)",dark:"rgba(35, 131, 226, 0.07)"},outlineBlueButtonPressedBackground:{light:"rgba(35, 131, 226, 0.14)",dark:"rgba(35, 131, 226, 0.14)"},outlineRedButtonBorder:{light:f.redWithAlpha(.5),dark:h.dark.red[400]},outlinefrontSecondaryButtonHoveredBackground:{light:f.redWithAlpha(.1),dark:f.redWithAlpha(.1)},outlinefrontSecondaryButtonPressedBackground:{light:f.redWithAlpha(.2),dark:f.redWithAlpha(.2)},outlineButtonBorder:{light:(0,o.Fq)(c.light.darkgray,.16),dark:h.dark.translucentGray[400]},outlinePressedButtonBorder:{light:(0,o.Fq)(c.light.darkgray,.9),dark:h.dark.translucentGray[900]},filterGroupBorder:{light:(0,o.Fq)(c.light.darkgray,.1),dark:h.dark.translucentGray[200]},radioButtonBorder:{light:f.blackWithAlpha(.2),dark:h.dark.translucentGray[400]},timelineBackground:{light:"rgb(253,253,253)",dark:h.dark.gray[50]},peekTimelineBackground:{light:"rgb(253,253,253)",dark:h.dark.gray[100]},timelineDarkerBackground:{light:"rgb(247,247,247)",dark:h.dark.translucentGray[100]},peekTimelineDarkerBackground:{light:"rgb(247,247,247)",dark:h.dark.translucentGray[100]},timelineRed:{light:"rgb(211,79,67)",dark:h.dark.red[600]},topbarFavorite:{light:"#F6C050",dark:h.dark.yellow[900]},calendarTodayBackground:{light:"#EB5757",dark:h.dark.red[700]},home:{light:{emptyStatePreview:{joinButtonBackground:h.light.gray[30],calendarIndicator:h.light.gray[50],verticalDivider:h.light.gray[75]},betaBadge:{background:f.blackWithAlpha(.15),color:f.white},scrollButtonBackground:{base:f.white,pressed:h.light.gray[50]},tile:{background:(0,o.Fq)("white",.9)},cards:{verticalDivider:(0,o.Fq)("black",.05),coverPhoto:{base:h.light.gray[30],hovered:h.light.gray[30],pressed:(0,o.Fq)(c.light.darkgray,.06)},background:{base:f.white,hovered:f.white,pressed:h.light.gray[50]},templateCardBackground:{base:f.white,hovered:f.white,pressed:(0,o.Fq)("black",.025)},tipsCheckboxFill:{base:(0,o.Fq)("black",.025),hovered:(0,o.Fq)("black",.025)},topBarButtonsBackground:{base:f.white}}},dark:{emptyStatePreview:{joinButtonBackground:h.dark.gray[200],calendarIndicator:h.dark.gray[300],verticalDivider:h.dark.gray[300]},betaBadge:{background:f.blackWithAlpha(.15),color:f.whiteWithAlpha(.6)},scrollButtonBackground:{base:h.dark.gray[200],pressed:h.dark.gray[300]},tile:{background:"rgba(32, 32, 32, 0.9)"},cards:{verticalDivider:(0,o.Fq)("white",.1),coverPhoto:{base:(0,o.Fq)("white",.03),hovered:(0,o.Fq)("white",.03),pressed:(0,o.Fq)("white",.05)},background:{base:(0,o.Fq)("white",.05),hovered:(0,o.Fq)("white",.05),pressed:(0,o.Fq)("white",.07)},templateCardBackground:{base:(0,o.Fq)("white",.05),hovered:(0,o.Fq)("white",.05),pressed:(0,o.Fq)("white",.07)},tipsCheckboxFill:{base:(0,o.Fq)("white",.025),hovered:(0,o.Fq)("white",.025)},topBarButtonsBackground:{base:h.dark.gray[200]}}}},personalHomeBackgroundDesktop:{light:f.white,dark:h.dark.gray[50]},personalHomeBackgroundPhone:{light:h.light.gray[30],dark:h.dark.gray[50]},migrationMyTasksPreviewBackground:{light:f.white,dark:h.dark.gray[400]},importOptionsButtonBackground:{light:f.white,dark:h.dark.translucentGray[100]},importOptionsIconWrapBackground:{light:"#FBFBFA",dark:h.dark.gray[100]},sitesPagePreviewWindowsChromeBar:{light:"#F5F5F5",dark:"#141414"},seoPreviewTitle:{light:"#1D13A3",dark:"#9EBDF4"},sitesBuilderBackground:{light:"#FCFCFC",dark:"#1F1F1F"},sitesInstructionStep:{light:h.light.gray[50],dark:h.dark.gray[400]},accentColors:h,selectLightGray:{light:{900:"rgba(29, 27, 22, 0.7)",800:"rgba(50, 48, 44, 1)",700:"rgba(72, 71, 67, 0.5)",600:"rgba(95, 94, 91, 0.5)",500:"rgba(120, 119, 116, 0.5)",400:"rgba(145, 145, 142, 0.5)",300:"rgba(172, 171, 169, 0.5)",200:"rgba(199, 198, 196, 0.5)",100:"rgba(227, 226, 224, 0.5)",50:"rgba(241, 241, 239, 0.5)",30:"rgba(249, 249, 245, 0.5)"},dark:{30:"rgba(21, 21, 21, 1)",50:"rgba(25, 25, 25, 1)",75:"rgba(28, 28, 28, 1)",100:"rgba(32, 32, 32, 1)",200:"rgba(37, 37, 37, 1)",300:"rgba(47, 47, 47, 1)",400:"rgba(55, 55, 55, 1)",500:"rgba(90, 90, 90, 1)",600:"rgba(127, 127, 127, 1)",700:"rgba(155, 155, 155, 1)",800:"rgba(211, 211, 211, 1)",850:"rgba(225, 225, 225, 1)",900:"rgba(246, 246, 246, 1)"}},guestIconColor:{light:"rgba(218, 163, 64, 1)",dark:"rgba(218, 163, 64, 1)"},legacyDefaultSelectColor:{light:(0,o.Fq)(c.light.lightgray,.5),dark:h.dark.translucentGray[300]},legacyRedSelectColor:{light:"rgba(255,0,26,0.2)",dark:"rgba(255,115,105, 0.5)"},equationEmptyPlaceholderBackground:{light:(0,o._j)("rgb(247, 246, 243)",.1),dark:h.dark.translucentGray[100]},equationErrorPlaceholderBackground:{light:f.redWithAlpha(.1),dark:h.dark.red[300]},equationTemporaryPlaceholderBackground:{light:"rgba(35, 131, 226, 0.14)",dark:h.dark.translucentGray[100]},simpleTableSelectionBorder:{light:"rgba(116, 182, 219, 1)",dark:h.dark.blue[900]},onboardingBackground:{light:"rgb(247, 246, 243)",dark:h.dark.gray[100]},onboardingPreviewBackground:{light:"rgb(247, 247, 245)",dark:h.dark.gray[100]},onboardingBackgroundMask:{light:"rgba(247, 246, 243, 0)",dark:"rgba(55, 60, 63, 0)"},errorText:{light:"#eb5757",dark:h.dark.red[700]},lightErrorText:{light:"#f28d8d",dark:h.dark.red[500]},illustrationFilter:{light:void 0,dark:"contrast(0)"},transclusionBorderColor:{light:"#e38676",dark:h.dark.red[400]},aiBlockBorderColor:{light:h.light.purple[300],dark:h.dark.purple[300]},aiPurpleColor:{light:h.light.purple[400],dark:h.dark.purple[800]},aiMessageBackgroundColor:{light:h.light.purple[50],dark:"#352b3f"},aiMessageTextColor:{light:h.light.purple[400],dark:"#9a6acb"},aiCheckoutColor:{light:"#9D34DA",dark:"#9D34DA"},msDocDiscussionInputPreview:{light:"#29528E",dark:"#29528E"},msExcelDiscussionInputPreview:{light:"#47723E",dark:"#47723E"},pdfDiscussionInputPreview:{light:"#D34F43",dark:"#D34F43"},commentUnreadIndicator:{light:"#CA4B44",dark:"#CA4B44"},invoiceGreen:{light:"#53A83F",dark:"#53A83F"},statusTokenBackground:{light:{green:"rgb(0 150 88 / 6%)",yellow:"rgb(234 197 103 / 25%)",red:"rgb(211 79 67 / 10%)"},dark:{green:"rgb(0 150 88 / 10%)",yellow:"rgb(234 197 103 / 10%)",red:"rgb(211 79 67 / 10%)"}},statusTokenIndicator:{light:{green:"rgb(0 150 88)",yellow:"rgb(234 197 103)",red:"rgb(211 79 67)"},dark:{green:"rgb(0 150 88)",yellow:"rgb(234 197 103)",red:"rgb(211 79 67)"}},findHighlightMatch:{light:{selectedBackground:"rgba(255,205,56,0.9)",unselectedBackground:"rgba(255,205,56,0.4)"},dark:{selectedBackground:"rgba(255,205,56,0.9)",unselectedBackground:"rgba(68,65,55,1)"}},statusTokenText:{light:{green:"#2D7650",yellow:"#CA8E1B",red:"#BE4135"},dark:{green:"#2D7650",yellow:"#CA8E1B",red:"#BE4135"}},guestTokenBackground:{light:"rgba(218, 163, 64, 0.2)",dark:"rgba(218, 163, 64, 0.2)"},marketplaceStarDefault:{light:"rgba(255, 177, 16, 0.3)",dark:(0,o._j)("rgba(255, 177, 16)",.3)},marketplaceStarSelected:{light:"rgb(255, 177, 16)",dark:(0,o._j)("rgb(255, 177, 16)",1)},teamAccessLevelIcons:{light:{blue:"#2383E2",orange:"#F98F2C",red:"#D34F43"},dark:{blue:"#2383E2",orange:"#F98F2C",red:"#D34F43"}},dismissIconFill:{light:h.light.gray[400],dark:h.dark.gray[800]},pill:{light:{background:{yellow:h.light.yellow[30],blue:h.light.uiBlue[50],red:h.light.red[30],white:h.light.gray[30]},border:{yellow:h.light.yellow[50],blue:h.light.uiBlue[100],red:h.light.red[50],white:h.light.gray[75]},icon:{yellow:"rgba(255, 177, 16, 1)",blue:h.light.uiBlue[600],red:h.light.red[500],white:h.light.gray[400]},outline:{yellow:h.light.yellow[100],blue:h.light.uiBlue[200],red:h.light.red[100],white:h.light.gray[75]},hover:{background:{yellow:h.light.yellow[50],blue:h.light.uiBlue[200],red:h.light.red[50],white:"rgba(0, 0, 0, 0.1)"},border:{yellow:h.light.yellow[100],blue:h.light.uiBlue[100],red:h.light.red[100],white:h.light.gray[100]},text:{yellow:h.light.yellow[800],blue:h.light.uiBlue[600],red:h.light.red[500],white:h.light.gray[500]}},pressed:{background:{yellow:h.light.yellow[100],blue:h.light.uiBlue[300],red:h.light.red[100],white:"rgba(0, 0, 0, 0.2)"},border:{yellow:h.light.yellow[100],blue:h.light.uiBlue[100],red:h.light.red[100],white:h.light.gray[200]}},selected:{background:{yellow:h.light.yellow[50],blue:h.light.uiBlue[100],red:h.light.red[50],white:h.light.gray[50]},border:{yellow:"rgba(255, 177, 16, 0.5)",blue:h.light.uiBlue[400],red:h.light.red[300],white:h.light.gray[400]},hover:{background:{yellow:h.light.yellow[100],blue:h.light.uiBlue[200],red:h.light.red[100],white:h.light.gray[100]},border:{yellow:"rgba(255, 177, 16, 0.5)",blue:h.light.uiBlue[400],red:h.light.red[300],white:h.light.gray[400]}},pressed:{background:{yellow:"rgba(252, 226, 171, 1)",blue:h.light.uiBlue[300],red:h.light.red[200],white:h.light.gray[200]},border:{yellow:"rgba(255, 177, 16, 0.5)",blue:h.light.uiBlue[400],red:h.light.red[300],white:h.light.gray[400]}}}},dark:{background:{yellow:h.dark.yellow[50],blue:h.dark.blue[50],red:h.dark.red[50],white:h.dark.gray[100]},border:{yellow:h.dark.yellow[75],blue:h.dark.uiBlue[100],red:h.dark.red[100],white:h.dark.translucentGray[200]},icon:{yellow:"rgba(255, 177, 16, 1)",blue:h.dark.uiBlue[600],red:h.dark.red[800],white:h.dark.gray[600]},outline:{yellow:h.dark.yellow[400],blue:h.dark.uiBlue[400],red:h.dark.red[400],white:h.dark.gray[75]},hover:{background:{yellow:h.dark.yellow[100],blue:h.dark.uiBlue[200],red:h.dark.red[100],white:"rgba(0, 0, 0, 0.1)"},border:{yellow:h.dark.yellow[100],blue:h.dark.uiBlue[100],red:h.dark.red[200],white:h.dark.translucentGray[300]},text:{yellow:h.dark.translucentGray[850],blue:h.dark.uiBlue[600],red:h.dark.red[800],white:h.dark.gray[600]}},pressed:{background:{yellow:h.dark.yellow[200],blue:h.dark.uiBlue[300],red:h.dark.red[200],white:"rgba(0, 0, 0, 0.2)"},border:{yellow:h.dark.yellow[100],blue:h.dark.uiBlue[100],red:h.dark.red[300],white:h.dark.translucentGray[300]}},selected:{background:{yellow:h.dark.yellow[75],blue:h.dark.blue[100],red:h.dark.red[100],white:h.dark.gray[400]},border:{yellow:"rgba(255, 177, 16, 0.5)",blue:h.dark.uiBlue[600],red:h.dark.red[500],white:"rgba(255, 255, 255, 0.18)"},hover:{background:{yellow:h.dark.yellow[100],blue:h.dark.uiBlue[200],red:h.dark.red[200],white:"rgba(0, 0, 0, 0.1)"},border:{yellow:"rgba(255, 177, 16, 0.5)",blue:h.dark.uiBlue[600],red:h.dark.red[500],white:"rgba(255, 255, 255, 0.18)"}},pressed:{background:{yellow:h.dark.yellow[300],blue:h.dark.uiBlue[400],red:h.dark.red[300],white:"rgba(0, 0, 0, 0.2)"},border:{yellow:"rgba(255, 177, 16, 0.5)",blue:h.dark.uiBlue[600],red:h.dark.red[500],white:"rgba(255, 255, 255, 0.18)"}}}}},...i.v,text:{light:{primary:h.light.gray[900],secondary:h.light.gray[500],tertiary:h.light.gray[300],quaternary:h.light.gray[200],uiBluePrimary:h.light.uiBlue[600],uiBlueSecondary:h.light.uiBlue[500],uiBlueTertiary:h.light.uiBlue[400],uiRedPrimary:h.light.red[500],uiRedSecondary:h.light.red[300],uiRedTertiary:h.light.red[200],uiYellowPrimary:h.light.yellow[500],contrast:h.light.gray[0],contrastSecondary:h.light.gray[200],red:h.light.red[800],redTertiary:h.light.red[400],brown:h.light.brown[800],orange:h.light.orange[800],yellow:h.light.yellow[800],green:h.light.green[800],blue:h.light.blue[800],purple:h.light.purple[800],pink:h.light.pink[800]},dark:{primary:h.dark.gray[850],secondary:h.dark.gray[600],tertiary:h.dark.gray[500],quaternary:h.dark.translucentGray[400],uiBluePrimary:h.dark.uiBlue[600],uiBlueSecondary:h.dark.uiBlue[500],uiBlueTertiary:h.dark.uiBlue[400],uiRedPrimary:h.dark.red[800],uiRedSecondary:h.dark.red[600],uiRedTertiary:h.dark.red[500],uiYellowPrimary:h.dark.yellow[800],contrast:h.dark.gray[900],contrastSecondary:h.light.gray[200],red:h.dark.translucentGray[850],redTertiary:h.dark.red[700],brown:h.dark.translucentGray[850],orange:h.dark.translucentGray[850],yellow:h.dark.translucentGray[850],green:h.dark.translucentGray[850],blue:h.dark.translucentGray[850],purple:h.dark.translucentGray[850],pink:h.dark.translucentGray[850]}},icon:{light:{primary:h.light.gray[800],secondary:h.light.gray[400],tertiary:h.light.gray[200],quaternary:h.light.gray[100],contrast:h.light.gray[0],uiBluePrimary:h.light.uiBlue[600],uiBlueSecondary:h.light.uiBlue[500],uiBlueTertiary:h.light.uiBlue[400],uiRedPrimary:h.light.red[500],uiRedSecondary:h.light.red[300],uiRedTertiary:h.light.red[200],uiYellowPrimary:h.light.yellow[500],uiYellowSecondary:h.light.yellow[200],uiGreenTertiary:h.light.green[400],red:h.light.red[500],orange:h.light.orange[500],yellow:h.light.yellow[500],green:h.light.green[500],blue:h.light.blue[500],purple:h.light.purple[500],pink:h.light.pink[500],brown:h.light.brown[500]},dark:{primary:h.dark.translucentGray[800],secondary:h.dark.translucentGray[600],tertiary:h.dark.translucentGray[500],quaternary:h.dark.translucentGray[400],uiBluePrimary:h.dark.uiBlue[600],uiBlueSecondary:h.dark.uiBlue[500],uiBlueTertiary:h.dark.uiBlue[400],uiRedPrimary:h.dark.red[800],uiRedSecondary:h.dark.red[600],uiRedTertiary:h.dark.red[400],contrast:h.dark.gray[900],uiYellowPrimary:h.dark.yellow[800],uiYellowSecondary:h.dark.yellow[400],uiGreenTertiary:h.dark.green[400],red:h.dark.red[800],brown:h.dark.brown[800],orange:h.dark.orange[800],yellow:h.dark.yellow[800],green:h.dark.green[800],blue:h.dark.blue[800],purple:h.dark.purple[800],pink:h.dark.pink[800]}},surface:{light:{page:h.light.gray[0],wash:h.light.gray[30],elevated:h.light.gray[0],dark:h.light.gray[900]},dark:{page:h.dark.gray[50],wash:h.dark.gray[100],elevated:h.dark.gray[200],dark:h.dark.gray[200]}},fill:{light:{uiBlue:h.light.uiBlue[600],uiRed:h.light.red[500],lightGray:h.light.gray[50],gray:h.light.gray[100],red:h.light.red[100],brown:h.light.brown[100],orange:h.light.orange[50],yellow:h.light.yellow[50],green:h.light.green[100],blue:h.light.blue[50],purple:h.light.purple[100],pink:h.light.pink[100]},dark:{uiBlue:h.dark.uiBlue[600],uiRed:h.dark.red[700],lightGray:h.dark.gray[400],gray:h.dark.gray[500],red:h.dark.red[300],brown:h.dark.brown[300],orange:h.dark.orange[300],yellow:h.dark.yellow[300],green:h.dark.green[300],blue:h.dark.blue[300],purple:h.dark.purple[300],pink:h.dark.pink[300]}},tint:{light:{regular:h.light.gray[75],uiBlue:h.light.uiBlue[100],uiBlueHover:h.light.uiBlue[200],uiBluePressed:h.light.uiBlue[300],uiRed:h.light.red[50],uiRedHover:h.light.red[50],uiRedPressed:h.light.red[100],uiYellow:h.light.yellow[30],uiYellowHover:h.light.yellow[50],uiYellowPressed:h.light.yellow[100]},dark:{regular:h.dark.translucentGray[200],uiBlue:h.dark.uiBlue[100],uiBlueHover:h.dark.uiBlue[200],uiBluePressed:h.light.uiBlue[300],uiRed:h.dark.red[100],uiRedHover:h.dark.red[100],uiRedPressed:h.dark.red[200],uiYellow:h.dark.yellow[100],uiYellowHover:h.dark.yellow[200],uiYellowPressed:h.dark.yellow[300]}},state:{light:{hover:(0,o.Fq)(c.light.darkgray,.04),pressed:(0,o.Fq)(c.light.darkgray,.1)},dark:{hover:(0,o.Fq)(f.white,.055),pressed:(0,o.Fq)(f.white,.13)}},stroke:{light:{deemphasized:h.light.gray[75],regular:h.light.gray[100],input:f.blackWithAlpha(.15),uiBlue:h.light.uiBlue[600],uiBlueDeemphasized:h.light.uiBlue[400],uiRed:h.light.red[300],uiRedDeemphasized:h.light.red[300],contrast:h.light.gray[0]},dark:{deemphasized:h.dark.translucentGray[200],regular:h.dark.translucentGray[400],input:f.whiteWithAlpha(.2),uiBlue:h.dark.uiBlue[600],uiBlueDeemphasized:h.dark.uiBlue[400],uiRed:h.dark.red[800],uiRedDeemphasized:h.dark.red[300],contrast:h.dark.gray[900]}},glass:{light:{wash:h.light.washGlass[0],page:h.light.pageGlass[0]},dark:{wash:h.dark.washGlass[0],page:h.dark.pageGlass[0]}},lightBlueBannerBackground:{light:"rgba(35, 131, 226, 0.07)",dark:"rgba(35, 131, 226, 0.07)"},lightGrayBannerBackground:{light:h.light.gray[30],dark:h.light.gray[800]},cropMaskOpacity:{light:"0.5",dark:"0.5"},createPageButtonBackground:{light:f.white,dark:h.dark.translucentGray[200]},performanceToolbarIndicator:{light:{green:"rgba(0, 150, 88, 0.5)",red:"rgba(211, 79, 67, 0.5)"},dark:{green:"rgba(0, 150, 88, 0.5)",red:"rgba(211, 79, 67, 0.5)"}}},n={};for(const[o,r]of(0,a.qP)(t))n[o]=r[e.theme];return n}const b=new Map;function _(e){const t=`${e.theme}`,n=b.get(t);if(n)return n;{const n=y(e);return b.set(t,n),n}}const S=["default","gray","brown","orange","yellow","teal","blue","purple","pink","red","default_background","gray_background","brown_background","orange_background","yellow_background","teal_background","blue_background","purple_background","pink_background","red_background"];function k(e){switch(e){case"default":case"gray":case"brown":case"orange":case"yellow":case"teal":case"blue":case"purple":case"pink":case"red":case"default_background":case"gray_background":case"brown_background":case"orange_background":case"yellow_background":case"teal_background":case"blue_background":case"purple_background":case"pink_background":case"red_background":return!0;default:return!1}}const w=S.filter((e=>-1===e.indexOf("background"))),x=S.filter((e=>-1!==e.indexOf("background"))),I=["default","gray","brown","orange","yellow","green","blue","purple","pink","red"],C={comment:(0,o.Vi)({r:255,g:203,b:0}),update:(0,o.Vi)({r:35,g:131,b:226}),remove:(0,o.Vi)({r:120,g:119,b:116})},T={comment:{light:.8,dark:.8},update:{light:.4,dark:.6},remove:{light:.4,dark:.6}},M={comment:{background:.15,underline:.4375},update:{underline:.25,background:.09},remove:{underline:.25,background:.09}},P=r.HP((e=>{const{annotationType:t,type:n,selected:r,hovered:i,overlapping:a,mode:s}=e,l=C[t],c=T[t][s],d=M[t][n],u=1.25*c,p=(i||r?"underline"===n?3:1:0)+(a?2:0);return(0,o.HI)(l.alpha(Math.min(c*d*(1+p),u)))}),(e=>r.VO(e).join("_")));function A(e){let{level:t,selected:n,hovered:o,mode:r}=e;return P({annotationType:"comment",type:"background",selected:n??!1,hovered:o??!1,overlapping:t>1,mode:r})}function R(e){let{level:t,selected:n,hovered:o,mode:r}=e;return P({annotationType:"comment",type:"underline",selected:n??!1,hovered:o??!1,overlapping:t>1,mode:r})}const D=r.HP((e=>(0,o.HI)(C.comment.alpha(.8*T.comment[e]))));function B(){return _({theme:"light"})}function E(e,t){const n=(0,a.Yd)(t).map((n=>{const r=t[n];try{return{name:n,distance:(0,o.Vi)(e).delta(r)}}catch(i){return{name:n,distance:360}}}));return r.F(n,(e=>{let{distance:t}=e;return t})).name}function F(e){const t={};for(const n of I){const e=L(_({theme:"light"}),n);t[n]=e.backgroundColor}return E(e,t)}function Z(e){const t={},n=_({theme:"light"});for(const[a,s]of Object.entries(n.accentColors))for(const[e,n]of Object.entries(s))t[`${a}:${e}`]=n;const o=E(e,t),[r,i]=o.split(":");return{colorName:r,shade:parseInt(i)}}function U(e){const t=e.map((e=>(0,o.Vi)(e))).reverse();let n=t.shift();if(!n)return"red";for(const o of t){const e=o.alpha(),t=n.alpha();if(1===e){n=o;continue}const r=Math.min(e+t,1),i=e/t;n=n.alpha(1).mix(o.alpha(1),i).alpha(r)}return(0,o.HI)(n)}function V(e){if(!e)return;const t=e.split(/\(|\)/);if(3!==t.length)return;const n=t[1].split(/(?:,| )+/),o="rgb"===t[0]&&3===n.length,r="rgba"===t[0]&&4===n.length;if(!o&&!r)return;const i=Number(n[0]),a=Number(n[1]),s=Number(n[2]);let l=`#${N(i)}${N(a)}${N(s)}`,c=255;return r&&(c=Math.round(255*Number(n[3]))),l=l.concat(N(c)),l.toUpperCase()}function N(e){let t=e.toString(16);return 1===t.length&&(t="0".concat(t)),t}function O(e,t){return t&&"default"!==t?e.accentColors[t]:e.selectLightGray}function L(e,t){const n=O(e,t);return"dark"===e.mode?{textColor:"rgba(255, 255, 255, 0.805)",backgroundColor:"gray"===t?n[500]:n[400],menuBackgroundColor:"gray"===t?n[500]:n[400]}:{textColor:n[800],backgroundColor:n[100],menuBackgroundColor:n[100]}}const j={colorful:["rgba(45, 152, 234, 1)","rgba(231, 181, 51, 1)","rgba(97, 189, 142, 1)","rgba(165, 121, 217, 1)","rgba(234, 139, 66, 1)","rgba(222, 101, 165, 1)","rgba(0, 181, 208, 1)","rgba(224, 94, 88, 1)"],white:["rgba(227, 226, 224, 1)","rgba(227, 226, 224, .7)","rgba(227, 226, 224, .5)","rgba(227, 226, 224, .3)","rgba(227, 226, 224, .15)"],black:["rgba(98, 97, 93, 1)","rgba(98, 97, 93, .7)","rgba(98, 97, 93, .5)","rgba(98, 97, 93, .3)","rgba(98, 97, 93, .15)"],blue:["rgba(45, 152, 234, 1)","rgba(45, 152, 234, .7)","rgba(45, 152, 234, .5)","rgba(45, 152, 234, .3)","rgba(45, 152, 234, .15)"],yellow:["rgba(231, 181, 51, 1)","rgba(231, 181, 51, .7)","rgba(231, 181, 51, .5)","rgba(231, 181, 51, .3)","rgba(231, 181, 51, .15)"],green:["rgba(97, 189, 142, 1)","rgba(97, 189, 142, .7)","rgba(97, 189, 142, .5)","rgba(97, 189, 142, .3)","rgba(97, 189, 142, .15)"],purple:["rgba(165, 121, 217, 1)","rgba(165, 121, 217, .7)","rgba(165, 121, 217, .5)","rgba(165, 121, 217, .3)","rgba(165, 121, 217, .15)"],teal:["rgba(0, 181, 208, 1)","rgba(0, 181, 208, .7)","rgba(0, 181, 208, .5)","rgba(0, 181, 208, .3)","rgba(0, 181, 208, .15)"],orange:["rgba(234, 139, 66, 1)","rgba(234, 139, 66, .7)","rgba(234, 139, 66, .5)","rgba(234, 139, 66, .3)","rgba(234, 139, 66, .15)"],pink:["rgba(222, 101, 165, 1)","rgba(222, 101, 165, .7)","rgba(222, 101, 165, .5)","rgba(222, 101, 165, .3)","rgba(222, 101, 165, .15)"],red:["rgba(224, 94, 88, 1)","rgba(224, 94, 88, .7)","rgba(224, 94, 88, .5)","rgba(224, 94, 88, .3)","rgba(224, 94, 88, .15)"],brown:["rgba(190, 140, 105, 1)","rgba(190, 140, 105, .7)","rgba(190, 140, 105, .5)","rgba(190, 140, 105, .3)","rgba(190, 140, 105, .15)"],gray:["rgba(199, 198, 196, 1)"],default:["rgba(227, 226, 224, 1)"],translucentGray:["rgba(241, 241, 239, 1)","rgba(255, 255, 255, .1)"]};function K(e,t){const n=O(e,t),o=!t||"default"===t,r={light:n[400],dark:o||"gray"===t?n[600]:n[500]},i={light:n[30],dark:o?75 in n?n[75]:"":"gray"===t?n[100]:n[50]},a={light:n[30],dark:"gray"===t?"rgba(255, 255, 255, 0.03)":75 in n?n[75]:""},s={light:void 0,dark:o||"gray"===t?n[300]:n[200]},l={light:void 0,dark:o||"gray"===t?n[400]:n[300]},c={light:void 0,dark:o||"gray"===t?n[300]:n[200]};var d,u,p,m;return"dark"===e.mode?{textColor:r.dark,backgroundColor:i.dark,peekBackgroundColor:a.dark,cardBackgroundColor:s.dark,cardHoveredBackgroundColor:l.dark,cardPressedBackgroundColor:c.dark,chartColor:t?null===(d=j[t])||void 0===d?void 0:d[0]:null===(u=j.default)||void 0===u?void 0:u[0]}:{textColor:r.light,backgroundColor:i.light,peekBackgroundColor:a.light,cardBackgroundColor:s.light,cardHoveredBackgroundColor:l.light,cardPressedBackgroundColor:c.light,chartColor:t?null===(p=j[t])||void 0===p?void 0:p[0]:null===(m=j.default)||void 0===m?void 0:m[0]}}const z={default:void 0,gray:"gray",brown:"brown",orange:"orange",yellow:"yellow",teal:"green",blue:"blue",purple:"purple",pink:"pink",red:"red",default_background:void 0,gray_background:"gray",brown_background:"brown",orange_background:"orange",yellow_background:"yellow",teal_background:"green",blue_background:"blue",purple_background:"purple",pink_background:"pink",red_background:"red"};function q(e){return e.includes("_background")}const H={background:{light:50,lightHovered:100,lightPressed:200,dark:300,darkHovered:400,darkPressed:500},text:{light:500,lightHovered:50,lightPressed:100,dark:900,darkHovered:100,darkPressed:200,darkGray:700}};function G(e,t){if("default"===e)return{color:"inherit",fill:"inherit"};const n=z[e];if(!n)return{color:"inherit",fill:"inherit"};const o=t.accentColors[n],r={light:o[H.background.light],dark:o[H.background.dark]},i={light:o[H.text.light],dark:"gray"===e?o[H.text.darkGray]:o[H.text.dark]};return q(e)?{background:"dark"===t.mode?r.dark:r.light}:{color:"dark"===t.mode?i.dark:i.light,fill:"dark"===t.mode?i.dark:i.light}}function W(e,t){const n=w.filter((e=>"default"!==e));let o=0;for(let r=0;r<e.length;r++)o+=e.charCodeAt(r);o%=n.length;return G(n[o],t).color||t.regularTextColor}function $(e,t){if("default"===e)return{color:"inherit",fill:"inherit",hoveredBackground:t.whiteButtonHoveredBackground,pressedBackground:t.whiteButtonPressedBackground};const n=z[e];if(!n)return{color:"inherit",fill:"inherit"};const o=t.accentColors[n],r=G(e,t),i={lightHovered:o[H.background.lightHovered],lightPressed:o[H.background.lightPressed],darkHovered:o[H.background.darkHovered],darkPressed:o[H.background.darkPressed]},a={lightHovered:o[H.text.lightHovered],lightPressed:o[H.text.lightPressed],darkHovered:o[H.text.darkHovered],darkPressed:o[H.text.darkPressed]};return q(e)?{background:r.background,hoveredBackground:"dark"===t.mode?i.darkHovered:i.lightHovered,pressedBackground:"dark"===t.mode?i.darkPressed:i.lightPressed}:{color:r.color,fill:r.fill,hoveredBackground:"dark"===t.mode?a.darkHovered:a.lightHovered,pressedBackground:"dark"===t.mode?a.darkPressed:a.lightPressed}}function Y(e,t){if("default"===e)return{color:t.regularTextColor};const n=z[e];if(!n)return{color:t.regularTextColor};const o=t.accentColors[n],r={light:o[50],dark:"gray_background"===e?o[200]:o[100]},i={light:o[500],dark:"gray"===e?o[800]:o[900]};return q(e)?{background:"dark"===t.mode?r.dark:r.light}:{color:"dark"===t.mode?i.dark:i.light,fill:"dark"===t.mode?i.dark:i.light}}function Q(e,t){return"default"===e||"default_background"===e?{color:t.regularTextColor}:G(e,t)}function J(e,t){return{color:e[t.mode],fill:e[t.mode]}}const X=f},296902:(e,t,n)=>{n.d(t,{Z:()=>i,v:()=>s});var o=n(997466);function r(){return`rgba(84, 70, 35, ${arguments.length>0&&void 0!==arguments[0]?arguments[0]:1})`}const i={frontDesktopChromeHairline:"rgba(255, 255, 255, 0.5) 0px 0px 0px 1px",frontMediumShadow:`0 2px 8px ${r(.15)}, 0 1px 3px ${r(.15)}`,frontDeepShadow:`0 6px 20px ${r(.3)}`,frontInputShadow:"rgba(15, 15, 15, 0.1) 0px 0px 0px 1px inset",frontImageFilterDropShadow:"drop-shadow(rgba(84, 70, 35, 0.3) 0px 6px 20px)",frontImageSmallFilterDropShadow:"drop-shadow(rgba(84, 70, 35, 0.3) 0px 3px 10px)",frontCardShadow:"\n\t\t0px 4px 8px rgba(0, 0, 0, 0.04),\n\t\t0px 0px 2px rgba(0, 0, 0, 0.06),\n\t\t0px 0px 1px rgba(0, 0, 0, 0.04)\n\t",frontDialogShadow:l({elevation:5,color:(0,o.Vi)("rgb(15, 15, 15)"),opacity:.1})},a={light:(0,o.Vi)("rgb(15, 15, 15)"),dark:(0,o.Vi)("rgb(15, 15, 15)")},s={shadowColor:{light:a.light,dark:a.dark},shadowOpacity:{light:.1,dark:.2},lightBoxShadow:{light:l({elevation:2,color:a.light,opacity:.1}),dark:l({elevation:2,color:a.dark,opacity:.2})},buttonGroupShadow:{light:l({elevation:2,color:a.light,opacity:.1}),dark:l({elevation:1,color:(0,o.Vi)("rgb(255,255,255)"),opacity:.13})},aiEditCardDropShadow:{light:"0px 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 0px 6px 0px rgba(0, 0, 0, 0.02), 0px 2px 4px 0px rgba(0, 0, 0, 0.04)",dark:l({elevation:1,color:(0,o.Vi)("rgb(255,255,255)"),opacity:.07})},aiBarShadow:{light:"0px 16px 24px 0px rgba(0, 0, 0, 0.07), 0px 2px 6px 0px rgba(0, 0, 0, 0.1), 0px 0px 1px 0px rgba(0, 0, 0, 0.1)",dark:l({elevation:1,color:(0,o.Vi)("rgb(255,255,255)"),opacity:.07})},mediumBoxShadow:{light:l({elevation:3,color:a.light,opacity:.1}),dark:l({elevation:3,color:a.dark,opacity:.2})},selectTypeBoardBoxShadow:{light:l({elevation:2,color:a.light,opacity:.05}),dark:l({elevation:2,color:a.dark,opacity:.1})},upCaretDropShadow:{light:"drop-shadow(rgba(15, 15, 15, 0.1) 0px 1px 0px)",dark:"drop-shadow(rgba(15, 15, 15, 0.2) 0px 1px 0px)"},downCaretDropShadow:{light:"drop-shadow(0px 4px 2px rgba(15, 15, 15, 0.1))",dark:"drop-shadow(0px 4px 2px rgba(15, 15, 15, 0.2))"},horizontalCaretDropShadow:{light:"drop-shadow(rgba(15, 15, 15, 0.1) -2px 0px 1px)",dark:"drop-shadow(rgba(15, 15, 15, 0.1) -2px 0px 1px)"},bottomActionBarShadow:{light:`0 -1px 0 1px ${(0,o.Fq)(a.light,.05)}, 0 -3px 6px ${(0,o.Fq)(a.light,.1)}`,dark:`0 -1px 0 1px ${(0,o.Fq)(a.dark,.05)}, 0 -3px 6px ${(0,o.Fq)(a.light,.1)}`},dictationBubbleBoxShadow:{light:l({elevation:1,color:a.light,opacity:.1}),dark:l({elevation:1,color:a.dark,opacity:.2})},talkingDictationBubbleBoxShadow:{light:l({elevation:2.01,color:a.light,opacity:.1}),dark:l({elevation:2.01,color:a.dark,opacity:.2})},lightMediumElevationBoxShadow:{light:"0px 0px 0px 1px rgba(227, 226, 224, 0.50), 0px 2px 4px -1px rgba(0, 0, 0, 0.06), 0px 12px 32px -6px rgba(0, 0, 0, 0.12)",dark:" 0px 0px 0px 1px  rgba(255, 255, 255, 0.05), 0px 2px 4px -1px rgba(0, 0, 0, 0.06), 0px 12px 32px -6px rgba(0, 0, 0, 0.12)"},largeBoxShadow:{light:l({elevation:5,color:a.light,opacity:.1}),dark:l({elevation:5,color:a.dark,opacity:.2})},largeLightBoxShadow:{light:"rgba(15, 15, 15, 0.04) 0px 0px 0px 1px, rgba(15, 15, 15, 0.03) 0px 3px 6px, rgba(15, 15, 15, 0.06) 0px 9px 24px",dark:l({elevation:3,color:a.dark,opacity:.1})},buttonBoxShadow:{light:`inset 0 0 0 1px ${(0,o.Fq)(a.light,.1)}, 0 1px 2px ${(0,o.Fq)(a.light,.1)}`,dark:`inset 0 0 0 1px ${(0,o.Fq)(a.dark,.2)}, 0 1px 2px ${(0,o.Fq)(a.dark,.1)}`},timelineTableBoxShadow:{light:`0 0 8px 0 ${(0,o.Fq)(a.light,.03)}`,dark:`0 0 8px 0 ${(0,o.Fq)(a.dark,.03)}`},plainButtonBoxShadow:{light:`0 0 0 1px ${(0,o.Fq)(a.light,.1)}`,dark:"0 0 0 1px rgba(255,255,255,0.1)"},elevatedButtonBoxShadow:{light:`inset 0 0 0 1px ${(0,o.Fq)(a.light,.15)}, 0 2px 4px ${(0,o.Fq)(a.light,.07)}`,dark:`inset 0 0 0 1px ${(0,o.Fq)(a.dark,.2)}, 0 2px 4px ${(0,o.Fq)(a.dark,.1)}`},borderBoxShadow:{light:`0 0 0 1px ${(0,o.Fq)(a.light,.1)}`,dark:`0 0 0 1px ${(0,o.Fq)(a.dark,.2)}`},innerBorderBoxShadow:{light:`inset 0 0 0 1px ${(0,o.Fq)(a.light,.1)}`,dark:'inset 0 0 0 1px "rgba(255, 255, 255, 0.055)"'},avatarBoxShadow:{light:"0 2px 4px rgba(15, 15, 15, 0.1)",dark:"0 2px 4px rgba(15, 15, 15, 0.2)"},inputBoxShadow:{light:l({elevation:1,color:a.light,opacity:.1,inner:!0}),dark:"rgba(255, 255, 255, 0.075) 0 0 0 1px inset"},focusedShadow:{light:"rgba(35, 131, 226, 0.57) 0px 0px 0px 1px inset, rgba(35, 131, 226, 0.35) 0px 0px 0px 2px",dark:"rgba(35, 131, 226, 0.57) 0px 0px 0px 1px inset, rgba(35, 131, 226, 0.35) 0px 0px 0px 2px"},outlineRedInputBoxShadow:{light:"\n\t\t\trgba(235, 87, 87, 0.7) 0px 0px 0px 1px inset,\n\t\t\trgba(235, 87, 87, 0.4) 0px 0px 0px 2px\n\t\t",dark:"\n\t\t\trgba(235, 87, 87, 0.7) 0px 0px 0px 1px inset,\n\t\t\trgba(235, 87, 87, 0.4) 0px 0px 0px 2px\n\t\t"},outlineBlueInputBoxShadow:{light:"\n\t\t\trgba(35, 131, 226, 0.57) 0px 0px 0px 1px inset,\n\t\t\trgba(35, 131, 226, 0.35) 0px 0px 0px 2px\n\t  ",dark:"\n\t\trgba(35, 131, 226, 0.57) 0px 0px 0px 1px inset,\n\t\trgba(35, 131, 226, 0.35) 0px 0px 0px 2px\n\t  "},outlineThinBlueInputBoxShadow:{light:"\n\t\t\trgba(35, 131, 226, 0.57) 0px 0px 0px 1px inset,\n\t\t\trgba(35, 131, 226, 0.35) 0px 0px 0px 1px\n\t  ",dark:"\n\t\trgba(35, 131, 226, 0.57) 0px 0px 0px 1px inset,\n\t\trgba(35, 131, 226, 0.35) 0px 0px 0px 1px\n\t  "},collectionTableOutlineBlueInputBoxShadow:{light:"\n\t\t\trgba(35, 131, 226, 0.57) 0px 0px 0px 2px inset,\n\t\t\trgba(35, 131, 226, 0.35) 0px 0px 0px 1px inset\n\t  ",dark:"\n\t\trgba(35, 131, 226, 0.57) 0px 0px 0px 2px inset,\n\t\trgba(35, 131, 226, 0.35) 0px 0px 0px 1px inset\n\t  "},collectionTableOutlineUltraThinBlueInputBoxShadow:{light:"\n\t\t\trgba(35, 131, 226, 0.35) 0px 0px 0px 1px inset,\n\t\t\trgba(35, 131, 226, 0.3) 0px 0px 0px 1.5px inset\n\t  ",dark:"\n\t\trgba(35, 131, 226, 0.35) 0px 0px 0px 1px inset,\n\t\trgba(35, 131, 226, 0.3) 0px 0px 0px 1.5px inset\n\t  "},sidebarResizerBoxShadow:{light:"inset -2px 0px 0px 0px rgba(0, 0, 0, 0.1)",dark:"inset -2px 0px 0px 0px rgba(255, 255, 255, 0.1)"},sidebarBoxShadow:{light:"inset -1px 0px 0px 0px rgba(0, 0, 0, 0.025)",dark:"inset -1px 0px 0px 0px rgba(255, 255, 255, 0.05)"},secondarySidebarResizerBoxShadow:{light:"inset -2px 0px 0px 0px rgb(229, 229, 229)",dark:"inset -2px 0px 0px 0px rgb(26, 26, 26)"},secondarySidebarBoxShadow:{light:"inset -1px 0px 0px 0px rgb(249, 249, 249)",dark:"inset -1px 0px 0px 0px rgba(13, 13, 13)"},buttonDivider:{light:"inset -1px 0px 0px 0px rgba(0, 0, 0, 0.1)",dark:"inset -1px 0px 0px 0px rgba(255, 255, 255, 0.1)"},topbarAndroidShadow:{light:"\n\t\t\trgba(15, 15, 15, 0.1) 0px 2px 4px,\n\t\t\trgba(15, 15, 15, 0.15) 0px 2px 8px\n\t\t",dark:"\n\t\t\trgba(15, 15, 15, 0.2) 0px 2px 4px,\n\t\t\trgba(15, 15, 15, 0.3) 0px 2px 8px\n\t\t"},topbarAndroidShadowCollapsed:{light:"\n\t\t\trgba(15, 15, 15, 0.1) 0px 1px 0px,\n\t\t\ttransparent 0px 0px 0px\n\t\t",dark:"\n\t\t\trgba(15, 15, 15, 0.2) 0px 1px 0px,\n\t\t\ttransparent 0px 0px 0px\n\t\t"},marginDiscussionSelectedShadow:{light:"rgb(15 15 15 / 4%) 0px 0px 0px 1px, rgb(15 15 15 / 4%) 0px 3px 2px, rgb(15 15 15 / 8%) 0px 3px 9px",dark:"rgb(15 15 15 / 4%) 0px 0px 0px 1px, rgb(15 15 15 / 12%) 0px 3px 3px, rgb(15 15 15 / 24%) 0px 3px 9px"},homeScrollButtonShadow:{light:l({elevation:2,color:a.light,opacity:.1}),dark:l({elevation:2,color:a.dark,opacity:.2})},homeShadow:{light:{card:{base:l({inner:!1,elevation:1,color:"black",opacity:.05}),hovered:l({inner:!1,elevation:1,color:"black",opacity:.1})},templateCard:{base:l({inner:!1,elevation:1,color:"black",opacity:.06}),hovered:l({inner:!1,elevation:1,color:"black",opacity:.12})}},dark:{card:{base:"unset",hovered:l({inner:!0,elevation:1,color:"white",opacity:.05})},templateCard:{base:"unset",hovered:l({inner:!0,elevation:1,color:"white",opacity:.05})}}},sitesTopbarRoleActionsPreview:{light:"0px 51px 80px 0px rgba(0,0,0,0.06),0px 27.955px 31.135px 0px rgba(0,0,0,0.04), 0px 4.43px 15.223px 0px rgba(0,0,0,0.04), 0px 9.449px 8.335px 0px rgba(0,0,0,0.03), 0px 4.922px 4.557px 0px rgba(0,0,0,0.02), 0px 1.933px 2.025px 0px rgba(0,0,0,0.02)",dark:"0px 20px 48px -8px rgba(0, 0, 0, 0.48)"},siteBuilderPagePreview:{light:"0px 12px 36px -6px rgba(29, 27, 22, 0.08)",dark:"0px 12px 36px -6px rgba(0, 0, 0, 0.32)"},sitePublishPagePreview:{light:"0px 5px 16px 0px rgba(0, 0, 0, 0.04)",dark:"0px 5px 16px 0px rgba(0, 0, 0, 0.04)"},sharePreviewImageActions:{light:"0px 12px 36px -6px rgba(29, 27, 22, 0.08)",dark:"0px 12px 36px -6px rgba(0, 0, 0, 0.32)"}};function l(e){let{elevation:t,color:n=(0,o.Vi)({h:0,s:1,l:7}),opacity:r=.1,inner:i=!1}=e;const a=i?"inset":"";switch(t){case 1:return`\n\t\t\t\t\t${a} 0 0 0 1px ${(0,o.Fq)(n,r)}\n\t\t\t\t`;case 2:return`\n\t\t\t\t\t${a} 0 0 0 1px ${(0,o.Fq)(n,r)},\n\t\t\t\t\t${a} 0 2px 4px ${(0,o.Fq)(n,r)}\n\t\t\t\t`;default:return`\n\t\t\t\t\t${a} 0 0 0 1px ${(0,o.Fq)(n,r/2)},\n\t\t\t\t\t${a} 0 ${1*t}px ${2*t}px ${(0,o.Fq)(n,r)},\n\t\t\t\t\t${a} 0 ${3*t}px ${8*t}px ${(0,o.Fq)(n,2*r)}\n\t\t\t\t`}}},799757:(e,t,n)=>{function o(e){try{return String(JSON.stringify(e,((e,t)=>t instanceof Map?Object.fromEntries(t):"bigint"==typeof t?t.toString():"symbol"==typeof t?t.description:t)))}catch{return"Unable to serialize your whatever it is. Sorry."}}n.d(t,{P:()=>o})},250202:(e,t,n)=>{n.d(t,{kB:()=>d});n(21703);var o=n(401898),r=n(619584),i=n(212847);const a=Symbol("JSON Schema"),s=Symbol("JSON Schema Components"),l=Symbol("No JSON Schema"),c={isNull:()=>({type:"null",[s]:{}}),boolean:()=>({type:"boolean",[s]:{}}),number:()=>({type:"number",[s]:{}}),integer:()=>({type:"integer",[s]:{}}),string:()=>({type:"string",[s]:{}}),dateString:()=>({type:"string",format:"date",[s]:{}}),literal:e=>({enum:[e],[s]:{}}),literals:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{enum:t,[s]:{}}},uuid:()=>({type:"string",format:"uuid",[s]:{}}),uuidWithoutDashes:()=>({type:"string",format:"uuid",[s]:{}}),any:()=>u,array:e=>({type:"array",items:e[a],[s]:e[a][s]}),tuple:e=>({type:"tuple",items:!1,prefixItems:e.map((e=>e[a])).filter((e=>e!==l)),[s]:Object.assign({},...e.map((e=>e[a][s])))}),record:(e,t)=>({type:"object",additionalProperties:t[a],[s]:t[a][s]}),object:e=>{let{required:t,optional:n,exact:o}=e;return{type:"object",properties:(0,r.m8)(Object.entries({...t,...n}).filter((e=>{let[t,n]=e;return n[a]!==l})).map((e=>{let[t,n]=e;return[t,n[a]]}))),...o&&{additionalProperties:!1},...Object.keys(t).length>0&&{required:Object.keys(t)},[s]:Object.assign({},...Object.values({...t,...n}).map((e=>e[a][s])))}},union:e=>({anyOf:e.map((e=>e[a])).filter((e=>e!==l)),[s]:Object.assign({},...e.map((e=>e[a][s])))}),gte:(e,t)=>{const n=e[a];return n!==l?{...n,minimum:t}:n},lte:(e,t)=>{const n=e[a];return n!==l?{...n,maximum:t}:n},maxLength:(e,t)=>{const n=e[a];if(n===l)return n;if("type"in n){if("string"===n.type)return{...n,maxLength:t};if("array"===n.type)return{...n,maxItems:t}}throw new Error("Unknown type for max length.")},minLength:(e,t)=>{const n=e[a];if(n===l)return n;if("type"in n){if("string"===n.type)return{...n,minLength:t};if("array"===n.type)return{...n,minItems:t}}throw new Error("Unknown type for min length.")},nonEmpty:e=>{const t=e[a];if(t===l)return t;if("type"in t){if("string"===t.type)return{...t,minLength:1};if("object"===t.type)return{...t,minProperties:1};if("array"===t.type)return{...t,minItems:1}}throw new Error("Unknown non-emptyable type.")},nullable:e=>{const t=e[a];if(t===l)return t;if("type"in t)if(Array.isArray(t.type)){if("null"===t.type[1])return t;(0,o.t1)(t.type[1])}else{if("string"===t.type)return{...t,type:[t.type,"null"]};if("object"===t.type)return{...t,type:[t.type,"null"]};if("array"===t.type)return{...t,type:[t.type,"null"]};if("tuple"===t.type)return{...t,type:[t.type,"null"]};if("boolean"===t.type)return{...t,type:[t.type,"null"]};if("integer"===t.type)return{...t,type:[t.type,"null"]};if("number"===t.type)return{...t,type:[t.type,"null"]};if("null"===t.type)return t;(0,o.t1)(t.type)}else{if("const"in t)return{...t,enum:[t.const,null]};if("enum"in t)return{...t,enum:[...t.enum,null]};if("anyOf"in t)return{...t,anyOf:t.anyOf.map((e=>c.nullable({[a]:e})))};if("$ref"in t)return{anyOf:[t,{type:"null"}],[s]:t[s]};if(n=t,(0,o.Kn)(n)&&0===Object.keys(n).length)return t;(0,o.t1)(t)}var n}},d=(0,r.m8)(Object.entries(c).map((e=>{let[t,n]=e;return[t,function(){for(var e=arguments.length,r=new Array(e),l=0;l<e;l++)r[l]=arguments[l];return 1===r.length&&(0,o.Kn)(r[0])&&("id"in r[0]||"description"in r[0])?function(){const{description:e,examples:o,id:l}=r[0];let c={description:e,...o&&{examples:o},...n(...arguments)};return l&&(c={$ref:`#/components/schemas/${l}`,[s]:{...c[s],[l]:c}}),{[a]:c,...i[t](...arguments)}}:{[a]:n(...r),...i[t](...r)}}]})));Symbol("Exact empty object ({})"),d.object({id:"emptyObject"})({required:{},optional:{},exact:!0});const u={}},840376:(e,t,n)=>{n.d(t,{u:()=>l});n(757658);var o=n(530615),r=n(653965),i=n(261158),a=n(849772);let s;s=Symbol.iterator;class l{constructor(){this.unique=new Map,this.multi=new o.G((()=>new i.Z))}static fromArray(e){const t=new this;for(const n of e)(0,a.Pb)(n)?t.add(n):(0,a.J7)(n)!==a.Mc.Highlight&&(0,a.J7)(n)!==a.Mc.TemporaryHighlight&&t.unique.has((0,a.gO)(n))||t.add(n);return t}static normalize(e){return this.fromArray(e).toArray()}static compareByGroupingKey(e,t){let[n,o]=e,[r,i]=t;return n===r?0:n<r?-1:1}*[s](){for(const e of this.getUniqueAnnotations())yield e;for(const[,e]of this.getMultiInstanceAnnotations())for(const t of e)yield t}toArray(){return Array(...this)}findFirstOfGroupingKey(e){return this.findByGroupingKey(e)[0]}findByGroupingKey(e){if(this.multi.has(e))return this.multi.get(e).valuesArray();const t=this.unique.get(e);return t?[t]:[]}find(e){const t=[];for(const n of this)e(n)&&t.push(n);return t}add(e){if((0,a.Pb)(e)){const t=(0,a.gO)(e);this.multi.get(t).add(e)}else{const t=(0,a.gO)(e);this.unique.set(t,e)}}removeGroupingKey(e){if(this.multi.has(e)){const t=this.multi.get(e).size;return this.multi.delete(e),t>0}return!!this.unique.has(e)&&this.unique.delete(e)}remove(e){if((0,a.Pb)(e)){const t=(0,a.gO)(e),n=this.multi.get(t);let o=0;for(const i of n)r.Xy(i,e)&&(n.delete(i),o++);return o>0}{const t=(0,a.gO)(e);return!!r.Xy(this.unique.get(t),e)&&this.unique.delete(t)}}getUniqueAnnotations(){return[...this.unique.entries()].sort(l.compareByGroupingKey).map((e=>{let[,t]=e;return t}))}getMultiInstanceAnnotations(){return new Map([...this.multi.entries()].sort(l.compareByGroupingKey).map((e=>{let[t,n]=e;return[t,[...n]]})))}}},428084:(e,t,n)=>{n.d(t,{Z:()=>i});n(21703),n(757658);var o=n(657347),r=n(937850);const i=class{constructor(e){this.performRequests=void 0,this.batchSize=void 0,this.maxWorkers=void 0,this.requestDelayMs=void 0,this.requestTimeoutMs=void 0,this.queue=[],this.currentWorkers=0,this.currentSetTimeouts=0,this.dequeue=async()=>{if(this.currentSetTimeouts=0,this.currentWorkers>=this.maxWorkers||0===this.queue.length)return;this.currentWorkers++;const e=this.queue.splice(0,this.batchSize),t=e.map((e=>e.request));let n,i;try{if(this.requestTimeoutMs){const e=await r.OI(this.requestTimeoutMs,this.performRequests(t));if(e.timeout)throw new Error("Timed out.");n=e.result}else n=await this.performRequests(t)}catch(a){i=(0,o.t)(a)}try{if(i)for(let t=0;t<e.length;t++){e[t].deferred.reject(i)}else if(n)for(let t=0;t<e.length;t++){const o=e[t],r=n[t];o.deferred.resolve(r)}}catch(s){}this.currentWorkers--,this.queue.length>=this.batchSize?this.dequeue():this.dequeueAfterTimeout()};const{performRequests:t,batchSize:n,maxWorkers:i,requestDelayMs:a,requestTimeoutMs:s}=e;this.performRequests=t,this.batchSize=n,this.maxWorkers=i,this.requestDelayMs=a||0,this.requestTimeoutMs=s}getQueueSize(){return this.queue.length}updateBatchSize(e){this.batchSize=e}updateRequestDelayMs(e){this.requestDelayMs=e}getMaxWorkers(){return this.maxWorkers}updateMaxWorkers(e){this.maxWorkers=e,this.dequeueAfterTimeout()}enqueue(e){const t=r.UZ();return this.queue.push({request:e,deferred:t}),this.dequeueAfterTimeout(),t.promise}dequeueAfterTimeout(){this.currentSetTimeouts<this.maxWorkers&&(this.currentSetTimeouts++,setTimeout(this.dequeue,this.requestDelayMs))}}},853504:(e,t,n)=>{n.d(t,{Z:()=>a});n(21703);function o(e){return!("object"!=typeof e||!e)&&!(function(e){if(!function(e){return"object"==typeof e&&null!==e}(e)||"[object Object]"!==function(e){if(null===e)return void 0===e?"[object Undefined]":"[object Null]";return toString.call(e)}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e)||Array.isArray(e)||s(e)||l(e))}function r(e,t){return("ignore-class-instances"!==t||!o(e))&&(null==e||Array.isArray(e)&&0===e.length||s(e)&&0===e.size||l(e)&&0===e.size||c(e)&&!s(e)&&!l(e)&&0===Object.keys(e).length)}const i={annotationOpsBefore:!0,annotationOpsAfter:!0};const a=function e(t,n){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if("ignore-class-instances"===n&&o(t))return t;if(Array.isArray(t)){const o=t;let i=0;for(let t=0;t<o.length;t++){if(a.length>0&&a[0]!==t){o[i]=o[t],i+=1;continue}const s=e(o[t],n,a.slice(1));r(s,n)||(o[i]=s,i+=1)}o.length=i}else if(s(t)){if(a.length>0)throw new Error("Cannot traverse path into a Set");for(const e of t)r(e,n)&&t.delete(e)}else if(l(t)){if(a.length>0)throw new Error("Cannot traverse path into a map");const o=t.keys();for(const i of o){const o=e(t.get(i),n);r(o,n)?t.delete(i):t.set(i,o)}}else if(c(t)){const o=Object.keys(t);for(const s of o){if(i[s])continue;if(a.length>0&&a[0]!==s)continue;const o=e(t[s],n,a.slice(1));r(o,n)?delete t[s]:t[s]=o}}return r(t,n)?void 0:t};function s(e){return e instanceof Set}function l(e){return e instanceof Map}function c(e){const t=typeof e;return null!==e&&("object"===t||"function"===t)}},354064:(e,t,n)=>{n.d(t,{Z:()=>o});const o=class{constructor(){this.listeners={}}addListener(e,t){let n=this.listeners[e];n||(n=new Set,this.listeners[e]=n),n.add(t)}addOnceListener(e,t){var n=this;const o=function(){n.removeListener(e,o),t(...arguments)};this.addListener(e,o)}removeListener(e,t){const n=this.listeners[e];n&&(n.delete(t),0===n.size&&delete this.listeners[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];const r=this.listeners[e];r&&r.forEach((e=>e(...n)))}listenerCount(e){const t=this.listeners[e];return t?t.size:0}}},77492:(e,t,n)=>{n.d(t,{R:()=>r});var o=n(145953);const r={runSync(e,t){let n=t.next();for(;!n.done;){const r=o.Ak.create();for(const t of n.value.recordPointers)r.setModel(t,e(t));n=t.next({recordMap:r})}return n.value},async runAsync(e,t){let n=t.next();for(;!n.done;){const o=await e(n.value.recordPointers);n=t.next({recordMap:o})}return n.value},fetchRecord:function*(e){const{recordMap:t}=yield{recordPointers:[e]};return t.getModel(e)},fetchRecords:function*(e){const{recordMap:t}=yield{recordPointers:e};return t},makeRunners:e=>({sync:t=>r.runSync(t.getRecordModel,e(t)),async:t=>r.runAsync(t.loadRecordModel,e(t))})}},868931:(e,t,n)=>{n.d(t,{C:()=>o});const o={serialize:e=>JSON.stringify(e),deserialize:e=>JSON.parse(e)}},255652:(e,t,n)=>{n.d(t,{s:()=>r});n(757658);var o=n(401898);class r{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};this.buckets={},this.count=0,this.total=0,this.unique=0,this.startedAt=new Map,this.logger=e}async measureErrors(e,t,n,o){const r=`${e} ${++this.unique}`;this.start(r);try{const e=await o();return this.end(r,t),e}catch(i){throw this.end(r,n,i),i}}get average(){return Math.floor(this.total/this.count)}get summary(){const e=[];e.push(`avg ${this.average}ms for ${this.count} calls`);for(const[t,n]of(0,o.qP)(this.buckets)){if(!n)continue;const o=Math.floor(n.total/n.count),r=(n.count/this.count*100).toFixed(2);e.push(`[${t}: ${r}% avg ${o}ms]`)}return e.join(" ")}start(e){this.startedAt.set(e,"object"==typeof performance?performance.now():Date.now())}end(e,t){const n=this.startedAt.get(e);if(!n)return;this.startedAt.delete(e);const o=("object"==typeof performance?performance.now():Date.now())-n;this.count++,this.total=this.total+o;let r=this.buckets[t];r||(r={count:0,total:0},this.buckets[t]=r),r.count++,r.total=r.total+o;for(var i=arguments.length,a=new Array(i>2?i-2:0),s=2;s<i;s++)a[s-2]=arguments[s];this.logger(`end ${e} ${t}: ${o}ms`,...a)}}},18201:(e,t,n)=>{n.d(t,{Z:()=>r});n(21703),n(757658),n(430541);var o=n(657347);const r=class{constructor(e){let{maxSize:t,prefix:n,store:o,version:r}=e;this.prefix=void 0,this.maxSize=void 0,this.store=void 0,this.version=void 0,this.serializedKeys=void 0,this.namespace=void 0,this.lastVersion=void 0,this.createInternalKey=e=>`${this.namespace}${e}`,this.maxSize=t,this.prefix=n,this.store=o,this.version=r.toString(),this.namespace=`${n}:${r}::`,this.serializedKeys=`${n}:${r}:keys`,this.lastVersion=`${n}:version`}set(e,t){try{this.setInternal(e,t),this.promote(e)}catch(n){return{error:(0,o.t)(n)}}return{value:void 0}}get(e){try{const t=this.getInternal(e);if(null!==t)return{value:t}}catch(t){return{error:(0,o.t)(t)}}return{value:void 0}}remove(e){try{this.getKeys().indexOf(e)>-1&&(this.removeInternal(e),this.evict(e))}catch(t){return{error:(0,o.t)(t)}}return{value:void 0}}clear(){try{const e=this.getKeys();for(const t of e)this.removeInternal(t);this.setKeys([])}catch(e){return{error:(0,o.t)(e)}}return{value:void 0}}scan(e){try{const t=this.getKeys();for(const n of t){const t=this.getInternal(n);if(null===t)throw new Error(`Item not found: ${n}`);e(n,t)}}catch(t){return{error:(0,o.t)(t)}}return{value:void 0}}entries(){const e=[],t=this.scan(((t,n)=>{e.push([t,n])}));return t.error?{error:t.error}:{value:e}}keys(){try{return{value:this.getKeys()}}catch(e){return{error:(0,o.t)(e)}}}slowGC(){const e=[],t=e=>e!==this.serializedKeys&&(!!e.endsWith("keys")&&this.isOldKey(e));for(let n=0;n<this.store.length;n+=1){const o=this.store.key(n);null!==o&&((this.isOldKey(o)||t(o))&&e.push(o))}for(const n of e)this.store.removeItem(n)}updateVersionAndGC(){const e=this.store.getItem(this.lastVersion);if(null!==e){const t=parseInt(e,10),n=parseInt(this.version,10),o=!Number.isNaN(t),r=!Number.isNaN(n);o&&r&&t<n&&this.slowGC()}this.store.setItem(this.lastVersion,this.version)}isOldKey(e){if(!e.startsWith(`${this.prefix}:`))return!1;const t=e.substring(`${this.prefix}:`.length),n=parseInt(t,10);if(Number.isNaN(n))return!1;return n<parseInt(this.version,10)}getKeys(){const e=this.store.getItem(this.serializedKeys);if(null===e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}setKeys(e){const t=JSON.stringify(e);this.store.setItem(this.serializedKeys,t)}promote(e){const t=this.getKeys(),n=t.indexOf(e);if(n>-1)t.splice(n,1),t.unshift(e);else if(t.unshift(e),t.length>this.maxSize){const e=t.splice(this.maxSize);for(const t of e)this.removeInternal(t)}this.setKeys(t)}evict(e){const t=this.getKeys(),n=t.indexOf(e);n>-1&&t.splice(n,1),this.setKeys(t)}setInternal(e,t){this.store.setItem(this.createInternalKey(e),JSON.stringify(t))}getInternal(e){const t=this.store.getItem(this.createInternalKey(e));return null===t?null:JSON.parse(t)}removeInternal(e){this.store.removeItem(this.createInternalKey(e))}}},575189:(e,t,n)=>{n.d(t,{uP:()=>P,yx:()=>M});var o=n(212847);const r=o.union([o.number(),o.string(),o.boolean(),o.isNull(),o.array(o.string())]),i=o.undefinable(r),a=o.union([r,o.record(o.string(),r)]),s=o.union([i,o.record(o.string(),i)]),l=o.union([s,o.record(o.string(),s)]),c=l,d=o.without(o.without(o.nonEmpty(o.string()),"{"),"}");o.object({required:{key:d,value:a,ttl:o.undefinable(o.number())},optional:{}}),o.object({required:{key:d,value:s,version:o.number()},optional:{}}),o.object({required:{key:d,value:o.number(),ttl:o.undefinable(o.number())},optional:{}}),o.object({required:{key:d,value:o.number(),version:o.number()},optional:{}}),o.object({required:{key:d,amount:o.number(),ttl:o.undefinable(o.number())},optional:{passThroughData:c}}),o.object({required:{key:d,value:o.number(),version:o.number()},optional:{}}),o.object({required:{key:d,field:o.string(),value:s,ttl:o.undefinable(o.number())},optional:{}}),o.object({required:{key:d,field:o.string(),value:l,version:o.number()},optional:{}}),o.object({required:{id:o.string()},optional:{}}),o.object({required:{setValueTime:o.number()},optional:{}}),o.object({required:{ackId:o.string()},optional:{}}),o.object({required:{},optional:{}}),o.object({required:{key:d,field:o.string(),updates:o.record(o.string(),i),ttl:o.undefinable(o.number())},optional:{onDisconnectFields:o.undefinable(o.object({required:{presenceOnDisconnectFlag:o.literals("register","clear"),subscriptionId:o.string(),pageVisitId:o.undefinable(o.string()),spaceId:o.string(),pageId:o.string()},optional:{}}))}}),o.object({required:{key:d,field:o.string(),value:l,version:o.number()},optional:{}});const u=o.object({required:{blockId:o.string(),userId:o.string(),spaceId:o.string(),operation:o.literal("logPageExit"),pageVisitId:o.undefinable(o.string()),ts:o.number()},optional:{}}),p=(o.object({required:{key:d},optional:{}}),o.object({required:{key:d,value:s,version:o.number()},optional:{}}),o.object({required:{operation:o.literal("setValue"),key:d,value:o.string(),ttl:o.undefinable(o.number())},optional:{}})),m=o.object({required:{operation:o.literal("setValue"),key:d,value:s,version:o.number()},optional:{}}),g=o.object({required:{operation:o.literal("increment"),key:d,amount:o.number(),ttl:o.undefinable(o.number())},optional:{passThroughData:c}}),f=o.object({required:{operation:o.literal("increment"),key:d,value:o.number(),version:o.number()},optional:{}}),h=o.object({required:{operation:o.literal("setIfGreater"),key:d,value:o.number(),ttl:o.undefinable(o.number())},optional:{}}),v=o.object({required:{operation:o.literal("setIfGreater"),key:d,value:o.number(),version:o.number()},optional:{}}),y=o.object({required:{operation:o.literal("setField"),key:d,field:o.string(),value:s,ttl:o.undefinable(o.number())},optional:{}}),b=o.object({required:{operation:o.literal("setField"),key:d,field:o.string(),value:l,version:o.number()},optional:{}}),_=o.object({required:{operation:o.literal("updateField"),key:d,field:o.string(),updates:o.record(o.string(),i),ttl:o.undefinable(o.number())},optional:{onDisconnectFields:o.undefinable(o.object({required:{presenceOnDisconnectFlag:o.literals("register","clear"),subscriptionId:o.string(),pageVisitId:o.undefinable(o.string()),spaceId:o.string(),pageId:o.string()},optional:{}}))}}),S=o.object({required:{operation:o.literal("updateField"),key:d,field:o.string(),value:l,version:o.number()},optional:{}}),k=o.object({required:{operation:o.literal("logPageExit"),spaceId:o.string(),userId:o.string(),blockId:o.string(),pageVisitId:o.undefinable(o.string())},optional:{}}),w=o.object({required:{operation:o.literal("logPageExit")},optional:{}}),x={setValue:p,increment:g,setIfGreater:h,setField:y,updateField:_,logPageExit:k},I=o.union(Object.values(x)),C={setValue:m,increment:f,setIfGreater:v,setField:b,updateField:S,logPageExit:w},T=o.union(Object.values(C)),M=(o.object({required:{operations:o.array(I)},optional:{}}),o.object({required:{responses:o.array(T)},optional:{}}),o.object({required:{subscriptions:o.array(o.object({required:{key:d,version:o.number()},optional:{}}))},optional:{}}),o.object({required:{responses:o.array(o.object({required:{key:d,wasNotified:o.boolean()},optional:{}})),internalProcessingTimeMs:o.number()},optional:{}}),o.object({required:{key:d,version:o.number()},optional:{}}),o.object({required:{key:d,wasNotified:o.boolean()},optional:{}}),o.object({required:{keys:o.array(d)},optional:{}}),o.object({required:{keys:o.array(d),internalProcessingTimeMs:o.number()},optional:{}}),o.object({required:{key:d},optional:{}}),o.object({required:{key:d},optional:{}}),o.object({required:{disconnectId:o.string(),operations:o.array(I)},optional:{}}),o.object({required:{disconnectId:o.string(),hadDisconnect:o.boolean()},optional:{}}),o.object({required:{disconnectId:o.string()},optional:{}}),o.object({required:{disconnectId:o.string(),wasRemoved:o.boolean()},optional:{}}),o.union([o.object({required:{type:o.literal("notification"),key:d,value:l,version:o.number()},optional:{ackId:o.string(),passThroughData:c}}),o.object({required:{type:o.literal("response"),status:o.literals("ok","error"),requestId:o.string(),result:o.any()},optional:{}})])),P=o.object({required:{userId:o.string(),present:o.boolean()},optional:{activityTimestamp:o.number(),blockId:o.union([o.isNull(),o.string()])}});o.object({required:{max_records:o.number()},optional:{}}),o.object({required:{values:o.array(u)},optional:{}}),o.object({required:{last_length:o.number(),new_length:o.number(),added:o.boolean()},optional:{}})},511799:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(467266),r=n.n(o),i=n(653965);let a;const s=new WeakMap;function l(e){let t=s.get(e);return void 0!==t||(t=r()(e),s.set(e,t)),t}a=Symbol.iterator;class c{constructor(){let{getKey:e=l,from:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.map=new Map,this.getKey=void 0,this.getKey=e,t)for(const[n,o]of t)this.set(n,o)}get size(){return this.map.size}set(e,t){return this.map.set(this.getKey(e),[e,t])}get(e){const t=this.map.get(this.getKey(e));if(t)return t[1]}getKeyObject(e){const t=this.map.get(this.getKey(e));if(t)return t[0]}has(e){return this.map.has(this.getKey(e))}delete(e){return this.map.delete(this.getKey(e))}*entries(){for(const e of this.map.values())yield e}[a](){return this.entries()}*keys(){for(const[e,t]of this.map.values())yield e}*values(){for(const[e,t]of this.map.values())yield t}valuesArray(){return Array.from(this.values())}compactedValuesArray(){return i.oA(Array.from(this.values()))}}},261158:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(511799);let r;r=Symbol.iterator;class i{constructor(e){this.map=void 0,this.map=new o.Z({getKey:e})}add(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(const o of t)this.map.set(o,o)}delete(e){return this.map.delete(e)}valuesArray(){return this.map.valuesArray()}has(e){return this.map.has(e)}some(e){return this.valuesArray().some(e)}find(e){return this.valuesArray().find(e)}equals(e){if(this.size!==e.size)return!1;for(const t of e)if(!this.has(t))return!1;return!0}get size(){return this.map.size}[r](){return this.map.values()}static fromArray(e){const{values:t,getKeyFn:n}=e,o=void 0!==n?new i(n):new i;return t.forEach((e=>o.add(e))),o}}const a=i},300482:(e,t,n)=>{n.d(t,{SH:()=>i,V_:()=>a,Xc:()=>d,dj:()=>c,f4:()=>u,op:()=>l});var o=n(653965),r=n(401898);Symbol("ID path");function i(e){return s[e.command]}function a(e){switch(e.command){case"appendActivity":case"set":case"update":case"listBefore":case"listAfter":case"listReplace":case"listRemove":case"keyedObjectListBefore":case"keyedObjectListAfter":case"keyedObjectListRemove":case"keyedObjectListUpdate":case"setPermissionItem":case"temporarySetPermissionItemForBackfill":case"setSingletonPermissionItem":case"addRelationAfter":case"addRelationBefore":case"addRelations":case"removeRelation":case"addPersonAfter":case"addPersonBefore":case"removePerson":case"addSelectOptionAfter":case"addSelectOptionBefore":case"removeSelectOption":case"copyFile":case"listBeforeMulti":case"listAfterMulti":case"removeTeamMembershipItem":case"setTeamMembershipItem":return!0;default:return!1}}const s={insertChildrenAfter:!0,insertChildrenBefore:!0,removeChild:!0,setParent:!0,assignAutoIncrementId:!0,moveToPrivate:!0};const l={set:function(e){return{...e,command:"set"}},update:function(e){return{...e,command:"update"}},append:function(e){return e.args.ids?e.args.before?{pointer:e.pointer,path:e.path,command:"listBeforeMulti",args:{ids:e.args.ids,before:e.args.before}}:{pointer:e.pointer,path:e.path,command:"listAfterMulti",args:{ids:e.args.ids,after:e.args.after}}:e.args.before?{pointer:e.pointer,path:e.path,command:"listBefore",args:{id:e.args.id,before:e.args.before}}:{pointer:e.pointer,path:e.path,command:"listAfter",args:{id:e.args.id,after:e.args.after}}},insertChildren:function(e){const t=e.args.ids??[e.args.id];return e.args.before?{pointer:e.pointer,path:e.path,command:"insertChildrenBefore",args:{ids:t,before:e.args.before}}:{pointer:e.pointer,path:e.path,command:"insertChildrenAfter",args:{ids:t,after:e.args.after}}},remove:function(e){return{pointer:e.pointer,path:e.path,command:"listRemove",args:{id:e.args.id}}},removeChild:function(e){return{pointer:e.pointer,path:e.path,command:"removeChild",args:{id:e.args.id}}}};function c(e){for(const t of e)!t.pointer&&t.table&&t.id&&(t.pointer={table:t.table,id:t.id})}const d=(0,r.AO)((e=>"object"==typeof e&&"id"in e?{true:e}:{false:e}));function u(e,t){let n=e;for(const i of t){if(null==n)return;var r;if(d(i))n=o.sE(n,{id:i.id});else n=null===(r=n)||void 0===r?void 0:r[i]}return n}},29299:(e,t,n)=>{n.d(t,{$j:()=>a,Y5:()=>i,v2:()=>r,ze:()=>s});n(772141);var o=n(421202);n(606287),n(870279),n(475246),n(429369);function r(e){const{pointer:t,parent_table:n,parent_id:o,alive:r}=e;return{pointer:t,command:"update",path:[],args:{parent_id:o,parent_table:n,alive:r}}}function i(e){const{pointer:t,userId:n}=e;return{command:"set",pointer:t,path:["permissions"],args:[{type:"user_permission",role:"editor",user_id:n}]}}function a(e){return{pointer:{table:o.iU,id:e.blockParentId},path:["content"],command:"removeChild",args:{id:e.recordId}}}function s(e){return{pointer:{table:o.iU,id:e.blockParentId},path:["content"],command:"insertChildrenAfter",args:{ids:[e.recordId]}}}},570096:(e,t,n)=>{n.d(t,{R:()=>r,l:()=>o});const o="center_peek",r="side_peek"},673360:(e,t,n)=>{n.d(t,{QS:()=>V,hL:()=>O,mI:()=>F,mk:()=>B,oK:()=>U,tz:()=>Z});var o=n(401898),r=n(570921),i=n(554368),a=n(908542),s=n(810188),l=n(789320),c=n(798963),d=n(718844),u=n(556358),p=n(173916),m=n(244312),g=n(332161),f=n(949953),h=n(714429),v=n(873081),y=n(611318),b=n(865311),_=n(594578),S=n(886854),k=n(524836),w=n(86135),x=n(231577),I=n(983200),C=n(715539),T=n(91644),M=n(475246),P=n(263368),A=n(429369),R=n(35794),D=n(811045);const B={create:(e,t)=>({table:e,value:t}),fromModel:e=>B.create(e.table,e.__IM_SORRY__getValue()),isSpaceRecordWithTable:e=>e.table===M.bx,isTeamRecordWithTable:e=>e.table===A.e0,isSpaceShardRecordWithTable:e=>!!(0,D.IO)(e.table),getSpaceId(e){if(B.isSpaceShardRecordWithTable(e)){if(B.isSpaceRecordWithTable(e))return e.value.id;{const{value:t}=e;return t.space_id}}if(e.table===r.TY){return e.value.space_id}if(e.table===b.uX){return e.value.space_id}}},E={block:!0,space_view:!0,collection:!0,collection_view:!0,comment:!0,activity:!0,discussion:!0,slack_integration:!0,snapshot:!0,bot:!0,access_request:!0,page_visit:!0,page_exit:!0,integration:!0,[g.PJ]:!0,[f.r9]:!0,team:!0,reaction:!0,[m.Jd]:!0,[c.cv]:!0,[I.wM]:!0,[d.Xj]:!0,[k.qV]:!0,[w.FM]:!0,[R.bf]:!0,[i.y0]:!0,[T.AT]:!0,[_.P9]:!0,[s.J4]:!0,[a.t_]:!0,[y.Bh]:!0,[P.ah]:!0,[S.X]:!0,[u.EK]:!0,[v.bC]:!0,[C.Gs]:!0,[h.L_]:!0,[x.eC]:!0,[l.SS]:!0,[p.ZP]:!0};function F(e){return(0,o.qg)(E,e)&&E[e]}function Z(e){return Boolean(F(e.table)&&U(e.__IM_SORRY__getValue()))}function U(e){return"object"==typeof e&&null!==e&&"parent_table"in e&&void 0!==e.parent_table&&void 0!==e.parent_id}const V={getSpaceId:e=>{if(e&&U(e))return(0,D.an)(e.parent_table)&&"space_id"in e?e.space_id:void 0}},N={block:!0,space_view:!0,collection:!0,collection_view:!0,comment:!0,bot:!0,integration:!0,[m.Jd]:!0,[c.cv]:!0,[d.Xj]:!0,[k.qV]:!0,[w.FM]:!0,[i.y0]:!0,[T.AT]:!0,[a.t_]:!0,[h.L_]:!0,[l.SS]:!0};function O(e){return(0,o.qg)(N,e)&&N[e]}},145953:(e,t,n)=>{n.d(t,{Ak:()=>f,Ao:()=>p,PF:()=>h,R3:()=>u});n(21703),n(757658);var o=n(653965),r=n(401898),i=n(959753),a=n(291627);let s,l,c,d;function u(e){const t=f.create();for(const{pointer:n,value:o}of e)t.setValue(n,o);return t}class p{constructor(e){this.data=void 0,this.data=e}static create(e){if(e){if(3===e.__version__)return new m(e);if(function(e){return void 0===e.__version__}(e))return new g(e);throw new Error("Unknown RecordMapJson version")}return new m({__version__:3})}getTables(){return Object.keys(this.data).filter((e=>"__"!==e.substr(0,2)))}getSize(){let e=0;const t=this.getTables();for(const n of t)e+=Object.values(this.data[n]).length;return e}delete(e){const t=this.data[e.table];return t&&delete t[e.id],this}clone(){const e=this.createEmptyRecordMap();for(const t of this)e.set(t.pointer,t.value);return e}}s=Symbol.iterator;class m extends p{constructor(e){super(e),this.data=void 0,this.data=e}createEmptyRecordMap(){return p.create({__version__:3})}get(e){const t=this.data[e.table];if(t){const n=t[e.id];if(n)return n.value}}pointerWasExplicitlySet(e){const t=this.data[e.table];if(t){if(t[e.id])return!0}return!1}getByTable(e){const t=this.data[e];return t?Object.entries(t).map((t=>{let[n,o]=t;const{spaceId:r,value:i}=o;return{pointer:{table:e,id:n,spaceId:r},value:i}})):[]}set(e,t){this.data[e.table]||(this.data[e.table]={});const n=this.data[e.table]??{},o=n[e.id];let r=e.spaceId;return void 0===e.spaceId&&o&&o.spaceId&&(r=o.spaceId),n[e.id]={spaceId:r,value:t},this}*[s](){const e=this.getTables();for(const t of e){const e=this.data[t];if(e)for(const[n,o]of Object.entries(e)){const{value:e,spaceId:r}=o;yield{pointer:{id:n,table:t,spaceId:r},value:e}}}}toJson(e){const{allowVersionDowngrade:t,maxSupportedVersion:n}=e;return t&&"v1"===n?function(e){const t={};return Object.entries(e).forEach((e=>{let[n,o]=e;if("__"===n.substr(0,2))return;const r=n;o&&(t[r]={},Object.entries(o).forEach((e=>{let[n,o]=e;o&&(t[r][n]=o.value)})))})),t}(this.data):this.data}}l=Symbol.iterator;class g extends p{constructor(e){super(e),this.data=void 0,this.data=e}createEmptyRecordMap(){return p.create({})}get(e){const t=this.data[e.table];if(t)return t[e.id]}pointerWasExplicitlySet(e){const t=this.data[e.table];return!!t&&t.hasOwnProperty(e.id)}getByTable(e){const t=this.data[e];return t?Object.entries(t).map((t=>{let[n,o]=t;return{pointer:{table:e,id:n},value:o}})):[]}set(e,t){let n=this.data[e.table];return n||(n={},this.data[e.table]=n),n[e.id]=t,this}*[l](){for(const[t,n]of Object.entries(this.data))if(n)for(const[o,r]of Object.entries(n)){var e;let n;n=null!=r&&null!==(e=r.value)&&void 0!==e&&e.space_id?{pointer:{table:t,id:o,spaceId:r.value.space_id},value:r}:{pointer:{table:t,id:o},value:r},yield n}}toJson(e){return this.data}}c=Symbol.iterator;class f{constructor(e){this.inner=void 0,this.inner=p.create(e)}has(e){return void 0!==this.getValue(e)}getValue(e){return this.inner.get(e)}getModel(e){const t=this.getValue(e);if(t)return i.kk5.fromValue(e.table,t)}pointerWasExplicitlySet(e){return this.inner.pointerWasExplicitlySet(e)}getByTable(e){return this.inner.getByTable(e)}getModelsByTable(e){return this.inner.getByTable(e).map((t=>i.kk5.fromValue(e,t.value))).filter((e=>void 0!==e))}getPointersByTable(e){return this.inner.getByTable(e).map((e=>e.pointer))}getModels(e){return e.map((e=>this.getModel(e)))}setValue(e,t){return this.inner.set(e,t),this}setModel(e,t){const n=null==t?void 0:t.__IM_SORRY__getValue();return this.setValue(e,n)}addModel(e){return this.setModel(e.pointer,e)}*[c](){for(const{pointer:e,value:t}of this.inner)yield{pointer:e,model:i.kk5.fromValue(e.table,t)}}delete(e){return this.inner.delete(e),this}getSize(){return this.inner.getSize()}clone(){const e=new f;for(const t of this)e.setModel(t.pointer,t.model);return e}toJson(e){return this.inner.toJson(e)}assign(e){for(const{pointer:t,model:n}of e)this.setModel(t,n);return this}static merge(e){const t=new f;return e.forEach((e=>t.assign(e))),t}static create(e){return new f(e)}static createFromModels(){const e=f.create();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];for(const r of n)e.addModel(r);return e}isEqual(e,t){const n=[],r=[];for(const{pointer:i,model:a}of e){let e=this.getValue(i);null!=t&&t.mapThisValueBeforeComparisonFn&&(e=t.mapThisValueBeforeComparisonFn({value:e,pointer:i}));const n=null==a?void 0:a.__IM_SORRY__getValue();if(r.push(i),!(0,o.Xy)(e,n))return!1}for(const{pointer:i,model:a}of this){let r=null==a?void 0:a.__IM_SORRY__getValue();null!=t&&t.mapThisValueBeforeComparisonFn&&(r=t.mapThisValueBeforeComparisonFn({value:r,pointer:i}));const s=e.getValue(i);if(n.push(i),!(0,o.Xy)(r,s))return!1}if(null!=t&&t.shouldCompareSpaceIdsInPointers){const e=(0,o.MR)(r,["id","spaceId"]),t=(0,o.MR)(n,["id","spaceId"]);if(!(0,o.Xy)(t,e))return!1}return!0}toRecordPointerSet(){const e=new a.X;for(const{pointer:t,model:n}of this)n&&e.add(t);return e}}d=Symbol.iterator;class h{constructor(e){this.inner=void 0,this.inner=p.create(e)}has(e){return void 0!==this.getRole(e)}getValue(e){var t;return null===(t=this.inner.get(e))||void 0===t?void 0:t.value}getModel(e){const t=this.getValue(e);if(t)return i.kk5.fromValue(e.table,t)}getModelsByTable(e){return this.getByTable(e).map((t=>t.value?i.kk5.fromValue(e,t.value):void 0)).filter(r.$K)}getRole(e){var t;return null===(t=this.inner.get(e))||void 0===t?void 0:t.role}getByTable(e){return this.inner.getByTable(e)}setValueAndRole(e,t,n){return this.inner.set(e,{value:t,role:n}),this}setModelAndRole(e,t,n){const o=null==t?void 0:t.__IM_SORRY__getValue();return this.setValueAndRole(e,o,n)}*[d](){for(const e of this.inner[Symbol.iterator]())e.value&&(yield{pointer:e.pointer,model:i.kk5.fromValue(e.pointer.table,e.value.value),role:e.value.role})}delete(e){return this.inner.delete(e),this}clone(){const e=new h;for(const{pointer:t,model:n,role:o}of this)e.setModelAndRole(t,n,o);return e}getSize(){return this.inner.getSize()}assign(e){for(const{pointer:t,model:n,role:o}of e)this.setModelAndRole(t,n,o);return this}static merge(e){const t=new h;return e.forEach((e=>t.assign(e))),t}toJson(e){return this.inner.toJson(e)}static create(e){return new h(e)}toRecordMap(){const e=f.create();for(const{pointer:t,model:n}of this)n&&e.setModel(t,n);return e}}},600606:(e,t,n)=>{n.d(t,{$O:()=>$,Ok:()=>Y,P2:()=>W,UI:()=>H,dr:()=>G,qo:()=>Q});var o=n(653965),r=n(307032),i=n(673360),a=n(570921),s=n(554368),l=n(545149),c=n(908542),d=n(810188),u=n(789320),p=n(798963),m=n(718844),g=n(173916),f=n(870279),h=n(394302),v=n(933709),y=n(982447),b=n(114710),_=n(57883),S=n(714429),k=n(685593),w=n(584683),x=n(611318),I=n(670017),C=n(989470),T=n(594578),M=n(524836),P=n(86135),A=n(231577),R=n(801311),D=n(265963),B=n(616663),E=n(715539),F=n(91644),Z=n(840837),U=n(665635),V=n(591937),N=n(307591),O=n(947969),L=n(935623),j=n(263368),K=n(638086),z=n(35794);const q={[a.TY]:!0,[v.qF]:!0,[f.x_]:!0,[C.UI]:!0,[I.Kk]:!0,[_.t0]:!0,[Z.rp]:!0,[b.Dw]:!0,[y.r]:!0,[w.Tu]:!0,[p.cv]:!0,[M.qV]:!0,[P.FM]:!0,[m.Xj]:!0,[z.bf]:!0,[s.y0]:!0,[F.AT]:!0,[U.Zx]:!0,[V.GQ]:!0,[N.Py]:!0,[O.WU]:!0,[L.M]:!0,[T.P9]:!0,[d.J4]:!0,[c.t_]:!0,[R.M]:!0,[x.Bh]:!0,[j.ah]:!0,[l.P]:!0,[E.Gs]:!0,[h.p]:!0,[S.L_]:!0,[A.eC]:!0,[K.l]:!0,[u.SS]:!0,[k.M]:!0,[g.pC]:!0};function H(e){return e in q}const G={fromSpaceShardRecordId:(e,t)=>({id:e.id,spaceId:e.spaceId,table:t}),fromPointerLike(e){const{table:t,id:n,spaceId:o}=e;return{table:t,id:n,spaceId:o}},fromRecordWithTable(e){const t=e.table,n=e.value.id,o=i.mk.getSpaceId(e);return void 0!==o?{table:t,id:n,spaceId:o}:{table:t,id:n}},getParentPointerFromRecordWithParent(e){const t=e.parent_id,n=e.parent_table,o=i.QS.getSpaceId(e);return void 0!==o?{table:n,id:t,spaceId:o}:{table:n,id:t}},uniq:e=>o.mN(e,(e=>`${e.table}:${e.id}`)),toKey:e=>e.spaceId?`${e.spaceId}:${e.table}:${e.id}`:`${e.table}:${e.id}`,isEqualIdTable:(e,t)=>e.id===t.id&&e.table===t.table,isEqual(e,t){return this.isEqualIdTable(e,t)&&e.spaceId===t.spaceId}},W={toKey:e=>`${e.userId}:${G.toKey(e.pointer)}`};function $(e,t){return e.table===t}function Y(e){return(0,r.e)(e.id)||"temporary_password"===e.table||e.table===B.h||e.table===D.a||(0,O.X$)(e)||(0,U.mR)(e)||(0,V.cA)(e)||(0,N.aA)(e)}function Q(e,t){return e.table===t.table&&e.id===t.id}},291627:(e,t,n)=>{n.d(t,{X:()=>a});var o=n(516691),r=n(261158);let i;i=Symbol.iterator;class a{constructor(e){if(this.internalState=void 0,this.internalState=new r.Z(o.dn),e)for(const t of e)this.add(t)}size(){return this.internalState.size}add(e){this.internalState.add(e)}delete(e){this.internalState.delete(e)}has(e){return this.internalState.has(e)}*[i](){for(const e of this.internalState)yield e}}},95371:(e,t,n)=>{n.d(t,{CY:()=>m,DG:()=>r,DY:()=>c,MW:()=>s,Sr:()=>d,Xf:()=>u,YL:()=>p,Yc:()=>l,Yz:()=>a,lj:()=>g,mp:()=>i,qF:()=>v,si:()=>f,ub:()=>h});n(757658);var o=n(401898);class r{constructor(e){this.children=e}map(e){const t=this.children.map((t=>t.map(e)));return new r(t)}toString(){return`DetachedTreeRoots([${this.children}])`}}class i{constructor(e,t){this.value=e,this.children=t}map(e){return s(this,(t=>({value:e(t.value),children:t.children})))}toString(){return`Tree(${this.value}, [${this.children}])`}}function a(e,t){return t(e.value)||e.children.some((e=>a(e,t)))}function s(e,t){const n=t(e);if(!n)return;const{value:r,children:a}=n,l=a?a.map((e=>s(e,t))).filter(o.$K):[];return new i(r,l)}function l(e){const{values:t,isAncestor:n,compareOrder:o}=e;if(0===t.length)return;const a=(e,t)=>{for(const o of e)if(n(o.value,t))return void a(o.children,t);e.push(new i(t,[]))},s=t.slice().sort(o),l=[];for(const r of s)a(l,r);return new r(l)}function c(e,t){for(const n of e){if(t(n))return[n];{const e=c(n.children,t);if(e)return[n,...e]}}}function d(e,t){if(t&&t.length>0){const n=t[t.length-1],o=t[t.length-2]||e,r=o.children.findIndex((e=>e===n));if(r>0)return{prev:o.children[r-1]};if(o!==e)return{parent:o}}return{}}function u(e,t){if(t&&t.length>0){const n=t[t.length-1],o=t[t.length-2]||e,r=o.children.findIndex((e=>e===n));return r<o.children.length-1?{next:o.children[r+1]}:u(e,t.slice(0,t.length-1))}return{}}function p(e,t){if(t&&t.length>0){const n=t[t.length-1],o=t[t.length-2]||e,r=o.children.findIndex((e=>e===n));if(r>0){return{prev:m(o.children[r-1])}}if(o!==e)return{parent:o}}return{}}function m(e){for(;e.children.length>0;)e=e.children[e.children.length-1];return e}function g(e,t){if(t&&t.length>0){const n=t[t.length-1];if(n.children.length>0){return{next:n.children[0]}}const{next:o}=u(e,t);return{next:o}}return{}}function f(e){if(e&&e.length>0){const t=e[e.length-1];if(t.children.length>0)return t.children[0]}}function h(e){if(e&&e.length>1)return e[e.length-2]}function v(e,t){if(0===e.length||0===t.length)return-1;for(let n=Math.min(e.length,t.length)-1;n>-1;n--){if(e[n]===t[n])return n}return-1}},439721:(e,t,n)=>{n.d(t,{F:()=>a,o:()=>s});n(21703),n(757658);var o=n(401898),r=n(95371),i=n(873597);const a={applyMutable:function(e,t){const n=(0,r.DY)(e.children,(e=>e===t.target));if(void 0===n)return!1;if(0===n.length)throw new Error("findPathInTree: empty path");const i=1===n.length?e.children:n[n.length-2].children,a=i.indexOf(t.target);if(-1===a)throw new Error("findPathInTree: cannot find node");switch(t.operation){case"indentSelf":return function(e,t){if(0===t)return!1;const n=e[t],o=e[t-1];return e.splice(t,1),o.children.push(n,...n.children),n.children=[],!0}(i,a);case"indentSelfAndSubtree":return function(e,t){if(0===t)return!1;const n=e[t],o=e[t-1];return e.splice(t,1),o.children.push(n),!0}(i,a);case"unindentSelf":{if(1===n.length)return!1;const t=2===n.length?e.children:n[n.length-3].children,o=n[n.length-2],r=t.indexOf(o);if(-1===r)throw new Error("findPathInTree: cannot find node");return function(e,t,n){const o=e[t],r=o.children[n];return o.children.splice(n,1),e.splice(t+1,0,r),!0}(t,r,a)}case"unindentSelfAndUpdateSiblings":{if(1===n.length)return!1;const t=2===n.length?e.children:n[n.length-3].children,o=n[n.length-2],r=t.indexOf(o);if(-1===r)throw new Error("findPathInTree: cannot find node");return function(e,t,n){const o=e[t],r=o.children[n],i=o.children.splice(n+1,o.children.length-n-1);return r.children.push(...i),o.children.splice(n,1),e.splice(t+1,0,r),!0}(t,r,a)}default:(0,o.t1)(t.operation)}}};const s={getIndentOperationsFromTreeRange:(e,t)=>"indent"===t?function(e){const t=[];for(const n of(0,i.bu)(e))t.push({operation:"indentSelf",target:n});return t}(e):"indentSelfAndSubtree"===t?function(e){const t=[];for(const n of(0,i.bu)(e))t.push({operation:"indentSelfAndSubtree",target:n});return t}(e):"unindent"===t?function(e){const t=[];for(const n of(0,i.bu)(e))t.push({operation:"unindentSelfAndUpdateSiblings",target:n});return t.reverse()}(e):"unindentSelf"===t?function(e){const t=[];for(const n of(0,i.bu)(e))t.push({operation:"unindentSelf",target:n});return t.reverse()}(e):void(0,o.t1)(t)}},873597:(e,t,n)=>{n.d(t,{JK:()=>r,bu:()=>a,tL:()=>i});n(21703);var o=n(401898);function*r(e){yield e;for(const t of e.children)yield*r(t)}function*i(e){for(let t=e.startPath.length-1;t>=0;t--){const n=e.getStartBoundary(t);if(!n)throw new Error("Start boundary must be defined");t===e.startPath.length-1?yield n.parent:yield*n.childrenInsideRange}}function*a(e){for(const{position:t,tree:n}of function*(e){for(let t=e.startPath.length-1;t>=0;t--){const n=e.getStartBoundary(t);if(n&&(t===e.startPath.length-1&&(yield{position:"start",tree:n.parent}),t>0))for(const e of n.childrenInsideRange)yield{position:"within",tree:e}}for(let t=0;t<e.endPath.length;t++){const n=e.getEndBoundary(t);if(n)for(const t of n.childrenInsideRange)e.isInEndPath(t)?yield{position:"endPath",tree:t}:yield{position:"within",tree:t}}}(e))switch(t){case"start":case"endPath":yield n;break;case"within":yield*r(n);break;default:(0,o.t1)(t)}}},500374:(e,t,n)=>{n.d(t,{Z:()=>r,f:()=>i});var o=n(401898);function r(e){return[{operation:"delete",deleteFromParent:e.moveFromParent,deletingChildren:e.movingChildren,debug:e.debug},{operation:"insert",insertIntoParent:e.moveToParent,insertChildren:e.movingChildren,adjacentSibling:e.moveToAdjacentSibling,direction:e.moveToDirection,debug:e.debug}]}const i={applyMutable:function(e){switch(e.operation){case"delete":return a(e);case"insert":return s(e);case"move":const[t,n]=r(e),i=a(t),l=s(n);return i||l;default:(0,o.t1)(e)}}};function a(e){const{deleteFromParent:t,deletingChildren:n}=e;if(0===n.length)return!1;const o=new Set(n),r=t.children.filter((e=>!o.has(e)));return r.length!==t.children.length&&(t.children=r,!0)}function s(e){const{direction:t,insertChildren:n,insertIntoParent:r,adjacentSibling:i}=e;if(0===n.length)return!1;const a=i?r.children.indexOf(i):-1,s=(()=>{switch(t){case"listBefore":return Math.max(0,a);case"listAfter":return-1===a?r.children.length:a+1;default:(0,o.t1)(t)}})();return r.children.splice(s,0,...n),!0}},570842:(e,t,n)=>{n.d(t,{T:()=>r});n(21703),n(757658);var o=n(95371);class r{constructor(e,t,n){if(this.maxDepth=void 0,this.start=void 0,this.end=void 0,this.startPathSet=void 0,this.endPathSet=void 0,this.isInStartPath=e=>this.startPathSet.has(e),this.isInEndPath=e=>this.endPathSet.has(e),this.commonAncestor=e,this.startPath=t,this.endPath=n,0===this.startPath.length||0===this.endPath.length)throw new Error(`Cannot create TreeRange with empty path: ${this.startPath} ${this.endPath}`);this.start=this.startPath[this.startPath.length-1],this.end=this.endPath[this.endPath.length-1],this.startPathSet=new Set(t),this.endPathSet=new Set(n),this.maxDepth=Math.max(this.startPath.length,this.endPath.length)}static fromNearestCommonAncestor(e,t){const n=(0,o.qF)(e,t);if(!(n<0))return new this(e[n],e.slice(n),t.slice(n))}getStartBoundary(e){if(e>=this.startPath.length||e<0)return;const t=this.startPath[e];if(0===e&&this.startPath.length<=1&&this.endPath.length<=1)return{parentType:"commonAncestor",parent:t,childrenBeforeRange:[],childrenInsideRange:[],childrenAfterRange:t.children.slice()};const n=t.children.findIndex(this.isInStartPath)+1,o=t.children.findIndex(this.isInEndPath),r=t.children.slice(0,n),i=t.children.slice(n,-1===o?void 0:o+1),a=-1===o?[]:t.children.slice(o+1);return 0===e?{parentType:"commonAncestor",parent:t,childrenBeforeRange:r,childrenInsideRange:i,childrenAfterRange:a}:{parentType:"startPath",parent:t,childrenBeforeRange:r,childrenInsideRange:i}}getEndBoundary(e){if(e>=this.endPath.length||e<0)return;if(0===e)return this.getStartBoundary(0);const t=this.endPath[e],n=t.children.findIndex(this.isInStartPath)+1,o=t.children.findIndex(this.isInEndPath)+1,r=t.children.slice(n,o),i=t.children.slice(o);return{parentType:"endPath",parent:t,childrenInsideRange:r,childrenAfterRange:i}}getAnalagousNodesAtOffset(e){const t=this.startPath.length-1-e,n=this.endPath.length-1-e;return{start:this.getStartBoundary(t),end:this.getEndBoundary(n)}}*iterateAnalogousNodes(){for(let e=0;e<this.maxDepth;e++)yield this.getAnalagousNodesAtOffset(e)}getDeletionAtOffset(e){const{start:t,end:n}=this.getAnalagousNodesAtOffset(e),o=[];t&&t.childrenInsideRange.length>0&&o.push({operation:"delete",deleteFromParent:t.parent,deletingChildren:t.childrenInsideRange});const r=(null==t?void 0:t.parent)||this.commonAncestor;if(r&&n&&n.parent!==this.commonAncestor&&n.parent!==r&&n.childrenAfterRange.length>0){const e=r.children.find(this.isInStartPath);o.push({operation:"move",moveFromParent:n.parent,movingChildren:n.childrenAfterRange,moveToParent:r,moveToAdjacentSibling:e,moveToDirection:e?"listAfter":"listBefore"})}return o}*iterateDeletion(){for(let e=0;e<this.maxDepth;e++)yield*this.getDeletionAtOffset(e)}getInsertionAtOffset(e,t,n){const o=Math.max(0,e.length-1-t),r=e[o],i=e[o+1],{start:a,end:s}=this.getAnalagousNodesAtOffset(t),l=[];if(a&&a.childrenInsideRange.length>0){const e=n.get(r)||i;l.push({operation:"move",moveFromParent:a.parent,movingChildren:a.childrenInsideRange,moveToParent:r,moveToAdjacentSibling:e,moveToDirection:e?"listAfter":"listBefore"});const t=a.childrenInsideRange[a.childrenInsideRange.length-1];n.set(r,t)}const c=this.startPath.length-1-t,d=Math.min(c,this.endPath.length-1),u=this.getEndBoundary(d);if(u&&u.parent!==this.commonAncestor&&r!==e[0]){const e=r.children.indexOf(i)+1,t=r.children.slice(e);if(t.length){const e=0===u.childrenInsideRange.length&&u.childrenAfterRange.length>0,n=e?u.childrenAfterRange[0]:u.childrenInsideRange[u.childrenInsideRange.length-1];l.push({operation:"move",moveFromParent:r,movingChildren:t,moveToParent:u.parent,moveToAdjacentSibling:n,moveToDirection:e?"listBefore":"listAfter"})}}return s&&s.parent!==this.commonAncestor&&s.childrenAfterRange.length>0&&l.push({operation:"delete",deleteFromParent:s.parent,deletingChildren:s.childrenAfterRange}),l}*iterateInsertionAt(e){const t=new Map,n=[];for(let o=0;o<this.maxDepth;o++)n.push(...this.getInsertionAtOffset(e,o,t));yield*n}}},766504:(e,t,n)=>{n.d(t,{I:()=>a,o:()=>s});var o=n(401898),r=n(145953);let i;const a="guest";i=Symbol.iterator;class s{constructor(e){this.data=void 0,this.data=e??{}}getUserRecordMap(e){const t=e??a;let n=this.data[t];return n||(n=r.PF.create(),this.data[t]=n),n}getValue(e){return this.getUserRecordMap(e.userId).getValue(e.pointer)}getRole(e){return this.getUserRecordMap(e.userId).getRole(e.pointer)}setValueAndRole(e,t,n){return this.getUserRecordMap(e.userId).setValueAndRole(e.pointer,t,n),this}setModelAndRole(e,t,n){return this.getUserRecordMap(e.userId).setModelAndRole(e.pointer,t,n),this}delete(e){this.getUserRecordMap(e.userId).delete(e.pointer)}*[i](){for(const[e,t]of(0,o.qP)(this.data))for(const{pointer:n,model:o,role:r}of t)void 0!==o&&(yield{pointer:n,model:o,role:r,userId:e===a?void 0:e})}}},340902:(e,t,n)=>{n.d(t,{B9:()=>M,BX:()=>I,Fb:()=>F,KN:()=>U,OC:()=>k,RR:()=>N,Yr:()=>C,Z3:()=>R,fc:()=>D,gg:()=>A,hY:()=>E,j4:()=>P,lv:()=>B,md:()=>Z,n_:()=>V,tR:()=>S});n(757658);var o=n(653965),r=n(307032),i=n(401898),a=n(619584),s=n(541432),l=n(163171),c=(n(180951),n(959753)),d=n(772141),u=n(570921),p=n(421202),m=n(606287),g=(n(213493),n(933709)),f=n(865311),h=n(475246),v=n(429369),y=n(519889),b=n(399108),_=n(421838);a.hM;function S(e,t){const n=c.kk5.fromValue(u.TY,t),{edits:i,index:a}=e,s=[...n&&n.getEdits()||[],...i],l=b.VR(s),d=l[0],f=d&&d.timestamp.toString()||n&&n.start_time||i[0].timestamp,y=o.Z$(l),_=y&&y.timestamp.toString()||n&&n.end_time||f,S=w(i[0]),k=function(e){const{space_id:t,navigable_block_id:n,collection_id:o,collection_row_id:r,top_level_block_id:i,discussion_id:a,team_id:s,access_request_type:l}=e;return n?"guest_invite_request"===l?{parent_table:h.bx,parent_id:t}:{parent_table:p.iU,parent_id:n}:i?{parent_table:p.iU,parent_id:i}:r?{parent_table:p.iU,parent_id:r}:a?{parent_table:g.qF,parent_id:a}:o?{parent_table:m.vF,parent_id:o}:s?{parent_table:v.e0,parent_id:s}:{parent_table:h.bx,parent_id:t}}(i[0]);return{type:u.L8[i[0].type],index:a,start_time:f.toString(),end_time:_.toString(),edits:l.slice(0,1e3),invalid:x(l),shard_id:(0,r.bm)(S.space_id),context_id:u.rH(S),...S,...k}}function k(e){if("collection-changed"===e.type&&e.collection_data){if(!e.collection_data.before&&!e.collection_data.after)return!1;if(!e.collection_data.before||!e.collection_data.after)return!0;const t=e.collection_data.before.description,n=e.collection_data.after.description;return(0,_.Dne)(t,n)}if("collection-created"===e.type&&e.collection_data){const t=e.collection_data.description;return Boolean(t)}return!1}function w(e){return a.ei(e,u.uJ)}function x(e){if(0===b.hI(e).length)return!0;{const t=e[0];if("mention-deleted"===t.type)return!0;if("mention-created"===t.type){if(t.authors&&t.authors.some((e=>e.table===y.KJ&&e.id===t.mentioned_user_id)))return!0}else if(e.every((e=>"comment-deleted"===e.type)))return!0}return!1}function I(e,t){const n=function(e){const t=c.kk5.fromValue(u.TY,e),n=t&&t.getEdits()||[];return a.cf(o.xH(n.map((e=>e.authors||[]))))}(c.kk5.fromValue(u.TY,e));return n.some((e=>e.table===y.KJ&&e.id===t))}function C(e){const{before:t,after:n}=e,o=[];return new Set((0,i.Yd)(t.properties||{}).concat((0,i.Yd)(n.properties||{}))).forEach((e=>{(0,_.Dne)(t&&t.properties&&t.properties[e],n&&n.properties&&n.properties[e])&&o.push(e)})),o}const T=["page_icon","is_placeholder"];function M(e){const{before:t,after:n}=e,o=[];return T.forEach((e=>{(t.format&&t.format[e])!==(n.format&&n.format[e])&&o.push(e)})),o}function P(e){const{before:t,after:n,property:o}=e;return(0,_.Dne)(t&&t.properties&&t.properties[o],n&&n.properties&&n.properties[o])}function A(e){return(0,l.OS)(e).length>0}function R(e){return e.after.type===s.Ti.tableRow&&C(e).length>0}function D(e){return M(e).length>0}function B(e){const{before:t,after:n}=e,o=c.kk5.fromBlock(t),r=c.kk5.fromBlock(n),i=o.type,a=r.type,s=o.isNavigableBlock()&&r.isNavigableBlock();return i&&a&&i!==a&&!s}function E(e){const{activity:t,getRecordModel:n,baseUrl:o,pageVisitSource:r}=e;if(t.isType("top-level-block-created")||t.isType("top-level-block-deleted")){const e=n(t.getTopLevelBlockPointer());if(e)return e.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}else if(t.isType("commented")){const e=n(t.getDiscussionPointer());if(e){const t=n(e.getParentPointer());if(t)return t.getRenderUrl({getRecordModel:n,baseUrl:o,discussionId:e.id,pageVisitSource:r})}}else if(t.isType("collection-row-created")||t.isType("collection-row-deleted")){const e=n(t.getCollectionRowPointer());if(e)return e.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}else if(t.isType("permissions-edited")){const e=t.getNavigableBlockPointer();if(e){const t=n(e);if(t)return t.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}else{const e=n(t.getSpacePointer());if(e)return e.getRenderUrl({baseUrl:o})}}else if(t.isType("block-edited")){const e=n(t.getNavigableBlockPointer());if(e)return e.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}else if(t.isType("user-mentioned")){const e=n(t.getMentionedBlockPointer());if(e)return e.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}else if(t.isType("reminder")){const e=n(t.getReminderBlockPointer());if(e)return e.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}else if(t.isType("user-invited")){const e=t.getNavigableBlockPointer();if(e){const t=n(e);if(t)return t.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}else{const e=n(t.getSpacePointer());if(e)return e.getRenderUrl({baseUrl:o})}}else if(t.isType("block-property-edited")){const e=n(t.getNavigableBlockPointer());if(e)return e.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}else if(t.isType("private-content-transferred")){const e=n(t.getNavigableBlockPointer());if(e)return e.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}else if(t.isType("access-request-resolved")){const e=n(t.getNavigableBlockPointer());if(e)return e.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}else if(t.isType("verification-expired")){const e=n(t.getNavigableBlockPointer());if(e)return e.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}else if(t.isType("in-app-notification-automation-action-triggered")){const e=n(t.getNavigableBlockPointer());if(e)return e.getRenderUrl({getRecordModel:n,baseUrl:o,pageVisitSource:r})}return o||"/"}function F(e){switch(e){case"top-level-block-created":return"activity_top_level_block_created";case"top-level-block-deleted":return"activity_top_level_block_deleted";case"collection-row-created":return"activity_collection_row_created";case"collection-row-deleted":return"activity_collection_row_deleted";case"block-edited":return"activity_block_edited";case"block-property-edited":return"activity_block_property_edited";case"permissions-edited":return"activity_permissions_edited";case"user-mentioned":return"activity_mention";case"commented":return"activity_comment";case"user-invited":return"activity_invited";case"collection-edited":return"collection_edited";case"collection-view-edited":return"collection_view_edited";case"collection-property-edited":return"collection_property_edited";case"reminder":return"activity_reminder";case"permission-group-edited":return"activity_permission_group_edited";case"page-locked":return"activity_page_locked";case"page-unlocked":return"activity_page_unlocked";case"email-edited":return"activity_email_edited";case"access-requested":return"activity_access_requested";case"access-request-resolved":return"activity_access_request_resolved";case"page-deleted":return"activity_page_deleted";case"page-restored":return"activity_page_restored";case"page-permanently-deleted":return"activity_page_permanently_deleted";case"team-membership-edited":return"activity_team_membership_edited";case"private-content-transferred":return"activity_private_content_transferred";case"permission-group-mentioned":return"activity_permission_group_mentioned";case"verification-expired":return"activity_verification_expired";case"import-completed":return"activity_import_completed";case"export-completed":return"activity_export_completed";case"in-app-notification-automation-action-triggered":return"activity_in_app_notification_automation_action_triggered"}}function Z(e){const t=[],n=[],o=[];return e.forEach((e=>{!function(e){if("permission-created"===e.type){const t=e.permission_data;if("user_permission"===t.type&&d.YX(t.role)&&e.authors&&1===e.authors.length&&e.authors[0].table===y.KJ&&e.authors[0].id===t.user_id)return!0}return!1}(e)?"permission-restriction-created"===e.type||"permission-restriction-deleted"===e.type?n.push(e):o.push(e):t.push(e)})),{autojoinEdits:t,inheritanceEdits:n,otherEdits:o}}function U(e){return"commented"===e||"following"===f.hE[e]}function V(e){return"mentions"===f.hE[e]}function N(e){return"block-changed"===e.type&&e.block_data.after.block_value.type===s.Ti.page}},266897:(e,t,n)=>{n.d(t,{$4:()=>I,$S:()=>m,D$:()=>_,F3:()=>u,Hl:()=>C,I4:()=>x,Iq:()=>f,Jp:()=>S,LU:()=>y,ON:()=>w,Wk:()=>h,Xv:()=>v,YU:()=>g,dp:()=>b,m3:()=>k,uC:()=>p});var o=n(401898),r=n(212847),i=n(715070),a=n(959753),s=n(554368),l=n(177420),c=n(519889);const d={[c.KJ]:!0,[l.cZ]:!0,[s.y0]:!0};const u=r.union([r.object({required:{table:r.literals("bot","notion_user"),id:r.string()},optional:{spaceId:r.string()}}),r.object({required:{table:r.literal("agent"),id:r.string(),spaceId:r.string()},optional:{}})]);function p(e){return e.isUser()}function m(e){return e.table===c.KJ}function g(e){return e.table===l.cZ}function f(e){return e.table===s.y0}function h(e){return"object"==typeof e&&"table"in e&&"id"in e&&("string"==typeof(t=e.table)&&t in d);var t}function v(e){return void 0!==e&&"pointer"in e}function y(e){return a.kk5.isAnyModel(e)?e.asActor:"asActor"in e?e:void 0===e.value?{table:e.table,asActor:void 0}:a.kk5.fromRecordWithTable(e).asActor}function b(e){return a.kk5.fromValue(c.KJ,e)}function _(e){return a.kk5.fromValue(l.cZ,e)}function S(e){return a.kk5.fromValue(s.y0,e)}function k(e){return e?b(e):{table:c.KJ,asActor:void 0}}function w(e){return e?_(e):{table:l.cZ,asActor:void 0}}function x(e){return e?S(e):{table:s.y0,asActor:void 0}}function I(e,t){return t?t.table===c.KJ?(null===(n=t.asActor)||void 0===n?void 0:n.getDisplayName(e))??e.formatMessage(a.T_T.messages.anonymousPlaceholder):t.table===l.cZ?(0,i.Mh)(t.asActor):t.table===s.y0?(null===(r=t.asActor)||void 0===r?void 0:r.getName())??e.formatMessage(a.Rgi.messages.unnamedAgent):void(0,o.t1)(t):e.formatMessage(a.T_T.messages.anonymousPlaceholder);var n,r}function C(e){var t;const{pointer:n}=e;return(null===(t=a.omK.fromGetRecordValueFn(e.getRecordValue||e.getRecordModel)(n))||void 0===t?void 0:t.asActor)??{table:n.table,asActor:void 0}}},319234:(e,t,n)=>{n.d(t,{A:()=>i});const o=/^\d{5}(-\d{4})?$/,r=/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] ?\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i;function i(e){if(!e.country)return!1;switch(e.country){case"US":return o.test(e.zipCode);case"CA":return r.test(e.zipCode);default:return!0}}},687205:(e,t,n)=>{n.d(t,{Dr:()=>o,K9:()=>a,nI:()=>r,vK:()=>i});const o=(0,n(709291).defineMessages)({translateSpanish:{defaultMessage:"Spanish",id:"id.completions.translateSpanish"},translateFrench:{defaultMessage:"French",id:"id.completions.translateFrench"},translateKorean:{defaultMessage:"Korean",id:"id.completions.translateKorean"},translateJapanese:{defaultMessage:"Japanese",id:"id.completions.translateJapanese"},translateEnglish:{defaultMessage:"English",id:"id.completions.translateEnglish"},translateChineseSimplified:{defaultMessage:"Chinese (Simplified)",id:"id.completions.translateChineseSimplified"},translateChineseTraditional:{defaultMessage:"Chinese (Traditional)",id:"id.completions.translateChineseTraditional"},translateRussian:{defaultMessage:"Russian",id:"id.completions.translateRussian"},translatePortuguese:{defaultMessage:"Portuguese",id:"id.completions.translatePortuguese"},translateGerman:{defaultMessage:"German",id:"id.completions.translateGerman"},translateItalian:{defaultMessage:"Italian",id:"id.completions.translateItalian"},translateDutch:{defaultMessage:"Dutch",id:"id.completions.translateDutch"},translateIndonesian:{defaultMessage:"Indonesian",id:"id.completions.translateIndonesian"},translateFilipino:{defaultMessage:"Filipino",id:"id.completions.translateFilipino"},translateVietnamese:{defaultMessage:"Vietnamese",id:"id.completions.translateVietnamese"},changeToneProfessional:{defaultMessage:"Professional",id:"id.completions.changeToneProfessional"},changeToneCasual:{defaultMessage:"Casual",id:"id.completions.changeToneCasual"},changeToneStraightforward:{defaultMessage:"Straightforward",id:"id.completions.changeToneStraightforward"},changeToneConfident:{defaultMessage:"Confident",id:"id.completions.changeToneConfident"},changeToneFriendly:{defaultMessage:"Friendly",id:"id.completions.changeToneFriendly"}}),r=[{key:"english",name:o.translateEnglish},{key:"korean",name:o.translateKorean},{key:"chinese (simplified)",name:o.translateChineseSimplified},{key:"chinese (traditional)",name:o.translateChineseTraditional},{key:"japanese",name:o.translateJapanese},{key:"spanish",name:o.translateSpanish},{key:"russian",name:o.translateRussian},{key:"french",name:o.translateFrench},{key:"portuguese",name:o.translatePortuguese},{key:"german",name:o.translateGerman},{key:"italian",name:o.translateItalian},{key:"dutch",name:o.translateDutch},{key:"indonesian",name:o.translateIndonesian},{key:"filipino",name:o.translateFilipino},{key:"vietnamese",name:o.translateVietnamese}],i=[{key:"professional",name:o.changeToneProfessional},{key:"casual",name:o.changeToneCasual},{key:"straightforward",name:o.changeToneStraightforward},{key:"confident",name:o.changeToneConfident},{key:"friendly",name:o.changeToneFriendly}];function a(e){return"formula"!==e.type&&"rollup"!==e.type&&"relation"!==e.type&&"file"!==e.type&&"url"!==e.type&&"auto_increment_id"!==e.type&&"button"!==e.type&&"email"!==e.type&&"phone_number"!==e.type}},779946:(e,t,n)=>{n.d(t,{iI:()=>b,HR:()=>S,SY:()=>y,Q3:()=>_,rQ:()=>g,xx:()=>v,j:()=>f,k3:()=>k});n(757658);var o=n(552629),r=n(401898),i=n(218265),a=n(674686),s=n(568626),l=n(554153),c=n(646637);let d,u,p=[],m="/";async function g(e){const{device:t,config:n,cookieService:o}=e;u=!["staging","production"].includes(n.env),await a.vO({trackingType:"targeting",cookieService:o})&&(t.isNative||t.doNotTrackEnabled||(m=function(e){if(e.isLocalhost)return"http://localhost:3000";return"https://aif.notion.so"}(n),function(e){if(!m)return;const t=document.createElement("iframe");t.setAttribute("sandbox","allow-scripts allow-same-origin"),t.setAttribute("style","position: absolute; opacity: 0; width: 1px; height: 1px; top: 0; left: 0; border: none; display: block; z-index: -1;"),t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex","-1"),t.setAttribute("referrerpolicy","no-referrer"),t.setAttribute("src",e.aif.url),document.body.appendChild(t),t.addEventListener("load",(()=>{d=t;for(const e of p)h(t,e);p=[]}))}(n)))}async function f(e){const{device:t,event:n,cookieService:r,source:i}=e;if((!r||await a.vO({trackingType:"targeting",cookieService:r}))&&!(u&&n.google||t&&(t.isNative||t.doNotTrackEnabled)))try{!function(e){const{event:t}=e,n=e.source??"client";if("front"===n){if(t.google&&"custom"===t.google.eventName){(window.dataLayer=window.dataLayer||[]).push({event:t.google.data.event,data:t.google.data.data})}}else d?d.contentWindow&&d.contentWindow.postMessage(t,m):p.push(t)}({event:n,source:i})}catch(l){s.log({level:"error",from:"adAnalyticsHelpers",type:"analyticsTrack",error:(0,o.Ui)(l)})}}function h(e,t){(function(e){var t,n;return"CompleteRegistration"===(null===(t=e.facebook)||void 0===t?void 0:t.eventName)||"registration"===(null===(n=e.google)||void 0===n?void 0:n.eventName)})(t)&&s.log({level:"info",from:"adAnalyticsHelpers",type:"analyticsTrackSignupIFramePostCall"}),e.contentWindow&&e.contentWindow.postMessage(t,m)}function v(e){if("facebook"===e.type){const t=`fb.1.${Date.now()}.${e.id}`;c.Z.set("adClick",{type:"facebook",id:t})}else"google"===e.type?c.Z.set("adClick",{type:"google",id:e.id}):(0,r.t1)(e)}function y(){return c.Z.get("adClick")}function b(){c.Z.remove("adClick")}function _(){return c.Z.get("fbp")}function S(){l.Z.remove("fbp")}async function k(e){var t;const{device:n,email:o,cookieService:r}=e,a=(0,i.DP)(null===(t=document.location)||void 0===t?void 0:t.href),s=null==a?void 0:a.get("cid"),l=null==a?void 0:a.get("metadata_cid");var c;if(l)return f({device:n,event:{metadataio:{eventName:"sign_up",data:{email:o,cid:s,mcid:l,url:null===(c=document.location)||void 0===c?void 0:c.href}}},cookieService:r})}},682813:(e,t,n)=>{n.d(t,{e:()=>r});var o=n(401898);function r(e,t){const{notificationId:n,activityId:r,sessionId:i,from:a,alreadyRead:s}=t,l=function(e){const{alreadyRead:t,from:n}=e;switch(n){case"mark_as_unread":return t?"unread":"no_change";case"read_on_page":case"email":case"mark_as_read":case"add_reaction":case"remove_reaction":case"title":case"body":case"frame":case"archive":case"unarchive":case"open_reply_menu":case"mark_all_as_read":case"open_automation_view_all_notifications_menu":case"main":case"approve_request_access":case"deny_request_access":return t?"no_change":"read";default:return(0,o.t1)(n)}}({alreadyRead:s,from:a});if("no_change"===l)return;const c={notificationId:n,activityId:r,sessionId:i,from:a,target:l};e.trackEvent({eventName:"mark_notification_as_read",properties:c})}},460341:(e,t,n)=>{function o(e){var t;return null==e||null===(t=e.split(".notion."))||void 0===t?void 0:t[1]}n.d(t,{Q:()=>o})},845369:(e,t,n)=>{n.d(t,{B7:()=>i,Pu:()=>r});var o=n(212847);const r="render_duration",i=(new Set(["destinations","emergencyThrottlePercentage","amplitudeOptions","datadogOptions","snowflakeOptions","statsigOptions","customerIoOptions"]),o.literals("connected_apps_settings","compliance_connected_apps_settings","external_object_instance_block","external_object_instance_inline_popup","external_object_instance_block_error_dropdown","placeholder_root_external_collection_view_block","connected_relation_property_menu","source_picker_connect_another_account","integration_gallery","collection_settings_property_type","integration_file_picker","send_to_notion","unfurl","messages_tab","install_redirect","all_updates","notifications_and_settings","collection_view_settings","share_menu","space_settings","workspace_connections_redirect","import_settings"),["reply_menu_mentions_comments","reply_menu_archive","reply_menu_all_updates","updates_menu_mentions_comments","updates_menu_archive","updates_menu_all_updates"]),a=["platform","deviceType","device_os","is_mobile_beta","desktopArch"],s=["app_version","mobile_app_version","desktop_app_version","desktopOsVersion","desktopElectronVersion","mobileNativeSystemVersion","mobileNativeAppVersion","is_experimental_build"]},633409:(e,t,n)=>{n.d(t,{x:()=>o});const o={CreatedBy:"notion://docs/created_by_property",CreatedTime:"notion://docs/created_time_property",LastEditedBy:"notion://docs/last_edited_by_property",LastEditedTime:"notion://docs/last_edited_time_property",Tags:"notion://docs/doc_tags_property",Type:"notion://docs/type_property",Status:"notion://docs/docs_status_property"}},371663:(e,t,n)=>{n.d(t,{tt:()=>a.tt,Be:()=>a.Be,LI:()=>a.LI,fW:()=>a.fW,By:()=>a.By,zU:()=>a.zU,nG:()=>a.nG,Cx:()=>a.Cx,Fi:()=>a.Fi,KW:()=>a.KW,xm:()=>a.xm,mr:()=>r.mr,Aw:()=>a.Aw,wW:()=>a.wW,Yb:()=>a.Yb,T3:()=>a.T3,r:()=>a.r,Ll:()=>a.Ll,J1:()=>a.J1,nl:()=>i.nl,hp:()=>i.hp,SF:()=>i.SF,NH:()=>i.NH,eH:()=>i.eH,Rw:()=>i.Rw,YE:()=>i.YE,df:()=>i.J1,p$:()=>a.p$,gg:()=>a.gg,NB:()=>a.NB,ac:()=>o.ac,lw:()=>o.lw,V3:()=>o.V3,ye:()=>o.ye,cI:()=>o.cI,z3:()=>o.z3,Kk:()=>o.Kk,g3:()=>o.g3,iS:()=>o.iS,sV:()=>o.sV,WL:()=>o.WL,tD:()=>o.tD,y$:()=>o.y$,Ym:()=>a.iS,ii:()=>a.ii,WN:()=>a.WN,Pf:()=>a.Pf,br:()=>a.br,jh:()=>a.jh,rK:()=>a.rK,GZ:()=>a.GZ,Ww:()=>a.Ww,uV:()=>o.uV,SA:()=>a.SA,zI:()=>r.zI,Iz:()=>r.Iz,b0:()=>i.b0,W:()=>o.W,eK:()=>i.eK,Es:()=>o.Es,e1:()=>o.e1});var o=n(259308),r=n(556606),i=n(761514),a=n(494714);const s="existing_team",l="quick_capture",c="typed_db_migration",d="template_gallery";a.Yb,a.tt,a.r,a.rK,a.KW,a.Ll,a.Yb,a.tt,a.r,a.KW,a.rK,a.iS,a.wW,a.p$,a.nG,a.zU,a.Fi,a.GZ,a.br,a.iS,a.wW,a.iS,a.iS,a.wW,a.p$,a.nG,a.zU,a.Fi,a.GZ},670475:(e,t,n)=>{n.d(t,{C:()=>o});const o={CreatedBy:"notion://meetings/created_by_property",CreatedTime:"notion://meetings/created_time_property",LastEditedBy:"notion://meetings/last_edited_by_property",LastEditedTime:"notion://meetings/last_edited_time_property",Attendees:"notion://meetings/attendees_property",MeetingTime:"notion://meetings/meeting_time_property",MeetingType:"notion://meetings/meeting_type_property",Tags:"notion://meetings/meeting_tags_property",MeetingNoteToCalendarEventRelation:"notion://meetings/meeting_note_to_calendar_event_relation_property",CalendarEventToMeetingNoteRelation:"notion://meetings/calendar_event_to_meeting_note_relation_property"}},556606:(e,t,n)=>{n.d(t,{Iz:()=>s,mr:()=>l,zI:()=>i});var o=n(709291),r=n(142613);const i={People:"notion://projects/people_property",Status:"notion://projects/status_property",ProjectDates:"notion://projects/project_dates_property",Priority:"notion://projects/priority_property",Collaborators:"notion://projects/collaborators_property",AiSummary:"notion://projects/project_summary_feature",ProjectToTaskRelation:"notion://projects/project_to_task_relation",BlockingRelation:"notion://projects/project_blocking_relation",BlockedByRelation:"notion://projects/project_blocked_by_relation",CompletionRollup:"notion://projects/completion_rollup",Description:"notion://projects/description_property",JiraSyncBoardToProjectRelation:"notion://projects/jira_sync_board_to_project_relation",JiraSyncProjectToConnectedBoardRelation:"notion://projects/jira_sync_project_to_connected_board_relation"},a=(0,o.defineMessages)({projectTitleProperty:{id:"databaseTypes.projectTypes.projectTitleProperty",defaultMessage:"Project name"},projectOwner:{defaultMessage:"Owner",id:"databaseTypes.projectTypes.projectOwner"},datesProperty:{defaultMessage:"Dates",id:"databaseTypes.projectTypes.datesProperty"},status:{defaultMessage:"Status",id:"appTemplates.projects.status"},done:{defaultMessage:"Done",id:"appTemplates.projects.done"},backlog:{id:"appTemplates.projects.backlog",defaultMessage:"Backlog"},planned:{id:"appTemplates.projects.planned",defaultMessage:"Planning"},paused:{defaultMessage:"Paused",id:"appTemplates.projects.paused"},inProgress:{defaultMessage:"In progress",id:"appTemplates.projects.inProgress"},cancelled:{defaultMessage:"Cancelled",id:"appTemplates.projects.cancelled"}});function s(e){return{title:{type:"title",name:e.formatMessage(a.projectTitleProperty)},[i.People]:{type:"person",name:e.formatMessage(a.projectOwner)},[i.ProjectDates]:{type:"date",name:e.formatMessage(a.datesProperty)},[i.Status]:{name:e.formatMessage(a.status),type:"status",groups:[{id:"todo-status-group",name:r.G1,color:"gray",optionIds:["backlog"]},{id:"in-progress-status-group",name:r.Ho,color:"blue",optionIds:["planned","in-progress","paused"]},{id:"complete-status-group",name:r.RW,color:"green",optionIds:["canceled","done"]}],options:[{id:"planned",color:"blue",value:e.formatMessage(a.planned)},{id:"in-progress",color:"yellow",value:e.formatMessage(a.inProgress)},{id:"paused",color:"purple",value:e.formatMessage(a.paused)},{id:"backlog",value:e.formatMessage(a.backlog)},{id:"done",color:"green",value:e.formatMessage(a.done)},{id:"canceled",color:"red",value:e.formatMessage(a.cancelled)}],defaultOption:"Backlog"}}}const l="notion://projects/project_summary_feature"},761514:(e,t,n)=>{n.d(t,{J1:()=>a,NH:()=>u,Rw:()=>c,SF:()=>s,YE:()=>l,b0:()=>i,eH:()=>d,eK:()=>f,hp:()=>p,nl:()=>m});var o=n(709291),r=n(142613);const i={Status:"notion://sprints/sprint_status_property",StatusV2:"notion://sprints/sprint_status_property_v2",UniqueId:"notion://sprints/unique_id_property",Dates:"notion://sprints/dates_property",SprintToTaskRelation:"notion://sprints/sprint_task_relation",TotalTasksRollup:"notion://sprints/total_tasks_property",CompletedTasksRollup:"notion://sprints/completed_tasks_property"},a="past",s="current",l="next",c="last",d="future",u="future-status-group",p="current-status-group",m="complete-status-group",g=(0,o.defineMessages)({sprintTitleProperty:{id:"appTemplates.tasks.sprintTitleProperty",defaultMessage:"Sprint name"},datesProperty:{defaultMessage:"Dates",id:"appTemplates.sprints.timelineProperty"},uniqueIdProperty:{defaultMessage:"Sprint ID",id:"appTemplatesSprintsV2.sprints.uniqueIdProperty"},sprintStatus:{id:"appTemplatesSprintsV2.sprints.sprintStatus",defaultMessage:"Sprint status"},next:{id:"appTemplatesSprintsV2.sprints.next",defaultMessage:"Next"},last:{id:"appTemplatesSprintsV2.sprints.last",defaultMessage:"Last"},past:{id:"appTemplatesSprintsV2.sprints.past",defaultMessage:"Past"},future:{id:"appTemplatesSprintsV2.sprints.future",defaultMessage:"Future"},current:{id:"appTemplatesSprintsV2.sprints.current",defaultMessage:"Current"}});function f(e){return{title:{type:"title",name:e.formatMessage(g.sprintTitleProperty)},[i.StatusV2]:{name:e.formatMessage(g.sprintStatus),type:"status",groups:[{id:p,name:r.Ap,color:"blue",optionIds:[s]},{id:u,name:r.JV,color:"gray",optionIds:[l,d]},{id:m,name:r.RW,color:"green",optionIds:[c,a]}],options:[{id:s,color:"blue",value:e.formatMessage(g.current)},{id:l,color:"purple",value:e.formatMessage(g.next)},{id:d,color:"gray",value:e.formatMessage(g.future)},{id:c,color:"yellow",value:e.formatMessage(g.last)},{id:a,color:"brown",value:e.formatMessage(g.past)}],defaultOption:e.formatMessage(g.future)},[i.Dates]:{type:"date",name:e.formatMessage(g.datesProperty)},[i.UniqueId]:{type:"auto_increment_id",name:e.formatMessage(g.uniqueIdProperty)}}}},259308:(e,t,n)=>{n.d(t,{Es:()=>s,Kk:()=>u,V3:()=>y,W:()=>x,WL:()=>g,ac:()=>f,cI:()=>b,e1:()=>k,g3:()=>l,iS:()=>h,lw:()=>v,sV:()=>c,tD:()=>_,uV:()=>w,y$:()=>d,ye:()=>m,z3:()=>p});var o=n(709291),r=n(653965),i=n(142613),a=n(977657);a.tO.map((e=>`notion://feature/connection_property_${e}`));const s={Status:"notion://tasks/status_property",Assign:"notion://tasks/assign_property",AiSummary:"notion://tasks/ai_summary_property",DueDate:"notion://tasks/due_date_property",Priority:"notion://tasks/priority_property",Tags:"notion://tasks/tags_property",AutoIncrementId:"notion://tasks/auto_increment_id_property",Description:"notion://tasks/description_property",Estimates:"notion://tasks/estimates_property",Reporter:"notion://tasks/reporter_property",Type:"notion://tasks/task_type_property",CreatedTime:"notion://tasks/created_time_property",LastEditedTime:"notion://tasks/last_edited_time_property",LastEditedBy:"notion://tasks/last_edited_by_property",Location:"notion://tasks/location_property",DuplicatesRelation:"notion://tasks/task_duplicates_relation",DuplicateOfRelation:"notion://tasks/task_duplicate_of_relation",ParentTaskRelation:"notion://tasks/parent_task_relation",SubTaskRelation:"notion://tasks/sub_task_relation",TaskToSprintRelation:"notion://tasks/task_sprint_relation",SprintStatusRollup:"notion://tasks/task_sprint_status_rollup",TaskToProjectRelation:"notion://tasks/task_to_project_relation",BlockingRelation:"notion://tasks/task_blocking_relation",BlockedRelation:"notion://tasks/task_blocked_by_relation",GithubPrsRelation:"notion://tasks/task_to_github_prs_relation",GithubPrsToTaskRelation:"notion://tasks/github_prs_to_task_relation",JiraSyncIssueToTaskRelation:"notion://tasks/jira_sync_issue_to_task_relation",JiraSyncTaskToConnectedIssueRelation:"notion://tasks/jira_sync_task_to_connected_issue_relation",...{AiSummaryUntyped:"notion://feature/ai_summary_property",AiCustomAutofill:"notion://feature/ai_custom_autofill_property",AiTranslation:"notion://feature/ai_translation_property",AiKeywords:"notion://feature/ai_keywords_property",...{[a.f3]:`notion://feature/connection_property_${a.f3}`,[a.mQ]:`notion://feature/connection_property_${a.mQ}`,[a.Nw]:`notion://feature/connection_property_${a.Nw}`}}},l="notion://tasks/tasks_current_sprint_view",c="notion://tasks/tasks_sprint_planning_view",d="notion://tasks/tasks_with_no_sprint_view",u="notion://tasks/relative_current_sprint_filter",p="notion://projects/tutorial/tasks/create_a_task",m="notion://tasks/tasks_by_project_view",g="notion://tasks/tasks_table_view",f="notion://tasks/tasks_board_view",h="notion://tasks/my_tasks_view",v="notion://tasks/tasks_by_due_date_view",y="notion://tasks/tasks_by_person_view",b="notion://tasks/tasks_by_status_view",_="notion://tasks/tasks_with_no_sprints_sprint_empty_filter",S=(0,o.defineMessages)({taskTitleProperty:{defaultMessage:"Task name",id:"databaseTypes.taskTypes.taskTitleProperty"},assignProperty:{defaultMessage:"Assignee",id:"databaseTypes.taskTypes.assigneeProperty"},statusProperty:{defaultMessage:"Status",id:"databaseTypes.taskTypes.statusProperty"},dueDateProperty:{defaultMessage:"Due",id:"databaseTypes.taskTypes.dueDateProperty"},notStarted:{defaultMessage:"Not started",id:"databaseTypes.taskTypes.notStarted"},todo:{defaultMessage:"To-do",id:"appTemplates.tasks.todo"},inProgress:{defaultMessage:"In progress",id:"databaseTypes.taskTypes.inProgress"},complete:{defaultMessage:"Complete",id:"databaseTypes.taskTypes.completed"},done:{defaultMessage:"Done",id:"databaseTypes.taskTypes.done"},archived:{defaultMessage:"Archived",id:"databaseTypes.taskTypes.archived"},taskCreatedByProperty:{defaultMessage:"Created by",id:"databaseTypes.taskTypes.taskCreatedByProperty"},createdTimeProperty:{defaultMessage:"Created time",id:"databaseTypes.taskTypes.createdTimeProperty"},lastEditedTimeProperty:{defaultMessage:"Last edited time",id:"databaseTypes.taskTypes.lastEditedTimeProperty"},lastEditedByProperty:{defaultMessage:"Last edited by",id:"databaseTypes.taskTypes.lastEditedByProperty"},locationProperty:{defaultMessage:"Source",id:"databaseTypes.taskTypes.sourceProperty"}});function k(e){return{title:{type:"title",name:e.formatMessage(S.taskTitleProperty)},[s.Assign]:{type:"person",name:e.formatMessage(S.assignProperty)},[s.Status]:{name:e.formatMessage(S.statusProperty),type:"status",groups:[{id:"todo-status-group",name:i.G1,color:"gray",optionIds:["not-started"]},{id:"in-progress-status-group",name:i.Ho,color:"blue",optionIds:["in-progress"]},{id:"complete-status-group",name:i.RW,color:"green",optionIds:["done","archived"]}],options:[{id:"not-started",value:e.formatMessage(S.notStarted)},{id:"in-progress",color:"blue",value:e.formatMessage(S.inProgress)},{id:"done",color:"green",value:e.formatMessage(S.done)},{id:"archived",color:"gray",value:e.formatMessage(S.archived)}],defaultOption:e.formatMessage(S.notStarted)},[s.DueDate]:{type:"date",name:e.formatMessage(S.dueDateProperty)}}}function w(e){return{...k(e),[s.Reporter]:{type:"created_by",name:e.formatMessage(S.taskCreatedByProperty)},[s.CreatedTime]:{type:"created_time",name:e.formatMessage(S.createdTimeProperty)},[s.LastEditedTime]:{type:"last_edited_time",name:e.formatMessage(S.lastEditedTimeProperty)},[s.LastEditedBy]:{type:"last_edited_by",name:e.formatMessage(S.lastEditedByProperty)},[s.Location]:{type:"location",name:e.formatMessage(S.locationProperty),location_type:"parent"}}}function x(e){return r.oA([I,C,e?T:void 0,M])}const I={hidden:!1,property:s.TaskToSprintRelation,value:{type:"relation",value:{type:"relative",value:{type:"builtin",variable:"current"}}}},C={hidden:!1,property:s.TaskToSprintRelation,value:{type:"relation",value:{type:"relative",value:{type:"builtin",variable:"next"}}}},T={hidden:!1,property:s.TaskToSprintRelation,value:{type:"relation",value:{type:"relative",value:{type:"builtin",variable:"last"}}}},M={hidden:!1,property:s.TaskToSprintRelation,value:{type:"relation",value:void 0}}},494714:(e,t,n)=>{n.d(t,{tt:()=>q,Be:()=>j,LI:()=>ae,fW:()=>X,By:()=>R,zU:()=>N,nG:()=>U,Cx:()=>B,Fi:()=>L,KW:()=>W,xm:()=>ee,Aw:()=>P,wW:()=>Z,Yb:()=>z,T3:()=>H,r:()=>G,Ll:()=>K,J1:()=>A,p$:()=>V,gg:()=>T,NB:()=>M,iS:()=>F,ii:()=>x,WN:()=>I,Pf:()=>C,br:()=>w,Sc:()=>E,jh:()=>D,rK:()=>$,GZ:()=>O,mj:()=>Y,LZ:()=>Q,MG:()=>J,Ww:()=>ie,SA:()=>ne,Q6:()=>oe,dK:()=>re});var o=n(709291),r=n(401898),i=n(569651),a=(n(667294),n(745238)),s=n(785893);const l=(0,a.IU)("docsDB",{viewBox:"0 0 27 35",svg:(0,s.jsx)("path",{d:"M5.20312 34.4688H21.7969C25.0312 34.4688 26.6406 32.8281 26.6406 29.5781V15.3906C26.6406 13.375 26.4062 12.5 25.1562 11.2188L16.5469 2.45312C15.3594 1.23438 14.375 0.96875 12.625 0.96875H5.20312C1.98438 0.96875 0.359375 2.625 0.359375 5.875V29.5781C0.359375 32.8438 1.96875 34.4688 5.20312 34.4688ZM5.3125 31.9531C3.70312 31.9531 2.875 31.0938 2.875 29.5312V5.92188C2.875 4.375 3.70312 3.48438 5.32812 3.48438H12.2812V12.5625C12.2812 14.5312 13.2656 15.5 15.2188 15.5H24.125V29.5312C24.125 31.0938 23.2969 31.9531 21.6719 31.9531H5.3125ZM15.5 13.1406C14.875 13.1406 14.6406 12.8906 14.6406 12.2656V3.96875L23.6406 13.1406H15.5Z"})});var c=n(269578),d=n(959699),u=n(554855),p=n(286793),m=n(733507),g=n(959960),f=n(523539),h=n(633409),v=n(670475),y=n(556606),b=n(761514),_=n(259308),S=n(351259),k=n(846283);const w="untyped",x="typed",I="_typedDBpreset",C="_db_tutorial_feature",T="notion://sprints",M="notion://tasks_block",P="notion://projects_block",A="notion://sprints_block",R="notion://docs_block",D="notion://wiki_block",B="notion://meetings_block",E="notion://untyped_block",F="notion://tasks_collection",Z="notion://projects_collection",U="notion://github_prs_sub_external_collection",V="notion://sprints_collection",N="notion://docs_collection",O="notion://wiki_collection",L="notion://meetings_collection",j="notion://calendar_events_sub_external_collection",K="notion://projects/simple_tasks_preset",z="notion://projects/projects_preset",q="notion://projects/agile_preset",H="notion://projects/project_management_importers_preset",G="notion://docs/simple_docs_preset",W="notion://meetings/meetings_preset",$="notion://wiki/company_home_preset",Y="notion://wiki/engineering_wiki_preset",Q="notion://wiki/product_wiki_preset",J="notion://wiki/sales_wiki_preset",X=[F,Z,V,N,O,L,U,j],ee=[K,z,q,H,G,W,$,Y,Q,J],te=[$,Y,Q,J],ne=(0,r.AO)((e=>(0,r.DE)(ee,e)&&!(0,r.DE)(te,e)&&e!==H?{true:e}:{false:e})),oe=new Set([...Object.values(_.Es),...Object.values(y.zI),...Object.values(b.b0),...Object.values(h.x),...Object.values(k.k),...Object.values(v.C)]),re=new Set([...Object.values(S.ti)]),ie=(0,o.defineMessages)({untyped_type:{defaultMessage:"Untyped",id:"dbTypes.untyped.type"},untyped_singular:{defaultMessage:"page",id:"dbTypes.untyped.singular"},untyped_plural:{defaultMessage:"pages",id:"dbTypes.untyped.plural"},untyped_caption:{defaultMessage:"Start a database from scratch",id:"dbTypes.untyped.caption"},untyped_item_singular:{defaultMessage:"item",id:"dbTypes.untypedItem.singular"},untyped_item_plural:{defaultMessage:"items",id:"dbTypes.untypedItem.plural"},task_type:{defaultMessage:"Tasks",id:"dbTypes.task.type"},task_singular:{defaultMessage:"task",id:"dbTypes.task.singular"},task_plural:{defaultMessage:"tasks",id:"dbTypes.task.plural"},task_caption:{defaultMessage:"Simple task management",id:"dbTypes.task.caption"},task_benefit1:{defaultMessage:"See all your tasks across multiple task databases in your personal home",id:"dbTypes.tasks.benefit1"},task_benefit2:{defaultMessage:"Custom page layout tailored for tasks",id:"dbTypes.tasks.benefit2"},task_benefit3:{defaultMessage:"Pre-built properties and notifications",id:"dbTypes.tasks.benefit3"},project_type:{defaultMessage:"Projects",id:"dbTypes.project.type"},project_singular:{defaultMessage:"project",id:"dbTypes.project.singular"},project_plural:{defaultMessage:"projects",id:"dbTypes.project.plural"},project_caption:{defaultMessage:"Organize groups of tasks",id:"dbTypes.project.caption"},project_benefit1:{defaultMessage:"See all your projects across multiple project databases in your personal home",id:"dbTypes.projects.benefit1"},project_benefit2:{defaultMessage:"Custom page layout tailored for projects",id:"dbTypes.projects.benefit2"},github_type:{defaultMessage:"GitHub Pull Requests",id:"dbTypes.github.type"},github_singular:{defaultMessage:"pull request",id:"dbTypes.github.singular"},github_plural:{defaultMessage:"pull requests",id:"dbTypes.github.plural"},sprint_type:{defaultMessage:"Sprints",id:"dbTypes.sprint.type"},sprint_singular:{defaultMessage:"sprint",id:"dbTypes.sprint.singular"},sprint_plural:{defaultMessage:"sprints",id:"dbTypes.sprint.plural"},sprint_caption:{defaultMessage:"Agile project management",id:"dbTypes.sprint.caption"},doc_type:{defaultMessage:"Docs",id:"dbTypes.doc.type"},doc_singular:{defaultMessage:"doc",id:"dbTypes.doc.singular"},doc_plural:{defaultMessage:"docs",id:"dbTypes.doc.plural"},doc_caption:{defaultMessage:"Organize team documents",id:"dbTypes.doc.caption"},wiki_type:{defaultMessage:"Wiki",id:"dbTypes.wiki.type"},meeting_type:{defaultMessage:"Meetings",id:"dbTypes.meeting.type"},meeting_singular:{defaultMessage:"meeting",id:"dbTypes.meeting.singular"},meeting_plural:{defaultMessage:"meetings",id:"dbTypes.meeting.plural"},meeting_caption:{defaultMessage:"Event, Time, Participants...",id:"dbTypes.meeting.caption"},calendar_type:{defaultMessage:"Calendar Events",id:"dbTypes.calendar.type"},calendar_singular:{defaultMessage:"calendar event",id:"dbTypes.calendar.singular"},calendar_plural:{defaultMessage:"calendar events",id:"dbTypes.calendar.plural"}}),ae={[w]:{type:ie.untyped_type,icon:u.a,singular:ie.untyped_singular,plural:ie.untyped_plural,caption:ie.untyped_caption,blockUri:void 0},[F]:{type:ie.task_type,icon:g.w,singular:ie.task_singular,plural:ie.task_plural,caption:ie.task_caption,blockUri:M},[Z]:{type:ie.project_type,icon:p.D,singular:ie.project_singular,plural:ie.project_plural,caption:ie.project_caption,blockUri:P},[U]:{type:ie.github_type,icon:c.f,singular:ie.github_singular,plural:ie.github_plural,blockUri:void 0},[V]:{type:ie.sprint_type,icon:m.L,singular:ie.sprint_singular,plural:ie.sprint_plural,caption:ie.sprint_caption,blockUri:A},[N]:{type:ie.doc_type,icon:l,singular:ie.doc_singular,plural:ie.doc_plural,caption:ie.doc_caption,blockUri:R},[O]:{type:ie.wiki_type,icon:f.Y,singular:ie.untyped_singular,plural:ie.untyped_plural,blockUri:D},[L]:{type:ie.meeting_type,icon:d.N,singular:ie.meeting_singular,plural:ie.meeting_plural,caption:ie.meeting_caption,blockUri:B},[j]:{type:ie.calendar_type,icon:i.C,singular:ie.calendar_singular,plural:ie.calendar_plural,blockUri:void 0}}},240005:(e,t,n)=>{n.d(t,{y:()=>u});var o=n(959699),r=n(554855),i=n(329665),a=n(733507),s=n(959960),l=n(369576),c=n(523539),d=n(494714);const u={untyped:{databaseUris:[],icon:r.a},[d.Ll]:{databaseUris:[d.iS],icon:s.w},[d.Yb]:{databaseUris:[d.wW,d.iS],icon:i.B},[d.tt]:{databaseUris:[d.wW,d.iS,d.p$,d.nG],icon:a.L},[d.T3]:{databaseUris:[d.wW,d.iS]},[d.r]:{databaseUris:[d.zU],icon:l.e},[d.KW]:{databaseUris:[d.Fi],icon:o.N},[d.rK]:{databaseUris:[d.GZ],icon:c.Y},[d.mj]:{databaseUris:[d.GZ],icon:c.Y},[d.LZ]:{databaseUris:[d.GZ],icon:c.Y},[d.MG]:{databaseUris:[d.GZ],icon:c.Y}}},351259:(e,t,n)=>{n.d(t,{S7:()=>i,ti:()=>r});const o="notion://untyped",r={priorityHmlProperty:`${o}/priority_hml_property`,aiSummaryProperty:`${o}/ai_summary_property`,aiCustomAutofillProperty:`${o}/ai_custom_autofill_property`,aiTranslationProperty:`${o}/ai_translation_property`,aiKeywordsProperty:`${o}/ai_keywords_property`,progressBarCurrentProperty:`${o}/progress_bar_current_property`,progressBarTargetProperty:`${o}/progress_bar_target_property`,progressBarFormulaProperty:`${o}/progress_bar_progress_formula_property`,ganttInitiativeProperty:`${o}/gantt_initiative_property`,ganttDueDateProperty:`${o}/gantt_due_date_property`,ganttTimelineView:`${o}/gantt_timeline_view`},i={priorityHmlFeature:`${o}/priority_hml_feature`,aiSummaryFeature:`${o}/ai_summary_feature`,aiCustomAutofillFeature:`${o}/ai_custom_autofill_feature`,aiTranslationFeature:`${o}/ai_translation_feature`,aiKeywordsFeature:`${o}/ai_keywords_feature`,progressBarFeature:`${o}/progress_bar_feature`,ganttChartFeature:`${o}/gantt_chart_feature`}},846283:(e,t,n)=>{n.d(t,{k:()=>o});const o={Owner:"notion://wiki/owner_property"}},172111:(e,t,n)=>{n.d(t,{Ao:()=>v,J2:()=>s,Pf:()=>p,Pi:()=>f,Tx:()=>u,Xj:()=>c,bK:()=>a,cR:()=>g,dD:()=>d,fe:()=>h,ky:()=>m,tq:()=>l,wg:()=>i});n(21703),n(556606),n(259308);var o=n(494714),r=n(240005);const i={tasks:o.iS,projects:o.wW},a="createNew";function s(e){return e&&d(e)?o.LI[e].type:o.LI.untyped.type}function l(e,t){return e&&d(e)?o.LI[e].singular:t?o.Ww.untyped_item_singular:o.LI.untyped.singular}function c(e,t){return e&&d(e)?o.LI[e].plural:t?o.Ww.untyped_item_plural:o.LI.untyped.plural}function d(e){return o.fW.includes(e)}function u(e){return e===o.br}function p(e){return o.Q6.has(e)}function m(e){return o.dK.has(e)}function g(e){return p(e)||m(e)}function f(e){return r.y[e].databaseUris}function h(e){const t=e.getFormatStore().getKeyStore("app_config_uri").getValue(),n=null==t?void 0:t.includes("/tutorial/");return Boolean(n)}function v(e,t){switch(e){case o.iS:case o.wW:case o.p$:return t.accentColors.blue;case o.zU:return t.accentColors.yellow;case o.GZ:case o.Fi:return t.accentColors.red;case o.br:default:return t.mediumIconColor}}},841892:(e,t,n)=>{n.d(t,{Z:()=>o});const o={appleDeveloperMerchantidDomainAssociation:"/apple-developer-merchantid-domain-association",disabledJavascriptHtml:"/disabled-javascript.html",emails:{notionLogoBlackSmallPng:"/emails/notion-logo-black-small.6f608cf5.png",notionLogoSmallSupportsDarkPng:"/emails/notion-logo-small-supports-dark.png",notionWordmarkBlackSmallPng:"/emails/notion-wordmark-black-small.76b8bede.png",notionWordmarkSmallSupportsDarkPng:"/emails/notion-wordmark-small-supports-dark.png"},error500Html:"/error-500.html",fileErrors:{"403Html":"/file-errors/403.html","404Html":"/file-errors/404.html","419Html":"/file-errors/419.html","500Html":"/file-errors/500.html","503Html":"/file-errors/503.html"},images:{aggregations:{averagePng:"/images/aggregations/average.13d131c7.png",checkedPng:"/images/aggregations/checked.559fd230.png",countPng:"/images/aggregations/count.0229e394.png",countValuesPng:"/images/aggregations/countValues.81e24549.png",dateRangePng:"/images/aggregations/dateRange.2219b54f.png",earliestDatePng:"/images/aggregations/earliestDate.1854fe3c.png",emptyPng:"/images/aggregations/empty.5a8e8976.png",latestDatePng:"/images/aggregations/latestDate.4b297359.png",maxPng:"/images/aggregations/max.a6857201.png",medianPng:"/images/aggregations/median.178364f3.png",minPng:"/images/aggregations/min.ea5e7a21.png",notEmptyPng:"/images/aggregations/notEmpty.f8f86445.png",percentCheckedPng:"/images/aggregations/percentChecked.4bc2f766.png",percentEmptyPng:"/images/aggregations/percentEmpty.8e070da8.png",percentNotEmptyPng:"/images/aggregations/percentNotEmpty.c3ac1c83.png",percentUncheckedPng:"/images/aggregations/percentUnchecked.1df5ea48.png",rangePng:"/images/aggregations/range.68f97557.png",sumPng:"/images/aggregations/sum.e0ad6a7e.png",uncheckedPng:"/images/aggregations/unchecked.e4120d79.png",uniquePng:"/images/aggregations/unique.05e3efe4.png"},aiIntro:{intro1Png:"/images/ai-intro/intro1.png",intro2Png:"/images/ai-intro/intro2.png",intro3Png:"/images/ai-intro/intro3.png"},appPackages:{agileGuideImage1Png:"/images/app-packages/agile-guide-image1.png",agileGuideImage2Png:"/images/app-packages/agile-guide-image2.png",agileGuideImage3Png:"/images/app-packages/agile-guide-image3.png",agileGuideImage4Png:"/images/app-packages/agile-guide-image4.png",agileGuideImage5Png:"/images/app-packages/agile-guide-image5.png",agilePresetIconSvg:"/images/app-packages/agile-preset-icon.svg",docsGettingStarted1Png:"/images/app-packages/docs-getting-started-1.png",docsGettingStarted2Png:"/images/app-packages/docs-getting-started-2.png",docsGettingStarted3Png:"/images/app-packages/docs-getting-started-3.png",docsGettingStarted4Png:"/images/app-packages/docs-getting-started-4.png",docsIconSvg:"/images/app-packages/docs-icon.svg",featureAiSummarizeSvg:"/images/app-packages/feature-ai-summarize.svg",featureBoardSvg:"/images/app-packages/feature-board.svg",featureCalendarSvg:"/images/app-packages/feature-calendar.svg",featureDependenciesSvg:"/images/app-packages/feature-dependencies.svg",featureEstimationSvg:"/images/app-packages/feature-estimation.svg",featureGanttSvg:"/images/app-packages/feature-gantt.svg",featureMineSvg:"/images/app-packages/feature-mine.svg",featurePieChartSvg:"/images/app-packages/feature-pie-chart.svg",featurePrioritySvg:"/images/app-packages/feature-priority.svg",featureReleasesSvg:"/images/app-packages/feature-releases.svg",featureRoadmapSvg:"/images/app-packages/feature-roadmap.svg",featureSprintSvg:"/images/app-packages/feature-sprint.svg",featureSprintsSvg:"/images/app-packages/feature-sprints.svg",featureStatusSvg:"/images/app-packages/feature-status.svg",featureSubtasksSvg:"/images/app-packages/feature-subtasks.svg",featureTimeSvg:"/images/app-packages/feature-time.svg",featureTypeSvg:"/images/app-packages/feature-type.svg",featureUpdatesSvg:"/images/app-packages/feature-updates.svg",featureWorkloadSvg:"/images/app-packages/feature-workload.svg",jiraProjectIconSvg:"/images/app-packages/jira-project-icon.svg",jiraTaskIconSvg:"/images/app-packages/jira-task-icon.svg",meetingsGettingStarted1Png:"/images/app-packages/meetings-getting-started-1.png",meetingsGettingStarted2Png:"/images/app-packages/meetings-getting-started-2.png",meetingsGettingStarted3Png:"/images/app-packages/meetings-getting-started-3.png",meetingsGettingStarted4Png:"/images/app-packages/meetings-getting-started-4.png",meetingsIconSvg:"/images/app-packages/meetings-icon.svg",onboardingAppSelectionPng:"/images/app-packages/onboarding-app-selection.png",projectPreview1Png:"/images/app-packages/project-preview1.png",projectsAndTasksGettingStartedPng:"/images/app-packages/projects-and-tasks-getting-started.png",projectsGuideImage1Png:"/images/app-packages/projects-guide-image1.png",projectsGuideImage2Png:"/images/app-packages/projects-guide-image2.png",projectsGuideImage3Png:"/images/app-packages/projects-guide-image3.png",projectsGuideImage4Png:"/images/app-packages/projects-guide-image4.png",projectsGuideImage5Png:"/images/app-packages/projects-guide-image5.png",projectsIconSvg:"/images/app-packages/projects-icon.svg",projectsProjectsEmptyIconPng:"/images/app-packages/projects-projects-empty-icon.png",projectsProjectsTasksPresetPng:"/images/app-packages/projects-projects-tasks-preset.png",projectsTasksSprintsGettingStartedPng:"/images/app-packages/projects-tasks-sprints-getting-started.png",sprintsAutomationModalPng:"/images/app-packages/sprints-automation-modal.png",sprintsDbIconSvg:"/images/app-packages/sprints-db-icon.svg",sprintsRunSvg:"/images/app-packages/sprints-run.svg",sprintsTurnOnPreviewPng:"/images/app-packages/sprints-turn-on-preview.png",taskDbIconSvg:"/images/app-packages/task-db-icon.svg",taskPresetIconSvg:"/images/app-packages/task-preset-icon.svg",testVideoMp4:"/images/app-packages/test-video.mp4",verifiedShieldPng:"/images/app-packages/verifiedShield.png",wikiIconSvg:"/images/app-packages/wiki-icon.svg"},assistantStaticFaceFaviconPng:"/images/assistant_static_face_favicon.png",avatars:{avatar1Png:"/images/avatars/avatar1.png",avatar2Png:"/images/avatars/avatar2.png",avatar3Png:"/images/avatars/avatar3.png",avatar4DarkPng:"/images/avatars/avatar4-dark.png",avatar4LightPng:"/images/avatars/avatar4-light.png",avatar5Png:"/images/avatars/avatar5.png",avatar6Png:"/images/avatars/avatar6.png",avatar7Png:"/images/avatars/avatar7.png"},blockRendererCovers:{collectionTableDarkPng:"/images/blockRendererCovers/collection-table-dark.png",collectionTableLightPng:"/images/blockRendererCovers/collection-table-light.png",plainTableDarkPng:"/images/blockRendererCovers/plain-table-dark.png",plainTableLightPng:"/images/blockRendererCovers/plain-table-light.png"},blocks:{abstractPng:"/images/blocks/abstract.453c8d20.png",audioPng:"/images/blocks/audio.946c8e51.png",boardInlinePng:"/images/blocks/board-inline.016bdff6.png",boardPng:"/images/blocks/board.a4ec9610.png",breadcrumbPng:"/images/blocks/breadcrumb.43774c17.png",bulletedListPng:"/images/blocks/bulleted-list.0e87e917.png",calendarInlinePng:"/images/blocks/calendar-inline.e59a1b6b.png",calendarPng:"/images/blocks/calendar.24f41568.png",calloutPng:"/images/blocks/callout.7b4c39c4.png",chartDonutPng:"/images/blocks/chart-donut.19da677b.png",chartHorizontalBarPng:"/images/blocks/chart-horizontal-bar.d7e28433.png",chartLinePng:"/images/blocks/chart-line.d818ee1e.png",chartNumberPng:"/images/blocks/chart-number.9786b407.png",chartVerticalBarPng:"/images/blocks/chart-vertical-bar.3c8aba95.png",codePng:"/images/blocks/code.a8b201f4.png",codepenPng:"/images/blocks/codepen.d14b682c.png",columnListPng:"/images/blocks/columnList.63d7ab92.png",datePng:"/images/blocks/date.b37fcef7.png",deepnotePng:"/images/blocks/deepnote.b3f58634.png",dividerPng:"/images/blocks/divider.210d0faf.png",drivePng:"/images/blocks/drive.a97c62ee.png",embedPng:"/images/blocks/embed.6a481331.png",excalidrawPng:"/images/blocks/excalidraw.b2dad901.png",figmaPng:"/images/blocks/figma.8742808d.png",filePng:"/images/blocks/file.4fade042.png",formViewPng:"/images/blocks/form-view.d3e8c213.png",framerPng:"/images/blocks/framer.e7786c0b.png",galleryInlinePng:"/images/blocks/gallery-inline.e7e1f95b.png",galleryPng:"/images/blocks/gallery.a83d6324.png",githubPng:"/images/blocks/github.9565b324.png",headerPng:"/images/blocks/header.57a7576a.png",hexPng:"/images/blocks/hex.6cccb54c.png",imagePng:"/images/blocks/image.33d80a98.png",inlineEmojiPng:"/images/blocks/inline-emoji.4fda0007.png",inlineEquationPng:"/images/blocks/inline-equation.a1270861.png",invisionPng:"/images/blocks/invision.73f1400b.png",linkPng:"/images/blocks/link.dd415f7c.png",listInlinePng:"/images/blocks/list-inline.9150ee55.png",listPng:"/images/blocks/list.daadba0c.png",loomPng:"/images/blocks/loom.665a49d5.png",mapsPng:"/images/blocks/maps.b1caf3fd.png",mentionDatePng:"/images/blocks/mention-date.adf0aaa0.png",mentionPagePng:"/images/blocks/mention-page.b360b9b2.png",mentionPersonPng:"/images/blocks/mention-person.6f6b2d65.png",miroPng:"/images/blocks/miro.12aa6110.png",mixpanelPng:"/images/blocks/mixpanel.f12354ad.png",numberedListPng:"/images/blocks/numbered-list.0406affe.png",pagePng:"/images/blocks/page.83b0bf31.png",pdfPng:"/images/blocks/pdf.d718d1fe.png",quotePng:{"en-US":"/images/blocks/quote/en-US.png","es-ES":"/images/blocks/quote/es-ES.png","es-LA":"/images/blocks/quote/es-LA.png","fr-FR":"/images/blocks/quote/fr-FR.png","ja-JP":"/images/blocks/quote/ja-JP.png","ko-KR":"/images/blocks/quote/ko-KR.png","pr-BR":"/images/blocks/quote/pr-BR.png"},replitPng:"/images/blocks/replit.0ef4ed4c.png",simpleTablePng:"/images/blocks/simple-table.e31a23bb.png",sketchPng:"/images/blocks/sketch.96e9b687.png",slideblockPng:"/images/blocks/slideblock.dd41b71b.png",subheaderPng:"/images/blocks/subheader.9aab4769.png",subsubheaderPng:"/images/blocks/subsubheader.d0ed0bb3.png",tableInlinePng:"/images/blocks/table-inline.4c70a4ba.png",tableOfContentsPng:"/images/blocks/table-of-contents.e9cdeac5.png",tablePng:"/images/blocks/table.1659c09f.png",tableViewInlinePng:"/images/blocks/table-view-inline.7e99324a.png",tableViewPng:"/images/blocks/table-view.6f17ba1c.png",tabsPng:"/images/blocks/tabs.8b5159fa.png",templateButtonPng:{"en-US":"/images/blocks/template-button/en-US.png","es-ES":"/images/blocks/template-button/es-ES.png","es-LA":"/images/blocks/template-button/es-LA.png","fr-FR":"/images/blocks/template-button/fr-FR.png","ja-JP":"/images/blocks/template-button/ja-JP.png","ko-KR":"/images/blocks/template-button/ko-KR.png","pt-BR":"/images/blocks/template-button/pt-BR.png","zh-CN":"/images/blocks/template-button/zh-CN.png","zh-TW":"/images/blocks/template-button/zh-TW.png"},texPng:"/images/blocks/tex.b0aa14b2.png",textPng:{"en-US":"/images/blocks/text/en-US.png","es-ES":"/images/blocks/text/es-ES.png","es-LA":"/images/blocks/text/es-LA.png","fr-FR":"/images/blocks/text/fr-FR.png","ja-JP":"/images/blocks/text/ja-JP.png","ko-KR":"/images/blocks/text/ko-KR.png","pr-BR":"/images/blocks/text/pr-BR.png"},timelineInlinePng:"/images/blocks/timeline-inline.f6e42922.png",timelinePng:"/images/blocks/timeline.0fbedb5c.png",toDoPng:"/images/blocks/to-do.f8d20542.png",toggleHeading1Png:"/images/blocks/toggle_heading_1.3d7aefe1.png",toggleHeading2Png:"/images/blocks/toggle_heading_2.aba07398.png",toggleHeading3Png:"/images/blocks/toggle_heading_3.3879a8be.png",togglePng:"/images/blocks/toggle.5e462b2a.png",transclusionPng:"/images/blocks/transclusion.caa87a01.png",twitterPng:"/images/blocks/twitter.816b4178.png",typeformPng:"/images/blocks/typeform.d1099f0f.png",videoPng:"/images/blocks/video.ceeec2c7.png",webBookmarkPng:"/images/blocks/web-bookmark.82a15180.png",whimsicalPng:"/images/blocks/whimsical.93d89414.png"},charts:{chartsExportGradientDarkPng:"/images/charts/charts-export-gradient-dark.png",chartsExportGradientLightPng:"/images/charts/charts-export-gradient-light.png",chartsExportLogoDarkPng:"/images/charts/charts-export-logo-dark.png",chartsExportLogoLightPng:"/images/charts/charts-export-logo-light.png",chartsLaunchModalDarkPng:"/images/charts/charts-launch-modal-dark.png",chartsLaunchModalPng:"/images/charts/charts-launch-modal.png"},chatButtonSmallPng:"/images/chat-button-small.png",checkbox:{checkboxOffPng:"/images/checkbox/checkbox-off.png",checkboxOffSvg:"/images/checkbox/checkbox-off.svg",checkboxOnPng:"/images/checkbox/checkbox-on.png",checkboxOnSvg:"/images/checkbox/checkbox-on.svg"},chromeDesktopTopPng:"/images/chrome-desktop-top.png",chromeMacTopPng:"/images/chrome-mac-top.png",chromeMobileAndroidPng:"/images/chrome-mobile-android.png",chromeMobileIphonePng:"/images/chrome-mobile-iphone.png",chromeMobileIphoneXPng:"/images/chrome-mobile-iphone-x.png",chromeSafariTopPng:"/images/chrome-safari-top.png",chromeSlackTopPng:"/images/chrome-slack-top.png",clubPenguinDanceGif:"/images/club-penguin-dance.gif",collections:{migrationModalThumbnail:{enPng:"/images/collections/migrationModalThumbnail/en.png"},nestGetStartedPng:"/images/collections/nestGetStarted.png"},commandSearch:{tooltipPng:"/images/command-search/tooltip.png"},devices:{iphoneFramePng:"/images/devices/iphone-frame.png",iphoneXFramePng:"/images/devices/iphone-x-frame.png"},downgradeFeedbackPng:"/images/downgrade-feedback.png",elmoNotionBlockPng:"/images/elmo-notion-block.png",email:{pagePng:"/images/email/page.png"},emoji:{appleEmojiSpritesheet64Png:"/images/emoji/apple-emoji-spritesheet-64.60ccb2c3.png",googleEmojiSpritesheet64Png:"/images/emoji/google-emoji-spritesheet-64.8ac08a90.png",twitterEmojiSpritesheet64Png:"/images/emoji/twitter-emoji-spritesheet-64.2d0a6b9b.png"},enableAiNonWorkspaceOwnersPng:"/images/enable-ai-non-workspace-owners.png",enableAiPng:"/images/enable-ai.png",enableAiSettingsPanelPng:"/images/enable-ai-settings-panel.png",enableAiWorkspaceOwnersPng:"/images/enable-ai-workspace-owners.png",enterpriseModal:{managedUsersDarkPng:"/images/enterprise_modal/managed_users_dark.png",managedUsersLightPng:"/images/enterprise_modal/managed_users_light.png",organizationsDarkPng:"/images/enterprise_modal/organizations_dark.png",organizationsLightPng:"/images/enterprise_modal/organizations_light.png",securityDarkPng:"/images/enterprise_modal/security_dark.png",securityLightPng:"/images/enterprise_modal/security_light.png"},externalIntegrations:{acmeIconPng:"/images/external_integrations/acme-icon.png",asanaAccentPng:"/images/external_integrations/asana-accent.png",asanaCompletedIconPng:"/images/external_integrations/asana-completed-icon.png",asanaIconPng:"/images/external_integrations/asana-icon.png",awareIconPng:"/images/external_integrations/aware-icon.png",cronCalendarIconPng:"/images/external_integrations/cron-calendar-icon.png",datadogLogoPng:"/images/external_integrations/datadog-logo.png",drataIconPng:"/images/external_integrations/drata-icon.png",dropboxDarkIconPng:"/images/external_integrations/dropbox-dark-icon.png",dropboxIconPng:"/images/external_integrations/dropbox-icon.png",externalAppToProjectsArrowPng:"/images/external_integrations/external-app-to-Projects-arrow.png",externalAppToTasksArrowPng:"/images/external_integrations/external-app-to-tasks-arrow.png",figmaIconPng:"/images/external_integrations/figma-icon.png",githubAccentPng:"/images/external_integrations/github-accent.png",githubDarkIconPng:"/images/external_integrations/github-dark-icon.png",githubIconPng:"/images/external_integrations/github-icon.png",githubIssueClosedIconPng:"/images/external_integrations/github-issue-closed-icon.png",githubIssueOpenIconPng:"/images/external_integrations/github-issue-open-icon.png",githubPullClosedIconPng:"/images/external_integrations/github-pull-closed-icon.png",githubPullMergedIconPng:"/images/external_integrations/github-pull-merged-icon.png",githubPullOpenIconPng:"/images/external_integrations/github-pull-open-icon.png",githubPullOpenIconWhitePng:"/images/external_integrations/github-pull-open-icon-white.png",gitlabAccentPng:"/images/external_integrations/gitlab-accent.png",gitlabIconPng:"/images/external_integrations/gitlab-icon.png",gmailIconPng:"/images/external_integrations/gmail-icon.png",googleContactsIconPng:"/images/external_integrations/google-contacts-icon.png",googlecalendarIconPng:"/images/external_integrations/googlecalendar-icon.png",hanzoIconPng:"/images/external_integrations/hanzo-icon.png",hubspotIconPng:"/images/external_integrations/hubspot-icon.png",jiraAccentPng:"/images/external_integrations/jira-accent.png",jiraIconPng:"/images/external_integrations/jira-icon.png",jiraIssueBugIconPng:"/images/external_integrations/jira-issue-bug-icon.png",jiraIssueEpicIconPng:"/images/external_integrations/jira-issue-epic-icon.png",jiraIssueStoryIconPng:"/images/external_integrations/jira-issue-story-icon.png",jiraIssueTaskIconPng:"/images/external_integrations/jira-issue-task-icon.png",jiraPng:"/images/external_integrations/jira.png",loomIconPng:"/images/external_integrations/loom-icon.png",miroIconPng:"/images/external_integrations/miro-icon.png",nightfallLogoSvg:"/images/external_integrations/nightfall-logo.svg",notionCalendarIconPng:"/images/external_integrations/notion-calendar-icon.png",onedriveIconPng:"/images/external_integrations/onedrive-icon.png",onnaIconJpeg:"/images/external_integrations/onna-icon.jpeg",pantherLogoPng:"/images/external_integrations/panther-logo.png",personPlaceholderPng:"/images/external_integrations/person_placeholder.png",polymerLogoJpeg:"/images/external_integrations/polymer-logo.jpeg",runrevealPng:"/images/external_integrations/runreveal.png",salesforceAccentPng:"/images/external_integrations/salesforce-accent.png",salesforcePng:"/images/external_integrations/salesforce.png",sharepointIconPng:"/images/external_integrations/sharepoint-icon.png",slackAccentPng:"/images/external_integrations/slack-accent.png",slackIconPng:"/images/external_integrations/slack-icon.png",splunkLogoJpeg:"/images/external_integrations/splunk-logo.jpeg",sumoLogicLogoJpeg:"/images/external_integrations/sumo-logic-logo.jpeg",trelloAccentPng:"/images/external_integrations/trello-accent.png",trelloIconPng:"/images/external_integrations/trello-icon.png",zoomAccentPng:"/images/external_integrations/zoom-accent.png",zoomIconPng:"/images/external_integrations/zoom-icon.png"},faviconDevIco:"/images/favicon-dev.ico",faviconIco:"/images/favicon.ico",faviconLocalIco:"/images/favicon-local.ico",faviconPng:"/images/favicon.png",faviconStgIco:"/images/favicon-stg.ico",feedbackThankYouPng:"/images/feedback-thank-you.png",forms:{formCopyLinkDarkPng:"/images/forms/form-copy-link-dark.png",formCopyLinkPng:"/images/forms/form-copy-link.png",formsBetaLaunchModalDarkPng:"/images/forms/forms-beta-launch-modal-dark.png",formsBetaLaunchModalLightPng:"/images/forms/forms-beta-launch-modal-light.png"},framePlaceholderSvg:"/images/frame-placeholder.svg",gifs:{followPageGif:"/images/gifs/follow-page.gif",mentionsGif:"/images/gifs/mentions.gif"},githubStudentPackPng:"/images/github-student-pack.png",googleDriveLogoPng:"/images/googleDriveLogo.png",heroIllustrationPng:"/images/hero-illustration.png",home:{learn:{"10AiPromptsToHelpMarketersWriteBetterCopyFasterPng":"/images/home/learn/10-ai-prompts-to-help-marketers-write-better-copy-faster.png",aDesignersUltimateGuideToUsingNotionPng:"/images/home/learn/a-designers-ultimate-guide-to-using-notion.png",aNotionGuideOnSwitchingBetweenWorkAndPersonalAccountsPng:"/images/home/learn/a-notion-guide-on-switching-between-work-and-personal-accounts.png",collaborateWithPeoplePng:"/images/home/learn/collaborate-with-people.png",collaborateWithTeammatesPng:"/images/home/learn/collaborate_with_teammates.png",connectToolsToNotionApiPng:"/images/home/learn/connect-tools-to-notion-api.png",createADatabasePng:"/images/home/learn/create-a-database.png",createAPageChecklistDarkModePng:"/images/home/learn/create-a-page-checklist-dark-mode.png",createAPageChecklistLightModePng:"/images/home/learn/create-a-page-checklist-light-mode.png",createASubpagePng:"/images/home/learn/create-a-subpage.png",createYourFirstPagePng:"/images/home/learn/create-your-first-page.png",customizeAndStyleYourContentPng:"/images/home/learn/customize-and-style-your-content.png",docsAndMeetingsPng:"/images/home/learn/docs-and-meetings.png",exploreCommunityTemplatesPersonalDarkModePng:"/images/home/learn/explore-community-templates-personal-dark-mode.png",exploreCommunityTemplatesPersonalLightModePng:"/images/home/learn/explore-community-templates-personal-light-mode.png",exploreCommunityTemplatesTeamDarkModePng:"/images/home/learn/explore-community-templates-team-dark-mode.png",exploreCommunityTemplatesTeamLightModePng:"/images/home/learn/explore-community-templates-team-light-mode.png",exploreGettingStartedDarkModePng:"/images/home/learn/explore-getting-started-dark-mode.png",exploreGettingStartedLightModePng:"/images/home/learn/explore-getting-started-light-mode.png",exploreYourTemplateDarkModePng:"/images/home/learn/explore-your-template-dark-mode.png",exploreYourTemplateLightModePng:"/images/home/learn/explore-your-template-light-mode.png",getAnswersAboutContentFasterWithQAndAPng:"/images/home/learn/get-answers-about-content-faster-with-q-and-a.png",getTheAppsAndroidQrCodePng:"/images/home/learn/get-the-apps-android-qr-code.png",getTheAppsDarkModePng:"/images/home/learn/get-the-apps-dark-mode.png",getTheAppsIphoneQrCodePng:"/images/home/learn/get-the-apps-iphone-qr-code.png",getTheAppsLightModePng:"/images/home/learn/get-the-apps-light-mode.png",gettingStartedProjectsPng:"/images/home/learn/getting-started-projects.png",gettingStartedWithProjectsAndTasksPng:"/images/home/learn/getting-started-with-projects-and-tasks.png",importingDataPng:"/images/home/learn/importing-data.png",inviteACollaboratorDarkModePng:"/images/home/learn/invite-a-collaborator-dark-mode.png",inviteACollaboratorLightModePng:"/images/home/learn/invite-a-collaborator-light-mode.png",keyboardShortcutsPng:"/images/home/learn/keyboard-shortcuts.png",littleCharacterDarkModePng:"/images/home/learn/little-character-dark-mode.png",littleCharacterLightModePng:"/images/home/learn/little-character-light-mode.png",notionFitToolEcosystemPng:"/images/home/learn/notion-fit-tool-ecosystem.png",notionForProductManagersPng:"/images/home/learn/notion-for-product-managers.png",organizedWorkspaceBestPracticesPng:"/images/home/learn/organized-workspace-best-practices.png",personalTasksPng:"/images/home/learn/personal-tasks.png",productEngineeringNotionSprintPlanningPng:"/images/home/learn/product-engineering-notion-sprint-planning.png",qaHeroDarkModePng:"/images/home/learn/qa-hero-dark-mode.png",qaHeroLightModePng:"/images/home/learn/qa-hero-light-mode.png",settingUpNotionForSchoolPng:"/images/home/learn/setting-up-notion-for-school.png",shareYourWorkPng:"/images/home/learn/share-your-work.png",sharingAndPermissionsPng:"/images/home/learn/sharing-and-permissions.png",simpleTablesVsDatabasesPng:"/images/home/learn/simple-tables-vs-databases.png",startWithATemplatePng:"/images/home/learn/start-with-a-template.png",theUltimateGuideToNotionTemplatesPng:"/images/home/learn/the-ultimate-guide-to-notion-templates.png",threeStepsBeforeOnboardingToNotionPng:"/images/home/learn/three-steps-before-onboarding-to-notion.png",timedTrialGiftboxPng:"/images/home/learn/timed-trial-giftbox.png",typesOfContentBlocksPng:"/images/home/learn/types-of-content-blocks.png",understandingNotionsSharingSettingsPng:"/images/home/learn/understanding-notions-sharing-settings.png",unearthFreshInsightsFromYourPersonalKnowledgeLibraryUsingQAndAPng:"/images/home/learn/unearth-fresh-insights-from-your-personal-knowledge-library-using-q-and-a.png",usingNotionAiPng:"/images/home/learn/using-notion-ai.png",usingNotionForMarketingCampaignsPng:"/images/home/learn/using-notion-for-marketing-campaigns.png",usingNotionForProductAndEngineeringOkrsPng:"/images/home/learn/using-notion-for-product-and-engineering-okrs.png",usingNotionForProductRoadmapsPng:"/images/home/learn/using-notion-for-product-roadmaps.png",whatIsABlockPng:"/images/home/learn/what-is-a-block.png",whatIsADatabasePng:"/images/home/learn/what-is-a-database.png",whatIsNotionPng:"/images/home/learn/what-is-notion.png",wikisAndFaqsPng:"/images/home/learn/wikis-and-faqs.png"}},icons:{alarmClockPng:"/images/icons/alarmClock.4e200255.png",atPng:"/images/icons/at.efc632d7.png",basicClockPng:"/images/icons/basic-clock.632b1b6e.png",boardPng:"/images/icons/board.44c6afcc.png",boltFilledPng:"/images/icons/boltFilled.9d75111e.png",checkboxPng:"/images/icons/checkbox.3e146845.png",clockArrowLockSvg:"/images/icons/clock-arrow-lock.750a0c24.svg",collectionTableSvg:"/images/icons/collection-table.84137af6.svg",createdAtPng:"/images/icons/created-at.0fafab6c.png",createdByPng:"/images/icons/created-by.13285574.png",cursorHandPng:"/images/icons/cursor-hand.ba24ebbe.png",cursorPointerPng:"/images/icons/cursor-pointer.4ebf7dfd.png",datePng:"/images/icons/date.f30a62a4.png",emailPng:"/images/icons/email.749bd8b2.png",filePng:"/images/icons/file.e2b311d8.png",formulaPng:"/images/icons/formula.d5760981.png",globe2Png:"/images/icons/globe-2.483430ea.png",historyForwardPng:"/images/icons/history-forward.f6f26f20.png",idPng:"/images/icons/id.21230755.png",keyPng:"/images/icons/key.e5863bcb.png",laptopPng:"/images/icons/laptop.52144617.png",locationArrowPng:"/images/icons/location-arrow.2a6b8799.png",locationPng:"/images/icons/location.375d82d1.png",multipleSelectPng:"/images/icons/multiple-select.5d48b805.png",numberPng:"/images/icons/number.c473697c.png",pagePng:"/images/icons/page.b826e829.png",personPng:"/images/icons/person.f9ff98c8.png",phoneNumberPng:"/images/icons/phone-number.7908ec14.png",phonePng:"/images/icons/phone.9f137f8c.png",presentBoxPng:"/images/icons/presentBox.0a6304a4.png",randomPng:"/images/icons/random.39b56781.png",relationPng:"/images/icons/relation.a192c73f.png",selectPng:"/images/icons/select.8647c6ee.png",speechBubblePng:"/images/icons/speech-bubble.ed13738b.png",statusPng:"/images/icons/status.12bf7677.png",tablePng:"/images/icons/table.4fb956bd.png",textPng:"/images/icons/text.6b26bc82.png",titlePng:"/images/icons/title.ce638437.png",todoDonePng:"/images/icons/todo-done.baca55df.png",todoPng:"/images/icons/todo.ed420552.png",typesStatusSvg:"/images/icons/typesStatus.b7c53c7d.svg",unknownTypePng:"/images/icons/unknown-type.b3a62194.png",urlPng:"/images/icons/url.8a405116.png",verificationSvg:"/images/icons/verification.5dd21904.svg"},import:{asanaPng:"/images/import/asana.png",confluencePng:"/images/import/confluence.png",csvPng:"/images/import/csv.png",dropboxPaperPng:"/images/import/dropbox-paper.png",evernotePng:"/images/import/evernote.png",googleDocsPng:"/images/import/google-docs.png",googleDrivePng:"/images/import/google-drive.png",htmlPng:"/images/import/html.png",importPng:"/images/import/import.png",mondayPng:"/images/import/monday.png",pdfSvg:"/images/import/pdf.svg",quipPng:"/images/import/quip.png",textPng:"/images/import/text.png",trelloPng:"/images/import/trello.png",wordPng:"/images/import/word.png",workflowyPng:"/images/import/workflowy.png"},integrations:{funkyManagementIconPng:"/images/integrations/funky-management-icon.png",notionDevsLogoGaSvg:"/images/integrations/notion-devs-logo-ga.svg",notionDevsLogoSvg:"/images/integrations/notion-devs-logo.svg",notionFooterLogoSvg:"/images/integrations/notion-footer-logo.svg",screenshots:{googleDriveIntegrationPng:"/images/integrations/screenshots/google-drive-integration.png"}},invitePng:"/images/invite.png",inviteuiPng:"/images/inviteui.png",layouts:{configuration:{inlineDefaultPng:"/images/layouts/configuration/inline__default.png",inlineMinimalPng:"/images/layouts/configuration/inline__minimal.png",pageCommentsExpandedPng:"/images/layouts/configuration/page_comments__expanded.png",pageCommentsOffPng:"/images/layouts/configuration/page_comments__off.png",personCompactPng:"/images/layouts/configuration/person-compact.png",personMediumPng:"/images/layouts/configuration/person-medium.png",propertyFilesMediaPreviewJpg:"/images/layouts/configuration/property-files-media-preview.jpg",propertyFilesMediaPreviewLargePng:"/images/layouts/configuration/property-files-media-preview-large.png",propertyNumberPreviewLargePng:"/images/layouts/configuration/property-number-preview-large.png",propertyPersonPreviewLargePng:"/images/layouts/configuration/property-person-preview-large.png",propertyPersonPreviewPng:"/images/layouts/configuration/property-person-preview.png"},education:{infoPanelAnimationGif:"/images/layouts/education/info-panel-animation.gif",introModalIllustrationDarkPng:"/images/layouts/education/intro-modal-illustration-dark.png",introModalIllustrationPng:"/images/layouts/education/intro-modal-illustration.png"}},loadingSpinnerSvg:"/images/loading-spinner.4dc19970.svg",loadingSpinnerWhiteSvg:"/images/loading-spinner-white.6909ddaa.svg",logo642XPng:"/images/logo_64@2x.png",logoForSlackIntegrationPng:"/images/logo-for-slack-integration.png",logoForStripePng:"/images/logo-for-stripe.png",logoGoogleOauthPng:"/images/logo-google-oauth.png",logoIosPng:"/images/logo-ios.png",mab:{abstractSvg:"/images/mab/abstract.3ce46ae2.svg",aiActionItemsBlockSvg:"/images/mab/ai-action-items-block.02054d55.svg",aiFreePromptBlockSvg:"/images/mab/ai-free-prompt-block.5769e729.svg",aiSectionBlockSvg:"/images/mab/ai-section-block.3967293b.svg",aiSummaryBlockSvg:"/images/mab/ai-summary-block.5738a18f.svg",audioSvg:"/images/mab/audio.cdd62438.svg",boardViewSvg:"/images/mab/board-view.ad58e74d.svg",bookmarkSvg:"/images/mab/bookmark.8cd7d0c5.svg",breadcrumbSvg:"/images/mab/breadcrumb.6e55dbad.svg",bulletedListSvg:"/images/mab/bulleted-list.0f372b2f.svg",buttonSvg:"/images/mab/button.25f8e2c5.svg",calendarViewSvg:"/images/mab/calendar-view.fd1a4a76.svg",calloutSvg:"/images/mab/callout.29d24af6.svg",codeSvg:"/images/mab/code.9dbc6a93.svg",codepenSvg:"/images/mab/codepen.4c83f9cf.svg",column2BlockSvg:"/images/mab/column2-block.e94aea44.svg",column3BlockSvg:"/images/mab/column3-block.48068f25.svg",column4BlockSvg:"/images/mab/column4-block.fe9691ea.svg",column5BlockSvg:"/images/mab/column5-block.ae0db410.svg",columnListSvg:"/images/mab/column-list.06947d44.svg",databaseFullPageSvg:"/images/mab/database-full-page.896bb066.svg",databaseInlineSvg:"/images/mab/database-inline.f3f0c402.svg",dateOrReminderSvg:"/images/mab/date-or-reminder.d41d8cd9.svg",deepnoteSvg:"/images/mab/deepnote.86e30b3a.svg",dividerSvg:"/images/mab/divider.5b6a9899.svg",drawingSvg:"/images/mab/drawing.464bbdaa.svg",driveSvg:"/images/mab/drive.c96e2584.svg",embedSvg:"/images/mab/embed.02e0afaf.svg",emojiSvg:"/images/mab/emoji.d41d8cd9.svg",equationSvg:"/images/mab/equation.8ddfec59.svg",excalidrawSvg:"/images/mab/excalidraw.2fe36b82.svg",figmaSvg:"/images/mab/figma.cd275b92.svg",fileSvg:"/images/mab/file.8e537ce0.svg",framerSvg:"/images/mab/framer.01bafc9a.svg",galleryViewSvg:"/images/mab/gallery-view.8557aebb.svg",gistSvg:"/images/mab/gist.044a4f5d.svg",headerSvg:"/images/mab/header.452f1b44.svg",hexSvg:"/images/mab/hex.6874db7f.svg",imageSvg:"/images/mab/image.d9ccda8d.svg",inlineEquationSvg:"/images/mab/inline-equation.146df682.svg",invisionSvg:"/images/mab/invision.bd4973d4.svg",linkToPageSvg:"/images/mab/link-to-page.02e0afaf.svg",linkedDatabaseSvg:"/images/mab/linked-database.4a878b81.svg",listViewSvg:"/images/mab/list-view.5a675cf4.svg",loomSvg:"/images/mab/loom.a482df65.svg",mapsSvg:"/images/mab/maps.8b7e830e.svg",mentionPageSvg:"/images/mab/mention-page.d41d8cd9.svg",mentionPersonSvg:"/images/mab/mention-person.d41d8cd9.svg",mermaidCodeBlockSvg:"/images/mab/mermaid-code-block.a09e875e.svg",miroSvg:"/images/mab/miro.4ebed379.svg",mixpanelSvg:"/images/mab/mixpanel.c42f001e.svg",numberedListSvg:"/images/mab/numbered-list.a016a971.svg",pageSvg:"/images/mab/page.9419125f.svg",pdfSvg:"/images/mab/pdf.0bd562af.svg",quoteSvg:"/images/mab/quote.922df022.svg",replitSvg:"/images/mab/replit.68608256.svg",sketchSvg:"/images/mab/sketch.0dce8180.svg",subHeaderSvg:"/images/mab/sub-header.4f19d5f7.svg",subSubHeaderSvg:"/images/mab/sub-sub-header.94ac018c.svg",tabSvg:"/images/mab/tab.722306e1.svg",tableOfContentsSvg:"/images/mab/table-of-contents.2bf5b842.svg",tableSvg:"/images/mab/table.0517d800.svg",tableViewSvg:"/images/mab/table-view.0517d800.svg",textSvg:"/images/mab/text.ca713cd8.svg",timelineViewSvg:"/images/mab/timeline-view.8557aebb.svg",toDoSvg:"/images/mab/to-do.737303fb.svg",toggleFormatHeaderBlockSvg:"/images/mab/toggle-format-header-block.571ecd51.svg",toggleFormatSubHeaderBlockSvg:"/images/mab/toggle-format-sub-header-block.43153817.svg",toggleFormatSubSubHeaderBlockSvg:"/images/mab/toggle-format-sub-sub-header-block.d599f792.svg",toggleSvg:"/images/mab/toggle.c7fa1d17.svg",transclusionContainerSvg:"/images/mab/transclusion-container.cef2889d.svg",tweetSvg:"/images/mab/tweet.781e88cc.svg",typeformSvg:"/images/mab/typeform.a992103a.svg",videoSvg:"/images/mab/video.768e5965.svg",whimsicalSvg:"/images/mab/whimsical.16e0b68c.svg"},meta:{apiBetaPng:"/images/meta/api-beta.png",builtWithNotionPng:"/images/meta/builtWithNotion.png",careersPng:"/images/meta/careers.png",confluencePng:"/images/meta/confluence.png",customersPng:"/images/meta/customers.png",defaultPng:"/images/meta/default.png",educatorsPng:"/images/meta/educators.png",enterprisePng:"/images/meta/enterprise.png",evernotePng:"/images/meta/evernote.png",learnPng:"/images/meta/learn.png",notesPng:"/images/meta/notes.png",notionWordmarkPng:"/images/meta/notion-wordmark.png",personalV2Png:"/images/meta/personal-v2.png",projectsPng:"/images/meta/projects.png",referralPng:"/images/meta/referral.png",remotePng:"/images/meta/remote.png",startupsPng:"/images/meta/startups.png",studentsPng:"/images/meta/students.png",webClipperPng:"/images/meta/web-clipper.png",wikisPng:"/images/meta/wikis.png"},metaEducatorsPng:"/images/meta-educators.png",metaEvernotePng:"/images/meta-evernote.png",metaNotesPng:"/images/meta-notes.png",metaPng:"/images/meta.png",metaProjectsPng:"/images/meta-projects.png",metaReferralPng:"/images/meta-referral.png",metaStartupsPng:"/images/meta-startups.png",metaStudentsPng:"/images/meta-students.png",metaWebClipperPng:"/images/meta-web-clipper.png",metaWikisPng:"/images/meta-wikis.png",notionForPerfmarkPng:"/images/notion-for-perfmark.png",notionForStartupsPng:"/images/notion-for-startups.png",notionForStudentsPng:"/images/notion-for-students.png",notionLogoPng:"/images/notion-logo.64ce0d00.png",nyancatGif:"/images/nyancat.gif",onboarding:{aiQnaBudsDarkPng:"/images/onboarding/ai-qna-buds-dark.png",aiQnaBudsPng:"/images/onboarding/ai-qna-buds.png",aiQnaDarkPng:"/images/onboarding/ai-qna-dark.png",aiQnaLightPng:"/images/onboarding/ai-qna-light.png",aiQnaStubPng:"/images/onboarding/ai-qna-stub.png",aiSignupPageImageV2Png:"/images/onboarding/ai-signup-page-image-v2.png",aiStoryDarkAnimV2Gif:"/images/onboarding/ai-story-dark-anim-v2.gif",aiStoryLightAnimV2Gif:"/images/onboarding/ai-story-light-anim-v2.gif",aiWriterPreviewPng:"/images/onboarding/ai-writer-preview.png",appsPng:"/images/onboarding/apps.png",categoryPickerLargeDarkmodePng:"/images/onboarding/category-picker-large-darkmode.png",categoryPickerLargeLightmodePng:"/images/onboarding/category-picker-large-lightmode.png",categoryPickerSmallPng:"/images/onboarding/category-picker-small.png",checkedSvg:"/images/onboarding/checked.svg",contextTilePng:"/images/onboarding/context-tile.png",couch2DarkmodePng:"/images/onboarding/couch2-darkmode.png",couch2LightmodePng:"/images/onboarding/couch2-lightmode.png",desktopAppPng:"/images/onboarding/desktop-app.png",desktopNotesPng:"/images/onboarding/desktop-notes.png",emailSentPng:"/images/onboarding/email-sent.png",importAsanaPng:"/images/onboarding/import-asana.png",importEvernotePng:"/images/onboarding/import-evernote.png",importMarkdownPng:"/images/onboarding/import-markdown.png",importMorePng:"/images/onboarding/import-more.png",importTrelloPng:"/images/onboarding/import-trello.png",intentWorkPng:"/images/onboarding/intent-work.png",mobileHeroAndroidGif:"/images/onboarding/mobile-hero-android.gif",mobileHeroGif:"/images/onboarding/mobile-hero.gif",mobileOnboardingInviteDarkmodePng:"/images/onboarding/mobile-onboarding-invite-darkmode.png",mobileOnboardingInviteLightmodePng:"/images/onboarding/mobile-onboarding-invite-lightmode.png",mobilePlaceholderSvg:"/images/onboarding/mobile-placeholder.svg",mobileSidebarPng:"/images/onboarding/mobile-sidebar.png",mobileWikiPng:"/images/onboarding/mobile-wiki.png",movePageToWorkspaceGif:"/images/onboarding/move-page-to-workspace.gif",packageOnboardingPeopleLookingAtCollectionDarkModePng:"/images/onboarding/package_onboarding_people_looking_at_collection_dark_mode.png",packageOnboardingPeopleLookingAtCollectionPng:"/images/onboarding/package_onboarding_people_looking_at_collection.png",personCarryingStuffPng:"/images/onboarding/person_carrying_stuff.png",planTypeForLifeDarkmodePng:"/images/onboarding/plan-type-for-life-darkmode.png",planTypeForLifeLightmodePng:"/images/onboarding/plan-type-for-life-lightmode.png",planTypeForSchoolDarkmodePng:"/images/onboarding/plan-type-for-school-darkmode.png",planTypeForSchoolLightmodePng:"/images/onboarding/plan-type-for-school-lightmode.png",planTypeForWorkDarkmodePng:"/images/onboarding/plan-type-for-work-darkmode.png",planTypeForWorkLightmodePng:"/images/onboarding/plan-type-for-work-lightmode.png",productBackgroundMacBottomPng:"/images/onboarding/product-background-mac-bottom.png",productBackgroundMacTopPng:"/images/onboarding/product-background-mac-top.png",productBackgroundWindowsBottomPng:"/images/onboarding/product-background-windows-bottom.png",productBackgroundWindowsTopPng:"/images/onboarding/product-background-windows-top.png",profilePlaceholderDarkmodePng:"/images/onboarding/profile-placeholder-darkmode.png",profilePlaceholderLightmodePng:"/images/onboarding/profile-placeholder-lightmode.png",qnaPng:"/images/onboarding/qna.png",skeletonPageSvg:"/images/onboarding/skeleton-page.svg",teamFeaturesIllustrationPng:"/images/onboarding/team-features-illustration.png",templatePlaceholderDarkSvg:"/images/onboarding/template-placeholder-dark.svg",templatePlaceholderSvg:"/images/onboarding/template-placeholder.svg",templateTeaserPng:"/images/onboarding/template-teaser.png",uncheckedSvg:"/images/onboarding/unchecked.svg",useCaseNotePng:"/images/onboarding/use-case-note.png",useCaseWikiPng:"/images/onboarding/use-case-wiki.png",webClipperPng:"/images/onboarding/web-clipper.png"},onboardingPlaceholderPng:"/images/onboarding-placeholder.png",pageCover:{gradients10Jpg:"/images/page-cover/gradients_10.jpg",gradients11Jpg:"/images/page-cover/gradients_11.jpg",gradients1Png:"/images/page-cover/gradients_1.png",gradients2Png:"/images/page-cover/gradients_2.png",gradients3Png:"/images/page-cover/gradients_3.png",gradients4Png:"/images/page-cover/gradients_4.png",gradients5Png:"/images/page-cover/gradients_5.png",gradients6Png:"/images/page-cover/gradients_6.png",gradients7Png:"/images/page-cover/gradients_7.png",gradients8Png:"/images/page-cover/gradients_8.png",gradients9Png:"/images/page-cover/gradients_9.png",metArnoldBocklin1880Jpg:"/images/page-cover/met_arnold_bocklin_1880.jpg",metBruegel1565Jpg:"/images/page-cover/met_bruegel_1565.jpg",metCamillePissarro1896Jpg:"/images/page-cover/met_camille_pissarro_1896.jpg",metCanaletto1720Jpg:"/images/page-cover/met_canaletto_1720.jpg",metCezanne1890Jpg:"/images/page-cover/met_cezanne_1890.jpg",metEdgarDegas1874Jpg:"/images/page-cover/met_edgar_degas_1874.jpg",metEmanuelLeutzeJpg:"/images/page-cover/met_emanuel_leutze.jpg",metFitzHenryLaneJpg:"/images/page-cover/met_fitz_henry_lane.jpg",metFredericEdwinChurch1871Jpg:"/images/page-cover/met_frederic_edwin_church_1871.jpg",metGeorgesSeurat1884Jpg:"/images/page-cover/met_georges_seurat_1884.jpg",metGerome1890Jpg:"/images/page-cover/met_gerome_1890.jpg",metGoya1789Jpg:"/images/page-cover/met_goya_1789.jpg",metHenriRousseau1907Jpg:"/images/page-cover/met_henri_rousseau_1907.jpg",metHenriTl1892Jpg:"/images/page-cover/met_henri_tl_1892.jpg",metHenryLerolle1885Jpg:"/images/page-cover/met_henry_lerolle_1885.jpg",metHoracePippinJpg:"/images/page-cover/met_horace_pippin.jpg",metJeanBeraudJpg:"/images/page-cover/met_jean_beraud.jpg",metJohnSingerSargentMoroccoJpg:"/images/page-cover/met_john_singer_sargent_morocco.jpg",metJosephHidley1870Jpg:"/images/page-cover/met_joseph_hidley_1870.jpg",metJulesTavernier1878Jpg:"/images/page-cover/met_jules_tavernier_1878.jpg",metKlimt1912Jpg:"/images/page-cover/met_klimt_1912.jpg",metPaulSignacJpg:"/images/page-cover/met_paul_signac.jpg",metSilkKashanCarpetJpg:"/images/page-cover/met_silk_kashan_carpet.jpg",metTerracottaFuneraryPlaqueJpg:"/images/page-cover/met_terracotta_funerary_plaque.jpg",metTheUnicornInCaptivityJpg:"/images/page-cover/met_the_unicorn_in_captivity.jpg",metVincentVanGoghCradleJpg:"/images/page-cover/met_vincent_van_gogh_cradle.jpg",metVincentVanGoghGinouxJpg:"/images/page-cover/met_vincent_van_gogh_ginoux.jpg",metVincentVanGoghIrisesJpg:"/images/page-cover/met_vincent_van_gogh_irises.jpg",metVincentVanGoghOleandersJpg:"/images/page-cover/met_vincent_van_gogh_oleanders.jpg",metWilliamMorris1875Jpg:"/images/page-cover/met_william_morris_1875.jpg",metWilliamMorris1877WillowJpg:"/images/page-cover/met_william_morris_1877_willow.jpg",metWilliamMorris1878Jpg:"/images/page-cover/met_william_morris_1878.jpg",metWilliamTurner1835Jpg:"/images/page-cover/met_william_turner_1835.jpg",metWinslowHomerMaineCoastJpg:"/images/page-cover/met_winslow_homer_maine_coast.jpg",nasaBruceMccandlessSpacewalkJpg:"/images/page-cover/nasa_bruce_mccandless_spacewalk.jpg",nasaBuzzAldrinOnTheMoonJpg:"/images/page-cover/nasa_buzz_aldrin_on_the_moon.jpg",nasaCarinaNebulaJpg:"/images/page-cover/nasa_carina_nebula.jpg",nasaEagleInLunarOrbitJpg:"/images/page-cover/nasa_eagle_in_lunar_orbit.jpg",nasaEarthGridJpg:"/images/page-cover/nasa_earth_grid.jpg",nasaEvaDuringSkylab3Jpg:"/images/page-cover/nasa_eva_during_skylab_3.jpg",nasaFingerprintsOfWaterOnTheSandJpg:"/images/page-cover/nasa_fingerprints_of_water_on_the_sand.jpg",nasaGreatSandyDesertAustraliaJpg:"/images/page-cover/nasa_great_sandy_desert_australia.jpg",nasaIbmType704Jpg:"/images/page-cover/nasa_ibm_type_704.jpg",nasaMultiAxisGimbalRigJpg:"/images/page-cover/nasa_multi-axis_gimbal_rig.jpg",nasaNewYorkCityGridJpg:"/images/page-cover/nasa_new_york_city_grid.jpg",nasaOrionNebulaJpg:"/images/page-cover/nasa_orion_nebula.jpg",nasaReducedGravityWalkingSimulatorJpg:"/images/page-cover/nasa_reduced_gravity_walking_simulator.jpg",nasaRobertStewartSpacewalk2Jpg:"/images/page-cover/nasa_robert_stewart_spacewalk_2.jpg",nasaRobertStewartSpacewalkJpg:"/images/page-cover/nasa_robert_stewart_spacewalk.jpg",nasaSpaceShuttleChallengerJpg:"/images/page-cover/nasa_space_shuttle_challenger.jpg",nasaSpaceShuttleColumbiaAndSunriseJpg:"/images/page-cover/nasa_space_shuttle_columbia_and_sunrise.jpg",nasaSpaceShuttleColumbiaJpg:"/images/page-cover/nasa_space_shuttle_columbia.jpg",nasaTheBlueMarbleJpg:"/images/page-cover/nasa_the_blue_marble.jpg",nasaTimPeakeSpacewalkJpg:"/images/page-cover/nasa_tim_peake_spacewalk.jpg",nasaTransonicTunnelJpg:"/images/page-cover/nasa_transonic_tunnel.jpg",nasaWrightsFirstFlightJpg:"/images/page-cover/nasa_wrights_first_flight.jpg",rijksmuseumAvercamp1608Jpg:"/images/page-cover/rijksmuseum_avercamp_1608.jpg",rijksmuseumAvercamp1620Jpg:"/images/page-cover/rijksmuseum_avercamp_1620.jpg",rijksmuseumClaesz1628Jpg:"/images/page-cover/rijksmuseum_claesz_1628.jpg",rijksmuseumJanLievens1627Jpg:"/images/page-cover/rijksmuseum_jan_lievens_1627.jpg",rijksmuseumJansz1636Jpg:"/images/page-cover/rijksmuseum_jansz_1636.jpg",rijksmuseumJansz1637Jpg:"/images/page-cover/rijksmuseum_jansz_1637.jpg",rijksmuseumJansz1641Jpg:"/images/page-cover/rijksmuseum_jansz_1641.jpg",rijksmuseumJansz1649Jpg:"/images/page-cover/rijksmuseum_jansz_1649.jpg",rijksmuseumMignons1660Jpg:"/images/page-cover/rijksmuseum_mignons_1660.jpg",rijksmuseumRembrandt1642Jpg:"/images/page-cover/rijksmuseum_rembrandt_1642.jpg",rijksmuseumVermeerTheMilkmaidJpg:"/images/page-cover/rijksmuseum_vermeer_the_milkmaid.jpg",solidBeigePng:"/images/page-cover/solid_beige.png",solidBluePng:"/images/page-cover/solid_blue.png",solidRedPng:"/images/page-cover/solid_red.png",solidYellowPng:"/images/page-cover/solid_yellow.png",webb1Jpg:"/images/page-cover/webb1.jpg",webb2Jpg:"/images/page-cover/webb2.jpg",webb3Jpg:"/images/page-cover/webb3.jpg",webb4Jpg:"/images/page-cover/webb4.jpg",woodcuts10Jpg:"/images/page-cover/woodcuts_10.jpg",woodcuts11Jpg:"/images/page-cover/woodcuts_11.jpg",woodcuts13Jpg:"/images/page-cover/woodcuts_13.jpg",woodcuts14Jpg:"/images/page-cover/woodcuts_14.jpg",woodcuts15Jpg:"/images/page-cover/woodcuts_15.jpg",woodcuts16Jpg:"/images/page-cover/woodcuts_16.jpg",woodcuts1Jpg:"/images/page-cover/woodcuts_1.jpg",woodcuts2Jpg:"/images/page-cover/woodcuts_2.jpg",woodcuts3Jpg:"/images/page-cover/woodcuts_3.jpg",woodcuts4Jpg:"/images/page-cover/woodcuts_4.jpg",woodcuts5Jpg:"/images/page-cover/woodcuts_5.jpg",woodcuts6Jpg:"/images/page-cover/woodcuts_6.jpg",woodcuts7Jpg:"/images/page-cover/woodcuts_7.jpg",woodcuts8Jpg:"/images/page-cover/woodcuts_8.jpg",woodcuts9Jpg:"/images/page-cover/woodcuts_9.jpg",woodcutsSekka1Jpg:"/images/page-cover/woodcuts_sekka_1.jpg",woodcutsSekka2Jpg:"/images/page-cover/woodcuts_sekka_2.jpg",woodcutsSekka3Jpg:"/images/page-cover/woodcuts_sekka_3.jpg"},pricing:{aiLogoPng:"/images/pricing/ai-logo.png",dark:{booksPng:"/images/pricing/dark/books.png",businessPlanPng:"/images/pricing/dark/businessPlan.png",enterprisePlanPng:"/images/pricing/dark/enterprisePlan.png",freePlanPng:"/images/pricing/dark/freePlan.png",giftBoxPng:"/images/pricing/dark/giftBox.png",plusPlanPng:"/images/pricing/dark/plusPlan.png",upgradeAirplanePng:"/images/pricing/dark/upgradeAirplane.png"},light:{booksPng:"/images/pricing/light/books.png",businessPlanPng:"/images/pricing/light/businessPlan.png",enterprisePlanPng:"/images/pricing/light/enterprisePlan.png",freePlanPng:"/images/pricing/light/freePlan.png",giftBoxPng:"/images/pricing/light/giftBox.png",plusPlanPng:"/images/pricing/light/plusPlan.png",upgradeAirplanePng:"/images/pricing/light/upgradeAirplane.png"},original:{businessPng:"/images/pricing/original/business.png",enterprisePng:"/images/pricing/original/enterprise.png",freePng:"/images/pricing/original/free.png",plusPng:"/images/pricing/original/plus.png"},pricingEnterpriseV2Png:"/images/pricing/pricing-enterprise-v2.png",pricingEvernoteV2Png:"/images/pricing/pricing-evernote-v2.png",pricingFreeV2Png:"/images/pricing/pricing-free-v2.png",pricingNotionV2Png:"/images/pricing/pricing-notion-v2.png",pricingPersonalReplacesPng:"/images/pricing/pricing-personal-replaces.png",pricingPersonalV2Png:"/images/pricing/pricing-personal-v2.png",pricingProReplacesPng:"/images/pricing/pricing-pro-replaces.png",pricingTeamV2Png:"/images/pricing/pricing-team-v2.png"},projectsPreview1XPng:"/images/Projects_Preview_1x.png",projectsPreview2XPng:"/images/Projects_Preview_2x.png",projectsPreview3XPng:"/images/Projects_Preview_3x.png",replaces:{notesPng:"/images/replaces/notes.png",tasksPng:"/images/replaces/tasks.png",wikisPng:"/images/replaces/wikis.png"},scimMenuPng:"/images/scim-menu.png",selfRelationSameSvg:"/images/self-relation-same.svg",selfRelationSeparateSvg:"/images/self-relation-separate.svg",sharing:{sharingPagePng:"/images/sharing/sharing-page.png",sharingWorkspacePng:"/images/sharing/sharing-workspace.png"},signupBrandCampaignDarkModePng:"/images/signup_brand_campaign_dark_mode.png",signupBrandCampaignLightModePng:"/images/signup_brand_campaign_light_mode.png",sites:{sitesLaunchModalDarkPng:"/images/sites/sites-launch-modal-dark.png",sitesLaunchModalPng:"/images/sites/sites-launch-modal.png"},slackLogo2XPng:"/images/slack-logo@2x.png",spaceInviteEmailTwoPeopleCollaboratePng:"/images/space-invite-email-two-people-collaborate.png",sparklesFavicon2Png:"/images/sparkles_favicon_2.png",startupsBackgroundPng:"/images/startups_background.png",storyFinalsIvanAndFriendsPng:"/images/story_finals_ivan_and_friends.png",teamsEducation:{dark:{ownersAndMembersPng:"/images/teamsEducation/dark/ownersAndMembers.png",sidebarPng:"/images/teamsEducation/dark/sidebar.png",teamspacePreferencesPng:"/images/teamsEducation/dark/teamspacePreferences.png",teamspacesPng:"/images/teamsEducation/dark/teamspaces.png",turnIntoTeamspacePng:"/images/teamsEducation/dark/turnIntoTeamspace.png"},light:{ownersAndMembersPng:"/images/teamsEducation/light/ownersAndMembers.png",sidebarPng:"/images/teamsEducation/light/sidebar.png",teamspacePreferencesPng:"/images/teamsEducation/light/teamspacePreferences.png",teamspacesPng:"/images/teamsEducation/light/teamspaces.png",turnIntoTeamspacePng:"/images/teamsEducation/light/turnIntoTeamspace.png"}},templates:{becomeCreatorDarkPng:"/images/templates/become-creator-dark.png",becomeCreatorPng:"/images/templates/become-creator.png",bubblePng:"/images/templates/bubble.png",darkBubblePng:"/images/templates/dark-bubble.png",darkRainbowPng:"/images/templates/dark-rainbow.png",faviconIco:"/images/templates/favicon.ico",galleryHeaderIllustrationDarkPng:"/images/templates/gallery_header_illustration_dark.png",galleryHeaderIllustrationPng:"/images/templates/gallery-header-illustration.png",lifeHeaderDarkPng:"/images/templates/life-header-dark.png",lifeHeaderPng:"/images/templates/life-header.png",schoolHeaderDarkPng:"/images/templates/school-header-dark.png",schoolHeaderPng:"/images/templates/school-header.png",trendingCategoriesHeaderDarkPng:"/images/templates/trending-categories-header-dark.png",trendingCategoriesHeaderPng:"/images/templates/trending-categories-header.png",workHeaderDarkPng:"/images/templates/work-header-dark.png",workHeaderPng:"/images/templates/work-header.png"},thinkItMakeItCloudDarkPng:"/images/ThinkItMakeItCloudDark.png",tooltips:{blocks:{boardPng:{"en-US":"/images/tooltips/blocks/board/en-US.png","fr-FR":"/images/tooltips/blocks/board/fr-FR.png","ja-JP":"/images/tooltips/blocks/board/ja-JP.png"},breadcrumbPng:{"en-US":"/images/tooltips/blocks/breadcrumb/en-US.png","fr-FR":"/images/tooltips/blocks/breadcrumb/fr-FR.png","ja-JP":"/images/tooltips/blocks/breadcrumb/ja-JP.png"},bulletedListPng:{"en-US":"/images/tooltips/blocks/bulleted-list/en-US.png","fr-FR":"/images/tooltips/blocks/bulleted-list/fr-FR.png","ja-JP":"/images/tooltips/blocks/bulleted-list/ja-JP.png"},calendarPng:{"en-US":"/images/tooltips/blocks/calendar/en-US.png","fr-FR":"/images/tooltips/blocks/calendar/fr-FR.png","ja-JP":"/images/tooltips/blocks/calendar/ja-JP.png"},calloutPng:{"en-US":"/images/tooltips/blocks/callout/en-US.png","fr-FR":"/images/tooltips/blocks/callout/fr-FR.png","ja-JP":"/images/tooltips/blocks/callout/ja-JP.png"},chartDonutViewPng:"/images/tooltips/blocks/chart-donut-view.ce167a78.png",chartHorizontalBarViewPng:"/images/tooltips/blocks/chart-horizontal-bar-view.fb86a4a7.png",chartLineViewPng:"/images/tooltips/blocks/chart-line-view.35ad8481.png",chartVerticalBarViewPng:"/images/tooltips/blocks/chart-vertical-bar-view.8f6774aa.png",codePng:"/images/tooltips/blocks/code.3e33c698.png",columnListPng:{"en-US":"/images/tooltips/blocks/columnList/en-US.png"},dividerPng:"/images/tooltips/blocks/divider.83efad0b.png",filePng:{"en-US":"/images/tooltips/blocks/file/en-US.png"},formPng:{"de-DE":"/images/tooltips/blocks/form/de-DE.png","en-US":"/images/tooltips/blocks/form/en-US.png","es-ES":"/images/tooltips/blocks/form/es-ES.png","fr-FR":"/images/tooltips/blocks/form/fr-FR.png","ja-JP":"/images/tooltips/blocks/form/ja-JP.png","ko-KR":"/images/tooltips/blocks/form/ko-KR.png"},galleryPng:{"en-US":"/images/tooltips/blocks/gallery/en-US.png","fr-FR":"/images/tooltips/blocks/gallery/fr-FR.png","ja-JP":"/images/tooltips/blocks/gallery/ja-JP.png"},headerPng:{"en-US":"/images/tooltips/blocks/header/en-US.png","fr-FR":"/images/tooltips/blocks/header/fr-FR.png","ja-JP":"/images/tooltips/blocks/header/ja-JP.png"},imagePng:"/images/tooltips/blocks/image.110e56e8.png",inlineEmojiPng:{"en-US":"/images/tooltips/blocks/inline-emoji/en-US.png","fr-FR":"/images/tooltips/blocks/inline-emoji/fr-FR.png","ja-JP":"/images/tooltips/blocks/inline-emoji/ja-JP.png"},inlineEquationPng:"/images/tooltips/blocks/inline-equation.b9659320.png",linkToPagePng:{"en-US":"/images/tooltips/blocks/link-to-page/en-US.png","fr-FR":"/images/tooltips/blocks/link-to-page/fr-FR.png","ja-JP":"/images/tooltips/blocks/link-to-page/ja-JP.png"},listPng:{"en-US":"/images/tooltips/blocks/list/en-US.png","fr-FR":"/images/tooltips/blocks/list/fr-FR.png","ja-JP":"/images/tooltips/blocks/list/ja-JP.png"},mathPng:"/images/tooltips/blocks/math.ea9daec2.png",mentionPagePng:{"en-US":"/images/tooltips/blocks/mention-page/en-US.png","fr-FR":"/images/tooltips/blocks/mention-page/fr-FR.png","ja-JP":"/images/tooltips/blocks/mention-page/ja-JP.png"},mentionPersonPng:{"en-US":"/images/tooltips/blocks/mention-person/en-US.png","fr-FR":"/images/tooltips/blocks/mention-person/fr-FR.png","ja-JP":"/images/tooltips/blocks/mention-person/ja-JP.png"},mentionTimePng:{"en-US":"/images/tooltips/blocks/mention-time/en-US.png","fr-FR":"/images/tooltips/blocks/mention-time/fr-FR.png","ja-JP":"/images/tooltips/blocks/mention-time/ja-JP.png"},numberedListPng:{"en-US":"/images/tooltips/blocks/numbered-list/en-US.png","fr-FR":"/images/tooltips/blocks/numbered-list/fr-FR.png","ja-JP":"/images/tooltips/blocks/numbered-list/ja-JP.png"},pagePng:{"en-US":"/images/tooltips/blocks/page/en-US.png","fr-FR":"/images/tooltips/blocks/page/fr-FR.png","ja-JP":"/images/tooltips/blocks/page/ja-JP.png"},quotePng:{"en-US":"/images/tooltips/blocks/quote/en-US.png","fr-FR":"/images/tooltips/blocks/quote/fr-FR.png","ja-JP":"/images/tooltips/blocks/quote/ja-JP.png"},simpleTablePng:{"en-US":"/images/tooltips/blocks/simple-table/en-US.png"},subHeaderPng:{"en-US":"/images/tooltips/blocks/sub-header/en-US.png","fr-FR":"/images/tooltips/blocks/sub-header/fr-FR.png","ja-JP":"/images/tooltips/blocks/sub-header/ja-JP.png"},subsubheaderPng:{"en-US":"/images/tooltips/blocks/subsubheader/en-US.png","fr-FR":"/images/tooltips/blocks/subsubheader/fr-FR.png","ja-JP":"/images/tooltips/blocks/subsubheader/ja-JP.png"},tableOfContentsPng:{"en-US":"/images/tooltips/blocks/table-of-contents/en-US.png","fr-FR":"/images/tooltips/blocks/table-of-contents/fr-FR.png","ja-JP":"/images/tooltips/blocks/table-of-contents/ja-JP.png"},tablePng:{"en-US":"/images/tooltips/blocks/table/en-US.png","fr-FR":"/images/tooltips/blocks/table/fr-FR.png","ja-JP":"/images/tooltips/blocks/table/ja-JP.png"},tableViewPng:{"en-US":"/images/tooltips/blocks/table-view/en-US.png"},tabsPng:{"en-US":"/images/tooltips/blocks/tabs/en-US.png"},templateButtonPng:{"en-US":"/images/tooltips/blocks/template-button/en-US.png","es-ES":"/images/tooltips/blocks/template-button/es-ES.png","es-LA":"/images/tooltips/blocks/template-button/es-LA.png","fr-FR":"/images/tooltips/blocks/template-button/fr-FR.png","ja-JP":"/images/tooltips/blocks/template-button/ja-JP.png","ko-KR":"/images/tooltips/blocks/template-button/ko-KR.png","zh-CN":"/images/tooltips/blocks/template-button/zh-CN.png","zh-TW":"/images/tooltips/blocks/template-button/zh-TW.png"},textPng:{"en-US":"/images/tooltips/blocks/text/en-US.png","fr-FR":"/images/tooltips/blocks/text/fr-FR.png","ja-JP":"/images/tooltips/blocks/text/ja-JP.png"},timelinePng:{"en-US":"/images/tooltips/blocks/timeline/en-US.png"},toDoListPng:{"en-US":"/images/tooltips/blocks/to-do-list/en-US.png","fr-FR":"/images/tooltips/blocks/to-do-list/fr-FR.png","ja-JP":"/images/tooltips/blocks/to-do-list/ja-JP.png"},toggleH1Png:{"en-US":"/images/tooltips/blocks/toggle-h1/en-US.png"},toggleH2Png:{"en-US":"/images/tooltips/blocks/toggle-h2/en-US.png"},toggleH3Png:{"en-US":"/images/tooltips/blocks/toggle-h3/en-US.png"},toggleListPng:{"en-US":"/images/tooltips/blocks/toggle-list/en-US.png","fr-FR":"/images/tooltips/blocks/toggle-list/fr-FR.png","ja-JP":"/images/tooltips/blocks/toggle-list/ja-JP.png"},transclusionPng:{"en-US":"/images/tooltips/blocks/transclusion/en-US.png"},videoPng:"/images/tooltips/blocks/video.9ecc399e.png",webBookmarkPng:{"en-US":"/images/tooltips/blocks/web-bookmark/en-US.png","fr-FR":"/images/tooltips/blocks/web-bookmark/fr-FR.png","ja-JP":"/images/tooltips/blocks/web-bookmark/ja-JP.png"}},collectionSettings:{subitemsToggleOnTitlePng:"/images/tooltips/collection-settings/subitemsToggleOnTitle.png",turnIntoTasksPng:"/images/tooltips/collection-settings/turn-into-tasks.png"},linkPreviews:{blockPng:"/images/tooltips/link_previews/block.png",inlinePng:"/images/tooltips/link_previews/inline.png"},pageMenu:{newPageInPng:"/images/tooltips/page-menu/new-page-in.png",newSubpagePng:"/images/tooltips/page-menu/new-subpage.png",turnIntoPng:"/images/tooltips/page-menu/turn-into.png"},pageUpdates:{followPng:"/images/tooltips/page-updates/follow.e0a132cf.png",slackPng:"/images/tooltips/page-updates/slack.b105e4e6.png"},properties:{aiAutofillSummaryPng:"/images/tooltips/properties/ai-autofill-summary.png",aiCustomAutofillPng:"/images/tooltips/properties/ai-custom-autofill.png",aiKeywordsPng:"/images/tooltips/properties/ai-keywords.png",aiTranslationPng:"/images/tooltips/properties/ai-translation.png",dependenciesPng:"/images/tooltips/properties/dependencies.png",figmaPng:"/images/tooltips/properties/figma.png",githubSyncPullStatusPng:"/images/tooltips/properties/github-sync-pull-status.png",googleDrivePng:"/images/tooltips/properties/google-drive.png",projectsPriorityPng:"/images/tooltips/properties/projects-priority.png",sprintsPng:"/images/tooltips/properties/sprints.png",statusPng:"/images/tooltips/properties/status.png",subtasksPng:"/images/tooltips/properties/subtasks.png",tasksEstimatesPng:"/images/tooltips/properties/tasks-estimates.png",tasksPriorityPng:"/images/tooltips/properties/tasks-priority.png",tasksTagsPng:"/images/tooltips/properties/tasks-tags.png",zendeskPng:"/images/tooltips/properties/zendesk.png"},share:{allowCommentsPng:"/images/tooltips/share/allow-comments.41b0c5c5.png",allowDuplicatePng:"/images/tooltips/share/allow-duplicate.be0639d0.png",allowDuplicateV2Png:"/images/tooltips/share/allow-duplicate-v2.c0e391d2.png",allowEditingPng:"/images/tooltips/share/allow-editing.70797afd.png",allowSearchEnginesPng:"/images/tooltips/share/allow-search-engines.451818fa.png",publicPagePng:"/images/tooltips/share/public-page.8f4bb385.png",sharedPng:"/images/tooltips/share/shared.dde8dafe.png",workspacePng:"/images/tooltips/share/workspace.01af2429.png"},sidebar:{inviteTeamPreviewPng:"/images/tooltips/sidebar/inviteTeamPreview.png"},types:{checkboxPng:"/images/tooltips/types/checkbox.7080b998.png",createdByPng:"/images/tooltips/types/created-by.2e8a1b92.png",createdTimePng:"/images/tooltips/types/created-time.4e1ef094.png",datePng:"/images/tooltips/types/date.9f6b859a.png",emailPng:"/images/tooltips/types/email.4b0c2a3c.png",filePng:"/images/tooltips/types/file.f6a0cae5.png",formulaPng:"/images/tooltips/types/formula.2f728ad9.png",multiSelectPng:"/images/tooltips/types/multi_select.a8586d55.png",numberPng:"/images/tooltips/types/number.6ec35f46.png",personPng:"/images/tooltips/types/person.8cc03073.png",phoneNumberPng:"/images/tooltips/types/phone-number.6831c3cf.png",relationPng:"/images/tooltips/types/relation.f5c043b2.png",selectPng:"/images/tooltips/types/select.235ad906.png",textPng:"/images/tooltips/types/text.6cdde1be.png",urlPng:"/images/tooltips/types/url.e1402130.png"},upsells:{exportPdfSubpagesPng:"/images/tooltips/upsells/export-pdf-subpages.6e1fbc6d.png",searchEngineIndexingPng:"/images/tooltips/upsells/search-engine-indexing.e5c6961b.png",spaceReadAndWritePng:"/images/tooltips/upsells/space-read-and-write.62e14abe.png",userFullAccessPng:"/images/tooltips/upsells/user-full-access.c4437c4a.png",userReadAndWritePng:"/images/tooltips/upsells/user-read-and-write.398ed1ea.png"},views:{activeProjectsPng:"/images/tooltips/views/active-projects.ebc407e1.png",boardPng:"/images/tooltips/views/board.8bfd0505.png",calendarPng:"/images/tooltips/views/calendar.52338499.png",galleryPng:"/images/tooltips/views/gallery.4d7bfca7.png",groupsNewPng:"/images/tooltips/views/groups-new.103e9333.png",listPng:"/images/tooltips/views/list.003e7876.png",myProjectsPng:"/images/tooltips/views/my-projects.a24e2dab.png",projectBoardPng:"/images/tooltips/views/project-board.574ee561.png",projectCalendarPng:"/images/tooltips/views/project-calendar.61960b20.png",projectTimelinePng:"/images/tooltips/views/project-timeline.45a3b3fa.png",tablePng:"/images/tooltips/views/table.431b4cc6.png",tasksByAssigneePng:"/images/tooltips/views/tasks-by-assignee.a3cd6078.png",tasksByStatusChartPng:"/images/tooltips/views/tasks-by-status-chart.3875cfeb.png",tasksByStatusPng:"/images/tooltips/views/tasks-by-status.0f2f238d.png",tasksCalendarPng:"/images/tooltips/views/tasks-calendar.1c993d1a.png",tasksMyTasksPng:"/images/tooltips/views/tasks-my-tasks.9a0ea5e5.png",tasksTimelinePng:"/images/tooltips/views/tasks-timeline.6c5abae1.png",timelinePng:"/images/tooltips/views/timeline.d471f88d.png"}},twitterLogoPng:"/images/twitter-logo.png",uidoc:{iosKeyboardPng:"/images/uidoc/ios-keyboard.png",iphoneFramePng:"/images/uidoc/iphone-frame.png",iphoneStatusBarPng:"/images/uidoc/iphone-status-bar.png",safariBottomPng:"/images/uidoc/safari-bottom.png",safariBottomReversedPng:"/images/uidoc/safari-bottom-reversed.png",safariTopPng:"/images/uidoc/safari-top.png",teslaJpg:"/images/uidoc/tesla.jpg",trafficLightsPng:"/images/uidoc/traffic-lights.png"},upworkPreviewPng:"/images/upwork_preview.png",viewsIntro:{intro1Png:"/images/views-intro/intro1.png",intro2Png:"/images/views-intro/intro2.png",intro3Png:"/images/views-intro/intro3.png"},waitlist:{emailV2Svg:"/images/waitlist/email-v2.svg",facebookV2Svg:"/images/waitlist/facebook-v2.svg",linkedinV2Svg:"/images/waitlist/linkedin-v2.svg",twitterV2Svg:"/images/waitlist/twitter-v2.svg"},wikiTargetedPromo:{darkMode:{ownerPng:"/images/wiki-targeted-promo/dark-mode/owner.png",tagsPng:"/images/wiki-targeted-promo/dark-mode/tags.png",upgradePng:"/images/wiki-targeted-promo/dark-mode/upgrade.png",verificationPng:"/images/wiki-targeted-promo/dark-mode/verification.png"},lightMode:{ownerPng:"/images/wiki-targeted-promo/light-mode/owner.png",tagsPng:"/images/wiki-targeted-promo/light-mode/tags.png",upgradePng:"/images/wiki-targeted-promo/light-mode/upgrade.png",verificationPng:"/images/wiki-targeted-promo/light-mode/verification.png"}},workflowTemplates:{projectsWorkflowTemplatePng:"/images/workflow-templates/projects-workflow-template.png"}},katex:{fonts:{kaTeXAmsRegularTtf:"/katex/fonts/KaTeX_AMS-Regular.56573229.ttf",kaTeXAmsRegularWoff:"/katex/fonts/KaTeX_AMS-Regular.10824af7.woff",kaTeXAmsRegularWoff2:"/katex/fonts/KaTeX_AMS-Regular.66c67820.woff2",kaTeXCaligraphicBoldTtf:"/katex/fonts/KaTeX_Caligraphic-Bold.497bf407.ttf",kaTeXCaligraphicBoldWoff:"/katex/fonts/KaTeX_Caligraphic-Bold.de2ba279.woff",kaTeXCaligraphicBoldWoff2:"/katex/fonts/KaTeX_Caligraphic-Bold.a9e9b095.woff2",kaTeXCaligraphicRegularTtf:"/katex/fonts/KaTeX_Caligraphic-Regular.e6fb499f.ttf",kaTeXCaligraphicRegularWoff:"/katex/fonts/KaTeX_Caligraphic-Regular.a25140fb.woff",kaTeXCaligraphicRegularWoff2:"/katex/fonts/KaTeX_Caligraphic-Regular.08d95d99.woff2",kaTeXFrakturBoldTtf:"/katex/fonts/KaTeX_Fraktur-Bold.b9d7c449.ttf",kaTeXFrakturBoldWoff:"/katex/fonts/KaTeX_Fraktur-Bold.40934fc0.woff",kaTeXFrakturBoldWoff2:"/katex/fonts/KaTeX_Fraktur-Bold.796f3797.woff2",kaTeXFrakturRegularTtf:"/katex/fonts/KaTeX_Fraktur-Regular.97a699d8.ttf",kaTeXFrakturRegularWoff:"/katex/fonts/KaTeX_Fraktur-Regular.e435cda5.woff",kaTeXFrakturRegularWoff2:"/katex/fonts/KaTeX_Fraktur-Regular.f9e6a99f.woff2",kaTeXMainBoldItalicTtf:"/katex/fonts/KaTeX_Main-BoldItalic.52fb39b0.ttf",kaTeXMainBoldItalicWoff:"/katex/fonts/KaTeX_Main-BoldItalic.5f875f98.woff",kaTeXMainBoldItalicWoff2:"/katex/fonts/KaTeX_Main-BoldItalic.d8737343.woff2",kaTeXMainBoldTtf:"/katex/fonts/KaTeX_Main-Bold.8e431f7e.ttf",kaTeXMainBoldWoff:"/katex/fonts/KaTeX_Main-Bold.4cdba646.woff",kaTeXMainBoldWoff2:"/katex/fonts/KaTeX_Main-Bold.a9382e25.woff2",kaTeXMainItalicTtf:"/katex/fonts/KaTeX_Main-Italic.39349e0a.ttf",kaTeXMainItalicWoff:"/katex/fonts/KaTeX_Main-Italic.8ffd28f6.woff",kaTeXMainItalicWoff2:"/katex/fonts/KaTeX_Main-Italic.65297062.woff2",kaTeXMainRegularTtf:"/katex/fonts/KaTeX_Main-Regular.818582da.ttf",kaTeXMainRegularWoff:"/katex/fonts/KaTeX_Main-Regular.f1cdb692.woff",kaTeXMainRegularWoff2:"/katex/fonts/KaTeX_Main-Regular.f8a7f19f.woff2",kaTeXMathBoldItalicTtf:"/katex/fonts/KaTeX_Math-BoldItalic.6589c4f1.ttf",kaTeXMathBoldItalicWoff:"/katex/fonts/KaTeX_Math-BoldItalic.48155e43.woff",kaTeXMathBoldItalicWoff2:"/katex/fonts/KaTeX_Math-BoldItalic.1320454d.woff2",kaTeXMathItalicTtf:"/katex/fonts/KaTeX_Math-Italic.fe5ed587.ttf",kaTeXMathItalicWoff:"/katex/fonts/KaTeX_Math-Italic.ed7aea12.woff",kaTeXMathItalicWoff2:"/katex/fonts/KaTeX_Math-Italic.d8b7a801.woff2",kaTeXSansSerifBoldTtf:"/katex/fonts/KaTeX_SansSerif-Bold.f2ac7312.ttf",kaTeXSansSerifBoldWoff:"/katex/fonts/KaTeX_SansSerif-Bold.0e897d27.woff",kaTeXSansSerifBoldWoff2:"/katex/fonts/KaTeX_SansSerif-Bold.ad546b47.woff2",kaTeXSansSerifItalicTtf:"/katex/fonts/KaTeX_SansSerif-Italic.f60b4a34.ttf",kaTeXSansSerifItalicWoff:"/katex/fonts/KaTeX_SansSerif-Italic.ef725de5.woff",kaTeXSansSerifItalicWoff2:"/katex/fonts/KaTeX_SansSerif-Italic.e934cbc8.woff2",kaTeXSansSerifRegularTtf:"/katex/fonts/KaTeX_SansSerif-Regular.3243452e.ttf",kaTeXSansSerifRegularWoff:"/katex/fonts/KaTeX_SansSerif-Regular.5f8637ee.woff",kaTeXSansSerifRegularWoff2:"/katex/fonts/KaTeX_SansSerif-Regular.1ac3ed6e.woff2",kaTeXScriptRegularTtf:"/katex/fonts/KaTeX_Script-Regular.a189c37d.ttf",kaTeXScriptRegularWoff:"/katex/fonts/KaTeX_Script-Regular.a82fa2a7.woff",kaTeXScriptRegularWoff2:"/katex/fonts/KaTeX_Script-Regular.1b3161eb.woff2",kaTeXSize1RegularTtf:"/katex/fonts/KaTeX_Size1-Regular.0d8d9204.ttf",kaTeXSize1RegularWoff:"/katex/fonts/KaTeX_Size1-Regular.4788ba5b.woff",kaTeXSize1RegularWoff2:"/katex/fonts/KaTeX_Size1-Regular.82ef26dc.woff2",kaTeXSize2RegularTtf:"/katex/fonts/KaTeX_Size2-Regular.1fdda0e5.ttf",kaTeXSize2RegularWoff:"/katex/fonts/KaTeX_Size2-Regular.b0628bfd.woff",kaTeXSize2RegularWoff2:"/katex/fonts/KaTeX_Size2-Regular.95a1da91.woff2",kaTeXSize3RegularTtf:"/katex/fonts/KaTeX_Size3-Regular.963af864.ttf",kaTeXSize3RegularWoff:"/katex/fonts/KaTeX_Size3-Regular.4de844d4.woff",kaTeXSize3RegularWoff2:"/katex/fonts/KaTeX_Size3-Regular.9108a400.woff2",kaTeXSize4RegularTtf:"/katex/fonts/KaTeX_Size4-Regular.27a23ee6.ttf",kaTeXSize4RegularWoff:"/katex/fonts/KaTeX_Size4-Regular.3045a61f.woff",kaTeXSize4RegularWoff2:"/katex/fonts/KaTeX_Size4-Regular.61522cd3.woff2",kaTeXTypewriterRegularTtf:"/katex/fonts/KaTeX_Typewriter-Regular.6bf42875.ttf",kaTeXTypewriterRegularWoff:"/katex/fonts/KaTeX_Typewriter-Regular.0e046058.woff",kaTeXTypewriterRegularWoff2:"/katex/fonts/KaTeX_Typewriter-Regular.b8b8393d.woff2"},katexMinCss:"/katex/katex.ce13bac2.min.css"},migrations:{allMigrationsJson:"/migrations/all-migrations.75439ac1.json"},printCss:"/print.f2ad22d6.css",publicPageError404Html:"/public-page-error-404.html",securityTxt:"/security.txt",tutorial:{ada1DarkPng:"/tutorial/ada-1-dark.png",ada1Png:"/tutorial/ada-1.png",ada2DarkPng:"/tutorial/ada-2-dark.png",ada2Png:"/tutorial/ada-2.png",ada3DarkPng:"/tutorial/ada-3-dark.png",ada3Png:"/tutorial/ada-3.png",ada4DarkPng:"/tutorial/ada-4-dark.png",ada4Png:"/tutorial/ada-4.png",androidSidebarPng:"/tutorial/android-sidebar.png",emptyAvatarPng:"/tutorial/empty-avatar.png",iosDragAndDropGif:"/tutorial/ios-drag-and-drop.gif",iosNotionWebClipperGif:"/tutorial/ios-notion-web-clipper.gif",iosSidebarGif:"/tutorial/ios-sidebar.gif",mobileEditorGif:"/tutorial/mobile-editor.gif",mobileOfflineJpg:"/tutorial/mobile-offline.jpg",mobileShareSheetAndroidPng:"/tutorial/mobile-share-sheet-android.png",mobileShareSheetIosPng:"/tutorial/mobile-share-sheet-ios.png",mobileSyncMacPng:"/tutorial/mobile-sync-mac.png",mobileSyncSafariPng:"/tutorial/mobile-sync-safari.png",onboardingWikiDarkPng:"/tutorial/onboarding-wiki-dark.png",onboardingWikiPng:"/tutorial/onboarding-wiki.png",simon1DarkPng:"/tutorial/simon-1-dark.png",simon1Png:"/tutorial/simon-1.png",simon2DarkPng:"/tutorial/simon-2-dark.png",simon2Png:"/tutorial/simon-2.png",simon3DarkPng:"/tutorial/simon-3-dark.png",simon3Png:"/tutorial/simon-3.png",simon4DarkPng:"/tutorial/simon-4-dark.png",simon4Png:"/tutorial/simon-4.png",simonHalfDarkPng:"/tutorial/simon-half-dark.png",simonHalfPng:"/tutorial/simon-half.png",simonHalfWhitePng:"/tutorial/simon-half-white.png",simonSpyingDarkPng:"/tutorial/simon-spying-dark.png",simonSpyingPng:"/tutorial/simon-spying.png",webClipperOnboardingPng:"/tutorial/web-clipper-onboarding.png"},unsupportedBrowserHtml:"/unsupported-browser.html",unsupportedDesktopHtml:"/unsupported-desktop.html",zoomverify:{verifyzoomHtml:"/zoomverify/verifyzoom.html"}}},837167:(e,t,n)=>{n.d(t,{GF:()=>c,tj:()=>d,u3:()=>l});var o=n(307032),r=n(218265),i=n(815145),a=n(680310),s=n(89101);function l(e){let t=s._j.chat;e.isTutorial&&(t=`${s._j.chat}/tutorial`);const n={};return e.configureOpenInDesktopApp&&(n.configureOpenInDesktopApp="true"),e.pageVisitSource&&(n[i.$X]=String(e.pageVisitSource)),e.peekMode&&(n.pm=e.peekMode),e.peekViewBlockId&&(n[a.UJ]=(0,o.cj)(e.peekViewBlockId)),e.persona&&(n.persona=e.persona),"assistantQueryPrefill"in e&&e.assistantQueryPrefill&&(n.aq=e.assistantQueryPrefill),(0,r.bf)({url:t,query:n})}function c(e){const{currentUrl:t,assistantQueryPrefill:n,assistantTargetRedirect:o}=e,r=new URL(t);return void 0!==n&&r.searchParams.set("aq",n),void 0!==o&&r.searchParams.set("target",o),r.toString()}function d(e){const{pageId:t,scrollToBlockId:n,pageVisitSource:s,isMobile:l}=e,c={};return s&&(c[i.$X]=String(s)),l?(0,r.bf)({url:`/${(0,o.cj)(t)}`,hash:n&&(0,o.cj)(n)}):(c[a.UJ]=(0,o.cj)(t),(0,r.bf)({url:"/chat",query:c,hash:n&&(0,o.cj)(n)}))}},241154:(e,t,n)=>{n.d(t,{Oy:()=>l,PX:()=>a,UI:()=>c,e$:()=>d,oi:()=>s});var o=n(63811),r=n(212847),i=n(471924);function a(){return i.Ar()}const s=(0,o.Z$)((e=>r.uuid().validator(e)),r.uuid().toString);function l(){return i.Ar()}const c=(0,o.Z$)((e=>r.uuid().validator(e)),r.uuid().toString);function d(e){return i.Ar()}},116638:(e,t,n)=>{n.d(t,{QA:()=>w});var o=n(212847);const r=o.object({required:{type:o.literal("everything")},optional:{}}),i=o.object({required:{type:o.literal("notion")},optional:{}}),a=o.object({required:{type:o.literal("workspace")},optional:{}}),s=o.object({required:{type:o.literal("teamspace"),teamId:o.uuid()},optional:{}}),l=o.object({required:{type:o.literal("page"),pageId:o.uuid()},optional:{}}),c=o.object({required:{type:o.literal("collection"),pageId:o.uuid(),collectionId:o.uuid()},optional:{}}),d=o.object({required:{type:o.literal("helpdocs")},optional:{}}),u=o.object({required:{type:o.literal("slack")},optional:{}}),p=o.object({required:{type:o.literal("labeler")},optional:{}}),m=o.object({required:{type:o.literal("slackbot")},optional:{}}),g=o.object({required:{type:o.literal("google-drive")},optional:{}}),f=o.object({required:{type:o.literal("web")},optional:{}}),h=o.object({required:{type:o.literal("github")},optional:{}}),v=o.object({required:{type:o.literal("universal-workspace")},optional:{}}),y=o.object({required:{type:o.literal("universal-none")},optional:{}}),b=o.object({required:{type:o.literal("notion-none")},optional:{}}),_=o.union([p,m,v]),S=o.union([i,a,s,l,c,b]),k=o.union([r,v,u,d,g,h,y,f]),w=(o.union([S,k,_]),{type:"everything"})},938823:(e,t,n)=>{n.d(t,{m9:()=>a,v4:()=>i});var o=n(512174),r=n(647425);const i=4;o.KM;class a{constructor(e){this.getSearchBackend=void 0,this.getEligibleGroup=void 0,this.isAiEnabledFn=void 0,this.isZeroRetentionEnabledFn=void 0,this.getCanSearchWorkspaceWithCollectionIdFilter=void 0,this.checkGate=void 0,this.getSubscriptionTier=void 0,this.getIsAssistantSpaceSettingEnabled=void 0,this.isInitialized=void 0,this.getEligibleGroup=e.getEligibleGroup,this.isAiEnabledFn=e.isAiEnabled,this.isZeroRetentionEnabledFn=e.isZeroRetentionEnabled,this.getCanSearchWorkspaceWithCollectionIdFilter=e.getCanSearchWorkspaceWithCollectionIdFilter,this.getSearchBackend=e.getSearchBackend,this.checkGate=e.checkGate,this.getSubscriptionTier=e.getSubscriptionTier,this.getIsAssistantSpaceSettingEnabled=e.getIsAssistantSpaceSettingEnabled,this.isInitialized=e.isInitialized}isAiEnabled(){return this.isAiEnabledFn()}isZeroRetentionEnabled(){return this.isZeroRetentionEnabledFn()}isQnAExplicitlyDisabled(){return this.checkGate("disable_qna_for_workspace")}isXMLAssistantEnabled(){return this.modeIsAtMost("assistant_0.2")}isAttachmentUploadEnabledForUser(){return!this.isZeroRetentionEnabled()&&(!!this.modeIsAtMost("development")||!!this.modeIsAtMost("assistant_0.25_with_marketing")&&this.checkGate("assistant_enable_attachment_upload"))}isPdfImageConversionEnabledForUser(){return this.checkGate("assistant_chat_with_pdf_use_images")}getNamespace(){return"prompt_only_server"}showRemindersToUseQnA(){return this.modeIsNotControl()}isSupportOneClickEnabled(){return this.checkGate("decagon_launch")}isQnaShowLargeRemindersEnabledForUser(){return"on"===this.getEligibleGroup("qna_show_large_reminders")}isQnaShowAssistantOriginInputEnabledForUser(){return"on"===this.getEligibleGroup("qna_show_assistant_origin_input")}isAssistantSummarizeThisPageEnabledForUser(){return"on"===this.getEligibleGroup("assistant_show_summarize_this_page_reminder")&&this.modeIsAtMost("assistant_0.2")}isWebSearchEnabledForUser(){return this.checkGate("ai_assistant_universal_qna_web_search")}isWorkspaceLeapEligible(){return this.modeIsAtMost("assistant_0.2")&&Boolean(this.getSubscriptionTier())&&"enterprise"!==this.getSubscriptionTier()&&!this.isZeroRetentionEnabled()}isSlackQnaNotificationEnabled(){return this.checkGate("slack_qna_notification_tooltip_enabled")}canSeeSlackUniversalQnaAnnouncementModal(){return this.checkGate("is_third_party_qna_enabled")}canSeeRelatedContent(){return this.checkGate("find_related_content")}isAiAutomationButtonEnabledForUser(){return this.checkGate("ai_button_automation_enabled")&&this.modeIsAtMost("assistant_0.3")}shouldComputeRelatedContent(){return this.checkGate("compute_related_content")}canUseUniversalSearchScopes(){const e=this.getSubscriptionTier();return this.checkGate("is_third_party_qna_enabled")&&(0,r.mq)(e)&&this.isAiEnabled()}canUseMaybeNotionHelpSearchArg(){return this.checkGate("ai_search_arg_for_helpdocs_search")}isGoogleDriveQnaEnabled(){return this.checkGate("google_drive_qna_ingestion")}isMarketPlaceExpEnabled(){return this.checkGate("universal_qna_gdrive_enable_marketplace_app")}isGoogleDriveDelayedIngestionEnabled(){return this.checkGate("universal_qna_gdrive_enable_delayed_ingestion")}isGithubQnaEnabled(){return this.checkGate("github_qna")}canUseUniversalGoogleDriveSearchScope(){return this.isGoogleDriveQnaEnabled()&&this.canUseUniversalSearchScopes()}canUseUniversalGithubSearchScope(){return this.isGithubQnaEnabled()&&this.canUseUniversalSearchScopes()}canUseHigherContextLength(){return this.modeIsAtMost("assistant_0.2")}isMoveToCornerEnabled(){return this.modeIsAtMost("exploratory")}canUseCollectionIdForDBScopedSearch(){return this.getCanSearchWorkspaceWithCollectionIdFilter()}canReceiveAssistantLaunchGrant(){return this.modeIsAtMost("development")}isNewFindInExperienceEnabled(){return this.modeIsAtMost("assistant_0.25")&&this.checkGate("assistant_new_find_in_experience")}getMode(){if(!this.isAiEnabledFn())return"control";if(this.isQnAExplicitlyDisabled())return"control";const e=this.getEligibleGroup("assistant_variant");return e&&o.KM.find((t=>t===e))?e:this.getIsAssistantSpaceSettingEnabled()?"assistant_0.3":"assistant_0.25"}isMode(e){return this.getMode()===e}modeIsAtMost(e){return(0,o.i1)({mode:e,currentMode:this.getMode()})}modeIsNotControl(){return"control"!==this.getMode()}getIsInitialized(){return this.isInitialized}}},603865:(e,t,n)=>{n.d(t,{$M:()=>k,GQ:()=>M,NO:()=>y,Q9:()=>g,SF:()=>h,TX:()=>T,Vd:()=>m,XO:()=>w,Ym:()=>S,bD:()=>I,cO:()=>v,fo:()=>P,g9:()=>b,rX:()=>_});n(757658);var o=n(653965),r=n(940470),i=n(401898),a=n(881730),s=n(823290),l=n(399036),c=n(406695),d=n(335102),u=n(576218),p=n(295519);function m(e){return"event"===e.trigger.type}function g(e){return"recurrence"===e.trigger.type}(0,i.AO)((e=>(0,i.$K)(e)&&(0,i.$K)(e.target)&&(0,i.$K)(e.external_bot_id)?{true:{external_bot_id:e.external_bot_id,target:e.target}}:{false:e}));const f={checkbox:!0,date:!0,email:!0,multi_select:!0,number:!0,person:!0,phone_number:!0,relation:!0,select:!0,status:!0,text:!0,title:!0,url:!0,auto_increment_id:!1,button:!1,created_by:!1,created_time:!1,file:!1,formula:!1,last_edited_by:!1,last_edited_time:!1,last_visited_time:!1,location:!1,rollup:!1,verification:!1};function h(e){return Boolean(f[e.type]&&!(0,l.NK)(e)&&(!(0,l.qQ)(e)||void 0===(0,l.q3)(e)))}function v(e){const{collectionFormat:t,collectionSchema:n,filter:r,sort:a,sourcePropertyIds:s}=e,l=(s??(0,i.Yd)(n)).filter(((e,t,o)=>{const i=n[e];return!(!i||!h(i))&&(!r||r([e,i],t,n))}));if(0===l.length)return[];if(!t||!1===a)return l;const d=(0,p.i)(t,n,void 0,c.j5.Page).collection_page_properties||[];return o.MR(l,(e=>d.findIndex((t=>t.property===e))))}function y(e){const{collectionFormat:t,collectionSchema:n,sort:r}=e,a=(0,i.Yd)(n).filter(((e,t,o)=>{const r=n[e];return!(!r||!(0,l.U8)(r))}));if(0===a.length)return[];if(!t||!1===r)return a;const s=(0,p.i)(t,n,void 0,c.j5.Page).collection_page_properties||[];return o.MR(a,(e=>s.findIndex((t=>t.property===e))))}async function b(e){const{config:t,page:n,collectionPointer:o,collectionSchema:i,actionId:l,context:c,getCurrentPropertyValue:p}=e,m=[];for(const f of t.properties||[]){var g;const e=null===(g=t.values)||void 0===g?void 0:g[f],v=null==i?void 0:i[f];if(!v||!h(v))continue;const y=(0,u.H0)(o,f,v);if(!y)return{error:new a.Ox({actionId:l,property:f,collectionPointer:o})};const b=await(0,u.OH)({value:(null==e?void 0:e.value)||{type:"simple",value:void 0},context:{...c,returnType:y},executeFormula:c.executeContextualFormula});if(r.x.isFail(b))return{error:new a.x6({actionId:l,cause:b.error})};const _=(0,d.ag)({result:b.value,page:n,action:(0,s.o9)(e),currentPropertyValue:null==p?void 0:p(f),propertyId:f,propertySchema:v});_&&m.push(..._)}return{value:m}}function _(e){const{formulaValueTypes:t,minimumRole:n,targetId:o}=e,r=(0,d.vx)(t,o);if(r){const e=r.type;if("array"===e.type&&"block"===e.of.type&&e.of.collection)return[{type:"record_permission",pointer:e.of.collection,minimumRole:n??"reader"}]}return[]}const S={checkbox:!0,date:!0,email:!0,multi_select:!0,number:!0,person:!0,phone_number:!0,relation:!0,select:!0,status:!0,text:!0,title:!0,url:!0,button:!1,file:!1,verification:!1,auto_increment_id:!1,created_by:!1,created_time:!1,formula:!1,last_edited_by:!1,last_edited_time:!1,last_visited_time:!1,location:!1,rollup:!1};function k(e){return Boolean(S[e.type])}function w(e){const{collectionFormat:t,collectionSchema:n,filter:r,sort:a}=e,s=(0,i.Yd)(n).filter(((e,t,o)=>{var i;const a=n[e];return!(!a||!S[a.type])&&((!(0,l.qQ)(a)||null===(i=(0,l.q3)(a))||void 0===i||!i.auto_update_on_edit)&&(!r||r([e,a],t,n)))}));if(0===s.length)return[];if(!t||!1===a)return s;const d=(0,p.i)(t,n,void 0,c.j5.Page).collection_page_properties||[];return o.MR(s,(e=>d.findIndex((t=>t.property===e))))}const x={checkbox:!0,email:!0,multi_select:!0,number:!0,person:!0,phone_number:!0,relation:!0,select:!0,status:!0,text:!0,title:!0,url:!0,auto_increment_id:!1,button:!1,created_by:!1,created_time:!1,date:!1,file:!1,formula:!1,last_edited_by:!1,last_edited_time:!1,last_visited_time:!1,location:!1,rollup:!1,verification:!1};function I(e){return x[e.type]}const C={checkbox:!0,created_by:!0,created_time:!0,date:!0,email:!0,multi_select:!0,number:!0,person:!0,phone_number:!0,relation:!0,select:!0,status:!0,text:!0,title:!0,url:!0,last_edited_by:!0,last_edited_time:!0,auto_increment_id:!1,button:!1,file:!1,formula:!1,last_visited_time:!1,location:!1,rollup:!1,verification:!1};function T(e){return C[e.type]}function M(e){return 0===e}function P(e){return"button_block"===e||"button_property"===e}},267130:(e,t,n)=>{n.d(t,{Fv:()=>r,Ov:()=>s,uz:()=>a});n(757658);var o=n(401898);const r={create:(e,t)=>({pointer:e,platform:t,typecheckStartTime:void 0,typecheckDurationMs:void 0,typecheckSuccess:void 0,totalActionDependencies:void 0,executionStartTime:void 0,executionDurationMs:void 0,executionSuccess:void 0,totalOperations:void 0,totalBlocksCreated:void 0,totalPagesCreated:void 0,totalPagesUpdated:void 0,totalUsersMentioned:void 0,totalActions:0,actionStats:{},transactionIds:void 0}),createAction:(e,t)=>({pointer:e,actionType:t,typecheckStartTime:void 0,typecheckDurationMs:void 0,typecheckSuccess:void 0,totalDependencies:void 0,executionStartTime:void 0,executionDurationMs:void 0,executionSuccess:void 0,totalOperations:void 0,blocksCreated:void 0,pagesCreated:void 0,pagesUpdated:void 0,usersMentioned:void 0,transactionIds:void 0}),getOrCreateAction:(e,t,n)=>(e.actionStats[t.id]||(e.actionStats[t.id]=r.createAction(t,n)),e.actionStats[t.id]),aggregate(e){let t,n,o,r,a,s;const l=Object.values(e.actionStats),c=[];for(const d of l)t=i(t,d.totalDependencies),n=i(n,d.totalOperations),o=i(o,d.blocksCreated),r=i(r,d.pagesCreated),a=i(a,d.pagesUpdated),s=i(s,d.usersMentioned),Array.isArray(d.transactionIds)&&d.transactionIds.length>0&&c.push(...d.transactionIds);return e.totalActionDependencies=t,e.totalOperations=n,e.totalBlocksCreated=o,e.totalPagesCreated=r,e.totalPagesUpdated=a,e.totalUsersMentioned=s,c.length>0&&(e.transactionIds=c),e.totalActions=l.length,e},aggregateActionStats(e,t){(0,o.$K)(t)&&(e.typecheckDurationMs=i(e.typecheckDurationMs,t.typecheckDurationMs),e.totalDependencies=i(e.totalDependencies,t.totalDependencies),e.executionDurationMs=i(e.executionDurationMs,t.executionDurationMs),e.totalOperations=i(e.totalOperations,t.totalOperations),e.blocksCreated=i(e.blocksCreated,t.blocksCreated),e.pagesCreated=i(e.pagesCreated,t.pagesCreated),e.pagesUpdated=i(e.pagesUpdated,t.pagesUpdated),e.usersMentioned=i(e.usersMentioned,t.usersMentioned),Array.isArray(t.transactionIds)&&t.transactionIds.length>0&&(e.transactionIds=e.transactionIds??[],e.transactionIds.push(...t.transactionIds)))}};function i(e,t){return(0,o.$K)(t)?(e??0)+t:e}const a=(0,o.AO)((e=>(0,o.$K)(e.executionStartTime)&&(0,o.$K)(e.executionDurationMs)&&(0,o.$K)(e.executionSuccess)?{true:{...e,executionStartTime:e.executionStartTime,executionDurationMs:e.executionDurationMs,executionSuccess:e.executionSuccess}}:{false:e})),s=(0,o.AO)((e=>(0,o.$K)(e.executionStartTime)&&(0,o.$K)(e.executionDurationMs)&&(0,o.$K)(e.executionSuccess)?{true:{...e,executionStartTime:e.executionStartTime,executionDurationMs:e.executionDurationMs,executionSuccess:e.executionSuccess}}:{false:e}))},748777:(e,t,n)=>{n.d(t,{L:()=>w,Y:()=>S});n(757658),n(21703);var o=n(709291),r=n(940470),i=n(401898),a=n(603865),s=n(541432),l=n(173110),c=n(335102),d=n(589789),u=n(45681),p=n(747453),m=n(471924),g=n(959753),f=n(463306),h=n(718844),v=n(421202),y=n(881730),b=n(267130);const _=(0,o.defineMessages)({createPage:{id:"automations.actions.createPage",defaultMessage:"Add page to…"},createPageDefaultVariableName:{id:"automations.actions.createPageDefaultVariableName",defaultMessage:"New page added"},createPageVariableNameWithDatabase:{id:"automations.actions.createPageVariableNameWithDatabase",defaultMessage:"New page added in {databaseName}"},createPageVariableNameWithDatabaseAndStepNumber:{id:"automations.actions.createPageVariableNameWithDatabaseAndStepNumber",defaultMessage:"New page added in {databaseName} from step {stepNumber}"},createPageDescription:{id:"automations.actions.createPageDescription",defaultMessage:"Adds a new page to a database."}}),S={relation:!0,person:!0,multi_select:!0,title:!1,text:!1,url:!1,email:!1,phone_number:!1,checkbox:!1,created_by:!1,last_edited_by:!1,file:!1,select:!1,status:!1,number:!1,date:!1,created_time:!1,last_edited_time:!1,last_visited_time:!1,formula:!1,rollup:!1,button:!1,auto_increment_id:!1,location:!1,verification:!1},k=new Set(["button","event","recurrence"]),w={type:"create_page",invertible:!0,hasSideEffects:!0,display:{icon:p.R,name:_.createPage,description:_.createPageDescription},isAvailableForContext:e=>{let t=e.automation.getTriggerType();return"notification_event"===t&&(t="event"),"event"===t?e.isSubscribed:k.has(t)},getExecutionDependencies:(e,t)=>{const n=[],o=t.getConfig();return null!=o&&o.collection&&(n.push({type:"record_permission",pointer:o.collection,minimumRole:"content_only_editor"},{type:"collection_default_template_record_permission",pointer:o.collection,minimumRole:"none"}),null!=o&&o.template_page_id&&n.push({type:"record_permission",pointer:{id:o.template_page_id,spaceId:o.collection.spaceId,table:v.iU},minimumRole:"reader"})),n},typecheck:(e,t)=>{const n=t.getConfig();if(null==n||!n.collection)return{value:{validationFailures:[{type:"missing_required_config",actionType:"create_page",key:"collection"}]}};const o=e.getRecordModel(n.collection);if(!o)return{value:{validationFailures:[{type:"missing_required_config",actionType:"create_page",key:"collection"}]}};if(f.Pz(o.pointer,e.getRecordModel))return{value:{validationFailures:[{type:"collection_in_trash",actionType:"create_page",key:"collection"}]}};if(!n.collection.spaceId)return{error:new y.MO("Collection missing space ID")};if(n.template_page_id){const t=e.getRecordModel({id:n.template_page_id,table:v.iU});if(!t)return{value:{validationFailures:[{type:"invalid_optional_config",actionType:"create_page",key:"template"}]}};if(!t.isTemplate())return{value:{validationFailures:[{type:"invalid_optional_config",actionType:"create_page",key:"template"}]}};if(t.getParentId()!==n.collection.id)return{value:{validationFailures:[{type:"invalid_optional_config",actionType:"create_page",key:"template"}]}}}let r=!1,i=!1;for(const l of e.automationModel.getActionIds()){if(l===t.id)continue;const o=e.getRecordModel({id:l,spaceId:e.automationModel.getSpaceId(),table:h.Xj});var a;if("create_page"===(null==o?void 0:o.type))r=!0,(null===(a=o.getConfig())||void 0===a||null===(a=a.collection)||void 0===a?void 0:a.id)===n.collection.id&&(i=!0)}const s=(0,c.Kd)({source:"action",action_id:t.id,action_output_type:"page"}),d=e.automationModel.getActionIds().indexOf(t.id)??-1,u=o.getRenderTitle({getRecordModel:e.getRecordModel,userTimeZone:e.userTimeZone,intl:e.intl}),p=i?e.intl.formatMessage(_.createPageVariableNameWithDatabaseAndStepNumber,{databaseName:u,stepNumber:d+1}):r?e.intl.formatMessage(_.createPageVariableNameWithDatabase,{databaseName:u}):e.intl.formatMessage(_.createPageDefaultVariableName);return{value:{valueTypes:[{kind:l.yp.ContextValue,id:s,name:p,type:{type:"block",collection:n.collection}}]}}},execute:async(e,t)=>{const{author:n,executeEffectMap:o,handleDataRequest:p,loadRecordModel:h,useCrdtDefault:_}=e,S=t.getConfig();if(null==S||!S.collection||!S.collection.spaceId)return{error:new y.mK({pointer:null==S?void 0:S.collection,actionId:t.id})};const k=await h(S.collection);if(!k)return{value:{values:[]}};const w=k.getSpaceShardedPointer(),I=await f.ne(w,h),C=f.OJ(I);if((0,i.$K)(C))return{error:new y.O3({pointer:w,actionId:t.id})};let T;if(S.template_page_id){const e={id:S.template_page_id,spaceId:S.collection.spaceId,table:v.iU};x({getRecordModel:(await p({recordPointers:[e]})).getRecordModel,pointer:e})&&(T=S.template_page_id)}if(!(0,i.$K)(T)){const e=(await p({recordPointers:[S.collection]})).getRecordModel(S.collection),t=null==e?void 0:e.getDefaultTemplatePagePointer();if(t){x({getRecordModel:(await p({recordPointers:[t]})).getRecordModel,pointer:t})&&(T=t.id)}}const M=k.isPageTreeCollection(),P=k.getRootPagePointer(),A=await async function(e){const{isPageTreeCollection:t,rootPagePointer:n,actionId:o,author:r,loadRecordModel:i,useCrdtDefault:a}=e;if(t&&n){const e=await i(n);return e?{value:e.useCrdt()}:{error:new y.mK({pointer:n,actionId:o})}}return{value:a(r)}}({isPageTreeCollection:M,rootPagePointer:P,author:n,actionId:t.id,loadRecordModel:h,useCrdtDefault:_});if(r.x.isFail(A))return A;const{value:R}=A;let D,B;const E={},F=[];if(T){const n=await e.executeEffectMap.initializeTemplateInDatabase({actionId:t.id,templateId:T,collection:S.collection,propertyUpdates:{},useCrdt:R,automationExecutionContext:e});if(r.x.isFail(n))return n;D=n.value.pageId,B=n.value.pageModel,n.value.stats&&b.Fv.aggregateActionStats(E,n.value.stats)}else{var Z;D=(null===(Z=e.spaceIdCreator)||void 0===Z?void 0:Z.idInSavedSpace(v.iU))??m.Ar();const{model:t,operations:o}=g.yJh.create({id:D,type:s.Ti.page,parent:S.collection,space_id:S.collection.spaceId,createdBy:n||d.r3},{useCrdt:R});B=t,F.push(...o),b.Fv.aggregateActionStats(E,{blocksCreated:1,pagesCreated:1})}const U=k.getNormalizedSchema();if(U){const n=await(0,a.g9)({config:S,page:B,collectionPointer:w,collectionSchema:U,actionId:t.id,context:e});if(r.x.isFail(n))return n;F.push(...n.value)}if(M&&P){const e=(0,u.A6)(P.table,v.iU);if(!e)throw new Error(`Could not find child path for parent table ${P.table} and child table ${v.iU}`);F.push({pointer:P,path:e,command:"insertChildrenAfter",args:{ids:[D]}})}if(F.length>0){const e=await o.saveTransaction({actionId:t.id,info:{type:"create_page",collection:w,pageId:D},operations:F});if(e.error)return e;b.Fv.aggregateActionStats(E,e.value.stats)}const V=(0,c.Kd)({source:"action",action_id:t.id,action_output_type:"page"}),N={kind:l.yp.ContextValue,id:V,value:{type:"block",value:B.pointer}};return e.runtimeRecordPointerSet.add(B.pointer),{value:{stats:E,values:[N]}}}};function x(e){const{getRecordModel:t,pointer:n}=e,o=f.DW(n,t);return f.Zg(o)}},925785:(e,t,n)=>{n.d(t,{z:()=>qe,P:()=>He});var o=n(823290),r=n(709291),i=n(11751);const a=(0,r.defineMessages)({assistant:{id:"automations.actions.assistant",defaultMessage:"Notion AI"},assistantDescription:{id:"automations.actions.assistantDescription",defaultMessage:"Uses Notion AI to execute a task."}}),s={type:"assistant",invertible:void 0,hasSideEffects:!0,display:{icon:i.t,name:a.assistant,description:a.assistantDescription},isAvailableForContext:e=>!1,getExecutionDependencies:(e,t)=>[],typecheck:(e,t)=>({value:{valueTypes:[]}}),execute:(e,t)=>Promise.resolve({value:{values:[]}})};n(757658);var l=n(401898),c=n(173110),d=n(186517),u=n(600606),p=n(718844),m=n(421838),g=n(881730),f=n(763418);const h=(0,r.defineMessages)({assistant:{id:"automations.actions.assistantBasic",defaultMessage:"Notion AI"},assistantDescription:{id:"automations.actions.assistantBasicDescription",defaultMessage:"Opens an Assistant session with the specified instructions applied."}}),v={type:"assistant_basic",invertible:void 0,hasSideEffects:!0,display:{icon:i.t,name:h.assistant,description:h.assistantDescription},isAvailableForContext:e=>!("canAddAction"===e.checkType&&e.automationActions.length>=1)&&(!!e.assistantFeatureGate.isAiAutomationButtonEnabledForUser()&&"button"===e.automation.getTriggerType()),getExecutionDependencies:(e,t)=>{const n=t.getConfig(),o=[];o.push({minimumRole:"none",pointer:e.automationModel.getSpacePointer(),type:"record_permission"});const r=function(e){if(!e||!e.parameterValues)return[];if((0,p.tu)(e)){var t;const n=null===(t=e.parameterValues)||void 0===t?void 0:t.instructions;return(0,m.cCA)(n)}{const t=e.parameterValues;return Object.values(t).filter(y)}}(n);for(const i of r)o.push({minimumRole:"reader",pointer:i,type:"record_permission"});return o},typecheck:(e,t)=>{const{automationModel:n,getRecordModel:o,getRecordRole:r}=e,i=n.getSpacePointer(),a=r(i);if(!a||(0,d.gr)(a,"reader"))return{value:{validationFailures:[{actionType:"assistant_basic",type:"ai_disabled_for_guest"}]}};const s=o(i);if(!(0,l.$K)(s))return{error:new g.MO("Space model missing")};if(!s.isAiEnabledOnSpace())return{value:{validationFailures:[{actionType:"assistant_basic",type:"ai_disabled_in_space"}]}};const c=t.getConfig()??{skillType:"custom"};if(!(0,p.YC)(c))return{value:{validationFailures:[{actionType:"assistant_basic",type:"invalid_config"}]}};const{skillType:u}=c;if(!u)return{value:{validationFailures:[{actionType:"assistant_basic",type:"invalid_config"}]}};if(!(0,p.tu)(c))return{value:{validationFailures:[{actionType:"assistant_basic",type:"unsupported_skill"}]}};{var f;const e=null===(f=c.parameterValues)||void 0===f?void 0:f.instructions;if(0===(0,m.QaF)(e).trim().length)return{value:{validationFailures:[{actionType:"assistant_basic",type:"empty_instructions",key:"instructions"}]}}}return{value:{valueTypes:[]}}},execute:(e,t)=>{const n=t.getConfig();if(!n)return Promise.resolve({error:new g.Qq({actionId:t.id})});const o=function(e){var t;const n=(0,f.Vl)(),o=e.values.find((e=>e.kind===c.yp.ContextValue&&e.id===n));if(!o||"block"!==(null===(t=o.value)||void 0===t?void 0:t.type))return;return o.value.value}(e);return e.executeEffectMap.runAssistantWithInstructions({automationId:e.automationModel.id,config:n,overrideCurrentPagePointer:o}),Promise.resolve({value:{values:[]}})}};function y(e){return null!=e&&"object"==typeof e&&"id"in e&&"spaceId"in e&&"table"in e&&"string"==typeof e.id&&"string"==typeof e.table&&(0,u.Ok)(e)}var b=n(940470),_=n(371663),S=n(640506),k=n(145953),w=n(396367),x=n(798963),I=n(139927),C=n(894438),T=(n(252262),n(324506),n(653965)),M=n(541432),P=n(589789),A=n(471924),R=n(959753),D=n(300482),B=n(421202),E=n(606287);const F=(0,g.Fd)((async function(e){const{completeSprintAction:t,completeSprintExecutionContext:n}=e,o=await async function(e){const{sprintCollectionSchema:t,sprintCollectionPointer:n}=e.sprintCollectionContext,{context:o,action:r}=e.automationContext,i=w.qB[_.p$].current.reducer.getCombinatorFilter(t);return await N((()=>o.executeEffectMap.queryCollection({actionId:r.id,collection:n,userTimeZone:o.userTimeZone,filter:i,limit:1})),e)}(n);if(b.x.isFail(o))return o;const r=o.value.blockIds.at(0);if(!(0,l.$K)(r))return{error:new g._w({actionId:n.automationContext.action.id})};const i=await async function(e){const{sprintCollectionSchema:t,sprintCollectionPointer:n}=e.sprintCollectionContext,{context:o,action:r}=e.automationContext,i=w.qB[_.p$].next.reducer.getCombinatorFilter(t);return await N((()=>o.executeEffectMap.queryCollection({actionId:r.id,collection:n,userTimeZone:o.userTimeZone,filter:i,limit:1})),e)}(n);if(b.x.isFail(i))return i;const a=T.Ps(i.value.blockIds),s=await Promise.all([Z({currentSprintPageId:r,completeSprintExecutionContext:n}),U({currentSprintPageId:r,completeSprintExecutionContext:n})]);let c=s[0];const d=s[1],u=function(e){const{incompleteTasksResult:t,completeTasksResult:n}=e;if(b.x.isFail(t)||b.x.isFail(n))return;const o=t.value.blockIds.length,r=n.value.blockIds.length,i=o+r;return{completedTaskCount:r,incompleteTaskCount:o,totalTaskCount:i,completedTaskPercent:0===i?0:r/i}}({incompleteTasksResult:c,completeTasksResult:d}),p=n.automationContext.context.automationModel.isActive()?"recurrence_automation":"button_automation";let f,h;if((0,I.$X)({eventTracker:n.automationContext.context.eventTracker,properties:{action:"complete_sprint",from:p,completeSprintActionType:t,nextSprintDateRange:n.sprintCollectionContext.nextSprintDateRange,nextSprintInput:a?{type:"pointer",pointer:{id:a,table:B.iU,spaceId:n.spaceId}}:{type:"actionId"},currentSprintTaskSummary:u}}),a)h=a,f=1;else{const e=await async function(e){const{completeSprintExecutionContext:t,currentSprintPageId:n}=e,{sprintStatusNextOptionName:o,sprintStatusPropertyId:r}=t.sprintCollectionContext,{context:i,action:a}=t.automationContext,{recordMap:s,spaceId:l}=t,c={id:n,table:B.iU,spaceId:l},d=s.getModel(c);if(!d)return{error:new g.Do({actionId:a.id,pointer:c})};const u=q({intl:i.intl,userTimeZone:i.userTimeZone,getRecordModel:R.omK.fromRecordMap(s),incrementSprintIdAmount:1,sourceSprintPageModel:d}),p={title:(0,m.TPx)(u),[r]:[[o]]};return await L({completeSprintExecutionContext:t,pageProperties:p})}({completeSprintExecutionContext:n,currentSprintPageId:r});if(b.x.isFail(e))return e;h=e.value.blockId,f=2}const v=await async function(e){const{sprintUniqueIdPropertyId:t,sprintStatusPropertyId:n,sprintStatusFutureOptionName:o,sprintCollectionPointer:r}=e.sprintCollectionContext,{context:i,action:a}=e.automationContext,s={operator:"and",filters:[{property:n,filter:{operator:"status_is",value:{type:"is_option",value:o}}}]};return await N((()=>i.executeEffectMap.queryCollection({actionId:a.id,collection:r,filter:s,userTimeZone:i.userTimeZone,sort:[{property:t,direction:"ascending"}],limit:1})),e)}(n);if(b.x.isFail(v))return v;let y=v.value.blockIds[0];if(!y){const e=await O({completeSprintExecutionContext:n,sprintPageWithLargestUniqueId:h,incrementFutureSprintIdAmount:1});if(f=1===f?2:3,b.x.isFail(e))return e;y=e.value.blockId}const S=await async function(e){const{sprintUniqueIdPropertyId:t,sprintCollectionPointer:n}=e.sprintCollectionContext,{context:o,action:r}=e.automationContext;return await N((()=>o.executeEffectMap.queryCollection({actionId:r.id,collection:n,userTimeZone:o.userTimeZone,sort:[{property:t,direction:"descending"}],limit:1})),e)}(n);if(b.x.isFail(S))return S;const k=S.value.blockIds[0];if(function(e){var t;const{sprintStatusPropertySchema:n}=e.sprintCollectionContext;return(null===(t=n.options)||void 0===t?void 0:t.some((e=>e.id===_.Rw)))??!1}(n)){const e=await async function(e){const{sprintCollectionSchema:t,sprintCollectionPointer:n}=e.sprintCollectionContext,{context:o,action:r}=e.automationContext,i=w.qB[_.p$].last.reducer.getCombinatorFilter(t);return await N((()=>o.executeEffectMap.queryCollection({actionId:r.id,collection:n,userTimeZone:o.userTimeZone,filter:i,limit:1})),e)}(n);if(b.x.isFail(e))return e;const t=e.value.blockIds[0],o=await async function(e){const{completeSprintExecutionContext:t,currentSprintPageId:n}=e,{sprintStatusLastOptionName:o,sprintStatusPropertyId:r,sprintCollectionPointer:i}=t.sprintCollectionContext,{context:a,action:s}=t.automationContext,{spaceId:l}=t,c=[];o&&c.push(D.op.update({pointer:{id:n,table:B.iU,spaceId:l},path:["properties"],args:{[r]:[[o]]}}));return await a.executeEffectMap.saveTransaction({actionId:s.id,operations:c,info:{type:"update_pages",collection:i,editedProperties:[{id:r,type:"status"}],pageIds:[n]}})}({completeSprintExecutionContext:n,currentSprintPageId:r});if(b.x.isFail(o))return o;if(t){const e=await async function(e){const{completeSprintExecutionContext:t,lastSprintPageId:n}=e,{sprintStatusPastOptionName:o,sprintStatusPropertyId:r,sprintCollectionPointer:i}=t.sprintCollectionContext,{context:a,action:s}=t.automationContext,{spaceId:l}=t,c=[D.op.update({pointer:{id:n,table:B.iU,spaceId:l},path:["properties"],args:{[r]:[[o]]}})];return await a.executeEffectMap.saveTransaction({actionId:s.id,operations:c,info:{type:"update_pages",collection:i,editedProperties:[{id:r,type:"status"}],pageIds:[n]}})}({completeSprintExecutionContext:n,lastSprintPageId:t});if(b.x.isFail(e))return e}}else{const e=await async function(e){const{completeSprintExecutionContext:t,currentSprintPageId:n}=e,{sprintStatusPastOptionName:o,sprintStatusPropertyId:r,sprintCollectionPointer:i}=t.sprintCollectionContext,{context:a,action:s}=t.automationContext,{spaceId:l}=t,c=[D.op.update({pointer:{id:n,table:B.iU,spaceId:l},path:["properties"],args:{[r]:[[o]]}})];return await a.executeEffectMap.saveTransaction({actionId:s.id,operations:c,info:{type:"update_pages",collection:i,editedProperties:[{id:r,type:"status"}],pageIds:[n]}})}({completeSprintExecutionContext:n,currentSprintPageId:r});if(b.x.isFail(e))return e}const x=await async function(e){const{completeSprintExecutionContext:t,nextSprintPageId:n}=e,{sprintStatusCurrentOptionName:o,sprintStatusPropertyId:r,sprintCollectionPointer:i,nextSprintDateRange:a,sprintDatePropertyId:s}=t.sprintCollectionContext,{context:l,action:c}=t.automationContext,{spaceId:d}=t,u=[D.op.update({pointer:{id:n,table:B.iU,spaceId:d},path:["properties"],args:{[r]:[[o]],[s]:[(0,m.YCD)(["d",a])]}})];return await l.executeEffectMap.saveTransaction({actionId:c.id,operations:u,info:{type:"update_pages",collection:i,editedProperties:[{id:r,type:"status"}],pageIds:[n]}})}({completeSprintExecutionContext:n,nextSprintPageId:h});if(b.x.isFail(x))return x;const C=await async function(e){const{completeSprintExecutionContext:t,nextFutureSprintPageId:n}=e,{sprintStatusNextOptionName:o,sprintStatusPropertyId:r,sprintCollectionPointer:i}=t.sprintCollectionContext,{context:a,action:s}=t.automationContext,{recordMap:l,spaceId:c}=t,d={id:n,table:B.iU,spaceId:c},u=l.getModel(d);if(!u)return{error:new g.Do({actionId:s.id,pointer:d})};l.addModel(u);const p=[D.op.update({pointer:u.pointer,path:["properties"],args:{[r]:[[o]]}})];return await a.executeEffectMap.saveTransaction({actionId:s.id,operations:p,info:{type:"update_pages",collection:i,editedProperties:[{id:r,type:"status"}],pageIds:[n]}})}({completeSprintExecutionContext:n,nextFutureSprintPageId:y});if(b.x.isFail(C))return C;const M=await O({completeSprintExecutionContext:n,sprintPageWithLargestUniqueId:k,incrementFutureSprintIdAmount:f});if(b.x.isFail(M))return M;const P=new Set([]);for(;;){if(b.x.isFail(c))return c;if(0===c.value.blockIds.length)break;const e=c.value.blockIds.filter((e=>!P.has(e)));if("complete_sprint_and_move_incomplete_tasks_to_next_sprint"===t&&e.length>0){const t=await j({completeSprintExecutionContext:n,taskIds:e,nextSprintPageId:h});if(b.x.isFail(t))return t}else{if(!("complete_sprint_and_move_incomplete_tasks_to_backlog"===t&&e.length>0))break;{const t=await K(n,e);if(b.x.isFail(t))return t}}e.forEach((e=>P.add(e))),c=await Z({currentSprintPageId:r,completeSprintExecutionContext:n})}return{value:{success:!0}}}),(e=>e.completeSprintExecutionContext.automationContext.context.automationModel.id));async function Z(e){const{currentSprintPageId:t,completeSprintExecutionContext:n}=e,{taskStatusCompleteGroupName:o}=n.taskCollectionContext;return await V({currentSprintPageId:t,statusFilter:{operator:"status_is_not",value:{type:"is_group",value:o}},completeSprintExecutionContext:n})}async function U(e){const{currentSprintPageId:t,completeSprintExecutionContext:n}=e,{taskStatusCompleteGroupName:o}=n.taskCollectionContext;return await V({currentSprintPageId:t,statusFilter:{operator:"status_is",value:{type:"is_group",value:o}},completeSprintExecutionContext:n})}async function V(e){const{currentSprintPageId:t,statusFilter:n,completeSprintExecutionContext:o}=e,{taskStatusPropertyId:r,taskSprintRelationPropertyId:i,taskCollectionPointer:a}=o.taskCollectionContext,{context:s,action:l}=o.automationContext,c={operator:"and",filters:[{property:r,filter:n},{filter:{operator:"relation_contains",value:{type:"exact",value:t}},property:i}]};return await N((()=>s.executeEffectMap.queryCollection({limit:999,actionId:l.id,collection:a,userTimeZone:s.userTimeZone,filter:c})),o)}async function N(e,t){const{spaceId:n,recordMap:o}=t,{context:r}=t.automationContext,i=await e();if(b.x.isFail(i))return i;const a=i.value;if(a.recordMap)o.assign(a.recordMap.toRecordMap());else{const e=a.blockIds.map((e=>({id:e,table:B.iU,spaceId:n}))),t=await r.loadRecordModel(e);o.assign(t)}return{value:{blockIds:a.blockIds}}}async function O(e){const{completeSprintExecutionContext:t,sprintPageWithLargestUniqueId:n,incrementFutureSprintIdAmount:o}=e,{sprintStatusFutureOptionName:r,sprintStatusPropertyId:i}=t.sprintCollectionContext,{context:a,action:s}=t.automationContext,{recordMap:l,spaceId:c}=t,d={id:n,table:B.iU,spaceId:c},u=l.getModel(d);if(!u)return{error:new g.Do({actionId:s.id,pointer:d})};const p=q({intl:a.intl,userTimeZone:a.userTimeZone,getRecordModel:R.omK.fromRecordMap(l),incrementSprintIdAmount:o,sourceSprintPageModel:u}),f={title:(0,m.TPx)(p),[i]:[[r]]};return await L({completeSprintExecutionContext:t,pageProperties:f})}async function L(e){const{completeSprintExecutionContext:t,pageProperties:n}=e,{recordMap:o,sprintCollectionContext:r,automationContext:i,spaceId:a}=t,{context:s,action:l}=i,c=r.sprintCollectionPointer,d=o.getModel(c);if(!d)return{error:new g.fH("invalid_record",`Could not find collection record: ${c.id}`)};let u;const p=s.useCrdtDefault(s.author),m=d.getDefaultTemplatePagePointer();if(m){const e=await s.executeEffectMap.initializeTemplateInDatabase({actionId:l.id,templateId:m.id,collection:d.getSpaceShardedPointer(),propertyUpdates:n,useCrdt:p,automationExecutionContext:s});if(b.x.isFail(e))return e;u=e.value.pageId;const t={id:u,table:B.iU,spaceId:a},r=await s.loadRecordModel(t);if(!r)return{error:new g.fH("invalid_record",`Could not find new sprint page: ${t.id}`)};o.addModel(r)}else{var f;u=(null===(f=s.spaceIdCreator)||void 0===f?void 0:f.idInSavedSpace(B.iU))??A.Il();const{model:e,operations:t}=R.yJh.create({id:u,type:M.Ti.page,parent:{id:c.id,table:E.vF,spaceId:a},space_id:a,properties:n,createdBy:s.author||P.r3},{useCrdt:p});s.runtimeRecordPointerSet.add(e.pointer);const r=await s.executeEffectMap.saveTransaction({actionId:l.id,operations:t,info:{type:"create_page",collection:c,pageId:u}});if(b.x.isFail(r))return r;o.setModel(e.pointer,e)}return{value:{blockId:u}}}async function j(e){const{completeSprintExecutionContext:t,taskIds:n,nextSprintPageId:o}=e,{taskSprintRelationPropertyId:r,taskCollectionPointer:i}=t.taskCollectionContext,{context:a,action:s}=t.automationContext,{spaceId:l}=t,c=n.map((e=>D.op.update({pointer:{id:e,table:B.iU,spaceId:l},path:["properties"],args:{[r]:[(0,m.YCD)((0,m.$0A)(o,l))]}})));return await a.executeEffectMap.saveTransaction({actionId:s.id,operations:c,info:{type:"update_pages",collection:i,editedProperties:[{id:r,type:"relation"}],pageIds:n}})}async function K(e,t){const{taskSprintRelationPropertyId:n,taskCollectionPointer:o}=e.taskCollectionContext,{context:r,action:i}=e.automationContext,{spaceId:a}=e,s=t.map((e=>D.op.update({pointer:{id:e,table:B.iU,spaceId:a},path:["properties"],args:{[n]:void 0}})));return await r.executeEffectMap.saveTransaction({actionId:i.id,operations:s,info:{type:"update_pages",collection:o,editedProperties:[{id:n,type:"relation"}],pageIds:t}})}const z=(0,r.defineMessages)({defaultSprintName:{id:"completeSprint.newSprint.defaultName",defaultMessage:"Sprint"},sprintNameWithId:{id:"completeSprint.newSprintWithId.name",defaultMessage:"Sprint {sprintId}"}});function q(e){const{intl:t,userTimeZone:n,getRecordModel:o,sourceSprintPageModel:r,incrementSprintIdAmount:i}=e,a=r.getRenderTitle({intl:t,userTimeZone:n,getRecordModel:o}),s=T.Z$(null==a?void 0:a.trim().split(" "));let l;if(s){const e=parseInt(s);isNaN(e)||(l=e+i)}return void 0!==l?t.formatMessage(z.sprintNameWithId,{sprintId:l}):t.formatMessage(z.defaultSprintName)}const H={type:"complete_sprint",invertible:!1,hasSideEffects:!0,isAvailableForContext:e=>"recurrence"===e.automation.getTriggerType(),getExecutionDependencies:(e,t)=>{const n=t.getConfig(),o=[];return null!=n&&n.sprint_collection&&o.push({type:"record_permission",pointer:n.sprint_collection,minimumRole:"editor"}),null!=n&&n.task_collection&&o.push({type:"record_permission",pointer:n.task_collection,minimumRole:"editor"}),o},typecheck:(e,t)=>({value:{valueTypes:[]}}),execute:async(e,t)=>{var n,r,i,a,s,l,d,u,p,f,h;const v=t.getConfig();if(!v)return{error:new g.Qq({actionId:t.id})};const y=k.Ak.create(),T=await e.loadRecordModel(v.sprint_collection);if(!T)return{error:new g.Do({actionId:t.id,pointer:v.sprint_collection})};y.addModel(T);const M=T.getNormalizedSchema();if(!(0,w.PB)({appUri:null===(n=T.getFormat())||void 0===n?void 0:n.app_config_uri,collectionSchema:M}))return{error:new g.H2({actionId:t.id,sprintCollectionPointer:T.pointer})};const P=null===(r=T.getFormat())||void 0===r||null===(r=r.app_uri_map)||void 0===r?void 0:r[_.b0.StatusV2];if(!P)return{error:new g.Ox({actionId:t.id,collectionPointer:v.sprint_collection,property:_.b0.StatusV2})};const A=null===(i=T.getFormat())||void 0===i||null===(i=i.app_uri_map)||void 0===i?void 0:i[_.b0.UniqueId];if(!A)return{error:new g.Ox({actionId:t.id,collectionPointer:v.sprint_collection,property:_.b0.UniqueId})};const R=null===(a=T.getFormat())||void 0===a||null===(a=a.app_uri_map)||void 0===a?void 0:a[_.b0.Dates];if(!R)return{error:new g.Ox({actionId:t.id,collectionPointer:v.sprint_collection,property:_.b0.Dates})};const D=M[P];if(!D||"status"!==D.type)return{error:new g.Ox({actionId:t.id,collectionPointer:v.sprint_collection,property:_.b0.StatusV2})};const B=null===(s=D.options)||void 0===s||null===(s=s.find((e=>e.id===_.df)))||void 0===s?void 0:s.value,E=null===(l=D.options)||void 0===l||null===(l=l.find((e=>e.id===_.Rw)))||void 0===l?void 0:l.value,Z=null===(d=D.options)||void 0===d||null===(d=d.find((e=>e.id===_.SF)))||void 0===d?void 0:d.value,U=null===(u=D.options)||void 0===u||null===(u=u.find((e=>e.id===_.YE)))||void 0===u?void 0:u.value,V=null===(p=D.options)||void 0===p||null===(p=p.find((e=>e.id===_.eH)))||void 0===p?void 0:p.value;if(!(B&&Z&&U&&V))return{error:new g.fH("invalid_property_schema",`Could not find required options for ${_.b0.StatusV2}.`)};const N={id:e.automationModel.id,table:x.cv,spaceId:T.id},O=e.automationModel;if(!O.isType("recurrence"))return{error:new g.Do({actionId:t.id,pointer:N})};const L=await e.loadRecordModel(v.task_collection);if(!L)return{error:new g.Do({actionId:t.id,pointer:v.task_collection})};y.addModel(L);const j=null===(f=L.getFormat())||void 0===f||null===(f=f.app_uri_map)||void 0===f?void 0:f[_.Es.Status];if(!j)return{error:new g.Ox({actionId:t.id,collectionPointer:v.task_collection,property:_.Es.Status})};const K=null===(h=L.getFormat())||void 0===h||null===(h=h.app_uri_map)||void 0===h?void 0:h[_.Es.TaskToSprintRelation];if(!K)return{error:new g.Ox({actionId:t.id,collectionPointer:v.task_collection,property:_.Es.TaskToSprintRelation})};const z=L.getNormalizedSchema(),q=z[j];if(!q||"status"!==q.type)return{error:new g.Ox({actionId:t.id,collectionPointer:v.task_collection,property:_.Es.Status})};const H=(0,I.F_)(e.intl,q);if(!H)return{error:new g.fH("invalid_property_schema",`Could not find required group for ${_.Es.Status}.`)};const G=function(e){let t,n;if(e.forEach((e=>{e.kind===c.yp.ContextValue&&(e.id===o.Pv&&"date"===e.value.type&&(0,S.h)(e.value.value)?t=e.value.value:e.id===o.JL&&"text"===e.value.type&&(n=(0,m.QaF)(e.value.value)))})),!(t&&n))return;return{nextSprintDateRange:t,completeSprintActionType:n}}(e.values);let W,$;if(G)W=G.completeSprintActionType,$=G.nextSprintDateRange;else{const t=O.getTrigger().recurrence,n=(0,C.Su)(t);if(!n)return{error:new g.fH("misc",`Invalid recurrence for sprint recurrence automation: ${O.id}`)};$=(0,C.IX)({userTimeZone:e.userTimeZone,sprintSchedule:n}),W=v.complete_sprint_action}const Y={spaceId:T.space_id,automationContext:{action:t,context:e},sprintCollectionContext:{sprintCollectionPointer:v.sprint_collection,sprintCollectionSchema:M,nextSprintDateRange:$,sprintDatePropertyId:R,sprintStatusCurrentOptionName:Z,sprintStatusFutureOptionName:V,sprintStatusNextOptionName:U,sprintStatusPastOptionName:B,sprintStatusLastOptionName:E,sprintStatusPropertyId:P,sprintStatusPropertySchema:D,sprintUniqueIdPropertyId:A},taskCollectionContext:{taskCollectionPointer:v.task_collection,taskCollectionSchema:z,taskSprintRelationPropertyId:K,taskStatusCompleteGroupName:H,taskStatusPropertyId:j,taskStatusPropertySchema:q},recordMap:y},Q=await F({completeSprintAction:W,completeSprintExecutionContext:Y});return b.x.isFail(Q)?Q:{value:{values:[]}}}};var G=n(748777),W=n(446725),$=n(335102),Y=n(576218),Q=(n(667294),n(745238)),J=n(785893);const X=(0,Q.IU)("equalSquare",{viewBox:"0 0 18 18",svg:(0,J.jsxs)("g",{children:[(0,J.jsx)("path",{d:"M3.07 18H14.9c2.05 0 3.07-1.02 3.07-3.03V3.05c0-2.01-1.02-3.03-3.07-3.03H3.07C1.03.02 0 1.02 0 3.05v11.92C0 17 1.03 18 3.07 18Zm.02-1.57c-.98 0-1.52-.52-1.52-1.54V3.12c0-1.01.54-1.53 1.52-1.53h11.8c.97 0 1.52.52 1.52 1.53V14.9c0 1.02-.55 1.54-1.52 1.54Z"}),(0,J.jsx)("path",{d:"M5.31 11.55h7.36c.5 0 .84-.24.84-.73 0-.5-.33-.75-.84-.75H5.3c-.52 0-.85.25-.85.75 0 .49.35.73.85.73Zm0-3.6h7.36c.5 0 .84-.24.84-.74s-.33-.75-.84-.75H5.3c-.52 0-.85.25-.85.75s.35.74.85.74Z"})]})}),ee=(0,r.defineMessages)({defineVariablesName:{id:"automations.actions.defineVariablesName",defaultMessage:"Define custom variables"},defineVariablesDescription:{id:"automations.actions.defineVariablesDescription",defaultMessage:"Create and edit custom variables for your automation."}}),te={type:"define_variables",invertible:void 0,hasSideEffects:!1,display:{icon:X,name:ee.defineVariablesName,description:ee.defineVariablesDescription},isAvailableForContext:e=>e.checkExperimentGate("automation_formula_variables"),getExecutionDependencies:(e,t)=>[],typecheck:(e,t)=>{const n=[],o=t.getConfig(),{values:r,variableIds:i}=o??{};if((0,l.$K)(i)&&i.length>0&&(0,l.$K)(r))for(const a of i){const o=r[a];if((0,l.$K)(o)&&(0,l.$K)(o.value))if("simple"===o.value.type)n.push({id:(0,$.Kd)({source:"action",action_id:t.id,action_output_type:"variable",variable_id:a}),kind:c.yp.ContextValue,name:o.name,type:{type:"text"}});else{const r={handleDataRequest:(0,W.createFormulaDataRequestSyncHandler)(e.getRecordModel),valueTypes:e.valueTypes.slice(0)},i=(0,W.analyzeFormulaSync)(o.value.value??[[""]],r);if((0,l.$K)(i.parseErrors)&&i.parseErrors.length>0)continue;if((0,l.$K)(i.typeErrors)&&i.typeErrors.length>0)continue;if(!(0,l.$K)(i.type))continue;n.push({id:(0,$.Kd)({source:"action",action_id:t.id,action_output_type:"variable",variable_id:a}),kind:c.yp.ContextValue,name:o.name,type:i.type})}}return{value:{valueTypes:n}}},execute:async(e,t)=>{const n=[],o=t.getConfig(),{values:r,variableIds:i}=o??{};if((0,l.$K)(i)&&i.length>0&&(0,l.$K)(r))for(const a of i){const o=r[a];if((0,l.$K)(o)&&(0,l.$K)(o.value))if("simple"===o.value.type){const r=await(0,Y.OH)({value:o.value,context:{...e,returnType:{type:"text"}},executeFormula:e.executeContextualFormula});if(b.x.isFail(r))return{error:new g.x6({actionId:t.id,cause:r.error})};n.push({id:(0,$.Kd)({source:"action",action_id:t.id,action_output_type:"variable",variable_id:a}),kind:c.yp.ContextValue,value:r.value})}else{const r=await(0,W.executeFormulaAsync)(o.value.value??[[""]],e);if(b.x.isFail(r))return{error:new g.x6({actionId:t.id,cause:r.error})};n.push({id:(0,$.Kd)({source:"action",action_id:t.id,action_output_type:"variable",variable_id:a}),kind:c.yp.ContextValue,value:r.value})}}return{value:{values:n}}}};var ne=n(388437),oe=n(267130);const re=(0,r.defineMessages)({duplicateBlocks:{id:"automations.actions.duplicateBlocks",defaultMessage:"Insert blocks"},duplicateBlocksDescription:{id:"automations.actions.duplicateBlocksDescription",defaultMessage:"Insert text or blocks on this page."}}),ie={type:"duplicate_blocks",invertible:!0,hasSideEffects:!0,display:{icon:ne.a,name:re.duplicateBlocks,description:re.duplicateBlocksDescription},isAvailableForContext:e=>"button_block"===e.contextType,getExecutionDependencies:(e,t)=>[{type:"record_permission",pointer:e.automationModel.getParentPointer(),minimumRole:"content_only_editor"}],typecheck:()=>({value:{valueTypes:[]}}),execute:async(e,t)=>{const n=T.Ps(t.getBlocks()??[]),o=t.getInsertionPoint(),r={};if((0,l.$K)(n)){const t=await e.executeEffectMap.duplicateBlockChildren({blockPointer:{table:B.iU,id:n,spaceId:e.automationModel.getSpaceId()},insertionPoint:o});b.x.isSuccess(t)&&oe.Fv.aggregateActionStats(r,t.value.stats)}return{value:{stats:r,values:[]}}}};var ae=n(727714);const se=(0,r.defineMessages)({httpRequest:{id:"automations.actions.httpRequest",defaultMessage:"HTTP Request"},httpRequestDescription:{id:"automations.actions.httpRequestDescription",defaultMessage:"Calls a custom URL."}}),le={type:"http_request",invertible:!1,hasSideEffects:!1,display:{icon:ae.N,name:se.httpRequest,description:se.httpRequestDescription},isAvailableForContext:e=>{if(!e.checkExperimentGate("http_request_automation_action"))return!1;const t=e.automation.getTriggerType();return"button"===t||"event"===t},getExecutionDependencies:(e,t)=>[],typecheck:()=>({value:{valueTypes:[]}}),execute:()=>(console.log("Executed http_request action"),Promise.resolve({value:{values:[]}}))};var ce=n(584169);const de=(0,r.defineMessages)({modalConfirmation:{id:"automations.actions.modalConfirmation",defaultMessage:"Show confirmation"},modalConfirmationDescription:{id:"automations.actions.modalConfirmationDescription",defaultMessage:"Shows a confirmation window before proceeding."}}),ue={type:"modal_confirmation",invertible:void 0,hasSideEffects:!1,display:{icon:ce.m,name:de.modalConfirmation,description:de.modalConfirmationDescription},isAvailableForContext:e=>"button"===e.automation.getTriggerType(),getExecutionDependencies:(e,t)=>[],typecheck:()=>({value:{valueTypes:[]}}),execute:async(e,t)=>{var n,o,r;const i=t.getConfig();let a=[];if(null!=i&&i.text){const n=await(0,Y.OH)({value:i.text,context:{...e,returnType:{type:"text"}},executeFormula:e.executeContextualFormula});if(b.x.isFail(n))return{error:new g.x6({actionId:t.id,cause:n.error})};a=(0,$.j4)(n.value)}(0,m.VrM)(a)>x.tb&&(a=(0,m.Zdj)(a,x.tb),a.push((0,m.V3y)("…")));const s=await e.executeEffectMap.displayModal({format:{icon:null===(n=e.automationModel.getProperties())||void 0===n?void 0:n.icon,text:a,continueButtonText:(null==i||null===(o=i.continue_button)||void 0===o?void 0:o.text)??"",cancelButtonText:(null==i||null===(r=i.cancel_button)||void 0===r?void 0:r.text)??""}});return b.x.isFail(s)||b.x.isSuccess(s)&&"cancel"===s.value.result?{error:new g.nQ}:{value:{values:[]}}}};var pe=n(509999);const me=(0,r.defineMessages)({openPage:{id:"automations.actions.openPage",defaultMessage:"Open page"},openPageDescription:{id:"automations.actions.openPageDescription",defaultMessage:"Opens a specified page."}}),ge={type:"open_page",invertible:!1,hasSideEffects:!1,display:{icon:pe.J,name:me.openPage,description:me.openPageDescription},isAvailableForContext:e=>"button"===e.automation.getTriggerType(),getExecutionDependencies:(e,t)=>{var n,o;const r=t.getConfig();return"page"===(null==r||null===(n=r.target)||void 0===n?void 0:n.type)?[{type:"record_permission",pointer:null==r?void 0:r.target.page,minimumRole:"reader"}]:"variable"===(null==r||null===(o=r.target)||void 0===o?void 0:o.type)?[{id:r.target.id,minimumRole:"reader",type:"formula_value_permission"}]:[]},typecheck:(e,t)=>{const n=t.getConfig();if(null==n||!n.target)return{value:{validationFailures:[{type:"missing_required_config",actionType:"open_page",key:"target"}]}};if("page"===n.target.type){if(!e.getRecordModel(n.target.page))return{value:{validationFailures:[{type:"missing_required_config",actionType:"open_page",key:"target"}]}}}return{value:{valueTypes:[]}}},execute:(e,t)=>{const n=t.getConfig();if(null==n||!n.target)return Promise.resolve({error:new g.mK({pointer:null==n?void 0:n.target,actionId:t.id})});if("page"===n.target.type||"variable"===n.target.type){let o;if("page"===n.target.type)o=n.target.page;else if("variable"===n.target.type){const r=(0,$.dh)(e.values,n.target.id);if(!r)return Promise.resolve({error:new g.Hb({actionId:t.id,source:"action",variable:void 0})});if("block"===r.value.type)o=r.value.value;else{if("array"!==r.value.type)return Promise.resolve({error:new g.Hb({actionId:t.id,source:"action",variable:r.value})});{const e=r.value.values[0];if(!e||"block"!==e.type)return Promise.resolve({error:new g.Hb({actionId:t.id,source:"action",variable:r.value})});o=e.value}}}else(0,l.t1)(n.target);e.executeEffectMap.navigateToPage({actionId:t.id,page:o,openIn:t.getOpenPageIn()})}else"url"===n.target.type?e.executeEffectMap.openUrl({actionId:t.id,url:n.target.url}):(0,l.t1)(n.target);return Promise.resolve({value:{values:[]}})}};function fe(e){return{...e,isAvailableForContext:t=>!function(e){const{automationActions:t,checkType:n}=e;if("canAddAction"===n)return t.some((e=>e.isType("assistant_basic")));if("canSaveAction"===n)return t.length>1&&t.some((e=>e.isType("assistant_basic")));(0,l.t1)(n)}(t)&&e.isAvailableForContext(t),typecheck(t,n){const{runtimeStats:o}=t,r=o?oe.Fv.getOrCreateAction(o,n.pointer,n.type):void 0,i=performance.now(),a=e.typecheck(t,n),s=Math.trunc(performance.now()-i);return r&&(r.typecheckStartTime=i,r.typecheckDurationMs=s,b.x.isFail(a)?r.typecheckSuccess=!1:(oe.Fv.aggregateActionStats(r,a.value.stats),r.typecheckSuccess=!0)),a},async execute(t,n){const{runtimeStats:o}=t,r=o?oe.Fv.getOrCreateAction(o,n.pointer,n.type):void 0,i=performance.now(),a=await e.execute(t,n),s=Math.trunc(performance.now()-i);return r&&(r.executionStartTime=i,r.executionDurationMs=s,b.x.isFail(a)?r.executionSuccess=!1:(oe.Fv.aggregateActionStats(r,a.value.stats),r.executionSuccess=!0)),a}}}var he=n(849019);const ve=(0,r.defineMessages)({queryCollection:{id:"automations.actions.queryCollection",defaultMessage:"Get pages"},queryCollectionDescription:{id:"automations.actions.queryCollectionDescription",defaultMessage:"Get a list of pages from a database with optional filters and sorts, to be used in a subsequent automation step."},queryCollectionPages:{id:"automations.actions.queryCollectionPages",defaultMessage:"Pages from step {stepNumber}"}}),ye={type:"query_collection",invertible:void 0,hasSideEffects:!1,display:{icon:he.e,name:ve.queryCollection,description:ve.queryCollectionDescription},isAvailableForContext:()=>!1,getExecutionDependencies:(e,t)=>{const n=t.getConfig();return null!=n&&n.collection?[{type:"record_permission",pointer:null==n?void 0:n.collection,minimumRole:"reader"}]:[]},typecheck:(e,t)=>{const n=t.getConfig();if(null==n||!n.collection)return{value:{valueTypes:[]}};const o=(0,$.Kd)({source:"action",action_id:t.id,action_output_type:"pages"}),r=e.automationModel.getActionIds().indexOf(t.id)??-1;return{value:{valueTypes:[{kind:c.yp.ContextValue,id:o,name:e.intl.formatMessage(ve.queryCollectionPages,{stepNumber:r+1}),type:{type:"array",of:{type:"block",collection:n.collection}}}]}}},execute:async(e,t)=>{const n=t.getConfig();if(null==n||!n.collection)return{value:{values:[]}};if(null==n||!n.collection.spaceId)return{error:new g.mK({pointer:null==n?void 0:n.collection,actionId:t.id})};const o={table:E.vF,id:null==n?void 0:n.collection.id,spaceId:null==n?void 0:n.collection.spaceId},r=await e.executeEffectMap.queryCollection({actionId:t.id,collection:o,userTimeZone:e.userTimeZone,filter:null==n?void 0:n.filter,sort:null==n?void 0:n.sort,limit:null==n?void 0:n.limit});if(r.error)return r;const i=(0,$.Kd)({source:"action",action_id:t.id,action_output_type:"pages"}),a={kind:c.yp.ContextValue,id:i,value:{type:"array",values:r.value.blockIds.map((e=>({type:"block",value:{table:B.iU,id:e,spaceId:o.spaceId}})))}};return{value:{stats:r.value.stats,values:[a]}}}};var be=n(531701),_e=n(266897),Se=n(568626);const ke=(0,Q.IU)("gmailLogo",{viewBox:"52 42 88 66",svg:(0,J.jsxs)("g",{children:[(0,J.jsx)("path",{fill:"#4285f4",d:"M58 108h14V74L52 59v43c0 3.32 2.69 6 6 6"}),(0,J.jsx)("path",{fill:"#34a853",d:"M120 108h14c3.32 0 6-2.69 6-6V59l-20 15"}),(0,J.jsx)("path",{fill:"#fbbc04",d:"M120 48v26l20-15v-8c0-7.42-8.47-11.65-14.4-7.2"}),(0,J.jsx)("path",{fill:"#ea4335",d:"M72 74V48l24 18 24-18v26L96 92"}),(0,J.jsx)("path",{fill:"#c5221f",d:"M52 51v8l20 15V48l-5.6-4.2c-5.94-4.45-14.4-.22-14.4 7.2"})]})});var we=n(74446),xe=n(291627),Ie=n(882883),Ce=n(177420),Te=n(475246),Me=n(519889),Pe=n(744805);const Ae=(0,r.defineMessages)({sendGmailNotification:{id:"automations.actions.sendGmailNotification",defaultMessage:"Send mail to..."},sendGmailNotificationDescription:{id:"automations.actions.sendGmailNotificationDescription",defaultMessage:"Sends a notification to one or more people in Notion."}}),Re={type:"send_gmail_notification",invertible:void 0,hasSideEffects:!0,display:{icon:ke,name:Ae.sendGmailNotification,description:Ae.sendGmailNotificationDescription},isAvailableForContext:e=>{if(!e.checkExperimentGate("gmail_automation_action"))return!1;let t=e.automation.getTriggerType();"notification_event"===t&&(t="event");let n=!0;if("event"===t&&(n=e.isSubscribed),!n||"event"!==t)return!1;const o=e.automationActions.filter((e=>e.isType("send_gmail_notification")));return"canAddAction"===e.checkType?o.length<1:o.length<=1},getExecutionDependencies:(e,t)=>{var n;const o=[],r=t.getConfig(),i=null==r||null===(n=r.to)||void 0===n||null===(n=n.value)||void 0===n?void 0:n.value,a=null==r?void 0:r.external_bot_id;a&&o.push({type:"record_permission",pointer:{table:Ce.cZ,id:a},minimumRole:"editor"});return(0,m.lcG)(i).forEach((e=>o.push({type:"record_permission",pointer:{table:Me.KJ,id:e},minimumRole:"reader"}))),o},typecheck:(e,t)=>{var n,o,r,i;const a=t.getConfig(),s=null==a?void 0:a.to;if(!a||!s)return{value:{validationFailures:[{type:"missing_required_config",actionType:"send_gmail_notification",key:"to"}]}};const l=(0,m.lcG)(null===(n=s.value)||void 0===n?void 0:n.value).map((t=>(0,_e.Hl)({pointer:{table:Me.KJ,id:t},getRecordModel:e.getRecordModel})));if(!s.value||!s.value.value||0===(null===(o=s.value.value)||void 0===o?void 0:o.length))return{value:{validationFailures:[{type:"missing_required_config",actionType:"send_gmail_notification",key:"to"}]}};if(l.every((e=>{var t;return(null===(t=e.asActor)||void 0===t?void 0:t.table)===Me.KJ&&e.asActor.getIsDeleted()}))&&0===(0,m.oOk)(s.value.value).length)return{value:{validationFailures:[{type:"invalid_required_config",actionType:"send_gmail_notification",key:"to"}]}};if(!a.email_subject||null===(r=a.email_subject)||void 0===r||!r.value||(0,m.PgY)(a.email_subject.value))return{value:{validationFailures:[{type:"missing_required_config",actionType:"send_gmail_notification",key:"email_subject"}]}};if(!a.email_body||null===(i=a.email_body)||void 0===i||!i.value||(0,m.PgY)(a.email_body.value))return{value:{validationFailures:[{type:"missing_required_config",actionType:"send_gmail_notification",key:"email_body"}]}};if(!a.external_bot_id)return{value:{validationFailures:[{type:"missing_required_config",actionType:"send_gmail_notification",key:"external_bot_id"}]}};const c=e.getRecordModel({id:a.external_bot_id,table:Ce.cZ});return null!=c&&c.alive?{value:{valueTypes:[]}}:{value:{validationFailures:[{type:"missing_required_config",actionType:"send_gmail_notification",key:"external_bot_id"}]}}},execute:async(e,t)=>{var n,o,r,i,a,s,l,c;const d=null===(n=t.getConfig())||void 0===n?void 0:n.to,u=null===(o=t.getConfig())||void 0===o?void 0:o.cc,p=null===(r=t.getConfig())||void 0===r?void 0:r.bcc,m=null===(i=t.getConfig())||void 0===i?void 0:i.reply_to,f=null===(a=t.getConfig())||void 0===a?void 0:a.from_name,h=null===(s=t.getConfig())||void 0===s?void 0:s.email_subject,v=null===(l=t.getConfig())||void 0===l?void 0:l.email_body,y=null===(c=t.getConfig())||void 0===c?void 0:c.external_bot_id;if(!d||!d.value)return{error:new g.Qq({actionId:t.id,missingConfigKey:"to"})};if(!h)return{error:new g.Qq({actionId:t.id,missingConfigKey:"email_subject"})};if(!v)return{error:new g.Qq({actionId:t.id,missingConfigKey:"email_body"})};if(!y)return{error:new g.Qq({actionId:t.id,missingConfigKey:"external_bot_id"})};let b,_,S,k;try{b=await De(t,e,d),_=await De(t,e,u),S=await De(t,e,p),k=await De(t,e,m)}catch(C){if(C instanceof g.x6)return{error:C};throw C}const w=await Be(e,h),x=await Be(e,v),I=f?await Be(e,f):[[""]];if(0!==b.size()){const n=await e.executeEffectMap.sendGmailNotification({to:b,cc:_,bcc:S,externalBot:{table:Ce.cZ,id:y},replyTo:k.size()>0?Array.from(k)[0]:void 0,fromName:Ee(e,I),subject:Ee(e,w),body:Ee(e,x),htmlBody:Fe(e,t.pointer.spaceId,x),actionId:t.id,space:{table:Te.bx,id:t.pointer.spaceId}});if(null!=n&&n.error)return n}else Se.log({data:{miscDataToConvertToString:{unresolvedOrEmptyTarget:d,actionId:t.id,spaceId:t.pointer.spaceId,automationId:e.automationModel.id}},from:"sendGmailNotification",level:"info",type:"sendGmailNotificationEmptyResolvedTargets"});return{value:{stats:{usersMentioned:b.size()+_.size()+S.size()},values:[]}}}};async function De(e,t,n){const o=new xe.X;if(null==n||!n.value)return o;const r=await(0,Y.OH)({value:n.value,context:{...t,returnType:{type:"person"}},executeFormula:t.executeContextualFormula});if(b.x.isFail(r))throw new g.x6({actionId:e.id,cause:r.error});const i=(0,$.j4)(r.value);return(0,m.lcG)(i).forEach((e=>o.add({table:Me.KJ,id:e}))),o}async function Be(e,t){const n=await(0,Y.OH)({value:t,context:{...e,returnType:{type:"text"}},executeFormula:e.executeContextualFormula});return b.x.isSuccess(n)?(0,$.j4)(n.value):[[""]]}function Ee(e,t){const n=R.omK.constant(void 0);return(0,Ie.Xh)({textValue:t,getRecordModel:n,userTimeZone:e.userTimeZone,deterministic:!0,disableAnnotationPrefix:!0,intl:e.intl}).trim()}function Fe(e,t,n){var o;const r=R.omK.constant(void 0);return(0,Pe.hW)({textValue:{value:n,spaceId:t},getRecordModel:r,userTimeZone:e.userTimeZone,intl:e.intl,getRecordRole:we.DH.empty(),disableStyleAnnotations:!1,disableInsertedDeletedAnnotations:!1,disableDateStyleAnnotations:!1,disableSuggestionAnnotations:!1,disableHover:!0,disableLinks:!1,disabled:!1,isClient:!1,isAndroid:!1,isSafariOrIOS:!1,isWindows:!1,showEmojiInline:!1,emojiType:"raw",theme:(0,be.gh)({theme:"light"}),baseUrl:"",publicDomainName:"",currentUserId:null===(o=e.author)||void 0===o?void 0:o.id,katex:void 0,getPublicBaseUrlForPage:void 0,externalIntegrations:[],formulaValueTypes:[],emojiData:{positionalEmojiData:{},emojiByCategory:{},emojiByColorRaw:{},emojiByName:{}},isMobileNative:!1})}var Ze=n(399036),Ue=n(590792);const Ve=(0,r.defineMessages)({sendInAppNotification:{id:"automations.actions.sendInAppNotification",defaultMessage:"Send notification to..."},createPageDefaultVariableName:{id:"automations.actions.createPageDefaultVariableName",defaultMessage:"New page added"},createPageVariableNameWithDatabase:{id:"automations.actions.createPageVariableNameWithDatabase",defaultMessage:"New page added in {databaseName}"},createPageVariableNameWithDatabaseAndStepNumber:{id:"automations.actions.createPageVariableNameWithDatabaseAndStepNumber",defaultMessage:"New page added in {databaseName} from step {stepNumber}"},sendInAppNotificationDescription:{id:"automations.actions.sendInAppNotificationDescription",defaultMessage:"Sends a notification to one or more people in Notion."}}),Ne={type:"send_in_app_notification",invertible:void 0,hasSideEffects:!0,display:{icon:Ue.t,name:Ve.sendInAppNotification,description:Ve.sendInAppNotificationDescription},isAvailableForContext:e=>{let t=e.automation.getTriggerType();"notification_event"===t&&(t="event");let n=!0;if("event"===t&&(n=e.isSubscribed),!n||"event"!==t)return!1;const o=e.automationActions.filter((e=>e.isType("send_in_app_notification")));return"canAddAction"===e.checkType?o.length<1:o.length<=1},getExecutionDependencies:(e,t)=>{var n;const o=[],r=t.getConfig(),i=null==r||null===(n=r.target)||void 0===n?void 0:n.type;if(!i)return[];if("property"===i){var a;const e=null==r||null===(a=r.target)||void 0===a?void 0:a.collectionPointer;e&&o.push({type:"record_permission",pointer:e,minimumRole:"reader"})}else if("formula"===i){var s;const e=null==r||null===(s=r.target)||void 0===s||null===(s=s.value)||void 0===s?void 0:s.value;(0,m.lcG)(e).forEach((e=>o.push({type:"record_permission",pointer:{table:Me.KJ,id:e},minimumRole:"reader"})))}else(0,l.t1)(i);return o},typecheck:(e,t)=>{var n;const o=t.getConfig(),r=null==o?void 0:o.target;if(!o||!r)return{value:{validationFailures:[{type:"missing_required_config",actionType:"send_in_app_notification",key:"target"}]}};if("property"===r.type){if(!r.propertyId)return{value:{validationFailures:[{type:"missing_required_config",actionType:"send_in_app_notification",key:"propertyId"}]}};if(!r.collectionPointer)return{value:{validationFailures:[{type:"missing_required_config",actionType:"send_in_app_notification",key:"collectionPointer"}]}};const t=e.getRecordModel({id:r.collectionPointer.id,table:E.vF}),n=null==t?void 0:t.getSchema()[r.propertyId];if(!n)return{value:{validationFailures:[{type:"deleted_required_config",actionType:"send_in_app_notification",key:"propertyId"}]}};if(!(0,Ze.U8)(n))return{value:{validationFailures:[{type:"invalid_required_config",actionType:"send_in_app_notification",key:"propertyId"}]}}}else if("formula"===r.type){var i,a;const t=(0,m.lcG)(null===(i=r.value)||void 0===i?void 0:i.value).map((t=>(0,_e.Hl)({pointer:{table:Me.KJ,id:t},getRecordModel:e.getRecordModel})));if(!r.value||!r.value.value||0===(null===(a=r.value.value)||void 0===a?void 0:a.length))return{value:{validationFailures:[{type:"missing_required_config",actionType:"send_in_app_notification",key:"formulaValue"}]}};if(t.every((e=>{var t;return(null===(t=e.asActor)||void 0===t?void 0:t.table)===Me.KJ&&e.asActor.getIsDeleted()}))&&0===(0,m.oOk)(r.value.value).length)return{value:{validationFailures:[{type:"invalid_required_config",actionType:"send_in_app_notification",key:"formulaValue"}]}}}return o.notification_message&&null!==(n=o.notification_message)&&void 0!==n&&n.value&&!(0,m.PgY)(o.notification_message.value)?{value:{valueTypes:[]}}:{value:{validationFailures:[{type:"missing_required_config",actionType:"send_in_app_notification",key:"notification_message"}]}}},execute:async(e,t)=>{var n,o,r;const i=null===(n=t.getConfig())||void 0===n?void 0:n.target,a=null===(o=t.getConfig())||void 0===o?void 0:o.notification_message;if(!i||!a)return{error:new g.Qq({actionId:t.id,missingConfigKey:t.getConfig()?i?"notification_message":"target":"config"})};const s=new Set,c=null===(r=e.formulaVariableResolution)||void 0===r||null===(r=r.thisPageBlockModel)||void 0===r?void 0:r.pointer;if(!c)return{error:new g.L({actionId:t.id,contextValueId:"blockPointer"})};const d=c.id,u=i.type;switch(u){case"formula":if(!i.value)return{error:new g.Qq({actionId:t.id,missingConfigKey:"target"})};const n=await(0,Y.OH)({value:i.value,context:{...e,returnType:{type:"person"}},executeFormula:e.executeContextualFormula});if(b.x.isFail(n))return{error:new g.x6({actionId:t.id,cause:n.error})};const o=(0,$.j4)(n.value);(0,m.lcG)(o).forEach((e=>s.add(e)));break;case"property":const r=i.propertyId,a=i.collectionPointer;if(!r||!a)return{error:new g.Qq({actionId:t.id,missingConfigKey:r?"collectionPointer":"propertyId"})};const c=await e.loadRecordModel(a),p=await e.loadRecordModel({table:B.iU,id:d,spaceId:t.pointer.spaceId});if(!p)return{error:new g.mz({actionId:t.id,propertyId:r,failedToResolve:{blockId:d}})};if(!c)return{error:new g.mz({actionId:t.id,propertyId:r,failedToResolve:{collectionId:a.id}})};{const e=c.getNormalizedSchema()[r];if(!e||!(0,Ze.U8)(e))return{error:new g.mz({actionId:t.id,propertyId:r,failedToResolve:{collectionId:a.id}})};const n="created_by"===e.type,o="last_edited_by"===e.type;if(n){const e=p.getCreatedByPointer();e&&e.table===Me.KJ&&s.add(e.id)}else if(o){const e=p.getLastEditedByPointer();e&&e.table===Me.KJ&&s.add(e.id)}else{const e=null==p?void 0:p.getProperties();if(!e)return{error:new g.mz({actionId:t.id,propertyId:r,failedToResolve:{blockId:p.id}})};{const t=e[r],n=(0,m.lcG)(t);n.length>0&&n.map((e=>{s.add(e)}))}}}break;default:(0,l.t1)(u)}const p=await(0,Y.OH)({context:{...e,returnType:{type:"text"}},executeFormula:e.executeContextualFormula,value:a}),f=b.x.isSuccess(p)?(0,$.j4)(p.value):[[""]];if(0!==s.size){const n=await e.executeEffectMap.sendInAppNotification({targets:s,message:f,actionId:t.id,spaceId:t.pointer.spaceId});if(null!=n&&n.error)return n}else Se.log({data:{miscDataToConvertToString:{unresolvedOrEmptyTarget:i,actionId:t.id,spaceId:t.pointer.spaceId,automationId:e.automationModel.id}},from:"sendInAppNotification",level:"info",type:"sendInAppNotificationEmptyResolvedTargets"});return{value:{stats:{usersMentioned:s.size},values:[]}}}};var Oe=n(324600);const Le=(0,r.defineMessages)({slackNotification:{defaultMessage:"Send Slack notification to…",id:"automations.actions.slackNotification"},slackNotificationDescription:{defaultMessage:"Sends a Slack notification to a user or channel.",id:"automations.actions.slackNotificationDescription"}}),je={type:"slack_notification",invertible:void 0,hasSideEffects:!1,display:{icon:Oe.P,name:Le.slackNotification,description:Le.slackNotificationDescription},isAvailableForContext:e=>{if("event"===e.contextType){const t=e.automationActions.filter((e=>e.isType("slack_notification")));return"canAddAction"===e.checkType?t.length<1:t.length<=1}return!("button"!==e.automation.getTriggerType()||!e.checkExperimentGate("slack_action_enabled_on_button_automation"))},getExecutionDependencies:(e,t)=>{const n=t.getConfig();return null!=n&&n.external_bot_id?[{minimumRole:"reader",pointer:{id:n.external_bot_id,table:Ce.cZ},type:"record_permission"}]:[]},typecheck:(e,t)=>{const n=t.getConfig();if(null==n||!n.external_bot_id)return{value:{validationFailures:[{type:"missing_required_config",actionType:"slack_notification",key:"external_bot_id"}]}};return e.getRecordModel({id:n.external_bot_id,table:Ce.cZ})?n.target?{value:{valueTypes:[]}}:{value:{validationFailures:[{type:"missing_required_config",actionType:"slack_notification",key:"target"}]}}:{value:{validationFailures:[{type:"missing_required_value",actionType:"slack_notification",key:"external_bot_id"}]}}},execute:async(e,t)=>{const n=t.getConfig(),o=null==n?void 0:n.target;if(!n||!n.external_bot_id||!n.target)return{error:new g.Qq({actionId:t.id,missingConfigKey:t.getConfig()?o?"external_bot_id":"target":"config"})};const r=e.author,i={target:n.target,external_bot_id:n.external_bot_id},a=await e.executeEffectMap.sendSlackNotification({config:i,author:r,actionPointer:t.pointer});return b.x.isFail(a)?a:{value:{values:[]}}}};var Ke=n(744057);const ze={query_collection:fe(ye),create_page:fe(G.L),update_pages:fe(Ke.UZ),open_page:fe(ge),slack_notification:fe(je),duplicate_blocks:fe(ie),modal_confirmation:fe(ue),complete_sprint:fe(H),assistant:fe(s),send_in_app_notification:fe(Ne),send_gmail_notification:fe(Re),assistant_basic:fe(v),define_variables:fe(te),http_request:fe(le)};function qe(e){return ze[e]}function He(e){return(0,o.FP)(e).map((e=>qe(e)))}},744057:(e,t,n)=>{n.d(t,{UZ:()=>w,ww:()=>k});n(757658);var o=n(709291),r=n(653965),i=n(940470),a=n(401898),s=n(603865),l=n(173110),c=n(335102),d=n(238297),u=n(725651),p=n(959753),m=n(300482),g=n(463306),f=n(421202),h=n(519889),v=n(881730),y=n(267130);const b=(0,o.defineMessages)({updatePages:{id:"automations.actions.updatePages",defaultMessage:"Edit pages in…"},updatePagesDescription:{id:"automations.actions.updatePagesDescription",defaultMessage:"Edits the properties of specified pages in a database."}}),_=new Set(["button","event"]);async function S(e){const{pointer:t,context:n,actionId:o}=e,r=await n.loadRecordModel(t);if(!r)return{error:new v.Do({pointer:t,actionId:o})};const i=await(0,d.Rd)({block:r,loadRecordModel:n.loadRecordModel});return i?{value:i.getSpaceShardedPointer()}:{error:new v.Do({pointer:t,actionId:o})}}function k(e){var t;const{actionModels:n,id:o}=e,r=(0,c.MY)(o),i="action"===r.source?n.find((e=>e.id===r.action_id)):void 0,s=(0,a.$K)(i)?null===(t=i.getConfig())||void 0===t?void 0:t.collection:void 0;return{automationValueInfo:r,collectionPointer:s,actionModel:i}}const w={type:"update_pages",invertible:!0,hasSideEffects:!0,display:{icon:u.R,name:b.updatePages,description:b.updatePagesDescription},isAvailableForContext:e=>{let t=e.automation.getTriggerType();if("notification_event"===t&&(t="event"),"event"===t){if(!e.isSubscribed)return!1;const t=e.automationActions.filter((e=>{var t;return e.isType("update_pages")&&"collection"===(null===(t=e.getConfig())||void 0===t||null===(t=t.target)||void 0===t?void 0:t.type)}));return"canAddAction"===e.checkType?t.length<5:t.length<=5}return _.has(t)},getExecutionDependencies:(e,t)=>{var n,o;const r=t.getConfig();return"collection"===(null==r||null===(n=r.target)||void 0===n?void 0:n.type)?[{type:"record_permission",pointer:null==r?void 0:r.target.collection,minimumRole:"content_only_editor"}]:"variable"===(null==r||null===(o=r.target)||void 0===o?void 0:o.type)?[{id:r.target.id,minimumRole:"read_and_write",type:"formula_value_permission"}]:[]},typecheck:(e,t)=>{const n=t.getConfig();if(null==n||!n.target)return{value:{validationFailures:[{type:"missing_required_config",actionType:"update_pages",key:"target"}]}};if("collection"===n.target.type){if((0,g.Pz)(n.target.collection,e.getRecordModel))return{value:{validationFailures:[{type:"collection_in_trash",actionType:"update_pages",key:"collection"}]}}}else if("page"===n.target.type){if((0,g.Pz)(n.target.page,e.getRecordModel))return{value:{validationFailures:[{type:"block_in_trash",actionType:"update_pages",key:"block"}]}}}return{value:{valueTypes:[]}}},execute:async(e,t)=>{const n=t.getConfig();if(null==n||!n.target)return{error:new v.mK({pointer:null==n?void 0:n.target,actionId:t.id})};let o,u,b,_=e.loadRecordModel;if("collection"===(null==n?void 0:n.target.type)){const r=await _(n.target.collection);if(!r)return{error:new v.Do({pointer:n.target.collection,actionId:t.id})};let a;for(const t of e.values){if(t.kind!==l.yp.ContextValue)continue;const e=(0,c.MY)(t.id);if("global"!==e.source)continue;if("current_user"!==e.global)continue;const n=t.value;"person"===n.type&&(n.value.table===h.KJ&&(a=n.value))}const s=await e.executeEffectMap.queryCollection({actionId:t.id,collection:n.target.collection,userTimeZone:e.userTimeZone,currentUserPointer:a,filter:n.target.filter,limit:n.target.limit,sort:n.target.sort});if(i.x.isFail(s))return s;b=s.value.blockIds,o=r.getNormalizedSchema(),u=n.target.collection,s.value.recordMap&&(_=p.s85.tryUntilFound(_,p.s85.fromRecordMapWithRole(s.value.recordMap)))}else if("variable"===n.target.type){const a=(0,c.dh)(e.values,n.target.id);if(!a)return{error:new v.L({actionId:t.id,contextValueId:n.target.id})};if("block"===a.value.type){let n=await S({pointer:a.value.value,context:e,actionId:t.id});if(i.x.isFail(n)){const t=function(e){const{actionModels:t,contextValue:n}=e,{automationValueInfo:o,collectionPointer:r,actionModel:i}=k({actionModels:t,id:n.id});return"action"!==o.source?{error:new v.Hb({source:"global",variable:n.value})}:i&&"create_page"===i.getType()&&r?{value:r}:{error:new v.Hb({actionId:o.action_id,source:"action",variable:n.value})}}({actionModels:e.actionModels,contextValue:a});if(i.x.isFail(t))return n;n=t}b=[a.value.value.id],u=n.value;const r=await e.executeEffectMap.getCollectionSchema({actionId:t.id,pointer:u});if(i.x.isFail(r))return r;o=r.value.collectionSchema}else{if("array"!==a.value.type)return{error:new v.Hb({actionId:t.id,source:"action",variable:a.value})};{const n=a.value.values[0];if(!n||"block"!==n.type)return{error:new v.Hb({actionId:t.id,source:"action",variable:n})};const s=await _(n.value),l=s?await(0,d.Rd)({block:s,loadRecordModel:_}):void 0;if(!l)return{error:new v.Do({pointer:n.value,actionId:t.id})};const c=l.getSpaceShardedPointer();b=r.oA(a.value.values.map((e=>"block"===e.type?e.value.id:void 0)));const p=await e.executeEffectMap.getCollectionSchema({actionId:t.id,pointer:c});if(i.x.isFail(p))return p;o=p.value.collectionSchema,u=c}}}else if("page"===n.target.type){const r=n.target.page,a=await S({pointer:r,context:e,actionId:t.id});if(i.x.isFail(a))return a;b=[r.id],u=a.value;const s=await e.executeEffectMap.getCollectionSchema({actionId:t.id,pointer:u});if(i.x.isFail(s))return s;o=s.value.collectionSchema}else(0,a.t1)(n.target);const w={};y.Fv.aggregateActionStats(w,{pagesUpdated:b.length});const x=[];for(const r of b){const l={table:f.iU,id:r,spaceId:u.spaceId},c=await _(l);if(!c)return{error:new v.Do({pointer:l,actionId:t.id})};const d=await(0,g.ne)(c.pointer,e.loadRecordModel),p=(0,g.OJ)(d);if((0,a.$K)(p))return{error:new v.O3({pointer:c.pointer,actionId:t.id})};if(o){const r=c.getProperties(),a=await(0,s.g9)({config:n,page:c,collectionPointer:u,collectionSchema:o,actionId:t.id,context:e,getCurrentPropertyValue:e=>null==r?void 0:r[e]});if(i.x.isFail(a))return a;x.push(...a.value)}e.author&&x.push(m.op.update({pointer:{table:f.iU,id:r,spaceId:u.spaceId},path:[],args:{last_edited_time:Date.now(),last_edited_by_table:e.author.table,last_edited_by_id:e.author.id}}))}if(x.length>0){const r=(n.properties??[]).map((e=>{var t;const n=null===(t=o)||void 0===t?void 0:t[e];if(n)return{id:e,type:n.type}})).filter(a.$K),s=await e.executeEffectMap.saveTransaction({actionId:t.id,info:{type:"update_pages",pageIds:b,collection:u,editedProperties:r},operations:x});if(i.x.isFail(s))return s;y.Fv.aggregateActionStats(w,{totalOperations:x.length})}return{value:{stats:w,values:[]}}}}},102647:(e,t,n)=>{n.d(t,{A2:()=>w,Bj:()=>R,By:()=>f,Cz:()=>g,Ey:()=>k,OK:()=>x,Rt:()=>b,T0:()=>h,TY:()=>D,W5:()=>m,ai:()=>_,co:()=>d,d:()=>C,dw:()=>P,eI:()=>c,gK:()=>A,lN:()=>p,mC:()=>M,nC:()=>I,nK:()=>S,qu:()=>T,r4:()=>v,rg:()=>l,uO:()=>y,yK:()=>u});n(21703),n(757658);var o=n(401898),r=n(335102),i=n(576218),a=n(421838),s=n(744057);function l(e,t){e.trackEvent({eventName:"automation_triggered",properties:t})}function c(e,t){e.trackEvent({eventName:"add_automation_step",properties:t})}function d(e,t){e.trackEvent({eventName:"delete_automation_step",properties:t})}function u(e,t){e.trackEvent({eventName:"click_configure_button",properties:t})}function p(e,t){e.trackEvent({eventName:"click_configure_button_done",properties:t})}function m(e,t){e.trackEvent({eventName:"click_automation_modal_option",properties:t})}function g(e,t){e.trackEvent({eventName:"automation_execution_success",properties:t})}function f(e,t){e.trackEvent({eventName:"automation_execution_fail",properties:t})}function h(e,t){e.trackEvent({eventName:"automation_create",properties:t})}function v(e,t){e.trackEvent({eventName:"automation_update",properties:t})}function y(e,t){e.trackEvent({eventName:"automation_delete",properties:t})}function b(e,t){e.trackEvent({eventName:"automation_enable",properties:t})}function _(e,t){e.trackEvent({eventName:"automation_disable",properties:t})}function S(e,t){e.trackEvent({eventName:"automation_trigger_create",properties:t})}function k(e,t){e.trackEvent({eventName:"automation_trigger_delete",properties:t})}function w(e,t){e.trackEvent({eventName:"automation_action_create",properties:t})}function x(e,t){e.trackEvent({eventName:"automation_action_delete",properties:t})}function I(e,t){e.trackEvent({eventName:"automation_configure_view",properties:t})}function C(e,t){e.trackEvent({eventName:"automation_configure_view",properties:t})}function T(e,t){e.trackEvent({eventName:"automation_learn_click",properties:t})}function M(e,t){e.trackEvent({eventName:"automation_close_learn_prompt",properties:t})}function P(e,t){e.trackEvent({eventName:"button_automation_slack_action",properties:t})}function A(e,t){e.trackEvent({eventName:"automation_target_pick",properties:t})}function R(e){const{automationActionModel:t,automationActionModels:n,getRecordModel:l,formulaTypecheckContextValues:c}=e;if(t.isType("assistant"))return{type:"assistant"};if(t.isType("assistant_basic"))return{type:"assistant_basic"};if(t.isType("complete_sprint"))return{type:"complete_sprint"};if(t.isType("create_page")){const e=t.getConfig();let n=[];const r=null==e?void 0:e.collection,i=null==e?void 0:e.properties;if((0,o.$K)(r)&&(0,o.$K)(i)&&i.length>0){const e=l(r),t=null==e?void 0:e.getNormalizedSchema();(0,o.$K)(t)&&(n=i.map((e=>{var n;return null===(n=t[e])||void 0===n?void 0:n.type})).filter(o.$K))}return{property_types:n,type:"create_page"}}if(t.isType("duplicate_blocks"))return{type:"duplicate_blocks"};if(t.isType("modal_confirmation"))return{type:"modal_confirmation"};if(t.isType("open_page"))return{type:"open_page"};if(t.isType("query_collection"))return{type:"query_collection"};if(t.isType("send_in_app_notification")){const e={type:"send_in_app_notification",messageCharacterCount:0},n=t.getConfig();if((0,o.$K)(n)&&(0,o.$K)(n.target)){switch(n.target.type){case"formula":if((0,o.$K)(n.target.value)){const t=(0,a.lcG)(n.target.value.value).length,o=(0,i.UB)(n.target.value).length;e.targetData={type:"formula",numUserFormulaTargets:t,numFormulaContextTargets:o}}break;case"property":if((0,o.$K)(n.target.propertyId)&&(0,o.$K)(n.target.collectionPointer)){const t=l(n.target.collectionPointer),r=null==t?void 0:t.getSchema();if((0,o.$K)(r)){var d;const t=null===(d=r[n.target.propertyId])||void 0===d?void 0:d.type;e.targetData={type:"property",propertyType:t}}}}if((0,o.$K)(n.notification_message)&&(0,o.$K)(n.notification_message.value)){var u;const t=(0,a.Vkf)(null==n||null===(u=n.notification_message)||void 0===u?void 0:u.value);e.messageCharacterCount=t}}return e}if(t.isType("send_gmail_notification"))return{type:"send_gmail_notification"};if(t.isType("slack_notification"))return{type:"slack_notification"};if(t.isType("update_pages")){const e=t.getConfig(),i=[],a=[];if((0,o.$K)(e)&&(0,o.$K)(e.target)&&(0,o.$K)(e.properties)&&e.properties.length>0){let t;if("variable"===e.target.type){const i=(0,r.MY)(e.target.id);if("action"===i.source){const r=(0,s.ww)({actionModels:n,id:e.target.id}).collectionPointer;if((0,o.$K)(r)){const e=l(r);t=null==e?void 0:e.getNormalizedSchema()}}else{if("global"!==i.source||"button_page"!==i.global)throw new Error("Failed loading property schema");{const n=(0,r.vx)(c,e.target.id);if("block"===(null==n?void 0:n.type.type)&&(0,o.$K)(n.type.collection)){const e=l(n.type.collection);t=null==e?void 0:e.getNormalizedSchema()}}}}else if("collection"===e.target.type){const n=l(e.target.collection);t=null==n?void 0:n.getNormalizedSchema()}(0,o.$K)(t)&&e.properties.forEach((n=>{var r;const s=null===(r=t[n])||void 0===r?void 0:r.type;if((0,o.$K)(s)&&(i.push(s),(0,o.$K)(e.values))){const t=e.values[n];(0,o.$K)(t)&&a.push({type:s,operator:t.action})}}))}return{property_types:i,property_configs:a,type:"update_pages"}}return t.isType("define_variables")?{type:"define_variables"}:t.isType("http_request")?{type:"http_request"}:void(0,o.t1)(t)}function D(e){const{automationModel:t,getRecordModel:n,formulaTypecheckContextValues:r}=e,i=[],a=t.getActionPointers().map((e=>n(e))).filter(o.$K);for(const p of t.getActionPointers()){const e=n(p);(0,o.$K)(e)&&i.push(R({automationActionModel:e,automationActionModels:a,getRecordModel:n,formulaTypecheckContextValues:r}))}const s=[];let l,c,d;if(t.isEventType()||t.isNotificationType()){var u;const e=t.getEventConfiguration(),r=n(t.getParentPointer());l=t.getParentId();const i=t.getEventConfiguration();if("collection_view"===(null===(u=i.source)||void 0===u?void 0:u.type)){const e=n(i.source.pointer);d=null==e?void 0:e.parent_id,c=null==i?void 0:i.source.pointer.id}const a=null==r?void 0:r.getNormalizedSchema();if((0,o.$K)(a)){const{pagesAdded:t,pagePropertiesEdited:n}=e;if(t&&s.push({type:"page"}),"any"===n.type)s.push({condition:"any",type:"property"});else if("none"===n.type)s.push({condition:"none",type:"property"});else{let e=[];"some"===n.type?e=n.some??[]:"all"===n.type&&(e=n.all??[]);const t=[],r=[];e.forEach((e=>{var n;const i=null===(n=a[e.property])||void 0===n?void 0:n.type;(0,o.$K)(i)&&(t.push({type:i,operator:e.filter.operator}),r.push(i))})),s.push({condition:n.type,property_configs:t,property_types:r,type:"property"})}}}return{automation_actions:i,automation_id:t.id,automation_triggers:s,collection_id:l,collection_view_id:c,collection_view_block_id:d}}},881730:(e,t,n)=>{n.d(t,{Do:()=>c,EP:()=>b,Fd:()=>a,H2:()=>w,Hb:()=>d,L:()=>f,MO:()=>r,O3:()=>l,Ox:()=>p,Pn:()=>u,Qq:()=>v,XJ:()=>_,_w:()=>k,_z:()=>S,fH:()=>i,iR:()=>m,mK:()=>s,mz:()=>y,nQ:()=>h,x6:()=>g});n(21703);var o=n(940470);class r extends Error{}class i extends Error{constructor(e,t){super(t),this.automationId=void 0,this.type=e}}function a(e,t){return async n=>{const r=await e(n);return o.x.isFail(r)&&(r.error.automationId=t(n)),r}}class s extends i{constructor(e){super("invalid_record_pointer","Invalid record pointer"),this.data=e}}class l extends i{constructor(e){super("record_pointer_in_trash","Record pointer is in trash"),this.data=e}}class c extends i{constructor(e){super("invalid_record","Invalid record"),this.data=e}}class d extends i{constructor(e){super("invalid_variable_type","Invalid variable type"),this.data=e}}class u extends i{constructor(e){super(e.type,e.message),this.data=e}}class p extends i{constructor(e){super("invalid_property_schema","Invalid property schema"),this.data=e}}class m extends i{constructor(e){super("unsupported_context","Unsupported context"),this.data=e}}class g extends i{constructor(e){super("formula_execution_failed","Formula execution failed"),this.data=e}}class f extends i{constructor(e){super("missing_context_value","Missing context value"),this.data=e}}class h extends i{constructor(){super("user_cancelled","User cancelled")}}class v extends i{constructor(e){super("missing_action_config","Missing automation action config"),this.data=e}}class y extends i{constructor(e){super("notification_unresolvable_target_error","One or more of the send-in-app-notification targets could not be resolved to a user ID."),this.data=e}}class b extends i{constructor(e){super("misc",e.message),this.data=e}}class _ extends i{constructor(e){super("slack_action_execution_error",e.message),this.data=e}}class S extends i{constructor(e){super("mismatch_trigger_context",e.message),this.data=e}}Error;class k extends i{constructor(e){super("missing_current_sprint","No current sprint, unable to execute automation"),this.data=e}}class w extends i{constructor(e){super("unsupported_sprint_schema","Unsupported sprint schema, the collection may be using sprints V1"),this.data=e}}},53196:(e,t,n)=>{n.d(t,{XO:()=>i,gq:()=>r,pQ:()=>o,sB:()=>a});const o=(0,n(709291).defineMessages)({slackAutomationDefaultName:{id:"automationStore.slackAutomation.defaultName",defaultMessage:"{hasCreatorName, select, true {{creatorName}'s notifications} other {Notifications}}"},automationDefaultName:{id:"automatonStore.automation.defaultName",defaultMessage:"{hasCreatorName, select, true {{creatorName}'s automation} other {Automation}}"},automationPrivateName:{id:"automatonStore.automation.privateName",defaultMessage:"An automation"},automationDeletedName:{defaultMessage:"A deleted automation",id:"automationStore.automation.deletedName"},automationPossessiveContextValueProperty:{defaultMessage:"{contextValueName}’s {propertyName}",id:"automations.possessiveContextValueProperty.title"}});function r(e,t){return e.formatMessage(o.slackAutomationDefaultName,{hasCreatorName:Boolean(t),creatorName:t})}function i(e,t){return e.formatMessage(o.automationDefaultName,{hasCreatorName:Boolean(t),creatorName:t})}function a(e,t,n){return e.formatMessage(o.automationPossessiveContextValueProperty,{contextValueName:t,propertyName:n})}},761202:(e,t,n)=>{n.d(t,{Ps:()=>s,TD:()=>l});n(757658);var o=n(653965),r=n(401898),i=n(603865),a=n(77492);function*s(e){const{permissions:t,typecheckContextValues:n}=e,s=[];for(const l of t)if("record_permission"===l.type)s.push((0,o.Xh)(l));else if("collection_default_template_record_permission"===l.type){const e=yield*a.R.fetchRecord(l.pointer),t=null==e?void 0:e.getDefaultTemplatePagePointer();(0,r.$K)(t)&&s.push({minimumRole:l.minimumRole,pointer:t,type:"record_permission"})}else if("formula_value_permission"===l.type){const e=(0,i.rX)({formulaValueTypes:n,minimumRole:l.minimumRole,targetId:l.id});e.length>0&&s.push(...e)}else(0,r.t1)(l);return s}const{sync:l,async:c}=a.R.makeRunners(s)},786433:(e,t,n)=>{n.d(t,{E_:()=>m,ND:()=>h,eb:()=>y,ld:()=>f,pM:()=>v});n(757658);var o=n(653965),r=n(940470),i=n(401898),a=n(77492),s=n(335102),l=n(925785),c=n(881730),d=n(761202),u=n(267130),p=n(899207);const{sync:m,async:g}=a.R.makeRunners((function*(e){const{actionModels:t,automationModel:n,contextType:m,runtimeStats:g}=e,f={valueTypes:e.valueTypes,actionInputValueTypes:{},actionValidationFailures:{}},h=performance.now();let v,y,b;if("button_block"===m||"button_property"===m){if(!n.isButtonType())return{error:new c.MO(`Automation trigger (${n.getTriggerType()}) does not match context type (${m}).`)};const t=n.getTrigger();b=(0,p.o)(n.getTriggerType()).typecheck(e,t)}else if("event"===m){if(!n.isEventType()&&!n.isNotificationType())return{error:new c.MO(`Automation trigger (${n.getTriggerType()}) does not match context type (${m}).`)};const t=n.getTrigger();b=(0,p.o)(n.getTriggerType()).typecheck(e,t)}else if("recurrence"===m){if(!n.isRecurrenceType())return{error:new c.MO(`Automation trigger (${n.getTriggerType()}) does not match context type (${m}).`)};const t=n.getTrigger();b=(0,p.o)(n.getTriggerType()).typecheck(e,t)}else if("assistant"===m){if(!n.isAssistantType())return{error:new c.MO(`Automation trigger (${n.getTriggerType()}) does not match context type (${m}).`)};const t=n.getTrigger();b=(0,p.o)(n.getTriggerType()).typecheck(e,t)}else(0,i.t1)(e);if(r.x.isFail(b))return b;f.valueTypes.push(...o.d9(b.value.valueTypes));for(const i of t){v=void 0,g&&(v=u.Fv.getOrCreateAction(g,i.pointer,i.getType()));const t=(0,l.z)(i.getType());if(!t){y={error:new c.EP({actionId:i.id,message:`Unsupported action type: ${i.getType()}`})};break}const p=t.getExecutionDependencies({automationModel:n},i),m=yield*(0,d.Ps)({permissions:p,typecheckContextValues:f.valueTypes});v&&(v.totalDependencies=m.length),yield*a.R.fetchRecords(m.map((e=>e.pointer)));const h=t.typecheck(e,i),b=o.d9(f.valueTypes);if(f.actionInputValueTypes[i.id]=b,r.x.isFail(h)){y=h;break}for(const e of h.value.valueTypes??[]){f.valueTypes.some((t=>(0,s.Fl)(e,t)))||f.valueTypes.push(e)}h.value.validationFailures&&(f.actionValidationFailures[i.id]=h.value.validationFailures)}const _=Math.trunc(performance.now()-h);return g&&(g.typecheckStartTime=h,g.typecheckDurationMs=_,g.typecheckSuccess=!(0,i.$K)(y)),y??{value:f}}));function f(e){return r.x.isFail(e)?[]:e.value.valueTypes.slice(0)}function h(e,t){return r.x.isFail(e)?[]:e.value.actionInputValueTypes[t]??[]}function v(e,t){return r.x.isFail(e)?[]:e.value.actionValidationFailures[t]??[]}function y(e,t,n){const o=h(e,t);return(0,s.vx)(o,n)}},823290:(e,t,n)=>{n.d(t,{E2:()=>c,FP:()=>s,Gl:()=>g,JL:()=>i,Pv:()=>r,Xp:()=>f,lK:()=>l,o9:()=>u,ss:()=>m,xZ:()=>p,z8:()=>d});var o=n(335102);const r=(0,o.Qc)("COMPLETE_SPRINT_NEXT_SPRINT_DATE_RANGE"),i=(0,o.Qc)("COMPLETE_SPRINT_ACTION_TYPE"),a={duplicate_blocks:{display:!0},create_page:{display:!0},modal_confirmation:{display:!0},open_page:{display:!0},query_collection:{display:!0},slack_notification:{display:!0},update_pages:{display:!0},assistant:{display:!0},send_in_app_notification:{display:!0},send_gmail_notification:{display:!0},assistant_basic:{display:!0},define_variables:{display:!0},http_request:{display:!0},complete_sprint:{display:!1}};function s(e){return Object.entries(a).filter((t=>{let[n,o]=t;return o[e]})).map((e=>{let[t]=e;return t}))}function l(e,t){return a[e][t]}const c=["replace","append","remove","toggle"],d="replace";function u(e){return(null==e?void 0:e.action)||d}const p=100,m=50,g={recurrence:{min:1,max:1},notification_event:{min:1,max:1},button:{min:0,max:"default_bound"},event:{min:1,max:"default_bound"},chat:{min:0,max:"default_bound"}};function f(e){return l(e.type,"display")}},674564:(e,t,n)=>{n.d(t,{C:()=>d});n(757658);var o=n(401898),r=n(300482);function i(e){const{pointer:t,target:n,visitor:i}=e,a=[];return l(i.visitVariableOutsideOfFormula(n.id),(e=>{(0,o.$K)(e)?a.push(r.op.update({pointer:t,path:["config","target"],args:{id:e}})):a.push(r.op.update({pointer:t,path:["config"],args:{target:null}}))})),a}function a(e){const{pointer:t,config:{properties:n,values:o},visitor:i}=e;if(!n||!o)return[];const a=[];for(const s of n){const e=o[s];null!=e&&e.value&&l(i.visitFormula(e.value),(n=>{a.push(r.op.update({pointer:t,path:["config","values"],args:{[s]:n?{...e,value:n}:null}}))}))}return a}function s(e){const{fieldName:t,pointer:n,config:o,visitor:i}=e,a=[],s=o[t];return s&&l(i.visitFormula(s),(e=>{a.push(r.op.update({pointer:n,path:["config"],args:{[t]:e??null}}))})),a}function l(e,t){"replace"===e.type?t(e.value):"keep"===e.type||(0,o.t1)(e)}const c={open_page:e=>{var t;const{action:n,visitor:o}=e,r=n.getConfig();if(!r)return[];const a=[];return"variable"===(null==r||null===(t=r.target)||void 0===t?void 0:t.type)&&a.push(...i({pointer:n.pointer,target:r.target,visitor:o})),a},query_collection:e=>[],send_in_app_notification:e=>{const{action:t,visitor:n}=e,o=t.getConfig();return o?s({fieldName:"notification_message",config:o,pointer:t.pointer,visitor:n}):[]},slack_notification:e=>[],update_pages:e=>{var t;const{action:n,visitor:o}=e,r=n.getConfig();if(!r)return[];const s=[];if("variable"===(null==r||null===(t=r.target)||void 0===t?void 0:t.type)){const e=i({pointer:n.pointer,target:r.target,visitor:o});s.push(...e)}return s.push(...a({pointer:n.pointer,config:r,visitor:o})),s},complete_sprint:e=>[],assistant:e=>[],assistant_basic:e=>[],create_page:e=>{const{action:t,visitor:n}=e,o=t.getConfig();return o?a({pointer:t.pointer,config:o,visitor:n}):[]},define_variables:e=>{const{action:t,visitor:n}=e,i=t.getConfig();if(!i||!i.values)return[];const a=[];for(const[s,c]of Object.entries(i.values))(0,o.$K)(c.value)&&l(n.visitFormula(c.value),(e=>{a.push(r.op.update({args:{[s]:{...c,value:e??null}},path:["config","values"],pointer:t.pointer}))}));return a},duplicate_blocks:e=>[],modal_confirmation:e=>{const{action:t,visitor:n}=e,o=t.getConfig();return o?s({fieldName:"text",config:o,pointer:t.pointer,visitor:n}):[]},send_gmail_notification:e=>{const{action:t,visitor:n}=e,o=t.getConfig();if(!o)return[];const r=s({fieldName:"email_subject",config:o,pointer:t.pointer,visitor:n});return[...s({fieldName:"email_body",config:o,pointer:t.pointer,visitor:n}),...r]},http_request:e=>[]};function d(e){return c[e]}},763418:(e,t,n)=>{n.d(t,{BD:()=>h,UF:()=>v,Vl:()=>l,ZH:()=>f,_V:()=>m,_u:()=>u,xL:()=>c});var o=n(709291),r=n(253877),i=n(173110),a=n(335102);const s=(0,o.defineMessages)({buttonPage:{id:"automations.triggers.button.page.label",defaultMessage:"This page"},currentUser:{id:"automations.triggers.currentUser.label",defaultMessage:"Person who clicked button"},now:{id:"automations.triggers.now.label",defaultMessage:"Now"},nowTooltip:{id:"automations.triggers.now.tooltip",defaultMessage:"Time when automation ran"},today:{id:"automations.triggers.today.label",defaultMessage:"Today"},todayTooltip:{id:"automations.triggers.today.tooltip",defaultMessage:"Date when automation ran"},triggerPageCreator:{id:"automations.triggers.pageCreator.label",defaultMessage:"Page creator"},triggerPageCreatorTooltip:{id:"automations.triggers.pageCreator.tooltip",defaultMessage:"Person who created page"}});function l(){return(0,a.Kd)({source:"global",global:"button_page"})}const c={name:s.buttonPage,compile(e,t){return{id:l(),kind:i.yp.ContextValue,name:e.formatMessage(this.name),type:{collection:t,type:"block"}}},evaluate:e=>({kind:i.yp.ContextValue,id:l(),value:{type:"block",value:e}})};function d(){return(0,a.Kd)({source:"global",global:"current_user"})}const u={name:s.currentUser,compile(e){return{id:d(),kind:i.yp.ContextValue,name:e.formatMessage(this.name),type:{type:"person"}}},evaluate:e=>({id:d(),kind:i.yp.ContextValue,value:{type:"person",value:e}})};function p(){return(0,a.Kd)({source:"global",global:"now"})}const m={name:s.now,tooltip:s.nowTooltip,compile(e){return{id:p(),kind:i.yp.ContextValue,name:e.formatMessage(this.name),tooltipName:this.tooltip?e.formatMessage(this.tooltip):void 0,type:{type:"date"}}},evaluate:e=>({id:p(),kind:i.yp.ContextValue,value:{type:"date",value:(0,r.CQ)(Date.now(),e)}})};function g(){return(0,a.Kd)({source:"global",global:"today"})}const f={name:s.today,tooltip:s.todayTooltip,compile(e){return{id:g(),kind:i.yp.ContextValue,name:e.formatMessage(this.name),tooltipName:this.tooltip?e.formatMessage(this.tooltip):void 0,type:{type:"date"}}},evaluate:e=>({id:g(),kind:i.yp.ContextValue,value:{type:"date",value:(0,r.hT)(Date.now(),e)}})};function h(){return(0,a.Kd)({source:"global",global:"page_creator"})}const v={name:s.triggerPageCreator,tooltip:s.triggerPageCreatorTooltip,compile(e){return{id:h(),kind:i.yp.ContextValue,name:e.formatMessage(this.name),tooltipName:this.tooltip?e.formatMessage(this.tooltip):void 0,type:{type:"person"}}},evaluate:e=>({id:h(),kind:i.yp.ContextValue,value:{type:"person",value:e}})}},899207:(e,t,n)=>{n.d(t,{o:()=>h});var o=n(653965),r=n(401898),i=n(238297),a=n(842875),s=n(600606),l=n(606287),c=n(881730),d=n(763418);const u={type:"button",getCreatePermissions(e){const{parentPointer:t}=e;return[{minimumRole:"read_and_write",pointer:t,type:"record_permission"}]},getEditPermissions(e){const{automationModel:t}=e;return[{minimumRole:"read_and_write",pointer:t.getParentPointer(),type:"record_permission"}]},getManagePermissions(e){const{automationModel:t}=e;return[{minimumRole:"read_and_write",pointer:t.getParentPointer(),type:"record_permission"}]},getExecutePermissions(e){const{automationModel:t}=e;return[{minimumRole:"reader",pointer:t.getParentPointer(),type:"record_permission"}]},typecheck(e){const{automationModel:t,contextType:n,getRecordModel:a,intl:u}=e,p=d._u.compile(u),m=d._V.compile(u),g=d.ZH.compile(u),f=t.getParentPointer();let h;if("button_block"===n){if(e.pageBlockModel){const t=(0,i.J2)({block:e.pageBlockModel,getRecordModel:a});t&&(h=d.xL.compile(u,t.pointer))}}else if("button_property"===n){const e=a(f);if((null==e?void 0:e.table)!==l.vF)return{error:new c.MO(`Unable to load automation parent: ${s.dr.toKey(f)}`)};h=d.xL.compile(u,e.pointer)}else(0,r.t1)(n);return{value:{valueTypes:(0,o.oA)([p,m,g,h])}}},execute(e){const{formulaVariableResolution:t}=e,{executingUserPointer:n,executingUserTimeZone:r,thisPageBlockModel:i}=t??{},s=i?d.xL.evaluate(i.pointer):void 0,l=n?d._u.evaluate(n):void 0,c=(0,a.r)(),u=d._V.evaluate(r??c),p=d.ZH.evaluate(r??c);return{value:{values:(0,o.oA)([s,l,u,p])}}}},p={type:"chat",getCreatePermissions(e){const{parentPointer:t}=e;return[{minimumRole:"read_and_write",pointer:t,type:"record_permission"}]},getEditPermissions(e){const{automationModel:t}=e;return[{minimumRole:"read_and_write",pointer:t.getParentPointer(),type:"record_permission"}]},getManagePermissions(e){const{automationModel:t}=e;return[{minimumRole:"read_and_write",pointer:t.getParentPointer(),type:"record_permission"}]},getExecutePermissions(e){const{automationModel:t}=e;return[{minimumRole:"reader",pointer:t.getParentPointer(),type:"record_permission"}]},typecheck:()=>({value:{valueTypes:[]}}),execute:()=>({value:{values:[]}})};n(757658);var m=n(213493);const g={type:"event",getCreatePermissions(e){const{parentPointer:t,spacePointer:n}=e;return[{minimumRole:"editor",pointer:t,type:"record_permission"},{minimumRole:"read_and_write",pointer:n,type:"record_permission"}]},getEditPermissions(e){const{automationModel:t}=e,n=[{minimumRole:"editor",pointer:t.getParentPointer(),type:"record_permission"},{minimumRole:"read_and_write",pointer:t.getSpacePointer(),type:"record_permission"}],o=t.getTrigger();if("event"===o.type){const e=o.event;(0,r.$K)(e.source)&&"filter"!==e.source.type&&(e.source.type===l.vF||e.source.type===m.np?n.push({minimumRole:"reader",pointer:e.source.pointer,type:"record_permission"}):(0,r.t1)(e.source))}return n},getManagePermissions(e){const{automationModel:t}=e;return[{minimumRole:"editor",pointer:t.getParentPointer(),type:"record_permission"},{minimumRole:"read_and_write",pointer:t.getSpacePointer(),type:"record_permission"}]},getExecutePermissions(e){const{automationModel:t}=e;return[{minimumRole:"reader",pointer:t.getParentPointer(),type:"record_permission"}]},typecheck(e){const{automationModel:t,intl:n}=e,r=d.UF.compile(n),i=d._V.compile(n),a=d.ZH.compile(n),s=t.getParentPointer();let c;return s.table===l.vF&&(c=d.xL.compile(n,s)),{value:{valueTypes:(0,o.oA)([r,i,a,c])}}},execute(e){const{formulaVariableResolution:t}=e,{executingUserPointer:n,executingUserTimeZone:i,thisPageBlockModel:s}=t??{},l=s?d.xL.evaluate(s.pointer):void 0,c=n?d._u.evaluate(n):void 0,u=(0,a.r)(),p=d._V.evaluate(i??u),m=null==s?void 0:s.getCreatedByPointer(),g=(0,r.$K)(m)?d.UF.evaluate(m):void 0,f=d.ZH.evaluate(i??u);return{value:{values:(0,o.oA)([l,c,p,f,g])}}}},f={button:u,chat:p,event:g,notification_event:g,recurrence:{type:"recurrence",getCreatePermissions(e){const{parentPointer:t}=e;return[{minimumRole:"read_and_write",pointer:t,type:"record_permission"}]},getEditPermissions(e){const{automationModel:t}=e;return[{minimumRole:"read_and_write",pointer:t.getParentPointer(),type:"record_permission"}]},getManagePermissions(e){const{automationModel:t}=e;return[{minimumRole:"read_and_write",pointer:t.getParentPointer(),type:"record_permission"}]},getExecutePermissions(e){const{automationModel:t}=e;return[{minimumRole:"reader",pointer:t.getParentPointer(),type:"record_permission"}]},typecheck:()=>({value:{valueTypes:[]}}),execute:()=>({value:{values:[]}})}};function h(e){return f[e]}},736576:(e,t,n)=>{n.d(t,{I3:()=>w,dq:()=>k,xU:()=>y});n(757658);var o=n(653965),r=n(926249),i=n(401898),a=n(541432),s=n(399036),l=n(714215),c=n(238297),d=n(959753),u=n(463306),p=n(600606),m=n(421202),g=n(870279),f=n(933709),h=n(23867),v=n(421838);async function y(e){const{loadRecordValue:t,operationPointers:n,getInitialRecordModel:r,getFinalRecordModel:a}=e,s=[],c=[],u=async(n,o)=>{var r;const i=null===(r=await t({table:m.iU,id:n,spaceId:o}))||void 0===r?void 0:r.space_id;return i||(e.getSpaceIdFromBlockId?await e.getSpaceIdFromBlockId(n,o):void 0)};return await Promise.all(n.map((async e=>{if((0,p.$O)(e,m.iU)){const n=r.getRecordValue(e),p=a.getRecordValue(e),g=null==p?void 0:p.space_id,f={...e,spaceId:(0,h.C)(g)};let v;if(n&&(v=d.kk5.fromBlock(n).getCollectionPointer()),(!n||!v)&&p){const e=d.kk5.fromBlock(p).getCollectionPointer();if(e){let n=a.getRecordValue(e);n||(n=await t(e)),n&&n.parent_id!==p.id&&s.push({space_id:n.space_id,block_id:(0,i.xL)(n.parent_id),mentioned_from:{type:"collection_reference",block_id:p.id,pointer:{id:p.id,spaceId:p.space_id,table:m.iU}}})}}const y=(0,l.N)(_(n),_(p),b);for(const{blockId:t,propertyId:o}of y.created)s.push({space_id:await u(t,g),block_id:t,mentioned_from:{type:"property_mention",block_id:e.id,property_id:o,pointer:f}});for(const{blockId:t,propertyId:o}of y.deleted)c.push({space_id:await u(t,g),block_id:t,mentioned_from:{type:"property_mention",block_id:e.id,property_id:o,pointer:f}});const S=P(n),k=P(p);S&&!o.Xy(S,k)&&c.push({space_id:S.spaceId,block_id:S.id,mentioned_from:{type:"alias",pointer:f}}),k&&!o.Xy(S,k)&&s.push({space_id:k.spaceId,block_id:k.id,mentioned_from:{type:"alias",pointer:f}});const w=A(n),x=A(p);w&&!o.Xy(w,x)&&c.push({space_id:w.spaceId,block_id:w.id,mentioned_from:{type:"transclusion_reference",pointer:f}}),x&&!o.Xy(w,x)&&s.push({space_id:x.spaceId,block_id:x.id,mentioned_from:{type:"transclusion_reference",pointer:f}})}else if((0,p.$O)(e,g.x_)){const t=r.getRecordValue(e),n=a.getRecordValue(e),o=null==n?void 0:n.space_id,i={...e,spaceId:(0,h.C)(o)},d=(0,l.E)(S(t),S(n));for(const r of d.created)s.push({space_id:await u(r,o),block_id:r,mentioned_from:{type:"comment_mention",comment_id:e.id,pointer:i}});for(const r of d.deleted)c.push({space_id:await u(r,o),block_id:r,mentioned_from:{type:"comment_mention",comment_id:e.id,pointer:i}})}}))),{createdBacklinks:s,deletedBacklinks:c}}function b(e){return`${e.blockId}${e.propertyId}`}function _(e){const t=d.kk5.fromValue(m.iU,e),n=[];if(!t)return n;const o=t.getProperties();if(!o)return n;for(const r in o){const e=v.jDe(t.getProperty(r));for(const t of e)n.push({propertyId:r,blockId:t})}return n}function S(e){const t=d.kk5.fromValue(g.x_,e);return t&&t.alive?v.jDe(t.getText()):[]}function k(e){var t,n,o,r;return"comment_mention"===e.mentioned_from.type?{table:g.x_,id:e.mentioned_from.comment_id,spaceId:(0,h.C)(null===(t=e.mentioned_from.pointer)||void 0===t?void 0:t.spaceId)}:"reference"===e.mentioned_from.type?{table:m.iU,id:e.mentioned_from.parent_block_id,spaceId:(0,h.C)(null===(n=e.mentioned_from.parent_pointer)||void 0===n?void 0:n.spaceId)}:"property_mention"===e.mentioned_from.type?{table:m.iU,id:e.mentioned_from.block_id,spaceId:(0,h.C)(null===(o=e.mentioned_from.pointer)||void 0===o?void 0:o.spaceId)}:"collection_reference"===e.mentioned_from.type?{table:m.iU,id:e.mentioned_from.block_id,spaceId:(0,h.C)(null===(r=e.mentioned_from.pointer)||void 0===r?void 0:r.spaceId)}:"alias"===e.mentioned_from.type||"transclusion_reference"===e.mentioned_from.type?e.mentioned_from.pointer:void(0,i.t1)(e.mentioned_from)}function w(e){const{backlinks:t,getRecordModel:n,sourceBlockRecordPointer:r}=e,i=(0,u.DW)(r,n),a=o.Z$(i),s=i[0];return a&&"block"===s.table?t.filter((t=>x({...e,backlink:t}))).filter((t=>I({...e,backlink:t,shouldCheckSourceBlockPublicPermission:{sourceBlockRecordPointer:s}}))).filter((t=>C({...e,backlink:t}))).filter((t=>T({...e,backlink:t,shouldPerformRelationCheck:{sourceBlock:s}}))).filter((t=>M({...e,backlink:t}))):[]}function x(e){const{getRecordModel:t,backlink:n}=e,o=k(n),r=(0,u.DW)(o,t);return!!(0,u.Zg)(r)}function I(e){const{actor:t,actorHasPermissionViaPublicAccessOnlyFn:n,backlink:o,shouldCheckSourceBlockPublicPermission:i}=e,a=n({actor:t,recordPointer:k(o)});if(a){if(!i)return!1;{const e=n({actor:t,recordPointer:i.sourceBlockRecordPointer});if(!e)return!1;if(!(0,r.Z)(a.from,e.from))return!1}}return!0}function C(e){const{getRecordModel:t,backlink:n}=e,o=k(n),r=(0,u.DW)(o,t);if(!(0,u.Zg)(r))return!1;return!r.some((e=>e.table===f.qF&&e.resolved))}function T(e){const{getRecordModel:t,backlink:n,shouldPerformRelationCheck:o}=e;if("property_mention"===n.mentioned_from.type){var r;const e=t({table:m.iU,id:n.mentioned_from.block_id,spaceId:(0,h.C)(null===(r=n.mentioned_from.pointer)||void 0===r?void 0:r.spaceId)});if(!e)return!1;const i=(0,c.ky)({block:e,getRecordModel:t});if(i){const e=d.kk5.fromCollection(i);if("title"!==n.mentioned_from.property_id){const r=s.MY(i),a=n.mentioned_from.property_id,l=r[a];if(!l)return!1;if("relation"===l.type){if(!o)return!1;{const n=o.sourceBlock,r=(0,c.ky)({block:n,getRecordModel:t}),i=s.F0(l);if(!r||r.id!==i)return!1;if(s.EY({...e.pointer,propertyId:a,propertySchema:l},r))return!1}}else if("title"!==l.type&&"text"!==l.type)return!1}}else if("title"===n.mentioned_from.property_id){if(!(0,a.XD)(e.type,e.getFormat()))return!1}else{if("caption"!==n.mentioned_from.property_id)return!1;if(!d.kk5.fromBlock(e).isType(a.oe))return!1}}return!0}function M(e){const{getRecordModel:t,backlink:n}=e,o=k(n),r=(0,u.DW)(o,t);if(!(0,u.Zg)(r))return!1;const i=(0,u.zN)(r)[0],a=(0,u.uJ)({table:m.iU,id:n.block_id},t)[1];return!i||!a||i.id!==a.id}function P(e){const t=d.kk5.fromValue(m.iU,e);if(t&&"alias"===t.type)return t.getAliasTargetPointer()}function A(e){const t=d.kk5.fromValue(m.iU,e);if(t&&"transclusion_reference"===t.type)return t.getTransclusionReferenceTargetPointer()}},949271:(e,t,n)=>{n.d(t,{N7:()=>i,ZD:()=>a});var o=n(531701),r=n(137810);function i(e){return{color:o.ZP.defaultText,fill:"currentColor",lineHeight:1.5,fontFamily:r.Z.getCompositeFontFamily(e).sans}}const a={paddingTop:3,paddingBottom:3,paddingLeft:2,paddingRight:2}},378168:(e,t,n)=>{n.d(t,{A1:()=>u,A7:()=>c,FT:()=>g,KH:()=>f,Tv:()=>m,iv:()=>s,vF:()=>d,xR:()=>p,yB:()=>l});n(401898);var o=n(619584),r=n(463306),i=n(421202),a=n(647425);const s=1714158352e3,l=17240832e5,c=30*o.Lq,d=30*o.Lq;function u(e){const t=(0,r.y)(e);if((null==t?void 0:t.table)===i.iU)return t.getDeletedFromTrashTime()}function p(e){const t=(0,r.OJ)(e);if((null==t?void 0:t.table)===i.iU)return t.getMovedToTrashTime()}function m(e){if(!e||!(0,a.wP)(e.getSubscriptionTier()))return 1e3*c;return 1e3*(e.getSetting("delete_from_trash_delay_seconds")??c)}function g(e){if(!e||!(0,a.wP)(e.getSubscriptionTier()))return 1e3*d;return 1e3*(e.getSetting("purge_delay_seconds")??d)}function f(e){let{movedToTrashTime:t,deleteFromTrashDelayMs:n,cdrrDeletionEnabledTimestamp:o}=e;const r=t??s;return(r<o?o:r)+n}},217215:(e,t,n)=>{n.d(t,{$F:()=>w,IT:()=>v,Q2:()=>g,T0:()=>b,TX:()=>y,V1:()=>k,bZ:()=>f,lL:()=>p,qk:()=>x,x:()=>h,xg:()=>S});var o=n(709291),r=n(541432),i=n(401800),a=n(406695),s=n(463306),l=n(421202),c=n(933709),d=n(509844),u=n(544876);const p=1e3,m=(0,o.defineMessages)({emptyPageTitle:{id:"emptyPageTitle",defaultMessage:"Untitled"},emptyCollectionViewTitle:{id:"emptyDatabaseViewTitle",defaultMessage:"View of {commaSeparatedDatabaseNames}"},restrictedPageTitle:{id:"restrictedPageTitle",defaultMessage:"No access"}});function g(e){return e.formatMessage(m.emptyPageTitle)}function f(e,t){return e.formatMessage(m.emptyCollectionViewTitle,{commaSeparatedDatabaseNames:t})}function h(e){return e.formatMessage(m.restrictedPageTitle)}function v(e){if(e)return{pointer:e.pointer,icon:(0,a.Lf)(e.icon)}}function y(e,t,n){const o=e.getKeyStore("uri").getValue(),r=e.getKeyStore("attributes").getValue();if(o&&r){const i=null==r?void 0:r.find((e=>{var t;return"avatar"===(null===(t=e.format)||void 0===t?void 0:t.section)}));if(i&&(0,u.Wj)(i))return{pointer:e.pointer,icon:i.values[0]};if(t){const r=function(e,t,n){if(!n)return;const o=(0,u.ny)({url:e,integrations:n,currentSpaceId:t});if("success"!==o.type)return;return o.integration.info.icon||void 0}(o,t,n);if(r)return{pointer:e.pointer,icon:r}}}}function b(e){const{blockModel:t,getRecordModel:n,baseUrl:o,discussionId:a,pageVisitSource:l,notificationId:d}=e;if((0,r.S9)(t.getType()))return(0,i.Z)({pageId:t.id,pageModel:t,baseUrl:o,discussionId:a,notificationId:d,pageVisitSource:l});const u=s.DW(t.pointer,n),p=s.C8(u);if(p){let e=t.id;if(a){const o=n({table:c.qF,id:a,spaceId:t.getSpaceId()});if(o){const t=n(o.getParentPointer());e=t&&t.getType()===r.Ti.tableRow?t.getParentId():o.getParentId()}}return(0,i.Z)({pageId:p.id,pageModel:p,scrollToBlockId:e,baseUrl:o,discussionId:a,notificationId:d,pageVisitSource:l})}}const _=(0,o.defineMessages)({embed:{defaultMessage:"Embed",id:"blockHelpers.embedBlockType"},framer:{defaultMessage:"Framer",id:"blockHelpers.framerBlockType"},tweet:{defaultMessage:"Tweet",id:"blockHelpers.tweetBlockType"},gist:{defaultMessage:"Gist",id:"blockHelpers.gistBlockType"},drive:{defaultMessage:"Drive",id:"blockHelpers.driveBlockType"},figma:{defaultMessage:"Figma",id:"blockHelpers.figmaBlockType"},loom:{defaultMessage:"Loom",id:"blockHelpers.loomBlockType"},typeform:{defaultMessage:"Typeform",id:"blockHelpers.typeformBlockType"},codepen:{defaultMessage:"Codepen",id:"blockHelpers.codepenBlockType"},audio:{defaultMessage:"Audio",id:"blockHelpers.audioBlockType"},maps:{defaultMessage:"Maps",id:"blockHelpers.mapsBlockType"},invision:{defaultMessage:"Invision",id:"blockHelpers.invisionBlockType"},mixpanel:{defaultMessage:"Mixpanel",id:"blockHelpers.mixpanelBlockType"},image:{defaultMessage:"Image",id:"blockHelpers.imageBlockType"},pdf:{defaultMessage:"PDF",id:"blockHelpers.pdfBlockType"},video:{defaultMessage:"Video",id:"blockHelpers.videoBlockType"},file:{defaultMessage:"File",id:"blockHelpers.fileBlockType"},whimsical:{defaultMessage:"Whimsical",id:"blockHelpers.whimsicalBlockType"},miro:{defaultMessage:"Miro",id:"blockHelpers.miroBlockType"},abstract:{defaultMessage:"Abstract",id:"blockHelpers.abstractBlockType"},sketch:{defaultMessage:"Sketch",id:"blockHelpers.sketchBlockType"},excalidraw:{defaultMessage:"Excalidraw",id:"blockHelpers.excalidrawBlockType"},replit:{defaultMessage:"Replit",id:"blockHelpers.replitBlockType"},hex:{defaultMessage:"Hex",id:"blockHelpers.hexBlockType"},deepnote:{defaultMessage:"Deepnote",id:"blockHelpers.deepnoteBlockType"},drawing:{defaultMessage:"Drawing",id:"blockHelpers.drawingBlockType"}});function S(e,t){return e.formatMessage(_[t])}const k=(0,o.defineMessages)({placeholder:{id:"externalObjectInstanceBlock.placeholder.message",defaultMessage:"Embed {value}"},editLabel:{id:"externalObjectInstanceBlock.editLabel.message",defaultMessage:"Link Preview"}});function w(e,t,n){const o=t.getFormat();if(!o)return"";if(o.original_url)return o.original_url??"";if(o.integration_id){const t=n({table:d.K2,id:o.integration_id});if(t)return e.formatMessage(k.placeholder,{value:t.getName()})}return""}function x(e){return e.table in l.i3}},541432:(e,t,n)=>{n.d(t,{$t:()=>Y,BA:()=>we,BT:()=>b,BX:()=>pe,D1:()=>Ce,F8:()=>be,Fx:()=>u,GP:()=>D,MF:()=>s,MV:()=>k,Nn:()=>F,OY:()=>te,Ok:()=>I,PH:()=>R,Pm:()=>_e,Q2:()=>x,Q3:()=>w,S9:()=>le,TT:()=>ee,Ti:()=>m,UW:()=>p,Um:()=>X,VB:()=>oe,W2:()=>he,XD:()=>fe,XX:()=>U,Z7:()=>Z,ZM:()=>ke,ZY:()=>c,Zi:()=>A,Zj:()=>E,Zu:()=>ie,_7:()=>ne,_T:()=>ae,dM:()=>me,eJ:()=>ue,eh:()=>$,f7:()=>ge,fb:()=>Q,hD:()=>ve,hY:()=>y,he:()=>ye,ib:()=>B,kC:()=>_,lQ:()=>se,m3:()=>q,nH:()=>v,nY:()=>Ie,nq:()=>re,oe:()=>M,p2:()=>H,pg:()=>W,q7:()=>S,sX:()=>d,tD:()=>Se,tx:()=>j,wP:()=>z,wZ:()=>l,yv:()=>ce,zp:()=>de,zq:()=>J});var o=n(401898),r=n(371663),i=n(600606),a=n(421202);const s={toggleFormatHeaderBlock:"toggle_format_header_block",toggleFormatSubHeaderBlock:"toggle_format_sub_header_block",toggleFormatSubSubHeaderBlock:"toggle_format_sub_sub_header_block",column2Block:"column2_block",column3Block:"column3_block",column4Block:"column4_block",column5Block:"column5_block",mermaidCodeBlock:"mermaid_code_block",aiFreePromptBlock:"ai_free_prompt_block"};s.aiFreePromptBlock;const l={header:"toggle_format_header_block",sub_header:"toggle_format_sub_header_block",sub_sub_header:"toggle_format_sub_sub_header_block"};l.header;const c={toggle_format_header_block:"header",toggle_format_sub_header_block:"sub_header",toggle_format_sub_sub_header_block:"sub_sub_header",column2_block:"column_list",column3_block:"column_list",column4_block:"column_list",column5_block:"column_list",mermaid_code_block:"code",ai_free_prompt_block:"ai_block"};function d(e){return e.startsWith("column")&&e.endsWith("block")}function u(e){return e.startsWith("toggle_format_")}function p(e){return e.startsWith("ai_")&&e.endsWith("_block")}c.mermaid_code_block;const m={image:"image",video:"video",bookmark:"bookmark",file:"file",page:"page",linkToPage:"link_to_page",personalHomePage:"personal_home_page",linkToCollection:"link_to_collection",text:"text",header:"header",subHeader:"sub_header",subSubHeader:"sub_sub_header",toDo:"to_do",bulletedList:"bulleted_list",numberedList:"numbered_list",toggle:"toggle",code:"code",factory:"factory",button:"button",divider:"divider",columnList:"column_list",column:"column",copyIndicator:"copy_indicator",breadcrumb:"breadcrumb",equation:"equation",quote:"quote",collectionView:"collection_view",collectionViewPage:"collection_view_page",form:"form",embed:"embed",framer:"framer",tweet:"tweet",gist:"gist",drive:"drive",figma:"figma",loom:"loom",typeform:"typeform",codepen:"codepen",audio:"audio",maps:"maps",invision:"invision",pdf:"pdf",callout:"callout",tableOfContents:"table_of_contents",whimsical:"whimsical",miro:"miro",abstract:"abstract",sketch:"sketch",excalidraw:"excalidraw",alias:"alias",transclusionContainer:"transclusion_container",transclusionReference:"transclusion_reference",replit:"replit",externalObjectInstance:"external_object_instance",table:"table",tableRow:"table_row",tab:"tab",hex:"hex",deepnote:"deepnote",mixpanel:"mixpanel",externalObjectInstancePage:"external_object_instance_page",aiBlock:"ai_block",drawing:"drawing",slide:"slide",post:"post"},g={text:!0,to_do:!0,bulleted_list:!0,numbered_list:!0,toggle:!0,page:!0,column:!0,column_list:!0,factory:!0,transclusion_container:!0,callout:!0,quote:!0,table:!0,tab:!0,ai_block:!0,slide:!0,post:!0},f={header:!0,sub_header:!0,sub_sub_header:!0},h={text:!0,to_do:!0,bulleted_list:!0,numbered_list:!0,toggle:!0,column:!0,transclusion_container:!0,callout:!0,quote:!0},v={callout:!0},y={callout:!0,quote:!0},b={transclusion_container:!0,transclusion_reference:!0,collection_view:!0,column_list:!0,column:!0,table:!0,factory:!0,ai_block:!0,button:!0,slide:!0,callout:!0},_={text:!0,to_do:!0,bulleted_list:!0,numbered_list:!0},S={header:!0,sub_header:!0,sub_sub_header:!0,to_do:!0,bulleted_list:!0,numbered_list:!0,toggle:!0,quote:!0,callout:!0},k={text:!0,page:!0,collection_view_page:!0,bulleted_list:!0,numbered_list:!0,toggle:!0,quote:!0,to_do:!0,header:!0,sub_header:!0,sub_sub_header:!0,callout:!0,transclusion_container:!0,transclusion_reference:!0,alias:!0},w={text:!0,header:!0,sub_header:!0,sub_sub_header:!0},x={header:!0,sub_header:!0,sub_sub_header:!0,quote:!0,callout:!0},I={image:!0,video:!0,embed:!0,tweet:!0,drive:!0,gist:!0,invision:!0,framer:!0,audio:!0,maps:!0,figma:!0,loom:!0,typeform:!0,codepen:!0,pdf:!0,whimsical:!0,miro:!0,abstract:!0,sketch:!0,excalidraw:!0,replit:!0,hex:!0,deepnote:!0,mixpanel:!0,drawing:!0},C={image:!0,video:!0,embed:!0,drive:!0,gist:!0,invision:!0,framer:!0,maps:!0,figma:!0,loom:!0,typeform:!0,codepen:!0,pdf:!0,whimsical:!0,miro:!0,abstract:!0,sketch:!0,excalidraw:!0,replit:!0,hex:!0,deepnote:!0,mixpanel:!0},T={image:!0,pdf:!0},M={...I,bookmark:!0,file:!0,code:!0},P={transclusion_container:!0,transclusion_reference:!0},A={text:!0,header:!0,sub_header:!0,sub_sub_header:!0,page:!0,to_do:!0,bulleted_list:!0,numbered_list:!0,toggle:!0,code:!0,quote:!0,callout:!0,equation:!0,transclusion_container:!0,column_list:!0,slide:!0},R=["text","header","sub_header","sub_sub_header","to_do","bulleted_list","numbered_list","toggle","code","page"],D={image:!0,video:!0,tweet:!0,drive:!0,maps:!0,gist:!0,audio:!0,file:!0,collection_view:!0,pdf:!0,table:!0},B={column_list:!0,collection_view:!0,external_object_instance:!0,...I},E={text:!0,to_do:!0,bulleted_list:!0,numbered_list:!0,toggle:!0,quote:!0,page:!0,header:!0,sub_header:!0,sub_sub_header:!0,bookmark:!0,file:!0,collection_view_page:!0,callout:!0,table_of_contents:!0,button:!0},F={callout:!0,button:!0,page:!0},Z={page:!0,collection_view:!0,collection_view_page:!0,external_object_instance_page:!0,form:!0,personal_home_page:!0},U={column:!0,column_list:!0,copy_indicator:!0,divider:!0,link_to_page:!0,link_to_collection:!0,table_of_contents:!0},V={column:!0,column_list:!0,copy_indicator:!0,divider:!0,link_to_page:!0,link_to_collection:!0,table_of_contents:!0,collection_view:!0,collection_view_page:!0,transclusion_container:!0,transclusion_reference:!0},N={collection_view:!0},O={text:!0,page:!0,bulleted_list:!0,numbered_list:!0,to_do:!0,toggle:!0,quote:!0,factory:!0,code:!0,header:!0,sub_header:!0,sub_sub_header:!0,callout:!0,external_object_instance_page:!0,ai_block:!0,file:!0},L={text:!0,bulleted_list:!0,numbered_list:!0,to_do:!0,toggle:!0,quote:!0,header:!0,sub_header:!0,sub_sub_header:!0,callout:!0};function j(e){return!!(0,o.qg)(L,e)&&L[e]}const K={text:!0,bulleted_list:!0,numbered_list:!0,to_do:!0,toggle:!0};function z(e){return!!(0,o.qg)(K,e)&&K[e]}const q={header:!0,sub_header:!0,sub_sub_header:!0},H={text:!0,bulleted_list:!0,numbered_list:!0,to_do:!0,toggle:!0,quote:!0,header:!0,sub_header:!0,sub_sub_header:!0,callout:!0},G={text:!0,bulleted_list:!0,numbered_list:!0,to_do:!0,toggle:!0,quote:!0,callout:!0,slide:!0},W={collection_view:!0,collection_view_page:!0},$={text:!0,bulleted_list:!0,numbered_list:!0,to_do:!0,toggle:!0,quote:!0,header:!0,sub_header:!0,sub_sub_header:!0},Y={page:!0,callout:!0,column:!0,factory:!0,button:!0,transclusion_container:!0,transclusion_reference:!0,tab:!0,slide:!0},Q={...q,toggle:!0,numbered_list:!0,bulleted_list:!0,text:!0,to_do:!0},J={toggle:!0,numbered_list:!0,bulleted_list:!0,text:!0,to_do:!0,...q};function X(e,t){return ue(e,t)||ge(e,t)||!!(0,o.qg)(g,e)&&g[e]}function ee(e,t){return ue(e,t)||!!(0,o.qg)(h,e)&&h[e]}function te(e){return!!(0,o.qg)(I,e)&&I[e]}function ne(e){return!!(0,o.qg)(C,e)&&C[e]}function oe(e){return!!(0,o.qg)(T,e)&&T[e]}function re(e){return!!(0,o.qg)(P,e)&&P[e]}function ie(e){return!!(0,o.qg)(A,e)&&A[e]}function ae(e,t){const n=!!(0,o.qg)(V,e)&&V[e],r=ge(e,t),s=Boolean(t&&t.alias_pointer&&(0,i.$O)(t.alias_pointer,a.iU));return n&&!r||s}function se(e){return!!(0,o.qg)(N,e)&&N[e]}function le(e){return!!(0,o.qg)(Z,e)&&Z[e]}function ce(e){switch(e){case m.page:case m.collectionView:case m.collectionViewPage:case m.form:case m.button:return!0;default:return!1}}function de(e){return!!(0,o.qg)(f,e)&&f[e]}function ue(e,t){return de(e)&&(null==t?void 0:t.toggleable)}function pe(e,t){return"toggle"===e||ue(e,t)}function me(e){return!!(0,o.qg)(W,e)&&W[e]}function ge(e,t){return me(e)&&(null==t?void 0:t.app_config_uri)===r.jh}function fe(e,t){return void 0!==e&&((e!==m.callout||2!==(null==t?void 0:t.callout_version))&&(!!(0,o.qg)(O,e)&&O[e]))}function he(e){return!!(0,o.qg)(M,e)&&M[e]}function ve(e){return!!(0,o.qg)(G,e)&&G[e]}function ye(e){return!!(0,o.qg)(_,e)&&_[e]}const be={page:!0,collection_view_page:!0,external_object_instance_page:!0};function _e(e){return!!(0,o.qg)(be,e)&&be[e]}const Se={asanaImport:"asana_import",confluenceFileImport:"confluence_file_import",confluenceApiImport:"confluence_api_import",googleDocsImport:"google_docs_import",dropboxPaperImport:"dropbox_paper_import",evernoteImport:"evernote_import",mondayImport:"monday_import",quipImport:"quip_import",trelloImport:"trello_import",workflowyImport:"workflowy_import",wordImport:"word_import",csvImport:"csv_import",markdownImport:"markdown_import",htmlImport:"html_import",genericImport:"generic_import",pdfImport:"pdf_import"},ke={text:!0,to_do:!0,header:!0,sub_header:!0,sub_sub_header:!0,bulleted_list:!0,numbered_list:!0,table:!1,table_row:!1,page:!1,personal_home_page:!1,toggle:!1,quote:!1,factory:!1,button:!1,column_list:!1,column:!1,embed:!1,framer:!1,tweet:!1,gist:!1,drive:!1,audio:!1,maps:!1,invision:!1,mixpanel:!1,image:!1,video:!1,file:!1,bookmark:!1,equation:!1,code:!1,collection_view:!1,collection_view_page:!1,form:!1,breadcrumb:!1,copy_indicator:!1,divider:!1,link_to_page:!1,link_to_collection:!1,figma:!1,loom:!1,typeform:!1,codepen:!1,pdf:!1,callout:!1,table_of_contents:!1,whimsical:!1,miro:!1,abstract:!1,sketch:!1,excalidraw:!1,replit:!1,alias:!1,transclusion_container:!1,transclusion_reference:!1,external_object_instance:!1,tab:!1,external_object_instance_page:!1,hex:!1,deepnote:!1,ai_block:!1,drawing:!1,slide:!1,post:!1},we={...ke,tab:!0,quote:!0,table:!0,table_row:!0,column_list:!0,column:!0,toggle:!0,callout:!0,transclusion_container:!0,transclusion_reference:!0},xe={transclusion_container:!0,slide:!0};function Ie(e,t){return!!e&&(e===m.callout&&2===(null==t?void 0:t.callout_version)||!!(0,o.qg)(xe,e)&&xe[e])}const Ce={header:!0,sub_header:!0,sub_sub_header:!0}},163171:(e,t,n)=>{n.d(t,{OS:()=>i});n(757658),n(401898),n(371663),n(399036),n(714215),n(959753);var o=n(542297),r=n(421838);function i(e){const{before:t,after:n,schema:i}=e,a=[];return(i?Object.keys(i):o.qF).forEach((e=>{(0,r.Dne)(t&&t.properties&&t.properties[e],n&&n.properties&&n.properties[e])&&a.push(e)})),a}},150475:(e,t,n)=>{n.d(t,{EW:()=>r,R5:()=>i,bv:()=>a,u7:()=>s});var o=n(401898);n(541432);function r(e){switch(e){case"home_main":case"home_trending":case"home_similar_users":case"home_my_tasks":case"home_custom_db":case"home_most_visited":case"home_last_edited":case"home_favorites":return!0;case void 0:return!1;default:(0,o.t1)(e)}}function i(e){const t=null==e?void 0:e.getSystemBlockType();switch(t){case"home_main":case"home_trending":case"home_similar_users":case"home_most_visited":case"home_last_edited":case"home_my_tasks":case"home_custom_db":case"home_favorites":return!0;case void 0:return!1;default:(0,o.t1)(t)}}function a(e){switch(e){case"home_main":case"home_trending":case"home_similar_users":case"home_most_visited":case"home_last_edited":case"home_my_tasks":case"home_favorites":return!0;case"home_custom_db":case void 0:return!1;default:(0,o.t1)(e)}}function s(e){switch(e){case"home_main":case"home_trending":case"home_similar_users":case"home_most_visited":case"home_last_edited":case"home_favorites":return!0;case"home_my_tasks":case"home_custom_db":case void 0:return!1;default:(0,o.t1)(e)}}},715070:(e,t,n)=>{n.d(t,{Be:()=>_,Mh:()=>w,U9:()=>h,Uz:()=>S,Ye:()=>m,c9:()=>b,f2:()=>k,hA:()=>f,ms:()=>g,oA:()=>v,pH:()=>u,xe:()=>y,y2:()=>x});var o=n(653965),r=n(401898),i=(n(977657),n(959753)),a=n(772141),s=n(177420),l=n(475246),c=n(519889);const d=(0,r.AO)((e=>"read_property"===e||"insert_property"===e||"update_property"===e?{true:e}:{false:e}));function u(e){return!(!(0,r.Kn)(e)||0===(0,r.Yd)(e).length)&&Object.entries(e).every((e=>{let[t,n]=e;return d(t)&&!0===n}))}const p=(0,r.AO)((e=>(0,r.DE)(a.ZK,e)?{true:e}:{false:e}));function m(e){return!(!(0,r.Kn)(e)||0===(0,r.Yd)(e).length)&&Object.entries(e).every((e=>{let[t,n]=e;return p(t)&&!0===n}))}function g(e){if(!(0,r.Kn)(e)||0===(0,r.Yd)(e).length)return!1;const{read_user_without_email:t,read_user_with_email:n,inherit_creator_permissions:o,link_preview:i,synced_database:a,webhooks:s,workspace_search:l,workspace_page_export:c,workspace_content_transfer:d,read_teamspace:p,...g}=e;return(void 0===n||!0===n&&void 0!==t&&!0===t)&&((void 0===t||!0===t)&&((void 0===o||!0===o)&&(u(g)||m(g))))}function f(e){return i.kk5.fromValue(s.cZ,e).isBotWithCoreApiCapabilities()}function h(e){return g(e.capabilities)&&_(e.capabilities)}const v=(0,r.AO)((e=>e.parent_table===c.KJ&&"guest"===e.type&&f(e)?{true:e}:{false:e}));function y(e){return i.kk5.fromValue(s.cZ,e).isScimBot()}const b=(0,r.AO)((e=>e.parent_table===l.bx&&"guest"===e.type&&f(e)?{true:e}:{false:e}));function _(e){if(!e||!(0,r.Kn)(e)||0===(0,r.Yd)(e).length)return!1;const{link_preview:t,synced_database:n}=e;return!0===t||!0===n}function S(e){return!(!e||!(0,r.Kn)(e)||0===(0,r.Yd)(e).length)&&!0===e.webhooks}function k(e){if(!e||!(0,r.Kn)(e)||0===(0,r.Yd)(e).length)return!1;const{synced_database:t}=e;return!0===t}function w(e){return(i.kk5.isAnyModel(e)?e.getName():null==e?void 0:e.name)||"Unnamed Bot"}function x(e){return o.oA([e.name,"bot"]).join(" ")}},712137:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(653965);const r=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return!o.hj(e)||o.i2(e)?r:e>n?n:e<t?t:e}},79571:(e,t,n)=>{n.d(t,{xg:()=>p,TB:()=>u,$Z:()=>d,CG:()=>f,QN:()=>m,sv:()=>h,Yy:()=>g,nK:()=>l});n(21703);var o=n(730120);function r(e,t,n){return o.ou.utc(e,t,n).toMillis()}const i=r(1970,1,1),a=r(2038,1,17),s=[{name:"ai_slack_universal_qna_announcement",placement:"Modal",platforms:["desktop"],start:r(2024,6,18),end:r(2025,6,18),custom_dismissal:!0,show_on_startup:!0},{name:"ai_google_drive_universal_qna_announcement",placement:"Modal",platforms:["desktop"],start:r(2024,8,14),end:r(2024,11,14),custom_dismissal:!0,show_on_startup:!0},{name:"ai_assistant_announcement",placement:"Modal",platforms:["desktop"],start:r(2024,6,18),end:r(2025,6,18),show_on_startup:!0},{name:"dummy_modal",placement:"Modal",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"notion_calendar_launch_promo",placement:"Modal",platforms:["desktop"],start:r(2024,2,1),end:r(2025,6,15),show_on_startup:!0},{name:"charts_launch_modal",placement:"Modal",platforms:["desktop","mobile-web"],start:r(2024,6,17),end:r(2024,7,28),show_on_startup:!0},{name:"sites_launch_modal",placement:"Modal",platforms:["desktop"],start:o.ou.fromISO("June 25 2024").toMillis(),end:o.ou.fromISO("June 25 2025").toMillis(),show_on_startup:!0},{name:"charts_ga_launch_modal",placement:"Modal",platforms:["desktop","mobile-web"],start:r(2024,8,5),end:r(2024,9,13),show_on_startup:!0},{name:"page_layouts_intro_modal",placement:"Modal",platforms:["desktop"],start:r(2024,7,24),end:r(2024,9,15),show_on_startup:!0},{name:"forms_beta_launch_modal",placement:"Modal",platforms:["desktop"],start:r(2024,8,19),end:r(2024,10,1),show_on_startup:!0},{name:"desktop_download_sidebar",placement:"SidebarFooter",platforms:["desktop"],start:i,end:r(2024,10,23),show_on_startup:!0},{name:"mwn_announcement",placement:"SidebarFooter",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"configure_retention_sidebar",placement:"SidebarFooter",platforms:["desktop"],start:i,end:a},{name:"student_org_prompt",placement:"SidebarFooter",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"block_limit_nudge",placement:"SidebarFooter",platforms:["desktop"],start:i,end:a,custom_dismissal:!0,show_on_startup:!0},{name:"ai_limit_nudge",placement:"SidebarFooter",platforms:["desktop"],start:i,end:a,custom_dismissal:!0,show_on_startup:!0},{name:"sidebar_upgrade_nudge",placement:"SidebarFooter",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"startup_sidebar_footer",placement:"SidebarFooter",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"calendar_launch_prompt",placement:"SidebarFooter",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"share_button_tooltip",placement:"Tooltip",platforms:["desktop"],start:i,end:a},{name:"open_in_calendar_tooltip",placement:"Tooltip",platforms:["desktop"],start:i,end:a},{name:"ai_google_drive_qna_notification_tooltip",placement:"Tooltip",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"ai_slack_qna_notification_tooltip",placement:"Tooltip",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"ai_sales_assisted_notification_tooltip",placement:"Tooltip",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"ai_assistant_origin_element_tooltip",placement:"Tooltip",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"ai_assistant_reminder_tooltip",placement:"Tooltip",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"ai_slack_qna_embed_tooltip",placement:"Tooltip",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"layout_customize_layout_button_tooltip",placement:"Tooltip",platforms:["desktop"],start:i,end:a},{name:"language_switch_prompt",placement:"Tooltip",platforms:["desktop"],start:i,end:a,custom_dismissal:!0,show_on_startup:!0},{name:"asana_post_import_tour",placement:"Tooltip",platforms:["desktop"],start:i,end:a,show_on_startup:!0},{name:"forms_share_form_tooltip",placement:"Tooltip",platforms:["desktop"],start:i,end:a}],l=["Modal","SidebarFooter","Tooltip"],c=s,d=c.map((e=>e.name)),u=new Set(d),p=c.reduce(((e,t)=>({...e,[t.name]:t})),{});function m(e){return p[e].placement}function g(e){const t=d.indexOf(e);return-1===t?Number.POSITIVE_INFINITY:t}function f(e){if(e)return u.has(e)?e:void 0}function h(e){if(e.isDesktop)return"desktop";if(e.isMobileBrowser)return"mobile-web";if(e.isApple)return"mobile-ios";if(e.isAndroid)return"mobile-android";throw new Error(`Unsupported device: ${e}`)}},606906:(e,t,n)=>{function o(e){return e||(e=""),e.split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}n.d(t,{Z:()=>o})},107289:(e,t,n)=>{n.d(t,{HT:()=>g,K0:()=>s,_i:()=>v,dq:()=>l,ib:()=>d});var o=n(435011),r=n(114714),i=n(180951),a=n(830420);function s(e){let{collectionSchema:t,axisChartType:n}=e;const o=c({collectionSchema:t});if(!o)return;const r=d({property:o,collectionSchema:t,hideEmptyGroups:!1});if(!r)return;const i="formula"===r.type?r.groupBy.sort:r.sort;let s="column";switch(n){case"bar":s="bar";break;case"line":s="line";break;case"column":case void 0:s="column"}return{chartFormat:{axisHideEmptyGroups:r.hideEmptyGroups,mainSort:(0,a.H9)(i)},type:n??"column",dataConfig:{type:"groups_reducer",groupBy:r,aggregationConfig:{aggregation:{aggregator:"count"},seriesFormat:{displayType:s},stackOptions:void 0}}}}function l(e){let{collectionSchema:t}=e;const n=c({collectionSchema:t});if(!n)return;const o=d({property:n,collectionSchema:t,hideEmptyGroups:!0});if(!o)return;const r=(0,i.Qm)({schema:t,property:n});if(!r)return;const s="formula"===o.type?o.groupBy.sort:o.sort;return{chartFormat:{axisHideEmptyGroups:o.hideEmptyGroups,mainSort:r&&(0,a.jn)(r)?a.MN.yDescending:(0,a.H9)(s)},type:"donut",dataConfig:{type:"groups_reducer",groupBy:o,aggregationConfig:{aggregation:{aggregator:"count"}}}}}function c(e){let{collectionSchema:t}=e;return Object.keys(t).filter((e=>{const n=(0,i.Qm)({schema:t,property:e});return!!n&&(0,r.LG)(n)})).sort(((e,n)=>function(e,t,n){const o=(0,i.Qm)({schema:n,property:e}),a=(0,i.Qm)({schema:n,property:t});if(!(o&&(0,r.sM)(o.type)&&a&&(0,r.sM)(a.type)))return 0;const s=u[o.type],l=u[a.type];return void 0===s||void 0===l?0:s-l}(e,n,t)))[0]}function d(e){let{property:t,collectionSchema:n,hideEmptyGroups:a}=e;const s=(0,i.Qm)({schema:n,property:t});if(s&&(0,r.LG)(s)){if((0,r.A1)(s.type))return{type:s.type,property:t,groupBy:"day",sort:{type:"ascending"}};if("number"===s.type)return{type:s.type,property:t,groupBy:{type:"unique"},start:-1,end:-1,size:-1,sort:{type:"ascending"}};if("formula"===s.type){const e=(0,o.mm)(s);if("number"===e)return{type:"formula",property:t,groupBy:{type:"number",groupBy:{type:"unique"},start:-1,end:-1,size:-1,sort:{type:"ascending"}}};if("date"===e)return{type:s.type,property:t,groupBy:{type:"date",groupBy:"day",sort:{type:"ascending"}}}}return(0,r.fw)({property:t,propertySchema:s,hideEmptyGroups:a})}}const u={select:0,multi_select:0,status:0,date:1,number:1,person:1,relation:2,checkbox:3,created_time:3,created_by:3,last_edited_by:3,last_edited_time:3,last_visited_time:3,text:3,title:3,url:4,email:4,phone_number:4,formula:5},p=["title","text"];function m(e){return p.includes(e)}function g(e){if("formula"===e.type){const t=(0,o.mm)(e);return"array"!==t&&"block"!==t&&"unknown"!==t&&m(t)}return m(e.type)}const f=["number"];function h(e){return f.includes(e)}function v(e){if("formula"===e.type){const t=(0,o.mm)(e);return"array"!==t&&"block"!==t&&"unknown"!==t&&h(t)}return h(e.type)}},830420:(e,t,n)=>{n.d(t,{H9:()=>i,MN:()=>r,jn:()=>a});var o=n(399036);let r=function(e){return e.manual="manual",e.resultsAdvanced="results-advanced",e.yAscending="y-ascending",e.yDescending="y-descending",e.xAscending="x-ascending",e.xDescending="x-descending",e}({});function i(e){switch(null==e?void 0:e.type){case"manual":return r.manual;case"descending":return r.xDescending;default:return r.xAscending}}function a(e){return!(0,o.Lt)(e)}},164945:(e,t,n)=>{function o(e){return r(e.type)}function r(e){return"column"===e||"bar"===e||"line"===e}n.d(t,{F:()=>r,u:()=>o})},117397:(e,t,n)=>{n.d(t,{A$:()=>p,Ge:()=>u,L9:()=>m,Q3:()=>l,X0:()=>c,Xl:()=>d,aX:()=>g});var o=n(401898),r=n(619584);const i={ABAP:!0,Agda:!0,Arduino:!0,Assembly:!0,Bash:!0,BASIC:!0,BNF:!0,C:!0,"C#":!0,"C++":!0,Clojure:!0,CoffeeScript:!0,Coq:!0,CSS:!0,Dart:!0,Dhall:!0,Diff:!0,Docker:!0,EBNF:!0,Elixir:!0,Elm:!0,Erlang:!0,"F#":!0,Flow:!0,Fortran:!0,Gherkin:!0,GLSL:!0,Go:!0,GraphQL:!0,Groovy:!0,Haskell:!0,HTML:!0,Idris:!0,Java:!0,JavaScript:!0,JSON:!0,Julia:!0,Kotlin:!0,LaTeX:!0,Less:!0,Lisp:!0,LiveScript:!0,"LLVM IR":!0,Lua:!0,Makefile:!0,Markdown:!0,Markup:!0,MATLAB:!0,Mathematica:!0,Mermaid:!0,Nix:!0,"Notion Formula":!0,"Objective-C":!0,OCaml:!0,Pascal:!0,Perl:!0,PHP:!0,"Plain Text":!0,PowerShell:!0,Prolog:!0,Protobuf:!0,PureScript:!0,Python:!0,R:!0,Racket:!0,Reason:!0,Ruby:!0,Rust:!0,Sass:!0,Scala:!0,Scheme:!0,Scss:!0,Shell:!0,Solidity:!0,SQL:!0,Swift:!0,TOML:!0,TypeScript:!0,"VB.Net":!0,Verilog:!0,VHDL:!0,"Visual Basic":!0,WebAssembly:!0,XML:!0,YAML:!0,"Java/C/C++/C#":!0},a={abap:"ABAP",agda:"Agda",ino:"Arduino",s:"Assembly",bash:"Bash",sh:"Bash",basic:"BASIC",bnf:"BNF",c:"C",cs:"C#",cpp:"C++",clojure:"Clojure",clj:"Clojure",coffee:"CoffeeScript",coq:"Coq",css:"CSS",dart:"Dart",dhall:"Dhall",diff:"Diff",dockerfile:"Docker",ebnf:"EBNF",elixir:"Elixir",elm:"Elm",erlang:"Erlang",erl:"Erlang",fsharp:"F#",fs:"F#",flow:"Flow",fortran:"Fortran",f90:"Fortran",gherkin:"Gherkin",feature:"Gherkin",glsl:"GLSL",go:"Go",graphql:"GraphQL",groovy:"Groovy",hs:"Haskell",haskell:"Haskell",html:"HTML",idr:"Idris",java:"Java",js:"JavaScript",jsx:"JavaScript",json:"JSON",julia:"Julia",jl:"Julia",kt:"Kotlin",tex:"LaTeX",less:"Less",lisp:"Lisp",ls:"LiveScript",llvm:"LLVM IR",lua:"Lua",mk:"Makefile",makefile:"Makefile",md:"Markdown",markdown:"Markdown",markup:"Markup",matlab:"MATLAB",m:"MATLAB",mathematica:"Mathematica",nb:"Mathematica",mermaid:"Mermaid",nix:"Nix",notion:"Notion Formula",mli:"OCaml",ml:"OCaml",pascal:"Pascal",pl:"Perl",perl:"Perl",php:"PHP",ps1:"PowerShell",psm1:"PowerShell",prolog:"Prolog",proto:"Protobuf",purs:"PureScript",py:"Python",r:"R",rkt:"Racket",racket:"Racket",re:"Reason",rei:"Reason",rb:"Ruby",ruby:"Ruby",rs:"Rust",rust:"Rust",sass:"Sass",scss:"Scss",scala:"Scala",scheme:"Scheme",scm:"Scheme",shen:"Shell",shell:"Shell",solidity:"Solidity",sol:"Solidity",sql:"SQL",swift:"Swift",toml:"TOML",ts:"TypeScript",tsx:"TypeScript",vb:"VB.Net",vbs:"VB.Net",verilog:"Verilog",v:"Verilog",vhdl:"VHDL","visual-basic":"Visual Basic",vbnet:"Visual Basic",wasm:"WebAssembly",wat:"WebAssembly",xml:"XML",yaml:"YAML",yml:"YAML",txt:"Plain Text",log:"Plain Text",cfg:"Plain Text",ini:"Plain Text",conf:"Plain Text",jsonc:"JSON",bat:"Shell",cmd:"Shell",ps:"Shell",bashrc:"Shell",bash_profile:"Shell",gitignore:"Plain Text",gitattributes:"Plain Text",npmrc:"Plain Text",yarnrc:"Plain Text",editorconfig:"Plain Text",eslintrc:"JSON",prettierrc:"JSON",stylelintrc:"JSON",babelrc:"JSON",webpack:"JavaScript"},s=["Mermaid"];function l(e){return(0,o.DE)(s,e)}const c=(0,o.Yd)(i),d=(0,r.m8)((0,o.qP)(i).map((e=>{let[t]=e;return[t.toLowerCase(),t]}))),u=(0,r.Jd)(d),p=(0,o.Yd)(d),m=((0,o.AO)((e=>(0,o.qg)(a,e)?{true:e}:{false:e})),(0,o.AO)((e=>(0,o.qg)(i,e)&&Boolean(i[e])?{true:e}:{false:e}))),g=(0,o.AO)((e=>(0,o.qg)(d,e)&&Boolean(d[e])?{true:e}:{false:e}))},482545:(e,t,n)=>{n.d(t,{m:()=>o});const o=1e3},202032:(e,t,n)=>{n.d(t,{Ag:()=>V,Bf:()=>_,Ei:()=>re,FN:()=>ie,Fw:()=>I,GW:()=>Z,HK:()=>g,Mv:()=>se,O4:()=>oe,OK:()=>T,OV:()=>E,Pz:()=>ee,Sy:()=>h,W6:()=>j,Ys:()=>R,_M:()=>v,cY:()=>F,dN:()=>ae,en:()=>M,f8:()=>x,gC:()=>A,gu:()=>D,iV:()=>ne,k$:()=>b,nC:()=>S,o5:()=>p,pI:()=>q,pK:()=>B,sl:()=>m,tD:()=>k,vX:()=>le,yd:()=>K});n(757658);var o=n(401898),r=n(619584),i=n(576205),a=n(830823),s=n(435011),l=n(399036),c=n(407057),d=n(253877),u=n(959753);const p=["count"];function m(e){return"count"===e}function g(e){return m(e.aggregator)}const f={count_values:!0,unique:!0,empty:!0,not_empty:!0,percent_empty:!0,percent_not_empty:!0,show_unique:!0},h=(0,r.XP)(f);function v(e){return"string"==typeof e?Boolean(f[e]):"object"==typeof e?Boolean(f[e.operator]):void(0,o.t1)(e)}const y={sum:!0,average:!0,median:!0,min:!0,max:!0,range:!0},b=(0,r.XP)(y);function _(e){return"string"==typeof e?Boolean(y[e]):"object"==typeof e?Boolean(y[e.operator]):void(0,o.t1)(e)}function S(e){return _(e.aggregator)}const k=(0,r.XP)({unique:!0,count_values:!0}),w={earliest_date:!0,latest_date:!0,date_range:!0},x=(0,r.XP)(w);function I(e){return"string"==typeof e?Boolean(w[e]):"object"==typeof e?Boolean(w[e.operator]):void(0,o.t1)(e)}const C={count_per_group:!0,percent_per_group:!0},T=(0,r.XP)(C);function M(e){return Boolean(C[e.operator])}const P={checked:!0,unchecked:!0,percent_checked:!0,percent_unchecked:!0},A=(0,r.XP)(P);function R(e){return"string"==typeof e?Boolean(P[e]):"object"==typeof e?Boolean(P[e.operator]):void(0,o.t1)(e)}function D(e){return M(e)?e.operator:e}function B(e){return!m(e.aggregator)}function E(e){return"string"==typeof e.aggregator?e.aggregator:"object"==typeof e.aggregator?e.aggregator.operator:void(0,o.t1)(e)}const F={count_aggregations:["count","count_values","unique","empty","not_empty","checked","unchecked","count_per_group"],percent_aggregations:["percent_empty","percent_not_empty","percent_checked","percent_unchecked","percent_per_group"],statistics_aggregations:["sum","average","median","min","max","range"],date_aggregations:["earliest_date","latest_date","date_range"],rollup_aggregations:["show_unique"]},Z=100,U={text:{show_unique:!0,count:!0,count_values:!0,unique:!0,empty:!0,not_empty:!0,percent_empty:!0,percent_not_empty:!0},checkbox:{count:!0,checked:!0,unchecked:!0,percent_checked:!0,percent_unchecked:!0},select:{show_unique:!0,count:!0,count_values:!0,unique:!0,empty:!0,not_empty:!0,percent_empty:!0,percent_not_empty:!0},multi_select:{show_unique:!0,count:!0,count_values:!0,unique:!0,empty:!0,not_empty:!0,percent_empty:!0,percent_not_empty:!0},status:{show_unique:!0,count:!0,count_values:!0,unique:!0,empty:!0,not_empty:!0,percent_empty:!0,percent_not_empty:!0,count_per_group:!0,percent_per_group:!0},relation:{show_unique:!0,count:!0,count_values:!0,unique:!0,empty:!0,not_empty:!0,percent_empty:!0,percent_not_empty:!0},person:{show_unique:!0,count:!0,count_values:!0,unique:!0,empty:!0,not_empty:!0,percent_empty:!0,percent_not_empty:!0},location:{count:!0,count_values:!0,unique:!0},number:{show_unique:!0,count:!0,count_values:!0,unique:!0,empty:!0,not_empty:!0,percent_empty:!0,percent_not_empty:!0,sum:!0,average:!0,median:!0,min:!0,max:!0,range:!0},date:{show_unique:!0,count:!0,count_values:!0,unique:!0,empty:!0,not_empty:!0,percent_empty:!0,percent_not_empty:!0,earliest_date:!0,latest_date:!0,date_range:!0},file:{show_unique:!0,count:!0,count_values:!0,unique:!0,empty:!0,not_empty:!0,percent_empty:!0,percent_not_empty:!0},verification:{}};function V(e,t){return"string"==typeof t?Boolean(U[e][t]):"object"==typeof t?Boolean(U[e][t.operator]):void(0,o.t1)(t)}const N={count:()=>({type:"count",count:0}),count_values:()=>({type:"count_values",count:0}),empty:()=>({type:"empty",empty:0}),not_empty:()=>({type:"not_empty",filled:0}),unique:()=>({type:"unique",values:new Set}),show_unique:()=>({type:"show_unique",values:new Set}),percent_empty:()=>({type:"percent_empty",count:0,empty:0}),percent_not_empty:()=>({type:"percent_not_empty",count:0,filled:0}),sum:()=>({type:"sum",sum:0}),average:()=>({type:"average",count:0,sum:0}),median:()=>({type:"median",values:[]}),min:()=>({type:"min",min:void 0}),max:()=>({type:"max",max:void 0}),range:()=>({type:"range",min:void 0,max:void 0}),earliest_date:()=>({type:"earliest_date",min:void 0}),latest_date:()=>({type:"latest_date",max:void 0}),date_range:()=>({type:"date_range",min:void 0,max:void 0}),checked:()=>({type:"checked",checked:0}),unchecked:()=>({type:"unchecked",unchecked:0}),percent_checked:()=>({type:"percent_checked",count:0,checked:0}),percent_unchecked:()=>({type:"percent_unchecked",count:0,unchecked:0}),count_per_group:e=>{let{groupName:t}=e;return{type:"count_per_group",statusGroup:t,groupCount:0,total:0}},percent_per_group:e=>{let{groupName:t}=e;return{type:"percent_per_group",statusGroup:t,groupCount:0,total:0}}},O=((0,o.Yd)(N),{count:"number",count_values:"number",empty:"number",not_empty:"number",unique:"number",percent_empty:"number",percent_not_empty:"number",sum:"number",average:"number",median:"number",min:"number",max:"number",range:"number",checked:"number",unchecked:"number",percent_checked:"number",percent_unchecked:"number",earliest_date:"date",latest_date:"date",date_range:"date",show_unique:"number",count_per_group:"text",percent_per_group:"number"}),L={userId:void 0,userStartOfWeek:0};function j(e){return O[e]}function K(e){return"string"==typeof e?N[e]([]):"object"==typeof e?N[e.operator]({groupName:e.groupName}):void(0,o.t1)(e)}function z(e){const{state:t,filterValue:n}=e,o=J[t.type][n.type];o&&o(e)}function q(e){const{state:t,aggregation:n,collectionRequestContext:o}=e,{userTimeZone:r,intl:i}=o;if(g(n))z({filterValue:{type:"text",value:void 0},state:t,userTimeZone:r,intl:i});else if(B(n)){const{property:o}=n,{block:s,getRecordModel:l,collectionRequestContext:c,...d}=e,p=(0,a.FT)({...d,block:u.kk5.fromBlock(s),getRecordModel:l,property:o,collectionRequestContext:{...c,depth:c.depth+1}});for(const e of p)"verification"!==e.type&&z({filterValue:e,state:t,userTimeZone:r,intl:i})}}function H(e){e.state.count+=1}function G(e){(0,i.nS)({filter:{operator:"is_empty"},...L,...e,filterType:e.filterValue.type,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0})(e.filterValue)&&(e.state.empty+=1)}function W(e){(0,i.nS)({filter:{operator:"is_not_empty"},...L,...e,filterType:e.filterValue.type,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0})(e.filterValue)&&(e.state.filled+=1)}function $(e){const t=(0,i.nS)({filter:{operator:"is_empty"},...L,...e,filterType:e.filterValue.type,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0})(e.filterValue);e.state.count+=1,t&&(e.state.empty+=1)}function Y(e){const t=(0,i.nS)({filter:{operator:"is_not_empty"},...L,...e,filterType:e.filterValue.type,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0})(e.filterValue);e.state.count+=1,t&&(e.state.filled+=1)}const Q={number:e=>{const t=e.filterValue;void 0===t.value||isNaN(t.value)||e.state.values.add(t.value.toString())},text:e=>{const t=e.filterValue;void 0!==t.value&&t.value.length>0&&e.state.values.add(t.value)},select:e=>{const t=e.filterValue;void 0!==t.value&&e.state.values.add(t.value)},multi_select:e=>{const t=e.filterValue;if(void 0!==t.value)for(const n of t.value)e.state.values.add(n)},status:e=>{const t=e.filterValue;void 0!==t.option&&e.state.values.add(t.option)},relation:e=>{const t=e.filterValue;if(void 0!==t.value)for(const n of t.value)e.state.values.add(n.id)},person:e=>{const t=e.filterValue;if(void 0!==t.value)for(const n of t.value)e.state.values.add(n.id)},location:e=>{const t=e.filterValue;void 0!==t.value&&e.state.values.add(t.value.id)},date:e=>{const t=e.filterValue;void 0!==t.value&&e.state.values.add(c.ZV({allowRelativeDates:!1,value:t.value,userTimeZone:e.userTimeZone,intl:e.intl}))},file:e=>{const t=e.filterValue;if(void 0!==t.value)for(const n of t.value)e.state.values.add(n)}},J={count:{number:H,text:H,select:H,multi_select:H,status:H,relation:H,person:H,date:H,file:H,location:H,checkbox:H},count_values:{number:e=>{void 0!==e.filterValue.value&&(e.state.count+=1)},text:e=>{const t=e.filterValue;void 0!==t.value&&t.value.length>0&&(e.state.count+=1)},select:e=>{void 0!==e.filterValue.value&&(e.state.count+=1)},multi_select:e=>{const t=e.filterValue;void 0!==t.value&&(e.state.count+=t.value.length)},status:e=>{void 0!==e.filterValue.option&&(e.state.count+=1)},relation:e=>{const t=e.filterValue;void 0!==t.value&&(e.state.count+=t.value.length)},person:e=>{const t=e.filterValue;void 0!==t.value&&(e.state.count+=t.value.length)},date:e=>{void 0!==e.filterValue.value&&(e.state.count+=1)},file:e=>{const t=e.filterValue;void 0!==t.value&&(e.state.count+=t.value.length)},location:e=>{void 0!==e.filterValue.value&&(e.state.count+=1)}},show_unique:Q,unique:Q,empty:{number:G,text:G,select:G,multi_select:G,status:G,relation:G,person:G,date:G,file:G},not_empty:{number:W,text:W,select:W,multi_select:W,status:W,relation:W,person:W,date:W,file:W},percent_empty:{number:$,text:$,select:$,multi_select:$,status:$,relation:$,person:$,date:$,file:$},percent_not_empty:{number:Y,text:Y,select:Y,multi_select:Y,status:Y,relation:Y,person:Y,date:Y,file:Y},sum:{number:e=>{const t=e.filterValue.value;void 0===t||isNaN(t)||(e.state.sum+=t)}},average:{number:e=>{const t=e.filterValue.value;void 0===t||isNaN(t)||(e.state.count+=1,e.state.sum+=t)}},median:{number:e=>{const t=e.filterValue.value;void 0===t||isNaN(t)||e.state.values.push(t)}},min:{number:e=>{const t=e.filterValue.value;void 0===t||isNaN(t)||(void 0===e.state.min||t<e.state.min)&&(e.state.min=t)}},max:{number:e=>{const t=e.filterValue.value;void 0===t||isNaN(t)||(void 0===e.state.max||t>e.state.max)&&(e.state.max=t)}},range:{number:e=>{const t=e.filterValue.value;void 0===t||isNaN(t)||((void 0===e.state.min||t<e.state.min)&&(e.state.min=t),(void 0===e.state.max||t>e.state.max)&&(e.state.max=t))}},checked:{checkbox:function(e){(0,i.nS)({filter:{operator:"checkbox_is",value:{type:"exact",value:!0}},...L,...e,filterType:e.filterValue.type,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0})(e.filterValue)&&(e.state.checked+=1)}},unchecked:{checkbox:function(e){(0,i.nS)({filter:{operator:"checkbox_is",value:{type:"exact",value:!1}},...L,...e,filterType:e.filterValue.type,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0})(e.filterValue)&&(e.state.unchecked+=1)}},percent_checked:{checkbox:function(e){const t=(0,i.nS)({filter:{operator:"checkbox_is",value:{type:"exact",value:!0}},...L,...e,filterType:e.filterValue.type,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0})(e.filterValue);e.state.count+=1,t&&(e.state.checked+=1)}},percent_unchecked:{checkbox:function(e){const t=(0,i.nS)({filter:{operator:"checkbox_is",value:{type:"exact",value:!1}},...L,...e,filterType:e.filterValue.type,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0})(e.filterValue);e.state.count+=1,t&&(e.state.unchecked+=1)}},date_range:{date:e=>{const t=e.filterValue.value,n=e.state;if(void 0!==t){const o=d.NK(t,e.userTimeZone);(void 0===n.min||o.start<n.min)&&(n.min=o.start);const r=o.end??o.start;(void 0===n.max||n.max<r)&&(n.max=r)}}},earliest_date:{date:e=>{const t=e.filterValue.value,n=e.state;if(void 0!==t){const o=d.NK(t,e.userTimeZone);(void 0===n.min||o.start<n.min)&&(n.min=o.start)}}},latest_date:{date:e=>{const t=e.filterValue.value,n=e.state;if(void 0!==t){const o=d.NK(t,e.userTimeZone),r=o.end??o.start;(void 0===n.max||n.max<r)&&(n.max=r)}}},count_per_group:{status:function(e){(0,i.nS)({filter:{operator:"status_is",value:{type:"is_group",value:e.state.statusGroup}},...L,...e,filterType:e.filterValue.type,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0})(e.filterValue)&&(e.state.groupCount+=1),e.state.total+=1}},percent_per_group:{status:function(e){(0,i.nS)({filter:{operator:"status_is",value:{type:"is_group",value:e.state.statusGroup}},...L,...e,filterType:e.filterValue.type,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0})(e.filterValue)&&(e.state.groupCount+=1),e.state.total+=1}}},X={count:e=>({type:"number",value:e.count}),count_values:e=>({type:"number",value:e.count}),empty:e=>({type:"number",value:e.empty}),not_empty:e=>({type:"number",value:e.filled}),unique:e=>({type:"number",value:e.values.size}),show_unique:e=>({type:"number",value:e.values.size}),percent_empty:e=>({type:"number",value:0===e.count?void 0:e.empty/e.count}),percent_not_empty:e=>({type:"number",value:0===e.count?void 0:e.filled/e.count}),sum:e=>({type:"number",value:e.sum}),average:e=>({type:"number",value:0===e.count?void 0:e.sum/e.count}),median:e=>({type:"number",value:te(e.values)}),min:e=>({type:"number",value:e.min}),max:e=>({type:"number",value:e.max}),range:e=>({type:"number",value:void 0!==e.max&&void 0!==e.min?e.max-e.min:void 0}),checked:e=>({type:"number",value:e.checked}),unchecked:e=>({type:"number",value:e.unchecked}),percent_checked:e=>({type:"number",value:0===e.count?void 0:e.checked/e.count}),percent_unchecked:e=>({type:"number",value:0===e.count?void 0:e.unchecked/e.count}),earliest_date:e=>({type:"date",value:e.min?d.LH(e.min):void 0}),latest_date:e=>({type:"date",value:e.max?d.LH(e.max):void 0}),date_range:e=>{if(void 0===e.max||void 0===e.min)return{type:"date",value:void 0};return{type:"date",value:d.iC(e.min.valueOf(),e.max.valueOf(),e.min.zoneName)}},count_per_group:e=>({type:"text",value:`${e.groupCount}/${e.total}`}),percent_per_group:e=>({type:"number",value:0===e.total?void 0:e.groupCount/e.total})};function ee(e){return(0,X[e.type])(e)}function te(e){if(e.sort((function(e,t){return e-t})),0===e.length)return 0;const t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2}function ne(e){return!(se(e)||re(e)||ie(e)||l.Eu.includes(e.type))}function oe(e){return"number"===e.type||"number"===(0,s.mm)(e)||"rollup"===e.type&&e.aggregation&&"number"===j(D(e.aggregation))}function re(e){return"status"===e.type}function ie(e){return"location"===e.type}function ae(e){return(0,l.Lt)(e)||"date"===(0,s.mm)(e)||"rollup"===e.type&&e.aggregation&&"date"===j(D(e.aggregation))}function se(e){return"checkbox"===e.type||"checkbox"===(0,s.mm)(e)}function le(e){return"count"===e||"count_values"===e||"unique"===e||"empty"===e||"not_empty"===e}},990559:(e,t,n)=>{n.d(t,{$z:()=>d,FT:()=>c,Y7:()=>s,cj:()=>l,wf:()=>a});var o=n(653965),r=n(399036),i=n(524836);function a(e,t){return!o.hj(t)||isNaN(t)?"":e?`${e}-${t}`:`${t}`}function s(e){const{spaceId:t}=e;return{table:"record_counter",id:(0,i.Sr)(e),spaceId:t}}function l(e){return c(e).length>0}function c(e){return[...d((0,r.oC)({id:e.id,format:e.format,space_id:e.space_id,schema:e.schema})),...d((0,r.Dv)({deleted_schema:e.deleted_schema}))]}function d(e){return Object.entries(e).filter((e=>{let[t,n]=e;return n&&"auto_increment_id"===n.type})).map((e=>{let[t]=e;return t}))}},514248:(e,t,n)=>{n.d(t,{Ko:()=>P,ND:()=>E,RA:()=>C,WL:()=>B,Xq:()=>L,hz:()=>j,r9:()=>q,wg:()=>K,zk:()=>T});n(757658);var o=n(653965),r=n(401898),i=n(576205),a=n(830823),s=n(114714),l=n(399036),c=n(180951),d=n(10070),u=n(640506),p=n(253877),m=n(471924),g=n(676725),f=n(959753),h=n(433422),v=n(74446),y=n(600606),b=n(421202),_=n(519889),S=n(542297),k=n(421838);function w(e){const t=[],n=[];for(const[o,r]of Object.entries(e))r&&((0,S.S4)(o)||("person"===r.type?t.push(o):"date"===r.type&&n.push(o)));return{date:n,person:t}}const x=k.V3y(", ");function I(e,t){const n={command:"update",args:t,pointer:{table:b.iU,id:e.id},path:["properties"]};return f.kk5.fromValue(e.table,(0,h.lK)(n,e.__IM_SORRY__getValue()))}function C(e){const{block:t,schema:n,propertyMapping:r,filter:a,userFilterContext:s,groupsPointer:l,relativeVariableResult:c,currentPageInRelatedCollection:d,getRecordModel:u,intl:p,resultCache:m}=e,{userId:g,userTimeZone:h,userStartOfWeek:y}=s;let _=t;const S=f.omK.tryUntilFound(f.omK.fromMonomorphicFunctionUnsafe((e=>{let{table:t,id:n}=e;if(t===b.iU&&n===_.id)return _}),v.mF.fromMonomorphicFunctionUnsafe((e=>{let{table:t,id:n}=e;if(t===b.iU&&n===_.id)return _.__IM_SORRY__getValue()}))),u),k={};for(const o of l)Object.assign(k,F({block:_,getRecordModel:S,schema:n,propertyMapping:r,group:o,intl:p,userFilterContext:s,relativeVariableResult:c,currentPageInRelatedCollection:d,resultCache:m})),_=I(t,k);if(a){const e=V({block:_,schema:n,filter:a,propertyMapping:r,userFilterContext:s,relativeVariableResult:c,currentPageInRelatedCollection:d,getRecordModel:u,intl:p,resultCache:m}),o="failsFilter"===e.type||"coercedByFilter"===e.type?e.update??{}:{};Object.assign(k,o),_=I(t,k)}for(const o of l)Object.assign(k,F({block:_,getRecordModel:S,schema:n,propertyMapping:r,group:o,intl:p,userFilterContext:s,relativeVariableResult:c,currentPageInRelatedCollection:d,resultCache:m})),_=I(t,k);const w=I(_,k),x=o.yW(l.map((e=>{const t=T({group:e,propertyMapping:r,schema:n,timeZone:h}),o=t?(0,i.q)({context:{schema:n,userId:g,userTimeZone:h,userStartOfWeek:y,relativeVariableResult:c,currentPageInRelatedCollection:d,intl:p},propertyMapping:r,filter:t}):void 0;return Boolean(o&&o({block:w,getRecordModel:u,propertyMapping:r,resultCache:m}))}))),C=a?(0,i.q)({filter:a,propertyMapping:r,context:{schema:n,userId:g,userTimeZone:h,userStartOfWeek:y,relativeVariableResult:c,currentPageInRelatedCollection:d,intl:p}}):void 0,M=!C||C({block:w,getRecordModel:u,propertyMapping:r,resultCache:m});return{coercionSucceeded:x&&M,update:k}}function T(e){const t=P(e);return t?(0,i.vA)(t)?t:{operator:"and",filters:[t]}:void 0}function M(e,t){var n;return t?(null===(n=d.aQ.fromViewPropertyIds([e.property],t))||void 0===n?void 0:n[0])??e.property:e.property}function P(e){const{schema:t,group:n,propertyMapping:o,timeZone:i}=e,a=M(n,o),l=t[a];if(!l)return;const c=n.value;if((0,s.LG)(l)&&c.type===l.type){if(void 0===c.value)return{property:a,filter:{operator:"is_empty"}};if("select"===l.type)return"string"==typeof c.value?{property:a,filter:{operator:"enum_is",value:{type:"exact",value:c.value}}}:void 0;if("status"===l.type)return void 0!==c.value&&"status"===c.type?{property:a,filter:{operator:"status_is",value:"by_group"===c.value.type?{type:"is_group",value:c.value.group}:{type:"is_option",value:c.value.option}}}:void 0;if((0,s.pd)(l.type))return"object"==typeof c.value&&c.type===l.type?{property:a,filter:{operator:"person_contains",value:{type:"exact",value:c.value}}}:void 0;if("relation"===l.type)return"object"==typeof c.value&&"relation"===c.type?function(e,t){if((0,s.RA)(t.value))return{property:e,filter:{operator:"relation_contains",value:{type:"exact",value:t.value.id}}};if((0,s.t2)(t.value))return{property:e,filter:{operator:"relation_contains",value:{type:"relative",value:{type:"builtin",variable:t.value.value.variable}}}}}(a,c):void 0;if("location"===l.type)return"object"==typeof c.value&&"location"===c.type?{property:a,filter:{operator:"location_is",value:{type:"exact",value:c.value.id}}}:void 0;if("multi_select"===l.type)return"string"==typeof c.value?{property:a,filter:{operator:"enum_contains",value:{type:"exact",value:c.value}}}:void 0;if((0,s.A1)(l.type)){if(c.type!==l.type)return;return A(c.value,a,i)}if((0,s.HB)(l.type)){if(c.type!==l.type)return;return R(c.value,a)}if("number"===l.type){if("number"!==c.type)return;return D(c.value,a)}if("checkbox"===l.type){if("checkbox"!==c.type)return;return{property:a,filter:{operator:"checkbox_is",value:{type:"exact",value:c.value}}}}if("formula"===l.type){if("formula"!==c.type)return;const e=c.value;if(void 0===e.value)return;if((0,s.R7)(e))return R(e.value,a);if("number"===e.type)return D(e.value,a);if("checkbox"===e.type)return{property:a,filter:{operator:"checkbox_is",value:{type:"exact",value:e.value}}};if((0,s.Mc)(e))return A(e.value,a,i);if((0,s.q6)(e))return function(e,t){return{property:e,filter:{operator:"person_contains",value:{type:"exact",value:t.value}}}}(a,e);if((0,s.tL)(e))return(0,s.RA)(e.value)?{property:a,filter:{operator:"relation_contains",value:{type:"exact",value:e.value.id}}}:void 0;(0,r.t1)(e)}(0,r.t1)(l.type)}}function A(e,t,n){const o=(0,s.Hk)(e,n);return{property:t,filter:{operator:"date_is_within",value:{type:"exact",value:p.OQ.toPersistedDateRange(o,n)}}}}function R(e,t){if("alphabet_prefix"===e.type){const n=e.value;return isNaN(parseInt(n))?{operator:"or",filters:[{property:t,filter:{operator:"string_starts_with",value:{type:"exact",value:e.value.toUpperCase()}}},{property:t,filter:{operator:"string_starts_with",value:{type:"exact",value:e.value.toLowerCase()}}}]}:{property:t,filter:{operator:"string_starts_with",value:{type:"exact",value:e.value}}}}return"other"===e.type?{property:t,filter:{operator:"string_has_no_alphabet_prefix"}}:"exact"===e.type?{property:t,filter:{operator:"string_is",value:{type:"exact",value:e.value}}}:void(0,r.t1)(e)}function D(e,t){if("range"===e.type){const{start:n,end:o}=e;return{operator:"and",filters:[{property:t,filter:{operator:"number_greater_than_or_equal_to",value:{type:"exact",value:n}}},{property:t,filter:{operator:"number_less_than",value:{type:"exact",value:o}}}]}}if("out_of_range"===e.type){const{start:n,end:o}=e;return{operator:"or",filters:[{property:t,filter:{operator:"number_less_than",value:{type:"exact",value:n}}},{property:t,filter:{operator:"number_greater_than_or_equal_to",value:{type:"exact",value:o}}}]}}if("unique"===e.type)return{property:t,filter:{operator:"number_equals",value:{type:"exact",value:e.value}}};(0,r.t1)(e)}function B(e,t){const n=e.property,o=null==t?void 0:t[n];if(null!=o&&o.derived_property_record_metadata)return!1;if(o&&c.A0(o))return!1;const i=e.value;return!i.value||("select"===i.type||"multi_select"===i.type||"status"===i.type||"person"===i.type||"checkbox"===i.type||"relation"===i.type||"date"===i.type||"number"===i.type||((0,s.R7)(i)?"exact"===i.value.type:"formula"!==i.type&&"created_by"!==i.type&&"last_edited_by"!==i.type&&"created_time"!==i.type&&"last_edited_time"!==i.type&&"location"!==i.type&&"last_visited_time"!==i.type&&void(0,r.t1)(i.type)))}function E(e){const{schema:t,propertyMapping:n,group:o,block:i,resultCache:a}=e;if(!B(o,t))return{};const l=function(e){const{schema:t,group:n,propertyMapping:o}=e,i=M(n,o),a=t[i];if(!a)return;const l=n.value;return(0,s.LG)(a)&&l.type===a.type&&void 0!==l.value?"person"===a.type?"object"==typeof l.value&&"person"===l.type?{property:i,filter:{operator:"person_does_not_contain",value:{type:"exact",value:l.value}}}:void 0:"relation"===a.type?"relation"===l.type&&(0,s.RA)(l.value)?{property:i,filter:{operator:"relation_does_not_contain",value:{type:"exact",value:l.value.id}}}:"relation"===l.type&&(0,s.t2)(l.value)?{property:i,filter:{operator:"relation_does_not_contain",value:{type:"relative",value:{type:"builtin",variable:l.value.value.variable}}}}:void 0:"location"===a.type?"object"==typeof l.value&&"location"===l.type?{property:i,filter:{operator:"location_is_not",value:{type:"exact",value:l.value.id}}}:void 0:"multi_select"===a.type?"string"==typeof l.value?{property:i,filter:{operator:"enum_does_not_contain",value:{type:"exact",value:l.value}}}:void 0:void("select"!==a.type&&"status"!==a.type&&"checkbox"!==a.type&&"date"!==a.type&&"text"!==a.type&&"title"!==a.type&&"url"!==a.type&&"email"!==a.type&&"phone_number"!==a.type&&"number"!==a.type&&"formula"!==a.type&&"created_by"!==a.type&&"last_edited_by"!==a.type&&"created_time"!==a.type&&"last_edited_time"!==a.type&&"last_visited_time"!==a.type&&(0,r.t1)(a)):void 0}({schema:t,group:o,propertyMapping:n});if(!l)return{};const c=N({...e,property:l.property,filter:l.filter,schema:t,block:i,resultCache:a});return("failsFilter"===c.type||"coercedByFilter"===c.type)&&c.update||{}}function F(e){const{schema:t,propertyMapping:n,group:o,block:r,userFilterContext:a}=e,{userTimeZone:s}=a;if(!B(o,t))return{};const l=P({schema:t,group:o,propertyMapping:n,timeZone:s});if(!l||!(0,i.aN)(l))return{};const c=N({...e,property:l.property,filter:l.filter,schema:t,block:r});return("failsFilter"===c.type||"coercedByFilter"===c.type)&&c.update||{}}function Z(e){const{dateValue:t,timestamp:n,userTimeZone:o}=e;if("date"===t.type)return{...p.hT(n,o),reminder:t.reminder};if("datetime"===t.type)return{...p.CQ(n,o),reminder:t.reminder};if("daterange"===t.type){const e=p.DF(u.Nh(t),o).valueOf(),r=p.DF(u.v3(t),o).valueOf()-e;return{...p.fZ(n,n+r,o),reminder:t.reminder}}if("datetimerange"===t.type){const e=p.Sy(u.C1(t)).valueOf(),r=p.Sy(u.C1(t)).valueOf()-e;return{...p.iC(n,n+r,o),reminder:t.reminder}}(0,r.t1)(t)}const U={text:function(e){const{filter:t,value:n}=e;if("is_empty"===t.operator)return{type:"text",value:void 0};if("is_not_empty"===t.operator)return;if("string_has_no_alphabet_prefix"===t.operator)return;const o=(t.value.value||"").trim();return"string_is_not"===t.operator||"string_does_not_contain"===t.operator?{type:"text",value:void 0}:"string_is"===t.operator?{type:"text",value:o}:"string_contains"===t.operator||"string_ends_with"===t.operator?{type:"text",value:(n.value||"")+o}:"string_starts_with"===t.operator?{type:"text",value:o+(n.value||"")}:void(0,r.t1)(t.operator)},checkbox:function(e){const{filter:t}=e,n=t.value;return"checkbox_is"===t.operator?{type:"checkbox",value:Boolean(n.value)}:"checkbox_is_not"===t.operator?{type:"checkbox",value:!Boolean(n.value)}:void(0,r.t1)(t.operator)},select:function(e){var t;const{filter:n,propertySchema:o}=e;if("is_empty"===n.operator)return{type:"select",value:void 0};if("is_not_empty"===n.operator)return{type:"select",value:o.options&&o.options.length>0?o.options[0].value:void 0};const a=null===(t=(0,i.mg)(n)[0])||void 0===t?void 0:t.value;return void 0!==a?"enum_is"===n.operator?{type:"select",value:a}:"enum_is_not"===n.operator?{type:"select",value:void 0}:void(0,r.t1)(n.operator):void 0},multi_select:function(e){var t;const{filter:n,propertySchema:o,value:a}=e;if("is_empty"===n.operator)return{type:"multi_select",value:void 0};if("is_not_empty"===n.operator)return{type:"multi_select",value:o.options&&o.options.length>0?[o.options[0].value]:void 0};const s=null===(t=(0,i.qC)(n)[0])||void 0===t?void 0:t.value;if(void 0===s)return;const l=a.value||[];return"enum_contains"===n.operator?{type:"multi_select",value:[...l,s]}:"enum_does_not_contain"===n.operator?{type:"multi_select",value:l.filter((e=>e!==s))}:void(0,r.t1)(n.operator)},status:function(e){const{filter:t,propertySchema:n}=e,o=n.groups??[],a=n.options??[];if("is_empty"===t.operator)return{type:"status",option:void 0,group:void 0};if("is_not_empty"===t.operator)return{type:"status",option:n.options&&n.options.length>0?n.options[0].value:void 0,group:n.groups&&n.groups.length>0?n.groups[0].name:void 0};const s=(0,i.wB)(t);if(0===s.length)return;const l=o.map((e=>{const t=a.filter((t=>{var n;return null===(n=e.optionIds)||void 0===n?void 0:n.includes(t.id)}));return{group:e,groupOptions:t}}));if("status_is"===t.operator){const{type:e,value:t}=s[0];if("is_group"===e){var c;const e=o.findIndex((e=>e.name.toLowerCase()===(null==t?void 0:t.toLowerCase()))),n=e>=0?l[e]:void 0;return{type:"status",group:null==n?void 0:n.group.name,option:null==n||null===(c=n.groupOptions[0])||void 0===c?void 0:c.value}}if("is_option"===e){const e=a.find((e=>e.value===t)),n=e&&o.find((t=>{var n;return null===(n=t.optionIds)||void 0===n?void 0:n.includes(e.id)}));return{type:"status",group:null==n?void 0:n.name,option:null==e?void 0:e.value}}(0,r.t1)(e)}if("status_is_not"===t.operator)return{type:"status",group:void 0,option:void 0};(0,r.t1)(t.operator)},relation:function(e){var t;const{filter:n,value:o,propertySchema:a,relativeVariableResult:s,currentPageInRelatedCollection:l}=e;if("is_empty"===n.operator)return{type:"relation",value:void 0};if("is_not_empty"===n.operator)return;const c=(0,i.YO)(n),d=null===(t=c[0])||void 0===t?void 0:t.type;let u;var p;if("exact"===d)u=null===(p=c[0])||void 0===p?void 0:p.value;else if("relative"===d){var m,g,f;const e=null===(m=a.collection_pointer)||void 0===m?void 0:m.id;if(!e||!s)return;var h;if("builtin"===(null===(g=c[0])||void 0===g?void 0:g.value.type))u=s[e][null===(h=c[0])||void 0===h?void 0:h.value.variable];else"current_page_in_related_collection"===(null===(f=c[0])||void 0===f?void 0:f.value.type)&&(u=l)}if(void 0===u)return;const v=o.value||[];return"relation_contains"===n.operator?{type:"relation",value:[...v,{id:u,table:b.iU,spaceId:0!==v.length?v[0].spaceId:void 0}]}:"relation_does_not_contain"===n.operator?{type:"relation",value:v.filter((e=>e.id!==u))}:void(0,r.t1)(n.operator)},person:function(e){const{filter:t,userFilterContext:n,value:a}=e,{userId:s}=n;if("is_empty"===t.operator)return{type:"person",value:void 0};if("is_not_empty"===t.operator)return s?{type:"person",value:[{table:_.KJ,id:s}]}:void 0;const l=(0,i.R8)(t)[0];if(!l)return;const c=(0,i.l$)({operatorValue:l,userId:s});if(void 0===c)return;const d=a.value||[];return"person_contains"===t.operator?{type:"person",value:[...d,c]}:"person_does_not_contain"===t.operator?{type:"person",value:d.filter((e=>!o.Xy(e,c)))}:void(0,r.t1)(t.operator)},number:function(e){const{filter:t}=e;if("is_empty"===t.operator)return{type:"number",value:void 0};if("is_not_empty"===t.operator)return{type:"number",value:0};const n=t.value.value;return void 0===n||o.i2(n)?void 0:"number_equals"===t.operator||"number_greater_than_or_equal_to"===t.operator||"number_less_than_or_equal_to"===t.operator?{type:"number",value:n}:"number_less_than"===t.operator?{type:"number",value:n-1}:"number_greater_than"===t.operator?{type:"number",value:n+1}:"number_does_not_equal"===t.operator?{type:"number",value:void 0}:void(0,r.t1)(t.operator)},date:function(e){const{filter:t,userFilterContext:n,value:o}=e,{userTimeZone:a,userStartOfWeek:s}=n;if("is_empty"===t.operator)return{type:"date",value:void 0};if("is_not_empty"===t.operator)return{type:"date",value:p.Lg(a)};const l=o.value;if((0,i.TQ)(t)){const e=(0,i.sw)({operatorValue:t.value,userTimeZone:a,userStartOfWeek:s});if(void 0===l){const t=p.Lg(a),n=p.NK(t,a).start.valueOf();return void 0!==e.start&&void 0!==e.end&&n>=e.start&&n<=e.end?{type:"date",value:t}:void 0!==e.start?{type:"date",value:p.hT(e.start,a)}:void 0!==e.end?{type:"date",value:p.hT(e.end,a)}:void 0}const n=p.NK(l,a).start.valueOf();return void 0!==e.end&&n>e.end?{type:"date",value:Z({dateValue:l,timestamp:e.end,userTimeZone:a})}:void 0!==e.start&&n<e.start?{type:"date",value:Z({dateValue:l,timestamp:e.start,userTimeZone:a})}:void 0}const c=t.value,d=(0,i.og)({operatorValue:c,userTimeZone:a});if(void 0!==d){if("date_is"===t.operator||"date_is_on_or_before"===t.operator||"date_is_on_or_after"===t.operator)return l?{type:"date",value:Z({dateValue:l,timestamp:d,userTimeZone:a})}:{type:"date",value:p.hT(d,a)};if("date_is_before"===t.operator){const e=p.Xz({date:d,daysToAdd:-1});return l?{type:"date",value:Z({dateValue:l,timestamp:e,userTimeZone:a})}:{type:"date",value:p.hT(e,a)}}if("date_is_after"===t.operator){const e=p.Xz({date:d,daysToAdd:1});return l?{type:"date",value:Z({dateValue:l,timestamp:e,userTimeZone:a})}:{type:"date",value:p.hT(e,a)}}(0,r.t1)(t.operator)}},file:function(e){const{filter:t}=e;if("is_empty"===t.operator)return{type:"file",value:void 0};"is_not_empty"!==t.operator&&(0,r.t1)(t)},location:()=>{},verification:function(e){const{filter:t}=e;if("verification_is"===t.operator)return{type:"verification",value:void 0};"verification_is_not"!==t.operator&&(0,r.t1)(t.operator)}};function V(e){const{filter:t,block:n,schema:o,propertyMapping:a,userFilterContext:s,relativeVariableResult:l,currentPageInRelatedCollection:c,getRecordModel:d,intl:u,resultCache:p}=e,{userId:m,userTimeZone:g,userStartOfWeek:h}=s,y=t.filters||[];if(0===y.length)return{type:"passesFilter"};if((0,i.q)({context:{schema:o,userId:m,userTimeZone:g,userStartOfWeek:h,relativeVariableResult:l,currentPageInRelatedCollection:c,intl:u},propertyMapping:a,filter:t})({block:n,getRecordModel:d,propertyMapping:a,resultCache:p}))return{type:"passesFilter"};if("or"===t.operator){const e=y.map((e=>(0,i.aN)(e)?N({intl:u,block:n,schema:o,propertyMapping:a,property:e.property,filter:e.filter,userFilterContext:s,getRecordModel:d,relativeVariableResult:l,currentPageInRelatedCollection:c,resultCache:p}):(0,i.Mm)(e)?{type:"failsFilter"}:(0,i.vA)(e)?V({filter:e,intl:u,block:n,schema:o,propertyMapping:a,userFilterContext:s,relativeVariableResult:l,currentPageInRelatedCollection:c,getRecordModel:d,resultCache:p}):void(0,r.t1)(e)));if(e.some((e=>"passesFilter"===e.type)))return{type:"passesFilter"};const t=e.find((e=>"coercedByFilter"===e.type));return t||(e.find((e=>"failsFilter"===e.type))||{type:"failsFilter"})}const _=[...y];_.reverse();let S="passesFilter";const k={};let w=n;const x=f.omK.tryUntilFound(f.omK.fromMonomorphicFunctionUnsafe((e=>{let{table:t,id:n}=e;if(t===b.iU&&n===w.id)return w}),v.mF.fromMonomorphicFunctionUnsafe((e=>{let{table:t,id:n}=e;if(t===b.iU&&n===w.id)return w.__IM_SORRY__getValue()}))),d);for(const r of _){if((0,i.Mm)(r))continue;const e=(0,i.aN)(r)?N({intl:u,block:w,schema:o,propertyMapping:a,property:r.property,filter:r.filter,userFilterContext:s,getRecordModel:x,relativeVariableResult:l,currentPageInRelatedCollection:c,resultCache:p}):V({filter:r,intl:u,block:w,schema:o,propertyMapping:a,userFilterContext:s,relativeVariableResult:l,currentPageInRelatedCollection:c,getRecordModel:x,resultCache:p});"coercedByFilter"===e.type&&"passesFilter"===S&&(S="coercedByFilter"),"failsFilter"===e.type&&(S="failsFilter"),("coercedByFilter"===e.type||"failsFilter"===e.type&&e.update)&&(Object.assign(k,e.update),w=I(n,k))}return"passesFilter"===S?{type:S}:{type:S,update:k}}function N(e){const{filter:t,block:n,property:o,schema:r,propertyMapping:s,userFilterContext:l,getRecordModel:d,relativeVariableResult:u,currentPageInRelatedCollection:p,intl:m,resultCache:g}=e,{userId:f,userTimeZone:h,userStartOfWeek:v}=l;if((0,i.Y1)({context:{schema:r,userId:f,userTimeZone:h,userStartOfWeek:v,relativeVariableResult:u,currentPageInRelatedCollection:p,intl:m},filter:t,property:o,propertyMapping:s,depth:0})({block:n,getRecordModel:d,propertyMapping:s,resultCache:g}))return{type:"passesFilter"};if((0,i.a_)(t))return{type:"failsFilter"};const y=(null==s?void 0:s[o])??o,b=r[y];if(!b)return{type:"failsFilter"};if(!(0,a.BJ)(b))return{type:"failsFilter"};const _=(0,a.vc)(b.type),S=(0,a.ML)({filterValueType:_,block:n,propertyValue:c.wS(n,y,d),propertySchema:b,getRecordModel:d,collectionRequestContext:{userId:f,userTimeZone:h,intl:m,depth:0,visitedProperties:new Set,resultCache:g}}),k=(0,U[_])({filter:t,value:S,propertySchema:b,userFilterContext:l,relativeVariableResult:u,currentPageInRelatedCollection:p});if(void 0===k)return{type:"failsFilter"};return{type:"coercedByFilter",update:{[y]:(0,a.qg)({propertyType:b.type,filterValue:k})}}}function O(e,t){const n=e.name.trim().toLowerCase(),r=t.name.trim().toLowerCase(),i=o.hr(n),a=new RegExp(`^${i}( [0-9]*)?$`,"g"),s=o.hr(r),l=r?new RegExp(`^${s}( [0-9]*)?$`,"g"):void 0;return Boolean(r.match(a)||l&&n.match(l))}function L(e){const{blockProperties:t,oldSchema:n,newSchema:o,typesMatch:r,oldPropertyMapping:i,newPropertyMapping:a}=e,s=Object.keys(n),l=Object.keys(o),c=function(e){const{blockProperties:t,oldSchema:n,newSchema:o}=e,r={},i=null==t?void 0:t.title,a=k.lcG(i),[s]=k.nai(i),{person:[l],date:[c]}=w(o),{person:[d],date:[u]}=w(n);if(l&&(null==t||!t[l])&&!d&&a.length>0){const e=Array.from(new Set(a));r[l]=(0,g.Z)(e.map((e=>k.YCD(k.tEo(e)))),(()=>x))}return!c||null!=t&&t[c]||u||!s||(r[c]=[k.YCD(k.pZr(s))]),r}({blockProperties:t,oldSchema:n,newSchema:o}),u={propertyUpdate:c,newSchema:o},p=["relation","auto_increment_id","verification"];for(const g of s){const e=n[g],s=null==t?void 0:t[g];if(e&&!p.includes(e.type)){if(r){const e=d.aQ.derivePropertyUri(g,i),n=e?null==a?void 0:a[e]:void 0;if(n&&n!==g){u.propertyUpdate[n]=(null==t?void 0:t[g])||null,u.propertyUpdate[g]=null;continue}}if(s){const r=l.find((e=>g===e))||l.find((t=>{const n=o[t];if(void 0!==n&&e.type===n.type)return O(e,n)}));if(r&&u.propertyUpdate)r!==g&&(u.propertyUpdate[r]=t[g]||null,u.propertyUpdate[g]=null);else{const e=m.Il(),o=n[g];u.newSchema={...u.newSchema,[e]:o},u.propertyUpdate&&(u.propertyUpdate[e]=t[g]||null,u.propertyUpdate[g]=null)}}}}return u}function j(e){const{block:t,schema:n,property:i,oldValue:a,newValue:l}=e;if(void 0===a.value)return{};if(void 0===l.value)return{};const d=t.getProperties();if(!d)return{};const u=d[i];if(!u)return{};const p=n[i];if(!p)return{};if(!(0,s.LG)(p))return{};if("status"===p.type||"select"===p.type||"multi_select"===p.type||"checkbox"===p.type)return function(e){const{propertySchema:t,property:n,oldValue:o,newValue:i,propertyValue:a}=e;if(void 0===o.value)return{};if(void 0===i.value)return{};if(!(0,s.LG)(t))return{};if("select"===t.type){if("select"!==o.type||"select"!==i.type)return{};if(void 0===i.value)return{};const e=c.Ak(a);return 0===e.length&&void 0===o.value||e.some((e=>(e||"").trim().toLowerCase()===(o.value||"").trim().toLowerCase()))?{[n]:c.O2(i.value)}:{}}if("multi_select"===t.type){if("multi_select"!==o.type||"multi_select"!==i.type)return{};if(void 0===i.value)return{};const e=c.Ak(a);if(!e.some((e=>e.trim().toLowerCase()===(o.value||"").trim().toLowerCase())))return{};const t=i.value,r=e.map((e=>e.trim().toLowerCase()===(o.value||"").trim().toLowerCase()?t:e));return{[n]:c.zq(r)}}if("status"===t.type){const e=t.groups??[],r=t.options??[];if("checkbox"===o.type&&"status"===i.type){if(c.Ml(a)!==o.value)return{};let t;if("by_group"===i.value.type){const n=i.value.group,o=e.find((e=>e.name===n)),a=r.find((e=>{var t;return e.id===(null==o||null===(t=o.optionIds)||void 0===t?void 0:t[0])}));t=null==a?void 0:a.value}else t=i.value.option;if(t)return{[n]:c.Is(t)}}var l;return"status"===o.type&&"status"===i.type?"by_option"!==o.value.type||"by_option"!==i.value.type||(null===(l=c.Ak(a))||void 0===l?void 0:l[0])!==o.value.option?{}:{[n]:c.Is(i.value.option)}:{}}if("checkbox"===t.type)return"status"!==o.type||"checkbox"!==i.type||"by_option"!==o.value.type?{}:c.Ak(a).includes(o.value.option)?{[n]:c._I(i.value)}:{};(0,r.t1)(t)}({propertySchema:p,property:i,propertyValue:u,oldValue:a,newValue:l});if("person"===p.type){if("person"!==a.type||"person"!==l.type)return{};if(void 0===a.value)return{};if(void 0===l.value)return{};const e=l.value,n=a.value,r=f.kk5.fromBlock(t),s=c.DW({textValue:u,propertySchema:p,blockCreatorPointer:r.getCreatedByPointer()});if(!s.some((e=>o.Xy(e,n))))return{};const d=s.map((t=>o.Xy(t,n)?e:t));return{[i]:c.C1(d)}}if("relation"===p.type){if("relation"!==a.type||"relation"!==l.type||void 0===a.value||void 0===l.value)return{};if((0,s.t2)(a.value)||(0,s.t2)(l.value))return{};const e=l.value,t=a.value,n=c.rq(u);if(!n.some((e=>(0,y.qo)(e,t))))return{};const o=n.map((n=>(0,y.qo)(n,t)?e:n));return{[i]:c.ow(o)}}if((0,s.HB)(p.type)){if(a.type!==p.type||l.type!==p.type||void 0===a.value||void 0===l.value||"exact"!==a.value.type||"exact"!==l.value.type)return{};return k.QaF(u)!==a.value.value?{}:{[i]:(0,k.TPx)(l.value.value)}}if("date"===p.type||"number"===p.type||"formula"===p.type||"created_by"===p.type||"last_edited_by"===p.type||"created_time"===p.type||"last_edited_time"===p.type||"location"===p.type||"last_visited_time"===p.type)return{};(0,r.t1)(p.type)}function K(e){const{block:t,schema:n,property:o,value:r,timeZone:a,intl:l,getRecordModel:c,resultCache:d}=e,u=n[o];if(!u||!(0,s.LG)(u)||t.is_template)return!1;const m=P({schema:n,propertyMapping:void 0,group:{property:o,value:r},timeZone:a});if(!m)return!1;return(0,i.q)({filter:{operator:"and",filters:[m]},propertyMapping:void 0,context:{schema:n,intl:l,userId:void 0,userTimeZone:"UTC",userStartOfWeek:(0,p.aN)(),relativeVariableResult:void 0,currentPageInRelatedCollection:void 0}})({block:t,getRecordModel:c,propertyMapping:void 0,resultCache:d})}const z={Todo:"To-do","To-do":"To-do","To do":"To-do","Not started":"To-do",Backlog:"To-do",Incomplete:"To-do",Waiting:"To-do","On hold":"To-do",Later:"To-do",Blocked:"To-do","In progress":"In progress",Building:"In progress",Designing:"In progress",Research:"In progress",Scoping:"In progress",Planning:"In progress","Needs review":"In progress",Reviewed:"In progress",Review:"In progress",Pending:"In progress",Recurring:"In progress","Review needed":"In progress","Edits needed":"In progress",Editing:"In progress",Complete:"Complete",Completed:"Complete",Done:"Complete",Finished:"Complete",Archive:"Complete",Archived:"Complete",Deleted:"Complete",Published:"Complete",Reverted:"Complete"};function q(e,t,n){var r;const i=(0,l.I4)(e,n),a=i.groups??[],s=i.options??[],c=o.Cw(z,((e,t)=>t.toLowerCase())),d=new Set,u=new Set;for(const o of t){const e=s.findIndex((e=>e.value.toLowerCase()===o.value.toLowerCase()));if(e>-1){const t=s[e];if(!d.has(t.id)){u.add(o.id),d.add(t.id),s[e]={...o,id:t.id};continue}}const t=c[o.value.toLowerCase()],n=a.find((e=>e.name===t));var p;if(n)null===(p=n.optionIds)||void 0===p||p.push(o.id),u.add(o.id)}for(const[o,l]of a.entries()){var m;const e=null===(m=l.optionIds)||void 0===m?void 0:m.some((e=>u.has(e)));l.optionIds=(l.optionIds??[]).filter((t=>!(!u.has(t)&&!d.has(t))||!e))}null==a||null===(r=a[0].optionIds)||void 0===r||r.push(...t.filter((e=>!u.has(e.id))).map((e=>e.id)));const g=[...s,...t],f=[];for(const o of a)for(const e of o.optionIds??[]){const t=g.find((t=>t.id===e));t&&f.push(t)}return{type:"status",name:e,groups:a,options:f}}},668497:(e,t,n)=>{n.d(t,{L:()=>k});var o=n(653965),r=n(307032),i=n(619584),a=n(990559),s=n(435011),l=n(399036),c=n(180951),d=n(334299),u=n(756373),p=n(640506),m=n(407057),g=n(253877),f=n(643593),h=n(335102),v=n(484682),y=n(959753),b=n(882883),_=n(606287),S=n(421838);function k(e){const{schema:t,property:n,block:o}=e,r=t[n];if(!r)return;const i=c.wS(o,n);return(0,x[r.type])({textValue:i,propertySchema:r,...e})}function w(e){const{textValue:t,getRecordModel:n,collectionRequestContext:o}=e,{userTimeZone:r,intl:i}=o;return(0,b.Xh)({textValue:t,getRecordModel:n,userTimeZone:r,intl:i})}const x={title:w,text:w,select:e=>{const{textValue:t,propertySchema:n}=e,o=n.options||[];return c.Sj(t,o)},multi_select:e=>{const{textValue:t,propertySchema:n}=e,o=n.options||[],r=c.uP(t,o);return r.sort(),r.join(",")},status:e=>{const{textValue:t,propertySchema:n}=e;return c.ZG(t,n)},relation:e=>{let{textValue:t,getRecordModel:n,propertySchema:o}=e;if("relation"!==o.type)return"";const i=c.j$({relationValue:c.rq(t),getRecordModel:n,propertySchema:o}).map((e=>`https://www.notion.so/${(0,r.cj)(e.id)}`));return i.sort(),i.join(", ")},rollup:e=>d.kJ({...e,collectionRequestContext:{...e.collectionRequestContext,visitedProperties:new Set}}),url:e=>{let{textValue:t}=e;return c.zB(t)},email:e=>{let{textValue:t}=e;return(0,S.Jcv)(t)},phone_number:e=>{let{textValue:t}=e;return(0,S.Jcv)(t)},checkbox:e=>{let{textValue:t}=e;return c.Ml(t)?l.bx:l.HC},person:e=>{const{textValue:t,getRecordModel:n,propertySchema:r,block:i,collectionRequestContext:a}=e,{intl:s}=a,l=y.kk5.fromBlock(i),d=c.DW({textValue:t,propertySchema:r,blockCreatorPointer:l.getCreatedByPointer()}),u=o.oA(d.map((e=>{const t=n(e);return null==t?void 0:t.getDisplayName(s)})));return u.sort(),u.join(",")},number:e=>{let{textValue:t}=e;const n=c.VY(t);if(void 0!==n)return n.toString()},auto_increment_id:e=>{let{textValue:t,block:n,getRecordModel:o}=e;const r=c.ah(t);if(void 0!==r){const e=y.kk5.fromBlock(n),t=e.getParentTable();if(t!==_.vF)return;const i=o((0,u.We)({spaceId:e.getSpaceId(),parentTable:t,parentId:e.getParentId()}));return(0,a.wf)(null==i?void 0:i.getRecordKey(),r)}},date:e=>{let{textValue:t,propertySchema:n,collectionRequestContext:o}=e;const{userTimeZone:r,intl:i}=o,a=c.Gl(t),{date_format:s,time_format:l}=n;if(a)return(0,m.ZV)({allowRelativeDates:!1,value:a,date_format:s,time_format:l,userTimeZone:r,intl:i})},file:e=>{const t=c.g(e.textValue).map((t=>{if(e.exportedFilePaths&&e.secureFileS3Url&&e.secureFileS3UrlV2&&f.E$(t.url,[e.secureFileS3Url,e.secureFileS3UrlV2])){const e=f.lF(t.url);if(e)return e}return t.url}));return t.sort(),t.join(",")},formula:e=>{const{property:t,schema:n,block:o,getRecordModel:r,collectionRequestContext:a}=e,{userTimeZone:c,intl:d,depth:u,formulaTimeoutTimestampMs:g,logFormulaTimeoutFn:f,resultCache:y}=a,_=n[t];if("v2"===_.version){if(!_.formula2)return;const e=(0,s.EC)({block:o,property:t,formulaCode:_.formula2.code,getRecordModel:r,intl:d,userTimeZone:c,depth:u,visitedProperties:new Set,resultCache:y,formulaTimeoutTimestampMs:g,logFormulaTimeoutFn:f});if(!e)return;const n=(0,h.j4)(e);return(0,b.Xh)({textValue:n,getRecordModel:r,userTimeZone:c,intl:d})}{const e=(0,v.AH)({schema:n,property:t,block:o,getRecordModel:r,collectionRequestContext:{...a,visitedProperties:new Set}});return"boolean"==typeof e?e?l.bx:l.HC:(0,i.hj)(e)?e.toString():p.U3(e)?(0,m.ZV)({allowRelativeDates:!1,value:e,userTimeZone:c,intl:d}):e}},created_time:e=>{const{block:t,collectionRequestContext:n}=e,{userTimeZone:o,intl:r}=n,i=y.kk5.fromBlock(t);if(i.getCreatedTime())return(0,m.ZV)({allowRelativeDates:!1,value:g.CQ(i.getCreatedTime(),o),userTimeZone:o,intl:r})},last_edited_time:e=>{const{block:t,collectionRequestContext:n}=e,{userTimeZone:o,intl:r}=n,i=y.kk5.fromBlock(t);if(i.getLastEditedTime())return(0,m.ZV)({allowRelativeDates:!1,value:g.CQ(i.getLastEditedTime(),o),userTimeZone:o,intl:r})},created_by:e=>{const{block:t,getRecordModel:n,collectionRequestContext:o}=e,{intl:r}=o,i=t.getCreatedByPointer(),a=i&&n(i);return null==a?void 0:a.getDisplayName(r)},last_edited_by:e=>{const{block:t,getRecordModel:n,collectionRequestContext:o}=e,{intl:r}=o,i=t.getLastEditedByPointer(),a=i&&n(i);return null==a?void 0:a.getDisplayName(r)},last_visited_time:()=>"",button:()=>"",location:()=>"",verification:()=>{}}},598953:(e,t,n)=>{n.d(t,{U:()=>o,w:()=>r});const o=" ";function r(e){return e[0]===o}},576205:(e,t,n)=>{n.d(t,{$1:()=>ze,A9:()=>ae,CA:()=>Xe,Fo:()=>at,Gb:()=>te,J5:()=>ut,Js:()=>N,Jw:()=>Te,Ly:()=>I,Mm:()=>Ke,Mp:()=>K,NU:()=>U,OH:()=>ht,Oo:()=>ft,R8:()=>Q,Rf:()=>Be,SH:()=>pt,T:()=>fe,TI:()=>Ue,TQ:()=>D,TX:()=>ve,UG:()=>he,Uz:()=>Oe,W6:()=>we,XA:()=>M,Y1:()=>Ge,YO:()=>G,ZB:()=>Re,_N:()=>Se,aN:()=>je,a_:()=>Ee,bS:()=>ce,c3:()=>ye,dx:()=>B,e:()=>Y,eX:()=>yt,fI:()=>dt,fl:()=>xe,gE:()=>me,h6:()=>re,hh:()=>Ve,je:()=>rt,kk:()=>vt,l$:()=>st,mg:()=>P,mv:()=>ke,nS:()=>Je,og:()=>et,ot:()=>k,q:()=>He,qC:()=>E,r2:()=>j,s9:()=>bt,sw:()=>ot,tO:()=>ie,u0:()=>z,v8:()=>de,vA:()=>Le,vR:()=>Ae,wB:()=>V,xm:()=>Ze,yI:()=>mt});n(757658),n(21703);var o=n(653965),r=n(401898),i=n(619584),a=n(259308),s=n(202032),l=n(830823),c=n(435011),d=n(114714),u=n(399036),p=n(180951),m=n(143690),g=n(334299),f=n(516691),h=n(253877),v=n(335102),y=n(484682),b=n(882883),_=(n(421202),n(519889)),S=n(421838);const k="50vh",w={string_is:!0,string_is_not:!0,string_contains:!0,string_does_not_contain:!0,string_starts_with:!0,string_ends_with:!0,is_empty:!0,is_not_empty:!0,string_has_no_alphabet_prefix:!1},x=(0,i.XP)(w).filter((e=>w[e]));function I(e){return t=e.operator,w.hasOwnProperty(t);var t}const C={checkbox_is:!0,checkbox_is_not:!0},T=(0,i.XP)(C);function M(e){return t=e.operator,Boolean(C[t]);var t}function P(e){return Array.isArray(e.value)?e.value:e.value.value?[e.value]:[]}const A={enum_is:!0,enum_is_not:!0,is_empty:!0,is_not_empty:!0},R=(0,i.XP)(A);function D(e){return"date_is_within"===e.operator||"date_is_relative_to"===e.operator}function B(e){return t=e.operator,Boolean(A[t]);var t}function E(e){return Array.isArray(e.value)?e.value:e.value.value?[e.value]:[]}const F={enum_contains:!0,enum_does_not_contain:!0,is_empty:!0,is_not_empty:!0},Z=(0,i.XP)(F);function U(e){return t=e.operator,Boolean(F[t]);var t}function V(e){return mt(e.value)?[]:Array.isArray(e.value)?e.value:e.value.value?[e.value]:[]}function N(e,t){const n=e.groups??[],o=e.options??[],r=[];for(const i of t)if("is_group"===i.type){const e=n.find((e=>e.name===i.value));if(e){const t=o.filter((t=>{var n;return null===(n=e.optionIds)||void 0===n?void 0:n.includes(t.id)}));r.push(...t.map((e=>({type:"exact",value:e.value}))))}}else r.push({type:"exact",value:i.value});return r}const O={status_is:!0,status_is_not:!0,is_empty:!0,is_not_empty:!0},L=(0,i.XP)(O);function j(e){return Boolean(O[e.operator])}function K(e){return t=e.operator,Boolean(q[t]);var t}function z(e){return Array.isArray(e.value)?e.value:e.value.value?[e.value]:[]}const q={location_is:!0,location_is_not:!0},H=(0,i.XP)(q);function G(e){return Array.isArray(e.value)?e.value:e.value.value?[e.value]:[]}const W={relation_contains:!0,relation_does_not_contain:!0,is_empty:!0,is_not_empty:!0},$=(0,i.XP)(W);function Y(e){return t=e.operator,Boolean(W[t]);var t}function Q(e){return Array.isArray(e.value)?e.value:e.value.value?[e.value]:[]}const J={person_contains:!0,person_does_not_contain:!0,is_empty:!0,is_not_empty:!0},X=(0,i.XP)(J);function ee(e){return Boolean(J[e])}function te(e){return ee(e.operator)}const ne={number_equals:!0,number_does_not_equal:!0,number_greater_than:!0,number_less_than:!0,number_greater_than_or_equal_to:!0,number_less_than_or_equal_to:!0,is_empty:!0,is_not_empty:!0},oe=(0,i.XP)(ne);function re(e){return t=e.operator,Boolean(ne[t]);var t}const ie=[...(0,i.VO)({today:{type:"relative",value:"today"},tomorrow:{type:"relative",value:"tomorrow"},yesterday:{type:"relative",value:"yesterday"},one_week_ago:{type:"relative",value:"one_week_ago"},one_week_from_now:{type:"relative",value:"one_week_from_now"},one_month_ago:{type:"relative",value:"one_month_ago"},one_month_from_now:{type:"relative",value:"one_month_from_now"}}),{type:"exact",value:void 0}],ae={this_week:{type:"relative",value:"surrounding",unit:"week"},the_past_week:{type:"relative",value:"custom",direction:"past",count:1,unit:"week"},the_past_month:{type:"relative",value:"custom",direction:"past",count:1,unit:"month"},the_past_year:{type:"relative",value:"custom",direction:"past",count:1,unit:"year"},the_next_week:{type:"relative",value:"custom",direction:"future",count:1,unit:"week"},the_next_month:{type:"relative",value:"custom",direction:"future",count:1,unit:"month"},the_next_year:{type:"relative",value:"custom",direction:"future",count:1,unit:"year"}},se=[...Object.values(ae),{type:"exact",value:void 0}],le=[{type:"relative",value:"custom",direction:"future",count:2,unit:"week"},{type:"exact",value:void 0}];function ce(){return se}function de(){return le}const ue={date_is:!0,date_is_before:!0,date_is_after:!0,date_is_on_or_before:!0,date_is_on_or_after:!0,date_is_within:!0,date_is_relative_to:!0,is_empty:!0,is_not_empty:!0},pe=(0,i.XP)(ue);function me(e){return t=e.operator,Boolean(ue[t]);var t}const ge={start_date:!1,end_date:!0},fe=(0,i.XP)(ge);function he(e){return ge[e]}function ve(e){const t=e.use_end;return void 0===t||!1===t?"start_date":!0===t?"end_date":void(0,r.t1)(t)}function ye(e){return"date"===e.type||"formula"===e.type&&"date"===(0,c.mm)(e)||"rollup"===e.type&&void 0!==e.aggregation&&"date_range"===e.aggregation}const be={is_empty:!0,is_not_empty:!0},_e=(0,i.XP)(be);function Se(e){return Boolean(be[e])}function ke(e){return Se(e.operator)}const we=ke;function xe(e){return Array.isArray(e.value)?e.value:e.value.value?[e.value]:[]}const Ie={verification_is:!0,verification_is_not:!0},Ce=(0,i.XP)(Ie);function Te(e){return t=e.operator,Boolean(Ie[t]);var t}const Me={text:I,number:re,checkbox:M,select:B,multi_select:U,status:j,relation:Y,person:te,date:me,file:we,location:K,verification:Te},Pe={string_is:!0,string_is_not:!0,string_contains:!0,string_does_not_contain:!0,string_starts_with:!0,string_ends_with:!0,checkbox_is:!0,checkbox_is_not:!0,enum_is:!0,enum_is_not:!0,enum_contains:!0,enum_does_not_contain:!0,status_is:!0,status_is_not:!0,relation_contains:!0,relation_does_not_contain:!0,person_contains:!0,person_does_not_contain:!0,number_equals:!0,number_does_not_equal:!0,number_greater_than:!0,number_less_than:!0,number_greater_than_or_equal_to:!0,number_less_than_or_equal_to:!0,date_is:!0,date_is_before:!0,date_is_after:!0,date_is_on_or_before:!0,date_is_on_or_after:!0,date_is_within:!0,date_is_relative_to:!0,location_is:!0,location_is_not:!0,verification_is:!0,verification_is_not:!0};function Ae(e){return Boolean(Pe[e.operator])}function Re(e,t){return e in Me&&Me[e](t)}const De={any:!0,none:!0,every:!0},Be=(0,i.XP)(De);function Ee(e){return Boolean(De[e.operator])}const Fe={text:x,checkbox:T,select:R,multi_select:Z,status:L,relation:$,person:X,number:oe,date:pe,file:_e,location:H,verification:Ce};function Ze(e){return Fe[e]}const Ue={operator:"and",filters:[{property:"title",filter:{operator:"string_contains",value:{type:"exact",value:void 0}}}]},Ve={operator:"and",filters:[]},Ne={and:!0,or:!0},Oe=(0,i.XP)(Ne);function Le(e){return"operator"in e&&Ne[e.operator]}function je(e){return"property"in e&&"string"==typeof e.property}function Ke(e){return"timestamp"in e&&"string"==typeof e.timestamp}function ze(e){return 0===(e.filters||[]).length}function qe(){return!1}function He(e){const{context:t,propertyMapping:n,filter:o}=e,{userId:i,userTimeZone:a,userStartOfWeek:s}=t,l=o.operator,c=o.filters||[],d=c.map((e=>{let o;return je(e)?o=Ge({property:e.property,propertyMapping:n,filter:e.filter,context:t,depth:0}):Le(e)?o=He({context:t,propertyMapping:n,filter:e}):Ke(e)?o=Qe({filter:e,userId:i,userTimeZone:a,userStartOfWeek:s}):(0,r.t1)(e),{shortCircuitOthers:0,latency:0,processed:0,originalFilter:e,compiledFilter:o}}));let u=0;if("or"===l||"and"===l)return e=>{u++,(u<100&&u%25==24||u%100==99)&&(c.length<=1||d.sort(((e,t)=>{const n=(e.shortCircuitOthers+100)/(e.processed+100),o=(t.shortCircuitOthers+100)/(t.processed+100);return(e.latency+100)/(e.processed+100)/n-(t.latency+100)/(t.processed+100)/o})));let t=!0;for(const n of d){const o=Date.now();if(t=n.compiledFilter(e),n.latency+=Date.now()-o,n.processed++,"or"===l&&t)return n.shortCircuitOthers++,t;if("and"===l&&!t)return n.shortCircuitOthers++,t}return t};(0,r.t1)(l)}function Ge(e){const{property:t,filter:n,propertyMapping:o,context:i,depth:a}=e,{schema:c,userId:d,userTimeZone:u,intl:m,optimizer:f,userStartOfWeek:h,relativeVariableResult:v,currentPageInRelatedCollection:y}=i,b=c[(null==o?void 0:o[t])??t];if(!b)return qe;let _;if("relation"===b.type&&v&&b.collection_pointer){_=v[b.collection_pointer.id]}if("formula"===b.type)return We({context:i,filter:n,property:t,propertySchema:b,depth:a});if("rollup"===b.type)return function(e){const{context:t,property:n,filter:o,propertySchema:i,depth:a}=e,{schema:l,userId:c,userTimeZone:d,userStartOfWeek:u,relativeVariableResult:p,currentPageInRelatedCollection:m,intl:f,optimizer:h}=t;if(i.aggregation&&"show_unique"!==i.aggregation){let e;if((0,s._M)(i.aggregation)||(0,s.Bf)(i.aggregation)||(0,s.sl)(i.aggregation)||(0,s.Ys)(i.aggregation)){if(!re(o))return qe;e="number"}else if((0,s.Fw)(i.aggregation)){if(!me(o))return qe;e="date"}else if((0,s.en)(i.aggregation)){if(!re(o)||!I(o))return qe;e="count_per_group"===i.aggregation.operator?"text":"number"}else(0,r.t1)(i.aggregation);const t=Je({filter:o,filterType:e,userId:c,userTimeZone:d,userStartOfWeek:u,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0});return o=>{const r=(0,g.O0)({property:n,schema:l,...o,collectionRequestContext:{userId:void 0,userTimeZone:d,intl:f,depth:a,visitedProperties:new Set,resultCache:o.resultCache,formulaTimeoutTimestampMs:o.formulaTimeoutTimestampMs,logFormulaTimeoutFn:o.logFormulaTimeoutFn}});return!!r&&(r.type===e&&t(r))}}if(!Ee(o))return qe;let v;const y=e=>{const t=(0,g.gT)({property:n,schema:l,getRecordModel:e});return t?Ee(o.subfilter)?qe:Ge({filter:o.subfilter,property:t.targetProperty,propertyMapping:void 0,context:{schema:t.targetCollectionSchema,userId:c,userTimeZone:d,userStartOfWeek:u,intl:f,optimizer:h,relativeVariableResult:p,currentPageInRelatedCollection:m},depth:a+1}):qe};return e=>{const{block:t,getRecordModel:r,formulaTimeoutTimestampMs:i,logFormulaTimeoutFn:a}=e,s=(0,g.I_)({property:n,schema:l,block:t,getRecordModel:r}),c=v??=y(r);return ct(o.operator,s,(t=>c({block:t,getRecordModel:r,propertyMapping:void 0,formulaTimeoutTimestampMs:i,logFormulaTimeoutFn:a,resultCache:e.resultCache})))}}({context:i,filter:n,property:t,propertySchema:b,depth:a});if("button"===b.type)return qe;const S=(0,l.vc)(b.type);if(!Re(S,n))return qe;const k=Je({filter:n,filterType:S,userId:d,userTimeZone:u,userStartOfWeek:h,relativeVariableValues:_,currentPageInRelatedCollection:y}),w=e=>{const{block:n,getRecordModel:o,propertyMapping:r,formulaTimeoutTimestampMs:i,logFormulaTimeoutFn:a,resultCache:s}=e,c=(null==r?void 0:r[t])??t;let g;g="title"===b.type&&"collection_view_page"===n.getType()?(0,p.iT)(n,o):(0,p.wS)(n,c,o);const f=(0,l.ML)({filterValueType:S,block:n,propertySchema:b,propertyValue:g,getRecordModel:o,collectionRequestContext:{userId:d,userTimeZone:u,intl:m,depth:0,visitedProperties:new Set,formulaTimeoutTimestampMs:i,logFormulaTimeoutFn:a,resultCache:s}});return k(f)};if(f){const e={schema:c,property:t,userId:d,userTimeZone:u,intl:m,basicFilter:n,compiledBasicFilter:k,compiledFilter:w},o="function"==typeof f?f:null==f?void 0:f[S],r=null==o?void 0:o(e);if(r)return r}return w}function We(e){return"v2"===e.propertySchema.version?function(e){const{propertySchema:t,filter:n,context:o,property:r,depth:i}=e,{userId:a,userTimeZone:s,userStartOfWeek:l,intl:d}=o;if(!t.formula2)return qe;const u=t.formula2.result_type;if("array"===u.type){const e=(0,v.B8)(u);if("array"===e.type||"select"===e.type||"function"===e.type)return qe;const a="block"===e.type||"unknown"===e.type?"text":e.type;return function(e){const{propertySchema:t,filter:n,context:o,property:r,subfilterType:i}=e,{userId:a,userTimeZone:s,intl:l,userStartOfWeek:d}=o;if(!Ee(n))return qe;let u;const p=()=>Ee(n.subfilter)?()=>!1:Je({filter:n.subfilter,userId:a,userTimeZone:s,userStartOfWeek:d,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0,filterType:i});return o=>{if(!t.formula2)return!1;const{block:a,getRecordModel:d,resultCache:m}=o,g=(0,c.EC)({block:a,property:r,formulaCode:t.formula2.code,getRecordModel:d,intl:l,userTimeZone:s,depth:e.depth,visitedProperties:new Set,resultCache:m});if(!g||"array"!==g.type)return!1;if(!(0,c.of)(g)&&!I(n.subfilter))return!1;const f=u??=p();return!!Re(i,n.subfilter)&&ct(n.operator,g.values,(e=>{if("array"===e.type||"undefined"===e.type)return!1;const t=Ye(e,i,d,l,s);return void 0!==t&&f(t)}))}}({context:o,filter:n,property:r,propertySchema:t,depth:i,subfilterType:a})}const p="block"===u.type||"unknown"===u.type?"text":u.type;if(!Re(p,n))return qe;const m=Je({filter:n,userId:a,userTimeZone:s,userStartOfWeek:l,filterType:p,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0});return o=>{if(!t.formula2)return!1;const i=(0,c.EC)({block:o.block,property:r,formulaCode:t.formula2.code,getRecordModel:o.getRecordModel,intl:d,userTimeZone:s,depth:e.depth,visitedProperties:new Set,formulaTimeoutTimestampMs:o.formulaTimeoutTimestampMs,logFormulaTimeoutFn:o.logFormulaTimeoutFn,resultCache:o.resultCache});if("is_empty"===n.operator)return $e(i);if("is_not_empty"===n.operator)return!$e(i);if(!i||"undefined"===i.type)return!1;const{getRecordModel:a}=o,l=Ye(i,p,a,d,s);return!!l&&m(l)}}(e):function(e){const{propertySchema:t,filter:n,context:o,property:r,depth:i}=e,{userId:a,userTimeZone:s,userStartOfWeek:l,intl:c,schema:d}=o;if(!t.formula)return qe;const u=t.formula.result_type;if(!u)return qe;if(!Re(u,n))return qe;const p=Je({filter:n,userId:a,userTimeZone:s,userStartOfWeek:l,filterType:u,relativeVariableValues:void 0,currentPageInRelatedCollection:void 0});return e=>{const t=(0,y.AH)({...e,property:r,schema:d,collectionRequestContext:{userId:void 0,userTimeZone:s,depth:i,intl:c,resultCache:e.resultCache,visitedProperties:new Set,formulaTimeoutTimestampMs:e.formulaTimeoutTimestampMs,logFormulaTimeoutFn:e.logFormulaTimeoutFn}});return p({type:u,value:t})}}(e)}function $e(e){return!e||"undefined"===e.type||"array"===e.type&&0===e.values.length||"text"===e.type&&0===(0,S.eeV)(e.value).length}function Ye(e,t,n,o,i){let a=e.type;if("undefined"!==a){if("block"===a&&(a="text"),"text"===t||"text"===e.type)return{type:"text",value:(0,b.Xh)({textValue:(0,v.j4)(e),getRecordModel:n,intl:o,userTimeZone:i})};if("block"===e.type){const t=n(e.value);if(!t)return;return{type:"text",value:t.getRenderTitle({getRecordModel:n,intl:o,userTimeZone:i})}}return"person"===e.type?{type:"person",value:[e.value]}:"number"===e.type?{type:"number",value:e.value}:"date"===e.type?{type:"date",value:e.value}:"checkbox"===e.type?{type:"checkbox",value:e.value}:void("undefined"!==e.type&&"array"!==e.type&&(0,r.t1)(e))}}function Qe(e){const{filter:t,userId:n,userTimeZone:o,userStartOfWeek:r}=e,i=Je({filter:t.filter,userId:n,userTimeZone:o,userStartOfWeek:r,filterType:"date",relativeVariableValues:void 0,currentPageInRelatedCollection:void 0});return e=>{const n=(0,y.HK)({timestampType:t.timestamp,block:e.block,userTimeZone:o});return i({type:"date",value:n})}}function Je(e){return(0,lt[e.filterType])(e)}function Xe(e){const{filter:t}=e,n=Ae(t)?V(t):[],i=o.jj(o.oA(n.filter((e=>"is_group"===e.type)).map((e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.toLowerCase()})))),a=n.filter((e=>"is_option"===e.type)).map((e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.toLowerCase()}));return e=>{const{option:o,group:s}=e;if("is_empty"===t.operator)return void 0===o;if("is_not_empty"===t.operator)return void 0!==o;if(0===n.length)return!0;const l=Boolean(s&&i.includes(s.toLowerCase())),c=Boolean(o&&a.includes(o.toLowerCase()));return"status_is"===t.operator?l||c:"status_is_not"===t.operator?!l&&!c:void(0,r.t1)(t.operator)}}function et(e){const{operatorValue:t,userTimeZone:n}=e;if("exact"===t.type){const e=t.value;if(!(0,r.$K)(e))return;const{start:o}=h.NK(e,n);return o.startOf("day").valueOf()}return nt({operatorValue:t,userTimeZone:n})}function tt(e,t){if("this_week"===e.value)return{start:h.kT({timezone:t}).startOf("week").valueOf(),end:h.kT({timezone:t}).endOf("week").valueOf()};if("the_past_week"===e.value)return{start:h.Uu(t).minus({days:8}).valueOf(),end:h.kT({timezone:t}).valueOf()};if("the_past_month"===e.value)return{start:h.kT({timezone:t}).minus({months:1,days:1}).valueOf(),end:h.kT({timezone:t}).valueOf()};if("the_past_year"===e.value)return{start:h.kT({timezone:t}).minus({years:1}).valueOf(),end:h.kT({timezone:t}).valueOf()};const n=h.kT({timezone:t}).minus({days:1}).valueOf();return"the_next_week"===e.value?{start:n,end:h.kT({timezone:t}).plus({weeks:1}).valueOf()}:"the_next_month"===e.value?{start:n,end:h.kT({timezone:t}).plus({months:1}).valueOf()}:"the_next_year"===e.value?{start:n,end:h.kT({timezone:t}).plus({years:1}).valueOf()}:void(0,r.t1)(e)}function nt(e){const{operatorValue:t,userTimeZone:n}=e;return"today"===t.value?h.Uu(n).valueOf():"tomorrow"===t.value?h.Uu(n).plus({days:1}).valueOf():"yesterday"===t.value?h.Uu(n).minus({days:1}).valueOf():"one_week_from_now"===t.value?h.Uu(n).plus({weeks:1}).valueOf():"one_week_ago"===t.value?h.Uu(n).minus({weeks:1}).valueOf():"one_month_from_now"===t.value?h.Uu(n).plus({months:1}).valueOf():"one_month_ago"===t.value?h.Uu(n).minus({months:1}).valueOf():void(0,r.t1)(t)}function ot(e){const{operatorValue:t,userTimeZone:n,userStartOfWeek:o}=e;if("relative"===t.type&&"surrounding"===t.value){const{start:e,end:r}=rt(t.unit,n,o);return{start:e.valueOf(),end:r.valueOf()}}if("relative"===t.type&&"custom"===t.value)return it({filterDirection:t.direction,filterCount:t.count,filterUnit:t.unit,userTimeZone:n});if("relative"===t.type)return tt(t,n);if("exact"===t.type){if(t.value){const{value:e}=t;if(e.start_date&&e.end_date){const t={type:"daterange",start_date:e.start_date,end_date:e.end_date},o=h.NK(t,n);return{start:o.start.valueOf(),end:o.end.endOf("day").valueOf()}}if(e.start_date){const t={type:"date",start_date:e.start_date};return{start:h.DF(t,n).valueOf(),end:void 0}}if(e.end_date){const t={type:"date",start_date:e.end_date};return{start:void 0,end:h.DF(t,n).endOf("day").valueOf()}}return{start:void 0,end:void 0}}return{start:void 0,end:void 0}}(0,r.t1)(t)}function rt(e,t,n){const o=h.kT({timezone:t});switch(e){case"day":return{start:o.startOf("day"),end:o.endOf("day")};case"week":return{start:h.em(o.valueOf(),n,t),end:h.gQ(o.valueOf(),n,t)};case"month":return{start:o.startOf("month").startOf("day"),end:o.endOf("month").startOf("day")};case"year":return{start:o.startOf("year").startOf("day"),end:o.endOf("year").startOf("day")};default:(0,r.t1)(e)}}function it(e){const{filterDirection:t,filterCount:n,filterUnit:o,userTimeZone:i}=e,a=at(t,n,o,i);switch(t){case"future":return{start:h.kT({timezone:i}).startOf("day").valueOf(),end:a.endOf("day").valueOf()};case"past":return{start:a.startOf("day").valueOf(),end:h.kT({timezone:i}).endOf("day").valueOf()};default:(0,r.t1)(t)}}function at(e,t,n,o){const r="past"===e?-t:t;return h.kT({timezone:o}).plus({[n]:r})}function st(e){const{operatorValue:t,userId:n}=e;if("relative"===t.type){if("me"===t.value)return n?{table:_.KJ,id:n}:void 0;(0,r.t1)(t)}return t.value}const lt={text:function(e){const{filter:t}=e,n=Ae(t)?(t.value.value||"").trim().toLowerCase():void 0;return e=>{const i=(e.value||"").toLowerCase();if(!o.HD(i))throw new Error(`str is not a string: ${i}`);return"is_empty"===t.operator?0===i.length:"is_not_empty"===t.operator?i.length>0:"string_has_no_alphabet_prefix"===t.operator?Boolean(i&&!(0,d.bk)(i)):!n||("string_is"===t.operator?i===n:"string_is_not"===t.operator?i!==n:"string_contains"===t.operator?i.indexOf(n)>=0:"string_does_not_contain"===t.operator?i.indexOf(n)<0:"string_starts_with"===t.operator?i.slice(0,n.length)===n:"string_ends_with"===t.operator?i.slice(i.length-n.length)===n:void(0,r.t1)(t.operator))}},checkbox:function(e){const{filter:t}=e,n=Boolean(t.value.value);return e=>{const o=Boolean(e.value);return"checkbox_is"===t.operator?o===n:"checkbox_is_not"===t.operator?o!==n:void(0,r.t1)(t.operator)}},select:function(e){const{filter:t}=e,n=Ae(t)?P(t).map((e=>{let{value:t}=e;return t})):[];return e=>{const o=e.value;return"is_empty"===t.operator?void 0===o:"is_not_empty"===t.operator?void 0!==o:0===n.length||("enum_is"===t.operator?n.includes(o):"enum_is_not"===t.operator?!n.includes(o):void(0,r.t1)(t.operator))}},multi_select:function(e){const{filter:t}=e,n=Ae(t)?E(t).map((e=>{let{value:t}=e;return t})):[];return e=>{const o=e.value||[];return"is_empty"===t.operator?0===o.length:"is_not_empty"===t.operator?o.length>0:0===n.length||("enum_contains"===t.operator?o.some((e=>n.includes(e))):"enum_does_not_contain"===t.operator?!o.some((e=>n.includes(e))):void(0,r.t1)(t.operator))}},status:Xe,relation:function(e){const{filter:t,relativeVariableValues:n,currentPageInRelatedCollection:o}=e,i=Ae(t)?function(e){const{filter:t,relativeVariableValue:n,currentPageInRelatedCollection:o}=e;return G(t).map((e=>{let{type:t,value:i}=e;if("exact"===t)return i;if("relative"===t){if("builtin"===i.type&&n)return n[i.variable];if("current_page_in_related_collection"===i.type)return o}else(0,r.t1)(t)}))}({filter:t,relativeVariableValue:n,currentPageInRelatedCollection:o}):[];return e=>{const n=e.value||[];return"is_empty"===t.operator?0===n.length:"is_not_empty"===t.operator?n.length>0:0===i.length||("relation_contains"===t.operator?n.some((e=>i.includes(e.id))):"relation_does_not_contain"===t.operator?!n.some((e=>i.includes(e.id))):void(0,r.t1)(t.operator))}},person:function(e){const{filter:t,userId:n}=e,o=Ae(t)?Q(t).map((e=>{const t=st({operatorValue:e,userId:n});if(t)return(0,f.dn)(t)})).filter(r.$K):[];return e=>{const n=e.value||[];if("is_empty"===t.operator)return 0===n.length;if("is_not_empty"===t.operator)return n.length>0;if(0===o.length&&0===Q(t).length)return!0;const i=new Set(n.map(f.dn));return"person_contains"===t.operator?o.some((e=>i.has(e))):"person_does_not_contain"===t.operator?!o.some((e=>i.has(e))):void(0,r.t1)(t.operator)}},number:function(e){const{filter:t}=e;return e=>{const n=e.value;if("is_empty"===t.operator)return void 0===n||o.i2(n);if("is_not_empty"===t.operator)return void 0!==n&&!o.i2(n);const i=t.value.value;return!(void 0!==i&&!o.i2(i))||(void 0===n||o.i2(n)?"number_does_not_equal"===t.operator:"number_equals"===t.operator?n===i:"number_does_not_equal"===t.operator?n!==i:"number_greater_than"===t.operator?n>i:"number_less_than"===t.operator?n<i:"number_greater_than_or_equal_to"===t.operator?n>=i:"number_less_than_or_equal_to"===t.operator?n<=i:void(0,r.t1)(t.operator))}},date:function(e){const{filter:t,userTimeZone:n,userStartOfWeek:o}=e;if("is_empty"===t.operator)return e=>{const t=e.value;if(!t)return!0;const o=h.NK(t,n);return!!isNaN(o.start.valueOf())||void 0===e.value};if("is_not_empty"===t.operator)return e=>{const t=e.value;if(!t)return!1;const o=h.NK(t,n);return!isNaN(o.start.valueOf())&&void 0!==e.value};if(D(t)){const e=ot({operatorValue:t.value,userTimeZone:n,userStartOfWeek:o});return o=>{const r=o.value;if(!r)return!1;const i=h.NK(r,n),a=i.start.valueOf(),s=i.end?i.end.valueOf():i.start.valueOf(),l=t.use_end?s:a;return(void 0===e.start||l>=e.start)&&(void 0===e.end||l<=e.end)}}let i=et({operatorValue:t.value,userTimeZone:n}),a=h.kT({date:i,timezone:n}).endOf("day").valueOf();if("object"==typeof t.value.value&&"datetime"===t.value.value.type){const e=function(e){const{operatorValue:t,userTimeZone:n}=e;if("exact"===t.type){const e=t.value;if(!(0,r.$K)(e))return;return h.uO(e,n)}return nt({operatorValue:t,userTimeZone:n})}({operatorValue:t.value,userTimeZone:n});if(!(0,r.$K)(e))return()=>!0;i=e,a=e}return e=>{const o=e.value;if(!(0,r.$K)(i))return!0;if(!o)return!1;const s=h.NK(o,n),l=s.start.valueOf(),c=s.end?s.end.valueOf():s.start.valueOf(),d=t.use_end?c:l;return"date_is"===t.operator?a>=d&&i<=d:"date_is_before"===t.operator?d<i:"date_is_on_or_before"===t.operator?d<=a:"date_is_after"===t.operator?d>a:"date_is_on_or_after"===t.operator?d>=i:void(0,r.t1)(t.operator)}},file:function(e){const{filter:t}=e;return e=>{const n=e.value||[];return"is_empty"===t.operator?0===n.length:"is_not_empty"===t.operator?n.length>0:void(0,r.t1)(t)}},location:function(e){const{filter:t}=e,n=z(t).map((e=>{let{value:t}=e;return t}));return e=>{const o=e.value;return"location_is"===t.operator?n.includes(null==o?void 0:o.id):"location_is_not"===t.operator?!n.includes(null==o?void 0:o.id):void(0,r.t1)(t.operator)}},verification:function(e){const{filter:t}=e,n=Ae(t)?xe(t).map((e=>{let{value:t}=e;return t})):[];return e=>{const o=e.value;return"verification_is"===t.operator?n.includes(o):"verification_is_not"===t.operator?!n.includes(o):void(0,r.t1)(t.operator)}}};function ct(e,t,n){return"any"===e?0!==t.length&&t.some(n):"none"===e?0===t.length||!t.some(n):"every"===e?0!==t.length&&o.yW(t,n):void(0,r.t1)(e)}function dt(e){const{schema:t,property:n,getRecordModel:o}=e,r=t[n];if(!r)return"text";if("formula"===r.type){if("v2"===r.version){if(!r.formula2)return"text";const e=r.formula2.result_type.type;if("unknown"===e||"block"===e)return"text";if("array"===e){const e=(0,v.B8)(r.formula2.result_type.of).type;return"block"===e||"array"===e||"unknown"===e||"function"===e?"text":e}return e}return r.formula&&r.formula.result_type?r.formula.result_type:"text"}if("rollup"===r.type){if(!r.relation_property||!r.target_property)return"text";if(r.aggregation&&"show_unique"!==r.aggregation)return(0,s.W6)((0,s.gu)(r.aggregation));const e=t[r.relation_property];if(!e||"relation"!==e.type||!(0,u.j0)(e))return"text";const n=o((0,u.j0)(e));if(!n)return"text";return dt({schema:n.getNormalizedSchema(),property:r.target_property,getRecordModel:o})}return"button"===r.type?"text":(0,l.vc)(r.type)}function ut(e,t,n,o){const i=e[t];if(!i)return!1;if("formula"===i.type){if("v2"===i.version){if(i.formula2){const e=i.formula2.result_type.type;return"unknown"===e||"block"===e?I(n):"array"===e?function(e,t){const n=(0,v.B8)(t);return!("array"===n.type||"function"===n.type||!Ee(e))&&("block"===n.type||"unknown"===n.type?Re("text",e.subfilter):Re(n.type,e.subfilter))}(n,i.formula2.result_type.of):Re(e,n)}return ke(n)}return i.formula&&i.formula.result_type?Re(i.formula.result_type,n):!!ke(n)}if("rollup"===i.type){if(i.aggregation&&"show_unique"!==i.aggregation){return Re((0,s.W6)((0,s.gu)(i.aggregation)),n)}if(!Ee(n))return!1;if(!o)return!0;const a=dt({schema:e,property:t,getRecordModel:o}),l=Ee(n)?n.subfilter:n;if("text"===a)return I(l);if("relation"===a)return Y(l);if("checkbox"===a)return M(l);if("select"===a||"multi_select"===a)return B(l)||U(l);if("status"===a)return j(l);if("person"===a)return te(l);if("number"===a)return re(l);if("date"===a)return me(l);if("file"===a)return ke(l);if("location"===a)return K(l);if("verification"===a)return Te(l);(0,r.t1)(a)}if("button"===i.type)return!1;return Re((0,l.vc)(i.type),n)}function pt(e,t){if(t(e))return e;if(Le(e))for(const n of e.filters||[]){const e=pt(n,t);if(e)return e}}function mt(e){return!e||(Array.isArray(e)?!e.some(gt):!gt(e))}function gt(e){return e&&!Array.isArray(e)&&void 0!==e.value&&""!==e.value}function ft(e){if(je(e)){const t=Ee(e.filter)?e.filter.subfilter:e.filter;return Ae(t)&&mt(t.value)}return!1}function ht(e){const{propertyFilters:t,combinatorFilter:n,schema:r}=e;return o.oA([n,...t.map((e=>{const t=(0,m.dN)(e.filter,r);if(t){if(!je(t))return t;{const e=Ee(t.filter)?t.filter.subfilter:t.filter;if(!Ae(e)||!mt(e.value))return t}}}))])}function vt(e){return 1===e.length&&Le(e[0])?e[0]:e.length>0?{operator:"and",filters:e}:void 0}function yt(e){return"exact"===e.type?e.type:"surrounding"===e.value?`${e.type}-${e.unit}`:"custom"===e.value?`${e.type}-${e.unit}-${e.count}-${e.direction}`:e.value}function bt(e){return Boolean(e&&je(e)&&e.property===a.Es.TaskToSprintRelation&&Y(e.filter)&&"relation_contains"===e.filter.operator&&Array.isArray(e.filter.value))}},830823:(e,t,n)=>{n.d(t,{BJ:()=>y,FT:()=>B,GJ:()=>b,LR:()=>f,ML:()=>I,qg:()=>A,vc:()=>h,yK:()=>S});var o=n(401898),r=n(435011),i=n(180951),a=n(334299),s=n(640506),l=n(253877),c=n(484682),d=n(882883),u=n(989470),p=n(421838),m=n(604308);const g={text:"text",url:"text",email:"text",phone_number:"text",checkbox:"checkbox",select:"select",multi_select:"multi_select",status:"status",person:"person",relation:"relation",created_by:"person",last_edited_by:"person",number:"number",auto_increment_id:"number",date:"date",created_time:"date",last_edited_time:"date",last_visited_time:"date",title:"text",file:"file",location:"location",verification:"verification"};function f(e){return e in g}function h(e){return g[e]}const v={created_by:!0,last_edited_by:!0,created_time:!0,last_edited_time:!0,last_visited_time:!0,location:!0};function y(e){return f(e.type)&&!(e.type in v)}function b(e){const{propertyValue:t,getRecordModel:n,collectionRequestContext:o}=e,{userTimeZone:r,intl:i}=o;return{type:"text",value:(0,d.Xh)({textValue:t,getRecordModel:n,userTimeZone:r,intl:i}).trim()}}function _(e){const{propertyValue:t}=e;return{type:"text",value:p.Jcv(t)}}function S(e){const{propertySchema:t,propertyValue:n}=e;if(!t||"status"!==t.type)return{type:"status",option:void 0,group:void 0};const o=t.options??[],r=i.ZG(n,t),a=o.find((e=>e.value===r)),s=t.groups??[],l=a?s.find((e=>{var t;return null===(t=e.optionIds)||void 0===t?void 0:t.includes(a.id)})):void 0;return{type:"status",option:r,group:null==l?void 0:l.name}}function k(e){const{propertyValue:t}=e;return{type:"number",value:i.VY(t)}}function w(e){if(!e.timestamp)return{type:"date",value:void 0};return{type:"date",value:l.CQ(e.timestamp,e.userTimeZone)}}const x={text:b,title:b,url:_,email:_,phone_number:_,checkbox:function(e){const{propertyValue:t}=e;return{type:"checkbox",value:i.Ml(t)}},select:function(e){const{propertyValue:t,propertySchema:n}=e,o=n&&"select"===n.type&&n.options||[];return{type:"select",value:i.Sj(t,o)}},multi_select:function(e){const{propertySchema:t,propertyValue:n}=e;if(!t||"multi_select"!==t.type)return{type:"multi_select",value:void 0};const o=t.options||[];return{type:"multi_select",value:i.uP(n,o)}},status:S,relation:function(e){const{propertyValue:t,propertySchema:n,getRecordModel:o}=e;return n&&"relation"===n.type?{type:"relation",value:i.j$({relationValue:i.rq(t),propertySchema:n,getRecordModel:o})}:{type:"relation",value:void 0}},person:function(e){const{block:t,propertyValue:n,propertySchema:o}=e;return{type:"person",value:i.DW({textValue:n,propertySchema:o,blockCreatorPointer:t.getCreatedByPointer()})}},created_by:e=>{let{block:t}=e;const n=t.getCreatedByPointer();return{type:"person",value:n?[n]:void 0}},last_edited_by:e=>{let{block:t}=e;const n=t.getLastEditedByPointer();return{type:"person",value:n?[n]:void 0}},number:k,auto_increment_id:k,date:function(e){const{propertyValue:t}=e;return{type:"date",value:i.Gl(t)}},created_time:e=>{let{block:t,collectionRequestContext:{userTimeZone:n}}=e;return w({timestamp:t.getCreatedTime(),userTimeZone:n})},last_edited_time:e=>{let{block:t,collectionRequestContext:{userTimeZone:n}}=e;return w({timestamp:t.getLastEditedTime(),userTimeZone:n})},file:function(e){const{propertyValue:t}=e;return{type:"file",value:i.g(t).map((e=>e.url))}},location:function(e){const{block:t,propertySchema:n}=e;return n&&"location"===n.type?{type:"location",value:i.UB({block:t})}:{type:"location",value:void 0}},last_visited_time:function(e){const{block:t,propertySchema:n,getRecordModel:o,collectionRequestContext:r}=e,{userTimeZone:i,userId:a}=r;if(!a||!n||"last_visited_time"!==n.type)return{type:"date",value:void 0};const s=(0,u.Pv)({parent_id:t.id,user_id:a}),l=o({table:u.UI,id:s,spaceId:t.getSpaceId()});return w({timestamp:null==l?void 0:l.getVisitedAt(),userTimeZone:i})},verification:function(e){const{propertyValue:t}=e,n=i._w(t);return{type:"verification",value:(0,m.WN)(n).type}}};function I(e){const{filterValueType:t,propertySchema:n}=e;if(!n)return{type:t,value:void 0};if(!f(n.type))return{type:t,value:void 0};const o=x[n.type];return o?o(e):{type:t,value:void 0}}function C(e){return void 0===e.value||""===e.value?[]:[[e.value]]}function T(e){return i.iD(e.value)}function M(e){return i.eP(e.value)}const P={text:C,title:C,url:T,email:T,phone_number:T,checkbox:function(e){return i._I(e.value)},select:function(e){return i.O2(e.value)},multi_select:function(e){return i.zq(e.value)},status:function(e){return i.Is(e.option)},relation:function(e){return i.ow(e.value||[])},person:function(e){return i.C1(e.value||[])},number:M,auto_increment_id:M,date:function(e){return i.d7(e.value)},file:function(e){return i.CC((e.value||[]).map((e=>({name:e,url:e}))))},location:function(){return[]},verification:function(e){return[]}};function A(e){const{propertyType:t,filterValue:n}=e;return(0,P[t])(n)}function*R(e){const{block:t,schema:n,property:i,getRecordModel:a,collectionRequestContext:l,formula2Error:d}=e,{userTimeZone:u,depth:p,intl:m,visitedProperties:g,resultCache:f,formulaTimeoutTimestampMs:h,logFormulaTimeoutFn:v,logFormulaStatsFn:y}=l,b=n[i];if(b&&"formula"===b.type)if("v2"===b.version){if(!b.formula2)return;const{code:e}=b.formula2,n=(0,r.EC)({block:t,property:i,formulaCode:e,getRecordModel:a,intl:m,userTimeZone:u,depth:p,visitedProperties:g,formulaTimeoutTimestampMs:h,logFormulaTimeoutFn:v,logFormulaStatsFn:y,formula2Error:d,resultCache:f});if(!n)return;yield*D(n,a,u,m)}else{if(!b.formula)return;if(!b.formula.result_type)return;const e=(0,c.AH)({schema:n,property:i,block:t,getRecordModel:a,collectionRequestContext:{userId:void 0,userTimeZone:u,depth:p,intl:m,resultCache:f,visitedProperties:g,formulaTimeoutTimestampMs:h,logFormulaTimeoutFn:v}});if("number"===b.formula.result_type){if("number"!=typeof e)return}else if("text"===b.formula.result_type){if("string"!=typeof e)return}else if("checkbox"===b.formula.result_type){if("boolean"!=typeof e)return}else if("date"===b.formula.result_type){if(!s.U3(e))return}else(0,o.t1)(b.formula.result_type);yield{type:b.formula.result_type,value:e}}}function*D(e,t,n,o){if(e&&"undefined"!==e.type)if("array"===e.type)for(const r of e.values)yield*D(r,t,n,o);else if("block"===e.type){const r=t(e.value);if(!r)return;yield{type:"text",value:r.getRenderTitle({getRecordModel:t,userTimeZone:n,intl:o})}}else"person"===e.type?yield{type:"person",value:[e.value]}:"text"===e.type?yield{type:"text",value:(0,d.Xh)({textValue:e.value,getRecordModel:t,userTimeZone:n,intl:o})}:("number"===e.type||"date"===e.type||"checkbox"===e.type)&&(yield{type:e.type,value:e.value})}function*B(e){const{block:t,schema:n,property:o,getRecordModel:r,propertyMapping:s,collectionRequestContext:l}=e,c=n[o];if(!c)return;if("formula"===c.type)return void(yield*R(e));if("rollup"===c.type)return void(yield*function*(e){const{block:t,schema:n,property:o,getRecordModel:r,collectionRequestContext:i,formula2Error:s}=e,l=n[o];if(!l)return;if("rollup"!==l.type)return;const c=(0,a.gT)({property:o,schema:n,getRecordModel:r});if(!c)return;if(l.aggregation&&"show_unique"!==l.aggregation){const t=(0,a.O0)(e);return void(t&&(yield t))}const d=(0,a.I_)({property:o,schema:n,block:t,getRecordModel:r});for(const a of d)yield*B({block:a,property:c.targetProperty,schema:c.targetCollectionSchema,getRecordModel:r,propertyMapping:void 0,collectionRequestContext:{...i,depth:i.depth+1},formula2Error:s})}(e));if("button"===c.type)return;const d=h(c.type),u=(null==s?void 0:s[o])??o,p=I({filterValueType:d,propertySchema:c,propertyValue:i.wS(t,u,r),block:t,getRecordModel:r,collectionRequestContext:l});yield p}},435011:(e,t,n)=>{n.d(t,{EC:()=>_,HU:()=>M,NM:()=>S,PY:()=>I,XU:()=>Z,Z5:()=>U,cO:()=>P,gi:()=>V,j1:()=>F,lH:()=>k,mm:()=>R,of:()=>C,oh:()=>x,pV:()=>A,py:()=>E,r9:()=>D,uZ:()=>B,x9:()=>b});n(757658);var o=n(653965),r=(n(307032),n(940470)),i=n(560246),a=n(463087),s=n(640506),l=n(407057),c=n(80206),d=n(173110),u=n(877097),p=n(672158),m=n(335102),g=n(484682),f=n(318955),h=n(238297),v=n(959753),y=n(421838);function b(e){if("function"===e.type)return{type:"unknown"};if("array"===e.type){return{type:"array",of:b(e.of)}}return e}function _(e){const{block:t,property:n,getRecordModel:o,formula2Error:i,resultCache:a,logFormulaStatsFn:s}=e,l=performance.now(),c=Z({resultCache:a,blockId:t.id,property:n});if(void 0!==c)return null==s||s({executionTimeMs:performance.now()-l,cachedCount:1}),I(c);const d=(0,h.ky)({block:t,getRecordModel:o}),u=v.kk5.fromValue("collection",d);if(!u)return;const m=P(t,u,n);if(m)return r.x.isFail(m)?(null==s||s({executionTimeMs:performance.now()-l,cachedCount:1,error:m.error.type}),void(null===(null==i?void 0:i.error)&&(0,p.no)(m.error)&&(i.error=new p.WV(m.error)))):m.value;const g=S(e);if(null==s||s({executionTimeMs:performance.now()-l,uncachedCount:1}),!g)return;const f=x(g);return r.x.isFail(f)?(null==s||s({error:f.error.type}),void(null===(null==i?void 0:i.error)&&(0,p.no)(f.error)&&(i.error=new p.WV(f.error)))):f.value}function S(e){const t=w(e);if(t)return x(t)}function k(e){return w(e)}function w(e){const{block:t,formulaCode:n,property:o,getRecordModel:r,intl:i,userTimeZone:a,depth:s,visitedProperties:l,formulaTimeoutTimestampMs:u,logFormulaTimeoutFn:p,resultCache:m}=e,g=(0,h.ky)({block:t,getRecordModel:r});if(!v.kk5.fromValue("collection",g))return;const f=(0,c.l)();if(!f)return;const y={values:[{kind:d.yp.ThisRow,value:{type:"block",value:t.pointer}}],handleDataRequest:f.createFormulaDataRequestSyncHandler(r),intl:i,userTimeZone:a,depth:s,visitedProperties:l,formulaTimeoutTimestampMs:u,logFormulaTimeoutFn:p,resultCache:m},b=f.executeFormulaSync(n,y);return"value"in b&&F({resultCache:m,blockId:t.id,property:o,value:b.value}),b}function x(e){return r.x.isFail(e)?e:{value:I(e.value)}}function I(e){if("function"===e.type)return{type:"undefined"};if("array"===e.type){var t;if(0===e.values.length)return{type:"undefined"};const n={type:"array",values:(0,m.Yw)(e).values.filter((e=>"undefined"!==e.type))};if(!C(n)){const e=o.oA(n.values.map((e=>{if("array"!==e.type)return{type:"text",value:(0,m.j4)(e)}})));return{type:"array",values:e}}return"function"===(null===(t=n.values[0])||void 0===t?void 0:t.type)?{type:"undefined"}:n}return e}function C(e){return 0===e.values.length||e.values.every((t=>t.type===e.values[0].type))}const T=new WeakMap;function M(e,t,n,o){if(!(0,c.l)())return;const r=T.get(e),i={version:t.getVersion(),getResult:o};void 0===r?T.set(e,{[n]:i}):r[n]=i}function P(e,t,n){if(!(0,c.l)())return;const o=T.get(e),r=null==o?void 0:o[n];return r?r.version!==t.getVersion()?void(null==o||delete o[n]):r.getResult():void 0}function A(e){if("formula"!==e.type)return[];if("v2"===e.version){const t=(0,c.l)();return e.formula2&&t?t.getFormula2Dependencies(e.formula2.code):[]}return(0,f.b$)(e.formula)}function R(e){var t,n;return e&&"formula"===e.type?"v2"===e.version?(null==e||null===(n=e.formula2)||void 0===n?void 0:n.result_type.type)??"unknown":(null===(t=e.formula)||void 0===t?void 0:t.result_type)??"unknown":"unknown"}function D(e){var t,n;return e&&"formula"===e.type?"v2"===e.version?null!=e&&null!==(n=e.formula2)&&void 0!==n&&n.result_type?(0,m.aL)(e.formula2.result_type).type??"unknown":"unknown":(null===(t=e.formula)||void 0===t?void 0:t.result_type)??"unknown":"unknown"}function B(e){return"string"==typeof e?{type:"text",value:(0,y.TPx)(e)}:"number"==typeof e?{type:"number",value:e}:"boolean"==typeof e?{type:"checkbox",value:e}:(0,s.U3)(e)?{type:"date",value:e}:{type:"undefined"}}function E(e){let{schema:t,property:n,blockModel:o,getRecordModel:r,intl:a,userTimeZone:s,depth:c,resultCache:d,formulaTimeoutTimestampMs:u,visitedProperties:p,formula2Error:m}=e;const f=t[n];if("v2"===f.version){if(!f.formula2)return;const e=_({block:o,property:n,formulaCode:f.formula2.code,getRecordModel:r,intl:a,userTimeZone:s,depth:c,visitedProperties:p??new Set,formulaTimeoutTimestampMs:u,formula2Error:m,resultCache:d});if(!e)return;return"date"===e.type?(0,l.ZV)({value:e.value,userTimeZone:s,intl:a,allowRelativeDates:!1}):(0,i.QT)({result:e,getRecordModel:r,userTimeZone:s,intl:a})}{const{formula:e}=f;if(e)return(0,g.AH)({schema:t,property:n,block:o,getRecordModel:r,collectionRequestContext:{userId:void 0,userTimeZone:s,depth:c,intl:a,resultCache:d,visitedProperties:p??new Set,formulaTimeoutTimestampMs:u},formula2Error:m})}}function F(e){let{resultCache:t,blockId:n,property:o,value:r}=e;const i=t.get(n)??new Map;i.set(`${o}:${a.Hi.FormulaValue2}`,r),t.set(n,i)}function Z(e){var t;let{resultCache:n,blockId:o,property:r}=e;return null===(t=n.get(o))||void 0===t?void 0:t.get(`${r}:${a.Hi.FormulaValue2}`)}function U(e){if("array"===e.type){const t=(0,m.B8)(e.of);return u.YD[t.type]}return u.l7[e.type]}function V(e){return"formula"===e.type&&Boolean("number"===R(e)||e.formula2&&"number"===(0,m.aL)(e.formula2.result_type).type)}},114714:(e,t,n)=>{n.d(t,{A1:()=>j,Cc:()=>Te,H1:()=>N,HB:()=>B,HH:()=>re,Hd:()=>te,Hk:()=>ge,KW:()=>ne,Kp:()=>ke,LG:()=>Q,Lr:()=>oe,Mc:()=>O,N2:()=>ye,Qq:()=>se,R7:()=>D,RA:()=>q,Rc:()=>U,S1:()=>E,TD:()=>V,Tr:()=>le,Uh:()=>we,Vb:()=>Ie,Wz:()=>W,YG:()=>Ce,ZH:()=>ae,aB:()=>R,b7:()=>Re,bk:()=>he,dQ:()=>xe,eF:()=>X,fw:()=>Pe,g4:()=>$,ib:()=>L,mD:()=>ee,mu:()=>be,n6:()=>ve,nP:()=>G,pd:()=>Z,q6:()=>F,qQ:()=>ue,sM:()=>Y,t2:()=>H,tL:()=>K,vu:()=>_e,we:()=>ie,z8:()=>Se,zb:()=>z});n(430541),n(757658);var o=n(653965),r=n(401898),i=n(212847),a=n(164945),s=n(830823),l=n(435011),c=n(180951),d=n(253877),u=n(484682),p=n(238297),m=n(959753),g=n(882883),f=n(606287),h=n(989470),v=n(421838);const y=i.object({required:{type:i.literal("select"),value:i.undefinable(i.string())},optional:{}}),b=i.object({required:{type:i.literal("multi_select"),value:i.undefinable(i.string())},optional:{}}),_=i.object({required:{type:i.literal("status"),value:i.undefinable(i.union([i.object({required:{type:i.literal("by_group"),group:i.string()},optional:{}}),i.object({required:{type:i.literal("by_option"),option:i.string()},optional:{}})]))},optional:{}}),S=i.object({required:{type:i.union([i.literal("person"),i.literal("created_by"),i.literal("last_edited_by")]),value:i.undefinable(i.object({required:{table:i.literal("notion_user"),id:i.string()},optional:{}}))},optional:{}}),k=i.object({required:{type:i.literal("relation"),value:i.undefinable(i.union([i.object({required:{table:i.literal("block"),id:i.string(),spaceId:i.string()},optional:{}}),i.object({required:{type:i.literal("relative"),value:i.object({required:{type:i.literal("builtin"),variable:i.union([i.literal("current"),i.literal("next")])},optional:{}})},optional:{}})]))},optional:{}}),w=i.object({required:{type:i.literal("location"),value:i.undefinable(i.object({required:{table:i.literal("collection"),id:i.string(),spaceId:i.string()},optional:{}}))},optional:{}}),x=i.object({required:{type:i.union([i.literal("date"),i.literal("created_time"),i.literal("last_edited_time")]),value:i.undefinable(i.any())},optional:{}}),I=i.object({required:{type:i.union([i.literal("text"),i.literal("title"),i.literal("url"),i.literal("email"),i.literal("phone_number")]),value:i.undefinable(i.any())},optional:{}}),C=i.object({required:{type:i.literal("number"),value:i.undefinable(i.any())},optional:{}}),T=i.object({required:{type:i.literal("checkbox"),value:i.boolean()},optional:{}}),M=i.object({required:{type:i.literal("formula"),value:i.undefinable(i.any())},optional:{}}),P=(i.union([y,b,_,S,k,x,I,C,T,M,w]),{select:!0,multi_select:!0,person:!0}),A={select:!0,multi_select:!0,status:!0,person:!0,relation:!0,date:!0,text:!0,title:!0,url:!0,email:!0,phone_number:!0,number:!0,checkbox:!0,formula:!0,created_by:!0,last_edited_by:!0,created_time:!0,last_edited_time:!0,last_visited_time:!0,location:!0};function R(e){return B(e.type)}function D(e){return B(e.type)}function B(e){return(0,c.TN)(e)}function E(e){return Z(e.type)}function F(e){return Z(e.type)}function Z(e){return"person"===e||"created_by"===e||"last_edited_by"===e}function U(e){return N(e.type)}function V(e){return N(e.type)}function N(e){return"status"===e}function O(e){return j(e.type)}function L(e){return j(e.type)}function j(e){return"date"===e||"created_time"===e||"last_edited_time"===e||"last_visited_time"===e}function K(e){return z(e.type)}function z(e){return"relation"===e}function q(e){return!!e&&"table"in e}function H(e){return!!e&&("type"in e&&"relative"===e.type)}function G(e){return K(e)&&H(e.value)&&"last"===e.value.value.variable}function W(e,t){return"person"===e.type||"relation"===e.type||("select"===e.type||"multi_select"===e.type?t:R(e)?"exact"===e.groupBy:"status"!==e.type&&"number"!==e.type&&"date"!==e.type&&"checkbox"!==e.type&&"created_by"!==e.type&&"last_edited_by"!==e.type&&"created_time"!==e.type&&"last_edited_time"!==e.type&&"last_visited_time"!==e.type&&"formula"!==e.type&&"location"!==e.type&&void(0,r.t1)(e.type))}function $(e){return e.type in P}function Y(e){return e in A}function Q(e){if("formula"===e.type){const t=(0,l.mm)(e);return"array"!==t&&"unknown"!==t}return Y(e.type)}const J="uncategorized";function X(e){return"boolean"==typeof e.hidden?e.hidden:"boolean"==typeof e.hiddenByDefault?e.hiddenByDefault:Boolean(e.emptyHidden)}function ee(e){return e?te(e.value):J}function te(e){if(!e.value)return`${e.type}:${J}`;if("select"===e.type||"multi_select"===e.type)return`${e.type}:${e.value}`;if("status"===e.type){const t="by_group"===e.value.type?e.value.group:e.value.option;return`${e.type}:${e.value.type}-${t}`}if(F(e)||"location"===e.type)return`${e.type}:${e.value.id}`;if("relation"===e.type){const t=e.value;return q(t)?`${e.type}:${t.id}`:`${e.type}:${t.type}:${t.value.variable}`}if(O(e)){const t=fe(e.value);return`${e.type}:${t?t.start_date:e.value.type}`}if(D(e))return`${e.type}:${"other"===e.value.type?e.value.type:e.value.value.trim()}`;if("number"===e.type){const t=e.value.type;if("range"===t)return`${e.type}:${e.value.start}:${e.value.end}`;if("out_of_range"===t)return`${e.type}:${t}`;if("unique"===t)return`${e.type}:${t}:${e.value.value}`;(0,r.t1)(t)}return"checkbox"===e.type?`${e.type}:${e.value}`:"formula"===e.type?`${e.type}:${te(e.value)}`:void(0,r.t1)(e)}function ne(e){return oe(e.map((e=>te(e.value))))}function oe(e){return e.join(":")}function re(e,t){return e.length===t.length&&!e.find(((e,n)=>!ie(e.value,t[n].value)))}function ie(e,t){if(e===t)return!0;if(!e||!t)return e===t;if("select"===e.type||"multi_select"===e.type)return t.type===e.type&&(void 0!==e.value&&t.value,e.value===t.value);if("status"===e.type)return t.type===e.type&&(void 0!==e.value&&void 0!==t.value?"by_group"===e.value.type&&"by_group"===t.value.type&&e.value.group===t.value.group||"by_option"===e.value.type&&"by_option"===t.value.type&&e.value.option===t.value.option:e.value===t.value);if(F(e)||"location"===e.type)return t.type===e.type&&(void 0!==e.value&&void 0!==t.value?e.value.table===t.value.table&&e.value.id===t.value.id:e.value===t.value);if("relation"===e.type)return t.type===e.type&&(void 0!==e.value&&void 0!==t.value?q(e.value)&&q(t.value)?e.value.table===t.value.table&&e.value.id===t.value.id:!(!H(e.value)||!H(t.value))&&(e.value.type===t.value.type&&e.value.value.variable===t.value.value.variable):e.value===t.value);if(O(e)){if(t.type!==e.type)return!1;if(void 0!==e.value&&void 0!==t.value){const n=fe(e.value),r=fe(t.value);return void 0!==n&&void 0!==r?o.Xy(n,r):e.value.type===t.value.type}return e.value===t.value}if(D(e))return t.type===e.type&&(void 0!==e.value&&void 0!==t.value?"exact"===e.value.type&&"exact"===t.value.type||"alphabet_prefix"===e.value.type&&"alphabet_prefix"===t.value.type?e.value.value.trim()===t.value.value.trim():"other"===e.value.type&&"other"===t.value.type:e.value===t.value);if("number"===e.type){if(t.type!==e.type)return!1;if(void 0!==e.value&&void 0!==t.value){if("range"===e.value.type&&"range"===t.value.type)return e.value.start===t.value.start&&e.value.end===t.value.end;if("out_of_range"===e.value.type&&"out_of_range"===t.value.type)return!0}return e.value===t.value}return"checkbox"===e.type?t.type===e.type&&e.value===t.value:"formula"===e.type?t.type===e.type&&ie(e.value,t.value):void(0,r.t1)(e)}function ae(e,t){return e===t||!(!e||!t)&&ie(e.value,t.value)}function se(e){const{schema:t,groupBy:n}=e,{property:o}=n,r=t[o];if(r&&("select"===r.type||"multi_select"===r.type)){const e=(r.options||[]).map((e=>"select"===r.type?{type:"select",value:e.value}:{type:"multi_select",value:e.value}));return e.unshift({type:r.type,value:void 0}),e}if(r&&"status"===r.type){if("status"!==n.type)return;return"group"===n.groupBy?(r.groups??[]).map((e=>({type:"status",value:{type:"by_group",group:e.name}}))):(r.options??[]).map((e=>({type:"status",value:{type:"by_option",option:e.value}})))}if(r&&"checkbox"===r.type){return[{type:"checkbox",value:!0},{type:"checkbox",value:!1}]}}function le(e){const{block:t,schema:n,groupBy:o,getRecordModel:i,propertyMapping:a,relativeVariableResult:y,collectionRequestContext:b}=e,{userId:_,userTimeZone:S,intl:k}=b,w=n[o.property];if(!w||!Q(w))return;const x=(0,c.wS)(t,(null==a?void 0:a[o.property])??o.property,i);if("select"===w.type){const e=(0,c.Sj)(x,w.options||[]);return e?[{type:"select",value:e}]:[{type:"select",value:void 0}]}if("multi_select"===w.type){const e=(0,c.uP)(x,w.options||[]);return e.length>0?e.map((e=>({type:"multi_select",value:e}))):[{type:"multi_select",value:void 0}]}if("status"===w.type){if("status"!==o.type)return;const e=w.options??[],t=(0,c.ZG)(x,w),n=e.find((e=>e.value===t)),r=(w.groups??[]).find((e=>{var t;return n&&(null===(t=e.optionIds)||void 0===t?void 0:t.includes(n.id))}));return"group"===o.groupBy&&r?[{type:"status",value:{type:"by_group",group:r.name}}]:"option"===o.groupBy&&n?[{type:"status",value:{type:"by_option",option:n.value}}]:[{type:"status",value:void 0}]}if("person"===w.type){const e=m.kk5.fromBlock(t),n=(0,c.DW)({textValue:x,propertySchema:w,blockCreatorPointer:e.getCreatedByPointer()});return n.length>0?n.map((e=>({type:"person",value:e}))):[{type:"person",value:void 0}]}if("relation"===w.type){const e=(0,c.rq)(x);if(e.length>0){const t=w.collection_pointer,n=t&&y&&y[t.id],o=[];return e.forEach((e=>{var t;e.spaceId||(e.spaceId=null==w||null===(t=w.collection_pointer)||void 0===t?void 0:t.spaceId);const r=ue({relativeVariableValues:n,pointer:e});if(r.length>0)o.push(...r);else{const t={type:"relation",value:e};o.push(t)}})),o}return[{type:"relation",value:void 0}]}if("location"===w.type)return[{type:"location",value:(0,c.UB)({block:t})}];if("date"===w.type){if("date"!==o.type)return;return pe({dateValue:(0,c.Gl)(x),intl:k,userTimeZone:S,groupBy:o})}if("created_time"===w.type){if("created_time"!==o.type)return;if(!t.created_time)return[{type:"created_time",value:void 0}];return pe({dateValue:(0,d.CQ)(t.created_time,S),intl:k,userTimeZone:S,groupBy:o})}if("last_edited_time"===w.type){if("last_edited_time"!==o.type)return;if(!t.last_edited_time)return[{type:"number",value:void 0}];return pe({dateValue:(0,d.CQ)(t.last_edited_time,S),intl:k,userTimeZone:S,groupBy:o})}if("last_visited_time"===w.type){if("last_visited_time"!==o.type)return;if(!_)return;const e=(0,h.Pv)({parent_id:t.id,user_id:_}),n=i({table:h.UI,id:e,spaceId:t.space_id}),r=null==n?void 0:n.getVisitedAt();if(!r)return[{type:"last_visited_time",value:void 0}];return pe({dateValue:(0,d.CQ)(r,S),intl:k,userTimeZone:S,groupBy:o})}if("created_by"===w.type){if("created_by"!==o.type)return;return t.created_by_id&&t.created_by_table?[{type:"created_by",value:{table:t.created_by_table,id:t.created_by_id,spaceId:t.space_id}}]:[{type:"created_by",value:void 0}]}if("last_edited_by"===w.type){if("last_edited_by"!==o.type)return;return t.last_edited_by_id&&t.last_edited_by_table?[{type:"last_edited_by",value:{table:t.last_edited_by_table,id:t.last_edited_by_id,spaceId:t.space_id}}]:[{type:"last_edited_by",value:void 0}]}if(B(w.type)){if(!R(o))return;const e=m.kk5.fromBlock(t);return de({textValue:(0,s.GJ)({block:e,propertySchema:w,propertyValue:x,getRecordModel:i,collectionRequestContext:b}).value,groupBy:o})}if("number"===w.type){if("number"!==o.type)return;const e=(0,c.VY)(x);if("number"==typeof e){return[{type:"number",value:ve(e,o.start,o.end,o.size,o.groupBy)}]}return[{type:"number",value:void 0}]}if("checkbox"===w.type){if("checkbox"!==o.type)return;return[{type:"checkbox",value:(0,c.Ml)(x)}]}if("formula"===w.type){if("formula"!==o.type)return;const e=o.groupBy,a=(0,p.ky)({block:m.kk5.fromBlock(t),getRecordModel:i});if(!a)return;const s={table:f.vF,id:a.id,spaceId:t.space_id},c=[(0,v.YCD)((0,v.kbv)({collection:s,property:o.property,name:""}))],d="v2"===w.version?(0,l.EC)({block:m.kk5.fromBlock(t),property:o.property,formulaCode:c,getRecordModel:i,intl:k,userTimeZone:S,depth:0,visitedProperties:new Set,formulaTimeoutTimestampMs:b.formulaTimeoutTimestampMs,logFormulaTimeoutFn:b.logFormulaTimeoutFn,logFormulaStatsFn:b.logFormulaStatsFn,resultCache:b.resultCache}):(0,l.uZ)((0,u.Qs)({property:o.property,schema:n,block:m.kk5.fromBlock(t),getRecordModel:i,collectionRequestContext:b})),h=[{type:"formula",value:void 0}];if(!d||"undefined"===d.type)return h;if("text"===e.type){if("text"!==d.type)return h;const t={...e,property:o.property};return ce(de({textValue:(0,g.Xh)({textValue:d.value,getRecordModel:i,intl:k,userTimeZone:S,disableAnnotationPrefix:!0}),groupBy:t}))}if("number"===e.type){if("number"!==d.type)return h;return ce([{type:"number",value:ve(d.value,e.start,e.end,e.size,e.groupBy)}])}if("checkbox"===e.type)return"checkbox"!==d.type?h:ce([{type:"checkbox",value:d.value}]);if("date"===e.type){if("date"!==d.type)return h;const t=pe({dateValue:d.value,intl:k,userTimeZone:S,groupBy:{...e,property:o.property}});return ce(t?t.filter((e=>"date"===e.type)):void 0)}if("person"===e.type||"last_edited_by"===e.type||"created_by"===e.type){if("person"!==d.type)return h;return ce([{type:"person",value:d.value}])}if("relation"===e.type){if("block"!==d.type)return h;const e=i(d.value);if(!e)return h;const t=e.getRenderTitle({getRecordModel:i,userTimeZone:S,intl:k});return t?ce([{type:"text",value:{type:"exact",value:t}}]):h}(0,r.t1)(e.type)}(0,r.t1)(w.type)}function ce(e){if(e)return e.map((e=>({type:"formula",value:e})))}function de(e){const{textValue:t,groupBy:n}=e;if(R(n)){if(!t)return[{type:n.type,value:void 0}];if("alphabet_prefix"===n.groupBy){const e=he(t);return e?[{type:n.type,value:{type:"alphabet_prefix",value:e}}]:[{type:n.type,value:{type:"other"}}]}if("exact"===n.groupBy)return[{type:n.type,value:{type:"exact",value:t}}];(0,r.t1)(n.groupBy)}}function ue(e){const{relativeVariableValues:t,pointer:n}=e;if(!t)return[];const o=[];return Object.entries(t).forEach((e=>{let[t,r]=e;if(n.id===r){const e={type:"relation",value:{type:"relative",value:{type:"builtin",variable:t}}};o.push(e)}})),o}function pe(e){const{dateValue:t,groupBy:n,userTimeZone:o,intl:i}=e;if(!L(n))return;if(!t)return[{type:n.type,value:void 0}];const a=(0,d.NK)(t,o,i.locale).start.setZone(o);if("relative"===n.groupBy){const e=me(a,o);return e?[{type:n.type,value:e}]:[{type:n.type,value:{type:"month",range:d.OQ.toPersistedDateRange({start:a.startOf("month"),end:a.endOf("month")},null)}}]}return"day"===n.groupBy?[{type:n.type,value:{type:"day",range:d.OQ.toPersistedDateRange({start:a.startOf("day"),end:a.endOf("day")},null)}}]:"week"===n.groupBy?[{type:n.type,value:{type:"week",range:d.OQ.toPersistedDateRange({start:a.startOf("week"),end:a.endOf("week")},null)}}]:"month"===n.groupBy?[{type:n.type,value:{type:"month",range:d.OQ.toPersistedDateRange({start:a.startOf("month"),end:a.endOf("month")},null)}}]:"year"===n.groupBy?[{type:n.type,value:{type:"year",range:d.OQ.toPersistedDateRange({start:a.startOf("year"),end:a.endOf("year")},null)}}]:void(0,r.t1)(n.groupBy)}function me(e,t){const n=(0,d.Uu)(t).startOf("day"),o=e.diff(n,"days").days;return o>=0?o<1?{type:"today"}:o<2?{type:"tomorrow"}:o<8?{type:"next_7_days"}:o<31?{type:"next_30_days"}:void 0:o>=-1?{type:"yesterday"}:o>=-7?{type:"last_7_days"}:o>=-30?{type:"last_30_days"}:void 0}function ge(e,t){const n=(0,d.Uu)(t);if("today"===e.type)return{start:n.startOf("day"),end:n.endOf("day")};if("yesterday"===e.type)return{start:n.minus({days:1}).startOf("day"),end:n.minus({days:1}).endOf("day")};if("last_7_days"===e.type)return{start:n.minus({days:7}).startOf("day"),end:n.minus({days:2}).endOf("day")};if("last_30_days"===e.type)return{start:n.minus({days:30}).startOf("day"),end:n.minus({days:8}).endOf("day")};if("tomorrow"===e.type)return{start:n.plus({days:1}).startOf("day"),end:n.plus({days:1}).endOf("day")};if("next_7_days"===e.type)return{start:n.plus({days:2}).startOf("day"),end:n.plus({days:7}).endOf("day")};if("next_30_days"===e.type)return{start:n.plus({days:8}).startOf("day"),end:n.plus({days:30}).endOf("day")};if("day"===e.type||"week"===e.type||"month"===e.type||"year"===e.type){const n=(0,d.NK)(e.range,t);return{start:n.start.startOf("day"),end:n.end.endOf("day")}}(0,r.t1)(e)}function fe(e){return"today"===e.type||"yesterday"===e.type||"last_7_days"===e.type||"last_30_days"===e.type||"tomorrow"===e.type||"next_7_days"===e.type||"next_30_days"===e.type?void 0:e.range}function he(e){const t=e.toUpperCase()[0];if(/^[A-Z0-9]$/.test(t))return t}function ve(e,t,n,r,i){if("unique"===(null==i?void 0:i.type))return{type:"unique",value:e};if(e<t||e>n)return{type:"out_of_range",start:t,end:n};const a=t+Math.floor((e-t)/r)*r,s=a+r;return{type:"range",start:o.NM(a,Ae),end:o.NM(s,Ae)}}function ye(e){return"checkbox"===(0,l.mm)(e)?{type:"formula",value:{type:"checkbox",value:!1}}:"checkbox"===e.type?{type:"checkbox",value:!1}:"created_by"===e.type||"last_edited_by"===e.type||"created_time"===e.type||"last_edited_time"===e.type||"location"===e.type?void 0:{type:e.type,value:void 0}}function be(e){return"formula"===e.type?e.groupBy.sort:e.sort}const _e=["group","option"],Se=["relative","day","week","month","year"],ke=["exact","alphabet_prefix"],we="collection_groups",xe="collection_group_aggregation",Ie={aggregator:"count",property:void 0,enforceMaxAggregationLimit:!0};function Ce(e){return Z(e.type)||"checkbox"===e.type?["manual"]:"select"===e.type||"multi_select"===e.type||"status"===e.type||"relation"===e.type?["manual","ascending","descending"]:j(e.type)?["ascending","descending"]:B(e.type)?["manual","ascending","descending"]:"number"===e.type?["ascending","descending"]:"formula"===e.type?Ce(e.groupBy):"location"===e.type?["manual","ascending","descending"]:void(0,r.t1)(e.type)}function Te(e){if(Z(e.type)||"checkbox"===e.type){const t={...e};return t.sort={type:"manual"},t}if("select"===e.type||"multi_select"===e.type){const t={...e};return t.sort={type:"ascending"},t}if("status"===e.type){const t={...e};return t.sort={type:"ascending"},t}if("relation"===e.type){const t={...e};return t.sort={type:"ascending"},t}if(j(e.type)){const t={...e};return t.sort={type:"ascending"},t}if(B(e.type)){const t={...e};return t.sort={type:"ascending"},t}if("number"===e.type){const t={...e};return t.sort={type:"ascending"},t}if("formula"===e.type)return Te(e.groupBy);if("location"===e.type){const t={...e};return t.sort={type:"ascending"},t}(0,r.t1)(e.type)}function Me(e,t,n){const o=void 0===n||n;return"select"===e||"multi_select"===e||Z(e)?{...t,type:e,hideEmptyGroups:o,sort:{type:"manual"}}:"status"===e?{...t,type:e,hideEmptyGroups:o,groupBy:"option",sort:{type:"ascending"}}:"relation"===e||"location"===e?{...t,hideEmptyGroups:o,type:e,sort:{type:"ascending"}}:j(e)?{...t,hideEmptyGroups:o,type:e,groupBy:"relative",sort:{type:"ascending"}}:"phone_number"===e||B(e)?{...t,hideEmptyGroups:o,type:e,groupBy:"exact",sort:{type:"ascending"}}:"number"===e?{...t,hideEmptyGroups:o,type:e,start:0,end:1e3,size:100,sort:{type:"ascending"}}:"checkbox"===e?{...t,hideEmptyGroups:o,type:e,sort:{type:"manual"}}:void(0,r.t1)(e)}function Pe(e){const{property:t,propertySchema:n,isCollectionTypedView:o,hideEmptyGroups:r}=e,i=void 0===r||r,a={property:t};if("formula"===n.type){const e=(0,l.mm)(n);return"array"===e||"unknown"===e?{...a,type:"formula",hideEmptyGroups:i,groupBy:Me("number",a)}:"block"===e?{type:"formula",hideEmptyGroups:i,groupBy:Me("relation",a),...a}:{type:"formula",hideEmptyGroups:i,groupBy:Me(e,a),...a}}const s=Me(n.type,a,i);return o&&"status"===s.type&&(s.groupBy="group"),s}const Ae=10;function Re(e,t,n){var o;return"chart_config"===t?null!=e&&e.chart_config&&"placeholder"!==e.chart_config.type&&"groups_reducer"===e.chart_config.dataConfig.type?(0,a.u)(null==e?void 0:e.chart_config)&&"chart_subgroups"===n?null===(o=e.chart_config.dataConfig.aggregationConfig.stackOptions)||void 0===o?void 0:o.groupBy:e.chart_config.dataConfig.groupBy:void 0:e[t]}},399036:(e,t,n)=>{n.d(t,{$u:()=>I,Ch:()=>Me,D1:()=>K,DS:()=>J,Dv:()=>he,EY:()=>C,Eu:()=>le,F0:()=>w,Fn:()=>ge,G$:()=>W,HC:()=>ue,HF:()=>Ce,I4:()=>S,K6:()=>k,KR:()=>j,LS:()=>T,Lt:()=>oe,MD:()=>X,MY:()=>Se,NK:()=>F,Pr:()=>L,Qr:()=>De,RR:()=>Pe,TL:()=>_,TN:()=>B,Tr:()=>A,U8:()=>q,XT:()=>pe,XU:()=>D,Yl:()=>ne,ZY:()=>G,a5:()=>ve,bf:()=>Ie,bx:()=>ce,by:()=>ee,cd:()=>de,ci:()=>Ae,cu:()=>U,dx:()=>N,en:()=>re,fc:()=>P,g0:()=>O,gB:()=>Z,gq:()=>me,iE:()=>V,iw:()=>xe,j0:()=>x,kc:()=>z,oC:()=>fe,ow:()=>Re,p_:()=>E,pn:()=>we,q3:()=>Y,qQ:()=>$,rX:()=>se,t:()=>H,uS:()=>be,ub:()=>ie,uk:()=>ae,us:()=>Te,xo:()=>Q});n(757658);var o=n(531701),r=n(653965),i=n(215828),a=n(401898),s=n(619584),l=n(212847),c=n(687205),d=n(841892),u=n(202032),p=n(598953),m=n(435011),g=n(142613),f=n(318955),h=n(471924),v=n(959753),y=n(606287),b=n(23867);l.intersection([l.object({optional:{},required:{auto_update_on_edit:l.boolean()}}),l.union([l.object({required:{type:l.literal("custom"),prompt:l.string()},optional:{}}),l.object({required:{type:l.literal("extract"),prompt:l.string()},optional:{}}),l.object({required:{type:l.literal("summarize")},optional:{}}),l.object({required:{type:l.literal("translate"),targetProperties:l.array(l.string()),toLanguage:l.literals(...c.nI.map((e=>e.key)))},optional:{}}),l.object({required:{type:l.literals("select"),add_options:l.boolean()},optional:{prompt:l.string()}}),l.object({required:{type:l.literals("multi_select"),add_options:l.boolean()},optional:{prompt:l.string()}})])]);function _(e){const t=o.AP.filter((t=>!e.find((e=>e.color===t)))),n=t.length>0?t:o.AP;return n[r.MX(0,n.length-1)]}function S(e,t){const n=[{id:h.Il(),value:t.formatMessage(g.i9.statusOptionNotStarted)},{id:h.Il(),value:t.formatMessage(g.i9.statusOptionInProgress),color:"blue"},{id:h.Il(),value:t.formatMessage(g.i9.statusOptionDone),color:"green"}];return{name:e,type:"status",options:n,groups:[{id:h.Il(),name:g.G1,optionIds:[n[0].id],color:"gray"},{id:h.Il(),name:g.Ho,optionIds:[n[1].id],color:"blue"},{id:h.Il(),name:g.RW,optionIds:[n[2].id],color:"green"}],defaultOption:t.formatMessage(g.i9.statusOptionNotStarted)}}let k=function(e){return e[e.SyncProjects=0]="SyncProjects",e[e.SyncAdditionalProperties=1]="SyncAdditionalProperties",e}({});function w(e){var t;return(null===(t=e.collection_pointer)||void 0===t?void 0:t.id)??e.collection_id}function x(e){return e.collection_pointer??(void 0!==e.collection_id?{table:y.vF,id:e.collection_id,spaceId:(0,b.C)(void 0)}:void 0)}function I(e){var t;const{propertySchema:n,property:o,sourceCollectionId:r,targetCollectionSchema:i}=e;if(!n.property)return!1;const a=Boolean(i[n.property]&&"relation"===(null===(t=i[n.property])||void 0===t?void 0:t.type));return(n.property!==o||w(n)!==r)&&a}function C(e,t){var n;const o=v.kk5.fromCollection(t),r=e.id,i=e.propertyId,a=e.propertySchema,s=o.id,l=a.property;if(!l)return!1;const c=o.getNormalizedSchema()[l];if(!c)return!1;if(!("relation"===c.type))return!1;if(!((null===(n=x(c))||void 0===n?void 0:n.id)===r&&c.property===i))return!1;const d=r===s&&i===l;return!(!a.version&&d)}function T(e){const{type:t}=e;switch(t){case"title":case"text":return"text";case"relation":return"relation";case"checkbox":case"number":case"person":case"file":case"url":case"email":case"phone_number":case"created_time":case"created_by":case"last_edited_time":case"last_edited_by":case"last_visited_time":case"formula":case"rollup":case"select":case"multi_select":case"date":case"button":case"status":case"auto_increment_id":case"location":case"verification":return"arrow";default:(0,a.t1)(t)}}const M=["person","date"];function P(e){return void 0!==e&&"string"==typeof e&&M.includes(e)}const A=["text","number","select","multi_select","status","date","person","file","checkbox","url","email","phone_number","formula","relation","rollup","created_time","created_by","last_edited_time","last_edited_by","button","auto_increment_id","verification"],R=["ai_summary","ai_custom_prompt","ai_extract","ai_translate","ai_keywords"],D=(0,a.AO)((e=>R.includes(e)?{true:e}:{false:e}));function B(e){if(D(e))switch(e){case"ai_custom_prompt":case"ai_summary":case"ai_extract":case"ai_translate":return"text";case"ai_keywords":return"multi_select";default:(0,a.t1)(e)}return e}function E(e){return"relation"===e.type}function F(e){return"relation"===e.type&&Boolean(e.connectedRelation)}function Z(e){return"status"===e.type}function U(e){return"select"===e.type||"multi_select"===e.type}function V(e){return"verification"===e.type}function N(e){return"relation"===e.type||"verification"===e.type||"auto_increment_id"===e.type}function O(e){return A.includes(e.type)&&!N(e)}function L(e){return!!e&&("person"===e.type||"multi_select"===e.type||"select"===e.type||"status"===e.type||"number"===e.type||"email"===e.type||"phone_number"===e.type||"text"===e.type||"title"===e.type||"url"===e.type||"relation"===e.type)}function j(e){return"person"===e.type}function K(e){return"button"===e.type}function z(e){return"title"===e.type}function q(e){return j(e)||function(e){return"created_by"===e.type}(e)||function(e){return"last_edited_by"===e.type}(e)}function H(e){return Z(e)||U(e)}function G(e){return"created_by"===e||"created_time"===e||"last_edited_by"===e||"last_edited_time"===e||"auto_increment_id"===e||"location"===e}function W(e){return"number"===e.type}const $=(0,a.AO)((e=>"text"===e.type||"select"===e.type||"multi_select"===e.type?{true:e}:{false:e}));function Y(e){if(e)switch(e.type){case"text":return e.ai_inference;case"select":case"multi_select":return e.select_ai_inference;default:return}}function Q(e){switch(e.type){case"text":return"ai_inference";case"select":case"multi_select":return"select_ai_inference";default:(0,a.t1)(e)}}function J(e){if(!e)return!1;switch(e.type){case"extract":case"custom":return!0;case"select":case"multi_select":case"summarize":case"translate":return!1;default:throw(0,a.t1)(e)}}const X=(0,a.AO)((e=>"custom"===e||"extract"===e||"translate"===e||"summarize"===e?{true:e}:{false:e}));function ee(e,t){return!!e&&(!("text"!==t||!X(e.type))||("select"===t||"multi_select"===t)&&e.type===t)}const te=["text","title","url","email","phone_number","number"];function ne(e){return te.includes(e)}function oe(e){const t=(0,m.mm)(e);return"formula"===e.type?"date"===t:"rollup"===e.type?Boolean(e.relation_property&&e.target_property&&e.aggregation&&"date"===(0,u.W6)((0,u.gu)(e.aggregation))):"date"===e.type||"created_time"===e.type||"last_edited_time"===e.type}function re(e){return"relation"===e.type||"person"===e.type}const ie=["text","relation","url","select","multi_select","person","number","email","phone_number","title"],ae=["created_by","created_time","checkbox","last_edited_by","last_edited_time","location"],se=["verification","button"],le=["verification","button"],ce="Yes",de=[[ce]],ue="No",pe=[[ue]],me=1e3;function ge(e){const t={},n=Object.keys(e);for(const o of n)(0,i.j5)(o)&&(t[o]=e[o]);return t}function fe(e){const t={...ke(e),...ye(null==e?void 0:e.schema,null==e?void 0:e.id)},n=be(t);return t[n]||(t[n]={type:xe,name:"Name"}),t}function he(e){return ye(null==e?void 0:e.deleted_schema)}function ve(e){return ye(e.block_schema)}function ye(e,t){return function(e,t){const n={...e};let o=!1;const r=Object.keys(n);for(const i of r){const e=n[i];if(e)if((U(e)||Z(e))&&e.options){const r=new Set,a=[];for(const n of e.options)n.value&&!r.has(n.value)&&(r.add(n.value),n.collectionIds=t?[t]:void 0,a.push(n));a.length!==e.options.length&&(n[i]={...e,options:a},o=!0)}else if("relation"===e.type)x(e)?e.property||e.version||(n[i]={...e,property:i},o=!0):(n[i]={name:e.name,type:"text"},o=!0);else if("formula"===e.type){const t=e.formula?f.as(e.formula):void 0;n[i]={...e,formula:t},o=!0}else void 0===e.type&&(n[i]=void 0)}return{wasNormalized:o,normalizedSchema:n}}(e,t).normalizedSchema}function be(e){return Ie in e?Ie:xe}const _e=new WeakMap;function Se(e){const t=_e.get(e);if(t)return t;const n=fe(e);return _e.set(e,n),n}function ke(e){var t,n;return null!=e&&null!==(t=e.format)&&void 0!==t&&t.external_schema?(0,s.m8)(Object.entries(null==e||null===(n=e.format)||void 0===n?void 0:n.external_schema).flatMap((t=>{let[n,o]=t;if(void 0===o)return[];const r=`${p.U}${n}`;if("relation"===(null==o?void 0:o.type)){var i;const t=null===(i=e.format)||void 0===i||null===(i=i.related_external_object_uris_to_instance_ids)||void 0===i?void 0:i[o.uri];return t?[[r,{name:o.name,type:null==o?void 0:o.type,collection_id:t,collection_pointer:{table:y.vF,id:t,spaceId:e.space_id}}]]:[]}return[[r,o]]}))):{}}function we(e){return Ce(e)||Te(e)}const xe="title",Ie=`${p.U}${xe}`;function Ce(e){return e===xe}function Te(e){return e===Ie}d.Z.images.icons.titlePng,d.Z.images.icons.textPng,d.Z.images.icons.numberPng,d.Z.images.icons.urlPng,d.Z.images.icons.selectPng,d.Z.images.icons.multipleSelectPng,d.Z.images.icons.typesStatusSvg,d.Z.images.icons.personPng,d.Z.images.icons.emailPng,d.Z.images.icons.phoneNumberPng,d.Z.images.icons.datePng,d.Z.images.icons.filePng,d.Z.images.icons.checkboxPng,d.Z.images.icons.formulaPng,d.Z.images.icons.relationPng,d.Z.images.icons.relationPng,d.Z.images.icons.createdAtPng,d.Z.images.icons.createdByPng,d.Z.images.icons.createdAtPng,d.Z.images.icons.createdByPng,d.Z.images.icons.createdAtPng,d.Z.images.icons.formulaPng,d.Z.images.icons.idPng,d.Z.images.icons.locationPng,d.Z.images.icons.verificationSvg;function Me(e){const{collectionId:t,property:n,propertySchema:o,newOption:i,isAscending:a}=e,s=o.options||[],l=r.cx(s,(e=>e.value.localeCompare(i.value,void 0,{sensitivity:"base"})*(a?1:-1)>=0));return-1!==l?{pointer:{table:y.vF,id:t},command:"keyedObjectListBefore",path:["schema",n,"options"],args:{value:i,before:s[l]}}:{pointer:{table:y.vF,id:t},command:"keyedObjectListAfter",path:["schema",n,"options"],args:{value:i}}}function Pe(e){const{newTokenValues:t,property:n,propertySchema:o,collectionId:r}=e;if(!U(o))return;const i=o.options||[],a=t.flatMap((e=>e.filter((e=>!i.find((t=>t.value===e)))))),s=[];return a.forEach((e=>{const t=_(i),a={id:h.Il(),value:e,color:t};"alphabetical"===o.auto_sort_options||"reverse_alphabetical"===o.auto_sort_options?s.push(Me({collectionId:r,property:n,propertySchema:o,newOption:a,isAscending:"alphabetical"===o.auto_sort_options})):s.push({pointer:{table:y.vF,id:r},command:"keyedObjectListAfter",path:["schema",n,"options"],args:{value:a}})})),s}const Ae=50,Re="virtual_summary",De={name:"AI summary",type:"text",ai_inference:{type:"summarize",auto_update_on_edit:!1}}},180951:(e,t,n)=>{n.d(t,{A0:()=>Se,Ak:()=>q,BW:()=>ue,BY:()=>pe,C1:()=>de,CC:()=>Ae,DW:()=>ce,Ds:()=>Le,GL:()=>et,Gk:()=>V,Gl:()=>se,Hw:()=>Be,IQ:()=>je,Is:()=>ee,KK:()=>We,Kf:()=>Xe,Kp:()=>_e,LC:()=>Ge,LL:()=>me,Ml:()=>re,NT:()=>Qe,O2:()=>W,P4:()=>G,Pd:()=>ye,Ps:()=>$e,Qm:()=>U,R3:()=>Ie,Sj:()=>H,TN:()=>tt,Tp:()=>X,U8:()=>xe,UB:()=>Ze,VY:()=>Te,ZG:()=>te,_I:()=>ie,_w:()=>J,ah:()=>Ee,bA:()=>Je,bQ:()=>ot,d7:()=>le,e7:()=>Fe,eP:()=>Me,f0:()=>F,fp:()=>D,g:()=>Pe,gC:()=>Ne,gg:()=>ke,gi:()=>Ke,i7:()=>L,iD:()=>De,iT:()=>A,ib:()=>Y,ic:()=>we,j$:()=>he,kc:()=>ve,ln:()=>nt,nW:()=>Ue,ow:()=>fe,pX:()=>be,rO:()=>oe,rq:()=>ge,sJ:()=>qe,sh:()=>ze,uJ:()=>Oe,uP:()=>$,wI:()=>K,wS:()=>R,wV:()=>Ve,xz:()=>Z,yF:()=>Ce,yp:()=>ne,zB:()=>Re,zq:()=>Q});n(757658),n(21703);var o=n(653965),r=n(401898),i=n(266897),a=n(670475),s=n(541432),l=n(598953),c=n(830823),d=n(435011),u=n(399036),p=n(142613),m=n(756373),g=n(516691),f=n(640506),h=n(484795),v=n(714215),y=n(977657),b=(n(80206),n(238297)),_=n(676725),S=n(630845),k=n(959753),w=n(423512),x=(n(300482),n(600606)),I=n(421202),C=n(606287),T=n(519889),M=n(421838),P=n(544876);function A(e,t){const n=e.getCollectionPointer();if(!n)return;const o=t(n);return null==o?void 0:o.getName()}function R(e,t,n){const o=k.kk5.fromBlock(e);if("title"===t&&o.useCrdt()){var i;const e=null===(i=o.getTextSliceTree())||void 0===i?void 0:i.getTextValue();if(e)return e}const a=o.getPropertiesStore().getKeyStore(t).getValue();if(a)return a;if(o.getType()===s.Ti.externalObjectInstancePage&&(0,l.w)(t)||"title"===t){var c;const e=null===(c=o.getExternalObjectAttributes())||void 0===c?void 0:c.find((e=>"title"===t?e.id===t:e.id===t.slice(1)));if(e)return function(e,t,n,o){if(P.AM(e)){if(function(e){var t;return"rich_text"===(null===(t=e.format)||void 0===t?void 0:t.type)}(e))return e.values;return e.values.flatMap((e=>{if("string"==typeof e)return M.TPx(e);if("number"==typeof e)return Me(e);if("boolean"==typeof e)return ie(e);if(P.l1(e))return[];if("date"===e.type||"datetime"===e.type||"datetimerange"===e.type)return le(e);throw(0,r.P)(e),new Error(`Expected attributeValue.type to never occur: " + ${JSON.stringify(e.type)}`)}))}if("embed"===e.type)return e.values.flatMap(De);if("relation"===e.type)return fe(e.values.map((e=>{const n=null==t?void 0:t[e];if(n)return{table:I.iU,id:n,spaceId:o}})).filter(r.$K));if("person"===e.type)return de(e.values.map((e=>{const t=null==n?void 0:n[e];if(t)return{table:T.KJ,id:t,spaceId:o}})).filter(r.$K));(0,r.t1)(e)}(e,o.getFormatValue("related_external_object_uris_to_instance_ids"),o.getFormatValue("related_external_object_uris_to_user_ids"),o.getSpaceId())}}function D(e,t,n){var o;const r=n.getSchema(),i=r[t];if(null==i||!i.derived_property_record_metadata||"external_object_instance_page_metadata"!==i.derived_property_record_metadata.type)return;const a=i.derived_property_record_metadata;if(!r[a.pointer_property_uri])return;return{eoipPointer:null===(o=ge(e.getProperty(a.pointer_property_uri)))||void 0===o?void 0:o[0],eoipMetadata:a}}function B(e,t,n){const o=E(e,t,n);if(o)return R(o.eoip,`${l.U}${o.externalObjectAttribute}`)}function E(e,t,n){if(!n)return;const o=e.getParentPointer();if(!o.id||!o.spaceId||o.table!==C.vF)return;const r=n(o);if((null==r?void 0:r.table)!==C.vF)return;const i=D(e,t,r);if(!i)return;const{eoipPointer:a,eoipMetadata:s}=i;if(!a)return;const l=n(a);return l?{eoip:l,externalObjectAttribute:s.external_object_attribute}:void 0}function F(e,t,n){if(!e||!t)return!1;return!!E(e,t,n)}function Z(e){const{textValue:t,blockModel:n,getRecordModel:o,propertySchema:r}=e,i=n.getParentPointer();if("auto_increment_id"===(null==r?void 0:r.type)&&"collection"===(null==i?void 0:i.table)&&null!=i&&i.spaceId){var a;return`${`${null===(a=o((0,m.We)({spaceId:i.spaceId,parentTable:"collection",parentId:i.id})))||void 0===a?void 0:a.record_key}-`??0}${t}`}return t}function U(e){const{schema:t,property:n}=e;return t[n]||t[`${l.U}${n}`]}function V(e){var t;return e.properties||(null===(t=e.format)||void 0===t?void 0:t.attributes)}const N=new WeakMap;function O(e){if(!e.length)return;let t=N.get(e);if(void 0===t){t=new Map;for(const n of e){const e=n.value.trim().toLowerCase();t.set(e,n)}N.set(e,t)}return t}function L(e,t){const n=O(e);return null==n?void 0:n.get(t.trim().toLowerCase())}function j(e,t){var n;const o=O(e);return null==o||null===(n=o.get(t.trim().toLowerCase()))||void 0===n?void 0:n.value}function K(e,t){var n;const o=O(e);return null==o||null===(n=o.get(t.trim().toLowerCase()))||void 0===n?void 0:n.color}const z=new WeakMap;function q(e){if(void 0===e)return[];const t=z.get(e);if(void 0!==t)return t;const n=M.Jcv(e).split(",").map((e=>e.trim())).filter(Boolean);return z.set(e,n),n}function H(e,t){const n=q(e);for(const o of n){const e=j(t,o);if(e)return e}}function G(e,t){const n=q(e);for(const o of n){const e=L(t,o);if(e)return e}}function W(e){return e?[[e]]:[]}function $(e,t){const n=q(e).map((e=>{const n=j(t,e);if(n)return n}));return o.jj(o.oA(n))}function Y(e,t){const n=q(e).map((e=>L(t,e)));return o.jj(o.oA(n))}function Q(e){if(!e)return[];return[[e.join(",")]]}function J(e){if(!e)return;const t=M.bjV(e);if(0===t.length)return;const n=se(e);return n&&((0,f.v9)(n)||(0,f.qg)(n))?[t[0],n]:void 0}function X(e){if(!e)return[];const[t,n]=e,o=[];return t.table===T.KJ?o.push(M.YCD(M.tEo(t.id))):o.push(M.YCD(M.CbB(t.id))),o.push(le(n)[0]),(0,_.Z)(o,(()=>M.V3y(",")))}const ee=W;function te(e,t){return ne(e,t)??t.defaultOption}function ne(e,t){return H(e,t.options??[])}function oe(e,t,n){var o,r,i,a;const s=te(e,t),l=t.groups??[],c=(t.options??[]).find((e=>e.value===s)),d=c&&l.find((e=>{var t;return null===(t=e.optionIds)||void 0===t?void 0:t.includes(c.id)})),u=n.formatMessage(p.ct.statusGroupNameComplete),m=n.formatMessage(p.ct.statusGroupNameInProgress);return(null==d||null===(o=d.name)||void 0===o?void 0:o.toLowerCase())===u.toLowerCase()||(null==d||null===(r=d.name)||void 0===r?void 0:r.toLowerCase())===p.RW.toLowerCase()||((null==d||null===(i=d.name)||void 0===i?void 0:i.toLowerCase())===m.toLowerCase()||(null==d||null===(a=d.name)||void 0===a?void 0:a.toLowerCase())===p.Ho.toLowerCase())&&"partial"}function re(e){return M.Jcv(e).trim().toLowerCase()===u.bx.trim().toLowerCase()}function ie(e){return e?u.cd:u.XT}const ae=new WeakMap;function se(e){if(e&&ae.has(e))return ae.get(e);const t=function(e){const t=M.nai(e);if(t.length>0){if("Invalid Date"===t[0].start_date||"Invalid date"===t[0].start_date)return;return t[0]}const n=M.Jcv(e);return(0,h.Ki)(n)}(e);return e&&ae.set(e,t),t}function le(e){return e?[M.YCD(M.pZr(e))]:[]}function ce(e){const{textValue:t,propertySchema:n,blockCreatorPointer:o,bypassLimit:r}=e;if("person"!==(null==n?void 0:n.type))return[];const i=M.bjV(t),a=new Set;let s=[];for(const l of i){const e=(0,g.dn)(l);a.has(e)||(a.add(e),s.push(l))}return 0===s.length&&"created_by"===n.default&&o&&(s=[o]),n.limit&&!r?s.slice(0,1):s}function de(e){const t=e.map((e=>e.table===T.KJ?M.YCD(M.tEo(e.id)):M.YCD(M.CbB(e.id))));return(0,_.Z)(t,(()=>M.V3y(",")))}function ue(e){const{value:t,isTemplatePage:n,propertySchema:o,blockCreatorPointer:a}=e;if(!o)return[];const s=M.KSk({includeTemplateVariables:n,value:t}),l=new Set;let c=[];for(const u of s){let e;(0,i.Wk)(u)?e=u.id:M.D4X(u)?e=u:(0,r.t1)(u),l.has(e)||(l.add(e),c.push(u))}0===c.length&&"created_by"===o.default&&a&&(c=[a]);const d=o.limit;return d?c.slice(0,d):c}function pe(e){const t=e.map((e=>M.D4X(e)?M.YCD(M.WBu({type:e})):(0,i.Wk)(e)?e.table===T.KJ?M.YCD(M.tEo(e.id)):M.YCD(M.CbB(e.id)):void(0,r.t1)(e)));return(0,_.Z)(t,(()=>M.V3y(",")))}function me(e){const t=M.jDe(e);return o.jj(t)}function ge(e){const t=M.cCA(e);return x.dr.uniq(t)}function fe(e){const t=e.map((e=>M.YCD(M.$0A(e.id,e.spaceId))));return(0,_.Z)(t,(()=>M.V3y(",")))}function he(e){const{relationValue:t,propertySchema:n,getRecordModel:o}=e,r=n.limit,i=[];for(const s of t){var a;if(r&&i.length>=r)break;const e=o(s);if(!e||!e.getAlive()||e.isTemplate())continue;(null===(a=(0,b.J2)({getRecordModel:o,block:e}))||void 0===a?void 0:a.id)===(0,u.F0)(n)&&i.push(s)}return i}function ve(e){let{relationValue:t,getRecordModel:n,originAction:o}=e;const r=[];for(const i of t){if("paste"===o){r.push(i);continue}const e=n(i);e&&e.getAlive()&&r.push(i)}return r}async function ye(e){const{relationValue:t,propertySchema:n,loadRecordModel:i,limit:a}=e,s=n.limit??a,l=[];for(const c of o.yo(t,10)){const e=(await Promise.all(c.map((async e=>{var t;const o=await i(e);if(!o||!o.getAlive())return;return(null===(t=await(0,b.Rd)({loadRecordModel:i,block:o}))||void 0===t?void 0:t.id)===(0,u.F0)(n)?e:void 0})))).filter(r.$K);if(s){const t=s-l.length;e.splice(t)}if(l.push(...e),s&&l.length>=s)break}return l}function be(e,t,n){let o=[...e];const r=e.findIndex((e=>e.property===t));return o=e[r]?[...e.slice(0,r),{property:t,visible:n},...e.slice(r+1)]:[...e,{property:t,visible:n}],o}function _e(e){return!!e&&!("relation"!==e.type||!e.connectedRelation||e.connectedRelation.integration_id!==y.U9)}function Se(e){return!!e&&!("relation"!==e.type||!e.connectedRelation||e.connectedRelation.integration_id!==y.Dv)}function ke(e){return!!e&&!("relation"!==e.type||!e.connectedRelation||e.connectedRelation.integration_id!==y.f3)}function we(e){return!!e&&!("relation"!==e.type||!e.connectedRelation||e.connectedRelation.integration_id!==y.mQ)}function xe(e){return!!e&&!("relation"!==e.type||!e.connectedRelation||e.connectedRelation.integration_id!==y.Nw)}function Ie(e){return!!e&&!("relation"!==e.type||!e.connectedRelation||e.connectedRelation.integration_id!==y.eY)}function Ce(e){return!!e&&!("relation"!==e.type||!e.connectedRelation||e.connectedRelation.integration_id!==y.Dv)}function Te(e){const t=M.Jcv(e);return w.p3(t)}function Me(e){return void 0===e||isNaN(e)?[]:[[e.toString()]]}function Pe(e){const t=M.rxn(e),n=o.mN(t,(e=>e.url));if(n.length>0)return n;const r=M.Jcv(e);if(r){const e=M.rOz(r);if(e)return[{name:e.value,url:e.href}]}return[]}function Ae(e){const t=e.map((e=>M.V3y(e.name,[M.edl(e.url)])));return(0,_.Z)(t,(()=>M.V3y(",")))}function Re(e){const t=M.rxn(e);if(t.length>0)return t[0].url;return M.Jcv(e)}function De(e){if(null==e)return[];const t=Be("url",[[e]]);return[M.V3y(e,[M.edl(t||e)])]}function Be(e,t){if("url"===e){const e=Re(t);if(e){const t=S.s(e);if(t&&t[0]&&t[0].href)return t[0].href}}else if("phone_number"===e){const e=Re(t);if(e){const t=e.trim().replace(/\s/g,"").replace(/\(/g,"").replace(/\)/g,"").replace(/\-/g,"").replace(/\./g,"");return t.includes("tel:")?t:`tel:${t}`}}else if("email"===e){const e=Re(t);return e&&!e.includes("mailto:")?`mailto:${e}`:e}}function Ee(e){const t=M.Jcv(e);return w.p3(t)}function Fe(e){return void 0===e||isNaN(e)?[]:[[e.toString()]]}function Ze(e){const t=k.kk5.fromBlock(e.block);if("page"===t.getType()&&t.getParentTable()===C.vF)return t.getParentPointer()}function Ue(e){const{block:t,getRecordModel:n}=e,o=Ze({block:t});return o&&n(o)}function Ve(e){var t,n,o;const{block:i,property:a,schema:s,getRecordModel:l,userId:d,userTimeZone:u,intl:p}=e,m=(0,b.ky)({block:i,getRecordModel:l}),g=(0,c.FT)({block:i,property:a,schema:s,getRecordModel:l,propertyMapping:null==m||null===(t=m.format)||void 0===t?void 0:t.app_uri_map,collectionRequestContext:{userId:d,intl:p,userTimeZone:u,depth:0,visitedProperties:new Set,resultCache:new Map}});if(void 0===g)return!0;for(const c of g){if(B(i,a,l))return!1;switch(c.type){case"text":if(null!=c&&null!==(n=c.value)&&void 0!==n&&n.length)return!1;break;case"checkbox":if(null!=c&&c.value)return!1;break;case"select":case"number":case"date":if(void 0!==c.value)return!1;break;case"multi_select":case"relation":case"person":case"file":if(null!=c&&null!==(o=c.value)&&void 0!==o&&o.length)return!1;break;case"verification":if(void 0!==c.value&&"none"!==c.value)return!1;break;case"status":if(void 0!==c.option)return!1;break;case"location":return!1;default:(0,r.t1)(c)}}return!0}function Ne(e){if(e&&"formula"===e.type){return"checkbox"===(0,d.mm)(e)}return e&&"checkbox"===e.type}function Oe(e){const{block:t,propertySchema:n,getRecordModel:o}=e;if(void 0===n.property)return[];const i=R(t,n.property);if(void 0===i)return[];return he({relationValue:ge(i),getRecordModel:o,propertySchema:n}).map((e=>o(e))).filter(r.$K)}function Le(e){const{block:t,propertySchema:n,getRecordModel:o}=e;if(void 0===n.property)return[];const i=R(t,n.property);if(void 0===i)return[];return he({relationValue:ge(i),getRecordModel:o,propertySchema:n}).map((e=>o(e))).filter(r.$K)}function je(e){let{before:t,after:n}=e;if(!(t&&n&&(0,u.t)(t)&&(0,u.t)(n)))return;const r=t.options??[],i=n.options??[],a=o.KX(r,"id"),s=o.KX(i,"id"),l=[],c=[],d=[];for(const o of r){const e=s[o.id];e?e.value!==o.value&&d.push({before:o,after:e}):c.push(o)}for(const o of i)a[o.id]||l.push(o);return{newOptions:l,removedOptions:c,modifiedOptions:d}}function Ke(e){let{isAuthed:t,isSpaceAdmin:n,isPropertyAdminAuthOnly:o,isMobile:r}=e;return!t&&!n&&o&&!r}function ze(e){const{propertySchema:t,isTypedProperty:n}=e,o=(0,u.NK)(t);return"title"===t.type||"verification"===t.type||"auto_increment_id"===t.type||n||o}function qe(e){return[...M.cCA(e),...M.bjV(e)]}const He=[a.C.MeetingNoteToCalendarEventRelation,a.C.Attendees,a.C.MeetingTime];function Ge(e,t){return!!e&&He.some((n=>{var o;return(null===(o=e.getPropertyMapping())||void 0===o?void 0:o[n])===t}))}function We(e,t,n){return!(!e||!t)&&(!!Ge(t,n)&&!!Ye(e))}function $e(e,t){const n=Ye(e),o=n?t(n):void 0;return null==o?void 0:o.getFormat().uri}function Ye(e){var t;return null===(t=ge(e.getPropertiesStore().getKeyStore(a.C.MeetingNoteToCalendarEventRelation).getValue()))||void 0===t?void 0:t[0]}function Qe(e){const{beforeValue:t,afterValue:n,propertySchema:o,getRecordModel:r,getBlockTitle:i}=e,a=ge(t),s=ge(n),l=(0,v.N)(a,s,(e=>`${e.id}${e.table}`)),c=new Set(he({relationValue:l.created,getRecordModel:r,propertySchema:o})),d=new Set(he({relationValue:l.deleted,getRecordModel:r,propertySchema:o})),u=[...c,...d];return u.flatMap(((e,t)=>{const n=i({table:I.iU,id:e.id})||[],o=[],r=M.lzi(n);for(const i of r)if(M.QJH(i)){const t=c.has(e)?"+":"-",n=[i[0],[[t]]];o.push(n)}else o.push(i);return t<u.length-1&&o.push(M.V3y("\n")),o}))}function Je(e){return!!e&&"button"!==e.type}function Xe(e){return!!e&&"button"!==e.type}function et(e){return!!e&&"button"!==e.type}function tt(e){return!!e&&("text"===e||"title"===e||"url"===e||"email"===e||"phone_number"===e)}function nt(e){return"relation"===e.type||"person"===e.type}function ot(e,t){return(e??[]).filter((e=>e in t))}},143690:(e,t,n)=>{n.d(t,{BW:()=>z,C7:()=>X,Ct:()=>de,HF:()=>ne,Ih:()=>me,LU:()=>ae,NM:()=>ie,Oi:()=>he,Qo:()=>fe,Uo:()=>J,aW:()=>G,c_:()=>ue,dN:()=>pe,fY:()=>$,fk:()=>N,jF:()=>ee,kk:()=>q,ps:()=>W,x3:()=>H,zh:()=>ge});n(757658);var o=n(653965),r=n(401898),i=n(212847),a=n(172111),s=n(541432),l=n(202032),c=n(576205),d=n(830823),u=n(435011),p=n(399036),m=n(180951),g=n(897058),f=n(10070),h=n(528155),v=n(756373),y=n(406695),b=n(80206),_=n(173110),S=n(335102),k=n(238297),w=n(295519),x=n(159730),I=n(959753),C=n(292516),T=n(261158),M=n(463306),P=n(673360),A=n(33361),R=n(600606),D=n(498459),B=n(882883),E=n(421202),F=n(606287),Z=n(519889),U=n(421838);i.object({required:{userTimeZone:i.undefinable(i.string()),searchQuery:i.undefinable(i.string())},optional:{sort:i.any(),filter:i.any(),reducers:i.any(),upwardTraversalRelation:i.any(),userId:i.string(),reducerDependencies:i.record(i.string(),i.array(i.string())),maxPreloadedRecords:i.number(),currentPageInRelatedCollection:i.string()}});class V{constructor(){this.filterStats=void 0,this.trackingOptimizer=void 0,this.cachedFilters=void 0,this.filterStats=[],this.trackingOptimizer=e=>{var t;const n={fail:0,pass:0,evalTime:0,filter:e.basicFilter,property:e.property,type:null===(t=e.schema[e.property])||void 0===t?void 0:t.type};return this.filterStats.push(n),t=>{const o=Date.now(),r=e.compiledFilter(t);return n.evalTime+=Date.now()-o,r?n.pass+=1:n.fail+=1,r}},this.cachedFilters=new WeakMap}compile(e){const{context:t,filter:n,propertyMapping:o}=e;if(!n)return;const r=this.memoizedCompile(n,t),i=o?e=>r({...e,propertyMapping:o}):r;return i}memoizedCompile(e,t){var n,o;const r=null===(n=this.cachedFilters.get(t.schema))||void 0===n?void 0:n.get(e);if(void 0!==r)return r;const i={...t,optimizer:this.trackingOptimizer},a=(0,c.q)({context:i,propertyMapping:void 0,filter:e});return this.cachedFilters.has(t.schema)||this.cachedFilters.set(t.schema,new WeakMap),null===(o=this.cachedFilters.get(t.schema))||void 0===o||o.set(e,a),a}}function N(e){const{schema:t,loader:n,getRecordModel:r,pageSort:i,apiSorts:a,intl:s,isSorted:l,relativeVariableResult:c}=e,d={};o.Ed(n.reducers||{},((e,o)=>{d[o]=(0,g.Q7)({schema:t,loader:n,reducer:e,pageSort:i,getRecordModel:r,apiSorts:a,intl:s,isSorted:l,relativeVariableResult:c})}));return{reducerStates:d,completedReducers:{},filterCompiler:new V,upwardTraversalVisitedIds:new Set,vectorSearchScores:{}}}const O={incremented:!1,completedReducers:{},isSubitemWithDeadTopLevelBlock:!1};function L(e){const{collection:t,block:n,getRecordModel:o,sourceType:r}=e;if(!j(n))return!1;const i=function(e){const t=(0,a.fe)(e),n=e.created_time,o=e.last_edited_time;return!(o>n)&&t}(n);if("typed"===r&&i)return!1;const s=(0,k.Es)({getRecordModel:o,block:n});return t.id===(null==s?void 0:s.id)}function j(e){return e.alive&&!e.is_template&&e.type!==s.Ti.copyIndicator&&!e.isPermanentlyDeleted()}function K(e){const{block:t,propertySchema:n,getRecordModel:o,visitedIds:r,currentTraversalVisitedIds:i}=e;if(r.has(t.id))return new Set;r.add(t.id);const a=(0,m.uJ)({block:t,propertySchema:n,getRecordModel:o});if(0===a.length)return new Set([t]);if(a.some((e=>i.has(e.id))))return new Set([t]);const s=new Set;for(const l of a){i.add(l.id);const e=K({block:l,propertySchema:n,getRecordModel:o,visitedIds:r,currentTraversalVisitedIds:i});i.delete(l.id);for(const t of e){j(t)&&s.add(t)}}return s}function z(e,t,n,o){var r;const{visibleProperties:i,loader:a,userId:s,getRecordModel:l,intl:c,schema:d,relativeVariableResult:u,currentPageInRelatedCollection:p,groupsReducerIds:m,reducerIdsWithNoGroupDependencies:v,collectionSourceType:y,resultCache:b,userStartOfWeek:_}=n,S=I.kk5.fromBlock(e),k=I.kk5.fromCollection(t);if(!(0,h.MQ)(y)&&!L({collection:k,getRecordModel:l,block:S,sourceType:y}))return O;if(!a.reducers)return O;const w={},C=k.getNormalizedSchema(),T=null===(r=k.getFormat())||void 0===r?void 0:r.app_uri_map,P={schema:d,intl:c,userId:s,userTimeZone:a.userTimeZone,userStartOfWeek:_,relativeVariableResult:u,currentPageInRelatedCollection:p},A=o.filterCompiler.compile({filter:a.filter,context:P,propertyMapping:T});if(!(!A||A({block:I.kk5.fromBlock(S),getRecordModel:l,propertyMapping:T,formulaTimeoutTimestampMs:n.formulaTimeoutMs&&Date.now()+n.formulaTimeoutMs,logFormulaTimeoutFn:n.logFormulaTimeoutFn,resultCache:b})))return O;if(a.searchQuery&&!$({block:S,query:a.searchQuery,getRecordModel:l,userTimeZone:a.userTimeZone,schema:C,intl:c,onlyPropertyIds:i?f.aQ.fromViewPropertyIds(i,T):void 0}))return O;const R=a.upwardTraversalRelation?K({block:S,propertySchema:a.upwardTraversalRelation,getRecordModel:l,visitedIds:o.upwardTraversalVisitedIds,currentTraversalVisitedIds:new Set([S.id])}):new Set([S]);let D=!1;if(a.upwardTraversalRelation)for(const g of R){if(g.id===S.id)continue;if(!(0,M.Zg)((0,M.DW)(g.pointer,l))){D=!0;break}}const B=a.reducerDependencies??{};for(const f of R){const e=[];for(const c of m??[]){const t=a.reducers[c],r=o.reducerStates[c];if((0,g.qf)({intl:n.intl,reducer:t,reducerId:c,state:r,schema:d,block:f,getRecordModel:l,userTimeZone:a.userTimeZone,userId:s,visibleProperties:i,propertyMapping:T,relativeVariableResult:u,formulaTimeoutMs:n.formulaTimeoutMs,logFormulaTimeoutFn:n.logFormulaTimeoutFn,logFormulaStatsFn:n.logFormulaStatsFn,resultCache:b}),"groups"!==r.type)throw new x.D3("Expected GroupsReducer to be of type 'groups'");e.push(r)}const t=(0,g.cm)(e,f.id),r=new Set;for(const n of t){const e=B[n];for(const t of e??[])r.add(t)}for(const c of[...r,...v??[]]){if(o.completedReducers[c])continue;const e=a.reducers[c];if(!e)continue;const t=o.reducerStates[c],r=o.filterCompiler.compile({filter:e.filter,context:P,propertyMapping:T});if(!r||r({block:I.kk5.fromBlock(f),getRecordModel:l,propertyMapping:void 0,formulaTimeoutTimestampMs:n.formulaTimeoutMs&&Date.now()+n.formulaTimeoutMs,logFormulaTimeoutFn:n.logFormulaTimeoutFn,resultCache:b})){const{shouldComplete:r}=(0,g.qf)({intl:n.intl,reducer:e,reducerId:c,state:t,schema:d,block:f,getRecordModel:l,userTimeZone:a.userTimeZone,userId:s,visibleProperties:i,propertyMapping:T,relativeVariableResult:u,formulaTimeoutMs:n.formulaTimeoutMs,logFormulaTimeoutFn:n.logFormulaTimeoutFn,logFormulaStatsFn:n.logFormulaStatsFn,resultCache:b});if(r){const r=(0,g.rQ)({reducer:e,state:t,reducerLoaderState:o,loader:a,schema:d,isSprintPlanningView:n.isSprintPlanningView});w[c]=r,o.completedReducers[c]=r}}}}return{incremented:!0,completedReducers:w,isSubitemWithDeadTopLevelBlock:D}}function q(e,t){const{loader:n,schema:r}=e,i={...t.completedReducers},a={};return n.reducers&&o.Ed(n.reducers||{},((o,s)=>{if(t.completedReducers[s])return;const l=t.reducerStates[s],c=(0,g.rQ)({reducer:o,reducerLoaderState:t,state:l,loader:n,schema:r,isSprintPlanningView:e.isSprintPlanningView});i[s]=c,a[s]=c})),{result:{type:"reducer",reducerResults:i},completedReducers:a,filterStats:t.filterCompiler.filterStats}}function H(e,t){let n=[],r=[];if(e){const[i,a]=o.uK(Object.entries(e),(e=>{let[,t]=e;return"groups"===t.type}));n=i.map((e=>{let[t,n]=e;return t}));const s=a.map((e=>{let[t,n]=e;return t})),l=new Set(Object.values(t??{}).flat());r=s.filter((e=>!l.has(e)))}return{groupsReducerIds:n,reducerIdsWithNoGroupDependencies:r}}function G(e){const{result:t,onlyTypes:n}=e,r=new Set;return o.Ed(t.reducerResults,(e=>{if(!n||n.includes(e.type))for(const t of function(e){const t=new Set;if("results"===e.type)for(const n of e.blockIds)t.add(n);else if("groups"===e.type)for(const{value:n}of e.results)"relation"===n.type&&n.value&&"id"in n.value&&t.add(n.value.id),"location"===n.type&&n.value&&t.add(n.value.id);return[...t]}(e))r.add(t)})),Array.from(r.values())}function W(e,t,n){var o;const r=(0,w.i)(e,n,void 0,(0,y.Dg)(t)),i=(0,y.oz)(t),a=i?r[i]:void 0;"list"!==t&&"calendar"!==t||null==a||a.push({visible:!0,property:"title"});return null==a||null===(o=a.filter((e=>Boolean(e.visible))))||void 0===o?void 0:o.map((e=>e.property))}function $(e){const{block:t,query:n,getRecordModel:o,userTimeZone:r,schema:i,intl:a,onlyPropertyIds:s}=e,l=I.kk5.fromBlock(t);if(!(0,m.Gk)({properties:l.getProperties(),format:l.getFormat()}))return!1;const c=s??Object.keys(i);return Boolean(c.find((e=>{let t;const s=i[e];if("title"===e&&l.isType("collection_view_page"))t=(0,m.iT)(l,o);else if("created_by"===(null==s?void 0:s.type)||"last_edited_by"===(null==s?void 0:s.type)){const e="created_by"===(null==s?void 0:s.type)?l.getCreatedByPointer():l.getLastEditedByPointer();e&&(t=[(0,U.YCD)(e.table===Z.KJ?(0,U.tEo)(e.id):(0,U.CbB)(e.id))])}else t=(0,m.wS)(l,e,o);if(!t)return!1;const c=(0,B.Xh)({textValue:t,getRecordModel:o,userTimeZone:r,intl:a});return Q((0,m.xz)({textValue:c,blockModel:l,getRecordModel:o,propertySchema:i[e]})).indexOf(Q(n.trim()))>=0})))}const Y=/[\u0300-\u036f]/g;function Q(e){return e?e.toLocaleLowerCase().normalize("NFD").replace(Y,""):""}const J=6,X=15;async function ee(e){const{blocks:t,recordMap:n,loadRecordModel:o}=e;for(const r of t){const e=(r.content??[]).slice(0,X).map((e=>({table:E.iU,id:e,spaceId:r.space_id}))),t=await o(e);n.assign(t)}}async function te(e){let{record:t,dependencies:n,blockIdToAssociatedCollectionModelCache:o,getRecordModel:r,loadRecordModel:i,userTimeZone:a,intl:s,formulaTimeoutMs:l,logFormulaStatsFn:c,logFormulaTimeoutFn:d,checkCancellation:p,dependencyCache:g,resultCache:f}=e;p&&p();const h=[],y=t.value;if(y.parent_table&&y.parent_id&&h.push(R.dr.getParentPointerFromRecordWithParent(y)),t.table!==E.iU||!t.value)return h;const w=t.value,x=I.kk5.fromBlock(w),C=x.getCollectionPointer();C&&h.push(C);const T=o[x.id]??await(0,k.Rd)({block:x,loadRecordModel:i});if(!T)return h;x.id in o||(o[x.id]=T);const M=n.get(T.id);if(null==M||!M.size)return h;const P=[...(null==M?void 0:M.get("title"))??[],...(null==M?void 0:M.get("text"))??[]].map((e=>{let{property:t}=e;return t}));for(const u of P){var A;const e=null===(A=w.properties)||void 0===A?void 0:A[u];e&&h.push(...(0,D.F2)(e))}(null==M?void 0:M.get("created_by"))&&w.created_by_table&&w.created_by_id&&h.push({table:w.created_by_table,id:w.created_by_id,spaceId:w.space_id});(null==M?void 0:M.get("last_edited_by"))&&w.last_edited_by_table&&w.last_edited_by_id&&h.push({table:w.last_edited_by_table,id:w.last_edited_by_id,spaceId:w.space_id});if((null==M?void 0:M.get("auto_increment_id"))&&h.push((0,v.We)({spaceId:w.space_id,parentTable:F.vF,parentId:T.id})),!(0,m.Gk)(w))return h;const B=M.get("relation");if(B)for(const u of B){const e=(0,m.wS)(w,u.property),t=(0,m.LL)(e);for(const n of t)h.push({table:E.iU,id:n,spaceId:u.collectionPointer.spaceId})}const Z=M.get("person");if(Z)for(const u of Z){const e=(0,m.wS)(w,u.property),t=(0,m.DW)({textValue:e,propertySchema:u.propertySchema,bypassLimit:!0,blockCreatorPointer:x.getCreatedByPointer()});for(const n of t)h.push(n)}const U=M.get("formula");if(U&&a&&s)for(const m of U){var V;const e=performance.now();p&&p();const t=m.propertySchema,n=(0,b.l)();if(void 0===t.version||void 0===t.formula2||!n)return h;let v;const y=(0,u.XU)({resultCache:f,blockId:w.id,property:m.property});if(void 0!==y)v={value:(0,u.PY)(y)};else{const e={values:[{kind:_.yp.ThisRow,value:{type:"block",value:{table:"block",id:w.id}}}],handleDataRequest:(0,S.yf)(r,i,l,d,c,p,g,f,o),intl:s,userTimeZone:a,depth:0,visitedProperties:new Set,formulaTimeoutTimestampMs:l&&Date.now()+l,logFormulaTimeoutFn:d,resultCache:f},h=await n.executeFormulaAsync(t.formula2.code,e);"value"in h&&(0,u.j1)({resultCache:f,blockId:w.id,property:m.property,value:h.value}),v=(0,u.oh)(h),(0,u.HU)(I.kk5.fromBlock(w),T,m.property,(()=>v))}null==c||c({executionTimeMs:performance.now()-e,cachedCount:y?1:0,uncachedCount:y?0:1,error:null===(V=v.error)||void 0===V?void 0:V.type})}return h}async function ne(e){return oe(e,new T.Z)}async function oe(e,t){var n;const{collectionPointer:r,schema:i,property:a,loadRecordModel:s,dependencyCache:l}=e,c=i[a];if(!c)return[];const d=null===(n=l.get(r.id))||void 0===n?void 0:n.get(a);if(d)return d;const m={collectionPointer:r,property:a,propertySchema:c};if(t.has(m))return[m];if(t.add(m),c.derived_property_record_metadata){const e=c.derived_property_record_metadata.pointer_property_uri,t=i[e];if(t){return[{collectionPointer:r,property:e,propertySchema:t}]}}else{if("relation"===c.type){const e=(0,p.j0)(c);return e&&await s(e),[]}if("formula"===c.type){const e=o.oA((0,u.pV)(c).map((e=>{const t=i[e];if(t){return{collectionPointer:r,property:e,propertySchema:t}}}))),n=await Promise.all(e.map((e=>{let{property:n}=e;return oe({collectionPointer:r,schema:i,property:n,loadRecordModel:s,dependencyCache:l},t)}))),d=o.mN([...e,...o.xH(n)],(e=>{let{collectionPointer:t,property:n}=e;return`${t.id}${n}`}));return re({dependencyCache:l,collectionPointer:r,property:a,result:d}),d}if("rollup"===c.type&&c.relation_property&&c.target_property){const e=i[c.relation_property];if(!e||"relation"!==e.type)return[];const n=(0,p.j0)(e);if(!n)return[];const d=await s(n),u=(null==d?void 0:d.getNormalizedSchema())??{},m=[],g={collectionPointer:r,property:c.relation_property,propertySchema:e};if(m.push(g),c.target_property_type){const e=u[c.target_property];if(e&&c.target_property_type===e.type){const t={collectionPointer:{table:F.vF,id:n.id,spaceId:null==d?void 0:d.space_id},property:c.target_property,propertySchema:e};m.push(t)}}const f=await oe({collectionPointer:n,schema:u,property:c.target_property,loadRecordModel:s,dependencyCache:l},t);m.push(...f);const h=o.mN(m,(e=>{let{collectionPointer:t,property:n}=e;return`${t.id}${n}`}));return re({dependencyCache:l,collectionPointer:r,property:a,result:h}),h}}return[]}function re(e){const{dependencyCache:t,collectionPointer:n,property:o,result:r}=e,i=t.get(n.id);if(void 0!==i)i.set(o,r);else{const e=new Map;e.set(o,r),t.set(n.id,e)}}function ie(e){return Object.values(e.reducers||{}).some((e=>"aggregation"===e.type))}function ae(e){return Object.values(e.reducers||{}).some((e=>"groups"===e.type))}function se(e){const{filter:t,propertyIdSet:n}=e;if((0,c.aN)(t))n.add(t.property);else if((0,c.vA)(t)){const e=t.filters||[];for(const t of e)se({filter:t,propertyIdSet:n})}}function le(e){const{loader:t,schema:n,loadAllProperties:r,searchProperties:i}=e,a=new Set,s=new Set;if(t){var c;if(null!=t&&null!==(c=t.upwardTraversalRelation)&&void 0!==c&&c.property&&a.add(t.upwardTraversalRelation.property),(t.filter||t.filterToComputeDependencies)&&se({propertyIdSet:a,filter:t.filterToComputeDependencies??t.filter}),t.sort)for(const o of t.sort){var d;"formula"===(null===(d=n[o.property])||void 0===d?void 0:d.type)?s.add(o.property):a.add(o.property)}const e=t.reducers||{};o.Ed(e,(e=>{if(e){e.filter&&se({propertyIdSet:a,filter:e.filter});const t=[];if("aggregation"===e.type&&(0,l.pK)(e.aggregation)&&t.push(e.aggregation.property),"groups"===e.type&&(t.push(e.groupBy.property),e.subGroup&&t.push(e.subGroup.groupBy.property),e.aggregation&&("intersection_and_independent"===e.aggregation.type||"intersection"===e.aggregation.type)&&(0,l.pK)(e.aggregation.intersectionAggregation)&&t.push(e.aggregation.intersectionAggregation.property),e.aggregation&&("intersection_and_independent"===e.aggregation.type||"independent"===e.aggregation.type)&&e.aggregation.groupAggregation&&(0,l.pK)(e.aggregation.groupAggregation)&&t.push(e.aggregation.groupAggregation.property),e.aggregation&&("intersection_and_independent"===e.aggregation.type||"independent"===e.aggregation.type)&&e.aggregation.subGroupAggregation&&(0,l.pK)(e.aggregation.subGroupAggregation)&&t.push(e.aggregation.subGroupAggregation.property)),0===t.length)return;for(const e of t){const t=n[e];"formula"===(null==t?void 0:t.type)?s.add(e):a.add(e)}}}))}const u=function(e){return Boolean(null==e?void 0:e.searchQuery)||Boolean(o.VO(null==e?void 0:e.reducers).some((e=>Boolean("results"===e.type&&e.searchQuery))))}(t);if(u)for(const o of i??Object.keys(n)){const e=n[o];if(e){if("rollup"===e.type||"formula"===e.type)continue;a.add(o)}}if(r)for(const o of Object.keys(n))s.add(o);for(const o of s)a.has(o)&&s.delete(o);return{filterStagePropertyIdsSet:a,incrementStagePropertyIdsSet:s}}function ce(e){return"property"in e}async function de(e){const{collectionValueOrModel:t,loader:n,recordMap:o,loadRecordModel:r,loadAllProperties:i,apiSorts:a,dependencyCache:s,searchProperties:l}=e,c=I.kk5.fromValue(F.vF,t),d=c.getNormalizedSchema(),u=c.getPropertyMapping(),p=a?[...a.filter(ce)]:[],{filterStagePropertyIdsSet:m,incrementStagePropertyIdsSet:g}=le({loader:n,schema:d,loadAllProperties:i,searchProperties:l}),h=new Set([...m,...g,...p.map((e=>e.property))]),v=f.aQ.fromViewPropertyIds(Array.from(h),u);return(await async function(e){const{recordMap:t,loadRecordModel:n,collectionModelOrValue:o,properties:r,schema:i,dependencyCache:a}=e,s=C.s.throughRecordMap(t,n),l=new T.Z,c=I.kk5.fromValue(F.vF,o).pointer;return await Promise.all(r.map((async e=>{const t=i[e];if(t){const n={collectionPointer:c,property:e,propertySchema:t};l.add(n);const o=await ne({collectionPointer:c,schema:i,property:e,loadRecordModel:s,dependencyCache:a});for(const e of o)l.add(e)}}))),l}({recordMap:o,loadRecordModel:r,collectionModelOrValue:c,properties:v,schema:d,dependencyCache:s})).valuesArray()}async function ue(e){const{blocks:t,recordMap:n,dependencies:o,blockIdToAssociatedCollectionModelCache:r,loadRecordModel:i,userTimeZone:a,intl:s,formulaTimeoutMs:l,logFormulaStatsFn:c,logFormulaTimeoutFn:d,checkCancellation:u,dependencyCache:p,resultCache:m}=e;u&&u();const g=[];for(const y of t){const e=I.kk5.fromBlock(y),t=e.pointer;g.push(t),n.setModel(e.pointer,e)}const f=new Map,h=new Map;for(const y of o){const e=y.collectionPointer.id,t="formula"===y.propertySchema.type?f:h;let n=t.get(e);void 0===n&&(n=new Map,t.set(e,n));const o=n.get(y.propertySchema.type);void 0===o?n.set(y.propertySchema.type,[y]):o.push(y)}const v=C.s.throughRecordMap(n,i);for(const y of[h,f])await(0,A.aV)({recordPointers:g,recurFn:async(e,t,o)=>await te({record:P.mk.create(e.table,e.__IM_SORRY__getValue()),dependencies:y,dependencyCache:p,blockIdToAssociatedCollectionModelCache:r,getRecordModel:I.omK.fromRecordMap(n),loadRecordModel:v,intl:s,userTimeZone:a,formulaTimeoutMs:l,logFormulaTimeoutFn:d,logFormulaStatsFn:c,checkCancellation:u,resultCache:m}),loadRecordModel:v,recordMap:n})}function pe(e,t){const n=t[e.property];if(n&&e.filter){if("status"===n.type){const{property:t,filter:o}=e,r=n.groups??[];if((0,c.mv)(e.filter))return e;if((0,c.XA)(o)){const e=o.value.value;if(void 0===e)return;const n=r[r.length-1];return{filter:{operator:e?"status_is":"status_is_not",value:{type:"is_group",value:null==n?void 0:n.name}},property:t}}if((0,c.dx)(o)||(0,c.NU)(o)){if((0,c.mv)(o))return;const e=((0,c.dx)(o)?(0,c.mg)(o):(0,c.qC)(o)).map((e=>({type:"is_option",value:e.value})));return{filter:{operator:"enum_is"===o.operator||"enum_contains"===o.operator?"status_is":"status_is_not",value:e.length>0?e:{type:"is_group",value:void 0}},property:t}}if(!(0,c.r2)(o))return}if((0,c.J5)(t,e.property,e.filter,void 0)){if("select"===n.type){if(!(0,c.dx)(e.filter))return;if((0,c.mv)(e.filter))return e;const t=(0,c.mg)(e.filter);if(0===t.length)return e;return t.every((e=>(n.options||[]).some((t=>t.value===e.value))))?e:void 0}if("multi_select"===n.type){if(!(0,c.NU)(e.filter))return;if((0,c.mv)(e.filter))return e;const t=(0,c.qC)(e.filter);if(0===t.length)return e;return t.every((e=>(n.options||[]).some((t=>t.value===e.value))))?e:void 0}if("date"===n.type&&(0,c.TQ)(e.filter)){const t=e.filter.value;if("relative"===t.type){if("custom"===t.value||"surrounding"===t.value)return{...e,filter:{...e.filter,operator:"date_is_relative_to"}};{const n=c.A9[t.value],o={...e.filter,value:n,operator:"date_is_relative_to"};return{...e,filter:o}}}if("exact"===t.type)return{...e,filter:{...e.filter,operator:"date_is_within"}};(0,r.t1)(t)}if("relation"===n.type&&"relation_contains"===e.filter.operator){const t=(0,c.YO)(e.filter);t.length>1&&(e.filter.value=t.filter((e=>void 0!==e.value)))}return e}}}function me(e,t){if((0,c.vA)(e)){const n=e,r=n.filters||[],i={...n,filters:o.oA(r.map((e=>me(e,t))))};if(!i.filters||0===i.filters.length)return;return i}return(0,c.aN)(e)?pe(e,t):e}function ge(e,t){return e.filter((e=>{const n=t[e.property];return Boolean(n)}))}function fe(e,t,n){let o=e&&e.query2?e.query2:{};if(o.calendar_by&&e&&"calendar"===e.type){const e=t[o.calendar_by];e&&(0,p.Lt)(e)||(o={...o,calendar_by:void 0})}if(o.timeline_by&&e&&"timeline"===e.type){const e=t[o.timeline_by];if(e&&(0,p.Lt)(e)||(o={...o,timeline_by:void 0}),o.timeline_by_end){const e=t[o.timeline_by_end];e&&(0,p.Lt)(e)||(o={...o,timeline_by_end:void 0})}}if(o.filter&&(o={...o,filter:me(o.filter,t)}),o.sort&&(o={...o,sort:ge(o.sort,t)}),o.aggregations){const n=o.aggregations.filter((n=>{if((0,l.HK)(n))return(0,l.sl)(n.aggregator);const o=t[n.property];if(o){if((0,d.LR)(o.type)){const e=(0,d.vc)(o.type);if(!(0,l.Ag)(e,n.aggregator))return!1}return!!e}}));o={...o,aggregations:n}}return!e||"board"!==e.type||o.aggregations&&0!==o.aggregations.length||n||(o.aggregations=[{aggregator:"count"}]),o}function he(e){const{expectedAggregator:t,aggregationReducerResult:n}=e;if(!t)return{error:"no aggregation provided"};const o=(0,l.W6)((0,l.gu)(t));return n&&"aggregation"===n.type&&n.aggregationResult.type===o&&void 0!==n.aggregationResult.value?{value:n.aggregationResult.value}:{error:"unexpected response returned for aggregation"}}},897058:(e,t,n)=>{n.d(t,{M9:()=>f,Q7:()=>h,cm:()=>R,gd:()=>w,qf:()=>b,rQ:()=>_});n(757658);var o=n(653965),r=n(401898),i=n(259308),a=n(202032),s=n(114714),l=n(180951),c=n(143690),d=n(10070),u=n(560246),p=n(159730),m=n(959753),g=n(421838);const f="board_collection_groups";function h(e){const{schema:t,loader:n,reducer:o,getRecordModel:i,intl:s,apiSorts:l,pageSort:c,isSorted:d,relativeVariableResult:m}=e;if("results"===o.type){const e=(0,u.$m)({userId:n.userId,userTimeZone:n.userTimeZone,intl:s,userSorts:n.sort??[],schema:t,apiSorts:l});return{type:"results",sorting:d?"sorted":new u.EO([...e,...(0,u.Xm)(c)]),blockIds:[],total:0}}if("groups"===o.type){var g,f,h,b,_,S;const e={type:"groups",groupsMap:new Map,blockIdToGroupIds:new Map,blockIdToSubgroupIds:new Map},n=y({schema:t,groupBy:o.groupBy,groupSortPreference:o.groupSortPreference,relativeVariableResult:m,getRecordModel:i});if(o.aggregation){const e=void 0===o.subGroup&&("independent"===o.aggregation.type||"intersection_and_independent"===o.aggregation.type)&&o.aggregation.subGroupAggregation,t=void 0===o.subGroup&&("intersection"===o.aggregation.type||"intersection_and_independent"===o.aggregation.type);if(e||t)throw new p.D3("Malformed groups reducer nested aggregation request")}const r="independent"===(null===(g=o.aggregation)||void 0===g?void 0:g.type)||"intersection_and_independent"===(null===(f=o.aggregation)||void 0===f?void 0:f.type)?null===(h=o.aggregation.groupAggregation)||void 0===h?void 0:h.aggregator:void 0;for(const[t,a]of n)e.groupsMap.set(t,A({propertyType:o.groupBy.type,group:a,currentValue:e.groupsMap.get(t),getRecordModel:i,aggregator:r}));const s=o.subGroup;if(s){var k,w,x;e.subGroupsMap=new Map;const n=y({schema:t,groupBy:s.groupBy,groupSortPreference:s.groupSortPreference,relativeVariableResult:m,getRecordModel:i}),r="independent"===(null===(k=o.aggregation)||void 0===k?void 0:k.type)||"intersection_and_independent"===(null===(w=o.aggregation)||void 0===w?void 0:w.type)?null===(x=o.aggregation.subGroupAggregation)||void 0===x?void 0:x.aggregator:void 0;for(const[t,o]of n)e.subGroupsMap.set(t,A({propertyType:s.groupBy.type,group:o,currentValue:e.subGroupsMap.get(t),getRecordModel:i,aggregator:r}))}const l="intersection"===(null===(b=o.aggregation)||void 0===b?void 0:b.type)||"intersection_and_independent"===(null===(_=o.aggregation)||void 0===_?void 0:_.type)?null===(S=o.aggregation.intersectionAggregation)||void 0===S?void 0:S.aggregator:void 0;if(l&&s&&e.subGroupsMap){e.intersectionAggregationsMap=new Map;v(Array.from(e.groupsMap.keys()),Array.from(e.subGroupsMap.keys())).forEach((t=>{var n;null===(n=e.intersectionAggregationsMap)||void 0===n||n.set(t,(0,a.yd)(l))}))}return e}if("aggregation"===o.type)return{type:"aggregation",aggregationState:(0,a.yd)(o.aggregation.aggregator)};(0,r.t1)(o)}function v(e,t){if(0===e.length||0===t.length)return[];const n=[];return e.forEach((e=>{t.forEach((t=>{const o=(0,s.Lr)([t,e]);n.push(o)}))})),n}function y(e){let{schema:t,groupBy:n,groupSortPreference:o,relativeVariableResult:r,getRecordModel:i}=e;const a=new Map,l=(0,s.Qq)({schema:t,groupBy:n});if(l)for(const d of l){const e=(0,s.Hd)(d);a.set(e,d)}else{const e=t[n.property];if(e&&(0,s.LG)(e)){const t=(0,s.N2)(e);if(t){const e=(0,s.Hd)(t);a.set(e,t)}if(e&&"relation"===e.type&&r){var c;const t=null===(c=e.collection_pointer)||void 0===c?void 0:c.id;if(t){const e=r[t];e&&Object.entries(e).filter((e=>{let[t,n]=e;return void 0!==n})).forEach((e=>{let[t,n]=e;const o={type:"relation",value:{type:"relative",value:{type:"builtin",variable:t}}},r=(0,s.Hd)(o);a.set(r,o)}))}}}}if(o)for(const d of o)if(d.type===n.type){const e=(0,s.Hd)(d);a.set(e,d)}return a}function b(e){const{block:t,schema:n,reducer:o,state:i,getRecordModel:l,userId:u,userTimeZone:g,intl:h,visibleProperties:y,propertyMapping:b,relativeVariableResult:_,reducerId:S,formulaTimeoutMs:k,logFormulaTimeoutFn:w,logFormulaStatsFn:x,resultCache:I}=e,C={userId:u,userTimeZone:g,intl:h,visitedProperties:new Set,depth:0,resultCache:I,formulaTimeoutTimestampMs:k&&Date.now()+k,logFormulaTimeoutFn:w,logFormulaStatsFn:x};if("results"===o.type){if("results"!==i.type)throw new p.D3("Reducer and state type mismatch");if(o.searchQuery&&!(0,c.fY)({block:t,query:o.searchQuery,getRecordModel:l,userTimeZone:g,schema:n,intl:e.intl,onlyPropertyIds:y?d.aQ.fromViewPropertyIds(y,b):void 0}))return{shouldComplete:!1};if(i.blockIds.push(t.id),i.total++,"sorted"===i.sorting){if(i.total>o.limit)return{shouldComplete:!0}}else i.sorting.updateBlock({block:m.kk5.fromBlock(t),schema:n,propertyMapping:b,getRecordModel:l,resultCache:I});return{shouldComplete:!1}}if("groups"===o.type){if("groups"!==i.type)throw new p.D3("Reducer and state type mismatch");const e=(0,s.Tr)({block:t,schema:n,groupBy:o.groupBy,getRecordModel:l,propertyMapping:b,relativeVariableResult:_,collectionRequestContext:C});if(e){var T,M;const r="independent"===(null===(T=o.aggregation)||void 0===T?void 0:T.type)||"intersection_and_independent"===(null===(M=o.aggregation)||void 0===M?void 0:M.type)?o.aggregation.groupAggregation:void 0;for(const c of e){var P;const e=(0,s.Hd)(c),d=A({group:c,propertyType:o.groupBy.type,currentValue:i.groupsMap.get(e),getRecordModel:l,aggregator:null==r?void 0:r.aggregator});d.total++;const u=!!S&&S===f?i.blockIdToSubgroupIds:i.blockIdToGroupIds;u.has(t.id)||u.set(t.id,new Set),null===(P=u.get(t.id))||void 0===P||P.add(e),r&&d.aggregationState&&(0,a.pI)({block:t,schema:n,aggregation:r,state:d.aggregationState,getRecordModel:l,propertyMapping:b,collectionRequestContext:C}),i.groupsMap.set(e,d)}}if(i.subGroupsMap&&o.subGroup){const r=(0,s.Tr)({block:t,schema:n,groupBy:o.subGroup.groupBy,getRecordModel:l,propertyMapping:b,relativeVariableResult:_,collectionRequestContext:C});if(r){var R,D;const e="independent"===(null===(R=o.aggregation)||void 0===R?void 0:R.type)||"intersection_and_independent"===(null===(D=o.aggregation)||void 0===D?void 0:D.type)?o.aggregation.subGroupAggregation:void 0;for(const c of r){const r=(0,s.Hd)(c),d=A({group:c,propertyType:o.subGroup.groupBy.type,currentValue:i.subGroupsMap.get(r),getRecordModel:l,aggregator:null==e?void 0:e.aggregator});d.total++,e&&d.aggregationState&&(0,a.pI)({block:t,schema:n,aggregation:e,state:d.aggregationState,getRecordModel:l,propertyMapping:b,collectionRequestContext:C}),i.subGroupsMap.set(r,d)}}if(o.aggregation&&e&&r){var B,E;const c=v(e.map((e=>(0,s.Hd)(e))),r.map((e=>(0,s.Hd)(e)))),d="intersection"===(null===(B=o.aggregation)||void 0===B?void 0:B.type)||"intersection_and_independent"===(null===(E=o.aggregation)||void 0===E?void 0:E.type)?o.aggregation.intersectionAggregation:void 0,u=i.intersectionAggregationsMap;if(!u||!d)return{shouldComplete:!1};c.forEach((e=>{const o=u.get(e)||(0,a.yd)(d.aggregator);(0,a.pI)({block:t,schema:n,aggregation:d,state:o,getRecordModel:l,propertyMapping:b,collectionRequestContext:C}),u.set(e,o)}))}}return{shouldComplete:!1}}if("aggregation"===o.type){if("aggregation"!==i.type)throw new p.D3("Reducer and state type mismatch");(0,a.pI)({block:t,schema:n,aggregation:o.aggregation,state:i.aggregationState,getRecordModel:l,propertyMapping:b,collectionRequestContext:C});const e=i.aggregationState;if(o.aggregation.enforceMaxAggregationLimit&&(0,a.vX)(e.type))switch(e.type){case"count":case"count_values":if(e.count>=a.GW)return{shouldComplete:!0};break;case"empty":if(e.empty>=a.GW)return{shouldComplete:!0};break;case"not_empty":if(e.filled>=a.GW)return{shouldComplete:!0};break;case"unique":if(e.values.size>=a.GW)return{shouldComplete:!0}}return{shouldComplete:!1}}(0,r.t1)(o)}function _(e){const{reducer:t,state:n,loader:o,schema:i,isSprintPlanningView:l}=e;if("results"===t.type){if("results"!==n.type)throw new p.D3("Reducer and state type mismatch");let e=n.blockIds;"sorted"!==n.sorting&&(e=(0,u.Qx)(n.blockIds,n.sorting));return{type:"results",blockIds:e.slice(0,t.limit),hasMore:e.length>t.limit}}if("groups"===t.type){if("groups"!==n.type)throw new p.D3("Reducer and state type mismatch");const e=Array.from(n.groupsMap.values());let r=k({groupBy:"formula"===t.groupBy.type?{...t.groupBy.groupBy,property:t.groupBy.property}:t.groupBy,groups:e,groupSortPreference:t.groupSortPreference,loader:o,schema:i,isSprintPlanningView:l});const{subGroupsMap:u}=n;let _;if(u&&t.subGroup){const e=Array.from(u.values());_=k({groupBy:"formula"===t.subGroup.groupBy.type?{...t.subGroup.groupBy.groupBy,property:t.subGroup.groupBy.property}:t.subGroup.groupBy,groups:e,groupSortPreference:t.subGroup.groupSortPreference,loader:o,schema:i,isSprintPlanningView:l})}const{aggregation:w}=t;if(w){var c,d,m,g,f,h,y;if(!t.hideEmptyAggregationGroups)r=r.slice(0,t.limit),_=null===(h=_)||void 0===h?void 0:h.slice(0,null===(y=t.subGroup)||void 0===y?void 0:y.limit);const o={},i=[];r.forEach((e=>{const n=(0,s.Hd)(e.value),r=e.aggregationState;if(r){const e=(0,a.Pz)(r);if(o[n]={type:"aggregation",aggregationResult:e},"number"===e.type&&0===e.value&&Boolean(t.hideEmptyAggregationGroups))return}i.push(e)}));const l=[];null===(c=_)||void 0===c||c.forEach((e=>{const n=(0,s.Hd)(e.value),r=e.aggregationState;if(r){const e=(0,a.Pz)(r);if(o[n]={type:"aggregation",aggregationResult:e},"number"===e.type&&0===e.value&&Boolean(t.hideEmptyAggregationGroups))return}l.push(e)}));const{intersectionAggregationsMap:u}=n,p="intersection"===(null===(d=t.aggregation)||void 0===d?void 0:d.type)||"intersection_and_independent"===(null===(m=t.aggregation)||void 0===m?void 0:m.type)?null===(g=t.aggregation.intersectionAggregation)||void 0===g?void 0:g.aggregator:void 0;if(("intersection"===w.type||"intersection_and_independent"===w.type)&&u&&i&&l&&void 0!==p){v(i.map((e=>(0,s.Hd)(e.value))),l.map((e=>(0,s.Hd)(e.value)))).forEach((e=>{const t=u.get(e)||(0,a.yd)(p),n=(0,a.Pz)(t);o[e]={type:"aggregation",aggregationResult:n}}))}const{groupResults:b,subGroupResults:k}=S(i,l,t.limit,null===(f=t.subGroup)||void 0===f?void 0:f.limit);return{type:"groups",results:b,total:t.hideEmptyAggregationGroups?i.length:e.length,aggregationResults:o,subGroupResults:t.subGroup?k:void 0}}{var b;const{groupResults:n,subGroupResults:o}=S(r,_,t.limit,null===(b=t.subGroup)||void 0===b?void 0:b.limit);return{type:"groups",results:n,total:e.length,subGroupResults:o}}}if("aggregation"===t.type){if("aggregation"!==n.type)throw new p.D3("Reducer and state type mismatch");return{type:"aggregation",aggregationResult:(0,a.Pz)(n.aggregationState)}}(0,r.t1)(t)}function S(e,t,n,o){const r=e.slice(0,n),i=null==t?void 0:t.slice(0,o);return{groupResults:r.map((e=>{let{value:t,total:n}=e;return{value:t,total:n}})),subGroupResults:null==i?void 0:i.map((e=>{let{value:t,total:n}=e;return{value:t,total:n}}))}}function k(e){const{groupBy:t,groupSortPreference:n,groups:i,loader:a,schema:l,isSprintPlanningView:c}=e;if("status"===t.type||(0,s.S1)(t)){if("manual"===t.sort.type)return x(i,n);{const e=l[t.property];if("status"===(null==e?void 0:e.type))return function(e,t,n){const i=[],a=[],s=n.groups??[],l=n.options??[];for(const o of e){const e=o.value;if(e.value){if("status"===e.type){const t=e.value;if("by_group"===t.type){const e=s.findIndex((e=>e.name===t.group));a.push({group:o,index:e})}else if("by_option"===t.type){const e=l.findIndex((e=>e.value===t.option));a.push({group:o,index:e})}else(0,r.t1)(t)}}else i.push(o)}const c=o.MR(a,(e=>e.index));t||c.reverse();return[...i,...c.map((e=>e.group))]}(i,"ascending"===t.sort.type,e)}}else if("select"===t.type||"multi_select"===t.type){if("manual"===t.sort.type)return x(i,n);{const e=l[t.property];if("select"===(null==e?void 0:e.type)||"multi_select"===(null==e?void 0:e.type))return function(e,t){const n=[],o=[];for(const r of e){const e=r.value;"select"!==e.type&&"multi_select"!==e.type||!e.value?o.push(r):n.push(r)}n.sort(((e,t)=>{const n="select"!==e.value.type&&"multi_select"!==e.value.type||!e.value.value?"":e.value.value,o="select"!==t.value.type&&"multi_select"!==t.value.type||!t.value.value?"":t.value.value;return n.localeCompare(o,void 0,{sensitivity:"base"})})),t||n.reverse();return[...o,...n]}(i,"ascending"===t.sort.type)}}else if((0,s.ib)(t)){if("ascending"===t.sort.type)return I(i,!0,a);if("descending"===t.sort.type)return I(i,!1,a);(0,r.t1)(t.sort)}else if("relation"===t.type){if("manual"===t.sort.type)return c?w(i,n):x(i,n);if("ascending"===t.sort.type)return C(i,{ascending:!0,nullGroupsLast:D(t.property)});if("descending"===t.sort.type)return C(i,{ascending:!1,nullGroupsLast:D(t.property)});(0,r.t1)(t.sort)}else if("location"===t.type){if("manual"===t.sort.type)return x(i,n);if("ascending"===t.sort.type)return T(i,!0);if("descending"===t.sort.type)return T(i,!1);(0,r.t1)(t.sort)}else if((0,s.aB)(t)){if("manual"===t.sort.type)return x(i,n);if("ascending"===t.sort.type)return M(i,!0);if("descending"===t.sort.type)return M(i,!1);(0,r.t1)(t.sort)}else if("number"===t.type){if("ascending"===t.sort.type)return P(i,!0);if("descending"===t.sort.type)return P(i,!1);(0,r.t1)(t.sort)}else{if("checkbox"===t.type)return x(i,n);(0,r.t1)(t.type)}return i}function w(e,t){const n=function(e,t){const n=(0,i.W)(t),r=n.map((e=>e.value)),a={};for(let i=0;i<n.length;i++){const t=r[i];o.sE(e,t)||(a[(0,s.Hd)(t)]=i)}for(let o=0;o<e.length;o++){const t=e[o];a[(0,s.Hd)(t)]=o+n.length}return a}(t,e.some((e=>(0,s.nP)(e.value))));return o.MR(e,[e=>{const t=n[(0,s.Hd)(e.value)];return void 0!==t?t:1/0},e=>(0,s.Hd)(e.value)])}function x(e,t){const n={};for(let o=0;o<t.length;o++){const e=t[o];n[(0,s.Hd)(e)]=o}return o.MR(e,[e=>{const t=n[(0,s.Hd)(e.value)];return void 0!==t?t:1/0},e=>(0,s.Hd)(e.value)])}function I(e,t,n){const r=[],i=[];for(const o of e){const e=o.value;if(e.value){if("formula"===e.type&&"date"===e.value.type&&e.value.value){const t=(0,s.Hk)(e.value.value,n.userTimeZone);r.push({start:t.start.valueOf(),group:o})}else if((0,s.Mc)(e)){const t=(0,s.Hk)(e.value,n.userTimeZone);r.push({start:t.start.valueOf(),group:o})}}else i.push(o)}const a=o.MR(r,(e=>e.start));return t||a.reverse(),[...i,...a.map((e=>{let{group:t}=e;return t}))]}function C(e,t){const n=[],o=[],{ascending:r,nullGroupsLast:i}=t;for(const a of e){const e=a.value;"relation"===e.type&&e.value?n.push(a):o.push(a)}return n.sort(((e,t)=>{const n="relation"===e.type&&e.title?e.title:"",o="relation"===t.type&&t.title?t.title:"",r=n.localeCompare(o,void 0,{sensitivity:"base"});return 0===r&&"relation"===e.type&&"relation"===t.type&&(0,s.tL)(e.value)&&(0,s.tL)(t.value)&&(0,s.RA)(e.value.value)&&(0,s.RA)(t.value.value)?e.value.value.id<t.value.value.id?-1:e.value.value.id>t.value.value.id?1:0:r})),r||n.reverse(),i?[...n,...o]:[...o,...n]}function T(e,t){const n=[],o=[];for(const r of e){const e=r.value;"location"===e.type&&e.value?n.push(r):o.push(r)}return n.sort(((e,t)=>{const n="location"===e.type&&e.title?e.title:"",o="location"===t.type&&t.title?t.title:"";return n.localeCompare(o,void 0,{sensitivity:"base"})})),t||n.reverse(),[...o,...n]}function M(e,t){const n=[],o=[],r=[];for(const i of e){const e=i.value;e.value?"formula"===e.type&&"text"===e.value.type&&e.value.value?"other"===e.value.value.type?r.push(i):n.push({group:i,value:e.value.value.value}):(0,s.R7)(e)&&("other"===e.value.type?r.push(i):n.push({group:i,value:e.value.value})):o.push(i)}return n.sort(((e,t)=>e.value.localeCompare(t.value,void 0,{sensitivity:"base"}))),t||n.reverse(),[...o,...n.map((e=>{let{group:t}=e;return t})),...r]}function P(e,t){const n=[],r=[],i=[];for(const o of e){const e=o.value;if(e.value){if("formula"===e.type&&"number"===e.value.type&&e.value.value){const t="unique"===e.value.value.type?e.value.value.value:e.value.value.start;"out_of_range"===e.value.value.type?i.push(o):n.push({group:o,start:t})}else if("number"===e.type){const t="unique"===e.value.type?e.value.value:e.value.start;"out_of_range"===e.value.type?i.push(o):n.push({group:o,start:t})}}else r.push(o)}const a=o.MR(n,(e=>e.start));return t||a.reverse(),[...r,...a.map((e=>{let{group:t}=e;return t})),...i]}function A(e){const{propertyType:t,group:n,currentValue:o,getRecordModel:r,aggregator:i}=e,c=null==o?void 0:o.aggregationState,d=i?c??(0,a.yd)(i):void 0,u=(null==o?void 0:o.total)||0;if("relation"===t){if("relation"===n.type&&n.value){if((0,s.RA)(n.value)){const e=r(n.value);return{type:t,value:n,title:(0,g.QaF)(e?(0,l.wS)(e,"title",r):void 0),total:u,aggregationState:d}}return{type:t,value:n,title:n.value.value.variable,total:u,aggregationState:d}}return{type:t,value:n,title:void 0,total:u,aggregationState:d}}if("location"===t){if("location"===n.type&&n.value){const e=r(n.value);return{type:t,value:n,title:(0,g.QaF)(null==e?void 0:e.getName()),total:u,aggregationState:d}}return{type:t,value:n,title:void 0,total:u,aggregationState:d}}return{type:t,value:n,total:u,aggregationState:d}}function R(e,t){const n=function(e,t){const n=new Set,o=new Set,r=new Set;for(const i of e){if("groups"!==i.type)return new Set;for(const e of i.blockIdToGroupIds.get(t)??[])o.add(e);for(const e of i.blockIdToSubgroupIds.get(t)??[])r.add(e)}for(const i of r)for(const e of o){const t=(0,s.Lr)([i,e]);n.add(t)}return o.forEach((e=>n.add(e))),r.forEach((e=>n.add(e))),n}(e,t);for(const o of e){if("groups"!==o.type)return new Set;o.blockIdToGroupIds.delete(t),o.blockIdToSubgroupIds.delete(t)}return n}function D(e){return Boolean(e&&e===i.Es.TaskToProjectRelation)}},334299:(e,t,n)=>{n.d(t,{I_:()=>v,O0:()=>h,gT:()=>y,kJ:()=>f});n(757658);var o=n(653965),r=n(401898),i=n(202032),a=n(668497),s=n(399036),l=n(180951),c=n(463087),d=n(407057),u=n(253877),p=n(238297),m=n(924211),g=n(959753);function f(e){const{property:t,schema:n,block:s,getRecordModel:c,collectionRequestContext:p}=e,{userTimeZone:f,depth:v,intl:b}=p,_=y({property:t,schema:n,getRecordModel:c});if(!_)return;const{propertySchema:S,relationPropertySchema:k,targetCollectionSchema:w,targetProperty:x}=_;if(S.relation_property&&S.target_property){if(!S.aggregation||"show_unique"===S.aggregation){const e=g.kk5.fromBlock(s).getProperties(),t=l.j$({relationValue:l.rq(e[S.relation_property]),propertySchema:k,getRecordModel:c}),n=new Set;return o.oA(t.map((e=>{const t=c(e);if(S.target_property&&t){const e=(0,a.L)({property:x,schema:w,block:t,getRecordModel:c,collectionRequestContext:{...p,depth:v+1,visitedProperties:new Set}});if("show_unique"===S.aggregation&&e){if(n.has(e))return;n.add(e)}return e}}))).join(",")}{const e=h({property:t,schema:n,block:s,getRecordModel:c,collectionRequestContext:p});if(void 0===e)return;if("text"===e.type)return e.value;if("number"===e.type){if(!e.value)return;return e.value.toString()}if("date"===e.type){if(!e.value)return;if(!(0,i.Fw)(S.aggregation))return;if("earliest_date"===S.aggregation||"latest_date"===S.aggregation)return(0,d.Yx)(u.uO(e.value,f),"medium",(0,m.E2)(b));if("date_range"===S.aggregation)return(0,d.LU)(e.value,f,b);(0,r.t1)(S.aggregation)}(0,r.t1)(e)}}}function h(e){const{schema:t,property:n,block:o,getRecordModel:r,collectionRequestContext:a,formula2Error:s}=e,d=function(e){var t;let{resultCache:n,blockId:o,property:r}=e;return null===(t=n.get(o))||void 0===t?void 0:t.get(`${r}:${c.Hi.CollectionAggregationResult}`)}({resultCache:a.resultCache,blockId:o.id,property:n});if(void 0!==d)return d;const u=y({property:n,schema:t,getRecordModel:r});if(!u)return;const{propertySchema:m,relationPropertySchema:g,targetCollectionSchema:f,targetProperty:h}=u;if(!m.aggregation||!m.relation_property||!m.target_property)return;const v=l.j$({relationValue:l.rq(l.wS(o,m.relation_property)),getRecordModel:r,propertySchema:g}),b=function(e){const{relationPointers:t,initialState:n,getRecordModel:o,targetPropertyId:r,targetCollectionSchema:a,collectionRequestContext:s,formula2Error:l}=e,c={...n};for(const d of t){const e=o(d);if(e&&(0,p.ky)({getRecordModel:o,block:e})){const t={property:r,aggregator:c.type};(0,i.pI)({aggregation:t,state:c,schema:a,block:e,getRecordModel:o,propertyMapping:void 0,collectionRequestContext:s,formula2Error:l})}}return c}({initialState:(0,i.yd)(m.aggregation),relationPointers:v,getRecordModel:r,targetPropertyId:h,targetCollectionSchema:f,collectionRequestContext:a,formula2Error:s}),_=(0,i.Pz)(b);return function(e){let{resultCache:t,blockId:n,property:o,value:r}=e;const i=t.get(n)??new Map;i.set(`${o}:${c.Hi.CollectionAggregationResult}`,r),t.set(n,i)}({resultCache:a.resultCache,blockId:o.id,property:n,value:_}),_}function v(e){const{schema:t,property:n,block:o,getRecordModel:r}=e,i=y({property:n,schema:t,getRecordModel:r});if(!i)return[];const{propertySchema:a}=i;if(!a.relation_property||!a.target_property)return[];const s=l.j$({relationValue:l.rq(l.wS(o,a.relation_property)),getRecordModel:r,propertySchema:i.relationPropertySchema}),c=[];for(const l of s){const e=r(l);e&&c.push(e)}return c}function y(e){const{schema:t,property:n,getRecordModel:o}=e,r=t[n];if(!(r&&"rollup"===r.type&&r.relation_property&&r.target_property_type&&r.target_property))return;const i=t[r.relation_property];if(!i||"relation"!==i.type||!(0,s.F0)(i))return;const a=o((0,s.j0)(i));if(!a)return;const l=a.getNormalizedSchema(),c=a.getMappedProperty(r.target_property),d=l[c];return d&&r.target_property_type===d.type?{propertySchema:r,targetProperty:c,relationPropertySchema:i,targetCollectionModel:a,targetCollectionSchema:l,targetPropertySchema:d}:void 0}},10070:(e,t,n)=>{n.d(t,{Hs:()=>m,W0:()=>v,aQ:()=>c,jf:()=>u});n(21703),n(757658);var o=n(653965),r=n(940470),i=n(401898),a=(n(371663),n(670475),n(846283),n(172111)),s=n(305345),l=n(142613);const c={fromViewPropertyIds:(e,t)=>e.map((e=>c.fromViewPropertyId(e,t))),fromViewPropertyId:(e,t)=>(null==t?void 0:t[e])??e,toViewSchema(e,t){const n={},r=t?o.U_(t):{};for(const[o,i]of Object.entries(e)){n[(null==r?void 0:r[o])??o]=i}return n},derivePropertyUri(e,t){const n=(t?o.U_(t):{})[e];return(0,a.cR)(n)?n:void 0},derivePropertyUris(e,t){const n=t?o.U_(t):{};return new Set(Object.keys(e).map((e=>n[e])).filter(a.cR))}};class d extends Error{constructor(e,t,n){super(`Cannot merge property schemas for property "${e}": ${t.type} <> ${n.type}`)}}function u(e){const{schemas:t,onlyPropertyIds:n,prioritizeLooserLimitRule:a}=e,s={},l=n??o.G0(...t.map(Object.keys));for(const o of l){const e=t.map((e=>e[o])).filter(i.$K);if(!(0,i.Of)(e))continue;const n=r.x.reduce(e,((e,t)=>{const n=g(e,t,a);if(void 0===n){return{error:new d(o,e,t)}}return{value:n}}));if(r.x.isFail(n))return{error:n.error};s[o]=n.value}return{value:s}}const p=new WeakMap;function m(e,t,n){if("typed"!==e)return n.getNormalizedSchema();const o=p.get(n);if(!o){var r;const e=n.getNormalizedSchema(),o=u({schemas:[t,c.toViewSchema(e,null===(r=n.getFormat())||void 0===r?void 0:r.app_uri_map)],prioritizeLooserLimitRule:!1});if(o.error)throw o.error;return p.set(n,o.value),o.value}return o}function g(e,t,n){if("select"===e.type||"multi_select"===e.type){if(e.type!==t.type)return;const n=e.options||[],r=t.options||[],i=o.qZ(n,r,(e=>e.id));return{type:t.type,name:t.name,icon:t.icon,options:i}}if("status"===e.type){if(e.type!==t.type)return;return function(e,t){const n=[e,t].flatMap((e=>e.groups??[])),r=o.mN(n,(e=>h(e.id,e.name))).map((e=>({id:e.id,name:h(e.id,e.name),color:e.color,optionIds:[]}))),i=new Map;for(const o of r){var a,l;const n=null===(a=e.groups)||void 0===a?void 0:a.find((e=>h(e.id,e.name)===o.name)),r=null===(l=t.groups)||void 0===l?void 0:l.find((e=>h(e.id,e.name)===o.name)),s=(e.options??[]).filter((e=>((null==n?void 0:n.optionIds)??[]).includes(e.id))),c=e=>{const t=e.value,n=i.get(t);if(void 0===n)i.set(t,{option:e,collectionIdSet:new Set(e.collectionIds),group:o});else for(const o of e.collectionIds??[])n.collectionIdSet.add(o)};(t.options??[]).filter((e=>((null==r?void 0:r.optionIds)??[]).includes(e.id))).forEach(c),s.forEach(c)}const c=new Set,d=[];for(const{group:o,option:u,collectionIdSet:p}of i.values()){let e=u.id;c.has(e)&&(e=`${e}-${s.c(u.value)}`),c.add(e),d.push({...u,id:e,...p.size>0?{collectionIds:[...p]}:{}}),(o.optionIds??=[]).push(e)}return{type:"status",name:t.name,defaultOption:t.defaultOption,groups:r,options:d}}(e,t)}if("number"===e.type){if(e.type!==t.type)return;return{type:t.type,name:t.name,icon:t.icon,number_format:f(e,t,"number_format"),show_as:f(e,t,"show_as")}}if("date"===e.type||"created_time"===e.type||"last_edited_time"===e.type||"last_visited_time"===e.type){if(e.type!==t.type)return;return{type:t.type,name:t.name,icon:t.icon,time_format:f(e,t,"time_format"),date_format:f(e,t,"date_format")}}if("person"===e.type){if(e.type!==t.type)return;const o=f(e,t,"limit");return{type:t.type,name:t.name,icon:t.icon,limit:o??(n?void 0:t.limit),default:f(e,t,"default")??t.default}}if("relation"===e.type){if(e.type!==t.type||e.autoRelate!==t.autoRelate)return;const o=f(e,t,"limit");return{type:t.type,name:t.name,icon:t.icon,autoRelate:f(e,t,"autoRelate"),property:f(e,t,"property"),limit:o??(n?void 0:t.limit),version:"v2",collection_pointer:f(e,t,"collection_pointer")}}if("rollup"===e.type){if(e.type!==t.type||e.relation_property!==t.relation_property||e.aggregation!==t.aggregation)return;return{type:t.type,name:t.name,icon:t.icon,relation_property:t.relation_property,aggregation:t.aggregation,show_as:f(e,t,"show_as"),target_property:f(e,t,"target_property"),target_property_type:f(e,t,"target_property_type")}}if("formula"===e.type){if("v2"===e.version){var r,a;if(e.type!==t.type||e.version!==t.version||!o.Xy(null===(r=e.formula2)||void 0===r?void 0:r.code,null===(a=t.formula2)||void 0===a?void 0:a.code))return;return{type:t.type,name:t.name,icon:t.icon,formula2:t.formula2,number_format:f(e,t,"number_format"),show_as:f(e,t,"show_as")}}if(e.type!==t.type||e.version!==t.version||!o.Xy(e.formula,t.formula))return;return{type:t.type,name:t.name,icon:t.icon,formula:t.formula,number_format:f(e,t,"number_format"),show_as:f(e,t,"show_as")}}if("auto_increment_id"===e.type){if(e.type!==t.type)return;return t}if("title"===e.type||"file"===e.type||"text"===e.type||"checkbox"===e.type||"url"===e.type||"email"===e.type||"phone_number"===e.type||"created_by"===e.type||"last_edited_by"===e.type||"button"===e.type||"location"===e.type||"verification"===e.type){if(e.type!==t.type)return;return t}(0,i.t1)(e)}function f(e,t,n){return o.Xy(e[n],t[n])?e[n]:void 0}function h(e,t){return"todo-status-group"===e?l.G1:"in-progress-status-group"===e?l.Ho:"complete-status-group"===e?l.RW:"current-status-group"===e?l.Ap:"future-status-group"===e?l.JV:t}function v(e,t){for(const n in t){const o=t[n];if((null==o?void 0:o.name)===e)return[n,o]}}},560246:(e,t,n)=>{n.d(t,{$m:()=>Z,C6:()=>y,EO:()=>N,O$:()=>L,QT:()=>P,Qx:()=>D,Xm:()=>U});n(757658);var o=n(653965),r=n(401898),i=n(435011),a=n(180951),s=n(334299),l=n(640506),c=n(407057),d=n(253877),u=n(335102),p=n(484682),m=n(882883),g=n(989470),f=n(421838),h=n(604308);let v;const y=["ascending","descending"],b={select:!0,multi_select:!0,status:!0,created_time:!0,date:!0,last_edited_time:!0,last_visited_time:!0,number:!0,auto_increment_id:!0,verification:!0};function _(e){var t,n;return b[e.type]||"formula"===e.type&&("number"===(null===(t=e.formula2)||void 0===t?void 0:t.result_type.type)||"number"===(null===(n=e.formula)||void 0===n?void 0:n.result_type))||"rollup"===e.type&&"number"===e.target_property_type}function S(e){const{textValue:t,getRecordModel:n,collectionRequestContext:o}=e,{userTimeZone:r,intl:i}=o;return(0,m.Xh)({intl:i,textValue:t,getRecordModel:n,userTimeZone:r,disableAnnotationPrefix:!0,renderDateAnnotationsAsISO:!0}).trim()}function k(e){const{textValue:t,propertySchema:n}=e,o=n.options||[],r=a.Sj(t,o),i=o.findIndex((e=>e.value===r));if(i>=0)return i}const w=new WeakMap;function x(e){const t=function(e){const t=e.options||[],n=e.groups||[],r=new Map;for(const[o,i]of n.entries())for(const e of i.optionIds??[])r.set(e,o);return o.MR([...t.entries()],[e=>{let[t,n]=e;return r.get(n.id)},e=>{let[t,n]=e;return t}]).map((e=>{let[t,n]=e;return n}))}(e),n=new Map;for(let o=0;o<t.length;o++)n.set(t[o].value,o);return n}function I(e){return f.Jcv(e.textValue)}function C(e){return a.VY(e.textValue)}function T(e){const{actors:t,getRecordModel:n,intl:r}=e;return o.oA(t.map((e=>{const t=n(e);return null==t?void 0:t.getDisplayName(r)}))).join(" ")}function M(e){const{pointers:t,getRecordModel:n}=e;return o.oA(t.map((e=>{const t=n(e),o=t?a.wS(t,"title",n):"";return t&&o?f.Jcv(o).replace(/,/g,""):""}))).join(" ")}function P(e){const{result:t,getRecordModel:n,userTimeZone:o,intl:r,useImprovedSort:i}=e;if("checkbox"===t.type||"number"===t.type)return t.value;if("text"===t.type)return i?(0,m.Xh)({textValue:t.value,getRecordModel:n,userTimeZone:o,intl:r,disableAnnotationPrefix:!0,renderDateAnnotationsAsISO:!0}).trim():(0,m.Xh)({textValue:t.value,getRecordModel:n,userTimeZone:o,intl:r}).trim();if("date"===t.type)return(0,c.RY)(t.value,o);if("person"===t.type)return T({actors:[t.value],getRecordModel:n,intl:r});if("block"===t.type){const e=n(t.value);if(!e)return;return e.getRenderTitle({getRecordModel:n,userTimeZone:o,intl:r})}if("array"===t.type){const e=t.values;if(0===e.length)return;if(e.every((e=>"block"===e.type))){return M({pointers:e.map((e=>e.value)),getRecordModel:n})}if(function(e){return e.every((e=>"person"===e.type))}(e)){return T({actors:e.map((e=>e.value)),getRecordModel:n,intl:r})}return i?(0,m.Xh)({textValue:(0,u.j4)(t),getRecordModel:n,userTimeZone:o,intl:r,disableAnnotationPrefix:!0,renderDateAnnotationsAsISO:!0}):(0,m.Xh)({textValue:(0,u.j4)(t),getRecordModel:n,userTimeZone:o,intl:r})}}const A={title:S,text:S,select:k,multi_select:k,status:function(e){const{textValue:t,propertySchema:n}=e,o=a.ZG(t,n);if(!o)return;const r=w.get(n);if(r)return r.get(o);const i=x(n);return w.set(n,i),i.get(o)},url:I,email:I,phone_number:I,checkbox:function(e){return a.Ml(e.textValue)},number:C,auto_increment_id:C,location:function(e){const{getRecordModel:t,block:n,collectionRequestContext:o}=e,r=a.nW({block:n,getRecordModel:t});if(r)return S({textValue:r.getName(),getRecordModel:t,collectionRequestContext:o}).trim()},person:function(e){const{textValue:t,getRecordModel:n,propertySchema:o,block:r,collectionRequestContext:i}=e,{intl:s}=i;return T({intl:s,actors:a.DW({textValue:t,propertySchema:o,blockCreatorPointer:r.getCreatedByPointer()}),getRecordModel:n})},date:function(e){const{textValue:t,collectionRequestContext:n}=e,{userTimeZone:o}=n,r=a.Gl(t);if(r)return d.uO(r,o)},relation:function(e){const{textValue:t,getRecordModel:n,propertySchema:o}=e;if("relation"!==o.type)return;return M({pointers:a.j$({relationValue:a.rq(t),getRecordModel:n,propertySchema:o}),getRecordModel:n})},created_time:e=>{let{block:t}=e;return t.getCreatedTime()},last_edited_time:e=>{let{block:t}=e;return t.getLastEditedTime()},file:e=>{let{textValue:t}=e;return f.Jcv(t)},created_by:e=>{let{block:t,getRecordModel:n,collectionRequestContext:o}=e;const{intl:r}=o,i=t.getCreatedByPointer();if(i)return T({actors:[i],getRecordModel:n,intl:r})},last_edited_by:e=>{let{block:t,getRecordModel:n,collectionRequestContext:o}=e;const{intl:r}=o,i=t.getLastEditedByPointer();if(i)return T({actors:[i],getRecordModel:n,intl:r})},last_visited_time:e=>{let{block:t,getRecordModel:n,collectionRequestContext:o}=e;const{userId:r}=o;if(!r)return;const i=(0,g.Pv)({parent_id:t.id,user_id:r}),a=n({table:g.UI,id:i,spaceId:t.getSpaceId()});return null==a?void 0:a.getVisitedAt()},verification:function(e){const t=a._w(e.textValue);if(!t)return;const n=(0,h.WN)(t),o=n.type;switch(o){case"verified":return n.isIndefinite?Number.POSITIVE_INFINITY:n.dateTimeRange.end.valueOf();case"expired":return n.dateTimeRange.end.valueOf();case"none":return;default:(0,r.t1)(o)}}};function R(e){const{schema:t,property:n,block:o,getRecordModel:c,propertyMapping:u,collectionRequestContext:m}=e,{userTimeZone:g,depth:f,intl:h,formulaTimeoutTimestampMs:v,logFormulaTimeoutFn:y}=m,b=t[n];if(!b)return;if("formula"===b.type){if(void 0===b.version){const t=(0,p.AH)({...e,collectionRequestContext:{...m,visitedProperties:new Set}});return l.U3(t)?d.uO(t,g):t}{if(!b.formula2)return;const e=(0,i.EC)({block:o,property:n,formulaCode:b.formula2.code,getRecordModel:c,intl:h,userTimeZone:g,depth:f,visitedProperties:new Set,formulaTimeoutTimestampMs:v,logFormulaTimeoutFn:y,logFormulaStatsFn:m.logFormulaStatsFn,resultCache:m.resultCache});if(!e)return;const t=P({result:e,getRecordModel:c,userTimeZone:g,intl:h,useImprovedSort:!0});return"string"==typeof t?t.toLowerCase():t}}if("rollup"===b.type){const o=(0,s.gT)({property:n,schema:t,getRecordModel:c});if(!o)return;if(b.aggregation&&"show_unique"!==b.aggregation){const t=(0,s.O0)({...e,collectionRequestContext:{...m,visitedProperties:new Set}});if(void 0===t)return;if("number"===t.type||"text"===t.type)return t.value;if("date"===t.type){if(!t.value)return;return d.uO(t.value,g)}(0,r.t1)(t)}const i=(0,s.I_)(e);if(0===i.length)return;const a=i[0];return R({property:o.targetProperty,schema:o.targetCollectionSchema,block:a,getRecordModel:c,propertyMapping:void 0,collectionRequestContext:{...m,depth:f+1}})}if("button"===b.type)return;const _=A[b.type],S=(null==u?void 0:u[n])??n;let k;return k="title"===b.type&&o.isType("collection_view_page")?a.iT(o,c):a.wS(o,S,c),_({textValue:k,propertySchema:b,...e})}function D(e,t){const n=[...e];return n.sort(t.compare),n}function B(e){const{property:t,propertySchema:n,direction:o,userTimeZone:r,userId:i,intl:a}=e;return{getSortValue:e=>{let{block:n,schema:o,propertyMapping:s,getRecordModel:l,formulaTimeoutTimestampMs:c,logFormulaTimeoutFn:d,logFormulaStatsFn:u,resultCache:p}=e;return R({property:t,schema:o,block:n,getRecordModel:l,propertyMapping:s,collectionRequestContext:{intl:a,userId:i,userTimeZone:r,depth:0,resultCache:p,visitedProperties:new Set,formulaTimeoutTimestampMs:c,logFormulaTimeoutFn:d,logFormulaStatsFn:u}})},descending:"descending"===o,isNumeric:!!n&&_(n)}}function E(e){const{userId:t,userTimeZone:n,intl:o,apiSorts:i}=e;return i?i.map((i=>"property"in i?B({property:i.property,propertySchema:e.schema[i.property],direction:i.direction,userId:t,userTimeZone:n,intl:o}):"timestamp"in i?function(e){const{timestamp:t,direction:n}=e;return{getSortValue:e=>{let{block:n}=e;return"created_time"===t?n.getCreatedTime():"last_edited_time"===t?n.getLastEditedTime():void(0,r.t1)(t)},descending:"descending"===n,isNumeric:!0}}(i):void(0,r.t1)(i))):[]}function F(e){const{userTimeZone:t,intl:n,userId:o,userSorts:r,schema:i}=e;return[...r.map((e=>B({property:e.property,propertySchema:i[e.property],direction:e.direction,userId:o,userTimeZone:t,intl:n})))]}function Z(e){return[...E(e),...F(e)]}function U(e){return[new V(e),{getSortValue:e=>{let{block:t}=e;return t.getCreatedTime()},descending:!0,isNumeric:!0},{getSortValue:e=>{let{block:t}=e;return t.id},descending:!1,isNumeric:!0}]}v=Symbol.iterator;class V{constructor(e){this.pageSortIndex=void 0,this.ids=void 0,this.descending=!1,this.isNumeric=!0,this.ids=e,this.pageSortIndex=V.buildPageSortIndex(e)}getIds(){return this.ids}getSortValue(e){return this.pageSortIndex[e.block.id]}[v](){return Object.entries(this.pageSortIndex)[Symbol.iterator]()}update(e){this.ids=e,this.pageSortIndex=V.buildPageSortIndex(e)}}V.buildPageSortIndex=e=>{const t={};return e.forEach(((e,n)=>t[e]=n)),t};class N{constructor(e){this.resultSortMap=void 0,this.compare=(e,t)=>{const{querySorts:n,resultSortMap:o}=this;for(let r=0;r<n.length;r++){const i=n[r],a=L(o[e][r],o[t][r],{numeric:i.isNumeric,descending:i.descending});if(0!==a)return a}return 0},this.querySorts=e,this.resultSortMap={}}debugDump(){return this.resultSortMap}hasBlock(e){return void 0!==this.resultSortMap[e]}deleteBlock(e){delete this.resultSortMap[e]}updateBlock(e){const t=this.querySorts.map((t=>t.getSortValue(e)));this.resultSortMap[e.block.id]=t}updatePageSortIfAny(e){const t=this.querySorts.findIndex((e=>e instanceof V));if(-1===t)return[];const n=this.querySorts[t];n.update(e);const o=[];for(const[r,i]of Object.entries(this.resultSortMap)){const e=i[t],a=n.getSortValue({block:{id:r}});e!==a&&(i[t]=a,o.push(r))}return o}}const O=new Intl.Collator("en",{caseFirst:"upper",numeric:!0});function L(e,t,n){let{numeric:o,descending:r}=n;const i=null==e||""===e,a=null==t||""===t;return i&&!a?1:a&&!i?-1:i||a?0:o?e>t?r?-1:1:e<t?r?1:-1:0:r?O.compare(t.toString(),e.toString()):O.compare(e.toString(),t.toString())}},528155:(e,t,n)=>{n.d(t,{MQ:()=>c,Sl:()=>s,nx:()=>l});var o=n(401898),r=n(212847),i=n(371663),a=n(760310);const s={schema:r.union([r.object({required:{type:r.literal("collection"),id:r.uuid(),spaceId:r.uuid()},optional:{}}),r.object({required:{type:r.literal("typed"),databaseType:r.literals(...i.fW),spaceId:r.uuid()},optional:{}}),r.object({required:{type:r.literal("trending"),spaceId:r.uuid(),userId:r.uuid()},optional:{teamId:r.uuid()}}),r.object({required:{type:r.literal("similarUsers"),spaceId:r.uuid(),userId:r.uuid()},optional:{}})]),getCollectionId(e){if(l(e))return(0,a.hJ)(e);switch(e.type){case"collection":return e.id;case"typed":return e.databaseType;default:(0,o.t1)(e)}},getTaintId(e){if(l(e)){return`${(0,a.hJ)(e)}:${e.spaceId}`}switch(e.type){case"collection":return e.id;case"typed":return`${e.spaceId}:${e.databaseType}`;default:(0,o.t1)(e)}},hasCollections(e){if(l(e))return!1;switch(e.type){case"collection":case"typed":return!0;default:(0,o.t1)(e)}}};function l(e){return c(null==e?void 0:e.type)}function c(e){switch(e){case"trending":case"similarUsers":return!0;case"collection":case"typed":case void 0:return!1;default:(0,o.t1)(e)}}},142613:(e,t,n)=>{n.d(t,{Ap:()=>s,G1:()=>r,GX:()=>p,Ho:()=>i,JV:()=>l,RW:()=>a,ct:()=>d,i9:()=>m,lH:()=>u});var o=n(709291);const r="To-do",i="In progress",a="Complete",s="Current",l="Future",c=[r,i,a,s,l],d=(0,o.defineMessages)({statusGroupNameTodo:{id:"database.statusProperty.groupName.todo",defaultMessage:"To-do"},statusGroupNameInProgress:{id:"database.statusProperty.groupName.inProgress",defaultMessage:"In progress"},statusGroupNameComplete:{id:"database.statusProperty.groupName.complete",defaultMessage:"Complete"},statusGroupNameFuture:{id:"database.statusProperty.groupName.future",defaultMessage:"Complete"},statusGroupNameCurrent:{id:"database.statusProperty.groupName.current",defaultMessage:"Complete"}});function u(e){return!!c.includes(e)}function p(e){switch(e){case r:return d.statusGroupNameTodo;case i:return d.statusGroupNameInProgress;case a:return d.statusGroupNameComplete;case s:return d.statusGroupNameCurrent;case l:return d.statusGroupNameFuture;default:return d.statusGroupNameTodo}}const m=(0,o.defineMessages)({statusOptionNotStarted:{id:"database.statusProperty.option.notStarted",defaultMessage:"Not started"},statusOptionInProgress:{id:"database.statusProperty.option.inProgress",defaultMessage:"In progress"},statusOptionDone:{id:"database.statusProperty.option.done",defaultMessage:"Done"},typedStatusOptionArchived:{id:"appTemplates.tasks.archived",defaultMessage:"Archived"}})},463087:(e,t,n)=>{n.d(t,{Hi:()=>i,aX:()=>a,yd:()=>r});var o=n(212847);const r=o.undefinable(o.object({required:{blockIdToVersion:o.record(o.string(),o.number())},optional:{hasMore:o.boolean()}}));let i=function(e){return e[e.FormulaValue=0]="FormulaValue",e[e.FormulaValue2=1]="FormulaValue2",e[e.CollectionAggregationResult=2]="CollectionAggregationResult",e}({});const a={"421618d2-8a87-4d8b-89f3-66b3be775c42":"B1","152bf835-0558-4737-a7c0-f8320e4e8b96":"B2","fdd25a45-a3ff-4405-9750-4850d9dae916":"B3","ea7d751e-a89f-473b-a900-168c543bd156":"B4","9a447736-eb8f-4816-92a2-9a805605ab6b":"B5","3ff86601-f54d-49a7-83c7-667d1d259267":"B6"}},516691:(e,t,n)=>{n.d(t,{Vg:()=>i,dn:()=>o,vY:()=>r});n(600606);function o(e){const{table:t,id:n}=e;return`${n}:${t}`}function r(e){return`:${e.id}`}function i(e){const t=e.split(":");return{id:t[1],spaceId:""===t[0]?void 0:t[0]}}},563144:(e,t,n)=>{n.d(t,{P:()=>r});var o=n(653965);function r(e,t){return t.getAlive()!==e.getAlive()||!o.Xy(t.getText(),e.getText())||!o.Xy(t.getContent(),e.getContent())}},667946:(e,t,n)=>{n.d(t,{X:()=>l,Z:()=>d});var o=n(667294),r=n(926249),i=n(517755),a=n(394302),s=n(785893);const l=40;function c(e){const{emojiId:t,emojiName:n,emojiUrl:o,spaceId:r,size:c,baseUrl:d,currentUserId:u,style:p}=e,m=i.EK({url:o,baseUrl:d,fullyQualified:!1,userId:u,width:l,permissionRecord:{table:a.p,id:t,spaceId:r}});return(0,s.jsx)("img",{alt:n,"aria-label":n,style:{width:c,height:c,background:`url("${m}")`,backgroundSize:"100%",backgroundPosition:"center",backgroundRepeat:"no-repeat",...p},src:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="})}const d=o.memo(c,r.Z)},562760:(e,t,n)=>{n.d(t,{Z:()=>i});n(667294);var o=n(379362),r=n(785893);function i(e){const{icon:t,theme:n,size:i,style:a}=e,s=t.startsWith("/icons/");return(0,r.jsx)("div",{style:{width:i,height:i,transform:s?"scale(1.2)":void 0,mask:`url(${t}${s?`?mode=${n.mode}`:""}) no-repeat center`,WebkitMask:`url(${t}${s?`?mode=${n.mode}`:""}) no-repeat center`,backgroundColor:(null==a?void 0:a.fill)??o.Lr[n.mode].gray,...a}})}},122377:(e,t,n)=>{n.d(t,{P:()=>s,Z:()=>l});var o=n(667294),r=n(649814),i=n(665217),a=n(785893);const s="notion-emoji",l=o.memo((function(e){let{type:t,char:n,size:o,imgStyle:s,emojiData:l}=e;return"raw"===t?(0,a.jsx)(r.Z,{char:n,size:o}):(0,a.jsx)(i.Z,{char:n,type:t,size:o,style:s,emojiData:l})}))},649814:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(667294),r=n(785893);const i=o.memo((function(e){return(0,r.jsx)("span",{role:"img","aria-label":e.char,style:{fontFamily:'"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Noto Color Emoji","Segoe UI Symbol","Android Emoji",EmojiSymbols',lineHeight:"1em",whiteSpace:"nowrap",fontSize:e.size},children:e.char})}))},665217:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(667294),r=n(542129),i=n(415095),a=n(122377),s=n(649814),l=n(785893);const c=o.memo((function(e){let{char:t,type:n,size:o,style:c,emojiData:d}=e;const u=(0,r.y)(t,d);if(!u)return console.error("Could not find character in emojiData:",t),(0,l.jsx)(s.Z,{char:t,size:o});const p=(0,i.bk)(n),m=u.sheetX/i.zX*100+"%",g=u.sheetY/i.zX*100+"%";return(0,l.jsx)("img",{className:a.P,alt:t,"aria-label":t,style:{width:o||"100%",height:o||"100%",backgroundRepeat:"no-repeat",background:`url("${p}")`,backgroundPositionX:m,backgroundPositionY:g,backgroundSize:`${i.zX+1}00% ${i.zX+1}00%`,...c},src:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="})}))},702749:(e,t,n)=>{n.d(t,{V:()=>l});n(757658);var o=n(667294),r=n(542129),i=n(415095),a=n(122377),s=n(785893);function l(e){const{children:t,type:n,size:l,emojiData:c}=e,d=(0,i.p4)(t),u=[];let p="";for(const o of d){(0,r.y)(o,c)?(p.length>0&&(u.push(p),p=""),u.push((0,s.jsx)(a.Z,{char:o,size:l,type:n,imgStyle:{verticalAlign:"-0.1em",margin:"0 0.1em"},emojiData:c},u.length))):p+=o}return p.length>0&&u.push(p),o.createElement(o.Fragment,{},...u)}},598923:(e,t,n)=>{n.d(t,{CY:()=>f,MW:()=>c,k7:()=>h});n(667294);var o=n(657347),r=n(401898),i=n(269634),a=n(116275),s=n(785893);const l="0.16.9";function c(e){return"block"===e.display?(0,s.jsx)(d,{...e}):(0,s.jsx)(u,{...e})}function d(e){const{katex:t,equation:n,options:o,style:r,errorStyle:i,theme:a}=e,l=f({katex:t,equation:n,options:{...o,displayMode:!0}});return l.error?(0,s.jsx)("div",{style:{background:a.errorText,...i},role:"alert",children:l.error.message},"error"):(0,s.jsx)("div",{style:r,dangerouslySetInnerHTML:{__html:l.value}},"value")}function u(e){const{katex:t,index:n,equation:o,options:r,isTemporary:l,style:c,theme:d,intl:u}=e;if(!o)return(0,s.jsxs)(p,{index:n,style:{...m("empty",d),...c},children:[(0,i.G)(g.equationIcon),u.formatMessage({id:"inlineEquationToken.placeholder.label",defaultMessage:"New equation"})]},n);const h=f({katex:t,equation:o,options:{...r,displayMode:!1}});return h.error?(0,s.jsxs)(p,{index:n,style:{...m("error",d),...c},children:[(0,i.G)(g.equationIcon),u.formatMessage({id:"inlineEquationToken.invalidPlaceholder.label",defaultMessage:"Invalid equation"})]},n):(0,s.jsxs)(p,{index:n,style:{...l&&m("temporary",d),...c},children:[(0,s.jsx)("span",{}),(0,s.jsx)("span",{dangerouslySetInnerHTML:{__html:h.value}}),(0,s.jsx)("span",{children:a.U3})]},n)}function p(e){const{index:t,style:n,children:o}=e;return(0,s.jsx)("span",{"data-token-index":t,contentEditable:!1,className:a.et,style:{...g.inlineContainer,...n},children:o},t)}function m(e,t){return"empty"===e?{...g.inlinePlaceholder,background:t.equationEmptyPlaceholderBackground,color:t.mediumTextColor}:"error"===e?{...g.inlinePlaceholder,background:t.equationErrorPlaceholderBackground,color:t.errorText}:"temporary"===e?{...g.inlinePlaceholder,...g.temporaryPlaceholder,background:t.equationTemporaryPlaceholderBackground}:void(0,r.t1)(e)}const g={inlineContainer:{userSelect:"all",WebkitUserSelect:"all",MozUserSelect:"all"},inlinePlaceholder:{display:"inline-flex",alignItems:"center",verticalAlign:"top",padding:"0 4px",borderRadius:4},equationIcon:{width:16,height:16,marginRight:4,display:"inline-block",fill:"currentColor"},temporaryPlaceholder:{transform:"translate3d(-4px, 0, 0)",marginRight:-8}};function f(e){const{katex:t,equation:n,options:r}=e;try{return{error:void 0,value:t.renderToString(n,r)}}catch(i){return{error:(0,o.t)(i)}}}function h(){return(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`@import url('https://cdnjs.cloudflare.com/ajax/libs/KaTeX/${l}/katex.min.css')`}})}},12396:(e,t,n)=>{n.d(t,{RE:()=>Z,ZP:()=>U,wG:()=>E});n(667294);var o=n(379362),r=n(188607),i=n(591856),a=n(760019),s=n(742696),l=n(920669),c=n(745238),d=n(785893);const u=(0,c.IU)("typesButton",{viewBox:"0 0 16 16",svg:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M7.00004 12.8265L7.06157 7.36455C7.0684 7.11162 7.32817 7.01592 7.49907 7.19366L11.2383 11.0286C11.4229 11.2269 11.293 11.473 11.0401 11.4866L9.56352 11.5481L10.794 14.3919C10.8555 14.5149 10.8077 14.6585 10.6846 14.72L10.001 14.9866C9.87797 15.0413 9.74125 14.973 9.68657 14.8499L8.51762 11.9583L7.47856 13.0042C7.30083 13.1751 6.99321 13.0931 7.00004 12.8265Z"}),(0,d.jsx)("path",{d:"M0.679932 11.1758C0.679932 12.5908 1.40122 13.2949 2.82993 13.2949H5.81912C5.77156 13.1428 5.74706 12.9789 5.7502 12.8063L5.75709 12.1943H2.83993C2.15634 12.1943 1.77993 11.832 1.77993 11.1211V4.88379C1.77993 4.17285 2.15634 3.81055 2.83993 3.81055H13.15C13.8268 3.81055 14.21 4.17285 14.21 4.88379V11.1211C14.21 11.832 13.8268 12.1943 13.15 12.1943H12.2188C12.0027 12.4483 11.716 12.6111 11.4183 12.6869L11.6814 13.2949H13.17C14.6055 13.2949 15.31 12.584 15.31 11.1758V4.8291C15.31 3.4209 14.6055 2.70996 13.17 2.70996H2.82993C1.40122 2.70996 0.679932 3.41406 0.679932 4.8291V11.1758Z"})]})});var p=n(742283),m=n(363030),g=n(669196),f=n(282447),h=n(648524),v=n(943393),y=n(932426),b=n(571500),_=n(372050),S=n(155159),k=n(526774),w=n(934093),x=n(492607),I=n(832623),C=n(753866),T=n(603729),M=n(800108),P=n(983303),A=n(656505),R=n(808938),D=n(394308),B=n(562760);const E={text:M.p,number:S.J,url:R.O,file:v.Z,date:f.V,person:k.O,email:h.n,phone_number:w.u,checkbox:p.r,select:C.w,multi_select:_.A,status:T.T,relation:x.v,rollup:I.G,formula:y.D,created_time:m.I,created_by:g.H,title:P.c,last_edited_time:m.I,last_edited_by:g.H,last_visited_time:m.I,button:u,auto_increment_id:b.A,location:s.t,verification:D.f,ai_summary:i.Y,ai_custom_prompt:l.y,ai_extract:_.A,ai_translate:r.Q,ai_keywords:a.F},F=A.S;function Z(e){return e.mediumIconColor}function U(e){const{size:t,style:n,theme:r,icon:i,type:a}=e,s=i&&(0,o.V2)(i);if(i)return s?(0,d.jsx)(B.Z,{style:{fill:Z(r),...n},size:t,theme:r,icon:i}):(0,d.jsx)("img",{src:i,style:{width:t,height:t}});const l={width:t,height:t,fill:Z(r),...n};return E[a]?E[a](l):F(l)}},633831:(e,t,n)=>{n.d(t,{Z:()=>r});n(667294);var o=n(785893);function r(e){let{children:t,viewBox:n,style:r,className:i}=e;return(0,o.jsx)("svg",{role:"graphics-symbol",viewBox:n,style:{width:"100%",height:"100%",display:"block",fill:"inherit",flexShrink:0,...r},className:i,children:t})}},984619:(e,t,n)=>{n.d(t,{Nv:()=>s,ZP:()=>c,e1:()=>l,lo:()=>a});n(667294);var o=n(531701),r=n(137810),i=n(785893);let a=function(e){return e[e.ExtraSmall=0]="ExtraSmall",e[e.Small=1]="Small",e[e.Medium=2]="Medium",e[e.Inline=3]="Inline",e[e.Large=4]="Large",e}({});function s(e){switch(e){case a.ExtraSmall:return 6;case a.Large:return 10;case a.Small:case a.Medium:case a.Inline:default:return 8}}function l(e){switch(e){case a.ExtraSmall:return{height:14,fontSize:12,paddingLeft:6,paddingRight:6,margin:"0 4px 0 0"};case a.Small:return{height:18,fontSize:12,paddingLeft:6,paddingRight:6,margin:"0 4px 4px 0"};case a.Medium:return{height:20,fontSize:14,paddingLeft:6,paddingRight:6,margin:"0 6px 6px 0"};case a.Large:return{height:24,fontSize:16,paddingLeft:8,paddingRight:8,margin:"0 8px 8px 0"};case a.Inline:default:return{height:18,fontSize:13,paddingLeft:8,paddingRight:8,margin:"0 6px 0 0"}}}const c=function(e){const{backgroundColor:t,color:n,format:a,isSingle:c,isStrikedThrough:d,shouldShrink:u,showColoredDot:p,style:m,theme:g,value:f}=e,h={display:c?"inline-flex":"flex",alignItems:"center",flexShrink:c||u?1:0,minWidth:0,borderRadius:4,lineHeight:"120%",color:n||("light"===g.mode?g.regularTextColor:o.ZP.whiteWithAlpha(.7)),background:t||(0,o.KR)(g,"default").backgroundColor},v=s(a),y="default"===p?"gray":p,b=y?{marginRight:5,borderRadius:"50%",height:v,width:v,backgroundColor:g.accentColors[y][600]}:{},_=l(a);return(0,i.jsx)("div",{style:{...h,..._,margin:c?0:_.margin,...m},children:(0,i.jsxs)("div",{style:{...r.Z.textOverflowStyle,textDecoration:d?"line-through":void 0},children:[p??(0,i.jsx)("div",{style:b}),f]})})}},950655:(e,t,n)=>{n.d(t,{Z:()=>s});n(667294);var o=n(937612),r=n(137810),i=n(785893);function a(e){const{children:t,theme:n}=e;return(0,i.jsx)("span",{style:{whiteSpace:"nowrap",display:"inline-flex",borderRadius:4,marginLeft:6,padding:"2px 6px",color:n.lightTextColor,background:n.defaultBadgeBackground,fontSize:".9em",lineHeight:1,letterSpacing:"0.04em",fontWeight:r.Z.fontWeight.regular,alignItems:"center"},children:t})}function s(e){const{theme:t,intl:n,isPageInTrash:r,enableNewTrashPageMentionPill:s}=e;return r&&s?(0,i.jsxs)(a,{theme:t,children:[(0,i.jsx)("span",{style:{whiteSpace:"nowrap"},children:(0,o.y)({marginRight:2,height:".8em",width:".8em"})}),n.formatMessage({defaultMessage:"In Trash",id:"trashMentionPill.pageInTrash"})]}):null}},158102:(e,t,n)=>{n.d(t,{ZP:()=>c,nH:()=>s,r4:()=>l});n(667294);var o=n(415095),r=n(643593),i=n(517755),a=n(785893);function s(e){let{avatarBorder:t,avatarSize:n,theme:o}=e;return{border:t?"1px solid currentColor":void 0,borderRadius:"100%",overflow:"hidden",width:n,height:n,maxWidth:"100%",maxHeight:"100%",background:o.popoverBackground,display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",WebkitUserSelect:"none",color:o.regularTextColor}}function l(e){let{avatarSize:t,fontSize:n,theme:o}=e;return{boxSizing:"content-box",border:"1px solid currentColor",borderRadius:"100%",width:t-2,height:t-2,lineHeight:t-2+"px",overflow:"hidden",textAlign:"center",fontSize:n??14,background:o.popoverBackground,userSelect:"none",WebkitUserSelect:"none",color:o.regularTextColor}}const c=function(e){const{avatarBorder:t,avatarSize:n,baseUrl:c,fontSize:d,theme:u,userValue:p}=e,m={...s({avatarBorder:t,avatarSize:n,theme:u}),...e.avatarStyle},g={...l({avatarSize:n,fontSize:d,theme:u}),...e.initialStyle};if(p){const t=p.profile_photo,n=p.name,s=p.email;if(t){const n=r.F8(t)?i.Q4({url:t,width:e.avatarSize,fullyQualified:!0,stripGoogleIconQuery:!0,baseUrl:c,userId:void 0}):t;return(0,a.jsx)("div",{style:m,children:(0,a.jsx)("img",{src:n,style:{display:"block",width:"100%",height:"100%",objectFit:"cover"}})})}if(n||s){let e;return n?e=o.p4(n)[0]:s&&(e=o.p4(s)[0]),e=e?e.toUpperCase():"",(0,a.jsx)("div",{children:(0,a.jsx)("div",{style:g,children:(0,a.jsx)("div",{children:e})})})}return(0,a.jsx)("div",{children:" "})}return(0,a.jsx)("div",{children:" "})}},901274:(e,t,n)=>{n.d(t,{IC:()=>c,bM:()=>u,fz:()=>d,o0:()=>p});n(757658);var o=n(401898),r=n(421202),i=n(177420),a=n(606287),s=n(213493),l=n(475246);function c(e){const{targetTriggerType:t,targetParentPointer:n,targetSpaceId:r}=e;return"notification_event"===t||"event"===t?[{pointer:n,minimumRequiredRole:"editor"},{pointer:{id:r,table:l.bx},minimumRequiredRole:"read_and_write"}]:"recurrence"===t||"button"===t||"chat"===t?[{pointer:n,minimumRequiredRole:"read_and_write"}]:void(0,o.t1)(t)}function d(e){const{automationValue:t,actionValues:n}=e,r=n.flatMap((e=>p(e))).filter(o.$K);return"notification_event"===t.trigger.type||"event"===t.trigger.type?(r.push({pointer:{id:t.parent_id,table:t.parent_table,spaceId:t.space_id},minimumRequiredRole:"editor"},{pointer:{id:t.space_id,table:l.bx},minimumRequiredRole:"read_and_write"}),(0,o.$K)(t.trigger.event.source)&&(t.trigger.event.source.type===s.np||t.trigger.event.source.type===a.vF?r.push({pointer:t.trigger.event.source.pointer,minimumRequiredRole:"reader"}):"filter"===t.trigger.event.source.type||(0,o.t1)(t.trigger.event.source))):"recurrence"===t.trigger.type||"button"===t.trigger.type||"chat"===t.trigger.type?r.push({pointer:{id:t.parent_id,table:t.parent_table,spaceId:t.space_id},minimumRequiredRole:"read_and_write"}):(0,o.t1)(t.trigger),r}function u(e){return"notification_event"===e.trigger.type||"event"===e.trigger.type?[{pointer:{id:e.parent_id,table:e.parent_table,spaceId:e.space_id},minimumRequiredRole:"editor"},{pointer:{id:e.space_id,table:l.bx},minimumRequiredRole:"read_and_write"}]:"recurrence"===e.trigger.type||"button"===e.trigger.type||"chat"===e.trigger.type?[{pointer:{id:e.parent_id,table:e.parent_table,spaceId:e.space_id},minimumRequiredRole:"read_and_write"}]:void(0,o.t1)(e.trigger)}function p(e){if("create_page"===e.type){var t,n;const o=[];var a,s;if(null!==(t=e.config)&&void 0!==t&&t.collection)o.push({pointer:null===(a=e.config)||void 0===a?void 0:a.collection,minimumRequiredRole:"content_only_editor"});if(null!==(n=e.config)&&void 0!==n&&n.template_page_id)o.push({pointer:{id:null===(s=e.config)||void 0===s?void 0:s.template_page_id,table:r.iU,spaceId:e.space_id},minimumRequiredRole:"reader"});return o}var l,c;if("query_collection"===e.type){if(null!==(l=e.config)&&void 0!==l&&l.collection)return[{pointer:null===(c=e.config)||void 0===c?void 0:c.collection,minimumRequiredRole:"content_only_editor"}]}else if("update_pages"===e.type){var d;const t=null===(d=e.config)||void 0===d?void 0:d.target;if(!t)return[];if("collection"===t.type)return[{pointer:t.collection,minimumRequiredRole:"content_only_editor"}];if("page"===t.type)return[{pointer:t.page,minimumRequiredRole:"content_only_editor"}];if("variable"===t.type)return[];(0,o.t1)(t)}else if("open_page"===e.type){var u;const t=null===(u=e.config)||void 0===u?void 0:u.target;if(!t)return[];if("page"===t.type)return[{pointer:t.page,minimumRequiredRole:"reader"}];if("variable"===t.type||"url"===t.type)return[];(0,o.t1)(t)}else if("slack_notification"===e.type){var p;if(null!==(p=e.config)&&void 0!==p&&p.external_bot_id)return[{pointer:{id:e.config.external_bot_id,table:i.cZ},minimumRequiredRole:"reader"}]}else{if("duplicate_blocks"===e.type)return[];if("modal_confirmation"===e.type)return[];if("complete_sprint"===e.type){var m,g;const t=[];return null!==(m=e.config)&&void 0!==m&&m.sprint_collection&&t.push({pointer:e.config.sprint_collection,minimumRequiredRole:"editor"}),null!==(g=e.config)&&void 0!==g&&g.task_collection&&t.push({pointer:e.config.task_collection,minimumRequiredRole:"editor"}),t}if("assistant"===e.type)return[];if("assistant_basic"===e.type)return[];if("send_in_app_notification"===e.type)return[];if("define_variables"===e.type)return[];if("http_request"===e.type)return[];if("send_gmail_notification"===e.type){var f;const t=[];return null!==(f=e.config)&&void 0!==f&&f.external_bot_id&&t.push({pointer:{id:e.config.external_bot_id,table:i.cZ},minimumRequiredRole:"editor"}),t}(0,o.t1)(e)}}},686658:(e,t,n)=>{n.d(t,{Fd:()=>d,G_:()=>c,UE:()=>u,cW:()=>p,fV:()=>i,ze:()=>s});n(667294);var o=n(709291),r=n(785893);const i="v9",a="https://www.notion.so/Cookie-Notice-bc186044eed5488a8387a9e94b14e58c",s=(0,o.defineMessages)({cookieSettingsLabel:{id:"cookieConsent.settings.label",defaultMessage:"Cookie settings"},customizeCookiesHeader:{id:"cookieConsent.customizeCookies.header",defaultMessage:"Customize cookies"},trackingTypeNecessaryTitle:{id:"cookieConsent.trackingTypeNecessary.title",defaultMessage:"Strictly necessary"},trackingTypeNecessaryCaption:{id:"cookieConsent.trackingTypeNecessary.caption",defaultMessage:"Essential for the site to function. Always On."},trackingTypePreferenceTitle:{id:"cookieConsent.trackingTypePreference.title",defaultMessage:"Functional"},trackingTypePreferenceCaption:{id:"cookieConsent.trackingTypePreference.caption",defaultMessage:"Used to remember preference selections and provide enhanced features."},trackingTypePerformanceTitle:{id:"cookieConsent.trackingTypePerformance.title",defaultMessage:"Analytics"},trackingTypePerformanceCaption:{id:"cookieConsent.trackingTypePerformance.caption",defaultMessage:"Used to measure usage and improve your experience."},trackingTypeTargetingTitle:{id:"cookieConsent.trackingTypeTargeting.title",defaultMessage:"Marketing"},trackingTypeTargetingCaption:{id:"cookieConsent.trackingTypeTargeting.caption",defaultMessage:"Used for targeted advertising."},trackingTypeTargetingSubtitleiOS:{id:"cookieConsent.trackingTypeTargeting.subtitleiOS",defaultMessage:"Not collected nor used within the iOS app"},cookieDismissButtonLabel:{id:"cookieConsent.dismissButton.label",defaultMessage:"Done"},acceptAllButtonLabel:{id:"cookieConsent.acceptAllButton.label",defaultMessage:"Accept all"},rejectAllButtonLabel:{id:"cookieConsent.rejectAllButton.label",defaultMessage:"Reject all"},moreOptionsButtonLabel:{id:"cookieConsent.moreOptionsButton.label",defaultMessage:"More options"},reloadAfterSaveMessage:{id:"cookieConsent.reloadAfterSave.message",defaultMessage:"Notion will now reload to apply your cookie preferences. Click okay to continue."}}),l=(0,o.defineMessages)({banner:{id:"cookieConsent.bannerDisclaimer.message",defaultMessage:"Notion uses cookies to offer you a better experience. See<cookielink>Cookie Notice</cookielink>for details."},settings:{id:"cookieConsent.settingsDisclaimer.message",defaultMessage:"Customize cookies. See<cookielink>Cookie Notice</cookielink>for details."},snackbar:{id:"cookieConsent.snackbarDisclaimer.message",defaultMessage:"Notion uses cookies. See<cookielink>Cookie Notice</cookielink>for details."}});function c(e,t){switch(e){case"necessary":return{title:s.trackingTypeNecessaryTitle,caption:s.trackingTypeNecessaryCaption};case"preference":return{title:s.trackingTypePreferenceTitle,caption:s.trackingTypePreferenceCaption};case"performance":return{title:s.trackingTypePerformanceTitle,caption:s.trackingTypePerformanceCaption};case"targeting":const e=t?s.trackingTypeTargetingSubtitleiOS:void 0;return{title:s.trackingTypeTargetingTitle,subtitle:e,caption:s.trackingTypeTargetingCaption}}}function d(e,t){return(0,r.jsx)(o.FormattedMessage,{...l[t],values:{cookielink:t=>(0,r.jsxs)(r.Fragment,{children:[" ",e(a,t)," "]})}})}const u={necessary:!0,performance:!0,preference:!0,targeting:!0},p={necessary:!0,performance:!1,preference:!1,targeting:!1}},780994:(e,t,n)=>{n.d(t,{$i:()=>d,Aw:()=>l,GC:()=>i});const o=[{name:"Afghanistan",countryCode:"AF"},{name:"Åland Islands",countryCode:"AX"},{name:"Albania",countryCode:"AL"},{name:"Algeria",countryCode:"DZ"},{name:"American Samoa",countryCode:"AS"},{name:"Andorra",countryCode:"AD"},{name:"Angola",countryCode:"AO"},{name:"Anguilla",countryCode:"AI"},{name:"Antarctica",countryCode:"AQ"},{name:"Antigua and Barbuda",countryCode:"AG"},{name:"Argentina",countryCode:"AR"},{name:"Armenia",countryCode:"AM"},{name:"Aruba",countryCode:"AW"},{name:"Australia",countryCode:"AU"},{name:"Austria",countryCode:"AT"},{name:"Azerbaijan",countryCode:"AZ"},{name:"Bahamas",countryCode:"BS"},{name:"Bahrain",countryCode:"BH"},{name:"Bangladesh",countryCode:"BD"},{name:"Barbados",countryCode:"BB"},{name:"Belarus",countryCode:"BY"},{name:"Belgium",countryCode:"BE"},{name:"Belize",countryCode:"BZ"},{name:"Benin",countryCode:"BJ"},{name:"Bermuda",countryCode:"BM"},{name:"Bhutan",countryCode:"BT"},{name:"Bolivia (Plurinational State of)",countryCode:"BO"},{name:"Bonaire, Sint Eustatius and Saba",countryCode:"BQ"},{name:"Bosnia and Herzegovina",countryCode:"BA"},{name:"Botswana",countryCode:"BW"},{name:"Bouvet Island",countryCode:"BV"},{name:"Brazil",countryCode:"BR"},{name:"British Indian Ocean Territory",countryCode:"IO"},{name:"Brunei Darussalam",countryCode:"BN"},{name:"Bulgaria",countryCode:"BG"},{name:"Burkina Faso",countryCode:"BF"},{name:"Burundi",countryCode:"BI"},{name:"Cabo Verde",countryCode:"CV"},{name:"Cambodia",countryCode:"KH"},{name:"Cameroon",countryCode:"CM"},{name:"Canada",countryCode:"CA"},{name:"Cayman Islands",countryCode:"KY"},{name:"Central African Republic",countryCode:"CF"},{name:"Chad",countryCode:"TD"},{name:"Chile",countryCode:"CL"},{name:"China",countryCode:"CN"},{name:"Christmas Island",countryCode:"CX"},{name:"Cocos (Keeling) Islands",countryCode:"CC"},{name:"Colombia",countryCode:"CO"},{name:"Comoros",countryCode:"KM"},{name:"Congo",countryCode:"CG"},{name:"Congo, Democratic Republic of the",countryCode:"CD"},{name:"Cook Islands",countryCode:"CK"},{name:"Costa Rica",countryCode:"CR"},{name:"Côte d'Ivoire",countryCode:"CI"},{name:"Croatia",countryCode:"HR"},{name:"Cuba",countryCode:"CU"},{name:"Curaçao",countryCode:"CW"},{name:"Cyprus",countryCode:"CY"},{name:"Czechia",countryCode:"CZ"},{name:"Denmark",countryCode:"DK"},{name:"Djibouti",countryCode:"DJ"},{name:"Dominica",countryCode:"DM"},{name:"Dominican Republic",countryCode:"DO"},{name:"Ecuador",countryCode:"EC"},{name:"Egypt",countryCode:"EG"},{name:"El Salvador",countryCode:"SV"},{name:"Equatorial Guinea",countryCode:"GQ"},{name:"Eritrea",countryCode:"ER"},{name:"Estonia",countryCode:"EE"},{name:"Eswatini",countryCode:"SZ"},{name:"Ethiopia",countryCode:"ET"},{name:"Falkland Islands (Malvinas)",countryCode:"FK"},{name:"Faroe Islands",countryCode:"FO"},{name:"Fiji",countryCode:"FJ"},{name:"Finland",countryCode:"FI"},{name:"France",countryCode:"FR"},{name:"French Guiana",countryCode:"GF"},{name:"French Polynesia",countryCode:"PF"},{name:"French Southern Territories",countryCode:"TF"},{name:"Gabon",countryCode:"GA"},{name:"Gambia",countryCode:"GM"},{name:"Georgia",countryCode:"GE"},{name:"Germany",countryCode:"DE"},{name:"Ghana",countryCode:"GH"},{name:"Gibraltar",countryCode:"GI"},{name:"Greece",countryCode:"GR"},{name:"Greenland",countryCode:"GL"},{name:"Grenada",countryCode:"GD"},{name:"Guadeloupe",countryCode:"GP"},{name:"Guam",countryCode:"GU"},{name:"Guatemala",countryCode:"GT"},{name:"Guernsey",countryCode:"GG"},{name:"Guinea",countryCode:"GN"},{name:"Guinea-Bissau",countryCode:"GW"},{name:"Guyana",countryCode:"GY"},{name:"Haiti",countryCode:"HT"},{name:"Heard Island and McDonald Islands",countryCode:"HM"},{name:"Holy See",countryCode:"VA"},{name:"Honduras",countryCode:"HN"},{name:"Hong Kong",countryCode:"HK"},{name:"Hungary",countryCode:"HU"},{name:"Iceland",countryCode:"IS"},{name:"India",countryCode:"IN"},{name:"Indonesia",countryCode:"ID"},{name:"Iran (Islamic Republic of)",countryCode:"IR"},{name:"Iraq",countryCode:"IQ"},{name:"Ireland",countryCode:"IE"},{name:"Isle of Man",countryCode:"IM"},{name:"Israel",countryCode:"IL"},{name:"Italy",countryCode:"IT"},{name:"Jamaica",countryCode:"JM"},{name:"Japan",countryCode:"JP"},{name:"Jersey",countryCode:"JE"},{name:"Jordan",countryCode:"JO"},{name:"Kazakhstan",countryCode:"KZ"},{name:"Kenya",countryCode:"KE"},{name:"Kiribati",countryCode:"KI"},{name:"Korea, Republic of",countryCode:"KR"},{name:"Kosovo",countryCode:"XK"},{name:"Kuwait",countryCode:"KW"},{name:"Kyrgyzstan",countryCode:"KG"},{name:"Lao People's Democratic Republic",countryCode:"LA"},{name:"Latvia",countryCode:"LV"},{name:"Lebanon",countryCode:"LB"},{name:"Lesotho",countryCode:"LS"},{name:"Liberia",countryCode:"LR"},{name:"Libya",countryCode:"LY"},{name:"Liechtenstein",countryCode:"LI"},{name:"Lithuania",countryCode:"LT"},{name:"Luxembourg",countryCode:"LU"},{name:"Macao",countryCode:"MO"},{name:"Madagascar",countryCode:"MG"},{name:"Malawi",countryCode:"MW"},{name:"Malaysia",countryCode:"MY"},{name:"Maldives",countryCode:"MV"},{name:"Mali",countryCode:"ML"},{name:"Malta",countryCode:"MT"},{name:"Marshall Islands",countryCode:"MH"},{name:"Martinique",countryCode:"MQ"},{name:"Mauritania",countryCode:"MR"},{name:"Mauritius",countryCode:"MU"},{name:"Mayotte",countryCode:"YT"},{name:"Mexico",countryCode:"MX"},{name:"Micronesia (Federated States of)",countryCode:"FM"},{name:"Moldova, Republic of",countryCode:"MD"},{name:"Monaco",countryCode:"MC"},{name:"Mongolia",countryCode:"MN"},{name:"Montenegro",countryCode:"ME"},{name:"Montserrat",countryCode:"MS"},{name:"Morocco",countryCode:"MA"},{name:"Mozambique",countryCode:"MZ"},{name:"Myanmar",countryCode:"MM"},{name:"Namibia",countryCode:"NA"},{name:"Nauru",countryCode:"NR"},{name:"Nepal",countryCode:"NP"},{name:"Netherlands",countryCode:"NL"},{name:"New Caledonia",countryCode:"NC"},{name:"New Zealand",countryCode:"NZ"},{name:"Nicaragua",countryCode:"NI"},{name:"Niger",countryCode:"NE"},{name:"Nigeria",countryCode:"NG"},{name:"Niue",countryCode:"NU"},{name:"Norfolk Island",countryCode:"NF"},{name:"North Korea",countryCode:"KP"},{name:"North Macedonia",countryCode:"MK"},{name:"Northern Mariana Islands",countryCode:"MP"},{name:"Norway",countryCode:"NO"},{name:"Oman",countryCode:"OM"},{name:"Pakistan",countryCode:"PK"},{name:"Palau",countryCode:"PW"},{name:"Palestine, State of",countryCode:"PS"},{name:"Panama",countryCode:"PA"},{name:"Papua New Guinea",countryCode:"PG"},{name:"Paraguay",countryCode:"PY"},{name:"Peru",countryCode:"PE"},{name:"Philippines",countryCode:"PH"},{name:"Pitcairn",countryCode:"PN"},{name:"Poland",countryCode:"PL"},{name:"Portugal",countryCode:"PT"},{name:"Puerto Rico",countryCode:"PR"},{name:"Qatar",countryCode:"QA"},{name:"Réunion",countryCode:"RE"},{name:"Romania",countryCode:"RO"},{name:"Russian Federation",countryCode:"RU"},{name:"Rwanda",countryCode:"RW"},{name:"Saint Barthélemy",countryCode:"BL"},{name:"Saint Helena, Ascension and Tristan da Cunha",countryCode:"SH"},{name:"Saint Kitts and Nevis",countryCode:"KN"},{name:"Saint Lucia",countryCode:"LC"},{name:"Saint Martin (French part)",countryCode:"MF"},{name:"Saint Pierre and Miquelon",countryCode:"PM"},{name:"Saint Vincent and the Grenadines",countryCode:"VC"},{name:"Samoa",countryCode:"WS"},{name:"San Marino",countryCode:"SM"},{name:"Sao Tome and Principe",countryCode:"ST"},{name:"Saudi Arabia",countryCode:"SA"},{name:"Senegal",countryCode:"SN"},{name:"Serbia",countryCode:"RS"},{name:"Seychelles",countryCode:"SC"},{name:"Sierra Leone",countryCode:"SL"},{name:"Singapore",countryCode:"SG"},{name:"Sint Maarten (Dutch part)",countryCode:"SX"},{name:"Slovakia",countryCode:"SK"},{name:"Slovenia",countryCode:"SI"},{name:"Solomon Islands",countryCode:"SB"},{name:"Somalia",countryCode:"SO"},{name:"South Africa",countryCode:"ZA"},{name:"South Georgia and the South Sandwich Islands",countryCode:"GS"},{name:"South Sudan",countryCode:"SS"},{name:"Spain",countryCode:"ES"},{name:"Sri Lanka",countryCode:"LK"},{name:"Sudan",countryCode:"SD"},{name:"Suriname",countryCode:"SR"},{name:"Svalbard and Jan Mayen",countryCode:"SJ"},{name:"Sweden",countryCode:"SE"},{name:"Switzerland",countryCode:"CH"},{name:"Syrian Arab Republic",countryCode:"SY"},{name:"Taiwan",countryCode:"TW"},{name:"Tajikistan",countryCode:"TJ"},{name:"Tanzania, United Republic of",countryCode:"TZ"},{name:"Thailand",countryCode:"TH"},{name:"Timor-Leste",countryCode:"TL"},{name:"Togo",countryCode:"TG"},{name:"Tokelau",countryCode:"TK"},{name:"Tonga",countryCode:"TO"},{name:"Trinidad and Tobago",countryCode:"TT"},{name:"Tunisia",countryCode:"TN"},{name:"Turkey",countryCode:"TR"},{name:"Turkmenistan",countryCode:"TM"},{name:"Turks and Caicos Islands",countryCode:"TC"},{name:"Tuvalu",countryCode:"TV"},{name:"Uganda",countryCode:"UG"},{name:"Ukraine",countryCode:"UA"},{name:"United Arab Emirates",countryCode:"AE"},{name:"United Kingdom",countryCode:"GB"},{name:"United States",countryCode:"US"},{name:"United States Minor Outlying Islands",countryCode:"UM"},{name:"Uruguay",countryCode:"UY"},{name:"Uzbekistan",countryCode:"UZ"},{name:"Vanuatu",countryCode:"VU"},{name:"Venezuela (Bolivarian Republic of)",countryCode:"VE"},{name:"Viet Nam",countryCode:"VN"},{name:"Virgin Islands (British)",countryCode:"VG"},{name:"Virgin Islands (U.S.)",countryCode:"VI"},{name:"Wallis and Futuna",countryCode:"WF"},{name:"Western Sahara",countryCode:"EH"},{name:"Yemen",countryCode:"YE"},{name:"Zambia",countryCode:"ZM"},{name:"Zimbabwe",countryCode:"ZW"}],r=new Set(o.map((e=>{let{countryCode:t}=e;return t})));function i(e){return void 0!==e&&r.has(e)}const a={Afghanistan:"AF",AlandIslands:"AX",Albania:"AL",Algeria:"DZ",AmericanSamoa:"AS",Andorra:"AD",Angola:"AO",Anguilla:"AI",Antarctica:"AQ",AntiguaAndBarbuda:"AG",Argentina:"AR",Armenia:"AM",Aruba:"AW",Australia:"AU",Austria:"AT",Azerbaijan:"AZ",Bahamas:"BS",Bahrain:"BH",Bangladesh:"BD",Barbados:"BB",Belarus:"BY",Belgium:"BE",Belize:"BZ",Benin:"BJ",Bermuda:"BM",Bhutan:"BT",Bolivia:"BO",BosniaAndHerzegovina:"BA",Botswana:"BW",BouvetIsland:"BV",Brazil:"BR",BritishIndianOceanTerritory:"IO",BritishVirginIslands:"VG",Brunei:"BN",Bulgaria:"BG",BurkinaFaso:"BF",Burundi:"BI",Cambodia:"KH",Cameroon:"CM",Canada:"CA",CapeVerde:"CV",CaribbeanNetherlands:"BQ",CaymanIslands:"KY",CentralAfricanRepublic:"CF",Chad:"TD",Chile:"CL",China:"CN",ChristmasIsland:"CX",CocosIslands:"CC",Colombia:"CO",Comoros:"KM",CongoBrazzaville:"CG",CongoKinshasa:"CD",CookIslands:"CK",CostaRica:"CR",CotedIvoire:"CI",Croatia:"HR",Cuba:"CU",Curacao:"CW",Cyprus:"CY",Czechia:"CZ",Denmark:"DK",Djibouti:"DJ",Dominica:"DM",DominicanRepublic:"DO",Ecuador:"EC",Egypt:"EG",ElSalvador:"SV",EquatorialGuinea:"GQ",Eritrea:"ER",Estonia:"EE",Eswatini:"SZ",Ethiopia:"ET",FalklandIslands:"FK",FaroeIslands:"FO",Fiji:"FJ",Finland:"FI",France:"FR",FrenchGuiana:"GF",FrenchPolynesia:"PF",FrenchSouthernTerritories:"TF",Gabon:"GA",Gambia:"GM",Georgia:"GE",Germany:"DE",Ghana:"GH",Gibraltar:"GI",Greece:"GR",Greenland:"GL",Grenada:"GD",Guadeloupe:"GP",Guam:"GU",Guatemala:"GT",Guernsey:"GG",Guinea:"GN",GuineaBissau:"GW",Guyana:"GY",Haiti:"HT",HeardAndMcDonaldIslands:"HM",Honduras:"HN",HongKong:"HK",Hungary:"HU",Iceland:"IS",India:"IN",Indonesia:"ID",Iran:"IR",Iraq:"IQ",Ireland:"IE",IsleofMan:"IM",Israel:"IL",Italy:"IT",Jamaica:"JM",Japan:"JP",Jersey:"JE",Jordan:"JO",Kazakhstan:"KZ",Kenya:"KE",Kiribati:"KI",Kosovo:"XK",Kuwait:"KW",Kyrgyzstan:"KG",Laos:"LA",Latvia:"LV",Lebanon:"LB",Lesotho:"LS",Liberia:"LR",Libya:"LY",Liechtenstein:"LI",Lithuania:"LT",Luxembourg:"LU",Macao:"MO",Madagascar:"MG",Malawi:"MW",Malaysia:"MY",Maldives:"MV",Mali:"ML",Malta:"MT",MarshallIslands:"MH",Martinique:"MQ",Mauritania:"MR",Mauritius:"MU",Mayotte:"YT",Mexico:"MX",Micronesia:"FM",Moldova:"MD",Monaco:"MC",Mongolia:"MN",Montenegro:"ME",Montserrat:"MS",Morocco:"MA",Mozambique:"MZ",Myanmar:"MM",Namibia:"NA",Nauru:"NR",Nepal:"NP",Netherlands:"NL",NewCaledonia:"NC",NewZealand:"NZ",Nicaragua:"NI",Niger:"NE",Nigeria:"NG",Niue:"NU",NorfolkIsland:"NF",NorthernMarianaIslands:"MP",NorthKorea:"KP",NorthMacedonia:"MK",Norway:"NO",Oman:"OM",Pakistan:"PK",Palau:"PW",Palestine:"PS",Panama:"PA",PapuaNewGuinea:"PG",Paraguay:"PY",Peru:"PE",Philippines:"PH",PitcairnIslands:"PN",Poland:"PL",Portugal:"PT",PuertoRico:"PR",Qatar:"QA",Reunion:"RE",Romania:"RO",Russia:"RU",Rwanda:"RW",Samoa:"WS",SanMarino:"SM",SaoTomeAndPrincipe:"ST",SaudiArabia:"SA",Senegal:"SN",Serbia:"RS",Seychelles:"SC",SierraLeone:"SL",Singapore:"SG",SintMaarten:"SX",Slovakia:"SK",Slovenia:"SI",SolomonIslands:"SB",Somalia:"SO",SouthAfrica:"ZA",SouthGeorgiaAndSouthSandwichIslands:"GS",SouthKorea:"KR",SouthSudan:"SS",Spain:"ES",SriLanka:"LK",StBarthelemy:"BL",StHelena:"SH",StKittsAndNevis:"KN",StLucia:"LC",StMartin:"MF",StPierreAndMiquelon:"PM",StVincentAndGrenadines:"VC",Sudan:"SD",Suriname:"SR",SvalbardAndJanMayen:"SJ",Sweden:"SE",Switzerland:"CH",Syria:"SY",Taiwan:"TW",Tajikistan:"TJ",Tanzania:"TZ",Thailand:"TH",TimorLeste:"TL",Togo:"TG",Tokelau:"TK",Tonga:"TO",TrinidadAndTobago:"TT",Tunisia:"TN",Turkiye:"TR",Turkmenistan:"TM",TurksAndCaicosIslands:"TC",Tuvalu:"TV",Uganda:"UG",Ukraine:"UA",UnitedArabEmirates:"AE",UnitedKingdom:"GB",UnitedStates:"US",Uruguay:"UY",USOutlyingIslands:"UM",USVirginIslands:"VI",Uzbekistan:"UZ",Vanuatu:"VU",VaticanCity:"VA",Venezuela:"VE",Vietnam:"VN",WallisAndFutuna:"WF",WesternSahara:"EH",Yemen:"YE",Zambia:"ZM",Zimbabwe:"ZW"},s=Object.fromEntries(o.map((e=>[e.countryCode,e])));new Set([a.Austria,a.Belgium,a.Bulgaria,a.Croatia,a.Cyprus,a.Czechia,a.Denmark,a.Estonia,a.Finland,a.France,a.Germany,a.Greece,a.Hungary,a.Ireland,a.Italy,a.Latvia,a.Lithuania,a.Luxembourg,a.Malta,a.Netherlands,a.Poland,a.Portugal,a.Romania,a.Slovakia,a.Slovenia,a.Spain,a.Sweden]);function l(e){if(!i(e))return{opt:"in",defaultOptIn:!1};switch(e){case a.UnitedKingdom:case a.Belgium:case a.Bulgaria:case a.Croatia:case a.Czechia:case a.Denmark:case a.Estonia:case a.Finland:case a.France:case a.Greece:case a.Ireland:case a.Latvia:case a.Lithuania:case a.Luxembourg:case a.Malta:case a.Netherlands:case a.Norway:case a.Portugal:case a.Romania:case a.Sweden:case a.Spain:case a.Slovenia:case a.Iceland:case a.Kosovo:case a.Turkiye:return{opt:"out",defaultOptIn:!0};case a.Cyprus:case a.Hungary:case a.Italy:case a.Poland:case a.Switzerland:case a.Serbia:case a.BosniaAndHerzegovina:case a.Montenegro:case a.Albania:case a.Moldova:case a.NorthMacedonia:case a.Slovakia:return{opt:"in",defaultOptIn:!1};case a.Germany:case a.Austria:return{opt:"doubleIn",defaultOptIn:!1};default:return{opt:"in",defaultOptIn:!0}}}function c(e,t){return e.formatDisplayName(t,{type:"region"})??function(e){return s[e].name}(t)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{locale:n=e.locale,collator:o=new Intl.Collator(n,{sensitivity:"base"})}=t;return Array.from(r).map((t=>({countryCode:t,name:c(e,t)}))).sort(((t,n)=>o.compare(c(e,t.countryCode),c(e,n.countryCode))))}},457081:(e,t,n)=>{n.d(t,{X:()=>m,Z:()=>u});var o=n(467266),r=n.n(o),i=n(653965),a=n(401898),s=n(840376),l=n(421838),c=n(459579),d=n(250680);class u{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.ops=e,function(e){for(let t=1;t<e.length;t++)(0,d.T)((0,c.$c)(e[t-1].id,e[t].id)<0)}(e)}add(e){(0,d.T)(!i.Xy(e.start,e.end),"Annotation start and end positions should not be the same"),"addAnnotation"===e.type&&(l.ZAl(e.annotation)||l.kuv(e.annotation))&&(0,d.T)(i.Xy(e.start.id,e.end.id)&&"before"===e.start.anchor&&"after"===e.end.anchor,"Mention/equation annotation should only be applied to one character");const t=this.findInsertionIndex(e.id);this.ops.splice(t,0,e)}findInsertionIndex(e){const t=this.ops.findIndex((t=>(0,c.$c)(t.id,e)>0));return t>=0?t:this.ops.length}getOps(){return this.ops}getActiveAnnotationsInternal(){const e=new s.u;for(const t of this.ops){const n=t.type;"addAnnotation"===n?e.add(t.annotation):"removeAnnotation"===n?"string"==typeof t.annotationKey?e.removeGroupingKey(t.annotationKey):e.remove(t.annotationKey):(0,a.t1)(n)}return e}getActiveAnnotations(){const e=new Map;for(const t of this.getActiveAnnotationsInternal())e.set(m(t),t);return e}getResolvedAnnotations(){return this.getActiveAnnotationsInternal().toArray()}containsOpId(e){for(const t of this.ops)if(i.Xy(t.id,e.id))return"annotationOp"===e.type&&i.Xy(t,e.annotationOp)?"exists_same":"exists_different";return!1}clone(){return new u([...this.ops])}equals(e){return i.Xy(this.ops,e.ops)}static equals(e,t){return e===t||(void 0===e||void 0===t?e===t:e.equals(t))}toString(){const e=this.ops.map((e=>{switch(e.type){case"addAnnotation":return`+${p(e.annotation)}`;case"removeAnnotation":return`-${p(e.annotationKey)}`}}));return`[AnnotationOpSet ${e.length?e.join(", "):"empty"}]`}}function p(e){const t="string"==typeof e?e:l.c14(e);return"string"==typeof t?t:`(${t.join(",")})`}function m(e){const t=l.c14(e);return"string"==typeof t?t:r()(t)}},443993:(e,t,n)=>{n.d(t,{JE:()=>p,Jy:()=>c,KH:()=>u,vM:()=>d});var o=n(653965),r=n(401898),i=n(421838),a=n(457081),s=n(250680);class l{constructor(e){this.prev=void 0,this.next=void 0,this.annotationOpSetBefore=void 0,this.annotationOpSetAfter=void 0,this.id=e}startsWithId(e){return this.containsId(e)}endsWithId(e){return this.containsId(e)}containsId(e){return o.Xy(this.id,e)}getAnnotationOpSetForAnchor(e){return"before"===e?this.annotationOpSetBefore:"after"===e?this.annotationOpSetAfter:void(0,r.t1)(e)}maybeCreateAnnotationOpSetForAnchor(e,t){var n;if("before"===e)this.annotationOpSetBefore??=(null==t||null===(n=t.opSet)||void 0===n?void 0:n.clone())??new a.Z;else if("after"===e){var o;this.annotationOpSetAfter??=(null==t||null===(o=t.opSet)||void 0===o?void 0:o.clone())??new a.Z}else(0,r.t1)(e)}copyAnnotationOpSetTo(e){this.annotationOpSetBefore&&(e.annotationOpSetBefore=this.annotationOpSetBefore.clone()),this.annotationOpSetAfter&&(e.annotationOpSetAfter=this.annotationOpSetAfter.clone())}equals(e){return typeof this==typeof e&&a.Z.equals(this.annotationOpSetBefore,e.annotationOpSetBefore)&&a.Z.equals(this.annotationOpSetAfter,e.annotationOpSetAfter)}toString(){return`[${this.className}]`}}class c extends l{constructor(e,t,n,o){super(e),this.className="TextItem",this.deleted=!1,this.prev=void 0,this.next=void 0,this.id=e,this.originId=t,this.content=n,this.length=o,this.verifyValueAndLength()}verifyValueAndLength(){(0,s.T)(!this.content||this.content.length===this.length,"TextItem content length must match item length"),(0,s.T)(this.length>0,"TextItem must have nonzero length"),(0,s.T)(!this.content||!(0,i.pIV)(this.content),"TextItem must not contain disallowed characters")}getStartId(){return this.id}getEndId(){const e=this.id;return[e[0],e[1]+this.length-1]}startsWithId(e){return o.Xy(this.getStartId(),e)}endsWithId(e){return o.Xy(this.getEndId(),e)}containsId(e){return"start"!==e&&"end"!==e&&this.id[0]===e[0]&&this.id[1]<=e[1]&&e[1]<=this.id[1]+this.length-1}getDefinedContent(){return(0,s.TO)(this.content)}isDeleted(){return this.deleted}setDeleted(){this.deleted=!0,this.content=void 0}splitBeforeId(e){return this.split(e,"before")}splitAfterId(e){return this.split(e,"after")}split(e,t){var n;(0,s.T)(this.length>1),(0,s.T)(this.containsId(e));const o=e[1]-this.id[1]+("after"===t?1:0);(0,s.T)(0<o&&o<this.length);const r=[this.id[0],this.id[1]+o],i=[this.id[0],this.id[1]+o-1],a=this.deleted?c.createDeleted(r,i,this.length-o):c.create(r,i,this.getDefinedContent().slice(o));this.annotationOpSetAfter&&(a.annotationOpSetAfter=this.annotationOpSetAfter.clone());const l=this.next;return this.next=a,a.prev=this,l&&(a.next=l,l.prev=a),this.content=null===(n=this.content)||void 0===n?void 0:n.slice(0,o),this.length=o,this.verifyValueAndLength(),this.annotationOpSetAfter=void 0,this.next=a,a}maybeMergeWithNext(){const e=this.next;if(!(e instanceof c))return!1;const t=this.getEndId(),n=e.getStartId();return!(!o.Xy(t,e.originId)||t[0]!==n[0]||t[1]!==n[1]-1||this.deleted!==e.deleted||void 0!==this.annotationOpSetAfter||void 0!==e.annotationOpSetBefore)&&(this.content&&e.content&&(this.content+=e.content),this.length+=e.length,this.verifyValueAndLength(),e.annotationOpSetAfter&&(this.annotationOpSetAfter=e.annotationOpSetAfter.clone()),this.next=e.next,e.next&&(e.next.prev=this),e.prev=void 0,e.next=void 0,!0)}getLength(){return this.length}clone(){const e=this.deleted?c.createDeleted(this.id,this.originId,this.length):c.create(this.id,this.originId,this.getDefinedContent());return this.copyAnnotationOpSetTo(e),e}equals(e){return super.equals(e)&&e instanceof c&&o.Xy(this.id,e.id)&&o.Xy(this.originId,e.originId)&&this.deleted===e.deleted&&this.content===e.content&&this.length===e.length}static create(e,t,n){return new c(e,t,n,n.length)}static createDeleted(e,t,n){const o=new c(e,t,void 0,n);return o.setDeleted(),o}toString(){return this.deleted?`[${this.className} (deleted)]`:`[${this.className} ${this.content}]`}}class d extends l{constructor(){super("start"),this.className="StartItem",this.prev=void 0,this.next=void 0,this.id="start"}clone(){const e=new d;return this.copyAnnotationOpSetTo(e),e}equals(e){return super.equals(e)&&e instanceof d}}class u extends l{constructor(){super("end"),this.className="EndItem",this.prev=void 0,this.next=void 0,this.id="end",this.originId="start"}clone(){const e=new u;return this.copyAnnotationOpSetTo(e),e}equals(e){return super.equals(e)&&e instanceof u}}class p extends l{constructor(e,t){super(e),this.className="SplitItem",this.prev=void 0,this.next=void 0,this.id=e,this.originId=t}clone(){const e=new p(this.id,this.originId);return this.copyAnnotationOpSetTo(e),e}equals(e){return super.equals(e)&&e instanceof p&&o.Xy(this.id,e.id)&&o.Xy(this.originId,e.originId)}}},719056:(e,t,n)=>{n.d(t,{Z:()=>i,h:()=>r});var o=n(250680);class r{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.value=e}get(){return this.value}set(e){this.value=e}}class i{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.valueHolder=void 0,this.valueHolder="number"==typeof e?new r(e):e,(0,o.T)(this.valueHolder.get()>=0)}reserveTicks(e){(0,o.T)(e>0);const t=this.valueHolder.get(),n=t+1;return this.valueHolder.set(t+e),n}maybeUpdateClock(e){return e>this.valueHolder.get()&&(this.valueHolder.set(e),!0)}getValue(){return this.valueHolder.get()}}},769920:(e,t,n)=>{n.d(t,{ZP:()=>S,rd:()=>_,GU:()=>h});n(252262),n(324506),n(757658);var o=n(467266),r=n.n(o),i=n(653965),a=n(401898),s=n(159730),l=n(471924),c=n(421838),d=n(459579),u=n(443993),p=n(852136),m=n(719056);function g(e){switch(e.type){case"insertText":return e.id[1]+e.content.length-1;case"splitText":case"addAnnotation":case"removeAnnotation":return e.id[1]}}var f=n(250680);const h=(0,a.AO)((e=>e instanceof u.vM||e instanceof u.JE?{true:e}:{false:e})),v=(0,a.AO)((e=>e instanceof u.KH||e instanceof u.JE?{true:e}:{false:e})),y=(0,a.AO)((e=>e instanceof u.Jy?{true:e}:{false:e}));function b(e){return"EndItem"!==e.className}const _=(0,a.AO)((e=>"end"===e?{false:e}:{true:e}));class S{constructor(e,t,n){this.textInstanceId=void 0,this.opClock=void 0,this.startItem=void 0,this.endItem=void 0,this.visibleCount=void 0,this.textInstanceId=e,this.opClock=t,this.startItem=n,this.endItem=(0,f.Fb)(p.s(n),v),this.visibleCount=p.TS(n),(0,f.T)(this.startItem!==this.endItem)}getStartItem(){return this.startItem}getEndItem(){return this.endItem}getVisibleCount(){return this.visibleCount}applyOperation(e){switch(e.type){case"insertText":this.applyInsertTextOperation(e);break;case"deleteText":this.applyDeleteTextOperation(e);break;case"splitText":this.applySplitTextOperation(e);break;case"addAnnotation":case"removeAnnotation":this.applyAnnotationOperation(e);break;default:(0,a.t1)(e)}}applyInsertTextOperation(e){const t=u.Jy.create(e.id,e.originId,e.content);this.integrateItem(t),this.opClock.maybeUpdateClock(g(e)),this.validateContent()}applyDeleteTextOperation(e){for(const t of e.idRanges)for(const e of this.getTextItemsInIdRange(t))e.isDeleted()||(e.setDeleted(),this.visibleCount-=e.getLength(),e.prev instanceof u.Jy&&e.prev.maybeMergeWithNext(),e.maybeMergeWithNext());this.validateContent()}applySplitTextOperation(e){const t=new u.JE(e.id,e.originId);this.integrateItem(t),this.opClock.maybeUpdateClock(g(e))}integrateItem(e){this.verifyDoesNotContainOpId({type:e instanceof u.Jy?"text":"split",id:e.id,originId:e.originId}),(0,f.T)(1===(0,d.Dx)(e.id,e.originId),`new item id [${e.id}] must be strictly greater than its origin id [${e.originId}]`);const t=(0,f.Fb)((0,f.TO)(this.getItemEndingWithId(e.originId)),b);let n=t;for(;n.next&&!((0,d.Dx)(e.id,n.next.id)>0);)n=(0,f.Fb)(n.next,b);const o=n.next;if(n.next=e,e.prev=n,o&&(e.next=o,o.prev=e),e instanceof u.Jy&&(this.visibleCount+=e.getLength()),e instanceof u.JE){this.validateNotEndingWithHighSurrogate(t,"Cannot split content between a surrogate pair");const n=this.getPreceedingAnnotationOpSet({id:e.id,anchor:"before"});n&&e.maybeCreateAnnotationOpSetForAnchor("before",{opSet:n})}n instanceof u.Jy&&n.maybeMergeWithNext()}validateContent(){(0,f.T)(!c.PM3(this.getText()),"Content must not contain unpaired surrogates")}validateNotEndingWithHighSurrogate(e,t){if(!(e instanceof u.Jy)||e.isDeleted())return;const n=e.getDefinedContent().at(-1);n&&(0,f.T)("high"!==c.kG3(n),t)}applyAnnotationOperation(e){this.verifyDoesNotContainOpId({type:"annotationOp",id:e.id,annotationOp:e});const t=(0,f.TO)("before"===e.start.anchor?this.getItemStartingWithId(e.start.id):this.getItemEndingWithId(e.start.id)),n=(0,f.TO)("before"===e.end.anchor?this.getItemStartingWithId(e.end.id,{includeEndItem:!0}):this.getItemEndingWithId(e.end.id,{includeEndItem:!0}));let o=this.getPreceedingAnnotationOpSet(e.start);t.maybeCreateAnnotationOpSetForAnchor(e.start.anchor,{opSet:o});const r=this.iterateItemAnnotationOpSets({direction:"forward",from:e.start,to:e.end,includeSplitCharacters:!0});for(const{item:i,anchor:a}of r){i instanceof u.JE&&i.maybeCreateAnnotationOpSetForAnchor(a,{opSet:o});const t=(0,f.TO)(i.getAnnotationOpSetForAnchor(a));o=t.clone(),t.add(e)}n.maybeCreateAnnotationOpSetForAnchor(e.end.anchor,{opSet:o}),this.opClock.maybeUpdateClock(g(e))}getPreceedingAnnotationOpSet(e){const t=this.iterateItemAnnotationOpSets({direction:"backward",from:e});for(const{annotationOpSet:n}of t)return(0,f.TO)(n)}getActiveAnnotationsAfterId(e){const t=(0,f.TO)(this.getItemContainingId(e)),n=t.endsWithId(e)?{anchor:"after",id:e}:{anchor:"before",id:t instanceof u.Jy?t.getStartId():t.id},o=this.getPreceedingAnnotationOpSet(n);return o?o.getActiveAnnotations():new Map}*iterateItems(e){yield*p.Hi(this.startItem,e)}*iterateItemAnnotationOpSets(e){const{direction:t,from:n,includeSplitCharacters:o,to:r}=e;let i=(0,f.TO)(this.getItemContainingId(n.id));(0,f.T)("before"===n.anchor?i.startsWithId(n.id):i.endsWithId(n.id));let s=n.anchor;for(;i;){if(r&&i.containsId(r.id)&&s===r.anchor)return void(0,f.T)("before"===r.anchor?i.startsWithId(r.id):i.endsWithId(r.id));const e=i.getAnnotationOpSetForAnchor(s);switch(e?yield{item:i,anchor:s,annotationOpSet:e}:o&&i instanceof u.JE&&("forward"===t&&"before"===s||"backward"===t&&"after"===s)&&(yield{item:i,anchor:s,annotationOpSet:void 0}),t){case"forward":i="before"===s?i:i.next,s="before"===s?"after":"before";break;case"backward":i="after"===s?i:i.prev,s="after"===s?"before":"after";break;default:(0,a.t1)(t)}}}getItemStartingWithId(e,t){return this.getItem(e,{...t,shouldStartWithId:!0})}getItemEndingWithId(e,t){return this.getItem(e,{...t,shouldEndWithId:!0})}getItemWithOnlyId(e){return this.getItem(e,{shouldStartWithId:!0,shouldEndWithId:!0})}getItemContainingId(e,t){return this.getItem(e,t)}containsItemWithId(e,t){return Boolean(this.getItemContainingId(e,t))}getItem(e,t){const n=this.iterateItems({includeDeleted:!0,includeEndItem:null==t?void 0:t.includeEndItem});for(const o of n){if(o instanceof u.Jy&&o.containsId(e)){if("start"===e||"end"===e)continue;let n=o;return null!=t&&t.shouldStartWithId&&!n.startsWithId(e)&&(n=n.splitBeforeId(e)),null!=t&&t.shouldEndWithId&&!n.endsWithId(e)&&n.splitAfterId(e),n}if(o.containsId(e))return o}}getTextItemsInIdRange(e){const[t,n]=e,[o,r]=t,a=[o,r+n-1],s=[],l=this.iterateItems({includeDeleted:!0});for(const i of l)!(i instanceof u.Jy)||i.getStartId()[0]!==o||(0,d.e0)(a,i.getStartId())<0||(0,d.e0)(i.getEndId(),t)<0||s.push(i);(0,f.T)(s.length>0,"expected items to be nonempty"),i.MR(s,(e=>e.getStartId()[1]));for(let i=1;i<s.length;i++)(0,f.T)(s[i].getStartId()[1]=s[i-1].getEndId()[1]+1,"expected sorted items to have consecutive IDs");const c=s[0];if((0,f.T)(c.containsId(t),"expected the first item to contain the first id in the range"),(0,d.e0)(c.getStartId(),t)<0){const e=c.splitBeforeId(t);s[0]=e}const p=(0,f.TO)(s.at(-1),"expected items to be nonempty");return(0,f.T)(p.containsId(a),"expected the last item to contain the last id in the range"),(0,d.e0)(a,p.getEndId())<0&&p.splitAfterId(a),s}getIndexOfTextItem(e){let t=0;for(const n of this.iterateItems({includeDeleted:!0}))if(n instanceof u.Jy){if(n.containsId(e)){if(n.isDeleted())return{type:"deleted",nextVisibleIndex:t};return{type:"visible",index:t+(e[1]-n.id[1])}}n.isDeleted()||(t+=n.getLength())}}getItemIdsInRange(e,t){(0,f.T)(e<=t),(0,f.T)(0<=e&&t<this.visibleCount);const n=[];let o=0,r=-1;for(const i of this.iterateItems({includeDeleted:!1})){if(!(i instanceof u.Jy))continue;const a=r+1,s=a+i.getLength()-1;if(s<e){r=s;continue}if(t<a)break;const l=Math.max(0,e-a),c=Math.min(s-a,t-a),[d,p]=i.id,m=[d,p+l],g=c-l+1;n.push([m,g]),o+=g,r=s}return(0,f.T)(o===t-e+1),n}getItemIdAtIndex(e){return this.getItemIdsInRange(e,e)[0][0]}getItemIdBeforeIndex(e){const t=this.getItemIdAtIndex(e),n=(0,f.Fb)((0,f.TO)(this.getItemContainingId(t)),y);if(!n.startsWithId(t))return[t[0],t[1]-1];const o=(0,f.TO)(n.prev);return o instanceof u.Jy?o.getEndId():o.id}getItemIdAfterIndex(e){const t=this.getItemIdAtIndex(e);return this.getItemIdAfterItem(t)}getItemIdAfterItem(e){if("start"===e){(0,f.R9)(this.getStartItem(),u.vM);return(0,f.TO)(this.getStartItem().next).id}const t=(0,f.TO)(this.getItemContainingId(e));if(!t.endsWithId(e))return[e[0],e[1]+1];const n=(0,f.TO)(t.next);return n instanceof u.Jy?n.getStartId():n.id}getOriginItemIdForInsertionIndex(e){let t;if((0,f.T)(0<=e&&e<=this.visibleCount),e===this.visibleCount)t=this.getEndItem();else{const n=this.getItemIdAtIndex(e),o=(0,f.Fb)((0,f.TO)(this.getItemContainingId(n)),y);if(!o.startsWithId(n))return[n[0],n[1]-1];t=o}for(;t.prev;){const e=t.prev;if(e instanceof u.Jy&&!e.isDeleted())return e.getEndId();if(e instanceof u.KH)throw new s.B8("Previous item should not be an EndItem");if(e.getAnnotationOpSetForAnchor("after"))return e instanceof u.Jy?e.getEndId():(0,f.Fb)(e.id,_);t=t.prev}return(0,f.Fb)((0,f.Fb)(t,h).id,_)}isLastOriginItemId(e){return i.Xy(this.getOriginItemIdForInsertionIndex(this.visibleCount),e)}verifyDoesNotContainOpId(e){const t=this.containsOpId(e);if(t)switch(t){case"exists_likely_same":throw new s.$C("Text slice already contains ID",{data:{id:e.id}});case"exists_same":throw new s.dO("Text slice already contains ID",{data:{id:e.id}});case"exists_different":throw new s.WE("Text slice already contains ID",{data:{id:e.id}});default:(0,a.t1)(t)}}containsOpId(e){for(const o of this.iterateItems({includeDeleted:!0,includeEndItem:!0})){var t,n;if(o.containsId(e.id))return o instanceof u.Jy&&"text"===e.type&&(o.startsWithId(e.id)&&i.Xy(o.originId,e.originId)||!o.startsWithId(e.id)&&i.Xy(e.originId,[e.id[0],e.id[1]-1]))?"exists_likely_same":o instanceof u.JE&&"split"===e.type&&i.Xy(o.originId,e.originId)?"exists_same":"exists_different";const r=null===(t=o.getAnnotationOpSetForAnchor("before"))||void 0===t?void 0:t.containsOpId(e);if(r)return r;const a=null===(n=o.getAnnotationOpSetForAnchor("after"))||void 0===n?void 0:n.containsOpId(e);if(a)return a}return!1}getTextValue(){const e=[];let t;for(const r of this.iterateItems({includeDeleted:!0})){var n,o;t=(null===(n=r.getAnnotationOpSetForAnchor("before"))||void 0===n?void 0:n.getResolvedAnnotations())??t,r instanceof u.Jy&&r.getLength()&&!r.isDeleted()&&(t?(t.length?e.push([r.getDefinedContent(),t]):e.push([r.getDefinedContent()]),t=void 0):e.length?(0,f.TO)(e.at(-1))[0]+=r.getDefinedContent():e.push([r.getDefinedContent()])),t=(null===(o=r.getAnnotationOpSetForAnchor("after"))||void 0===o?void 0:o.getResolvedAnnotations())??t}return e}getText(){const e=[];for(const t of this.iterateItems())t instanceof u.Jy&&e.push(t.getDefinedContent());return e.join("")}getSliceStartKey(){return`${this.textInstanceId},${r()(this.startItem.id)}`}getSliceKey(){return`${this.textInstanceId},${r()(this.startItem.id)},${r()(this.endItem.id)}`}static combineSlices(e){(0,f.T)(e.length>0);const{textInstanceId:t,opClock:n}=(0,f.TO)(e[0]),o=n.getValue(),i=new Map;for(const c of e){(0,f.T)(c.textInstanceId===t),(0,f.T)(c.opClock.getValue()===o);const e=r()(c.getStartItem().id);(0,f.T)(!i.has(e)),i.set(e,c)}const a=(0,f.TO)(i.get(r()("start")));i.delete(r()("start"));const s=a.startItem;let l=a.endItem;for(;"end"!==l.id;){const e=r()(l.id),t=(0,f.TO)(i.get(e));i.delete(e);const n=(0,f.TO)(t.startItem.next);l.next=n,n.prev=l,l=t.endItem}return(0,f.T)(0===i.size),new S(t,n,s)}splitIntoSlices(){const e=p.Eg(this.startItem);this.endItem=(0,f.Fb)(p.s(this.startItem),v),this.visibleCount=p.TS(this.startItem),(0,f.T)(this.startItem!==this.endItem);const t=[this];for(let n=1;n<e.length;n++)t.push(new S(this.textInstanceId,this.opClock,(0,f.Fb)(e[n],h)));return t}equals(e){if(this===e)return!0;if(this.textInstanceId!==e.textInstanceId)return!1;const t=[...this.iterateItems({includeDeleted:!0,includeEndItem:!0})],n=[...e.iterateItems({includeDeleted:!0,includeEndItem:!0})];if(t.length!==n.length)return!1;for(let o=0;o<t.length;o++){const e=n[o];if(!t[o].equals(e))return!1}return!0}static createEmpty(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.Il(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new m.Z;const n=new u.vM,o=new u.KH;return n.next=o,o.prev=n,new S(e,t,n)}}},346227:(e,t,n)=>{n.d(t,{ZP:()=>y,_5:()=>h,ek:()=>v});n(757658),n(252262),n(324506),n(21703),n(430541);var o=n(992242),r=n(653965),i=n(401898),a=n(415095),s=n(471924),l=n(421838),c=n(457081),d=n(459579),u=n(769920),p=n(250680);const m=12,g={type:"contains",includeEndItem:!1},f=Symbol.for("CRDT_SESSION_ID");function h(){return(0,i.lD)((0,o.x0)(m),f)}const v=h();class y{constructor(e,t){this.parent=void 0,this.children=[],this.sessionId=e,this.textSlice=t}insertText(e,t){const n=this.getOperationForInsertText(e,t);if(n){const{operation:e}=n;this.applyInsertTextOperation(e)}return this}insertTextValue(e,t){if(0===t.length)return this;const n=this.getOperationsForInsertTextValue(e,t).operations;for(const o of n){const e=o.type;"insertText"===e?this.applyInsertTextOperation(o):"addAnnotation"===e||"removeAnnotation"===e?this.applyAnnotationOperation(o):(0,i.t1)(e)}return this}getIndexOfTextItem(e,t){let n=0;for(const o of this.iterateTextSliceTrees()){const r=o.getTextSlice();if(r.textInstanceId===e){const e=r.getIndexOfTextItem(t);if(void 0!==e)switch(e.type){case"visible":return{type:"visible",index:n+e.index};case"deleted":return{type:"deleted",nextVisibleIndex:n+e.nextVisibleIndex};default:(0,i.t1)(e)}}n+=r.getVisibleCount()}}getGraphemeIndexOfTextItem(e,t){const n=this.getIndexOfTextItem(e,t);if(void 0===n)return;const o=this.getTextValue(),r=new a.nV(l.eeV(o));switch(n.type){case"visible":return{type:"visible",index:r.getGraphemeIndex(n.index)};case"deleted":return{type:"deleted",nextVisibleIndex:r.getGraphemeIndex(n.nextVisibleIndex)};default:(0,i.t1)(n)}}getGraphemeIndicesOfSlice(e){let t,n=0;for(const i of this.iterateTextSliceTrees()){const o=i.getTextSlice();if(o.textInstanceId===e.textInstanceId&&("start"===e.boundary&&o.getStartItem().startsWithId(e.start)||"end"===e.boundary&&o.getEndItem().endsWithId(e.end))){t=[n,n+o.getVisibleCount()];break}n+=o.getVisibleCount()}if(!t)return;const o=this.getTextValue(),r=new a.nV(l.eeV(o));return{startIndex:r.getGraphemeIndex(t[0]),exclusiveEndIndex:r.getGraphemeIndex(t[1])}}getOperationsForInsertTextValue(e,t){const n=l.QaF(t),o=this.getOperationForInsertText(e,n);if(!o)return{operations:[],invertedOperations:[]};const{operation:r,invertedOperation:i}=o,{textSliceTree:a}=this.getTextSliceTreeAndOriginItemIdForInsertionIndex(e),{textSlice:s}=a;return{operations:[r,...this.getAnnotationOperationsForInsertTextValue(r,t,s)],invertedOperations:[i]}}getOperationsForInsertTextValueAfterOriginId(e,t,n){const o=(0,p.TO)(this.findTextSliceTreeContainingItemWithId(e,t)),{textSlice:r}=o,i=l.QaF(n);if(0===i.length)return{operations:[],invertedOperations:[]};const a={type:"insertText",textInstanceId:e,id:[this.sessionId,r.opClock.reserveTicks(i.length)],originId:t,content:i},s={type:"invertedInsertText",textInstanceId:e,startId:a.id,endId:[a.id[0],a.id[1]+i.length-1]};return{operations:[a,...this.getAnnotationOperationsForInsertTextValue(a,n,r)],invertedOperations:[s]}}getAnnotationOperationsForInsertTextValue(e,t,n){const o=new Map,i=new a.W3(l.eeV(t));l.EX_({textValue:t,startIndex:0,endIndex:i.getLength()}).forEach(((e,t)=>{let{startIndex:n,endIndex:r,annotation:a}=e;const s=i.getStringStartIndex(n),l=i.getStringEndIndex(r-1),d=(0,c.X)(a),u=o.get(d)??[];u.push({startIndex:s,endIndex:l,annotation:a,sortIndex:t}),o.set(d,u)}));const s=n.getActiveAnnotationsAfterId(e.originId),d=new Map,u=new Map;for(const[a,l]of o){const e=s.get(a);if(!e){u.set(a,l);continue}const t=[],n=[];for(const{startIndex:i,endIndex:a,annotation:s,sortIndex:c}of l)r.Xy(s,e)?t.push({startIndex:i,endIndex:a}):n.push({startIndex:i,endIndex:a,annotation:s,sortIndex:c});const o=b(t,i.getStringLength()-1);o.length&&d.set(a,o),n.length&&u.set(a,n)}for(const r of s.keys())o.has(r)||((0,p.T)(!d.has(r)),d.set(r,[{startIndex:0,endIndex:i.getStringLength()-1}]));const m=i.getStringLength(),g=n.getItemIdAfterItem(e.originId),f=[];for(const[r,a]of d){const t=(0,p.TO)(s.get(r)),o=l.c14(t),i=l.J7s(t),c=l.$z2(i);for(const{startIndex:r,endIndex:s}of a){const t=c?{anchor:"before",id:[this.sessionId,e.id[1]+r]}:{anchor:"after",id:r-1>=0?[this.sessionId,e.id[1]+r-1]:e.originId},i={anchor:"before",id:s+1<m?[this.sessionId,e.id[1]+s+1]:g};f.push({type:"removeAnnotation",textInstanceId:e.textInstanceId,id:[this.sessionId,n.opClock.reserveTicks(1)],start:t,end:i,annotationKey:o})}}const h=[...u.values()].flat().sort(((e,t)=>e.sortIndex-t.sortIndex));for(const{startIndex:r,endIndex:a,annotation:c}of h){const t=l.J7s(c),o=l.$z2(t),i={anchor:"before",id:[this.sessionId,e.id[1]+r]},s=o?{anchor:"before",id:a+1<m?[this.sessionId,e.id[1]+a+1]:g}:{anchor:"after",id:[this.sessionId,e.id[1]+a]};f.push({type:"addAnnotation",textInstanceId:e.textInstanceId,id:[this.sessionId,n.opClock.reserveTicks(1)],start:i,end:s,annotation:c})}return f}getOperationForInsertText(e,t){if(0===t.length)return;const{textSliceTree:n,originId:o}=this.getTextSliceTreeAndOriginItemIdForInsertionIndex(e),{textSlice:r}=n,i={type:"insertText",textInstanceId:r.textInstanceId,id:[this.sessionId,r.opClock.reserveTicks(t.length)],originId:o,content:t};return{operation:i,invertedOperation:{type:"invertedInsertText",textInstanceId:r.textInstanceId,startId:i.id,endId:[i.id[0],i.id[1]+t.length-1]}}}TEST_ONLY__getOperationForInsertText(e,t){return this.getOperationForInsertText(e,t)}applyInsertTextOperation(e){(0,p.TO)(this.findTextSliceContainingItemWithId(e.textInstanceId,e.originId)).applyInsertTextOperation(e)}deleteText(e,t){return this.getOperationsForDeleteText(e,t).operations.forEach((e=>this.applyDeleteOperation(e))),this}getOperationsForDeleteText(e,t){(0,p.T)(e<=t);const n=[],o=[];for(const{textSliceTree:r,textSliceStartIndex:i,textSliceEndIndex:s}of this.getTextSliceTreesInRange(e,t)){const{textSlice:c}=r,u=Math.max(0,e-i),m=Math.min(s-i,t-i),g=c.getItemIdsInRange(u,m),f=(0,d.jY)(g),h=c.getTextValue(),v=new a.nV(l.eeV(h)),y=l.KU1(h,v.getGraphemeIndex(u),v.getGraphemeIndex(m)+1),b=y.reduce(((e,t)=>{var n;return e+((null===(n=t[0])||void 0===n?void 0:n.length)??0)}),0);(0,p.T)(b===f.length,`Deleted text should have same length as deleted item IDs: expected ${f.length} but got ${b} `),n.push({type:"deleteText",textInstanceId:c.textInstanceId,idRanges:g}),o.push({type:"invertedDeleteText",textInstanceId:c.textInstanceId,originId:(0,p.TO)(f.at(-1)),deletedTextValue:y,deletedIds:f})}return(0,p.T)(n.length>0),(0,p.T)(o.length>0),{operations:n,invertedOperations:o}}applyDeleteOperation(e){(0,p.TO)(this.findTextSliceContainingItemWithId(e.textInstanceId,(0,p.TO)(e.idRanges[0][0]))).applyDeleteTextOperation(e)}addAnnotation(e,t,n){return this.getOperationsForAddAnnotation(e,t,n).operations.forEach((e=>this.applyAnnotationOperation(e))),this}removeAnnotation(e,t,n){return this.getOperationsForRemoveAnnotation(e,t,n).operations.forEach((e=>this.applyAnnotationOperation(e))),this}getOperationsForAddAnnotation(e,t,n){(0,p.T)(e<=t);const o=l.J7s(n),r=l.$z2(o),i=this.getTextSliceSpansForAnnotationOperation(e,t,r,!1).map((e=>{let{textSlice:t,start:o,end:r}=e;return{type:"addAnnotation",textInstanceId:t.textInstanceId,id:[this.sessionId,t.opClock.reserveTicks(1)],start:o,end:r,annotation:n}}));(0,p.T)(i.length>0);const{textSliceTree:a,opId:s}=this.getTextSliceTreeAndItemIdForIndex(e),{textSliceTree:c,opId:d}=this.getTextSliceTreeAndItemIdForIndex(t);return{operations:i,invertedOperations:[{type:"invertedAddAnnotation",startTextInstanceId:a.textSlice.textInstanceId,startId:s,endTextInstanceId:c.textSlice.textInstanceId,endId:d,annotationKey:l.c14(n)}]}}getOperationsForRemoveAnnotation(e,t,n){(0,p.T)(e<=t);const o=l.O5C(n),i=l.L7X(o),s=this.getTextSliceSpansForAnnotationOperation(e,t,i,!0).map((e=>{let{textSlice:t,start:o,end:r}=e;return{type:"removeAnnotation",textInstanceId:t.textInstanceId,id:[this.sessionId,t.opClock.reserveTicks(1)],start:o,end:r,annotationKey:n}}));(0,p.T)(s.length>0);const{textSliceTree:c,opId:d}=this.getTextSliceTreeAndItemIdForIndex(e),{textSliceTree:u,opId:m}=this.getTextSliceTreeAndItemIdForIndex(t),g=this.getTextValue(),f=new a.nV(l.eeV(g)),h=l.Sfs({textValue:g,startIndex:f.getGraphemeIndex(e),endIndex:f.getGraphemeIndex(t)+1,groupingKey:l.O5C(n)}).find((e=>{let{annotation:t}=e;return r.Xy(l.c14(t),n)}));return{operations:s,invertedOperations:h?[{type:"invertedRemoveAnnotation",startTextInstanceId:c.textSlice.textInstanceId,startId:d,endTextInstanceId:u.textSlice.textInstanceId,endId:m,annotation:h.annotation}]:[]}}getTextSliceSpansForAnnotationOperation(e,t,n,o){(0,p.T)(0<=e&&e<=t&&t<this.getVisibleCount(),`Invalid range: [${e}, ${t}]`);const r=[];for(const{textSliceTree:i,textSliceStartIndex:a,textSliceEndIndex:s}of this.getTextSliceTreesInRange(e,t)){const{textSlice:l}=i;let c,d;c=e<a?{id:l.getStartItem().id,anchor:"after"}:o&&!n?{id:l.getItemIdBeforeIndex(e-a),anchor:"after"}:{id:l.getItemIdAtIndex(e-a),anchor:"before"},d=s<t?{id:l.getEndItem().id,anchor:"before"}:o||n?{id:l.getItemIdAfterIndex(t-a),anchor:"before"}:{id:l.getItemIdAtIndex(t-a),anchor:"after"},r.push({textSlice:l,start:c,end:d})}return r}applyAnnotationOperation(e){(0,p.TO)(this.findTextSliceContainingItemWithId(e.textInstanceId,e.start.id)).applyAnnotationOperation(e)}splitAtIndex(e){const t=this.getOperationsForSplitAtIndex(e),n=t.type;switch(n){case"splitNodeEnd":{const{newTextSliceTree:e,textSliceTreesToMove:n}=t;e.detachFromParent();for(const t of n)t.detachFromParent(),e.appendChild(t);return e}case"splitWithinNode":{const{splitOp:e,textSliceTreesToMove:n}=t,o=this.applySplitOperation(e);o.detachFromParent();for(const t of n)t.detachFromParent(),o.appendChild(t);return o}default:(0,i.t1)(n)}}getOperationsForSplitForMerge(){const{textSlice:e}=this;e.opClock.reserveTicks(20);return{type:"splitWithinNode",splitOp:{type:"splitText",textInstanceId:e.textInstanceId,id:[this.sessionId,e.opClock.reserveTicks(1)],originId:(0,p.Fb)(e.getStartItem().id,u.rd)},textSliceTreeToSplit:this,textSliceTreesToMove:[]}}getOperationsForSplitAtIndex(e){const{textSliceTree:t,originId:n}=this.getTextSliceTreeAndOriginItemIdForInsertionIndex(e),{textSlice:o}=t;if(o.isLastOriginItemId(n)){const e=this.getNextTextSliceTree(t);if(e)return{type:"splitNodeEnd",previousTextSliceTree:t,newTextSliceTree:e,textSliceTreesToMove:this.getFollowingTopLevelTextSliceTrees(e)}}return{type:"splitWithinNode",splitOp:{type:"splitText",textInstanceId:o.textInstanceId,id:[this.sessionId,o.opClock.reserveTicks(1)],originId:n},textSliceTreeToSplit:t,textSliceTreesToMove:this.getFollowingTopLevelTextSliceTrees(t)}}applySplitOperation(e){const t=(0,p.TO)(this.findTextSliceTreeContainingItemWithId(e.textInstanceId,e.originId));t.textSlice.applySplitTextOperation(e);const n=t.textSlice.splitIntoSlices();(0,p.T)(2===n.length);const o=(0,p.T)(n[1]),r=new y(this.sessionId,o);for(;t.children.length;){const e=t.children[0];e.detachFromParent(),r.appendChild(e)}return t.appendChild(r),r}getTextValue(){const e=[];for(const t of this.iterateTextSliceTrees())e.push(...t.textSlice.getTextValue());return l.Zxt(e)}getText(){return l.QaF(this.getTextValue())}detachFromParent(){var e;null===(e=this.parent)||void 0===e||e.removeChild(this)}getTextSlice(){return this.textSlice}replaceTextSlice(e){(0,p.T)(e.textInstanceId===this.textSlice.textInstanceId),this.textSlice=e}removeChild(e){const t=this.children.indexOf(e);return(0,p.T)(-1!==t),this.children.splice(t,1),e.parent=void 0,this}appendChild(e){if((0,p.T)(void 0===e.parent),e.parent=this,this.children.push(e),e.hasCycle())throw e.detachFromParent(),new Error("Appending child resulted in a cycle");return this}hasCycle(){const e=new Set;let t=this;for(;t;){if(e.has(t))return!0;e.add(t),t=t.parent}return!1}getTextSliceTreeAndOriginItemIdForInsertionIndex(e){let t,n;if(0===e){let e;for(const t of this.iterateTextSliceTrees())if(e=t,t.textSlice.getVisibleCount()>0)break;t=(0,p.TO)(e),n=0}else{const o=(0,p.TO)(this.getTextSliceTreesInRange(e-1,e-1)[0]);t=o.textSliceTree,n=e-o.textSliceStartIndex}return{textSliceTree:t,originId:t.textSlice.getOriginItemIdForInsertionIndex(n)}}getTextSliceTreeAndItemIdForIndex(e){const{textSliceTree:t,textSliceStartIndex:n}=(0,p.TO)(this.getTextSliceTreesInRange(e,e)[0]),o=e-n;return{textSliceTree:t,opId:t.textSlice.getItemIdAtIndex(o)}}findTextSliceContainingItemWithId(e,t,n){var o;return null===(o=this.findTextSliceTreeContainingItemWithId(e,t,n))||void 0===o?void 0:o.textSlice}findTextSliceTreeBeforeTextSliceStartingWithItemId(e,t){let n;for(const o of this.iterateTextSliceTrees()){const{textSlice:r}=o;if(r.textInstanceId===e&&r.getStartItem().startsWithId(t))return n;n=o}}findTextSliceTreeContainingItemWithId(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g;for(const o of this.iterateTextSliceTrees(e))switch(n.type){case"contains":if(o.textSlice.containsItemWithId(t,n))return o;break;case"start":if(o.textSlice.getStartItem().startsWithId(t))return o;break;case"end":if(o.textSlice.getEndItem().endsWithId(t))return o;break;default:(0,i.t1)(n)}}getTextSliceTreesInRange(e,t){const n=[];(0,p.T)(0<=e&&e<=t&&t<this.getVisibleCount(),`Invalid range: [${e}, ${t}]`);let o=-1;for(const r of this.iterateTextSliceTrees()){const{textSlice:i}=r;if(0===i.getVisibleCount())continue;const a=o+1,s=a+i.getVisibleCount()-1;if(s<e)o=s;else{if(t<a)break;n.push({textSliceTree:r,textSliceStartIndex:a,textSliceEndIndex:s}),o=s}}return n}getNextTextSliceTree(e){let t;for(const n of this.iterateTextSliceTrees()){if(t===e)return n;t=n}}getFollowingTopLevelTextSliceTrees(e){const t=[this];for(;t.length;){const n=(0,p.TO)(t.shift());if(n===e)return[...t];t.unshift(...n.children)}return[]}getLastTextSliceTreeInPreOrderTraversal(){let e=this;for(const t of this.iterateTextSliceTrees())e=t;return e}getVisibleCount(){let e=0;for(const t of this.iterateTextSliceTrees())e+=t.textSlice.getVisibleCount();return e}*iterateTextSliceTrees(e){e&&this.textSlice.textInstanceId!==e||(yield this);for(const t of this.children)yield*t.iterateTextSliceTrees(e)}equals(e){if(void 0===e)return!1;if(this===e)return!0;const t=[...this.iterateTextSliceTrees()],n=[...e.iterateTextSliceTrees()];if(t.length!==n.length)return!1;for(let o=0;o<t.length;o++){const e=t[o],r=n[o];if(!e.textSlice.equals(r.textSlice))return!1;const i=e.children,a=r.children;if(i.length!==a.length)return!1;for(let t=0;t<i.length;t++){const e=i[t],n=a[t];if(e.textSlice.getSliceKey()!==n.textSlice.getSliceKey())return!1}}return!0}getTextInstanceIds(){const e=new Set;for(const t of this.iterateTextSliceTrees())e.add(t.textSlice.textInstanceId);return e}static createEmpty(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.Il();return new y(arguments.length>1&&void 0!==arguments[1]?arguments[1]:v,u.ZP.createEmpty(e))}}function b(e,t){const n=[];let o=-1;for(const{startIndex:r,endIndex:i}of e)r>o+1&&n.push({startIndex:o+1,endIndex:r-1}),o=i;return t>=o+1&&n.push({startIndex:o+1,endIndex:t}),n}},266749:(e,t,n)=>{n.d(t,{IG:()=>a,k8:()=>o,pp:()=>i});const o=!0,r=Symbol("crdtAware");function i(e){return"test"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"production")?e:Object.defineProperty(Array.isArray(e)?[...e]:{...e},r,{value:!0,enumerable:!1,configurable:!1,writable:!1})}function a(e){return r in e&&!0===e[r]}},597531:(e,t,n)=>{n.d(t,{Ry:()=>b,Vt:()=>x,cX:()=>h,cZ:()=>_,mz:()=>y,nY:()=>v});n(757658),n(21703);var o=n(653965),r=n(401898),i=n(541432),a=n(642509),s=n(159730),l=n(959753),c=n(300482),d=n(421202),u=n(167175),p=n(266749),m=n(942828),g=n(346227),f=n(250680);function h(e){return e.format?{...e,format:v(e.format)}:e}function v(e){const{use_crdt:t,text_slice_tree:n,text_clocks:o,...r}=e;return r}function y(e){const{block:t,useCrdt:n}=e,o=l.kk5.fromBlock(t),r=o.__IM_SORRY__getValue();if(!n){return[c.op.set({pointer:o.pointer,path:[],args:k(r)})]}const i=g.ZP.createEmpty(o.pointer.id),a=S(r,i),s=c.op.set({pointer:o.pointer,path:[],args:a}),d=o.getProperty("title");if(!d||0===d.length)return[s];return[s,...i.getOperationsForInsertTextValue(0,d).operations.map((e=>u.W5({pointer:o.pointer,crdtOperation:e,fullTextValue:d})))]}function b(e){const{existingBlock:t,updatedBlock:n}=e,o=l.kk5.fromBlock(t),i=l.kk5.fromBlock(n).__IM_SORRY__getValue(),{format:a,properties:s,moved:d,...u}=h(i),{title:m,...g}=s??{},f=[c.op.update({pointer:o.pointer,path:[],args:(0,p.pp)(u)}),a&&Object.keys(a).length>0?c.op.update({pointer:o.pointer,path:["format"],args:a}):void 0,o.useCrdt()?g&&Object.keys(g).length>0?c.op.update({pointer:o.pointer,path:["properties"],args:g}):void 0:s&&Object.keys(s).length>0?c.op.update({pointer:o.pointer,path:["properties"],args:(0,p.pp)(s)}):void 0,d&&Object.keys(d).length>0?c.op.update({pointer:o.pointer,path:["moved"],args:d}):void 0].filter(r.$K);if(!o.useCrdt())return f;const v=_(o,m);return[...f,...v]}function _(e,t){if(!e.useCrdt())throw new s.B8("Called getOperationsForTitleUpdate on a non-CRDT block. Use regular update operations instead!",{data:{block:e.pointer}});const n=e.getTextSliceTree();if(!n)return[];const r=n.getTextValue();if(o.Xy(r,t))return[];const i=[],a=n.getVisibleCount()>0?n.getOperationsForDeleteText(0,n.getVisibleCount()-1).operations:[];if(i.push(...a),t&&t.length>0){for(const t of a)n.applyDeleteOperation(t);const e=n.getOperationsForInsertTextValue(0,t).operations;i.push(...e)}return i.map((n=>u.W5({pointer:e.pointer,crdtOperation:n,fullTextValue:t??[]})))}function S(e,t){const n=w(e,{use_crdt:!0,text_slice_tree:m.Z.serialize(t),text_clocks:m.Z.serializeClocks(t)});return(0,p.pp)({...n,properties:{...n.properties,title:t.getTextValue()}})}function k(e){return w(e,{use_crdt:void 0,text_slice_tree:void 0,text_clocks:void 0})}function w(e,t){const{type:n,format:o}=e;return n===i.Ti.drawing?(0,p.pp)({...e,format:{drawing_value:void 0,...o,...t}}):n===i.Ti.externalObjectInstance?(0,p.pp)((0,a.Ux)(e)?e:{...e,format:{...o,...t}}):(i.Ti.externalObjectInstancePage,(0,p.pp)({...e,format:{...o,...t}}))}function x(e,t){return e.map((e=>{if("set"!==e.command||e.pointer.table!==d.iU)return e;if(!t)return{...e,args:(0,p.pp)(e.args)};if(e.path.length>0)throw new Error("Block operation should modify root record");return{...e,args:I({...e.args,id:e.args.id??e.pointer.id})}}))}function I(e){var t;(0,f.T)(!l.kk5.fromBlock(e).useCrdt());const n=g.ZP.createEmpty(e.id),o=null===(t=e.properties)||void 0===t?void 0:t.title;return o&&o.length>0&&n.insertTextValue(0,o),S(e,n)}},961238:(e,t,n)=>{n.d(t,{c:()=>r});const o="preDevDowngrade";function r(){return"postDevDowngrade"===o}},945709:(e,t,n)=>{n.d(t,{l:()=>r});var o=n(942828);function r(e,t,n){if(!e||!t)return;const r=Object.keys(t).reduce(((e,t)=>{const o=n({value:0,textInstanceId:t});return e[t]=o,e}),{});return o.Z.deserialize(e,r)}},459579:(e,t,n)=>{n.d(t,{$c:()=>i,Dx:()=>a,e0:()=>r,jY:()=>s});n(757658);var o=n(250680);function r(e,t){return e[1]<t[1]?-1:e[1]>t[1]?1:e[0]<t[0]?-1:e[0]>t[0]?1:0}function i(e,t){const n=r(e,t);return(0,o.T)(0!==n,`Expected IDs to be distinct: ${e}`),n}function a(e,t){const n=function(e,t){return"start"===e?"start"===t?0:-1:"end"===e?"start"===t?1:"end"===t?0:-1:"start"===t||"end"===t?1:r(e,t)}(e,t);return(0,o.T)(0!==n,`Expected IDs to be distinct: ${e}`),n}function s(e){const t=[];for(const n of e){const[e,o]=n,[r,i]=e;for(let n=0;n<o;n++)t.push([r,i+n])}return t}},852136:(e,t,n)=>{n.d(t,{AB:()=>l,Eg:()=>s,Hi:()=>r,TS:()=>a,s:()=>i});n(757658);var o=n(443993);function*r(e,t){let n=e;for(;n;){let e=!0;(null==t||!t.includeDeleted)&&n instanceof o.Jy&&n.isDeleted()?e=!1:null!=t&&t.includeEndItem||n.next||(e=!1),e&&(yield n),n=n.next}}function i(e){let t=e;for(const n of r(e,{includeDeleted:!0,includeEndItem:!0}))t=n;return t}function a(e){let t=0;for(const n of r(e,{includeDeleted:!1}))n instanceof o.Jy&&(t+=n.getLength());return t}function s(e){const t=[e];let n=e.next;for(;n;)if(n instanceof o.JE&&n.next){const e=n.clone(),o=n.next;e.next=o,o.prev=e,e.prev=void 0,n.next=void 0,t.push(e),n=e.next}else n=n.next;return t}function l(e){for(let t=1;t<e.length;t++)e[t].prev=e[t-1],e[t-1].next=e[t]}},990542:(e,t,n)=>{n.d(t,{Z:()=>p});n(757658);var o=n(852136),r=n(719056),i=n(769920),a=n(250680),s=n(401898),l=n(443993),c=n(457081);class d{static serialize(e){return[...e.getOps()]}static deserialize(e){return new c.Z(e)}}class u{static serialize(e){let t;e instanceof l.vM?t=u.serializeStartItem(e):e instanceof l.KH?t=u.serializeEndItem(e):e instanceof l.JE?t=u.serializeSplitItem(e):e instanceof l.Jy?t=u.serializeTextItem(e):(0,s.t1)(e);const n=e.getAnnotationOpSetForAnchor("before");n&&(t.annotationOpsBefore=d.serialize(n));const o=e.getAnnotationOpSetForAnchor("after");return o&&(t.annotationOpsAfter=d.serialize(o)),t}static serializeStartItem(e){return{type:"start"}}static serializeEndItem(e){return{type:"end"}}static serializeSplitItem(e){return{type:"split",id:e.id,originId:e.originId}}static serializeTextItem(e){return e.isDeleted()?{type:"text",id:e.id,originId:e.originId,deleted:!0,length:e.getLength()}:{type:"text",id:e.id,originId:e.originId,deleted:!1,content:e.getDefinedContent()}}static deserialize(e){let t,n=0;const o=e.type;switch(o){case"start":t=u.deserializeStartItem(e);break;case"end":t=u.deserializeEndItem(e);break;case"split":const r=u.deserializeSplitItem(e);t=r,n=Math.max("string"==typeof r.originId?0:r.originId[1],r.id[1]);break;case"text":const i=u.deserializeTextItem(e);t=i,n=Math.max("string"==typeof i.originId?0:i.originId[1],i.getEndId()[1]);break;default:(0,s.t1)(o)}if(e.annotationOpsBefore&&(t.maybeCreateAnnotationOpSetForAnchor("before",{opSet:d.deserialize(e.annotationOpsBefore)}),e.annotationOpsBefore.length>0))for(const r of e.annotationOpsBefore)n=Math.max(n,r.id[1],"string"==typeof r.start.id?0:r.start.id[1],"string"==typeof r.end.id?0:r.end.id[1]);if(e.annotationOpsAfter&&(t.maybeCreateAnnotationOpSetForAnchor("after",{opSet:d.deserialize(e.annotationOpsAfter)}),e.annotationOpsAfter.length>0))for(const r of e.annotationOpsAfter)n=Math.max(n,r.id[1],"string"==typeof r.start.id?0:r.start.id[1],"string"==typeof r.end.id?0:r.end.id[1]);return{item:t,maxTimestamp:n}}static deserializeStartItem(e){return new l.vM}static deserializeEndItem(e){return new l.KH}static deserializeSplitItem(e){return new l.JE(e.id,e.originId)}static deserializeTextItem(e){return e.deleted?l.Jy.createDeleted(e.id,e.originId,e.length):l.Jy.create(e.id,e.originId,e.content)}}class p{static serialize(e){const t=[];for(const n of e.iterateItems({includeDeleted:!0,includeEndItem:!0}))t.push(u.serialize(n));return{textInstanceId:e.textInstanceId,items:t}}static deserialize(e,t){const n=[];let s=0;for(const o of e.items){const{item:e,maxTimestamp:t}=u.deserialize(o);n.push(e),s=Math.max(s,t)}o.AB(n);const l=(0,a.Fb)(n[0],i.GU);return t.set(Math.max(t.get(),s)),new i.ZP(e.textInstanceId,new r.Z(t),l)}}},942828:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(719056),r=n(346227),i=n(250680),a=n(990542);class s{static serialize(e){const t={};for(const n of e.iterateTextSliceTrees()){const e=n.getTextSlice(),o=n.children;t[e.getSliceKey()]={textSlice:a.Z.serialize(e),childKeys:o.map((e=>e.getTextSlice().getSliceKey()))}}return{root:e.getTextSlice().getSliceKey(),nodes:t}}static serializeClocks(e){const t={};for(const n of e.iterateTextSliceTrees()){const{textInstanceId:e}=n.getTextSlice();t[e]=1}return t}static deserialize(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.ek;const i=e.root,a=e.nodes;return t=t??Object.values(a).reduce(((e,t)=>{const{textSlice:n}=t;return e[n.textInstanceId]||(e[n.textInstanceId]=new o.h),e}),{}),s.deserializeHelper(n,i,a,t)}static deserializeHelper(e,t,n,o){const{textSlice:l,childKeys:c=[]}=(0,i.TO)(n[t]),d=(0,i.TO)(o[l.textInstanceId]),u=a.Z.deserialize(l,d),p=new r.ZP(e,u);for(const r of c){const t=s.deserializeHelper(e,r,n,o);p.appendChild(t)}return p}}},752147:(e,t,n)=>{function o(e){return Boolean(e)}function r(){const e="production";switch(e){case"local":case"staging":case"development":case"production":return e;default:return"production"}}n.d(t,{R:()=>r,l:()=>o})},250680:(e,t,n)=>{n.d(t,{Fb:()=>l,R9:()=>c,T:()=>i,TO:()=>a,m7:()=>s});var o=n(159730),r=n(182798);function i(e,t,n){return r.T(e,t,n,o.B8)}function a(e,t,n){return r.TO(e,t,n,o.B8)}function s(e,t,n){return r.m7(e,t,n,o.B8)}function l(e,t,n){return r.Fb(e,t,n,o.B8)}function c(e,t,n){return r.R9(e,t,n,o.B8)}},401800:(e,t,n)=>{n.d(t,{P:()=>u,Z:()=>p});var o=n(307032),r=n(218265),i=n(815145),a=n(541432),s=n(180951),l=n(680310),c=n(959753),d=n(421838);function u(e){let{config:t,domainName:n,isCustomHostname:o}=e;const{port:i,protocol:a}=new URL(t.domainBaseUrl);return o?r.WU({protocol:a,hostname:n,port:i}):r.WU({protocol:a,host:`${n}.${t.publicDomainName}`})}function p(e){const{pageId:t,spaceDomain:n,scrollToBlockId:u,peekViewBlockId:p,peekMode:m,collectionViewId:g,baseUrl:f,discussionId:h,showMoveTo:v,saveParent:y,duplicate:b,pageVisitSource:_,templateGalleryItem:S,projectManagementLaunch:k,notificationId:w,openPageUpdatesTab:x,queryId:I}=e;let C;"pageModel"in e&&e.pageModel?C=e.pageModel:"pageValue"in e&&e.pageValue&&(C=c.kk5.fromValue("block",e.pageValue));let T="";if(C&&(0,a.XD)(C.getType(),C.getFormat())&&(0,s.wS)(C,"title")){const e=(0,s.wS)(C,"title");T=d.Jcv(e||[]).replace(/[^\w]/g," ").trim().slice(0,100).split(/\s+/g).join("-")}let M="/";n&&(M+=`${n}/`),t&&(M+=T?`${T}-${o.cj(t)}`:`${o.cj(t)}`),f&&(M=`${f}${M}`);const P={};return g&&(P.v=o.cj(g)),p&&(P[l.UJ]=o.cj(p)),m&&(P.pm=m),h&&(P.d=o.cj(h)),w&&(P.nid=o.cj(w)),v&&(P.showMoveTo="true"),y&&(P.saveParent="true"),b&&(P.duplicate="true"),S&&(P.tg=S),k&&(P.pjm="true"),x&&(P.openPageUpdatesTab="true"),_&&(P[i.$X]=String(_)),I&&(P[i.Mf]=I),r.bf({url:M,query:P,hash:u&&o.cj(u)})}},595200:(e,t,n)=>{function o(e,t){if(t(e))return e;let n,o=0;do{o++,n=`${e} ${o}`}while(!t(n));return n}n.d(t,{Z:()=>o})},222491:(e,t,n)=>{n.d(t,{nB:()=>d,iv:()=>i,jN:()=>a,EO:()=>s,dk:()=>l,vE:()=>u,S$:()=>p,Ws:()=>c});n(757658);var o=n(401898);const r={inputRangeThumb:{borderColor:!0,background:!0},inputRangeTrack:{color:!0},pseudoAfter:{color:!0,content:!0,display:!0,width:!0,height:!0,border:!0,background:!0,fontFamily:!0,fontWeight:!0,fontSize:!0},pseudoBefore:{color:!0,content:!0,display:!0,width:!0,height:!0,border:!0,background:!0,fontFamily:!0,fontWeight:!0,fontSize:!0},pseudoSelection:{color:!0,WebkitTextFillColor:!0,textShadow:!0,background:!0},pseudoHover:{background:!0},pseudoActive:{background:!0},whenContentEditable:{caretColor:!0,WebkitUserModify:!0},whenRootSelecting:{display:!0},whenFocusedEditable:{WebkitUserModify:!0,WebkitUserSelect:!0,userSelect:!0},pseudoAfterWhenComposing:{display:!0}};function i(){const e=[],t={};let n=!1;for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];for(const c of a)if(c)if("string"!=typeof c)for(const[i,a]of Object.entries(c))if(i in r){const r=i,s=a;e.push(r);for(const[e,i]of(0,o.qP)(s)){t[`--${r}--${e}`]=i,n=!0}}else"style"===i?(Object.assign(t,a),n=!0):"className"===i?e.push(a):"object"!=typeof a&&"function"!=typeof a&&(t[i]=a,n=!0);else e.push(c);const l={};return e.length>0&&(l.className=e.join(" ")),n&&(l.style=t),l}function a(e){return`assistant-grouped-edit-${e}`}function s(e){const{type:t,editId:n}=e;return`assistant-grouped-edit-id-${n}-${t}`}function l(e){let{discussionId:t}=e;return`discussion-id-${t}`}function c(e){let{type:t}=e;return`suggestion-${t}`}const d=3;function u(e){let{level:t}=e;return`discussion-level-${Math.min(t,d)}`}function p(e){let{blockId:t,href:n}=e;return`link-annotation-${t}-${function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(n)}`}},252936:(e,t,n)=>{n.d(t,{Bp:()=>m,yu:()=>f});n(757658),n(21703);var o=n(730120),r=n(940470),i=n(401898),a=n(180951),s=n(640506),l=n(253877),c=n(321768),d=n(300482),u=n(772141),p=n(421202);const m=["consume_gap","preserve_gap"];class g{constructor(){this.operations=[],this.numDependenciesUpdated=0,this.numCouldNotUpdateDueToPermissions=0}push(e){this.operations.push(...e.operations),this.numDependenciesUpdated+=e.numDependenciesUpdated,this.numCouldNotUpdateDueToPermissions+=e.numCouldNotUpdateDueToPermissions}pushUpdatedBlockDates(e,t){for(const[n,o]of e)this.operations.push(...t.toOperations(o,{id:n,table:p.iU}));this.numDependenciesUpdated+=e.size}}function f(e){const{block:t,options:n,blockingPropertyId:s,blockedByPropertyId:l,timeZone:c,locale:d,collectionSchema:u,getRecordRole:p,getRecordValue:m,dateProperty:f,endDateProperty:b}=e,_=function(e){return t=>{let{oldDateValue:n,newDateValue:r,dependencyDateValue:a}=t;const s=Boolean(e.avoid_weekends),l=e.mode;if(!l)return;const c=a.getStart(),d=r.getStart(),u=r.getEnd();let p;if("consume_gap"===l){if(u.valueOf()>=c.valueOf()){if(s)return w({dateShiftMode:l,newDateData:o.Xp.fromDateTimes(d,u),dependencyDateValue:a});p=u.plus(a.nudgeForDate("start"))}}else if("preserve_gap"===l)if(n){const e=n.getStart(),t=n.getEnd();if(s)return w({dateShiftMode:l,oldDateData:o.Xp.fromDateTimes(e,t),newDateData:o.Xp.fromDateTimes(d,u),dependencyDateValue:a});const r=u.diff(t);p=c.plus(r)}else u.valueOf()>=c.valueOf()&&(p=u.plus(a.nudgeForDate("start")));else(0,i.t1)(l);return p&&a.changeBoundary({type:"start",newValue:p})}}(n),S=function(e){return t=>{let{oldDateValue:n,newDateValue:r,dependencyDateValue:a}=t;const s=Boolean(e.avoid_weekends),l=e.mode;if(!l)return;const c=a.getEnd(),d=r.getStart(),u=r.getEnd();let p;if("consume_gap"===l){if(d.valueOf()<=c.valueOf()&&(p=d.minus(a.nudgeForDate("end")),s))return k({dateShiftMode:l,newDateData:o.Xp.fromDateTimes(d,u),dependencyDateValue:a})}else if("preserve_gap"===l)if(n){const e=n.getStart(),t=n.getEnd();if(s)return k({dateShiftMode:l,oldDateData:o.Xp.fromDateTimes(e,t),newDateData:o.Xp.fromDateTimes(d,u),dependencyDateValue:a});const r=e.diff(d);p=c.minus(r)}else d.valueOf()<=c.valueOf()&&(p=d.minus(a.nudgeForDate("end")));else(0,i.t1)(l);return p&&a.changeBoundary({type:"end",newValue:p})}}(n),x={timeZone:c,locale:d};let I,M;if((0,i.$K)(b)){const e=new T({convertArgs:x,startPropertyId:f.id,endPropertyId:b.id});I=e;const n=e.getFromBlock(t),o=(0,a.Gl)(f.newValue)??(null==n?void 0:n.startValue),r=(0,a.Gl)(b.newValue)??(null==n?void 0:n.endValue);if(!(0,i.$K)(o))return new g;M=new A({convertArgs:x,startValue:o,endValue:r})}else{I=new C({convertArgs:x,propertyId:f.id});const e=(0,a.Gl)(f.newValue);if(!(0,i.$K)(e))return new g;M=new P({convertArgs:x,value:e})}const R={startingBlock:t,startingNewDateValue:M,context:{collectionSchema:u,getRecordRole:p,getRecordValue:m,accessor:I}};if("consume_gap"===n.mode){const e=new g,t=y({...R,dependencyPropertyId:s,dateAdjuster:_,dateRangeIsFurtherThan:(e,t)=>e.getStart().valueOf()>t.getStart().valueOf()});if(r.x.isFail(t))return new g;e.push(t.value);const n=y({...R,dependencyPropertyId:l,dateAdjuster:S,dateRangeIsFurtherThan:(e,t)=>e.getEnd().valueOf()<t.getEnd().valueOf()});return r.x.isFail(n)?new g:(e.push(n.value),e)}if("preserve_gap"===n.mode)return function(e){const{startingBlock:t,startingNewDateValue:n,forwardConfig:o,backwardConfig:r,context:i}=e,{accessor:a}=i,s=new Set,l=[{block:t,newDateValue:n}],c=new Map,d=new g;for(;;){const e=l.shift();if(!e)break;const{block:n,newDateValue:u}=e;if(s.has(n.id))continue;s.add(n.id);const p=a.getFromBlock(n);for(const{dependencyPropertyId:a,dateAdjuster:s}of[o,r]){const e=v(i,n,a);for(const n of e)n.id!==t.id&&h({context:i,adjust:e=>s({oldDateValue:p,newDateValue:u,dependencyDateValue:e}),result:d,dependencyPointer:n,onDateUpdated:(e,t)=>{c.has(n.id)||c.set(n.id,t),l.push({block:e,newDateValue:t})}})}}return d.pushUpdatedBlockDates(c,a),d}({...R,forwardConfig:{dependencyPropertyId:s,dateAdjuster:_},backwardConfig:{dependencyPropertyId:l,dateAdjuster:S}});(0,i.t1)(n.mode)}function h(e){const{result:t,dependencyPointer:n,context:o,adjust:r,onDateUpdated:i}=e,{accessor:a,getRecordValue:s,getRecordRole:l}=o,c=l(n);if(c&&!(0,u.J5)(c))return void t.numCouldNotUpdateDueToPermissions++;const d=s(n);if(!d)return;const p=a.getFromBlock(d);if(!p)return;const m=r(p);m&&!m.equals(p)&&i(d,m)}function v(e,t,n){var o;const r=e.collectionSchema[n];return r&&"relation"===r.type?(0,a.j$)({propertySchema:r,getRecordModel:c.o.fromGetRecordValueFn(e.getRecordValue),relationValue:(0,a.rq)(null===(o=t.properties)||void 0===o?void 0:o[n])}):[]}function y(e){const{startingBlock:t,startingNewDateValue:n,context:o,dateAdjuster:r,dateRangeIsFurtherThan:i,dependencyPropertyId:a}=e,{accessor:s}=o,l=new Set,c=[{block:t,newDateValue:n,path:[]}],d=new Map,u=new g;for(;;){const e=c.shift();if(!e)break;const{block:t,newDateValue:n,path:p}=e;if(p.includes(t.id))return{error:"cycle_detected"};if(l.has(t.id))continue;l.add(t.id);const m=s.getFromBlock(t),g=[...p,t.id],f=v(o,t,a);for(const a of f)h({context:o,adjust:e=>r({oldDateValue:m,newDateValue:n,dependencyDateValue:e}),result:u,dependencyPointer:a,onDateUpdated:(e,t)=>{const n=d.get(a.id);n&&!i(t,n)||d.set(a.id,t),c.push({block:e,newDateValue:t,path:g})}})}return u.pushUpdatedBlockDates(d,s),{value:u}}function b(e){const{inputDate:t,dateShiftDirection:n}=e;return 6===t.weekday?t.plus({days:"right"===n?2:-1}):7===t.weekday?t.plus({days:"right"===n?1:-2}):t}function _(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=0;if(e.valueOf()>t.valueOf())n=t,o=e;else{if(!(e.valueOf()<t.valueOf()))return 0;n=e,o=t}for(r&&(n=n.plus({days:1}),o=o.minus({days:1}));n.valueOf()<=o.valueOf();)S(n)||i++,n=n.plus({days:1});return i}function S(e){return 6===e.weekday||7===e.weekday}function k(e){const{newDateData:t,dependencyDateValue:n,dateShiftMode:o}=e,r=n.getStart(),i=n.getEnd(),a=_(r,i);let s=b({inputDate:t.start.minus({days:1}),dateShiftDirection:"left"});if("preserve_gap"===o){const n=_(e.oldDateData.start,i,!0);for(let e=_(t.start,s,!0);e<n;e++)s=s.minus({days:1}),S(s)&&(s=b({inputDate:s,dateShiftDirection:"left"}))}let l=s,c=1;for(;c<a;)l=l.minus({days:1}),S(l)||c++;return n.changeBoundaries({newStart:l,newEnd:s})}function w(e){const{dependencyDateValue:t,newDateData:n,dateShiftMode:o}=e,r=t.getStart(),i=_(r,t.getEnd());let a=b({inputDate:n.end.plus({days:1}),dateShiftDirection:"right"});if("preserve_gap"===o){const t=_(e.oldDateData.end,r,!0);for(let e=_(n.end,a,!0);e<t;e++)a=a.plus({days:1}),S(a)&&(a=b({inputDate:a,dateShiftDirection:"right"}))}let s=a,l=1;for(;l<i;)s=s.plus({days:1}),S(s)||l++;return t.changeBoundaries({newStart:a,newEnd:s})}function x(e,t){if(!(e instanceof t))throw new Error(`Expected ShiftableDate to be of type ${t}`)}class I{constructor(e){this.convertArgs=e}}class C extends I{constructor(e){super(e.convertArgs),this.propertyId=void 0,this.propertyId=e.propertyId}getFromBlock(e){var t;const n=(0,a.Gl)(null===(t=e.properties)||void 0===t?void 0:t[this.propertyId]);return n?new P({value:n,convertArgs:this.convertArgs}):void 0}toOperations(e,t){return x(e,P),[d.op.update({pointer:t,path:["properties"],args:{[this.propertyId]:(0,a.d7)(e.value)}})]}}class T extends I{constructor(e){super(e.convertArgs),this.startPropertyId=void 0,this.endPropertyId=void 0,this.startPropertyId=e.startPropertyId,this.endPropertyId=e.endPropertyId}getFromBlock(e){var t;const n=(0,a.Gl)(null===(t=e.properties)||void 0===t?void 0:t[this.startPropertyId]);if((0,i.$K)(n)){var o;const t=(0,a.Gl)(null===(o=e.properties)||void 0===o?void 0:o[this.endPropertyId]);return new A({startValue:n,endValue:t,convertArgs:this.convertArgs})}}toOperations(e,t){return x(e,A),[d.op.update({pointer:t,path:["properties"],args:{[this.startPropertyId]:(0,a.d7)(e.startValue),...e.endValue?{[this.endPropertyId]:(0,a.d7)(e.endValue)}:{}}})]}}class M{constructor(e){this.convertArgs=e}toLuxon(e){return l.OQ.notionDateOrDateTimeToLuxon(e,this.convertArgs)}}class P extends M{constructor(e){super(e.convertArgs),this.value=void 0,this.value=e.value}getStart(){return this.toLuxon(s.Ws(this.value))}getEnd(){return this.toLuxon(s.S$(this.value))}nudgeForDate(e){return"date"===this.value.type||"daterange"===this.value.type?{days:1}:"datetime"===this.value.type?{minutes:1}:"datetimerange"===this.value.type?{}:void(0,i.t1)(this.value)}equals(e){return x(e,P),s.AP(this.value,e.value)}changeBoundary(e){let t;if("daterange"===this.value.type||"datetimerange"===this.value.type){const n=l.NK(this.value,this.convertArgs.timeZone,this.convertArgs.locale),o=n.end.diff(n.start);t=("daterange"===this.value.type?l.OQ.toPersistedDateRange:l.OQ.toPersistedDateTimeRange)("start"===e.type?{start:e.newValue,end:e.newValue.plus(o)}:{start:e.newValue.minus(o),end:e.newValue},this.convertArgs.timeZone)}else if("date"===this.value.type||"datetime"===this.value.type){t=("date"===this.value.type?l.OQ.toPersistedDate:l.OQ.toPersistedDateTime)(e.newValue.valueOf(),this.convertArgs.timeZone)}else(0,i.t1)(this.value);return new P({value:t,convertArgs:this.convertArgs})}changeBoundaries(e){const{newStart:t,newEnd:n}=e;return new P({value:l.OQ.toPersistedDateWithType({start:t,end:n},this.value.type,this.convertArgs.timeZone),convertArgs:this.convertArgs})}}class A extends M{getMergedValue(){if(this._mergedValue===A.MergedValueNotCalculated){const e=l.rH(this.startValue,this.endValue);this._mergedValue=e?l.Qq(e):void 0}return this._mergedValue}constructor(e){super(e.convertArgs),this.startValue=void 0,this.endValue=void 0,this._mergedValue=void 0,this.startValue=e.startValue,this.endValue=e.endValue}getStart(){return this.toLuxon(s.Ws(this.getMergedValue()??this.startValue))}getEnd(){return this.toLuxon(s.S$(this.getMergedValue()??this.endValue??this.startValue))}equals(e){return x(e,A),s.AP(this.startValue,e.startValue)&&((0,i.$K)(this.endValue)?(0,i.$K)(e.endValue)&&s.AP(this.endValue,e.endValue):!(0,i.$K)(e.endValue))}nudgeForDate(e){const t="start"===e?this.startValue:this.endValue??this.startValue;return"date"===t.type?{days:1}:"datetime"===t.type||"datetimerange"===t.type||"daterange"===t.type?{}:void(0,i.t1)(t)}toPersistedDateDiscardingRange(e,t){return void 0===t||"date"===t||"daterange"===t?l.OQ.toPersistedDate(e.valueOf(),this.convertArgs.timeZone):"datetime"===t||"datetimerange"===t?l.OQ.toPersistedDateTime(e.valueOf(),this.convertArgs.timeZone):void(0,i.t1)(t)}changeBoundary(e){var t,n;const o=this.getEnd().diff(this.getStart());return new A({convertArgs:this.convertArgs,..."start"===e.type?{startValue:this.toPersistedDateDiscardingRange(e.newValue,this.startValue.type),endValue:this.toPersistedDateDiscardingRange(e.newValue.plus(o),null===(t=this.endValue)||void 0===t?void 0:t.type)}:{startValue:this.toPersistedDateDiscardingRange(e.newValue.minus(o),this.startValue.type),endValue:this.toPersistedDateDiscardingRange(e.newValue,null===(n=this.endValue)||void 0===n?void 0:n.type)}})}changeBoundaries(e){var t;const{newStart:n,newEnd:o}=e;return new A({startValue:this.toPersistedDateDiscardingRange(n,this.startValue.type),endValue:this.toPersistedDateDiscardingRange(o,null===(t=this.endValue)||void 0===t?void 0:t.type),convertArgs:this.convertArgs})}}A.MergedValueNotCalculated=Symbol("Merged value not calculated yet")},640506:(e,t,n)=>{n.d(t,{AE:()=>R,AP:()=>O,C1:()=>H,Dy:()=>te,Fi:()=>y,Gc:()=>ee,HZ:()=>m,Io:()=>oe,J_:()=>w,L7:()=>d,Ls:()=>ne,Nh:()=>z,PI:()=>f,QD:()=>E,S$:()=>$,Sc:()=>S,U3:()=>N,V3:()=>D,Ws:()=>W,Xn:()=>s,YL:()=>re,Ze:()=>Y,Zy:()=>p,_3:()=>B,_F:()=>Z,_h:()=>G,ah:()=>j,b8:()=>U,bR:()=>M,cQ:()=>c,c_:()=>b,dE:()=>K,dG:()=>g,fy:()=>u,gR:()=>T,h:()=>x,jG:()=>F,jK:()=>L,n3:()=>v,nQ:()=>V,oq:()=>_,qW:()=>Q,qg:()=>C,sF:()=>h,v3:()=>q,v9:()=>I,vJ:()=>P,wH:()=>X,wg:()=>A,yw:()=>J});n(757658);var o=n(730120),r=n(709291),i=n(401898),a=n(842875);const s=Date.UTC(2020,4,27),l={date:!0,daterange:!0,datetime:!0,datetimerange:!0};function c(e){return e in l}new Date;const d=["hidden","12h","24h"],u=(0,r.defineMessages)({ll:{defaultMessage:"Full date",id:"dateHelpers.dateFormat.fullDate"},"MMM DD, YYYY":{defaultMessage:"Month Day, Year",id:"dateHelpers.dateFormat.explicitMonthDayYear"},"MM/DD/YYYY":{defaultMessage:"Month/Day/Year",id:"dateHelpers.dateFormat.monthDayYear"},"DD/MM/YYYY":{defaultMessage:"Day/Month/Year",id:"dateHelpers.dateFormat.dayMonthYear"},"YYYY/MM/DD":{defaultMessage:"Year/Month/Day",id:"dateHelpers.dateFormat.yearMonthDay"},relative:{defaultMessage:"Relative",id:"dateHelpers.dateFormat.relative"}}),p=["ll","MM/DD/YYYY","DD/MM/YYYY","YYYY/MM/DD","relative"],m="09:00",g=[void 0,{unit:"minute",value:0},{unit:"minute",value:5},{unit:"minute",value:10},{unit:"minute",value:15},{unit:"minute",value:30},{unit:"hour",value:1},{unit:"hour",value:2},{unit:"day",value:1,time:m,defaultTimeZone:(0,a.r)()},{unit:"day",value:2,time:m,defaultTimeZone:(0,a.r)()}],f=[void 0,{unit:"day",value:0,time:m,defaultTimeZone:(0,a.r)()},{unit:"day",value:1,time:m,defaultTimeZone:(0,a.r)()},{unit:"day",value:2,time:m,defaultTimeZone:(0,a.r)()},{unit:"week",value:1,time:m,defaultTimeZone:(0,a.r)()}],h="ll",v=" ",y=(0,r.defineMessages)({"12h":{defaultMessage:"12 hour",id:"dateHelpers.12hourTimeFormat"},"24h":{defaultMessage:"24 hour",id:"dateHelpers.24hourTimeFormat"},hidden:{defaultMessage:"Hidden",id:"dateHelpers.hiddenTimeFormat"}}),b="LT";function _(e){return"en-US"===e?"DD":"D"}const S="t",k={year:!1,month:!1,week:!1,day:!1,hour:!0,minute:!0};function w(e){return"date"===e.type}function x(e){return Boolean("daterange"===e.type&&e.start_date&&e.end_date)}function I(e){return"datetime"===e.type}function C(e){return"datetimerange"===e.type}function T(e){return"daterange"===e.type}function M(e){return!!x(e)||!!C(e)}function P(e){return!k[e.unit]}function A(e,t){return P(e)?e:{unit:"day",value:0,time:m,defaultTimeZone:t}}function R(e){return P(e)&&0===e.value?{unit:"minute",value:0}:e}function D(e){if(e&&("date"===e.type||"daterange"===e.type))return e.reminder}function B(e){if(e&&("datetime"===e.type||"datetimerange"===e.type))return e.reminder}function E(e){return"datetime"===e.type?{type:"date",start_date:e.start_date}:"datetimerange"===e.type?{type:"daterange",start_date:e.start_date,end_date:e.end_date}:e}function F(e){switch(e){case"DD/MM/YYYY":return"dd/MM/yyyy";case"MM/DD/YYYY":return"MM/dd/yyyy";case"YYYY/MM/DD":return"yyyy/MM/dd";case"MMM DD, YYYY":return"MMM dd, yyyy";default:return"DDD"}}function Z(e){switch(e){case"h:mm A":return"h:mm a";case"H:mm":return"H:mm";case"A h:mm":return"a h:mm";case v:return v;default:return"t"}}function U(e,t,n,o){return Boolean(V(e,t,n)||o&&(V(n,o,e)||V(n,o,t)))}function V(e,t,n){return n>=e&&n<=t}function N(e){const t=e;return Boolean(t&&t.type&&t.start_date)}function O(e,t){return!(e.type!==t.type||e.start_date!==t.start_date||"start_time"in e&&"start_time"in t&&(null==e?void 0:e.start_time)!==(null==t?void 0:t.start_time)||"end_date"in e&&"end_date"in t&&(null==e?void 0:e.end_date)!==(null==t?void 0:t.end_date)||"end_time"in e&&"end_time"in t&&(null==e?void 0:e.end_time)!==(null==t?void 0:t.end_time)||"time_zone"in e&&"time_zone"in t&&(null==e?void 0:e.time_zone)!==(null==t?void 0:t.time_zone))}const L="HH:mm",j="en",K=/(.+) \((.+)\)/;function z(e){return{type:"date",start_date:e.start_date,reminder:e.reminder}}function q(e){return{type:"date",start_date:e.end_date,reminder:e.reminder}}function H(e){return{type:"datetime",start_date:e.start_date,start_time:e.start_time,time_zone:e.time_zone,reminder:e.reminder}}function G(e){return{type:"datetime",start_date:e.end_date,start_time:e.end_time,time_zone:e.time_zone,reminder:e.reminder}}function W(e){return"daterange"===e.type?z(e):"datetimerange"===e.type?H(e):e}function $(e){return"daterange"===e.type?q(e):"datetimerange"===e.type?G(e):e}function Y(e){if("datetime"===e.type||"datetimerange"===e.type)return e.time_zone}function Q(e){return"daterange"===e.type&&e.start_date===e.end_date?{type:"date",start_date:e.start_date,reminder:e.reminder}:"datetimerange"===e.type&&e.start_date===e.end_date&&e.start_time===e.end_time?{type:"datetime",start_date:e.start_date,start_time:e.start_time,reminder:e.reminder,time_zone:e.time_zone}:e}function J(e){if("datetime"===e.type||"datetimerange"===e.type)return e.time_zone}function X(e){const{locale:t}=e,n=[],o=new Intl.DateTimeFormat(t,{month:"long"});for(let r=1;r<13;r++){const e=new Date(Date.UTC(2021,r,0)),t=o.format(e);n.push(t)}return n}function ee(e){if(e.start_date&&e.end_date){return{type:"range",value:{type:"daterange",start_date:e.start_date,end_date:e.end_date}}}if(e.start_date){return{type:"starting",value:{type:"date",start_date:e.start_date}}}if(e.end_date){return{type:"ending",value:{type:"date",start_date:e.end_date}}}}function te(e){return"datetime"===e.type?{type:"date",start_date:e.start_date}:"datetimerange"===e.type?{type:"daterange",start_date:e.start_date,end_date:e.end_date}:e}function ne(e){return"date"===e.type?{type:"daterange",start_date:e.start_date}:"daterange"===e.type?e:"datetime"===e.type?{type:"daterange",start_date:e.start_date}:"datetimerange"===e.type?{type:"daterange",start_date:e.start_date,end_date:e.end_date}:(0,i.t1)(e)}function oe(e){const t=e??new Date;return Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds())}function re(e){const t=o.ou.fromMillis(e).setZone("UTC");return new Date(t.year,t.month-1,t.day,t.hour,t.minute,t.second).getTime()}},407057:(e,t,n)=>{n.d(t,{$6:()=>P,$I:()=>M,$b:()=>R,Cp:()=>C,IV:()=>y,LU:()=>b,OB:()=>u,RY:()=>d,Yx:()=>T,ZV:()=>c,ZW:()=>I,er:()=>S,kv:()=>k,mr:()=>g,ns:()=>h,p6:()=>m,tv:()=>A,vI:()=>w,xE:()=>f});var o=n(730120),r=n(401898),i=n(842875),a=n(924211),s=n(640506),l=n(253877);function c(e){return u({...e,formatValuesFn:e=>{const{endDate:t,endTime:n,startDate:o}=e;return(0,r.$K)(n)?`${o} → ${n}`:(0,r.$K)(t)?`${o} → ${t}`:o}})}function d(e,t){const{start:n,end:o}=l.NK(e,t);return(0,r.$K)(o)?`${n.toISO()} → ${o.toISO()}`:n.toISO()}function u(e){const{value:t,shortenDateAndRange:n,allowRelativeDates:r,date_format:a,time_format:c,intl:d,alwaysIncludeTimezone:u,formatValuesFn:m,getToday:g}=e,{locale:h}=d,y=e.userTimeZone&&function(e){if(e in p)return p[e];try{Intl.DateTimeFormat(void 0,{timeZone:e})}catch(t){return p[e]=!1,!1}return p[e]=!0,!0}(e.userTimeZone)?e.userTimeZone:(0,i.r)(),b=l.NK(t,y,h),_=Boolean(n),S=a??s.sF,k="date"===t.type||"daterange"===t.type,w=!k&&e.displayInUserTimezone,x=w?b.start.setZone(y):b.start,I=b.end&&w?b.end.setZone(y):b.end,C=x.toLocaleString(o.ou.DATE_SHORT).startsWith(String(x.year)),T=v({date:x,dateFormat:S,timeFormat:c,shortenDate:_,allowRelativeDates:r,userTimeZone:y,intl:d,hasRangeDate:C?void 0:I,excludeTime:k,alwaysIncludeTimezone:u,getToday:g});if(I){if("datetimerange"===t.type&&x.startOf("day").equals(I.startOf("day"))){return m({endTime:f({dateTime:I,timeFormat:c,humanReadable:!1}),startDate:T})}return m({endDate:v({date:I,dateFormat:S,timeFormat:c,shortenDate:_,allowRelativeDates:r,userTimeZone:y,intl:d,hasRangeDate:C?x:void 0,excludeTime:k,alwaysIncludeTimezone:u,getToday:g}),startDate:T})}return m({startDate:T})}const p={};function m(e){const{date:t,dateFormat:n,allowRelativeDates:r,shortenDate:i,hasRangeDate:a,intl:c,getToday:d}=e;return r&&"relative"===n?function(e){const{date:t,intl:n}=e,o=e.getToday??l.Uu,r=o(t.zone),i=Math.round(t.startOf("day").diff(r,"days").get("days"));if(0===i)return n.formatMessage({defaultMessage:"Today",id:"dateFormatHelpers.text.today"});if(1===i)return n.formatMessage({defaultMessage:"Tomorrow",id:"dateFormatHelpers.text.tomorrow"});if(-1===i)return n.formatMessage({defaultMessage:"Yesterday",id:"dateFormatHelpers.text.yesterday"});const a=t.toLocaleString({weekday:"long"});if(i>1&&i<=7)return t.weekNumber===r.weekNumber?a:n.formatMessage({defaultMessage:"Next {dayOfTheWeek}",id:"dateFormatHelpers.text.nextDayOfTheWeek"},{dayOfTheWeek:a});if(i<-1&&i>=-7)return t.weekNumber===r.weekNumber?a:n.formatMessage({defaultMessage:"Last {dayOfTheWeek}",id:"dateFormatHelpers.text.lastDayOfTheWeek"},{dayOfTheWeek:a});return I(t,"long")}({date:t,intl:c,getToday:d}):function(e){const{date:t,dateFormat:n,shortenDate:r,hasRangeDate:i}=e,a=function(e){const t="relative"===e.dateFormat||"MMM DD, YYYY"===e.dateFormat?s.sF:e.dateFormat;return s.jG(t)}({dateFormat:n});if("DDD"===a){const e=r&&(!i&&t.year===o.ou.now().year||t.year===(null==i?void 0:i.year));return t.toLocaleString({year:e?void 0:"numeric",month:r?"short":"long",day:"numeric"})}return t.toFormat(a)}({date:t,dateFormat:n,shortenDate:i,hasRangeDate:a})}function g(e){const{time_format:t}=e,n=Boolean(e.humanReadable);return f({dateTime:o.ou.fromFormat(e.start_time,s.jK).setLocale(e.intl.locale),timeFormat:t,humanReadable:n})}function f(e){const{dateTime:t,humanReadable:n,timeFormat:r}=e;if(n&&"h:mm A"===r){return t.toLocaleString(o.ou.TIME_SIMPLE).replace(" ","").toLowerCase()}if(r){const e=s._F(r);return t.toFormat(e)}return t.toLocaleString(o.ou.TIME_SIMPLE)}function h(e){const{time_format:t,intl:n,start_time:r,end_time:i,humanReadable:a}=e;let l=o.ou.fromFormat(r,s.jK).setLocale(n.locale).toFormat(s._F(t)),c=o.ou.fromFormat(i,s.jK).setLocale(n.locale).toFormat(s._F(t));return a&&"h:mm A"===t&&((l.includes("AM")&&c.includes("AM")||l.includes("PM")&&c.includes("PM"))&&(l=l.replace("AM","").replace("PM","")),l.includes(":00")&&c.includes(":00")&&(l=l.replace(":00",""),c=c.replace(":00","")),l=l.replace(" ","").toLowerCase(),c=c.replace(" ","").toLowerCase()),[l,c].join("-")}function v(e){const{date:t,dateFormat:n,timeFormat:o,userTimeZone:r,excludeTime:i,alwaysIncludeTimezone:a}=e;if(!t.isValid)return"";const s=m(e);if(i)return s;const c=[s,f({dateTime:t,timeFormat:o,humanReadable:"relative"===n})].join(" "),d=t.setZone(r);if(a||t.toFormat(l._F)!==d.toFormat(l._F)){return`${c} (${t.toFormat("ZZZZ")})`}return c}function y(e,t){const n=e.years;if(n&&n>=1)return t.formatMessage({defaultMessage:"{number, plural, one {{number} year} other {{number} years}}",id:"dateFormatHelpers.formatDuration.years"},{number:_(n)});const o=e.months||e.month;if(o&&o>=1)return t.formatMessage({defaultMessage:"{number, plural, one {{number} month} other {{number} months}}",id:"dateFormatHelpers.formatDuration.months"},{number:_(o)});const r=e.days||e.day;if(r&&r>=1)return t.formatMessage({defaultMessage:"{number, plural, one {{number} day} other {{number} days}}",id:"dateFormatHelpers.formatDuration.days"},{number:Math.round(r)});const i=e.hours||e.hour;if(i&&i>=1)return t.formatMessage({defaultMessage:"{number, plural, one {{number} hour} other {{number} hours}}",id:"dateFormatHelpers.formatDuration.hours"},{number:Math.round(i)});const a=e.minutes||e.minute||0;return t.formatMessage({defaultMessage:"{number, plural, one {{number} minute} other {{number} minutes}}",id:"dateFormatHelpers.formatDuration.minutes"},{number:Math.round(a)})}function b(e,t,n){const o=l.NK(e,t);if(l.qw(o)){const e=o.end.diff(o.start),t=e.as("year");if(t>=1)return y({years:_(t)},n);const r=e.as("months");if(r>=1)return y({months:_(r)},n);const i=e.as("days");if(i>=1)return y({days:Math.round(i)},n);const a=e.as("hours");if(a>=1)return y({hours:Math.round(a)},n);const s=e.as("minutes");return y({minutes:Math.round(s)},n)}return""}function _(e){return Math.round(10*e)/10}function S(e,t){const n=o.ou.local().setLocale((0,a.E2)(e)).set({weekday:t});if(n.isValid)return n.toFormat("ccccc")}function k(e,t){return(1===e?[1,2,3,4,5,6,7]:[7,1,2,3,4,5,6]).map((e=>[e,o.ou.fromObject({weekday:e}).setLocale(t).toLocaleString({weekday:"short"})]))}function w(e){return[1,2,3,4,5].map((t=>[t,o.ou.fromObject({weekday:t}).setLocale(e).toLocaleString({weekday:"short"})]))}const x={very_short:{year:"2-digit",month:"numeric",day:"numeric"},short:o.ou.DATE_SHORT,short2:{year:"numeric",month:"2-digit",day:"2-digit"},medium:o.ou.DATE_MED,medium_with_time:o.ou.DATETIME_MED,long:o.ou.DATE_FULL,day:{day:"numeric"},month_long:{month:"long"},month_short:{month:"short"},month_day:{day:"numeric",month:"short"},month_day_time:{day:"numeric",month:"short",hour:"numeric",minute:"numeric"},month_day_long:{day:"numeric",month:"long"},month_year_long:{month:"long",year:"numeric"},month_year_short:{month:"short",year:"numeric"},time:{hour:"numeric",minute:"numeric"}};function I(e,t,n){return(n?e.setLocale(n):e).toLocaleString(x[t])}function C(e,t){return"YYYY-MM-DD"===t?e.toISODate():e.toFormat(s.jG(t))}function T(e,t,n,r){return I(o.ou.fromMillis(e,{locale:n,zone:r}),t)}function M(e){return o.ou.fromMillis(e).toUTC().toISO({format:"extended"})}function P(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?o.ou.fromMillis(e).toUTC():o.ou.fromMillis(e)).toISODate({format:"extended"})}function A(e,t){return o.ou.fromMillis(e,{locale:t}).toRelative()??""}function R(e,t,n,r,i){const a=o.ou.now().startOf("day"),s=o.ou.fromMillis(e,{locale:t}),l=Math.round(s.startOf("day").diff(a,"days").as("days")),c=s.toLocaleString(o.ou.TIME_SIMPLE),d=i||"medium_with_time";if(r){if(0===l)return n.formatMessage({defaultMessage:"Today {delimiter} {time}",id:"dateFormatHelpers.formatMillisToCalendar.todayDelimiter"},{delimiter:r,time:c});if(-1===l)return n.formatMessage({defaultMessage:"Yesterday {delimiter} {time}",id:"dateFormatHelpers.formatMillisToCalendar.yesterdayDelimiter"},{delimiter:r,time:c});const e=I(s,d);return n.formatMessage({defaultMessage:"{formattedDate} {delimiter} {time}",id:"dateFormatHelpers.formatMillisToCalendar.customDelimiter"},{formattedDate:e,delimiter:r,time:c})}return 0===l?n.formatMessage({defaultMessage:"Today at {time}",id:"dateFormatHelpers.formatMillisToCalendar.todayAt"},{time:c}):-1===l?n.formatMessage({defaultMessage:"Yesterday at {time}",id:"dateFormatHelpers.formatMillisToCalendar.yesterdayAt"},{time:c}):I(s,d)}},253877:(e,t,n)=>{n.d(t,{BC:()=>f,Bn:()=>X,CQ:()=>B,Cv:()=>I,DF:()=>V,Dp:()=>S,IS:()=>ie,Id:()=>Q,Iq:()=>l,KR:()=>ye,Kq:()=>k,Kw:()=>ce,LH:()=>E,LY:()=>te,Lg:()=>b,ME:()=>D,NJ:()=>x,NK:()=>K,Nm:()=>be,OQ:()=>_e,Oo:()=>C,Qq:()=>W,RN:()=>ue,R_:()=>A,Ro:()=>_,Sv:()=>ve,Sy:()=>N,TE:()=>ne,Ty:()=>le,Uu:()=>y,V7:()=>se,XI:()=>$,Xh:()=>J,Xz:()=>me,Y3:()=>ee,YC:()=>ke,Y_:()=>pe,_:()=>ge,_F:()=>u,aN:()=>Se,b8:()=>M,bD:()=>L,c$:()=>he,dj:()=>T,em:()=>re,er:()=>fe,fZ:()=>F,gQ:()=>ae,gW:()=>G,hT:()=>R,iC:()=>Z,kT:()=>v,kl:()=>de,nD:()=>w,qw:()=>z,rH:()=>Y,uO:()=>H,us:()=>oe,vz:()=>q,x7:()=>p,zw:()=>h});n(21703);var o=n(730120),r=n(401898),i=n(619584),a=n(842875),s=n(640506);const l="yyyy-MM-dd",c=/^(\d{4})-(\d{2})-(\d{2})$/,d=/^(\d{2}):(\d{2})$/,u="yyyy-MM-dd HH:mm",p=(0,a.r)();function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return e<0?`-${(-e).toString().padStart(t,"0")}`:e.toString().padStart(t,"0")}const g="Invalid DateTime";function f(e){return e.isValid?`${m(e.year,4)}-${m(e.month,2)}-${m(e.day,2)}`:g}function h(e){return e.isValid?`${m(e.hour,2)}:${m(e.minute,2)}`:g}function v(e){const t=e.date??Date.now(),n=e.timezone??p;return o.ou.fromMillis(t,{zone:n})}function y(e){return o.ou.now().setZone(e).startOf("day")}function b(e){return{type:"date",start_date:f(y(e))}}function _(e){return{type:"date",start_date:f(y(e).plus({days:1}))}}function S(e){const t=y(e),n=t.startOf("week");return{type:"date",start_date:f(n<=t?n.plus({week:1}):n)}}function k(e){return{type:"date",start_date:f(y(e).plus({weeks:1}))}}function w(e){return{type:"date",start_date:f(y(e).plus({months:1}))}}function x(e){return{type:"date",start_date:f(y(e).plus({years:1}))}}function I(e){return{type:"date",start_date:f(y(e).minus({days:1}))}}function C(e){return{type:"date",start_date:f(y(e).minus({week:1}))}}function T(e){return{type:"date",start_date:f(y(e).minus({months:1}))}}function M(e){return{type:"date",start_date:f(y(e).minus({years:1}))}}const P=new Map;function A(e){const t=P.get(e),n=Math.floor(Date.now()/i.hM);if(void 0!==t&&n===t[0])return t[1];const r=function(e){const t=o.ou.now().setZone(e);return{type:"datetime",start_date:f(t),start_time:h(t),time_zone:e}}(e);return P.set(e,[n,r]),r}function R(e,t){return D(o.ou.fromMillis(e,{zone:t}))}function D(e){return{type:"date",start_date:f(e)}}function B(e,t){return E(o.ou.fromMillis(e,{zone:t}))}function E(e){return{type:"datetime",start_date:f(e),start_time:h(e),time_zone:e.zoneName}}function F(e,t,n){const r=o.ou.fromMillis(e,{zone:n}),i=o.ou.fromMillis(t,{zone:n});return{type:"daterange",start_date:f(r),end_date:f(i)}}function Z(e,t,n){const r=o.ou.fromMillis(e,{zone:n}),i=o.ou.fromMillis(t,{zone:n});return{type:"datetimerange",start_date:f(r),start_time:h(r),end_date:f(i),end_time:h(i),time_zone:n}}function U(e){const t=c.exec(e.start_date);if(t){const[,e,n,o]=t;return[+e,+n,+o]}}function V(e,t,n){const r=U(e);return void 0!==r?o.ou.local(r[0],r[1],r[2],{zone:t,locale:n||s.ah}):o.ou.invalid("unparsable",`the input "${e.start_date}" can't be parsed as format ${l}`)}function N(e,t){const n=U(e),r=function(e){const t=d.exec(e.start_time);if(t){const[,e,n]=t;return[+e,+n]}}(e);if(void 0!==n&&void 0!==r)return o.ou.local(n[0],n[1],n[2],r[0],r[1],{locale:t||s.ah,zone:e.time_zone});const i=`${e.start_date} ${e.start_time}`,a=`${l} ${s.jK}`;return o.ou.invalid("unparsable",`the input "${i}" can't be parsed as format ${a}`)}function O(e,t){return B(V(e,t).toMillis(),t)}function L(e,t){const n=K(e,t);return Z(n.start.valueOf(),n.end.endOf("day").valueOf(),t)}const j=new WeakMap;function K(e,t,n){var o;const r=void 0!==n?`${t}-${n}`:t;let i=null===(o=j.get(e))||void 0===o?void 0:o[r];if(void 0===i){i=function(e,t,n){return"datetimerange"===e.type?{start:N((0,s.C1)(e),n),end:N((0,s._h)(e),n)}:"datetime"===e.type?{start:N(e,n)}:"daterange"===e.type?{start:V((0,s.Nh)(e),t,n),end:V((0,s.v3)(e),t,n)}:{start:V(e,t,n)}}(e,t,n);const o=j.get(e);void 0===o?j.set(e,{[r]:i}):o[r]=i}return i}function z(e){return Boolean(e.end)}function q(e){const{previous:t,updatedStartTime:n}=e,o=function(e){const t=K(e,(0,a.r)());return t.end.diff(t.start)}(t),r=N({type:"datetime",start_date:t.start_date,start_time:n,time_zone:t.time_zone}),i=r.plus(o);return{newDate:{...t,start_time:e.updatedStartTime,end_date:f(i),end_time:h(i)},currentMonth:r}}function H(e,t){return K(e,t).start.valueOf()}function G(e){if("date"===e.type||"datetime"===e.type)return e;{const t=K(e,(0,a.r)());return t.end&&t.start>t.end?"daterange"===e.type?{...e,start_date:e.end_date}:{...e,start_date:e.end_date,start_time:e.end_time}:e}}function W(e){if("date"===e.type||"datetime"===e.type)return e;{const t=K(e,(0,a.r)());return t.end&&t.end<t.start?"daterange"===e.type?{...e,end_date:e.start_date}:{...e,end_date:e.start_date,end_time:e.start_time}:e}}function $(e){if((0,s.bR)(e)){const t=K(e,(0,a.r)());return function(e){return e.start.isValid&&void 0!==e.end&&e.end.isValid&&e.start<=e.end}(t)?t:void 0}return K(e,(0,a.r)())}function Y(e,t){if(e&&t){const n=(0,s.Ws)(e),o=(0,s.Ws)(t);if("datetime"===n.type){const e="datetime"===o.type?o:O(o,n.time_zone);return{type:"datetimerange",start_date:n.start_date,start_time:n.start_time,end_date:e.start_date,end_time:e.start_time,time_zone:n.time_zone}}if("datetime"===o.type){const e=O(n,o.time_zone);return{type:"datetimerange",start_date:e.start_date,start_time:e.start_time,end_date:o.start_date,end_time:o.start_time,time_zone:o.time_zone}}return{type:"daterange",start_date:n.start_date,end_date:o.start_date}}return e?(0,s.Ws)(e):t?(0,s.Ws)(t):void 0}function Q(e){if("exact"===e.type)return e.value&&{type:"date",start_date:e.value.start_date};switch(e.value){case"today":return b((0,a.r)());case"tomorrow":return _((0,a.r)());case"yesterday":return I((0,a.r)());case"one_month_ago":return T((0,a.r)());case"one_month_from_now":return w((0,a.r)());case"one_week_ago":return C((0,a.r)());case"one_week_from_now":return k((0,a.r)());default:(0,r.t1)(e)}}function J(e){const{firstDate:t,secondDate:n}=e;return o.ou.fromMillis(t).hasSame(o.ou.fromMillis(n),"year")}function X(e){const{firstDate:t,secondDate:n}=e;return o.ou.fromMillis(t).hasSame(o.ou.fromMillis(n),"month")}function ee(e){return o.ou.fromMillis(e).hasSame(o.ou.local(),"day")}function te(e){const t=o.ou.fromMillis(e);return 6===t.weekday||7===t.weekday}function ne(e){return o.ou.fromMillis(e).day}function oe(e){return o.ou.fromMillis(e).endOf("day").valueOf()}function re(e,t,n){const r=o.ou.fromMillis(e,{zone:n});if(7===r.weekday&&0===t)return r.startOf("day");const i=r.startOf("week");return 0===t?i.minus({days:1}).startOf("day"):i.startOf("day")}function ie(e,t){return re(e,t,(0,a.r)()).valueOf()}function ae(e,t,n){const r=o.ou.fromMillis(e,{zone:n});if(7===r.weekday&&0===t)return r.plus({days:6}).endOf("day");const i=r.endOf("week");return 0===t?i.minus({days:1}).endOf("day"):i.endOf("day")}function se(e,t){return ae(e,t,(0,a.r)()).valueOf()}function le(e,t,n){const r=o.ou.fromMillis(e,{zone:n});if(1===r.weekday)return r.startOf("day");const i=re(e,t,n);return 1===t?i.startOf("day"):i.plus({days:1})}function ce(e,t,n){const r=o.ou.fromMillis(e,{zone:n});if(5===r.weekday)return r.endOf("day");if(6===r.weekday)return r.minus({days:1}).endOf("day");if(1===t){return re(e,t,n).plus({days:4}).endOf("day")}return re(e,t,n).plus({days:5}).endOf("day")}function de(e){return o.ou.fromMillis(e).startOf("month").valueOf()}function ue(e){return o.ou.fromMillis(e).endOf("month").valueOf()}function pe(e,t){const n=K(e,t);return{start:n.start.valueOf(),end:n.end?n.end.valueOf():void 0}}function me(e){const{date:t,daysToAdd:n}=e;return o.ou.fromMillis(t).plus({days:n}).valueOf()}function ge(e){const{date:t,monthsToAdd:n}=e;return o.ou.fromMillis(t).plus({months:n}).valueOf()}function fe(e){return o.ou.local({zone:e}).toFormat("ZZZZ")}function he(e,t){if("date"===e.type||"daterange"===e.type)return e;const n=K(e,t),o=n.start.setZone(t),r={type:"datetime",start_date:f(o),start_time:h(o),time_zone:t,reminder:e.reminder};if("datetimerange"===e.type){if(!n.end)throw new Error("Datetimerange with no end.");const e=n.end.setZone(t);return{...r,type:"datetimerange",end_date:f(e),end_time:h(e)}}return r}function ve(e,t){var n,o;return(null==e||null===(n=e.settings)||void 0===n?void 0:n.time_zone)||(null==t||null===(o=t.settings)||void 0===o?void 0:o.time_zone)||(0,a.r)()}function ye(e,t){if(!e.reminder)return;const n=K(e,t).start,{unit:o,value:r}=e.reminder;return n.minus({[o]:r})}function be(e,t){const n=ye(e,t);return!!n&&n<=o.ou.now()}const _e={toPersistedDate:function(e){return R(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,a.r)())},toPersistedDateTime:function(e){return B(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,a.r)())},toPersistedDateRange:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,a.r)();return{type:"daterange",start_date:f(t?e.start.setZone(t):e.start),end_date:f(t?e.end.setZone(t):e.end)}},toPersistedDateTimeRange:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,a.r)();const n=e.start.setZone(t),o=e.end.setZone(t);return{type:"datetimerange",start_date:f(n),start_time:h(n),end_date:f(o),end_time:h(o),time_zone:t}},toPersistedDateWithType(e,t,n){if("daterange"===t||"datetimerange"===t){return("daterange"===t?_e.toPersistedDateRange:_e.toPersistedDateTimeRange)({start:e.start,end:e.end},n)}if("date"===t||"datetime"===t){return("date"===t?_e.toPersistedDate:_e.toPersistedDateTime)(e.start.valueOf(),n)}(0,r.t1)(t)},toUnixMs:e=>N(e).valueOf(),isoToUnixMs:(e,t)=>{const n=o.ou.fromISO(e,{zone:t});if(n.isValid)return n.valueOf()},jsDateToLuxon:e=>o.ou.fromJSDate(e),notionDateToLuxon:(e,t)=>{const{timeZone:n=(0,a.r)(),locale:r}=t??{};return o.ou.fromISO(e.start_date,{zone:n,locale:r})},notionDateTimeToLuxon:(e,t)=>N(e,t),notionDateOrDateTimeToLuxon:(e,t)=>"date"===e.type?_e.notionDateToLuxon(e,t):"datetime"===e.type?_e.notionDateTimeToLuxon(e,null==t?void 0:t.locale):void(0,r.t1)(e),notionDateToJsDate:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,a.r)();return _e.notionDateToLuxon(e,{timeZone:t}).toJSDate()}};function Se(){return 0}function ke(e){return e.weekday%7}},484795:(e,t,n)=>{n.d(t,{$v:()=>Ae,CR:()=>Ce,Ki:()=>De,OD:()=>Se,PG:()=>we,St:()=>ve,TD:()=>be,UL:()=>Ne,_1:()=>ke,cg:()=>ye,f_:()=>Pe,iZ:()=>Ie,jV:()=>xe,uy:()=>Te,wk:()=>Me});n(21703),n(252262),n(324506);var o=n(730120),r=n(997864),i=n.n(r),a=n(709291),s=n(653965),l=n(401898),c=n(619584),d=n(842875),u=n(924211),p=n(640506),m=n(253877);const g=(0,a.defineMessages)({now:{id:"dateParserHelpers.now",defaultMessage:"now"},remind:{id:"dateParserHelpers.remind",defaultMessage:"remind"},me:{id:"dateParserHelpers.me",defaultMessage:"me"},at:{id:"dateParserHelpers.at",defaultMessage:"at"},todayShort:{id:"dateParserHelpers.today.short",defaultMessage:"td"},today:{id:"dateParserHelpers.today",defaultMessage:"today"},tomorrowShort:{id:"dateParserHelpers.tomorrow.short",defaultMessage:"tm"},tomorrow:{id:"dateParserHelpers.tomorrow",defaultMessage:"tomorrow"},yesterdayShort:{id:"dateParserHelpers.yesterday.short",defaultMessage:"yd"},yesterday:{id:"dateParserHelpers.yesterday",defaultMessage:"yesterday"},last:{id:"dateParserHelpers.last",defaultMessage:"last"},next:{id:"dateParserHelpers.next",defaultMessage:"next"},month:{id:"dateParserHelpers.month",defaultMessage:"month"},year:{id:"dateParserHelpers.year",defaultMessage:"year"},day:{id:"dateParserHelpers.day",defaultMessage:"day"}}),f="_";Symbol("TokenParser");function h(){return o.ou.now().set({hour:9}).toFormat("a")}function v(){return o.ou.now().set({hour:14}).toFormat("a")}function y(e){const t=o.ou.fromObject(e);if(t.isValid)return t}function b(e){return i().succeed(null).chain(e)}const _=!1;function S(e){return t=>i().custom(((n,o)=>(o,r)=>(_&&(console.info(e),console.info("input:",o),console.info("start:",`${Array(r).fill(" ").join("")}^`),console.info(JSON.stringify(t,void 0,2))),n(r,t))))}function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return i().custom(((n,o)=>(r,i)=>{let a=0;if((0,u.og)(r)!==r)throw new Error("You need to simplify input before parsing!");const s=r,l=(0,u.og)(e);for(;a<l.length&&s.charAt(i+a)===l.charAt(a);)a++;return a>=t?n(i+a,s.slice(i,i+a)):o(i,`Expected prefix of '${l}'`)}))}const w=i().alt(i().regex(/\s+/),i().eof),x=i().regex(/[\.\/]/),I=i().alt(x,i().eof),C=i().regex(/[\s\,]+/),T=i().alt(C,i().eof),M=i().regex(/\s*[-→~]\s*/),P=i().string(":");function A(e){return i().optWhitespace.then(i().alt(i().string((0,u.$7)().formatMessage(g.at)),i().string(e.formatMessage(g.at)),i().string(","),i().succeed(""))).then(i().optWhitespace)}const R=i().regex(/[0-9]+/),D=i().regex(/[0-2]?[0-9]/),B=i().alt(w,M,R),E=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],F=p.wH((0,u.$7)());function Z(e,t){const n=parseInt(e,10);if((0,c.hj)(n)){const e=Math.abs(n);return e<12&&t.length>0&&(0,u.og)(t)===(0,u.og)(v())?e+12:12===e&&t.length>0&&(0,u.og)(t)===(0,u.og)(h())?0:e}return function(e){return e&&(0,u.og)(e)===(0,u.og)(v())?18:9}(t)}function U(e){const t=parseInt(e,10);if((0,c.hj)(t)){const e=Math.abs(t);if(e<69)return 2e3+e;if(e<100)return 1900+e;if(e>=1e3)return e}}function V(e){const t=parseInt(e,10);if((0,c.hj)(t)){const e=Math.abs(t);if(e<=12)return e}}function N(e){const t=parseInt(e,10);if((0,c.hj)(t)){const e=Math.abs(t);if(e<=31)return e}}const O=b((()=>{const e=h();return i().alt(k("am").lookahead(B),k(e).lookahead(B)).result(e)})),L=b((()=>{const e=o.ou.now().set({hour:15}).toFormat("a");return i().alt(k("pm").lookahead(B),k(e).lookahead(B)).result(e)})),j=i().alt(O,L),K=i().seqMap(D,P.times(0,1),R.times(0,1),i().optWhitespace,j.times(0,1),((e,t,n,o,r)=>({hour:e,minute:n[0]||"",meridian:r[0]||""}))),z=i().seqMap(j,i().optWhitespace,D.times(0,1),P.times(0,1),R.times(0,1),((e,t,n,o,r)=>({meridian:e,hour:n[0],minute:r[0]}))),q=i().alt(K,z).chain((e=>{let{hour:t,minute:n,meridian:r}=e;const a=Z(t,r),s=function(e){const t=parseInt(e,10);if((0,c.hj)(t)){const e=Math.abs(t);return e>59?0:e}return 0}(n),l=o.ou.fromObject({hour:a,minute:s});if(!l.isValid)return r?i().succeed({type:"time",time:o.ou.now().toFormat(p.jK),hasAmPm:!0}):i().fail("Invalid time");const d={type:"time",time:l.toFormat(p.jK),hasAmPm:r.length>0};return i().succeed(d)})).notFollowedBy(x).chain(S("parseTime")),H=q.chain((e=>{const t=M.then(q).map((t=>{if(e.hasAmPm){if(t.hasAmPm){return{type:"timerange",start:e.time,end:t.time}}const n=o.ou.fromFormat(e.time,p.jK),r=o.ou.fromFormat(t.time,p.jK);if(n>r&&r.hour<12){const t=r.plus({hour:12}).toFormat(p.jK);return{type:"timerange",start:e.time,end:t}}return{type:"timerange",start:e.time,end:t.time}}if(t.hasAmPm){const n=o.ou.fromFormat(e.time,p.jK),r=o.ou.fromFormat(t.time,p.jK);if(n.hour+12<r.hour){return{type:"timerange",start:n.plus({hour:12}).toFormat(p.jK),end:t.time}}}return{type:"timerange",start:e.time,end:t.time}})).chain(S("parseTimeRange"));return i().alt(t,i().succeed(e))})).chain(S("parseTimeOrTimeRange"));function G(e){return i().alt(...pe(e,g.todayShort,g.today)).map((()=>({type:"date",start_date:o.ou.now().toFormat(m.Iq)})))}function W(e){return i().alt(...pe(e,g.tomorrowShort,g.tomorrow)).map((()=>({type:"date",start_date:o.ou.now().plus({day:1}).toFormat(m.Iq)})))}function $(e){return i().alt(...pe(e,g.yesterdayShort,g.yesterday)).map((()=>({type:"date",start_date:o.ou.now().minus({day:1}).toFormat(m.Iq)})))}const Y=b((()=>{const e=o.kI.weekdays(),t=s.$R(E,e);return i().alt(...t.map(((e,t)=>{let[n,r]=e;return i().alt(k(n).lookahead(B),k(r).lookahead(B)).map((()=>{const e=o.ou.now(),n=e.set({weekday:t+1});return{type:"date",start_date:(n.weekday===e.weekday?n.plus({week:1}):n).toFormat(m.Iq)}})).chain(S("daysOfWeek"))})))}));function Q(e,t,n){const o=i().alt(...t.map(((t,o)=>{let[r,a]=t;return i().alt(k((0,u.$7)().formatMessage(n)),k(e.formatMessage(n))).then(i().optWhitespace).then(i().alt(k(r).lookahead(B),k(a).lookahead(B))).map((()=>({weekday:o+1})))}))),r=i().alt(...t.map(((t,o)=>{let[r,a]=t;return i().alt(k(r),k(a)).then(i().optWhitespace).then(i().alt(k((0,u.$7)().formatMessage(n)).lookahead(B),k(e.formatMessage(n)).lookahead(B))).map((()=>({weekday:o+1})))})));return i().alt(o,r)}function J(e){return b((()=>{const t=o.kI.weekdays(),n=s.$R(E,t);return Q(e,n,g.last).map((e=>{let{weekday:t}=e;return{type:"date",start_date:o.ou.now().set({weekday:t}).minus({week:1}).toFormat(m.Iq)}}))}))}function X(e){return i().alt(k((0,u.$7)().formatMessage(g.last)).lookahead(B),k(e.formatMessage(g.last)).lookahead(B)).then(i().optWhitespace).then(i().eof).map((()=>({type:"date",start_date:o.ou.now().minus({week:1}).toFormat(m.Iq)})))}function ee(e){return b((()=>{const t=o.kI.weekdays(),n=s.$R(E,t);return Q(e,n,g.next).map((e=>{let{weekday:t}=e;return{type:"date",start_date:o.ou.now().set({weekday:t}).plus({week:1}).toFormat(m.Iq)}}))}))}function te(e){return i().alt(k((0,u.$7)().formatMessage(g.next)).lookahead(B),k(e.formatMessage(g.next)).lookahead(B)).then(i().optWhitespace).then(i().eof).map((()=>({type:"date",start_date:o.ou.now().plus({week:1}).toFormat(m.Iq)})))}function ne(e){return i().alt(...function(e){return[G(e),W(e),$(e),J(e),ee(e),Y,te(e),X(e)]}(e)).chain(S("parseRelativeDate"))}const oe=b((()=>{const e=o.kI.months(),t=s.$R(F,e);return i().alt(...t.map(((e,t)=>{var n;let[o,r]=e;return i().alt(...[k(o).lookahead(B),null===(n=re(r))||void 0===n?void 0:n.lookahead(B)].filter(l.$K)).map((()=>t+1))})))}));function re(e){if(/^\d+/.test(e)){if(1===e.length)return;return i().string(e)}return k(e)}function ie(e,t){const n=o.ou.now(),r=n.year,i=n.minus({month:1});return o.ou.fromObject({month:e,day:t,year:r-1})>i?r-1:o.ou.fromObject({month:e,day:t,year:r})>i?r:r+1}var ae=function(e){return e[e.Year=0]="Year",e[e.Month=1]="Month",e[e.Day=2]="Day",e}(ae||{});function se(e){const t=function(e){const t=ue(e,g.year).map((e=>e.map((e=>({parsed:e,dateElementKind:ae.Year}))))),n=ue(e,g.month).map((e=>e.map((e=>({parsed:e,dateElementKind:ae.Month}))))),o=ue(e,g.day).map((e=>e.map((e=>({parsed:e,dateElementKind:ae.Day})))));return i().seqMap(R.notFollowedBy(i().alt(P,j)).skip(i().optWhitespace),i().alt(...t,...n,...o),((e,t)=>({...t,digits:e})))}(e);return t.skip(i().optWhitespace).times(1,3).map((e=>{let t,n,r;for(const o of e.flat())switch(o.dateElementKind){case ae.Year:t=U(o.digits);break;case ae.Month:n=V(o.digits);break;case ae.Day:r=N(o.digits)}r=r||1,n=n??o.ou.now().month,t=t??ie(n,r);return{type:"date",start_date:(y({year:t,month:n,day:r})??o.ou.now()).toFormat(m.Iq)}}))}const le=i().seqMap(R.notFollowedBy(i().alt(P,j)),x.notFollowedBy(i().alt(P,j)),R.times(0,1),I.times(0,1),R.times(0,1),((e,t,n,r,i)=>{const a=parseInt(e);let s,l,c;a>31?(s=U(e),n[0]&&(l=V(n[0])),i[0]&&(c=N(i[0]))):a>12||o.ou.fromISO("1990-12-28").toLocaleString(o.ou.DATE_SHORT).startsWith("28")?(c=N(e),n[0]&&(l=V(n[0])),i[0]&&(s=U(i[0]))):(l=V(e),n[0]&&(c=N(n[0])),i[0]&&(s=U(i[0]))),c=c??1,l=l??o.ou.now().month,s=s??ie(l,c);return{type:"date",start_date:(y({year:s,month:l,day:c})??o.ou.now()).toFormat(m.Iq)}})).chain(S("parseShortFormDate"));function ce(e){return i().alt(ne(e),function(e){return i().alt(se(e),i().seqMap(oe.skip(i().optWhitespace),R.notFollowedBy(i().alt(P,j)).times(0,1),T.times(0,1),R.notFollowedBy(i().alt(P,j)).times(0,1),((e,t,n,r)=>{const i=N(t[0])??1;return{type:"date",start_date:(y({year:U(r[0])??ie(e,i),month:e,day:i})??o.ou.now()).toFormat(m.Iq)}}))).chain(S("parseLongFormDate"))}(e),le)}const de=H.map((e=>{const t=(0,m.Lg)((0,d.r)());if("time"===e.type){return{type:"datetime",start_date:t.start_date,start_time:e.time,time_zone:(0,d.r)()}}return{type:"datetimerange",start_date:t.start_date,start_time:e.start,end_date:t.start_date,end_time:e.end,time_zone:(0,d.r)()}}));function ue(e,t){return[...(0,u.$7)().formatMessage(t).split(f).map((e=>k(e).lookahead(B))),...e.formatMessage(t).split(f).map((e=>k(e).lookahead(B)))]}function pe(e,t,n){const o=[...(0,u.$7)().formatMessage(t).split(f).map((e=>i().string(e))),...e.formatMessage(t).split(f).map((e=>i().string(e)))];return[...[...(0,u.$7)().formatMessage(n).split(f).map((e=>k(e).lookahead(B))),...e.formatMessage(n).split(f).map((e=>k(e).lookahead(B)))],...o]}function me(e){return i().alt(function(e){return i().alt(...ue(e,g.now)).map((()=>(0,m.R_)((0,d.r)())))}(e),de,function(e){return ce(e).skip(A(e)).chain((t=>{const n=A(e).then(H).chain(S("parseStartTimeOrTimeRange")).map((e=>"time"===e.type?{type:"datetime",start_date:t.start_date,start_time:e.time,time_zone:(0,d.r)()}:{type:"datetimerange",start_date:t.start_date,start_time:e.start,end_date:t.start_date,end_time:e.end,time_zone:(0,d.r)()})).chain((t=>{if("datetimerange"===t.type)return i().succeed(t);const n=t,o=M.then(ce(e)).chain(S("parseEndDate")).map((e=>({type:"datetimerange",start_date:n.start_date,start_time:n.start_time,end_date:e.start_date,end_time:"00:00",time_zone:(0,d.r)()}))).chain((t=>{const n=A(e).then(q).map((e=>({...t,end_time:e.time}))).chain(S("parseEndTime"));return i().alt(n,i().succeed(t))})).chain(S("parseEndDateTime"));return i().alt(o,i().succeed(n))})).chain(S("parseDateTimeOrDateTimeRange")),o=M.then(ce(e)).map((e=>({type:"daterange",start_date:t.start_date,end_date:e.start_date}))).chain(S("parseDateRange")),r={type:"date",start_date:t.start_date};return i().alt(n,o,i().succeed(r))})).chain(S("parseDateOrDateTimeOrDateTimeRange"))}(e)).map((e=>(0,m.gW)(e))).skip(M.times(0,1)).skip(C.times(0,1)).chain(S("parsePersistedDate"))}function ge(e){return i().alt(...ue(e,g.remind)).skip(function(e){return i().optWhitespace.then(i().alt(i().string((0,u.$7)().formatMessage(g.me)),i().string(e.formatMessage(g.me)),i().string(","),i().succeed(""))).then(i().optWhitespace)}(e)).chain(S("remindParser"))}function fe(e){return(t,n)=>{const r=o.Zr.defaultLocale,i=(0,u.E2)(n);o.Zr.defaultLocale=i;const a=e(n).parse((0,u.og)(t));if(o.Zr.defaultLocale=r,a.status)return a.value}}function he(e){const t=(0,m.NK)(e,(0,d.r)());return!t.start.isValid||t.end&&!t.end.isValid?i().fail("Invalid date validation"):i().succeed(e)}const ve=fe((e=>function(e){return ge(e).times(0,1).chain((t=>{let[n]=t;return me(e).times(0,1).chain((e=>{let[t]=e;if(n&&t)return t="date"===t.type||"daterange"===t.type?{...t,reminder:{unit:"day",value:0,time:p.HZ,defaultTimeZone:(0,d.r)()}}:{...t,reminder:{unit:"minute",value:0}},i().succeed(t);if(n){const e=(0,m.Ro)((0,d.r)());return e.reminder={unit:"day",value:0,time:p.HZ,defaultTimeZone:(0,d.r)()},i().succeed(e)}return t?i().succeed(t):i().fail("Failed to parse.")}))}))}(e).chain(he))),ye=fe((e=>me(e).chain(he))),be=fe((e=>q.map((e=>{let{time:t}=e;return t})))),_e=fe((e=>ce(e).chain(he).map((e=>{let{start_date:t}=e;return t}))));function Se(e,t){if(e.match(/^\d{1,2}:\d{2}/))return;if(e.match(/\d{2}-\d{4}/))return;const n=o.ou.fromISO(e,{zone:null==t?void 0:t.timeZone});if(n.isValid)return n;const r=e.replace(/ /,"T");if(r!==e){const e=o.ou.fromISO(r);if(e.isValid)return e}}function ke(e,t){const n=De(e,{intl:t,includeSeconds:!0});if(n)return n;const o=Se(e,t);return o?we(o):void 0}function we(e){return e.valueOf()===e.startOf("day").valueOf()?{type:"date",start_date:e.toFormat(m.Iq)}:{type:"datetime",start_date:e.toFormat(m.Iq),start_time:e.toFormat(p.jK),time_zone:e.zoneName}}function xe(e){return{type:"date",start_date:o.ou.fromISO(e).toFormat(m.Iq)}}function Ie(e){const t=o.ou.fromISO(e);return{type:"datetime",start_date:t.toFormat(m.Iq),start_time:t.toFormat(p.jK),time_zone:t.zoneName}}function Ce(e,t){const n=o.ou.fromISO(e),r=o.ou.fromISO(t);return{type:"datetimerange",start_date:n.toFormat(m.Iq),start_time:n.toFormat(p.jK),end_date:r.toFormat(m.Iq),end_time:r.toFormat(p.jK),time_zone:n.zoneName}}function Te(e,t){if(e)return Pe(e,m.Iq,t)}function Me(e,t){if(e)return Ae(e,p.jK,t)}function Pe(e,t,n){const r=o.ou.fromFormat(e,t,{locale:(0,u.E2)(n)});return r.isValid?r.setLocale(p.ah).toFormat(m.Iq):_e(e,n)}function Ae(e,t,n){const r=o.ou.fromFormat(e,t,{locale:(0,u.E2)(n)});return r.isValid?r.setLocale(p.ah).toFormat(p.jK):be(e,n)}const Re="→";function De(e,t){var n;const o=Boolean(null==t?void 0:t.includeSeconds),r=p.dE.exec(e);let i,a;r&&r[1]&&r[2]?(i=r[1],a=r[2]):i=e,a=a||(null==t||null===(n=t.intl)||void 0===n?void 0:n.timeZone)||(0,d.r)();const s=i.split(Re);if(s[0]&&s[1]){const e=s[0].trim(),t=s[1].trim(),n=Ve(e,a,o);if(void 0!==n){let e=Ve(t,a,o);if(void 0===e){e=Ve(`${n.date}, ${t}`,a,o)}if(void 0!==e){return{type:"datetimerange",start_date:n.date,start_time:n.time,end_date:e.date,end_time:e.time,time_zone:a}}}else{const n=Ue(e);if(void 0!==n){const e=Ue(t);if(void 0!==e){return{type:"daterange",start_date:n,end_date:e}}}}}else if(s[0]){const e=s[0].trim(),t=Ve(e,a,o);if(void 0!==t){return{type:"datetime",start_date:t.date,start_time:t.time,time_zone:a}}{const t=Ue(e);if(void 0!==t){return{type:"date",start_date:t}}}}}class Be{constructor(e){this.parsers=void 0,this.formats=e}getParsers(){return void 0===this.parsers&&(this.parsers=this.formats.map((e=>o.ou.buildFormatParser(e,{locale:p.ah})))),this.parsers}}const Ee=new Be(["LLLL d yyyy","yyyy LL dd","LL dd yyyy","LLL dd yyyy","dd LLL yyyy","LL/dd/yyyy","LL-dd-yyyy","L/d/yyyy","L-d-yyyy","LL/dd/yy","LL-dd-yy","L/d/yy","L-d-yy","d LLL yy","d/LLL/yy","d-LLL-yy","d LLL yyyy","d/LLL/yyyy","d-LLL-yyyy","yyyy/LL/dd","yyyy-LL-dd","LLLL d, yyyy","dd/LL/yyyy","dd-LL-yyyy","yyyy年L月d日"]),Fe=new Be(["LLLL d yyyy, HH:mm ZZZ","yyyy LL dd, HH:mm ZZZ","LL dd yyyy, HH:mm ZZZ","LLL dd yyyy, HH:mm ZZZ","dd LLL yyyy, HH:mm ZZZ","LL/dd/yyyy, HH:mm ZZZ","LL-dd-yyyy, HH:mm ZZZ","L/d/yyyy, HH:mm ZZZ","L-d-yyyy, HH:mm ZZZ","LL/dd/yy, HH:mm ZZZ","LL-dd-yy, HH:mm ZZZ","L/d/yy, HH:mm ZZZ","L-d-yy, HH:mm ZZZ","d LLL yy, HH:mm ZZZ","d/LLL/yy, HH:mm ZZZ","d-LLL-yy, HH:mm ZZZ","yyyy/LL/dd, HH:mm ZZZ","yyyy-LL-dd, HH:mm ZZZ","LLLL d yyyy, HH:mm","LLLL d, yyyy HH:mm","LLLL d, yyyy H:mm","yyyy LL dd, HH:mm","LL dd yyyy, HH:mm","LLL dd yyyy, HH:mm","dd LLL yyyy, HH:mm","LL/dd/yyyy, HH:mm","LL/dd/yyyy HH:mm","LL/dd/yyyy H:mm","LL-dd-yyyy HH:mm","LL-dd-yyyy H:mm","dd/LL/yyyy HH:mm","dd-LL-yyyy HH:mm","dd/LL/yyyy H:mm","dd-LL-yyyy H:mm","LL-dd-yyyy, HH:mm","L/d/yyyy, HH:mm","L-d-yyyy, HH:mm","LL/dd/yy, HH:mm","LL-dd-yy, HH:mm","L/d/yy, HH:mm","L-d-yy, HH:mm","d LLL yy, HH:mm","d/LLL/yy, HH:mm","d-LLL-yy, HH:mm","d LLL yyyy, HH:mm","d/LLL/yyyy, HH:mm","d-LLL-yyyy, HH:mm","yyyy/LL/dd, HH:mm","yyyy/LL/dd HH:mm","yyyy/LL/dd H:mm","yyyy-LL-dd, HH:mm","yyyy-LL-dd H:mm","yyyy-LL-dd HH:mm","yyyy-LL-dd, H:mm","LLLL d yyyy, hh:mm a","yyyy LL dd, hh:mm a","LL dd yyyy, hh:mm a","LLL dd yyyy, hh:mm a","dd LLL yyyy, hh:mm a","dd-LL-yyyy hh:mm a","dd/LL/yyyy, hh:mm a","LL/dd/yyyy hh:mm a","LL-dd-yyyy hh:mm a","LL-dd-yyyy, hh:mm a","L/d/yyyy, hh:mm a","L-d-yyyy, hh:mm a","LL/dd/yy, hh:mm a","LL-dd-yy, hh:mm a","L/d/yy, hh:mm a","L-d-yy, hh:mm a","d LLL yy, hh:mm a","d/LLL/yy, hh:mm a","d-LLL-yy, hh:mm a","yyyy/LL/dd hh:mm a","yyyy-LL-dd hh:mm a","yyyy年L月d日 H:mm","yyyy年L月d日 h:mm a"]),Ze=new Be(["LLLL d yyyy, HH:mm:ss ZZZ","yyyy LL dd, HH:mm:ss ZZZ","LL dd yyyy, HH:mm:ss ZZZ","LLL dd yyyy, HH:mm:ss ZZZ","dd LLL yyyy, HH:mm:ss ZZZ","LL/dd/yyyy, HH:mm:ss ZZZ","LL-dd-yyyy, HH:mm:ss ZZZ","L/d/yyyy, HH:mm:ss ZZZ","L-d-yyyy, HH:mm:ss ZZZ","LL/dd/yy, HH:mm:ss ZZZ","LL-dd-yy, HH:mm:ss ZZZ","L/d/yy, HH:mm:ss ZZZ","L-d-yy, HH:mm:ss ZZZ","d LLL yy, HH:mm:ss ZZZ","d/LLL/yy, HH:mm:ss ZZZ","d-LLL-yy, HH:mm:ss ZZZ","yyyy/LL/dd, HH:mm:ss ZZZ","yyyy-LL-dd, HH:mm:ss ZZZ","LLLL d yyyy, HH:mm:ss","LLLL d, yyyy HH:mm:ss","LLLL d, yyyy H:mm:ss","yyyy LL dd, HH:mm:ss","LL dd yyyy, HH:mm:ss","LLL dd yyyy, HH:mm:ss","dd LLL yyyy, HH:mm:ss","LL/dd/yyyy, HH:mm:ss","LL/dd/yyyy HH:mm:ss","LL/dd/yyyy H:mm:ss","LL-dd-yyyy HH:mm:ss","LL-dd-yyyy H:mm:ss","dd/LL/yyyy HH:mm:ss","dd-LL-yyyy HH:mm:ss","dd/LL/yyyy H:mm:ss","dd-LL-yyyy H:mm:ss","LL-dd-yyyy, HH:mm:ss","L/d/yyyy, HH:mm:ss","L-d-yyyy, HH:mm:ss","LL/dd/yy, HH:mm:ss","LL-dd-yy, HH:mm:ss","L/d/yy, HH:mm:ss","L-d-yy, HH:mm:ss","d LLL yy, HH:mm:ss","d/LLL/yy, HH:mm:ss","d-LLL-yy, HH:mm:ss","d LLL yyyy, HH:mm:ss","d/LLL/yyyy, HH:mm:ss","d-LLL-yyyy, HH:mm:ss","yyyy/LL/dd, HH:mm:ss","yyyy/LL/dd HH:mm:ss","yyyy/LL/dd H:mm:ss","yyyy-LL-dd, HH:mm:ss","yyyy-LL-dd H:mm:ss","yyyy-LL-dd HH:mm:ss","yyyy-LL-dd, H:mm:ss","LLLL d yyyy, hh:mm:ss a","yyyy LL dd, hh:mm:ss a","LL dd yyyy, hh:mm:ss a","LLL dd yyyy, hh:mm:ss a","dd LLL yyyy, hh:mm:ss a","dd-LL-yyyy hh:mm:ss a","dd/LL/yyyy, hh:mm:ss a","LL/dd/yyyy hh:mm:ss a","LL-dd-yyyy hh:mm:ss a","LL-dd-yyyy, hh:mm:ss a","L/d/yyyy, hh:mm:ss a","L-d-yyyy, hh:mm:ss a","LL/dd/yy, hh:mm:ss a","LL-dd-yy, hh:mm:ss a","L/d/yy, hh:mm:ss a","L-d-yy, hh:mm:ss a","d LLL yy, hh:mm:ss a","d/LLL/yy, hh:mm:ss a","d-LLL-yy, hh:mm:ss a","yyyy/LL/dd hh:mm:ss a","yyyy-LL-dd hh:mm:ss a","yyyy年L月d日 H:mm:ss","yyyy年L月d日 h:mm:ss a"]);function Ue(e){for(const t of Ee.getParsers()){const n=o.ou.fromFormatParser(e,t,{locale:p.ah});if(n.isValid)return(0,m.BC)(n)}}function Ve(e,t,n){let r=Fe.getParsers();n&&(r=r.concat(Ze.getParsers()));for(const i of r){const n=o.ou.fromFormatParser(e,i,{locale:p.ah,zone:t});if(n.isValid)return{date:(0,m.BC)(n),time:(0,m.zw)(n),timeZone:t}}}const Ne=fe((e=>ne(e).map((e=>{let{start_date:t}=e;return t}))))},44317:(e,t,n)=>{n.d(t,{Ct:()=>a,O5:()=>s,eG:()=>i,sY:()=>l});var o=n(709291),r=n(619584);const i=(0,o.defineMessages)({year:{id:"timeUtils.durationDescriptor.intervalYear",defaultMessage:"{numYears, plural, one {1 year} other {{numYears} years}}"},week:{id:"timeUtils.durationDescriptor.intervalWeek",defaultMessage:"{numWeeks, plural, one {1 week} other {{numWeeks} weeks}}"},day:{id:"timeUtils.durationDescriptor.intervalDay",defaultMessage:"{numDays, plural, one {1 day} other {{numDays} days}}"},hour:{id:"timeUtils.durationDescriptor.intervalHour",defaultMessage:"{numHours, plural, one {1 hour} other {{numHours} hours}}"},minute:{id:"timeUtils.durationDescriptor.intervalMinute",defaultMessage:"{numMinutes, plural, one {1 minute} other {{numMinutes} minutes}}"},second:{id:"timeUtils.durationDescriptor.intervalSecond",defaultMessage:"{numSeconds, plural, one {1 second} other {{numSeconds} seconds}}"}});function a(e,t){const n=Math.floor(e/r._I),o=Math.floor(e/r.DS),a=Math.floor(e/r.A0),s=Math.floor(e/r.U6),l=Math.floor(e/r.hM),c=Math.floor(e/r.C0);return n>=1?t.formatMessage(i.year,{numYears:n}):o>=1?t.formatMessage(i.week,{numWeeks:o}):a>=1?t.formatMessage(i.day,{numDays:a}):s>=1?t.formatMessage(i.hour,{numHours:s}):l>=1?t.formatMessage(i.minute,{numMinutes:l}):t.formatMessage(i.second,{numSeconds:c})}function s(e){return Math.floor((Date.now()-e)/864e5)}function l(e){return Math.floor((Date.now()-e)/36e5)}},923956:(e,t,n)=>{n.d(t,{YI:()=>i});const o="-deleted@notion.so",r="-deleted@makenotion.com";function i(e){return e.endsWith(o)||e.endsWith(r)}},714215:(e,t,n)=>{n.d(t,{E:()=>o,N:()=>r});n(757658),n(21703);function o(e,t){const n=new Set(e),o=new Set,r=new Array,i=new Array;for(const a of t)o.add(a),n.has(a)||i.push(a);for(const a of e)o.has(a)||r.push(a);return{created:i,deleted:r}}function r(e,t,n){const o=new Map,r=new Map,i=new Array,a=new Array;for(const s of e)o.set(n(s),s);for(const s of t){const e=n(s);r.set(e,s),o.has(e)||a.push(e)}for(const s of e){const e=n(s);r.has(e)||i.push(e)}return{created:a.map((e=>{const t=r.get(e);if(!t)throw new Error("After map did not contain value.");return t})),deleted:i.map((e=>{const t=o.get(e);if(!t)throw new Error("Before map did not contain value.");return t}))}}},293824:(e,t,n)=>{n.d(t,{q:()=>r});n(757658);var o=n(335311);function r(e,t){const n=o.create({arrays:{detectMove:!1,includeValueOnMove:!0}}).diff(e,t);if(!n)return{beforeOps:{},removeOps:new Set};let r=[],i=[];for(const o in n)"_t"!==o&&("_"===o[0]?r.push(parseInt(o.slice(1),10)):1===n[o].length&&i.push({index:parseInt(o,10),value:n[o][0]}));const a={},s=new Set,l=[...e];r=r.sort(((e,t)=>e-t));for(let o=r.length-1;o>=0;o--){const e=r[o],t=l.splice(e,1)[0];s.add(t)}i=i.sort(((e,t)=>e.index-t.index));for(let o=0;o<i.length;o++){const e=i[o];a[e.value]=l[e.index],l.splice(e.index,0,e.value)}return{beforeOps:a,removeOps:s}}},709410:(e,t,n)=>{n.d(t,{Bb:()=>u,GW:()=>p});n(757658);var o=n(709291),r=n(653965),i=n(401898),a=n(456452),s=n(421838),l=n(182798);const c=(0,o.defineMessages)({addLabel:{id:"suggestionContext.label.add",defaultMessage:"Add"},removeLabel:{id:"suggestionContext.label.remove",defaultMessage:"Delete"},labelForReplaceOldText:{id:"suggestionContext.label.replaceOld",defaultMessage:"Replace"},labelForReplaceNewText:{id:"suggestionContext.label.replaceNew",defaultMessage:"with"},boldLabel:{id:"suggestionContext.label.bold",defaultMessage:"Bold"},unboldLabel:{id:"suggestionContext.label.unbold",defaultMessage:"Unbold"},italicLabel:{id:"suggestionContext.label.italic",defaultMessage:"Italicize"},unitalicLabel:{id:"suggestionContext.label.unitalic",defaultMessage:"Unitalicize"},strikeLabel:{id:"suggestionContext.label.strike",defaultMessage:"Strike through"},unstrikeLabel:{id:"suggestionContext.label.unstrike",defaultMessage:"Remove strike through"},underlineLabel:{id:"suggestionContext.label.underline",defaultMessage:"Underline"},removeUnderlineLabel:{id:"suggestionContext.label.remove underline",defaultMessage:"Remove underline"},codeStyleLabel:{id:"suggestionContext.label.codeStyle",defaultMessage:"Mark as code"},removeCodeStyleLabel:{id:"suggestionContext.label.remove codeStyle",defaultMessage:"Remove code style"},addLinkLabel:{id:"suggestionContext.label.addLink",defaultMessage:"Add link"},removeLinkLabel:{id:"suggestionContext.label.removeLink",defaultMessage:"Remove link"},highlightLabel:{id:"suggestionContext.label.highlight",defaultMessage:"Highlight"},removeHighlightLabel:{id:"suggestionContext.label.removeHighlight",defaultMessage:"Remove highlight"},undefinedOpLabel:{id:"suggestionContext.label.undefinedOp",defaultMessage:"Undefined operation"},lineBreak:{id:"suggestionContext.text.linebreak",defaultMessage:"line break"},lineBreaks:{id:"suggestionContext.text.linebreaks",defaultMessage:"line breaks"},block:{id:"suggestionContext.text.block",defaultMessage:"block"},blocks:{id:"suggestionContext.text.blocks",defaultMessage:"blocks"}}),d={[s.GKr.Bold]:[c.boldLabel,c.unboldLabel],[s.GKr.Italic]:[c.italicLabel,c.unitalicLabel],[s.GKr.Strike]:[c.strikeLabel,c.unstrikeLabel],[s.GKr.Underline]:[c.underlineLabel,c.removeUnderlineLabel],[s.GKr.Code]:[c.codeStyleLabel,c.removeCodeStyleLabel],[s.GKr.Link]:[c.addLinkLabel,c.removeLinkLabel],[s.GKr.Highlight]:[c.highlightLabel,c.removeHighlightLabel]};function u(e){const{discussionContextData:t,discussionId:n,discussionType:o,excludeLabel:r,intl:c}=e;if("default"===o){let e;const n=t[0];return"textValue"===n.type&&(e=n.value),(0,l.TO)(e)}if("suggestion"===o){return function(e){const{suggestionContextRenderLineItem:t,excludeLabel:n}=e;return t.flatMap(((e,o)=>{if(n)return e.value;const r=[];return e.shouldUseDeleteColor?r.push(s.V3y(`${e.label}: `,[a.H])):r.push(s.V3y(`${e.label}: `,[a._P])),e.removeQuotationMarks||r.push(s.V3y("“",[e.shouldUseDeleteColor?a.rP:a.or])),"insert_block"===e.type||"add_line_break"===e.type?e.value.forEach((e=>{r.push(s.V3y(s.WiV(e),[a.or]))})):"remove_line_break"===e.type||"delete_block"===e.type?e.value.forEach((e=>{r.push(s.V3y(s.WiV(e),[a.rP]))})):r.push(...e.value),e.removeQuotationMarks||r.push(s.V3y("”",[e.shouldUseDeleteColor?a.rP:a.or])),o!==t.length-1&&r.push(s.V3y("\n")),r}))}({suggestionContextRenderLineItem:m({discussionContextData:t,discussionId:n,intl:c}),intl:c,excludeLabel:r})}(0,i.t1)(o)}function p(e){const{discussionType:t,discussionId:n,discussionContextData:o,intl:r}=e;if("suggestion"===t)return m({discussionContextData:o,discussionId:n,intl:r})}function m(e){const{discussionContextData:t,intl:n,discussionId:o}=e,a=t.flatMap((e=>"textValue"===e.type?function(e){const{textValue:t,intl:n,discussionId:o}=e,i=r.mN(t.flatMap((e=>(0,s.hDy)(e))).filter((e=>s.BIG(e)&&s.fgJ(e)===o)),(e=>`[${e.join(",")}]`));if(0===i.length)return[];const a=2===i.length&&1===i.filter((e=>s.pGj(e))).length&&1===i.filter((e=>s.$b8(e))).length,l=[];for(const r of i){const e=g({annotation:r,isReplace:a,intl:n}),o=s.$b8(r);let i=t;if(s.u2m(r)||s.Jeu(r)){const e=s.EpE(r);if(s.j0F(e)){i=[[s.zW$(e)]]}}a&&(s.pGj(r)?i=t.filter((e=>(0,s.hDy)(e).some((e=>s.pGj(e))))):s.$b8(r)&&(i=t.filter((e=>(0,s.hDy)(e).some((e=>s.$b8(e))))))),l.push({label:e,value:i,shouldUseDeleteColor:o})}return l}({textValue:e.value,discussionId:o,intl:n}):"blockSuggestion"===e.type?function(e){const{blockSuggestion:t,intl:n}=e;if("add_line_break"===t.type)return{label:n.formatMessage(c.addLabel),value:[s.V3y(n.formatMessage(c.lineBreak))],shouldUseDeleteColor:!1,removeQuotationMarks:!0,type:"add_line_break"};if("remove_line_break"===t.type)return{label:n.formatMessage(c.removeLabel),value:[s.V3y(n.formatMessage(c.lineBreak))],shouldUseDeleteColor:!0,removeQuotationMarks:!0,type:"remove_line_break"};if("insert"===t.type)return{label:n.formatMessage(c.addLabel),value:[s.V3y(n.formatMessage(c.block))],shouldUseDeleteColor:!1,removeQuotationMarks:!0,type:"insert_block"};if("remove"===t.type)return{label:n.formatMessage(c.removeLabel),value:[s.V3y(n.formatMessage(c.block))],shouldUseDeleteColor:!0,removeQuotationMarks:!0,type:"delete_block"};(0,i.t1)(t.type)}({blockSuggestion:e.value,intl:n}):void(0,i.t1)(e))),l=[a].map((e=>function(e,t){const n=e.filter((e=>"insert_block"===e.type));if(1===n.length&&1===e.length)return e;if(n.length>1&&n.length===e.length)return[{label:t.formatMessage(c.addLabel),value:[s.V3y(t.formatMessage(c.blocks))],shouldUseDeleteColor:!1,removeQuotationMarks:!0}];return e.filter((e=>"insert_block"!==e.type))}(e,n))).map((e=>function(e,t){const n=e.filter((e=>"delete_block"===e.type));if(1===n.length&&1===e.length)return e;if(n.length>1&&n.length===e.length)return[{label:t.formatMessage(c.removeLabel),value:[s.V3y(t.formatMessage(c.blocks))],shouldUseDeleteColor:!1,removeQuotationMarks:!0}];return e}(e,n))).map((e=>f(e,n,"add_line_break"))).map((e=>f(e,n,"remove_line_break")));return l[0]}function g(e){const{annotation:t,isReplace:n,intl:o}=e,r=c.undefinedOpLabel;if(s.pGj(t)){const e=n?c.labelForReplaceNewText:c.addLabel;return o.formatMessage(e)}if(s.$b8(t)){const e=n?c.labelForReplaceOldText:c.removeLabel;return o.formatMessage(e)}if(s.u2m(t)||s.Jeu(t)){const e=s.EpE(t);if(s.u2m(t)){const t=d[s.J7s(e)][0]??r;return o.formatMessage(t)}{const t=d[s.J7s(e)][1]??r;return o.formatMessage(t)}}(0,i.t1)(t)}function f(e,t,n){let o,r;const i="add_line_break"===n?t.formatMessage(c.addLabel):t.formatMessage(c.removeLabel),a=e=>{r&&(e.push({label:i,value:[s.V3y(t.formatMessage(c.lineBreaks))],shouldUseDeleteColor:"remove_line_break"===n,removeQuotationMarks:!0}),r=!1,o=!1),o&&(e.push({label:i,value:[s.V3y(t.formatMessage(c.lineBreak))],shouldUseDeleteColor:"remove_line_break"===n,removeQuotationMarks:!0}),o=!1)},l=e.reduce(((e,t)=>(t.type===n?o?r=!0:o=!0:(a(e),e.push(t)),e)),[]);return a(l),l}},320297:(e,t,n)=>{n.d(t,{XJ:()=>de,J_:()=>ce,PZ:()=>ie,nM:()=>X,eb:()=>ne});n(757658),n(21703);var o=n(653965),r=n(307032),i=n(215828),a=n(401898),s=n(619584),l=(n(371663),n(603865)),c=n(674564),d=n(217215),u=n(541432),p=n(576205),m=n(114714),g=n(399036),f=n(901274),h=n(597531);const v="415fc269-e68f-4da0-b3e3-b1273b741a7f";n(642509);var y=n(589789),b=n(471924),_=n(959753),S=(n(300482),n(798963)),k=n(718844),w=n(421202),x=n(421838);function I(e){var t;const{blockValue:n,factoryButtonDeprecationContext:o,source:r}=e,i=function(e){return _.kk5.fromValue(w.iU,e).getCreatedByPointer()??{id:y.P_.id,table:y.P_.table}}(n),a=n.space_id,s=b.Il(),l=b.Il(),c=o.isRootBlockFactoryBlock&&o.isCurrentBlockRootBlock?o.rootTextContainerId:b.Il(),d=function(e){const{automationActionId:t,textContainerBlockId:n,creatorPointer:o,originalBlockValue:r,spaceId:i,blockContent:a}=e;return{table:w.iU,value:{id:n,space_id:i,alive:!0,parent_table:k.Xj,parent_id:t,type:"text",version:0,content:a,created_time:r.created_time,created_by_table:o.table,created_by_id:o.id}}}({automationActionId:l,textContainerBlockId:c,creatorPointer:i,originalBlockValue:n,blockContent:"duplication"===r?null===(t=n.content)||void 0===t?void 0:t.map((t=>e.pointerMapper({id:t,table:w.iU}).id)):n.content,spaceId:a}),u=function(e){const{automationId:t,automationActionId:n,spaceId:o,textContainerBlockId:r}=e;return{table:k.Xj,value:{id:n,space_id:o,alive:!0,parent_table:S.cv,parent_id:t,type:"duplicate_blocks",blocks:[r],version:0,config:void 0}}}({automationActionId:l,automationId:s,creatorPointer:i,originalBlockValue:n,spaceId:a,textContainerBlockId:c}),p=function(e){var t;const{creatorPointer:n,automationActionId:o,originalBlockValue:r,spaceId:i,automationId:a}=e,s=b.Il(),l=Date.now();return{table:S.cv,value:{id:a,space_id:i,alive:!0,trigger:{id:s,type:"button"},parent_id:r.id,parent_table:w.iU,action_ids:[o],status:"active",properties:{name:(0,x.QaF)(null===(t=r.properties)||void 0===t?void 0:t.title)},created_by_id:n.id,created_by_table:n.table,created_time:r.created_time??l,last_edited_time:r.last_edited_time??l,version:0,last_edited_by_id:r.last_edited_by_id??n.id,last_edited_by_table:r.last_edited_by_table??n.table}}}({automationActionId:l,automationId:s,creatorPointer:i,originalBlockValue:n,spaceId:a});return{textContainerBlock:d,automation:p,automationAction:u}}var C=n(406695),T=n(335102),M=n(576218),P=n(568626),A=n(264572),R=n(530615),D=n(752147);class B{constructor(e,t,n){this.childToParentMap=new Map,this.unmappedContentIds=new Set,this.extraTranscludedChildren=new R.G((()=>new Set)),this.logWarning=t,this.createCopyIndicator=n;for(const{model:o}of e)if(o instanceof _.yJh)for(const t of o.getContentPointers()){e.getModel(t)?this.childToParentMap.has(t.id)?this.extraTranscludedChildren.get(t.id).add(o.id):this.childToParentMap.set(t.id,o.pointer.id):this.unmappedContentIds.add(t.id)}!this.createCopyIndicator&&this.logWarning&&this.logWarning({type:"multiReferencedContentIds",contentIds:Array.from(this.extraTranscludedChildren.keys())})}remapDuplicateBlockParent(e){const{originalBlockPointer:t,duplicateMapper:n}=e,o=this.childToParentMap.get(t.id);if(!o)return;const r=n({requested:{table:w.iU,id:o},requester:t});return r&&r.table===w.iU?r:void 0}createCopyIndicatorBlockValue(e){const{type:t,targetSpaceId:n,sourceBlockId:o,duplicateParentId:r,createdBy:i,createOptions:a,additionalRecordsToMutate:s}=e,{model:l}=_.yJh.create({id:(0,b.Il)(),type:u.Ti.copyIndicator,space_id:n,parent:{id:r,table:w.iU,spaceId:n},createdBy:i},{useCrdt:D.l()}),c=l.__IM_SORRY__getValue();return a.onCreate({type:t,duplicateBlockId:c.id,sourceBlockId:o,duplicateParentId:r}),s.push({table:w.iU,value:c}),c.id}remapDuplicateBlockContent(e){const{originalBlockPointer:t,duplicateMapper:n,originalBlockContent:o,originalCreatedBy:r,duplicateBlockId:i,targetSpaceId:s}=e,l=[];return{content:o.map((e=>{if(this.createCopyIndicator&&this.extraTranscludedChildren.has(e)&&this.extraTranscludedChildren.get(e).has(t.id))return this.createCopyIndicatorBlockValue({type:"multi-transcluded-content",targetSpaceId:s,sourceBlockId:e,duplicateParentId:i,createdBy:r,createOptions:this.createCopyIndicator,additionalRecordsToMutate:l});const o=n({requested:{table:w.iU,id:e},requester:t});return o?o.id:this.isUnmappedContentId(e)?this.createCopyIndicator?this.createCopyIndicatorBlockValue({type:"unmapped-content",targetSpaceId:s,sourceBlockId:e,duplicateParentId:i,createdBy:r,createOptions:this.createCopyIndicator,additionalRecordsToMutate:l}):void(null===(a=this.logWarning)||void 0===a||a.call(this,{type:"unmappedContentId",block:t,contentId:e})):e;var a})).filter(a.$K),additionalRecords:l}}isUnmappedContentId(e){return this.unmappedContentIds.has(e)}}var E=n(433422),F=n(278702),Z=n(463306),U=n(186517),V=n(772141),N=n(74446),O=n(145953),L=n(600606),j=n(177420),K=n(606287),z=n(213493),q=n(870279),H=n(933709),G=n(714429),W=n(611318),$=n(480396),Y=n(23867),Q=n(91644);var J=n(463332);function X(e){const t=ne([x.V3y(e)]);return x.QaF(t)}function ee(e){if(e.length<3||!e.startsWith("(")||!e.endsWith(")"))return;const t=e.substring(1,e.length-1),n=parseInt(t),o=!Number.isNaN(n)&&n>0&&function(e){return Boolean(e.match(/^[1-9][0-9]*$/))}(t);return o?n:void 0}function te(e){const t=e=>`(${e})`,{title:n,digit:o}=function(e){const t=e.trimEnd(),n=t.split(" "),o=ee(n[n.length-1]);let r=t;if(void 0!==o){const e=n.slice(0,n.length-1).join(" ");r=e.length>0?e:void 0}return{title:r,digit:o}}(e[0]),r=void 0===n?"":`${n.trimEnd()} `,i=t(void 0===o?1:o+1);return x.V3y(`${r}${i}`)}function ne(e){const t=x.QaF(e);if(0===t.trim().length||void 0===e)return[x.V3y(t)];const n=e[e.length-1];if(x.QJH(n)){return[...e.slice(0,e.length-1),te(n)]}return[...e,te([""])]}const oe={block:!0,collection:!0,collection_view:!0,discussion:!0,comment:!0,reaction:!0,automation:!0,automation_action:!0,skill:!0,layout:!0,form_question:!0};function re(e){return e.table in oe}function ie(e){const{sourceBlockId:t,targetBlockPointer:n,recordMap:r,options:i,baseUrl:a,publicDomainName:s,actor:l,getRecordRole:c,mapper:d,preventLegacyTransclusions:u,createLegacyTransclusionCopyIndicator:p,logWarning:m,spaceIdCreator:g,installationImprint:f}=e,h=e.recordPointerMap||O.Ao.create();for(const{pointer:o}of r){if(o.id===t){h.set(o,n);continue}let e=h.get(o);!e&&d&&(e=d({requested:o,requester:{table:w.iU,id:t}})),e||(e={spaceId:n.spaceId,table:o.table,id:(null==g?void 0:g.idInSavedSpace(o.table))??b.Ar()}),h.set(o,e)}let v;u&&(v=new B(r,m,p??!1));const y=O.Ak.create(),_=e=>{let{requested:t}=e;return h.get(t)},S={},k=[],x=r.getModel({id:t,table:w.iU}),I=x?function(e){const t="duplication",n=new Map;let o;return"factory"===e.type?(o={type:t,isRootBlockFactoryBlock:!0,isCurrentBlockRootBlock:!1,factoryBlockIdToNewTextContainerIdMap:n,rootTextContainerId:b.Il()},o.factoryBlockIdToNewTextContainerIdMap.set(e.id,{id:o.rootTextContainerId,table:w.iU})):o={type:t,isRootBlockFactoryBlock:!1,factoryBlockIdToNewTextContainerIdMap:n},o}(x):void 0;for(const{pointer:o,model:b}of r){if(void 0===b)continue;if(!re(b))continue;if(!(null!=i&&i.duplicateDiscussions||o.table!==H.qF&&o.table!==q.x_&&o.table!==$.yo))continue;const e=Boolean((null==i?void 0:i.resolveTemplateVariables)&&pe({rootSourceBlockIds:[t],childSourcePointer:o,getSourceRecordValue:N.mF.fromRecordMap(r)}))?{...i,resolveTemplateVariables:!1}:i;null!=I&&I.isRootBlockFactoryBlock&&(I.isCurrentBlockRootBlock=b.id===t);const{duplicateRecord:d,additionalRecords:u}=se({table:b.table,record:b.__IM_SORRY__getValue(),mapper:_,options:e,rewiredUriMap:S,typedCollectionViewBlocks:k,originOptions:{baseUrl:a,publicDomainName:s},actor:l,getRecordRole:c,factoryButtonDeprecationContext:I,legacyTransclusionFixer:v,installationImprint:f});if(void 0!==d){if(b.table===w.iU&&d.id===n.id){const e=d;delete e.parent_id,delete e.parent_table,delete e.alive}ae({duplicateRecordMap:y,duplicateRecordResult:{duplicateRecord:d,additionalRecords:u,duplicateRecordTable:b.table}})}}return function(e){const{rewiredUriMap:t,typedCollectionViewBlocks:n,duplicateRecordMap:r}=e;if(o.xb(t)||0===n.length)return;const i=o.oA(n.map((e=>r.getValue(e))));i.forEach((e=>{var n;const o=null==e||null===(n=e.format)||void 0===n?void 0:n.app_uri_map;o&&Object.entries(o).forEach((e=>{let[n,r]=e;o[n]=t[r]}))}));const a=i.reduce(((e,t)=>{var n;const o=null==t||null===(n=t.format)||void 0===n?void 0:n.app_id;return o&&(e[o]=e[o]?[...e[o],t]:[t]),e}),{});Object.entries(a).forEach((e=>{let[t,n]=e;const o=b.Il();n.forEach((e=>{var t;null!=e&&null!==(t=e.format)&&void 0!==t&&t.app_id&&(e.format.app_id=o)}))}))}({rewiredUriMap:S,typedCollectionViewBlocks:k,duplicateRecordMap:y}),{duplicateRecordMap:y,originalToDuplicate:h}}function ae(e){const{duplicateRecordResult:t,duplicateRecordMap:n}=e,{additionalRecords:o,duplicateRecord:r,duplicateRecordTable:i}=t;n.setValue(L.dr.fromPointerLike({table:i,id:r.id}),r);for(const a of o)n.setValue(L.dr.fromPointerLike({id:a.value.id,table:a.table}),a.value)}function se(e){const{table:t,record:n,mapper:l,options:c,originOptions:p,actor:f,helperRecordMap:b,getRecordRole:M,rewiredUriMap:P,typedCollectionViewBlocks:A,factoryButtonDeprecationContext:R,legacyTransclusionFixer:D,installationImprint:B}=e,E=o.Xh(n),Z=ge({mapper:l,requested:L.dr.fromPointerLike({table:t,id:n.id,spaceId:n.space_id}),requester:L.dr.fromPointerLike({table:t,id:n.id})});E.id=Z.id,E.space_id=(0,Y.C)(Z.spaceId);const U=[];if(t===w.iU){const e=E,{additionalRecords:t}=function(e){var t,n,i,l,c,p,m,g,f,b;const{originalBlock:k,duplicateBlock:T,mapper:M,options:P,originOptions:A,rewiredUriMap:R,typedCollectionViewBlocks:D,actor:B,helperRecordMap:E,factoryButtonDeprecationContext:F,legacyTransclusionFixer:Z,installationImprint:U}=e,N={table:w.iU,id:k.id,spaceId:k.space_id};null!==(t=k.format)&&void 0!==t&&t.app_config_uri&&null!==(n=T.format)&&void 0!==n&&n.app_config_uri&&((0,C.iA)(k.format.app_config_uri)?T.format.app_config_uri=void 0:((0,u.dM)(T.type)&&D.push({table:w.iU,id:T.id,spaceId:T.space_id}),R[k.id]=T.id));const O=[];T.format&&(T.format=h.nY(T.format));null!==(i=T.format)&&void 0!==i&&i.site_id&&delete T.format.site_id;if("factory"===T.type&&F){const{automation:e,automationAction:t,textContainerBlock:n}=I({blockValue:T,source:"duplication",pointerMapper:e=>M({requested:e,requester:N})??e,factoryButtonDeprecationContext:F});O.push(e,t,n),F.factoryBlockIdToNewTextContainerIdMap.set(k.id,{id:n.value.id,table:w.iU});const o=T;o.type="button",o.content=[],o.format={...o.format,automation_id:e.value.id}}(0,r.e)(k.id)&&(T.format||(T.format={}),T.format.copied_from_pointer={table:w.iU,id:k.id,spaceId:k.space_id},T.copied_from=k.id);let q;k.parent_table===w.iU&&(q=null==F?void 0:F.factoryBlockIdToNewTextContainerIdMap.get(k.parent_id));q??=(null==Z?void 0:Z.remapDuplicateBlockParent({originalBlockPointer:N,duplicateMapper:M}))??M({requested:{table:T.parent_table,id:T.parent_id,spaceId:T.space_id},requester:N}),q&&(T.parent_id=q.id,T.parent_table!==q.table&&(0,d.qk)(q)&&(T.parent_table=q.table));null!==(l=T.format)&&void 0!==l&&l.ai_instructions_page_pointer&&(T.format.ai_instructions_page_pointer=M({requested:T.format.ai_instructions_page_pointer,requester:N}));null!==(c=T.format)&&void 0!==c&&c.ai_skill_pointer&&(T.format.ai_skill_pointer=M({requested:T.format.ai_skill_pointer,requester:N}));const G=T;G.view_ids&&(G.view_ids=G.view_ids.map((e=>{var t;return(null===(t=M({requested:{table:z.np,id:e,spaceId:G.space_id},requester:N}))||void 0===t?void 0:t.id)||e})));const W=_.kk5.fromBlock(G).getCollectionPointer();if(W){var $;if(null==E||null===($=E.getValue(W))||void 0===$||null===($=$.format)||void 0===$?void 0:$.bot_id)G.collection_id=W.id,G.format={...G.format,collection_pointer:W};else{const e=M({requested:W,requester:N})||W;if(e.table!==K.vF)throw new Error(`Collection pointer for duplicate collection is invalid: ${JSON.stringify(e)}`);G.collection_id=e.id,G.format={...G.format,collection_pointer:e}}}null!==(p=T.format)&&void 0!==p&&p.form_layout_pointer&&(T.format.form_layout_pointer=M({requested:T.format.form_layout_pointer,requester:N}));T.discussions&&(P.duplicateDiscussions?T.discussions=T.discussions.map((e=>{var t;return(null===(t=M({requested:L.dr.fromPointerLike({table:H.qF,id:e,spaceId:T.space_id}),requester:N}))||void 0===t?void 0:t.id)||e})):delete T.discussions);if(T.permissions){var Q;if(P.duplicatePermissions)T.permissions=function(e){const{block:t,targetSpaceSettings:n,targetTeamSettings:o}=e;return(t.permissions||[]).filter((e=>!(0,V.FB)(e)&&(!(0,V.hV)(e)&&((!(!o&&n.disablePublicAccess||o&&o.disable_public_access)||!(0,V.$D)(e))&&!((!o&&n.disableGuests||o&&o.disable_guests)&&(0,V.jg)(e)&&!n.memberUserIds.includes(e.user_id))))))}({block:T,targetSpaceSettings:P.duplicatePermissions.targetSpaceSettings,targetTeamSettings:null===(Q=P.duplicatePermissions)||void 0===Q?void 0:Q.targetTeamSettings});else delete T.permissions}T.content_classification&&delete T.content_classification;T.moved&&delete T.moved;T.properties||(T.properties={});for(const o in T.properties){const e=P.duplicateDiscussions?T.properties[o]:x.V3g(T.properties[o],{removeSuggestionAnnotationsAndText:!0,removeSuggestionAnnotations:!0,removeDiscussions:!0});T.properties[o]=e}T.ignore_block_count&&delete T.ignore_block_count;if(T.properties)for(const o of Object.keys(T.properties)){const e=T.properties[o];e&&(T.properties[o]=ue({...A,text:{value:e,spaceId:(0,Y.C)(T.space_id)},mapper:M,requester:N,resolveTemplateVariables:P.resolveTemplateVariables||!1}))}if("transclusion_reference"===T.type&&P.deepCopyTransclusionContainers){const e=T;if(e.format&&e.format.transclusion_reference_pointer){const t=e.format.transclusion_reference_pointer,n=M({requested:t,requester:N});n&&(e.format.transclusion_reference_pointer=n)}}if("transclusion_container"===T.type&&!P.deepCopyTransclusionContainers){const e=T;e.type="transclusion_reference",e.content=void 0;const t=e.format||{};t.transclusion_reference_pointer=N,e.format=t}if("alias"===T.type&&T.format&&T.format.alias_pointer){const e=T.format.alias_pointer,t=M({requested:e,requester:N});t&&(T.format.alias_pointer=t)}U&&(J=T,(0,u.yv)(J.type))&&T.format&&(T.format.installation_imprint={pointer:U});var J;T.type===u.Ti.externalObjectInstancePage&&(T.type=u.Ti.externalObjectInstance);if(T.type===u.Ti.externalObjectInstance){var X,ee,te;if(null!==(X=T.format)&&void 0!==X&&X.related_external_object_uris_to_instance_ids&&(T.format.related_external_object_uris_to_instance_ids=(0,s.m8)((0,a.qP)(T.format.related_external_object_uris_to_instance_ids).map((e=>{var t;let[n,o]=e;return[n,(null===(t=M({requested:{table:w.iU,id:o,spaceId:G.space_id},requester:N}))||void 0===t?void 0:t.id)||o]})))),P.convertExternalObjectInstancesToPlaceholders&&(null===(ee=T.format)||void 0===ee||!ee.is_placeholder)&&null!==(te=T.format)&&void 0!==te&&te.bot_id){const e=null==E?void 0:E.getValue({table:j.cZ,id:T.format.bot_id}),t=null==e?void 0:e.integration_id;if(t){const e={is_placeholder:!0,integration_id:t};T.format=e}}}T.file_ids&&function(e){var t;const n=JSON.stringify(e.properties);e.file_ids=null==e||null===(t=e.file_ids)||void 0===t?void 0:t.filter((t=>{var o,r,i,a,s,l;return!(null===(o=e.format)||void 0===o||!o.display_source||-1===(null===(r=e.format)||void 0===r||null===(r=r.display_source)||void 0===r?void 0:r.indexOf(t)))||(!(null===(i=e.format)||void 0===i||!i.page_cover||-1===(null===(a=e.format)||void 0===a||null===(a=a.page_cover)||void 0===a?void 0:a.indexOf(t)))||(!(null===(s=e.format)||void 0===s||!s.page_icon||-1===(null===(l=e.format)||void 0===l||null===(l=l.page_icon)||void 0===l?void 0:l.indexOf(t)))||-1!==n.indexOf(t)))}))}(T);const ne=k,oe=T;oe.format&&(null!==(m=ne.format)&&void 0!==m&&m.original_source||null!==(g=ne.format)&&void 0!==g&&g.image_edit_metadata)&&(oe.format.original_source=void 0,oe.format.image_edit_metadata=void 0);if(null!==(f=T.format)&&void 0!==f&&f.automation_id){const e=M({requested:{table:S.cv,id:T.format.automation_id,spaceId:T.space_id},requester:N});e&&(T.format.automation_id=e.id)}"collection"===k.parent_table&&k.type===u.Ti.copyIndicator&&T.properties&&(0,a.Yd)(T.properties).length>0&&(T.type=u.Ti.page);if(!P.preserveSourceMetadataTimestamps){const e=Date.now();T.created_time=e,T.last_edited_time=e}B&&(T.last_edited_by_id=B.id,T.last_edited_by_table=B.table,T.created_by_id=B.id,T.created_by_table=B.table);T.non_content_children&&(T.non_content_children=T.non_content_children.map((e=>{var t;return(null===(t=M({requested:{table:w.iU,id:e,spaceId:T.space_id},requester:N}))||void 0===t?void 0:t.id)||e})));if(null!==(b=T.format)&&void 0!==b&&b.collection_view_modules_map){const e=T.format.collection_view_modules_map,t={};for(const n in e){const o=e[n];let r=M({requested:o.collection_view_block_pointer,requester:N});r&&r.table===w.iU||(r=o.collection_view_block_pointer),t[n]={collection_view_block_pointer:r,base_version:o.base_version,has_customized:o.has_customized}}T.format.collection_view_modules_map=t}const re=T;if(re.content){var ie;if(Z){const e=Z.remapDuplicateBlockContent({originalBlockPointer:N,duplicateMapper:M,originalBlockContent:re.content,originalCreatedBy:B||y.r3.pointer,duplicateBlockId:re.id,targetSpaceId:T.space_id});re.content=e.content,O.push(...e.additionalRecords)}else re.content=re.content.map((e=>{var t;return(null===(t=M({requested:{table:w.iU,id:e},requester:N}))||void 0===t?void 0:t.id)||e}));if(T.space_id===v&&null!==(ie=T.properties)&&void 0!==ie&&ie.title){var ae,se,le;const e=(0,x.lzi)(null===(ae=T.properties)||void 0===ae?void 0:ae.title);e&&e.length>0&&e[0].length>0&&null!==(se=e[0][0])&&void 0!==se&&null!==(se=se.trim())&&void 0!==se&&se.startsWith("🎲")&&null!==(le=e[0][0])&&void 0!==le&&null!==(le=le.trim())&&void 0!==le&&le.endsWith("🎲")&&(re.content=o.TV(re.content))}}return{duplicateRecord:T,additionalRecords:O}}({originalBlock:n,duplicateBlock:e,mapper:l,options:c??{},rewiredUriMap:P,typedCollectionViewBlocks:A,originOptions:p,actor:f,helperRecordMap:b,factoryButtonDeprecationContext:R,legacyTransclusionFixer:D,installationImprint:B});U.push(...t)}else if(t===K.vF){!function(e,t,n,o,l){var c,d,u,p;const m={table:K.vF,id:e.id,spaceId:e.space_id};null!==(c=e.format)&&void 0!==c&&c.app_config_uri&&(l[e.id]=t.id);if((0,r.e)(e.id)){if(t.format||(t.format={}),t.format.copied_from_pointer={table:K.vF,id:e.id,spaceId:e.space_id},void 0!==t.format.collection_default_template&&"empty"!==t.format.collection_default_template){const e=n({requested:{table:w.iU,id:t.format.collection_default_template.template_page_id},requester:m});e&&(t.format.collection_default_template={template_page_id:e.id})}if(t.format.layout_pointer){const e=fe({mapper:n,table:W.Bh,requested:t.format.layout_pointer,requester:m});t.format.layout_pointer=e}t.copied_from=e.id}const f=n({requested:{table:t.parent_table,id:t.parent_id},requester:m});f&&(t.parent_id=f.id);const h=g.oC(t);for(const r in h){const a=h[r];if(a&&"relation"===a.type&&g.j0(a)){const e=n({requested:g.j0(a),requester:m});e?(a.collection_id=e.id,a.collection_pointer={id:e.id,table:K.vF,spaceId:(0,Y.C)(e.spaceId)}):a.property&&(a.property=(0,i.ZP)())}var v;if(a&&"title"===a.type&&t.name&&(t.name=ue({...o,text:{value:t.name,spaceId:t.space_id},mapper:n,requester:m,resolveTemplateVariables:!1})),a&&"button"===a.type&&a.automation_id)a.automation_id=(null===(v=n({requested:{id:a.automation_id,spaceId:e.space_id,table:S.cv},requester:m}))||void 0===v?void 0:v.id)??a.automation_id}t.description&&(t.description=ue({...o,text:{value:t.description,spaceId:t.space_id},mapper:n,requester:m,resolveTemplateVariables:!1}));for(const r in h){const e=h[r];if(!e||"formula"!==e.type||"v2"!==e.version||!e.formula2)continue;const t=(0,T.Wo)(e.formula2.code,n,m);e.formula2.code=t}t.template_pages&&(t.template_pages=t.template_pages.map((e=>{var t;return(null===(t=n({requested:{table:w.iU,id:e},requester:m}))||void 0===t?void 0:t.id)||e})));if(null!==(d=t.format)&&void 0!==d&&d.collection_mode&&"page_tree"===t.format.collection_mode.type){var y;const e=t.format.collection_mode.root_page_pointer,o=(null===(y=n({requested:L.dr.fromPointerLike({table:"block",id:e.id,spaceId:t.space_id}),requester:m}))||void 0===y?void 0:y.id)||e.id;t.format.collection_mode={type:"page_tree",root_page_pointer:{id:o,table:"block",spaceId:t.space_id}}}null!==(u=t.format)&&void 0!==u&&u.related_external_object_uris_to_instance_ids&&(t.format.related_external_object_uris_to_instance_ids=(0,s.m8)((0,a.qP)(t.format.related_external_object_uris_to_instance_ids).map((e=>{var o;let[r,i]=e;return[r,(null===(o=n({requested:{table:K.vF,id:i,spaceId:t.space_id},requester:m}))||void 0===o?void 0:o.id)||i]}))));delete t.deleted_schema,null!==(p=t.format)&&void 0!==p&&p.automation_ids&&(t.format.automation_ids=t.format.automation_ids.map((e=>{var o;return null===(o=n({requested:{id:e,table:S.cv,spaceId:t.space_id},requester:m}))||void 0===o?void 0:o.id})).filter(a.$K))}(n,E,l,p,P)}else if(t===z.np){!function(e,t,n,o,r){var i,a,s,l,c,d,u;const p={table:z.np,id:e.id,spaceId:e.space_id};null!==(i=e.format)&&void 0!==i&&i.app_config_uri&&null!==(a=t.format)&&void 0!==a&&a.app_config_uri&&((0,C.iA)(e.format.app_config_uri)?t.format.app_config_uri=void 0:o[e.id]=t.id);const g=null===(s=t.format)||void 0===s?void 0:s.collection_pointer;if(g){const e=null==r?void 0:r.getModel(g);if(!Boolean(null==e?void 0:e.isSyncedCollection())){const e=n({requested:g,requester:p})||g;t.format={...t.format,collection_pointer:e}}}if(t.format){var f;const e=null===(f=t.format.collection_groups)||void 0===f?void 0:f.map((e=>{if("relation"===e.value.type&&(0,m.RA)(e.value.value)&&e.value.value){return{...e,value:{type:"relation",value:n({requested:e.value.value,requester:p})}}}return e}));if(t.format.collection_groups=e,void 0!==t.format.collection_view_default_template&&"empty"!==t.format.collection_view_default_template){const e=n({requested:{table:w.iU,id:t.format.collection_view_default_template.template_page_id},requester:p});e&&(t.format.collection_view_default_template={template_page_id:e.id})}}const h=n({requested:{table:t.parent_table,id:t.parent_id,spaceId:t.space_id},requester:p});h&&(t.parent_id=h.id);t.page_sort&&(t.page_sort=t.page_sort.map((e=>{var o;return(null===(o=n({requested:{table:w.iU,id:e,spaceId:t.space_id},requester:p}))||void 0===o?void 0:o.id)||e})));if("page"===t.type&&null!==(l=t.format)&&void 0!==l&&l.page_pointer){var v;const e=t.format.page_pointer,o=(null===(v=n({requested:L.dr.fromPointerLike({table:"block",id:e.id,spaceId:t.space_id}),requester:p}))||void 0===v?void 0:v.id)||e.id;t.format.page_pointer={table:"block",id:o,spaceId:t.space_id}}if(null!==(c=t.format)&&void 0!==c&&c.property_filters){const e=t.format.property_filters;for(const t of e)t.filter&&le(t.filter,(e=>{var t;return null===(t=n({requested:e,requester:p}))||void 0===t?void 0:t.id}))}if(null!==(d=t.format)&&void 0!==d&&d.filters2){const e=t.format.filters2;for(const t of e)t.filter&&le(t.filter,(e=>{var t;return null===(t=n({requested:e,requester:p}))||void 0===t?void 0:t.id}))}const y=t.query2;y&&y.filter&&le(y.filter,(e=>{var t;return null===(t=n({requested:e,requester:p}))||void 0===t?void 0:t.id}));var b;null!==(u=t.format)&&void 0!==u&&u.form_block_pointer&&(t.format.form_block_pointer=n({requested:null===(b=t.format)||void 0===b?void 0:b.form_block_pointer,requester:p}))}(n,E,l,P,b)}else t===H.qF?function(e,t,n,o){const r={table:H.qF,id:e.id,spaceId:e.space_id},i=n({requested:{table:t.parent_table,id:t.parent_id,spaceId:t.space_id},requester:r});i&&(t.parent_id=i.id);t.comments&&(t.comments=t.comments.map((e=>{var o;return(null===(o=n({requested:{table:q.x_,id:e,spaceId:t.space_id},requester:r}))||void 0===o?void 0:o.id)||e})));if("default"===t.type&&t.context)t.context=ue({...o,text:{value:t.context,spaceId:t.space_id},mapper:n,requester:r,resolveTemplateVariables:!1});else if("suggestion"===t.type)throw new Error("Not implemented")}(n,E,l,p):t===q.x_?function(e,t,n,o){const r={table:q.x_,id:e.id,spaceId:e.space_id},i=n({requested:L.dr.fromPointerLike({table:t.parent_table,id:t.parent_id,spaceId:t.space_id}),requester:r});i&&(t.parent_id=i.id);t.text&&(t.text=ue({...o,text:{value:t.text,spaceId:t.space_id},mapper:n,requester:r,resolveTemplateVariables:!1}));if(t.content)for(const[s,l]of t.content.entries()){var a;const e=(null===(a=n({requested:L.dr.fromPointerLike({table:w.iU,id:l,spaceId:t.space_id}),requester:r}))||void 0===a?void 0:a.id)??l;t.content[s]=e}}(n,E,l,p):t===$.yo?function(e,t,n,o){const r={table:$.yo,id:e.id,spaceId:e.space_id},i=n({requested:L.dr.fromPointerLike({table:t.parent_table,id:t.parent_id,spaceId:t.space_id}),requester:r});i&&(t.parent_id=i.id)}(n,E,l):t===S.cv?ce({originalRecord:n,duplicateRecord:E,mapper:l,options:c??{},actor:f}):t===k.Xj?de({originalRecord:n,duplicateRecord:E,mapper:l,getRecordRole:M,options:c??{},originOptions:p}):t===Q.AT?function(e){let{original:t,duplicate:n,mapper:o,originOptions:r}=e;const i={table:Q.AT,id:t.id,spaceId:t.space_id},a=o({requested:L.dr.fromPointerLike({table:n.parent_table,id:n.parent_id,spaceId:n.space_id}),requester:i});a&&(n.parent_id=a.id)}({original:n,duplicate:E,mapper:l,originOptions:p}):t===W.Bh?function(e){let{original:t,duplicate:n,mapper:o}=e;const r={table:W.Bh,id:t.id,spaceId:t.space_id};n.parent_id=ge({mapper:o,requested:L.dr.fromPointerLike({table:n.parent_table,id:n.parent_id,spaceId:n.space_id}),requester:r}).id,n.modules=(0,F.AQ)(n.modules),n.modules=(0,F.Mr)(n.modules,(e=>{if("collectionViewV2"===e.type){return{type:"collectionViewV2",id:e.id,collectionViewBlockPointer:{...fe({table:w.iU,mapper:o,requested:L.dr.fromPointerLike(e.collectionViewBlockPointer),requester:r}),spaceId:n.space_id}}}if("formQuestion"===e.type){return{type:"formQuestion",id:e.id,formQuestionId:{...fe({table:G.L_,mapper:o,requested:L.dr.fromPointerLike({table:G.L_,id:e.formQuestionId,spaceId:n.space_id}),requester:r}),spaceId:n.space_id}.id}}return e})),t.blocks&&(n.blocks=t.blocks.map((e=>ge({mapper:o,requested:{table:w.iU,id:e,spaceId:n.space_id},requester:r}).id)))}({original:n,duplicate:E,mapper:l}):t===G.L_?function(e){const{original:t,duplicate:n,mapper:o}=e,r={table:G.L_,id:t.id,spaceId:t.space_id},i=o({requested:L.dr.fromPointerLike({table:n.parent_table,id:n.parent_id,spaceId:n.space_id}),requester:r});i&&(n.parent_id=i.id)}({original:n,duplicate:E,mapper:l,originOptions:p}):(0,a.t1)(t);return{duplicateRecord:E,additionalRecords:U}}function le(e,t){if(p.vA(e)){(e.filters||[]).forEach((e=>le(e,t)))}if(p.aN(e)){if(p.e(e.filter)){const n=e.filter;if("relation_contains"===n.operator||"relation_does_not_contain"===n.operator)if(Array.isArray(n.value)){const e=n.value.map((e=>{const n=e.type;if("exact"===n){const n=e.value;return{type:"exact",value:n&&t({table:w.iU,id:n})||n}}if("relative"===n)return e;(0,a.t1)(n)}));n.value=e}else{const e=n.value.type;if("exact"===e){const e=n.value.value;n.value.value=e&&t({table:w.iU,id:e})||e}else{if("relative"===e)return;(0,a.t1)(e)}}}if(p.a_(e.filter)){const n=e.filter.subfilter;if(p.e(n)){const e=n;if("relation_contains"===e.operator||"relation_does_not_contain"===e.operator)if(Array.isArray(e.value)){const n=e.value.map((e=>{const n=e.type;if("exact"===n){const n=e.value;return{type:"exact",value:n&&t({table:w.iU,id:n})||n}}if("relative"===n)return e;(0,a.t1)(n)}));e.value=n}else{const n=e.value.type;if("exact"===n){const n=e.value.value;e.value.value=n&&t({table:w.iU,id:n})||n}else{if("relative"===n)return;(0,a.t1)(n)}}}}}}function ce(e){var t;const{originalRecord:n,duplicateRecord:o,mapper:r,options:i,actor:s}=e,c=L.dr.fromSpaceShardRecordId({id:n.id,spaceId:n.space_id},S.cv);o.copied_from_pointer=c;const d=(null===(t=r({requested:L.dr.fromPointerLike({table:o.parent_table,id:o.parent_id,spaceId:o.space_id}),requester:c}))||void 0===t?void 0:t.id)??o.parent_id;o.parent_id=d;const u=(o.action_ids??[]).map((e=>{var t;return(null===(t=r({requested:L.dr.fromPointerLike({table:k.Xj,id:e,spaceId:o.space_id}),requester:c}))||void 0===t?void 0:t.id)??e}));o.action_ids=u;const p=Date.now();o.created_time=p,o.last_edited_time=p,o.last_executed_time=void 0,(0,a.$K)(s)&&(o.created_by_id=s.id,o.created_by_table=s.table,o.last_edited_by_id=s.id,o.last_edited_by_table=s.table),(0,l.Q9)(o)&&i.shouldDisableRecurrenceAutomation&&(o.status="disabled_duplication"),"notification_event"===o.trigger.type&&(o.trigger={...o.trigger,type:"event"}),(0,l.Vd)(o)&&function(e){var t;const{duplicateRecord:n,mapper:o,originalRecord:r}=e,i={id:r.id,spaceId:r.space_id,table:S.cv},s={sourceAutomationParentId:r.parent_id,sourceAutomationId:r.id,sourceAutomationName:(null===(t=r.properties)||void 0===t?void 0:t.name)??""},l=n.trigger.event.source;if((0,a.$K)(l))if("collection"===l.type){const e=o({requested:l.pointer,requester:i});e?e.table!==K.vF?(P.log({data:{miscDataToConvertToString:{...s,duplicateAutomationTriggerTable:e.table}},from:"duplicateHelpers.duplicateAutomationEventValueHelper",level:"info",type:"duplicateAutomationIncorrectTriggerTableCollection"}),n.trigger.event.source=void 0,n.status="disabled"):(0,a.$K)(e.spaceId)&&e.spaceId===n.space_id?l.pointer={...e,spaceId:n.space_id}:(P.log({data:{miscDataToConvertToString:{...s,duplicateAutomationTriggerSpaceId:e.spaceId,sourceAutomationSpaceId:n.space_id}},from:"duplicateHelpers.duplicateAutomationEventValueHelper",level:"info",type:"duplicateAutomationMissingTriggerCollectionSpaceId"}),n.trigger.event.source=void 0,n.status="disabled"):(P.log({data:{miscDataToConvertToString:{...s,sourceAutomationTriggerSourceId:l.pointer.id}},from:"duplicateHelpers.duplicateAutomationEventValueHelper",level:"info",type:"duplicateAutomationMissingTriggerCollectionSource"}),n.trigger.event.source=void 0,n.status="disabled")}else if("collection_view"===l.type){const e=o({requested:l.pointer,requester:i});e?e.table!==z.np?(P.log({data:{miscDataToConvertToString:{...s,duplicateAutomationTriggerTable:e.table}},from:"duplicateHelpers.duplicateAutomationEventValueHelper",level:"info",type:"duplicateAutomationIncorrectTriggerCollectionViewTable"}),n.trigger.event.source=void 0,n.status="disabled"):(0,a.$K)(e.spaceId)&&e.spaceId===n.space_id?l.pointer={...e,spaceId:n.space_id}:(P.log({data:{miscDataToConvertToString:{...s,duplicateAutomationTriggerSpaceId:e.spaceId,sourceAutomationSpaceId:n.space_id}},from:"duplicateHelpers.duplicateAutomationEventValueHelper",level:"info",type:"duplicateAutomationMissingTriggerCollectionSpaceId"}),n.trigger.event.source=void 0,n.status="disabled"):(P.log({data:{miscDataToConvertToString:{...s,sourceAutomationTriggerSourceId:l.pointer.id}},from:"duplicateHelpers.duplicateAutomationEventValueHelper",level:"info",type:"duplicateAutomationMissingTriggerCollectionView"}),n.trigger.event.source=void 0,n.status="disabled")}else"filter"===l.type||(0,a.t1)(l);else P.log({data:{miscDataToConvertToString:s},from:"duplicateHelpers.duplicateAutomationEventValueHelper",level:"info",type:"duplicateAutomationMissingTriggerSource"}),n.status="disabled"}({duplicateRecord:o,mapper:r,originalRecord:n})}function de(e){const{originalRecord:t,duplicateRecord:n,mapper:o,getRecordRole:r,options:i,originOptions:s,duplicateBlocks:l=!0}=e,d=t.space_id!==n.space_id,u={table:k.Xj,id:t.id,spaceId:t.space_id},p=o({requested:L.dr.fromPointerLike({table:n.parent_table,id:n.parent_id,spaceId:n.space_id}),requester:u});let m=r;!function(e){const{automationAction:t,mapper:n,options:o}=e;if(!t.config)return;const r=(e,t)=>({spaceId:t.spaceId,...n({id:t.id,table:t.table,spaceId:t.spaceId}),table:e});if("create_page"===t.type){if(t.config.collection&&(t.config.collection=r(K.vF,t.config.collection)),t.config.template_page_id){(null==o?void 0:o.isTemplateInstantiation)&&o.sourceBlockIds.has(t.config.template_page_id)||(t.config.template_page_id=r(w.iU,{id:t.config.template_page_id,table:w.iU,spaceId:t.space_id}).id)}}else if("query_collection"===t.type)t.config.collection&&(t.config.collection=r(K.vF,t.config.collection));else if("update_pages"===t.type){const e=t.config.target;e&&("collection"===e.type?(e.collection=r(K.vF,e.collection),e.filter&&le(e.filter,(e=>{var t;return null===(t=n(e))||void 0===t?void 0:t.id}))):"variable"===e.type||("page"===e.type?e.page=r(w.iU,e.page):(0,a.t1)(e)))}else if("open_page"===t.type){const e=t.config.target;e&&("page"===e.type?e.page=r(w.iU,e.page):"variable"===e.type||"url"===e.type||(0,a.t1)(e))}else if("complete_sprint"===t.type){const e=t.config.sprint_collection,n=t.config.task_collection;t.config.sprint_collection=r(K.vF,e),t.config.task_collection=r(K.vF,n)}else"define_variables"===t.type||"duplicate_blocks"===t.type||"modal_confirmation"===t.type||"slack_notification"===t.type||"assistant"===t.type||"send_in_app_notification"===t.type||"send_gmail_notification"===t.type||"assistant_basic"===t.type||"http_request"===t.type||(0,a.t1)(t)}({automationAction:n,mapper:e=>{const t=o({requester:u,requested:e});return t?(m=N.DH.tryUntilFound(N.DH.constantForPointer(t,"editor"),m),t):d?(m=N.DH.tryUntilFound(N.DH.constantForPointer(e,"none"),m),e):e},options:i.resolveAutomationConfig}),function(e){const{automationAction:t,requester:n,mapper:o,originOptions:r}=e;function i(e){const r=(0,T.MY)(e);if("action"===r.source){var i;const e=(null===(i=o({requester:n,requested:{id:r.action_id,table:k.Xj,spaceId:t.space_id}}))||void 0===i?void 0:i.id)??r.action_id;return(0,T.Kd)({...r,action_id:e})}if("global"===r.source)return e;(0,a.t1)(r)}const s=_.kk5.fromValue(k.Xj,t),l=(0,c.C)(t.type)({action:s,visitor:{visitFormula:e=>{const a=(0,M.Zw)(e,i);let s;return s=a.value?{...a,value:ue({...r,text:{value:a.value,spaceId:t.space_id},mapper:o,requester:n,resolveTemplateVariables:!1})}:a,{type:"replace",value:s}},visitVariableOutsideOfFormula:e=>({type:"replace",value:i(e)})}}),d=O.Ak.create();d.setValue(s.pointer,t),(0,E.FS)({recordMap:d,operations:l,updateOnly:!1});const u=d.getModel(s.pointer);if(!u)throw new Error("Updated automation action not found in record map");t.config=u.getConfig()}({automationAction:n,mapper:o,requester:u,originOptions:s});const g=(null==p?void 0:p.id)??n.parent_id;n.parent_id=g,d&&"slack_notification"===n.type&&(n.config={});const h=(0,f.o0)(n);if(h){h.some((e=>{const t=m(e.pointer);return!t||!(0,U.yY)(t,e.minimumRequiredRole)}))&&(n.config={})}const v=(n.blocks??[]).map((e=>{var t;return null===(t=o({requested:L.dr.fromPointerLike({table:w.iU,id:e,spaceId:n.space_id}),requester:u}))||void 0===t?void 0:t.id})).filter(a.$K);n.blocks=v.length>0?v:void 0,l||(n.blocks=void 0)}function ue(e){const{text:t,mapper:n,requester:o,resolveTemplateVariables:r,baseUrl:i,publicDomainName:s}=e;if(void 0!==t)return t.value.map((e=>function(e){const{token:t,mapper:n,requester:o,resolveTemplateVariables:r,baseUrl:i,publicDomainName:s}=e,l=x.hDy(t.token);let c;const d=l.map((e=>{if(x.STW(e)){const t=x.yrl(e);if(t){const e=n({requested:t,requester:o});if(e)return x.$0A(e.id,e.spaceId)}}if(x.j0F(e)){const t=x.zW$(e),r=(0,A.A5)({url:t,baseUrl:i,publicDomainName:s});if(r){const e=n({requested:{table:w.iU,id:r,spaceId:(0,Y.C)(void 0)},requester:o});if(e)return x.edl((0,A.nR)({pageId:e.id}))}}if(x.nSN(e)){const t=x.frW(e);if(t){const e=n({requested:{table:w.iU,id:t,spaceId:(0,Y.C)(void 0)},requester:o});if(e)return x.x36(e.id)}}if(x.xw5(e)){const r=x.h19(e),i=n({requested:{table:H.qF,id:r,spaceId:t.spaceId},requester:o});if(i)return x.jw(i.id)}if(x.aq(e)&&r){const t=J.x5(e,r);if(t&&x.IWo(t)&&r){const e=x.zEN(t);if(e===r.currentUserId){if(c)return;c=e}}return t}if(x.IWo(e)&&r){const t=x.zEN(e);if(t===r.currentUserId){if(c)return;c=t}}if(x.Lyt(e)){const t=x.pxR(e);if((0,x.CEh)(t)||!t.collection)return e;const r=n({requester:o,requested:t.collection});if((null==r?void 0:r.table)!==K.vF)return e;const i=t.property;return x.kbv({collection:r,property:i})}return e})).filter(a.$K);return x.V3y(x.WiV(t.token),d)}({token:{token:e,spaceId:t.spaceId},mapper:n,requester:o,resolveTemplateVariables:r,baseUrl:i,publicDomainName:s})))}function pe(e){const{rootSourceBlockIds:t,childSourcePointer:n,getSourceRecordValue:o}=e;for(const r of(0,Z.BW)(n,o))if(me({rootSourceBlockIds:t,recordWithTable:r}))return!0;return!1}function me(e){const{recordWithTable:t,rootSourceBlockIds:n}=e;if(t.table!==w.iU)return t.table===k.Xj;if(n.includes(t.value.id))return!1;if(_.kk5.fromBlock(t.value).isTemplateVariableContainerBlock())return!0}function ge(e){const{mapper:t,requested:n,requester:o}=e,r=t({requested:n,requester:o});if(!r)throw new Error(`Unable to find mapped duplicate for ${n.table} ${n.id} while duplicating ${o.table} ${o.id}`);return r}function fe(e){const{mapper:t,requested:n,requester:o,table:r}=e,i=ge({mapper:t,requested:n,requester:o});if(!(0,L.$O)(i,r))throw new Error(`Expected mapped duplicate for ${n.table} ${n.id} to be a ${r}, but it is a ${i.table} (while duplicating ${o.table} ${o.id})`);return i}},840654:(e,t,n)=>{n.d(t,{A_:()=>i,RO:()=>c,XW:()=>l,lO:()=>s,to:()=>a,x_:()=>r});var o=n(653965);const r=.5,i=4.9,a=.1,s=1;function l(e){switch(o.uZ(o.NM(e,1),r,i)){case r:return 155;case.6:return 128;case.7:return 108;case.8:return 94;case.9:return 83;default:return 75}}function c(e){const t=o.uZ(o.NM(e,1),r,i);switch(t){case r:return 273;case.6:return 228;case.7:return 195;case.8:return 171;case.9:return 151;case 1:return 136;case 1.1:return 123;case 1.2:return 113;case 1.3:return 105;case 1.4:return 97;case 1.5:return 91;case 1.6:return 85;default:return Math.max(85-Math.floor(10*(t-1.6)*5),0)}}},133728:(e,t,n)=>{n.d(t,{BZ:()=>d,CU:()=>p,Gd:()=>h,H3:()=>a,dq:()=>u,dy:()=>v,nj:()=>m,oH:()=>s,t_:()=>y,zI:()=>g});n(757658);var o=n(983999),r=n(653965),i=(n(307032),n(218265),n(780994));function a(e){if(e){const t=f(e);if(!t)return;const{name:n,domain:o}=t;return`${n.trim().toLowerCase()}@${o.trim().toLowerCase()}`}}function s(e){return Boolean(e&&o.validate(e))}const l=/[a-z0-9.!#$%&'*+/=?^_`{|}~\-]+@[a-z0-9._+\-]+\.[a-z0-9._+\-]+/gi,c=/^[a-z0-9.!#$%&'*+/=?^_`{|}~\-]+(@([a-z0-9._+\-]+(\.[a-z0-9._+\-]+)?)?)?$/gi;function d(e){const t=e.match(c);return!!t&&t.length>0}function u(e){const t=function(e){const t=e.match(l);if(t&&!(t.length<1))return a(t[0])}(e);return t||""}function p(e){const t=e.match(l);return null===t?[]:r.jj(r.oA(t.map(a)))}function m(e){const t=[],n=[],o=e.split(",").map((e=>e.trim()));o.slice(0,-1).forEach((e=>{if(0===e.length)return;const o=p(e);o.length>0?t.push(...o):n.push(e)}));const i=o[o.length-1],s=p(i);let l="";if(0===s.length)l=i;else if(1===s.length){const e=s[0];a(e)!==a(i)||t.length>0?t.push(e):l=i}else t.push(...s);return{extractedEmails:r.jj(r.oA(t.map(a))),invalidParts:r.jj(n),newInputValue:l}}function g(e){const t=p(e);return t.length>1||1===t.length&&a(t[0])!==a(e)?{extractedEmails:t,newInputValue:""}:{extractedEmails:[],newInputValue:e}}function f(e){const t=e.lastIndexOf("@"),n=e.substring(0,t),o=e.substring(t+1);if(""!==n&&""!==o)return{name:n,domain:o}}function h(e){if(e){const t=f(e);if(!t)return;return t.domain}}function v(e,t){if(!e)return!1;const n=h(t);return r.q9(e,n)}function y(e){return"doubleIn"===(0,i.Aw)(e).opt?"https://privacyportal.onetrust.com/ui/#/preferences/multipage/login/85da1f3a-9621-4cdf-a38b-0c15137a20c5":"https://privacyportal.onetrust.com/ui/#/preferences/multipage/login/06108214-ebec-46eb-ba8b-20521af00794"}},895538:(e,t,n)=>{n.d(t,{Cm:()=>ee,Dz:()=>ne,Kz:()=>u,Ol:()=>re,QA:()=>p,SR:()=>j,TT:()=>m,Wb:()=>te,Z8:()=>le,_c:()=>z,tj:()=>oe,x$:()=>se,xL:()=>X,y_:()=>h});n(757658);var o=n(653965),r=n(218265),i=n(619584),a=n(541432),s=n(643593),l=n(512549),c=n(599405),d=n(421838);const u=930,p=320,m=708,g=700,f=500;function h(e,t){if(e&&t){const n=r.Qc(e).pathname||"";return n.substring(n.length-t.length,n.length).toLowerCase()===t}return!1}const v=/^(https?:)?(\/\/)?app\.hex\.tech\/[^\/]+\/app\/[^\/]+/;const y=/^(https?:)?(\/\/)?embed\.deepnote\.com\/[^\/]+/;const b=/^(https?:)?(\/\/)?gist\.github\.com\/([^\/]+\/)?[0-9a-f]+/;const _=/^(https?:)?(\/\/)?(drive|docs|sheets)\.google\.com\/(open|(document|spreadsheets|presentation)\/d\/).+/;const S=/^(https?:)?(\/\/)?docs\.google\.com\/document\/d\/[^\/]+\/edit.*/;function k(e){return S.test(e.url)}const w=/^(https?:)?(\/\/)?docs\.google\.com\/presentation\/d\/[^\/]+\/edit.*/;function x(e){return w.test(e.url)}const I=/^(https?:)?(\/\/)?docs\.google\.com\/spreadsheets\/d\/[^\/]+\/edit.*/;const C=/^(https?:)?(\/\/)?(twitter|x)\.com\/[^\/]+\/status\/[^\/]+/;const T=/^(https?:)?(\/\/)?(www\.)?google\.com\/maps\/.+/;const M=/^(https?:)?(\/\/)?framer\.cloud\/.+/;const P=/^(https?:)?(\/\/)?(www\.)?whimsical\.com\/.+/,A=/^(https?:)?(\/\/)?(www\.)?whimsical\.com\/blog\/.+/;const R=/^(https?:)?(\/\/)?(www\.)?miro\.com\/app\/board\/.+/;const D=/^(https?:)?(\/\/)?app\.abstract\.com\/share\/.+/,B=/^(https?:)?(\/\/)?share\.goabstract\.com\/.+/;const E=/^(https?:)?(\/\/)?sketch\.(com|cloud)\/s\/.+/;const F=/^(https?:)?(\/\/)?excalidraw\.com\/.+/;const Z=/^(https?:)?(\/\/)?(replit\.com|repl\.it)\/.+/;const U=/^(https?:)?(\/\/)?invis\.io\/.+/,V=/^(https?:)?(\/\/)?invisionapp\.com\/.+/,N=/^(https?:)?(\/\/)?invisionapp\.com\/inside-design\/.+/;const O=/^(https?:)?(\/\/)?(?:eu\.)?mixpanel\.com\/(project|s|public|report|p)\/.+/;const L=[".png",".jpg",".jpeg",".gif",".tif",".tiff",".bmp",".svg",".heic",".webp"];function j(e){return(0,s.g_)(e.url)||(0,s.ef)(e.url)||L.some((t=>h(e.url,t)))}const K=[".mp3",".wav",".ogg",".oga",".m4a"];function z(e){return K.some((t=>h(e.url,t)))}const q=/^(https?:)?(\/\/)?(www\.)?youtube\.com\/[watch|embed].+/,H=/^(https?:)?(\/\/)?vimeo.com\/[0-9]+/;const G=/^(https?:)?(\/\/)?([\w\.-]+\.)?figma.com\/(file|proto|board|design)\/([0-9a-zA-Z]{22,128})(?:\/.*)?$/;const W=/^(https?:)?(\/\/)?(www\.)?(use)?loom\.com\/share\/.+/;const $=/^(https?:)?(\/\/)?[\w\.]+\.typeform\.com\/to\/.+/,Y=/^(https?:)?(\/\/)?[\w\.]+\.typeform\.com\/.+/;const Q=/^(https?:)?(\/\/)?codepen\.io\/[^\/]+\/pen\/.+/;const J=[".webm",".mkv",".flv",".flv",".vob",".ogv",".ogg",".drc",".gifv",".mng",".avi",".mov",".qt",".wmv",".yuv",".rm",".rmvb",".asf",".amv",".mp4",".m4p",".m4v",".mpg",".mp2",".mpeg",".mpe",".mpv",".mpg",".mpeg",".m2v",".m4v",".svi",".3gp",".3g2",".mxf",".roq",".nsv",".flv",".f4v",".f4p",".f4a",".f4b"];function X(e){return J.some((t=>h(e.url,t)))}function ee(e){if(!(0,l.Z)(e.url))return!1;return"page"!==(0,c.parseRoute)({url:e.url,baseUrl:e.baseUrl,publicDomainName:e.publicDomainName,isMobile:!1,protocol:void 0,currentUrl:void 0}).name}const te={image:j,video:function(e){return X(e)||q.test(e.url)||H.test(e.url)},tweet:function(e){return C.test(e.url)},drive:function(e){return _.test(e.url)},gist:function(e){return b.test(e.url)},invision:function(e){return!j(e)&&!N.test(e.url)&&(U.test(e.url)||V.test(e.url))},framer:function(e){return M.test(e.url)},audio:z,maps:function(e){return T.test(e.url)},figma:function(e){return G.test(e.url)},loom:function(e){return W.test(e.url)},typeform:function(e){return $.test(e.url)||Y.test(e.url)},codepen:function(e){return Q.test(e.url)},pdf:function(e){const t=r.Qc(e.url);return Boolean(t.pathname&&t.pathname.indexOf(".pdf")>=0)},whimsical:function(e){return P.test(e.url)&&!A.test(e.url)},miro:function(e){return R.test(e.url)},abstract:function(e){return D.test(e.url)||B.test(e.url)},sketch:function(e){return E.test(e.url)},excalidraw:function(e){return F.test(e.url)},replit:function(e){return Z.test(e.url)},embed:function(e){return!!(0,l.Z)(e.url)&&("page"!==(0,c.parseRoute)({url:e.url,baseUrl:e.baseUrl,publicDomainName:e.publicDomainName,isMobile:!1,protocol:void 0,currentUrl:void 0}).name&&!i.XP(te).filter((e=>"embed"!==e)).map((e=>te[e])).some((t=>t(e))))},hex:function(e){return v.test(e.url)},mixpanel:function(e){return O.test(e.url)},deepnote:function(e){return y.test(e.url)},drawing:function(e){return!1}};function ne(e){const{preferredType:t}=e,n=i.XP(te),o=[];for(const r of n)if(te[r](e)){if(r===t&&"embed"!==t)return r;o.push(r)}return o.length>0?o[0]:"embed"}function oe(e){const{width:t,height:n,scale:o,type:r,pageWidth:i}=e,a={block_width:t,block_height:n,block_preserve_scale:Boolean(o),block_full_width:!1,block_page_width:!1};return"embed"===r||"pdf"===r?(a.block_page_width=!a.block_width,a.block_height=n||p):"video"===r&&n?(a.block_page_width=!0,a.block_aspect_ratio=n/t):"image"===r&&n?a.block_aspect_ratio=n/t:"audio"===r||"maps"===r?(a.block_width=void 0,a.block_page_width=!0):"whimsical"===r||"framer"===r||"miro"===r||"excalidraw"===r?(a.block_width=void 0,a.block_page_width=!0,a.block_height=400):"replit"===r&&(a.block_width=void 0,a.block_page_width=!0,a.block_height=600),t>i&&(a.block_page_width=!0,"image"!==r&&"video"!==r||(a.block_height=void 0)),a}async function re(e){const{type:t,isDataURL:n,source:o,trackEmbedType:r}=e;return function(e){const{type:t,isDataURL:n,url:o}=e;if(t===a.Ti.tweet||t===a.Ti.gist||t===a.Ti.figma||t===a.Ti.audio||t===a.Ti.image||n||t===a.Ti.invision||t===a.Ti.pdf||t===a.Ti.drive&&(k({url:o})||x({url:o})))return!0;return!1}({type:t,isDataURL:n,url:o})&&r(t),t===a.Ti.tweet?function(e){const{source:t}=e;return{type:"tweet",properties:{source:d.TPx(t)},format:{display_source:void 0}}}(e):t===a.Ti.gist?function(e){const{source:t}=e;return{type:"gist",properties:{source:d.TPx(t)},format:{display_source:void 0}}}(e):t===a.Ti.figma?function(e){const{source:t}=e,n=`https://www.figma.com/embed?embed_host=notion&url=${encodeURIComponent(t)}`;return{type:"figma",properties:{source:d.TPx(n)},format:{display_source:void 0,block_height:p}}}(e):t===a.Ti.audio?function(e){const{source:t}=e;return{type:"audio",properties:{source:d.TPx(t)},format:{display_source:void 0}}}(e):t===a.Ti.image||n?function(e){const{source:t}=e;return{type:"image",properties:{source:d.TPx(t)},format:{display_source:t}}}(e):t===a.Ti.invision?function(e){const{source:t}=e;return{type:"invision",properties:{source:d.TPx(t)},format:{display_source:void 0,block_height:p}}}(e):t===a.Ti.pdf?function(e){const{source:t}=e;return{type:"pdf",properties:{source:d.TPx(t)},format:{display_source:void 0,block_height:p}}}(e):t===a.Ti.drive&&k({url:o})?async function(e){const{source:t,type:n,pageWidth:o,getEmbedData:r}=e;if(t.includes("preview")){const e=await r({source:t,pageWidth:o,type:n});if(e&&!e.empty)return e}return{type:n,properties:{source:d.TPx(t)},format:{display_source:t,block_height:p}}}(e):t===a.Ti.drive&&x({url:o})?async function(e){const{source:t,type:n,pageWidth:o,isMobileDevice:r,getEmbedData:i}=e,a=await i({source:t,pageWidth:o,type:n});if(a&&!a.empty)return a;return{type:n,properties:{source:d.TPx(t)},format:{display_source:t,block_height:r?p:f,block_width:g}}}(e):t===a.Ti.drive&&function(e){return I.test(e.url)}({url:o})?async function(e){const{source:t,type:n,pageWidth:o,getEmbedData:r,isMobileDevice:i}=e;if(t.includes("preview")){const e=await r({source:t,pageWidth:o,type:n});if(e&&!e.empty)return e}return{type:n,properties:{source:d.TPx(t)},format:{display_source:t,block_height:i?p:f,block_width:g}}}(e):(r("generic"),async function(e){const{pageWidth:t,getEmbedData:n,source:o,type:r}=e,i=await n({source:o,pageWidth:t,type:r});if(i&&!i.empty)return i;let s=r,l={...oe({type:r,width:400,height:void 0,scale:!1,pageWidth:t}),display_source:o},c={source:d.TPx(o)};null!=i&&i.headerValidationFailed&&function(e){if("drive"===e||"figma"===e||"gist"===e||"invision"===e)return!1;return!0}(s)?(s=a.Ti.bookmark,l={},c={link:d.TPx(o),title:d.TPx(o)}):(l={block_height:p},c={source:d.TPx(o)});return{type:s,properties:c,format:l}}(e))}const ie=["http:","https:"],ae="http:";function se(e){const t=r.Qc(e);let n=e;if(t.protocol){if(ie.indexOf(t.protocol)<0){const o=e.slice(t.protocol.length);n=`${ae}${o}`}}else n=`${ae}//${(0,o.R5)(e,"/")}`;return n}function le(e){var t,n,o,i,a;const s=r.Qc(e,{slashesDenoteHost:!0});if(!s)return e;if(s.host&&s.host.endsWith(".embedly.com")&&s.query.src)return s.query.src;if("www.youtube.com"===s.hostname&&"/watch"===s.pathname&&s.query&&s.query.v)return r.bf({url:`https://www.youtube.com/embed/${s.query.v}`,query:{...s.query,v:void 0}});if("whimsical.com"===s.hostname&&s.pathname){const e=s.pathname.split("/").slice(-1)[0];return r.bf({url:`https://whimsical.com/embed/${e}`})}if("miro.com"===s.hostname&&s.pathname){const e=s.pathname.split("/")[3],t=s.query.playRecording?s.query.playRecording:void 0;return r.bf({url:`https://miro.com/app/live-embed/${e}/`,query:{embedMode:t?"board_recording_player":"view_only_without_ui",autoplay:"true",playRecording:t}})}if(null!==(t=s.hostname)&&void 0!==t&&t.includes("replit.com")||null!==(n=s.hostname)&&void 0!==n&&n.includes("repl.it")){return"true"===new URLSearchParams(e).get("lite")?e:r.SK(e,{lite:"true"})}if(null!==(o=s.hostname)&&void 0!==o&&o.includes("docs.google.com")&&null!==(i=s.pathname)&&void 0!==i&&i.includes("presentation")&&null!==(a=s.pathname)&&void 0!==a&&a.includes("/edit")){const e=s.pathname.replace("/edit","/preview");return r.bf({url:`https://${s.hostname}${e}`,query:{...s.query},hash:s.hash||void 0})}return e}},490902:(e,t,n)=>{n.d(t,{Q4:()=>i,YN:()=>o,tN:()=>r});const o=["✋","✋🏻","✋🏼","✋🏽","✋🏾","✋🏿"],r=o.length-1,i={}},542129:(e,t,n)=>{n.d(t,{y:()=>r});var o=n(490902);function r(e,t){let{positionalEmojiData:n}=t;const r=n[e];if(!r)return;const[i,a,s,l]=r,{keywords:c,uniqueKeywords:d}=o.Q4[e]||{};return{codepoints:i,sheetX:a,sheetY:s,variations:l,keywords:c,uniqueKeywords:d}}},415095:(e,t,n)=>{n.d(t,{G0:()=>_,Gb:()=>T,Hk:()=>b,Lq:()=>D,W3:()=>R,bk:()=>S,db:()=>I,nV:()=>A,p4:()=>P,rJ:()=>w,xo:()=>E,xu:()=>x,yS:()=>k,zX:()=>g});n(757658),n(252262),n(324506);var o=n(608575),r=n(39593),i=n.n(r),a=n(653965),s=n(401898),l=n(619584),c=n(841892),d=n(542129),u=n(522808),p=n(394302),m=n(182798);const g=60,f=64,h=1,v=/[\u{E0020}-\u{E007E}]/u,y="󠁿";function b(e,t){var n;const o=T(e);return null===(n=(0,d.y)(o,t))||void 0===n||null===(n=n.keywords)||void 0===n?void 0:n[0]}function _(e){return{x:e.sheetX*(f+2*h)+h,y:e.sheetY*(f+2*h)+h,size:f}}function S(e){return"apple"===e?c.Z.images.emoji.appleEmojiSpritesheet64Png:"twitter"===e?c.Z.images.emoji.twitterEmojiSpritesheet64Png:"google"===e?c.Z.images.emoji.googleEmojiSpritesheet64Png:(0,s.t1)(e)}function k(e,t){const n=(0,d.y)(e,t);return n&&n.variations||[]}function w(e){const t=e.toLowerCase().replace(/_/g," ").replace(/-$/g,"").replace(/-([a-z])/g," $1").replace(/\s+/g," ").trim();if(t)return t}function x(e){var t;const n=(null===(t=w(e))||void 0===t?void 0:t.split(/\s+/g).filter(Boolean))??[];return[w(e)??e,...n]}function I(e,t){return P(e).filter((e=>!(0,d.y)(e,t))).join("")}const C=["🏻","🏼","🏽","🏾","🏿"];function T(e){let t=e;return C.forEach((e=>t=t.replace(e,""))),t}const M=new(i())({max:30,maxAge:l.hM,updateAgeOnGet:!0});function P(e){const t=M.get(e);if(t)return t;if(a.HD(e)){const t=function(e){const t=[];let n=0;for(;n<e.length;){let o=e[n];if("🏴"===e[n]&&n+2<=e.length){const t=n;for(n+=1;n<e.length&&v.test(e[n]);)n+=1;if(n<e.length&&e[n]===y){const r=n;o=e.slice(t,r+1).join("")}else n=t}t.push(o),n+=1}return t}(a.qo(e));return M.set(e,t),t}return a.qo(e)}class A{constructor(e){this.codepointToGraphemeMap=void 0,this.codepointToGraphemeMap=new Map;let t=0,n=0;for(;n<e.length;n++){const o=e[n].length;for(let e=0;e<o;e++)this.codepointToGraphemeMap.set(t+e,n);t+=o}this.codepointToGraphemeMap.set(t,n)}getGraphemeIndex(e){return(0,m.TO)(this.codepointToGraphemeMap.get(e))}}class R{constructor(e){this.graphemeInfoArray=void 0,this.graphemeInfoArray=[];let t=0;for(const n of e)this.graphemeInfoArray.push({char:n,startIndex:t,length:n.length}),t+=n.length}getStringStartIndex(e){return(0,m.T)(0<=e&&e<=this.graphemeInfoArray.length),e===this.graphemeInfoArray.length?this.getStringLength():this.graphemeInfoArray[e].startIndex}getStringEndIndex(e){return(0,m.T)(0<=e&&e<this.graphemeInfoArray.length),this.graphemeInfoArray[e].startIndex+this.graphemeInfoArray[e].length-1}getCharLength(e){return(0,m.T)(0<=e&&e<this.graphemeInfoArray.length),this.graphemeInfoArray[e].length}getStringLength(){return this.graphemeInfoArray.length?this.graphemeInfoArray.at(-1).startIndex+this.graphemeInfoArray.at(-1).length:0}getInclusiveStringRangeForSelection(e){return{startIndex:this.getStringStartIndex(e.startIndex),endIndex:this.getStringEndIndex(e.endIndex-1)}}getLength(){return this.graphemeInfoArray.length}}function D(e){const t={};for(const[n,o]of Object.entries(e.emojiByColorRaw))for(const e of o)t[e]=n;return{...e,emojiByColorProcessed:t}}Symbol("UnicodeEmojiString");function B(e){const{pathname:t}=(0,o.parse)(e),[n,r,i]=t.split("/");return{type:"custom",pointer:{table:p.p,id:i,spaceId:r}}}const E={isCustomEmojiString:e=>e.startsWith("notion://custom_emoji/"),fromPointer:e=>({type:"custom",pointer:e}),fromString:function(e){return E.isCustomEmojiString(e)?B(e):(0,u.Z)(e)?{type:"unicode",unicode:e}:void 0},fromCustomEmojiString:B,toString(e){switch(e.type){case"custom":return`notion://custom_emoji/${e.pointer.spaceId}/${e.pointer.id}`;case"unicode":return e.unicode;default:(0,s.t1)(e)}}}},178934:(e,t,n)=>{n.d(t,{Ic:()=>o});const o=Object.freeze({});Object.freeze([]),Object.freeze([])},105220:(e,t,n)=>{n.d(t,{RI:()=>i});var o=n(159730),r=n(647425);function i(e){const t=function(e){const{space:t,spaceUser:n}=e;if(void 0===t||null==n||!n.isWorkspaceOwner())return new o.XV("You do not have permissions to this feature in the requested space.",{type:"generic_insufficient_permissions"});return a(t)}(e);return void 0===t}function a(e){if(!(0,r.wP)(e.getSubscriptionTier()))return new o.XV("The feature is not available on your current plan type.",{type:"generic_insufficient_plan_type"})}},361757:(e,t,n)=>{function o(e){return"owner"===e}function r(e){return{role:"owner",id:e}}n.d(t,{A:()=>r,K:()=>o})},225972:(e,t,n)=>{n.d(t,{HX:()=>y,fK:()=>v,$A:()=>h,Jq:()=>b,j2:()=>m,Pv:()=>_,j:()=>S});var o=n(653965),r=n(552629),i=n(307032),a=n(218265),s=n(350112),l=n(815145),c=n(674686);var d=n(568626);const u=new l.nY((async e=>{const{config:t,deviceId:o,disableCookies:r}=e,c=await n.e(89543).then(n.t.bind(n,16791,23));return await new Promise((e=>{const n=t.amplitude&&t.amplitude.apiKey;if(!n)return e(void 0);const d=new URL(t.domainBaseUrl),u=`${d.host}${t.api.http}/teV1`;let p,m=!0;"http:"===d.protocol&&(m=!1),o&&(p=o.startsWith("w_")||o.startsWith("a_")?o.replaceAll("-",""):(0,i.XR)(o));const g=p,f="development"===t.env?50:1e3;c.getInstance("eventTrailApi").init(n,"",{apiEndpoint:u,forceHttps:m,includeReferrer:!0,includeUtm:!0,includeFbclid:!0,includeGclid:!0,unsetParamsReferrerOnNewSession:!1,saveParamsReferrerOncePerSession:!1,storage:r?"none":"",saveEvents:!r,savedMaxCount:f,deviceId:g},(n=>{n&&n.setVersionName((t.env,"2023092001")),e(n),function(){const e=(0,a.gy)(window.location.href);if(!e)return;const t={utm_campaign:e.searchParams.get("utm_campaign")||s.cL,utm_content:e.searchParams.get("utm_content")||s.cL,utm_medium:e.searchParams.get("utm_medium")||s.cL,utm_source:e.searchParams.get("utm_source")||s.cL,utm_term:e.searchParams.get("utm_term")||s.cL};v({traits:(0,l.bt)({...t})})}()}))}))}));function p(e,t,n){return function(i,a,s){if(200===i&&"success"===a)return;const l=o.CE(t,"experiments"),c={data:{responseBody:a,eventName:e,eventData:l,groupData:n},statusCode:i,message:null==s?void 0:s.reason};d.rateLimitedLog({level:"error",from:"eventTrailApiHelpers",type:"trackFailure",error:(0,r.Ui)(c)})}}async function m(e){const{config:t,isEnabled:n,deviceId:o,cookieService:i}=e,a=!(await c.ec({service:"amplitude",cookieService:i}));try{await u.load({config:t,isEnabled:n,deviceId:o,disableCookies:a})}catch(s){d.log({level:"error",from:"eventTrailApiHelpers",type:"initialize",error:(0,r.Ui)(s)})}}function g(e,t){const n=new e.Identify;if(t)for(const o of Object.keys(t)){const e=t[o];void 0!==e&&(Array.isArray(e)?n.append(o,e):n.set(o,e))}return n}function f(e,t,n){const o=t.userPropertiesOperations||{};n.logEvent(e,o,void 0,p(e,o))}async function h(e){const{userId:t,traits:n,spaceIds:r}=e,a=await u.getInstance();if(!a)return;a.setUserId((0,i.XR)(t));const s=g(a,n);r&&s.set("workspace",o.jj(r)),f("$identify_user",s,a)}async function v(e){const{traits:t}=e,n=await u.getInstance();if(!n)return;const o=new n.Identify;for(const r of t)"set"===r.operation?o.set(r.name,r.value):"setOnce"===r.operation&&o.setOnce(r.name,r.value);f("$identify_device",o,n)}async function y(){const e=await u.getInstance();null==e||e.setUserId(null)}async function b(e){const{spaceId:t,spaceData:n}=e;if(!t)return;const r=await u.getInstance();if(!r)return;const i=o.d9(n),a=Object.entries(i).filter((e=>{let[t,n]=e;return Array.isArray(n)}));a.forEach((e=>{let[t,n]=e;return delete i[t]}));let s=g(r,i);a.forEach((e=>{let[t,n]=e;return s=s.set(t,n)})),r.groupIdentify("workspace",t,s)}async function _(e){const t=await u.getInstance();t&&t.setDeviceId((0,i.XR)(e))}async function S(e){const{eventName:t,eventData:n,spaceId:o}=e,r=await u.getInstance();if(r)if(o){const e={workspace:o};r.logEventWithGroups(t,n,e,void 0,p(t,n,e))}else r.logEvent(t,n,void 0,p(t,n))}},512174:(e,t,n)=>{n.d(t,{DP:()=>x,KM:()=>y,LI:()=>B,NC:()=>N,TS:()=>I,XY:()=>T,YY:()=>F,_n:()=>Z,b2:()=>R,dn:()=>D,g6:()=>i,i1:()=>b,l4:()=>C,nb:()=>U,pX:()=>V});n(21703);var o=n(401898),r=n(619584);const i={"search-vectors":["log-norm","min-max-norm","cohere-snippets"],"search-no-local-blending":["on"],"search-debug-only-no-recent-boosting":["on"],"search-shorten-inactive-timer":["0","10","30","60","90"],"search-debug-only-force-random-sample":["on"],"search-debug-force-log-signals":["on"],"search-more-recent-pages-in-local":["lazy-100","lazy-200","lazy-500","lazy-1000"],"search-new-local-recall-v2":["v1","v2","v3","v4"],"search-query-expansion":["prefix-completion","word-splitting","spell-correction","all"],"search-debug-force-no-rerank":["on","always-rerank"],"vector-naive-ranker":["on"],"search-mention-model-feature-logging":["on"],"search-mentions-models":["v1","v2","dev"],"search-no-neg-boost-relation-search":["on"],"search-negative-boost-only-quickfind":["on"],"search-negative-boost-tuning":["0.01","0.1","0.25","0.5"],"search-no-bot-downrank":["on"],"search-use-recent-pages-signal":["on"],"search-use-local-reranker-layered":["on"],"search-include-all-local-sources":["on"],"search-local-edited-pages-max":["3","8","15"],"search-local-sim-users-edited-pages-max":["3","8","15"],search_supplement_possible_ancestors:["on"],search_use_new_cjk_boost:["on"],search_match_phrase_boost:["1.5","3","15"],search_use_cld_language_detection:["on"],search_additional_highlight_margin_offset_characters:["128","256","512","1024"]},a={teams_invite_link:["on"],team_invite_link_ms2:["on"]},s={grant_access_via_mentions:["on"],settings_in_space_switcher:["settings_and_corner","settings_only","corner_only"],share_menu_cleanup_experiment:["on"]},l={simplified_email_subject_line:["on"],mobile_push_notification_reply_action:["on"],inbox_2_0:["internal_prototype_time_grouping"],access_request_email_reminder:["on"],...{send_email_notifs_within_five_min_commenting_batch_window:["on"],default_always_notify_email_on:["on"],dcu_allow_actions_while_commenting:["on"],comments_pane_empty_state_cta:["on"],improved_mention_menu_ux:["both_tooltips","will_not_notify_tooltip_only"],right_gutter_comment_action:["on"],allow_page_invite_through_mention_menu:["on"],team_getting_started_with_mention:["on"],posts_prototype:["on"]}},c={acquisition_global_holdout_aa_testing:["on"],nux_onboarding_async:["on"],space_setting_people_search_bar_expand:["on"],read_persona_survey_data_from_space:["on"],expansion_share_transparency_contextual_invite:["variant1","variant2","variant3","variant4","variant5","variant6"],people_tab_show_guest_suggestions:["on"],guest_sidebar_locked:["on"],guest_sidebar_locked_v2:["on"],improve_logged_out_landing_exp_desktop:["on"],improve_logged_out_landing_exp_mobile:["on"],revamped_getting_started_for_personal:["variant_1","variant_2","variant_3","variant_4","variant_5","variant_6"],landing_home_page_tips_checklist:["land_on_home_no_checklist","land_on_home_with_checklist","land_on_getting_started_with_checklist"],generate_private_templates_for_invited_joiners:["on"],automatically_create_tasks_and_projects_for_work:["automatically_create_tasks_projects","automatically_create_tasks_projects_with_simplified_content"],onboarding_tools_step:["survey_replace_use_cases_with_tools_question","add_additional_tools_step","add_additional_use_cases_step"],workspace_survey_enable_second_workspace:["on"],desktop_download_sidebar_callout:["on"],import_google_contacts:["on"],workflow_template_customization_onboarding:["replace_app_templates_with_workflow_templates","onboarding_customize_workflow_templates","onboarding_land_and_customize_workflow_templates"]},d={mobile_user_activation_android_land_on_home_v2_exp:["on"],mobile_user_activation_android_template_pills:["on"]},u={in_app_contact_sales_cta_billing:["on"]},p={ai_limit_drop:["on"],block_management:["on"],contextual_checkout:["on"],formula_assistant:["on"],guest_limit_policy:["on"],hide_ai_limit_counter:["on"],krw_prices:["on"],jpy_prices:["on"],largesse:["on"],prices_test_country:["US","DE","GB","JP","KR","CH"],mobile_web_subscriptions:["on"],quick_workspace_creation:["on"],subscription_elements:["payment_and_address","payment"],trial_polish:["on"],tt_popup:["on"]},m={asana_to_single_team_space:["on"],asana_import_by_batch:["on"],csv_adaptiveschema:["on"]},g={inapp_show_featured_templates_for_persona:["on"],templates_sidebar_tooltip:["20k","thousands","no_number"],duplication_ux_improvement:["on"],template_dynamic_top_categories:["on"]},f={feature_settings_experiment:["on"]},h={database_ai_summary_suggestion:["on"],blurred_ai_upsell:["on"],qna_chunk_size:["small","180","240","360","480"]},v={multi_cell_auth:["v2","dual_version_on_new_token","dual_version_on_existing_token","v3"]},y=["assistant_0.2","assistant_0.25","assistant_0.25_with_marketing","assistant_0.3","development","exploratory"];function b(e){const{mode:t,currentMode:n}=e,o=["control",...y];return o.indexOf(t)<=o.indexOf(n)}const _={assistant_variant:y,ai_search_query_expansion:["single_stack","double_stack"]},S={ai_qna_alternative_embeddings:["cohere"],qna_abandoned_search_reminders:["on"],qna_show_assistant_origin_input:["on"],qna_show_large_reminders:["on"],qna_show_page_suggested_questions:["on"],qna_vectorless_enabled:["last_edited_200_pages","es_query_n_last_edited_200_pages","es_query_n_last_edited_k_pages"],assistant_show_summarize_this_page_reminder:["on"]},k={ai_addon_immediate_trigger:["on"]},w={"indexeddb-transaction-timeout-v2":["on"],"remove-profile-photo-string":["on"],"template-checklist":["on"],"clear-record-cache-on-login":["on"],"await-update-user-id":["on"],"embed-previews":["on"],"mobile-drag-delay":["1000","600","700","800","900","1100","1200","1300","1400","1500"],"android-context-menu":["on"],"mobile-bottom-bar-ios-v4":["on"],"messagestore-ios-v3":["on"],"txnqueue-ios-v6":["on"],patchExternalCollection:["on"],"emoji-apple-spritesheets":["enabled"],"default-new-page-property-to-hide-when-empty":["on"],"android-background-bridge-message-parsing":["on"],"columns-full-width":["on"],"notion-to-slack":["on"],"notion-mentions-to-slack":["on"],database_sync_for_google_calendar:["on"],database_sync_for_gitlab:["on"],database_sync_for_asana:["on"],...i,...a,...s,...l,...c,...d,...u,...p,...g,...m,...f,...h,...k,"newer-primus":["on"],statsig_space_id_debug:["on"],zendesk:["on"],highlight_legacy_transclusions:["on"],user_similarity_debugging:["on"],iframely_switch:["on"],request_membership:["on"],parallel_confluence_importer:["on"],parallel_confluence_importer_via_api:["on"],special_case_confluence_file_size:["on"],special_case_pdf_file_size:["on"],confluence_dynamic_batch_size_temp:["on"],confluence_server_allow_requests:["on"],confluence_logs:["on"],confluence_api_v2:["on"],confluence_search_api:["on"],box_file_picker:["on"],link_preview_resizing_api:["on"],google_external_integration_file_picker:["on"],enable_google_drive_external_integration:["on"],my_home:["on"],show_instruction_on_auth_popup_blocked:["on"],teamspace_guests:["on"],monday_importer:["on"],pdf_importer:["on"],migrate_confluence_into_teamspace:["on"],generic_importer:["on"],slash_command_import:["on"],special_case_generic_file_size:["on"],android_3rd_party_login_with_external_browser:["on"],ios_3rd_party_login_with_external_browser:["on"],block_limit_delay:["on"],prioritize_slash_menu_block_placeholder:["on"],slash_menu_tooltip:["on"],wiki_education_convert_modal:["bottom_right"],avoid_empty_eoip_creation_unfurl_collection:["on"],jira_import_and_sync:["on"],jira_sync_data_center_integration:["on"],use_global_local_search_cache:["on"],..._,...S,indexeddb_graceful_fallback_to_in_memory_queue:["on"],allow_auth_with_app_browser_for_mobile:["on"],property_creation_tooltips_exp:["on"],monetizationExperiments:["on"],marketing_mwn_api_kill_switch:["on"],dynamic_social_preview_image:["on"],floating_table_of_contents_variants:["floating_left","floating_right","hug_content_left"],dictation_experiment_v2:["on"],export_attachments_with_page:["on"],ai_getting_started_template:["on"],sites_timi_brand_watermark:["on"],serve_experimental_client_build:["on"],...v};function x(e){return Boolean(w[e])}const I=new Set([]),C=["ai_getting_started_template","iframely_switch","database_sync_for_google_calendar","database_sync_for_gitlab","database_sync_for_asana",...(0,o.Yd)(a),...(0,o.Yd)(s),"zendesk","highlight_legacy_transclusions","request_membership","special_case_confluence_file_size","special_case_pdf_file_size","special_case_generic_file_size","confluence_dynamic_batch_size_temp","confluence_server_allow_requests","confluence_logs","user_similarity_debugging","box_file_picker","google_external_integration_file_picker","link_preview_resizing_api","enable_google_drive_external_integration","show_instruction_on_auth_popup_blocked","parallel_confluence_importer","parallel_confluence_importer_via_api","confluence_api_v2","confluence_search_api",...(0,o.Yd)(i),...(0,o.Yd)(c),...(0,o.Yd)(d),...(0,o.Yd)(u),...(0,o.Yd)(p),...(0,o.Yd)(g),...(0,o.Yd)(m),...(0,o.Yd)(h),"teamspace_guests","monday_importer","pdf_importer","migrate_confluence_into_teamspace","generic_importer","slash_command_import",...(0,o.Yd)(l),"android_3rd_party_login_with_external_browser","ios_3rd_party_login_with_external_browser","block_limit_delay","prioritize_slash_menu_block_placeholder","slash_menu_tooltip","wiki_education_convert_modal","avoid_empty_eoip_creation_unfurl_collection","jira_import_and_sync","jira_sync_data_center_integration","use_global_local_search_cache",...(0,o.Yd)(_),...(0,o.Yd)(S),"indexeddb_graceful_fallback_to_in_memory_queue","allow_auth_with_app_browser_for_mobile","property_creation_tooltips_exp","dynamic_social_preview_image","marketing_mwn_api_kill_switch","floating_table_of_contents_variants","dictation_experiment_v2",...(0,o.Yd)(f),...(0,o.Yd)(k),"export_attachments_with_page","sites_timi_brand_watermark","serve_experimental_client_build",...(0,o.Yd)(v)],T=[...C].sort(),M=["assistant-labeler-mode","qna-reranker-skipped","experimental-cohere-only-for-personal-workspace","assistant-teacher-mode","ai_leap_is_visible","rerank_slack_only_by_cohere","ai_button_automation_enabled","slack_qna_notification_tooltip_enabled","assistant_chat_with_pdf_use_images","claude-sonnet-rollout","anthropic_explicit_prompt_caching","ai_search_arg_for_helpdocs_search","gpt-4o-mini-notion-router-rollout","load-web-page-rollout","new_ai_connectors_notifications","google_drive_qna_announcement_modal","find_related_content","compute_related_content","assistant_0point25_ux_rollout","zero_retention_routing_enabled","enable_slackbot_qna","enable_slackbot_qna_by_space","ai_assistant_helpdocs_scoped_search","assistant_enable_attachment_upload","collection_view_ai_button","full_page_translate"],P=["show_limited_qna_label","enable_limited_qna","limited_qna_dark_read"],A=["vector_db_search","embeddings-enabled-for-spaceid","extend-recall-with-recent-pages"],R=["state_management_in_new_monday_importer","allow_cut_copy_comment","dot_com_cookie_sync","force_integration_draft_to_contentful","queue_task_cross_cell_routing_enabled","queue_proxy_multi_hop_enabled","should_create_teamspace_in_zip_importer","polyglot","enforce_write_once_permissions_for_space_updates","discard_record_map_from_duplicate_block_enabled","allow_dead_space_views_when_joining_space","throw_on_changing_unmanaged_scim_user","log_all_headers_for_unknown_scim_idp","enable_get_private_page_info_endpoint","log_saml_response_on_error","highlight_quasi_alive_blocks_enabled","organization_console_enabled","organization_is_source_of_truth","deprecate_saml_config_space_ids","wiki_query_killswitch","validate_block_parent_child_relationship","fwd_wiki_to_collection_svc","debug_analytics","cell_based_queue_service_enabled","local_cell_enqueue_enabled","never_select_title_on_select_all","connected_relation","log_traces_to_splunk","log_space_traces_to_splunk","block_menu_shortcut_fix","display_date_in_user_timezone","scim_log_postgres_in_place_updates","remove_user_invited_group_notifications","disable_subscription_tier_context","prefetch_space_record_on_activity_edits","public_api_dev_mode","optimize_single_workspace","enabled_bev_default_audience_filter","sprig","ai_multi_level_undo","ai_favorites","autoretry_file_uploads","uploads_retry_embeds_immediately","uploads_retry_all_immediately","enable_secure_file_url_for_user","lock_on_scim_patch_group","prevent_saml_guest_login","fix_legacy_transclusions_on_duplicate","client-performance-profiler","react_18_concurrent_rendering",...["allow_mobile_home_redirect","sidebar_pages_hide_toggles","sidebar_home_dev_gate","home_welcome_animation","home_cover_photo","home_recents_caching","update_user_space_access_kill_switch","load_cached_page_chunk_no_space","new_invite_members_modal","allow_groups_as_team_owners","sidebar_add_new_pages_to_bottom","horizon_1_sidebar_panel_rollout","persisted_secondary_sidebar_state","share_show_dls_permission","share_menu_cleanup","share_menu_cleanup_ga"],"channel_specific_notification_messages","dev_only_show_updates_filters","enable_notifications_processor","track_collaborative_page_view","updates_ai","precheck_create_slack_notifications","tips_inapp_modal","allow_public_page_access_request","upwork_signup_flow","signup_revamp_help_message_support","guest_sidebar_popup","onboarding_polish_v1","external_access_request_rate_limiting","marketing_signup_front_app","onboarding_templates_from_dynamic_configs","contextualized_onboarding","new_user_package_onboarding","enable_smb_trial_onboarding_flow",...["page_layouts","page_layouts_presets","default_open_sidebar","stacked_properties_in_sidebar","collection_view_module_v2","page_layouts_user_education","page_layouts_user_announcement_modal","page_backlinks_refresh","layout_property_style_refresh","untyped_features","workflow_templates_prototype"],"subitems_drag_drop_improvements","intelligent_collections_sort_modal","collection_querying_use_sqlite_server","collection_client_log_looping_remote_request","collection_client_skip_looping_remote_request","collection_service_high_priority_space","collections_enterprise_workspaces","typed_db_migration","use_collection_reducer_request_hook","charts_mvp","charts_beta_launch_modal","charts_ga_launch_modal","charts_ga_modal_public_site_redirect","charts_public","aggregation_improvements","forms_mvp","forms_viewer","forms_next","forms_beta_launch_modal","forms_embed","collections_property_type_change_rename_group","collections_inline_text_property_comment","collections_cached_relation_search","collections_highlight_matching_title_tokens","timeline_item_date_range_functional","collection_timeline_view_item_new_functional","webhooks_beta","public_api_developer_survey","e_discovery","add_comments_on_blocks","install_dlp_integrations","public_api_use_secure_file_proxy","webhooks_enable_nightfall","inactive_webhook_subscription_ui","public_api_bot_token_to_space","advanced_security_in_enterprise","currency_gbp","deny_multiplayer_personal_plan_upgrade","guest_limit_debug_ui","in_app_contact_sales_marketo","jpy_prices","krw_prices","native_invoice_payment","nip_demo_code","pshwm_grace_period_enabled","sepa_debit","test_clocks","tt_affiliates","tt_bl","tt_marketing","tt_upwork","tt_smbs","pshwm_use_effective_time_to_get_spaces_with_smus","pshwm_proration_job_should_use_new_path","pshwm_high_water_mark","202407_price_update_is_enabled","202407_deny_legacy_plus_price","timed_trial_task_runner_enabled","high_watermark_pricing_ui","kr_card_payment_method","russian_sanctions_banner_enabled","russian_sanctions_sales_assisted_banner_enabled","enable_localized_templates","template_submission_backend_v2","use_duplicate_template_block_as_promise","relaunch_duplication_flow","sync_from_contentful","enable_marketplace_listing","enable_marketplace_listing_review_backend","enable_marketplace_listing_review_frontend","enable_template_detail_redesign","enable_marketplace_installation","inapp_mui","inapp_bp","enable_in_app_gallery_backend","in_app_use_algolia","marketing_use_algolia","mobile_mui_gallery","enable_template_access_restriction","self_serve_localization_backend","self_serve_localization_frontend","enable_template_installation_imprinting","csv_schema_typed_merge","csv_validation_errors_fix","csv_relation_support","csv_twoway_relation_support","card_details_unified","trello_pagination_enabled","zip_importer_enabled","csvimport_force_datadog_trace_enabled","asana-new-post-import","improved_asana_importer_screens","monday_v2_enabled","enable_default_create_crdt_page","enable_text_crdt_client","enable_text_crdt_server","show_crdt_warnings","suppress_crdt_banner","remove_replayed_set_block_operations","always_enable_page_block_tracker","disable_auto_crdt_upgrade","display_crdt_block_client","slack_action_enabled_on_button_automation","functional_collection_settings_duplicate_view","collection_view_link_paste_improvements","automation_hot_db_automations","automation_advanced_person_trigger_actions","automation_advanced_number_trigger_actions","automation_advanced_text_trigger_actions","automation_advanced_select_trigger_actions","automation_advanced_relation_trigger_actions","automation_formula_variables","automation_advanced_and_triggers","http_request_automation_action","automation_builder_modal","sites_custom_hostnames_skip_validation","sites_add_on","sites_split_publish_actions","sites_custom_hostnames_no_require_subdomain","cron_connected_relation","notion_calendar_launch_modal","calendar_home_tile_open_in_zoom_app","calendar_home_tile_caching","prevent_edits_trash_server","prevent_edits_trash_public_api","cdrr_workspace_settings","cdrr_deletion_enabled","cdrr_admin_content_search","trash_page_mention_pill","improved_trash_ui","deleted_permission_validation","trash_metadata","cdrr_deleted_from_trash_view","use_dynamo_for_permanent_deletion","cdrr_ignore_additional_parent_check_for_restore_block",...M,"typed_move_to_improved_search","search_index_collection_ranking_features","native-find-in-page","record_mention_indexing_enabled","record_mention_backfill",...A,...P,"ios_clear_selection_auto_dismiss_keyboard","mobile_app_launch_blank_page","mobile_assistant_prevent_clear_selection","mobile_show_page_shimmer","mobile_skip_onboarding_timeout","mobile_keep_template_gallery_open","mab_debugging","mobile_move_to_restore_selection_v2","new_page_navigation_fix","android_ei_gboard_delete_over_selection_fix","trash_dont_need_current_page","mobile_user_activation_template_gallery_refresh_gate","can_see_callout_modal_test","mwn_inapp_promo","language_switch_prompt","ui_guest_disable_changes","allow_space_member_to_export_analytics","space_audit_log_s3_static_config","allow_customize_integration_headers","force_capture_public_api_datadog_trace","block_attribution","workspace_consolidation_checkpoint","desktop_app_login_with_email_redirect","desktop_app_signup_hide_passcode","ios_app_signup_hide_passcode","user_data_consent_admin_bypass","link_preview_auth_with_server_integration","formula_buttons","enable_deleted_page_indicator","forethought","decagon_launch","defer_remote_version_update_for_pending_tx","survey_data_writes","enable_refetch_eoi_blocks_on_retry","adding_extra_logs_in_eoi_retry_fg","prevent_duplicate_scim_groups","snapshot_optional_collection_rollback_enabled","saml_throw_on_temporary_password_use_case_mismatch","saml_enforced_disallow_send_temporary_password","audit_log_aes_event_read","audit_log_permanently_deleted_filter_enable","audit_log_event_name_column","guest_invite_requests","drawing_block","slide_block","log_identify_cross_domain_device_ids","duplcate_template_tracking_serverside","disable_ai_big_red_button","ai_data_sharing","convert_cut_paste_to_move","page_title_in_reranker","text_align","enable_giphy_feature_gate","admin_content_search_only_search_titles","legacy_slack_notifications","overlay_trap_focus","mobile_fix_ai_message_click","google_drive_connected_relation","figma_connected_relation","zendesk_connected_relation","salesforce_connected_relation","zendesk_ai_enabled","use_iframely_cards","enable_link_mentions","enable_link_mention_hover","hyperlink_hovers","new_bookmark","new_hover_designs_lp","transcript_feedback_button","export_collections_v1","use_new_import_notification","scim_patch_race_condition_resistant_operations","is_use_unpaginated_get_jira_fields","scim_high_throughput_save_transactions","scim_use_postgres_in_place_queries","message_store_client_send_request_metric_enabled","audio_processor_client_send_request_metric_enabled","enable_organization_domain_claim","append_favorites","support_synced_database_automations","template_algolia_sync_job","template_contentful_sync_job","mobile_bridge_performance_logging","ai_source_picker","client_http_gzip","is_visibility_enabled_for_db_sync","disable_poll_jobs_for_collection_entities","export_new_structure","embed_block_fallback","marketing_mwn_api_kill_switch","marketing_mwn_api_paid_kill_switch","submit_contact_sales_kill_switch","marketo_form_kill_switch","automation_update_pages_batching","enable_guest_export","collections_view_specific_client_mode_enabled","autofill_tags","enable_vector_search_in_autotag","dark_fetch_autotag","enable_ai_suggested_properties","typed_move_to_improved_default_results","ios_enable_prefetching","hide_orphan_blocks","wiki_perf_improvement_local_enabled","show_keep_existing_guests_modal","recover_user_content_in_product","export_puppeteer_upgrade","meeting_notes_transcript_consumer_setup","meeting_notes_transcript_new_consumer","meeting_notes_formatting_fix","enable_external_integration_auth_strict_access",...M,...P,...A,"people_profile_popup","send_student_form_error_messages","disable_storage_manager_estimate","toc_nested_headings","mention_menu_page_headings","disable_qna_for_workspace","derived_property_sync_processor","enable_transcript_tab","mobile_native_external_link_fix","localized_parse_number","inert_html_attribute","sync_session_cookie","sync_session_cookie_verification","remove_apostrophe_for_maps_url","settings_console_analytics","settings_console_content_search","use_hierarchy_in_zip_importer","audit_log_guest_membership_request","is_evernote_authpopup_closing_fix_enabled","enable_oauth_from_desktop_ux_v2","enable_public_content_scanning","inactive_webhook_subscriptions","should_extract_media_from_html","csv_export_in_user_timezone","slack_token_specification","enable_server_integrations_proxy","enable_custom_siem_integration","social_media_preview_image_render_page_metadata","include_nonindexed_public_content_for_scanning","enable_list_users_by_email_addresses","low_guest_limit","presence_avatar_tooltips","notion_ai_assistant_continuous_eval_sample_rate","partitioned_universal_importer","input_padding","block_reactions","collections_virtualization","article_extractor_enable","google_doc_importer","quip_importer","deterministic_ids_in_quip_importer","page_permissions_api","ai_indexing_allowlist","scim_suppress_email","image_cropping","image_cropping_aspect_ratios","image_cropping_reset","image_hyperlink","export_html_search_engine_indexing","show_jira_import_overlay_messages","disable_jira_sync_source_for_members","jira_onboarding_tour","preload_cutaway","comic_sans","ai_public_sites_scanning","floating_table_of_contents","is_third_party_qna_enabled","code_block_preserve_indent","google_drive_qna_ingestion","google_drive_qna_initial_sync_disabled","universal_qna_gdrive_enable_marketplace_app","universal_qna_gdrive_enable_delayed_ingestion","github_qna","universal_qna_gdrive_get_recently_visited_files","universal_qna_gdrive_skip_hydration","create_snapshot_migration_enabled","docs_clipboard_imagedata","prefer_high_level_operations","mobile_quick_capture_icons_redesign","enable_token_refresh_time_bump_enabled","run_rules_engine_for_bot_api","search_notion_calendar_ltr_reranking_model","delete_records_in_jira_resync","mobile_nav_skip_add_page_check","run_rules_engine_for_publish","mso","mtb","enable_github_aisummary_linkback","github_activity_comments","github_magic_words","show_github_connected_property_settings","enable_notion_activity_notifications_in_slack","slack_db_notification_default_props_untyped_dbs","slack_db_notification_default_properties","slack_bot_enable_slack_oauth_v2","enable_notion_ai_unfurl_in_slack","markdown_support_for_slack","enable_extra_slack_bot_logs","in_app_startups_application","enable_custom_token_update_query","cdrr_workspace_settings","ai_assistant_universal_qna_web_search","ai_assistant_markdown","ai_assistant_simplified_writer_routing","ai_team","multi_cell_aware_apis","space_cache_miss_backoff_retry","show_session_expiration_error_message","db_comments","mab_consider_navigation_top_page","file_upload_post_to_s3","space_skip_messagestore_publish","human_suggested_edits_advanced_enabled","space_bypass_log_sampling","0524_assistant_empty_state","session_refresh_trust_rule_enabled","trust_rule_can_revoke_user","template_pause_creator_updates","use_new_file_token_format","colorful_presence_avatars","enable_write_personal_home_checklist_user_setting","trusted_domain_pages","trusted_domain_pages_logged_out","enterprise_trusted_domain_enabled","public_space_data_store_local_cache_disabled","add_extra_logs_refetch_external_instance_blocks","custom_emojis","id_schema","id_schema_v1","force_update_celeaf_oncompositionend","formal_postgres_proxy","dictation_new_page_nux","organization_is_source_of_truth_for_saml","search-custom-action-results","sticky_inbox_date_buckets","locke","capi_v1","capi_v2","suggestion_notification_enabled","integration_publish_request","integration_creation_ui","performance_debugging_toolbar","load_cached_page_chunk_multi_cell_enabled","load_page_chunk_multi_cell_enabled","serve_experimental_client_build_dev","load_page_chunk_omit_existing_record_versions","send_request_ack_metric_enabled","content_export_checkpointing","token_v2_clientside_refresh","workspace_member_access_notif_polish","sync_session_cookie_refresh","turbopuffer_real_read","state_management_in_monday_importer","preserve_text_around_links_confluence","dev_search_team_feature_gate","dont_rate_limit_public_content_ai_scans","csvimport_faster_navigate_to_page_enabled","slack_ingestion_use_new_handler","should_use_confluence_attachment_map","rules_engine_fetch_with_timeout","deprecate_presence_expiration","docs_list_actions_remove_no_clone","update_roles_via_scim","docs_simplify_placeholder_new_users","docs_simplify_placeholder_existing_users","log_destroy_presence","create_v2_callouts","save_transactions_upgrade_callouts_to_v2","gmail_automation_action","github_student_pack","log_messagestore_attempts","respect_error_retryable_enabled","persistence_status_indicator","enable_page_previews","enable_slack_embed_tooltips_actual","content_export_email_render","multi_cell_backlinks","desktop_show_universal_link_setting_hint","assistant_new_find_in_experience","get_all_highlight_annotations","login_device_management","new_bot_token_hash_writes","enable_hipaa_self_serve","enable_token_store_caching","global_oauth_confirmation_ui","github_ai_connector_consumer_setup","github_ai_connector_configuration","search_secondary_surfaces_hook","serve_desktop_service_worker_gate","mobile_mab_mrr","mab_refresh_personalization_gate","new_bot_token_encrypt_secret_writes","dot_com_help_embeds","automations_open_url_action","docs_function_list_item_block2","omit_space_from_page_cache","docs_function_editable","functional_component_page_view_block","docs_function_code_block_value","functional_component_page_loading_container","store_user_properties_in_external_schema_for_jira_sync","lucy-in-the-sky-with-tab-blocks","use_signed_image_variant_endpoint","custom_jira_sync_flow_for_jira_members","read_user_from_primary","assistant_quiz_skill","beta-developers-external","show_slash_menu_v2","space_lookup_search_engine_only","functional_component_simple_table_block","rules_engine_query_qwak_by_default","unfurl_disable_store_verify","editor_basic_rtl"],D=[...R].sort();const B={event_trail_events:{},page_tree_query_strategy:{strategy:"js_recursion_property_filter_sql"},event_trail_routing:{},collection_request_settings:{clientFormulaTimeoutMs:30*r.C0},sentry:{errorsSampleRate:0,"tracesSampleRate-v0":0,"replaysSessionSampleRate-v0":0,"replaysOnErrorSampleRate-v0":0,profilesSessionSampleRate:0,profilesSampleRate:0},gtm_ai_favorites:{space_id:void 0,collection_id:void 0},palette:{"sessionSampleRate-v4":0,pageLoadSampleIntervalMs:10,interactionSampleIntervalMs:10,maxBufferSize:1e5},palette_analyzer:{databaseId:""},permanently_delete_tree_queue_task_override:{queue_task_kill_switch_on:!1,task_delay_override_seconds:void 0,elastic_search_request_batch_size:200,s3_request_batch_size:200,redis_read_batch_size:1e4,tree_iteration_batch_size:1e4,tree_iteration_max_buffer_size:5e4,postgres_query_batch_size:1e5},load_test_simulator_configs:{commenter_interval_ms:1e3,page_viewer_interval_ms:100,editor_interval_ms:1e3,editor_typing_interval_ms:100,presence_interval_ms:1e3},education_free_submit_form_config:{},startups_airtable_config:{},confluence_server_groups:{default:{read:[],create:[]}},notion_people_block_id:{data:{}},template_ids_to_use_duplicate_block:{data:[]},template_ids_not_to_use_duplicate_block_server:{data:[]},template_to_previous_blocks_duplication_config:{},load_test_bypass_rate_limit_page_ids:{pages:[]},csv_limits:{maxRelationPages:1e3,maxRows:1e5,maxColumns:500},xlsx_limits:{maxRows:1e5,maxColumns:1e3},jira_resync_frequencies:{importResyncFrequencyMS:24*r.U6,importResyncViaWebhookLifeTimeMS:3*r.U6,importResyncViaWebhookDelayedSeconds:3*r.d},jira_import_batch_config:{processIssueBatchSize:10,attachmentBatchSize:1},jira_importer_records_fetch_limit:{records_limit:10},jira_attachments_config:{attachmentSize:1e6,numberOfAttachments:5},model_overrides:{},slack_contacts_limit:{maxLimit:100,defaultLimit:100},automation_update_pages:{},inbox_2_0_shadow_traffic_testing:{getNotificationLogPassRate:0,getUserNotificationsPassRate:0},active_token_counter_config:{},text_crdt_config:{delete_merge_slice_tree_block_limit:100,crdt_page_banner_link:"https://dev.notion.so/notion/Conflict-Resolution-784929c697f54e1eb18d77ac782fc548"},default_create_crdt_page_config:{private:!1,space:!1,team:!1,app_template:!1,collection_table_view:!1,collection_non_table_view:!1,collection_unknown_view:!1,collection_instantiate_template:!1,other:!1,automation_action:!1,comment:!1,external_object_instance_page:!1},dev_ai_context:{suggestOnPageNavigationProbability:0},qna_ai_reminders:{abandonedSearchReminderProbability:0},mobile_inbox_2_0_feedback:{},paste_event_logging:{samplePercentage:0,redactedHtmlMaxSize:4096},article_extractor_enable_urls:{urls:[]},ai_qna_silent_retry_mode:{},ingestion:{slack:{clientId:"",prefix:"",channelIds:[],ingestionTopic:"",adminScopes:[],userScopes:[],userMappingScopes:[],maxChannelsPerPartition:0,enablePermissionsFilter:!1,sendToKafka:!1,showRemoveWorkspaceIntegration:!1,ingestionKafkaMaxSize:1992294,learnMoreUrl:"https://notion.so",runPoller:!0,pollerBatchSize:10,maxProcessingTime:30,allowPollerToDelete:!1},googleDrive:{mainPollTime:600,ingestionTopic:"",sendToKafka:!1,batchSizeForFileSync:10,mainPollEnabled:!0,learnMoreUrl:"https://notion.so",ingestionKafkaMaxSize:2097152,enableSlidesSheetsPages:!1,enablePageCitations:!1,pageSize:2e3,initialSyncUserBatch:30,initialSyncFileBatch:100,googlePageSize:100,googleTokenAPIConcurrentRequestLimit:10,timeDeltaForActivityInMS:6e5,googleApiRetryConfig:{retryAttemptsMS:[500,1e3,2e3],retryAttemptRandomOffsetMS:500},initialSyncDelayInCompletion:3600,googleAuthUrl:"https://workspace.google.com/marketplace/app/notion_ai/988713442660",troubleShootingUrl:"https://notion.so",initialSyncStartDelayInSec:3600,enableStaleDataCheck:!0,deleteQueueTaskSecondRunDelay:3600},bucket:"",kafka:{topic:"",partitionCount:0},batchSizeForS3FileDeletes:10},create_snapshot_configs:{load_subtree_batchSize:500,load_subtree_query_limit:10},universal_qna:{defaultExternalSources:[],blendedRecall:{strategy:"cohere"},minCosScoreGoogleDrive:-1,s3Parallelism:100,hydrationParallism:20,maxSpreadsheetsToHydrate:5,asyncLabelingRatio:{notion:0,slack:0,googleDrive:0,github:0},helpdocsCachingExpireMs:36e5},qna_embedding:{embeddingMethod:void 0},collection_virtualized_load_limits:{table:{initial_limit:50,increment_limit:50}},slack_pause_ingestion:{liveIngestion:{allWorkspaces:{events:[{type:"user_change"}]},specificWorkspaces:[]},bulkIngestion:[]},link_paste_order:{defaultOrder:{name:"Default",order:["preview","mention","link"]}},collection_service_concurrency_cost_limit:{},query_collection_rate_limit:{},query_collection_slow_mode:{windowSeconds:10,requestThresholdPerWindow:1e3,clientThrottleMs:1e3},query_collection_size_based_slow_mode:{config:[]},query_collection_chart_refetch_settings:{clientThrottleMs:3e3},collection_reducer_request_settings:{chart:{debounce_wait_ms:1e3},general_debounce_wait_ms:void 0},charts_query_collection_limits:{},mc_config:{},id_schema_dynamic_config_v2:{percent:0},id_schema_dynamic_config_v3:{percent:0,real_id:!1},sites_settings:{custom_domain_limit:void 0,custom_hostname_validation:{retry_delay:1e3,max_retries:5,inject_failure_percent:0}},mobile_dictation_visualizer:{lowshelf_filter_frequency:1500,lowshelf_filter_gain:-30,fft_size:256,min_hz:void 0,max_hz:void 0},load_test_trace_config:{queue_page_viewer_simulator_sample_rate:0,load_test_inner_sample_rate:0},activity_type_aes_config:{default:"iae"},home_new_user_checklist_config:{daysSinceSignupToHide:30,daysSinceSignupToMoveDown:2,launchDateMs:17185212e5},capi_v2_event_names:{StartTrial:!1,InitiateCheckout:!1,CompleteRegistration:!1,Purchase:!1,PurchaseWorkType:!1,PurchaseWorkTypeProfessionalDomain:!1,Subscribe:!1,SubscribeAI:!1},imports_queue_config:{asana:{saveTransactionsBatchSize:100,fetchTaskBatchSize:100,globalUseCrdt:!0}},always_force_refetch_for_specific_tables:{tables:[]},callout_config:{callout_blocklist:[]},integration_standards_url:{url:""},integration_tech_partners:{tech_partner_ids:[]},multicell_api_config:{default_max_depth:10,api_overrides:{}},onboarding_templates:{joiner:{}},qa_skip_mobile_onboarding:{subaddress:void 0},monday_v2_config:{unsupported_properties:[]},github_ai_connector_configuration:{timeFrame:365,shouldIndexData:!0,shouldIndexCode:!1}},E=new Set(C);function F(e){return E.has(e)}new Set(R);function Z(e){return w[e]}const U="_unassigned_";const V="NoExperimentActor";function N(e,t){const n=Object.keys(e.value).find((e=>e.toLowerCase()===t.toLowerCase()));return n?e.get(n,null):e.get(t,null)}},664962:(e,t,n)=>{n.d(t,{O:()=>F});n(757658);var o=n(653965),r=n(619584),i=n(266897),a=n(815145),s=n(715070),l=n(990559),c=n(435011),d=n(180951),u=n(334299),p=n(756373),m=n(401800),g=n(640506),f=n(407057),h=n(253877),v=n(761075),y=n(264572),b=n(225718),_=n(959753),S=n(463306),k=n(421202),w=n(177420),x=n(606287),I=n(519889),C=n(421838),T=n(307928),M=n(604308);const P=f.ZV;function A(e){return(0,v.hJ)({...e,fromString:e=>e}).join("")}function R(e){const{textValue:t}=e;if(t){const n=[];for(const o of t)C.QJH(o)||n.push(A({...e,textValue:[o]}));return n.join(", ")}return""}const D={[C.GKr.Page]:e=>{let{annotation:t,exportArgs:n}=e;const{getExportedPathToPage:o}=n,r=C.TOT(t),i=(0,v.Ho)({intl:n.intl,blockId:r,getRecordValue:n.getRecordValue,userTimeZone:n.userTimeZone}),a=o({toPageId:r});if(i&&a)return`${i} (${a})`},[C.GKr.CustomEmoji]:e=>{let{annotation:t,exportArgs:n}=e;const{getRecordValue:o}=n,r=C.PtE(t);if(!r)return;const i=_.omK.fromGetRecordValueFn(o)(r);return i?i.getRenderTitle():void 0},[C.GKr.Comment]:e=>{let{annotation:t,exportArgs:n}=e;const{getRecordValue:o,baseUrl:r}=n,i=_.omK.fromGetRecordValueFn(o),s=C.$WM(t);if(!s)return;const l=i(s);if(!l)return;const c=l.getParentId(),d=l.getParentPointer(),u=(0,S.el)((0,S.DW)(d,o));if(!u)return;const p=i(d);let g;if(p){const e=i(p.getParentPointer());g=e&&"table_row"===e.getType()?e.getParentId():p.getParentId()}return(0,m.Z)({pageId:u.id,scrollToBlockId:g,pageValue:u,baseUrl:r,discussionId:c,pageVisitSource:a.tY.Export})},[C.GKr.Link]:e=>{let{annotation:t,exportArgs:n}=e;const{getExportedPathToFile:o,getExportedPathToPage:r,navigableBlockId:i,baseUrl:a,publicDomainName:s}=n,l=C.zW$(t),c=(0,y.A5)({url:l,baseUrl:a,publicDomainName:s});return c?r({toPageId:c}):o({fromBlockId:i,toFileURI:l})},[C.GKr.User]:e=>{let{annotation:t,exportArgs:n}=e;const{intl:o}=n,r=C.zEN(t),i=n.getRecordValue({table:I.KJ,id:r});if(i)return`@${(0,T.Nz)(o,i)}`},[C.GKr.Bot]:e=>{let{annotation:t,exportArgs:n}=e;const o=C._Rq(t),r=n.getRecordValue({table:w.cZ,id:o});if(r)return`@${(0,s.Mh)(r)}`},[C.GKr.Group]:e=>{let{annotation:t,exportArgs:n}=e;const o=(0,v.kF)({annotation:t,exportArgs:n});if(o)return o},[C.GKr.ExternalObjectInstance]:e=>{var t;let{annotation:n,exportArgs:o}=e;const r=C.frW(n);return null===(t=o.getRecordValue({table:k.iU,id:r,spaceId:o.root.spaceId}))||void 0===t||null===(t=t.format)||void 0===t?void 0:t.original_url},[C.GKr.LinkMention]:e=>{let{annotation:t,exportArgs:n}=e;const{href:o}=C.r0m(t);return o},[C.GKr.Date]:e=>{let{annotation:t,exportArgs:n}=e;const{date_format:o,time_format:r,...i}=C.zyO(t);return`@${(0,f.ZV)({value:i,date_format:o,time_format:r,userTimeZone:n.userTimeZone,allowRelativeDates:!1,intl:n.intl})}`},[C.GKr.Equation]:e=>{let{annotation:t,exportArgs:n}=e;const o=(0,b.dx)(t),r=(0,b.wB)(t,n.getExportedPathToPage,n);return`${o}${C.xey(t)}${r}`},[C.GKr.Bold]:v.Hf,[C.GKr.Italic]:v.Hf,[C.GKr.Strike]:v.Hf,[C.GKr.Code]:v.Hf,[C.GKr.Highlight]:v.Hf,[C.GKr.Discussion]:v.Hf,[C.GKr.Underline]:v.Hf,[C.GKr.Inserted]:v.Hf,[C.GKr.Deleted]:v.Hf,[C.GKr.TemporaryComment]:v.Hf,[C.GKr.TemporaryCursor]:v.Hf,[C.GKr.TemporaryEquation]:v.Hf,[C.GKr.TemporaryPage]:v.Hf,[C.GKr.TemporaryInput]:v.Hf,[C.GKr.TemporarySelection]:v.Hf,[C.GKr.TemporaryFindHighlight]:v.Hf,[C.GKr.TemporarySelectedFindHighlight]:v.Hf,[C.GKr.TemplateVariable]:v.Hf,[C.GKr.FormulaPageProperty]:v.Hf,[C.GKr.FormulaContextValue]:v.Hf,[C.GKr.FormulaError]:v.Hf,[C.GKr.Citation]:v.Hf,[C.GKr.SuggestionInsertText]:v.Hf,[C.GKr.SuggestionRemoveText]:v.Hf,[C.GKr.SuggestionAnnotate]:v.Hf,[C.GKr.SuggestionUnannotate]:v.Hf,[C.GKr.TemporaryNativeMABFilter]:v.Hf,[C.GKr.TemporaryDictation]:v.Hf,[C.GKr.TemporaryHighlight]:v.Hf,[C.GKr.AssistantInstructionsCollection]:v.Hf};function B(){}function E(){return Promise.resolve(void 0)}const F={blockRenderers:{text:B,header:B,sub_header:B,sub_sub_header:B,quote:B,bulleted_list:B,toggle:B,to_do:B,numbered_list:B,code:B,page:B,image:B,video:B,embed:B,bookmark:B,file:B,tweet:B,maps:B,gist:B,framer:B,invision:B,mixpanel:B,drive:B,figma:B,loom:B,pdf:B,typeform:B,codepen:B,audio:B,divider:B,equation:B,collection_view:B,collection_view_page:B,column_list:B,column:B,factory:B,copy_indicator:B,breadcrumb:B,link_to_collection:B,link_to_page:B,table_of_contents:B,callout:B,whimsical:B,miro:B,abstract:B,sketch:B,excalidraw:B,replit:B,alias:B,transclusion_container:B,transclusion_reference:B,external_object_instance:B,table:B,table_row:B,tab:B,hex:B,deepnote:B,external_object_instance_page:B,button:B,ai_block:B,drawing:B,slide:B,personal_home_page:B,form:B,post:B},asyncBlockRenderers:{text:E,header:E,sub_header:E,sub_sub_header:E,quote:E,bulleted_list:E,toggle:E,to_do:E,numbered_list:E,code:E,page:E,image:E,video:E,embed:E,bookmark:E,file:E,tweet:E,maps:E,gist:E,framer:E,invision:E,mixpanel:E,drive:E,figma:E,loom:E,pdf:E,typeform:E,codepen:E,audio:E,divider:E,equation:E,collection_view:E,collection_view_page:E,column_list:E,column:E,factory:E,copy_indicator:E,breadcrumb:E,link_to_collection:E,link_to_page:E,table_of_contents:E,callout:E,whimsical:E,miro:E,abstract:E,sketch:E,excalidraw:E,replit:E,alias:E,transclusion_container:E,transclusion_reference:E,external_object_instance:E,table:E,table_row:E,tab:E,hex:E,deepnote:E,external_object_instance_page:E,button:E,ai_block:E,drawing:E,slide:E,personal_home_page:E,form:E,post:E},annotationRenderers:D,propertyRenderers:{title:e=>A(e),text:A,select:e=>{const{textValue:t,propertySchema:n}=e,o=n.options||[];return d.Sj(t,o)},multi_select:e=>{const{textValue:t,propertySchema:n}=e,o=n.options||[],r=d.uP(t,o);return r.sort(),r.join(", ")},status:e=>{const{textValue:t,propertySchema:n}=e;return d.ZG(t,n)},relation:e=>{const{textValue:t,propertySchema:n,exportArgs:o}=e;if("relation"!==n.type)return;const r=d.j$({relationValue:d.rq(t),getRecordModel:_.omK.fromGetRecordValueFn(o.getRecordValue),propertySchema:n}),i=d.ow(r);return R({...e,textValue:i})},rollup:e=>{const t=e.exportArgs.getRecordValue,n=_.kk5.fromValue(k.iU,e.block),o=_.omK.fromGetRecordValueFn(t);return u.kJ({...e,block:n,getRecordModel:o,collectionRequestContext:{userId:void 0,userTimeZone:e.exportArgs.userTimeZone,depth:0,intl:e.exportArgs.intl,visitedProperties:new Set,resultCache:e.exportArgs.resultCache}})},url:e=>{let{textValue:t}=e;return C.Jcv(t)},email:e=>{let{textValue:t}=e;return C.Jcv(t)},phone_number:e=>{let{textValue:t}=e;return C.Jcv(t)},checkbox:e=>{let{textValue:t}=e;return d.Ml(t)?"Yes":"No"},person:e=>{let{textValue:t,exportArgs:n,propertySchema:r,block:i}=e;const{intl:a}=n,s=_.kk5.fromBlock(i),l=d.DW({textValue:t,propertySchema:r,blockCreatorPointer:s.getCreatedByPointer()});return o.oA(l.map((e=>{const t=n.getRecordValue(e),o=t&&_.kk5.fromValue(e.table,t);return null==o?void 0:o.getDisplayName(a)}))).join(", ")},number:e=>{let{textValue:t}=e;const n=d.VY(t);if(void 0!==n)return n.toString()},date:e=>{let{textValue:t,propertySchema:n,...o}=e;const r=o.exportArgs.userTimeZone,i=d.Gl(t),{date_format:a,time_format:s}=n;if(i)return(0,f.ZV)({allowRelativeDates:!1,value:i,date_format:a,time_format:s,userTimeZone:r,intl:o.exportArgs.intl,displayInUserTimezone:o.exportArgs.displayInUserTimezone??!1,alwaysIncludeTimezone:!0})},file:R,formula:e=>{const{property:t,schema:n,block:o,exportArgs:i}=e,{userTimeZone:a,getRecordValue:s,intl:l,resultCache:d}=i,u=(0,c.py)({schema:n,property:t,blockModel:_.kk5.fromBlock(o),getRecordModel:_.omK.fromGetRecordValueFn(s),intl:l,userTimeZone:a,depth:0,resultCache:d});return"boolean"==typeof u?u?"Yes":"No":(0,r.hj)(u)?u.toString():(0,g.U3)(u)?P({value:u,userTimeZone:a,allowRelativeDates:!1,intl:i.intl}):u},created_time:e=>{const{block:t,exportArgs:n}=e,{userTimeZone:o}=n;if(t.created_time)return P({allowRelativeDates:!1,value:(0,h.CQ)(t.created_time,o),userTimeZone:o,intl:n.intl})},last_edited_time:e=>{const{block:t,exportArgs:n}=e,{userTimeZone:o}=n;if(t.last_edited_time)return P({allowRelativeDates:!1,value:(0,h.CQ)(t.last_edited_time,o),userTimeZone:o,intl:n.intl})},created_by:e=>{const{block:t,exportArgs:n}=e,{getRecordValue:o,intl:r}=n;if(t.created_by_table&&t.created_by_id){const e=(0,i.Hl)({getRecordValue:o,pointer:{table:t.created_by_table,id:t.created_by_id,spaceId:t.space_id}});if(e.asActor)return(0,i.$4)(r,e)}},last_edited_by:e=>{const{block:t,exportArgs:n}=e,{getRecordValue:o,intl:r}=n;if(t.last_edited_by_table&&t.last_edited_by_id){const e=(0,i.Hl)({getRecordValue:o,pointer:{table:t.last_edited_by_table,id:t.last_edited_by_id,spaceId:t.space_id}});if(e.asActor)return(0,i.$4)(r,e)}},button:e=>"",auto_increment_id:e=>{let{textValue:t,block:n,exportArgs:o}=e;const r=d.ah(t),{getRecordValue:i}=o;if(void 0!==r){const e=_.kk5.fromBlock(n),t=e.getParentTable();if(t!==x.vF)return;const o=i((0,p.We)({spaceId:e.getSpaceId(),parentTable:t,parentId:e.getParentId()}));return(0,l.wf)(null==o?void 0:o.record_key,r)}},last_visited_time:e=>"",location:e=>"",verification:e=>{let{textValue:t,exportArgs:n}=e;const o=d._w(t);if(!o)return"";const r=M.WN(o);return n.intl.formatMessage(M.A3(r.type))}}}},761075:(e,t,n)=>{n.d(t,{Gb:()=>U,Hf:()=>C,Ho:()=>Z,J6:()=>M,K9:()=>R,LK:()=>P,Qx:()=>E,Wy:()=>x,ZW:()=>B,_2:()=>k,_f:()=>w,cN:()=>I,hJ:()=>T,kF:()=>D});n(757658),n(430541);var o=n(709291),r=n(653965),i=n(401898),a=n(541432),s=n(576205),l=n(180951),c=n(560246),d=n(595200),u=n(253877),p=n(406695),m=n(295519),g=n(959753),f=n(463306),h=n(882883),v=n(421202),y=n(213493),b=n(591937),_=(n(429369),n(654584)),S=n(421838);function k(e){const{exportArgs:t,renderers:n}=e,{blockId:o,getRecordValue:r}=t,i=r({table:v.iU,id:o});if(!i)return;const a=i.type,s=e.renderers.blockRenderers[a];return s?s({block:i,exportArgs:t,renderers:n}):void 0}function w(e){const{exportArgs:t,renderers:n,ticker:o}=e,{blockId:r,getRecordValue:i}=t,a=i({table:v.iU,id:r});if(!a)return Promise.resolve(void 0);const s=a.type,l=e.renderers.asyncBlockRenderers[s];return l?l({block:a,exportArgs:t,renderers:n,ticker:o}):Promise.resolve(void 0)}function x(e){const{schema:t,property:n,block:o,renderers:r,exportArgs:i}=e,a=t[n];if(!a)return;const s=(0,l.wS)(o,n),c=e.renderers.propertyRenderers[a.type];return c?c({textValue:s,propertySchema:a,property:n,schema:t,block:o,renderers:r,exportArgs:i}):void 0}function I(e){const{annotation:t,children:n,exportArgs:o,renderers:r}=e,i=S.J7s(t),a=r.annotationRenderers[i];if(a)return a({annotation:t,children:n,exportArgs:o,renderers:r})}function C(e){return e.children}function T(e){const{textValue:t,exportArgs:n,renderers:o,fromString:i}=e,a=t?S.lzi(t):[];if(0===a.length)return[];const s=a.map((e=>{let t=i(S.WiV(e));const r=S.hDy(e),a=r.filter(S.ZAl),s=r.filter((e=>!S.ZAl(e)));for(const i of a)if(t=I({exportArgs:n,renderers:o,annotation:i,children:t}),t)break;for(const i of s)t=I({exportArgs:n,renderers:o,annotation:i,children:t});return t}));return r.oA(s)}function M(e){var t;const{blockModel:n,exportArgs:o}=e,{preferredViewMap:r,getRecordValue:i}=o,a=g.omK.fromGetRecordValueFn(i),s=(null==r?void 0:r[n.id])??(null===(t=n.getCollectionViewIds())||void 0===t?void 0:t[0]);if(!s)return;const l=a({table:y.np,id:s,spaceId:n.getSpaceId()});if(!l)return;const c=l.getCollectionPointer(n);if(!c)return;const d=a(c);return d?{collectionViewModel:l,collectionModel:d}:void 0}function P(e){var t,n;const{exportArgs:o}=e,{root:i,userTimeZone:a,intl:l,getRecordValue:f,getRecordsWithParent:y}=o,b=g.omK.fromGetRecordValueFn(f);if(o.exportCollectionsV1Enabled)return function(e){var t;const{blockModel:n,exportArgs:o}=e,{root:i,userTimeZone:a,intl:s,exportFilteredCollectionView:l,getRecordValue:u,getRecordsWithParent:f}=o,y=g.omK.fromGetRecordValueFn(u),b=M(e);if(!b)return;const{collectionViewModel:_,collectionModel:k}=b;let w=[];if(l){var x;const e=null===(x=o.collectionViewExportDataMap)||void 0===x||null===(x=x.get(n.id))||void 0===x?void 0:x.filteredIds;if(null==e||!e.length)return;for(const t of e){const e=u({table:v.iU,id:t,spaceId:n.getSpaceId()});e&&(e.alive||i.table===v.iU&&i.id===e.id)&&!e.is_template&&w.push(e)}}else w=f(v.iU,k.id).filter((e=>(e.alive||i.table===v.iU&&i.id===e.id)&&!e.is_template));if(!k||0===w.length)return;const I=k.getNormalizedSchema(),C=(0,m.i)(_.getFormat()||{},I,_.getRawQuery(),p.j5.Table),T=(C.table_properties||[]).filter((e=>!l||e.visible)).map((e=>e.property));T.includes("title")||T.unshift("title");const P={},A=null===(t=_.getRawQuery())||void 0===t?void 0:t.sort;if(A){const e=c.$m({userTimeZone:a,userId:void 0,intl:s,userSorts:A,apiSorts:[],schema:I}),t=w.map((e=>e.id)),n=new c.EO([...e,...c.Xm([])]),o=new Map;w.forEach((e=>{n.updateBlock({block:g.kk5.fromBlock(e),schema:I,propertyMapping:void 0,getRecordModel:g.omK.fromGetRecordValueFn(u),resultCache:o})})),c.Qx(t,n).forEach(((e,t)=>{P[e]=t}))}else(_.getPageSort()||[]).forEach(((e,t)=>{P[e]=t}));const R=r.MR(w,(e=>P.hasOwnProperty(e.id)?P[e.id]:e.created_time?e.created_time:1/0)),D={},B=T.map((e=>{const t=I[e],n=(null==t?void 0:t.name)||s.formatMessage(F.defaultNewProperty),o=Object.values(D);let r;return r=o.includes(n)?(0,d.Z)(n,(e=>!o.includes(e))):n,D[e]=r,r}));return{schema:I,sortedBlocks:R,columnIdToName:D,columnIds:T,columnNames:B,collectionTitle:(0,h.Xh)({intl:s,textValue:k.getName(),getRecordModel:y,userTimeZone:a,deterministic:!0}),collectionDescription:S.QaF(k.getDescription()),collectionViewName:_.getName(),sortingInfo:A,filteringInfo:C.property_filters}}(e);const _=M(e);if(!_)return;const{collectionViewModel:k,collectionModel:w}=_;let x=y(v.iU,w.id).filter((e=>(e.alive||i.table===v.iU&&i.id===e.id)&&!e.is_template));if(!w||0===x.length)return;const I=w.getNormalizedSchema(),C=(0,m.i)(k.getFormat()||{},I,k.getRawQuery(),p.j5.Table),T=(C.table_properties||[]).filter((e=>"currentView"!==o.collectionViewExportType||e.visible)).map((e=>e.property));if(T.includes("title")||T.unshift("title"),"currentView"===o.collectionViewExportType&&C.property_filters){const e=(0,s.q)({filter:{filters:C.property_filters.map((e=>e.filter)).filter((e=>!(0,s.Oo)(e))),operator:"and"},propertyMapping:void 0,context:{schema:I,userId:void 0,userTimeZone:a,userStartOfWeek:(0,u.aN)(),relativeVariableResult:void 0,currentPageInRelatedCollection:void 0,intl:l}});x=x.filter((t=>e({block:g.kk5.fromBlock(t),getRecordModel:g.omK.fromGetRecordValueFn(f),propertyMapping:void 0,resultCache:o.resultCache})))}const P=null===(t=k.getRawQuery())||void 0===t?void 0:t.filter;if("currentView"===o.collectionViewExportType&&P){const e=(0,s.q)({filter:P,propertyMapping:void 0,context:{schema:I,userId:void 0,userTimeZone:a,userStartOfWeek:(0,u.aN)(),relativeVariableResult:void 0,currentPageInRelatedCollection:void 0,intl:l}});x=x.filter((t=>e({block:g.kk5.fromBlock(t),getRecordModel:g.omK.fromGetRecordValueFn(f),propertyMapping:void 0,resultCache:o.resultCache})))}const A={},R=null===(n=k.getRawQuery())||void 0===n?void 0:n.sort;if(R){const e=c.$m({userTimeZone:a,userId:void 0,intl:l,userSorts:R,apiSorts:[],schema:I}),t=x.map((e=>e.id)),n=new c.EO([...e,...c.Xm([])]),o=new Map;x.forEach((e=>{n.updateBlock({block:g.kk5.fromBlock(e),schema:I,propertyMapping:void 0,getRecordModel:g.omK.fromGetRecordValueFn(f),resultCache:o})}));c.Qx(t,n).forEach(((e,t)=>{A[e]=t}))}else{(k.getPageSort()||[]).forEach(((e,t)=>{A[e]=t}))}const D=r.MR(x,(e=>A.hasOwnProperty(e.id)?A[e.id]:e.created_time?e.created_time:1/0)),B={},E=T.map((e=>{const t=I[e],n=t&&t.name?t.name:l.formatMessage(F.defaultNewProperty),o=Object.values(B);let r;return r=o.includes(n)?(0,d.Z)(n,(e=>!o.includes(e))):n,B[e]=r,r}));return{schema:I,sortedBlocks:D,columnIdToName:B,columnIds:T,columnNames:E,collectionTitle:(0,h.Xh)({intl:l,textValue:w.getName(),getRecordModel:b,userTimeZone:a,deterministic:!0}),collectionDescription:S.QaF(w.getDescription()),collectionViewName:k.getName(),sortingInfo:void 0,filteringInfo:void 0}}function A(e){switch(e){case"letters":return"a";case"roman":return"i";default:return"1"}}function R(e){var t;const{block:n,exportArgs:o}=e,{getRecordValue:r}=o;let s,l=!0;const c=function(e,t){const n=null==t?void 0:t.content;if(n&&n.length>0){const o=n.findIndex((t=>t===e.id));if(-1!==o){if(0!==o)return{id:n[o-1],isParent:!1,index:-1};if((null==t?void 0:t.type)===a.Ti.numberedList)return{id:e.parent_id,isParent:!0,index:0}}}return{id:void 0,isParent:!1,index:-1}}(n,r({table:v.iU,id:n.parent_id}));let d=c.index;var u;if(null!==(t=n.format)&&void 0!==t&&t.list_format&&(s=n.format.list_format,l=!1),!s)if(c.id&&null!==(u=o.numberedListCache[c.id])&&void 0!==u&&u.format){const e=o.numberedListCache[c.id];s=c.isParent&&e.inDefaultFormat?function(e){switch(e){case"numbers":return"letters";case"letters":return"roman";default:return"numbers"}}(e.format):e.format,e.inDefaultFormat||(l=!1)}else s="numbers";return-1===d&&(d=c.id&&o.numberedListCache[c.id]&&!c.isParent?o.numberedListCache[c.id].index+1:0),n.format&&(0,i.$K)(n.format.list_start_index)&&(d=n.format.list_start_index-1),o.numberedListCache[n.id]={index:d,format:s,inDefaultFormat:l},{index:d,format:A(s)}}function D(e){const{annotation:t,exportArgs:n}=e,o=S.kxk(t);if(!o)return;const{groupId:r,spaceId:i}=o,a=g.omK.fromGetRecordValueFn(n.getRecordValue)({table:b.GQ,id:(0,b.L9)({spacePermissionGroupId:r,spaceId:i}),spaceId:i});return`@${(0,_.m)({intl:n.intl,permissionGroupModel:a})}`}function B(e){const{block:t,exportArgs:n}=e,{getRecordValue:o,bulletedListCache:r}=n,i=t.format?t.format.bullet_list_format:void 0;if(t.parent_id in r)return{depth:r[t.parent_id].depth+1,list_format:i||r[t.parent_id].list_format};const a=o({table:v.iU,id:t.parent_id});if("bulleted_list"!==(null==a?void 0:a.type))return r[t.id]={depth:0,list_format:i},r[t.id];{const e=B({block:a,exportArgs:n});return{depth:e.depth+1,list_format:i||e.list_format}}}function E(e){return e.blockId===e.navigableBlockId&&!e.renderParentBlockId}const F=(0,o.defineMessages)({untitledTitle:{id:"exportRenderer.titleOfBlock.untitled",defaultMessage:"Untitled"},defaultNewProperty:{defaultMessage:"Property",id:"exportRenderer.titleOfNewProperty.property"}});function Z(e){const{blockId:t,getRecordValue:n,userTimeZone:o,intl:r}=e,i=g.omK.fromGetRecordValueFn(n),a=i({table:v.iU,id:t});return(null==a?void 0:a.getRenderTitle({getRecordModel:i,userTimeZone:o,intl:r}))||r.formatMessage(F.untitledTitle)}function U(e){const{blockId:t,root:n,getRecordValue:o,skipSelf:r}=e;for(const i of(0,f.BW)({table:v.iU,id:t},o)){if(i.table===v.iU&&g.kk5.fromBlock(i.value).isNavigableBlock()&&(!r||i.value.id!==t))return i.value;if(i.table===n.table&&i.value.id===n.id)break}}},478601:(e,t,n)=>{n.d(t,{U:()=>h,j:()=>c});n(757658);var o=n(709291),r=n(653965),i=n(401898),a=n(544876);const s=(0,o.defineMessages)({githubPullOpened:{id:"unfurling.github.githubPullOpened",defaultMessage:"Opened {value}"},githubPullClosed:{id:"unfurling.github.githubPullClosed",defaultMessage:"Closed {value}"},githubPullMerged:{id:"unfurling.github.githubPullMerged",defaultMessage:"Merged {value}"},githubCommitted:{id:"unfurling.github.githubCommitted",defaultMessage:"Committed {value}"},githubPullRequest:{id:"unfurling.github.githubPullRequest",defaultMessage:"Pull Request {value}"},githubIssue:{id:"unfurling.github.githubIssue",defaultMessage:"Issue {value}"},githubCommit:{id:"unfurling.github.githubCommit",defaultMessage:"Commit"},githubFile:{id:"unfurling.github.githubFile",defaultMessage:"File"},githubRef:{id:"unfurling.github.githubRef",defaultMessage:"Ref"},codeLanguage:{id:"unfurling.github.codeLanguage",defaultMessage:"Language"},githubRepoUpdated:{id:"unfurling.github.githubRepoUpdated",defaultMessage:"Updated {value}"},githubPullRequests:{id:"unfurling.github.githubPullRequests",defaultMessage:"{value} Pull Requests"},githubIssues:{id:"unfurling.github.githubIssues",defaultMessage:"{value} Issues"},jiraAssignee:{id:"unfurling.jira.jiraAssignee",defaultMessage:"Assigned to {value}"},jiraUpdated:{id:"unfurling.github.jiraUpdated",defaultMessage:"Updated {value}"},slackMessage:{id:"unfurling.slack.slackMessage",defaultMessage:"Message in Slack"},slackThread:{id:"unfurling.slack.slackThread",defaultMessage:"Thread in Slack"},slackReplyCount:{id:"unfurling.slack.slackReplyCount",defaultMessage:"{value, plural, one {{value} reply} other {{value} replies}}"},zoomMeeting:{id:"unfurling.zoom.joinZoomMeeting",defaultMessage:"Join Zoom meeting"},zoomPasscode:{id:"unfurling.zoom.zoomPasscode",defaultMessage:"Passcode: {value}"},asanaDueAt:{id:"unfurling.asana.asanaDueAt",defaultMessage:"Due {value}"},asanaUpdatedAt:{id:"unfurling.asana.asanaUpdatedAt",defaultMessage:"Updated {value}"},asanaPreviewEntity:{id:"unfurling.asana.asanaTask",defaultMessage:"Preview Asana"},asanaAssignedTo:{id:"unfurling.asana.asanaAssignedTo",defaultMessage:"Assigned to {value}"},trelloDueAt:{id:"unfurling.trello.trelloDueAt",defaultMessage:"Due {value}"},trelloUpdatedAt:{id:"unfurling.trello.trelloUpdatedAt",defaultMessage:"Updated {value}"},trelloAssignedTo:{id:"unfurling.trello.trelloAssignedTo",defaultMessage:"Assigned to {value}"},trelloCard:{id:"unfurling.trello.trelloCard",defaultMessage:"Card in Trello"},figmaFile:{id:"unfurling.figma.figmaFile",defaultMessage:"Figma File"},figmaLastModifiedBy:{id:"unfurling.figma.figmaLastModifiedBy",defaultMessage:"Last modified by {value}"},dropboxFile:{id:"unfurling.dropbox.dropboxFile",defaultMessage:"Dropbox File"},status:{id:"unfurling.generic.status",defaultMessage:"Status"},pullRequest:{id:"unfurling.github.pullRequest",defaultMessage:"PR"},author:{id:"unfurling.generic.author",defaultMessage:"Author"},issue:{id:"unfurling.github.issue",defaultMessage:"Issue"},assigned:{id:"unfurling.generic.assigned",defaultMessage:"Assigned"},section:{id:"unfurling.generic.section",defaultMessage:"Section"},due:{id:"unfurling.generic.due",defaultMessage:"Due"},created:{id:"unfurling.generic.created",defaultMessage:"Created"},updated:{id:"unfurling.generic.updated",defaultMessage:"Updated"},type:{id:"unfurling.generic.type",defaultMessage:"Type"},project:{id:"unfurling.generic.project",defaultMessage:"Project"},meetingId:{id:"unfurling.zoom.meetingId",defaultMessage:"Meeting ID"},passcode:{id:"unfurling.zoom.passcode",defaultMessage:"Passcode"},host:{id:"unfurling.zoom.host",defaultMessage:"Host"},list:{id:"unfurling.trello.list",defaultMessage:"List"},lastModifiedBy:{id:"unfurling.generic.lastModifiedBy",defaultMessage:"Modified by"},lastModifiedAt:{id:"unfurling.generic.lastModifiedAt",defaultMessage:"Modified at"},replies:{id:"unfurling.slack.replies",defaultMessage:"Replies"},owner:{id:"unfurling.github.owner",defaultMessage:"Owner"},gitlabIssues:{id:"unfurling.gitlab.gitlabIssues",defaultMessage:"{value} Pull Requests"},gitlabMerges:{id:"unfurling.gitlab.gitlabMerges",defaultMessage:"{value} Issues"},dynamicLabelForHover:{id:"unfurling.hover.label",defaultMessage:"{value}"},calendarEventTime:{id:"unfurling.calendar.eventTime",defaultMessage:"Event time"},calendarLocation:{id:"unfurling.calendar.location",defaultMessage:"Location"}});function l(e){var t,n,o,i;const a=[];for(const r of e.root.attributes||[]){var s;if("relation"===r.type&&"extension"===(null==r||null===(s=r.format)||void 0===s?void 0:s.type))for(const t of r.format.extension||[]){const n=w({rootAttribute:r,subAttribute:_(e,r.id,t.id),section:t.section});n&&a.push(n)}else a.push(r)}a.push(...e.parsedAttributes);const l=r.mN(a,"id"),c=r.vM(l,(e=>{let{format:t}=e;return null==t?void 0:t.section}));return{icons:c.avatar||[],title:null===(t=c.title)||void 0===t?void 0:t[0],body:null===(n=c.body)||void 0===n?void 0:n[0],entityIcon:null===(o=c.entity)||void 0===o?void 0:o[0],identifier:null===(i=c.identifier)||void 0===i?void 0:i[0],primaries:c.primary||[],secondaries:c.secondary||[],embeds:c.embed||[]}}const c={block:e=>{const{icons:t,title:n,primaries:o,body:i,entityIcon:s,identifier:c,secondaries:d,embeds:u}=l(e);return{icons:t,headerAttributes:r.oA([n?{attribute:n}:void 0,...o.map((e=>({attribute:e})))]),bodyAttribute:i&&(0,a.Id)(i)?i:void 0,subheaderIcon:s,subheaderAttributes:r.oA([c?{attribute:c}:void 0,...d.map((e=>({attribute:e})))]),previewAttributes:u.filter(a.km)}},inline:e=>{const{icons:t,title:n,primaries:o,identifier:i,entityIcon:a}=l(e);return{icon:a,identifier:i,title:n?{attribute:n}:void 0,attributes:r.oA([...o.slice(0,2),t[0]])}},hover:e=>{const{title:t,secondaries:n,primaries:o,embeds:c,identifier:d}=l(e),u=null==c?void 0:c[0],p=[d,...o,...n].filter(i.$K).map((e=>{const{id:t}=e;return"created_at"===t?{key:{formatter:s.created},value:{attribute:e}}:"updated_at"===t?{key:{formatter:s.updated},value:{attribute:e}}:{key:{formatter:s.dynamicLabelForHover},value:{attribute:e}}}));return{title:t?{attribute:t}:void 0,dictionaryAttributes:r.oA(p),previewImageAttribute:u&&(0,a.li)(u)?u:void 0}}};function d(e){const t=b(e,"key"),n=t&&(0,a.Id)(t)?t.values[0]:void 0,o=n?n.split("-").slice(1).map(((e,t)=>0===t?`${e[0].toUpperCase()}${e.substring(1)}`:e)).join(" "):void 0,r=S(e,"members"),i=r.map((e=>{const t=e.find((e=>{let{id:t}=e;return"avatar_url"===t})),n=e.find((e=>{let{id:t}=e;return"title"===t||"name"===t}));return t||n})),l=r.map((e=>e.find((e=>{let{id:t}=e;return"title"===t||"name"===t})))),c=_(e,"board","title")||_(e,"board","board_name"),d=_(e,"list","title")||_(e,"list","name"),u=v(e,"title"),p=v(e,"due_at"),m=v(e,"updated_at");return{title:u?{attribute:u}:o?{attribute:{id:"title",name:"Title",type:"inline",values:[o]}}:t&&t.values[0]?{attribute:t}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.trelloCard},memberNames:l,boardName:c,listName:d,dueAt:p,updatedAt:m,memberIcons:i}}function u(e){var t;const n=b(e,"title"),o=n&&(0,a.Id)(n)?n.values[0]:void 0,r=o?null===(t=I(o))||void 0===t?void 0:t.split("-").join(" ").replace(/   /g," - "):void 0,i=v(e,"title")||v(e,"name"),l=v(e,"updated_at"),c=v(e,"username")||_(e,"user","title")||_(e,"user","name"),d=v(e,"avatar_url")||_(e,"user","avatar_url"),u=v(e,"thumbnail_url"),p=b(e,"site");return{title:i?{attribute:i}:r?{attribute:{id:"title",name:"Title",type:"inline",values:[r]}}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.figmaFile},lastModifiedByName:c,parsedSite:p,lastModifiedAt:l,previewImageAttribute:u,lastModifiedByAvatar:d}}function p(e){const t=b(e,"title"),n=t&&(0,a.Id)(t)?t.values[0]:void 0,o=n?I(n):void 0,r=v(e,"title"),i=v(e,"file_size"),l=v(e,"preview_image");return{title:r?{attribute:r}:o?{attribute:{id:"title",name:"Title",type:"inline",values:[o]}}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.dropboxFile},fileSizeAttribute:i,previewImageAttribute:l}}function m(e){const t=b(e,"title"),n=t&&(0,a.Id)(t)?t.values[0]:void 0,o=n?I(n):void 0,r=v(e,"title"),i=v(e,"file_size"),l=v(e,"preview_image");return{title:r?{attribute:r}:o?{attribute:{id:"title",name:"Title",type:"inline",values:[o]}}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.dropboxFile},fileSizeAttribute:i,previewImageAttribute:l}}function g(){return{block:e=>{const t=b(e,"title"),n=b(e,"owner_and_repo"),o=v(e,"title"),i=v(e,"number"),l=_(e,"user","title")||_(e,"user","login"),c=_(e,"user","avatar_url"),d=v(e,"state"),u=_(e,"state","icon"),p=_(e,"state","title")||_(e,"state","name"),m=p&&(0,a.Id)(p)?p.values[0]:void 0;let g;const f=v(e,"created_at"),h=v(e,"merged_at"),y=v(e,"closed_at");return"Open"===m&&f?g={attribute:f,formatter:s.githubPullOpened}:"Closed"===m&&y?g={attribute:y,formatter:s.githubPullClosed}:"Merged"===m&&h&&(g={attribute:h,formatter:s.githubPullMerged}),{icons:r.oA([c||l]),headerAttributes:r.oA([o?{attribute:o}:t?{attribute:t,formatter:s.githubPullRequest}:void 0,d?{attribute:d}:void 0]),subheaderIcon:u,subheaderAttributes:i||l||g?r.oA([i?{attribute:i}:void 0,l?{attribute:l}:void 0,g]):r.oA([n?{attribute:n}:void 0])}},inline:e=>{const t=b(e,"title"),n=v(e,"title"),o=v(e,"number"),i=v(e,"state"),l=_(e,"state","icon");return{icon:l&&(0,a.li)(l)?l:void 0,identifier:o,title:n?{attribute:n}:t?{attribute:t,formatter:s.githubPullRequest}:void 0,attributes:r.oA([i])}},hover:e=>{const t=b(e,"title"),n=b(e,"owner_and_repo"),o=v(e,"title"),i=v(e,"number"),l=v(e,"user"),c=v(e,"state"),d=_(e,"state","title")||_(e,"state","name"),u=d&&(0,a.Id)(d)?d.values[0]:void 0;let p;const m=v(e,"created_at"),g=v(e,"merged_at"),f=v(e,"closed_at");return"Open"===u&&m?p={attribute:m,formatter:s.githubPullOpened}:"Closed"===u&&f?p={attribute:f,formatter:s.githubPullClosed}:"Merged"===u&&g&&(p={attribute:g,formatter:s.githubPullMerged}),{title:o?{attribute:o}:t?{attribute:t,formatter:s.githubPullRequest}:void 0,headerAttributes:r.oA([n?{attribute:n}:void 0,p]),dictionaryAttributes:r.oA([i?{key:{formatter:s.pullRequest},value:{attribute:i}}:void 0,c?{key:{formatter:s.status},value:{attribute:c}}:void 0,l?{key:{formatter:s.author},value:{attribute:l}}:void 0])}}}}const f={github_app_pull:g(),github_pull:g(),"Calendar event":{block:e=>({}),inline:e=>({}),hover:e=>{const t=v(e,"title"),n=v(e,"event_time"),o=v(e,"location");return{title:t?{attribute:t}:void 0,dictionaryAttributes:r.oA([n?{key:{formatter:s.calendarEventTime},value:{attribute:n}}:void 0,o?{key:{formatter:s.calendarLocation},value:{attribute:o}}:void 0])}}},github_issue:{block:e=>{const t=b(e,"title"),n=b(e,"owner_and_repo"),o=v(e,"title"),i=v(e,"number"),l=_(e,"user","title")||_(e,"user","login"),c=_(e,"user","avatar_url"),d=v(e,"state"),u=_(e,"state","icon"),p=_(e,"state","title")||_(e,"state","name"),m=p&&(0,a.Id)(p)?p.values[0]:void 0;let g;const f=v(e,"created_at"),h=v(e,"closed_at");return"Open"===m&&f?g={attribute:f,formatter:s.githubPullOpened}:"Closed"===m&&h&&(g={attribute:h,formatter:s.githubPullClosed}),{icons:r.oA([c||l]),headerAttributes:r.oA([o?{attribute:o}:t?{attribute:t,formatter:s.githubIssue}:void 0,d?{attribute:d}:void 0]),subheaderIcon:u,subheaderAttributes:i||l||g?r.oA([i?{attribute:i}:void 0,l?{attribute:l}:void 0,g]):r.oA([n?{attribute:n}:void 0])}},inline:e=>{const t=b(e,"title"),n=v(e,"title"),o=v(e,"number"),i=v(e,"state"),l=_(e,"user","avatar_url"),c=_(e,"state","icon");return{icon:c&&(0,a.li)(c)?c:void 0,identifier:o,title:n?{attribute:n}:t?{attribute:t,formatter:s.githubIssue}:void 0,attributes:r.oA([i,l])}},hover:e=>{const t=b(e,"title"),n=b(e,"owner_and_repo"),o=v(e,"title"),i=v(e,"number"),l=v(e,"user"),c=v(e,"state"),d=_(e,"state","title")||_(e,"state","name"),u=d&&(0,a.Id)(d)?d.values[0]:void 0;let p;const m=v(e,"created_at"),g=v(e,"closed_at");return"Open"===u&&m?p={attribute:m}:"Closed"===u&&g&&(p={attribute:g}),{title:o?{attribute:o}:t?{attribute:t,formatter:s.githubIssue}:void 0,headerAttributes:r.oA([n?{attribute:n}:void 0,p]),dictionaryAttributes:r.oA([i?{key:{formatter:s.issue},value:{attribute:i}}:void 0,c?{key:{formatter:s.status},value:{attribute:c}}:void 0,l?{key:{formatter:s.author},value:{attribute:l}}:void 0])}}},github_commit:{block:e=>{const t=v(e,"title"),n=b(e,"commit_sha"),o=b(e,"owner_and_repo"),i=_(e,"author","title")||_(e,"author","login"),l=_(e,"author","avatar_url"),c=v(e,"created_at");return{icons:r.oA([l||i]),headerAttributes:r.oA([t?{attribute:t}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.githubCommit},!t&&n&&(0,a.Id)(n)?{attribute:{...n,values:[n.values[0].substring(0,7)]}}:void 0]),subheaderAttributes:i||c?r.oA([i?{attribute:i}:void 0,c?{attribute:c,formatter:s.githubCommitted}:void 0]):r.oA([o?{attribute:o}:void 0])}},inline:e=>{const t=v(e,"title"),n=b(e,"commit_sha"),o=v(e,"number"),i=v(e,"state"),l=_(e,"user","avatar_url");return{identifier:o&&(0,a.Id)(o)?o:void 0,title:t?{attribute:t}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.githubCommit},attributes:i||l?r.oA([i,l]):r.oA([n&&(0,a.Id)(n)?{...n,values:[n.values[0].substring(0,7)]}:void 0])}},hover:e=>{const t=v(e,"title"),n=b(e,"commit_sha"),o=b(e,"owner_and_repo"),i=v(e,"author"),l=v(e,"created_at");return{title:t?{attribute:t}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.githubCommit},headerAttributes:r.oA([o?{attribute:o}:void 0,n&&(0,a.Id)(n)?{attribute:{...n,values:[n.values[0].substring(0,7)]}}:void 0]),dictionaryAttributes:r.oA([i?{key:{formatter:s.author},value:{attribute:i}}:void 0,l?{key:{formatter:s.created},value:{attribute:l}}:void 0])}}},github_repo:{block:e=>{const t=b(e,"owner"),n=b(e,"title")||b(e,"name"),o=v(e,"title")||v(e,"name"),i=_(e,"owner","title")||_(e,"owner","login"),a=_(e,"owner","avatar_url"),l=v(e,"updated_at");return{icons:r.oA([a||i]),headerAttributes:r.oA([o?{attribute:o}:n?{attribute:n}:void 0]),subheaderAttributes:i||l?r.oA([i?{attribute:i}:void 0,l?{attribute:l,formatter:s.githubRepoUpdated}:void 0]):r.oA([t?{attribute:t}:void 0])}},inline:e=>{const t=b(e,"title")||b(e,"name"),n=v(e,"title")||v(e,"name"),o=v(e,"state"),i=_(e,"owner","avatar_url");return{title:n?{attribute:n}:t?{attribute:t}:void 0,attributes:r.oA([o,i])}},hover:e=>{const t=b(e,"title")||b(e,"name"),n=v(e,"title")||v(e,"name"),o=v(e,"owner"),i=v(e,"updated_at");return{title:n?{attribute:n}:t?{attribute:t}:void 0,dictionaryAttributes:r.oA([o?{key:{formatter:s.owner},value:{attribute:o}}:void 0,i?{key:{formatter:s.updated},value:{attribute:i}}:void 0])}}},github_file:{block:e=>{var t,n;const o=b(e,"owner_and_repo"),i=b(e,"path")||b(e,"path"),a=v(e,"title")||v(e,"name"),s=_(e,"owner","name"),l=_(e,"owner","avatar_url"),c=v(e,"content"),d="code"===(null==c||null===(t=c.format)||void 0===t?void 0:t.type)?c:void 0,u=null==d||null===(n=d.format)||void 0===n?void 0:n.language,p=x(b(e,"commit_or_branch")),m=x(v(e,"ref"));return{icons:r.oA([l||s]),headerAttributes:r.oA([a?{attribute:a}:i?{attribute:i}:void 0,s?{attribute:s}:o?{attribute:o}:void 0]),bodyAttribute:d,subheaderAttributes:r.oA([m?{attribute:m}:p?{attribute:p}:void 0,u?{attribute:{id:"language",name:"Language",type:"inline",values:[u]}}:void 0])}},inline:e=>{const t=b(e,"owner_and_repo"),n=b(e,"path")||b(e,"path"),o=v(e,"title")||v(e,"name"),i=_(e,"owner","name"),a=_(e,"owner","avatar_url");return{title:o?{attribute:o}:n?{attribute:n}:void 0,attributes:r.oA([a,i||t])}},hover:e=>{var t,n,o;const i=b(e,"owner_and_repo"),a=v(e,"content"),l="code"===(null==a||null===(t=a.format)||void 0===t?void 0:t.type)?a:void 0,c=b(e,"path")||b(e,"path"),d=v(e,"title")||v(e,"name"),u=_(e,"owner","name"),p=x(b(e,"commit_or_branch")),m=x(v(e,"ref"));return{headerAttributes:r.oA([i?{attribute:i}:u?{attribute:u}:void 0,m?{attribute:m}:p?{attribute:p}:void 0]),title:d?{attribute:d}:c?{attribute:c}:void 0,dictionaryAttributes:r.oA([i?{key:{formatter:s.owner},value:{attribute:i}}:void 0,m?{key:{formatter:s.githubRef},value:{attribute:m}}:void 0,null!=l&&null!==(n=l.format)&&void 0!==n&&n.language?{key:{formatter:s.codeLanguage},value:{attribute:{id:"language",name:"Language",type:"inline",values:[null===(o=l.format)||void 0===o?void 0:o.language]}}}:void 0])}}},github_pulls:{block:e=>{const t=b(e,"owner"),n=b(e,"repo"),o=v(e,"owner"),i=v(e,"repo");return{headerAttributes:r.oA([i?{attribute:i}:n?{attribute:n,formatter:s.githubPullRequests}:void 0]),subheaderAttributes:r.oA([o?{attribute:o}:t?{attribute:t}:void 0])}},inline:e=>{const t=b(e,"repo"),n=v(e,"repo");return{title:n?{attribute:n}:t?{attribute:t,formatter:s.githubPullRequests}:void 0}}},github_issues:{block:e=>{const t=b(e,"owner"),n=b(e,"repo"),o=v(e,"owner"),i=v(e,"repo");return{headerAttributes:r.oA([i?{attribute:i}:n?{attribute:n,formatter:s.githubIssues}:void 0]),subheaderAttributes:r.oA([o?{attribute:o}:t?{attribute:t}:void 0])}},inline:e=>{const t=b(e,"repo"),n=v(e,"repo");return{title:n?{attribute:n}:t?{attribute:t,formatter:s.githubIssues}:void 0}}},jira_issue:{block:e=>{const t=b(e,"title"),n=b(e,"site"),o=v(e,"title"),i=v(e,"key"),a=v(e,"status"),l=_(e,"type","icon"),c=v(e,"updated"),d=_(e,"assignee","title")||_(e,"assignee","name"),u=_(e,"assignee","avatar_url");return{icons:r.oA([u||d]),headerAttributes:r.oA([o?{attribute:o}:t?{attribute:t}:void 0,a?{attribute:a}:void 0]),subheaderIcon:l,subheaderAttributes:i||d||c?r.oA([i?{attribute:i}:void 0,d?{attribute:d,formatter:s.jiraAssignee}:void 0,c?{attribute:c,formatter:s.jiraUpdated}:void 0]):r.oA([n?{attribute:n}:void 0])}},inline:e=>{const t=b(e,"title"),n=v(e,"title"),o=v(e,"key"),i=_(e,"assignee","avatar_url"),s=_(e,"type","icon")||v(e,"icon"),l=v(e,"status");return{icon:s&&(0,a.li)(s)?s:void 0,identifier:o,title:n?{attribute:n}:t?{attribute:t}:void 0,attributes:r.oA([l,i])}},hover:e=>{const t=b(e,"title"),n=v(e,"title"),o=v(e,"key"),i=v(e,"status"),a=v(e,"type"),l=v(e,"updated"),c=v(e,"assignee");return{title:n?{attribute:n}:t?{attribute:t}:void 0,dictionaryAttributes:r.oA([a?{key:{formatter:s.type},value:{attribute:a}}:void 0,o?{key:{formatter:s.project},value:{attribute:o}}:void 0,i?{key:{formatter:s.status},value:{attribute:i}}:void 0,c?{key:{formatter:s.assigned},value:{attribute:c}}:void 0,l?{key:{formatter:s.updated},value:{attribute:l}}:void 0])}}},jira_project:{block:e=>{const t=b(e,"site"),n=b(e,"title"),o=v(e,"site"),i=v(e,"title");return{headerAttributes:r.oA([i?{attribute:i}:n?{attribute:n}:void 0]),subheaderAttributes:r.oA([o?{attribute:o}:t?{attribute:t}:void 0])}},inline:e=>{const t=b(e,"title"),n=v(e,"title");return{title:n?{attribute:n}:t?{attribute:t}:void 0}}},slack_message:{block:e=>{const t=b(e,"workspace"),n=b(e,"threadTimestamp"),o=Boolean(n&&(0,a.Id)(n)&&n.values[0]),i=v(e,"reply_count"),l=i&&(0,a.An)(i)&&i.values[0]||0,c=_(e,"parent_thread","reply_count"),d=c&&(0,a.An)(c)&&c.values[0]||0,u=l>0||d>0,p=o||u,m=_(e,"user","title")||_(e,"user","name"),g=_(e,"user","avatar_url"),f=v(e,"title")||v(e,"text"),h=_(e,"channel","title")||_(e,"channel","name"),y=v(e,"sent_at"),w=S(e,"reply_users").map((e=>{const t=e.find((e=>{let{id:t}=e;return"avatar_url"===t})),n=e.find((e=>{let{id:t}=e;return"title"===t||"name"===t}));return t||n})),x=k("slack");return{icons:r.oA([g||m||f&&x,...w]),headerAttributes:r.oA([m?{attribute:m}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:p?s.slackThread:s.slackMessage},y?{attribute:y}:void 0]),bodyAttribute:f&&((0,a.Id)(f)||(0,a.kz)(f))?f:void 0,subheaderAttributes:r.oA([u?i?{attribute:i,formatter:s.slackReplyCount}:c?{attribute:c,formatter:s.slackReplyCount}:void 0:void 0,h?{attribute:h}:t?{attribute:t}:void 0,,])}},inline:e=>{const t=e.integrationIcon?{id:"slack_icon",name:"Slack Icon",type:"embed",mimeType:"image/*",values:[e.integrationIcon]}:void 0,n=_(e,"user","title")||_(e,"user","name"),o=_(e,"user","avatar_url"),i=v(e,"title")||v(e,"text"),l=_(e,"channel","title")||_(e,"channel","name"),c=o&&(0,a.li)(o)?o:i?k("slack"):void 0;return{icon:c,identifier:n||void 0,title:i?{attribute:i}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.slackMessage},attributes:r.oA([c?t:void 0,l])}},hover:e=>{const t=b(e,"workspace"),n=v(e,"reply_count"),o=n&&(0,a.An)(n)&&n.values[0]?n:void 0,i=_(e,"parent_thread","reply_count"),l=i&&(0,a.An)(i)&&i.values[0]?i:void 0,c=o??l,d=v(e,"user"),u=_(e,"user","avatar_url"),p=_(e,"user","title")||_(e,"user","name"),m=Boolean(_(e,"user","title")||_(e,"user","name")),g=v(e,"title")||v(e,"text"),f=_(e,"channel","title")||_(e,"channel","name"),h=v(e,"sent_at"),y=S(e,"reply_users").map((e=>{const t=e.find((e=>{let{id:t}=e;return"avatar_url"===t})),n=e.find((e=>{let{id:t}=e;return"title"===t||"name"===t}));return t||n})),w=k("slack");return{icons:r.oA([u||p||g&&w,...y]),headerAttributes:r.oA([f?{attribute:f}:t?{attribute:t}:void 0,h?{attribute:h}:void 0]),bodyAttribute:g&&((0,a.Id)(g)||(0,a.kz)(g))?g:void 0,dictionaryAttributes:r.oA([d&&m?{key:{formatter:s.author},value:{attribute:d}}:void 0,c?{key:{formatter:s.slackReplyCount},value:{attribute:c}}:void 0])}}},zoom_meeting:{block:e=>{const t=b(e,"meetingId"),n=_(e,"host","title")||_(e,"host","name"),o=_(e,"host","avatar_url"),i=v(e,"title"),a=v(e,"status"),l=v(e,"meeting_id"),c=v(e,"passcode");return{icons:r.oA([o||n]),headerAttributes:r.oA([i?{attribute:i}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.zoomMeeting},a?{attribute:a}:void 0]),subheaderAttributes:r.oA([l?{attribute:l}:t?{attribute:t}:void 0,c?{attribute:c,formatter:s.zoomPasscode}:void 0])}},inline:e=>{const t=b(e,"meetingId"),n=v(e,"title"),o=v(e,"meeting_id");return{title:n?{attribute:n}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.zoomMeeting},attributes:r.oA([o||t])}},hover:e=>{const t=b(e,"meetingId"),n=_(e,"host","title")||_(e,"host","name"),o=_(e,"host","avatar_url"),i=v(e,"title"),a=v(e,"status"),l=v(e,"meeting_id"),c=v(e,"passcode"),d=l??t;return{title:i?{attribute:i}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.zoomMeeting},dictionaryAttributes:r.oA([d?{key:{formatter:s.meetingId},value:{attribute:d}}:void 0,c?{key:{formatter:s.passcode},value:{attribute:c}}:void 0,a?{key:{formatter:s.status},value:{attribute:a}}:void 0,n?{key:{formatter:s.host},value:{icon:o,attribute:n}}:void 0])}}},asana_task:{block:e=>{const t=_(e,"assignee","title")||_(e,"assignee","name"),n=_(e,"assignee","avatar_url"),o=v(e,"title"),i=y(e,["updated_at","updated"]),a=y(e,["due_at","duedate"]),l=_(e,"project","color"),c=_(e,"project","title")||_(e,"project","project_name"),d=_(e,"section","title")||_(e,"section","name"),u=v(e,"completed");return{icons:r.oA([n||t]),headerAttributes:r.oA([o?{attribute:o}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.asanaPreviewEntity},u?{attribute:u}:d?{attribute:d}:void 0,a?{attribute:a,formatter:s.asanaDueAt}:void 0]),subheaderIcon:l,subheaderAttributes:r.oA([c?{attribute:c}:void 0,t?{attribute:t,formatter:s.asanaAssignedTo}:void 0,i?{attribute:i,formatter:s.asanaUpdatedAt}:void 0])}},inline:e=>{const t=v(e,"title"),n=_(e,"section","title")||_(e,"section","name"),o=_(e,"assignee","avatar_url"),i=v(e,"completed");return{title:t?{attribute:t}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.asanaPreviewEntity},attributes:r.oA([i||n,o])}},hover:e=>{const t=v(e,"assignee"),n=v(e,"title"),o=y(e,["updated_at","updated"]),i=y(e,["due_at","duedate"]),a=_(e,"project","title")||_(e,"project","project_name"),l=_(e,"section","title")||_(e,"section","name"),c=v(e,"completed");return{title:n?{attribute:n}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.asanaPreviewEntity},headerAttributes:a?[{attribute:a}]:void 0,dictionaryAttributes:r.oA([t?{key:{formatter:s.assigned},value:{attribute:t}}:void 0,c?{key:{formatter:s.status},value:{attribute:c}}:void 0,l?{key:{formatter:s.section},value:{attribute:l}}:void 0,i?{key:{formatter:s.due},value:{attribute:i}}:void 0,o?{key:{formatter:s.updated},value:{attribute:o}}:void 0])}}},asana_project:{block:e=>({headerAttributes:r.oA([{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.asanaPreviewEntity}])}),inline:e=>({title:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.asanaPreviewEntity}})},trello_card:{block:e=>{const{boardName:t,dueAt:n,listName:o,memberIcons:i,memberNames:a,title:l,updatedAt:c}=d(e);return{icons:r.oA(i),headerAttributes:r.oA([l,n?{attribute:n,formatter:s.trelloDueAt}:void 0,o?{attribute:o}:void 0]),subheaderAttributes:r.oA([t?{attribute:t}:void 0,a[0]?{attribute:a[0],formatter:s.trelloAssignedTo}:void 0,c?{attribute:c,formatter:s.trelloUpdatedAt}:void 0])}},inline:e=>{const t=b(e,"key"),n=t&&(0,a.Id)(t)?t.values[0]:void 0,o=n?n.split("-").slice(1).map(((e,t)=>0===t?`${e[0].toUpperCase()}${e.substring(1)}`:e)).join(" "):void 0,i=_(e,"members","avatar_url"),l=_(e,"list","title")||_(e,"list","name"),c=v(e,"title");return{title:c?{attribute:c}:o?{attribute:{id:"title",name:"Title",type:"inline",values:[o]}}:t&&t.values[0]?{attribute:t}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.trelloCard},attributes:r.oA([l,i])}},hover:e=>{const{boardName:t,dueAt:n,listName:o,memberIcons:i,memberNames:a,title:l,updatedAt:c}=d(e);return{title:l,headerAttributes:t?[{attribute:t}]:[],dictionaryAttributes:r.oA([a[0]?{key:{formatter:s.assigned},value:{attribute:a[0],icon:r.Ps(i)}}:void 0,n?{key:{formatter:s.due},value:{attribute:n}}:void 0,o?{key:{formatter:s.list},value:{attribute:o}}:void 0,c?{key:{formatter:s.updated},value:{attribute:c}}:void 0])}}},trello_board:{block:e=>{const t=b(e,"key"),n=v(e,"boardId");return{headerAttributes:r.oA([n?{attribute:n}:t?{attribute:t}:void 0])}},inline:e=>{const t=b(e,"key"),n=v(e,"key");return{title:n?{attribute:n}:t?{attribute:t}:void 0}}},figma_file:{block:e=>{const{title:t,lastModifiedAt:n,lastModifiedByAvatar:o,lastModifiedByName:i,parsedSite:l,previewImageAttribute:c}=u(e);return{icons:r.oA([o]),headerAttributes:[t],subheaderAttributes:r.oA([i?{attribute:i,formatter:s.figmaLastModifiedBy}:l?{attribute:l}:void 0,n?{attribute:n}:void 0]),previewAttributes:r.oA([c&&(0,a.km)(c)?c:void 0])}},inline:e=>{var t;const n=b(e,"title"),o=n&&(0,a.Id)(n)?n.values[0]:void 0,i=o?null===(t=I(o))||void 0===t?void 0:t.split("-").join(" ").replace(/   /g," - "):void 0,l=v(e,"title")||v(e,"name"),c=_(e,"user","avatar_url"),d=v(e,"updated_at"),u=b(e,"site");return{title:l?{attribute:l}:i?{attribute:{id:"title",name:"Title",type:"inline",values:[i]}}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.figmaFile},attributes:r.oA([c,d??u])}},hover:e=>{const{title:t,lastModifiedAt:n,lastModifiedByAvatar:o,lastModifiedByName:i,previewImageAttribute:l}=u(e);return{title:t,dictionaryAttributes:r.oA([i?{key:{formatter:s.lastModifiedBy},value:{attribute:i,icon:o}}:void 0,n?{key:{formatter:s.lastModifiedAt},value:{attribute:n}}:void 0]),previewImageAttribute:l&&(0,a.li)(l)?l:void 0}}},dropbox_file:{block:e=>{const{title:t,previewImageAttribute:n,fileSizeAttribute:o}=p(e);return{headerAttributes:[t],subheaderAttributes:r.oA([o?{attribute:o}:void 0]),previewAttributes:r.oA([n&&(0,a.km)(n)?n:void 0])}},inline:e=>{const t=b(e,"title"),n=t&&(0,a.Id)(t)?t.values[0]:void 0,o=n?I(n):void 0,i=v(e,"title"),l=v(e,"file_size");return{title:i?{attribute:i}:o?{attribute:{id:"title",name:"Title",type:"inline",values:[o]}}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.dropboxFile},attributes:r.oA([l])}},hover:e=>{const{title:t,previewImageAttribute:n,fileSizeAttribute:o}=p(e);return{title:t,headerAttributes:o?[{attribute:o}]:[],previewImageAttribute:n&&(0,a.li)(n)?n:void 0}}},onedrive_file:{block:e=>{const{title:t,fileSizeAttribute:n,previewImageAttribute:o}=m(e);return{headerAttributes:[t],subheaderAttributes:r.oA([n?{attribute:n}:void 0]),previewAttributes:r.oA([o&&(0,a.km)(o)?o:void 0])}},inline:e=>{const t=b(e,"title"),n=t&&(0,a.Id)(t)?t.values[0]:void 0,o=n?I(n):void 0,i=v(e,"title"),l=v(e,"file_size");return{title:i?{attribute:i}:o?{attribute:{id:"title",name:"Title",type:"inline",values:[o]}}:{attribute:{id:"title",name:"Title",type:"inline",values:[""]},formatter:s.dropboxFile},attributes:r.oA([l])}},hover:e=>{const{title:t,fileSizeAttribute:n,previewImageAttribute:o}=m(e);return{title:t,headerAttributes:n?[{attribute:n}]:[],previewImageAttribute:o&&(0,a.li)(o)?o:void 0}}},gitlab_issues:{block:e=>{const t=b(e,"owner"),n=b(e,"repo"),o=v(e,"owner"),i=v(e,"repo");return{headerAttributes:r.oA([i?{attribute:i}:n?{attribute:n,formatter:s.gitlabIssues}:void 0]),subheaderAttributes:r.oA([o?{attribute:o}:t?{attribute:t}:void 0])}},inline:e=>{const t=b(e,"repo"),n=v(e,"repo");return{title:n?{attribute:n}:t?{attribute:t,formatter:s.gitlabIssues}:void 0}}},gitlab_merges:{block:e=>{const t=b(e,"owner"),n=b(e,"repo"),o=v(e,"owner"),i=v(e,"repo");return{headerAttributes:r.oA([i?{attribute:i}:n?{attribute:n,formatter:s.gitlabMerges}:void 0]),subheaderAttributes:r.oA([o?{attribute:o}:t?{attribute:t}:void 0])}},inline:e=>{const t=b(e,"repo"),n=v(e,"repo");return{title:n?{attribute:n}:t?{attribute:t,formatter:s.gitlabMerges}:void 0}}}};function h(e){return(e?f[e]:void 0)??c}function v(e,t){const{root:n}=e;return(n.attributes||[]).find((e=>{let{id:n}=e;return n===t}))}function y(e,t){const{root:n}=e,o=n.attributes||[];for(let r=0;r<t.length;r++){const e=o.find((e=>{let{id:n}=e;return n===t[r]}));if(e)return e}}function b(e,t){const{parsedAttributes:n}=e;return n.find((e=>{let{id:n}=e;return n===t}))}function _(e,t,n){var o;const{root:r,relations:i}=e,a=(r.attributes||[]).find((e=>{let{id:n}=e;return n===t})),s=a&&"relation"===a.type?a.values[0]:void 0,l=i.find((e=>e.uri===s));return null==l||null===(o=l.attributes)||void 0===o?void 0:o.find((e=>{let{id:t}=e;return t===n}))}function S(e,t){const{root:n,relations:o}=e,r=(n.attributes||[]).find((e=>{let{id:n}=e;return n===t})),s=new Set(r&&(0,a.OM)(r)&&r.values||[]);return o.filter((e=>s.has(e.uri))).map((e=>e.attributes)).filter(i.$K)}function k(e){return{id:`${e}-person-placeholder`,name:"Person Placeholder",type:"embed",mimeType:"image/*",values:["images/external_integrations/person_placeholder.png"]}}function w(e){const{rootAttribute:t,subAttribute:n,section:o}=e;if(!n)return;const r=`${t.id}_${n.id}`;if((0,a.Id)(n)){if((0,a._X)(o))return{...n,id:r,name:t.name,format:{section:o}}}else if((0,a.An)(n)){if((0,a.U5)(o))return{...n,id:r,name:t.name,format:{section:o}}}else if((0,a.Jq)(n)){if((0,a.U4)(o))return{...n,id:r,name:t.name,format:{section:o}}}else if((0,a.hW)(n)){if((0,a.fl)(o))return{...n,id:r,name:t.name,format:{section:o}}}else if((0,a.Gc)(n)){if((0,a.Gm)(o))return{...n,id:r,name:t.name,format:{section:o}}}else if((0,a.li)(n)){if((0,a.Ej)(o))return{...n,id:r,name:t.name,format:{section:o}}}else if((0,a.km)(n)){if((0,a.tz)(o))return{...n,id:r,name:t.name,format:{section:o}}}else{if((0,a.OM)(n))return;if((0,a.no)(n))return;if((0,a.O0)(n))return;if((0,a.kz)(n))return;(0,i.t1)(n)}}function x(e){if(e&&(0,a.Id)(e)&&e.values[0].length>=40){const t=e.values[0].substring(0,7);return{...e,values:[t]}}return e}function I(e){try{return decodeURIComponent(e)}catch(t){return}}},977657:(e,t,n)=>{n.d(t,{Aw:()=>f,BP:()=>C,Dv:()=>o,Ff:()=>u,Gl:()=>b,Gw:()=>r,Nw:()=>s,Qk:()=>w,U9:()=>i,Xs:()=>S,YM:()=>p,aG:()=>v,eY:()=>h,f3:()=>l,mC:()=>d,mQ:()=>c,nO:()=>a,ok:()=>x,s9:()=>T,tO:()=>k,u2:()=>I});const o="c0d82879-3eea-4c21-b0d1-42a775022c4b",r="cdc46cd9-f0e9-48fd-b3aa-18481098e29e",i="b759b994-5c32-4268-bbb0-41f435abb8d9",a="7f5d87f7-be5f-45ee-83d3-b9af153f0ee0",s="e0dbc237-dcea-4ed7-8de0-bfc1ea6ac768",l="2e19d8ee-fc61-48c1-be14-07a3aff43542",c="3a6a5bc3-6b3a-467e-9fc5-de4b6024a0e1",d="15d02cbd-b82a-4ccd-928e-f2ff0806f9ba",u="ccb795df-ffbb-414b-9a98-15a5cfb3297c",p="249a0797-abfd-4ee9-b8c3-30c32489eb2b",m="042f18e5-d630-4b45-964d-583e1d62b602",g="59487270-7a29-4dff-b0a1-3fc4b0f08fa8",f="7df961b7-66d9-4fb1-a963-ebcd171d6148",h="8e608b04-c0f8-4a71-8a38-b33ea0464d4d",v="9a9a6abb-ac0a-4cc8-9041-7626f934465c",y="e4c2ee0b-cd35-4e55-9e27-87690ae043f8",b="e8db4f1e-32ef-4588-8b7f-dcbf2e05e21f",_="00000000-0000-4000-8000-000000000005",S="00000000-0000-4000-8000-000000000003",k=[l,c,s],w=[v];function x(e){return[_,m].includes(e)}const I={[r]:"github",[d]:"jira",[a]:"slack","70570080-b12c-4484-a5ef-7c917ea6af1e":"zoom",[f]:"asana","45c081d8-e28b-43d0-87be-c373ca160336":"trello",[c]:"figma","4d0f0ca4-c5f2-42c8-b6a6-795a590a3e57":"dropbox","ef9a1f68-a912-4bc0-9523-1688a2a52645":"onedrive",[m]:"google_calendar","09c1d111-fdc8-4ab8-8351-8b4b4edf2976":"hubspot","e719abb7-effd-42f1-aa3f-0f449710fdc0":"gitlab",[p]:"box","c20823c5-4014-4716-baa0-08d603480004":"adobe_xd","a5cac57e-e610-4b62-b515-9e2757c0a945":"clickup",[l]:"google_drive","48fba5a0-411d-43eb-aad4-1daff8c3c64d":"pagerduty",[s]:"zendesk",[o]:"cron",[h]:"salesforce",[g]:"quip",[v]:"gmail",[y]:"google_contacts",[b]:"jira_data_center"};function C(e){const{integrationId:t}=e;return t in I||t===S||t===i||t===_||t===u}function T(e){return function(e){return[S,r].includes(e)}(e)?"github":x(e)?"google_calendar":I[e]}},402864:(e,t,n)=>{n.d(t,{l:()=>r,o:()=>i});var o=n(218265);function r(e){const{url:t,integration:n,pattern:r}=e,i=n.info.utm_keys;if(i){var a;const e=null!==(a=r.additional_types)&&void 0!==a&&a.collection?i.collection:i.link_preview;if(e){const n=(0,o.Qc)(t);return n.query.atlOrigin=e,n.search=null,(0,o.WU)(n)}}return t}function i(e,t){if(t&&e){const t=e.find((e=>{var t;return"embed"===e.type&&"embed"===(null===(t=e.format)||void 0===t?void 0:t.section)}));if(t&&t.format)return{block_height:t.format.defaultHeight,block_width:t.format.defaultWidth}}}},642509:(e,t,n)=>{n.d(t,{Ev:()=>l,Gq:()=>s,OY:()=>p,Ux:()=>u,hD:()=>c});var o=n(401898),r=n(421202),i=n(606287);(0,o.AO)((e=>e&&e.parent_table===r.iU&&a(e)&&e.format&&e.format.original_url&&!e.format.is_placeholder?{true:e}:{false:e})),(0,o.AO)((e=>{var t,n;return e&&e.parent_table===r.iU&&a(e)&&e.format&&void 0===e.format.original_url&&null!==(t=e.format)&&void 0!==t&&t.external_object_id&&null!==(n=e.format)&&void 0!==n&&n.uri&&!e.format.is_placeholder?{true:e}:{false:e}}));const a=(0,o.AO)((e=>d(e)&&"external_object_instance"===e.type?{true:e}:{false:e})),s=((0,o.AO)((e=>d(e)&&"external_object_instance_page"===e.type?{true:e}:{false:e})),(0,o.AO)((e=>e&&e.parent_table===i.vF&&d(e)&&"external_object_instance_page"===e.type?{true:e}:{false:e})),(0,o.AO)((e=>{var t;return d(e)?{false:e}:e.parent_table===r.iU&&null!==(t=e.format)&&void 0!==t&&t.original_url&&e.format.external_object_id?{true:e}:{false:e}}))),l=(0,o.AO)((e=>{var t;return d(e)?{false:e}:e.parent_table===r.iU&&null!==(t=e.format)&&void 0!==t&&t.original_url&&!e.format.external_object_id?{true:e}:{false:e}})),c=((0,o.AO)((e=>{var t;return!e||d(e)?{false:e}:e.parent_table===i.vF&&null!==(t=e.format)&&void 0!==t&&t.external_object_id?{true:e}:{false:e}})),(0,o.AO)((e=>{var t,n;return!e||d(e)?{false:e}:null!=e&&null!==(t=e.format)&&void 0!==t&&t.original_url||null!=e&&null!==(n=e.format)&&void 0!==n&&n.external_object_id||p(e)||m(e)||g(e)?{true:e}:{false:e}}))),d=(0,o.AO)((e=>"type"in e&&e.type?{true:e}:{false:e})),u=(0,o.AO)((e=>void 0===e.format?{true:e}:{false:e})),p=((0,o.AO)((e=>{var t;return null!==(t=e.format)&&void 0!==t&&t.is_placeholder?{true:e}:{false:e}})),(0,o.AO)((e=>{var t,n;return!e||d(e)?{false:e}:null!==(t=e.format)&&void 0!==t&&t.is_placeholder&&null!==(n=e.format)&&void 0!==n&&n.integration_id?{true:e}:{false:e}}))),m=(0,o.AO)((e=>d(e)?{false:e}:e.parent_table===i.vF&&e.format&&e.format.uri&&void 0===e.format.external_object_id&&e.format.integration_id?{true:e}:{false:e})),g=(0,o.AO)((e=>d(e)?{false:e}:e.parent_table===i.vF&&e.format&&e.format.uri&&void 0===e.format.external_object_id&&void 0===e.format.integration_id?{true:e}:{false:e}))},643593:(e,t,n)=>{n.d(t,{AA:()=>E,E$:()=>_,F8:()=>x,LF:()=>I,Wv:()=>R,_H:()=>P,bY:()=>c,ef:()=>T,g_:()=>C,lF:()=>g,lJ:()=>l,m5:()=>d,mD:()=>B,mV:()=>A,rF:()=>Z,w2:()=>F,x$:()=>f,zw:()=>M});n(21703),n(310517);var o=n(653965),r=n(307032),i=n(218265),a=n(517755),s=n(159730);n(471924),n(182798);const l=["A4","A3"],c=["Letter","Legal","Tabloid"];l.concat(c);function d(e){var t;return null===(t=p(e))||void 0===t?void 0:t.fileId}function u(e){let t;try{t=new URL(e)}catch(s){return}if(!t.hostname.endsWith(".amazonaws.com"))return;const n=t.pathname.slice(1),o=t.hostname.split(".");let r,i,a;if(5===o.length&&"s3"===o[1])r=o[0],i=n,a=t.origin;else{if((4!==o.length||"s3"!==o[0])&&3!==o.length)return;r=n.slice(0,n.indexOf("/")),i=n.slice(n.indexOf("/")+1),a=`${t.origin}/${r}`}return{bucket:r,key:i,baseurl:a}}function p(e){const t=u(e);if(!t)return;const{bucket:n,key:o}=t,i=o.split("/"),a="space/id/name"===function(e){return e.endsWith("files-secure")?"space/id/name":"id/name"}(n)?i.shift():void 0,[s,l]=i;return{key:o,bucket:n,fileId:(0,r.e)(s)?s:void 0,spaceId:(0,r.e)(a)?a:void 0,fileName:l}}function m(e){var t;return null===(t=p(e))||void 0===t?void 0:t.key}function g(e){const t=p(e);if(!t||!t.fileId)return;const{fileId:n,fileName:o}=t,r=o.indexOf(".");if(-1===r)return`${o}-${n}`;return`${o.slice(0,r)}-${n}.${o.slice(r+1)}`}function f(e){const t=["https://file.notion.so/","https://file-dev.notion.so/","https://file-stg.notion.so/","http://file-local.notion.so:3000/"];for(const n of t)if(null!=e&&e.startsWith(n))return!0;return!1}const h="secure.notion-static.com",v="temporary.notion-static.com",y="-files-secure";function b(e,t){if(!e)return!1;if(!(e.startsWith(t)||e.replace("s3.","s3-").startsWith(t)))return!1;if(t.includes(v))return!0;if(t.includes(h)||t.includes(y)){const t=i.Qc(e);if(!t.pathname)return!1;const n=t.pathname.split("/")??[];return 4===n.length&&""!==n[3]}return!1}function _(e,t){if(S(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:""))return!0;if(t.length>3)throw new s.p8("invalid method parameters");for(const n of t)if(b(e,n))return!0;return!1}function S(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=i.Qc(e);if(!o.pathname||o.host!==n)return!1;const r=o.pathname.split("/")??[];return Boolean(e&&r.length>=3&&`/${r[1]}`===t)}const k={"image/fits":!0,"image/ief":!0,"image/jp2":!0,"image/jpeg":!0,"image/jpg":!0,"image/jpm":!0,"image/jpx":!0,"image/png":!0,"image/tiff":!0,"image/tif":!0,"image/heic":!0,"image/x-icon":!0,"image/svg+xml":!0,"application/pdf":!0},w={heic:!0,ico:!0,jpeg:!0,jpg:!0,png:!0,tif:!0,tiff:!0,gif:!0,svg:!0,pdf:!0,webp:!0};function x(e,t){if(I(e))return!1;const n=(B(e)||"").toLowerCase();return!(!w[n]&&!k[`image/${n}`])&&!(t&&t.length>0&&"gif"===n&&_(e,t))}function I(e){const t=e.toLowerCase();return t.startsWith("/images/")&&!t.includes("..")}function C(e){return e.startsWith("https://images.unsplash.com/")}function T(e){const t=new RegExp("^(http|https)://media[0-9-]+.giphy.com/");return null!==e.match(t)}function M(e,t){const n=i.Qc(e);return i.bf({url:`https://images.unsplash.com${n.pathname}`,query:{...n.query,w:(3*Math.max(400*Math.round(t/400),400)).toString()}})}function P(e,t,n,o,r){const i=(0,a.EK)({url:e,permissionRecord:t,baseUrl:n,fullyQualified:!1,userId:o});return fetch(i).then((e=>e.blob())).then((e=>{const t=document.createElement("a");t.href=window.URL.createObjectURL(e),t.download=r||"image",t.click(),window.URL.revokeObjectURL(t.href)}))}function A(e,t){const n=D(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",arguments.length>3&&void 0!==arguments[3]?arguments[3]:"");if(void 0!==n)return n;if(_(e,t)){const t=d(e),n=m(e);if(t&&n){return{id:t,url:e}}}}function R(e,t,n){if(void 0===e)return;if(void 0===D(e,arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",arguments.length>4&&void 0!==arguments[4]?arguments[4]:""))return;const o=i.Qc(e);if(!o.pathname)return;const r=o.pathname.split("/");if(r.length<5)return;const a="f"===r[2];return{name:r[a?5:4],link:`${a?n:t}/${r.slice(3).join("/")}`}}function D(e,t,n){if(S(e,t,n)){const t=i.Qc(e);if(!t.pathname)return;const n=t.pathname.split("/");if(n.length<5)return;const o="s"===n[2]?3:4,r=n[o],a=n.slice(o).join("/");if(r&&a){return{id:r,url:e}}}}function B(e){const t=i.Qc(e);if(!t.href)return;if(!t.pathname)return;const n=o.Z$(t.pathname.split("/"));if(!n)return;const r=n.split(".");return 1===r.length?"":r[r.length-1]}function E(e){const t=e.lastIndexOf(".");return t>=0?e.substring(0,t):e}function F(e){const t=i.Qc(e);if(t.pathname){const e=t.pathname.substring(t.pathname.lastIndexOf("/")+1);if(e)return e}return""}function Z(e){let t=e.title||F(e.source)||e.source;if(e.title){const n=B(e.source),o=B(t.replace("#",""));n&&n!==o&&(t+=`.${n}`)}return t}},517755:(e,t,n)=>{n.d(t,{EK:()=>l,Q4:()=>s,g:()=>d,nK:()=>a});var o=n(653965),r=n(218265);const i=2e3,a=5e3;function s(e){return c({...e,permissionRecord:void 0})}function l(e){return c(e)}function c(e){const{userId:t}=e;let{url:n,width:a}=e;const{baseUrl:s,fullyQualified:l,stripGoogleIconQuery:c,permissionRecord:d}=e;if(n.startsWith("C:\\"))return n;r.j3(n)&&(n=r.O_({relativeUrl:n,baseUrl:s})),c&&(n=n.replace("?sz=50",""));const u={...d};a&&n.indexOf(".ico")<0&&n.indexOf(".svg")<0&&n.indexOf(".gif")<0&&(a*=2,a=o.NM(a,-1),a=Math.max(a,40),a=Math.min(a,i),u.width=a.toString()),u.userId=t;const p=l?s:"";return r.bf({url:`${p}/image/${encodeURIComponent(n)}`,query:{...u,cache:"v2"}})}function d(e){const{baseURL:t,url:n,downloadName:o,download:i,permissionRecord:a,currentUserId:s,domainBaseURL:l}=e,c=r.j3(n)?r.O_({relativeUrl:n,baseUrl:t}):n,d={...a};o&&(d.name=o),i&&(d.download="true"),s&&(d.userId=s);const u=l||"";return r.bf({url:`${u}/signed/${encodeURIComponent(c)}`,query:{...d,cache:"v2"}})}},480632:(e,t,n)=>{n.d(t,{Ew:()=>i,KC:()=>r,gR:()=>l,i:()=>s,ux:()=>a});var o=n(619584);const r=5*o.eM,i=100*o.eM,a=10,s=Object.entries({image:["JPG","JPEG","PNG","GIF","SVG","BMP","HEIC","TIF","TIFF","WEBP","ICO","PSD"],video:["MP4","MOV","AVI","WMV","MKV","FLV","WEBM","MPEG","M4V","3GP","3G2","OGV"],audio:["MP3","WAV","AAC","FLAC","OGG","M4A","WMA","ALAC","AIFF","OPUS","MID","MIDI"],pdf:["PDF"],slides:["PPT","PPTX","PPS","PPSX","ODP"],sheet:["XLS","XLSX","ODS","CSV","TSV"],other:["TXT","MD","LOG","DOC","DOCX","ODT","RTF"]}).reduce(((e,t)=>{let[n,o]=t;return o.forEach((t=>{e[t]=n})),e}),{});function l(e){return s.hasOwnProperty(e.toUpperCase())}},406695:(e,t,n)=>{n.d(t,{AX:()=>p,De:()=>E,Dg:()=>C,H:()=>y,Lf:()=>F,Lw:()=>M,Nx:()=>h,PZ:()=>g,Rt:()=>A,Sn:()=>m,Vj:()=>c,Zg:()=>f,gH:()=>d,iA:()=>D,j5:()=>l,jk:()=>x,kp:()=>S,lw:()=>v,oY:()=>s,oz:()=>u,rx:()=>I,v0:()=>T,vP:()=>P});var o=n(401898),r=n(619584),i=n(415095),a=n(379362);const s={type:"database"};let l=function(e){return e[e.Page=0]="Page",e[e.Collection=1]="Collection",e[e.Table=2]="Table",e[e.Board=3]="Board",e[e.Calendar=4]="Calendar",e[e.List=5]="List",e[e.Gallery=6]="Gallery",e[e.Timeline=7]="Timeline",e[e.PageView=8]="PageView",e[e.Relation=9]="Relation",e[e.Chart=10]="Chart",e[e.FormEditor=11]="FormEditor",e}({}),c=function(e){return e.Jira="Jira",e}({}),d=function(e){return e.CsvImport="CsvImport",e}({});function u(e){return"table"===e?"table_properties":"board"===e?"board_properties":"calendar"===e?"calendar_properties":"gallery"===e?"gallery_properties":"list"===e?"list_properties":"timeline"===e?"timeline_properties":"page"===e?"page_view_properties":void("chart"!==e&&"form_editor"!==e&&(0,o.t1)(e))}const p=["show","hide_if_empty","hide"],m=["section_show","section_collapsed","section_hide","inline","minimal"],g="medium",f=280,h=200,v=35,y=["hours","day","week","bi_week","month","quarter","year"],b=(0,o.AO)((e=>e.original_url&&e.external_object_id?{true:e}:{false:e})),_=(0,o.AO)((e=>e.is_placeholder&&!e.integration_id?{true:e}:{false:e})),S=(0,o.AO)((e=>b(e)||b(e)||_(e)?{true:e}:{false:e})),k={type:"load_limit",limit:50},w={type:"load_limit",limit:25},x=[{type:"load_limit",limit:10},{type:"load_limit",limit:25},{type:"load_limit",limit:50},{type:"load_limit",limit:100}];function I(e,t){return e||(t?w:k)}function C(e){return"table"===e?l.Table:"board"===e?l.Board:"calendar"===e?l.Calendar:"list"===e?l.List:"timeline"===e?l.Timeline:"page"===e?l.PageView:"gallery"===e?l.Gallery:"chart"===e?l.Chart:"form_editor"===e?l.FormEditor:void(0,o.t1)(e)}function T(e){var t;return null==e||null===(t=e.getFormat())||void 0===t?void 0:t.drive_properties}function M(e){return Boolean(e)}function P(e,t){return Boolean(e&&t.find((e=>{let{property:t,visible:n}=e;return Boolean("title"===t&&n)})))}function A(e,t,n){let o=[...e];const r=e.findIndex((e=>e.property===t)),i=e[r];return i?!i.visible&&n&&(o[r]={...o[r],visible:!0}):o=[{property:t,visible:!0},...e],o}const R=new RegExp(/notion:\/\/.*\/tutorial\/.*/);function D(e){return!!e&&R.test(e)}const B=5*r.hM;function E(e,t){var n;const r=null===(n=e.update_ai_inferences_status)||void 0===n?void 0:n[t];return r?"requested"===r.type?{isRunning:Date.now()-r.created_time<B}:"updating"===r.type?{isRunning:Date.now()-r.last_edited_time<B,numPagesFilled:r.num_pages_filled,numPagesRequested:r.num_pages_requested}:void(0,o.t1)(r):{isRunning:!1}}function F(e){if(null==e)return;const t=i.xo.fromString(e);if(t)switch(t.type){case"custom":return{type:"custom_emoji",emoji:t,icon:e};case"unicode":return{type:"unicode_emoji",emoji:t,icon:t.unicode}}return(0,a.V2)(e)?{type:"notion_icon",icon:e}:(0,a.kR)(e)?{type:"app_package_asset",icon:e}:{type:"url",icon:e}}},464340:(e,t,n)=>{n.d(t,{P:()=>a});n(757658);var o=n(401898);const r={LLLL:"DDDD t",llll:void 0,LLL:"DDD t",lll:"DD t",LL:"DDD",ll:"DD",L:void 0,l:void 0,LT:"t",LTS:"tt",M:"L",Mo:void 0,MM:"LL",MMM:void 0,MMMM:void 0,Q:"q",Qo:void 0,D:"d",Do:void 0,DD:"dd",DDD:"o",DDDo:void 0,DDDD:"ooo",d:void 0,do:void 0,dd:void 0,ddd:void 0,dddd:"cccc",e:void 0,E:"c",w:void 0,wo:void 0,ww:void 0,W:"W",Wo:void 0,WW:"WW",YY:"yy",YYYY:"yyyy",YYYYYY:void 0,Y:"y",gg:"kk",gggg:"kkkk",GG:"kk",GGGG:"kkkk",A:"a",a:void 0,H:"H",HH:"HH",h:"h",hh:"hh",k:void 0,kk:void 0,m:"m",mm:"mm",s:"s",ss:"ss",S:"uuu",SS:"uu",SSS:"SSS",z:void 0,zz:void 0,Z:"ZZ",ZZ:"ZZZ",X:"X",x:"x"};const i=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|LTS|LT|LL?L?L?|l{1,4}|.)/g;function a(e,t){let n=[];const a=[],d=e.locale.substring(0,2),u=t=>{if(n.length>0){const t=n.join("");a.push(e.toFormat(t)),n=[]}t&&a.push(t)},p=t.match(i);return p?(p.forEach((t=>{if(r[t])n.push(r[t]);else if((i=t)in r&&void 0===r[i])switch(t){case"llll":"en"===d?n.push("ccc, DD t"):"ja"===d?n.push("DD(ccc) t"):"ko"===d?n.push("DD cccc t"):"de"===d?n.push("ccc., DD t"):n.push("ccc DD t");break;case"L":"ko"===d?n.push("yyyy.MM.dd."):u(e.toLocaleString({day:"2-digit",month:"2-digit",year:"numeric"}));break;case"l":"ja"===d?u(e.toLocaleString({day:"2-digit",month:"2-digit",year:"numeric"})):"ko"===d?n.push("yyyy.MM.dd."):"fr"===d?n.push("d/M/y"):n.push("D");break;case"MMM":"ja"===d?u(e.toLocaleString({month:"long"})):n.push("LLL");break;case"MMMM":"ja"===d?u(e.toLocaleString({month:"long"})):n.push("LLLL");break;case"e":if("fr"===d||"de"===d){u((e.weekday-1).toString());break}case"d":case"do":const i=7===e.weekday?0:e.weekday;if("do"===t){const e=c(d,i,"c");if(e){u(e);break}}u(i.toString());break;case"dd":u(e.weekdayShort.substring(0,2));break;case"ddd":"de"===d?n.push("ccc."):n.push("ccc");break;case"ww":if("fr"===d||"de"===d){n.push("WW");break}case"w":case"wo":const a=function(e,t){if("fr"===t||"de"===t)return e.weekNumber;const n=e.set({month:1,day:1});if(l(e,n)||l(e,n.set({year:e.year+1})))return 1;return s(e)}(e,d);if("wo"===t){const e=c(d,a,"W");if(e){u(e);break}}const p="ww"===t?a.toString().padStart(2,"0"):a.toString();u(p);break;case"YYYYYY":u(`+${e.year.toString().padStart(6,"0")}`);break;case"a":u(e.toFormat("a").toLowerCase());break;case"k":0===e.hour?u("24"):n.push("H");break;case"kk":0===e.hour?u("24"):n.push("HH");break;case"Mo":case"Qo":case"Do":case"DDDo":case"Wo":const m=r[t.replace("o","")],g=function(e,t,n){const o=t.toFormat(n),r=parseInt(o);if(isNaN(r))return;return c(e,r,n)}(d,e,m);g?u(g):n.push(m);break;case"z":case"zz":const f=e.zone.offsetName(e.toMillis(),{format:"short",locale:"en-US"});u(f);break;default:(0,o.t1)(t)}else/^S{4,9}/.test(t)?n.push("SSS"):/^\[.*\]$/.test(t)?u(t.substring(1,t.length-1)):u(t.replace(/\\/g,""));var i})),u(),a.join("")):e.toFormat(t)}function s(e){if(7===e.weekday)return s(e.plus({days:1}));const t=e.set({month:1,day:1}),n=e.set({month:1,day:4});if(t.weekNumber!==n.weekNumber){if(1!==(7===t.weekday?e.set({month:1,day:2}).weekNumber:t.weekNumber))return e.weekNumber+1}return e.weekNumber}function l(e,t){const n=7===e.weekday?e.plus({days:1}):e,o=7===t.weekday?t.plus({days:1}):t;return n.hasSame(o,"week")}function c(e,t,n){switch(e){case"en":return function(e){const t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}(t);case"fr":return function(e,t){switch(t){case"d":return e+(1===e?"er":"");default:case"L":case"q":case"o":case"c":return e+(1===e?"er":"e");case"W":return e+(1===e?"re":"e")}}(t,n);case"de":return`${t}.`;case"ja":return function(e,t){switch(t){case"y":return 1===e?"元年":`${e}年`;case"d":case"c":case"o":return`${e}日`;default:return e.toString()}}(t,n);case"ko":return function(e,t){switch(t){case"d":case"c":case"o":return`${e}일`;case"L":return`${e}월`;case"W":return`${e}주`;default:return e.toString()}}(t,n);default:return}}},399319:(e,t,n)=>{n.d(t,{Jy:()=>s,qT:()=>r,uy:()=>a,xK:()=>i});var o=n(600606);function r(e,t){return Array.isArray(t)?t.some((t=>r(e,t))):"unknown"===e.type||"unknown"===t.type||"expression"===t.type||e.type===t.type&&("block"===e.type||"select"===e.type||"function"===e.type?s(e,t):"array"!==e.type||"array"!==t.type||r(e.of,t.of))}function i(e,t){return!!r(e,t)||(r({type:"checkbox"},t)?{type:"checkbox"}:!!r({type:"text"},t)&&{type:"text"})}function a(e,t){const n=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?s:(e,t)=>e.type===t.type;return n(e,t)||"array"===e.type&&n(e.of,t)}function s(e,t){return e.type===t.type&&("block"===e.type&&"block"===t.type?void 0===e.collection?void 0===t.collection:void 0!==t.collection&&(0,o.qo)(e.collection,t.collection):"select"===e.type&&"select"===t.type?(0,o.qo)(e.collection,t.collection)&&e.property===t.property:"array"===e.type&&"array"===t.type?s(e.of,t.of):"function"!==e.type||"function"!==t.type||e.libraryFunction===t.libraryFunction&&void 0!==e.boundTargetType==(void 0!==t.boundTargetType))}},173110:(e,t,n)=>{n.d(t,{Av:()=>d,DF:()=>S,Eb:()=>c,GV:()=>T,Gx:()=>_,Oy:()=>i,QQ:()=>v,Rc:()=>C,Uq:()=>k,WG:()=>s,WY:()=>M,Xm:()=>w,_i:()=>b,dy:()=>l,eO:()=>y,gD:()=>x,vz:()=>a,x2:()=>r,yp:()=>o,zF:()=>h,zq:()=>I});let o=function(e){return e[e.Binding=0]="Binding",e[e.ContextValue=1]="ContextValue",e[e.ThisRow=2]="ThisRow",e}({}),r=function(e){return e[e.Binding=0]="Binding",e[e.Token=1]="Token",e[e.Builtin=2]="Builtin",e[e.LibraryFunction=3]="LibraryFunction",e}({}),i=function(e){return e.Checkbox="checkbox",e.Block="block",e.Person="person",e.BlockProperty="block_property",e.Date="date",e.ContextValue="context",e}({}),a=function(e){return e.Title="title",e.CreatedBy="created_by",e.CreatedTime="created_time",e.LastEditedBy="last_edited_by",e.LastEditedTime="last_edited_time",e}({});const s=Object.values(a),l={[a.Title]:{type:"text"},[a.CreatedBy]:{type:"person"},[a.CreatedTime]:{type:"date"},[a.LastEditedBy]:{type:"person"},[a.LastEditedTime]:{type:"date"}},c="{{notion:",d="}}",u="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",p=c.replace(/\{/g,"\\{"),m=d.replace(/\}/g,"\\}"),g="[^:]+",f="[^}]+",h=new RegExp(`${p}.*${m}`),v=new RegExp(`^${p}${i.Block}:(${u})(:${u})?${m}`),y=new RegExp(`^${p}${i.Person}:(${u})${m}`),b=new RegExp(`^${p}${i.BlockProperty}:(${g})(:(${u}):(${u}))?${m}`),_=(new RegExp(`${p}${i.BlockProperty}:(${g})(:(${u}):(${u}))?${m}`,"g"),new RegExp(`^${p}${i.BlockProperty}:context_value:(${g}):(${f}):([\\w-]+)${m}`)),S=new RegExp(`^${p}${i.Checkbox}:(true|false)${m}`),k=new RegExp(`^${p}${i.ContextValue}:(${f})${m}`),w=new RegExp(`^${p}${i.Date}:([^}]+)${m}`),x=new RegExp(/prop\((["'“”])(.*?)(["'“”])\)/g),I=["add","subtract","multiply","divide","sum"],C=["min","max","mean","median"],T="current",M="index"},773717:(e,t,n)=>{n.d(t,{FR:()=>m,OY:()=>p,ic:()=>u,sB:()=>d,sG:()=>c,y_:()=>g});var o=n(653965),r=n(401898),i=n(877097),a=n(672158),s=n(335102);function l(e){switch(e){case"checkbox":return"boolean";case"number":return"number";case"text":return"text";case"date":return"date";case"array":return"array";case"block":return"block";case"person":return"person";case"select":return"select";case"function":return"function";case"unknown":return"unknown";case"undefined":return"undefined";default:(0,r.t1)(e)}}function c(e){switch(e.type){case a.$E.InvalidCharacter:return{...i.mr.InvalidCharacter,values:{errorCharacter:e.character}};case a.$E.UnclosedStringLiteral:return i.mr.UnclosedStringLiteral;case a.$E.UnclosedComment:return i.mr.UnclosedComment;case a.$E.TokenExpected:return{...i.mr.TokenExpected,values:{expectedToken:e.token}};case a.$E.StringLiteralContainsToken:return i.mr.StringLiteralContainsToken;case a.$E.ExpressionExpected:return i.mr.ExpressionExpected;case a.$E.PropertyTokenOrFunctionExpected:return i.mr.PropertyExpected;case a.$E.EndOfInputExpected:return i.mr.EndOfInputExpected;case a.$E.UnexpectedError:return i.mr.UnexpectedError;default:(0,r.t1)(e)}}function d(e){switch(e.type){case a.h4.FunctionCallArgumentWrongType:case a.h4.FunctionCallUnexpectedArgument:return e.argument;default:return e.node}}function u(e){let t;switch(e.type){case a.h4.ThisRowTypeNotFound:t=i.o8.ThisRowTypeNotFound;break;case a.h4.ThisRowNotBlockWithCollection:t=i.o8.ThisRowNotBlockWithCollection;break;case a.h4.MissingPropertyOnThisRow:t={...i.o8.MissingPropertyOnThisRow,values:{propertyName:e.property}};break;case a.h4.MissingContextVariable:{const n=(0,s.Xp)(e.token)?e.token.contextValueId:e.token.valueId;t={...i.o8.MissingContextVariable,values:{valueId:n}}}break;case a.h4.MissingBlock:t={...i.o8.MissingBlock,values:{blockId:e.token.blockId}};break;case a.h4.CallingNotFunction:t={...i.o8.CallingNotFunction,values:{expressionType:l(e.callee.type.type)}};break;case a.h4.FunctionCallTooFewArguments:t={...i.o8.FunctionCallTooFewArguments,values:{minNumParameters:e.minNumParameters,functionName:e.libraryFunction.name,numArguments:e.numArguments}};break;case a.h4.FunctionCallUnexpectedArgument:t={...i.o8.FunctionCallUnexpectedArgument,values:{functionName:e.libraryFunction.name}};break;case a.h4.FunctionCallArgumentWrongType:t={...i.o8.FunctionCallArgumentWrongType,values:{argumentType:l(e.argument.type.type),functionName:e.libraryFunction.name}};break;case a.h4.MemberPropertyMismatchCollection:t={...i.o8.MemberPropertyMismatchCollection,values:{propertyName:e.token.property}};break;case a.h4.MemberPropertyMissing:t={...i.o8.MemberPropertyMissing,values:{propertyName:e.property}};break;case a.h4.MemberPropertyTargetNotBlock:t=i.o8.MemberPropertyTargetNotBlock;break;case a.h4.MemberPropertyTypeInvalid:t={...i.o8.MemberPropertyTypeInvalid,values:{propertyName:e.propertyName,propertyType:e.propertyType}};break;case a.h4.UndefinedIdentifier:t={...i.o8.UndefinedIdentifier,values:{identifier:e.node.text}};break;case a.h4.UnifiedFunctionCannotFindFunction:t={...i.o8.UnifiedFunctionCannotFindFunction,values:{functionName:e.name}};break;case a.h4.UnifiedFunctionNoArguments:t={...i.o8.UnifiedFunctionNoArguments,values:{functionName:e.libraryFunction.name}};break;case a.h4.UnifiedFunctionTargetWrongType:t={...i.o8.UnifiedFunctionTargetWrongType,values:{functionName:e.libraryFunction.name,targetType:l(e.expression.type.type)}};break;case a.h4.CannotRelativelyCompareTypes:t={...i.o8.CannotRelativelyCompareTypes,values:{lhsType:l(e.lhsType.type),rhsType:l(e.rhsType.type)}};break;case a.h4.CannotDoMathOnType:t={...i.o8.CannotDoMathOnType,values:{lhsType:l(e.lhsType.type),rhsType:l(e.rhsType.type)}};break;case a.h4.UnaryMinusOnNonNumber:t={...i.o8.UnaryMinusOnNonNumber,values:{type:l(e.expression.type.type)}};break;case a.h4.IdentifierExpected:t=i.o8.IdentifierExpected;break;case a.h4.FunctionCallExpected:t={...i.o8.FunctionCallExpected,values:{functionName:e.functionName}};break;case a.h4.RenamedIdentifier:t={...i.o8.RenamedIdentifier,values:{identifier:e.identifier,renamedTo:e.renamedTo}};break;case a.h4.RemovedFunction:t={...i.o8.RemovedFunction,values:{functionName:e.functionName,alternative:e.alternative}};break;case a.h4.ContextVariableNotBlockWithCollection:t={...i.o8.ContextVariableNotBlockWithCollection,values:{valueId:e.token.contextValueId}};break;case a.h4.MissingPropertyOnContextVariable:t={...i.o8.MissingPropertyOnContextVariable,values:{propertyName:e.property,valueId:e.token.contextValueId}};break;case a.h4.BlockPropertyTypeInvalid:t={...i.o8.BlockPropertyTypeInvalid,values:{propertyName:e.propertyName}};break;default:(0,r.t1)(e)}return{...t,values:{...t.values,startOffset:e.node.startOffset,endOffset:e.node.endOffset+1}}}function p(e){let t;switch(e.type){case a.FY.MissingThisRow:t=i.YG.MissingThisRow;break;case a.FY.MissingSchemaPropertyOnThisRow:t={...i.YG.MissingSchemaPropertyOnThisRow,values:{propertyName:e.property}};break;case a.FY.ThisRowBlockPropertyMismatchCollection:t=i.YG.ThisRowBlockPropertyMismatchCollection;break;case a.FY.MissingContextVariable:t={...i.YG.MissingContextVariable,values:{valueId:e.valueId}};break;case a.FY.IdentifierNotFound:t={...i.YG.IdentifierNotFound,values:{identifier:e.node.text}};break;case a.FY.CannotRelativelyCompareTypes:t={...i.YG.CannotRelativelyCompareTypes,values:{lhsType:l(e.lhsType),rhsType:l(e.rhsType)}};break;case a.FY.CannotDoMathOnType:t={...i.YG.CannotDoMathOnType,values:{valueType:l(e.valueType)}};break;case a.FY.CannotCallNonFunction:t={...i.YG.CannotCallNonFunction,values:{calleeType:l(e.calleeType)}};break;case a.FY.UnifiedFunctionPropertyNotFound:t={...i.YG.UnifiedFunctionPropertyNotFound,values:{functionName:e.node.name}};break;case a.FY.LibraryFunctionExecutionError:t={...i.YG.LibraryFunctionExecutionError,values:{functionName:e.libraryFunction.name}};break;case a.FY.FunctionCallTooFewArguments:t={...i.YG.FunctionCallTooFewArguments,values:{functionName:e.libraryFunction.name}};break;case a.FY.FunctionCallUnexpectedArgument:t={...i.YG.FunctionCallUnexpectedArgument,values:{functionName:e.libraryFunction.name}};break;case a.FY.FunctionCallArgumentWrongType:t={...i.YG.FunctionCallArgumentWrongType,values:{functionName:e.libraryFunction.name,argumentType:l(e.argumentType)}};break;case a.FY.AccessingPropertyOnNonBlock:t=i.YG.AccessingPropertyOnNonBlock;break;case a.FY.MissingDataDependencyBlock:t={...i.YG.MissingDataDependencyBlock,values:{blockId:e.blockPointer.id}};break;case a.FY.MissingDataDependencyPerson:t={...i.YG.MissingDataDependencyPerson,values:{personId:e.personPointer.id}};break;case a.FY.MemberPropertyMismatchCollection:t=i.YG.MemberPropertyMismatchCollection;break;case a.FY.MissingPropertyOnSchemaForMemberProperty:t=i.YG.MissingPropertyOnSchemaForMemberProperty;break;case a.FY.UnaryMinusOnNonNumber:t={...i.YG.UnaryMinusOnNonNumber,values:{expressionType:l(e.expressionType)}};break;case a.FY.UnexpectedRecoveryNode:t=i.YG.UnexpectedRecoveryNode;break;case a.FY.UnexpectedError:t=i.YG.UnexpectedError;break;case a.FY.DepthExceeded:t=i.YG.DepthExceeded;break;case a.FY.CycleDetected:t=i.YG.CycleDetected;break;case a.FY.MaxEvaluationTimeExceeded:t=i.YG.MaxEvaluationTimeExceeded;break;case a.FY.MissingSchemaPropertyOnCollection:t={...i.YG.MissingSchemaPropertyOnCollection,values:{collectionId:e.collectionId,propertyName:e.property}};break;case a.FY.ContextVariableWrongType:t={...i.YG.ContextVariableWrongType,values:{expectedType:e.expectedType,propertyType:e.resultType,valueId:e.valueId}};break;default:(0,r.t1)(e)}return(0,s.w7)(e)?{...t,values:{...t.values,startOffset:e.node.startOffset,endOffset:e.node.endOffset+1}}:t}function m(e){const t=null==e?void 0:e.values;return[o.CE(e,"values"),t]}function g(e){return e.type===a.FY.DepthExceeded||e.type===a.FY.CycleDetected||e.type===a.FY.MaxEvaluationTimeExceeded}},513730:(e,t,n)=>{n.d(t,{Ec:()=>d,LD:()=>c,_z:()=>u,co:()=>p});n(757658);var o=n(653965),r=n(541432),i=n(399036),a=n(600606),s=n(421202),l=n(606287);function*c(e){const t=[];let n,r=e.length;for(;r>0;){const i=[];for(let o=0;o<e.length;o++){const a=e[o];if(void 0===a)continue;const s=void 0!==n?a.next(n):a.next();s.done?(e[o]=void 0,r--,t[o]=s.value):i.push(s.value)}i.length>0&&(n=yield{recordPointers:(0,o.mN)(i.flatMap((e=>e.recordPointers??[])),(e=>`${e.table}:${e.id}`)),collectionBlockProperties:i.flatMap((e=>e.collectionBlockProperties??[]))})}return t}function*d(e,t){if(!e.length)return[];const n=yield{recordPointers:e},o=t.limit,r=[];for(const a of e){if(void 0!==o&&r.length>=o)break;const e=n.getRecordModel(a);if(!e||!e.getAlive()||e.isTemplate())continue;const s=yield*p(e);(null==s?void 0:s.id)===(0,i.F0)(t)&&r.push(e)}return r}function*u(e,t){const n=t[e];if(!(n&&"rollup"===n.type&&n.relation_property&&n.target_property_type&&n.target_property))return;const o=t[n.relation_property];if(!o||"relation"!==o.type||!(0,i.F0)(o))return;const r=(0,i.j0)(o),{getRecordModel:a}=yield{recordPointers:[r]},s=a(r);if(!s)return;const l=s.getNormalizedSchema(),c=s.getMappedProperty(n.target_property),d=l[c];return d&&n.target_property_type===d.type?{propertySchema:n,targetProperty:c,relationPropertySchema:o,targetCollectionModel:s,targetCollectionSchema:l,targetPropertySchema:d,targetCollectionPointer:r}:void 0}function*p(e){const t=e.getParentPointer();if(t.table===l.vF){return(yield{recordPointers:[t]}).getRecordModel(t)}const n=e.getType();if((0,r.Pm)(n))return yield*function*(e){let t=e.getParentPointer();for(;t;){if(a.dr.isEqual(t,e.pointer))return;if(t.table!==s.iU)return;const n=(yield{recordPointers:[t]}).getRecordModel(t);if(!n)return;if(!n.isCollectionView()){t=n.getParentPointer();continue}const o=n.getCollectionPointer();if(!o)return;const r=(yield{recordPointers:[o]}).getRecordModel(o);if(!r)return;const i=r.getRootPagePointer();return r.isPageTreeCollection()&&i&&a.dr.isEqual(i,t)?r:void 0}}(e)}},150610:(e,t,n)=>{n.d(t,{Eh:()=>s,aU:()=>l,dJ:()=>c,eD:()=>u,tE:()=>d});n(757658);var o=n(401898),r=n(415095),i=n(421838),a=n(335102);function s(e,t){if(0===t)return 0;let n=0,i=0;for(let a=0;a<e.length;a++){const s=e[a];switch(s.type){case"code":if(t<=n+s.codeLength)return i+(0,r.p4)(s.text).slice(0,t-n).join("").length;n+=s.codeLength,i+=s.length;break;case"token":if(t<=n+1)return i+s.length;n+=1,i+=s.length;break;default:(0,o.t1)(s)}}return i}function l(e,t,n){if(0===t)return 0;let o=0,i=0;for(let a=0;a<e.length;a++){const s=e[a];switch(s.type){case"code":if(t<=i+s.length)return o+(0,r.p4)(s.text.substring(0,t-i)).length;o+=s.codeLength,i+=s.length;break;case"token":if(i+s.length>=t)return o+("right"===n?1:0);o+=1,i+=s.length}}return o}function c(e){let t="";const n=[];return null==e||e.forEach((e=>{const o=(0,i.hDy)(e),s=(0,a._u)(o);if(void 0!==s)return t+=s,void n.push({type:"token",length:s.length});const l=(0,i.WiV)(e);t+=l,n.push({type:"code",length:l.length,codeLength:(0,r.p4)(l).length,text:l})})),[t,n]}function d(e,t){return{...e,startOffset:l(t,e.startOffset,"left"),endOffset:l(t,e.endOffset,"left")}}function u(e){return e.reduce(((e,t)=>{const n=t.type;return"token"===n?e+1:"code"===n?e+t.codeLength:void(0,o.t1)(n)}),0)}},889679:(e,t,n)=>{n.d(t,{QP:()=>c,h0:()=>d,um:()=>u});n(430541),n(757658);var o=n(709291),r=n(202032),i=n(421838),a=n(173110),s=n(335102);const l=(0,o.defineMessages)({property:{id:"formula2Input.propertyHelper.descriptionGeneric",defaultMessage:"Database property."},titlePropertyDescription:{id:"formulaLibrary.property.title.description",defaultMessage:"Title property."},textPropertyDescription:{id:"formulaLibrary.property.text.description",defaultMessage:"Text property."},urlPropertyDescription:{id:"formulaLibrary.property.url.description",defaultMessage:"URL property."},emailPropertyDescription:{id:"formulaLibrary.property.email.description",defaultMessage:"Email property."},phoneNumberPropertyDescription:{id:"formulaLibrary.property.phoneNumber.description",defaultMessage:"Phone number property."},selectPropertyDescription:{id:"formulaLibrary.property.select.description",defaultMessage:"Select property."},multiSelectPropertyDescription:{id:"formulaLibrary.property.multiSelect.description",defaultMessage:"Multi-select property, list."},statusPropertyDescription:{id:"formulaLibrary.property.status.description",defaultMessage:"Status property."},checkboxPropertyDescription:{id:"formulaLibrary.property.checkbox.description",defaultMessage:"Checkbox property."},datePropertyDescription:{id:"formulaLibrary.property.date.description",defaultMessage:"Date property."},personPropertyDescription:{id:"formulaLibrary.property.person.description",defaultMessage:"Person property, list."},relationPropertyDescription:{id:"formulaLibrary.property.relation.description",defaultMessage:"Relation property, list."},rollupPropertyDescriptionList:{id:"formulaLibrary.property.rollup.description",defaultMessage:"Rollup property, list."},rollupPropertyDescription:{id:"formulaLibrary.property.rollup.descriptionWithList",defaultMessage:"Rollup property."},numberPropertyDescription:{id:"formulaLibrary.property.number.description",defaultMessage:"Number property."},formulaPropertyDescription:{id:"formulaLibrary.property.formula.description",defaultMessage:"Formula property."},formulaPropertyDescriptionList:{id:"formulaLibrary.property.formula.descriptionWithList",defaultMessage:"Formula property, list."},createdTimePropertyDescription:{id:"formulaLibrary.property.createdTime.description",defaultMessage:"Created time property."},lastEditedTimePropertyDescription:{id:"formulaLibrary.property.lastEditedTime.description",defaultMessage:"Last edited time property."},createdByPropertyDescription:{id:"formulaLibrary.property.createdBy.description",defaultMessage:"Created by property."},lastEditedByPropertyDescription:{id:"formulaLibrary.property.lastEditedBy.description",defaultMessage:"Last edited by property."},filePropertyDescription:{id:"formulaLibrary.property.file.description",defaultMessage:"File property, list."},autoincrementIdDescription:{id:"formulaLibrary.property.autoincrementId.description",defaultMessage:"ID property."}}),c={title:{name:"title",type:{type:"text"},description:l.titlePropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),['.style("b")']],isCopyable:!0},{input:[d("Full Name"),['.split(" ").at(0)']]}]:[{input:[d("Title")]},{input:[d("Title"),['.style("b")']]},{input:[d("Name"),['.split(" ").at(0)']]}]},text:{name:"text",type:{type:"text"},description:l.textPropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[["upper("],p(e),[")"]],isCopyable:!0},{input:[p(e),['.style("b", "red")']],isCopyable:!0}]:[{input:[["upper("],d("Name"),[")"]]},{input:[d("Name"),['.style("b", "red")']]}]},url:{name:"url",type:{type:"text"},description:l.urlPropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),[' ? link("Link", '],p(e),[').style("green") : ""']],isCopyable:!0}]:[{input:[d("URL"),[' ? link("Link", '],d("URL"),[').style("green") : ""']]}]},email:{name:"email",type:{type:"text"},description:l.emailPropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),[' ? link("Email", "mailto:" + '],p(e),[').style("blue") : ""']],isCopyable:!0}]:[{input:[d("Email"),[' ? link("Email", "mailto:" + '],d("Email"),[').style("blue") : ""']]}]},phone_number:{name:"phone_number",type:{type:"text"},description:l.phoneNumberPropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),[' ? link("Call", "tel:" + '],p(e),[').style("blue") : ""']],isCopyable:!0}]:[{input:[d("Email"),[' ? link("Call", "tel:" + '],d("Email"),[').style("blue") : ""']]}]},number:{name:"number",type:{type:"number"},description:l.numberPropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),[" / 2"]],isCopyable:!0},{input:[["pi() * "],p(e),[" ^ 2"]],isCopyable:!0}]:[{input:[d("Cost"),[" / "],d("Total Units")]},{input:[["pi() * "],d("Radius"),[" ^ 2"]]}]},select:{name:"select",type:{type:"text"},description:l.selectPropertyDescription,examples:e=>{const t=[{input:[d("Priority"),[' == "High"']]},{input:[['["Feature", "Bug"].includes('],d("Task Type"),[")"]]}];return e&&t.unshift({input:[p(e)],isCopyable:!0}),t}},multi_select:{name:"select",type:{type:"array",of:{type:"text"}},description:l.multiSelectPropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),[".length()"]],isCopyable:!0},{input:[d("Tags"),['.includes("Finance")']]}]:[{input:[d("Tags"),[".length()"]]},{input:[d("Tags"),['.includes("Finance")']]}]},status:{name:"status",type:{type:"text"},description:l.statusPropertyDescription,examples:e=>"Status"===(null==e?void 0:e.name)?[{input:[p(e)],isCopyable:!0},{input:[p(e),[' == "Done"']],isCopyable:!0},{input:[['["Not started", "In progress"].includes('],p(e),[")"]],isCopyable:!0}]:[{input:[d("Status"),[' == "Done"']]},{input:[['["Not started", "In progress"].includes('],d("Status"),[")"]]}]},checkbox:{name:"checkbox",type:{type:"checkbox"},description:l.checkboxPropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[["not "],p(e)],isCopyable:!0},{input:[d("Signed"),[" and "],d("Sealed"),[" and "],d("Delivered")]}]:[{input:[["not"],d("Done")]},{input:[d("Signed"),[" and "],d("Sealed"),[" and "],d("Delivered")]}]},date:{name:"date",type:{type:"date"},description:l.datePropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),[" > now()"]],isCopyable:!0},{input:[p(e),['.dateAdd(1, "weeks")']],isCopyable:!0},{input:[["dateBetween("],p(e),[', now(), "days")']],isCopyable:!0}]:[{input:[d("Due Date"),[" > now()"]]},{input:[["formatDate("],d("Date"),[', "YYYY/MM/DD HH:mm")']]},{input:[["dateBetween("],d("Birthday"),[', now(), "days")']]}]},person:{name:"person",type:{type:"array",of:{type:"text"}},description:l.personPropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),[".length()"]],isCopyable:!0},{input:[p(e),[".at(0)"]],isCopyable:!0},{input:[p(e),[".map(current.email())"]],isCopyable:!0},{input:[p(e),['.some(current.name() == "Alice")']]}]:[{input:[d("Participants"),[".at(0)"]]},{input:[d("Participants"),[".length()"]]},{input:[d("Participants"),['.some(current.name() == "Alice")']]}]},relation:{name:"relation",type:{type:"array",of:{type:"block"}},description:l.relationPropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),[".length()"]],isCopyable:!0},{input:[d("Tasks"),[".filter(current."],d("Status"),[' != "Done")']]}]:[{input:[d("Tasks"),[".length()"]]},{input:[d("Tasks"),[".filter(current."],d("Status"),[' != "Done")']]}]},rollup:{name:"rollup",type:e=>{if("rollup"===(null==e?void 0:e.type)&&("show_unique"===e.aggregation||void 0===e.aggregation))return{type:"array",of:{type:"unknown"}};if(e&&"aggregation"in e&&void 0!==e.aggregation){return{type:(0,r.W6)((0,r.gu)(e.aggregation))}}return{type:"unknown"}},description:e=>"rollup"!==(null==e?void 0:e.type)||"show_unique"!==e.aggregation&&void 0!==e.aggregation?l.rollupPropertyDescription:l.rollupPropertyDescriptionList,examples:(e,t)=>{let n;return n=!t||"rollup"!==(null==t?void 0:t.type)||"show_unique"!==t.aggregation&&void 0!==t.aggregation?[{input:[d("Average cost"),[" * 12"]]},{input:[d("Sum of customers"),[" > 100"]]}]:[void 0!==e?{input:[p(e),[".length()"]],isCopyable:!0}:{input:[d("Purchases"),[".length()"]]},{input:[["sum("],d("Purchases"),[".map(current."],d("Cost"),["))"]]}],e&&n.unshift({input:[p(e)],isCopyable:!0}),n}},file:{name:"file",type:{type:"array",of:{type:"text"}},description:l.filePropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),[".length()"]],isCopyable:!0},{input:[p(e),['.filter(current.match(".pdf$"))']],isCopyable:!0},{input:[p(e),['.map(link("File", current))']],isCopyable:!0}]:[{input:[d("Attachments"),[".length()"]]},{input:[d("Attachments"),['.filter(current.match(".pdf$"))']]},{input:[d("Attachments"),['.map(link("File", current))']]}]},formula:{name:"formula",type:e=>{var t,n,o;return e&&"formula2"in e&&null!==(t=e.formula2)&&void 0!==t&&null!==(t=t.result_type)&&void 0!==t&&t.type?e.formula2.result_type:e&&"formula"in e&&null!==(n=e.formula)&&void 0!==n&&n.result_type?{type:null===(o=e.formula)||void 0===o?void 0:o.result_type}:{type:"unknown"}},description:e=>{var t;return e&&"formula2"in e&&"array"===(null===(t=e.formula2)||void 0===t||null===(t=t.result_type)||void 0===t?void 0:t.type)?l.formulaPropertyDescriptionList:l.formulaPropertyDescription},examples:(e,t)=>{var n,o;let r={type:"unknown"};if(t&&"formula2"in t&&null!==(n=t.formula2)&&void 0!==n&&null!==(n=n.result_type)&&void 0!==n&&n.type)r=t.formula2.result_type;else if(t&&"formula"in t&&null!==(o=t.formula)&&void 0!==o&&o.result_type){var i;r={type:null===(i=t.formula)||void 0===i?void 0:i.result_type}}if(!e)return[];const s=[{input:[p(e)],isCopyable:!0}];switch(r.type){case"array":switch(s.push({input:[p(e),[".length()"]],isCopyable:!0}),r.of.type){case"text":s.push({input:[p(e),['.join("\\n")']],isCopyable:!0});break;case"number":s.push({input:[p(e),[".sum()"]],isCopyable:!0});break;case"date":s.push({input:[p(e),['.map(dateBetween(now(), current, "days"))']],isCopyable:!0});break;case"person":s.push({input:[p(e),[".map(current.name())"]],isCopyable:!0}),s.push({input:[p(e),[".some(current.name() == 'Alice')"]],isCopyable:!0});break;case"checkbox":s.push({input:[p(e),[".every(current == true)"]],isCopyable:!0});break;case"block":s.push({input:[d("Primary Tasks"),[".filter(current."],d("Status"),[' == "Done")']]})}break;case"number":s.push({input:[p(e),[" * 2 > 100"]],isCopyable:!0});break;case"text":s.push({input:[p(e),[".upper()"]],isCopyable:!0});break;case"date":s.push({input:[p(e),[" > now()"]],isCopyable:!0});break;case"person":s.push({input:[p(e),[".name()"]],isCopyable:!0});break;case"checkbox":s.push({input:[["not "],p(e)],isCopyable:!0});break;case"block":s.push({input:[p(e),[".map(current."],u(a.vz.CreatedBy),[")"]]})}return s}},created_time:{name:"created_time",type:{type:"date"},description:l.createdTimePropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),['.dateAdd(1, "weeks")']],isCopyable:!0},{input:[p(e),[' > dateSubtract(now(), 1, "years")']],isCopyable:!0}]:[{input:[u(a.vz.CreatedTime),['.dateAdd(1, "weeks")']]},{input:[u(a.vz.CreatedTime),[' > dateSubtract(now(), 1, "years")']]}]},last_edited_time:{name:"last_edited_time",type:{type:"date"},description:l.lastEditedTimePropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),['.dateAdd(1, "weeks")']],isCopyable:!0},{input:[p(e),[' > dateSubtract(now(), 1, "month")']],isCopyable:!0}]:[{input:[u(a.vz.LastEditedTime),['.dateAdd(1, "weeks")']]},{input:[u(a.vz.LastEditedTime),[' > dateSubtract(now(), 1, "month")']]}]},created_by:{name:"created_by",type:{type:"person"},description:l.createdByPropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),[".name()"]],isCopyable:!0},{input:[p(e),[".email()"]],isCopyable:!0}]:[{input:[u(a.vz.CreatedBy),[".name()"]]},{input:[u(a.vz.CreatedBy),[".email()"]]}]},last_edited_by:{name:"last_edited_by",type:{type:"person"},description:l.lastEditedByPropertyDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),[".name()"]],isCopyable:!0},{input:[p(e),[".email()"]],isCopyable:!0}]:[{input:[u(a.vz.LastEditedBy),[".name()"]]},{input:[u(a.vz.LastEditedBy),[".email()"]]}]},auto_increment_id:{name:"auto_increment_id",type:{type:"number"},description:l.autoincrementIdDescription,examples:e=>e?[{input:[p(e)],isCopyable:!0},{input:[p(e),['.split("-").first() /* Prefix */']],isCopyable:!0},{input:[p(e),['.split("-").last().toNumber() /* ID */']],isCopyable:!0}]:[{input:[d("ID Code")]},{input:[d("Task ID"),['.split("-").first() /* Prefix */']],output:'"TASK"'},{input:[d("Task ID"),['.split("-").last().toNumber() /* ID */']],output:"123"}]},button:null,location:null,last_visited_time:null,verification:null};function d(e){return(0,i.YCD)((0,i.kbv)({collection:void 0,name:e,property:""}))}function u(e){return(0,i.YCD)((0,i.kbv)({collection:void 0,name:(0,s.Ve)(e),property:e}))}function p(e){return(0,i.YCD)((0,i.kbv)(e))}},877097:(e,t,n)=>{n.d(t,{Gw:()=>s,YD:()=>c,YG:()=>a,l7:()=>l,mr:()=>r,o8:()=>i});var o=n(709291);const r=(0,o.defineMessages)({InvalidCharacter:{defaultMessage:'Invalid character "{errorCharacter}".',id:"formulas.formulaParseError.invalidCharacter"},UnclosedStringLiteral:{defaultMessage:"Unclosed string literal.",id:"formulas.formulaParseError.unclosedStringLiteral"},UnclosedComment:{defaultMessage:"Unclosed comment. Comments must be closed with a */ sequence.",id:"formulas.formulaParseError.unclosedComment"},TokenExpected:{defaultMessage:'Expected token "{expectedToken}".',id:"formulas.formulaParseError.tokenExpected"},StringLiteralContainsToken:{defaultMessage:"String literal contains token.",id:"formulas.formulaParseError.stringLiteralContainsToken"},ExpressionExpected:{defaultMessage:"Expression expected.",id:"formulas.formulaParseError.expressionExpected"},PropertyExpected:{defaultMessage:"Property token or function expected.",id:"formulas.formulaParseError.propertyExpected"},EndOfInputExpected:{defaultMessage:"End of input expected.",id:"formulas.formulaParseError.endOfInputExpected"},UnexpectedError:{defaultMessage:"Unexpected error.",id:"formulas.formulaParseError.unexpectedError"}}),i=(0,o.defineMessages)({ThisRowTypeNotFound:{defaultMessage:"Cannot find this row in context.",id:"formulas.formulaTypecheckerError.thisRowTypeNotFound"},ThisRowNotBlockWithCollection:{defaultMessage:"This row is not a block with a collection.",id:"formulas.formulaTypecheckerError.thisRowNotBlockWithCollection"},MissingPropertyOnThisRow:{defaultMessage:'Cannot find property "{propertyName}" on this row.',id:"formulas.formulaTypecheckerError.missingPropertyOnThisRow"},MissingContextVariable:{defaultMessage:"Cannot find context variable {valueId}.",id:"formulas.formulaTypecheckerError.missingContextVariable"},MissingBlock:{defaultMessage:"Could not find block {blockId}.",id:"formulas.formulaTypecheckerError.missingBlock"},CallingNotFunction:{defaultMessage:"Cannot call expression of type {expressionType}.",id:"formulas.formulaTypecheckerError.callingNotFunction"},FunctionCallTooFewArguments:{defaultMessage:"Function {functionName} expects {minNumParameters} arguments, but only {numArguments} were provided.",id:"formulas.formulaTypecheckerError.functionCallTooFewArguments"},FunctionCallUnexpectedArgument:{defaultMessage:"Function {functionName} received unexpected argument.",id:"formulas.formulaTypecheckerError.functionCallUnexpectedArgument"},FunctionCallArgumentWrongType:{defaultMessage:"Argument of type {argumentType} does not satisfy function {functionName}.",id:"formulas.formulaTypecheckerError.functionCallArgumentWrongType"},MemberPropertyMismatchCollection:{defaultMessage:"Token {propertyName} does not match block's collection.",id:"formulas.formulaTypecheckerError.memberPropertyMismatchCollection"},MemberPropertyMissing:{defaultMessage:'Cannot find property "{propertyName}" on collection.',id:"formulas.formulaTypecheckerError.memberPropertyMissing"},MemberPropertyTargetNotBlock:{defaultMessage:"Cannot access property on non-block.",id:"formulas.formulaTypecheckerError.memberPropertyTargetNotBlock"},MemberPropertyTypeInvalid:{defaultMessage:"Cannot access {propertyName} due to an unsupported property type.",id:"formulas.formulaTypecheckerError.memberInvalidPropertyType"},UndefinedIdentifier:{defaultMessage:"{identifier} is not defined.",id:"formulas.formulaTypecheckerError.undefinedIdentifier"},IdentifierExpected:{defaultMessage:"Expected identifier.",id:"formulas.formulaTypecheckerError.identifierExpected"},UnifiedFunctionCannotFindFunction:{defaultMessage:"Cannot find function {functionName}.",id:"formulas.formulaTypecheckerError.unifiedFunctionCannotFindFunction"},UnifiedFunctionNoArguments:{defaultMessage:"Function {functionName} does not expect any arguments.",id:"formulas.formulaTypecheckerError.unifiedFunctionNoArguments"},UnifiedFunctionTargetWrongType:{defaultMessage:"Cannot call {functionName} with target of type {targetType}.",id:"formulas.formulaTypecheckerError.unifiedFunctionTargetWrongType"},CannotRelativelyCompareTypes:{defaultMessage:"Cannot compare {lhsType} and {rhsType}.",id:"formulas.formulaTypecheckerError.cannotRelativelyCompareTypes"},CannotDoMathOnType:{defaultMessage:"Cannot do math on {lhsType} and {rhsType}.",id:"formulas.formulaTypecheckerError.cannotDoMathOnType"},UnaryMinusOnNonNumber:{defaultMessage:"Cannot apply minus to {type}.",id:"formulas.formulaTypecheckerError.unaryMinusOnNonNumber"},CircularDependency:{defaultMessage:"Circular dependency detected; this formula references itself.",id:"formulas.formulaTypecheckerError.circularDependency"},FunctionCallExpected:{defaultMessage:"Expected function {functionName}() to be called.",id:"formulas.formulaTypecheckerError.functionCallExpected"},RenamedIdentifier:{defaultMessage:'The function "{identifier}()" was renamed to "{renamedTo}()".',id:"formulas.formulaEvaluatorError.renamedIdentifier"},RemovedFunction:{defaultMessage:'The function "{functionName}()" was removed. You can use {alternative} instead.',id:"formulas.formulaEvaluatorError.removedFunction"},ContextVariableNotBlockWithCollection:{defaultMessage:"Context variable {valueId} is not a block with a collection.",id:"formulas.formulaTypecheckerError.contextVariableNotBlockWithCollection"},MissingPropertyOnContextVariable:{defaultMessage:'Cannot find property "{propertyName}" on context variable {valueId}.',id:"formulas.formulaTypecheckerError.missingPropertyOnContextVariable"},BlockPropertyTypeInvalid:{defaultMessage:"Cannot access {propertyName} due to an unsupported property type.",id:"formulas.formulaTypecheckerError.blockPropertyTypeInvalid"}}),a=(0,o.defineMessages)({MissingThisRow:{defaultMessage:"Cannot find this row.",id:"formulas.formulaEvaluatorError.missingThisRow"},MissingSchemaPropertyOnThisRow:{defaultMessage:'Missing property "{propertyName}" on this row.',id:"formulas.formulaEvaluatorError.missingSchemaPropertyOnThisRow"},ThisRowBlockPropertyMismatchCollection:{defaultMessage:"This row property belongs to a different collection.",id:"formulas.formulaEvaluatorError.thisRowBlockPropertyMismatchCollection"},MissingContextVariable:{defaultMessage:'Missing context variable "{valueId}".',id:"formulas.formulaEvaluatorError.missingContextVariable"},IdentifierNotFound:{defaultMessage:'"{identifier}" is not defined.',id:"formulas.formulaEvaluatorError.identifierNotFound"},CannotRelativelyCompareTypes:{defaultMessage:'Cannot compare types "{lhsType}" and "{rhsType}".',id:"formulas.formulaEvaluatorError.cannotRelativelyCompareTypes"},CannotDoMathOnType:{defaultMessage:'Cannot do math on type "{valueType}".',id:"formulas.formulaEvaluatorError.cannotDoMathOnType"},CannotCallNonFunction:{defaultMessage:'Cannot call type "{calleeType}".',id:"formulas.formulaEvaluatorError.cannotCallNonFunction"},UnifiedFunctionPropertyNotFound:{defaultMessage:'Function "{functionName}" not found.',id:"formulas.formulaEvaluatorError.unifiedFunctionPropertyNotFound"},LibraryFunctionExecutionError:{defaultMessage:'Error occurred while calling "{functionName}".',id:"formulas.formulaEvaluatorError.libraryFunctionExecutionError"},FunctionCallTooFewArguments:{defaultMessage:'Called "{functionName}" with too few arguments.',id:"formulas.formulaEvaluatorError.functionCallTooFewArguments"},FunctionCallUnexpectedArgument:{defaultMessage:'Called "{functionName}" with unexpected argument.',id:"formulas.formulaEvaluatorError.functionCallUnexpectedArgument"},FunctionCallArgumentWrongType:{defaultMessage:'Called "{functionName}" with wrong argument type "{argumentType}".',id:"formulas.formulaEvaluatorError.functionCallArgumentWrongType"},AccessingPropertyOnNonBlock:{defaultMessage:"Target value is not a block.",id:"formulas.formulaEvaluatorError.accessingPropertyOnNonBlock"},AccessingUserPropertyOnNonPerson:{defaultMessage:"Target value is not a person.",id:"formulas.formulaEvaluatorError.accessingUserPropertyOnNonPerson"},MissingDataDependencyBlock:{defaultMessage:'Cannot find target block "{blockId}".',id:"formulas.formulaEvaluatorError.missingDataDependencyBlock"},MissingDataDependencyPerson:{defaultMessage:'Cannot find target person "{personId}".',id:"formulas.formulaEvaluatorError.missingDataDependencyPerson"},MemberPropertyMismatchCollection:{defaultMessage:"Cannot access property of a different collection.",id:"formulas.formulaEvaluatorError.memberPropertyMismatchCollection"},MissingPropertyOnSchemaForMemberProperty:{defaultMessage:"Cannot find property on collection.",id:"formulas.formulaEvaluatorError.missingPropertyOnSchemaForMemberProperty"},UnaryMinusOnNonNumber:{defaultMessage:"Cannot negate value of type {expressionType}.",id:"formulas.formulaEvaluatorError.unaryMinusOnNonNumber"},UnexpectedRecoveryNode:{defaultMessage:"Unexpected recovery node.",id:"formulas.formulaEvaluatorError.unexpectedRecoveryNode"},UnexpectedError:{defaultMessage:"Unexpected error.",id:"formulas.formulaEvaluatorError.unexpectedError"},DepthExceeded:{defaultMessage:"Maximum recursion depth exceeded.",id:"formulas.formulaEvaluatorError.depthExceeded"},CycleDetected:{defaultMessage:"Cycle detected in formula.",id:"formulas.formulaEvaluatorError.cycleDetected"},MaxEvaluationTimeExceeded:{defaultMessage:"Max Evaluation Time Exceeded.",id:"formulas.formulaEvaluatorError.maxEvaluationTimeExceeded"},MissingSchemaPropertyOnCollection:{defaultMessage:'Missing property "{propertyName}" on collection {collectionId}',id:"formulas.formulaEvaluatorError.missingSchemaPropertyOnCollection"},ContextVariableWrongType:{defaultMessage:"Context variable {valueId} returned a type of {propertyType} instead of {expectedType}",id:"formulas.formulaEvaluatorError.contextVariableWrongType"}}),s=(0,o.defineMessages)({true:{id:"formula2Input.builtin.true",defaultMessage:"The boolean value true."},false:{id:"formula2Input.builtin.false",defaultMessage:"The boolean value false."},and:{id:"formula2Input.builtin.and",defaultMessage:"The boolean operator and."},or:{id:"formula2Input.builtin.or",defaultMessage:"The boolean operator or."},not:{id:"formula2Input.builtin.not",defaultMessage:"Returns the opposite of a boolean value."},"+":{id:"formula2Input.builtin.plus",defaultMessage:"Adds two values together."},"-":{id:"formula2Input.builtin.subtract",defaultMessage:"Subtracts two numbers."},"*":{id:"formula2Input.builtin.mult",defaultMessage:"Multiplies two numbers."},"/":{id:"formula2Input.builtin.div",defaultMessage:"Divides two numbers."},"%":{id:"formula2Input.builtin.mod",defaultMessage:"The modulo operator, which returns the remainder of a division."},"^":{id:"formula2Input.builtin.pow",defaultMessage:"Raises a number to a power."},"==":{id:"formula2Input.builtin.eq",defaultMessage:"Checks if two values are equal."},"!=":{id:"formula2Input.builtin.neq",defaultMessage:"Checks if two values are not equal."},">":{id:"formula2Input.builtin.gt",defaultMessage:"Checks if the first value is greater than the second."},"<":{id:"formula2Input.builtin.lt",defaultMessage:"Checks if the first value is less than the second."},">=":{id:"formula2Input.builtin.ge",defaultMessage:"Checks if the first value is greater than or equal to the second."},"<=":{id:"formula2Input.builtin.le",defaultMessage:"Checks if the first value is less than or equal to the second."}}),l=(0,o.defineMessages)({text:{id:"formula2Input.type.text",defaultMessage:"Text"},number:{id:"formula2Input.type.number",defaultMessage:"Number"},checkbox:{id:"formula2Input.type.checkbox",defaultMessage:"Checkbox"},date:{id:"formula2Input.type.date",defaultMessage:"Date"},block:{id:"formula2Input.type.block",defaultMessage:"Block"},unknown:{id:"formula2Input.type.undefined",defaultMessage:"Unknown"},person:{id:"formula2Input.type.person",defaultMessage:"Person"},array:{id:"formula2Input.type.array",defaultMessage:"List of unknown"},function:{id:"formula2Input.type.function",defaultMessage:"Function"},select:{id:"formula2Input.type.select",defaultMessage:"Select"}}),c=(0,o.defineMessages)({text:{id:"formula2Input.type.plural.text",defaultMessage:"List of text"},number:{id:"formula2Input.type.plural.number",defaultMessage:"List of numbers"},checkbox:{id:"formula2Input.type.plural.checkbox",defaultMessage:"List of checkboxes"},date:{id:"formula2Input.type.plural.date",defaultMessage:"List of dates"},block:{id:"formula2Input.type.plural.block",defaultMessage:"List of blocks"},unknown:{id:"formula2Input.type.plural.undefined",defaultMessage:"List"},person:{id:"formula2Input.type.plural.person",defaultMessage:"List of people"},function:{id:"formula2Input.type.plural.function",defaultMessage:"List of functions"},select:{id:"formula2Input.type.plural.select",defaultMessage:"List of selects"},array:{id:"formula2Input.type.plural.array",defaultMessage:"List of lists"}})},446725:(e,t,n)=>{n.r(t),n.d(t,{addTypesToFormulaAST:()=>We,addTypesToFormulaASTAsync:()=>Ge,analyzeFormula:()=>at,analyzeFormulaSync:()=>st,convertCollectionFormulaToFormula2:()=>Ke,convertFormulaCSTToAST:()=>Me,createFormulaDataRequestHandler:()=>O.yf,createFormulaDataRequestSyncHandler:()=>O.lc,evaluateFormulaASTAsync:()=>Ze,executeFormulaAsync:()=>it,executeFormulaSync:()=>rt,formulaResultAndOldFormulaValueEqual:()=>O.hV,getFormula2Dependencies:()=>lt,getFormulaEditorInfoAtPosition:()=>nt,getMessageForFormulaEvaluatorError:()=>ze.OY,getMessageForFormulaTypecheckError:()=>ze.ic,getNodeOfInterestForFormulaTypecheckError:()=>ze.sB,isUniqueFormulaEvaluatorError:()=>O.hp,parseFormulaInputToAst:()=>Re,parseFormulaInputToCst:()=>Pe,processFormulaInput:()=>k.dJ});var o=n(940470),r=(n(757658),n(657347)),i=n(653965),a=n(937850),s=n(401898),l=n(266897),c=n(990559),d=n(435011),u=n(180951),p=n(334299),m=n(560246),g=n(756373),f=n(600606),h=n(421202),v=n(606287),y=n(519889),b=n(421838),_=n(173110),S=n(513730),k=n(150610),w=(n(21703),n(252262),n(324506),n(730120)),x=n(709291),I=n(307032),C=n(619584),T=n(640506),M=n(253877),P=n(484795),A=n(464340),R=n(842875),D=n(676725),B=n(399319),E=n(369282),F=n.n(E),Z=n(531701),U=n(882883);var V=n(321768),N=n(672158),O=n(335102);function L(e,t,n){return{name:e,eval:function*(e,t){return{type:"number",value:n}},returnType:{type:"number"},iconType:{type:"number"},examples:[[{input:`${e}()`,output:n.toString()}]],syntax:[`${e}()`],description:t}}function j(e,t,n,o){const r=o.map((t=>({input:`${e}(${t})`,output:`${n(t)}`}))),i=o.map((t=>({input:`${t}.${e}()`,output:`${n(t)}`})));return{name:e,eval:function*(e,t){const[o]=e;return F()("number"===o.type),{type:"number",value:n(o.value)}},parameters:{expected:[{name:"input",type:{type:"number"}}]},returnType:{type:"number"},iconType:{type:"number"},examples:[r,i],syntax:[`${e}(number)`,`number.${e}()`],description:t}}function K(e,t,n,o){return{name:e,eval:function*(t,o){let[r,a]=t;if(_.zq.includes(e)){if("undefined"===r.type&&"undefined"===a.type)return{type:"number",value:0};"undefined"===r.type&&"number"===a.type?r={type:"number",value:0}:"undefined"===a.type&&"number"===r.type&&(a={type:"number",value:0})}return F()("number"===r.type&&"number"===a.type),{type:"number",value:(0,i.NM)(n(r.value,a.value),12)}},parameters:{expected:[{name:"lhs",type:{type:"number"}},{name:"rhs",type:{type:"number"}}]},returnType:{type:"number"},iconType:{type:"number"},examples:[[{input:`${e}(5, 10)`,output:`${n(5,10)}`},{input:`5 ${o} 10`,output:`${n(5,10)}`}],[{input:`5.${e}(10)`,output:`${n(5,10)}`},{input:`5 ${o} 10`,output:`${n(5,10)}`}]],syntax:[`${e}(number, number)`,`number.${e}(number)`],description:t}}const z=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"];function*q(e,t){let n=yield*(0,O.PX)(e,t);if("s"!==n.at(-1)&&(n+="s"),!z.includes(n.toLowerCase()))throw new N.Mu({type:N.sj.DateInvalidDurationUnit,invalidUnit:n});return n}function H(e){return function*(t,n){const[o,r,i]=t;F()("date"===o.type&&"number"===r.type&&"text"===i.type);const a=(0,M.NK)(o.value,n.userTimeZone),s=yield*q(i.value,n),l=e(a.start,r.value,s),c="hours"===s||"minutes"===s||"seconds"===s||"milliseconds"===s;return{type:"date",value:"date"!==o.value.type&&"daterange"!==o.value.type||c?(0,M.CQ)(l,n.userTimeZone):(0,M.hT)(l,n.userTimeZone)}}}function G(e){return function*(t,n){const[o]=t;return F()("date"===o.type),{type:"number",value:e((0,M.NK)((0,T.Ws)(o.value),n.userTimeZone,n.intl.locale).start)}}}function*W(e,t){try{return yield*Fe(e,t)}catch(n){if("info"in n&&"type"in n.info&&n.info.type===N.FY.DepthExceeded)throw n;return{type:"undefined"}}}function $(e,t,n){return(0,S.LD)(e.map(((e,o)=>W(t,{...n,values:[{kind:_.yp.Binding,id:_.GV,value:e},{kind:_.yp.Binding,id:_.WY,value:{type:"number",value:o}},...n.values]}))))}const Y={b:["b"],i:["i"],s:["s"],u:["_"],c:["c"]},Q=["b","i","s","_","c","h"];function J(e){const t=[];return e.forEach((e=>{var n;const o=null==e||null===(n=e[0])||void 0===n?void 0:n[0].toLowerCase().split(",");for(const r of o){const e=X(r);if(e)t.push(e);else{const e=Y[r];e&&t.push(e)}}})),t}function X(e){const t=Z.E_.find((t=>t===e));return t?[b.GKr.Highlight,t]:"green"===e?[b.GKr.Highlight,"teal"]:"green_background"===e?[b.GKr.Highlight,"teal_background"]:"grey"===e?[b.GKr.Highlight,"gray"]:"grey_background"===e?[b.GKr.Highlight,"gray_background"]:void 0}const ee=["number","date","checkbox","undefined"];function te(e){let t;return e.every((e=>"undefined"===e.type||(void 0===t?!!ee.includes(e.type)&&(t=e.type,!0):t===e.type)))}function ne(e){const{left:t,right:n,context:o}=e;return"date"===t.type&&"date"===n.type?(0,O.SU)(t.value,n.value,o.userTimeZone):"number"===t.type&&"number"===n.type?t.value-n.value:"checkbox"===t.type&&"checkbox"===n.type?t.value===n.value?0:t.value?1:-1:"undefined"===t.type?"undefined"===n.type?0:1:"undefined"===n.type?-1:0}function oe(e){const t=[];for(const n of e)if("array"===n.type){const e=oe(n.values);t.push(...e)}else"number"===n.type&&t.push(n.value);return t}function*re(e,t,n,o,r){const i=yield*ie(e,r,{disableAnnotationPrefix:!1}),a=yield*ie(n,r),s=Math.min(Math.floor(t),1e4),l=(0,b.VrM)(i);if(l>=t)return{type:"text",value:e};const c=(0,b.VrM)(a),d=s-l,u=c>0?Math.floor(d/c):0,p=d%c,m=[];"end"===o&&m.push(...e);for(let g=0;g<u;g++)m.push(...a);return p>0&&m.push(...(0,b.xrQ)(a,0,p).tokensInsideRange),"start"===o&&m.push(...e),{type:"text",value:(0,b.Zxt)(m)}}function*ie(e,t,n){const o=(0,u.sJ)(e);return function(e){const{textValue:t,getRecordModel:n,userTimeZone:o,intl:r,seenBlocks:i=new Set,deterministic:a=!1,disableAnnotationPrefix:s=!1,disableInsertedAnnotations:l=!1,renderDateAnnotationsAsISO:c=!1,externalIntegrations:d}=e,u=[],p=s?"":"@",m=b.lzi(t);for(const g of m){const e=b.hDy(g);if(!e.length){u.push(g);continue}const s=(0,U.Ln)({token:g,getRecordModel:n,userTimeZone:o,deterministic:a,intl:r,seenBlocks:i,prefix:p,disableInsertedAnnotations:l,renderDateAnnotationsAsISO:c,externalIntegrations:d}),m=(0,U.qb)(e,l);(null!=t&&t.length||m.length)&&u.push((0,b.V3y)(s??"",m))}return u}({textValue:e,getRecordModel:o.length?(yield{recordPointers:o}).getRecordModel:V.o.constant(void 0),userTimeZone:t.userTimeZone,deterministic:!0,intl:t.intl,disableAnnotationPrefix:!0,...n})}var ae=n(889679),se=n(877097);function le(e){if(!e)throw new Error("Assertion failed in formulaLibraryFunctions")}const ce=(0,x.defineMessages)({if:{id:"database.formula2.operator.if.description",defaultMessage:"Returns the first value if the condition is true; otherwise, returns the second value."},ifs:{id:"database.formula2.operator.ifs.description",defaultMessage:"Returns the value that corresponds to the first true condition. This can be used as an alternative to multiple nested if() statements."},e:{id:"database.formula2.constant.e.description",defaultMessage:"Returns the base of the natural logarithm."},pi:{id:"database.formula2.constant.pi.description",defaultMessage:"Returns the ratio of a circle's circumference to its diameter."},add:{id:"database.formula2.operator.add.description",defaultMessage:"Returns the sum of two numbers."},at:{id:"database.formula2.operator.at.description",defaultMessage:"Returns the value at the specified index in a list."},every:{id:"database.formula2.operator.every.description",defaultMessage:"Returns true if every item in the list satisfies the given condition, and false otherwise."},filter:{id:"database.formula2.operator.filter.description",defaultMessage:"Returns the values in the list for which the condition is true."},find:{id:"database.formula2.operator.find.description",defaultMessage:"Returns the first element in the list for which the condition returns true."},first:{id:"database.formula2.operator.first.description",defaultMessage:"Returns the first item in the list."},flat:{id:"database.formula2.operator.flat.description",defaultMessage:"Flattens a list of lists into a single list."},includes:{id:"database.formula2.operator.includes.description",defaultMessage:"Returns true if the list contains the specified value, and false otherwise."},last:{id:"database.formula2.operator.last.description",defaultMessage:"Returns the last item in the list."},map:{id:"database.formula2.operator.map.description",defaultMessage:"Returns the list populated with the results of calling the expression on every item in the input list."},reverse:{id:"database.formula2.operator.reverse.description",defaultMessage:"Returns the reversed list."},slice:{id:"database.formula2.operator.slice.description",defaultMessage:"Returns the items of the list from the provided start index (inclusive) to the end index (optional and exclusive)."},findIndex:{id:"database.formula2.operator.findIndex.description",defaultMessage:"Returns the index of the first item in the list for which the condition evaluates to true."},unique:{id:"database.formula2.operator.unique.description",defaultMessage:"Returns the list of unique values in the input list."},toPlainText:{id:"database.formula2.operator.toPlainText.description",defaultMessage:"Returns the plain text representation of the input text."},toText:{id:"database.formula2.operator.toText.description",defaultMessage:"Returns the text representation of the input value."},sort:{id:"database.formula2.operator.sort.description",defaultMessage:"Returns the list in sorted order. Optionally, a provided expression can be used to determine the sorting order."},some:{id:"database.formula2.operator.some.description",defaultMessage:"Returns true if any item in the list satisfies the given condition, and false otherwise."},let:{id:"database.formula2.operator.let.description",defaultMessage:"Assigns a value to a variable and evaluates the expression using that variable."},lets:{id:"database.formula2.operator.lets.description",defaultMessage:"Assigns values to multiple variables and evaluates the expression using those variables."},sum:{id:"database.formula2.operator.sum.description",defaultMessage:"Returns the sum of its arguments."},subtract:{id:"database.formula2.operator.subtract.description",defaultMessage:"Returns the difference of two numbers."},multiply:{id:"database.formula2.operator.multiply.description",defaultMessage:"Returns the product of two numbers."},divide:{id:"database.formula2.operator.divide.description",defaultMessage:"Returns the quotient of two numbers."},pow:{id:"database.formula2.operator.pow.description",defaultMessage:"Returns the result of a base number raised to an exponent power."},mod:{id:"database.formula2.operator.mod.description",defaultMessage:"Returns the first number modulo the second number."},equal:{id:"database.formula2.operator.equal.description",defaultMessage:"Returns true if both values are equal and false otherwise."},unequal:{id:"database.formula2.operator.unequal.description",defaultMessage:"Returns false if both values are equal and true otherwise."},concat:{id:"database.formula2.function.concat.description",defaultMessage:"Returns the concatenation of multiple lists."},join:{id:"database.formula2.function.join.description",defaultMessage:"Returns the values of the list with the joiner placed between each of the values."},split:{id:"database.formula2.function.split.description",defaultMessage:"Returns the list of values created by splitting a text by a separator."},substring:{id:"database.formula2.function.slice.description",defaultMessage:"Returns the substring of the text from the start index (inclusive) to the end index (optional and exclusive)."},length:{id:"database.formula2.function.length.description",defaultMessage:"Returns the length of the text or list value."},format:{id:"database.formula2.function.format.description",defaultMessage:"Returns the value formatted as text."},style:{id:"database.formula2.function.style.description",defaultMessage:'Adds styles and colors to the text. Valid formatting styles: "b" (bold), "u" (underline), "i" (italics), "c" (code), or "s" (strikethrough). Valid colors: "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", and "red". Add "_background" to colors to set background colors.'},unstyle:{id:"database.formula2.function.unstyle.description",defaultMessage:"Removes formatting styles from the text. If no styles are specified, all styles are removed."},link:{id:"database.formula2.function.link.description",defaultMessage:"Creates a hyperlink from the label text and the URL."},toNumber:{id:"database.formula2.function.toNumber.description",defaultMessage:"Parses a number from text."},contains:{id:"database.formula2.function.contains.description",defaultMessage:"Returns true if the search string is present in the value."},replace:{id:"database.formula2.function.replace.description",defaultMessage:"Replaces the first match of the regular expression with the replacement value."},replaceAll:{id:"database.formula2.function.replaceAll.description",defaultMessage:"Replaces all matches of the regular expression with the replacement value."},test:{id:"database.formula2.function.test.description",defaultMessage:"Returns true if the value matches the regular expression and false otherwise."},match:{id:"database.formula2.function.match.description",defaultMessage:"Returns all matches of the regular expression as a list."},empty:{id:"database.formula2.function.empty.description",defaultMessage:"Returns true if the value is empty. 0, “”, false, and [] are considered empty."},abs:{id:"database.formula2.function.abs.description",defaultMessage:"Returns the absolute value of the number."},cbrt:{id:"database.formula2.function.cbrt.description",defaultMessage:"Returns the cube root of the number."},ceil:{id:"database.formula2.function.ceil.description",defaultMessage:"Returns the smallest integer greater than or equal to the number."},exp:{id:"database.formula2.function.exp.description",defaultMessage:"Returns e^x, where x is the argument, and e is Euler's number (2.718…), the base of the natural logarithm."},floor:{id:"database.formula2.function.floor.description",defaultMessage:"Returns the largest integer less than or equal to the number."},ln:{id:"database.formula2.function.ln.description",defaultMessage:"Returns the natural logarithm of the number."},log10:{id:"database.formula2.function.log10.description",defaultMessage:"Returns the base 10 logarithm of the number."},log2:{id:"database.formula2.function.log2.description",defaultMessage:"Returns the base 2 logarithm of the number."},max:{id:"database.formula2.function.max.description",defaultMessage:"Returns the largest number of the arguments."},min:{id:"database.formula2.function.min.description",defaultMessage:"Returns the smallest number of the arguments."},mean:{id:"database.formula2.function.mean.description",defaultMessage:"Returns the arithmetic average of its arguments."},median:{id:"database.formula2.function.median.description",defaultMessage:"Returns the middle value of its arguments."},mode:{id:"database.formula2.function.mode.description",defaultMessage:"Returns the most commonly occurring value of its arguments."},round:{id:"database.formula2.function.round.description",defaultMessage:"Returns the value of a number rounded to the nearest integer."},sign:{id:"database.formula2.function.sign.description",defaultMessage:"Returns 1 if the number is positive, -1 if it is negative, and 0 if it is zero."},sqrt:{id:"database.formula2.function.sqrt.description",defaultMessage:"Returns the positive square root of the number."},start:{id:"database.formula2.function.start.description",defaultMessage:"Returns the start of the date range."},end:{id:"database.formula2.function.end.description",defaultMessage:"Returns the end of the date range."},now:{id:"database.formula2.function.now.description",defaultMessage:"Returns the current date and time."},today:{id:"database.formula2.function.today.description",defaultMessage:"Returns the current date without the time."},timestamp:{id:"database.formula2.function.timestamp.description",defaultMessage:"Returns the current Unix timestamp, representing the number of milliseconds that have elapsed since January 1, 1970."},fromTimestamp:{id:"database.formula2.function.fromTimestamp.description",defaultMessage:"Returns the date from the given Unix timestamp. The timestamp represents the number of milliseconds that have elapsed since January 1, 1970. Note: the returned date will not retain the seconds & milliseconds."},dateAdd:{id:"database.formula2.function.dateAdd.description",defaultMessage:'Adds time to the date. The unit argument can be one of: "years", "quarters", "months", "weeks", "days", "hours", or "minutes".'},dateSubtract:{id:"database.formula2.function.dateSubtract.description",defaultMessage:'Subtracts time from the date. The unit argument can be one of: "years", "quarters", "months", "weeks", "days", "hours", or "minutes".'},dateBetween:{id:"database.formula2.function.dateBetween.description",defaultMessage:'Returns the difference between two dates. The unit argument can be one of: "years", "quarters", "months", "weeks", "days", "hours", or "minutes".'},formatDate:{id:"database.formula2.function.formatDate.description",defaultMessage:'Formats the date using a custom format string and optional timezone. The format string can contain the following text to represent parts of the date: "YYYY" for year, "MM" for month, "DD" for day, "HH" for hour, "mm" for minute.'},date:{id:"database.formula2.function.date.description",defaultMessage:"Returns the day of the month from the date (1-31)."},day:{id:"database.formula2.function.day.description",defaultMessage:"Returns the day of the week of the date, between 1 (Monday) and 7 (Sunday)."},month:{id:"database.formula2.function.month.description",defaultMessage:"Returns the month of the date (1-12)."},week:{id:"database.formula2.function.week.description",defaultMessage:"Returns the ISO week of the year of the date (1-53)."},year:{id:"database.formula2.function.year.description",defaultMessage:"Returns the year of the date."},hour:{id:"database.formula2.function.hour.description",defaultMessage:"Returns the hour of the date (0-23)."},minute:{id:"database.formula2.function.minute.description",defaultMessage:"Returns the minute of the date (0-59)."},parseDate:{id:"database.formula2.function.parseDate.description",defaultMessage:"Returns the date parsed according to the ISO 8601 standard."},dateRange:{id:"database.formula2.function.dateRange.description",defaultMessage:"Returns a date range constructed from the start and end dates."},dateStart:{id:"database.formula2.function.dateStart.description",defaultMessage:"Returns the start of the date range."},dateEnd:{id:"database.formula2.function.dateEnd.description",defaultMessage:"Returns the end of the date range."},id:{id:"database.formula2.function.id.description",defaultMessage:"Returns the id of the page or person. If no page or person is provided, returns the id of the page the formula is on."},name:{id:"database.formula2.function.name.description",defaultMessage:"Returns the name of a person."},email:{id:"database.formula2.function.email.description",defaultMessage:"Returns the email address of a person."},lower:{id:"database.formula2.function.lower.description",defaultMessage:"Converts the text to lowercase."},upper:{id:"database.formula2.function.upper.description",defaultMessage:"Converts the text to uppercase."},repeat:{id:"database.formula2.function.repeat.description",defaultMessage:"Repeats the text a given number of times."},padStart:{id:"database.formula2.function.padStart.description",defaultMessage:"Returns the text padded with the provided padding string at the start until the target length is reached."},padEnd:{id:"database.formula2.function.padEnd.description",defaultMessage:"Returns the text padded with the provided padding string at the end until the target length is reached."},_wait:{id:"database.formula2.function.wait.description",defaultMessage:"Wait a specified duration before returning a value."}}),de={type:"undefined"},ue={name:"expression",type:{type:"expression"},augmentScope:e=>{var t;const n="array"===(null===(t=e[0])||void 0===t?void 0:t.type)?e[0].of:{type:"unknown"};return{[_.GV]:n,[_.WY]:{type:"number"}}}},pe={expected:[{name:"list",type:{type:"array",of:{type:"unknown"}}},ue]},me={expected:[{name:"list",type:{type:"array",of:{type:"unknown"}}},{...ue,optional:!0}]},ge={if:{name:"if",eval:function*(e,t){const[n,o,r]=e;return le("checkbox"===n.type),n.value?yield*Fe(o,t):yield*Fe(r,t)},parameters:{expected:[{name:"condition",type:{type:"checkbox"}},{name:"ifTrue",type:{type:"expression"}},{name:"ifFalse",type:{type:"expression"}}]},returnType:e=>{let[t,n,o]=e;return void 0!==n&&void 0!==o&&(0,B.Jy)(n,o)?n:{type:"unknown"}},iconType:{type:"checkbox"},examples:[[{input:"if(true, 1, 2)",output:"1"},{input:"if(false, 1, 2)",output:"2"},{input:[(0,ae.h0)("Checked"),[' == true ? "Complete" : "Incomplete"']]}],[{input:"true.if(1, 2)",output:"1"},{input:"false.if(1, 2)",output:"2"}]],syntax:["if(condition, ifTrue, ifFalse)","condition.if(ifTrue, ifFalse)"],description:ce.if},ifs:{name:"ifs",parameters:{expected:[{name:"condition",type:{type:"checkbox"}},{name:"ifTrue",type:{type:"expression"}}],varargs:[{name:"rest",type:{type:"expression"}}]},returnType:e=>{if(e.length<2)return{type:"unknown"};const t=e[1];let n=2;for(;n<e.length-1;n+=2)if(!(0,B.Jy)(e[n+1],t))return{type:"unknown"};if(n===e.length-1){const o=e[n];if(!(0,B.Jy)(o,t))return{type:"unknown"}}return t},eval:function*(e,t){const n=e[0];if(le("checkbox"===n.type),n.value)return yield*Fe(e[1],t);for(let o=2;o<e.length-1;o+=2){const n=e[o];if((0,O.vh)(yield*Fe(n,t)))return yield*Fe(e[o+1],t)}return e.length%2==1?yield*Fe(e[e.length-1],t):de},iconType:{type:"checkbox"},examples:[[{input:"ifs(true, 1, true, 2, 3)",output:"1"},{input:"ifs(false, 1, false, 2, 3)",output:"3"}],[{input:"true.ifs(1, true, 2, 3)",output:"1"},{input:"false.ifs(1, false, 2, 3)",output:"3"}]],syntax:["ifs(condition, ifTrue, condition2, ifTrue2, ..., else)","condition.ifs(ifTrue, condition2, ifTrue2, ..., else)"],description:ce.ifs},and:{name:"and",eval:function*(e,t){return{type:"checkbox",value:e.every((e=>(0,O.vh)(e)))}},parameters:{varargs:[{name:"value",type:[{type:"unknown"}]}]},returnType:{type:"checkbox"},iconType:{type:"checkbox"},examples:[[{input:"and(true, true, true)",output:"true"},{input:"and(3 > 2, 2 < 3)",output:"false"}],[{input:"true.and(true, true)",output:"true"},{input:"(3 > 2).and(2 < 3)",output:"false"}]],syntax:["and(boolean, boolean, ...)","boolean.and(boolean, ...)"],description:se.Gw.and},or:{name:"or",eval:function*(e,t){return{type:"checkbox",value:e.some((e=>(0,O.vh)(e)))}},parameters:{varargs:[{name:"value",type:[{type:"unknown"}]}]},returnType:{type:"checkbox"},iconType:{type:"checkbox"},examples:[[{input:"or(true, false, false)",output:"true"},{input:"or(3 > 2, 2 < 3)",output:"true"}],[{input:"true.or(false, false)",output:"true"},{input:"(3 > 2).or(2 < 3)",output:"true"}]],syntax:["or(boolean, boolean, ...)","boolean.or(boolean, ...)"],description:se.Gw.or},not:{name:"not",eval:function*(e,t){const[n]=e;return{type:"checkbox",value:!(0,O.vh)(n)}},parameters:{varargs:[{name:"value",type:[{type:"unknown"}]}]},returnType:{type:"checkbox"},iconType:{type:"checkbox"},examples:[[{input:"not(true)",output:"false"},{input:"not(2 > 3)",output:"true"}],[{input:"true.not()",output:"false"},{input:"(2 > 3).not()",output:"true"}]],syntax:["not(boolean)","boolean.not()"],description:se.Gw.not},empty:{name:"empty",eval:function*(e,t){const[n]=e;return{type:"checkbox",value:"array"===n.type?0===n.values.length:!(0,O.vh)(n)}},parameters:{expected:[{name:"input",type:{type:"unknown"}}]},returnType:{type:"checkbox"},iconType:{type:"checkbox"},examples:[[{input:"empty(0)",output:"true"},{input:"empty([])",output:"true"}],[{input:"0.empty()",output:"true"},{input:"[].empty()",output:"true"}]],syntax:["empty(value)","value.empty()"],description:ce.empty},length:{name:"length",eval:function*(e,t){const[n]=e;return"array"===n.type?{type:"number",value:n.values.length}:(le("text"===n.type),{type:"number",value:n.value.reduce(((e,t)=>e+(0,b.J1x)(t)),0)})},parameters:{expected:[{name:"input",type:[{type:"text"},{type:"array",of:{type:"unknown"}}]}]},returnType:{type:"number"},iconType:{type:"text"},examples:[[{input:'length("hello")',output:"5"},{input:"length([1, 2, 3])",output:"3"}],[{input:'"hello".length()',output:"5"},{input:"[1, 2, 3].length()",output:"3"}]],syntax:["length(value)","value.length()"],description:ce.length},substring:{name:"substring",eval:function*(e,t){const[n,o,r]=e;le("text"===n.type&&"number"===o.type);return{type:"text",value:[[(yield*(0,O.PX)(n.value,t)).slice(o.value,"number"===(null==r?void 0:r.type)?r.value:void 0)]]}},parameters:{expected:[{name:"target",type:{type:"text"}},{name:"startIndex",type:{type:"number"}},{name:"endIndex",optional:!0,type:{type:"number"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:'substring("Notion", 0, 3)',output:'"Not"'},{input:'substring("Notion", 3)',output:'"ion"'}],[{input:'"Notion".substring(0, 3)',output:'"Not"'},{input:'"Notion".substring(3)',output:'"ion"'}]],syntax:["substring(text, startIndex, endIndex?)","text.substring(startIndex, endIndex?)"],description:ce.substring},contains:{name:"contains",eval:function*(e,t){const[n,o]=e;le("text"===n.type&&"text"===o.type);const[r,i]=yield*(0,O.zA)([n.value,o.value],t);return{type:"checkbox",value:r.includes(i)}},parameters:{expected:[{name:"input",type:{type:"text"}},{name:"search",type:{type:"text"}}]},returnType:{type:"checkbox"},iconType:{type:"text"},examples:[[{input:'contains("Notion", "ot")',output:"true"}],[{input:'"Notion".contains("ot")',output:"true"}]],syntax:["contains(value, search)","value.contains(search)"],description:ce.contains},test:{name:"test",eval:function*(e,t){const[n,o]=e;le("text"===n.type&&"text"===o.type);const[r,i]=yield*(0,O.zA)([o.value,n.value],t);return{type:"checkbox",value:new RegExp(r).test(i)}},parameters:{expected:[{name:"input",type:{type:"text"}},{name:"pattern",type:{type:"text"}}]},returnType:{type:"checkbox"},iconType:{type:"checkbox"},examples:[[{input:'test("Notion", "Not")',output:"true"},{input:'test("Notion", "\\d")',output:"false"}],[{input:'"Notion.test("Not")',output:"true"},{input:'"Notion".test("\\d")',output:"false"}]],syntax:["test(text, pattern)","text.test(pattern)"],description:ce.test},match:{name:"match",eval:function*(e,t){const[n,o]=e;le("text"===n.type&&"text"===o.type);const[r,i]=yield*(0,O.zA)([n.value,o.value],t),a=r.match(new RegExp(i,"g"));return a?{type:"array",values:a.map((e=>({type:"text",value:(0,b.TPx)(e)})))}:{type:"array",values:[]}},parameters:{expected:[{name:"input",type:{type:"text"}},{name:"pattern",type:{type:"text"}}]},returnType:{type:"array",of:{type:"text"}},iconType:{type:"text"},examples:[[{input:'match("Notion Notion", "Not")',output:'["Not", "Not"]'},{input:'match("Notion 123 Notion 456", "\\d+")',output:'["123", "456"]'}],[{input:'"Notion Notion".match("Not")',output:'["Not", "Not"]'},{input:'"Notion 123 Notion 456".match("\\d+")',output:'["123", "456"]'}]],syntax:["match(text, pattern)","text.match(pattern)"],description:ce.match},replace:{name:"replace",eval:function*(e,t){const[n,o,r]=e;le("text"===n.type&&"text"===o.type);const[i,a,s]=yield*(0,O.zA)([n.value,o.value,"text"===(null==r?void 0:r.type)?r.value:void 0],t);return{type:"text",value:(0,b.TPx)(i.replace(new RegExp(a),s))}},parameters:{expected:[{name:"input",type:{type:"text"}},{name:"pattern",type:{type:"text"}},{name:"replacement",optional:!0,type:{type:"text"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:'replace("Notion Notion", "N", "M")',output:'"Motion Notion"'}],[{input:'"Notion Notion".replace("N", "M")',output:'"Motion Notion"'}]],syntax:["replace(text, pattern, replacement?)","text.replace(pattern, replacement?)"],description:ce.replace},replaceAll:{name:"replaceAll",eval:function*(e,t){const[n,o,r]=e;le("text"===n.type&&"text"===o.type);const[i,a,s]=yield*(0,O.zA)([n.value,o.value,"text"===(null==r?void 0:r.type)?r.value:void 0],t);return{type:"text",value:(0,b.TPx)(i.replace(new RegExp(a,"g"),s))}},parameters:{expected:[{name:"input",type:{type:"text"}},{name:"pattern",type:{type:"text"}},{name:"replacement",optional:!0,type:{type:"text"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:'replaceAll("Notion Notion", "N", "M")',output:'"Motion Motion"'},{input:'replaceAll("Notion 123", "\\d", "")',output:'"Notion"'}],[{input:'"Notion Notion".replaceAll("N", "M")',output:'"Motion Motion"'},{input:'"Notion 123".replaceAll("\\d", "")',output:'"Notion"'}]],syntax:["replaceAll(text, pattern, replacement?)","text.replaceAll(pattern, replacement?)"],description:ce.replaceAll},lower:{name:"lower",eval:function*(e){const[t]=e;le("text"===t.type);return{type:"text",value:t.value.map((e=>{const t=(0,b.hDy)(e),n=(0,b.WiV)(e);return(0,b.V3y)(n.toLowerCase(),t)}))}},parameters:{expected:[{name:"text",type:{type:"text"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:'lower("NOTION")',output:'"notion"'}],[{input:'"NOTION".lower()',output:'"notion"'}]],syntax:["lower(text)","text.lower()"],description:ce.lower},upper:{name:"upper",eval:function*(e){const[t]=e;le("text"===t.type);return{type:"text",value:t.value.map((e=>{const t=(0,b.hDy)(e),n=(0,b.WiV)(e);return(0,b.V3y)(n.toUpperCase(),t)}))}},parameters:{expected:[{name:"text",type:{type:"text"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:'upper("notion")',output:'"NOTION"'}],[{input:'"notion".upper()',output:'"NOTION"'}]],syntax:["upper(text)","text.upper()"],description:ce.upper},repeat:{name:"repeat",eval:function*(e){const[t,n]=e;le("text"===t.type),le("number"===n.type);const o=[],r=Math.min(n.value,1e4);for(let i=0;i<r;i++)o.push(...t.value);return{type:"text",value:o}},parameters:{expected:[{name:"text",type:{type:"text"}},{name:"count",type:{type:"number"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:'repeat("0", 4)',output:'"0000"'},{input:'repeat("~=", 10).style("blue")',output:[['"'],["~=~=~=~=~=~=~=~=~=~=",[["h","blue"]]],['"']]}],[{input:'"0".repeat(4)',output:'"0000"'},{input:'"~=".repeat(10).style("blue")',output:[['"'],["~=~=~=~=~=~=~=~=~=~=",[["h","blue"]]],['"']]}]],syntax:["repeat(text, count)","text.repeat(count)"],description:ce.repeat},padStart:{name:"padStart",eval:function*(e,t){const[n,o,r]=e;return le("text"===n.type&&"number"===o.type&&"text"===r.type),yield*re(n.value,o.value,r.value,"start",t)},parameters:{expected:[{name:"text",type:{type:"text"}},{name:"targetLength",type:{type:"number"}},{name:"padString",type:{type:"text"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:'padStart("A", 3, ".")',output:'"..A"'},{input:"padStart(123, 5, 0)",output:'"00123"'}],[{input:'"A".padStart(3, ".")',output:'"..A"'},{input:"123.padStart(5, 0)",output:'"00123"'}]],syntax:["padStart(text, targetLength, padString)","text.padStart(targetLength, padString)"],description:ce.padStart},padEnd:{name:"padEnd",eval:function*(e,t){const[n,o,r]=e;return le("text"===n.type&&"number"===o.type&&"text"===(null==r?void 0:r.type)),yield*re(n.value,o.value,r.value,"end",t)},parameters:{expected:[{name:"text",type:{type:"text"}},{name:"targetLength",type:{type:"number"}},{name:"padString",type:{type:"text"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:'padEnd("A", 3, ".")',output:'"A.."'},{input:"padEnd(123, 5, 0)",output:'"12300"'}],[{input:'"A".padEnd(3, ".")',output:'"A.."'},{input:"123.padEnd(5, 0)",output:'"12300"'}]],syntax:["padEnd(text, targetLength, padString)","text.padEnd(targetLength, padString)"],description:ce.padEnd},link:{name:"link",eval:function*(e){const[t,n]=e;return le("text"===t.type),le("text"===n.type),{type:"text",value:(0,b.C9B)(t.value,(0,b.Jcv)(n.value))}},parameters:{expected:[{name:"input",type:{type:"text"}},{name:"url",type:{type:"text"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:'link("Notion", "https://notion.so")',output:[['"'],["Notion",[(0,b.edl)("https://notion.so")]],['"']]}],[{input:'"Notion".link("https://notion.so")',output:[['"'],["Notion",[(0,b.edl)("https://notion.so")]],['"']]}]],syntax:["link(text, url)","text.link(url)"],description:ce.link},style:{name:"style",eval:function*(e){const[t,...n]=e;le("text"===t.type),n.forEach((e=>le("text"===e.type)));const o=n.length>0?J(n.map((e=>(le("text"===e.type),e.value))).filter(s.$K)):[];return{type:"text",value:(r=t.value,i=o,r.map((e=>{const t=(0,b.hDy)(e);return(0,b.V3y)((0,b.WiV)(e),[...t,...i])})))};var r,i},parameters:{expected:[{name:"input",type:{type:"text"}}],varargs:[{name:"styles",type:{type:"text"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:'style("Notion", "b", "u")',output:[['"'],["Notion",[["b"],["_"]]],['"']]},{input:'style("Notion", "blue", "gray_background")',output:[['"'],["Notion",[["h","blue"],["h","blue_background"]]],['"']]}],[{input:'"Notion".style("b", "u")',output:[['"'],["Notion",[["b"],["_"]]],['"']]},{input:'"Notion".style("blue", "blue_background")',output:[['"'],["Notion",[["h","blue"],["h","blue_background"]]],['"']]}]],syntax:["style(value, styles)","value.style(styles)"],description:ce.style},unstyle:{name:"unstyle",eval:function*(e){const[t,...n]=e;le("text"===t.type);const o=n.length>0?J(n.map((e=>(le("text"===e.type),e.value))).filter(s.$K)):void 0;return{type:"text",value:(r=t.value,i=o,r.map((e=>(0,b.V3y)((0,b.WiV)(e),(0,b.hDy)(e).filter((e=>{const t=(0,b.J7s)(e);return!Q.includes(t)||void 0!==i&&!i.some((n=>t===n[0]&&(void 0===n[1]||e[1]===n[1])))}))))))};var r,i},parameters:{expected:[{name:"input",type:{type:"text"}}],varargs:[{name:"styles",optional:!0,type:{type:"text"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:[['unstyle("'],["Text",[["b"],["c"]]],['")']],output:[['"Text"']]},{input:[['unstyle("'],["Text",[["h","blue"],["b"]]],['", "blue")']],output:[['"'],["Text",[["b"]]],['"']]}],[{input:[['"'],["Text",[["b"],["c"]]],['".unstyle()']],output:[['"Text"']]},{input:[['"'],["Text",[["h","blue"],["b"]]],['".unstyle("blue")']],output:[['"'],["Text",[["b"]]],['"']]}]],syntax:["unstyle(value, styles?)","value.unstyle(styles?)"],description:ce.unstyle},format:{name:"format",eval:function*(e,t){const[n]=e,o=(0,O.j4)(n);return{type:"text",value:(0,b.TPx)(yield*(0,O.PX)(o,t))}},parameters:{expected:[{name:"input",type:{type:"unknown"}}]},returnType:{type:"text"},iconType:{type:"text"},examples:[[{input:"format(1234)",output:'"1234"'},{input:"format(now())",output:[['"'],[(0,A.P)(w.ou.now(),"MMMM D, Y HH:mm")],['"']]}],[{input:"1234.format()",output:'"1234"'},{input:"now().format()",output:[['"'],[(0,A.P)(w.ou.now(),"MMMM D, Y HH:mm")],['"']]}]],syntax:["format(value)","value.format()"],description:ce.format},add:K("add",ce.add,((e,t)=>e+t),"+"),subtract:K("subtract",ce.subtract,((e,t)=>e-t),"-"),multiply:K("multiply",ce.multiply,((e,t)=>e*t),"*"),mod:K("mod",ce.mod,((e,t)=>e%t),"%"),pow:K("pow",ce.pow,((e,t)=>e**t),"^"),divide:{name:"divide",description:ce.divide,eval:function*(e,t){const[n,o]=e;return le("number"===n.type&&"number"===o.type),0===o.value?de:{type:"number",value:n.value/o.value}},returnType:{type:"number"},iconType:{type:"number"},syntax:["divide(number, number)","number.divide(number)"],parameters:{expected:[{name:"lhs",type:{type:"number"}},{name:"rhs",type:{type:"number"}}]},examples:[[{input:"divide(5, 10)",output:"0.5"},{input:"5 / 10",output:"0.5"}],[{input:"5.divide(10)",output:"0.5"},{input:"5 / 10",output:"0.5"}]]},min:{name:"min",eval:function*(e,t){const n=e,o=(0,O.Yw)({type:"array",values:n});if(0===o.values.length)return de;if(o.values.every((e=>"date"===e.type))){const e=o.values.map((e=>{if("date"===e.type)return(0,M.uO)(e.value,t.userTimeZone)})).filter(s.$K);if(0===e.length)return de;const n=e.indexOf(Math.min(...e));return o.values[n]}{const e=o.values.map((e=>"number"===e.type?e.value:void 0)).filter(s.$K);if(0===e.length)return de;return{type:"number",value:Math.min(...e)}}},parameters:{varargs:[{name:"value",type:[{type:"number"},{type:"array",of:{type:"number"}}]}]},returnType:{type:"number"},iconType:{type:"number"},examples:[[{input:"min(1, 2, 3)",output:"1"},{input:"min([1, 2, 3])",output:"1"}],[{input:"[1, 2, 3].min()",output:"1"}]],syntax:["min(list)","list.min()"],description:ce.min},max:{name:"max",eval:function*(e,t){const n=e,o=(0,O.Yw)({type:"array",values:n});if(0===o.values.length)return de;if(o.values.every((e=>"date"===e.type))){const e=o.values.map((e=>{if("date"===e.type)return(0,M.uO)(e.value,t.userTimeZone)})).filter(s.$K);if(0===e.length)return de;const n=e.indexOf(Math.max(...e));return o.values[n]}{const e=o.values.map((e=>"number"===e.type?e.value:void 0)).filter(s.$K);if(0===e.length)return de;return{type:"number",value:Math.max(...e)}}},parameters:{varargs:[{name:"value",type:[{type:"number"},{type:"array",of:{type:"number"}}]}]},returnType:{type:"number"},iconType:{type:"number"},examples:[[{input:"max(1, 2, 3)",output:"3"},{input:"max([1, 2, 3])",output:"3"}],[{input:"[1, 2, 3].max()",output:"3"}]],syntax:["max(list)","list.max()"],description:ce.max},sum:{name:"sum",eval:function*(e,t){return{type:"number",value:e.reduce(((e,t)=>e+("number"===t.type?t.value:"array"===t.type?t.values.reduce(((e,t)=>e+("number"===t.type?t.value:0)),0):0)),0)}},parameters:{varargs:[{name:"value",type:[{type:"number"},{type:"array",of:{type:"number"}}]}]},returnType:{type:"number"},iconType:{type:"number"},examples:[[{input:"sum(1, 2, 3)",output:"6"},{input:"sum([1, 2, 3], 4, 5)",output:"15"}],[{input:"[1, 2, 3].sum()",output:"6"},{input:"[1, 2, 3].sum(4, 5)",output:"15"}]],syntax:["sum(list)","list.sum()"],description:ce.sum},median:{name:"median",eval:function*(e,t){const n=oe(e).sort(((e,t)=>e-t));if(0===n.length)return de;if(n.length%2==0){return{type:"number",value:(n[n.length/2-1]+n[n.length/2])/2}}return{type:"number",value:n[Math.floor(n.length/2)]}},parameters:{varargs:[{name:"value",type:[{type:"number"},{type:"array",of:{type:"number"}}]}]},returnType:{type:"number"},iconType:{type:"number"},examples:[[{input:"median(1, 2, 4)",output:"2"},{input:"median([1, 2, 3], 4)",output:"2.5"}],[{input:"[1, 2, 4].median()",output:"2"},{input:"[1, 2, 3].median(4)",output:"2.5"}]],syntax:["median(list)","list.median()"],description:ce.median},mean:{name:"mean",eval:function*(e,t){const n=oe(e);if(0===n.length)return de;return{type:"number",value:n.reduce(((e,t)=>e+t),0)/n.length}},parameters:{varargs:[{name:"value",type:[{type:"number"},{type:"array",of:{type:"number"}}]}]},returnType:{type:"number"},iconType:{type:"number"},examples:[[{input:"mean(1, 2, 3)",output:"2"},{input:"mean([1, 2, 3], 4, 5)",output:"3"}],[{input:"[1, 2, 3].mean()",output:"2"},{input:"[1, 2, 3].mean(4, 5)",output:"3"}]],syntax:["mean(list)","list.mean()"],description:ce.mean},abs:j("abs",ce.abs,Math.abs,[10,-10]),round:j("round",ce.round,Math.round,[.4,-.6]),ceil:j("ceil",ce.ceil,Math.ceil,[.4,-.6]),floor:j("floor",ce.floor,Math.floor,[.4,-.6]),sqrt:j("sqrt",ce.sqrt,Math.sqrt,[4,7]),cbrt:j("cbrt",ce.cbrt,Math.cbrt,[9,64]),exp:j("exp",ce.exp,Math.exp,[1,-1]),ln:j("ln",ce.ln,Math.log,[Math.E,10]),log10:j("log10",ce.log10,Math.log10,[10,1e5]),log2:j("log2",ce.log2,Math.log2,[4,1024]),sign:j("sign",ce.sign,Math.sign,[-10,10]),pi:L("pi",ce.pi,Math.PI),e:L("e",ce.e,Math.E),toNumber:{name:"toNumber",eval:function*(e,t){const[n]=e;switch(n.type){case"number":return n;case"checkbox":return{type:"number",value:n.value?1:0};case"text":{const e=yield*(0,O.PX)(n.value,t),o=parseFloat(e);return(0,C.hj)(o)?{type:"number",value:parseFloat(e)}:de}case"date":return{type:"number",value:(0,M.NK)(n.value,t.userTimeZone).start.valueOf()};default:return de}},parameters:{expected:[{name:"input",type:{type:"unknown"}}]},returnType:{type:"number"},iconType:{type:"number"},examples:[[{input:'toNumber("2")',output:"2"},{input:"toNumber(now())",output:(0,M.uO)((0,M.R_)((0,R.r)()),(0,R.r)()).toString()},{input:"toNumber(true)",output:"1"}],[{input:'"2".toNumber()',output:"2"},{input:"now().toNumber()",output:(0,M.uO)((0,M.R_)((0,R.r)()),(0,R.r)()).toString()},{input:"true.toNumber()",output:"1"}]],syntax:["toNumber(value)","value.toNumber()"],description:ce.toNumber},now:{name:"now",eval:function*(e,t){return{type:"date",value:(0,M.R_)(t.userTimeZone)}},parameters:{},returnType:{type:"date"},iconType:{type:"date"},examples:[[{input:"now()",output:[(0,b.YCD)((0,b.pZr)((0,M.R_)((0,R.r)())))]}]],syntax:["now()"],description:ce.now},today:{name:"today",eval:function*(e,t){return{type:"date",value:(0,M.ME)((0,M.Uu)(t.userTimeZone))}},parameters:{},returnType:{type:"date"},iconType:{type:"date"},examples:[[{input:"today()",output:[(0,b.YCD)((0,b.pZr)((0,M.ME)((0,M.Uu)((0,R.r)()))))]}]],syntax:["today()"],description:ce.today},minute:{name:"minute",eval:G((e=>e.minute)),parameters:{expected:[{name:"date",type:{type:"date"}}]},returnType:{type:"number"},iconType:{type:"date"},examples:[[{input:'minute(parseDate("2023-07-10T17:35Z"))',output:"35"}],[{input:'parseDate("2023-07-10T17:35Z").minute()',output:"35"}]],syntax:["minute(date)","date.minute()"],description:ce.minute},hour:{name:"hour",eval:G((e=>e.hour)),parameters:{expected:[{name:"date",type:{type:"date"}}]},returnType:{type:"number"},iconType:{type:"date"},examples:[[{input:'hour(parseDate("2023-07-10T17:35Z"))',output:"17"}],[{input:'parseDate("2023-07-10T17:35Z").hour()',output:"17"}]],syntax:["hour(date)","date.hour()"],description:ce.hour},day:{name:"day",eval:G((e=>e.weekday)),parameters:{expected:[{name:"date",type:{type:"date"}}]},returnType:{type:"number"},iconType:{type:"date"},examples:[[{input:'day(parseDate("2023-07-10T17:35Z"))',output:"1"}],[{input:'parseDate("2023-07-10T17:35Z").day()',output:"1"}]],syntax:["day(date)","date.day()"],description:ce.day},date:{name:"date",eval:G((e=>e.day)),parameters:{expected:[{name:"date",type:{type:"date"}}]},returnType:{type:"number"},iconType:{type:"date"},examples:[[{input:'date(parseDate("2023-07-10T17:35Z"))',output:"10"}],[{input:'parseDate("2023-07-10T17:35Z").date()',output:"10"}]],syntax:["date(date)","date.date()"],description:ce.date},week:{name:"week",eval:G((e=>e.weekNumber)),parameters:{expected:[{name:"date",type:{type:"date"}}]},returnType:{type:"number"},iconType:{type:"date"},examples:[[{input:'week(parseDate("2023-01-02"))',output:"1"}],[{input:'parseDate("2023-01-02").week()',output:"1"}]],syntax:["week(date)","date.week()"],description:ce.week},month:{name:"month",eval:G((e=>e.month)),parameters:{expected:[{name:"date",type:{type:"date"}}]},returnType:{type:"number"},iconType:{type:"date"},examples:[[{input:'month(parseDate("2023-07-10T17:35Z"))',output:"7"}],[{input:'parseDate("2023-07-10T17:35Z").month()',output:"7"}]],syntax:["month(date)","date.month()"],description:ce.month},year:{name:"year",eval:G((e=>e.year)),parameters:{expected:[{name:"date",type:{type:"date"}}]},returnType:{type:"number"},iconType:{type:"date"},examples:[[{input:"year(now())",output:w.ou.now().year.toString()}],[{input:"now().year()",output:w.ou.now().year.toString()}]],syntax:["year(date)","date.year()"],description:ce.year},dateAdd:{name:"dateAdd",eval:H(((e,t,n)=>e.plus({[n]:t}).valueOf())),parameters:{expected:[{name:"input",type:{type:"date"}},{name:"num",type:{type:"number"}},{name:"unit",type:{type:"text"}}]},returnType:{type:"date"},iconType:{type:"date"},examples:[[{input:'dateAdd(now(), 1, "days")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().plus({days:1}))))]},{input:'dateAdd(now(), 2, "months")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().plus({months:2}))))]},{input:'dateAdd(now(), 3, "years")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().plus({years:3}))))]}],[{input:'now().dateAdd(1, "days")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().plus({days:1}))))]},{input:'now().dateAdd(2, "months")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().minus({months:2}))))]},{input:'now().dateAdd(3, "years")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().plus({years:3}))))]}]],syntax:["dateAdd(date, num, unit)","date.dateAdd(num, unit)"],description:ce.dateAdd},dateSubtract:{name:"dateSubtract",eval:H(((e,t,n)=>e.minus({[n]:t}).valueOf())),parameters:{expected:[{name:"input",type:{type:"date"}},{name:"num",type:{type:"number"}},{name:"unit",type:{type:"text"}}]},returnType:{type:"date"},iconType:{type:"date"},examples:[[{input:'dateSubtract(now(), 1, "days")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().minus({days:1}))))]},{input:'dateSubtract(now(), 2, "months")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().minus({months:2}))))]},{input:'dateSubtract(now(), 3, "years")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().minus({years:3}))))]}],[{input:'now().dateSubtract(1, "days")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().minus({days:1}))))]},{input:'now().dateSubtract(2, "months")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().minus({months:2}))))]},{input:'now().dateSubtract(3, "years")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.now().minus({years:3}))))]}]],syntax:["dateSubtract(date, num, unit)","date.dateSubtract(num, unit)"],description:ce.dateSubtract},dateBetween:{name:"dateBetween",eval:function*(e,t){const[n,o,r]=e;le("date"===n.type&&"date"===o.type&&"text"===r.type);const i=(0,M.NK)(n.value,t.userTimeZone).start,a=(0,M.NK)(o.value,t.userTimeZone).start,s=yield*q(r.value,t);return{type:"number",value:Math.trunc(i.diff(a,s).get(s))}},parameters:{expected:[{name:"left",type:{type:"date"}},{name:"right",type:{type:"date"}},{name:"unit",type:{type:"text"}}]},returnType:{type:"number"},iconType:{type:"date"},examples:[[{input:'dateBetween(now(), parseDate("2022-09-07"), "days")',output:Math.trunc(w.ou.now().diff(w.ou.fromISO("2022-09-07"),"days").days).toString()},{input:'dateBetween(parseDate("2030-01-01"), now(), "years")',output:Math.trunc(w.ou.fromISO("2030-01-01").diffNow("years").years).toString()}],[{input:'now().dateBetween(parseDate("2022-09-07"), "days")',output:Math.trunc(w.ou.now().diff(w.ou.fromISO("2022-09-07"),"days").days).toString()},{input:'parseDate("2030-01-01").dateBetween(now(), "years")',output:Math.trunc(w.ou.fromISO("2030-01-01").diffNow("years").years).toString()}]],syntax:["dateBetween(date, date, unit)","date.dateBetween(date, unit)"],description:ce.dateBetween},dateRange:{name:"dateRange",eval:function*(e,t){const[n,o]=e;return le("date"===n.type&&"date"===o.type),"start_time"in n.value||"start_time"in o.value?{type:"date",value:{type:"datetimerange",start_date:n.value.start_date,start_time:"start_time"in n.value?n.value.start_time:"00:00",end_date:"end_date"in o.value?o.value.end_date:o.value.start_date,end_time:"end_time"in o.value?o.value.end_time:"start_time"in o.value?o.value.start_time:"23:59",time_zone:"time_zone"in n.value&&n.value.time_zone||"time_zone"in o.value&&o.value.time_zone||t.userTimeZone}}:{type:"date",value:{type:"daterange",start_date:n.value.start_date,end_date:"end_date"in o.value?o.value.end_date:o.value.start_date}}},parameters:{expected:[{name:"start",type:{type:"date"}},{name:"end",type:{type:"date"}}]},returnType:{type:"date"},iconType:{type:"date"},examples:[[{input:[["dateRange("],(0,ae.h0)("Start Date"),[", "],(0,ae.h0)("End Date"),[")"]],output:[(0,b.YCD)((0,b.pZr)({type:"daterange",start_date:"2022-09-07",end_date:"2023-09-07"}))]}],[{input:[(0,ae.h0)("Start Date"),[".dateRange("],(0,ae.h0)("End Date"),[")"]],output:[(0,b.YCD)((0,b.pZr)({type:"daterange",start_date:"2022-09-07",end_date:"2023-09-07"}))]}]],syntax:["dateRange(start, end)"],description:ce.dateRange},dateStart:{name:"dateStart",eval:function*(e,t){const[n]=e;return le("date"===n.type),{type:"date",value:(0,T.Ws)(n.value)}},parameters:{expected:[{name:"input",type:{type:"date"}}]},returnType:{type:"date"},iconType:{type:"date"},examples:[[{input:[["dateStart("],(0,ae.h0)("Date Range"),[")"]],output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.fromISO("2022-09-07"))))]},{input:[["dateBetween(dateStart("],(0,ae.h0)("Date Range"),["), dateEnd("],(0,ae.h0)("Date Range"),['), "days")']],output:[["-365"]]}],[{input:[(0,ae.h0)("Date Range"),[".dateStart()"]],output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.fromISO("2022-09-07"))))]},{input:[(0,ae.h0)("Date Range"),[".dateStart().dateBetween("],(0,ae.h0)("Date Range"),['.dateEnd(), "days")']],output:[["-365"]]}]],syntax:["dateStart(dateRange)","dateRange.dateStart()"],description:ce.dateStart},dateEnd:{name:"dateEnd",eval:function*(e,t){const[n]=e;return le("date"===n.type),{type:"date",value:(0,T.S$)(n.value)}},parameters:{expected:[{name:"input",type:{type:"date"}}]},returnType:{type:"date"},iconType:{type:"date"},examples:[[{input:[["dateEnd("],(0,ae.h0)("Date range"),[")"]],output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.fromISO("2023-09-07"))))]},{input:[["dateBetween(dateEnd("],(0,ae.h0)("Date Range"),["), dateStart("],(0,ae.h0)("Date Range"),['), "days")']],output:"365"}],[{input:[(0,ae.h0)("Date Range"),[".dateEnd()"]],output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.fromISO("2023-09-07"))))]},{input:[(0,ae.h0)("Date Range"),[".dateEnd().dateBetween("],(0,ae.h0)("Date Range"),['.dateStart(), "days")']],output:"365"}]],syntax:["dateEnd(dateRange)","dataRange.dateEnd()"],description:ce.dateEnd},timestamp:{name:"timestamp",eval:function*(e,t){const[n]=e;return le("date"===n.type),{type:"number",value:(0,M.uO)(n.value,t.userTimeZone)}},parameters:{expected:[{name:"input",type:{type:"date"}}]},returnType:{type:"number"},iconType:{type:"date"},examples:[[{input:"timestamp(now())",output:(0,M.uO)((0,M.R_)((0,R.r)()),(0,R.r)()).toString()}],[{input:"now().timestamp()",output:(0,M.uO)((0,M.R_)((0,R.r)()),(0,R.r)()).toString()}]],syntax:["timestamp(date)","date.timestamp()"],description:ce.timestamp},fromTimestamp:{name:"fromTimestamp",eval:function*(e,t){const[n]=e;return le("number"===n.type),{type:"date",value:(0,M.CQ)(n.value,t.userTimeZone)}},parameters:{expected:[{name:"input",type:{type:"number"}}]},returnType:{type:"date"},iconType:{type:"date"},examples:[[{input:"fromTimestamp(1689024900000)",output:[(0,b.YCD)((0,b.pZr)((0,M.CQ)(16890249e5,(0,R.r)())))]}],[{input:"1689024900000.fromTimestamp()",output:[(0,b.YCD)((0,b.pZr)((0,M.CQ)(16890249e5,(0,R.r)())))]}]],syntax:["fromTimestamp(timestamp)","timestamp.fromTimestamp()"],description:ce.fromTimestamp},formatDate:{name:"formatDate",eval:function*(e,t){const[n,o,r]=e;le("date"===(null==n?void 0:n.type)&&"text"===(null==o?void 0:o.type)),le(void 0===r||"text"===(null==r?void 0:r.type));const i=function(e){const{timeZone:t,context:n}=e;if("text"===(null==t?void 0:t.type)){const e=(0,b.Jcv)(t.value);return e.startsWith("GMT")&&e.length>3?`Etc/GMT${"-"===e[3]?"+":"-"}${e.slice(4)}`:e}return n.userTimeZone}({timeZone:r,context:t});let a=(0,M.NK)((0,T.Ws)(n.value),i,t.intl.locale).start;return"datetime"!==n.value.type&&"datetimerange"!==n.value.type||(a=a.setZone(i)),{type:"text",value:(0,b.TPx)((0,A.P)(a,yield*(0,O.PX)(o.value,t)))}},parameters:{expected:[{name:"date",type:{type:"date"}},{name:"format",type:{type:"text"}},{name:"timezone",type:{type:"text"},optional:!0}]},returnType:{type:"text"},iconType:{type:"date"},examples:[[{input:'formatDate(now(), "MMMM D, Y")',output:[['"'],[(0,A.P)(w.ou.now(),"MMMM D, Y")],['"']]},{input:'formatDate(now(), "YYYY-MM-DD HH:mm")',output:[['"'],[(0,A.P)(w.ou.now(),"YYYY-MM-DD HH:mm")],['"']]},{input:'formatDate(now(), "h:mm A", "UTC+1")',output:[['"'],[(0,A.P)(w.ou.now().setZone("UTC+1"),"h:mm A")],['"']]}],[{input:'now().formatDate("MMMM D, Y")',output:[['"'],[(0,A.P)(w.ou.now(),"MMMM D, Y")],['"']]},{input:'now().formatDate("YYYY-MM-DD HH:mm")',output:[['"'],[(0,A.P)(w.ou.now(),"YYYY-MM-DD HH:mm")],['"']]},{input:'now().formatDate("h:mm A", "UTC+1")',output:[['"'],[(0,A.P)(w.ou.now().setZone("UTC+1"),"h:mm A")],['"']]}]],syntax:["formatDate(date, format, timezone?)","date.formatDate(format, timezone?)"],description:ce.formatDate},parseDate:{name:"parseDate",eval:function*(e,t){const[n]=e;le("text"===n.type);const o=yield*(0,O.PX)(n.value,t),r=(0,P.OD)(o);return r?{type:"date",value:(0,P.PG)(r)}:de},parameters:{expected:[{name:"dateString",type:{type:"text"}}]},returnType:{type:"date"},iconType:{type:"date"},examples:[[{input:'parseDate("2022-01-01")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.fromISO("2022-01-01"))))]},{input:'parseDate("2022-01-01T00:00Z")',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.fromISO("2022-01-01T00:00Z"))))]}],[{input:'"2022-01-01".parseDate()',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.fromISO("2022-01-01"))))]},{input:'"2022-01-01T00:00Z".parseDate()',output:[(0,b.YCD)((0,b.pZr)((0,P.PG)(w.ou.fromISO("2022-01-01T00:00Z"))))]}]],syntax:["parseDate(dateText)","dateText.parseDate()"],description:ce.parseDate},name:{name:"name",eval:function*(e,t){const[n]=e;le("person"===n.type);const o=(yield{recordPointers:[n.value]}).getRecordModel(n.value);if(!o)throw new N.Mu({type:N.sj.UserNotFound});return{type:"text",value:(0,b.TPx)(o.getDisplayName(t.intl))}},parameters:{expected:[{name:"person",type:{type:"person"}}]},returnType:{type:"text"},iconType:{type:"person"},examples:[[{input:[["name("],(0,ae.um)(_.vz.CreatedBy),[")"]],isCopyable:!0},{input:[(0,ae.h0)("Pioneers"),['.map(name(current)).join(", ")']],output:'"Grace Hopper, Ada Lovelace"'}],[{input:[(0,ae.um)(_.vz.CreatedBy),[".name()"]],isCopyable:!0},{input:[(0,ae.h0)("Pioneers"),['.map(current.name()).join(", ")']],output:'"Grace Hopper, Ada Lovelace"'}]],syntax:["name(person)","person.name()"],description:ce.name},email:{name:"email",eval:function*(e,t){const[n]=e;le("person"===n.type);const o=(yield{recordPointers:[n.value]}).getRecordModel(n.value);if(!o)throw new N.Mu({type:N.sj.UserNotFound});return o.isUser()?{type:"text",value:(0,b.TPx)(o.getEmail())}:de},parameters:{expected:[{name:"person",type:{type:"person"}}]},returnType:{type:"text"},iconType:{type:"person"},examples:[[{input:[["email("],(0,ae.um)(_.vz.CreatedBy),[")"]],isCopyable:!0},{input:[(0,ae.h0)("People"),['.map(email(current)).join(", ")']]}],[{input:[(0,ae.um)(_.vz.CreatedBy),[".email()"]],isCopyable:!0},{input:[(0,ae.h0)("People"),['.map(current.email()).join(", ")']]}]],syntax:["email(person)","person.email()"],description:ce.email},at:{name:"at",eval:function*(e,t){const[n,o]=e;le("array"===n.type&&"number"===o.type);const r=n.values.at(o.value);return void 0!==r?r:de},parameters:{expected:[{name:"list",type:{type:"array",of:{type:"unknown"}}},{name:"index",type:{type:"number"}}]},returnType:e=>{let[t]=e;return"array"===(null==t?void 0:t.type)?t.of:{type:"unknown"}},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:"at([1, 2, 3], 1)",output:"2"}],[{input:"[1, 2, 3].at(1)",output:"2"}]],syntax:["at(list, index)","list.at(index)"],description:ce.at},first:{name:"first",eval:function*(e,t){const[n]=e;return le("array"===n.type),n.values.length>0?n.values[0]:de},parameters:{expected:[{name:"list",type:{type:"array",of:{type:"unknown"}}}]},returnType:e=>{let[t]=e;return"array"===(null==t?void 0:t.type)?t.of:{type:"unknown"}},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:"first([1, 2, 3])",output:"1"}],[{input:"[1, 2, 3].first()",output:"1"},{input:"[].first()",output:"Empty"}]],syntax:["first(list)","list.first()"],description:ce.first},last:{name:"last",eval:function*(e,t){const[n]=e;return le("array"===n.type),n.values.length>0?n.values[n.values.length-1]:de},parameters:{expected:[{name:"list",type:{type:"array",of:{type:"unknown"}}}]},returnType:e=>{let[t]=e;return"array"===(null==t?void 0:t.type)?t.of:{type:"unknown"}},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:"last([1, 2, 3])",output:"3"}],[{input:"[1, 2, 3].last()",output:"3"}]],syntax:["last(list)","list.last()"],description:ce.last},slice:{name:"slice",eval:function*(e,t){const[n,o,r]=e;return le("array"===n.type&&"number"===o.type),{type:"array",values:n.values.slice(o.value,"number"===(null==r?void 0:r.type)?r.value:void 0)}},parameters:{expected:[{name:"list",type:{type:"array",of:{type:"unknown"}}},{name:"startIndex",type:{type:"number"}},{name:"endIndex",optional:!0,type:{type:"number"}}]},returnType:e=>{let[t]=e;return"array"===(null==t?void 0:t.type)?t:{type:"array",of:{type:"unknown"}}},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:"slice([1, 2, 3], 1, 2)",output:"[2]"},{input:'slice(["a", "b", "c"], 1)',output:'["b", "c"]'}],[{input:"[1, 2, 3].slice(1, 2)",output:"[2]"},{input:'["a", "b", "c"].slice(1)',output:'["b", "c"]'}]],syntax:["slice(list, startIndex, endIndex?)","list.slice(startIndex, endIndex?)"],description:ce.slice},concat:{name:"concat",eval:function*(e){return{type:"array",values:e.flatMap((e=>(le("array"===e.type),e.values.filter((e=>"undefined"!==e.type)))))}},parameters:{varargs:[{name:"arg",type:{type:"array",of:{type:"unknown"}}}]},returnType:e=>{const t=null==e?void 0:e[0];if(void 0===t)return{type:"array",of:{type:"unknown"}};for(let n=1;n<e.length;n++)if(void 0!==e[n]&&!(0,B.Jy)(e[n],t))return{type:"array",of:{type:"unknown"}};return t},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:"concat([1, 2], [3, 4])",output:"[1, 2, 3, 4]"},{input:'concat(["a", "b"], ["c", "d"])',output:'["a", "b", "c", "d"]'}],[{input:"[1, 2].concat([3, 4])",output:"[1, 2, 3, 4]"},{input:'["a", "b"].concat(["c", "d"])',output:'["a", "b", "c", "d"]'}]],syntax:["concat(list, list2, ...)","list.concat(list2, ...)"],description:ce.concat},sort:{name:"sort",eval:function*(e,t){const[n,o]=e;le("array"===n.type);const r=n.values.filter((e=>"undefined"!==e.type)),a=void 0!==o?yield*function*(e,t,n){const o=yield*$(e,t,n);if(te(o))return(0,i.$R)(e,o).sort(((e,t)=>ne({left:e[1],right:t[1],context:n}))).map((e=>{let[t]=e;return t}));const r=(0,i.oA)(o.flatMap((e=>(0,O.Rp)(e)))),a=r.length?(yield{recordPointers:r}).getRecordModel:V.o.constant(void 0),s=o.map((e=>(0,m.QT)({result:e,getRecordModel:a,userTimeZone:n.userTimeZone,intl:n.intl,useImprovedSort:!0})));return(0,i.$R)(e,s).sort(((e,t)=>(0,m.O$)(e[1],t[1],{}))).map((e=>{let[t]=e;return t}))}(r,o,t):yield*function*(e,t){if(te(e))return e.sort(((e,n)=>ne({left:e,right:n,context:t})));const n=(0,i.oA)(e.flatMap((e=>(0,O.Rp)(e)))),o=n.length?(yield{recordPointers:n}).getRecordModel:V.o.constant(void 0),r=e.map((e=>(0,m.QT)({result:e,getRecordModel:o,userTimeZone:t.userTimeZone,intl:t.intl,useImprovedSort:!0})));return(0,i.$R)(e,r).sort(((e,t)=>(0,m.O$)(e[1],t[1],{}))).map((e=>{let[t]=e;return t}))}(r,t);return{type:"array",values:a}},parameters:me,returnType:e=>{let[t]=e;return"array"===(null==t?void 0:t.type)?t:{type:"array",of:{type:"unknown"}}},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:"sort([3, 1, 2])",output:"[1, 2, 3]"},{input:'sort(["Yash", "Stephen", "Paul", "Simon", "Ryo"])',output:'["Paul", "Ryo", "Simon", "Stephen", "Yash"]'},{input:"sort([1, 2, 3], current * -1)",output:"[3, 2, 1]"}],[{input:"[3, 1, 2].sort()",output:"[1, 2, 3]"},{input:'["Yash", "Stephen", "Paul", "Simon", "Ryo"].sort()',output:'["Paul", "Ryo", "Simon", "Stephen", "Yash"]'},{input:"[1, 2, 3].sort(current * -1)",output:"[3, 2, 1]"}]],syntax:["sort(list)","list.sort()"],description:ce.sort},reverse:{name:"reverse",eval:function*(e,t){const[n]=e;le("array"===n.type);return{type:"array",values:[...n.values].reverse()}},parameters:{expected:[{name:"list",type:{type:"array",of:{type:"unknown"}}}]},returnType:e=>{let[t]=e;return"array"===(null==t?void 0:t.type)?t:{type:"array",of:{type:"unknown"}}},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:'reverse(["green", "eggs", "ham"])',output:'["ham", "eggs", "green"]'}],[{input:'["green", "eggs", "ham"].reverse()',output:'["ham", "eggs", "green"]'}]],syntax:["reverse(list)","list.reverse()"],description:ce.reverse},join:{name:"join",eval:function*(e,t){const[n,o]=e;le("array"===n.type&&"text"===o.type);const r=n.values.map((e=>(0,O.j4)(e)));return{type:"text",value:(0,b.Zxt)((0,D.Z)(r,(()=>o.value)).flat())}},parameters:{expected:[{name:"input",type:{type:"array",of:{type:"unknown"}}},{name:"joiner",type:{type:"text"}}]},returnType:{type:"text"},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:'join(["a", "b", "c"], ", ")',output:'"a, b, c"'},{input:'join(["dog", "go"], "")',output:'"doggo"'}],[{input:'["a", "b", "c"].join(", ")',output:'"a, b, c"'},{input:'["dog", "go"].join("")',output:'"doggo"'}]],syntax:["join(list, joiner)","list.join(joiner)"],description:ce.join},split:{name:"split",eval:function*(e,t){const[n,o]=e;le("text"===n.type),le(void 0===o||"text"===o.type);const[r,i]=yield*(0,O.zA)([n.value,null==o?void 0:o.value],t);if(""===r)return{type:"array",values:[]};const a=" "===i||void 0===o,s=a?/\s+/:i;return{type:"array",values:r.split(s).filter((e=>!a||e.length>0)).map((e=>({type:"text",value:(0,b.TPx)(e)})))}},parameters:{expected:[{name:"input",type:{type:"text"}},{name:"separator",optional:!0,type:{type:"text"}}]},returnType:{type:"array",of:{type:"text"}},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:'split("apple,pear,orange", ",")',output:'["apple", "pear", "orange"]'}],[{input:'"apple,pear,orange".split(",")',output:'["apple", "pear", "orange"]'}]],syntax:["split(text, separator)","text.split(separator)"],description:ce.split},unique:{name:"unique",eval:function*(e,t){const[n]=e;le("array"===n.type);const o=[];for(const r of n.values){(yield*(0,S.LD)(o.map((e=>(0,O.Jr)(e,r,t))))).some((e=>e))||o.push(r)}return{type:"array",values:o}},parameters:{expected:[{name:"list",type:{type:"array",of:{type:"unknown"}}}]},returnType:e=>{let[t]=e;return"array"===(null==t?void 0:t.type)?t:{type:"array",of:{type:"unknown"}}},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:"unique([1, 1, 2])",output:"[1, 2]"}],[{input:"[1, 1, 2].unique()",output:"[1, 2]"}]],syntax:["unique(list)","list.unique()"],description:ce.unique},includes:{name:"includes",eval:function*(e,t){const[n,o]=e;le("array"===n.type);for(const r of n.values){if(yield*(0,O.Jr)(r,o,t))return{type:"checkbox",value:!0}}return{type:"checkbox",value:!1}},parameters:{expected:[{name:"list",type:{type:"array",of:{type:"unknown"}}},{name:"needle",type:{type:"unknown"}}]},returnType:{type:"checkbox"},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:'includes(["a", "b", "c"], "b")',output:"true"},{input:"includes([1, 2, 3], 4)",output:"false"}],[{input:'["a", "b", "c"].includes("b")',output:"true"},{input:"[1, 2, 3].includes(4)",output:"false"}]],syntax:["includes(list, search)","list.includes(search)"],description:ce.includes},find:{name:"find",eval:function*(e,t){const[n,o]=e;le("array"===n.type);const r=yield*$(n.values,o,t);return n.values.find(((e,t)=>(0,O.vh)(r[t])))??{type:"undefined"}},parameters:pe,returnType:e=>{let[t,n]=e;return"array"===(null==t?void 0:t.type)?t.of:{type:"unknown"}},iconType:{type:"text"},examples:[[{input:'find(["a", "b", "c"], current == "b")',output:'"b"'},{input:"find([1, 2, 3], current > 100)",output:"Empty"}],[{input:'["a", "b", "c"].find(current == "b")',output:'"b"'},{input:"[1, 2, 3].find(current > 100)",output:"Empty"}]],syntax:["find(list, condition)","list.find(condition)"],description:ce.find},findIndex:{name:"findIndex",eval:function*(e,t){const[n,o]=e;le("array"===n.type);return{type:"number",value:(yield*$(n.values,o,t)).findIndex((e=>(0,O.vh)(e)))}},parameters:pe,returnType:{type:"number"},iconType:{type:"text"},examples:[[{input:'findIndex(["a", "b", "c"], current == "b")',output:"1"},{input:"findIndex([1, 2, 3], current > 100)",output:"-1"}],[{input:'["a", "b", "c"].findIndex(current == "b")',output:"1"},{input:"[1, 2, 3].findIndex(current > 100)",output:"-1"}]],syntax:["findIndex(list, condition)","list.findIndex(condition)"],description:ce.findIndex},filter:{name:"filter",eval:function*(e,t){const[n,o]=e;le("array"===n.type);const r=yield*$(n.values,o,t);return{type:"array",values:n.values.filter(((e,t)=>(0,O.vh)(r[t])))}},parameters:pe,returnType:e=>{let[t,n]=e;return"array"===(null==t?void 0:t.type)?t:{type:"unknown"}},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:"filter([1, 2, 3], current > 1)",output:"[2, 3]"},{input:'filter(["a", "b", "c"], current == "a")',output:'["a"]'}],[{input:"[1, 2, 3].filter(current > 1)",output:"[2, 3]"},{input:'["a", "b", "c"].filter(current == "a")',output:'["a"]'}]],syntax:["filter(list, condition)","list.filter(condition)"],description:ce.filter},some:{name:"some",eval:function*(e,t){const[n,o]=e;le("array"===n.type);return{type:"checkbox",value:(yield*$(n.values,o,t)).some((e=>(0,O.vh)(e)))}},parameters:pe,returnType:{type:"checkbox"},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:"some([1, 2, 3], current == 2)",output:"true"},{input:'some(["a", "b", "c"], current.length > 2)',output:"false"}],[{input:"[1, 2, 3].some(current == 2)",output:"true"},{input:'["a", "b", "c"].some(current.length > 2)',output:"false"}]],syntax:["some(list, expression)","list.some(expression)"],description:ce.some},every:{name:"every",eval:function*(e,t){const[n,o]=e;le("array"===n.type);return{type:"checkbox",value:(yield*$(n.values,o,t)).every((e=>(0,O.vh)(e)))}},parameters:pe,returnType:{type:"checkbox"},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:"every([1, 2, 3], current > 0)",output:"true"},{input:'every(["a", "b", "c"], current == "b")',output:"false"}],[{input:"[1, 2, 3].every(current > 0)",output:"true"},{input:'["a", "b", "c"].every(current == "b")',output:"false"}]],syntax:["every(list, condition)","list.every(condition)"],description:ce.every},map:{name:"map",eval:function*(e,t){const[n,o]=e;return le("array"===n.type),{type:"array",values:yield*$(n.values,o,t)}},parameters:pe,returnType:e=>{let[t,n]=e;return{type:"array",of:n??{type:"unknown"}}},iconType:{type:"array",of:{type:"text"}},examples:[[{input:"map([1, 2, 3], current + 1)",output:"[2, 3, 4]"},{input:"map([1, 2, 3], current + index)",output:"[1, 3, 5]"}],[{input:"[1, 2, 3].map(current + 1)",output:"[2, 3, 4]"},{input:"[1, 2, 3].map(current + index)",output:"[1, 3, 5]"}]],syntax:["map(list, expression)","list.map(expression)"],description:ce.map},flat:{name:"flat",eval:function*(e,t){const[n]=e;le("array"===n.type);const o=[];for(const r of n.values)"array"===r.type?o.push(...r.values):o.push(r);return{type:"array",values:o}},parameters:{expected:[{name:"list",type:{type:"array",of:{type:"unknown"}}}]},returnType:e=>{let[t]=e,n={type:"unknown"};return"array"===(null==t?void 0:t.type)&&(n="array"===t.of.type?t.of.of:t.of),{type:"array",of:n}},iconType:{type:"array",of:{type:"unknown"}},examples:[[{input:"flat([1, 2, 3])",output:"[1, 2, 3]"},{input:"flat([[1, 2], [3, 4]])",output:"[1, 2, 3, 4]"}],[{input:"[1, 2, 3].flat()",output:"[1, 2, 3]"},{input:"[[1, 2], [3, 4]].flat()",output:"[1, 2, 3, 4]"}]],syntax:["flat(list, list2?, ...)","list.flat(list2?, ...)"],description:ce.flat},id:{name:"id",eval:function*(e,t){const[n]=e;if(!n){var o;const e=null===(o=t.values.find((e=>e.kind===_.yp.ThisRow)))||void 0===o?void 0:o.value;if("block"!==(null==e?void 0:e.type))throw new N.Mu({type:N.sj.TryingToGetIdWithoutThisRow});return{type:"text",value:(0,b.TPx)((0,I.cj)(e.value.id))}}return le("block"===n.type||"person"===n.type),{type:"text",value:(0,b.TPx)((0,I.cj)(n.value.id))}},parameters:{expected:[{name:"value",type:[{type:"person"},{type:"block"}],optional:!0}]},returnType:{type:"text"},iconType:{type:"text"},syntax:["id(value?)","value.id()"],examples:[[{input:"id()"},{input:[["id("],(0,ae.h0)("Relation"),[".first())"]]},{input:[["id("],(0,ae.h0)("Person"),[".first())"]]}],[{input:[(0,ae.h0)("Relation"),[".first().id()"]]},{input:[(0,ae.h0)("Person"),[".first().id()"]]}]],description:ce.id},equal:{name:"equal",eval:function*(e,t){const[n,o]=e;return{type:"checkbox",value:yield*(0,O.Jr)(n,o,t)}},parameters:{expected:[{name:"lhs",type:{type:"unknown"}},{name:"rhs",type:{type:"unknown"}}]},returnType:{type:"checkbox"},iconType:{type:"checkbox"},examples:[[{input:"equal(1, 1)",output:"true"},{input:'"a" == "b"',output:"false"}],[{input:"1.equal(1)",output:"true"},{input:'"a" == "b"',output:"false"}]],syntax:["equal(value, value)","value.equal(value)"],description:ce.equal},unequal:{name:"unequal",eval:function*(e,t){const[n,o]=e;return{type:"checkbox",value:!(yield*(0,O.Jr)(n,o,t))}},parameters:{expected:[{name:"lhs",type:{type:"unknown"}},{name:"rhs",type:{type:"unknown"}}]},returnType:{type:"checkbox"},iconType:{type:"checkbox"},examples:[[{input:"unequal(1, 2)",output:"true"},{input:'"a" != "a"',output:"false"}],[{input:"1.unequal(2)",output:"true"},{input:'"a" != "a"',output:"false"}]],syntax:["unequal(value, value)","value.unequal(value)"],description:ce.unequal},let:{name:"let",eval:function*(e,t){const[n,o,r]=e;if(n.kind!==N.bG.Identifier)throw new N.Mu({type:N.sj.LetBindingNameNotIdentifier,node:n});const i=yield*W(o,t);return yield*Fe(r,{...t,values:[{kind:_.yp.Binding,id:n.text,value:i},...t.values]})},parameters:{expected:[{name:"identifier",type:{type:"expression"}},{name:"value",type:{type:"expression"}},{name:"expression",type:{type:"expression"}}]},returnType:e=>{let[t,n,o]=e;return o??{type:"unknown"}},iconType:{type:"text"},examples:[[{input:'let(name, "Doug Engelbart", "Hello, " + name + "!")',output:'"Hello, Doug Engelbart!"'},{input:"let(radius, 4, round(pi() * radius ^ 2))",output:"50"}],[{input:'name.let("Alan Kay", "Hello, " + name + "!")',output:'"Hello, Alan Kay!"'},{input:"radius.let(4, round(pi() * radius ^ 2)",output:"50"}]],syntax:["let(variable, value, expression)","variable.let(value, expression)"],description:ce.let},lets:{name:"lets",eval:function*(e,t){const n=e;if(n.length<3||n.length%2!=1)throw new N.Mu({type:N.sj.NotEnoughArguments});const o={...t};for(let i=0;i<n.length-1;i+=2){const e=n[i],t=n[i+1];if(e.kind!==N.bG.Identifier)throw new N.Mu({type:N.sj.LetBindingNameNotIdentifier,node:e});const r=yield*W(t,o);o.values=[{kind:_.yp.Binding,id:e.text,value:r},...o.values]}const r=n[n.length-1];return yield*Fe(r,o)},parameters:{varargs:[{name:"args",type:{type:"expression"}}]},returnType:e=>e[e.length-1]??{type:"unknown"},iconType:{type:"text"},examples:[[{input:'lets(a, "Hello", b, "world", a + " " + b)',output:'"Hello world"'},{input:"lets(base, 3, height, 8, base * height / 2)",output:"12"}],[]],syntax:["lets(variable, value, variable2, value2, ..., expression)","variable.lets(value, variable2, value2, ..., expression)"],description:ce.lets}};const fe=["block","array","person"],he=["let","lets"];var ve=n(484682),ye=(n(292087),n(877090));const be=i.HP((()=>function(){const e=(0,ye.V3)({name:"AdditionOperator",pattern:ye.hW.NA}),t=(0,ye.V3)({name:"UnaryOperator",pattern:ye.hW.NA}),n=(0,ye.V3)({name:"Plus",pattern:/\+/,categories:e}),o=(0,ye.V3)({name:"Minus",pattern:/-/,categories:[e,t]}),r=(0,ye.V3)({name:"ExclamationPoint",pattern:/!/,categories:t}),i=(0,ye.V3)({name:"MultiplicationOperator",pattern:ye.hW.NA}),a=(0,ye.V3)({name:"Multi",pattern:/\*/,categories:i}),s=(0,ye.V3)({name:"Div",pattern:/\//,categories:i}),l=(0,ye.V3)({name:"Modulo",pattern:/%/,categories:i}),c=(0,ye.V3)({name:"Caret",pattern:/\^/}),d=(0,ye.V3)({name:"BooleanLiteral",pattern:ye.hW.NA}),u=(0,ye.V3)({name:"True",pattern:/true/i,categories:d}),p=(0,ye.V3)({name:"False",pattern:/false/i,categories:d}),m=(0,ye.V3)({name:"And",pattern:/and |&&/i}),g=(0,ye.V3)({name:"Or",pattern:/or |\|\|/i}),f=(0,ye.V3)({name:"Not",pattern:/not /i,categories:t}),h=(0,ye.V3)({name:"RelationalOperator",pattern:ye.hW.NA}),y=(0,ye.V3)({name:"LessThan",pattern:/<=?/,categories:h}),b=(0,ye.V3)({name:"GreaterThan",pattern:/>=?/,categories:h}),S=(0,ye.V3)({name:"EqualityOperator",pattern:ye.hW.NA}),k=(0,ye.V3)({name:"Equal",pattern:/==/,categories:S}),w=(0,ye.V3)({name:"NotEqual",pattern:/!=/,categories:S}),x=(0,ye.V3)({name:"LParen",pattern:/\(/}),I=(0,ye.V3)({name:"RParen",pattern:/\)/}),C=(0,ye.V3)({name:"LBracket",pattern:/\[/}),T=(0,ye.V3)({name:"RBracket",pattern:/\]/}),M=(0,ye.V3)({name:"Comma",pattern:/,/}),P=(0,ye.V3)({name:"Dot",pattern:/\./}),A=(0,ye.V3)({name:"QuestionMark",pattern:/\?/}),R=(0,ye.V3)({name:"Colon",pattern:/:/}),D=(0,ye.V3)({name:"StringLiteral",pattern:/"(?:[^\\"]|\\.)*"/,start_chars_hint:['"']}),B=(0,ye.V3)({name:"UnclosedStringLiteral",pattern:/"(?:[^\\"]|\\.)*/,start_chars_hint:['"']}),E=(0,ye.V3)({name:"NumberLiteral",pattern:/(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/}),F=(0,ye.V3)({name:"Comment",pattern:/\/\*(?:[^*]|\*(?:[^\/]))*\*\//,group:ye.hW.SKIPPED,start_chars_hint:["/*"]}),Z=(0,ye.V3)({name:"UnclosedComment",pattern:/\/\*(?:[^*]|\*(?:[^\/]))*/,group:ye.hW.SKIPPED,start_chars_hint:["/*"]}),U=(0,ye.V3)({name:"InputToken",pattern:{exec:(e,t)=>{if(!e.startsWith(_.Eb,t))return null;const n=e.substring(t),o=_._i.exec(n);if(null!==o){const e=[o[0]],t=(0,O.i0)(o[1]);let n;if(void 0!==o[2])n={type:_.Oy.BlockProperty,property:t,collection:{table:v.vF,id:o[3],spaceId:o[4]}};else{if(!_.WG.includes(t))return null;n={type:_.Oy.BlockProperty,property:t,collection:void 0}}return e.payload=n,e}const r=_.Gx.exec(n);if(null!==r){const e=[r[0]],t=(0,O.i0)(r[1]),n=(0,O.wf)(r[2]),o=(0,O.by)(e[3]),i={contextValueId:n,property:t,type:_.Oy.BlockProperty,valueSnapshot:o};return e.payload=i,e}const i=_.QQ.exec(n);if(null!==i){const e=[i[0]],t={type:_.Oy.Block,blockId:i[1],spaceId:void 0!==i[2]?i[2].substring(1):void 0};return e.payload=t,e}const a=_.eO.exec(n);if(null!==a){const e=[a[0]],t={type:_.Oy.Person,userId:a[1]};return e.payload=t,e}const s=_.DF.exec(n);if(null!==s){const e=[s[0]],t={type:_.Oy.Checkbox,checked:"true"===s[1]};return e.payload=t,e}const l=_.Uq.exec(n);if(null!==l){const e=[l[0]],t=(0,O.wf)(l[1]),n={type:_.Oy.ContextValue,valueId:t};return e.payload=n,e}const c=_.Xm.exec(n);if(null!==c){const e=[c[0]],t={type:_.Oy.Date,date:(0,O.DF)(c[1])};return e.payload=t,e}return null}},line_breaks:!1,start_chars_hint:[_.Eb]}),V=(0,ye.V3)({name:"IdentifierName",pattern:(N=/[\p{Letter}_][\p{Number}\p{Letter}_]*/u,(e,t)=>{const n=new RegExp(N.source,`${N.flags}y`);return n.lastIndex=t,n.exec(e)}),line_breaks:!1});var N;return{WhiteSpace:(0,ye.V3)({name:"WhiteSpace",pattern:/\s+/,group:ye.hW.SKIPPED}),NumberLiteral:E,StringLiteral:D,UnclosedStringLiteral:B,Comment:F,UnclosedComment:Z,InputToken:U,True:u,False:p,And:m,Or:g,Not:f,IdentifierName:V,Equal:k,NotEqual:w,Plus:n,Minus:o,ExclamationPoint:r,Multi:a,Div:s,Modulo:l,Caret:c,LParen:x,RParen:I,LBracket:C,RBracket:T,AdditionOperator:e,MultiplicationOperator:i,LessThan:y,GreaterThan:b,QuestionMark:A,Colon:R,Comma:M,Dot:P,UnaryOperator:t,EqualityOperator:S,RelationalOperator:h,BooleanLiteral:d}}()));const _e=i.HP((e=>new ye.hW(function(e){return Object.values(e)}(e))));class Se extends ye.wd{constructor(e){super(Object.values(e),{recoveryEnabled:!0,nodeLocationTracking:"onlyOffset"}),this.formulaTokens=void 0,this.expression=this.RULE("expression",(()=>{this.SUBRULE(this.conditionalExpression)})),this.primaryExpression=this.RULE("primaryExpression",(()=>{this.OR([{ALT:()=>this.SUBRULE(this.parenthesisExpression)},{ALT:()=>this.SUBRULE(this.arrayExpression)},{ALT:()=>this.CONSUME(this.formulaTokens.NumberLiteral)},{ALT:()=>this.CONSUME(this.formulaTokens.StringLiteral)},{ALT:()=>this.CONSUME(this.formulaTokens.UnclosedStringLiteral)},{ALT:()=>this.CONSUME(this.formulaTokens.BooleanLiteral)},{ALT:()=>this.CONSUME(this.formulaTokens.IdentifierName)},{ALT:()=>this.CONSUME(this.formulaTokens.InputToken)}])})),this.conditionalExpression=this.RULE("conditionalExpression",(()=>{this.SUBRULE(this.logicalOrExpression,{LABEL:"condition"}),this.OPTION((()=>{this.CONSUME(this.formulaTokens.QuestionMark),this.SUBRULE2(this.logicalOrExpression,{LABEL:"expIfTrue"}),this.CONSUME(this.formulaTokens.Colon),this.SUBRULE3(this.logicalOrExpression,{LABEL:"expIfFalse"})}))})),this.logicalOrExpression=this.RULE("logicalOrExpression",(()=>{this.SUBRULE(this.logicalAndExpression,{LABEL:"lhs"}),this.MANY((()=>{this.CONSUME(this.formulaTokens.Or),this.SUBRULE2(this.logicalAndExpression,{LABEL:"rhs"})}))})),this.logicalAndExpression=this.RULE("logicalAndExpression",(()=>{this.SUBRULE(this.equalityExpression,{LABEL:"lhs"}),this.MANY((()=>{this.CONSUME(this.formulaTokens.And),this.SUBRULE2(this.equalityExpression,{LABEL:"rhs"})}))})),this.equalityExpression=this.RULE("equalityExpression",(()=>{this.SUBRULE(this.relationalExpression,{LABEL:"lhs"}),this.OPTION((()=>{this.CONSUME(this.formulaTokens.EqualityOperator),this.SUBRULE2(this.relationalExpression,{LABEL:"rhs"})}))})),this.relationalExpression=this.RULE("relationalExpression",(()=>{this.SUBRULE(this.additionExpression,{LABEL:"lhs"}),this.OPTION((()=>{this.CONSUME(this.formulaTokens.RelationalOperator),this.SUBRULE2(this.additionExpression,{LABEL:"rhs"})}))})),this.additionExpression=this.RULE("additionExpression",(()=>{this.SUBRULE(this.multiplicationExpression,{LABEL:"lhs"}),this.MANY((()=>{this.CONSUME(this.formulaTokens.AdditionOperator),this.SUBRULE2(this.multiplicationExpression,{LABEL:"rhs"})}))})),this.multiplicationExpression=this.RULE("multiplicationExpression",(()=>{this.SUBRULE(this.exponentiationExpression,{LABEL:"lhs"}),this.MANY((()=>{this.CONSUME(this.formulaTokens.MultiplicationOperator),this.SUBRULE2(this.exponentiationExpression,{LABEL:"rhs"})}))})),this.exponentiationExpression=this.RULE("exponentiationExpression",(()=>{this.SUBRULE(this.unaryExpression,{LABEL:"lhs"}),this.MANY((()=>{this.CONSUME(this.formulaTokens.Caret),this.SUBRULE2(this.unaryExpression,{LABEL:"rhs"})}))})),this.unaryExpression=this.RULE("unaryExpression",(()=>{this.OPTION((()=>{this.CONSUME(this.formulaTokens.UnaryOperator)})),this.SUBRULE(this.primaryExpression),this.MANY((()=>{this.SUBRULE2(this.memberCallSubExpression)}))})),this.memberCallSubExpression=this.RULE("memberCallSubExpression",(()=>{this.OR([{ALT:()=>this.SUBRULE(this.dotMemberExpression)},{ALT:()=>this.SUBRULE(this.callArguments)}])})),this.dotMemberExpression=this.RULE("dotMemberExpression",(()=>{this.CONSUME(this.formulaTokens.Dot),this.OR([{ALT:()=>this.CONSUME(this.formulaTokens.IdentifierName)},{GATE:()=>{var e;const t=this.LA(1);return t.tokenType===this.formulaTokens.InputToken&&(null===(e=t.payload)||void 0===e?void 0:e.type)===_.Oy.BlockProperty},ALT:()=>this.CONSUME(this.formulaTokens.InputToken)}])})),this.callArguments=this.RULE("callArguments",(()=>{this.CONSUME(this.formulaTokens.LParen),this.OPTION((()=>{this.SUBRULE(this.expression),this.MANY((()=>{this.CONSUME(this.formulaTokens.Comma),this.SUBRULE2(this.expression)}))})),this.CONSUME(this.formulaTokens.RParen)})),this.parenthesisExpression=this.RULE("parenthesisExpression",(()=>{this.CONSUME(this.formulaTokens.LParen),this.SUBRULE(this.expression),this.CONSUME(this.formulaTokens.RParen)})),this.arrayExpression=this.RULE("arrayExpression",(()=>{this.CONSUME(this.formulaTokens.LBracket),this.OPTION((()=>{this.SUBRULE(this.expression),this.MANY((()=>{this.CONSUME(this.formulaTokens.Comma),this.SUBRULE2(this.expression)}))})),this.CONSUME(this.formulaTokens.RBracket)})),this.formulaTokens=e,this.performSelfAnalysis()}}const ke=i.HP((e=>new Se(e)));function we(e){const t=/unexpected character: ->(.+)<- at offset/.exec(e.message);if(null!==t)return{type:N.$E.InvalidCharacter,character:t[1],offset:e.offset};if("unclosed string literal"===e.message)return{type:N.$E.UnclosedStringLiteral,offset:e.offset};if("unclosed comment"===e.message)return{type:N.$E.UnclosedComment,offset:e.offset};throw new Error(`Unhandled chevrotain recognition error: ${e.message}`)}const xe={RParen:")",RBracket:"]",Colon:":"};function Ie(e){const t=e.token.tokenType===ye.sd?"eof":e.token.startOffset;switch(e.name){case"MismatchedTokenException":{const n=/Expecting token of type --> (.+) <-- but found/.exec(e.message);if(null!==n){const e=n[1],o=xe[e];if(void 0!==o)return{type:N.$E.TokenExpected,token:o,offset:t}}break}case"NoViableAltException":{const n=e.context.ruleStack[e.context.ruleStack.length-1];switch(n){case"primaryExpression":return{type:N.$E.ExpressionExpected,offset:t};case"dotMemberExpression":return{type:N.$E.PropertyTokenOrFunctionExpected,offset:t}}throw new Error(`Unhandled unviable alt: ${n}`)}case"NotAllInputParsedException":return{type:N.$E.EndOfInputExpected,offset:t}}return{type:N.$E.UnexpectedError,error:new Error(`Unhandled chevrotain recognition error: ${e.name}`),offset:t}}const Ce=new RegExp(/\\([\\nt"])/g);function Te(e){return e.find((e=>void 0!==e&&!isNaN(e)))}function Me(e){const t=function(){const e=be(),t=ke(e).getBaseCstVisitorConstructor();return new class extends t{constructor(){super(),this.validateVisitor()}expression(e){return this.visit(e.conditionalExpression)}primaryExpression(e){if(void 0!==e.parenthesisExpression)return this.visit(e.parenthesisExpression);if(void 0!==e.arrayExpression)return this.visit(e.arrayExpression);if(void 0!==e.NumberLiteral)return{kind:N.bG.Number,text:e.NumberLiteral[0].image,startOffset:e.NumberLiteral[0].startOffset,endOffset:e.NumberLiteral[0].endOffset};if(void 0!==e.StringLiteral){const t=e.StringLiteral[0].image.slice(1,-1).replace(Ce,((e,t)=>{switch(t){case"n":return"\n";case"t":return"\t";default:return t}}));return{kind:N.bG.String,text:t,startOffset:e.StringLiteral[0].startOffset,endOffset:e.StringLiteral[0].endOffset}}return void 0!==e.UnclosedStringLiteral?{kind:N.bG.String,text:e.UnclosedStringLiteral[0].image.substring(1,e.UnclosedStringLiteral[0].image.length),startOffset:e.UnclosedStringLiteral[0].startOffset,endOffset:e.UnclosedStringLiteral[0].endOffset}:void 0!==e.BooleanLiteral?{kind:N.bG.Boolean,text:e.BooleanLiteral[0].image,startOffset:e.BooleanLiteral[0].startOffset,endOffset:e.BooleanLiteral[0].endOffset}:void 0!==e.InputToken?{kind:N.bG.NotionToken,token:e.InputToken[0].payload,startOffset:e.InputToken[0].startOffset,endOffset:e.InputToken[0].endOffset}:void 0!==e.IdentifierName?{kind:N.bG.Identifier,text:e.IdentifierName[0].image,startOffset:e.IdentifierName[0].startOffset,endOffset:e.IdentifierName[0].endOffset}:{kind:N.bG.RecoveryNode,startOffset:-1,endOffset:-1}}conditionalExpression(e){const t=this.visit(e.condition[0]);var n,o,r,i;return void 0!==e.QuestionMark?{kind:N.bG.Conditional,condition:t,expIfTrue:this.visit(e.expIfTrue[0]),expIfFalse:void 0!==(null===(n=e.expIfFalse)||void 0===n?void 0:n[0])?this.visit(e.expIfFalse[0]):void 0,startOffset:e.condition[0].location.startOffset,endOffset:Te([null===(o=e.expIfFalse)||void 0===o||null===(o=o[0].location)||void 0===o?void 0:o.endOffset,null===(r=e.Colon)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.endOffset,null===(i=e.expIfTrue[0].location)||void 0===i?void 0:i.endOffset,e.QuestionMark[0].endOffset])}:t}logicalOrExpression(e){const t=this.visit(e.lhs[0]);if(void 0!==e.Or){var n,o;const r=(null===(n=e.rhs)||void 0===n?void 0:n.map((e=>this.visit(e))))??[];return{kind:N.bG.LogicalOr,elements:[t,...r],startOffset:e.lhs[0].location.startOffset,endOffset:Te([null===(o=e.rhs)||void 0===o||null===(o=o[e.rhs.length-1])||void 0===o||null===(o=o.location)||void 0===o?void 0:o.endOffset,e.Or[0].endOffset])}}return t}logicalAndExpression(e){const t=this.visit(e.lhs[0]);if(void 0!==e.And){var n,o;const r=(null===(n=e.rhs)||void 0===n?void 0:n.map((e=>this.visit(e))))??[];return{kind:N.bG.LogicalAnd,elements:[t,...r],startOffset:e.lhs[0].location.startOffset,endOffset:Te([null===(o=e.rhs)||void 0===o||null===(o=o[e.rhs.length-1])||void 0===o||null===(o=o.location)||void 0===o?void 0:o.endOffset,e.And[0].endOffset])}}return t}equalityExpression(e){const t=this.visit(e.lhs[0]);if(void 0!==e.EqualityOperator){var n;const o=e.rhs[0];return{kind:N.bG.Equality,op:e.EqualityOperator[0].image,lhs:t,rhs:this.visit(o),startOffset:e.lhs[0].location.startOffset,endOffset:Te([null===(n=o.location)||void 0===n?void 0:n.endOffset,e.EqualityOperator[0].endOffset])}}return t}relationalExpression(e){const t=this.visit(e.lhs[0]);if(void 0!==e.RelationalOperator){var n;const o=e.rhs[0];return{kind:N.bG.Relational,op:e.RelationalOperator[0].image,lhs:t,rhs:this.visit(o),startOffset:e.lhs[0].location.startOffset,endOffset:Te([null===(n=o.location)||void 0===n?void 0:n.endOffset,e.RelationalOperator[0].endOffset])}}return t}additionExpression(e){let t=this.visit(e.lhs[0]);if(void 0!==e.AdditionOperator)for(let o=0;o<e.AdditionOperator.length;o++){var n;const r=e.rhs[o];t={kind:N.bG.Additive,op:e.AdditionOperator[o].image,lhs:t,rhs:this.visit(r),startOffset:e.lhs[0].location.startOffset,endOffset:Te([null===(n=r.location)||void 0===n?void 0:n.endOffset,e.AdditionOperator[o].endOffset])}}return t}multiplicationExpression(e){let t=this.visit(e.lhs[0]);if(void 0!==e.MultiplicationOperator)for(let o=0;o<e.MultiplicationOperator.length;o++){var n;const r=e.rhs[o];t={kind:N.bG.Multiplicative,op:e.MultiplicationOperator[o].image,lhs:t,rhs:this.visit(r),startOffset:e.lhs[0].location.startOffset,endOffset:Te([null===(n=r.location)||void 0===n?void 0:n.endOffset,e.MultiplicationOperator[o].endOffset])}}return t}exponentiationExpression(e){let t;const n=this.visit(e.lhs[0]);if(void 0!==e.Caret){var o;const r=e.Caret.length-1;let i,a=null===(o=e.rhs[r].location)||void 0===o?void 0:o.endOffset;(void 0===a||isNaN(a))&&(a=e.Caret[r].endOffset);for(let n=e.Caret.length-1;n>=0;n--){const o=e.rhs[n];t=void 0===i?this.visit(o):{kind:N.bG.Exponentiation,op:i,lhs:this.visit(o),rhs:t,startOffset:o.location.startOffset,endOffset:a},i=e.Caret[n].image}return{kind:N.bG.Exponentiation,op:i,lhs:n,rhs:t,startOffset:e.lhs[0].location.startOffset,endOffset:a}}return n}unaryExpression(e){let t=this.visit(e.primaryExpression[0]),n=e.primaryExpression[0].location.startOffset;const o=void 0!==e.UnaryOperator&&"-"===e.UnaryOperator[0].image&&t.kind===N.bG.Number;var r;if(o&&(t={kind:N.bG.Unary,op:e.UnaryOperator[0].image.toLowerCase(),expression:t,startOffset:e.UnaryOperator[0].startOffset,endOffset:t.endOffset}),isNaN(n)&&(n=null===(r=e.memberCallSubExpression)||void 0===r?void 0:r[0].location.startOffset),void 0!==e.memberCallSubExpression)for(const l of e.memberCallSubExpression){const e=l.location.endOffset;if(void 0!==l.children.callArguments){var i,a,s;const o=l.children.callArguments[0].children;t={kind:N.bG.Call,expression:t,arguments:(null===(i=l.children.callArguments[0])||void 0===i||null===(i=i.children.expression)||void 0===i?void 0:i.map((e=>this.visit(e))))??[],lParenOffset:o.LParen[0].startOffset,rParenOffset:null===(a=o.RParen)||void 0===a?void 0:a[0].startOffset,commaOffsets:(null===(s=o.Comma)||void 0===s?void 0:s.map((e=>e.startOffset)))??[],startOffset:n,endOffset:e}}else if(void 0!==l.children.dotMemberExpression){const o=l.children.dotMemberExpression[0].children;if(void 0!==o.IdentifierName){const r=o.IdentifierName[0];t={kind:N.bG.UnifiedFunctionProperty,expression:t,name:r.image,nameStartOffset:r.startOffset,nameEndOffset:r.endOffset,startOffset:n,endOffset:e}}else if(void 0!==o.InputToken){const r=o.InputToken[0],i=r.payload;if(i.type===_.Oy.BlockProperty){if((0,O.Xp)(i))throw new Error("unexpected block property context value in unaryExpression");t={kind:N.bG.MemberBlockProperty,expression:t,propertyToken:void 0===i.collection?{property:i.property,collection:void 0}:{property:i.property,collection:i.collection},propertyStartOffset:r.startOffset,propertyEndOffset:r.endOffset,startOffset:n,endOffset:e}}}}}return void 0===e.UnaryOperator||o?t:{kind:N.bG.Unary,op:e.UnaryOperator[0].image.toLowerCase().trimEnd(),expression:t,startOffset:e.UnaryOperator[0].startOffset,endOffset:t.endOffset}}parenthesisExpression(e){return this.visit(e.expression[0])}arrayExpression(e){var t,n,o,r,i;return{kind:N.bG.Array,elements:(null===(t=e.expression)||void 0===t?void 0:t.map((e=>this.visit(e))))??[],lBracketOffset:e.LBracket[0].startOffset,rBracketOffset:null===(n=e.RBracket)||void 0===n?void 0:n[0].startOffset,commaOffsets:(null===(o=e.Comma)||void 0===o?void 0:o.map((e=>e.startOffset)))??[],startOffset:e.LBracket[0].startOffset,endOffset:Te([null===(r=e.RBracket)||void 0===r?void 0:r[0].endOffset,null===(i=e.expression)||void 0===i||null===(i=i[e.expression.length-1])||void 0===i||null===(i=i.location)||void 0===i?void 0:i.endOffset,e.LBracket[0].endOffset])}}memberCallSubExpression(e){throw new Error("unexpected memberCallSubExpression")}dotMemberExpression(e){throw new Error("unexpected dotMemberExpression")}callArguments(e){throw new Error("unexpected callArguments")}}}();try{return{value:t.visit(e)}}catch(n){return{error:{type:N.$E.UnexpectedError,error:(0,r.t)(n),offset:0}}}}function Pe(e,t){const n=be(),o=_e(n).tokenize(e),r=[];for(const s of o.errors)r.push(we(s));for(const s of o.tokens.filter((e=>e.tokenType===n.UnclosedStringLiteral||e.tokenType===n.UnclosedComment)))r.push({type:s.tokenType===n.UnclosedStringLiteral?N.$E.UnclosedStringLiteral:N.$E.UnclosedComment,offset:t?(0,k.aU)(t,s.startOffset,"left"):s.startOffset});for(const s of o.tokens.filter((e=>e.tokenType===n.StringLiteral)))_.zF.test(s.image)&&r.push({type:N.$E.StringLiteralContainsToken,offset:t?(0,k.aU)(t,s.startOffset,"left"):s.startOffset});const i=ke(n);i.input=o.tokens;const a=i.expression();for(const s of i.errors)r.push(Ie(s));return[a,r]}const Ae=new WeakMap;function Re(e){let t=Ae.get(e);if(void 0!==t)return t;const[n,o]=(0,k.dJ)(e),[r,i]=Pe(n);return t=i.length>0?{error:i[0]}:Me(r),Ae.set(e,t),t}const De=3e5;function Be(e,t,n){if("number"!==t.type&&"undefined"!==t.type)throw new N.WV({type:N.FY.CannotDoMathOnType,op:n,operand:e,valueType:t.type})}const Ee=15;function*Fe(e,t){if(t.depth>Ee)throw new N.WV({type:N.FY.DepthExceeded});if(t.formulaTimeoutTimestampMs&&Date.now()>t.formulaTimeoutTimestampMs)throw t.logFormulaTimeoutFn&&t.logFormulaTimeoutFn(),new N.WV({type:N.FY.MaxEvaluationTimeExceeded});switch(e.kind){case N.bG.Number:return{type:"number",value:parseFloat(e.text)};case N.bG.String:return{type:"text",value:[[e.text]]};case N.bG.Boolean:return{type:"checkbox",value:"true"===e.text.toLowerCase()};case N.bG.NotionToken:{const o=e.token;switch(o.type){case _.Oy.Checkbox:return{type:"checkbox",value:o.checked};case _.Oy.BlockProperty:{if((0,O.Xp)(o)){const n=t.values.find((e=>e.kind===_.yp.ContextValue&&e.id===(0,O.Kv)(o.contextValueId)));if(void 0===n)throw new N.WV({type:N.FY.MissingContextVariable,node:e,valueId:o.contextValueId});if("block"!==n.value.type)throw new N.WV({type:N.FY.ContextVariableWrongType,node:e,valueId:o.contextValueId,expectedType:"block",resultType:n.value.type});const r=n.value.value,i=(yield{recordPointers:[r]}).getRecordModel(r);if(void 0===i)throw new N.WV({type:N.FY.MissingDataDependencyBlock,node:e,blockPointer:r});const a=(0,O.SR)(o.property),s=yield*(0,S.co)(i);if(!s)throw new N.WV({type:N.FY.MissingDataDependencyBlock,node:e,blockPointer:i.pointer});const l=null==s?void 0:s.getNormalizedSchema(),c=null==l?void 0:l[a];if(void 0===s||void 0===c||void 0===l)throw new N.WV({type:N.FY.MissingSchemaPropertyOnCollection,node:e,collectionId:i.getParentId(),property:a});return yield*Ue({block:i,parentCollectionModel:s,property:a,schema:l,propertySchema:c,oldContext:t})}const n=t.values.find((e=>e.kind===_.yp.ThisRow));if("block"!==(null==n?void 0:n.value.type))throw new N.WV({type:N.FY.MissingThisRow,node:e});const r=n.value.value,i=(yield{recordPointers:[r]}).getRecordModel(r);if(void 0===i)throw new N.WV({type:N.FY.MissingThisRow,node:e});if(void 0===o.collection)return(0,O.SQ)(i,o.property);const a=(0,O.SR)(o.property),s=yield*(0,S.co)(i);if(!s)throw new N.WV({type:N.FY.MissingDataDependencyBlock,node:e,blockPointer:i.pointer});if(!(0,f.qo)(o.collection,s))throw new N.WV({type:N.FY.ThisRowBlockPropertyMismatchCollection,node:e,thisRowCollection:s});const l=null==s?void 0:s.getNormalizedSchema(),c=null==l?void 0:l[a];if(void 0===s||void 0===c||void 0===l)throw new N.WV({type:N.FY.MissingSchemaPropertyOnThisRow,node:e,collectionId:i.getParentId(),property:a});return yield*Ue({block:i,parentCollectionModel:s,property:a,schema:l,propertySchema:c,oldContext:t})}case _.Oy.Block:return{type:"block",value:{table:h.iU,id:o.blockId,spaceId:o.spaceId}};case _.Oy.ContextValue:{var n;const r=null===(n=t.values.find((e=>e.kind===_.yp.ContextValue&&e.id===(0,O.Kv)(o.valueId))))||void 0===n?void 0:n.value;if(void 0===r)throw new N.WV({type:N.FY.MissingContextVariable,node:e,valueId:o.valueId});return r}case _.Oy.Date:return{type:"date",value:o.date};case _.Oy.Person:return{type:"person",value:{table:y.KJ,id:o.userId}};default:return(0,s.t1)(o)}}case N.bG.Identifier:{var o;const n=null===(o=t.values.find((t=>t.kind===_.yp.Binding&&t.id===e.text)))||void 0===o?void 0:o.value;if(void 0!==n)return n;if(ge.hasOwnProperty(e.text))return{type:"function",function:ge[e.text]};throw new N.WV({type:N.FY.IdentifierNotFound,node:e})}case N.bG.Array:return{type:"array",values:yield*(0,S.LD)(e.elements.map((e=>Fe(e,t))))};case N.bG.Conditional:{const n=yield*Fe(e.condition,t);return(0,O.vh)(n)?yield*Fe(e.expIfTrue,t):yield*Fe(e.expIfFalse,t)}case N.bG.LogicalOr:return{type:"checkbox",value:(yield*(0,S.LD)(e.elements.map((e=>Fe(e,t))))).map(O.vh).some((e=>e))};case N.bG.LogicalAnd:return{type:"checkbox",value:(yield*(0,S.LD)(e.elements.map((e=>Fe(e,t))))).map(O.vh).every((e=>e))};case N.bG.Equality:{const[n,o]=yield*(0,S.LD)([Fe(e.lhs,t),Fe(e.rhs,t)]),r=yield*(0,O.Jr)(n,o,t),i=e.op;switch(i){case"==":return{type:"checkbox",value:r};case"!=":return{type:"checkbox",value:!r};default:return(0,s.t1)(i)}}case N.bG.Relational:{const[n,o]=yield*(0,S.LD)([Fe(e.lhs,t),Fe(e.rhs,t)]);if("undefined"===n.type||"undefined"===o.type)return{type:"checkbox",value:!1};if("date"===n.type&&"date"===o.type){const r=(0,O.SU)(n.value,o.value,t.userTimeZone);switch(e.op){case"<":return{type:"checkbox",value:r<0};case"<=":return{type:"checkbox",value:r<=0};case">":return{type:"checkbox",value:r>0};case">=":return{type:"checkbox",value:r>=0}}}if("text"===n.type&&"text"===o.type){const[r,i]=yield*(0,O.zA)([n.value,o.value],t);switch(e.op){case"<":return{type:"checkbox",value:r<i};case"<=":return{type:"checkbox",value:r<=i};case">":return{type:"checkbox",value:r>i};case">=":return{type:"checkbox",value:r>=i}}}if("number"===n.type&&"number"===o.type||"checkbox"===n.type&&"checkbox"===o.type)switch(e.op){case"<":return{type:"checkbox",value:n.value<o.value};case"<=":return{type:"checkbox",value:n.value<=o.value};case">":return{type:"checkbox",value:n.value>o.value};case">=":return{type:"checkbox",value:n.value>=o.value}}throw new N.WV({type:N.FY.CannotRelativelyCompareTypes,lhs:e.lhs,rhs:e.rhs,lhsType:n.type,rhsType:o.type})}case N.bG.Additive:{let[n,o]=yield*(0,S.LD)([Fe(e.lhs,t),Fe(e.rhs,t)]);if("undefined"===n.type&&"undefined"===o.type)return{type:"number",value:0};switch("undefined"===n.type&&"number"===o.type?n={type:"number",value:0}:"undefined"===o.type&&"number"===n.type&&(o={type:"number",value:0}),e.op){case"+":return"number"===n.type&&"number"===o.type?{type:"number",value:i.NM(n.value+o.value,12)}:{type:"text",value:(0,b.Zxt)((0,O.j4)(n).concat((0,O.j4)(o)))};case"-":if(Be(e.lhs,n,e.op),Be(e.rhs,o,e.op),"number"===n.type&&"number"===o.type)return{type:"number",value:i.NM(n.value-o.value,12)}}return{type:"undefined"}}case N.bG.Multiplicative:{let[n,o]=yield*(0,S.LD)([Fe(e.lhs,t),Fe(e.rhs,t)]);if(Be(e.lhs,n,e.op),Be(e.rhs,o,e.op),"undefined"===n.type&&"undefined"===o.type)return{type:"number",value:0};switch("undefined"===n.type&&"number"===o.type?n={type:"number",value:0}:"undefined"===o.type&&"number"===n.type&&(o={type:"number",value:0}),e.op){case"*":if("number"===n.type&&"number"===o.type)return{type:"number",value:i.NM(n.value*o.value,12)};break;case"/":if("number"===n.type&&"number"===o.type)return 0===o.value?{type:"undefined"}:{type:"number",value:i.NM(n.value/o.value,12)};break;case"%":if("number"===n.type&&"number"===o.type)return{type:"number",value:n.value%o.value}}return{type:"undefined"}}case N.bG.Exponentiation:{const[n,o]=yield*(0,S.LD)([Fe(e.lhs,t),Fe(e.rhs,t)]);if(Be(e.lhs,n,e.op),Be(e.rhs,o,e.op),"^"===e.op)if("number"===n.type&&"number"===o.type)return{type:"number",value:i.NM(n.value**o.value,12)};return{type:"undefined"}}case N.bG.Unary:{const n=yield*Fe(e.expression,t),o=e.op;switch(o){case"-":if("number"!==n.type)throw new N.WV({type:N.FY.UnaryMinusOnNonNumber,node:e.expression,expressionType:n.type});return{type:"number",value:-n.value};case"!":case"not":return{type:"checkbox",value:!(0,O.vh)(n)};default:return(0,s.t1)(o)}}case N.bG.Call:{const n=yield*Fe(e.expression,t);if("function"!==n.type)throw new N.WV({type:N.FY.CannotCallNonFunction,node:e,calleeType:n.type});const o=n.function,i=(0,O.P2)(o),a=void 0!==n.boundTarget?[n.boundTarget,...e.arguments]:e.arguments;if(a.length<i)throw new N.WV({type:N.FY.FunctionCallTooFewArguments,node:e,libraryFunction:o,numArguments:a.length});const s=yield*(0,S.LD)(a.map(((n,r)=>function*(e,t,n,o,r){const i=(0,O.J3)(o,n);if(void 0===i)throw new N.WV({type:N.FY.FunctionCallUnexpectedArgument,node:e,argument:t,libraryFunction:o,parameterIndex:n});if(!Array.isArray(i.type)&&"expression"===i.type.type)return t;const a=yield*Fe(t,r);if(!(0,O.mB)(a,i.type)){if(Array.isArray(i.type)?i.type.some((e=>"checkbox"===e.type)):"checkbox"===i.type.type)return{type:"checkbox",value:(0,O.vh)(a)};if(Array.isArray(i.type)?i.type.some((e=>"text"===e.type)):"text"===(0,O.B8)(i.type).type)return"array"===a.type&&(Array.isArray(i.type)?i.type.some((e=>"array"===e.type)):"array"===i.type.type)?{type:"array",values:a.values.map((e=>({type:"text",value:(0,O.j4)(e)})))}:"array"===a.type&&0===a.values.length?{type:"text",value:[[""]]}:{type:"text",value:(0,O.j4)(a)};if(!_.zq.includes(o.name)&&!_.Rc.includes(o.name))throw new N.WV({type:N.FY.FunctionCallArgumentWrongType,node:e,argument:t,libraryFunction:o,parameterIndex:n,argumentType:a.type})}return a}(e,n,r,o,t))));try{return yield*o.eval(s,t)}catch(r){if(r instanceof N.WV)throw r;throw new N.WV({type:N.FY.LibraryFunctionExecutionError,node:e,libraryFunction:o,error:r})}}case N.bG.UnifiedFunctionProperty:if(ge.hasOwnProperty(e.name))return{type:"function",function:ge[e.name],boundTarget:e.expression};throw new N.WV({type:N.FY.UnifiedFunctionPropertyNotFound,node:e});case N.bG.MemberBlockProperty:{const n=yield*Fe(e.expression,t);if("undefined"===n.type)return{type:"undefined"};if("block"!==n.type)throw new N.WV({type:N.FY.AccessingPropertyOnNonBlock,node:e,expressionValue:n});const o=(yield{recordPointers:[n.value]}).getRecordModel(n.value);if(void 0===o)throw new N.WV({type:N.FY.MissingDataDependencyBlock,node:e,blockPointer:n.value});if(void 0===e.propertyToken.collection)return(0,O.SQ)(o,e.propertyToken.property);const r=yield*(0,S.co)(o);if(!r)throw new N.WV({type:N.FY.MissingDataDependencyBlock,node:e,blockPointer:o.pointer});const i=(0,O.SR)(e.propertyToken.property);if(!(0,f.qo)(e.propertyToken.collection,r))throw new N.WV({type:N.FY.MemberPropertyMismatchCollection,node:e,blockCollection:r});const a=null==r?void 0:r.getNormalizedSchema(),s=null==a?void 0:a[i];if(void 0===r||void 0===s||void 0===a)throw new N.WV({type:N.FY.MissingPropertyOnSchemaForMemberProperty,node:e});return yield*Ue({block:o,property:i,parentCollectionModel:r,schema:a,propertySchema:s,oldContext:t})}case N.bG.RecoveryNode:throw new N.WV({type:N.FY.UnexpectedRecoveryNode,recovery:e});default:(0,s.t1)(e)}}async function Ze(e,t,n){try{t.formulaTimeoutTimestampMs=t.formulaTimeoutTimestampMs??Date.now()+De;const n=Fe(e,t);let o=n.next();for(;!o.done;){const e=t.handleDataRequest(o.value);o=n.next((0,a.tI)(e)?await e:e)}return{value:o.value}}catch(o){if(o instanceof N.WV){const e=o.info;return n&&(0,O.w7)(e)?{error:{...e,node:(0,k.tE)(e.node,n)}}:{error:e}}return{error:{type:N.FY.UnexpectedError,error:(0,r.t)(o)}}}}function Ue(e){let{block:t,property:n,parentCollectionModel:r,schema:a,propertySchema:f,oldContext:y}=e;return function*(){if("rollup"===f.type){const o=`${t.id}:${n}`;if(y.visitedProperties.has(o))throw new N.WV({type:N.FY.CycleDetected});const s=new Set(y.visitedProperties);s.add(o);const l=(0,d.XU)({resultCache:y.resultCache,blockId:t.id,property:n});if(void 0!==l)return l;const c={...y,visitedProperties:s,depth:y.depth+1};if(f.aggregation&&"show_unique"!==f.aggregation){var e;const o=yield*(0,S._z)(n,a),{relation_property:i}=f;if(null==o||!o.targetCollectionPointer||!i)return{type:"undefined"};const s=(0,u.rq)(null===(e=t.getProperties())||void 0===e?void 0:e[i]);if(void 0===s)return{type:"undefined"};s.push(o.targetCollectionPointer),s.push(t.pointer);const{getRecordModel:l}=yield{recordPointers:s,collectionBlockProperties:[{blockPointers:[t.pointer],collectionPointer:r.pointer,schema:a,property:n}]},m={error:null},g=(0,p.O0)({property:n,schema:a,block:t,getRecordModel:l,collectionRequestContext:{...c,userId:void 0},formula2Error:m});if(null!==m.error)throw m.error;if(void 0===g)return{type:"undefined"};const h=function(e){if(void 0===e.value)return{type:"undefined"};switch(e.type){case"text":return{type:"text",value:(0,b.TPx)(e.value)};case"number":return{type:"number",value:e.value};case"date":return{type:"date",value:e.value}}}(g);return(0,d.j1)({resultCache:c.resultCache,blockId:t.id,property:n,value:h}),h}{var k;const e=yield*(0,S._z)(n,a),{relation_property:o}=f;if(void 0===e||void 0===o)return{type:"undefined"};const{relationPropertySchema:r,targetCollectionSchema:s,targetCollectionModel:l,targetProperty:p}=e,g=(0,u.rq)(null===(k=t.getProperties())||void 0===k?void 0:k[o]),h=yield*(0,S.Ec)(g,r);if(0===h.length){const e={type:"array",values:[]};return(0,d.j1)({resultCache:c.resultCache,blockId:t.id,property:n,value:e}),e}const v=yield*(0,S.LD)(h.flatMap((e=>{const t=s[p];if(void 0===t)return[];const n={kind:_.yp.ThisRow,value:{type:"block",value:e.pointer}};return c.values=[n],[Ue({block:e,property:p,parentCollectionModel:l,schema:s,propertySchema:t,oldContext:c})]}))),b=(0,O.Yw)({type:"array",values:v});if(b.values.length&&"show_unique"===f.aggregation){g.push(t.pointer);const{getRecordModel:e}=yield{recordPointers:g},o=(0,d.XU)({resultCache:y.resultCache,blockId:t.id,property:n});if(void 0!==o)return o;const r=i.mN(b.values,(t=>(0,m.QT)({result:t,getRecordModel:e,userTimeZone:c.userTimeZone,intl:c.intl}))),a={type:"array",values:r};return(0,d.j1)({resultCache:c.resultCache,blockId:t.id,property:n,value:a}),a}const w={type:"array",values:b.values};return(0,d.j1)({resultCache:c.resultCache,blockId:t.id,property:n,value:w}),w}}if("formula"===f.type){const e=`${t.id}:${n}`;if(y.visitedProperties.has(e))throw new N.WV({type:N.FY.CycleDetected});const i=new Set(y.visitedProperties);if("v2"===f.version){i.add(e);const o=(0,d.XU)({resultCache:y.resultCache,blockId:t.id,property:n});if(void 0!==o)return o}const s={...y,visitedProperties:i,depth:y.depth+1};if(void 0!==f.version){var w;const e=null===(w=f.formula2)||void 0===w?void 0:w.code;if(!e)return{type:"undefined"};const r=(0,d.XU)({resultCache:s.resultCache,blockId:t.id,property:n});if(void 0!==r)return r;const i=Re(e);if(o.x.isFail(i))return{type:"undefined"};const a={kind:_.yp.ThisRow,value:{type:"block",value:t.pointer}};s.values=[a];const l=yield*Fe(i.value,s);return(0,d.j1)({resultCache:s.resultCache,blockId:t.id,property:n,value:l}),l}{const{getRecordModel:e}=yield{collectionBlockProperties:[{blockPointers:[t.pointer],collectionPointer:r.pointer,schema:a,property:n}]},o={error:null},i=(0,ve.AH)({schema:a,property:n,block:t,getRecordModel:e,collectionRequestContext:{userId:void 0,userTimeZone:s.userTimeZone,intl:s.intl,depth:s.depth,resultCache:s.resultCache,logFormulaTimeoutFn:s.logFormulaTimeoutFn,visitedProperties:s.visitedProperties},formula2Error:o});if(null!==o.error)throw o.error;switch(typeof i){case"string":return{type:"text",value:(0,b.TPx)(i)};case"number":return{type:"number",value:i};case"boolean":return{type:"checkbox",value:i};case"object":return{type:"date",value:i};default:return{type:"undefined"}}}}else if(_.WG.includes(f.type))return(0,O.SQ)(t,f.type);const x=(0,u.fp)(t,n,r),I=yield{recordPointers:[r.pointer,...null!=x&&x.eoipPointer?[x.eoipPointer]:[]]},C=(0,u.wS)(t,n,I.getRecordModel);if("status"===f.type){const e=(0,u.ZG)(C,f);return void 0===e?{type:"undefined"}:{type:"text",value:(0,b.TPx)(e)}}if("checkbox"===f.type&&void 0===C)return{type:"checkbox",value:!1};if(("relation"===f.type||"multi_select"===f.type)&&void 0===C)return{type:"array",values:[]};if("person"===f.type&&void 0===C){const e=t.getCreatedByPointer();return"created_by"===f.default&&void 0!==e&&(0,l.Wk)(e)?{type:"array",values:[{type:"person",value:e}]}:{type:"array",values:[]}}if(void 0===C)return{type:"undefined"};switch(f.type){case"title":case"text":case"url":case"email":return{type:"text",value:C};case"phone_number":return{type:"text",value:(0,b.TPx)((0,b.Jcv)(C))};case"select":{const e=(0,u.Sj)(C,f.options??[]);return void 0===e?{type:"undefined"}:{type:"text",value:(0,b.TPx)(e)}}case"multi_select":return{type:"array",values:(0,u.uP)(C,f.options??[]).map((e=>({type:"text",value:(0,b.TPx)(e)})))};case"checkbox":return{type:"checkbox",value:(0,u.Ml)(C)};case"date":{const e=(0,u.Gl)(C);return void 0===e?{type:"undefined"}:{type:"date",value:e}}case"person":return{type:"array",values:(0,u.DW)({textValue:C,propertySchema:f,blockCreatorPointer:void 0}).map((e=>({type:"person",value:e})))};case"relation":return{type:"array",values:(yield*(0,S.Ec)((0,u.rq)(C),f)).map((e=>({type:"block",value:{table:h.iU,id:e.id,spaceId:e.getSpaceId()}})))};case"number":const e=(0,u.VY)(C);return"number"==typeof e?{type:"number",value:e}:{type:"undefined"};case"auto_increment_id":{var T;const e=yield*(0,S.co)(t);if(!e)return{type:"undefined"};const{getRecordModel:n}=yield{recordPointers:[t.pointer]},o=null===(T=n((0,g.We)({spaceId:t.getSpaceId(),parentTable:v.vF,parentId:e.id})))||void 0===T?void 0:T.getRecordKey(),r=(0,u.VY)(C),i=(0,c.wf)(o,r);return void 0!==i?{type:"text",value:[[i]]}:{type:"undefined"}}case"file":return{type:"array",values:(0,u.g)(C).map((e=>{let{url:t}=e;return{type:"text",value:(0,b.TPx)(t)}}))};case"created_time":case"last_edited_time":case"created_by":case"last_edited_by":case"last_visited_time":case"button":case"location":case"verification":return{type:"undefined"};default:(0,s.t1)(f)}}()}var Ve=n(991905);const Ne={slice:"substring",start:"dateStart",end:"dateEnd"},Oe={unaryMinus:"-",unaryPlus:"+",larger:">",largerEq:">=",smaller:"<",smallerEq:"<="},Le=["add","subtract","multiply","divide","pow","mod","equal","unequal","larger","largerEq","smaller","smallerEq"];function je(e,t,n){return o=e,r=Ke(e,t,n),"conditional"===o.type||"function"===o.type&&(Le.includes(o.name)||["unaryPlus","unaryMinus"].includes(o.name))||"operator"===o.type&&void 0!==o.args&&o.args.length>=2?[["("],...r,[")"]]:r;var o,r}function Ke(e,t,n){switch(e.type){case"conditional":return[["if("],...je(e.condition,t,n),[", "],...je(e.true,t,n),[", "],...je(e.false,t,n),[")"]];case"constant":switch(e.value_type){case"number":return(0,b.TPx)(`${e.value}`);case"string":const t=e.value.replace(/\n/g,"\\n").replace(/"/g,'\\"').replace(/\t/g,"\\t");return(0,b.TPx)(`"${t}"`);case"boolean":return(0,b.TPx)(""+(e.value?"true":"false"));default:throw new Error(`unexpected constant type: ${e.value_type}`)}case"function":if(Le.includes(e.name)){const o="equal"===e.name?"==":"concat"===e.name?"+":Ve.Gn[e.name].operator;return[...je(e.args[0],t,n),[` ${o} `],...je(e.args[1],t,n)]}switch(e.name){case"unaryMinus":return[["-"],...je(e.args[0],t,n)];case"unaryPlus":return[["toNumber("],...Ke(e.args[0],t,n),[")"]];case"month":return[["month("],...Ke(e.args[0],t,n),[") - 1"]];case"day":return[["day("],...Ke(e.args[0],t,n),[") % 7"]];case"concat":return[["("],...(0,D.Z)((e.args??[]).map((e=>Ke(e,t,n))),(()=>[[" + "]])).flat(),[")"]];case"join":return[["join("],["["],...(0,D.Z)((e.args??[]).slice(1).map((e=>Ke(e,t,n))),(()=>[[", "]])).flat(),["]"],[", "],...Ke(e.args[0],t,n),[")"]];default:if("id"===e.name)return(0,b.TPx)("id()");const o=Ne[e.name]??e.name;if(void 0===ge[o])throw new Error(`unexpected formula: ${o}`);return[[`${o}(`],...(0,D.Z)((e.args??[]).map((e=>Ke(e,t,n))),(()=>[[", "]])).flat(),[")"]]}case"operator":var o,r;if(1===(null===(o=e.args)||void 0===o?void 0:o.length))switch(e.operator){case"not":return[["!"],...je(e.args[0],t,n)];case"+":return[["toNumber("],...Ke(e.args[0],t,n),[")"]];default:return[[`${e.operator}`],...je(e.args[0],t,n)]}if(2===(null===(r=e.args)||void 0===r?void 0:r.length))return[...je(e.args[0],t,n),[` ${e.operator} `],...je(e.args[1],t,n)];if("?"===e.operator)return[...je(e.args[0],t,n),[" ? "],...je(e.args[0],t,n),[" : "],...je(e.args[0],t,n)];throw new Error(`unhandled operator: ${e.operator}`);case"symbol":switch(e.name){case"pi":return(0,b.TPx)("pi()");case"e":return(0,b.TPx)("e()");case"true":return(0,b.TPx)("true");case"false":return(0,b.TPx)("false");default:throw new Error(`unexpected constant: ${e.name}`)}case"property":{const o=n[e.id];if(void 0===o)return[[e.name]];const r=(0,b.YCD)((0,b.kbv)({collection:t,property:e.id,name:o.name}));switch(o.type){case"person":case"relation":return[["join(map("],r,[', format(current)), ", ")']];case"rollup":return o.aggregation&&"show_unique"!==o.aggregation?[r]:[["join(map("],r,[', format(current)), ",")']];case"file":case"multi_select":return[["join("],r,[', ", ")']];case"auto_increment_id":return[r,[".split('-').last().toNumber()"]];default:return[r]}}case"error":throw new Error("unexpected formula error node")}}var ze=n(773717);function*qe(e,t){var n,o;if(e.id===(null===(n=t.publicPageDataCollection)||void 0===n?void 0:n.id))return null===(o=t.publicPageDataCollection)||void 0===o?void 0:o.schema;const r=(yield{recordPointers:[e]}).getRecordModel(e);return null==r?void 0:r.getNormalizedSchema()}function*He(e,t){const{valueTypes:n}=t;switch(e.kind){case N.bG.Number:return{node:{...e,type:{type:"number"},valueTypes:n},errors:[]};case N.bG.String:return{node:{...e,type:{type:"text"},valueTypes:n},errors:[]};case N.bG.Boolean:return{node:{...e,type:{type:"checkbox"},valueTypes:n},errors:[]};case N.bG.NotionToken:{const l=e.token;switch(l.type){case _.Oy.Checkbox:return{node:{...e,type:{type:"checkbox"},valueTypes:n},errors:[]};case _.Oy.BlockProperty:{var o;if((0,O.Xp)(l)){const o=n.find((e=>e.kind===_.yp.ContextValue&&e.id===(0,O.Kv)(l.contextValueId)));if(void 0===o)return{node:{...e,type:{type:"unknown"},valueTypes:n},errors:[{type:N.h4.MissingContextVariable,node:e,token:l}]};const i=o.type;if("block"!==i.type||void 0===i.collection)return{node:{...e,type:{type:"unknown"},valueTypes:n},errors:[{type:N.h4.ContextVariableNotBlockWithCollection,node:e,token:l}]};const a=yield*qe(i.collection,t),s=(0,O.SR)(l.property),c=null==a?void 0:a[s];if(void 0===c||void 0===a){var r;const o=(null===(r=t.formulaPropertyNames)||void 0===r?void 0:r.get(s))??s;return{node:{...e,type:{type:"unknown"},valueTypes:n},errors:[{type:N.h4.MissingPropertyOnContextVariable,node:e,property:o,token:l}]}}const d=yield*(0,O.IP)(s,a,c);return{node:{...e,type:d??{type:"unknown"},valueTypes:n},errors:void 0===d?[{type:N.h4.BlockPropertyTypeInvalid,node:e,token:l,propertyName:c.name,propertyType:c.type}]:[]}}const a=null===(o=n.find((e=>e.kind===_.yp.ThisRow)))||void 0===o?void 0:o.type;if(void 0===a)return{node:{...e,type:{type:"unknown"},valueTypes:n},errors:[{type:N.h4.ThisRowTypeNotFound,node:e}]};if("block"!==a.type||void 0===a.collection)return{node:{...e,type:{type:"unknown"},valueTypes:n},errors:[{type:N.h4.ThisRowNotBlockWithCollection,node:e}]};if(void 0===l.collection)return{node:{...e,type:_.dy[l.property],valueTypes:n},errors:[]};const s=yield*qe(a.collection,t),c=(0,O.SR)(l.property),d=null==s?void 0:s[c];var i;if(void 0===d||void 0===s)return{node:{...e,type:{type:"unknown"},valueTypes:n},errors:[{type:N.h4.MissingPropertyOnThisRow,node:e,property:(null===(i=t.formulaPropertyNames)||void 0===i?void 0:i.get(c))??c}]};const u=yield*(0,O.IP)(c,s,d);return{node:{...e,type:u??{type:"unknown"},valueTypes:n},errors:void 0===u?[{type:N.h4.MemberPropertyTypeInvalid,node:e,token:l,propertyName:d.name,propertyType:d.type}]:[]}}case _.Oy.ContextValue:{var a;const t=null===(a=n.find((e=>e.kind===_.yp.ContextValue&&e.id===(0,O.Kv)(l.valueId))))||void 0===a?void 0:a.type;return void 0===t?{node:{...e,type:{type:"unknown"},valueTypes:n},errors:[{type:N.h4.MissingContextVariable,node:e,token:l}]}:{node:{...e,type:t,valueTypes:n},errors:[]}}case _.Oy.Block:{const t={table:h.iU,id:l.blockId,spaceId:l.spaceId},o=(yield{recordPointers:[t]}).getRecordModel(t);if(void 0===o)return{node:{...e,type:{type:"unknown"},valueTypes:n},errors:[{type:N.h4.MissingBlock,node:e,token:l}]};const r=o.getCollectionPointer();return{node:{...e,type:{type:"block",collection:r},valueTypes:n},errors:[]}}case _.Oy.Person:return{node:{...e,type:{type:"person"},valueTypes:n},errors:[]};case _.Oy.Date:return{node:{...e,type:{type:"date"},valueTypes:n},errors:[]};default:return(0,s.t1)(l)}}case N.bG.Array:{const o=yield*(0,S.LD)(e.elements.map((e=>He(e,t))));let r={type:"unknown"};if(o.length>0){r=o[0].node.type;for(let e=1;e<o.length;e++)if(!(0,B.Jy)(r,o[e].node.type)){r={type:"unknown"};break}}return{node:{...e,elements:o.map((e=>e.node)),type:{type:"array",of:r},valueTypes:n},errors:o.flatMap((e=>e.errors))}}case N.bG.Identifier:{var l;const t=null===(l=n.find((t=>t.kind===_.yp.Binding&&t.id===e.text)))||void 0===l?void 0:l.type;if(void 0!==t)return{node:{...e,type:t,valueTypes:n},errors:[]};const o=ge.hasOwnProperty(e.text)?ge[e.text]:void 0;if(void 0===o){const t=[{type:N.h4.UndefinedIdentifier,node:e}];return Ne.hasOwnProperty(e.text)?t.push({type:N.h4.RenamedIdentifier,node:e,identifier:e.text,renamedTo:Ne[e.text]}):Oe.hasOwnProperty(e.text)&&t.push({type:N.h4.RemovedFunction,node:e,functionName:e.text,alternative:Oe[e.text]}),{node:{...e,type:{type:"unknown"},valueTypes:n},errors:t}}return{node:{...e,type:{type:"function",libraryFunction:o,calledFromUnifiedFunctionProperty:!1},valueTypes:n},errors:[]}}case N.bG.Conditional:{const o=yield*He(e.condition,t),r=yield*He(e.expIfTrue,t),i=void 0!==e.expIfFalse?yield*He(e.expIfFalse,t):void 0;let a={type:"unknown"};return void 0===r.node.type||void 0!==(null==i?void 0:i.node.type)&&!(0,B.Jy)(r.node.type,i.node.type)||(a=r.node.type),{node:{...e,condition:o.node,expIfTrue:r.node,expIfFalse:null==i?void 0:i.node,type:a,valueTypes:n},errors:[...o.errors,...r.errors??[],...(null==i?void 0:i.errors)??[]]}}case N.bG.LogicalOr:case N.bG.LogicalAnd:const d=yield*(0,S.LD)(e.elements.map((e=>He(e,t)))),u=d.flatMap((e=>e.errors));return{node:{...e,elements:d.map((e=>e.node)),type:{type:"checkbox"},valueTypes:n},errors:u};case N.bG.Equality:case N.bG.Relational:{const o=yield*He(e.lhs,t),r=yield*He(e.rhs,t),i=[...o.errors,...r.errors];if(e.kind===N.bG.Relational){const t=o.node.type,n=r.node.type;"unknown"===t.type||"unknown"===n.type||t.type===n.type&&["number","date","text","checkbox"].includes(t.type)||i.push({type:N.h4.CannotRelativelyCompareTypes,node:e,lhsType:t,rhsType:n})}return{node:{...e,lhs:o.node,rhs:r.node,type:{type:"checkbox"},valueTypes:n},errors:i}}case N.bG.Additive:case N.bG.Multiplicative:case N.bG.Exponentiation:{const o=yield*He(e.lhs,t),r=yield*He(e.rhs,t),i=[...o.errors,...r.errors];if("+"===e.op)return"number"===o.node.type.type&&"number"===r.node.type.type?{node:{...e,lhs:o.node,rhs:r.node,type:{type:"number"},valueTypes:n},errors:i}:{node:{...e,lhs:o.node,rhs:r.node,type:["unknown","number"].includes(o.node.type.type)&&["unknown","number"].includes(r.node.type.type??"unknown")?{type:"unknown"}:{type:"text"},valueTypes:n},errors:i};const a=function(e,t,n){const o=t.type,r=(null==n?void 0:n.type)??{type:"unknown"};if(!["unknown","number"].includes(o.type)||!["unknown","number"].includes(r.type))return{type:N.h4.CannotDoMathOnType,node:e,lhsType:o,rhsType:r}}(e,o.node,r.node);return void 0!==a&&i.push(a),{node:{...e,lhs:o.node,rhs:r.node,type:{type:"number"},valueTypes:n},errors:i}}case N.bG.Unary:{const o=yield*He(e.expression,t),r=[...o.errors];let i;switch(e.op){case"-":["number","unknown"].includes(o.node.type.type)||r.push({type:N.h4.UnaryMinusOnNonNumber,node:e,expression:o.node}),i={type:"number"};break;case"!":case"not":i={type:"checkbox"};break;default:(0,s.t1)(e)}return{node:{...e,expression:o.node,type:i,valueTypes:n},errors:r}}case N.bG.Call:{const{node:o,errors:r}=yield*He(e.expression,t),i=[...r];if(o.kind===N.bG.Identifier&&("lets"===o.text||"let"===o.text)){const r=[];let a=[...n];for(let n=0;n<e.arguments.length-1;n+=2){const o=e.arguments[n],s=e.arguments[n+1];if(o.kind!==N.bG.Identifier){i.push({type:N.h4.IdentifierExpected,node:o});continue}const{node:l,errors:c}=yield*He(s,{...t,valueTypes:a});r[n+1]=l,i.push(...c);const d=o.text;a=[{kind:_.yp.Binding,id:d,name:d,type:l.type},...a],r[n]={...o,type:l.type,valueTypes:a}}const s=e.arguments[e.arguments.length-1];if(!s)return{node:{...e,expression:o,arguments:r,type:{type:"unknown"},valueTypes:a},errors:i};const{node:l,errors:c}=yield*He(s,{...t,valueTypes:a});return r[e.arguments.length-1]=l,i.push(...c),{node:{...e,expression:o,arguments:r,type:l.type,valueTypes:a},errors:i}}["function","unknown"].includes(o.type.type)||i.push({type:N.h4.CallingNotFunction,node:e,callee:o});const a="function"===o.type.type?o.type.libraryFunction:void 0,s="function"===o.type.type?o.type.boundTargetType:void 0;if(void 0!==a){const t=(0,O.P2)(a),n=e.arguments.length+(void 0!==s?1:0);n<t&&("function"===o.type.type&&o.type.calledFromUnifiedFunctionProperty?i.push({type:N.h4.FunctionCallTooFewArguments,node:e,libraryFunction:a,numArguments:n-1,minNumParameters:t-1}):i.push({type:N.h4.FunctionCallTooFewArguments,node:e,libraryFunction:a,numArguments:n,minNumParameters:t}))}const l=[],c=[];void 0!==s&&c.push(s);for(let d=0;d<e.arguments.length;d++){const o=e.arguments[d],r=void 0!==s?d+1:d,u=void 0!==a?(0,O.J3)(a,r):void 0;if(void 0!==a&&void 0===u&&i.push({type:N.h4.FunctionCallUnexpectedArgument,node:e,libraryFunction:a,argument:o,parameterIndex:r}),void 0!==(null==u?void 0:u.augmentScope)){const e=l.map((e=>(null==e?void 0:e.type)??{type:"unknown"})),r=u.augmentScope(void 0!==s?[s,...e]:e),{node:a,errors:p}=yield*He(o,{...t,valueTypes:[...Object.entries(r).map((e=>{let[t,n]=e;return{kind:_.yp.Binding,id:t,type:n}})),...n]});l[d]=a,c.push(a.type),i.push(...p)}else{const{node:n,errors:r}=yield*He(o,t);if(l[d]=n,void 0!==a&&void 0!==u){const t="id"===a.name&&"block"===n.type.type||(0,B.xK)(n.type,u.type);"boolean"==typeof t?(c.push(n.type),t||i.push({type:N.h4.FunctionCallArgumentWrongType,node:e,libraryFunction:a,argument:n,expectedParameter:u})):c.push(t)}else c.push(n.type);i.push(...r)}}return{node:{...e,expression:o,arguments:l,type:void 0!==a?"function"==typeof a.returnType?a.returnType(c):a.returnType:{type:"unknown"},valueTypes:n},errors:i}}case N.bG.UnifiedFunctionProperty:{const o=ge.hasOwnProperty(e.name)?ge[e.name]:void 0,{node:r,errors:i}=yield*He(e.expression,t),a=[...i];let s={type:"unknown"};if(void 0===o)a.push({type:N.h4.UnifiedFunctionCannotFindFunction,node:e,name:e.name});else{const t=(0,O.J3)(o,0);if(void 0===t)a.push({type:N.h4.UnifiedFunctionNoArguments,node:e,libraryFunction:o});else{const n="id"===o.name&&"block"===r.type.type||(0,B.xK)(r.type,t.type);"boolean"==typeof n?(s=r.type,n||a.push({type:N.h4.UnifiedFunctionTargetWrongType,node:e,expression:r,libraryFunction:o})):s=n}}return{node:{...e,expression:r,type:void 0!==o?{type:"function",boundTargetType:s,libraryFunction:o,calledFromUnifiedFunctionProperty:!0}:{type:"unknown"},valueTypes:n},errors:a}}case N.bG.MemberBlockProperty:{const{node:o,errors:r}=yield*He(e.expression,t),i=[...r];let a;if("block"===o.type.type)if(void 0===e.propertyToken.collection)a=_.dy[e.propertyToken.property];else{const n=yield*qe(e.propertyToken.collection,t),r=(0,O.SR)(e.propertyToken.property),s=null==n?void 0:n[r];var c;if(void 0===s||void 0===n)i.push({type:N.h4.MemberPropertyMissing,node:e,property:(null===(c=t.formulaPropertyNames)||void 0===c?void 0:c[r])??r});else if(void 0!==o.type.collection)if((0,f.qo)(e.propertyToken.collection,o.type.collection)){const t=yield*(0,O.IP)(r,n,s);a=t,void 0===t&&i.push({type:N.h4.MemberPropertyTypeInvalid,node:e,token:e.propertyToken,propertyName:s.name,propertyType:s.type})}else i.push({type:N.h4.MemberPropertyMismatchCollection,node:e,token:e.propertyToken})}else"unknown"!==o.type.type&&i.push({type:N.h4.MemberPropertyTargetNotBlock,node:e,expression:o});return{node:{...e,expression:o,type:a??{type:"unknown"},valueTypes:n},errors:i}}case N.bG.RecoveryNode:return{node:{...e,type:{type:"unknown"},valueTypes:n},errors:[]};default:(0,s.t1)(e)}}async function Ge(e,t,n){const o=He(e,t);let r=o.next();for(;!r.done;){const e=t.handleDataRequest(r.value);r=o.next((0,a.tI)(e)?await e:e)}if(!n)return r.value;const i=r.value.errors.map((e=>{const t=(0,ze.sB)(e);return{...e,node:(0,k.tE)(t,n)}}));return{node:r.value.node,errors:i}}function We(e,t,n){const o=He(e,t);let r=o.next();for(;!r.done;){const e=t.handleDataRequest(r.value);r=o.next(e)}if(!n)return r.value;const i=r.value.errors.map((e=>{const t=(0,ze.sB)(e);return{...e,node:(0,k.tE)(t,n)}}));return{node:r.value.node,errors:i}}var $e=n(158573);const Ye=["title","text","url","email","phone_number","checkbox","person","created_by","last_edited_by","select","multi_select","status","number","date","created_time","last_edited_time","last_visited_time","formula","relation","rollup","auto_increment_id"];async function Qe(e,t,n){const o=[],r=new Set;if(void 0!==e){const i=t.handleDataRequest({recordPointers:[e]}),s=((0,a.tI)(i)?await i:i).getRecordModel(e),l=null==s?void 0:s.getNormalizedSchema();if(l)for(const[a,c]of Object.entries(l))void 0!==(null==c?void 0:c.type)&&_.WG.includes(null==c?void 0:c.type)&&r.add(c.type),a!==t.sourceProperty&&null!=c&&c.name&&Ye.includes(null==c?void 0:c.type)&&Je(n,c.name)&&o.push({kind:_.x2.Token,name:c.name,token:{type:_.Oy.BlockProperty,property:(0,O.Uw)(a),collection:e}})}for(const i of Object.values(_.vz)){if(r.has(i))continue;const e=(0,O.Ve)(i);(""===n||Je(n,e))&&o.push({kind:_.x2.Token,token:{type:_.Oy.BlockProperty,property:i,collection:void 0},name:e})}return o}function Je(e,t){return""===e||(0,$e.C6)(e,t)}async function Xe(e){const{prefix:t,context:n,receiverType:o,includeDeprecatedCompletions:r,dotMemberExpression:i}=e,a=[],s=[],l=[],c=new Set;if(void 0===o){var d;n.valueTypes.forEach((e=>{if(e.kind===_.yp.Binding){const n=e.id;!c.has(n)&&t!==e.id&&Je(t,e.id)&&(a.push({kind:_.x2.Binding,text:n,type:e.type}),c.add(n))}}));const e=null===(d=n.valueTypes.find((e=>e.kind===_.yp.ThisRow)))||void 0===d?void 0:d.type;"block"===(null==e?void 0:e.type)&&void 0!==e.collection&&s.push(...await Qe(e.collection,n,t)),n.valueTypes.forEach((e=>{if(e.kind===_.yp.ContextValue&&Je(t,e.name)){const t=(0,O.ij)(e.id);s.push({kind:_.x2.Token,token:{type:_.Oy.ContextValue,valueId:t}})}}))}else"block"===o.type&&s.push(...await Qe(o.collection,n,t));for(const m in ge)if(!c.has(m)&&Je(t,m)&&(r||!m.startsWith("_"))&&("toNumber"!==m||null==o||!o.type||!fe.includes(o.type))&&(!i||!he.includes(m))){const e=ge[m];if(void 0!==o){var u,p;const t=(null===(u=e.parameters)||void 0===u||null===(u=u.expected)||void 0===u||null===(u=u[0])||void 0===u?void 0:u.type)??(null===(p=e.parameters)||void 0===p||null===(p=p.varargs)||void 0===p||null===(p=p[0])||void 0===p?void 0:p.type);if(void 0===t||!(0,B.qT)(o,t))continue}l.push({kind:_.x2.LibraryFunction,libraryFunction:e}),c.add(m)}return[...(0,$e.ZP)(t,a,(e=>e.text)),...(0,$e.ZP)(t,s,(e=>e.name??"")),...(0,$e.ZP)(t,[],(e=>e.builtin)),...(0,$e.ZP)(t,l,(e=>e.libraryFunction.name))]}function et(e,t){const n=[...e].reverse().find((e=>e.kind===N.bG.Call));if((null==n?void 0:n.kind)===N.bG.Call){let e=-1;if(t>n.lParenOffset&&(void 0===n.rParenOffset||t<=n.rParenOffset))for(e=0;e<n.commaOffsets.length&&!(n.commaOffsets[e]>t);e++);return{expression:n.expression,parameterIndex:e}}}const tt={[_.x2.Binding]:0,[_.x2.Token]:1,[_.x2.Builtin]:2,[_.x2.LibraryFunction]:3};async function nt(e){var t,n;const{formula:r,inputPosition:i,context:a,includeDeprecatedCompletions:s}=e,[l,c]=(0,k.dJ)(r),d=(0,k.Eh)(c,i);let u=l.substring(0,d);const p=u[u.length-1],m=/[\s.]/.test(p);m&&(u=`${u}_`);const g=be(),f=_e(g).tokenize(u).tokens,h=ke(g);h.input=f;const v=Me(h.expression());if(o.x.isFail(v))return{value:void 0};const y=await Ge(v.value,a,c),{node:b}=y,S=f[f.length-1];let w=!1,x=f;void 0!==S&&(0,ye.ol)(S,g.IdentifierName)&&(x=[...x],x.pop(),w=!0);const I=h.computeContentAssist("expression",x),C=w?S.image.substring(0,S.image.length-(m?1:0)):void 0,T=(0,O.cQ)(b,d),M={inputPosition:i,mappedPosition:d,nodePath:T,callParameter:et(T,d)},P=[],A=et(T,d),R={handleDataRequest:a.handleDataRequest,valueTypes:b.valueTypes,sourceProperty:a.sourceProperty};let D;for(let o=1;o<=5;o++){const e=(0,O.cQ)(b,d-o);if(D=e[e.length-1],void 0!==D)break}(null===(t=D)||void 0===t?void 0:t.kind)===N.bG.RecoveryNode&&(D=void 0);const B=void 0!==D&&0===T.length,E=!D||D.kind===N.bG.Unary||D.kind===N.bG.Equality||D.kind===N.bG.Identifier,F=!D||D.kind===N.bG.Equality||D.kind===N.bG.Identifier;for(const o of I){var Z,U,V,L,j,K,z,q,H;if(o.nextTokenType===g.IdentifierName){const e="dotMemberExpression"===o.ruleStack[o.ruleStack.length-1];if(e){const t=x[x.length-1];if(!(0,ye.ol)(t,g.Dot))return{value:void 0};const n=T[T.length-1];if(void 0!==n&&(n.kind===N.bG.UnifiedFunctionProperty||n.kind===N.bG.MemberBlockProperty)){const t=n.expression;M.completionsInfo={type:"member dot receiver",prefix:C,receiverNode:t};const o=await Xe({prefix:C??"",context:R,receiverType:t.type,includeDeprecatedCompletions:s,dotMemberExpression:e});P.push(...o)}}else{M.completionsInfo={type:"free identifier",prefix:C};const t=await Xe({prefix:C??"",context:R,includeDeprecatedCompletions:s,dotMemberExpression:e});if(P.push(...t),A&&(A.expression.kind===N.bG.UnifiedFunctionProperty&&0===A.parameterIndex||A.expression.kind===N.bG.Identifier&&1===A.parameterIndex)){const e=A.expression.kind===N.bG.UnifiedFunctionProperty?A.expression.name:A.expression.text,t=ge[e];if(((null==t?void 0:t.parameters)===pe||(null==t?void 0:t.parameters)===me)&&Je(C??"",_.GV)&&C!==_.GV&&C!==`${_.GV}.`){var G,W;const e=A.expression,t="function"===e.type.type&&"array"===(null===(G=e.type.boundTargetType)||void 0===G?void 0:G.type)&&(null===(W=e.type.boundTargetType)||void 0===W?void 0:W.of)||{type:"unknown"};P.push({kind:_.x2.Binding,text:_.GV,type:t}),P.push({kind:_.x2.Binding,text:_.WY,type:{type:"number"}})}}}}else if(o.nextTokenType===g.AdditionOperator&&B&&"text"===(null===(Z=D)||void 0===Z?void 0:Z.type.type)){const e=ot(["+"],C??"");P.push(...e)}else if(o.nextTokenType===g.AdditionOperator&&B&&"number"===(null===(U=D)||void 0===U?void 0:U.type.type)){const e=ot(["+","-"],C??"");P.push(...e)}else if(o.nextTokenType===g.MultiplicationOperator&&B&&"number"===(null===(V=D)||void 0===V?void 0:V.type.type)){const e=ot(["*","/"],C??"");P.push(...e)}else if(o.nextTokenType!==g.RelationalOperator||!B||"number"!==(null===(L=D)||void 0===L?void 0:L.type.type)&&"text"!==(null===(j=D)||void 0===j?void 0:j.type.type)&&"date"!==(null===(K=D)||void 0===K?void 0:K.type.type)){if(o.nextTokenType===g.EqualityOperator&&B&&null!==(z=D)&&void 0!==z&&z.type.type&&"unknown"!==(null===(q=D)||void 0===q?void 0:q.type.type)){const e=ot(["==","!="],C??"");P.push(...e)}else if(o.nextTokenType===g.BooleanLiteral&&E){const e=ot(["true","false"],C??"");P.push(...e)}else if(o.nextTokenType===g.And&&B&&"checkbox"===(null===(H=D)||void 0===H?void 0:H.type.type)){const e=ot(["and","or"],C??"");P.push(...e)}else if(o.nextTokenType===g.UnaryOperator&&F){const e=ot(["not"],C??"");P.push(...e)}}else{const e=ot([">",">=","<","<="],C??"");P.push(...e)}}const $=null===(n=f[f.length-1])||void 0===n?void 0:n.tokenType;if(0===P.length&&$===g.IdentifierName){const e=f.slice(-4).reverse(),t=[];for(let o=0;o<e.length;o++){var Y;if((null===(Y=e[o])||void 0===Y?void 0:Y.tokenType)!==g.IdentifierName)break;const n=w?e[o].image.substring(0,e[o].image.length-(m?1:0)):void 0;void 0!==n&&(0===o?t.push(n):t.push(n+t[o-1]))}let n=[];for(let o=1;o<t.length;o++){const e=t[o],r=await Xe({prefix:e.trim(),context:R,includeDeprecatedCompletions:s,dotMemberExpression:!1});if(r.length>0){n=r.map((t=>({...t,overridePrefixLength:e.length+o})))}}P.push(...n)}return M.completions=P.sort(((e,t)=>{const n=e.kind,o=t.kind;return tt[n]-tt[o]})),{value:M}}function ot(e,t){return e.filter((e=>Je(t,e))).map((e=>({kind:_.x2.Builtin,builtin:e})))}function rt(e,t){const n=Re(e);return o.x.isFail(n)?n:function(e,t,n){try{t.formulaTimeoutTimestampMs=t.formulaTimeoutTimestampMs??Date.now()+De;const n=Fe(e,t);let o=n.next();for(;!o.done;){const e=t.handleDataRequest(o.value);o=n.next(e)}return{value:o.value}}catch(o){if(o instanceof N.WV){const e=o.info;return n&&(0,O.w7)(e)?{error:{...e,node:(0,k.tE)(e.node,n)}}:{error:e}}return{error:{type:N.FY.UnexpectedError,error:(0,r.t)(o)}}}}(n.value,t)}async function it(e,t){const n=Re(e);return o.x.isFail(n)?n:await Ze(n.value,t)}async function at(e,t){const n=Re(e);if(o.x.isFail(n))return{value:{parseErrors:[n.error]}};const r=await Ge(n.value,t),{node:i,errors:a}=r;return{value:{type:i.type,typeErrors:a}}}function st(e,t){const n=Re(e);if(o.x.isFail(n))return{parseErrors:[n.error]};const r=We(n.value,t),{node:i,errors:a}=r;return{type:i.type,typeErrors:a}}function lt(e){const t=Re(e);return o.x.isFail(t)?[]:(0,O.Qg)(t.value)}},672158:(e,t,n)=>{n.d(t,{$E:()=>r,FY:()=>s,Mu:()=>a,WV:()=>d,bG:()=>o,h4:()=>u,no:()=>c,sj:()=>i});n(21703);let o=function(e){return e.Number="number",e.String="string",e.Boolean="boolean",e.Array="array",e.Identifier="identifier",e.NotionToken="notionToken",e.Conditional="conditional",e.LogicalOr="logicalOr",e.LogicalAnd="logicalAnd",e.Equality="equality",e.Relational="relational",e.Additive="additive",e.Multiplicative="multiplicative",e.Exponentiation="exponentiation",e.Unary="unary",e.Call="call",e.UnifiedFunctionProperty="unifiedFunctionProperty",e.MemberBlockProperty="memberProperty",e.RecoveryNode="recovery",e}({}),r=function(e){return e.InvalidCharacter="InvalidCharacter",e.UnclosedStringLiteral="UnclosedStringLiteral",e.UnclosedComment="UnclosedComment",e.TokenExpected="TokenExpected",e.StringLiteralContainsToken="StringLiteralContainsToken",e.ExpressionExpected="ExpressionExpected",e.PropertyTokenOrFunctionExpected="PropertyTokenOrFunctionExpected",e.EndOfInputExpected="EndOfInputExpected",e.UnexpectedError="UnexpectedError",e}({}),i=function(e){return e[e.DateInvalidDurationUnit=0]="DateInvalidDurationUnit",e[e.TryingToGetIdWithoutThisRow=1]="TryingToGetIdWithoutThisRow",e[e.LetBindingNameNotIdentifier=2]="LetBindingNameNotIdentifier",e[e.NotEnoughArguments=3]="NotEnoughArguments",e[e.UserNotFound=4]="UserNotFound",e}({});class a extends Error{constructor(e){super(),this.info=void 0,this.info=e}}let s=function(e){return e.MissingThisRow="MissingThisRow",e.MissingSchemaPropertyOnThisRow="MissingSchemaPropertyOnThisRow",e.MissingSchemaPropertyOnCollection="MissingSchemaPropertyOnCollection",e.ThisRowBlockPropertyMismatchCollection="ThisRowBlockPropertyMismatchCollection",e.MissingContextVariable="MissingContextVariableEval",e.IdentifierNotFound="IdentifierNotFound",e.CannotRelativelyCompareTypes="CannotRelativelyCompareTypesEval",e.CannotDoMathOnType="CannotDoMathOnTypeEval",e.CannotCallNonFunction="CannotCallNonFunction",e.UnifiedFunctionPropertyNotFound="UnifiedFunctionPropertyNotFound",e.LibraryFunctionExecutionError="LibraryFunctionExecutionError",e.FunctionCallTooFewArguments="FunctionCallTooFewArgumentsEval",e.FunctionCallUnexpectedArgument="FunctionCallUnexpectedArgumentEval",e.FunctionCallArgumentWrongType="FunctionCallArgumentWrongTypeEval",e.AccessingPropertyOnNonBlock="AccessingPropertyOnNonBlock",e.MissingDataDependencyBlock="MissingDataDependencyBlock",e.MissingDataDependencyPerson="MissingDataDependencyPerson",e.MemberPropertyMismatchCollection="MemberPropertyMismatchCollectionEval",e.MissingPropertyOnSchemaForMemberProperty="MissingPropertyOnSchemaForMemberProperty",e.UnaryMinusOnNonNumber="UnaryMinusOnNonNumberEval",e.UnexpectedRecoveryNode="UnexpectedRecoveryNode",e.UnexpectedError="UnexpectedEvalError",e.DepthExceeded="DepthExceeded",e.CycleDetected="CycleDetected",e.MaxEvaluationTimeExceeded="MaxEvaluationTimeExceeded",e.ContextVariableWrongType="ContextVariableWrongType",e}({});const l=[s.CycleDetected,s.DepthExceeded,s.MaxEvaluationTimeExceeded];function c(e){return l.includes(e.type)}class d extends Error{constructor(e){super(),this.info=void 0,this.info=e}}let u=function(e){return e.ThisRowTypeNotFound="ThisRowTypeNotFound",e.ThisRowNotBlockWithCollection="ThisRowNotBlockWithCollection",e.ContextVariableNotBlockWithCollection="ContextVariableNotBlockWithCollection",e.MissingPropertyOnThisRow="MissingPropertyOnThisRow",e.MissingPropertyOnContextVariable="MissingPropertyOnContextVariable",e.MissingContextVariable="MissingContextVariable",e.MissingBlock="MissingBlock",e.CallingNotFunction="CallingNotFunction",e.FunctionCallTooFewArguments="FunctionCallTooFewArguments",e.FunctionCallUnexpectedArgument="FunctionCallUnexpectedArgument",e.FunctionCallArgumentWrongType="FunctionCallArgumentWrongType",e.MemberPropertyMismatchCollection="MemberPropertyMismatchCollection",e.MemberPropertyMissing="MemberPropertyMissing",e.MemberPropertyTargetNotBlock="MemberPropertyTargetNotBlock",e.MemberPropertyTypeInvalid="MemberPropertyTypeInvalid",e.UndefinedIdentifier="UndefinedIdentifier",e.UnifiedFunctionCannotFindFunction="UnifiedFunctionCannotFindFunction",e.UnifiedFunctionNoArguments="UnifiedFunctionNoArguments",e.UnifiedFunctionTargetWrongType="UnifiedFunctionTargetWrongType",e.CannotRelativelyCompareTypes="CannotRelativelyCompareTypes",e.CannotDoMathOnType="CannotDoMathOnType",e.UnaryMinusOnNonNumber="UnaryMinusOnNonNumber",e.IdentifierExpected="IdentifierExpected",e.FunctionCallExpected="FunctionCallExpected",e.RenamedIdentifier="RenamedIdentifier",e.RemovedFunction="RemovedFunction",e.BlockPropertyTypeInvalid="BlockPropertyTypeInvalid",e}({})},335102:(e,t,n)=>{n.d(t,{B8:()=>J,DF:()=>Ce,Fl:()=>se,IP:()=>ee,J3:()=>ie,Jr:()=>oe,Kd:()=>fe,Kl:()=>Ge,Kv:()=>ge,MY:()=>he,NP:()=>ce,Ny:()=>We,P2:()=>re,PX:()=>Me,Qc:()=>ve,Qg:()=>Oe,RX:()=>pe,Rp:()=>Pe,SQ:()=>te,SR:()=>_e,SU:()=>Ae,UQ:()=>ze,Uw:()=>be,Ve:()=>Ve,WT:()=>de,Wo:()=>Ke,Xp:()=>Ye,Yw:()=>q,_u:()=>Ze,aL:()=>X,ag:()=>H,by:()=>ke,cQ:()=>$e,dh:()=>le,fQ:()=>Ue,hV:()=>De,hp:()=>Ee,i0:()=>Se,ij:()=>me,j4:()=>Y,lc:()=>we,mB:()=>Q,vh:()=>ne,vx:()=>ae,w7:()=>Be,wf:()=>ye,yf:()=>xe,zA:()=>Te});n(757658),n(21703),n(252262),n(324506);var o=n(467266),r=n.n(o),i=n(653965),a=n(937850),s=(n(307032),n(940470)),l=n(401898),c=n(202032),d=n(399036),u=n(180951),p=n(143690),m=n(10070),g=n(516691),f=n(266749),h=n(597531),v=n(640506),y=n(253877),b=n(842875),_=n(849019),S=n(763860),k=n(742283),w=n(282447),x=n(932426),I=n(155159),C=n(526774),T=n(753866),M=n(800108),P=n(656505),A=n(676725),R=n(959753),D=n(261158),B=n(300482),E=n(145953),F=n(600606),Z=n(882883),U=(n(421202),n(606287)),V=n(519889),N=n(421838),O=n(173110),L=n(513730),j=n(150610),K=n(672158),z=n(80206);function q(e){return{type:"array",values:e.values.flatMap((e=>"array"===e.type?q(e).values:[e]))}}function H(e){const{result:t,currentPropertyValue:n,propertyId:o,page:r,action:a,propertySchema:s}=e,c=r.getSpaceShardedPointer(),p=[];switch(t.type){case"text":if(!d.t(s)){p.push(...$({page:r,propertyId:o,propertySchema:s,textValue:Y(t)}));break}const e=(s.options??[]).map((e=>e.value)),m=(0,N.QaF)(t.value);if(!e.includes(m))return;p.push(...$({page:r,propertyId:o,propertySchema:s,textValue:(0,u.O2)(m)}));break;case"number":case"date":case"person":case"block":case"undefined":case"function":p.push(...$({page:r,propertyId:o,propertySchema:s,textValue:Y(t)}));break;case"checkbox":p.push(...$({page:r,propertyId:o,propertySchema:s,textValue:(0,u._I)(t.value)}));break;case"array":{const e=q(t),m=e.values[0];if(!m)return;if("person"===m.type){const t=r.getCreatedByPointer();let d=(0,u.DW)({textValue:n,propertySchema:s,blockCreatorPointer:t}),m=i.oA(e.values.map((e=>"person"===e.type?e.value:void 0)));"person"===s.type&&(0,l.$K)(s.default)&&!n&&1===d.length&&(m=[...d,...m],d=[]),p.push(...G({currentValues:d,newValues:m,action:a,propertySchema:s,equalityFn:(e,t)=>(0,g.dn)(e)===(0,g.dn)(t),createReplaceOperations:e=>$({page:r,propertyId:o,propertySchema:s,textValue:(0,u.C1)(e)}),createAddOperation:e=>({command:"addPersonAfter",pointer:c,path:["properties",o],args:{pointer:e,after:void 0}}),createRemoveOperation:e=>({command:"removePerson",pointer:c,path:["properties",o],args:{pointer:e}})}))}else{if("block"===m.type){p.push(...G({currentValues:(0,u.rq)(n),newValues:i.oA(e.values.map((e=>"block"===e.type?e.value:void 0))),action:a,propertySchema:s,equalityFn:(e,t)=>(0,g.dn)(e)===(0,g.dn)(t),createReplaceOperations:e=>$({page:r,propertyId:o,propertySchema:s,textValue:(0,u.ow)(e)}),createAddOperation:e=>({command:"addRelationAfter",pointer:c,path:["properties",o],args:{id:e.id,spaceId:e.spaceId,after:void 0}}),createRemoveOperation:e=>({command:"removeRelation",pointer:c,path:["properties",o],args:{id:e.id,spaceId:e.spaceId}})}));break}if("text"===m.type){if(!d.t(s))return;const t=(s.options??[]).map((e=>e.value)),l=i.oA(e.values.map((e=>"text"===e.type?(0,N.QaF)(e.value):void 0))).filter((e=>t.includes(e)));p.push(...G({currentValues:(0,u.uP)(n,s.options||[]),newValues:l,action:a,propertySchema:s,equalityFn:(e,t)=>e===t,createReplaceOperations:e=>$({page:r,propertyId:o,propertySchema:s,textValue:(0,u.zq)(e)}),createAddOperation:e=>({command:"addSelectOptionAfter",pointer:c,path:["properties",o],args:{option:e,after:void 0}}),createRemoveOperation:e=>({command:"removeSelectOption",pointer:c,path:["properties",o],args:{option:e}})}))}}break}default:(0,l.t1)(t)}return p}function G(e){const{currentValues:t,newValues:n,action:o,propertySchema:r,equalityFn:i,createReplaceOperations:a,createAddOperation:s,createRemoveOperation:c}=e,u=d.en(r)?r.limit:void 0;if("replace"===o)return a(W(n,u));if("append"===o){const e=function(e){const{currentValues:t,newValues:n,limit:o,equalityFn:r}=e,i=[];for(const s of n)t.find((e=>r(e,s)))||i.push(s);const a=W([...t,...i],o);if(a.length<=t.length)return[];return a.slice(t.length)}({currentValues:t,newValues:n,limit:u,equalityFn:i});return e.map(s)}if("remove"===o){const e=function(e){const{currentValues:t,valuesToRemove:n,equalityFn:o}=e;return n.filter((e=>t.find((t=>o(t,e)))))}({currentValues:t,valuesToRemove:n,equalityFn:i});return e.map(c)}if("toggle"===o){const{valuesToAdd:e,valuesToRemove:o}=function(e){const{currentValues:t,valuesToToggle:n,limit:o,equalityFn:r}=e;let i=[];const a=[];for(const s of n)t.find((e=>r(e,s)))?a.push(s):i.push(s);if(o){const e=t.length-a.length+i.length-o;e>0&&(i=i.slice(0,i.length-e))}return{valuesToAdd:i,valuesToRemove:a}}({currentValues:t,valuesToToggle:n,limit:u,equalityFn:i});return[...o.map(c),...e.map(s)]}(0,l.t1)(o)}function W(e,t){return(0,l.$K)(t)?e.slice(0,t):e}function $(e){const{page:t,propertyId:n,propertySchema:o,textValue:r}=e;return d.kc(o)?t.useCrdt()?h.cZ(t,r):[B.op.update({pointer:t.getSpaceShardedPointer(),path:["properties"],args:f.pp({[n]:r})})]:[B.op.update({pointer:t.getSpaceShardedPointer(),path:["properties"],args:{[n]:r}})]}function Y(e){switch(e.type){case"text":return e.value;case"number":return(0,u.eP)(e.value);case"checkbox":return(0,N.TPx)(e.value?"true":"false");case"date":return(0,u.d7)(e.value);case"person":return(0,u.C1)([e.value]);case"block":return(0,u.ow)([e.value]);case"array":return(0,N.Zxt)((0,A.Z)(e.values,(()=>({type:"text",value:(0,N.TPx)(",")}))).flatMap((e=>Y(e))));case"function":case"undefined":return[];default:(0,l.t1)(e)}}function Q(e,t){if(Array.isArray(t))return t.some((t=>Q(e,t)));switch(t.type){case"text":case"number":case"checkbox":case"date":case"person":return e.type===t.type;case"array":return"array"===e.type&&e.values.every((e=>Q(e,t.of)));case"unknown":case"expression":return!0;case"block":return"block"===e.type;case"select":case"function":return!1;default:(0,l.t1)(t)}}function J(e){return"array"!==e.type?e:J(e.of)}function X(e){return"array"!==e.type?e:X(e.of)}function*ee(e,t,n){switch(n.type){case"title":case"text":case"email":case"phone_number":case"url":case"select":case"auto_increment_id":case"status":return{type:"text"};case"number":return{type:"number"};case"checkbox":return{type:"checkbox"};case"file":case"multi_select":return{type:"array",of:{type:"text"}};case"date":case"created_time":case"last_edited_time":case"last_visited_time":return{type:"date"};case"person":return{type:"array",of:{type:"person"}};case"created_by":case"last_edited_by":return{type:"person"};case"relation":return{type:"array",of:{type:"block",collection:n.collection_pointer}};case"rollup":if(void 0!==n.aggregation&&"show_unique"!==n.aggregation){return{type:(0,c.W6)((0,c.gu)(n.aggregation))}}const r=yield*(0,L._z)(e,t);if(void 0===r)return{type:"text"};const{targetCollectionSchema:i,targetProperty:a,targetPropertySchema:s}=r,d=yield*ee(a,i,s);if(void 0===d)return;return{type:"array",of:J(d)};case"formula":switch(n.version){case void 0:var o;return void 0!==(null===(o=n.formula)||void 0===o?void 0:o.result_type)?{type:n.formula.result_type}:{type:"unknown"};case"v2":return n.formula2?n.formula2.result_type:{type:"unknown"};default:return(0,l.t1)(n.version)}case"button":case"location":case"verification":return;default:(0,l.t1)(n)}}function te(e,t){switch(t){case O.vz.Title:const n=e.getProperty("title");return void 0!==n?{type:"text",value:n}:{type:"undefined"};case O.vz.CreatedBy:const o=e.getCreatedByPointer();return o?{type:"person",value:o}:{type:"undefined"};case O.vz.CreatedTime:const r=e.getCreatedTime();return void 0!==r?{type:"date",value:(0,y.CQ)(r,(0,b.r)())}:{type:"undefined"};case O.vz.LastEditedBy:const i=e.getLastEditedByPointer();return i?{type:"person",value:i}:{type:"undefined"};case O.vz.LastEditedTime:const a=e.getLastEditedTime();return void 0!==a?{type:"date",value:(0,y.CQ)(a,(0,b.r)())}:{type:"undefined"};default:(0,l.t1)(t)}}function ne(e){return!("checkbox"===e.type&&!1===e.value||"undefined"===e.type||"number"===e.type&&0===e.value||"array"===e.type&&0===e.values.length||"text"===e.type&&!e.value.some((e=>(0,N.J1x)(e)>0)))}function*oe(e,t,n){if("text"===e.type&&"text"===t.type){const[o,r]=yield*Te([e.value,t.value],n);return o===r}if("number"===e.type&&"number"===t.type)return e.value===t.value;if("checkbox"===e.type&&"checkbox"===t.type)return e.value===t.value;if("date"===e.type&&"date"===t.type)return(0,v.AP)(e.value,t.value);if("person"===e.type&&"person"===t.type)return(0,F.qo)(e.value,t.value);if("array"===e.type&&"array"===t.type){if(e.values.length!==t.values.length)return!1;return(yield*(0,L.LD)(e.values.map(((e,o)=>oe(e,t.values[o],n))))).every((e=>!0===e))}return"block"===e.type&&"block"===t.type?e.value.id===t.value.id:"undefined"===e.type&&"undefined"===t.type}function re(e){var t;return(null===(t=e.parameters)||void 0===t||null===(t=t.expected)||void 0===t?void 0:t.filter((e=>!0!==e.optional)).length)??0}function ie(e,t){var n,o;const r=null===(n=e.parameters)||void 0===n||null===(n=n.expected)||void 0===n?void 0:n[t];if(void 0!==r)return r;const i=null===(o=e.parameters)||void 0===o?void 0:o.varargs;if(void 0!==i&&i.length>0){var a;return i[(t-((null===(a=e.parameters)||void 0===a||null===(a=a.expected)||void 0===a?void 0:a.length)??0))%i.length]}}function ae(e,t){return e.find((e=>e.kind===O.yp.ContextValue&&e.id===t))}function se(e,t){return e.kind===O.yp.Binding?t.kind===O.yp.Binding&&e.name===t.name:e.kind===O.yp.ContextValue?t.kind===O.yp.ContextValue&&e.name===t.name:e.kind===O.yp.ThisRow?t.kind===O.yp.ThisRow:void(0,l.t1)(e)}function le(e,t){return e.find((e=>e.kind===O.yp.ContextValue&&e.id===t))}function ce(e){if(e.kind===O.yp.ContextValue||e.kind===O.yp.Binding)return e.name;if(e.kind===O.yp.ThisRow)throw new Error("Not implemented yet.");(0,l.t1)(e)}function de(e){return e.kind===O.yp.ContextValue?e.tooltipName??e.name:ce(e)}const ue={text:M.p,number:I.J,date:w.V,checkbox:k.r,block:_.e,person:C.O,select:T.w,array:S.U,function:x.D,unknown:P.S};function pe(e){const t=e.type;return"array"===t&&"block"===e.of.type?_.e:ue[t]}function me(e){return encodeURIComponent(e)}function ge(e){return decodeURIComponent(e)}function fe(e){return r()(e)}function he(e){return JSON.parse(e)}function ve(e){return e}function ye(e){return e}function be(e){return encodeURIComponent(e)}function _e(e){return decodeURIComponent(e)}function Se(e){return e}function ke(e){return e}function we(e){return t=>({getRecordModel:e})}function xe(e,t,n,o,r,s,c,d,u){return m=>{var g;s&&s();const f=[],h=E.Ak.create();if(null===(g=m.recordPointers)||void 0===g||g.forEach((t=>{const n=e(t);void 0!==n?h.setModel(t,n):f.push(t)})),0===f.length&&(void 0===m.collectionBlockProperties||0===m.collectionBlockProperties.length))return{getRecordModel:R.omK.fromRecordMap(h)};const v=void 0!==m.collectionBlockProperties?function(e){const t=[];for(const n of e){const e=t.find((e=>(0,F.qo)(e.collectionPointer,n.collectionPointer)&&e.property===n.property));void 0!==e?e.blockPointers.push(...n.blockPointers):t.push({...n,blockPointers:[...n.blockPointers]})}return t}(m.collectionBlockProperties):[],y=c??new Map,b=d??new Map,_=u??{};return new Promise((async(e,c)=>{try{const c=new D.Z((e=>`${e.id}${e.table}`));c.add(...f),v.forEach((e=>{let{blockPointers:t,collectionPointer:n}=e;c.add(...t),c.add(n)})),await(0,a.Lc)(c.valuesArray(),500,(async e=>{const n=await t(e);h.setModel(e,n)})),await(0,a.Lc)(v,5,(async e=>{let{blockPointers:a,collectionPointer:c,schema:d,property:u}=e;const m=await(0,p.HF)({collectionPointer:c,schema:d,property:u,loadRecordModel:t,dependencyCache:y}),g=i.mN(a,(e=>e.id)).map((e=>h.getModel(e))).filter(l.$K),f=h.getModel(c);f&&g.forEach((e=>{_[e.id]=f})),await(0,p.c_)({blocks:g,dependencies:m,blockIdToAssociatedCollectionModelCache:_,recordMap:h,loadRecordModel:t,formulaTimeoutMs:n,logFormulaTimeoutFn:o,logFormulaStatsFn:r,checkCancellation:s,dependencyCache:y,resultCache:b})})),e({getRecordModel:R.omK.fromRecordMap(h)})}catch(d){c(d)}}))}}function Ie(e){switch(e.type){case"date":return`date|${e.start_date}`;case"daterange":return`daterange|${e.start_date}|${e.end_date}`;case"datetime":return`datetime|${e.start_date}|${e.start_time}|${e.time_zone}`;case"datetimerange":return`datetimerange|${e.start_date}|${e.start_time}|${e.end_date}|${e.end_time}|${e.time_zone}`}}function Ce(e){const[t,...n]=e.split("|");switch(t){case"date":return{type:"date",start_date:n[0]};case"daterange":return{type:"daterange",start_date:n[0],end_date:n[1]};case"datetime":return{type:"datetime",start_date:n[0],start_time:n[1],time_zone:n[2]};case"datetimerange":return{type:"datetimerange",start_date:n[0],start_time:n[1],end_date:n[2],end_time:n[3],time_zone:n[4]};default:throw new Error("Invalid serialized date")}}function*Te(e,t){const n=e.flatMap((e=>(0,u.sJ)(e))),o=n.length?(yield{recordPointers:n}).getRecordModel:R.omK.constant(void 0);return e.map((e=>void 0!==e?(0,Z.Xh)({textValue:e,getRecordModel:o,userTimeZone:t.userTimeZone,deterministic:!0,disableAnnotationPrefix:!0,intl:t.intl}):""))}function*Me(e,t){const n=(0,u.sJ)(e),o=n.length?(yield{recordPointers:n}).getRecordModel:R.omK.constant(void 0);return(0,Z.Xh)({textValue:e,getRecordModel:o,userTimeZone:t.userTimeZone,deterministic:!0,disableAnnotationPrefix:!0,intl:t.intl})}function Pe(e){switch(e.type){case"block":case"person":return[e.value];case"text":return(0,u.sJ)(e.value);case"array":return e.values.flatMap(Pe);case"number":case"checkbox":case"date":case"function":case"undefined":return[];default:(0,l.t1)(e)}}function Ae(e,t,n){const o=(0,y.uO)(e,n),r=(0,y.uO)(t,n);return o>r?1:o<r?-1:0}const Re=1e-6;function De(e,t){const n=s.x.unwrap(e);switch(typeof t){case"string":return"text"===n.type&&(0,N.QaF)(n.value)===t;case"number":return"number"===n.type&&Math.abs(n.value-t)<Re;case"boolean":return"checkbox"===n.type&&n.value===t;case"undefined":return"undefined"===n.type;case"object":return"date"===n.type&&(0,v.AP)(n.value,t)}}function Be(e){return"node"in e}function Ee(e){return Be(e)&&e.type!==K.FY.FunctionCallArgumentWrongType&&e.type!==K.FY.FunctionCallUnexpectedArgument}function Fe(e,t,n){const o=be(e),r=me(t),i=function(e){return encodeURIComponent(e)}(n);return`${O.Eb}${O.Oy.BlockProperty}:context_value:${o}:${r}:${i}${O.Av}`}function Ze(e){const t=(0,N.sP4)(e);if(void 0!==t){const e=me((0,N.vmO)(t).id);return`${O.Eb}${O.Oy.ContextValue}:${e}${O.Av}`}const n=(0,N.jRb)(e);if(void 0!==n){const e=(0,N.pxR)(n),t=be(e.property);return"contextValueId"in e?Fe(e.property,e.contextValueId,e.valueSnapshot):void 0!==e.collection?`${O.Eb}${O.Oy.BlockProperty}:${t}:${e.collection.id}:${e.collection.spaceId}${O.Av}`:`${O.Eb}${O.Oy.BlockProperty}:${t}${O.Av}`}const o=(0,N.K9C)(e);if(void 0!==o){const e=(0,N.zyO)(o);return r=e,`${O.Eb}${O.Oy.Date}:${Ie(r)}${O.Av}`}var r;const i=(0,N.V8Y)(e);if(void 0!==i){const e=(0,N.yrl)(i);if(void 0!==e)return`${O.Eb}${O.Oy.Block}:${e.id}${void 0!==e.spaceId?`:${e.spaceId}`:""}${O.Av}`}const a=(0,N.hH9)(e);if(void 0!==a){const e=(0,N.zEN)(a);return`${O.Eb}${O.Oy.Person}:${e}${O.Av}`}}function Ue(e,t,n,o){const r=(0,N.sP4)(e);if(void 0!==r){return(0,N.vmO)(r).id}const i=(0,N.jRb)(e);if(void 0!==i){var a;const e=(0,N.pxR)(i);if((0,N.CEh)(e))return e.contextValueId;if(!e.collection)return`prop("${Ve(`${e.property}`)}")`;const n=t(e.collection);if(!n)return;const o=null===(a=n.getSchema()[e.property])||void 0===a?void 0:a.name;if(!o)return;return`prop("${o}")`}const s=(0,N.K9C)(e);if(void 0!==s){return Ie((0,N.zyO)(s))}const l=(0,N.V8Y)(e);if(void 0!==l){const e=(0,N.yrl)(l);if(void 0===e)return;const r=t(e);if(!r)return;return r.getRenderTitle({getRecordModel:t,intl:n,userTimeZone:o})}const c=(0,N.hH9)(e);if(void 0!==c){const e=t({id:(0,N.zEN)(c),table:V.KJ});if(!e)return;return e.getFullName(n)}}function Ve(e){switch(e){case O.vz.CreatedTime:return"Created Time";case O.vz.LastEditedTime:return"Last Edited Time";case O.vz.LastEditedBy:return"Last Edited By";case O.vz.CreatedBy:return"Created By";case O.vz.Title:return"Page Name";default:(0,l.t1)(e)}}function Ne(e){switch(e){case"Created Time":return O.vz.CreatedTime;case"Last Edited Time":return O.vz.LastEditedTime;case"Last Edited By":return O.vz.LastEditedBy;case"Created By":return O.vz.CreatedBy;case"Page Name":return O.vz.Title;default:return}}function Oe(e){const t=new Set;return Le(e,t),Array.from(t)}function Le(e,t){if(void 0!==e)switch(e.kind){case K.bG.Conditional:return Le(e.condition,t),Le(e.expIfFalse,t),void Le(e.expIfTrue,t);case K.bG.Equality:case K.bG.Relational:case K.bG.Additive:case K.bG.Multiplicative:case K.bG.Exponentiation:return Le(e.lhs,t),void Le(e.rhs,t);case K.bG.Call:return Le(e.expression,t),void e.arguments.forEach((e=>Le(e,t)));case K.bG.Unary:case K.bG.UnifiedFunctionProperty:return void Le(e.expression,t);case K.bG.LogicalAnd:case K.bG.LogicalOr:case K.bG.Array:return void e.elements.forEach((e=>Le(e,t)));case K.bG.NotionToken:return void(e.token.type===O.Oy.BlockProperty&&je(e.token.property,t));case K.bG.MemberBlockProperty:return void je(e.propertyToken.property,t);case K.bG.RecoveryNode:case K.bG.String:case K.bG.Boolean:case K.bG.Identifier:case K.bG.Number:return;default:(0,l.t1)(e)}}function je(e,t){O.WG.includes(e)||t.add(_e(e))}function Ke(e,t,n){const o=[];return e.forEach((e=>{const r=(0,N.hDy)(e),i=(0,N.jRb)(r);if(!i)return void o.push(e);const a=(0,N.pxR)(i);if((0,N.CEh)(a)||!a.collection)return void o.push(e);const s=t({requester:n,requested:a.collection});if((null==s?void 0:s.table)!==U.vF)return void o.push(e);const l=a.property,c=(0,N.YCD)((0,N.kbv)({collection:s,property:l}));o.push(c)})),o}function ze(e,t,n){let[o,r]=qe({textValue:e,sourceCollection:t,getRecordModel:n,removeProp:!1}),i=0;for(;r&&i<100;)[o,r]=qe({textValue:o,sourceCollection:t,getRecordModel:n,removeProp:!1}),i++;const[a,s]=qe({textValue:o,sourceCollection:t,getRecordModel:n,removeProp:!0});return a}function qe(e){const{textValue:t,sourceCollection:n,getRecordModel:o,removeProp:r}=e,i=(0,z.l)(),[a,l]=i.processFormulaInput(t),[c]=i.parseFormulaInputToCst(a),d=i.convertFormulaCSTToAST(c);if(s.x.isFail(d))return[t,!1];const u={type:"block",collection:n.pointer},p={valueTypes:[{kind:O.yp.ThisRow,type:u}],handleDataRequest:we(o)},{node:g}=i.addTypesToFormulaAST(d.value,p);let f=!1;const h=[];let v=0;for(const s of t){if(f){h.push(s);continue}if(!N.QJH(s)){v+=1,h.push(s);continue}const e=s[0];let t,i=0;for(;null!==(t=O.gD.exec(e));){if(f)continue;t.index>i&&h.push([e.substring(i,t.index)]);const a=$e(g,(0,j.Eh)(l,v+t.index-1)),s=a[a.length-1];let c=n.pointer;if(s){const e=J(s.type);"block"===e.type&&e.collection&&(c=e.collection)}const d=t[2],u=o(c);if(!u){h.push([d]);continue}const p=(0,m.W0)(d,u.getNormalizedSchema());if(p){const[e,t]=p,n=(0,N.YCD)((0,N.kbv)({collection:u.pointer,property:e,name:t.name}));f=!0,h.push(n)}else{const e=Ne(d);e?(h.push((0,N.YCD)((0,N.kbv)({collection:void 0,property:e,name:d}))),f=!0):r?h.push([d]):h.push([`prop("${d}")`])}i=O.gD.lastIndex}i<e.length&&h.push([e.substring(i)]),v+=e.length}return[h,f]}function He(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const o=[];for(const r of e)if(void 0!==r){const e=Ge(r,t,n);e.length>0&&o.push.apply(o,e)}return o}function Ge(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(o.has(e))return[];if(o.add(e),!t&&e.kind!==K.bG.Call&&"function"===(null==e||null===(n=e.type)||void 0===n?void 0:n.type))return[{type:K.h4.FunctionCallExpected,node:e,functionName:e.type.libraryFunction.name}];let r=[];switch(e.kind){case K.bG.Conditional:r=He([e.condition,e.expIfTrue,e.expIfFalse],!1,o);break;case K.bG.Equality:case K.bG.Relational:case K.bG.Additive:case K.bG.Multiplicative:case K.bG.Exponentiation:r=He([e.lhs,e.rhs],!1,o);break;case K.bG.Call:const n=e.expression;n.kind===K.bG.Identifier&&("let"===n.text||"lets"===n.text)?(r=[...He(e.arguments.slice(0,e.arguments.length-1),!0,o),...He([e.expression],!0,o)],e.arguments.length>2&&e.arguments.length%3==0&&r.push(...He([e.arguments.at(-1)],t,o))):r=[...He(e.arguments,!1,o),...He([e.expression],!0,o)];break;case K.bG.Unary:case K.bG.UnifiedFunctionProperty:r=He([e.expression],!1,o);break;case K.bG.LogicalAnd:case K.bG.LogicalOr:case K.bG.Array:r=He(e.elements,!1);break;case K.bG.RecoveryNode:case K.bG.String:case K.bG.Boolean:case K.bG.Identifier:case K.bG.NotionToken:case K.bG.MemberBlockProperty:case K.bG.Number:r=[];break;default:(0,l.t1)(e)}return r}function We(e){const t=new Map;return e.forEach((e=>{const n=(0,N.hDy)(e),o=(0,N.jRb)(n);if(!o)return;const r=(0,N.pxR)(o);r.name&&t.set(r.property,r.name)})),t}function $e(e,t){if(t<e.startOffset||t>e.endOffset+1)return[];const n=e.kind;switch(n){case K.bG.Number:case K.bG.String:case K.bG.Boolean:case K.bG.NotionToken:case K.bG.Identifier:case K.bG.RecoveryNode:return[e];case K.bG.Conditional:{const n=$e(e.condition,t);if(n.length>0)return[e,...n];const o=$e(e.expIfTrue,t);if(o.length>0)return[e,...o];if(void 0!==e.expIfFalse){const n=$e(e.expIfFalse,t);if(n.length>0)return[e,...n]}return[e]}case K.bG.Equality:case K.bG.Relational:case K.bG.Additive:case K.bG.Multiplicative:case K.bG.Exponentiation:{const n=$e(e.lhs,t);if(n.length>0)return[e,...n];const o=$e(e.rhs,t);return o.length>0?[e,...o]:[e]}case K.bG.LogicalOr:case K.bG.LogicalAnd:case K.bG.Array:for(const n of e.elements){const o=$e(n,t);if(o.length>0)return[e,...o]}return[e];case K.bG.Unary:{const n=$e(e.expression,t);return n.length>0?[e,...n]:[e]}case K.bG.Call:{const n=$e(e.expression,t);if(n.length>0)return[e,...n];for(const o of e.arguments){const n=$e(o,t);if(n.length>0)return[e,...n]}return[e]}case K.bG.UnifiedFunctionProperty:case K.bG.MemberBlockProperty:const o=$e(e.expression,t);return o.length>0?[e,...o]:[e];default:(0,l.t1)(n)}}function Ye(e){return e.type===O.Oy.BlockProperty&&"contextValueId"in e}},80206:(e,t,n)=>{let o;function r(){return o??=n(446725)}n.d(t,{l:()=>r})},484682:(e,t,n)=>{n.d(t,{AH:()=>y,HK:()=>w,Qs:()=>_,y4:()=>I});n(21703);var o=n(653965),r=n(401898),i=n(266897),a=n(435011),s=n(180951),l=n(334299),c=n(463087),d=n(640506),u=n(407057),p=n(253877),m=n(959753),g=n(421838),f=n(672158),h=n(991905);const v=15;function y(e){const{schema:t,property:n,block:r,getRecordModel:i,collectionRequestContext:a,formula2Error:s}=function(e){return"getRecordModel"in e?e:{...e,block:m.kk5.fromBlock(e.block),getRecordModel:m.omK.fromGetRecordValueFn(e.getRecordValue)}}(e),{depth:l,resultCache:d,visitedProperties:u,formulaTimeoutTimestampMs:p,logFormulaTimeoutFn:g}=a,h=t[n];if(!h||"formula"!==h.type||!h.formula)return;const{formula:y}=h;if(l>v)return void(null===(null==s?void 0:s.error)&&(s.error=new f.WV({type:f.FY.DepthExceeded})));const _=`${r.id}:${n}`;if(u.has(_))return void(null===(null==s?void 0:s.error)&&(s.error=new f.WV({type:f.FY.CycleDetected})));const S=function(e){var t;let{resultCache:n,blockId:o,property:r}=e;return null===(t=n.get(o))||void 0===t?void 0:t.get(`${r}:${c.Hi.FormulaValue}`)}({resultCache:d,blockId:r.id,property:n});if(void 0!==S)return S;if(p&&Date.now()>p)return g&&g(),void(null===(null==s?void 0:s.error)&&(s.error=new f.WV({type:f.FY.MaxEvaluationTimeExceeded})));const k=new Set(u);k.add(_);try{let e=b({formula:y,schema:t,block:r,getRecordModel:i,collectionRequestContext:{...a,visitedProperties:k},formula2Error:s});if(o.hj(e)){if(!o.xV(e))return;e=o.NM(e,12)}return function(e){let{resultCache:t,blockId:n,property:o,value:r}=e;const i=t.get(n)??new Map;i.set(`${o}:${c.Hi.FormulaValue}`,r),t.set(n,i)}({resultCache:d,blockId:r.id,property:n,value:e}),e}catch(w){return void console.error(w)}}function b(e){const{formula:t,schema:n,block:o,getRecordModel:r,collectionRequestContext:i,formula2Error:a}=function(e){return"getRecordModel"in e?e:{...e,block:m.kk5.fromBlock(e.block),getRecordModel:m.omK.fromGetRecordValueFn(e.getRecordValue)}}(e),{userTimeZone:s,intl:l}=i;if("conditional"===t.type)return b({formula:t.condition,schema:n,block:o,getRecordModel:r,collectionRequestContext:i,formula2Error:a})?b({formula:t.true,schema:n,block:o,getRecordModel:r,collectionRequestContext:i,formula2Error:a}):b({formula:t.false,schema:n,block:o,getRecordModel:r,collectionRequestContext:i,formula2Error:a});if("constant"===t.type){const{value:e,value_type:n}=t;return"string"===n?e:"number"===n?parseFloat(e):"boolean"===n?!!JSON.parse(e):void 0}if("function"===t.type){const{args:e}=t,c=(e||[]).map((e=>b({formula:e,schema:n,block:o,getRecordModel:r,collectionRequestContext:i,formula2Error:a}))),d=h.uf(t.name),u=h.aV(t.name);return d?d.apply(c,s,l,o):u?u.apply(c,s,l,o):void 0}if("property"===t.type)return _({property:t.id,schema:n,block:o,getRecordModel:r,collectionRequestContext:i,formula2Error:a});if("operator"===t.type){const{args:e,name:c}=t,d=(e||[]).map((e=>b({formula:e,schema:n,block:o,getRecordModel:r,collectionRequestContext:i,formula2Error:a}))),u=h.aV(c);if(!u)return;return u.apply(d,s,l,o)}if("symbol"===t.type){const{name:e}=t;return e in h._G?h._G[e].value:void 0}}function _(e){const t=function(e){return"getRecordModel"in e?e:{...e,block:m.kk5.fromBlock(e.block),getRecordModel:m.omK.fromGetRecordValueFn(e.getRecordValue)}}(e),{property:n,schema:o}=t,r=o[n];if(r)return x[r.type](t)}function S(e){const{property:t,block:n}=e,o=s.wS(n,t)||[];return g.Jcv(o)}function k(e){const{property:t,block:n}=e,o=s.wS(n,t)||[];return s.zB(o)}function w(e){const{timestampType:t,block:n,userTimeZone:o}=e;if("created_time"===t){if(n.getCreatedTime())return p.CQ(n.getCreatedTime(),o)}else if("last_edited_time"===t){if(n.getLastEditedTime())return p.CQ(n.getLastEditedTime(),o)}else(0,r.t1)(t)}const x={title:S,text:S,url:k,email:k,phone_number:k,select:e=>{let{property:t,schema:n,block:o}=e;const r=s.wS(o,t)||[],i=n[t].options||[];return s.Sj(r,i)},multi_select:e=>{let{property:t,schema:n,block:o}=e;const r=s.wS(o,t)||[],i=n[t].options||[];return s.uP(r,i).join(", ")},status:e=>{let{property:t,schema:n,block:o}=e;const r=s.wS(o,t)||[],i=n[t];return s.ZG(r,i)},checkbox:e=>{let{property:t,block:n}=e;const o=s.wS(n,t)||[];return s.Ml(o)},date:e=>{let{property:t,block:n}=e;const o=s.wS(n,t)||[];return s.Gl(o)},person:e=>{let{property:t,block:n,getRecordModel:o,schema:r,collectionRequestContext:a}=e;const{intl:l}=a,c=s.wS(n,t)||[],d=r[t],u=m.kk5.fromBlock(n);return s.DW({textValue:c,propertySchema:d,blockCreatorPointer:u.getCreatedByPointer()}).map((e=>(0,i.$4)(l,(0,i.Hl)({pointer:e,getRecordModel:o})))).join(", ")},relation:e=>{let{property:t,block:n,getRecordModel:o,schema:r}=e;const i=s.wS(n,t)||[],a=r[t];if(!a||"relation"!==a.type)return;return s.j$({relationValue:s.rq(i),propertySchema:a,getRecordModel:o}).map((e=>{const t=o(e);if(!t)return;const n=s.wS(t,"title");return n?g.Jcv(n):void 0})).join(", ")},rollup:e=>{const{property:t,schema:n}=e,o=n[t];if(!o||"rollup"!==o.type||!o.aggregation||"show_unique"===o.aggregation)return l.kJ(e);{const t=l.O0(e);if(void 0===t)return;if("text"===t.type)return t.value;if("number"===t.type)return t.value;if("date"===t.type)return t.value;(0,r.t1)(t)}},number:e=>{let{property:t,block:n}=e;const o=s.wS(n,t)||[];return s.VY(o)},file:e=>{let{property:t,block:n}=e;const o=s.wS(n,t)||[];return s.g(o).map((e=>{let{url:t}=e;return t})).join(", ")},formula:e=>{const{intl:t,userTimeZone:n,formulaTimeoutTimestampMs:o,depth:r,visitedProperties:i}=e.collectionRequestContext;return"v2"===e.schema[e.property].version?(0,a.py)({schema:e.schema,property:e.property,blockModel:e.block,getRecordModel:e.getRecordModel,intl:t,userTimeZone:n,depth:r+1,formulaTimeoutTimestampMs:o,visitedProperties:i,formula2Error:e.formula2Error,resultCache:e.collectionRequestContext.resultCache}):y({...e,collectionRequestContext:{...e.collectionRequestContext,depth:e.collectionRequestContext.depth+1}})},created_time:e=>{let{block:t,collectionRequestContext:n}=e;const{userTimeZone:o}=n,r=m.kk5.fromBlock(t);if(r.getCreatedTime())return p.CQ(r.getCreatedTime(),o)},last_edited_time:e=>{let{block:t,collectionRequestContext:n}=e;const{userTimeZone:o}=n,r=m.kk5.fromBlock(t);if(r.getLastEditedTime())return p.CQ(r.getLastEditedTime(),o)},created_by:e=>{let{block:t,getRecordModel:n,collectionRequestContext:o}=e;const{intl:r}=o,a=m.kk5.fromBlock(t).getCreatedByPointer();if(a)return(0,i.$4)(r,(0,i.Hl)({pointer:a,getRecordModel:n}));const s=a&&n(a);return(0,i.$4)(r,s)},last_edited_by:e=>{let{block:t,getRecordModel:n,collectionRequestContext:o}=e;const{intl:r}=o,a=m.kk5.fromBlock(t).getLastEditedByPointer();if(a)return(0,i.$4)(r,(0,i.Hl)({pointer:a,getRecordModel:n}))},button:()=>"",location:()=>"",last_visited_time:()=>"",auto_increment_id:e=>{let{property:t,block:n}=e;const o=s.wS(n,t)||[];return s.VY(o)},verification:()=>{}};function I(e){const{schema:t,property:n,collectionRequestContext:r}=e,{userTimeZone:i,intl:a}=r,s=_(e),l=t[n];if(!l)throw new Error("Property not found");if(o.hj(s)){if(!o.xV(s))return;return s.toString()}return"boolean"==typeof s?s.toString():d.U3(s)?"date"===l.type?(0,u.ZV)({value:s,userTimeZone:i,allowRelativeDates:!1,intl:a}):void 0:s}},318955:(e,t,n)=>{n.d(t,{as:()=>s,b$:()=>a,z6:()=>i});n(21703);var o=n(653965),r=n(202032);n(991905);function i(e){return"title"===e.type||"relation"===e.type||"url"===e.type||"select"===e.type||"multi_select"===e.type||"person"===e.type||"file"===e.type||"email"===e.type||"phone_number"===e.type||"text"===e.type||"created_by"===e.type||"last_edited_by"===e.type?"text":"number"===e.type?"number":"created_time"===e.type||"last_edited_time"===e.type||"date"===e.type?"date":"checkbox"===e.type?"checkbox":"rollup"===e.type?e.aggregation&&"show_unique"!==e.aggregation?(0,r.W6)((0,r.gu)(e.aggregation)):"text":"formula"===e.type&&e.formula?"number"===e.formula.result_type?"number":"date"===e.formula.result_type?"date":"checkbox"===e.formula.result_type?"checkbox":"text":"text"}function a(e){if(!e)return[];if("conditional"===e.type)return o.G0(a(e.condition),a(e.true),a(e.false));if("function"===e.type||"operator"===e.type){const t=e.args||[];return o.G0(...t.map(a))}return"property"===e.type?[e.id]:[]}function s(e){if("conditional"===e.type)return{type:e.type,condition:s(e.condition),true:s(e.true),false:s(e.false),result_type:e.result_type};if("constant"===e.type)return{type:e.type,value:e.value,value_type:e.value_type,result_type:e.result_type};if("function"===e.type){const t=e.args||[];return{type:e.type,name:e.name,args:t.map(s),result_type:e.result_type}}if("operator"===e.type){const t=e.args||[];return{type:e.type,operator:e.operator,name:e.name,args:t.map(s),result_type:e.result_type}}if("symbol"===e.type)return{type:e.type,name:e.name,result_type:e.result_type};if("property"===e.type)return{type:e.type,id:e.id,name:e.name,result_type:e.result_type};if("error"===e.type)return{type:e.type,message:e.message,result_type:e.result_type,size:e.size};throw new Error("Invalid formula type.")}},991905:(e,t,n)=>{n.d(t,{Gn:()=>I,_G:()=>g,aV:()=>w,uf:()=>C,wk:()=>T});var o=n(709291),r=n(307032),i=n(619584),a=n(640506),s=n(407057),l=n(253877),c=n(464340),d=n(471924);const u=(0,o.defineMessages)({e:{id:"database.formula.constant.e.description",defaultMessage:"The base of the natural logarithm."},pi:{id:"database.formula.constant.pi.description",defaultMessage:"The ratio of a circle's circumference to its diameter."},if:{id:"database.formula.operator.if.description",defaultMessage:"Switches between two options based on another value."},add:{id:"database.formula.operator.add.description",defaultMessage:"Adds two numbers and returns their sum, or concatenates two strings."},subtract:{id:"database.formula.operator.subtract.description",defaultMessage:"Subtracts two numbers and returns their difference."},multiply:{id:"database.formula.operator.multiply.description",defaultMessage:"Multiplies two numbers and returns their product."},divide:{id:"database.formula.operator.divide.description",defaultMessage:"Divides two numbers and returns their quotient."},pow:{id:"database.formula.operator.pow.description",defaultMessage:"Returns base to the exponent power, that is, baseexponent."},mod:{id:"database.formula.operator.mod.description",defaultMessage:"Divides two numbers and returns their remainder."},unaryMinus:{id:"database.formula.operator.unaryMinus.description",defaultMessage:"Negates a number."},unaryPlus:{id:"database.formula.operator.unaryPlus.description",defaultMessage:"Converts its argument into a number."},not:{id:"database.formula.operator.not.description",defaultMessage:"Returns the logical NOT of its argument."},and:{id:"database.formula.operator.and.description",defaultMessage:"Returns the logical AND of its two arguments."},or:{id:"database.formula.operator.or.description",defaultMessage:"Returns the logical OR of its two arguments."},equal:{id:"database.formula.operator.equal.description",defaultMessage:"Returns true if its arguments are equal, and false otherwise."},unequal:{id:"database.formula.operator.unequal.description",defaultMessage:"Returns false if its arguments are equal, and true otherwise."},larger:{id:"database.formula.operator.larger.description",defaultMessage:"Returns true if the first argument is larger than the second."},largerEq:{id:"database.formula.operator.largerEq.description",defaultMessage:"Returns true if the first argument is larger than or equal to than the second."},smaller:{id:"database.formula.operator.smaller.description",defaultMessage:"Returns true if the first argument is smaller than the second."},smallerEq:{id:"database.formula.operator.smallerEq.description",defaultMessage:"Returns true if the first argument is smaller than or equal to than the second."},concat:{id:"database.formula.function.concat.description",defaultMessage:"Concatenates its arguments and returns the result."},join:{id:"database.formula.function.join.description",defaultMessage:"Inserts the first argument between the rest and returns their concatenation."},slice:{id:"database.formula.function.slice.description",defaultMessage:"Extracts a substring from a string from the start index (inclusively) to the end index (optional and exclusively)."},length:{id:"database.formula.function.length.description",defaultMessage:"Returns the length of a string."},format:{id:"database.formula.function.format.description",defaultMessage:"Formats its argument as a string."},toNumber:{id:"database.formula.function.toNumber.description",defaultMessage:"Parses a number from text."},contains:{id:"database.formula.function.contains.description",defaultMessage:"Returns true if the second argument is found in the first."},replace:{id:"database.formula.function.replace.description",defaultMessage:"Replaces the first match of a regular expression with a new value."},replaceAll:{id:"database.formula.function.replaceAll.description",defaultMessage:"Replaces all matches of a regular expression with a new value."},test:{id:"database.formula.function.test.description",defaultMessage:"Tests if a string matches a regular expression."},empty:{id:"database.formula.function.empty.description",defaultMessage:"Tests if a value is empty."},abs:{id:"database.formula.function.abs.description",defaultMessage:"Returns the absolute value of a number."},cbrt:{id:"database.formula.function.cbrt.description",defaultMessage:"Returns the cube root of a number."},ceil:{id:"database.formula.function.ceil.description",defaultMessage:"Returns the smallest integer greater than or equal to a number."},exp:{id:"database.formula.function.exp.description",defaultMessage:"Returns E^x, where x is the argument, and E is Euler's constant (2.718…), the base of the natural logarithm."},floor:{id:"database.formula.function.floor.description",defaultMessage:"Returns the largest integer less than or equal to a number."},ln:{id:"database.formula.function.ln.description",defaultMessage:"Returns the natural logarithm of a number."},log10:{id:"database.formula.function.log10.description",defaultMessage:"Returns the base 10 logarithm of a number."},log2:{id:"database.formula.function.log2.description",defaultMessage:"Returns the base 2 logarithm of a number."},max:{id:"database.formula.function.max.description",defaultMessage:"Returns the largest of zero or more numbers."},min:{id:"database.formula.function.min.description",defaultMessage:"Returns the smallest of zero or more numbers."},round:{id:"database.formula.function.round.description",defaultMessage:"Returns the value of a number rounded to the nearest integer."},sign:{id:"database.formula.function.sign.description",defaultMessage:"Returns the sign of the x, indicating whether x is positive, negative or zero."},sqrt:{id:"database.formula.function.sqrt.description",defaultMessage:"Returns the positive square root of a number."},start:{id:"database.formula.function.start.description",defaultMessage:"Returns the start of a date range."},end:{id:"database.formula.function.end.description",defaultMessage:"Returns the end of a date range."},now:{id:"database.formula.function.now.description",defaultMessage:"Returns the current date and time."},timestamp:{id:"database.formula.function.timestamp.description",defaultMessage:"Returns an integer number from a Unix millisecond timestamp, corresponding to the number of milliseconds since January 1, 1970."},fromTimestamp:{id:"database.formula.function.fromTimestamp.description",defaultMessage:"Returns a date constructed from a Unix millisecond timestamp, corresponding to the number of milliseconds since January 1, 1970."},dateAdd:{id:"database.formula.function.dateAdd.description",defaultMessage:'Add to a date. The last argument, unit, can be one of: "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", or "milliseconds".'},dateSubtract:{id:"database.formula.function.dateSubtract.description",defaultMessage:'Subtract from a date. The last argument, unit, can be one of: "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", or "milliseconds".'},dateBetween:{id:"database.formula.function.dateBetween.description",defaultMessage:'Returns the time between two dates. The last argument, unit, can be one of: "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", or "milliseconds".'},formatDate:{id:"database.formula.function.formatDate.description",defaultMessage:"Format a date using the Moment standard time format string."},minute:{id:"database.formula.function.minute.description",defaultMessage:"Returns an integer number, between 0 and 59, corresponding to minutes in the given date."},hour:{id:"database.formula.function.hour.description",defaultMessage:"Returns an integer number, between 0 and 23, corresponding to hour for the given date."},day:{id:"database.formula.function.day.description",defaultMessage:"Returns an integer number corresponding to the day of the week for the given date: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on."},date:{id:"database.formula.function.date.description",defaultMessage:"Returns an integer number, between 1 and 31, corresponding to day of the month for the given."},month:{id:"database.formula.function.month.description",defaultMessage:"Returns an integer number, between 0 and 11, corresponding to month in the given date according to local time. 0 corresponds to January, 1 to February, and so on."},year:{id:"database.formula.function.year.description",defaultMessage:"Returns a number corresponding to the year of the given date."},id:{id:"database.formula.function.id.description",defaultMessage:"Returns a unique string id for each entry."},properties:{id:"database.formula.category.properties",defaultMessage:"Properties"},constants:{id:"database.formula.category.constants",defaultMessage:"Constants"},operators:{id:"database.formula.category.operators",defaultMessage:"Operators"},functions:{id:"database.formula.category.functions",defaultMessage:"Functions"}});let p=function(e){return e[e.property=0]="property",e[e.constant=1]="constant",e[e.operator=2]="operator",e[e.function=3]="function",e}({});p.property,p.constant,p.operator,p.function,p.property,u.properties,p.constant,u.constants,p.operator,u.operators,p.function,u.functions;const m=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],g={e:{name:"e",value:Math.E,category:p.constant,descriptionMessage:u.e,resultType:"number",examples:["e == 2.718281828459045"]},pi:{name:"pi",value:Math.PI,category:p.constant,descriptionMessage:u.pi,resultType:"number",examples:["2 * pi == 6.283185307179586"]},true:{name:"true",value:!0,category:p.constant,descriptionMessage:void 0,resultType:"checkbox",examples:['true ? "yes" : "no" == "yes"']},false:{name:"false",value:!1,category:p.constant,descriptionMessage:void 0,resultType:"checkbox",examples:['false ? "yes" : "no" == "no"']}};function f(e){return{resultType:e,arity:[e,e]}}function h(e){return{resultType:e,arity:[e]}}const v=f("number"),y=f("checkbox"),b=h("number"),_=h("date"),S={resultType:"number",arity:["date"]},k=[{resultType:"checkbox",arity:["text","text"]},{resultType:"checkbox",arity:["checkbox","checkbox"]},{resultType:"checkbox",arity:["date","date"]},{resultType:"checkbox",arity:["number","number"]}];function w(e){if(I.hasOwnProperty(e))return I[e]}function x(e){return e.some((e=>"string"==typeof e))?e.map((e=>e||"")):e.map((e=>e||0))}const I={if:{name:"if",apply:e=>e[0]?e[1]:e[2],operator:"?",category:p.operator,descriptionMessage:u.if,signatures:[{resultType:"text",arity:["checkbox","text","text"]},{resultType:"number",arity:["checkbox","number","number"]},{resultType:"checkbox",arity:["checkbox","checkbox","checkbox"]},{resultType:"date",arity:["checkbox","date","date"]}],examples:["true ? 1 : -1 == 1",'if(false, "yes", "no") == "no"']},add:{name:"add",apply:e=>{const t=x(e);return t[0]+t[1]},operator:"+",category:p.operator,descriptionMessage:u.add,signatures:[v,{resultType:"text",arity:["text","text"]}],examples:["3 + 4 = 7","add(1, 3) == 4",'"add" + "text" == "addtext"']},subtract:{name:"subtract",apply:e=>{const t=x(e);return t[0]-t[1]},operator:"-",category:p.operator,descriptionMessage:u.subtract,signatures:[v],examples:["3 - 1 == 2","subtract(4, 5) == -1"]},multiply:{name:"multiply",apply:e=>{const t=x(e);return t[0]*t[1]},operator:"*",category:p.operator,descriptionMessage:u.multiply,signatures:[v],examples:["6 * 9 == 54","multiply(2, 10) == 20"]},divide:{name:"divide",apply:e=>{const t=x(e);return t[0]/t[1]},operator:"/",category:p.operator,descriptionMessage:u.divide,signatures:[v],examples:["12 / 4 == 3","divide(12, 3) == 4"]},pow:{name:"pow",apply:e=>{const t=x(e);return Math.pow(t[0],t[1])},operator:"^",category:p.operator,descriptionMessage:u.pow,signatures:[v],examples:["5 ^ 3 == 125","pow(2, 6) == 64"]},mod:{name:"mod",apply:e=>{const t=x(e);return t[0]%t[1]},operator:"%",category:p.operator,descriptionMessage:u.mod,signatures:[v],examples:["7 % 5 == 2","mod(3, 3) == 0"]},unaryMinus:{name:"unaryMinus",apply:e=>-x(e)[0],operator:"-",category:p.operator,descriptionMessage:u.unaryMinus,signatures:[b],examples:["-1 + 2 == 1","unaryMinus(42) == -42"]},unaryPlus:{name:"unaryPlus",apply:e=>+x(e)[0],operator:"+",category:p.operator,descriptionMessage:u.unaryPlus,signatures:[b,{resultType:"number",arity:["text"]},{resultType:"number",arity:["checkbox"]}],examples:['+ "42" == 42',"unaryPlus(true) == 1"]},not:{name:"not",apply:e=>!e[0],operator:"not",category:p.operator,descriptionMessage:u.not,signatures:[{resultType:"checkbox",arity:["checkbox"]}],examples:["not true == false","not(false) == true"]},and:{name:"and",apply:e=>e[0]&&e[1],operator:"and",category:p.operator,descriptionMessage:u.and,signatures:[y],examples:["true and false == false","and(true, true) == true"]},or:{name:"or",apply:e=>e[0]||e[1],operator:"or",category:p.operator,descriptionMessage:u.or,signatures:[y],examples:["false or true == true","or(false, false) == false"]},equal:{name:"equal",apply:(e,t)=>{const[n,o]=e;return a.U3(n)&&a.U3(o)?l.NK(n,t).start.valueOf()===l.NK(o,t).start.valueOf():n===o},operator:"==",category:p.operator,descriptionMessage:u.equal,signatures:k,examples:["(3 * 5 == 15) == true","equal(false, not true) == true"]},unequal:{name:"unequal",apply:(e,t)=>{const[n,o]=e;return a.U3(n)&&a.U3(o)?l.NK(n,t).start.valueOf()!==l.NK(o,t).start.valueOf():n!==o},operator:"!=",category:p.operator,descriptionMessage:u.unequal,signatures:k,examples:["(6 * 9 != 42) == false","(true != not false) == false"]},larger:{name:"larger",apply:(e,t)=>{const[n,o]=e;return a.U3(n)&&a.U3(o)?l.NK(n,t).start.valueOf()>l.NK(o,t).start.valueOf():n>o},operator:">",category:p.operator,descriptionMessage:u.larger,signatures:k,examples:["5 > 3 == true"]},largerEq:{name:"largerEq",apply:(e,t)=>{const[n,o]=e;return a.U3(n)&&a.U3(o)?l.NK(n,t).start.valueOf()>=l.NK(o,t).start.valueOf():n>=o},operator:">=",category:p.operator,descriptionMessage:u.largerEq,signatures:k,examples:["5 >= 3 == true","4 >= 4 == true"]},smaller:{name:"smaller",apply:(e,t)=>{const[n,o]=e;return a.U3(n)&&a.U3(o)?l.NK(n,t).start.valueOf()<l.NK(o,t).start.valueOf():n<o},operator:"<",category:p.operator,descriptionMessage:u.smaller,signatures:k,examples:["10 < 8 == false"]},smallerEq:{name:"smallerEq",apply:(e,t)=>{const[n,o]=e;return a.U3(n)&&a.U3(o)?l.NK(n,t).start.valueOf()<=l.NK(o,t).start.valueOf():n<=o},operator:"<=",category:p.operator,descriptionMessage:u.smallerEq,signatures:k,examples:["10 <= 8 == false","8 <= 8 == true"]}};function C(e){if(T.hasOwnProperty(e))return T[e]}const T={concat:{name:"concat",apply:e=>e?e.join(""):void 0,category:p.function,descriptionMessage:u.concat,signatures:[{resultType:"text",variadic:"text"}],examples:['"dog" +"go" == "doggo"','concat("dog", "go") == "doggo"']},join:{name:"join",apply:e=>e?e.slice(1).join(e[0]):void 0,category:p.function,descriptionMessage:u.join,signatures:[{resultType:"text",variadic:"text"}],examples:['join("-", "a", "b", "c") == "a-b-c"']},slice:{name:"slice",apply:e=>e&&e[0]?e[0].slice(e[1],e[2]):void 0,category:p.function,descriptionMessage:u.slice,signatures:[{resultType:"text",arity:["text","number"]},{resultType:"text",arity:["text","number","number"]}],examples:['slice("Hello world", 1, 5) == "ello"','slice("notion", 3) == "ion"']},length:{name:"length",apply:e=>e[0]?e[0].length:0,category:p.function,descriptionMessage:u.length,signatures:[{resultType:"number",arity:["text"]}],examples:['length("Hello world") == 11']},format:{name:"format",apply:(e,t,n)=>{const o=e[0];return a.U3(o)?(0,s.ZV)({value:o,userTimeZone:t,allowRelativeDates:!1,intl:n}):void 0!==o?o.toString():void 0},category:p.function,descriptionMessage:u.format,signatures:[{resultType:"text",arity:["number"]},{resultType:"text",arity:["checkbox"]},{resultType:"text",arity:["date"]},{resultType:"text",arity:["text"]}],examples:['format(42) == "42"','format(true) == "true"','format(now()) == "December 31, 1969 16:00 (PST)"']},toNumber:{name:"toNumber",apply:(e,t)=>{const n=e[0];if(a.U3(n))return l.NK(n,t).start.valueOf();if("boolean"==typeof n)return n?1:0;if("string"==typeof n){const e=parseFloat(n);return i.hj(e)?e:void 0}return i.hj(n)?n:void 0},category:p.function,descriptionMessage:u.toNumber,signatures:[{resultType:"number",arity:["text"]},{resultType:"number",arity:["number"]},{resultType:"number",arity:["checkbox"]},{resultType:"number",arity:["date"]}],examples:['toNumber("42") == 42',"toNumber(false) == 0"]},contains:{name:"contains",apply:e=>Boolean(e[0]&&e[0].includes(e[1])),category:p.function,descriptionMessage:u.contains,signatures:[{resultType:"checkbox",arity:["text","text"]}],examples:['contains("notion", "ion") == true']},replace:{name:"replace",apply:e=>{try{const t=e[0]?e[0].toString():"";return e[1]?t.replace(new RegExp(e[1]),e[2]||""):""}catch(t){return}},category:p.function,descriptionMessage:u.replace,signatures:[{resultType:"text",arity:["number","text","text"]},{resultType:"text",arity:["text","text","text"]},{resultType:"text",arity:["checkbox","text","text"]}],examples:['replace("1-2-3", "-", "!") == "1!2-3"']},replaceAll:{name:"replaceAll",apply:e=>{try{const t=e[0]?e[0].toString():"";return e[1]?t.replace(new RegExp(e[1],"g"),e[2]||""):""}catch(t){return}},category:p.function,descriptionMessage:u.replaceAll,signatures:[{resultType:"text",arity:["number","text","text"]},{resultType:"text",arity:["text","text","text"]},{resultType:"text",arity:["checkbox","text","text"]}],examples:['replaceAll("1-2-3", "-", "!") == "1!2!3"']},test:{name:"test",apply:e=>{try{const t=e[0]?e[0].toString():"";return new RegExp(e[1]).test(t)}catch(t){return}},category:p.function,descriptionMessage:u.test,signatures:[{resultType:"checkbox",arity:["number","text"]},{resultType:"checkbox",arity:["text","text"]},{resultType:"checkbox",arity:["checkbox","text"]}],examples:['test("1-2-3", "-") == true']},empty:{name:"empty",apply:e=>!Boolean(e[0]),category:p.function,descriptionMessage:u.empty,signatures:[{resultType:"checkbox",arity:["number"]},{resultType:"checkbox",arity:["text"]},{resultType:"checkbox",arity:["checkbox"]},{resultType:"checkbox",arity:["date"]}],examples:['empty("") == true']},abs:{name:"abs",apply:e=>Math.abs(e[0]),category:p.function,descriptionMessage:u.abs,signatures:[b],examples:["abs(-3) == 3"]},cbrt:{name:"cbrt",apply:e=>Math.cbrt(e[0]),category:p.function,descriptionMessage:u.cbrt,signatures:[b],examples:["cbrt(8) == 2"]},ceil:{name:"ceil",apply:e=>Math.ceil(e[0]),category:p.function,descriptionMessage:u.ceil,signatures:[b],examples:["ceil(4.2) == 5"]},exp:{name:"exp",apply:e=>Math.exp(e[0]),category:p.function,descriptionMessage:u.exp,signatures:[b],examples:["exp(1) == 2.718281828459045"]},floor:{name:"floor",apply:e=>Math.floor(e[0]),category:p.function,descriptionMessage:u.floor,signatures:[b],examples:["floor(2.8) == 2"]},ln:{name:"ln",apply:e=>Math.log(e[0]),category:p.function,descriptionMessage:u.ln,signatures:[b],examples:["ln(e) == 1"]},log10:{name:"log10",apply:e=>Math.log10(e[0]),category:p.function,descriptionMessage:u.log10,signatures:[b],examples:["log10(1000) == 3"]},log2:{name:"log2",apply:e=>Math.log2(e[0]),category:p.function,descriptionMessage:u.log2,signatures:[b],examples:["log2(64) == 6"]},max:{name:"max",apply:e=>Math.max.apply(void 0,e),category:p.function,descriptionMessage:u.max,signatures:[{resultType:"number",variadic:"number"}],examples:["max(5, 2, 9, 3) == 9"]},min:{name:"min",apply:e=>Math.min.apply(void 0,e),category:p.function,descriptionMessage:u.min,signatures:[{resultType:"number",variadic:"number"}],examples:["min(4, 1, 5, 3) == 1"]},round:{name:"round",apply:e=>Math.round(e[0]),category:p.function,descriptionMessage:u.round,signatures:[b],examples:["round(4.4) == 4","round(4.5) == 5"]},sign:{name:"sign",apply:e=>Math.sign(e[0]),category:p.function,descriptionMessage:u.sign,signatures:[b],examples:["sign(4) == 1","sign(-9) == -1","sign(0) == 0"]},sqrt:{name:"sqrt",apply:e=>Math.sqrt(e[0]),category:p.function,descriptionMessage:u.sqrt,signatures:[b],examples:["sqrt(144) == 12"]},start:{name:"start",apply:e=>{const t=e[0];if(a.U3(t)){if("daterange"===t.type){return{type:"date",start_date:t.start_date}}if("datetimerange"===t.type){return{type:"datetime",start_date:t.start_date,start_time:t.start_time,time_zone:t.time_zone}}return t}},category:p.function,descriptionMessage:u.start,signatures:[_],examples:['start(prop("Date")) == Feb 2, 1996']},end:{name:"end",apply:e=>{const t=e[0];if(a.U3(t)){if("daterange"===t.type){return{type:"date",start_date:t.end_date}}if("datetimerange"===t.type){return{type:"datetime",start_date:t.end_date,start_time:t.end_time,time_zone:t.time_zone,reminder:t.reminder}}return t}},category:p.function,descriptionMessage:u.end,signatures:[_],examples:['end(prop("Date")) == Feb 2, 1996']},now:{name:"now",apply:(e,t)=>l.R_(t),category:p.function,descriptionMessage:u.now,signatures:[{resultType:"date",arity:[]}],examples:["now() == Feb 2, 1996"]},timestamp:{name:"timestamp",apply:(e,t)=>{const n=e[0];if(a.U3(n))return l.NK(n,t).start.valueOf()},category:p.function,descriptionMessage:u.timestamp,signatures:[S],examples:["timestamp(now()) == 1512593154718"]},fromTimestamp:{name:"fromTimestamp",apply:(e,t)=>i.hj(e[0])?l.CQ(e[0],t):void 0,category:p.function,descriptionMessage:u.fromTimestamp,signatures:[{resultType:"date",arity:["number"]}],examples:["fromTimestamp(2000000000000) == Tue May 17 2033"]},dateAdd:{name:"dateAdd",apply:(e,t)=>{const[n,o,r]=e;if(!n||!i.hj(o)||m.indexOf(r)<0)return;const a=l.NK(n,t).start.plus({[r]:o}).valueOf();return"datetime"===n.type||"datetimerange"===n.type?l.CQ(a,n.time_zone):l.hT(a,t)},category:p.function,descriptionMessage:u.dateAdd,signatures:[{resultType:"date",arity:["date","number","text"]}],examples:m.map((e=>`dateAdd(date, amount, "${e}")`))},dateSubtract:{name:"dateSubtract",apply:(e,t)=>{const[n,o,r]=e;if(!n||!i.hj(o)||m.indexOf(r)<0)return;const a=l.NK(n,t).start.minus({[r]:o}).valueOf();return"datetime"===n.type||"datetimerange"===n.type?l.CQ(a,n.time_zone):l.hT(a,t)},category:p.function,descriptionMessage:u.dateSubtract,signatures:[{resultType:"date",arity:["date","number","text"]}],examples:m.map((e=>`dateSubtract(date, amount, "${e}")`))},dateBetween:{name:"dateBetween",apply:(e,t)=>{const[n,o,r]=e;if(!n||!o||m.indexOf(r)<0)return;const i=l.NK(n,t).start,a=l.NK(o,t).start;return Math.trunc(i.diff(a,r).get(r))},category:p.function,descriptionMessage:u.dateBetween,signatures:[{resultType:"number",arity:["date","date","text"]}],examples:m.map((e=>`dateBetween(date, date2, "${e}")`))},formatDate:{name:"formatDate",apply:(e,t,n)=>{const[o,r]=e;if(o&&r){const e=l.NK(o,t,n.locale).start;return(0,c.P)(e,r)}},category:p.function,descriptionMessage:u.formatDate,signatures:[{resultType:"text",arity:["date","text"]}],examples:['formatDate(now(), "MMMM D YYYY, HH:mm") == March 30 2010, 12:00','formatDate(now(), "YYYY/MM/DD, HH:mm") == 2010/03/30, 12:00','formatDate(now(), "MM/DD/YYYY, HH:mm") == 03/30/2010, 12:00','formatDate(now(), "HH:mm A") == 12:00 PM','formatDate(now(), "M/D/YY") == 3/30/10']},minute:{name:"minute",apply:(e,t)=>{const n=e[0];if(a.U3(n))return l.NK(n,t).start.minute},category:p.function,descriptionMessage:u.minute,signatures:[S],examples:["minute(now()) == 45"]},hour:{name:"hour",apply:(e,t)=>{const n=e[0];if(a.U3(n))return l.NK(n,t).start.hour},category:p.function,descriptionMessage:u.hour,signatures:[S],examples:["hour(now()) == 17"]},day:{name:"day",apply:(e,t)=>{const n=e[0];if(a.U3(n))return l.YC(l.NK(n,t).start)},category:p.function,descriptionMessage:u.day,signatures:[S],examples:["day(now()) == 3"]},date:{name:"date",apply:(e,t)=>{const n=e[0];if(a.U3(n))return l.NK(n,t).start.day},category:p.function,descriptionMessage:u.date,signatures:[S],examples:["date(now()) == 13"]},month:{name:"month",apply:(e,t)=>{const n=e[0];if(a.U3(n))return l.NK(n,t).start.month-1},category:p.function,descriptionMessage:u.month,signatures:[S],examples:["month(now()) == 11"]},year:{name:"year",apply:(e,t)=>{const n=e[0];if(a.U3(n))return l.NK(n,t).start.year},category:p.function,descriptionMessage:u.year,signatures:[S],examples:["year(now()) == 1984"]},id:{name:"id",apply:(e,t,n,o)=>(0,r.cj)(o.id),category:p.function,descriptionMessage:u.id,signatures:[{resultType:"text",arity:[]}],examples:[`id() == "${(0,r.cj)(d.Il())}"`]}}},576218:(e,t,n)=>{n.d(t,{A6:()=>m,Ck:()=>h,H0:()=>v,OH:()=>k,S3:()=>b,UB:()=>_,YD:()=>p,Zw:()=>S,iC:()=>g,qW:()=>y});n(757658);var o=n(653965),r=n(940470),i=n(401898),a=n(180951),s=n(676725),l=n(606287),c=n(23867),d=n(421838),u=n(335102);function p(e){if(void 0!==e)return[f(e)]}function m(e){const t=e||[],n=[];for(const o of t){const e=d.hDy(o),t=d.hH9(e)||d.V8Y(e)||d.sP4(e)||d.K9C(e);t&&n.push(t);const r=d.WiV(o).split(",");for(const o of r){const e=o.trim(),t=e.indexOf('"'),r=e.lastIndexOf('"');if(t>=0&&r>=0){const o=e.slice(t+1,r);o.length>0&&n.push(o)}else"true"===e?n.push(!0):"false"===e&&n.push(!1)}}return n}function g(e){const t=o.mN(e,(e=>JSON.stringify(e)));if(0!==t.length)return d.Zxt([["["],...(0,s.Z)(t.map(f),(()=>[", "])),["]"]])}function f(e){return"string"==typeof e?[`"${e}"`]:"boolean"==typeof e?[`${e}`]:d.YCD(e)}function h(e,t){return e.filter((e=>JSON.stringify(e)!==JSON.stringify(t)))}function v(e,t,n){const o=y(e,t,n);if(o)return function(e){if("text"===e.type)return e;if("number"===e.type)return e;if("checkbox"===e.type)return e;if("date"===e.type)return e;if("block_array"===e.type)return{type:"array",of:{type:"block",collection:e.collection}};if("person_array"===e.type)return{type:"array",of:{type:"person"}};if("select"===e.type)return{type:"select",collection:e.collection,property:e.property};if("select_array"===e.type)return{type:"array",of:{type:"select",collection:e.collection,property:e.property}};(0,i.t1)(e)}(o)}function y(e,t,n){if("text"===n.type||"url"===n.type||"email"===n.type||"phone_number"===n.type||"title"===n.type)return{type:"text"};if("checkbox"===n.type)return{type:"checkbox"};if("multi_select"===n.type)return{type:"select_array",collection:e,property:t};if("select"===n.type||"status"===n.type)return{type:"select",collection:e,property:t};if("person"===n.type)return{type:"person_array"};if("number"===n.type||"auto_increment_id"===n.type)return{type:"number"};if("date"===n.type)return{type:"date"};if("relation"===n.type){if(n.collection_pointer)return{type:"block_array",collection:{table:l.vF,id:n.collection_pointer.id,spaceId:(0,c.C)(n.collection_pointer.spaceId)}};if(n.collection_id)return{type:"block_array",collection:{table:l.vF,id:n.collection_id,spaceId:e.spaceId}}}else{if("formula"===n.type||"rollup"===n.type||"last_edited_by"===n.type||"last_edited_time"===n.type||"button"===n.type||"created_time"===n.type||"created_by"===n.type||"file"===n.type||"location"===n.type||"verification"===n.type||"last_visited_time"===n.type)return;(0,i.t1)(n)}}function b(e){return"string"!=typeof e&&"boolean"!=typeof e}function _(e){return(e.value??[]).map((e=>{if(!d.km_(e))return;const t=d.sP4(e[1]);if(!t)return;return d.vmO(t).id})).filter(i.$K)}function S(e,t){return{...e,value:e.value?e.value.map((e=>{if(!d.km_(e))return e;const n=o.Xh(e);for(const o of n[1])d.wjk(o)&&(o[1].id=t(o[1].id));return n})):void 0}}async function k(e){const{context:t,executeFormula:n,ignoreErrors:o,value:s}=e,{returnType:l}=t,c=s.value;if("simple"===s.type){let e=c;if(function(e){if(!(0,i.$K)(e))return!1;let t;for(const n of e)if(t=d.hDy(n),0!==t.length&&d.IVR(t))return!0;return!1}(e)){const a=await async function(e){const{context:t,executeFormula:n,ignoreErrors:o,value:a}=e;if(!(0,i.$K)(a))return{value:void 0};const s=[];let l=[];for(const i of a)if(l=d.hDy(i),d.sP4(l)){const e=await n(t,[i]);if(r.x.isFail(e)&&!o)return e;r.x.isSuccess(e)&&s.push(...w((0,u.j4)(e.value),l))}else if(d.jRb(l)){const e=await n(t,[i]);if(r.x.isFail(e)&&!o)return e;r.x.isSuccess(e)&&s.push(...w((0,u.j4)(e.value),l))}else s.push(i);return{value:s}}({context:t,executeFormula:n,value:e});if(r.x.isFail(a))return o?{value:{type:"undefined"}}:a;e=a.value}if("number"===l.type){const t=a.VY(e);return(0,i.$K)(t)&&!isNaN(t)?{value:{type:"number",value:t}}:{value:{type:"undefined"}}}if("text"===l.type)return{value:{type:"text",value:e??[]}};if("checkbox"===l.type){return{value:{type:"checkbox",value:"true"===d.QaF(e)}}}return n(t,e)}return"formula"===s.type?n(t,c):(0,i.t1)(s.type)}function w(e,t){if(0===d.VrM(e))return e;const n=t.filter((e=>d.inx(e)));return 0===n.length?e:d.Zxt(e.map((e=>{const t=d.hDy(e);return 0===t.length?d.V3y(d.WiV(e),n):d.V3y(d.WiV(e),d.wrb(t,n))})))}},158573:(e,t,n)=>{n.d(t,{C6:()=>y,DF:()=>c,T6:()=>p,V5:()=>u,ZP:()=>h,uI:()=>d});var o=n(443261),r=n.n(o),i=n(653965),a=n(401898),s=n(133728);const l=2e6,c=1e6,d=1e5,u=1e4,p=1e3,m=900;function g(e){return e.normalize("NFKD")}function f(e){return-e.score}function h(e,t,n,o){const r=(null==o?void 0:o.minThreshold)||0,a=(null==o?void 0:o.getSortScore)||f,s=i.oA(t.map((t=>{const i=y(e,n(t),{normalizeFuzzyScore:null==o?void 0:o.normalizeFuzzyScore});if(i&&i.score>r)return{original:t,score:i.score}})));return i.MR(s,(e=>a(e))).map((e=>e.original))}function v(e,t,n){const o=g(e).toLowerCase(),r=g(t).toLowerCase();if(r===o)return{isExactMatch:!0};const a=r.indexOf(o);if(0===a)return{isPrefixMatch:!0};if(" "===r[a-1])return(0,s.oH)(r.substring(a,a+e.length))?{isExactMatch:!0}:{isWordPrefixMatch:!0};if(a>-1)return{isSubstringMatch:!0};if(o.includes(" ")){const e=function(e,t){const n=i.hr(e.trim()).replace(/\s+/g,"(.*?) "),o=new RegExp(n),r=t.match(o);return r?{result:!0,distance:r.slice(1).reduce(((e,t)=>e+t.length),0)}:{result:!1}}(o,r);return e.result?{isInOrderTokenMatch:!0,inOrderMatchDistance:e.distance}:void 0}return null!=n&&n.ignoreFuzzyFallback?void 0:{isFuzzyMatch:!0}}function y(e,t,n){const o=g(e),i=g(t),s=r().match(o,i,n);if(!s)return;const f=o.toLowerCase(),h=i.toLowerCase(),y=v(f,h,n);if(y){if("isExactMatch"in y)return{...s,score:c,matchMetadata:y};if("isPrefixMatch"in y)return{...s,score:d,matchMetadata:y};if("isWordPrefixMatch"in y)return{...s,score:u,matchMetadata:y};if("isSubstringMatch"in y)return{...s,score:p,matchMetadata:y};if("isInOrderTokenMatch"in y)return{...s,score:m-y.inOrderMatchDistance,matchMetadata:y};if("isFuzzyMatch"in y){const e=function(e,t,n){const o=e.charAt(0);let i=n;for(let a=1;a<t.length;++a){if(t.charAt(a)!==o)continue;const n=r().match(e,t.substring(a));n&&n.score>i&&(i=n.score)}return i}(f,h,s.score);return{...s,score:null!=n&&n.normalizeFuzzyScore?b(f,e):e,matchMetadata:y}}if("isExactIdMatch"in y)return{...s,score:l,matchMetadata:y};(0,a.t1)(y)}}function b(e,t){if(t){return function(e){const{inputValue:t,inputMin:n,inputMax:o,targetMin:r,targetMax:i}=e,a=o-n;if(0===a)return i;return(t-n)/a*(i-r)+r}({inputValue:t,inputMin:0,inputMax:(n=e.length,Math.pow(2,n+1)-n-2),targetMin:0,targetMax:m-1})}return 0;var n}},238297:(e,t,n)=>{n.d(t,{Es:()=>g,J2:()=>m,Rd:()=>c,ky:()=>p});var o=n(541432),r=n(77492),i=n(959753),a=n(600606),s=n(421202),l=n(606287);n(213493);async function c(e){const t=await d({blockModel:e.block,loadRecordModel:e.loadRecordModel});if(t)return t;const n=e.block.type;return e.bypassValidation||(0,o.Pm)(n)?h(e):void 0}async function d(e){const{loadRecordModel:t,blockModel:n}=function(e){return"loadRecordModel"in e?e:{blockModel:i.kk5.fromBlock(e.blockValue),loadRecordModel:i.s85.fromLoadRecordValueFn(e.loadRecordValue)}}(e),o=n.getParentPointer();if(o.table===l.vF)return await t(o)}function u(e){return"getRecordModel"in e?e:{block:i.kk5.fromBlock(e.block),getRecordModel:i.omK.fromGetRecordValueFn(e.getRecordValue)}}function p(e){const t=u(e),n=m(t);if(n)return t.getRecordModel.getRecordValue(n.pointer)}function m(e){const t=u(e),n=function(e){const{getRecordModel:t,block:n}=e,o=n.getParentPointer();if(o.table===l.vF)return t(o)}(t);if(n)return n;const r=t.block.getType();return(0,o.Pm)(r)?f(t):void 0}function g(e){var t;const n=u(e),r=function(e){const{block:t}=e,n=t.getParentPointer();if(n.table===l.vF)return n}(n);if(r)return r;const i=n.block.getType();return(0,o.Pm)(i)?null===(t=f(n))||void 0===t?void 0:t.pointer:void 0}const{sync:f,async:h}=r.R.makeRunners((function*(e){const{block:t}=e,n=new Set;let o=t.getParentPointer();for(;o&&!n.has(o.id);){if(n.add(o.id),a.dr.isEqual(o,t.pointer))return;if(o.table!==s.iU)return;const e=yield*r.R.fetchRecord(o);if(!e)return;if(!e.isCollectionView()){o=e.getParentPointer();continue}const i=e.getCollectionPointer();if(!i)return;const l=yield*r.R.fetchRecord(i);if(!l)return;const c=l.getRootPagePointer();return l.isPageTreeCollection()&&c&&a.dr.isEqual(c,o)?l:void 0}}))},842875:(e,t,n)=>{n.d(t,{m:()=>i,r:()=>a});var o=n(653965);const r="UTC";function i(){return Intl.DateTimeFormat().resolvedOptions().timeZone||r}const a=o.HP(i)},295519:(e,t,n)=>{n.d(t,{i:()=>d,n:()=>g});n(757658);var o=n(653965),r=n(164945),i=n(435011),a=n(114714),s=n(399036),l=n(143690),c=n(406695);function d(e,t,n,o){if(e||(e={}),o===c.j5.Table||o===c.j5.Relation){if(e={...e,table_properties:m(e.table_properties||[],t,"force",!0),collection_group_by:y(e,t),collection_groups:S(e.collection_groups),property_filters:k(e,t),table_frozen_column_index:void 0!==e.table_frozen_column_index?Math.max(e.table_frozen_column_index,-1):-1},o===c.j5.Relation){const n=m(e.table_properties||[],t,"force",!0);e.collection_relation_options||(e.collection_relation_options={});if(n.filter((e=>{var n;return"relation"===(null===(n=t[e.property])||void 0===n?void 0:n.type)})).map((t=>{e.collection_relation_options&&!e.collection_relation_options[t.property]&&(e.collection_relation_options[t.property]={})})),e.collection_relation_options){const t={};Object.entries(e.collection_relation_options).map((e=>{let[n,o]=e;const r=o.related_properties;let i;if(r)if(r.find((e=>"title"===e.property)))if(r.find((e=>"title"===e.property&&!e.visible))){const e=r.find((e=>"title"===e.property&&!e.visible));e&&(e.visible=!0)}else i=r;else i=[{property:"title",visible:!0},...r];else i=[{property:"title",visible:!0}];t[n]={related_properties:i}})),e.collection_relation_options=t}}}else if(o===c.j5.Board){const o=u(e.board_cover,t),r=e.board_properties||[];!0!==(e={...e,board_columns_by:v(e,t,n),board_cover:o,board_columns:e.board_columns||e.board_groups2||[],board_properties:g({propertyFormats:e.board_properties||[],schema:t,titleProperty:(0,c.Lw)(o)?"allow":"force"}),collection_group_by:y(e,t),collection_groups:S(e.collection_groups),property_filters:k(e,t),table_wrap:void 0===e.table_wrap||e.table_wrap}).board_title_visible||r.find((e=>"title"===e.property))||(e.board_properties=(0,c.Rt)(e.board_properties||[],"title",!0),delete e.board_title_visible)}else if(o===c.j5.Calendar)e={...e,calendar_properties:g({propertyFormats:e.calendar_properties||[],schema:t,titleProperty:"force"}),property_filters:k(e,t)};else if(o===c.j5.List)e={...e,list_properties:g({propertyFormats:e.list_properties||[],schema:t,titleProperty:"force"}),collection_group_by:y(e,t),collection_groups:S(e.collection_groups),property_filters:k(e,t)};else if(o===c.j5.Gallery){const n=u(e.gallery_cover,t);!0===(e={...e,gallery_cover:n,gallery_properties:g({propertyFormats:e.gallery_properties||[],schema:t,titleProperty:(0,c.Lw)(n)?"allow":"force"}),collection_group_by:y(e,t),collection_groups:S(e.collection_groups),property_filters:k(e,t)}).gallery_title_visible&&(e.gallery_properties=(0,c.Rt)(e.gallery_properties||[],"title",!0),delete e.gallery_title_visible)}else if(o===c.j5.Timeline){const n=m(e.timeline_table_properties||[],t,"allow",!1),o=n.some((e=>{let{visible:t}=e;return Boolean(t)})),r=(0,c.vP)(Boolean(e.timeline_show_table),n);e={...e,timeline_properties:g({propertyFormats:e.timeline_properties||[],schema:t,titleProperty:r?"allow":"force"}),timeline_table_properties:n,timeline_show_table:Boolean(e.timeline_show_table&&o),collection_group_by:y(e,t),collection_groups:S(e.collection_groups),property_filters:k(e,t)}}else if(o===c.j5.Page||o===c.j5.Collection){var r;const n=g({propertyFormats:e.collection_page_properties||[],schema:t,titleProperty:"disallow"}),o=t=>{const n=e.property_visibility;if(n){const e=n.find((e=>{let{property:n}=e;return n===t}));return e&&e.visibility}},i=["hide","hide_if_empty"],a=n.some((e=>i.includes(o(e.property)||"show")))?"hide_if_empty":"show";e={...e,page_section_visibility:e.page_section_visibility||{backlinks:"section_collapsed",comments:"section_show",margin_comments:"inline"},property_visibility:n.map((e=>({property:e.property,visibility:o(e.property)||a}))),collection_page_sections:null===(r=e.collection_page_sections)||void 0===r?void 0:r.filter((e=>e&&Boolean(t[e.section]))),collection_page_properties:n}}else o===c.j5.PageView?e={...e}:o===c.j5.Chart&&(e={...e,chart_subgroups:e.chart_subgroups||[],chart_config:f(e.chart_config,t)});const i=e.inline_collection_first_load_limit;return i&&"load_all"===i.type&&(e.inline_collection_first_load_limit={type:"load_limit",limit:100}),e}function u(e,t){if(e&&"property"===e.type){const n=t[e.property];return n&&"file"===n.type?e:void 0}return e}function p(e){const t=Object.keys(e);return o.MR(t,(t=>{if(s.pn(t))return"";{const n=e[t];return n?n.name:""}}))}function m(e,t,n,r){let i=[...e];i=i.filter((e=>e&&Boolean(t[e.property])));const a=s.uS(t);"allow"===n?i=(0,c.Rt)(i,a,!1):"disallow"===n?i=h(i,a):"force"===n&&(i=(0,c.Rt)(i,a,!0));const l=i.some((e=>!e.visible)),d=p(t);for(const o of d){if(s.HF(o))continue;s.us(o)&&(i=h(i,"title"));const n=e.find((e=>e.property===o)),a=t[o];let c=!1;a&&s.p_(a)&&a.hideByDefaultInUnconfiguredViews&&(c=!0),n||(l||!r||c?i.push({property:o,visible:!1}):i.push({property:o,visible:!0}))}return i=i.map((e=>{if(e.width)return e;{const t=s.pn(e.property)?c.Zg:c.Nx;return{...e,width:t}}})),i=o.mN(i,(e=>{let{property:t}=e;return t})),i}function g(e){const{propertyFormats:t,schema:n,titleProperty:r}=e;let i=[...t];i=i.filter((e=>e&&Boolean(n[e.property]))),"allow"===r?i=(0,c.Rt)(i,"title",!1):"disallow"===r?i=h(i,"title"):"force"===r&&(i=(0,c.Rt)(i,"title",!0));const a=p(n);for(const o of a)if(!s.pn(o)){i.find((e=>e.property===o))||i.push({property:o,visible:!1})}return i=o.mN(i,(e=>{let{property:t}=e;return t})),i}function f(e,t){var n;if(!e)return e;if("placeholder"===e.type)return e;const i=o.Xh(e);if(i.chartFormat&&void 0===i.chartFormat.mainSort&&void 0!==i.chartFormat.axisSort&&(i.chartFormat.mainSort=i.chartFormat.axisSort,i.chartFormat.axisSort=void 0),"groups_reducer"===(null===(n=i.dataConfig)||void 0===n?void 0:n.type)){const e=b(i.dataConfig.groupBy,t);if(e&&(i.dataConfig.groupBy=e),(0,r.u)(i)){var a;const e=null===(a=i.dataConfig.aggregationConfig.stackOptions)||void 0===a?void 0:a.groupBy;if(e){const n=b(e,t);n&&(i.dataConfig.aggregationConfig.stackOptions.groupBy=n)}}}return i}function h(e,t){return e.filter((e=>{let{property:n}=e;return n!==t}))}function v(e,t,n){let o;if(e.board_columns_by)o=b(e.board_columns_by,t);else if(n&&n.group_by){const e=t[n.group_by];e&&(0,a.g4)(e)&&(o={property:n.group_by,type:e.type,sort:{type:"manual"}})}return o}function y(e,t){let n;return e.collection_group_by&&(n=b(e.collection_group_by,t)),n}function b(e,t){if(!e)return;const n=t[e.property];if(n&&(0,a.LG)(n)){if("formula"===e.type){let t=(0,i.mm)(n);return"block"===t&&(t="relation"),t===e.groupBy.type?e:(0,a.fw)({property:e.property,propertySchema:n})}return n.type===e.type&&e.sort&&(0,a.YG)(e).includes(e.sort.type)?e:(0,a.fw)({property:e.property,propertySchema:n})}}const _=100;function S(e){const t=e?e.filter((e=>!(0,a.eF)(e))):[],n=e?e.filter((e=>(0,a.eF)(e))):[];return t.slice(0,_).concat(n)}function k(e,t){if(e.property_filters){const n=e.property_filters.map((e=>{let{id:n,filter:o}=e;const r=(0,l.dN)(o,t);return r&&{id:n,filter:r}}));return o.oA(n)}}},305773:(e,t,n)=>{n.d(t,{ZP:()=>d,jy:()=>u,xN:()=>c});n(757658);var o=n(401898),r=n(180951),i=n(643593),a=n(959753),s=n(421838);const l=["source"];function c(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0;const c=[],d=[],m=e.getProperties(),g=e.useCrdt()&&e.getTextSliceTree();if(g){const e=u(r.g(g.getTextValue()),[t,n],o,a);c.push(...e)}if(m){const e=Object.keys(m);for(const i of e){const e=m[i],g=e?r.g(e):void 0;if(s){const e=p(g,t,n,o,a);if(e&&e.length>0&&l.includes(i)){const t={pointer:s,path:["properties",i],command:"set",args:e};d.push(t)}}const f=u(g,[t,n],o,a);c.push(...f)}}const f=e.getFormat();if(f){const{page_cover:e,page_icon:r}=f;if(e){const r=(0,i.mV)(e,[t,n],o,a);r&&c.push(r)}if(r){const e=(0,i.mV)(r,[t,n],o,a);e&&c.push(e)}}return{files:c,operations:d}}function d(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0;return a.kk5.fromBlock(e).getSecureFiles(t,n,o,r,i)}function u(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return void 0===e?[]:e.map((e=>(0,i.mV)(e.url,t,n,r))).filter(o.$K)}function p(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4?arguments[4]:void 0;if(void 0===e)return;const l=e.map((e=>(0,i.Wv)(e.url,t,n,r,a))).filter(o.$K);return l&&l.length>0?[s.V3y(l[0].link)]:void 0}},589789:(e,t,n)=>{n.d(t,{P_:()=>a,gd:()=>s,r3:()=>l});var o=n(266897),r=n(177420),i=n(519889);const a=(0,o.dp)(i.s$),s=((0,o.dp)(i.el),(0,o.dp)(i.T0),(0,o.dp)(i.fs),(0,o.dp)(i.Az)),l=(0,o.D$)(r._H)},176490:(e,t,n)=>{n.d(t,{C:()=>c,DK:()=>a,HV:()=>l,Jr:()=>d,Lh:()=>s,eV:()=>i,u9:()=>r});var o=n(137810);const r=1.3,i=1.875;function a(e){return u(e.fontSizeValue||i,e.fontFamily)}const s=1.5;function l(e){return u(e.fontSizeValue||s,e.fontFamily)}const c=1.25;function d(e){return u(e.fontSizeValue||c,e.fontFamily)}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return{fontFamily:arguments.length>1?arguments[1]:void 0,fontWeight:o.Z.fontWeight.semibold,fontSize:`${e}em`,lineHeight:r,margin:0}}},45681:(e,t,n)=>{n.d(t,{T1:()=>E,A6:()=>D,Wr:()=>R,rb:()=>B});var o=n(653965),r=n(990559),i=n(180951),a=n(238297),s=n(606287);const l={derivePrimitiveOperations:function(e,t){const{collectionId:n,spaceId:o}=e.args,l=t(e.pointer);if(!l)return[];if(l.is_template)return[];const c=(0,a.ky)({block:l,getRecordValue:t});if((null==c?void 0:c.id)===n){const a=(0,r.Y7)({spaceId:o,parentTable:s.vF,parentId:n}),l=t(a),c=t({table:s.vF,id:n,spaceId:o});if(c&&l&&l.alive)return(0,r.FT)(c).flatMap((t=>[{pointer:e.pointer,command:"set",path:["properties",t],args:(0,i.e7)(l.next_value)},{pointer:a,command:"set",path:["next_value"],args:l.next_value+1}]))}return[]},getAdditionalRelatedPointers:function(e){const{collectionId:t,spaceId:n}=e.args;return[(0,r.Y7)({spaceId:n,parentTable:s.vF,parentId:t})]},invert:function(e,t){return[]}};n(21703),n(757658);var c=n(300482),d=n(673360);const u={derivePrimitiveOperations:function(e,t){const n=[];n.push({...e,command:"insertChildrenBefore"===e.command?"listBeforeMulti":"listAfterMulti",args:{...e.args}});const o=R(e.pointer.table,e.path);if(!o)throw new Error(`Unsupported operation table and operation path ${JSON.stringify(e)} `);return e.args.ids.forEach((r=>{const i={id:r,table:o,spaceId:e.pointer.spaceId};n.push({command:"update",pointer:i,path:[],args:{parent_table:e.pointer.table,parent_id:e.pointer.id,alive:!0}});const a=t(i);if(a&&a.parent_id&&a.parent_table&&a.parent_id!==e.pointer.id){const e=D(a.parent_table,o);e?n.push({command:"listRemove",pointer:{id:a.parent_id,table:a.parent_table,spaceId:a.space_id},path:e,args:{id:a.id}}):function(e){if(!e)throw new Error("Assertion failed in insertChildrenOperationHelper")}(a.parent_table===s.vF)}})),n},getAdditionalRelatedPointers:function(e){const t=R(e.pointer.table,e.path);if(!t)throw new Error(`Invalid operation ${JSON.stringify(e)}`);return e.args.ids.map((n=>({id:n,table:t,spaceId:e.pointer.spaceId})))},invert:function(e,t){const n=R(e.pointer.table,e.path);if(!n)throw new Error(`Invalid operation ${JSON.stringify(e)}`);return e.args.ids.flatMap((o=>{const r={id:o,table:n,spaceId:e.pointer.spaceId},i=t(r);if(i&&i.parent_table&&i.parent_id){if(D(i.parent_table,n)){const n=t({id:i.parent_id,table:i.parent_table,spaceId:i.space_id});if(n){if(i.parent_id===e.pointer.id&&i.parent_table===e.pointer.table){const t=D(i.parent_table,r.table);if(t){const r=(0,c.f4)(n,t);if(!r||!r.includes(i.id))return[{command:"removeChild",pointer:e.pointer,path:e.path,args:{id:o}}]}}const t=p(d.mk.create(i.parent_table,n),i.parent_table,r);return t?[t]:[]}return[{command:"removeChild",pointer:e.pointer,path:e.path,args:{id:o}}]}return[{command:"setParent",pointer:r,path:[],args:{parentId:i.parent_id,parentTable:i.parent_table}}]}return[{command:"removeChild",pointer:e.pointer,path:e.path,args:{id:o}}]}))}};function p(e,t,n){const o=D(e.table,n.table);if(!o)return{command:"setParent",pointer:n,path:[],args:{parentId:e.value.id,parentTable:t}};const r=(0,c.f4)(e.value,o);if(!r)return;const i=r.indexOf(n.id);if(-1===i)return;const a={id:e.value.id,table:t,spaceId:n.spaceId};if(0===i){return{command:"insertChildrenBefore",pointer:a,path:o,args:{ids:[n.id]}}}return{command:"insertChildrenAfter",pointer:a,path:o,args:{ids:[n.id],after:r[i-1]}}}n(430541);var m=n(959753),g=n(29299),f=n(213493),h=n(611318),v=n(91644),y=n(475246);const b={derivePrimitiveOperations:function(e){const{pointer:t}=e,{spaceViewPointer:n,userId:o,removeFromParent:r}=e.args;if(t.spaceId!==n.spaceId)throw new Error("Invalid moveToPrivateOperation: Cannot move to a different space");const i=[(0,g.Y5)({pointer:t,userId:o}),(0,g.v2)({pointer:t,parent_table:y.bx,parent_id:n.spaceId,alive:!0}),{pointer:n,path:["private_pages"],command:"listAfter",args:{id:t.id}}];if(r){const e=D(r.table,t.table);e&&i.unshift({pointer:r,path:e,command:"listRemove",args:{id:t.id}})}return i},getAdditionalRelatedPointers:function(e){return(0,o.oA)([e.args.spaceViewPointer,e.args.removeFromParent])},invert:function(e,t){const{pointer:n}=e,{spaceViewPointer:o,removeFromParent:r}=e.args,i=m.omK.fromGetRecordValueFn(t),a=i(n);if(!a)return[];const l=[{command:"set",pointer:n,path:["permissions"],args:a.getPermissionItems()},(0,g.v2)({pointer:n,parent_table:a.parent_table,parent_id:a.parent_id,alive:a.alive??!0}),{pointer:o,path:["private_pages"],command:"listRemove",args:{id:n.id}}];if(r){const e=D(r.table,n.table);if(e){const t=i(r);if(t&&t.table!==s.vF&&t.table!==v.AT&&t.table!==f.np&&t.table!==h.Bh){const o=t.getChildren(),i=o.indexOf(n.id);i<=0?l.push({pointer:r,path:e,command:"listBefore",args:{id:n.id}}):l.push({pointer:r,path:e,command:"listAfter",args:{id:n.id,after:o[i-1]}})}}}return l}},_={derivePrimitiveOperations:function(e){const t=[];t.push({...e,command:"listRemove"});const n=R(e.pointer.table,e.path);if(!n)throw new Error(`invalid operation ${JSON.stringify(e)}`);return t.push({command:"set",path:["alive"],args:!1,pointer:{table:n,spaceId:e.pointer.spaceId,id:e.args.id}}),t},getAdditionalRelatedPointers:function(e){const t=R(e.pointer.table,e.path);if(!t)throw new Error(`Invalid operation ${JSON.stringify(e)}`);return[{id:e.args.id,table:t,spaceId:e.pointer.spaceId}]},invert:function(e,t){const n=t(e.pointer);if(!n)return[];const o=R(e.pointer.table,e.path);if(!o)throw new Error(`Invalid operation ${JSON.stringify(e)}`);const r=p(d.mk.create(e.pointer.table,n),e.pointer.table,{id:e.args.id,table:o,spaceId:e.pointer.spaceId});return r?[r]:[]}};var S=n(789320),k=n(798963),w=n(718844),x=n(421202),I=n(870279),C=n(933709),T=n(577858),M=n(429369);const P={insertChildrenAfter:u,insertChildrenBefore:u,setParent:{derivePrimitiveOperations:function(e,t){const n=[{command:"update",pointer:e.pointer,path:[],args:{parent_table:e.args.parentTable,parent_id:e.args.parentId,alive:!0}}],o=t(e.pointer);if(o&&o.parent_id&&o.parent_table){const t=D(o.parent_table,e.pointer.table);t&&n.push({command:"listRemove",pointer:{id:o.parent_id,table:o.parent_table,spaceId:o.space_id},path:t,args:{id:e.pointer.id}})}return n},getAdditionalRelatedPointers:function(e){return[]},invert:function(e,t){const n=t(e.pointer);if(!n||!n.parent_id||!n.parent_table)return[{command:"set",pointer:e.pointer,path:["alive"],args:!1}];if(n.parent_id===e.args.parentId&&n.parent_table===e.args.parentTable)return[];if(D(n.parent_table,e.pointer.table)){const o=t({id:n.parent_id,table:n.parent_table,spaceId:n.space_id});if(o){const t=p(d.mk.create(n.parent_table,o),n.parent_table,e.pointer);if(t)return[t]}return[]}return[{command:"setParent",pointer:e.pointer,path:[],args:{parentId:n.parent_id,parentTable:n.parent_table}}]}},removeChild:_,assignAutoIncrementId:l,moveToPrivate:b},A={[x.iU]:[{childTable:x.iU,childPath:["content"]},{childTable:C.qF,childPath:["discussions"]}],[y.bx]:[{childTable:x.iU,childPath:["pages"]}],[T.zU]:[{childTable:S.SS,childPath:["assistant_session_starters"]}],[C.qF]:[{childTable:I.x_,childPath:["comments"]}],[I.x_]:[{childTable:x.iU,childPath:["content"]}],[M.e0]:[{childTable:x.iU,childPath:["team_pages"]}],[k.cv]:[{childTable:w.Xj,childPath:["action_ids"]}],[w.Xj]:[{childTable:x.iU,childPath:["blocks"]}],[v.AT]:[],[f.np]:[],[h.Bh]:[{childTable:x.iU,childPath:["blocks"]}]};function R(e,t){var n;const r=A[e];if(r)return null===(n=r.find((e=>{let{childPath:n}=e;return o.Xy(n,t)})))||void 0===n?void 0:n.childTable}function D(e,t){var n;const o=A[e];if(o)return null===(n=o.find((e=>t===e.childTable)))||void 0===n?void 0:n.childPath}function B(e,t){return P[e.command].invert(e,t)}function E(e,t){return P[e.command].derivePrimitiveOperations(e,t)}},760310:(e,t,n)=>{n.d(t,{Eq:()=>c,dn:()=>l,gs:()=>f,hH:()=>s,hJ:()=>d,ie:()=>g});var o=n(709291),r=n(307032),i=n(541432);(0,o.defineMessages)({myTasks:{defaultMessage:"My tasks",id:"homePageTemplates.myTasks"},personalHome:{defaultMessage:"Home",id:"homePageTemplates.home"},assignedToMeView:{defaultMessage:"My tasks",id:"homePageTemplates.assignedToMeView"},createdByMeView:{defaultMessage:"Created by me",id:"homePageTemplates.createdByMeView"},customDbTitle:{defaultMessage:"Home views",id:"homePageTemplates.customDbTitle.includeHome"}});const a={trending:{block:"trending",collectionView:"trendingCollectionView",collection:"trendingCollection"},myTasks:{block:"myTasks",collectionView:"myTasksAssignedToMeCollectionView"},customDb:{block:"customDb",collectionView:"customDbCollectionView"},similarUsers:{block:"similarUsers",collectionView:"similarUsersCollectionView",collection:"similarUsersCollection"},main:{block:"main"},mostVisited:{block:"mostVisited",collectionView:"mostVisitedCollectionView",collection:"mostVisitedCollection"},lastEdited:{block:"lastEdited",collectionView:"lastEditedCollectionView",collection:"lastEditedCollection"},favorites:{block:"favorites",collectionView:"favoritesCollectionView",collection:"favoritesCollection"}};function s(e){let{userId:t,spaceId:n}=e;return{main:u({userId:t,spaceId:n,type:"main"}),trending:u({userId:t,spaceId:n,type:"trending"}),myTasks:u({userId:t,spaceId:n,type:"myTasks"}),customDb:u({userId:t,spaceId:n,type:"customDb"}),similarUsers:u({userId:t,spaceId:n,type:"similarUsers"}),mostVisited:u({userId:t,spaceId:n,type:"mostVisited"}),lastEdited:u({userId:t,spaceId:n,type:"lastEdited"}),favorites:u({userId:t,spaceId:n,type:"favorites"}),trendingCollectionView:m({userId:t,spaceId:n,type:"trending"}),myTasksAssignedToMeCollectionView:m({userId:t,spaceId:n,type:"myTasks"}),customDbCollectionView:m({userId:t,spaceId:n,type:"customDb"}),similarUsersCollectionView:m({userId:t,spaceId:n,type:"similarUsers"}),mostVisitedCollectionView:m({userId:t,spaceId:n,type:"mostVisited"}),lastEditedCollectionView:m({userId:t,spaceId:n,type:"lastEdited"}),favoritesCollectionView:m({userId:t,spaceId:n,type:"favorites"}),trendingCollection:p({userId:t,spaceId:n,type:"trending"}),similarUsersCollection:p({userId:t,spaceId:n,type:"similarUsers"}),mostVisitedCollection:p({userId:t,spaceId:n,type:"mostVisited"}),lastEditedCollection:p({userId:t,spaceId:n,type:"lastEdited"}),favoritesCollection:p({userId:t,spaceId:n,type:"favorites"})}}function l(e){return e.isType(i.Ti.personalHomePage)}function c(e){return a[e.type].collection}function d(e){return p(e)}function u(e){let{userId:t,spaceId:n,type:o}=e;const i=a[o].block;return(0,r.Ul)(`${t}-${n}-${i}`)}function p(e){let{userId:t,spaceId:n,type:o}=e;const i=a[o].collection;return(0,r.Ul)(`${t}-${n}-${i}`)}function m(e){let{userId:t,spaceId:n,type:o}=e;const i=a[o].collectionView;return(0,r.Ul)(`${t}-${n}-${i}`)}const g=["explore_team_template","explore_private_template","explore_personal_template","explore_getting_started_template"];function f(e){return"string"==typeof e&&g.includes(e)}},719531:(e,t,n)=>{n.d(t,{$O:()=>mt,KD:()=>he,xR:()=>gt,RE:()=>ft});n(757658),n(430541);var o=n(608575),r=n(160809),i=n.n(r),a=n(730120),s=n(657347),l=n(653965),c=n(307032),d=n(541432),u=n(399036),p=n(180951),m=n(597531),g=n(709291),f=n(619584),h=n(484795),v=n(406695),y=n(568626),b=n(305773),_=n(159730),S=n(630845),k=n(959753),w=n(423512),x=n(300482),I=n(421202),C=n(606287),T=n(213493),M=n(421838);const P="PartialMatch",A="FullMatch",R="ColumnCategory",D=(0,g.defineMessages)({titleColumnName:{id:"database.titleColumn.name",defaultMessage:"Title"},genericColumnName:{id:"database.genericColumn.name",defaultMessage:"Column {columnNumber}"}});function B(e){const{table:t,deps:{intl:n,randomShortID:o,isPhoneNumber:r},options:{useCsvAdaptiveSchema:i}}=e,a=function(e,t,n,o){var r;let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5?arguments[5]:void 0;e=e.filter((e=>e.some((e=>Boolean((e.text||"").trim())))));const s=e.length>0?e[0].length:0,c=e.map(((e,t)=>({row:e,rowIndex:t}))).filter((e=>{let{row:t}=e;return t.length!==s}));if(c.length>0){const e=c[0];throw new _.p8("CsvImportError",{data:{},clientData:{type:"csv_import_inconsistent_columns",messageValues:{numTitleColumns:s,numBadRows:c.length,firstBadRowIndex:e.rowIndex+1,firstBadRow:JSON.stringify(e.row.map((e=>e.text))),firstBadRowLength:e.row.length}}})}const d=null===(r=e[0])||void 0===r?void 0:r.length;null==a||a.set(R,function(e){return e<50?"lessthan50":e<100?"lessthan100":e<500?"lessthan500":e<1e3?"lessthan1000":e<5e3?"lessthan5000":"greaterthan5000"}(d));let u=[];1===e.length?u=e[0].map(((e,n)=>t.formatMessage(D.genericColumnName,{columnNumber:n+1}))):e.length>1&&(u=e[0].map((e=>e.text)),e.shift());const m=e,g=function(e){return[{test:W.bind(null,e),sampledSchemaIsComplete:!0},{test:O,sampledSchemaIsComplete:!0},{test:z,sampledSchemaIsComplete:!0},{test:H,sampledSchemaIsComplete:!0},{test:j,sampledSchemaIsComplete:!0},{test:N,sampledSchemaIsComplete:!1},{test:$,sampledSchemaIsComplete:!1},{test:Q,sampledSchemaIsComplete:!1},{test:J,sampledSchemaIsComplete:!0}]}(o),f=l.oA(l.Ri(m).map((e=>e.length&&e[0].columnType?e[0].columnType:function(e,t,n,o,r,i){const a=t.filter((e=>Boolean(e)));if(0===a.length)return J(e,a);if(r)for(const s of o){const o=s.test(e,a,n);if(o){let n=o;if(!1===o.isFullMatch){y.log({level:"info",from:"csvHelper",type:"csvColumnTypes",data:{message:"Partial column type match detected, setting data type as string",columnType:o.schema.type,matchType:"Partial"}}),n=J(e,t);const r=(null==i?void 0:i.get(P))||0;null==i||i.set(P,r+1)}else y.log({level:"info",from:"csvHelper",type:"csvColumnTypes",data:{message:"Complete column type match detected",columnType:o.schema.type,matchType:"Full"}});const r=(null==i?void 0:i.get(A))||0;return null==i||i.set(A,r+1),n}}else{const t=a.filter((e=>!l.xb(e))).slice(0,100);for(const r of o){const o=r.test(e,t,n);if(o){const s=r.sampledSchemaIsComplete||t.length===a.length?o:r.test(e,a,n);if(s){if(!1===s.isFullMatch){y.log({level:"info",from:"csvHelper",type:"csvColumnTypes",data:{message:"Partial column type match detected, Potential data loss due to parsing failures",columnType:s.schema.type,matchType:"Partial"}});const e=(null==i?void 0:i.get(P))||0;null==i||i.set(P,e+1)}else{const e=(null==i?void 0:i.get(A))||0;null==i||i.set(A,e+1)}return s}}}}return J(e,[])}(t,e.map((e=>null==e?void 0:e.text)),n,g,i,a)))),h=u.map((()=>!1));for(let l=0;l<u.length;l++)if("text"===f[l].schema.type)for(let e=0;e<m.length;e++){const t=m[e][l].textValue;if(t)for(const n of t)if(M.AJd(n)){h[l]=!0,e=m.length;break}}let v=!0;const b={title:{type:"title",name:t.formatMessage(D.titleColumnName)}};u.forEach(((e,t)=>{const o=f[t];if(o)if("text"===o.schema.type&&v&&!h[t]){v=!1,o.id="title",o.schema={type:"title",name:e};const t=b.title;t&&(t.name=e)}else{const t=n();o.id=t,b[t]={name:e,...o.schema}}}));const S=m.map((e=>{const t={};return f.forEach(((n,o)=>{if(n){const{id:r,schema:i,coerce:a}=n,{type:s}=i;if(r){const n=e[o]||"";t[r]="url"===s?p.iD(n.text):"date"===s?p.d7(a(n.text)):"text"===s?n.textValue||M.TPx(a(n.text)):"file"===s?n.textValue||[]:M.TPx(a(n.text))}}})),t}));return{schema:b,types:f,pages:S}}(t,n,o,r,i,e.csvEvalContext);return function(e){const{actor:t,blockType:n,root:o,parent:r,name:i,format:a,deps:{randomID:s,spaceIdCreator:c,secureFileS3Url:p,secureFileS3UrlV2:g,createCollectionAsyncWithStatusLabel:f},options:{ignoreBlockCount:h,useCrdt:y},pages:_,schema:S,columnIds:w}=e,P=e.collectionId??(null==c?void 0:c.idInSavedSpace(C.vF))??s(),A=e.collectionViewId??(null==c?void 0:c.idInSavedSpace(T.np))??s(),R=[],D=[],B=[],{operations:F}=k.tE1.create({id:P,parent:o.existing?o.record.pointer:{id:o.id,table:I.iU,spaceId:r.spaceId},space_id:r.spaceId,name:M.TPx(i),schema:S,format:{collection_page_properties:l.oA(w.map((e=>{if(e)return{visible:!0,property:e}}))),...f&&{sync_state:{syncing:!0,last_synced_at:Date.now()},static_import_collection_type:v.gH.CsvImport}}});R.push(...F);const Z=o.existing?o.record.id:o.id,{model:U,operations:V}=k.yJh.create({id:Z,type:n,collection_id:P,format:{collection_pointer:{table:C.vF,id:P,spaceId:r.spaceId}},view_ids:[A],createdBy:t,parent:r,space_id:r.spaceId},{useCrdt:y});o.existing?R.push(...m.Ry({existingBlock:o.record,updatedBlock:U})):R.push(...V);if(f){const{operations:e}=k.wxX.create({id:A,type:"table",name:"Show All",parent:o.existing?o.record.pointer:{id:o.id,table:I.iU,spaceId:r.spaceId},space_id:r.spaceId,format:{table_properties:l.oA(w.map((e=>{if(e)return{visible:!0,property:e}}))),...a},createdBy:t});R.push(...e)}const N=function(e){const{actor:t,collectionId:n,spaceId:o,pages:r,secureFileS3Url:i,secureFileS3UrlV2:a,randomID:s,spaceIdCreator:l,options:c}=e;return r.map((e=>{var r;const u=(null===(r=e[E])||void 0===r?void 0:r.toString())??(null==l?void 0:l.idInSavedSpace(I.iU))??s();delete e[E];const{model:p,operations:m}=k.yJh.create({id:u,parent:{id:n,table:C.vF,spaceId:o},space_id:o,type:d.Ti.page,createdBy:t,properties:e,...c.ignoreBlockCount?{ignore_block_count:!0}:void 0},{useCrdt:c.useCrdt}),g=[...m];if(i&&a){const e=(0,b.ZP)(p,i,a);e.length>0&&g.push(x.op.update({pointer:p.pointer,path:[],args:{file_ids:e.map((e=>e.id))}}))}return{id:u,operations:g}}))}({actor:t,collectionId:P,secureFileS3Url:p,secureFileS3UrlV2:g,spaceId:r.spaceId,pages:_,randomID:s,spaceIdCreator:c,options:{useCrdt:y,ignoreBlockCount:h}});for(const{operations:l}of N)D.push(...l);const{operations:O}=k.wxX.create({id:A,type:"table",name:"Show All",parent:o.existing?o.record.pointer:{id:o.id,table:I.iU,spaceId:r.spaceId},space_id:r.spaceId,format:{table_properties:l.oA(w.map((e=>{if(e)return{visible:!0,property:e}}))),...a},page_sort:N.map((e=>e.id)).slice(0,u.gq),createdBy:t});if(D.push(...O),f){const e={table:C.vF,id:P,spaceId:r.spaceId},t=x.op.update({pointer:e,path:["format","sync_state"],args:{syncing:!1,last_synced_at:Date.now()}});return B.push(t),{operations:D,createCollectionOperations:R,collectionFinishedOperations:B}}return{operations:[...R,...D]}}({...a,columnIds:a.types.map((e=>e.id)),...e})}const E="NOTION_COLLECTION_ROW_ID";const F=["yes","Yes","true","True","checked"],Z=["no","No","false","False","unchecked"];function U(e){return F.some((t=>e===t))||Z.some((t=>e===t))}function V(e,t){return e.length===t.length}function N(e,t){if(t.every(U))return{schema:{type:"checkbox"},validate:U,coerce:e=>F.some((t=>e===t))?u.bx:u.HC}}function O(e,t){const n=t.map(w._g),o=n[0];if(o&&n.every((e=>Boolean(e&&e.format===o.format))))return{schema:{type:"number",number_format:o.format},validate(e){const t=w._g(e);return!f.z4(t)&&t.format===o.format},coerce(e){const t=w._g(e);return`${t?t.value:void 0}`}}}function L(e,t){if(parseInt(t)&&t.length<=6)return!1;const n=h._1(t,e);return Boolean(n)}function j(e,t){const n=t.filter((t=>L(e,t)));if(n.length>=t.length/2)return{schema:{type:"date"},validate:t=>L(e,t),coerce:t=>h._1(t,e),isFullMatch:V(t,n)}}function K(e){return e.length<320&&e.includes("@")&&S.B(e,"email")}function z(e,t){const n=t.filter(K);if(n.length>=t.length/2)return{schema:{type:"email"},validate:K,coerce:l.yR,isFullMatch:V(t,n)}}function q(e){return e.length<320&&S.B(e,"url")}function H(e,t){const n=t.filter(q);if(n.length>=t.length/2)return{schema:{type:"url"},validate:q,coerce:l.yR,isFullMatch:V(t,n)}}function G(e,t){return!String(t).match(/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/)&&e(String(t))}function W(e,t,n){const o=G.bind(null,e),r=n.filter(o);if(r.length>=n.length/2)return{schema:{type:"phone_number"},validate:o,coerce:l.yR,isFullMatch:V(n,r)}}function $(e,t,n){const o=[];t.forEach((e=>e.split(",").forEach((e=>o.push(e.trim())))));const r=new Set(o);if(i=r.size,a=o.length,s=t.length,a>s&&Y(i,a)){return{schema:{type:"multi_select",options:Array.from(r).map(((e,t)=>({id:n(),value:e,color:(0,u.TL)([])})))},validate:e=>r.has(e),coerce:l.yR}}var i,a,s}function Y(e,t){return e>0&&e**2<t}function Q(e,t,n){const o=new Set(t);if(Y(o.size,t.length)){return{schema:{type:"select",options:Array.from(o).map(((e,t)=>({id:n(),value:e,color:(0,u.TL)([])})))},validate:e=>o.has(e),coerce:l.yR}}}function J(e,t){return{schema:{type:"text"},validate:l._z,coerce:l.yR}}var X=n(253877),ee=n(895538),te=n(415095),ne=n(977657),oe=n(643593),re=n(520270),ie=n(719233),ae=n(870279),se=n(933709),le=n(519889);const ce={CommentAuthor:"cma",CommentDiscussionId:"cmm"},de={a:!0,strong:!0,em:!0,code:!0,del:!0,s:!0,span:!0,time:!0},ue={meta:!0,style:!0,script:!0,head:!0,title:!0},pe="sourceCode",me=700,ge=1e5;function fe(e){if(!e)return;const t=parseInt(e);return isNaN(t)?void 0:t}const he={[M.GKr.Page]:"data-notion-page-id",spaceId:"data-notion-space-id",[M.GKr.Highlight]:"data-notion-highlight",[M.GKr.User]:"data-notion-user-id",[M.GKr.Discussion]:"data-notion-block-discussion-id",[M.GKr.Equation]:"data-notion-inline-equation",[M.GKr.Comment]:"data-notion-block-comment-id",[ce.CommentAuthor]:"data-notion-block-comment-author-id",[ce.CommentDiscussionId]:"data-notion-block-comment-discussion-id",[d.Ti.code]:"data-notion-code-syntax",[d.Ti.callout]:"data-notion-callout",calloutIcon:"data-notion-callout-icon",calloutBackground:"data-notion-callout-background",[d.Ti.tableOfContents]:"data-notion-toc",[d.Ti.file]:"data-notion-file",fileAlias:"data-notion-file-alias",[d.Ti.columnList]:"data-notion-column-list",[d.Ti.column]:"data-notion-column-ratio",[d.Ti.video]:"data-notion-video",[d.Ti.audio]:"data-notion-audio",[d.Ti.pdf]:"data-notion-pdf",[d.Ti.equation]:"data-notion-equation",dateFormat:"data-notion-date-format",[d.Ti.externalObjectInstance]:"data-notion-link-preview"},ve="Lucidchart",ye="Jira",be="JiraDC";ne.mC,ne.Gl,ne.mC,ne.Gl,ne.mC,ne.Gl;function _e(e,t){return t&&t.nodeType===e.Node.ELEMENT_NODE}function Se(e,t){return e.nodeType===t.Node.TEXT_NODE||e instanceof t.Element&&de[e.tagName.toLowerCase()]}function ke(e,t,n){var o;let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(t&&1===e.nodeType&&e.hasAttribute(he[M.GKr.Comment]))return r;if(n&&"pre"===(null===(o=e.tagName)||void 0===o?void 0:o.toLowerCase()))return r;r.push(e);for(const i of te.p4(e.childNodes))ke(i,t,n,r);return r}function we(e){const t=[];if(!e.parentNode)return t;let n=e.parentNode;for(;n;)t.push(n),n=n.parentNode||void 0;return t}function xe(e,t){const n=we(e).filter((e=>e instanceof t.Element&&("ul"===e.tagName.toLowerCase()||"ol"===e.tagName.toLowerCase()))).length;return n}const Ie=["•","◦","▪"],Ce=["h1","h2","h3","h4","h5","h6"].map((e=>`${e}:not(:first-child)`)).join(", ");function Te(e){const{node:t,window:n,stripText:o,stripSurroundingWhitespace:r,timeZone:i,ignoreComments:s,deps:l,ignoreCodeBlock:u}=e;if(!o){for(const e of Array.from(t.querySelectorAll("p:not(:first-child)")))e.prepend("\n");for(const e of Array.from(t.querySelectorAll(Ce)))e.prepend("\n");for(const e of Array.from(t.querySelectorAll("ul > li"))){const t=xe(e,n)-1,o=t%Ie.length,r=Ie[o],i="    ".repeat(t);e.prepend(`\n${i}${r} `)}for(const e of Array.from(t.querySelectorAll("ol"))){const t=xe(e,n),o="    ".repeat(t);for(let n=0;n<e.children.length;n+=1){e.children[n].prepend(`\n${o}${n+1}. `)}}for(const e of Array.from(t.querySelectorAll("pre")))e.parentNode&&e.parentNode.insertBefore(n.document.createTextNode("\n\n"),e)}const p=[],m=[],g=ke(t,s,u).filter((e=>e.nodeType===n.Node.TEXT_NODE&&(!o||!/^( |\t)*(\n)+( |\t)*$/.test(e.data))));let f=!0;g.forEach(((e,s)=>{let u=e.data;o&&(u=u.replace(/\[ \] /g,""),u=u.replace(/\[x\] /g,""),u=u.replace(/^[\-\*\•]\s?/g,""),u=u.replace(/(\s)+/g,"$1")),!t.hasAttribute("confluenceTabSpaces")&&0===s&&r&&(u=u.trimStart()),s===g.length-1&&f&&r&&(u=u.trimEnd());const h=[],v=we(e);let y;!o&&v.some((e=>e instanceof n.Element&&("h1"===e.tagName.toLowerCase()||"h2"===e.tagName.toLowerCase()||"h3"===e.tagName.toLowerCase()||"h4"===e.tagName.toLowerCase()||"h5"===e.tagName.toLowerCase()||"h6"===e.tagName.toLowerCase())))&&h.push([M.GKr.Bold]),v.some((e=>e instanceof n.Element&&"strong"===e.tagName.toLowerCase()))&&h.push([M.GKr.Bold]),v.some((e=>e instanceof n.Element&&"em"===e.tagName.toLowerCase()))&&h.push([M.GKr.Italic]),v.some((e=>e instanceof n.Element&&"u"===e.tagName.toLowerCase()))&&h.push([M.GKr.Underline]),v.some((e=>e instanceof n.Element&&("code"===e.tagName.toLowerCase()||"pre"===e.tagName.toLowerCase())))&&h.push([M.GKr.Code]),v.some((e=>e instanceof n.Element&&("del"===e.tagName.toLowerCase()||"strike"===e.tagName.toLowerCase()||"s"===e.tagName.toLowerCase())))&&h.push([M.GKr.Strike]);const b=v.find((e=>{var t;return e instanceof n.Element&&(e.hasAttribute(he[M.GKr.Highlight])||(null===(t=e.parentElement)||void 0===t?void 0:t.hasAttribute(he[M.GKr.Highlight])))}));if(b&&b instanceof n.Element){var _;const e=b.getAttribute(he[M.GKr.Highlight]),t=null===(_=b.parentElement)||void 0===_?void 0:_.getAttribute(he[M.GKr.Highlight]),n=yt(e&&"undefined"!==e?e||"":t||"");n&&h.push([M.GKr.Highlight,n])}const S=v.find((e=>e instanceof n.Element&&"a"===e.tagName.toLowerCase()));if(S){const e=S.getAttribute(he[M.GKr.Page]),t=S.getAttribute("notionUserId")||S.getAttribute(he[M.GKr.User]),n=S.getAttribute(he.spaceId),o=S.getAttribute(he[M.GKr.Comment]);"string"==typeof e&&(0,c.e)(e)&&"string"==typeof n&&(0,c.e)(n)?y=M.$0A(e,n):S.href?h.push(M.edl(S.href)):"string"==typeof t&&(0,c.e)(t)?(y=M.tEo(t),S.getAttribute("notionUserId")&&s===g.length-2&&(f=!1)):o&&n&&(0,c.e)(o)&&(0,c.e)(n)&&(y=M.mfJ(o,n))}const k=v.find((e=>!!(e instanceof n.Element&&e.getAttribute(he[M.GKr.Discussion])))),w=t.classList.contains("page-comment");if(k&&!w){const e=k.getAttribute(he[M.GKr.Discussion]);if(e){e.split(",").forEach((e=>h.push(M.jw(e))))}}const x=v.find((e=>e instanceof n.Element&&"sub"===e.tagName.toLowerCase()));let C;"true"===(null==x?void 0:x.getAttribute("confluenceProcessableEquation"))&&(C=`_{${x.textContent}}`);const T=v.find((e=>e instanceof n.Element&&"sup"===e.tagName.toLowerCase()));let P;"true"===(null==T?void 0:T.getAttribute("confluenceProcessableEquation"))&&(P=`^{${T.textContent}}`);const A=v.find((e=>e instanceof n.Element&&e.hasAttribute(he[M.GKr.Equation])));let R;null!=A&&A.textContent&&(R=A.textContent);const D=v.find((e=>e instanceof n.Element&&"time"===e.tagName.toLowerCase()));if(D){const e=D.getAttribute("datetime");if(e){const t=function(e,t){const n=a.ou.fromISO(e),o=n.toMillis();return o===n.startOf("day").toMillis()?X.OQ.toPersistedDate(o,t):X.OQ.toPersistedDateTime(o,t)}(e,i),n={...t};"relative"===D.getAttribute(he.dateFormat)&&(n.date_format="relative"),y=M.pZr(n)}}const B=v.find((e=>!!(e instanceof n.Element&&e instanceof n.HTMLSpanElement&&e.getAttribute(he[d.Ti.externalObjectInstance]))));if(y)p.push(M.YCD(y,h));else if(C)p.push(M.qZ6(C,h));else if(P)p.push(M.qZ6(P,h));else if(R)p.push(M.qZ6(R,h));else if(B&&null!=l&&l.randomID){var E;const e=(null==l||null===(E=l.spaceIdCreator)||void 0===E?void 0:E.idInSavedSpace(I.iU))??l.randomID();p.push(M.YCD(M.x36(e),h)),m.push(e)}else p.push(M.V3y(u,h))}));const h=M.Zdj(p,ge);return{titleTokens:M.Zxt(h),linkMentionBlockIds:m}}function Me(e,t){const n=["img[src]","a[download]",`a[${he[d.Ti.file]}]`,`audio[${he[d.Ti.audio]}]`,`video[${he[d.Ti.video]}]`];t&&n.push("pre");const o=e.querySelectorAll(n.join(","));return te.p4(o)}function Pe(e){const{actor:t,parent:n,node:o,allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:d,spaceIdCreator:u,randomShortID:p,isPhoneNumber:m},options:{useCrdt:g,ignoreBlockCount:f,considerCodeBlockAsNonTextItem:h}}=e;return tt({actor:t,parent:n,nodes:Me(o,h),allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:d,spaceIdCreator:u,randomShortID:p,isPhoneNumber:m},options:{useCrdt:g,ignoreBlockCount:f}})}function Ae(e){const{actor:t,parent:n,node:o,type:r,allOperations:i,options:{useCrdt:a,ignoreBlockCount:s,stripText:l,stripSurroundingWhitespace:c,ignoreCodeBlock:u},deps:{window:p,randomID:m,spaceIdCreator:g}}=e,f=(null==g?void 0:g.idInSavedSpace(I.iU))??m(),{titleTokens:h,linkMentionBlockIds:v}=Te({node:o,window:p,stripText:l,stripSurroundingWhitespace:c,ignoreComments:!0,ignoreCodeBlock:u,deps:{randomID:m,spaceIdCreator:g}}),{operations:y}=k.yJh.create({id:f,type:r,properties:{title:h},parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!s||void 0},{useCrdt:a});if(i.push(...y),v.length){const e=o.querySelectorAll(`span[${he[d.Ti.externalObjectInstance]}]`);for(const[o,r]of Array.from(e).entries())v[o]&&Ne({actor:t,parent:n,node:r,allOperations:i,deps:{randomID:m,spaceIdCreator:g},options:{useCrdt:a,ignoreBlockCount:s},blockId:v[o]})}return Xe({node:o,spaceId:n.spaceId,window:p,blockId:f,actor:t,allOperations:i}),f}function Re(e){const{actor:t,parent:n,node:o,tableData:r,allOperations:i,deps:{intl:a,secureFileS3Url:s,secureFileS3UrlV2:l,randomID:c,spaceIdCreator:u,randomShortID:p,window:m,isPhoneNumber:g},options:{useCrdt:h,ignoreBlockCount:v,tableType:y}}=e,b=(null==u?void 0:u.idInSavedSpace(I.iU))??c();if("table"===y){const{operations:e}=function(e){const{table:t,actor:n,parent:o,tableId:r,deps:{randomID:i,spaceIdCreator:a,randomShortID:s},options:{useCrdt:l,ignoreBlockCount:c}}=e,u=[],p=t.length?t[0].map((e=>s())):[],m=t.map((e=>(null==a?void 0:a.idInSavedSpace(I.iU))??i()));u.push(...k.yJh.create({id:r,type:d.Ti.table,content:m,format:{table_block_column_order:p},properties:{},parent:o,space_id:o.spaceId,createdBy:n,ignore_block_count:!!c||void 0},{useCrdt:l}).operations);const g=m.flatMap(((e,i)=>{const a=f.m8(p.flatMap(((e,n)=>{var o;const r=null===(o=t[i])||void 0===o||null===(o=o[n])||void 0===o?void 0:o.textValue;return r?[[e,r]]:[]})));return k.yJh.create({id:e,type:d.Ti.tableRow,parent:{id:r,table:I.iU,spaceId:o.spaceId},space_id:o.spaceId,properties:a,createdBy:n},{useCrdt:l}).operations}));return u.push(...g),{operations:u}}({actor:t,tableId:b,parent:n,table:r,deps:{randomID:c,spaceIdCreator:u,randomShortID:p},options:{useCrdt:h,ignoreBlockCount:v}});i.push(...e),Xe({node:o,spaceId:n.spaceId,window:m,blockId:b,actor:t,allOperations:i})}else if("collection"===y){const e=o.getAttribute("data-database-title")??"",{operations:d}=B({actor:t,blockType:"collection_view",root:{existing:!1,id:b},parent:n,name:e,format:{table_wrap:!0},table:r,deps:{secureFileS3Url:s,secureFileS3UrlV2:l,intl:a,randomID:c,spaceIdCreator:u,randomShortID:p,isPhoneNumber:g},options:{useCrdt:h,ignoreBlockCount:v,useCsvAdaptiveSchema:!0}});i.push(...d)}return b}function De(e){const{actor:t,parent:n,allOperations:o,deps:{randomID:r,spaceIdCreator:i},options:{useCrdt:a,ignoreBlockCount:s}}=e,l=(null==i?void 0:i.idInSavedSpace(I.iU))??r(),{operations:c}=k.yJh.create({id:l,type:d.Ti.divider,parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!s||void 0},{useCrdt:a});return o.push(...c),l}function Be(e){const{actor:t,parent:n,source:o,allOperations:r,deps:{secureFileS3Url:i,secureFileS3UrlV2:a,randomID:s,spaceIdCreator:l},options:{useCrdt:c,ignoreBlockCount:u,fallbackWidth:p}}=e;let m;"image"===o.type&&o.width?m=Math.min(o.width,me):p&&(m=Math.min(p,me));const g=(null==l?void 0:l.idInSavedSpace(I.iU))??s(),{model:f,operations:h}=k.yJh.create({id:g,type:d.Ti.image,properties:{source:M.TPx(o.url)},format:{block_width:m},parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!u||void 0},{useCrdt:c});return r.push(...h,f.getSecureFilesUpdate(i,a)),g}function Ee(e){const{actor:t,parent:n,node:o,sourceUrl:r,allOperations:i,deps:{randomID:a,spaceIdCreator:s},options:{useCrdt:l,ignoreBlockCount:c}}=e,d=fe(o.getAttribute("height")),u=fe(o.getAttribute("width")),p=(null==s?void 0:s.idInSavedSpace(I.iU))??a();let m;try{m=new URL(r)}catch(h){m=r}const g=ee.Dz({url:r,baseUrl:m instanceof URL?m.origin:m,publicDomainName:""}),{operations:f}=k.yJh.create({id:p,type:g,properties:{source:M.TPx(r)},format:{block_width:u,block_height:d,block_full_width:!1,block_page_width:!(u||d),block_preserve_scale:!0},parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!c||void 0},{useCrdt:l});return i.push(...f),p}function Fe(e){const{actor:t,parent:n,source:o,allOperations:r,deps:{secureFileS3Url:i,secureFileS3UrlV2:a,randomID:s,spaceIdCreator:l},options:{useCrdt:c,ignoreBlockCount:d}}=e,u=(null==l?void 0:l.idInSavedSpace(I.iU))??s(),m=ee.Dz({url:o.url,baseUrl:o.url,publicDomainName:""}),g="embed"===m?"file":m,{model:f,operations:h}=k.yJh.create({id:u,type:g,properties:{title:M.TPx((0,oe.w2)(o.url)),source:p.iD(o.url)},format:{block_width:"image"===o.type&&o.width?Math.min(o.width,me):void 0},parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!d||void 0},{useCrdt:c});return r.push(...h,f.getSecureFilesUpdate(i,a)),u}function Ze(e){return"#text"===e.nodeName?e.textContent?e.textContent:"":Array.from(e.childNodes).map((e=>{const t=e.nodeName.toLowerCase();return"br"===t?"\n":"div"===t?`${Ze(e)}\n`:Ze(e)})).map((e=>e.split("\n").map((e=>e.trimRight())).join("\n"))).join("")}function Ue(e){const{actor:t,parent:n,node:o,allOperations:r,deps:{importFileMap:a,window:s,secureFileS3Url:l,secureFileS3UrlV2:c,intl:u,randomID:p,spaceIdCreator:m,randomShortID:g,isPhoneNumber:f},options:{useCrdt:h,ignoreBlockCount:v}}=e,y=(null==m?void 0:m.idInSavedSpace(I.iU))??p(),b=o.getAttribute(he.calloutBackground),_=b?yt(b):void 0,S=o.getAttribute(he.calloutIcon),w=S&&S.match(i()())?S:void 0,{title:x,children:C}=function(e){const{node:t,window:n}=e,o=te.p4(t.childNodes),[r,...i]=o;if(!r)return{title:[]};if(function(e){return t=>!!(_e(e,t)&&t instanceof e.HTMLParagraphElement)}(n)(r)){const{titleTokens:e}=Te({node:r,window:n,stripText:!1,stripSurroundingWhitespace:!0,ignoreComments:!0});return{title:e,children:i}}if(Se(r,n)){const{titleTokens:e}=Te({node:t,window:n,stripText:!1,stripSurroundingWhitespace:!0,ignoreComments:!0});return{title:e,children:void 0}}return{title:[],children:o}}({node:o,window:s}),T=Array.isArray(C)?tt({actor:t,parent:{table:I.iU,id:y,spaceId:n.spaceId},nodes:C,allOperations:r,deps:{importFileMap:a,window:s,secureFileS3Url:l,secureFileS3UrlV2:c,intl:u,randomID:p,spaceIdCreator:m,randomShortID:g,isPhoneNumber:f},options:{useCrdt:h,ignoreBlockCount:v}}):[],{operations:M}=k.yJh.create({id:y,type:d.Ti.callout,content:T,properties:{title:x},format:{block_color:_,page_icon:w},parent:{id:n.id,table:n.table,spaceId:n.spaceId},space_id:n.spaceId,createdBy:t,ignore_block_count:!!v||void 0},{useCrdt:h});return r.push(...M),Xe({node:o,spaceId:n.spaceId,window:s,blockId:y,actor:t,allOperations:r}),y}function Ve(e){const{actor:t,parent:n,node:o,allOperations:r,deps:{importFileMap:i,secureFileS3Url:a,secureFileS3UrlV2:s,randomID:l,spaceIdCreator:c},options:{useCrdt:u,ignoreBlockCount:p}}=e,m=o.getAttribute(he[d.Ti.file])||"",g=i[m]?i[m].url:m;let f=o.getAttribute(he.fileAlias)||"";!f&&g.lastIndexOf("/")>=0&&(f=g.substring(g.lastIndexOf("/")+1));const h=(null==c?void 0:c.idInSavedSpace(I.iU))??l(),{model:v,operations:y}=k.yJh.create({createdBy:t,id:h,parent:{id:n.id,table:n.table,spaceId:n.spaceId},space_id:n.spaceId,properties:{source:M.TPx(g),title:M.TPx(f)},type:d.Ti.file,ignore_block_count:!!p||void 0},{useCrdt:u});return r.push(...y,v.getSecureFilesUpdate(a,s)),h}function Ne(e){const{actor:t,parent:n,node:r,allOperations:i,deps:{randomID:a,spaceIdCreator:s},options:{useCrdt:l,ignoreBlockCount:c}}=e,u=e.blockId?e.blockId:(null==s?void 0:s.idInSavedSpace(I.iU))??a();let p;const m="true"===r.getAttribute("bot-connected"),g=r.getAttribute("href"),f=r.getAttribute(he[d.Ti.externalObjectInstance]);if(!g||!f)return;if(m){const e=r.getAttribute("metadata");if(e){const t=JSON.parse(e);if(!(t.uri&&t.external_object_id&&t.bot_id&&t.attributes))return;p={original_url:t.uri,external_object_id:t.external_object_id,bot_id:t.bot_id,uri:t.uri,attributes:t.attributes}}else{const e=o.parse(g).hostname;if(!e)return;p={original_url:g,domain:e,error:{status_code:re.Rl.BAD_REQUEST}}}}else{const e=o.parse(g).hostname;if(!e)return;p={original_url:g,domain:e}}if(!p)return;const{operations:h}=k.yJh.create({createdBy:t,id:u,parent:{id:n.id,table:"block",spaceId:n.spaceId},type:d.Ti.externalObjectInstance,space_id:n.spaceId,format:p,ignore_block_count:!!c||void 0},{useCrdt:l});return i.push(...h),u}const Oe=/language-(\w+)/;function Le(e){let t=null;return null==e||e.forEach(((e,n,o)=>{if(t)return;if(ie.Y.hasOwnProperty(e))return void(t=e);const r=e.match(Oe);r&&r.length>1&&ie.Y.hasOwnProperty(r[1])&&(t=r[1])})),t}function je(e){const{actor:t,parent:n,node:o,allOperations:r,deps:{randomID:i,spaceIdCreator:a,window:s},options:{useCrdt:l,ignoreBlockCount:c}}=e,u=(null==a?void 0:a.idInSavedSpace(I.iU))??i();let p=o.getAttribute(he[d.Ti.code]);if(!p){var m;p=Le(null===(m=o.querySelector("code"))||void 0===m||null===(m=m.parentElement)||void 0===m?void 0:m.classList)}if(!p){var g;p=Le(null===(g=o.querySelector("code"))||void 0===g?void 0:g.classList)}const f=p&&ie.Y[p]?ie.Y[p]:"Plain Text",{operations:h}=k.yJh.create({id:u,type:d.Ti.code,properties:{title:M.TPx(Ze(o)),language:M.TPx(f)},format:{code_wrap:!0},parent:{id:n.id,table:n.table,spaceId:n.spaceId},space_id:n.spaceId,createdBy:t,ignore_block_count:!!c||void 0},{useCrdt:l});return r.push(...h),Xe({node:o,spaceId:n.spaceId,window:s,blockId:u,actor:t,allOperations:r}),u}function Ke(e){const{actor:t,parent:n,node:o,allOperations:r,deps:{randomID:i,spaceIdCreator:a},options:{useCrdt:s,ignoreBlockCount:l}}=e,c=(null==a?void 0:a.idInSavedSpace(I.iU))??i(),{operations:u}=k.yJh.create({id:c,type:d.Ti.equation,properties:{title:M.TPx(Ze(o))},parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!l||void 0},{useCrdt:s});return r.push(...u),c}function ze(e){const{actor:t,parent:n,allOperations:o,deps:{randomID:r,spaceIdCreator:i},options:{useCrdt:a,ignoreBlockCount:s}}=e,l=(null==i?void 0:i.idInSavedSpace(I.iU))??r(),{operations:c}=k.yJh.create({id:l,type:d.Ti.tableOfContents,format:{block_color:"gray"},parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!s||void 0},{useCrdt:a});return o.push(...c),l}function qe(e){const{actor:t,parent:n,node:o,allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:u,spaceIdCreator:p,randomShortID:m,isPhoneNumber:g},options:{useCrdt:f,ignoreBlockCount:h}}=e,v=(null==p?void 0:p.idInSavedSpace(I.iU))??u(),[y,...b]=te.p4(o.childNodes),_=tt({actor:t,parent:{id:v,table:I.iU,spaceId:n.spaceId},nodes:b,allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:u,spaceIdCreator:p,randomShortID:m,isPhoneNumber:g},options:{useCrdt:f,ignoreBlockCount:h}}),{operations:S}=k.yJh.create({id:v,type:d.Ti.quote,properties:{title:M.TPx(null!=y&&y.textContent?y.textContent.trim():"")},content:_,parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!h||void 0},{useCrdt:f});return r.push(...S),Xe({node:o,spaceId:n.spaceId,blockId:v,actor:t,allOperations:r,window:a}),v}function He(e){const{actor:t,parent:n,node:o,allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:u,spaceIdCreator:p,randomShortID:m,isPhoneNumber:g},options:{useCrdt:f,ignoreBlockCount:h}}=e,v=(null==p?void 0:p.idInSavedSpace(I.iU))??u(),y=o.querySelector("summary"),b=te.p4(o.childNodes).filter((e=>e!==y)),_=y&&y.textContent&&(()=>{const{titleTokens:e}=Te({node:y,window:a,stripText:!1,stripSurroundingWhitespace:!0,ignoreComments:!0,deps:{randomID:u,spaceIdCreator:p}});return e})(),S=tt({actor:t,parent:{id:v,table:I.iU,spaceId:n.spaceId},nodes:b,allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:u,spaceIdCreator:p,randomShortID:m,isPhoneNumber:g},options:{useCrdt:f,ignoreBlockCount:h}}),{operations:w}=k.yJh.create({id:v,type:d.Ti.toggle,content:S,properties:{title:_||M.TPx("")},parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!h||void 0},{useCrdt:f});return r.push(...w),v}function Ge(e){const{actor:t,parent:n,node:o,allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:u,spaceIdCreator:p,randomShortID:m,isPhoneNumber:g},options:{useCrdt:f,ignoreBlockCount:h}}=e,v=(null==p?void 0:p.idInSavedSpace(I.iU))??u(),y=te.p4(o.children).filter((e=>e.hasAttribute(he[d.Ti.column]))).slice(0,8).map((e=>function(e){const{actor:t,parent:n,node:o,allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:u,spaceIdCreator:p,randomShortID:m,isPhoneNumber:g},options:{useCrdt:f,ignoreBlockCount:h}}=e,v=(null==p?void 0:p.idInSavedSpace(I.iU))??u(),y=o.getAttribute(he[d.Ti.column]);let b;if(null!==y){const e=parseFloat(y);!Number.isNaN(e)&&e>0&&e<=1&&(b=e)}const _=tt({actor:t,parent:{id:v,table:I.iU,spaceId:n.spaceId},nodes:te.p4(o.children),allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:u,spaceIdCreator:p,randomShortID:m,isPhoneNumber:g},options:{useCrdt:f,ignoreBlockCount:h}}),{operations:S}=k.yJh.create({id:v,type:d.Ti.column,format:{column_ratio:b},content:_,parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!h||void 0},{useCrdt:f});return r.push(...S),v}({actor:t,parent:{id:v,table:I.iU,spaceId:n.spaceId},node:e,allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:u,spaceIdCreator:p,randomShortID:m,isPhoneNumber:g},options:{useCrdt:f,ignoreBlockCount:h}}))),{operations:b}=k.yJh.create({id:v,type:d.Ti.columnList,content:y,parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!h||void 0},{useCrdt:f});return r.push(...b),v}const We=/^\[x\].*/,$e=/^\[ \].*/,Ye=/^[-\*\•].*/;function Qe(e){const{actor:t,parent:n,node:o,allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:p,spaceIdCreator:m,randomShortID:g,isPhoneNumber:f},options:{useCrdt:h,ignoreBlockCount:v}}=e,y=(null==m?void 0:m.idInSavedSpace(I.iU))??p(),b=a.document.createElement("span"),_=[];te.p4(o.childNodes).forEach(((e,t)=>{0===t&&function(e,t){return e instanceof t.Element&&"a"===e.tagName.toLowerCase()&&e.hasAttribute(he[d.Ti.file])}(e,a)?_.push(e):0===t&&!(function(e,t){return e instanceof t.Element&&"img"===e.tagName.toLowerCase()}(e,a)||function(e,t){return e instanceof t.Element&&"video"===e.tagName.toLowerCase()}(e,a)||function(e,t){return e instanceof t.Element&&"audio"===e.tagName.toLowerCase()}(e,a))||Se(e,a)?(b.appendChild(e),e instanceof a.Element&&Me(e).forEach((e=>_.push(e)))):_.push(e)}));const S=tt({actor:t,parent:{id:y,table:I.iU,spaceId:n.spaceId},nodes:_,allOperations:r,deps:{importFileMap:i,window:a,secureFileS3Url:s,secureFileS3UrlV2:l,intl:c,randomID:p,spaceIdCreator:m,randomShortID:g,isPhoneNumber:f},options:{useCrdt:h,ignoreBlockCount:v}}),w=We.test(b.textContent||""),x=$e.test(b.textContent||"");let C;C=w||x?d.Ti.toDo:o.parentNode instanceof a.Element&&"ol"===o.parentNode.tagName.toLowerCase()?d.Ti.numberedList:d.Ti.bulletedList;let T=!1;C===d.Ti.toDo&&w&&(T=!0);const{titleTokens:P}=Te({node:b,window:a,stripText:!0,stripSurroundingWhitespace:!0,ignoreComments:!0,deps:{randomID:p,spaceIdCreator:m}}),{operations:A}=k.yJh.create({id:y,type:C,content:S,properties:{title:P,checked:T?M.TPx(u.bx):void 0},parent:n,space_id:n.spaceId,createdBy:t,ignore_block_count:!!v||void 0},{useCrdt:h});return r.push(...A),Xe({node:b,spaceId:n.spaceId,blockId:y,actor:t,allOperations:r,window:a}),y}function Je(e){const{node:t,spaceId:n,window:o,actor:r,discussionId:i,allOperations:a,deps:s,options:l}=e,c=Array.from(t.querySelectorAll(`span[${he[ce.CommentDiscussionId]}="${i}"]`)),d=Date.now(),u=[];for(const p of c){if(null===p.textContent||0===p.textContent.trim().length)continue;const e=p.getAttribute(he[M.GKr.Comment]);if(!e)continue;const{titleTokens:c}=Te({node:p,window:o,stripText:!0,stripSurroundingWhitespace:!0,ignoreComments:!1}),m=p.getAttribute(he[ce.CommentAuthor]);u.push(e);const g=s&&l&&Pe({actor:r,parent:{table:ae.x_,id:e,spaceId:n},node:t,allOperations:a,deps:s,options:l}),f={id:e,parent_id:i,parent_table:se.qF,space_id:n,version:1,created_time:d,last_edited_time:d,text:c,created_by_table:le.KJ,created_by_id:m||r.id,alive:!0,...g&&{content:g}};a.push(x.op.set({pointer:{table:ae.x_,id:e,spaceId:n},path:[],args:f}))}return u}function Xe(e){const{node:t,spaceId:n,blockId:o,actor:r,allOperations:i,window:a}=e,s=Array.from(t.querySelectorAll(`span[${he[M.GKr.Discussion]}]`)),l=new Map;for(const c of s){const e=c.getAttribute(he[M.GKr.Discussion]);if(!e)continue;e.split(",").forEach((e=>{if(l.has(e)){var t;null===(t=l.get(e))||void 0===t||null===(t=t.context)||void 0===t||t.push([c.textContent??"",[[M.GKr.Discussion,e]]])}else{const t={id:e,type:"default",parent_id:o,parent_table:I.iU,resolved:!1,context:[[c.textContent??"",[[M.GKr.Discussion,e]]]],space_id:n,version:0};l.set(e,t)}}))}et({node:t,spaceId:n,window:a,blockId:o,actor:r,discussionToTextMap:l,allOperations:i})}function et(e){const{node:t,spaceId:n,window:o,blockId:r,actor:i,discussionToTextMap:a,allOperations:s,deps:l,options:c}=e;for(const[d,u]of a.entries()){const e=Je({node:t,spaceId:n,window:o,discussionId:d,actor:i,allOperations:s,deps:l,options:c});u.comments=e,s.push(x.op.set({pointer:{table:se.qF,id:d,spaceId:n},path:[],args:u}),{pointer:{table:I.iU,id:r,spaceId:n},command:"listAfter",path:["discussions"],args:{id:d}})}}function tt(e){const{actor:t,parent:n,nodes:o,allOperations:r,deps:i,htmlParserErrors:a,options:s}=e;return l.G0(...o.map((e=>nt({actor:t,parent:n,node:e,allOperations:r,deps:i,htmlParserErrors:a,options:s}))))}function nt(e){const{actor:t,parent:n,node:o,allOperations:r,deps:i,htmlParserErrors:a,options:c}=e,{importFileMap:u,window:m,secureFileS3Url:g,secureFileS3UrlV2:f,intl:h,randomID:v,spaceIdCreator:y}=i,{useCrdt:b,ignoreBlockCount:_,treatNestedCodeAsCodeBlocks:S,skipTableToCollectionConversion:k}=c;if(o&&o instanceof m.Element){const e=o.tagName.toLowerCase();if("div"===e&&"page-comments"===o.getAttribute("class")){const e=function(e){var t;const{node:n,parent:o,actor:r,window:i,allOperations:a,deps:s,options:l}=e,c=n.getAttribute(he[M.GKr.Discussion])||((null===(t=s.spaceIdCreator)||void 0===t?void 0:t.idInSavedSpace(se.qF))??s.randomID()),d=new Map;return d.set(c,{type:"default",id:c,parent_id:o.id,parent_table:I.iU,resolved:!1,space_id:o.spaceId,version:1}),et({node:n,spaceId:o.spaceId,window:i,blockId:o.id,discussionToTextMap:d,allOperations:a,actor:r,deps:s,options:l}),c}({node:o,window:m,actor:t,allOperations:r,parent:n,deps:i,options:c});return[e]}if("h1"===e)return[Ae({actor:t,parent:n,node:o,type:d.Ti.header,allOperations:r,deps:{window:m,randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_,stripText:!0,stripSurroundingWhitespace:!0}}),...Pe({actor:t,parent:n,node:o,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_}})];if("h2"===e)return[Ae({actor:t,parent:n,node:o,type:d.Ti.subHeader,allOperations:r,deps:{window:m,randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_,stripText:!0,stripSurroundingWhitespace:!0}}),...Pe({actor:t,parent:n,node:o,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_}})];if("hr"===e)return[De({actor:t,parent:n,allOperations:r,deps:{randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_}})];if("h"===e[0])return[Ae({actor:t,parent:n,node:o,type:d.Ti.subSubHeader,allOperations:r,deps:{window:m,randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_,stripText:!0,stripSurroundingWhitespace:!0}}),...Pe({actor:t,parent:n,node:o,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_}})];if("pre"===e||"code"===e||"div"===e&&o.className===pe)return[je({actor:t,parent:n,node:o,allOperations:r,deps:{randomID:v,spaceIdCreator:y,window:m},options:{useCrdt:b,ignoreBlockCount:_}}),...Pe({actor:t,parent:n,node:o,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_}})];if(o.hasAttribute(he[d.Ti.callout]))return[Ue({actor:t,parent:n,node:o,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_}})];if("blockquote"===e)return[qe({actor:t,parent:n,node:o,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_}})];if("details"===e)return[He({actor:t,parent:n,node:o,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_}})];if("table"===e){const{tableData:c,tableFiles:g}=function(e){const{node:t,window:n,importFileMap:o,intl:r}=e,i=[],a=[],s=Array.from(t.querySelectorAll("tr")).filter((e=>e.closest("table")===t));for(const c of s){const e=[],t=[],s=Array.from(c.querySelectorAll("td, th")).filter((e=>e.closest("tr")===c));for(const r of s){const i=(r.textContent||"").trim(),a=ot(r.getAttribute("rowspan"),1),{titleTokens:s}=Te({node:r,window:n,stripText:!1,stripSurroundingWhitespace:!0,ignoreComments:!0});e.push({text:i,textValue:s,rowSpan:a});const c=ot(r.getAttribute("colspan"),1);for(let t=1;t<c;t++)e.push({text:"",rowSpan:a});const u=Me(r);if(u.length){const e=l.oA(u.flatMap((e=>{var t;const n=e.getAttribute("src")||e.getAttribute(he[d.Ti.file])||e.getAttribute(he[d.Ti.audio])||e.getAttribute(he[d.Ti.video]),r=e.getAttribute(he.fileAlias);return n?{name:r||n,url:(null===(t=o[n])||void 0===t?void 0:t.url)||n}:void 0})));t.push(...e)}}e.length&&a.push(e);const u=p.CC(t);i.push({text:r.formatMessage({id:"htmlHelpers.table.fileColumnName",defaultMessage:"Files"}),textValue:u})}for(let l=0;l<a.length;l++){const e=a[l];for(let t=0;t<e.length;t++){const n=e[t].rowSpan;if(n>1)for(let e=1;e<n&&!(l+e>=a.length);e++){a[l+e].splice(t,0,{text:"",rowSpan:1})}}}return{tableData:a,tableFiles:i}}({node:o,window:m,importFileMap:u,intl:h});if(!k&&g.some((e=>{var t;return null===(t=e.textValue)||void 0===t?void 0:t.length})))for(let e=0;e<c.length;e++)c[e].push({text:g[e].text,textValue:g[e].textValue,columnType:{schema:{type:"file"},validate:l._z,coerce:l.yR}});let f="table";if((o.hasAttribute("data-import-as-database")||!k&&g.some((e=>{var t;return null===(t=e.textValue)||void 0===t?void 0:t.length})))&&(f="collection"),0===l.Ar(c).length)return[];if(n.table===C.vF||n.table===ae.x_)return[];const v={...n,table:n.table};try{return[Re({actor:t,parent:v,node:o,tableData:c,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_,tableType:f}})]}catch(w){const t=(0,s.t)(w);if(!a||"CsvImportError"!==t.message)throw w;const n=a.get(e)||0;return a.set(e,n+1),[]}}if("div"===e&&o.hasAttribute(he[d.Ti.columnList]))return[Ge({actor:t,parent:n,node:o,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_}})];if("nav"===e&&o.hasAttribute(he[d.Ti.tableOfContents]))return[ze({actor:t,parent:n,allOperations:r,deps:{randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_}}),...Pe({actor:t,parent:n,node:o,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_}})];if("ul"===e||"ol"===e)return l.G0(...l.UI(o.children,(e=>nt({actor:t,parent:n,node:e,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_}}))));if("li"===e||We.test(o.textContent||"")||$e.test(o.textContent||"")||Ye.test(o.textContent||""))return[Qe({actor:t,parent:n,node:o,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_}})];if("img"===e){const e=o.getAttribute("src");if(e)return[Be({actor:t,parent:n,source:u[e]||{type:"unknown",url:e},allOperations:r,deps:{secureFileS3Url:g,secureFileS3UrlV2:f,randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_,fallbackWidth:o instanceof m.HTMLImageElement?o.width:void 0}})]}if("a"===e&&o.getAttribute(he[d.Ti.externalObjectInstance])){const e=Ne({actor:t,parent:n,node:o,allOperations:r,deps:{randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_}});return e?[e]:[]}if("a"===e&&o.getAttribute(he[d.Ti.file]))return[Ve({actor:t,parent:n,node:o,allOperations:r,deps:{importFileMap:u,secureFileS3Url:g,secureFileS3UrlV2:f,randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_}})];if("a"===e&&0===te.p4(o.childNodes).length){const e=o.getAttribute("href");if(o.hasAttribute("download")&&e)return[Fe({actor:t,parent:n,source:u[e]||{type:"unknown",url:e},allOperations:r,deps:{secureFileS3Url:g,secureFileS3UrlV2:f,randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_}})]}if("video"===e){const e=o.querySelector("source");if(e){const o=e.getAttribute("src");if(o&&ee.xL({url:o}))return[Fe({actor:t,parent:n,source:{type:"unknown",url:o},allOperations:r,deps:{secureFileS3Url:g,secureFileS3UrlV2:f,randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_}})]}}if("audio"===e){const e=o.querySelector("source");if(e){const o=e.getAttribute("src");if(o&&ee._c({url:o}))return[Fe({actor:t,parent:n,source:{type:"unknown",url:o},allOperations:r,deps:{secureFileS3Url:g,secureFileS3UrlV2:f,randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_}})]}}if("iframe"===e){const e=o.getAttribute("src");if(e)return[Ee({actor:t,parent:n,node:o,sourceUrl:e,allOperations:r,deps:{randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_}})]}return"p"===e&&o.getAttribute("confluenceNewLine")?[Ae({actor:t,parent:n,node:o,type:d.Ti.text,allOperations:r,deps:{window:m,randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_,stripText:!0,stripSurroundingWhitespace:!0}})]:o.hasAttribute(he[d.Ti.equation])?[Ke({actor:t,parent:n,node:o,allOperations:r,deps:{randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_}})]:[.../^\s*$/g.test(o.textContent||"")?[]:[Ae({actor:t,parent:n,node:o,type:d.Ti.text,allOperations:r,deps:{window:m,randomID:v,spaceIdCreator:y},options:{useCrdt:b,ignoreBlockCount:_,stripText:!1,stripSurroundingWhitespace:!0,ignoreCodeBlock:S}})],...Pe({actor:t,parent:n,node:o,allOperations:r,deps:i,options:{useCrdt:b,ignoreBlockCount:_,considerCodeBlockAsNonTextItem:S}})]}return[]}function ot(e,t){const n=null!==e?parseInt(e,10):t;return isFinite(n)?n:t}function rt(e){if(e&&-1!==e.indexOf("em"))return parseInt(e)}function it(e,t,n){const o=n.document.createElement(t);for(;e.firstChild;)o.appendChild(e.firstChild);for(let r=e.attributes.length-1;r>=0;--r){const t=e.attributes[r];o.setAttribute(t.name,t.value)}return e.parentNode&&e.parentNode.replaceChild(o,e),o}function at(e,t,n){const o=n.document.createElement(t);for(;e.firstChild;)o.appendChild(e.firstChild);e.appendChild(o)}function st(e){const t=[];let n=e;for(;e.firstChild;){const o=e.firstChild;t.push(o),e.parentNode&&e.parentNode.insertBefore(o,n.nextSibling),n=o}const o=e.parentNode;return o&&(o.removeChild(e),o.normalize()),t}const lt=1e4;function ct(e,t){!function(e,t){const n=Array.from(e.querySelectorAll("p"));for(const o of n){let e=o.firstChild,n=0;for(;e&&n<lt;){let r=!1;if(e instanceof t.Element&&null!==e.textContent&&!e.textContent.trim()){const t=Array.from(e.querySelectorAll("br"));if(t.length>0){for(const n of t)o.insertBefore(n,e);r=!0}}const i=e.nextSibling;r&&o.removeChild(e),e=i,n+=1}}}(e,t);const n=Array.from(e.querySelectorAll("p"));for(let o=0;o<lt;o++){const e=n.shift();if(!e||!e.parentNode)return;const o=e.querySelector("br");if(!o)continue;if(o.parentElement!==e)continue;const r=t.document.createElement("p");e.parentNode.insertBefore(r,e.nextSibling);let i=o.nextSibling;for(;i;){const e=i.nextSibling;r.appendChild(i),i=e}e.removeChild(o),n.unshift(r)}}function dt(e){const t=e.match(/^([0-9]+)px$/i);if(t)return parseInt(t[1])}function ut(e){const{rootNode:t,window:n,isInlineContent:o,emojiData:r}=e;!function(e){const{rootNode:t,window:n,emojiData:{emojiByName:o}}=e,r=Array.from(t.querySelectorAll("img[data-stringify-emoji]"));for(const i of r){const e=i.getAttribute("data-stringify-emoji")||"",t=e.match(/^:(.+):$/);if(!t||!i.parentNode)continue;const r=o[t[1]]||e;i.parentNode.replaceChild(n.document.createTextNode(r),i)}}({rootNode:t,window:n,emojiData:r}),t.normalize(),ct(t,n);const i=te.p4(t.childNodes);for(;i.length>0;){let e=i.shift();if(e instanceof n.Element&&e.parentNode&&"google-sheets-html-origin"===e.tagName.toLowerCase()){const t=te.p4(e.childNodes);for(const n of t)e.parentNode.insertBefore(n,e);i.unshift(...t),e.remove()}else if(e&&e.parentNode&&3===e.nodeType&&/^( |\t)*(\n)+( |\t)*$/.test(e.data))e.parentNode.removeChild(e);else if(e&&e instanceof n.Element&&e.parentNode&&ue[e.tagName.toLowerCase()])e.parentNode.removeChild(e);else{if(e instanceof n.HTMLElement){const t=(a=e.style.fontSize||void 0)&&-1!==a.indexOf("px")||a&&-1!==a.indexOf("pt")?parseInt(a):void 0,o=rt(e.style.fontSize||void 0);(t&&t>=24||o&&o>2)&&(e=it(e,"h1",n))}if(e instanceof n.HTMLElement&&("line-through"===e.style.textDecoration&&at(e,"del",n),"italic"===e.style.fontStyle&&at(e,"em",n),("bold"===e.style.fontWeight||e.style.fontWeight&&parseInt(e.style.fontWeight)>=500)&&at(e,"strong",n)),e instanceof n.HTMLImageElement){const t=dt(e.style.width);!e.width&&t&&(e.width=t)}if(e instanceof n.HTMLElement&&("b"===e.tagName.toLowerCase()?e=it(e,"strong",n):"i"===e.tagName.toLowerCase()&&(e=it(e,"em",n))),e instanceof n.HTMLElement&&"strong"===e.tagName.toLowerCase()&&"normal"===e.style.fontWeight&&(e=it(e,"span",n)),e instanceof n.HTMLElement&&("section"===e.tagName.toLowerCase()||"article"===e.tagName.toLowerCase())&&(e=it(e,"div",n)),e instanceof n.HTMLElement&&"div"===e.tagName.toLowerCase()&&"inline"===e.style.display&&(e=it(e,"span",n)),e instanceof n.HTMLElement&&"input"===e.tagName.toLowerCase()&&"checkbox"===e.type){const t=e.checked,o=e.parentNode,r=n.document.createElement("span");r.textContent=`[${t?"x":" "}] `,o&&(o.insertBefore(r,e),o.removeChild(e)),i.push(r)}else{if(e instanceof n.HTMLElement&&"table"===e.tagName.toLowerCase()){const t=Array.from(e.querySelectorAll("tr")).map((e=>e.querySelectorAll("td, th")));if(t.every((e=>1===e.length))){const o=n.document.createDocumentFragment();for(const e of t){const t=e[0],r=t.childNodes.length;for(let e=0;e<r;e+=1){const n=t.childNodes[e];n&&(o.appendChild(n.cloneNode(!0)),i.push(n))}o.appendChild(n.document.createElement("hr"))}e.parentNode&&e.parentNode.replaceChild(o,e)}}if(e instanceof n.HTMLElement&&("ul"===e.tagName.toLowerCase()||"ol"===e.tagName.toLowerCase())&&e.parentNode instanceof n.HTMLElement&&("ul"===e.parentNode.tagName.toLowerCase()||"ol"===e.parentNode.tagName.toLowerCase())&&e.previousSibling instanceof n.HTMLElement&&"li"===e.previousSibling.tagName.toLowerCase()&&e.previousSibling.appendChild(e),e instanceof n.Element&&(e.removeAttribute("style"),e.removeAttribute("dir")),e instanceof n.Element&&"span"===e.tagName.toLowerCase()){if("page-comment"===e.getAttribute("class")||"retain-span"===e.getAttribute("class"))continue;(e.hasAttribute(he[M.GKr.Highlight])||e.hasAttribute(he[M.GKr.Discussion])||e.hasAttribute(he[M.GKr.Comment])||e.hasAttribute(he[M.GKr.Equation])?Array.from(e.children):st(e)).forEach((e=>i.push(e)))}else if(e){te.p4(e.childNodes).forEach((e=>i.push(e)))}}}}var a;for(te.p4(t.childNodes).forEach((e=>i.push(e)));i.length>0;){const e=i.shift();if(e)if(pt(e,n)&&l.yW(e.childNodes,(e=>e instanceof n.Element&&"h1"===e.tagName.toLowerCase()))){const t=n.document.createElement("h1");l.S6(e.childNodes,(e=>{l.S6(e.childNodes,(e=>{const n=e.cloneNode(!0);n&&t.appendChild(n)}))}));const o=e.parentNode;if(o){if("td"===e.tagName.toLowerCase()||"th"===e.tagName.toLowerCase()){const r=n.document.createElement(e.tagName.toLowerCase());r.appendChild(t),o.insertBefore(r,e)}else o.insertBefore(t,e);o.removeChild(e)}i.push(t)}else if(pt(e,n)&&l.yW(e.childNodes,(e=>e instanceof n.Element&&"h2"===e.tagName.toLowerCase()))){const t=n.document.createElement("h2");l.S6(e.childNodes,(e=>{l.S6(e.childNodes,(e=>{const n=e.cloneNode(!0);n&&t.appendChild(n)}))}));const o=e.parentNode;if(o){if("td"===e.tagName.toLowerCase()||"th"===e.tagName.toLowerCase()){const r=n.document.createElement(e.tagName.toLowerCase());r.appendChild(t),o.insertBefore(r,e)}else o.insertBefore(t,e);o.removeChild(e)}i.push(t)}else if(e instanceof n.HTMLElement&&("div"===e.tagName.toLowerCase()||"span"===e.tagName.toLowerCase())&&e.parentNode&&0===e.childNodes.length)e.parentNode.removeChild(e);else if(!pt(e,n)||"p"!==e.tagName.toLowerCase()&&"div"!==e.tagName.toLowerCase()&&"figure"!==e.tagName.toLowerCase()||!te.p4(e.childNodes).some((e=>e instanceof n.Element&&("p"===e.tagName.toLowerCase()||"div"===e.tagName.toLowerCase()||"img"===e.tagName.toLowerCase()||"ul"===e.tagName.toLowerCase()||"table"===e.tagName.toLowerCase()||"hr"===e.tagName.toLowerCase()||"video"===e.tagName.toLowerCase())))){if(e&&e.childNodes){te.p4(e.childNodes).forEach((e=>i.push(e)))}}else{st(e).forEach((e=>i.push(e)))}}t.normalize(),o||te.p4(t.childNodes).forEach((e=>{if(3===e.nodeType){const o=n.document.createElement("p");t.insertBefore(o,e),o.appendChild(e)}}))}function pt(e,t){return e instanceof t.Element&&(0!==e.childNodes.length&&!(e.hasAttribute(he[d.Ti.columnList])||e.hasAttribute(he[d.Ti.column])||e.hasAttribute(he[d.Ti.callout])))}function mt(e){const{actor:t,parent:n,rootNode:o,deps:r,htmlParserErrors:i,options:a}=e;ut({rootNode:o,window:r.window,isInlineContent:!1,emojiData:r.emojiData});const s=[];return{allOperations:s,rootContentIds:tt({actor:t,parent:n,nodes:te.p4(o.children),allOperations:s,deps:r,htmlParserErrors:i,options:a})}}function gt(e){const{node:t,window:n,stripText:o,stripSurroundingWhitespace:r,emojiData:i}=e;ut({rootNode:t,window:n,isInlineContent:!0,emojiData:i});const{titleTokens:a}=Te({node:t,window:n,stripText:o,stripSurroundingWhitespace:r,ignoreComments:!0});return a}function ft(e){const{node:t,window:n,emojiData:o}=e;return ut({rootNode:t,window:n,isInlineContent:!1,emojiData:o}),vt(t,n)}const ht=new Set(["span","div","p"]);function vt(e,t){const n=e.tagName.toLowerCase();if(!ht.has(n))return!0;if("div"===n&&(e.className===pe||e.hasAttribute(he[d.Ti.columnList])))return!0;for(const o of Array.from(e.childNodes))if(_e(t,o)&&vt(o,t))return!0;return!1}function yt(e){if("default"===e||"gray"===e||"brown"===e||"orange"===e||"yellow"===e||"teal"===e||"blue"===e||"purple"===e||"pink"===e||"red"===e||"gray_background"===e||"brown_background"===e||"orange_background"===e||"yellow_background"===e||"teal_background"===e||"blue_background"===e||"purple_background"===e||"pink_background"===e||"red_background"===e)return e}},114581:(e,t,n)=>{n.d(t,{h:()=>o});const o=(0,n(745238).CZ)("exclamationMarkTriangle",{default:{loader:()=>n.e(15187).then(n.bind(n,15187)),size:20},small:{loader:()=>n.e(79250).then(n.bind(n,979250)),size:16},mini:{loader:()=>n.e(93173).then(n.bind(n,793173)),size:14},large:{loader:()=>n.e(43339).then(n.bind(n,343339)),size:24}})},636127:(e,t,n)=>{n.d(t,{b:()=>o});const o=(0,n(745238).CZ)("infoCircle",{default:{loader:()=>n.e(27140).then(n.bind(n,427140)),size:20},small:{loader:()=>n.e(46779).then(n.bind(n,346779)),size:16},mini:{loader:()=>n.e(15314).then(n.bind(n,115314)),size:14},large:{loader:()=>n.e(91075).then(n.bind(n,791075)),size:24}})},379016:(e,t,n)=>{n.d(t,{j:()=>o});const o=(0,n(745238).CZ)("trash",{default:{loader:()=>n.e(79983).then(n.bind(n,79983)),size:20},small:{loader:()=>n.e(80407).then(n.bind(n,980407)),size:16},mini:{loader:()=>n.e(17817).then(n.bind(n,217817)),size:14},large:{loader:()=>n.e(93029).then(n.bind(n,193029)),size:24}})},379362:(e,t,n)=>{n.d(t,{Lr:()=>f,Oe:()=>g,Pk:()=>p,R9:()=>m,RR:()=>h,V2:()=>l,c:()=>c,kR:()=>d,mk:()=>u});var o=n(709291),r=n(997466),i=n(531701);const a=/^(?:https:\/\/(?:www\.)?notion\.so\/icons\/|notion\.so\/icons\/|\/?icons\/)([^\/]+)$/,s=/^([a-z1-9\-]+)_?([a-z]*).svg$/;function l(e){return e.startsWith("/icons/")}function c(e){const t=e.match(a),[,n]=t??[],o=null==n?void 0:n.match(s),[,r,i]=o??[];if(r){return{iconName:r,color:g.find((e=>e===i))}}}function d(e){return e.startsWith("/images/app-packages/")}function u(e){const t=e.split(/[/_.]/)[3];return g.find((e=>e===t))??"gray"}function p(e){let{icon:t,mode:n,useLightGrayColor:o}=e;const a=u(t),s="lightgray"===a?"gray":a;return o&&"gray"===s?"light"===n?(0,r.Fq)(i.se.light.darkgray,.06):i.FN.dark.translucentGray[200]:"light"===n?i.FN[n][s][100]:i.FN[n][s][300]}function m(e,t){const n=u(e),o="lightgray"===n?"gray":n;return i.FN[t][o][200]}const g=["gray","lightgray","brown","yellow","orange","green","blue","purple","pink","red"],f={dark:{blue:"#2E7CD1",brown:"#AA755F",gray:"#D3D3D3",green:"#2D9964",lightgray:"#7F7F7F",orange:"#D87620",pink:"#C94079",purple:"#8D5BC1",red:"#CD4945",yellow:"#CA8E1B"},light:{blue:"#337ea9",brown:"#9F6B53",gray:"#55534E",green:"#448361",lightgray:"#A6A299",orange:"#d9730d",pink:"#C14C8A",purple:"#9065B0",red:"#D44C47",yellow:"#CB912F"}},h=(0,o.defineMessages)({blue:{defaultMessage:"blue",id:"iconPickerColorPicker.color.blue"},brown:{defaultMessage:"brown",id:"iconPickerColorPicker.color.brown"},lightgray:{defaultMessage:"lightgray",id:"iconPickerColorPicker.color.lightgray"},green:{defaultMessage:"green",id:"iconPickerColorPicker.color.green"},gray:{defaultMessage:"default",id:"iconPickerColorPicker.color.default"},orange:{defaultMessage:"orange",id:"iconPickerColorPicker.color.orange"},pink:{defaultMessage:"pink",id:"iconPickerColorPicker.color.pink"},purple:{defaultMessage:"purple",id:"iconPickerColorPicker.color.purple"},red:{defaultMessage:"red",id:"iconPickerColorPicker.color.red"},yellow:{defaultMessage:"yellow",id:"iconPickerColorPicker.color.yellow"}})},745238:(e,t,n)=>{n.d(t,{CZ:()=>a,IU:()=>i});n(667294);var o=n(633831),r=n(785893);function i(e,t){const{viewBox:n,svg:i}=t;return Object.assign(((t,a)=>{const s=a?`${e} ${a}`:e;return(0,r.jsx)(o.Z,{viewBox:n,className:s,style:t,children:i})}),{__iconDefinition:t})}function a(e,t){return{name:e,variants:t}}},188607:(e,t,n)=>{n.d(t,{Q:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("aiTranslate",{viewBox:"0 0 16 16",svg:(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M0.990263 11.9374C1.50923 11.9374 1.80048 11.6727 1.98582 11.0266L2.2453 10.2111H4.86129L5.12077 11.0584C5.29023 11.6833 5.58149 11.9374 6.14281 11.9374C6.70943 11.9374 7.11719 11.5509 7.11719 11.0054C7.11719 10.8042 7.08012 10.6241 6.9901 10.3753L5.089 5.19623C4.79775 4.4019 4.33174 4.06299 3.53212 4.06299C2.77486 4.06299 2.30355 4.41779 2.02289 5.19623L0.137684 10.3753C0.0529553 10.6083 0 10.8466 0 11.0107C0 11.5879 0.375982 11.9374 0.990263 11.9374ZM2.63188 8.74423L3.50034 5.79992H3.54271L4.43765 8.74423H2.63188Z"}),(0,r.jsx)("path",{d:"M9.92506 8.57591C9.38887 8.91351 9.12077 9.32393 9.12077 9.80717C9.12077 10.0653 9.18035 10.2672 9.29951 10.4129C9.42528 10.5519 9.59739 10.6214 9.81584 10.6214C9.82908 10.6214 9.84563 10.6214 9.86549 10.6214C9.88535 10.6148 9.89859 10.6115 9.9052 10.6115C9.96478 10.6115 9.99457 10.5817 9.99457 10.5221V8.6057C9.99457 8.55274 9.9714 8.54281 9.92506 8.57591ZM12.3776 7.97021C12.0864 7.97021 11.805 7.99007 11.5336 8.02979C11.4807 8.04303 11.4542 8.07282 11.4542 8.11915V9.68801C11.4542 9.70125 11.4608 9.71118 11.4741 9.7178C11.4939 9.72442 11.5072 9.72111 11.5138 9.70787C11.9441 9.25773 12.3081 8.70499 12.606 8.04965C12.6126 8.02979 12.6093 8.01324 12.5961 8C12.5829 7.98014 12.5663 7.97021 12.5464 7.97021H12.3776ZM9.64704 11.9718C9.03141 11.9718 8.53493 11.7931 8.15761 11.4356C7.78691 11.0781 7.60156 10.5916 7.60156 9.97597C7.60156 9.30738 7.80346 8.71492 8.20726 8.19859C8.61106 7.67564 9.18366 7.27846 9.92506 7.00705C9.9714 6.98719 9.99457 6.95078 9.99457 6.89783V6.03396C9.99457 5.981 9.96809 5.95452 9.91513 5.95452H8.6243C8.47205 5.95452 8.33966 5.89826 8.22712 5.78572C8.11459 5.67319 8.05832 5.54079 8.05832 5.38854V5.2396C8.05832 5.08735 8.11459 4.95496 8.22712 4.84242C8.33966 4.72989 8.47205 4.67362 8.6243 4.67362H9.91513C9.96809 4.67362 9.99457 4.64714 9.99457 4.59418V4.17715C9.99457 4.02489 10.0508 3.89581 10.1634 3.7899C10.2759 3.67736 10.4083 3.62109 10.5606 3.62109H10.8882C11.0405 3.62109 11.1729 3.67736 11.2854 3.7899C11.3979 3.89581 11.4542 4.02489 11.4542 4.17715V4.59418C11.4542 4.64714 11.484 4.67362 11.5436 4.67362H14.9792C15.1314 4.67362 15.2638 4.72989 15.3764 4.84242C15.4889 4.95496 15.5452 5.08735 15.5452 5.2396V5.38854C15.5452 5.54079 15.4889 5.67319 15.3764 5.78572C15.2638 5.89826 15.1314 5.95452 14.9792 5.95452H11.5436C11.484 5.95452 11.4542 5.981 11.4542 6.03396V6.58008C11.4542 6.62642 11.4807 6.64959 11.5336 6.64959C11.7719 6.62311 12.0533 6.60987 12.3776 6.60987C13.5427 6.60987 14.4364 6.86473 15.0586 7.37444C15.6875 7.87754 16.0019 8.56598 16.0019 9.43978C16.0019 10.1216 15.7934 10.7174 15.3764 11.2271C14.9659 11.7302 14.3966 12.0976 13.6685 12.3293C13.5228 12.3756 13.3805 12.359 13.2415 12.2796C13.1025 12.2002 13.0098 12.0843 12.9635 11.9321L12.8741 11.6541C12.8278 11.515 12.841 11.3793 12.9138 11.2469C12.9867 11.1079 13.0959 11.0086 13.2415 10.9491C13.6188 10.7902 13.92 10.575 14.1451 10.3036C14.3702 10.0322 14.4827 9.74428 14.4827 9.43978C14.4827 9.00288 14.3437 8.66197 14.0657 8.41704C14.0326 8.38394 14.0028 8.39718 13.9763 8.45676C13.5063 9.57548 12.8807 10.4427 12.0996 11.0583C11.3251 11.6673 10.5076 11.9718 9.64704 11.9718Z"})]})})},136700:(e,t,n)=>{n.d(t,{m:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("alarmClock",{viewBox:"0 0 14 14",svg:(0,r.jsx)("path",{d:"M4.31165,1.1958 L1.01208,3.95264 L0,2.75684 L3.30725,0 L4.31165,1.1958 Z M14,2.76416 L12.988,3.95947 L9.68127,1.1958 L10.6932,0 L14,2.76416 Z M7,1.50244 C10.4635,1.50244 13.2732,4.2998 13.2732,7.75098 C13.2732,11.2026 10.4635,14 7,14 C3.52954,14 0.726929,11.2026 0.726929,7.75098 C0.726929,4.2998 3.5365,1.50244 7,1.50244 Z M7.44116,4.23584 L7.44116,7.86572 L10.2234,9.50781 L9.60596,10.5166 L6.21594,8.49023 L6.21594,4.23584 L7.44116,4.23584 Z M2.29517,7.75098 C2.29517,10.3408 4.39819,12.4365 7,12.4365 C9.60181,12.4365 11.7048,10.3408 11.7048,7.75098 C11.7048,5.16113 9.60181,3.06543 7,3.06543 C4.39819,3.06543 2.29517,5.16113 2.29517,7.75098 Z"})})},509999:(e,t,n)=>{n.d(t,{J:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("alias",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M13.1475 10.5869V3.72363C13.1475 3.25195 12.833 2.93066 12.3477 2.93066H5.48438C5.02637 2.93066 4.70508 3.27246 4.70508 3.67578C4.70508 4.07227 5.05371 4.40039 5.46387 4.40039H7.89746L10.8438 4.30469L9.59961 5.39844L3.08496 11.9199C2.92773 12.0771 2.8457 12.2686 2.8457 12.46C2.8457 12.8564 3.20801 13.2256 3.61816 13.2256C3.80957 13.2256 3.99414 13.1504 4.15137 12.9932L10.6729 6.47168L11.7803 5.22754L11.6641 8.05762V10.6074C11.6641 11.0176 11.9922 11.373 12.4023 11.373C12.8057 11.373 13.1475 11.0312 13.1475 10.5869Z"})})},733907:(e,t,n)=>{n.d(t,{n:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("arrowRight",{viewBox:"0 0 30 30",svg:(0,r.jsx)("polygon",{points:"1 14 25.188 14 16.594 5.406 18 4 29 15 18 26 16.594 24.594 25.188 16 1 16"})})},629651:(e,t,n)=>{n.d(t,{w:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("arrowUpThick",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M7.99316 14.6133C8.58789 14.6133 8.98438 14.2031 8.98438 13.5879V6L8.92285 4.5166L10.2969 6.10254L11.835 7.63379C12.0195 7.81836 12.252 7.94141 12.5459 7.94141C13.0791 7.94141 13.4824 7.54492 13.4824 6.98438C13.4824 6.72461 13.3799 6.48535 13.1748 6.27344L8.72461 1.82324C8.54004 1.63184 8.2666 1.52246 7.99316 1.52246C7.72656 1.52246 7.44629 1.63184 7.26172 1.82324L2.81836 6.27344C2.61328 6.48535 2.51074 6.72461 2.51074 6.98438C2.51074 7.54492 2.91406 7.94141 3.44727 7.94141C3.74805 7.94141 3.98047 7.81836 4.1582 7.63379L5.69629 6.10254L7.07031 4.5166L7.00195 6V13.5879C7.00195 14.2031 7.40527 14.6133 7.99316 14.6133Z"})})},591856:(e,t,n)=>{n.d(t,{Y:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("assistSummarize",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.87305 7.23047C1.79297 7.23047 0.96582 6.40332 0.96582 5.13184C0.96582 3.375 2.33984 2.06934 3.88477 2.06934C4.2334 2.06934 4.50684 2.25391 4.50684 2.5752C4.50684 2.83496 4.30176 3.04004 4.03516 3.06055C3.05078 3.1084 2.33301 3.7168 2.12109 4.63965C2.33984 4.33203 2.66797 4.18164 3.07812 4.18164C3.90527 4.18164 4.51367 4.77637 4.51367 5.67188C4.51367 6.6084 3.77539 7.23047 2.87305 7.23047ZM7.13867 7.23047C6.06543 7.23047 5.23828 6.40332 5.23828 5.13184C5.23828 3.375 6.61914 2.06934 8.15723 2.06934C8.5127 2.06934 8.7793 2.25391 8.7793 2.5752C8.7793 2.83496 8.57422 3.04004 8.30078 3.06055C7.32324 3.1084 6.60547 3.7168 6.40039 4.63965C6.6123 4.3252 6.94727 4.18164 7.35059 4.18164C8.17773 4.18164 8.78613 4.77637 8.78613 5.67188C8.78613 6.6084 8.04785 7.23047 7.13867 7.23047ZM10.6045 3.27246C10.2695 3.27246 10.0029 3.00586 10.0029 2.6709C10.0029 2.33594 10.2695 2.06934 10.6045 2.06934H14.4395C14.7744 2.06934 15.0479 2.33594 15.0479 2.6709C15.0479 3.00586 14.7744 3.27246 14.4395 3.27246H10.6045ZM10.6045 6.85449C10.2695 6.85449 10.0029 6.58789 10.0029 6.25293C10.0029 5.91797 10.2695 5.65137 10.6045 5.65137H14.4395C14.7744 5.65137 15.0479 5.91797 15.0479 6.25293C15.0479 6.58789 14.7744 6.85449 14.4395 6.85449H10.6045ZM1.55371 10.4365C1.21875 10.4365 0.952148 10.1699 0.952148 9.83496C0.952148 9.5 1.21875 9.2334 1.55371 9.2334H14.4395C14.7744 9.2334 15.0479 9.5 15.0479 9.83496C15.0479 10.1699 14.7744 10.4365 14.4395 10.4365H1.55371ZM1.55371 14.0117C1.21875 14.0117 0.952148 13.752 0.952148 13.417C0.952148 13.0752 1.21875 12.8154 1.55371 12.8154H14.4395C14.7744 12.8154 15.0479 13.0752 15.0479 13.417C15.0479 13.752 14.7744 14.0117 14.4395 14.0117H1.55371Z"})})},959194:(e,t,n)=>{n.d(t,{s:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("attachFile",{viewBox:"0 0 20 20",svg:(0,r.jsx)("path",{d:"M15.7608 10.5231L9.60997 16.674C8.07432 18.218 6.01573 18.0769 4.69591 16.7404C3.35948 15.4206 3.22667 13.3703 4.77061 11.8264L13.1959 3.39278C14.0758 2.51289 15.4039 2.33028 16.2755 3.20186C17.1554 4.08174 16.9645 5.40157 16.0846 6.28145L7.7838 14.5988C7.45177 14.9309 7.05333 14.8396 6.82091 14.6154C6.60509 14.383 6.51378 13.9929 6.84581 13.6525L12.6315 7.8669C12.9552 7.54317 12.9718 7.06172 12.6564 6.74629C12.3409 6.43916 11.8595 6.44746 11.5357 6.77119L5.7252 12.59C4.79551 13.5197 4.83702 14.9475 5.6588 15.7775C6.55528 16.674 7.91661 16.6491 8.8463 15.7194L17.1969 7.36885C18.8487 5.71699 18.7906 3.54219 17.338 2.08125C15.9103 0.661819 13.7023 0.57051 12.0504 2.22237L3.5587 10.7224C1.4171 12.864 1.55821 15.9602 3.51719 17.9191C5.47618 19.8781 8.57237 20.0192 10.7223 17.8776L16.9147 11.6853C17.2301 11.3781 17.2301 10.8054 16.9064 10.5065C16.5992 10.1745 16.0846 10.2077 15.7608 10.5231Z"})})},590792:(e,t,n)=>{n.d(t,{t:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("bell",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M1.36914 11.7627C1.36914 12.3369 1.80664 12.7266 2.51074 12.7266H5.32031C5.38184 14.0322 6.44824 15.2285 8 15.2285C9.55176 15.2285 10.6182 14.0391 10.6797 12.7266H13.4893C14.2002 12.7266 14.6309 12.3369 14.6309 11.7627C14.6309 11.0381 13.9678 10.416 13.3457 9.81445C12.8672 9.34277 12.751 8.39941 12.6621 7.46289C12.5732 4.87207 11.8213 3.14258 10.0371 2.49316C9.77734 1.59082 9.01855 0.900391 8 0.900391C6.98145 0.900391 6.22266 1.59082 5.96289 2.49316C4.17871 3.14258 3.42676 4.87207 3.33789 7.46289C3.24902 8.39941 3.13965 9.34277 2.6543 9.81445C2.03906 10.416 1.36914 11.0381 1.36914 11.7627ZM3.00293 11.4756V11.3936C3.18066 11.1953 3.57715 10.833 3.91211 10.4434C4.38379 9.90332 4.60254 8.92578 4.6709 7.62695C4.75293 4.85156 5.60059 3.92871 6.70801 3.62793C6.87207 3.58691 6.96777 3.50488 6.98145 3.32031C7.01562 2.62305 7.39844 2.1582 8 2.1582C8.60156 2.1582 8.99121 2.62305 9.01855 3.32031C9.03223 3.50488 9.12793 3.58691 9.29883 3.62793C10.3994 3.92871 11.2539 4.85156 11.3291 7.62695C11.3975 8.92578 11.623 9.90332 12.0879 10.4434C12.4297 10.833 12.8125 11.1953 12.9834 11.3936V11.4756H3.00293ZM6.6123 12.7266H9.3877C9.33984 13.5811 8.7793 14.1348 8 14.1348C7.22754 14.1348 6.66699 13.5811 6.6123 12.7266Z"})})},383096:(e,t,n)=>{n.d(t,{Q:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("book",{viewBox:"0 0 30 30",svg:(0,r.jsx)("path",{d:"M27,23V1H7C4.791,1,3,2.791,3,5v20c0,2.209,1.791,4,4,4h20v-2h-1v-4H27z M21,3v6l-1-1.333L19,9V3H21z M20,11l3,4V3h2v18H9V3 h8v12L20,11z M5,5c0-1.103,0.896-2,2-2v18c-0.729,0-1.411,0.195-2,0.537V5z M24,27H7c-1.104,0-2-0.896-2-2s0.896-2,2-2h17V27z"})})},569651:(e,t,n)=>{n.d(t,{C:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("calendar",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M3.24902 14.7764H12.6621C14.1455 14.7764 14.918 14.0107 14.918 12.5479V4.22852C14.918 2.76562 14.1455 2 12.6621 2H3.24902C1.77246 2 1 2.75879 1 4.22852V12.5479C1 14.0107 1.77246 14.7764 3.24902 14.7764ZM3.24219 13.416C2.6748 13.416 2.36035 13.1221 2.36035 12.5205V6.23145C2.36035 5.62988 2.6748 5.33594 3.24219 5.33594H12.6689C13.2363 5.33594 13.5508 5.62988 13.5508 6.23145V12.5205C13.5508 13.1221 13.2363 13.416 12.6689 13.416H3.24219ZM6.63965 7.69434H7.04297C7.28906 7.69434 7.37109 7.61914 7.37109 7.37988V6.97656C7.37109 6.73047 7.28906 6.65527 7.04297 6.65527H6.63965C6.39355 6.65527 6.31152 6.73047 6.31152 6.97656V7.37988C6.31152 7.61914 6.39355 7.69434 6.63965 7.69434ZM8.875 7.69434H9.27832C9.51758 7.69434 9.59961 7.61914 9.59961 7.37988V6.97656C9.59961 6.73047 9.51758 6.65527 9.27832 6.65527H8.875C8.62891 6.65527 8.54688 6.73047 8.54688 6.97656V7.37988C8.54688 7.61914 8.62891 7.69434 8.875 7.69434ZM11.1035 7.69434H11.5068C11.7529 7.69434 11.835 7.61914 11.835 7.37988V6.97656C11.835 6.73047 11.7529 6.65527 11.5068 6.65527H11.1035C10.8643 6.65527 10.7822 6.73047 10.7822 6.97656V7.37988C10.7822 7.61914 10.8643 7.69434 11.1035 7.69434ZM4.41113 9.89551H4.80762C5.05371 9.89551 5.13574 9.82031 5.13574 9.57422V9.1709C5.13574 8.93164 5.05371 8.85645 4.80762 8.85645H4.41113C4.16504 8.85645 4.08301 8.93164 4.08301 9.1709V9.57422C4.08301 9.82031 4.16504 9.89551 4.41113 9.89551ZM6.63965 9.89551H7.04297C7.28906 9.89551 7.37109 9.82031 7.37109 9.57422V9.1709C7.37109 8.93164 7.28906 8.85645 7.04297 8.85645H6.63965C6.39355 8.85645 6.31152 8.93164 6.31152 9.1709V9.57422C6.31152 9.82031 6.39355 9.89551 6.63965 9.89551ZM8.875 9.89551H9.27832C9.51758 9.89551 9.59961 9.82031 9.59961 9.57422V9.1709C9.59961 8.93164 9.51758 8.85645 9.27832 8.85645H8.875C8.62891 8.85645 8.54688 8.93164 8.54688 9.1709V9.57422C8.54688 9.82031 8.62891 9.89551 8.875 9.89551ZM11.1035 9.89551H11.5068C11.7529 9.89551 11.835 9.82031 11.835 9.57422V9.1709C11.835 8.93164 11.7529 8.85645 11.5068 8.85645H11.1035C10.8643 8.85645 10.7822 8.93164 10.7822 9.1709V9.57422C10.7822 9.82031 10.8643 9.89551 11.1035 9.89551ZM4.41113 12.0898H4.80762C5.05371 12.0898 5.13574 12.0146 5.13574 11.7754V11.3721C5.13574 11.126 5.05371 11.0508 4.80762 11.0508H4.41113C4.16504 11.0508 4.08301 11.126 4.08301 11.3721V11.7754C4.08301 12.0146 4.16504 12.0898 4.41113 12.0898ZM6.63965 12.0898H7.04297C7.28906 12.0898 7.37109 12.0146 7.37109 11.7754V11.3721C7.37109 11.126 7.28906 11.0508 7.04297 11.0508H6.63965C6.39355 11.0508 6.31152 11.126 6.31152 11.3721V11.7754C6.31152 12.0146 6.39355 12.0898 6.63965 12.0898ZM8.875 12.0898H9.27832C9.51758 12.0898 9.59961 12.0146 9.59961 11.7754V11.3721C9.59961 11.126 9.51758 11.0508 9.27832 11.0508H8.875C8.62891 11.0508 8.54688 11.126 8.54688 11.3721V11.7754C8.54688 12.0146 8.62891 12.0898 8.875 12.0898Z"})})},760019:(e,t,n)=>{n.d(t,{F:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("categories",{viewBox:"0 0 14 14",svg:(0,r.jsx)("path",{d:"M3.25391 6.53809C1.59961 6.53809 0.25293 5.18457 0.25293 3.53711C0.25293 1.90332 1.59961 0.549805 3.25391 0.549805C4.90137 0.549805 6.24805 1.90332 6.24805 3.53711C6.24805 5.18457 4.90137 6.53809 3.25391 6.53809ZM10.7461 6.53809C9.08496 6.53809 7.74512 5.18457 7.74512 3.53711C7.74512 1.90332 9.08496 0.549805 10.7461 0.549805C12.3867 0.549805 13.7402 1.90332 13.7402 3.53711C13.7402 5.18457 12.3867 6.53809 10.7461 6.53809ZM3.25391 5.29395C4.23145 5.29395 5.00391 4.52832 5.00391 3.54395C5.00391 2.56641 4.23145 1.77344 3.25391 1.77344C2.2627 1.77344 1.49707 2.56641 1.49707 3.54395C1.49707 4.52832 2.2627 5.29395 3.25391 5.29395ZM10.7461 5.29395C11.7236 5.29395 12.4961 4.52832 12.4961 3.54395C12.4961 2.56641 11.7236 1.77344 10.7461 1.77344C9.75488 1.77344 8.98242 2.56641 8.98242 3.54395C8.98242 4.52832 9.75488 5.29395 10.7461 5.29395ZM3.25391 13.5791C1.59961 13.5791 0.25293 12.2256 0.25293 10.5781C0.25293 8.94434 1.59961 7.58398 3.25391 7.58398C4.90137 7.58398 6.24805 8.94434 6.24805 10.5781C6.24805 12.2256 4.90137 13.5791 3.25391 13.5791ZM10.7461 13.5791C9.08496 13.5791 7.74512 12.2256 7.74512 10.5781C7.74512 8.94434 9.08496 7.58398 10.7461 7.58398C12.3867 7.58398 13.7402 8.94434 13.7402 10.5781C13.7402 12.2256 12.3867 13.5791 10.7461 13.5791ZM3.25391 12.3281C4.23145 12.3281 5.00391 11.5625 5.00391 10.5781C5.00391 9.60059 4.23145 8.80762 3.25391 8.80762C2.2627 8.80762 1.49707 9.60059 1.49707 10.5781C1.49707 11.5625 2.2627 12.3281 3.25391 12.3281ZM10.7461 12.3281C11.7236 12.3281 12.4961 11.5625 12.4961 10.5781C12.4961 9.60059 11.7236 8.80762 10.7461 8.80762C9.75488 8.80762 8.98242 9.60059 8.98242 10.5781C8.98242 11.5625 9.75488 12.3281 10.7461 12.3281Z"})})},849019:(e,t,n)=>{n.d(t,{e:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("collectionSearch",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M0 6.35938C0 9.86719 2.85156 12.7188 6.35938 12.7188C7.66406 12.7188 8.85938 12.3203 9.85938 11.6406L13.4531 15.2344C13.6719 15.4609 13.9766 15.5625 14.2812 15.5625C14.9453 15.5625 15.4219 15.0625 15.4219 14.4141C15.4219 14.1016 15.3125 13.8125 15.1016 13.5938L11.5312 10.0156C12.2734 8.99219 12.7188 7.72656 12.7188 6.35938C12.7188 2.85156 9.86719 0 6.35938 0C2.85156 0 0 2.85156 0 6.35938ZM1.65625 6.35938C1.65625 3.76562 3.75781 1.65625 6.35938 1.65625C8.95312 1.65625 11.0625 3.76562 11.0625 6.35938C11.0625 8.95312 8.95312 11.0625 6.35938 11.0625C3.75781 11.0625 1.65625 8.95312 1.65625 6.35938Z"})})},742696:(e,t,n)=>{n.d(t,{t:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("collectionTable",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.39697 14.4634H13.5964C15.0532 14.4634 15.8311 13.6921 15.8311 12.2485V4.24609C15.8311 2.80249 15.0532 2.03125 13.5964 2.03125H2.39697C0.940186 2.03125 0.162354 2.7959 0.162354 4.24609V12.2485C0.162354 13.6987 0.940186 14.4634 2.39697 14.4634ZM1.63232 4.39771C1.63232 3.79126 1.94214 3.50122 2.52222 3.50122H7.28809V5.74243H1.63232V4.39771ZM13.4712 3.50122C14.0447 3.50122 14.3611 3.79126 14.3611 4.39771V5.74243H8.70532V3.50122H13.4712ZM1.63232 9.3811V7.10693H7.28809V9.3811H1.63232ZM8.70532 9.3811V7.10693H14.3611V9.3811H8.70532ZM2.52222 12.9934C1.94214 12.9934 1.63232 12.7034 1.63232 12.0969V10.7522H7.28809V12.9934H2.52222ZM14.3611 12.0969C14.3611 12.7034 14.0447 12.9934 13.4712 12.9934H8.70532V10.7522H14.3611V12.0969Z"})})},356666:(e,t,n)=>{n.d(t,{o:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("dots",{viewBox:"0 0 13 3",svg:(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M3,1.5A1.5,1.5,0,1,1,1.5,0,1.5,1.5,0,0,1,3,1.5Z"}),(0,r.jsx)("path",{d:"M8,1.5A1.5,1.5,0,1,1,6.5,0,1.5,1.5,0,0,1,8,1.5Z"}),(0,r.jsx)("path",{d:"M13,1.5A1.5,1.5,0,1,1,11.5,0,1.5,1.5,0,0,1,13,1.5Z"})]})})},388437:(e,t,n)=>{n.d(t,{a:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("duplicate",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.83887 12.1523H4.00098V13.1846C4.00098 14.6406 4.75977 15.3994 6.24316 15.3994H13.1611C14.6377 15.3994 15.4033 14.6406 15.4033 13.1846V6.21191C15.4033 4.75586 14.6377 3.99707 13.1611 3.99707H11.999V2.96484C11.999 1.50879 11.2334 0.75 9.75684 0.75H2.83887C1.3623 0.75 0.59668 1.50195 0.59668 2.96484V9.93066C0.59668 11.3936 1.3623 12.1523 2.83887 12.1523ZM2.9209 10.8125C2.28516 10.8125 1.93652 10.4844 1.93652 9.82129V3.08105C1.93652 2.41797 2.28516 2.08301 2.9209 2.08301H9.68164C10.3105 2.08301 10.666 2.41797 10.666 3.08105V3.99707H6.24316C4.75977 3.99707 4.00098 4.75586 4.00098 6.21191V10.8125H2.9209ZM6.31836 14.0596C5.68262 14.0596 5.34082 13.7314 5.34082 13.0684V6.32812C5.34082 5.66504 5.68262 5.33691 6.31836 5.33691H13.0791C13.708 5.33691 14.0635 5.66504 14.0635 6.32812V13.0684C14.0635 13.7314 13.708 14.0596 13.0791 14.0596H6.31836Z"})})},269634:(e,t,n)=>{n.d(t,{G:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("equation",{viewBox:"0 0 16 16",svg:(0,r.jsx)("g",{children:(0,r.jsx)("path",{d:"M3.31 14.128c-.373 0-.665-.107-.874-.321a1.956 1.956 0 01-.472-.82L.576 8.466a2.875 2.875 0 01-.061-.211 1.26 1.26 0 01-.02-.233c0-.205.07-.378.211-.52a.75.75 0 01.554-.218c.205 0 .369.055.492.164.123.11.216.276.28.5l1.23 4.326H3.4l2.83-9.27c.114-.368.278-.637.493-.806.214-.173.533-.26.957-.26h7.04c.238 0 .427.069.568.206a.706.706 0 01.219.54.736.736 0 01-.219.553c-.141.137-.33.205-.567.205H7.713l-2.98 9.482a2.294 2.294 0 01-.506.861c-.215.228-.52.342-.916.342zm5.715-1.299a.625.625 0 01-.45-.17.572.572 0 01-.179-.432.77.77 0 01.158-.457l1.763-2.414-1.668-2.29a.79.79 0 01-.191-.499c0-.173.064-.32.191-.444a.677.677 0 01.479-.185c.146 0 .267.03.362.09a.957.957 0 01.294.307l1.45 2.112h.04l1.395-2.105c.1-.15.198-.255.294-.315a.664.664 0 01.355-.089c.187 0 .342.06.465.178a.562.562 0 01.185.43c0 .16-.06.318-.178.473l-1.75 2.365 1.736 2.351a.77.77 0 01.171.472.589.589 0 01-.191.451.667.667 0 01-.472.171.642.642 0 01-.355-.089 1.357 1.357 0 01-.301-.328l-1.45-2.099h-.034l-1.462 2.1c-.11.154-.212.263-.308.327a.628.628 0 01-.349.09z"})})})},237240:(e,t,n)=>{n.d(t,{s:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("expand",{viewBox:"-1 -1 9 11",svg:(0,r.jsx)("path",{id:"path0_stroke",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"})})},561061:(e,t,n)=>{n.d(t,{B:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("eyeHide",{viewBox:"0 0 30 20",svg:(0,r.jsx)("path",{d:"M20.9297 18.416C21.2227 18.7188 21.6914 18.7383 21.9941 18.416C22.3066 18.0938 22.2871 17.6543 21.9941 17.3516L5.66602 1.0332C5.37305 0.740234 4.88477 0.740234 4.5918 1.0332C4.30859 1.31641 4.30859 1.81445 4.5918 2.09766L20.9297 18.416ZM21.8574 15.5938C24.709 13.709 26.5742 11.1211 26.5742 9.95898C26.5742 7.97656 21.1543 1.6582 13.3418 1.6582C11.6816 1.6582 10.1191 1.94141 8.70312 2.41016L11.2422 4.94922C11.8867 4.67578 12.5898 4.51953 13.3418 4.51953C16.3594 4.51953 18.8008 6.91211 18.8008 9.95898C18.8008 10.7012 18.6348 11.4141 18.3418 12.0391L21.8574 15.5938ZM13.3418 18.2598C15.1484 18.2598 16.8281 17.9277 18.3027 17.3809L15.7441 14.8223C15.0215 15.1934 14.2012 15.3984 13.3418 15.3984C10.2949 15.3984 7.88281 12.9277 7.87305 9.95898C7.87305 9.08008 8.07812 8.25 8.43945 7.51758L5.09961 4.1582C2.02344 6.08203 0.0996094 8.78711 0.0996094 9.95898C0.0996094 11.9316 5.61719 18.2598 13.3418 18.2598ZM16.4473 9.75391C16.4473 8.04492 15.0703 6.6582 13.3418 6.6582C13.2148 6.6582 13.0879 6.66797 12.9707 6.67773L16.4277 10.1348C16.4375 10.0176 16.4473 9.88086 16.4473 9.75391ZM10.2266 9.73438C10.2266 11.4531 11.6426 12.8398 13.3516 12.8398C13.4883 12.8398 13.6152 12.8301 13.752 12.8203L10.2461 9.31445C10.2363 9.45117 10.2266 9.59766 10.2266 9.73438Z"})})},269578:(e,t,n)=>{n.d(t,{f:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("github",{viewBox:"0 0 1024 1024",svg:(0,r.jsx)("path",{d:"M512 0C229.25 0 0 229.25 0 512c0 226.25 146.688 418.125 350.156 485.812 25.594 4.688 34.938-11.125 34.938-24.625 0-12.188-0.469-52.562-0.719-95.312C242 908.812 211.906 817.5 211.906 817.5c-23.312-59.125-56.844-74.875-56.844-74.875-46.531-31.75 3.53-31.125 3.53-31.125 51.406 3.562 78.47 52.75 78.47 52.75 45.688 78.25 119.875 55.625 149 42.5 4.654-33 17.904-55.625 32.5-68.375C304.906 725.438 185.344 681.5 185.344 485.312c0-55.938 19.969-101.562 52.656-137.406-5.219-13-22.844-65.094 5.062-135.562 0 0 42.938-13.75 140.812 52.5 40.812-11.406 84.594-17.031 128.125-17.219 43.5 0.188 87.312 5.875 128.188 17.281 97.688-66.312 140.688-52.5 140.688-52.5 28 70.531 10.375 122.562 5.125 135.5 32.812 35.844 52.625 81.469 52.625 137.406 0 196.688-119.75 240-233.812 252.688 18.438 15.875 34.75 47 34.75 94.75 0 68.438-0.688 123.625-0.688 140.5 0 13.625 9.312 29.562 35.25 24.562C877.438 930 1024 738.125 1024 512 1024 229.25 794.75 0 512 0z"})})},184869:(e,t,n)=>{n.d(t,{c:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("googleDrive",{viewBox:"0 0 512 512",svg:(0,r.jsxs)("g",{children:[" ",(0,r.jsx)("path",{d:"M175.5,44.9c2.6,0,4.5,0,6.5,0c50.5,0,101,0.1,151.5-0.2c5.5,0,8.5,2,11,6.4c10.7,19,21.5,38,32.3,56.9   c13.2,23.2,26.5,46.4,39.8,69.5c14.8,25.9,29.8,51.6,44.6,77.5c11.9,20.7,23.6,41.6,35.4,62.4c1.5,2.6,5,5.2,3.5,7.8  c-0.8,1.4-5.6,0.6-8.5,0.6c-28.8-0.3-57.6-0.4-86.4-1.2c-19.7-0.6-39.3-0.3-58.9-0.8c-5.6-0.1-11.3-0.6-16.9-0.7   c-2.3,0-3.1-1.2-4-2.9c-9.7-17.9-19.4-35.7-29.2-53.6c-10.4-19.1-20.8-38.2-31.3-57.4c-11.5-21.2-23-42.4-34.5-63.5   c-11.6-21.3-23.3-42.6-34.9-64C188.7,69.7,182.3,57.6,175.5,44.9z"})," ",(0,r.jsx)("path",{d:"M97.1,474c1.6-6.5,5.5-10.8,8.3-15.6c14.5-25.3,29.3-50.3,43.9-75.5c8.6-14.9,17.1-29.8,25.5-44.8   c1.4-2.5,3.1-3.2,5.6-3.2c27.6,0.4,55.3,0.3,82.9,1.3c16.7,0.6,33.3,0.4,49.9,0.8c20.1,0.4,40.3,0.2,60.4,1.2  c13.8,0.6,27.6,0.4,41.4,0.7c29.3,0.5,58.6,0.8,87.9,1.2c1.4,0,3.2-0.7,4,1.1c0.5,1.3-0.4,2.4-1.2,3.6   c-10.4,16.3-20.8,32.7-31.2,49.1c-10.6,16.7-21.1,33.5-31.6,50.2c-5.3,8.4-10.6,16.7-15.6,25.2c-2.3,3.9-4.9,6.2-9.8,5.7   c-5.4-0.6-11-0.7-16.4-0.7c-99.3-0.1-198.6-0.2-297.9-0.3C101.3,474,99.4,474,97.1,474z"})," ",(0,r.jsx)("path",{d:"M9.8,326.3c1.1-5.3,4.5-9.5,7.1-14c14.3-25.7,28.9-51.2,43.3-76.8c9.7-17.1,19.5-34.3,29.2-51.4   c12.9-22.8,25.7-45.7,38.6-68.5c10.7-18.9,21.6-37.8,32.4-56.7c4.7-8.2,5.1-8.4,9.3-0.6c8.3,15.6,16.7,31.1,24.8,46.8  c6.1,11.9,12.6,23.7,18.9,35.5c7.2,13.6,14.5,27.2,21.7,40.7c2.2,4.2,4.3,8.6,6.8,12.7c1.3,2.1,0.9,3.4-0.3,5.4   c-16.2,27.3-32.2,54.7-48.4,81.9c-14,23.6-28.3,47-42.3,70.6c-16.4,27.5-32.6,55.1-49,82.6c-6.6,11.2-13.3,22.4-20,33.6   c-0.6,1.1-0.8,2.8-2.5,2.7c-1.6-0.1-2-1.7-2.6-2.8c-3.7-7.6-7.3-15.2-10.9-22.8c-6.9-14.7-13.9-29.3-20.9-44   c-9-18.8-18-37.5-27-56.3c-2.3-4.8-4.5-9.6-6.8-14.3C10.6,329.2,9.7,328,9.8,326.3z"})," "]})})},584169:(e,t,n)=>{n.d(t,{m:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("help",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M8 15.126C11.8623 15.126 15.0615 11.9336 15.0615 8.06445C15.0615 4.20215 11.8623 1.00293 7.99316 1.00293C4.13086 1.00293 0.938477 4.20215 0.938477 8.06445C0.938477 11.9336 4.1377 15.126 8 15.126ZM8 13.7383C4.85547 13.7383 2.33301 11.209 2.33301 8.06445C2.33301 4.91992 4.84863 2.39746 7.99316 2.39746C11.1377 2.39746 13.667 4.91992 13.6738 8.06445C13.6738 11.209 11.1445 13.7383 8 13.7383ZM7.84277 9.4248C8.21875 9.4248 8.45801 9.21289 8.47852 8.93262C8.47852 8.90527 8.47852 8.87109 8.47852 8.85059C8.49902 8.49512 8.74512 8.25586 9.18945 7.96875C9.85938 7.52441 10.2969 7.13477 10.2969 6.3418C10.2969 5.2002 9.27148 4.55078 8.06152 4.55078C6.89258 4.55078 6.09277 5.08398 5.88086 5.72656C5.83984 5.84277 5.81934 5.95898 5.81934 6.08203C5.81934 6.41016 6.0791 6.61523 6.35254 6.61523C6.60547 6.61523 6.76953 6.5127 6.90625 6.32812L7.01562 6.19141C7.24121 5.81543 7.56934 5.61719 7.97949 5.61719C8.5332 5.61719 8.90918 5.94531 8.90918 6.41016C8.90918 6.84082 8.62207 7.05273 8.04102 7.45605C7.55566 7.79102 7.2002 8.14648 7.2002 8.76855V8.84375C7.2002 9.22656 7.43262 9.4248 7.84277 9.4248ZM7.83594 11.5234C8.27344 11.5234 8.63574 11.2021 8.63574 10.7715C8.63574 10.3408 8.27344 10.0264 7.83594 10.0264C7.3916 10.0264 7.03613 10.3477 7.03613 10.7715C7.03613 11.2021 7.39844 11.5234 7.83594 11.5234Z"})})},727714:(e,t,n)=>{n.d(t,{N:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("link",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M7.69922 10.8945L8.73828 9.84863C7.91797 9.77344 7.34375 9.51367 6.91992 9.08984C5.76465 7.93457 5.76465 6.29395 6.91309 5.14551L9.18262 2.87598C10.3379 1.7207 11.9717 1.7207 13.127 2.87598C14.2891 4.04492 14.2822 5.67188 13.1338 6.82031L11.958 7.99609C12.1768 8.49512 12.2451 9.10352 12.1289 9.62988L14.0908 7.6748C15.7725 6 15.7793 3.62109 14.084 1.92578C12.3887 0.223633 10.0098 0.237305 8.33496 1.91211L5.95605 4.29785C4.28125 5.97266 4.26758 8.35156 5.96289 10.0469C6.36621 10.4434 6.90625 10.7441 7.69922 10.8945ZM8.30078 5.13184L7.26855 6.17773C8.08203 6.25293 8.66309 6.51953 9.08008 6.93652C10.2422 8.09863 10.2422 9.73242 9.08691 10.8809L6.81738 13.1504C5.66211 14.3057 4.03516 14.3057 2.87305 13.1504C1.71094 11.9883 1.71777 10.3545 2.87305 9.20605L4.04199 8.03027C3.83008 7.53125 3.75488 6.92969 3.87109 6.39648L1.91602 8.35156C0.234375 10.0264 0.227539 12.4121 1.92285 14.1074C3.61816 15.8027 5.99707 15.7891 7.67188 14.1143L10.0439 11.7354C11.7256 10.0537 11.7324 7.6748 10.0371 5.98633C9.64062 5.58301 9.10059 5.28223 8.30078 5.13184Z"})})},763860:(e,t,n)=>{n.d(t,{U:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("list",{viewBox:"0 0 64 64",svg:(0,r.jsx)("path",{d:"m56,13v6H22v-6h34Zm-34,22h34v-6H22v6Zm0,16h34v-6H22v6ZM12,12c-2.21,0-4,1.79-4,4s1.79,4,4,4,4-1.79,4-4-1.79-4-4-4Zm0,16c-2.21,0-4,1.79-4,4s1.79,4,4,4,4-1.79,4-4-1.79-4-4-4Zm0,16c-2.21,0-4,1.79-4,4s1.79,4,4,4,4-1.79,4-4-1.79-4-4-4Z"})})},920669:(e,t,n)=>{n.d(t,{y:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("magicWand",{viewBox:"0 0 36 32",svg:(0,r.jsx)("path",{d:"M13.984 7.484c.188 0 .282-.109.313-.28.531-2.5.5-2.595 3.125-3.126.172-.031.297-.14.297-.312 0-.188-.125-.297-.297-.329-2.625-.53-2.594-.624-3.125-3.109-.031-.172-.125-.297-.313-.297-.187 0-.28.125-.312.297-.531 2.485-.5 2.578-3.125 3.11-.172.03-.297.14-.297.328 0 .171.125.28.297.312 2.625.531 2.594.625 3.125 3.125.031.172.125.281.312.281zM26.891 13c.218 0 .343-.14.39-.344.532-2.969.547-3.156 3.688-3.703.218-.031.36-.172.36-.39 0-.22-.142-.344-.36-.391-3.14-.531-3.157-.719-3.688-3.688-.047-.203-.172-.359-.39-.359-.22 0-.344.156-.391.36-.531 2.968-.547 3.156-3.688 3.687-.203.047-.359.172-.359.39 0 .22.156.36.36.391 3.14.547 3.156.735 3.687 3.703.047.203.172.344.39.344zM5.42 17.484c.22 0 .345-.156.391-.359.532-2.969.547-3.156 3.688-3.688.203-.046.36-.171.36-.39s-.157-.36-.36-.39c-3.14-.548-3.156-.735-3.688-3.704-.046-.203-.171-.344-.39-.344s-.344.141-.39.344c-.532 2.969-.548 3.156-3.688 3.703-.203.031-.36.172-.36.39 0 .22.157.345.36.392 3.14.53 3.156.718 3.687 3.687.047.203.172.36.39.36zm26.688 13.36c.657.672 1.782.672 2.407 0 .64-.688.64-1.75 0-2.407l-14.86-14.906c-.656-.656-1.781-.656-2.406 0a1.75 1.75 0 000 2.422l14.86 14.89zm-9.093-10.735l-4.578-4.593c-.282-.282-.375-.594-.094-.86.234-.25.562-.187.86.11l4.593 4.593-.781.75zM12.844 31.094c.281 0 .484-.203.531-.5.5-4.172.703-4.282 4.953-4.969.328-.063.531-.219.531-.531 0-.297-.203-.485-.468-.532-4.282-.812-4.516-.796-5.016-4.968-.047-.297-.25-.5-.531-.5-.297 0-.5.203-.531.484-.547 4.235-.688 4.375-5.016 4.985a.516.516 0 00-.469.53c0 .298.203.47.469.532 4.328.828 4.453.828 5.016 5a.516.516 0 00.53.469z"})})},959699:(e,t,n)=>{n.d(t,{N:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("meetingsDB",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M3.297 13.956h9.406c.743 0 1.301-.19 1.675-.567.378-.374.567-.925.567-1.655V3.415c0-.734-.189-1.287-.567-1.661-.374-.374-.932-.56-1.675-.56H3.297c-.738 0-1.297.186-1.675.56-.378.374-.567.927-.567 1.661v8.32c0 .729.189 1.28.567 1.654.378.378.937.567 1.675.567zm-.014-1.347c-.287 0-.506-.072-.656-.218-.15-.15-.226-.374-.226-.67V5.404c0-.296.076-.52.226-.67.15-.15.37-.225.656-.225h9.427c.287 0 .506.075.656.225.155.15.233.374.233.67v6.317c0 .296-.078.52-.233.67-.15.146-.369.218-.656.218H3.283zM4.46 6.977h7.096a.426.426 0 00.314-.123.449.449 0 00.123-.322.409.409 0 00-.123-.3.426.426 0 00-.314-.124H4.459a.45.45 0 00-.321.123.41.41 0 00-.123.301.45.45 0 00.123.322.45.45 0 00.321.123zm0 2.016h7.096a.426.426 0 00.314-.123.409.409 0 00.123-.3.417.417 0 00-.123-.308.414.414 0 00-.314-.13H4.459a.436.436 0 00-.321.13.417.417 0 00-.123.307.41.41 0 00.123.301.45.45 0 00.321.123zm0 2.024h4.478a.426.426 0 00.314-.123.41.41 0 00.123-.301.417.417 0 00-.123-.308.414.414 0 00-.314-.13H4.459a.436.436 0 00-.321.13.417.417 0 00-.123.308.41.41 0 00.123.3.45.45 0 00.321.124z"})})},526789:(e,t,n)=>{n.d(t,{q:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("microphone",{viewBox:"0 0 17 25",svg:(0,r.jsx)("path",{d:"M0.20752 12.0743C0.20752 13.5496 0.511882 14.853 1.12061 15.9845C1.72933 17.116 2.57438 18.0219 3.65576 18.7023C4.73714 19.3826 5.98324 19.7908 7.39404 19.9269V22.129H3.45166C3.17236 22.129 2.93245 22.2257 2.73193 22.4191C2.53141 22.6196 2.43115 22.8595 2.43115 23.1388C2.43115 23.4109 2.53141 23.6437 2.73193 23.837C2.93245 24.0376 3.17236 24.1378 3.45166 24.1378H13.313C13.5923 24.1378 13.8322 24.0376 14.0327 23.837C14.2332 23.6437 14.3335 23.4109 14.3335 23.1388C14.3335 22.8595 14.2332 22.6196 14.0327 22.4191C13.8322 22.2257 13.5923 22.129 13.313 22.129H9.37061V19.9269C10.7814 19.7908 12.0239 19.3826 13.0981 18.7023C14.1795 18.0219 15.0246 17.116 15.6333 15.9845C16.242 14.853 16.5464 13.5496 16.5464 12.0743V9.94739C16.5464 9.66809 16.4461 9.43176 16.2456 9.2384C16.0522 9.04504 15.8159 8.94836 15.5366 8.94836C15.2573 8.94836 15.0174 9.04504 14.8169 9.2384C14.6164 9.43176 14.5161 9.66809 14.5161 9.94739V11.9991C14.5161 13.2166 14.2583 14.2837 13.7427 15.2003C13.2271 16.1098 12.5109 16.8152 11.5942 17.3165C10.6776 17.8178 9.60693 18.0685 8.38232 18.0685C7.16488 18.0685 6.09424 17.8178 5.17041 17.3165C4.24658 16.8152 3.52686 16.1098 3.01123 15.2003C2.50277 14.2837 2.24854 13.2166 2.24854 11.9991V9.94739C2.24854 9.66809 2.14827 9.43176 1.94775 9.2384C1.74723 9.04504 1.50374 8.94836 1.21729 8.94836C0.94515 8.94836 0.708822 9.04504 0.508301 9.2384C0.30778 9.43176 0.20752 9.66809 0.20752 9.94739V12.0743ZM8.38232 15.8448C9.10563 15.8448 9.75016 15.6766 10.3159 15.34C10.8888 14.9962 11.3364 14.5236 11.6587 13.922C11.9881 13.3204 12.1528 12.6222 12.1528 11.8273V4.59778C12.1528 3.80286 11.9881 3.10461 11.6587 2.50305C11.3364 1.90149 10.8888 1.43241 10.3159 1.09583C9.75016 0.752075 9.10563 0.5802 8.38232 0.5802C7.65902 0.5802 7.0109 0.752075 6.43799 1.09583C5.87223 1.43241 5.42464 1.90149 5.09521 2.50305C4.76579 3.10461 4.60107 3.80286 4.60107 4.59778V11.8273C4.60107 12.6222 4.76579 13.3204 5.09521 13.922C5.42464 14.5236 5.87223 14.9962 6.43799 15.34C7.0109 15.6766 7.65902 15.8448 8.38232 15.8448Z"})})},460651:(e,t,n)=>{n.d(t,{h:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("notionLogo",{viewBox:"0 0 120 126",svg:(0,r.jsx)("path",{d:"M 20.6927 21.9315C 24.5836 25.0924 26.0432 24.8512 33.3492 24.3638L 102.228 20.2279C 103.689 20.2279 102.474 18.7705 101.987 18.5283L 90.5477 10.2586C 88.3558 8.55699 85.4356 6.60818 79.8387 7.09563L 13.1433 11.9602C 10.711 12.2014 10.2251 13.4175 11.1939 14.3924L 20.6927 21.9315ZM 24.8281 37.9835L 24.8281 110.456C 24.8281 114.351 26.7745 115.808 31.1553 115.567L 106.853 111.187C 111.236 110.946 111.724 108.267 111.724 105.103L 111.724 33.1169C 111.724 29.958 110.509 28.2544 107.826 28.4976L 28.721 33.1169C 25.8018 33.3622 24.8281 34.8225 24.8281 37.9835ZM 99.5567 41.8711C 100.042 44.0622 99.5567 46.2512 97.3618 46.4974L 93.7143 47.2241L 93.7143 100.728C 90.5477 102.43 87.6275 103.403 85.1942 103.403C 81.2983 103.403 80.3226 102.186 77.4044 98.54L 53.5471 61.087L 53.5471 97.3239L 61.0964 99.0275C 61.0964 99.0275 61.0964 103.403 55.0057 103.403L 38.2148 104.377C 37.727 103.403 38.2148 100.973 39.9179 100.486L 44.2996 99.2717L 44.2996 51.36L 38.2158 50.8725C 37.728 48.6815 38.9431 45.5225 42.3532 45.2773L 60.3661 44.0631L 85.1942 82.0036L 85.1942 48.4402L 78.864 47.7136C 78.3781 45.0351 80.3226 43.0902 82.7569 42.849L 99.5567 41.8711ZM 7.5434 5.39404L 76.9175 0.285276C 85.4366 -0.445402 87.6285 0.0440428 92.983 3.93368L 115.128 19.4982C 118.782 22.1747 120 22.9034 120 25.8211L 120 111.187C 120 116.537 118.051 119.701 111.237 120.185L 30.6734 125.05C 25.5584 125.294 23.124 124.565 20.4453 121.158L 4.13735 99.9994C 1.21516 96.1048 0 93.191 0 89.7819L 0 13.903C 0 9.5279 1.94945 5.8785 7.5434 5.39404Z"})})},954851:(e,t,n)=>{n.d(t,{S:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("page",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M4.35645 15.4678H11.6367C13.0996 15.4678 13.8584 14.6953 13.8584 13.2256V7.02539C13.8584 6.0752 13.7354 5.6377 13.1406 5.03613L9.55176 1.38574C8.97754 0.804688 8.50586 0.667969 7.65137 0.667969H4.35645C2.89355 0.667969 2.13477 1.44043 2.13477 2.91016V13.2256C2.13477 14.7021 2.89355 15.4678 4.35645 15.4678ZM4.46582 14.1279C3.80273 14.1279 3.47461 13.7793 3.47461 13.1436V2.99219C3.47461 2.36328 3.80273 2.00781 4.46582 2.00781H7.37793V5.75391C7.37793 6.73145 7.86328 7.20312 8.83398 7.20312H12.5186V13.1436C12.5186 13.7793 12.1836 14.1279 11.5205 14.1279H4.46582ZM8.95703 6.02734C8.67676 6.02734 8.56055 5.9043 8.56055 5.62402V2.19238L12.334 6.02734H8.95703ZM10.4336 9.00098H5.42969C5.16992 9.00098 4.98535 9.19238 4.98535 9.43164C4.98535 9.67773 5.16992 9.86914 5.42969 9.86914H10.4336C10.6797 9.86914 10.8643 9.67773 10.8643 9.43164C10.8643 9.19238 10.6797 9.00098 10.4336 9.00098ZM10.4336 11.2979H5.42969C5.16992 11.2979 4.98535 11.4893 4.98535 11.7354C4.98535 11.9746 5.16992 12.1592 5.42969 12.1592H10.4336C10.6797 12.1592 10.8643 11.9746 10.8643 11.7354C10.8643 11.4893 10.6797 11.2979 10.4336 11.2979Z"})})},554855:(e,t,n)=>{n.d(t,{a:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("pageEmpty",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M4.35645 15.4678H11.6367C13.0996 15.4678 13.8584 14.6953 13.8584 13.2256V7.02539C13.8584 6.0752 13.7354 5.6377 13.1406 5.03613L9.55176 1.38574C8.97754 0.804688 8.50586 0.667969 7.65137 0.667969H4.35645C2.89355 0.667969 2.13477 1.44043 2.13477 2.91016V13.2256C2.13477 14.7021 2.89355 15.4678 4.35645 15.4678ZM4.46582 14.1279C3.80273 14.1279 3.47461 13.7793 3.47461 13.1436V2.99219C3.47461 2.36328 3.80273 2.00781 4.46582 2.00781H7.37793V5.75391C7.37793 6.73145 7.86328 7.20312 8.83398 7.20312H12.5186V13.1436C12.5186 13.7793 12.1836 14.1279 11.5205 14.1279H4.46582ZM8.95703 6.02734C8.67676 6.02734 8.56055 5.9043 8.56055 5.62402V2.19238L12.334 6.02734H8.95703Z"})})},439567:(e,t,n)=>{n.d(t,{Y:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("pageLinkIndicator",{viewBox:"0 0 13 13",svg:(0,r.jsx)("path",{d:"M6.30826 4.43292L1.76184 8.98454C1.76176 8.98462 1.76169 8.9847 1.76161 8.98477C1.76158 8.9848 1.76156 8.98482 1.76154 8.98484C1.46068 9.28584 1.25 9.6914 1.25 10.1565C1.25 10.6117 1.45865 11.0119 1.73417 11.2886C2.01014 11.5658 2.41107 11.7773 2.87078 11.7773C3.34169 11.7773 3.73758 11.5617 4.03477 11.2733L4.03482 11.2734L4.04244 11.2657L8.58864 6.72474V8.667C8.58864 9.51956 9.22729 10.2935 10.1521 10.2935C11.0528 10.2935 11.75 9.54534 11.75 8.66127V2.92671C11.75 2.48722 11.5981 2.06381 11.2838 1.74808C10.9689 1.43182 10.5446 1.27728 10.1006 1.27728H4.36028C3.46161 1.27728 2.72804 1.97749 2.72804 2.86942C2.72804 3.79734 3.51104 4.43292 4.35455 4.43292H6.30826Z",fill:"#3E3C38",stroke:"white",strokeWidth:"1.5"})})},725651:(e,t,n)=>{n.d(t,{R:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("pencil",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M3.926 13.307H14.11c.183 0 .34-.066.472-.199a.644.644 0 00.198-.471.652.652 0 00-.198-.479.644.644 0 00-.472-.198H5.272l-1.346 1.347zm-.704-.636l7.683-7.684-1.312-1.319-7.69 7.684-.67 1.606c-.037.1-.017.191.06.273.083.082.174.105.274.069l1.655-.63zm8.34-8.326l.738-.732c.182-.187.278-.376.287-.567.009-.192-.068-.374-.232-.547l-.267-.267c-.169-.168-.351-.246-.547-.232-.196.014-.385.11-.567.287l-.739.732 1.327 1.326z"})})},526056:(e,t,n)=>{n.d(t,{f:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("pilcrow",{viewBox:"0 0 12 14",svg:(0,r.jsx)("path",{d:"M0 3.97949C0 3.28223 0.152669 2.67383 0.458008 2.1543C0.767904 1.63021 1.20085 1.22461 1.75684 0.9375C2.31738 0.645833 2.96908 0.5 3.71191 0.5H10.2539C10.4954 0.5 10.6868 0.568359 10.8281 0.705078C10.974 0.841797 11.0469 1.02865 11.0469 1.26562C11.0469 1.5026 10.974 1.69173 10.8281 1.83301C10.6868 1.97428 10.4954 2.04492 10.2539 2.04492H9.20117V12.7842C9.20117 13.0303 9.13053 13.224 8.98926 13.3652C8.84798 13.5065 8.65885 13.5771 8.42188 13.5771C8.1849 13.5771 7.99805 13.5065 7.86133 13.3652C7.72461 13.224 7.65625 13.0303 7.65625 12.7842V2.04492H6.25488V12.7842C6.25488 13.0303 6.18424 13.224 6.04297 13.3652C5.90625 13.5065 5.7194 13.5771 5.48242 13.5771C5.24089 13.5771 5.05176 13.5065 4.91504 13.3652C4.77832 13.224 4.70996 13.0303 4.70996 12.7842V7.47266H3.78711C3.02604 7.47266 2.36068 7.32682 1.79102 7.03516C1.22591 6.74349 0.786133 6.33789 0.47168 5.81836C0.157227 5.29427 0 4.68132 0 3.97949Z"})})},747453:(e,t,n)=>{n.d(t,{R:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("plus",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 00-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 00-.739.722v5.529h-5.37a.746.746 0 00-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})})},329665:(e,t,n)=>{n.d(t,{B:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("projectManagementBig",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{fillRule:"evenodd",d:"M0 5.302c0 2.793 2.209 5.112 4.96 5.291V9.426a4.124 4.124 0 01-3.79-4.124 4.12 4.12 0 014.127-4.138 4.13 4.13 0 014.071 3.37h1.18C10.168 1.988 7.943 0 5.296 0 2.394 0 0 2.4 0 5.302zm5.302-3.197c1.489 0 2.75 1.043 3.098 2.429h-.1c-.322 0-.633.045-.927.13-.281-.876-1.117-1.533-2.071-1.533-1.18 0-2.17.992-2.17 2.171 0 1.068.823 1.988 1.855 2.147-.018.139-.027.28-.027.425v.607C3.377 8.305 2.11 6.93 2.11 5.302c0-1.744 1.443-3.197 3.192-3.197zm.005 1.967c.586 0 1.086.426 1.204.98A3.353 3.353 0 005.24 6.536a1.244 1.244 0 01-1.167-1.233c0-.676.554-1.23 1.235-1.23zm9.026 11.503H8.177c-1.098 0-1.668-.564-1.668-1.652V7.736c0-1.087.57-1.652 1.668-1.652h6.156C15.43 6.084 16 6.65 16 7.736v6.187c0 1.083-.57 1.652-1.667 1.652zm-6.827-1.738c0 .493.259.742.732.742h6.034c.467 0 .732-.25.732-.742v-6.02c0-.492-.265-.736-.732-.736H8.238c-.473 0-.732.244-.732.737v6.019zm3.655-.854a.526.526 0 01-.448.254c-.188 0-.335-.076-.473-.254l-1.2-1.465a.532.532 0 01-.131-.34c0-.254.193-.453.442-.453.152 0 .274.056.396.214l.946 1.205L12.7 8.92c.107-.173.244-.254.396-.254.24 0 .463.167.463.417 0 .116-.061.238-.127.345l-2.272 3.554z",clipRule:"evenodd"})})},286793:(e,t,n)=>{n.d(t,{D:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("projectsDB",{viewBox:"0 0 33 33",svg:(0,r.jsx)("path",{d:"M16.5 32.6562C25.2188 32.6562 32.4375 25.4219 32.4375 16.7188C32.4375 8 25.2031 0.78125 16.4844 0.78125C7.78125 0.78125 0.5625 8 0.5625 16.7188C0.5625 25.4219 7.79688 32.6562 16.5 32.6562ZM16.5 30C9.125 30 3.23438 24.0938 3.23438 16.7188C3.23438 9.34375 9.10938 3.4375 16.4844 3.4375C23.8594 3.4375 29.7656 9.34375 29.7812 16.7188C29.7969 24.0938 23.875 30 16.5 30ZM16.5 26.625C21.9219 26.625 26.4062 22.125 26.4062 16.7188C26.4062 11.2969 21.9062 6.79688 16.5 6.79688C11.0781 6.79688 6.59375 11.2969 6.59375 16.7188C6.59375 22.125 11.0938 26.625 16.5 26.625ZM16.5 24.1094C12.4844 24.1094 9.10938 20.7344 9.10938 16.7188C9.10938 12.6719 12.4688 9.3125 16.5 9.3125C20.5156 9.3125 23.8906 12.6875 23.8906 16.7188C23.8906 20.75 20.5312 24.1094 16.5 24.1094ZM16.5156 20.7656C18.7344 20.7656 20.5625 18.9531 20.5625 16.7031C20.5625 14.4844 18.7344 12.6719 16.5156 12.6719C14.2812 12.6719 12.4531 14.4844 12.4531 16.7031C12.4531 18.9531 14.2812 20.7656 16.5156 20.7656Z"})})},170782:(e,t,n)=>{n.d(t,{L:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("questionMark",{viewBox:"0 0 20 20",svg:(0,r.jsx)("path",{d:"M9.645 12.826c.26 0 .457-.073.594-.219a.935.935 0 00.233-.574v-.212a2 2 0 01.15-.71c.091-.197.24-.386.444-.568.21-.187.5-.401.869-.643.601-.396 1.07-.831 1.408-1.305.342-.479.512-1.046.512-1.702 0-.693-.173-1.283-.52-1.77a3.258 3.258 0 00-1.394-1.129c-.588-.264-1.246-.396-1.975-.396-.547 0-1.057.08-1.531.239-.47.16-.885.39-1.245.69-.355.301-.63.661-.827 1.08a2.38 2.38 0 00-.17.486 2.205 2.205 0 00-.048.444c0 .237.068.43.205.581.14.146.337.219.588.219a.847.847 0 00.519-.157.905.905 0 00.314-.445c.114-.387.272-.7.472-.936.205-.237.447-.408.725-.513.282-.11.59-.164.923-.164.41 0 .777.073 1.1.219.324.141.581.346.773.615.196.269.294.583.294.943 0 .31-.06.581-.178.814a2.17 2.17 0 01-.513.642c-.223.196-.49.402-.8.616a6.68 6.68 0 00-.922.738 2.965 2.965 0 00-.63.84c-.15.306-.225.65-.225 1.033v.369c0 .26.073.472.219.636.15.16.362.24.636.24zm.013 3.808c.205 0 .392-.05.56-.15.174-.1.31-.235.41-.404a.998.998 0 00.158-.554c0-.2-.052-.385-.157-.553a1.071 1.071 0 00-.41-.397 1.08 1.08 0 00-.56-.15c-.21 0-.4.05-.568.15a1.085 1.085 0 00-.554.95c0 .205.05.39.15.554.1.169.235.303.404.403.168.1.358.15.567.15z"})})},324600:(e,t,n)=>{n.d(t,{P:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("slackLogo",{viewBox:"0 0 16 16",svg:(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M1.68078 11.7915C2.60586 11.7915 3.36156 11.0358 3.36156 10.1107V8.42993H1.68078C0.755701 8.42993 0 9.18563 0 10.1107C0 11.0358 0.755701 11.7915 1.68078 11.7915Z",fill:"#E01E5A"}),(0,r.jsx)("path",{d:"M5.88928 8.42993C4.9642 8.42993 4.2085 9.18563 4.2085 10.1107V14.3192C4.2085 15.2443 4.9642 16 5.88928 16C6.81436 16 7.57006 15.2443 7.57006 14.3192V10.1107C7.57006 9.18563 6.81436 8.42993 5.88928 8.42993Z",fill:"#E01E5A"}),(0,r.jsx)("path",{d:"M4.2085 1.68078C4.2085 2.60586 4.9642 3.36156 5.88928 3.36156H7.57006V1.68078C7.57006 0.755701 6.81436 0 5.88928 0C4.9642 0 4.2085 0.755701 4.2085 1.68078Z",fill:"#36C5F0"}),(0,r.jsx)("path",{d:"M7.57003 5.88928C7.57003 4.9642 6.81433 4.2085 5.88925 4.2085H1.68078C0.755701 4.2085 0 4.9642 0 5.88928C0 6.81436 0.755701 7.57006 1.68078 7.57006H5.88925C6.81433 7.57006 7.57003 6.81436 7.57003 5.88928Z",fill:"#36C5F0"}),(0,r.jsx)("path",{d:"M10.1107 7.57003C11.0358 7.57003 11.7915 6.81433 11.7915 5.88925V1.68078C11.7915 0.755701 11.0358 0 10.1107 0C9.18563 0 8.42993 0.755701 8.42993 1.68078V5.88925C8.42993 6.81433 9.18563 7.57003 10.1107 7.57003Z",fill:"#2EB67D"}),(0,r.jsx)("path",{d:"M14.3192 4.2085C13.3941 4.2085 12.6384 4.9642 12.6384 5.88928V7.57006H14.3192C15.2443 7.57006 16 6.81436 16 5.88928C16 4.9642 15.2443 4.2085 14.3192 4.2085Z",fill:"#2EB67D"}),(0,r.jsx)("path",{d:"M8.42993 10.1107C8.42993 11.0358 9.18563 11.7915 10.1107 11.7915H14.3192C15.2443 11.7915 16 11.0358 16 10.1107C16 9.18563 15.2443 8.42993 14.3192 8.42993H10.1107C9.18563 8.42993 8.42993 9.18563 8.42993 10.1107Z",fill:"#ECB22E"}),(0,r.jsx)("path",{d:"M11.7915 14.3192C11.7915 13.3941 11.0358 12.6384 10.1107 12.6384H8.42993V14.3192C8.42993 15.2443 9.18563 16 10.1107 16C11.0358 16 11.7915 15.2443 11.7915 14.3192Z",fill:"#ECB22E"})]})})},265317:(e,t,n)=>{n.d(t,{Q:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("slackLogoUnfilled",{viewBox:"0 0 16 16",svg:(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M1.68078 11.7915C2.60586 11.7915 3.36156 11.0358 3.36156 10.1107V8.42993H1.68078C0.755701 8.42993 0 9.18563 0 10.1107C0 11.0358 0.755701 11.7915 1.68078 11.7915Z"}),(0,r.jsx)("path",{d:"M5.88928 8.42993C4.9642 8.42993 4.2085 9.18563 4.2085 10.1107V14.3192C4.2085 15.2443 4.9642 16 5.88928 16C6.81436 16 7.57006 15.2443 7.57006 14.3192V10.1107C7.57006 9.18563 6.81436 8.42993 5.88928 8.42993Z"}),(0,r.jsx)("path",{d:"M4.2085 1.68078C4.2085 2.60586 4.9642 3.36156 5.88928 3.36156H7.57006V1.68078C7.57006 0.755701 6.81436 0 5.88928 0C4.9642 0 4.2085 0.755701 4.2085 1.68078Z"}),(0,r.jsx)("path",{d:"M7.57003 5.88928C7.57003 4.9642 6.81433 4.2085 5.88925 4.2085H1.68078C0.755701 4.2085 0 4.9642 0 5.88928C0 6.81436 0.755701 7.57006 1.68078 7.57006H5.88925C6.81433 7.57006 7.57003 6.81436 7.57003 5.88928Z"}),(0,r.jsx)("path",{d:"M10.1107 7.57003C11.0358 7.57003 11.7915 6.81433 11.7915 5.88925V1.68078C11.7915 0.755701 11.0358 0 10.1107 0C9.18563 0 8.42993 0.755701 8.42993 1.68078V5.88925C8.42993 6.81433 9.18563 7.57003 10.1107 7.57003Z"}),(0,r.jsx)("path",{d:"M14.3192 4.2085C13.3941 4.2085 12.6384 4.9642 12.6384 5.88928V7.57006H14.3192C15.2443 7.57006 16 6.81436 16 5.88928C16 4.9642 15.2443 4.2085 14.3192 4.2085Z"}),(0,r.jsx)("path",{d:"M8.42993 10.1107C8.42993 11.0358 9.18563 11.7915 10.1107 11.7915H14.3192C15.2443 11.7915 16 11.0358 16 10.1107C16 9.18563 15.2443 8.42993 14.3192 8.42993H10.1107C9.18563 8.42993 8.42993 9.18563 8.42993 10.1107Z"}),(0,r.jsx)("path",{d:"M11.7915 14.3192C11.7915 13.3941 11.0358 12.6384 10.1107 12.6384H8.42993V14.3192C8.42993 15.2443 9.18563 16 10.1107 16C11.0358 16 11.7915 15.2443 11.7915 14.3192Z"})]})})},11751:(e,t,n)=>{n.d(t,{t:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("sparkles",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.2757 4.82358C7.57934 4.71847 7.57934 4.53161 7.2757 4.41483L5.62905 3.78419C5.33709 3.67908 4.99842 3.3404 4.88164 3.03676L4.25101 1.39009C4.1459 1.08644 3.95905 1.08644 3.84226 1.39009L3.21163 3.03676C3.10653 3.32872 2.76786 3.6674 2.46422 3.78419L0.817572 4.41483C0.513934 4.51994 0.513934 4.70679 0.817572 4.82358L2.46422 5.45422C2.75618 5.55933 3.09485 5.898 3.21163 6.20165L3.84226 7.84832C3.94737 8.15196 4.13422 8.15196 4.25101 7.84832L4.88164 6.20165C4.98674 5.90968 5.32541 5.571 5.62905 5.45422L7.2757 4.82358ZM15.2991 10.5929C16.2334 10.3593 16.2334 9.9739 15.2991 9.74032L13.2321 9.22647C12.2978 8.9929 11.3402 8.03526 11.1066 7.10097L10.5928 5.03387C10.3592 4.09959 9.97382 4.09959 9.74025 5.03387L9.2264 7.10097C8.99283 8.03526 8.03521 8.9929 7.10094 9.22647L5.03387 9.74032C4.09961 9.9739 4.09961 10.3593 5.03387 10.5929L7.10094 11.1067C8.03521 11.3403 8.99283 12.2979 9.2264 13.2322L9.74025 15.2993C9.97382 16.2336 10.3592 16.2336 10.5928 15.2993L11.1066 13.2322C11.3402 12.2979 12.2978 11.3403 13.2321 11.1067L15.2991 10.5929Z"})})},733507:(e,t,n)=>{n.d(t,{L:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("sprintsDB",{viewBox:"0 0 18 18",svg:(0,r.jsx)("path",{d:"M9.844 3.375c0-.87.537-1.406 1.406-1.406.87 0 1.406.537 1.406 1.406 0 .87-.537 1.406-1.406 1.406-.87 0-1.406-.537-1.406-1.406Zm1.83 4.708c.555.658 1.247 1.48 2.951 1.48V8.155c-1.052 0-1.378-.388-1.876-.979-.582-.691-1.308-1.552-3.187-1.552-2.714 0-4.269 1.443-5.343 3.589l1.257.63c.779-1.558 1.606-2.346 2.74-2.652L6.822 9.976c-.531 1.066-1.325 1.555-2.514 1.555H3.094v1.688h1.215c1.884 0 3.147-.77 3.996-2.436.743.563 2.965 2.427 3.592 4.967l1.6-.534c-.621-2.52-2.402-4.346-3.552-5.302l1.198-2.393c.186.16.349.351.529.565l.003-.003Z"})})},959960:(e,t,n)=>{n.d(t,{w:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("tasksDB",{viewBox:"0 0 14 14 ",svg:(0,r.jsx)("path",{d:"M2.72949 13.4561H11.0078C12.4844 13.4561 13.25 12.6904 13.25 11.2344V2.91504C13.25 1.45215 12.4844 0.693359 11.0078 0.693359H2.72949C1.25293 0.693359 0.487305 1.45215 0.487305 2.91504V11.2344C0.487305 12.6973 1.25293 13.4561 2.72949 13.4561ZM2.81152 12.1162C2.17578 12.1162 1.82715 11.7812 1.82715 11.1182V3.02441C1.82715 2.36133 2.17578 2.0332 2.81152 2.0332H10.9258C11.5547 2.0332 11.9102 2.36133 11.9102 3.02441V11.1182C11.9102 11.7812 11.5547 12.1162 10.9258 12.1162H2.81152ZM6.14062 10.3115C6.38672 10.3115 6.59863 10.1885 6.74219 9.96973L9.79785 5.19141C9.88672 5.04785 9.96875 4.88379 9.96875 4.72656C9.96875 4.3916 9.66797 4.16602 9.34668 4.16602C9.1416 4.16602 8.95703 4.27539 8.81348 4.50781L6.11328 8.8418L4.8418 7.22168C4.67773 7.00977 4.51367 6.93457 4.30859 6.93457C3.97363 6.93457 3.71387 7.20117 3.71387 7.54297C3.71387 7.70703 3.77539 7.85742 3.8916 8.00098L5.50488 9.96973C5.68945 10.209 5.8877 10.3115 6.14062 10.3115Z"})})},937612:(e,t,n)=>{n.d(t,{y:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("trash",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M4.8623 15.4287H11.1445C12.1904 15.4287 12.8672 14.793 12.915 13.7402L13.3799 3.88965H14.1318C14.4736 3.88965 14.7402 3.62988 14.7402 3.28809C14.7402 2.95312 14.4736 2.69336 14.1318 2.69336H11.0898V1.66797C11.0898 0.62207 10.4268 0 9.29199 0H6.69434C5.56641 0 4.89648 0.62207 4.89648 1.66797V2.69336H1.86133C1.5332 2.69336 1.25977 2.95312 1.25977 3.28809C1.25977 3.62988 1.5332 3.88965 1.86133 3.88965H2.62012L3.08496 13.7471C3.13281 14.7998 3.80273 15.4287 4.8623 15.4287ZM6.1543 1.72949C6.1543 1.37402 6.40039 1.14844 6.7832 1.14844H9.20312C9.58594 1.14844 9.83203 1.37402 9.83203 1.72949V2.69336H6.1543V1.72949ZM4.99219 14.2188C4.61621 14.2188 4.34277 13.9453 4.32227 13.542L3.86426 3.88965H12.1152L11.6709 13.542C11.6572 13.9453 11.3838 14.2188 10.9941 14.2188H4.99219ZM5.9834 13.1182C6.27051 13.1182 6.45508 12.9336 6.44824 12.667L6.24316 5.50293C6.23633 5.22949 6.04492 5.05176 5.77148 5.05176C5.48438 5.05176 5.2998 5.23633 5.30664 5.50293L5.51172 12.667C5.51855 12.9404 5.70996 13.1182 5.9834 13.1182ZM8 13.1182C8.28711 13.1182 8.47852 12.9336 8.47852 12.667V5.50293C8.47852 5.23633 8.28711 5.05176 8 5.05176C7.71289 5.05176 7.52148 5.23633 7.52148 5.50293V12.667C7.52148 12.9336 7.71289 13.1182 8 13.1182ZM10.0166 13.1182C10.29 13.1182 10.4746 12.9404 10.4814 12.667L10.6934 5.50293C10.7002 5.23633 10.5088 5.05176 10.2285 5.05176C9.95508 5.05176 9.76367 5.22949 9.75684 5.50293L9.54492 12.667C9.53809 12.9336 9.72949 13.1182 10.0166 13.1182Z"})})},77926:(e,t,n)=>{n.d(t,{l:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("twitter",{viewBox:"0 0 2400 2452",svg:(0,r.jsx)("path",{d:"M5.3 7.7c4.6 6.6 920.6 1339.9 928.8 1351.9l2.9 4.2-463.2 538.3C219.1 2198.2 8.2 2443.3 5.2 2446.7l-5.4 6.3h211.8l409.5-476c225.2-261.8 409.6-476 409.9-476 .3 0 147.7 214.2 327.5 476l327 476h714.6l-2.9-4.3c-1.6-2.3-220-320.1-485.2-706.2-265.3-386.1-482.4-702.7-482.4-703.6-.1-.8 200.4-234.6 445.4-519.4C2120 234.7 2320.7 1.3 2320.8.8c.2-.4-47.1-.8-105.1-.8h-105.5l-387.4 450.2c-213 247.6-387.7 450.3-388.3 450.4-.5.2-140.2-202.4-310.4-450.1L714.7 0H-.1l5.4 7.7zm669 239c283.8 405.9 1434.5 2052.1 1435.1 2053 .6 1-32 1.3-161.7 1.3h-162.5l-341-487.7C1256.7 1545 920 1063.4 696.1 743.1 472.2 422.8 289 160.4 289 159.9s68.3-.9 162-.9h161.9l61.4 87.7z"})})},742283:(e,t,n)=>{n.d(t,{r:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesCheckbox",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M3.85742 14.4561H12.1357C13.6123 14.4561 14.3779 13.6904 14.3779 12.2344V3.91504C14.3779 2.45215 13.6123 1.69336 12.1357 1.69336H3.85742C2.38086 1.69336 1.61523 2.45215 1.61523 3.91504V12.2344C1.61523 13.6973 2.38086 14.4561 3.85742 14.4561ZM3.93945 13.1162C3.30371 13.1162 2.95508 12.7812 2.95508 12.1182V4.02441C2.95508 3.36133 3.30371 3.0332 3.93945 3.0332H12.0537C12.6826 3.0332 13.0381 3.36133 13.0381 4.02441V12.1182C13.0381 12.7812 12.6826 13.1162 12.0537 13.1162H3.93945ZM7.26855 11.3115C7.51465 11.3115 7.72656 11.1885 7.87012 10.9697L10.9258 6.19141C11.0146 6.04785 11.0967 5.88379 11.0967 5.72656C11.0967 5.3916 10.7959 5.16602 10.4746 5.16602C10.2695 5.16602 10.085 5.27539 9.94141 5.50781L7.24121 9.8418L5.96973 8.22168C5.80566 8.00977 5.6416 7.93457 5.43652 7.93457C5.10156 7.93457 4.8418 8.20117 4.8418 8.54297C4.8418 8.70703 4.90332 8.85742 5.01953 9.00098L6.63281 10.9697C6.81738 11.209 7.01562 11.3115 7.26855 11.3115Z"})})},363030:(e,t,n)=>{n.d(t,{I:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesCreatedAt",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M8 15.126C11.8623 15.126 15.0615 11.9336 15.0615 8.06445C15.0615 4.20215 11.8623 1.00293 7.99316 1.00293C4.13086 1.00293 0.938477 4.20215 0.938477 8.06445C0.938477 11.9336 4.1377 15.126 8 15.126ZM8 13.7383C4.85547 13.7383 2.33301 11.209 2.33301 8.06445C2.33301 4.91992 4.84863 2.39746 7.99316 2.39746C11.1377 2.39746 13.6738 4.91992 13.6738 8.06445C13.6738 11.209 11.1445 13.7383 8 13.7383ZM4.54102 8.91211H7.99316C8.30078 8.91211 8.54004 8.67285 8.54004 8.37207V3.8877C8.54004 3.58691 8.30078 3.34766 7.99316 3.34766C7.69238 3.34766 7.45312 3.58691 7.45312 3.8877V7.83203H4.54102C4.2334 7.83203 4.00098 8.06445 4.00098 8.37207C4.00098 8.67285 4.2334 8.91211 4.54102 8.91211Z"})})},669196:(e,t,n)=>{n.d(t,{H:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesCreatedBy",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M8 15.126C11.8623 15.126 15.0615 11.9336 15.0615 8.06445C15.0615 4.20215 11.8623 1.00293 7.99316 1.00293C4.13086 1.00293 0.938477 4.20215 0.938477 8.06445C0.938477 11.9336 4.1377 15.126 8 15.126ZM8 10.4229C6.05176 10.4229 4.54785 11.1133 3.83008 11.9131C2.90039 10.9082 2.33301 9.55469 2.33301 8.06445C2.33301 4.91992 4.84863 2.39746 7.99316 2.39746C11.1377 2.39746 13.6738 4.91992 13.6738 8.06445C13.6738 9.55469 13.1064 10.9082 12.1699 11.9131C11.4521 11.1133 9.94824 10.4229 8 10.4229ZM8 9.30176C9.32617 9.30859 10.3516 8.18066 10.3516 6.71094C10.3516 5.33008 9.31934 4.18164 8 4.18164C6.6875 4.18164 5.6416 5.33008 5.64844 6.71094C5.65527 8.18066 6.68066 9.28809 8 9.30176Z"})})},282447:(e,t,n)=>{n.d(t,{V:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesDate",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M3.29688 14.4561H12.7031C14.1797 14.4561 14.9453 13.6904 14.9453 12.2344V3.91504C14.9453 2.45215 14.1797 1.69336 12.7031 1.69336H3.29688C1.82031 1.69336 1.05469 2.45215 1.05469 3.91504V12.2344C1.05469 13.6973 1.82031 14.4561 3.29688 14.4561ZM3.27637 13.1162C2.70898 13.1162 2.39453 12.8154 2.39453 12.2207V5.9043C2.39453 5.30273 2.70898 5.00879 3.27637 5.00879H12.71C13.2842 5.00879 13.6055 5.30273 13.6055 5.9043V12.2207C13.6055 12.8154 13.2842 13.1162 12.71 13.1162H3.27637ZM6.68066 7.38086H7.08398C7.33008 7.38086 7.41211 7.30566 7.41211 7.05957V6.66309C7.41211 6.41699 7.33008 6.3418 7.08398 6.3418H6.68066C6.44141 6.3418 6.35938 6.41699 6.35938 6.66309V7.05957C6.35938 7.30566 6.44141 7.38086 6.68066 7.38086ZM8.92285 7.38086H9.31934C9.56543 7.38086 9.64746 7.30566 9.64746 7.05957V6.66309C9.64746 6.41699 9.56543 6.3418 9.31934 6.3418H8.92285C8.67676 6.3418 8.59473 6.41699 8.59473 6.66309V7.05957C8.59473 7.30566 8.67676 7.38086 8.92285 7.38086ZM11.1582 7.38086H11.5547C11.8008 7.38086 11.8828 7.30566 11.8828 7.05957V6.66309C11.8828 6.41699 11.8008 6.3418 11.5547 6.3418H11.1582C10.9121 6.3418 10.8301 6.41699 10.8301 6.66309V7.05957C10.8301 7.30566 10.9121 7.38086 11.1582 7.38086ZM4.44531 9.58203H4.84863C5.09473 9.58203 5.17676 9.50684 5.17676 9.26074V8.86426C5.17676 8.61816 5.09473 8.54297 4.84863 8.54297H4.44531C4.20605 8.54297 4.12402 8.61816 4.12402 8.86426V9.26074C4.12402 9.50684 4.20605 9.58203 4.44531 9.58203ZM6.68066 9.58203H7.08398C7.33008 9.58203 7.41211 9.50684 7.41211 9.26074V8.86426C7.41211 8.61816 7.33008 8.54297 7.08398 8.54297H6.68066C6.44141 8.54297 6.35938 8.61816 6.35938 8.86426V9.26074C6.35938 9.50684 6.44141 9.58203 6.68066 9.58203ZM8.92285 9.58203H9.31934C9.56543 9.58203 9.64746 9.50684 9.64746 9.26074V8.86426C9.64746 8.61816 9.56543 8.54297 9.31934 8.54297H8.92285C8.67676 8.54297 8.59473 8.61816 8.59473 8.86426V9.26074C8.59473 9.50684 8.67676 9.58203 8.92285 9.58203ZM11.1582 9.58203H11.5547C11.8008 9.58203 11.8828 9.50684 11.8828 9.26074V8.86426C11.8828 8.61816 11.8008 8.54297 11.5547 8.54297H11.1582C10.9121 8.54297 10.8301 8.61816 10.8301 8.86426V9.26074C10.8301 9.50684 10.9121 9.58203 11.1582 9.58203ZM4.44531 11.7832H4.84863C5.09473 11.7832 5.17676 11.708 5.17676 11.4619V11.0654C5.17676 10.8193 5.09473 10.7441 4.84863 10.7441H4.44531C4.20605 10.7441 4.12402 10.8193 4.12402 11.0654V11.4619C4.12402 11.708 4.20605 11.7832 4.44531 11.7832ZM6.68066 11.7832H7.08398C7.33008 11.7832 7.41211 11.708 7.41211 11.4619V11.0654C7.41211 10.8193 7.33008 10.7441 7.08398 10.7441H6.68066C6.44141 10.7441 6.35938 10.8193 6.35938 11.0654V11.4619C6.35938 11.708 6.44141 11.7832 6.68066 11.7832ZM8.92285 11.7832H9.31934C9.56543 11.7832 9.64746 11.708 9.64746 11.4619V11.0654C9.64746 10.8193 9.56543 10.7441 9.31934 10.7441H8.92285C8.67676 10.7441 8.59473 10.8193 8.59473 11.0654V11.4619C8.59473 11.708 8.67676 11.7832 8.92285 11.7832Z"})})},369576:(e,t,n)=>{n.d(t,{e:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesDocs",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M5.498 4.324h5.004a.432.432 0 00.43-.438.417.417 0 00-.43-.43H5.498a.426.426 0 00-.314.123.417.417 0 00-.123.308.432.432 0 00.437.437zm0 2.331h5.004a.418.418 0 00.308-.123.44.44 0 00.123-.314.418.418 0 00-.43-.424H5.497a.426.426 0 00-.314.123.41.41 0 00-.123.3.44.44 0 00.123.315.426.426 0 00.314.123zm0 2.338h2.42a.426.426 0 00.314-.123.41.41 0 00.123-.3.417.417 0 00-.123-.308.414.414 0 00-.314-.13h-2.42a.414.414 0 00-.314.13.417.417 0 00-.123.307.41.41 0 00.123.301.426.426 0 00.314.123zm-3.363 3.733c0 .738.187 1.296.56 1.674.374.379.928.568 1.661.568h7.28c.734 0 1.288-.19 1.662-.568.373-.378.56-.936.56-1.674V2.41c0-.734-.187-1.29-.56-1.668-.374-.383-.928-.574-1.661-.574h-7.28c-.734 0-1.288.191-1.662.574-.373.378-.56.934-.56 1.668v10.316zm1.346-.082V2.499c0-.319.082-.563.247-.731.164-.174.412-.26.745-.26h7.054c.333 0 .581.086.746.26.164.168.246.412.246.731v10.145c0 .314-.082.556-.246.724-.165.169-.413.253-.746.253H4.473c-.333 0-.581-.084-.745-.253-.165-.168-.247-.41-.247-.724z"})})},648524:(e,t,n)=>{n.d(t,{n:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesEmail",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M0.870117 8.40625C0.870117 12.8975 3.93262 15.6523 8.19824 15.6523C9.31934 15.6523 10.3242 15.5088 10.9463 15.3037C11.3975 15.1533 11.5547 14.9141 11.5547 14.6338C11.5547 14.3398 11.3428 14.1279 11.0283 14.1279C10.9326 14.1279 10.8164 14.1416 10.6797 14.1689C9.94141 14.3398 9.29883 14.4629 8.42383 14.4629C4.69141 14.4629 2.18262 12.2207 2.18262 8.44727C2.18262 4.81055 4.56836 2.28125 8.12988 2.28125C11.3223 2.28125 13.8926 4.26367 13.8926 7.74316C13.8926 9.69141 13.2363 11.0039 12.1904 11.0039C11.4932 11.0039 11.0967 10.5801 11.0967 9.85547V5.4668C11.0967 5.03613 10.8574 4.77637 10.4473 4.77637C10.0371 4.77637 9.79102 5.03613 9.79102 5.4668V6.12305H9.70215C9.36035 5.28906 8.52637 4.77637 7.52148 4.77637C5.76465 4.77637 4.53418 6.2666 4.53418 8.42676C4.53418 10.6143 5.77148 12.1318 7.57617 12.1318C8.62207 12.1318 9.4082 11.5781 9.79785 10.6279H9.87988C10.0439 11.5645 10.8506 12.1318 11.9443 12.1318C13.9131 12.1318 15.123 10.293 15.123 7.6543C15.123 3.68945 12.2109 1.09863 8.14355 1.09863C3.86426 1.09863 0.870117 4.01758 0.870117 8.40625ZM7.84277 10.9014C6.70801 10.9014 5.99707 9.95117 5.99707 8.44043C5.99707 6.93652 6.71484 5.98633 7.84961 5.98633C9.00488 5.98633 9.73633 6.92285 9.73633 8.41309C9.73633 9.93066 8.99805 10.9014 7.84277 10.9014Z"})})},943393:(e,t,n)=>{n.d(t,{Z:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesFile",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M12.5938 8.44043L7.54883 13.4854C6.26367 14.7773 4.54102 14.6475 3.44043 13.54C2.32617 12.4326 2.20312 10.7168 3.49512 9.4248L10.3926 2.52734C11.1445 1.77539 12.2725 1.63867 13.0039 2.37695C13.7422 3.11523 13.6055 4.22949 12.8535 4.98828L6.08594 11.7627C5.77832 12.0703 5.41602 11.9814 5.2041 11.7764C4.99902 11.5576 4.91016 11.2021 5.21777 10.8877L9.93457 6.1709C10.1738 5.93164 10.1875 5.58301 9.96191 5.35059C9.72949 5.13184 9.38086 5.13867 9.1416 5.37793L4.39746 10.1152C3.67285 10.8535 3.7002 11.9746 4.34961 12.624C5.05371 13.3281 6.12012 13.3145 6.8584 12.5762L13.6602 5.77441C14.9795 4.45508 14.9316 2.71875 13.7764 1.55664C12.6416 0.428711 10.8779 0.34668 9.55176 1.66602L2.61328 8.61816C0.883789 10.3477 1 12.8291 2.57227 14.4014C4.14453 15.9668 6.63281 16.0898 8.3623 14.3672L13.4414 9.28809C13.6738 9.0625 13.667 8.64551 13.4346 8.41992C13.209 8.18066 12.833 8.21484 12.5938 8.44043Z"})})},932426:(e,t,n)=>{n.d(t,{D:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesFormula",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M5.04688 14.3604H11.2744C11.7324 14.3604 12.0537 14.0801 12.0537 13.6494C12.0537 13.2119 11.7324 12.9248 11.2744 12.9248H5.81934V12.8564L9.30566 8.82324C9.54492 8.57031 9.6748 8.29688 9.6748 8.0166C9.6748 7.73633 9.54492 7.45605 9.29883 7.20996L5.81934 3.2793V3.21094H11.2812C11.7393 3.21094 12.0537 2.92383 12.0537 2.48633C12.0537 2.05566 11.7393 1.77539 11.2812 1.77539H5.05371C4.34277 1.77539 3.95312 2.26758 3.95312 2.81445C3.95312 3.12207 4.07617 3.44336 4.33594 3.69629L8.15039 7.96875V8.05078L4.3291 12.4395C4.06934 12.6924 3.94629 13.0137 3.94629 13.3213C3.94629 13.8682 4.33594 14.3604 5.04688 14.3604Z"})})},571500:(e,t,n)=>{n.d(t,{A:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesId",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M12.252 7.9209C13.7217 7.9209 14.7266 6.93652 14.7266 5.50781C14.7266 4.0791 13.7217 3.10156 12.252 3.10156C10.8232 3.10156 9.8457 4.0791 9.8457 5.50781C9.8457 6.93652 10.8301 7.9209 12.252 7.9209ZM2.00488 13.1367C2.45605 13.1367 2.72949 12.8496 2.72949 12.3848V5.83594L7.35059 12.5967C7.6377 12.9932 7.86328 13.1367 8.20508 13.1367C8.69043 13.1367 8.96387 12.8359 8.96387 12.3232V3.8877C8.96387 3.42285 8.69043 3.12891 8.23242 3.12891C7.78809 3.12891 7.50781 3.41602 7.50781 3.8877V10.4229L2.89355 3.66895C2.60645 3.25879 2.40137 3.12891 2.03906 3.12891C1.56738 3.12891 1.27344 3.4502 1.27344 3.94238V12.3848C1.27344 12.8496 1.55371 13.1367 2.00488 13.1367ZM12.252 6.84766C11.5615 6.84766 11.0898 6.30762 11.0898 5.50781C11.0898 4.70801 11.5615 4.16797 12.252 4.16797C12.9902 4.16797 13.4756 4.70801 13.4756 5.50781C13.4756 6.30762 12.9834 6.84766 12.252 6.84766ZM10.625 9.77344H13.9541C14.3506 9.77344 14.624 9.54102 14.624 9.14453C14.624 8.74805 14.3506 8.50195 13.9541 8.50195H10.625C10.2285 8.50195 9.96191 8.74805 9.96191 9.14453C9.96191 9.54102 10.2285 9.77344 10.625 9.77344Z"})})},372050:(e,t,n)=>{n.d(t,{A:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesMultipleSelect",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M1.91602 4.83789C2.44238 4.83789 2.87305 4.40723 2.87305 3.87402C2.87305 3.34766 2.44238 2.91699 1.91602 2.91699C1.38281 2.91699 0.952148 3.34766 0.952148 3.87402C0.952148 4.40723 1.38281 4.83789 1.91602 4.83789ZM5.1084 4.52344H14.3984C14.7607 4.52344 15.0479 4.23633 15.0479 3.87402C15.0479 3.51172 14.7607 3.22461 14.3984 3.22461H5.1084C4.74609 3.22461 4.45898 3.51172 4.45898 3.87402C4.45898 4.23633 4.74609 4.52344 5.1084 4.52344ZM1.91602 9.03516C2.44238 9.03516 2.87305 8.60449 2.87305 8.07129C2.87305 7.54492 2.44238 7.11426 1.91602 7.11426C1.38281 7.11426 0.952148 7.54492 0.952148 8.07129C0.952148 8.60449 1.38281 9.03516 1.91602 9.03516ZM5.1084 8.7207H14.3984C14.7607 8.7207 15.0479 8.43359 15.0479 8.07129C15.0479 7.70898 14.7607 7.42188 14.3984 7.42188H5.1084C4.74609 7.42188 4.45898 7.70898 4.45898 8.07129C4.45898 8.43359 4.74609 8.7207 5.1084 8.7207ZM1.91602 13.2324C2.44238 13.2324 2.87305 12.8018 2.87305 12.2686C2.87305 11.7422 2.44238 11.3115 1.91602 11.3115C1.38281 11.3115 0.952148 11.7422 0.952148 12.2686C0.952148 12.8018 1.38281 13.2324 1.91602 13.2324ZM5.1084 12.918H14.3984C14.7607 12.918 15.0479 12.6309 15.0479 12.2686C15.0479 11.9062 14.7607 11.6191 14.3984 11.6191H5.1084C4.74609 11.6191 4.45898 11.9062 4.45898 12.2686C4.45898 12.6309 4.74609 12.918 5.1084 12.918Z"})})},155159:(e,t,n)=>{n.d(t,{J:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesNumber",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M2.4834 10.9902H4.33594L3.75488 13.8887C3.74121 13.9639 3.72754 14.0664 3.72754 14.1416C3.72754 14.5381 3.99414 14.7637 4.39746 14.7637C4.81445 14.7637 5.09473 14.5449 5.18359 14.1143L5.80566 10.9902H8.79297L8.21191 13.8887C8.19824 13.9639 8.18457 14.0664 8.18457 14.1416C8.18457 14.5381 8.45117 14.7637 8.85449 14.7637C9.27148 14.7637 9.55176 14.5449 9.63379 14.1143L10.2627 10.9902H12.4502C12.9287 10.9902 13.2432 10.6758 13.2432 10.2109C13.2432 9.8418 12.9902 9.56836 12.6006 9.56836H10.5498L11.2129 6.28711H13.3662C13.8379 6.28711 14.1523 5.96582 14.1523 5.50098C14.1523 5.13184 13.9062 4.8584 13.5098 4.8584H11.5L12.0195 2.27441C12.0264 2.21973 12.0469 2.11035 12.0469 2.01465C12.0469 1.625 11.7666 1.39258 11.3633 1.39258C10.9053 1.39258 10.6797 1.63867 10.5977 2.05566L10.0303 4.8584H7.04297L7.5625 2.27441C7.57617 2.21973 7.58984 2.11035 7.58984 2.01465C7.58984 1.625 7.30957 1.39258 6.91309 1.39258C6.44824 1.39258 6.21582 1.63867 6.13379 2.05566L5.57324 4.8584H3.54297C3.06445 4.8584 2.75 5.18652 2.75 5.65137C2.75 6.03418 3.00293 6.28711 3.39258 6.28711H5.28613L4.62305 9.56836H2.63379C2.15527 9.56836 1.84082 9.89648 1.84082 10.3613C1.84082 10.7373 2.09375 10.9902 2.4834 10.9902ZM6.09277 9.56836L6.75586 6.28711H9.74316L9.08008 9.56836H6.09277Z"})})},526774:(e,t,n)=>{n.d(t,{O:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesPerson",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M10.9536 7.90088C12.217 7.90088 13.2559 6.79468 13.2559 5.38525C13.2559 4.01514 12.2114 2.92017 10.9536 2.92017C9.70142 2.92017 8.65137 4.02637 8.65698 5.39087C8.6626 6.79468 9.69019 7.90088 10.9536 7.90088ZM4.4231 8.03003C5.52368 8.03003 6.42212 7.05859 6.42212 5.83447C6.42212 4.63843 5.51245 3.68945 4.4231 3.68945C3.33374 3.68945 2.41846 4.64966 2.41846 5.84009C2.42407 7.05859 3.32251 8.03003 4.4231 8.03003ZM1.37964 13.168H5.49561C4.87231 12.292 5.43384 10.6074 6.78711 9.51807C6.18628 9.14746 5.37769 8.87231 4.4231 8.87231C1.95239 8.87231 0.262207 10.6917 0.262207 12.1628C0.262207 12.7974 0.548584 13.168 1.37964 13.168ZM7.50024 13.168H14.407C15.4009 13.168 15.7322 12.8423 15.7322 12.2864C15.7322 10.8489 13.8679 8.88354 10.9536 8.88354C8.04492 8.88354 6.17505 10.8489 6.17505 12.2864C6.17505 12.8423 6.50635 13.168 7.50024 13.168Z"})})},934093:(e,t,n)=>{n.d(t,{u:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesPhoneNumber",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M5.09473 11.2021C7.11133 13.2188 9.55859 14.7705 11.5547 14.7705C12.4502 14.7705 13.2363 14.4629 13.8652 13.7656C14.2275 13.3555 14.4531 12.8838 14.4531 12.4121C14.4531 12.0498 14.3164 11.7012 13.9678 11.4551L11.8691 9.96484C11.541 9.73242 11.2607 9.62305 11.0146 9.62305C10.6934 9.62305 10.4131 9.80078 10.0986 10.1152L9.59961 10.6074C9.52441 10.6826 9.42871 10.71 9.33984 10.71C9.23047 10.71 9.12793 10.6689 9.05273 10.6348C8.62891 10.4023 7.89062 9.7666 7.20703 9.08984C6.53027 8.40625 5.89453 7.6748 5.66895 7.24414C5.62793 7.16895 5.58691 7.06641 5.58691 6.96387C5.58691 6.875 5.61426 6.7793 5.69629 6.7041L6.18164 6.20508C6.49609 5.88379 6.68066 5.60352 6.68066 5.28223C6.68066 5.03613 6.56445 4.7627 6.33203 4.42773L4.85547 2.34961C4.60254 2.00098 4.24707 1.85059 3.85742 1.85059C3.39941 1.85059 2.93457 2.05566 2.52441 2.44531C1.84766 3.08789 1.54688 3.88086 1.54688 4.76953C1.54688 6.76562 3.07812 9.18555 5.09473 11.2021Z"})})},492607:(e,t,n)=>{n.d(t,{v:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesRelation",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M13.1475 10.5869V3.72363C13.1475 3.25195 12.833 2.93066 12.3477 2.93066H5.48438C5.02637 2.93066 4.70508 3.27246 4.70508 3.67578C4.70508 4.07227 5.05371 4.40039 5.46387 4.40039H7.89746L10.8438 4.30469L9.59961 5.39844L3.08496 11.9199C2.92773 12.0771 2.8457 12.2686 2.8457 12.46C2.8457 12.8564 3.20801 13.2256 3.61816 13.2256C3.80957 13.2256 3.99414 13.1504 4.15137 12.9932L10.6729 6.47168L11.7803 5.22754L11.6641 8.05762V10.6074C11.6641 11.0176 11.9922 11.373 12.4023 11.373C12.8057 11.373 13.1475 11.0312 13.1475 10.5869Z"})})},832623:(e,t,n)=>{n.d(t,{G:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesRollup",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M1.25293 6.82031C1.25293 9.88965 3.74805 12.3848 6.81738 12.3848C7.95898 12.3848 9.00488 12.0361 9.87988 11.4414L13.0244 14.5859C13.2158 14.7842 13.4824 14.873 13.749 14.873C14.3301 14.873 14.7471 14.4355 14.7471 13.8682C14.7471 13.5947 14.6514 13.3418 14.4668 13.1504L11.3428 10.0195C11.9922 9.12402 12.3818 8.0166 12.3818 6.82031C12.3818 3.75098 9.88672 1.25586 6.81738 1.25586C3.74805 1.25586 1.25293 3.75098 1.25293 6.82031ZM2.70215 6.82031C2.70215 4.55078 4.54102 2.70508 6.81738 2.70508C9.08691 2.70508 10.9326 4.55078 10.9326 6.82031C10.9326 9.08984 9.08691 10.9355 6.81738 10.9355C4.54102 10.9355 2.70215 9.08984 2.70215 6.82031Z"})})},753866:(e,t,n)=>{n.d(t,{w:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesSelect",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M8 15.126C11.8623 15.126 15.0615 11.9336 15.0615 8.06445C15.0615 4.20215 11.8623 1.00293 7.99316 1.00293C4.13086 1.00293 0.938477 4.20215 0.938477 8.06445C0.938477 11.9336 4.1377 15.126 8 15.126ZM8 13.7383C4.85547 13.7383 2.33301 11.209 2.33301 8.06445C2.33301 4.91992 4.84863 2.39746 7.99316 2.39746C11.1377 2.39746 13.6738 4.91992 13.6738 8.06445C13.6738 11.209 11.1445 13.7383 8 13.7383ZM7.62402 10.6348C7.79492 10.915 8.20508 10.9287 8.37598 10.6348L10.666 6.73145C10.8574 6.41016 10.7002 6.04102 10.3652 6.04102H5.62793C5.29297 6.04102 5.14941 6.43066 5.32031 6.73145L7.62402 10.6348Z"})})},603729:(e,t,n)=>{n.d(t,{T:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesStatus",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M8.75488 1.02344C8.75488 0.613281 8.41309 0.264648 8.00293 0.264648C7.59277 0.264648 7.25098 0.613281 7.25098 1.02344V3.11523C7.25098 3.51855 7.59277 3.86719 8.00293 3.86719C8.41309 3.86719 8.75488 3.51855 8.75488 3.11523V1.02344ZM3.91504 5.0293C4.20215 5.31641 4.69434 5.32324 4.97461 5.03613C5.26855 4.74902 5.26855 4.25684 4.98145 3.96973L3.53906 2.52051C3.25195 2.2334 2.7666 2.21973 2.47949 2.50684C2.19238 2.79395 2.18555 3.28613 2.47266 3.57324L3.91504 5.0293ZM10.9629 4.01758C10.6826 4.30469 10.6826 4.79688 10.9697 5.08398C11.2568 5.37109 11.749 5.36426 12.0361 5.07715L13.4854 3.62793C13.7725 3.34082 13.7725 2.84863 13.4785 2.55469C13.1982 2.27441 12.7061 2.27441 12.4189 2.56152L10.9629 4.01758ZM15.0234 8.78906C15.4336 8.78906 15.7822 8.44727 15.7822 8.03711C15.7822 7.62695 15.4336 7.28516 15.0234 7.28516H12.9385C12.5283 7.28516 12.1797 7.62695 12.1797 8.03711C12.1797 8.44727 12.5283 8.78906 12.9385 8.78906H15.0234ZM0.975586 7.28516C0.56543 7.28516 0.223633 7.62695 0.223633 8.03711C0.223633 8.44727 0.56543 8.78906 0.975586 8.78906H3.07422C3.48438 8.78906 3.83301 8.44727 3.83301 8.03711C3.83301 7.62695 3.48438 7.28516 3.07422 7.28516H0.975586ZM12.0361 10.9902C11.749 10.71 11.2568 10.71 10.9629 10.9971C10.6826 11.2842 10.6826 11.7764 10.9697 12.0635L12.4258 13.5127C12.7129 13.7998 13.2051 13.793 13.4922 13.5059C13.7793 13.2256 13.7725 12.7266 13.4854 12.4395L12.0361 10.9902ZM2.52051 12.4395C2.22656 12.7266 2.22656 13.2188 2.50684 13.5059C2.79395 13.793 3.28613 13.7998 3.57324 13.5127L5.02246 12.0703C5.31641 11.7832 5.31641 11.291 5.03613 11.0039C4.74902 10.7168 4.25684 10.71 3.96973 10.9971L2.52051 12.4395ZM8.75488 12.9658C8.75488 12.5557 8.41309 12.207 8.00293 12.207C7.59277 12.207 7.25098 12.5557 7.25098 12.9658V15.0576C7.25098 15.4609 7.59277 15.8096 8.00293 15.8096C8.41309 15.8096 8.75488 15.4609 8.75488 15.0576V12.9658Z"})})},800108:(e,t,n)=>{n.d(t,{p:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesText",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M1.56738 3.25879H14.4258C14.7676 3.25879 15.0479 2.97852 15.0479 2.63672C15.0479 2.29492 14.7744 2.02148 14.4258 2.02148H1.56738C1.21875 2.02148 0.952148 2.29492 0.952148 2.63672C0.952148 2.97852 1.22559 3.25879 1.56738 3.25879ZM1.56738 6.84082H14.4258C14.7676 6.84082 15.0479 6.56055 15.0479 6.21875C15.0479 5.87695 14.7744 5.60352 14.4258 5.60352H1.56738C1.21875 5.60352 0.952148 5.87695 0.952148 6.21875C0.952148 6.56055 1.22559 6.84082 1.56738 6.84082ZM1.56738 10.4229H14.4258C14.7676 10.4229 15.0479 10.1426 15.0479 9.80078C15.0479 9.45898 14.7744 9.18555 14.4258 9.18555H1.56738C1.21875 9.18555 0.952148 9.45898 0.952148 9.80078C0.952148 10.1426 1.22559 10.4229 1.56738 10.4229ZM1.56738 14.0049H8.75879C9.10059 14.0049 9.38086 13.7246 9.38086 13.3828C9.38086 13.041 9.10742 12.7676 8.75879 12.7676H1.56738C1.21875 12.7676 0.952148 13.041 0.952148 13.3828C0.952148 13.7246 1.22559 14.0049 1.56738 14.0049Z"})})},983303:(e,t,n)=>{n.d(t,{c:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesTitle",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M0.637695 13.1914C1.0957 13.1914 1.32812 13 1.47852 12.5215L2.24414 10.3887H6.14746L6.90625 12.5215C7.05664 13 7.2959 13.1914 7.74707 13.1914C8.22559 13.1914 8.5332 12.9043 8.5332 12.4531C8.5332 12.2891 8.50586 12.1523 8.44434 11.9678L5.41602 3.79199C5.2041 3.21777 4.82129 2.9375 4.19922 2.9375C3.60449 2.9375 3.21484 3.21777 3.0166 3.78516L-0.0322266 12.002C-0.09375 12.1797 -0.121094 12.3232 -0.121094 12.4668C-0.121094 12.918 0.166016 13.1914 0.637695 13.1914ZM2.63379 9.12402L4.17871 4.68066H4.21973L5.76465 9.12402H2.63379ZM12.2793 13.2324C13.3115 13.2324 14.2891 12.6787 14.7129 11.8037H14.7402V12.5762C14.7471 12.9863 15.0273 13.2393 15.4238 13.2393C15.834 13.2393 16.1143 12.9795 16.1143 12.5215V8.00977C16.1143 6.49902 14.9658 5.52148 13.1543 5.52148C11.7666 5.52148 10.6592 6.08887 10.2695 6.99121C10.1943 7.15527 10.1533 7.3125 10.1533 7.46289C10.1533 7.81152 10.4062 8.04395 10.7686 8.04395C11.0215 8.04395 11.2129 7.94824 11.3496 7.73633C11.7529 6.99121 12.2861 6.65625 13.1064 6.65625C14.0977 6.65625 14.6992 7.20996 14.6992 8.1123V8.67285L12.5664 8.7959C10.7686 8.8916 9.77734 9.69824 9.77734 11.0107C9.77734 12.3369 10.8096 13.2324 12.2793 13.2324ZM12.6621 12.1387C11.8008 12.1387 11.2129 11.667 11.2129 10.9561C11.2129 10.2725 11.7598 9.82129 12.7578 9.75977L14.6992 9.62988V10.3203C14.6992 11.3457 13.7969 12.1387 12.6621 12.1387Z"})})},656505:(e,t,n)=>{n.d(t,{S:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesUnknownType",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M8,0 C12.4182,0 16,3.58203 16,8 C16,12.418 12.4182,16 8,16 C3.58185,16 0,12.418 0,8 C0,3.58203 3.58185,0 8,0 Z M6.74139,5.98633 C6.76208,5.31738 7.21722,4.87598 7.87933,4.87598 C8.52759,4.87598 8.98279,5.26221 8.98279,5.8208 C8.98279,6.42773 8.74139,6.71729 7.80347,7.26904 C6.84485,7.8208 6.5,8.44141 6.63104,9.62061 L6.65173,9.89648 L8.80347,9.89648 L8.80347,9.57227 C8.80347,8.92432 9.06549,8.61377 10.0103,8.06885 C11.0241,7.48291 11.5,6.7793 11.5,5.75879 C11.5,4.10352 10.1345,3 8.0379,3 C5.83105,3 4.52069,4.1792 4.5,5.98633 L6.74139,5.98633 Z M9.07239,12.0273 C9.07239,11.3379 8.48621,10.793 7.76898,10.793 C7.0448,10.793 6.46552,11.3379 6.46552,12.0273 C6.46552,12.7241 7.0448,13.269 7.76898,13.269 C8.48621,13.269 9.07239,12.7241 9.07239,12.0273 Z"})})},808938:(e,t,n)=>{n.d(t,{O:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesUrl",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M7.69922 10.8945L8.73828 9.84863C7.91797 9.77344 7.34375 9.51367 6.91992 9.08984C5.76465 7.93457 5.76465 6.29395 6.91309 5.14551L9.18262 2.87598C10.3379 1.7207 11.9717 1.7207 13.127 2.87598C14.2891 4.04492 14.2822 5.67188 13.1338 6.82031L11.958 7.99609C12.1768 8.49512 12.2451 9.10352 12.1289 9.62988L14.0908 7.6748C15.7725 6 15.7793 3.62109 14.084 1.92578C12.3887 0.223633 10.0098 0.237305 8.33496 1.91211L5.95605 4.29785C4.28125 5.97266 4.26758 8.35156 5.96289 10.0469C6.36621 10.4434 6.90625 10.7441 7.69922 10.8945ZM8.30078 5.13184L7.26855 6.17773C8.08203 6.25293 8.66309 6.51953 9.08008 6.93652C10.2422 8.09863 10.2422 9.73242 9.08691 10.8809L6.81738 13.1504C5.66211 14.3057 4.03516 14.3057 2.87305 13.1504C1.71094 11.9883 1.71777 10.3545 2.87305 9.20605L4.04199 8.03027C3.83008 7.53125 3.75488 6.92969 3.87109 6.39648L1.91602 8.35156C0.234375 10.0264 0.227539 12.4121 1.92285 14.1074C3.61816 15.8027 5.99707 15.7891 7.67188 14.1143L10.0439 11.7354C11.7256 10.0537 11.7324 7.6748 10.0371 5.98633C9.64062 5.58301 9.10059 5.28223 8.30078 5.13184Z"})})},394308:(e,t,n)=>{n.d(t,{f:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("typesVerification",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M3.86426 14.0459H5.32715C5.45475 14.0459 5.56185 14.0892 5.64844 14.1758L6.6875 15.2148C7.13411 15.6615 7.56934 15.8825 7.99316 15.8779C8.42155 15.8779 8.85677 15.6569 9.29883 15.2148L10.3379 14.1758C10.429 14.0892 10.5384 14.0459 10.666 14.0459H12.1221C12.751 14.0459 13.2158 13.8955 13.5166 13.5947C13.8219 13.2939 13.9746 12.8268 13.9746 12.1934V10.7305C13.9746 10.6029 14.0202 10.4958 14.1113 10.4092L15.1436 9.37012C15.5902 8.92806 15.8112 8.49284 15.8066 8.06445C15.8066 7.63607 15.5856 7.19857 15.1436 6.75195L14.1113 5.71289C14.0202 5.6263 13.9746 5.52148 13.9746 5.39844V3.92871C13.9746 3.30436 13.8242 2.83952 13.5234 2.53418C13.2227 2.22884 12.7555 2.07617 12.1221 2.07617H10.666C10.5384 2.07617 10.429 2.03288 10.3379 1.94629L9.29883 0.914062C8.85677 0.462891 8.42155 0.239583 7.99316 0.244141C7.56934 0.244141 7.13411 0.467448 6.6875 0.914062L5.64844 1.94629C5.56185 2.03288 5.45475 2.07617 5.32715 2.07617H3.86426C3.23535 2.07617 2.76823 2.22656 2.46289 2.52734C2.16211 2.82812 2.01172 3.29525 2.01172 3.92871V5.39844C2.01172 5.52148 1.96842 5.6263 1.88184 5.71289L0.849609 6.75195C0.402995 7.19857 0.179688 7.63607 0.179688 8.06445C0.179688 8.49284 0.402995 8.92806 0.849609 9.37012L1.88184 10.4092C1.96842 10.4958 2.01172 10.6029 2.01172 10.7305V12.1934C2.01172 12.8223 2.16211 13.2871 2.46289 13.5879C2.76823 13.8932 3.23535 14.0459 3.86426 14.0459ZM7.23438 11.4277C7.10221 11.4277 6.98372 11.4004 6.87891 11.3457C6.77409 11.291 6.67155 11.2021 6.57129 11.0791L4.89648 9.04199C4.83724 8.96452 4.79167 8.88477 4.75977 8.80273C4.72786 8.7207 4.71191 8.63639 4.71191 8.5498C4.71191 8.37663 4.77116 8.22852 4.88965 8.10547C5.0127 7.97786 5.16081 7.91406 5.33398 7.91406C5.44336 7.91406 5.54134 7.93685 5.62793 7.98242C5.71452 8.02799 5.80339 8.10775 5.89453 8.22168L7.20703 9.88965L10.0371 5.36426C10.1829 5.12728 10.3675 5.00879 10.5908 5.00879C10.7594 5.00879 10.9098 5.06348 11.042 5.17285C11.1787 5.28223 11.2471 5.42578 11.2471 5.60352C11.2471 5.68099 11.2288 5.76302 11.1924 5.84961C11.1559 5.93164 11.1149 6.00911 11.0693 6.08203L7.87012 11.0723C7.78809 11.1908 7.69238 11.2796 7.58301 11.3389C7.47819 11.3981 7.36198 11.4277 7.23438 11.4277Z"})})},523539:(e,t,n)=>{n.d(t,{Y:()=>i});n(667294);var o=n(745238),r=n(785893);const i=(0,o.IU)("wikiDB",{viewBox:"0 0 16 16",svg:(0,r.jsx)("path",{d:"M.282 12.767c0 .31.09.537.267.683.178.15.39.226.636.226.127 0 .25-.03.369-.09.118-.058.25-.136.396-.232.378-.246.784-.44 1.217-.58.433-.142.875-.21 1.326-.206.479.005.944.094 1.395.267.455.178.87.444 1.244.8.16.15.307.255.444.314a1.039 1.039 0 00.84 0c.138-.059.286-.164.445-.314a3.74 3.74 0 011.23-.8 4.115 4.115 0 012.734-.062c.434.142.837.335 1.211.582.15.095.285.173.404.232.118.06.241.089.369.089a.952.952 0 00.635-.226c.178-.146.267-.373.267-.683V3.483a.682.682 0 00-.096-.376c-.214-.373-.526-.713-.936-1.018-.41-.305-.891-.55-1.443-.732a5.542 5.542 0 00-1.763-.273 5.23 5.23 0 00-2.024.383c-.61.255-1.094.588-1.449.998-.365-.41-.854-.743-1.47-.998a5.143 5.143 0 00-2.003-.383c-.638 0-1.232.091-1.784.273a5.067 5.067 0 00-1.435.732 3.41 3.41 0 00-.93 1.018.59.59 0 00-.082.185 1.26 1.26 0 00-.014.191v9.284zm1.347-.76V3.689c.178-.255.417-.476.718-.663.3-.186.638-.332 1.011-.437a4.308 4.308 0 011.17-.157c.615 0 1.175.118 1.681.355.51.233.882.545 1.114.937v8.387a4.156 4.156 0 00-.793-.458 4.802 4.802 0 00-.957-.307 4.72 4.72 0 00-1.046-.117c-.565 0-1.1.071-1.606.212a4.262 4.262 0 00-1.292.568zm7.04.103V3.723c.233-.392.602-.704 1.108-.937a3.948 3.948 0 011.696-.355c.4 0 .786.052 1.155.157.374.105.71.25 1.012.437.305.187.546.408.724.663v8.32a4.356 4.356 0 00-1.299-.568 5.897 5.897 0 00-1.592-.211c-.36 0-.711.038-1.053.116a5.002 5.002 0 00-.957.307c-.3.133-.565.285-.793.458z"})})},318970:(e,t,n)=>{n.d(t,{V3:()=>o,Wm:()=>r});const o={"1:1":{width:1,height:1},"5:4":{width:5,height:4},"4:3":{width:4,height:3},"7:5":{width:7,height:5},"3:2":{width:3,height:2},"5:3":{width:5,height:3},"16:9":{width:16,height:9}},r={crop:{unit:"%",x:0,y:0,width:100,height:100},mask:"None"}},264572:(e,t,n)=>{n.d(t,{A5:()=>d,m3:()=>m,nR:()=>c});n(757658);var o=n(653965),r=(n(218265),n(815145)),i=n(401800),a=n(599405),s=n(421202),l=n(421838);function c(e){const{pageId:t,scrollToBlockId:n,peekViewBlockId:o,peekMode:a,collectionViewId:s,discussionId:l}=e;return(0,i.Z)({pageId:t,scrollToBlockId:n,peekViewBlockId:o,peekMode:a,collectionViewId:s,discussionId:l,pageVisitSource:r.tY.LinkInPage})}function d(e){const{url:t,baseUrl:n,publicDomainName:o}=e;let r;try{r=(0,a.parseRoute)({url:t,isMobile:!1,baseUrl:n,publicDomainName:o,protocol:void 0,currentUrl:void 0})}catch(i){return}if("page"===r.name)return r.peekViewBlockId||r.blockId}function u(e){return(t,n,o)=>{const r=e({table:s.iU,id:t});return!!r&&(r.parent_table===n&&r.parent_id===o)}}function p(e,t){if(!e)return[];const n=l.jDe(e),o=l.rxn(e);for(const r of o){const e=d({...t,url:r.url});e&&n.push(e)}return n}function m(e){const{parentBlock:t,oldTextValue:n,newTextValue:r,getRecordValue:i,baseUrl:a,publicDomainName:l}=e,c=p(n,{baseUrl:a,publicDomainName:l}),d=p(r,{baseUrl:a,publicDomainName:l});return function(e){const{parentBlock:t,mentionedPageIds:n,blockHasParent:r}=e,i=t.content||[];return o.zu(n,...i).filter((e=>r(e,s.iU,t.id)))}({parentBlock:t,mentionedPageIds:o.zu(c,...d),blockHasParent:u(i)})}},474181:(e,t,n)=>{n.d(t,{Cb:()=>w,Mq:()=>m,T0:()=>S,T2:()=>I,VM:()=>p,Xv:()=>T,_o:()=>_,hB:()=>v,lT:()=>C,mb:()=>y,mo:()=>f,ns:()=>x,t9:()=>g,ue:()=>b,zc:()=>h});var o=n(709291),r=n(401898),i=n(218265),a=n(841892),s=n(977657),l=n(471924),c=n(959753),d=n(509844),u=n(54363);(0,o.defineMessages)({dlp:{id:"integrationHelpers.integrationTypes.dlp",defaultMessage:"DLP"},siem:{id:"integrationHelpers.integrationTypes.siem",defaultMessage:"SIEM"},ediscovery:{id:"integrationHelpers.integrationTypes.ediscovery",defaultMessage:"eDiscovery"}});function p(e){if(void 0===e)return!1;const t=c.kk5.isAnyModel(e)?e.getCapabilities():e.capabilities;return!0===(null==t?void 0:t.link_preview)||!0===(null==t?void 0:t.synced_database)}function m(e){if(void 0===e)return!1;const t=c.kk5.isAnyModel(e)?e.getCapabilities():e.capabilities;return!0===t.workspace_page_export||!0===t.workspace_search||!0===t.read_teamspace}function g(e){if(void 0===e)return!1;return!0===(c.kk5.isAnyModel(e)?e.getCapabilities():e.capabilities).webhooks}function f(e){return p(e)}function h(e){var t;if(!p(e))return!1;const n=c.kk5.fromValue(d.K2,e);return Boolean(null==n||null===(t=n.getInfo().original_url_patterns)||void 0===t?void 0:t.find((e=>{var t;return!0===(null===(t=e.additional_types)||void 0===t?void 0:t.collection)})))}function v(e){return void 0!==e&&"external"===e.type&&s.Qk.includes(e.id)}function y(e,t){const n=i.yn(t);if(!n)return!1;const o=i.Qc(n);if(!o.hostname)return!1;if("http:"===o.protocol&&"localhost"===o.hostname)return!0;if("https:"!==o.protocol)return!1;const{hostname:r}=i.Qc(e);if(!r)return!1;const a=r.split(".").slice(-2,-1).join("."),s=`${a}.so`,l=`${a}.com`;return o.hostname!==s&&!o.hostname.endsWith(`.${s}`)&&o.hostname!==l&&!o.hostname.endsWith(`.${l}`)}function b(e,t){const n=t.match(/^(h|$)(t|$)(t|$)(p|$)(s|$)(:|$)(\/|$)(\/|$).*$/),o=t.match(/^(h|$)(t|$)(t|$)(p|$)(:|$)(\/|$)(\/|$).*$/);return[t,n?void 0:`https://${t}`,o?void 0:`http://${t}`].filter(r.$K).filter((t=>t&&y(e,t)))}const _="legacy-google-integration",S="legacy-slack-integration",k={id:_,name:"Google Drive",alive:!0,status:"published",info:{icon:a.Z.images.import.googleDrivePng,tagline:"Easily bring Google Docs, Sheets, and Slides into Notion",description:"Connect Google Drive with Notion to easily bring all your files into Notion - including Google Sheets, Google Docs, and Google Slides.",developer_name:"Notion",website_url:"https://www.notion.so/",privacy_policy_url:"https://www.notion.so/notion/Terms-and-Privacy-28ffdd083dc3473e9c2da6ec011b58ac",screenshots:[a.Z.images.integrations.screenshots.googleDriveIntegrationPng]},updated_at:0},w={id:S,name:"Slack",alive:!0,status:"published",info:{icon:a.Z.images.externalIntegrations.slackIconPng,tagline:"See Slack messages directly in Notion for easy sharing and collaboration",description:"Slack is a messaging app for business that connects people to the information they need. Notion's link preview integration with Slack allows you to see Slack messages directly in a Notion page by simply pasting a link, for easy sharing and collaboration across teams.",developer_name:"Notion",website_url:"https://www.notion.so/",privacy_policy_url:"https://www.notion.so/notion/Terms-and-Privacy-28ffdd083dc3473e9c2da6ec011b58ac"},updated_at:0},x=[k,w],I=x.map((e=>e.id));function C(e){return`${e}/eap/app/authorize`}function T(e){const{locale:t,integrationId:n}=e;return(0,l.Ul)(JSON.stringify({table:u.uV,locale:t,id:n}))}},676725:(e,t,n)=>{n.d(t,{Z:()=>o});n(757658);function o(e,t){const n=[];return e.forEach(((o,r)=>{n.push(o),e[r+1]&&n.push(t(r))})),n}},382138:(e,t,n)=>{function o(){return!0===window.__mobileAppBackgroundLaunch}n.d(t,{Z:()=>o})},522808:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(100632);const r=function(e){return!(!e||e.length>100||e.startsWith("data")||e.startsWith("http")||e.startsWith("/images")||e.startsWith("/icons")||e.startsWith("notion:"))&&o.onlyEmoji(e).length>0}},512549:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(630845);const r=function(e){return e&&o.B(e,"url")}},630845:(e,t,n)=>{n.d(t,{B:()=>r,s:()=>i});var o=n(565155);function r(e,t){return o.Bu(e,t)}function i(e,t){return o.sE(e,t)}},265454:(e,t,n)=>{n.d(t,{ZP:()=>a,_g:()=>r,td:()=>i});const o={};let r=function(e){return e[e.Javascript=0]="Javascript",e[e.Stylesheet=1]="Stylesheet",e}({});function i(e){const t=o[e];void 0!==t&&(t.element.remove(),delete o[e])}const a=function(e){let{resourceType:t=r.Javascript,id:n,attributes:i={},async:a=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=o[e];if(s)return s.loaded;let l;switch(t){case r.Javascript:if(l=document.createElement("script"),l.async=a,l.src=e,void 0!==n&&(l.id=n),void 0!==i)for(const e in i)l.setAttribute(e,i[e]);break;case r.Stylesheet:l=document.createElement("link"),l.href=e,l.type="text/css",l.rel="stylesheet"}const c=new Promise(((e,t)=>{l.addEventListener("load",(()=>{e()})),l.addEventListener("error",(()=>{t()}));document.getElementsByTagName("head")[0].appendChild(l)}));return o[e]={loaded:c,element:l},c}},597213:(e,t,n)=>{n.d(t,{F:()=>o});let o=function(e){return e.NotSpecified="NotSpecified",e.CreatorProfile="CreatorProfile",e.SpaceSwitcher="SpaceSwitcher",e.DeleteAccount="DeleteAccount",e.NoAvailableSpaces="NoAvailableSpaces",e.MobileNativeListener="MobileNativeListener",e.LogoutRouteVisited="LogoutRouteVisisted",e.AdminActionSelfLogout="AdminActionSelfLogout",e.AdminLogoutFallThrough="AdminActionFallThrough",e.PublicPageAccessDenied="PublicPageAccessDenied",e.PageAccessDenied="PageAccessDenied",e.OnboardingError="OnboardingError",e.OnboardingExit="OnboardingExit",e}({})},225718:(e,t,n)=>{n.d(t,{cG:()=>F,AS:()=>E,Lk:()=>D,wB:()=>I,dx:()=>x,c8:()=>$,lM:()=>Y,on:()=>Q,CK:()=>H,WB:()=>R});n(757658);var o=n(467266),r=n.n(o),i=n(653965),a=n(401898),s=n(840376),l=n(541432),c=n(180951),d=n(407057),u=n(714215),p=n(895538),m=n(761075),g=n(264572),f=n(522808),h=n(959753),v=n(421202);var y=n(719233),b=n(600606),_=n(870279),S=n(519889),k=n(421838);n(744805),n(937850);var w=n(307928);function x(e){const t=k.J7s(e);return"a"===t?"[":"b"===t?"**":"i"===t?"*":"c"===t?"`":"s"===t?"~~":"e"===t?"$":""}function I(e,t,n){const o=k.J7s(e);if(k.j0F(e)){const o=k.zW$(e),r=(0,g.A5)({...n,url:o});return`](${(r?t({toPageId:r}):o)||""})`}return"b"===o?"**":"i"===o?"*":"c"===o?"`":"s"===o?"~~":"e"===o?"$":""}function C(e){const{annotation:t,exportArgs:n}=e,{getRecordValue:o,userTimeZone:r,getExportedPathToPage:i,intl:s,transformAnnotation:l}=n,c=h.omK.fromGetRecordValueFn(o);if(l){const e=l(t,n);if("string"==typeof e)return e}if(k.IWo(t)){const e=k.zEN(t),n=o({table:S.KJ,id:e});return`@${(0,w.Nz)(s,n)}`}if(k.STW(t)){const e=k.TOT(t),r=o({table:v.iU,id:e});if(r){return`[${R({block:r,exportArgs:n})}](${i({toPageId:e})})`}}else if(k.VOE(t)){const e=k.PtE(t);var u;if(e)return null===(u=c(e))||void 0===u?void 0:u.getRenderTitle()}else{if(k.K$_(t)){var p;const e=k.r3j(t),r=o({table:_.x_,id:e,spaceId:n.root.spaceId});return null==r||null===(p=r.text)||void 0===p?void 0:p.toString()}if(k.fpG(t)){const{date_format:e,time_format:o,...i}=k.zyO(t);return(0,d.ZV)({value:i,date_format:e,time_format:o,userTimeZone:r,allowRelativeDates:!1,intl:n.intl})}if(k.kuv(t))return k.xey(t);if(k._bk(t)){const e=(0,m.kF)({annotation:t,exportArgs:n});if(e)return e}else{if(k.nSN(t)){var g;const e=k.frW(t);return null===(g=o({table:v.iU,id:e,spaceId:n.root.spaceId}))||void 0===g||null===(g=g.format)||void 0===g?void 0:g.original_url}if(k.OU5(t))return"";if(k.vuC(t)){const{href:e}=k.r0m(t);return e}if(k.inx(t)||k.j0F(t)||k.aC4(t)||k.xw5(t)||k.BIG(t)||k.pV3(t)||k.STW(t)||k.rIb(t)||k.LAI(t)||k.fTS(t)||k.aq(t)||k.QVC(t)||k.uge(t)||k.Lyt(t)||k.wjk(t)||k.Ojp(t)||k.otC(t)||k.wWS(t)||k._q_(t))return;(0,a.t1)(t)}}}function T(e){const t=/^\s+/.exec(e);return t?t[0]:""}function M(e){const t=/\s+$/.exec(e);return t?t[0]:""}function P(e){const t=M(e);return t.length>0?e.slice(0,-1*t.length):e}function A(e){const t=T(e);return e.slice(t.length)}function R(e){const{block:t,exportArgs:n}=e;return H({textValue:k.lzi(h.kk5.fromBlock(t).getProperties().title),exportArgs:n})}function D(e){const{block:t,exportArgs:n}=e,{getRecordValue:o}=n,r=t&&t.content?t.content:[];return i.oA(i.UI(r,(t=>K({block:o({table:v.iU,id:t}),exportArgs:{...n,blockId:t},visitedBlock:e.visitedBlock}))))}function B(e){return e.split("\n")}function E(e){const{block:t,exportArgs:n}=e,o=k.lzi(h.kk5.fromBlock(t).getProperties().caption);return o.length>0?[{text:H({textValue:o,exportArgs:n}),breakLines:!0,children:[]}]:[]}function F(e){const{block:t,exportArgs:n}=e;return H({textValue:k.lzi(h.kk5.fromBlock(t).getProperties().caption),exportArgs:n})}function Z(e){return{text:"",breakLines:!0,children:D(e)}}function U(){}function V(e){const{block:t,exportArgs:n}=e;return{text:`# ${R({block:t,exportArgs:n}).trim()}`,breakLines:!0,children:D(e)}}function N(e){const{block:t,exportArgs:n}=e;return{text:`- ${R({block:t,exportArgs:n}).trim()}`,breakLines:!1,childrenPrefix:z,children:D(e)}}function O(e){const{block:t,exportArgs:n}=e,{getExportedRenderAsset:o}=n,{source:r}=h.kk5.fromBlock(t).getProperties(),i=k.QaF(r),a=o({fromBlockId:n.blockId,toFileURI:i});return{text:`[${F(e)||R({block:t,exportArgs:n})||a}](${a})`,breakLines:!0,children:E(e)}}function L(e){const{block:t,exportArgs:n}=e,{getRecordValue:o,getExportedPathToPage:r,userTimeZone:i,intl:a}=n;if("collection_view"===t.type||"collection_view_page"===t.type){return{text:`[${(0,m.Ho)({blockId:t.id,getRecordValue:o,userTimeZone:i,intl:a})}](${r({toPageId:t.id,exportFileExt:".csv"})})`,breakLines:!0,children:[]}}}const j={text:function(e){const{block:t,exportArgs:n}=e;return{text:R({block:t,exportArgs:n}),breakLines:!0,children:D(e)}},header:V,sub_header:function(e){const{block:t,exportArgs:n}=e;return{text:`## ${R({block:t,exportArgs:n}).trim()}`,breakLines:!0,children:D(e)}},sub_sub_header:function(e){const{block:t,exportArgs:n}=e;return{text:`### ${R({block:t,exportArgs:n}).trim()}`,breakLines:!0,children:D(e)}},quote:function(e){const{block:t,exportArgs:n}=e;return{text:`> ${R({block:t,exportArgs:n}).trim()}`,breakLines:!0,childrenPrefix:"> ",children:D(e)}},bulleted_list:N,toggle:N,to_do:function(e){const{block:t,exportArgs:n}=e;let o;return o=c.Ml(h.kk5.fromBlock(t).getProperties().checked)?"- [x] ":"- [ ] ",{text:`${o} ${R({block:t,exportArgs:n}).trim()}`,breakLines:!1,childrenPrefix:z,children:D(e)}},numbered_list:function(e){const{block:t,exportArgs:n}=e,{getRecordValue:o}=n;return{text:`${function(e){const{block:t,getRecordValue:n}=e,o=t.parent_id,r=n({table:v.iU,id:o});let a;a=r?i.oA(i.UI(r.content,(e=>n({table:v.iU,id:e})))):[];const s=i.cx(a,(e=>e.id===t.id)),c=i.tP(a,0,s),d=i.qr(c,(e=>e.type!==l.Ti.numberedList));return c.length-(d+1)}({block:t,getRecordValue:o})+1}. ${R({block:t,exportArgs:n})}`,breakLines:!1,childrenPrefix:z,children:D(e)}},code:function(e){const{block:t,exportArgs:n}=e,o=R({block:t,exportArgs:n});return{text:`${`\`\`\`${t.properties&&t.properties.language?function(e){const t=k.QaF(e);if(!t)return"";const n=y.W[t];return void 0===n||n===y.W["Plain Text"]?"":n}(t.properties.language):""}\n${B(o).join("\n")}\n\`\`\``}`,breakLines:!0,children:[]}},page:function(e){const{block:t,exportArgs:n}=e;if(t.id===n.navigableBlockId&&!n.renderParentBlockId)return V(e);const{getExportedPathToPage:o}=n;return{text:`[${R({block:t,exportArgs:n})}](${o({toPageId:t.id})})`,breakLines:!0,children:[]}},image:function(e){const{block:t,exportArgs:n}=e,{getExportedRenderAsset:o}=n,{source:r}=h.kk5.fromBlock(t).getProperties(),i=k.QaF(r),a=o({fromBlockId:n.blockId,toFileURI:i}),s=F(e)||R({block:t,exportArgs:n})||a;return{text:(0,p.SR)({url:i})?`![${s}](${a})`:`[${s}](${a})`,breakLines:!0,children:E(e)}},video:O,embed:O,bookmark:function(e){const{block:t,exportArgs:n}=e,{link:o}=h.kk5.fromBlock(t).getProperties(),r=c.zB(o);return{text:`[${R({block:t,exportArgs:n})}](${r})`,breakLines:!0,children:E(e)}},file:O,external_object_instance:function(e){var t;const{block:n}=e,o=null===(t=n.format)||void 0===t?void 0:t.original_url;if(o)return{text:`[${o}](${o})`,breakLines:!0,children:[]}},tweet:O,maps:O,gist:O,framer:O,invision:O,mixpanel:O,drive:function(e){const{block:t}=e;if(t.format&&t.format.drive_properties){const{url:e,title:n}=t.format.drive_properties;return{text:`[${n}](${e})`,breakLines:!0,children:[]}}return O(e)},figma:O,loom:O,pdf:O,typeform:O,codepen:O,audio:O,divider:function(){return{text:"---",breakLines:!0,children:[]}},equation:function(e){const{block:t}=e;let n="";return t&&t.properties&&t.properties.title&&(n=k.QaF(t.properties.title)),{text:`$$\n${n}\n$$`,breakLines:!0,children:[]}},collection_view:L,collection_view_page:L,column_list:Z,column:Z,factory:U,personal_home_page:U,form:U,post:U,copy_indicator:U,breadcrumb:U,link_to_collection:U,link_to_page:U,callout:function(e){var t;const{block:n,exportArgs:o}=e,r=R({block:n,exportArgs:o}),i=null===(t=n.format)||void 0===t?void 0:t.page_icon;return{text:`${(0,f.Z)(i)?i:"string"==typeof i?function(e){let{source:t,width:n=40,exportArgs:o}=e;const{getExportedRenderAsset:r}=o,i=r({fromBlockId:o.blockId,toFileURI:t});return`<img src="${i}" alt="${i}" width="${n}px" />`}({source:i,exportArgs:o}):""} ${r}`.trim(),breakLines:!0,children:D(e),htmlTag:"aside"}},table_of_contents:U,whimsical:O,miro:O,abstract:O,sketch:O,excalidraw:O,replit:O,hex:O,deepnote:O,alias:function(e){const{block:t,exportArgs:n}=e,{getRecordValue:o}=n;if(t.format&&t.format.alias_pointer&&(0,b.$O)(t.format.alias_pointer,v.iU)){const r=o(t.format.alias_pointer);if(r)return K({block:r,exportArgs:{...n,renderParentBlockId:t.id,blockId:t.format.alias_pointer.id},visitedBlock:e.visitedBlock})}},slide:Z,transclusion_container:Z,transclusion_reference:function(e){const{block:t,exportArgs:n}=e,{getRecordValue:o}=n;if(t.format&&t.format.transclusion_reference_pointer){const r=o(t.format.transclusion_reference_pointer);if(r)return K({block:r,exportArgs:{...n,renderParentBlockId:t.id,blockId:t.format.transclusion_reference_pointer.id},visitedBlock:e.visitedBlock})}},table:function(e){var t;const{block:n,exportArgs:o}=e,{getRecordValue:r}=o,i=(null===(t=n.format)||void 0===t||null===(t=t.table_block_column_order)||void 0===t?void 0:t.length)||0,a=n.content,s={text:"",breakLines:!0,children:[]};if(0===i||!a)return s;const l=a.map((t=>{const i=r({table:v.iU,id:t});return i&&K({block:i,exportArgs:{...o,blockId:t,renderParentBlockId:n.id},visitedBlock:e.visitedBlock})||s})),c={text:`| ${[...Array(i).keys()].map((()=>"---")).join(" | ")} |`,breakLines:!1,children:[]};return{text:"",breakLines:!0,children:[l[0],c,...l.slice(1)]}},table_row:function(e){var t;const{block:n,exportArgs:o}=e,{getRecordValue:r,renderParentBlockId:i}=o;if(!i)return;const a=r({table:v.iU,id:i}),s=null==a||null===(t=a.format)||void 0===t?void 0:t.table_block_column_order;if(!s)return;return{text:`| ${s.map((t=>{const o=c.wS(n,t);return o?H({textValue:o,exportArgs:e.exportArgs}):void 0})).join(" | ")} |`,breakLines:!1,children:[]}},tab:function(e){var t;const{block:n,exportArgs:o}=e,{getRecordValue:r}=o;return{text:`${i.oA(null===(t=n.content)||void 0===t?void 0:t.flatMap((e=>{const t=r({table:v.iU,id:e});if(t)return[R({block:t,exportArgs:o}),q(D({block:t,exportArgs:o})).trim()]}))).join("\n\n")}\n\t\t`,breakLines:!0,children:[]}},external_object_instance_page:U,button:U,ai_block:Z,drawing:U};function K(e){const{block:t,forceRenderAsText:n,exportArgs:{transformBlockMapping:o}}=e;if(t&&t.type){if(e.visitedBlock){if(e.visitedBlock.has(t.id))return;e.visitedBlock.add(t.id)}const r=n&&(0,l.XD)(t.type,t.format)?(null==o?void 0:o.text)??j.text:(null==o?void 0:o[t.type])??j[t.type];if(r)return r(e)}}const z="    ";function q(e){let t="";for(const n of e){n.breakLines&&(t+="\n"),n.htmlTag&&(t+=`<${n.htmlTag}>\n`),n.text&&(t+=`${n.text}\n`),n.breakLines&&(t+=n.childrenPrefix?`${n.childrenPrefix}\n`:"\n");let e=q(n.children);if(e&&n.childrenPrefix){const t=B(e);e=[...t.slice(0,-1).map((e=>n.childrenPrefix+e)),...t.slice(-1)].join("\n")}t+=`${e}`,n.htmlTag&&(t+=`</${n.htmlTag}>\n\n`),n.suffix&&(t+=`${n.suffix}\n\n`)}return t=t.replace(/[\n]{3,}/g,"\n\n"),t}function H(e){const{textValue:t,exportArgs:n}=e;let o="";const l=k.lzi(t);let c=[];for(const p of l){const e=s.u.normalize(k.hDy(p)),t=(0,u.N)(c,e,(e=>r()(e))),l=k.WiV(p),d=e.map((e=>C({annotation:e,exportArgs:n}))).find((e=>(0,a.$K)(e))),m=d??l,g=M(o);o=P(o),t.deleted.reverse();for(const r of t.deleted)o+=I(r,n.getExportedPathToPage,n);o+=g,o+=T(m);for(const n of t.created)o+=x(n);o+=A(m);c=[...i.DY(c,e,((e,t)=>i.Xy(e,t))),...t.created]}const d=M(o);o=P(o),c.reverse();for(const r of c)o+=I(r,n.getExportedPathToPage,n);return o+=d,o}function G(e,t){const n=(new e).match(t)||[];if(0===n.length)return t;let o="",r=0;for(const i of n){const e=0===i.index||"<"!==t[i.index-1],n=i.lastIndex===t.length||">"!==t[i.lastIndex],a=Boolean(t.slice(i.index).match(/^[a-z][a-z]+:/i)),s=e&&n&&a;o+=t.slice(r,i.index),s&&(o+="<"),o+=i.raw,s&&(o+=">"),r=i.lastIndex}return o+=t.slice(r),o}function W(e){return e.replace(/\\/g,"\\\\")}function $(e){const{MarkdownIt:t,LinkifyIt:n,markdown:o,plugin:r,disable:i,options:a}=e,s=new t({linkify:!0,...a});return i&&s.disable(i,!1),r&&s.use(r),s.render(W(G(n,o)))}function Y(e){const{MarkdownIt:t,LinkifyIt:n,markdown:o,plugin:r}=e,i=new t({linkify:!0});return r&&i.use(r),i.renderInline(W(G(n,o)))}function Q(e,t){const n=new Set;return q(i.oA(e.map((e=>K({block:e,exportArgs:{...t,blockId:e.id},visitedBlock:n}))))).trim()}},403072:(e,t,n)=>{n.d(t,{E_:()=>a,GQ:()=>s,cv:()=>l});var o=n(218265),r=n(89101);const i=["creators","categories","templates","search","collections"];function a(e){const t=r._j.gallery;return(0,o.bf)({url:t,query:{}})}function s(e){for(const t of i)if(e===t)return!0;return!1}function l(e,t){let n=`${e.domainBaseUrl}/${t.name}`;t.pageType&&(n+=`/${t.pageType}`),t.slug&&(n+=`/${t.slug}`);const o=new URL(n);return t.query&&o.searchParams.append("query",encodeURIComponent(t.query)),t.preview&&o.searchParams.append("preview",encodeURIComponent("true")),t.tags&&o.searchParams.append("tags",t.tags),t.groupedTags&&o.searchParams.append("groupedTags",t.groupedTags),t.orderBy&&o.searchParams.append("orderBy",encodeURIComponent(t.orderBy)),t.paid&&o.searchParams.append("paid",encodeURIComponent(t.paid)),t.qualification&&o.searchParams.append("qualification",encodeURIComponent(t.qualification)),t.locales&&o.searchParams.append("locales",encodeURIComponent(t.locales)),t.crumbs&&o.searchParams.append("cr",encodeURIComponent(t.crumbs)),o.toString()}},449143:(e,t,n)=>{n.d(t,{NT:()=>c,XP:()=>l,lU:()=>a,lX:()=>i,p_:()=>s});var o=n(475246),r=n(421838);function i(e){return{...e.page?{page:!0,createPage:Boolean(e.createPage)}:{page:!1,createPage:!1},...e.user?{user:!0,inviteUserToWorkspace:Boolean(e.inviteUserToWorkspace),inviteUserToPage:Boolean(e.inviteUserToPage)}:{user:!1,inviteUserToWorkspace:!1,inviteUserToPage:!1},...e.date?{date:!0,reminder:Boolean(e.reminder)}:{date:!1,reminder:!1},bot:Boolean(e.bot),heading:Boolean(e.heading),group:Boolean(e.group),templateVariable:Boolean(e.templateVariable),formulaContextVariable:Boolean(e.formulaContextVariable)}}function a(e){return{...null!=e&&e.page?{page:!0,createPage:!0}:{page:!1,createPage:Boolean(null==e?void 0:e.createPage)},...null!=e&&e.user?{user:!0,inviteUserToWorkspace:!0,inviteUserToPage:!0}:{user:!1,inviteUserToWorkspace:Boolean(null==e?void 0:e.inviteUserToWorkspace),inviteUserToPage:Boolean(null==e?void 0:e.inviteUserToPage)},...null!=e&&e.date?{date:!0,reminder:!0}:{date:!1,reminder:Boolean(null==e?void 0:e.reminder)},bot:Boolean(null==e?void 0:e.bot),heading:Boolean(null==e?void 0:e.heading),group:Boolean(null==e?void 0:e.group),templateVariable:Boolean(null==e?void 0:e.templateVariable),formulaContextVariable:Boolean(null==e?void 0:e.formulaContextVariable)}}function s(e){return a({page:!e.page,createPage:!e.createPage,user:!e.user,inviteUserToWorkspace:!e.inviteUserToWorkspace,inviteUserToPage:!e.inviteUserToPage,date:!e.date,reminder:!e.reminder,bot:!e.bot,group:!e.group,heading:!e.heading,templateVariable:!e.templateVariable,formulaContextVariable:!e.formulaContextVariable})}function l(e){const{mentionAnnotation:t,currentUserId:n,getRecordModel:i}=e;return!!n&&(r._bk(t)&&function(e){var t;const{currentUserId:n,groupId:r,spaceId:i,getRecordModel:a}=e;if(!n)return!1;const s=a({table:o.bx,id:i});if(!s)return!1;return new Set(null===(t=s.getPermissionGroups().find((e=>e.id===r)))||void 0===t?void 0:t.user_ids).has(n)}({currentUserId:n,groupId:t[1],spaceId:t[2],getRecordModel:i}))}function c(e){const{textValue:t,currentUserId:n,getRecordModel:o}=e;return!!n&&r.lzi(t).some((e=>function(e){const{token:t,currentUserId:n}=e;return!(!n||!r.km_(t))&&r.hn0(t).some((e=>r.IWo(e)&&e[1]===n))}({token:e,currentUserId:n})||function(e){const{token:t,currentUserId:n,getRecordModel:o}=e;return!(!n||!r.km_(t))&&r.hn0(t).some((e=>l({mentionAnnotation:e,currentUserId:n,getRecordModel:o})))}({token:e,currentUserId:n,getRecordModel:o})))}},758203:(e,t,n)=>{n.d(t,{$B:()=>l,Bn:()=>a});const o="spoXsEWnSOsAMp",r=`<${o}>`,i=`</${o}>`;function a(e,t){return`${r}${e}|${t}${i}`}const s=new RegExp(`${r.replace(/</g,"\\<").replace(/>/g,"\\>")}(.*?)${i.replace(/</g,"\\<").replace(/>/g,"\\>")}`,"g");function l(e){if(e)return e.replace(s,"")}},144615:(e,t,n)=>{n.d(t,{Ap:()=>R,Cm:()=>O,Cy:()=>y,H7:()=>x,JK:()=>Z,JY:()=>h,Lp:()=>b,Mv:()=>T,N6:()=>_,NP:()=>P,Ns:()=>k,T0:()=>B,TA:()=>A,ZS:()=>m,bS:()=>v,e7:()=>V,h8:()=>N,iX:()=>C,jY:()=>f,je:()=>S,ji:()=>I,mC:()=>L,pD:()=>E,pb:()=>M,pz:()=>g,vb:()=>w});var o=n(307032),r=n(600606),i=n(421202),a=n(606287),s=n(213493),l=n(480396),c=n(475246),d=n(577858),u=n(429369);const p={[c.bx]:!0,[i.iU]:!0,[s.np]:!0,[a.vF]:!0,[d.zU]:!0,[u.e0]:!0,[l.yo]:!0};function m(e){return(0,r.UI)(e.table)&&!(e.table in p)?`versions/${e.id}:${e.table}:${e.spaceId}`:`versions/${e.id}:${e.table}`}function g(e){const t=e.indexOf("/");if(-1===t)return;const n=e.substring(t+1).split(":");return 2===n.length?r.dr.fromPointerLike({table:n[1],id:n[0]}):3===n.length?r.dr.fromPointerLike({table:n[1],id:n[0],spaceId:n[2]}):void 0}function f(e){return`collection/${e}`}function h(e){return`typedDatabasesListChanged/${e.spaceId}-${e.databaseType}`}function v(e){return`activity/${e}`}function y(e){return`activity/${e}`}function b(e){return`notification/${e}`}function _(e){return`activity/notification/${e}`}function S(e){return`teams_in_space/${e}`}function k(e){return`user_page_visit/${e}`}function w(e){let{botId:t,accountId:n,calendarId:r}=e;return`cron/events_updated/${t}/${n}/${(0,o.Ul)(r)}`}function x(e){let{botId:t}=e;return`cron/calendar_updated/${t}`}function I(e){let{botId:t,accountId:n,calendarId:r}=e;return`cron/calendar_selection_toggled/${t}/${n}/${(0,o.Ul)(r)}`}function C(e){let{notionUserId:t,spaceId:n}=e;return`connections/updated/${t}/${n}`}function T(e){return`backlinks/${e}`}function M(e){return`page_visit/${e}`}function P(e){return`user_shared_pages_in_space/${e.spaceId}-${e.userId}`}function A(e){return`subscription_banner/${e.spaceId}`}function R(e){return`billing_subscription_banner/${e.spaceId}`}const D="presence";function B(e){return`${D}/${e}`}function E(e){return`user_joined_teams_in_space/${e.userId}:${e.spaceId}`}const F="diagnosticPing";function Z(e){return`${F}/${e}`}const U="presence/drawing";function V(e){return`${U}/${e}`}function N(e){return`custom_emoji/${e}`}function O(e){return`current_space_permission_groups/${e}`}function L(e){return`posts_in_channel/${e.spaceId}/${e.channelId}`}},23210:(e,t,n)=>{n.d(t,{D:()=>r});var o=n(630845);function r(e){const t=o.s(e);if(t[0]){const n=t[0].href;return e.startsWith(n)&&e.slice(n.length).match(/^[^\s]+$/)?e:n}return e}},423512:(e,t,n)=>{n.d(t,{dk:()=>p,td:()=>x,uf:()=>k,IM:()=>w,Bo:()=>R,jD:()=>g,b3:()=>f,dX:()=>m,p3:()=>P,_g:()=>A,DA:()=>C});var o=n(10793),r=n.n(o),i=n(679680),a=n.n(i);class s extends WeakMap{constructor(e,t){t?(super(t),this.defaultFactory=void 0):(super(),this.defaultFactory=void 0),this.defaultFactory=e}get(e){if(!super.has(e)){const t=this.defaultFactory(e);super.set(e,t)}return super.get(e)}}var l=n(653965),c=n(401898),d=n(924211);const u=["dollar","australian_dollar","canadian_dollar","singapore_dollar","euro","pound","yen","ruble","rupee","won","yuan","real","lira","rupiah","franc","hong_kong_dollar","new_zealand_dollar","krona","norwegian_krone","mexican_peso","rand","new_taiwan_dollar","danish_krone","zloty","baht","forint","koruna","shekel","chilean_peso","philippine_peso","dirham","colombian_peso","riyal","ringgit","leu","argentine_peso","uruguayan_peso","peruvian_sol"],p="number",m=["number","number_with_commas","percent",...u];function g(e){return e?["number","number_with_commas","percent",e,...u.filter((t=>t!==e))]:m}function f(e){return"number"!==e&&"number_with_commas"!==e&&"compact"!==e&&"percent"!==e&&"bytes"!==e&&"date_range"!==e&&"date"!==e&&u.includes(e)}const h={dollar:"USD",australian_dollar:"AUD",canadian_dollar:"CAD",singapore_dollar:"SGD",euro:"EUR",pound:"GBP",yen:"JPY",ruble:"RUB",rupee:"INR",won:"KRW",yuan:"CNY",real:"BRL",lira:"TRY",rupiah:"IDR",franc:"CHF",hong_kong_dollar:"HKD",new_zealand_dollar:"NZD",krona:"SEK",norwegian_krone:"NOK",mexican_peso:"MXN",rand:"ZAR",new_taiwan_dollar:"TWD",danish_krone:"DKK",zloty:"PLN",baht:"THB",forint:"HUF",koruna:"CZK",shekel:"ILS",chilean_peso:"CLP",philippine_peso:"PHP",dirham:"AED",colombian_peso:"COP",riyal:"SAR",ringgit:"MYR",leu:"RON",argentine_peso:"ARS",uruguayan_peso:"UYU",peruvian_sol:"PEN"};const v=u.reduce(((e,t)=>(e[t]=function(e){var t;return(null===(t=new Intl.NumberFormat("en-US",{currency:h[e],style:"currency"}).formatToParts(0).find((e=>"currency"===e.type)))||void 0===t?void 0:t.value)||""}(t),e)),{}),y=/[^0-9\.\,\ \-eE0123456789., -eE]/g,b=/[^0-9\.\-eeEE0123456789.-eE]/g,_=/(e\-|E\-|e-|E-)/g,S=12;function k(e,t,n,o){if(!l.hj(e)||isNaN(e))return"";if("percent"===t)return n.formatNumber(e,{style:"percent",maximumFractionDigits:S,useGrouping:!1});if(t&&(0,c.qg)(v,t))return n.formatNumber(e,{style:"currency",currencyDisplay:"symbol",currency:h[t],notation:o});if("number_with_commas"===t){const{decimal:t,integerSeparator:o}=(0,d.iF)(n);return r()({decimal:t,integerSeparator:o})(e)}if("compact"===t)return n.formatNumber(e,{notation:"compact"});if("bytes"===t)return x(e,2);{const t=e.toString();if(t.match(_)){const o=parseInt(t.split(_)[2],10);if(o<20){return e.toFixed(o)}{const{decimal:t,integerSeparator:o}=(0,d.iF)(n);return r()({decimal:t,integerSeparator:o})(e).replace(new RegExp(`\\${o}`,"g"),"")}}{const{decimal:t,integerSeparator:o}=(0,d.iF)(n);return r()({decimal:t,integerSeparator:o})(e).replace(new RegExp(`\\${o}`,"g"),"")}}}function w(e,t){const n=(e??0)/t*100;return Math.max(0,Math.min(n,100))}function x(e,t){if(0===e)return"0 bytes";const n=t<0?0:t,o=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,o)).toFixed(n))} ${["bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][o]}`}const I={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","-":"-",",":",",".":".",e:"e",E:"E","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","-":"-","e":"e","E":"E",",":",",".":"."};function C(e){let t="";if(!e)return t;for(let n=0;n<e.length;n++){const o=I[e[n]];void 0!==o&&(t+=o)}return t}class T{constructor(e){var t,n;this.group=void 0,this.decimal=void 0,this.numeral=void 0,this.numeralMap=void 0,this.convertNumeral=e=>{const t=this.numeralMap.get(e);return"number"==typeof t?t.toString():e};const o=e.formatNumberToParts(12345.6),r=[...e.formatNumber(9876543210,{useGrouping:!1})].reverse();this.numeralMap=new Map(r.map(((e,t)=>[e,t]))),this.group=new RegExp(`[${null===(t=o.find((e=>"group"===e.type)))||void 0===t?void 0:t.value}]`,"g"),this.decimal=new RegExp(`[${null===(n=o.find((e=>"decimal"===e.type)))||void 0===n?void 0:n.value}]`),this.numeral=new RegExp(`[${r.join("")}]`,"g")}parse(e){const t=(e=e.trim().replace(this.group,"").replace(this.decimal,".").replace(this.numeral,this.convertNumeral))?+e:NaN;return isNaN(t)?void 0:t}}const M=new s((e=>new T(e)));function P(e,t){if(!e)return;if(t){const n=M.get(t).parse(e);if(void 0!==n)return n}if(-1!==e.indexOf("-Infinity"))return Number.NEGATIVE_INFINITY;if(-1!==e.indexOf("Infinity"))return Number.POSITIVE_INFINITY;const n=e.replace("/","/").split("/");if(2===n.length){const[e,t]=n.map((e=>P(e)));if(0===t)return;if(void 0!==e&&void 0!==t)return e/t}const o=C(e.replace(y,"")),r=o.match(/\d(\.| )\d{3}\,\d+$/);if(r||o.match(/\,\d{2}$/)){const e=r&&r[1]?{thousands:r[1]}:{},t=a()(o,{...e,decimal:","});return isNaN(t)?void 0:t}const i=o.replace(b,""),s=a()(i);if(isNaN(s)){const e=Number.parseFloat(i);return isNaN(e)?void 0:e}return s}function A(e){const t=e.replace(/(\d)( |_)(\d\d\d)/g,"$1$3");if(/^\d+(\.\d+)?%$/.test(t))return{format:"percent",value:parseFloat(t)/100};const n=(0,c.Yd)(v).find((e=>t[0]===v[e]));if(n){const e=Number(t.slice(1));if(!l.i2(e))return{format:n,value:e}}else if(t.indexOf("0x")<0&&t.indexOf("/")<0&&t.indexOf(":")<0&&t.indexOf("-")<=0){const e=Number(t);if(!l.i2(e))return{format:"number",value:e}}}function R(e,t){switch(t){case"number":return e.formatMessage({id:"collection.numberFormat.number",defaultMessage:"Number"});case"number_with_commas":return e.formatMessage({id:"collection.numberFormat.numberWithCommas",defaultMessage:"Number with commas"});case"percent":return e.formatMessage({id:"collection.numberFormat.percent",defaultMessage:"Percent"});case"real":return e.formatMessage({id:"collection.numberFormat.brl",defaultMessage:"Real"});case"lira":return e.formatMessage({id:"collection.numberFormat.try",defaultMessage:"Lira"});case"rupiah":return e.formatMessage({id:"collection.numberFormat.idr",defaultMessage:"Rupiah"});case"dollar":return e.formatMessage({id:"collection.numberFormat.dollar",defaultMessage:"US Dollar"});case"australian_dollar":return e.formatMessage({id:"collection.numberFormat.australianDollar",defaultMessage:"Australian dollar"});case"canadian_dollar":return e.formatMessage({id:"collection.numberFormat.canadianDollar",defaultMessage:"Canadian dollar"});case"singapore_dollar":return e.formatMessage({id:"collection.numberFormat.singaporeDollar",defaultMessage:"Singapore dollar"});case"euro":return e.formatMessage({id:"collection.numberFormat.euro",defaultMessage:"Euro"});case"pound":return e.formatMessage({id:"collection.numberFormat.pound",defaultMessage:"Pound"});case"yen":return e.formatMessage({id:"collection.numberFormat.yen",defaultMessage:"Yen"});case"ruble":return e.formatMessage({id:"collection.numberFormat.ruble",defaultMessage:"Ruble"});case"rupee":return e.formatMessage({id:"collection.numberFormat.rupee",defaultMessage:"Rupee"});case"won":return e.formatMessage({id:"collection.numberFormat.won",defaultMessage:"Won"});case"yuan":return e.formatMessage({id:"collection.numberFormat.yuan",defaultMessage:"Yuan"});case"franc":return e.formatMessage({id:"collection.numberFormat.franc",defaultMessage:"Franc"});case"hong_kong_dollar":return e.formatMessage({id:"collection.numberFormat.hongKongDollar",defaultMessage:"Hong Kong dollar"});case"new_zealand_dollar":return e.formatMessage({id:"collection.numberFormat.newZealandDollar",defaultMessage:"New Zealand dollar"});case"krona":return e.formatMessage({id:"collection.numberFormat.krona",defaultMessage:"Krona"});case"norwegian_krone":return e.formatMessage({id:"collection.numberFormat.norwegianKrone",defaultMessage:"Norwegian krone"});case"mexican_peso":return e.formatMessage({id:"collection.numberFormat.mexicanPeso",defaultMessage:"Mexican peso"});case"rand":return e.formatMessage({id:"collection.numberFormat.rand",defaultMessage:"Rand"});case"new_taiwan_dollar":return e.formatMessage({id:"collection.numberFormat.newTaiwanDollar",defaultMessage:"New Taiwan dollar"});case"danish_krone":return e.formatMessage({id:"collection.numberFormat.danishKrone",defaultMessage:"Danish krone"});case"zloty":return e.formatMessage({id:"collection.numberFormat.zloty",defaultMessage:"Złoty"});case"baht":return e.formatMessage({id:"collection.numberFormat.baht",defaultMessage:"Baht"});case"forint":return e.formatMessage({id:"collection.numberFormat.forint",defaultMessage:"Forint"});case"koruna":return e.formatMessage({id:"collection.numberFormat.koruna",defaultMessage:"Koruna"});case"shekel":return e.formatMessage({id:"collection.numberFormat.shekel",defaultMessage:"Shekel"});case"chilean_peso":return e.formatMessage({id:"collection.numberFormat.chileanPeso",defaultMessage:"Chilean peso"});case"philippine_peso":return e.formatMessage({id:"collection.numberFormat.philippinePeso",defaultMessage:"Philippine peso"});case"dirham":return e.formatMessage({id:"collection.numberFormat.dirham",defaultMessage:"Dirham"});case"colombian_peso":return e.formatMessage({id:"collection.numberFormat.colombianPeso",defaultMessage:"Colombian peso"});case"riyal":return e.formatMessage({id:"collection.numberFormat.riyal",defaultMessage:"Riyal"});case"ringgit":return e.formatMessage({id:"collection.numberFormat.ringgit",defaultMessage:"Ringgit"});case"leu":return e.formatMessage({id:"collection.numberFormat.leu",defaultMessage:"Leu"});case"argentine_peso":return e.formatMessage({id:"collection.numberFormat.argentinePeso",defaultMessage:"Argentine peso"});case"uruguayan_peso":return e.formatMessage({id:"collection.numberFormat.uruguayanPeso",defaultMessage:"Uruguayan peso"});case"peruvian_sol":return e.formatMessage({id:"collection.numberFormat.peruvianSol",defaultMessage:"Peruvian sol"})}}},256589:(e,t,n)=>{function o(e,t){return t&&e.redirect_uris.includes(t)?t:t||1!==e.redirect_uris.length?void 0:e.redirect_uris[0]}n.d(t,{_:()=>o})},482036:(e,t,n)=>{n.d(t,{_:()=>o});const o={invalid_request:"invalid_request",unauthorized_client:"unauthorized_client",access_denied:"access_denied",unsupported_response_type:"unsupported_response_type",invalid_scope:"invalid_scope",server_error:"server_error",temporarily_unavailable:"temporarily_unavailable"}},433422:(e,t,n)=>{n.d(t,{FS:()=>L,bv:()=>V,EX:()=>j,lK:()=>U});n(21703),n(757658);var o=n(653965),r=n(401898),i=n(619584),a=n(340902),s=n(752147),l=n(853504),c=n(45681),d=n(159730);n(430541);function u(e,t){let n=Array.isArray(t)?t:[];return n=n.filter((t=>t!==e.id)),n}function p(e,t){let n=Array.isArray(t)?t:[];return n=n.filter((t=>t&&t.id&&t.id!==e.remove.id)),n}var m=n(959753),g=n(300482),f=n(186517),h=n(180951),v=n(600606),y=n(421202),b=n(421838);function _(e,t){const n=(0,b.bjV)(t);return T({addedValue:e.args.pointer,previousValues:n,equalityFn:S,createRemoveOpFn:t=>({pointer:e.pointer,path:e.path,command:"removePerson",args:{pointer:t}}),createAddAfterOpFn:t=>({pointer:e.pointer,path:e.path,command:"addPersonAfter",args:{pointer:t}}),createAddBeforeOpFn:(t,n)=>({pointer:e.pointer,path:e.path,command:"addPersonBefore",args:{pointer:t,before:n}})})}function S(e,t){return"me"===e||"me"===t?"me"===e&&"me"===t:v.dr.isEqualIdTable(e,t)}function k(e,t){return e.trim().toLowerCase()===t.trim().toLowerCase()}function w(e,t){const n=(0,h.Ak)(t);return T({addedValue:e.args.option,previousValues:n,equalityFn:k,createRemoveOpFn:t=>({pointer:e.pointer,path:e.path,command:"removeSelectOption",args:{option:t}}),createAddAfterOpFn:t=>({pointer:e.pointer,path:e.path,command:"addSelectOptionAfter",args:{option:t}}),createAddBeforeOpFn:(t,n)=>({pointer:e.pointer,path:e.path,command:"addSelectOptionBefore",args:{option:t,before:n}})})}function x(e){const{value:t,after:n,currentValueAtPath:r,fromTextValueFn:i,toTextValueFn:a,equalityFn:s}=e,l=C({value:t,currentValues:i(r),equalityFn:s});let c;if(n){const e=l.findIndex((e=>s(e,n)));c=o.sv([...l.slice(0,e+1),t,...l.slice(e+1)],s)}else c=o.sv([...l,t],s);return a(c)}function I(e){const{value:t,before:n,currentValueAtPath:r,fromTextValueFn:i,toTextValueFn:a,equalityFn:s}=e,l=C({value:t,currentValues:i(r),equalityFn:s});let c;if(n){const e=l.findIndex((e=>s(e,n)));c=o.sv([...l.slice(0,e),t,...l.slice(e)],s)}else c=o.sv([t,...l],s);return a(c)}function C(e){const{value:t,currentValues:n,equalityFn:o}=e;return n.filter((e=>!o(e,t)))}function T(e){const{addedValue:t,previousValues:n,equalityFn:o,createRemoveOpFn:r,createAddAfterOpFn:i,createAddBeforeOpFn:a}=e,s=n.findIndex((e=>o(e,t)));return s<0?r(t):s===n.length-1?i(t):a(t,n[s+1])}function M(e){const{removedValue:t,previousValues:n,equalityFn:o,createAddAfterOpFn:r,createAddBeforeOpFn:i}=e,a=n.findIndex((e=>o(e,t)));return a<0?r(t):0===a?i(t,n.length>1?n[1]:void 0):r(t,n[a-1])}function P(e,t){const n=(0,h.rq)(t);return T({addedValue:{id:e.args.id,spaceId:e.args.spaceId,table:y.iU},previousValues:n,equalityFn:v.dr.isEqualIdTable,createRemoveOpFn:t=>({pointer:e.pointer,path:e.path,command:"removeRelation",args:{id:t.id,spaceId:t.spaceId}}),createAddAfterOpFn:t=>({pointer:e.pointer,path:e.path,command:"addRelationAfter",args:{id:t.id,spaceId:t.spaceId}}),createAddBeforeOpFn:(t,n)=>({pointer:e.pointer,path:e.path,command:"addRelationBefore",args:{id:t.id,before:null==n?void 0:n.id,spaceId:t.spaceId}})})}var A=n(676462),R=n(364684),D=n(785370),B=n(167175);const E={set:function(e){return o.Xh(e)},update:function(e){return{...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},...o.Xh(e)}},listBefore:function(e,t){let n=Array.isArray(t)?t:[];n=u({id:e.id},n);const r=o.cx(n,(t=>t===e.before));return r>=0?n.splice(r,0,e.id):n.unshift(e.id),n},listAfter:function(e,t){let n=Array.isArray(t)?t:[];n=u({id:e.id},n);const r=o.cx(n,(t=>t===e.after));return r>=0?n.splice(r+1,0,e.id):n.push(e.id),n},listRemove:u,listReplace:function(e,t){let n=Array.isArray(t)?t:[];return n=n.map((t=>t===e.id?e.newId:t)),n},listAfterMulti:function(e,t){const n=new Set(e.ids),r=(Array.isArray(t)?t:[]).filter((e=>!n.has(e))),i=o.cx(r,(t=>t===e.after));return i>=0?r.splice(i+1,0,...e.ids):r.push(...e.ids),r},listBeforeMulti:function(e,t){const n=new Set(e.ids),r=(Array.isArray(t)?t:[]).filter((e=>!n.has(e))),i=o.cx(r,(t=>t===e.before));return i>=0?r.splice(i,0,...e.ids):r.unshift(...e.ids),r},keyedObjectListBefore:function(e,t){let n=Array.isArray(t)?t:[];n=p({remove:{id:e.value.id}},n);const r=e.before?e.before.id:void 0,i=o.cx(n,(e=>e&&e.id&&e.id===r));return i>=0?n.splice(i,0,e.value):n.unshift(e.value),n},keyedObjectListAfter:function(e,t){let n=Array.isArray(t)?t:[];n=p({remove:{id:e.value.id}},n);const r=e.after?e.after.id:void 0,i=o.cx(n,(e=>e&&e.id&&e.id===r));return i>=0?n.splice(i+1,0,e.value):n.push(e.value),n},keyedObjectListRemove:p,keyedObjectListUpdate:function(e,t){const n=Array.isArray(t)?[...t]:[],r=o.cx(n,(t=>t&&t.id&&t.id===e.value.id));return r>=0?n[r]=e.value:n.push(e.value),n},appendActivity:a.tR,setPermissionItem:f.r2,temporarySetPermissionItemForBackfill:f.p6,setSingletonPermissionItem:f.co,addRelationAfter:function(e,t){return x({value:{id:e.id,spaceId:e.spaceId,table:y.iU},after:e.after?{id:e.after,spaceId:e.spaceId,table:y.iU}:void 0,currentValueAtPath:t,fromTextValueFn:h.rq,toTextValueFn:h.ow,equalityFn:v.dr.isEqualIdTable})},addRelationBefore:function(e,t){return I({value:{id:e.id,spaceId:e.spaceId,table:y.iU},before:e.before?{id:e.before,spaceId:e.spaceId,table:y.iU}:void 0,currentValueAtPath:t,fromTextValueFn:h.rq,toTextValueFn:h.ow,equalityFn:v.dr.isEqualIdTable})},addRelations:function(e,t){const n=o.Kn(t)?t:{},r={...n};for(const o in e){const t=e[o],i=(0,h.rq)(n[o]),a=v.dr.uniq([...i,...t.map((e=>({id:e.id,spaceId:e.spaceId,table:y.iU})))]);r[o]=(0,h.ow)(a)}return r},removeRelation:function(e,t){return(0,h.ow)(C({value:{id:e.id,spaceId:e.spaceId,table:y.iU},currentValues:(0,h.rq)(t),equalityFn:v.dr.isEqualIdTable}))},addPersonAfter:function(e,t){return x({value:e.pointer,after:e.after,currentValueAtPath:t,fromTextValueFn:e=>(0,b.KSk)({value:e,includeTemplateVariables:!0}),toTextValueFn:h.BY,equalityFn:S})},addPersonBefore:function(e,t){return I({value:e.pointer,before:e.before,currentValueAtPath:t,fromTextValueFn:e=>(0,b.KSk)({value:e,includeTemplateVariables:!0}),toTextValueFn:h.BY,equalityFn:S})},removePerson:function(e,t){return(0,h.BY)(C({value:e.pointer,currentValues:(0,b.KSk)({value:t,includeTemplateVariables:!0}),equalityFn:S}))},addSelectOptionAfter:function(e,t){return x({value:e.option,after:e.after,currentValueAtPath:t,fromTextValueFn:h.Ak,toTextValueFn:h.zq,equalityFn:k})},addSelectOptionBefore:function(e,t){return I({value:e.option,before:e.before,currentValueAtPath:t,fromTextValueFn:h.Ak,toTextValueFn:h.zq,equalityFn:k})},removeSelectOption:function(e,t){const n=C({value:e.option,currentValues:(0,h.Ak)(t),equalityFn:k});return n.length>0?(0,h.zq)(n):[]},copyFile:function(e,t){const n=t.file_ids||[];return n.includes(e.fileId)?{...t}:{...t,file_ids:[...n,e.fileId]}},removeTeamMembershipItem:R.Uk,setTeamMembershipItem:R.I6};function F(e,t){return function(e,t){return e.pointer.table===y.iU&&0===e.path.length&&(0,r.Kn)(e.args)&&!Array.isArray(e.args)&&(0,r.Kn)(t)&&!Array.isArray(t)&&0===Object.keys(t).length}(e,t)?{pointer:e.pointer,path:[],command:"update",args:{alive:!1}}:{pointer:e.pointer,path:e.path,command:"set",args:i.z4(t)?null:t}}function Z(e){return void 0===e.size?1:e.size}function U(e,t){const n=t||{},r=e.path.length>0?(0,g.f4)(n,e.path):n,a=n.version?n.version+Z(e):Z(e),s=E[e.command];if(!s)throw new Error(`Unknown operation command ${e.command}.`);if(void 0!==e.expectedVersion&&n.version&&e.expectedVersion!==n.version)throw new d.vq("Mismatching expected and actual versions for the record",{clientData:{type:"operation_conflict",expectedVersion:e.expectedVersion,currentVersion:n.version,command:e.command,path:e.path,pointer:e.pointer}});const c=s(e.args,r),u=e.path.length>0?function(e,t,n){if(0===t.length)throw new d.D3("Empty path to set");const r=o.Xh(e);let i=r;for(let a=0;a<t.length;a++){const e=t[a],r=(0,g.Xc)(e)?o.cx(i,{id:e.id}):e;if(a===t.length-1)i[r]=n;else{let e=o.d9(i[r]);null==e&&(e="number"==typeof t[a+1]?[]:{}),i[r]=e,i=e}}return r}(n,e.path,c):c,p=A.ZP[e.pointer.table],m=p.requiredColumns||{},f=p.defaultColumnValues||{};for(const o of Object.keys(m))!t||i.z4(t[o])||u&&!i.z4(u[o])||(u[o]=f.hasOwnProperty(o)?f[o]:t[o]);if(u&&t){const e=t.file_ids||[];(u.file_ids||[]).length<e.length&&(u.file_ids=e)}return{...(0,l.Z)(u,"mangle-class-instances",e.path||[]),id:e.pointer.id,version:a}}function V(e,t){let n;switch(t=t||{},n=e.path.length>0?(0,g.f4)(t,e.path):t,e.command){case"set":return F(e,n);case"update":return function(e,t){t||(t={});const n={};return Object.keys(e.args).forEach((e=>{n[e]=t[e],void 0===n[e]&&(n[e]=null)})),{pointer:e.pointer,path:e.path,command:"update",args:n}}(e,n);case"listBefore":return function(e,t){const n=Array.isArray(t)?t:[],o=n.findIndex((t=>t===e.args.id));if(o>=0){if(o+1===n.length)return{pointer:e.pointer,path:e.path,command:"listAfter",args:{id:e.args.id}};const t=n[o+1];return{pointer:e.pointer,path:e.path,command:"listBefore",args:{id:e.args.id,before:t}}}return{pointer:e.pointer,path:e.path,command:"listRemove",args:{id:e.args.id}}}(e,n);case"listAfter":return function(e,t){const n=Array.isArray(t)?t:[],o=n.findIndex((t=>t===e.args.id));if(o>0){const t=n[o-1];return{pointer:e.pointer,path:e.path,command:"listAfter",args:{id:e.args.id,after:t}}}return 0===o?{pointer:e.pointer,path:e.path,command:"listBefore",args:{id:e.args.id}}:{pointer:e.pointer,path:e.path,command:"listRemove",args:{id:e.args.id}}}(e,n);case"listRemove":return function(e,t){const n=Array.isArray(t)?t:[],o=n.findIndex((t=>t===e.args.id)),r=n[o-1];return r?{pointer:e.pointer,path:e.path,command:"listAfter",args:{id:e.args.id,after:r}}:{pointer:e.pointer,path:e.path,command:"listBefore",args:{id:e.args.id}}}(e,n);case"keyedObjectListBefore":return function(e,t){const n=Array.isArray(t)?t:[],o=n.findIndex((t=>t.id===e.args.value.id));if(o>=0){if(o+1===n.length)return{pointer:e.pointer,path:e.path,command:"keyedObjectListAfter",args:e.args};const t=n[o+1];return{pointer:e.pointer,path:e.path,command:"keyedObjectListBefore",args:{value:e.args.value,before:{id:t.id}}}}return{pointer:e.pointer,path:e.path,command:"keyedObjectListRemove",args:{remove:{id:e.args.value.id}}}}(e,n);case"keyedObjectListAfter":return function(e,t){const n=Array.isArray(t)?t:[],o=n.findIndex((t=>t.id===e.args.value.id));if(o>0){const t=n[o-1];return{pointer:e.pointer,path:e.path,command:"keyedObjectListAfter",args:{value:e.args.value,after:{id:t.id}}}}return 0===o?{pointer:e.pointer,path:e.path,command:"keyedObjectListBefore",args:{value:e.args.value}}:{pointer:e.pointer,path:e.path,command:"keyedObjectListRemove",args:{remove:{id:e.args.value.id}}}}(e,n);case"keyedObjectListRemove":return function(e,t){const n=Array.isArray(t)?t:[],o=n.findIndex((t=>t.id===e.args.remove.id)),r=n[o],i=n[o-1];return r?i?{pointer:e.pointer,path:e.path,command:"keyedObjectListAfter",args:{value:r,after:{id:i.id}}}:{pointer:e.pointer,path:e.path,command:"keyedObjectListBefore",args:{value:r}}:{pointer:e.pointer,path:e.path,command:"keyedObjectListRemove",args:{remove:{id:e.args.remove.id}}}}(e,n);case"keyedObjectListUpdate":return function(e,t){t||(t={});const n=(Array.isArray(t)?t:[]).find((t=>t.id===e.args.value.id));return n?{pointer:e.pointer,path:e.path,command:"keyedObjectListUpdate",args:{value:n}}:{pointer:e.pointer,path:e.path,command:"keyedObjectListRemove",args:{remove:{id:e.args.value.id}}}}(e,n);case"addRelationAfter":case"addRelationBefore":return P(e,n);case"removeRelation":return function(e,t){const n=(0,h.rq)(t);return M({removedValue:{id:e.args.id,spaceId:e.args.spaceId,table:y.iU},previousValues:n,equalityFn:v.dr.isEqualIdTable,createAddAfterOpFn:(t,n)=>({pointer:e.pointer,path:e.path,command:"addRelationAfter",args:{id:t.id,after:null==n?void 0:n.id,spaceId:t.spaceId}}),createAddBeforeOpFn:(t,n)=>({pointer:e.pointer,path:e.path,command:"addRelationBefore",args:{id:t.id,before:null==n?void 0:n.id,spaceId:t.spaceId}})})}(e,n);case"addPersonAfter":case"addPersonBefore":return _(e,n);case"removePerson":return function(e,t){const n=(0,b.bjV)(t);return M({removedValue:e.args.pointer,previousValues:n,equalityFn:S,createAddAfterOpFn:(t,n)=>({pointer:e.pointer,path:e.path,command:"addPersonAfter",args:{pointer:t,after:n}}),createAddBeforeOpFn:(t,n)=>({pointer:e.pointer,path:e.path,command:"addPersonBefore",args:{pointer:t,before:n}})})}(e,n);case"addSelectOptionAfter":case"addSelectOptionBefore":return w(e,n);case"removeSelectOption":return function(e,t){const n=(0,h.Ak)(t);return M({removedValue:e.args.option,previousValues:n,equalityFn:k,createAddAfterOpFn:(t,n)=>({pointer:e.pointer,path:e.path,command:"addSelectOptionAfter",args:{option:t,after:n}}),createAddBeforeOpFn:(t,n)=>({pointer:e.pointer,path:e.path,command:"addSelectOptionBefore",args:{option:t,before:n}})})}(e,n);default:return}}function N(e){const{getRecordModel:t,setNewValue:n,recordOperations:o,updateOnly:r}=e;for(const i of o)if((0,g.SH)(i)){const e=(0,c.T1)(i,t.getRecordValue);for(const o of e)O({primitiveOperation:o,getRecordModel:t,setNewValue:n,updateOnly:r})}else O({primitiveOperation:i,getRecordModel:t,setNewValue:n,updateOnly:r})}function O(e){const{getRecordModel:t,setNewValue:n,primitiveOperation:o,updateOnly:r}=e,i=t.getRecordValue(o.pointer);if(!r||i){const e=U(o,i);n({pointer:o.pointer,newValue:e})}}function L(e){const{recordMap:t,operations:n,updateOnly:o}=e,r=m.omK.fromRecordMap(t),i=e=>t.setValue(e.pointer,e.newValue),a=new Map;for(const l of n)(0,B.Qf)(l)?(0,D.w)({getRecordModel:r,setNewValue:i,textInstanceBlocksMap:a,operation:l,env:s.R()}):N({getRecordModel:r,setNewValue:i,recordOperations:[l],updateOnly:o})}function j(e){const t=[],n=[];for(const o of e)(0,B.Qf)(o)?n.push(o):t.push(o);return{recordOperations:t,textOperations:n}}},269246:(e,t,n)=>{n.d(t,{Ng:()=>l,PT:()=>a,Wy:()=>c,cz:()=>i,fY:()=>d,g$:()=>s,kg:()=>o,mu:()=>r});const o="teamSidebar",r="teamBrowserSearch",i="teamBrowserUnjoinedTeams",a="teamBrowserJoinedTeams",s="publicPageTemplateIncludes",l=-1,c=[5,10,15,20,l];function d(e){const{block:t,query:n,getRecordModel:o,userTimeZone:r,intl:i}=e;if(!n)return!0;const a=null==t?void 0:t.getRenderTitle({getRecordModel:o,userTimeZone:r,intl:i});return!!a&&a.toLowerCase().indexOf(n.trim().toLowerCase())>=0}},278702:(e,t,n)=>{n.d(t,{i1:()=>p,nq:()=>u,Gc:()=>l,eJ:()=>s,Mr:()=>d,AQ:()=>c});var o=n(401898),r=n(611318);const i={cover:!0,titleWithIcon:!0,inlinePageSections:!0,expandedBacklinks:!0,discussions:!0,bottomControls:!0,editor:!0,transcript:!0,properties:!0,formTitle:!0,formSubmit:!0,formQuestion:!0,placeholder:!0,property:!0,collectionView:!1,collectionViewV2:!0};function a(e){return i[e.type]}function s(e){switch(e){case"page_main":return"page_layout_schema";case"page_details":return"page_info_layout_schema";case"form_layout_schema":return"form_layout_schema";default:(0,o.t1)(e)}}function l(e){switch(e){case"page_layout_schema":return"page_main";case"page_info_layout_schema":return"page_details";case"form_layout_schema":return"form_layout_schema";default:(0,o.t1)(e)}}function c(e){return function(e,t){return{page_layout_schema:(e.page_layout_schema??[]).filter(t),page_info_layout_schema:(e.page_info_layout_schema??[]).filter(t),form_layout_schema:(e.form_layout_schema??[]).filter(t)}}(e,a)}function d(e,t){return{page_layout_schema:(e.page_layout_schema??[]).map(t),page_info_layout_schema:(e.page_info_layout_schema??[]).map(t),form_layout_schema:(e.form_layout_schema??[]).map(t)}}function u(e){return r.g9.map((t=>e[t])).filter(o.$K).flat()}function p(e){return r.cf.map((t=>e[t])).flat()}},702512:(e,t,n)=>{n.d(t,{Dw:()=>a,h:()=>i,zR:()=>r});const o="addProperty-";function r(e){return{key:`${o}${e}`,draggable:!1}}function i(e){return e.startsWith(o)}function a(e){return e.slice(o.length)}},82009:(e,t,n)=>{n.d(t,{e:()=>o});const o={supportsPinnedProperties:e=>"stacked"!==e,supportsSidebar:e=>"stacked"!==e,canMoveToMainPage:(e,t)=>"split"!==e||"properties"!==t}},652136:(e,t,n)=>{n.d(t,{$S:()=>l,L0:()=>m,Z:()=>d,bf:()=>c,cm:()=>u});var o=n(435011),r=n(399036),i=n(888250),a=n(225985),s=n(82009);function l(e){const{module:t,layoutPreset:n}=e,o=s.e.supportsPinnedProperties(n);return"property"===t.type?c({...e,module:t}):"titleWithIcon"===t.type?(0,i.V)(t,o):t}function c(e){const{module:t}=e;let n;if(n=e.collectionSchema?e.collectionSchema[t.propertyId]:e.collectionModel.getNormalizedSchema()[t.propertyId],!n)return{type:"deleted_property",id:t.id,rawModule:t};if((0,r.U8)(n)){var i;const e=`property_${n.type}`;return{type:e,propertyId:t.propertyId,id:t.id,style:(null===(i=t.config)||void 0===i||null===(i=i[e])||void 0===i?void 0:i.style)??"compact"}}var a,s;if((0,r.G$)(n))return{type:`property_${n.type}`,propertyId:t.propertyId,id:t.id,style:(null===(a=t.config)||void 0===a||null===(a=a.property_number)||void 0===a?void 0:a.style)??"large"};if("formula"===n.type)return{type:`property_${n.type}`,propertyId:t.propertyId,id:t.id,style:(0,o.gi)(n)?(null===(s=t.config)||void 0===s||null===(s=s.property_formula)||void 0===s?void 0:s.style)??"large":"expanded"};return{type:`property_${n.type}`,propertyId:t.propertyId,id:t.id}}function d(e){const{collectionSchema:t,modules:n,layoutPreset:o,excludeDeletedProperties:r}=e,i=n.map((e=>l({collectionSchema:t,module:e,layoutPreset:o})));return r?i.filter((e=>"deleted_property"!==e.type)):i}function u(e){if((0,a.f)(e)){return{type:"property",propertyId:e.propertyId,id:e.id,style:"expanded",config:p(e)}}return"deleted_property"===e.type?e.rawModule:"normalizedTitleWithIcon"===e.type?(0,i.X)(e):e}function p(e){if((0,a.f)(e))switch(e.type){case"property_person":case"property_created_by":case"property_last_edited_by":case"property_number":case"property_formula":return{[e.type]:{style:e.style}};default:return{}}return{}}function m(e){return e.map((e=>u(e)))}},15167:(e,t,n)=>{n.d(t,{_P:()=>l,l2:()=>c,x9:()=>s});var o=n(215828),r=n(560369),i=n(652136);const a={page_main:[{id:"cover",type:"cover"},{id:"title_with_icon",type:"normalizedTitleWithIcon",supportsPinnedProperties:!0,propertyIds:[]},{id:"properties",type:"properties"},{id:"inline_page_sections",type:"inlinePageSections"},{id:"expanded_backlinks",type:"expandedBacklinks"},{id:"discussions",type:"discussions"},{id:"bottom_controls",type:"bottomControls"},{id:"editor",type:"editor"}],page_details:[],form_layout_schema:[],page_layout_preset:"stacked"};function s(){return a}function l(){return{page_layout_schema:(0,i.L0)(a.page_main).map((e=>(0,r.T)(e)?{...e,id:(0,o.ZP)()}:e)),page_info_layout_schema:(0,i.L0)(a.page_details).map((e=>(0,r.T)(e)?{...e,id:(0,o.ZP)()}:e)),form_layout_schema:void 0}}function c(e,t){const n=void 0===t?[{id:(0,o.ZP)(),type:"formQuestion",formQuestionId:e}]:[{id:(0,o.ZP)(),type:"formQuestion",formQuestionId:e},{id:(0,o.ZP)(),type:"formQuestion",formQuestionId:t}];return{page_layout_schema:void 0,page_info_layout_schema:void 0,form_layout_schema:[{id:(0,o.ZP)(),type:"cover"},{id:(0,o.ZP)(),type:"formTitle"},...n,{id:(0,o.ZP)(),type:"formSubmit"}]}}},3093:(e,t,n)=>{n.d(t,{Lr:()=>h,O4:()=>S,T8:()=>f,cb:()=>T,en:()=>g,ln:()=>C,oC:()=>I,oH:()=>k,qH:()=>p,tZ:()=>w,vX:()=>m,x8:()=>y,zh:()=>b});n(21703),n(252262),n(324506),n(757658);var o=n(653965),r=n(542297),i=n(702512);class a extends Error{constructor(e,t,n){super();const o=`propertyId: ${t} duplicated in group with id ${n.id}`;this.message=`${e} -- ${o}`,console.error("DuplicatePropertyInGroupError",this.message)}}class s extends Error{constructor(e,t){super();const n=`property groups does not contain a group with id ${t}`;this.message=`${e} -- ${n}`,console.error("MissingPropertyGroupId",this.message)}}class l extends Error{constructor(e,t){super();const n=`property groups does not contain a group at index ${t}`;this.message=`${e} -- ${n}`,console.error("MissingPropertyGroupAtIndex",this.message)}}class c extends Error{constructor(e){super();this.message=`${e} -- no groups present`,console.error("NoGroupsPresent",this.message)}}class d extends Error{constructor(e,t){super();const n=`unknown group or property id: ${t}`;this.message=`${e} -- ${n}`,console.error("UnknownGroupOrPropertyId",this.message)}}class u extends Error{constructor(e,t,n){super();const o=`property with id ${t} is not in group with id ${n}`;this.message=`${e} -- ${o}`,console.error("MissingPropertyIdInGroup",this.message)}}function p(e){var t;let{propertyGroups:n,schema:i}=e;if(!n)return;if(0===n.length)return;const a=(0,o.D9)(i,((e,t)=>!(0,r.S4)(t))),s=n.map((e=>e.propertyIds?{...e,propertyIds:e.propertyIds.filter((e=>!!a[e]))}:e)),c=(0,o.Q8)(a,(()=>!1));s.forEach((e=>{var t;null===(t=e.propertyIds)||void 0===t||t.forEach((e=>c[e]=!0))}));const d=Object.keys((0,o.D9)(c,(e=>!e))).sort();if(!d)return s;const u=null===(t=s.at(-1))||void 0===t?void 0:t.id;if(!u)throw new l("cannot add missing properties from schema to last property group",s.length-1);return b({propertyGroups:s,groupId:u,propertyIds:d})}function m(e){let{propertyGroups:t,groupId:n}=e;return t.find((e=>e.id===n))}function g(e){let{propertyGroups:t,groupId:n,errorMessageIfMissing:o}=e;const r=m({propertyGroups:t,groupId:n});if(!r)throw new s(o,n);return r}function f(e){let{propertyGroups:t}=e;const n={},o=[];return t.forEach((e=>{n[e.id]={type:"group",group:e},o.push(e.id);(e.propertyIds||[]).forEach((e=>{n[e]={type:"property"},o.push(e)}))})),{flattenedGroupsAndProperties:o,groupAndPropertyLookupMap:n}}function h(e){const{flattenedGroupsAndProperties:t,groupAndPropertyLookupMap:n}=e,o=[],r=[];for(let a=0;a<t.length;a++){const e=t[a],s=n[e];if((0,i.h)(e))continue;if(!s)throw new d("cannot create group from flattened group and property ids",e);if("property"===s.type){const t=e,n=o.at(-1);if(!n){r.push(t);continue}o[o.length-1]={...n,propertyIds:[...n.propertyIds||[],t]};continue}const l=s.group;o.push({...l,propertyIds:[]})}if(0===o.length)throw new c("cannot construct property groups from flattenedGroupsAndProperties");if(r.length>0){const e=o[0];o[0]={...e,propertyIds:[...r,...e.propertyIds||[]]}}return o}function v(e){let{propertyGroup:t,propertyId:n}=e;return!!t.propertyIds&&t.propertyIds.includes(n)}function y(e){let{propertyGroups:t,groupId:n,newValue:o}=e;const r=t.findIndex((e=>e.id===n)),i=t[r];if(-1===r)throw new s("cannot set value for property group",n);const a={...i,...o},l=[...t];return l[r]=a,l}function b(e){let{propertyGroups:t,groupId:n,propertyIds:o}=e;const r=g({propertyGroups:t,groupId:n,errorMessageIfMissing:"cannot add property to group"}),{id:i,...s}=function(e){let{propertyGroup:t,propertyIds:n}=e;return 0===n.length?{...t}:t.propertyIds?(n.forEach((e=>{if(v({propertyGroup:t,propertyId:e}))throw new a("cannot add property",e,t)})),{...t,propertyIds:[...t.propertyIds,...n]}):{...t,propertyIds:[...n]}}({propertyGroup:r,propertyIds:o});return y({propertyGroups:t,groupId:r.id,newValue:s})}function _(e){let{propertyGroups:t,groupId:n,propertyIds:o}=e;const r=g({propertyGroups:t,groupId:n,errorMessageIfMissing:"cannot add property to group"}),{id:i,...s}=function(e){let{propertyGroup:t,propertyIds:n}=e;return 0===n.length?{...t}:t.propertyIds?(n.forEach((e=>{if(v({propertyGroup:t,propertyId:e}))throw new a("cannot add property",e,t)})),{...t,propertyIds:[...n,...t.propertyIds]}):{...t,propertyIds:[...n]}}({propertyGroup:r,propertyIds:o});return y({propertyGroups:t,groupId:r.id,newValue:s})}function S(e){let{propertyGroups:t,propertyId:n}=e;return t.map((e=>function(e){let{propertyGroup:t,propertyId:n}=e;if(!t.propertyIds)return{...t};const o=t.propertyIds.filter((e=>e!==n));return{...t,propertyIds:o}}({propertyGroup:e,propertyId:n})))}function k(e){let{propertyGroup:t,newPartialProperties:n}=e;const o=t.propertyIds;if(!o)return{...t};const r={};o.forEach((e=>r[e]=!0)),n.forEach((e=>{if(!r[e])throw new u("cannot update property order",e,t.id)}));const i={};n.forEach((e=>{i[e]=!0}));const a=o.filter((e=>!i[e])),s=[...n,...a];return{...t,propertyIds:s}}function w(e){let{propertyGroups:t,groupId:n}=e;const o=m({propertyGroups:t,groupId:n});if(!o)return[...t];if(1===t.length)return;if(null==o||!o.propertyIds||0===o.propertyIds.length)return x({propertyGroups:t,groupId:n});const r=t.findIndex((e=>e.id===n));if(r<0)throw new s("Cannot determine index of property group to delete",n);if(0===r){const e=t.at(1);if(!e)throw new l("cannot find second group to add properties to",1);return x({propertyGroups:_({propertyGroups:t,groupId:e.id,propertyIds:o.propertyIds}),groupId:n})}const i=r-1,a=t.at(r-1);if(!a)throw new l("cannot find group above to to add properties to",i);return x({propertyGroups:b({propertyGroups:t,groupId:a.id,propertyIds:o.propertyIds}),groupId:n})}function x(e){let{propertyGroups:t,groupId:n}=e;return t.filter((e=>e.id!==n))}function I(e){let{propertyGroups:t,groupId:n}=e;const o=g({propertyGroups:t,groupId:n,errorMessageIfMissing:"cannot add property to group"}),r=t.findIndex((e=>e.id===n));if(r<0)throw new s("Cannot determine index of property group to move",n);if(0===r)return[...t];const i=r-1,a=t.at(r-1);if(!a)throw new l("cannot find group above to to swap with",i);const c=[...t];return c[i]=o,c[r]=a,c}function C(e){let{propertyGroups:t,groupId:n}=e;const o=g({propertyGroups:t,groupId:n,errorMessageIfMissing:"cannot add property to group"}),r=t.findIndex((e=>e.id===n));if(r<0)throw new s("Cannot determine index of property group to move",n);if(r===t.length-1)return[...t];const i=r+1,a=t.at(r+1);if(!a)throw new l("cannot find group below to to swap with",i);const c=[...t];return c[i]=o,c[r]=a,c}function T(e){let{propertyGroups:t,propertyId:n,destinationGroupId:o}=e;if(v({propertyGroup:g({propertyGroups:t,groupId:o,errorMessageIfMissing:"cannot move property to group"}),propertyId:n}))return t;return b({propertyGroups:S({propertyGroups:t,propertyId:n}),groupId:o,propertyIds:[n]})}},888250:(e,t,n)=>{function o(e){const t=e.supportsPinnedProperties?e.propertyIds:e.rawPropertyIds;return{id:e.id,type:"titleWithIcon",propertyIds:0===(null==t?void 0:t.length)?void 0:t}}function r(e,t){return t?{id:e.id,type:"normalizedTitleWithIcon",supportsPinnedProperties:!0,propertyIds:e.propertyIds??[]}:{id:e.id,type:"normalizedTitleWithIcon",supportsPinnedProperties:!1,rawPropertyIds:e.propertyIds}}n.d(t,{V:()=>r,X:()=>o})},560369:(e,t,n)=>{n.d(t,{T:()=>a,s:()=>i});const o={normalizedTitleWithIcon:!0,properties:!0,property_number:!0,property_title:!0,property_person:!0,property_file:!0,property_text:!0,property_checkbox:!0,property_url:!0,property_email:!0,property_phone_number:!0,property_created_by:!0,property_last_edited_by:!0,property_button:!0,property_select:!0,property_multi_select:!0,property_status:!0,property_date:!0,property_created_time:!0,property_last_edited_time:!0,property_last_visited_time:!0,property_relation:!0,property_rollup:!0,property_formula:!0,property_auto_increment_id:!0,property_location:!0,property_verification:!0,collectionView:!0,collectionViewV2:!0,formQuestion:!0,placeholder:!0,deleted_property:!1,cover:!1,inlinePageSections:!1,expandedBacklinks:!1,discussions:!1,bottomControls:!1,editor:!1,transcript:!1,formTitle:!1,formSubmit:!1},r={properties:!0,property:!0,collectionView:!0,collectionViewV2:!0,formQuestion:!0,placeholder:!0,titleWithIcon:!0,cover:!1,inlinePageSections:!1,expandedBacklinks:!1,discussions:!1,bottomControls:!1,editor:!1,transcript:!1,formTitle:!1,formSubmit:!1};function i(e){return o[e.type]}function a(e){return r[e.type]}},225985:(e,t,n)=>{n.d(t,{o1:()=>l,xV:()=>a,f:()=>r});const o={property_number:!0,property_title:!0,property_person:!0,property_file:!0,property_text:!0,property_checkbox:!0,property_url:!0,property_email:!0,property_phone_number:!0,property_created_by:!0,property_last_edited_by:!0,property_button:!0,property_select:!0,property_multi_select:!0,property_status:!0,property_date:!0,property_created_time:!0,property_last_edited_time:!0,property_last_visited_time:!0,property_relation:!0,property_rollup:!0,property_formula:!0,property_auto_increment_id:!0,property_location:!0,property_verification:!0};function r(e){return Boolean(e&&e.type in o)}const i={property_person:!0,property_created_by:!0,property_last_edited_by:!0};function a(e){return e.type in i}const s={collectionView:!0,collectionViewV2:!0};function l(e){return e.type in s}},463306:(e,t,n)=>{n.d(t,{$t:()=>Q,BW:()=>B,C8:()=>F,DW:()=>E,GR:()=>G,KP:()=>W,OJ:()=>N,Pz:()=>O,Wq:()=>H,YL:()=>Y,YP:()=>J,Zg:()=>V,bs:()=>j,el:()=>Z,gc:()=>te,hI:()=>D,ne:()=>U,om:()=>q,uJ:()=>K,uv:()=>z,y:()=>$,zN:()=>L});n(757658);var o=n(653965),r=n(401898),i=n(541432),a=n(516691),s=n(959753),l=n(772141),c=n(673360),d=n(74446),u=n(600606),p=n(554368),m=n(908542),g=n(789320),f=n(798963),h=n(718844),v=n(421202),y=n(177420),b=n(606287),_=n(213493),S=n(870279),k=n(244312),w=n(714429),x=n(509844),I=n(524836),C=n(86135),T=n(91644),M=n(475246),P=n(577858),A=n(429369),R=n(519889);function*D(e,t){let n=e;const o=new Set;for(;n;){const e=(0,a.dn)(n);if(o.has(e))break;o.add(e);const s=t(n);if(s&&(yield s),s&&(0,c.mI)(s.table)){var r,i;n=s.getParentPointer(),null!==(r=n)&&void 0!==r&&r.table&&null!==(i=n)&&void 0!==i&&i.id||(n=void 0)}else n=void 0}}function*B(e,t){for(const n of D(e,s.omK.fromGetRecordValueFn(t))){const e=t(n.pointer),o=n.table;e&&(yield{value:e,table:o})}}function E(e,t){return s.omK.is(t)?Array.from(D(e,t)):Array.from(B(e,t))}function F(e){let t=!0;for(const n of e){if(!t&&n.table===v.iU&&n.isNavigableBlock())return n;t=!1}}function Z(e){const t=L(o.Gb(e));if(!(t.length<=0))return t[0]}async function U(e,t){if(s.s85.is(t)){const n=[];for await(const o of async function*(e,t){let n=e;const o=new Set;for(;n;){const e=(0,a.dn)(n);if(o.has(e))break;o.add(e);const r=await t(n);r&&(yield r),n=r&&(0,c.tz)(r)?r.getParentPointer():void 0}}(e,t))n.push(o);return n}{const n=[];for await(const o of async function*(e,t){let n=e;const o=new Set;for(;n;){const e=(0,a.dn)(n);if(o.has(e))break;o.add(e);const r=await t(n);r&&(yield{table:n.table,value:r}),n=r&&(0,c.oK)(r)?u.dr.getParentPointerFromRecordWithParent(r):void 0}}(e,t))n.push(o);return n}}function V(e){return void 0===N(e)}function N(e){return o.sE(e,(e=>!function(e){switch(e.table){case v.iU:case P.zU:case b.vF:case _.np:case S.x_:case y.cZ:case x.K2:case k.Jd:case f.cv:case h.Xj:case I.qV:case C.FM:case T.AT:case p.y0:case w.L_:case m.t_:case g.SS:return s.kk5.isAnyModel(e)?e.parent_id&&e.alive:Boolean(e.value.parent_id&&e.value.alive);default:return e.table,!0}}(e)))}function O(e,t){if(s.omK.is(t)){return!V(E(e,t))}return!V(E(e,t))}function L(e){return e.filter((e=>{if(e.table===v.iU)if(s.kk5.isAnyModel(e)){if(e.isNavigableBlock())return!0}else if((0,i.S9)(e.value.type))return!0;return!1})).map((e=>s.kk5.isAnyModel(e)?e:e.value))}function j(e){const t=e.find((e=>e.table===A.e0));return t&&(s.kk5.isAnyModel(t)?t:t.value)}function K(e,t){if(s.omK.is(t)){return L(E(e,t))}return L(E(e,t))}function z(e,t){return E(e,s.omK.fromRecordMap(t))}function q(e,t){return E(e,s.omK.fromRecordMapWithRole(t))}function H(e,t){return E(e,d.mF.fromRecordMapWithRole(t))}function G(e){return Boolean($(e))}function W(e){return e.some((e=>e.table===v.iU&&e.isPurged()))}function $(e){return e.find((e=>e.table===M.bx?e.isDeleted():e.table===v.iU&&e.isPermanentlyDeleted()))}function Y(e,t){return te(e.map(s.kk5.fromRecordWithTable)).some((e=>{if(e.table===v.iU){return e.getPermissionItems().some((e=>{if((0,l.C2)(e)&&(0,l.Wi)(e.role))return!1;if(t.isUser()){if((0,l.jg)(e))return e.user_id===t.id}else if(t.isBot())if(t.isUserGuestBot()){if((0,l.jg)(e)){if(t.created_by_table===R.KJ)return e.user_id===t.created_by_id;(0,r.t1)(t.created_by_table)}}else if((0,l.FB)(e))return e.bot_id===t.id;return!1}))}return!1}))}function Q(e){return Boolean(ee(e))}function J(e){return function(e){return X(e,(e=>(0,l.J5)(e.role)))}(e)?"read_and_write":function(e){return X(e,(e=>(0,l.RF)(e.role)))}(e)?"comment_only":ee(e)?"reader":"none"}function X(e,t){for(const n of te(e)){if(n.table!==v.iU)continue;const e=(s.kk5.isAnyModel(n)?n.getPermissionItems():n.value.permissions||[]).find((e=>(0,l.$D)(e)&&(!t||t(e))));if(e&&(0,l.$D)(e))return e}}function ee(e){return X(e,(e=>(0,l.YX)(e.role)))}function te(e){const t=[];for(const n of e)if(t.push(n),n.table===v.iU)if(s.kk5.isAnyModel(n)){if(n.isRestricted())break}else{if((n.value&&n.value.permissions||[]).some(l.Le))break}return t}},772141:(e,t,n)=>{n.d(t,{$D:()=>W,Av:()=>i,Bc:()=>C,C2:()=>Y,D7:()=>_,FB:()=>E,Ir:()=>F,Ix:()=>V,J5:()=>b,Jy:()=>f,KK:()=>N,LW:()=>j,Le:()=>A,Lq:()=>z,RF:()=>v,RI:()=>q,RN:()=>h,RO:()=>G,UF:()=>P,VM:()=>k,WY:()=>S,Wi:()=>p,YX:()=>g,ZK:()=>l,ZQ:()=>H,an:()=>a,bm:()=>O,cY:()=>Q,dy:()=>x,e_:()=>B,fG:()=>K,gG:()=>R,hV:()=>U,iC:()=>u,jD:()=>d,jg:()=>D,o7:()=>$,p8:()=>T,rG:()=>y,rz:()=>m,tx:()=>Z,xm:()=>s,zU:()=>L,zz:()=>w});var o=n(401898),r=n(212847);const i=["none","reader","comment_only","content_only_editor","read_and_write","membership_admin","editor"],a=["editor","membership_admin","read_and_write","none"],s=Object.assign({},...i.map(((e,t)=>({[e]:t})))),l=["read_content","insert_content","update_content","read_comment","insert_comment"],c=["read_user_without_email","read_user_with_email","read_user_email_name_photo"],d={none:"none",reader:{read_content:!0,read_comment:!0},comment_only:{read_content:!0,read_comment:!0,insert_comment:!0},content_only_editor:{read_content:!0,insert_content:!0,read_comment:!0,insert_comment:!0},read_and_write:{read_content:!0,insert_content:!0,update_content:!0,read_comment:!0,insert_comment:!0},membership_admin:"none"},u=(0,o.AO)((e=>"none"===e||"reader"===e||"comment_only"===e||"content_only_editor"===e||"read_and_write"===e||"membership_admin"===e||"editor"===e?{true:e}:{false:e}));function p(e){return"none"===e}function m(e){return"string"==typeof e?"reader"===e:!0===e.read_content&&!0!==e.insert_content&&!0!==e.update_content||!0===e.read_property&&!0!==e.insert_property&&!0!==e.update_property}function g(e){return"string"==typeof e?"reader"===e||"comment_only"===e||"content_only_editor"===e||"read_and_write"===e||"membership_admin"===e||"editor"===e:!0===e.read_content||!0===e.read_property}function f(e){return"read_and_write"===e||"membership_admin"===e||"editor"===e}function h(e){return"read_and_write"===e}function v(e){return"comment_only"===e||b(e)||Boolean("object"==typeof e&&e.insert_comment)}function y(e){return"comment_only"===e}function b(e){return"content_only_editor"===e||_(e)||function(e){return w(e)||I(e)||h(e)}(e)}function _(e){return"string"==typeof e?"read_and_write"===e||"editor"===e:!0===e.insert_content||!0===e.update_content||!0===e.insert_property||!0===e.update_property}function S(e){return"content_only_editor"===e}function k(e){return"object"==typeof e&&!0===e.insert_content&&!0===e.update_content&&!0!==e.read_content}function w(e){return"editor"===e}function x(e){return"membership_admin"===e||w(e)}function I(e){return"membership_admin"===e}function C(e){return I(e)||w(e)}function T(e){const t=c;return Object.keys(e).every((e=>t.includes(e)))}const M=r.literals("none","reader","comment_only","read_and_write","membership_admin","editor"),P=(r.object({required:{type:r.literal("user_permission"),role:M,user_id:r.uuid()},optional:{invite_id:r.uuid()}}),r.object({required:{type:r.literal("group_permission"),role:M,group_id:r.uuid()},optional:{}}),["deleted_permission","restricted_permission","exclusive_user_permission","user_permission","bot_permission","group_permission","team_owner_permission","team_permission","explicit_team_guest_permission","explicit_team_permission","explicit_team_owner_permission","space_permission","trusted_domain_permission","public_permission"]);function A(e){return"restricted_permission"===e.type}function R(e){return"deleted_permission"===e.type}function D(e){return"user_permission"===e.type}function B(e){return"exclusive_user_permission"===e.type}function E(e){return"bot_id"in e&&"bot_permission"===e.type}function F(e){return"space_permission"===e.type}function Z(e){return F(e)&&Boolean(e.unlisted_timestamp)}function U(e){return"group_permission"===e.type}function V(e){return"team_permission"===e.type}function N(e){return"team_owner_permission"===e.type}function O(e){return"explicit_team_guest_permission"===e.type}function L(e){return"explicit_team_permission"===e.type}function j(e){return"explicit_team_owner_permission"===e.type}function K(e){return"explicit_team_permission"===e.type||"explicit_team_owner_permission"===e.type}function z(e){return V(e)||L(e)||N(e)||j(e)}function q(e){return V(e)||L(e)}function H(e){return N(e)||j(e)}function G(e){return"trusted_domain_permission"===e.type}function W(e){return"public_permission"===e.type}function $(e){return!!e.expiration_timestamp&&Date.now()>e.expiration_timestamp}function Y(e){return!R(e)&&!A(e)}function Q(e){return Y(e)?e.role:"none"}},834687:(e,t,n)=>{n.d(t,{GK:()=>w,QZ:()=>k});var o=n(401898),r=n(959753),i=(n(145953),n(291627),n(554368)),a=n(421202),s=n(177420),l=n(475246),c=n(665635),d=(n(591937),n(307591)),u=n(947969),p=n(429369),m=n(519889);n(21703);class g{constructor(e){this.agentPointer=void 0,this.logErrorFn=void 0;const{agentPointer:t,logErrorFn:n}=e;this.agentPointer=t,this.logErrorFn=n}getActorPointer(){return this.agentPointer}getSpaceRole(e){return"none"}getTeamRole(e){return"none"}getGroupRole(e){return"none"}}function f(e){const{undecoratedGetRecordModel:t,logErrorFn:n,from:o}=e;return r.omK.fromMonomorphicFunctionUnsafe((e=>{const r=t(e);return void 0===r&&"space_user"!==e.table&&"space_bot"!==e.table&&"space_permission_group"!==e.table&&"space_permission_group_member"!==e.table&&n({from:o,type:"NecessaryRecordWasNotProvided",error:new Error(`${o} needed the following record: ${e.table}/${e.id}, but it was not provided`),data:e}),r}),t.getRecordValue)}class h{logIfUnexpectedSpace(e){this.relevantEntities.relevantSpaceIds.has(e)||this.logErrorFn({from:"BotActorMembership",type:"NonRelevantSpaceRequested",error:new Error(`Space role was requested for ${e}, which was not a pre-determined "relevant" space id`),data:{spaceId:e}})}constructor(e){this.botPointer=void 0,this.getRecordModel=void 0,this.logErrorFn=void 0,this.memoizedSpaceRoles=void 0,this.relevantEntities=void 0;const{botPointer:t,getRecordModel:n,logErrorFn:o,relevantEntities:r}=e;this.botPointer=t,this.logErrorFn=o,this.getRecordModel=f({undecoratedGetRecordModel:n,logErrorFn:o,from:"BotActorMembership"}),this.memoizedSpaceRoles={},this.relevantEntities=r}getActorPointer(){return this.botPointer}getSpaceRole(e){this.logIfUnexpectedSpace(e);const t=this.memoizedSpaceRoles[e];if(void 0!==t)return t;const n=this.getRecordModel((0,c.HY)({botId:this.botPointer.id,spaceId:e})),o=void 0===n?"none":n.membership_type;return this.memoizedSpaceRoles[e]=o,this.memoizedSpaceRoles[e]}getTeamRole(e){return"none"}getGroupRole(e){return"none"}}n(757658);var v=n(364684);class y{logIfUnexpectedSpace(e){this.relevantEntities.relevantSpaceIds.has(e)||this.logErrorFn({from:"UserActorMembership",type:"NonRelevantSpaceRequested",error:new Error(`Space role was requested for ${e}, which was not a pre-determined "relevant" space id`),data:{spaceId:e}})}logIfUnexpectedTeam(e){const{teamId:t,spaceId:n}=e;this.relevantEntities.relevantTeamIds.has(t)||this.logErrorFn({from:"UserActorMembership",type:"NonRelevantTeamRequested",error:new Error(`Team role was requested for ${t}, which was not a pre-determined "relevant" team id`),data:{teamId:t,spaceId:n}})}logIfUnexpectedGroup(e){var t;const{groupId:n,spaceId:o}=e;null!==(t=this.relevantEntities.relevantGroupIds.get(o))&&void 0!==t&&t.has(n)||this.logErrorFn({from:"UserActorMembership",type:"NonRelevantGroupRequested",error:new Error(`Group role was requested for ${n}, which was not a pre-determined "relevant" group id`),data:e})}constructor(e){this.userPointer=void 0,this.getRecordModel=void 0,this.logErrorFn=void 0,this.relevantEntities=void 0,this.memoizedSpaceRoles=void 0,this.memoizedTeamRoles=void 0,this.memoizedSpaceToGroupMembership=void 0;const{userPointer:t,getRecordModel:n,logErrorFn:o,relevantEntities:r}=e;this.userPointer=t,this.getRecordModel=f({undecoratedGetRecordModel:n,logErrorFn:o,from:"UserActorMembership"}),this.logErrorFn=o,this.relevantEntities=r,this.memoizedSpaceRoles={},this.memoizedTeamRoles={},this.memoizedSpaceToGroupMembership={}}getActorPointer(){return this.userPointer}getSpaceRole(e){this.logIfUnexpectedSpace(e);const t=this.memoizedSpaceRoles[e];if(void 0!==t)return t;const n=this.getRecordModel((0,u.v8)({userId:this.userPointer.id,spaceId:e})),o=void 0===n?"none":n.membership_type;return this.memoizedSpaceRoles[e]=o,this.memoizedSpaceRoles[e]}getTeamRole(e){const{teamId:t,spaceId:n}=e;this.logIfUnexpectedTeam({teamId:t,spaceId:n});const r=this.memoizedTeamRoles[t];if(void 0!==r)return r;const i=this.getRecordModel({table:p.e0,id:t,spaceId:n});if(void 0===i||i.getSpaceId()!==n)return this.memoizedTeamRoles[t]="none",this.memoizedTeamRoles[t];const a=this.getSpaceRole(i.getSpaceId()),s=(0,u.L6)(a);let l=[];s&&i.isDefault()&&l.push("member"),i.getRawMembership().forEach((e=>{if("user"===e.entity_type)e.user_id===this.userPointer.id&&l.push(e.type);else if("group"===e.entity_type)if("owner"===e.type||"member"===e.type){"none"!==this.getGroupRole({spaceId:i.getSpaceId(),groupId:e.group_id})&&l.push(e.type)}else(0,o.t1)(e.type);else(0,o.t1)(e)})),s||(l=l.filter((e=>"team_level_guest"===e)));const c=(0,v.uG)(...l);return this.memoizedTeamRoles[t]=c,this.memoizedTeamRoles[t]}getGroupRole(e){const{groupId:t,spaceId:n}=e;this.logIfUnexpectedGroup({groupId:t,spaceId:n});const o=this.getSpaceRole(n);if(!(0,u.L6)(o))return"none";const r=this.memoizedSpaceToGroupMembership[n];if(r&&r[t])return r[t];r||(this.memoizedSpaceToGroupMembership[n]={});const i=this.getRecordModel((0,d.Ss)({spacePermissionGroupId:t,userId:this.userPointer.id,spaceId:n}));return i&&i.isAlive()?this.memoizedSpaceToGroupMembership[n][t]="member":this.memoizedSpaceToGroupMembership[n][t]="none",this.memoizedSpaceToGroupMembership[n][t]}}let b;b=Symbol.iterator;class _{constructor(e){this.userActorMemberships=void 0,this.botActorMemberships=void 0,this.agentActorMemberships=void 0,this.logErrorFn=void 0;const{logErrorFn:t,relevantEntities:n,getRecordModel:r,actorPointers:a}=e;this.userActorMemberships={},this.botActorMemberships={},this.agentActorMemberships={},this.logErrorFn=t;for(const l of a)l.table===m.KJ?this.userActorMemberships[l.id]=new y({userPointer:l,relevantEntities:n,logErrorFn:t,getRecordModel:r}):l.table===s.cZ?this.botActorMemberships[l.id]=new h({botPointer:l,relevantEntities:n,logErrorFn:t,getRecordModel:r}):l.table===i.y0?this.agentActorMemberships[l.id]=new g({agentPointer:l,logErrorFn:t}):(0,o.t1)(l)}getActorMembership(e){let t;if(e.table===m.KJ?t=this.userActorMemberships[e.id]:e.table===s.cZ?t=this.botActorMemberships[e.id]:e.table===i.y0?t=this.agentActorMemberships[e.id]:(0,o.t1)(e),void 0===t){const t=new Error("Requested actor did not have an actor membership");this.logErrorFn({from:"ActorMemberships",type:"MissingActorMembership",error:t,data:{actorPointer:e}})}return t}*[b](){yield*Object.values(this.userActorMemberships),yield*Object.values(this.botActorMemberships),yield*Object.values(this.agentActorMemberships)}}var S=n(772141);function k(e){const{recordMapFromWhichToFindRelevantEntities:t,alreadyKnownRelevantEntities:n}=e,r={relevantSpaceIds:new Set,relevantTeamIds:new Set,relevantGroupIds:new Map},i=e=>{null!=n&&n.relevantSpaceIds.has(e)||r.relevantSpaceIds.add(e)},s=e=>{null!=n&&n.relevantTeamIds.has(e)||r.relevantTeamIds.add(e)},d=(e,t)=>{var o;if(null!=n&&null!==(o=n.relevantGroupIds.get(t))&&void 0!==o&&o.has(e))return;const i=r.relevantGroupIds.get(t);void 0===i?r.relevantGroupIds.set(t,new Set([e])):i.add(e)},m=(e,t)=>{e.forEach((e=>{if((0,S.hV)(e))d(e.group_id,t);else if((0,S.fG)(e)||(0,S.bm)(e))s(e.team_id);else if(!((0,S.jg)(e)||(0,S.FB)(e)||!(0,S.C2)(e)||(0,S.$D)(e)||(0,S.RO)(e)||(0,S.e_)(e)||(0,S.Ir)(e)||(0,S.Ix)(e)||(0,S.KK)(e)))throw(0,o.t1)(e)}))};for(const{pointer:o,model:g}of t)if(void 0!==o.spaceId&&i(o.spaceId),o.table===l.bx)i(o.id);else if(o.table===p.e0){if(s(o.id),void 0!==g){const e=g;i(e.getSpaceId()),e.getRawMembership().forEach((t=>{"group"===t.entity_type&&d(t.group_id,e.getSpaceId())}));m(e.getPermissionItems(),e.getSpaceId());const t=e.getParentPointer();t.table===l.bx&&void 0!==t.id&&i(t.id)}}else if(o.table===u.WU){const{spaceId:e}=(0,u.KQ)(o.id);i(e)}else if(o.table===c.Zx){const{spaceId:e}=(0,c.td)(o.id);i(e)}else if(o.table===a.iU&&void 0!==g){const e=g;i(e.getSpaceId()),m(e.getPermissionItems(),e.getSpaceId())}return r}function w(e){const{recordMap:t,actorPointers:n,logErrorFn:o,getRecordModelFnWithMaybeMissingRecords:r}=e,i=k({recordMapFromWhichToFindRelevantEntities:t});return new _({getRecordModel:r,actorPointers:n,logErrorFn:o,relevantEntities:i})}},186517:(e,t,n)=>{n.d(t,{$5:()=>J,D3:()=>fe,FD:()=>le,Gx:()=>de,Gy:()=>_e,IF:()=>V,KJ:()=>A,Kf:()=>P,L2:()=>ee,OC:()=>j,Rh:()=>ae,SL:()=>Z,Ub:()=>oe,WM:()=>se,Wo:()=>X,X0:()=>W,Xr:()=>re,YO:()=>z,ZH:()=>pe,_G:()=>ne,bk:()=>ve,co:()=>M,gD:()=>x,gr:()=>U,kD:()=>ue,mq:()=>ce,nl:()=>R,oF:()=>D,p6:()=>C,pA:()=>me,qY:()=>$,r2:()=>T,uH:()=>ie,wN:()=>ye,ws:()=>I,xO:()=>N,yY:()=>F,z4:()=>he,zX:()=>q});n(757658),n(21703);var o=n(709291),r=n(653965),i=n(401898),a=n(266897),s=n(541432),l=n(715070),c=n(133728),d=n(159730),u=n(959753),p=n(463306),m=n(554368),g=n(421202),f=n(177420),h=n(933709),v=n(361220),y=n(475246),b=n(947969),_=n(429369),S=n(519889),k=(n(647425),n(364684)),w=n(772141);function x(e){return X(e).some((e=>(0,w.RO)(e)&&(0,w.YX)(e.role)))}function I(e,t){return e.some((e=>"user_permission"===e.type&&e.user_id===t))}function C(e,t){let n=t||[];return n=n.filter((t=>!P(t,e))),n.push(e),n=n.filter((e=>!(0,w.C2)(e)||"none"!==(0,w.cY)(e))),n}function T(e,t){let n=t||[];if("public_permission"===e.type){const t=n.filter((e=>(0,w.$D)(e))).map((e=>e.added_timestamp||0));t.length>0?e.added_timestamp=Math.min(...t):e.added_timestamp=(new Date).getTime()}return n=n.filter((t=>!P(t,e))),n.push(e),n=n.filter((e=>!(0,w.C2)(e)||"none"!==(0,w.cY)(e))),n}function M(e,t){const{singletonPermissionItem:n,set:o}=e;let r=t||[];return r=r.filter((e=>!P(e,n))),o&&r.push(n),r}function P(e,t){return!(!e||!t)&&((0,w.jg)(e)&&(0,w.jg)(t)||(0,w.e_)(e)&&(0,w.e_)(t)?e.user_id===t.user_id:(0,w.FB)(e)&&(0,w.FB)(t)?e.bot_id===t.bot_id:(0,w.hV)(e)&&(0,w.hV)(t)?e.group_id===t.group_id:(0,w.LW)(e)&&(0,w.LW)(t)||(0,w.zU)(e)&&(0,w.zU)(t)?e.team_id===t.team_id:e.type===t.type)}function A(e){return(0,p.gc)(e).map((e=>{if(e.table===g.iU){const t=u.kk5.isAnyModel(e)?e.getPermissionItems():e.value.permissions,n=u.kk5.isAnyModel(e)?e.id:e.value.id;if(t&&t.length>0)return{from:{table:g.iU,blockId:n},permissions:t}}else if(e.table===_.e0){const t=u.kk5.isAnyModel(e)?e.getPermissionItems():e.value.permissions,n=u.kk5.isAnyModel(e)?e.id:e.value.id;if(t&&t.length>0)return{from:{table:_.e0,teamId:n},permissions:t}}})).filter(i.$K)}function R(){let e=0,t="none";for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];for(const s of o)if("string"==typeof s)e=Math.max(e,w.Av.indexOf(s));else for(const e of(0,i.Yd)(s))s[e]&&(t=E(t,e));const a=w.Av[e];return"editor"===a||"read_and_write"===a||"membership_admin"===a?a:"none"!==t&&Object.keys(t).length?("reader"!==a&&"comment_only"!==a&&"content_only_editor"!==a||(t=E(t,"read_content")),t):a}const D=(0,i.AO)((e=>"object"==typeof e?{true:e}:{false:e})),B=(0,i.AO)((e=>(0,l.pH)(e)||(0,l.Ye)(e)||"none"===e?{true:e}:{false:e}));function E(e,t){let n;return"none"===e?"read_content"===t?n={read_content:!0}:"update_content"===t?n={update_content:!0}:"insert_content"===t?n={insert_content:!0}:"read_property"===t||"update_property"===t||"insert_property"===t?n={read_property:!0}:"read_comment"===t?n={read_comment:!0}:"insert_comment"===t?n={insert_comment:!0}:(0,i.t1)(t):(n={...e},"read_content"===t?(n.read_content=!0,delete n.read_property):"update_content"===t?(n.update_content=!0,delete n.update_property):"insert_content"===t?(n.insert_content=!0,delete n.insert_property):"read_property"===t?n.read_content||(n.read_property=!0):"update_property"===t?n.update_content||(n.update_property=!0):"insert_property"===t?n.insert_content||(n.insert_property=!0):"read_comment"===t?n.read_comment=!0:"insert_comment"===t?n.insert_comment=!0:(0,i.t1)(t)),n}function F(e,t){if("string"==typeof e&&"string"==typeof t)return V(e,t);if("string"==typeof e){if("editor"===e||"membership_admin"===e)return!0;e=w.jD[e]}if("string"==typeof t){if("editor"===t||"membership_admin"===t)return!1;t=w.jD[t]}return function(e,t){if("none"===t)return!0;if("none"===e)return!1;let n=!0;for(const o of(0,i.Yd)(t))"read_property"===o?n&&=e.read_property||e.read_content:"update_property"===o?n&&=e.update_property||e.update_content:"insert_property"===o?n&&=e.insert_property||e.insert_content:"read_content"===o?n&&=e.read_content:"update_content"===o?n&&=e.update_content:"insert_content"===o?n&&=e.insert_content:"read_comment"===o?n&&=e.read_comment:"insert_comment"===o?n&&=e.insert_comment:"link_preview"===o||"synced_database"===o||(0,i.t1)(o);return Boolean(n)}(e,t)}function Z(e,t){return w.Av.indexOf(e)<=w.Av.indexOf(t)}function U(e,t){return w.Av.indexOf(e)<w.Av.indexOf(t)}function V(e,t){return w.Av.indexOf(e)>=w.Av.indexOf(t)}function N(e,t){return w.Av.indexOf(e)>w.Av.indexOf(t)}function O(e,t){return void 0!==t?t:void 0!==e&&e}function L(e){const{inheritedPermissionToCompare:t,mostPermissivePermissionLoose:n}=e,o=n;if((0,w.tx)(o.permissionItem)&&!(0,w.tx)(t.permissionItem))return t;const r=o.permissionItem.role,i=R(r,t.permissionItem.role),a=i!==r?t:o;return{from:a.from,permissionItem:{...a.permissionItem,role:i}}}function j(e){return e?(0,w.jg)(e)||(0,w.e_)(e)?`${e.type}:${e.user_id}`:(0,w.FB)(e)?`${e.type}:${e.bot_id}`:(0,w.hV)(e)?`${e.type}:${e.group_id}`:(0,w.zU)(e)||(0,w.LW)(e)?`${e.type}:${e.team_id}`:e.type:""}function K(e){return 1===e.length?e[0]:e.reduce(((e,t)=>{if(!P(e.permissionItem,t.permissionItem))throw Error("Items should be grouped by target, but given items have different targets");return(0,w.jg)(t.permissionItem)||(0,w.e_)(t.permissionItem)||(0,w.Ir)(t.permissionItem)||(0,w.RO)(t.permissionItem)||(0,w.bm)(t.permissionItem)||(0,w.bm)(t.permissionItem)||(0,w.RI)(t.permissionItem)||(0,w.ZQ)(t.permissionItem)||(0,w.hV)(t.permissionItem)||(0,w.FB)(t.permissionItem)?L({mostPermissivePermissionLoose:e,inheritedPermissionToCompare:t}):(0,w.$D)(t.permissionItem)?function(e){const{mostPermissivePermissionLoose:t,inheritedPermissionToCompare:n}=e,o=L({mostPermissivePermissionLoose:t,inheritedPermissionToCompare:n});var r,i,a,s;return o.permissionItem={...o.permissionItem,allow_duplicate:(a=o.permissionItem.allow_duplicate,s=n.permissionItem.allow_duplicate,void 0!==s?s:void 0===a||a),allow_search_engine_indexing:O(o.permissionItem.allow_search_engine_indexing,n.permissionItem.allow_search_engine_indexing),expiration_timestamp:(r=o.permissionItem.expiration_timestamp,i=n.permissionItem.expiration_timestamp,r&&i?Math.max(r,i):r||i)},o}({mostPermissivePermissionLoose:e,inheritedPermissionToCompare:t}):(0,w.gG)(t.permissionItem)?{...e,from:t.from}:(0,w.Le)(t.permissionItem)?e:void(0,i.t1)(t.permissionItem)}),e[0])}function z(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=r.xH(e.map((e=>{const{permissions:t,from:n}=e;return t.map((e=>({from:n,permissionItem:e})))})));n.reverse();const o=r.vM(n,(e=>j(e.permissionItem))),i=r.Q8(o,K),a=new Set,s=[];for(const r of n){const e=j(r.permissionItem);a.has(e)||(a.add(e),s.push(i[e]))}if(!t){const e=s.find((e=>(0,w.gG)(e.permissionItem)));if(e)return[e]}return s}function q(e){return e.table===y.bx}function H(e){return e.table===y.bx}function G(e){return e.table===_.e0}function W(e){const{actor:t,ancestors:n,ignorePublicPermissions:o,permissionsContext:r}=e;return Y({actorOrPointer:t,ancestors:n,ignorePublicPermissions:o,permissionsContext:r})}function $(e){const{actorPointer:t,ancestors:n,ignorePublicPermissions:o,permissionsContext:r}=e;return Y({actorOrPointer:t,ancestors:n,ignorePublicPermissions:o,permissionsContext:r})}function Y(e){const{actorOrPointer:t,ancestors:n,permissionsContext:o}=e;if((0,p.GR)(n))return[];const r=(0,a.Xv)(t)?t.pointer:t;let s=Boolean(e.ignorePublicPermissions);s||(0,p.Zg)(n)||(s=!0);const l=n.find(H),d=null==l?void 0:l.getSpaceId(),u=(null==r?void 0:r.table)===f.cZ?r:void 0,g=n.find(G),v=null==g?void 0:g.pointer.id;if(u&&u.spaceId&&l&&d!==u.spaceId)return[];u&&!s&&(s=!0);const y=A(n).map((e=>{const{permissions:t,from:n}=e,a=function(e){const{actorPointer:t,actorMemberships:n,ancestorSpaceId:o,ancestorTeamId:r}=e;if(!t)return e=>!!(0,w.$D)(e);if(t.table===m.y0)throw new Error("Agents not yet supported in permissions");if(t.table===f.cZ)return e=>!((0,w.jg)(e)||(0,w.e_)(e)||(0,w.hV)(e)||(0,w.Ix)(e)||(0,w.KK)(e)||(0,w.zU)(e)||(0,w.LW)(e)||(0,w.bm)(e))&&(!(0,w.FB)(e)||e.bot_id===t.id);if(t.table===S.KJ){const e=n.getActorMembership(t);return n=>{if((0,w.FB)(n))return!1;if((0,w.Ix)(n)){if(!r||!o)return!1;const t=(null==e?void 0:e.getTeamRole({teamId:r,spaceId:o}))||"none";return(0,k.vo)({givenTeamRole:t,comparisonTeamRole:"member"})}if((0,w.KK)(n)){if(!r||!o)return!1;const t=(null==e?void 0:e.getTeamRole({teamId:r,spaceId:o}))||"none";return(0,k.vo)({givenTeamRole:t,comparisonTeamRole:"owner"})}if((0,w.jg)(n)||(0,w.e_)(n))return n.user_id===t.id;if((0,w.hV)(n)){if(!o)return!1;return"member"===(null==e?void 0:e.getGroupRole({groupId:n.group_id,spaceId:o}))}if((0,w.zU)(n)){if(!o)return!1;const t=(null==e?void 0:e.getTeamRole({teamId:n.team_id,spaceId:o}))||"none";return(0,k.vo)({givenTeamRole:t,comparisonTeamRole:"member"})}if((0,w.LW)(n)){if(!o)return!1;const t=(null==e?void 0:e.getTeamRole({teamId:n.team_id,spaceId:o}))||"none";return(0,k.vo)({givenTeamRole:t,comparisonTeamRole:"owner"})}if((0,w.bm)(n)){if(!o)return!1;return"team_level_guest"===((null==e?void 0:e.getTeamRole({teamId:n.team_id,spaceId:o}))||"none")}return!0}}(0,i.t1)(t)}({actorPointer:r,actorMemberships:o.actorMemberships,ancestorSpaceId:d,ancestorTeamId:v});return{from:n,permissions:t.filter(a)}})),_=z(y),x=(0,p.Zg)(n),I=n.some((e=>Boolean(e.table===h.qF&&e.resolved))),C=(0,a.Xv)(t)&&(0,a.uC)(t)?t:void 0,T=null==C?void 0:C.email,M=function(e){const{isAlive:t,hasResolvedDiscussion:n,ignorePublicPermissions:o,actorMemberships:r,actorPointer:a,ancestorTeamId:s,ancestorSpaceId:l,spaceModel:d,userActorEmail:u}=e;return e=>{const{permissionItem:p}=e;if(!(0,w.C2)(p))return!1;if((!t||n)&&(0,w.rz)(p.role)&&!(0,w.FB)(p))return!1;if(!o&&(0,w.$D)(p)&&!(0,w.o7)(p))return!0;if(void 0===a)return!1;if(a.table===m.y0)throw new Error("Agents not yet supported in permissions");if(a.table===f.cZ){const e=r.getActorMembership(a);if((0,w.FB)(p)&&p.bot_id===a.id)return!0;if((0,w.Ir)(p)){if(!l)return!1;const t=null==e?void 0:e.getSpaceRole(l);return Boolean(t&&"bot_owner"===t)}return!1}if(a.table===S.KJ){const e=r.getActorMembership(a);if(((0,w.jg)(p)||(0,w.e_)(p))&&p.user_id===a.id)return!0;if((0,w.Ix)(p)){if(!s||!l)return!1;const t=(null==e?void 0:e.getTeamRole({teamId:s,spaceId:l}))||"none";return(0,k.vo)({givenTeamRole:t,comparisonTeamRole:"member"})}if((0,w.KK)(p)){if(!s||!l)return!1;const t=(null==e?void 0:e.getTeamRole({teamId:s,spaceId:l}))||"none";return(0,k.vo)({givenTeamRole:t,comparisonTeamRole:"owner"})}if((0,w.zU)(p)){if(!l)return!1;const t=(null==e?void 0:e.getTeamRole({teamId:p.team_id,spaceId:l}))||"none";return(0,k.vo)({givenTeamRole:t,comparisonTeamRole:"member"})}if((0,w.LW)(p)){if(!l)return!1;const t=(null==e?void 0:e.getTeamRole({teamId:p.team_id,spaceId:l}))||"none";return(0,k.vo)({givenTeamRole:t,comparisonTeamRole:"owner"})}if((0,w.bm)(p)){if(!l)return!1;return"team_level_guest"===((null==e?void 0:e.getTeamRole({teamId:p.team_id,spaceId:l}))||"none")}if((0,w.Ir)(p)){if(!l)return!1;const t=null==e?void 0:e.getSpaceRole(l);return Boolean(t&&(0,b.L6)(t))}if((0,w.hV)(p)){if(!l)return!1;const t=null==e?void 0:e.getGroupRole({groupId:p.group_id,spaceId:l});return Boolean(t&&"none"!==t)}if((0,w.RO)(p)){const t=null==d?void 0:d.getTrustedDomains();if(!t||0===t.length)return!1;const n=l?null==e?void 0:e.getSpaceRole(l):"none";return(0,b.L6)(n??"none")||function(e,t){return void 0!==t&&(0,c.dy)(e,t)}(t,u)}return!1}(0,i.t1)(a)}}({isAlive:x,hasResolvedDiscussion:I,ignorePublicPermissions:s,actorMemberships:o.actorMemberships,actorPointer:r,ancestorTeamId:v,ancestorSpaceId:d,spaceModel:l,userActorEmail:T});return _.filter(M).map((e=>{const{from:t,permissionItem:o}=e,[r,i]=n;return _e({record:r,parent:i,from:t,permissionItem:o})?{...e,permissionItem:{...o,role:J({ancestors:n,from:t})}}:e}))}function Q(e,t){return!!t&&(t.table===e.table&&t.id===e.blockId)}function J(e){const{ancestors:t,from:n}=e;return function(e,t){if(t.table!==g.iU)return!1;const n=e.findIndex((e=>e.table===g.iU&&e.type===s.Ti.page&&e.is_template));if(n<0)return!1;const o=e[n+2];if(!o)return!1;if(o.table!==g.iU)return!1;return o.isType(s.pg)&&o.id===t.blockId}(t,n)?"comment_only":"read_and_write"}function X(e){return z(A(e)).map((e=>{let{permissionItem:t}=e;return t}))}function ee(e,t){const n=[],o=[],i=[],a=[],s={};for(const r of e){s[j(r)]=r}for(const l of t){const e=j(l);if(s[e]){const t=s[e];(0,w.C2)(t)&&(0,w.C2)(l)&&!r.Xy(t.role,l.role)?i.push([t,l]):a.push(l),delete s[e]}else n.push(l)}for(const r of Object.values(s))o.push(r);return{created:n.sort(ne),deleted:o.sort(ne),changed:i.sort(ne),unchanged:a.sort(ne)}}function te(e){return Array.isArray(e)?e[0].type:e.type}function ne(e,t){return w.UF.indexOf(te(e))-w.UF.indexOf(te(t))}function oe(e,t,n){const o=ee(t,n),r=o.unchanged.filter((e=>(0,w.C2)(e)));for(const[s,l]of o.changed){const t=R(s.role,l.role);(s.role!==l.role&&s.role!==t||be({block:e,childPermissionItem:s,parentPermissionItem:l}))&&r.push(s)}const i=[];for(const s of r){const t={pointer:e.pointer,command:"setPermissionItem",path:["permissions"],args:{...s,role:"none"}};i.push(t)}const a={pointer:e.pointer,command:"setSingletonPermissionItem",path:["permissions"],args:{singletonPermissionItem:{type:"restricted_permission"},set:!1}};return i.push(a),i}function re(e,t,n){const o=[],r=ee(t,n);for(const i of r.created)if((0,w.C2)(i)){const e={...i,role:"none"};o.push([e,i])}for(const[i,a]of r.changed){const t=R(i.role,a.role);i.role===a.role||i.role===t||be({block:e,childPermissionItem:i,parentPermissionItem:a})||o.push([i,a])}return o}function ie(e){if(e){const{read_user_without_email:t,read_user_with_email:n,inherit_creator_permissions:o,link_preview:r,synced_database:i,webhooks:a,workspace_search:s,workspace_page_export:l,read_teamspace:c,...d}=e;if(B(d))return d}return"none"}function ae(e){if(!e)return{};const{read_user_with_email:t,read_user_without_email:n}=e;return n&&t?{read_user_without_email:n,read_user_with_email:t}:n?{read_user_without_email:n}:{}}function se(e){if(!e)return{};const{link_preview:t,synced_database:n}=e;return t&&n?{link_preview:t,synced_database:n}:t?{link_preview:t}:{}}function le(e){return Boolean(e&&e.inherit_creator_permissions)}const ce=(0,o.defineMessages)({adminLabel:{id:"userPermissionsMenu.adminItem.label",defaultMessage:"Admin"},adminCaption:{id:"userPermissionsMenu.adminItem.caption",defaultMessage:"Can change workspace settings and invite new members to the workspace."},workspaceOwnerLabel:{id:"userPermissionsMenu.workspaceOwnerItem.label",defaultMessage:"Workspace owner"},workspaceOwnerCaption:{id:"userPermissionsMenu.workspaceOwnerItem.caption",defaultMessage:"Can change workspace settings and invite new members to the workspace."},membershipAdminLabel:{id:"userPermissionsMenu.membershipAdminItem.label",defaultMessage:"Membership admin"},membershipAdminCaption:{id:"userPermissionsMenu.membershipAdminItem.caption",defaultMessage:"Can manage workspace and group membership."},fullAccessLabel:{id:"userPermissionsMenu.fullAccessItem.label",defaultMessage:"Full access"},fullAccessCaption:{id:"userPermissionsMenu.fullAccessItem.caption",defaultMessage:"Can edit and share with others."},fullAccessCaptionV2:{id:"userPermissionsMenu.fullAccessItem.caption2",defaultMessage:"Edit, suggest, comment, and share with others"},requestFullAccessLabel:{id:"userPermissionsMenu.requestFullAccessItem.label",defaultMessage:"Request full access"},memberLabel:{id:"userPermissionsMenu.memberItem.label",defaultMessage:"Member"},memberCaption:{id:"userPermissionsMenu.memberItem.caption",defaultMessage:"Cannot change workspace settings or invite new members to the workspace."},canEditLabel:{id:"userPermissionsMenu.canEditItem.label",defaultMessage:"Can edit"},canEditCaption:{id:"userPermissionsMenu.canEditItem.caption",defaultMessage:"Can edit, but not share with others."},canEditCaptionV2:{id:"userPermissionsMenu.canEditItem.caption2",defaultMessage:"Edit, suggest, and comment"},requestEditLabel:{id:"userPermissionsMenu.requestEditItem.label",defaultMessage:"Request edit access"},canEditContentLabel:{id:"userPermissionsMenu.canEditContentItem.label",defaultMessage:"Can edit content"},canEditContentCaption:{id:"userPermissionsMenu.canEditContentItem.caption",defaultMessage:"Can edit content, but can't edit the database's views or structure."},canReadLabel:{id:"userPermissionsMenu.canReadItem.label",defaultMessage:"Can view"},canReadCaption:{id:"userPermissionsMenu.canReadItem.caption",defaultMessage:"Cannot edit or share with others."},requestReadLabel:{id:"userPermissionsMenu.requestReadItem.label",defaultMessage:"Request view access"},canWriteLabel:{id:"userPermissionsMenu.canWriteItem.label",defaultMessage:"Can write."},canWriteCaption:{id:"userPermissionsMenu.canWriteItem.caption",defaultMessage:"Cannot read or share with others."},unpublishPageLabel:{id:"userPermissionsMenu.unpublishPageItem.label",defaultMessage:"Remove"},unpublishPageLabelV2:{id:"userPermissionsMenu.unpublishPageItem.label2",defaultMessage:"Unpublish site"},unpublishPageCaption:{id:"userPermissionsMenu.unpublishPageItem.caption",defaultMessage:"Unpublish this page from the web"},canCommentLabel:{id:"userPermissionsMenu.canCommentItem.label",defaultMessage:"Can comment"},canCommentCaption:{id:"userPermissionsMenu.canCommentItem.caption",defaultMessage:"Can only comment and suggest."},canCommentCaptionV2:{id:"userPermissionsMenu.canCommentItem.caption2",defaultMessage:"Suggest and comment"},requestCommentLabel:{id:"userPermissionsMenu.requestCommentItem.label",defaultMessage:"Request comment access"},mixedAccessLabel:{id:"userPermissionsMenu.mixedAccessItem.label",defaultMessage:"Mixed access"},mixedAccessCaption:{id:"userPermissionsMenu.mixedAccessItem.caption",defaultMessage:"Has mixed access."},leaveWorkspaceLabel:{id:"userPermissionsMenu.leaveWorkspaceItem.label",defaultMessage:"Leave workspace"},removeFromWorkspaceLabel:{id:"userPermissionsMenu.removeFromWorkspaceItem.label",defaultMessage:"Remove from workspace"},removeWorkspaceLabel:{id:"userPermissionsMenu.removeWorkspaceItem.label",defaultMessage:"Remove"},disabledLabel:{id:"userPermissionsMenu.disabledItem.label",defaultMessage:"Disabled"},noAccessLabel:{id:"userPermissionsMenu.noAccessItem.label",defaultMessage:"No access"},noneLabel:{id:"userPermissionsMenu.none.label",defaultMessage:"None"},guestLabel:{id:"userPermissionsMenu.guestItem.label",defaultMessage:"Guest"},pageGuestLabel:{id:"userPermissionsMenu.pageGuestItem.label",defaultMessage:"Page guest"},teamGuestLabel:{id:"userPermissionsMenu.teamGuestItem.label",defaultMessage:"Teamspace guest"},variousAccessLabel:{id:"userPermissionsMenu.canAccessItem.label",defaultMessage:"Various access"},limitedAccessLabel:{id:"userPermissionsMenu.limitedAccessItem.label",defaultMessage:"Limited access"}});function de(e,t){if(!e)throw new Error("Expected to have a role");if("none"===e)return{label:ce.noAccessLabel};if(t===y.bx||t===v.V7)return{label:ce.memberLabel,caption:ce.memberCaption};if(e.read_content&&e.update_content&&e.insert_content)return{label:ce.canEditLabel,caption:ce.canEditCaption};if(e.insert_content||e.update_content||e.read_content||e.read_comment)return{label:ce.mixedAccessLabel,caption:ce.mixedAccessCaption};if(e.insert_comment)return{label:ce.canCommentLabel,caption:ce.canCommentCaption};if(e.insert_property||e.update_property||e.read_property)throw new Error("Unsupported permission role");(0,i.t1)(e)}function ue(e,t){if(D(e)){const{label:n}=de(e,t);return n}return"reader"===e?ce.canReadLabel:"editor"===e?ce.fullAccessLabel:"read_and_write"===e?ce.canEditLabel:"content_only_editor"===e?ce.canEditContentLabel:"comment_only"===e?ce.canCommentLabel:"none"===e?ce.noAccessLabel:"membership_admin"===e?ce.membershipAdminLabel:void(0,i.t1)(e)}function pe(e){switch(e){case"owner":return ce.workspaceOwnerLabel;case"membership_admin":return ce.membershipAdminLabel;case"member":return ce.memberLabel;case"none":case"page_guest":return ce.noneLabel;default:(0,i.t1)(e)}}async function me(e){const t=await async function(e){const{spaceId:t,inheritedPermissionItemsForPage:n,loadRecordModel:o,teamHasTeamLevelGuestsCache:r}=e,a={shared_internally:!1,shared_externally:!1,shared_to_web:!1,private:!1,shared_with_trusted_domain:!1},s=n.filter((e=>!(0,w.Le)(e)));if(1===s.length&&(0,w.jg)(s[0]))return a.private=!0,a;const l=s.filter((e=>(0,w.jg)(e)||(0,w.e_)(e))).map((e=>(0,b.v8)({spaceId:t,userId:e.user_id}))),c=await o(l),d=async e=>{const n={table:"team",id:e,spaceId:t},r=await o(n);return(null==r?void 0:r.hasTeamLevelGuests())??!1};for(const u of s)switch(u.type){case"user_permission":case"exclusive_user_permission":const e=(0,b.v8)({spaceId:t,userId:u.user_id}),n=c.getModel(e);null!=n&&n.isMember()?a.shared_internally=!0:a.shared_externally=!0;continue;case"explicit_team_owner_permission":case"explicit_team_permission":case"explicit_team_guest_permission":const o=u.team_id;(void 0!==(null==r?void 0:r[o])?r[o]:await d(o))?a.shared_externally=!0:a.shared_internally=!0;continue;case"bot_permission":a.shared_externally=!0;continue;case"group_permission":case"space_permission":a.shared_internally=!0;continue;case"public_permission":a.shared_to_web=!0;break;case"deleted_permission":case"restricted_permission":case"team_owner_permission":case"team_permission":case"trusted_domain_permission":continue;default:(0,i.t1)(u)}return a}(e);return ge(t)}function ge(e){return e.shared_to_web?"shared_to_web":e.shared_externally?"shared_externally":e.shared_with_trusted_domain?"shared_with_trusted_domain":e.shared_internally?"shared_internally":"private"}function fe(e){switch(e.type){case"explicit_team_owner_permission":case"explicit_team_guest_permission":case"explicit_team_permission":return e.team_id;case"bot_permission":return e.bot_id;case"exclusive_user_permission":case"user_permission":return e.user_id;case"group_permission":return e.group_id;case"public_permission":case"team_permission":case"team_owner_permission":case"deleted_permission":case"restricted_permission":case"space_permission":case"trusted_domain_permission":return;default:(0,i.t1)(e)}}function he(e,t){return R(e,t)===e}function ve(e){let{teamValue:t,permissionRole:n}=e;const o=(0,k.xC)(t);if(!o)throw new d.p8("Couldn't find team's default permission");return R(n,o)===o&&n!==o}function ye(e){const{userId:t,teamsThatUserIsANonGuestMemberOf:n,spaceMembers:o}=e,r=n.filter((e=>!e.isArchived()));if(1!==o.length)return!1;if(o[0].userId!==t)return!1;if(1!==r.length)return!1;return r[0].isOwner({userId:t,includeGroupMembership:!1})}function be(e){const{block:t,childPermissionItem:n,parentPermissionItem:o}=e;return!t.isCollectionView()&&"read_and_write"===n.role&&"content_only_editor"===o.role}function _e(e){const{record:t,parent:n,from:o,permissionItem:r}=e;return!!t&&(!(void 0===r.role||!(0,w.WY)(r.role))&&(o.table!==g.iU||(!Q(o,t)&&!Q(o,n)||!(!n||n.table!==o.table||"collection"===t.table||"collection_view"===t.table||!n.hasWikiBlockUri()))))}},820852:(e,t,n)=>{async function o(){const e=await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,915660,23));return await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,686405,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,447231,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,735433,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,804279,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,402731,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,951849,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,357874,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,494446,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,724115,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,652812,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,939980,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,946213,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,474307,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,979016,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,115251,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,980871,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,257065,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,124370,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,340728,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,77158,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,568232,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,368805,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,675041,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,108956,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,409220,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,27915,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,75045,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,449472,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,779812,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,927046,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,417117,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,140485,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,781295,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,524335,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,616150,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,652503,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,474277,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,662356,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,756543,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,332334,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,190319,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,737802,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,745520,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,476347,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,585153,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,466841,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,748443,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,424064,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,699729,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,861169,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,523099,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,552353,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,958704,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.bind(n,662964)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,11426,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,824371,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,13210,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,720288,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,196854,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,399945,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,286862,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,943932,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,737345,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,89485,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,180366,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,454803,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,651412,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,824540,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,128439,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,959385,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,470767,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,989865,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,312886,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,492447,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,830893,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,335266,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,590874,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,509930,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,496836,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,721029,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,65398,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,847251,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,838564,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,583082,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,305774,23)),await Promise.all([n.e(52048),n.e(72846)]).then(n.t.bind(n,973358,23)),e}n.r(t),n.d(t,{PrismLanguages:()=>r,importPrism:()=>o});let r=function(e){return e.abap="abap",e.agda="agda",e.arduino="arduino",e.bash="bash",e.basic="basic",e.bnf="bnf",e.c="c",e.clike="clike",e.clojure="clojure",e.coffeescript="coffeescript",e.coq="coq",e.cpp="cpp",e.csharp="csharp",e.css="css",e.cssExtras="css-extras",e.dart="dart",e.dhall="dhall",e.diff="diff",e.docker="docker",e.ebnf="ebnf",e.elixir="elixir",e.elm="elm",e.erlang="erlang",e.flow="flow",e.fortran="fortran",e.fsharp="fsharp",e.gherkin="gherkin",e.glsl="glsl",e.go="go",e.graphql="graphql",e.groovy="groovy",e.haskell="haskell",e.html="html",e.idris="idris",e.java="java",e.javascript="javascript",e.json="json",e.jsx="jsx",e.julia="julia",e.kotlin="kotlin",e.latex="latex",e.less="less",e.lisp="lisp",e.livescript="livescript",e.llvm="llvm",e.lua="lua",e.makefile="makefile",e.markdown="markdown",e.markup="markup",e.mathematica="mathematica",e.matlab="matlab",e.mermaid="mermaid",e.nasm="nasm",e.nix="nix",e.notion="notion",e.objectivec="objectivec",e.ocaml="ocaml",e.pascal="pascal",e.perl="perl",e.php="php",e.powershell="powershell",e.prolog="prolog",e.protobuf="protobuf",e.purescript="purescript",e.python="python",e.r="r",e.racket="racket",e.reason="reason",e.ruby="ruby",e.rust="rust",e.sass="sass",e.scala="scala",e.scheme="scheme",e.scss="scss",e.solidity="solidity",e.sql="sql",e.swift="swift",e.toml="toml",e.tsx="tsx",e.typescript="typescript",e.vbnet="vbnet",e.verilog="verilog",e.vhdl="vhdl",e.visualBasic="visual-basic",e.wasm="wasm",e.xml="xml",e.yaml="yaml",e}({})},719233:(e,t,n)=>{n.d(t,{W:()=>r,Y:()=>i});var o=n(820852);const r={ABAP:o.PrismLanguages.abap,Agda:o.PrismLanguages.agda,Arduino:o.PrismLanguages.arduino,Assembly:o.PrismLanguages.nasm,Bash:o.PrismLanguages.bash,BASIC:o.PrismLanguages.basic,BNF:o.PrismLanguages.bnf,C:o.PrismLanguages.c,"C#":o.PrismLanguages.csharp,"C++":o.PrismLanguages.cpp,Clojure:o.PrismLanguages.clojure,CoffeeScript:o.PrismLanguages.coffeescript,Coq:o.PrismLanguages.coq,CSS:o.PrismLanguages.css,Dart:o.PrismLanguages.dart,Dhall:o.PrismLanguages.dhall,Diff:o.PrismLanguages.diff,Docker:o.PrismLanguages.docker,EBNF:o.PrismLanguages.ebnf,Elixir:o.PrismLanguages.elixir,Elm:o.PrismLanguages.elm,Erlang:o.PrismLanguages.erlang,"F#":o.PrismLanguages.fsharp,Flow:o.PrismLanguages.flow,Fortran:o.PrismLanguages.fortran,Gherkin:o.PrismLanguages.gherkin,GLSL:o.PrismLanguages.glsl,Go:o.PrismLanguages.go,GraphQL:o.PrismLanguages.graphql,Groovy:o.PrismLanguages.groovy,Haskell:o.PrismLanguages.haskell,HTML:o.PrismLanguages.html,Idris:o.PrismLanguages.idris,Java:o.PrismLanguages.java,JavaScript:o.PrismLanguages.jsx,JSON:o.PrismLanguages.json,Julia:o.PrismLanguages.julia,Kotlin:o.PrismLanguages.kotlin,LaTeX:o.PrismLanguages.latex,Less:o.PrismLanguages.less,Lisp:o.PrismLanguages.lisp,LiveScript:o.PrismLanguages.livescript,"LLVM IR":o.PrismLanguages.llvm,Lua:o.PrismLanguages.lua,Makefile:o.PrismLanguages.makefile,Markdown:o.PrismLanguages.markdown,Markup:o.PrismLanguages.markup,MATLAB:o.PrismLanguages.matlab,Mathematica:o.PrismLanguages.mathematica,Mermaid:o.PrismLanguages.mermaid,Nix:o.PrismLanguages.nix,"Notion Formula":o.PrismLanguages.notion,"Objective-C":o.PrismLanguages.objectivec,OCaml:o.PrismLanguages.ocaml,Pascal:o.PrismLanguages.pascal,Perl:o.PrismLanguages.perl,PHP:o.PrismLanguages.php,"Plain Text":"null",PowerShell:o.PrismLanguages.powershell,Prolog:o.PrismLanguages.prolog,Protobuf:o.PrismLanguages.protobuf,PureScript:o.PrismLanguages.purescript,Python:o.PrismLanguages.python,R:o.PrismLanguages.r,Racket:o.PrismLanguages.racket,Reason:o.PrismLanguages.reason,Ruby:o.PrismLanguages.ruby,Rust:o.PrismLanguages.rust,Sass:o.PrismLanguages.sass,Scala:o.PrismLanguages.scala,Scheme:o.PrismLanguages.scheme,Scss:o.PrismLanguages.scss,Shell:o.PrismLanguages.bash,Solidity:o.PrismLanguages.solidity,SQL:o.PrismLanguages.sql,Swift:o.PrismLanguages.swift,TOML:o.PrismLanguages.toml,TypeScript:o.PrismLanguages.tsx,"VB.Net":o.PrismLanguages.vbnet,Verilog:o.PrismLanguages.verilog,VHDL:o.PrismLanguages.vhdl,"Visual Basic":o.PrismLanguages.visualBasic,WebAssembly:o.PrismLanguages.wasm,XML:o.PrismLanguages.xml,YAML:o.PrismLanguages.yaml,"Java/C/C++/C#":o.PrismLanguages.clike},i={[o.PrismLanguages.abap]:"ABAP",[o.PrismLanguages.agda]:"Agda",[o.PrismLanguages.arduino]:"Arduino",[o.PrismLanguages.bash]:"Shell",[o.PrismLanguages.basic]:"BASIC",[o.PrismLanguages.bnf]:"BNF",[o.PrismLanguages.c]:"C",[o.PrismLanguages.clojure]:"Clojure",[o.PrismLanguages.coffeescript]:"CoffeeScript",[o.PrismLanguages.coq]:"Coq",[o.PrismLanguages.cpp]:"C++",[o.PrismLanguages.csharp]:"C#",[o.PrismLanguages.css]:"CSS",[o.PrismLanguages.dart]:"Dart",[o.PrismLanguages.dhall]:"Dhall",[o.PrismLanguages.diff]:"Diff",[o.PrismLanguages.docker]:"Docker",[o.PrismLanguages.ebnf]:"EBNF",[o.PrismLanguages.elixir]:"Elixir",[o.PrismLanguages.elm]:"Elm",[o.PrismLanguages.erlang]:"Erlang",[o.PrismLanguages.flow]:"Flow",[o.PrismLanguages.fortran]:"Fortran",[o.PrismLanguages.fsharp]:"F#",[o.PrismLanguages.gherkin]:"Gherkin",[o.PrismLanguages.glsl]:"GLSL",[o.PrismLanguages.go]:"Go",[o.PrismLanguages.graphql]:"GraphQL",[o.PrismLanguages.groovy]:"Groovy",[o.PrismLanguages.haskell]:"Haskell",[o.PrismLanguages.html]:"HTML",[o.PrismLanguages.idris]:"Idris",[o.PrismLanguages.java]:"Java",[o.PrismLanguages.javascript]:"JavaScript",[o.PrismLanguages.json]:"JSON",[o.PrismLanguages.jsx]:"JavaScript",[o.PrismLanguages.julia]:"Julia",[o.PrismLanguages.kotlin]:"Kotlin",[o.PrismLanguages.latex]:"LaTeX",[o.PrismLanguages.less]:"Less",[o.PrismLanguages.lisp]:"Lisp",[o.PrismLanguages.livescript]:"LiveScript",[o.PrismLanguages.llvm]:"LLVM IR",[o.PrismLanguages.lua]:"Lua",[o.PrismLanguages.makefile]:"Makefile",[o.PrismLanguages.markdown]:"Markdown",[o.PrismLanguages.markup]:"Markup",[o.PrismLanguages.matlab]:"MATLAB",[o.PrismLanguages.mathematica]:"Mathematica",[o.PrismLanguages.mermaid]:"Mermaid",[o.PrismLanguages.nasm]:"Assembly",[o.PrismLanguages.notion]:"Notion Formula",[o.PrismLanguages.nix]:"Nix",[o.PrismLanguages.objectivec]:"Objective-C",[o.PrismLanguages.ocaml]:"OCaml",[o.PrismLanguages.pascal]:"Pascal",[o.PrismLanguages.perl]:"Perl",[o.PrismLanguages.php]:"PHP",[o.PrismLanguages.powershell]:"PowerShell",[o.PrismLanguages.prolog]:"Prolog",[o.PrismLanguages.protobuf]:"Protobuf",[o.PrismLanguages.purescript]:"PureScript",[o.PrismLanguages.python]:"Python",[o.PrismLanguages.r]:"R",[o.PrismLanguages.racket]:"Racket",[o.PrismLanguages.reason]:"Reason",[o.PrismLanguages.ruby]:"Ruby",[o.PrismLanguages.rust]:"Rust",[o.PrismLanguages.sass]:"Sass",[o.PrismLanguages.scala]:"Scala",[o.PrismLanguages.scheme]:"Scheme",[o.PrismLanguages.scss]:"Scss",[o.PrismLanguages.solidity]:"Solidity",[o.PrismLanguages.sql]:"SQL",[o.PrismLanguages.swift]:"Swift",[o.PrismLanguages.toml]:"TOML",[o.PrismLanguages.tsx]:"TypeScript",[o.PrismLanguages.typescript]:"TypeScript",[o.PrismLanguages.vbnet]:"VB.Net",[o.PrismLanguages.verilog]:"Verilog",[o.PrismLanguages.vhdl]:"VHDL",[o.PrismLanguages.visualBasic]:"Visual Basic",[o.PrismLanguages.wasm]:"WebAssembly",[o.PrismLanguages.xml]:"XML",[o.PrismLanguages.yaml]:"YAML",[o.PrismLanguages.clike]:"Java/C/C++/C#"}},890850:(e,t,n)=>{n.d(t,{$r:()=>a,Zj:()=>i});var o=n(915157);const r="promoCode";function i(e){let{currentUserId:t,promoCode:n}=e;n?o.Z.set({userId:t,key:r,value:n}):o.Z.remove({userId:t,key:r})}function a(e){o.Z.remove({userId:e,key:r})}},606746:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(697762);const r={renderToStaticMarkup:o.uS,renderToString:o.Dq}},74446:(e,t,n)=>{n.d(t,{DH:()=>a,mF:()=>i,zF:()=>s});var o=n(401898),r=n(600606);Symbol("Record Loading Function");const i={constant(e){return this.fromMonomorphicFunctionUnsafe((()=>e))},throw(e){return this.fromMonomorphicFunctionUnsafe((()=>{throw e()}))},tryUntilFound(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.fromMonomorphicFunctionUnsafe((e=>{for(const n of t){const t=n(e);if(void 0!==t)return t}}))},fromRecordMap(e){return this.fromMonomorphicFunctionUnsafe((t=>e.getValue(t)))},fromRecordMapWithRole(e){return this.fromMonomorphicFunctionUnsafe((t=>e.getValue(t)))},fromMonomorphicFunctionUnsafe:e=>e},a={fromRecordMapWithRole:e=>t=>{const n=e.getRole(t);return"string"==typeof n?n:void 0},empty:()=>e=>{},constantForPointer:(e,t)=>n=>{if(r.dr.isEqualIdTable(n,e))return t},tryUntilFound:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{for(const n of t){const t=n(e);if((0,o.$K)(t))return t}}}},s={fromGetRecordValueFn(e){return this.fromMonomorphicFunctionUnsafe((t=>Promise.resolve(e(t))))},fromRecordMap(e){return this.fromMonomorphicFunctionUnsafe((t=>Promise.resolve(e.getValue(t))))},fromRecordMapWithRole(e){return this.fromMonomorphicFunctionUnsafe((t=>Promise.resolve(e.getValue(t))))},sideEffect(e){return this.fromMonomorphicFunctionUnsafe((t=>e(t).then((()=>{}))))},tryUntilFound(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.fromMonomorphicFunctionUnsafe((async e=>{for(const n of t){const t=await n(e);if(void 0!==t)return t}}))},fromMonomorphicFunctionUnsafe:e=>e}},33361:(e,t,n)=>{n.d(t,{aV:()=>l,uf:()=>c,DI:()=>s});var o=n(516691);n(757658);async function r(e){const t=new Set;await i(0,e.keys.map((e=>({key:e,parentKey:void 0}))),e,t)}async function i(e,t,n,o){const r=[],s=[];for(const i of t){const{key:t,parentKey:l}=i,c=n.loadIntoMap.get(t);c?await a(t,c,l,e,r,n,o):s.push(i)}if(n.loadMultiFn){const t=await n.loadMultiFn(s.map((e=>{let{key:t}=e;return t})));for(const{key:i,parentKey:l}of s){const s=t.get(i);await a(i,s,l,e,r,n,o)}}else await Promise.all(s.map((async t=>{let{key:i,parentKey:s}=t;const l=await n.loadFn(i);await a(i,l,s,e,r,n,o)})));r.length>0&&await i(e+1,r,n,o)}async function a(e,t,n,o,r,i,a){if(i.loadIntoMap.set(e,t),void 0===t)return;const s=await i.recurFn(t,e,n,o)??[];for(const l of s){const t=i.keyToString(l);a.has(t)||(a.add(t),r.push({key:l,parentKey:e}))}}n(811045);function s(e){return e.toRecordMap()}async function l(e){await r({keys:e.recordPointers,keyToString:o.dn,recurFn:async(t,n,o,r)=>await e.recurFn(t,o,r),loadFn:e.loadRecordModel,loadMultiFn:async t=>{const n=await e.loadRecordModel(t);return{get:e=>n.getModel(e)}},loadIntoMap:{get:t=>e.recordMap.getModel(t),set(t,n){e.recordMap.setModel(t,n)}}})}async function c(e){const{loadRecordModels:t}=e;await r({keys:e.recordPointers,keyToString:o.dn,recurFn:(t,n,o,r)=>{if(t.model)return e.recurFn(t.model,t.role,o,r)},loadFn:e.loadRecordModel,loadMultiFn:t&&(async e=>{const n=await t(e);return{get(e){const t=n.getModel(e),o=n.getRole(e);if(o)return{model:t,role:o}}}}),loadIntoMap:{get(t){const n=e.recordMap.getModel(t),o=e.recordMap.getRole(t);if(o)return{model:n,role:o}},set(t,n){n&&e.recordMap.setModelAndRole(t,n.model,n.role)}}})}},498459:(e,t,n)=>{n.d(t,{Bq:()=>l,F2:()=>c});var o=n(653965),r=n(959753),i=(n(673360),n(421202)),a=(n(606287),n(519889)),s=n(421838);function l(e){if(e.table===i.iU){const t=e.value;if(t)return r.kk5.fromBlock(t).getCollectionPointer()}}function c(e){const t=s.lzi(e);return o.oA(t.map((e=>{const t=s.hDy(e),n=s.hH9(t),o=s.V8Y(t);if(n){const e=s.zEN(n);if(e)return{table:a.KJ,id:e}}else if(o){const e=s.TOT(o);if(e)return{table:i.iU,id:e}}})))}},396367:(e,t,n)=>{n.d(t,{P8:()=>v,PB:()=>f,Zv:()=>h,oN:()=>g,qB:()=>d,un:()=>p,zy:()=>u});n(757658);var o=n(709291),r=n(761514),i=n(494714),a=n(576205),s=n(399036);class l{constructor(e,t){this.variable=void 0,this.property=void 0,this.variable=e,this.property=t}getProperty(){return this.property}get(e){const t=this.getCombinatorFilter(e);if(t)return{type:"results",limit:1,filter:t}}getCombinatorFilter(e){const t=this.getPropertyFilter(e,this.variable);if(t)return{operator:"and",filters:[{property:this.property,filter:t}]}}getPropertyFilter(e,t){var n;const o=e[this.property];if(!o)return;return{operator:"status_is",value:{type:"is_option",value:null===(n=o.options)||void 0===n||null===(n=n.find((e=>e.id===t)))||void 0===n?void 0:n.value}}}}const c=(0,o.defineMessages)({current:{id:"database.filterValue.relationType.relativeSprintVariable.current",defaultMessage:"Current"},next:{id:"database.filterValue.relationType.relativeSprintVariable.next",defaultMessage:"Next"},last:{id:"database.filterValue.relationType.relativeSprintVariable.last",defaultMessage:"Last"}}),d={[i.p$]:{current:{messageDescriptor:c.current,reducer:new l(r.SF,r.b0.StatusV2)},next:{messageDescriptor:c.next,reducer:new l(r.YE,r.b0.StatusV2)},last:{messageDescriptor:c.last,reducer:new l(r.Rw,r.b0.StatusV2)}}};function u(e,t){const{filter:n,property:o}=e;if(!(0,a.e)(n)||!(0,a.vR)(n))return!1;const r=t[o];if(!r||!(0,s.p_)(r))return!1;return(0,a.YO)(n).some((e=>"relative"===e.type))}function p(e,t,n){if(!e)return!1;const o=t[n];return!!o&&m(e,n,o)}function m(e,t,n){return e===i.p$&&t===r.b0.StatusV2&&(0,s.gB)(n)}function g(e,t){return!!e&&p(t,e,r.b0.StatusV2)}function f(e){const{appUri:t,collectionSchema:n}=e;return Boolean(t&&d[t]&&g(n,t))}function h(e,t){const n=e[r.b0.StatusV2];if(!n||!m(t,r.b0.StatusV2,n))return[];return Object.keys(d[t]).filter((e=>{var t;return null===(t=n.options)||void 0===t?void 0:t.find((t=>t.id===e))}))}function v(e,t){const n=Object.entries(t).find((t=>{let[n,o]=t;return e===o}));return n?n[0]:void 0}},882883:(e,t,n)=>{n.d(t,{Ln:()=>S,Xh:()=>_,qb:()=>k,wy:()=>w});var o=n(709291),r=n(541432),i=n(180951),a=n(407057),s=n(335102),l=n(959753),c=n(421202),d=n(606287),u=n(394302),p=n(591937),m=n(519889),g=n(654584),f=n(421838),h=n(744805),v=n(463332),y=n(307928);const b=(0,o.defineMessages)({untitledTextAsString:{defaultMessage:"Untitled",id:"textRenderHelpers.untitledTextAsString"}});function _(e){const{textValue:t,getRecordModel:n,userTimeZone:o,intl:r,seenBlocks:i=new Set,deterministic:a=!1,disableAnnotationPrefix:s=!1,disableInsertedAnnotations:l=!1,renderDateAnnotationsAsISO:c=!1,externalIntegrations:d}=e,u=f.lzi(t),p=s?"":"@";let m="";for(const g of u){const e=S({token:g,getRecordModel:n,intl:r,prefix:p,seenBlocks:i,userTimeZone:o,renderDateAnnotationsAsISO:c,deterministic:a,externalIntegrations:d,disableInsertedAnnotations:l});null!=e&&e.length&&(m+=e)}return m}function S(e){const{token:t,getRecordModel:n,intl:o,prefix:i,seenBlocks:l,userTimeZone:d,renderDateAnnotationsAsISO:_,deterministic:S,externalIntegrations:k,disableInsertedAnnotations:x}=e,I=f.WiV(t),C=f.hDy(t);if(!C.length)return I;const T=f.hH9(C);if(T){const e=f.zEN(T);if(e){const t=n({table:m.KJ,id:e});return`${i}${(0,y.Nz)(o,t)}`}return}const M=f.xat(C);if(M){const e=f.kxk(M);if(e){const{groupId:t,spaceId:r}=e,a=n((0,p.iA)({spaceId:r,spacePermissionGroupId:t}));return`${i}${(0,g.m)({intl:o,permissionGroupModel:a})}`}return}const P=f.V8Y(C);if(P){const e=f.TOT(P);return e&&!l.has(e)?(l.add(e),`${i}${w({blockId:e,getRecordModel:n,intl:o,userTimeZone:d,seenBlocks:l})||o.formatMessage(b.untitledTextAsString)}`):void 0}const A=f.K9C(C);if(A){const{date_format:e,time_format:t,...n}=f.zyO(A);return _?`${i}${(0,a.RY)(n,d)}`:`${i}${(0,a.ZV)({value:n,date_format:e,time_format:t,userTimeZone:d,intl:o,...S?{allowRelativeDates:!1}:{allowRelativeDates:!0}})}`}const R=f.Ap(C);if(R){return`$${f.xey(R)}$`}const D=f.frE(C);if(D){if(!k)return;const e=f.frW(D);if(!e)return;const t=n({table:c.iU,id:e});if(null==t||!t.isType(r.Ti.externalObjectInstance))return;return h.Wi({blockModel:t,getRecordModel:n,externalIntegrations:k,intl:o})}const B=f.QGY(C);if(B){return`${i}${(0,v.U$)(f.fsE(B).type,o)}`}if(f.IVR(C))return(0,s.fQ)(C,n,o,d);const E=f.J82(C);if(E){const[e,t,o]=E,r=n({table:u.p,id:t,spaceId:o});return null==r?void 0:r.getRenderTitle()}return f.jC0(C)||x&&f.gCI(C)?void 0:I}function k(e,t){return e.filter((e=>!(f.IWo(e)||f._bk(e)||f.STW(e)||f.fpG(e)||f.kuv(e)||t&&f.p23(e)||f.aq(e)||f.jFV(e)||f.OU5(e))))}function w(e){const{blockId:t,getRecordModel:n,intl:o,userTimeZone:r,seenBlocks:a}=e,s=n({table:c.iU,id:t});if(!s)return"";const u=s.getRenderFormatPointer(n);if(!u)return"";if(u.table===c.iU){if(s.isCollectionView()){const e=(0,i.wS)(s,"title");return e?_({textValue:e,getRecordModel:n,userTimeZone:r,deterministic:!1,intl:o,seenBlocks:a}):s.getEmptyTitlePlaceholder({getRecordModel:n,userTimeZone:r,intl:o})}const e=n(u);if(e){return _({textValue:(0,i.wS)(e,"title")||[],getRecordModel:n,userTimeZone:r,deterministic:!1,intl:o,seenBlocks:a,disableInsertedAnnotations:!0})}}else if(u.table===d.vF){const e=n(u);if(!e)return"";const t=l.kk5.fromCollection(e).getNormalizedName();if(t)return _({textValue:t,getRecordModel:n,userTimeZone:r,deterministic:!1,intl:o,seenBlocks:a,disableInsertedAnnotations:!0})}return""}},405228:(e,t,n)=>{n.d(t,{AE:()=>i,_h:()=>a,a7:()=>l,jY:()=>s,v9:()=>r});var o=n(89101);function r(e,t){return`${i(t)}/${e}`}function i(e){return`${e}${o._j.samlAuth}`}function a(e){const{samlConfigStatus:t,emailDomains:n,idp_metadata:o,idp_metadata_url:r}=e;return("configured"===t||"enforced"===t)&&!!n&&n.length>0&&Boolean(o||r)}function s(e){return 0===e.length?{type:"invalid",reason:"empty"}:{type:"valid"}}function l(e){return 0===e.length?{type:"invalid",reason:"empty"}:e.includes('WantAuthnRequestsSigned="true"')?{type:"invalid",reason:"signed_request"}:{type:"valid"}}},458129:(e,t,n)=>{n.d(t,{J8:()=>a,Kc:()=>s,U$:()=>i,ZP:()=>c,b5:()=>l});n(252262),n(324506);var o=n(280873),r=n(876096);const i={block:!0,space:!0,team:!0},a="access_request";function s(e){return Boolean(e.granted_by_table)}function l(e){var t,n,o;return Boolean("page_access_request"===e.type&&"read_and_write"===(null===(t=e.attributes)||void 0===t||null===(t=t.permission_records_and_roles)||void 0===t||null===(t=t.at(0))||void 0===t?void 0:t.role)&&("reader"===(null===(n=e.attributes)||void 0===n?void 0:n.existing_permissions)||"comment_only"===(null===(o=e.attributes)||void 0===o?void 0:o.existing_permissions)))}const c={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,parent_table:o.Z.String,parent_id:o.Z.UUID,for_actor_table:o.Z.String,for_actor_id:o.Z.UUID,granted_time:o.Z.Number,granted_by_table:o.Z.String,granted_by_id:o.Z.UUID,created_time:o.Z.Number,created_by_table:o.Z.String,created_by_id:o.Z.UUID,resolved_time:o.Z.Number,resolved_by_table:o.Z.String,resolved_by_id:o.Z.UUID,message:o.Z.String,status:o.Z.String,attributes:o.Z.JSON,type:o.Z.String},model:(0,r.y)({RecordStore:!0,properties:{resolved_by_id:{getRelationalPointerMethod:!1},for_actor_id:{getRelationalPointerMethod:!1},granted_by_id:{getRelationalPointerMethod:!1},created_by_id:{getRelationalPointerMethod:!1}}})}},570921:(e,t,n)=>{n.d(t,{L8:()=>p,Py:()=>m,Se:()=>g,TY:()=>f,ZP:()=>h,p3:()=>d,rH:()=>u,uJ:()=>c});var o=n(467266),r=n.n(o),i=n(307032),a=n(619584),s=n(280873),l=n(876096);const c=a.XP({space_id:!0,team_id:!0,navigable_block_id:!0,collection_id:!0,mentioned_user_id:!0,mentioned_block_id:!0,mentioned_property:!0,top_level_block_id:!0,collection_row_id:!0,discussion_id:!0,invited_user_id:!0,collection_property_id:!0,collection_view_id:!0,reminder_block_id:!0,reminder_property:!0,permission_group_id:!0,access_request_id:!0,mentioned_group_id:!0,contains_important_property_updates_only:!0,access_request_type:!0,suggestion_session_id:!0}),d={block:!0,space:!0,user_root:!0,collection:!0,team:!0};function u(e){const t=Object.fromEntries(Object.entries(e).filter((e=>{let[t,n]=e;return c.includes(t)&&null!=n}))),n=r()(t);return(0,i.Ul)(n)}const p={"block-created":"block-edited","block-deleted":"block-edited","block-changed":"block-edited","block-property-changed":"block-property-edited","permission-created":"permissions-edited","permission-deleted":"permissions-edited","permission-changed":"permissions-edited","permission-restriction-created":"permissions-edited","permission-restriction-deleted":"permissions-edited","permission-group-created":"permission-group-edited","permission-group-deleted":"permission-group-edited","permission-group-changed":"permission-group-edited","top-level-block-created":"top-level-block-created","top-level-block-deleted":"top-level-block-deleted","collection-row-created":"collection-row-created","collection-row-deleted":"collection-row-deleted","mention-created":"user-mentioned","mention-deleted":"user-mentioned","suggestion-created":"commented","comment-created":"commented","comment-changed":"commented","comment-deleted":"commented","team-member-added":"team-membership-edited","user-invited":"user-invited","collection-created":"collection-edited","collection-changed":"collection-edited","collection-property-created":"collection-property-edited","collection-property-deleted":"collection-property-edited","collection-property-changed":"collection-property-edited","collection-view-created":"collection-view-edited","collection-view-deleted":"collection-view-edited","collection-view-changed":"collection-view-edited","reminder-created":"reminder","page-locked":"page-locked","page-unlocked":"page-unlocked","email-changed":"email-edited","access-requested":"access-requested","access-request-resolved":"access-request-resolved","page-deleted":"page-deleted","page-restored":"page-restored","page-permanently-deleted":"page-permanently-deleted","private-content-transferred":"private-content-transferred","permission-group-mention-created":"permission-group-mentioned","permission-group-mention-deleted":"permission-group-mentioned","export-completed":"export-completed","import-completed":"import-completed","in-app-notification-automation-action-triggered":"in-app-notification-automation-action-triggered"},m=["block-edited","permissions-edited","commented","page-locked","page-unlocked"],g=["block-edited","permissions-edited","collection-row-created","collection-row-deleted","collection-edited","collection-property-edited","collection-view-edited"],f="activity",h={table:f,columnTypes:{id:s.Z.UUID,version:s.Z.Number,last_version:s.Z.Number,index:s.Z.Number,start_time:s.Z.String,end_time:s.Z.String,space_id:s.Z.UUID,team_id:s.Z.UUID,navigable_block_id:s.Z.UUID,collection_id:s.Z.UUID,mentioned_user_id:s.Z.UUID,mentioned_block_id:s.Z.UUID,mentioned_property:s.Z.String,top_level_block_id:s.Z.UUID,discussion_id:s.Z.UUID,invited_user_id:s.Z.UUID,collection_row_id:s.Z.UUID,collection_view_id:s.Z.UUID,collection_property_id:s.Z.String,reminder_block_id:s.Z.UUID,reminder_property:s.Z.String,permission_group_id:s.Z.UUID,access_request_id:s.Z.UUID,type:s.Z.String,edits:s.Z.JSON,invalid:s.Z.Boolean,parent_table:s.Z.String,parent_id:s.Z.UUID,shard_id:s.Z.Number,context_id:s.Z.UUID,in_log:s.Z.Boolean,mentioned_group_id:s.Z.UUID,contains_important_property_updates_only:s.Z.Boolean,access_request_type:s.Z.String},model:(0,l.y)({RecordStore:!0,properties:{suggestion_session_id:{getMethod:!1}}})}},30842:(e,t,n)=>{n.d(t,{Y:()=>r,Z:()=>i});var o=n(280873);const r="admin_api_log",i={table:r,columnTypes:{id:o.Z.UUID,timestamp:o.Z.Number,admin_user_id:o.Z.UUID,event_name:o.Z.String,params:o.Z.JSON,version:o.Z.Number,last_version:o.Z.Number,did_write:o.Z.Boolean},requiredColumns:{id:!0,event_name:!0,admin_user_id:!0,timestamp:!0,version:!0}}},39050:(e,t,n)=>{n.d(t,{L:()=>r,Z:()=>i});var o=n(280873);const r="admin_api_op_log",i={table:r,columnTypes:{id:o.Z.UUID,request_id:o.Z.UUID,timestamp:o.Z.Number,event_name:o.Z.String,operation_index:o.Z.Number,operation:o.Z.JSON,version:o.Z.Number,last_version:o.Z.Number},requiredColumns:{id:!0,version:!0,request_id:!0,timestamp:!0,event_name:!0,operation:!0,operation_index:!0}}},554368:(e,t,n)=>{n.d(t,{CS:()=>i,ZP:()=>s,y0:()=>a});var o=n(280873),r=n(876096);const i={block:!0},a="agent",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,parent_id:o.Z.UUID,parent_table:o.Z.String,space_id:o.Z.UUID,alive:o.Z.Boolean,created_time:o.Z.Number,created_by_id:o.Z.UUID,created_by_table:o.Z.String,last_edited_time:o.Z.Number,last_edited_by_id:o.Z.UUID,last_edited_by_table:o.Z.String,instruction_block_id:o.Z.UUID,resources:o.Z.JSON,properties:o.Z.JSON},model:(0,r.y)({RecordStore:!0,interfaces:{ActorModelInterface:"@notionhq/shared/models/ActorModelInterface"}})}},545149:(e,t,n)=>{n.d(t,{P:()=>i,Z:()=>a});var o=n(280873),r=n(876096);const i="ai_embedding_config",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.UUID,space_id:o.Z.UUID,is_allowed:o.Z.Boolean},model:(0,r.y)({RecordStore:!0})}},851650:(e,t,n)=>{n.d(t,{Z:()=>a,b:()=>i});var o=n(280873),r=n(876096);const i="ai_waitlist",a={table:i,columnTypes:{id:o.Z.UUID,created_at:o.Z.UUID,updated_at:o.Z.UUID,user_id:o.Z.UUID,referring_id:o.Z.UUID,enrolled:o.Z.Boolean,email:o.Z.String,position:o.Z.Number,version:o.Z.Number,invite_code:o.Z.String,space_id:o.Z.String,qna_priority:o.Z.Boolean},model:(0,r.y)({RecordStore:!0})}},288179:(e,t,n)=>{n.d(t,{F:()=>r,Z:()=>i});var o=n(280873);const r="apple_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,access_token:o.Z.String,refresh_token:o.Z.String,apple_user_id:o.Z.String}}},180926:(e,t,n)=>{n.d(t,{D:()=>r,Z:()=>i});var o=n(280873);const r="asana_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,access_token:o.Z.String,refresh_token:o.Z.String,account:o.Z.String}}},908542:(e,t,n)=>{n.d(t,{ZP:()=>s,t_:()=>i,zF:()=>a});var o=n(280873),r=n(876096);const i="assistant_chat_session",a={space_view:!0},s={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.UUID,parent_table:o.Z.String,parent_id:o.Z.UUID,created_time:o.Z.Number,chat_step_id:o.Z.UUID,type:o.Z.String,parent_external_id:o.Z.String,alive:o.Z.Boolean,properties:o.Z.JSON,file_ids:o.Z.StringArray},requiredColumns:{id:!0,version:!0,space_id:!0,type:!0,created_time:!0,alive:!0,chat_step_id:!0},model:(0,r.y)({RecordStore:!0})}},810188:(e,t,n)=>{n.d(t,{J4:()=>a,Mb:()=>i,ZP:()=>s});var o=n(280873),r=n(876096);const i={assistant_chat_session:!0},a="assistant_chat_step",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.UUID,parent_table:o.Z.String,parent_id:o.Z.UUID,created_time:o.Z.Number,properties:o.Z.JSON},requiredColumns:{id:!0,version:!0,space_id:!0,created_time:!0,parent_table:!0,parent_id:!0},model:(0,r.y)({RecordStore:!0})}},789320:(e,t,n)=>{n.d(t,{SS:()=>i,YC:()=>a,ZP:()=>s});var o=n(280873),r=n(876096);const i="assistant_session_starter",a={space_view:!0},s={table:i,columnTypes:{id:o.Z.UUID,alive:o.Z.Boolean,version:o.Z.Number,last_version:o.Z.Number,parent_id:o.Z.UUID,parent_table:o.Z.String,created_by_table:o.Z.String,created_by_id:o.Z.UUID,created_time:o.Z.Number,last_edited_time:o.Z.Number,last_edited_by_id:o.Z.UUID,last_edited_by_table:o.Z.String,space_id:o.Z.UUID,user_id:o.Z.UUID,type:o.Z.String,data:o.Z.JSON},requiredColumns:{id:!0,alive:!0,version:!0,parent_id:!0,parent_table:!0,created_by_table:!0,created_by_id:!0,created_time:!0,last_edited_time:!0,last_edited_by_id:!0,last_edited_by_table:!0,space_id:!0,user_id:!0,type:!0,data:!0},model:(0,r.y)({RecordStore:!0})}},798963:(e,t,n)=>{n.d(t,{OO:()=>c,ZP:()=>u,cv:()=>s,tb:()=>l,xx:()=>a});var o=n(653965),r=n(280873),i=n(876096);const a={block:!0,collection:!0},s="automation",l=300,c=30,d=["id","created_by_id","created_by_table","created_time","parent_id","parent_table","space_id"],u=(o.e5(d,["parent_id","parent_table"]),{table:s,columnTypes:{id:r.Z.UUID,version:r.Z.Number,last_version:r.Z.Number,space_id:r.Z.UUID,parent_table:r.Z.String,parent_id:r.Z.UUID,alive:r.Z.Boolean,created_by_id:r.Z.UUID,created_by_table:r.Z.String,created_time:r.Z.Number,last_edited_by_id:r.Z.UUID,last_edited_by_table:r.Z.String,last_edited_time:r.Z.Number,status:r.Z.String,trigger:r.Z.JSON,action_ids:r.Z.StringArray,run_at:r.Z.Number,properties:r.Z.JSON,copied_from_pointer:r.Z.JSON,last_executed_time:r.Z.Number},requiredColumns:{id:!0,version:!0,space_id:!0,parent_table:!0,parent_id:!0,alive:!0,created_by_id:!0,created_by_table:!0,created_time:!0,last_edited_by_id:!0,last_edited_by_table:!0,last_edited_time:!0,status:!0,trigger:!0},defaultColumnValues:{status:"disabled"},model:(0,i.y)({RecordStore:!0,properties:{copied_from_pointer:{getMethod:"getCopiedFrom",getKeyStoreMethod:!1,getRelationStoreMethod:!1},trigger:{getKeyStoreMethod:!1}}})})},718844:(e,t,n)=>{n.d(t,{MN:()=>s,Xj:()=>u,YC:()=>l,ZP:()=>p,eC:()=>d,tu:()=>c});var o=n(709291),r=n(280873),i=n(876096);const a=(0,o.defineMessages)({defaultEmptyVariableName:{defaultMessage:"Custom variable",id:"AutomationAction.defaultEmptyVariableName"}}),s={automation:!0};function l(e){return!(!e||"object"!=typeof e)&&((!("skillType"in e)||"string"==typeof e.skillType)&&(!("parameterValues"in e)||"object"==typeof e.parameterValues))}function c(e){return"custom"===(null==e?void 0:e.skillType)}const d=a.defaultEmptyVariableName,u="automation_action",p={table:u,columnTypes:{id:r.Z.UUID,type:r.Z.String,version:r.Z.Number,last_version:r.Z.Number,space_id:r.Z.UUID,parent_table:r.Z.String,parent_id:r.Z.UUID,alive:r.Z.Boolean,config:r.Z.JSON,blocks:r.Z.StringArray},requiredColumns:{id:!0,type:!0,version:!0,space_id:!0,parent_table:!0,parent_id:!0,alive:!0},model:(0,i.y)({RecordStore:!0,properties:{config:{getKeyStoreMethod:!1}}})}},556358:(e,t,n)=>{n.d(t,{EK:()=>i,Z:()=>s,ZP:()=>l});var o=n(280873),r=n(876096);const i="billing_data",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,parent_id:o.Z.UUID,parent_table:o.Z.String,external_id:o.Z.String,email:o.Z.String,address:o.Z.JSON,created_at:o.Z.Number},requiredColumns:{version:!0,parent_id:!0,parent_table:!0,created_at:!0},defaultColumnValues:{},model:(0,r.y)({})},s={space:!0},l=a},593561:(e,t,n)=>{n.d(t,{Z:()=>a,r:()=>i});var o=n(280873),r=n(876096);const i="billing_subscription",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,billing_data_id:o.Z.UUID,external_id:o.Z.String,status:o.Z.String,trial_end:o.Z.Number,current_period_end:o.Z.Number,items:o.Z.JSON,created_at:o.Z.Number},requiredColumns:{version:!0,billing_data_id:!0,status:!0,created_at:!0},defaultColumnValues:{},model:(0,r.y)({})}},607470:(e,t,n)=>{n.d(t,{Z:()=>i,n:()=>r});var o=n(280873);const r="block_token",i={table:r,columnTypes:{id:o.Z.UUID,token_id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number}}},60014:(e,t,n)=>{n.d(t,{Z:()=>i,x:()=>r});var o=n(280873);const r="bot_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,bot_id:o.Z.UUID,created_at:o.Z.Number,revoked_at:o.Z.Number,secret:o.Z.String,secret_hash:o.Z.String,key_id:o.Z.String}}},173916:(e,t,n)=>{n.d(t,{ZP:()=>c,aq:()=>l,l$:()=>s,pC:()=>a});var o=n(280873),r=n(876096),i=n(429369);const a="channel",s={[i.e0]:!0},l={table:a,columnTypes:{id:o.Z.UUID,name:o.Z.String,description:o.Z.String,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.UUID,parent_table:o.Z.String,parent_id:o.Z.UUID},requiredColumns:{id:!0,version:!0,parent_table:!0,space_id:!0,parent_id:!0},model:(0,r.y)({RecordStore:!0})},c=a},606287:(e,t,n)=>{n.d(t,{Vv:()=>a,ZP:()=>l,vF:()=>s});var o=n(178934),r=n(280873),i=n(876096);const a={block:!0,collection:!0},s="collection",l={table:s,columnTypes:{id:r.Z.UUID,version:r.Z.Number,last_version:r.Z.Number,name:r.Z.JSON,description:r.Z.JSON,icon:r.Z.String,cover:r.Z.String,schema:r.Z.JSON,format:r.Z.JSON,parent_id:r.Z.UUID,parent_table:r.Z.String,alive:r.Z.Boolean,file_ids:r.Z.StringArray,template_pages:r.Z.StringArray,copied_from:r.Z.UUID,migrated:r.Z.Boolean,space_id:r.Z.UUID,deleted_schema:r.Z.JSON},requiredColumns:{parent_id:!0,parent_table:!0,alive:!0},defaultColumnValues:{alive:!1},model:(0,i.y)({RecordStore:!0,properties:{icon:{getMethod:"getRawIcon",getKeyStoreMethod:"getIconStore"},cover:{getKeyStoreMethod:!0},format:{defaultOnRead:o.Ic},schema:{defaultOnRead:o.Ic},deleted_schema:{defaultOnRead:o.Ic},copied_from:{getMethod:!1}}})}},213493:(e,t,n)=>{n.d(t,{ZP:()=>s,av:()=>i,np:()=>a});var o=n(280873),r=n(876096);const i={block:!0},a="collection_view",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,type:o.Z.String,name:o.Z.String,page_sort:o.Z.UUIDArray,parent_id:o.Z.UUID,parent_table:o.Z.String,alive:o.Z.Boolean,format:o.Z.JSON,query2:o.Z.JSON,space_id:o.Z.UUID,created_time:o.Z.Number,created_by_table:o.Z.String,created_by_id:o.Z.UUID,last_edited_time:o.Z.Number,last_edited_by_table:o.Z.String,last_edited_by_id:o.Z.UUID},requiredColumns:{parent_id:!0,parent_table:!0,alive:!0,type:!0},defaultColumnValues:{alive:!1},model:(0,r.y)({RecordStore:!0,properties:{query2:{getMethod:"getRawQuery",getKeyStoreMethod:"getQueryStore"},format:{defaultOnRead:{}}}})}},870279:(e,t,n)=>{n.d(t,{ZP:()=>s,a:()=>i,x_:()=>a});var o=n(280873),r=n(876096);const i={discussion:!0},a="comment";const s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,parent_id:o.Z.UUID,parent_table:o.Z.String,text:o.Z.JSON,created_time:o.Z.Number,last_edited_time:o.Z.Number,alive:o.Z.Boolean,created_by_table:o.Z.String,created_by_id:o.Z.UUID,space_id:o.Z.UUID,content:o.Z.UUIDArray,reactions:o.Z.UUIDArray},requiredColumns:{parent_id:!0,parent_table:!0,alive:!0,created_time:!0},model:(0,r.y)({RecordStore:!0})}},175908:(e,t,n)=>{n.d(t,{D:()=>r,Z:()=>i});var o=n(280873);const r="confluence_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,site:o.Z.String,email:o.Z.String,access_token:o.Z.String,instance:o.Z.String,authentication_type:o.Z.String,user_id:o.Z.UUID,space_id:o.Z.UUID}}},506359:(e,t,n)=>{n.d(t,{H:()=>r,Z:()=>i});var o=n(280873);const r="cookie_consent",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,consent_id:o.Z.UUID,update_time:o.Z.Number,permission:o.Z.JSON,document_version:o.Z.String}}},407678:(e,t,n)=>{n.d(t,{DJ:()=>i,Vt:()=>r,ZP:()=>a});var o=n(280873);const r="promo",i="credit",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,user_id:o.Z.UUID,amount:o.Z.Number,created_timestamp:o.Z.Number,type:o.Z.String,to_user_id:o.Z.UUID,activated:o.Z.Boolean,from_user_id:o.Z.UUID,sent_email:o.Z.Boolean}}},394302:(e,t,n)=>{n.d(t,{Z:()=>a,p:()=>i});var o=n(280873),r=n(876096);const i="custom_emoji",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.UUID,name:o.Z.String,url:o.Z.String,file_ids:o.Z.StringArray,created_time:o.Z.Number,created_by_id:o.Z.UUID,created_by_table:o.Z.String,alive:o.Z.Boolean},requiredColumns:{version:!0,space_id:!0,name:!0,url:!0,created_time:!0,created_by_id:!0,created_by_table:!0,alive:!0},model:(0,r.y)({RecordStore:!0})}},960897:(e,t,n)=>{n.d(t,{BV:()=>m,DB:()=>u,Du:()=>s,Sf:()=>d,VJ:()=>p,ZP:()=>i,tt:()=>a,wK:()=>r});var o=n(280873);const r="customer",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,customer_id:o.Z.String,offers:o.Z.JSON,sales_assisted_plan:o.Z.String}},a=["personal","plus","business","enterprise"],s=["ambassador_plus_free","ambassador_plus_free_yearly","ambassador_enterprise_free","ambassador_enterprise_free_yearly","nonprofit_free","nonprofit_free_yearly","student_free","student_free_yearly","student_free_eur","student_free_yearly_eur","student_free_gbp","student_free_yearly_gbp","student_free_jpy","student_free_yearly_jpy","student_free_krw","student_free_yearly_krw","student_club_monthly","student_club_yearly"],l=["enterprise_trial","enterprise_trial_eur","enterprise_trial_gbp","enterprise_trial_jpy","enterprise_trial_krw","business_trial","business_trial_eur","business_trial_gbp","business_trial_jpy","business_trial_krw","plus_trial_eur","plus_trial_gbp","plus_trial_jpy","plus_trial_krw","enterprise_free","enterprise_sales_assisted_eur","enterprise_sales_assisted_gbp","enterprise_sales_assisted_jpy","enterprise_sales_assisted_krw","business_sales_assisted","business_sales_assisted_eur","business_sales_assisted_gbp","business_sales_assisted_jpy","business_sales_assisted_krw","plus_sales_assisted","plus_sales_assisted_eur","plus_sales_assisted_gbp","plus_sales_assisted_jpy","plus_sales_assisted_krw"],c=["enterprise_monthly_18","enterprise_monthly_180","enterprise_monthly_eur_17","enterprise_yearly_eur_168","enterprise_monthly_gbp_15","enterprise_yearly_gbp_150","enterprise_monthly_jpy_3000","enterprise_yearly_jpy_30000","enterprise_monthly_krw_25200","enterprise_yearly_krw_252000","enterprise_monthly_10","enterprise_yearly_96","enterprise_monthly_eur_9_50","enterprise_yearly_eur_90","enterprise_monthly_gbp_8_50","enterprise_yearly_gbp_84","enterprise_monthly_jpy_2000","enterprise_yearly_jpy_19800","enterprise_monthly_krw_16800","enterprise_yearly_krw_168000","enterprise_monthly_8","enterprise_monthly_12","enterprise_monthly_14","enterprise_monthly_16","enterprise_monthly_20","enterprise_yearly_80","enterprise_yearly_120","enterprise_yearly_144","enterprise_yearly_168","enterprise_yearly_192","enterprise_yearly_216"],d=[...l,...c],u=["employee_plus_free"],p=[...s,...l,"employee_plus_free","marketing_team_free","marketing_enterprise_free","personal_free","team_free"],m=["personal_monthly_5","personal_yearly_48","team_monthly_10","team_yearly_96","plus_monthly_usd_202407","plus_yearly_usd_202407","business_monthly","business_yearly","enterprise_monthly_25","enterprise_yearly_240","plus_monthly_eur","plus_yearly_eur","plus_monthly_eur_202407","plus_yearly_eur_202407","business_monthly_eur","business_yearly_eur","enterprise_monthly_eur","enterprise_yearly_eur","plus_monthly_gbp","plus_yearly_gbp","plus_monthly_gbp_202407","plus_yearly_gbp_202407","business_monthly_gbp","business_yearly_gbp","enterprise_monthly_gbp","enterprise_yearly_gbp","plus_monthly_jpy","plus_yearly_jpy","plus_monthly_jpy_202407","plus_yearly_jpy_202407","business_monthly_jpy","business_yearly_jpy","enterprise_monthly_jpy","enterprise_yearly_jpy","plus_monthly_krw","plus_yearly_krw_202407","business_monthly_krw","business_yearly_krw","enterprise_monthly_krw","enterprise_yearly_krw",...p,...c,"personal_monthly_0.50","personal_monthly_1.50","personal_monthly_2.50","personal_monthly_3.50","team_monthly_0.10","team_monthly_0.50","team_monthly_0.80","team_monthly_0.90","team_monthly_1","team_monthly_1.20","team_monthly_1.50","team_monthly_2","team_monthly_2.40","team_monthly_2.50","team_monthly_3","team_monthly_3.20","team_monthly_3.50","team_monthly_4","team_monthly_4.50","team_monthly_5","team_monthly_5.60","team_monthly_6","team_monthly_7","team_monthly_8","personal_yearly_4.80","personal_yearly_14.40","personal_yearly_24","personal_yearly_33.60","team_yearly_1","team_yearly_5","team_yearly_8","team_yearly_9","team_yearly_9.60","team_yearly_12","team_yearly_15","team_yearly_20","team_yearly_24","team_yearly_25","team_yearly_28.80","team_yearly_32","team_yearly_35","team_yearly_40","team_yearly_45","team_yearly_48","team_yearly_56","team_yearly_60","team_yearly_67.20","team_yearly_80"]},669549:(e,t,n)=>{n.d(t,{U5:()=>a,ZP:()=>l});var o=n(212847),r=n(280873),i=n(876096);const a="device",s={table:a,columnTypes:{id:r.Z.UUID,created_at:r.Z.Number,version:r.Z.Number,last_version:r.Z.Number,device_name:r.Z.String,device_os:r.Z.String,os_version:r.Z.NumberArray,device_platform:r.Z.String},model:(0,i.y)({})},l=(o.literals("ios","android","mac","windows","chrome","linux","unknown"),o.literals("react-native","electron","browser","unknown"),s)},933709:(e,t,n)=>{n.d(t,{Eu:()=>i,ZP:()=>s,qF:()=>a});var o=n(280873),r=n(876096);const i={block:!0},a="discussion",s={table:a,columnTypes:{id:o.Z.UUID,type:o.Z.String,version:o.Z.Number,last_version:o.Z.Number,parent_id:o.Z.UUID,parent_table:o.Z.String,context:o.Z.JSON,resolved:o.Z.Boolean,comments:o.Z.StringArray,space_id:o.Z.UUID,reactions:o.Z.UUIDArray,property_id:o.Z.String},requiredColumns:{parent_id:!0,parent_table:!0,resolved:!0,type:!0},model:(0,r.y)({RecordStore:!0,properties:{context:{private:!0}}})}},244312:(e,t,n)=>{n.d(t,{Jd:()=>a,ZP:()=>s,n5:()=>i});var o=n(280873),r=n(876096);const i={notion_user:!0},a="domain_verification_code";const s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,parent_id:o.Z.UUID,parent_table:o.Z.String,domain:o.Z.String,verification_code:o.Z.String,created_at:o.Z.Number,expires_at:o.Z.Number,verified_at:o.Z.Number,alive:o.Z.Boolean,type:o.Z.String,info:o.Z.JSON},model:(0,r.y)({RecordStore:!0})}},804986:(e,t,n)=>{n.d(t,{Z:()=>i,r:()=>r});var o=n(280873);const r="drive_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,notion_user_id:o.Z.UUID,google_user_id:o.Z.String,email:o.Z.String,access_token:o.Z.String,refresh_token:o.Z.String,expires_at:o.Z.Number}}},152719:(e,t,n)=>{n.d(t,{Z:()=>i,g:()=>r});var o=n(280873);const r="education_domain",i={table:r,columnTypes:{id:o.Z.String,version:o.Z.Number,last_version:o.Z.Number,domain:o.Z.String,activated_count:o.Z.Number},requiredColumns:{domain:!0,activated_count:!0},defaultColumnValues:{activated_count:0}}},758912:(e,t,n)=>{n.d(t,{J:()=>r,Z:()=>i});var o=n(280873);const r="education_email",i={table:r,columnTypes:{id:o.Z.String,version:o.Z.Number,last_version:o.Z.Number,email:o.Z.String,activated:o.Z.Boolean},requiredColumns:{email:!0,activated:!0},defaultColumnValues:{activated:!1}}},419639:(e,t,n)=>{n.d(t,{ZP:()=>d,gl:()=>s,mz:()=>c,nJ:()=>a,nb:()=>l});var o=n(401898),r=n(280873),i=n(876096);function a(e,t){switch(e){case"unrestricted":return t.formatMessage({id:"emailDomain.workspaceCreationSetting.auditLog.unrestricted",defaultMessage:"Unrestricted"});case"admins_only":return t.formatMessage({id:"emailDomain.workspaceCreationSetting.auditLog.workspaceOwnersOnly",defaultMessage:"Workspace Owners Only"});default:(0,o.t1)(e)}}const s="180_day",l={"1_hour":36e5,"2_hour":72e5,"4_hour":144e5,"8_hour":288e5,"12_hour":432e5,"1_day":864e5,"2_day":1728e5,"3_day":2592e5,"4_day":3456e5,"7_day":6048e5,"14_day":12096e5,"21_day":18144e5,"30_day":2592e6,"60_day":5184e6,"90_day":7776e6,"180_day":15552e6},c="email_domain",d={table:c,columnTypes:{id:r.Z.UUID,version:r.Z.Number,last_version:r.Z.Number,created_time:r.Z.Number,created_by_table:r.Z.String,created_by_id:r.Z.UUID,last_edited_time:r.Z.Number,last_edited_by_table:r.Z.String,last_edited_by_id:r.Z.UUID,domain:r.Z.String,space_ids:r.Z.UUIDArray,workspace_creation_enum:r.Z.String,settings:r.Z.JSON},model:(0,i.y)({properties:{created_by_id:{getRelationalPointerMethod:!1},last_edited_by_id:{getRelationalPointerMethod:!1}}})}},336077:(e,t,n)=>{n.d(t,{Z:()=>i,z:()=>r});var o=n(280873);const r="evernote_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,account:o.Z.String,request_token:o.Z.String,request_secret:o.Z.String,access_token:o.Z.String,access_secret:o.Z.String,created_time:o.Z.Number}}},197715:(e,t,n)=>{n.d(t,{Le:()=>r,ZP:()=>s,bt:()=>i,sl:()=>a});var o=n(280873);const r="control",i=["userId","deviceId","spaceId"],a="experiment",s={table:a,columnTypes:{id:o.Z.UUID,experiment_id:o.Z.String,version:o.Z.Number,last_version:o.Z.Number,groups:o.Z.JSON,overrides:o.Z.JSON,experiment_version:o.Z.Number,start_time:o.Z.Number,end_time:o.Z.Number,target_type:o.Z.String}}},332161:(e,t,n)=>{n.d(t,{PJ:()=>a,ZP:()=>s,h0:()=>i});var o=n(280873),r=n(876096);const i={bot:!0},a="external_authentication",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,last_edited_time:o.Z.Number,parent_table:o.Z.String,parent_id:o.Z.UUID,space_id:o.Z.UUID,user_id:o.Z.UUID,integration_id:o.Z.UUID,account_key:o.Z.String,account_name:o.Z.String},model:(0,r.y)({})}},982447:(e,t,n)=>{n.d(t,{Z:()=>i,r:()=>r});var o=n(280873);const r="external_authentication_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,access_token:o.Z.String,refresh_token:o.Z.String,bot_id:o.Z.String,user_id:o.Z.String,integration_id:o.Z.String,space_id:o.Z.String,expires_at:o.Z.Number}}},609713:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>i});var o=n(280873),r=n(876096);const i="external_entity",a={table:i,columnTypes:{id:o.Z.UUID,entity_type:o.Z.String,external_identifier:o.Z.String,external_display_name:o.Z.String,metainfo:o.Z.JSON,external_integration_id:o.Z.String,bot_id:o.Z.String,user_id:o.Z.UUID,space_id:o.Z.UUID,alive:o.Z.Boolean,version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number,created_by_table:o.Z.String,created_by_id:o.Z.String,updated_by_table:o.Z.String,updated_by_id:o.Z.String},model:(0,r.y)({})}},157398:(e,t,n)=>{n.d(t,{T:()=>i,Z:()=>a});var o=n(280873),r=n(876096);const i="external_integration_app",a={table:i,columnTypes:{id:o.Z.UUID,client_id:o.Z.String,client_secret:o.Z.String,oauth_authorize_url:o.Z.String,oauth_token_url:o.Z.String,deletion_url:o.Z.String,scopes:o.Z.StringArray,internal_integration_id:o.Z.UUID,alive:o.Z.Boolean,version:o.Z.Number,created_at:o.Z.Number,created_by_table:o.Z.String,created_by_id:o.Z.UUID,updated_by_table:o.Z.String,updated_by_id:o.Z.UUID,updated_at:o.Z.Number},model:(0,r.y)({})}},949953:(e,t,n)=>{n.d(t,{$x:()=>a,ZP:()=>c,r9:()=>l,wG:()=>s});var o=n(212847),r=n(280873),i=n(876096);const a={notion_user:!0},s=o.object({required:{oauth_authorize_url:o.string(),oauth_token_url:o.string(),client_id:o.string(),client_secret:o.string()},optional:{scopes:o.string(),deletion_url:o.string()}}),l="external_integration_authorization",c={table:l,columnTypes:{id:r.Z.UUID,version:r.Z.Number,last_version:r.Z.Number,parent_table:r.Z.String,parent_id:r.Z.String,oauth_authorize_url:r.Z.String,oauth_token_url:r.Z.String,client_id:r.Z.String,client_secret:r.Z.String,scopes:r.Z.String,deletion_url:r.Z.String},model:(0,i.y)({})}},114710:(e,t,n)=>{n.d(t,{Dw:()=>i,ZP:()=>a,kE:()=>r});var o=n(280873);const r={avatar:"avatar",identifier:"identifier",title:"title",primary:"primary",secondary:"secondary",body:"body",entity:"entity",embed:"embed",background:"background"},i="external_object",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,last_edited_time:o.Z.Number,external_created_at:o.Z.Number,external_last_edited_time:o.Z.Number,bot_id:o.Z.UUID,space_id:o.Z.UUID,uri:o.Z.String,attributes:o.Z.JSON,error:o.Z.JSON,schema:o.Z.JSON,external_collection_uris:o.Z.StringArray,sync_state:o.Z.JSON}}},709508:(e,t,n)=>{n.d(t,{F:()=>i,Z:()=>a});var o=n(280873),r=n(876096);const i="external_token",a={table:i,columnTypes:{id:o.Z.UUID,external_entity_id:o.Z.UUID,scopes:o.Z.StringArray,auth_type:o.Z.String,access_token:o.Z.String,refresh_token:o.Z.String,expires_at:o.Z.Number,lock_status:o.Z.String,alive:o.Z.Boolean,version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number,created_by_table:o.Z.String,created_by_id:o.Z.UUID,updated_by_table:o.Z.String,updated_by_id:o.Z.UUID},model:(0,r.y)({})}},262643:(e,t,n)=>{n.d(t,{ZP:()=>s,q4:()=>a,r9:()=>i});var o=n(471924),r=n(280873);function i(e){const{user_id:t,token:n}=e;return o.Ul([t,n].join(""))}const a="firebase_token",s={table:a,columnTypes:{id:r.Z.UUID,version:r.Z.Number,last_version:r.Z.Number,token:r.Z.String,user_id:r.Z.UUID,invalid:r.Z.Boolean}}},57883:(e,t,n)=>{n.d(t,{$j:()=>f,GC:()=>u,Tg:()=>d,ZP:()=>v,r$:()=>p,t0:()=>h,vU:()=>m,yI:()=>g});var o=n(307032),r=n(212847),i=n(280873),a=n(876096);const s=r.object({required:{comments:r.literal("all"),property_updates:r.literal("all"),mentions:r.literal(!0),other:r.literal(!0),explicitly_set_by_user:r.boolean()},optional:{}}),l=r.object({required:{comments:r.literal("all"),property_updates:r.literal("off"),mentions:r.literal(!0),other:r.literal(!0),explicitly_set_by_user:r.boolean()},optional:{}}),c=r.object({required:{comments:r.literal("all"),property_updates:r.literal("important"),mentions:r.literal(!0),other:r.literal(!0),explicitly_set_by_user:r.boolean()},optional:{}}),d=r.object({required:{comments:r.literal("replies"),property_updates:r.literal("off"),mentions:r.literal(!0),other:r.literal(!1),explicitly_set_by_user:r.boolean()},optional:{}});r.union([s,l,c,d]);function u(e){return{comments:"all",property_updates:"important",mentions:!0,other:!0,explicitly_set_by_user:e.explicitly_set_by_user}}function p(e){return{comments:"all",property_updates:"off",mentions:!0,other:!0,explicitly_set_by_user:e.explicitly_set_by_user}}function m(e){return{comments:"replies",property_updates:"off",mentions:!0,other:!1,explicitly_set_by_user:e.explicitly_set_by_user}}function g(e){return{comments:"all",property_updates:"all",mentions:!0,other:!0,explicitly_set_by_user:e.explicitly_set_by_user}}function f(e){const{user_id:t,navigable_block_id:n}=e;return(0,o.Ul)([t,n].join(""))}const h="follow",v={table:h,columnTypes:{id:i.Z.UUID,version:i.Z.Number,last_version:i.Z.Number,user_id:i.Z.UUID,navigable_block_id:i.Z.UUID,following:i.Z.Boolean,created_time:i.Z.Number,space_id:i.Z.UUID,follow_settings:i.Z.JSON},model:(0,a.y)({RecordStore:!0})}},714429:(e,t,n)=>{n.d(t,{L_:()=>a,PX:()=>i,ZP:()=>s});var o=n(280873),r=n(876096);const i={layout:!0},a="form_question",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.UUID,parent_table:o.Z.String,parent_id:o.Z.UUID,alive:o.Z.Boolean,config:o.Z.JSON},requiredColumns:{id:!0,version:!0,space_id:!0,parent_table:!0,parent_id:!0,alive:!0,config:!0},model:(0,r.y)({RecordStore:!0})}},685593:(e,t,n)=>{n.d(t,{M:()=>i,Z:()=>a});var o=n(280873),r=n(876096);const i="free_chart",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.UUID,free_chart_view_ids:o.Z.UUIDArray},requiredColumns:{id:!0,version:!0,space_id:!0,free_chart_view_ids:!0},model:(0,r.y)({RecordStore:!0})}},366726:(e,t,n)=>{n.d(t,{Z:()=>i,l:()=>r});var o=n(280873);const r="geo_ip_location",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,geoname_id:o.Z.Number,locale_code:o.Z.String,continent_code:o.Z.String,continent_name:o.Z.String,country_iso_code:o.Z.String,country_name:o.Z.String,subdivision_1_iso_code:o.Z.String,subdivision_1_name:o.Z.String,subdivision_2_iso_code:o.Z.String,subdivision_2_name:o.Z.String,city_name:o.Z.String,metro_code:o.Z.Number,time_zone:o.Z.String,is_in_european_union:o.Z.Boolean}}},230754:(e,t,n)=>{n.d(t,{G:()=>r,Z:()=>i});var o=n(280873);const r="geo_ip_network",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,network:o.Z.String,geoname_id:o.Z.Number,registered_country_geoname_id:o.Z.Number,represented_country_geoname_id:o.Z.Number,is_anonymous_proxy:o.Z.Boolean,is_satellite_provider:o.Z.Boolean,postal_code:o.Z.String,latitude:o.Z.Number,longitude:o.Z.Number,accuracy_radius:o.Z.Number}}},168105:(e,t,n)=>{n.d(t,{S:()=>i,Z:()=>a});var o=n(280873),r=n(876096);const i="global_oauth_client",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,client_name:o.Z.String,client_secret:o.Z.String,default_scopes:o.Z.JSON,redirect_uris:o.Z.StringArray,created_at:o.Z.Number,updated_at:o.Z.Number,metadata:o.Z.JSON},model:(0,r.y)({})}},606946:(e,t,n)=>{n.d(t,{N:()=>r,Z:()=>i});var o=n(280873);const r="google_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,token:o.Z.String,google_user_id:o.Z.String}}},54363:(e,t,n)=>{n.d(t,{ZP:()=>a,uV:()=>i});var o=n(280873),r=n(876096);const i="integration_listing",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,contentful_id:o.Z.String,integration_id:o.Z.UUID,creator_id:o.Z.UUID,tags:o.Z.StringArray,name:o.Z.String,slug:o.Z.String,locale:o.Z.String,info:o.Z.JSON,created_at:o.Z.Number,last_updated_at:o.Z.Number},model:(0,r.y)({RecordStore:!0})}},825753:(e,t,n)=>{n.d(t,{Z:()=>i,z:()=>r});var o=n(280873);const r="integration_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,integration_id:o.Z.UUID,created_at:o.Z.Number,revoked_at:o.Z.Number,token_hash:o.Z.String}}},873081:(e,t,n)=>{n.d(t,{ZP:()=>s,bC:()=>a,xJ:()=>i});var o=n(280873),r=n(876096);const i={space:!0},a="internal_domain",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_time:o.Z.Number,parent_id:o.Z.String,parent_table:o.Z.UUID,url:o.Z.String,type:o.Z.String},requiredColumns:{version:!0,parent_id:!0,parent_table:!0,created_time:!0,space_id:!0,url:!0,type:!0},defaultColumnValues:{},model:(0,r.y)({RecordStore:!0})}},584683:(e,t,n)=>{n.d(t,{Tu:()=>i,ZP:()=>a,_e:()=>r});var o=n(280873);const r="group",i="invite",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,flow_id:o.Z.UUID,space_id:o.Z.UUID,target_id:o.Z.UUID,target_table:o.Z.String,inviter_id:o.Z.UUID,inviter_table:o.Z.String,invitee_id:o.Z.UUID,invitee_table_or_group:o.Z.String,message:o.Z.String,created_time:o.Z.Number,attributes:o.Z.JSON},requiredColumns:{id:!0,version:!0,space_id:!0,target_id:!0,target_table:!0,inviter_id:!0,inviter_table:!0,invitee_id:!0,invitee_table_or_group:!0,created_time:!0,attributes:!0}}},801849:(e,t,n)=>{n.d(t,{ZP:()=>a,aO:()=>i});var o=n(280873),r=n(876096);const i="invoice",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,subscription_id:o.Z.UUID,billing_data_id:o.Z.UUID,external_id:o.Z.String,external_url:o.Z.String,status:o.Z.String,created_at:o.Z.Number,due_date:o.Z.Number,overrides:o.Z.JSON,payment_intent:o.Z.JSON},requiredColumns:{version:!0,billing_data_id:!0,subscription_id:!0,status:!0,created_at:!0},defaultColumnValues:{},model:(0,r.y)({})}},611318:(e,t,n)=>{n.d(t,{Bh:()=>c,DQ:()=>a,ZP:()=>d,cf:()=>l,g9:()=>s});var o=n(401898),r=n(280873),i=n(876096);const a={collection:!0,block:!0},s=(0,o.Yd)({page_layout_schema:!0,page_info_layout_schema:!0,form_layout_schema:!0}),l=(0,o.Yd)({page_main:!0,page_details:!0,form_layout_schema:!0}),c="layout",d={table:c,columnTypes:{id:r.Z.UUID,version:r.Z.Number,last_version:r.Z.Number,space_id:r.Z.UUID,parent_table:r.Z.String,parent_id:r.Z.UUID,created_by_id:r.Z.UUID,created_by_table:r.Z.String,created_time:r.Z.Number,last_edited_by_id:r.Z.UUID,last_edited_by_table:r.Z.String,last_edited_time:r.Z.Number,modules:r.Z.JSON,blocks:r.Z.UUIDArray},requiredColumns:{id:!0,version:!0,space_id:!0,parent_table:!0,parent_id:!0,created_by_id:!0,created_by_table:!0,created_time:!0,last_edited_by_id:!0,last_edited_by_table:!0,last_edited_time:!0,modules:!0},model:(0,i.y)({RecordStore:!0,properties:{modules:{getMethod:"getRawModules",getKeyStoreMethod:"getRawModulesStore"},blocks:{getMethod:"getBlockChildren",getKeyStoreMethod:"getBlockChildrenStore"}}})}},112748:(e,t,n)=>{n.d(t,{GL:()=>i,ZP:()=>a});var o=n(280873),r=n(876096);const i="marketplace_acquisition",a={table:i,columnTypes:{id:o.Z.UUID,listing_id:o.Z.UUID,customer_id:o.Z.UUID,seller_id:o.Z.UUID,stripe_payment_intent_id:o.Z.String,product_price:o.Z.Number,total_price:o.Z.Number,status:o.Z.String,created_time:o.Z.Number,updated_time:o.Z.Number,version:o.Z.Number,last_version:o.Z.Number,destination_table:o.Z.String,destination_id:o.Z.UUID},model:(0,r.y)({})}},941904:(e,t,n)=>{n.d(t,{Z:()=>a,m:()=>i});var o=n(280873),r=n(876096);const i="marketplace_customer",a={table:i,columnTypes:{id:o.Z.UUID,acquirer_table:o.Z.String,acquirer_id:o.Z.String,stripe_customer_id:o.Z.String,created_time:o.Z.Number,version:o.Z.Number,last_version:o.Z.Number},model:(0,r.y)({})}},366004:(e,t,n)=>{n.d(t,{Z:()=>a,m:()=>i});var o=n(280873),r=n(876096);const i="marketplace_installation",a={table:i,columnTypes:{id:o.Z.UUID,destination_table:o.Z.String,destination_id:o.Z.String,actor_table:o.Z.String,actor_id:o.Z.String,acquisition_id:o.Z.String,created_time:o.Z.Number,version:o.Z.Number,last_version:o.Z.Number,status:o.Z.String},requiredColumns:{id:!0,version:!0,destination_table:!0,destination_id:!0,actor_table:!0,actor_id:!0,acquisition_id:!0,created_time:!0},model:(0,r.y)({})}},122777:(e,t,n)=>{n.d(t,{Vj:()=>i,ZP:()=>a});var o=n(280873),r=n(876096);const i="marketplace_listing",a={table:i,columnTypes:{id:o.Z.UUID,product_table:o.Z.String,product_id:o.Z.String,creator_id:o.Z.String,price:o.Z.Number,created_time:o.Z.Number,version:o.Z.Number,last_version:o.Z.Number,checkout_enabled:o.Z.Boolean,ratings_attributes:o.Z.JSON},model:(0,r.y)({})}},197924:(e,t,n)=>{n.d(t,{ZI:()=>a,ZK:()=>i,ZP:()=>s});var o=n(280873),r=n(876096);const i=[1,2,3,4,5],a="marketplace_listing_review",s={table:a,columnTypes:{id:o.Z.UUID,title:o.Z.String,rating:o.Z.Number,acquisition_id:o.Z.String,serialized_content:o.Z.JSON,serialized_creator_response:o.Z.JSON,status:o.Z.String,attributes:o.Z.JSON,created_time:o.Z.Number,updated_time:o.Z.Number,version:o.Z.Number,last_version:o.Z.Number},requiredColumns:{id:!0,version:!0,rating:!0,acquisition_id:!0,status:!0,created_time:!0,updated_time:!0},model:(0,r.y)({RecordStore:!0})}},238429:(e,t,n)=>{n.d(t,{ZP:()=>c,i6:()=>i});var o=n(212847),r=n(280873);const i="mfa_settings",a={table:i,columnTypes:{id:r.Z.UUID,user_id:r.Z.UUID,created_at:r.Z.Number,enabled:r.Z.Boolean,is_primary:r.Z.Boolean,method:r.Z.String,setting:r.Z.JSON,version:r.Z.Number,last_version:r.Z.Number}},s=(o.literals("totp","sms","backup_code"),o.literals("totp","sms"),o.literals("bcrypt")),l=o.literals("crypto-service"),c=(o.object({required:{backup_codes:o.array(o.object({required:{codeHash:o.string(),hasBeenUsed:o.boolean()},optional:{}})),hash_method:s},optional:{recovery:o.boolean()}}),o.object({required:{phone_number:o.string(),masked_phone_number:o.string()},optional:{}}),o.object({required:{totp_secret:o.string(),encryption_method:l,key_version:o.string(),friendly_name:o.string()},optional:{}}),a)},589488:(e,t,n)=>{n.d(t,{N:()=>r,Z:()=>i});var o=n(280873);const r="monday_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,email:o.Z.String,api_token:o.Z.String,user_id:o.Z.UUID,space_id:o.Z.UUID}}},829305:(e,t,n)=>{n.d(t,{X:()=>o});const o={BRL:{currencyCode:"BRL",minorUnitDigits:2},EUR:{currencyCode:"EUR",minorUnitDigits:2},GBP:{currencyCode:"GBP",minorUnitDigits:2},JPY:{currencyCode:"JPY",minorUnitDigits:0},KRW:{currencyCode:"KRW",minorUnitDigits:0},USD:{currencyCode:"USD",minorUnitDigits:2}}},865311:(e,t,n)=>{n.d(t,{Xm:()=>a,ZP:()=>c,hE:()=>s,uX:()=>l});var o=n(307032),r=n(280873),i=n(876096);function a(e,t){return(0,o.Ul)([e,t].join(""))}const s={"user-mentioned":"mentions",commented:"mentions","block-property-edited":"mentions","user-invited":"mentions","team-membership-edited":"mentions",reminder:"mentions","email-edited":"mentions","access-requested":"mentions","access-request-resolved":"mentions","private-content-transferred":"mentions","permission-group-mentioned":"mentions","verification-expired":"mentions","import-completed":"mentions","export-completed":"mentions","in-app-notification-automation-action-triggered":"mentions","block-edited":"following","permissions-edited":"following","permission-group-edited":"following","top-level-block-created":"following","top-level-block-deleted":"following","collection-row-created":"following","collection-row-deleted":"following","collection-edited":"following","collection-property-edited":"following","collection-view-edited":"following","page-locked":"following","page-unlocked":"following","page-deleted":"following","page-restored":"following","page-permanently-deleted":"following"};const l="notification",c={table:l,columnTypes:{id:r.Z.UUID,version:r.Z.Number,last_version:r.Z.Number,user_id:r.Z.String,activity_id:r.Z.UUID,received:r.Z.Boolean,read:r.Z.Boolean,visited:r.Z.Boolean,emailed:r.Z.Boolean,invalid:r.Z.Boolean,space_id:r.Z.UUID,navigable_block_id:r.Z.UUID,collection_id:r.Z.UUID,discussion_id:r.Z.UUID,end_time:r.Z.String,type:r.Z.String,channel:r.Z.String,archived_at:r.Z.Number},model:(0,i.y)({RecordStore:!0})}},116427:(e,t,n)=>{n.d(t,{V:()=>r,Z:()=>i});var o=n(280873);const r="oauth_authorization_code",i={table:r,columnTypes:{id:o.Z.UUID,created_time:o.Z.Number,version:o.Z.Number,last_version:o.Z.Number,redirect_uri:o.Z.String,created_by_id:o.Z.UUID,created_by_table:o.Z.String,bot_id:o.Z.UUID,created_bot_token_id:o.Z.UUID,revoked_at:o.Z.Number,type:o.Z.String,space_id:o.Z.UUID,integration_id:o.Z.UUID,optional_info:o.Z.JSON,capabilities:o.Z.JSON}}},361220:(e,t,n)=>{n.d(t,{V7:()=>i,ZP:()=>a});var o=n(280873),r=n(876096);const i="organization",a={table:i,columnTypes:{id:o.Z.UUID,name:o.Z.String,roles:o.Z.JSON,version:o.Z.Number,last_version:o.Z.Number,alive:o.Z.Boolean,created_time:o.Z.Number,created_by_id:o.Z.UUID,created_by_table:o.Z.String,last_edited_time:o.Z.Number,last_edited_by_id:o.Z.UUID,last_edited_by_table:o.Z.String,default_space_settings:o.Z.JSON,email_domains:o.Z.StringArray,managed_user_settings:o.Z.JSON,saml_provisioning_space_id:o.Z.UUID},requiredColumns:{id:!0,name:!0,version:!0,alive:!0,created_time:!0,created_by_id:!0,created_by_table:!0,last_edited_by_id:!0,last_edited_by_table:!0,last_edited_time:!0},model:(0,r.y)({RecordStore:!0})}},296683:(e,t,n)=>{n.d(t,{K:()=>i,Z:()=>a});var o=n(280873),r=n(876096);const i="organization_space",a={table:i,columnTypes:{id:o.Z.UUID,organization_id:o.Z.UUID,space_id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,alive:o.Z.Boolean},requiredColumns:{id:!0,version:!0,organization_id:!0,space_id:!0,alive:!0},model:(0,r.y)({})}},670017:(e,t,n)=>{n.d(t,{Kk:()=>a,XK:()=>i,ZP:()=>s});n(307032);var o=n(280873),r=n(876096);const i={block:!0};const a="page_exit",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,parent_table:o.Z.String,parent_id:o.Z.UUID,user_id:o.Z.UUID,exited_at:o.Z.Number,space_id:o.Z.UUID},requiredColumns:{parent_table:!0,parent_id:!0,user_id:!0,exited_at:!0},model:(0,r.y)({RecordStore:!0})}},989470:(e,t,n)=>{n.d(t,{Pv:()=>s,UI:()=>l,ZP:()=>c,bl:()=>a});var o=n(307032),r=n(280873),i=n(876096);const a={block:!0};function s(e){const{parent_id:t,user_id:n}=e;return(0,o.Ul)(`block:${t}:${n}`)}const l="page_visit",c={table:l,columnTypes:{id:r.Z.UUID,version:r.Z.Number,last_version:r.Z.Number,parent_table:r.Z.String,parent_id:r.Z.UUID,user_id:r.Z.UUID,visited_at:r.Z.Number,space_id:r.Z.UUID,was_unlisted:r.Z.Boolean},requiredColumns:{parent_table:!0,parent_id:!0,user_id:!0,visited_at:!0},model:(0,i.y)({RecordStore:!0})}},849126:(e,t,n)=>{n.d(t,{Z:()=>i,v:()=>r});var o=n(280873);const r="password",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,password_hash:o.Z.String}}},870121:(e,t,n)=>{n.d(t,{Z:()=>a,k:()=>i});var o=n(280873),r=n(876096);const i="plus_lock_waitlist",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.UUID,opted_in_at:o.Z.Number,opted_in_by_id:o.Z.UUID,opted_in_by_table:o.Z.String,metadata:o.Z.JSON},requiredColumns:{version:!0,space_id:!0},defaultColumnValues:{},model:(0,r.y)({RecordStore:!0})}},594578:(e,t,n)=>{n.d(t,{JI:()=>i,P9:()=>r,ZP:()=>a});var o=n(280873);const r="property_item",i={block:!0};const a={table:r,columnTypes:{id:o.Z.UUID,space_id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,parent_id:o.Z.UUID,parent_table:o.Z.String,parent_version:o.Z.Number,property_id:o.Z.String,property_version:o.Z.Number,fractional_index:o.Z.String,collection_id:o.Z.UUID,json_value:o.Z.JSON,plain_text_value:o.Z.String,text_has_mentions:o.Z.Boolean,url_value:o.Z.String,boolean_value:o.Z.Boolean,number_value:o.Z.Number,date_value_start:o.Z.Number,date_value_end:o.Z.Number,date_value_is_datetime:o.Z.Boolean,date_value_timezone:o.Z.String,date_value_original:o.Z.String,select_value:o.Z.String,pointer_value_id:o.Z.UUID,pointer_value_space_id:o.Z.UUID,pointer_value_table:o.Z.String},requiredColumns:{property_id:!0,parent_id:!0,parent_table:!0,fractional_index:!0,id:!0,space_id:!0,version:!0,parent_version:!0}}},886854:(e,t,n)=>{n.d(t,{X:()=>s,ZP:()=>l,bJ:()=>a,j_:()=>i});var o=n(280873),r=n(876096);const i=25,a={space:!0},s="public_domain",l={table:s,columnTypes:{id:o.Z.UUID,space_id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,domain_name:o.Z.String,domain_type:o.Z.String,domain_status:o.Z.String,is_default:o.Z.Boolean,is_autogenerated:o.Z.Boolean,public_home_page:o.Z.String,parent_id:o.Z.String,parent_table:o.Z.UUID,created_time:o.Z.Number,created_by_table:o.Z.String,created_by_id:o.Z.UUID,last_edited_time:o.Z.Number,last_edited_by_table:o.Z.String,last_edited_by_id:o.Z.UUID},requiredColumns:{id:!0,space_id:!0,version:!0,domain_name:!0,domain_type:!0,domain_status:!0,is_default:!0,is_autogenerated:!0,parent_id:!0,parent_table:!0},model:(0,r.y)({RecordStore:!0})}},204137:(e,t,n)=>{n.d(t,{A:()=>r,Z:()=>i});var o=n(280873);const r="public_email_domain",i={table:r,columnTypes:{id:o.Z.String,version:o.Z.Number,last_version:o.Z.Number,domain:o.Z.String},requiredColumns:{domain:!0}}},480396:(e,t,n)=>{n.d(t,{Cq:()=>i,ZP:()=>s,yo:()=>a});var o=n(280873),r=n(876096);const i={comment:!0,discussion:!0},a="reaction",s={table:a,columnTypes:{id:o.Z.UUID,space_id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_time:o.Z.Number,parent_id:o.Z.UUID,parent_table:o.Z.String,icon:o.Z.String,actors:o.Z.JSON},requiredColumns:{parent_id:!0,parent_table:!0,space_id:!0,icon:!0},defaultColumnValues:{},model:(0,r.y)({RecordStore:!0})}},524836:(e,t,n)=>{n.d(t,{Sr:()=>c,ZP:()=>l,lu:()=>a,qV:()=>s});var o=n(307032),r=n(280873),i=n(876096);const a={collection:!0},s="record_counter",l={table:s,columnTypes:{id:r.Z.UUID,version:r.Z.Number,last_version:r.Z.Number,space_id:r.Z.UUID,parent_table:r.Z.String,parent_id:r.Z.UUID,next_value:r.Z.Number,alive:r.Z.Boolean},requiredColumns:{space_id:!0,parent_table:!0,parent_id:!0,next_value:!0,alive:!0},model:(0,i.y)({RecordStore:!0})};function c(e){const{spaceId:t,parentTable:n,parentId:r}=e;return(0,o.Ul)(`${t}-${n}-${r}`)}},23867:(e,t,n)=>{function o(e){return e}n.d(t,{C:()=>o})},231577:(e,t,n)=>{n.d(t,{ZP:()=>s,eC:()=>i,y7:()=>a});n(467266),n(401898);var o=n(280873),r=n(876096);const i="record_mention",a={block:!0,comment:!0},s={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,type:o.Z.String,space_id:o.Z.UUID,parent_table:o.Z.String,parent_id:o.Z.UUID,parent_property_id:o.Z.String,mentioned_space_id:o.Z.UUID,mentioned_table:o.Z.String,mentioned_id:o.Z.UUID,mentioned_property_id:o.Z.UUID},requiredColumns:{type:!0,space_id:!0,parent_table:!0,parent_id:!0,mentioned_table:!0,mentioned_id:!0},model:(0,r.y)({})}},278929:(e,t,n)=>{n.d(t,{BA:()=>a,Nw:()=>s,WL:()=>l,ZP:()=>u,_h:()=>c,xs:()=>d});var o=n(212847),r=n(405228),i=n(280873);const a=["add","remove","delete"],s=(o.literals("unconfigured","disabled"),o.literals("configured","enforced"),"saml_config");function l(e){return"unconfigured"===e.status||"disabled"===e.status}function c(e){return r._h({samlConfigStatus:e.status,emailDomains:e.email_domains,idp_metadata:e.idp_metadata,idp_metadata_url:e.idp_metadata_url})}function d(e){return c(e)&&Boolean(e.idp_metadata)}const u={table:s,columnTypes:{id:i.Z.UUID,version:i.Z.Number,last_version:i.Z.Number,status:i.Z.String,email_domains:i.Z.StringArray,idp_metadata_url:i.Z.String,idp_public_certificate:i.Z.String,idp_sign_in_url:i.Z.String,idp_sign_out_url:i.Z.String,create_account:i.Z.Boolean,last_edited_by:i.Z.UUID,last_edited_time:i.Z.Number,idp_metadata:i.Z.XML,space_ids:i.Z.UUIDArray,owner_table:i.Z.String,owner_id:i.Z.String},requiredColumns:{status:!0,create_account:!0,last_edited_by:!0,last_edited_time:!0,space_ids:!0,owner_table:!0,owner_id:!0},defaultColumnValues:{status:"unconfigured",create_account:!1}}},676462:(e,t,n)=>{n.d(t,{LV:()=>jt,Nq:()=>zt,OC:()=>Nt,ZP:()=>Wt,wb:()=>Ht,ym:()=>Kt});var o=n(653965),r=n(401898),i=n(619584),a=n(212847),s=(n(159730),n(458129)),l=n(570921),c=n(30842),d=n(39050),u=n(554368),p=n(545149),m=n(851650),g=n(288179),f=n(180926),h=n(908542),v=n(810188),y=n(789320),b=n(798963),_=n(718844),S=n(556358),k=n(593561),w=n(421202),x=n(607470),I=n(177420),C=n(60014),T=n(173916),M=n(606287),P=n(213493),A=n(870279),R=n(175908),D=n(506359),B=n(407678),E=n(394302),F=n(960897),Z=n(669549),U=n(933709),V=n(244312),N=n(804986),O=n(152719),L=n(758912),j=n(419639),K=n(336077),z=n(197715),q=n(332161),H=n(982447),G=n(609713),W=n(157398),$=n(949953),Y=n(114710),Q=n(709508),J=n(262643),X=n(57883),ee=n(714429),te=n(685593),ne=n(366726),oe=n(230754),re=n(168105),ie=n(606946),ae=n(509844),se=n(54363),le=n(825753),ce=n(873081),de=n(584683),ue=n(801849),pe=n(611318),me=n(112748),ge=n(941904),fe=n(366004),he=n(122777),ve=n(197924),ye=n(238429),be=n(589488),_e=n(865311),Se=n(116427),ke=n(361220),we=n(296683),xe=n(670017),Ie=n(989470),Ce=n(849126),Te=n(870121),Me=n(594578),Pe=n(886854),Ae=n(204137),Re=n(480396),De=n(524836),Be=n(86135),Ee=n(231577),Fe=n(278929),Ze=n(884323),Ue=n(801311),Ve=n(983200),Ne=n(367627),Oe=n(265963),Le=n(714130),je=n(134406),Ke=n(342314),ze=n(616663),qe=n(619221),He=n(493646),Ge=n(715539),We=n(91644),$e=n(563787),Ye=n(838952),Qe=n(840837),Je=n(475246),Xe=n(665635),et=n(396740),tt=n(755514),nt=n(975990),ot=n(57829),rt=n(963188),it=n(556877),at=n(591937),st=n(307591),lt=n(276413),ct=n(947969),dt=n(147238),ut=n(935623),pt=n(577858),mt=n(537202),gt=n(263368),ft=n(429369),ht=n(826195),vt=n(614450),yt=n(314718),bt=n(614327),_t=n(71495),St=n(453412),kt=n(965836),wt=n(705505),xt=n(266295),It=n(638086),Ct=n(110354),Tt=n(519889),Mt=n(19716),Pt=n(976244),At=n(598897),Rt=n(563408),Dt=n(917730),Bt=n(789713),Et=n(766079),Ft=n(758161),Zt=n(328182),Ut=n(35794);const Vt={block:1,record_counter:2,discussion:3,comment:4,[Te.k]:5,[Ee.eC]:6,collection:7,collection_view:8};new Map(Object.entries(Vt).map((e=>{let[t,n]=e;return[n,t]})));s.J8,s.U$,l.TY,l.p3,c.Y,d.L,u.y0,u.CS,p.P,m.b,g.F,f.D,v.J4,v.Mb,b.cv,b.xx,_.Xj,_.MN,S.EK,S.Z,k.r,w.iU,w.i3,x.n,I.cZ,I.Mf,C.x,M.vF,M.Vv,P.np,P.av,A.x_,A.a,R.D,D.H,B.DJ,F.wK,Z.U5,U.qF,U.Eu,V.Jd,V.n5,N.r,j.mz,O.g,L.J,K.z,z.sl,q.PJ,q.h0,H.r,G.a,W.T,$.r9,$.$x,Y.Dw,Q.F,J.q4,X.t0,ie.N,ne.l,oe.G,ae.K2,ae.v5,le.z,ce.bC,ce.xJ,de.Tu,ue.aO,pe.Bh,pe.DQ,me.GL,ge.m,he.Vj,be.N,ye.i6,_e.uX,Ee.eC,Ee.y7,Tt.KJ,Se.V,ke.V7,we.K,xe.Kk,xe.XK,Ie.UI,Ie.bl,Ce.v,Me.P9,Me.JI,Pe.X,Pe.bJ,Ae.A,Re.yo,Re.Cq,De.qV,De.lu,Be.FM,Be.Yo,Fe.Nw,Ue.M,Ze.b,Oe.a,ze.h,Ve.wM,Ve.h1,je.f1,Ke.P,Le.O,Ne.m,qe.a,He.O,We.AT,We.yP,$e.s_,$e.iP,Ye.A,Qe.rp,Qe.bW,Je.bx,Xe.Zx,tt.r,nt.F,rt.V,et.L,it.L9,at.GQ,st.Py,lt.e8,ct.WU,ut.M,dt.x,pt.zU,pt.AQ,mt.FU,gt.ah,gt.hJ,ot.fF,ft.e0,ft.Im,ht.nE,vt.O,yt.u,bt.zg,_t.Az,St.nt,kt.jA,wt.uK,xt.O,Ct.I,Mt.V,Pt.e,At.pm,Rt.j,Et.dx,Ft.t,Zt.Sr,Ut.bf,Ut.AO,Ge.Gs,Ge.d6,E.p,fe.m,ve.ZI,ee.L_,ee.PX,Te.k,se.uV,re.S,Bt.w,Dt.m,It.l,y.SS,y.YC,te.M,T.ZP,T.l$,h.t_,h.zF;const Nt={block:w.ZP,customer:F.ZP,notion_user:Tt.ZP,space:Je.ZP,space_bot:Xe.ZP,space_permission_group:at.nZ,space_permission_group_member:st.hU,space_user:ct.ZP,space_view:pt.ZP,token:wt.ZP,user_root:Et.ZP,temporary_password:kt.ZP,password:Ce.Z,collection:M.ZP,collection_view:P.ZP,apple_token:g.Z,google_token:ie.Z,follow:X.ZP,activity:l.ZP,notification:_e.ZP,firebase_token:J.ZP,trello_token:xt.Z,asana_token:f.Z,confluence_token:R.Z,monday_token:be.Z,external_entity:G.Z,external_token:Q.Z,external_integration_app:W.Z,slack_integration:$e.ZP,slack_notification:Ye.Z,discussion:U.ZP,comment:A.ZP,snapshot:Qe.ZP,credit:B.ZP,used_credit:Ct.Z,user_settings:Zt.ZP,evernote_token:K.Z,space_recover_pages:lt.ZP,drive_token:N.Z,block_token:x.Z,user_metadata:Rt.Z,bot:I.ZP,bot_token:C.Z,saml_config:Fe.ZP,experiment:z.ZP,education_domain:O.Z,education_email:L.Z,space_invite_link:rt.Z,public_email_domain:Ae.Z,user_data_consent_permissions:Mt.Z,access_request:s.ZP,template_tag:St.ZP,template_collection:vt.Z,page_visit:Ie.ZP,page_exit:xe.ZP,subscription:mt.ZP,space_domain:tt.Z,admin_api_log:c.Z,admin_api_op_log:d.Z,integration:ae.ZP,integration_token:le.Z,oauth_authorization_code:Se.Z,mfa_settings:ye.ZP,device:Z.ZP,user_device:Pt.Z,[q.PJ]:q.ZP,[H.r]:H.Z,[Ut.bf]:Ut.ZP,[Y.Dw]:Y.ZP,[Ft.t]:Ft.Z,team:ft.ZP,[He.O]:He.Z,[D.H]:D.Z,[oe.G]:oe.Z,[ne.l]:ne.Z,[Re.yo]:Re.ZP,[$.r9]:$.ZP,[V.Jd]:V.ZP,[j.mz]:j.ZP,[nt.F]:nt.Z,[de.Tu]:de.ZP,[b.cv]:b.ZP,[Ue.M]:Ue.Z,[Ze.b]:Ze.Z,[Oe.a]:Oe.Z,[ze.h]:ze.Z,[je.f1]:je.ZP,[Ke.P]:Ke.Z,[Ve.wM]:Ve.ZP,[Le.O]:Le.Z,[Ne.m]:Ne.Z,[qe.a]:qe.Z,[De.qV]:De.ZP,[Be.FM]:Be.ZP,[_.Xj]:_.ZP,[me.GL]:me.ZP,[ot.fF]:ot.ZP,[dt.x]:dt.ZP,[At.pm]:At.ZP,[et.L]:et.Z,[it.L9]:it.ZP,[ht.nE]:ht.ZP,[bt.zg]:bt.ZP,[yt.u]:yt.Z,[_t.Az]:_t.ZP,[ke.V7]:ke.ZP,[we.K]:we.Z,[u.y0]:u.ZP,[ut.M]:ut.Z,[We.AT]:We.ZP,[m.b]:m.Z,[p.P]:p.Z,[Me.P9]:Me.ZP,[h.t_]:h.ZP,[v.J4]:v.ZP,[pe.Bh]:pe.ZP,[gt.ah]:gt.ZP,[ge.m]:ge.Z,[he.Vj]:he.ZP,[ce.bC]:ce.ZP,[Pe.X]:Pe.ZP,[S.EK]:S.ZP,[ue.aO]:ue.ZP,[k.r]:k.Z,[Ge.Gs]:Ge.ZP,[E.p]:E.Z,[fe.m]:fe.Z,[ve.ZI]:ve.ZP,[ee.L_]:ee.ZP,[Te.k]:Te.Z,[Ee.eC]:Ee.ZP,[se.uV]:se.ZP,[re.S]:re.Z,[Bt.w]:Bt.Z,[Dt.m]:Dt.Z,[It.l]:It.Z,[y.SS]:y.ZP,[te.M]:te.Z,[T.ZP]:T.aq},Ot={customer:1,notion_user:2,space:3,space_bot:4,space_user:5,space_view:6,token:7,user_root:8,temporary_password:9,password:10,collection:11,collection_view:12,apple_token:13,google_token:14,follow:15,activity:16,notification:17,firebase_token:18,trello_token:19,asana_token:20,confluence_token:21,monday_token:22,external_entity:23,external_token:24,external_integration_app:25,slack_integration:26,slack_notification:27,discussion:28,comment:29,snapshot:30,credit:31,used_credit:32,user_settings:33,evernote_token:34,space_recover_pages:35,drive_token:36,block_token:37,user_metadata:38,bot:39,bot_token:40,saml_config:41,experiment:42,education_domain:43,education_email:44,space_invite_link:45,public_email_domain:46,user_data_consent_permissions:47,access_request:48,page_visit:49,page_exit:50,subscription:51,space_domain:52,admin_api_op_log:53,admin_api_log:54,integration:55,integration_token:56,oauth_authorization_code:57,mfa_settings:58,device:59,user_device:60,[q.PJ]:61,[H.r]:62,[Ut.bf]:63,[Y.Dw]:64,[Ft.t]:65,team:66,[He.O]:67,[D.H]:68,[oe.G]:69,[ne.l]:70,[Re.yo]:71,[$.r9]:72,[V.Jd]:73,[j.mz]:74,[nt.F]:75,[de.Tu]:76,[b.cv]:77,[Ue.M]:78,[Ze.b]:79,[Oe.a]:80,[ze.h]:81,[Ve.wM]:82,[je.f1]:83,[Ke.P]:84,[Le.O]:85,[Ne.m]:86,[qe.a]:87,[De.qV]:88,[Be.FM]:89,[_.Xj]:90,[ot.fF]:91,[dt.x]:92,[At.pm]:93,[et.L]:94,[it.L9]:95,[ht.nE]:96,[St.nt]:97,[bt.zg]:98,[yt.u]:99,[_t.Az]:100,[ke.V7]:101,[we.K]:102,[u.y0]:103,[ut.M]:104,[We.AT]:105,[m.b]:106,[Me.P9]:107,[h.t_]:108,[v.J4]:109,[pe.Bh]:110,[gt.ah]:111,[Pe.X]:112,[p.P]:113,[S.EK]:114,[ue.aO]:115,[ce.bC]:116,[k.r]:117,[ge.m]:118,[he.Vj]:119,[me.GL]:120,[Ge.Gs]:121,[E.p]:122,[fe.m]:123,[ve.ZI]:124,[ee.L_]:125,[Te.k]:126,[vt.O]:127,[Ee.eC]:128,[se.uV]:129,[re.S]:130,[Bt.w]:131,[Dt.m]:132,[It.l]:133,[y.SS]:134,[te.M]:135,[at.GQ]:136,[st.Py]:137,[T.ZP]:138,block:192};new Map(Object.entries(Ot).map((e=>{let[t,n]=e;return[n,t]}))),u.y0,b.cv,w.iU,I.cZ,P.np,A.x_,j.mz,q.PJ,Y.Dw,pe.Bh,ke.V7,Pe.X,Fe.Nw,We.AT,Je.bx,at.GQ,lt.e8,ft.e0,Ut.bf,Ge.Gs,y.SS,ke.V7;const Lt={block:!0,customer:!1,notion_user:!1,space:!0,space_bot:!0,space_permission_group:!0,space_permission_group_member:!0,space_user:!0,space_view:!0,token:!1,user_root:!1,temporary_password:!1,password:!1,collection:!0,collection_view:!0,apple_token:!1,google_token:!1,follow:!0,activity:!0,notification:!0,firebase_token:!1,trello_token:!1,asana_token:!1,confluence_token:!0,monday_token:!0,external_entity:!0,external_token:!1,external_integration_app:!1,slack_integration:!1,slack_notification:!1,discussion:!0,comment:!0,snapshot:!0,credit:!1,used_credit:!1,user_settings:!1,evernote_token:!1,space_recover_pages:!0,drive_token:!1,block_token:!1,user_metadata:!1,bot:!0,bot_token:!1,saml_config:!1,experiment:!1,education_domain:!1,education_email:!1,space_invite_link:!1,public_email_domain:!1,user_data_consent_permissions:!1,access_request:!1,page_visit:!0,page_exit:!0,subscription:!0,space_domain:!1,admin_api_op_log:!1,admin_api_log:!1,integration:!1,integration_token:!1,oauth_authorization_code:!1,mfa_settings:!1,device:!1,user_device:!1,[q.PJ]:!0,[H.r]:!0,[Ut.bf]:!0,[Y.Dw]:!0,[Ft.t]:!1,team:!0,[He.O]:!1,[D.H]:!1,[oe.G]:!1,[ne.l]:!1,[Re.yo]:!0,[$.r9]:!1,[V.Jd]:!1,[j.mz]:!1,[nt.F]:!1,[de.Tu]:!0,[b.cv]:!0,[Ue.M]:!0,[Ze.b]:!0,[Oe.a]:!1,[ze.h]:!1,[Ve.wM]:!1,[je.f1]:!1,[Ke.P]:!1,[Le.O]:!1,[Ne.m]:!1,[qe.a]:!1,[De.qV]:!0,[Be.FM]:!0,[_.Xj]:!0,[ot.fF]:!0,[dt.x]:!0,[At.pm]:!1,[et.L]:!1,[it.L9]:!0,[ht.nE]:!1,[St.nt]:!1,[bt.zg]:!1,[vt.O]:!1,[yt.u]:!1,[_t.Az]:!1,[ke.V7]:!1,[we.K]:!0,[u.y0]:!0,[ut.M]:!0,[We.AT]:!0,[m.b]:!1,[Me.P9]:!0,[h.t_]:!0,[v.J4]:!0,[pe.Bh]:!0,[gt.ah]:!0,[Pe.X]:!0,[p.P]:!0,[S.EK]:!1,[ue.aO]:!1,[ce.bC]:!1,[k.r]:!1,[ge.m]:!1,[he.Vj]:!1,[me.GL]:!1,[Ge.Gs]:!0,[E.p]:!0,[fe.m]:!1,[ve.ZI]:!1,[ee.L_]:!0,[Te.k]:!1,[Ee.eC]:!0,[se.uV]:!1,[re.S]:!1,[Bt.w]:!1,[Dt.m]:!1,[It.l]:!0,[y.SS]:!0,[te.M]:!0,[T.ZP]:!0};function jt(e){return Lt[e]}function Kt(e){return Ot[e]}function zt(e){return Vt[e]}const qt=(0,r.Yd)(Nt);function Ht(e){return qt.includes(e)}a.literals(...(0,i.XP)(Nt));const Gt={};o.M6(Nt,(e=>{e.columnTypes&&o.M6(e.columnTypes,((e,t)=>{t&&(Gt[t]=!0)}))}));const Wt=Nt},884323:(e,t,n)=>{n.d(t,{Z:()=>i,b:()=>r});var o=n(280873);const r="server_integrations__github_installation",i={table:r,columnTypes:{id:o.Z.UUID,bot_id:o.Z.UUID,installation_id:o.Z.String,space_id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number}}},801311:(e,t,n)=>{n.d(t,{M:()=>r,Z:()=>i});var o=n(280873);const r="server_integrations__jira_webhook",i={table:r,columnTypes:{id:o.Z.UUID,bot_id:o.Z.UUID,webhook_id:o.Z.Number,space_id:o.Z.UUID,version:o.Z.Number,user_id:o.Z.UUID,site:o.Z.String,webhook_details:o.Z.JSON,created_at:o.Z.Number,updated_at:o.Z.Number}}},983200:(e,t,n)=>{n.d(t,{ZP:()=>s,h1:()=>i,wM:()=>a});var o=n(280873),r=n(876096);const i={server_integrations__slack_enterprise:!0,server_integrations__slack_workspace:!0,server_integrations__slack_unique_global_user:!0},a="server_integrations__slack_bot_token",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number,access_token:o.Z.String,scopes:o.Z.StringArray,parent_table:o.Z.String,parent_id:o.Z.String},model:(0,r.y)({})}},367627:(e,t,n)=>{n.d(t,{Z:()=>i,m:()=>r});var o=n(280873);const r="server_integrations__slack_channel",i={table:r,columnTypes:{id:o.Z.UUID,slack_channel_id:o.Z.String,slack_workspace_id:o.Z.String,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number,preferences:o.Z.JSON}}},265963:(e,t,n)=>{n.d(t,{Z:()=>i,a:()=>r});var o=n(280873);const r="server_integrations__slack_enterprise",i={table:r,columnTypes:{id:o.Z.String,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number}}},714130:(e,t,n)=>{n.d(t,{O:()=>r,Z:()=>i});var o=n(280873);const r="server_integrations__slack_notion_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number,slack_unique_global_user_id:o.Z.UUID,access_token:o.Z.String,notion_workspace_id:o.Z.String,alive:o.Z.Boolean,notion_bot_id:o.Z.UUID}}},134406:(e,t,n)=>{n.d(t,{ZP:()=>i,f1:()=>r});var o=n(280873);const r="server_integrations__slack_unique_global_user",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number,slack_global_user_id:o.Z.String,slack_enterprise_id:o.Z.String,preferences:o.Z.JSON}}},342314:(e,t,n)=>{n.d(t,{P:()=>r,Z:()=>i});var o=n(280873);const r="server_integrations__slack_unique_local_user",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number,slack_workspace_id:o.Z.String,slack_local_user_id:o.Z.String,slack_unique_global_user_id:o.Z.UUID}}},616663:(e,t,n)=>{n.d(t,{Z:()=>i,h:()=>r});var o=n(280873);const r="server_integrations__slack_workspace",i={table:r,columnTypes:{id:o.Z.String,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number,slack_enterprise_id:o.Z.String,name:o.Z.String,icon:o.Z.String,preferences:o.Z.JSON}}},619221:(e,t,n)=>{n.d(t,{Z:()=>i,a:()=>r});var o=n(280873);const r="server_integrations__zendesk_token",i={table:r,columnTypes:{id:o.Z.UUID,bot_id:o.Z.UUID,zendesk_access_token:o.Z.String,notion_access_token:o.Z.String,zendesk_sub_domain:o.Z.String,zendesk_user_id:o.Z.Number,notion_proxy_token:o.Z.String,space_id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number}}},493646:(e,t,n)=>{n.d(t,{O:()=>r,Z:()=>i});var o=n(280873);const r="signup_tracking",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,email:o.Z.String,variant:o.Z.String,temporary_password:o.Z.String,csrf_token:o.Z.String,attribution_data:o.Z.JSON,created_at:o.Z.Number,user_id:o.Z.UUID,link_opened:o.Z.Boolean,link_opened_at:o.Z.Number}}},715539:(e,t,n)=>{n.d(t,{Gs:()=>a,ZP:()=>s,d6:()=>i});var o=n(280873),r=n(876096);const i={block:!0},a="site",s={table:a,columnTypes:{id:o.Z.UUID,type:o.Z.String,space_id:o.Z.UUID,domain_id:o.Z.UUID,parent_id:o.Z.String,parent_table:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_time:o.Z.Number,created_by_id:o.Z.UUID,created_by_table:o.Z.String,last_edited_time:o.Z.Number,last_edited_by_id:o.Z.UUID,last_edited_by_table:o.Z.String,favicon_url:o.Z.String,preview_image_url:o.Z.String,header:o.Z.JSON,google_analytics_id:o.Z.String,is_search_engine_indexing_enabled:o.Z.Boolean,settings:o.Z.JSON},requiredColumns:{id:!0,space_id:!0,parent_id:!0,parent_table:!0,version:!0},model:(0,r.y)({RecordStore:!0})}},91644:(e,t,n)=>{n.d(t,{AT:()=>a,ZP:()=>s,yP:()=>i});var o=n(280873),r=n(876096);const i={block:!0,space:!0},a="skill",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,type:o.Z.String,settings:o.Z.JSON,parent_id:o.Z.UUID,parent_table:o.Z.String,space_id:o.Z.UUID,alive:o.Z.Boolean,created_time:o.Z.Number,created_by_id:o.Z.UUID,created_by_table:o.Z.String,last_edited_time:o.Z.Number,last_edited_by_id:o.Z.UUID,last_edited_by_table:o.Z.String,blocks:o.Z.StringArray,instructions:o.Z.JSON,name:o.Z.String,icon:o.Z.String,permissions:o.Z.JSON},model:(0,r.y)({RecordStore:!0,properties:{settings:{getKeyStoreMethod:!1}}})}},563787:(e,t,n)=>{n.d(t,{ZP:()=>s,iP:()=>i,s_:()=>a});var o=n(280873),r=n(876096);const i={block:!0},a="slack_integration",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,team_name:o.Z.String,channel:o.Z.String,channel_id:o.Z.String,configuration_url:o.Z.String,webhook_url:o.Z.String,enabled:o.Z.Boolean,parent_id:o.Z.UUID,parent_table:o.Z.String,channel_locale:o.Z.String},model:(0,r.y)({RecordStore:!0})}},838952:(e,t,n)=>{n.d(t,{A:()=>r,Z:()=>i});var o=n(280873);const r="slack_notification",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,sent:o.Z.Boolean}}},840837:(e,t,n)=>{n.d(t,{ZP:()=>s,bW:()=>i,rp:()=>a});var o=n(280873),r=n(876096);const i={block:!0,collection:!0},a="snapshot",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,parent_table:o.Z.String,parent_id:o.Z.UUID,collection_ids:o.Z.UUIDArray,inline_collection_block_ids:o.Z.UUIDArray,timestamp:o.Z.String,authors:o.Z.JSON,space_id:o.Z.UUID},model:(0,r.y)({})}},665635:(e,t,n)=>{n.d(t,{BA:()=>c,HY:()=>d,IK:()=>u,Wi:()=>g,ZP:()=>h,Zx:()=>f,k1:()=>m,mR:()=>s,td:()=>l,vz:()=>p});var o=n(307032),r=(n(401898),n(159730)),i=n(280873),a=n(876096);function s(e){return e.table===f&&function(e){const t=e.split("|"),[n,r]=t;return 2===t.length&&(0,o.e)(n)&&(0,o.e)(r)}(e.id)}function l(e){const t=e.split("|"),[n,i]=t;if(!(2===t.length&&(0,o.e)(n)&&(0,o.e)(i)))throw new r.p8("invalid SpaceBotId",{data:{id:e}});return{botId:n,spaceId:i}}function c(e){const{botId:t,spaceId:n}=e;return`${t}|${n}`}function d(e){const{botId:t,spaceId:n}=e;return{id:c({botId:t,spaceId:n}),table:f,spaceId:n}}function u(e,t,n){return{id:c({botId:e.bot_id,spaceId:t}),bot_id:e.bot_id,space_id:t,membership_type:p(e.role),bot_parent_id:e.parent_id,bot_parent_table:e.parent_table,version:n}}function p(e){return"editor"===e?"bot_owner":"none"}function m(e){return"bot_owner"===e}function g(e){return"none"===e}const f="space_bot",h={table:f,columnTypes:{id:i.Z.String,bot_id:i.Z.String,space_id:i.Z.String,membership_type:i.Z.String,bot_parent_table:i.Z.String,bot_parent_id:i.Z.UUID,version:i.Z.Number,last_version:i.Z.Number},model:(0,a.y)({RecordStore:!0})}},396740:(e,t,n)=>{n.d(t,{L:()=>i,Z:()=>a});var o=n(280873),r=n(876096);const i="space_content_duplication_lookup",a={table:i,columnTypes:{id:o.Z.UUID,source_space_id:o.Z.UUID,target_space_id:o.Z.UUID,source_id:o.Z.UUID,source_type:o.Z.String,version:o.Z.Number,last_version:o.Z.Number,created_time:o.Z.Number},model:(0,r.y)({properties:{source_id:{getRelationalPointerMethod:!1}}})}},755514:(e,t,n)=>{n.d(t,{Z:()=>i,r:()=>r});var o=n(280873);const r="space_domain",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,domain:o.Z.String,is_autogenerated:o.Z.Boolean}}},975990:(e,t,n)=>{n.d(t,{F:()=>i,Z:()=>a});var o=n(280873),r=n(876096);const i="space_email_domain",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_created_by_id:o.Z.UUID,space_created_by_table:o.Z.String,space_created_by_email_domain:o.Z.String},model:(0,r.y)({properties:{space_created_by_id:{getRelationalPointerMethod:!1}}})}},57829:(e,t,n)=>{n.d(t,{ZP:()=>a,fF:()=>i});var o=n(280873),r=n(876096);const i="space_entitlement_usage",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number,space_id:o.Z.UUID,type:o.Z.String,usage:o.Z.Number,unit:o.Z.String},requiredColumns:{id:!0,version:!0,created_at:!0,updated_at:!0,space_id:!0,type:!0,usage:!0,unit:!0},model:(0,r.y)({})}},963188:(e,t,n)=>{n.d(t,{V:()=>i,Z:()=>a});var o=n(280873),r=n(876096);const i="space_invite_link",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.String,invite_link_code:o.Z.String,inviter_user_id:o.Z.UUID,channel:o.Z.String},model:(0,r.y)({RecordStore:!0})}},556877:(e,t,n)=>{n.d(t,{L9:()=>i,ZP:()=>a});var o=n(280873),r=n(876096);const i="space_membership_update",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.UUID,created_at:o.Z.Number,is_processed:o.Z.Boolean,attributes:o.Z.JSON,effective_time:o.Z.Number,processed_time:o.Z.Number},requiredColumns:{id:!0,version:!0,space_id:!0,created_at:!0,is_processed:!0,effective_time:!0},model:(0,r.y)({})}},591937:(e,t,n)=>{n.d(t,{GQ:()=>s,L9:()=>c,cA:()=>l,iA:()=>d,nZ:()=>u});var o=n(307032),r=(n(159730),n(280873)),i=n(876096);const a="|",s="space_permission_group";function l(e){return e.table===s&&function(e){const t=e.split(a),[n,r]=t;return 2===t.length&&(0,o.e)(n)&&(0,o.e)(r)}(e.id)}function c(e){const{spacePermissionGroupId:t,spaceId:n}=e;return`${t}|${n}`}function d(e){const{spacePermissionGroupId:t,spaceId:n}=e;return{id:c({spacePermissionGroupId:t,spaceId:n}),table:s,spaceId:n}}const u={table:s,columnTypes:{id:r.Z.String,version:r.Z.Number,last_version:r.Z.Number,name:r.Z.String,icon:r.Z.String,space_id:r.Z.UUID,group_id:r.Z.UUID,created_by_id:r.Z.UUID,created_by_table:r.Z.String,created_at:r.Z.Number,last_edited_by_table:r.Z.String,last_edited_by_id:r.Z.UUID,last_edited_at:r.Z.Number,deleted_at:r.Z.Number},model:(0,i.y)({RecordStore:!0})}},307591:(e,t,n)=>{n.d(t,{Py:()=>s,Ss:()=>d,aA:()=>l,ed:()=>c,hU:()=>u});var o=n(307032),r=(n(159730),n(280873)),i=n(876096);const a="|",s="space_permission_group_member";function l(e){return e.table===s&&function(e){const t=e.split(a),[n,r,i]=t;return 3===t.length&&(0,o.e)(n)&&(0,o.e)(r)&&(0,o.e)(i)}(e.id)}function c(e){const{userId:t,spacePermissionGroupId:n,spaceId:o}=e;return`${t}|${n}|${o}`}function d(e){return{id:c(e),table:s,spaceId:e.spaceId}}const u={table:s,columnTypes:{id:r.Z.String,space_id:r.Z.UUID,space_permission_group_id:r.Z.UUID,user_id:r.Z.UUID,version:r.Z.Number,last_version:r.Z.Number,removed_at:r.Z.Number},model:(0,i.y)({RecordStore:!0})}},276413:(e,t,n)=>{n.d(t,{ZP:()=>i,e8:()=>r});n(307032);var o=n(280873);const r="space_recover_pages",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,user_id:o.Z.UUID,space_id:o.Z.UUID,pages:o.Z.StringArray,created_time:o.Z.Number,last_edited_time:o.Z.Number}}},947969:(e,t,n)=>{n.d(t,{Ci:()=>h,Hv:()=>m,KQ:()=>c,L6:()=>S,Ni:()=>d,Po:()=>p,WU:()=>k,Wi:()=>_,X$:()=>l,ZP:()=>w,dy:()=>y,k1:()=>v,nJ:()=>b,pW:()=>f,qF:()=>g,v8:()=>u});var o=n(307032),r=n(401898),i=n(159730),a=n(280873),s=n(876096);function l(e){return e.table===k&&function(e){const t=e.split("|"),[n,r]=t;return 2===t.length&&(0,o.e)(n)&&(0,o.e)(r)}(e.id)}function c(e){const t=e.split("|"),[n,r]=t;if(!(2===t.length&&(0,o.e)(n)&&(0,o.e)(r)))throw new i.p8("invalid SpaceUserId",{data:{id:e}});return{userId:n,spaceId:r}}function d(e){const{userId:t,spaceId:n}=e;return`${t}|${n}`}function u(e){const{userId:t,spaceId:n}=e;return{id:d({userId:t,spaceId:n}),table:k,spaceId:n}}function p(e,t,n){return{id:d({userId:e.user_id,spaceId:t}),user_id:e.user_id,space_id:t,invite_id:e.invite_id,membership_type:m(e.role),version:n}}function m(e){return"read_and_write"===e?"member":"membership_admin"===e?"membership_admin":"editor"===e?"owner":"none"}function g(e){return"member"===e?"read_and_write":"membership_admin"===e?"membership_admin":"owner"===e?"editor":void(0,r.t1)(e)}function f(e){return"member"===e?"read_and_write":"membership_admin"===e?"membership_admin":"owner"===e?"editor":"none"===e||"page_guest"===e?"none":void(0,r.t1)(e)}function h(e){return"read_and_write"===e?"member":"membership_admin"===e?"membership_admin":"editor"===e?"owner":"none"}function v(e){return"owner"===e}function y(e){return"owner"===e||"membership_admin"===e}function b(e){return"page_guest"===e}function _(e){return"none"===e}function S(e){return!_(e)&&!b(e)}const k="space_user",w={table:k,columnTypes:{id:a.Z.String,user_id:a.Z.String,space_id:a.Z.String,membership_type:a.Z.String,invite_id:a.Z.String,version:a.Z.Number,last_version:a.Z.Number},model:(0,s.y)({RecordStore:!0})}},147238:(e,t,n)=>{n.d(t,{ZP:()=>a,x:()=>i});var o=n(280873),r=n(876096);const i="space_user_entitlement_usage",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,created_at:o.Z.Number,updated_at:o.Z.Number,space_id:o.Z.UUID,user_id:o.Z.UUID,type:o.Z.String,usage:o.Z.Number,unit:o.Z.String},requiredColumns:{id:!0,version:!0,created_at:!0,updated_at:!0,space_id:!0,user_id:!0,type:!0,usage:!0,unit:!0},model:(0,r.y)({})}},935623:(e,t,n)=>{n.d(t,{M:()=>i,Z:()=>a});var o=n(280873),r=n(876096);const i="space_user_recovery",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.UUID,user_id:o.Z.UUID,created_time:o.Z.Number,type:o.Z.String,block_id:o.Z.UUID,team_id:o.Z.UUID,permission_group_id:o.Z.UUID,permission_role:o.Z.String,membership_type:o.Z.String,restored_time:o.Z.Number,restored_by_id:o.Z.UUID,restored_by_table:o.Z.String},requiredColumns:{id:!0,version:!0,created_time:!0,space_id:!0,user_id:!0,type:!0},model:(0,r.y)({})}},577858:(e,t,n)=>{n.d(t,{AQ:()=>i,ZP:()=>s,zU:()=>a});var o=n(280873),r=n(876096);const i={user_root:!0},a="space_view",s={table:a,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.UUID,bookmarked_pages:o.Z.StringArray,shared_pages:o.Z.StringArray,shared_pages_manual_sort:o.Z.StringArray,visited_templates:o.Z.StringArray,sidebar_order:o.Z.StringArray,sidebar_hidden_templates:o.Z.StringArray,notify_mobile:o.Z.Boolean,notify_desktop:o.Z.Boolean,notify_email:o.Z.Boolean,notify_email_always:o.Z.Boolean,created_getting_started:o.Z.Boolean,parent_id:o.Z.UUID,parent_table:o.Z.String,alive:o.Z.Boolean,created_onboarding_templates:o.Z.Boolean,private_pages:o.Z.UUIDArray,joined:o.Z.Boolean,joined_teams:o.Z.UUIDArray,settings:o.Z.JSON,ai_suggestions:o.Z.JSON,assistant_session_starters:o.Z.UUIDArray,first_joined_space_time:o.Z.Number},model:(0,r.y)({RecordStore:!0,properties:{bookmarked_pages:{getMethod:"getBookmarkedPageIds",getKeyStoreMethod:"getBookmarkedPagesStore"},shared_pages:{getMethod:"getSharedPageIds",getKeyStoreMethod:"getSharedPagesStore"},shared_pages_manual_sort:{getMethod:"getSharedPagesManualSortIds",getKeyStoreMethod:"getSharedPagesManualSortStore"},private_pages:{getMethod:"getPrivatePageIds",getKeyStoreMethod:"getPrivatePagesStore"},visited_templates:{getMethod:"getVisitedTemplateIds",getKeyStoreMethod:"getVisitedTemplatesStore"},sidebar_hidden_templates:{getMethod:"getSidebarHiddenTemplateIds",getKeyStoreMethod:"getSidebarHiddenTemplatesStore"},assistant_session_starters:{getMethod:"getAssistantSessionStarterIds",getKeyStoreMethod:"getAssistantSessionStartersStore"}}})}},537202:(e,t,n)=>{n.d(t,{FU:()=>r,ZP:()=>i});n(307032);var o=n(280873);const r="subscription",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_id:o.Z.UUID,provider:o.Z.String,api_version:o.Z.String,product:o.Z.String,expires_at:o.Z.Number,data:o.Z.JSON,updated_at:o.Z.Number,write_id:o.Z.UUID},requiredColumns:{space_id:!0,provider:!0,data:!0,updated_at:!0}}},263368:(e,t,n)=>{n.d(t,{ZP:()=>s,ah:()=>a,hJ:()=>i});var o=n(280873),r=n(876096);const i={space:!0},a="subscription_banner",s={table:a,columnTypes:{id:o.Z.UUID,space_id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,parent_id:o.Z.UUID,parent_table:o.Z.String,banner_type:o.Z.String,banner_key:o.Z.String,audience:o.Z.String,banner_text:o.Z.String,active_at:o.Z.Number,expired_at:o.Z.Number},requiredColumns:{space_id:!0,version:!0,parent_id:!0,parent_table:!0,banner_type:!0,banner_key:!0,audience:!0,active_at:!0},defaultColumnValues:{},model:(0,r.y)({RecordStore:!0})}},826195:(e,t,n)=>{n.d(t,{ZP:()=>a,nE:()=>i});var o=n(280873),r=n(876096);const i="template",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,contentful_id:o.Z.String,name:o.Z.String,slug:o.Z.String,locale:o.Z.String,description:o.Z.String,price:o.Z.Number,authors:o.Z.StringArray,made_by:o.Z.String,tags:o.Z.StringArray,body:o.Z.JSON,attributes:o.Z.JSON,block_id:o.Z.UUID,created_at:o.Z.Number,last_updated_at:o.Z.Number,published_version:o.Z.Number,last_synced_at:o.Z.Number,all_tags:o.Z.StringArray,number_of_duplicates:o.Z.Number,score_1:o.Z.Number,score_2:o.Z.Number,score_3:o.Z.Number,score_4:o.Z.Number,score_5:o.Z.Number,show_in_gallery:o.Z.Boolean,template_draft_id:o.Z.UUID,template_draft_version:o.Z.Number,tags_v2:o.Z.StringArray,all_tags_v2:o.Z.StringArray},requiredColumns:{id:!0,version:!0,contentful_id:!0,name:!0,slug:!0,locale:!0,description:!0,made_by:!0,attributes:!0,created_at:!0,last_updated_at:!0,published_version:!0,last_synced_at:!0,number_of_duplicates:!0,score_1:!0,score_2:!0,score_3:!0,score_4:!0,score_5:!0,show_in_gallery:!0},model:(0,r.y)({RecordStore:!0})}},614450:(e,t,n)=>{n.d(t,{O:()=>i,Z:()=>a});var o=n(280873),r=n(876096);const i="template_collection",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,contentful_id:o.Z.String,name:o.Z.String,slug:o.Z.String,authors:o.Z.StringArray,locale:o.Z.String,templates:o.Z.StringArray,description:o.Z.String,long_description:o.Z.String,collection_body:o.Z.JSON,meta_title:o.Z.String,meta_description:o.Z.String,last_version:o.Z.Number,published_version:o.Z.Number,created_at:o.Z.Number,last_updated_at:o.Z.Number,last_synced_at:o.Z.Number,published_at:o.Z.Number,attributes:o.Z.JSON,display_in_app:o.Z.Boolean},requiredColumns:{id:!0,version:!0,contentful_id:!0,name:!0,slug:!0,authors:!0,locale:!0,templates:!0,description:!0,long_description:!0,meta_title:!0,meta_description:!0,published_version:!0,created_at:!0,last_updated_at:!0,last_synced_at:!0,published_at:!0},model:(0,r.y)({RecordStore:!0})}},314718:(e,t,n)=>{n.d(t,{Z:()=>a,u:()=>i});var o=n(280873),r=n(876096);const i="template_content_group",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,contentful_id:o.Z.String,title:o.Z.String,contents:o.Z.JSON,published_version:o.Z.Number,created_at:o.Z.Number,last_updated_at:o.Z.Number,last_synced_at:o.Z.Number,locale:o.Z.String,category_id:o.Z.String},requiredColumns:{id:!0,version:!0,contentful_id:!0,title:!0,contents:!0,published_version:!0,created_at:!0,last_updated_at:!0,last_synced_at:!0,locale:!0},model:(0,r.y)({RecordStore:!0})}},614327:(e,t,n)=>{n.d(t,{ZP:()=>a,zg:()=>i});var o=n(280873),r=n(876096);const i="template_creator",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,contentful_id:o.Z.String,name:o.Z.String,username:o.Z.String,is_template_creator:o.Z.Boolean,user_id:o.Z.String,attributes:o.Z.JSON,published_version:o.Z.Number,created_at:o.Z.Number,last_updated_at:o.Z.Number,last_synced_at:o.Z.Number,number_of_templates:o.Z.Number,template_image:o.Z.JSON,tags:o.Z.StringArray,number_of_duplicates:o.Z.Number,score_1:o.Z.Number,score_2:o.Z.Number,score_3:o.Z.Number,score_4:o.Z.Number,score_5:o.Z.Number,is_featured_creator:o.Z.Boolean,is_certified_consultant:o.Z.Boolean,stripe_connected_account_id:o.Z.String,stripe_connect_onboarding_phase:o.Z.String,status:o.Z.String,is_technology_partner:o.Z.Boolean},model:(0,r.y)({RecordStore:!0})}},71495:(e,t,n)=>{n.d(t,{Az:()=>i,ZP:()=>a});var o=n(280873),r=n(876096);const i="template_draft",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,contentful_id:o.Z.String,name:o.Z.String,slug:o.Z.String,locale:o.Z.String,description:o.Z.String,price:o.Z.Number,authors:o.Z.StringArray,made_by:o.Z.String,tags:o.Z.StringArray,attributes:o.Z.JSON,block_id:o.Z.UUID,created_at:o.Z.Number,last_updated_at:o.Z.Number,published_version:o.Z.Number,status:o.Z.String,draft_attributes:o.Z.JSON},requiredColumns:{id:!0,version:!0,contentful_id:!0,name:!0,slug:!0,locale:!0,description:!0,made_by:!0,attributes:!0,created_at:!0,last_updated_at:!0,published_version:!0,status:!0,draft_attributes:!0},model:(0,r.y)({RecordStore:!0})}},453412:(e,t,n)=>{n.d(t,{ZP:()=>a,nt:()=>i});var o=n(280873),r=n(876096);const i="template_tag",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,contentful_id:o.Z.String,name:o.Z.String,slug:o.Z.String,locale:o.Z.String,description:o.Z.String,contentful_parent_id:o.Z.String,icon:o.Z.JSON,published_version:o.Z.Number,created_at:o.Z.Number,last_updated_at:o.Z.Number,last_synced_at:o.Z.Number,subcategory_contentful_ids:o.Z.StringArray,featured_template_contentful_ids:o.Z.StringArray,attributes:o.Z.JSON,number_of_templates:o.Z.Number,template_image:o.Z.JSON,score_1:o.Z.Number,score_2:o.Z.Number,score_3:o.Z.Number,score_4:o.Z.Number,score_5:o.Z.Number,subcategory_contentful_ids_v2:o.Z.StringArray,hide_in_web_gallery:o.Z.Boolean,show_in_app:o.Z.Boolean,number_of_templates_v2:o.Z.Number},requiredColumns:{id:!0,version:!0,contentful_id:!0,name:!0,slug:!0,locale:!0,description:!0,icon:!0,published_version:!0,created_at:!0,last_updated_at:!0,last_synced_at:!0,attributes:!0,number_of_templates:!0,score_1:!0,score_2:!0,score_3:!0,score_4:!0,score_5:!0,hide_in_web_gallery:!0,show_in_app:!0,number_of_templates_v2:!0},model:(0,r.y)({RecordStore:!0})}},965836:(e,t,n)=>{n.d(t,{ZP:()=>i,jA:()=>r});var o=n(280873);const r="temporary_password",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,password:o.Z.String,timestamp:o.Z.Number,use_case:o.Z.String}}},705505:(e,t,n)=>{n.d(t,{ZP:()=>a,uK:()=>i});var o=n(280873),r=n(876096);const i="token",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,user_id:o.Z.UUID,timestamp:o.Z.Number,revoked:o.Z.Boolean,user_ids:o.Z.UUIDArray,auth_types:o.Z.JSON,admin_user_id:o.Z.UUID,expiration_settings:o.Z.JSON,refresh_time:o.Z.Number,versions:o.Z.NumberArray},model:(0,r.y)({})}},266295:(e,t,n)=>{n.d(t,{O:()=>r,Z:()=>i});var o=n(280873);const r="trello_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,account:o.Z.String,request_token:o.Z.String,request_secret:o.Z.String,access_token:o.Z.String,access_secret:o.Z.String}}},638086:(e,t,n)=>{n.d(t,{Z:()=>a,l:()=>i});var o=n(280873),r=n(876096);const i="trusted_domain",a={table:i,columnTypes:{id:o.Z.UUID,space_id:o.Z.UUID,email_domain:o.Z.String,domain_link_sharing_enabled:o.Z.Boolean,join_space_method:o.Z.String,version:o.Z.Number,last_version:o.Z.Number},model:(0,r.y)({RecordStore:!0})}},110354:(e,t,n)=>{n.d(t,{I:()=>r,Z:()=>i});var o=n(280873);const r="used_credit",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,amount:o.Z.Number}}},19716:(e,t,n)=>{n.d(t,{V:()=>r,Z:()=>i});var o=n(280873);const r="user_data_consent_permissions",i={table:r,columnTypes:{id:o.Z.String,version:o.Z.Number,last_version:o.Z.Number,expiry_time:o.Z.Number}}},976244:(e,t,n)=>{n.d(t,{Z:()=>a,e:()=>i});var o=n(280873),r=n(876096);const i="user_device",a={table:i,columnTypes:{id:o.Z.UUID,user_id:o.Z.UUID,device_id:o.Z.UUID,token_id:o.Z.UUID,created_at:o.Z.Number,last_login_at:o.Z.Number,last_login_ip_address:o.Z.String,last_login_geographic_location:o.Z.String,last_seen_time:o.Z.Number,version:o.Z.Number,last_version:o.Z.Number,revoked:o.Z.Boolean},model:(0,r.y)({})}},598897:(e,t,n)=>{n.d(t,{ZP:()=>s,pm:()=>a});var o=n(212847),r=n(280873),i=n(876096);const a="user_export",s=(o.literals("member_list","space","block","space_analytics_search","space_analytics_content","space_analytics_users","admin_content_search","audit_log","post_workspace_consolidation_report","domain_claimable_spaces"),{table:a,columnTypes:{id:r.Z.UUID,created_at:r.Z.Number,created_by_table:r.Z.String,created_by_id:r.Z.UUID,file_ids:r.Z.StringArray,type:r.Z.String,version:r.Z.Number,last_version:r.Z.Number},model:(0,i.y)({properties:{created_by_id:{getRelationalPointerMethod:!1}}})})},563408:(e,t,n)=>{n.d(t,{Z:()=>i,j:()=>r});var o=n(280873);const r="user_metadata",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,metadata:o.Z.JSON,updated_at:o.Z.Number}}},917730:(e,t,n)=>{n.d(t,{Z:()=>a,m:()=>i});var o=n(280873),r=n(876096);const i="user_oauth_access_token",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,access_token:o.Z.String,user_id:o.Z.UUID,client_id:o.Z.UUID,created_at:o.Z.Number,revoked_at:o.Z.Number,expires_at:o.Z.Number},model:(0,r.y)({})}},789713:(e,t,n)=>{n.d(t,{Z:()=>a,w:()=>i});var o=n(280873),r=n(876096);const i="user_oauth_authorization_code",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,user_id:o.Z.UUID,client_id:o.Z.UUID,created_at:o.Z.Number,expires_at:o.Z.Number,revoked_at:o.Z.Number},model:(0,r.y)({})}},766079:(e,t,n)=>{n.d(t,{ZP:()=>a,dx:()=>i});var o=n(280873),r=n(876096);const i="user_root",a={table:i,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,space_views:o.Z.StringArray,space_view_pointers:o.Z.JSON,left_spaces:o.Z.StringArray,deleted_email:o.Z.String},model:(0,r.y)({RecordStore:!0,properties:{space_views:{getMethod:!1},space_view_pointers:{getMethod:!1}}})}},758161:(e,t,n)=>{n.d(t,{Z:()=>i,t:()=>r});var o=n(280873);const r="user_session_auth_token",i={table:r,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,expires_at:o.Z.Number,cookies:o.Z.JSON,source_type:o.Z.String}}},328182:(e,t,n)=>{n.d(t,{AQ:()=>i,Sr:()=>s,ZP:()=>l,dF:()=>a});var o=n(280873),r=n(876096);const i=["not_seen","space_for_ai","ask_ai_anything","refine_ai_response","complete"],a=["unseen","home","views","owner","verification","tags","complete"],s="user_settings",l={table:s,columnTypes:{id:o.Z.UUID,version:o.Z.Number,last_version:o.Z.Number,settings:o.Z.JSON},model:(0,r.y)({RecordStore:!0})}},35794:(e,t,n)=>{n.d(t,{AO:()=>i,ZP:()=>s,bf:()=>a});var o=n(280873),r=n(876096);const i={space:!0},a="webhook_subscription",s={table:a,columnTypes:{id:o.Z.UUID,bot_id:o.Z.UUID,webhook_url:o.Z.String,webhook_secret:o.Z.String,parent_id:o.Z.UUID,parent_table:o.Z.String,space_id:o.Z.UUID,api_version:o.Z.String,health:o.Z.JSON,version:o.Z.Number,last_version:o.Z.Number,created_by_table:o.Z.String,created_by_id:o.Z.UUID,last_edited_by_table:o.Z.String,last_edited_by_id:o.Z.UUID,created_time:o.Z.Number,last_edited_time:o.Z.Number,webhook_customization:o.Z.JSON},model:(0,r.y)({RecordStore:!0})}},153772:(e,t,n)=>{function o(e){return"development"===e.env||"local"===e.env||e.isAdminMode}n.d(t,{x:()=>o})},494804:(e,t,n)=>{n.d(t,{A7:()=>i,LO:()=>c,fe:()=>s,nZ:()=>l,rE:()=>a});var o=n(401898),r=n(915157);function i(e){let{searchSessionId:t,searchSessionFlowNumber:n}=e;if((0,o.$K)(t)&&(0,o.$K)(n))return`1:${t}:${n}`}const a="SearchShowFilterBar";function s(e){return function(e){const{key:t,userId:n,defaultValue:o}=e,i=r.Z.get({userId:n,key:t});if(void 0===i)return o;if("boolean"!=typeof i)return!1;return i}({key:a,userId:e,defaultValue:!1})}const l=/(?:\s|^)-("[^"]+"|[\w]+)(?=\s|$)/g,c=/(?:\s|^)"([^"]*)"(?=\s|$)/g},492338:(e,t,n)=>{n.d(t,{GA:()=>x,Ix:()=>M,Pe:()=>T,Um:()=>A,dK:()=>R,iY:()=>d,ik:()=>C,jl:()=>m,lZ:()=>g,n8:()=>u,u4:()=>p,vp:()=>I});var o=n(709291),r=n(212847),i=n(494714),a=n(541432);const s=r.object({required:{type:r.literal("date"),start_date:r.string()},optional:{}}),l=r.union([r.object({required:{starting:s,ending:r.isUndefined()},optional:{}}),r.object({required:{starting:r.isUndefined(),ending:s},optional:{}}),r.object({required:{starting:s,ending:s},optional:{}}),r.object({required:{starting:r.isUndefined(),ending:r.isUndefined()},optional:{}})]),c=r.union([r.array(r.string()),r.object({required:{teamIds:r.array(r.string()),includeSpaceRecords:r.boolean()},optional:{}})]);function d(e){if(e)return Array.isArray(e)?e:e.teamIds?e.teamIds:void 0}r.object({required:{id:r.string(),type:r.union([r.literal("user"),r.literal("permission_group")])},optional:{}});let u=function(e){return e.CollectionsInSpace="CollectionsInSpace",e.BlocksInSpace="BlocksInSpace",e.BlocksInAncestor="BlocksInAncestor",e.BlocksInParent="BlocksInParent",e.BlocksInCollection="BlocksInCollection",e}({});r.object({required:{ancestors:r.array(r.string()),createdBy:r.array(r.string()),editedBy:r.array(r.string()),lastEditedTime:l,createdTime:l},optional:{requireEditPermissions:r.boolean(),isDeletedOnly:r.boolean(),excludeTemplates:r.boolean(),isAdminModeDeletedPageSearch:r.boolean(),blockTypes:r.minLength(r.array(r.literals(...Object.keys(a.Ti))),1),inTeams:c,navigableBlockContentOnly:r.boolean(),includePublicPagesWithoutExplicitAccess:r.boolean(),audience:r.array(r.literals("private","shared_internally","shared_externally","shared_to_web")),dev_excludedPages:r.array(r.string()),dev_excludedTeams:r.array(r.string()),parentId:r.string(),databaseType:r.array(r.literals(...i.fW)),adminContentSearchDeletionStatus:r.nonEmpty(r.array(r.literals("in_trash","deleted_from_trash","alive")))}});function p(e){return{isDeletedOnly:!1,excludeTemplates:!1,navigableBlockContentOnly:!1,requireEditPermissions:!1,includePublicPagesWithoutExplicitAccess:!1,ancestors:[],parentId:void 0,createdBy:[],editedBy:[],lastEditedTime:{starting:void 0,ending:void 0},createdTime:{starting:void 0,ending:void 0},inTeams:[],...e}}function m(e,t){return{...e,...t,createdTime:{...e.createdTime,...t.createdTime},lastEditedTime:{...e.lastEditedTime,...t.lastEditedTime}}}const g={searchModal:"search_modal",searchModalQueueTask:"search_modal_queue_task"},f=["question_answer_context_search","question_answer_limited_content_search"],h=["cron_attachment_search_input_change","cron_attachment_parent_search_input_change","cron_time_collection_views_query"],v=["legacy_searchPagesWithParent","relation_setup_menu"],y=r.union([...["quick_find","quick_find_public","quick_find_input_change","quick_find_scroll","quick_find_filters","quick_find_ancestor_filter","quick_find_navigational_mode"].map(r.literal),...h.map(r.literal),...f.map(r.literal),...v.map(r.literal),r.literal("ancestor_filter_page_search"),r.literal("debugging"),r.literal("report_bad_search"),r.literal("trash"),r.literal("link_to_page_block"),r.literal("link_to_collection_block"),r.literal("mention_menu"),r.literal("move_to_menu"),r.literal("public_home_page_menu"),r.literal("relation_menu"),r.literal("web_clipper"),r.literal("oauth"),r.literal("collection_group_value"),r.literal("collection_settings_source"),r.literal("collection_settings_select_relation_source"),r.literal("admin_search_permanently_deleted_pages"),r.literal("bot_iterate_blocks_in_space"),r.literal("api_unknown"),r.literal("simple_formula_value_page_search"),r.literal("automation_page_picker"),r.literal("automation_collection_picker"),r.literal("admin_content_search"),r.literal("ediscovery_search_api"),r.literal("admin_content_search_export"),r.literal("export_content_analytics"),r.literal("send_to_notion_database_options"),r.literal("send_to_notion_project_options"),r.literal("search_content_analytics"),r.literal("search_unique_id"),r.literal("collection_page_tree_query"),r.literal("assistant_scoped_search_menu"),r.literal("assistant_search_databases"),r.literal("benchmark_tests"),r.literal("audit_log"),r.literal("ui_doc")]),b=r.union([r.literal("bulk_index_records")]),_=r.union([r.literal("permanently_delete_space")]),S=(r.union([y,b,_]),["lastEdited","created","scroll","id",...Object.keys({pageViewsLast7Days:"pageViews.pageViewsLast7Days",pageViewsLast28Days:"pageViews.pageViewsLast28Days",pageViewsLast90Days:"pageViews.pageViewsLast90Days",pageViewsAllTime:"pageViews.pageViewsAllTime",uniquePageViewsLast7Days:"uniquePageViews.uniquePageViewsLast7Days",uniquePageViewsLast28Days:"uniquePageViews.uniquePageViewsLast28Days",uniquePageViewsLast90Days:"uniquePageViews.uniquePageViewsLast90Days",uniquePageViewsAllTime:"uniquePageViews.uniquePageViewsAllTime"})]),k=r.object({required:{field:r.literals("relevance")},optional:{}}),w=r.object({required:{field:r.literals(...S),direction:r.literals("asc","desc")},optional:{missing:r.union([r.literal("_first"),r.literal("_last"),r.number(),r.boolean(),r.string()]),searchAfter:r.undefinable(r.union([r.number(),r.string()]))}}),x=r.union([k,w]);let I=function(e){return e.Local="local",e.ElasticSearch="es",e.Postgres="pg",e.VectorDBBlock="vector_block",e.VectorDBCollection="vector_collection",e.ElasticsearchRandom="es_random",e.ElasticsearchUniqueID="es_uniqueId",e.ElasticsearchForcedRecentRecall="es_forced_recent_recall",e}({});const C=["spacePage","recentVisit","bookmarkedPage","sharedPage","frecencyStore","teamPage","defaultRecordCache","unknown","similarUser1dRecentPages","topPages7dPageView","editedPages1d","similarUsersEditedPages1d"],T=(0,o.defineMessages)({popularThisWeek:{defaultMessage:"Popular this week",id:"search.result.popularThisWeek.badge.text"},mostViewed:{defaultMessage:"Most viewed",id:"search.result.mostViewed.badge.text"},verified:{defaultMessage:"Verified",id:"search.result.verified.badge.text"},template:{defaultMessage:"Template",id:"search.result.template.badge.text"}}),M={RequestFailed:{type:"RequestFailed",message:"Something went wrong."},NoResults:{type:"NoResultsFound",message:"No results found."},Offline:{type:"Offline",message:"Go online for more results."}},P="gzkNfoUU",A=`<${P}>`,R=`</${P}>`},786036:(e,t,n)=>{n.d(t,{GL:()=>a,Of:()=>s,ln:()=>l,tL:()=>i,uP:()=>d,yR:()=>c});var o=n(619584),r=n(407057);const i={days:o.Lq,years:o.yx},a=10*i.years,s=1*i.days;function l(e){return e&&e%i.years==0?"years":"days"}function c(e,t){return e?Math.ceil(e/i[t]):30}function d(e,t){const n=l(e),o={[n]:c(e,n)};return(0,r.IV)(o,t)}},598275:(e,t,n)=>{n.d(t,{Ey:()=>y,In:()=>g,LL:()=>h,S3:()=>o,St:()=>l,r8:()=>d,vl:()=>p});const o={local:"http://localhost:3008",development:"https://integrations-api-dev.notion.com",staging:"https://integrations-api-stg.notion.com",production:"https://integrations-api.notion.com"},r={local:"http://localhost:3000/sip",development:"https://dev.notion.so/sip",staging:"https://stg.notion.so/sip",production:"https://notion.so/sip"},i="/install";function a(e){const{env:t,isServerIntegrationsProxyEnabled:n,integrationPath:a}=e;return`${(n?r:o)[t]}${a}${i}`}const s="/slack";function l(e,t){return a({env:e,isServerIntegrationsProxyEnabled:t,integrationPath:s})}const c="/github";function d(e,t){return a({env:e,isServerIntegrationsProxyEnabled:t,integrationPath:c})}const u="/zendesk";function p(e,t){return a({env:e,isServerIntegrationsProxyEnabled:t,integrationPath:u})}const m="/jira-data-center";function g(e,t){return a({env:e,isServerIntegrationsProxyEnabled:t,integrationPath:m})}const f="/salesforce";function h(e,t){return a({env:e,isServerIntegrationsProxyEnabled:t,integrationPath:f})}const v="/gmail";function y(e,t){return a({env:e,isServerIntegrationsProxyEnabled:t,integrationPath:v})}},811045:(e,t,n)=>{function o(e){return!!(r(e)||function(e){return a.has(e)}(e)||function(e){return s.includes(e)}(e))}function r(e){return i.has(e)}n.d(t,{IO:()=>r,an:()=>o});const i=new Set(["agent","automation_action","automation","block","collection_view","collection","comment","custom_emoji","discussion","external_authentication_token","external_object","follow","form_question","invite","page_exit","page_visit","reaction","record_counter","record_key","record_mention","server_integrations__jira_webhook","skill","snapshot","space_bot","space_permission_group","space_permission_group_member","space_user","space_view","space","subscription_banner","team","webhook_subscription","space_user_recovery","property_item","assistant_chat_step","assistant_chat_session","layout","ai_embedding_config","site","trusted_domain","assistant_session_starter","free_chart","channel"]),a=new Set(["activity"]),s=["notification"]},325666:(e,t,n)=>{n.d(t,{D:()=>a,T:()=>i});var o=n(653965),r=n(924211);const i="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";function a(e,t){if(o.HD(e))return e;{const n=e[t];return void 0!==n?n:e[r.al]}}},994044:(e,t,n)=>{n.d(t,{$e:()=>u,TQ:()=>d,UF:()=>s,my:()=>c,p_:()=>a});var o=n(709291),r=(n(307032),n(630845)),i=n(959753);const a=8,s=70,l=1e3;(0,o.defineMessages)({member:{id:"sharedContextualInviteHelpers.member.inviteMessage2",defaultMessage:"{userName} shared a page {pageName} with you."},guest:{id:"sharedContextualInviteHelpers.guest.inviteMessage2",defaultMessage:"Accept {userName}{userNameEndsWithS, select, true {’} other {’s}} invite to view {pageName}."},default:{id:"sharedContextualInviteHelpers.default.inviteMessage",defaultMessage:"Your invitation message"},optional:{id:"sharedContextualInviteHelpers.default.inviteMessagePrefix",defaultMessage:"Optional message..."}});function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;if(!e)return"";const n=r.s(e,"url");let o=e.slice();return n.forEach(((e,t)=>{o=o.replace(e.value,"[link]")})),o.length>t&&(o=`${o.substring(0,t)}...`),o}function d(e){if(!e)return!1;return r.s(e,"url").length>0}function u(e,t){var n;const o=null===(n=i.kk5.fromValue("block",e).getPermissionItems())||void 0===n?void 0:n.find((e=>"user_permission"===e.type&&e.user_id===t.invited_user_id));if(o&&"invite_id"in o)return o.invite_id}},654584:(e,t,n)=>{n.d(t,{m:()=>r});const o=(0,n(709291).defineMessages)({groupPlaceHolder:{id:"sharedSpacePermissionGroupHelpers.permissionGroup.anonymous",defaultMessage:"Anonymous group"}});function r(e){const{intl:t,permissionGroupModel:n}=e;return n&&n.name.length>0?`${n.name}`:t.formatMessage(o.groupPlaceHolder)}},236538:(e,t,n)=>{function o(e){return e?"shift+command+j":"shift+ctrl+j"}n.d(t,{F:()=>o})},590965:(e,t,n)=>{n.d(t,{BD:()=>y,CJ:()=>c,DI:()=>u,FN:()=>b,TZ:()=>m,XO:()=>l,XR:()=>p,hU:()=>d,nB:()=>_,nV:()=>v});var o=n(401898),r=n(218265),i=n(977657),a=n(772141),s=n(599405);n(665635),n(947969);function l(e,t,n,o){return!t||!n||!(0,a.zz)(n)||o}function c(e){const t=null==e?void 0:e.integration_restrictions;return"approved_only"===t||"approved_or_built_by_notion"===t}function d(e){const{spaceBotSettings:t,integrationId:n,env:o}=e;return!t||(!c(t)||(!(!t.integration_approval_statuses||!t.integration_approval_statuses[n])||!("approved_or_built_by_notion"!==t.integration_restrictions||!(0,i.BP)({integrationId:n,env:o}))))}const u=(0,o.AO)((e=>e&&"personal_external_transfer"===e.type&&"completed"!==e.status?{true:e}:{false:e})),p=(0,o.AO)((e=>e&&"team_claim_upgrade"===e.type&&"requested"===e.status?{true:e}:{false:e})),m=((0,o.AO)((e=>e&&"organization_claiming_space"===e.type&&"requested"===e.status?{true:e}:{false:e})),(0,o.AO)((e=>{if(!e||"domain_claim_space_deletion"!==e.type)return{false:e};switch(e.status){case"started":return{true:e};case"canceled":return{false:e}}}))),g=((0,o.AO)((e=>g(e)||f(e)||h(e)?{true:e}:{false:e})),(0,o.AO)((e=>{if(!e||"space_content_duplication"!==e.type)return{false:e};switch(e.status){case"started":return{true:e};case"failed_with_closed_source":case"failed":case"completed":case"dry_run_completed":case"pending_deletion":return{false:e}}}))),f=(0,o.AO)((e=>{if(!e||"space_content_duplication"!==e.type)return{false:e};switch(e.status){case"completed":return{true:e};case"dry_run_completed":case"failed":case"started":case"failed_with_closed_source":case"pending_deletion":return{false:e}}})),h=((0,o.AO)((e=>{if(!e||"space_content_duplication"!==e.type)return{false:e};switch(e.status){case"pending_deletion":return{true:e};case"dry_run_completed":case"failed":case"started":case"failed_with_closed_source":case"completed":return{false:e}}})),(0,o.AO)((e=>{if(!e||"space_content_duplication"!==e.type)return{false:e};switch(e.status){case"failed_with_closed_source":return{true:e};case"dry_run_completed":case"failed":case"started":case"completed":case"pending_deletion":return{false:e}}}))),v=(0,o.AO)((e=>{if(!e||"space_content_duplication"!==e.type)return{false:e};switch(e.status){case"failed_with_closed_source":case"started":case"completed":case"pending_deletion":return{true:e};case"dry_run_completed":case"failed":return{false:e}}}));function y(e){const{spaceId:t,baseUrl:n}=e,o=(0,s.createSpaceUrlPath)({route:{name:"space",spaceId:t,spaceDomain:void 0,requestedOnPublicDomain:void 0,searchQuery:void 0,searchRequest:void 0}});return(0,r.O_)({relativeUrl:o,baseUrl:n})}function b(e){return"none"===e.role}function _(e){return"none"!==e.role}},139927:(e,t,n)=>{n.d(t,{$X:()=>a,F_:()=>s,iZ:()=>i});var o=n(371663),r=n(142613);const i={autoCompleteSprints:!1,actionConfig:{complete_sprint_action:"complete_sprint_and_move_incomplete_tasks_to_next_sprint"},recurrenceConfig:{interval:2,weekdays:["MO"]}};function a(e){const{eventTracker:t,properties:n}=e;t.trackEvent({eventName:"complete_sprint_action",properties:n})}function s(e,t){var n;return null===(n=t.groups)||void 0===n||null===(n=n.find((t=>t.id===o.nl||(null==t?void 0:t.name)===r.RW||(null==t?void 0:t.name)===e.formatMessage(r.ct.statusGroupNameComplete))))||void 0===n?void 0:n.name}},894438:(e,t,n)=>{n.d(t,{DW:()=>s,IX:()=>a,Su:()=>r,rP:()=>i});var o=n(730120);function r(e){if("week"===e.frequency&&e.weekdays&&1===e.weekdays.length)return{weekday:e.weekdays[0],duration:e.interval}}function i(e){const{currentSprintEndDate:t,sprintSchedule:n}=e;return l({startDate:d({dateToAdjust:o.ou.fromISO(t),weekday:n.weekday,wrapForEqualDays:!0}),duration:n.duration})}function a(e){const{userTimeZone:t,sprintSchedule:n}=e;return l({startDate:o.ou.local({zone:t}),duration:n.duration})}function s(e){const{currentSprintStartDate:t,sprintSchedule:n}=e,r=d({dateToAdjust:o.ou.fromISO(t),weekday:n.weekday,wrapForEqualDays:!1}),{end_date:i}=l({startDate:r,duration:n.duration});let a=o.ou.fromISO(i);const s=o.ou.now().startOf("day");for(;a.diff(s,"days").days<0;)a=a.plus({weeks:1});return{type:"daterange",start_date:a.plus({days:1}).minus({weeks:n.duration}).toISODate(),end_date:a.toISODate()}}function l(e){const{startDate:t,duration:n}=e,o=t.plus({weeks:n}).minus({days:1});return{type:"daterange",start_date:t.toISODate(),end_date:o.toISODate()}}const c={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6};function d(e){const{dateToAdjust:t,weekday:n,wrapForEqualDays:o}=e,r=u({currentWeekday:t.weekday%7,nextWeekday:c[n],wrapForEqualDays:o});return t.plus({days:r})}function u(e){const{currentWeekday:t,nextWeekday:n,wrapForEqualDays:o}=e,r="number"==typeof t?t:c[t],i="number"==typeof n?n:c[n];if(r===i)return o?7:0;let a=r,s=0;for(;a!==i;)a===c.SA?a=0:a+=1,s+=1;return s}},399108:(e,t,n)=>{n.d(t,{VR:()=>A,hI:()=>D});n(757658);var o=n(653965),r=n(401898),i=n(340902),a=n(541432),s=n(163171),l=n(180951),c=n(853504),d=n(186517),u=n(772141);function p(e,t){return e.space_id===t.space_id&&e.collection_id===t.collection_id&&e.navigable_block_id===t.navigable_block_id}function m(e){return e.table+e.id}function g(e,t){return o.Xy(o.MR(e.authors||[],m),o.MR(t.authors||[],m))}function f(e,t){return o.MR(o.mN([...e.authors||[],...t.authors||[]],m),m)}function h(e,t){return e.block_id===t.block_id&&p(e,t)}function v(e,t){return e.block_id===t.block_id&&p(e,t)}function y(e,t){return p(e,t)&&e.comment_id===t.comment_id}function b(e,t){return p(e,t)}function _(e,t){return e.collection_property_id===t.collection_property_id&&p(e,t)}function S(e,t){return e.collection_view_id===t.collection_view_id&&p(e,t)}function k(e,t){return e.mentioned_block_id===t.mentioned_block_id&&e.mentioned_user_id===t.mentioned_user_id&&e.mentioned_property===t.mentioned_property&&g(e,t)&&p(e,t)}function w(e,t){return e.mentioned_block_id===t.mentioned_block_id&&e.mentioned_group_id===t.mentioned_group_id&&e.mentioned_property===t.mentioned_property&&g(e,t)&&p(e,t)}function x(e){const t=[];e:for(;e.list.length>0;){const n=e.list.shift();let o,r=0,i=!1;for(;r<e.list.length;){const t=e.list[r];if(i=e.cancel(n,t),i){e.list.splice(r,1);continue e}if(o=e.replace(n,t),o){e.list[r]=o;continue e}r++}t.push(n)}return t}function I(e,t){return 0===o.e5(e,t).length&&0===o.e5(t,e).length}function C(e,t){return p(e,t)&&e.permission_group_id===t.permission_group_id}function T(e){return"permission-created"===e.type||"permission-deleted"===e.type?(0,d.OC)(e.permission_data):"permission-changed"===e.type?(0,d.OC)(e.permission_data.before):void(0,r.t1)(e)}function M(e,t){return!!p(e,t)&&(!!g(e,t)&&("permission-restriction-created"===e.type||"permission-restriction-deleted"===e.type?"permission-restriction-created"===t.type||"permission-restriction-deleted"===t.type||(null===(n=e.permission_data)||void 0===n||null===(n=n.actual_changes)||void 0===n?void 0:n.some((e=>(0,d.OC)(e)===T(t)))):"permission-restriction-created"===t.type||"permission-restriction-deleted"===t.type?t.permission_data.actual_changes.some((t=>(0,d.OC)(t)===T(e))):T(e)===T(t)));var n}function P(e,t){if("permission-deleted"===e.type&&"permission-created"===t.type&&M(e,t)&&!function(e,t){return u.cY(e)===u.cY(t)}(e.permission_data,t.permission_data))return{...t,type:"permission-changed",timestamp:t.timestamp,permission_data:{before:e.permission_data,after:t.permission_data}}}function A(e){const t=x({list:x({list:o.MR((0,c.Z)(e,"mangle-class-instances")||[],(e=>e.timestamp)),cancel:(e,t)=>!1,replace:(e,t)=>P(e,t)}),cancel:(e,t)=>function(e,t){return"block-created"===e.type&&"block-deleted"===t.type&&h(e,t)}(e,t)||function(e,t){return"block-deleted"===e.type&&"block-created"===t.type&&h(e,t)}(e,t)||function(e,t){if("block-changed"===e.type&&"block-changed"===t.type&&h(e,t)){if(e.block_data.after.block_value.type===a.Ti.tableRow){const n=i.Yr({before:e.block_data.before.block_value,after:e.block_data.after.block_value}),r=i.Yr({before:t.block_data.before.block_value,after:t.block_data.after.block_value});return I(n,r)&&o.Xy(o.ei(e.block_data.before.block_value.properties||{},n),o.ei(t.block_data.after.block_value.properties||{},r))}const n=s.OS({before:e.block_data.before.block_value,after:e.block_data.after.block_value,schema:e.block_schema}),r=i.B9({before:e.block_data.before.block_value,after:e.block_data.after.block_value}),l=s.OS({before:t.block_data.before.block_value,after:t.block_data.after.block_value,schema:t.block_schema}),c=i.B9({before:t.block_data.before.block_value,after:t.block_data.after.block_value});return!i.lv({before:t.block_data.before.block_value,after:t.block_data.after.block_value})&&I(n,l)&&o.Xy(o.ei(e.block_data.before.block_value.properties||{},n),o.ei(t.block_data.after.block_value.properties||{},l))&&I(r,c)&&o.Xy(o.ei(e.block_data.before.block_value.format||{},r),o.ei(t.block_data.after.block_value.format||{},c))}return!1}(e,t)||function(e,t){return!("block-property-changed"!==e.type||"block-property-changed"!==t.type||!v(e,t))&&I(Object.keys(e.property_updates),Object.keys(t.property_updates))&&o.Xy(Object.values(e.property_updates).map((e=>e.before)),Object.values(t.property_updates).map((e=>e.after)))}(e,t)||function(e,t){return"permission-created"===e.type&&"permission-deleted"===t.type&&M(e,t)}(e,t)||function(e,t){return"permission-deleted"===e.type&&"permission-created"===t.type&&M(e,t)}(e,t)||function(e,t){return"permission-changed"===e.type&&"permission-changed"===t.type&&M(e,t)&&o.Xy(e.permission_data.before,t.permission_data.after)}(e,t)||function(e,t){return"mention-created"===e.type&&"mention-deleted"===t.type&&k(e,t)}(e,t)||function(e,t){return"mention-deleted"===e.type&&"mention-created"===t.type&&k(e,t)}(e,t)||function(e,t){return"permission-group-mention-created"===e.type&&"permission-group-mention-deleted"===t.type&&w(e,t)}(e,t)||function(e,t){return"permission-group-mention-deleted"===e.type&&"permission-group-mention-created"===t.type&&w(e,t)}(e,t)||function(e,t){return"comment-created"===e.type&&"comment-deleted"===t.type&&y(e,t)}(e,t)||function(e,t){return"comment-deleted"===e.type&&"comment-created"===t.type&&y(e,t)}(e,t)||function(e,t){return"comment-changed"===e.type&&"comment-changed"===t.type&&y(e,t)&&o.Xy(e.comment_data.before,t.comment_data.after)}(e,t)||function(e,t){return!!("collection-changed"===e.type&&"collection-changed"===t.type&&b(e,t)&&e.collection_data&&t.collection_data)&&o.Xy(e.collection_data.before,t.collection_data.after)}(e,t)||function(e,t){return"collection-property-created"===e.type&&"collection-property-deleted"===t.type&&_(e,t)}(e,t)||function(e,t){return"collection-property-deleted"===e.type&&"collection-property-created"===t.type&&_(e,t)}(e,t)||function(e,t){return"collection-property-changed"===e.type&&"collection-property-changed"===t.type&&_(e,t)&&o.Xy(e.collection_property_data.before,t.collection_property_data.after)}(e,t)||function(e,t){return"collection-view-created"===e.type&&"collection-view-deleted"===t.type&&S(e,t)}(e,t)||function(e,t){return"collection-view-deleted"===e.type&&"collection-view-created"===t.type&&S(e,t)}(e,t)||function(e,t){return"collection-view-changed"===e.type&&"collection-view-changed"===t.type&&S(e,t)&&o.Xy(e.collection_view_data.before,t.collection_view_data.after)}(e,t)||function(e,t){return"permission-group-created"===e.type&&"permission-group-deleted"===t.type&&C(e,t)}(e,t)||function(e,t){return"permission-group-deleted"===e.type&&"permission-group-created"===t.type&&C(e,t)}(e,t),replace:(e,t)=>function(e,t){if("block-created"===e.type&&"block-changed"===t.type&&h(e,t))return{...e,timestamp:t.timestamp,authors:f(e,t),block_schema:t.block_schema,block_data:t.block_data.after}}(e,t)||function(e,t){if("block-changed"===e.type&&"block-changed"===t.type&&h(e,t))return{...e,timestamp:t.timestamp,authors:f(e,t),block_schema:t.block_schema,block_data:{before:e.block_data.before,after:t.block_data.after}}}(e,t)||function(e,t){if("block-property-changed"===e.type&&"block-property-changed"===t.type&&v(e,t)){const n=e.property_updates;return t.property_updates&&Object.entries(t.property_updates).forEach((r=>{let[i,a]=r;i in n?o.Xy(n[i].before,a.after)?(delete n[i],e.filtered_block_schema&&delete e.filtered_block_schema[i],t.filtered_block_schema&&delete t.filtered_block_schema[i]):n[i].after=a.after:n[i]=a})),{...e,timestamp:t.timestamp,authors:f(e,t),filtered_block_schema:{...e.filtered_block_schema,...t.filtered_block_schema},property_updates:n}}}(e,t)||function(e,t){if("comment-created"===e.type&&"comment-changed"===t.type&&y(e,t))return{...e,comment_data:t.comment_data.after}}(e,t)||function(e,t){if("comment-changed"===e.type&&"comment-changed"===t.type&&y(e,t))return{...e,comment_data:{before:e.comment_data.before,after:t.comment_data.after}}}(e,t)||function(e,t){if("permission-created"===e.type&&"permission-changed"===t.type&&M(e,t))return{...e,timestamp:t.timestamp,permission_data:t.permission_data.after}}(e,t)||function(e,t){if("permission-changed"===e.type&&"permission-changed"===t.type&&M(e,t))return{...e,permission_data:{before:e.permission_data.before,after:t.permission_data.after},timestamp:t.timestamp}}(e,t)||function(e,t){if("permission-created"===t.type&&"permission-restriction-created"===e.type&&M(e,t))return{...e,timestamp:t.timestamp}}(e,t)||function(e,t){if("permission-deleted"===t.type&&"permission-restriction-deleted"===e.type&&M(e,t))return{...e,timestamp:t.timestamp}}(e,t)||function(e,t){if("collection-created"===e.type&&"collection-changed"===t.type&&b(e,t))return{...e,authors:f(e,t),collection_data:t.collection_data?t.collection_data.after:void 0}}(e,t)||function(e,t){if("collection-changed"===e.type&&"collection-changed"===t.type&&b(e,t))return{...e,timestamp:t.timestamp,authors:f(e,t),collection_data:{before:e.collection_data?e.collection_data.before:void 0,after:t.collection_data?t.collection_data.after:void 0}}}(e,t)||function(e,t){if("collection-property-created"===e.type&&"collection-property-changed"===t.type&&_(e,t))return{...e,timestamp:t.timestamp,authors:f(e,t),collection_property_data:t.collection_property_data.after}}(e,t)||function(e,t){if("collection-property-changed"===e.type&&"collection-property-changed"===t.type&&_(e,t))return{...e,timestamp:t.timestamp,authors:f(e,t),collection_property_data:{before:e.collection_property_data.before,after:t.collection_property_data.after}}}(e,t)||function(e,t){if("collection-view-created"===e.type&&"collection-view-changed"===t.type&&S(e,t))return{...e,timestamp:t.timestamp,authors:f(e,t),collection_view_data:t.collection_view_data.after}}(e,t)||function(e,t){if("collection-view-changed"===e.type&&"collection-view-changed"===t.type&&S(e,t))return{...e,timestamp:t.timestamp,authors:f(e,t),collection_view_data:{before:e.collection_view_data.before,after:t.collection_view_data.after}}}(e,t)||function(e,t){if("permission-group-created"===e.type&&"permission-group-changed"===t.type&&C(e,t))return{...e,timestamp:t.timestamp,permission_group_data:t.permission_group_data.after,authors:f(e,t)}}(e,t)||function(e,t){if("permission-group-changed"===e.type&&"permission-group-changed"===t.type&&C(e,t))return{...e,permission_group_data:{before:e.permission_group_data.before,after:t.permission_group_data.after},timestamp:t.timestamp,authors:f(e,t)}}(e,t)}).filter((e=>!function(e){if("block-changed"===e.type){const t=i.gg({before:e.block_data.before.block_value,after:e.block_data.after.block_value,schema:e.block_schema}),n=i.lv({before:e.block_data.before.block_value,after:e.block_data.after.block_value}),o=i.fc({before:e.block_data.before.block_value,after:e.block_data.after.block_value}),r=i.Z3({before:e.block_data.before.block_value,after:e.block_data.after.block_value});return!(t||n||o||r)}return!1}(e)));return o.MR(t,(e=>e.timestamp))}function R(e){const t=x({list:o.MR((0,c.Z)(e,"ignore-class-instances")||[],(e=>e.timestamp)),cancel:(e,t)=>!1,replace:(e,t)=>function(e,t){if("block-changed"===e.type&&"block-deleted"===t.type&&h(e,t))return{...t,authors:f(e,t)}}(e,t)||function(e,t){if("permission-group-changed"===e.type&&"permission-group-deleted"===t.type&&C(e,t))return{...t,timestamp:t.timestamp,permission_group_data:e.permission_group_data.before,authors:f(e,t)}}(e,t)||function(e,t){if("permission-changed"===e.type&&"permission-deleted"===t.type&&M(e,t))return{...t,timestamp:t.timestamp,permission_data:e.permission_data.before}}(e,t)||function(e,t){if("collection-property-changed"===e.type&&"collection-property-deleted"===t.type&&_(e,t))return{...t,authors:f(e,t)}}(e,t)||function(e,t){if("collection-view-changed"===e.type&&"collection-view-deleted"===t.type&&S(e,t))return{...t,authors:f(e,t)}}(e,t)});return o.MR(t,(e=>e.timestamp))}function D(e){return function(e){const t=[];return e.forEach((e=>{if("block-changed"===e.type)if(i.lv({before:e.block_data.before.block_value,after:e.block_data.after.block_value})){const n={...e,type:"block-created",block_data:e.block_data.after},o={...e,type:"block-deleted",block_data:e.block_data.before};t.push(o),t.push(n)}else t.push(e);else t.push(e)})),t}(R(e)).filter((e=>!function(e){return("block-created"===e.type||"block-deleted"===e.type)&&(0,a.XD)(e.block_data.block_value.type,e.block_data.block_value.format)&&"page"!==e.block_data.block_value.type&&!(0,l.wS)(e.block_data.block_value,"title")}(e)&&!function(e){return("block-created"===e.type||"block-deleted"===e.type)&&a.XX[e.block_data.block_value.type]}(e)))}},646637:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(430548);const r=["adClick","fbp"];const i=new class{constructor(e,t){this.localStorageStore=void 0,this.localStorageStore=new o.ZP({namespace:e,important:t,trackingType:"targeting"})}get(e){return this.localStorageStore.get(e)}set(e,t){return this.localStorageStore.set(e,t)}remove(e){return this.localStorageStore.remove(e)}removeAllIfNoPermission(){this.localStorageStore.hasPermissionForTrackingType||r.forEach((e=>this.remove(e)))}}(o.$p,!1)},472128:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(430548);const r=["sourceInitialPage"];const i=new class{constructor(e,t){this.localStorageStore=void 0,this.localStorageStore=new o.ZP({namespace:e,important:t,trackingType:"performance"})}get(e){let{userId:t,key:n}=e;return this.localStorageStore.get((0,o.dq)(t,n))}set(e){let{userId:t,key:n,value:r}=e;return this.localStorageStore.set((0,o.dq)(t,n),r)}remove(e){let{userId:t,key:n}=e;return this.localStorageStore.remove((0,o.dq)(t,n))}removeAllIfNoPermission(){const{namespace:e,hasPermissionForTrackingType:t}=this.localStorageStore;if(t)return;const n=`${o.eg}${e}:`;Object.keys(localStorage).filter((e=>e.startsWith(n))).filter((e=>{const[t,n,o,i]=e.split(":");return i&&r.includes(i)})).forEach((e=>localStorage.removeItem(e)))}}(o.TA,!1)},464793:(e,t,n)=>{n.d(t,{Cn:()=>a,tA:()=>s});var o=n(401898),r=n(398724),i=n(500896);const a="ALL_REGIONS";class s{constructor(e){this.lastVersion=void 0,this.externalId=void 0,this.product=void 0,this.billingInterval=void 0,this.unitAmount=void 0,this.state=void 0,this.regions=void 0,this.externalId=e.external_id,this.product=e.product,this.billingInterval=e.billing_interval,this.unitAmount=r.n.fromValue({amount:e.unit_amount,currencyCode:e.currency}),this.state=e.state,this.regions=e.regions}get currencyCode(){return this.unitAmount.currencyCode}getMonthlyUnitCost(e){const t=this.getAdjustedUnitAmount(e);return"year"===this.billingInterval?t.withDividedAmount(12):t}getMonthlyCost(e){const{quantity:t,coupon:n}=e;return this.getMonthlyUnitCost(n).withMultipliedAmount(t)}getCostPerBillingInterval(e){const{quantity:t,coupon:n}=e;return this.getAdjustedUnitAmount(n).withMultipliedAmount(t)}getDiscountPerBillingInterval(e){var t;const{quantity:n,coupon:o,promo:r}=e,a=this.unitAmount.withMultipliedAmount(n);if(o&&this.doesCouponApply(o))return a.withMultipliedAmount((0,i.ZN)(o));let s=0;return null!=r&&r.percent_off&&null!==(t=r.applies_to)&&void 0!==t&&t.includes(this.externalId)&&(s=r.percent_off/100),a.withMultipliedAmount(s)}getAdjustedUnitAmount(e){let t=1;return e&&this.doesCouponApply(e)&&(t=1-(0,i.ZN)(e)),this.unitAmount.withMultipliedAmount(t)}doesCouponApply(e){switch(this.product){case"ai":return"ai_fifty_percent"===e;case"free":case"student":case"personal":case"sites_custom_hostnames":return!1;case"plus":return["team_three_months","team_annual"].includes(e);case"business":case"enterprise":return["business_three_months","business_annual"].includes(e);default:(0,o.t1)(this.product)}}}},803791:(e,t,n)=>{n.d(t,{E3:()=>a,Qv:()=>s,Rt:()=>r,YD:()=>i,de:()=>l,lX:()=>d});n(653965),n(159730),n(181886);const o=["ai","sites_custom_hostnames"],r=["ai_add_on_employee_discount_monthly","ai_add_on_employee_discount_yearly"],i=["ai_add_on_standard_sales_assisted","ai_add_on_standard_sales_assisted_eur","ai_add_on_standard_sales_assisted_gbp","ai_add_on_standard_sales_assisted_jpy","ai_add_on_standard_sales_assisted_krw","ai_add_on_employee_discount_monthly","ai_add_on_employee_discount_yearly","ai_add_on_marketing_discount_monthly","ai_add_on_marketing_discount_yearly","sites_custom_hostnames_add_on_sales_assisted_gbp","sites_custom_hostnames_add_on_sales_assisted_usd","sites_custom_hostnames_add_on_sales_assisted_eur","sites_custom_hostnames_add_on_sales_assisted_jpy","sites_custom_hostnames_add_on_sales_assisted_krw","ai_add_on_standard_trial_monthly_usd","ai_add_on_standard_trial_yearly_usd","ai_add_on_standard_trial_monthly_eur","ai_add_on_standard_trial_yearly_eur","ai_add_on_standard_trial_monthly_gbp","ai_add_on_standard_trial_yearly_gbp","ai_add_on_standard_trial_monthly_jpy","ai_add_on_standard_trial_yearly_jpy","ai_add_on_standard_trial_monthly_krw","ai_add_on_standard_trial_yearly_krw",...["ai_add_on_standard_monthly_10","ai_add_on_standard_monthly_eur","ai_add_on_standard_monthly_gbp","ai_add_on_standard_monthly_jpy","ai_add_on_standard_monthly_krw","ai_add_on_standard_yearly_96","ai_add_on_standard_yearly_eur","ai_add_on_standard_yearly_gbp","ai_add_on_standard_yearly_jpy","ai_add_on_standard_yearly_krw","sites_custom_hostnames_add_on_monthly_usd","sites_custom_hostnames_add_on_yearly_usd","sites_custom_hostnames_add_on_monthly_eur","sites_custom_hostnames_add_on_yearly_eur","sites_custom_hostnames_add_on_monthly_gbp","sites_custom_hostnames_add_on_yearly_gbp","sites_custom_hostnames_add_on_monthly_jpy","sites_custom_hostnames_add_on_yearly_jpy","sites_custom_hostnames_add_on_monthly_krw","sites_custom_hostnames_add_on_yearly_krw"]];function a(e){return!!e&&e.length>0}function s(e){return o.some((t=>t===e))}function l(e){return!!e&&e.some((e=>"ai"===e.feature))}const c=402;function d(e){return e===c}},909182:(e,t,n)=>{n.d(t,{CO:()=>y,F6:()=>S,H6:()=>w,Hw:()=>h,IK:()=>v,Lg:()=>c,Rd:()=>p,Wo:()=>M,YK:()=>g,a7:()=>b,bs:()=>m,dK:()=>T,h_:()=>I,iv:()=>d,oh:()=>u,ry:()=>f,tw:()=>x,uD:()=>C,xi:()=>k,zt:()=>_});n(21703);var o=n(730120),r=n(653965),i=n(619584),a=n(960897),s=n(803791),l=n(464793);function c(e){return e.subscription?e.subscription.pending?{...e.subscription.pending,trialEnd:void 0}:e.subscription:{items:[],trialEnd:void 0}}function d(e){return e.subscription??{trialEnd:void 0,items:[]}}function u(e){let t;return t="free"===e||"personal_free"===e||"team_free"===e?void 0:{quantity:0,price:{externalId:"DANGEROUS__toFakeSubscriptionStateFromSubscriptionTier externalId",product:e,billingInterval:"month",unitAmount:{amount:0,currencyCode:"USD"},state:"current",regions:["ALL_REGIONS"]}},{trialEnd:void 0,items:(0,r.oA)([t])}}function p(e){return((null==e?void 0:e.items)??[]).some((e=>a.Sf.includes(e.price.externalId)))}function m(e){if(e)return M(e.items.map((e=>e.price.unitAmount.currencyCode)),"All subscription items should have the same currency code.")}function g(e){return!!e&&e.items.length>0}function f(e){if(e)return M(e.items.filter((e=>"sites_custom_hostnames"!==x(e))).map((e=>e.quantity)),"With the exception of the sites_custom_hostnames add-on, all subscription items should have the same quantity.")}function h(e){if(e)return M(e.items.map((e=>e.price.billingInterval)),"All subscription items should have the same billing interval.")}function v(e,t){if(!e.subscription)return t;const n=h(e.subscription);if(!n)return t;let r=e.subscription.currentPeriodEnd;const i="month"===n?o.nL.fromObject({month:1}):o.nL.fromObject({year:1}),a=o.nL.fromObject({hour:2});for(;t>r.plus(a);)r=r.plus(i);return r}function y(e){return!!e&&e.items.every((e=>0===e.price.unitAmount.amount))}function b(e,t){return((null==e?void 0:e.items)??[]).find((e=>x(e)===t))}function _(e){const t=b(e,"plan");return(null==t?void 0:t.price.product)??"free"}function S(e){var t;return null===(t=b(e,"plan"))||void 0===t?void 0:t.price.externalId}function k(e){return((null==e?void 0:e.items)??[]).filter((e=>"plan"!==x(e))).map((e=>e.price.product))}function w(e){return s.Qv(e.price.product)?void 0:e.price.product}function x(e){return I(e.price.product)}function I(e){return s.Qv(e)?e:"plan"}function C(e){return new l.tA({external_id:e.externalId,product:e.product,billing_interval:e.billingInterval,currency:e.unitAmount.currencyCode,unit_amount:e.unitAmount.amount,state:"current",regions:[l.Cn]})}function T(e,t){return(0,i.UV)(e,(e=>x(e)),t,(e=>x(e)))}function M(e,t){const n=(0,r.jj)(e);if(n.length>1)throw new Error(t);return n[0]}},306995:(e,t,n)=>{n.d(t,{AI:()=>c,Zl:()=>s,_D:()=>a,dK:()=>u,dP:()=>d,pc:()=>p,t4:()=>l});n(21703);var o=n(619584),r=n(909182),i=n(647425);function a(e,t){return u(e.items,t.items).some((e=>{let[t,n]=e;return function(e,t){if(!e)return!1;if(!t)return!0;const n=r.H6(e),o=r.H6(t);if(!n||!o)return!1;return i.rC[n]>i.rC[o]}(t,n)}))}function s(e,t,n){let{trialEnd:o,items:r}=t;const i=r.map((t=>{const o=t.price.product,r=t.price.unitAmount.currencyCode,i=function(e,t){let{interval:n,product:o,currency:r}=t;const i=e.find((e=>e.product===o&&e.billingInterval===n&&e.unitAmount.currencyValue.currencyCode===r));return m(i,`Unable to find price with interval: ${n}, product: ${o}, currency: ${r}`)}(e,{interval:n,product:o,currency:r});return{...t,price:i}}));return{trialEnd:o,items:i}}function l(e,t){const n=e.items.filter((e=>r.tw(e)!==t));return{...e,items:n}}function c(e,t){const n=e.items.filter((e=>r.tw(e)!==r.tw(t)));return{...e,items:n.concat([t])}}function d(e,t,n){const{product:o,interval:i,currency:a}=n,s=function(e){if("personal_free"===e||"team_free"===e)return"free";return e}(o),l=t.items.filter((e=>r.tw(e)!==r.h_(s))),c=function(e,t){let{interval:n,product:o,currency:r}=t;const i=e.find((e=>e.price.product===o&&e.price.billingInterval===n&&e.price.unitAmount.currencyValue.currencyCode===r));return m(i,`Unable to find price with interval: ${n}, product: ${o}, currency: ${r}`)}(e,{interval:i,product:s,currency:a});return{...t,items:l.concat([c])}}function u(e,t){return(0,o.UV)(e,(e=>r.tw(e)),t,(e=>r.tw(e)))}function p(e){const{prices:t,billingData:n,product:o}=e,i=r.bs(n.subscription),a=r.Lg(n),s=r.Hw(a),l=r.Hw(n.subscription),c=s??l;return t.find((e=>e.product===o&&e.billingInterval===c&&e.unitAmount.currencyValue.currencyCode===i))}function m(e,t){if(null==e)throw new Error(t);return e}},398724:(e,t,n)=>{n.d(t,{n:()=>r});n(21703);var o=n(829305);class r{static fromValue(e){const{amount:t,currencyCode:n}=e,i=o.X[n];if(!i)throw new Error(`Unsupported currency code: ${n}`);return new r(i,t)}static sum(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=t.filter((e=>void 0!==e));if(0===o.length)return;const{currencyCode:i}=o[0];if(o.some((e=>e.currencyCode!==i)))throw new Error("Cannot add money with different currencies");const a=o.reduce(((e,t)=>e+t.amount),0);return r.fromValue({amount:a,currencyCode:i})}static zero(e){return r.fromValue({amount:0,currencyCode:e})}constructor(e,t){this.currencyValue=void 0,this.amount=void 0,this.currencyValue=e,this.amount=t}get currencyCode(){return this.currencyValue.currencyCode}toMoneyValue(){return{amount:this.amount,currencyCode:this.currencyValue.currencyCode}}withAmount(e){return new r(this.currencyValue,e)}withAddedAmount(e){return new r(this.currencyValue,this.amount+e)}plus(e){if(this.currencyCode!==e.currencyCode)throw new Error(`Cannot add money with currency code ${this.currencyCode} to money with currency code ${e.currencyCode}`);return new r(this.currencyValue,this.amount+e.amount)}minus(e){return this.plus(e.withMultipliedAmount(-1))}withMultipliedAmount(e){return new r(this.currencyValue,this.amount*e)}withDividedAmount(e){return new r(this.currencyValue,this.amount/e)}zeroIfNegative(){return new r(this.currencyValue,Math.max(0,this.amount))}zeroIfPositive(){return new r(this.currencyValue,Math.min(0,this.amount))}isPositive(){return this.amount>0}isNegative(){return this.amount<0}}},500896:(e,t,n)=>{n.d(t,{$v:()=>i,ZN:()=>a,pp:()=>r});var o=n(401898);function r(e){if(!e)return!1;switch(e){case"ai_fifty_percent":return!0;case"team_three_months":case"team_annual":case"business_three_months":case"business_annual":case"enterprise_three_months":case"enterprise_annual":return!1;default:(0,o.t1)(e)}}function i(e){if(!e)return!1;switch(e){case"ai_fifty_percent":case"team_three_months":case"team_annual":case"business_three_months":case"business_annual":case"enterprise_three_months":case"enterprise_annual":return!0;default:(0,o.t1)(e)}}function a(e){switch(e){case"team_three_months":case"ai_fifty_percent":return.5;case"team_annual":case"business_three_months":case"business_annual":case"enterprise_three_months":case"enterprise_annual":return.1;default:(0,o.t1)(e)}}},181886:(e,t,n)=>{n.d(t,{$3:()=>r,KE:()=>s,Lj:()=>a,Md:()=>i,Vj:()=>l});var o=n(401898);const r=["free","plus","business","enterprise"],i=["team_monthly_10","team_yearly_96","plus_monthly_eur","plus_yearly_eur","plus_monthly_gbp","plus_yearly_gbp"];function a(e){switch(e){case"free":case"student":case"personal":case"plus":case"business":case"enterprise":case"ai":return"seats";case"sites_custom_hostnames":return"public_domain_custom_hostnames";default:(0,o.t1)(e)}}function s(e){switch(e){case"free":case"personal_free":case"team_free":return"free";case"student":case"personal":case"plus":case"business":case"enterprise":return e;default:(0,o.t1)(e)}}function l(e){const{prices:t,quantity:n,domainsQuantity:o}=e;return t.map((e=>"public_domain_custom_hostnames"===a(e.product)?{price:e,quantity:o??0}:{price:e,quantity:n}))}},102438:(e,t,n)=>{n.d(t,{Rb:()=>s,nR:()=>i,qH:()=>a,uN:()=>r});n(21703),n(757658);var o=n(960897);function r(e,t){return t?t.percent_off?{amount:e*t.percent_off/100,monthsRemaining:t.duration_in_months}:t.amount_off?{amount:t.amount_off}:{amount:0}:{amount:0}}function i(e){return"personal"!==e&&o.tt.find((t=>t===e))}function a(e,t){const n=e.find((e=>e.externalId===t));if(!n)throw new Error(`Unable to find price data for ${t}`);return n.billingInterval}function s(e){const{currency:t,isKrCardFeatureGateEnabled:n}=e,o=["card","link"];return"EUR"===t&&o.push("sepa_debit"),"KRW"===t&&n&&o.push("kr_card"),o}},647425:(e,t,n)=>{n.d(t,{$U:()=>A,$V:()=>k,Aw:()=>b,LU:()=>R,Mk:()=>g,NG:()=>u,NY:()=>x,O9:()=>l,QA:()=>h,QM:()=>m,QR:()=>f,Rs:()=>d,bo:()=>w,eR:()=>v,eZ:()=>S,gp:()=>P,iJ:()=>_,kE:()=>M,lu:()=>s,mq:()=>y,rC:()=>a,sX:()=>c,v5:()=>T,wP:()=>p,xt:()=>I});var o=n(653965);const r=["free","personal_free","team_free"],i=["personal","student"],a={free:0,personal_free:0,personal:1,student:2,team_free:3,plus:3,business:4,enterprise:5},s=3;function l(e){return e||"free"}function c(e){return y(e)||S(e,["personal","student"])}function d(e){return S(e,["business","enterprise"])}function u(e){return"business"===e}function p(e){return"enterprise"===e}function m(e){return!e||S(e,r)}function g(e){return!b(e)}function f(e){return"personal"===e}function h(e){return void 0!==e&&["free","personal_free","student","personal"].includes(e)}function v(e){return"plus"===e}function y(e){return S(e,["plus","business","enterprise"])}function b(e){return S(e,i)}function _(e){return"student"===e}function S(e,t){return!!e&&t.includes(e)}function k(e,t){return a[e]>=a[t]}function w(e){return(0,o.UT)((0,o.oA)(e),(e=>a[e]))}function x(e){const{oldTier:t,newTier:n}=e,o=a[t],r=a[n];return o<r?"upgrade":o>r?"downgrade":"equal"}function I(e,t){const n=a[e]<a.plus?a.plus-1:a[e];return a[t]===n+1}const C={free:{guestLimit:10,guestLimitToEnforce:10,spaceBlockLimit:1e3,fileUploadMaxBytes:5e6,versionHistoryLimitDays:7,defaultPublicDomains:1},personal_free:{guestLimit:10,guestLimitToEnforce:10,spaceBlockLimit:1e3,fileUploadMaxBytes:5e6,versionHistoryLimitDays:7,defaultPublicDomains:1},team_free:{guestLimit:10,guestLimitToEnforce:10,spaceBlockLimit:1e3,fileUploadMaxBytes:5e6,versionHistoryLimitDays:7,defaultPublicDomains:1},student:{guestLimit:void 0,guestLimitToEnforce:100,spaceBlockLimit:void 0,fileUploadMaxBytes:5e6,versionHistoryLimitDays:30,defaultPublicDomains:5},personal:{guestLimit:void 0,guestLimitToEnforce:100,spaceBlockLimit:void 0,fileUploadMaxBytes:5e6,versionHistoryLimitDays:7,defaultPublicDomains:5},plus:{guestLimit:void 0,guestLimitToEnforce:100,spaceBlockLimit:void 0,fileUploadMaxBytes:Number.MAX_SAFE_INTEGER,versionHistoryLimitDays:30,defaultPublicDomains:5},business:{guestLimit:void 0,guestLimitToEnforce:250,spaceBlockLimit:void 0,fileUploadMaxBytes:Number.MAX_SAFE_INTEGER,versionHistoryLimitDays:365,defaultPublicDomains:5},enterprise:{guestLimit:void 0,guestLimitToEnforce:250,spaceBlockLimit:void 0,fileUploadMaxBytes:Number.MAX_SAFE_INTEGER,versionHistoryLimitDays:Number.MAX_SAFE_INTEGER,defaultPublicDomains:5}};function T(){const{spaceBlockLimit:e}=C.free;return void 0===e?Number.MAX_SAFE_INTEGER:e}function M(e){return C[e].guestLimit}function P(e){let{hasLowGuestLimit:t}=e;return t?{free:1,personal_free:1,team_free:1,plus:2,student:2,personal:2,business:3,enterprise:4}:{free:10,personal_free:10,team_free:10,plus:100,student:100,personal:100,business:250,enterprise:250}}function A(e){return S(e,["enterprise"])}function R(e){return C[e].defaultPublicDomains??C.free.defaultPublicDomains}},456452:(e,t,n)=>{n.d(t,{H:()=>l,K9:()=>u,_P:()=>a,b8:()=>p,gb:()=>g,iR:()=>d,or:()=>i,rP:()=>s,xT:()=>m});var o=n(653965),r=n(421838);const i=[r.Mc5.TemporaryHighlight,{light:"#105FAD",dark:"#4FA7FF"}],a=[r.Mc5.TemporaryHighlight,{light:"#2383E291",dark:"#2383E291"}],s=[r.Mc5.TemporaryHighlight,{light:"#C7C6C4",dark:"#FFFFFF21"}],l=[r.Mc5.TemporaryHighlight,{light:"#ACA9A9",dark:"#5A5A5A"}],c=["property_title","block_format_suggestion","property_caption","table_row"];function d(e){return e.map((e=>{const t=(0,r.hDy)(e),n=o.vM(t,r.J7s),i=n[r.GKr.SuggestionAnnotate]||[],a=n[r.GKr.SuggestionUnannotate]||[];return i.forEach((e=>{if((0,r.u2m)(e)){const t=(0,r.EpE)(e),o=(0,r.J7s)(t);n[o]||(n[o]=[t])}})),a.forEach((e=>{if((0,r.Jeu)(e)){const t=(0,r.EpE)(e),o=(0,r.J7s)(t);n[o]&&delete n[o]}})),(0,r.V3y)((0,r.WiV)(e),o.xH(Object.values(n)))}))}function u(e){return e.flatMap((e=>(0,r.hDy)(e).flatMap((e=>r.BIG(e)?[r.fgJ(e)]:[]))))}function p(e){const{suggestions:t,...n}=e;return n}function m(e){const{blockModel:t,exclude:n,discussionId:o}=e;return c.filter((e=>!(null!=n&&n.has(e)))).reduce(((e,n)=>{if(e)return!0;switch(n){case"property_title":return u(t.getProperty("title")??[]).includes(o);case"property_caption":return u(t.getProperty("caption")??[]).includes(o);case"block_format_suggestion":return Boolean(t.getAllBlockSuggestions().find((e=>e.discussionId===o)));case"table_row":if("table_row"===t.getType())for(const e of Object.keys(t.getProperties())){if(u(t.getPropertiesStore().getKeyStore(e).getValue()??[]).includes(o))return!0}return!1}}),!1)}function g(e,t){if(!t)return{first:[...e],second:[]};const n=e.indexOf(t);if(-1===n)return{first:[...e],second:[]};return{first:e.slice(0,n+1),second:e.slice(n+1)}}},542297:(e,t,n)=>{n.d(t,{Kc:()=>u,S4:()=>l,eg:()=>c,qF:()=>a});var o=n(709291),r=n(653965),i=n(117397);const a=["title","description","caption","link","checked","language","source","size"],s=new Set(a);function l(e){return s.has(e)}const c=i.X0.map((e=>({value:e,id:e}))),d=(0,o.defineMessages)({title:{id:"block.propertyTypeName.title",defaultMessage:"Title"},description:{id:"block.propertyTypeName.description",defaultMessage:"Description"},caption:{id:"block.propertyTypeName.caption",defaultMessage:"Caption"},link:{id:"block.propertyTypeName.link",defaultMessage:"Link"},checked:{id:"block.propertyTypeName.checked",defaultMessage:"Checked"},language:{id:"block.propertyTypeName.language",defaultMessage:"Language"},source:{id:"block.propertyTypeName.source",defaultMessage:"Source"},size:{id:"block.propertyTypeName.size",defaultMessage:"Size"}}),u=(0,r.HP)((e=>{const t={name:e.formatMessage(d.title),type:"title"},n={name:e.formatMessage(d.link),type:"url"};return{title:t,description:{name:e.formatMessage(d.description),type:"text"},caption:{name:e.formatMessage(d.caption),type:"text"},link:n,checked:{name:e.formatMessage(d.checked),type:"checkbox"},language:{name:e.formatMessage(d.language),type:"select",options:c},source:{name:e.formatMessage(d.source),type:"url"},size:{name:e.formatMessage(d.size),type:"text"}}}),(e=>e.locale))},585031:(e,t,n)=>{n.d(t,{Q:()=>a,y:()=>l});n(757658);var o=n(653965),r=n(541432),i=n(421202);function a(e,t,n){const r=[];return s(t({table:i.iU,id:e}),t,r,!0,new Set,n),o.jj(r)}function s(e,t,n,o,a,l){if(!e)return;if(a.has(e.id))return;if(a.add(e.id),e.isType(r.m3)&&(n.push(e.id),!l))return;const c=e.getType()===r.Ti.transclusionReference&&e.getTransclusionReferenceTargetPointer();c&&s(t(c),t,n,!1,a,l);if(l?o||!(0,r.S9)(e.getType())&&(0,r.Um)(e.getType(),e.getFormat())&&e.hasContent():(o||e.getType()===r.Ti.columnList||e.getType()===r.Ti.column||e.getType()===r.Ti.transclusionContainer||e.getType()===r.Ti.callout)&&e.hasContent())for(const r of e.getContentIds())s(t({table:i.iU,id:r}),t,n,!1,a,l)}function l(e){const{headerBlockId:t,headerBlockIds:n,index:a,getRecordModel:s}=e,l=s({table:i.iU,id:t});if(!l)return 0;const c=l.getType(),d=o.oA(n.map((e=>s({table:i.iU,id:e}))));if(c===r.Ti.header)return 0;const u=o.qr(d,((e,t)=>t<a&&e.getType()===r.Ti.header));if(c===r.Ti.subHeader)return u>=0?1:0;const p=o.qr(d,((e,t)=>t<a&&e.getType()===r.Ti.subHeader));return u>=0&&p>u?2:u>=0||p>=0?1:0}},364684:(e,t,n)=>{n.d(t,{$$:()=>C,AW:()=>A,B5:()=>P,Ei:()=>R,Fm:()=>k,Hf:()=>u,I6:()=>F,J2:()=>b,Uk:()=>E,V3:()=>_,XO:()=>d,ah:()=>M,cM:()=>w,he:()=>m,jI:()=>D,jc:()=>S,lF:()=>B,m4:()=>p,s8:()=>v,tT:()=>g,uG:()=>f,vo:()=>h,x4:()=>c,xC:()=>y});n(757658);var o=n(653965),r=n(401898),i=n(959753),a=(n(463306),n(772141)),s=n(429369);function l(e){return e instanceof i.qcx?e.getRawMembership():void 0===e.membership?[]:e.membership}function c(e){let{rawMembers:t,groups:n}=e;if(!t||!n)return[];const r=o.KX(n,(e=>e.id)),i=t.map((e=>"group"===e.entity_type?r[e.group_id]:void 0));return o.oA(i)}function d(e){const t=l(e);return o.oA(t.map((e=>{if("owner"===e.type&&"user"===e.entity_type)return e.user_id})))}function u(e){const t=l(e);return o.oA(t.map((e=>{if("team_level_guest"===e.type)return e.user_id})))}function p(e){return Boolean(e.archived_by)}function m(e){const t=g(e);if(0===t.length)return"none";return f(...t.map((e=>e.type)))}function g(e){const{team:t,space:n,spaceUser:o}=e,r=t.getRawMembership(),i=[];if(!o)return[];const a=r.find((e=>"user"===e.entity_type&&e.user_id===o.user_id));if(!o.isMember()&&"team_level_guest"!==(null==a?void 0:a.type))return[];a&&i.push(a);const s={};r.filter((e=>"group"===e.entity_type)).forEach((e=>{const t=e;s[t.group_id]=t}));const l=n.getPermissionGroups().filter((e=>{var t;return s[e.id]&&(null===(t=e.user_ids)||void 0===t?void 0:t.includes(o.user_id))})).map((e=>s[e.id]));return i.push(...l),t.is_default&&0===i.length&&i.push({type:"member",entity_type:"user",user_id:o.user_id}),i}function f(){let e=0;for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];for(const r of n)e=Math.max(e,s.d2.indexOf(r));return s.d2[e]}function h(e){const{givenTeamRole:t,comparisonTeamRole:n}=e;return s.d2.indexOf(t)>=s.d2.indexOf(n)}function v(e){let{team:t,userId:n}=e;return l(t).some((e=>"team_level_guest"===e.type&&e.user_id===n))}function y(e){if(!e.permissions)return"none";const t=e.permissions.find((t=>b(t,e.id)));return t?t.role:"none"}function b(e,t){return(0,a.zU)(e)?e.team_id===t:(0,a.Ix)(e)}function _(e,t){return!!(0,a.bm)(e)&&e.team_id===t}function S(e,t){return!(!(0,a.LW)(e)||e.team_id!==t)||(0,a.KK)(e)}function k(e){return x(e).map((e=>e.userId))}function w(e){return x(e).filter((e=>e.teamMemberInfos.some((e=>"owner"===e.type||"member"===e.type)))).map((e=>e.userId))}function x(e){const{team:t,space:n,spaceMemberIds:o}=e;return I({teamMembership:t.isDefault()?C({team:t,spaceMemberIds:o}):t.getRawMembership(),spaceMemberIdsSet:new Set(o),permissionGroups:(null==n?void 0:n.getPermissionGroups())??[]})}function I(e){const{teamMembership:t,spaceMemberIdsSet:n,permissionGroups:o}=e,i={},a={};return t.forEach((e=>{if("user"===e.entity_type){("team_level_guest"===e.type||n.has(e.user_id))&&(i[e.user_id]=[e])}else"group"===e.entity_type?a[e.group_id]=e:(0,r.t1)(e)})),o.forEach((e=>{if(e.id in a&&e.user_ids){const t=a[e.id];e.user_ids.forEach((e=>{e in i||(i[e]=[]),n.has(e)&&i[e].push(t)}))}})),(0,r.qP)(i).map((e=>{let[t,n]=e;return{userId:t,teamMemberInfos:n}}))}function C(e){let{team:t,spaceMemberIds:n}=e;const o=[],r=new Set;for(const i of t.getRawMembership())o.push(i),"user"!==i.entity_type||"member"!==i.type&&"owner"!==i.type||r.add(i.user_id);for(const i of n)r.has(i)||o.push({type:"member",entity_type:"user",user_id:i});return o}function T(e){return"user"===e.entity_type?`${e.entity_type}|${e.user_id}`:"group"===e.entity_type?`${e.entity_type}|${e.group_id}`:void(0,r.t1)(e)}function M(e,t){return T(e)===T(t)}function P(e){return"self_join"===e.space_member_join_access?"open":"team_members"===e.visibility?"private":"closed"}function A(e){const{accessLevel:t,isDefault:n}=e,{id:o,permissions:i,settings:s}=e.teamValue,l={type:"explicit_team_owner_permission",role:"editor",team_id:o},c=(null==i?void 0:i.find(a.zU))||{type:"explicit_team_permission",role:"editor",team_id:o},d=null==i?void 0:i.find(a.Ir),u={visibility:"space_members",space_member_join_access:"self_join",invite_access:"team_members"};if(n)return{settings:u,permissions:[l,c,{type:"space_permission",role:c.role},{type:"explicit_team_guest_permission",role:"none",team_id:o}]};if("open"===t){const e=(null==d?void 0:d.role)??"none";return{settings:u,permissions:[l,c,{type:"space_permission",role:(0,a.YX)(e)?e:c.role}]}}return"closed"===t?{settings:{visibility:"space_members",space_member_join_access:"invite_only",invite_access:s.invite_access},permissions:[l,c,{type:"space_permission",role:"none"}]}:"private"===t?{settings:{visibility:"team_members",space_member_join_access:"invite_only",invite_access:null==s?void 0:s.invite_access},permissions:[l,c,{type:"space_permission",role:"none"}]}:void(0,r.t1)(t)}function R(e){let{spaceUserModel:t,teamModel:n,spaceModel:o}=e;if(void 0===(null==t?void 0:t.getUserId())||void 0===n||void 0===o)return!1;if("private"!==P(n.getSettings()))return!1;return"none"===m({space:o,spaceUser:t,team:n})}function D(e){return d(e).length<1}function B(e){let{groupId:t,teamMember:n}=e;return"group"===n.entity_type&&n.group_id===t}function E(e,t){return t?t.filter((t=>!M(t,e))):[]}function F(e,t){return(t=(t=t??[]).filter((t=>!M(t,e)))).push(e),t}},733653:(e,t,n)=>{n.d(t,{o:()=>o});const o=(0,n(709291).defineMessages)({nowText:{defaultMessage:"Now",id:"mentionMenu.templateVariables.text.now"},nowDescription:{defaultMessage:"Time when duplicated",id:"mentionMenu.templateVariables.description.now"},nowKeywords:{defaultMessage:"now",id:"mentionMenu.templateVariables.keywords.now"},todayText:{defaultMessage:"Today",id:"mentionMenu.templateVariables.text.tday"},todayDescription:{defaultMessage:"Date when duplicated",id:"mentionMenu.templateVariables.description.today"},todayKeywords:{defaultMessage:"today",id:"mentionMenu.templateVariables.keywords.today"},meText:{defaultMessage:"Me",id:"mentionMenu.templateVariables.text.me"},meDescription:{defaultMessage:"User when duplicated",id:"mentionMenu.templateVariables.description.me"},meKeywords:{defaultMessage:"me",id:"mentionMenu.templateVariables.keywords.me"}})},95807:(e,t,n)=>{n.d(t,{Hl:()=>i,Sl:()=>r});var o=n(401898);function r(e,t){if(!(0,o.$K)(t)||"production"===e)return t;const n=`notion-${e}-`;return t.startsWith(n)?t:`${n}${t}`}function i(e){return e&&e.startsWith("//")?`https:${e}`:e}},994826:(e,t,n)=>{n.d(t,{EY:()=>P,I$:()=>R,M2:()=>F,RW:()=>D,Uw:()=>A,ZB:()=>T,iV:()=>d,uw:()=>E,z6:()=>B});var o=n(709291),r=n(653965),i=n(307032),a=n(401898),s=n(218265),l=n(619584),c=n(715070);const d={headers:{authorization:{prefix:"Bearer"},hmac:!1},body:{path:["event"]},urlValidator:function(e){return Boolean((0,s.yn)(e))}},u=(0,o.defineMessages)({nightfall:{id:"temporaryWebhookIntegrationConfig.taglines.nightfall",defaultMessage:"Simplify security and compliance with Nightfall AI"},panther:{id:"temporaryWebhookIntegrationConfig.taglines.panther",defaultMessage:"A SIEM built for speed, scale, and flexibility"},sumologic:{id:"temporaryWebhookIntegrationConfig.taglines.sumologic",defaultMessage:"Secure and protect against modern threats with cloud-native log analytics"},runreveal:{id:"temporaryWebhookIntegrationConfig.taglines.runreveal",defaultMessage:"A SIEM you can love"},splunk:{id:"temporaryWebhookIntegrationConfig.taglines.splunk",defaultMessage:"The unified security and observability platform"},datadog:{id:"temporaryWebhookIntegrationConfig.taglines.datadog",defaultMessage:"Detect, investigate, and automate response to threats at any scale"},polymer:{id:"temporaryWebhookIntegrationConfig.taglines.polymer",defaultMessage:"Protect sensitive data across cloud apps and reduce the risk of exposure"},onna:{id:"temporaryAdminIntegrationConfig.taglines.onna",defaultMessage:"Connect. Find. Act."},hanzo:{id:"temporaryAdminIntegrationConfig.taglines.hanzo",defaultMessage:"Manage Risk Everywhere Work Is Done"},aware:{id:"temporaryAdminIntegrationConfig.taglines.aware",defaultMessage:"Secure Your Digital Workplace. Drive Growth. Scale AI."},drata:{id:"temporaryAdminIntegrationConfig.taglines.drata",defaultMessage:"Continuous compliance automation platform"},drataStaging:{id:"temporaryAdminIntegrationConfig.taglines.drataStaging",defaultMessage:"Drata (Staging) tagline"},metomic:{id:"temporaryAdminIntegrationConfig.taglines.metomic",defaultMessage:"Metomic integration tagline"},custom:{id:"temporaryAdminIntegrationConfig.taglines.custom",defaultMessage:"Custom webhook integration that only requires a destination URL."}}),p={id:"a2768733-a1f9-4174-84fa-40a9ff2053d7",name:"nightfall",icon:"/images/external_integrations/nightfall-logo.svg",website_url:"https://www.nightfall.ai/",signupUrl:"https://www.nightfall.ai/integrations/notion",privacy_policy_url:"https://www.nightfall.ai/privacy",terms_of_use_url:"https://www.nightfall.ai/terms",developer_name:"Nightfall AI",installation_info_url:void 0,type:"dlp",tagline:u.nightfall,webhookUrl:"https://notion.nightfall.ai/notion/v1/event",customization:{headers:{hmac:!0}},allowedBotCapabilities:{webhooks:!0,read_content:!0,update_content:!0,read_comment:!0,insert_comment:!0,read_user_without_email:!0,read_user_with_email:!0},allowedEndpoints:["public_getPage","public_getPageProperty","public_getBlock","public_listBlockChildren","public_getDatabase","public_getSelf","public_updatePage","public_updateBlock","public_deleteBlock","public_updateDatabase","public_listComments","public_createComment","public_deleteComment","public_updateComment","public_getComment","public_unsharePageFromWeb","public_removeGuestsFromPage","public_getUser","public_external_deleteExternalBot"],acceptsSecretToken:!1,integrationGalleryUrl:"https://www.notion.so/integrations/nightfall-ai",redirectUri:"https://app.nightfall.ai/dashboard"},m={id:"fb50a39e-955a-4b9c-9ffb-49587de2a79c",name:"panther",icon:"/images/external_integrations/panther-logo.png",website_url:"https://panther.com/",signupUrl:"https://panther.com/product/request-a-demo/",privacy_policy_url:"https://panther.com/privacy-policy/",terms_of_use_url:"https://panther.com/terms-of-service/",developer_name:"Panther",installation_info_url:void 0,type:"siem",customization:{headers:{hmac:!0},urlValidator:function(e){if(!e||!(0,s.yn)(e))return!1;const t=new URL(e);if("https:"!==t.protocol)return!1;if(!t.pathname.startsWith("/http/"))return!1;const n=t.pathname.replace("/http/","");return!!(0,i.t)(n)}},tagline:u.panther,allowedBotCapabilities:{webhooks:!0},acceptsSecretToken:!0,integrationGalleryUrl:"https://www.notion.so/integrations/panther"},g={id:"3ecda536-3b09-4218-a756-bda416c512d7",name:"sumologic",icon:"/images/external_integrations/sumo-logic-logo.jpeg",website_url:"https://www.sumologic.com/",signupUrl:"https://www.sumologic.com/sign-up/",privacy_policy_url:"https://www.sumologic.com/privacy-statement/",terms_of_use_url:"https://www.sumologic.com/terms-conditions/",developer_name:"Sumo Logic",installation_info_url:void 0,type:"siem",tagline:u.sumologic,allowedBotCapabilities:{webhooks:!0},acceptsSecretToken:!1,integrationGalleryUrl:"https://www.notion.so/integrations/sumo-logic",customization:{urlValidator:function(e){if(!e||!(0,s.yn)(e))return!1;const t=new URL(e);return"https:"===t.protocol&&(!!t.hostname.endsWith("sumologic.com")&&!!t.pathname.startsWith("/receiver/v1/http/"))}}},f={id:"ff522b0f-e688-4986-9b7d-255627316f73",name:"splunk",icon:"/images/external_integrations/splunk-logo.jpeg",website_url:"https://www.splunk.com/",signupUrl:"https://www.splunk.com/en_us/talk-to-sales.html",privacy_policy_url:"https://www.splunk.com/en_us/legal/privacy/privacy-policy.html",terms_of_use_url:"https://www.splunk.com/en_us/legal/terms/terms-of-use.html",developer_name:"Splunk",installation_info_url:void 0,integrationGalleryUrl:"https://www.notion.so/integrations/splunk",customization:{headers:{authorization:{prefix:"Splunk"}},body:{path:["event"]},urlValidator:function(e){if(!e||!(0,s.yn)(e))return!1;const t=new URL(e);if(!["http:","https:"].includes(t.protocol))return!1;let n=t.hostname;return!(!n.startsWith("http-inputs")||!n.endsWith(".splunkcloud.com"))&&(n=n.replace("http-inputs","").replace(".splunkcloud.com",""),!(n.length<2||!n.startsWith("-")&&!n.startsWith("."))&&!!["/services/collector/raw","/services/collector/event"].includes(t.pathname))}},type:"siem",tagline:u.splunk,allowedBotCapabilities:{webhooks:!0},acceptsSecretToken:!0},h={id:"97d68716-a483-4472-8fa9-da26215d721a",name:"datadog",icon:"/images/external_integrations/datadog-logo.png",website_url:"https://www.datadoghq.com/",signupUrl:"https://www.datadoghq.com/free-datadog-trial/",privacy_policy_url:"https://www.datadoghq.com/legal/privacy/",terms_of_use_url:"https://www.datadoghq.com/legal/terms/",developer_name:"Datadog",installation_info_url:void 0,type:"siem",integrationGalleryUrl:"https://www.notion.so/integrations/datadog",customization:{headers:{hmac:!0}},oauth:{accountInfoPropertyNames:{accountId:"dd_oid",accountName:"dd_org_name"},usePKCE:!0,apiDomainsByRegion:{"https://app.datadoghq.com":"api.datadoghq.com","https://us3.datadoghq.com":"api.us3.datadoghq.com","https://us5.datadoghq.com":"api.us5.datadoghq.com","https://app.datadoghq.eu":"datadoghq.eu","https://app.ddog-gov.com":"ddog-gov.com","https://ap1.datadoghq.com":"ap1.datadoghq.com"},tokenPath:"/oauth2/v1/token",apiKeyPath:"/api/v2/api_keys/marketplace"},tagline:u.datadog,allowedBotCapabilities:{webhooks:!0},acceptsSecretToken:!1},v={id:"73da42b2-8736-4900-b53d-20a8d0d46a17",name:"runreveal",icon:"/images/external_integrations/runreveal.png",website_url:"https://runreveal.com/",signupUrl:"https://runreveal.com/signup",privacy_policy_url:"https://runreveal.com/privacy-policy",terms_of_use_url:"https://runreveal.com/terms-of-service",developer_name:"RunReveal",installation_info_url:void 0,type:"siem",tagline:u.runreveal,allowedBotCapabilities:{webhooks:!0},acceptsSecretToken:!1,integrationGalleryUrl:"https://www.notion.so/integrations/runreveal",customization:{urlValidator:function(e){if(!e||!(0,s.yn)(e))return!1;const t=new URL(e);return"https:"===t.protocol&&!!t.hostname.endsWith(".runreveal.com")}}},y={icon:"/images/external_integrations/polymer-logo.jpeg",website_url:"https://www.polymerhq.io/",signupUrl:"https://www.polymerhq.io/request-demo/",privacy_policy_url:"https://www.polymerhq.io/privacy/",terms_of_use_url:"https://www.polymerhq.io/terms-of-service/",installation_info_url:void 0,type:"dlp",tagline:u.polymer,integrationGalleryUrl:"https://www.notion.so/integrations/polymer",allowedBotCapabilities:{webhooks:!0,read_content:!0,update_content:!0,read_comment:!0,insert_comment:!0,read_user_without_email:!0,read_user_with_email:!0},allowedEndpoints:["public_getPage","public_getPageProperty","public_getBlock","public_listBlockChildren","public_getDatabase","public_getSelf","public_updatePage","public_updateBlock","public_deleteBlock","public_updateDatabase","public_listComments","public_createComment","public_deleteComment","public_updateComment","public_getComment","public_unsharePageFromWeb","public_removeGuestsFromPage","public_listUsers","public_getUser","public_external_deleteExternalBot"],acceptsSecretToken:!1,redirectUri:"https://www.polymerhq.io/"},b={...y,id:"9fb229bb-d287-45de-82f1-7331e99d9c6b",name:"polymer",developer_name:"Polymer",webhookUrl:"https://notion.polymerhq.io/notion/events"},_={...y,id:"1b725b3c-5eda-454d-9b41-0f903de3ba00",name:"polymerDev",developer_name:"PolymerDev",webhookUrl:"https://pilot.qa.polymerhq.io/notion/events"},S={icon:"https://s3-us-west-2.amazonaws.com/public.notion-static.com/3944326d-8881-4093-90f8-63637b1ef75f/metomic.png",website_url:"https://metomic.io/",privacy_policy_url:"https://metomic.io/privacy-policy",terms_of_use_url:"https://metomic.io/terms-and-conditions",signupUrl:"https://metomic.io/",allowedBotCapabilities:{webhooks:!0,read_comment:!0,read_content:!0,insert_content:!0,update_content:!0,read_user_with_email:!0,read_user_without_email:!0,workspace_search:!0},type:"dlp",tagline:u.metomic,allowedEndpoints:["public_getPage","public_getPageProperty","public_getBlock","public_listBlockChildren","public_getDatabase","public_getSelf","public_updatePage","public_updateBlock","public_deleteBlock","public_updateDatabase","public_listComments","public_createComment","public_deleteComment","public_updateComment","public_getComment","public_unsharePageFromWeb","public_removeGuestsFromPage","public_getUser","public_external_deleteExternalBot","public_workspaceSearch","public_listTeamspaces"],acceptsSecretToken:!1,integrationGalleryUrl:"https://www.notion.so/integrations/metomic",redirectUri:"https://metomic.io/",customization:{headers:{hmac:!0}}},k={...S,id:"05d23763-7da5-4fcc-aad4-a147d5034cc3",name:"metomic",developer_name:"Metomic",webhookUrl:"https://integrations-api.metomic.io/notion/webhooks/generic/0188965b-c4f7-589c-45c0-7766857bad32"},w={...S,id:"75b66e0c-be9f-4fc5-bed6-1bc156f91e1c",name:"metomicStaging",developer_name:"Metomic (Staging)",webhookUrl:"https://integrations-api.metomic-staging.io/notion/webhooks/generic/01889547-4e22-1e0b-f363-571468d1b042"},x={id:"7487d286-3fa5-4984-8a62-3aa4c51f50ed",name:"custom",developer_name:"Custom SIEM integration",type:"siem",tagline:u.custom,allowedBotCapabilities:{webhooks:!0},acceptsSecretToken:!1,integrationGalleryUrl:"https://www.notion.so/integrations",acceptsCustomHeaders:!0},I=["public_exportPage","public_workspaceSearch","public_getUser","public_listUsers","public_listTeamspaces","public_getPage","public_getBlock","public_getDatabase","public_getSelf"],C={workspace_search:!0,workspace_page_export:!0,read_content:!0,read_user_without_email:!0,read_user_with_email:!0,read_teamspace:!0},T={datadog:h,nightfall:p,panther:m,polymer:b,polymerDev:_,metomic:k,metomicStaging:w,splunk:f,sumologic:g,runreveal:v,onna:{id:"bb67e6bb-09f3-48fe-a7b2-428665ff20ac",name:"onna",icon:"/images/external_integrations/onna-icon.jpeg",website_url:"https://onna.com/",privacy_policy_url:"https://onna.com/privacy-policy",terms_of_use_url:"https://onna.com/master-subscription-agreement",developer_name:"Onna",type:"ediscovery",tagline:u.onna,integrationGalleryUrl:"https://www.notion.so/integrations/onna",allowedBotCapabilities:C,allowedEndpoints:I,redirectUri:"https://localhost:3005"},aware:{id:"99b8b727-7eee-40f8-af16-de045fb78e15",name:"aware",icon:"/images/external_integrations/aware-icon.png",website_url:"https://www.awarehq.com/",privacy_policy_url:"https://www.awarehq.com/privacy",terms_of_use_url:"https://www.awarehq.com/terms-conditions",developer_name:"Aware",type:"ediscovery",tagline:u.aware,integrationGalleryUrl:"https://www.notion.so/integrations/aware",allowedBotCapabilities:C,allowedEndpoints:I,redirectUri:"https://localhost:3005"},hanzo:{id:"2ebac254-9d38-4c94-b579-0eac7fe0f43c",name:"hanzo",icon:"/images/external_integrations/hanzo-icon.png",website_url:"https://www.hanzo.co/",privacy_policy_url:"https://www.hanzo.co/privacy",terms_of_use_url:"https://www.hanzo.co/privacy",developer_name:"Hanzo",type:"ediscovery",tagline:u.hanzo,integrationGalleryUrl:"https://www.notion.so/integrations/hanzo",allowedBotCapabilities:C,allowedEndpoints:I,redirectUri:"https://localhost:3005"},drata:{id:"04912200-d72b-4f0c-b61f-a192dc6e4a2f",name:"drata",icon:"/images/external_integrations/drata-icon.png",website_url:"https://drata.com/",privacy_policy_url:"https://drata.com/privacy",terms_of_use_url:"https://drata.com/terms",developer_name:"Drata",type:"ediscovery",tagline:u.drata,integrationGalleryUrl:"https://www.notion.so/integrations/drata",allowedBotCapabilities:C,allowedEndpoints:I,redirectUri:"https://app.drata.com/"},drataStaging:{id:"98e6e1b8-ac1b-414a-89b1-09cf4371d326",name:"drataStaging",website_url:"https://drata.com/",privacy_policy_url:"https://drata.com/privacy",terms_of_use_url:"https://drata.com/terms",developer_name:"Drata (Staging)",type:"ediscovery",tagline:u.drataStaging,integrationGalleryUrl:"https://www.notion.so/integrations/",allowedBotCapabilities:C,allowedEndpoints:I,redirectUri:"http://localhost:5000/callback/notion"},custom:x},M=(0,l.m8)((0,a.qP)(T).map((e=>{let[t,n]=e;return[n.id,n]})));function P(e){var t;return null===(t=R(e))||void 0===t?void 0:t.name}function A(e){const t=R(e);return Boolean(t&&"ediscovery"===t.type)}function R(e){if(e)return M[e]}function D(e){const t=R(e);if(t&&("siem"===t.type||"dlp"===t.type))return t}function B(e){return Boolean(R(e))}function E(e){if(!e)return!1;const t=R(e);return!!t&&(0,c.ms)(t.allowedBotCapabilities)}function F(e){const{env:t,integrationConfig:n,webhookUrlToValidate:o}=e;return!!(0,r.TS)({},d,n.customization).urlValidator(o)||"local"===t&&o.startsWith("http://localhost:3005/")}},421838:(e,t,n)=>{n.d(t,{Mc5:()=>T.Mc,WO0:()=>Cn,C9B:()=>cn,GKr:()=>T.Mc,pIV:()=>$n,DgZ:()=>T.Dg,F7H:()=>T.F7,Vkf:()=>oo,JB:()=>sn,CbB:()=>en,hNu:()=>an,mfJ:()=>Jt,YWq:()=>Qt,pZr:()=>tn,jw:()=>dn,qZ6:()=>_n,x36:()=>on,_QF:()=>bn,kbv:()=>yn,XIB:()=>nn,edl:()=>rn,Wy3:()=>ln,YCD:()=>un,$0A:()=>Yt,WBu:()=>pn,W9d:()=>fn,mF$:()=>mn,rB1:()=>gn,EPB:()=>hn,TPx:()=>Wt,V3y:()=>$t,tEo:()=>Xt,_QS:()=>Fn,PM3:()=>Qn,fuX:()=>q,VP_:()=>to,Oqk:()=>Un,YnW:()=>ue,jC0:()=>Ce,PEL:()=>jn,gdi:()=>be,wPk:()=>fe,J82:()=>me,K9C:()=>he,zrg:()=>le,Ap:()=>se,frE:()=>ye,sP4:()=>xe,IVR:()=>Ie,jRb:()=>we,xat:()=>ge,gCI:()=>Te,eQP:()=>Me,rlz:()=>_e,LLi:()=>ve,I$B:()=>ae,V8Y:()=>pe,$d7:()=>ce,QGY:()=>Se,ujB:()=>ke,U_3:()=>Pe,hH9:()=>de,KSk:()=>At,P0m:()=>Vn,bjV:()=>Pt,gOH:()=>T.gO,O5C:()=>re,c14:()=>oe,Sfs:()=>Pn,J7s:()=>T.J7,Rkp:()=>bt,M9L:()=>dt,_Rq:()=>We,zyy:()=>Mt,Ulv:()=>io,eeV:()=>Lt,Vv0:()=>ct,r3j:()=>ut,$WM:()=>rt,PtE:()=>at,zyO:()=>pt,LmI:()=>Ht,nai:()=>Rt,h19:()=>et,fgJ:()=>tt,llS:()=>kt,xey:()=>ze,o0h:()=>St,CGe:()=>It,frW:()=>Xe,zUo:()=>xt,vmO:()=>Ye,oOk:()=>Tt,pxR:()=>Qe,kxk:()=>$e,zIN:()=>gt,zW$:()=>qe,r0m:()=>mt,Xyp:()=>On,Hze:()=>He,rOz:()=>eo,rxn:()=>Zt,Un8:()=>Ln,hn0:()=>_t,EX_:()=>An,TOT:()=>lt,yrl:()=>it,cCA:()=>Dt,HC:()=>Nn,jDe:()=>Bt,EpE:()=>nt,Nv0:()=>wt,XIY:()=>ot,fsE:()=>ht,sbu:()=>ft,TZP:()=>vt,ldh:()=>st,QaF:()=>jt,Qh7:()=>qt,VrM:()=>je,V3g:()=>zt,KU1:()=>Gt,Jcv:()=>Kt,hDy:()=>yt,J1x:()=>Le,WiV:()=>Oe,b1T:()=>kn,lzi:()=>Ot,kG3:()=>qn,O1u:()=>wn,zEN:()=>Ge,lcG:()=>Ct,p9b:()=>En,oP:()=>Bn,P$X:()=>Zn,AJd:()=>Re,_q_:()=>T._q,Nxc:()=>X,L7X:()=>J,$z2:()=>Q,dlu:()=>ee,pV3:()=>T.pV,OU5:()=>T.OU,eIM:()=>Ee,fTS:()=>T.fT,K$_:()=>T.K$,VOE:()=>T.VO,fpG:()=>T.fp,tXA:()=>Ne,loE:()=>T.lo,xw5:()=>T.xw,kuv:()=>T.ku,YrK:()=>Fe,EqZ:()=>$,vX7:()=>te,nSN:()=>T.nS,tk7:()=>Ze,wjk:()=>T.wj,JmL:()=>T.Jm,jFV:()=>T.jF,CEh:()=>Je,Lyt:()=>T.Ly,_bk:()=>T._b,LAI:()=>T.LA,p23:()=>T.p2,GIC:()=>T.GI,j0F:()=>T.j0,vuC:()=>T.vu,ZAl:()=>T.ZA,km_:()=>De,lFw:()=>W,V6J:()=>ne,STW:()=>T.ST,eOb:()=>Be,pJX:()=>Ve,ehE:()=>T.eh,QJH:()=>Ae,inx:()=>T.in,u2m:()=>T.u2,pGj:()=>T.pG,$b8:()=>T.$b,Jeu:()=>T.Je,X5l:()=>T.X5,BIG:()=>T.BI,$nX:()=>T.$n,D4X:()=>Ue,aq:()=>T.aq,aC4:()=>T.aC,otC:()=>T.ot,QVC:()=>T.QV,wWS:()=>T.wW,uge:()=>T.ug,Ojp:()=>T.Oj,rIb:()=>T.rI,UWr:()=>T.UW,FAE:()=>T.FA,f_I:()=>T.f_,PgY:()=>ie,IWo:()=>T.IW,xvX:()=>T.xv,aVG:()=>H,qyI:()=>z,wrb:()=>Xn,k87:()=>G,Zxt:()=>xn,s8k:()=>T.s8,STJ:()=>Tn,c1u:()=>vn,vJ3:()=>Nt,Y_F:()=>Vt,hpT:()=>ro,gPn:()=>Jn,xrQ:()=>In,Aqt:()=>Ut,Dne:()=>co,vNd:()=>Kn,Zgr:()=>ao,Z$K:()=>so,Zdj:()=>no});n(757658),n(252262),n(324506);var o=n(530615),r=n(653965),i=n(401898),a=n(218265),s=n(619584),l=n(840376),c=n(407057),d=n(415095),u=n(630845),p=n(924211),m=n(758203),g=n(23210),f=n(511799),h=n(421202),v=n(177420),y=n(606287),b=n(870279),_=n(394302),S=(n(933709),n(23867)),k=n(519889),w=(n(21703),n(467266)),x=n.n(w),I=n(261158),C=n(182798),T=n(849772);n(430541);const M=new WeakMap;function P(e){let t=M.get(e);return void 0!==t||(t=x()(e),M.set(e,t)),t}class A{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P;this.nodes=new Map,this.getKey=e}addNode(e){const t=this.getKey(e);this.nodes.has(t)||this.nodes.set(t,{children:new Set,value:e})}hasNode(e){const t=this.getKey(e);return this.nodes.has(t)}removeNode(e){const t=this.getKey(e);if(this.nodes.has(t)){const e=(0,C.TO)(this.nodes.get(t));this.nodes.delete(t);for(const{children:t}of this.nodes.values())t.delete(e)}}addEdge(e,t){this.addNode(e),this.addNode(t);const n=(0,C.TO)(this.nodes.get(this.getKey(e))),o=(0,C.TO)(this.nodes.get(this.getKey(t)));if(!n.children.has(o)&&(n.children.add(o),this.hasCycle(n)))throw n.children.delete(o),new Error(`Cycle detected adding edge ${this.getKey(e)} -> ${this.getKey(t)}`)}removeEdge(e,t){const n=(0,C.TO)(this.nodes.get(this.getKey(e))),o=(0,C.TO)(this.nodes.get(this.getKey(t)));n.children.has(o)&&n.children.delete(o)}hasEdge(e,t){const n=this.nodes.get(this.getKey(e)),o=this.nodes.get(this.getKey(t));return Boolean(n&&o&&n.children.has(o))}hasCycle(e){const t=new Set,n=new Set,o=e=>{if(t.has(e))return!0;if(n.has(e))return!1;t.add(e);for(const t of e.children)if(o(t))return!0;return t.delete(e),n.add(e),!1};return o(e)}getSortedNodes(){const e=[],t=new Set,n=o=>{t.add(o);for(const e of o.children)t.has(e)||n(e);e.unshift(o.value)};for(const o of this.nodes.values())t.has(o)||n(o);return e}}class R{constructor(){this.maxEndIndex=0,this.annotationRanges=new o.G((()=>[])),this.sorter=new A}addOrderedAnnotationsInRange(e){const{annotationLists:t,startIndex:n,endIndex:o}=e;(0,C.T)(n>=0,"Start index must be greater than or equal to 0"),(0,C.T)(n<o,"End index must be greater than start index"),(0,C.T)(n>=this.maxEndIndex,"Start of range should be greater than end of previously added ranges");const r=new I.Z,i=[];try{for(const e of t)for(let t=0;t<e.length;t++){const n=e[t];if(this.sorter.hasNode(n)||(this.sorter.addNode(n),r.add(n)),t>0){const o=e[t-1];this.sorter.hasEdge(o,n)||(this.sorter.addEdge(o,n),i.push([o,n]))}}}catch(a){for(const[e,t]of i)this.sorter.removeEdge(e,t);for(const e of r)this.sorter.removeNode(e);throw new Error("A list of annotations caused a cycle")}for(const s of t)for(const e of s){const t=x()(e),r=this.annotationRanges.get(t),i=r.at(-1);!i||i.endIndex!==n||(0,T.ZA)(e)||(0,T.ku)(e)?r.push({startIndex:n,endIndex:o}):(0,C.TO)(r.at(-1)).endIndex=o}this.maxEndIndex=o}getSortedAnnotationRanges(){const e=this.sorter.getSortedNodes(),t=[];for(const n of e){const e=x()(n),o=this.annotationRanges.get(e);for(const r of o)t.push({annotation:n,...r})}return t}}var D=n(531701),B=n(640506);function E(e){return[T.Mc.Bold]}function F(e){return[T.Mc.Italic]}function Z(e){return[T.Mc.Strike]}function U(e){return[T.Mc.Code]}function V(e){return[T.Mc.Underline]}function N(e){return 2===e.length&&"string"==typeof e[1]&&e[1].length?[T.Mc.Link,e[1]]:void 0}function O(e){return 2===e.length&&"string"==typeof e[1]&&(0,D.nR)(e[1])?[T.Mc.Highlight,e[1]]:void 0}function L(e){const t=e[0];switch(t){case T.Mc.Bold:return E();case T.Mc.Italic:return F();case T.Mc.Strike:return Z();case T.Mc.Code:return U();case T.Mc.Underline:return V();case T.Mc.Link:return N(e);case T.Mc.Highlight:return O(e);default:(0,i.t1)(t)}}T.Mc.Bold,T.Mc.Italic,T.Mc.Strike,T.Mc.Code,T.Mc.FormulaError,T.Mc.Underline,T.Mc.Inserted,T.Mc.Deleted,T.Mc.TemporaryComment,T.Mc.User,T.Mc.Bot,T.Mc.Page,T.Mc.TemporaryPage,T.Mc.Date,T.Mc.ExternalObjectInstance,T.Mc.TemplateVariable,T.Mc.Comment,T.Mc.Group,T.Mc.LinkMention,T.Mc.CustomEmoji,T.Mc.Citation,T.Mc.Discussion,T.Mc.Link,T.Mc.Highlight,T.Mc.Equation,T.Mc.TemporaryEquation,T.Mc.TemporaryInput,T.Mc.TemporarySelection,T.Mc.FormulaPageProperty,T.Mc.FormulaContextValue,T.Mc.TemporaryFindHighlight,T.Mc.TemporarySelectedFindHighlight,T.Mc.TemporaryCursor,T.Mc.SuggestionInsertText,T.Mc.SuggestionRemoveText,T.Mc.SuggestionAnnotate,T.Mc.SuggestionUnannotate,T.Mc.TemporaryHighlight,T.Mc.TemporaryNativeMABFilter,T.Mc.TemporaryDictation,T.Mc.AssistantInstructionsCollection;function j(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const K=8192,z="‣",q="⁍",H="⏎",G={...T.aL,[T.Mc.FormulaError]:!0,[T.Mc.Inserted]:!0,[T.Mc.Deleted]:!0,[T.Mc.TemporaryComment]:!0,[T.Mc.Discussion]:!0,[T.Mc.SuggestionRemoveText]:!0,[T.Mc.SuggestionUnannotate]:!0,[T.Mc.SuggestionInsertText]:!0,[T.Mc.SuggestionAnnotate]:!0,[T.Mc.Link]:!0,[T.Mc.Equation]:!0,[T.Mc.TemporaryEquation]:!0,[T.Mc.TemporaryInput]:!0,[T.Mc.TemporarySelection]:!0,[T.Mc.TemporaryFindHighlight]:!0,[T.Mc.TemporaryHighlight]:!0,[T.Mc.TemporarySelectedFindHighlight]:!0,[T.Mc.TemporaryCursor]:!0,[T.Mc.TemporaryNativeMABFilter]:!0,[T.Mc.TemporaryDictation]:!0,[T.Mc.LinkMention]:!0};function W(e){return!!((0,T.ZA)(e)||(0,T.Jm)(e)||(0,T.p2)(e)||(0,T.lo)(e)||(0,T.aC)(e)||(0,T.xw)(e)||(0,T.$b)(e)||(0,T.Je)(e)||(0,T.pG)(e)||(0,T.u2)(e)||(0,T.j0)(e)||(0,T.ku)(e)||(0,T.QV)(e)||(0,T.ug)(e)||(0,T.FA)(e)||(0,T.Ze)(e)||(0,T.wW)(e)||(0,T.UW)(e)||(0,T.qA)(e)||(0,T.Oj)(e)||(0,T.ot)(e))}T.Mc.Code;function $(e){return!!(0,T.fT)(e)}const Y={[T.Mc.Bold]:!0,[T.Mc.Italic]:!0,[T.Mc.Strike]:!0,[T.Mc.Underline]:!0,[T.Mc.Highlight]:!0};function Q(e){switch(e){case T.Mc.Bold:case T.Mc.Italic:case T.Mc.Strike:case T.Mc.Underline:case T.Mc.Highlight:return!0;default:return!1}}function J(e){return Q("hb"===e||"hf"===e?T.Mc.Highlight:e)}function X(e){return!!((0,T.RP)(e)||(0,T.m1)(e)||(0,T.t1)(e)||(0,T.PM)(e)||(0,T.LA)(e))}T.Mc.SuggestionInsertText,T.Mc.SuggestionAnnotate,T.Mc.SuggestionRemoveText;function ee(e){return!!X(e)||!!((0,T.pG)(e)||(0,T.u2)(e)||(0,T.$b)(e))}function te(e){return!!$(e)}function ne(e){return!!((0,T.ZA)(e)||(0,T.Jm)(e)||(0,T.p2)(e)||(0,T.lo)(e)||(0,T.aC)(e)||(0,T.xw)(e)||(0,T.Je)(e)||(0,T.j0)(e)||(0,T.ku)(e)||(0,T.QV)(e)||(0,T.ug)(e)||(0,T.FA)(e)||(0,T.Ze)(e)||(0,T.wW)(e)||(0,T.UW)(e)||(0,T.qA)(e)||(0,T.Oj)(e)||(0,T.ot)(e))}function oe(e){return(0,T.Pb)(e)?e:(0,T.gO)(e)}function re(e){return"string"==typeof e?e:e[0]}function ie(e){return!(e??[]).some((e=>Oe(e).trim().length>0))}function ae(e){return e.find(T.ZA)}function se(e){return e.find(T.ku)}function le(e){return e.filter(T.xw)}function ce(e){return e.filter(T.BI)}function de(e){return e.find(T.IW)}function ue(e){return e.find((e=>(0,T.pV)(e)))}function pe(e){return e.find(T.ST)}function me(e){return e.find(T.VO)}function ge(e){return e.find(T._b)}function fe(e){return e.find(T.K$)}function he(e){return e.find(T.fp)}function ve(e){return e.find(T.vu)}function ye(e){return e.find(T.nS)}function be(e){return e.find(T.fT)}function _e(e){return e.find(T.j0)}function Se(e){return e.find(T.aq)}function ke(e){return e.find(T.aC)}function we(e){return e.find(T.Ly)}function xe(e){return e.find(T.wj)}function Ie(e){return e.find(T.jF)}function Ce(e){return e.find(T.OU)}function Te(e){return e.find(T.p2)}function Me(e){return e.find(T.GI)}function Pe(e){return e.find(T.Oj)}function Ae(e){return 1===e.length}function Re(e){if(2===e.length&&!De(e)&&!Fe(e)){const[,t]=e;return t.filter(T.f_).length===t.length}return!1}function De(e){if(2===e.length&&e[0]===z){const[,t]=e;return Boolean(t.find(T.ZA))}return!1}function Be(e){if(2===e.length&&e[0]===z){const[,t]=e;return Boolean(t.find(T.ST))}return!1}function Ee(e){if(2===e.length&&e[0]===z){const[,t]=e;return Boolean(Ce(t))}return!1}function Fe(e){if(2===e.length&&e[0]===q){const[,t]=e;return Boolean(t.find(T.ku))}return!1}function Ze(e){return!(!Fe(e)&&!Be(e))}function Ue(e){return"string"==typeof e&&T.SR.includes(e)}function Ve(e){return"me"===e}function Ne(e){return"today"===e||"now"===e}function Oe(e){return e[0]}function Le(e){return d.p4(Oe(e)).length}function je(e){return e.reduce(((e,t)=>e+Le(t)),0)}function Ke(e){if(e&&e[1])return e[1]}function ze(e){return e[1]}function qe(e){return Ke(e)}function He(e){const t=_e(yt(e));if(t)return qe(t)}function Ge(e){return Ke(e)}function We(e){return Ke(e)}function $e(e){if(e&&e[1]&&e[2])return{groupId:e[1],spaceId:e[2]}}function Ye(e){return Ke(e)}function Qe(e){return Ke(e)}function Je(e){return"contextValueId"in e}function Xe(e){return Ke(e)}function et(e){return Ke(e)}function tt(e){return Ke(e)}function nt(e){return e[2]}function ot(e){return Ke(e)}function rt(e){if(e&&3===e.length)return{table:b.x_,id:e[1],spaceId:(0,S.C)(e[2])}}function it(e){if(e&&e[1])return{table:h.iU,id:e[1],spaceId:(0,S.C)(3===e.length?e[2]:void 0)}}function at(e){if(e&&e[1]&&e[2])return{table:_.p,id:e[1],spaceId:e[2]}}function st(e){if(e&&e[1])return e[1]}function lt(e){return Ke(e)}function ct(e){return Ke(e)}function dt(e){return{table:y.vF,id:e[1],spaceId:(0,S.C)(3===e.length?e[2]:void 0)}}function ut(e){return Ke(e)}function pt(e){return Ke(e)}function mt(e){return Ke(e)}function gt(e){return Ke(e)}function ft(e){return Ke(e)}function ht(e){return Ke(e)}function vt(e){return Ke(e)}function yt(e){return e&&e[1]&&Array.isArray(e[1])?e[1]:[]}function bt(e){const t=e??[];return yt(r.Z$(t))}function _t(e){return yt(e)}function St(e){const t=yt(e).find(T.ku);if(!t)return"";return ze(t)}function kt(e){return r.jj(r.xH(Ot(e).map((e=>function(e){return e.filter(T.hr)}(yt(e)).map((e=>ot(e)))))))}function wt(e){return r.jj(r.xH(Ot(e).map((e=>ce(yt(e)).map((e=>ot(e)))))))}function xt(e){return r.jj(r.xH(Ot(e).map((e=>{const t=function(e){return e.filter(T.nS)}(yt(e));return t.map((e=>Xe(e)))}))))}function It(e){const t=[];for(const n of Ot(e))if(Fe(n)){const e=St(n);t.push(e)}return t}function Ct(e){const t=[];return Ot(e).forEach((e=>{De(e)&&yt(e).forEach((e=>{if((0,T.IW)(e)){const n=Ge(e);n&&t.push(n)}}))})),t}function Tt(e){const t=[];return Ot(e).forEach((e=>{De(e)&&yt(e).forEach((e=>{if((0,T.wj)(e)){const n=Ye(e);n&&t.push(n)}}))})),t}function Mt(e){const t=[];return Ot(e).forEach((e=>{De(e)&&yt(e).forEach((e=>{if((0,T.pV)(e)){const n=We(e);n&&t.push(n)}}))})),t}function Pt(e){const t=[];return Ot(e).forEach((e=>{De(e)&&yt(e).forEach((e=>{if((0,T.pV)(e)){const n=We(e);n&&t.push({table:v.cZ,id:n})}if((0,T.IW)(e)){const n=Ge(e);n&&t.push({table:k.KJ,id:n})}}))})),t}function At(e){const{value:t,includeTemplateVariables:n}=e,o=[];return Ot(t).filter((e=>{De(e)&&yt(e).forEach((e=>{if(n&&(0,T.aq)(e)){const t=ht(e);t&&"me"===t.type&&o.push(t.type)}else if((0,T.pV)(e)){const t=We(e);t&&o.push({table:v.cZ,id:t})}else if((0,T.IW)(e)){const t=Ge(e);t&&o.push({table:k.KJ,id:t})}}))})),o}function Rt(e){const t=[],n=Ot(e);for(const o of n)if(De(o)){const e=he(yt(o));if(e){const n=pt(e);t.push(n)}}return t}function Dt(e){const t=[];for(const n of Ot(e)){const e=yt(n);if(!e)continue;const o=pe(e);if(!o)continue;const r=it(o);r&&t.push(r)}return t}function Bt(e){const t=[];for(const n of Ot(e)){const e=yt(n);if(!e)continue;const o=pe(e);if(!o)continue;const r=lt(o);r&&t.push(r)}return t}const Et=1,Ft=1;function Zt(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=[];return Ot(e).forEach(((e,o)=>{if(De(e))return;const r=Oe(e);yt(e).forEach(((e,i)=>{if(!(0,T.j0)(e))return;const a=qe(e);a&&n.push({name:r,url:a,path:t?[o,Et,i,Ft]:void 0})}))})),n}function Ut(e){return e.map(((t,n)=>{let o=t;if(0===n)if(Ae(o)){const[e]=o;o=[e.trimStart()]}else if(Re(o)){const[e,t]=o;o=[e.trimStart(),t]}if(n===e.length-1)if(Ae(o)){const[e]=o;o=[e.trimEnd()]}else if(Re(o)){const[e,t]=o;o=[e.trimEnd(),t]}return o}))}function Vt(e){return $t(Nt(Oe(e)),yt(e))}function Nt(e){return r.d1(d.p4(e),Yn).join("")}function Ot(e){return e&&Array.isArray(e)?e.filter(i.$K):[]}function Lt(e){return d.p4(jt(e))}function jt(e){return Ot(e).map((e=>Oe(e))).join("")}function Kt(e){return Ot(e).filter((e=>!De(e))).map((e=>Fe(e)?St(e):Oe(e))).join("")}function zt(e,t){return function(e,t){const{removeSuggestionAnnotationsAndText:n,removeSuggestionAnnotations:o,removeDiscussions:r}=t,i=[];let a=!1;e:for(const s of Ot(e)){const e=[];for(const t of yt(s))if(!r||!(0,T.xw)(t)){if((0,T.BI)(t)){if(a=!0,n){if((0,T.pG)(t))continue e;continue}if(o)continue}e.push(t)}i.push($t(Oe(s),e))}return{value:xn(i),containsSuggestions:a}}(e,t).value}function qt(e,t,n){const o=Ot(e);let r="";for(const i of o){const e=i[0],o=yt(i);e===z||Fe(i)||(r+=e);for(const i of o)if((0,T.fp)(i))r+=Ht(i);else if((0,T.j0)(i)){const e=qe(i),t=a.Qc(e);r+=` ${t.hostname||""}${t.pathname||""} `}else if((0,T.ku)(i))r+=ze(i);else if((0,T.IW)(i)){const e=Ge(i),o=t({table:k.KJ,id:e}),a=null==o?void 0:o.getName();a&&!n.user.has(e)&&n.user.set(e,a);r+=(0,m.Bn)("user",e)}}return{text:r,mentions:n}}function Ht(e){const t=pt(e);return c.ZV({value:t,date_format:t.date_format,time_format:t.time_format,allowRelativeDates:!1,intl:(0,p.$7)()})}function Gt(e,t,n){const o=Ot(e),r=[];let i=0,a=0;for(;i<o.length&&a<n;){const e=o[i];if(a>=t){const t=d.p4(Oe(e));if(!(a+t.length<=n)){const o=yt(e),i=n-a;r.push($t(t.slice(0,i).join(""),o));break}r.push(e),a+=t.length,i+=1}else{const o=d.p4(Oe(e));if(a+o.length>t){if(!(a+o.length<=n)){const i=yt(e),s=t-a,l=n-a;r.push($t(o.slice(s,l).join(""),i));break}{const n=yt(e),s=t-a;r.push($t(o.slice(s).join(""),n)),a+=o.length,i+=1}}else a+=o.length,i+=1}}return r}function Wt(e){return e?[$t(e)]:[]}function $t(e,t){return t&&t.length>0?[e,t]:[e]}function Yt(e,t){return t?["p",e,t]:["p",e]}function Qt(e){return["ce",e.id,e.spaceId]}function Jt(e,t){return["cm",e,t]}function Xt(e){return["u",e]}function en(e){return["r",e]}function tn(e){return["d",e]}function nn(e,t){return["g",e,t]}function on(e){return["eoi",e]}function rn(e){return["a",e]}function an(e){return["ci",e]}function sn(e,t){return t?["aic",e,t]:["aic",e]}function ln(e){return[T.Mc.LinkMention,e]}function cn(e,t){return e.map((e=>{const n=yt(e);return $t(Oe(e),[...n,rn((0,g.D)(t))])}))}function dn(e){return[T.Mc.Discussion,e]}function un(e,t){return $t(z,[e,...t||[]])}function pn(e){return[T.Mc.TemplateVariable,e]}function mn(e){return[T.Mc.TemporaryInput,e]}function gn(e){return[T.Mc.TemporaryNativeMABFilter,e]}function fn(){return[T.Mc.TemporaryEquation]}function hn(){return[T.Mc.TemporaryPage]}function vn(e,t){switch(e[0]){case"si":case"sr":return[e[0],t];case"sa":case"sua":return[e[0],t,e[2]];default:(0,i.t1)(e[0])}}function yn(e){return[T.Mc.FormulaPageProperty,e]}function bn(e){return[T.Mc.FormulaContextValue,e]}function _n(e,t){const n=function(e){return["e",e]}(e),o=t?[n,...t]:[n];return $t(q,o)}function Sn(e,t){const n=Ot(e);let o=0;for(const r of n){const e=o+Le(r);if(e>t)return{startIndex:o,endIndex:e,token:r};o=e}}function kn(e,t){const n=Sn(e,t);return n&&n.token}function wn(e){return xn(Ot(e).map((e=>{if(De(e))return e;return $t(Oe(e),yt(e).filter((e=>!(0,T.in)(e))))})))}function xn(e){if(!e)return[];const t=[];for(const n of Ot(e)){const e=l.u.normalize(yt(n));if(0===t.length||De((0,C.TO)(t.at(-1)))||!r.Xy(yt((0,C.TO)(t.at(-1))),e)){(Oe(n)||e.length)&&t.push($t(Oe(n),e))}else{(0,C.TO)(t.at(-1))[0]+=Oe(n)}}return e.length>0&&0===t.length?[[""]]:t}function In(e,t,n){const o=Ot(e),r=[],i=[],a=[];let s=0;for(const l of o){const e=Oe(l),o=yt(l),c=d.p4(e),u=s,p=s+c.length;if(p<=t)r.push(l);else if(u>=n)i.push(l);else if(u>=t&&p<=n)a.push(l);else if(u<=t&&p>=n){const e=t-u,s=e+n-t,l=c.slice(0,e),d=c.slice(e,s),p=c.slice(s);l.length>0&&r.push($t(l.join(""),o)),p.length>0&&i.push($t(p.join(""),o)),d.length>0&&a.push($t(d.join(""),o))}else if(u>=t&&u<n){const e=n-u,t=c.slice(0,e),r=c.slice(e);r.length>0&&i.push($t(r.join(""),o)),t.length>0&&a.push($t(t.join(""),o))}else if(u<t&&p>t){const e=t-u,n=c.slice(0,e),i=c.slice(e);n.length>0&&r.push($t(n.join(""),o)),i.length>0&&a.push($t(i.join(""),o))}s=p}return{tokensBeforeRange:xn(r),tokensInsideRange:xn(a),tokensAfterRange:xn(i)}}function Cn(e){const{textValue:t,selection:n,annotation:o}=e,r=io(t,n);if(r.startIndex===r.endIndex)return t??[];const{tokensBeforeRange:i,tokensInsideRange:a,tokensAfterRange:s}=In(t,r.startIndex,r.endIndex);return[...i,...a.map((e=>{const t=Oe(e),n=l.u.fromArray(yt(e));return n.add(o),$t(t,n.toArray())})),...s]}function Tn(e){const{textValue:t,selection:n,annotationKey:o}=e,r=io(t,n);if(r.startIndex===r.endIndex)return t??[];const{tokensBeforeRange:i,tokensInsideRange:a,tokensAfterRange:s}=In(t,r.startIndex,r.endIndex);return[...i,...a.map((e=>{const t=Oe(e),n=l.u.fromArray(yt(e));return"string"==typeof o?n.removeGroupingKey(o):n.remove(o),$t(t,n.toArray())})),...s]}function Mn(e){const{prevSpan:t,currSpan:n}=e;return t.endIndex===n.startIndex&&!(0,T.ZA)(n.annotation)&&!(0,T.ku)(n.annotation)&&r.Xy(t.annotation,n.annotation)}function Pn(e){const t=new f.Z;for(const{annotations:n,startIndex:o,endIndex:r}of Rn(e))for(const i of n.findByGroupingKey(e.groupingKey)){const e=t.get(i)??[],n=e.at(-1),a={annotation:i,startIndex:o,endIndex:r};n&&Mn({prevSpan:n,currSpan:a})?n.endIndex=r:e.push(a),t.set(i,e)}return[...t.values()].flat()}function An(e){const t=new o.G((()=>[]));let n=new R;const r=[];for(const{annotations:o,startIndex:a,endIndex:s}of Rn(e)){for(const n of o.getUniqueAnnotations()){const e=(0,T.J7)(n),o=t.get(e),r=o.at(-1);r&&Mn({prevSpan:r,currSpan:{annotation:n,startIndex:a,endIndex:s}})?r.endIndex=s:o.push({annotation:n,startIndex:a,endIndex:s}),t.set(e,o)}const e=[...o.getMultiInstanceAnnotations().values()];try{n.addOrderedAnnotationsInRange({annotationLists:e,startIndex:a,endIndex:s})}catch(i){r.push(...n.getSortedAnnotationRanges()),n=new R,n.addOrderedAnnotationsInRange({annotationLists:e,startIndex:a,endIndex:s})}}return r.push(...n.getSortedAnnotationRanges()),[...[...t.values()].flat(),...r]}function*Rn(e){const{textValue:t,startIndex:n,endIndex:o}=e;if((0,C.T)(n<=o),n===o)return;let r=0;for(const i of Ot(t)){const e=Le(i),t=r+e;if(t<=n)r+=e;else{if(o<=r)break;yield{startIndex:Math.max(r,n),endIndex:Math.min(t,o),annotations:l.u.fromArray(yt(i))},r+=e}}}function Dn(e,t,n,o){const r=Ot(e);let i=0,a=0;for(;i<n&&a<r.length;){const e=r[a],n=Oe(e),s=d.p4(n),l=yt(e);if(i+s.length>=t){const e=l.findIndex((e=>(0,T.J7)(e)===o));if(-1!==e){return{annotationStartIndex:i+e,annotationEndIndex:i+e+s.length}}}a++,i+=s.length}}function Bn(e,t,n,o){return void 0!==Dn(e,t,n,o)}function En(e,t,n,o){const r=Dn(e,t,n,o);if(!r)return!1;const{annotationStartIndex:i,annotationEndIndex:a}=r;return i===t||a===n}function Fn(e,t,n){const o=Ot(e),r=[];let i=0;for(const a of o){const e=Oe(a),o=yt(a),s=d.p4(e),l=i,c=i+s.length;if(c<=t&&c<=n||l>=t&&l>=n)r.push(a);else if(l>=t&&c<=n);else{const e=t-l,i=e+(n-t),a=s.filter(((t,n)=>!(n>=e&&n<=i-1)));r.push($t(a.join(""),o))}i=c}return r}function Zn(e,t,n){const o=Ot(e);if(o.length>0){const e=[];let r=0,i=!1;for(const a of o){const o=Oe(a),s=yt(a),l=d.p4(o),c=r,u=r+l.length;if(n>=c&&n<=u&&!i){const o=n-c,r=Jn(l,0,o),a=Jn(l,o);r.length>0&&e.push($t(r.join(""),s));for(const n of t)e.push(n);a.length>0&&e.push($t(a.join(""),s)),i=!0}else e.push(a);r=u}return e}return t}function Un(e){const{ignoreCase:t,substring:n,textValue:o}=e,i=jt(o),a=t?"gi":"g",s=new RegExp(r.hr(n),a),l=[];let c;for(;c=s.exec(i);)l.push({startIndex:c.index,endIndex:c.index+n.length});return l}function Vn(e){const t=[];let n=0,o=0;return Ot(e).forEach((e=>{o=n+Le(e);De(e)?(yt(e).forEach((e=>{const r={startIndex:n,endIndex:o};if((0,T.pV)(e)){const n=We(e);n&&t.push({pointer:{table:v.cZ,id:n},selection:r})}else if((0,T.IW)(e)){const n=Ge(e);n&&t.push({pointer:{table:k.KJ,id:n},selection:r})}})),n=o):n=o})),t}function Nn(e){const t=[];let n=0,o=0;return Ot(e).forEach((e=>{o=n+Le(e),Be(e)&&yt(e).forEach((e=>{if((0,T.ST)(e)){const r=it(e);r&&t.push({pointer:r,selection:{startIndex:n,endIndex:o}})}})),n=o})),t}function On(e){const t=[];let n=0,o=0;return Ot(e).forEach((e=>{o=n+Le(e),function(e){if(2===e.length&&e[0]===z){const[,t]=e;return Boolean(t.find(T.vu))}return!1}(e)&&yt(e).forEach((e=>{if((0,T.vu)(e)){const r=mt(e);t.push({metadata:{title:r.title,link_provider:r.link_provider,link_author:r.link_author},selection:{startIndex:n,endIndex:o}})}})),n=o})),t}function Ln(e){const{textValue:t,find:n,intl:o}=e,r=[];let i=0,a=0;return Ot(t).forEach((e=>{a=i+Le(e),function(e){if(2===e.length&&e[0]===z){const[,t]=e;return Boolean(t.find(T.fp))}return!1}(e)&&yt(e).forEach((e=>{if((0,T.fp)(e)){const t=pt(e);c.ZV({value:t,date_format:t.date_format,time_format:t.time_format,allowRelativeDates:!0,intl:o}).toLowerCase().includes(n.toLowerCase())&&r.push({startIndex:i,endIndex:a})}})),i=a})),r}function jn(e,t){return r.MR(e,(e=>Math.abs(t-e.startIndex)+Math.abs(t-e.endIndex)))[0]}function Kn(e){return e&&s.uh(e,De).map((e=>{if(Ae(e))return e;return[Fe(e)?St(e):Oe(e),yt(e).filter(zn)]}))}function zn(e){return!((0,T.fT)(e)||(0,T.ZA)(e)||(0,T.ku)(e)||(0,T.QV)(e)||(0,T.Jm)(e))}function qn(e){if(1!==e.length)return;const t=e.charCodeAt(0);return t>=55296&&t<=56319?"high":t>=56320&&t<=57343?"low":void 0}function Hn(e){return e.toString(16)}const Gn=[`\\u{${Hn(0)}}-\\u{${Hn(8)}}`,`\\u{${Hn(11)}}-\\u{${Hn(31)}}`,"\\u{2028}","\\u{2029}","\\u{200b}"],Wn=new RegExp(`[${Gn.join("")}]`,"u");function $n(e){return Wn.test(e)}function Yn(e){return function(e){return Wn.test(e[0])}(e)||Boolean(qn(e))}function Qn(e){let t=!1;for(let n=0;n<e.length;n++){const o=qn(e[n]);if("low"===o){if(t){t=!1;continue}return!0}"high"===o&&(t=!0)}return t}function Jn(e,t,n){return e.slice(Math.max(t,0),n)}function Xn(e,t){return r.sv([...e,...t],r.Xy)}function eo(e){if(e.startsWith("data:")||e.length>K)return;const t=u.s(e).filter((t=>{let{value:n,href:o}=t;return e===n}))[0];if(t){try{const e=new URL(t.href);if([".zip"].some((t=>e.hostname.endsWith(t))))return}catch{return}return t}}function to(e,t){return e.map((e=>$t(Oe(e),yt(e).filter(t))))}function no(e,t){const n=[];let o=0;for(const r of e){const e=d.p4(Oe(r)).slice(0,t-o),i=$t(e.join(""),yt(r));if(n.push(i),o+=e.length,o>=t)return n}return n}function oo(e){let t=0;for(const n of e)t+=d.p4(Oe(n)).length;return t}function ro(e,t,n){const o=Sn(e,t);if(!o)return;if(!n(o.token,void 0))return;const{tokensBeforeRange:r,tokensAfterRange:i}=In(e,o.startIndex,o.endIndex);let a=0;for(let l=r.length-1;l>-1;l--){const e=r[l];if(!n(e,r[l+1]||o.token))break;a+=Le(e)}let s=0;for(let l=0;l<i.length;l++){const e=i[l];if(!n(e,i[l-1]||o.token))break;s+=Le(e)}return{startIndex:o.startIndex-a,endIndex:o.endIndex+s}}function io(e,t){const n=Lt(e).length,o=Math.min(Math.max(t.startIndex,0),n),r=Math.min(Math.max(t.endIndex,0),n);return o===t.startIndex&&r===t.endIndex?t:{startIndex:o,endIndex:r}}function ao(e,t,n){return so(xn(void 0===e||0===e.length?[[""]]:e),xn(void 0===t||0===t.length?[[""]]:t),n)}function so(e,t,n){if(void 0===e&&void 0===t)return!0;if(void 0===e)return!1;if(void 0===t)return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++){if(!lo(e[o],t[o],n))return!1}return!0}function lo(e,t,n){const[o,i]=e,[a,s]=t;if(o!==a)return!1;if(void 0===i&&void 0===s)return!0;if(void 0===i||void 0===s)return!1;if(i.length!==s.length)return!1;for(let l=0;l<i.length;l++){const e=i[l],t=s[l];if(null!=n&&n.ignoreSpaceInPageAnnotations&&"p"===e[0]){if("p"!==t[0])return!1;if(e[1]!==t[1]||2!==e.length&&3!==e.length||2!==t.length&&3!==t.length)return!1}else if(!r.Xy(e,t))return!1}return!0}function co(e,t){const n=zt(e||[],{removeSuggestionAnnotationsAndText:!0,removeSuggestionAnnotations:!0,removeDiscussions:!0}),o=zt(t||[],{removeSuggestionAnnotationsAndText:!0,removeSuggestionAnnotations:!0,removeDiscussions:!0});return!r.Xy(n,o)}},785370:(e,t,n)=>{n.d(t,{w:()=>_});var o=n(401898),r=(n(757658),n(653965)),i=n(799757),a=n(942828),s=n(250680),l=n(421202),c=n(421838),d=n(926109);function u(e){const{getRecordModel:t,setNewValue:n,textInstanceBlocksMap:o,textOperation:u,logger:p,env:m}=e;function g(e){const o=r.Xh((0,s.TO)(t.getRecordValue(e)));o.version+=2,n({pointer:e,newValue:o})}const f=(0,s.TO)((0,d.JB)({getRecordModel:t,textInstanceBlocksMap:o,textInstanceId:u.args.textInstanceId,textSliceStartItemId:u.args.textSliceStartItemId,env:m})),h=r.Xh(f),v=(0,d.Ps)(h),y=(0,s.TO)(v.findTextSliceTreeContainingItemWithId(u.args.textInstanceId,u.args.textSliceStartItemId));(0,s.T)(y!==v,"Text slice tree node to move should not be root node of block.");const b=v.getTextValue(),_=(0,s.TO)(h.format),S=Object.keys((0,s.TO)(_.text_clocks)),k=(0,s.TO)((0,d.Qo)({getRecordModel:t,textInstanceBlocksMap:o,textInstanceId:u.args.targetTextInstanceId,textSliceEndItemId:u.args.targetTextSliceEndItemId,env:m}),"Target block expected to exist."+("development"===m?` Context: ${(0,i.P)({textOperation:u,textInstanceBlocksMap:o})}`:"")),w=k.id===f.id,x=w?h:r.Xh(k),I=w?v:(0,d.Ps)(x),C=(0,s.TO)(I.findTextSliceTreeContainingItemWithId(u.args.targetTextInstanceId,u.args.targetTextSliceEndItemId,{type:"end"}));if((0,s.T)(y!==C,"Source text slice tree node should not be the same as the target node."),p){const e=(0,s.TO)(o.get(u.args.textInstanceId)).length;if(p.logReadFanOut(e),!w){const e=(0,s.TO)(o.get(u.args.targetTextInstanceId)).length;p.logReadFanOut(e)}}const T=w?b:I.getTextValue(),M=(0,s.TO)(x.format),P=Object.keys((0,s.TO)(M.text_clocks)),A=u.pointer,R={table:l.iU,id:u.args.targetBlockId,spaceId:u.pointer.spaceId};y.detachFromParent();try{C.appendChild(y)}catch(Z){return g(A),void(R.id!==A.id&&R.id!==x.id&&g(R))}if(u.args.isMerge){const e=v.getTextValue();null==p||p.logRemainingTextAfterMerge(c.VrM(e))}(0,d.o_)({blockValue:h,textSliceTree:v,originalTextValue:b});const D=Object.keys(a.Z.serializeClocks(v)),B=r.e5(S,D);for(const i of B){const e=o.get(i);e?r.Od(e,(e=>e.id===h.id)):(0,s.T)(i!==u.args.textInstanceId&&i!==u.args.targetTextInstanceId)}const E={table:l.iU,id:h.id,spaceId:h.space_id};n({pointer:E,newValue:h});const F=x!==h?{table:l.iU,id:x.id,spaceId:x.space_id}:E;if(x!==h){(0,d.o_)({blockValue:x,textSliceTree:I,originalTextValue:T});const e=Object.keys(a.Z.serializeClocks(I)),t=r.e5(e,P);for(const n of t){const e=o.get(n)??[];e.push(F),o.set(n,e)}n({pointer:F,newValue:x})}return A.id!==h.id&&(g(A),null==p||p.logTextOperationAppliedToDifferentBlockThanOperationPointer()),R.id!==A.id&&R.id!==x.id&&(g(R),null==p||p.logTextOperationAppliedToDifferentBlockThanOperationPointer()),{sourceBlockPointer:E,targetBlockPointer:F}}var p=n(769920);function m(e){const{getRecordModel:t,textInstanceBlocksMap:n,crdtOperation:o,env:i}=e,a=o.textInstanceId,l=(0,d.b0)({getRecordModel:t,textInstanceBlocksMap:n,textInstanceId:a,env:i}).map(r.Xh),c=[],u=new Map,m=new Map;for(const{textSlice:r,blockValue:s}of(0,d.ru)(l,a)){c.push(r);const e=r.getSliceStartKey(),t=r.getSliceKey();u.set(e,t),m.set(e,s)}(0,s.T)(c.length>0);const g=p.ZP.combineSlices(c);g.applyOperation(o);const f=g.splitIntoSlices(),h=g.opClock.getValue(),{blockWithSplitSlice:v,splitTextSlice:y,newTextSlice:b}=function(e,t,n){let o,r,i;for(const a of e){if(r&&i)break;const e=a.getSliceStartKey(),l=n.get(e);if(!l){(0,s.m7)(i),i=a;continue}a.getSliceKey()===(0,s.TO)(t.get(e))||((0,s.m7)(r),(0,s.m7)(o),r=a,o=l)}return{blockWithSplitSlice:(0,s.TO)(o),splitTextSlice:(0,s.TO)(r),newTextSlice:(0,s.TO)(i)}}(f,u,m);return{sourceBlockValue:v,splitTextSlice:y,newTextSlice:b,updatedClockValue:h,sourceBlockFormat:(0,s.TO)(v.format),blockValues:l,textInstanceId:a}}function g(e){const{getRecordModel:t,setNewValue:n,textInstanceBlocksMap:o,textOperation:i,logger:a,env:c}=e,d=u({getRecordModel:t,setNewValue:n,textInstanceBlocksMap:o,textOperation:{command:"moveTextSlice",pointer:i.pointer,path:[],args:{...i.args,targetTextInstanceId:i.args.targetBlockId,targetTextSliceEndItemId:"end"}},logger:a,env:c});if(!d)return;const{sourceBlockPointer:p,targetBlockPointer:m}=d;!function(e){var t;const{getRecordModel:n,setNewValue:o,sourceBlockPointer:i,targetBlockPointer:a}=e,c=(0,s.TO)(n.getRecordValue(i)),d=(0,s.TO)(n.getRecordValue(a));if(c.parent_table!==l.iU||d.parent_table!==l.iU)return;if(c.id===d.id)return;if(d.parent_id===c.id&&d.id===(null===(t=c.content)||void 0===t?void 0:t[0]))return;const u={table:l.iU,id:c.parent_id,spaceId:c.space_id},p=(0,s.TO)(n.getRecordValue(u)),m={table:l.iU,id:d.parent_id,spaceId:d.space_id},g=m.id===u.id?p:(0,s.TO)(n.getRecordValue(m));let f=(0,s.TO)(p.content).indexOf(c.id);const h=(0,s.TO)(g.content).indexOf(d.id);if((0,s.T)(f>=0,"Expected source block to be in its parent's content array"),(0,s.T)(h>=0,"Expected target block to be in its parent's content array"),d.parent_id===c.parent_id&&h===f+1)return;const v=r.Xh(p),y=m.id===u.id?v:r.Xh(g);if((0,s.TO)(y.content).splice(h,1),f=(0,s.TO)(v.content).indexOf(c.id),(0,s.T)(f>=0),(0,s.TO)(v.content).splice(f+1,0,d.id),v.version+=1,o({pointer:u,newValue:v}),y!==v){const e=r.Xh(d);e.parent_id=v.id,e.version+=1,o({pointer:a,newValue:e}),y.version+=1,o({pointer:m,newValue:y})}}({getRecordModel:t,setNewValue:n,sourceBlockPointer:p,targetBlockPointer:m})}var f=n(346227),h=n(159730),v=n(167175);function y(e){const{getRecordModel:t,setNewValue:n,textInstanceBlocksMap:o,textOperation:i,logger:c,env:u}=e,p=i.pointer;let g;try{g=m({getRecordModel:t,textInstanceBlocksMap:o,crdtOperation:v.Sv(i),env:u})}catch(k){if(k instanceof h.dO)return;throw k}const{sourceBlockValue:y,splitTextSlice:b,newTextSlice:_}=g;y.version++;n({pointer:{table:l.iU,id:y.id,spaceId:y.space_id},newValue:y});const S=function(e,t,n){const o=t.textInstanceId,r=(0,d.Ps)(e),i=(0,s.TO)(r.findTextSliceTreeContainingItemWithId(o,t.getStartItem().id));i.replaceTextSlice(t);const a=new f.ZP((0,f._5)(),n);return[...i.children].forEach((e=>{e.detachFromParent(),a.appendChild(e)})),i.appendChild(a),r}(y,b,_);if(function(e,t){const n=(0,s.TO)(e.format);n.text_slice_tree=a.Z.serialize(t),n.text_clocks=a.Z.serializeClocks(t),e.properties??={},e.properties.title=t.getTextValue()}(y,S),c){const e=(0,s.TO)(o.get(i.args.textInstanceId)).length;c.logReadFanOut(e)}if(p.id!==y.id){const e=r.Xh((0,s.TO)(t.getRecordValue(p)));e.version+=2,n({pointer:p,newValue:e}),null==c||c.logTextOperationAppliedToDifferentBlockThanOperationPointer()}}var b=n(990542);function _(e){const{getRecordModel:t,setNewValue:n,textInstanceBlocksMap:i,operation:a,logger:c,env:m}=e;switch(a.command){case"insertText":case"deleteText":case"addAnnotation":case"removeAnnotation":return void function(e){const{getRecordModel:t,setNewValue:n,textInstanceBlocksMap:o,textOperation:i,logger:a,env:c}=e,u=i.pointer,m=v.Sv(i),g=m.textInstanceId,f=(0,d.b0)({getRecordModel:t,textInstanceBlocksMap:o,textInstanceId:g,env:c});(0,s.T)(f.every((e=>{let{space_id:t}=e;return t===f[0].space_id})),"Blocks containing slices of the same text instance should be in the same space.");const y=[],_=new Map;for(const{textSlice:r,blockValue:s}of(0,d.ru)(f,g))y.push(r),_.set(r.getSliceKey(),s);(0,s.T)(y.length>0);const S=p.ZP.combineSlices(y);try{S.applyOperation(m)}catch(C){if(C instanceof h.dO||C instanceof h.$C)return;throw C}const k=S.splitIntoSlices(),w=new Map;for(const l of k){var x;const e=l.getSliceKey(),t=(0,s.TO)(_.get(e)),n=t.id,o=w.get(n)??r.Xh(t),i=(0,s.TO)(o.format);(0,s.TO)(null===(x=i.text_slice_tree)||void 0===x?void 0:x.nodes[e]).textSlice=b.Z.serialize(l),w.set(n,o)}const I=new Set;for(const[r,p]of w){const e={table:l.iU,id:r,spaceId:p.space_id},o=(0,s.TO)(t.getRecordValue(e)),i=(0,d.Ps)(o),a=(0,d.Ps)(p);a.equals(i)||(I.add(r),(0,d.o_)({blockValue:p,textSliceTree:a,originalTextValue:i.getTextValue()}),n({pointer:e,newValue:p}))}if(null==a||a.logReadFanOut(w.size),null==a||a.logWriteFanOut(I.size),(0,s.T)("deleteText"===m.type||I.size>0,`At least one block should have been modified by ${m.type} operation`),I.size>1||1===I.size&&[...I][0]!==u.id){const e=r.Xh((0,s.TO)(t.getRecordValue(u)));e.version+=2,n({pointer:u,newValue:e}),null==a||a.logTextOperationAppliedToDifferentBlockThanOperationPointer()}}({getRecordModel:t,setNewValue:n,textInstanceBlocksMap:i,textOperation:a,logger:c,env:m});case"splitText":return void y({getRecordModel:t,setNewValue:n,textInstanceBlocksMap:i,textOperation:a,logger:c,env:m});case"moveTextSlice":return void u({getRecordModel:t,setNewValue:n,textInstanceBlocksMap:i,textOperation:a,logger:c,env:m});case"moveTextSliceIntoBlock":return void g({getRecordModel:t,setNewValue:n,textInstanceBlocksMap:i,textOperation:a,logger:c,env:m});case"replaceTextInBlock":return void function(e){const{getRecordModel:t,setNewValue:n,textOperation:o}=e,i=(0,s.TO)(t.getRecordValue(o.pointer)),a=r.Xh(i),l=(0,d.Ps)(a),c=l.getTextValue(),u=l.getVisibleCount();u>0&&l.deleteText(0,u-1),l.insertTextValue(0,o.args.textValue),(0,d.o_)({blockValue:a,textSliceTree:l,originalTextValue:c}),n({pointer:o.pointer,newValue:a})}({getRecordModel:t,setNewValue:n,textOperation:a});default:(0,o.t1)(a)}}},926109:(e,t,n)=>{n.d(t,{JB:()=>y,Ps:()=>h,Qo:()=>b,b0:()=>g,o_:()=>v,ru:()=>f});var o=n(653965),r=n(799757),i=n(401898),a=n(990542),s=n(942828),l=n(719056),c=n(346227),d=n(250680),u=n(959753),p=n(456452),m=n(421838);function g(e){const{getRecordModel:t,textInstanceBlocksMap:n,textInstanceId:o,env:r}=e;return(0,d.TO)(n.get(o),"textInstanceBlocksMap is missing an entry!",["development","local"].includes(r)?{textInstanceId:o,textInstanceBlocksMap:n}:void 0).map((e=>(0,d.TO)(t.getRecordValue(e),"Block pointer points to nonexistent record!",["development","local"].includes(r)?{blockPointer:e,textInstanceId:o,textInstanceBlocksMap:n}:void 0)))}function*f(e,t){let n;for(const o of e){const e=(0,d.TO)(o.format);(0,d.T)(e.use_crdt);const r=(0,d.TO)(e.text_slice_tree);n??=new l.h;for(const[i,s]of Object.entries(r.nodes))if(i.startsWith(t)){const e=a.Z.deserialize(s.textSlice,n);yield{textSlice:e,blockValue:o}}}}function h(e){const t=(0,d.TO)(e.format);(0,d.T)(t.use_crdt);const n=(0,d.TO)(t.text_slice_tree);return s.Z.deserialize(n,void 0,(0,c._5)())}function v(e){const{blockValue:t,textSliceTree:n,originalTextValue:r}=e,i=n.getTextValue();!function(e){const{blockValue:t,textSliceTree:n}=e,o=(0,d.TO)(t.format);(0,d.T)(o.use_crdt),o.text_slice_tree=s.Z.serialize(n),o.text_clocks=s.Z.serializeClocks(n),t.properties??={},t.properties.title=n.getTextValue(),t.version++}({blockValue:t,textSliceTree:n}),t.discussions=function(e){const{existingDiscussions:t,oldTextValue:n,newTextValue:r,newBlockValue:i}=e,a=o.e5(m.llS(n),m.llS(r)).filter((e=>!(0,p.xT)({blockModel:u.kk5.fromBlock(i),discussionId:e})));return a.length>0?o.zu(t??[],...a):t}({existingDiscussions:t.discussions,oldTextValue:r,newTextValue:i,newBlockValue:t}),t.discussions=function(e){const{existingDiscussions:t,oldTextValue:n,newTextValue:r}=e,i=o.e5(m.llS(r),m.llS(n));return i.length>0?o.G0(t??[],i):t}({existingDiscussions:t.discussions,oldTextValue:r,newTextValue:i})}function y(e){return _({...e,itemId:e.textSliceStartItemId,boundary:"start"})}function b(e){return _({...e,itemId:e.textSliceEndItemId,boundary:"end"})}function _(e){const{getRecordModel:t,textInstanceBlocksMap:n,textInstanceId:o,itemId:a,boundary:s,env:l}=e;let c;"start"===s?c=e=>e.startsWith(`${o},${(0,r.P)(a)}`):"end"===s?c=e=>e.startsWith(o)&&e.endsWith((0,r.P)(a)):(0,i.t1)(s);const u=g({getRecordModel:t,textInstanceBlocksMap:n,textInstanceId:o,env:l});for(const r of u){const e=(0,d.TO)(r.format);(0,d.T)(e.use_crdt);const t=(0,d.TO)(e.text_slice_tree);if(Object.keys(t.nodes).some(c))return r}}},579317:(e,t,n)=>{n.d(t,{x:()=>l});var o=n(959753),r=n(433422),i=n(145953),a=n(421202),s=n(785370);function l(e,t){const n=i.Ak.create(),{recordOperations:l,textOperations:c}=(0,r.EX)(e);(0,r.FS)({recordMap:n,operations:l,updateOnly:!1});const d=o.omK.fromRecordMap(n),u=e=>n.setValue(e.pointer,e.newValue),p=new Map(e.filter((e=>"set"===e.command&&e.pointer.table===a.iU&&(e.pointer,!0))).map((e=>[e.pointer.id,[e.pointer]])));for(const o of c)(0,s.w)({getRecordModel:d,setNewValue:u,textInstanceBlocksMap:p,operation:o,env:t});return n}},167175:(e,t,n)=>{n.d(t,{Qf:()=>i,Sv:()=>s,W5:()=>a});var o=n(401898);n(421838);const r={insertText:!0,deleteText:!0,splitText:!0,moveTextSliceIntoBlock:!0,moveTextSlice:!0,addAnnotation:!0,removeAnnotation:!0,replaceTextInBlock:!0};function i(e){return Boolean(r[e.command])}function a(e){const{pointer:t,crdtOperation:n,fullTextValue:r}=e,i=n.type;switch(i){case"insertText":return{command:"insertText",pointer:t,path:[],args:{...n,forDowngrade:{fullTextValue:r}}};case"deleteText":return{command:"deleteText",pointer:t,path:[],args:{...n,forDowngrade:{fullTextValue:r}}};case"addAnnotation":return{command:"addAnnotation",pointer:t,path:[],args:{...n,forDowngrade:{fullTextValue:r}}};case"removeAnnotation":return{command:"removeAnnotation",pointer:t,path:[],args:{...n,forDowngrade:{fullTextValue:r}}};case"splitText":return{command:"splitText",pointer:t,path:[],args:{...n}};default:(0,o.t1)(i)}}function s(e){const t=e.command;switch(t){case"insertText":return{...e.args,type:"insertText"};case"deleteText":return{...e.args,type:"deleteText"};case"addAnnotation":return{...e.args,type:"addAnnotation"};case"removeAnnotation":return{...e.args,type:"removeAnnotation"};case"splitText":return{...e.args,type:"splitText"};default:(0,o.t1)(t)}}},744805:(e,t,n)=>{n.d(t,{$i:()=>je,CY:()=>at,DK:()=>pe.DK,Eu:()=>pe.Eu,FB:()=>pe.FB,H4:()=>lt,IY:()=>Ke,JQ:()=>pe.JQ,Kx:()=>pe.Kx,Mw:()=>Oe,Nz:()=>pe.Nz,Re:()=>it,St:()=>rt,U3:()=>pe.U3,Wi:()=>qe,Y:()=>Re,dD:()=>ze,et:()=>pe.et,fn:()=>Ue,hW:()=>st,iR:()=>Je,kB:()=>pe.kB,l0:()=>nt,mJ:()=>pe.mJ,mb:()=>pe.mb,ni:()=>ct,qp:()=>pe.qp,sM:()=>Pe,sZ:()=>Me,tL:()=>pe.tL,tp:()=>et,tr:()=>Qe,vz:()=>Ne,zd:()=>pe.zd});n(757658);var o=n(294184),r=n.n(o),i=n(667294),a=n(997466),s=n(531701),l=n(653965),c=n(401898),d=n(137810),u=n(218265),p=n(815145),m=n(53196),g=n(217215),f=n(541432),h=n(715070),v=n(606906),y=n(180951),b=n(667946),_=n(122377),S=n(702749),k=n(598923),w=n(984619),x=n(950655),I=n(158102),C=n(401800),T=n(222491),M=n(407057),P=n(253877),A=n(542129),R=n(415095),D=n(478601),B=n(402864),E=n(643593),F=n(517755),Z=n(173110),U=n(335102),V=n(136700),N=n(629651),O=n(959194),L=n(561061),j=n(269578),K=n(184869),z=n(727714),q=n(460651),H=n(954851),G=n(554855),W=n(439567),$=n(526056),Y=n(170782),Q=n(265317),J=n(937612),X=n(449143),ee=n(959753),te=n(463306),ne=n(606746),oe=n(882883),re=n(421202),ie=n(177420),ae=n(933709),se=n(591937),le=n(519889),ce=n(654584),de=n(456452),ue=n(421838),pe=n(116275),me=n(463332),ge=n(544876),fe=n(307928),he=n(785893);const ve="0.05em solid",ye={fontWeight:d.Z.fontWeight.semibold},be={fontStyle:"italic"},_e={fontFamily:d.Z.baseFontFamily.githubMono,lineHeight:"normal",background:(0,a.Fq)(s.se.light.gray,.15),color:s.ZP.red,borderRadius:4,fontSize:"85%",padding:"0.2em 0.4em"},Se={borderRadius:0,paddingBottom:2.5},ke={textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:"red"},we={cursor:"pointer",color:s.ZP.inherit,wordWrap:"break-word"},xe={textDecoration:"line-through"},Ie={color:s.ZP.inherit,borderBottom:ve,wordWrap:"break-word"},Ce={color:s.ZP.diffTextColor,backgroundColor:s.ZP.diffBackground},Te={opacity:.4,marginBottom:6,textDecoration:"line-through"};function Me(e){return{background:(0,s._o)({annotationType:"update",type:"background",selected:!1,hovered:!1,overlapping:!1,mode:e.mode}),borderBottom:`2px solid ${(0,s._o)({annotationType:"update",type:"underline",selected:!1,hovered:!1,overlapping:!1,mode:e.mode})}`,paddingBottom:2,color:e.accentColors.uiBlue[700],transition:"background 0.2s ease, border 0.2s ease, color 0.2s ease, text-decoration 0.2s ease"}}function Pe(e){return{background:(0,s._o)({annotationType:"remove",type:"background",selected:!1,hovered:!1,overlapping:!1,mode:e.mode}),borderBottom:`2px solid ${(0,s._o)({annotationType:"remove",type:"underline",selected:!1,hovered:!1,overlapping:!1,mode:e.mode})}`,paddingBottom:2,textDecoration:"line-through",textDecorationThickness:"1px",color:e.text.quaternary,transition:"background 0.2s ease, border 0.2s ease, color 0.2s ease, text-decoration 0.2s ease"}}function Ae(e){return{paddingBottom:2,textDecoration:"line-through",textDecorationThickness:"1px",color:e.text.quaternary,transition:"all 0.2s ease"}}function Re(e){return{background:(0,s.Hu)({level:0,selected:!1,hovered:!1,mode:e.mode}),borderBottom:`2px solid ${(0,s.hI)({level:0,selected:!1,hovered:!1,mode:e.mode})}`,paddingBottom:2,transition:"background 0.2s ease, border 0.2s ease"}}const De={borderRadius:1,background:s.ZP.selectionColor,boxShadow:`0 0 0 3px ${s.ZP.selectionColor}`},Be={position:"absolute",width:"1.5px",borderRadius:1,height:"1.3em",background:`${s.ZP.frontPurpleBorder}`},Ee=l.HP((function(e){return{b:ye,i:be,c:_e,s:xe,_:Ie,"+":Ce,"-":Te,z:Re(e),st:De,tc:Be,si:Me(e),sr:Pe(e),sa:Me(e),sua:Me(e)}})),Fe=["mark","h","si","sr","m","z","b","i","c","s","_","a","u","p","d","+","-","fpp","fv","ci"];function Ze(e,t){return l.BK(e,t,((e,t,n)=>{if("textDecoration"===n&&void 0!==e)return`${e} ${t}`}))}function Ue(e){let{annotations:t,theme:n,getRecordModel:o,spaceId:r,prevAnnotations:i,nextAnnotations:a,dictationId:d}=e;const u={};let p;const m=[],g=Ee(n),f=[],h=[];let v=!1,y=!1;for(const s of t)if(ue.xw5(s)){const e=ue.h19(s);Ve({annotation:s,spaceId:r,getRecordModel:o})&&f.push(e),Ne({annotation:s,spaceId:r,getRecordModel:o})&&h.push(e)}else ue.aC4(s)?v=!0:ue.FAE(s)&&(y=!0);const b=v?f.length+1:f.length,_=b-h.length;v&&m.push(pe.Kx),y&&m.push(pe.mJ),t.forEach((e=>{if(ue.BIG(e)){let t;ue.pGj(e)||ue.u2m(e)||ue.Jeu(e)?t="update":ue.$b8(e)?t="remove":(0,c.t1)(e);const n=ue.fgJ(e);m.push((0,T.dk)({discussionId:n})),m.push((0,T.Ws)({type:t}))}if(ue.otC(e)){e[2]===d&&m.push(pe.j)}}));const S=t.filter((e=>{const t=ue.J7s(e);return t!==ue.GKr.Discussion&&t!==ue.GKr.TemporaryComment}));b>0&&S.push([ue.GKr.TemporaryComment]);const k=S.sort(((e,t)=>Fe.indexOf(ue.J7s(t))-Fe.indexOf(ue.J7s(e))));h.forEach((e=>{m.push((0,T.dk)({discussionId:e}))}));for(const c of k){const e=ue.J7s(c);if(e===ue.GKr.TemporaryComment){if(_>0){const e=S.find((e=>ue.J7s(e)===ue.GKr.Code));u.borderBottom===ve&&(p||(p={}),p.borderBottom=u.borderBottom),Ze(u,{background:(0,s.Hu)({level:_,selected:!1,hovered:!1,mode:n.mode}),borderBottom:`2px solid ${(0,s.hI)({level:_,selected:!1,hovered:!1,mode:n.mode})}`,paddingBottom:2,transition:"background 0.2s ease, border 0.2s ease"}),e&&Ze(u,Se),m.push((0,T.vE)({level:_})),f.forEach((e=>{m.push((0,T.dk)({discussionId:e}))}))}}else if(ue.LAI(c)){const e=ue.zIN(c);Ze(u,(0,s.A_)(e,n))}else if(ue.wWS(c)){const e=ue.sbu(c);Ze(u,(0,s.wo)(e,n))}else if(e===ue.GKr.Code){if(!ue.fTS(c))continue;Ze(u,_e);const e=!!i&&i.some(ue.fTS),t=!!a&&a.some(ue.fTS);e&&t?Ze(u,{borderRadius:0,paddingLeft:0,paddingRight:0}):e&&!t?Ze(u,{borderTopLeftRadius:0,borderBottomLeftRadius:0,paddingLeft:0}):!e&&t&&Ze(u,{borderTopRightRadius:0,borderBottomRightRadius:0,paddingRight:0})}else if(ue.JmL(c))Ze(u,ke);else if(ue.ehE(c)){const e=ue.V8Y(k),t=ue.LLi(k);if(e||t)continue;const o=null==i?void 0:i.some(ue.ehE),r=null==a?void 0:a.some(ue.ehE),s=ue.UWr(c);Ze(u,ct({isSelectedMatch:s,nextTokenContainsFindHighlight:r,previousTokenContainsFindHighlight:o,theme:n})),s&&m.push(pe.qp)}else if(ue.$nX(e)){if(!ue.BIG(c))continue;const t=g[e],n=null==a?void 0:a.some((e=>!(!ue.BIG(e)||!l.Xy(c,e))));if(t){const e={...t};if(ue.u2m(c)){const t=ue.EpE(c);ue.LAI(t)&&(delete e.background,delete e.color)}ue.$b8(c)&&u.textDecoration&&(p||(p={}),p.textDecoration=u.textDecoration),u.borderBottom===ve&&(p||(p={}),p.borderBottom=u.borderBottom),n&&(e.marginRight=2),Ze(u,e)}}else{let t=g[e];if(ue.GIC(c)){"+"===c[0]?t=g.si:"-"===c[0]&&(t=Ae(n));const e="+"===c[0]?"insert":"remove";m.push((0,T.jN)(e),(0,T.EO)({editId:c[1],type:e}))}t&&Ze(u,t)}}return{style:u,nestedInnerStyle:p,classNames:m}}function Ve(e){let{annotation:t,spaceId:n,getRecordModel:o}=e;if(ue.xw5(t)){const e=ue.h19(t);return o({table:ae.qF,id:e,spaceId:n})}}function Ne(e){var t;let{annotation:n,spaceId:o,getRecordModel:r}=e;return Boolean(null===(t=Ve({annotation:n,spaceId:o,getRecordModel:r}))||void 0===t?void 0:t.getResolved())}function Oe(e,t,n){return void 0===e?[]:ue.VP_(e.value||[],(o=>{if(ue.xw5(o)){const r=ue.h19(o);return n?r===n:!Ne({annotation:o,spaceId:null==e?void 0:e.spaceId,getRecordModel:t})}return!0}))}function Le(e){const t=e.key;return(0,he.jsxs)(i.Fragment,{children:[e,(0,he.jsx)("span",{className:pe.mb,children:pe.U3})]},t)}function je(e){let{args:t,style:n,nestedInnerStyle:o,classNames:i,index:a,token:l,tokenValue:v,tokenAnnotations:y}=e;const{disableHover:_,getRecordModel:k,isAndroid:w,disableLinks:A,emojiType:R,theme:D,intl:B,katex:E,parentBlockId:F,baseUrl:H,publicDomainName:G,textValue:W,stopLinkPropagation:$,linkTargetBlank:J,emojiData:X,isMobileNative:ee,isMobileNativeExternalLinkFixEnabled:ne}=t,ae=y.find(ue.uge);if(ae)return function(e){let{temporaryInputAnnotation:t,tokenValue:n,index:o,theme:r}=e;const{prefix:i,suffix:a,completion:s,prefixIcon:l}=ue.TZP(t),c=n.slice(i.length,a?-a.length:void 0);return(0,he.jsx)(he.Fragment,{children:(0,he.jsxs)("span",{...(0,T.iv)(pe.GR,{background:r.inlineInputBackground,padding:2.5,borderRadius:4,marginLeft:-2,pseudoAfter:{content:`"${s}"`,color:r.lightTextColor},pseudoAfterWhenComposing:{display:"none"}}),children:[(0,he.jsx)("span",{style:{color:r.mediumTextColor,display:l?"none":"initial"},children:i}),l&&(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)("span",{contentEditable:!1,className:pe.tL,style:{display:"inline-block",color:r.lightTextColor},children:l}),(0,he.jsx)($e,{})]}),c,a&&(0,he.jsx)("span",{style:{display:"none"},children:a})]},o)})}({temporaryInputAnnotation:ae,tokenValue:v,index:a,theme:D});if(ue.YrK(l)){const e=at({katex:E,equation:ue.o0h(l),index:a,isTemporary:Boolean(ue.hDy(l).find(ue.QVC)),style:n,theme:D,intl:B});return w?Le(e):e}const de=ue.rlz(y);if(de){const e=ue.zW$(de);if(e){return function(e){let{linkHref:t,style:n,theme:o,emojiType:i,tokenValue:a,disableLinks:s,index:l,disableHover:c,classNames:d,parentBlockId:p,baseUrl:m,publicDomainName:g,stopLinkPropagation:f,linkTargetBlank:h,emojiData:v}=e;const y=u.Nm({str:u.Qc(t).href,allowNoProtocol:!0}),b={...we,...n},_=(0,he.jsx)("span",{style:{borderBottom:ve,borderColor:o.opacityLinkDecorationColor,opacity:.7},className:c?"":(0,T.S$)({href:t,blockId:p||"unknown-block-id"}),children:(0,he.jsx)(S.V,{size:"1em",type:i,emojiData:v,children:a})});if(s)return(0,he.jsx)("span",{style:b,"data-token-index":l,children:_},l);b.textDecoration=b.textDecoration||"inherit";const k=r()(...d,pe.FB,pe.SJ,!c&&pe.kB);return(0,he.jsx)("a",{href:y,style:b,className:k,rel:"noopener noreferrer","data-token-index":l,tabIndex:0,onClick:f?e=>e.stopPropagation():void 0,target:h?"_blank":void 0,children:_},l)}({linkHref:e,style:n,theme:D,emojiType:R,tokenValue:v,disableLinks:A,index:a,disableHover:_,classNames:i,parentBlockId:F,baseUrl:H,publicDomainName:G,stopLinkPropagation:$,linkTargetBlank:J||ee&&ne,emojiData:X})}}const ge=ue.hH9(y);if(ge)return function(e){let{userAnnotation:t,getRecordModel:n,theme:o,index:r,style:i,emojiType:a,intl:s,isAndroid:l,classNames:c,disableHover:d,emojiData:u}=e;const p=ue.zEN(t),m=n({table:le.KJ,id:p}),g=e=>(0,he.jsx)("div",{style:{...e.style,background:o.lightDividerColor}}),f=[...c,pe.Eu,d?void 0:pe.kB].filter(Boolean).join(" "),h=(0,he.jsxs)("span",{style:{color:o.mediumTextColor,...i},contentEditable:!1,className:f,"data-token-index":r,children:[(0,he.jsx)("span",{}),(0,he.jsxs)("span",{children:[(0,he.jsx)("span",{style:{opacity:.6},children:"@"}),m?(0,he.jsx)(S.V,{size:"1em",type:a,emojiData:u,children:(0,fe.Nz)(s,m)}):(0,he.jsx)(g,{style:{height:8,width:75,borderRadius:4,display:"inline-block",marginLeft:"2px"}})]}),(0,he.jsx)("span",{})]},r);return l?Le(h):h}({userAnnotation:ge,getRecordModel:k,theme:D,index:a,style:n,emojiType:R,intl:B,isAndroid:w,classNames:i,disableHover:_,emojiData:X});const ye=ue.YnW(y);if(ye)return function(e){let{botAnnotation:t,index:n,theme:o,style:r,emojiType:i,getRecordModel:a,isAndroid:s,classNames:l,disableHover:c,emojiData:d}=e;const u=ue._Rq(t),p=a({table:ie.cZ,id:u}),m=[...l,pe.Eu,c?void 0:pe.kB].filter(Boolean).join(" "),g=(0,he.jsxs)("span",{style:{color:o.mediumTextColor,...r},contentEditable:!1,className:m,"data-token-index":n,children:[(0,he.jsx)("span",{}),(0,he.jsxs)("span",{children:[(0,he.jsx)("span",{style:{opacity:.6},children:"@🤖"}),(0,he.jsx)(S.V,{size:"1em",type:i,emojiData:d,children:(0,h.Mh)(p)})]}),(0,he.jsx)("span",{})]},n);return s?Le(g):g}({botAnnotation:ye,index:a,theme:D,style:n,emojiType:R,getRecordModel:k,isAndroid:w,classNames:i,disableHover:_,emojiData:X});const be=ue.xat(y);if(be)return function(e){let{groupAnnotation:t,index:n,theme:o,style:r,emojiType:i,intl:a,getRecordModel:s,isAndroid:l,classNames:c,disableHover:d,emojiData:u}=e;const p=ue.kxk(t);if(!p)return null;const{groupId:m,spaceId:g}=p,f=s((0,se.iA)({spacePermissionGroupId:m,spaceId:g})),h=(0,ce.m)({intl:a,permissionGroupModel:f}),v=[...c,pe.Eu,d?void 0:pe.kB].filter(Boolean).join(" "),y=e=>(0,he.jsx)("div",{style:{...e.style,background:o.lightDividerColor}}),b=(0,he.jsxs)("span",{style:{color:o.mediumTextColor,...r},contentEditable:!1,className:v,"data-token-index":n,children:[(0,he.jsx)("span",{}),(0,he.jsxs)("span",{children:[(0,he.jsx)("span",{style:{opacity:.6},children:"@"}),h?(0,he.jsx)(S.V,{size:"1em",type:i,emojiData:u,children:h}):(0,he.jsx)(y,{style:{height:8,width:75,borderRadius:4,display:"inline-block",marginLeft:"2px"}})]}),(0,he.jsx)("span",{})]},n);return l?Le(b):b}({groupAnnotation:be,index:a,theme:D,style:n,emojiType:R,intl:B,getRecordModel:k,isAndroid:w,classNames:i,disableHover:_,emojiData:X});const _e=ue.V8Y(y);if(_e)return function(e){const{pageAnnotation:t,tokenAnnotations:n,getRecordModel:o,getRecordRole:i,renderedPageBlockId:a,emojiType:l,intl:c,index:u,theme:m,isAndroid:f,isWindows:h,style:v,disableHover:y,userTimeZone:b,getPublicBaseUrlForPage:_,enableDeletedPageIndicator:k,enableNewTrashPageMentionPill:w,stopLinkPropagation:I,emojiData:T,disableLinks:M}=e,P=ue.TOT(t),A=Boolean(n.find(ue.rIb)),R={table:re.iU,id:P},D=o(R),B=i(R),E=Boolean(D&&D.isNavigableBlock()),F=E?D:(0,te.C8)((0,te.hI)(R,o)),Z=(0,C.Z)({pageId:(null==F?void 0:F.id)??P,scrollToBlockId:E?void 0:P,pageModel:D,baseUrl:D?null==_?void 0:_(R):void 0,pageVisitSource:p.tY.MentionInPage});let U,V=!1,N=!1;if("none"===B)U=(0,g.x)(c);else{const e=null==F?void 0:F.id;let t;if(E)t=P;else if(e===a){t=P,V=!0;U=ot(c,(0,oe.wy)({blockId:P,getRecordModel:o,intl:c,userTimeZone:b}))}else e?(t=e,N=!0):t=P;if(U||=(0,oe.wy)({blockId:t,getRecordModel:o,intl:c,userTimeZone:b}),U=tt(U),U&&N){const e=tt(ot(c,(0,oe.wy)({blockId:P,getRecordModel:o,intl:c,userTimeZone:b})));e&&(U=c.formatMessage({defaultMessage:"{pageTitleText} - {blockTitleText}",id:"textRenderHelpers.pageMention.linkToBlockOnDifferentPage"},{pageTitleText:U,blockTitleText:e}))}e&&(U||=(0,oe.wy)({blockId:e,getRecordModel:o,intl:c,userTimeZone:b})),U||=c.formatMessage({id:"textRenderHelpers.pageMention.untitledPlaceholder",defaultMessage:"Untitled"})}const O=o({table:re.iU,id:(null==F?void 0:F.id)??P}),L=null==O?void 0:O.getRenderFormatPointer(o),j=!!L&&(0,te.Pz)(L,o.getRecordValue),K=k&&j,z=et({...e,pageModel:F??D,pageRole:B,theme:m,showDeletedPageIndicator:K,enableNewTrashPageMentionPill:w,isLinkToBlockOnSamePage:V}),q=n.find(ue.ehE),H=Boolean(q),G=!!q&&ue.UWr(q),W=A?{background:m.equationTemporaryPlaceholderBackground,boxShadow:`0 0 0 3px ${m.equationTemporaryPlaceholderBackground}`,borderRadius:1,userSelect:"none"}:{},$=v&&v.textDecoration||"inherit",Y=r()(pe.zd,pe.Eu,pe.SJ,!y&&pe.kB,...e.classNames),Q=(0,he.jsxs)("a",{style:{...v,verticalAlign:"top",cursor:"pointer",color:s.ZP.inherit,textDecoration:$,transition:"all 100ms ease-in",pointerEvents:M?"none":void 0,...W},contentEditable:!1,className:Y,"data-token-index":u,href:Z,tabIndex:0,onClick:I?e=>e.stopPropagation():void 0,children:[(0,he.jsx)("span",{style:{whiteSpace:"nowrap"}}),(0,he.jsx)("span",{style:{whiteSpace:"nowrap",verticalAlign:h?"middle":void 0},children:z}),(0,he.jsx)("span",{style:{borderBottom:`${ve} ${m.linkDecorationColor}`,fontWeight:d.Z.fontWeight.medium,...K&&{color:m.mediumTextColor},...H&&ct({theme:m,isSelectedMatch:G})},className:r()(pe.t4,G&&pe.qp),children:(0,he.jsx)(S.V,{size:"1em",type:l,emojiData:T,children:U})}),(0,he.jsx)(x.Z,{theme:m,intl:c,isPageInTrash:j,enableNewTrashPageMentionPill:w}),(0,he.jsx)("span",{style:{whiteSpace:"nowrap"}})]},u);return f?Le(Q):Q}({pageAnnotation:_e,tokenAnnotations:y,classNames:i,index:a,style:n,...t});const Se=ue.J82(y);if(Se)return function(e){const{customEmojiAnnotation:t,getRecordModel:n,getRecordRole:o,theme:i,isSafariOrIOS:a,disableHover:s,index:l}=e,c=ue.PtE(t);if(!c)return(0,he.jsx)(he.Fragment,{});const d=n(c),u=o(c);let p;const m={fill:i.icon.secondary,borderRadius:2,backgroundColor:i.UIUserAvatarBackground};p="none"===u||d&&!d.alive?Ye({icon:L.B,style:m,withArrow:!1,isSafariOrIOS:a,theme:i.mode}):d?(0,he.jsx)(b.Z,{emojiId:d.id,emojiName:d.getName(),emojiUrl:d.getUrl(),spaceId:d.spaceId,baseUrl:e.baseUrl,currentUserId:e.currentUserId,size:"1.2em",style:{verticalAlign:"-0.2em"}}):Ye({icon:Y.L,style:m,withArrow:!1,isSafariOrIOS:a,theme:i.mode});const g=r()(pe.pC,pe.Eu,!s&&pe.kB),f=(0,he.jsx)("span",{"data-token-index":l,contentEditable:!1,className:g,style:{whiteSpace:"nowrap"},children:p},l);if(e.isAndroid)return Le(f);return f}({customEmojiAnnotation:Se,tokenAnnotations:y,index:a,style:n,...t});const ke=ue.wPk(y);if(ke)return function(e){var t;const{commentMentionAnnotation:n,index:o,intl:i,userTimeZone:a,emojiType:l,style:c,disableHover:u,theme:m,getRecordModel:g,baseUrl:h,getRecordRole:v,getPublicBaseUrlForPage:y,stopLinkPropagation:b,emojiData:_}=e,k=ue.$WM(n);if(!k)return;const w=c&&c.textDecoration||"inherit",x=v(k);if("none"===x)return(0,he.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",color:s.ZP.inherit,textDecoration:w,transition:"all 100ms ease-in"},contentEditable:!1,className:`${pe.zd} ${pe.Eu} ${u?"":pe.kB}`,children:[(0,L.B)({width:20,height:20,marginRight:5,marginLeft:5,fill:m.mediumIconColor}),(0,he.jsx)("span",{style:{borderBottom:`${ve} ${m.linkDecorationColor}`,fontWeight:d.Z.fontWeight.medium,flexShrink:0,marginRight:"0.3rem"},children:i.formatMessage({defaultMessage:"No access to page comments",id:"textRenderHelpers.commentMention.noAccess.title"})})]});const T=g(k);if(!T)return;const M=T.getParentPointer(),P=(0,te.C8)((0,te.hI)(M,g));if(!P)return;let A;const R=g(M),D=null==R?void 0:R.getParentPointer();if(D){const e=g(D);A=e&&e.getType()===f.Ti.tableRow?e.getParentId():null==D?void 0:D.id}const B=(0,C.Z)({pageId:P.id,scrollToBlockId:A,pageModel:P,baseUrl:null==y?void 0:y(P.pointer),discussionId:M.id,pageVisitSource:p.tY.MentionInPage}),E=T.getCreatedByPointer(),F=E&&g(E);if(!F)return;const Z=(0,he.jsx)(I.ZP,{userValue:F,avatarSize:20,baseUrl:h,theme:m}),U=et({...e,pageModel:P,pageRole:x,theme:m,hideLinkIndicator:!0}),V=(0,oe.wy)({blockId:P.id,getRecordModel:g,intl:i,userTimeZone:a})||i.formatMessage({id:"textRenderHelpers.commentMention.untitledPlaceholder",defaultMessage:"Untitled"}),N=ue.Jcv(T.getText()),j=null==F?void 0:F.getDisplayName(i),K=r()(pe.zd,pe.Eu,pe.SJ,!u&&pe.kB);return(0,he.jsxs)("a",{style:{...c,verticalAlign:"top",cursor:"pointer",color:s.ZP.inherit,textDecoration:w,transition:"all 100ms ease-in"},contentEditable:!1,className:K,"data-token-index":o,href:B,tabIndex:0,onClick:b?e=>e.stopPropagation():void 0,children:[(0,he.jsx)("span",{style:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"text-top"},children:Z}),j&&(0,he.jsx)("span",{style:{color:m.mediumTextColor,marginLeft:"0.4rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexShrink:0},children:(0,he.jsx)(S.V,{size:"1em",type:l,emojiData:_,children:j})}),(0,he.jsx)("span",{style:{borderBottom:`${ve} ${m.linkDecorationColor}`,fontWeight:d.Z.fontWeight.medium,marginRight:"0.4rem",marginLeft:"0.4rem",overflow:"hidden",textOverflow:"ellipsis"},children:N?(0,he.jsx)(S.V,{size:"1em",type:l,emojiData:_,children:He(N)}):(0,he.jsxs)("span",{style:{marginRight:5,display:"flex",alignItems:"center"},children:[(0,O.s)({width:18,height:18,marginRight:5,fill:m.mediumIconColor}),i.formatMessage({defaultMessage:"{numberOfAttachments, plural, one {{numberOfAttachments} attachment} other {{numberOfAttachments} attachments}}",id:"textRenderHelpers.commentMention.attachments.title"},{numberOfAttachments:null===(t=T.getContent())||void 0===t?void 0:t.length})]})}),U,(0,he.jsx)("span",{style:{color:m.mediumTextColor,overflow:"hidden",textOverflow:"ellipsis"},children:(0,he.jsx)(S.V,{size:"1em",type:l,emojiData:_,children:V})})]},o)}({commentMentionAnnotation:ke,index:a,style:n,...t});const xe=ue.LLi(y);if(xe)return function(e){const{linkMentionAnnotation:t,tokenAnnotations:n,index:o,emojiType:i,isAndroid:a,style:s,disableHover:l,disableLinks:c,theme:p,emojiData:m,stopLinkPropagation:g}=e,{title:f,link_author:h,link_provider:v,icon_url:y,href:b}=t[1],_=u.Nm({str:u.Qc(b).href,allowNoProtocol:!0}),k={...s,color:"inherit"},w={marginRight:"0.3em",fill:p.icon.secondary,width:"1em",height:"1em"};k.textDecoration=k.textDecoration||"inherit";const x=r()(pe.Ko,pe.Eu,pe.SJ,!l&&pe.kB);let I;I=y?(0,he.jsx)("img",{style:{width:"1.2em",height:"1.2em",borderRadius:3,verticalAlign:"-0.15em",marginRight:"0.3em"},src:y}):Ye({icon:z.N,style:w,withArrow:!1,isSafariOrIOS:!1,theme:p.mode});const C=n.find(ue.ehE),T=Boolean(C),M=!!C&&ue.UWr(C),P=(0,he.jsxs)("a",{href:_,className:x,"data-token-index":o,contentEditable:!1,tabIndex:0,target:"_blank",style:{...k,cursor:"pointer",pointerEvents:c?"none":void 0},onClick:g?e=>e.stopPropagation():void 0,rel:"noopener noreferrer",children:[I,(0,he.jsxs)("span",{className:r()(M&&pe.qp),style:{...T&&ct({theme:p,isSelectedMatch:M})},children:[h?(0,he.jsx)("span",{style:{color:p.mediumTextColor,marginRight:"0.3em"},children:(0,he.jsx)(S.V,{size:"1em",type:i,emojiData:m,children:h.toString()})}):v?(0,he.jsx)("span",{style:{color:p.mediumTextColor,marginRight:"0.3em"},children:(0,he.jsx)(S.V,{size:"1em",type:i,emojiData:m,children:v.toString()})}):null,f&&(0,he.jsx)("span",{style:{borderBottom:`${ve} solid ${p.linkDecorationColor}`,fontWeight:d.Z.fontWeight.medium,flexShrink:0},children:(0,he.jsx)(S.V,{size:"1em",type:i,emojiData:m,children:He(f)})})]})]},o);return a?Le(P):P}({linkMentionAnnotation:xe,index:a,tokenAnnotations:y,style:n,...t});const Ie=ue.K9C(y);if(Ie)return function(e){let{dateAnnotation:t,userTimeZone:n,intl:o,index:r,style:i,disabled:a,disableHover:l,disableDateStyleAnnotations:c,isAndroid:d,classNames:u,theme:p,getToday:m,displayInUserTimezone:g}=e;const{date_format:f,time_format:h,...v}=ue.zyO(t),y=(0,M.ZV)({value:v,date_format:f,time_format:h,userTimeZone:n,displayInUserTimezone:g,intl:o,allowRelativeDates:!0,getToday:m});let b,_={color:p.mediumTextColor};v.reminder&&(b=P.Nm(v,n),_=b?{color:p.errorText}:{color:s.ZP.blue});const S=[...u,pe.Eu,l?pe.Eu:pe.kB].filter(Boolean).join(" "),k=(0,he.jsxs)("span",{style:{...i,..._,cursor:a?"auto":"pointer"},contentEditable:!1,className:S,"data-token-index":r,children:[(0,he.jsx)("span",{}),(0,he.jsxs)("span",{children:[(0,he.jsx)("span",{style:{opacity:.5},children:"@"}),(0,he.jsx)("span",{className:"notion-reminder",style:c?{textDecoration:"none",color:s.ZP.inherit}:{},children:y}),v.reminder&&(0,he.jsx)("div",{style:{display:"inline-block",width:"1em",marginLeft:4,marginRight:2,paddingBottom:3,verticalAlign:"middle"},children:(0,V.m)({fill:b?p.errorText:s.ZP.blue})})]}),(0,he.jsx)("span",{})]},r);return d?Le(k):k}({dateAnnotation:Ie,index:a,style:n,classNames:i,...t});const Ce=ue.jRb(y);if(Ce)return function(e){let{baseUrl:t,classNames:n,disabled:o,disableHover:r,formulaPagePropertyMentionAnnotation:i,formulaValueTypes:a,getRecordModel:s,index:l,intl:c,isAndroid:d,style:u,theme:p}=e;const g=[...n,pe.Eu,r?pe.Eu:pe.kB].filter(Boolean).join(" "),f=(0,ue.pxR)(i);if(!(0,ue.xvX)(f))return null;let h=f.name;if((0,ue.CEh)(f)){const e=f.contextValueId,t=f.property,n=a.find((t=>t.kind===Z.yp.ContextValue&&t.id===e)),o=null==n?void 0:n.type;if(n&&"block"===(null==o?void 0:o.type)&&o.collection){var v;const e=s(o.collection),r=null==e?void 0:e.getNormalizedSchema(),i=null==r||null===(v=r[t])||void 0===v?void 0:v.name;i&&(h=(0,m.sB)(c,n.name,i))}else h=c.formatMessage({defaultMessage:"Unknown value’s property",id:"textRenderHelpers.formulaValueMention.possessiveUnknownValueProperty"})}else if(f.collection){var y;const e=f.property,t=s(f.collection),n=null==t?void 0:t.getNormalizedSchema(),o=null==n||null===(y=n[e])||void 0===y?void 0:y.name;o&&(h=o)}h??=f.property;const b=(0,he.jsxs)("span",{style:{...u,cursor:o?"auto":"pointer"},contentEditable:!1,className:g,"data-token-index":l,children:[(0,he.jsx)("span",{}),(0,he.jsx)("span",{style:{background:p.fill.gray,borderRadius:4,padding:"2px 4px"},children:h}),(0,he.jsx)("span",{})]},l);return d?Le(b):b}({formulaPagePropertyMentionAnnotation:Ce,index:a,style:n,classNames:i,...t});const Te=ue.sP4(y);if(Te)return function(e){let{formulaContextValueMentionAnnotation:t,index:n,style:o,disabled:r,disableHover:i,isAndroid:a,classNames:s,baseUrl:l,theme:c,formulaValueTypes:d,intl:u,isSafariOrIOS:p}=e;const m=[...s,pe.Eu,i?pe.Eu:pe.kB].filter(Boolean).join(" "),g=ue.vmO(t),f=(0,U.vx)(d,g.id),h=f?(0,U.RX)(f.type):void 0,v=h?Ye({icon:h,style:{fill:c.blueColor,marginRight:"0.3em",width:"1em",height:"1em"},withArrow:!1,isSafariOrIOS:p,theme:c.mode}):void 0,y=(0,he.jsxs)("span",{style:{...o,cursor:r?"auto":"pointer"},contentEditable:!1,className:m,"data-token-index":n,children:[(0,he.jsx)("span",{}),(0,he.jsxs)("span",{style:{background:c.outlineBlueButtonPressedBackground,color:c.blueColor,padding:"1px 6px",borderRadius:4},children:[v,(null==f?void 0:f.name)||u.formatMessage({defaultMessage:"Unknown value",id:"textRenderHelpers.formulaValueMention.unknownValue"})]}),(0,he.jsx)("span",{})]},n);return a?Le(y):y}({formulaContextValueMentionAnnotation:Te,index:a,style:n,classNames:i,...t});const Me=ue.jC0(y);if(Me)return function(e){const{citationAnnotation:t,intl:n,index:o,isAndroid:i,style:a,stopLinkPropagation:s,disableLinks:l,baseUrl:u,getRecordModel:m}=e,g=ue.Vv0(t),f=function(e){const{citationAnnotation:t,baseUrl:n,getRecordModel:o}=e,r=ue.Vv0(t);let i;const a=function(e){const{citationAnnotationData:t,getRecordModel:n}=e;if("block"!==t.type&&void 0!==t.type)return;if(!t.blockId)return;const o=t.blockId,r=n({table:re.iU,id:o});if(!r)return;if(r.isNavigableBlock())return{navigableBlockModel:r};{const e=(0,te.C8)((0,te.hI)({table:re.iU,id:o},n));if(!e)return;return{navigableBlockModel:e,scrollToBlockModel:r}}}({citationAnnotationData:r,getRecordModel:o});if(a){const{navigableBlockModel:e,scrollToBlockModel:t}=a;i=(0,C.Z)({pageId:e.id,pageModel:e,scrollToBlockId:null==t?void 0:t.id,baseUrl:n,pageVisitSource:p.tY.AIQna})}else"slack"===r.type?i=rt({domain:r.domain,baseUrl:r.baseUrl,channelId:r.channelId,messageId:r.messageId,threadTs:r.threadTs}):"google-drive"===r.type||"helpdoc"===r.type||"github"===r.type?i=r.url:"url"===r.type&&(i=r.href);return i}({citationAnnotation:t,baseUrl:u,getRecordModel:m}),h=!!Boolean(f)&&e.disableHover,v=r()(pe.rs,pe.Eu,pe.SJ,!h&&pe.kB),y=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="100%" height="100%" viewBox="0 0 24 24" version="1.1" data-ember-extension="1"><defs><linearGradient x1="28.1542969%" y1="63.7402344%" x2="74.6289062%" y2="17.7832031%" id="linearGradient-1"><stop stop-color="rgba(164, 164, 164, 1)" offset="0%"/><stop stop-color="rgba(164, 164, 164, 0)" stop-opacity="0" offset="100%"/></linearGradient></defs><g id="Page-1" stroke="none" stroke-width="1" fill="none" ><g transform="translate(-236.000000, -286.000000)"><g transform="translate(238.000000, 286.000000)"><circle id="Oval-2" stroke="url(#linearGradient-1)" stroke-width="4" cx="10" cy="12" r="10"/><path d="M10,2 C4.4771525,2 0,6.4771525 0,12" id="Oval-2" stroke="rgba(164, 164, 164, 1)" stroke-width="4"/><rect id="Rectangle-1" fill="rgba(164, 164, 164, 1)" x="8" y="0" width="4" height="4" rx="8"/></g></g></g></svg>'),b=t=>{let{style:n}=t;return(0,he.jsx)("img",{role:"progressbar",className:"loading-spinner",style:{filter:"contrast(2)",...n},alt:e.intl.formatMessage({id:"loadingSpinner.label",defaultMessage:"Loading..."}),"aria-busy":"true","aria-live":"polite",src:`data:image/svg+xml;utf8,${y}`})};let _,S,k;void 0===g.type||"block"===g.type?(S=g.blockId,k=g.number,_=void 0):"query_database_result"===g.type||"url"===g.type?(S=void 0,k=g.number,_=void 0):"github"===g.type||"slack"===g.type||"google-drive"===g.type||"helpdoc"===g.type?(S=void 0,k=g.number,_=g.messageId):(0,c.t1)(g.type);const w=f||"query_database_result"===g.type?(0,he.jsx)("a",{style:{...a,verticalAlign:"text-bottom",cursor:"pointer",transition:"all 100ms ease-in",pointerEvents:l?"none":void 0,textDecoration:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:90,padding:"0 4px",fontSize:10,minWidth:14,height:14,marginLeft:4,marginRight:1,fontWeight:d.Z.fontWeight.semibold},contentEditable:!1,className:v,"data-token-index":o,href:f,tabIndex:0,onClick:s?e=>e.stopPropagation():void 0,...S?{[pe.JQ]:S}:{},..._?{[pe.Nz]:_}:{},children:(0,he.jsxs)("span",{style:{display:"flex",gap:".1rem",alignItems:"center"},children:["slack"===g.type?(0,Q.Q)({width:10,height:10,fill:"white"}):"","google-drive"===g.type?(0,K.c)({width:10,height:10,fill:"white"}):"","helpdoc"===g.type?(0,q.h)({width:10,height:10,fill:"white"}):"","github"===g.type?(0,j.f)({width:10,height:10,fill:"white"}):"","url"===g.type?(0,N.w)({width:10,height:10,fill:"white",rotate:"45deg"}):"",k.toLocaleString(n.locale)]})},o):(0,he.jsx)("a",{style:{...a,verticalAlign:"text-bottom",cursor:"pointer",transition:"all 100ms ease-in",pointerEvents:"none",textDecoration:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:90,padding:"0 4px",fontSize:10,minWidth:14,height:14,marginLeft:4,marginRight:1,fontWeight:d.Z.fontWeight.semibold},contentEditable:!1,className:v,"data-token-index":o,tabIndex:0,onClick:s?e=>e.stopPropagation():void 0,children:(0,he.jsx)(b,{})},o),x=(0,he.jsxs)("span",{style:{whiteSpace:"nowrap"},children:["⁠",w,"⁠"]});return i?Le(x):x}({citationAnnotation:Me,tokenAnnotations:y,index:a,style:n,...t});const Pe=ue.frE(y);if(Pe){const e=ue.frW(Pe);if(!e)return;const o=k({table:re.iU,id:e,spaceId:null==W?void 0:W.spaceId});if(null==o||!o.isType(f.Ti.externalObjectInstance))return;return ze({blockModel:o,shouldWrap:!1,index:a,style:n,classNames:i,...t})}const Ae=ue.QGY(y);if(Ae)return function(e){let{templateVariableAnnotation:t,intl:n,index:o,style:r,disabled:i,disableHover:a,disableDateStyleAnnotations:l,isAndroid:c,classNames:d}=e;const u=(0,me.U$)(ue.fsE(t).type,n),p=[...d,pe.Eu,a?pe.Eu:pe.kB].filter(Boolean).join(" "),m=(0,he.jsxs)("span",{style:{...r,cursor:i?"auto":"pointer",opacity:.5},contentEditable:!1,className:p,"data-token-index":o,children:[(0,he.jsx)("span",{}),(0,he.jsxs)("span",{children:[(0,he.jsx)("span",{style:{opacity:.5},children:"@"}),(0,he.jsx)("span",{style:l?{textDecoration:"none",color:s.ZP.inherit}:{},children:u})]}),(0,he.jsx)("span",{})]},o);return c?Le(m):m}({templateVariableAnnotation:Ae,index:a,style:n,classNames:i,...t});const Re=ue.U_3(y);if(Re)return function(e){let{annotation:t,index:n,theme:o,tokenValue:r,isAndroid:i}=e;const a=ue.ldh(t);if(!a)return null;const s=r.slice(1,void 0),{hint:l}=a;return(0,he.jsx)(he.Fragment,{children:(0,he.jsxs)("span",{children:[(0,he.jsx)("span",{style:{color:o.mediumTextColor},...(0,T.iv)({pseudoAfter:{content:`"${l}"`,color:o.lightTextColor},pseudoAfterWhenComposing:{}}),children:"/"}),s]},n)})}({annotation:Re,index:a,tokenValue:v,...t});const De={key:a,style:n,"data-token-index":a,...ue.gdi(y)?{spellCheck:!1}:{},className:[...i,_?"":pe.kB].join(" ")};return o?(0,he.jsx)("span",{...De,children:(0,he.jsx)("span",{style:o,children:(0,he.jsx)(S.V,{size:"1em",type:R,emojiData:X,children:v})})}):(0,he.jsx)("span",{...De,children:(0,he.jsx)(S.V,{size:"1em",type:R,emojiData:X,children:v})})}function Ke(e){const{textValue:t,disableStyleAnnotations:n,disableInsertedDeletedAnnotations:o,disableSuggestionAnnotations:r,disableCommentAnnotations:i,getRecordModel:a,emojiType:c,highlightDiscussionId:d,theme:u,emojiData:p,dictationId:m}=e,g=[(null==t?void 0:t.value)||[]].map(de.iR).map((e=>d?function(e){let{textValue:t,highlightDiscussionId:n}=e;return ue.VP_(t,(e=>!ue.xw5(e)||n===ue.h19(e)))}({textValue:e,highlightDiscussionId:d}):e))[0],f=g.map(((l,d)=>{const f=ue.WiV(l),h=ue.hDy(l),v=d-1>=0?ue.hDy(g[d-1]):void 0,y=d+1<g.length?ue.hDy(g[d+1]):void 0;if(0===h.length)return(0,he.jsx)(S.V,{size:"1em",type:c,emojiData:p,children:f},d);const b=new Set(["mark","smark"]);let _=h;n&&!o?(b.add("+"),b.add("-")):!n&&o&&(_=h.filter((e=>"+"!==e[0]&&"-"!==e[0]))),r&&(_=h.filter((e=>e[0]!==ue.GKr.SuggestionInsertText&&e[0]!==ue.GKr.SuggestionRemoveText))),i&&(_=h.filter((e=>e[0]!==ue.GKr.Discussion))),n&&(_=h.filter((e=>b.has(e[0]))));const k=n&&_.length>0,{style:w,nestedInnerStyle:x,classNames:I}=n&&o&&!k?{style:{textDecoration:"none",color:s.ZP.inherit},nestedInnerStyle:void 0,classNames:[]}:Ue({annotations:_,theme:u,getRecordModel:a,spaceId:(null==t?void 0:t.spaceId)||"",prevAnnotations:v,nextAnnotations:y,dictationId:m});return je({args:e,style:w,nestedInnerStyle:x,classNames:I,index:d,token:l,tokenValue:f,tokenAnnotations:h})})),h=g[g.length-1],v=h?ue.WiV(h):"",y=(0,R.p4)(v),b=l.Z$(y),_=Boolean(b===ue.qyI||b===ue.fuX||b&&"raw"!==c&&(0,A.y)(b,p));return"\n"===b?f.push("\n"):_&&f.push(pe.DQ),f}function ze(e){var t,n;let o,{blockModel:a,shouldWrap:c,index:p,style:m,disableHover:g,disableLinks:h,isAndroid:v,theme:b,getRecordModel:_,currentUserId:k,baseUrl:x,classNames:I,emojiType:C,externalIntegrations:T,intl:M,stopLinkPropagation:P,emojiData:A}=e;if(!a.isType(f.Ti.externalObjectInstance)&&!a.isType(f.Ti.externalObjectInstancePage))return;if(o=a.getFormatValue("original_url")||a.getFormatValue("uri"),!o)return;const R=u.Nm({str:u.Qc(o).href,allowNoProtocol:!0});if(a.isType(f.Ti.externalObjectInstance)&&!R)return;const E={...m,color:"inherit"};E.textDecoration=E.textDecoration||"inherit";const F=r()(pe.Hg,pe.Eu,pe.SJ,...I,!g&&pe.kB),Z=(0,ge.ny)({url:o,integrations:T,currentSpaceId:a.getSpaceId()});let U=[];const V="success"===Z.type?Z.pattern.name:void 0,N=(0,D.U)(V),O=a.getFormatValue("related_external_object_uris_to_instance_ids"),L=Object.values(O||{});U=l.oA(L.map((e=>{var t;return null===(t=_({table:re.iU,id:e,spaceId:a.getSpaceId()}))||void 0===t?void 0:t.getFormat()})));const j="success"===Z.type?(0,ge.Tf)({url:o,integration:Z.integration}):[],K="success"===Z.type?Z.integration.info.icon:void 0,z=N.inline({integrationIcon:K,root:a.getFormat(),relations:U,parsedAttributes:j});let q,H;if(null!=z&&z.icon)(0,ge.li)(z.icon)?q=We({url:z.icon.values[0],iconSize:"1em",baseUrl:x,currentUserId:k,style:{marginRight:"0.3em"}}):(0,ge.Id)(z.icon)?q=function(e){const{title:t,theme:n,style:o}=e;return(0,he.jsx)(w.ZP,{style:{display:"inline-flex",padding:"0 4px",...o},format:w.lo.Inline,value:t[0].toUpperCase(),color:n.regularInvertedTextColor,backgroundColor:n.lightIconColor,isSingle:!0,shouldShrink:!0,theme:n})}({title:z.icon.values[0],theme:b,style:{marginRight:"0.3em"}}):(0,ge.hW)(z.icon)&&(q=function(e){const{color:t,theme:n,style:o}=e,r=`rgb(${t.r},${t.g},${t.b})`,{colorName:i,shade:a}=(0,s.lL)(r);return(0,he.jsx)("div",{style:{width:12,height:12,background:n.accentColors[i][a],borderRadius:4,display:"inline-block",...o}})}({color:z.icon.values[0],theme:b,style:{marginRight:"0.3em"}}));else if("success"===Z.type){const e=Z.integration.info.icon;e&&(q=We({url:e,iconSize:"1em",baseUrl:x,currentUserId:k,style:{marginRight:"0.3em"}}))}if(null!=z&&null!==(t=z.title)&&void 0!==t&&t.formatter&&(0,ge.Id)(z.title.attribute)){const{attribute:e,formatter:t}=z.title;H=M.formatMessage(t,{value:e.values[0]})}else H=null!=z&&null!==(n=z.title)&&void 0!==n&&n.attribute&&(0,ge.Id)(z.title.attribute)?z.title.attribute.values[0]:(0,y.wS)(a,"title")?ue.QaF((0,y.wS)(a,"title")):R||o;const G="success"===Z.type&&R?(0,B.l)({url:R,integration:Z.integration,pattern:Z.pattern}):R,W=(0,he.jsxs)("a",{href:G,target:"_blank",rel:"noopener noreferrer",style:{...E,pointerEvents:h?"none":void 0},className:F,"data-token-index":p,contentEditable:!1,tabIndex:0,onClick:P?e=>e.stopPropagation():void 0,children:[q,(null==z?void 0:z.identifier)&&(0,ge.Id)(z.identifier)&&(0,he.jsx)("span",{style:{color:b.mediumTextColor,marginRight:"0.3em"},children:(0,he.jsx)(S.V,{size:"1em",type:C,emojiData:A,children:z.identifier.values[0]})}),(0,he.jsx)("span",{style:{borderBottom:`${ve} ${b.linkDecorationColor}`,fontWeight:d.Z.fontWeight.medium,flexShrink:0,...c&&{whiteSpace:"break-spaces"}},children:(0,he.jsx)(S.V,{size:"1em",type:C,emojiData:A,children:He(H)})}),(null==z?void 0:z.attributes)&&z.attributes.map((e=>(0,he.jsx)(i.Fragment,{children:Ge({attribute:e,theme:b,emojiType:C,relatedInstanceData:U,baseUrl:x,currentUserId:k,emojiData:A})},e.id))),(0,he.jsx)("span",{})]},p);return v?Le(W):W}function qe(e){var t,n;let o,{blockModel:r,getRecordModel:i,externalIntegrations:a,intl:s}=e;if(!r.isType(f.Ti.externalObjectInstance)&&!r.isType(f.Ti.externalObjectInstancePage))return;if(o=r.getFormatValue("original_url")||r.getFormatValue("uri"),!o)return;const c=u.Nm({str:u.Qc(o).href,allowNoProtocol:!0});if(r.isType(f.Ti.externalObjectInstance)&&!c)return;const d=(0,ge.ny)({url:o,integrations:a,currentSpaceId:r.getSpaceId()});let p=[];const m="success"===d.type?d.pattern.name:void 0,g=(0,D.U)(m),h=r.getFormatValue("related_external_object_uris_to_instance_ids"),v=Object.values(h||{});p=l.oA(v.map((e=>{var t;return null===(t=i({table:re.iU,id:e,spaceId:r.getSpaceId()}))||void 0===t?void 0:t.getFormat()})));const b="success"===d.type?(0,ge.Tf)({url:o,integration:d.integration}):[],_="success"===d.type?d.integration.info.icon:void 0,S=g.inline({integrationIcon:_,root:r.getFormat(),relations:p,parsedAttributes:b});if(null!=S&&null!==(t=S.title)&&void 0!==t&&t.formatter&&(0,ge.Id)(S.title.attribute)){const{attribute:e,formatter:t}=S.title;return s.formatMessage(t,{value:e.values[0]})}return null!=S&&null!==(n=S.title)&&void 0!==n&&n.attribute&&(0,ge.Id)(S.title.attribute)?S.title.attribute.values[0]:(0,y.wS)(r,"title")?ue.QaF((0,y.wS)(r,"title")):c||o}function He(e){const t=e.toString().replace(/[\r\n]/g,"").trim();return`${t.substring(0,60)}${t.length>60?"…":""}`}function Ge(e){const{attribute:t,theme:n,emojiType:o,relatedInstanceData:r,baseUrl:i,currentUserId:a,emojiData:l}=e,c={marginLeft:4,color:n.mediumTextColor};if((0,ge.OM)(t)){const e=t.values[0],c=r.find((t=>t.uri===e));if(!c)return;const d=c.attributes||[],u=d.find(ge.Id),p=d.find(ge.li),m=d.find(ge.hW);if(!u)return;const g=null==m?void 0:m.values[0],f=g?(0,s.MJ)(`rgb(${g.r},${g.g},${g.b})`):void 0,h=(0,s.KR)(n,f),y=null==p?void 0:p.values[0];return(0,he.jsx)(w.ZP,{style:{display:"inline-flex",marginLeft:"0.3em"},format:w.lo.Inline,value:(0,he.jsxs)("span",{style:{display:"flex",alignItems:"center"},children:[y&&We({url:y,iconSize:"12px",currentUserId:a,baseUrl:i,style:{marginRight:"0.3em"}}),(0,he.jsx)(S.V,{type:o,emojiData:l,children:(0,v.Z)(u.values[0])})]}),color:h.textColor,backgroundColor:h.backgroundColor,isSingle:!0,shouldShrink:!0,theme:n},t.id)}if((0,ge.li)(t)){const e=null==t?void 0:t.values[0];if(!e)return;return We({url:e,baseUrl:i,iconSize:"1em",currentUserId:a,style:{marginLeft:"0.3em"}})}if((0,ge.E4)(t)){var d;const e=null===(d=t.format)||void 0===d?void 0:d.color,r=e?(0,s.MJ)(`rgb(${e.r},${e.g},${e.b})`):void 0,i=(0,s.KR)(n,r);return(0,he.jsx)("span",{style:c,children:t.values.map(((e,t)=>(0,he.jsx)(w.ZP,{style:{display:"inline-flex",margin:void 0},format:w.lo.Inline,value:(0,he.jsx)(S.V,{type:o,emojiData:l,children:(0,v.Z)(e)}),color:i.textColor,backgroundColor:i.backgroundColor,isSingle:!0,shouldShrink:!0,theme:n},t)))})}if((0,ge.Id)(t)){const e=t.values[0];return(0,he.jsx)("span",{style:c,children:(0,he.jsx)(S.V,{size:"1em",type:o,emojiData:l,children:He(e)})})}}function We(e){const{iconSize:t,url:n,baseUrl:o,currentUserId:r,style:i}=e,a={url:n,width:100,fullyQualified:!0,baseUrl:o,userId:r},s=(0,E.F8)(n)?F.Q4(a):n;return(0,he.jsx)("img",{style:{width:t,height:t,verticalAlign:"-0.15em",borderRadius:4,...i},src:s})}function $e(){return(0,he.jsx)("hr",{role:"none",...(0,T.iv)(pe.tL,{display:"inline-block",border:0,padding:0,margin:0,opacity:0,verticalAlign:"-0.15em",height:"1em",fontSize:"1em",lineHeight:"1em",pseudoAfter:{content:`"${pe.U3}"`}})})}function Ye(e){const{icon:t,style:n,withArrow:o,isSafariOrIOS:r,theme:i}=e,a=o?Xe({isSafariOrIOS:r,type:"default",theme:i}):void 0;return(0,he.jsxs)("span",{style:{width:"1.1em",height:"1.1em",display:"inline-block",verticalAlign:"-0.15em",position:"relative",...n},children:[t(),a]})}function Qe(e){const{isSafariOrIOS:t,theme:n}=e,o={marginLeft:"0.1em",marginRight:t?"0.4em":"0.5em",color:n.mediumTextColor};return Ye({icon:J.y,style:o,withArrow:!1,isSafariOrIOS:t,theme:n.mode})}function Je(e){const{isSafariOrIOS:t,theme:n}=e,o={marginLeft:"1.1em",marginRight:t?"0.4em":"0.5em",color:n.mediumTextColor};return Ye({icon:J.y,style:o,withArrow:!1,isSafariOrIOS:t,theme:n.mode})}function Xe(e){const{isSafariOrIOS:t,type:n}=e,o="emoji"===n&&t?"-0.6em":"-0.2em",r="image"===n?"0.15em":0,i=(0,s.gh)({theme:e.theme}),a=i.regularTextColor,l=i.contentBackground,c="dark"===i.mode?1.85:1.5;return(0,W.Y)({width:"0.7em",height:"0.7em",position:"absolute",right:o,bottom:r,fill:a,stroke:l,strokeWidth:c})}function et(e){const{showEmojiInline:t,emojiType:n,pageModel:o,pageRole:r,getRecordModel:i,baseUrl:a,isSafariOrIOS:s,isClient:l,currentUserId:d,parentBlockId:u,theme:p,hideLinkIndicator:m,isLinkToBlockOnSamePage:f,emojiData:h}=e,v="1em",y={marginRight:s?"0.4em":"0.5em",fill:p.icon.secondary};if("none"===r)return Ye({icon:L.B,style:y,withArrow:!1,isSafariOrIOS:s,theme:p.mode});if(f)return Ye({icon:$.f,style:{...y,fill:p.lightTextColor,marginRight:"0.1em",width:"1em",height:"1em"},withArrow:!1,isSafariOrIOS:s,theme:p.mode});if(!o)return null;const b=o.getRenderIcon({getRecordModel:i}),S=b&&(0,g.IT)(b);if(S){const e=(e,t)=>{const n=(0,E.F8)(e)?F.EK({url:e,permissionRecord:t,width:100,fullyQualified:!l,baseUrl:a,userId:d}):e;return(0,he.jsxs)("span",{style:{display:"inline-block",width:v,whiteSpace:"nowrap",position:"relative",marginRight:"0.5em"},children:[(0,he.jsx)("img",{style:{width:v,height:v,borderRadius:1},src:n}),o&&o.getParentId()!==u?Xe({isSafariOrIOS:s,type:"image",theme:p.mode}):void 0]})};switch(S.icon.type){case"unicode_emoji":return(0,he.jsxs)("span",{style:{display:t?"inline":"inline-block",marginLeft:"0.1em",marginRight:s?"0.8em":m?"0.3em":"0.5em",width:s?"0.8em":v,whiteSpace:"nowrap",position:"relative"},children:[(0,he.jsx)(_.Z,{size:s?"1em":v,char:S.icon.emoji.unicode,type:n,emojiData:h}),o&&o.getParentId()!==u&&!m?Xe({isSafariOrIOS:s,type:"emoji",theme:p.mode}):void 0]});case"custom_emoji":const r=ee.vq9.resolveCustomEmojiIcon(b,i);if(r)return e(r.icon,r.pointer);break;case"app_package_asset":case"notion_icon":return(0,he.jsxs)("span",{style:{display:"inline-block",width:v,whiteSpace:"nowrap",position:"relative",marginRight:"0.5em"},children:[(0,he.jsx)("img",{style:{width:v,height:v,borderRadius:1},src:S.icon.icon}),o&&o.getParentId()!==u?Xe({isSafariOrIOS:s,type:"image",theme:p.mode}):void 0]});case"url":return e(S.icon.icon,S.pointer);default:(0,c.t1)(S.icon)}}return o.isEmptyPage()?Ye({icon:G.a,style:y,withArrow:o.getParentId()!==u,isSafariOrIOS:s,theme:p.mode}):Ye({icon:H.S,style:y,withArrow:o.getParentId()!==u,isSafariOrIOS:s,theme:p.mode})}function tt(e){return e.includes("\n")&&(e=e.trim().split("\n")[0]),e}const nt=60;function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:nt;return t.length<=n?t:e.formatMessage({defaultMessage:"{text}…",id:"textRenderHelpers.ellipsifyText"},{text:t.substring(0,n-1)})}function rt(e){const{domain:t,baseUrl:n,channelId:o,messageId:r,threadTs:i}=e,a=n?n.replace(/\/$/,""):`https://${t}.slack.com`,s=new URL(`${a}/archives/${o}/p${r.replace(".","")}`);return i&&(s.searchParams.set("thread_ts",i),s.searchParams.set("cid",o)),s.toString()}function it(e){const{fileId:t,fileType:n}=e;return"document"===n?`https://docs.google.com/document/d/${t}`:"presentation"===n?`https://docs.google.com/presentation/d/${t}`:void 0}function at(e){const{katex:t,equation:n,index:o,isTemporary:r,style:i,intl:a,theme:s}=e;return t?(0,he.jsx)(k.MW,{display:"inline",katex:t,equation:n,index:o,isTemporary:r,style:i,theme:s,intl:a},o):(0,he.jsx)("span",{contentEditable:!1,style:i,className:pe.et,children:n},o)}function st(e){const t=Ke(e);return ne.Z.renderToString((0,he.jsx)(i.Fragment,{children:t}))}function lt(e){const{textValue:t,highlightStyle:n,currentUserId:o,getRecordModel:r}=e;if(!n)return t;const i=[];return ue.lzi(t).forEach((e=>{if(ue.km_(e)){const t=[];for(const i of ue.hn0(e)){const e=ue.IWo(i)&&i[1]===o,a=(0,X.XP)({mentionAnnotation:i,currentUserId:o,getRecordModel:r});e||a?(t.push(i),"text_only"!==n&&t.push([ue.GKr.Highlight,"yellow_background"]),"background_only"!==n&&t.push([ue.GKr.Highlight,"yellow"])):t.push(i)}i.push([e[0],t])}else i.push(e)})),i}function ct(e){const{nextTokenContainsFindHighlight:t,previousTokenContainsFindHighlight:n,isSelectedMatch:o,theme:r}=e;return{backgroundColor:o?r.findHighlightMatch.selectedBackground:r.findHighlightMatch.unselectedBackground,color:o?"black":r.text.primary,outline:`2px solid ${o?r.findHighlightMatch.selectedBackground:r.findHighlightMatch.unselectedBackground}`,outlineOffset:-.5,borderTopLeftRadius:n?void 0:4,borderBottomLeftRadius:n?void 0:4,borderTopRightRadius:t?void 0:4,borderBottomRightRadius:t?void 0:4,borderBottom:"0px solid transparent"}}},116275:(e,t,n)=>{n.d(t,{DK:()=>i,DQ:()=>v,Eu:()=>r,FB:()=>a,GR:()=>f,Hg:()=>d,JQ:()=>S,Ko:()=>I,Kx:()=>y,Nz:()=>k,SJ:()=>m,U3:()=>h,et:()=>u,j:()=>x,kB:()=>p,mJ:()=>b,mb:()=>o,pC:()=>c,qp:()=>w,rs:()=>_,t4:()=>l,tL:()=>g,zd:()=>s});const o="notion-text-buffer",r="notion-text-mention-token",i="notion-text-line-break-token",a="notion-link-token",s="notion-page-mention-token",l="notion-page-mention-token__title",c="notion-custom-emoji-token",d="notion-external-object-token",u="notion-text-equation-token",p="notion-enable-hover",m="notion-focusable-token",g="notion-ignore-text-content",f="notion-temporary-input",h="\ufeff",v="​",y="notion-temporary-comment",b="notion-temporary-comment-selection",_="notion-citation-mention-token",S="data-citation-token-block-id",k="data-citation-token-universal-id",w="in-page-find-selected-highlight-match",x="temporary-dictation-annotation",I="notion-link-mention-token"},849772:(e,t,n)=>{n.d(t,{$b:()=>ge,$n:()=>Ie,BI:()=>xe,Dg:()=>bn,F7:()=>_n,FA:()=>O,GI:()=>E,IW:()=>We,J7:()=>hn,Je:()=>we,Jm:()=>k,K$:()=>Bt,LA:()=>re,Ly:()=>Lt,Mc:()=>s,OU:()=>Qt,Oj:()=>Ee,PM:()=>I,Pb:()=>Sn,QV:()=>fn,RP:()=>d,SR:()=>It,ST:()=>Xe,UW:()=>H,VO:()=>ot,X5:()=>ve,ZA:()=>ln,Ze:()=>K,_b:()=>yt,_q:()=>an,aC:()=>U,aL:()=>sn,aq:()=>Pt,eh:()=>G,fT:()=>b,f_:()=>ze,fp:()=>dt,ft:()=>he,gO:()=>yn,hr:()=>Ce,in:()=>Q,j0:()=>ee,jF:()=>Gt,ku:()=>pn,lo:()=>B,m1:()=>m,nS:()=>kt,ot:()=>Ne,p2:()=>P,pG:()=>ue,pV:()=>gt,qA:()=>Y,qD:()=>Ct,rI:()=>at,s8:()=>xt,t1:()=>h,u2:()=>_e,ug:()=>Ae,vu:()=>tn,wW:()=>Ke,wj:()=>Ht,xv:()=>jt,xw:()=>le});var o=n(531701),r=n(63811),i=n(212847),a=n(606287);const s={Bold:"b",Italic:"i",Strike:"s",Code:"c",FormulaError:"~",Underline:"_",Inserted:"+",Deleted:"-",TemporaryComment:"z",User:"u",Bot:"r",Page:"p",TemporaryPage:"pt",Date:"d",ExternalObjectInstance:"eoi",TemplateVariable:"tv",Comment:"cm",Group:"g",LinkMention:"lm",CustomEmoji:"ce",Citation:"ci",Discussion:"m",Link:"a",Highlight:"h",Equation:"e",TemporaryEquation:"et",TemporaryInput:"xt",TemporarySelection:"st",FormulaPageProperty:"fpp",FormulaContextValue:"fv",TemporaryFindHighlight:"mark",TemporarySelectedFindHighlight:"smark",TemporaryCursor:"tc",SuggestionInsertText:"si",SuggestionRemoveText:"sr",SuggestionAnnotate:"sa",SuggestionUnannotate:"sua",TemporaryHighlight:"ht",TemporaryNativeMABFilter:"mabf",TemporaryDictation:"dut",AssistantInstructionsCollection:"aic"},l=i.literal(s.Bold),c=i.tuple([l]);function d(e){return 1===e.length&&e[0]===s.Bold}const u=i.literal(s.Italic),p=i.tuple([u]);function m(e){return 1===e.length&&e[0]===s.Italic}const g=i.literal(s.Strike),f=i.tuple([g]);function h(e){return 1===e.length&&e[0]===s.Strike}const v=i.literal(s.Code),y=i.tuple([v]);function b(e){return 1===e.length&&e[0]===s.Code}const _=i.literal(s.FormulaError),S=i.tuple([_]);function k(e){return 1===e.length&&e[0]===s.FormulaError}const w=i.literal(s.Underline),x=i.tuple([w]);function I(e){return 1===e.length&&e[0]===s.Underline}const C=i.tuple([i.literal(s.Inserted),i.string()]);const T=i.literal(s.Inserted),M=i.union([i.tuple([T]),C]);function P(e){return e[0]===s.Inserted&&(1===e.length||2===e.length)}const A=i.tuple([i.literal(s.Deleted),i.string()]);const R=i.literal(s.Deleted),D=i.union([i.tuple([R]),A]);function B(e){return e[0]===s.Deleted&&(1===e.length||2===e.length)}function E(e){return function(e){return 2===e.length&&e[0]===s.Inserted}(e)||function(e){return 2===e.length&&e[0]===s.Deleted}(e)}const F=i.literal(s.TemporaryComment),Z=i.tuple([F]);function U(e){return 1===e.length&&e[0]===s.TemporaryComment}const V=i.literal(s.TemporarySelection),N=i.tuple([V]);function O(e){return 1===e.length&&e[0]===s.TemporarySelection}const L=i.literal(s.TemporaryFindHighlight),j=i.tuple([L]);function K(e){return 1===e.length&&e[0]===s.TemporaryFindHighlight}const z=i.literal(s.TemporarySelectedFindHighlight),q=i.tuple([z]);function H(e){return 1===e.length&&e[0]===s.TemporarySelectedFindHighlight}function G(e){return K(e)||H(e)}const W=i.literal(s.TemporaryCursor),$=i.tuple([W]);function Y(e){return 1===e.length&&e[0]===s.TemporaryCursor}function Q(e){const[t]=e;return 1===e.length&&e[0]!==s.TemporaryEquation&&e[0]!==s.TemporaryPage||(t===s.Bold||t===s.Italic||t===s.Strike||t===s.Underline||t===s.Inserted||t===s.Deleted||t===s.TemporaryComment||t===s.TemporarySelection||t===s.TemporaryCursor)}const J=i.literal(s.Link),X=i.tuple([J,i.union([i.string(),i.isUndefined()])]);function ee(e){return 2===e.length&&e[0]===s.Link}const te=i.literal(s.Highlight),ne=(0,r.Z$)((e=>null),"BlockColor"),oe=i.tuple([te,ne]);function re(e){return 2===e.length&&e[0]===s.Highlight}const ie=i.literal(s.Discussion),ae=i.string(),se=i.tuple([ie,ae]);function le(e){return 2===e.length&&e[0]===s.Discussion}const ce=i.literal(s.SuggestionInsertText),de=i.tuple([ce,ae]);function ue(e){return 2===e.length&&e[0]===s.SuggestionInsertText}const pe=i.literal(s.SuggestionRemoveText),me=i.tuple([pe,ae]);function ge(e){return 2===e.length&&e[0]===s.SuggestionRemoveText}const fe=i.union([c,p,f,y,x,X,oe]);function he(e){switch(e){case s.Bold:case s.Italic:case s.Strike:case s.Code:case s.Underline:case s.Link:case s.Highlight:return!0;default:return!1}}function ve(e){return!!(d(e)||m(e)||h(e)||b(e)||I(e)||ee(e)||re(e))}const ye=i.literal(s.SuggestionAnnotate),be=i.tuple([ye,ae,fe]);function _e(e){return 3===e.length&&e[0]===s.SuggestionAnnotate}const Se=i.literal(s.SuggestionUnannotate),ke=i.tuple([Se,ae,fe]);function we(e){return 3===e.length&&e[0]===s.SuggestionUnannotate}function xe(e){return!!(we(e)||_e(e)||ge(e)||ue(e))}function Ie(e){switch(e){case s.SuggestionInsertText:case s.SuggestionRemoveText:case s.SuggestionAnnotate:case s.SuggestionUnannotate:return!0;default:return!1}}function Ce(e){return!!xe(e)||!!le(e)}const Te=i.literal(s.TemporaryInput),Me=i.object({required:{prefix:i.string(),suffix:i.string(),completion:i.string(),prefixIcon:i.union([(0,r.Z$)((e=>null),"ReactNode"),i.isUndefined()])},optional:{}}),Pe=i.tuple([Te,Me]);function Ae(e){return 2===e.length&&e[0]===s.TemporaryInput}const Re=i.literal(s.TemporaryNativeMABFilter),De=i.object({required:{hint:i.string()},optional:{}}),Be=i.tuple([Re,De]);function Ee(e){return 2===e.length&&e[0]===s.TemporaryNativeMABFilter}const Fe=i.literal(s.TemporaryDictation),Ze=i.number(),Ue=i.string(),Ve=i.tuple([Fe,Ze,Ue]);function Ne(e){return 3===e.length&&e[0]===s.TemporaryDictation}const Oe=i.literal(s.TemporaryHighlight),Le=(0,r.Z$)((e=>null),"HexColor"),je=i.tuple([Oe,Le]);function Ke(e){return 2===e.length&&e[0]===s.TemporaryHighlight}function ze(e){return!!(Q(e)||ee(e)||le(e)||xe(e)||re(e)||Ae(e)||Ee(e)||Ne(e)||Ke(e))}const qe=i.literal(s.User),He=i.string(),Ge=i.tuple([qe,He]);function We(e){return 2===e.length&&e[0]===s.User}const $e=i.literal(s.Page),Ye=i.string(),Qe=i.string(),Je=i.union([i.tuple([$e,Ye]),i.tuple([$e,Ye,Qe])]);function Xe(e){return(2===e.length||3===e.length)&&e[0]===s.Page}const et=i.literal(s.CustomEmoji),tt=i.uuid(),nt=i.tuple([et,tt,Qe]);function ot(e){return 3===e.length&&e[0]===s.CustomEmoji}const rt=i.literal(s.TemporaryPage),it=i.tuple([rt]);function at(e){return 1===e.length&&e[0]===s.TemporaryPage}const st=i.literal(s.Date),lt=(0,r.Z$)((e=>null),"DateAnnotationData"),ct=i.tuple([st,lt]);function dt(e){return 2===e.length&&e[0]===s.Date}const ut=i.literal(s.Bot),pt=i.string(),mt=i.tuple([ut,pt]);function gt(e){return 2===e.length&&e[0]===s.Bot}const ft=i.literal(s.Group),ht=i.string(),vt=i.tuple([ft,ht,Qe]);function yt(e){return 3===e.length&&e[0]===s.Group}const bt=i.literal(s.ExternalObjectInstance),_t=i.string(),St=i.tuple([bt,_t]);function kt(e){return 2===e.length&&e[0]===s.ExternalObjectInstance}const wt=i.literal(s.TemplateVariable),xt=["me"],It=[...xt,"now","today"],Ct=i.union(It.map(i.literal)),Tt=i.object({required:{type:Ct},optional:{}}),Mt=i.tuple([wt,Tt]);function Pt(e){return 2===e.length&&e[0]===s.TemplateVariable}const At=i.literal(s.Comment),Rt=i.string(),Dt=i.tuple([At,Rt,Qe]);function Bt(e){return 3===e.length&&e[0]===s.Comment}const Et=i.literal(s.FormulaPageProperty),Ft=i.object({required:{table:i.literal(a.vF),id:i.string()},optional:{spaceId:i.string()}}),Zt=(0,r.Z$)((e=>i.string().validator(e)),"SerializedContextValueId"),Ut=i.object({required:{contextValueId:Zt,property:i.string(),valueSnapshot:i.union([i.literal("current"),i.string()])},optional:{name:i.string()}}),Vt=i.object({required:{property:i.string()},optional:{collection:Ft,name:i.string()}}),Nt=i.union([Vt,Ut]),Ot=i.tuple([Et,Nt]);function Lt(e){return 2===e.length&&e[0]===s.FormulaPageProperty}function jt(e){const t="contextValueId"in e&&e.contextValueId,n="property"in e&&e.property,o="valueSnapshot"in e&&e.valueSnapshot;return!!(t&&n&&o)||!!n}const Kt=i.literal(s.FormulaContextValue),zt=(0,r.Z$)((e=>null),"FormulaContextValueMentionAnnotationData"),qt=i.tuple([Kt,zt]);function Ht(e){return 2===e.length&&e[0]===s.FormulaContextValue}function Gt(e){return Lt(e)||Ht(e)}const Wt=i.literal(s.Citation),$t=i.union([i.object({required:{href:i.string(),number:i.number(),blockId:i.union([i.string(),i.isUndefined()]),type:i.union([i.literal("block"),i.isUndefined()])},optional:{}}),i.object({required:{href:i.string(),number:i.number(),type:i.literal("url")},optional:{}}),i.object({required:{href:i.string(),number:i.number(),type:i.literal("google-drive"),messageId:i.string(),url:i.string()},optional:{}}),i.object({required:{href:i.string(),number:i.number(),type:i.literal("helpdoc"),messageId:i.string(),url:i.string()},optional:{}}),i.object({required:{type:i.literal("query_database_result"),number:i.number(),href:i.string(),queryDatabaseResultId:i.string()},optional:{}}),i.object({required:{href:i.string(),number:i.number(),type:i.literal("slack"),domain:i.union([i.string(),i.isUndefined()]),baseUrl:i.union([i.string(),i.isUndefined()]),channelId:i.string(),messageId:i.string(),threadTs:i.union([i.string(),i.isUndefined()])},optional:{}}),i.object({required:{href:i.string(),number:i.number(),type:i.literal("github"),messageId:i.string(),url:i.string()},optional:{}})]),Yt=i.tuple([Wt,$t]);function Qt(e){return 2===e.length&&e[0]===s.Citation}const Jt=i.literal(s.LinkMention),Xt=i.object({required:{href:i.string()},optional:{title:i.string(),description:i.string(),link_author:i.string(),link_provider:i.string(),thumbnail_url:i.string(),icon_url:i.string(),iframe_url:i.string(),height:i.number(),padding:i.number(),padding_top:i.number()}}),en=i.tuple([Jt,Xt]);function tn(e){return 2===e.length&&e[0]===s.LinkMention}const nn=i.literal(s.AssistantInstructionsCollection),on=i.string(),rn=i.union([i.tuple([nn,on]),i.tuple([nn,on,Qe])]);function an(e){return(2===e.length||3===e.length)&&e[0]===s.AssistantInstructionsCollection}const sn={[s.User]:!0,[s.Bot]:!0,[s.Page]:!0,[s.TemporaryPage]:!0,[s.Date]:!0,[s.ExternalObjectInstance]:!0,[s.TemplateVariable]:!0,[s.Comment]:!0,[s.Group]:!0,[s.FormulaPageProperty]:!0,[s.FormulaContextValue]:!0,[s.Citation]:!0,[s.LinkMention]:!0,[s.AssistantInstructionsCollection]:!0,[s.CustomEmoji]:!0};function ln(e){return!!(We(e)||Xe(e)||at(e)||gt(e)||kt(e)||dt(e)||yt(e)||Pt(e)||Bt(e)||Gt(e)||Qt(e)||tn(e)||an(e)||ot(e))}const cn=i.string(),dn=i.literal(s.Equation),un=i.tuple([dn,cn]);function pn(e){return 2===e.length&&e[0]===s.Equation}const mn=i.literal(s.TemporaryEquation),gn=i.tuple([mn]);function fn(e){return 1===e.length&&e[0]===s.TemporaryEquation}function hn(e){return e[0]}const vn={[s.Bold]:{validatorType:c},[s.Italic]:{validatorType:p},[s.Strike]:{validatorType:f},[s.Code]:{validatorType:y},[s.FormulaError]:{validatorType:S},[s.Underline]:{validatorType:x},[s.Inserted]:{validatorType:M},[s.Deleted]:{validatorType:D},[s.TemporaryComment]:{validatorType:Z,isTemporary:!0},[s.TemporarySelection]:{validatorType:N,isTemporary:!0},[s.TemporaryFindHighlight]:{validatorType:j,isTemporary:!0},[s.TemporarySelectedFindHighlight]:{validatorType:q,isTemporary:!0},[s.TemporaryCursor]:{validatorType:$,isTemporary:!0},[s.Link]:{validatorType:X},[s.Highlight]:{validatorType:oe},[s.Discussion]:{validatorType:se,isMultiInstance:!0},[s.SuggestionInsertText]:{validatorType:de},[s.SuggestionRemoveText]:{validatorType:me,isMultiInstance:!0},[s.SuggestionAnnotate]:{validatorType:be,isMultiInstance:!0},[s.SuggestionUnannotate]:{validatorType:ke,isMultiInstance:!0},[s.TemporaryInput]:{validatorType:Pe,isTemporary:!0},[s.TemporaryNativeMABFilter]:{validatorType:Be,isTemporary:!0},[s.TemporaryDictation]:{validatorType:Ve,isTemporary:!0},[s.TemporaryHighlight]:{validatorType:je,isTemporary:!0},[s.User]:{validatorType:Ge},[s.Page]:{validatorType:Je},[s.CustomEmoji]:{validatorType:nt},[s.TemporaryPage]:{validatorType:it,isTemporary:!0},[s.Date]:{validatorType:ct},[s.Bot]:{validatorType:mt},[s.Group]:{validatorType:vt},[s.ExternalObjectInstance]:{validatorType:St},[s.TemplateVariable]:{validatorType:Mt},[s.Comment]:{validatorType:Dt},[s.FormulaPageProperty]:{validatorType:Ot},[s.FormulaContextValue]:{validatorType:qt},[s.Citation]:{validatorType:Yt},[s.LinkMention]:{validatorType:en},[s.AssistantInstructionsCollection]:{validatorType:rn},[s.Equation]:{validatorType:un},[s.TemporaryEquation]:{validatorType:gn,isTemporary:!0}};function yn(e){if(e[0]===s.Highlight){const t=e[1];return o.E_.includes(t)&&(0,o.jS)(t)?"hb":"hf"}return e[0]}function bn(e){switch(e){case"hb":case"hf":return"h";default:return e}}function _n(e){return"h"===e?["hf","hb"]:[e]}function Sn(e){return function(e){const t=vn[e];if(t&&"isMultiInstance"in t&&t.isMultiInstance)return!0;return!1}(hn(e))}},463332:(e,t,n)=>{n.d(t,{KV:()=>p,U$:()=>m,XV:()=>h,Z0:()=>g,i6:()=>f,x5:()=>u});var o=n(401898),r=n(253877),i=n(158573),a=n(842875),s=n(733653),l=n(421838),c=n(849772);const d={now:{text:s.o.nowText,description:s.o.nowDescription,fuzzySearchKeywords:s.o.nowKeywords,category:"date",resolve:e=>{const t=r.R_(e.currentTimeZone||(0,a.r)());return l.pZr({...t,date_format:"relative"})}},today:{text:s.o.todayText,description:s.o.todayDescription,fuzzySearchKeywords:s.o.todayKeywords,category:"date",resolve:e=>{const t=r.Lg(e.currentTimeZone||(0,a.r)());return l.pZr({...t,date_format:"relative"})}},me:{text:s.o.meText,description:s.o.meDescription,fuzzySearchKeywords:s.o.meKeywords,category:"user",resolve:e=>e.currentUserId?l.tEo(e.currentUserId):void 0}};function u(e,t){const n=l.fsE(e);return d[n.type].resolve(t)}function p(e,t){return e?e.map((e=>function(e,t){const n=l.hDy(e).map((e=>(0,c.aq)(e)?u(e,t):e)).filter(o.$K);return l.V3y(l.WiV(e),n)}(e,t))):[]}function m(e,t){return t.formatMessage(d[e].text)}function g(e,t){return t.formatMessage(d[e].description)}function f(e,t){return d[e].category===t}function h(e,t){return(0,i.ZP)(e,Object.entries(d),(e=>{let[n,o]=e;return t.formatMessage(o.fuzzySearchKeywords)})).map((e=>{let[t,n]=e;return t}))}},249902:(e,t,n)=>{n.d(t,{j:()=>l,kI:()=>s});n(757658);var o=n(667294),r=n(966673),i=n(265454);let a=!1;function s(e){let{isEnabled:t,isLoggedIn:n,userId:s,userEmail:c,spaceId:d,sprigConfig:u,userDaysSinceSignup:p,daysSinceSpaceCreated:m,userDomainType:g,isSpaceAdmin:f,spaceMemberCount:h}=e;(0,o.useEffect)((()=>{if(a=t,!t||!n||void 0===s||void 0===c||void 0===u||void 0===g)return;if(window.Sprig)return;const e=function(){e._queue.push(arguments)};e._queue=[],e.appId=u.environmentId,window.Sprig=e,window.UserLeap=e,window.Sprig("setUserId",s),window.Sprig("setEmail",c),d&&window.Sprig("setAttribute","SPACE_ID",d),h&&window.Sprig("setAttribute","SPACE_MEMBER_COUNT",h),m&&window.Sprig("setAttribute","DAYS_SINCE_SPACE_CREATED",m),window.Sprig("setAttribute","DAYS_SINCE_USER_SIGNUP",p),window.Sprig("setAttribute","USER_DOMAIN_TYPE",g),window.Sprig("setAttribute","IS_SPACE_ADMIN",f),p>=3&&p<=14&&"professional"===g&&l(f?{name:"trigger-phase-1"}:{name:"trigger-phase-1-1"}),(0,i.ZP)("https://cdn.sprig.com/shim.js")}),[t,n,s,u,c,d,f,g,p,m,h]);const v=(0,r.D9)(n);(0,o.useEffect)((()=>{v&&!n&&window.Sprig&&window.Sprig("logoutUser")}),[v,n])}function l(e){const t=e.name;if(!window.Sprig)return void(a&&console.error("Sprig not loaded, not tracking: ",t));const n="args"in e?e.args:{};window.Sprig("track",t,n)}},380503:(e,t,n)=>{n.d(t,{Aj:()=>i,Pv:()=>u,R6:()=>c,TT:()=>r,br:()=>s,u3:()=>d});var o=n(840654);const r=52,i=45,a=44,s=44,l=30;function c(e){return e?s:a}function d(e){return 2*c(e)}function u(e,t,n){return(e&&!t?(0,o.XW)(n):12)+l}},509163:(e,t,n)=>{n.d(t,{FW:()=>r,eU:()=>o,lR:()=>i});const o={"sprints-onboarding":{steps:[{id:"current-sprint-view-tooltip"},{id:"sprint-task-tooltip"},{id:"complete-sprint-button-tooltip"}]},"enhanced-qna-onboarding":{steps:[{id:"find-in-tooltip"},{id:"mention-tooltip"}]},"jira-sync-onboarding":{steps:[{id:"all-projects-tooltip"},{id:"all-issues-tooltip"},{id:"database-views-and-filters-tooltip"},{id:"settings-to-setup-projects-and-issues"}]},"project-management-import-onboarding":{steps:[{id:"your-teamspace-tooltip"},{id:"all-projects-tooltip"},{id:"navigate-to-project-tasks-tooltip"},{id:"project-customization-tooltip"},{id:"related-tasks-database-views-tooltip"}]}},r="completed",i="dismissed"},544876:(e,t,n)=>{n.d(t,{AM:()=>T,Ah:()=>H,An:()=>f,E4:()=>b,Ej:()=>K,GY:()=>q,Gc:()=>C,Gm:()=>j,Id:()=>g,Jq:()=>h,O0:()=>I,OM:()=>w,Tf:()=>B,U4:()=>O,U5:()=>N,Wj:()=>k,XR:()=>R,_X:()=>Z,fl:()=>L,hW:()=>v,km:()=>_,kz:()=>M,l1:()=>y,li:()=>S,no:()=>x,ny:()=>A,tz:()=>z,wh:()=>m});var o=n(730120),r=n(653965),i=n(401898),a=n(218265),s=n(640506),l=n(253877),c=n(484795),d=n(159730),u=n(474181),p=n(509844);const m=10;function g(e){return"inline"===e.type&&e.values.length>=1&&"string"==typeof e.values[0]}function f(e){return"inline"===e.type&&e.values.length>=1&&"number"==typeof e.values[0]}function h(e){return"inline"===e.type&&e.values.length>=1&&"boolean"==typeof e.values[0]}function v(e){return"inline"===e.type&&e.values.length>=1&&y(e.values[0])}const y=(0,i.AO)((e=>"object"==typeof e&&"r"in e?{true:e}:{false:e}));function b(e){var t,n;return g(e)&&("enum"===(null===(t=e.format)||void 0===t?void 0:t.type)||"title"===(null===(n=e.format)||void 0===n?void 0:n.type))}function _(e){return"embed"===e.type&&e.values.length>=1}function S(e){return"embed"===e.type&&e.values.length>=1&&"image/*"===e.mimeType}function k(e){if(!_(e))return!1;const t=e.format;return!(!t||!("type"in t))&&"icon"===t.type}function w(e){return"relation"===e.type}function x(e){return"person"===e.type}function I(e){var t;return"inline"===e.type&&e.values.length>=1&&"string"==typeof e.values[0]&&"code"===(null===(t=e.format)||void 0===t?void 0:t.type)}function C(e){return"inline"===e.type&&s.U3(e.values[0])}function T(e){return"inline"===e.type}function M(e){var t;return"rich_text"===(null==e||null===(t=e.format)||void 0===t?void 0:t.type)}function P(e){const{integration:t,currentSpaceId:n}=e,o=t.info.original_url_domains??[],r=t.info.development_url_domains??[];return(0,p.ov)(n,t)?[...o,...r]:o}function A(e){const{url:t,integrations:n,currentSpaceId:o}=e,r=D(t);if(!r)return{type:"failure"};let s,l;for(const a of n){const e=P({integration:a,currentSpaceId:o});for(const n of a.info.original_url_patterns||[]){const o=R({url:t,domains:e,regex:new RegExp(n.regex)});if("invalid_url"===o.type)break;if("url_does_not_match_domain"===o.type)break;if("url_does_not_match_regex"!==o.type){if("success"===o.type){s=a,l=n;break}(0,i.t1)(o)}else s=a}if(s&&l)break}return l&&s?{type:"success",integration:s,pattern:l}:s?{type:"partial",integration:s,urlDomain:r,parsedUrl:(0,a.Qc)(t)}:{type:"failure"}}function R(e){const{url:t,domains:n,regex:o}=e,r=D(t);return r?n.find((e=>e===r))?o.test(t)?{type:"success"}:{type:"url_does_not_match_regex"}:{type:"url_does_not_match_domain"}:{type:"invalid_url"}}function D(e){var t;const n=null===(t=(0,a.Qc)(e).hostname)||void 0===t?void 0:t.split(".");return n&&n.length>=2?n.slice(n.length-2).join("."):void 0}function B(e){const{url:t,integration:n}=e;if(!(n&&(0,u.VM)(n)&&n.info&&n.info.original_url_patterns))return[];const o=n.info.original_url_patterns.find((e=>{let{regex:n}=e;return new RegExp(n).test(t)}));if(o){const e=new RegExp(o.regex);return r.oA([...(o.attributes||[]).map((n=>function(e,t,n){return g(n)||_(n)?{...n,values:n.values.map((n=>t.replace(e,n)))}:n}(e,t,n)))])}return[]}function E(e){return Array.isArray(e)?e:[e]}function F(e){return 1===e.length?e[0]:e}const Z=(0,i.AO)((e=>"avatar"===e||"identifier"===e||"title"===e||"primary"===e||"secondary"===e||"body"===e||void 0===e?{true:e}:{false:e})),U=(0,i.AO)((e=>"avatar"===e||"identifier"===e||"primary"===e||"secondary"===e||"body"===e||void 0===e?{true:e}:{false:e})),V=(0,i.AO)((e=>"primary"===e||void 0===e?{true:e}:{false:e})),N=(0,i.AO)((e=>void 0===e?{true:e}:{false:e})),O=(0,i.AO)((e=>void 0===e?{true:e}:{false:e})),L=(0,i.AO)((e=>"entity"===e||"background"===e||void 0===e?{true:e}:{false:e})),j=(0,i.AO)((e=>"primary"===e||"secondary"===e||void 0===e?{true:e}:{false:e})),K=(0,i.AO)((e=>"avatar"===e||"entity"===e||"embed"===e||void 0===e?{true:e}:{false:e})),z=(0,i.AO)((e=>"embed"===e||void 0===e?{true:e}:{false:e}));function q(e){const{id:t,name:n}=e,o={id:t,name:n};if("inline"in e){const t="inline";if("rich_text"in e.inline)return new d.p8("Rich text not supported here");if("plain_text"in e.inline)return{...o,type:t,values:E(e.inline.plain_text.value),...e.inline.plain_text.section&&{format:{section:e.inline.plain_text.section}}};if("code"in e.inline)return{...o,type:t,values:E(e.inline.code.value),format:{type:"code",section:e.inline.code.section,language:e.inline.code.language}};if("boolean"in e.inline)return{...o,type:t,values:E(e.inline.boolean.value)};if("number"in e.inline)return{...o,type:t,values:E(e.inline.number.value)};if("title"in e.inline)return{...o,type:t,values:E(e.inline.title.value),format:{type:"title",...e.inline.title.color&&{color:e.inline.title.color},section:"title"}};if("enum"in e.inline)return{...o,type:t,values:E(e.inline.enum.value),format:{type:"enum",...e.inline.enum.color&&{color:e.inline.enum.color},...e.inline.enum.section&&{section:e.inline.enum.section}}};if("color"in e.inline)return{...o,type:t,values:E(e.inline.color.value),...e.inline.color.section&&{format:{section:e.inline.color.section}}};if("date"in e.inline){const n=E(e.inline.date.value).map(c.jV);return n.every(s.J_)?{...o,type:t,values:n,...e.inline.date.section&&{format:{section:e.inline.date.section}}}:new d.p8("Invalid date value.")}if("datetime"in e.inline){const n=E(e.inline.datetime.value).map(c.iZ);return n.every(s.v9)?{...o,type:t,values:n,...e.inline.datetime.section&&{format:{section:e.inline.datetime.section}}}:new d.p8("Invalid datetime value.")}if("datetimerange"in e.inline){if(e.inline.datetimerange.value.length<2)return new d.p8("Invalidate datetimerange value.");const[n,r]=e.inline.datetimerange.value,i=(0,c.CR)(n,r);return s.qg(i)?{...o,type:t,values:[i],...e.inline.datetimerange.section&&{format:{section:e.inline.datetimerange.section}}}:new d.p8("Invalid datetimerange value.")}if("created_datetime"in e.inline){const n=E(e.inline.created_datetime.value).map(c.iZ);return n.every(s.v9)?{...o,type:t,values:n,format:{type:"created_time",...e.inline.created_datetime.section&&{section:e.inline.created_datetime.section}}}:new d.p8("Invalid created_datetime value.")}if("last_edited_datetime"in e.inline){const n=E(e.inline.last_edited_datetime.value).map(c.iZ);return n.every(s.v9)?{...o,type:t,values:n,format:{type:"last_edited_time",...e.inline.last_edited_datetime.section&&{section:e.inline.last_edited_datetime.section}}}:new d.p8("Invalid last_edited_datetime value.")}(0,i.t1)(e.inline)}else if("embed"in e){const t={};e.embed.default_height&&(t.defaultHeight=e.embed.default_height),e.embed.default_width&&(t.defaultWidth=e.embed.default_width);const n="embed";if("html"in e.embed)return{...o,type:n,values:E(e.embed.src_url),mimeType:"text/html",...e.embed.html.section&&{format:{section:e.embed.html.section,...t}}};if("image"in e.embed)return{...o,type:n,values:E(e.embed.src_url),mimeType:"image/*",format:{...e.embed.image.format&&{type:e.embed.image.format},...t,...e.embed.image.section&&{section:e.embed.image.section}}};if("audio"in e.embed)return{...o,type:n,values:E(e.embed.src_url),mimeType:"audio/*",...e.embed.audio.section&&{format:{section:e.embed.audio.section,...t}}};if("video"in e.embed)return{...o,type:n,values:E(e.embed.src_url),mimeType:"video/*",...e.embed.video.section&&{format:{section:e.embed.video.section,...t}}};if("pdf"in e.embed)return{...o,type:n,values:E(e.embed.src_url),mimeType:"application/pdf",...e.embed.pdf.section&&{format:{section:e.embed.pdf.section,...t}}};(0,i.t1)(e.embed)}else{if("relation"in e){const t="relation";return e.relation.extension?{...o,type:t,values:E(e.relation.uri),format:{type:"extension",extension:e.relation.extension}}:e.relation.mention?{...o,type:t,values:E(e.relation.uri),format:{type:"mention",section:null===(r=e.relation.mention)||void 0===r?void 0:r.section}}:{...o,type:t,values:E(e.relation.uri)};var r}if("people"in e)return{...o,type:"person",values:E(e.people.uri)};(0,i.t1)(e)}}function H(e){const{id:t,name:n}=e,o={id:t,name:n};if(T(e)){var r,a,l,c,d,u,p,m,y;if(g(e))return"title"===(null===(r=e.format)||void 0===r?void 0:r.type)?{...o,type:"inline",inline:{title:{value:e.values[0],..."title"===(null===(l=e.format)||void 0===l?void 0:l.section)&&{section:"title"}}}}:"enum"===(null===(a=e.format)||void 0===a?void 0:a.type)?{...o,type:"inline",inline:{enum:{value:F(e.values),...(null===(c=e.format)||void 0===c?void 0:c.section)&&V(e.format.section)&&{section:e.format.section}}}}:{...o,type:"inline",inline:{plain_text:{value:F(e.values),...(null===(d=e.format)||void 0===d?void 0:d.section)&&U(e.format.section)&&{section:e.format.section}}}};if(h(e))return{...o,type:"inline",inline:{boolean:{value:F(e.values)}}};if(f(e))return{...o,type:"inline",inline:{number:{value:F(e.values)}}};if(v(e))return{...o,type:"inline",inline:{color:{value:F(e.values),...(null===(u=e.format)||void 0===u?void 0:u.section)&&{section:e.format.section}}}};if(function(e){return"inline"===e.type&&s.U3(e.values[0])&&s.J_(e.values[0])}(e)){var b;const t=e.values.map((e=>{let{start_date:t}=e;return t}));return{...o,type:"inline",inline:{date:{value:F(t),...(null===(b=e.format)||void 0===b?void 0:b.section)&&{section:e.format.section}}}}}if(function(e){return"inline"===e.type&&s.U3(e.values[0])&&s.v9(e.values[0])}(e)){var _,S;const t=e.values.map((e=>{let{start_date:t,start_time:n,time_zone:o}=e;return G({date:t,time:n,timeZone:o})}));var k,w,x;return"created_time"===(null===(_=e.format)||void 0===_?void 0:_.type)?{...o,type:"inline",inline:{created_datetime:{value:t[0],...(null===(k=e.format)||void 0===k?void 0:k.section)&&{section:e.format.section}}}}:"last_edited_time"===(null===(S=e.format)||void 0===S?void 0:S.type)?{...o,type:"inline",inline:{last_edited_datetime:{value:t[0],...(null===(w=e.format)||void 0===w?void 0:w.section)&&{section:e.format.section}}}}:{...o,type:"inline",inline:{datetime:{value:F(t),...(null===(x=e.format)||void 0===x?void 0:x.section)&&{section:e.format.section}}}}}if(function(e){return"inline"===e.type&&s.U3(e.values[0])&&s.qg(e.values[0])&&s.U3(e.values[1])&&s.qg(e.values[1])}(e)){var C;const{start_date:t,start_time:n,end_date:r,end_time:i,time_zone:a}=e.values[0],s=[G({date:t,time:n,timeZone:a}),G({date:r,time:i,timeZone:a})];return{...o,type:"inline",inline:{datetimerange:{value:s,...(null===(C=e.format)||void 0===C?void 0:C.section)&&{section:e.format.section}}}}}if(I(e))return{...o,type:"inline",inline:{code:{value:F(e.values)[0],language:null===(p=e.format)||void 0===p?void 0:p.language,...(null===(m=e.format)||void 0===m?void 0:m.section)&&{section:e.format.section}}}};if(M(e))return{...o,type:"inline",inline:{rich_text:{value:[],...(null===(y=e.format)||void 0===y?void 0:y.section)&&{section:e.format.section}}}};(0,i.t1)(e)}else if("embed"===e.type){var P,A,R,D,B,E;if("image/*"===e.mimeType)return{...o,type:"embed",embed:{src_url:e.values[0],image:{...(null===(P=e.format)||void 0===P?void 0:P.type)&&{format:e.format.type},...(null===(A=e.format)||void 0===A?void 0:A.section)&&{section:e.format.section}}}};if("video/*"===e.mimeType)return{...o,type:"embed",embed:{src_url:e.values[0],video:{...(null===(R=e.format)||void 0===R?void 0:R.section)&&{section:e.format.section}}}};if("audio/*"===e.mimeType)return{...o,type:"embed",embed:{src_url:e.values[0],audio:{...(null===(D=e.format)||void 0===D?void 0:D.section)&&{section:e.format.section}}}};if("application/pdf"===e.mimeType)return{...o,type:"embed",embed:{src_url:e.values[0],pdf:{...(null===(B=e.format)||void 0===B?void 0:B.section)&&{section:e.format.section}}}};if("text/html"===e.mimeType)return{...o,type:"embed",embed:{src_url:e.values[0],html:{...(null===(E=e.format)||void 0===E?void 0:E.section)&&{section:e.format.section}}}};(0,i.t1)(e)}else{var Z,N,O,L;if("relation"===e.type)return"extension"===(null===(Z=e.format)||void 0===Z?void 0:Z.type)?{...o,type:"relation",relation:{uri:F(e.values),type:"extension",...(null===(O=e.format)||void 0===O?void 0:O.extension)&&{extension:e.format.extension}}}:"mention"===(null===(N=e.format)||void 0===N?void 0:N.type)?{...o,type:"relation",relation:{uri:F(e.values),type:"mention",...(null===(L=e.format)||void 0===L?void 0:L.section)&&{section:e.format.section}}}:{...o,type:"relation",relation:{uri:F(e.values)}};if("person"===e.type)return{...o,type:"people",people:{uri:F(e.values)}};(0,i.t1)(e)}}function G(e){const{date:t,time:n,timeZone:r}=e;return o.ou.fromFormat(`${t} ${n}`,`${l.Iq} ${s.jK}`,{zone:r}).toISO()}},307928:(e,t,n)=>{n.d(t,{Nz:()=>a,of:()=>s});var o=n(653965),r=n(959753),i=n(519889);function a(e,t,n){if(t){return r.kk5.fromValue(i.KJ,t).getDisplayName(e,n)}return e.formatMessage(r.T_T.messages.anonymousPlaceholder)}function s(e){return o.oA([e.name,e.email]).join(" ")}},841641:(e,t,n)=>{function o(e){return![".","#","$","[","]"].map((t=>-1!==e.indexOf(t))).reduce(((e,t)=>e||t),!1)}n.d(t,{Z:()=>o})},182798:(e,t,n)=>{n.d(t,{Fb:()=>s,R9:()=>l,T:()=>r,TO:()=>i,m7:()=>a});var o=n(159730);function r(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o.p8;if(!e)throw new r(t??"Expected condition to be true",n?{data:n}:{});return e}function i(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o.p8;if(null==e)throw new r(t??`Expected to exist: ${e}`,n?{data:n}:{});return e}function a(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o.p8;if(null!=e)throw new r(t??`Expected to not exist: ${e}`,n?{data:n}:{});return e}function s(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o.p8;if(!t(e))throw new r("Unexpected type",n?{data:n}:{});return e}function l(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o.p8;if(!(e instanceof t))throw new r("Unexpected type",n?{data:n}:{});return e}},604308:(e,t,n)=>{n.d(t,{A3:()=>m,WN:()=>l,X3:()=>f,Xs:()=>a,fm:()=>c,kY:()=>d,z5:()=>u,zz:()=>s});n(21703);var o=n(730120),r=n(709291),i=n(253877);const a=[90,30,7],s=["verified","expired","none"];function l(e){if(!e)return{type:"none"};const[t,n]=e,r=i.XI(n);return r?i.qw(r)?function(e){return e.end.valueOf()<=o.ou.now().valueOf()}(r)?{type:"expired",actorPointer:t,dateTimeRange:r}:{type:"verified",actorPointer:t,isIndefinite:!1,dateTimeRange:r}:{type:"verified",actorPointer:t,isIndefinite:!0,startDateTime:r.start}:{type:"none"}}function c(e){return e.end.diff(e.start,"days").days}function d(e){return o.ou.min(e,o.ou.now()).toRelative()}function u(e,t){if(e<0)throw new Error("negative number of days");if(!isFinite(e))throw new Error("non-finite number of days");const n=t.plus({days:e}).startOf("day");return{start:t,end:n}}const p=(0,r.defineMessages)({verified:{defaultMessage:"Verified",id:"verificationHelpers.verified"},expired:{defaultMessage:"Expired",id:"verificationHelpers.expired"},none:{defaultMessage:"Empty",id:"verificationHelpers.empty"}});function m(e){return p[e]}const g=(0,r.defineMessages)({verifiedIndefinitely:{defaultMessage:"Verified by {actor} indefinitely",id:"verificationHelpers.verifiedIndefinitely"},verifiedUntil:{defaultMessage:"Verified by {actor} until {datetime}",id:"verificationHelpers.verifiedUntil"}}),f={...p,...g}},573123:(e,t,n)=>{n.d(t,{Fi:()=>p,Hz:()=>i,Rh:()=>s,Zj:()=>c,aT:()=>g,ez:()=>a,hx:()=>m,xX:()=>l,y3:()=>u,yM:()=>d});var o=n(709291),r=n(401898);n(619584);const i=["last_7_days","last_28_days","last_90_days","all_time"];const a={last_7_days:7,last_28_days:28,last_90_days:90},s=((0,r.AO)((e=>7===e||28===e||90===e?{true:e}:{false:e})),(0,o.defineMessages)({last_7_days:{id:"spaceAnalyticsUserTab.dateFilter.last7days",defaultMessage:"Last 7 Days"},last_28_days:{id:"spaceAnalyticsUserTab.dateFilter.last28days",defaultMessage:"Last 28 Days"},last_90_days:{id:"spaceAnalyticsUserTab.dateFilter.last90days",defaultMessage:"Last 90 Days"},all_time:{id:"spaceAnalyticsUserTab.dateFilter.allTime",defaultMessage:"All Time"}})),l=(0,o.defineMessages)({last_7_days:{id:"spaceAnalyticsUserTab.dateFilter.lowercase.last7days",defaultMessage:"last 7 days"},last_28_days:{id:"spaceAnalyticsUserTab.dateFilter.lowercase.last28days",defaultMessage:"last 28 days"},last_90_days:{id:"spaceAnalyticsUserTab.dateFilter.lowercase.last90days",defaultMessage:"last 90 days"},all_time:{id:"spaceAnalyticsUserTab.dateFilter.lowercase.allTime",defaultMessage:"all time"}});function c(e,t,n){const o=e||0,r=t||0;return n?o-r:r-o}function d(e,t,n){const o=e||-1,r=t||-1;return n?o-r:r-o}const u=(0,o.defineMessages)({page:{id:"contentAnalyticsHeaderMessages.columnHeader.page",defaultMessage:"Page"},pageId:{id:"contentAnalyticsHeaderMessages.columnHeader.pageId",defaultMessage:"Page ID"},teams:{id:"contentAnalyticsHeaderMessages.columnHeader.teamspace",defaultMessage:"Teamspace"},audience:{id:"contentAnalyticsHeaderMessages.columnHeader.audience",defaultMessage:"Audience"},allViews:{id:"contentAnalyticsHeaderMessages.columnHeader.allViews",defaultMessage:"All views"},uniqueViews:{id:"contentAnalyticsHeaderMessages.columnHeader.uniqueViews",defaultMessage:"Unique views"},createdBy:{id:"contentAnalyticsHeaderMessages.columnHeader.createdBy",defaultMessage:"Created by"},createdAt:{id:"contentAnalyticsHeaderMessages.columnHeader.createdAt",defaultMessage:"Created at"},lastEditedBy:{id:"contentAnalyticsHeaderMessages.columnHeader.lastEditedBy",defaultMessage:"Last edited by"},lastEditedAt:{id:"contentAnalyticsHeaderMessages.columnHeader.lastEditedAt",defaultMessage:"Last edited at"}});const p={num_searches:"numSearches",num_unique_users:"numUniqueUsers",ctr:"ctr"},m={numSearches:"num_searches",numUniqueUsers:"num_unique_users",ctr:"ctr"};function g(e){return e<=1?"1":e<=50?"2-50":e<=100?"51-100":e<=500?"101-500":e<=1e3?"501-1000":e<=5e3?"1001-5000":"5001-plus"}},151454:(e,t,n)=>{n.d(t,{A_:()=>O,Bh:()=>K,D_:()=>l,Dy:()=>G,E:()=>te,Eo:()=>Z,Gt:()=>x,I5:()=>m,I8:()=>$,IK:()=>y,LI:()=>N,LN:()=>_,LX:()=>J,MC:()=>f,Mo:()=>F,Nm:()=>R,Nn:()=>E,O9:()=>u,Qm:()=>a,RJ:()=>v,S1:()=>D,VT:()=>h,Wd:()=>ee,Wi:()=>o,XB:()=>L,XP:()=>r,Y6:()=>U,YO:()=>j,_:()=>X,_Y:()=>C,ag:()=>oe,bF:()=>P,eU:()=>s,eu:()=>B,fQ:()=>I,hT:()=>q,hc:()=>A,iO:()=>b,jM:()=>W,ke:()=>re,l6:()=>i,lB:()=>H,lI:()=>V,mJ:()=>Y,mK:()=>w,nD:()=>c,ov:()=>S,p8:()=>ne,py:()=>p,sL:()=>M,t8:()=>k,u8:()=>Q,uB:()=>ie,vt:()=>z,wx:()=>g,xP:()=>d,y:()=>T});const o=1,r=2,i=2,a=2,s=3,l=9,c=9,d=30,u=80,p=81,m=83,g=83,f=84,h=85,v=85,y=85,b=86,_=85,S=85,k=85,w=86,x=86,I=86,C=86,T=86,M=h+2,P=h+2,A=h+2,R=88,D=88,B=89,E=99,F=99,Z=99,U=99,V=100,N=100,O=101,L=102,j=109,K=110,z=111,q=111,H=113,G=200,W=105,$=201,Y=999,Q=1e3,J=1e3,X=9999,ee=9999999,te=1e6,ne=1,oe=2,re=4,ie=1e3},246074:(e,t,n)=>{n.d(t,{j:()=>p,g:()=>m});var o=n(937850),r=n(674686),i=(n(21703),n(653965));let a,s,l=!1;function c(){return l}async function d(e){if(l)return;if(!(await r.ec({service:"zendesk",cookieService:e.cookieService})))return;const t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://decagon.ai/loaders/notion.js",t.id="decagon-widget-embed-script";const n=document.getElementsByTagName("script")[0];return null==n||n.parentNode.insertBefore(t,n),new Promise((n=>{t.addEventListener("load",(async t=>{if((0,i.kK)(window.duet))throw new Error("Decagon script not loaded");l=!0,window.duet.setMetadata(e.initArgs),window.duet.setUserId(e.initArgs.userId),await window.duet.hide(),await window.duet.close(),n()}))}))}async function u(e,t,n){if(a)return a;e.planType=t,e.isSalesAssistedPlan=n;const i=(0,o.UZ)();a=i.promise,await async function(e){if(!(await r.ec({service:"zendesk",cookieService:e.cookieService})))return;const t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://solve-widget.forethought.ai/embed.js",t.id="forethought-widget-embed-script",t.setAttribute("data-api-key","c895ee24-2c6c-4ed6-a100-3037e65cadda"),e.initialQuery&&t.setAttribute("initial-query",e.initialQuery);if(t.setAttribute("data-ft-full-name",e.fullName||"Forethought Deflected"),t.setAttribute("data-ft-email",e.email||"forethought@makenotion.com"),e.locale){var n;const o=null===(n=e.locale.split("-")[0])||void 0===n?void 0:n.toLowerCase();o&&t.setAttribute("data-ft-embed-script-language",o)}const o=e.planType||"undefined";"enterprise"===o&&e.isSalesAssistedPlan?(t.setAttribute("data-ft-plan-type","enterprise_free"),t.setAttribute("data-ft-workflow-tag","enterprise_free"),e.initialQuery||t.setAttribute("initial-intent-id","d5cb32d0-3637-4e8e-87fa-c4ea8d79d45f")):(t.setAttribute("data-ft-plan-type",o),t.setAttribute("data-ft-workflow-tag",o));const i=document.getElementsByTagName("script")[0];return null==i||i.parentNode.insertBefore(t,i),window.addEventListener("message",(e=>{var t,n;"forethoughtWidgetClosed"===(null==e||null===(t=e.data)||void 0===t?void 0:t.event)&&(null===(n=Forethought)||void 0===n||n("widget","hide"))})),new Promise((e=>{t.addEventListener("load",(()=>{var t;null===(t=Forethought)||void 0===t||t("widget","hide"),e()}))}))}(e),i.resolve()}async function p(e){if(s)return s;const t=(0,o.UZ)();s=t.promise;try{if("forethought"===e.type&&await u({...e.forethoughtInitializeArgs,initialQuery:e.initialQuery},e.userHighestPlanType,e.isSalesAssistedPlan),"decagon"===e.type){!c()&&!!e.decagonInitializeArgs&&await d({cookieService:e.cookieService,initArgs:e.decagonInitializeArgs})}await async function(e){const{locale:t,cookieService:n}=e;if(!(await r.ec({service:"zendesk",cookieService:n})))return;const o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src="https://static.zdassets.com/ekr/snippet.js?key=b9ad856d-6b98-4cf5-a2f6-d96e50557722",o.id="ze-snippet";const i=document.getElementsByTagName("script")[0];return null==i||i.parentNode.insertBefore(o,i),new Promise((e=>{o.addEventListener("load",(()=>{const n=window.zE;n&&(n("webWidget","setLocale",t),n("webWidget","hide"),e())}))}))}(e)}catch(n){e.onError&&e.onError(n)}finally{t.resolve()}}async function m(e){if(await p(e),"undefined"!=typeof Forethought)Forethought("widget","show"),Forethought("widget","open");else if(c())e.initialQuery&&window.duet.setInitialUserMessage(e.initialQuery),await window.duet.open();else{let e=window.zE;if(!e)return;e("webWidget","show"),e("webWidget","open"),e("webWidget:on","close",(function(t){e=window.zE,e&&e("webWidget","hide")}))}}},168866:(e,t,n)=>{e.exports=n.p+"9ade71d75a1c0e93.png"},993491:(e,t,n)=>{e.exports=n.p+"edfba4a6d1ff7acd.png"}}]);