function e(e){return e}function n(e,o,t,r){let a;switch(e.type){case"Group":a=function(e,o,t,r){const a=" "===e.combinator||r?e.combinator:" "+e.combinator+" ",c=e.terms.map(e=>n(e,o,t,r)).join(a);return e.explicit||t?(r||","===c[0]?"[":"[ ")+c+(r?"]":" ]"):c}(e,o,t,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return n(e.term,o,t,r)+o(function(e){const{min:n,max:o,comma:t}=e;return 0===n&&0===o?t?"#?":"*":0===n&&1===o?"?":1===n&&0===o?t?"#":"+":1===n&&1===o?"":(t?"#":"")+(n===o?"{"+n+"}":"{"+n+","+(0!==o?o:"")+"}")}(e),e);case"Boolean":a="<boolean-expr["+n(e.term,o,t,r)+"]>";break;case"Type":a="<"+e.name+(e.opts?o(function(e){if("Range"===e.type)return" ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}(e.opts),e.opts):"")+">";break;case"Property":a="<'"+e.name+"'>";break;case"Keyword":a=e.name;break;case"AtKeyword":a="@"+e.name;break;case"Function":a=e.name+"(";break;case"String":case"Token":a=e.value;break;case"Comma":a=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return o(a,e)}function o(o,t){let r=e,a=!1,c=!1;return"function"==typeof t?r=t:t&&(a=Boolean(t.forceBraces),c=Boolean(t.compact),"function"==typeof t.decorate&&(r=t.decorate)),n(o,r,a,c)}export{o as generate};