PageSourceSearch

https://entcrowddev.notion.site/_assets/DeferredNotionListeners-24156a58ae3eeb21.js

js entcrowddev.notion.site collected 2026-10-09 23:48:06 UTC 66,894 bytes, 8 lines download raw bytes

1"use strict";(globalThis.rspackChunknotion_next=globalThis.rspackChunknotion_next||[]).push([[1201],{368891(e,t,r){function i(){return(0,r(579993).O$)(r(192314).AppStoreCurrentUserSettingsStore)}r.d(t,{g:()=>i})},876252(e,t,r){function i(){return(0,r(579993).O$)(r(192314).AppStoreCurrentUserStore)}r.d(t,{$:()=>i})},929573(e,t,r){function i(e,t){let{disableExposureLogging:i=!1}=t??{};return(0,r(579993).K8)(()=>r(218744).default.getLayer({layerName:e,disableExposureLogging:i}),[e,i])}function n(e){let{layerName:t,param:i,defaultValue:n,disableExposureLogging:a=!1}=e;return(0,r(579993).K8)(()=>r(218744).default.getLayerParam({layerName:t,param:i,defaultValue:n,disableExposureLogging:a}),[t,i,n,a])}r.d(t,{O:()=>i,R:()=>n})},52213(e,t,r){let i=new(r(552709)).O2("SqliteSubscriptions",async()=>{let[{TabSqliteSubscriptionBackend:e},{SqliteSubscriptionManager:t},{OptimisticUpdateComposer:i}]=await Promise.all([Promise.all([r.e(73663),r.e(16772)]).then(r.bind(r,161651)),Promise.all([r.e(73663),r.e(16772)]).then(r.bind(r,890843)),Promise.all([r.e(73663),r.e(16772)]).then(r.bind(r,941053))]);return{TabSqliteSubscriptionBackend:e,SqliteSubscriptionManager:t,OptimisticUpdateComposer:i}});r.d(t,{},{k:i})},123004(e,t,r){let i=new WeakMap;function n(e,t){let n=i.get(e);if(n)return n;let{TabSqliteSubscriptionBackend:a,SqliteSubscriptionManager:o}=t,s=new o(new a({observer:e,debounceMs:100,broadcastWritesChannel:new BroadcastChannel("sqlite-writes"),config:r(139424).A}));return i.set(e,s),s}function a(e){return i.get(e)}r.d(t,{C3:()=>a,uD:()=>n})},777946(e,t,r){r(533958);var i=r(635790);function n(e,t,a,o=!1){var s,d,u,p;let g,f=function(e){var t,n;let a=null==(t=(0,r(533992).v3)().sqliteConnection)||null==(n=t.getObserver)?void 0:n.call(t),o=a?(0,r(123004).C3)(a):void 0,[s,l]=(0,i.useState)(o),c=(0,r(552709).fJ)(r(52213).k,{disabled:!e});return(0,i.useEffect)(()=>{!s&&a&&e&&"resolved"===c.status&&l((0,r(123004).uD)(a,c.value))},[a,c,s,e]),e?s:void 0}(!!t),v=function(e,t,n,a,o){let s=(0,r(533992).v3)().currentUser.id,l=t?function(e,t,i,n,a,o){var s,l,c;if(!i&&null!=(s=n.rowType)&&s.singleton)throw Error(`Must use useSqliteSingleton for singleton row type: ${n.rowType.name}`);let d=t.sql(),u=n.readTables;if(!u){let e=null==a?void 0:a.parseQuery(d);if(e)switch(e.type){case"unknown":u=e.tables;break;case"error":throw e.error;case"crud":if(e.writeTables.length>0)throw Error(`useSqliteQuery: cannot subscribe to query that writes to tables: ${e.writeTables.join(", ")}`);u=e.readTables;break;default:(0,r(48697).HB)(e)}else u=null==(c=n.rowType)?void 0:c.readTables}let p={_key:`sqlite:KeyCreatorNotLoaded:${e}`,_options:n,singleton:i,sql:d,args:t.args,queryName:e,readTables:u,primaryKey:n.primaryKey??(null==(l=n.rowType)?void 0:l.primaryKey),rowType:n.rowType,userId:o||"guest"};return a&&(p._key=a.keyCreator.getKeyUncached(p)),p}(e,t,n,a,o,s):void 0,[c,d]=(0,i.useState)(l);return(null==l?void 0:l._key)!==(null==c?void 0:c._key)?(d(l),l):c}(e,t,o,a,f),m=v?null==f?void 0:f.createQuery(v._key,v):void 0,h=m??l,b=(0,i.useSyncExternalStore)(h.subscribe,h.getSnapshot),y=(s=m,d=!!(null==v?void 0:v.singleton),u=f,g=null==(p=(0,r(552709).fJ)(r(52213).k,{disabled:!s}).value)?void 0:p.OptimisticUpdateComposer,(0,i.useCallback)((e,t)=>s&&u&&g&&s?c(e,t,d,s,u,g):e(),[s,u,g,d])),_=!!t,S=(0,i.useMemo)(()=>({...b,withOptimistic:y,enabled:_}),[b,y,_]);if(S.error&&!(null!=v&&v._options.allowError))throw S.error;return S}function a(e,t,r){let a=n(e,t,{...r,rowType:r.singletonType},!0);return(0,i.useMemo)(()=>{var e;return{enabled:a.enabled,loading:a.loading,seq:a.seq,value:null==(e=a.value)?void 0:e[0],valueSeq:a.valueSeq,error:a.error,errorSeq:a.errorSeq,withOptimistic:a.withOptimistic}},[a])}function o(){}let s=Object.freeze({loading:!0,seq:-1,value:void 0,valueSeq:void 0,error:void 0,errorSeq:void 0}),l={subscribe:()=>o,getSnapshot:()=>s,dispatch:o};async function c(e,t,i,n,a,o){let s,l,c,d=n.rowType;if(!d)throw Error(`Optimistic updates not supported for queries without a RowType or primaryKey: ${n.key}`);let u=new o(d,i);try{t(u)}finally{s=u.done()}let{queryUpdate:p,rowTypeUpdate:g}=s;if(!p&&!g)return e();g&&(a.dispatchRowTypeUpdate(n.userId,d,{type:"put",update:g}),l=()=>{a.dispatchRowTypeUpdate(n.userId,d,{type:"del",id:g.id})}),p&&(n.dispatch({type:"put",update:p}),c=()=>{n.dispatch({type:"del",id:p.id})});let f=(0,r(326904).nQ)(1e4,n.waitForRerun()),v=e();return Promise.all([v,f]).finally(()=>{var e,t;null==(e=l)||e(),null==(t=c)||t()}),await v}r.d(t,{p:()=>a,u:()=>n})},353914(e,t,r){r.r(t),r.d(t,{DeferredNotionListeners:()=>em});var i=r(635790);r(533958),r(435368),r(730330),r(765324);let n="notion_ls_sync",a=["theme","LRU:KeyValueStore2:appearanceSettingStorageKey","contrast","LRU:KeyValueStore2:contrastPreferenceStorageKey","LRU:KeyValueStore2:slipperySlopeSidebarSelectedTab","LRU:KeyValueStore2:openInDesktopApp","LRU:KeyValueStore2:openExternalLinkSettingStorageKey","LRU:LocalPreferenceStore3:offline_autosync_setting_2"],o=[{type:"prefix",value:"LRU:KeyValueStore2:aiChatDrafts:"},{type:"prefix",value:"LRU:KeyValueStore2:recentlyUsedHighlightColors"},{type:"prefix",value:"LRU:KeyValueStore2:recently_selected_timezones"},{type:"prefix",value:"LRU:KeyValueStore2:formulas_show_structure"},{type:"prefix",value:"LRU:formula_editor:formula_assistant_visible"},{type:"prefix",value:"LRU:KeyValueStore2:meetingNotificationState2"},{type:"prefix",value:"LRU:KeyValueStore2:adClick"},{type:"prefix",value:"LRU:KeyValueStore2:fbp"},{type:"prefix",value:"LRU:KeyValueStore2:trialUpsell"},{type:"prefix",value:"AMP_notion"},{type:"suffix",value:":sourceInitialPage"},{type:"suffix",value:":contextualizedOnboardingStateKeyV2"},{type:"prefix",value:"LRU:KeyValueStore2:emojiFrecency:"},{type:"prefix",value:"LRU:SlashMenu:"},{type:"prefix",value:"intercom-"}],s=new(r(552709)).O2("useAIDatabaseBuildToast",()=>r.e(75327).then(r.bind(r,714142))),l=new(r(552709)).O2("useDataScoutMetricToastDevOnly",()=>r.e(8421).then(r.bind(r,34959))),c=new(r(552709)).O2("useMeetingKeywordToast",()=>r.e(96941).then(r.bind(r,530215))),d=new(r(552709)).O2("useThreadOutboxRecovery",async()=>await Promise.all([r.e(2728),r.e(18091),r.e(24474)]).then(r.bind(r,749628))),u=new(r(552709)).O2("AgentWriterGlobalUndoListener",async()=>await Promise.all([r.e(2728),r.e(18091),r.e(36155)]).then(r.bind(r,339119))),p=(0,r(552709)._h)(u,e=>e.AgentWriterGlobalUndoListener);var g=r(440302);let f=new(r(552709)).O2("NotionCalendarListener",()=>Promise.all([r.e(41269),r.e(10817),r.e(55857),r.e(52512),r.e(58422),r.e(52622),r.e(52121)]).then(r.bind(r,894205))),v=(0,r(552709)._h)(f,e=>e.NotionCalendarListener);function m(){return(0,r(229888).L)()?(0,g.jsx)(v,{}):null}
1r(139583);let h=14*r(286762).nD;function b(e){return e.isDesktopOrWeb?e.areRequiredRecordsLoaded?e.isWorkspaceMember&&void 0!==e.signupTime&&Number.isFinite(e.signupTime)&&!(e.signupTime<=0)&&!(e.now-e.signupTime<h)&&e.isAiEnabledInSpace&&e.isChatAvailable&&e.isSidebarSimplificationEnabled&&e.homeHasChats&&void 0===e.threadConfig?void 0===e.subscriptionTier?"pending":(0,r(262166).dL)(e.subscriptionTier)||(0,r(262166).$P)(e.subscriptionTier)||(0,r(262166).HO)(e.subscriptionTier)?void 0===e.agentTurnCount?"pending":0!==e.agentTurnCount||!1===e.hasAvailableAiUsage?"ineligible":void 0===e.hasAvailableAiUsage?"pending":"eligible":"ineligible":"ineligible":"pending":"ineligible"}function y(){let e=(0,r(533992).v3)(),t=(0,r(972740).L)(),n=(0,r(476743).a)(),{experimentGroup:a}=function(){let e=(0,r(876252).$)(),t=(0,r(368891).g)(),n=(0,r(972740).L)(),a=(0,r(476743).a)(),o=(0,r(105445).m5)(),s=(0,r(579993).K8)(()=>{let i=(null==e?void 0:e.isDefined())===!0&&(null==t?void 0:t.isDefined())===!0&&t.id===e.id&&(null==n?void 0:n.isDefined())===!0&&(null==a?void 0:a.isDefined())===!0&&r(527391).t.USEWITHCAUTION_isFetchedForSpaceAndUserId({userId:e.id,spaceId:n.id}),o=null==t?void 0:t.getSettings(),s=null==a?void 0:a.getSettings(),l=(null==n?void 0:n.isDefined())===!0&&!(0,r(916804).I)(n),c=(null==n?void 0:n.isDefined())===!0&&!(0,r(828560).lp)(n),d=r(712241).L.fromSpaceStore({spaceIdCreator:null==n?void 0:n.getSpaceIdCreator(),spaceStore:n,sectionType:"chats"});return{areRequiredRecordsLoaded:i&&(null==d?void 0:d.isReady())===!0,isWorkspaceMember:l,signupTime:null==o?void 0:o.signup_time,isAiEnabledInSpace:(null==n?void 0:n.isAiEnabledOnSpace())===!0,isChatAvailable:c,homeHasChats:function(e){let t=(0,r(190278).Me)(e.storedConfig);if(void 0===t)return e.isLegacyChatsSectionVisible;let i=t.tabs.find(e=>"home"===(0,r(190278).Yw)(e))??t.tabs[0];return(null==i?void 0:i.sections.some(e=>"chats"===e.type))===!0}({storedConfig:null==s?void 0:s.sidebar_simplification_tabs_config,isLegacyChatsSectionVisible:(null==d?void 0:d.getPropertiesStore().getKeyValue("hidden"))===!1}),threadConfig:null==o?void 0:o.ask_me_anything_thread_config}},[t,e,n,a]),l=(0,r(579993).K8)(()=>{var t;if(!e||!r(529119).k.isReady()||r(529119).k.state.lastFetchedUserId!==e.id)return;let i=r(529119).k.getProfile();return null===i?null:(null==(t=i.usage_context)||null==(t=t["ai-agent-events-v0"])?void 0:t.agent_start_turn_cumulative)??0},[e]),[c]=(0,i.useState)(Date.now),d=b({...s,isDesktopOrWeb:!r(139424).A.isMobile,isSidebarSimplificationEnabled:o,subscriptionTier:void 0,agentTurnCount:l,hasAvailableAiUsage:void 0,now:c}),u=(0,r(226309).lh)({spaceId:s.areRequiredRecordsLoaded&&"pending"===d?null==n?void 0:n.id:void 0}),p=void 0===u?void 0:(0,r(991394).AI)(u),g=s.areRequiredRecordsLoaded&&"pending"===d&&void 0!==p&&((0,r(262166).dL)(p)||(0,r(262166).$P)(p)||(0,r(262166).HO)(p)),f=(0,r(775672).P)(g?null==n?void 0:n.id:void 0),[v,m]=(0,i.useState)({userId:null==e?void 0:e.id,spaceId:null==n?void 0:n.id,timedOut:!1});(v.userId!==(null==e?void 0:e.id)||v.spaceId!==(null==n?void 0:n.id))&&m({userId:null==e?void 0:e.id,spaceId:null==n?void 0:n.id,timedOut:!1});let h=v.timedOut,y=g&&f&&!h,_=(0,r(217844)._)({name:"ai_usage",amount:1,spaceId:y?null==n?void 0:n.id:void 0,userId:y?null==e?void 0:e.id:void 0}),S=!g||f&&void 0!==_;(0,i.useEffect)(()=>{if(S||h)return;let t=setTimeout(()=>{let t=null==n?void 0:n.id;t&&(0,r(104310).u)({event:{eventName:"home_chats_oracle_thread_ai_usage_timed_out",eventProperties:{space_id:t}}}),m({userId:null==e?void 0:e.id,spaceId:null==n?void 0:n.id,timedOut:!0})},3e3);return()=>{clearTimeout(t)}},[h,S,null==e?void 0:e.id,null==n?void 0:n.id]);let w=(0,r(579993).K8)(()=>g?!h&&(f&&void 0!==_?(0,r(747609).e2)(_):void 0):void 0,[_,h,f,g]),k=b({...s,subscriptionTier:p,isDesktopOrWeb:!r(139424).A.isMobile,isSidebarSimplificationEnabled:o,agentTurnCount:l,hasAvailableAiUsage:w,now:c}),L=(0,r(579993).K8)(()=>"eligible"!==k?"control":r(218744).default.getEligibleGroup({experimentId:"home_tab_ask_me_anything_thread",defaultGroup:"control",disableExposureLogging:!1}),[k]);return{decision:k,experimentGroup:L}}(),o=(0,r(368891).g)(),s=(0,r(579993).K8)(()=>(null==o?void 0:o.getSettingsStore().getKeyValue("domain_type"))==="professional",[o]),l=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{("v1"===a||"v2"===a)&&null!=t&&t.isDefined()&&null!=n&&n.isDefined()&&!l.current&&(l.current=!0,(0,r(859858).G)({environment:e,spaceStore:t,spaceVie
1wStore:n,isProfessionalUser:s,variant:a}).catch(e=>{(0,r(208318).t)().log({level:"error",from:"AskMeAnythingOracleThreadListener",type:"creationFailed",error:e,data:{spaceId:t.id}})}))},[e,a,s,t,n]),null}r(63224),r(499468),r(586042),r(169187),r(726090),r(132457),r(219390),r(73168),r(976614),r(159952);var _=()=>r(470604);let S=new(r(552709)).O2("audioProcessDetectionActions",async()=>await Promise.all([r.e(58035),r.e(80293),r.e(75887),r.e(87662),r.e(77694),r.e(22985),r.e(20681),r.e(86600),r.e(46913),r.e(10033),r.e(84528),r.e(32171),r.e(77099),r.e(99376),r.e(4822),r.e(78729),r.e(68735),r.e(14417),r.e(41379),r.e(64552),r.e(83065),r.e(66395),r.e(99044),r.e(97054),r.e(50869),r.e(40678),r.e(3649),r.e(1559),r.e(61300),r.e(97098),r.e(60921),r.e(54931),r.e(56556),r.e(26751),r.e(11849),r.e(4637),r.e(74787),r.e(57614),r.e(11327),r.e(20773),r.e(60428),r.e(56161),r.e(40835),r.e(89379),r.e(2337),r.e(90989),r.e(89292),r.e(52149),r.e(64076),r.e(44960),r.e(54161),r.e(42968),r.e(89352),r.e(11723),r.e(68034),r.e(31693),r.e(14512),r.e(80247),r.e(46449),r.e(82782),r.e(85239),r.e(74017),r.e(26612),r.e(96886),r.e(17970),r.e(33308),r.e(34925),r.e(66194),r.e(48453),r.e(90466),r.e(41269),r.e(10817),r.e(55857),r.e(52512),r.e(91049),r.e(11702),r.e(42386),r.e(58422),r.e(77979),r.e(82531),r.e(56762),r.e(33622),r.e(69116),r.e(99251),r.e(61457),r.e(25024),r.e(31207),r.e(67535),r.e(66256),r.e(17521),r.e(17048),r.e(26010),r.e(32911),r.e(95269),r.e(36036),r.e(90178),r.e(41873),r.e(89269),r.e(63569),r.e(90671),r.e(85160),r.e(19028),r.e(84741),r.e(38438),r.e(53191),r.e(77631),r.e(22016),r.e(14016),r.e(64526)]).then(r.bind(r,867162)));async function w(){if(!r(775657).electronApi||!r(775657).electronApi.getRunningInputAudioProcesses)return r(80279).Q.fail({message:"API not available"});try{return await r(775657).electronApi.getRunningInputAudioProcesses()}catch(e){return r(80279).Q.fail({message:"Failed to get audio processes",error:e})}}var k=()=>r(523661);async function L(e,t){if(r(218744).default.checkGate({gateName:"meeting_notes_detection_process_result"})){let i=await (0,r(675646).K)();if(r(80279).Q.isFail(i)||i.value.processes.map(k().v).filter(r(48697).O9).includes(e))return!0;if(!t.includeOutputProcesses)return!1;let n=await (0,r(539583).l)();if(r(80279).Q.isFail(n)){let e=n.error;return(null==e?void 0:e.message)!=="API not available"}return n.value.processes.map(e=>(0,k().v)(e.processName)).filter(r(48697).O9).includes(e)}{let t=await w();return!!r(80279).Q.isFail(t)||t.value.map(k().v).filter(r(48697).O9).includes(e)}}function A(e,t){for(let r of e)if(!t.includes(r))return{shouldNotify:!0,processName:r};return{shouldNotify:!1}}function T(e,t){for(let r of t)if(!e.includes(r))return{shouldStop:!0,processName:r};return{shouldStop:!1}}function C(e,t){var i;null===r(775657).electronApi||void 0===r(775657).electronApi||null==(i=r(775657).electronApi.initializeRunningInputAudioProcessDetection)||i.call(r(775657).electronApi,e,t)}async function E(e){let{environment:t,activeTranscriptionBlockStore:i,currentlyRunningAudioProcessNames:n,previouslyDetectedProcessNames:a,stopWhenAudioProcessEnds:o}=e;if(void 0!==i){let e=T(n,a);if(e.shouldStop&&e.processName)try{await o({processName:e.processName,currentlyRunningAudioProcessNames:n,previouslyDetectedProcessNames:a,activeTranscriptionBlockStore:i,listener:"legacy"})}catch(t){r(773352).log({level:"error",from:"meetingNotesDetection",type:"error_stopping_transcription_for_audio_process",error:(0,r(952977).convertErrorToLog)(t),data:{miscDataToConvertToString:{processName:e.processName,currentlyRunningAudioProcessNames:n,previouslyDetectedProcessNames:a,activeTranscriptionBlockId:i.id}}})}}else{let e=A(n,a);if(e.shouldNotify&&e.processName)try{let r=await S.load();await r.sendNotificationForRunningAudioProcess(t,e.processName)}catch(t){r(773352).log({level:"error",from:"meetingNotesDetection",type:"error_sending_notification_for_audio_process",error:(0,r(952977).convertErrorToLog)(t),data:{miscDataToConvertToString:{processName:e.processName,currentlyRunningAudioProcessNames:n,previouslyDetectedProcessNames:a}}})}}}async function U(e){let{activeTranscriptionBlockStore:t,currentlyRunningAudioProcessNames:i,previouslyDetectedProcessNames:n,processFirstSeenAtByName:a,minimumEndedAudioProcessRuntimeBeforeAutoStopMs:o,stopWhenAudioProcessEnds:s}=e,l=T(i,n);if(l.shouldStop&&void 0!==l.processName)try{let e=a.get(l.processName),c=void 0===e?void 0:Math.max(0,Date.now()-e);if(void 0!==c&&c<o)return void r(773352).log({level:"info",from:"meetingNotesDetection",type:"process_runtime_too_short_for_auto_stop",data:{miscDataToConvertToString:{processName:l.processName,endedProcessRuntimeMs:c,minimumEndedAudioProcessRuntimeBeforeAutoStopMs:o,currentlyRunningAudioProcessNames:i,previouslyDetectedProcessNames:n}}});await s({processName:l.processName,currentlyRunningAudioProcessNames:i,previouslyDetectedProcessNames:n,activeTranscriptionBlockStore:t,listener:"v2"})}catch(e){r(773352).log({level:"error",from:"meetingNotesDetection",type:"error_stopping_transcription_for_audio_process",error:(0,r(952977).convertErrorToLog)(e),data:{miscDataToConvertToString:{processName:l.processName,currentlyRunningAudioProcessNames:i,previouslyDetectedProcessNames:n,activeTranscriptionBlockId:t.id}}})}}async function I(e){var t;let{environment:i,processName:n,currentlyRunningAudioProcessNames:a,previouslyDetectedProcessNames:o,activeTranscriptionBlockStore:s,isCurrentRecording:l}=e,c=(0,r(276162).by)(s);if("transcribing"!==c.state)return;let d=null==(t=s.getFormat())||null==(t=t.transcription_state_history)?void 0:t.findLast(e=>"transcribing"===e.state),u=null!=d&&d.timestamp?Date.now()-d.timestamp:void 0;if(d&&void 0!==u&&u<3e4)return void r(773352).log({level:"info",from:"meetingNotesDetection",type:"stop_transcription_too_soon",data:{miscDataToConvertToString:{timeSinceLastStateChange:u}}});let p=await r(785576).w.load();l()&&((0,r(104310).u)({event:{eventName:"system_audio_process_stopped",eventProperties:{process_name:n,currently_running_audio_processes:a,previously_running_audio_processes:o,block_id:s.id,dictation_session_id:c.session_id,ms_since_transcribing_started:u}}}),await p.stopTranscription({environment:i,blockStore:s,from:"audio_process_detection"}))}function R({isActiveTab:e}){let t,n,a,o,s,l,c,d,u,p,g,f,v,m,h,b,y,w,T,N,x,P,M;return t=(0,r(533992).v3)(),n=(0,r(83208).X)("meeting_notes_zoom_speaker_attribution"),a=(0,r(83208).X)("meeting_notes_zoom_chat_disclosure"),(0,i.useEffect)(()=>{(0,r(761267).FE)(t)},[t,n,a]),function(e){let{isElectron:t,isActiveTab:n}=e,a=(0,r(839362).W)(),o=(0,r(579993).K8)(()=>
1{let e=r(192314).AppStoreSidebarSpaceViewStore.getState();return(null==e?void 0:e.isAiMeetingNotesAudioProcessDetectionMonitoringEnabled())??!1},[]),s=t&&a&&o,l=(0,i.useRef)(void 0);(0,i.useEffect)(()=>{let e=!1;return async function(){if(!n)return;let t=await (0,_().a)();if(!e&&t){if(void 0===l.current){l.current=s,s&&C(1e3,!1);return}if(l.current!==s)if(l.current=s,s)C(1e3,!1);else{var i;null===r(775657).electronApi||void 0===r(775657).electronApi||null==(i=r(775657).electronApi.stopRunningInputAudioProcessDetection)||i.call(r(775657).electronApi)}}}(),()=>{e=!0}},[s,n])}({isElectron:t.device.isElectron,isActiveTab:e}),o=(0,r(579993).K8)(()=>{let e=r(192314).AppStoreSidebarSpaceViewStore.getState();return(null==e?void 0:e.isAiMeetingNotesAudioProcessDetectionMonitoringEnabled())??!1},[]),s=(0,r(579993).K8)(()=>1e3*r(218744).default.getConfigKey("meeting_notes_audio_process_detection_config","minimum_runtime_before_auto_stop_seconds"),[]),l=(0,r(839362).W)(),c=(0,r(83208).X)("meeting_notes_use_audio_process_changed_v2"),d=t.device.isElectron&&e&&l&&o,u=t.device.isElectron&&l&&o,p=(0,r(579993).O$)(r(192314).AppStoreSidebarSpaceStore),g=(0,r(579993).K8)(()=>{let e=r(898735).A.state.tabs,t=r(585823).ei.state,i=[];return null!=t&&t.isMeetingNoteBlock()&&i.push(t),i.push(...e.flatMap(e=>e.activeBlocks).flatMap(e=>{if(!e||!p)return[];let t=r(970831).B.createChildStore(p,e.pointer);return t.isMeetingNoteBlock()&&i.push(t),[]})),(0,r(960408).hS)(i,e=>e.id)},[p]),f=(0,i.useRef)(g),v=(0,i.useRef)({legacy:d,v2:u}),(0,i.useLayoutEffect)(()=>{f.current=g,v.current={legacy:d,v2:u}},[g,d,u]),m=(0,i.useRef)(!0),h=(0,i.useRef)(void 0),(0,i.useEffect)(()=>(m.current=!0,()=>{var e;m.current=!1,null==(e=h.current)||e.abort()}),[]),b=(0,i.useCallback)(async e=>{var i,n,a,o;let s;null==(i=h.current)||i.abort();let l=e.activeTranscriptionBlockStore,c=(0,r(276162).by)(l);if("transcribing"!==c.state)return;let d=new AbortController;h.current=d;let u=()=>{let t=(0,r(276162).by)(l);return m.current&&!d.signal.aborted&&v.current[e.listener]&&f.current.some(e=>e.id===l.id)&&"transcribing"===t.state&&t.session_id===c.session_id},p=(n=t,a=e.processName,s=n.device.isElectronMac&&"zoom"===a&&r(218744).default.checkGate({gateName:"meeting_notes_zoom_speaker_attribution"}),{includeOutputProcesses:!n.device.isElectronMac||s,recheckUntilStopped:s});try{for(;u();){if("legacy"===e.listener&&!await (0,_().a)())return;let i=await L(e.processName,{includeOutputProcesses:p.includeOutputProcesses});if(!u())return;if(!i)return void await I({...e,environment:t,isCurrentRecording:u});if(!p.recheckUntilStopped){return void(o=e,r(773352).log({level:"info",from:"meetingNotesDetection",type:"legacy"===o.listener?"process_still_running_after_debounce_check":"process_still_running_after_check",data:{miscDataToConvertToString:{processName:o.processName,currentlyRunningAudioProcessNames:o.currentlyRunningAudioProcessNames,previouslyDetectedProcessNames:o.previouslyDetectedProcessNames}}}))}await function(e){return new Promise(t=>{let r=()=>{clearTimeout(i),e.removeEventListener("abort",r),t()},i=setTimeout(r,4e3);e.addEventListener("abort",r,{once:!0}),e.aborted&&r()})}(d.signal)}}finally{h.current===d&&(h.current=void 0)}},[t]),y=(0,i.useRef)(void 0),w=(0,i.useCallback)(async e=>{let r=y.current??[];y.current=void 0;let i=f.current;await E({environment:t,activeTranscriptionBlockStore:i[0],currentlyRunningAudioProcessNames:e,previouslyDetectedProcessNames:r,stopWhenAudioProcessEnds:b})},[t,b]),T=(0,i.useMemo)(()=>(0,r(960408).sg)(w,4e3,{trailing:!0}),[w]),N=(0,i.useRef)(async(e,t,r)=>{}),(0,i.useLayoutEffect)(()=>{N.current=async(e,i,n)=>{if((0,r(761267).FE)(t),d)try{if(!await (0,_().a)())return;let e=n.map(k().v).filter(r(48697).O9),t=i.map(k().v).filter(r(48697).O9);if(r(773352).log({level:"info",from:"meetingNotesDetection",type:"microphone_process_changed_detected",data:{miscDataToConvertToString:{oldProcessCount:t.length,newProcessCount:e.length,oldProcesses:t,newProcesses:e,oldProcessesUnfiltered:i,newProcessesUnfiltered:n}}}),(0,r(931576).n)(e,t))return;void 0===y.current&&(y.current=t),0===f.current.length?await w(e):await T(e)}catch(e){r(773352).log({level:"error",from:"meetingNotesDetection",type:"error_in_audio_process_listener",error:(0,r(952977).convertErrorToLog)(e),data:{miscDataToConvertToString:{oldProcesses:i,newProcesses:n}}})}}},[t,d,T,w]),x=(0,i.useCallback)(async(e,t,r)=>N.current(e,t,r),[]),P=(0,i.useRef)(async e=>{}),(0,i.useLayoutEffect)(()=>{P.current=async i=>{if((0,r(761267).FE)(t),!u)return;let{oldProcesses:n,newProcesses:a,metadata:o}=i;try{let i=a.map(k().v).filter(r(48697).O9),l=n.map(k().v).filter(r(48697).O9);if(r(773352).log({level:"info",from:"meetingNotesDetection",type:"microphone_process_changed_detected",data:{miscDataToConvertToString:{oldProcessCount:l.length,newProcessCount:i.length,oldProcesses:l,newProcesses:i,oldProcessesUnfiltered:n,newProcessesUnfiltered:a}}}),(0,r(931576).n)(i,l))return;if(0===f.current.length){if(!e||!await (0,_().a)())return;let r=A(i,l);if(!r.shouldNotify||!r.processName)return;let n=await S.load();await n.sendNotificationForRunningAudioProcess(t,r.processName);return}let c=(0,r(385149).H)();if(void 0===c)return;await U({activeTranscriptionBlockStore:c,currentlyRunningAudioProcessNames:i,previouslyDetectedProcessNames:l,process
1FirstSeenAtByName:function(e){var t;let r=null==(t=e.metadata)?void 0:t.processFirstSeenAtByProcessId,i=new Map;if(void 0===r)return i;for(let t of e.processIds){let e=(0,k().v)(t);if(void 0===e)continue;let n=r[t];if(void 0===n)continue;let a=i.get(e);(void 0===a||n<a)&&i.set(e,n)}return i}({processIds:[...new Set([...n,...a])],metadata:o}),minimumEndedAudioProcessRuntimeBeforeAutoStopMs:s,stopWhenAudioProcessEnds:b})}catch(e){r(773352).log({level:"error",from:"meetingNotesDetection",type:"error_in_audio_process_listener",error:(0,r(952977).convertErrorToLog)(e),data:{miscDataToConvertToString:{oldProcesses:n,newProcesses:a}}})}}},[t,e,u,s,b]),M=(0,i.useCallback)(async e=>P.current(e),[]),(0,i.useEffect)(()=>{if(c){let e=r(884972).bV.addListener(M);if(void 0!==e)return e}return r(884972).bH.addListener(x)},[x,M,c]),(0,i.useEffect)(()=>()=>{T.flush(),y.current=void 0},[T]),null}r(974864);let N=new(r(552709)).O2("useMeetingNotesFailoverRecoveryController",async()=>await Promise.all([r.e(17521),r.e(17048),r.e(32911),r.e(90178),r.e(8165)]).then(r.bind(r,462381)));async function x(e){if(!e.released)try{await e.release()}catch(e){P("screenWakeLockReleaseFailed",e)}}function P(e,t){(0,r(208318).t)().log({level:"warning",from:"useMeetingNotesScreenWakeLock",type:e,error:(0,r(952977).convertErrorToLog)(t)})}let M={GlobalInAppMessageListener:new(r(552709)).O2("GlobalInAppMessageListener",()=>r.e(4214).then(r.bind(r,537833)))},O=(0,r(552709)._h)(M.GlobalInAppMessageListener,e=>e.GlobalInAppMessageListener),D=new(r(552709)).O2("useRecentEventsListener",()=>r.e(21471).then(r.bind(r,400063))),W=new(r(552709)).O2("useUserLifecycleProfile",()=>r.e(52627).then(r.bind(r,211091))),K=new(r(552709)).O2("jamRecordingLinks",async()=>await r.e(28742).then(r.bind(r,445932))),q=new(r(552709)).O2("useCalendarMeetingNotificationScheduler",()=>Promise.all([r.e(58035),r.e(10033),r.e(84528),r.e(74787),r.e(57614),r.e(11327),r.e(89352),r.e(11723),r.e(68034),r.e(31693),r.e(14512),r.e(80247),r.e(82782),r.e(48453),r.e(90466),r.e(41269),r.e(10817),r.e(52512),r.e(33622),r.e(69116),r.e(31207),r.e(67535),r.e(66256),r.e(17521),r.e(17048),r.e(26010),r.e(32911),r.e(95269),r.e(36036),r.e(90178),r.e(41873),r.e(89269),r.e(74712),r.e(28551)]).then(r.bind(r,328691))),V=5*r(419681).Xb,j=new(r(552709)).O2("offlineOnboarding",()=>Promise.all([r.e(99115),r.e(13991),r.e(25688),r.e(46449),r.e(85239),r.e(46040)]).then(r.bind(r,822308))),B=(0,r(552709)._h)(j,e=>e.OfflinePagesListener),F=new(r(552709)).O2("useCleanMeetingNotesFailoverCachePeriodically",async()=>await Promise.all([r.e(58035),r.e(17521),r.e(17048),r.e(32911),r.e(90178),r.e(26)]).then(r.bind(r,707563))),H=new(r(552709)).O2("thirdPartyScripts",()=>Promise.all([r.e(91780),r.e(8359)]).then(r.bind(r,12230)));r(508945);let $="hello",G="browser_sw_v2_1_single_cache";async function z(){await (0,r(259533).waitForInitialPageRenderToComplete)(),await r(469945).A.waitUntil(()=>!r(469945).A.state.isMeasuring)}function X(e){let t=e.currentUser.isLoggedIn(),{device:i}=e;return"serviceWorker"in navigator&&t&&i.isBrowser&&!r(139424).A.isAdminMode&&!i.isMobileBrowser&&!i.isSafari}function Q(){var e;"serviceWorker"in navigator&&navigator.serviceWorker.getRegistration().then(e=>{null==e||e.unregister()}),null==(e=self.caches)||e.open(r(259533).BROWSER_SW_VERSION_CACHE_NAME).then(e=>{null==e||e.delete(r(259533).BROWSER_SW_VERSION_CACHE_PATH),null==e||e.delete(r(259533).BROWSER_SW_VERSION_CACHE_MIGRATION_VERSION_PATH),null==e||e.delete(r(259533).BROWSER_SW_VERSION_CACHE_GENERATION_PATH)})}async function J(e){if(!X(e))return;let t=r(218744).default.getLayer({layerName:"web_infra_serving_layer",disableExposureLogging:!0}).get("group","control"),i=r(218744).default.getEligibleGroup({experimentId:G,defaultGroup:"control",disableExposureLogging:!0});"on"===t&&"on"===i&&await z(),"serviceWorker"in navigator&&navigator.serviceWorker.getRegistration().then(e=>{e&&e.update()})}function Y(e){return void 0!==e&&e!==r(139424).A.buildTarget}async function Z(e){await r(192314).default.waitUntilRendered();let t=r(192314).AppStoreMainEditorCurrentBlockStore.state;return!!r(192314).AppStoreCurrentUserStore.state&&!!t&&!(0,r(142484).qb)(e,t,t.getSpaceStore())}async function ee(e,t){await Z(e)&&(r(994486).Dv(e,t,"banner"),r(474329).HQ({bannerCoordinator:r(623618)._,id:"AppUpdate",contentKey:"minor_app_update",styleKey:r(646478).q.Blue}))}function et(e){let{updateType:t,nextVersion:i,nextVersionCreatedTime:n,isRollback:a,environment:o}=e;if(r(994486).KD())return void(r(994486).Dv(o,t,"modal"),r(647095).ui({message:(0,g.jsx)(r(327219).sA,{defaultMessage:"We just launched new features!",id:"breakingUpdateDialog.title"}),showCancel:!1,keepFocus:!1,handleCancel:e=>{"tabHandoff"!==e&&r(994486).K0(o)},items:[{label:(0,g.jsx)(r(327219).sA,{defaultMessage:"Update and see what’s new",id:"breakingUpdateDialog.updateButtonTitle"}),color:"blue",onAccept:()=>r(994486).K0(o)}],innerStyle:{width:380}}));i&&r(994486).fC(i)&&r(994486).qr(i,n),(t===r(355981).Ur.Major||t===r(355981).Ur.Minor||r(994486).wT()||a)&&ee(o,t)}function er(e,t){let{AppUpdateStore:r}=t;r.state.appUpdate&&"ready"===r.state.appUpdate.state||r.setState({electronUpdate:r.state.electronUpdate,appUpdate:{state:"error",error:e}})}function ei(e,t){let{AppUpdateStore:i}=t;if(i.state.appUpdate&&"ready"===i.state.appUpdate.state)return;let n=(0,r(622231).parseVersion)(e.version),a=r(994486).Cv(),o=(0,r(355981).mj)({currentVersion:a,nextVersion:n,app:"client"});i.setState({electronUpdate:i.state.electronUpdate,appUpdate:{state:"downloading",type:o,version:n,timestamp:Date.now(),progress:0}})}function en(e,t){let{AppUpdateStore:r}=t,i=r.state;i.appUpdate&&"downloading"===i.appUpdate.state&&r.setState({electronUpdate:i.electronUpdate,appUpdate:{...i.appUpdate,progress:e.downloaded/e.total}})}function ea(e,t){let{AppUpdateStore:i}=t,n=(0,r(622231).parseVersion)(e.version),a=r(994486).Cv(),o=(0,r(355981).mj)({currentVersion:a,nextVersion:n,app:"client"}),s=(0,r(622231).isLessThanVersion)(n,a),l=e.createdTime;r(994486).fC(n)||i.setState({electronUpdate:i.state.electronUpdate,appUpdate:{state:"ready",type:o,version:n,versionCreatedTime:l,isRollback:s}}
1),et({updateType:o,nextVersion:n,nextVersionCreatedTime:l,isRollback:s,environment:t})}let eo="domain_migration_blocked";function es(){r(819652).UW({id:eo})}let el={recentPagesActions:new(r(552709)).O2("recentPagesActions",async()=>Promise.resolve().then(r.bind(r,384908))),userSignalsHelpers:new(r(552709)).O2("userSignalsHelpers",async()=>r.e(17077).then(r.bind(r,783782))),broadcastChannel:new(r(552709)).O2("broadcastChannel",async()=>Promise.resolve().then(r.bind(r,843517))),minisearchDependency:r(255636).f};function ec(e){let{elector:t,broadcastChannel:r}=e.state;e.setState(e.getInitialState()),(async()=>{await (null==t?void 0:t.die()),await (null==r?void 0:r.close())})()}async function ed(e){let{spaceStore:t,userId:i,environment:n}=e,a=t.id;ec(r(915681).A),(0,r(755235).So)(e=>({appStart:e.appStart,hookStart:e.hookStart,setupLocalSearchStart:performance.now()}));let o=el.recentPagesActions.load().then(async e=>{await e.reinitializeGlobalRecentPagesStoreState(n,i,t)}),s=el.userSignalsHelpers.load(),l=el.broadcastChannel.load(),c=(async()=>{let{BroadcastChannel:e,createLeaderElection:t}=await l,n=new e(`local_search_${a}_${i}`),o=(0,r(78543).r)()&&(0,r(168505).L)()?function(e){let t,i,n,a,o=!1,s={isLeader:!1,awaitLeadership:()=>(t??=new Promise(e=>{i=e}),l(),t),die:()=>(o=!0,c(),window.removeEventListener("pagehide",d),window.removeEventListener("pageshow",u),Promise.resolve())};function l(){if(o||n)return;let t=new AbortController;n=t,navigator.locks.request(e,{signal:t.signal},()=>{var e;return o?Promise.resolve():(s.isLeader=!0,null==(e=i)||e(),new Promise(e=>{a=e}))}).catch(e=>{o||t.signal.aborted||(0,r(208318).t)().error({from:"createWebLockLeaderElection",type:"localSearchLeaderElectionFailed",error:e})}).finally(()=>{n===t&&(n=void 0)})}function c(){var e,t;s.isLeader=!1,null==(e=a)||e(),a=void 0,null==(t=n)||t.abort(),n=void 0}function d(e){e.persisted&&c()}function u(e){e.persisted&&!o&&t&&l()}return window.addEventListener("pagehide",d),window.addEventListener("pageshow",u),s}(`local_search_leader_${a}_${i}`):t(n);r(915681).A.update(e=>({...e,elector:o,broadcastChannel:n}))})(),d=(await s).initializeAndLoadAllUserSignals({spaceId:a,userId:i,environment:n});await Promise.all([r(255636).f,o,d,c])}function eu(e){let t=(0,r(533992).v3)();(0,r(97668).Yb)(async()=>{if(!await (0,r(796310).Eo)({trackingType:"performance",cookieService:t.cookieService})||(await r(218744).default.waitUntilStatsigReadyAsync(),r(514806).StatsigInitializer.error||!r(514806).StatsigInitializer.isComplete))return;let i=r(218744).default.getConfig({configName:e,disableExposureLogging:!0});(0,r(826711).setBootDynamicConfig)(e,i)},[e,t])}function ep(e,t){let i=(0,r(533992).v3)();(0,r(97668).Yb)(async()=>{if(!await (0,r(796310).Eo)({trackingType:"performance",cookieService:i.cookieService})||(await r(218744).default.waitUntilStatsigReadyAsync(),r(514806).StatsigInitializer.error||!r(514806).StatsigInitializer.isComplete))return;let n={enableEventTrailLogging:null==t?void 0:t.enableEventTrailLogging,...(null==t?void 0:t.disableExposureLogging)!==void 0?{disableExposureLogging:t.disableExposureLogging}:{}},a=r(218744).default.getEligibleGroup({experimentId:e,...n});(0,r(826711).setBootExperimentGroup)(e,a)},[i,e,null==t?void 0:t.enableEventTrailLogging,null==t?void 0:t.disableExposureLogging])}function eg(e){let t=(0,r(533992).v3)();(0,r(97668).Yb)(async()=>{await (0,r(722399).persistBootStatsigGate)(t,e)},[t,e])}function ef(){return ep("query_client"),ep("prewarmed_tab_load_sidebar_exp"),ep("prefetch_slippery_slope"),eg("router_use_url_search_for_query_params"),eg("async_load_airgap_in_prod"),eg("sqlite_preload_use_nav_parent_id"),eg("sqlite_preload_ancestors"),eu("local_eval_statsig_denylist"),eu("routes_enabled_in_client_route_config_framework"),ep("enable_client_route_config_framework_phase_4"),ep("content_preview"),null}let ev=new(r(552709)).O2("useReactiveMessageEventListener",()=>r.e(42207).then(r.bind(r,805351)));function em(){var e,t;let u,f,v,h,b,_,S,w,k,L,A,T,C,E,U,I,R,M,j,Z,ee,el,eu,ep,eg,em,eS,ew,ek,eL,eA,eT,eC,eE,eU,eI,eR,eN,ex,eP,eM,eO,eD,eW,eK,eq,eV,ej,eB,eF,eH,e$,eG,ez,eX,eQ,eJ,eY,eZ,e0,e2,e9;(0,r(555540).V)();let e3=(0,r(533992).v3)(),e7=(0,r(80384).kg)();return u=(0,r(533992).v3)(),f=(0,i.useCallback)(()=>(function(e){let{AppUpdateStore:t}=e;t.setState({appUpdate:t.state.appUpdate,electronUpdate:{state:"checking"}})})(u),[u]),v=(0,i.useCallback)((e,t)=>(function(e,t){let{AppUpdateStore:r}=t;r.setState({appUpdate:r.state.appUpdate,electronUpdate:{state:"error",error:e}})})(t,u),[u]),h=(0,i.useCallback)(()=>(function(e){let{AppUpdateStore:t}=e;t.setState({appUpdate:t.state.appUpdate,electronUpdate:{state:"no-update",timestamp:Date.now()}})})(u),[u]),b=(0,i.useCallback)((e,t)=>(function(e,t){let{AppUpdateStore:i}=t,n=(0,r(622231).parseVersion)(e.version),a=(0,r(168179).getDesktopVersion)(),o=(0,r(355981).mj)({currentVersion:a,nextVersion:n,app:"desktop"});i.setState({appUpdate:i.state.appUpdate,electronUpdate:{state:"downloading",type:o,version:n,timestamp:Date.now(),progress:0}})})(t,u),[u]),_=(0,i.useCallback)((e,t)=>(function(e,t){let{AppUpdateStore:r}=t,i=r.state;i.electronUpdate&&"downloading"===i.electronUpdate.state&&r.setState({appUpdate:i.appUpdate,electronUpdate:{...i.electronUpdate,progress:e.transferred/e.total}})})(t,u),[u]),S=(0,i.useCallback)((e,t)=>(function(e,t){let{device:i}=t,{AppUpdateStore:n}=t,a=r(467008).A.get(r(994486).wp),o=e.version;if(a===o)if(i.isMac){n.setState({appUpdate:n.state.appUpdate,electronUpdate:{state:"ready",type:r(355981).Ur.Major,version:void 0,versionCreatedTime:0}}),r(647095).ui({message:(0,g.jsx)(r(327219).sA,{id:"desktopAppUpdater.moveNotionToApplicationsFolderDialog.prompt",defaultMessage:"Please move the Notion a
1pp into the Applications folder for the auto-updater to work."}),showCancel:!1,keepFocus:!1,handleCancel:e=>{"tabHandoff"!==e&&r(994486).K0(t)},items:[{label:(0,g.jsx)(r(327219).sA,{id:"desktopAppUpdater.moveNotionToApplicationsFolderDialog.dismissButton.label",defaultMessage:"OK"}),onAccept:()=>r(994486).K0(t)}]});return}else r(773352).log({level:"error",from:"AppUpdateListener",type:"electronUpdateFailed",data:{miscDataToConvertToString:{previousUpdateReady:a,nextUpdateReady:o}}});let s=(0,r(168179).getDesktopVersion)(),l=(0,r(622231).parseVersion)(e.version),c=(0,r(355981).mj)({currentVersion:s,nextVersion:l,app:"desktop"});n.setState({appUpdate:n.state.appUpdate,electronUpdate:{state:"ready",type:c,version:l,versionCreatedTime:0}})})(t,u),[u]),w=(0,i.useCallback)(()=>(function(e){let{AppUpdateStore:t}=e;t.state.appUpdate&&"ready"===t.state.appUpdate.state||t.setState({electronUpdate:t.state.electronUpdate,appUpdate:{state:"checking"}})})(u),[u]),k=(0,i.useCallback)((e,t)=>er(t,u),[u]),L=(0,i.useCallback)(()=>(function(e){let{AppUpdateStore:t}=e;t.state.appUpdate&&"ready"===t.state.appUpdate.state||t.setState({electronUpdate:t.state.electronUpdate,appUpdate:{state:"no-update",timestamp:Date.now()}})})(u),[u]),A=(0,i.useCallback)((e,t)=>ei(t,u),[u]),T=(0,i.useCallback)((e,t)=>en(t,u),[u]),C=(0,i.useCallback)((e,t)=>ea(t,u),[u]),E=(0,i.useCallback)(()=>(function(e){let t=e.AppUpdateStore;if(r(205885).A.getState().online&&t.isSilentUpdate()){let i=t.state.appUpdate;r(994486).JG({environment:e,url:window.location.href,version:i.version,versionCreatedTime:i.versionCreatedTime})}})(u),[u]),(0,i.useEffect)(()=>{let{device:e}=u;if(e.isElectron){let e=r(884972).Lz.addListener(S),t=r(884972).Gc.addListener(v),i=r(884972).WV.addListener(f),n=r(884972).L9.addListener(b),a=r(884972).n3.addListener(_),o=r(884972).Sn.addListener(h),s=r(884972).m0.addListener(C),l=r(884972).t0.addListener(k),c=r(884972).nT.addListener(w),d=r(884972).AX.addListener(A),u=r(884972).oF.addListener(E),p=r(884972).IC.addListener(T),g=r(884972).b7.addListener(L);return()=>{null==e||e(),null==t||t(),null==i||i(),null==n||n(),null==a||a(),null==o||o(),null==s||s(),null==l||l(),null==c||c(),null==d||d(),null==u||u(),null==p||p(),null==g||g()}}},[u,w,L,A,k,E,T,C,b,f,v,h,_,S]),(0,i.useEffect)(()=>{var e;let t,i,{device:n,mobileNative:a}=u;if(a&&a.updateReceiveApiHandlers({appUpdateReady:e=>ea(e,u),appUpdateError:e=>er(e,u),appUpdateChecking:w,appUpdateAvailable:e=>ei(e,u),appUpdateProgress:e=>en(e,u),appUpdateNotAvailable:L}),e=u,t=r(994486).Cv(),i=r(994486).B0(),(0,r(622231).isEqualVersion)(t,i)||et({updateType:(0,r(355981).mj)({currentVersion:t,nextVersion:i,app:"client"}),nextVersion:i,nextVersionCreatedTime:r(994486).bg(),isRollback:!1,environment:e}),n.isMobileNative&&a&&a.api.openUpdateSettings){let e=n.osVersion,t=n.isAndroid&&(0,r(622231).isLessThanVersion)(e,[7,0]),i=n.isIOS&&(0,r(622231).isLessThanVersion)(e,[18,0]);(t||i)&&function(e){let{mobileNative:t}=e;t&&r(474329).HQ({bannerCoordinator:r(623618)._,id:"PlatformUpdateWarning",contentKey:"mobile_platform_unsupported",styleKey:r(646478).q.Red})}(u)}},[u,w,L]),U=(0,i.useRef)(""),(0,i.useEffect)(()=>{let{device:e,mobileNative:t}=u;if(!t&&!e.isElectron&&!r(139424).A.isAdminMode){let e=setInterval(async function(){if(r(825244).A.state.isVisible)try{let e=r(994486).Cv(),t=await u.api.callApi({eventName:"getAssetsJsonV2",environment:u,data:{hash:U.current}});if("success"===t.type){let i=t.data;if(i.version){let t=Y(i.clientBuildTarget),n=(0,r(622231).parseVersion)(i.version);n&&((0,r(622231).isEqualVersion)(n,e)?t&&J(u):(ea(i,u),J(u))),U.current=i.hash}else Y(i.clientBuildTarget)&&J(u)}}catch(e){r(773352).log({level:"error",from:"AppUpdateListener",type:"checkForUpdatesFailed",error:(0,r(952977).convertErrorToLog)(e)})}},6e4);return()=>clearInterval(e)}},[u]),(0,i.useEffect)(()=>{let{device:e,mobileNative:t,AppUpdateStore:i}=u;if(!t&&!e.isElectron&&!r(139424).A.isAdminMode){let e=setInterval(function(){let e=i.state.appUpdate;(null==e?void 0:e.state)==="ready"&&null!=e&&e.isRollback&&!r(825244).A.state.isVisible&&r(205885).A.getState().online&&window.location.reload()},6e5);return()=>clearInterval(e)}},[u]),(0,i.useEffect)(()=>{(0,r(755235).So)(()=>({appStart:(0,r(737124).getAppStartTime)(),hookStart:performance.now()}))},[]),I=(0,r(533992).v3)(),R=(0,r(345776).T)(),j=null==(M=(0,r(972740).L)())?void 0:M.id,Z=(0,r(668745).ZC)(R),ee=(0,r(668745).ZC)(j),el=(0,r(579993).K8)(()=>
1{if(!M)return"";let e=(0,r(203462).zf)(I).getData(I,{spaceId:M.id});return e?(0,r(960408).My)(e.agents.map(e=>e.id)).join(","):""},[I,M]),eu=(0,r(668745).ZC)(el),(0,i.useEffect)(()=>{R&&j&&(R!==Z||j!==ee)&&(ec(r(915681).A),ed({spaceStore:M,userId:R,environment:I}))},[I,R,M,Z,ee,j]),(0,i.useEffect)(()=>{M&&el!==eu&&r(252116).G(I,"useLocalSearch")},[el,I,eu,M]),ep=(0,r(556583).K)(),eg=(0,r(919302).$)(),(0,i.useEffect)(()=>{ep&&eg&&(0,r(611918).e)(eg)},[ep,eg]),em=(0,r(723240).r)(),eS=(0,r(556583).y)(),ew=(0,r(579993).K8)(()=>r(329464).A.state.initialRenderCompleted,[]),ek=function(e){let t=(0,r(533992).v3)().currentUser.id,i=t&&e?(0,r(618919).F4)`
2				SELECT *
3				FROM offline_action
4				JOIN offline_page ON offline_action.impacted_page_id = offline_page.id
5					AND offline_action.meta_user_id = offline_page.meta_user_id
6				WHERE offline_action.meta_user_id = ${t}
7					AND offline_page.space_id = ${e}
8			`:void 0,{value:n}=(0,r(777946).u)("useAllOfflineActionsForSpace",i,{allowError:!0,rowType:r(305232).q});return n}(em),eL=(0,r(579993).K8)(()=>ek?function(e){let t=new(r(877167)).G(()=>new Set);for(let r of e)t.get(r.impacted_page_id).add(r.autosync_type);let i=0,n=0,a=0;for(let e of t.values())e.has("frecent")||e.has("smart_sync")?n++:e.has("not_autosynced")?i++:e.has("created_offline")&&a++;return{all_offline_pages:i+n+a,manual_offline_pages:i,autosynced_offline_pages:n,created_offline_offline_pages:a}}(ek):void 0,[ek],{equalityFn:r(931576).n}),eA=(0,i.useRef)(!1),eT=(0,i.useRef)(!0),(0,i.useEffect)(()=>{eL&&(eT.current=!0)},[eL]),(0,i.useEffect)(()=>{if(!eS||!ew||!eL)return;let e=()=>{(function(e){let{counts:t}=e;(0,r(104310).u)({event:{eventName:"offline_pages_counts",eventProperties:t}})})({counts:eL}),eT.current=!1};eA.current||(e(),eA.current=!0);let t=setInterval(()=>{eT.current&&e()},V);return()=>{clearInterval(t)}},[em,eS,ew,eL]),eC=(0,r(533992).v3)(),eE=(0,r(723240).r)(),eU=(0,r(556583).y)(),eI=(0,r(579993).K8)(()=>r(329464).A.state.initialRenderCompleted,[]),eR=(0,r(579993).K8)(()=>{var e;return null==(e=r(192314).AppStoreMainEditorCurrentBlockStore.state)?void 0:e.id},[]),(0,i.useEffect)(()=>{if(!eU||!eR||!eE||!eI)return;let e=eC.sqliteConnection;if(!e)return;let t=eC.currentUser.id;t&&(async()=>{var i;!function(e){let{status:t}=e;(0,r(104310).u)({event:{eventName:"page_offline_status",eventProperties:t}})}({status:{manual:(i=await (0,r(318909).Q)({connection:e,userId:t,spaceId:eE,pageId:eR})).includes("not_autosynced"),autosynced:i.includes("frecent")||i.includes("smart_sync"),created_offline:i.includes("created_offline")}})})()},[eC,eU,eE,eR,eI]),eN=(0,r(533992).v3)(),ex=(0,r(579993).O$)(r(205885).e),eP=(0,r(345776).T)(),eM=(0,r(723240).r)(),(0,i.useEffect)(()=>{let e=(0,r(716893).bB)();if(!e||!eP||!eM||!ex)return;let t=null,i=new AbortController,n=i.signal,a=()=>{e.cleanCacheForUser({userId:eP,spaceId:eM,environment:eN,waitUntilOpts:{signal:n,timeout:6e4}}).catch(e=>{r(773352).log({level:"error",from:"cleanCachePeriodically",type:"errorCleaningCache",error:(0,r(952977).convertErrorToLog)(e)})}).finally(()=>{n.aborted||(t=setTimeout(()=>{t=null,n.aborted||a()},3e5))})};return a(),()=>{i.abort(),t&&(clearTimeout(t),t=null)}},[eP,eM,ex,eN]),eD=X(eO=(0,r(533992).v3)()),eW=function(e){let t=e.currentUser.isLoggedIn(),{device:r}=e;return"serviceWorker"in navigator&&t&&r.isBrowser}(eO),eK=(0,r(83208).X)("disable_service_worker_in_browser"),eq=(0,r(929573).O)("web_infra_serving_layer",{disableExposureLogging:!0}).get("group","control"),eV=(0,r(604306).r)(G,{disableExposureLogging:!0}),ej="on"===eq&&"on"===eV,(0,i.useEffect)(()=>{eW&&!eD&&Q()},[eW,eD]),(0,i.useEffect)(()=>{eD&&eK&&Q()},[eD,eK]),(0,i.useEffect)(()=>{let e,t;if(!eD)return;let i=e=>{var t,i,n,a;if((null==(t=e.data)?void 0:t.type)==="service-worker-cached-index-miss"&&r(773352).log({level:"info",from:"useRegisterBrowserServiceWorker",type:"browserServiceWorkerCachedIndexMiss",data:{reason:e.data.reason,pathname:e.data.pathname}}),(null==(i=e.data)?void 0:i.type)==="service-worker-fetch-error"&&r(773352).log({level:"error",from:"useRegisterBrowserServiceWorker",type:"browserServiceWorkerFetchError",error:e.data.error}),(null==(n=e.data)?void 0:n.type)==="service-worker-install-error"&&r(773352).log({level:"error",from:"useRegisterBrowserServiceWorker",type:"browserServiceWorkerInstallError",error:e.data.error}),(null==(a=e.data)?void 0:a.type)==="report-service-worker-lifecycle"){let t=e.data.report;(0,r(104310).u)({event:{eventName:"browser_sw_lifecycle",eventProperties:{source:"worker",...t}},opts:{dontWait:!0}})}},n=()=>
8{"serviceWorker"in navigator&&navigator.serviceWorker.getRegistration().then(e=>{var t;null==e||null==(t=e.active)||t.postMessage({type:$})})},a=()=>{var i;let n=null==(i=e)?void 0:i.installing;n&&n!==t&&(t=n,function(e){let{worker:t,report:i}=e,n="installing",a=performance.now();t.addEventListener("statechange",()=>{let e=performance.now(),o=function(e){let{state:t,reached:i,duration_ms:n}=e;switch(t){case"installed":return{reached:"installed",record:{phase:"install",outcome:"success",duration_ms:n}};case"activating":return{reached:"activating"};case"activated":return{reached:"activated",record:{phase:"activate",outcome:"success",duration_ms:n}};case"redundant":{let e=function(e,t){switch(e){case"installing":return{phase:"install",outcome:"failure",duration_ms:t};case"installed":return{phase:"activate",outcome:"superseded",duration_ms:t};case"activating":return{phase:"activate",outcome:"failure",duration_ms:t};case"activated":return;default:return(0,r(48697).HB)(e)}}(i,n);return e?{reached:i,record:e}:{reached:i}}case"parsed":case"installing":return{reached:i};default:return(0,r(48697).HB)(t)}}({state:t.state,reached:n,duration_ms:Math.round(e-a)});a=e,n=o.reached,o.record&&i(o.record)})}({worker:n,report:e=>{(0,r(104310).u)({event:{eventName:"browser_sw_lifecycle",eventProperties:{source:"page",...e}},opts:{dontWait:!0}}),"install"===e.phase&&"failure"===e.outcome&&r(773352).log({level:"error",from:"useRegisterBrowserServiceWorker",type:"browserServiceWorkerInstallFailed",error:{message:"Installing service worker became redundant (install failed)"}})}}))},o=!1;if("serviceWorker"in navigator){navigator.serviceWorker.addEventListener("message",i),navigator.serviceWorker.addEventListener("controllerchange",n);let t=()=>{let t=performance.now();navigator.serviceWorker.register("/sw.js").then(i=>{var n;(0,r(104310).u)({event:{eventName:"browser_sw_lifecycle",eventProperties:{source:"page",phase:"register",outcome:"success",duration_ms:Math.round(performance.now()-t)}},opts:{dontWait:!0}}),e=i,i.addEventListener("updatefound",a),a(),null==(n=i.active)||n.postMessage({type:$})}).catch(e=>{(0,r(104310).u)({event:{eventName:"browser_sw_lifecycle",eventProperties:{source:"page",phase:"register",outcome:"failure",duration_ms:Math.round(performance.now()-t)}},opts:{dontWait:!0}}),r(773352).log({level:"warning",from:"useRegisterBrowserServiceWorker",type:"browserServiceWorkerRegistrationFailed",error:{message:String(e)}})})};ej?z().then(()=>{let e=r(218744).default.checkGate({gateName:"disable_service_worker_in_browser",disableExposureLogging:!0});o||e||t()}):t()}return()=>{if(o=!0,"serviceWorker"in navigator){var t;navigator.serviceWorker.removeEventListener("message",i),navigator.serviceWorker.removeEventListener("controllerchange",n),null==(t=e)||t.removeEventListener("updatefound",a)}}},[eD,ej]),(0,i.useEffect)(()=>{function e(e){}return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[!1]),eB=(0,r(83208).X)("enable_jam_recording_links"),eF=(0,r(552709).fJ)(K,{disabled:!eB}),eH=(0,r(579993).K8)(()=>r(714498).I.state.recordingLinkId,[]),i.useEffect(()=>{if(!eB)return;let{status:e,value:t}=eF;"resolved"===e&&t&&!t.isInitialized()&&t.initialize({teamId:"b729e17e-7abd-4cc6-a15f-256d0eceb210",openImmediately:eH})},[eF,eH,eB]),e$=(0,r(533992).v3)(),eG=(0,i.useRef)(!1),(0,i.useEffect)(()=>{var e;if(eG.current)return;let t=r(192314).AppStoreCurrentUserSettingsStore.state;if(!t)return;eG.current=!0;let i=r(255482).K.get({userId:e$.currentUser.id,key:r(347971).XK});if(!i)return;let n=(0,r(829093).a)(i);if(!n)return void r(255482).K.remove({userId:e$.currentUser.id,key:r(347971).XK});let a=null==(e=t.getSettings())?void 0:e.preferred_meeting_notes_language;if(a)return void(0,r(774094).p)({userId:e$.currentUser.id,from:"useMigrateDictationLanguageOnMount",additionalLogData:{existingUserSettingsLanguage:a,reason:"cleanupAfterMigration"}});let{serverCommitResult:o}=(0,r(323517).createAndCommit)({userAction:"migrateDictationLanguageToUserSettings",environment:e$,cellTarget:"main",canUndo:!1,perform:e=>{(0,r(862759).m)({userSettingsStore:t,transaction:e,data:{preferred_meeting_notes_language:n}})}});o.then(()=>{(0,r(774094).p)({userId:e$.currentUser.id,from:"useMigrateDictationLanguageOnMount",additionalLogData:{migratedLanguage:n,reason:"migrationSuccess"}})}).catch(e=>{r(773352).log({level:"error",from:"useMigrateDictationLanguageOnMount",type:"migrationFailed",error:(0,r(952977).convertErrorToLog)(e),data:{miscDataToConvertToString:{userId:e$.currentUser.id,attemptedLanguage:n}}})})},[e$]),function(){let e=(0,r(533992).v3)(),{WasmSqlite:t}=e;(0,i.useEffect)(()=>{t&&t.waitForInitialize().then(({retryInitializeEnabled:e,retryCount:t})=>{e&&(0,r(104310).u)({event:{eventName:"sqlite_record_cache.initialize.success",eventProperties:{retry_count:t}}})},e=>{if(e instanceof r(65364).pm){let{cause:t,retryCount:i,retryInitializeEnabled:n}=e;(0,r(104310).u)({event:{eventName:"sqlite_record_cache.initialize.error",eventProperties:{error_name:t instanceof Error?t.name:"unknown",error_message:t instanceof Error?t.message:"unknown",sqlite_code:(0,r(65364).xY)(t)?t.debugInfo.sqliteCo
8de:void 0,retry_initialize_enabled:"boolean"==typeof n?n:"unknown",retry_count:i}}})}})},[t,e])}(),ez=(0,r(83208).X)("exp_ping_polling"),eX=(0,r(83208).X)("exp_domain_migration_toast"),eQ="https://app.notion.com/exp/ping",eJ=(0,i.useRef)(0),eY=(0,i.useRef)(!1),eZ=(0,i.useRef)(!1),e0=(0,r(579993).K8)(()=>1e3*(r(218744).default.getConfig({configName:"exp_ping_polling_config"}).intervalSeconds??300),[]),e2=(0,i.useCallback)(async()=>{if(!eQ||eY.current)return;let e=r(192314).AppStoreSidebarSpaceStore.state,t=r(192314).AppStoreCurrentUserStore.state,n=null==e?void 0:e.id,a=null==e?void 0:e.getPlanType(),o=null==t?void 0:t.getEmail(),s=o?(0,r(801109).zN)(o):void 0;try{let e=await fetch(eQ,{method:"GET"});r(773352).log({level:"info",from:"useExpPingPolling",type:"exp_ping_success",data:{url:eQ,status:e.status,spaceId:n,planType:a,emailDomain:s}}),eJ.current=0,eX&&eZ.current&&(eZ.current=!1,es())}catch(e){if(r(773352).log({level:"error",from:"useExpPingPolling",type:"exp_ping_error",error:(0,r(952977).convertErrorToLog)(e),data:{url:eQ,spaceId:n,planType:a,emailDomain:s}}),eJ.current+=1,eX&&!eZ.current&&eJ.current>=2){let e;eZ.current=!0,e=r(962299).A.getIntl(),r(819652).HK({id:eo,presentationType:"persistent",variant:"error",title:e.formatMessage({id:"useExpPingPolling.domainMigrationToast.titleV2",defaultMessage:"Notion is working normally"}),jsxMessage:e.formatMessage({id:"useExpPingPolling.domainMigrationToast.messageV2",defaultMessage:"We're moving Notion's web address from notion.so to app.notion.com soon. You will need to ask IT to allowlist *.notion.com to avoid access issues during the transition. To learn more, see <link>this article</link>."},{link:e=>(0,i.createElement)("a",{href:"https://www.notion.com/help/notion-error-messages#general-troubleshooting",target:"_blank",rel:"noopener noreferrer"},...e)}),onUserDismiss:()=>{eY.current=!0,eZ.current=!1}})}}},[eQ,eX]),(0,i.useEffect)(()=>{eX||es()},[eX]),(0,i.useEffect)(()=>{if(!ez||!eQ)return;let e=()=>{("u"<typeof document||"visible"===document.visibilityState)&&e2()};e();let t=window.setInterval(e,e0);return()=>{window.clearInterval(t)}},[ez,eQ,e2,e0]),t=!e3.device.isElectron&&!e3.device.isMobileNative,e9=(0,r(579993).K8)(()=>{var e;return r(585823).gZ.state||!!(null==(e=r(585823).ei.state)?void 0:e.isMeetingNoteBlock())},[]),(0,i.useEffect)(()=>{if(t&&e9)return function(){let e;if(!("wakeLock"in navigator))return()=>{};let t=!0,r=!1,i=!1;async function n(){if(t&&"visible"===document.visibilityState&&(void 0===e||e.released)){if(r){i=!0;return}r=!0;try{let r=await navigator.wakeLock.request("screen");t?(e=r,r.addEventListener("release",o)):await x(r)}catch(e){P("screenWakeLockRequestFailed",e)}finally{r=!1,i&&(i=!1,n())}}}function a(){n()}function o(){n()}return document.addEventListener("visibilitychange",a),n(),()=>{if(!t)return;t=!1,document.removeEventListener("visibilitychange",a);let r=e;e=void 0,void 0!==r&&x(r)}}()},[t,e9]),(0,r(383953).w)(()=>{(0,r(288442).y)();try{!function(e){if("u"<typeof document)throw Error("persistLsSyncCookie requires a browser document");let t=document,r=e;if(void 0===r){if("u"<typeof window)throw Error("persistLsSyncCookie requires a browser window");r=window.location.hostname}if("localhost"!==r&&".so"!==r.slice(-3))return;let i=()=>{let e=";path=/;max-age=0;SameSite=Lax;Secure";t.cookie=`${n}=${e}`,t.cookie=`${n}=;domain=${r}${e}`},s={},l=!1;for(let e of a){let t=localStorage.getItem(e);null!==t&&(s[e]=t,l=!0)}let c=[];for(let e of o)for(let t=0;t<localStorage.length;t++){let r=localStorage.key(t);r&&("prefix"===e.type?r.startsWith(e.value):r.endsWith(e.value))&&c.push(r)}if(!l&&0===c.length)return i();let d={...s},u=encodeURIComponent(JSON.stringify(d));for(let e of c){let t=localStorage.getItem(e);if(null===t)continue;d[e]=t;let r=encodeURIComponent(JSON.stringify(d));r.length>3500?delete d[e]:u=r}u.length<=3500?t.cookie=`${n}=${u};path=/;max-age=31536000;SameSite=Lax;Secure`:i()}(void 0)}catch(e){(0,r(165219).xr)({keyId:n,keyValue:"",from:"persistLsSyncCookie",error:e})}r(884353).hR({device:e3.device,config:r(139424).A,cookieService:e3.cookieService})}),(0,g.jsxs)(g.Fragment,{children:[!r(139424).A.isMobile&&e3.device.isElectron?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(eb,{}),(0,g.jsx)(B,{}),(0,g.jsx)(e_,{dependency:q,hook:e=>e.useCalendarMeetingNotificationScheduler})]}):void 0,r(139424).A.isMobile?void 0:(0,g.jsx)(p,{}),r(139424).A.isMobile?void 0:(0,g.jsx)(y,{}),!r(139424).A.isMobile&&e7?(0,g.jsx)(ey,{}):void 0,r(139424).A.isMobile||null!=(e=e3.mobileNative)&&e.supportsNativeHomeOnPhone()?void 0:(0,g.jsx)(e_,{dependency:r(884373).W,hook:e=>e.useCacheSidebarImages}),(0,g.jsx)(e_,{dependency:r(884373).W,hook:e=>e.useFetchImportantPagesAfterSqliteCorruptionRecovery}),r(139424).A.isMobile?void 0:(0,g.jsx)(m,{}),(0,g.jsx)(eh,{}),(0,g.jsx)(e_,{dependency:H,hook:e=>e.useThirdPartyScripts}),(0,g.jsx)(O,{}),(0,g.jsx)(e_,{dependency:D,hook:e=>e.useRecentEventsListener}),(0,g.jsx)(e_,{dependency:ev,hook:e=>e.useReactiveMessageEventListener}),(0,g.jsx)(e_,{dependency:c,hook:e=>e.useMeetingKeywordToast}),(0,r(855216).Eu)("production")?(0,g.jsx)(e_,{dependency:l,hook:e=>e.useDataScoutMetricToastDevOnly}):void 0,(0,g.jsx)(e_,{dependency:s,hook:e=>e.useAIDatabaseBuildToast}),(0,g.jsx)(e_,{dependency:r(884373).W,hook:e=>e.useUpdateAutosyncedPages}),(0,g.jsx)(e_,{dependency:r(884373).W,hook:e=>e.useRefetchOfflinePages}),(0,g.jsx)(e_,{dependency:r(884373).W,hook:e=>e.useGarbageCollectOrphanedOfflineRows}),(0,g.jsx)(e_,{dependency:W,hook:e=>e.useUserLifecycleProfile}),(0,g.jsx)(e_,{dependency:F,hook:e=>e.useCleanMeetingNotesFailoverCachePeriodically}),(0,r(894062).n)()?(0,g.jsx)(e_,{dependency:N,hook:e=>e.useMeetingNotesFailoverRecoveryController}):void 0,(0,g.jsx)(e_,{dependency:d,hook:e=>e.useThreadOutboxRecovery}),(0,g.jsx)(ef,{})]})}function eh(){return(0,r(556583).y)()?(0,g.jsx)(r(337336).K,{team:"web-infra",from:"OfflineSyncListeners",fallback:()=>null,children:(0,g.jsx)(e_,{dependency:r(884373).W,hook:e=>e.usePageSubscriptionManager})}):null}function eb(){let e=(0,r(579993).K8)(()=>r(898735).A.state.isActiveTab,[]);return(0,g.jsx)(R,{isActiveTab:e??!1})}function ey(){return(0,r(80384).a1)(),null}function e_(e){let{value:t}=(0,r(552709).fJ)(e.dependency);return t?(0,g.jsx)(eS,{hook:e.hook(t)}):null}function eS(e){return e.hook(),null}},229888(e,t,r){function i(){let e=(0,r(533992).Y0)();return(0,r(579993).K8)(()=>!!r(415039).E.getState().botId&&(e.isElectron&&!r(218744).default.checkGate({gateName:"meeting_notification_web_locks_leader_election"})?r(898735).A.state.isActiveTab??!1:r(63528).l.getState().hasWebLock),[e.isElectron])}r.d(t,{L:()=>i})},774094(e,t,r){function i(e){let{userId:t,from:i,additionalLogData:n}=e,a=r(255482).K.get({userId:t,key:r(347971).XK});if(a)return r(255482).K.remove({userId:t,key:r(347971).XK}),r(773352).log({level:"info",from:i,type:"localStorageMigrationSuccess",data:{miscDataToConvertToString:{userId:t,previousLocalStorageValue:a,...n}}}),a}r.d(t,{p:()=>i})},288442(e,t,r){var i=()=>r(735303);let n={ko:()=>r.e(84525).then(r.bind(r,723608)),es:()=>r.e(1273).then(r.bind(r,499735)),de:()=>r.e(23379).then(r.bind(r,917797)),fr:()=>r.e(58609).then(r.bind(r,32867)),pt:()=>r.e(85712).then(r.bind(r,101699)),zh:()=>r.e(25122).then(r.bind(r,560744)),ja:()=>r.e(18254).then(r.bind(r,59910)),da:()=>r.e(23940).then(r.bind(r,386963)),fi:()=>r.e(97970).then(r.bind(r,23573)),nb:()=>r.e(90849).then(r.bind(r,607288)),nl:()=>r.e(5727).then(r.bind(r,59055)),sv:()=>r.e(66388).then(r.bind(r,767056)),th:()=>r.e(5875).then(r.bind(r,159935)),id:()=>r.e(86049).then(r.bind(r,326497)),vi:()=>r.e(51526).then(r.bind(r,631696)),he:()=>r.e(47186).then(r.bind(r,127879)),ar:()=>r.e(72093).then(r.bind(r,304206)),it:()=>r.e(39377).then(r.bind(r,94561))},a=!1,o=!1;async function s(e){for(let[r,n]of Object.entries(e.emojiLocaleKeywords)){var t;i().fB[r]={...i().fB[r],keywords:[...n,...(null==(t=i().fB[r])?void 0:t.keywords)||[]]}}await (0,r(21791).loadAndCacheEmojiDataOnce)(),r(753281).A.update(({emojiByName:t,...r})=>({...r,emojiByName:{...t,...e.emojiByName}}))}async function l(){o||(await s(await r.e(86009).then(r.bind(r,348842))),o=!0)}async function c(){if(a)return;let[e]=r(849917).locale.split("-");e in n&&(await s(await n[e]()),a=!0)}let d=(0,r(517122).A)(async()=>{await l(),await c()});r.d(t,{},{y:d})},63528(e,t,r){r(730330),r(976614),r(139583),r(765324);var i=()=>r(552923);class n extends i().u{abortController;isAcquiringWebLock=!1;isAcquiringVisibleTabLock=!1;hasVisibleTabLock=!1;lockRequestId=0;visibilityChangeHandler;releaseLockHandler;pageShowHandler;constructor(){super({getInitialState:()=>({hasWebLock:!1}),effect:()=>(r(192314).AppStoreSidebarSpaceIdStore.addListener(e),window.addEventListener("pageshow",this.pageShowHandler),e(),()=>{r(192314).AppStoreSidebarSpaceIdStore.removeListener(e),window.removeEventListener("pageshow",this.pageShowHandler),this.cleanupLastLock()})});const e=this.setupCalendarBrowserSubscriptionLock.bind(this);this.visibilityChangeHandler=async()=>{document.hasFocus()&&await (0,r(326904).wR)(100),"visible"===document.visibilityState&&(this.requestWebLock({steal:document.hasFocus()}),this.maybeRequestSecondaryVisibleTabLock()),"hidden"===document.visibilityState&&this.maybeRelinquishLock()},this.releaseLockHandler=()=>{this.cleanupLastLock()},this.pageShowHandler=e=>{e.persisted&&this.setupCalendarBrowserSubscriptionLock()}}cleanupLastLock(){var e;null==(e=this.abortController)||e.abort("cleanup_last_lock"),document.removeEventListener("visibilitychange",this.visibilityChangeHandler),window.removeEventListener("focus",this.visibilityChangeHandler),window.removeEventListener("unload",this.releaseLockHandler),window.removeEventListener("pagehide",this.releaseLockHandler)}async maybeRelinquishLock(){await (0,r(326904).wR)(100),"visible"===document.visibilityState||document.hasFocus()||this.state.hasWebLock&&this.get
8SecondaryVisibleTabShouldStealChannel().postMessage("relinquish")}async setupCalendarBrowserSubscriptionLock(){this.cleanupLastLock(),(0,r(78543).r)()?window.addEventListener("pagehide",this.releaseLockHandler):window.addEventListener("unload",this.releaseLockHandler),this.requestWebLock({steal:!1}),this.maybeRequestSecondaryVisibleTabLock(),await (0,r(326904).lG)([this.waitUntil(()=>this.state.hasWebLock),r(329464).A.waitUntil(()=>r(329464).A.state.initialRenderCompleted)]),this.requestWebLock({steal:"visible"===document.visibilityState&&document.hasFocus()}),document.addEventListener("visibilitychange",this.visibilityChangeHandler),window.addEventListener("focus",this.visibilityChangeHandler)}getLockName(){let e=r(192314).AppStoreSidebarSpaceIdStore.getState();return e?`app_level_calendar_event_subscription_leader-${e}`:"app_level_calendar_event_subscription_leader"}getSecondaryVisibleTabLockName(){return`${this.getLockName()}-secondary_visible_tab`}getSecondaryVisibleTabShouldStealChannel(){return new BroadcastChannel(`${this.get
8SecondaryVisibleTabLockName()}-should_steal`)}async maybeRequestSecondaryVisibleTabLock(){if("visible"!==document.visibilityState||this.state.hasWebLock||this.isAcquiringVisibleTabLock||this.hasVisibleTabLock)return;this.isAcquiringVisibleTabLock=!0;let e=new AbortController;document.addEventListener("visibilitychange",()=>e.abort("became_hidden"),{once:!0,signal:e.signal}),this.waitUntil(()=>this.state.hasWebLock,{signal:e.signal}).then(()=>e.abort("became_leader")).catch(()=>{});try{await navigator.locks.request(this.getSecondaryVisibleTabLockName(),{mode:"exclusive",signal:e.signal},async()=>{this.isAcquiringVisibleTabLock=!1,this.hasVisibleTabLock=!0,e.signal.aborted||await new Promise(t=>{this.getSecondaryVisibleTabShouldStealChannel().addEventListener("message",()=>{this.requestWebLock({steal:!0}),t()},{once:!0,signal:e.signal}),e.signal.addEventListener("abort",t,{once:!0})})})}catch{}this.isAcquiringVisibleTabLock=!1,this.hasVisibleTabLock=!1,e.signal.aborted||e.abort("cleanup")}async visibleTabAwaitingLockExists(){var e,t;let r=await navigator.locks.query(),i=null==(e=r.held)||null==(e=e.find(e=>e.name===this.getSecondaryVisibleTabLockName()))?void 0:e.clientId,n=null==(t=r.pending)?void 0:t.filter(e=>e.name===this.getLockName());return i&&(null==n?void 0:n.some(e=>e.clientId===i))}async requestWebLock(e){var t;let{steal:i}=e;if(!r(192314).AppStoreSidebarSpaceIdStore.getState()||this.state.hasWebLock||this.isAcquiringWebLock&&!i)return;let n=++this.lockRequestId;this.isAcquiringWebLock=!0,null==(t=this.abortController)||t.abort("new_request");let a=new AbortController;this.abortController=a;try{await navigator.locks.request(this.getLockName(),{mode:"exclusive",steal:i,signal:i?void 0:a.signal},async()=>{this.isAcquiringWebLock=!1,"visible"!==document.visibilityState&&await this.visibleTabAwaitingLockExists()&&(await (0,r(326904).wR)(100),this.get
8SecondaryVisibleTabShouldStealChannel().postMessage("should_steal")),a.signal.aborted||(this.setState({hasWebLock:!0}),await new Promise(e=>{a.signal.addEventListener("abort",()=>e(),{once:!0})}))})}catch{}n===this.lockRequestId&&(this.setState({hasWebLock:!1}),this.isAcquiringWebLock=!1,a.signal.aborted||this.requestWebLock({steal:!1})),a.signal.aborted||a.abort("cleanup"),this.maybeRequestSecondaryVisibleTabLock()}}let a=new n,o=new(r(47824)).ComputedStore(()=>r(218744).default.checkGate({gateName:"debug__disable_app_activity_subscription_leader"})?{hasWebLock:!1}:a.getState(),{debugName:"DEBUG__InAppActivitySubscriptionLeaderStore"});(0,r(202146).exposeDebugGetter)("InAppActivitySubscriptionLeaderStore",()=>o.getState()),r.d(t,{},{l:o})},919302(e,t,r){function i(e){let t=(0,r(533992).v3)(),{spaceId:i,orderBy:n,limit:a}=e??{},o=t.currentUser.id,s=o?(0,r(654725).m)({userId:o,spaceId:i,orderBy:n,limit:a}):void 0,{value:l}=(0,r(777946).u)("useOfflinePages",s,{allowError:!0,rowType:r(305232).m});return l}r.d(t,{$:()=>i})},775672(e,t,r){function i(e){let t=(0,r(533992).v3)(),i=(0,r(226309).lh)({spaceId:e});return(0,r(579993).K8)(()=>void 0!==e&&void 0!==i&&void 0!==r(547631).a.getData(t,{spaceId:e}),[t,e,i])}r.d(t,{P:()=>i})},128817(e,t,r){function i(e,t,i){var n;let a=r(192314).AppStoreCurrentUserSettingsStore.state;if(!a)return;let o=null==(n=a.getSettings())?void 0:n.tutorials;i?(0,r(862759).m)({userSettingsStore:a,transaction:i,data:{tutorials:{...o,[t]:(0,r(752153).i9)(a,t)}}}):u({userAction:"TutorialActions.nextStep",environment:e,perform:e=>{(0,r(862759).m)({userSettingsStore:a,transaction:e,data:{tutorials:{...o,[t]:(0,r(752153).i9)(a,t)}}})},userId:a.id})}function n(e,t){var i;let n=r(192314).AppStoreCurrentUserSettingsStore.state;if(!n)return;let a=null==(i=n.getSettings())?void 0:i.tutorials;u({userAction:"TutorialActions.prevStep",environment:e,perform:e=>{(0,r(862759).m)({userSettingsStore:n,transaction:e,data:{tutorials:{...a,[t]:(0,r(752153).KD)(n,t)}}})},userId:n.id})}function a(e,t){var i;let n=r(192314).AppStoreCurrentUserSettingsStore.state;if(!n)return;let a=null==(i=n.getSettings())?void 0:i.tutorials;(null==a?void 0:a[t])!==r(212169).YD&&u({userAction:"TutorialActions.dismissTutorial",environment:e,perform:e=>{(0,r(862759).m)({userSettingsStore:n,transaction:e,data:{tutorials:{...a,[t]:r(212169).YD}}})},userId:n.id})}function o(e){let t=r(192314).AppStoreCurrentUserSettingsStore.state;t&&u({userAction:"TutorialActions.resetTutorialsDebug",environment:e,perform:e=>{(0,r(862759).m)({userSettingsStore:t,transaction:e,data:{tutorials:{}}})},userId:t.id})}function s(e,t,i){var n;let a=r(192314).AppStoreCurrentUserSettingsStore.state;if(!a||(0,r(752153).x$)(a,t))return;let o=(0,r(752153).gt)(a,t);r(212169).c$[t].steps.findIndex(e=>e.id===o)>=r(212169).c$[t].steps.findIndex(e=>e.id===i)||(0,r(862759).m)({userSettingsStore:a,transaction:e,data:{tutorials:{...null==(n=a.getSettings())?void 0:n.tutorials,[t]:i}}})}function l(e,t,i){if((0,r(752153).ll)(i))return;let n=(0,r(752153).tb)(t,i);n&&s(e,t,n)}function c(e){var t;let{environment:i,tutorialId:n,tutorialStepId:a,transaction:o}=e,s=r(192314).AppStoreCurrentUserSettingsStore.state;if(!s)return;let l=null==(t=s.getSettings())?void 0:t.tutorials;o?(0,r(862759).m)({userSettingsStore:s,transaction:o,data:{tutorials:{...l,[n]:a}}}):u({userAction:"TutorialActions.nextStep",environment:i,perform:e=>{(0,r(862759).m)({userSettingsStore:s,transaction:e,data:{tutorials:{...l,[n]:a}}})},userId:s.id})}function d(e){let t=r(192314).AppStoreCurrentUserSettingsStore.state;return!!t&&(0,r(752153).x$)(t,e)}function u(e){return(0,r(323517).createAndCommit)({...e,canUndo:!1,cellTarget:"main"})}r.r(t),r.d(t,{checkIsTutorialDone:()=>d,dismissTutorial:()=>a,resetTutorials:()=>o,tutorialAdvanceToStep:()=>s,tutorialAdvanceToStepAfter:()=>l,tutorialGoToNextStep:()=>i,tutorialGoToPrevStep:()=>n,tutorialGoToStep:()=>c})},855216(e,t,r){let i={local:{agentUrl:"http://localhost:3000/agent/391104cd477e808cb8830092c769c88e",workflowId:"391104cd-477e-808c-b883-0092c769c88e",owningSpaceId:"24e104cd-477e-8137-bfc9-0003c8bfdc65"},development:{agentUrl:"https://app.dev.notion.com/agent/2e2b35e6e67f80f682740092a56e88ef",workflowId:"2e2b35e6-e67f-80f6-8274-0092a56e88ef",owningSpaceId:"fcf3e52b-079c-8162-9f33-0003fce6921e"}},n=/^[\p{L}\p{N}][\p{L}\p{N} %/_.&+()-]*$/u,a=/[\p{Cc}]/u;function o(e){return i[e]}function s(e){return void 0!==i[e]}function l(e){if(a.test(e))return;let t=e.trim().replace(/\s+/g," ");
8if(0!==t.length&&!(t.length>80)&&!(t.split(" ").length>6)&&n.test(t))return t}r.d(t,{Eu:()=>s,Kz:()=>l,LB:()=>o})},517122(e,t,r){function i(e){let t,r,i;return async(...n)=>t?(i=n,r)?r:r=t.then(()=>(r=void 0,t=e(...i))):t=e(...n)}r.d(t,{A:()=>i})}}]);

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.