<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2962],{56206:function(e,t,r){r.d(t,{M4:function(){return o}});var i=r(89886);let n=()=&gt;{};class s extends i.PureComponent{constructor(...e){super(...e),this.t=!1,this.i=null,this.o=n}componentWillUnmount(){this.o()}u(e){e!==this.i&amp;&amp;(this.o(),this.i=null,e&amp;&amp;(this.i=e,this.o=e.on("updated",()=&gt;this.forceUpdate())))}get allowed(){return this.t}h(){let e=this.props,t=e.of||e.a||e.an||e.this||e.on,r=e.not?"cannot":"can";return e.ability[r](e.I||e.do,t,e.field)}render(){return this.u(this.props.ability),this.t=this.h(),this.props.passThrough||this.t?this.l():null}l(){let{children:e,ability:t}=this.props;return"function"==typeof e?e(this.t,t):e}}function o(e){return t=&gt;(0,i.createElement)(e,{children:e=&gt;(0,i.createElement)(s,Object.assign({ability:e},t))})}},68201:function(e,t,r){r.d(t,{z4:function(){return eI},F$:function(){return eq},fo:function(){return ef}});class i{constructor(e,t){this.operator=e,this.value=t,Object.defineProperty(this,"t",{writable:!0})}get notes(){return this.t}addNote(e){this.t=this.t||[],this.t.push(e)}}class n extends i{}class s extends n{constructor(e,t){if(!Array.isArray(t))throw Error(`"${e}" operator expects to receive an array of conditions`);super(e,t)}}let o="__itself__";class a extends i{constructor(e,t,r){super(e,r),this.field=t}}let l=new n("__null__",null),u=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);function c(e,t){return 1===t.length?t[0]:new s(e,function e(t,r,i){let n=i||[];for(let i=0,o=r.length;i&lt;o;i++){let o=r[i];o instanceof s&amp;&amp;o.operator===t?e(t,o.value,n):n.push(o)}return n}(e,t))}let h=e=&gt;e,p=()=&gt;Object.create(null),f=Object.defineProperty(p(),"__@type@__",{value:"ignore value"});function d(e){let t=[];for(let r in e)u(e,r)&amp;&amp;e[r]!==f&amp;&amp;t.push(r);return t}function y(e,t){t!==l&amp;&amp;e.push(t)}let g=e=&gt;c("and",e),m={compound(e,t,r){let i=(Array.isArray(t)?t:[t]).map(e=&gt;r.parse(e));return new s(e.name,i)},field:(e,t,r)=&gt;new a(e.name,r.field,t),document:(e,t)=&gt;new n(e.name,t)};class v{constructor(e,t=p()){this.o=void 0,this.s=void 0,this.i=void 0,this.u=void 0,this.h=void 0,this.parse=this.parse.bind(this),this.u={operatorToConditionName:t.operatorToConditionName||h,defaultOperatorName:t.defaultOperatorName||"eq",mergeFinalConditions:t.mergeFinalConditions||g},this.o=Object.keys(e).reduce((t,r)=&gt;(t[r]=Object.assign({name:this.u.operatorToConditionName(r)},e[r]),t),{}),this.s=Object.assign({},t.fieldContext,{field:"",query:{},parse:this.parse,hasOperators:e=&gt;(function(e,t,r=!1){if(!e||e&amp;&amp;e.constructor!==Object)return!1;for(let i in e)if(u(e,i)&amp;&amp;u(t,i)&amp;&amp;(!r||e[i]!==f))return!0;return!1})(e,this.o,t.useIgnoreValue)}),this.i=Object.assign({},t.documentContext,{parse:this.parse,query:{}}),this.h=t.useIgnoreValue?d:Object.keys}setParse(e){this.parse=e,this.s.parse=e,this.i.parse=e}parseField(e,t,r,i){let n=this.o[t];if(!n)throw Error(`Unsupported operator "${t}"`);if("field"!==n.type)throw Error(`Unexpected ${n.type} operator "${t}" at field level`);return this.s.field=e,this.s.query=i,this.parseInstruction(n,r,this.s)}parseInstruction(e,t,r){return"function"==typeof e.validate&amp;&amp;e.validate(e,t),(e.parse||m[e.type])(e,t,r)}parseFieldOperators(e,t){let r=[],i=this.h(t);for(let n=0,s=i.length;n&lt;s;n++){let s=i[n];if(!this.o[s])throw Error(`Field query for "${e}" may contain only operators or a plain object as a value`);y(r,this.parseField(e,s,t[s],t))}return r}parse(e){let t=[],r=this.h(e);this.i.query=e;for(let i=0,n=r.length;i&lt;n;i++){let n=r[i],s=e[n],o=this.o[n];if(o){if("document"!==o.type&amp;&amp;"compound"!==o.type)throw Error(`Cannot use parsing instruction for operator "${n}" in "document" context as it is supposed to be used in  "${o.type}" context`);y(t,this.parseInstruction(o,s,this.i))}else this.s.hasOperators(s)?t.push(...this.parseFieldOperators(n,s)):y(t,this.parseField(n,this.u.defaultOperatorName,s,e))}return this.u.mergeFinalConditions(t)}}function b(e,t){let r=e[t];if("function"!=typeof r)throw Error(`Unable to interpret "${t}" condition. Did you forget to register interpreter for it?`);return r}function $(e){return e.operator}function w(e,t){if(!Array.isArray(t))throw Error(`"${e.name}" expects value to be an array`)}function x(e,t){if(w(e,t),!t.length)throw Error(`"${e.name}" expects to have at least one element in array`)}v.prototype.parseInstruction;let j=e=&gt;(t,r)=&gt;{if(typeof r!==e)throw Error(`"${t.name}" expects value to be a "${e}"`)},O={type:"compound",validate:x,parse(e,t,{parse:r}){let i=t.map(e=&gt;r(e));return c(e.name,i)}},A={type:"field",validate(e,t){if(!t||t.constructor!==Object)throw Error(`"${e.name}" expects to receive an object with nested query or field level operators`)},parse(e,t,{parse:r,field:i,hasOperators:n}){let s=n(t)?r(t,{field:o}):r(t);return new a(e.name,i,s)}},E={type:"field",validate:j("number")},_={type:"field",validate:w},F={type:"field",validate:j("boolean")},M={type:"field",validate:function(e,t){if(!("string"==typeof t||"number"==typeof t||t instanceof Date))throw Error(`"${e.name}" expects value to be comparable (i.e., string, number or date)`)}},C={type:"field"},N={type:"field",validate(e,t){if(!(t instanceof RegExp)&amp;&amp;"string"!=typeof t)throw Error(`"${e.name}" expects value to be a regular expression or a string that represents regular expression`)},parse(e,t,r){let i="string"==typeof t?new RegExp(t,r.query.$options||""):t;return new a(e.name,r.field,i)}},T={type:"field",parse:()=&gt;l},R={type:"document",validate:j("function")};var P=Object.freeze({__proto__:null,$and:O,$or:O,$nor:{type:"compound",validate:x},$not:{type:"field",validate(e,t){if(!(t&amp;&amp;(t instanceof RegExp||t.constructor===Object)))throw Error(`"${e.name}" expects to receive either regular expression or object of field operators`)},parse(e,t,r){let i=t instanceof RegExp?new a("regex",r.field,t):r.parse(t,r);return new s(e.name,[i])}},$elemMatch:A,$size:E,$in:_,$nin:_,$all:_,$mod:{type:"field",validate(e,t){if(!Array.isArray(t)||2!==t.length)throw Error(`"${e.name}" expects an array with 2 numeric elements`)}},$exists:F,$gte:M,$gt:M,$lt:M,$lte:M,$eq:C,$ne:C,$regex:N,$options:T,$where:R});class S extends v{constructor(e){super(e,{defaultOperatorName:"$eq",operatorToConditionName:e=&gt;e.slice(1)})}parse(e,t){return t&amp;&amp;t.field?g(this.parseFieldOperators(t.field,e)):super.parse(e)}}function q(e,t,r){for(let i=0,n=e.length;i&lt;n;i++)if(0===r(e[i],t))return!0;return!1}function k(e,t){return Array.isArray(e)&amp;&amp;Number.isNaN(Number(t))}function I(e,t,r){if(!k(e,t))return r(e,t);let i=[];for(let n=0;n&lt;e.length;n++){let s=r(e[n],t);void 0!==s&amp;&amp;(i=i.concat(s))}return i}function z(e){return(t,r,i)=&gt;{let n=i.get(r,t.field);return Array.isArray(n)?n.some(r=&gt;e(t,r,i)):e(t,n,i)}}let U=(e,t)=&gt;e[t];function D(e,t,r){let i=t.lastIndexOf(".");return -1===i?[e,t]:[r(e,t.slice(0,i)),t.slice(i+1)]}function J(e,t,r=U){if(t===o)return e;if(!e)throw Error(`Unable to get field "${t}" out of ${String(e)}.`);return function(e,t,r){if(-1===t.indexOf("."))return I(e,t,r);let i=t.split("."),n=e;for(let e=0,t=i.length;e&lt;t&amp;&amp;(n=I(n,i[e],r))&amp;&amp;"object"==typeof n;e++);return n}(e,t,r)}function V(e,t){return e===t?0:e&gt;t?1:-1}function Y(e,t={}){return function(e,t){let r;let i=t&amp;&amp;t.getInterpreterName||$;switch(t?t.numberOfArguments:0){case 1:r=r=&gt;b(e,i(r,t))(r,n);break;case 3:r=(r,s,o)=&gt;b(e,i(r,t))(r,s,o,n);break;default:r=(r,s)=&gt;b(e,i(r,t))(r,s,n)}let n=Object.assign({},t,{interpret:r});return n.interpret}(e,Object.assign({get:J,compare:V},t))}let L=(e,t,{interpret:r})=&gt;e.value.some(e=&gt;r(e,t)),W=(e,t,{interpret:r})=&gt;e.value.every(e=&gt;r(e,t)),B=(e,t,{compare:r,get:i})=&gt;{let n=i(t,e.field);return Array.isArray(n)&amp;&amp;!Array.isArray(e.value)?q(n,e.value,r):0===r(n,e.value)},G=(e,t,r)=&gt;!B(e,t,r),H=z((e,t,r)=&gt;{let i=r.compare(t,e.value);return 0===i||-1===i}),K=z((e,t,r)=&gt;-1===r.compare(t,e.value)),Q=z((e,t,r)=&gt;1===r.compare(t,e.value)),X=z((e,t,r)=&gt;{let i=r.compare(t,e.value);return 0===i||1===i}),Z=(e,t,{get:r})=&gt;{if(e.field===o)return void 0!==t;let[i,n]=D(t,e.field,r),s=t=&gt;null==t?!!t===e.value:t.hasOwnProperty(n)===e.value;return k(i,n)?i.some(s):s(i)},ee=z((e,t)=&gt;"number"==typeof t&amp;&amp;t%e.value[0]===e.value[1]),et=(e,t,{get:r})=&gt;{let[i,n]=D(t,e.field,r),s=t=&gt;{let i=r(t,n);return Array.isArray(i)&amp;&amp;i.length===e.value};return e.field!==o&amp;&amp;k(i,n)?i.some(s):s(i)},er=z((e,t)=&gt;"string"==typeof t&amp;&amp;e.value.test(t)),ei=z((e,t,{compare:r})=&gt;q(e.value,t,r)),en=(e,t,r)=&gt;!ei(e,t,r),es=(e,t,{compare:r,get:i})=&gt;{let n=i(t,e.field);return Array.isArray(n)&amp;&amp;e.value.every(e=&gt;q(n,e,r))},eo=(e,t,{interpret:r,get:i})=&gt;{let n=i(t,e.field);return Array.isArray(n)&amp;&amp;n.some(t=&gt;r(e.value,t))},ea=Object.assign({},Object.freeze({__proto__:null,or:L,nor:(e,t,r)=&gt;!L(e,t,r),and:W,not:(e,t,{interpret:r})=&gt;!r(e.value[0],t),eq:B,ne:G,lte:H,lt:K,gt:Q,gte:X,exists:Z,mod:ee,size:et,regex:er,within:ei,nin:en,all:es,elemMatch:eo,where:(e,t)=&gt;e.value.call(t)}),{in:ei});function el(e){return e instanceof Date?e.getTime():e&amp;&amp;"function"==typeof e.toJSON?e.toJSON():e}Y(ea);let eu=(e,t)=&gt;V(el(e),el(t));function ec(e,t,r){var i;let n=new S(e),s=Y(t,Object.assign({compare:eu},r));if(r&amp;&amp;r.forPrimitives){let e={field:o},t=n.parse;n.setParse(r=&gt;t(r,e))}return i=n.parse,(e,...t)=&gt;{let r=i(e,...t),n=s.bind(null,r);return n.ast=r,n}}function eh(e){return Array.isArray(e)?e:[e]}ec(P,ea),ec(["$and","$or"].reduce((e,t)=&gt;(e[t]=Object.assign({},e[t],{type:"field"}),e),Object.assign({},P,{$nor:Object.assign({},P.$nor,{type:"field",parse:m.compound})})),ea,{forPrimitives:!0});let ep="__caslSubjectType__";function ef(e,t){if(t){if(Object.hasOwn(t,ep)){if(e!==t[ep])throw Error(`Trying to cast object to subject type ${e} but previously it was casted to ${t[ep]}`)}else Object.defineProperty(t,ep,{value:e})}return t}let ed=e=&gt;{let t=typeof e;return"string"===t||"function"===t},ey=e=&gt;e.modelName||e.name;function eg(e){return Object.hasOwn(e,ep)?e[ep]:ey(e.constructor)}let em={function:e=&gt;e.constructor,string:eg};function ev(e,t,r){for(let i=r;i&lt;t.length;i++)e.push(t[i])}function eb(e,t){if(!e||!e.length)return t||[];if(!t||!t.length)return e||[];let r=0,i=0,n=[];for(;r&lt;e.length&amp;&amp;i&lt;t.length;)e[r].priority&lt;t[i].priority?(n.push(e[r]),r++):(n.push(t[i]),i++);return ev(n,e,r),ev(n,t,i),n}function e$(e,t,r){let i=e.get(t);return i||(i=r(),e.set(t,i)),i}let ew=e=&gt;e;class ex{constructor(e,t,r=0){!function(e,t){if(Array.isArray(e.fields)&amp;&amp;!e.fields.length)throw Error("`rawRule.fields` cannot be an empty array. https://bit.ly/390miLa");if(e.fields&amp;&amp;!t.fieldMatcher)throw Error('You need to pass "fieldMatcher" option in order to restrict access by fields');if(e.conditions&amp;&amp;!t.conditionsMatcher)throw Error('You need to pass "conditionsMatcher" option in order to restrict access by conditions')}(e,t),this.action=t.resolveAction(e.action),this.subject=e.subject,this.inverted=!!e.inverted,this.conditions=e.conditions,this.reason=e.reason,this.origin=e,this.fields=e.fields?eh(e.fields):void 0,this.priority=r,this.t=t}i(){return this.conditions&amp;&amp;!this.o&amp;&amp;(this.o=this.t.conditionsMatcher(this.conditions)),this.o}get ast(){let e=this.i();return e?e.ast:void 0}matchesConditions(e){return!this.conditions||(!e||ed(e)?!this.inverted:this.i()(e))}matchesField(e){return!this.fields||(e?(this.fields&amp;&amp;!this.u&amp;&amp;(this.u=this.t.fieldMatcher(this.fields)),this.u(e)):!this.inverted)}}let ej=e=&gt;({value:e.value,prev:e.prev,next:e.next}),eO=()=&gt;({rules:[],merged:!1}),eA=()=&gt;new Map;class eE{constructor(e=[],t={}){this.h=!1,this.l=new Map,this.p={conditionsMatcher:t.conditionsMatcher,fieldMatcher:t.fieldMatcher,resolveAction:t.resolveAction||ew},this.$=t.anyAction||"manage",this.A=t.anySubjectType||"all",this.m=e,this.M=!!t.detectSubjectType,this.j=t.detectSubjectType||eg,this.v(e)}get rules(){return this.m}detectSubjectType(e){return ed(e)?e:e?this.j(e):this.A}update(e){let t={rules:e,ability:this,target:this};return this._("update",t),this.m=e,this.v(e),this._("updated",t),this}v(e){let t;let r=new Map;for(let i=e.length-1;i&gt;=0;i--){let n=e.length-i-1,s=new ex(e[i],this.p,n),o=eh(s.action),a=eh(s.subject||this.A);!this.h&amp;&amp;s.fields&amp;&amp;(this.h=!0);for(let e=0;e&lt;a.length;e++){let i=e$(r,a[e],eA);void 0===t&amp;&amp;(t=typeof a[e]),typeof a[e]!==t&amp;&amp;"mixed"!==t&amp;&amp;(t="mixed");for(let e=0;e&lt;o.length;e++)e$(i,o[e],eO).rules.push(s)}}if(this.l=r,"mixed"!==t&amp;&amp;!this.M){let e=em[t]||em.string;this.j=e}}possibleRulesFor(e,t=this.A){if(!ed(t))throw Error('"possibleRulesFor" accepts only subject types (i.e., string or class) as the 2nd parameter');let r=e$(this.l,t,eA),i=e$(r,e,eO);if(i.merged)return i.rules;let n=e!==this.$&amp;&amp;r.has(this.$)?r.get(this.$).rules:void 0,s=eb(i.rules,n);return t!==this.A&amp;&amp;(s=eb(s,this.possibleRulesFor(e,this.A))),i.rules=s,i.merged=!0,s}rulesFor(e,t,r){let i=this.possibleRulesFor(e,t);if(r&amp;&amp;"string"!=typeof r)throw Error("The 3rd, `field` parameter is expected to be a string. See https://stalniy.github.io/casl/en/api/casl-ability#can-of-pure-ability for details");return this.h?i.filter(e=&gt;e.matchesField(r)):i}actionsFor(e){if(!ed(e))throw Error('"actionsFor" accepts only subject types (i.e., string or class) as a parameter');let t=new Set,r=this.l.get(e);r&amp;&amp;Array.from(r.keys()).forEach(e=&gt;t.add(e));let i=e!==this.A?this.l.get(this.A):void 0;return i&amp;&amp;Array.from(i.keys()).forEach(e=&gt;t.add(e)),Array.from(t)}on(e,t){this.F=this.F||new Map;let r=this.F,i=function(e,t){let r={value:e,prev:t,next:null};return t&amp;&amp;(t.next=r),r}(t,r.get(e)||null);return r.set(e,i),()=&gt;{let t=r.get(e);i.next||i.prev||t!==i?i===t&amp;&amp;r.set(e,i.prev):r.delete(e),i.next&amp;&amp;(i.next.prev=i.prev),i.prev&amp;&amp;(i.prev.next=i.next),i.next=i.prev=null}}_(e,t){if(!this.F)return;let r=this.F.get(e)||null;for(;null!==r;){let e=r.prev?ej(r.prev):null;r.value(t),r=e}}}class e_ extends eE{can(e,t,r){let i=this.relevantRuleFor(e,t,r);return!!i&amp;&amp;!i.inverted}relevantRuleFor(e,t,r){let i=this.detectSubjectType(t),n=this.rulesFor(e,i,r);for(let e=0,r=n.length;e&lt;r;e++)if(n[e].matchesConditions(t))return n[e];return null}cannot(e,t,r){return!this.can(e,t,r)}}let eF=ec({$eq:C,$ne:C,$lt:M,$lte:M,$gt:M,$gte:M,$in:_,$nin:_,$all:_,$size:E,$regex:N,$options:T,$elemMatch:A,$exists:F},{eq:B,ne:G,lt:K,lte:H,gt:Q,gte:X,in:ei,nin:en,all:es,size:et,regex:er,elemMatch:eo,exists:Z,and:W}),eM=/[-/\\^$+?.()|[\]{}]/g,eC=/\.?\*+\.?/g,eN=/\*+/,eT=/\./g;function eR(e,t,r){let i="*"===r[0]||"."===e[0]&amp;&amp;"."===e[e.length-1]?"+":"*",n=-1===e.indexOf("**")?"[^.]":".",s=e.replace(eT,"\\$&amp;").replace(eN,n+i);return t+e.length===r.length?`(?:${s})?`:s}function eP(e,t,r){return"."===e&amp;&amp;("*"===r[t-1]||"*"===r[t+1])?e:`\\${e}`}let eS=e=&gt;{let t;return r=&gt;(void 0===t&amp;&amp;(t=e.every(e=&gt;-1===e.indexOf("*"))?null:function(e){let t=e.map(e=&gt;e.replace(eM,eP).replace(eC,eR)),r=t.length&gt;1?`(?:${t.join("|")})`:t[0];return RegExp(`^${r}$`)}(e)),null===t?-1!==e.indexOf(r):t.test(r))};function eq(e=[],t={}){return new e_(e,Object.assign({conditionsMatcher:eF,fieldMatcher:eS},t))}class ek{constructor(e){this.O=e}because(e){return this.O.reason=e,this}}class eI{constructor(e){this.rules=[],this.C=e,this.can=(e,t,r,i)=&gt;this.R(e,t,r,i,!1),this.cannot=(e,t,r,i)=&gt;this.R(e,t,r,i,!0),this.build=e=&gt;"function"==typeof this.C.prototype.possibleRulesFor?new this.C(this.rules,e):this.C(this.rules,e)}R(e,t,r,i,n){let s={action:e};return n&amp;&amp;(s.inverted=n),t&amp;&amp;(s.subject=t,Array.isArray(r)||"string"==typeof r?s.fields=r:void 0!==r&amp;&amp;(s.conditions=r),void 0!==i&amp;&amp;(s.conditions=i)),this.rules.push(s),new ek(s)}}let ez=function(e){this.message=e};ez.prototype=Object.create(Error.prototype);class eU extends ez{static setDefaultMessage(e){this.P="string"==typeof e?()=&gt;e:e}static from(e){return new this(e)}constructor(e){super(""),this.ability=e,"function"==typeof Error.captureStackTrace&amp;&amp;(this.name="ForbiddenError",Error.captureStackTrace(this,this.constructor))}setMessage(e){return this.message=e,this}throwUnlessCan(e,t,r){let i=this.unlessCan(e,t,r);if(i)throw i}unlessCan(e,t,r){var i;let n=this.ability.relevantRuleFor(e,t,r);if(n&amp;&amp;!n.inverted)return;this.action=e,this.subject=t,this.subjectType="string"==typeof(i=this.ability.detectSubjectType(t))?i:ey(i),this.field=r;let s=n?n.reason:"";return this.message=this.message||s||this.constructor.P(this),this}}eU.P=e=&gt;`Cannot execute "${e.action}" on "${e.subjectType}"`,Object.freeze({__proto__:null})}}]);
//# sourceMappingURL=2962-f439bc6153cc27ca.js.map</pre></body></html>