PageSourceSearch

https://www.aipictors.com/assets/popover.js

js aipictors.com collected 2026-09-24 09:42:06 UTC 5,554 bytes, 1 lines download raw bytes

1import{r as p,j as c}from"./jsx-runtime.js";import{c as P}from"./index9.js";import{u as A,c as $}from"./index4.js";import{c as L}from"./index11.js";import{D as z}from"./index20.js";import{P as G,h as H,R as K,u as U,F as V}from"./index21.js";import{u as W}from"./index10.js";import{c as O,C as Z,R as q,A as _,a as B}from"./index30.js";import{P as w}from"./index12.js";import{P as E}from"./index13.js";import{u as J}from"./index14.js";import{c as Q}from"./utils.js";var C="Popover",[b,_e]=L(C,[O]),m=O(),[X,d]=b(C),j=e=>{const{__scopePopover:n,children:t,open:a,defaultOpen:o,onOpenChange:r,modal:s=!1}=e,i=m(n),l=p.useRef(null),[u,g]=p.useState(!1),[h,f]=J({prop:a,defaultProp:o??!1,onChange:r,caller:C});return c.jsx(q,{...i,children:c.jsx(X,{scope:n,contentId:W(),triggerRef:l,open:h,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(x=>!x),[f]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>g(!0),[]),onCustomAnchorRemove:p.useCallback(()=>g(!1),[]),modal:s,children:t})})};j.displayName=C;var N="PopoverAnchor",Y=p.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(N,t),r=m(t),{onCustomAnchorAdd:s,onCustomAnchorRemove:i}=o;return p.useEffect(()=>(s(),()=>i()),[s,i]),c.jsx(_,{...r,...a,ref:n})});Y.displayName=N;var F="PopoverTrigger",y=p.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(F,t),r=m(t),s=A(n,o.triggerRef),i=c.jsx(E.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":k(o.open),...a,ref:s,onClick:P(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:c.jsx(_,{asChild:!0,...r,children:i})});y.displayName=F;var R="PopoverPortal",[ee,oe]=b(R,{forceMount:void 0}),S=e=>{const{__scopePopover:n,forceMount:t,children:a,container:o}=e,r=d(R,n);return c.jsx(ee,{scope:n,forceMount:t,children:c.jsx(w,{present:t||r.open,children:c.jsx(G,{asChild:!0,container:o,children:a})})})};S.displayName=R;var v="PopoverContent",D=p.forwardRef((e,n)=>{const t=oe(v,e.__scopePopover),{forceMount:a=t.forceMount,...o}=e,r=d(v,e.__scopePopover);return c.jsx(w,{present:a||r.open,children:r.modal?c.jsx(re,{...o,ref:n}):c.jsx(ne,{...o,ref:n})})});D.displayName=v;var te=$("PopoverContent.RemoveScroll"),re=p.forwardRef((e,n)=>{const t=d(v,e.__scopePopover),a=p.useRef(null),o=A(n,a),r=p.useRef(!1);return p.useEffect(()=>{const s=a.current;if(s)return H(s)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(M,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),r.current||(i=t.triggerRef.current)==null||i.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0,u=i.button===2||l;r.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=p.forwardRef((e,n)=>{const t=d(v,e.__scopePopover),a=p.useRef(!1),o=p.useRef(!1);return c.jsx(M,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,r),r.defaultPrevented||(a.current||(i=t.triggerRef.current)==null||i.focus(),r.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:r=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=r.target;((u=t.triggerRef.current)==null?void 0:u.contains(s))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&o.current&&r.preventDefault()}})}),M=p.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:r,disableOutsidePointerEvents:s,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:g,...h}=e,f=d(v,t),x=m(t);return U(),c.jsx(V,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:r,children:c.jsx(z,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:g,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Z,{"data-state":k(f.open),role:"dialog",id:f.contentId,...x,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}
1),T="PopoverClose",ae=p.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(T,t);return c.jsx(E.button,{type:"button",...a,ref:n,onClick:P(e.onClick,()=>o.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=p.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=m(t);return c.jsx(B,{...o,...a,ref:n})});ce.displayName=se;function k(e){return e?"open":"closed"}var ie=j,pe=y,le=S,I=D;const we=ie,Ee=pe,ue=p.forwardRef(({className:e,align:n="center",sideOffset:t=4,...a},o)=>c.jsx(le,{children:c.jsx(I,{ref:o,align:n,sideOffset:t,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));ue.displayName=I.displayName;export{we as P,Ee as a,ue as b};

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.