import t from"../../utils/extend.prod.js";import*as o from"../../utils/rect.prod.js";import{makeModifier as e}from"../base.prod.js";import{getRestrictionRect as r}from"./pointer.prod.js";const n={top:1/0,left:1/0,bottom:-1/0,right:-1/0},i={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function s(t,o){for(const e of["top","left","bottom","right"])e in t||(t[e]=o[e]);return t}const f={noInner:n,noOuter:i,start({interaction:t,startOffset:e,state:n}){const{options:i}=n;let s;if(i){const e=r(i.offset,t,t.coords.start.page);s=o.rectToXY(e)}s=s||{x:0,y:0},n.offset={top:s.y+e.top,left:s.x+e.left,bottom:s.y-e.bottom,right:s.x-e.right}},set({coords:o,edges:e,interaction:f,state:m}){const{offset:a,options:p}=m;if(!e)return;const l=t({},o),h=r(p.inner,f,l)||{},c=r(p.outer,f,l)||{};s(h,n),s(c,i),e.top?o.y=Math.min(Math.max(c.top+a.top,l.y),h.top+a.top):e.bottom&&(o.y=Math.max(Math.min(c.bottom+a.bottom,l.y),h.bottom+a.bottom)),e.left?o.x=Math.min(Math.max(c.left+a.left,l.x),h.left+a.left):e.right&&(o.x=Math.max(Math.min(c.right+a.right,l.x),h.right+a.right))},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}};export default e(f,"restrictEdges");export{f as restrictEdges}; //# sourceMappingURL=edges.prod.js.map