If there are no empty slots, then prioritize the smallest stack of the same item (pick the first if there are multiple) If there is a toggled slot it will be skipped. The item will then be moved into the container If the item cannot be moved, it will be ejected into...