2 lines
20 KiB
JavaScript

var e=Object.defineProperty,t=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(t,s,r)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r;function a(e){return null==e||""===e||Array.isArray(e)&&0===e.length||!(e instanceof Date)&&"object"==typeof e&&0===Object.keys(e).length}function o(e){return!!(e&&e.constructor&&e.call&&e.apply)}function i(e){return!a(e)}function l(e,t){let s=-1;if(i(e))try{s=e.findLastIndex(t)}catch(r){s=e.lastIndexOf([...e].reverse().find(t))}return s}function c(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||0!==Object.keys(e).length)}function u(e,...t){return o(e)?e(...t):e}function d(e,t=!0){return"string"==typeof e&&(t||""!==e)}function h(e){return d(e)?e.replace(/(-|_)/g,"").toLowerCase():e}function m(e,t="",s={}){const r=h(t).split("."),n=r.shift();return n?c(e)?m(u(e[Object.keys(e).find((e=>h(e)===n))||""],s),r.join("."),s):void 0:u(e,s)}function p(e,t=!0){return Array.isArray(e)&&(t||0!==e.length)}function f(e=""){return i(e)&&1===e.length&&!!e.match(/\S| /)}function y(e,t){if(t){const s=t.test(e);return t.lastIndex=0,s}return!1}function g(...e){const a=(e={},o={})=>{const i=((e,a)=>{for(var o in a||(a={}))s.call(a,o)&&n(e,o,a[o]);if(t)for(var o of t(a))r.call(a,o)&&n(e,o,a[o]);return e})({},e);return Object.keys(o).forEach((t=>{c(o[t])&&t in e&&c(e[t])?i[t]=a(e[t],o[t]):i[t]=o[t]})),i};return e.reduce(((e,t,s)=>0===s?t:a(e,t)),{})}function v(e){return e?e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":"):e}function b(e){return d(e,!1)?e[0].toUpperCase()+e.slice(1):e}function S(e){return d(e)?e.replace(/(_)/g,"-").replace(/[A-Z]/g,((e,t)=>0===t?e:"-"+e.toLowerCase())).toLowerCase():e}function k(e){return d(e)?e.replace(/[A-Z]/g,((e,t)=>0===t?e:"."+e.toLowerCase())).toLowerCase():e}function $(){const e=new Map;return{on(t,s){let r=e.get(t);return r?r.push(s):r=[s],e.set(t,r),this},off(t,s){let r=e.get(t);return r&&r.splice(r.indexOf(s)>>>0,1),this},emit(t,s){let r=e.get(t);r&&r.slice().map((e=>{e(s)}))},clear(){e.clear()}}}var w=Object.defineProperty,L=Object.defineProperties,x=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,j=(e,t,s)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,_=(e,t)=>{for(var s in t||(t={}))C.call(t,s)&&j(e,s,t[s]);if(O)for(var s of O(t))N.call(t,s)&&j(e,s,t[s]);return e},P=(e,t)=>L(e,x(t)),T=(e,t)=>{var s={};for(var r in e)C.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(null!=e&&O)for(var r of O(e))t.indexOf(r)<0&&N.call(e,r)&&(s[r]=e[r]);return s},E=$();function A(e,t){p(e)?e.push(...t||[]):c(e)&&Object.assign(e,t)}function V(e="",t=""){return function(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}(`${d(e,!1)&&d(t,!1)?`${e}-`:e}${t}`)}function R(e="",t=""){return`--${V(e,t)}`}function M(e,t="",s="",r=[],n){if(d(e)){const t=/{([^}]*)}/g,a=e.trim();if(function(e=""){return((e.match(/{/g)||[]).length+(e.match(/}/g)||[]).length)%2!=0}(a))return;if(y(a,t)){const e=a.replaceAll(t,(e=>{const t=e.replace(/{|}/g,"").split(".").filter((e=>!r.some((t=>y(e,t)))));return`var(${R(s,S(t.join("-")))}${i(n)?`, ${n}`:""})`})),o=/(\d+\s+[\+\-\*\/]\s+\d+)/g,l=/var\([^)]+\)/g;return y(e.replace(l,"0"),o)?`calc(${e})`:e}return a}if(function(e){return i(e)&&!isNaN(e)}(e))return e}function W(e,t){return e?`${e}{${t}}`:""}var D=(...e)=>F(B.getTheme(),...e),F=(e={},t,s,r)=>{if(t){const{variable:n,options:o}=B.defaults||{},{prefix:i,transform:l}=(null==e?void 0:e.options)||o||{},c=y(t,/{([^}]*)}/g)?t:`{${t}}`;return"value"===r||a(r)&&"strict"===l?B.getTokenValue(t):M(c,void 0,i,[n.excludedKeyRegex],s)}return""};function H(e,t={}){const s=B.defaults.variable,{prefix:r=s.prefix,selector:n=s.selector,excludedKeyRegex:a=s.excludedKeyRegex}=t,o=(e,t="")=>Object.entries(e).reduce(((e,[s,n])=>{const i=y(s,a)?V(t):V(t,S(s)),l=function(e){return c(e)&&e.hasOwnProperty("value")&&e.hasOwnProperty("type")?e.value:e}(n);if(c(l)){const{variables:t,tokens:s}=o(l,i);A(e.tokens,s),A(e.variables,t)}else e.tokens.push((r?i.replace(`${r}-`,""):i).replaceAll("-",".")),function(e,t,s){d(t,!1)&&e.push(`${t}:${s};`)}(e.variables,R(i),M(l,i,r,[a]));return e}),{variables:[],tokens:[]}),{variables:i,tokens:l}=o(e,r);return{value:i,tokens:l,declarations:i.join(""),css:W(n,i.join(""))}}var I={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:`${e}{:root{[CSS]}}`,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(e.trim())}}},custom:{resolve:e=>({type:"custom",selector:e,matched:!0})}},resolve(e){const t=Object.keys(this.rules).filter((e=>"custom"!==e)).map((e=>this.rules[e]));return[e].flat().map((e=>{var s;return null!=(s=t.map((t=>t.resolve(e))).find((e=>e.matched)))?s:this.rules.custom.resolve(e)}))}},_toVariables:(e,t)=>H(e,{prefix:null==t?void 0:t.prefix}),getCommon({name:e="",theme:t={},params:s,set:r,defaults:n}){var a,o,l,c,d,h,m;const{preset:p,options:f}=t;let y,g,v,b,S,k,$;if(i(p)&&"strict"!==f.transform){const{primitive:t,semantic:s,extend:w}=p,L=s||{},{colorScheme:x}=L,O=T(L,["colorScheme"]),C=w||{},{colorScheme:N}=C,j=T(C,["colorScheme"]),_=x||{},{dark:P}=_,E=T(_,["dark"]),A=N||{},{dark:V}=A,R=T(A,["dark"]),M=i(t)?this._toVariables({primitive:t},f):{},W=i(O)?this._toVariables({semantic:O},f):{},F=i(E)?this._toVariables({light:E},f):{},H=i(P)?this._toVariables({dark:P},f):{},I=i(j)?this._toVariables({semantic:j},f):{},B=i(R)?this._toVariables({light:R},f):{},z=i(V)?this._toVariables({dark:V},f):{},[K,Z]=[null!=(a=M.declarations)?a:"",M.tokens],[q,X]=[null!=(o=W.declarations)?o:"",W.tokens||[]],[Y,U]=[null!=(l=F.declarations)?l:"",F.tokens||[]],[G,J]=[null!=(c=H.declarations)?c:"",H.tokens||[]],[Q,ee]=[null!=(d=I.declarations)?d:"",I.tokens||[]],[te,se]=[null!=(h=B.declarations)?h:"",B.tokens||[]],[re,ne]=[null!=(m=z.declarations)?m:"",z.tokens||[]];y=this.transformCSS(e,K,"light","variable",f,r,n),g=Z;v=`${this.transformCSS(e,`${q}${Y}`,"light","variable",f,r,n)}${this.transformCSS(e,`${G}`,"dark","variable",f,r,n)}`,b=[...new Set([...X,...U,...J])];S=`${this.transformCSS(e,`${Q}${te}color-scheme:light`,"light","variable",f,r,n)}${this.transformCSS(e,`${re}color-scheme:dark`,"dark","variable",f,r,n)}`,k=[...new Set([...ee,...se,...ne])],$=u(p.css,{dt:D})}return{primitive:{css:y,tokens:g},semantic:{css:v,tokens:b},global:{css:S,tokens:k},style:$}},getPreset({name:e="",preset:t={},options:s,params:r,set:n,defaults:a,selector:o}){var l,c,d;let h,m,p;if(i(t)&&"strict"!==s.transform){const r=e.replace("-directive",""),f=t,{colorScheme:y,extend:g,css:v}=f,b=T(f,["colorScheme","extend","css"]),S=g||{},{colorScheme:k}=S,$=T(S,["colorScheme"]),w=y||{},{dark:L}=w,x=T(w,["dark"]),O=k||{},{dark:C}=O,N=T(O,["dark"]),j=i(b)?this._toVariables({[r]:_(_({},b),$)},s):{},P=i(x)?this._toVariables({[r]:_(_({},x),N)},s):{},E=i(L)?this._toVariables({[r]:_(_({},L),C)},s):{},[A,V]=[null!=(l=j.declarations)?l:"",j.tokens||[]],[R,M]=[null!=(c=P.declarations)?c:"",P.tokens||[]],[W,F]=[null!=(d=E.declarations)?d:"",E.tokens||[]];h=`${this.transformCSS(r,`${A}${R}`,"light","variable",s,n,a,o)}${this.transformCSS(r,W,"dark","variable",s,n,a,o)}`,m=[...new Set([...V,...M,...F])],p=u(v,{dt:D})}return{css:h,tokens:m,style:p}},getPresetC({name:e="",theme:t={},params:s,set:r,defaults:n}){var a;const{preset:o,options:i}=t,l=null==(a=null==o?void 0:o.components)?void 0:a[e];return this.getPreset({name:e,preset:l,options:i,params:s,set:r,defaults:n})},getPresetD({name:e="",theme:t={},params:s,set:r,defaults:n}){var a;const o=e.replace("-directive",""),{preset:i,options:l}=t,c=null==(a=null==i?void 0:i.directives)?void 0:a[o];return this.getPreset({name:o,preset:c,options:l,params:s,set:r,defaults:n})},applyDarkColorScheme:e=>!("none"===e.darkModeSelector||!1===e.darkModeSelector),getColorSchemeOption(e,t){var s;return this.applyDarkColorScheme(e)?this.regex.resolve(!0===e.darkModeSelector?t.options.darkModeSelector:null!=(s=e.darkModeSelector)?s:t.options.darkModeSelector):[]},getLayerOrder(e,t={},s,r){const{cssLayer:n}=t;if(n){return`@layer ${u(n.order||"primeui",s)}`}return""},getCommonStyleSheet({name:e="",theme:t={},params:s,props:r={},set:n,defaults:a}){const o=this.getCommon({name:e,theme:t,params:s,set:n,defaults:a}),i=Object.entries(r).reduce(((e,[t,s])=>e.push(`${t}="${s}"`)&&e),[]).join(" ");return Object.entries(o||{}).reduce(((e,[t,s])=>{if(null==s?void 0:s.css){const r=v(null==s?void 0:s.css),n=`${t}-variables`;e.push(`<style type="text/css" data-primevue-style-id="${n}" ${i}>${r}</style>`)}return e}),[]).join("")},getStyleSheet({name:e="",theme:t={},params:s,props:r={},set:n,defaults:a}){var o;const i={name:e,theme:t,params:s,set:n,defaults:a},l=null==(o=e.includes("-directive")?this.getPresetD(i):this.getPresetC(i))?void 0:o.css,c=Object.entries(r).reduce(((e,[t,s])=>e.push(`${t}="${s}"`)&&e),[]).join(" ");return l?`<style type="text/css" data-primevue-style-id="${e}-variables" ${c}>${v(l)}</style>`:""},createTokens(e={},t,s="",r="",n={}){return Object.entries(e).forEach((([e,o])=>{const i=y(e,t.variable.excludedKeyRegex)?s:s?`${s}.${k(e)}`:k(e),l=r?`${r}.${e}`:e;c(o)?this.createTokens(o,t,i,l,n):(n[i]||(n[i]={paths:[],computed(e,t={}){var s,r;return 1===this.paths.length?null==(s=this.paths[0])?void 0:s.computed(this.paths[0].scheme,t.binding):e&&"none"!==e?null==(r=this.paths.find((t=>t.scheme===e)))?void 0:r.computed(e,t.binding):this.paths.map((e=>e.computed(e.scheme,t[e.scheme])))}}),n[i].paths.push({path:l,value:o,scheme:l.includes("colorScheme.light")?"light":l.includes("colorScheme.dark")?"dark":"none",computed(e,t={}){const s=/{([^}]*)}/g;let r=o;if(t.name=this.path,t.binding||(t.binding={}),y(o,s)){const a=o.trim().replaceAll(s,(s=>{var r;const a=s.replace(/{|}/g,""),o=null==(r=n[a])?void 0:r.computed(e,t);return p(o)&&2===o.length?`light-dark(${o[0].value},${o[1].value})`:null==o?void 0:o.value})),i=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,l=/var\([^)]+\)/g;r=y(a.replace(l,"0"),i)?`calc(${a})`:a}return a(t.binding)&&delete t.binding,{colorScheme:e,path:this.path,paths:t,value:r.includes("undefined")?void 0:r}}}))})),n},getTokenValue(e,t,s){var r;const n=t.split(".").filter((e=>!y(e.toLowerCase(),s.variable.excludedKeyRegex))).join(".");const a=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,o=[null==(r=e[n])?void 0:r.computed(a)].flat().filter((e=>e));return 1===o.length?o[0].value:o.reduce(((e={},t)=>{const s=t,{colorScheme:r}=s,n=T(s,["colorScheme"]);return e[r]=n,e}),void 0)},getSelectorRule:(e,t,s,r)=>"class"===s||"attr"===s?W(i(t)?`${e}${t},${e} ${t}`:e,r):W(e,i(t)?W(t,r):r),transformCSS(e,t,s,r,n={},a,o,l){if(i(t)){const{cssLayer:d}=n;if("style"!==r){const e=this.getColorSchemeOption(n,o);t="dark"===s?e.reduce(((e,{type:s,selector:r})=>(i(r)&&(e+=r.includes("[CSS]")?r.replace("[CSS]",t):this.getSelectorRule(r,l,s,t)),e)),""):W(null!=l?l:":root",t)}if(d){const s={name:"primeui",order:"primeui"};c(d)&&(s.name=u(d.name,{name:e,type:r})),i(s.name)&&(t=W(`@layer ${s.name}`,t),null==a||a.layerNames(s.name))}return t}return""}},B={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){const{theme:t}=e;t&&(this._theme=P(_({},t),{options:_(_({},this.defaults.options),t.options)}),this._tokens=I.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return(null==(e=this.theme)?void 0:e.preset)||{}},get options(){var e;return(null==(e=this.theme)?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),E.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=P(_({},this.theme),{preset:e}),this._tokens=I.createTokens(e,this.defaults),this.clearLoadedStyleNames(),E.emit("preset:change",e),E.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=P(_({},this.theme),{options:e}),this.clearLoadedStyleNames(),E.emit("options:change",e),E.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return I.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return I.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){const s={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return I.getPresetC(s)},getDirective(e="",t){const s={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return I.getPresetD(s)},getCustomPreset(e="",t,s,r){const n={name:e,preset:t,options:this.options,selector:s,params:r,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return I.getPreset(n)},getLayerOrderCSS(e=""){return I.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,s="style",r){return I.transformCSS(e,t,r,s,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,s={}){return I.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:s,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,s={}){return I.getStyleSheet({name:e,theme:this.theme,params:t,props:s,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),E.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&E.emit("theme:load"))}};function z(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className))}function K(e,t){if(e&&t){const s=t=>{z(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(s)))}}function Z(e,t){if(e&&t){const s=t=>{e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(s)))}}function q(){let e=window,t=document,s=t.documentElement,r=t.getElementsByTagName("body")[0];return{width:e.innerWidth||s.clientWidth||r.clientWidth,height:e.innerHeight||s.clientHeight||r.clientHeight}}function X(){let e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}function Y(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}function U(e,t){e&&("string"==typeof t?e.style.cssText=t:Object.entries(t||{}).forEach((([t,s])=>e.style[t]=s)))}function G(e,t){if(e instanceof HTMLElement){return e.offsetWidth}return 0}function J(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}var Q=void 0;function ee(e){{if(null!=Q)return Q;let e=document.createElement("div");U(e,{width:"100px",height:"100px",overflow:"scroll",position:"absolute",top:"-9999px"}),document.body.appendChild(e);let t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),Q=t,t}}function te(e,t={}){if(J(e)){const s=(t,r)=>{var n,a;const o=(null==(n=null==e?void 0:e.$attrs)?void 0:n[t])?[null==(a=null==e?void 0:e.$attrs)?void 0:a[t]]:[];return[r].flat().reduce(((e,r)=>{if(null!=r){const n=typeof r;if("string"===n||"number"===n)e.push(r);else if("object"===n){const n=Array.isArray(r)?s(t,r):Object.entries(r).map((([e,s])=>"style"!==t||!s&&0!==s?s?e:void 0:`${e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${s}`));e=n.length?e.concat(n.filter((e=>!!e))):e}}return e}),o)};Object.entries(t).forEach((([t,r])=>{if(null!=r){const n=t.match(/^on(.+)/);n?e.addEventListener(n[1].toLowerCase(),r):"p-bind"===t||"pBind"===t?te(e,r):(r="class"===t?[...new Set(s("class",r))].join(" ").trim():"style"===t?s("style",r).join(";").trim():r,(e.$attrs=e.$attrs||{})&&(e.$attrs[t]=r),e.setAttribute(t,r))}}))}}function se(e,t={},...s){if(e){const r=document.createElement(e);return te(r,t),r.append(...s),r}}function re(e,t){if(e){e.style.opacity="0";let s=+new Date,r="0",n=function(){r=""+(+e.style.opacity+((new Date).getTime()-s)/t),e.style.opacity=r,s=+new Date,+r<1&&(window.requestAnimationFrame&&requestAnimationFrame(n)||setTimeout(n,16))};n()}}function ne(e,t){return J(e)?e.matches(t)?e:e.querySelector(t):null}function ae(e,t){e&&document.activeElement!==e&&e.focus(t)}function oe(e,t){if(J(e)){const s=e.getAttribute(t);return isNaN(s)?"true"===s||"false"===s?"true"===s:s:+s}}function ie(e){if(e){let t=e.offsetHeight,s=getComputedStyle(e);return t-=parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)+parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),t}return 0}function le(e){if(e){e.style.visibility="hidden",e.style.display="block";let t=e.offsetHeight;return e.style.display="none",e.style.visibility="visible",t}return 0}function ce(e){if(e){e.style.visibility="hidden",e.style.display="block";let t=e.offsetWidth;return e.style.display="none",e.style.visibility="visible",t}return 0}function ue(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function de(e){if(e){let t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}function he(e,t){if(e){return e.offsetHeight}return 0}function me(e,t=[]){const s=ue(e);return null===s?t:me(s,t.concat([s]))}function pe(e){let t=[];if(e){let s=me(e);const r=/(auto|scroll)/,n=e=>{try{let t=window.getComputedStyle(e,null);return r.test(t.getPropertyValue("overflow"))||r.test(t.getPropertyValue("overflowX"))||r.test(t.getPropertyValue("overflowY"))}catch(t){return!1}};for(let e of s){let s=1===e.nodeType&&e.dataset.scrollselectors;if(s){let r=s.split(",");for(let s of r){let r=ne(e,s);r&&n(r)&&t.push(r)}}9!==e.nodeType&&n(e)&&t.push(e)}}return t}function fe(e){return!(null==e||!e.nodeName||!ue(e))}function ye(e){if(e){let t=e.offsetWidth,s=getComputedStyle(e);return t-=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight)+parseFloat(s.borderLeftWidth)+parseFloat(s.borderRightWidth),t}return 0}function ge(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function ve(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function be(e,t){var s,r;if(e){const n=e.parentElement,a=de(n),o=q(),i=e.offsetParent?e.offsetWidth:ce(e),l=e.offsetParent?e.offsetHeight:le(e),c=G(null==(s=null==n?void 0:n.children)?void 0:s[0]),u=he(null==(r=null==n?void 0:n.children)?void 0:r[0]);let d="",h="";a.left+c+i>o.width-ee()?a.left<i?t%2==1?d=a.left?"-"+a.left+"px":"100%":t%2==0&&(d=o.width-i-ee()+"px"):d="-100%":d="100%",h=e.getBoundingClientRect().top+u+l>o.height?`-${l-u}px`:"0px",e.style.top=h,e.style.left=d}}function Se(e,t="",s){J(e)&&null!=s&&e.setAttribute(t,s)}var ke={};function $e(e="pui_id_"){return ke.hasOwnProperty(e)||(ke[e]=0),ke[e]++,`${e}${ke[e]}`}var we=function(){let e=[];const t=(t,s,r=0)=>[...e].reverse().find((e=>!0))||{key:t,value:r},s=e=>e&&parseInt(e.style.zIndex,10)||0;return{get:s,set:(s,r,n)=>{r&&(r.style.zIndex=String(((s,r,n=999)=>{const a=t(s,r,n),o=a.value+(a.key===s?0:n)+1;return e.push({key:s,value:o}),o})(s,!0,n)))},clear:t=>{var r;t&&(r=s(t),e=e.filter((e=>e.value!==r)),t.style.zIndex="")},getCurrent:e=>(e=>t(e).value)(e)}}();export{G as A,he as B,de as C,K as D,$ as E,oe as F,ae as G,f as H,U as I,ce as J,le as K,q as L,ve as M,l as N,be as O,re as P,X as Q,Y as R,z as S,we as Z,Se as a,ge as b,i as c,B as d,D as e,ne as f,o as g,E as h,fe as i,m as j,d as k,p as l,v as m,pe as n,a as o,c as p,b as q,u as r,te as s,h as t,$e as u,g as v,se as w,Z as x,ie as y,ye as z};