client/components/popover/util.js
function( off, el ) {
	const ew = getBoundingClientRect( el ).width;
	off.left = Math.max( 0, Math.min( off.left, viewport.width - ew ) );

	return off;
}
function( off, el ) {
	const ew = getBoundingClientRect( el ).width;
	off.left = Math.max( 0, Math.min( off.left, viewport.width - ew ) );

	return off;
}
function ( off , el ) { const ew = getBoundingClientRect ( el ) . width ; off . left = Math . max ( 0 , Math . min ( off . left , viewport . width - ew ) ) ; return off ; }
/*
Constrain a left to keep the element in the window
@param  {Object} pl proposed left
@param  {Number} ew tip element width
@return {Number}    the best width
/ * Constrain a left to keep the element in the window