PageSourceSearch

https://fbrotte.notion.site/_assets/chatPanelActions-5e460da71dfcf635.js

js fbrotte.notion.site collected 2026-10-09 21:21:00 UTC 6,271 bytes, 1 lines download raw bytes

1"use strict";(globalThis.rspackChunknotion_next=globalThis.rspackChunknotion_next||[]).push([[13119],{420459(e,t,o){o(953925),o(435368),o(499468),o(586042),o(169187),o(726090),o(132457),o(219390),o(73168),o(540679),o(730330),o(765324);var r=()=>o(970831);function a(e){let t=e??("editing"===o(358377).default.state.mode?o(358377).default.state.multiSelection:void 0);if(!t)return;let a=t.start.store,n=a.getRecordStoreUIRoot(),i=o(521595).n.findNodeFromStore(a),l=(0,o(534012).T)(a),d=null==l?void 0:l.getRecordStoreUIParent(),s=(0,o(730994).K3)(n),u=l&&l instanceof r().B&&l!==n?l:void 0,c=u??i;if(n&&n instanceof r().B&&c)return{type:"cursor",textSelection:t,currentPage:n,currentBlock:u,origin:c,currentParent:d,scrollerStore:s,isPageTitle:n.id===a.id}}function n(){let{stores:e}=o(584265).default.state,t=o(358377).default.state,a="empty"!==t.mode?t.multiSelection:void 0,n="empty"!==t.mode?t.multiSelection.start.store:void 0,i=n?n.getRecordStoreUIRoot():void 0;if(!(i instanceof r().B)){let e,t=null==n?void 0:n.getRecordStoreUIParent();for(;null!=t;)t instanceof r().B&&(e=t),t=t.getRecordStoreUIParent();e&&(i=e)}if(a&&i&&i instanceof r().B){let t=(0,o(534012).T)(a.end.store),r=null==t?void 0:t.getRecordStoreUIParent(),n=(0,o(730994).K3)(i);if(t&&r)return{type:"textSelection",stores:e,textSelection:a,currentPage:i,origin:t,endBlock:t,endBlockParent:r,scrollerStore:n}}}function i(){if(o(584265).default.state.stores.length>0){let e=o(358377).default.state;if("empty"===e.mode){let e=function(){if(1!==o(584265).default.state.stores.length)return;let e=o(584265).default.state.stores["0"];if(!(e instanceof r().B))return;let t=e.getTitleStore();if(t)return{start:{store:t,index:0},end:{store:t,index:0}}}();return e?a(e):function(){let{stores:e}=o(584265).default.state,t=e[0],a=e.at(-1),n=t?t.getRecordStoreUIRoot():void 0;if(n&&n instanceof r().B&&a){let t=(0,o(730994).K3)(n);return{type:"blockSelection",stores:e,currentPage:n,origin:a,scrollerStore:t}}}()}return(0,o(971541).k)(e.multiSelection)?a():n()}}function l(e){if(e.isType("image"))return!(0,o(466390).getEmbedSourceFromBlockStore)(e);let t=e.getTitleStore();return!!t&&!!(0,o(247438).w9s)(t.getValue())&&!d(e)}function d(e){return e.getRenderableContentStores().some(e=>!l(e))}function s(e){let t=e[0],a=e.at(-1);if(!t||!a)return;let n=t.getRecordStoreUIRoot();if(!(n instanceof r().B))return;let i=new Set,l=[];for(let t of(0,o(966980).Lz)({blockStores:e,traverseTransclusionReferences:!0}))i.has(t.id)||(i.add(t.id),l.push(t));return{type:"blockSelection",stores:l,currentPage:n,origin:a,scrollerStore:(0,o(730994).K3)(n)}}o.d(t,{G4:()=>i,gu:()=>a,jF:()=>s,rs:()=>n,uY:()=>d,z0:()=>l})},183163(e,t,o){o.r(t),o.d(t,{openChatPanel:()=>r}),o(533958),o(176765),o(851344),o(866491);function r(e){let t,{environment:r,tabId:a,store:n,chatPanelState:i,source:l="button",shouldSaveThreadOnClose:d=!0,skipOpeningAnimation:s=!1,initialFocusBehavior:u="default",captureCompletionContext:c=!0,initialFile:f,pendingEmptyPageAgentStarter:p,agentServiceNewThreadIntent:S=!1,agentServiceNewThreadWorkflowId:h}=e,g=(0,o(328765).S)();if((0,o(548124).isChatUnavailableForSpace)(g))return;let w=o(307545).default.mark("agent_time_to_render"),m=c?(0,o(420459).G4)():void 0;(0,o(411282).w)(),o(562733).zI.setState({...o(562733).zI.state,initialFocusBehavior:u,pendingMeetingNotesInvocation:void 0,skipOpeningAnimation:s,agentServiceNewThreadIntent:S,agentServiceNewThreadWorkflowId:h,agentServiceNewSideChatParentThreadI
1d:void 0,agentTimeToRenderMetric:w,openSource:l,completionContext:m,...void 0===f?{}:{initialFiles:[f]},pendingEmptyPageAgentStarter:p,shouldSaveCurrentThreadOnClose:d});let I=i??{},v=I.isNewThread,C="threadId"in I&&!!I.threadId;!v&&!C&&o(973240).L.threadId&&o(973240).L.updatedAt&&o(973240).L.updatedAt+6e5>Date.now()&&(I={...I,threadId:o(973240).L.threadId}),d&&(0,o(487246).a)();let b=(0,o(548124).getMergedChatSidebarRouteData)({environment:r,update:I}),k=(0,o(548124).routeArgsGivenChatSidebarRouteData)(b),R=r.RouterStore.state.route;if(n)if((null==n?void 0:n.table)==="block")t=(0,o(374743).Ef)({environment:r,updates:{...k,scrollToBlockId:void 0,store:n}});else if((null==n?void 0:n.table)===o(832375).C0E){let e={};"agent"===R.name&&(e={...R.workflowViewType?{workflowViewType:R.workflowViewType}:{},workflowViewId:R.workflowViewId,workflowPrompt:R.workflowPrompt,agentChatThreadId:R.agentChatThreadId}),t=(0,o(453573).Lm)({workflowId:n.id,params:{workflowViewType:"agent",...k,...e}})}else(0,o(48697).HB)(n);else if(!n&&(0,o(548124).shouldAllowOpeningAgentOnSpecifiedRoute)(R)){let e=new URL(window.location.href);k.chatThreadId&&e.searchParams.set("t",k.chatThreadId),t=e.toString()}if(!t)throw Error(`Cannot open chat panel on route ${R.name} without a store`);let T=o(192314).AppStoreMainEditorCurrentBlockStore.state!==n;o(800198).Router.navigate({environment:r,tabId:a,url:t,redirect:!T});let P=(0,o(828560).hw)(),y=o(562733).zI.state.chatPanelMode;P||(P&&"sidebar"===y?(0,o(325475).h)({environment:r,isExpanded:!0,from:"slippery_slope_experiment",saveDetailsSidebarPreference:!1}):function(e){let{environment:t}=e;!(0,o(507330).K)(t)||(0,o(548124).getIsChatPanelOpen)(t)||(o(984858).sidebarExpandedStore.setState(!1),o(475097).default.setSidebarExpandedStoreState(!1),o(562733).zI.setState({...o(562733).zI.state,reopenMainSidebarOnClose:!0}))}({environment:r}));let B=null==g?void 0:g.id;B&&(r.api.callCellCompatibleApi({eventName:"warmSearchCache",environment:r,data:{spaceId:B},cellNavigation:{spaceId:B}}),r.api.callCellCompatibleApi({eventName:"warmVectorDBCache",environment:r,data:{spaceId:B},cellNavigation:{spaceId:B}})),(async()=>{try{(await Promise.all([o.e(80293),o.e(75887),o.e(87662),o.e(22985),o.e(77099),o.e(99376),o.e(4822),o.e(78729),o.e(68735),o.e(14417),o.e(41379),o.e(64552),o.e(83065),o.e(66395),o.e(99044),o.e(97054),o.e(50869),o.e(40678),o.e(3649),o.e(54931),o.e(26751),o.e(4637),o.e(60428),o.e(40835),o.e(66644)]).then(o.bind(o,689262))).trackAgentOpened({environment:r,from:l,leftNotionSidebarOpenState:o(984858).sidebarExpandedStore.state})}catch(e){}})()}},262118(e,t,o){function r(e){let{chatFeatureType:t}=e;o(562733).zI.update(e=>({...e,focusRequest:{chatFeatureType:t,id:(0,o(83388).Ay)()}}))}o.r(t),o.d(t,{requestUnifiedChatInputFocus:()=>r})}}]);

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