UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 4.33 kB
import{n as e,r as t}from"./rolldown-runtime-CNOWq4Kh.js";import{Wo as n}from"./_4____________________________.js";import{Cb as r,Db as i,JM as a,Ob as o,QM as s,Sb as c,XM as l,bb as u,bw as d,cv as f,gb as p,hb as m,sv as h,yb as g,yw as _}from"./_2_____________________________.js";import{Rt as v,u as y,x as b,y as x}from"./_6____________________.js";var S;function C(){return(C=e((()=>{S=`:host,openclaw-tooltip,openclaw-tooltip-provider{display:contents}.tooltip-surface{--chat-bubble-background:initial;--chat-text-link:var(--link);--chat-text-link-hover:var(--link-hover);--oc-overlay-distance:8px;--oc-overlay-enter-scale:.9;max-width:var(--openclaw-tooltip-max-width,min(260px, calc(100vw - 16px)));border-radius:var(--openclaw-tooltip-border-radius,var(--radius-tooltip));corner-shape:superellipse(1.5);max-height:min(420px,100dvh - 16px);padding:var(--openclaw-tooltip-padding,5px 7px);background:var(--openclaw-tooltip-background-color,var(--menu-surface));color:var(--text);box-shadow:var(--openclaw-tooltip-shadow,var(--menu-shadow));backdrop-filter:var(--menu-backdrop);font-family:var(--font-body);overflow-wrap:anywhere;pointer-events:none;-webkit-user-select:none;user-select:none;border:1px solid #0000;font-size:11px;font-weight:500;line-height:1.25;position:fixed;inset:auto;overflow:auto}.tooltip-surface[data-phase=opening]{animation:oc-overlay-enter var(--openclaw-tooltip-popup-show-duration,var(--control-ui-transition-fast)) ease}.tooltip-surface[data-phase=closing]{animation:oc-overlay-exit var(--openclaw-tooltip-popup-hide-duration,var(--control-ui-transition-fast)) ease forwards}:host(.sidebar-hover-tooltip) .tooltip-surface[data-phase=opening]{animation:var(--openclaw-tooltip-open-animation)}.tooltip-content{text-align:center;white-space:pre-line;display:block}.tooltip-rich-content{pointer-events:inherit;text-align:left;display:block}@media (prefers-reduced-motion:reduce){.tooltip-surface{--openclaw-tooltip-popup-show-duration:0s;--openclaw-tooltip-popup-hide-duration:0s}.tooltip-surface[data-phase=opening],.tooltip-surface[data-phase=closing],:host(.sidebar-hover-tooltip) .tooltip-surface[data-phase=opening]{animation:none}}@keyframes openclaw-tooltip-hover-card-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}`})))()}var w=t({mountTooltipView:()=>T});function T(e,t,r,a){let o=e.ownerDocument.createElement(`span`);o.className=`tooltip-content`,t.insertBefore(o,r),o.textContent=e.content;let l,u=null,m,h=g(`tooltip`,void 0,{exclusiveGroup:`tooltip`,dismissOutsidePointer:!1,dismissOutsideFocus:!1,dismissEscape:!1,reflectTriggerExpanded:!1,isValid:()=>!e.disabled&&!!a.trigger?.isConnected,acquireOcclusion:i,onInteraction:(e,t)=>a.handleInteraction(e,t),interactionElements:()=>a.trigger?[a.trigger]:[],onRootChange:t=>t===e.shadowRoot?d(t,[p,S,f]):void 0});h.bindSurface(t),h.setParent(s(a.trigger??e));let _=h.subscribe(e=>a.acceptedOpen(e)),v=[`overlay-after-show`,`overlay-after-hide`].map(r=>n(t,r,n=>{n.target===t&&(n.stopPropagation(),e.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0,cancelable:n.cancelable}))||n.preventDefault())})),y=()=>{let e=a.trigger;if(!e)return;let n=a.resolvedPlacement;(e!==u||n!==m)&&(l??=c(t),l.update(e,n),u=e,m=n),t.setAttribute(`placement`,n)};return{request(e){let t=a.trigger;return e&&t&&h.setParent(s(t)),h.bindTrigger(t instanceof HTMLElement?t:void 0),y(),h.request(e)},update(){o.textContent=e.content,h.open&&y()},retire:()=>h.retire(),dispose(){_(),h.dispose(),l?.dispose(),o.remove();for(let e of v)e()}}}var E,D;function O(){return(O=e((()=>{y(),o(),r(),u(),l(),_(),h(),m(),C(),E=b(`<openclaw-tooltip>`,1),D=Object.assign(function(e){var t=E();return x(t,[e,{get"prop:content"(){return e.content??``},get"prop:placement"(){return e.placement},get"prop:closeDelay"(){return e.closeDelay??100},get"prop:hoverDismissDelay"(){return e.hoverDismissDelay},get"prop:delay"(){return e.delay},get"prop:describe"(){return e.describe??!0},get"prop:descriptionTarget"(){return e.descriptionTarget},get"prop:pointerThrough"(){return e.pointerThrough??!1},get"prop:autoSize"(){return e.autoSize??!1},get"prop:disabled"(){return e.disabled??!1},get"prop:openOnClick"(){return e.openOnClick??!1},get"prop:anchor"(){return e.anchor??null}}],!1),t._$owner=v(),t},{Element:a})})))()}export{O as n,w as r,D as t};