Peach: Local-first video metadata scraper and media manager.
import{n as e}from"./casing-CxqC0yQL.js";function t(t){return t.startsWith(`--`)?t:e(t)}function n(e){let t=e.style.getPropertyValue(`anchor-name`).trim();return!t||t===`none`?[]:t.split(`,`).map(e=>e.trim()).filter(Boolean)}function r(e,n){for(let[r,i]of Object.entries(n))typeof i==`string`&&e.style.setProperty(t(r),i)}function i(e,n){return[...n].map(n=>{let r=t(n);return{property:r,value:e.style.getPropertyValue(r),priority:e.style.getPropertyPriority(r)}})}function a(e,t){for(let{property:n,value:r,priority:i}of t)r?e.style.setProperty(n,r,i):e.style.removeProperty(n)}function o(e,t,n){let o=i(e,Object.keys(t));try{return r(e,t),n()}finally{a(e,o)}}function s(e,n,{source:r=`inline-or-computed`}={}){let i=t(n),a=r!==`computed`&&e instanceof HTMLElement?e.style.getPropertyValue(i):``;return!a&&r!==`inline`&&(a=getComputedStyle(e).getPropertyValue(i)),a.trim()?c(e,a):null}function c(e,t){let n=t.trim();if(!n)return 0;let r=Number.parseFloat(n);if(!Number.isNaN(r)&&(/^-?\d*\.?\d+$/.test(n)||n.endsWith(`px`)))return r;let i=e.ownerDocument,a=i?.documentElement;if(!Number.isNaN(r)&&n.endsWith(`rem`))return r*(a&&Number.parseFloat(getComputedStyle(a).fontSize)||16);if(!Number.isNaN(r)&&n.endsWith(`em`))return r*(e instanceof HTMLElement&&Number.parseFloat(getComputedStyle(e).fontSize)||16);if(!i)return Number.isNaN(r)?0:r;let o=i.createElement(`div`);if(o.style.position=`absolute`,o.style.visibility=`hidden`,o.style.pointerEvents=`none`,o.style.inlineSize=n,!o.style.inlineSize)return 0;o.style.blockSize=`0`,o.style.padding=`0`,o.style.border=`0`,o.style.inset=`0`;let s=getComputedStyle(e);o.style.fontSize=s.fontSize;for(let e=0;e<s.length;e++){let t=s.item(e);t.startsWith(`--`)&&o.style.setProperty(t,s.getPropertyValue(t))}let c=i.body??i.documentElement;if(!c)return Number.isNaN(r)?0:r;if(c.appendChild(o),getComputedStyle(o).inlineSize===`auto`)return o.remove(),0;let l=o.getBoundingClientRect().width;return o.remove(),Number.isFinite(l)?l:Number.isNaN(r)?0:r}export{a,c as i,n,i as o,s as r,o as s,r as t};
//# sourceMappingURL=style-iIgYFplF.js.map