var __extends=this&&this.__extends||function(){var t=function(e,n){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[n]=e[n]};return t(e,n)};return function(e,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}();System.register(["./p-ea3ce2c4.system.js","./p-6e679e9d.system.js"],(function(t){"use strict";var e,n,o,i;return{setters:[function(t){e=t.T;n=t.S;o=t.d},function(t){i=t.R}],execute:function(){t({C:void 0,a:void 0});var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.decode=function(t){var o=Object.assign(Object.create(e.prototype),t);o.space=n.decode(o.space);return o};return e}(e);t("M",r);var c;(function(t){t["comparison"]="comparison";t["conditionalComparison"]="conditionalComparison"})(c||(c=t("a",{})));var s;(function(t){t["number"]="number";t["range"]="range";t["singleChoice"]="single-choice";t["multipleChoice"]="multipleChoice";t["text"]="text"})(s||(s={}));var u;(function(t){t["eq"]="eq";t["ne"]="ne";t["lt"]="lt";t["lte"]="lte";t["gt"]="gt";t["gte"]="gte";t["in"]="in";t["contain"]="contain";t["ncontain"]="ncontain";t["similar"]="similar";t["different"]="different"})(u||(u=t("C",{})));var a=function(){function t(t,e){this.comparisons=t;this.type=e}t.decode=function(e){return Object.assign(Object.create(t.prototype),e)};t.prototype.isValid=function(){if(this.type===c.comparison){return this.comparisons.length===1&&!!this.comparisons[0].firstField&&!!this.comparisons[0].secondField&&!!this.comparisons[0].comparison}return true};return t}();t("R",a);var f=t("g",(function(t,e){return t.fields.find((function(t){return t.type===i.type&&t.id===e})).otherCollection}));var p=t("b",(function(t,e){return t.selection?t.selection[e]:undefined}));var l=t("c",(function(t,e){var n;Object.keys(t.selection||{}).forEach((function(o){var i=v.decode(t.selection[o]);if(i.roleNameToSelect===e&&i.status==="active"){n=t.selection[o]}}));return n}));var d=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.decode=function(t){var i=Object.assign(Object.create(e.prototype),t);i.fields=o(i.fields);i.space=n.decode(i.space);Object.keys(i.selection||{}).forEach((function(t){i.selection[t]=v.decode(i.selection[t])}));if(i.structure){i.structure=r.decode(i.structure)}i.actionPermissions=i.actionPermissions||{};return i};return e}(e);t("P",d);var v=function(){function t(){}t.decode=function(e){var n;var o=Object.assign(Object.create(t.prototype),e);o.rules=(n=o.rules)===null||n===void 0?void 0:n.map((function(t){return a.decode(t)}));return o};t.prototype.isActive=function(){return this.status==="active"};return t}()}}}));