"use strict";const l=require("../../../../../../_virtual/processor.js");require("./parser.js");const y=require("../../../../../../_virtual/parser2.js");(function(h,c){c.__esModule=!0,c.default=void 0;var d=p(y.parser.exports);function p(o){return o&&o.__esModule?o:{default:o}}var v=function(){function o(e,t){this.func=e||function(){},this.funcRes=null,this.options=t}var s=o.prototype;return s._shouldUpdateSelector=function(t,r){r===void 0&&(r={});var n=Object.assign({},this.options,r);return n.updateSelector===!1?!1:typeof t!="string"},s._isLossy=function(t){t===void 0&&(t={});var r=Object.assign({},this.options,t);return r.lossless===!1},s._root=function(t,r){r===void 0&&(r={});var n=new d.default(t,this._parseOptions(r));return n.root},s._parseOptions=function(t){return{lossy:this._isLossy(t)}},s._run=function(t,r){var n=this;return r===void 0&&(r={}),new Promise(function(i,u){try{var f=n._root(t,r);Promise.resolve(n.func(f)).then(function(a){var _=void 0;return n._shouldUpdateSelector(t,r)&&(_=f.toString(),t.selector=_),{transform:a,root:f,string:_}}).then(i,u)}catch(a){u(a);return}})},s._runSync=function(t,r){r===void 0&&(r={});var n=this._root(t,r),i=this.func(n);if(i&&typeof i.then=="function")throw new Error("Selector processor returned a promise to a synchronous call.");var u=void 0;return r.updateSelector&&typeof t!="string"&&(u=n.toString(),t.selector=u),{transform:i,root:n,string:u}},s.ast=function(t,r){return this._run(t,r).then(function(n){return n.root})},s.astSync=function(t,r){return this._runSync(t,r).root},s.transform=function(t,r){return this._run(t,r).then(function(n){return n.transform})},s.transformSync=function(t,r){return this._runSync(t,r).transform},s.process=function(t,r){return this._run(t,r).then(function(n){return n.string||n.root.toString()})},s.processSync=function(t,r){var n=this._runSync(t,r);return n.string||n.root.toString()},o}();c.default=v,h.exports=c.default})(l.processor,l.processor.exports);
//# sourceMappingURL=processor.js.map
