import{a as r,c as n}from"./p-80de33dc.js";var t=r((function(r){r.exports=function(){Array.isArray||(Array.isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)});var r={},n={"==":function(r,n){return r==n},"===":function(r,n){return r===n},"!=":function(r,n){return r!=n},"!==":function(r,n){return r!==n},">":function(r,n){return r>n},">=":function(r,n){return r>=n},"<":function(r,n,t){return void 0===t?r<n:r<n&&n<t},"<=":function(r,n,t){return void 0===t?r<=n:r<=n&&n<=t},"!!":function(n){return r.truthy(n)},"!":function(n){return!r.truthy(n)},"%":function(r,n){return r%n},log:function(r){return console.log(r),r},in:function(r,n){return!(!n||void 0===n.indexOf)&&-1!==n.indexOf(r)},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(r,n,t){if(t<0){var u=String(r).substr(n);return u.substr(0,u.length+t)}return String(r).substr(n,t)},"+":function(){return Array.prototype.reduce.call(arguments,(function(r,n){return parseFloat(r,10)+parseFloat(n,10)}),0)},"*":function(){return Array.prototype.reduce.call(arguments,(function(r,n){return parseFloat(r,10)*parseFloat(n,10)}))},"-":function(r,n){return void 0===n?-r:r-n},"/":function(r,n){return r/n},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,(function(r,n){return r.concat(n)}),[])},var:function(r,n){var t=void 0===n?null:n,u=this;if(void 0===r||""===r||null===r)return u;for(var i=String(r).split("."),e=0;e<i.length;e++){if(null==u)return t;if(void 0===(u=u[i[e]]))return t}return u},missing:function(){for(var n=[],t=Array.isArray(arguments[0])?arguments[0]:arguments,u=0;u<t.length;u++){var i=t[u],e=r.apply({var:i},this);null!==e&&""!==e||n.push(i)}return n},missing_some:function(n,t){var u=r.apply({missing:t},this);return t.length-u.length>=n?[]:u}};return r.is_logic=function(r){return"object"==typeof r&&null!==r&&!Array.isArray(r)&&1===Object.keys(r).length},r.truthy=function(r){return!(Array.isArray(r)&&0===r.length||!r)},r.get_operator=function(r){return Object.keys(r)[0]},r.get_values=function(n){return n[r.get_operator(n)]},r.apply=function(t,u){if(Array.isArray(t))return t.map((function(n){return r.apply(n,u)}));if(!r.is_logic(t))return t;var i,e,f,o,a,c=r.get_operator(t),l=t[c];if(Array.isArray(l)||(l=[l]),"if"===c||"?:"==c){for(i=0;i<l.length-1;i+=2)if(r.truthy(r.apply(l[i],u)))return r.apply(l[i+1],u);return l.length===i+1?r.apply(l[i],u):null}if("and"===c){for(i=0;i<l.length;i+=1)if(e=r.apply(l[i],u),!r.truthy(e))return e;return e}if("or"===c){for(i=0;i<l.length;i+=1)if(e=r.apply(l[i],u),r.truthy(e))return e;return e}if("filter"===c)return o=r.apply(l[0],u),f=l[1],Array.isArray(o)?o.filter((function(n){return r.truthy(r.apply(f,n))})):[];if("map"===c)return o=r.apply(l[0],u),f=l[1],Array.isArray(o)?o.map((function(n){return r.apply(f,n)})):[];if("reduce"===c)return o=r.apply(l[0],u),f=l[1],a=void 0!==l[2]?l[2]:null,Array.isArray(o)?o.reduce((function(n,t){return r.apply(f,{current:t,accumulator:n})}),a):a;if("all"===c){if(o=r.apply(l[0],u),f=l[1],!Array.isArray(o)||!o.length)return!1;for(i=0;i<o.length;i+=1)if(!r.truthy(r.apply(f,o[i])))return!1;return!0}if("none"===c){if(o=r.apply(l[0],u),f=l[1],!Array.isArray(o)||!o.length)return!0;for(i=0;i<o.length;i+=1)if(r.truthy(r.apply(f,o[i])))return!1;return!0}if("some"===c){if(o=r.apply(l[0],u),f=l[1],!Array.isArray(o)||!o.length)return!1;for(i=0;i<o.length;i+=1)if(r.truthy(r.apply(f,o[i])))return!0;return!1}if(l=l.map((function(n){return r.apply(n,u)})),n.hasOwnProperty(c)&&"function"==typeof n[c])return n[c].apply(u,l);if(c.indexOf(".")>0){var s=String(c).split("."),y=n;for(i=0;i<s.length;i++){if(!y.hasOwnProperty(s[i]))throw new Error("Unrecognized operation "+c+" (failed at "+s.slice(0,i+1).join(".")+")");y=y[s[i]]}return y.apply(u,l)}throw new Error("Unrecognized operation "+c)},r.uses_data=function(n){var t=[];if(r.is_logic(n)){var u=r.get_operator(n),i=n[u];Array.isArray(i)||(i=[i]),"var"===u?t.push(i[0]):i.forEach((function(n){t.push.apply(t,r.uses_data(n))}))}return function(r){for(var n=[],t=0,u=r.length;t<u;t++)-1===n.indexOf(r[t])&&n.push(r[t]);return n}(t)},r.add_operation=function(r,t){n[r]=t},r.rm_operation=function(r){delete n[r]},r.rule_like=function(n,t){if(t===n)return!0;if("@"===t)return!0;if("number"===t)return"number"==typeof n;if("string"===t)return"string"==typeof n;if("array"===t)return Array.isArray(n)&&!r.is_logic(n);if(r.is_logic(t)){if(r.is_logic(n)){var u=r.get_operator(t),i=r.get_operator(n);if("@"===u||u===i)return r.rule_like(r.get_values(n,!1),r.get_values(t,!1))}return!1}if(Array.isArray(t)){if(Array.isArray(n)){if(t.length!==n.length)return!1;for(var e=0;e<t.length;e+=1)if(!r.rule_like(n[e],t[e]))return!1;return!0}return!1}return!1},r}()}));const u=Object.freeze(Object.assign(Object.create(null),t,{default:t}));export{u as j,t as l}