@kafca/agentdock 0.1.38 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/renderer/assets/{Badge-PKJavQmQ.js → Badge-B8Arb9Yy.js} +1 -1
- package/dist/renderer/assets/{Chat-DWm4h9aa.js → Chat-BpHN2UcX.js} +1 -1
- package/dist/renderer/assets/{ChatMarkdown-DKxW2GbO.js → ChatMarkdown-C_zHbGhg.js} +1 -1
- package/dist/renderer/assets/{Config-Bqn3cy0z.js → Config-357M6MbD.js} +1 -1
- package/dist/renderer/assets/{CronList-CPI_C7FW.js → CronList-BHgDIhFo.js} +1 -1
- package/dist/renderer/assets/{Dashboard-0e9JS5t7.js → Dashboard-CZQj79ep.js} +2 -2
- package/dist/renderer/assets/{EmptyState-CuA0koT7.js → EmptyState-DpSPN3kz.js} +1 -1
- package/dist/renderer/assets/{KnowledgeDetail-B1YSDbFa.js → KnowledgeDetail-Cbv2Oje7.js} +1 -1
- package/dist/renderer/assets/{KnowledgeHome-KHYwWGDu.js → KnowledgeHome-CEbNw_Za.js} +1 -1
- package/dist/renderer/assets/{Logs-X4LJw-00.js → Logs-IXayiVGS.js} +1 -1
- package/dist/renderer/assets/{Modal-BzEv4CK6.js → Modal-BTKWx2e5.js} +1 -1
- package/dist/renderer/assets/{Page-BrZMoKtK.js → Page-DCDVvqIU.js} +1 -1
- package/dist/renderer/assets/{ProjectDetail-DpO00Ozx.js → ProjectDetail-C6as_oba.js} +1 -1
- package/dist/renderer/assets/{ProjectList-DFtJHTic.js → ProjectList-DJfBaPyw.js} +1 -1
- package/dist/renderer/assets/{Select-DMrwDcus.js → Select-BYijPrOF.js} +1 -1
- package/dist/renderer/assets/{SessionChat-Bh9AfkK5.js → SessionChat-KapIGn1O.js} +1 -1
- package/dist/renderer/assets/{SessionList-Y3gWAe96.js → SessionList-C0ATtS_m.js} +1 -1
- package/dist/renderer/assets/{ThreadChat-Cq0ZRNOh.js → ThreadChat-CKWcyHia.js} +1 -1
- package/dist/renderer/assets/{Workspace-DMSPypFO.js → Workspace-MYHdNNV2.js} +1 -1
- package/dist/renderer/assets/{arrow-left-CgYQZlK9.js → arrow-left-Dl2cYCYQ.js} +1 -1
- package/dist/renderer/assets/{book-open-cAfg0BWS.js → book-open-CJCjYKCj.js} +1 -1
- package/dist/renderer/assets/{check-BNRlfwZx.js → check-Cknz-_NI.js} +1 -1
- package/dist/renderer/assets/{chevron-down-B9vVz3wf.js → chevron-down-v4poAoll.js} +1 -1
- package/dist/renderer/assets/{circle-TBXQ38et.js → circle-BnxuF8S1.js} +1 -1
- package/dist/renderer/assets/{desktop-DfkCIN1l.js → desktop-B9xqa1yi.js} +1 -1
- package/dist/renderer/assets/{funnel-BdZjZcqK.js → funnel-Cl1EldnW.js} +1 -1
- package/dist/renderer/assets/{heart-CBPXb4dq.js → heart-274KWkSA.js} +1 -1
- package/dist/renderer/assets/{index-CXrYAFUE.js → index-CAi_EMRl.js} +2 -2
- package/dist/renderer/assets/{index-C_Yr2rQ1.js → index-GaRPrxQn.js} +1 -1
- package/dist/renderer/assets/{pencil-BlLIWP1h.js → pencil-BfYhgp9_.js} +1 -1
- package/dist/renderer/assets/{play-F-oO0VwG.js → play-CLir9KyW.js} +1 -1
- package/dist/renderer/assets/{plug-B5BduKTi.js → plug-CTKL_TK4.js} +1 -1
- package/dist/renderer/assets/{plus-Bbe6vc8z.js → plus-9pP7UU-H.js} +1 -1
- package/dist/renderer/assets/projects-DRdvUEj2.js +1 -0
- package/dist/renderer/assets/{save-CbX1ymi_.js → save-DZOLXcQU.js} +1 -1
- package/dist/renderer/assets/{search-KyB8P1Ie.js → search-DjFl-8XR.js} +1 -1
- package/dist/renderer/assets/{server-D2EQ0I-I.js → server-UI3KEpUw.js} +1 -1
- package/dist/renderer/assets/{session-utils-C4Eq8h8o.js → session-utils-b9gwOizd.js} +1 -1
- package/dist/renderer/assets/{sessions-CchD99QT.js → sessions-DzSZ5A3m.js} +1 -1
- package/dist/renderer/assets/{shield-check-BTTXqP3n.js → shield-check-6fT5xdT3.js} +1 -1
- package/dist/renderer/assets/{trash-2-CDOrVaia.js → trash-2-DNBg0OLf.js} +1 -1
- package/dist/renderer/assets/{user-BR0zEuV_.js → user-B0MGTipJ.js} +1 -1
- package/dist/renderer/assets/{wifi-off-W_cPAMcl.js → wifi-off-DBxNxGco.js} +1 -1
- package/dist/renderer/index.html +1 -1
- package/dist-electron/services/local-ai-core/src/channel/lark/local-core-lark-gateway.js +8 -7
- package/dist-electron/services/local-ai-core/src/channel/lark/post.js +72 -0
- package/dist-electron/tests/integration/local-core-refactor.test.js +54 -12
- package/package.json +1 -1
- package/dist/renderer/assets/projects-CGLECySt.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G as Te,aK as Ae,r as c,j as x,aL as pe,aM as Ne,aA as te}from"./index-CXrYAFUE.js";var ye=Ae();const De=Te(ye);function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Jt(e,t){const n=c.createContext(t),r=i=>{const{children:s,...a}=i,h=c.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:h,children:s})};r.displayName=e+"Provider";function o(i){const s=c.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function en(e,t=[]){let n=[];function r(i,s){const a=c.createContext(s),h=n.length;n=[...n,s];const l=d=>{var p;const{scope:v,children:y,...w}=d,u=((p=v==null?void 0:v[e])==null?void 0:p[h])||a,m=c.useMemo(()=>w,Object.values(w));return x.jsx(u.Provider,{value:m,children:y})};l.displayName=i+"Provider";function f(d,v){var u;const y=((u=v==null?void 0:v[e])==null?void 0:u[h])||a,w=c.useContext(y);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(s=>c.createContext(s));return function(a){const h=(a==null?void 0:a[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:h}}),[a,h])}};return o.scopeName=e,[r,ke(o,...t)]}function ke(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:h,scopeName:l})=>{const d=h(i)[`__scope${l}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var ne=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Me=pe[" useId ".trim().toString()]||(()=>{}),Fe=0;function tn(e){const[t,n]=c.useState(Me());return ne(()=>{n(r=>r??String(Fe++))},[e]),e||(t?`radix-${t}`:"")}var Ie=pe[" useInsertionEffect ".trim().toString()]||ne;function nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=We({defaultProp:t,onChange:n}),a=e!==void 0,h=a?e:o;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const l=c.useCallback(f=>{var d;if(a){const v=Be(f)?f(e):f;v!==e&&((d=s.current)==null||d.call(s,v))}else i(f)},[a,e,i,s]);return[h,l]}function We({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return Ie(()=>{i.current=t},[t]),c.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Be(e){return typeof e=="function"}function _e(e){const t=je(e),n=c.forwardRef((r,o)=>{const{children:i,...s}=r,a=c.Children.toArray(i),h=a.find($e);if(h){const l=h.props.children,f=a.map(d=>d===h?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return x.jsx(t,{...s,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,f):null})}return x.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function je(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const s=Ke(o),a=Ve(i,o.props);return o.type!==c.Fragment&&(a.ref=r?Ne(r,s):s),c.cloneElement(o,a)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ue=Symbol("radix.slottable");function $e(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ue}function Ve(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const h=i(...a);return o(...a),h}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ke(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],V=Xe.reduce((e,t)=>{const n=_e(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:s,...a}=o,h=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(h,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ye(e,t){e&&ye.flushSync(()=>e.dispatchEvent(t))}function F(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function He(e,t=globalThis==null?void 0:globalThis.document){const n=F(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ze="DismissableLayer",J="dismissableLayer.update",Ge="dismissableLayer.pointerDownOutside",Ze="dismissableLayer.focusOutside",oe,Ee=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qe=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...h}=e,l=c.useContext(Ee),[f,d]=c.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=c.useState({}),w=te(t,E=>d(E)),u=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),p=u.indexOf(m),g=f?u.indexOf(f):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,S=g>=p,C=et(E=>{const L=E.target,T=[...l.branches].some(M=>M.contains(L));!S||T||(o==null||o(E),s==null||s(E),E.defaultPrevented||a==null||a())},v),P=tt(E=>{const L=E.target;[...l.branches].some(M=>M.contains(L))||(i==null||i(E),s==null||s(E),E.defaultPrevented||a==null||a())},v);return He(E=>{g===l.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},v),c.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(oe=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),ae(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=oe)}},[f,v,n,l]),c.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),ae())},[f,l]),c.useEffect(()=>{const E=()=>y({});return document.addEventListener(J,E),()=>document.removeEventListener(J,E)},[]),x.jsx(V.div,{...h,ref:w,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,P.onFocusCapture),onBlurCapture:X(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,C.onPointerDownCapture)})});qe.displayName=ze;var Qe="DismissableLayerBranch",Je=c.forwardRef((e,t)=>{const n=c.useContext(Ee),r=c.useRef(null),o=te(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(V.div,{...e,ref:o})});Je.displayName=Qe;function et(e,t=globalThis==null?void 0:globalThis.document){const n=F(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let h=function(){ge(Ge,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function tt(e,t=globalThis==null?void 0:globalThis.document){const n=F(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&ge(Ze,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ae(){const e=new CustomEvent(J);document.dispatchEvent(e)}function ge(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ye(o,i):o.dispatchEvent(i)}var Y="focusScope.autoFocusOnMount",H="focusScope.autoFocusOnUnmount",ce={bubbles:!1,cancelable:!0},nt="FocusScope",rt=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,h]=c.useState(null),l=F(o),f=F(i),d=c.useRef(null),v=te(t,u=>h(u)),y=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let u=function(b){if(y.paused||!a)return;const S=b.target;a.contains(S)?d.current=S:O(d.current,{select:!0})},m=function(b){if(y.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||O(d.current,{select:!0}))},p=function(b){if(document.activeElement===document.body)for(const C of b)C.removedNodes.length>0&&O(a)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const g=new MutationObserver(p);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),g.disconnect()}}},[r,a,y.paused]),c.useEffect(()=>{if(a){se.add(y);const u=document.activeElement;if(!a.contains(u)){const p=new CustomEvent(Y,ce);a.addEventListener(Y,l),a.dispatchEvent(p),p.defaultPrevented||(ot(ut(be(a)),{select:!0}),document.activeElement===u&&O(a))}return()=>{a.removeEventListener(Y,l),setTimeout(()=>{const p=new CustomEvent(H,ce);a.addEventListener(H,f),a.dispatchEvent(p),p.defaultPrevented||O(u??document.body,{select:!0}),a.removeEventListener(H,f),se.remove(y)},0)}}},[a,l,f,y]);const w=c.useCallback(u=>{if(!n&&!r||y.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,p=document.activeElement;if(m&&p){const g=u.currentTarget,[b,S]=at(g);b&&S?!u.shiftKey&&p===S?(u.preventDefault(),n&&O(b,{select:!0})):u.shiftKey&&p===b&&(u.preventDefault(),n&&O(S,{select:!0})):p===g&&u.preventDefault()}},[n,r,y.paused]);return x.jsx(V.div,{tabIndex:-1,...s,ref:v,onKeyDown:w})});rt.displayName=nt;function ot(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(O(r,{select:t}),document.activeElement!==n)return}function at(e){const t=be(e),n=ie(t,e),r=ie(t.reverse(),e);return[n,r]}function be(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ie(e,t){for(const n of e)if(!ct(n,{upTo:t}))return n}function ct(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function it(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&it(e)&&t&&e.select()}}var se=st();function st(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ue(e,t),e.unshift(t)},remove(t){var n;e=ue(e,t),(n=e[0])==null||n.resume()}}}function ue(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ut(e){return e.filter(t=>t.tagName!=="A")}var lt="Portal",ft=c.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=c.useState(!1);ne(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?De.createPortal(x.jsx(V.div,{...r,ref:t}),s):null});ft.displayName=lt;var z=0;function rn(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??le()),document.body.insertAdjacentElement("beforeend",e[1]??le()),z++,()=>{z===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),z--}},[])}function le(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var R=function(){return R=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},R.apply(this,arguments)};function Se(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function dt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var U="right-scroll-bar-position",$="width-before-scroll-bar",vt="with-scroll-bars-hidden",ht="--removed-body-scroll-bar-size";function G(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mt(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var pt=typeof window<"u"?c.useLayoutEffect:c.useEffect,fe=new WeakMap;function yt(e,t){var n=mt(null,function(r){return e.forEach(function(o){return G(o,r)})});return pt(function(){var r=fe.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||G(a,null)}),i.forEach(function(a){o.has(a)||G(a,s)})}fe.set(n,e)},[e]),n}function Et(e){return e}function gt(e,t){t===void 0&&(t=Et);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var h=function(){var f=s;s=[],f.forEach(i)},l=function(){return Promise.resolve().then(h)};l(),n={push:function(f){s.push(f),l()},filter:function(f){return s=s.filter(f),n}}}};return o}function bt(e){e===void 0&&(e={});var t=gt(null);return t.options=R({async:!0,ssr:!1},e),t}var we=function(e){var t=e.sideCar,n=Se(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,R({},n))};we.isSideCarExport=!0;function St(e,t){return e.useMedium(t),we}var Ce=bt(),Z=function(){},K=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Z,onWheelCapture:Z,onTouchMoveCapture:Z}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,h=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,v=e.sideCar,y=e.noRelative,w=e.noIsolation,u=e.inert,m=e.allowPinchZoom,p=e.as,g=p===void 0?"div":p,b=e.gapMode,S=Se(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,P=yt([n,t]),E=R(R({},S),o);return c.createElement(c.Fragment,null,f&&c.createElement(C,{sideCar:Ce,removeScrollBar:l,shards:d,noRelative:y,noIsolation:w,inert:u,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),s?c.cloneElement(c.Children.only(a),R(R({},E),{ref:P})):c.createElement(g,R({},E,{className:h,ref:P}),a))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};K.classNames={fullWidth:$,zeroRight:U};var wt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ct(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wt();return t&&e.setAttribute("nonce",t),e}function Pt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ct())&&(Pt(t,n),Rt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ot=function(){var e=xt();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Pe=function(){var e=Ot(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Lt={left:0,top:0,right:0,gap:0},q=function(e){return parseInt(e||"",10)||0},Tt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[q(n),q(r),q(o)]},At=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Lt;var t=Tt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Nt=Pe(),k="data-scroll-locked",Dt=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
import{G as Te,aK as Ae,r as c,j as x,aL as pe,aM as Ne,aA as te}from"./index-CAi_EMRl.js";var ye=Ae();const De=Te(ye);function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Jt(e,t){const n=c.createContext(t),r=i=>{const{children:s,...a}=i,h=c.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:h,children:s})};r.displayName=e+"Provider";function o(i){const s=c.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function en(e,t=[]){let n=[];function r(i,s){const a=c.createContext(s),h=n.length;n=[...n,s];const l=d=>{var p;const{scope:v,children:y,...w}=d,u=((p=v==null?void 0:v[e])==null?void 0:p[h])||a,m=c.useMemo(()=>w,Object.values(w));return x.jsx(u.Provider,{value:m,children:y})};l.displayName=i+"Provider";function f(d,v){var u;const y=((u=v==null?void 0:v[e])==null?void 0:u[h])||a,w=c.useContext(y);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(s=>c.createContext(s));return function(a){const h=(a==null?void 0:a[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:h}}),[a,h])}};return o.scopeName=e,[r,ke(o,...t)]}function ke(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:h,scopeName:l})=>{const d=h(i)[`__scope${l}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var ne=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Me=pe[" useId ".trim().toString()]||(()=>{}),Fe=0;function tn(e){const[t,n]=c.useState(Me());return ne(()=>{n(r=>r??String(Fe++))},[e]),e||(t?`radix-${t}`:"")}var Ie=pe[" useInsertionEffect ".trim().toString()]||ne;function nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=We({defaultProp:t,onChange:n}),a=e!==void 0,h=a?e:o;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const l=c.useCallback(f=>{var d;if(a){const v=Be(f)?f(e):f;v!==e&&((d=s.current)==null||d.call(s,v))}else i(f)},[a,e,i,s]);return[h,l]}function We({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return Ie(()=>{i.current=t},[t]),c.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Be(e){return typeof e=="function"}function _e(e){const t=je(e),n=c.forwardRef((r,o)=>{const{children:i,...s}=r,a=c.Children.toArray(i),h=a.find($e);if(h){const l=h.props.children,f=a.map(d=>d===h?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return x.jsx(t,{...s,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,f):null})}return x.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function je(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const s=Ke(o),a=Ve(i,o.props);return o.type!==c.Fragment&&(a.ref=r?Ne(r,s):s),c.cloneElement(o,a)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ue=Symbol("radix.slottable");function $e(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ue}function Ve(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const h=i(...a);return o(...a),h}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ke(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],V=Xe.reduce((e,t)=>{const n=_e(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:s,...a}=o,h=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(h,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ye(e,t){e&&ye.flushSync(()=>e.dispatchEvent(t))}function F(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function He(e,t=globalThis==null?void 0:globalThis.document){const n=F(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ze="DismissableLayer",J="dismissableLayer.update",Ge="dismissableLayer.pointerDownOutside",Ze="dismissableLayer.focusOutside",oe,Ee=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qe=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...h}=e,l=c.useContext(Ee),[f,d]=c.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=c.useState({}),w=te(t,E=>d(E)),u=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),p=u.indexOf(m),g=f?u.indexOf(f):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,S=g>=p,C=et(E=>{const L=E.target,T=[...l.branches].some(M=>M.contains(L));!S||T||(o==null||o(E),s==null||s(E),E.defaultPrevented||a==null||a())},v),P=tt(E=>{const L=E.target;[...l.branches].some(M=>M.contains(L))||(i==null||i(E),s==null||s(E),E.defaultPrevented||a==null||a())},v);return He(E=>{g===l.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},v),c.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(oe=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),ae(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=oe)}},[f,v,n,l]),c.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),ae())},[f,l]),c.useEffect(()=>{const E=()=>y({});return document.addEventListener(J,E),()=>document.removeEventListener(J,E)},[]),x.jsx(V.div,{...h,ref:w,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,P.onFocusCapture),onBlurCapture:X(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,C.onPointerDownCapture)})});qe.displayName=ze;var Qe="DismissableLayerBranch",Je=c.forwardRef((e,t)=>{const n=c.useContext(Ee),r=c.useRef(null),o=te(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(V.div,{...e,ref:o})});Je.displayName=Qe;function et(e,t=globalThis==null?void 0:globalThis.document){const n=F(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let h=function(){ge(Ge,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function tt(e,t=globalThis==null?void 0:globalThis.document){const n=F(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&ge(Ze,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ae(){const e=new CustomEvent(J);document.dispatchEvent(e)}function ge(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ye(o,i):o.dispatchEvent(i)}var Y="focusScope.autoFocusOnMount",H="focusScope.autoFocusOnUnmount",ce={bubbles:!1,cancelable:!0},nt="FocusScope",rt=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,h]=c.useState(null),l=F(o),f=F(i),d=c.useRef(null),v=te(t,u=>h(u)),y=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let u=function(b){if(y.paused||!a)return;const S=b.target;a.contains(S)?d.current=S:O(d.current,{select:!0})},m=function(b){if(y.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||O(d.current,{select:!0}))},p=function(b){if(document.activeElement===document.body)for(const C of b)C.removedNodes.length>0&&O(a)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const g=new MutationObserver(p);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),g.disconnect()}}},[r,a,y.paused]),c.useEffect(()=>{if(a){se.add(y);const u=document.activeElement;if(!a.contains(u)){const p=new CustomEvent(Y,ce);a.addEventListener(Y,l),a.dispatchEvent(p),p.defaultPrevented||(ot(ut(be(a)),{select:!0}),document.activeElement===u&&O(a))}return()=>{a.removeEventListener(Y,l),setTimeout(()=>{const p=new CustomEvent(H,ce);a.addEventListener(H,f),a.dispatchEvent(p),p.defaultPrevented||O(u??document.body,{select:!0}),a.removeEventListener(H,f),se.remove(y)},0)}}},[a,l,f,y]);const w=c.useCallback(u=>{if(!n&&!r||y.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,p=document.activeElement;if(m&&p){const g=u.currentTarget,[b,S]=at(g);b&&S?!u.shiftKey&&p===S?(u.preventDefault(),n&&O(b,{select:!0})):u.shiftKey&&p===b&&(u.preventDefault(),n&&O(S,{select:!0})):p===g&&u.preventDefault()}},[n,r,y.paused]);return x.jsx(V.div,{tabIndex:-1,...s,ref:v,onKeyDown:w})});rt.displayName=nt;function ot(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(O(r,{select:t}),document.activeElement!==n)return}function at(e){const t=be(e),n=ie(t,e),r=ie(t.reverse(),e);return[n,r]}function be(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ie(e,t){for(const n of e)if(!ct(n,{upTo:t}))return n}function ct(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function it(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&it(e)&&t&&e.select()}}var se=st();function st(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ue(e,t),e.unshift(t)},remove(t){var n;e=ue(e,t),(n=e[0])==null||n.resume()}}}function ue(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ut(e){return e.filter(t=>t.tagName!=="A")}var lt="Portal",ft=c.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=c.useState(!1);ne(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?De.createPortal(x.jsx(V.div,{...r,ref:t}),s):null});ft.displayName=lt;var z=0;function rn(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??le()),document.body.insertAdjacentElement("beforeend",e[1]??le()),z++,()=>{z===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),z--}},[])}function le(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var R=function(){return R=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},R.apply(this,arguments)};function Se(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function dt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var U="right-scroll-bar-position",$="width-before-scroll-bar",vt="with-scroll-bars-hidden",ht="--removed-body-scroll-bar-size";function G(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mt(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var pt=typeof window<"u"?c.useLayoutEffect:c.useEffect,fe=new WeakMap;function yt(e,t){var n=mt(null,function(r){return e.forEach(function(o){return G(o,r)})});return pt(function(){var r=fe.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||G(a,null)}),i.forEach(function(a){o.has(a)||G(a,s)})}fe.set(n,e)},[e]),n}function Et(e){return e}function gt(e,t){t===void 0&&(t=Et);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var h=function(){var f=s;s=[],f.forEach(i)},l=function(){return Promise.resolve().then(h)};l(),n={push:function(f){s.push(f),l()},filter:function(f){return s=s.filter(f),n}}}};return o}function bt(e){e===void 0&&(e={});var t=gt(null);return t.options=R({async:!0,ssr:!1},e),t}var we=function(e){var t=e.sideCar,n=Se(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,R({},n))};we.isSideCarExport=!0;function St(e,t){return e.useMedium(t),we}var Ce=bt(),Z=function(){},K=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Z,onWheelCapture:Z,onTouchMoveCapture:Z}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,h=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,v=e.sideCar,y=e.noRelative,w=e.noIsolation,u=e.inert,m=e.allowPinchZoom,p=e.as,g=p===void 0?"div":p,b=e.gapMode,S=Se(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,P=yt([n,t]),E=R(R({},S),o);return c.createElement(c.Fragment,null,f&&c.createElement(C,{sideCar:Ce,removeScrollBar:l,shards:d,noRelative:y,noIsolation:w,inert:u,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),s?c.cloneElement(c.Children.only(a),R(R({},E),{ref:P})):c.createElement(g,R({},E,{className:h,ref:P}),a))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};K.classNames={fullWidth:$,zeroRight:U};var wt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ct(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wt();return t&&e.setAttribute("nonce",t),e}function Pt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ct())&&(Pt(t,n),Rt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ot=function(){var e=xt();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Pe=function(){var e=Ot(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Lt={left:0,top:0,right:0,gap:0},q=function(e){return parseInt(e||"",10)||0},Tt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[q(n),q(r),q(o)]},At=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Lt;var t=Tt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Nt=Pe(),k="data-scroll-locked",Dt=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(vt,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as t}from"./index-CAi_EMRl.js";const e=()=>t.get("/projects"),r=o=>t.get(`/projects/${o}`);export{r as g,e as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as o}from"./index-
|
|
1
|
+
import{z as o}from"./index-CAi_EMRl.js";const i=s=>o.get(`/projects/${s}/sessions`),c=(s,e,t)=>o.get(`/projects/${s}/sessions/${e}`,{history_limit:String(t)}),r=(s,e,t)=>o.patch(`/projects/${s}/sessions/${e}`,t),a=(s,e)=>o.delete(`/projects/${s}/sessions/${e}`),p=(s,e)=>o.post(`/projects/${s}/sessions/switch`,e),$=(s,e)=>o.post(`/projects/${s}/send`,e);export{$ as a,a as d,c as g,i as l,r,p as s};
|
package/dist/renderer/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="./favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>AgentDock</title>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-CAi_EMRl.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="./assets/index-CaQZSRbg.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body class="bg-[#f5f5f7] dark:bg-[#151516]">
|
|
@@ -44,6 +44,7 @@ const file_utils_js_1 = require("../shared/file-utils.js");
|
|
|
44
44
|
const cards_js_1 = require("./cards.js");
|
|
45
45
|
const config_js_1 = require("./config.js");
|
|
46
46
|
const registration_js_1 = require("./registration.js");
|
|
47
|
+
const post_js_1 = require("./post.js");
|
|
47
48
|
const runtime_state_js_1 = require("./runtime-state.js");
|
|
48
49
|
const PAIRING_EXPIRY_MS = 10 * 60 * 1000;
|
|
49
50
|
const LARK_MAX_UPLOAD_FILE_SIZE = 30 * 1024 * 1024;
|
|
@@ -218,7 +219,7 @@ class LocalCoreLarkGateway extends node_events_1.EventEmitter {
|
|
|
218
219
|
if (part.type === 'text') {
|
|
219
220
|
const text = String(part.text || '').trim();
|
|
220
221
|
if (text) {
|
|
221
|
-
messageIds.push(await this.
|
|
222
|
+
messageIds.push(await this.sendTextAsPost(state, channelId, text));
|
|
222
223
|
}
|
|
223
224
|
continue;
|
|
224
225
|
}
|
|
@@ -514,14 +515,14 @@ class LocalCoreLarkGateway extends node_events_1.EventEmitter {
|
|
|
514
515
|
}
|
|
515
516
|
if (!existingMessageId) {
|
|
516
517
|
const createdId = renderedMessage.delivery === 'message' && renderedMessage.buttonRows.length === 0
|
|
517
|
-
? await this.
|
|
518
|
+
? await this.sendTextAsPost(state, route.chatId, renderedMessage.text)
|
|
518
519
|
: await this.sendTextAsCard(state, route.chatId, renderedMessage.text, renderedMessage.buttonRows, sessionKey, bridgeThreadId);
|
|
519
520
|
if (createdId) {
|
|
520
521
|
(0, runtime_state_js_1.setLarkRenderedMessageId)(turn, renderedMessage, createdId);
|
|
521
522
|
if (renderedMessage.isFinal) {
|
|
522
523
|
this.options.store.updatePlatformThreadMessageId(route.workspaceId, route.chatId, route.platformUserId, createdId, routePlatformKey);
|
|
523
524
|
}
|
|
524
|
-
this.options.log?.(`localcore-lark sent new ${renderedMessage.delivery === 'message' ? '
|
|
525
|
+
this.options.log?.(`localcore-lark sent new ${renderedMessage.delivery === 'message' ? 'post' : 'card'} message ${createdId} for sessionKey=${sessionKey}`);
|
|
525
526
|
}
|
|
526
527
|
continue;
|
|
527
528
|
}
|
|
@@ -1151,7 +1152,7 @@ class LocalCoreLarkGateway extends node_events_1.EventEmitter {
|
|
|
1151
1152
|
this.options.log?.(`localcore-lark card create took ${Date.now() - startedAt}ms textBytes=${Buffer.byteLength(text || '', 'utf8')}`);
|
|
1152
1153
|
return String(response?.data?.message_id || '').trim();
|
|
1153
1154
|
}
|
|
1154
|
-
async
|
|
1155
|
+
async sendTextAsPost(state, chatId, text) {
|
|
1155
1156
|
const startedAt = Date.now();
|
|
1156
1157
|
const response = await state.client.im.message.create({
|
|
1157
1158
|
params: {
|
|
@@ -1159,11 +1160,11 @@ class LocalCoreLarkGateway extends node_events_1.EventEmitter {
|
|
|
1159
1160
|
},
|
|
1160
1161
|
data: {
|
|
1161
1162
|
receive_id: chatId,
|
|
1162
|
-
msg_type: '
|
|
1163
|
-
content: JSON.stringify(
|
|
1163
|
+
msg_type: 'post',
|
|
1164
|
+
content: JSON.stringify((0, post_js_1.buildLarkPostContent)(text)),
|
|
1164
1165
|
},
|
|
1165
1166
|
});
|
|
1166
|
-
this.options.log?.(`localcore-lark
|
|
1167
|
+
this.options.log?.(`localcore-lark post create took ${Date.now() - startedAt}ms textBytes=${Buffer.byteLength(text || '', 'utf8')}`);
|
|
1167
1168
|
return String(response?.data?.message_id || '').trim();
|
|
1168
1169
|
}
|
|
1169
1170
|
resolveReceiveIdType(receiveId) {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildLarkPostContent = buildLarkPostContent;
|
|
4
|
+
function buildLarkPostContent(markdown) {
|
|
5
|
+
const content = renderLarkPostLines(markdown);
|
|
6
|
+
return {
|
|
7
|
+
zh_cn: {
|
|
8
|
+
content: content.length > 0 ? content : [[{ tag: 'text', text: ' ' }]],
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function renderLarkPostLines(markdown) {
|
|
13
|
+
const lines = String(markdown || '').replace(/\r\n/g, '\n').split('\n');
|
|
14
|
+
const rendered = [];
|
|
15
|
+
let codeFence = null;
|
|
16
|
+
for (const line of lines) {
|
|
17
|
+
const fence = matchFence(line);
|
|
18
|
+
if (fence) {
|
|
19
|
+
if (codeFence && fence.marker[0] === codeFence.marker[0] && fence.marker.length >= codeFence.marker.length) {
|
|
20
|
+
rendered.push([{
|
|
21
|
+
tag: 'code_block',
|
|
22
|
+
language: codeFence.language,
|
|
23
|
+
text: codeFence.lines.join('\n'),
|
|
24
|
+
}]);
|
|
25
|
+
codeFence = null;
|
|
26
|
+
}
|
|
27
|
+
else if (!codeFence) {
|
|
28
|
+
codeFence = {
|
|
29
|
+
marker: fence.marker,
|
|
30
|
+
language: fence.language,
|
|
31
|
+
lines: [],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
codeFence.lines.push(line);
|
|
36
|
+
}
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (codeFence) {
|
|
40
|
+
codeFence.lines.push(line);
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (!line.trim()) {
|
|
44
|
+
rendered.push([{ tag: 'text', text: '' }]);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
rendered.push([{ tag: 'md', text: sanitizeLarkPostMarkdown(line) }]);
|
|
48
|
+
}
|
|
49
|
+
if (codeFence) {
|
|
50
|
+
rendered.push([{
|
|
51
|
+
tag: 'code_block',
|
|
52
|
+
language: codeFence.language,
|
|
53
|
+
text: codeFence.lines.join('\n'),
|
|
54
|
+
}]);
|
|
55
|
+
}
|
|
56
|
+
return rendered;
|
|
57
|
+
}
|
|
58
|
+
function matchFence(line) {
|
|
59
|
+
const match = line.trim().match(/^(`{3,}|~{3,})([A-Za-z0-9_-]*)\s*$/);
|
|
60
|
+
if (!match) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
marker: match[1],
|
|
65
|
+
language: match[2] || '',
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function sanitizeLarkPostMarkdown(markdown) {
|
|
69
|
+
return markdown.replace(/\[([^\]]*)\]\(([^)]+)\)/g, (match, label, href) => {
|
|
70
|
+
return /^https?:\/\//i.test(href) ? match : `${label} (${href})`;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
@@ -30,11 +30,38 @@ function extractLarkCreatedMessage(request) {
|
|
|
30
30
|
return {
|
|
31
31
|
msgType,
|
|
32
32
|
content,
|
|
33
|
-
text: msgType
|
|
34
|
-
? String(content.elements?.[0]?.content || '')
|
|
35
|
-
: String(content.text || ''),
|
|
33
|
+
text: extractLarkCreatedMessageText(msgType, content),
|
|
36
34
|
};
|
|
37
35
|
}
|
|
36
|
+
function extractLarkCreatedMessageText(msgType, content) {
|
|
37
|
+
if (msgType === 'interactive') {
|
|
38
|
+
return String(content.elements?.[0]?.content || '');
|
|
39
|
+
}
|
|
40
|
+
if (msgType === 'post') {
|
|
41
|
+
return (content.zh_cn?.content || [])
|
|
42
|
+
.map((line) => (Array.isArray(line) ? line : [])
|
|
43
|
+
.map((item) => {
|
|
44
|
+
if (item?.tag === 'code_block') {
|
|
45
|
+
const language = String(item.language || '').trim();
|
|
46
|
+
return `\`\`\`${language}\n${String(item.text || '')}\n\`\`\``;
|
|
47
|
+
}
|
|
48
|
+
return String(item?.text || item?.href || '');
|
|
49
|
+
})
|
|
50
|
+
.join(''))
|
|
51
|
+
.join('\n');
|
|
52
|
+
}
|
|
53
|
+
return String(content.text || '');
|
|
54
|
+
}
|
|
55
|
+
function findLarkPostCodeBlock(content) {
|
|
56
|
+
for (const line of content.zh_cn?.content || []) {
|
|
57
|
+
for (const item of Array.isArray(line) ? line : []) {
|
|
58
|
+
if (item?.tag === 'code_block') {
|
|
59
|
+
return item;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
38
65
|
(0, node_test_1.default)('local core route parser separates runtime refresh and runtime detail routes', () => {
|
|
39
66
|
strict_1.default.deepEqual((0, server_routes_js_1.parseLocalAiCoreRoute)('GET', '/api/local/v1/logs'), { name: 'logs.list' });
|
|
40
67
|
strict_1.default.deepEqual((0, server_routes_js_1.parseLocalAiCoreRoute)('GET', '/api/local/v1/runtimes'), { name: 'runtimes.list' });
|
|
@@ -1853,6 +1880,7 @@ function extractLarkCreatedMessage(request) {
|
|
|
1853
1880
|
messageId,
|
|
1854
1881
|
msgType: message.msgType,
|
|
1855
1882
|
text: message.text,
|
|
1883
|
+
content: message.content,
|
|
1856
1884
|
});
|
|
1857
1885
|
return { data: { message_id: messageId } };
|
|
1858
1886
|
},
|
|
@@ -1921,13 +1949,13 @@ function extractLarkCreatedMessage(request) {
|
|
|
1921
1949
|
replyCtx: 'run-1',
|
|
1922
1950
|
content: '最终回答',
|
|
1923
1951
|
});
|
|
1924
|
-
strict_1.default.deepEqual(createdMessages.map((message) => message.msgType), ['interactive', '
|
|
1952
|
+
strict_1.default.deepEqual(createdMessages.map((message) => message.msgType), ['interactive', 'post']);
|
|
1925
1953
|
strict_1.default.equal(createdMessages[0]?.text, '先理解问题,再检查代码');
|
|
1926
1954
|
strict_1.default.equal(createdMessages[1]?.text, '最终回答');
|
|
1927
1955
|
strict_1.default.equal(patchedCards.length, 0);
|
|
1928
1956
|
strict_1.default.deepEqual(storedMessageIds, ['lark-msg-2']);
|
|
1929
1957
|
});
|
|
1930
|
-
(0, node_test_1.default)('lark bridge sends final reply as its own
|
|
1958
|
+
(0, node_test_1.default)('lark bridge sends final reply as its own post message instead of streaming draft', async () => {
|
|
1931
1959
|
const createdMessages = [];
|
|
1932
1960
|
const patchedCards = [];
|
|
1933
1961
|
const storedMessageIds = [];
|
|
@@ -1941,6 +1969,7 @@ function extractLarkCreatedMessage(request) {
|
|
|
1941
1969
|
messageId,
|
|
1942
1970
|
msgType: message.msgType,
|
|
1943
1971
|
text: message.text,
|
|
1972
|
+
content: message.content,
|
|
1944
1973
|
});
|
|
1945
1974
|
return { data: { message_id: messageId } };
|
|
1946
1975
|
},
|
|
@@ -1999,7 +2028,7 @@ function extractLarkCreatedMessage(request) {
|
|
|
1999
2028
|
replyCtx: 'run-1',
|
|
2000
2029
|
content: '真正最终回答',
|
|
2001
2030
|
});
|
|
2002
|
-
strict_1.default.deepEqual(createdMessages.map((message) => message.msgType), ['
|
|
2031
|
+
strict_1.default.deepEqual(createdMessages.map((message) => message.msgType), ['post']);
|
|
2003
2032
|
strict_1.default.deepEqual(createdMessages.map((message) => message.text), ['真正最终回答']);
|
|
2004
2033
|
strict_1.default.deepEqual(patchedCards, []);
|
|
2005
2034
|
strict_1.default.deepEqual(storedMessageIds, ['lark-msg-1']);
|
|
@@ -2017,6 +2046,7 @@ function extractLarkCreatedMessage(request) {
|
|
|
2017
2046
|
messageId,
|
|
2018
2047
|
msgType: message.msgType,
|
|
2019
2048
|
text: message.text,
|
|
2049
|
+
content: message.content,
|
|
2020
2050
|
});
|
|
2021
2051
|
return { data: { message_id: messageId } };
|
|
2022
2052
|
},
|
|
@@ -2073,11 +2103,11 @@ function extractLarkCreatedMessage(request) {
|
|
|
2073
2103
|
replyCtx: 'run-2',
|
|
2074
2104
|
content: 'second final',
|
|
2075
2105
|
});
|
|
2076
|
-
strict_1.default.deepEqual(createdMessages.map((message) => message.msgType), ['
|
|
2106
|
+
strict_1.default.deepEqual(createdMessages.map((message) => message.msgType), ['post', 'post']);
|
|
2077
2107
|
strict_1.default.deepEqual(createdMessages.map((message) => message.text), ['first final', 'second final']);
|
|
2078
2108
|
strict_1.default.deepEqual(patchedCards, []);
|
|
2079
2109
|
});
|
|
2080
|
-
(0, node_test_1.default)('lark bridge sends tool and final as separate
|
|
2110
|
+
(0, node_test_1.default)('lark bridge sends tool and final as separate post messages without patching tool progress', async () => {
|
|
2081
2111
|
const createdMessages = [];
|
|
2082
2112
|
const patchedCards = [];
|
|
2083
2113
|
const storedMessageIds = [];
|
|
@@ -2091,6 +2121,7 @@ function extractLarkCreatedMessage(request) {
|
|
|
2091
2121
|
messageId,
|
|
2092
2122
|
msgType: message.msgType,
|
|
2093
2123
|
text: message.text,
|
|
2124
|
+
content: message.content,
|
|
2094
2125
|
});
|
|
2095
2126
|
return { data: { message_id: messageId } };
|
|
2096
2127
|
},
|
|
@@ -2163,7 +2194,7 @@ function extractLarkCreatedMessage(request) {
|
|
|
2163
2194
|
replyCtx: 'run-1',
|
|
2164
2195
|
content: '好的,文件存在,现在发送给你:已发送!`CLAUDE.md` 文件已经发出去了,请查收',
|
|
2165
2196
|
});
|
|
2166
|
-
strict_1.default.deepEqual(createdMessages.map((message) => message.msgType), ['
|
|
2197
|
+
strict_1.default.deepEqual(createdMessages.map((message) => message.msgType), ['post', 'post']);
|
|
2167
2198
|
strict_1.default.deepEqual(createdMessages.map((message) => message.text), [
|
|
2168
2199
|
'🔧 bash',
|
|
2169
2200
|
'好的,文件存在,现在发送给你:已发送!`CLAUDE.md` 文件已经发出去了,请查收',
|
|
@@ -2185,6 +2216,7 @@ function extractLarkCreatedMessage(request) {
|
|
|
2185
2216
|
messageId,
|
|
2186
2217
|
msgType: message.msgType,
|
|
2187
2218
|
text: message.text,
|
|
2219
|
+
content: message.content,
|
|
2188
2220
|
});
|
|
2189
2221
|
return { data: { message_id: messageId } };
|
|
2190
2222
|
},
|
|
@@ -2291,13 +2323,18 @@ function extractLarkCreatedMessage(request) {
|
|
|
2291
2323
|
replyCtx: 'run-1',
|
|
2292
2324
|
content: '最终回答',
|
|
2293
2325
|
});
|
|
2294
|
-
strict_1.default.deepEqual(createdMessages.map((message) => message.msgType), ['interactive', '
|
|
2326
|
+
strict_1.default.deepEqual(createdMessages.map((message) => message.msgType), ['interactive', 'post', 'interactive', 'post']);
|
|
2295
2327
|
strict_1.default.deepEqual(createdMessages.map((message) => message.text), [
|
|
2296
2328
|
'先理解用户需求',
|
|
2297
2329
|
'🔧 Terminal\n\n```json\n{\n "command": "uname -a",\n "description": "Get system info"\n}\n```',
|
|
2298
2330
|
'看到了 Linux',
|
|
2299
2331
|
'最终回答',
|
|
2300
2332
|
]);
|
|
2333
|
+
strict_1.default.deepEqual(findLarkPostCodeBlock(createdMessages[1]?.content), {
|
|
2334
|
+
tag: 'code_block',
|
|
2335
|
+
language: 'json',
|
|
2336
|
+
text: '{\n "command": "uname -a",\n "description": "Get system info"\n}',
|
|
2337
|
+
});
|
|
2301
2338
|
strict_1.default.deepEqual(patchedCards, []);
|
|
2302
2339
|
strict_1.default.deepEqual(storedMessageIds, ['lark-msg-4']);
|
|
2303
2340
|
});
|
|
@@ -2619,7 +2656,7 @@ function extractLarkCreatedMessage(request) {
|
|
|
2619
2656
|
strict_1.default.equal(patchedCards[0]?.messageId, 'permission-msg-1');
|
|
2620
2657
|
strict_1.default.match(patchedCards[0]?.card?.elements?.[0]?.content || '', /工具确认已处理/);
|
|
2621
2658
|
strict_1.default.equal(createdMessages.length, 1);
|
|
2622
|
-
strict_1.default.equal(createdMessages[0]?.msgType, '
|
|
2659
|
+
strict_1.default.equal(createdMessages[0]?.msgType, 'post');
|
|
2623
2660
|
strict_1.default.match(createdMessages[0]?.text || '', /桌面文件列表/);
|
|
2624
2661
|
});
|
|
2625
2662
|
(0, node_test_1.default)('lark channel sends tool name and parameters once without streaming output', async () => {
|
|
@@ -2699,10 +2736,15 @@ function extractLarkCreatedMessage(request) {
|
|
|
2699
2736
|
},
|
|
2700
2737
|
});
|
|
2701
2738
|
const text = createdMessages[0]?.text || '';
|
|
2702
|
-
strict_1.default.equal(createdMessages[0]?.msgType, '
|
|
2739
|
+
strict_1.default.equal(createdMessages[0]?.msgType, 'post');
|
|
2703
2740
|
strict_1.default.match(text, /🔧 Terminal/);
|
|
2704
2741
|
strict_1.default.match(text, /```json\n{\n "command": "ls ~\/Desktop"\n}\n```/);
|
|
2705
2742
|
strict_1.default.doesNotMatch(text, /参数/);
|
|
2743
|
+
strict_1.default.deepEqual(findLarkPostCodeBlock(createdMessages[0]?.content), {
|
|
2744
|
+
tag: 'code_block',
|
|
2745
|
+
language: 'json',
|
|
2746
|
+
text: '{\n "command": "ls ~/Desktop"\n}',
|
|
2747
|
+
});
|
|
2706
2748
|
strict_1.default.equal(patchedCards.length, 0);
|
|
2707
2749
|
strict_1.default.doesNotMatch(text, /completed/);
|
|
2708
2750
|
strict_1.default.doesNotMatch(text, /secret terminal output/);
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as t}from"./index-CXrYAFUE.js";const e=()=>t.get("/projects"),r=o=>t.get(`/projects/${o}`);export{r as g,e as l};
|