import{s as e}from"./chunk-Bj-mKKzh.js";import{n as t}from"./jsx-runtime-CiQ1k8xo.js";import{c as n,i as r,s as i}from"./proxy-BMi4zsAT.js";import{X as a,Z as o,it as s,mt as c,pt as l}from"./single-value-DZHc7Ark.js";function u(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],c=s(i,a,o);return t?c(r):c}var d=e(t(),1);function f(e){let t=n(()=>o(e)),{isStatic:i}=(0,d.useContext)(r);if(i){let[,n]=(0,d.useState)(e);(0,d.useEffect)(()=>t.on(`change`,n),[])}return t}function p(e,t){let n=f(t()),r=()=>n.set(t());return r(),i(()=>{let t=()=>c.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),l(r)}}),n}function m(e){a.current=[],e();let t=p(a.current,e);return a.current=void 0,t}function h(e,t,n,r){if(typeof e==`function`)return m(e);let i=typeof t==`function`?t:u(t,n,r);return Array.isArray(e)?g(e,i):g([e],([e])=>i(e))}function g(e,t){let r=n(()=>[]);return p(e,()=>{r.length=0;let n=e.length;for(let t=0;t<n;t++)r[t]=e[t].get();return t(r)})}export{p as n,f as r,h as t};
//# sourceMappingURL=use-transform-Tia6ejIn.js.map