PageSourceSearch

https://kristinaliburd.notion.site/_assets/SidebarAgentShortcut-b2b1871a8010a603.js

js kristinaliburd.notion.site collected 2026-10-10 00:11:39 UTC 9,763 bytes, 1 lines download raw bytes

1"use strict";(globalThis.rspackChunknotion_next=globalThis.rspackChunknotion_next||[]).push([[20167],{636255(e,t,o){var a=o(635790),i=o(440302);function n({children:e,onChange:t,horizontal:l,style:r}){let s=(0,a.useRef)(null),c=(0,a.useRef)(0),d=(0,a.useRef)(0);return(0,a.useEffect)(()=>{let e=s.current;if(!e)return;let a=(0,o(54503).NM)(e);if(a){function i(){return(null==a?void 0:a.scrollTop)||0}function n(){if(l){let o=function(){if(!e||!a)return 0;{let t=e.getBoundingClientRect(),o=a.getBoundingClientRect(),{scrollLeft:i,scrollWidth:n}=a,l=t.left+t.width+i-o.left,r=i+o.width;return n-t.width-(r-l)}}(),n={offsetFromTop:i()};o!==d.current&&(d.current=o,t(o,n))}else{let o=function(){if(!e||!a)return 0;{let t=e.getBoundingClientRect(),o=a.getBoundingClientRect(),{scrollTop:i}=a;return t.top+t.height+i-o.top-(i+o.height)}}(),n={offsetFromTop:i()};o!==c.current&&(c.current=o,t(o,n))}}n();let r=(0,o(960408).nF)(function(e){n()},50);return(0,o(166027).P)({el:a,eventName:"scroll",callback:r}),()=>{(0,o(260244).O)({el:a,eventName:"scroll",callback:r})}}},[l,t]),(0,i.jsx)("div",{...o(398276).A.props(r),ref:s,children:e})}o.d(t,{F:()=>n})},497857(e,t,o){o(635790);var a=o(440302);function i(){return(0,a.jsx)(o(16275).I,{icon:o(746204).w,size:"lg",colorVariant:"primary"})}o.d(t,{h:()=>i})},590943(e,t,o){let a=new(o(552709)).O2("pagePresentationActions",async()=>await Promise.resolve().then(o.bind(o,697203)));o.d(t,{},{e:a})},884093(e,t,o){o(159952),o(635790);var a=o(440302);let i=(0,o(327219).YK)({moveToTab:{id:"useMoveSectionToTabActions.title.moveToTab",defaultMessage:"Move to tab"},newTab:{id:"useMoveSectionToTabActions.option.newTab",defaultMessage:"New tab"}}),n={width:16};function l(e){let{item:t,tabPlacement:l,onSelect:r}=e,s=(0,o(327219).tz)(),c=(0,o(960253).e)();if(!(null!=l&&l.allowsCrossTabMoves)||!t)return[];let{tabs:d,activeTabId:u,moveItemToTab:v,getMoveItemToTabDisabledTooltip:f,moveItemToNewTab:b}=l,g=(0,o(190278).Nq)({tabs:d}),m=d.map(e=>(0,o(876011).Ls)({key:`moveToTab-${e.id}`,displayName:void 0,analyticsName:"moveToTab",validators:[],closeParentMenu:!0,action:()=>{v(t,e.id),r()},render:i=>{let l=f(t,e.id),r=void 0!==l;return(0,a.jsx)(o(51831).m_,{disableTooltip:!r,placement:"left",content:()=>l,children:t=>(0,a.jsx)(o(95582).A,{...i,...t,title:e.name,disabled:r,disabledFeedback:r,icon:(0,a.jsx)(o(130867).j,{iconName:e.icon.name,color:o(111012).l8[c].gray}),right:e.id===u&&(0,a.jsx)(o(16275).I,{icon:o(971730).checkmarkSmallIcon,size:"sm"}),rightStyle:n})})}})),w=(0,o(876011).Ls)({key:"moveToNewTab",displayName:i.newTab,analyticsName:i.newTab.defaultMessage,validators:[],disabled:()=>!g,closeParentMenu:!0,action:()=>{b(t),r()},render:e=>(0,a.jsx)(o(860287).A,{...e,title:s.formatMessage(i.newTab),svg:o(581923).plusIcon,disabled:!g,disabledFeedback:!g,tooltipText:g?void 0:s.formatMessage(o(973969).p.reached)})});return[(0,o(110561).u)({key:"moveToTab",displayName:i.moveToTab,analyticsName:i.moveToTab.defaultMessage,validators:[],svg:o(21724).F,alignmentToOrigin:"start",subActions:()=>[(0,o(876011).gy)({key:"tabs",actions:m}),(0,o(876011).gy)({key:"newTab",render:e=>(0,a.jsx)(o(83743).A,{...e,topBorder:!0}),actions:[w]})]})]}o.d(t,{v:()=>l})},775895(e,t,o){o.r(t);var a=o(635790),i=o(440302);let n=(0,o(327219).YK)({noAccess:{id:"sidebar.simplification.agentShortcut.noAccess",defaultMessage:"No access"}}),l={button:{...o(132261).D.baseSidebarItem,transition:"none"},fullWidth:{width:"100%"},loadingIcon:{width:20,height:20}};function r(e){var t;let r=(0,o(275141).cZ)(),c=null==(t=(0,o(275141).Z$)())?void 0:t.sectionId,{shortcut:d,isCustomizationMode:u,tabPlacement:v}=e,f=(0,o(533992).v3)(),{navigate:b}=(0,a.useContext)(o(44894).E),g=(0,o(327219).tz)(),m=(0,o(196394).O)(d),w=(0,o(500786).h)(d.workflowId),[h,p]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!w)return void p(!1);let e=!1;return p(!1),w.load().catch(t=>{(0,o(208318).t)().log({level:"warning",from:"SidebarAgentShortcut",type:"loadAgentFailed",error:(0,o(952977).convertErrorToLog)(t)}),e||p(!0)}),()=>{e=!0}},[w]);let T=(0,o(579993).K8)(()=>null!=w&&w.isDefined()?(0,o(520653).V)(w)?"available":"unavailable":h?"unavailable":"loading",[h,w]),y=(0,o(579993).K8)(()=>"available"===T&&null!=w&&w.isDefined()?(0,o(575422).m)(w,g):void 0,[g,T,w]),I="unavailable"===T?g.formatMessage(n.noAccess):(null==y?void 0:y.name)??"",x=(0,o(13075).d)({shortcutKey:(0,o(476431).jR)(d),tabPlacement:v,sectionId:c}),S=(0,a.useCallback)(e=>{"available"===T&&b({environment:f,url:(0,o(453573).Lm)({workflowId:d.workflowId,params:{workflowViewType:"chat"}}
1),openInNew:(0,o(7029).V)(e)})},[f,b,d.workflowId,T]),k=(0,a.useCallback)(()=>r(e=>(0,o(481790).O0)({config:e,tabId:v.activeTabId,sectionId:c,shortcutKey:(0,o(476431).jR)(d)}),"sidebarSimplificationTabs.removeAgentShortcut"),[c,r,v.activeTabId,d]),M="unavailable"===T?(0,i.jsx)(o(16275).I,{icon:o(789777).exclamationMarkTriangleFillIcon,colorVariant:"secondary",size:"lg"}):(0,i.jsx)(s,{workflowStore:w,agentIcon:null==y?void 0:y.icon});return u?(0,i.jsx)(o(480968).V,{label:I,leadingIcon:M,trailingAccessory:x?(0,i.jsx)(o(639412).D,{moveToTab:{tabPlacement:v,shortcutKey:(0,o(476431).jR)(d)}}):void 0,removeAriaLabel:g.formatMessage(o(596415).E.removeFromSidebar),onRemove:k}):(0,i.jsx)(o(153774).P,{isSelected:m,onRemove:k,moveToTab:{tabPlacement:v,shortcutKey:(0,o(476431).jR)(d)},children:(0,i.jsx)("div",{style:l.fullWidth,"data-sidebar-customization-action":!0,children:(0,i.jsx)(o(64960).Ay,{ariaLabel:I,style:{...l.button,width:"100%"},hoveredStyle:o(153774).Z.hoveredStyle,pressedStyle:o(153774).Z.pressedStyle,onClick:S,allowShiftClick:!0,disabled:"available"!==T,children:(0,i.jsx)(o(538105).u,{left:M,children:I})})})})}function s(e){let{workflowStore:t,agentIcon:a}=e;return t?(0,i.jsx)(o(651790).AgentIcon,{agentIcon:a,workflowStore:t,size:20}):(0,i.jsx)("span",{style:l.loadingIcon})}o.d(t,{SidebarAgentShortcut:()=>r})},13075(e,t,o){o(730330),o(139583),o(159952);var a=o(635790),i=o(440302);let n=(0,o(327219).YK)({moveUp:{id:"sidebar.simplification.shortcut.moveShortcutUp",defaultMessage:"Move up"},moveDown:{id:"sidebar.simplification.shortcut.moveShortcutDown",defaultMessage:"Move down"}});function l(e){let{shortcutKey:t,tabPlacement:l,onSelect:r}=e,c=(0,o(327219).tz)(),d=(0,o(275141).cZ)(),u=(0,o(275141).Z$)(),v=(0,a.useMemo)(()=>({type:"shortcut",shortcutKey:t}),[t]),f=(0,o(884093).v)({item:v,tabPlacement:l,onSelect:r});return[...s({shortcutKey:t,tabPlacement:l,sectionId:null==u?void 0:u.sectionId}).map(e=>{let a=n[e];return(0,o(876011).Ls)({key:e,displayName:void 0,analyticsName:a.defaultMessage,validators:[],closeParentMenu:!0,action:()=>{d(a=>(0,o(481790).nz)({config:a,tabId:(null==u?void 0:u.tabId)??l.activeTabId,sectionId:null==u?void 0:u.sectionId,shortcutKey:t,option:e}),"sidebarSimplificationTabs.reorderShortcuts"),r()},render:t=>(0,i.jsx)(o(860287).A,{...t,title:c.formatMessage(a),svg:"moveUp"===e?o(358839).arrowStraightUpIcon:o(356938).arrowStraightDownIcon})})}),...void 0===u?f:[]]}function r(e){return void 0===e.sectionId&&e.tabPlacement.allowsCrossTabMoves||s(e).length>0}function s(e){let t=e.tabPlacement.tabs.find(t=>t.id===e.tabPlacement.activeTabId);return(0,o(481790).PS)({tab:t,shortcutKey:e.shortcutKey,sectionId:e.sectionId})}o.d(t,{c:()=>l,d:()=>r})},651790(e,t,o){o.r(t);var a=o(635790),i=o(440302);function n(e){let{agentIcon:t,workflowStore:n,workflowPointer:l,size:r,animated:s=!1}=e,c=(0,o(83208).X)("animated_custom_agent_faces"),d=(0,a.useMemo)(()=>{let e={workflowIcon:t,size:r,animated:s&&c};return n?(0,o(514827).D)({...e,workflowStore:n}):(0,o(514827).D)({...e,workflowPointer:l})},[t,n,l,r,s,c]);return(0,i.jsx)(o(569553).B6,{icon:d,iconRecordCategory:"workflow",isEmptyPage:!1,size:r,disabled:!0})}o.d(t,{AgentIcon:()=>n})},575422(e,t,o){let a=(0,o(327219).YK)({untitledAgent:{id:"workflow.emptyWorkflowTitle",defaultMessage:"Untitled agent"}});function i(e,t,o){var i;return{name:e.getName()||o||t.formatMessage(a.untitledAgent),icon:e.getRawIcon()||"",isLite:(null==(i=e.getData())?void 0:i.isLite)??!1}}o.d(t,{m:()=>i})},514827(e,t,o){function a(e){let{workflowStore:t,workflowPointer:a,workflowIcon:i,size:n,animated:l}=e,r=t?t.pointer:a,s=i||(0,o(337222).Oy)({baseUrl:o(139424).A.domainBaseUrl||"",shape:"square",color:"gray"});return n<32&&(s=(0,o(337222).Hy)(s)),l&&(s=(0,o(337222).xz)(s)),{pointer:r,icon:(0,o(337222).xr)(s)}}o.d(t,{D:()=>a})},500786(e,t,o){function a(e){let t=(0,o(972740).L)();return(0,o(579993).K8)(()=>{if(e&&t)return o(360851).N.createChildStore(t,{table:o(832375).C0E,id:e,spaceId:t.id})},[e,t])}o.d(t,{h:()=>a})},746204(e,t,o){o(635790);let a={viewBox:"0 0 20 20",fittedViewBox:"5.87 3.72 7.16 12.56",directional:!0,svg:(0,o(440302).jsx)("path",{d:"M6.131 9.381a.875.875 0 0 0 0 1.238l5.4 5.4a.875.875 0 1 0 1.238-1.238L7.987 10l4.782-4.781A.875.875 0 0 0 11.53 3.98z"})},i=(0,o(104509).wt)("arrowChevronSingleLeftFill",a,"fill");o.d(t,{},{w:i})},356938(e,t,o){o.r(t),o(635790);let a={viewBox:"0 0 20 20",fittedViewBox:"4.62 3.12 10.74 13.76",svg:(0,o(440302).jsx)("path",{d:"M4.807 11.058a.627.627 0 0 0 0 .884l4.7
15 4.75c.244.244.64.244.885 0l4.75-4.75a.626.626 0 0 0-.885-.884l-3.683 3.682V3.75a.625.625 0 1 0-1.25 0v10.99l-3.682-3.682a.626.626 0 0 0-.885 0"})},i=(0,o(104509).wt)("arrowStraightDown",a,"default");o.d(t,{},{arrowStraightDownIcon:i,iconDefinition:a})},358839(e,t,o){o.r(t),o(635790);let a={viewBox:"0 0 20 20",fittedViewBox:"4.64 3.12 10.74 13.76",svg:(0,o(440302).jsx)("path",{d:"M15.193 8.942a.626.626 0 0 0 0-.884l-4.75-4.75a.626.626 0 0 0-.885 0l-4.75 4.75a.626.626 0 0 0 .885.884L9.375 5.26v10.99a.625.625 0 1 0 1.25 0V5.26l3.683 3.682c.244.244.64.244.885 0"})},i=(0,o(104509).wt)("arrowStraightUp",a,"default");o.d(t,{},{arrowStraightUpIcon:i,iconDefinition:a})}}]);

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.