import{camelize as e,hyphenate as t,isOn as n,resolvePropValue as r}from"../util.mjs";import i from"../classNames.mjs";import a from"../isValid.mjs";import o from"./initDefaultProps.mjs";import{Comment as s,Fragment as c,Text as l,isVNode as u}from"vue";var d=e=>{let t=Object.keys(e),r={},i={},a={};for(let o=0,s=t.length;o<s;o++){let s=t[o];n(s)?(r[s[2].toLowerCase()+s.slice(3)]=e[s],i[s]=e[s]):a[s]=e[s]}return{onEvents:i,events:r,extraAttrs:a}},f=(t=``,n=!1)=>{let r={},i=/;(?![^(]*\))/g,a=/:(.+)/;return typeof t==`object`?t:(t.split(i).forEach(t=>{if(t){let i=t.split(a);if(i.length>1){let t=n?e(i[0].trim()):i[0].trim();r[t]=i[1].trim()}}}),r)},p=(e,t)=>e[t]!==void 0,m=Symbol(`skipFlatten`),h=(e=[],t=!0)=>{let n=Array.isArray(e)?e:[e],r=[];return n.forEach(e=>{Array.isArray(e)?r.push(...h(e,t)):e&&e.type===c?e.key===m?r.push(e):r.push(...h(e.children,t)):e&&u(e)?t&&!T(e)?r.push(e):t||r.push(e):a(e)&&r.push(e)}),r},g=(e,t=`default`,n={})=>u(e)?e.type===c?t==="default"?h(e.children):[]:e.children&&e.children[t]?h(e.children[t](n)):[]:h(e.$slots[t]&&e.$slots[t](n)),_=e=>{let t=e?.vnode?.el||e&&(e.$el||e);for(;t&&!t.tagName;)t=t.nextSibling;return t},v=n=>{let i={};if(n.$&&n.$.vnode){let e=n.$.vnode.props||{};Object.keys(n.$props).forEach(r=>{let a=n.$props[r],o=t(r);(a!==void 0||o in e)&&(i[r]=a)})}else if(u(n)&&typeof n.type==`object`){let t=n.props||{},a={};Object.keys(t).forEach(n=>{a[e(n)]=t[n]});let o=n.type.props||{};Object.keys(o).forEach(e=>{let t=r(o,a,e,a[e]);(t!==void 0||e in a)&&(i[e]=t)})}return i},y=(e,t=`default`,n=e,r=!0)=>{let i;if(e.$){let a=e[t];if(a!==void 0)return typeof a==`function`&&r?a(n):a;i=e.$slots[t],i=r&&i?i(n):i}else if(u(e)){let a=e.props&&e.props[t];if(a!==void 0&&e.props!==null)return typeof a==`function`&&r?a(n):a;e.type===c?i=e.children:e.children&&e.children[t]&&(i=e.children[t],i=r&&i?i(n):i)}return Array.isArray(i)&&(i=h(i),i=i.length===1?i[0]:i,i=i.length===0?void 0:i),i};function b(e={},t=!0){let n={};return n=e.$?{...n,...e.$attrs}:{...n,...e.props},d(n)[t?`onEvents`:`events`]}function x(e){let t=((u(e)?e.props:e.$attrs)||{}).class||{},n={};return typeof t==`string`?t.split(` `).forEach(e=>{n[e.trim()]=!0}):Array.isArray(t)?i(t).split(` `).forEach(e=>{n[e.trim()]=!0}):n={...n,...t},n}function S(t,n){let r=((u(t)?t.props:t.$attrs)||{}).style||{};if(typeof r==`string`)r=f(r,n);else if(n&&r){let t={};return Object.keys(r).forEach(n=>t[e(n)]=r[n]),t}return r}function C(e){return e.length===1&&e[0].type===c}function w(e){return e==null||e===``||Array.isArray(e)&&e.length===0}function T(e){return e&&(e.type===s||e.type===c&&e.children.length===0||e.type===l&&e.children.trim()===``)}function E(e){return e&&e.type===l}function D(e=[]){let t=[];return e.forEach(e=>{Array.isArray(e)?t.push(...e):e?.type===c?t.push(...D(e.children)):t.push(e)}),t.filter(e=>!T(e))}function O(e){if(e){let t=D(e);return t.length?t:void 0}else return e}function k(e){return Array.isArray(e)&&e.length===1&&(e=e[0]),e&&e.__v_isVNode&&typeof e.type!=`symbol`}function A(e,t,n=`default`){return t[n]??e[n]?.()}export{e as camelize,p as default,p as hasProp,D as filterEmpty,O as filterEmptyWithUndefined,_ as findDOMNode,h as flattenChildren,x as getClass,y as getComponent,b as getEvents,v as getOptionProps,A as getPropsSlot,g as getSlot,S as getStyle,o as initDefaultProps,w as isEmptyContent,T as isEmptyElement,C as isFragment,E as isStringElement,k as isValidElement,f as parseStyleText,m as skipFlattenKey,d as splitAttrs};