{"version":3,"file":"portal-BCxcQdVE.js","sources":["../../../node_modules/@headlessui/vue/dist/hooks/use-event-listener.js","../../../node_modules/@headlessui/vue/dist/hooks/use-tab-direction.js","../../../node_modules/@headlessui/vue/dist/hooks/use-root-containers.js","../../../node_modules/@headlessui/vue/dist/internal/portal-force-root.js","../../../node_modules/@headlessui/vue/dist/components/portal/portal.js"],"sourcesContent":["import{watchEffect as i}from\"vue\";import{env as a}from'../utils/env.js';function E(n,e,o,r){a.isServer||i(t=>{n=n!=null?n:window,n.addEventListener(e,o,r),t(()=>n.removeEventListener(e,o,r))})}export{E as useEventListener};\n","import{ref as a}from\"vue\";import{useWindowEvent as t}from'./use-window-event.js';var d=(r=>(r[r.Forwards=0]=\"Forwards\",r[r.Backwards=1]=\"Backwards\",r))(d||{});function n(){let o=a(0);return t(\"keydown\",e=>{e.key===\"Tab\"&&(o.value=e.shiftKey?1:0)}),o}export{d as Direction,n as useTabDirection};\n","import{h as m,ref as s}from\"vue\";import{Features as d,Hidden as c}from'../internal/hidden.js';import{dom as T}from'../utils/dom.js';import{getOwnerDocument as E}from'../utils/owner.js';function N({defaultContainers:o=[],portals:i,mainTreeNodeRef:H}={}){let t=s(null),r=E(t);function u(){var l,f,a;let n=[];for(let e of o)e!==null&&(e instanceof HTMLElement?n.push(e):\"value\"in e&&e.value instanceof HTMLElement&&n.push(e.value));if(i!=null&&i.value)for(let e of i.value)n.push(e);for(let e of(l=r==null?void 0:r.querySelectorAll(\"html > *, body > *\"))!=null?l:[])e!==document.body&&e!==document.head&&e instanceof HTMLElement&&e.id!==\"headlessui-portal-root\"&&(e.contains(T(t))||e.contains((a=(f=T(t))==null?void 0:f.getRootNode())==null?void 0:a.host)||n.some(M=>e.contains(M))||n.push(e));return n}return{resolveContainers:u,contains(n){return u().some(l=>l.contains(n))},mainTreeNodeRef:t,MainTreeNode(){return H!=null?null:m(c,{features:d.Hidden,ref:t})}}}function v(){let o=s(null);return{mainTreeNodeRef:o,MainTreeNode(){return m(c,{features:d.Hidden,ref:o})}}}export{v as useMainTreeNode,N as useRootContainers};\n","import{defineComponent as l,inject as a,provide as c}from\"vue\";import{render as p}from'../utils/render.js';let e=Symbol(\"ForcePortalRootContext\");function s(){return a(e,!1)}let u=l({name:\"ForcePortalRoot\",props:{as:{type:[Object,String],default:\"template\"},force:{type:Boolean,default:!1}},setup(o,{slots:t,attrs:r}){return c(e,o.force),()=>{let{force:f,...n}=o;return p({theirProps:n,ourProps:{},slot:{},slots:t,attrs:r,name:\"ForcePortalRoot\"})}}});export{u as ForcePortalRoot,s as usePortalRoot};\n","import{computed as w,defineComponent as m,getCurrentInstance as j,h as I,inject as s,onMounted as R,onUnmounted as y,provide as E,reactive as G,ref as p,Teleport as O,watch as D,watchEffect as K}from\"vue\";import{usePortalRoot as S}from'../../internal/portal-force-root.js';import{dom as B}from'../../utils/dom.js';import{getOwnerDocument as C}from'../../utils/owner.js';import{render as h}from'../../utils/render.js';function x(e){let t=C(e);if(!t){if(e===null)return null;throw new Error(`[Headless UI]: Cannot find ownerDocument for contextElement: ${e}`)}let l=t.getElementById(\"headlessui-portal-root\");if(l)return l;let r=t.createElement(\"div\");return r.setAttribute(\"id\",\"headlessui-portal-root\"),t.body.appendChild(r)}const f=new WeakMap;function U(e){var t;return(t=f.get(e))!=null?t:0}function M(e,t){let l=t(U(e));return l<=0?f.delete(e):f.set(e,l),l}let $=m({name:\"Portal\",props:{as:{type:[Object,String],default:\"div\"}},setup(e,{slots:t,attrs:l}){let r=p(null),i=w(()=>C(r)),o=S(),u=s(H,null),n=p(o===!0||u==null?x(r.value):u.resolveTarget());n.value&&M(n.value,a=>a+1);let c=p(!1);R(()=>{c.value=!0}),K(()=>{o||u!=null&&(n.value=u.resolveTarget())});let v=s(d,null),g=!1,b=j();return D(r,()=>{if(g||!v)return;let a=B(r);a&&(y(v.register(a),b),g=!0)}),y(()=>{var P,T;let a=(P=i.value)==null?void 0:P.getElementById(\"headlessui-portal-root\");!a||n.value!==a||M(n.value,L=>L-1)||n.value.children.length>0||(T=n.value.parentElement)==null||T.removeChild(n.value)}),()=>{if(!c.value||n.value===null)return null;let a={ref:r,\"data-headlessui-portal\":\"\"};return I(O,{to:n.value},h({ourProps:a,theirProps:e,slot:{},attrs:l,slots:t,name:\"Portal\"}))}}}),d=Symbol(\"PortalParentContext\");function q(){let e=s(d,null),t=p([]);function l(o){return t.value.push(o),e&&e.register(o),()=>r(o)}function r(o){let u=t.value.indexOf(o);u!==-1&&t.value.splice(u,1),e&&e.unregister(o)}let i={register:l,unregister:r,portals:t};return[t,m({name:\"PortalWrapper\",setup(o,{slots:u}){return E(d,i),()=>{var n;return(n=u.default)==null?void 0:n.call(u)}}})]}let H=Symbol(\"PortalGroupContext\"),z=m({name:\"PortalGroup\",props:{as:{type:[Object,String],default:\"template\"},target:{type:Object,default:null}},setup(e,{attrs:t,slots:l}){let r=G({resolveTarget(){return e.target}});return E(H,r),()=>{let{target:i,...o}=e;return h({theirProps:o,ourProps:{},slot:{},attrs:t,slots:l,name:\"PortalGroup\"})}}});export{$ as Portal,z as PortalGroup,q as useNestedPortals};\n"],"names":["E","n","e","o","r","c","isServer","i","t","window","addEventListener","removeEventListener","d","Forwards","Backwards","a","key","value","shiftKey","N","defaultContainers","portals","mainTreeNodeRef","H","s","u","l","f","HTMLElement","push","querySelectorAll","document","body","head","id","contains","T","getRootNode","host","some","M","resolveContainers","MainTreeNode","m","features","Hidden","ref","Symbol","name","props","as","type","Object","String","default","force","Boolean","setup","slots","attrs","p","theirProps","ourProps","slot","WeakMap","get","U","delete","set","$","w","C","Error","getElementById","createElement","setAttribute","appendChild","x","resolveTarget","R","K","v","g","b","j","D","B","y","register","P","L","children","length","parentElement","removeChild","I","O","to","h","q","indexOf","splice","unregister","call","z","target","G"],"mappings":"2RAAwE,SAASA,EAAEC,EAAEC,EAAEC,EAAEC,GAAKC,EAAAC,UAAUC,GAAKC,KAACP,EAAK,MAAHA,EAAQA,EAAEQ,QAASC,iBAAiBR,EAAEC,EAAEC,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