import{__require as e}from"../../fill-range/index.mjs";import{__require as r}from"./utils.mjs";var n,t;function i(){if(t)return n;t=1;const i=e(),s=r();return n=(e,r={})=>{const n=(e,t={})=>{const o=s.isInvalidBrace(t),u=!0===e.invalid&&!0===r.escapeInvalid,a=!0===o||!0===u,l=!0===r.escapeInvalid?"\\":"";let f="";if(!0===e.isOpen)return l+e.value;if(!0===e.isClose)return l+e.value;if("open"===e.type)return a?l+e.value:"(";if("close"===e.type)return a?l+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":a?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){const n=s.reduce(e.nodes),t=i(...n,{...r,wrap:!1,toRegex:!0,strictZeros:!0});if(0!==t.length)return n.length>1&&t.length>1?`(${t})`:t}if(e.nodes)for(const r of e.nodes)f+=n(r,e);return f};return n(e)}}export{i as __require};