const p="es_split_pct";function w(t,o=50){const s=typeof t=="number"?t:Number(t);return Number.isFinite(s)?Math.min(80,Math.max(20,Math.round(s*100)/100)):o}function h(t){const o=w(t);return document.cookie=`${p}=${o}; path=/; SameSite=Lax;`,o}function y({container:t,initialClientX:o,setSplitPercent:s}){if(!t)return;const d=t.getBoundingClientRect();let r=!0;const c=Array.from(document.querySelectorAll("iframe")),m=c.map(e=>e.style.pointerEvents);c.forEach(e=>e.style.pointerEvents="none");function n(){r&&(r=!1,c.forEach((e,i)=>e.style.pointerEvents=m[i]??""),window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",n),window.removeEventListener("touchmove",l),window.removeEventListener("touchend",n),document.body.style.cursor="",document.body.style.userSelect="")}function u(e){if(!r){n();return}const v=(e-d.left)/d.width*100,f=h(v);s(f)}function a(e){if(!r||e.buttons===0){n();return}u(e.clientX)}function l(e){const i=e.touches?.[0];if(!r||!i){n();return}u(i.clientX)}window.addEventListener("mousemove",a),window.addEventListener("mouseup",n),window.addEventListener("touchmove",l),window.addEventListener("touchend",n),document.body.style.cursor="col-resize",document.body.style.userSelect="none",u(o)}export{h as a,y as s};
//# sourceMappingURL=split-layout-DnRER1bP.js.map
