function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t){return(e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function n(t,e,a){return(n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var a=[null];a.push.apply(a,e);var o=new(Function.bind.apply(t,a));return n&&r(o,n.prototype),o}).apply(null,arguments)}function a(t){var o="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||(a=t,-1===Function.toString.call(a).indexOf("[native code]")))return t;var a;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(t))return o.get(t);o.set(t,i)}function i(){return n(t,arguments,e(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,t)})(t)}function o(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var i=eval,l="undefined"!=typeof module&&Boolean(module.exports)&&!("undefined"!=typeof navigator&&"ReactNative"===navigator.product),c=["value","path","pointer","parent","parentProperty","all"],u=Object.prototype.hasOwnProperty,p=l?require("vm"):{runInNewContext:function(t,e){var r=Object.keys(e),n=[];!function(t,e,r){for(var n=t.length,a=0;a1&&h.shift(),this._hasParentSelector=null;var f=this._trace(h,r,["$"],i,l,n).filter(function(t){return t&&!t.isParentSelector});return f.length?1!==f.length||s||Array.isArray(f[0].value)?f.reduce(function(t,e){var r=o._getPreferredOutput(e);return p&&Array.isArray(r)?t=t.concat(r):t.push(r),t},[]):this._getPreferredOutput(f[0]):s?[]:void 0}},y.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){default:throw new TypeError("Unknown result type");case"all":return t.pointer=y.toPointer(t.path),t.path="string"==typeof t.path?t.path:y.toPathString(t.path),t;case"value":case"parent":case"parentProperty":return t[e];case"path":return y.toPathString(t[e]);case"pointer":return y.toPointer(t.path)}},y.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path="string"==typeof t.path?t.path:y.toPathString(t.path),e(n,r,t)}},y.prototype._trace=function(e,r,n,a,o,i,l){var c,p=this;if(!e.length)return c={path:n,value:r,parent:a,parentProperty:o},this._handleCallback(c,i,"value"),c;var f=e[0],y=e.slice(1),v=[];function b(t){Array.isArray(t)?t.forEach(function(t){v.push(t)}):v.push(t)}if(("string"!=typeof f||l)&&r&&u.call(r,f))b(this._trace(y,r[f],s(n,f),r,f,i));else if("*"===f)this._walk(f,y,r,n,a,o,i,function(t,e,r,n,a,o,i,l){b(p._trace(h(t,r),n,a,o,i,l,!0))});else if(".."===f)b(this._trace(y,r,n,a,o,i)),this._walk(f,y,r,n,a,o,i,function(e,r,n,a,o,i,l,c){"object"===t(a[e])&&b(p._trace(h(r,n),a[e],s(o,e),a,e,c))});else{if("^"===f)return this._hasParentSelector=!0,n.length?{path:n.slice(0,-1),expr:y,isParentSelector:!0}:[];if("~"===f)return c={path:s(n,f),value:o,parent:a,parentProperty:null},this._handleCallback(c,i,"property"),c;if("$"===f)b(this._trace(y,r,n,null,null,i));else if(/^(-?\d*):(-?\d*):?(\d*)$/.test(f))b(this._slice(f,y,r,n,a,o,i));else if(0===f.indexOf("?(")){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(f,y,r,n,a,o,i,function(t,e,r,n,a,o,i,l){p._eval(e.replace(/^\?\((.*?)\)$/,"$1"),n[t],t,a,o,i)&&b(p._trace(h(t,r),n,a,o,i,l))})}else if("("===f[0]){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");b(this._trace(h(this._eval(f,r,n[n.length-1],n.slice(0,-1),a,o),y),r,n,a,o,i))}else if("@"===f[0]){var d=!1,g=f.slice(1,-2);switch(g){default:throw new TypeError("Unknown value type "+g);case"scalar":r&&["object","function"].includes(t(r))||(d=!0);break;case"boolean":case"string":case"undefined":case"function":t(r)===g&&(d=!0);break;case"number":t(r)===g&&isFinite(r)&&(d=!0);break;case"nonFinite":"number"!=typeof r||isFinite(r)||(d=!0);break;case"object":r&&t(r)===g&&(d=!0);break;case"array":Array.isArray(r)&&(d=!0);break;case"other":d=this.currOtherTypeCallback(r,n,a,o);break;case"integer":r!==Number(r)||!isFinite(r)||r%1||(d=!0);break;case"null":null===r&&(d=!0)}if(d)return c={path:n,value:r,parent:a,parentProperty:o},this._handleCallback(c,i,"value"),c}else if("`"===f[0]&&r&&u.call(r,f.slice(1))){var _=f.slice(1);b(this._trace(y,r[_],s(n,_),r,_,i,!0))}else if(f.includes(",")){var w=f.split(","),P=!0,S=!1,k=void 0;try{for(var x,m=w[Symbol.iterator]();!(P=(x=m.next()).done);P=!0){var j=x.value;b(this._trace(h(j,y),r,n,a,o,i))}}catch(t){S=!0,k=t}finally{try{P||null==m.return||m.return()}finally{if(S)throw k}}}else!l&&r&&u.call(r,f)&&b(this._trace(y,r[f],s(n,f),r,f,i,!0))}if(this._hasParentSelector)for(var O=0;O