const e=function(){};function t(t){return"function"==typeof t?t:e}function r(r,n,o){let a=e,c=e;if("function"==typeof n?a=n:n&&(a=t(n.enter),c=t(n.leave)),a===e&&c===e)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");!function e(t){switch(a.call(o,t),t.type){case"Group":t.terms.forEach(e);break;case"Multiplier":case"Boolean":e(t.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+t.type)}c.call(o,t)}(r)}export{r as walk};