"use strict";var f=require("emptier"),v=require("object-traversal");function a(r,l){if(!f.isEmpty(r,l))return Array.isArray(r)?y(r.map(e=>a(e,l)),l)?.filter(e=>!f.isEmpty(e,l)):r instanceof Set?y(new Set([...r].filter(e=>a(e,l))),l):r instanceof Map?y(new Map([...r].filter(e=>a(e[1],l))),l):(typeof r=="object"&&r!==null&&v.traverse(r,e=>{if(e.parent===null||e.key===null)return;const m=a(e.value,l);f.isEmpty(m,l)?delete e.parent[e.key]:e.parent[e.key]=m}),y(r,l))}function y(r,l={}){return f.isEmpty(r,l)?void 0:r}exports.emptyDeep=a;