@viamedici-spc/configurator-framer-bundle 0.1.0-alpha0013 → 0.1.0-alpha0015
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1242 -41
- package/dist/index.js +21546 -13571
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react"),X=require("react/jsx-runtime"),F=require("framer"),sg=require("framer-motion");function ug(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Up=ug(M);var cg=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))},lg=function(e){return function(){return{concat:function(t,n){return function(i){return e.concat(t(i),n(i))}}}}},dg=function(e){var t=lg(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function Ei(e){return e}function Js(e){return function(){return e}}var fg=Js(null),Vp=Js(void 0),di=Vp;function Nn(e,t,n,i,r,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return i(n(t(e.apply(this,arguments))))};case 5:return function(){return r(i(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(r(i(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(r(i(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(o(r(i(n(t(e.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(r(i(n(t(e.apply(this,arguments)))))))))}}}function m(e,t,n,i,r,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return i(n(t(e)));case 5:return r(i(n(t(e))));case 6:return o(r(i(n(t(e)))));case 7:return a(o(r(i(n(t(e))))));case 8:return u(a(o(r(i(n(t(e)))))));case 9:return s(u(a(o(r(i(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var oi=function(e,t){var n=typeof e=="number"?function(i){return i.length>=e}:e;return function(){var i=Array.from(arguments);return n(arguments)?t.apply(this,i):function(r){return t.apply(void 0,cg([r],i,!1))}}},pg=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))},hg=function(e){return e._tag==="None"},Pl=function(e){return e._tag==="Some"},Ys={_tag:"None"},Xs=function(e){return{_tag:"Some",value:e}},vg=function(e){return e._tag==="Left"},Qs=function(e){return{_tag:"Left",left:e}},Zs=function(e){return{_tag:"Right",right:e}},yg=function(e){return[e]},mg=function(e){return e.length>0},gg=function(e){return e[0]},bg=function(e){return e.slice(1)},Sg=[],Cg={},wg=Object.prototype.hasOwnProperty,Tg=function(e){return pg([e[0]],e.slice(1),!0)};function Ig(e,t){return function(n){return function(i){return e.ap(e.map(i,function(r){return function(o){return t.ap(r,o)}}),n)}}}function Eg(e){return function(t){return{concat:function(n,i){return e.ap(e.map(n,function(r){return function(o){return t.concat(r,o)}}),i)}}}}function Fp(e,t,n){return function(i){for(var r=Array(n.length+1),o=0;o<n.length;o++)r[o]=n[o];return r[n.length]=i,t===0?e.apply(null,r):Fp(e,t-1,r)}}function xg(e){var t=e.length;switch(t){case 1:return function(n){var i;return i={},i[e[0]]=n,i};case 2:return function(n){return function(i){var r;return r={},r[e[0]]=n,r[e[1]]=i,r}};case 3:return function(n){return function(i){return function(r){var o;return o={},o[e[0]]=n,o[e[1]]=i,o[e[2]]=r,o}}};case 4:return function(n){return function(i){return function(r){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=i,a[e[2]]=r,a[e[3]]=o,a}}}};case 5:return function(n){return function(i){return function(r){return function(o){return function(a){var u;return u={},u[e[0]]=n,u[e[1]]=i,u[e[2]]=r,u[e[3]]=o,u[e[4]]=a,u}}}}};default:return Fp(function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var r={},o=0;o<t;o++)r[e[o]]=n[o];return r},t-1,[])}}function $g(e){return function(t){for(var n=Object.keys(t),i=n.length,r=xg(n),o=e.map(t[n[0]],r),a=1;a<i;a++)o=e.ap(o,t[n[a]]);return o}}function Ag(e,t){return function(n){return function(i){return e.map(i,function(r){return t.map(r,n)})}}}function Dg(e){var t=Eg(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function Lp(e){return function(t,n){return e.chain(t,function(i){return e.map(n(i),function(){return i})})}}var Og=function(e){return function(){return Promise.resolve().then(e)}};function Ng(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var eu=function(e,t){return m(e,Gp(t))},Ml=function(e,t){return m(e,Pg(t))},Gp=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},Pg=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var i=n[0],r=n[1];return i(r)})}}},Ia=function(e){return function(){return Promise.resolve(e)}},Rl=oi(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),Ea="Task",tu={URI:Ea,map:eu},_l={URI:Ea,of:Ia},Mg={URI:Ea,map:eu,ap:Ml},jl={URI:Ea,map:eu,of:Ia,ap:Ml,chain:Rl},Rg=Ei,zd=Rl,Es={URI:Ea,map:eu,of:Ia,ap:Ml,chain:Rl,fromIO:Og,fromTask:Rg};function zp(e){return function(t){return function(n){return e.fromEither(hg(n)?Qs(t()):Zs(n.value))}}}function _g(e,t){return function(n,i){return function(r){return t.chain(r,function(o){return e.fromEither(n(o)?Zs(o):Qs(i(o)))})}}}var ql=Qs,nu=Zs,Wp=function(e,t){return m(e,qg(t))},jg=function(e,t){return m(e,Ug(t))},kl="Either",qg=function(e){return function(t){return Fi(t)?t:nu(e(t.right))}},kg={URI:kl,map:Wp},Bg=function(e){return function(t){return Fi(t)?t:Fi(e)?e:nu(t.right(e.right))}},Ug=Bg,Vg={URI:kl,map:Wp,ap:jg},Fg=function(e){return function(t){return Fi(t)?ql(e(t.left)):t}},Hp={URI:kl,fromEither:Ei},Lg=zp(Hp),Fi=vg,Gg=function(e,t){return function(n){return Fi(n)?e(n.left):t(n.right)}},tr=Gg;Hp.fromEither;var zg=function(e){return Fi(e)?nu(e.left):ql(e.right)},bn=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},Cn=function(e){return bn(function(t,n){for(var i in e)if(!e[i].equals(t[i],n[i]))return!1;return!0})},Bl={equals:function(e,t){return e===t}};Bl.equals;var Wg=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function Hg(e,t){return e<t?-1:e>t?1:0}var Kg={equals:Bl.equals,compare:Hg},Jg=Kg,Yg=function(e){return{concat:Wg(e)}},Xg=Yg;globalThis&&globalThis.__spreadArray;var Qg=Sg,Zg=mg,eb=function(e,t){return e<0||e>=t.length},tb=function(e,t,n){if(n[e]===t)return n;var i=Tg(n);return i[e]=t,i},nb=function(e){return function(t){if(t.length===1)return t;for(var n=[ob(t)],i=ab(t),r=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=i;o<a.length;o++){var u=a[o];r(u)}return n}},ib=yg,rb=gg,ob=rb,ab=bg,iu={equals:function(e,t){return e===t}},sb={equals:iu.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};iu.equals,sb.compare;globalThis&&globalThis.__spreadArray;var xs=function(e){return e.length===0},lo=Zg,ub=function(e){return function(t){if(xs(t))return Qp;for(var n=[],i=0;i<t.length;i++)n.push.apply(n,e(i,t[i]));return n}},cb=eb,lb=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Xs(n);return Ys}};function Bt(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Xs(t[n]);return Ys}}var db=function(e,t){return function(n){return cb(e,n)?Ys:Xs(mb(e,t(n[e]),n))}},fb=function(e,t,n){for(var i=[],r=Math.min(e.length,t.length),o=0;o<r;o++)i[o]=n(e[o],t[o]);return i};function Kp(e,t){return t===void 0?function(n){return Kp(n,e)}:fb(e,t,function(n,i){return[n,i]})}function Jp(e){return function(t,n){if(n===void 0){var i=Jp(e);return function(a){return i(t,a)}}for(var r=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(r(n[o]))return!0;return!1}}var Hr=function(e){var t=nb(e);return function(n){return lo(n)?t(n):n}},pb=function(e){return function(t){return xs(t)?e:xs(e)?t:t.concat(e)}},ve=pb;function Yp(e){var t=Jp(e);return function(n,i){if(i===void 0){var r=Yp(e);return function(o){return r(o,n)}}return n.filter(function(o){return!t(o,i)})}}var hb=ib,Xp=oi(2,function(e,t){return m(e,ub(function(n,i){return t(i,n)}))}),Ul=Xp(Ei),_=function(e){return function(t){return t.map(function(n){return e(n)})}},It=function(e){return function(t){return t.filter(e)}},vb=function(e){return function(t){for(var n=[],i=0;i<t.length;i++){var r=e(i,t[i]);Pl(r)&&n.push(r.value)}return n}},Er=function(e){return vb(function(t,n){return e(n)})},mn=Er(Ei),Sc=function(e,t){return yb(e,function(n,i,r){return t(i,r)})},yb=function(e,t){return function(n){for(var i=n.length,r=e,o=0;o<i;o++)r=t(o,r,n[o]);return r}},fo=function(e){return bn(function(t,n){return t.length===n.length&&t.every(function(i,r){return e.equals(i,n[r])})})},mb=function(e,t,n){return lo(n)?tb(e,t,n):n},Cc=function(e){return e.slice()},Wd=function(e){return xs(e)?Qp:e.slice()},Qp=Qg;function gb(e){return function(t){return t.every(e)}}var bb=Xp,Sb=function(e){return function(t){for(var n=[],i=0;i<t.length;i++)n.push.apply(n,e(i,t[i]));return n}};function Zi(e){return Bt(e)}var ss=function(e){return function(t){return t.map(function(n){return e(n)})}},Cb=oi(2,function(e,t){return m(e,Sb(function(n,i){return t(i,n)}))}),wb=Cb(Ei),Tb=function(e){return function(t){for(var n=[],i=0;i<t.length;i++){var r=e(i,t[i]);Pl(r)&&n.push(r.value)}return n}},Ai=function(e){return Tb(function(t,n){return e(n)})},Ib=function(e){return function(t){return t.filter(e)}},ne=Ys,ge=Xs;function xa(e){return function(t){return e(t)?ge(t):ne}}var Zp=function(e,t){return m(e,U(t))},eh=function(e,t){return m(e,Eb(t))},th="Option",xr=function(e){return{equals:function(t,n){return t===n||(zn(t)?zn(n):zn(n)?!1:e.equals(t.value,n.value))}}},U=function(e){return function(t){return zn(t)?ne:ge(e(t.value))}},Bi=ge,Eb=function(e){return function(t){return zn(t)||zn(e)?ne:ge(t.value(e.value))}},xb={URI:th,map:Zp,ap:eh,of:Bi},Vl=oi(2,function(e,t){return zn(e)?ne:t(e.value)}),$b={URI:th,map:Zp,ap:eh,chain:Vl},Ab=oi(2,function(e,t){return zn(e)?t():e}),Hd=Ab,Db=Vl(Ei),St=function(e){return function(t){return zn(t)?ne:e(t.value)?t:ne}},Vo=Pl,zn=function(e){return e._tag==="None"},Ob=function(e,t){return function(n){return zn(n)?e():t(n.value)}},bi=Ob,nh=bi,Nb=function(e){return function(t){return zn(t)?e():t.value}},Ue=Nb,wc=Db,Pb=oi(2,Lp($b)),ee=function(e){return e==null?ne:ge(e)},$n=bi(fg,Ei),ft=bi(Vp,Ei),Dn=Vl,Mb=Pb,Rb=Dg(xb);function _b(e){return Nn(nu,e.of)}function jb(e){return Nn(ql,e.of)}function qb(e){return Ag(e,kg)}function kb(e){return Ig(e,Vg)}function Bb(e){return function(t,n){return e.chain(t,function(i){return Fi(i)?e.of(i):n(i.right)})}}function Ub(e){return function(t,n){return e.map(t,Fg(n))}}function Vb(e){return function(t,n){return function(i){return e.map(i,tr(t,n))}}}function Fb(e){return function(t){return function(n){return e.chain(n,function(i){return Fi(i)?t(i.left):e.of(i)})}}}function Lb(e){return function(t){return e.map(t,zg)}}var Gb=globalThis&&globalThis.__awaiter||function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(i.next(l))}catch(f){a(f)}}function s(l){try{c(i.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):r(l.value).then(u,s)}c((i=i.apply(e,t||[])).next())})},zb=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(i=1,r&&(o=c[0]&2?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,r=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],r=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},vi=jb(_l),po=_b(_l),Wb=Ia,Hb=function(e){return Gp(Lg(e))},$s=Vb(tu),Kd=function(e,t){return function(){return Gb(void 0,void 0,void 0,function(){var n;return zb(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e().then(Zs)];case 1:return[2,i.sent()];case 2:return n=i.sent(),[2,Qs(t(n))];case 3:return[2]}})})}},ih=Fb(jl),Jd=Lb(tu),rh=function(e,t){return m(e,wt(t))},oh=function(e,t){return m(e,Jb(t))},wt=qb(tu),Kb=oi(2,Ub(tu)),Ln=Kb,Jb=kb(Mg),ah=oi(2,Bb(jl)),Kr=po,Fl="TaskEither",Yb={URI:Fl,map:rh,ap:oh,of:Kr},sh={URI:Fl,map:rh,ap:oh,chain:ah},Ll={URI:Fl,fromEither:Wb},Xb=oi(2,Lp(sh)),Gl=zp(Ll);Ll.fromEither;var Qb=_g(Ll,sh),Zb=Kr(Cg),Vn=ah,eS=Xb;function tS(e){return t=>m(t,wt(n=>(e(n)(),n)))}const ua=tS;function As(e){return t=>m(t,Jd,ua(e),Jd)}function nS(e){return t=>m(t,ua(n=>()=>e(n)()),As(n=>()=>e(n)()))}function iS(e){return t=>m(t,U(n=>(e(n)(),n)))}const rS=iS;function oS(e){return Nn(ge,e.of)}function aS(e){return Js(e.of(ne))}function sS(e){var t=aS(e);return function(n,i){return e.chain(n,bi(function(){return t()},i))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var uS=oS(_l),cS=Ia,lS=oi(2,sS(jl)),dS=lS,fS=dg,Qe={equals:function(e,t){return e===t}};Qe.equals;function uh(e){return function(t,n){if(n===void 0){var i=uh(e);return function(o){return i(o,t)}}for(var r in t)if(!wg.call(n,r)||!e.equals(t[r],n[r]))return!1;return!0}}function ch(e){var t=uh(e);return bn(function(n,i){return t(n)(i)&&t(i)(n)})}function Tc(e){return bn((t,n)=>{const i=t==null,r=n==null;return i&&r||!i&&!r&&e.equals(t,n)})}var zl={equals:function(e,t){return e===t}};zl.equals;const Zt=Symbol.for("@ts-pattern/matcher"),lh=Symbol.for("@ts-pattern/isVariadic"),Ds="@ts-pattern/anonymous-select-key",Ic=e=>!!(e&&typeof e=="object"),us=e=>e&&!!e[Zt],Lt=(e,t,n)=>{if(us(e)){const i=e[Zt](),{matched:r,selections:o}=i.match(t);return r&&o&&Object.keys(o).forEach(a=>n(a,o[a])),r}if(Ic(e)){if(!Ic(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let i=[],r=[],o=[];for(const a of e.keys()){const u=e[a];us(u)&&u[lh]?o.push(u):o.length?r.push(u):i.push(u)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<i.length+r.length)return!1;const a=t.slice(0,i.length),u=r.length===0?[]:t.slice(-r.length),s=t.slice(i.length,r.length===0?1/0:-r.length);return i.every((c,l)=>Lt(c,a[l],n))&&r.every((c,l)=>Lt(c,u[l],n))&&(o.length===0||Lt(o[0],s,n))}return e.length===t.length&&e.every((a,u)=>Lt(a,t[u],n))}return Object.keys(e).every(i=>{const r=e[i];return(i in t||us(o=r)&&o[Zt]().matcherType==="optional")&&Lt(r,t[i],n);var o})}return Object.is(t,e)},vn=e=>{var t,n,i;return Ic(e)?us(e)?(t=(n=(i=e[Zt]()).getSelectionKeys)==null?void 0:n.call(i))!=null?t:[]:Array.isArray(e)?ca(e,vn):ca(Object.values(e),vn):[]},ca=(e,t)=>e.reduce((n,i)=>n.concat(t(i)),[]);function pS(...e){if(e.length===1){const[t]=e;return n=>Lt(t,n,()=>{})}if(e.length===2){const[t,n]=e;return Lt(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function zt(e){return Object.assign(e,{optional:()=>Wl(e),and:t=>et(e,t),or:t=>dh(e,t),select:t=>t===void 0?la(e):la(t,e)})}function Ec(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[lh]:!0})}}))(e),{optional:()=>Ec(Wl(e)),select:t=>Ec(t===void 0?la(e):la(t,e))})}function Wl(e){return zt({[Zt]:()=>({match:t=>{let n={};const i=(r,o)=>{n[r]=o};return t===void 0?(vn(e).forEach(r=>i(r,void 0)),{matched:!0,selections:n}):{matched:Lt(e,t,i),selections:n}},getSelectionKeys:()=>vn(e),matcherType:"optional"})})}const hS=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},vS=(e,t)=>{for(const[n,i]of e.entries())if(!t(i,n))return!1;return!0};function et(...e){return zt({[Zt]:()=>({match:t=>{let n={};const i=(r,o)=>{n[r]=o};return{matched:e.every(r=>Lt(r,t,i)),selections:n}},getSelectionKeys:()=>ca(e,vn),matcherType:"and"})})}function dh(...e){return zt({[Zt]:()=>({match:t=>{let n={};const i=(r,o)=>{n[r]=o};return ca(e,vn).forEach(r=>i(r,void 0)),{matched:e.some(r=>Lt(r,t,i)),selections:n}},getSelectionKeys:()=>ca(e,vn),matcherType:"or"})})}function Me(e){return{[Zt]:()=>({match:t=>({matched:!!e(t)})})}}function la(...e){const t=typeof e[0]=="string"?e[0]:void 0,n=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return zt({[Zt]:()=>({match:i=>{let r={[t??Ds]:i};return{matched:n===void 0||Lt(n,i,(o,a)=>{r[o]=a}),selections:r}},getSelectionKeys:()=>[t??Ds].concat(n===void 0?[]:vn(n))})})}function Yn(e){return typeof e=="number"}function nr(e){return typeof e=="string"}function Oi(e){return typeof e=="bigint"}const fh=zt(Me(function(e){return!0})),yS=fh,ir=e=>Object.assign(zt(e),{startsWith:t=>{return ir(et(e,(n=t,Me(i=>nr(i)&&i.startsWith(n)))));var n},endsWith:t=>{return ir(et(e,(n=t,Me(i=>nr(i)&&i.endsWith(n)))));var n},minLength:t=>ir(et(e,(n=>Me(i=>nr(i)&&i.length>=n))(t))),maxLength:t=>ir(et(e,(n=>Me(i=>nr(i)&&i.length<=n))(t))),includes:t=>{return ir(et(e,(n=t,Me(i=>nr(i)&&i.includes(n)))));var n},regex:t=>{return ir(et(e,(n=t,Me(i=>nr(i)&&!!i.match(n)))));var n}}),mS=ir(Me(nr)),Xn=e=>Object.assign(zt(e),{between:(t,n)=>Xn(et(e,((i,r)=>Me(o=>Yn(o)&&i<=o&&r>=o))(t,n))),lt:t=>Xn(et(e,(n=>Me(i=>Yn(i)&&i<n))(t))),gt:t=>Xn(et(e,(n=>Me(i=>Yn(i)&&i>n))(t))),lte:t=>Xn(et(e,(n=>Me(i=>Yn(i)&&i<=n))(t))),gte:t=>Xn(et(e,(n=>Me(i=>Yn(i)&&i>=n))(t))),int:()=>Xn(et(e,Me(t=>Yn(t)&&Number.isInteger(t)))),finite:()=>Xn(et(e,Me(t=>Yn(t)&&Number.isFinite(t)))),positive:()=>Xn(et(e,Me(t=>Yn(t)&&t>0))),negative:()=>Xn(et(e,Me(t=>Yn(t)&&t<0)))}),gS=Xn(Me(Yn)),Ni=e=>Object.assign(zt(e),{between:(t,n)=>Ni(et(e,((i,r)=>Me(o=>Oi(o)&&i<=o&&r>=o))(t,n))),lt:t=>Ni(et(e,(n=>Me(i=>Oi(i)&&i<n))(t))),gt:t=>Ni(et(e,(n=>Me(i=>Oi(i)&&i>n))(t))),lte:t=>Ni(et(e,(n=>Me(i=>Oi(i)&&i<=n))(t))),gte:t=>Ni(et(e,(n=>Me(i=>Oi(i)&&i>=n))(t))),positive:()=>Ni(et(e,Me(t=>Oi(t)&&t>0))),negative:()=>Ni(et(e,Me(t=>Oi(t)&&t<0)))}),bS=Ni(Me(Oi)),SS=zt(Me(function(e){return typeof e=="boolean"})),CS=zt(Me(function(e){return typeof e=="symbol"})),wS=zt(Me(function(e){return e==null}));var Xe={__proto__:null,matcher:Zt,optional:Wl,array:function(...e){return Ec({[Zt]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const n=e[0];let i={};if(t.length===0)return vn(n).forEach(o=>{i[o]=[]}),{matched:!0,selections:i};const r=(o,a)=>{i[o]=(i[o]||[]).concat([a])};return{matched:t.every(o=>Lt(n,o,r)),selections:i}},getSelectionKeys:()=>e.length===0?[]:vn(e[0])})})},set:function(...e){return zt({[Zt]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};if(e.length===0)return{matched:!0};const i=(o,a)=>{n[o]=(n[o]||[]).concat([a])},r=e[0];return{matched:hS(t,o=>Lt(r,o,i)),selections:n}},getSelectionKeys:()=>e.length===0?[]:vn(e[0])})})},map:function(...e){return zt({[Zt]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};const i=(u,s)=>{n[u]=(n[u]||[]).concat([s])};if(e.length===0)return{matched:!0};var r;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(r=e[0])==null?void 0:r.toString()}`);const[o,a]=e;return{matched:vS(t,(u,s)=>{const c=Lt(o,s,i),l=Lt(a,u,i);return c&&l}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...vn(e[0]),...vn(e[1])]})})},intersection:et,union:dh,not:function(e){return zt({[Zt]:()=>({match:t=>({matched:!Lt(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Me,select:la,any:fh,_:yS,string:mS,number:gS,bigint:bS,boolean:SS,symbol:CS,nullish:wS,instanceOf:function(e){return zt(Me(function(t){return n=>n instanceof t}(e)))},shape:function(e){return zt(Me(pS(e)))}};const xc={matched:!1,value:void 0};function Y(e){return new TS(e,xc)}let TS=class $c{constructor(t,n){this.input=void 0,this.state=void 0,this.input=t,this.state=n}with(...t){if(this.state.matched)return this;const n=t[t.length-1],i=[t[0]];let r;t.length===3&&typeof t[1]=="function"?r=t[1]:t.length>2&&i.push(...t.slice(1,t.length-1));let o=!1,a={};const u=(c,l)=>{o=!0,a[c]=l},s=!i.some(c=>Lt(c,this.input,u))||r&&!r(this.input)?xc:{matched:!0,value:n(o?Ds in a?a[Ds]:a:this.input,this.input)};return new $c(this.input,s)}when(t,n){if(this.state.matched)return this;const i=!!t(this.input);return new $c(this.input,i?{matched:!0,value:n(this.input,this.input)}:xc)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}};var IS=Object.getOwnPropertyNames,ES=Object.getOwnPropertySymbols,xS=Object.prototype.hasOwnProperty;function Yd(e,t){return function(i,r,o){return e(i,r,o)&&t(i,r,o)}}function Fa(e){return function(n,i,r){if(!n||!i||typeof n!="object"||typeof i!="object")return e(n,i,r);var o=r.cache,a=o.get(n),u=o.get(i);if(a&&u)return a===i&&u===n;o.set(n,i),o.set(i,n);var s=e(n,i,r);return o.delete(n),o.delete(i),s}}function Xd(e){return IS(e).concat(ES(e))}var ph=Object.hasOwn||function(e,t){return xS.call(e,t)};function ho(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var hh="_owner",Qd=Object.getOwnPropertyDescriptor,Zd=Object.keys;function $S(e,t,n){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(!n.equals(e[i],t[i],i,i,e,t,n))return!1;return!0}function AS(e,t){return ho(e.getTime(),t.getTime())}function ef(e,t,n){if(e.size!==t.size)return!1;for(var i={},r=e.entries(),o=0,a,u;(a=r.next())&&!a.done;){for(var s=t.entries(),c=!1,l=0;(u=s.next())&&!u.done;){var f=a.value,d=f[0],p=f[1],h=u.value,v=h[0],w=h[1];!c&&!i[l]&&(c=n.equals(d,v,o,l,e,t,n)&&n.equals(p,w,d,v,e,t,n))&&(i[l]=!0),l++}if(!c)return!1;o++}return!0}function DS(e,t,n){var i=Zd(e),r=i.length;if(Zd(t).length!==r)return!1;for(var o;r-- >0;)if(o=i[r],o===hh&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!ph(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function Po(e,t,n){var i=Xd(e),r=i.length;if(Xd(t).length!==r)return!1;for(var o,a,u;r-- >0;)if(o=i[r],o===hh&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!ph(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=Qd(e,o),u=Qd(t,o),(a||u)&&(!a||!u||a.configurable!==u.configurable||a.enumerable!==u.enumerable||a.writable!==u.writable)))return!1;return!0}function OS(e,t){return ho(e.valueOf(),t.valueOf())}function NS(e,t){return e.source===t.source&&e.flags===t.flags}function tf(e,t,n){if(e.size!==t.size)return!1;for(var i={},r=e.values(),o,a;(o=r.next())&&!o.done;){for(var u=t.values(),s=!1,c=0;(a=u.next())&&!a.done;)!s&&!i[c]&&(s=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(i[c]=!0),c++;if(!s)return!1}return!0}function PS(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var MS="[object Arguments]",RS="[object Boolean]",_S="[object Date]",jS="[object Map]",qS="[object Number]",kS="[object Object]",BS="[object RegExp]",US="[object Set]",VS="[object String]",FS=Array.isArray,nf=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,rf=Object.assign,LS=Object.prototype.toString.call.bind(Object.prototype.toString);function GS(e){var t=e.areArraysEqual,n=e.areDatesEqual,i=e.areMapsEqual,r=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,u=e.areSetsEqual,s=e.areTypedArraysEqual;return function(l,f,d){if(l===f)return!0;if(l==null||f==null||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;var p=l.constructor;if(p!==f.constructor)return!1;if(p===Object)return r(l,f,d);if(FS(l))return t(l,f,d);if(nf!=null&&nf(l))return s(l,f,d);if(p===Date)return n(l,f,d);if(p===RegExp)return a(l,f,d);if(p===Map)return i(l,f,d);if(p===Set)return u(l,f,d);var h=LS(l);return h===_S?n(l,f,d):h===BS?a(l,f,d):h===jS?i(l,f,d):h===US?u(l,f,d):h===kS?typeof l.then!="function"&&typeof f.then!="function"&&r(l,f,d):h===MS?r(l,f,d):h===RS||h===qS||h===VS?o(l,f,d):!1}}function zS(e){var t=e.circular,n=e.createCustomConfig,i=e.strict,r={areArraysEqual:i?Po:$S,areDatesEqual:AS,areMapsEqual:i?Yd(ef,Po):ef,areObjectsEqual:i?Po:DS,arePrimitiveWrappersEqual:OS,areRegExpsEqual:NS,areSetsEqual:i?Yd(tf,Po):tf,areTypedArraysEqual:i?Po:PS};if(n&&(r=rf({},r,n(r))),t){var o=Fa(r.areArraysEqual),a=Fa(r.areMapsEqual),u=Fa(r.areObjectsEqual),s=Fa(r.areSetsEqual);r=rf({},r,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:u,areSetsEqual:s})}return r}function WS(e){return function(t,n,i,r,o,a,u){return e(t,n,u)}}function HS(e){var t=e.circular,n=e.comparator,i=e.createState,r=e.equals,o=e.strict;if(i)return function(s,c){var l=i(),f=l.cache,d=f===void 0?t?new WeakMap:void 0:f,p=l.meta;return n(s,c,{cache:d,equals:r,meta:p,strict:o})};if(t)return function(s,c){return n(s,c,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};var a={cache:void 0,equals:r,meta:void 0,strict:o};return function(s,c){return n(s,c,a)}}var KS=Hi();Hi({strict:!0});Hi({circular:!0});Hi({circular:!0,strict:!0});Hi({createInternalComparator:function(){return ho}});Hi({strict:!0,createInternalComparator:function(){return ho}});Hi({circular:!0,createInternalComparator:function(){return ho}});Hi({circular:!0,createInternalComparator:function(){return ho},strict:!0});function Hi(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,i=e.createInternalComparator,r=e.createState,o=e.strict,a=o===void 0?!1:o,u=zS(e),s=GS(u),c=i?i(s):WS(s);return HS({circular:n,comparator:s,createState:r,equals:c,strict:a})}function JS(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var i=0;i<e.length;i++){var r=e[i];if(typeof r!="string")throw new TypeError("Url must be a string. Received "+r);r!==""&&(i>0&&(r=r.replace(/^[\/]+/,"")),i<e.length-1?r=r.replace(/[\/]+$/,""):r=r.replace(/[\/]+$/,"/"),t.push(r))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function YS(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),JS(e)}var ta=m,XS=fS(Rb({concat:Xg(Jg).concat,empty:0}))();function QS(e){return function(t){return t.iterNumber>=e?ne:ge(0)}}function ZS(e,t){return function(n){return ta(n,t,U(function(i){return Math.min(e,i)}))}}function eC(e){return function(t){return ge(e*Math.pow(2,t.iterNumber))}}var tC={iterNumber:0,cumulativeDelay:0,previousDelay:ne};function nC(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+Ue(function(){return 0})(n),previousDelay:n}}function iC(e,t){var n=nC(e,t);return ta(n.previousDelay,nh(function(){return Es.of(n)},function(i){return Ng(i)(Es.of(n))}))}function Nr(e,t,n){var i=function(r){return ta(r,t,zd(function(o){return n(o)?ta(iC(e,r),zd(function(a){return ta(a.previousDelay,nh(function(){return Es.of(o)},function(){return i(a)}))})):Es.of(o)}))};return i(tC)}var da={};Object.defineProperty(da,"__esModule",{value:!0});da.isGuid=vh=da.guid=void 0;var rC=function(e){e===void 0&&(e=2);for(var t=(Date.now()*3).toString(16),n=new Date().getTimezoneOffset(),i=Number("".concat(n<0?"7":"6").concat(Math.abs(n))).toString(16),r=e*9+3+15,o="",a=0;a<e;a++)o+=of()+"-";for(o+=i,o+=t;o.length<r;)o+=of();return o.substring(0,r)},vh=da.guid=rC,of=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},oC=function(e,t){t===void 0&&(t=2);var n=e.split("-"),i=aC(n[n.length-1]);if(n.length-1!==t)return"Invalid guid, invalid number of blocks";var r=n.concat().slice(0,-1).reduce(function(o,a){return o&&a.length===8&&!a.includes(" ")},!0);return r?!i&&n[n.length-1].length!==18?"Invalid guid, last date block has invalid size":!0:"Invalid guid, one or more random blocks are invalid"};da.isGuid=oC;var aC=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function Hl(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function $a(e){return{equals(t,n){const i=m(ee(t),Ue(()=>[])),r=m(ee(n),Ue(()=>[]));return fo(e).equals(i,r)}}}const $r=Cn({localId:Qe,componentPath:$a(Qe),sharedConfigurationModelId:Hl(Qe)}),Kl=Cn({localId:Qe,configurationModelId:Qe}),yh=bn((e,t)=>Y({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>sC.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>uC.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>cC.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>lC.equals(n.x,n.y)).otherwise(()=>!1)),sC=Cn({type:Qe,attributeId:$r,state:Qe,choiceValueId:Qe}),uC=Cn({type:Qe,attributeId:$r,state:Qe}),cC=Cn({type:Qe,attributeId:$r,state:iu}),lC=Cn({type:Qe,attributeId:$r,state:zl});var Jt=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Jt||{}),Yt=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Yt||{}),Xr=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(Xr||{}),Pn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(Pn||{}),Si=(e=>(e.Channel="Channel",e.Package="Package",e))(Si||{}),he=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(he||{}),Ci=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ci||{}),Li=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Li||{}),ii=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(ii||{}),ti=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(ti||{}),Gi=(e=>(e.Always="Always",e.Optional="Optional",e))(Gi||{});const dC=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:Pn,AttributeType:he,ChoiceValueDecisionState:Ci,ComponentDecisionState:Li,ConfigurationModelSourceType:Si,ConstraintType:Xr,DecisionKind:ii,ExplainQuestionSubject:Yt,ExplainQuestionType:Jt,Inclusion:Gi,Selection:ti,eqCausedByDecision:yh,eqGlobalAttributeId:$r,eqGlobalConstraintId:Kl},Symbol.toStringTag,{value:"Module"}));var gt=(e=>(e.Unknown="Unknown",e.CommunicationError="Local.LowLevelCommunicationError",e.ServiceError="ServiceError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationUnauthorized="ConfigurationUnauthorized",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(gt||{}),ru=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(ru||{});const mh={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}},fC=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationConflictReason:ru,FailureResultFactory:mh,FailureType:gt},Symbol.toStringTag,{value:"Module"}));let gh=class{mapToCreateSessionRequest(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToAttributeRelations(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToConfigurationModelSource(t){return Y(t).with({type:Si.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Si.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return m(t,ee,U(Nn(_(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),ft)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:m([...t.decisions],ss(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return m(ee(t),ft)}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath,sharedConfigurationModelId:t.sharedConfigurationModelId}}mapToAllowedInExplain(t){return t==null?null:{rules:this.mapToAllowedRulesInExplain(t.rules)}}mapToAllowedRulesInExplain(t){return Y(t).returnType().with({type:Pn.all},()=>({type:"AllowedRulesAll"})).with({type:Pn.none},()=>({type:"AllowedRulesNone"})).with({type:Pn.specific},n=>({type:"AllowedRulesSpecific",rules:m(n.rules,_(this.mapToGlobalConstraintId),Cc)})).with(Xe.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function pC(e){return t=>Qb(n=>n!=null,e)(t)}function hC(){return po(di())}var dn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(dn||{}),cr=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(cr||{}),Vt=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Vt||{}),lr=(e=>(e.all="all",e.none="none",e.specific="specific",e))(lr||{});const Ht=Cn({localId:Qe,componentPath:$a(Qe),sharedConfigurationModel:Hl(Qe)}),vC=xr(fo(Cn({attributeId:Ht,decisions:$a(Ht)}))),yC=xr(bn((e,t)=>Y({x:e,y:t}).returnType().with({x:{type:"all"},y:{type:"all"}},()=>!0).with({x:{type:"none"},y:{type:"none"}},()=>!0).with({x:{type:"specific"},y:{type:"specific"}},({x:n,y:i})=>fo(Kl).equals(n.rules,i.rules)).otherwise(()=>!1))),mC=xr(Cn({rules:yC})),gC=Cn({configurationModelSource:bn((e,t)=>KS(e,t)),decisionsToRespect:vC,usageRuleParameters:ch(Qe),allowedInExplain:mC});var fa=(e=>(e.Channel="Channel",e.Package="Package",e))(fa||{}),Le=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(Le||{}),ce=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(ce||{}),Et=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Et||{}),lt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(lt||{}),vr=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(vr||{}),yr=(e=>(e.Always="Always",e.Optional="Optional",e))(yr||{});const bC={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:xr(Qe).equals(e.state,t.state)},SC={equals(e,t){return xr(iu).equals(e.value,t.value)}},CC={equals(e,t){return xr(zl).equals(e.value,t.value)}},wC={equals(e,t){return xr(Qe).equals(e.state,t.state)}},TC={equals(e,t){return Ht.equals(e.attributeId,t.attributeId)?Y({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,i)=>CC.equals(i.x,i.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,i)=>SC.equals(i.x,i.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,i)=>wC.equals(i.x,i.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,i)=>bC.equals(i.x,i.y)).otherwise(()=>!1):!1}},IC=fo(TC),EC={equals:(e,t)=>IC.equals(e.decisions,t.decisions)&&xC.equals(e.mode,t.mode)},xC={equals:(e,t)=>Y({x:e,y:t}).with({x:{type:"Default"},y:{type:"Default"}},n=>!0).with({x:{type:"DropExistingDecisions"},y:{type:"DropExistingDecisions"}},n=>!0).otherwise(()=>!1)};var Ac=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(Ac||{}),Qr=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(Qr||{}),se=(e=>(e.ServiceError="ServiceError",e.Unknown="Unknown",e.CommunicationError="CommunicationError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(se||{}),Jl=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Jl||{});const $C={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};function AC(e,t){console.log(`--------------------------------------------------------------------------------
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),$=require("react/jsx-runtime"),q=require("framer"),lb=require("react-dom"),T1=require("framer-motion");function fb(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const J=fb(O),I1=fb(lb);var A1=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},$1=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},O1=function(e){var t=$1(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function si(e){return e}function gl(e){return function(){return e}}var D1=gl(null),db=gl(void 0),Br=db;function jn(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return u(s(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function m(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return s(a(o(i(r(n(t(e)))))));case 9:return u(s(a(o(i(r(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var Rr=function(e,t){var n=typeof e=="number"?function(r){return r.length>=e}:e;return function(){var r=Array.from(arguments);return n(arguments)?t.apply(this,r):function(i){return t.apply(void 0,A1([i],r,!1))}}},N1=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},P1=function(e){return e._tag==="None"},Qp=function(e){return e._tag==="Some"},bl={_tag:"None"},Sl=function(e){return{_tag:"Some",value:e}},R1=function(e){return e._tag==="Left"},wl=function(e){return{_tag:"Left",left:e}},Cl=function(e){return{_tag:"Right",right:e}},k1=function(e){return[e]},M1=function(e){return e.length>0},j1=function(e){return e[0]},_1=function(e){return e.slice(1)},q1=[],F1={},L1=Object.prototype.hasOwnProperty,B1=function(e){return N1([e[0]],e.slice(1),!0)};function V1(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function U1(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function pb(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):pb(e,t-1,i)}}function G1(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return pb(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function z1(e){return function(t){for(var n=Object.keys(t),r=n.length,i=G1(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function W1(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function H1(e){var t=U1(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function hb(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var K1=function(e){return function(){return Promise.resolve().then(e)}};function Y1(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var xl=function(e,t){return m(e,vb(t))},Zp=function(e,t){return m(e,X1(t))},vb=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},X1=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},au=function(e){return function(){return Promise.resolve(e)}},eh=Rr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),su="Task",El={URI:su,map:xl},th={URI:su,of:au},J1={URI:su,map:xl,ap:Zp},nh={URI:su,map:xl,of:au,ap:Zp,chain:eh},Q1=si,zv=eh,Mc={URI:su,map:xl,of:au,ap:Zp,chain:eh,fromIO:K1,fromTask:Q1};function mb(e){return function(t){return function(n){return e.fromEither(P1(n)?wl(t()):Cl(n.value))}}}function Z1(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Cl(o):wl(r(o)))})}}}var rh=wl,Tl=Cl,yb=function(e,t){return m(e,tE(t))},eE=function(e,t){return m(e,iE(t))},ih="Either",tE=function(e){return function(t){return Ni(t)?t:Tl(e(t.right))}},nE={URI:ih,map:yb},rE=function(e){return function(t){return Ni(t)?t:Ni(e)?e:Tl(t.right(e.right))}},iE=rE,oE={URI:ih,map:yb,ap:eE},aE=function(e){return function(t){return Ni(t)?rh(e(t.left)):t}},gb={URI:ih,fromEither:si},sE=mb(gb),Ni=R1,uE=function(e,t){return function(n){return Ni(n)?e(n.left):t(n.right)}},Zi=uE;gb.fromEither;var cE=function(e){return Ni(e)?Tl(e.left):rh(e.right)},an=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},mt=function(e){return an(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},Wv=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return an(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},oh={equals:function(e,t){return e===t}};oh.equals;var lE=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function fE(e,t){return e<t?-1:e>t?1:0}var dE={equals:oh.equals,compare:fE},pE=dE,hE=function(e){return{concat:lE(e)}},vE=hE,Hv=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},mE=q1,yE=M1,gE=function(e,t){return e<0||e>=t.length},bE=function(e){return function(t){return Hv(Hv([],t,!0),[e],!1)}},SE=bE,wE=function(e,t,n){if(n[e]===t)return n;var r=B1(n);return r[e]=t,r},CE=function(e){return function(t){if(t.length===1)return t;for(var n=[TE(t)],r=IE(t),i=function(u){n.every(function(c){return!e.equals(c,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},xE=k1,EE=j1,TE=EE,IE=_1,uu={equals:function(e,t){return e===t}},AE={equals:uu.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};uu.equals,AE.compare;globalThis&&globalThis.__spreadArray;var jc=function(e){return e.length===0},Pa=yE,$E=SE,OE=function(e){return function(t){if(jc(t))return sh;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},bb=gE,DE=function(e){return function(t){return bb(e,t)?t:e===0?sh:t.slice(0,e)}},NE=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Sl(n);return bl}};function Wt(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Sl(t[n]);return bl}}var PE=function(e,t){return function(n){return bb(e,n)?bl:Sl(qE(e,t(n[e]),n))}},RE=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function Sb(e,t){return t===void 0?function(n){return Sb(n,e)}:RE(e,t,function(n,r){return[n,r]})}function ah(e){return function(t,n){if(n===void 0){var r=ah(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var sa=function(e){var t=CE(e);return function(n){return Pa(n)?t(n):n}},kE=function(e){return function(t){return jc(t)?e:jc(e)?t:t.concat(e)}},Ne=kE;function wb(e){var t=ah(e);return function(n,r){if(r===void 0){var i=wb(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var ME=xE,Cb=Rr(2,function(e,t){return m(e,OE(function(n,r){return t(r,n)}))}),Il=Cb(si),G=function(e){return function(t){return t.map(function(n){return e(n)})}},ft=function(e){return function(t){return t.filter(e)}},jE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Qp(i)&&n.push(i.value)}return n}},cr=function(e){return jE(function(t,n){return e(n)})},Kn=cr(si),yd=function(e,t){return _E(e,function(n,r,i){return t(r,i)})},_E=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},xr=function(e){return an(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},qE=function(e,t,n){return Pa(n)?wE(e,t,n):n},gd=function(e){return e.slice()},Kv=function(e){return jc(e)?sh:e.slice()},sh=mE;function FE(e){return function(t){return t.every(e)}}var LE=Cb,BE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}};function Xi(e){return Wt(e)}var dc=function(e){return function(t){return t.map(function(n){return e(n)})}},VE=Rr(2,function(e,t){return m(e,BE(function(n,r){return t(r,n)}))}),UE=VE(si),GE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Qp(i)&&n.push(i.value)}return n}},di=function(e){return GE(function(t,n){return e(n)})},zE=function(e){return function(t){return t.filter(e)}},xb=function(e){return function(t){return jn(e,t)}},WE=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ge=bl,Me=Sl;function cu(e){return function(t){return e(t)?Me(t):ge}}var Eb=function(e,t){return m(e,Z(t))},Tb=function(e,t){return m(e,HE(t))},Ib="Option",kr=function(e){return{equals:function(t,n){return t===n||(Sr(t)?Sr(n):Sr(n)?!1:e.equals(t.value,n.value))}}},Z=function(e){return function(t){return Sr(t)?ge:Me(e(t.value))}},Ii=Me,HE=function(e){return function(t){return Sr(t)||Sr(e)?ge:Me(t.value(e.value))}},KE={URI:Ib,map:Eb,ap:Tb,of:Ii},uh=Rr(2,function(e,t){return Sr(e)?ge:t(e.value)}),YE={URI:Ib,map:Eb,ap:Tb,chain:uh},XE=Rr(2,function(e,t){return Sr(e)?t():e}),Yv=XE,JE=uh(si),wt=function(e){return function(t){return Sr(t)?ge:e(t.value)?t:ge}},fs=Qp,Sr=function(e){return e._tag==="None"},QE=function(e,t){return function(n){return Sr(n)?e():t(n.value)}},Xr=QE,Ab=Xr,ZE=function(e){return function(t){return Sr(t)?e():t.value}},Ye=ZE,bd=JE,eT=Rr(2,hb(YE)),he=function(e){return e==null?ge:Me(e)},En=Xr(D1,si),dt=Xr(db,si),Yn=uh,tT=eT,nT=H1(KE);function rT(e){return jn(Tl,e.of)}function iT(e){return jn(rh,e.of)}function oT(e){return W1(e,nE)}function aT(e){return V1(e,oE)}function sT(e){return function(t,n){return e.chain(t,function(r){return Ni(r)?e.of(r):n(r.right)})}}function uT(e){return function(t,n){return e.map(t,aE(n))}}function cT(e){return function(t,n){return function(r){return e.map(r,Zi(t,n))}}}function lT(e){return function(t){return function(n){return e.chain(n,function(r){return Ni(r)?t(r.left):e.of(r)})}}}function fT(e){return function(t){return e.map(t,cE)}}var dT=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(l){try{c(r.next(l))}catch(f){a(f)}}function u(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((r=r.apply(e,t||[])).next())})},pT=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Wr=iT(th),Ra=rT(th),hT=au,vT=function(e){return vb(sE(e))},_c=cT(El),Xv=function(e,t){return function(){return dT(void 0,void 0,void 0,function(){var n;return pT(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Cl)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,wl(t(n))];case 3:return[2]}})})}},$b=lT(nh),Jv=fT(El),Ob=function(e,t){return m(e,Kt(t))},Db=function(e,t){return m(e,yT(t))},Kt=oT(El),mT=Rr(2,uT(El)),yr=mT,yT=aT(J1),Nb=Rr(2,sT(nh)),ua=Ra,ch="TaskEither",gT={URI:ch,map:Ob,ap:Db,of:ua},Pb={URI:ch,map:Ob,ap:Db,chain:Nb},lh={URI:ch,fromEither:hT},bT=Rr(2,hb(Pb)),fh=mb(lh);lh.fromEither;var ST=Z1(lh,Pb),wT=ua(F1),vr=Nb,CT=bT;function xT(e){return t=>m(t,Kt(n=>(e(n)(),n)))}const js=xT;function qc(e){return t=>m(t,Jv,js(e),Jv)}function ET(e){return t=>m(t,js(n=>()=>e(n)()),qc(n=>()=>e(n)()))}function TT(e){return t=>m(t,Z(n=>(e(n)(),n)))}const IT=TT;function AT(e){return jn(Me,e.of)}function $T(e){return gl(e.of(ge))}function OT(e){var t=$T(e);return function(n,r){return e.chain(n,Xr(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var DT=AT(th),NT=au,PT=Rr(2,OT(nh)),RT=PT,kT=O1,xe={equals:function(e,t){return e===t}};xe.equals;function Rb(e){return function(t,n){if(n===void 0){var r=Rb(e);return function(o){return r(o,t)}}for(var i in t)if(!L1.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function dh(e){var t=Rb(e);return an(function(n,r){return t(n)(r)&&t(r)(n)})}function lu(e){return an((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var Al={equals:function(e,t){return e===t}};Al.equals;const kn=Symbol.for("@ts-pattern/matcher"),kb=Symbol.for("@ts-pattern/isVariadic"),Fc="@ts-pattern/anonymous-select-key",Sd=e=>!!(e&&typeof e=="object"),pc=e=>e&&!!e[kn],vn=(e,t,n)=>{if(pc(e)){const r=e[kn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(Sd(e)){if(!Sd(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let r=[],i=[],o=[];for(const a of e.keys()){const s=e[a];pc(s)&&s[kb]?o.push(s):o.length?i.push(s):r.push(s)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<r.length+i.length)return!1;const a=t.slice(0,r.length),s=i.length===0?[]:t.slice(-i.length),u=t.slice(r.length,i.length===0?1/0:-i.length);return r.every((c,l)=>vn(c,a[l],n))&&i.every((c,l)=>vn(c,s[l],n))&&(o.length===0||vn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>vn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||pc(o=i)&&o[kn]().matcherType==="optional")&&vn(i,t[r],n);var o})}return Object.is(t,e)},Wn=e=>{var t,n,r;return Sd(e)?pc(e)?(t=(n=(r=e[kn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?_s(e,Wn):_s(Object.values(e),Wn):[]},_s=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function MT(...e){if(e.length===1){const[t]=e;return n=>vn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return vn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function wn(e){return Object.assign(e,{optional:()=>ph(e),and:t=>At(e,t),or:t=>Mb(e,t),select:t=>t===void 0?qs(e):qs(t,e)})}function wd(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[kb]:!0})}}))(e),{optional:()=>wd(ph(e)),select:t=>wd(t===void 0?qs(e):qs(t,e))})}function ph(e){return wn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Wn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:vn(e,t,r),selections:n}},getSelectionKeys:()=>Wn(e),matcherType:"optional"})})}const jT=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},_T=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function At(...e){return wn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>vn(i,t,r)),selections:n}},getSelectionKeys:()=>_s(e,Wn),matcherType:"and"})})}function Mb(...e){return wn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return _s(e,Wn).forEach(i=>r(i,void 0)),{matched:e.some(i=>vn(i,t,r)),selections:n}},getSelectionKeys:()=>_s(e,Wn),matcherType:"or"})})}function Je(e){return{[kn]:()=>({match:t=>({matched:!!e(t)})})}}function qs(...e){const t=typeof e[0]=="string"?e[0]:void 0,n=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return wn({[kn]:()=>({match:r=>{let i={[t??Fc]:r};return{matched:n===void 0||vn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??Fc].concat(n===void 0?[]:Wn(n))})})}function Er(e){return typeof e=="number"}function eo(e){return typeof e=="string"}function vi(e){return typeof e=="bigint"}const jb=wn(Je(function(e){return!0})),qT=jb,to=e=>Object.assign(wn(e),{startsWith:t=>{return to(At(e,(n=t,Je(r=>eo(r)&&r.startsWith(n)))));var n},endsWith:t=>{return to(At(e,(n=t,Je(r=>eo(r)&&r.endsWith(n)))));var n},minLength:t=>to(At(e,(n=>Je(r=>eo(r)&&r.length>=n))(t))),maxLength:t=>to(At(e,(n=>Je(r=>eo(r)&&r.length<=n))(t))),includes:t=>{return to(At(e,(n=t,Je(r=>eo(r)&&r.includes(n)))));var n},regex:t=>{return to(At(e,(n=t,Je(r=>eo(r)&&!!r.match(n)))));var n}}),FT=to(Je(eo)),Tr=e=>Object.assign(wn(e),{between:(t,n)=>Tr(At(e,((r,i)=>Je(o=>Er(o)&&r<=o&&i>=o))(t,n))),lt:t=>Tr(At(e,(n=>Je(r=>Er(r)&&r<n))(t))),gt:t=>Tr(At(e,(n=>Je(r=>Er(r)&&r>n))(t))),lte:t=>Tr(At(e,(n=>Je(r=>Er(r)&&r<=n))(t))),gte:t=>Tr(At(e,(n=>Je(r=>Er(r)&&r>=n))(t))),int:()=>Tr(At(e,Je(t=>Er(t)&&Number.isInteger(t)))),finite:()=>Tr(At(e,Je(t=>Er(t)&&Number.isFinite(t)))),positive:()=>Tr(At(e,Je(t=>Er(t)&&t>0))),negative:()=>Tr(At(e,Je(t=>Er(t)&&t<0)))}),LT=Tr(Je(Er)),mi=e=>Object.assign(wn(e),{between:(t,n)=>mi(At(e,((r,i)=>Je(o=>vi(o)&&r<=o&&i>=o))(t,n))),lt:t=>mi(At(e,(n=>Je(r=>vi(r)&&r<n))(t))),gt:t=>mi(At(e,(n=>Je(r=>vi(r)&&r>n))(t))),lte:t=>mi(At(e,(n=>Je(r=>vi(r)&&r<=n))(t))),gte:t=>mi(At(e,(n=>Je(r=>vi(r)&&r>=n))(t))),positive:()=>mi(At(e,Je(t=>vi(t)&&t>0))),negative:()=>mi(At(e,Je(t=>vi(t)&&t<0)))}),BT=mi(Je(vi)),VT=wn(Je(function(e){return typeof e=="boolean"})),UT=wn(Je(function(e){return typeof e=="symbol"})),GT=wn(Je(function(e){return e==null}));var Tt={__proto__:null,matcher:kn,optional:ph,array:function(...e){return wd({[kn]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const n=e[0];let r={};if(t.length===0)return Wn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>vn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Wn(e[0])})})},set:function(...e){return wn({[kn]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};if(e.length===0)return{matched:!0};const r=(o,a)=>{n[o]=(n[o]||[]).concat([a])},i=e[0];return{matched:jT(t,o=>vn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Wn(e[0])})})},map:function(...e){return wn({[kn]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};const r=(s,u)=>{n[s]=(n[s]||[]).concat([u])};if(e.length===0)return{matched:!0};var i;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(i=e[0])==null?void 0:i.toString()}`);const[o,a]=e;return{matched:_T(t,(s,u)=>{const c=vn(o,u,r),l=vn(a,s,r);return c&&l}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Wn(e[0]),...Wn(e[1])]})})},intersection:At,union:Mb,not:function(e){return wn({[kn]:()=>({match:t=>({matched:!vn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Je,select:qs,any:jb,_:qT,string:FT,number:LT,bigint:BT,boolean:VT,symbol:UT,nullish:GT,instanceOf:function(e){return wn(Je(function(t){return n=>n instanceof t}(e)))},shape:function(e){return wn(Je(MT(e)))}};const Cd={matched:!1,value:void 0};function ue(e){return new zT(e,Cd)}let zT=class xd{constructor(t,n){this.input=void 0,this.state=void 0,this.input=t,this.state=n}with(...t){if(this.state.matched)return this;const n=t[t.length-1],r=[t[0]];let i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&r.push(...t.slice(1,t.length-1));let o=!1,a={};const s=(c,l)=>{o=!0,a[c]=l},u=!r.some(c=>vn(c,this.input,s))||i&&!i(this.input)?Cd:{matched:!0,value:n(o?Fc in a?a[Fc]:a:this.input,this.input)};return new xd(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new xd(this.input,r?{matched:!0,value:n(this.input,this.input)}:Cd)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}};var WT=Object.getOwnPropertyNames,HT=Object.getOwnPropertySymbols,KT=Object.prototype.hasOwnProperty;function Qv(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Ru(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);var o=i.cache,a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i);return o.delete(n),o.delete(r),u}}function Zv(e){return WT(e).concat(HT(e))}var _b=Object.hasOwn||function(e,t){return KT.call(e,t)};function ka(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var qb="_owner",em=Object.getOwnPropertyDescriptor,tm=Object.keys;function YT(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function XT(e,t){return ka(e.getTime(),t.getTime())}function nm(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var u=t.entries(),c=!1,l=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],p=f[1],h=s.value,v=h[0],C=h[1];!c&&!r[l]&&(c=n.equals(d,v,o,l,e,t,n)&&n.equals(p,C,d,v,e,t,n))&&(r[l]=!0),l++}if(!c)return!1;o++}return!0}function JT(e,t,n){var r=tm(e),i=r.length;if(tm(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===qb&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!_b(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function ts(e,t,n){var r=Zv(e),i=r.length;if(Zv(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===qb&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!_b(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=em(e,o),s=em(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function QT(e,t){return ka(e.valueOf(),t.valueOf())}function ZT(e,t){return e.source===t.source&&e.flags===t.flags}function rm(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var s=t.values(),u=!1,c=0;(a=s.next())&&!a.done;)!u&&!r[c]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[c]=!0),c++;if(!u)return!1}return!0}function eI(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var tI="[object Arguments]",nI="[object Boolean]",rI="[object Date]",iI="[object Map]",oI="[object Number]",aI="[object Object]",sI="[object RegExp]",uI="[object Set]",cI="[object String]",lI=Array.isArray,im=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,om=Object.assign,fI=Object.prototype.toString.call.bind(Object.prototype.toString);function dI(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,u=e.areTypedArraysEqual;return function(l,f,d){if(l===f)return!0;if(l==null||f==null||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;var p=l.constructor;if(p!==f.constructor)return!1;if(p===Object)return i(l,f,d);if(lI(l))return t(l,f,d);if(im!=null&&im(l))return u(l,f,d);if(p===Date)return n(l,f,d);if(p===RegExp)return a(l,f,d);if(p===Map)return r(l,f,d);if(p===Set)return s(l,f,d);var h=fI(l);return h===rI?n(l,f,d):h===sI?a(l,f,d):h===iI?r(l,f,d):h===uI?s(l,f,d):h===aI?typeof l.then!="function"&&typeof f.then!="function"&&i(l,f,d):h===tI?i(l,f,d):h===nI||h===oI||h===cI?o(l,f,d):!1}}function pI(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?ts:YT,areDatesEqual:XT,areMapsEqual:r?Qv(nm,ts):nm,areObjectsEqual:r?ts:JT,arePrimitiveWrappersEqual:QT,areRegExpsEqual:ZT,areSetsEqual:r?Qv(rm,ts):rm,areTypedArraysEqual:r?ts:eI};if(n&&(i=om({},i,n(i))),t){var o=Ru(i.areArraysEqual),a=Ru(i.areMapsEqual),s=Ru(i.areObjectsEqual),u=Ru(i.areSetsEqual);i=om({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function hI(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function vI(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,c){var l=r(),f=l.cache,d=f===void 0?t?new WeakMap:void 0:f,p=l.meta;return n(u,c,{cache:d,equals:i,meta:p,strict:o})};if(t)return function(u,c){return n(u,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(u,c){return n(u,c,a)}}var mI=Bi();Bi({strict:!0});Bi({circular:!0});Bi({circular:!0,strict:!0});Bi({createInternalComparator:function(){return ka}});Bi({strict:!0,createInternalComparator:function(){return ka}});Bi({circular:!0,createInternalComparator:function(){return ka}});Bi({circular:!0,createInternalComparator:function(){return ka},strict:!0});function Bi(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,s=pI(e),u=dI(s),c=r?r(u):hI(u);return vI({circular:n,comparator:u,createState:i,equals:c,strict:a})}function yI(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<e.length;r++){var i=e[r];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(r>0&&(i=i.replace(/^[\/]+/,"")),r<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function gI(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),yI(e)}var Ts=m,bI=kT(nT({concat:vE(pE).concat,empty:0}))();function SI(e){return function(t){return t.iterNumber>=e?ge:Me(0)}}function wI(e,t){return function(n){return Ts(n,t,Z(function(r){return Math.min(e,r)}))}}function CI(e){return function(t){return Me(e*Math.pow(2,t.iterNumber))}}var xI={iterNumber:0,cumulativeDelay:0,previousDelay:ge};function EI(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+Ye(function(){return 0})(n),previousDelay:n}}function TI(e,t){var n=EI(e,t);return Ts(n.previousDelay,Ab(function(){return Mc.of(n)},function(r){return Y1(r)(Mc.of(n))}))}function Bo(e,t,n){var r=function(i){return Ts(i,t,zv(function(o){return n(o)?Ts(TI(e,i),zv(function(a){return Ts(a.previousDelay,Ab(function(){return Mc.of(o)},function(){return r(a)}))})):Mc.of(o)}))};return r(xI)}var am=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fs={};Object.defineProperty(Fs,"__esModule",{value:!0});Fs.isGuid=Lb=Fs.guid=void 0;var II=function(e){e===void 0&&(e=2);for(var t=(Date.now()*3).toString(16),n=new Date().getTimezoneOffset(),r=Number("".concat(n<0?"7":"6").concat(Math.abs(n))).toString(16),i=e*9+3+15,o="",a=0;a<e;a++)o+=sm()+"-";for(o+=r,o+=t;o.length<i;)o+=sm();return o.substring(0,i)},Lb=Fs.guid=II,sm=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},AI=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=$I(n[n.length-1]);if(n.length-1!==t)return"Invalid guid, invalid number of blocks";var i=n.concat().slice(0,-1).reduce(function(o,a){return o&&a.length===8&&!a.includes(" ")},!0);return i?!r&&n[n.length-1].length!==18?"Invalid guid, last date block has invalid size":!0:"Invalid guid, one or more random blocks are invalid"};Fs.isGuid=AI;var $I=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function hh(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function $l(e){return{equals(t,n){const r=m(he(t),Ye(()=>[])),i=m(he(n),Ye(()=>[]));return xr(e).equals(r,i)}}}const ko=mt({localId:xe,componentPath:$l(xe),sharedConfigurationModelId:hh(xe)}),vh=mt({localId:xe,configurationModelId:xe}),Bb=an((e,t)=>ue({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>OI.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>DI.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>NI.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>PI.equals(n.x,n.y)).otherwise(()=>!1)),OI=mt({type:xe,attributeId:ko,state:xe,choiceValueId:xe}),DI=mt({type:xe,attributeId:ko,state:xe}),NI=mt({type:xe,attributeId:ko,state:uu}),PI=mt({type:xe,attributeId:ko,state:Al});var Tn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Tn||{}),In=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(In||{}),ha=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ha||{}),ar=(e=>(e.all="all",e.none="none",e.specific="specific",e))(ar||{}),Jr=(e=>(e.Channel="Channel",e.Package="Package",e))(Jr||{}),Xe=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(Xe||{}),Qr=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Qr||{}),Pi=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Pi||{}),Zr=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Zr||{}),Dr=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Dr||{}),Ri=(e=>(e.Always="Always",e.Optional="Optional",e))(Ri||{});const RI=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:ar,AttributeType:Xe,ChoiceValueDecisionState:Qr,ComponentDecisionState:Pi,ConfigurationModelSourceType:Jr,ConstraintType:ha,DecisionKind:Zr,ExplainQuestionSubject:In,ExplainQuestionType:Tn,Inclusion:Ri,Selection:Dr,eqCausedByDecision:Bb,eqGlobalAttributeId:ko,eqGlobalConstraintId:vh},Symbol.toStringTag,{value:"Module"}));var Gt=(e=>(e.Unknown="Unknown",e.CommunicationError="Local.LowLevelCommunicationError",e.ServiceError="ServiceError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationUnauthorized="ConfigurationUnauthorized",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(Gt||{}),Ol=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Ol||{});const Vb={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}},kI=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationConflictReason:Ol,FailureResultFactory:Vb,FailureType:Gt},Symbol.toStringTag,{value:"Module"}));let Ub=class{mapToCreateSessionRequest(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToAttributeRelations(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToConfigurationModelSource(t){return ue(t).with({type:Jr.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Jr.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return m(t,he,Z(jn(G(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),dt)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:m([...t.decisions],dc(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return m(he(t),dt)}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath,sharedConfigurationModelId:t.sharedConfigurationModelId}}mapToAllowedInExplain(t){return t==null?null:{rules:this.mapToAllowedRulesInExplain(t.rules)}}mapToAllowedRulesInExplain(t){return ue(t).returnType().with({type:ar.all},()=>({type:"AllowedRulesAll"})).with({type:ar.none},()=>({type:"AllowedRulesNone"})).with({type:ar.specific},n=>({type:"AllowedRulesSpecific",rules:m(n.rules,G(this.mapToGlobalConstraintId),gd)})).with(Tt.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function MI(e){return t=>ST(n=>n!=null,e)(t)}function jI(){return Ra(Br())}var Gn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Gn||{}),fo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(fo||{}),dn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(dn||{}),po=(e=>(e.all="all",e.none="none",e.specific="specific",e))(po||{});const bn=mt({localId:xe,componentPath:$l(xe),sharedConfigurationModel:hh(xe)}),_I=kr(xr(mt({attributeId:bn,decisions:$l(bn)}))),qI=kr(an((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:"all"},y:{type:"all"}},()=>!0).with({x:{type:"none"},y:{type:"none"}},()=>!0).with({x:{type:"specific"},y:{type:"specific"}},({x:n,y:r})=>xr(vh).equals(n.rules,r.rules)).otherwise(()=>!1))),FI=kr(mt({rules:qI})),LI=mt({configurationModelSource:an((e,t)=>mI(e,t)),decisionsToRespect:_I,usageRuleParameters:dh(xe),allowedInExplain:FI});var Ls=(e=>(e.Channel="Channel",e.Package="Package",e))(Ls||{}),ct=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ct||{}),Te=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Te||{}),Xt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Xt||{}),Mt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Mt||{}),go=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(go||{}),bo=(e=>(e.Always="Always",e.Optional="Optional",e))(bo||{});const BI={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:kr(xe).equals(e.state,t.state)},VI={equals(e,t){return kr(uu).equals(e.value,t.value)}},UI={equals(e,t){return kr(Al).equals(e.value,t.value)}},GI={equals(e,t){return kr(xe).equals(e.state,t.state)}},zI={equals(e,t){return bn.equals(e.attributeId,t.attributeId)?ue({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>UI.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>VI.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>GI.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>BI.equals(r.x,r.y)).otherwise(()=>!1):!1}},WI=xr(zI),HI={equals:(e,t)=>WI.equals(e.decisions,t.decisions)&&KI.equals(e.mode,t.mode)},KI={equals:(e,t)=>ue({x:e,y:t}).with({x:{type:"Default"},y:{type:"Default"}},n=>!0).with({x:{type:"DropExistingDecisions"},y:{type:"DropExistingDecisions"}},n=>!0).otherwise(()=>!1)};var Ed=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(Ed||{}),va=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(va||{}),we=(e=>(e.ServiceError="ServiceError",e.Unknown="Unknown",e.CommunicationError="CommunicationError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(we||{}),mh=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(mh||{});const YI={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};function XI(e,t){console.log(`--------------------------------------------------------------------------------
|
|
2
2
|
-- ${t??""}
|
|
3
3
|
--------------------------------------------------------------------------------
|
|
4
|
-
${JSON.stringify(e,null,2)}`)}var na=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(na||{}),bh=(e=>(e.BooleanAttributeNotFound="BooleanAttributeNotFound",e.ChoiceAttributeNotFound="ChoiceAttributeNotFound",e.ChoiceValueNotFound="ChoiceValueNotFound",e.ConfigurationInitializationFailure="InitializationFailure",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.LegacyConfigurationModelInvalid="DeploymentStore.Core.Store.SnapshotInvalid",e.LegacySnapshotInvalid="SnapshotInvalid",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConflictWithConsequence="ConflictWithConsequence",e.DecisionInvalid="DecisionInvalid",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.NumericAttributeNotFound="NumericAttributeNotFound",e.NumericDecisionOutOfRange="NumericDecisionOutOfRange",e.SessionNotFound="SessionNotFound",e.SetDecisionConflict="SetDecisionConflict",e.Unauthorized="Unauthorized",e.AuthenticationFailure="AuthenticationFailure",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(bh||{});const DC=e=>Object.values(bh).includes(e),OC=e=>DC(e)?ge(e):ne;function NC(e){const t=n=>Y(n).with("ConfigurationModelNotFound",()=>({type:se.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:se.DecisionsToRespectInvalid})).with(Xe.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:se.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:se.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:se.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:se.ConfigurationConflict,reason:Jl.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:se.ConfigurationConflict})).with(Xe.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:se.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:se.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:se.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:se.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:se.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",i=>({type:se.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:se.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:se.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return m(e.type,OC,U(t))}const PC=e=>Object.values(na).includes(e),MC=e=>PC(e)?ge(e):ne;function RC(e){return m(e,MC,U(n=>Y(n).with("Generic::LocalClientError",()=>({type:se.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:se.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:se.CommunicationError})).with("Generic::Unauthorized",()=>({type:se.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:se.Unknown})).exhaustive()))}function fi(e,t){AC(e,t);const n=e.type;return m(ne,Hd(()=>NC(e)),Hd(()=>RC(n)),Ue(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:se.Unknown})))}let Sh=class{constructor(t,n,i,r){this.engineApiClient=t,this.contractToRestMapper=n,this.restToDomainMapper=i,this.options=r}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t);return m(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),Ln(i=>fi(i,"ClientSideSessionLifetimeHandler - create")),Vn(i=>this.restToDomainMapper.mapToSessionId(i)),pC(()=>({type:se.ConfigurationUnauthenticated})))}close(t){return m(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),Ln(n=>fi(n,"ClientSideSessionLifetimeHandler - close")),wt(()=>di()))}};var Ch=(e=>(e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e))(Ch||{});function ui(e,t,n){const i=m(Array.isArray(e)?e:[e],YS);return m(Kd(()=>fetch(i,t),r=>({type:"error"})),Vn(r=>m(Kd(async()=>{const o=await r.json();return{response:r,data:o}},()=>r))),ih(r=>r.status===401?vi({type:na.ConfigurationEngineRestApiUnauthorized,status:401}):r.status===204?po({response:r,data:{}}):r.type==="error"?vi({type:na.LowLevelCommunicationError}):vi({type:na.UnhandledResponseStatus})),Vn(r=>m(n(r),Gl(()=>r.data))))}function Dc(e,t){return ui(e,t,n=>{if(n.response.status===200)return Bi(n.data);if(n.response.status===409){const i=n.data;return Y(i).with({type:"ConfigurationModelInvalid"},r=>Bi(i)).with({type:"ConfigurationModelNotFeasible"},r=>Bi(i)).otherwise(()=>ne)}return ne})}let _C=class{constructor(t){this.baseUrl=t}createSessionUsingApiKey(t,n){const i={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-API-KEY":n},body:JSON.stringify(t)};return Dc([this.baseUrl,"v2/session"],i)}createSessionUsingJwtBearer(t,n){const i={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify(t)};return Dc([this.baseUrl,"v2/session"],i)}setMany(t,n){const i={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return ui([this.baseUrl,"v2/session/configuration/decision/many"],i,r=>r.response.status===200||r.response.status===409?ge(r.data):ne)}makeDecision(t,n){const i={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return ui([this.baseUrl,"v2/session/configuration/decision"],i,r=>r.response.status===200?ge(r.data):ne)}getDecisions(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return ui([this.baseUrl,"v2/session/configuration/decision"],n,i=>i.response.status===200?ge(i.data):ne)}getWhyStateNotPossible(t,n){const i={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return ui([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],i,r=>r.response.status===200?ge(r.data):ne)}getWhyNotSatisfied(t,n){const i={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return ui([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],i,r=>r.response.status===200?ge(r.data):ne)}getConsequence(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return ui([this.baseUrl,"v2/session/configuration/consequence"],n,i=>i.response.status===200?ge(i.data):ne)}deleteSessionUsingJwtBearer(t,n){const i={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return ui([this.baseUrl,`v2/session/${t}`],i,r=>r.response.status===204?ge({}):ne)}};var mr=(e=>(e.Included="Included",e.Excluded="Excluded",e))(mr||{}),Oc=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Oc||{}),Nc=(e=>(e.Always="Always",e.Optional="Optional",e))(Nc||{}),pa=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(pa||{}),yi=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(yi||{}),sn=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(sn||{}),Pc=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(Pc||{}),Mc=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(Mc||{}),Fo=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Fo||{});const on=Cn({localId:Qe,componentPath:$a(Qe),sharedConfigurationModelId:Hl(Qe)});let wh=class{mapToDecisions(t){return{}}mapToSessionId(t){return Y(t).with({sessionId:Xe.string},n=>po(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const i=m(n.constraintExplanations,_(r=>this.mapToConstraintExplanation(r)));return vi({type:se.ConfigurationModelNotFeasible,constraintExplanations:i})}).with({type:"ConfigurationModelInvalid"},()=>vi({type:se.ConfigurationModelInvalid})).otherwise(()=>vi({type:se.Unknown}))}mapToExplainAnswer(t,n){const i=Y(n).with({question:dn.whyIsStateNotPossible,subject:Vt.boolean},a=>[{type:ce.Boolean,attributeId:a.attributeId,value:ge(a.state)}]).with({question:dn.whyIsStateNotPossible,subject:Vt.numeric},a=>[{type:ce.Numeric,attributeId:a.attributeId,value:ge(a.state)}]).with({question:dn.whyIsStateNotPossible,subject:Vt.component},a=>[{type:ce.Component,attributeId:a.attributeId,state:ge(a.state)}]).with({question:dn.whyIsStateNotPossible,subject:Vt.choiceValue},a=>[{type:ce.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:ge(a.state)}]).otherwise(()=>[]),r=m(t.decisionExplanations,_(a=>this.mapToDecisionExplanation(a,i,{type:"Default"}))),o=m(t.constraintExplanations,_(a=>this.mapToConstraintExplanation(a)));return Y(n).with({answerType:cr.decisions},()=>({decisionExplanations:r})).with({answerType:cr.constraints},()=>({constraintExplanations:o})).with({answerType:cr.all},()=>({constraintExplanations:o,decisionExplanations:r})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,i){const r=this.mapToExplicitDecisions(n);return{type:se.ConfigurationSetManyConflict,decisionExplanations:m(t.decisionExplanations,_(o=>this.mapToDecisionExplanation(o,r,i))),constraintExplanations:m(t.constraintExplanations,_(o=>this.mapToConstraintExplanation(o)))}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModel(t,n){const i=this.mapToAttributes(t,n);return{isSatisfied:n.isConfigurationSatisfied??!1,attributes:i}}mapToBooleanDecision(t){return{type:ce.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:ee(t.state)}}mapToNumericDecision(t){return{type:ce.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:ee(t.state)}}mapToComponentDecision(t){return{type:ce.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:ce.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToDecisionState(t.state)}}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModel:t.sharedConfigurationModelId,componentPath:t.componentPath??[]}}mapToChoiceValueDecision(t){return m(this.mapToDecisionState(t.state),U(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:m(t.causedByRules,_(n=>this.mapToRuleConstraint(n))),causedByCardinalities:m(t.causedByCardinalities,_(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:Qr.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:Qr.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=m(t.booleanDecisions??[],_(a=>({type:ce.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ee(a.state)}))),i=m(t.numericDecisions??[],_(a=>({type:ce.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ee(a.state)}))),r=m(t.componentDecisions??[],_(a=>({type:ce.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:m(ee(a.state),U(u=>this.mapToDecisionState(u)),wc)}))),o=m(t.choiceDecisions??[],_(a=>({type:ce.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:m(ee(a.state),U(u=>this.mapToDecisionState(u)),wc)})));return m([],ve(n),ve(i),ve(r),ve(o))}mapToDecisionExplanation(t,n,i){const r=m(t.causedByBooleanDecisions,_(h=>this.mapToCausedByBooleanDecision(h))),o=m(t.causedByNumericDecisions,_(h=>this.mapToCausedByNumericDecision(h))),a=m(t.causedByComponentDecisions,_(h=>this.mapToCausedByComponentDecision(h))),u=m(t.causedByChoiceDecisions,_(h=>this.mapToCausedByChoiceValueDecision(h))),s=m(r,_(h=>({type:ce.Boolean,attributeId:h.attributeId,value:ne}))),c=m(o,_(h=>({type:ce.Numeric,attributeId:h.attributeId,value:ne}))),l=m(a,_(h=>({type:ce.Component,attributeId:h.attributeId,state:ne}))),f=m(u,_(h=>({type:ce.ChoiceValue,attributeId:h.attributeId,choiceValueId:h.choiceValueId,state:ne}))),d=m([],ve(s),ve(c),ve(l),ve(f)),p=Yp(bn((h,v)=>{const w=Ht.equals(h.attributeId,v.attributeId);return Y({a:h,b:v}).with({a:{type:ce.ChoiceValue},b:{type:ce.ChoiceValue}},C=>w&&C.a.choiceValueId===C.b.choiceValueId).otherwise(()=>w)}))(d)(n);return{causedByBooleanDecisions:r,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:u,solution:{decisions:m([],ve(d),ve(p)),mode:i}}}mapToCausedByBooleanDecision(t){return{type:ce.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return Y(t).with(Pc.NotAvailable,()=>Ac.NotAvailable).with(Pc.StateNotPossible,()=>Ac.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:ce.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:ce.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:ce.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToAttributes(t,n){function i(d){return m(n.canAttributeContributeToConfigurationSatisfaction,Bt(p=>on.equals(p,d)),Vo)}const r=m([],ve(m(t.choiceValueDecisions,_(d=>d.attributeId))),ve(m(n.choiceConsequences,_(d=>d.attributeId))),Hr(on)),o=m(r,_(d=>{const p=m(t.choiceValueDecisions??[],Ib(v=>on.equals(v.attributeId,d))),h=m(n.choiceConsequences??[],Zi(v=>on.equals(v.attributeId,d)));return m(h,U(v=>this.mapToChoiceAttributes(v,p,i(d))))}),mn),a=m([],ve(m(t.numericDecisions,_(d=>d.attributeId))),ve(m(n.numericConsequences,_(d=>d.attributeId))),Hr(on)),u=m(a,_(d=>{const p=m(t.numericDecisions??[],Zi(v=>on.equals(v.attributeId,d))),h=m(n.numericConsequences??[],Zi(v=>on.equals(v.attributeId,d)));return m(h,U(v=>this.mapToNumericAttribute(v,p,i(d))))}),mn),s=m([],ve(m(t.booleanDecisions,_(d=>d.attributeId))),ve(m(n.booleanConsequences,_(d=>d.attributeId))),Hr(on)),c=m(s,_(d=>{const p=m(t.booleanDecisions??[],Zi(v=>on.equals(v.attributeId,d))),h=m(n.booleanConsequences??[],Zi(v=>on.equals(v.attributeId,d)));return m(h,U(v=>this.mapToBooleanAttribute(v,p,i(d))))}),mn),l=m([],ve(m(t.componentDecisions,_(d=>d.attributeId))),ve(m(n.componentConsequences,_(d=>d.attributeId))),Hr(on)),f=m(l,_(d=>{const p=m(t.componentDecisions??[],Zi(v=>on.equals(v.attributeId,d))),h=m(n.componentConsequences??[],Zi(v=>on.equals(v.attributeId,d)));return m(h,U(v=>this.mapToComponentAttribute(v,p,i(d))))}),mn);return m([],ve(o),ve(f),ve(u),ve(c))}mapToComponentAttribute(t,n,i){return{type:Le.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:m(t.possibleDecisionStates,ss(r=>this.mapToPossibleDecisionState(r))),decision:m(n,Dn(r=>m(this.mapToDecisionState(r.state),U(o=>({state:o,kind:r.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:m(t.selection,ee,U(r=>this.mapToSelection(r)),ft),canContributeToConfigurationSatisfaction:i}}mapToChoiceAttributes(t,n,i){const r=m(t.values,ss(o=>{const a=m(n,Bt(u=>u.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:Le.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:r,canContributeToConfigurationSatisfaction:i}}mapToBooleanAttribute(t,n,i){return{type:Le.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:m(n,Dn(r=>m(r.state,ee,U(o=>({kind:this.mapToDecisionKind(r.kind),state:o}))))),canContributeToConfigurationSatisfaction:i}}mapToNumericAttribute(t,n,i){return{type:Le.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,range:{min:t.range.min,max:t.range.max},selection:this.mapToSelection(t.selection),decimalPlaces:t.decimalPlaces,decision:m(n,Dn(r=>m(r.state,ee,U(o=>({kind:this.mapToDecisionKind(r.kind),state:o}))))),canContributeToConfigurationSatisfaction:i}}mapToChoiceValue(t,n){const i=m(t.possibleDecisionStates,ss(r=>this.mapToPossibleDecisionState(r)));return{choiceValueId:t.choiceValueId,decision:m(n,Dn(r=>this.mapToChoiceValueDecision(r))),possibleDecisionStates:i}}mapToDecisionKind(t){return Y(t).with(pa.Implicit,()=>lt.Implicit).with(pa.Explicit,()=>lt.Explicit).exhaustive()}mapToDecisionState(t){return Y(t).with(yi.Included,()=>ge(Et.Included)).with(yi.Excluded,()=>ge(Et.Excluded)).with(yi.Undefined,()=>ne).exhaustive()}mapToPossibleDecisionState(t){return Y(t).with(mr.Included,()=>Et.Included).with(mr.Excluded,()=>Et.Excluded).exhaustive()}mapToSelection(t){return Y(t).with(Oc.Mandatory,()=>vr.Mandatory).with(Oc.Optional,()=>vr.Optional).exhaustive()}mapToInclusion(t){return Y(t).with(Nc.Always,()=>yr.Always).with(Nc.Optional,()=>yr.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},Th=class{constructor(t,n){this.restToDomainMapper=new wh,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),i=Dc(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return m(i,Ln(r=>fi(r,"ServerSideSessionLifetimeHandler - create")),Vn(r=>this.restToDomainMapper.mapToSessionId(r)))}close(t){return m(ui(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===Ch.NoContent?ge({}):ne),Ln(n=>fi(n,"ServerSideSessionLifetimeHandler - close")),wt(di))}},jC=class{constructor(t,n,i){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=i,this.onConfigurationChangedHandler=ne}setOnConfigurationChangedHandler(t){const n=m(t,ee,U(i=>r=>{const o=this.domainToContractMapper.mapToConfiguration(r);i(o)}));this.inner.setOnConfigurationChangedHandler(n)}getConfiguration(){const t=this.inner.getConfiguration();return this.domainToContractMapper.mapToConfiguration(t)}getSessionContext(){const t=this.inner.getSessionContext();return this.domainToContractMapper.mapToSessionContext(t)}async setSessionContext(t){const n=this.contractToDomainMapper.mapToSessionContext(t);return await m(this.inner.setSessionContext(n),wt(di),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await m(this.inner.restoreConfiguration(n),wt(di),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await m(this.inner.makeDecision(n),wt(di),this.adaptToContractPromise())()}async setMany(t,n){const i=this.contractToDomainMapper.mapToAttributeDecisions(t),r=this.contractToDomainMapper.mapToMode(n);return await m(this.inner.setMany(i,r),wt(di),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await m(this.inner.applySolution(n),wt(di),this.adaptToContractPromise())()}async explain(t,n){const i=this.contractToDomainMapper.mapToExplainQuestion(t,n);return await m(this.inner.explain(i),wt(r=>this.domainToContractMapper.mapToExplainAnswer(r)),this.adaptToContractPromise())()}async close(){return await m(this.inner.close(),Ln(t=>this.domainToContractMapper.mapToFailureResult(t)),$s(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Nn(Ln(t=>this.domainToContractMapper.mapToFailureResult(t)),$s(t=>Promise.reject(t),t=>Promise.resolve(t)))}},qC=class{mapToExplainQuestion(t,n){const i={answerType:Y(n).with("decisions",()=>cr.decisions).with("constraints",()=>cr.constraints).with("full",()=>cr.all).exhaustive()};return Y(t).with({question:Jt.whyIsNotSatisfied,subject:Yt.configuration},r=>({...i,question:dn.whyIsNotSatisfied,subject:Vt.configuration})).with({question:Jt.whyIsNotSatisfied,subject:Yt.attribute},r=>({...i,question:dn.whyIsNotSatisfied,subject:Vt.attribute,attributeId:this.mapToGlobalAttributeId(r.attributeId)})).with({question:Jt.whyIsStateNotPossible,subject:Yt.choiceValue},r=>({...i,question:dn.whyIsStateNotPossible,subject:Vt.choiceValue,attributeId:this.mapToGlobalAttributeId(r.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(r.state)})).with({question:Jt.whyIsStateNotPossible,subject:Yt.component},r=>({...i,question:dn.whyIsStateNotPossible,subject:Vt.component,attributeId:this.mapToGlobalAttributeId(r.attributeId),state:this.mapToDecisionState(r.state)})).with({question:Jt.whyIsStateNotPossible,subject:Yt.numeric},r=>({...i,question:dn.whyIsStateNotPossible,subject:Vt.numeric,attributeId:this.mapToGlobalAttributeId(r.attributeId),state:r.state})).with({question:Jt.whyIsStateNotPossible,subject:Yt.boolean},r=>({...i,question:dn.whyIsStateNotPossible,subject:Vt.boolean,attributeId:this.mapToGlobalAttributeId(r.attributeId),state:r.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:m(t.attributes,_(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return m(t,_(n=>this.mapToAttributeDecision(n)))}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),decisionsToRespect:this.mapToDecisionsToRespect(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToAttributeDecision(t){return Y(t).with({type:he.Choice,choiceValueId:Xe.string},n=>({type:ce.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:he.Numeric},n=>({type:ce.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ee(n.state)})).with({type:he.Boolean},n=>({type:ce.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ee(n.state)})).with({type:he.Component},n=>({type:ce.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(ee(n.state),Dn(i=>this.mapToDecisionStateOption(i)))})).exhaustive()}mapToDecisionsToRespect(t){return m(ee(t),U(n=>m(n,_(i=>({attributeId:this.mapToGlobalAttributeId(i.attributeId),decisions:m(i.decisions,_(r=>this.mapToGlobalAttributeId(r)))})))))}mapToMode(t){return Y(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).exhaustive()}mapToConflictHandling(t){return Y(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath??[],sharedConfigurationModel:t.sharedConfigurationModelId}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return Y(t).with({type:Si.Package},n=>({type:fa.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Si.Channel},n=>({type:fa.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:m(t.decisions,_(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return Y(t).with({type:he.Boolean},n=>({type:Le.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:m(n.decision,ee,U(i=>({kind:this.mapToDecisionKind(i.kind),state:i.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:he.Numeric},n=>({type:Le.Numeric,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,range:{min:n.range.min,max:n.range.max},decimalPlaces:n.decimalPlaces,selection:this.mapToSelection(n.selection),decision:m(n.decision,ee,U(i=>({kind:this.mapToDecisionKind(i.kind),state:i.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:he.Choice},n=>({type:Le.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:m(n.values,_(i=>this.mapToChoiceValue(i))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:he.Component},n=>({type:Le.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:m(n.decision,ee,Dn(i=>m(this.mapToDecisionStateOption(i.state),U(r=>({kind:this.mapToDecisionKind(i.kind),state:r}))))),possibleDecisionStates:m(n.possibleDecisionStates,_(i=>this.mapToDecisionStateOption(i)),mn),selection:m(n.selection,ee,U(i=>this.mapToSelection(i)),ft),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:m(t.possibleDecisionStates,_(n=>this.mapToDecisionStateOption(n)),mn)}}mapToChoiceValueDecision(t){return m(t.decision,ee,Dn(n=>m(this.mapToDecisionStateOption(n.state),U(i=>({state:i,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return Y(t).with(ii.Implicit,()=>lt.Implicit).with(ii.Explicit,()=>lt.Explicit).exhaustive()}mapToSelection(t){return Y(t).with(ti.Mandatory,()=>vr.Mandatory).with(ti.Optional,()=>vr.Optional).exhaustive()}mapToInclusion(t){return Y(t).with(Gi.Always,()=>yr.Always).with(Gi.Optional,()=>yr.Optional).exhaustive()}mapToDecisionState(t){return Y(t).with(Xe.union(Ci.Included,Li.Included),()=>Et.Included).with(Xe.union(Ci.Excluded,Li.Excluded),()=>Et.Excluded).exhaustive()}mapToDecisionStateOption(t){return m(ee(t),U(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return m(t,ee,U(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return m(t,ee,U(n=>Y(n).returnType().with({type:Pn.all},()=>({type:lr.all})).with({type:Pn.none},()=>({type:lr.none})).with({type:Pn.specific},i=>({type:lr.specific,rules:m(i.rules,_(this.mapToGlobalConstraintId))})).exhaustive()))}},Ih=class{mapToExplainAnswer(t){const n=Y(t).with({decisionExplanations:Xe.array(Xe.any)},r=>m(r.decisionExplanations,_(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),i=Y(t).with({constraintExplanations:Xe.array(Xe.any)},r=>m(r.constraintExplanations,_(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:i}}mapToConstraintExplanation(t){return{causedByCardinalities:m(t.causedByCardinalities,_(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:m(t.causedByRules,_(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=m(t.causedByChoiceDecisions,_(a=>this.mapToCausedByChoiceAttributeDecision(a))),i=m(t.causedByComponentDecisions,_(a=>this.mapToCausedByComponentAttributeDecision(a))),r=m(t.causedByNumericDecisions,_(a=>this.mapToCausedByNumericAttributeDecision(a))),o=m(t.causedByBooleanDecisions,_(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:m([],ve(n),ve(i),ve(r),ve(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:m(t.decisions,_(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return Y(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return Y(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToDecisionsToRespect(t.decisionsToRespect),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToFailureResult(t){return Y(t).with({type:se.ConfigurationConflict},n=>({type:gt.ConfigurationConflict,reason:Y(n.reason).with(Jl.NumericDecisionOutOfRange,()=>ru.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:se.ConfigurationApplicationError},()=>({type:gt.ConfigurationApplicationError})).with({type:se.ConfigurationUnauthenticated},()=>({type:gt.ConfigurationUnauthenticated})).with({type:se.ConfigurationModelNotFound},()=>({type:gt.ConfigurationModelNotFound})).with({type:se.ConfigurationTimeout},()=>({type:gt.ConfigurationTimeout})).with({type:se.ConfigurationAttributeNotFound},()=>({type:gt.ConfigurationAttributeNotFound})).with({type:se.ConfigurationChoiceValueNotFound},()=>({type:gt.ConfigurationChoiceValueNotFound})).with({type:se.ConfigurationSolutionNotAvailable},()=>({type:gt.ConfigurationSolutionNotAvailable})).with({type:se.ConfigurationRejectedDecisionsConflict},n=>{const i=m(n.rejectedDecisions,_(r=>this.mapToExplicitDecision(r)));return mh.createConfigurationRejectedDecisionsConflict(i)}).with({type:se.DecisionsToRespectInvalid},()=>({type:gt.DecisionsToRespectInvalid})).with({type:se.ServiceError},()=>({type:gt.ServiceError})).with({type:se.CommunicationError},()=>({type:gt.CommunicationError})).with({type:se.Unknown},()=>({type:gt.Unknown})).with({type:se.ConfigurationModelInvalid},()=>({type:gt.ConfigurationModelInvalid})).with({type:se.ConfigurationInitializationFailure},()=>({type:gt.ConfigurationInitializationFailure})).with({type:se.ConfigurationModelNotFeasible},n=>({type:gt.ConfigurationModelNotFeasible,constraintExplanations:m(n.constraintExplanations,_(i=>this.mapToConstraintExplanation(i)))})).with({type:se.ConfigurationSetManyConflict},n=>({type:gt.ConfigurationSetManyConflict,decisionExplanations:m(n.decisionExplanations,_(i=>this.mapToDecisionExplanation(i))),constraintExplanations:m(n.constraintExplanations,_(i=>this.mapToConstraintExplanation(i)))})).with({type:se.SpecifiedDeploymentForbidden},n=>({type:gt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:m(t.attributes,_(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return m(t,U(Nn(_(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:m(n.decisions,_(i=>this.mapToGlobalAttributeId(i)))})))),$n)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return Y(t).with({type:fa.Package},n=>({type:Si.Package,configurationModelPackage:n.configurationModelPackage})).with({type:fa.Channel},n=>({type:Si.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return Y(t).with({type:ce.ChoiceValue},n=>({type:he.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.state,U(i=>this.mapToChoiceValueDecisionState(i)),ft),choiceValueId:n.choiceValueId})).with({type:ce.Component},n=>({type:he.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.state,U(i=>this.mapToComponentDecisionState(i)),ft)})).with({type:ce.Numeric},n=>({type:he.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,ft)})).with({type:ce.Boolean},n=>({type:he.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,ft)})).exhaustive()}mapToCardinality(t){return Y(t).with(Qr.Cardinality,()=>Xr.Cardinality).with(Qr.Component,()=>Xr.Component).with(Qr.Rule,()=>Xr.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return Y(t).with({type:ce.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:ce.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:ce.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:ce.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:he.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:he.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:he.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:he.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return Y(t).with(vr.Mandatory,()=>ti.Mandatory).with(vr.Optional,()=>ti.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return Y(t).with({type:Le.Boolean},i=>({...n,type:he.Boolean,decision:m(i.decision,U(r=>({state:r.state,kind:this.mapToDecisionKind(r.kind)})),$n),selection:this.mapToSelection(i.selection),possibleDecisionStates:i.possibleDecisionStates})).with({type:Le.Numeric},i=>({...n,type:he.Numeric,decision:m(i.decision,U(r=>({state:r.state,kind:this.mapToDecisionKind(r.kind)})),$n),range:i.range,decimalPlaces:i.decimalPlaces,selection:this.mapToSelection(i.selection)})).with({type:Le.Choice},i=>({...n,type:he.Choice,cardinality:i.cardinality,values:m(i.values,_(r=>{const o=m(r.decision,U(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),$n);return{id:r.choiceValueId,possibleDecisionStates:m(r.possibleDecisionStates,_(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:Le.Component},i=>({...n,type:he.Component,decision:m(i.decision,U(r=>({state:this.mapToComponentDecisionState(r.state),kind:this.mapToDecisionKind(r.kind)})),$n),possibleDecisionStates:m(i.possibleDecisionStates,_(r=>this.mapToComponentDecisionState(r))),selection:m(i.selection,ee,U(r=>this.mapToSelection(r)),ft),inclusion:this.mapToInclusion(i.inclusion)})).exhaustive()}mapToInclusion(t){return Y(t).with(yr.Always,()=>Gi.Always).with(yr.Optional,()=>Gi.Optional).exhaustive()}mapToComponentDecisionState(t){return Y(t).with(Et.Included,()=>Li.Included).with(Et.Excluded,()=>Li.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return Y(t).with(Et.Included,()=>Ci.Included).with(Et.Excluded,()=>Ci.Excluded).exhaustive()}mapToDecisionKind(t){return Y(t).with(lt.Explicit,()=>ii.Explicit).with(lt.Implicit,()=>ii.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return m(t,U(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),$n)}mapToAllowedRulesInExplain(t){return m(t,U(n=>Y(n).returnType().with({type:lr.all},()=>({type:Pn.all})).with({type:lr.none},()=>({type:Pn.none})).with({type:lr.specific},i=>({type:Pn.specific,rules:m(i.rules,_(this.mapToGlobalConstraintId))})).exhaustive()),$n)}},Eh=class{constructor(t,n){this.contractToDomainMapper=new qC,this.domainToContractMapper=new Ih,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await m(this.sessionHandler.recreate(n),wt(i=>{const r=this.internalConfigurationSessionCreator(this.sessionHandler,i);return new jC(r,this.contractToDomainMapper,this.domainToContractMapper)}),$s(i=>{const r=this.domainToContractMapper.mapToFailureResult(i);return Promise.reject(r)},i=>Promise.resolve(i)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:ne,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function Yl(e){return e.possibleDecisionStates.some(t=>t===Ci.Included)}function xh(e){return!Yl(e)}const kC=Object.freeze(Object.defineProperty({__proto__:null,isAllowed:Yl,isBlocked:xh},Symbol.toStringTag,{value:"Module"}));function BC(e){return Y(e).with({type:he.Choice},t=>t.cardinality.lowerBound>0).with({type:he.Boolean},t=>t.selection===ti.Mandatory).with({type:he.Numeric},t=>t.selection===ti.Mandatory).with({type:he.Component},t=>t.inclusion===Gi.Optional&&t.selection===ti.Mandatory).exhaustive()}function UC(e){return Y(e).with({type:he.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function VC(e){return m(e.values,It(Yl))}function FC(e){return m(e.values,It(xh))}function $h(e,t){return m(e.values,Er(n=>m(n.decision,ee,St(i=>i.kind===t))))}function Ah(e){return m(e.values,It(t=>m(t.decision,ee,U(n=>n.state===Ci.Included),Ue(()=>!1))))}const LC=Ah;function Dh(e){return m(e.decision,ee,St(t=>t.kind===ii.Explicit),$n)}function Oh(e){return m(e.decision,ee,St(t=>t.kind===ii.Explicit),$n)}function GC(e,t){return e.possibleDecisionStates.some(n=>n===t)}function Nh(e){return m(e.decision,ee,$n)}function Ph(e){return Mh(e,Li.Included)}function zC(e){return!Ph(e)}function Mh(e,t){return e.possibleDecisionStates.some(n=>n===t)}const WC=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:VC,getBlockedChoiceValues:FC,getBooleanDecision:Oh,getChoiceDecisions:$h,getComponentDecision:Nh,getIncludedChoiceValues:Ah,getNumericDecision:Dh,getSelectedChoiceValues:LC,isBooleanValuePossible:GC,isComponentAllowed:Ph,isComponentBlocked:zC,isComponentStatePossible:Mh,isMandatory:BC,isMultiSelect:UC},Symbol.toStringTag,{value:"Module"})),Rh=e=>e.type===he.Boolean,_h=e=>e.type===he.Choice,jh=e=>e.type===he.Numeric,qh=e=>e.type===he.Component,HC=$a(Qe);function KC(e,t,n){var i;const r=((i=t.componentPath)==null?void 0:i.length)??0;return m(e,It(o=>{var a;const u=((a=o.id.componentPath)==null?void 0:a.length)??0;return n?r>u?!1:m(o.id.componentPath??[],Kp(t.componentPath??[]),gb(([s,c])=>s===c)):HC.equals(o.id.componentPath,t.componentPath)}))}function JC(e,t,n){return[]}function YC(e){return m(e,It(t=>{const n=m(t.id.componentPath,ee,U(r=>r.length===0),Ue(()=>!0)),i=m(t.id.sharedConfigurationModelId,ee,bi(()=>!0,()=>!1));return n&&i}))}function XC(e,t){return m(kh(e),_(n=>$h(n,t)),Ul,Er(n=>ee(n)))}function QC(e,t){return m(Uh(e),It(n=>{var i;return((i=n.decision)==null?void 0:i.kind)===t}),_(n=>Dh(n)),Er(n=>ee(n)))}function ZC(e,t){return m(Vh(e),It(n=>{var i;return((i=n.decision)==null?void 0:i.kind)===t}),_(n=>Oh(n)),Er(n=>ee(n)))}function ew(e,t){return m(Bh(e),It(n=>{var i;return((i=n.decision)==null?void 0:i.kind)===t}),_(n=>Nh(n)),Er(n=>ee(n)))}function kh(e){return m(e.attributes,It(_h))}function Bh(e){return m(e.attributes,It(qh))}function Uh(e){return m(e.attributes,It(jh))}function Vh(e){return m(e.attributes,It(Rh))}function tw(e,t){return m(Aa(e,t),ft)}function nw(e,t){return m(Fh(e,t),ft)}function iw(e,t,n){return m(Fh(e,t),U(i=>i.values),Dn(Nn(Bt(i=>i.id===n))),ft)}function rw(e,t){return m(Aa(e,t),St(jh),ft)}function ow(e,t){return m(Aa(e,t),St(Rh),ft)}function aw(e,t){return m(Aa(e,t),St(qh),ft)}function Aa(e,t){return m(e.attributes,Bt(n=>$r.equals(n.id,t)))}function Fh(e,t){return m(Aa(e,t),St(_h))}const Ar=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:KC,filterAttributesOfRoot:YC,filterAttributesOfShared:JC,getAttribute:tw,getBooleanAttribute:ow,getBooleanAttributes:Vh,getBooleanDecisions:ZC,getChoiceAttribute:nw,getChoiceAttributes:kh,getChoiceDecisions:XC,getChoiceValue:iw,getComponentAttribute:aw,getComponentAttributes:Bh,getComponentDecisions:ew,getNumericAttribute:rw,getNumericAttributes:Uh,getNumericDecisions:QC},Symbol.toStringTag,{value:"Module"})),Lh={whyIsNotSatisfied:{configuration:{question:Jt.whyIsNotSatisfied,subject:Yt.configuration},attribute:e=>({question:Jt.whyIsNotSatisfied,subject:Yt.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:Jt.whyIsStateNotPossible,subject:Yt.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:Jt.whyIsStateNotPossible,subject:Yt.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:Jt.whyIsStateNotPossible,subject:Yt.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:Jt.whyIsStateNotPossible,subject:Yt.component,attributeId:e,state:t})})}},sw=Object.freeze(Object.defineProperty({__proto__:null,explainQuestionBuilder:Lh},Symbol.toStringTag,{value:"Module"})),uw="https://spc.cloud.ceventis.de/api/engine",cw={hcaEngineBaseUrl:uw};function lw(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??cw.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function Mo(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const Gh=e=>t=>n=>m(n,lb(i=>e.equals(i,t)),U(i=>m(n,db(i,r=>t))),wc,Ue(()=>m(n,ve(hb(t))))),La=Gh({equals:(e,t)=>Ht.equals(e.attributeId,t.attributeId)}),dw=Gh({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let fw=class{constructor(t){this.restToDomainMapper=t}updateConfigurationSession(t,n){const i=this.updateConfigurationModel(t.configuration,n);return{...t,configuration:i}}updateConfigurationModel(t,n){var i,r,o,a,u,s,c,l,f;const d=m(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],_(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),p=m(((r=n.consequences)==null?void 0:r.choiceConsequences)??[],_(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),h=m(((o=n.affectedDecisions)==null?void 0:o.componentDecisions)??[],_(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),v=m(((a=n.consequences)==null?void 0:a.componentConsequences)??[],_(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),w=m(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],_(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),C=m(((s=n.consequences)==null?void 0:s.numericConsequences)??[],_(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),S=m(((c=n.affectedDecisions)==null?void 0:c.booleanDecisions)??[],_(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),T=m(((l=n.consequences)==null?void 0:l.booleanConsequences)??[],_(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),I=m([],ve(m(S,_(b=>b.attributeId))),ve(m(T,_(b=>b.attributeId))),ve(m(w,_(b=>b.attributeId))),ve(m(C,_(b=>b.attributeId))),ve(m(d,_(b=>b.attributeId))),ve(m(p,_(b=>b.attributeId))),ve(m(h,_(b=>b.attributeId))),ve(m(v,_(b=>b.attributeId))),Hr(Ht)),x=m(I,Sc(t.attributes,(b,E)=>{const P=t.attributes.find($=>Ht.equals($.attributeId,E));return Y(P).with({type:Le.Choice},($,L)=>{const R=this.mergeChoice(L,m(p,Bt(A=>Ht.equals(A.attributeId,E)),U(A=>A.payload)),m(d,It(A=>Ht.equals(A.attributeId,E)),_(A=>A.payload)));return La(R)(b)}).with({type:Le.Numeric},($,L)=>{const R=this.mergeNumeric(L,m(C,Bt(A=>Ht.equals(A.attributeId,E)),U(A=>A.payload)),m(w,Bt(A=>Ht.equals(A.attributeId,E)),U(A=>A.payload)));return La(R)(b)}).with({type:Le.Boolean},($,L)=>{const R=this.mergeBoolean(L,m(T,Bt(A=>Ht.equals(A.attributeId,E)),U(A=>A.payload)),m(S,Bt(A=>Ht.equals(A.attributeId,E)),U(A=>A.payload)));return La(R)(b)}).with({type:Le.Component},($,L)=>{const R=this.mergeComponent(L,m(v,Bt(A=>Ht.equals(A.attributeId,E)),U(A=>A.payload)),m(h,Bt(A=>Ht.equals(A.attributeId,E)),U(A=>A.payload)));return La(R)(b)}).exhaustive()}));return{...t,isSatisfied:m((f=n.consequences)==null?void 0:f.isConfigurationSatisfied,ee,Ue(()=>t.isSatisfied)),attributes:x}}mergeChoice(t,n,i){const r=m(n,U(s=>s.values??[]),Ue(()=>[])),o=m(i),a=m([],ve(m(r,_(s=>s.choiceValueId))),ve(m(o,_(s=>s.choiceValueId))),_(Mo),Hr(Qe)),u=m(a,Sc(t.values,(s,c)=>{const l=m(r,Bt(h=>h.choiceValueId===c)),f=m(o,Bt(h=>h.choiceValueId===c)),d=m(t.values.find(h=>h.choiceValueId===c),ee),p=this.mergeChoiceValue(c,d,l,f);return dw(p)(s)}));return{...t,isSatisfied:m(n,U(s=>Mo(s.isSatisfied)),Ue(()=>t.isSatisfied)),values:u}}mergeChoiceValue(t,n,i,r){const o=m(r,U(u=>({state:this.toDecisionState(Mo(u.state)),kind:this.toDecisionKind(Mo(u.kind))})),Ue(()=>({state:m(n,Dn(u=>m(u.decision,U(s=>s.state)))),kind:m(n,Dn(u=>m(u.decision,U(s=>s.kind))),Ue(()=>lt.Explicit))}))),a=m(i,U(u=>m(Wd(u.possibleDecisionStates??[]),_(s=>this.toPossibleDecisionState(s)),mn)),Ue(()=>m(n,U(u=>u.possibleDecisionStates??[]),Ue(()=>[]))));return{choiceValueId:t,decision:m(o.state,U(u=>({state:u,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,i){const r=m(i,U(a=>{const u=this.toDecisionState(Mo(a.state));return m(u,U(s=>({state:s,kind:this.toDecisionKind(a.kind)})))}),Ue(()=>m(t.decision,U(a=>({state:a.state,kind:a.kind}))))),o=m(n,U(a=>m(Wd(a.possibleDecisionStates??[]),_(u=>this.toPossibleDecisionState(u)),mn)),Ue(()=>t.possibleDecisionStates));return{...t,isSatisfied:m(n,U(a=>a.isSatisfied),Ue(()=>t.isSatisfied)),possibleDecisionStates:o,decision:r}}mergeNumeric(t,n,i){return{...t,isSatisfied:m(n,Dn(r=>ee(r.isSatisfied)),Ue(()=>t.isSatisfied)),decision:m(i,bi(()=>t.decision,r=>m(r.state,ee,U(o=>({kind:this.toDecisionKind(r.kind),state:o})))))}}mergeBoolean(t,n,i){return{...t,isSatisfied:m(n,Dn(r=>ee(r.isSatisfied)),Ue(()=>t.isSatisfied)),decision:m(i,bi(()=>t.decision,r=>m(r.state,ee,U(o=>({kind:this.toDecisionKind(r.kind),state:o}))))),possibleDecisionStates:m(n,U(r=>r.possibleDecisionStates),Ue(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return Y(t).with(mr.Included,()=>ge(Et.Included)).with(mr.Excluded,()=>ge(Et.Excluded)).otherwise(()=>ne)}toDecisionState(t){return Y(t).with(yi.Included,()=>ge(Et.Included)).with(yi.Excluded,()=>ge(Et.Excluded)).otherwise(()=>ne)}toDecisionKind(t){return Y(t).with(pa.Implicit,()=>lt.Implicit).with(pa.Explicit,()=>lt.Explicit).exhaustive()}},pw=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return Y(t).with({type:ce.ChoiceValue},n=>({type:sn.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:ce.Component},n=>({type:sn.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:ce.Numeric},n=>({type:sn.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,ft)})).with({type:ce.Boolean},n=>({type:sn.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,ft)})).exhaustive()}mapToExplicitDecisions(t,n){const i=this.mapToMode(n),r=m([...t],Ai(s=>s.type!==ce.Boolean?ne:ge({type:sn.Boolean,attributeId:this.mapToGlobalAttributeId(s.attributeId),state:m(s.value,ft)}))),o=m([...t],Ai(s=>s.type!==ce.Numeric?ne:ge({type:sn.Numeric,attributeId:this.mapToGlobalAttributeId(s.attributeId),state:m(s.value,ft)}))),a=m([...t],Ai(s=>s.type!==ce.ChoiceValue?ne:ge({type:sn.Choice,attributeId:this.mapToGlobalAttributeId(s.attributeId),choiceValueId:s.choiceValueId,state:this.mapToDecisionState(s.state)}))),u=m([...t],Ai(s=>s.type!==ce.Component?ne:ge({type:sn.Component,attributeId:this.mapToGlobalAttributeId(s.attributeId),state:this.mapToDecisionState(s.state)})));return{mode:i,choiceDecisions:a,numericDecisions:o,booleanDecisions:r,componentDecisions:u}}mapToExplicitDecisionsInner(t){const n=m([...t],Ai(a=>a.type!==Le.Boolean?ne:m(a.decision,St(u=>u.kind===lt.Explicit),U(()=>this.mapToExplicitBooleanDecision(a))))),i=m([...t],Ai(a=>a.type!==Le.Numeric?ne:m(a.decision,St(u=>u.kind===lt.Explicit),U(()=>this.mapToExplicitNumericDecision(a))))),r=m([...t],Ai(a=>a.type!==Le.Component?ne:m(a.decision,St(u=>u.kind===lt.Explicit),U(()=>this.mapToExplicitComponentDecision(a))))),o=m([...t],Ai(a=>a.type!==Le.Choice?ne:m(this.mapToExplicitChoiceDecisions(a),xa(u=>m(u,lo)))),wb);return{booleanDecisions:n,numericDecisions:i,choiceDecisions:o,componentDecisions:r}}mapToMode(t){return Y(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>this.mapToDropExistingDecisionsMode(n)).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:m(t.componentPath,ee,U(Cc),$n),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:Y(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:Xe.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:sn.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:m(t.decision,U(n=>n.state),ft)}}mapToExplicitNumericDecision(t){return{type:sn.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:m(t.decision,U(n=>n.state),ft)}}mapToExplicitComponentDecision(t){return{type:sn.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(m(t.decision,U(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(i){return m(i.decision,U(r=>r.kind===lt.Explicit),Ue(()=>!1))}return m(t.values,It(n),_(i=>({type:sn.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(m(i.decision,U(r=>r.state)))})),Cc)}mapToDecisionState(t){return m(t,U(n=>Y(n).with(Et.Included,()=>yi.Included).with(Et.Excluded,()=>yi.Excluded).exhaustive()),Ue(()=>yi.Undefined))}mapToPossibleDecisionState(t){return Y(t).with(Et.Included,()=>mr.Included).with(Et.Excluded,()=>mr.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return Y(t).with({subject:Vt.attribute},n=>({type:Mc.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:Vt.configuration},()=>({type:Mc.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return Y(t).with({subject:Vt.boolean},n=>({type:Fo.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:Vt.numeric},n=>({type:Fo.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:Vt.component},n=>({type:Fo.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:Vt.choiceValue},n=>({type:Fo.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},hw=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return m(t.configuration.attributes,Bt(n=>Y(n).with({type:Le.Boolean},i=>m(i.decision,St(r=>r.kind===lt.Explicit),Vo)).with({type:Le.Numeric},i=>m(i.decision,St(r=>r.kind===lt.Explicit),Vo)).with({type:Le.Choice},i=>m(i.values,Bt(r=>m(r.decision,U(o=>o.kind===lt.Explicit),Ue(()=>!1))),Vo)).with({type:Le.Component},i=>m(i.decision,St(r=>r.kind===lt.Explicit),Vo)).exhaustive()),bi(()=>!1,()=>!0))},getExplicitDecisions(t){return m(t.configuration.attributes,_(n=>Y(n).with({type:Le.Boolean},i=>m(i.decision,St(r=>r.kind===lt.Explicit),U(r=>({type:ce.Boolean,attributeId:i.attributeId,value:ee(r.state)})),U(r=>[r]))).with({type:Le.Numeric},i=>m(i.decision,St(r=>r.kind===lt.Explicit),U(r=>({type:ce.Numeric,attributeId:i.attributeId,value:ee(r.state)})),U(r=>[r]))).with({type:Le.Choice},i=>m(i.values,_(r=>m(r.decision,St(o=>o.kind===lt.Explicit),U(o=>({type:ce.ChoiceValue,attributeId:i.attributeId,choiceValueId:r.choiceValueId,state:ee(o.state)})))),mn,Bi)).with({type:Le.Component},i=>m(i.decision,St(r=>r.kind===lt.Explicit),U(r=>({type:ce.Component,attributeId:i.attributeId,state:ee(r.state)})),U(r=>[r]))).exhaustive()),mn,Ul)}}}},vw=class{constructor(t,n,i,r,o,a){this.engineApiClient=n,this.domainToRestMapper=r,this.restToDomainMapper=i,this.domainToContractMapper=o,this.domainUpdater=a,this.sessionHandler=t,this.interpreter=new hw}close(t){return this.sessionHandler.close(t)}recreate(t){return this.initializeInner(t,!1)}reinitialize(t){return this.initializeInner(t,!0)}makeDecision(t,n){const i=this.domainToRestMapper.mapToExplicitDecision(t);return this.withSession(n,(r,o)=>m(this.engineApiClient.makeDecision(r,i),Ln(fi),wt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,i=>{const r=Y(t).with({question:dn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,i)).with({question:dn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,i)).exhaustive();return m(r,Ln(fi),wt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,i){return this.withSession(i,(r,o)=>{const a=this.setManyInner(t,n,r);return m(a,Vn(u=>{var s,c,l,f;const d=m([],ve(m(((s=u.rejectedDecisions)==null?void 0:s.booleanDecisions)??[],_(p=>this.restToDomainMapper.mapToBooleanDecision(p)))),ve(m(((c=u.rejectedDecisions)==null?void 0:c.numericDecisions)??[],_(p=>this.restToDomainMapper.mapToNumericDecision(p)))),ve(m(((l=u.rejectedDecisions)==null?void 0:l.componentDecisions)??[],_(p=>this.restToDomainMapper.mapToComponentDecision(p)))),ve(m(((f=u.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],_(p=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(p)))));return m(d,lo)?vi($C.createConfigurationRejectedDecisionsConflict(d)):Kr(this.domainUpdater.updateConfigurationSession(o,u))}))})}replaceDecisions(t,n){const i=this.interpreter.configurationSession.getExplicitDecisions(n),r=this.setManyInner(i,{type:"DropExistingDecisions",conflictHandling:{type:"Automatic"}},t);return m(r,wt(o=>({})))}setManyInner(t,n,i){const r=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(i,r);return m(o,Ln(fi),Vn(a=>{const u={rejectedDecisions:{booleanDecisions:Xe.array(Xe.any)}},s={decisionExplanations:Xe.array(Xe.any)};return Y(a).with(u,c=>po(c)).with(s,c=>vi(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(c,r,n))).otherwise(()=>vi({type:se.Unknown}))}))}explainWhyStateNotPossible(t,n){const i=this.domainToRestMapper.mapToWhyStateNotPossibleRequest(t);return this.engineApiClient.getWhyStateNotPossible(n,i)}explainWhyNotSatisfied(t,n){const i=this.domainToRestMapper.mapToWhyNotSatisfiedRequest(t);return this.engineApiClient.getWhyNotSatisfied(n,i)}withSession(t,n){return m(Kr(t),Vn(i=>m(i.sessionId,bi(()=>this.initializeInner(i,!1),()=>Kr(i)))),Vn(i=>m(i.sessionId,Gl(()=>({type:se.ConfigurationUnauthenticated})),Vn(r=>n(r,i)))))}initializeInner(t,n){return m(Zb,()=>m(t.sessionId,cS,dS(u=>n?uS(u):m(this.sessionHandler.close(u),$s(()=>ne,()=>ne)))),u=>{const s=this.domainToContractMapper.mapToSessionContext(t.context);return m(u,Hb(()=>({type:se.ConfigurationUnauthenticated})),ih(()=>this.sessionHandler.create(s)))},u=>m(u,eS(s=>m(Bi(t),St(this.interpreter.configurationSession.hasExplicitDecisions),U(c=>this.replaceDecisions(s,c)),Ue(()=>Kr({}))))),u=>m(u,Vn(s=>{const c=this.determineConsequences(s),l=this.determineDecisions(s),f=$g(Yb)({consequences:c,decisions:l});return m(f,wt(({decisions:d,consequences:p})=>this.restToDomainMapper.mapToConfigurationModel(d,p)),wt(d=>({sessionId:Bi(s),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return m(this.engineApiClient.getDecisions(t),Ln(fi))}determineConsequences(t){return m(this.engineApiClient.getConsequence(t),Ln(fi))}},yw=class{constructor(t,n){this.onConfigurationChangedHandler=ne,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return m(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return m(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:ne}}restoreConfiguration(t){return m(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return m(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return m(this.configurationSession.sessionId,U(t=>this.sessionHandler.close(t)),U(Nn(wt(t=>{this.configurationSession={...this.configurationSession,sessionId:ne}}))),Ue(Js(hC())))}applySolution(t){return m(this.configurationSession.solutions,Bt(n=>EC.equals(n,t)),Gl(()=>({type:se.ConfigurationSolutionNotAvailable})),wt(n=>n.decisions),Vn(n=>this.setMany(n,t.mode)))}setMany(t,n){return m(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),As(i=>()=>{const r=Y(i).with({decisionExplanations:Xe.array(Xe.any)},o=>ge(o.decisionExplanations)).otherwise(()=>ne);this.configurationSession={...this.configurationSession,solutions:m(r,U(Nn(_(o=>o.solution))),Ue(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=Y(t).with({decisionExplanations:Xe.array(Xe.any)},i=>i.decisionExplanations).otherwise(()=>[]);return m(n,_(i=>i.solution))}invalidateAvailableSolutions(){return nS(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return As(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return ua(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Nn(ua(t=>()=>{this.configurationSession=t,m(this.onConfigurationChangedHandler,rS(n=>()=>n(this.configurationSession.configuration)))}),wt(t=>t.configuration),this.invalidateAvailableSolutions())}},mw=class{constructor(t){this.inner=t;const n=3,i=2e3,r=200;this.policy=ZS(i,XS.concat(eC(r),QS(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Nr(this.policy,n,i=>m(i,tr(r=>this.determineAndPrepareRetry(r),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Nr(this.policy,n,i=>m(i,tr(r=>this.determineAndPrepareRetry(r),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Nr(this.policy,n,i=>m(i,tr(r=>this.determineAndPrepareRetry(r),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Nr(this.policy,n,i=>m(i,tr(r=>this.determineAndPrepareRetry(r),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Nr(this.policy,n,i=>m(i,tr(r=>this.determineAndPrepareRetry(r),()=>!1)))}setMany(t,n){const i=()=>this.inner.setMany(t,n);return Nr(this.policy,i,r=>m(r,tr(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return Y(t).with({type:se.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:se.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},gw=class{constructor(){this.queue=[],this.operating=ne}push(t){const n=new bw(t);return this.queue.push(n),this.operating=m(this.operating,Ue(()=>this.start()),Bi),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=m(t,_(i=>i.argument),Sc(ne,(i,r)=>this.reduce(i,r)),U(Nn(i=>this.execute(i),i=>i.then(r=>{m(t,_(o=>{o.resolve(r)}))}).catch(r=>{m(t,_(o=>{o.reject(r)}))}))),ft);n&&await n}this.operating=ne}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},bw=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,i)=>{this.resolve=n,this.reject=i})}},Sw=class extends gw{constructor(t){super(),this.inner=t}reduce(t,n){return ge(n)}async execute(t){return await this.inner.setSessionContext(t)()}},Cw=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new Sw(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(gC.equals(n,t))return po(this.getConfiguration());const i=this.setContextReducingTaskExecutor.push(t);return()=>i}applySolution(t){return this.inner.applySolution(t)}close(){return this.inner.close()}makeDecision(t){return this.inner.makeDecision(t)}restoreConfiguration(t){return this.inner.restoreConfiguration(t)}setMany(t,n){return this.inner.setMany(t,n)}explain(t){return this.inner.explain(t)}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}},ww=class{constructor(t,n=!1){this.stringify=n,this.inner=t,this.durationNumberFormat=new Intl.NumberFormat("en-EN",{maximumFractionDigits:3})}withLogging(t,n,i){const r=performance.now(),o=()=>{const a=performance.now()-r;return this.durationNumberFormat.format(a)};return console.debug(`Operation ${t} started with`,this.renderAsRequired(n)),m(i(),As(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),ua(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with success`,this.renderAsRequired(a))}))}renderAsRequired(t){return this.stringify?JSON.stringify(t,null,2):t}explain(t){return this.withLogging("explain",[t],()=>this.inner.explain(t))}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){return this.withLogging("setSessionContext",[t],()=>this.inner.setSessionContext(t))}applySolution(t){return this.withLogging("applySolution",[t],()=>this.inner.applySolution(t))}close(){return this.inner.close()}makeDecision(t){return this.withLogging("makeDecision",[t],()=>this.inner.makeDecision(t))}restoreConfiguration(t){return this.withLogging("restoreConfiguration",[t],()=>this.inner.restoreConfiguration(t))}setMany(t,n){return this.withLogging("setMany",[t,n],()=>this.inner.setMany(t,n))}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}},Tw=class zh{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+vh()}static new(t){return new zh(t)}close(){return this.executeTaskSynchronous(()=>this.inner.close())}restoreConfiguration(t){return this.executeTaskSynchronous(()=>this.inner.restoreConfiguration(t))}setSessionContext(t){return this.executeTaskSynchronous(()=>this.inner.setSessionContext(t))}invalidateSessionId(){return this.inner.invalidateSessionId()}makeDecision(t){return this.executeTaskSynchronous(()=>this.inner.makeDecision(t))}applySolution(t){return this.executeTaskSynchronous(()=>this.inner.applySolution(t))}setMany(t,n){return this.executeTaskSynchronous(()=>this.inner.setMany(t,n))}explain(t){return this.executeTaskSynchronous(()=>this.inner.explain(t))}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}getConfiguration(){return this.inner.getConfiguration()}getSessionContext(){return this.inner.getSessionContext()}executeTaskSynchronous(t){return()=>navigator.locks.request(this.lockName,{mode:"exclusive"},()=>t()())}};function Iw(e){e=lw(e);const t=new _C(e.hcaEngineBaseUrl),n=new wh,i=new pw,r=new Ih,o=new gh,a=new fw(n),u=Y(e.sessionHandler).with({create:Xe.any,close:Xe.any},l=>l).with({accessToken:Xe.string},l=>new Sh(t,o,n,l)).with({sessionCreateUrl:Xe.string,sessionDeleteUrl:Xe.string},l=>new Th(o,l)).exhaustive(),s=new vw(u,t,n,i,r,a),c=(l,f)=>m(new yw(l,f),d=>new mw(d),d=>new Cw(d),Tw.new,d=>new ww(d,!1));return new Eh(s,c)}const Rc=$r.equals,Ew=Kl.equals,xw=yh.equals,$w=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:Pn,AttributeInterpreter:WC,AttributeType:he,ChoiceValueDecisionState:Ci,ChoiceValueInterpreter:kC,ClientSideSessionLifetimeHandler:Sh,ComponentDecisionState:Li,ConfigurationConflictReason:ru,ConfigurationInterpreter:Ar,ConfigurationModelSourceType:Si,ConfiguratorClient:Eh,ConstraintType:Xr,ContractToRestMapper:gh,DecisionKind:ii,ExplainQuestionSubject:Yt,ExplainQuestionType:Jt,FailureType:gt,Inclusion:Gi,QuestionBuilder:sw,Results:fC,Selection:ti,ServerSideSessionLifetimeHandler:Th,Types:dC,causedByDecisionEquals:xw,createClient:Iw,explainQuestionBuilder:Lh,globalAttributeIdEquals:Rc,globalConstraintIdEquals:Ew},Symbol.toStringTag,{value:"Module"}));/*! *****************************************************************************
|
|
4
|
+
${JSON.stringify(e,null,2)}`)}var Is=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(Is||{}),Gb=(e=>(e.BooleanAttributeNotFound="BooleanAttributeNotFound",e.ChoiceAttributeNotFound="ChoiceAttributeNotFound",e.ChoiceValueNotFound="ChoiceValueNotFound",e.ConfigurationInitializationFailure="InitializationFailure",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.LegacyConfigurationModelInvalid="DeploymentStore.Core.Store.SnapshotInvalid",e.LegacySnapshotInvalid="SnapshotInvalid",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConflictWithConsequence="ConflictWithConsequence",e.DecisionInvalid="DecisionInvalid",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.NumericAttributeNotFound="NumericAttributeNotFound",e.NumericDecisionOutOfRange="NumericDecisionOutOfRange",e.SessionNotFound="SessionNotFound",e.SetDecisionConflict="SetDecisionConflict",e.Unauthorized="Unauthorized",e.AuthenticationFailure="AuthenticationFailure",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(Gb||{});const JI=e=>Object.values(Gb).includes(e),QI=e=>JI(e)?Me(e):ge;function ZI(e){const t=n=>ue(n).with("ConfigurationModelNotFound",()=>({type:we.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:we.DecisionsToRespectInvalid})).with(Tt.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:we.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:we.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:we.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:we.ConfigurationConflict,reason:mh.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:we.ConfigurationConflict})).with(Tt.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:we.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:we.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:we.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:we.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:we.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:we.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:we.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:we.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return m(e.type,QI,Z(t))}const eA=e=>Object.values(Is).includes(e),tA=e=>eA(e)?Me(e):ge;function nA(e){return m(e,tA,Z(n=>ue(n).with("Generic::LocalClientError",()=>({type:we.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:we.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:we.CommunicationError})).with("Generic::Unauthorized",()=>({type:we.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:we.Unknown})).exhaustive()))}function Vr(e,t){XI(e,t);const n=e.type;return m(ge,Yv(()=>ZI(e)),Yv(()=>nA(n)),Ye(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:we.Unknown})))}let zb=class{constructor(t,n,r,i){this.engineApiClient=t,this.contractToRestMapper=n,this.restToDomainMapper=r,this.options=i}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t);return m(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),yr(r=>Vr(r,"ClientSideSessionLifetimeHandler - create")),vr(r=>this.restToDomainMapper.mapToSessionId(r)),MI(()=>({type:we.ConfigurationUnauthenticated})))}close(t){return m(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),yr(n=>Vr(n,"ClientSideSessionLifetimeHandler - close")),Kt(()=>Br()))}};var Wb=(e=>(e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e))(Wb||{});function qr(e,t,n){const r=m(Array.isArray(e)?e:[e],gI);return m(Xv(()=>fetch(r,t),i=>({type:"error"})),vr(i=>m(Xv(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),$b(i=>i.status===401?Wr({type:Is.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?Ra({response:i,data:{}}):i.type==="error"?Wr({type:Is.LowLevelCommunicationError}):Wr({type:Is.UnhandledResponseStatus})),vr(i=>m(n(i),fh(()=>i.data))))}function Td(e,t){return qr(e,t,n=>{if(n.response.status===200)return Ii(n.data);if(n.response.status===409){const r=n.data;return ue(r).with({type:"ConfigurationModelInvalid"},i=>Ii(r)).with({type:"ConfigurationModelNotFeasible"},i=>Ii(r)).otherwise(()=>ge)}return ge})}let rA=class{constructor(t){this.baseUrl=t}createSessionUsingApiKey(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-API-KEY":n},body:JSON.stringify(t)};return Td([this.baseUrl,"v2/session"],r)}createSessionUsingJwtBearer(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify(t)};return Td([this.baseUrl,"v2/session"],r)}setMany(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return qr([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?Me(i.data):ge)}makeDecision(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return qr([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?Me(i.data):ge)}getDecisions(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return qr([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?Me(r.data):ge)}getWhyStateNotPossible(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return qr([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?Me(i.data):ge)}getWhyNotSatisfied(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return qr([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?Me(i.data):ge)}getConsequence(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return qr([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?Me(r.data):ge)}deleteSessionUsingJwtBearer(t,n){const r={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return qr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?Me({}):ge)}};var So=(e=>(e.Included="Included",e.Excluded="Excluded",e))(So||{}),Id=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Id||{}),Ad=(e=>(e.Always="Always",e.Optional="Optional",e))(Ad||{}),Bs=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Bs||{}),Hr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Hr||{}),Fn=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(Fn||{}),$d=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))($d||{}),Od=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(Od||{}),ds=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(ds||{});const _n=mt({localId:xe,componentPath:$l(xe),sharedConfigurationModelId:hh(xe)});let Hb=class{mapToDecisions(t){return{}}mapToSessionId(t){return ue(t).with({sessionId:Tt.string},n=>Ra(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=m(n.constraintExplanations,G(i=>this.mapToConstraintExplanation(i)));return Wr({type:we.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Wr({type:we.ConfigurationModelInvalid})).otherwise(()=>Wr({type:we.Unknown}))}mapToExplainAnswer(t,n){const r=ue(n).with({question:Gn.whyIsStateNotPossible,subject:dn.boolean},a=>[{type:Te.Boolean,attributeId:a.attributeId,value:Me(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:dn.numeric},a=>[{type:Te.Numeric,attributeId:a.attributeId,value:Me(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:dn.component},a=>[{type:Te.Component,attributeId:a.attributeId,state:Me(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:dn.choiceValue},a=>[{type:Te.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:Me(a.state)}]).otherwise(()=>[]),i=m(t.decisionExplanations,G(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=m(t.constraintExplanations,G(a=>this.mapToConstraintExplanation(a)));return ue(n).with({answerType:fo.decisions},()=>({decisionExplanations:i})).with({answerType:fo.constraints},()=>({constraintExplanations:o})).with({answerType:fo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:we.ConfigurationSetManyConflict,decisionExplanations:m(t.decisionExplanations,G(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:m(t.constraintExplanations,G(o=>this.mapToConstraintExplanation(o)))}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModel(t,n){const r=this.mapToAttributes(t,n);return{isSatisfied:n.isConfigurationSatisfied??!1,attributes:r}}mapToBooleanDecision(t){return{type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:he(t.state)}}mapToNumericDecision(t){return{type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:he(t.state)}}mapToComponentDecision(t){return{type:Te.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToDecisionState(t.state)}}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModel:t.sharedConfigurationModelId,componentPath:t.componentPath??[]}}mapToChoiceValueDecision(t){return m(this.mapToDecisionState(t.state),Z(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:m(t.causedByRules,G(n=>this.mapToRuleConstraint(n))),causedByCardinalities:m(t.causedByCardinalities,G(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:va.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:va.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=m(t.booleanDecisions??[],G(a=>({type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:he(a.state)}))),r=m(t.numericDecisions??[],G(a=>({type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:he(a.state)}))),i=m(t.componentDecisions??[],G(a=>({type:Te.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:m(he(a.state),Z(s=>this.mapToDecisionState(s)),bd)}))),o=m(t.choiceDecisions??[],G(a=>({type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:m(he(a.state),Z(s=>this.mapToDecisionState(s)),bd)})));return m([],Ne(n),Ne(r),Ne(i),Ne(o))}mapToDecisionExplanation(t,n,r){const i=m(t.causedByBooleanDecisions,G(h=>this.mapToCausedByBooleanDecision(h))),o=m(t.causedByNumericDecisions,G(h=>this.mapToCausedByNumericDecision(h))),a=m(t.causedByComponentDecisions,G(h=>this.mapToCausedByComponentDecision(h))),s=m(t.causedByChoiceDecisions,G(h=>this.mapToCausedByChoiceValueDecision(h))),u=m(i,G(h=>({type:Te.Boolean,attributeId:h.attributeId,value:ge}))),c=m(o,G(h=>({type:Te.Numeric,attributeId:h.attributeId,value:ge}))),l=m(a,G(h=>({type:Te.Component,attributeId:h.attributeId,state:ge}))),f=m(s,G(h=>({type:Te.ChoiceValue,attributeId:h.attributeId,choiceValueId:h.choiceValueId,state:ge}))),d=m([],Ne(u),Ne(c),Ne(l),Ne(f)),p=wb(an((h,v)=>{const C=bn.equals(h.attributeId,v.attributeId);return ue({a:h,b:v}).with({a:{type:Te.ChoiceValue},b:{type:Te.ChoiceValue}},E=>C&&E.a.choiceValueId===E.b.choiceValueId).otherwise(()=>C)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:m([],Ne(d),Ne(p)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return ue(t).with($d.NotAvailable,()=>Ed.NotAvailable).with($d.StateNotPossible,()=>Ed.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:Te.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToAttributes(t,n){function r(d){return m(n.canAttributeContributeToConfigurationSatisfaction,Wt(p=>_n.equals(p,d)),fs)}const i=m([],Ne(m(t.choiceValueDecisions,G(d=>d.attributeId))),Ne(m(n.choiceConsequences,G(d=>d.attributeId))),sa(_n)),o=m(i,G(d=>{const p=m(t.choiceValueDecisions??[],zE(v=>_n.equals(v.attributeId,d))),h=m(n.choiceConsequences??[],Xi(v=>_n.equals(v.attributeId,d)));return m(h,Z(v=>this.mapToChoiceAttributes(v,p,r(d))))}),Kn),a=m([],Ne(m(t.numericDecisions,G(d=>d.attributeId))),Ne(m(n.numericConsequences,G(d=>d.attributeId))),sa(_n)),s=m(a,G(d=>{const p=m(t.numericDecisions??[],Xi(v=>_n.equals(v.attributeId,d))),h=m(n.numericConsequences??[],Xi(v=>_n.equals(v.attributeId,d)));return m(h,Z(v=>this.mapToNumericAttribute(v,p,r(d))))}),Kn),u=m([],Ne(m(t.booleanDecisions,G(d=>d.attributeId))),Ne(m(n.booleanConsequences,G(d=>d.attributeId))),sa(_n)),c=m(u,G(d=>{const p=m(t.booleanDecisions??[],Xi(v=>_n.equals(v.attributeId,d))),h=m(n.booleanConsequences??[],Xi(v=>_n.equals(v.attributeId,d)));return m(h,Z(v=>this.mapToBooleanAttribute(v,p,r(d))))}),Kn),l=m([],Ne(m(t.componentDecisions,G(d=>d.attributeId))),Ne(m(n.componentConsequences,G(d=>d.attributeId))),sa(_n)),f=m(l,G(d=>{const p=m(t.componentDecisions??[],Xi(v=>_n.equals(v.attributeId,d))),h=m(n.componentConsequences??[],Xi(v=>_n.equals(v.attributeId,d)));return m(h,Z(v=>this.mapToComponentAttribute(v,p,r(d))))}),Kn);return m([],Ne(o),Ne(f),Ne(s),Ne(c))}mapToComponentAttribute(t,n,r){return{type:ct.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:m(t.possibleDecisionStates,dc(i=>this.mapToPossibleDecisionState(i))),decision:m(n,Yn(i=>m(this.mapToDecisionState(i.state),Z(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:m(t.selection,he,Z(i=>this.mapToSelection(i)),dt),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=m(t.values,dc(o=>{const a=m(n,Wt(s=>s.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:ct.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(t,n,r){return{type:ct.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:m(n,Yn(i=>m(i.state,he,Z(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(t,n,r){return{type:ct.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,range:{min:t.range.min,max:t.range.max},selection:this.mapToSelection(t.selection),decimalPlaces:t.decimalPlaces,decision:m(n,Yn(i=>m(i.state,he,Z(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=m(t.possibleDecisionStates,dc(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:m(n,Yn(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return ue(t).with(Bs.Implicit,()=>Mt.Implicit).with(Bs.Explicit,()=>Mt.Explicit).exhaustive()}mapToDecisionState(t){return ue(t).with(Hr.Included,()=>Me(Xt.Included)).with(Hr.Excluded,()=>Me(Xt.Excluded)).with(Hr.Undefined,()=>ge).exhaustive()}mapToPossibleDecisionState(t){return ue(t).with(So.Included,()=>Xt.Included).with(So.Excluded,()=>Xt.Excluded).exhaustive()}mapToSelection(t){return ue(t).with(Id.Mandatory,()=>go.Mandatory).with(Id.Optional,()=>go.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(Ad.Always,()=>bo.Always).with(Ad.Optional,()=>bo.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},Kb=class{constructor(t,n){this.restToDomainMapper=new Hb,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=Td(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return m(r,yr(i=>Vr(i,"ServerSideSessionLifetimeHandler - create")),vr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return m(qr(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===Wb.NoContent?Me({}):ge),yr(n=>Vr(n,"ServerSideSessionLifetimeHandler - close")),Kt(Br))}};const yh={whyIsNotSatisfied:{configuration:{question:Tn.whyIsNotSatisfied,subject:In.configuration},attribute:e=>({question:Tn.whyIsNotSatisfied,subject:In.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:Tn.whyIsStateNotPossible,subject:In.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:Tn.whyIsStateNotPossible,subject:In.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:Tn.whyIsStateNotPossible,subject:In.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:Tn.whyIsStateNotPossible,subject:In.component,attributeId:e,state:t})})}},iA=Object.freeze(Object.defineProperty({__proto__:null,explainQuestionBuilder:yh},Symbol.toStringTag,{value:"Module"}));let oA=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=ge}setOnConfigurationChangedHandler(t){const n=m(t,he,Z(r=>i=>{const o=this.domainToContractMapper.mapToConfiguration(i);r(o)}));this.inner.setOnConfigurationChangedHandler(n)}getConfiguration(){const t=this.inner.getConfiguration();return this.domainToContractMapper.mapToConfiguration(t)}getSessionContext(){const t=this.inner.getSessionContext();return this.domainToContractMapper.mapToSessionContext(t)}async setSessionContext(t){const n=this.contractToDomainMapper.mapToSessionContext(t);return await m(this.inner.setSessionContext(n),Kt(Br),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await m(this.inner.restoreConfiguration(n),Kt(Br),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await m(this.inner.makeDecision(n),Kt(Br),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await m(this.inner.setMany(r,i),Kt(Br),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await m(this.inner.applySolution(n),Kt(Br),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(yh):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await m(this.inner.explain(i),Kt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await m(this.inner.close(),yr(t=>this.domainToContractMapper.mapToFailureResult(t)),_c(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return jn(yr(t=>this.domainToContractMapper.mapToFailureResult(t)),_c(t=>Promise.reject(t),t=>Promise.resolve(t)))}},aA=class{mapToExplainQuestion(t,n){const r={answerType:ue(n).with("decisions",()=>fo.decisions).with("constraints",()=>fo.constraints).with("full",()=>fo.all).exhaustive()};return ue(t).with({question:Tn.whyIsNotSatisfied,subject:In.configuration},i=>({...r,question:Gn.whyIsNotSatisfied,subject:dn.configuration})).with({question:Tn.whyIsNotSatisfied,subject:In.attribute},i=>({...r,question:Gn.whyIsNotSatisfied,subject:dn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:Tn.whyIsStateNotPossible,subject:In.choiceValue},i=>({...r,question:Gn.whyIsStateNotPossible,subject:dn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:Tn.whyIsStateNotPossible,subject:In.component},i=>({...r,question:Gn.whyIsStateNotPossible,subject:dn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:Tn.whyIsStateNotPossible,subject:In.numeric},i=>({...r,question:Gn.whyIsStateNotPossible,subject:dn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:Tn.whyIsStateNotPossible,subject:In.boolean},i=>({...r,question:Gn.whyIsStateNotPossible,subject:dn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:m(t.attributes,G(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return m(t,G(n=>this.mapToAttributeDecision(n)))}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),decisionsToRespect:this.mapToDecisionsToRespect(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToAttributeDecision(t){return ue(t).with({type:Xe.Choice,choiceValueId:Tt.string},n=>({type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:Xe.Numeric},n=>({type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:he(n.state)})).with({type:Xe.Boolean},n=>({type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:he(n.state)})).with({type:Xe.Component},n=>({type:Te.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(he(n.state),Yn(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return m(he(t),Z(n=>m(n,G(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:m(r.decisions,G(i=>this.mapToGlobalAttributeId(i)))})))))}mapToMode(t){return ue(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).exhaustive()}mapToConflictHandling(t){return ue(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath??[],sharedConfigurationModel:t.sharedConfigurationModelId}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return ue(t).with({type:Jr.Package},n=>({type:Ls.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Jr.Channel},n=>({type:Ls.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:m(t.decisions,G(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return ue(t).with({type:Xe.Boolean},n=>({type:ct.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:m(n.decision,he,Z(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Xe.Numeric},n=>({type:ct.Numeric,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,range:{min:n.range.min,max:n.range.max},decimalPlaces:n.decimalPlaces,selection:this.mapToSelection(n.selection),decision:m(n.decision,he,Z(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Xe.Choice},n=>({type:ct.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:m(n.values,G(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Xe.Component},n=>({type:ct.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:m(n.decision,he,Yn(r=>m(this.mapToDecisionStateOption(r.state),Z(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:m(n.possibleDecisionStates,G(r=>this.mapToDecisionStateOption(r)),Kn),selection:m(n.selection,he,Z(r=>this.mapToSelection(r)),dt),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:m(t.possibleDecisionStates,G(n=>this.mapToDecisionStateOption(n)),Kn)}}mapToChoiceValueDecision(t){return m(t.decision,he,Yn(n=>m(this.mapToDecisionStateOption(n.state),Z(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return ue(t).with(Zr.Implicit,()=>Mt.Implicit).with(Zr.Explicit,()=>Mt.Explicit).exhaustive()}mapToSelection(t){return ue(t).with(Dr.Mandatory,()=>go.Mandatory).with(Dr.Optional,()=>go.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(Ri.Always,()=>bo.Always).with(Ri.Optional,()=>bo.Optional).exhaustive()}mapToDecisionState(t){return ue(t).with(Tt.union(Qr.Included,Pi.Included),()=>Xt.Included).with(Tt.union(Qr.Excluded,Pi.Excluded),()=>Xt.Excluded).exhaustive()}mapToDecisionStateOption(t){return m(he(t),Z(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return m(t,he,Z(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return m(t,he,Z(n=>ue(n).returnType().with({type:ar.all},()=>({type:po.all})).with({type:ar.none},()=>({type:po.none})).with({type:ar.specific},r=>({type:po.specific,rules:m(r.rules,G(this.mapToGlobalConstraintId))})).exhaustive()))}},Yb=class{mapToExplainAnswer(t){const n=ue(t).with({decisionExplanations:Tt.array(Tt.any)},i=>m(i.decisionExplanations,G(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=ue(t).with({constraintExplanations:Tt.array(Tt.any)},i=>m(i.constraintExplanations,G(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:m(t.causedByCardinalities,G(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:m(t.causedByRules,G(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=m(t.causedByChoiceDecisions,G(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=m(t.causedByComponentDecisions,G(a=>this.mapToCausedByComponentAttributeDecision(a))),i=m(t.causedByNumericDecisions,G(a=>this.mapToCausedByNumericAttributeDecision(a))),o=m(t.causedByBooleanDecisions,G(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:m([],Ne(n),Ne(r),Ne(i),Ne(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:m(t.decisions,G(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return ue(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return ue(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToDecisionsToRespect(t.decisionsToRespect),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToFailureResult(t){return ue(t).with({type:we.ConfigurationConflict},n=>({type:Gt.ConfigurationConflict,reason:ue(n.reason).with(mh.NumericDecisionOutOfRange,()=>Ol.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:we.ConfigurationApplicationError},()=>({type:Gt.ConfigurationApplicationError})).with({type:we.ConfigurationUnauthenticated},()=>({type:Gt.ConfigurationUnauthenticated})).with({type:we.ConfigurationModelNotFound},()=>({type:Gt.ConfigurationModelNotFound})).with({type:we.ConfigurationTimeout},()=>({type:Gt.ConfigurationTimeout})).with({type:we.ConfigurationAttributeNotFound},()=>({type:Gt.ConfigurationAttributeNotFound})).with({type:we.ConfigurationChoiceValueNotFound},()=>({type:Gt.ConfigurationChoiceValueNotFound})).with({type:we.ConfigurationSolutionNotAvailable},()=>({type:Gt.ConfigurationSolutionNotAvailable})).with({type:we.ConfigurationRejectedDecisionsConflict},n=>{const r=m(n.rejectedDecisions,G(i=>this.mapToExplicitDecision(i)));return Vb.createConfigurationRejectedDecisionsConflict(r)}).with({type:we.DecisionsToRespectInvalid},()=>({type:Gt.DecisionsToRespectInvalid})).with({type:we.ServiceError},()=>({type:Gt.ServiceError})).with({type:we.CommunicationError},()=>({type:Gt.CommunicationError})).with({type:we.Unknown},()=>({type:Gt.Unknown})).with({type:we.ConfigurationModelInvalid},()=>({type:Gt.ConfigurationModelInvalid})).with({type:we.ConfigurationInitializationFailure},()=>({type:Gt.ConfigurationInitializationFailure})).with({type:we.ConfigurationModelNotFeasible},n=>({type:Gt.ConfigurationModelNotFeasible,constraintExplanations:m(n.constraintExplanations,G(r=>this.mapToConstraintExplanation(r)))})).with({type:we.ConfigurationSetManyConflict},n=>({type:Gt.ConfigurationSetManyConflict,decisionExplanations:m(n.decisionExplanations,G(r=>this.mapToDecisionExplanation(r))),constraintExplanations:m(n.constraintExplanations,G(r=>this.mapToConstraintExplanation(r)))})).with({type:we.SpecifiedDeploymentForbidden},n=>({type:Gt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:m(t.attributes,G(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return m(t,Z(jn(G(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:m(n.decisions,G(r=>this.mapToGlobalAttributeId(r)))})))),En)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return ue(t).with({type:Ls.Package},n=>({type:Jr.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Ls.Channel},n=>({type:Jr.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return ue(t).with({type:Te.ChoiceValue},n=>({type:Xe.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.state,Z(r=>this.mapToChoiceValueDecisionState(r)),dt),choiceValueId:n.choiceValueId})).with({type:Te.Component},n=>({type:Xe.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.state,Z(r=>this.mapToComponentDecisionState(r)),dt)})).with({type:Te.Numeric},n=>({type:Xe.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,dt)})).with({type:Te.Boolean},n=>({type:Xe.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,dt)})).exhaustive()}mapToCardinality(t){return ue(t).with(va.Cardinality,()=>ha.Cardinality).with(va.Component,()=>ha.Component).with(va.Rule,()=>ha.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return ue(t).with({type:Te.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:Te.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:Te.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:Te.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:Xe.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:Xe.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:Xe.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:Xe.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return ue(t).with(go.Mandatory,()=>Dr.Mandatory).with(go.Optional,()=>Dr.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return ue(t).with({type:ct.Boolean},r=>({...n,type:Xe.Boolean,decision:m(r.decision,Z(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),En),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ct.Numeric},r=>({...n,type:Xe.Numeric,decision:m(r.decision,Z(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),En),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ct.Choice},r=>({...n,type:Xe.Choice,cardinality:r.cardinality,values:m(r.values,G(i=>{const o=m(i.decision,Z(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),En);return{id:i.choiceValueId,possibleDecisionStates:m(i.possibleDecisionStates,G(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ct.Component},r=>({...n,type:Xe.Component,decision:m(r.decision,Z(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),En),possibleDecisionStates:m(r.possibleDecisionStates,G(i=>this.mapToComponentDecisionState(i))),selection:m(r.selection,he,Z(i=>this.mapToSelection(i)),dt),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return ue(t).with(bo.Always,()=>Ri.Always).with(bo.Optional,()=>Ri.Optional).exhaustive()}mapToComponentDecisionState(t){return ue(t).with(Xt.Included,()=>Pi.Included).with(Xt.Excluded,()=>Pi.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return ue(t).with(Xt.Included,()=>Qr.Included).with(Xt.Excluded,()=>Qr.Excluded).exhaustive()}mapToDecisionKind(t){return ue(t).with(Mt.Explicit,()=>Zr.Explicit).with(Mt.Implicit,()=>Zr.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return m(t,Z(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),En)}mapToAllowedRulesInExplain(t){return m(t,Z(n=>ue(n).returnType().with({type:po.all},()=>({type:ar.all})).with({type:po.none},()=>({type:ar.none})).with({type:po.specific},r=>({type:ar.specific,rules:m(r.rules,G(this.mapToGlobalConstraintId))})).exhaustive()),En)}},Xb=class{constructor(t,n){this.contractToDomainMapper=new aA,this.domainToContractMapper=new Yb,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await m(this.sessionHandler.recreate(n),Kt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new oA(i,this.contractToDomainMapper,this.domainToContractMapper)}),_c(r=>{const i=this.domainToContractMapper.mapToFailureResult(r);return Promise.reject(i)},r=>Promise.resolve(r)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:ge,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function gh(e){return e.possibleDecisionStates.some(t=>t===Qr.Included)}function Jb(e){return!gh(e)}const sA=Object.freeze(Object.defineProperty({__proto__:null,isAllowed:gh,isBlocked:Jb},Symbol.toStringTag,{value:"Module"}));function uA(e){return ue(e).with({type:Xe.Choice},t=>t.cardinality.lowerBound>0).with({type:Xe.Boolean},t=>t.selection===Dr.Mandatory).with({type:Xe.Numeric},t=>t.selection===Dr.Mandatory).with({type:Xe.Component},t=>t.inclusion===Ri.Optional&&t.selection===Dr.Mandatory).exhaustive()}function cA(e){return ue(e).with({type:Xe.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function lA(e){return m(e.values,ft(gh))}function fA(e){return m(e.values,ft(Jb))}function Qb(e,t){return m(e.values,cr(n=>m(n.decision,he,wt(r=>r.kind===t))))}function Zb(e){return m(e.values,ft(t=>m(t.decision,he,Z(n=>n.state===Qr.Included),Ye(()=>!1))))}const dA=Zb;function eS(e){return m(e.decision,he,wt(t=>t.kind===Zr.Explicit),En)}function tS(e){return m(e.decision,he,wt(t=>t.kind===Zr.Explicit),En)}function pA(e,t){return e.possibleDecisionStates.some(n=>n===t)}function nS(e){return m(e.decision,he,En)}function rS(e){return iS(e,Pi.Included)}function hA(e){return!rS(e)}function iS(e,t){return e.possibleDecisionStates.some(n=>n===t)}const vA=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:lA,getBlockedChoiceValues:fA,getBooleanDecision:tS,getChoiceDecisions:Qb,getComponentDecision:nS,getIncludedChoiceValues:Zb,getNumericDecision:eS,getSelectedChoiceValues:dA,isBooleanValuePossible:pA,isComponentAllowed:rS,isComponentBlocked:hA,isComponentStatePossible:iS,isMandatory:uA,isMultiSelect:cA},Symbol.toStringTag,{value:"Module"})),oS=e=>e.type===Xe.Boolean,aS=e=>e.type===Xe.Choice,sS=e=>e.type===Xe.Numeric,uS=e=>e.type===Xe.Component,mA=lu(xe),um=xr(xe);function cS(e,t){const n=a=>mA.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return m(n,WE(t?a=>um.equals(m(a.componentPath??[],DE(r)),e.componentPath):a=>um.equals(a.componentPath??[],e.componentPath)))}function yA(e,t,n){const r=m(cS({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:m(t.componentPath??[],$E(t.localId))},n),xb(i=>i.id));return m(e,ft(r))}function gA(e,t,n){const r=m(cS({sharedConfigurationModelId:t,componentPath:[]},n),xb(i=>i.id));return m(e,ft(r))}function bA(e){return m(e,ft(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function SA(e,t){return m(lS(e),G(n=>Qb(n,t)),Il,cr(n=>he(n)))}function wA(e,t){return m(dS(e),ft(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>eS(n)),cr(n=>he(n)))}function CA(e,t){return m(pS(e),ft(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>tS(n)),cr(n=>he(n)))}function xA(e,t){return m(fS(e),ft(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>nS(n)),cr(n=>he(n)))}function lS(e){return m(e.attributes,ft(aS))}function fS(e){return m(e.attributes,ft(uS))}function dS(e){return m(e.attributes,ft(sS))}function pS(e){return m(e.attributes,ft(oS))}function EA(e,t){return m(fu(e,t),dt)}function TA(e,t){return m(hS(e,t),dt)}function IA(e,t,n){return m(hS(e,t),Z(r=>r.values),Yn(jn(Wt(r=>r.id===n))),dt)}function AA(e,t){return m(fu(e,t),wt(sS),dt)}function $A(e,t){return m(fu(e,t),wt(oS),dt)}function OA(e,t){return m(fu(e,t),wt(uS),dt)}function fu(e,t){return m(e.attributes,Wt(n=>ko.equals(n.id,t)))}function hS(e,t){return m(fu(e,t),wt(aS))}const DA=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:yA,filterAttributesOfRoot:bA,filterAttributesOfShared:gA,getAttribute:EA,getBooleanAttribute:$A,getBooleanAttributes:pS,getBooleanDecisions:CA,getChoiceAttribute:TA,getChoiceAttributes:lS,getChoiceDecisions:SA,getChoiceValue:IA,getComponentAttribute:OA,getComponentAttributes:fS,getComponentDecisions:xA,getNumericAttribute:AA,getNumericAttributes:dS,getNumericDecisions:wA},Symbol.toStringTag,{value:"Module"})),NA="https://spc.cloud.ceventis.de/api/engine",PA={hcaEngineBaseUrl:NA};function RA(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??PA.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function ns(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const vS=e=>t=>n=>m(n,NE(r=>e.equals(r,t)),Z(r=>m(n,PE(r,i=>t))),bd,Ye(()=>m(n,Ne(ME(t))))),ku=vS({equals:(e,t)=>bn.equals(e.attributeId,t.attributeId)}),kA=vS({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let MA=class{constructor(t){this.restToDomainMapper=t}updateConfigurationSession(t,n){const r=this.updateConfiguration(t.configuration,n);return{...t,configuration:r}}updateConfiguration(t,n){var r,i,o,a,s,u,c,l,f,d;const p=m(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],G(this.restToDomainMapper.mapToGlobalAttributeId)),h=I=>ah(bn)(I,p),v=m(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=m(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=m(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),y=m(((s=n.consequences)==null?void 0:s.componentConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),w=m(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=m(((c=n.consequences)==null?void 0:c.numericConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),S=m(((l=n.affectedDecisions)==null?void 0:l.booleanDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=m(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=m([],Ne(m(S,G(I=>I.attributeId))),Ne(m(T,G(I=>I.attributeId))),Ne(m(w,G(I=>I.attributeId))),Ne(m(x,G(I=>I.attributeId))),Ne(m(v,G(I=>I.attributeId))),Ne(m(C,G(I=>I.attributeId))),Ne(m(E,G(I=>I.attributeId))),Ne(m(y,G(I=>I.attributeId))),sa(bn)),D=m(A,yd(t.attributes,(I,N)=>{const j=t.attributes.find(L=>bn.equals(L.attributeId,N));return ue(j).with({type:ct.Choice},(L,V)=>{const H=this.mergeChoice(V,m(C,Wt(R=>bn.equals(R.attributeId,N)),Z(R=>R.payload)),m(v,ft(R=>bn.equals(R.attributeId,N)),G(R=>R.payload)));return ku(H)(I)}).with({type:ct.Numeric},(L,V)=>{const H=this.mergeNumeric(V,m(x,Wt(R=>bn.equals(R.attributeId,N)),Z(R=>R.payload)),m(w,Wt(R=>bn.equals(R.attributeId,N)),Z(R=>R.payload)));return ku(H)(I)}).with({type:ct.Boolean},(L,V)=>{const H=this.mergeBoolean(V,m(T,Wt(R=>bn.equals(R.attributeId,N)),Z(R=>R.payload)),m(S,Wt(R=>bn.equals(R.attributeId,N)),Z(R=>R.payload)));return ku(H)(I)}).with({type:ct.Component},(L,V)=>{const H=this.mergeComponent(V,m(y,Wt(R=>bn.equals(R.attributeId,N)),Z(R=>R.payload)),m(E,Wt(R=>bn.equals(R.attributeId,N)),Z(R=>R.payload)));return ku(H)(I)}).exhaustive()}),G(I=>{const N=h(I.attributeId);return I.canContributeToConfigurationSatisfaction!=N?{...I,canContributeToConfigurationSatisfaction:N}:I}));return{...t,isSatisfied:m((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,he,Ye(()=>t.isSatisfied)),attributes:D}}mergeChoice(t,n,r){const i=m(n,Z(u=>u.values??[]),Ye(()=>[])),o=m(r),a=m([],Ne(m(i,G(u=>u.choiceValueId))),Ne(m(o,G(u=>u.choiceValueId))),G(ns),sa(xe)),s=m(a,yd(t.values,(u,c)=>{const l=m(i,Wt(h=>h.choiceValueId===c)),f=m(o,Wt(h=>h.choiceValueId===c)),d=m(t.values.find(h=>h.choiceValueId===c),he),p=this.mergeChoiceValue(c,d,l,f);return kA(p)(u)}));return{...t,isSatisfied:m(n,Z(u=>ns(u.isSatisfied)),Ye(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=m(i,Z(s=>({state:this.toDecisionState(ns(s.state)),kind:this.toDecisionKind(ns(s.kind))})),Ye(()=>({state:m(n,Yn(s=>m(s.decision,Z(u=>u.state)))),kind:m(n,Yn(s=>m(s.decision,Z(u=>u.kind))),Ye(()=>Mt.Explicit))}))),a=m(r,Z(s=>m(Kv(s.possibleDecisionStates??[]),G(u=>this.toPossibleDecisionState(u)),Kn)),Ye(()=>m(n,Z(s=>s.possibleDecisionStates??[]),Ye(()=>[]))));return{choiceValueId:t,decision:m(o.state,Z(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=m(r,Z(a=>{const s=this.toDecisionState(ns(a.state));return m(s,Z(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),Ye(()=>m(t.decision,Z(a=>({state:a.state,kind:a.kind}))))),o=m(n,Z(a=>m(Kv(a.possibleDecisionStates??[]),G(s=>this.toPossibleDecisionState(s)),Kn)),Ye(()=>t.possibleDecisionStates));return{...t,isSatisfied:m(n,Z(a=>a.isSatisfied),Ye(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:m(n,Yn(i=>he(i.isSatisfied)),Ye(()=>t.isSatisfied)),decision:m(r,Xr(()=>t.decision,i=>m(i.state,he,Z(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:m(n,Yn(i=>he(i.isSatisfied)),Ye(()=>t.isSatisfied)),decision:m(r,Xr(()=>t.decision,i=>m(i.state,he,Z(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:m(n,Z(i=>i.possibleDecisionStates),Ye(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return ue(t).with(So.Included,()=>Me(Xt.Included)).with(So.Excluded,()=>Me(Xt.Excluded)).otherwise(()=>ge)}toDecisionState(t){return ue(t).with(Hr.Included,()=>Me(Xt.Included)).with(Hr.Excluded,()=>Me(Xt.Excluded)).otherwise(()=>ge)}toDecisionKind(t){return ue(t).with(Bs.Implicit,()=>Mt.Implicit).with(Bs.Explicit,()=>Mt.Explicit).exhaustive()}},jA=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return ue(t).with({type:Te.ChoiceValue},n=>({type:Fn.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Te.Component},n=>({type:Fn.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Te.Numeric},n=>({type:Fn.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,dt)})).with({type:Te.Boolean},n=>({type:Fn.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,dt)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=m([...t],di(u=>u.type!==Te.Boolean?ge:Me({type:Fn.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:m(u.value,dt)}))),o=m([...t],di(u=>u.type!==Te.Numeric?ge:Me({type:Fn.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:m(u.value,dt)}))),a=m([...t],di(u=>u.type!==Te.ChoiceValue?ge:Me({type:Fn.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=m([...t],di(u=>u.type!==Te.Component?ge:Me({type:Fn.Component,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:this.mapToDecisionState(u.state)})));return{mode:r,choiceDecisions:a,numericDecisions:o,booleanDecisions:i,componentDecisions:s}}mapToExplicitDecisionsInner(t){const n=m([...t],di(a=>a.type!==ct.Boolean?ge:m(a.decision,wt(s=>s.kind===Mt.Explicit),Z(()=>this.mapToExplicitBooleanDecision(a))))),r=m([...t],di(a=>a.type!==ct.Numeric?ge:m(a.decision,wt(s=>s.kind===Mt.Explicit),Z(()=>this.mapToExplicitNumericDecision(a))))),i=m([...t],di(a=>a.type!==ct.Component?ge:m(a.decision,wt(s=>s.kind===Mt.Explicit),Z(()=>this.mapToExplicitComponentDecision(a))))),o=m([...t],di(a=>a.type!==ct.Choice?ge:m(this.mapToExplicitChoiceDecisions(a),cu(s=>m(s,Pa)))),UE);return{booleanDecisions:n,numericDecisions:r,choiceDecisions:o,componentDecisions:i}}mapToMode(t){return ue(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>this.mapToDropExistingDecisionsMode(n)).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:m(t.componentPath,he,Z(gd),En),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:ue(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:Tt.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:Fn.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:m(t.decision,Z(n=>n.state),dt)}}mapToExplicitNumericDecision(t){return{type:Fn.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:m(t.decision,Z(n=>n.state),dt)}}mapToExplicitComponentDecision(t){return{type:Fn.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(m(t.decision,Z(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return m(r.decision,Z(i=>i.kind===Mt.Explicit),Ye(()=>!1))}return m(t.values,ft(n),G(r=>({type:Fn.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(m(r.decision,Z(i=>i.state)))})),gd)}mapToDecisionState(t){return m(t,Z(n=>ue(n).with(Xt.Included,()=>Hr.Included).with(Xt.Excluded,()=>Hr.Excluded).exhaustive()),Ye(()=>Hr.Undefined))}mapToPossibleDecisionState(t){return ue(t).with(Xt.Included,()=>So.Included).with(Xt.Excluded,()=>So.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return ue(t).with({subject:dn.attribute},n=>({type:Od.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:dn.configuration},()=>({type:Od.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return ue(t).with({subject:dn.boolean},n=>({type:ds.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:dn.numeric},n=>({type:ds.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:dn.component},n=>({type:ds.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:dn.choiceValue},n=>({type:ds.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},_A=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return m(t.configuration.attributes,Wt(n=>ue(n).with({type:ct.Boolean},r=>m(r.decision,wt(i=>i.kind===Mt.Explicit),fs)).with({type:ct.Numeric},r=>m(r.decision,wt(i=>i.kind===Mt.Explicit),fs)).with({type:ct.Choice},r=>m(r.values,Wt(i=>m(i.decision,Z(o=>o.kind===Mt.Explicit),Ye(()=>!1))),fs)).with({type:ct.Component},r=>m(r.decision,wt(i=>i.kind===Mt.Explicit),fs)).exhaustive()),Xr(()=>!1,()=>!0))},getExplicitDecisions(t){return m(t.configuration.attributes,G(n=>ue(n).with({type:ct.Boolean},r=>m(r.decision,wt(i=>i.kind===Mt.Explicit),Z(i=>({type:Te.Boolean,attributeId:r.attributeId,value:he(i.state)})),Z(i=>[i]))).with({type:ct.Numeric},r=>m(r.decision,wt(i=>i.kind===Mt.Explicit),Z(i=>({type:Te.Numeric,attributeId:r.attributeId,value:he(i.state)})),Z(i=>[i]))).with({type:ct.Choice},r=>m(r.values,G(i=>m(i.decision,wt(o=>o.kind===Mt.Explicit),Z(o=>({type:Te.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:he(o.state)})))),Kn,Ii)).with({type:ct.Component},r=>m(r.decision,wt(i=>i.kind===Mt.Explicit),Z(i=>({type:Te.Component,attributeId:r.attributeId,state:he(i.state)})),Z(i=>[i]))).exhaustive()),Kn,Il)}}}},qA=class{constructor(t,n,r,i,o,a){this.engineApiClient=n,this.domainToRestMapper=i,this.restToDomainMapper=r,this.domainToContractMapper=o,this.domainUpdater=a,this.sessionHandler=t,this.interpreter=new _A}close(t){return this.sessionHandler.close(t)}recreate(t){return this.initializeInner(t,!1)}reinitialize(t){return this.initializeInner(t,!0)}makeDecision(t,n){const r=this.domainToRestMapper.mapToExplicitDecision(t);return this.withSession(n,(i,o)=>m(this.engineApiClient.makeDecision(i,r),yr(Vr),Kt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=ue(t).with({question:Gn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Gn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return m(i,yr(Vr),Kt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return m(a,vr(s=>{var u,c,l,f;const d=m([],Ne(m(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],G(p=>this.restToDomainMapper.mapToBooleanDecision(p)))),Ne(m(((c=s.rejectedDecisions)==null?void 0:c.numericDecisions)??[],G(p=>this.restToDomainMapper.mapToNumericDecision(p)))),Ne(m(((l=s.rejectedDecisions)==null?void 0:l.componentDecisions)??[],G(p=>this.restToDomainMapper.mapToComponentDecision(p)))),Ne(m(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],G(p=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(p)))));return m(d,Pa)?Wr(YI.createConfigurationRejectedDecisionsConflict(d)):ua(this.domainUpdater.updateConfigurationSession(o,s))}))})}replaceDecisions(t,n){const r=this.interpreter.configurationSession.getExplicitDecisions(n),i=this.setManyInner(r,{type:"DropExistingDecisions",conflictHandling:{type:"Automatic"}},t);return m(i,Kt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return m(o,yr(Vr),vr(a=>{const s={rejectedDecisions:{booleanDecisions:Tt.array(Tt.any)}},u={decisionExplanations:Tt.array(Tt.any)};return ue(a).with(s,c=>Ra(c)).with(u,c=>Wr(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(c,i,n))).otherwise(()=>Wr({type:we.Unknown}))}))}explainWhyStateNotPossible(t,n){const r=this.domainToRestMapper.mapToWhyStateNotPossibleRequest(t);return this.engineApiClient.getWhyStateNotPossible(n,r)}explainWhyNotSatisfied(t,n){const r=this.domainToRestMapper.mapToWhyNotSatisfiedRequest(t);return this.engineApiClient.getWhyNotSatisfied(n,r)}withSession(t,n){return m(ua(t),vr(r=>m(r.sessionId,Xr(()=>this.initializeInner(r,!1),()=>ua(r)))),vr(r=>m(r.sessionId,fh(()=>({type:we.ConfigurationUnauthenticated})),vr(i=>n(i,r)))))}initializeInner(t,n){return m(wT,()=>m(t.sessionId,NT,RT(s=>n?DT(s):m(this.sessionHandler.close(s),_c(()=>ge,()=>ge)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return m(s,vT(()=>({type:we.ConfigurationUnauthenticated})),$b(()=>this.sessionHandler.create(u)))},s=>m(s,CT(u=>m(Ii(t),wt(this.interpreter.configurationSession.hasExplicitDecisions),Z(c=>this.replaceDecisions(u,c)),Ye(()=>ua({}))))),s=>m(s,vr(u=>{const c=this.determineConsequences(u),l=this.determineDecisions(u),f=z1(gT)({consequences:c,decisions:l});return m(f,Kt(({decisions:d,consequences:p})=>this.restToDomainMapper.mapToConfigurationModel(d,p)),Kt(d=>({sessionId:Ii(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return m(this.engineApiClient.getDecisions(t),yr(Vr))}determineConsequences(t){return m(this.engineApiClient.getConsequence(t),yr(Vr))}},FA=class{constructor(t,n){this.onConfigurationChangedHandler=ge,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return m(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return m(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:ge}}restoreConfiguration(t){return m(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return m(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return m(this.configurationSession.sessionId,Z(t=>this.sessionHandler.close(t)),Z(jn(Kt(t=>{this.configurationSession={...this.configurationSession,sessionId:ge}}))),Ye(gl(jI())))}applySolution(t){return m(this.configurationSession.solutions,Wt(n=>HI.equals(n,t)),fh(()=>({type:we.ConfigurationSolutionNotAvailable})),Kt(n=>n.decisions),vr(n=>this.setMany(n,t.mode)))}setMany(t,n){return m(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),qc(r=>()=>{const i=ue(r).with({decisionExplanations:Tt.array(Tt.any)},o=>Me(o.decisionExplanations)).otherwise(()=>ge);this.configurationSession={...this.configurationSession,solutions:m(i,Z(jn(G(o=>o.solution))),Ye(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=ue(t).with({decisionExplanations:Tt.array(Tt.any)},r=>r.decisionExplanations).otherwise(()=>[]);return m(n,G(r=>r.solution))}invalidateAvailableSolutions(){return ET(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return qc(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return js(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return jn(js(t=>()=>{this.configurationSession=t,m(this.onConfigurationChangedHandler,IT(n=>()=>n(this.configurationSession.configuration)))}),Kt(t=>t.configuration),this.invalidateAvailableSolutions())}},LA=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=wI(r,bI.concat(CI(i),SI(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Bo(this.policy,n,r=>m(r,Zi(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Bo(this.policy,n,r=>m(r,Zi(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Bo(this.policy,n,r=>m(r,Zi(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Bo(this.policy,n,r=>m(r,Zi(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Bo(this.policy,n,r=>m(r,Zi(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Bo(this.policy,r,i=>m(i,Zi(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return ue(t).with({type:we.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:we.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},BA=class{constructor(){this.queue=[],this.operating=ge}push(t){const n=new VA(t);return this.queue.push(n),this.operating=m(this.operating,Ye(()=>this.start()),Ii),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=m(t,G(r=>r.argument),yd(ge,(r,i)=>this.reduce(r,i)),Z(jn(r=>this.execute(r),r=>r.then(i=>{m(t,G(o=>{o.resolve(i)}))}).catch(i=>{m(t,G(o=>{o.reject(i)}))}))),dt);n&&await n}this.operating=ge}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},VA=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},UA=class extends BA{constructor(t){super(),this.inner=t}reduce(t,n){return Me(n)}async execute(t){return await this.inner.setSessionContext(t)()}};class GA{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new UA(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(LI.equals(n,t))return Ra(this.getConfiguration());const r=this.setContextReducingTaskExecutor.push(t);return()=>r}applySolution(t){return this.inner.applySolution(t)}close(){return this.inner.close()}makeDecision(t){return this.inner.makeDecision(t)}restoreConfiguration(t){return this.inner.restoreConfiguration(t)}setMany(t,n){return this.inner.setMany(t,n)}explain(t){return this.inner.explain(t)}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}}let zA=class{constructor(t,n=!1){this.stringify=n,this.inner=t,this.durationNumberFormat=new Intl.NumberFormat("en-EN",{maximumFractionDigits:3})}withLogging(t,n,r){const i=performance.now(),o=()=>{const a=performance.now()-i;return this.durationNumberFormat.format(a)};return console.debug(`Operation ${t} started with`,this.renderAsRequired(n)),m(r(),qc(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),js(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with success`,this.renderAsRequired(a))}))}renderAsRequired(t){return this.stringify?JSON.stringify(t,null,2):t}explain(t){return this.withLogging("explain",[t],()=>this.inner.explain(t))}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){return this.withLogging("setSessionContext",[t],()=>this.inner.setSessionContext(t))}applySolution(t){return this.withLogging("applySolution",[t],()=>this.inner.applySolution(t))}close(){return this.inner.close()}makeDecision(t){return this.withLogging("makeDecision",[t],()=>this.inner.makeDecision(t))}restoreConfiguration(t){return this.withLogging("restoreConfiguration",[t],()=>this.inner.restoreConfiguration(t))}setMany(t,n){return this.withLogging("setMany",[t,n],()=>this.inner.setMany(t,n))}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}},WA=class mS{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+Lb()}static new(t){return new mS(t)}close(){return this.executeTaskSynchronous(()=>this.inner.close())}restoreConfiguration(t){return this.executeTaskSynchronous(()=>this.inner.restoreConfiguration(t))}setSessionContext(t){return this.executeTaskSynchronous(()=>this.inner.setSessionContext(t))}invalidateSessionId(){return this.inner.invalidateSessionId()}makeDecision(t){return this.executeTaskSynchronous(()=>this.inner.makeDecision(t))}applySolution(t){return this.executeTaskSynchronous(()=>this.inner.applySolution(t))}setMany(t,n){return this.executeTaskSynchronous(()=>this.inner.setMany(t,n))}explain(t){return this.executeTaskSynchronous(()=>this.inner.explain(t))}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}getConfiguration(){return this.inner.getConfiguration()}getSessionContext(){return this.inner.getSessionContext()}executeTaskSynchronous(t){return()=>navigator.locks.request(this.lockName,{mode:"exclusive"},()=>t()())}};function HA(e){e=RA(e);const t=new rA(e.hcaEngineBaseUrl),n=new Hb,r=new jA,i=new Yb,o=new Ub,a=new MA(n),s=ue(e.sessionHandler).with({create:Tt.any,close:Tt.any},l=>l).with({accessToken:Tt.string},l=>new zb(t,o,n,l)).with({sessionCreateUrl:Tt.string,sessionDeleteUrl:Tt.string},l=>new Kb(o,l)).exhaustive(),u=new qA(s,t,n,r,i,a),c=(l,f)=>m(new FA(l,f),d=>new LA(d),d=>new GA(d),WA.new,d=>new zA(d,!1));return new Xb(u,c)}const KA=ko.equals,YA=vh.equals,XA=Bb.equals,JA=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:ar,AttributeInterpreter:vA,AttributeType:Xe,ChoiceValueDecisionState:Qr,ChoiceValueInterpreter:sA,ClientSideSessionLifetimeHandler:zb,ComponentDecisionState:Pi,ConfigurationConflictReason:Ol,ConfigurationInterpreter:DA,ConfigurationModelSourceType:Jr,ConfiguratorClient:Xb,ConstraintType:ha,ContractToRestMapper:Ub,DecisionKind:Zr,ExplainQuestionBuilderModule:iA,ExplainQuestionSubject:In,ExplainQuestionType:Tn,FailureType:Gt,Inclusion:Ri,Results:kI,Selection:Dr,ServerSideSessionLifetimeHandler:Kb,Types:RI,causedByDecisionEquals:XA,createClient:HA,explainQuestionBuilder:yh,globalAttributeIdEquals:KA,globalConstraintIdEquals:YA},Symbol.toStringTag,{value:"Module"}));var QA=Object.getOwnPropertyNames,ZA=Object.getOwnPropertySymbols,e$=Object.prototype.hasOwnProperty;function cm(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Mu(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);var o=i.cache,a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i);return o.delete(n),o.delete(r),u}}function lm(e){return QA(e).concat(ZA(e))}var yS=Object.hasOwn||function(e,t){return e$.call(e,t)};function Ma(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var gS="_owner",fm=Object.getOwnPropertyDescriptor,dm=Object.keys;function t$(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function n$(e,t){return Ma(e.getTime(),t.getTime())}function pm(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var u=t.entries(),c=!1,l=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],p=f[1],h=s.value,v=h[0],C=h[1];!c&&!r[l]&&(c=n.equals(d,v,o,l,e,t,n)&&n.equals(p,C,d,v,e,t,n))&&(r[l]=!0),l++}if(!c)return!1;o++}return!0}function r$(e,t,n){var r=dm(e),i=r.length;if(dm(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===gS&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!yS(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function rs(e,t,n){var r=lm(e),i=r.length;if(lm(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===gS&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!yS(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=fm(e,o),s=fm(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function i$(e,t){return Ma(e.valueOf(),t.valueOf())}function o$(e,t){return e.source===t.source&&e.flags===t.flags}function hm(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var s=t.values(),u=!1,c=0;(a=s.next())&&!a.done;)!u&&!r[c]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[c]=!0),c++;if(!u)return!1}return!0}function a$(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var s$="[object Arguments]",u$="[object Boolean]",c$="[object Date]",l$="[object Map]",f$="[object Number]",d$="[object Object]",p$="[object RegExp]",h$="[object Set]",v$="[object String]",m$=Array.isArray,vm=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,mm=Object.assign,y$=Object.prototype.toString.call.bind(Object.prototype.toString);function g$(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,u=e.areTypedArraysEqual;return function(l,f,d){if(l===f)return!0;if(l==null||f==null||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;var p=l.constructor;if(p!==f.constructor)return!1;if(p===Object)return i(l,f,d);if(m$(l))return t(l,f,d);if(vm!=null&&vm(l))return u(l,f,d);if(p===Date)return n(l,f,d);if(p===RegExp)return a(l,f,d);if(p===Map)return r(l,f,d);if(p===Set)return s(l,f,d);var h=y$(l);return h===c$?n(l,f,d):h===p$?a(l,f,d):h===l$?r(l,f,d):h===h$?s(l,f,d):h===d$?typeof l.then!="function"&&typeof f.then!="function"&&i(l,f,d):h===s$?i(l,f,d):h===u$||h===f$||h===v$?o(l,f,d):!1}}function b$(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?rs:t$,areDatesEqual:n$,areMapsEqual:r?cm(pm,rs):pm,areObjectsEqual:r?rs:r$,arePrimitiveWrappersEqual:i$,areRegExpsEqual:o$,areSetsEqual:r?cm(hm,rs):hm,areTypedArraysEqual:r?rs:a$};if(n&&(i=mm({},i,n(i))),t){var o=Mu(i.areArraysEqual),a=Mu(i.areMapsEqual),s=Mu(i.areObjectsEqual),u=Mu(i.areSetsEqual);i=mm({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function S$(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function w$(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,c){var l=r(),f=l.cache,d=f===void 0?t?new WeakMap:void 0:f,p=l.meta;return n(u,c,{cache:d,equals:i,meta:p,strict:o})};if(t)return function(u,c){return n(u,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(u,c){return n(u,c,a)}}var C$=Vi();Vi({strict:!0});Vi({circular:!0});Vi({circular:!0,strict:!0});Vi({createInternalComparator:function(){return Ma}});Vi({strict:!0,createInternalComparator:function(){return Ma}});Vi({circular:!0,createInternalComparator:function(){return Ma}});Vi({circular:!0,createInternalComparator:function(){return Ma},strict:!0});function Vi(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,s=b$(e),u=g$(s),c=r?r(u):S$(u);return w$({circular:n,comparator:u,createState:i,equals:c,strict:a})}function bh(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function du(e){return{equals(t,n){const r=m(he(t),Ye(()=>[])),i=m(he(n),Ye(()=>[]));return xr(e).equals(r,i)}}}const ja=mt({localId:xe,componentPath:du(xe),sharedConfigurationModelId:bh(xe)}),bS=mt({localId:xe,configurationModelId:xe}),x$=an((e,t)=>ue({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>E$.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>T$.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>I$.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>A$.equals(n.x,n.y)).otherwise(()=>!1)),E$=mt({type:xe,attributeId:ja,state:xe,choiceValueId:xe}),T$=mt({type:xe,attributeId:ja,state:xe}),I$=mt({type:xe,attributeId:ja,state:uu}),A$=mt({type:xe,attributeId:ja,state:Al});var Si=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Si||{}),rr=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(rr||{}),no=(e=>(e.all="all",e.none="none",e.specific="specific",e))(no||{}),yn=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(yn||{}),Dl=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Dl||{});const ym=mt({localId:xe,componentPath:du(xe),sharedConfigurationModel:bh(xe)}),$$=kr(xr(mt({attributeId:ym,decisions:du(ym)}))),O$=kr(an((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:"all"},y:{type:"all"}},()=>!0).with({x:{type:"none"},y:{type:"none"}},()=>!0).with({x:{type:"specific"},y:{type:"specific"}},({x:n,y:r})=>xr(bS).equals(n.rules,r.rules)).otherwise(()=>!1))),D$=kr(mt({rules:O$}));mt({configurationModelSource:an((e,t)=>C$(e,t)),decisionsToRespect:$$,usageRuleParameters:dh(xe),allowedInExplain:D$});mt({localId:xe,componentPath:du(xe),sharedConfigurationModelId:bh(xe)});Si.whyIsNotSatisfied,rr.configuration;function N$(e,t){return m(e.values,cr(n=>m(n.decision,he,wt(r=>r.kind===t))))}function P$(e){return m(e.decision,he,wt(t=>t.kind===Dl.Explicit),En)}function R$(e){return m(e.decision,he,wt(t=>t.kind===Dl.Explicit),En)}function k$(e){return m(e.decision,he,En)}const SS=e=>e.type===yn.Boolean,wS=e=>e.type===yn.Choice,CS=e=>e.type===yn.Numeric,xS=e=>e.type===yn.Component,M$=du(xe);function j$(e,t,n){var r;const i=((r=t.componentPath)==null?void 0:r.length)??0;return m(e,ft(o=>{var a;const s=((a=o.id.componentPath)==null?void 0:a.length)??0;return n?i>s?!1:m(o.id.componentPath??[],Sb(t.componentPath??[]),FE(([u,c])=>u===c)):M$.equals(o.id.componentPath,t.componentPath)}))}function _$(e,t,n){return[]}function q$(e){return m(e,ft(t=>{const n=m(t.id.componentPath,he,Z(i=>i.length===0),Ye(()=>!0)),r=m(t.id.sharedConfigurationModelId,he,Xr(()=>!0,()=>!1));return n&&r}))}function F$(e,t){return m(ES(e),G(n=>N$(n,t)),Il,cr(n=>he(n)))}function L$(e,t){return m(IS(e),ft(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>P$(n)),cr(n=>he(n)))}function B$(e,t){return m(AS(e),ft(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>R$(n)),cr(n=>he(n)))}function V$(e,t){return m(TS(e),ft(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>k$(n)),cr(n=>he(n)))}function ES(e){return m(e.attributes,ft(wS))}function TS(e){return m(e.attributes,ft(xS))}function IS(e){return m(e.attributes,ft(CS))}function AS(e){return m(e.attributes,ft(SS))}function U$(e,t){return m(pu(e,t),dt)}function G$(e,t){return m($S(e,t),dt)}function z$(e,t,n){return m($S(e,t),Z(r=>r.values),Yn(jn(Wt(r=>r.id===n))),dt)}function W$(e,t){return m(pu(e,t),wt(CS),dt)}function H$(e,t){return m(pu(e,t),wt(SS),dt)}function K$(e,t){return m(pu(e,t),wt(xS),dt)}function pu(e,t){return m(e.attributes,Wt(n=>ja.equals(n.id,t)))}function $S(e,t){return m(pu(e,t),wt(wS))}const _a=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:j$,filterAttributesOfRoot:q$,filterAttributesOfShared:_$,getAttribute:U$,getBooleanAttribute:H$,getBooleanAttributes:AS,getBooleanDecisions:B$,getChoiceAttribute:G$,getChoiceAttributes:ES,getChoiceDecisions:F$,getChoiceValue:z$,getComponentAttribute:K$,getComponentAttributes:TS,getComponentDecisions:V$,getNumericAttribute:W$,getNumericAttributes:IS,getNumericDecisions:L$},Symbol.toStringTag,{value:"Module"})),Y$=ja.equals,X$=bS.equals;x$.equals;/*! *****************************************************************************
|
|
5
5
|
Copyright (c) Microsoft Corporation.
|
|
6
6
|
|
|
7
7
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -14,12 +14,12 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
14
14
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
15
15
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
16
16
|
PERFORMANCE OF THIS SOFTWARE.
|
|
17
|
-
***************************************************************************** */var G=function(){return G=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},G.apply(this,arguments)};function Xl(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}function Te(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function xe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}function Ke(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var We;(function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"})(We||(We={}));var gr;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(gr||(gr={}));var _c=We.Start,Ql=We.Stop,Da=We.Raise,ou=We.Send,Wh=We.Cancel,Aw=We.NullEvent,Zl=We.Assign;We.After;We.DoneState;var Hh=We.Log,Dw=We.Init,jc=We.Invoke;We.ErrorExecution;var af=We.ErrorPlatform,Ow=We.ErrorCustom,Kh=We.Update,Nw=We.Choose,Pw=We.Pure,Jh=".",sf={},qc="xstate.guard",Mw="",at=process.env.NODE_ENV==="production",Ga;function ed(e,t,n){n===void 0&&(n=Jh);var i=ia(e,n),r=ia(t,n);return Ae(r)?Ae(i)?r===i:!1:Ae(i)?i in r:Object.keys(i).every(function(o){return o in r?ed(i[o],r[o]):!1})}function Yh(e){try{return Ae(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function kc(e,t){try{return vo(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function Rw(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function ia(e,t){if(Rw(e))return e.value;if(vo(e))return Os(e);if(typeof e!="string")return e;var n=kc(e,t);return Os(n)}function Os(e){if(e.length===1)return e[0];for(var t={},n=t,i=0;i<e.length-1;i++)i===e.length-2?n[e[i]]=e[i+1]:(n[e[i]]={},n=n[e[i]]);return t}function Lo(e,t){for(var n={},i=Object.keys(e),r=0;r<i.length;r++){var o=i[r];n[o]=t(e[o],o,e,r)}return n}function uf(e,t,n){var i,r,o={};try{for(var a=Te(Object.keys(e)),u=a.next();!u.done;u=a.next()){var s=u.value,c=e[s];n(c)&&(o[s]=t(c,s,e))}}catch(l){i={error:l}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}var _w=function(e){return function(t){var n,i,r=t;try{for(var o=Te(e),a=o.next();!a.done;a=o.next()){var u=a.value;r=r[u]}}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}};function jw(e,t){return function(n){var i,r,o=n;try{for(var a=Te(e),u=a.next();!u.done;u=a.next()){var s=u.value;o=o[t][s]}}catch(c){i={error:c}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}}function cs(e){if(!e)return[[]];if(Ae(e))return[[e]];var t=rt(Object.keys(e).map(function(n){var i=e[n];return typeof i!="string"&&(!i||!Object.keys(i).length)?[[n]]:cs(e[n]).map(function(r){return[n].concat(r)})}));return t}function rt(e){var t;return(t=[]).concat.apply(t,Ke([],xe(e),!1))}function Xh(e){return vo(e)?e:[e]}function Bn(e){return e===void 0?[]:Xh(e)}function Ns(e,t,n){var i,r;if(_e(e))return e(t,n.data);var o={};try{for(var a=Te(Object.keys(e)),u=a.next();!u.done;u=a.next()){var s=u.value,c=e[s];_e(c)?o[s]=c(t,n.data):o[s]=c}}catch(l){i={error:l}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function qw(e){return/^(done|error)\./.test(e)}function cf(e){return!!(e instanceof Promise||e!==null&&(_e(e)||typeof e=="object")&&_e(e.then))}function kw(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function Bw(e,t){var n,i,r=xe([[],[]],2),o=r[0],a=r[1];try{for(var u=Te(e),s=u.next();!s.done;s=u.next()){var c=s.value;t(c)?o.push(c):a.push(c)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return[o,a]}function Qh(e,t){return Lo(e.states,function(n,i){if(n){var r=(Ae(t)?void 0:t[i])||(n?n.current:void 0);if(r)return{current:r,states:Qh(n,r)}}})}function Uw(e,t){return{current:t,states:Qh(e,t)}}function lf(e,t,n,i){at||At(!!e,"Attempting to update undefined context");var r=e&&n.reduce(function(o,a){var u,s,c=a.assignment,l={state:i,action:a,_event:t},f={};if(_e(c))f=c(o,t.data,l);else try{for(var d=Te(Object.keys(c)),p=d.next();!p.done;p=d.next()){var h=p.value,v=c[h];f[h]=_e(v)?v(o,t.data,l):v}}catch(w){u={error:w}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(u)throw u.error}}return Object.assign({},o,f)},e);return r}var At=function(){};at||(At=function(e,t){var n=e instanceof Error?e:void 0;if(!(!n&&e)&&console!==void 0){var i=["Warning: ".concat(t)];n&&i.push(n),console.warn.apply(console,i)}});function vo(e){return Array.isArray(e)}function _e(e){return typeof e=="function"}function Ae(e){return typeof e=="string"}function Zh(e,t){if(e)return Ae(e)?{type:qc,name:e,predicate:t?t[e]:void 0}:_e(e)?{type:qc,name:e.name,predicate:e}:e}function Vw(e){try{return"subscribe"in e&&_e(e.subscribe)}catch{return!1}}var _i=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Ga={},Ga[_i]=function(){return this},Ga[Symbol.observable]=function(){return this};function wi(e){return!!e&&"__xstatenode"in e}function Fw(e){return!!e&&typeof e.send=="function"}var Lw=function(){var e=0;return function(){return e++,e.toString(16)}}();function au(e,t){return Ae(e)||typeof e=="number"?G({type:e},t):e}function qt(e,t){if(!Ae(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=au(e);return G({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Pr(e,t){var n=Xh(t).map(function(i){return typeof i>"u"||typeof i=="string"||wi(i)?{target:i,event:e}:G(G({},i),{event:e})});return n}function Gw(e){if(!(e===void 0||e===Mw))return Bn(e)}function zw(e,t,n){if(!at){var i=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(i));else{var r=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(i," Current error is '").concat(t,"'.").concat(r))}}}function ev(e,t,n,i,r){var o=e.options.guards,a={state:r,cond:t,_event:i};if(t.type===qc)return((o==null?void 0:o[t.name])||t.predicate)(n,i.data,a);var u=o==null?void 0:o[t.type];if(!u)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return u(n,i.data,a)}function tv(e){return typeof e=="string"?{type:e}:e}function ls(e,t,n){var i=function(){},r=typeof e=="object",o=r?e:null;return{next:((r?e.next:e)||i).bind(o),error:((r?e.error:t)||i).bind(o),complete:((r?e.complete:n)||i).bind(o)}}function za(e,t){return"".concat(e,":invocation[").concat(t,"]")}function Bc(e){return(e.type===Da||e.type===ou&&e.to===gr.Internal)&&typeof e.delay!="number"}var Zr=qt({type:Dw});function Uc(e,t){return t&&t[e]||void 0}function ha(e,t){var n;if(Ae(e)||typeof e=="number"){var i=Uc(e,t);_e(i)?n={type:e,exec:i}:i?n=i:n={type:e,exec:void 0}}else if(_e(e))n={type:e.name||e.toString(),exec:e};else{var i=Uc(e.type,t);if(_e(i))n=G(G({},e),{exec:i});else if(i){var r=i.type||e.type;n=G(G(G({},i),e),{type:r})}else n=e}return n}var ji=function(e,t){if(!e)return[];var n=vo(e)?e:[e];return n.map(function(i){return ha(i,t)})};function td(e){var t=ha(e);return G(G({id:Ae(e)?e:t.id},t),{type:t.type})}function Ww(e,t){return{type:Da,event:typeof e=="function"?e:au(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function Hw(e,t,n,i){var r={_event:n},o=qt(_e(e.event)?e.event(t,n.data,r):e.event),a;if(Ae(e.delay)){var u=i&&i[e.delay];a=_e(u)?u(t,n.data,r):u}else a=_e(e.delay)?e.delay(t,n.data,r):e.delay;return G(G({},e),{type:Da,_event:o,delay:a})}function su(e,t){return{to:t?t.to:void 0,type:ou,event:_e(e)?e:au(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:_e(e)?e.name:Yh(e)}}function Kw(e,t,n,i){var r={_event:n},o=qt(_e(e.event)?e.event(t,n.data,r):e.event),a;if(Ae(e.delay)){var u=i&&i[e.delay];a=_e(u)?u(t,n.data,r):u}else a=_e(e.delay)?e.delay(t,n.data,r):e.delay;var s=_e(e.to)?e.to(t,n.data,r):e.to;return G(G({},e),{to:s,_event:o,event:o.data,delay:a})}function Jw(e,t){return su(e,G(G({},t),{to:gr.Parent}))}var Yw=function(e,t,n){return G(G({},e),{value:Ae(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},Xw=function(e){return{type:Wh,sendId:e}};function Qw(e){var t=td(e);return{type:We.Start,activity:t,exec:void 0}}function Zw(e){var t=_e(e)?e:td(e);return{type:We.Stop,activity:t,exec:void 0}}function eT(e,t,n){var i=_e(e.activity)?e.activity(t,n.data):e.activity,r=typeof i=="string"?{id:i}:i,o={type:We.Stop,activity:r};return o}var tT=function(e){return{type:Zl,assignment:e}};function nT(e,t){var n=t?"#".concat(t):"";return"".concat(We.After,"(").concat(e,")").concat(n)}function Wa(e,t){var n="".concat(We.DoneState,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function ds(e,t){var n="".concat(We.DoneInvoke,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function Go(e,t){var n="".concat(We.ErrorPlatform,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function iT(e,t){if(!at&&(!e||typeof e=="function")){var n=e;e=function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var o=typeof n=="function"?n.apply(void 0,Ke([],xe(i),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return su(function(i,r){return r},G(G({},t),{to:e}))}var rT=function(e){var t,n,i=[];try{for(var r=Te(e),o=r.next();!o.done;o=r.next())for(var a=o.value,u=0;u<a.actions.length;){if(a.actions[u].type===Zl){i.push(a.actions[u]),a.actions.splice(u,1);continue}u++}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i};function Ps(e,t,n,i,r,o,a){a===void 0&&(a=!1);var u=a?[]:rT(r),s=u.length?lf(n,i,u,t):n,c=a?[n]:void 0,l=[];function f(h,v){var w;switch(v.type){case Da:{var C=Hw(v,s,i,e.options.delays);return o&&typeof C.delay=="number"&&o(C,s,i),C}case ou:var S=Kw(v,s,i,e.options.delays);if(!at){var T=v.delay;At(!Ae(T)||typeof S.delay=="number","No delay reference for delay expression '".concat(T,"' was found on machine '").concat(e.id,"'"))}return o&&S.to!==gr.Internal&&(h==="entry"?l.push(S):o(S,s,i)),S;case Hh:{var I=Yw(v,s,i);return o==null||o(I,s,i),I}case Nw:{var x=v,b=(w=x.conds.find(function(Z){var Q=Zh(Z.cond,e.options.guards);return!Q||ev(e,Q,s,i,o?void 0:t)}))===null||w===void 0?void 0:w.actions;if(!b)return[];var E=xe(Ps(e,t,s,i,[{type:h,actions:ji(Bn(b),e.options.actions)}],o,a),2),P=E[0],$=E[1];return s=$,c==null||c.push(s),P}case Pw:{var b=v.get(s,i.data);if(!b)return[];var L=xe(Ps(e,t,s,i,[{type:h,actions:ji(Bn(b),e.options.actions)}],o,a),2),R=L[0],A=L[1];return s=A,c==null||c.push(s),R}case Ql:{var I=eT(v,s,i);return o==null||o(I,n,i),I}case Zl:{s=lf(s,i,[v],o?void 0:t),c==null||c.push(s);break}default:var K=ha(v,e.options.actions),re=K.exec;if(o)o(K,s,i);else if(re&&c){var ze=c.length-1,we=G(G({},K),{exec:function(Z){for(var Q=[],de=1;de<arguments.length;de++)Q[de-1]=arguments[de];re.apply(void 0,Ke([c[ze]],xe(Q),!1))}});K=we}return K}}function d(h){var v,w,C=[];try{for(var S=Te(h.actions),T=S.next();!T.done;T=S.next()){var I=T.value,x=f(h.type,I);x&&(C=C.concat(x))}}catch(b){v={error:b}}finally{try{T&&!T.done&&(w=S.return)&&w.call(S)}finally{if(v)throw v.error}}return l.forEach(function(b){o(b,s,i)}),l.length=0,C}var p=rt(r.map(d));return[p,s]}var Ms=[],Lr=function(e,t){Ms.push(e);var n=t(e);return Ms.pop(),n},oT=function(e){return e(Ms[Ms.length-1])};function nv(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[_i]=function(){return this},t}function aT(e,t,n,i){var r,o=tv(e.src),a=(r=t==null?void 0:t.options.services)===null||r===void 0?void 0:r[o.type],u=e.data?Ns(e.data,n,i):void 0,s=a?nd(a,e.id,u):nv(e.id);return s.meta=e,s}function nd(e,t,n){var i=nv(t);if(i.deferred=!0,wi(e)){var r=i.state=Lr(void 0,function(){return(n?e.withContext(n):e).initialState});i.getSnapshot=function(){return r}}return i}function sT(e){try{return typeof e.send=="function"}catch{return!1}}function uT(e){return sT(e)&&"id"in e}function cT(e){var t;return G((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[_i]=function(){return this},t),e)}var Rs=function(e){return e.type==="atomic"||e.type==="final"};function iv(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function va(e){return iv(e).filter(function(t){return t.type!=="history"})}function rv(e){var t=[e];return Rs(e)?t:t.concat(rt(va(e).map(rv)))}function zo(e,t){var n,i,r,o,a,u,s,c,l=new Set(e),f=Vc(l),d=new Set(t);try{for(var p=Te(d),h=p.next();!h.done;h=p.next())for(var v=h.value,w=v.parent;w&&!d.has(w);)d.add(w),w=w.parent}catch($){n={error:$}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}var C=Vc(d);try{for(var S=Te(d),T=S.next();!T.done;T=S.next()){var v=T.value;if(v.type==="compound"&&(!C.get(v)||!C.get(v).length))f.get(v)?f.get(v).forEach(function(L){return d.add(L)}):v.initialStateNodes.forEach(function(L){return d.add(L)});else if(v.type==="parallel")try{for(var I=(a=void 0,Te(va(v))),x=I.next();!x.done;x=I.next()){var b=x.value;d.has(b)||(d.add(b),f.get(b)?f.get(b).forEach(function(L){return d.add(L)}):b.initialStateNodes.forEach(function(L){return d.add(L)}))}}catch(L){a={error:L}}finally{try{x&&!x.done&&(u=I.return)&&u.call(I)}finally{if(a)throw a.error}}}}catch($){r={error:$}}finally{try{T&&!T.done&&(o=S.return)&&o.call(S)}finally{if(r)throw r.error}}try{for(var E=Te(d),P=E.next();!P.done;P=E.next())for(var v=P.value,w=v.parent;w&&!d.has(w);)d.add(w),w=w.parent}catch($){s={error:$}}finally{try{P&&!P.done&&(c=E.return)&&c.call(E)}finally{if(s)throw s.error}}return d}function ov(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var i=n[0];if(i){if(Rs(i))return i.key}else return{}}var r={};return n.forEach(function(o){r[o.key]=ov(o,t)}),r}function Vc(e){var t,n,i=new Map;try{for(var r=Te(e),o=r.next();!o.done;o=r.next()){var a=o.value;i.has(a)||i.set(a,[]),a.parent&&(i.has(a.parent)||i.set(a.parent,[]),i.get(a.parent).push(a))}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i}function lT(e,t){var n=zo([e],t);return ov(e,Vc(n))}function Wo(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function dT(e){return Ke([],xe(new Set(rt(Ke([],xe(e.map(function(t){return t.ownEvents})),!1)))),!1)}function fs(e,t){return t.type==="compound"?va(t).some(function(n){return n.type==="final"&&Wo(e,n)}):t.type==="parallel"?va(t).every(function(n){return fs(e,n)}):!1}function fT(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function df(e){return new Set(rt(e.map(function(t){return t.tags})))}function av(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(Ae(e)||Ae(t))return e===t;var n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&n.every(function(r){return av(e[r],t[r])})}function pT(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function hT(e,t){var n=e.exec,i=G(G({},e),{exec:n!==void 0?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0});return i}var En=function(){function e(t){var n=this,i;this.actions=[],this.activities=sf,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||sf,this.meta=fT(t.configuration),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=(i=Array.isArray(t.tags)?new Set(t.tags):t.tags)!==null&&i!==void 0?i:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return dT(n.configuration)}})}return e.from=function(t,n){if(t instanceof e)return t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t;var i=Zr;return new e({value:t,context:n,_event:i,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var i=Zr;return new e({value:t.value,context:n,_event:i,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var i=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),Ae(t))return[t];var r=Object.keys(t);return r.concat.apply(r,Ke([],xe(r.map(function(o){return i.toStrings(t[o],n).map(function(a){return o+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var i=Xl(t,["configuration","transitions","tags","machine"]);return G(G({},i),{tags:Array.from(n)})},e.prototype.matches=function(t){return ed(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;at&&At(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var i=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,t);return!!(i!=null&&i.transitions.length)&&i.transitions.some(function(r){return r.target!==void 0||r.actions.length})},e}(),vT={deferEvents:!1},ff=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=G(G({},vT),t)}return e.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},e.prototype.schedule=function(t){if(!this.initialized||this.processingEvent){this.queue.push(t);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},e.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},e}(),Hu=new Map,yT=0,Ro={bookId:function(){return"x:".concat(yT++)},register:function(e,t){return Hu.set(e,t),e},get:function(e){return Hu.get(e)},free:function(e){Hu.delete(e)}};function id(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;at||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues")}function mT(){var e=id();if(e&&"__xstate__"in e)return e.__xstate__}function gT(e){if(id()){var t=mT();t&&t.register(e)}}function bT(e,t){t===void 0&&(t={});var n=e.initialState,i=new Set,r=[],o=!1,a=function(){if(!o){for(o=!0;r.length>0;){var c=r.shift();n=e.transition(n,c,s),i.forEach(function(l){return l.next(n)})}o=!1}},u=cT({id:t.id,send:function(c){r.push(c),a()},getSnapshot:function(){return n},subscribe:function(c,l,f){var d=ls(c,l,f);return i.add(d),d.next(n),{unsubscribe:function(){i.delete(d)}}}}),s={parent:t.parent,self:u,id:t.id||"anonymous",observers:i};return n=e.start?e.start(s):n,u}var Fc={sync:!1,autoForward:!1},ut;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ut||(ut={}));var ST=function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var i=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=ut.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(l,f){if(vo(l))return i.batch(l),i.state;var d=qt(au(l,f));if(i.status===ut.Stopped)return at||At(!1,'Event "'.concat(d.name,'" was sent to stopped service "').concat(i.machine.id,`". This service has already reached its final state, and will not transition.
|
|
18
|
-
Event: `).concat(JSON.stringify(d.data))),
|
|
19
|
-
Event: `).concat(JSON.stringify(d.data)));return
|
|
20
|
-
Event: `).concat(JSON.stringify(event)));else if(this.status!==ut.Running)throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(t.length){var i=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var r,o,a=n.state,u=!1,s=[],c=function(p){var h=qt(p);n.forward(h),a=Lr(n,function(){return n.machine.transition(a,h,void 0,i||void 0)}),s.push.apply(s,Ke([],xe(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return hT(v,a)})),!1)),u=u||!!a.changed};try{for(var l=Te(t),f=l.next();!f.done;f=l.next()){var d=f.value;c(d)}}catch(p){r={error:p}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}a.changed=u,a.actions=s,n.update(a,qt(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var i=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var r=qt(t);if(r.name.indexOf(af)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(af)===0}))throw r.data.data;var o=Lr(this,function(){return i.machine.transition(i.state,r,void 0,n||void 0)});return o},e.prototype.nextState=function(t){return this._nextState(t,!1)},e.prototype.forward=function(t){var n,i;try{for(var r=Te(this.forwardTo),o=r.next();!o.done;o=r.next()){var a=o.value,u=this.children.get(a);if(!u)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));u.send(t)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},e.prototype.defer=function(t){var n=this,i=this.clock.setTimeout(function(){"to"in t&&t.to?n.sendTo(t._event,t.to,!0):n.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=i)},e.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},e.prototype.exec=function(t,n,i){i===void 0&&(i=this.machine.options.actions),this._exec(t,n.context,n._event,i)},e.prototype.removeChild=function(t){var n;this.children.delete(t),this.forwardTo.delete(t),(n=this.state)===null||n===void 0||delete n.children[t]},e.prototype.stopChild=function(t){var n=this.children.get(t);n&&(this.removeChild(t),_e(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,i){if(this.status!==ut.Running)return nd(t,n);if(cf(t))return this.spawnPromise(Promise.resolve(t),n);if(_e(t))return this.spawnCallback(t,n);if(uT(t))return this.spawnActor(t,n);if(Vw(t))return this.spawnObservable(t,n);if(wi(t))return this.spawnMachine(t,G(G({},i),{id:n}));if(kw(t))return this.spawnBehavior(t,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof t,'".'))},e.prototype.spawnMachine=function(t,n){var i=this;n===void 0&&(n={});var r=new e(t,G(G({},this.options),{parent:this,id:n.id||t.id})),o=G(G({},Fc),n);o.sync&&r.onTransition(function(u){i.send(Kh,{state:u,id:r.id})});var a=r;return this.children.set(r.id,a),o.autoForward&&this.forwardTo.add(r.id),r.onDone(function(u){i.removeChild(r.id),i.send(qt(u,{origin:r.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var i=bT(t,{id:n,parent:this});return this.children.set(n,i),i},e.prototype.spawnPromise=function(t,n){var i,r=this,o=!1,a;t.then(function(s){o||(a=s,r.removeChild(n),r.send(qt(ds(n,s),{origin:n})))},function(s){if(!o){r.removeChild(n);var c=Go(n,s);try{r.send(qt(c,{origin:n}))}catch(l){zw(s,l,n),r.devTools&&r.devTools.send(c,r.state),r.machine.strict&&r.stop()}}});var u=(i={id:n,send:function(){},subscribe:function(s,c,l){var f=ls(s,c,l),d=!1;return t.then(function(p){d||(f.next(p),!d&&f.complete())},function(p){d||f.error(p)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},i[_i]=function(){return this},i);return this.children.set(n,u),u},e.prototype.spawnCallback=function(t,n){var i,r=this,o=!1,a=new Set,u=new Set,s,c=function(d){s=d,u.forEach(function(p){return p(d)}),!o&&r.send(qt(d,{origin:n}))},l;try{l=t(c,function(d){a.add(d)})}catch(d){this.send(Go(n,d))}if(cf(l))return this.spawnPromise(l,n);var f=(i={id:n,send:function(d){return a.forEach(function(p){return p(d)})},subscribe:function(d){var p=ls(d);return u.add(p.next),{unsubscribe:function(){u.delete(p.next)}}},stop:function(){o=!0,_e(l)&&l()},toJSON:function(){return{id:n}},getSnapshot:function(){return s}},i[_i]=function(){return this},i);return this.children.set(n,f),f},e.prototype.spawnObservable=function(t,n){var i,r=this,o,a=t.subscribe(function(s){o=s,r.send(qt(s,{origin:n}))},function(s){r.removeChild(n),r.send(qt(Go(n,s),{origin:n}))},function(){r.removeChild(n),r.send(qt(ds(n),{origin:n}))}),u=(i={id:n,send:function(){},subscribe:function(s,c,l){return t.subscribe(s,c,l)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},i[_i]=function(){return this},i);return this.children.set(n,u),u},e.prototype.spawnActor=function(t,n){return this.children.set(n,t),t},e.prototype.spawnActivity=function(t){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(!n){at||At(!1,"No implementation found for activity '".concat(t.type,"'"));return}var i=n(this.state.context,t);this.spawnEffect(t.id,i)},e.prototype.spawnEffect=function(t,n){var i;this.children.set(t,(i={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}},i[_i]=function(){return this},i))},e.prototype.attachDev=function(){var t=id();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(G(G({name:this.id,autoPause:!0,stateSanitizer:function(i){return{value:i.value,context:i.context,actions:i.actions}}},n),{features:G({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}gT(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[_i]=function(){return this},e.prototype.getSnapshot=function(){return this.status===ut.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,n){return setTimeout(t,n)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},e.interpret=sv,e}(),CT=function(e){return Ae(e)?G(G({},Fc),{name:e}):G(G(G({},Fc),{name:Lw()}),e)};function pf(e,t){var n=CT(t);return oT(function(i){if(!at){var r=wi(e)||_e(e);At(!!i||r,'Attempted to spawn an Actor (ID: "'.concat(wi(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return i?i.spawn(e,n.name,n):nd(e,n.name)})}function sv(e,t){var n=new ST(e,t);return n}function wT(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function Ha(e){return G(G({type:jc},e),{toJSON:function(){e.onDone,e.onError;var t=Xl(e,["onDone","onError"]);return G(G({},t),{type:jc,src:wT(e.src)})}})}var Gr="",Lc="#",_o="*",Mr={},Rr=function(e){return e[0]===Lc},TT=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},IT=function(e,t,n){var i=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(Ae(o.target)||wi(o.target))}),r=t===Gr?"the transient event":"event '".concat(t,"'");At(!i,"One or more transitions for ".concat(r," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},ET=function(){function e(t,n,i,r){i===void 0&&(i="context"in t?t.context:void 0);var o=this,a;this.config=t,this._context=i,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(TT(),n),this.parent=r==null?void 0:r.parent,this.key=this.config.key||(r==null?void 0:r.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:Jh),this.id=this.config.id||Ke([this.machine.key],xe(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,at||At(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?Lo(this.config.states,function(c,l){var f,d=new e(c,{},void 0,{parent:o,key:l});return Object.assign(o.idMap,G((f={},f[d.id]=d,f),d.idMap)),d}):Mr;var u=0;function s(c){var l,f;c.order=u++;try{for(var d=Te(iv(c)),p=d.next();!p.done;p=d.next()){var h=p.value;s(h)}}catch(v){l={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}finally{if(l)throw l.error}}}s(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(c){var l=c.event;return l===Gr}):Gr in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=Bn(this.config.entry||this.config.onEntry).map(function(c){return ha(c)}),this.onExit=Bn(this.config.exit||this.config.onExit).map(function(c){return ha(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=Bn(this.config.invoke).map(function(c,l){var f,d;if(wi(c)){var p=za(o.id,l);return o.machine.options.services=G((f={},f[p]=c,f),o.machine.options.services),Ha({src:p,id:p})}else if(Ae(c.src)){var p=c.id||za(o.id,l);return Ha(G(G({},c),{id:p,src:c.src}))}else if(wi(c.src)||_e(c.src)){var p=c.id||za(o.id,l);return o.machine.options.services=G((d={},d[p]=c.src,d),o.machine.options.services),Ha(G(G({id:p},c),{src:p}))}else{var h=c.src;return Ha(G(G({id:za(o.id,l)},c),{src:h}))}}),this.activities=Bn(this.config.activities).concat(this.invoke).map(function(c){return td(c)}),this.transition=this.transition.bind(this),this.tags=Bn(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||rv(this).forEach(function(t){return t.on})},e.prototype.withConfig=function(t,n){var i=this.options,r=i.actions,o=i.activities,a=i.guards,u=i.services,s=i.delays;return new e(this.config,{actions:G(G({},r),t.actions),activities:G(G({},o),t.activities),guards:G(G({},a),t.guards),services:G(G({},u),t.services),delays:G(G({},s),t.delays)},n??this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return _e(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:Lo(this.states,function(t){return t.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(n,i){return n[i.eventType]=n[i.eventType]||[],n[i.eventType].push(i),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var n=t===Gr,i=this.transitions.filter(function(r){var o=r.eventType===t;return n?o:o||r.eventType===_o});return this.__cache.candidates[t]=i,i},e.prototype.getDelayedTransitions=function(){var t=this,n=this.config.after;if(!n)return[];var i=function(o,a){var u=_e(o)?"".concat(t.id,":delay[").concat(a,"]"):o,s=nT(u,t.id);return t.onEntry.push(su(s,{delay:o})),t.onExit.push(Xw(s)),s},r=vo(n)?n.map(function(o,a){var u=i(o.delay,a);return G(G({},o),{event:u})}):rt(Object.keys(n).map(function(o,a){var u=n[o],s=Ae(u)?{target:u}:u,c=isNaN(+o)?o:+o,l=i(c,a);return Bn(s).map(function(f){return G(G({},f),{event:l,delay:c})})}));return r.map(function(o){var a=o.delay;return G(G({},t.formatTransition(o)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,i=this;if(!t)return[];var r=t instanceof En?t.value:ia(t,this.delimiter);if(Ae(r)){var o=this.getStateNode(r).initial;return o!==void 0?this.getStateNodes((n={},n[r]=o,n)):[this,this.states[r]]}var a=Object.keys(r),u=[this];return u.push.apply(u,Ke([],xe(rt(a.map(function(s){return i.getStateNode(s).getStateNodes(r[s])}))),!1)),u},e.prototype.handles=function(t){var n=Yh(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof En?t:En.create(t),i=Array.from(zo([],this.getStateNodes(n.value)));return new En(G(G({},n),{value:this.resolve(n.value),configuration:i,done:fs(i,this),tags:df(i),machine:this.machine}))},e.prototype.transitionLeafNode=function(t,n,i){var r=this.getStateNode(t),o=r.next(n,i);return!o||!o.transitions.length?this.next(n,i):o},e.prototype.transitionCompoundNode=function(t,n,i){var r=Object.keys(t),o=this.getStateNode(r[0]),a=o._transition(t[r[0]],n,i);return!a||!a.transitions.length?this.next(n,i):a},e.prototype.transitionParallelNode=function(t,n,i){var r,o,a={};try{for(var u=Te(Object.keys(t)),s=u.next();!s.done;s=u.next()){var c=s.value,l=t[c];if(l){var f=this.getStateNode(c),d=f._transition(l,n,i);d&&(a[c]=d)}}}catch(C){r={error:C}}finally{try{s&&!s.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}var p=Object.keys(a).map(function(C){return a[C]}),h=rt(p.map(function(C){return C.transitions})),v=p.some(function(C){return C.transitions.length>0});if(!v)return this.next(n,i);var w=rt(Object.keys(a).map(function(C){return a[C].configuration}));return{transitions:h,exitSet:rt(p.map(function(C){return C.exitSet})),configuration:w,source:n,actions:rt(Object.keys(a).map(function(C){return a[C].actions}))}},e.prototype._transition=function(t,n,i){return Ae(t)?this.transitionLeafNode(t,n,i):Object.keys(t).length===1?this.transitionCompoundNode(t,n,i):this.transitionParallelNode(t,n,i)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,qt(n))},e.prototype.next=function(t,n){var i,r,o=this,a=n.name,u=[],s=[],c;try{for(var l=Te(this.getCandidates(a)),f=l.next();!f.done;f=l.next()){var d=f.value,p=d.cond,h=d.in,v=t.context,w=h?Ae(h)&&Rr(h)?t.matches(ia(this.getStateNodeById(h).path,this.delimiter)):ed(ia(h,this.delimiter),_w(this.path.slice(0,-2))(t.value)):!0,C=!1;try{C=!p||ev(this.machine,p,v,n,t)}catch(I){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
21
|
-
`).concat(I.message))}if(C&&w){d.target!==void 0&&(s=d.target),u.push.apply(u,Ke([],xe(d.actions),!1)),c=d;break}}}catch(I){i={error:I}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}if(c){if(!s.length)return{transitions:[c],exitSet:[],configuration:t.value?[this]:[],source:t,actions:u};var S=rt(s.map(function(I){return o.getRelativeStateNodes(I,t.historyValue)})),T=!!c.internal;return{transitions:[c],exitSet:T?[]:rt(s.map(function(I){return o.getPotentiallyReenteringNodes(I)})),configuration:S,source:t,actions:u}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var n=[],i=this,r=t;i&&i!==r;)n.push(i),i=i.parent;return i!==r?[]:(n.push(r),n)},e.prototype.getActions=function(t,n,i,r,o,a,u){var s,c,l,f,d=this,p=a?zo([],this.getStateNodes(a.value)):[],h=new Set;try{for(var v=Te(Array.from(t).sort(function(R,A){return R.order-A.order})),w=v.next();!w.done;w=v.next()){var C=w.value;(!Wo(p,C)||Wo(i.exitSet,C)||C.parent&&h.has(C.parent))&&h.add(C)}}catch(R){s={error:R}}finally{try{w&&!w.done&&(c=v.return)&&c.call(v)}finally{if(s)throw s.error}}try{for(var S=Te(p),T=S.next();!T.done;T=S.next()){var C=T.value;(!Wo(t,C)||Wo(i.exitSet,C.parent))&&i.exitSet.push(C)}}catch(R){l={error:R}}finally{try{T&&!T.done&&(f=S.return)&&f.call(S)}finally{if(l)throw l.error}}i.exitSet.sort(function(R,A){return A.order-R.order});var I=Array.from(h).sort(function(R,A){return R.order-A.order}),x=new Set(i.exitSet),b=rt(I.map(function(R){var A=[];if(R.type!=="final")return A;var K=R.parent;if(!K.parent)return A;A.push(Wa(R.id,R.doneData),Wa(K.id,R.doneData?Ns(R.doneData,r,o):void 0));var re=K.parent;return re.type==="parallel"&&va(re).every(function(ze){return fs(i.configuration,ze)})&&A.push(Wa(re.id)),A})),E=I.map(function(R){var A=R.onEntry,K=R.activities.map(function(re){return Qw(re)});return{type:"entry",actions:ji(u?Ke(Ke([],xe(A),!1),xe(K),!1):Ke(Ke([],xe(K),!1),xe(A),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:b.map(function(R){return Ww(R)})}),P=Array.from(x).map(function(R){return{type:"exit",actions:ji(Ke(Ke([],xe(R.onExit),!1),xe(R.activities.map(function(A){return Zw(A)})),!1),d.machine.options.actions)}}),$=P.concat({type:"transition",actions:ji(i.actions,this.machine.options.actions)}).concat(E);if(n){var L=ji(rt(Ke([],xe(t),!1).sort(function(R,A){return A.order-R.order}).map(function(R){return R.onExit})),this.machine.options.actions).filter(function(R){return!Bc(R)});return $.concat({type:"stop",actions:L})}return $},e.prototype.transition=function(t,n,i,r){t===void 0&&(t=this.initialState);var o=qt(n),a;if(t instanceof En)a=i===void 0?t:this.resolveState(En.from(t,i));else{var u=Ae(t)?this.resolve(Os(this.getResolvedPath(t))):this.resolve(t),s=i??this.machine.context;a=this.resolveState(En.from(u,s))}if(!at&&o.name===_o)throw new Error("An event cannot have the wildcard type ('".concat(_o,"')"));if(this.strict&&!this.events.includes(o.name)&&!qw(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},l=zo([],this.getStateNodes(a.value)),f=c.configuration.length?zo(l,c.configuration):l;return c.configuration=Ke([],xe(f),!1),this.resolveTransition(c,a,a.context,r,o)},e.prototype.resolveRaisedTransition=function(t,n,i,r){var o,a=t.actions;return t=this.transition(t,n,void 0,r),t._event=i,t.event=i.data,(o=t.actions).unshift.apply(o,Ke([],xe(a),!1)),t},e.prototype.resolveTransition=function(t,n,i,r,o){var a,u,s,c,l=this;o===void 0&&(o=Zr);var f=t.configuration,d=!n||t.transitions.length>0,p=d?t.configuration:n?n.configuration:[],h=fs(p,this),v=d?lT(this.machine,f):void 0,w=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,C=this.getActions(new Set(p),h,t,i,o,n,r),S=n?G({},n.activities):{};try{for(var T=Te(C),I=T.next();!I.done;I=T.next()){var x=I.value;try{for(var b=(s=void 0,Te(x.actions)),E=b.next();!E.done;E=b.next()){var P=E.value;P.type===_c?S[P.activity.id||P.activity.type]=P:P.type===Ql&&(S[P.activity.id||P.activity.type]=!1)}}catch(Pe){s={error:Pe}}finally{try{E&&!E.done&&(c=b.return)&&c.call(b)}finally{if(s)throw s.error}}}}catch(Pe){a={error:Pe}}finally{try{I&&!I.done&&(u=T.return)&&u.call(T)}finally{if(a)throw a.error}}var $=xe(Ps(this,n,i,o,C,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),L=$[0],R=$[1],A=xe(Bw(L,Bc),2),K=A[0],re=A[1],ze=L.filter(function(Pe){var it;return Pe.type===_c&&((it=Pe.activity)===null||it===void 0?void 0:it.type)===jc}),we=ze.reduce(function(Pe,it){return Pe[it.activity.id]=aT(it.activity,l.machine,R,o),Pe},n?G({},n.children):{}),Z=new En({value:v||n.value,context:R,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?w?Uw(w,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?re:[],activities:v?S:n?n.activities:{},events:[],configuration:p,transitions:t.transitions,children:we,done:h,tags:df(p),machine:this}),Q=i!==R;Z.changed=o.name===Kh||Q;var de=Z.history;de&&delete de.history;var _t=!h&&(this._transient||f.some(function(Pe){return Pe._transient}));if(!d&&(!_t||o.name===Gr))return Z;var ae=Z;if(!h)for(_t&&(ae=this.resolveRaisedTransition(ae,{type:Aw},o,r));K.length;){var jt=K.shift();ae=this.resolveRaisedTransition(ae,jt._event,o,r)}var rn=ae.changed||(de?!!ae.actions.length||Q||typeof de.value!=typeof ae.value||!av(ae.value,de.value):void 0);return ae.changed=rn,ae.history=de,ae},e.prototype.getStateNode=function(t){if(Rr(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[t];if(!n)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return n},e.prototype.getStateNodeById=function(t){var n=Rr(t)?t.slice(Lc.length):t;if(n===this.id)return this;var i=this.machine.idMap[n];if(!i)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return i},e.prototype.getStateNodeByPath=function(t){if(typeof t=="string"&&Rr(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=kc(t,this.delimiter).slice(),i=this;n.length;){var r=n.shift();if(!r.length)break;i=i.getStateNode(r)}return i},e.prototype.resolve=function(t){var n,i=this;if(!t)return this.initialStateValue||Mr;switch(this.type){case"parallel":return Lo(this.initialStateValue,function(o,a){return o?i.getStateNode(a).resolve(t[a]||o):Mr});case"compound":if(Ae(t)){var r=this.getStateNode(t);return r.type==="parallel"||r.type==="compound"?(n={},n[t]=r.initialStateValue,n):t}return Object.keys(t).length?Lo(t,function(o,a){return o?i.getStateNode(a).resolve(o):Mr}):this.initialStateValue||{};default:return t||Mr}},e.prototype.getResolvedPath=function(t){if(Rr(t)){var n=this.machine.idMap[t.slice(Lc.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return kc(t,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=uf(this.states,function(i){return i.initialStateValue||Mr},function(i){return i.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=Rs(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var i=this.getStateNodes(t);return this.resolveTransition({configuration:i,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;Ae(n.target)?t=Rr(n.target)?Os(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:t=n.target}return t},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(t,n,i){return i===void 0&&(i=!0),i?t.type==="history"?t.resolveHistory(n):t.initialStateNodes:[t]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var t=this;if(Rs(this))return[this];if(this.type==="compound"&&!this.initial)return at||At(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=cs(this.initialStateValue);return rt(n.map(function(i){return t.getFromRelativePath(i)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=xe(t),i=n[0],r=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(i,"' from node with no states"));var o=this.getStateNode(i);if(o.type==="history")return o.resolveHistory();if(!this.states[i])throw new Error("Child state '".concat(i,"' does not exist on '").concat(this.id,"'"));return this.states[i].getFromRelativePath(r)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:uf(this.states,function(n,i){if(!t)return n.historyValue();var r=Ae(t)?void 0:t[i];return n.historyValue(r||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var i=this.parent;if(!t){var r=this.target;return r?rt(cs(r).map(function(a){return i.getFromRelativePath(a)})):i.initialStateNodes}var o=jw(i.path,"states")(t).current;return Ae(o)?[i.getStateNode(o)]:rt(cs(o).map(function(a){return n.history==="deep"?i.getFromRelativePath(a):[i.states[a[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var t=this,n=rt(Object.keys(this.states).map(function(i){return t.states[i].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var t,n,i,r;if(this.__cache.events)return this.__cache.events;var o=this.states,a=new Set(this.ownEvents);if(o)try{for(var u=Te(Object.keys(o)),s=u.next();!s.done;s=u.next()){var c=s.value,l=o[c];if(l.states)try{for(var f=(i=void 0,Te(l.events)),d=f.next();!d.done;d=f.next()){var p=d.value;a.add("".concat(p))}}catch(h){i={error:h}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(i)throw i.error}}}}catch(h){t={error:h}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(i){if(!Ae(i))return i;var r=i[0]===n.delimiter;if(r&&!n.parent)return n.getStateNodeByPath(i.slice(1));var o=r?n.key+i:i;if(n.parent)try{var a=n.parent.getStateNodeByPath(o);return a}catch(u){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
22
|
-
`).concat(
|
|
17
|
+
***************************************************************************** */var ne=function(){return ne=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ne.apply(this,arguments)};function Sh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Le(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ue(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function gt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var ht;(function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"})(ht||(ht={}));var wo;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(wo||(wo={}));var Dd=ht.Start,wh=ht.Stop,hu=ht.Raise,Nl=ht.Send,OS=ht.Cancel,J$=ht.NullEvent,Ch=ht.Assign;ht.After;ht.DoneState;var DS=ht.Log,Q$=ht.Init,Nd=ht.Invoke;ht.ErrorExecution;var gm=ht.ErrorPlatform,Z$=ht.ErrorCustom,NS=ht.Update,eO=ht.Choose,tO=ht.Pure,PS=".",bm={},Pd="xstate.guard",nO="",Nt=process.env.NODE_ENV==="production",ju;function xh(e,t,n){n===void 0&&(n=PS);var r=As(e,n),i=As(t,n);return ze(i)?ze(r)?i===r:!1:ze(r)?r in i:Object.keys(r).every(function(o){return o in i?xh(r[o],i[o]):!1})}function RS(e){try{return ze(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function Rd(e,t){try{return qa(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function rO(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function As(e,t){if(rO(e))return e.value;if(qa(e))return Lc(e);if(typeof e!="string")return e;var n=Rd(e,t);return Lc(n)}function Lc(e){if(e.length===1)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function ps(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function Sm(e,t,n){var r,i,o={};try{for(var a=Le(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];n(c)&&(o[u]=t(c,u,e))}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var iO=function(e){return function(t){var n,r,i=t;try{for(var o=Le(e),a=o.next();!a.done;a=o.next()){var s=a.value;i=i[s]}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function oO(e,t){return function(n){var r,i,o=n;try{for(var a=Le(e),s=a.next();!s.done;s=a.next()){var u=s.value;o=o[t][u]}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function hc(e){if(!e)return[[]];if(ze(e))return[[e]];var t=Ot(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:hc(e[n]).map(function(i){return[n].concat(i)})}));return t}function Ot(e){var t;return(t=[]).concat.apply(t,gt([],Ue(e),!1))}function kS(e){return qa(e)?e:[e]}function pr(e){return e===void 0?[]:kS(e)}function Bc(e,t,n){var r,i;if(Ze(e))return e(t,n.data);var o={};try{for(var a=Le(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];Ze(c)?o[u]=c(t,n.data):o[u]=c}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function aO(e){return/^(done|error)\./.test(e)}function wm(e){return!!(e instanceof Promise||e!==null&&(Ze(e)||typeof e=="object")&&Ze(e.then))}function sO(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function uO(e,t){var n,r,i=Ue([[],[]],2),o=i[0],a=i[1];try{for(var s=Le(e),u=s.next();!u.done;u=s.next()){var c=u.value;t(c)?o.push(c):a.push(c)}}catch(l){n={error:l}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function MS(e,t){return ps(e.states,function(n,r){if(n){var i=(ze(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:MS(n,i)}}})}function cO(e,t){return{current:t,states:MS(e,t)}}function Cm(e,t,n,r){Nt||en(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,c=a.assignment,l={state:r,action:a,_event:t},f={};if(Ze(c))f=c(o,t.data,l);else try{for(var d=Le(Object.keys(c)),p=d.next();!p.done;p=d.next()){var h=p.value,v=c[h];f[h]=Ze(v)?v(o,t.data,l):v}}catch(C){s={error:C}}finally{try{p&&!p.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var en=function(){};Nt||(en=function(e,t){var n=e instanceof Error?e:void 0;if(!(!n&&e)&&console!==void 0){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});function qa(e){return Array.isArray(e)}function Ze(e){return typeof e=="function"}function ze(e){return typeof e=="string"}function jS(e,t){if(e)return ze(e)?{type:Pd,name:e,predicate:t?t[e]:void 0}:Ze(e)?{type:Pd,name:e.name,predicate:e}:e}function lO(e){try{return"subscribe"in e&&Ze(e.subscribe)}catch{return!1}}var wi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();ju={},ju[wi]=function(){return this},ju[Symbol.observable]=function(){return this};function ei(e){return!!e&&"__xstatenode"in e}function fO(e){return!!e&&typeof e.send=="function"}var dO=function(){var e=0;return function(){return e++,e.toString(16)}}();function Pl(e,t){return ze(e)||typeof e=="number"?ne({type:e},t):e}function cn(e,t){if(!ze(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=Pl(e);return ne({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Vo(e,t){var n=kS(t).map(function(r){return typeof r>"u"||typeof r=="string"||ei(r)?{target:r,event:e}:ne(ne({},r),{event:e})});return n}function pO(e){if(!(e===void 0||e===nO))return pr(e)}function hO(e,t,n){if(!Nt){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}function _S(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===Pd)return((o==null?void 0:o[t.name])||t.predicate)(n,r.data,a);var s=o==null?void 0:o[t.type];if(!s)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return s(n,r.data,a)}function qS(e){return typeof e=="string"?{type:e}:e}function vc(e,t,n){var r=function(){},i=typeof e=="object",o=i?e:null;return{next:((i?e.next:e)||r).bind(o),error:((i?e.error:t)||r).bind(o),complete:((i?e.complete:n)||r).bind(o)}}function _u(e,t){return"".concat(e,":invocation[").concat(t,"]")}function kd(e){return(e.type===hu||e.type===Nl&&e.to===wo.Internal)&&typeof e.delay!="number"}var ma=cn({type:Q$});function Md(e,t){return t&&t[e]||void 0}function Vs(e,t){var n;if(ze(e)||typeof e=="number"){var r=Md(e,t);Ze(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Ze(e))n={type:e.name||e.toString(),exec:e};else{var r=Md(e.type,t);if(Ze(r))n=ne(ne({},e),{exec:r});else if(r){var i=r.type||e.type;n=ne(ne(ne({},r),e),{type:i})}else n=e}return n}var Ci=function(e,t){if(!e)return[];var n=qa(e)?e:[e];return n.map(function(r){return Vs(r,t)})};function Eh(e){var t=Vs(e);return ne(ne({id:ze(e)?e:t.id},t),{type:t.type})}function vO(e,t){return{type:hu,event:typeof e=="function"?e:Pl(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function mO(e,t,n,r){var i={_event:n},o=cn(Ze(e.event)?e.event(t,n.data,i):e.event),a;if(ze(e.delay)){var s=r&&r[e.delay];a=Ze(s)?s(t,n.data,i):s}else a=Ze(e.delay)?e.delay(t,n.data,i):e.delay;return ne(ne({},e),{type:hu,_event:o,delay:a})}function Rl(e,t){return{to:t?t.to:void 0,type:Nl,event:Ze(e)?e:Pl(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Ze(e)?e.name:RS(e)}}function yO(e,t,n,r){var i={_event:n},o=cn(Ze(e.event)?e.event(t,n.data,i):e.event),a;if(ze(e.delay)){var s=r&&r[e.delay];a=Ze(s)?s(t,n.data,i):s}else a=Ze(e.delay)?e.delay(t,n.data,i):e.delay;var u=Ze(e.to)?e.to(t,n.data,i):e.to;return ne(ne({},e),{to:u,_event:o,event:o.data,delay:a})}function gO(e,t){return Rl(e,ne(ne({},t),{to:wo.Parent}))}var bO=function(e,t,n){return ne(ne({},e),{value:ze(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},SO=function(e){return{type:OS,sendId:e}};function wO(e){var t=Eh(e);return{type:ht.Start,activity:t,exec:void 0}}function CO(e){var t=Ze(e)?e:Eh(e);return{type:ht.Stop,activity:t,exec:void 0}}function xO(e,t,n){var r=Ze(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:ht.Stop,activity:i};return o}var EO=function(e){return{type:Ch,assignment:e}};function TO(e,t){var n=t?"#".concat(t):"";return"".concat(ht.After,"(").concat(e,")").concat(n)}function qu(e,t){var n="".concat(ht.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function mc(e,t){var n="".concat(ht.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function hs(e,t){var n="".concat(ht.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function IO(e,t){if(!Nt&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,gt([],Ue(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return Rl(function(r,i){return i},ne(ne({},t),{to:e}))}var AO=function(e){var t,n,r=[];try{for(var i=Le(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===Ch){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function Vc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:AO(i),u=s.length?Cm(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var C;switch(v.type){case hu:{var E=mO(v,u,r,e.options.delays);return o&&typeof E.delay=="number"&&o(E,u,r),E}case Nl:var y=yO(v,u,r,e.options.delays);if(!Nt){var w=v.delay;en(!ze(w)||typeof y.delay=="number","No delay reference for delay expression '".concat(w,"' was found on machine '").concat(e.id,"'"))}return o&&y.to!==wo.Internal&&(h==="entry"?l.push(y):o(y,u,r)),y;case DS:{var x=bO(v,u,r);return o==null||o(x,u,r),x}case eO:{var S=v,T=(C=S.conds.find(function(B){var U=jS(B.cond,e.options.guards);return!U||_S(e,U,u,r,o?void 0:t)}))===null||C===void 0?void 0:C.actions;if(!T)return[];var A=Ue(Vc(e,t,u,r,[{type:h,actions:Ci(pr(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case tO:{var T=v.get(u,r.data);if(!T)return[];var N=Ue(Vc(e,t,u,r,[{type:h,actions:Ci(pr(T),e.options.actions)}],o,a),2),j=N[0],L=N[1];return u=L,c==null||c.push(u),j}case wh:{var x=xO(v,u,r);return o==null||o(x,n,r),x}case Ch:{u=Cm(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=Vs(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=ne(ne({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,gt([c[R]],Ue(U),!1))}});V=ie}return V}}function d(h){var v,C,E=[];try{for(var y=Le(h.actions),w=y.next();!w.done;w=y.next()){var x=w.value,S=f(h.type,x);S&&(E=E.concat(S))}}catch(T){v={error:T}}finally{try{w&&!w.done&&(C=y.return)&&C.call(y)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,E}var p=Ot(i.map(d));return[p,u]}var Uc=[],ea=function(e,t){Uc.push(e);var n=t(e);return Uc.pop(),n},$O=function(e){return e(Uc[Uc.length-1])};function FS(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[wi]=function(){return this},t}function OO(e,t,n,r){var i,o=qS(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?Bc(e.data,n,r):void 0,u=a?Th(a,e.id,s):FS(e.id);return u.meta=e,u}function Th(e,t,n){var r=FS(t);if(r.deferred=!0,ei(e)){var i=r.state=ea(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function DO(e){try{return typeof e.send=="function"}catch{return!1}}function NO(e){return DO(e)&&"id"in e}function PO(e){var t;return ne((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[wi]=function(){return this},t),e)}var Gc=function(e){return e.type==="atomic"||e.type==="final"};function LS(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Us(e){return LS(e).filter(function(t){return t.type!=="history"})}function BS(e){var t=[e];return Gc(e)?t:t.concat(Ot(Us(e).map(BS)))}function vs(e,t){var n,r,i,o,a,s,u,c,l=new Set(e),f=jd(l),d=new Set(t);try{for(var p=Le(d),h=p.next();!h.done;h=p.next())for(var v=h.value,C=v.parent;C&&!d.has(C);)d.add(C),C=C.parent}catch(I){n={error:I}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var E=jd(d);try{for(var y=Le(d),w=y.next();!w.done;w=y.next()){var v=w.value;if(v.type==="compound"&&(!E.get(v)||!E.get(v).length))f.get(v)?f.get(v).forEach(function(N){return d.add(N)}):v.initialStateNodes.forEach(function(N){return d.add(N)});else if(v.type==="parallel")try{for(var x=(a=void 0,Le(Us(v))),S=x.next();!S.done;S=x.next()){var T=S.value;d.has(T)||(d.add(T),f.get(T)?f.get(T).forEach(function(N){return d.add(N)}):T.initialStateNodes.forEach(function(N){return d.add(N)}))}}catch(N){a={error:N}}finally{try{S&&!S.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{w&&!w.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}try{for(var A=Le(d),D=A.next();!D.done;D=A.next())for(var v=D.value,C=v.parent;C&&!d.has(C);)d.add(C),C=C.parent}catch(I){u={error:I}}finally{try{D&&!D.done&&(c=A.return)&&c.call(A)}finally{if(u)throw u.error}}return d}function VS(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(Gc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=VS(o,t)}),i}function jd(e){var t,n,r=new Map;try{for(var i=Le(e),o=i.next();!o.done;o=i.next()){var a=o.value;r.has(a)||r.set(a,[]),a.parent&&(r.has(a.parent)||r.set(a.parent,[]),r.get(a.parent).push(a))}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function RO(e,t){var n=vs([e],t);return VS(e,jd(n))}function ms(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function kO(e){return gt([],Ue(new Set(Ot(gt([],Ue(e.map(function(t){return t.ownEvents})),!1)))),!1)}function yc(e,t){return t.type==="compound"?Us(t).some(function(n){return n.type==="final"&&ms(e,n)}):t.type==="parallel"?Us(t).every(function(n){return yc(e,n)}):!1}function MO(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function xm(e){return new Set(Ot(e.map(function(t){return t.tags})))}function US(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(ze(e)||ze(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return US(e[i],t[i])})}function jO(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function _O(e,t){var n=e.exec,r=ne(ne({},e),{exec:n!==void 0?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0});return r}var er=function(){function e(t){var n=this,r;this.actions=[],this.activities=bm,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||bm,this.meta=MO(t.configuration),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=(r=Array.isArray(t.tags)?new Set(t.tags):t.tags)!==null&&r!==void 0?r:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return kO(n.configuration)}})}return e.from=function(t,n){if(t instanceof e)return t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t;var r=ma;return new e({value:t,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=ma;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var r=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),ze(t))return[t];var i=Object.keys(t);return i.concat.apply(i,gt([],Ue(i.map(function(o){return r.toStrings(t[o],n).map(function(a){return o+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var r=Sh(t,["configuration","transitions","tags","machine"]);return ne(ne({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return xh(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;Nt&&en(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,t);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},e}(),qO={deferEvents:!1},Em=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=ne(ne({},qO),t)}return e.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},e.prototype.schedule=function(t){if(!this.initialized||this.processingEvent){this.queue.push(t);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},e.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},e}(),$f=new Map,FO=0,is={bookId:function(){return"x:".concat(FO++)},register:function(e,t){return $f.set(e,t),e},get:function(e){return $f.get(e)},free:function(e){$f.delete(e)}};function Ih(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;Nt||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues")}function LO(){var e=Ih();if(e&&"__xstate__"in e)return e.__xstate__}function BO(e){if(Ih()){var t=LO();t&&t.register(e)}}function VO(e,t){t===void 0&&(t={});var n=e.initialState,r=new Set,i=[],o=!1,a=function(){if(!o){for(o=!0;i.length>0;){var c=i.shift();n=e.transition(n,c,u),r.forEach(function(l){return l.next(n)})}o=!1}},s=PO({id:t.id,send:function(c){i.push(c),a()},getSnapshot:function(){return n},subscribe:function(c,l,f){var d=vc(c,l,f);return r.add(d),d.next(n),{unsubscribe:function(){r.delete(d)}}}}),u={parent:t.parent,self:s,id:t.id||"anonymous",observers:r};return n=e.start?e.start(u):n,s}var _d={sync:!1,autoForward:!1},Rt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Rt||(Rt={}));var UO=function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var r=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=Rt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(l,f){if(qa(l))return r.batch(l),r.state;var d=cn(Pl(l,f));if(r.status===Rt.Stopped)return Nt||en(!1,'Event "'.concat(d.name,'" was sent to stopped service "').concat(r.machine.id,`". This service has already reached its final state, and will not transition.
|
|
18
|
+
Event: `).concat(JSON.stringify(d.data))),r.state;if(r.status!==Rt.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(d.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
|
|
19
|
+
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var p=r._nextState(d);r.update(p,d)}),r._state},this.sendTo=function(l,f,d){var p=r.parent&&(f===wo.Parent||r.parent.id===f),h=p?r.parent:ze(f)?f===wo.Internal?r:r.children.get(f)||is.get(f):fO(f)?f:void 0;if(!h){if(!p)throw new Error("Unable to send event to child '".concat(f,"' from service '").concat(r.id,"'."));Nt||en(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(l.type));return}if("machine"in h){if(r.status!==Rt.Stopped||r.parent!==h||r.state.done){var v=ne(ne({},l),{name:l.name===Z$?"".concat(hs(r.id)):l.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,v]):h.send(v)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,l.data]):h.send(l.data)},this._exec=function(l,f,d,p){p===void 0&&(p=r.machine.options.actions);var h=l.exec||Md(l.type,p),v=Ze(h)?h:h?h.exec:l.exec;if(v)try{return v(f,d.data,r.machine.config.predictableActionArguments?{action:l,_event:d}:{action:l,state:r.state,_event:d})}catch(H){throw r.parent&&r.parent.send({type:"xstate.error",data:H}),H}switch(l.type){case hu:{var C=l;r.defer(C);break}case Nl:var E=l;if(typeof E.delay=="number"){r.defer(E);return}else E.to?r.sendTo(E._event,E.to,d===ma):r.send(E._event);break;case OS:r.cancel(l.sendId);break;case Dd:{if(r.status!==Rt.Running)return;var y=l.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[y.id||y.type])break;if(y.type===ht.Invoke){var w=qS(y.src),x=r.machine.options.services?r.machine.options.services[w.type]:void 0,S=y.id,T=y.data;Nt||en(!("forward"in y),"`forward` property is deprecated (found in invocation of '".concat(y.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var A="autoForward"in y?y.autoForward:!!y.forward;if(!x){Nt||en(!1,"No service found for invocation '".concat(y.src,"' in machine '").concat(r.machine.id,"'."));return}var D=T?Bc(T,f,d):void 0;if(typeof x=="string")return;var I=Ze(x)?x(f,d.data,{data:D,src:w,meta:y.meta}):x;if(!I)return;var N=void 0;ei(I)&&(I=D?I.withContext(D):I,N={autoForward:A}),r.spawn(I,S,N)}else r.spawnActivity(y);break}case wh:{r.stopChild(l.activity.id);break}case DS:var j=l,L=j.label,V=j.value;L?r.logger(L,V):r.logger(V);break;default:Nt||en(!1,"No implementation found for action type '".concat(l.type,"'"));break}};var i=ne(ne({},e.defaultOptions),n),o=i.clock,a=i.logger,s=i.parent,u=i.id,c=u!==void 0?u:t.id;this.id=c,this.logger=a,this.clock=o,this.parent=s,this.options=i,this.scheduler=new Em({deferEvents:this.options.deferEvents}),this.sessionId=is.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:ea(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return Nt||en(this.status!==Rt.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(t,n){var r,i;try{for(var o=Le(t.actions),a=o.next();!a.done;a=o.next()){var s=a.value;this.exec(s,t,n)}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},e.prototype.update=function(t,n){var r,i,o,a,s,u,c,l,f=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||n===ma)&&this.options.execute)this.execute(this.state);else for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);if(this.children.forEach(function(I){f.state.children[I.id]=I}),this.devTools&&this.devTools.send(n.data,t),t.event)try{for(var p=Le(this.eventListeners),h=p.next();!h.done;h=p.next()){var v=h.value;v(t.event)}}catch(I){r={error:I}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var C=Le(this.listeners),E=C.next();!E.done;E=C.next()){var v=E.value;v(t,t.event)}}catch(I){o={error:I}}finally{try{E&&!E.done&&(a=C.return)&&a.call(C)}finally{if(o)throw o.error}}try{for(var y=Le(this.contextListeners),w=y.next();!w.done;w=y.next()){var x=w.value;x(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(I){s={error:I}}finally{try{w&&!w.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}if(this.state.done){var S=t.configuration.find(function(I){return I.type==="final"&&I.parent===f.machine}),T=S&&S.doneData?Bc(S.doneData,t.context,n):void 0;this._doneEvent=mc(this.id,T);try{for(var A=Le(this.doneListeners),D=A.next();!D.done;D=A.next()){var v=D.value;v(this._doneEvent)}}catch(I){c={error:I}}finally{try{D&&!D.done&&(l=A.return)&&l.call(A)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),is.free(this.sessionId)}},e.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Rt.Running&&t(this.state,this.state.event),this},e.prototype.subscribe=function(t,n,r){var i=this,o=vc(t,n,r);this.listeners.add(o.next),this.status!==Rt.NotStarted&&o.next(this.state);var a=function(){i.doneListeners.delete(a),i.stopListeners.delete(a),o.complete()};return this.status===Rt.Stopped?o.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){i.listeners.delete(o.next),i.doneListeners.delete(a),i.stopListeners.delete(a)}}},e.prototype.onEvent=function(t){return this.eventListeners.add(t),this},e.prototype.onSend=function(t){return this.sendListeners.add(t),this},e.prototype.onChange=function(t){return this.contextListeners.add(t),this},e.prototype.onStop=function(t){return this.stopListeners.add(t),this},e.prototype.onDone=function(t){return this.status===Rt.Stopped&&this._doneEvent?t(this._doneEvent):this.doneListeners.add(t),this},e.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},e.prototype.start=function(t){var n=this;if(this.status===Rt.Running)return this;this.machine._init(),is.register(this.sessionId,this),this.initialized=!0,this.status=Rt.Running;var r=t===void 0?this.initialState:ea(this,function(){return jO(t)?n.machine.resolveState(t):n.machine.resolveState(er.from(t,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,ma)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(t){Ze(t.stop)&&t.stop()}),this.children.clear()},e.prototype._stop=function(){var t,n,r,i,o,a,s,u,c,l;try{for(var f=Le(this.listeners),d=f.next();!d.done;d=f.next()){var p=d.value;this.listeners.delete(p)}}catch(A){t={error:A}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}try{for(var h=Le(this.stopListeners),v=h.next();!v.done;v=h.next()){var p=v.value;p(),this.stopListeners.delete(p)}}catch(A){r={error:A}}finally{try{v&&!v.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}try{for(var C=Le(this.contextListeners),E=C.next();!E.done;E=C.next()){var p=E.value;this.contextListeners.delete(p)}}catch(A){o={error:A}}finally{try{E&&!E.done&&(a=C.return)&&a.call(C)}finally{if(o)throw o.error}}try{for(var y=Le(this.doneListeners),w=y.next();!w.done;w=y.next()){var p=w.value;this.doneListeners.delete(p)}}catch(A){s={error:A}}finally{try{w&&!w.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Rt.Stopped,this._initialState=void 0;try{for(var x=Le(Object.keys(this.delayedEventsMap)),S=x.next();!S.done;S=x.next()){var T=S.value;this.clock.clearTimeout(this.delayedEventsMap[T])}}catch(A){c={error:A}}finally{try{S&&!S.done&&(l=x.return)&&l.call(x)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new Em({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var t=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r;if(!(!((r=t._state)===null||r===void 0)&&r.done)){var i=cn({type:"xstate.stop"}),o=ea(t,function(){var a=Ot(gt([],Ue(t.state.configuration),!1).sort(function(f,d){return d.order-f.order}).map(function(f){return Ci(f.onExit,t.machine.options.actions)})),s=Ue(Vc(t.machine,t.state,t.state.context,i,[{type:"exit",actions:a}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),u=s[0],c=s[1],l=new er({value:t.state.value,context:c,_event:i,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:u.filter(function(f){return!kd(f)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return l.changed=!0,l});t.update(o,i),t._stopChildren(),is.free(t.sessionId)}}),this},e.prototype.batch=function(t){var n=this;if(this.status===Rt.NotStarted&&this.options.deferEvents)Nt||en(!1,"".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,`" and are deferred. Make sure .start() is called for this service.
|
|
20
|
+
Event: `).concat(JSON.stringify(event)));else if(this.status!==Rt.Running)throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(t.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,a=n.state,s=!1,u=[],c=function(p){var h=cn(p);n.forward(h),a=ea(n,function(){return n.machine.transition(a,h,void 0,r||void 0)}),u.push.apply(u,gt([],Ue(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return _O(v,a)})),!1)),s=s||!!a.changed};try{for(var l=Le(t),f=l.next();!f.done;f=l.next()){var d=f.value;c(d)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,cn(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=cn(t);if(i.name.indexOf(gm)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(gm)===0}))throw i.data.data;var o=ea(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},e.prototype.nextState=function(t){return this._nextState(t,!1)},e.prototype.forward=function(t){var n,r;try{for(var i=Le(this.forwardTo),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));s.send(t)}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.defer=function(t){var n=this,r=this.clock.setTimeout(function(){"to"in t&&t.to?n.sendTo(t._event,t.to,!0):n.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=r)},e.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},e.prototype.exec=function(t,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(t,n.context,n._event,r)},e.prototype.removeChild=function(t){var n;this.children.delete(t),this.forwardTo.delete(t),(n=this.state)===null||n===void 0||delete n.children[t]},e.prototype.stopChild=function(t){var n=this.children.get(t);n&&(this.removeChild(t),Ze(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Rt.Running)return Th(t,n);if(wm(t))return this.spawnPromise(Promise.resolve(t),n);if(Ze(t))return this.spawnCallback(t,n);if(NO(t))return this.spawnActor(t,n);if(lO(t))return this.spawnObservable(t,n);if(ei(t))return this.spawnMachine(t,ne(ne({},r),{id:n}));if(sO(t))return this.spawnBehavior(t,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof t,'".'))},e.prototype.spawnMachine=function(t,n){var r=this;n===void 0&&(n={});var i=new e(t,ne(ne({},this.options),{parent:this,id:n.id||t.id})),o=ne(ne({},_d),n);o.sync&&i.onTransition(function(s){r.send(NS,{state:s,id:i.id})});var a=i;return this.children.set(i.id,a),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(s){r.removeChild(i.id),r.send(cn(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=VO(t,{id:n,parent:this});return this.children.set(n,r),r},e.prototype.spawnPromise=function(t,n){var r,i=this,o=!1,a;t.then(function(u){o||(a=u,i.removeChild(n),i.send(cn(mc(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var c=hs(n,u);try{i.send(cn(c,{origin:n}))}catch(l){hO(u,l,n),i.devTools&&i.devTools.send(c,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,c,l){var f=vc(u,c,l),d=!1;return t.then(function(p){d||(f.next(p),!d&&f.complete())},function(p){d||f.error(p)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[wi]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnCallback=function(t,n){var r,i=this,o=!1,a=new Set,s=new Set,u,c=function(d){u=d,s.forEach(function(p){return p(d)}),!o&&i.send(cn(d,{origin:n}))},l;try{l=t(c,function(d){a.add(d)})}catch(d){this.send(hs(n,d))}if(wm(l))return this.spawnPromise(l,n);var f=(r={id:n,send:function(d){return a.forEach(function(p){return p(d)})},subscribe:function(d){var p=vc(d);return s.add(p.next),{unsubscribe:function(){s.delete(p.next)}}},stop:function(){o=!0,Ze(l)&&l()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[wi]=function(){return this},r);return this.children.set(n,f),f},e.prototype.spawnObservable=function(t,n){var r,i=this,o,a=t.subscribe(function(u){o=u,i.send(cn(u,{origin:n}))},function(u){i.removeChild(n),i.send(cn(hs(n,u),{origin:n}))},function(){i.removeChild(n),i.send(cn(mc(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,c,l){return t.subscribe(u,c,l)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[wi]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnActor=function(t,n){return this.children.set(n,t),t},e.prototype.spawnActivity=function(t){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(!n){Nt||en(!1,"No implementation found for activity '".concat(t.type,"'"));return}var r=n(this.state.context,t);this.spawnEffect(t.id,r)},e.prototype.spawnEffect=function(t,n){var r;this.children.set(t,(r={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}},r[wi]=function(){return this},r))},e.prototype.attachDev=function(){var t=Ih();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(ne(ne({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:ne({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}BO(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[wi]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Rt.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,n){return setTimeout(t,n)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},e.interpret=GS,e}(),GO=function(e){return ze(e)?ne(ne({},_d),{name:e}):ne(ne(ne({},_d),{name:dO()}),e)};function Tm(e,t){var n=GO(t);return $O(function(r){if(!Nt){var i=ei(e)||Ze(e);en(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(ei(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):Th(e,n.name)})}function GS(e,t){var n=new UO(e,t);return n}function zO(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function Fu(e){return ne(ne({type:Nd},e),{toJSON:function(){e.onDone,e.onError;var t=Sh(e,["onDone","onError"]);return ne(ne({},t),{type:Nd,src:zO(e.src)})}})}var ta="",qd="#",os="*",Uo={},Go=function(e){return e[0]===qd},WO=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},HO=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(ze(o.target)||ei(o.target))}),i=t===ta?"the transient event":"event '".concat(t,"'");en(!r,"One or more transitions for ".concat(i," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},KO=function(){function e(t,n,r,i){r===void 0&&(r="context"in t?t.context:void 0);var o=this,a;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(WO(),n),this.parent=i==null?void 0:i.parent,this.key=this.config.key||(i==null?void 0:i.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:PS),this.id=this.config.id||gt([this.machine.key],Ue(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,Nt||en(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?ps(this.config.states,function(c,l){var f,d=new e(c,{},void 0,{parent:o,key:l});return Object.assign(o.idMap,ne((f={},f[d.id]=d,f),d.idMap)),d}):Uo;var s=0;function u(c){var l,f;c.order=s++;try{for(var d=Le(LS(c)),p=d.next();!p.done;p=d.next()){var h=p.value;u(h)}}catch(v){l={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}finally{if(l)throw l.error}}}u(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(c){var l=c.event;return l===ta}):ta in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=pr(this.config.entry||this.config.onEntry).map(function(c){return Vs(c)}),this.onExit=pr(this.config.exit||this.config.onExit).map(function(c){return Vs(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=pr(this.config.invoke).map(function(c,l){var f,d;if(ei(c)){var p=_u(o.id,l);return o.machine.options.services=ne((f={},f[p]=c,f),o.machine.options.services),Fu({src:p,id:p})}else if(ze(c.src)){var p=c.id||_u(o.id,l);return Fu(ne(ne({},c),{id:p,src:c.src}))}else if(ei(c.src)||Ze(c.src)){var p=c.id||_u(o.id,l);return o.machine.options.services=ne((d={},d[p]=c.src,d),o.machine.options.services),Fu(ne(ne({id:p},c),{src:p}))}else{var h=c.src;return Fu(ne(ne({id:_u(o.id,l)},c),{src:h}))}}),this.activities=pr(this.config.activities).concat(this.invoke).map(function(c){return Eh(c)}),this.transition=this.transition.bind(this),this.tags=pr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||BS(this).forEach(function(t){return t.on})},e.prototype.withConfig=function(t,n){var r=this.options,i=r.actions,o=r.activities,a=r.guards,s=r.services,u=r.delays;return new e(this.config,{actions:ne(ne({},i),t.actions),activities:ne(ne({},o),t.activities),guards:ne(ne({},a),t.guards),services:ne(ne({},s),t.services),delays:ne(ne({},u),t.delays)},n??this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return Ze(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:ps(this.states,function(t){return t.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var n=t===ta,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===os});return this.__cache.candidates[t]=r,r},e.prototype.getDelayedTransitions=function(){var t=this,n=this.config.after;if(!n)return[];var r=function(o,a){var s=Ze(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=TO(s,t.id);return t.onEntry.push(Rl(u,{delay:o})),t.onExit.push(SO(u)),u},i=qa(n)?n.map(function(o,a){var s=r(o.delay,a);return ne(ne({},o),{event:s})}):Ot(Object.keys(n).map(function(o,a){var s=n[o],u=ze(s)?{target:s}:s,c=isNaN(+o)?o:+o,l=r(c,a);return pr(u).map(function(f){return ne(ne({},f),{event:l,delay:c})})}));return i.map(function(o){var a=o.delay;return ne(ne({},t.formatTransition(o)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,r=this;if(!t)return[];var i=t instanceof er?t.value:As(t,this.delimiter);if(ze(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var a=Object.keys(i),s=[this];return s.push.apply(s,gt([],Ue(Ot(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=RS(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof er?t:er.create(t),r=Array.from(vs([],this.getStateNodes(n.value)));return new er(ne(ne({},n),{value:this.resolve(n.value),configuration:r,done:yc(r,this),tags:xm(r),machine:this.machine}))},e.prototype.transitionLeafNode=function(t,n,r){var i=this.getStateNode(t),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},e.prototype.transitionCompoundNode=function(t,n,r){var i=Object.keys(t),o=this.getStateNode(i[0]),a=o._transition(t[i[0]],n,r);return!a||!a.transitions.length?this.next(n,r):a},e.prototype.transitionParallelNode=function(t,n,r){var i,o,a={};try{for(var s=Le(Object.keys(t)),u=s.next();!u.done;u=s.next()){var c=u.value,l=t[c];if(l){var f=this.getStateNode(c),d=f._transition(l,n,r);d&&(a[c]=d)}}}catch(E){i={error:E}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var p=Object.keys(a).map(function(E){return a[E]}),h=Ot(p.map(function(E){return E.transitions})),v=p.some(function(E){return E.transitions.length>0});if(!v)return this.next(n,r);var C=Ot(Object.keys(a).map(function(E){return a[E].configuration}));return{transitions:h,exitSet:Ot(p.map(function(E){return E.exitSet})),configuration:C,source:n,actions:Ot(Object.keys(a).map(function(E){return a[E].actions}))}},e.prototype._transition=function(t,n,r){return ze(t)?this.transitionLeafNode(t,n,r):Object.keys(t).length===1?this.transitionCompoundNode(t,n,r):this.transitionParallelNode(t,n,r)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,cn(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],c;try{for(var l=Le(this.getCandidates(a)),f=l.next();!f.done;f=l.next()){var d=f.value,p=d.cond,h=d.in,v=t.context,C=h?ze(h)&&Go(h)?t.matches(As(this.getStateNodeById(h).path,this.delimiter)):xh(As(h,this.delimiter),iO(this.path.slice(0,-2))(t.value)):!0,E=!1;try{E=!p||_S(this.machine,p,v,n,t)}catch(x){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
21
|
+
`).concat(x.message))}if(E&&C){d.target!==void 0&&(u=d.target),s.push.apply(s,gt([],Ue(d.actions),!1)),c=d;break}}}catch(x){r={error:x}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}if(c){if(!u.length)return{transitions:[c],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var y=Ot(u.map(function(x){return o.getRelativeStateNodes(x,t.historyValue)})),w=!!c.internal;return{transitions:[c],exitSet:w?[]:Ot(u.map(function(x){return o.getPotentiallyReenteringNodes(x)})),configuration:y,source:t,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var n=[],r=this,i=t;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},e.prototype.getActions=function(t,n,r,i,o,a,s){var u,c,l,f,d=this,p=a?vs([],this.getStateNodes(a.value)):[],h=new Set;try{for(var v=Le(Array.from(t).sort(function(j,L){return j.order-L.order})),C=v.next();!C.done;C=v.next()){var E=C.value;(!ms(p,E)||ms(r.exitSet,E)||E.parent&&h.has(E.parent))&&h.add(E)}}catch(j){u={error:j}}finally{try{C&&!C.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}try{for(var y=Le(p),w=y.next();!w.done;w=y.next()){var E=w.value;(!ms(t,E)||ms(r.exitSet,E.parent))&&r.exitSet.push(E)}}catch(j){l={error:j}}finally{try{w&&!w.done&&(f=y.return)&&f.call(y)}finally{if(l)throw l.error}}r.exitSet.sort(function(j,L){return L.order-j.order});var x=Array.from(h).sort(function(j,L){return j.order-L.order}),S=new Set(r.exitSet),T=Ot(x.map(function(j){var L=[];if(j.type!=="final")return L;var V=j.parent;if(!V.parent)return L;L.push(qu(j.id,j.doneData),qu(V.id,j.doneData?Bc(j.doneData,i,o):void 0));var H=V.parent;return H.type==="parallel"&&Us(H).every(function(R){return yc(r.configuration,R)})&&L.push(qu(H.id)),L})),A=x.map(function(j){var L=j.onEntry,V=j.activities.map(function(H){return wO(H)});return{type:"entry",actions:Ci(s?gt(gt([],Ue(L),!1),Ue(V),!1):gt(gt([],Ue(V),!1),Ue(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:T.map(function(j){return vO(j)})}),D=Array.from(S).map(function(j){return{type:"exit",actions:Ci(gt(gt([],Ue(j.onExit),!1),Ue(j.activities.map(function(L){return CO(L)})),!1),d.machine.options.actions)}}),I=D.concat({type:"transition",actions:Ci(r.actions,this.machine.options.actions)}).concat(A);if(n){var N=Ci(Ot(gt([],Ue(t),!1).sort(function(j,L){return L.order-j.order}).map(function(j){return j.onExit})),this.machine.options.actions).filter(function(j){return!kd(j)});return I.concat({type:"stop",actions:N})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=cn(n),a;if(t instanceof er)a=r===void 0?t:this.resolveState(er.from(t,r));else{var s=ze(t)?this.resolve(Lc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(er.from(s,u))}if(!Nt&&o.name===os)throw new Error("An event cannot have the wildcard type ('".concat(os,"')"));if(this.strict&&!this.events.includes(o.name)&&!aO(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},l=vs([],this.getStateNodes(a.value)),f=c.configuration.length?vs(l,c.configuration):l;return c.configuration=gt([],Ue(f),!1),this.resolveTransition(c,a,a.context,i,o)},e.prototype.resolveRaisedTransition=function(t,n,r,i){var o,a=t.actions;return t=this.transition(t,n,void 0,i),t._event=r,t.event=r.data,(o=t.actions).unshift.apply(o,gt([],Ue(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,c,l=this;o===void 0&&(o=ma);var f=t.configuration,d=!n||t.transitions.length>0,p=d?t.configuration:n?n.configuration:[],h=yc(p,this),v=d?RO(this.machine,f):void 0,C=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,E=this.getActions(new Set(p),h,t,r,o,n,i),y=n?ne({},n.activities):{};try{for(var w=Le(E),x=w.next();!x.done;x=w.next()){var S=x.value;try{for(var T=(u=void 0,Le(S.actions)),A=T.next();!A.done;A=T.next()){var D=A.value;D.type===Dd?y[D.activity.id||D.activity.type]=D:D.type===wh&&(y[D.activity.id||D.activity.type]=!1)}}catch(K){u={error:K}}finally{try{A&&!A.done&&(c=T.return)&&c.call(T)}finally{if(u)throw u.error}}}}catch(K){a={error:K}}finally{try{x&&!x.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}var I=Ue(Vc(this,n,r,o,E,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),N=I[0],j=I[1],L=Ue(uO(N,kd),2),V=L[0],H=L[1],R=N.filter(function(K){var ae;return K.type===Dd&&((ae=K.activity)===null||ae===void 0?void 0:ae.type)===Nd}),ie=R.reduce(function(K,ae){return K[ae.activity.id]=OO(ae.activity,l.machine,j,o),K},n?ne({},n.children):{}),B=new er({value:v||n.value,context:j,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?C?cO(C,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?H:[],activities:v?y:n?n.activities:{},events:[],configuration:p,transitions:t.transitions,children:ie,done:h,tags:xm(p),machine:this}),U=r!==j;B.changed=o.name===NS||U;var fe=B.history;fe&&delete fe.history;var M=!h&&(this._transient||f.some(function(K){return K._transient}));if(!d&&(!M||o.name===ta))return B;var P=B;if(!h)for(M&&(P=this.resolveRaisedTransition(P,{type:J$},o,i));V.length;){var te=V.shift();P=this.resolveRaisedTransition(P,te._event,o,i)}var oe=P.changed||(fe?!!P.actions.length||U||typeof fe.value!=typeof P.value||!US(P.value,fe.value):void 0);return P.changed=oe,P.history=fe,P},e.prototype.getStateNode=function(t){if(Go(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[t];if(!n)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return n},e.prototype.getStateNodeById=function(t){var n=Go(t)?t.slice(qd.length):t;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},e.prototype.getStateNodeByPath=function(t){if(typeof t=="string"&&Go(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=Rd(t,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},e.prototype.resolve=function(t){var n,r=this;if(!t)return this.initialStateValue||Uo;switch(this.type){case"parallel":return ps(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):Uo});case"compound":if(ze(t)){var i=this.getStateNode(t);return i.type==="parallel"||i.type==="compound"?(n={},n[t]=i.initialStateValue,n):t}return Object.keys(t).length?ps(t,function(o,a){return o?r.getStateNode(a).resolve(o):Uo}):this.initialStateValue||{};default:return t||Uo}},e.prototype.getResolvedPath=function(t){if(Go(t)){var n=this.machine.idMap[t.slice(qd.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return Rd(t,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=Sm(this.states,function(r){return r.initialStateValue||Uo},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=Gc(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;ze(n.target)?t=Go(n.target)?Lc(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:t=n.target}return t},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(t,n,r){return r===void 0&&(r=!0),r?t.type==="history"?t.resolveHistory(n):t.initialStateNodes:[t]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var t=this;if(Gc(this))return[this];if(this.type==="compound"&&!this.initial)return Nt||en(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=hc(this.initialStateValue);return Ot(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=Ue(t),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(i)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:Sm(this.states,function(n,r){if(!t)return n.historyValue();var i=ze(t)?void 0:t[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!t){var i=this.target;return i?Ot(hc(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=oO(r.path,"states")(t).current;return ze(o)?[r.getStateNode(o)]:Ot(hc(o).map(function(a){return n.history==="deep"?r.getFromRelativePath(a):[r.states[a[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var t=this,n=Ot(Object.keys(this.states).map(function(r){return t.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var t,n,r,i;if(this.__cache.events)return this.__cache.events;var o=this.states,a=new Set(this.ownEvents);if(o)try{for(var s=Le(Object.keys(o)),u=s.next();!u.done;u=s.next()){var c=u.value,l=o[c];if(l.states)try{for(var f=(r=void 0,Le(l.events)),d=f.next();!d.done;d=f.next()){var p=d.value;a.add("".concat(p))}}catch(h){r={error:h}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(h){t={error:h}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(r){if(!ze(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var a=n.parent.getStateNodeByPath(o);return a}catch(s){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
22
|
+
`).concat(s.message))}else return n.getStateNodeByPath(o)})},e.prototype.formatTransition=function(t){var n=this,r=pO(t.target),i="internal"in t?t.internal:r?r.some(function(u){return ze(u)&&u[0]===n.delimiter}):!0,o=this.machine.options.guards,a=this.resolveTarget(r),s=ne(ne({},t),{actions:Ci(pr(t.actions)),cond:jS(t.cond,o),target:a,source:this,internal:i,eventType:t.event,toJSON:function(){return ne(ne({},s),{target:s.target?s.target.map(function(u){return"#".concat(u.id)}):void 0,source:"#".concat(n.id)})}});return s},e.prototype.formatTransitions=function(){var t,n,r=this,i;if(!this.config.on)i=[];else if(Array.isArray(this.config.on))i=this.config.on;else{var o=this.config.on,a=os,s=o[a],u=s===void 0?[]:s,c=Sh(o,[typeof a=="symbol"?a:a+""]);i=Ot(Object.keys(c).map(function(y){!Nt&&y===ta&&en(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(r.id,'".'));var w=Vo(y,c[y]);return Nt||HO(r,y,w),w}).concat(Vo(os,u)))}var l=this.config.always?Vo("",this.config.always):[],f=this.config.onDone?Vo(String(qu(this.id)),this.config.onDone):[];Nt||en(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var d=Ot(this.invoke.map(function(y){var w=[];return y.onDone&&w.push.apply(w,gt([],Ue(Vo(String(mc(y.id)),y.onDone)),!1)),y.onError&&w.push.apply(w,gt([],Ue(Vo(String(hs(y.id)),y.onError)),!1)),w})),p=this.after,h=Ot(gt(gt(gt(gt([],Ue(f),!1),Ue(d),!1),Ue(i),!1),Ue(l),!1).map(function(y){return pr(y).map(function(w){return r.formatTransition(w)})}));try{for(var v=Le(p),C=v.next();!C.done;C=v.next()){var E=C.value;h.push(E)}}catch(y){t={error:y}}finally{try{C&&!C.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}return h},e}(),Im=!1;function Ah(e,t){return!Nt&&!("predictableActionArguments"in e)&&!Im&&(Im=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new KO(e,t)}var Pn=EO,YO=Rl,zS=gO,Lu=IO,nt={},$h={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});/*! *****************************************************************************
|
|
23
23
|
Copyright (c) Microsoft Corporation.
|
|
24
24
|
|
|
25
25
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -32,7 +32,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==ut.Running)throw
|
|
|
32
32
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
33
33
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
34
34
|
PERFORMANCE OF THIS SOFTWARE.
|
|
35
|
-
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var u,s=1,c=arguments.length;s<c;s++){u=arguments[s];for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&(a[l]=u[l])}return a},e.__assign.apply(this,arguments)};function t(o,a){var u={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&a.indexOf(s)<0&&(u[s]=o[s]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,s=Object.getOwnPropertySymbols(o);c<s.length;c++)a.indexOf(s[c])<0&&Object.prototype.propertyIsEnumerable.call(o,s[c])&&(u[s[c]]=o[s[c]]);return u}function n(o){var a=typeof Symbol=="function"&&Symbol.iterator,u=a&&o[a],s=0;if(u)return u.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&s>=o.length&&(o=void 0),{value:o&&o[s++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(o,a){var u=typeof Symbol=="function"&&o[Symbol.iterator];if(!u)return o;var s=u.call(o),c,l=[],f;try{for(;(a===void 0||a-- >0)&&!(c=s.next()).done;)l.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(u=s.return)&&u.call(s)}finally{if(f)throw f.error}}return l}function r(o,a,u){if(u||arguments.length===2)for(var s=0,c=a.length,l;s<c;s++)(l||!(s in a))&&(l||(l=Array.prototype.slice.call(a,0,s)),l[s]=a[s]);return o.concat(l||Array.prototype.slice.call(a))}e.__read=i,e.__rest=t,e.__spreadArray=r,e.__values=n})(od);var uu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ActionTypes=void 0,function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"}(e.ActionTypes||(e.ActionTypes={})),e.SpecialTargets=void 0,function(t){t.Parent="#_parent",t.Internal="#_internal"}(e.SpecialTargets||(e.SpecialTargets={}))})(uu);var yt={};Object.defineProperty(yt,"__esModule",{value:!0});var Mt=uu,$T=Mt.ActionTypes.Start,AT=Mt.ActionTypes.Stop,DT=Mt.ActionTypes.Raise,OT=Mt.ActionTypes.Send,NT=Mt.ActionTypes.Cancel,PT=Mt.ActionTypes.NullEvent,MT=Mt.ActionTypes.Assign,RT=Mt.ActionTypes.After,_T=Mt.ActionTypes.DoneState,jT=Mt.ActionTypes.Log,qT=Mt.ActionTypes.Init,kT=Mt.ActionTypes.Invoke,BT=Mt.ActionTypes.ErrorExecution,UT=Mt.ActionTypes.ErrorPlatform,VT=Mt.ActionTypes.ErrorCustom,FT=Mt.ActionTypes.Update,LT=Mt.ActionTypes.Choose,GT=Mt.ActionTypes.Pure;yt.after=RT;yt.assign=MT;yt.cancel=NT;yt.choose=LT;yt.doneState=_T;yt.error=VT;yt.errorExecution=BT;yt.errorPlatform=UT;yt.init=qT;yt.invoke=kT;yt.log=jT;yt.nullEvent=PT;yt.pure=GT;yt.raise=DT;yt.send=OT;yt.start=$T;yt.stop=AT;yt.update=FT;var cv={},yo={};Object.defineProperty(yo,"__esModule",{value:!0});var zT=".",WT={},HT="xstate.guard",KT="";yo.DEFAULT_GUARD_TYPE=HT;yo.EMPTY_ACTIVITY_MAP=WT;yo.STATE_DELIMITER=zT;yo.TARGETLESS_KEY=KT;var cu={};Object.defineProperty(cu,"__esModule",{value:!0});var JT=process.env.NODE_ENV==="production";cu.IS_PRODUCTION=JT;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=od,n=uu,i=yt,r=yo,o=cu,a;function u(y){return Object.keys(y)}function s(y,D,N){N===void 0&&(N=r.STATE_DELIMITER);var O=p(y,N),k=p(D,N);return Q(k)?Q(O)?k===O:!1:Q(O)?O in k:Object.keys(O).every(function(B){return B in k?s(O[B],k[B]):!1})}function c(y){try{return Q(y)||typeof y=="number"?"".concat(y):y.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function l(y){try{return Q(y)||typeof y=="number"?"".concat(y):Z(y)?y.name:y.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(y,D){try{return we(y)?y:y.toString().split(D)}catch{throw new Error("'".concat(y,"' is not a valid state path."))}}function d(y){return typeof y=="object"&&"value"in y&&"context"in y&&"event"in y&&"_event"in y}function p(y,D){if(d(y))return y.value;if(we(y))return h(y);if(typeof y!="string")return y;var N=f(y,D);return h(N)}function h(y){if(y.length===1)return y[0];for(var D={},N=D,O=0;O<y.length-1;O++)O===y.length-2?N[y[O]]=y[O+1]:(N[y[O]]={},N=N[y[O]]);return D}function v(y,D){for(var N={},O=Object.keys(y),k=0;k<O.length;k++){var B=O[k];N[B]=D(y[B],B,y,k)}return N}function w(y,D,N){var O,k,B={};try{for(var J=t.__values(Object.keys(y)),H=J.next();!H.done;H=J.next()){var oe=H.value,fe=y[oe];N(fe)&&(B[oe]=D(fe,oe,y))}}catch(ht){O={error:ht}}finally{try{H&&!H.done&&(k=J.return)&&k.call(J)}finally{if(O)throw O.error}}return B}var C=function(y){return function(D){var N,O,k=D;try{for(var B=t.__values(y),J=B.next();!J.done;J=B.next()){var H=J.value;k=k[H]}}catch(oe){N={error:oe}}finally{try{J&&!J.done&&(O=B.return)&&O.call(B)}finally{if(N)throw N.error}}return k}};function S(y,D){return function(N){var O,k,B=N;try{for(var J=t.__values(y),H=J.next();!H.done;H=J.next()){var oe=H.value;B=B[D][oe]}}catch(fe){O={error:fe}}finally{try{H&&!H.done&&(k=J.return)&&k.call(J)}finally{if(O)throw O.error}}return B}}function T(y){if(!y)return[[]];if(Q(y))return[[y]];var D=x(Object.keys(y).map(function(N){var O=y[N];return typeof O!="string"&&(!O||!Object.keys(O).length)?[[N]]:T(y[N]).map(function(k){return[N].concat(k)})}));return D}function I(y){var D,N,O={};if(y&&y.length===1&&y[0].length===1)return y[0][0];try{for(var k=t.__values(y),B=k.next();!B.done;B=k.next())for(var J=B.value,H=O,oe=0;oe<J.length;oe++){var fe=J[oe];if(oe===J.length-2){H[fe]=J[oe+1];break}H[fe]=H[fe]||{},H=H[fe]}}catch(ht){D={error:ht}}finally{try{B&&!B.done&&(N=k.return)&&N.call(k)}finally{if(D)throw D.error}}return O}function x(y){var D;return(D=[]).concat.apply(D,t.__spreadArray([],t.__read(y),!1))}function b(y){return we(y)?y:[y]}function E(y){return y===void 0?[]:b(y)}function P(y,D,N){var O,k;if(Z(y))return y(D,N.data);var B={};try{for(var J=t.__values(Object.keys(y)),H=J.next();!H.done;H=J.next()){var oe=H.value,fe=y[oe];Z(fe)?B[oe]=fe(D,N.data):B[oe]=fe}}catch(ht){O={error:ht}}finally{try{H&&!H.done&&(k=J.return)&&k.call(J)}finally{if(O)throw O.error}}return B}function $(y){return/^(done|error)\./.test(y)}function L(y){return!!(y instanceof Promise||y!==null&&(Z(y)||typeof y=="object")&&Z(y.then))}function R(y){return y!==null&&typeof y=="object"&&"transition"in y&&typeof y.transition=="function"}function A(y,D){var N,O,k=t.__read([[],[]],2),B=k[0],J=k[1];try{for(var H=t.__values(y),oe=H.next();!oe.done;oe=H.next()){var fe=oe.value;D(fe)?B.push(fe):J.push(fe)}}catch(ht){N={error:ht}}finally{try{oe&&!oe.done&&(O=H.return)&&O.call(H)}finally{if(N)throw N.error}}return[B,J]}function K(y,D){return v(y.states,function(N,O){if(N){var k=(Q(D)?void 0:D[O])||(N?N.current:void 0);if(k)return{current:k,states:K(N,k)}}})}function re(y,D){return{current:D,states:K(y,D)}}function ze(y,D,N,O){o.IS_PRODUCTION||e.warn(!!y,"Attempting to update undefined context");var k=y&&N.reduce(function(B,J){var H,oe,fe=J.assignment,ht={state:O,action:J,_event:D},Xi={};if(Z(fe))Xi=fe(B,D.data,ht);else try{for(var si=t.__values(Object.keys(fe)),kn=si.next();!kn.done;kn=si.next()){var No=kn.value,Qi=fe[No];Xi[No]=Z(Qi)?Qi(B,D.data,ht):Qi}}catch(Wu){H={error:Wu}}finally{try{kn&&!kn.done&&(oe=si.return)&&oe.call(si)}finally{if(H)throw H.error}}return Object.assign({},B,Xi)},y);return k}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(y,D){var N=y instanceof Error?y:void 0;if(!(!N&&y)&&console!==void 0){var O=["Warning: ".concat(D)];N&&O.push(N),console.warn.apply(console,O)}});function we(y){return Array.isArray(y)}function Z(y){return typeof y=="function"}function Q(y){return typeof y=="string"}function de(y,D){if(y)return Q(y)?{type:r.DEFAULT_GUARD_TYPE,name:y,predicate:D?D[y]:void 0}:Z(y)?{type:r.DEFAULT_GUARD_TYPE,name:y.name,predicate:y}:y}function _t(y){try{return"subscribe"in y&&Z(y.subscribe)}catch{return!1}}var ae=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),jt=(a={},a[ae]=function(){return this},a[Symbol.observable]=function(){return this},a);function rn(y){return!!y&&"__xstatenode"in y}function Pe(y){return!!y&&typeof y.send=="function"}var it=function(){var y=0;return function(){return y++,y.toString(16)}}();function Kn(y,D){return Q(y)||typeof y=="number"?t.__assign({type:y},D):y}function Jn(y,D){if(!Q(y)&&"$$type"in y&&y.$$type==="scxml")return y;var N=Kn(y);return t.__assign({name:N.type,data:N,$$type:"scxml",type:"external"},D)}function qn(y,D){var N=b(D).map(function(O){return typeof O>"u"||typeof O=="string"||rn(O)?{target:O,event:y}:t.__assign(t.__assign({},O),{event:y})});return N}function Yi(y){if(!(y===void 0||y===r.TARGETLESS_KEY))return E(y)}function $i(y,D,N){if(!o.IS_PRODUCTION){var O=y.stack?" Stacktrace was '".concat(y.stack,"'"):"";if(y===D)console.error("Missing onError handler for invocation '".concat(N,"', error was '").concat(y,"'.").concat(O));else{var k=D.stack?" Stacktrace was '".concat(D.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(N,"'. ")+"Original error: '".concat(y,"'. ").concat(O," Current error is '").concat(D,"'.").concat(k))}}}function In(y,D,N,O,k){var B=y.options.guards,J={state:k,cond:D,_event:O};if(D.type===r.DEFAULT_GUARD_TYPE)return((B==null?void 0:B[D.name])||D.predicate)(N,O.data,J);var H=B==null?void 0:B[D.type];if(!H)throw new Error("Guard '".concat(D.type,"' is not implemented on machine '").concat(y.id,"'."));return H(N,O.data,J)}function Fu(y){return typeof y=="string"?{type:y}:y}function Lu(y,D,N){var O=function(){},k=typeof y=="object",B=k?y:null;return{next:((k?y.next:y)||O).bind(B),error:((k?y.error:D)||O).bind(B),complete:((k?y.complete:N)||O).bind(B)}}function Gu(y,D){return"".concat(y,":invocation[").concat(D,"]")}function zu(y){return(y.type===i.raise||y.type===i.send&&y.to===n.SpecialTargets.Internal)&&typeof y.delay!="number"}e.createInvokeId=Gu,e.evaluateGuard=In,e.flatten=x,e.getActionType=l,e.getEventType=c,e.interopSymbols=jt,e.isActor=Pe,e.isArray=we,e.isBehavior=R,e.isBuiltInEvent=$,e.isFunction=Z,e.isMachine=rn,e.isObservable=_t,e.isPromiseLike=L,e.isRaisableAction=zu,e.isStateLike=d,e.isString=Q,e.keys=u,e.mapContext=P,e.mapFilterValues=w,e.mapValues=v,e.matchesState=s,e.nestedPath=S,e.normalizeTarget=Yi,e.partition=A,e.path=C,e.pathToStateValue=h,e.pathsToStateValue=I,e.reportUnhandledExceptionOnInvocation=$i,e.symbolObservable=ae,e.toArray=E,e.toArrayStrict=b,e.toEventObject=Kn,e.toGuard=de,e.toInvokeSource=Fu,e.toObserver=Lu,e.toSCXMLEvent=Jn,e.toStatePath=f,e.toStatePaths=T,e.toStateValue=p,e.toTransitionConfigArray=qn,e.uniqueId=it,e.updateContext=ze,e.updateHistoryStates=K,e.updateHistoryValue=re})(cv);Object.defineProperty(qe,"__esModule",{value:!0});var Oe=od,_n=uu,Nt=yt,Se=cv,lv=cu,YT=Se.toSCXMLEvent({type:Nt.init});function Gc(e,t){return t&&t[e]||void 0}function lu(e,t){var n;if(Se.isString(e)||typeof e=="number"){var i=Gc(e,t);Se.isFunction(i)?n={type:e,exec:i}:i?n=i:n={type:e,exec:void 0}}else if(Se.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var i=Gc(e.type,t);if(Se.isFunction(i))n=Oe.__assign(Oe.__assign({},e),{exec:i});else if(i){var r=i.type||e.type;n=Oe.__assign(Oe.__assign(Oe.__assign({},i),e),{type:r})}else n=e}return n}var zc=function(e,t){if(!e)return[];var n=Se.isArray(e)?e:[e];return n.map(function(i){return lu(i,t)})};function ad(e){var t=lu(e);return Oe.__assign(Oe.__assign({id:Se.isString(e)?e:t.id},t),{type:t.type})}function XT(e,t){return{type:Nt.raise,event:typeof e=="function"?e:Se.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function dv(e,t,n,i){var r={_event:n},o=Se.toSCXMLEvent(Se.isFunction(e.event)?e.event(t,n.data,r):e.event),a;if(Se.isString(e.delay)){var u=i&&i[e.delay];a=Se.isFunction(u)?u(t,n.data,r):u}else a=Se.isFunction(e.delay)?e.delay(t,n.data,r):e.delay;return Oe.__assign(Oe.__assign({},e),{type:Nt.raise,_event:o,delay:a})}function Oa(e,t){return{to:t?t.to:void 0,type:Nt.send,event:Se.isFunction(e)?e:Se.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Se.isFunction(e)?e.name:Se.getEventType(e)}}function fv(e,t,n,i){var r={_event:n},o=Se.toSCXMLEvent(Se.isFunction(e.event)?e.event(t,n.data,r):e.event),a;if(Se.isString(e.delay)){var u=i&&i[e.delay];a=Se.isFunction(u)?u(t,n.data,r):u}else a=Se.isFunction(e.delay)?e.delay(t,n.data,r):e.delay;var s=Se.isFunction(e.to)?e.to(t,n.data,r):e.to;return Oe.__assign(Oe.__assign({},e),{to:s,_event:o,event:o.data,delay:a})}function sd(e,t){return Oa(e,Oe.__assign(Oe.__assign({},t),{to:_n.SpecialTargets.Parent}))}function QT(e,t,n){return Oa(t,Oe.__assign(Oe.__assign({},n),{to:e}))}function ZT(){return sd(Nt.update)}function eI(e,t){return Oa(e,Oe.__assign(Oe.__assign({},t),{to:function(n,i,r){var o=r._event;return o.origin}}))}var tI=function(e,t){return{context:e,event:t}};function nI(e,t){return e===void 0&&(e=tI),{type:Nt.log,label:t,expr:e}}var pv=function(e,t,n){return Oe.__assign(Oe.__assign({},e),{value:Se.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},iI=function(e){return{type:Nt.cancel,sendId:e}};function rI(e){var t=ad(e);return{type:_n.ActionTypes.Start,activity:t,exec:void 0}}function oI(e){var t=Se.isFunction(e)?e:ad(e);return{type:_n.ActionTypes.Stop,activity:t,exec:void 0}}function hv(e,t,n){var i=Se.isFunction(e.activity)?e.activity(t,n.data):e.activity,r=typeof i=="string"?{id:i}:i,o={type:_n.ActionTypes.Stop,activity:r};return o}var aI=function(e){return{type:Nt.assign,assignment:e}};function sI(e){return typeof e=="object"&&"type"in e}function uI(e,t){var n=t?"#".concat(t):"";return"".concat(_n.ActionTypes.After,"(").concat(e,")").concat(n)}function cI(e,t){var n="".concat(_n.ActionTypes.DoneState,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function lI(e,t){var n="".concat(_n.ActionTypes.DoneInvoke,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function dI(e,t){var n="".concat(_n.ActionTypes.ErrorPlatform,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function fI(e){return{type:_n.ActionTypes.Pure,get:e}}function pI(e,t){if(!lv.IS_PRODUCTION&&(!e||typeof e=="function")){var n=e;e=function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var o=typeof n=="function"?n.apply(void 0,Oe.__spreadArray([],Oe.__read(i),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return Oa(function(i,r){return r},Oe.__assign(Oe.__assign({},t),{to:e}))}function hI(e,t){return sd(function(n,i,r){return{type:Nt.error,data:Se.isFunction(e)?e(n,i,r):e}},Oe.__assign(Oe.__assign({},t),{to:_n.SpecialTargets.Parent}))}function vI(e){return{type:_n.ActionTypes.Choose,conds:e}}var yI=function(e){var t,n,i=[];try{for(var r=Oe.__values(e),o=r.next();!o.done;o=r.next())for(var a=o.value,u=0;u<a.actions.length;){if(a.actions[u].type===Nt.assign){i.push(a.actions[u]),a.actions.splice(u,1);continue}u++}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i};function Wc(e,t,n,i,r,o,a){a===void 0&&(a=!1);var u=a?[]:yI(r),s=u.length?Se.updateContext(n,i,u,t):n,c=a?[n]:void 0,l=[];function f(h,v){var w;switch(v.type){case Nt.raise:{var C=dv(v,s,i,e.options.delays);return o&&typeof C.delay=="number"&&o(C,s,i),C}case Nt.send:var S=fv(v,s,i,e.options.delays);if(!lv.IS_PRODUCTION){var T=v.delay;Se.warn(!Se.isString(T)||typeof S.delay=="number","No delay reference for delay expression '".concat(T,"' was found on machine '").concat(e.id,"'"))}return o&&S.to!==_n.SpecialTargets.Internal&&(h==="entry"?l.push(S):o(S,s,i)),S;case Nt.log:{var I=pv(v,s,i);return o==null||o(I,s,i),I}case Nt.choose:{var x=v,b=(w=x.conds.find(function(Z){var Q=Se.toGuard(Z.cond,e.options.guards);return!Q||Se.evaluateGuard(e,Q,s,i,o?void 0:t)}))===null||w===void 0?void 0:w.actions;if(!b)return[];var E=Oe.__read(Wc(e,t,s,i,[{type:h,actions:zc(Se.toArray(b),e.options.actions)}],o,a),2),P=E[0],$=E[1];return s=$,c==null||c.push(s),P}case Nt.pure:{var b=v.get(s,i.data);if(!b)return[];var L=Oe.__read(Wc(e,t,s,i,[{type:h,actions:zc(Se.toArray(b),e.options.actions)}],o,a),2),R=L[0],A=L[1];return s=A,c==null||c.push(s),R}case Nt.stop:{var I=hv(v,s,i);return o==null||o(I,n,i),I}case Nt.assign:{s=Se.updateContext(s,i,[v],o?void 0:t),c==null||c.push(s);break}default:var K=lu(v,e.options.actions),re=K.exec;if(o)o(K,s,i);else if(re&&c){var ze=c.length-1,we=Oe.__assign(Oe.__assign({},K),{exec:function(Z){for(var Q=[],de=1;de<arguments.length;de++)Q[de-1]=arguments[de];re.apply(void 0,Oe.__spreadArray([c[ze]],Oe.__read(Q),!1))}});K=we}return K}}function d(h){var v,w,C=[];try{for(var S=Oe.__values(h.actions),T=S.next();!T.done;T=S.next()){var I=T.value,x=f(h.type,I);x&&(C=C.concat(x))}}catch(b){v={error:b}}finally{try{T&&!T.done&&(w=S.return)&&w.call(S)}finally{if(v)throw v.error}}return l.forEach(function(b){o(b,s,i)}),l.length=0,C}var p=Se.flatten(r.map(d));return[p,s]}qe.actionTypes=Nt;qe.after=uI;qe.assign=aI;qe.cancel=iI;qe.choose=vI;qe.done=cI;qe.doneInvoke=lI;qe.error=dI;qe.escalate=hI;qe.forwardTo=pI;qe.getActionFunction=Gc;qe.initEvent=YT;qe.isActionObject=sI;var cn=qe.log=nI,mI=qe.pure=fI;qe.raise=XT;qe.resolveActions=Wc;qe.resolveLog=pv;qe.resolveRaise=dv;qe.resolveSend=fv;qe.resolveStop=hv;qe.respond=eI;qe.send=Oa;qe.sendParent=sd;qe.sendTo=QT;qe.sendUpdate=ZT;qe.start=rI;var vf=qe.stop=oI;qe.toActionObject=lu;qe.toActionObjects=zc;qe.toActivityDefinition=ad;function vv(e){return function(n,i,r,o,a,u,s){return e(n,i,s)}}function du(e){return function(n,i,r,o){if(!n||!i||typeof n!="object"||typeof i!="object")return e(n,i,r,o);var a=o.get(n),u=o.get(i);if(a&&u)return a===i&&u===n;o.set(n,i),o.set(i,n);var s=e(n,i,r,o);return o.delete(n),o.delete(i),s}}function yv(e,t){var n={};for(var i in e)n[i]=e[i];for(var i in t)n[i]=t[i];return n}function yf(e){return e.constructor===Object||e.constructor==null}function mf(e){return typeof e.then=="function"}function fu(e,t){return e===t||e!==e&&t!==t}var gI="[object Arguments]",bI="[object Boolean]",SI="[object Date]",CI="[object RegExp]",wI="[object Map]",TI="[object Number]",II="[object Object]",EI="[object Set]",xI="[object String]",gf=Object.prototype.toString;function pu(e){var t=e.areArraysEqual,n=e.areDatesEqual,i=e.areMapsEqual,r=e.areObjectsEqual,o=e.areRegExpsEqual,a=e.areSetsEqual,u=e.createIsNestedEqual,s=u(c);function c(l,f,d){if(l===f)return!0;if(!l||!f||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;if(yf(l)&&yf(f))return r(l,f,s,d);var p=Array.isArray(l),h=Array.isArray(f);if(p||h)return p===h&&t(l,f,s,d);var v=gf.call(l);return v!==gf.call(f)?!1:v===SI?n(l,f,s,d):v===CI?o(l,f,s,d):v===wI?i(l,f,s,d):v===EI?a(l,f,s,d):v===II||v===gI?mf(l)||mf(f)?!1:r(l,f,s,d):v===bI||v===TI||v===xI?fu(l.valueOf(),f.valueOf()):!1}return c}function mv(e,t,n,i){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n(e[r],t[r],r,r,e,t,i))return!1;return!0}var $I=du(mv);function gv(e,t){return fu(e.valueOf(),t.valueOf())}function bv(e,t,n,i){var r=e.size===t.size;if(!r)return!1;if(!e.size)return!0;var o={},a=0;return e.forEach(function(u,s){if(r){var c=!1,l=0;t.forEach(function(f,d){!c&&!o[l]&&(c=n(s,d,a,l,e,t,i)&&n(u,f,s,d,e,t,i))&&(o[l]=!0),l++}),a++,r=c}}),r}var AI=du(bv),DI="_owner",OI=Object.prototype.hasOwnProperty;function Sv(e,t,n,i){var r=Object.keys(e),o=r.length;if(Object.keys(t).length!==o)return!1;for(var a;o-- >0;){if(a=r[o],a===DI){var u=!!e.$$typeof,s=!!t.$$typeof;if((u||s)&&u!==s)return!1}if(!OI.call(t,a)||!n(e[a],t[a],a,a,e,t,i))return!1}return!0}var NI=du(Sv);function Cv(e,t){return e.source===t.source&&e.flags===t.flags}function wv(e,t,n,i){var r=e.size===t.size;if(!r)return!1;if(!e.size)return!0;var o={};return e.forEach(function(a,u){if(r){var s=!1,c=0;t.forEach(function(l,f){!s&&!o[c]&&(s=n(a,l,u,f,e,t,i))&&(o[c]=!0),c++}),r=s}}),r}var PI=du(wv),Tv=Object.freeze({areArraysEqual:mv,areDatesEqual:gv,areMapsEqual:bv,areObjectsEqual:Sv,areRegExpsEqual:Cv,areSetsEqual:wv,createIsNestedEqual:vv}),Iv=Object.freeze({areArraysEqual:$I,areDatesEqual:gv,areMapsEqual:AI,areObjectsEqual:NI,areRegExpsEqual:Cv,areSetsEqual:PI,createIsNestedEqual:vv}),MI=pu(Tv);function RI(e,t){return MI(e,t,void 0)}pu(yv(Tv,{createIsNestedEqual:function(){return fu}}));pu(Iv);pu(yv(Iv,{createIsNestedEqual:function(){return fu}}));var Hc={exports:{}},Ku={},Ja={exports:{}},Ju={};/**
|
|
35
|
+
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,c=arguments.length;u<c;u++){s=arguments[u];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(a[l]=s[l])}return a},e.__assign.apply(this,arguments)};function t(o,a){var s={};for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&a.indexOf(u)<0&&(s[u]=o[u]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,u=Object.getOwnPropertySymbols(o);c<u.length;c++)a.indexOf(u[c])<0&&Object.prototype.propertyIsEnumerable.call(o,u[c])&&(s[u[c]]=o[u[c]]);return s}function n(o){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&o[a],u=0;if(s)return s.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&u>=o.length&&(o=void 0),{value:o&&o[u++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(o,a){var s=typeof Symbol=="function"&&o[Symbol.iterator];if(!s)return o;var u=s.call(o),c,l=[],f;try{for(;(a===void 0||a-- >0)&&!(c=u.next()).done;)l.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return l}function i(o,a,s){if(s||arguments.length===2)for(var u=0,c=a.length,l;u<c;u++)(l||!(u in a))&&(l||(l=Array.prototype.slice.call(a,0,u)),l[u]=a[u]);return o.concat(l||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})($h);var kl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ActionTypes=void 0,function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"}(e.ActionTypes||(e.ActionTypes={})),e.SpecialTargets=void 0,function(t){t.Parent="#_parent",t.Internal="#_internal"}(e.SpecialTargets||(e.SpecialTargets={}))})(kl);var Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});var sn=kl,XO=sn.ActionTypes.Start,JO=sn.ActionTypes.Stop,QO=sn.ActionTypes.Raise,ZO=sn.ActionTypes.Send,eD=sn.ActionTypes.Cancel,tD=sn.ActionTypes.NullEvent,nD=sn.ActionTypes.Assign,rD=sn.ActionTypes.After,iD=sn.ActionTypes.DoneState,oD=sn.ActionTypes.Log,aD=sn.ActionTypes.Init,sD=sn.ActionTypes.Invoke,uD=sn.ActionTypes.ErrorExecution,cD=sn.ActionTypes.ErrorPlatform,lD=sn.ActionTypes.ErrorCustom,fD=sn.ActionTypes.Update,dD=sn.ActionTypes.Choose,pD=sn.ActionTypes.Pure;Vt.after=rD;Vt.assign=nD;Vt.cancel=eD;Vt.choose=dD;Vt.doneState=iD;Vt.error=lD;Vt.errorExecution=uD;Vt.errorPlatform=cD;Vt.init=aD;Vt.invoke=sD;Vt.log=oD;Vt.nullEvent=tD;Vt.pure=pD;Vt.raise=QO;Vt.send=ZO;Vt.start=XO;Vt.stop=JO;Vt.update=fD;var WS={},Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});var hD=".",vD={},mD="xstate.guard",yD="";Fa.DEFAULT_GUARD_TYPE=mD;Fa.EMPTY_ACTIVITY_MAP=vD;Fa.STATE_DELIMITER=hD;Fa.TARGETLESS_KEY=yD;var Ml={};Object.defineProperty(Ml,"__esModule",{value:!0});var gD=process.env.NODE_ENV==="production";Ml.IS_PRODUCTION=gD;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=$h,n=kl,r=Vt,i=Fa,o=Ml,a;function s(g){return Object.keys(g)}function u(g,k,F){F===void 0&&(F=i.STATE_DELIMITER);var _=p(g,F),X=p(k,F);return U(X)?U(_)?X===_:!1:U(_)?_ in X:Object.keys(_).every(function(Q){return Q in X?u(_[Q],X[Q]):!1})}function c(g){try{return U(g)||typeof g=="number"?"".concat(g):g.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function l(g){try{return U(g)||typeof g=="number"?"".concat(g):B(g)?g.name:g.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(g,k){try{return ie(g)?g:g.toString().split(k)}catch{throw new Error("'".concat(g,"' is not a valid state path."))}}function d(g){return typeof g=="object"&&"value"in g&&"context"in g&&"event"in g&&"_event"in g}function p(g,k){if(d(g))return g.value;if(ie(g))return h(g);if(typeof g!="string")return g;var F=f(g,k);return h(F)}function h(g){if(g.length===1)return g[0];for(var k={},F=k,_=0;_<g.length-1;_++)_===g.length-2?F[g[_]]=g[_+1]:(F[g[_]]={},F=F[g[_]]);return k}function v(g,k){for(var F={},_=Object.keys(g),X=0;X<_.length;X++){var Q=_[X];F[Q]=k(g[Q],Q,g,X)}return F}function C(g,k,F){var _,X,Q={};try{for(var le=t.__values(Object.keys(g)),se=le.next();!se.done;se=le.next()){var Se=se.value,$e=g[Se];F($e)&&(Q[Se]=k($e,Se,g))}}catch(Ft){_={error:Ft}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(_)throw _.error}}return Q}var E=function(g){return function(k){var F,_,X=k;try{for(var Q=t.__values(g),le=Q.next();!le.done;le=Q.next()){var se=le.value;X=X[se]}}catch(Se){F={error:Se}}finally{try{le&&!le.done&&(_=Q.return)&&_.call(Q)}finally{if(F)throw F.error}}return X}};function y(g,k){return function(F){var _,X,Q=F;try{for(var le=t.__values(g),se=le.next();!se.done;se=le.next()){var Se=se.value;Q=Q[k][Se]}}catch($e){_={error:$e}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(_)throw _.error}}return Q}}function w(g){if(!g)return[[]];if(U(g))return[[g]];var k=S(Object.keys(g).map(function(F){var _=g[F];return typeof _!="string"&&(!_||!Object.keys(_).length)?[[F]]:w(g[F]).map(function(X){return[F].concat(X)})}));return k}function x(g){var k,F,_={};if(g&&g.length===1&&g[0].length===1)return g[0][0];try{for(var X=t.__values(g),Q=X.next();!Q.done;Q=X.next())for(var le=Q.value,se=_,Se=0;Se<le.length;Se++){var $e=le[Se];if(Se===le.length-2){se[$e]=le[Se+1];break}se[$e]=se[$e]||{},se=se[$e]}}catch(Ft){k={error:Ft}}finally{try{Q&&!Q.done&&(F=X.return)&&F.call(X)}finally{if(k)throw k.error}}return _}function S(g){var k;return(k=[]).concat.apply(k,t.__spreadArray([],t.__read(g),!1))}function T(g){return ie(g)?g:[g]}function A(g){return g===void 0?[]:T(g)}function D(g,k,F){var _,X;if(B(g))return g(k,F.data);var Q={};try{for(var le=t.__values(Object.keys(g)),se=le.next();!se.done;se=le.next()){var Se=se.value,$e=g[Se];B($e)?Q[Se]=$e(k,F.data):Q[Se]=$e}}catch(Ft){_={error:Ft}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(_)throw _.error}}return Q}function I(g){return/^(done|error)\./.test(g)}function N(g){return!!(g instanceof Promise||g!==null&&(B(g)||typeof g=="object")&&B(g.then))}function j(g){return g!==null&&typeof g=="object"&&"transition"in g&&typeof g.transition=="function"}function L(g,k){var F,_,X=t.__read([[],[]],2),Q=X[0],le=X[1];try{for(var se=t.__values(g),Se=se.next();!Se.done;Se=se.next()){var $e=Se.value;k($e)?Q.push($e):le.push($e)}}catch(Ft){F={error:Ft}}finally{try{Se&&!Se.done&&(_=se.return)&&_.call(se)}finally{if(F)throw F.error}}return[Q,le]}function V(g,k){return v(g.states,function(F,_){if(F){var X=(U(k)?void 0:k[_])||(F?F.current:void 0);if(X)return{current:X,states:V(F,X)}}})}function H(g,k){return{current:k,states:V(g,k)}}function R(g,k,F,_){o.IS_PRODUCTION||e.warn(!!g,"Attempting to update undefined context");var X=g&&F.reduce(function(Q,le){var se,Se,$e=le.assignment,Ft={state:_,action:le,_event:k},Ki={};if(B($e))Ki=$e(Q,k.data,Ft);else try{for(var _r=t.__values(Object.keys($e)),dr=_r.next();!dr.done;dr=_r.next()){var es=dr.value,Yi=$e[es];Ki[es]=B(Yi)?Yi(Q,k.data,Ft):Yi}}catch(Af){se={error:Af}}finally{try{dr&&!dr.done&&(Se=_r.return)&&Se.call(_r)}finally{if(se)throw se.error}}return Object.assign({},Q,Ki)},g);return X}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(g,k){var F=g instanceof Error?g:void 0;if(!(!F&&g)&&console!==void 0){var _=["Warning: ".concat(k)];F&&_.push(F),console.warn.apply(console,_)}});function ie(g){return Array.isArray(g)}function B(g){return typeof g=="function"}function U(g){return typeof g=="string"}function fe(g,k){if(g)return U(g)?{type:i.DEFAULT_GUARD_TYPE,name:g,predicate:k?k[g]:void 0}:B(g)?{type:i.DEFAULT_GUARD_TYPE,name:g.name,predicate:g}:g}function M(g){try{return"subscribe"in g&&B(g.subscribe)}catch{return!1}}var P=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[P]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(g){return!!g&&"__xstatenode"in g}function K(g){return!!g&&typeof g.send=="function"}var ae=function(){var g=0;return function(){return g++,g.toString(16)}}();function de(g,k){return U(g)||typeof g=="number"?t.__assign({type:g},k):g}function ve(g,k){if(!U(g)&&"$$type"in g&&g.$$type==="scxml")return g;var F=de(g);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},k)}function Ee(g,k){var F=T(k).map(function(_){return typeof _>"u"||typeof _=="string"||oe(_)?{target:_,event:g}:t.__assign(t.__assign({},_),{event:g})});return F}function Re(g){if(!(g===void 0||g===i.TARGETLESS_KEY))return A(g)}function De(g,k,F){if(!o.IS_PRODUCTION){var _=g.stack?" Stacktrace was '".concat(g.stack,"'"):"";if(g===k)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(g,"'.").concat(_));else{var X=k.stack?" Stacktrace was '".concat(k.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(g,"'. ").concat(_," Current error is '").concat(k,"'.").concat(X))}}}function yt(g,k,F,_,X){var Q=g.options.guards,le={state:X,cond:k,_event:_};if(k.type===i.DEFAULT_GUARD_TYPE)return((Q==null?void 0:Q[k.name])||k.predicate)(F,_.data,le);var se=Q==null?void 0:Q[k.type];if(!se)throw new Error("Guard '".concat(k.type,"' is not implemented on machine '").concat(g.id,"'."));return se(F,_.data,le)}function ce(g){return typeof g=="string"?{type:g}:g}function Nn(g,k,F){var _=function(){},X=typeof g=="object",Q=X?g:null;return{next:((X?g.next:g)||_).bind(Q),error:((X?g.error:k)||_).bind(Q),complete:((X?g.complete:F)||_).bind(Q)}}function fi(g,k){return"".concat(g,":invocation[").concat(k,"]")}function Lo(g){return(g.type===r.raise||g.type===r.send&&g.to===n.SpecialTargets.Internal)&&typeof g.delay!="number"}e.createInvokeId=fi,e.evaluateGuard=yt,e.flatten=S,e.getActionType=l,e.getEventType=c,e.interopSymbols=te,e.isActor=K,e.isArray=ie,e.isBehavior=j,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=M,e.isPromiseLike=N,e.isRaisableAction=Lo,e.isStateLike=d,e.isString=U,e.keys=s,e.mapContext=D,e.mapFilterValues=C,e.mapValues=v,e.matchesState=u,e.nestedPath=y,e.normalizeTarget=Re,e.partition=L,e.path=E,e.pathToStateValue=h,e.pathsToStateValue=x,e.reportUnhandledExceptionOnInvocation=De,e.symbolObservable=P,e.toArray=A,e.toArrayStrict=T,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=ce,e.toObserver=Nn,e.toSCXMLEvent=ve,e.toStatePath=f,e.toStatePaths=w,e.toStateValue=p,e.toTransitionConfigArray=Ee,e.uniqueId=ae,e.updateContext=R,e.updateHistoryStates=V,e.updateHistoryValue=H})(WS);Object.defineProperty(nt,"__esModule",{value:!0});var He=$h,lr=kl,rn=Vt,qe=WS,HS=Ml,bD=qe.toSCXMLEvent({type:rn.init});function Fd(e,t){return t&&t[e]||void 0}function jl(e,t){var n;if(qe.isString(e)||typeof e=="number"){var r=Fd(e,t);qe.isFunction(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(qe.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var r=Fd(e.type,t);if(qe.isFunction(r))n=He.__assign(He.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=He.__assign(He.__assign(He.__assign({},r),e),{type:i})}else n=e}return n}var Ld=function(e,t){if(!e)return[];var n=qe.isArray(e)?e:[e];return n.map(function(r){return jl(r,t)})};function Oh(e){var t=jl(e);return He.__assign(He.__assign({id:qe.isString(e)?e:t.id},t),{type:t.type})}function SD(e,t){return{type:rn.raise,event:typeof e=="function"?e:qe.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function KS(e,t,n,r){var i={_event:n},o=qe.toSCXMLEvent(qe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(qe.isString(e.delay)){var s=r&&r[e.delay];a=qe.isFunction(s)?s(t,n.data,i):s}else a=qe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return He.__assign(He.__assign({},e),{type:rn.raise,_event:o,delay:a})}function vu(e,t){return{to:t?t.to:void 0,type:rn.send,event:qe.isFunction(e)?e:qe.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:qe.isFunction(e)?e.name:qe.getEventType(e)}}function YS(e,t,n,r){var i={_event:n},o=qe.toSCXMLEvent(qe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(qe.isString(e.delay)){var s=r&&r[e.delay];a=qe.isFunction(s)?s(t,n.data,i):s}else a=qe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=qe.isFunction(e.to)?e.to(t,n.data,i):e.to;return He.__assign(He.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function Dh(e,t){return vu(e,He.__assign(He.__assign({},t),{to:lr.SpecialTargets.Parent}))}function wD(e,t,n){return vu(t,He.__assign(He.__assign({},n),{to:e}))}function CD(){return Dh(rn.update)}function xD(e,t){return vu(e,He.__assign(He.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var ED=function(e,t){return{context:e,event:t}};function TD(e,t){return e===void 0&&(e=ED),{type:rn.log,label:t,expr:e}}var XS=function(e,t,n){return He.__assign(He.__assign({},e),{value:qe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},ID=function(e){return{type:rn.cancel,sendId:e}};function AD(e){var t=Oh(e);return{type:lr.ActionTypes.Start,activity:t,exec:void 0}}function $D(e){var t=qe.isFunction(e)?e:Oh(e);return{type:lr.ActionTypes.Stop,activity:t,exec:void 0}}function JS(e,t,n){var r=qe.isFunction(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:lr.ActionTypes.Stop,activity:i};return o}var OD=function(e){return{type:rn.assign,assignment:e}};function DD(e){return typeof e=="object"&&"type"in e}function ND(e,t){var n=t?"#".concat(t):"";return"".concat(lr.ActionTypes.After,"(").concat(e,")").concat(n)}function PD(e,t){var n="".concat(lr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function RD(e,t){var n="".concat(lr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function kD(e,t){var n="".concat(lr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function MD(e){return{type:lr.ActionTypes.Pure,get:e}}function jD(e,t){if(!HS.IS_PRODUCTION&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,He.__spreadArray([],He.__read(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return vu(function(r,i){return i},He.__assign(He.__assign({},t),{to:e}))}function _D(e,t){return Dh(function(n,r,i){return{type:rn.error,data:qe.isFunction(e)?e(n,r,i):e}},He.__assign(He.__assign({},t),{to:lr.SpecialTargets.Parent}))}function qD(e){return{type:lr.ActionTypes.Choose,conds:e}}var FD=function(e){var t,n,r=[];try{for(var i=He.__values(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===rn.assign){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function Bd(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:FD(i),u=s.length?qe.updateContext(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var C;switch(v.type){case rn.raise:{var E=KS(v,u,r,e.options.delays);return o&&typeof E.delay=="number"&&o(E,u,r),E}case rn.send:var y=YS(v,u,r,e.options.delays);if(!HS.IS_PRODUCTION){var w=v.delay;qe.warn(!qe.isString(w)||typeof y.delay=="number","No delay reference for delay expression '".concat(w,"' was found on machine '").concat(e.id,"'"))}return o&&y.to!==lr.SpecialTargets.Internal&&(h==="entry"?l.push(y):o(y,u,r)),y;case rn.log:{var x=XS(v,u,r);return o==null||o(x,u,r),x}case rn.choose:{var S=v,T=(C=S.conds.find(function(B){var U=qe.toGuard(B.cond,e.options.guards);return!U||qe.evaluateGuard(e,U,u,r,o?void 0:t)}))===null||C===void 0?void 0:C.actions;if(!T)return[];var A=He.__read(Bd(e,t,u,r,[{type:h,actions:Ld(qe.toArray(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case rn.pure:{var T=v.get(u,r.data);if(!T)return[];var N=He.__read(Bd(e,t,u,r,[{type:h,actions:Ld(qe.toArray(T),e.options.actions)}],o,a),2),j=N[0],L=N[1];return u=L,c==null||c.push(u),j}case rn.stop:{var x=JS(v,u,r);return o==null||o(x,n,r),x}case rn.assign:{u=qe.updateContext(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=jl(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=He.__assign(He.__assign({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,He.__spreadArray([c[R]],He.__read(U),!1))}});V=ie}return V}}function d(h){var v,C,E=[];try{for(var y=He.__values(h.actions),w=y.next();!w.done;w=y.next()){var x=w.value,S=f(h.type,x);S&&(E=E.concat(S))}}catch(T){v={error:T}}finally{try{w&&!w.done&&(C=y.return)&&C.call(y)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,E}var p=qe.flatten(i.map(d));return[p,u]}nt.actionTypes=rn;nt.after=ND;nt.assign=OD;nt.cancel=ID;nt.choose=qD;nt.done=PD;nt.doneInvoke=RD;nt.error=kD;nt.escalate=_D;nt.forwardTo=jD;nt.getActionFunction=Fd;nt.initEvent=bD;nt.isActionObject=DD;var Bn=nt.log=TD,LD=nt.pure=MD;nt.raise=SD;nt.resolveActions=Bd;nt.resolveLog=XS;nt.resolveRaise=KS;nt.resolveSend=YS;nt.resolveStop=JS;nt.respond=xD;nt.send=vu;nt.sendParent=Dh;nt.sendTo=wD;nt.sendUpdate=CD;nt.start=AD;var Am=nt.stop=$D;nt.toActionObject=jl;nt.toActionObjects=Ld;nt.toActivityDefinition=Oh;function QS(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function _l(e){return function(n,r,i,o){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i,o);var a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i,o);return o.delete(n),o.delete(r),u}}function ZS(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function $m(e){return e.constructor===Object||e.constructor==null}function Om(e){return typeof e.then=="function"}function ql(e,t){return e===t||e!==e&&t!==t}var BD="[object Arguments]",VD="[object Boolean]",UD="[object Date]",GD="[object RegExp]",zD="[object Map]",WD="[object Number]",HD="[object Object]",KD="[object Set]",YD="[object String]",Dm=Object.prototype.toString;function Fl(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.areRegExpsEqual,a=e.areSetsEqual,s=e.createIsNestedEqual,u=s(c);function c(l,f,d){if(l===f)return!0;if(!l||!f||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;if($m(l)&&$m(f))return i(l,f,u,d);var p=Array.isArray(l),h=Array.isArray(f);if(p||h)return p===h&&t(l,f,u,d);var v=Dm.call(l);return v!==Dm.call(f)?!1:v===UD?n(l,f,u,d):v===GD?o(l,f,u,d):v===zD?r(l,f,u,d):v===KD?a(l,f,u,d):v===HD||v===BD?Om(l)||Om(f)?!1:i(l,f,u,d):v===VD||v===WD||v===YD?ql(l.valueOf(),f.valueOf()):!1}return c}function ew(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var XD=_l(ew);function tw(e,t){return ql(e.valueOf(),t.valueOf())}function nw(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={},a=0;return e.forEach(function(s,u){if(i){var c=!1,l=0;t.forEach(function(f,d){!c&&!o[l]&&(c=n(u,d,a,l,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[l]=!0),l++}),a++,i=c}}),i}var JD=_l(nw),QD="_owner",ZD=Object.prototype.hasOwnProperty;function rw(e,t,n,r){var i=Object.keys(e),o=i.length;if(Object.keys(t).length!==o)return!1;for(var a;o-- >0;){if(a=i[o],a===QD){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!ZD.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var e2=_l(rw);function iw(e,t){return e.source===t.source&&e.flags===t.flags}function ow(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={};return e.forEach(function(a,s){if(i){var u=!1,c=0;t.forEach(function(l,f){!u&&!o[c]&&(u=n(a,l,s,f,e,t,r))&&(o[c]=!0),c++}),i=u}}),i}var t2=_l(ow),aw=Object.freeze({areArraysEqual:ew,areDatesEqual:tw,areMapsEqual:nw,areObjectsEqual:rw,areRegExpsEqual:iw,areSetsEqual:ow,createIsNestedEqual:QS}),sw=Object.freeze({areArraysEqual:XD,areDatesEqual:tw,areMapsEqual:JD,areObjectsEqual:e2,areRegExpsEqual:iw,areSetsEqual:t2,createIsNestedEqual:QS}),n2=Fl(aw);function r2(e,t){return n2(e,t,void 0)}Fl(ZS(aw,{createIsNestedEqual:function(){return ql}}));Fl(sw);Fl(ZS(sw,{createIsNestedEqual:function(){return ql}}));var Vd={exports:{}},Of={},Bu={exports:{}},Df={};/**
|
|
36
36
|
* @license React
|
|
37
37
|
* use-sync-external-store-shim.production.min.js
|
|
38
38
|
*
|
|
@@ -40,7 +40,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==ut.Running)throw
|
|
|
40
40
|
*
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/var
|
|
43
|
+
*/var Nm;function i2(){if(Nm)return Df;Nm=1;var e=O;function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(f,d){var p=d(),h=r({inst:{value:p,getSnapshot:d}}),v=h[0].inst,C=h[1];return o(function(){v.value=p,v.getSnapshot=d,u(v)&&C({inst:v})},[f,p,d]),i(function(){return u(v)&&C({inst:v}),f(function(){u(v)&&C({inst:v})})},[f]),a(p),p}function u(f){var d=f.getSnapshot;f=f.value;try{var p=d();return!n(f,p)}catch{return!0}}function c(f,d){return d()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return Df.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,Df}var Nf={};/**
|
|
44
44
|
* @license React
|
|
45
45
|
* use-sync-external-store-shim.development.js
|
|
46
46
|
*
|
|
@@ -48,7 +48,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==ut.Running)throw
|
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the MIT license found in the
|
|
50
50
|
* LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/var
|
|
51
|
+
*/var Pm;function o2(){return Pm||(Pm=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var x=arguments.length,S=new Array(x>1?x-1:0),T=1;T<x;T++)S[T-1]=arguments[T];r("error",w,S)}}function r(w,x,S){{var T=t.ReactDebugCurrentFrame,A=T.getStackAddendum();A!==""&&(x+="%s",S=S.concat([A]));var D=S.map(function(I){return String(I)});D.unshift("Warning: "+x),Function.prototype.apply.call(console[w],console,D)}}function i(w,x){return w===x&&(w!==0||1/w===1/x)||w!==w&&x!==x}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,c=e.useDebugValue,l=!1,f=!1;function d(w,x,S){l||e.startTransition!==void 0&&(l=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var T=x();if(!f){var A=x();o(T,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var D=a({inst:{value:T,getSnapshot:x}}),I=D[0].inst,N=D[1];return u(function(){I.value=T,I.getSnapshot=x,p(I)&&N({inst:I})},[w,T,x]),s(function(){p(I)&&N({inst:I});var j=function(){p(I)&&N({inst:I})};return w(j)},[w]),c(T),T}function p(w){var x=w.getSnapshot,S=w.value;try{var T=x();return!o(S,T)}catch{return!0}}function h(w,x,S){return x()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",C=!v,E=C?h:d,y=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E;Nf.useSyncExternalStore=y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Nf}var Rm;function uw(){return Rm||(Rm=1,process.env.NODE_ENV==="production"?Bu.exports=i2():Bu.exports=o2()),Bu.exports}/**
|
|
52
52
|
* @license React
|
|
53
53
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
54
54
|
*
|
|
@@ -56,7 +56,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==ut.Running)throw
|
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the MIT license found in the
|
|
58
58
|
* LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var
|
|
59
|
+
*/var km;function a2(){if(km)return Of;km=1;var e=O,t=uw();function n(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;return Of.useSyncExternalStoreWithSelector=function(c,l,f,d,p){var h=o(null);if(h.current===null){var v={hasValue:!1,value:null};h.current=v}else v=h.current;h=s(function(){function E(T){if(!y){if(y=!0,w=T,T=d(T),p!==void 0&&v.hasValue){var A=v.value;if(p(A,T))return x=A}return x=T}if(A=x,r(w,T))return A;var D=d(T);return p!==void 0&&p(A,D)?A:(w=T,x=D)}var y=!1,w,x,S=f===void 0?null:f;return[function(){return E(l())},S===null?void 0:function(){return E(S())}]},[l,f,d,p]);var C=i(c,h[0],h[1]);return a(function(){v.hasValue=!0,v.value=C},[C]),u(C),C},Of}var Pf={};/**
|
|
60
60
|
* @license React
|
|
61
61
|
* use-sync-external-store-shim/with-selector.development.js
|
|
62
62
|
*
|
|
@@ -64,10 +64,10 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==ut.Running)throw
|
|
|
64
64
|
*
|
|
65
65
|
* This source code is licensed under the MIT license found in the
|
|
66
66
|
* LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/var Tf;function kI(){return Tf||(Tf=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=M,t=Ev();function n(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var i=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,u=e.useMemo,s=e.useDebugValue;function c(l,f,d,p,h){var v=o(null),w;v.current===null?(w={hasValue:!1,value:null},v.current=w):w=v.current;var C=u(function(){var x=!1,b,E,P=function(A){if(!x){x=!0,b=A;var K=p(A);if(h!==void 0&&w.hasValue){var re=w.value;if(h(re,K))return E=re,re}return E=K,K}var ze=b,we=E;if(i(ze,A))return we;var Z=p(A);return h!==void 0&&h(we,Z)?we:(b=A,E=Z,Z)},$=d===void 0?null:d,L=function(){return P(f())},R=$===null?void 0:function(){return P($())};return[L,R]},[f,d,p,h]),S=C[0],T=C[1],I=r(l,S,T);return a(function(){w.hasValue=!0,w.value=I},[I]),s(I),I}Xu.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Xu}process.env.NODE_ENV==="production"?Hc.exports=qI():Hc.exports=kI();var BI=Hc.exports,UI=M.useLayoutEffect;function If(e){var t=Up.useRef();return t.current||(t.current={v:e()}),t.current.v}var _s=globalThis&&globalThis.__assign||function(){return _s=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},_s.apply(this,arguments)},VI=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n},FI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o};function LI(e,t){var n=If(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var i=FI(M.useState(n),1),r=i[0];e!==r&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var o=t.context,a=t.guards,u=t.actions,s=t.activities,c=t.services,l=t.delays;t.state;var f=VI(t,["context","guards","actions","activities","services","delays","state"]),d=If(function(){var p={context:o,guards:a,actions:u,activities:s,services:c,delays:l},h=n.withConfig(p,function(){return _s(_s({},n.context),o)});return sv(h,f)});return UI(function(){Object.assign(d.machine.options.actions,u),Object.assign(d.machine.options.guards,a),Object.assign(d.machine.options.activities,s),Object.assign(d.machine.options.services,c),Object.assign(d.machine.options.delays,l)},[u,a,s,c,l]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function GI(e,t,n){if(e.status===ut.NotStarted)return!0;var i=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||i)}var zI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o};function WI(e){return e}function HI(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=zI(t,1),r=i[0],o=r===void 0?{}:r,a=LI(e,o),u=M.useCallback(function(){return a.status===ut.NotStarted?o.state?En.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),s=M.useCallback(function(f,d){return GI(a,f,d)},[a]),c=M.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),l=BI.useSyncExternalStoreWithSelector(c,u,u,WI,s);return M.useEffect(function(){var f=o.state;return a.start(f?En.create(f):void 0),function(){a.stop(),a.status=ut.NotStarted}},[]),[l,a.send,a]}const xv=M.createContext(null),$v=M.createContext(null),Av=M.createContext(null),Dv=M.createContext(null),ud=()=>M.useContext(xv),mo=()=>M.useContext(Dv),Ov="The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";function cd(e){if(!e)throw new Error(Ov)}function go(e){if(!e)throw new Error(Ov)}function Na(){const e=ud();return cd(e),M.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var KI=function(e){return e._tag==="Some"},hu=function(e){return function(t){return KI(e(t))}};const JI=hu(e=>e.type===he.Choice?ge(e):ne),YI=hu(e=>e.type===he.Numeric?ge(e):ne),XI=hu(e=>e.type===he.Boolean?ge(e):ne),QI=hu(e=>e.type===he.Component?ge(e):ne);function vu(e){return e.decision!=null&&e.decision.kind===ii.Explicit}function Nv(e){return m(e.values,It(vu),_(t=>({type:he.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function ZI(e){return m(e,xa(vu),U(()=>({type:he.Numeric,attributeId:e.id,state:null})))}function eE(e){return m(e,xa(vu),U(()=>({type:he.Boolean,attributeId:e.id,state:null})))}function tE(e){return m(e,xa(vu),U(()=>({type:he.Component,attributeId:e.id,state:null})))}function nE(e,t){return m(Ar.filterAttributesOfComponent(t,e,!0),n=>[m(n,It(JI),bb(Nv)),m(n,It(YI),_(ZI),mn),m(n,It(XI),_(eE),mn),m(n,It(QI),_(tE),mn)],Ul)}function iE(e,t=!1){const n=mo();return go(n),M.useMemo(()=>m(ee(e),U(Nn(_(i=>Ar.getAttribute(n,i)),t?Er(ee):Ei)),Ue(()=>n.attributes)),[e,n,t])}function rE(e){const t=mo(),{makeDecision:n,setManyDecision:i}=Na();go(t);const r=Ar.getChoiceAttribute(t,e),o=M.useMemo(()=>({makeDecision:(u,s)=>n({type:he.Choice,attributeId:e,choiceValueId:u,state:s}),clearDecisions:m(r,ee,U(Nv),St(lo),U(u=>()=>i(u,{type:"Default"})),Ue(()=>()=>Promise.resolve()))}),[e,r,n,i]),a=M.useMemo(()=>({...o,attribute:r}),[r,o]);if(r)return a}function oE(e){const t=mo(),{makeDecision:n}=Na();go(t);const i=Ar.getNumericAttribute(t,e),r=M.useMemo(()=>({makeDecision:a=>n({type:he.Numeric,attributeId:e,state:a})}),[e,n]),o=M.useMemo(()=>({...r,attribute:i}),[i,r]);if(i)return o}function aE(e){const t=mo(),{makeDecision:n}=Na();go(t);const i=Ar.getBooleanAttribute(t,e),r=M.useMemo(()=>({makeDecision:a=>n({type:he.Boolean,attributeId:e,state:a})}),[e,n]),o=M.useMemo(()=>({...r,attribute:i}),[i,r]);if(i)return o}function sE(e){const t=mo(),{makeDecision:n,setManyDecision:i}=Na();go(t);const r=t.attributes,o=Ar.getComponentAttribute(t,e),a=M.useMemo(()=>({makeDecision:s=>n({type:he.Component,attributeId:e,state:s}),clearSubtree:m(nE(e,r),xa(lo),U(s=>()=>i(s,{type:"Default"})),Ue(()=>()=>Promise.resolve()))}),[e,n,r,i]),u=M.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return u}const uE=bn((e,t)=>ch(Qe).equals(e??{},t??{})),cE=Cn({attributeId:bn(Rc),decisions:fo(bn(Rc))}),lE=bn((e,t)=>fo(cE).equals(e??[],t??[])),Qu=Cn({configurationModelSource:bn((e,t)=>RI(e,t)),attributeRelations:lE,usageRuleParameters:uE}),dE=Bl,Zu=Tc(dE),fE=()=>rd({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{desiredClient:null,desiredSessionContext:null,actualClient:null,session:null,sessionCreationError:null,sessionUpdateError:null,hasEverSuccessfullyCreatedSession:!1},initial:"ProcessChanges",on:{ChangeConfigurationClient:{actions:["saveDesiredClient"]},ChangeSessionContext:{actions:["saveDesiredSessionContext"]}},exit:[cn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[cn("Entering ProcessChanges","SessionManagement:"),_r(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[cn("Entering DisposeSession","SessionManagement:"),_r(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[cn("Entering CreateSession","SessionManagement:"),_r(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[cn("Entering SessionCreationFailed","SessionManagement:"),_r(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[cn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:cn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[cn("Entering UpdateSession","SessionManagement:"),_r(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[cn("Entering SessionUpdateFailed","SessionManagement:"),_r(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[cn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:cn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Xt({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Xt({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Xt((e,t)=>(e.session&&e.session.close().then(di).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Xt((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Xt((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Xt({sessionCreationError:()=>null}),setSessionUpdateError:Xt((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Xt({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Xt({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:e=>e.desiredClient.createSession(e.desiredSessionContext).then(t=>({session:t,client:e.desiredClient})).catch(t=>Promise.reject({type:t.type,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({type:t.type,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!Zu.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!Qu.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!Zu.equals(e.desiredClient,e.sessionCreationError.client)||!Tc(Qu).equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!Zu.equals(e.desiredClient,e.actualClient)||!Tc(Qu).equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function _r(e){const t=e===0,n=e===1;return mI((i,r)=>{const o={isInitializing:(!i.hasEverSuccessfullyCreatedSession||t)&&i.sessionCreationError==null,errorType:i.sessionCreationError&&i.sessionCreationError.type},a={isUpdating:n&&i.sessionUpdateError==null,errorType:i.sessionUpdateError&&i.sessionUpdateError.type};return uv({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:i.session})})}const pE=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),hE=()=>rd({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[uv((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[cn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[cn("Entering Subscribe","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{target:"ProcessChanges",cond:(e,t)=>t.session==null||e.session!==t.session,actions:["saveSession"]}},invoke:{id:"configurationSubscriptionActor",src:(e,t)=>pE(e.session)}}}},{actions:{saveSession:Xt((e,t)=>({session:t.session}))}}),vE=()=>{let e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}},Ef=()=>{const e=vE();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}},yE=()=>rd({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:Ef()},entry:[Xt({sessionManagementActor:()=>pf(fE()),configurationSubscriptionManagementActor:()=>pf(hE())})],exit:[vf(e=>e.sessionManagementActor),vf(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[Ka(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[Ka(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[Ka(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[Ka(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Xt((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),xT(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Xt((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Xt((e,t)=>{var n;const i=!((n=e.sessionInitialization)!=null&&n.isInitializing)&&e.session!=null&&e.configuration!=null&&e.configuration.session===e.session;return e.isReadyPromise&&i&&(e.isReadyPromise.resolve(),e.isReadyPromise.capsule.promise=null),{isReadyPromise:(()=>i?null:e.isReadyPromise!=null?e.isReadyPromise:Ef())()}})}});function mE(e){var t,n;const[i,r]=HI(yE,{logger:(...s)=>console.log("ConfigurationManagement:",...s)});M.useEffect(()=>{r({type:"ChangeConfigurationClient",client:e.configuratorClient}),e.configuratorClient||console.warn("The configurator client is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass a valid client.")},[e.configuratorClient]),M.useEffect(()=>{const s=m(ee(e.sessionContext),Mb(c=>ee(c.configurationModelSource)),$n);r({type:"ChangeSessionContext",sessionContext:s}),s||console.warn("The session context is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass valid session context data.")},[e.sessionContext]);const o=M.useMemo(()=>{var s,c,l,f;return{isInitializing:((c=(s=i.context.isReadyPromise)==null?void 0:s.capsule)==null?void 0:c.promise)!=null,isInitializingPromise:(l=i.context.isReadyPromise)==null?void 0:l.capsule,error:((f=i.context.sessionInitialization)==null?void 0:f.errorType)&&{type:i.context.sessionInitialization.errorType,retry:()=>r({type:"RetrySessionCreation"})}}},[i.context.sessionInitialization,i.context.isReadyPromise]),a=M.useMemo(()=>{var s,c;return{isUpdating:(s=i.context.sessionUpdating)==null?void 0:s.isUpdating,error:((c=i.context.sessionUpdating)==null?void 0:c.errorType)&&{type:i.context.sessionUpdating.errorType,retry:()=>r({type:"RetrySessionUpdate"})}}},[i.context.sessionUpdating]),u=((t=i.context.configuration)==null?void 0:t.session)===i.context.session?(n=i.context.configuration)==null?void 0:n.configuration:null;return{configurationInitialization:o,configurationUpdating:a,session:i.context.session,configuration:u}}function gE(e){const{configurationInitialization:t,configurationUpdating:n,session:i,configuration:r}=mE({configuratorClient:e.configuratorClient,sessionContext:e});return X.jsx($v.Provider,{value:t,children:X.jsx(Av.Provider,{value:n,children:X.jsx(xv.Provider,{value:i,children:X.jsx(Dv.Provider,{value:r,children:e.children})})})})}function Pv(){return M.useContext($v)}function bE(){return M.useContext(Av)}function SE(e){const{children:t}=e,{isInitializingPromise:n}=Pv();if(n!=null&&n.promise)throw n.promise;return X.jsx(X.Fragment,{children:t})}function CE(){const e=ud();return cd(e),M.useMemo(()=>({}),[e])}function wE(){const e=ud(),t=mo();return cd(e),go(t),M.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const TE=Object.freeze(Object.defineProperty({__proto__:null,Configuration:gE,ConfigurationSuspender:SE,useAttributes:iE,useBooleanAttribute:aE,useChoiceAttribute:rE,useComponentAttribute:sE,useConfiguration:wE,useConfigurationInitialization:Pv,useConfigurationUpdating:bE,useDecision:Na,useExplain:CE,useNumericAttribute:oE},Symbol.toStringTag,{value:"Module"}));var IE=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))},EE=function(e){return function(){return{concat:function(t,n){return function(i){return e.concat(t(i),n(i))}}}}},xE=function(e){var t=EE(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function xi(e){return e}function yu(e){return function(){return e}}var $E=yu(null),Mv=yu(void 0),pi=Mv;function Mn(e,t,n,i,r,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return i(n(t(e.apply(this,arguments))))};case 5:return function(){return r(i(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(r(i(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(r(i(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(o(r(i(n(t(e.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(r(i(n(t(e.apply(this,arguments)))))))))}}}function g(e,t,n,i,r,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return i(n(t(e)));case 5:return r(i(n(t(e))));case 6:return o(r(i(n(t(e)))));case 7:return a(o(r(i(n(t(e))))));case 8:return u(a(o(r(i(n(t(e)))))));case 9:return s(u(a(o(r(i(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var ai=function(e,t){var n=typeof e=="number"?function(i){return i.length>=e}:e;return function(){var i=Array.from(arguments);return n(arguments)?t.apply(this,i):function(r){return t.apply(void 0,IE([r],i,!1))}}},AE=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))},DE=function(e){return e._tag==="None"},ld=function(e){return e._tag==="Some"},mu={_tag:"None"},gu=function(e){return{_tag:"Some",value:e}},OE=function(e){return e._tag==="Left"},bu=function(e){return{_tag:"Left",left:e}},Su=function(e){return{_tag:"Right",right:e}},NE=function(e){return[e]},PE=function(e){return e.length>0},ME=function(e){return e[0]},RE=function(e){return e.slice(1)},_E=[],jE={},qE=Object.prototype.hasOwnProperty,kE=function(e){return AE([e[0]],e.slice(1),!0)};function BE(e,t){return function(n){return function(i){return e.ap(e.map(i,function(r){return function(o){return t.ap(r,o)}}),n)}}}function UE(e){return function(t){return{concat:function(n,i){return e.ap(e.map(n,function(r){return function(o){return t.concat(r,o)}}),i)}}}}function Rv(e,t,n){return function(i){for(var r=Array(n.length+1),o=0;o<n.length;o++)r[o]=n[o];return r[n.length]=i,t===0?e.apply(null,r):Rv(e,t-1,r)}}function VE(e){var t=e.length;switch(t){case 1:return function(n){var i;return i={},i[e[0]]=n,i};case 2:return function(n){return function(i){var r;return r={},r[e[0]]=n,r[e[1]]=i,r}};case 3:return function(n){return function(i){return function(r){var o;return o={},o[e[0]]=n,o[e[1]]=i,o[e[2]]=r,o}}};case 4:return function(n){return function(i){return function(r){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=i,a[e[2]]=r,a[e[3]]=o,a}}}};case 5:return function(n){return function(i){return function(r){return function(o){return function(a){var u;return u={},u[e[0]]=n,u[e[1]]=i,u[e[2]]=r,u[e[3]]=o,u[e[4]]=a,u}}}}};default:return Rv(function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var r={},o=0;o<t;o++)r[e[o]]=n[o];return r},t-1,[])}}function FE(e){return function(t){for(var n=Object.keys(t),i=n.length,r=VE(n),o=e.map(t[n[0]],r),a=1;a<i;a++)o=e.ap(o,t[n[a]]);return o}}function LE(e,t){return function(n){return function(i){return e.map(i,function(r){return t.map(r,n)})}}}function GE(e){var t=UE(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function _v(e){return function(t,n){return e.chain(t,function(i){return e.map(n(i),function(){return i})})}}var zE=function(e){return function(){return Promise.resolve().then(e)}};function WE(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var Cu=function(e,t){return g(e,jv(t))},dd=function(e,t){return g(e,HE(t))},jv=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},HE=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var i=n[0],r=n[1];return i(r)})}}},Pa=function(e){return function(){return Promise.resolve(e)}},fd=ai(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),Ma="Task",wu={URI:Ma,map:Cu},pd={URI:Ma,of:Pa},KE={URI:Ma,map:Cu,ap:dd},hd={URI:Ma,map:Cu,of:Pa,ap:dd,chain:fd},JE=xi,xf=fd,js={URI:Ma,map:Cu,of:Pa,ap:dd,chain:fd,fromIO:zE,fromTask:JE};function qv(e){return function(t){return function(n){return e.fromEither(DE(n)?bu(t()):Su(n.value))}}}function YE(e,t){return function(n,i){return function(r){return t.chain(r,function(o){return e.fromEither(n(o)?Su(o):bu(i(o)))})}}}var vd=bu,Tu=Su,kv=function(e,t){return g(e,QE(t))},XE=function(e,t){return g(e,tx(t))},yd="Either",QE=function(e){return function(t){return zi(t)?t:Tu(e(t.right))}},ZE={URI:yd,map:kv},ex=function(e){return function(t){return zi(t)?t:zi(e)?e:Tu(t.right(e.right))}},tx=ex,nx={URI:yd,map:kv,ap:XE},ix=function(e){return function(t){return zi(t)?vd(e(t.left)):t}},Bv={URI:yd,fromEither:xi},rx=qv(Bv),zi=OE,ox=function(e,t){return function(n){return zi(n)?e(n.left):t(n.right)}},rr=ox;Bv.fromEither;var ax=function(e){return zi(e)?Tu(e.left):vd(e.right)},Sn=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},wn=function(e){return Sn(function(t,n){for(var i in e)if(!e[i].equals(t[i],n[i]))return!1;return!0})},md={equals:function(e,t){return e===t}};md.equals;var sx=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function ux(e,t){return e<t?-1:e>t?1:0}var cx={equals:md.equals,compare:ux},lx=cx,dx=function(e){return{concat:sx(e)}},fx=dx;globalThis&&globalThis.__spreadArray;var px=_E,hx=PE,vx=function(e,t){return e<0||e>=t.length},yx=function(e,t,n){if(n[e]===t)return n;var i=kE(n);return i[e]=t,i},mx=function(e){return function(t){if(t.length===1)return t;for(var n=[Sx(t)],i=Cx(t),r=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=i;o<a.length;o++){var u=a[o];r(u)}return n}},gx=NE,bx=ME,Sx=bx,Cx=RE,Iu={equals:function(e,t){return e===t}},wx={equals:Iu.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};Iu.equals,wx.compare;globalThis&&globalThis.__spreadArray;var qs=function(e){return e.length===0},bo=hx,Tx=function(e){return function(t){if(qs(t))return Gv;for(var n=[],i=0;i<t.length;i++)n.push.apply(n,e(i,t[i]));return n}},Ix=vx,Ex=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return gu(n);return mu}};function Ut(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return gu(t[n]);return mu}}var xx=function(e,t){return function(n){return Ix(e,n)?mu:gu(Px(e,t(n[e]),n))}},$x=function(e,t,n){for(var i=[],r=Math.min(e.length,t.length),o=0;o<r;o++)i[o]=n(e[o],t[o]);return i};function Uv(e,t){return t===void 0?function(n){return Uv(n,e)}:$x(e,t,function(n,i){return[n,i]})}function Vv(e){return function(t,n){if(n===void 0){var i=Vv(e);return function(a){return i(t,a)}}for(var r=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(r(n[o]))return!0;return!1}}var Jr=function(e){var t=mx(e);return function(n){return bo(n)?t(n):n}},Ax=function(e){return function(t){return qs(t)?e:qs(e)?t:t.concat(e)}},ye=Ax;function Fv(e){var t=Vv(e);return function(n,i){if(i===void 0){var r=Fv(e);return function(o){return r(o,n)}}return n.filter(function(o){return!t(o,i)})}}var Dx=gx,Lv=ai(2,function(e,t){return g(e,Tx(function(n,i){return t(i,n)}))}),gd=Lv(xi),j=function(e){return function(t){return t.map(function(n){return e(n)})}},xt=function(e){return function(t){return t.filter(e)}},Ox=function(e){return function(t){for(var n=[],i=0;i<t.length;i++){var r=e(i,t[i]);ld(r)&&n.push(r.value)}return n}},Dr=function(e){return Ox(function(t,n){return e(n)})},gn=Dr(xi),Kc=function(e,t){return Nx(e,function(n,i,r){return t(i,r)})},Nx=function(e,t){return function(n){for(var i=n.length,r=e,o=0;o<i;o++)r=t(o,r,n[o]);return r}},So=function(e){return Sn(function(t,n){return t.length===n.length&&t.every(function(i,r){return e.equals(i,n[r])})})},Px=function(e,t,n){return bo(n)?yx(e,t,n):n},Jc=function(e){return e.slice()},$f=function(e){return qs(e)?Gv:e.slice()},Gv=px;function Mx(e){return function(t){return t.every(e)}}var Rx=Lv,_x=function(e){return function(t){for(var n=[],i=0;i<t.length;i++)n.push.apply(n,e(i,t[i]));return n}};function er(e){return Ut(e)}var ps=function(e){return function(t){return t.map(function(n){return e(n)})}},jx=ai(2,function(e,t){return g(e,_x(function(n,i){return t(i,n)}))}),qx=jx(xi),kx=function(e){return function(t){for(var n=[],i=0;i<t.length;i++){var r=e(i,t[i]);ld(r)&&n.push(r.value)}return n}},Di=function(e){return kx(function(t,n){return e(n)})},Bx=function(e){return function(t){return t.filter(e)}},ie=mu,be=gu;function Ra(e){return function(t){return e(t)?be(t):ie}}var zv=function(e,t){return g(e,V(t))},Wv=function(e,t){return g(e,Ux(t))},Hv="Option",Or=function(e){return{equals:function(t,n){return t===n||(Wn(t)?Wn(n):Wn(n)?!1:e.equals(t.value,n.value))}}},V=function(e){return function(t){return Wn(t)?ie:be(e(t.value))}},Ui=be,Ux=function(e){return function(t){return Wn(t)||Wn(e)?ie:be(t.value(e.value))}},Vx={URI:Hv,map:zv,ap:Wv,of:Ui},bd=ai(2,function(e,t){return Wn(e)?ie:t(e.value)}),Fx={URI:Hv,map:zv,ap:Wv,chain:bd},Lx=ai(2,function(e,t){return Wn(e)?t():e}),Af=Lx,Gx=bd(xi),Ct=function(e){return function(t){return Wn(t)?ie:e(t.value)?t:ie}},Ho=ld,Wn=function(e){return e._tag==="None"},zx=function(e,t){return function(n){return Wn(n)?e():t(n.value)}},Ti=zx,Kv=Ti,Wx=function(e){return function(t){return Wn(t)?e():t.value}},Ve=Wx,Yc=Gx,Hx=ai(2,_v(Fx)),te=function(e){return e==null?ie:be(e)},An=Ti($E,xi),pt=Ti(Mv,xi),On=bd,Kx=Hx,Jx=GE(Vx);function Yx(e){return Mn(Tu,e.of)}function Xx(e){return Mn(vd,e.of)}function Qx(e){return LE(e,ZE)}function Zx(e){return BE(e,nx)}function e0(e){return function(t,n){return e.chain(t,function(i){return zi(i)?e.of(i):n(i.right)})}}function t0(e){return function(t,n){return e.map(t,ix(n))}}function n0(e){return function(t,n){return function(i){return e.map(i,rr(t,n))}}}function i0(e){return function(t){return function(n){return e.chain(n,function(i){return zi(i)?t(i.left):e.of(i)})}}}function r0(e){return function(t){return e.map(t,ax)}}var o0=globalThis&&globalThis.__awaiter||function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(i.next(l))}catch(f){a(f)}}function s(l){try{c(i.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):r(l.value).then(u,s)}c((i=i.apply(e,t||[])).next())})},a0=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(i=1,r&&(o=c[0]&2?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,r=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],r=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},mi=Xx(pd),Co=Yx(pd),s0=Pa,u0=function(e){return jv(rx(e))},ks=n0(wu),Df=function(e,t){return function(){return o0(void 0,void 0,void 0,function(){var n;return a0(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e().then(Su)];case 1:return[2,i.sent()];case 2:return n=i.sent(),[2,bu(t(n))];case 3:return[2]}})})}},Jv=i0(hd),Of=r0(wu),Yv=function(e,t){return g(e,Tt(t))},Xv=function(e,t){return g(e,l0(t))},Tt=Qx(wu),c0=ai(2,t0(wu)),Gn=c0,l0=Zx(KE),Qv=ai(2,e0(hd)),Yr=Co,Sd="TaskEither",d0={URI:Sd,map:Yv,ap:Xv,of:Yr},Zv={URI:Sd,map:Yv,ap:Xv,chain:Qv},Cd={URI:Sd,fromEither:s0},f0=ai(2,_v(Zv)),wd=qv(Cd);Cd.fromEither;var p0=YE(Cd,Zv),h0=Yr(jE),Fn=Qv,v0=f0;function y0(e){return t=>g(t,Tt(n=>(e(n)(),n)))}const ya=y0;function Bs(e){return t=>g(t,Of,ya(e),Of)}function m0(e){return t=>g(t,ya(n=>()=>e(n)()),Bs(n=>()=>e(n)()))}function g0(e){return t=>g(t,V(n=>(e(n)(),n)))}const b0=g0;function S0(e){return Mn(be,e.of)}function C0(e){return yu(e.of(ie))}function w0(e){var t=C0(e);return function(n,i){return e.chain(n,Ti(function(){return t()},i))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var T0=S0(pd),I0=Pa,E0=ai(2,w0(hd)),x0=E0,$0=xE,Ze={equals:function(e,t){return e===t}};Ze.equals;function ey(e){return function(t,n){if(n===void 0){var i=ey(e);return function(o){return i(o,t)}}for(var r in t)if(!qE.call(n,r)||!e.equals(t[r],n[r]))return!1;return!0}}function ty(e){var t=ey(e);return Sn(function(n,i){return t(n)(i)&&t(i)(n)})}function Xc(e){return Sn((t,n)=>{const i=t==null,r=n==null;return i&&r||!i&&!r&&e.equals(t,n)})}var Td={equals:function(e,t){return e===t}};Td.equals;const en=Symbol.for("@ts-pattern/matcher"),ny=Symbol.for("@ts-pattern/isVariadic"),Us="@ts-pattern/anonymous-select-key",Qc=e=>!!(e&&typeof e=="object"),hs=e=>e&&!!e[en],Gt=(e,t,n)=>{if(hs(e)){const i=e[en](),{matched:r,selections:o}=i.match(t);return r&&o&&Object.keys(o).forEach(a=>n(a,o[a])),r}if(Qc(e)){if(!Qc(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let i=[],r=[],o=[];for(const a of e.keys()){const u=e[a];hs(u)&&u[ny]?o.push(u):o.length?r.push(u):i.push(u)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<i.length+r.length)return!1;const a=t.slice(0,i.length),u=r.length===0?[]:t.slice(-r.length),s=t.slice(i.length,r.length===0?1/0:-r.length);return i.every((c,l)=>Gt(c,a[l],n))&&r.every((c,l)=>Gt(c,u[l],n))&&(o.length===0||Gt(o[0],s,n))}return e.length===t.length&&e.every((a,u)=>Gt(a,t[u],n))}return Object.keys(e).every(i=>{const r=e[i];return(i in t||hs(o=r)&&o[en]().matcherType==="optional")&&Gt(r,t[i],n);var o})}return Object.is(t,e)},yn=e=>{var t,n,i;return Qc(e)?hs(e)?(t=(n=(i=e[en]()).getSelectionKeys)==null?void 0:n.call(i))!=null?t:[]:Array.isArray(e)?ma(e,yn):ma(Object.values(e),yn):[]},ma=(e,t)=>e.reduce((n,i)=>n.concat(t(i)),[]);function A0(...e){if(e.length===1){const[t]=e;return n=>Gt(t,n,()=>{})}if(e.length===2){const[t,n]=e;return Gt(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function Wt(e){return Object.assign(e,{optional:()=>Id(e),and:t=>tt(e,t),or:t=>iy(e,t),select:t=>t===void 0?ga(e):ga(t,e)})}function Zc(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[ny]:!0})}}))(e),{optional:()=>Zc(Id(e)),select:t=>Zc(t===void 0?ga(e):ga(t,e))})}function Id(e){return Wt({[en]:()=>({match:t=>{let n={};const i=(r,o)=>{n[r]=o};return t===void 0?(yn(e).forEach(r=>i(r,void 0)),{matched:!0,selections:n}):{matched:Gt(e,t,i),selections:n}},getSelectionKeys:()=>yn(e),matcherType:"optional"})})}const D0=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},O0=(e,t)=>{for(const[n,i]of e.entries())if(!t(i,n))return!1;return!0};function tt(...e){return Wt({[en]:()=>({match:t=>{let n={};const i=(r,o)=>{n[r]=o};return{matched:e.every(r=>Gt(r,t,i)),selections:n}},getSelectionKeys:()=>ma(e,yn),matcherType:"and"})})}function iy(...e){return Wt({[en]:()=>({match:t=>{let n={};const i=(r,o)=>{n[r]=o};return ma(e,yn).forEach(r=>i(r,void 0)),{matched:e.some(r=>Gt(r,t,i)),selections:n}},getSelectionKeys:()=>ma(e,yn),matcherType:"or"})})}function Re(e){return{[en]:()=>({match:t=>({matched:!!e(t)})})}}function ga(...e){const t=typeof e[0]=="string"?e[0]:void 0,n=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Wt({[en]:()=>({match:i=>{let r={[t??Us]:i};return{matched:n===void 0||Gt(n,i,(o,a)=>{r[o]=a}),selections:r}},getSelectionKeys:()=>[t??Us].concat(n===void 0?[]:yn(n))})})}function Qn(e){return typeof e=="number"}function or(e){return typeof e=="string"}function Pi(e){return typeof e=="bigint"}const ry=Wt(Re(function(e){return!0})),N0=ry,ar=e=>Object.assign(Wt(e),{startsWith:t=>{return ar(tt(e,(n=t,Re(i=>or(i)&&i.startsWith(n)))));var n},endsWith:t=>{return ar(tt(e,(n=t,Re(i=>or(i)&&i.endsWith(n)))));var n},minLength:t=>ar(tt(e,(n=>Re(i=>or(i)&&i.length>=n))(t))),maxLength:t=>ar(tt(e,(n=>Re(i=>or(i)&&i.length<=n))(t))),includes:t=>{return ar(tt(e,(n=t,Re(i=>or(i)&&i.includes(n)))));var n},regex:t=>{return ar(tt(e,(n=t,Re(i=>or(i)&&!!i.match(n)))));var n}}),P0=ar(Re(or)),Zn=e=>Object.assign(Wt(e),{between:(t,n)=>Zn(tt(e,((i,r)=>Re(o=>Qn(o)&&i<=o&&r>=o))(t,n))),lt:t=>Zn(tt(e,(n=>Re(i=>Qn(i)&&i<n))(t))),gt:t=>Zn(tt(e,(n=>Re(i=>Qn(i)&&i>n))(t))),lte:t=>Zn(tt(e,(n=>Re(i=>Qn(i)&&i<=n))(t))),gte:t=>Zn(tt(e,(n=>Re(i=>Qn(i)&&i>=n))(t))),int:()=>Zn(tt(e,Re(t=>Qn(t)&&Number.isInteger(t)))),finite:()=>Zn(tt(e,Re(t=>Qn(t)&&Number.isFinite(t)))),positive:()=>Zn(tt(e,Re(t=>Qn(t)&&t>0))),negative:()=>Zn(tt(e,Re(t=>Qn(t)&&t<0)))}),M0=Zn(Re(Qn)),Mi=e=>Object.assign(Wt(e),{between:(t,n)=>Mi(tt(e,((i,r)=>Re(o=>Pi(o)&&i<=o&&r>=o))(t,n))),lt:t=>Mi(tt(e,(n=>Re(i=>Pi(i)&&i<n))(t))),gt:t=>Mi(tt(e,(n=>Re(i=>Pi(i)&&i>n))(t))),lte:t=>Mi(tt(e,(n=>Re(i=>Pi(i)&&i<=n))(t))),gte:t=>Mi(tt(e,(n=>Re(i=>Pi(i)&&i>=n))(t))),positive:()=>Mi(tt(e,Re(t=>Pi(t)&&t>0))),negative:()=>Mi(tt(e,Re(t=>Pi(t)&&t<0)))}),R0=Mi(Re(Pi)),_0=Wt(Re(function(e){return typeof e=="boolean"})),j0=Wt(Re(function(e){return typeof e=="symbol"})),q0=Wt(Re(function(e){return e==null}));var Ee={__proto__:null,matcher:en,optional:Id,array:function(...e){return Zc({[en]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const n=e[0];let i={};if(t.length===0)return yn(n).forEach(o=>{i[o]=[]}),{matched:!0,selections:i};const r=(o,a)=>{i[o]=(i[o]||[]).concat([a])};return{matched:t.every(o=>Gt(n,o,r)),selections:i}},getSelectionKeys:()=>e.length===0?[]:yn(e[0])})})},set:function(...e){return Wt({[en]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};if(e.length===0)return{matched:!0};const i=(o,a)=>{n[o]=(n[o]||[]).concat([a])},r=e[0];return{matched:D0(t,o=>Gt(r,o,i)),selections:n}},getSelectionKeys:()=>e.length===0?[]:yn(e[0])})})},map:function(...e){return Wt({[en]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};const i=(u,s)=>{n[u]=(n[u]||[]).concat([s])};if(e.length===0)return{matched:!0};var r;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(r=e[0])==null?void 0:r.toString()}`);const[o,a]=e;return{matched:O0(t,(u,s)=>{const c=Gt(o,s,i),l=Gt(a,u,i);return c&&l}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...yn(e[0]),...yn(e[1])]})})},intersection:tt,union:iy,not:function(e){return Wt({[en]:()=>({match:t=>({matched:!Gt(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Re,select:ga,any:ry,_:N0,string:P0,number:M0,bigint:R0,boolean:_0,symbol:j0,nullish:q0,instanceOf:function(e){return Wt(Re(function(t){return n=>n instanceof t}(e)))},shape:function(e){return Wt(Re(A0(e)))}};const el={matched:!1,value:void 0};function W(e){return new k0(e,el)}let k0=class tl{constructor(t,n){this.input=void 0,this.state=void 0,this.input=t,this.state=n}with(...t){if(this.state.matched)return this;const n=t[t.length-1],i=[t[0]];let r;t.length===3&&typeof t[1]=="function"?r=t[1]:t.length>2&&i.push(...t.slice(1,t.length-1));let o=!1,a={};const u=(c,l)=>{o=!0,a[c]=l},s=!i.some(c=>Gt(c,this.input,u))||r&&!r(this.input)?el:{matched:!0,value:n(o?Us in a?a[Us]:a:this.input,this.input)};return new tl(this.input,s)}when(t,n){if(this.state.matched)return this;const i=!!t(this.input);return new tl(this.input,i?{matched:!0,value:n(this.input,this.input)}:el)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}};var B0=Object.getOwnPropertyNames,U0=Object.getOwnPropertySymbols,V0=Object.prototype.hasOwnProperty;function Nf(e,t){return function(i,r,o){return e(i,r,o)&&t(i,r,o)}}function Ya(e){return function(n,i,r){if(!n||!i||typeof n!="object"||typeof i!="object")return e(n,i,r);var o=r.cache,a=o.get(n),u=o.get(i);if(a&&u)return a===i&&u===n;o.set(n,i),o.set(i,n);var s=e(n,i,r);return o.delete(n),o.delete(i),s}}function Pf(e){return B0(e).concat(U0(e))}var oy=Object.hasOwn||function(e,t){return V0.call(e,t)};function wo(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var ay="_owner",Mf=Object.getOwnPropertyDescriptor,Rf=Object.keys;function F0(e,t,n){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(!n.equals(e[i],t[i],i,i,e,t,n))return!1;return!0}function L0(e,t){return wo(e.getTime(),t.getTime())}function _f(e,t,n){if(e.size!==t.size)return!1;for(var i={},r=e.entries(),o=0,a,u;(a=r.next())&&!a.done;){for(var s=t.entries(),c=!1,l=0;(u=s.next())&&!u.done;){var f=a.value,d=f[0],p=f[1],h=u.value,v=h[0],w=h[1];!c&&!i[l]&&(c=n.equals(d,v,o,l,e,t,n)&&n.equals(p,w,d,v,e,t,n))&&(i[l]=!0),l++}if(!c)return!1;o++}return!0}function G0(e,t,n){var i=Rf(e),r=i.length;if(Rf(t).length!==r)return!1;for(var o;r-- >0;)if(o=i[r],o===ay&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!oy(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function jo(e,t,n){var i=Pf(e),r=i.length;if(Pf(t).length!==r)return!1;for(var o,a,u;r-- >0;)if(o=i[r],o===ay&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!oy(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=Mf(e,o),u=Mf(t,o),(a||u)&&(!a||!u||a.configurable!==u.configurable||a.enumerable!==u.enumerable||a.writable!==u.writable)))return!1;return!0}function z0(e,t){return wo(e.valueOf(),t.valueOf())}function W0(e,t){return e.source===t.source&&e.flags===t.flags}function jf(e,t,n){if(e.size!==t.size)return!1;for(var i={},r=e.values(),o,a;(o=r.next())&&!o.done;){for(var u=t.values(),s=!1,c=0;(a=u.next())&&!a.done;)!s&&!i[c]&&(s=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(i[c]=!0),c++;if(!s)return!1}return!0}function H0(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var K0="[object Arguments]",J0="[object Boolean]",Y0="[object Date]",X0="[object Map]",Q0="[object Number]",Z0="[object Object]",e$="[object RegExp]",t$="[object Set]",n$="[object String]",i$=Array.isArray,qf=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,kf=Object.assign,r$=Object.prototype.toString.call.bind(Object.prototype.toString);function o$(e){var t=e.areArraysEqual,n=e.areDatesEqual,i=e.areMapsEqual,r=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,u=e.areSetsEqual,s=e.areTypedArraysEqual;return function(l,f,d){if(l===f)return!0;if(l==null||f==null||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;var p=l.constructor;if(p!==f.constructor)return!1;if(p===Object)return r(l,f,d);if(i$(l))return t(l,f,d);if(qf!=null&&qf(l))return s(l,f,d);if(p===Date)return n(l,f,d);if(p===RegExp)return a(l,f,d);if(p===Map)return i(l,f,d);if(p===Set)return u(l,f,d);var h=r$(l);return h===Y0?n(l,f,d):h===e$?a(l,f,d):h===X0?i(l,f,d):h===t$?u(l,f,d):h===Z0?typeof l.then!="function"&&typeof f.then!="function"&&r(l,f,d):h===K0?r(l,f,d):h===J0||h===Q0||h===n$?o(l,f,d):!1}}function a$(e){var t=e.circular,n=e.createCustomConfig,i=e.strict,r={areArraysEqual:i?jo:F0,areDatesEqual:L0,areMapsEqual:i?Nf(_f,jo):_f,areObjectsEqual:i?jo:G0,arePrimitiveWrappersEqual:z0,areRegExpsEqual:W0,areSetsEqual:i?Nf(jf,jo):jf,areTypedArraysEqual:i?jo:H0};if(n&&(r=kf({},r,n(r))),t){var o=Ya(r.areArraysEqual),a=Ya(r.areMapsEqual),u=Ya(r.areObjectsEqual),s=Ya(r.areSetsEqual);r=kf({},r,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:u,areSetsEqual:s})}return r}function s$(e){return function(t,n,i,r,o,a,u){return e(t,n,u)}}function u$(e){var t=e.circular,n=e.comparator,i=e.createState,r=e.equals,o=e.strict;if(i)return function(s,c){var l=i(),f=l.cache,d=f===void 0?t?new WeakMap:void 0:f,p=l.meta;return n(s,c,{cache:d,equals:r,meta:p,strict:o})};if(t)return function(s,c){return n(s,c,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};var a={cache:void 0,equals:r,meta:void 0,strict:o};return function(s,c){return n(s,c,a)}}var c$=Ki();Ki({strict:!0});Ki({circular:!0});Ki({circular:!0,strict:!0});Ki({createInternalComparator:function(){return wo}});Ki({strict:!0,createInternalComparator:function(){return wo}});Ki({circular:!0,createInternalComparator:function(){return wo}});Ki({circular:!0,createInternalComparator:function(){return wo},strict:!0});function Ki(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,i=e.createInternalComparator,r=e.createState,o=e.strict,a=o===void 0?!1:o,u=a$(e),s=o$(u),c=i?i(s):s$(s);return u$({circular:n,comparator:s,createState:r,equals:c,strict:a})}function l$(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var i=0;i<e.length;i++){var r=e[i];if(typeof r!="string")throw new TypeError("Url must be a string. Received "+r);r!==""&&(i>0&&(r=r.replace(/^[\/]+/,"")),i<e.length-1?r=r.replace(/[\/]+$/,""):r=r.replace(/[\/]+$/,"/"),t.push(r))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function d$(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),l$(e)}var ra=g,f$=$0(Jx({concat:fx(lx).concat,empty:0}))();function p$(e){return function(t){return t.iterNumber>=e?ie:be(0)}}function h$(e,t){return function(n){return ra(n,t,V(function(i){return Math.min(e,i)}))}}function v$(e){return function(t){return be(e*Math.pow(2,t.iterNumber))}}var y$={iterNumber:0,cumulativeDelay:0,previousDelay:ie};function m$(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+Ve(function(){return 0})(n),previousDelay:n}}function g$(e,t){var n=m$(e,t);return ra(n.previousDelay,Kv(function(){return js.of(n)},function(i){return WE(i)(js.of(n))}))}function jr(e,t,n){var i=function(r){return ra(r,t,xf(function(o){return n(o)?ra(g$(e,r),xf(function(a){return ra(a.previousDelay,Kv(function(){return js.of(o)},function(){return i(a)}))})):js.of(o)}))};return i(y$)}var ba={};Object.defineProperty(ba,"__esModule",{value:!0});ba.isGuid=sy=ba.guid=void 0;var b$=function(e){e===void 0&&(e=2);for(var t=(Date.now()*3).toString(16),n=new Date().getTimezoneOffset(),i=Number("".concat(n<0?"7":"6").concat(Math.abs(n))).toString(16),r=e*9+3+15,o="",a=0;a<e;a++)o+=Bf()+"-";for(o+=i,o+=t;o.length<r;)o+=Bf();return o.substring(0,r)},sy=ba.guid=b$,Bf=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},S$=function(e,t){t===void 0&&(t=2);var n=e.split("-"),i=C$(n[n.length-1]);if(n.length-1!==t)return"Invalid guid, invalid number of blocks";var r=n.concat().slice(0,-1).reduce(function(o,a){return o&&a.length===8&&!a.includes(" ")},!0);return r?!i&&n[n.length-1].length!==18?"Invalid guid, last date block has invalid size":!0:"Invalid guid, one or more random blocks are invalid"};ba.isGuid=S$;var C$=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function Ed(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function _a(e){return{equals(t,n){const i=g(te(t),Ve(()=>[])),r=g(te(n),Ve(()=>[]));return So(e).equals(i,r)}}}const To=wn({localId:Ze,componentPath:_a(Ze),sharedConfigurationModelId:Ed(Ze)}),uy=wn({localId:Ze,configurationModelId:Ze}),w$=Sn((e,t)=>W({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>T$.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>I$.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>E$.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>x$.equals(n.x,n.y)).otherwise(()=>!1)),T$=wn({type:Ze,attributeId:To,state:Ze,choiceValueId:Ze}),I$=wn({type:Ze,attributeId:To,state:Ze}),E$=wn({type:Ze,attributeId:To,state:Iu}),x$=wn({type:Ze,attributeId:To,state:Td});var fn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(fn||{}),pn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(pn||{}),vs=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(vs||{}),ni=(e=>(e.all="all",e.none="none",e.specific="specific",e))(ni||{}),Wi=(e=>(e.Channel="Channel",e.Package="Package",e))(Wi||{}),q=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(q||{}),nt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(nt||{}),Fe=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Fe||{}),pe=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(pe||{}),Vi=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Vi||{}),no=(e=>(e.Always="Always",e.Optional="Optional",e))(no||{}),vt=(e=>(e.Unknown="Unknown",e.CommunicationError="Local.LowLevelCommunicationError",e.ServiceError="ServiceError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationUnauthorized="ConfigurationUnauthorized",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(vt||{}),cy=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(cy||{});const $$={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};let A$=class{mapToCreateSessionRequest(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToAttributeRelations(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToConfigurationModelSource(t){return W(t).with({type:Wi.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Wi.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return g(t,te,V(Mn(j(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),pt)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:g([...t.decisions],ps(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return g(te(t),pt)}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath,sharedConfigurationModelId:t.sharedConfigurationModelId}}mapToAllowedInExplain(t){return t==null?null:{rules:this.mapToAllowedRulesInExplain(t.rules)}}mapToAllowedRulesInExplain(t){return W(t).returnType().with({type:ni.all},()=>({type:"AllowedRulesAll"})).with({type:ni.none},()=>({type:"AllowedRulesNone"})).with({type:ni.specific},n=>({type:"AllowedRulesSpecific",rules:g(n.rules,j(this.mapToGlobalConstraintId),Jc)})).with(Ee.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function D$(e){return t=>p0(n=>n!=null,e)(t)}function O$(){return Co(pi())}var hn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(hn||{}),dr=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(dr||{}),Ft=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Ft||{}),fr=(e=>(e.all="all",e.none="none",e.specific="specific",e))(fr||{});const Kt=wn({localId:Ze,componentPath:_a(Ze),sharedConfigurationModel:Ed(Ze)}),N$=Or(So(wn({attributeId:Kt,decisions:_a(Kt)}))),P$=Or(Sn((e,t)=>W({x:e,y:t}).returnType().with({x:{type:"all"},y:{type:"all"}},()=>!0).with({x:{type:"none"},y:{type:"none"}},()=>!0).with({x:{type:"specific"},y:{type:"specific"}},({x:n,y:i})=>So(uy).equals(n.rules,i.rules)).otherwise(()=>!1))),M$=Or(wn({rules:P$})),R$=wn({configurationModelSource:Sn((e,t)=>c$(e,t)),decisionsToRespect:N$,usageRuleParameters:ty(Ze),allowedInExplain:M$});var Sa=(e=>(e.Channel="Channel",e.Package="Package",e))(Sa||{}),Ge=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(Ge||{}),le=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(le||{}),$t=(e=>(e.Included="Included",e.Excluded="Excluded",e))($t||{}),dt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(dt||{}),br=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(br||{}),Sr=(e=>(e.Always="Always",e.Optional="Optional",e))(Sr||{});const _$={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:Or(Ze).equals(e.state,t.state)},j$={equals(e,t){return Or(Iu).equals(e.value,t.value)}},q$={equals(e,t){return Or(Td).equals(e.value,t.value)}},k$={equals(e,t){return Or(Ze).equals(e.state,t.state)}},B$={equals(e,t){return Kt.equals(e.attributeId,t.attributeId)?W({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,i)=>q$.equals(i.x,i.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,i)=>j$.equals(i.x,i.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,i)=>k$.equals(i.x,i.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,i)=>_$.equals(i.x,i.y)).otherwise(()=>!1):!1}},U$=So(B$),V$={equals:(e,t)=>U$.equals(e.decisions,t.decisions)&&F$.equals(e.mode,t.mode)},F$={equals:(e,t)=>W({x:e,y:t}).with({x:{type:"Default"},y:{type:"Default"}},n=>!0).with({x:{type:"DropExistingDecisions"},y:{type:"DropExistingDecisions"}},n=>!0).otherwise(()=>!1)};var nl=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(nl||{}),eo=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(eo||{}),ue=(e=>(e.ServiceError="ServiceError",e.Unknown="Unknown",e.CommunicationError="CommunicationError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(ue||{}),xd=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(xd||{});const L$={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};function G$(e,t){console.log(`--------------------------------------------------------------------------------
|
|
67
|
+
*/var Mm;function s2(){return Mm||(Mm=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=uw();function n(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;function c(l,f,d,p,h){var v=o(null),C;v.current===null?(C={hasValue:!1,value:null},v.current=C):C=v.current;var E=s(function(){var S=!1,T,A,D=function(L){if(!S){S=!0,T=L;var V=p(L);if(h!==void 0&&C.hasValue){var H=C.value;if(h(H,V))return A=H,H}return A=V,V}var R=T,ie=A;if(r(R,L))return ie;var B=p(L);return h!==void 0&&h(ie,B)?ie:(T=L,A=B,B)},I=d===void 0?null:d,N=function(){return D(f())},j=I===null?void 0:function(){return D(I())};return[N,j]},[f,d,p,h]),y=E[0],w=E[1],x=i(l,y,w);return a(function(){C.hasValue=!0,C.value=x},[x]),u(x),x}Pf.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Pf}process.env.NODE_ENV==="production"?Vd.exports=a2():Vd.exports=s2();var u2=Vd.exports,c2=O.useLayoutEffect;function jm(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var zc=globalThis&&globalThis.__assign||function(){return zc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},zc.apply(this,arguments)},l2=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},f2=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function d2(e,t){var n=jm(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=f2(O.useState(n),1),i=r[0];e!==i&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var o=t.context,a=t.guards,s=t.actions,u=t.activities,c=t.services,l=t.delays;t.state;var f=l2(t,["context","guards","actions","activities","services","delays","state"]),d=jm(function(){var p={context:o,guards:a,actions:s,activities:u,services:c,delays:l},h=n.withConfig(p,function(){return zc(zc({},n.context),o)});return GS(h,f)});return c2(function(){Object.assign(d.machine.options.actions,s),Object.assign(d.machine.options.guards,a),Object.assign(d.machine.options.activities,u),Object.assign(d.machine.options.services,c),Object.assign(d.machine.options.delays,l)},[s,a,u,c,l]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function p2(e,t,n){if(e.status===Rt.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var h2=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function v2(e){return e}function m2(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=h2(t,1),i=r[0],o=i===void 0?{}:i,a=d2(e,o),s=O.useCallback(function(){return a.status===Rt.NotStarted?o.state?er.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return p2(a,f,d)},[a]),c=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),l=u2.useSyncExternalStoreWithSelector(c,s,s,v2,u);return O.useEffect(function(){var f=o.state;return a.start(f?er.create(f):void 0),function(){a.stop(),a.status=Rt.NotStarted}},[]),[l,a.send,a]}const cw=O.createContext(null),lw=O.createContext(null),fw=O.createContext(null),dw=O.createContext(null),Nh=()=>O.useContext(cw),La=()=>O.useContext(dw),pw="The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";function Ph(e){if(!e)throw new Error(pw)}function Ba(e){if(!e)throw new Error(pw)}function mu(){const e=Nh();return Ph(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var y2=function(e){return e._tag==="Some"},Ll=function(e){return function(t){return y2(e(t))}};const g2=Ll(e=>e.type===yn.Choice?Me(e):ge),b2=Ll(e=>e.type===yn.Numeric?Me(e):ge),S2=Ll(e=>e.type===yn.Boolean?Me(e):ge),w2=Ll(e=>e.type===yn.Component?Me(e):ge);function Bl(e){return e.decision!=null&&e.decision.kind===Dl.Explicit}function hw(e){return m(e.values,ft(Bl),G(t=>({type:yn.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function C2(e){return m(e,cu(Bl),Z(()=>({type:yn.Numeric,attributeId:e.id,state:null})))}function x2(e){return m(e,cu(Bl),Z(()=>({type:yn.Boolean,attributeId:e.id,state:null})))}function E2(e){return m(e,cu(Bl),Z(()=>({type:yn.Component,attributeId:e.id,state:null})))}function T2(e,t){return m(_a.filterAttributesOfComponent(t,e,!0),n=>[m(n,ft(g2),LE(hw)),m(n,ft(b2),G(C2),Kn),m(n,ft(S2),G(x2),Kn),m(n,ft(w2),G(E2),Kn)],Il)}function vw(){const e=Nh();return Ph(e),O.useMemo(()=>({explain:(t,n)=>ue(n).with("decisions",r=>e.explain(t,r)).with("constraints",r=>e.explain(t,r)).with("full",r=>e.explain(t,r)).exhaustive(),applySolution:t=>e.applySolution(t)}),[e])}function I2(e,t=!1){const n=La();return Ba(n),O.useMemo(()=>m(he(e),Z(jn(G(r=>_a.getAttribute(n,r)),t?cr(he):si)),Ye(()=>n.attributes)),[e,n,t])}function A2(e){const t=La(),{makeDecision:n,setManyDecision:r}=mu(),i=Vl(e,rr.choiceValue);Ba(t);const o=_a.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,c)=>n({type:yn.Choice,attributeId:e,choiceValueId:u,state:c}),clearDecisions:m(o,he,Z(hw),wt(Pa),Z(u=>()=>r(u,{type:"Default"})),Ye(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function $2(e){const t=La(),{makeDecision:n}=mu(),r=Vl(e,rr.numeric);Ba(t);const i=_a.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:yn.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function O2(e){const t=La(),{makeDecision:n}=mu(),r=Vl(e,rr.boolean);Ba(t);const i=_a.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:yn.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function D2(e){const t=La(),{makeDecision:n,setManyDecision:r}=mu(),i=Vl(e,rr.component);Ba(t);const o=t.attributes,a=_a.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:c=>n({type:yn.Component,attributeId:e,state:c}),clearSubtree:m(T2(e,o),cu(Pa),Z(c=>()=>r(c,{type:"Default"})),Ye(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function Vl(e,t){const{explain:n,applySolution:r}=vw();return O.useMemo(()=>({explain:(i,o)=>{const a=ue(i.question).with(Si.whyIsNotSatisfied,()=>rr.attribute).otherwise(()=>t),s={...i,subject:a,attributeId:e};return ue(o).with("decisions",u=>n(s,u)).with("constraints",u=>n(s,u)).with("full",u=>n(s,u)).exhaustive()},applySolution:r}),[e,t,n,r])}const _m=an(Y$),N2=an(X$),P2=an((e,t)=>dh(xe).equals(e??{},t??{})),R2=mt({attributeId:_m,decisions:xr(_m)}),k2=an((e,t)=>xr(R2).equals(e??[],t??[])),M2=mt({type:xe}),j2=mt({type:xe}),_2=mt({type:xe,rules:xr(N2)}),q2=an((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:no.all},y:{type:no.all}},({x:n,y:r})=>M2.equals(n,r)).with({x:{type:no.none},y:{type:no.none}},({x:n,y:r})=>j2.equals(n,r)).with({x:{type:no.specific},y:{type:no.specific}},({x:n,y:r})=>_2.equals(n,r)).otherwise(()=>!1)),F2=mt({rules:lu(q2)}),mw=mt({configurationModelSource:an((e,t)=>r2(e,t)),attributeRelations:k2,usageRuleParameters:P2,allowedInExplain:lu(F2)}),Ud=lu(mw),L2=oh,gc=lu(L2),B2=()=>Ah({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{desiredClient:null,desiredSessionContext:null,actualClient:null,session:null,sessionCreationError:null,sessionUpdateError:null,hasEverSuccessfullyCreatedSession:!1},initial:"ProcessChanges",on:{ChangeConfigurationClient:{actions:["saveDesiredClient"]},ChangeSessionContext:{actions:["saveDesiredSessionContext"]}},exit:[Bn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Bn("Entering ProcessChanges","SessionManagement:"),zo(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Bn("Entering DisposeSession","SessionManagement:"),zo(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Bn("Entering CreateSession","SessionManagement:"),zo(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Bn("Entering SessionCreationFailed","SessionManagement:"),zo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Bn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Bn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Bn("Entering UpdateSession","SessionManagement:"),zo(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Bn("Entering SessionUpdateFailed","SessionManagement:"),zo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Bn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Bn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Pn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Pn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Pn((e,t)=>(e.session&&e.session.close().then(Br).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Pn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Pn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Pn({sessionCreationError:()=>null}),setSessionUpdateError:Pn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Pn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Pn({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:e=>e.desiredClient.createSession(e.desiredSessionContext).then(t=>({session:t,client:e.desiredClient})).catch(t=>Promise.reject({type:t.type,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({type:t.type,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!gc.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!mw.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!gc.equals(e.desiredClient,e.sessionCreationError.client)||!Ud.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!gc.equals(e.desiredClient,e.actualClient)||!Ud.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function zo(e){const t=e===0,n=e===1;return LD((r,i)=>{const o={isInitializing:(!r.hasEverSuccessfullyCreatedSession||t)&&r.sessionCreationError==null,errorType:r.sessionCreationError&&r.sessionCreationError.type},a={isUpdating:n&&r.sessionUpdateError==null,errorType:r.sessionUpdateError&&r.sessionUpdateError.type};return zS({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const V2=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),U2=()=>Ah({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[zS((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Bn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Bn("Entering Subscribe","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{target:"ProcessChanges",cond:(e,t)=>t.session==null||e.session!==t.session,actions:["saveSession"]}},invoke:{id:"configurationSubscriptionActor",src:(e,t)=>V2(e.session)}}}},{actions:{saveSession:Pn((e,t)=>({session:t.session}))}}),G2=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},qm=()=>{const e=G2();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var z2=function(e,t,n){var r=O.useRef(),i=O.useRef(0);return r.current==null&&(r.current=e),t.equals(e,r.current)||(n&&n.debug&&process.env.NODE_ENV!=="production"&&console.info("Stable hook update triggered:",{prev:r.current,value:e}),r.current=e,i.current+=1),[i.current]},Fm=function(e,t,n,r){return O.useEffect(e,z2(t,n,r))};const W2=()=>Ah({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:qm()},entry:[Pn({sessionManagementActor:()=>Tm(B2()),configurationSubscriptionManagementActor:()=>Tm(U2())})],exit:[Am(e=>e.sessionManagementActor),Am(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[Lu(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[Lu(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[Lu(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[Lu(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Pn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),YO(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Pn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Pn((e,t)=>{var n;const r=!((n=e.sessionInitialization)!=null&&n.isInitializing)&&e.session!=null&&e.configuration!=null&&e.configuration.session===e.session;return e.isReadyPromise&&r&&(e.isReadyPromise.resolve(),e.isReadyPromise.capsule.promise=null),{isReadyPromise:(()=>r?null:e.isReadyPromise!=null?e.isReadyPromise:qm())()}})}});function H2(e){var t,n;const[r,i]=m2(W2,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});Fm(()=>{i({type:"ChangeConfigurationClient",client:e.configuratorClient}),e.configuratorClient||console.warn("The configurator client is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass a valid client.")},[e.configuratorClient],Wv(gc)),Fm(()=>{const u=m(he(e.sessionContext),tT(c=>he(c.configurationModelSource)),En);i({type:"ChangeSessionContext",sessionContext:u}),u||console.warn("The session context is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass valid session context data.")},[e.sessionContext],Wv(Ud));const o=O.useMemo(()=>{var u,c,l,f;return{isInitializing:((c=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:c.promise)!=null,isInitializingPromise:(l=r.context.isReadyPromise)==null?void 0:l.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.errorType)&&{type:r.context.sessionInitialization.errorType,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,c;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((c=r.context.sessionUpdating)==null?void 0:c.errorType)&&{type:r.context.sessionUpdating.errorType,retry:()=>i({type:"RetrySessionUpdate"})}}},[r.context.sessionUpdating]),s=((t=r.context.configuration)==null?void 0:t.session)===r.context.session?(n=r.context.configuration)==null?void 0:n.configuration:null;return{configurationInitialization:o,configurationUpdating:a,session:r.context.session,configuration:s}}function K2(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=H2({configuratorClient:t,sessionContext:n});return $.jsx(lw.Provider,{value:r,children:$.jsx(fw.Provider,{value:i,children:$.jsx(cw.Provider,{value:o,children:$.jsx(dw.Provider,{value:a,children:e.children})})})})}function yw(){return O.useContext(lw)}function Y2(){return O.useContext(fw)}function X2(e){const{children:t}=e,{isInitializingPromise:n}=yw();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function J2(){const e=Nh(),t=La();return Ph(e),Ba(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const Q2=Object.freeze(Object.defineProperty({__proto__:null,Configuration:K2,ConfigurationSuspender:X2,useAttributes:I2,useBooleanAttribute:O2,useChoiceAttribute:A2,useComponentAttribute:D2,useConfiguration:J2,useConfigurationInitialization:yw,useConfigurationUpdating:Y2,useDecision:mu,useExplain:vw,useNumericAttribute:$2},Symbol.toStringTag,{value:"Module"}));var Z2=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},eN=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},tN=function(e){var t=eN(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function Mr(e){return e}function Ul(e){return function(){return e}}var nN=Ul(null),gw=Ul(void 0),Ur=gw;function sr(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return u(s(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function b(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return s(a(o(i(r(n(t(e)))))));case 9:return u(s(a(o(i(r(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var jr=function(e,t){var n=typeof e=="number"?function(r){return r.length>=e}:e;return function(){var r=Array.from(arguments);return n(arguments)?t.apply(this,r):function(i){return t.apply(void 0,Z2([i],r,!1))}}},rN=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},iN=function(e){return e._tag==="None"},Rh=function(e){return e._tag==="Some"},Gl={_tag:"None"},zl=function(e){return{_tag:"Some",value:e}},oN=function(e){return e._tag==="Left"},Wl=function(e){return{_tag:"Left",left:e}},Hl=function(e){return{_tag:"Right",right:e}},aN=function(e){return[e]},sN=function(e){return e.length>0},uN=function(e){return e[0]},cN=function(e){return e.slice(1)},lN=[],fN={},bw=Object.prototype.hasOwnProperty,dN=function(e){return rN([e[0]],e.slice(1),!0)};function pN(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function hN(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function Sw(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):Sw(e,t-1,i)}}function vN(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return Sw(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function mN(e){return function(t){for(var n=Object.keys(t),r=n.length,i=vN(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function yN(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function gN(e){var t=hN(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function ww(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var bN=function(e){return function(){return Promise.resolve().then(e)}};function SN(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var Kl=function(e,t){return b(e,Cw(t))},kh=function(e,t){return b(e,wN(t))},Cw=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},wN=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},yu=function(e){return function(){return Promise.resolve(e)}},Mh=jr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),gu="Task",Yl={URI:gu,map:Kl},jh={URI:gu,of:yu},CN={URI:gu,map:Kl,ap:kh},_h={URI:gu,map:Kl,of:yu,ap:kh,chain:Mh},xN=Mr,Lm=Mh,Wc={URI:gu,map:Kl,of:yu,ap:kh,chain:Mh,fromIO:bN,fromTask:xN};function xw(e){return function(t){return function(n){return e.fromEither(iN(n)?Wl(t()):Hl(n.value))}}}function EN(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Hl(o):Wl(r(o)))})}}}var qh=Wl,Xl=Hl,Ew=function(e,t){return b(e,IN(t))},TN=function(e,t){return b(e,ON(t))},Fh="Either",IN=function(e){return function(t){return ki(t)?t:Xl(e(t.right))}},AN={URI:Fh,map:Ew},$N=function(e){return function(t){return ki(t)?t:ki(e)?e:Xl(t.right(e.right))}},ON=$N,DN={URI:Fh,map:Ew,ap:TN},NN=function(e){return function(t){return ki(t)?qh(e(t.left)):t}},Tw={URI:Fh,fromEither:Mr},PN=xw(Tw),ki=oN,RN=function(e,t){return function(n){return ki(n)?e(n.left):t(n.right)}},ro=RN;Tw.fromEither;var kN=function(e){return ki(e)?Xl(e.left):qh(e.right)},On=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},gn=function(e){return On(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},Bm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return On(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},Lh={equals:function(e,t){return e===t}};Lh.equals;var MN=function(e){return function(t,n){return t===n||e(t,n)===0}},Jl=function(e){return{equals:MN(e),compare:function(t,n){return t===n?0:e(t,n)}}},Vm=function(e){return function(t){return Jl(function(n,r){return t.compare(e(n),e(r))})}},jN=function(){return{concat:function(e,t){return Jl(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},_N=function(){return{concat:jN().concat,empty:Jl(function(){return 0})}},qN=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function FN(e,t){return e<t?-1:e>t?1:0}var LN={equals:Lh.equals,compare:FN},BN=LN,VN=function(e){return{concat:qN(e)}},UN=VN;globalThis&&globalThis.__spreadArray;var GN=lN,Iw=sN,zN=function(e,t){return e<0||e>=t.length},WN=function(e,t,n){if(n[e]===t)return n;var r=dN(n);return r[e]=t,r},HN=function(e){return function(t){if(t.length===1)return t;for(var n=[QN(t)],r=ZN(t),i=function(u){n.every(function(c){return!e.equals(c,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},KN=function(e){if(Iw(e)){var t=_N();return YN(e.reduce(t.concat,t.empty))}return Mr},Aw=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);bw.call(n,a)?n[a].push(o):n[a]=[o]}return n}},YN=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},XN=aN,JN=uN,QN=JN,ZN=cN,Ql={equals:function(e,t){return e===t}},$w={equals:Ql.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};Ql.equals,$w.compare;globalThis&&globalThis.__spreadArray;var Hc=function(e){return e.length===0},Mo=Iw,eP=function(e){return function(t){if(Hc(t))return Pw;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},tP=zN,nP=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return zl(n);return Gl}};function fn(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return zl(t[n]);return Gl}}var rP=function(e,t){return function(n){return tP(e,n)?Gl:zl(fP(e,t(n[e]),n))}},iP=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},oP=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function Ow(e,t){return t===void 0?function(n){return Ow(n,e)}:oP(e,t,function(n,r){return[n,r]})}function Bh(e){return function(t,n){if(n===void 0){var r=Bh(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var ca=function(e){var t=HN(e);return function(n){return Mo(n)?t(n):n}},aP=function(e){var t=KN(e);return function(n){return Mo(n)?t(n):n}},sP=function(e){return function(t){return Hc(t)?e:Hc(e)?t:t.concat(e)}},Pe=sP;function Dw(e){var t=Bh(e);return function(n,r){if(r===void 0){var i=Dw(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var uP=XN,Nw=jr(2,function(e,t){return b(e,eP(function(n,r){return t(r,n)}))}),Vh=Nw(Mr),z=function(e){return function(t){return t.map(function(n){return e(n)})}},Jt=function(e){return function(t){return t.filter(e)}},cP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Rh(i)&&n.push(i.value)}return n}},jo=function(e){return cP(function(t,n){return e(n)})},Xn=jo(Mr),Gd=function(e,t){return lP(e,function(n,r,i){return t(r,i)})},lP=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},_o=function(e){return On(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},fP=function(e,t,n){return Mo(n)?WN(e,t,n):n},zd=function(e){return e.slice()},Um=function(e){return Hc(e)?Pw:e.slice()},Pw=GN;function dP(e){return function(t){return t.every(e)}}var pP=Nw,hP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}};function Ji(e){return fn(e)}var bc=function(e){return function(t){return t.map(function(n){return e(n)})}},vP=jr(2,function(e,t){return b(e,hP(function(n,r){return t(r,n)}))}),mP=vP(Mr),yP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Rh(i)&&n.push(i.value)}return n}},pi=function(e){return yP(function(t,n){return e(n)})},gP=function(e){return function(t){return t.filter(e)}},be=Gl,je=zl;function bu(e){return function(t){return e(t)?je(t):be}}var Rw=function(e,t){return b(e,ee(t))},kw=function(e,t){return b(e,bP(t))},Mw="Option",qo=function(e){return{equals:function(t,n){return t===n||(wr(t)?wr(n):wr(n)?!1:e.equals(t.value,n.value))}}},ee=function(e){return function(t){return wr(t)?be:je(e(t.value))}},Ai=je,bP=function(e){return function(t){return wr(t)||wr(e)?be:je(t.value(e.value))}},SP={URI:Mw,map:Rw,ap:kw,of:Ai},Uh=jr(2,function(e,t){return wr(e)?be:t(e.value)}),wP={URI:Mw,map:Rw,ap:kw,chain:Uh},CP=jr(2,function(e,t){return wr(e)?t():e}),Gm=CP,xP=Uh(Mr),Ht=function(e){return function(t){return wr(t)?be:e(t.value)?t:be}},ys=Rh,wr=function(e){return e._tag==="None"},EP=function(e,t){return function(n){return wr(n)?e():t(n.value)}},ti=EP,jw=ti,TP=function(e){return function(t){return wr(t)?e():t.value}},st=TP,Wd=xP,IP=jr(2,ww(wP)),ye=function(e){return e==null?be:je(e)},nr=ti(nN,Mr),qt=ti(gw,Mr),ir=Uh,AP=IP,$P=gN(SP);function OP(e){return sr(Xl,e.of)}function DP(e){return sr(qh,e.of)}function NP(e){return yN(e,AN)}function PP(e){return pN(e,DN)}function RP(e){return function(t,n){return e.chain(t,function(r){return ki(r)?e.of(r):n(r.right)})}}function kP(e){return function(t,n){return e.map(t,NN(n))}}function MP(e){return function(t,n){return function(r){return e.map(r,ro(t,n))}}}function jP(e){return function(t){return function(n){return e.chain(n,function(r){return ki(r)?t(r.left):e.of(r)})}}}function _P(e){return function(t){return e.map(t,kN)}}var qP=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(l){try{c(r.next(l))}catch(f){a(f)}}function u(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((r=r.apply(e,t||[])).next())})},FP=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Kr=DP(jh),Va=OP(jh),LP=yu,BP=function(e){return Cw(PN(e))},Kc=MP(Yl),zm=function(e,t){return function(){return qP(void 0,void 0,void 0,function(){var n;return FP(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Hl)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Wl(t(n))];case 3:return[2]}})})}},_w=jP(_h),Wm=_P(Yl),qw=function(e,t){return b(e,Yt(t))},Fw=function(e,t){return b(e,UP(t))},Yt=NP(Yl),VP=jr(2,kP(Yl)),gr=VP,UP=PP(CN),Lw=jr(2,RP(_h)),la=Va,Gh="TaskEither",GP={URI:Gh,map:qw,ap:Fw,of:la},Bw={URI:Gh,map:qw,ap:Fw,chain:Lw},zh={URI:Gh,fromEither:LP},zP=jr(2,ww(Bw)),Wh=xw(zh);zh.fromEither;var WP=EN(zh,Bw),HP=la(fN),mr=Lw,KP=zP;function YP(e){return t=>b(t,Yt(n=>(e(n)(),n)))}const Gs=YP;function Yc(e){return t=>b(t,Wm,Gs(e),Wm)}function XP(e){return t=>b(t,Gs(n=>()=>e(n)()),Yc(n=>()=>e(n)()))}function JP(e){return t=>b(t,ee(n=>(e(n)(),n)))}const QP=JP;function ZP(e){return sr(je,e.of)}function eR(e){return Ul(e.of(be))}function tR(e){var t=eR(e);return function(n,r){return e.chain(n,ti(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var nR=ZP(jh),rR=yu,iR=jr(2,tR(_h)),oR=iR,aR=tN,pt={equals:function(e,t){return e===t}},Hd={equals:pt.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},sR=function(e){return function(t){return Object.keys(t).sort(e.compare)}};function Hh(e){if(typeof e=="function")return Hh(Hd)(e);var t=sR(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var s=a[o];i.push(n(s,r[s]))}return i}}}function Vw(e){return function(t,n){if(n===void 0){var r=Vw(e);return function(o){return r(o,t)}}for(var i in t)if(!bw.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function Uw(e){var t=Vw(e);return On(function(n,r){return t(n)(r)&&t(r)(n)})}const uR=Jl(()=>0);var Kh={equals:function(e,t){return e===t}},cR={equals:Kh.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};const Mn=Symbol.for("@ts-pattern/matcher"),Gw=Symbol.for("@ts-pattern/isVariadic"),Xc="@ts-pattern/anonymous-select-key",Kd=e=>!!(e&&typeof e=="object"),Sc=e=>e&&!!e[Mn],mn=(e,t,n)=>{if(Sc(e)){const r=e[Mn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(Kd(e)){if(!Kd(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let r=[],i=[],o=[];for(const a of e.keys()){const s=e[a];Sc(s)&&s[Gw]?o.push(s):o.length?i.push(s):r.push(s)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<r.length+i.length)return!1;const a=t.slice(0,r.length),s=i.length===0?[]:t.slice(-i.length),u=t.slice(r.length,i.length===0?1/0:-i.length);return r.every((c,l)=>mn(c,a[l],n))&&i.every((c,l)=>mn(c,s[l],n))&&(o.length===0||mn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>mn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||Sc(o=i)&&o[Mn]().matcherType==="optional")&&mn(i,t[r],n);var o})}return Object.is(t,e)},Hn=e=>{var t,n,r;return Kd(e)?Sc(e)?(t=(n=(r=e[Mn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?zs(e,Hn):zs(Object.values(e),Hn):[]},zs=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function lR(...e){if(e.length===1){const[t]=e;return n=>mn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return mn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function Cn(e){return Object.assign(e,{optional:()=>Yh(e),and:t=>$t(e,t),or:t=>zw(e,t),select:t=>t===void 0?Ws(e):Ws(t,e)})}function Yd(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[Gw]:!0})}}))(e),{optional:()=>Yd(Yh(e)),select:t=>Yd(t===void 0?Ws(e):Ws(t,e))})}function Yh(e){return Cn({[Mn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Hn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:mn(e,t,r),selections:n}},getSelectionKeys:()=>Hn(e),matcherType:"optional"})})}const fR=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},dR=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function $t(...e){return Cn({[Mn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>mn(i,t,r)),selections:n}},getSelectionKeys:()=>zs(e,Hn),matcherType:"and"})})}function zw(...e){return Cn({[Mn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return zs(e,Hn).forEach(i=>r(i,void 0)),{matched:e.some(i=>mn(i,t,r)),selections:n}},getSelectionKeys:()=>zs(e,Hn),matcherType:"or"})})}function Qe(e){return{[Mn]:()=>({match:t=>({matched:!!e(t)})})}}function Ws(...e){const t=typeof e[0]=="string"?e[0]:void 0,n=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Cn({[Mn]:()=>({match:r=>{let i={[t??Xc]:r};return{matched:n===void 0||mn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??Xc].concat(n===void 0?[]:Hn(n))})})}function Ir(e){return typeof e=="number"}function io(e){return typeof e=="string"}function yi(e){return typeof e=="bigint"}const Ww=Cn(Qe(function(e){return!0})),pR=Ww,oo=e=>Object.assign(Cn(e),{startsWith:t=>{return oo($t(e,(n=t,Qe(r=>io(r)&&r.startsWith(n)))));var n},endsWith:t=>{return oo($t(e,(n=t,Qe(r=>io(r)&&r.endsWith(n)))));var n},minLength:t=>oo($t(e,(n=>Qe(r=>io(r)&&r.length>=n))(t))),maxLength:t=>oo($t(e,(n=>Qe(r=>io(r)&&r.length<=n))(t))),includes:t=>{return oo($t(e,(n=t,Qe(r=>io(r)&&r.includes(n)))));var n},regex:t=>{return oo($t(e,(n=t,Qe(r=>io(r)&&!!r.match(n)))));var n}}),hR=oo(Qe(io)),Ar=e=>Object.assign(Cn(e),{between:(t,n)=>Ar($t(e,((r,i)=>Qe(o=>Ir(o)&&r<=o&&i>=o))(t,n))),lt:t=>Ar($t(e,(n=>Qe(r=>Ir(r)&&r<n))(t))),gt:t=>Ar($t(e,(n=>Qe(r=>Ir(r)&&r>n))(t))),lte:t=>Ar($t(e,(n=>Qe(r=>Ir(r)&&r<=n))(t))),gte:t=>Ar($t(e,(n=>Qe(r=>Ir(r)&&r>=n))(t))),int:()=>Ar($t(e,Qe(t=>Ir(t)&&Number.isInteger(t)))),finite:()=>Ar($t(e,Qe(t=>Ir(t)&&Number.isFinite(t)))),positive:()=>Ar($t(e,Qe(t=>Ir(t)&&t>0))),negative:()=>Ar($t(e,Qe(t=>Ir(t)&&t<0)))}),vR=Ar(Qe(Ir)),gi=e=>Object.assign(Cn(e),{between:(t,n)=>gi($t(e,((r,i)=>Qe(o=>yi(o)&&r<=o&&i>=o))(t,n))),lt:t=>gi($t(e,(n=>Qe(r=>yi(r)&&r<n))(t))),gt:t=>gi($t(e,(n=>Qe(r=>yi(r)&&r>n))(t))),lte:t=>gi($t(e,(n=>Qe(r=>yi(r)&&r<=n))(t))),gte:t=>gi($t(e,(n=>Qe(r=>yi(r)&&r>=n))(t))),positive:()=>gi($t(e,Qe(t=>yi(t)&&t>0))),negative:()=>gi($t(e,Qe(t=>yi(t)&&t<0)))}),mR=gi(Qe(yi)),yR=Cn(Qe(function(e){return typeof e=="boolean"})),gR=Cn(Qe(function(e){return typeof e=="symbol"})),bR=Cn(Qe(function(e){return e==null}));var Ve={__proto__:null,matcher:Mn,optional:Yh,array:function(...e){return Yd({[Mn]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const n=e[0];let r={};if(t.length===0)return Hn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>mn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Hn(e[0])})})},set:function(...e){return Cn({[Mn]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};if(e.length===0)return{matched:!0};const r=(o,a)=>{n[o]=(n[o]||[]).concat([a])},i=e[0];return{matched:fR(t,o=>mn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Hn(e[0])})})},map:function(...e){return Cn({[Mn]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};const r=(s,u)=>{n[s]=(n[s]||[]).concat([u])};if(e.length===0)return{matched:!0};var i;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(i=e[0])==null?void 0:i.toString()}`);const[o,a]=e;return{matched:dR(t,(s,u)=>{const c=mn(o,u,r),l=mn(a,s,r);return c&&l}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Hn(e[0]),...Hn(e[1])]})})},intersection:$t,union:zw,not:function(e){return Cn({[Mn]:()=>({match:t=>({matched:!mn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Qe,select:Ws,any:Ww,_:pR,string:hR,number:vR,bigint:mR,boolean:yR,symbol:gR,nullish:bR,instanceOf:function(e){return Cn(Qe(function(t){return n=>n instanceof t}(e)))},shape:function(e){return Cn(Qe(lR(e)))}};const Xd={matched:!1,value:void 0};function Y(e){return new SR(e,Xd)}let SR=class Jd{constructor(t,n){this.input=void 0,this.state=void 0,this.input=t,this.state=n}with(...t){if(this.state.matched)return this;const n=t[t.length-1],r=[t[0]];let i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&r.push(...t.slice(1,t.length-1));let o=!1,a={};const s=(c,l)=>{o=!0,a[c]=l},u=!r.some(c=>mn(c,this.input,s))||i&&!i(this.input)?Xd:{matched:!0,value:n(o?Xc in a?a[Xc]:a:this.input,this.input)};return new Jd(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new Jd(this.input,r?{matched:!0,value:n(this.input,this.input)}:Xd)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}};var wR=Object.getOwnPropertyNames,CR=Object.getOwnPropertySymbols,xR=Object.prototype.hasOwnProperty;function Hm(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Vu(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);var o=i.cache,a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i);return o.delete(n),o.delete(r),u}}function Km(e){return wR(e).concat(CR(e))}var Hw=Object.hasOwn||function(e,t){return xR.call(e,t)};function Ua(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var Kw="_owner",Ym=Object.getOwnPropertyDescriptor,Xm=Object.keys;function ER(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function TR(e,t){return Ua(e.getTime(),t.getTime())}function Jm(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var u=t.entries(),c=!1,l=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],p=f[1],h=s.value,v=h[0],C=h[1];!c&&!r[l]&&(c=n.equals(d,v,o,l,e,t,n)&&n.equals(p,C,d,v,e,t,n))&&(r[l]=!0),l++}if(!c)return!1;o++}return!0}function IR(e,t,n){var r=Xm(e),i=r.length;if(Xm(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===Kw&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Hw(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function as(e,t,n){var r=Km(e),i=r.length;if(Km(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===Kw&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Hw(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=Ym(e,o),s=Ym(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function AR(e,t){return Ua(e.valueOf(),t.valueOf())}function $R(e,t){return e.source===t.source&&e.flags===t.flags}function Qm(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var s=t.values(),u=!1,c=0;(a=s.next())&&!a.done;)!u&&!r[c]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[c]=!0),c++;if(!u)return!1}return!0}function OR(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var DR="[object Arguments]",NR="[object Boolean]",PR="[object Date]",RR="[object Map]",kR="[object Number]",MR="[object Object]",jR="[object RegExp]",_R="[object Set]",qR="[object String]",FR=Array.isArray,Zm=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,ey=Object.assign,LR=Object.prototype.toString.call.bind(Object.prototype.toString);function BR(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,u=e.areTypedArraysEqual;return function(l,f,d){if(l===f)return!0;if(l==null||f==null||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;var p=l.constructor;if(p!==f.constructor)return!1;if(p===Object)return i(l,f,d);if(FR(l))return t(l,f,d);if(Zm!=null&&Zm(l))return u(l,f,d);if(p===Date)return n(l,f,d);if(p===RegExp)return a(l,f,d);if(p===Map)return r(l,f,d);if(p===Set)return s(l,f,d);var h=LR(l);return h===PR?n(l,f,d):h===jR?a(l,f,d):h===RR?r(l,f,d):h===_R?s(l,f,d):h===MR?typeof l.then!="function"&&typeof f.then!="function"&&i(l,f,d):h===DR?i(l,f,d):h===NR||h===kR||h===qR?o(l,f,d):!1}}function VR(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?as:ER,areDatesEqual:TR,areMapsEqual:r?Hm(Jm,as):Jm,areObjectsEqual:r?as:IR,arePrimitiveWrappersEqual:AR,areRegExpsEqual:$R,areSetsEqual:r?Hm(Qm,as):Qm,areTypedArraysEqual:r?as:OR};if(n&&(i=ey({},i,n(i))),t){var o=Vu(i.areArraysEqual),a=Vu(i.areMapsEqual),s=Vu(i.areObjectsEqual),u=Vu(i.areSetsEqual);i=ey({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function UR(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function GR(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,c){var l=r(),f=l.cache,d=f===void 0?t?new WeakMap:void 0:f,p=l.meta;return n(u,c,{cache:d,equals:i,meta:p,strict:o})};if(t)return function(u,c){return n(u,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(u,c){return n(u,c,a)}}var zR=Ui();Ui({strict:!0});Ui({circular:!0});Ui({circular:!0,strict:!0});Ui({createInternalComparator:function(){return Ua}});Ui({strict:!0,createInternalComparator:function(){return Ua}});Ui({circular:!0,createInternalComparator:function(){return Ua}});Ui({circular:!0,createInternalComparator:function(){return Ua},strict:!0});function Ui(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,s=VR(e),u=BR(s),c=r?r(u):UR(u);return GR({circular:n,comparator:u,createState:i,equals:c,strict:a})}function WR(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<e.length;r++){var i=e[r];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(r>0&&(i=i.replace(/^[\/]+/,"")),r<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function HR(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),WR(e)}var $s=b,KR=aR($P({concat:UN(BN).concat,empty:0}))();function YR(e){return function(t){return t.iterNumber>=e?be:je(0)}}function XR(e,t){return function(n){return $s(n,t,ee(function(r){return Math.min(e,r)}))}}function JR(e){return function(t){return je(e*Math.pow(2,t.iterNumber))}}var QR={iterNumber:0,cumulativeDelay:0,previousDelay:be};function ZR(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+st(function(){return 0})(n),previousDelay:n}}function ek(e,t){var n=ZR(e,t);return $s(n.previousDelay,jw(function(){return Wc.of(n)},function(r){return SN(r)(Wc.of(n))}))}function Wo(e,t,n){var r=function(i){return $s(i,t,Lm(function(o){return n(o)?$s(ek(e,i),Lm(function(a){return $s(a.previousDelay,jw(function(){return Wc.of(o)},function(){return r(a)}))})):Wc.of(o)}))};return r(QR)}var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.isGuid=Xh=Hs.guid=void 0;var tk=function(e){e===void 0&&(e=2);for(var t=(Date.now()*3).toString(16),n=new Date().getTimezoneOffset(),r=Number("".concat(n<0?"7":"6").concat(Math.abs(n))).toString(16),i=e*9+3+15,o="",a=0;a<e;a++)o+=ty()+"-";for(o+=r,o+=t;o.length<i;)o+=ty();return o.substring(0,i)},Xh=Hs.guid=tk,ty=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},nk=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=rk(n[n.length-1]);if(n.length-1!==t)return"Invalid guid, invalid number of blocks";var i=n.concat().slice(0,-1).reduce(function(o,a){return o&&a.length===8&&!a.includes(" ")},!0);return i?!r&&n[n.length-1].length!==18?"Invalid guid, last date block has invalid size":!0:"Invalid guid, one or more random blocks are invalid"};Hs.isGuid=nk;var rk=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function Jh(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function Su(e){return{equals(t,n){const r=b(ye(t),st(()=>[])),i=b(ye(n),st(()=>[]));return _o(e).equals(r,i)}}}const Ga=gn({localId:pt,componentPath:Su(pt),sharedConfigurationModelId:Jh(pt)}),Yw=gn({localId:pt,configurationModelId:pt}),ik=On((e,t)=>Y({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>ok.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>ak.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>sk.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>uk.equals(n.x,n.y)).otherwise(()=>!1)),ok=gn({type:pt,attributeId:Ga,state:pt,choiceValueId:pt}),ak=gn({type:pt,attributeId:Ga,state:pt}),sk=gn({type:pt,attributeId:Ga,state:Ql}),uk=gn({type:pt,attributeId:Ga,state:Kh});var Lt=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Lt||{}),et=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(et||{}),wc=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(wc||{}),pn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(pn||{}),Mi=(e=>(e.Channel="Channel",e.Package="Package",e))(Mi||{}),W=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(W||{}),xt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(xt||{}),ut=(e=>(e.Included="Included",e.Excluded="Excluded",e))(ut||{}),Oe=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Oe||{}),$i=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))($i||{}),wa=(e=>(e.Always="Always",e.Optional="Optional",e))(wa||{}),St=(e=>(e.Unknown="Unknown",e.CommunicationError="Local.LowLevelCommunicationError",e.ServiceError="ServiceError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationUnauthorized="ConfigurationUnauthorized",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(St||{}),Xw=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Xw||{});const ck={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};let lk=class{mapToCreateSessionRequest(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToAttributeRelations(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToConfigurationModelSource(t){return Y(t).with({type:Mi.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Mi.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return b(t,ye,ee(sr(z(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),qt)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:b([...t.decisions],bc(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return b(ye(t),qt)}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath,sharedConfigurationModelId:t.sharedConfigurationModelId}}mapToAllowedInExplain(t){return t==null?null:{rules:this.mapToAllowedRulesInExplain(t.rules)}}mapToAllowedRulesInExplain(t){return Y(t).returnType().with({type:pn.all},()=>({type:"AllowedRulesAll"})).with({type:pn.none},()=>({type:"AllowedRulesNone"})).with({type:pn.specific},n=>({type:"AllowedRulesSpecific",rules:b(n.rules,z(this.mapToGlobalConstraintId),zd)})).with(Ve.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function fk(e){return t=>WP(n=>n!=null,e)(t)}function dk(){return Va(Ur())}var zn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(zn||{}),ho=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(ho||{}),hn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(hn||{}),vo=(e=>(e.all="all",e.none="none",e.specific="specific",e))(vo||{});const Sn=gn({localId:pt,componentPath:Su(pt),sharedConfigurationModel:Jh(pt)}),pk=qo(_o(gn({attributeId:Sn,decisions:Su(Sn)}))),hk=qo(On((e,t)=>Y({x:e,y:t}).returnType().with({x:{type:"all"},y:{type:"all"}},()=>!0).with({x:{type:"none"},y:{type:"none"}},()=>!0).with({x:{type:"specific"},y:{type:"specific"}},({x:n,y:r})=>_o(Yw).equals(n.rules,r.rules)).otherwise(()=>!1))),vk=qo(gn({rules:hk})),mk=gn({configurationModelSource:On((e,t)=>zR(e,t)),decisionsToRespect:pk,usageRuleParameters:Uw(pt),allowedInExplain:vk});var Ks=(e=>(e.Channel="Channel",e.Package="Package",e))(Ks||{}),lt=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(lt||{}),Ie=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ie||{}),Qt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Qt||{}),jt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(jt||{}),Co=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Co||{}),xo=(e=>(e.Always="Always",e.Optional="Optional",e))(xo||{});const yk={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:qo(pt).equals(e.state,t.state)},gk={equals(e,t){return qo(Ql).equals(e.value,t.value)}},bk={equals(e,t){return qo(Kh).equals(e.value,t.value)}},Sk={equals(e,t){return qo(pt).equals(e.state,t.state)}},wk={equals(e,t){return Sn.equals(e.attributeId,t.attributeId)?Y({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>bk.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>gk.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>Sk.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>yk.equals(r.x,r.y)).otherwise(()=>!1):!1}},Ck=_o(wk),xk={equals:(e,t)=>Ck.equals(e.decisions,t.decisions)&&Ek.equals(e.mode,t.mode)},Ek={equals:(e,t)=>Y({x:e,y:t}).with({x:{type:"Default"},y:{type:"Default"}},n=>!0).with({x:{type:"DropExistingDecisions"},y:{type:"DropExistingDecisions"}},n=>!0).otherwise(()=>!1)};var Qd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(Qd||{}),ya=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ya||{}),Ce=(e=>(e.ServiceError="ServiceError",e.Unknown="Unknown",e.CommunicationError="CommunicationError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(Ce||{}),Qh=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Qh||{});const Tk={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};function Ik(e,t){console.log(`--------------------------------------------------------------------------------
|
|
68
68
|
-- ${t??""}
|
|
69
69
|
--------------------------------------------------------------------------------
|
|
70
|
-
${JSON.stringify(e,null,2)}`)}var oa=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(oa||{}),ly=(e=>(e.BooleanAttributeNotFound="BooleanAttributeNotFound",e.ChoiceAttributeNotFound="ChoiceAttributeNotFound",e.ChoiceValueNotFound="ChoiceValueNotFound",e.ConfigurationInitializationFailure="InitializationFailure",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.LegacyConfigurationModelInvalid="DeploymentStore.Core.Store.SnapshotInvalid",e.LegacySnapshotInvalid="SnapshotInvalid",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConflictWithConsequence="ConflictWithConsequence",e.DecisionInvalid="DecisionInvalid",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.NumericAttributeNotFound="NumericAttributeNotFound",e.NumericDecisionOutOfRange="NumericDecisionOutOfRange",e.SessionNotFound="SessionNotFound",e.SetDecisionConflict="SetDecisionConflict",e.Unauthorized="Unauthorized",e.AuthenticationFailure="AuthenticationFailure",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(ly||{});const z$=e=>Object.values(ly).includes(e),W$=e=>z$(e)?be(e):ie;function H$(e){const t=n=>W(n).with("ConfigurationModelNotFound",()=>({type:ue.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:ue.DecisionsToRespectInvalid})).with(Ee.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:ue.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:ue.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:ue.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:ue.ConfigurationConflict,reason:xd.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:ue.ConfigurationConflict})).with(Ee.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:ue.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:ue.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:ue.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:ue.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:ue.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",i=>({type:ue.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:ue.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:ue.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return g(e.type,W$,V(t))}const K$=e=>Object.values(oa).includes(e),J$=e=>K$(e)?be(e):ie;function Y$(e){return g(e,J$,V(n=>W(n).with("Generic::LocalClientError",()=>({type:ue.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:ue.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:ue.CommunicationError})).with("Generic::Unauthorized",()=>({type:ue.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:ue.Unknown})).exhaustive()))}function hi(e,t){G$(e,t);const n=e.type;return g(ie,Af(()=>H$(e)),Af(()=>Y$(n)),Ve(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:ue.Unknown})))}class X${constructor(t,n,i,r){this.engineApiClient=t,this.contractToRestMapper=n,this.restToDomainMapper=i,this.options=r}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t);return g(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),Gn(i=>hi(i,"ClientSideSessionLifetimeHandler - create")),Fn(i=>this.restToDomainMapper.mapToSessionId(i)),D$(()=>({type:ue.ConfigurationUnauthenticated})))}close(t){return g(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),Gn(n=>hi(n,"ClientSideSessionLifetimeHandler - close")),Tt(()=>pi()))}}var dy=(e=>(e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e))(dy||{});function ci(e,t,n){const i=g(Array.isArray(e)?e:[e],d$);return g(Df(()=>fetch(i,t),r=>({type:"error"})),Fn(r=>g(Df(async()=>{const o=await r.json();return{response:r,data:o}},()=>r))),Jv(r=>r.status===401?mi({type:oa.ConfigurationEngineRestApiUnauthorized,status:401}):r.status===204?Co({response:r,data:{}}):r.type==="error"?mi({type:oa.LowLevelCommunicationError}):mi({type:oa.UnhandledResponseStatus})),Fn(r=>g(n(r),wd(()=>r.data))))}function il(e,t){return ci(e,t,n=>{if(n.response.status===200)return Ui(n.data);if(n.response.status===409){const i=n.data;return W(i).with({type:"ConfigurationModelInvalid"},r=>Ui(i)).with({type:"ConfigurationModelNotFeasible"},r=>Ui(i)).otherwise(()=>ie)}return ie})}class Q${constructor(t){this.baseUrl=t}createSessionUsingApiKey(t,n){const i={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-API-KEY":n},body:JSON.stringify(t)};return il([this.baseUrl,"v2/session"],i)}createSessionUsingJwtBearer(t,n){const i={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify(t)};return il([this.baseUrl,"v2/session"],i)}setMany(t,n){const i={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return ci([this.baseUrl,"v2/session/configuration/decision/many"],i,r=>r.response.status===200||r.response.status===409?be(r.data):ie)}makeDecision(t,n){const i={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return ci([this.baseUrl,"v2/session/configuration/decision"],i,r=>r.response.status===200?be(r.data):ie)}getDecisions(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return ci([this.baseUrl,"v2/session/configuration/decision"],n,i=>i.response.status===200?be(i.data):ie)}getWhyStateNotPossible(t,n){const i={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return ci([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],i,r=>r.response.status===200?be(r.data):ie)}getWhyNotSatisfied(t,n){const i={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return ci([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],i,r=>r.response.status===200?be(r.data):ie)}getConsequence(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return ci([this.baseUrl,"v2/session/configuration/consequence"],n,i=>i.response.status===200?be(i.data):ie)}deleteSessionUsingJwtBearer(t,n){const i={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return ci([this.baseUrl,`v2/session/${t}`],i,r=>r.response.status===204?be({}):ie)}}var Cr=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Cr||{}),rl=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(rl||{}),ol=(e=>(e.Always="Always",e.Optional="Optional",e))(ol||{}),Ca=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Ca||{}),gi=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(gi||{}),un=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(un||{}),al=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(al||{}),sl=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(sl||{}),Ko=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ko||{});const an=wn({localId:Ze,componentPath:_a(Ze),sharedConfigurationModelId:Ed(Ze)});let fy=class{mapToDecisions(t){return{}}mapToSessionId(t){return W(t).with({sessionId:Ee.string},n=>Co(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const i=g(n.constraintExplanations,j(r=>this.mapToConstraintExplanation(r)));return mi({type:ue.ConfigurationModelNotFeasible,constraintExplanations:i})}).with({type:"ConfigurationModelInvalid"},()=>mi({type:ue.ConfigurationModelInvalid})).otherwise(()=>mi({type:ue.Unknown}))}mapToExplainAnswer(t,n){const i=W(n).with({question:hn.whyIsStateNotPossible,subject:Ft.boolean},a=>[{type:le.Boolean,attributeId:a.attributeId,value:be(a.state)}]).with({question:hn.whyIsStateNotPossible,subject:Ft.numeric},a=>[{type:le.Numeric,attributeId:a.attributeId,value:be(a.state)}]).with({question:hn.whyIsStateNotPossible,subject:Ft.component},a=>[{type:le.Component,attributeId:a.attributeId,state:be(a.state)}]).with({question:hn.whyIsStateNotPossible,subject:Ft.choiceValue},a=>[{type:le.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:be(a.state)}]).otherwise(()=>[]),r=g(t.decisionExplanations,j(a=>this.mapToDecisionExplanation(a,i,{type:"Default"}))),o=g(t.constraintExplanations,j(a=>this.mapToConstraintExplanation(a)));return W(n).with({answerType:dr.decisions},()=>({decisionExplanations:r})).with({answerType:dr.constraints},()=>({constraintExplanations:o})).with({answerType:dr.all},()=>({constraintExplanations:o,decisionExplanations:r})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,i){const r=this.mapToExplicitDecisions(n);return{type:ue.ConfigurationSetManyConflict,decisionExplanations:g(t.decisionExplanations,j(o=>this.mapToDecisionExplanation(o,r,i))),constraintExplanations:g(t.constraintExplanations,j(o=>this.mapToConstraintExplanation(o)))}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModel(t,n){const i=this.mapToAttributes(t,n);return{isSatisfied:n.isConfigurationSatisfied??!1,attributes:i}}mapToBooleanDecision(t){return{type:le.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:te(t.state)}}mapToNumericDecision(t){return{type:le.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:te(t.state)}}mapToComponentDecision(t){return{type:le.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:le.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToDecisionState(t.state)}}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModel:t.sharedConfigurationModelId,componentPath:t.componentPath??[]}}mapToChoiceValueDecision(t){return g(this.mapToDecisionState(t.state),V(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:g(t.causedByRules,j(n=>this.mapToRuleConstraint(n))),causedByCardinalities:g(t.causedByCardinalities,j(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:eo.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:eo.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=g(t.booleanDecisions??[],j(a=>({type:le.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:te(a.state)}))),i=g(t.numericDecisions??[],j(a=>({type:le.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:te(a.state)}))),r=g(t.componentDecisions??[],j(a=>({type:le.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:g(te(a.state),V(u=>this.mapToDecisionState(u)),Yc)}))),o=g(t.choiceDecisions??[],j(a=>({type:le.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:g(te(a.state),V(u=>this.mapToDecisionState(u)),Yc)})));return g([],ye(n),ye(i),ye(r),ye(o))}mapToDecisionExplanation(t,n,i){const r=g(t.causedByBooleanDecisions,j(h=>this.mapToCausedByBooleanDecision(h))),o=g(t.causedByNumericDecisions,j(h=>this.mapToCausedByNumericDecision(h))),a=g(t.causedByComponentDecisions,j(h=>this.mapToCausedByComponentDecision(h))),u=g(t.causedByChoiceDecisions,j(h=>this.mapToCausedByChoiceValueDecision(h))),s=g(r,j(h=>({type:le.Boolean,attributeId:h.attributeId,value:ie}))),c=g(o,j(h=>({type:le.Numeric,attributeId:h.attributeId,value:ie}))),l=g(a,j(h=>({type:le.Component,attributeId:h.attributeId,state:ie}))),f=g(u,j(h=>({type:le.ChoiceValue,attributeId:h.attributeId,choiceValueId:h.choiceValueId,state:ie}))),d=g([],ye(s),ye(c),ye(l),ye(f)),p=Fv(Sn((h,v)=>{const w=Kt.equals(h.attributeId,v.attributeId);return W({a:h,b:v}).with({a:{type:le.ChoiceValue},b:{type:le.ChoiceValue}},C=>w&&C.a.choiceValueId===C.b.choiceValueId).otherwise(()=>w)}))(d)(n);return{causedByBooleanDecisions:r,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:u,solution:{decisions:g([],ye(d),ye(p)),mode:i}}}mapToCausedByBooleanDecision(t){return{type:le.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return W(t).with(al.NotAvailable,()=>nl.NotAvailable).with(al.StateNotPossible,()=>nl.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:le.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:le.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:le.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToAttributes(t,n){function i(d){return g(n.canAttributeContributeToConfigurationSatisfaction,Ut(p=>an.equals(p,d)),Ho)}const r=g([],ye(g(t.choiceValueDecisions,j(d=>d.attributeId))),ye(g(n.choiceConsequences,j(d=>d.attributeId))),Jr(an)),o=g(r,j(d=>{const p=g(t.choiceValueDecisions??[],Bx(v=>an.equals(v.attributeId,d))),h=g(n.choiceConsequences??[],er(v=>an.equals(v.attributeId,d)));return g(h,V(v=>this.mapToChoiceAttributes(v,p,i(d))))}),gn),a=g([],ye(g(t.numericDecisions,j(d=>d.attributeId))),ye(g(n.numericConsequences,j(d=>d.attributeId))),Jr(an)),u=g(a,j(d=>{const p=g(t.numericDecisions??[],er(v=>an.equals(v.attributeId,d))),h=g(n.numericConsequences??[],er(v=>an.equals(v.attributeId,d)));return g(h,V(v=>this.mapToNumericAttribute(v,p,i(d))))}),gn),s=g([],ye(g(t.booleanDecisions,j(d=>d.attributeId))),ye(g(n.booleanConsequences,j(d=>d.attributeId))),Jr(an)),c=g(s,j(d=>{const p=g(t.booleanDecisions??[],er(v=>an.equals(v.attributeId,d))),h=g(n.booleanConsequences??[],er(v=>an.equals(v.attributeId,d)));return g(h,V(v=>this.mapToBooleanAttribute(v,p,i(d))))}),gn),l=g([],ye(g(t.componentDecisions,j(d=>d.attributeId))),ye(g(n.componentConsequences,j(d=>d.attributeId))),Jr(an)),f=g(l,j(d=>{const p=g(t.componentDecisions??[],er(v=>an.equals(v.attributeId,d))),h=g(n.componentConsequences??[],er(v=>an.equals(v.attributeId,d)));return g(h,V(v=>this.mapToComponentAttribute(v,p,i(d))))}),gn);return g([],ye(o),ye(f),ye(u),ye(c))}mapToComponentAttribute(t,n,i){return{type:Ge.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:g(t.possibleDecisionStates,ps(r=>this.mapToPossibleDecisionState(r))),decision:g(n,On(r=>g(this.mapToDecisionState(r.state),V(o=>({state:o,kind:r.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:g(t.selection,te,V(r=>this.mapToSelection(r)),pt),canContributeToConfigurationSatisfaction:i}}mapToChoiceAttributes(t,n,i){const r=g(t.values,ps(o=>{const a=g(n,Ut(u=>u.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:Ge.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:r,canContributeToConfigurationSatisfaction:i}}mapToBooleanAttribute(t,n,i){return{type:Ge.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:g(n,On(r=>g(r.state,te,V(o=>({kind:this.mapToDecisionKind(r.kind),state:o}))))),canContributeToConfigurationSatisfaction:i}}mapToNumericAttribute(t,n,i){return{type:Ge.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,range:{min:t.range.min,max:t.range.max},selection:this.mapToSelection(t.selection),decimalPlaces:t.decimalPlaces,decision:g(n,On(r=>g(r.state,te,V(o=>({kind:this.mapToDecisionKind(r.kind),state:o}))))),canContributeToConfigurationSatisfaction:i}}mapToChoiceValue(t,n){const i=g(t.possibleDecisionStates,ps(r=>this.mapToPossibleDecisionState(r)));return{choiceValueId:t.choiceValueId,decision:g(n,On(r=>this.mapToChoiceValueDecision(r))),possibleDecisionStates:i}}mapToDecisionKind(t){return W(t).with(Ca.Implicit,()=>dt.Implicit).with(Ca.Explicit,()=>dt.Explicit).exhaustive()}mapToDecisionState(t){return W(t).with(gi.Included,()=>be($t.Included)).with(gi.Excluded,()=>be($t.Excluded)).with(gi.Undefined,()=>ie).exhaustive()}mapToPossibleDecisionState(t){return W(t).with(Cr.Included,()=>$t.Included).with(Cr.Excluded,()=>$t.Excluded).exhaustive()}mapToSelection(t){return W(t).with(rl.Mandatory,()=>br.Mandatory).with(rl.Optional,()=>br.Optional).exhaustive()}mapToInclusion(t){return W(t).with(ol.Always,()=>Sr.Always).with(ol.Optional,()=>Sr.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}};class Z${constructor(t,n){this.restToDomainMapper=new fy,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),i=il(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return g(i,Gn(r=>hi(r,"ServerSideSessionLifetimeHandler - create")),Fn(r=>this.restToDomainMapper.mapToSessionId(r)))}close(t){return g(ci(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===dy.NoContent?be({}):ie),Gn(n=>hi(n,"ServerSideSessionLifetimeHandler - close")),Tt(pi))}}class eA{constructor(t,n,i){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=i,this.onConfigurationChangedHandler=ie}setOnConfigurationChangedHandler(t){const n=g(t,te,V(i=>r=>{const o=this.domainToContractMapper.mapToConfiguration(r);i(o)}));this.inner.setOnConfigurationChangedHandler(n)}getConfiguration(){const t=this.inner.getConfiguration();return this.domainToContractMapper.mapToConfiguration(t)}getSessionContext(){const t=this.inner.getSessionContext();return this.domainToContractMapper.mapToSessionContext(t)}async setSessionContext(t){const n=this.contractToDomainMapper.mapToSessionContext(t);return await g(this.inner.setSessionContext(n),Tt(pi),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await g(this.inner.restoreConfiguration(n),Tt(pi),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await g(this.inner.makeDecision(n),Tt(pi),this.adaptToContractPromise())()}async setMany(t,n){const i=this.contractToDomainMapper.mapToAttributeDecisions(t),r=this.contractToDomainMapper.mapToMode(n);return await g(this.inner.setMany(i,r),Tt(pi),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await g(this.inner.applySolution(n),Tt(pi),this.adaptToContractPromise())()}async explain(t,n){const i=this.contractToDomainMapper.mapToExplainQuestion(t,n);return await g(this.inner.explain(i),Tt(r=>this.domainToContractMapper.mapToExplainAnswer(r)),this.adaptToContractPromise())()}async close(){return await g(this.inner.close(),Gn(t=>this.domainToContractMapper.mapToFailureResult(t)),ks(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Mn(Gn(t=>this.domainToContractMapper.mapToFailureResult(t)),ks(t=>Promise.reject(t),t=>Promise.resolve(t)))}}class tA{mapToExplainQuestion(t,n){const i={answerType:W(n).with("decisions",()=>dr.decisions).with("constraints",()=>dr.constraints).with("full",()=>dr.all).exhaustive()};return W(t).with({question:fn.whyIsNotSatisfied,subject:pn.configuration},r=>({...i,question:hn.whyIsNotSatisfied,subject:Ft.configuration})).with({question:fn.whyIsNotSatisfied,subject:pn.attribute},r=>({...i,question:hn.whyIsNotSatisfied,subject:Ft.attribute,attributeId:this.mapToGlobalAttributeId(r.attributeId)})).with({question:fn.whyIsStateNotPossible,subject:pn.choiceValue},r=>({...i,question:hn.whyIsStateNotPossible,subject:Ft.choiceValue,attributeId:this.mapToGlobalAttributeId(r.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(r.state)})).with({question:fn.whyIsStateNotPossible,subject:pn.component},r=>({...i,question:hn.whyIsStateNotPossible,subject:Ft.component,attributeId:this.mapToGlobalAttributeId(r.attributeId),state:this.mapToDecisionState(r.state)})).with({question:fn.whyIsStateNotPossible,subject:pn.numeric},r=>({...i,question:hn.whyIsStateNotPossible,subject:Ft.numeric,attributeId:this.mapToGlobalAttributeId(r.attributeId),state:r.state})).with({question:fn.whyIsStateNotPossible,subject:pn.boolean},r=>({...i,question:hn.whyIsStateNotPossible,subject:Ft.boolean,attributeId:this.mapToGlobalAttributeId(r.attributeId),state:r.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:g(t.attributes,j(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return g(t,j(n=>this.mapToAttributeDecision(n)))}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),decisionsToRespect:this.mapToDecisionsToRespect(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToAttributeDecision(t){return W(t).with({type:q.Choice,choiceValueId:Ee.string},n=>({type:le.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:q.Numeric},n=>({type:le.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:te(n.state)})).with({type:q.Boolean},n=>({type:le.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:te(n.state)})).with({type:q.Component},n=>({type:le.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(te(n.state),On(i=>this.mapToDecisionStateOption(i)))})).exhaustive()}mapToDecisionsToRespect(t){return g(te(t),V(n=>g(n,j(i=>({attributeId:this.mapToGlobalAttributeId(i.attributeId),decisions:g(i.decisions,j(r=>this.mapToGlobalAttributeId(r)))})))))}mapToMode(t){return W(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).exhaustive()}mapToConflictHandling(t){return W(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath??[],sharedConfigurationModel:t.sharedConfigurationModelId}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return W(t).with({type:Wi.Package},n=>({type:Sa.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Wi.Channel},n=>({type:Sa.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:g(t.decisions,j(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return W(t).with({type:q.Boolean},n=>({type:Ge.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:g(n.decision,te,V(i=>({kind:this.mapToDecisionKind(i.kind),state:i.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:q.Numeric},n=>({type:Ge.Numeric,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,range:{min:n.range.min,max:n.range.max},decimalPlaces:n.decimalPlaces,selection:this.mapToSelection(n.selection),decision:g(n.decision,te,V(i=>({kind:this.mapToDecisionKind(i.kind),state:i.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:q.Choice},n=>({type:Ge.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:g(n.values,j(i=>this.mapToChoiceValue(i))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:q.Component},n=>({type:Ge.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:g(n.decision,te,On(i=>g(this.mapToDecisionStateOption(i.state),V(r=>({kind:this.mapToDecisionKind(i.kind),state:r}))))),possibleDecisionStates:g(n.possibleDecisionStates,j(i=>this.mapToDecisionStateOption(i)),gn),selection:g(n.selection,te,V(i=>this.mapToSelection(i)),pt),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:g(t.possibleDecisionStates,j(n=>this.mapToDecisionStateOption(n)),gn)}}mapToChoiceValueDecision(t){return g(t.decision,te,On(n=>g(this.mapToDecisionStateOption(n.state),V(i=>({state:i,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return W(t).with(pe.Implicit,()=>dt.Implicit).with(pe.Explicit,()=>dt.Explicit).exhaustive()}mapToSelection(t){return W(t).with(Vi.Mandatory,()=>br.Mandatory).with(Vi.Optional,()=>br.Optional).exhaustive()}mapToInclusion(t){return W(t).with(no.Always,()=>Sr.Always).with(no.Optional,()=>Sr.Optional).exhaustive()}mapToDecisionState(t){return W(t).with(Ee.union(nt.Included,Fe.Included),()=>$t.Included).with(Ee.union(nt.Excluded,Fe.Excluded),()=>$t.Excluded).exhaustive()}mapToDecisionStateOption(t){return g(te(t),V(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return g(t,te,V(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return g(t,te,V(n=>W(n).returnType().with({type:ni.all},()=>({type:fr.all})).with({type:ni.none},()=>({type:fr.none})).with({type:ni.specific},i=>({type:fr.specific,rules:g(i.rules,j(this.mapToGlobalConstraintId))})).exhaustive()))}}class py{mapToExplainAnswer(t){const n=W(t).with({decisionExplanations:Ee.array(Ee.any)},r=>g(r.decisionExplanations,j(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),i=W(t).with({constraintExplanations:Ee.array(Ee.any)},r=>g(r.constraintExplanations,j(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:i}}mapToConstraintExplanation(t){return{causedByCardinalities:g(t.causedByCardinalities,j(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:g(t.causedByRules,j(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=g(t.causedByChoiceDecisions,j(a=>this.mapToCausedByChoiceAttributeDecision(a))),i=g(t.causedByComponentDecisions,j(a=>this.mapToCausedByComponentAttributeDecision(a))),r=g(t.causedByNumericDecisions,j(a=>this.mapToCausedByNumericAttributeDecision(a))),o=g(t.causedByBooleanDecisions,j(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:g([],ye(n),ye(i),ye(r),ye(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:g(t.decisions,j(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return W(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return W(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToDecisionsToRespect(t.decisionsToRespect),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToFailureResult(t){return W(t).with({type:ue.ConfigurationConflict},n=>({type:vt.ConfigurationConflict,reason:W(n.reason).with(xd.NumericDecisionOutOfRange,()=>cy.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:ue.ConfigurationApplicationError},()=>({type:vt.ConfigurationApplicationError})).with({type:ue.ConfigurationUnauthenticated},()=>({type:vt.ConfigurationUnauthenticated})).with({type:ue.ConfigurationModelNotFound},()=>({type:vt.ConfigurationModelNotFound})).with({type:ue.ConfigurationTimeout},()=>({type:vt.ConfigurationTimeout})).with({type:ue.ConfigurationAttributeNotFound},()=>({type:vt.ConfigurationAttributeNotFound})).with({type:ue.ConfigurationChoiceValueNotFound},()=>({type:vt.ConfigurationChoiceValueNotFound})).with({type:ue.ConfigurationSolutionNotAvailable},()=>({type:vt.ConfigurationSolutionNotAvailable})).with({type:ue.ConfigurationRejectedDecisionsConflict},n=>{const i=g(n.rejectedDecisions,j(r=>this.mapToExplicitDecision(r)));return $$.createConfigurationRejectedDecisionsConflict(i)}).with({type:ue.DecisionsToRespectInvalid},()=>({type:vt.DecisionsToRespectInvalid})).with({type:ue.ServiceError},()=>({type:vt.ServiceError})).with({type:ue.CommunicationError},()=>({type:vt.CommunicationError})).with({type:ue.Unknown},()=>({type:vt.Unknown})).with({type:ue.ConfigurationModelInvalid},()=>({type:vt.ConfigurationModelInvalid})).with({type:ue.ConfigurationInitializationFailure},()=>({type:vt.ConfigurationInitializationFailure})).with({type:ue.ConfigurationModelNotFeasible},n=>({type:vt.ConfigurationModelNotFeasible,constraintExplanations:g(n.constraintExplanations,j(i=>this.mapToConstraintExplanation(i)))})).with({type:ue.ConfigurationSetManyConflict},n=>({type:vt.ConfigurationSetManyConflict,decisionExplanations:g(n.decisionExplanations,j(i=>this.mapToDecisionExplanation(i))),constraintExplanations:g(n.constraintExplanations,j(i=>this.mapToConstraintExplanation(i)))})).with({type:ue.SpecifiedDeploymentForbidden},n=>({type:vt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:g(t.attributes,j(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return g(t,V(Mn(j(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:g(n.decisions,j(i=>this.mapToGlobalAttributeId(i)))})))),An)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return W(t).with({type:Sa.Package},n=>({type:Wi.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Sa.Channel},n=>({type:Wi.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return W(t).with({type:le.ChoiceValue},n=>({type:q.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.state,V(i=>this.mapToChoiceValueDecisionState(i)),pt),choiceValueId:n.choiceValueId})).with({type:le.Component},n=>({type:q.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.state,V(i=>this.mapToComponentDecisionState(i)),pt)})).with({type:le.Numeric},n=>({type:q.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,pt)})).with({type:le.Boolean},n=>({type:q.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,pt)})).exhaustive()}mapToCardinality(t){return W(t).with(eo.Cardinality,()=>vs.Cardinality).with(eo.Component,()=>vs.Component).with(eo.Rule,()=>vs.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return W(t).with({type:le.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:le.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:le.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:le.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:q.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:q.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:q.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:q.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return W(t).with(br.Mandatory,()=>Vi.Mandatory).with(br.Optional,()=>Vi.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return W(t).with({type:Ge.Boolean},i=>({...n,type:q.Boolean,decision:g(i.decision,V(r=>({state:r.state,kind:this.mapToDecisionKind(r.kind)})),An),selection:this.mapToSelection(i.selection),possibleDecisionStates:i.possibleDecisionStates})).with({type:Ge.Numeric},i=>({...n,type:q.Numeric,decision:g(i.decision,V(r=>({state:r.state,kind:this.mapToDecisionKind(r.kind)})),An),range:i.range,decimalPlaces:i.decimalPlaces,selection:this.mapToSelection(i.selection)})).with({type:Ge.Choice},i=>({...n,type:q.Choice,cardinality:i.cardinality,values:g(i.values,j(r=>{const o=g(r.decision,V(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),An);return{id:r.choiceValueId,possibleDecisionStates:g(r.possibleDecisionStates,j(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:Ge.Component},i=>({...n,type:q.Component,decision:g(i.decision,V(r=>({state:this.mapToComponentDecisionState(r.state),kind:this.mapToDecisionKind(r.kind)})),An),possibleDecisionStates:g(i.possibleDecisionStates,j(r=>this.mapToComponentDecisionState(r))),selection:g(i.selection,te,V(r=>this.mapToSelection(r)),pt),inclusion:this.mapToInclusion(i.inclusion)})).exhaustive()}mapToInclusion(t){return W(t).with(Sr.Always,()=>no.Always).with(Sr.Optional,()=>no.Optional).exhaustive()}mapToComponentDecisionState(t){return W(t).with($t.Included,()=>Fe.Included).with($t.Excluded,()=>Fe.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return W(t).with($t.Included,()=>nt.Included).with($t.Excluded,()=>nt.Excluded).exhaustive()}mapToDecisionKind(t){return W(t).with(dt.Explicit,()=>pe.Explicit).with(dt.Implicit,()=>pe.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return g(t,V(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),An)}mapToAllowedRulesInExplain(t){return g(t,V(n=>W(n).returnType().with({type:fr.all},()=>({type:ni.all})).with({type:fr.none},()=>({type:ni.none})).with({type:fr.specific},i=>({type:ni.specific,rules:g(i.rules,j(this.mapToGlobalConstraintId))})).exhaustive()),An)}}class nA{constructor(t,n){this.contractToDomainMapper=new tA,this.domainToContractMapper=new py,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await g(this.sessionHandler.recreate(n),Tt(i=>{const r=this.internalConfigurationSessionCreator(this.sessionHandler,i);return new eA(r,this.contractToDomainMapper,this.domainToContractMapper)}),ks(i=>{const r=this.domainToContractMapper.mapToFailureResult(i);return Promise.reject(r)},i=>Promise.resolve(i)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:ie,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}}function hy(e){return e.possibleDecisionStates.some(t=>t===nt.Included)}function iA(e){return!hy(e)}function rA(e){return W(e).with({type:q.Choice},t=>t.cardinality.lowerBound>0).with({type:q.Boolean},t=>t.selection===Vi.Mandatory).with({type:q.Numeric},t=>t.selection===Vi.Mandatory).with({type:q.Component},t=>t.inclusion===no.Optional&&t.selection===Vi.Mandatory).exhaustive()}function oA(e){return W(e).with({type:q.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function aA(e){return g(e.values,xt(hy))}function sA(e){return g(e.values,xt(iA))}function vy(e,t){return g(e.values,Dr(n=>g(n.decision,te,Ct(i=>i.kind===t))))}function yy(e){return g(e.values,xt(t=>g(t.decision,te,V(n=>n.state===nt.Included),Ve(()=>!1))))}const uA=yy;function my(e){return g(e.decision,te,Ct(t=>t.kind===pe.Explicit),An)}function gy(e){return g(e.decision,te,Ct(t=>t.kind===pe.Explicit),An)}function cA(e,t){return e.possibleDecisionStates.some(n=>n===t)}function by(e){return g(e.decision,te,An)}function Sy(e){return Cy(e,Fe.Included)}function lA(e){return!Sy(e)}function Cy(e,t){return e.possibleDecisionStates.some(n=>n===t)}const Jo=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:aA,getBlockedChoiceValues:sA,getBooleanDecision:gy,getChoiceDecisions:vy,getComponentDecision:by,getIncludedChoiceValues:yy,getNumericDecision:my,getSelectedChoiceValues:uA,isBooleanValuePossible:cA,isComponentAllowed:Sy,isComponentBlocked:lA,isComponentStatePossible:Cy,isMandatory:rA,isMultiSelect:oA},Symbol.toStringTag,{value:"Module"})),wy=e=>e.type===q.Boolean,Ty=e=>e.type===q.Choice,Iy=e=>e.type===q.Numeric,Ey=e=>e.type===q.Component,dA=_a(Ze);function fA(e,t,n){var i;const r=((i=t.componentPath)==null?void 0:i.length)??0;return g(e,xt(o=>{var a;const u=((a=o.id.componentPath)==null?void 0:a.length)??0;return n?r>u?!1:g(o.id.componentPath??[],Uv(t.componentPath??[]),Mx(([s,c])=>s===c)):dA.equals(o.id.componentPath,t.componentPath)}))}function pA(e,t,n){return[]}function hA(e){return g(e,xt(t=>{const n=g(t.id.componentPath,te,V(r=>r.length===0),Ve(()=>!0)),i=g(t.id.sharedConfigurationModelId,te,Ti(()=>!0,()=>!1));return n&&i}))}function vA(e,t){return g(xy(e),j(n=>vy(n,t)),gd,Dr(n=>te(n)))}function yA(e,t){return g(Ay(e),xt(n=>{var i;return((i=n.decision)==null?void 0:i.kind)===t}),j(n=>my(n)),Dr(n=>te(n)))}function mA(e,t){return g(Dy(e),xt(n=>{var i;return((i=n.decision)==null?void 0:i.kind)===t}),j(n=>gy(n)),Dr(n=>te(n)))}function gA(e,t){return g($y(e),xt(n=>{var i;return((i=n.decision)==null?void 0:i.kind)===t}),j(n=>by(n)),Dr(n=>te(n)))}function xy(e){return g(e.attributes,xt(Ty))}function $y(e){return g(e.attributes,xt(Ey))}function Ay(e){return g(e.attributes,xt(Iy))}function Dy(e){return g(e.attributes,xt(wy))}function bA(e,t){return g(ja(e,t),pt)}function SA(e,t){return g(Oy(e,t),pt)}function CA(e,t,n){return g(Oy(e,t),V(i=>i.values),On(Mn(Ut(i=>i.id===n))),pt)}function wA(e,t){return g(ja(e,t),Ct(Iy),pt)}function TA(e,t){return g(ja(e,t),Ct(wy),pt)}function IA(e,t){return g(ja(e,t),Ct(Ey),pt)}function ja(e,t){return g(e.attributes,Ut(n=>To.equals(n.id,t)))}function Oy(e,t){return g(ja(e,t),Ct(Ty))}const Io=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:fA,filterAttributesOfRoot:hA,filterAttributesOfShared:pA,getAttribute:bA,getBooleanAttribute:TA,getBooleanAttributes:Dy,getBooleanDecisions:mA,getChoiceAttribute:SA,getChoiceAttributes:xy,getChoiceDecisions:vA,getChoiceValue:CA,getComponentAttribute:IA,getComponentAttributes:$y,getComponentDecisions:gA,getNumericAttribute:wA,getNumericAttributes:Ay,getNumericDecisions:yA},Symbol.toStringTag,{value:"Module"}));fn.whyIsNotSatisfied,pn.configuration;const EA="https://spc.cloud.ceventis.de/api/engine",xA={hcaEngineBaseUrl:EA};function $A(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??xA.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function qo(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const Ny=e=>t=>n=>g(n,Ex(i=>e.equals(i,t)),V(i=>g(n,xx(i,r=>t))),Yc,Ve(()=>g(n,ye(Dx(t))))),Xa=Ny({equals:(e,t)=>Kt.equals(e.attributeId,t.attributeId)}),AA=Ny({equals:(e,t)=>e.choiceValueId===t.choiceValueId});class DA{constructor(t){this.restToDomainMapper=t}updateConfigurationSession(t,n){const i=this.updateConfigurationModel(t.configuration,n);return{...t,configuration:i}}updateConfigurationModel(t,n){var i,r,o,a,u,s,c,l,f;const d=g(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],j(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),p=g(((r=n.consequences)==null?void 0:r.choiceConsequences)??[],j(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),h=g(((o=n.affectedDecisions)==null?void 0:o.componentDecisions)??[],j(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),v=g(((a=n.consequences)==null?void 0:a.componentConsequences)??[],j(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),w=g(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],j(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),C=g(((s=n.consequences)==null?void 0:s.numericConsequences)??[],j(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),S=g(((c=n.affectedDecisions)==null?void 0:c.booleanDecisions)??[],j(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),T=g(((l=n.consequences)==null?void 0:l.booleanConsequences)??[],j(b=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(b.attributeId),payload:b}))),I=g([],ye(g(S,j(b=>b.attributeId))),ye(g(T,j(b=>b.attributeId))),ye(g(w,j(b=>b.attributeId))),ye(g(C,j(b=>b.attributeId))),ye(g(d,j(b=>b.attributeId))),ye(g(p,j(b=>b.attributeId))),ye(g(h,j(b=>b.attributeId))),ye(g(v,j(b=>b.attributeId))),Jr(Kt)),x=g(I,Kc(t.attributes,(b,E)=>{const P=t.attributes.find($=>Kt.equals($.attributeId,E));return W(P).with({type:Ge.Choice},($,L)=>{const R=this.mergeChoice(L,g(p,Ut(A=>Kt.equals(A.attributeId,E)),V(A=>A.payload)),g(d,xt(A=>Kt.equals(A.attributeId,E)),j(A=>A.payload)));return Xa(R)(b)}).with({type:Ge.Numeric},($,L)=>{const R=this.mergeNumeric(L,g(C,Ut(A=>Kt.equals(A.attributeId,E)),V(A=>A.payload)),g(w,Ut(A=>Kt.equals(A.attributeId,E)),V(A=>A.payload)));return Xa(R)(b)}).with({type:Ge.Boolean},($,L)=>{const R=this.mergeBoolean(L,g(T,Ut(A=>Kt.equals(A.attributeId,E)),V(A=>A.payload)),g(S,Ut(A=>Kt.equals(A.attributeId,E)),V(A=>A.payload)));return Xa(R)(b)}).with({type:Ge.Component},($,L)=>{const R=this.mergeComponent(L,g(v,Ut(A=>Kt.equals(A.attributeId,E)),V(A=>A.payload)),g(h,Ut(A=>Kt.equals(A.attributeId,E)),V(A=>A.payload)));return Xa(R)(b)}).exhaustive()}));return{...t,isSatisfied:g((f=n.consequences)==null?void 0:f.isConfigurationSatisfied,te,Ve(()=>t.isSatisfied)),attributes:x}}mergeChoice(t,n,i){const r=g(n,V(s=>s.values??[]),Ve(()=>[])),o=g(i),a=g([],ye(g(r,j(s=>s.choiceValueId))),ye(g(o,j(s=>s.choiceValueId))),j(qo),Jr(Ze)),u=g(a,Kc(t.values,(s,c)=>{const l=g(r,Ut(h=>h.choiceValueId===c)),f=g(o,Ut(h=>h.choiceValueId===c)),d=g(t.values.find(h=>h.choiceValueId===c),te),p=this.mergeChoiceValue(c,d,l,f);return AA(p)(s)}));return{...t,isSatisfied:g(n,V(s=>qo(s.isSatisfied)),Ve(()=>t.isSatisfied)),values:u}}mergeChoiceValue(t,n,i,r){const o=g(r,V(u=>({state:this.toDecisionState(qo(u.state)),kind:this.toDecisionKind(qo(u.kind))})),Ve(()=>({state:g(n,On(u=>g(u.decision,V(s=>s.state)))),kind:g(n,On(u=>g(u.decision,V(s=>s.kind))),Ve(()=>dt.Explicit))}))),a=g(i,V(u=>g($f(u.possibleDecisionStates??[]),j(s=>this.toPossibleDecisionState(s)),gn)),Ve(()=>g(n,V(u=>u.possibleDecisionStates??[]),Ve(()=>[]))));return{choiceValueId:t,decision:g(o.state,V(u=>({state:u,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,i){const r=g(i,V(a=>{const u=this.toDecisionState(qo(a.state));return g(u,V(s=>({state:s,kind:this.toDecisionKind(a.kind)})))}),Ve(()=>g(t.decision,V(a=>({state:a.state,kind:a.kind}))))),o=g(n,V(a=>g($f(a.possibleDecisionStates??[]),j(u=>this.toPossibleDecisionState(u)),gn)),Ve(()=>t.possibleDecisionStates));return{...t,isSatisfied:g(n,V(a=>a.isSatisfied),Ve(()=>t.isSatisfied)),possibleDecisionStates:o,decision:r}}mergeNumeric(t,n,i){return{...t,isSatisfied:g(n,On(r=>te(r.isSatisfied)),Ve(()=>t.isSatisfied)),decision:g(i,Ti(()=>t.decision,r=>g(r.state,te,V(o=>({kind:this.toDecisionKind(r.kind),state:o})))))}}mergeBoolean(t,n,i){return{...t,isSatisfied:g(n,On(r=>te(r.isSatisfied)),Ve(()=>t.isSatisfied)),decision:g(i,Ti(()=>t.decision,r=>g(r.state,te,V(o=>({kind:this.toDecisionKind(r.kind),state:o}))))),possibleDecisionStates:g(n,V(r=>r.possibleDecisionStates),Ve(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return W(t).with(Cr.Included,()=>be($t.Included)).with(Cr.Excluded,()=>be($t.Excluded)).otherwise(()=>ie)}toDecisionState(t){return W(t).with(gi.Included,()=>be($t.Included)).with(gi.Excluded,()=>be($t.Excluded)).otherwise(()=>ie)}toDecisionKind(t){return W(t).with(Ca.Implicit,()=>dt.Implicit).with(Ca.Explicit,()=>dt.Explicit).exhaustive()}}class OA{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return W(t).with({type:le.ChoiceValue},n=>({type:un.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:le.Component},n=>({type:un.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:le.Numeric},n=>({type:un.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,pt)})).with({type:le.Boolean},n=>({type:un.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,pt)})).exhaustive()}mapToExplicitDecisions(t,n){const i=this.mapToMode(n),r=g([...t],Di(s=>s.type!==le.Boolean?ie:be({type:un.Boolean,attributeId:this.mapToGlobalAttributeId(s.attributeId),state:g(s.value,pt)}))),o=g([...t],Di(s=>s.type!==le.Numeric?ie:be({type:un.Numeric,attributeId:this.mapToGlobalAttributeId(s.attributeId),state:g(s.value,pt)}))),a=g([...t],Di(s=>s.type!==le.ChoiceValue?ie:be({type:un.Choice,attributeId:this.mapToGlobalAttributeId(s.attributeId),choiceValueId:s.choiceValueId,state:this.mapToDecisionState(s.state)}))),u=g([...t],Di(s=>s.type!==le.Component?ie:be({type:un.Component,attributeId:this.mapToGlobalAttributeId(s.attributeId),state:this.mapToDecisionState(s.state)})));return{mode:i,choiceDecisions:a,numericDecisions:o,booleanDecisions:r,componentDecisions:u}}mapToExplicitDecisionsInner(t){const n=g([...t],Di(a=>a.type!==Ge.Boolean?ie:g(a.decision,Ct(u=>u.kind===dt.Explicit),V(()=>this.mapToExplicitBooleanDecision(a))))),i=g([...t],Di(a=>a.type!==Ge.Numeric?ie:g(a.decision,Ct(u=>u.kind===dt.Explicit),V(()=>this.mapToExplicitNumericDecision(a))))),r=g([...t],Di(a=>a.type!==Ge.Component?ie:g(a.decision,Ct(u=>u.kind===dt.Explicit),V(()=>this.mapToExplicitComponentDecision(a))))),o=g([...t],Di(a=>a.type!==Ge.Choice?ie:g(this.mapToExplicitChoiceDecisions(a),Ra(u=>g(u,bo)))),qx);return{booleanDecisions:n,numericDecisions:i,choiceDecisions:o,componentDecisions:r}}mapToMode(t){return W(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>this.mapToDropExistingDecisionsMode(n)).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:g(t.componentPath,te,V(Jc),An),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:W(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:Ee.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:un.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:g(t.decision,V(n=>n.state),pt)}}mapToExplicitNumericDecision(t){return{type:un.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:g(t.decision,V(n=>n.state),pt)}}mapToExplicitComponentDecision(t){return{type:un.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(g(t.decision,V(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(i){return g(i.decision,V(r=>r.kind===dt.Explicit),Ve(()=>!1))}return g(t.values,xt(n),j(i=>({type:un.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(g(i.decision,V(r=>r.state)))})),Jc)}mapToDecisionState(t){return g(t,V(n=>W(n).with($t.Included,()=>gi.Included).with($t.Excluded,()=>gi.Excluded).exhaustive()),Ve(()=>gi.Undefined))}mapToPossibleDecisionState(t){return W(t).with($t.Included,()=>Cr.Included).with($t.Excluded,()=>Cr.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return W(t).with({subject:Ft.attribute},n=>({type:sl.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:Ft.configuration},()=>({type:sl.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return W(t).with({subject:Ft.boolean},n=>({type:Ko.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:Ft.numeric},n=>({type:Ko.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:Ft.component},n=>({type:Ko.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:Ft.choiceValue},n=>({type:Ko.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}}class NA{constructor(){this.configurationSession={hasExplicitDecisions(t){return g(t.configuration.attributes,Ut(n=>W(n).with({type:Ge.Boolean},i=>g(i.decision,Ct(r=>r.kind===dt.Explicit),Ho)).with({type:Ge.Numeric},i=>g(i.decision,Ct(r=>r.kind===dt.Explicit),Ho)).with({type:Ge.Choice},i=>g(i.values,Ut(r=>g(r.decision,V(o=>o.kind===dt.Explicit),Ve(()=>!1))),Ho)).with({type:Ge.Component},i=>g(i.decision,Ct(r=>r.kind===dt.Explicit),Ho)).exhaustive()),Ti(()=>!1,()=>!0))},getExplicitDecisions(t){return g(t.configuration.attributes,j(n=>W(n).with({type:Ge.Boolean},i=>g(i.decision,Ct(r=>r.kind===dt.Explicit),V(r=>({type:le.Boolean,attributeId:i.attributeId,value:te(r.state)})),V(r=>[r]))).with({type:Ge.Numeric},i=>g(i.decision,Ct(r=>r.kind===dt.Explicit),V(r=>({type:le.Numeric,attributeId:i.attributeId,value:te(r.state)})),V(r=>[r]))).with({type:Ge.Choice},i=>g(i.values,j(r=>g(r.decision,Ct(o=>o.kind===dt.Explicit),V(o=>({type:le.ChoiceValue,attributeId:i.attributeId,choiceValueId:r.choiceValueId,state:te(o.state)})))),gn,Ui)).with({type:Ge.Component},i=>g(i.decision,Ct(r=>r.kind===dt.Explicit),V(r=>({type:le.Component,attributeId:i.attributeId,state:te(r.state)})),V(r=>[r]))).exhaustive()),gn,gd)}}}}class PA{constructor(t,n,i,r,o,a){this.engineApiClient=n,this.domainToRestMapper=r,this.restToDomainMapper=i,this.domainToContractMapper=o,this.domainUpdater=a,this.sessionHandler=t,this.interpreter=new NA}close(t){return this.sessionHandler.close(t)}recreate(t){return this.initializeInner(t,!1)}reinitialize(t){return this.initializeInner(t,!0)}makeDecision(t,n){const i=this.domainToRestMapper.mapToExplicitDecision(t);return this.withSession(n,(r,o)=>g(this.engineApiClient.makeDecision(r,i),Gn(hi),Tt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,i=>{const r=W(t).with({question:hn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,i)).with({question:hn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,i)).exhaustive();return g(r,Gn(hi),Tt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,i){return this.withSession(i,(r,o)=>{const a=this.setManyInner(t,n,r);return g(a,Fn(u=>{var s,c,l,f;const d=g([],ye(g(((s=u.rejectedDecisions)==null?void 0:s.booleanDecisions)??[],j(p=>this.restToDomainMapper.mapToBooleanDecision(p)))),ye(g(((c=u.rejectedDecisions)==null?void 0:c.numericDecisions)??[],j(p=>this.restToDomainMapper.mapToNumericDecision(p)))),ye(g(((l=u.rejectedDecisions)==null?void 0:l.componentDecisions)??[],j(p=>this.restToDomainMapper.mapToComponentDecision(p)))),ye(g(((f=u.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],j(p=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(p)))));return g(d,bo)?mi(L$.createConfigurationRejectedDecisionsConflict(d)):Yr(this.domainUpdater.updateConfigurationSession(o,u))}))})}replaceDecisions(t,n){const i=this.interpreter.configurationSession.getExplicitDecisions(n),r=this.setManyInner(i,{type:"DropExistingDecisions",conflictHandling:{type:"Automatic"}},t);return g(r,Tt(o=>({})))}setManyInner(t,n,i){const r=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(i,r);return g(o,Gn(hi),Fn(a=>{const u={rejectedDecisions:{booleanDecisions:Ee.array(Ee.any)}},s={decisionExplanations:Ee.array(Ee.any)};return W(a).with(u,c=>Co(c)).with(s,c=>mi(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(c,r,n))).otherwise(()=>mi({type:ue.Unknown}))}))}explainWhyStateNotPossible(t,n){const i=this.domainToRestMapper.mapToWhyStateNotPossibleRequest(t);return this.engineApiClient.getWhyStateNotPossible(n,i)}explainWhyNotSatisfied(t,n){const i=this.domainToRestMapper.mapToWhyNotSatisfiedRequest(t);return this.engineApiClient.getWhyNotSatisfied(n,i)}withSession(t,n){return g(Yr(t),Fn(i=>g(i.sessionId,Ti(()=>this.initializeInner(i,!1),()=>Yr(i)))),Fn(i=>g(i.sessionId,wd(()=>({type:ue.ConfigurationUnauthenticated})),Fn(r=>n(r,i)))))}initializeInner(t,n){return g(h0,()=>g(t.sessionId,I0,x0(u=>n?T0(u):g(this.sessionHandler.close(u),ks(()=>ie,()=>ie)))),u=>{const s=this.domainToContractMapper.mapToSessionContext(t.context);return g(u,u0(()=>({type:ue.ConfigurationUnauthenticated})),Jv(()=>this.sessionHandler.create(s)))},u=>g(u,v0(s=>g(Ui(t),Ct(this.interpreter.configurationSession.hasExplicitDecisions),V(c=>this.replaceDecisions(s,c)),Ve(()=>Yr({}))))),u=>g(u,Fn(s=>{const c=this.determineConsequences(s),l=this.determineDecisions(s),f=FE(d0)({consequences:c,decisions:l});return g(f,Tt(({decisions:d,consequences:p})=>this.restToDomainMapper.mapToConfigurationModel(d,p)),Tt(d=>({sessionId:Ui(s),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return g(this.engineApiClient.getDecisions(t),Gn(hi))}determineConsequences(t){return g(this.engineApiClient.getConsequence(t),Gn(hi))}}class MA{constructor(t,n){this.onConfigurationChangedHandler=ie,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return g(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return g(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:ie}}restoreConfiguration(t){return g(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return g(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return g(this.configurationSession.sessionId,V(t=>this.sessionHandler.close(t)),V(Mn(Tt(t=>{this.configurationSession={...this.configurationSession,sessionId:ie}}))),Ve(yu(O$())))}applySolution(t){return g(this.configurationSession.solutions,Ut(n=>V$.equals(n,t)),wd(()=>({type:ue.ConfigurationSolutionNotAvailable})),Tt(n=>n.decisions),Fn(n=>this.setMany(n,t.mode)))}setMany(t,n){return g(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),Bs(i=>()=>{const r=W(i).with({decisionExplanations:Ee.array(Ee.any)},o=>be(o.decisionExplanations)).otherwise(()=>ie);this.configurationSession={...this.configurationSession,solutions:g(r,V(Mn(j(o=>o.solution))),Ve(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=W(t).with({decisionExplanations:Ee.array(Ee.any)},i=>i.decisionExplanations).otherwise(()=>[]);return g(n,j(i=>i.solution))}invalidateAvailableSolutions(){return m0(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Bs(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return ya(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Mn(ya(t=>()=>{this.configurationSession=t,g(this.onConfigurationChangedHandler,b0(n=>()=>n(this.configurationSession.configuration)))}),Tt(t=>t.configuration),this.invalidateAvailableSolutions())}}class RA{constructor(t){this.inner=t;const n=3,i=2e3,r=200;this.policy=h$(i,f$.concat(v$(r),p$(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return jr(this.policy,n,i=>g(i,rr(r=>this.determineAndPrepareRetry(r),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return jr(this.policy,n,i=>g(i,rr(r=>this.determineAndPrepareRetry(r),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return jr(this.policy,n,i=>g(i,rr(r=>this.determineAndPrepareRetry(r),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return jr(this.policy,n,i=>g(i,rr(r=>this.determineAndPrepareRetry(r),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return jr(this.policy,n,i=>g(i,rr(r=>this.determineAndPrepareRetry(r),()=>!1)))}setMany(t,n){const i=()=>this.inner.setMany(t,n);return jr(this.policy,i,r=>g(r,rr(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return W(t).with({type:ue.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:ue.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}}class _A{constructor(){this.queue=[],this.operating=ie}push(t){const n=new jA(t);return this.queue.push(n),this.operating=g(this.operating,Ve(()=>this.start()),Ui),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=g(t,j(i=>i.argument),Kc(ie,(i,r)=>this.reduce(i,r)),V(Mn(i=>this.execute(i),i=>i.then(r=>{g(t,j(o=>{o.resolve(r)}))}).catch(r=>{g(t,j(o=>{o.reject(r)}))}))),pt);n&&await n}this.operating=ie}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}}class jA{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,i)=>{this.resolve=n,this.reject=i})}}class qA extends _A{constructor(t){super(),this.inner=t}reduce(t,n){return be(n)}async execute(t){return await this.inner.setSessionContext(t)()}}class kA{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new qA(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(R$.equals(n,t))return Co(this.getConfiguration());const i=this.setContextReducingTaskExecutor.push(t);return()=>i}applySolution(t){return this.inner.applySolution(t)}close(){return this.inner.close()}makeDecision(t){return this.inner.makeDecision(t)}restoreConfiguration(t){return this.inner.restoreConfiguration(t)}setMany(t,n){return this.inner.setMany(t,n)}explain(t){return this.inner.explain(t)}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}}class BA{constructor(t,n=!1){this.stringify=n,this.inner=t,this.durationNumberFormat=new Intl.NumberFormat("en-EN",{maximumFractionDigits:3})}withLogging(t,n,i){const r=performance.now(),o=()=>{const a=performance.now()-r;return this.durationNumberFormat.format(a)};return console.debug(`Operation ${t} started with`,this.renderAsRequired(n)),g(i(),Bs(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),ya(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with success`,this.renderAsRequired(a))}))}renderAsRequired(t){return this.stringify?JSON.stringify(t,null,2):t}explain(t){return this.withLogging("explain",[t],()=>this.inner.explain(t))}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){return this.withLogging("setSessionContext",[t],()=>this.inner.setSessionContext(t))}applySolution(t){return this.withLogging("applySolution",[t],()=>this.inner.applySolution(t))}close(){return this.inner.close()}makeDecision(t){return this.withLogging("makeDecision",[t],()=>this.inner.makeDecision(t))}restoreConfiguration(t){return this.withLogging("restoreConfiguration",[t],()=>this.inner.restoreConfiguration(t))}setMany(t,n){return this.withLogging("setMany",[t,n],()=>this.inner.setMany(t,n))}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}}let UA=class Py{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+sy()}static new(t){return new Py(t)}close(){return this.executeTaskSynchronous(()=>this.inner.close())}restoreConfiguration(t){return this.executeTaskSynchronous(()=>this.inner.restoreConfiguration(t))}setSessionContext(t){return this.executeTaskSynchronous(()=>this.inner.setSessionContext(t))}invalidateSessionId(){return this.inner.invalidateSessionId()}makeDecision(t){return this.executeTaskSynchronous(()=>this.inner.makeDecision(t))}applySolution(t){return this.executeTaskSynchronous(()=>this.inner.applySolution(t))}setMany(t,n){return this.executeTaskSynchronous(()=>this.inner.setMany(t,n))}explain(t){return this.executeTaskSynchronous(()=>this.inner.explain(t))}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}getConfiguration(){return this.inner.getConfiguration()}getSessionContext(){return this.inner.getSessionContext()}executeTaskSynchronous(t){return()=>navigator.locks.request(this.lockName,{mode:"exclusive"},()=>t()())}};function VA(e){e=$A(e);const t=new Q$(e.hcaEngineBaseUrl),n=new fy,i=new OA,r=new py,o=new A$,a=new DA(n),u=W(e.sessionHandler).with({create:Ee.any,close:Ee.any},l=>l).with({accessToken:Ee.string},l=>new X$(t,o,n,l)).with({sessionCreateUrl:Ee.string,sessionDeleteUrl:Ee.string},l=>new Z$(o,l)).exhaustive(),s=new PA(u,t,n,i,r,a),c=(l,f)=>g(new MA(l,f),d=>new RA(d),d=>new kA(d),UA.new,d=>new BA(d,!1));return new nA(s,c)}const Uf=To.equals;uy.equals;w$.equals;/*! *****************************************************************************
|
|
70
|
+
${JSON.stringify(e,null,2)}`)}var Os=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(Os||{}),Jw=(e=>(e.BooleanAttributeNotFound="BooleanAttributeNotFound",e.ChoiceAttributeNotFound="ChoiceAttributeNotFound",e.ChoiceValueNotFound="ChoiceValueNotFound",e.ConfigurationInitializationFailure="InitializationFailure",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.LegacyConfigurationModelInvalid="DeploymentStore.Core.Store.SnapshotInvalid",e.LegacySnapshotInvalid="SnapshotInvalid",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConflictWithConsequence="ConflictWithConsequence",e.DecisionInvalid="DecisionInvalid",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.NumericAttributeNotFound="NumericAttributeNotFound",e.NumericDecisionOutOfRange="NumericDecisionOutOfRange",e.SessionNotFound="SessionNotFound",e.SetDecisionConflict="SetDecisionConflict",e.Unauthorized="Unauthorized",e.AuthenticationFailure="AuthenticationFailure",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(Jw||{});const Ak=e=>Object.values(Jw).includes(e),$k=e=>Ak(e)?je(e):be;function Ok(e){const t=n=>Y(n).with("ConfigurationModelNotFound",()=>({type:Ce.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:Ce.DecisionsToRespectInvalid})).with(Ve.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:Ce.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:Ce.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:Ce.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:Ce.ConfigurationConflict,reason:Qh.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:Ce.ConfigurationConflict})).with(Ve.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:Ce.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:Ce.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:Ce.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:Ce.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:Ce.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return b(e.type,$k,ee(t))}const Dk=e=>Object.values(Os).includes(e),Nk=e=>Dk(e)?je(e):be;function Pk(e){return b(e,Nk,ee(n=>Y(n).with("Generic::LocalClientError",()=>({type:Ce.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:Ce.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:Ce.CommunicationError})).with("Generic::Unauthorized",()=>({type:Ce.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:Ce.Unknown})).exhaustive()))}function Gr(e,t){Ik(e,t);const n=e.type;return b(be,Gm(()=>Ok(e)),Gm(()=>Pk(n)),st(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:Ce.Unknown})))}let Rk=class{constructor(t,n,r,i){this.engineApiClient=t,this.contractToRestMapper=n,this.restToDomainMapper=r,this.options=i}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t);return b(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),gr(r=>Gr(r,"ClientSideSessionLifetimeHandler - create")),mr(r=>this.restToDomainMapper.mapToSessionId(r)),fk(()=>({type:Ce.ConfigurationUnauthenticated})))}close(t){return b(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),gr(n=>Gr(n,"ClientSideSessionLifetimeHandler - close")),Yt(()=>Ur()))}};var Qw=(e=>(e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e))(Qw||{});function Fr(e,t,n){const r=b(Array.isArray(e)?e:[e],HR);return b(zm(()=>fetch(r,t),i=>({type:"error"})),mr(i=>b(zm(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),_w(i=>i.status===401?Kr({type:Os.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?Va({response:i,data:{}}):i.type==="error"?Kr({type:Os.LowLevelCommunicationError}):Kr({type:Os.UnhandledResponseStatus})),mr(i=>b(n(i),Wh(()=>i.data))))}function Zd(e,t){return Fr(e,t,n=>{if(n.response.status===200)return Ai(n.data);if(n.response.status===409){const r=n.data;return Y(r).with({type:"ConfigurationModelInvalid"},i=>Ai(r)).with({type:"ConfigurationModelNotFeasible"},i=>Ai(r)).otherwise(()=>be)}return be})}let kk=class{constructor(t){this.baseUrl=t}createSessionUsingApiKey(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-API-KEY":n},body:JSON.stringify(t)};return Zd([this.baseUrl,"v2/session"],r)}createSessionUsingJwtBearer(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify(t)};return Zd([this.baseUrl,"v2/session"],r)}setMany(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Fr([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?je(i.data):be)}makeDecision(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Fr([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?je(i.data):be)}getDecisions(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Fr([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?je(r.data):be)}getWhyStateNotPossible(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Fr([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?je(i.data):be)}getWhyNotSatisfied(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Fr([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?je(i.data):be)}getConsequence(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Fr([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?je(r.data):be)}deleteSessionUsingJwtBearer(t,n){const r={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return Fr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?je({}):be)}};var Eo=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Eo||{}),ep=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(ep||{}),tp=(e=>(e.Always="Always",e.Optional="Optional",e))(tp||{}),Ys=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Ys||{}),Yr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Yr||{}),Ln=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(Ln||{}),np=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(np||{}),rp=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(rp||{}),gs=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(gs||{});const qn=gn({localId:pt,componentPath:Su(pt),sharedConfigurationModelId:Jh(pt)});let Zw=class{mapToDecisions(t){return{}}mapToSessionId(t){return Y(t).with({sessionId:Ve.string},n=>Va(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=b(n.constraintExplanations,z(i=>this.mapToConstraintExplanation(i)));return Kr({type:Ce.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Kr({type:Ce.ConfigurationModelInvalid})).otherwise(()=>Kr({type:Ce.Unknown}))}mapToExplainAnswer(t,n){const r=Y(n).with({question:zn.whyIsStateNotPossible,subject:hn.boolean},a=>[{type:Ie.Boolean,attributeId:a.attributeId,value:je(a.state)}]).with({question:zn.whyIsStateNotPossible,subject:hn.numeric},a=>[{type:Ie.Numeric,attributeId:a.attributeId,value:je(a.state)}]).with({question:zn.whyIsStateNotPossible,subject:hn.component},a=>[{type:Ie.Component,attributeId:a.attributeId,state:je(a.state)}]).with({question:zn.whyIsStateNotPossible,subject:hn.choiceValue},a=>[{type:Ie.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:je(a.state)}]).otherwise(()=>[]),i=b(t.decisionExplanations,z(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=b(t.constraintExplanations,z(a=>this.mapToConstraintExplanation(a)));return Y(n).with({answerType:ho.decisions},()=>({decisionExplanations:i})).with({answerType:ho.constraints},()=>({constraintExplanations:o})).with({answerType:ho.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:Ce.ConfigurationSetManyConflict,decisionExplanations:b(t.decisionExplanations,z(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:b(t.constraintExplanations,z(o=>this.mapToConstraintExplanation(o)))}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModel(t,n){const r=this.mapToAttributes(t,n);return{isSatisfied:n.isConfigurationSatisfied??!1,attributes:r}}mapToBooleanDecision(t){return{type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:ye(t.state)}}mapToNumericDecision(t){return{type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:ye(t.state)}}mapToComponentDecision(t){return{type:Ie.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToDecisionState(t.state)}}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModel:t.sharedConfigurationModelId,componentPath:t.componentPath??[]}}mapToChoiceValueDecision(t){return b(this.mapToDecisionState(t.state),ee(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:b(t.causedByRules,z(n=>this.mapToRuleConstraint(n))),causedByCardinalities:b(t.causedByCardinalities,z(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:ya.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:ya.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=b(t.booleanDecisions??[],z(a=>({type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),r=b(t.numericDecisions??[],z(a=>({type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),i=b(t.componentDecisions??[],z(a=>({type:Ie.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:b(ye(a.state),ee(s=>this.mapToDecisionState(s)),Wd)}))),o=b(t.choiceDecisions??[],z(a=>({type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:b(ye(a.state),ee(s=>this.mapToDecisionState(s)),Wd)})));return b([],Pe(n),Pe(r),Pe(i),Pe(o))}mapToDecisionExplanation(t,n,r){const i=b(t.causedByBooleanDecisions,z(h=>this.mapToCausedByBooleanDecision(h))),o=b(t.causedByNumericDecisions,z(h=>this.mapToCausedByNumericDecision(h))),a=b(t.causedByComponentDecisions,z(h=>this.mapToCausedByComponentDecision(h))),s=b(t.causedByChoiceDecisions,z(h=>this.mapToCausedByChoiceValueDecision(h))),u=b(i,z(h=>({type:Ie.Boolean,attributeId:h.attributeId,value:be}))),c=b(o,z(h=>({type:Ie.Numeric,attributeId:h.attributeId,value:be}))),l=b(a,z(h=>({type:Ie.Component,attributeId:h.attributeId,state:be}))),f=b(s,z(h=>({type:Ie.ChoiceValue,attributeId:h.attributeId,choiceValueId:h.choiceValueId,state:be}))),d=b([],Pe(u),Pe(c),Pe(l),Pe(f)),p=Dw(On((h,v)=>{const C=Sn.equals(h.attributeId,v.attributeId);return Y({a:h,b:v}).with({a:{type:Ie.ChoiceValue},b:{type:Ie.ChoiceValue}},E=>C&&E.a.choiceValueId===E.b.choiceValueId).otherwise(()=>C)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:b([],Pe(d),Pe(p)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return Y(t).with(np.NotAvailable,()=>Qd.NotAvailable).with(np.StateNotPossible,()=>Qd.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:Ie.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToAttributes(t,n){function r(d){return b(n.canAttributeContributeToConfigurationSatisfaction,fn(p=>qn.equals(p,d)),ys)}const i=b([],Pe(b(t.choiceValueDecisions,z(d=>d.attributeId))),Pe(b(n.choiceConsequences,z(d=>d.attributeId))),ca(qn)),o=b(i,z(d=>{const p=b(t.choiceValueDecisions??[],gP(v=>qn.equals(v.attributeId,d))),h=b(n.choiceConsequences??[],Ji(v=>qn.equals(v.attributeId,d)));return b(h,ee(v=>this.mapToChoiceAttributes(v,p,r(d))))}),Xn),a=b([],Pe(b(t.numericDecisions,z(d=>d.attributeId))),Pe(b(n.numericConsequences,z(d=>d.attributeId))),ca(qn)),s=b(a,z(d=>{const p=b(t.numericDecisions??[],Ji(v=>qn.equals(v.attributeId,d))),h=b(n.numericConsequences??[],Ji(v=>qn.equals(v.attributeId,d)));return b(h,ee(v=>this.mapToNumericAttribute(v,p,r(d))))}),Xn),u=b([],Pe(b(t.booleanDecisions,z(d=>d.attributeId))),Pe(b(n.booleanConsequences,z(d=>d.attributeId))),ca(qn)),c=b(u,z(d=>{const p=b(t.booleanDecisions??[],Ji(v=>qn.equals(v.attributeId,d))),h=b(n.booleanConsequences??[],Ji(v=>qn.equals(v.attributeId,d)));return b(h,ee(v=>this.mapToBooleanAttribute(v,p,r(d))))}),Xn),l=b([],Pe(b(t.componentDecisions,z(d=>d.attributeId))),Pe(b(n.componentConsequences,z(d=>d.attributeId))),ca(qn)),f=b(l,z(d=>{const p=b(t.componentDecisions??[],Ji(v=>qn.equals(v.attributeId,d))),h=b(n.componentConsequences??[],Ji(v=>qn.equals(v.attributeId,d)));return b(h,ee(v=>this.mapToComponentAttribute(v,p,r(d))))}),Xn);return b([],Pe(o),Pe(f),Pe(s),Pe(c))}mapToComponentAttribute(t,n,r){return{type:lt.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:b(t.possibleDecisionStates,bc(i=>this.mapToPossibleDecisionState(i))),decision:b(n,ir(i=>b(this.mapToDecisionState(i.state),ee(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:b(t.selection,ye,ee(i=>this.mapToSelection(i)),qt),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=b(t.values,bc(o=>{const a=b(n,fn(s=>s.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:lt.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(t,n,r){return{type:lt.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:b(n,ir(i=>b(i.state,ye,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(t,n,r){return{type:lt.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,range:{min:t.range.min,max:t.range.max},selection:this.mapToSelection(t.selection),decimalPlaces:t.decimalPlaces,decision:b(n,ir(i=>b(i.state,ye,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=b(t.possibleDecisionStates,bc(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:b(n,ir(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return Y(t).with(Ys.Implicit,()=>jt.Implicit).with(Ys.Explicit,()=>jt.Explicit).exhaustive()}mapToDecisionState(t){return Y(t).with(Yr.Included,()=>je(Qt.Included)).with(Yr.Excluded,()=>je(Qt.Excluded)).with(Yr.Undefined,()=>be).exhaustive()}mapToPossibleDecisionState(t){return Y(t).with(Eo.Included,()=>Qt.Included).with(Eo.Excluded,()=>Qt.Excluded).exhaustive()}mapToSelection(t){return Y(t).with(ep.Mandatory,()=>Co.Mandatory).with(ep.Optional,()=>Co.Optional).exhaustive()}mapToInclusion(t){return Y(t).with(tp.Always,()=>xo.Always).with(tp.Optional,()=>xo.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},Mk=class{constructor(t,n){this.restToDomainMapper=new Zw,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=Zd(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return b(r,gr(i=>Gr(i,"ServerSideSessionLifetimeHandler - create")),mr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return b(Fr(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===Qw.NoContent?je({}):be),gr(n=>Gr(n,"ServerSideSessionLifetimeHandler - close")),Yt(Ur))}};const e0={whyIsNotSatisfied:{configuration:{question:Lt.whyIsNotSatisfied,subject:et.configuration},attribute:e=>({question:Lt.whyIsNotSatisfied,subject:et.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:Lt.whyIsStateNotPossible,subject:et.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:Lt.whyIsStateNotPossible,subject:et.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:Lt.whyIsStateNotPossible,subject:et.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:Lt.whyIsStateNotPossible,subject:et.component,attributeId:e,state:t})})}};let jk=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=be}setOnConfigurationChangedHandler(t){const n=b(t,ye,ee(r=>i=>{const o=this.domainToContractMapper.mapToConfiguration(i);r(o)}));this.inner.setOnConfigurationChangedHandler(n)}getConfiguration(){const t=this.inner.getConfiguration();return this.domainToContractMapper.mapToConfiguration(t)}getSessionContext(){const t=this.inner.getSessionContext();return this.domainToContractMapper.mapToSessionContext(t)}async setSessionContext(t){const n=this.contractToDomainMapper.mapToSessionContext(t);return await b(this.inner.setSessionContext(n),Yt(Ur),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await b(this.inner.restoreConfiguration(n),Yt(Ur),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await b(this.inner.makeDecision(n),Yt(Ur),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await b(this.inner.setMany(r,i),Yt(Ur),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await b(this.inner.applySolution(n),Yt(Ur),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(e0):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await b(this.inner.explain(i),Yt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await b(this.inner.close(),gr(t=>this.domainToContractMapper.mapToFailureResult(t)),Kc(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return sr(gr(t=>this.domainToContractMapper.mapToFailureResult(t)),Kc(t=>Promise.reject(t),t=>Promise.resolve(t)))}},_k=class{mapToExplainQuestion(t,n){const r={answerType:Y(n).with("decisions",()=>ho.decisions).with("constraints",()=>ho.constraints).with("full",()=>ho.all).exhaustive()};return Y(t).with({question:Lt.whyIsNotSatisfied,subject:et.configuration},i=>({...r,question:zn.whyIsNotSatisfied,subject:hn.configuration})).with({question:Lt.whyIsNotSatisfied,subject:et.attribute},i=>({...r,question:zn.whyIsNotSatisfied,subject:hn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:Lt.whyIsStateNotPossible,subject:et.choiceValue},i=>({...r,question:zn.whyIsStateNotPossible,subject:hn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:Lt.whyIsStateNotPossible,subject:et.component},i=>({...r,question:zn.whyIsStateNotPossible,subject:hn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:Lt.whyIsStateNotPossible,subject:et.numeric},i=>({...r,question:zn.whyIsStateNotPossible,subject:hn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:Lt.whyIsStateNotPossible,subject:et.boolean},i=>({...r,question:zn.whyIsStateNotPossible,subject:hn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:b(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return b(t,z(n=>this.mapToAttributeDecision(n)))}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),decisionsToRespect:this.mapToDecisionsToRespect(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToAttributeDecision(t){return Y(t).with({type:W.Choice,choiceValueId:Ve.string},n=>({type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:W.Numeric},n=>({type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:W.Boolean},n=>({type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:W.Component},n=>({type:Ie.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:b(ye(n.state),ir(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return b(ye(t),ee(n=>b(n,z(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:b(r.decisions,z(i=>this.mapToGlobalAttributeId(i)))})))))}mapToMode(t){return Y(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).exhaustive()}mapToConflictHandling(t){return Y(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath??[],sharedConfigurationModel:t.sharedConfigurationModelId}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return Y(t).with({type:Mi.Package},n=>({type:Ks.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Mi.Channel},n=>({type:Ks.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:b(t.decisions,z(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return Y(t).with({type:W.Boolean},n=>({type:lt.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:b(n.decision,ye,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.Numeric},n=>({type:lt.Numeric,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,range:{min:n.range.min,max:n.range.max},decimalPlaces:n.decimalPlaces,selection:this.mapToSelection(n.selection),decision:b(n.decision,ye,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.Choice},n=>({type:lt.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:b(n.values,z(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.Component},n=>({type:lt.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:b(n.decision,ye,ir(r=>b(this.mapToDecisionStateOption(r.state),ee(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:b(n.possibleDecisionStates,z(r=>this.mapToDecisionStateOption(r)),Xn),selection:b(n.selection,ye,ee(r=>this.mapToSelection(r)),qt),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:b(t.possibleDecisionStates,z(n=>this.mapToDecisionStateOption(n)),Xn)}}mapToChoiceValueDecision(t){return b(t.decision,ye,ir(n=>b(this.mapToDecisionStateOption(n.state),ee(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return Y(t).with(Oe.Implicit,()=>jt.Implicit).with(Oe.Explicit,()=>jt.Explicit).exhaustive()}mapToSelection(t){return Y(t).with($i.Mandatory,()=>Co.Mandatory).with($i.Optional,()=>Co.Optional).exhaustive()}mapToInclusion(t){return Y(t).with(wa.Always,()=>xo.Always).with(wa.Optional,()=>xo.Optional).exhaustive()}mapToDecisionState(t){return Y(t).with(Ve.union(xt.Included,ut.Included),()=>Qt.Included).with(Ve.union(xt.Excluded,ut.Excluded),()=>Qt.Excluded).exhaustive()}mapToDecisionStateOption(t){return b(ye(t),ee(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return b(t,ye,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return b(t,ye,ee(n=>Y(n).returnType().with({type:pn.all},()=>({type:vo.all})).with({type:pn.none},()=>({type:vo.none})).with({type:pn.specific},r=>({type:vo.specific,rules:b(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()))}},t0=class{mapToExplainAnswer(t){const n=Y(t).with({decisionExplanations:Ve.array(Ve.any)},i=>b(i.decisionExplanations,z(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=Y(t).with({constraintExplanations:Ve.array(Ve.any)},i=>b(i.constraintExplanations,z(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:b(t.causedByCardinalities,z(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:b(t.causedByRules,z(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=b(t.causedByChoiceDecisions,z(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=b(t.causedByComponentDecisions,z(a=>this.mapToCausedByComponentAttributeDecision(a))),i=b(t.causedByNumericDecisions,z(a=>this.mapToCausedByNumericAttributeDecision(a))),o=b(t.causedByBooleanDecisions,z(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:b([],Pe(n),Pe(r),Pe(i),Pe(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:b(t.decisions,z(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return Y(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return Y(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToDecisionsToRespect(t.decisionsToRespect),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToFailureResult(t){return Y(t).with({type:Ce.ConfigurationConflict},n=>({type:St.ConfigurationConflict,reason:Y(n.reason).with(Qh.NumericDecisionOutOfRange,()=>Xw.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:Ce.ConfigurationApplicationError},()=>({type:St.ConfigurationApplicationError})).with({type:Ce.ConfigurationUnauthenticated},()=>({type:St.ConfigurationUnauthenticated})).with({type:Ce.ConfigurationModelNotFound},()=>({type:St.ConfigurationModelNotFound})).with({type:Ce.ConfigurationTimeout},()=>({type:St.ConfigurationTimeout})).with({type:Ce.ConfigurationAttributeNotFound},()=>({type:St.ConfigurationAttributeNotFound})).with({type:Ce.ConfigurationChoiceValueNotFound},()=>({type:St.ConfigurationChoiceValueNotFound})).with({type:Ce.ConfigurationSolutionNotAvailable},()=>({type:St.ConfigurationSolutionNotAvailable})).with({type:Ce.ConfigurationRejectedDecisionsConflict},n=>{const r=b(n.rejectedDecisions,z(i=>this.mapToExplicitDecision(i)));return ck.createConfigurationRejectedDecisionsConflict(r)}).with({type:Ce.DecisionsToRespectInvalid},()=>({type:St.DecisionsToRespectInvalid})).with({type:Ce.ServiceError},()=>({type:St.ServiceError})).with({type:Ce.CommunicationError},()=>({type:St.CommunicationError})).with({type:Ce.Unknown},()=>({type:St.Unknown})).with({type:Ce.ConfigurationModelInvalid},()=>({type:St.ConfigurationModelInvalid})).with({type:Ce.ConfigurationInitializationFailure},()=>({type:St.ConfigurationInitializationFailure})).with({type:Ce.ConfigurationModelNotFeasible},n=>({type:St.ConfigurationModelNotFeasible,constraintExplanations:b(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:Ce.ConfigurationSetManyConflict},n=>({type:St.ConfigurationSetManyConflict,decisionExplanations:b(n.decisionExplanations,z(r=>this.mapToDecisionExplanation(r))),constraintExplanations:b(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:Ce.SpecifiedDeploymentForbidden},n=>({type:St.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:b(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return b(t,ee(sr(z(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:b(n.decisions,z(r=>this.mapToGlobalAttributeId(r)))})))),nr)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return Y(t).with({type:Ks.Package},n=>({type:Mi.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Ks.Channel},n=>({type:Mi.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return Y(t).with({type:Ie.ChoiceValue},n=>({type:W.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:b(n.state,ee(r=>this.mapToChoiceValueDecisionState(r)),qt),choiceValueId:n.choiceValueId})).with({type:Ie.Component},n=>({type:W.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:b(n.state,ee(r=>this.mapToComponentDecisionState(r)),qt)})).with({type:Ie.Numeric},n=>({type:W.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:b(n.value,qt)})).with({type:Ie.Boolean},n=>({type:W.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:b(n.value,qt)})).exhaustive()}mapToCardinality(t){return Y(t).with(ya.Cardinality,()=>wc.Cardinality).with(ya.Component,()=>wc.Component).with(ya.Rule,()=>wc.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return Y(t).with({type:Ie.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:Ie.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:Ie.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:Ie.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:W.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:W.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:W.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:W.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return Y(t).with(Co.Mandatory,()=>$i.Mandatory).with(Co.Optional,()=>$i.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return Y(t).with({type:lt.Boolean},r=>({...n,type:W.Boolean,decision:b(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),nr),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:lt.Numeric},r=>({...n,type:W.Numeric,decision:b(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),nr),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:lt.Choice},r=>({...n,type:W.Choice,cardinality:r.cardinality,values:b(r.values,z(i=>{const o=b(i.decision,ee(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),nr);return{id:i.choiceValueId,possibleDecisionStates:b(i.possibleDecisionStates,z(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:lt.Component},r=>({...n,type:W.Component,decision:b(r.decision,ee(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),nr),possibleDecisionStates:b(r.possibleDecisionStates,z(i=>this.mapToComponentDecisionState(i))),selection:b(r.selection,ye,ee(i=>this.mapToSelection(i)),qt),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return Y(t).with(xo.Always,()=>wa.Always).with(xo.Optional,()=>wa.Optional).exhaustive()}mapToComponentDecisionState(t){return Y(t).with(Qt.Included,()=>ut.Included).with(Qt.Excluded,()=>ut.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return Y(t).with(Qt.Included,()=>xt.Included).with(Qt.Excluded,()=>xt.Excluded).exhaustive()}mapToDecisionKind(t){return Y(t).with(jt.Explicit,()=>Oe.Explicit).with(jt.Implicit,()=>Oe.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return b(t,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),nr)}mapToAllowedRulesInExplain(t){return b(t,ee(n=>Y(n).returnType().with({type:vo.all},()=>({type:pn.all})).with({type:vo.none},()=>({type:pn.none})).with({type:vo.specific},r=>({type:pn.specific,rules:b(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()),nr)}},qk=class{constructor(t,n){this.contractToDomainMapper=new _k,this.domainToContractMapper=new t0,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await b(this.sessionHandler.recreate(n),Yt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new jk(i,this.contractToDomainMapper,this.domainToContractMapper)}),Kc(r=>{const i=this.domainToContractMapper.mapToFailureResult(r);return Promise.reject(i)},r=>Promise.resolve(r)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:be,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function n0(e){return e.possibleDecisionStates.some(t=>t===xt.Included)}function Fk(e){return!n0(e)}function Lk(e){return Y(e).with({type:W.Choice},t=>t.cardinality.lowerBound>0).with({type:W.Boolean},t=>t.selection===$i.Mandatory).with({type:W.Numeric},t=>t.selection===$i.Mandatory).with({type:W.Component},t=>t.inclusion===wa.Optional&&t.selection===$i.Mandatory).exhaustive()}function Bk(e){return Y(e).with({type:W.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function Vk(e){return b(e.values,Jt(n0))}function Uk(e){return b(e.values,Jt(Fk))}function r0(e,t){return b(e.values,jo(n=>b(n.decision,ye,Ht(r=>r.kind===t))))}function i0(e){return b(e.values,Jt(t=>b(t.decision,ye,ee(n=>n.state===xt.Included),st(()=>!1))))}const Gk=i0;function o0(e){return b(e.decision,ye,Ht(t=>t.kind===Oe.Explicit),nr)}function a0(e){return b(e.decision,ye,Ht(t=>t.kind===Oe.Explicit),nr)}function zk(e,t){return e.possibleDecisionStates.some(n=>n===t)}function s0(e){return b(e.decision,ye,nr)}function u0(e){return c0(e,ut.Included)}function Wk(e){return!u0(e)}function c0(e,t){return e.possibleDecisionStates.some(n=>n===t)}const An=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:Vk,getBlockedChoiceValues:Uk,getBooleanDecision:a0,getChoiceDecisions:r0,getComponentDecision:s0,getIncludedChoiceValues:i0,getNumericDecision:o0,getSelectedChoiceValues:Gk,isBooleanValuePossible:zk,isComponentAllowed:u0,isComponentBlocked:Wk,isComponentStatePossible:c0,isMandatory:Lk,isMultiSelect:Bk},Symbol.toStringTag,{value:"Module"})),l0=e=>e.type===W.Boolean,f0=e=>e.type===W.Choice,d0=e=>e.type===W.Numeric,p0=e=>e.type===W.Component,Hk=Su(pt);function Kk(e,t,n){var r;const i=((r=t.componentPath)==null?void 0:r.length)??0;return b(e,Jt(o=>{var a;const s=((a=o.id.componentPath)==null?void 0:a.length)??0;return n?i>s?!1:b(o.id.componentPath??[],Ow(t.componentPath??[]),dP(([u,c])=>u===c)):Hk.equals(o.id.componentPath,t.componentPath)}))}function Yk(e,t,n){return[]}function Xk(e){return b(e,Jt(t=>{const n=b(t.id.componentPath,ye,ee(i=>i.length===0),st(()=>!0)),r=b(t.id.sharedConfigurationModelId,ye,ti(()=>!0,()=>!1));return n&&r}))}function Jk(e,t){return b(h0(e),z(n=>r0(n,t)),Vh,jo(n=>ye(n)))}function Qk(e,t){return b(m0(e),Jt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>o0(n)),jo(n=>ye(n)))}function Zk(e,t){return b(y0(e),Jt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>a0(n)),jo(n=>ye(n)))}function eM(e,t){return b(v0(e),Jt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>s0(n)),jo(n=>ye(n)))}function h0(e){return b(e.attributes,Jt(f0))}function v0(e){return b(e.attributes,Jt(p0))}function m0(e){return b(e.attributes,Jt(d0))}function y0(e){return b(e.attributes,Jt(l0))}function tM(e,t){return b(wu(e,t),qt)}function nM(e,t){return b(g0(e,t),qt)}function rM(e,t,n){return b(g0(e,t),ee(r=>r.values),ir(sr(fn(r=>r.id===n))),qt)}function iM(e,t){return b(wu(e,t),Ht(d0),qt)}function oM(e,t){return b(wu(e,t),Ht(l0),qt)}function aM(e,t){return b(wu(e,t),Ht(p0),qt)}function wu(e,t){return b(e.attributes,fn(n=>Ga.equals(n.id,t)))}function g0(e,t){return b(wu(e,t),Ht(f0))}const za=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:Kk,filterAttributesOfRoot:Xk,filterAttributesOfShared:Yk,getAttribute:tM,getBooleanAttribute:oM,getBooleanAttributes:y0,getBooleanDecisions:Zk,getChoiceAttribute:nM,getChoiceAttributes:h0,getChoiceDecisions:Jk,getChoiceValue:rM,getComponentAttribute:aM,getComponentAttributes:v0,getComponentDecisions:eM,getNumericAttribute:iM,getNumericAttributes:m0,getNumericDecisions:Qk},Symbol.toStringTag,{value:"Module"})),sM="https://spc.cloud.ceventis.de/api/engine",uM={hcaEngineBaseUrl:sM};function cM(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??uM.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function ss(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const b0=e=>t=>n=>b(n,nP(r=>e.equals(r,t)),ee(r=>b(n,rP(r,i=>t))),Wd,st(()=>b(n,Pe(uP(t))))),Uu=b0({equals:(e,t)=>Sn.equals(e.attributeId,t.attributeId)}),lM=b0({equals:(e,t)=>e.choiceValueId===t.choiceValueId});class fM{constructor(t){this.restToDomainMapper=t}updateConfigurationSession(t,n){const r=this.updateConfiguration(t.configuration,n);return{...t,configuration:r}}updateConfiguration(t,n){var r,i,o,a,s,u,c,l,f,d;const p=b(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],z(this.restToDomainMapper.mapToGlobalAttributeId)),h=I=>Bh(Sn)(I,p),v=b(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=b(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=b(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),y=b(((s=n.consequences)==null?void 0:s.componentConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),w=b(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=b(((c=n.consequences)==null?void 0:c.numericConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),S=b(((l=n.affectedDecisions)==null?void 0:l.booleanDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=b(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=b([],Pe(b(S,z(I=>I.attributeId))),Pe(b(T,z(I=>I.attributeId))),Pe(b(w,z(I=>I.attributeId))),Pe(b(x,z(I=>I.attributeId))),Pe(b(v,z(I=>I.attributeId))),Pe(b(C,z(I=>I.attributeId))),Pe(b(E,z(I=>I.attributeId))),Pe(b(y,z(I=>I.attributeId))),ca(Sn)),D=b(A,Gd(t.attributes,(I,N)=>{const j=t.attributes.find(L=>Sn.equals(L.attributeId,N));return Y(j).with({type:lt.Choice},(L,V)=>{const H=this.mergeChoice(V,b(C,fn(R=>Sn.equals(R.attributeId,N)),ee(R=>R.payload)),b(v,Jt(R=>Sn.equals(R.attributeId,N)),z(R=>R.payload)));return Uu(H)(I)}).with({type:lt.Numeric},(L,V)=>{const H=this.mergeNumeric(V,b(x,fn(R=>Sn.equals(R.attributeId,N)),ee(R=>R.payload)),b(w,fn(R=>Sn.equals(R.attributeId,N)),ee(R=>R.payload)));return Uu(H)(I)}).with({type:lt.Boolean},(L,V)=>{const H=this.mergeBoolean(V,b(T,fn(R=>Sn.equals(R.attributeId,N)),ee(R=>R.payload)),b(S,fn(R=>Sn.equals(R.attributeId,N)),ee(R=>R.payload)));return Uu(H)(I)}).with({type:lt.Component},(L,V)=>{const H=this.mergeComponent(V,b(y,fn(R=>Sn.equals(R.attributeId,N)),ee(R=>R.payload)),b(E,fn(R=>Sn.equals(R.attributeId,N)),ee(R=>R.payload)));return Uu(H)(I)}).exhaustive()}),z(I=>{const N=h(I.attributeId);return I.canContributeToConfigurationSatisfaction!=N?{...I,canContributeToConfigurationSatisfaction:N}:I}));return{...t,isSatisfied:b((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,ye,st(()=>t.isSatisfied)),attributes:D}}mergeChoice(t,n,r){const i=b(n,ee(u=>u.values??[]),st(()=>[])),o=b(r),a=b([],Pe(b(i,z(u=>u.choiceValueId))),Pe(b(o,z(u=>u.choiceValueId))),z(ss),ca(pt)),s=b(a,Gd(t.values,(u,c)=>{const l=b(i,fn(h=>h.choiceValueId===c)),f=b(o,fn(h=>h.choiceValueId===c)),d=b(t.values.find(h=>h.choiceValueId===c),ye),p=this.mergeChoiceValue(c,d,l,f);return lM(p)(u)}));return{...t,isSatisfied:b(n,ee(u=>ss(u.isSatisfied)),st(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=b(i,ee(s=>({state:this.toDecisionState(ss(s.state)),kind:this.toDecisionKind(ss(s.kind))})),st(()=>({state:b(n,ir(s=>b(s.decision,ee(u=>u.state)))),kind:b(n,ir(s=>b(s.decision,ee(u=>u.kind))),st(()=>jt.Explicit))}))),a=b(r,ee(s=>b(Um(s.possibleDecisionStates??[]),z(u=>this.toPossibleDecisionState(u)),Xn)),st(()=>b(n,ee(s=>s.possibleDecisionStates??[]),st(()=>[]))));return{choiceValueId:t,decision:b(o.state,ee(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=b(r,ee(a=>{const s=this.toDecisionState(ss(a.state));return b(s,ee(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),st(()=>b(t.decision,ee(a=>({state:a.state,kind:a.kind}))))),o=b(n,ee(a=>b(Um(a.possibleDecisionStates??[]),z(s=>this.toPossibleDecisionState(s)),Xn)),st(()=>t.possibleDecisionStates));return{...t,isSatisfied:b(n,ee(a=>a.isSatisfied),st(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:b(n,ir(i=>ye(i.isSatisfied)),st(()=>t.isSatisfied)),decision:b(r,ti(()=>t.decision,i=>b(i.state,ye,ee(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:b(n,ir(i=>ye(i.isSatisfied)),st(()=>t.isSatisfied)),decision:b(r,ti(()=>t.decision,i=>b(i.state,ye,ee(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:b(n,ee(i=>i.possibleDecisionStates),st(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return Y(t).with(Eo.Included,()=>je(Qt.Included)).with(Eo.Excluded,()=>je(Qt.Excluded)).otherwise(()=>be)}toDecisionState(t){return Y(t).with(Yr.Included,()=>je(Qt.Included)).with(Yr.Excluded,()=>je(Qt.Excluded)).otherwise(()=>be)}toDecisionKind(t){return Y(t).with(Ys.Implicit,()=>jt.Implicit).with(Ys.Explicit,()=>jt.Explicit).exhaustive()}}class dM{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return Y(t).with({type:Ie.ChoiceValue},n=>({type:Ln.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ie.Component},n=>({type:Ln.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ie.Numeric},n=>({type:Ln.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:b(n.value,qt)})).with({type:Ie.Boolean},n=>({type:Ln.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:b(n.value,qt)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=b([...t],pi(u=>u.type!==Ie.Boolean?be:je({type:Ln.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:b(u.value,qt)}))),o=b([...t],pi(u=>u.type!==Ie.Numeric?be:je({type:Ln.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:b(u.value,qt)}))),a=b([...t],pi(u=>u.type!==Ie.ChoiceValue?be:je({type:Ln.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=b([...t],pi(u=>u.type!==Ie.Component?be:je({type:Ln.Component,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:this.mapToDecisionState(u.state)})));return{mode:r,choiceDecisions:a,numericDecisions:o,booleanDecisions:i,componentDecisions:s}}mapToExplicitDecisionsInner(t){const n=b([...t],pi(a=>a.type!==lt.Boolean?be:b(a.decision,Ht(s=>s.kind===jt.Explicit),ee(()=>this.mapToExplicitBooleanDecision(a))))),r=b([...t],pi(a=>a.type!==lt.Numeric?be:b(a.decision,Ht(s=>s.kind===jt.Explicit),ee(()=>this.mapToExplicitNumericDecision(a))))),i=b([...t],pi(a=>a.type!==lt.Component?be:b(a.decision,Ht(s=>s.kind===jt.Explicit),ee(()=>this.mapToExplicitComponentDecision(a))))),o=b([...t],pi(a=>a.type!==lt.Choice?be:b(this.mapToExplicitChoiceDecisions(a),bu(s=>b(s,Mo)))),mP);return{booleanDecisions:n,numericDecisions:r,choiceDecisions:o,componentDecisions:i}}mapToMode(t){return Y(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>this.mapToDropExistingDecisionsMode(n)).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:b(t.componentPath,ye,ee(zd),nr),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:Y(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:Ve.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:Ln.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:b(t.decision,ee(n=>n.state),qt)}}mapToExplicitNumericDecision(t){return{type:Ln.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:b(t.decision,ee(n=>n.state),qt)}}mapToExplicitComponentDecision(t){return{type:Ln.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(b(t.decision,ee(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return b(r.decision,ee(i=>i.kind===jt.Explicit),st(()=>!1))}return b(t.values,Jt(n),z(r=>({type:Ln.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(b(r.decision,ee(i=>i.state)))})),zd)}mapToDecisionState(t){return b(t,ee(n=>Y(n).with(Qt.Included,()=>Yr.Included).with(Qt.Excluded,()=>Yr.Excluded).exhaustive()),st(()=>Yr.Undefined))}mapToPossibleDecisionState(t){return Y(t).with(Qt.Included,()=>Eo.Included).with(Qt.Excluded,()=>Eo.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return Y(t).with({subject:hn.attribute},n=>({type:rp.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:hn.configuration},()=>({type:rp.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return Y(t).with({subject:hn.boolean},n=>({type:gs.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.numeric},n=>({type:gs.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.component},n=>({type:gs.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:hn.choiceValue},n=>({type:gs.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}}class pM{constructor(){this.configurationSession={hasExplicitDecisions(t){return b(t.configuration.attributes,fn(n=>Y(n).with({type:lt.Boolean},r=>b(r.decision,Ht(i=>i.kind===jt.Explicit),ys)).with({type:lt.Numeric},r=>b(r.decision,Ht(i=>i.kind===jt.Explicit),ys)).with({type:lt.Choice},r=>b(r.values,fn(i=>b(i.decision,ee(o=>o.kind===jt.Explicit),st(()=>!1))),ys)).with({type:lt.Component},r=>b(r.decision,Ht(i=>i.kind===jt.Explicit),ys)).exhaustive()),ti(()=>!1,()=>!0))},getExplicitDecisions(t){return b(t.configuration.attributes,z(n=>Y(n).with({type:lt.Boolean},r=>b(r.decision,Ht(i=>i.kind===jt.Explicit),ee(i=>({type:Ie.Boolean,attributeId:r.attributeId,value:ye(i.state)})),ee(i=>[i]))).with({type:lt.Numeric},r=>b(r.decision,Ht(i=>i.kind===jt.Explicit),ee(i=>({type:Ie.Numeric,attributeId:r.attributeId,value:ye(i.state)})),ee(i=>[i]))).with({type:lt.Choice},r=>b(r.values,z(i=>b(i.decision,Ht(o=>o.kind===jt.Explicit),ee(o=>({type:Ie.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:ye(o.state)})))),Xn,Ai)).with({type:lt.Component},r=>b(r.decision,Ht(i=>i.kind===jt.Explicit),ee(i=>({type:Ie.Component,attributeId:r.attributeId,state:ye(i.state)})),ee(i=>[i]))).exhaustive()),Xn,Vh)}}}}class hM{constructor(t,n,r,i,o,a){this.engineApiClient=n,this.domainToRestMapper=i,this.restToDomainMapper=r,this.domainToContractMapper=o,this.domainUpdater=a,this.sessionHandler=t,this.interpreter=new pM}close(t){return this.sessionHandler.close(t)}recreate(t){return this.initializeInner(t,!1)}reinitialize(t){return this.initializeInner(t,!0)}makeDecision(t,n){const r=this.domainToRestMapper.mapToExplicitDecision(t);return this.withSession(n,(i,o)=>b(this.engineApiClient.makeDecision(i,r),gr(Gr),Yt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=Y(t).with({question:zn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:zn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return b(i,gr(Gr),Yt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return b(a,mr(s=>{var u,c,l,f;const d=b([],Pe(b(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],z(p=>this.restToDomainMapper.mapToBooleanDecision(p)))),Pe(b(((c=s.rejectedDecisions)==null?void 0:c.numericDecisions)??[],z(p=>this.restToDomainMapper.mapToNumericDecision(p)))),Pe(b(((l=s.rejectedDecisions)==null?void 0:l.componentDecisions)??[],z(p=>this.restToDomainMapper.mapToComponentDecision(p)))),Pe(b(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],z(p=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(p)))));return b(d,Mo)?Kr(Tk.createConfigurationRejectedDecisionsConflict(d)):la(this.domainUpdater.updateConfigurationSession(o,s))}))})}replaceDecisions(t,n){const r=this.interpreter.configurationSession.getExplicitDecisions(n),i=this.setManyInner(r,{type:"DropExistingDecisions",conflictHandling:{type:"Automatic"}},t);return b(i,Yt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return b(o,gr(Gr),mr(a=>{const s={rejectedDecisions:{booleanDecisions:Ve.array(Ve.any)}},u={decisionExplanations:Ve.array(Ve.any)};return Y(a).with(s,c=>Va(c)).with(u,c=>Kr(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(c,i,n))).otherwise(()=>Kr({type:Ce.Unknown}))}))}explainWhyStateNotPossible(t,n){const r=this.domainToRestMapper.mapToWhyStateNotPossibleRequest(t);return this.engineApiClient.getWhyStateNotPossible(n,r)}explainWhyNotSatisfied(t,n){const r=this.domainToRestMapper.mapToWhyNotSatisfiedRequest(t);return this.engineApiClient.getWhyNotSatisfied(n,r)}withSession(t,n){return b(la(t),mr(r=>b(r.sessionId,ti(()=>this.initializeInner(r,!1),()=>la(r)))),mr(r=>b(r.sessionId,Wh(()=>({type:Ce.ConfigurationUnauthenticated})),mr(i=>n(i,r)))))}initializeInner(t,n){return b(HP,()=>b(t.sessionId,rR,oR(s=>n?nR(s):b(this.sessionHandler.close(s),Kc(()=>be,()=>be)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return b(s,BP(()=>({type:Ce.ConfigurationUnauthenticated})),_w(()=>this.sessionHandler.create(u)))},s=>b(s,KP(u=>b(Ai(t),Ht(this.interpreter.configurationSession.hasExplicitDecisions),ee(c=>this.replaceDecisions(u,c)),st(()=>la({}))))),s=>b(s,mr(u=>{const c=this.determineConsequences(u),l=this.determineDecisions(u),f=mN(GP)({consequences:c,decisions:l});return b(f,Yt(({decisions:d,consequences:p})=>this.restToDomainMapper.mapToConfigurationModel(d,p)),Yt(d=>({sessionId:Ai(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return b(this.engineApiClient.getDecisions(t),gr(Gr))}determineConsequences(t){return b(this.engineApiClient.getConsequence(t),gr(Gr))}}let vM=class{constructor(t,n){this.onConfigurationChangedHandler=be,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return b(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return b(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:be}}restoreConfiguration(t){return b(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return b(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return b(this.configurationSession.sessionId,ee(t=>this.sessionHandler.close(t)),ee(sr(Yt(t=>{this.configurationSession={...this.configurationSession,sessionId:be}}))),st(Ul(dk())))}applySolution(t){return b(this.configurationSession.solutions,fn(n=>xk.equals(n,t)),Wh(()=>({type:Ce.ConfigurationSolutionNotAvailable})),Yt(n=>n.decisions),mr(n=>this.setMany(n,t.mode)))}setMany(t,n){return b(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),Yc(r=>()=>{const i=Y(r).with({decisionExplanations:Ve.array(Ve.any)},o=>je(o.decisionExplanations)).otherwise(()=>be);this.configurationSession={...this.configurationSession,solutions:b(i,ee(sr(z(o=>o.solution))),st(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=Y(t).with({decisionExplanations:Ve.array(Ve.any)},r=>r.decisionExplanations).otherwise(()=>[]);return b(n,z(r=>r.solution))}invalidateAvailableSolutions(){return XP(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Yc(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Gs(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return sr(Gs(t=>()=>{this.configurationSession=t,b(this.onConfigurationChangedHandler,QP(n=>()=>n(this.configurationSession.configuration)))}),Yt(t=>t.configuration),this.invalidateAvailableSolutions())}};class mM{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=XR(r,KR.concat(JR(i),YR(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Wo(this.policy,n,r=>b(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Wo(this.policy,n,r=>b(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Wo(this.policy,n,r=>b(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Wo(this.policy,n,r=>b(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Wo(this.policy,n,r=>b(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Wo(this.policy,r,i=>b(i,ro(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return Y(t).with({type:Ce.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:Ce.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}}class yM{constructor(){this.queue=[],this.operating=be}push(t){const n=new gM(t);return this.queue.push(n),this.operating=b(this.operating,st(()=>this.start()),Ai),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=b(t,z(r=>r.argument),Gd(be,(r,i)=>this.reduce(r,i)),ee(sr(r=>this.execute(r),r=>r.then(i=>{b(t,z(o=>{o.resolve(i)}))}).catch(i=>{b(t,z(o=>{o.reject(i)}))}))),qt);n&&await n}this.operating=be}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}}class gM{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}}class bM extends yM{constructor(t){super(),this.inner=t}reduce(t,n){return je(n)}async execute(t){return await this.inner.setSessionContext(t)()}}class SM{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new bM(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(mk.equals(n,t))return Va(this.getConfiguration());const r=this.setContextReducingTaskExecutor.push(t);return()=>r}applySolution(t){return this.inner.applySolution(t)}close(){return this.inner.close()}makeDecision(t){return this.inner.makeDecision(t)}restoreConfiguration(t){return this.inner.restoreConfiguration(t)}setMany(t,n){return this.inner.setMany(t,n)}explain(t){return this.inner.explain(t)}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}}class wM{constructor(t,n=!1){this.stringify=n,this.inner=t,this.durationNumberFormat=new Intl.NumberFormat("en-EN",{maximumFractionDigits:3})}withLogging(t,n,r){const i=performance.now(),o=()=>{const a=performance.now()-i;return this.durationNumberFormat.format(a)};return console.debug(`Operation ${t} started with`,this.renderAsRequired(n)),b(r(),Yc(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Gs(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with success`,this.renderAsRequired(a))}))}renderAsRequired(t){return this.stringify?JSON.stringify(t,null,2):t}explain(t){return this.withLogging("explain",[t],()=>this.inner.explain(t))}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){return this.withLogging("setSessionContext",[t],()=>this.inner.setSessionContext(t))}applySolution(t){return this.withLogging("applySolution",[t],()=>this.inner.applySolution(t))}close(){return this.inner.close()}makeDecision(t){return this.withLogging("makeDecision",[t],()=>this.inner.makeDecision(t))}restoreConfiguration(t){return this.withLogging("restoreConfiguration",[t],()=>this.inner.restoreConfiguration(t))}setMany(t,n){return this.withLogging("setMany",[t,n],()=>this.inner.setMany(t,n))}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}}let CM=class S0{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+Xh()}static new(t){return new S0(t)}close(){return this.executeTaskSynchronous(()=>this.inner.close())}restoreConfiguration(t){return this.executeTaskSynchronous(()=>this.inner.restoreConfiguration(t))}setSessionContext(t){return this.executeTaskSynchronous(()=>this.inner.setSessionContext(t))}invalidateSessionId(){return this.inner.invalidateSessionId()}makeDecision(t){return this.executeTaskSynchronous(()=>this.inner.makeDecision(t))}applySolution(t){return this.executeTaskSynchronous(()=>this.inner.applySolution(t))}setMany(t,n){return this.executeTaskSynchronous(()=>this.inner.setMany(t,n))}explain(t){return this.executeTaskSynchronous(()=>this.inner.explain(t))}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}getConfiguration(){return this.inner.getConfiguration()}getSessionContext(){return this.inner.getSessionContext()}executeTaskSynchronous(t){return()=>navigator.locks.request(this.lockName,{mode:"exclusive"},()=>t()())}};function xM(e){e=cM(e);const t=new kk(e.hcaEngineBaseUrl),n=new Zw,r=new dM,i=new t0,o=new lk,a=new fM(n),s=Y(e.sessionHandler).with({create:Ve.any,close:Ve.any},l=>l).with({accessToken:Ve.string},l=>new Rk(t,o,n,l)).with({sessionCreateUrl:Ve.string,sessionDeleteUrl:Ve.string},l=>new Mk(o,l)).exhaustive(),u=new hM(s,t,n,r,i,a),c=(l,f)=>b(new vM(l,f),d=>new mM(d),d=>new SM(d),CM.new,d=>new wM(d,!1));return new qk(u,c)}const EM=Ga.equals,TM=Yw.equals;ik.equals;function Zl(e){return On((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}/*! *****************************************************************************
|
|
71
71
|
Copyright (c) Microsoft Corporation.
|
|
72
72
|
|
|
73
73
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -80,12 +80,12 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
80
80
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
81
81
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
82
82
|
PERFORMANCE OF THIS SOFTWARE.
|
|
83
|
-
***************************************************************************** */var z=function(){return z=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},z.apply(this,arguments)};function $d(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}function Ie(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function $e(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}function Je(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var He;(function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"})(He||(He={}));var wr;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(wr||(wr={}));var ul=He.Start,Ad=He.Stop,qa=He.Raise,Eu=He.Send,My=He.Cancel,FA=He.NullEvent,Dd=He.Assign;He.After;He.DoneState;var Ry=He.Log,LA=He.Init,cl=He.Invoke;He.ErrorExecution;var Vf=He.ErrorPlatform,GA=He.ErrorCustom,_y=He.Update,zA=He.Choose,WA=He.Pure,jy=".",Ff={},ll="xstate.guard",HA="",st=process.env.NODE_ENV==="production",Qa;function Od(e,t,n){n===void 0&&(n=jy);var i=aa(e,n),r=aa(t,n);return De(r)?De(i)?r===i:!1:De(i)?i in r:Object.keys(i).every(function(o){return o in r?Od(i[o],r[o]):!1})}function qy(e){try{return De(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function dl(e,t){try{return Eo(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function KA(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function aa(e,t){if(KA(e))return e.value;if(Eo(e))return Vs(e);if(typeof e!="string")return e;var n=dl(e,t);return Vs(n)}function Vs(e){if(e.length===1)return e[0];for(var t={},n=t,i=0;i<e.length-1;i++)i===e.length-2?n[e[i]]=e[i+1]:(n[e[i]]={},n=n[e[i]]);return t}function Yo(e,t){for(var n={},i=Object.keys(e),r=0;r<i.length;r++){var o=i[r];n[o]=t(e[o],o,e,r)}return n}function Lf(e,t,n){var i,r,o={};try{for(var a=Ie(Object.keys(e)),u=a.next();!u.done;u=a.next()){var s=u.value,c=e[s];n(c)&&(o[s]=t(c,s,e))}}catch(l){i={error:l}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}var JA=function(e){return function(t){var n,i,r=t;try{for(var o=Ie(e),a=o.next();!a.done;a=o.next()){var u=a.value;r=r[u]}}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}};function YA(e,t){return function(n){var i,r,o=n;try{for(var a=Ie(e),u=a.next();!u.done;u=a.next()){var s=u.value;o=o[t][s]}}catch(c){i={error:c}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}}function ys(e){if(!e)return[[]];if(De(e))return[[e]];var t=ot(Object.keys(e).map(function(n){var i=e[n];return typeof i!="string"&&(!i||!Object.keys(i).length)?[[n]]:ys(e[n]).map(function(r){return[n].concat(r)})}));return t}function ot(e){var t;return(t=[]).concat.apply(t,Je([],$e(e),!1))}function ky(e){return Eo(e)?e:[e]}function Un(e){return e===void 0?[]:ky(e)}function Fs(e,t,n){var i,r;if(je(e))return e(t,n.data);var o={};try{for(var a=Ie(Object.keys(e)),u=a.next();!u.done;u=a.next()){var s=u.value,c=e[s];je(c)?o[s]=c(t,n.data):o[s]=c}}catch(l){i={error:l}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function XA(e){return/^(done|error)\./.test(e)}function Gf(e){return!!(e instanceof Promise||e!==null&&(je(e)||typeof e=="object")&&je(e.then))}function QA(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function ZA(e,t){var n,i,r=$e([[],[]],2),o=r[0],a=r[1];try{for(var u=Ie(e),s=u.next();!s.done;s=u.next()){var c=s.value;t(c)?o.push(c):a.push(c)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return[o,a]}function By(e,t){return Yo(e.states,function(n,i){if(n){var r=(De(t)?void 0:t[i])||(n?n.current:void 0);if(r)return{current:r,states:By(n,r)}}})}function e1(e,t){return{current:t,states:By(e,t)}}function zf(e,t,n,i){st||Dt(!!e,"Attempting to update undefined context");var r=e&&n.reduce(function(o,a){var u,s,c=a.assignment,l={state:i,action:a,_event:t},f={};if(je(c))f=c(o,t.data,l);else try{for(var d=Ie(Object.keys(c)),p=d.next();!p.done;p=d.next()){var h=p.value,v=c[h];f[h]=je(v)?v(o,t.data,l):v}}catch(w){u={error:w}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(u)throw u.error}}return Object.assign({},o,f)},e);return r}var Dt=function(){};st||(Dt=function(e,t){var n=e instanceof Error?e:void 0;if(!(!n&&e)&&console!==void 0){var i=["Warning: ".concat(t)];n&&i.push(n),console.warn.apply(console,i)}});function Eo(e){return Array.isArray(e)}function je(e){return typeof e=="function"}function De(e){return typeof e=="string"}function Uy(e,t){if(e)return De(e)?{type:ll,name:e,predicate:t?t[e]:void 0}:je(e)?{type:ll,name:e.name,predicate:e}:e}function t1(e){try{return"subscribe"in e&&je(e.subscribe)}catch{return!1}}var qi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Qa={},Qa[qi]=function(){return this},Qa[Symbol.observable]=function(){return this};function Ii(e){return!!e&&"__xstatenode"in e}function n1(e){return!!e&&typeof e.send=="function"}var i1=function(){var e=0;return function(){return e++,e.toString(16)}}();function xu(e,t){return De(e)||typeof e=="number"?z({type:e},t):e}function kt(e,t){if(!De(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=xu(e);return z({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function qr(e,t){var n=ky(t).map(function(i){return typeof i>"u"||typeof i=="string"||Ii(i)?{target:i,event:e}:z(z({},i),{event:e})});return n}function r1(e){if(!(e===void 0||e===HA))return Un(e)}function o1(e,t,n){if(!st){var i=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(i));else{var r=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(i," Current error is '").concat(t,"'.").concat(r))}}}function Vy(e,t,n,i,r){var o=e.options.guards,a={state:r,cond:t,_event:i};if(t.type===ll)return((o==null?void 0:o[t.name])||t.predicate)(n,i.data,a);var u=o==null?void 0:o[t.type];if(!u)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return u(n,i.data,a)}function Fy(e){return typeof e=="string"?{type:e}:e}function ms(e,t,n){var i=function(){},r=typeof e=="object",o=r?e:null;return{next:((r?e.next:e)||i).bind(o),error:((r?e.error:t)||i).bind(o),complete:((r?e.complete:n)||i).bind(o)}}function Za(e,t){return"".concat(e,":invocation[").concat(t,"]")}function fl(e){return(e.type===qa||e.type===Eu&&e.to===wr.Internal)&&typeof e.delay!="number"}var to=kt({type:LA});function pl(e,t){return t&&t[e]||void 0}function wa(e,t){var n;if(De(e)||typeof e=="number"){var i=pl(e,t);je(i)?n={type:e,exec:i}:i?n=i:n={type:e,exec:void 0}}else if(je(e))n={type:e.name||e.toString(),exec:e};else{var i=pl(e.type,t);if(je(i))n=z(z({},e),{exec:i});else if(i){var r=i.type||e.type;n=z(z(z({},i),e),{type:r})}else n=e}return n}var ki=function(e,t){if(!e)return[];var n=Eo(e)?e:[e];return n.map(function(i){return wa(i,t)})};function Nd(e){var t=wa(e);return z(z({id:De(e)?e:t.id},t),{type:t.type})}function a1(e,t){return{type:qa,event:typeof e=="function"?e:xu(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function s1(e,t,n,i){var r={_event:n},o=kt(je(e.event)?e.event(t,n.data,r):e.event),a;if(De(e.delay)){var u=i&&i[e.delay];a=je(u)?u(t,n.data,r):u}else a=je(e.delay)?e.delay(t,n.data,r):e.delay;return z(z({},e),{type:qa,_event:o,delay:a})}function $u(e,t){return{to:t?t.to:void 0,type:Eu,event:je(e)?e:xu(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:je(e)?e.name:qy(e)}}function u1(e,t,n,i){var r={_event:n},o=kt(je(e.event)?e.event(t,n.data,r):e.event),a;if(De(e.delay)){var u=i&&i[e.delay];a=je(u)?u(t,n.data,r):u}else a=je(e.delay)?e.delay(t,n.data,r):e.delay;var s=je(e.to)?e.to(t,n.data,r):e.to;return z(z({},e),{to:s,_event:o,event:o.data,delay:a})}function c1(e,t){return $u(e,z(z({},t),{to:wr.Parent}))}var l1=function(e,t,n){return z(z({},e),{value:De(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},d1=function(e){return{type:My,sendId:e}};function f1(e){var t=Nd(e);return{type:He.Start,activity:t,exec:void 0}}function p1(e){var t=je(e)?e:Nd(e);return{type:He.Stop,activity:t,exec:void 0}}function h1(e,t,n){var i=je(e.activity)?e.activity(t,n.data):e.activity,r=typeof i=="string"?{id:i}:i,o={type:He.Stop,activity:r};return o}var v1=function(e){return{type:Dd,assignment:e}};function y1(e,t){var n=t?"#".concat(t):"";return"".concat(He.After,"(").concat(e,")").concat(n)}function es(e,t){var n="".concat(He.DoneState,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function gs(e,t){var n="".concat(He.DoneInvoke,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function Xo(e,t){var n="".concat(He.ErrorPlatform,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function m1(e,t){if(!st&&(!e||typeof e=="function")){var n=e;e=function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var o=typeof n=="function"?n.apply(void 0,Je([],$e(i),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return $u(function(i,r){return r},z(z({},t),{to:e}))}var g1=function(e){var t,n,i=[];try{for(var r=Ie(e),o=r.next();!o.done;o=r.next())for(var a=o.value,u=0;u<a.actions.length;){if(a.actions[u].type===Dd){i.push(a.actions[u]),a.actions.splice(u,1);continue}u++}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i};function Ls(e,t,n,i,r,o,a){a===void 0&&(a=!1);var u=a?[]:g1(r),s=u.length?zf(n,i,u,t):n,c=a?[n]:void 0,l=[];function f(h,v){var w;switch(v.type){case qa:{var C=s1(v,s,i,e.options.delays);return o&&typeof C.delay=="number"&&o(C,s,i),C}case Eu:var S=u1(v,s,i,e.options.delays);if(!st){var T=v.delay;Dt(!De(T)||typeof S.delay=="number","No delay reference for delay expression '".concat(T,"' was found on machine '").concat(e.id,"'"))}return o&&S.to!==wr.Internal&&(h==="entry"?l.push(S):o(S,s,i)),S;case Ry:{var I=l1(v,s,i);return o==null||o(I,s,i),I}case zA:{var x=v,b=(w=x.conds.find(function(Z){var Q=Uy(Z.cond,e.options.guards);return!Q||Vy(e,Q,s,i,o?void 0:t)}))===null||w===void 0?void 0:w.actions;if(!b)return[];var E=$e(Ls(e,t,s,i,[{type:h,actions:ki(Un(b),e.options.actions)}],o,a),2),P=E[0],$=E[1];return s=$,c==null||c.push(s),P}case WA:{var b=v.get(s,i.data);if(!b)return[];var L=$e(Ls(e,t,s,i,[{type:h,actions:ki(Un(b),e.options.actions)}],o,a),2),R=L[0],A=L[1];return s=A,c==null||c.push(s),R}case Ad:{var I=h1(v,s,i);return o==null||o(I,n,i),I}case Dd:{s=zf(s,i,[v],o?void 0:t),c==null||c.push(s);break}default:var K=wa(v,e.options.actions),re=K.exec;if(o)o(K,s,i);else if(re&&c){var ze=c.length-1,we=z(z({},K),{exec:function(Z){for(var Q=[],de=1;de<arguments.length;de++)Q[de-1]=arguments[de];re.apply(void 0,Je([c[ze]],$e(Q),!1))}});K=we}return K}}function d(h){var v,w,C=[];try{for(var S=Ie(h.actions),T=S.next();!T.done;T=S.next()){var I=T.value,x=f(h.type,I);x&&(C=C.concat(x))}}catch(b){v={error:b}}finally{try{T&&!T.done&&(w=S.return)&&w.call(S)}finally{if(v)throw v.error}}return l.forEach(function(b){o(b,s,i)}),l.length=0,C}var p=ot(r.map(d));return[p,s]}var Gs=[],zr=function(e,t){Gs.push(e);var n=t(e);return Gs.pop(),n},b1=function(e){return e(Gs[Gs.length-1])};function Ly(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[qi]=function(){return this},t}function S1(e,t,n,i){var r,o=Fy(e.src),a=(r=t==null?void 0:t.options.services)===null||r===void 0?void 0:r[o.type],u=e.data?Fs(e.data,n,i):void 0,s=a?Pd(a,e.id,u):Ly(e.id);return s.meta=e,s}function Pd(e,t,n){var i=Ly(t);if(i.deferred=!0,Ii(e)){var r=i.state=zr(void 0,function(){return(n?e.withContext(n):e).initialState});i.getSnapshot=function(){return r}}return i}function C1(e){try{return typeof e.send=="function"}catch{return!1}}function w1(e){return C1(e)&&"id"in e}function T1(e){var t;return z((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[qi]=function(){return this},t),e)}var zs=function(e){return e.type==="atomic"||e.type==="final"};function Gy(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Ta(e){return Gy(e).filter(function(t){return t.type!=="history"})}function zy(e){var t=[e];return zs(e)?t:t.concat(ot(Ta(e).map(zy)))}function Qo(e,t){var n,i,r,o,a,u,s,c,l=new Set(e),f=hl(l),d=new Set(t);try{for(var p=Ie(d),h=p.next();!h.done;h=p.next())for(var v=h.value,w=v.parent;w&&!d.has(w);)d.add(w),w=w.parent}catch($){n={error:$}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}var C=hl(d);try{for(var S=Ie(d),T=S.next();!T.done;T=S.next()){var v=T.value;if(v.type==="compound"&&(!C.get(v)||!C.get(v).length))f.get(v)?f.get(v).forEach(function(L){return d.add(L)}):v.initialStateNodes.forEach(function(L){return d.add(L)});else if(v.type==="parallel")try{for(var I=(a=void 0,Ie(Ta(v))),x=I.next();!x.done;x=I.next()){var b=x.value;d.has(b)||(d.add(b),f.get(b)?f.get(b).forEach(function(L){return d.add(L)}):b.initialStateNodes.forEach(function(L){return d.add(L)}))}}catch(L){a={error:L}}finally{try{x&&!x.done&&(u=I.return)&&u.call(I)}finally{if(a)throw a.error}}}}catch($){r={error:$}}finally{try{T&&!T.done&&(o=S.return)&&o.call(S)}finally{if(r)throw r.error}}try{for(var E=Ie(d),P=E.next();!P.done;P=E.next())for(var v=P.value,w=v.parent;w&&!d.has(w);)d.add(w),w=w.parent}catch($){s={error:$}}finally{try{P&&!P.done&&(c=E.return)&&c.call(E)}finally{if(s)throw s.error}}return d}function Wy(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var i=n[0];if(i){if(zs(i))return i.key}else return{}}var r={};return n.forEach(function(o){r[o.key]=Wy(o,t)}),r}function hl(e){var t,n,i=new Map;try{for(var r=Ie(e),o=r.next();!o.done;o=r.next()){var a=o.value;i.has(a)||i.set(a,[]),a.parent&&(i.has(a.parent)||i.set(a.parent,[]),i.get(a.parent).push(a))}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i}function I1(e,t){var n=Qo([e],t);return Wy(e,hl(n))}function Zo(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function E1(e){return Je([],$e(new Set(ot(Je([],$e(e.map(function(t){return t.ownEvents})),!1)))),!1)}function bs(e,t){return t.type==="compound"?Ta(t).some(function(n){return n.type==="final"&&Zo(e,n)}):t.type==="parallel"?Ta(t).every(function(n){return bs(e,n)}):!1}function x1(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function Wf(e){return new Set(ot(e.map(function(t){return t.tags})))}function Hy(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(De(e)||De(t))return e===t;var n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&n.every(function(r){return Hy(e[r],t[r])})}function $1(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function A1(e,t){var n=e.exec,i=z(z({},e),{exec:n!==void 0?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0});return i}var xn=function(){function e(t){var n=this,i;this.actions=[],this.activities=Ff,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||Ff,this.meta=x1(t.configuration),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=(i=Array.isArray(t.tags)?new Set(t.tags):t.tags)!==null&&i!==void 0?i:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return E1(n.configuration)}})}return e.from=function(t,n){if(t instanceof e)return t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t;var i=to;return new e({value:t,context:n,_event:i,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var i=to;return new e({value:t.value,context:n,_event:i,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var i=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),De(t))return[t];var r=Object.keys(t);return r.concat.apply(r,Je([],$e(r.map(function(o){return i.toStrings(t[o],n).map(function(a){return o+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var i=$d(t,["configuration","transitions","tags","machine"]);return z(z({},i),{tags:Array.from(n)})},e.prototype.matches=function(t){return Od(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;st&&Dt(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var i=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,t);return!!(i!=null&&i.transitions.length)&&i.transitions.some(function(r){return r.target!==void 0||r.actions.length})},e}(),D1={deferEvents:!1},Hf=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=z(z({},D1),t)}return e.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},e.prototype.schedule=function(t){if(!this.initialized||this.processingEvent){this.queue.push(t);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},e.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},e}(),ec=new Map,O1=0,ko={bookId:function(){return"x:".concat(O1++)},register:function(e,t){return ec.set(e,t),e},get:function(e){return ec.get(e)},free:function(e){ec.delete(e)}};function Md(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;st||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues")}function N1(){var e=Md();if(e&&"__xstate__"in e)return e.__xstate__}function P1(e){if(Md()){var t=N1();t&&t.register(e)}}function M1(e,t){t===void 0&&(t={});var n=e.initialState,i=new Set,r=[],o=!1,a=function(){if(!o){for(o=!0;r.length>0;){var c=r.shift();n=e.transition(n,c,s),i.forEach(function(l){return l.next(n)})}o=!1}},u=T1({id:t.id,send:function(c){r.push(c),a()},getSnapshot:function(){return n},subscribe:function(c,l,f){var d=ms(c,l,f);return i.add(d),d.next(n),{unsubscribe:function(){i.delete(d)}}}}),s={parent:t.parent,self:u,id:t.id||"anonymous",observers:i};return n=e.start?e.start(s):n,u}var vl={sync:!1,autoForward:!1},ct;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ct||(ct={}));var R1=function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var i=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=ct.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(l,f){if(Eo(l))return i.batch(l),i.state;var d=kt(xu(l,f));if(i.status===ct.Stopped)return st||Dt(!1,'Event "'.concat(d.name,'" was sent to stopped service "').concat(i.machine.id,`". This service has already reached its final state, and will not transition.
|
|
84
|
-
Event: `).concat(JSON.stringify(d.data))),
|
|
85
|
-
Event: `).concat(JSON.stringify(d.data)));return
|
|
86
|
-
Event: `).concat(JSON.stringify(event)));else if(this.status!==ct.Running)throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(t.length){var i=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var r,o,a=n.state,u=!1,s=[],c=function(p){var h=kt(p);n.forward(h),a=zr(n,function(){return n.machine.transition(a,h,void 0,i||void 0)}),s.push.apply(s,Je([],$e(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return A1(v,a)})),!1)),u=u||!!a.changed};try{for(var l=Ie(t),f=l.next();!f.done;f=l.next()){var d=f.value;c(d)}}catch(p){r={error:p}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}a.changed=u,a.actions=s,n.update(a,kt(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var i=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var r=kt(t);if(r.name.indexOf(Vf)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(Vf)===0}))throw r.data.data;var o=zr(this,function(){return i.machine.transition(i.state,r,void 0,n||void 0)});return o},e.prototype.nextState=function(t){return this._nextState(t,!1)},e.prototype.forward=function(t){var n,i;try{for(var r=Ie(this.forwardTo),o=r.next();!o.done;o=r.next()){var a=o.value,u=this.children.get(a);if(!u)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));u.send(t)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},e.prototype.defer=function(t){var n=this,i=this.clock.setTimeout(function(){"to"in t&&t.to?n.sendTo(t._event,t.to,!0):n.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=i)},e.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},e.prototype.exec=function(t,n,i){i===void 0&&(i=this.machine.options.actions),this._exec(t,n.context,n._event,i)},e.prototype.removeChild=function(t){var n;this.children.delete(t),this.forwardTo.delete(t),(n=this.state)===null||n===void 0||delete n.children[t]},e.prototype.stopChild=function(t){var n=this.children.get(t);n&&(this.removeChild(t),je(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,i){if(this.status!==ct.Running)return Pd(t,n);if(Gf(t))return this.spawnPromise(Promise.resolve(t),n);if(je(t))return this.spawnCallback(t,n);if(w1(t))return this.spawnActor(t,n);if(t1(t))return this.spawnObservable(t,n);if(Ii(t))return this.spawnMachine(t,z(z({},i),{id:n}));if(QA(t))return this.spawnBehavior(t,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof t,'".'))},e.prototype.spawnMachine=function(t,n){var i=this;n===void 0&&(n={});var r=new e(t,z(z({},this.options),{parent:this,id:n.id||t.id})),o=z(z({},vl),n);o.sync&&r.onTransition(function(u){i.send(_y,{state:u,id:r.id})});var a=r;return this.children.set(r.id,a),o.autoForward&&this.forwardTo.add(r.id),r.onDone(function(u){i.removeChild(r.id),i.send(kt(u,{origin:r.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var i=M1(t,{id:n,parent:this});return this.children.set(n,i),i},e.prototype.spawnPromise=function(t,n){var i,r=this,o=!1,a;t.then(function(s){o||(a=s,r.removeChild(n),r.send(kt(gs(n,s),{origin:n})))},function(s){if(!o){r.removeChild(n);var c=Xo(n,s);try{r.send(kt(c,{origin:n}))}catch(l){o1(s,l,n),r.devTools&&r.devTools.send(c,r.state),r.machine.strict&&r.stop()}}});var u=(i={id:n,send:function(){},subscribe:function(s,c,l){var f=ms(s,c,l),d=!1;return t.then(function(p){d||(f.next(p),!d&&f.complete())},function(p){d||f.error(p)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},i[qi]=function(){return this},i);return this.children.set(n,u),u},e.prototype.spawnCallback=function(t,n){var i,r=this,o=!1,a=new Set,u=new Set,s,c=function(d){s=d,u.forEach(function(p){return p(d)}),!o&&r.send(kt(d,{origin:n}))},l;try{l=t(c,function(d){a.add(d)})}catch(d){this.send(Xo(n,d))}if(Gf(l))return this.spawnPromise(l,n);var f=(i={id:n,send:function(d){return a.forEach(function(p){return p(d)})},subscribe:function(d){var p=ms(d);return u.add(p.next),{unsubscribe:function(){u.delete(p.next)}}},stop:function(){o=!0,je(l)&&l()},toJSON:function(){return{id:n}},getSnapshot:function(){return s}},i[qi]=function(){return this},i);return this.children.set(n,f),f},e.prototype.spawnObservable=function(t,n){var i,r=this,o,a=t.subscribe(function(s){o=s,r.send(kt(s,{origin:n}))},function(s){r.removeChild(n),r.send(kt(Xo(n,s),{origin:n}))},function(){r.removeChild(n),r.send(kt(gs(n),{origin:n}))}),u=(i={id:n,send:function(){},subscribe:function(s,c,l){return t.subscribe(s,c,l)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},i[qi]=function(){return this},i);return this.children.set(n,u),u},e.prototype.spawnActor=function(t,n){return this.children.set(n,t),t},e.prototype.spawnActivity=function(t){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(!n){st||Dt(!1,"No implementation found for activity '".concat(t.type,"'"));return}var i=n(this.state.context,t);this.spawnEffect(t.id,i)},e.prototype.spawnEffect=function(t,n){var i;this.children.set(t,(i={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}},i[qi]=function(){return this},i))},e.prototype.attachDev=function(){var t=Md();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(z(z({name:this.id,autoPause:!0,stateSanitizer:function(i){return{value:i.value,context:i.context,actions:i.actions}}},n),{features:z({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}P1(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[qi]=function(){return this},e.prototype.getSnapshot=function(){return this.status===ct.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,n){return setTimeout(t,n)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},e.interpret=Ky,e}(),_1=function(e){return De(e)?z(z({},vl),{name:e}):z(z(z({},vl),{name:i1()}),e)};function Kf(e,t){var n=_1(t);return b1(function(i){if(!st){var r=Ii(e)||je(e);Dt(!!i||r,'Attempted to spawn an Actor (ID: "'.concat(Ii(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return i?i.spawn(e,n.name,n):Pd(e,n.name)})}function Ky(e,t){var n=new R1(e,t);return n}function j1(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function ts(e){return z(z({type:cl},e),{toJSON:function(){e.onDone,e.onError;var t=$d(e,["onDone","onError"]);return z(z({},t),{type:cl,src:j1(e.src)})}})}var Wr="",yl="#",Bo="*",kr={},Br=function(e){return e[0]===yl},q1=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},k1=function(e,t,n){var i=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(De(o.target)||Ii(o.target))}),r=t===Wr?"the transient event":"event '".concat(t,"'");Dt(!i,"One or more transitions for ".concat(r," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},B1=function(){function e(t,n,i,r){i===void 0&&(i="context"in t?t.context:void 0);var o=this,a;this.config=t,this._context=i,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(q1(),n),this.parent=r==null?void 0:r.parent,this.key=this.config.key||(r==null?void 0:r.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:jy),this.id=this.config.id||Je([this.machine.key],$e(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,st||Dt(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?Yo(this.config.states,function(c,l){var f,d=new e(c,{},void 0,{parent:o,key:l});return Object.assign(o.idMap,z((f={},f[d.id]=d,f),d.idMap)),d}):kr;var u=0;function s(c){var l,f;c.order=u++;try{for(var d=Ie(Gy(c)),p=d.next();!p.done;p=d.next()){var h=p.value;s(h)}}catch(v){l={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}finally{if(l)throw l.error}}}s(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(c){var l=c.event;return l===Wr}):Wr in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=Un(this.config.entry||this.config.onEntry).map(function(c){return wa(c)}),this.onExit=Un(this.config.exit||this.config.onExit).map(function(c){return wa(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=Un(this.config.invoke).map(function(c,l){var f,d;if(Ii(c)){var p=Za(o.id,l);return o.machine.options.services=z((f={},f[p]=c,f),o.machine.options.services),ts({src:p,id:p})}else if(De(c.src)){var p=c.id||Za(o.id,l);return ts(z(z({},c),{id:p,src:c.src}))}else if(Ii(c.src)||je(c.src)){var p=c.id||Za(o.id,l);return o.machine.options.services=z((d={},d[p]=c.src,d),o.machine.options.services),ts(z(z({id:p},c),{src:p}))}else{var h=c.src;return ts(z(z({id:Za(o.id,l)},c),{src:h}))}}),this.activities=Un(this.config.activities).concat(this.invoke).map(function(c){return Nd(c)}),this.transition=this.transition.bind(this),this.tags=Un(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||zy(this).forEach(function(t){return t.on})},e.prototype.withConfig=function(t,n){var i=this.options,r=i.actions,o=i.activities,a=i.guards,u=i.services,s=i.delays;return new e(this.config,{actions:z(z({},r),t.actions),activities:z(z({},o),t.activities),guards:z(z({},a),t.guards),services:z(z({},u),t.services),delays:z(z({},s),t.delays)},n??this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return je(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:Yo(this.states,function(t){return t.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(n,i){return n[i.eventType]=n[i.eventType]||[],n[i.eventType].push(i),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var n=t===Wr,i=this.transitions.filter(function(r){var o=r.eventType===t;return n?o:o||r.eventType===Bo});return this.__cache.candidates[t]=i,i},e.prototype.getDelayedTransitions=function(){var t=this,n=this.config.after;if(!n)return[];var i=function(o,a){var u=je(o)?"".concat(t.id,":delay[").concat(a,"]"):o,s=y1(u,t.id);return t.onEntry.push($u(s,{delay:o})),t.onExit.push(d1(s)),s},r=Eo(n)?n.map(function(o,a){var u=i(o.delay,a);return z(z({},o),{event:u})}):ot(Object.keys(n).map(function(o,a){var u=n[o],s=De(u)?{target:u}:u,c=isNaN(+o)?o:+o,l=i(c,a);return Un(s).map(function(f){return z(z({},f),{event:l,delay:c})})}));return r.map(function(o){var a=o.delay;return z(z({},t.formatTransition(o)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,i=this;if(!t)return[];var r=t instanceof xn?t.value:aa(t,this.delimiter);if(De(r)){var o=this.getStateNode(r).initial;return o!==void 0?this.getStateNodes((n={},n[r]=o,n)):[this,this.states[r]]}var a=Object.keys(r),u=[this];return u.push.apply(u,Je([],$e(ot(a.map(function(s){return i.getStateNode(s).getStateNodes(r[s])}))),!1)),u},e.prototype.handles=function(t){var n=qy(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof xn?t:xn.create(t),i=Array.from(Qo([],this.getStateNodes(n.value)));return new xn(z(z({},n),{value:this.resolve(n.value),configuration:i,done:bs(i,this),tags:Wf(i),machine:this.machine}))},e.prototype.transitionLeafNode=function(t,n,i){var r=this.getStateNode(t),o=r.next(n,i);return!o||!o.transitions.length?this.next(n,i):o},e.prototype.transitionCompoundNode=function(t,n,i){var r=Object.keys(t),o=this.getStateNode(r[0]),a=o._transition(t[r[0]],n,i);return!a||!a.transitions.length?this.next(n,i):a},e.prototype.transitionParallelNode=function(t,n,i){var r,o,a={};try{for(var u=Ie(Object.keys(t)),s=u.next();!s.done;s=u.next()){var c=s.value,l=t[c];if(l){var f=this.getStateNode(c),d=f._transition(l,n,i);d&&(a[c]=d)}}}catch(C){r={error:C}}finally{try{s&&!s.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}var p=Object.keys(a).map(function(C){return a[C]}),h=ot(p.map(function(C){return C.transitions})),v=p.some(function(C){return C.transitions.length>0});if(!v)return this.next(n,i);var w=ot(Object.keys(a).map(function(C){return a[C].configuration}));return{transitions:h,exitSet:ot(p.map(function(C){return C.exitSet})),configuration:w,source:n,actions:ot(Object.keys(a).map(function(C){return a[C].actions}))}},e.prototype._transition=function(t,n,i){return De(t)?this.transitionLeafNode(t,n,i):Object.keys(t).length===1?this.transitionCompoundNode(t,n,i):this.transitionParallelNode(t,n,i)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,kt(n))},e.prototype.next=function(t,n){var i,r,o=this,a=n.name,u=[],s=[],c;try{for(var l=Ie(this.getCandidates(a)),f=l.next();!f.done;f=l.next()){var d=f.value,p=d.cond,h=d.in,v=t.context,w=h?De(h)&&Br(h)?t.matches(aa(this.getStateNodeById(h).path,this.delimiter)):Od(aa(h,this.delimiter),JA(this.path.slice(0,-2))(t.value)):!0,C=!1;try{C=!p||Vy(this.machine,p,v,n,t)}catch(I){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
87
|
-
`).concat(I.message))}if(C&&w){d.target!==void 0&&(s=d.target),u.push.apply(u,Je([],$e(d.actions),!1)),c=d;break}}}catch(I){i={error:I}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}if(c){if(!s.length)return{transitions:[c],exitSet:[],configuration:t.value?[this]:[],source:t,actions:u};var S=ot(s.map(function(I){return o.getRelativeStateNodes(I,t.historyValue)})),T=!!c.internal;return{transitions:[c],exitSet:T?[]:ot(s.map(function(I){return o.getPotentiallyReenteringNodes(I)})),configuration:S,source:t,actions:u}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var n=[],i=this,r=t;i&&i!==r;)n.push(i),i=i.parent;return i!==r?[]:(n.push(r),n)},e.prototype.getActions=function(t,n,i,r,o,a,u){var s,c,l,f,d=this,p=a?Qo([],this.getStateNodes(a.value)):[],h=new Set;try{for(var v=Ie(Array.from(t).sort(function(R,A){return R.order-A.order})),w=v.next();!w.done;w=v.next()){var C=w.value;(!Zo(p,C)||Zo(i.exitSet,C)||C.parent&&h.has(C.parent))&&h.add(C)}}catch(R){s={error:R}}finally{try{w&&!w.done&&(c=v.return)&&c.call(v)}finally{if(s)throw s.error}}try{for(var S=Ie(p),T=S.next();!T.done;T=S.next()){var C=T.value;(!Zo(t,C)||Zo(i.exitSet,C.parent))&&i.exitSet.push(C)}}catch(R){l={error:R}}finally{try{T&&!T.done&&(f=S.return)&&f.call(S)}finally{if(l)throw l.error}}i.exitSet.sort(function(R,A){return A.order-R.order});var I=Array.from(h).sort(function(R,A){return R.order-A.order}),x=new Set(i.exitSet),b=ot(I.map(function(R){var A=[];if(R.type!=="final")return A;var K=R.parent;if(!K.parent)return A;A.push(es(R.id,R.doneData),es(K.id,R.doneData?Fs(R.doneData,r,o):void 0));var re=K.parent;return re.type==="parallel"&&Ta(re).every(function(ze){return bs(i.configuration,ze)})&&A.push(es(re.id)),A})),E=I.map(function(R){var A=R.onEntry,K=R.activities.map(function(re){return f1(re)});return{type:"entry",actions:ki(u?Je(Je([],$e(A),!1),$e(K),!1):Je(Je([],$e(K),!1),$e(A),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:b.map(function(R){return a1(R)})}),P=Array.from(x).map(function(R){return{type:"exit",actions:ki(Je(Je([],$e(R.onExit),!1),$e(R.activities.map(function(A){return p1(A)})),!1),d.machine.options.actions)}}),$=P.concat({type:"transition",actions:ki(i.actions,this.machine.options.actions)}).concat(E);if(n){var L=ki(ot(Je([],$e(t),!1).sort(function(R,A){return A.order-R.order}).map(function(R){return R.onExit})),this.machine.options.actions).filter(function(R){return!fl(R)});return $.concat({type:"stop",actions:L})}return $},e.prototype.transition=function(t,n,i,r){t===void 0&&(t=this.initialState);var o=kt(n),a;if(t instanceof xn)a=i===void 0?t:this.resolveState(xn.from(t,i));else{var u=De(t)?this.resolve(Vs(this.getResolvedPath(t))):this.resolve(t),s=i??this.machine.context;a=this.resolveState(xn.from(u,s))}if(!st&&o.name===Bo)throw new Error("An event cannot have the wildcard type ('".concat(Bo,"')"));if(this.strict&&!this.events.includes(o.name)&&!XA(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},l=Qo([],this.getStateNodes(a.value)),f=c.configuration.length?Qo(l,c.configuration):l;return c.configuration=Je([],$e(f),!1),this.resolveTransition(c,a,a.context,r,o)},e.prototype.resolveRaisedTransition=function(t,n,i,r){var o,a=t.actions;return t=this.transition(t,n,void 0,r),t._event=i,t.event=i.data,(o=t.actions).unshift.apply(o,Je([],$e(a),!1)),t},e.prototype.resolveTransition=function(t,n,i,r,o){var a,u,s,c,l=this;o===void 0&&(o=to);var f=t.configuration,d=!n||t.transitions.length>0,p=d?t.configuration:n?n.configuration:[],h=bs(p,this),v=d?I1(this.machine,f):void 0,w=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,C=this.getActions(new Set(p),h,t,i,o,n,r),S=n?z({},n.activities):{};try{for(var T=Ie(C),I=T.next();!I.done;I=T.next()){var x=I.value;try{for(var b=(s=void 0,Ie(x.actions)),E=b.next();!E.done;E=b.next()){var P=E.value;P.type===ul?S[P.activity.id||P.activity.type]=P:P.type===Ad&&(S[P.activity.id||P.activity.type]=!1)}}catch(Pe){s={error:Pe}}finally{try{E&&!E.done&&(c=b.return)&&c.call(b)}finally{if(s)throw s.error}}}}catch(Pe){a={error:Pe}}finally{try{I&&!I.done&&(u=T.return)&&u.call(T)}finally{if(a)throw a.error}}var $=$e(Ls(this,n,i,o,C,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),L=$[0],R=$[1],A=$e(ZA(L,fl),2),K=A[0],re=A[1],ze=L.filter(function(Pe){var it;return Pe.type===ul&&((it=Pe.activity)===null||it===void 0?void 0:it.type)===cl}),we=ze.reduce(function(Pe,it){return Pe[it.activity.id]=S1(it.activity,l.machine,R,o),Pe},n?z({},n.children):{}),Z=new xn({value:v||n.value,context:R,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?w?e1(w,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?re:[],activities:v?S:n?n.activities:{},events:[],configuration:p,transitions:t.transitions,children:we,done:h,tags:Wf(p),machine:this}),Q=i!==R;Z.changed=o.name===_y||Q;var de=Z.history;de&&delete de.history;var _t=!h&&(this._transient||f.some(function(Pe){return Pe._transient}));if(!d&&(!_t||o.name===Wr))return Z;var ae=Z;if(!h)for(_t&&(ae=this.resolveRaisedTransition(ae,{type:FA},o,r));K.length;){var jt=K.shift();ae=this.resolveRaisedTransition(ae,jt._event,o,r)}var rn=ae.changed||(de?!!ae.actions.length||Q||typeof de.value!=typeof ae.value||!Hy(ae.value,de.value):void 0);return ae.changed=rn,ae.history=de,ae},e.prototype.getStateNode=function(t){if(Br(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[t];if(!n)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return n},e.prototype.getStateNodeById=function(t){var n=Br(t)?t.slice(yl.length):t;if(n===this.id)return this;var i=this.machine.idMap[n];if(!i)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return i},e.prototype.getStateNodeByPath=function(t){if(typeof t=="string"&&Br(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=dl(t,this.delimiter).slice(),i=this;n.length;){var r=n.shift();if(!r.length)break;i=i.getStateNode(r)}return i},e.prototype.resolve=function(t){var n,i=this;if(!t)return this.initialStateValue||kr;switch(this.type){case"parallel":return Yo(this.initialStateValue,function(o,a){return o?i.getStateNode(a).resolve(t[a]||o):kr});case"compound":if(De(t)){var r=this.getStateNode(t);return r.type==="parallel"||r.type==="compound"?(n={},n[t]=r.initialStateValue,n):t}return Object.keys(t).length?Yo(t,function(o,a){return o?i.getStateNode(a).resolve(o):kr}):this.initialStateValue||{};default:return t||kr}},e.prototype.getResolvedPath=function(t){if(Br(t)){var n=this.machine.idMap[t.slice(yl.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return dl(t,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=Lf(this.states,function(i){return i.initialStateValue||kr},function(i){return i.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=zs(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var i=this.getStateNodes(t);return this.resolveTransition({configuration:i,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;De(n.target)?t=Br(n.target)?Vs(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:t=n.target}return t},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(t,n,i){return i===void 0&&(i=!0),i?t.type==="history"?t.resolveHistory(n):t.initialStateNodes:[t]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var t=this;if(zs(this))return[this];if(this.type==="compound"&&!this.initial)return st||Dt(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=ys(this.initialStateValue);return ot(n.map(function(i){return t.getFromRelativePath(i)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=$e(t),i=n[0],r=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(i,"' from node with no states"));var o=this.getStateNode(i);if(o.type==="history")return o.resolveHistory();if(!this.states[i])throw new Error("Child state '".concat(i,"' does not exist on '").concat(this.id,"'"));return this.states[i].getFromRelativePath(r)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:Lf(this.states,function(n,i){if(!t)return n.historyValue();var r=De(t)?void 0:t[i];return n.historyValue(r||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var i=this.parent;if(!t){var r=this.target;return r?ot(ys(r).map(function(a){return i.getFromRelativePath(a)})):i.initialStateNodes}var o=YA(i.path,"states")(t).current;return De(o)?[i.getStateNode(o)]:ot(ys(o).map(function(a){return n.history==="deep"?i.getFromRelativePath(a):[i.states[a[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var t=this,n=ot(Object.keys(this.states).map(function(i){return t.states[i].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var t,n,i,r;if(this.__cache.events)return this.__cache.events;var o=this.states,a=new Set(this.ownEvents);if(o)try{for(var u=Ie(Object.keys(o)),s=u.next();!s.done;s=u.next()){var c=s.value,l=o[c];if(l.states)try{for(var f=(i=void 0,Ie(l.events)),d=f.next();!d.done;d=f.next()){var p=d.value;a.add("".concat(p))}}catch(h){i={error:h}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(i)throw i.error}}}}catch(h){t={error:h}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(i){if(!De(i))return i;var r=i[0]===n.delimiter;if(r&&!n.parent)return n.getStateNodeByPath(i.slice(1));var o=r?n.key+i:i;if(n.parent)try{var a=n.parent.getStateNodeByPath(o);return a}catch(u){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
88
|
-
`).concat(
|
|
83
|
+
***************************************************************************** */var re=function(){return re=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},re.apply(this,arguments)};function Zh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Be(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ge(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function bt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var vt;(function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"})(vt||(vt={}));var To;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(To||(To={}));var ip=vt.Start,ev=vt.Stop,Cu=vt.Raise,ef=vt.Send,w0=vt.Cancel,IM=vt.NullEvent,tv=vt.Assign;vt.After;vt.DoneState;var C0=vt.Log,AM=vt.Init,op=vt.Invoke;vt.ErrorExecution;var ny=vt.ErrorPlatform,$M=vt.ErrorCustom,x0=vt.Update,OM=vt.Choose,DM=vt.Pure,E0=".",ry={},ap="xstate.guard",NM="",Pt=process.env.NODE_ENV==="production",Gu;function nv(e,t,n){n===void 0&&(n=E0);var r=Ds(e,n),i=Ds(t,n);return We(i)?We(r)?i===r:!1:We(r)?r in i:Object.keys(r).every(function(o){return o in i?nv(r[o],i[o]):!1})}function T0(e){try{return We(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function sp(e,t){try{return Wa(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function PM(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function Ds(e,t){if(PM(e))return e.value;if(Wa(e))return Jc(e);if(typeof e!="string")return e;var n=sp(e,t);return Jc(n)}function Jc(e){if(e.length===1)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function bs(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function iy(e,t,n){var r,i,o={};try{for(var a=Be(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];n(c)&&(o[u]=t(c,u,e))}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var RM=function(e){return function(t){var n,r,i=t;try{for(var o=Be(e),a=o.next();!a.done;a=o.next()){var s=a.value;i=i[s]}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function kM(e,t){return function(n){var r,i,o=n;try{for(var a=Be(e),s=a.next();!s.done;s=a.next()){var u=s.value;o=o[t][u]}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function Cc(e){if(!e)return[[]];if(We(e))return[[e]];var t=Dt(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:Cc(e[n]).map(function(i){return[n].concat(i)})}));return t}function Dt(e){var t;return(t=[]).concat.apply(t,bt([],Ge(e),!1))}function I0(e){return Wa(e)?e:[e]}function hr(e){return e===void 0?[]:I0(e)}function Qc(e,t,n){var r,i;if(tt(e))return e(t,n.data);var o={};try{for(var a=Be(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];tt(c)?o[u]=c(t,n.data):o[u]=c}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function MM(e){return/^(done|error)\./.test(e)}function oy(e){return!!(e instanceof Promise||e!==null&&(tt(e)||typeof e=="object")&&tt(e.then))}function jM(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function _M(e,t){var n,r,i=Ge([[],[]],2),o=i[0],a=i[1];try{for(var s=Be(e),u=s.next();!u.done;u=s.next()){var c=u.value;t(c)?o.push(c):a.push(c)}}catch(l){n={error:l}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function A0(e,t){return bs(e.states,function(n,r){if(n){var i=(We(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:A0(n,i)}}})}function qM(e,t){return{current:t,states:A0(e,t)}}function ay(e,t,n,r){Pt||tn(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,c=a.assignment,l={state:r,action:a,_event:t},f={};if(tt(c))f=c(o,t.data,l);else try{for(var d=Be(Object.keys(c)),p=d.next();!p.done;p=d.next()){var h=p.value,v=c[h];f[h]=tt(v)?v(o,t.data,l):v}}catch(C){s={error:C}}finally{try{p&&!p.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var tn=function(){};Pt||(tn=function(e,t){var n=e instanceof Error?e:void 0;if(!(!n&&e)&&console!==void 0){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});function Wa(e){return Array.isArray(e)}function tt(e){return typeof e=="function"}function We(e){return typeof e=="string"}function $0(e,t){if(e)return We(e)?{type:ap,name:e,predicate:t?t[e]:void 0}:tt(e)?{type:ap,name:e.name,predicate:e}:e}function FM(e){try{return"subscribe"in e&&tt(e.subscribe)}catch{return!1}}var xi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Gu={},Gu[xi]=function(){return this},Gu[Symbol.observable]=function(){return this};function ni(e){return!!e&&"__xstatenode"in e}function LM(e){return!!e&&typeof e.send=="function"}var BM=function(){var e=0;return function(){return e++,e.toString(16)}}();function tf(e,t){return We(e)||typeof e=="number"?re({type:e},t):e}function ln(e,t){if(!We(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=tf(e);return re({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Ho(e,t){var n=I0(t).map(function(r){return typeof r>"u"||typeof r=="string"||ni(r)?{target:r,event:e}:re(re({},r),{event:e})});return n}function VM(e){if(!(e===void 0||e===NM))return hr(e)}function UM(e,t,n){if(!Pt){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}function O0(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===ap)return((o==null?void 0:o[t.name])||t.predicate)(n,r.data,a);var s=o==null?void 0:o[t.type];if(!s)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return s(n,r.data,a)}function D0(e){return typeof e=="string"?{type:e}:e}function xc(e,t,n){var r=function(){},i=typeof e=="object",o=i?e:null;return{next:((i?e.next:e)||r).bind(o),error:((i?e.error:t)||r).bind(o),complete:((i?e.complete:n)||r).bind(o)}}function zu(e,t){return"".concat(e,":invocation[").concat(t,"]")}function up(e){return(e.type===Cu||e.type===ef&&e.to===To.Internal)&&typeof e.delay!="number"}var ga=ln({type:AM});function cp(e,t){return t&&t[e]||void 0}function Xs(e,t){var n;if(We(e)||typeof e=="number"){var r=cp(e,t);tt(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(tt(e))n={type:e.name||e.toString(),exec:e};else{var r=cp(e.type,t);if(tt(r))n=re(re({},e),{exec:r});else if(r){var i=r.type||e.type;n=re(re(re({},r),e),{type:i})}else n=e}return n}var Ei=function(e,t){if(!e)return[];var n=Wa(e)?e:[e];return n.map(function(r){return Xs(r,t)})};function rv(e){var t=Xs(e);return re(re({id:We(e)?e:t.id},t),{type:t.type})}function GM(e,t){return{type:Cu,event:typeof e=="function"?e:tf(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function zM(e,t,n,r){var i={_event:n},o=ln(tt(e.event)?e.event(t,n.data,i):e.event),a;if(We(e.delay)){var s=r&&r[e.delay];a=tt(s)?s(t,n.data,i):s}else a=tt(e.delay)?e.delay(t,n.data,i):e.delay;return re(re({},e),{type:Cu,_event:o,delay:a})}function nf(e,t){return{to:t?t.to:void 0,type:ef,event:tt(e)?e:tf(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:tt(e)?e.name:T0(e)}}function WM(e,t,n,r){var i={_event:n},o=ln(tt(e.event)?e.event(t,n.data,i):e.event),a;if(We(e.delay)){var s=r&&r[e.delay];a=tt(s)?s(t,n.data,i):s}else a=tt(e.delay)?e.delay(t,n.data,i):e.delay;var u=tt(e.to)?e.to(t,n.data,i):e.to;return re(re({},e),{to:u,_event:o,event:o.data,delay:a})}function HM(e,t){return nf(e,re(re({},t),{to:To.Parent}))}var KM=function(e,t,n){return re(re({},e),{value:We(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},YM=function(e){return{type:w0,sendId:e}};function XM(e){var t=rv(e);return{type:vt.Start,activity:t,exec:void 0}}function JM(e){var t=tt(e)?e:rv(e);return{type:vt.Stop,activity:t,exec:void 0}}function QM(e,t,n){var r=tt(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:vt.Stop,activity:i};return o}var ZM=function(e){return{type:tv,assignment:e}};function ej(e,t){var n=t?"#".concat(t):"";return"".concat(vt.After,"(").concat(e,")").concat(n)}function Wu(e,t){var n="".concat(vt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Ec(e,t){var n="".concat(vt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Ss(e,t){var n="".concat(vt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function tj(e,t){if(!Pt&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,bt([],Ge(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return nf(function(r,i){return i},re(re({},t),{to:e}))}var nj=function(e){var t,n,r=[];try{for(var i=Be(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===tv){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function Zc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:nj(i),u=s.length?ay(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var C;switch(v.type){case Cu:{var E=zM(v,u,r,e.options.delays);return o&&typeof E.delay=="number"&&o(E,u,r),E}case ef:var y=WM(v,u,r,e.options.delays);if(!Pt){var w=v.delay;tn(!We(w)||typeof y.delay=="number","No delay reference for delay expression '".concat(w,"' was found on machine '").concat(e.id,"'"))}return o&&y.to!==To.Internal&&(h==="entry"?l.push(y):o(y,u,r)),y;case C0:{var x=KM(v,u,r);return o==null||o(x,u,r),x}case OM:{var S=v,T=(C=S.conds.find(function(B){var U=$0(B.cond,e.options.guards);return!U||O0(e,U,u,r,o?void 0:t)}))===null||C===void 0?void 0:C.actions;if(!T)return[];var A=Ge(Zc(e,t,u,r,[{type:h,actions:Ei(hr(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case DM:{var T=v.get(u,r.data);if(!T)return[];var N=Ge(Zc(e,t,u,r,[{type:h,actions:Ei(hr(T),e.options.actions)}],o,a),2),j=N[0],L=N[1];return u=L,c==null||c.push(u),j}case ev:{var x=QM(v,u,r);return o==null||o(x,n,r),x}case tv:{u=ay(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=Xs(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=re(re({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,bt([c[R]],Ge(U),!1))}});V=ie}return V}}function d(h){var v,C,E=[];try{for(var y=Be(h.actions),w=y.next();!w.done;w=y.next()){var x=w.value,S=f(h.type,x);S&&(E=E.concat(S))}}catch(T){v={error:T}}finally{try{w&&!w.done&&(C=y.return)&&C.call(y)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,E}var p=Dt(i.map(d));return[p,u]}var el=[],na=function(e,t){el.push(e);var n=t(e);return el.pop(),n},rj=function(e){return e(el[el.length-1])};function N0(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[xi]=function(){return this},t}function ij(e,t,n,r){var i,o=D0(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?Qc(e.data,n,r):void 0,u=a?iv(a,e.id,s):N0(e.id);return u.meta=e,u}function iv(e,t,n){var r=N0(t);if(r.deferred=!0,ni(e)){var i=r.state=na(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function oj(e){try{return typeof e.send=="function"}catch{return!1}}function aj(e){return oj(e)&&"id"in e}function sj(e){var t;return re((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[xi]=function(){return this},t),e)}var tl=function(e){return e.type==="atomic"||e.type==="final"};function P0(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Js(e){return P0(e).filter(function(t){return t.type!=="history"})}function R0(e){var t=[e];return tl(e)?t:t.concat(Dt(Js(e).map(R0)))}function ws(e,t){var n,r,i,o,a,s,u,c,l=new Set(e),f=lp(l),d=new Set(t);try{for(var p=Be(d),h=p.next();!h.done;h=p.next())for(var v=h.value,C=v.parent;C&&!d.has(C);)d.add(C),C=C.parent}catch(I){n={error:I}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var E=lp(d);try{for(var y=Be(d),w=y.next();!w.done;w=y.next()){var v=w.value;if(v.type==="compound"&&(!E.get(v)||!E.get(v).length))f.get(v)?f.get(v).forEach(function(N){return d.add(N)}):v.initialStateNodes.forEach(function(N){return d.add(N)});else if(v.type==="parallel")try{for(var x=(a=void 0,Be(Js(v))),S=x.next();!S.done;S=x.next()){var T=S.value;d.has(T)||(d.add(T),f.get(T)?f.get(T).forEach(function(N){return d.add(N)}):T.initialStateNodes.forEach(function(N){return d.add(N)}))}}catch(N){a={error:N}}finally{try{S&&!S.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{w&&!w.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}try{for(var A=Be(d),D=A.next();!D.done;D=A.next())for(var v=D.value,C=v.parent;C&&!d.has(C);)d.add(C),C=C.parent}catch(I){u={error:I}}finally{try{D&&!D.done&&(c=A.return)&&c.call(A)}finally{if(u)throw u.error}}return d}function k0(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(tl(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=k0(o,t)}),i}function lp(e){var t,n,r=new Map;try{for(var i=Be(e),o=i.next();!o.done;o=i.next()){var a=o.value;r.has(a)||r.set(a,[]),a.parent&&(r.has(a.parent)||r.set(a.parent,[]),r.get(a.parent).push(a))}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function uj(e,t){var n=ws([e],t);return k0(e,lp(n))}function Cs(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function cj(e){return bt([],Ge(new Set(Dt(bt([],Ge(e.map(function(t){return t.ownEvents})),!1)))),!1)}function Tc(e,t){return t.type==="compound"?Js(t).some(function(n){return n.type==="final"&&Cs(e,n)}):t.type==="parallel"?Js(t).every(function(n){return Tc(e,n)}):!1}function lj(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function sy(e){return new Set(Dt(e.map(function(t){return t.tags})))}function M0(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(We(e)||We(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return M0(e[i],t[i])})}function fj(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function dj(e,t){var n=e.exec,r=re(re({},e),{exec:n!==void 0?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0});return r}var tr=function(){function e(t){var n=this,r;this.actions=[],this.activities=ry,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||ry,this.meta=lj(t.configuration),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=(r=Array.isArray(t.tags)?new Set(t.tags):t.tags)!==null&&r!==void 0?r:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return cj(n.configuration)}})}return e.from=function(t,n){if(t instanceof e)return t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t;var r=ga;return new e({value:t,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=ga;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var r=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),We(t))return[t];var i=Object.keys(t);return i.concat.apply(i,bt([],Ge(i.map(function(o){return r.toStrings(t[o],n).map(function(a){return o+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var r=Zh(t,["configuration","transitions","tags","machine"]);return re(re({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return nv(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;Pt&&tn(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,t);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},e}(),pj={deferEvents:!1},uy=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=re(re({},pj),t)}return e.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},e.prototype.schedule=function(t){if(!this.initialized||this.processingEvent){this.queue.push(t);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},e.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},e}(),Rf=new Map,hj=0,us={bookId:function(){return"x:".concat(hj++)},register:function(e,t){return Rf.set(e,t),e},get:function(e){return Rf.get(e)},free:function(e){Rf.delete(e)}};function ov(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;Pt||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues")}function vj(){var e=ov();if(e&&"__xstate__"in e)return e.__xstate__}function mj(e){if(ov()){var t=vj();t&&t.register(e)}}function yj(e,t){t===void 0&&(t={});var n=e.initialState,r=new Set,i=[],o=!1,a=function(){if(!o){for(o=!0;i.length>0;){var c=i.shift();n=e.transition(n,c,u),r.forEach(function(l){return l.next(n)})}o=!1}},s=sj({id:t.id,send:function(c){i.push(c),a()},getSnapshot:function(){return n},subscribe:function(c,l,f){var d=xc(c,l,f);return r.add(d),d.next(n),{unsubscribe:function(){r.delete(d)}}}}),u={parent:t.parent,self:s,id:t.id||"anonymous",observers:r};return n=e.start?e.start(u):n,s}var fp={sync:!1,autoForward:!1},kt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(kt||(kt={}));var gj=function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var r=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=kt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(l,f){if(Wa(l))return r.batch(l),r.state;var d=ln(tf(l,f));if(r.status===kt.Stopped)return Pt||tn(!1,'Event "'.concat(d.name,'" was sent to stopped service "').concat(r.machine.id,`". This service has already reached its final state, and will not transition.
|
|
84
|
+
Event: `).concat(JSON.stringify(d.data))),r.state;if(r.status!==kt.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(d.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
|
|
85
|
+
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var p=r._nextState(d);r.update(p,d)}),r._state},this.sendTo=function(l,f,d){var p=r.parent&&(f===To.Parent||r.parent.id===f),h=p?r.parent:We(f)?f===To.Internal?r:r.children.get(f)||us.get(f):LM(f)?f:void 0;if(!h){if(!p)throw new Error("Unable to send event to child '".concat(f,"' from service '").concat(r.id,"'."));Pt||tn(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(l.type));return}if("machine"in h){if(r.status!==kt.Stopped||r.parent!==h||r.state.done){var v=re(re({},l),{name:l.name===$M?"".concat(Ss(r.id)):l.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,v]):h.send(v)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,l.data]):h.send(l.data)},this._exec=function(l,f,d,p){p===void 0&&(p=r.machine.options.actions);var h=l.exec||cp(l.type,p),v=tt(h)?h:h?h.exec:l.exec;if(v)try{return v(f,d.data,r.machine.config.predictableActionArguments?{action:l,_event:d}:{action:l,state:r.state,_event:d})}catch(H){throw r.parent&&r.parent.send({type:"xstate.error",data:H}),H}switch(l.type){case Cu:{var C=l;r.defer(C);break}case ef:var E=l;if(typeof E.delay=="number"){r.defer(E);return}else E.to?r.sendTo(E._event,E.to,d===ga):r.send(E._event);break;case w0:r.cancel(l.sendId);break;case ip:{if(r.status!==kt.Running)return;var y=l.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[y.id||y.type])break;if(y.type===vt.Invoke){var w=D0(y.src),x=r.machine.options.services?r.machine.options.services[w.type]:void 0,S=y.id,T=y.data;Pt||tn(!("forward"in y),"`forward` property is deprecated (found in invocation of '".concat(y.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var A="autoForward"in y?y.autoForward:!!y.forward;if(!x){Pt||tn(!1,"No service found for invocation '".concat(y.src,"' in machine '").concat(r.machine.id,"'."));return}var D=T?Qc(T,f,d):void 0;if(typeof x=="string")return;var I=tt(x)?x(f,d.data,{data:D,src:w,meta:y.meta}):x;if(!I)return;var N=void 0;ni(I)&&(I=D?I.withContext(D):I,N={autoForward:A}),r.spawn(I,S,N)}else r.spawnActivity(y);break}case ev:{r.stopChild(l.activity.id);break}case C0:var j=l,L=j.label,V=j.value;L?r.logger(L,V):r.logger(V);break;default:Pt||tn(!1,"No implementation found for action type '".concat(l.type,"'"));break}};var i=re(re({},e.defaultOptions),n),o=i.clock,a=i.logger,s=i.parent,u=i.id,c=u!==void 0?u:t.id;this.id=c,this.logger=a,this.clock=o,this.parent=s,this.options=i,this.scheduler=new uy({deferEvents:this.options.deferEvents}),this.sessionId=us.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:na(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return Pt||tn(this.status!==kt.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(t,n){var r,i;try{for(var o=Be(t.actions),a=o.next();!a.done;a=o.next()){var s=a.value;this.exec(s,t,n)}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},e.prototype.update=function(t,n){var r,i,o,a,s,u,c,l,f=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||n===ga)&&this.options.execute)this.execute(this.state);else for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);if(this.children.forEach(function(I){f.state.children[I.id]=I}),this.devTools&&this.devTools.send(n.data,t),t.event)try{for(var p=Be(this.eventListeners),h=p.next();!h.done;h=p.next()){var v=h.value;v(t.event)}}catch(I){r={error:I}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var C=Be(this.listeners),E=C.next();!E.done;E=C.next()){var v=E.value;v(t,t.event)}}catch(I){o={error:I}}finally{try{E&&!E.done&&(a=C.return)&&a.call(C)}finally{if(o)throw o.error}}try{for(var y=Be(this.contextListeners),w=y.next();!w.done;w=y.next()){var x=w.value;x(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(I){s={error:I}}finally{try{w&&!w.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}if(this.state.done){var S=t.configuration.find(function(I){return I.type==="final"&&I.parent===f.machine}),T=S&&S.doneData?Qc(S.doneData,t.context,n):void 0;this._doneEvent=Ec(this.id,T);try{for(var A=Be(this.doneListeners),D=A.next();!D.done;D=A.next()){var v=D.value;v(this._doneEvent)}}catch(I){c={error:I}}finally{try{D&&!D.done&&(l=A.return)&&l.call(A)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),us.free(this.sessionId)}},e.prototype.onTransition=function(t){return this.listeners.add(t),this.status===kt.Running&&t(this.state,this.state.event),this},e.prototype.subscribe=function(t,n,r){var i=this,o=xc(t,n,r);this.listeners.add(o.next),this.status!==kt.NotStarted&&o.next(this.state);var a=function(){i.doneListeners.delete(a),i.stopListeners.delete(a),o.complete()};return this.status===kt.Stopped?o.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){i.listeners.delete(o.next),i.doneListeners.delete(a),i.stopListeners.delete(a)}}},e.prototype.onEvent=function(t){return this.eventListeners.add(t),this},e.prototype.onSend=function(t){return this.sendListeners.add(t),this},e.prototype.onChange=function(t){return this.contextListeners.add(t),this},e.prototype.onStop=function(t){return this.stopListeners.add(t),this},e.prototype.onDone=function(t){return this.status===kt.Stopped&&this._doneEvent?t(this._doneEvent):this.doneListeners.add(t),this},e.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},e.prototype.start=function(t){var n=this;if(this.status===kt.Running)return this;this.machine._init(),us.register(this.sessionId,this),this.initialized=!0,this.status=kt.Running;var r=t===void 0?this.initialState:na(this,function(){return fj(t)?n.machine.resolveState(t):n.machine.resolveState(tr.from(t,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,ga)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(t){tt(t.stop)&&t.stop()}),this.children.clear()},e.prototype._stop=function(){var t,n,r,i,o,a,s,u,c,l;try{for(var f=Be(this.listeners),d=f.next();!d.done;d=f.next()){var p=d.value;this.listeners.delete(p)}}catch(A){t={error:A}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}try{for(var h=Be(this.stopListeners),v=h.next();!v.done;v=h.next()){var p=v.value;p(),this.stopListeners.delete(p)}}catch(A){r={error:A}}finally{try{v&&!v.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}try{for(var C=Be(this.contextListeners),E=C.next();!E.done;E=C.next()){var p=E.value;this.contextListeners.delete(p)}}catch(A){o={error:A}}finally{try{E&&!E.done&&(a=C.return)&&a.call(C)}finally{if(o)throw o.error}}try{for(var y=Be(this.doneListeners),w=y.next();!w.done;w=y.next()){var p=w.value;this.doneListeners.delete(p)}}catch(A){s={error:A}}finally{try{w&&!w.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=kt.Stopped,this._initialState=void 0;try{for(var x=Be(Object.keys(this.delayedEventsMap)),S=x.next();!S.done;S=x.next()){var T=S.value;this.clock.clearTimeout(this.delayedEventsMap[T])}}catch(A){c={error:A}}finally{try{S&&!S.done&&(l=x.return)&&l.call(x)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new uy({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var t=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r=ln({type:"xstate.stop"}),i=na(t,function(){var o=Dt(bt([],Ge(t.state.configuration),!1).sort(function(l,f){return f.order-l.order}).map(function(l){return Ei(l.onExit,t.machine.options.actions)})),a=Ge(Zc(t.machine,t.state,t.state.context,r,[{type:"exit",actions:o}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),s=a[0],u=a[1],c=new tr({value:t.state.value,context:u,_event:r,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:s.filter(function(l){return!up(l)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return c.changed=!0,c});t.update(i,r),t._stopChildren(),us.free(t.sessionId)}),this},e.prototype.batch=function(t){var n=this;if(this.status===kt.NotStarted&&this.options.deferEvents)Pt||tn(!1,"".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,`" and are deferred. Make sure .start() is called for this service.
|
|
86
|
+
Event: `).concat(JSON.stringify(event)));else if(this.status!==kt.Running)throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(t.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,a=n.state,s=!1,u=[],c=function(p){var h=ln(p);n.forward(h),a=na(n,function(){return n.machine.transition(a,h,void 0,r||void 0)}),u.push.apply(u,bt([],Ge(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return dj(v,a)})),!1)),s=s||!!a.changed};try{for(var l=Be(t),f=l.next();!f.done;f=l.next()){var d=f.value;c(d)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,ln(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=ln(t);if(i.name.indexOf(ny)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(ny)===0}))throw i.data.data;var o=na(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},e.prototype.nextState=function(t){return this._nextState(t,!1)},e.prototype.forward=function(t){var n,r;try{for(var i=Be(this.forwardTo),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));s.send(t)}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.defer=function(t){var n=this,r=this.clock.setTimeout(function(){"to"in t&&t.to?n.sendTo(t._event,t.to,!0):n.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=r)},e.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},e.prototype.exec=function(t,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(t,n.context,n._event,r)},e.prototype.removeChild=function(t){var n;this.children.delete(t),this.forwardTo.delete(t),(n=this.state)===null||n===void 0||delete n.children[t]},e.prototype.stopChild=function(t){var n=this.children.get(t);n&&(this.removeChild(t),tt(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==kt.Running)return iv(t,n);if(oy(t))return this.spawnPromise(Promise.resolve(t),n);if(tt(t))return this.spawnCallback(t,n);if(aj(t))return this.spawnActor(t,n);if(FM(t))return this.spawnObservable(t,n);if(ni(t))return this.spawnMachine(t,re(re({},r),{id:n}));if(jM(t))return this.spawnBehavior(t,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof t,'".'))},e.prototype.spawnMachine=function(t,n){var r=this;n===void 0&&(n={});var i=new e(t,re(re({},this.options),{parent:this,id:n.id||t.id})),o=re(re({},fp),n);o.sync&&i.onTransition(function(s){r.send(x0,{state:s,id:i.id})});var a=i;return this.children.set(i.id,a),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(s){r.removeChild(i.id),r.send(ln(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=yj(t,{id:n,parent:this});return this.children.set(n,r),r},e.prototype.spawnPromise=function(t,n){var r,i=this,o=!1,a;t.then(function(u){o||(a=u,i.removeChild(n),i.send(ln(Ec(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var c=Ss(n,u);try{i.send(ln(c,{origin:n}))}catch(l){UM(u,l,n),i.devTools&&i.devTools.send(c,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,c,l){var f=xc(u,c,l),d=!1;return t.then(function(p){d||(f.next(p),!d&&f.complete())},function(p){d||f.error(p)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[xi]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnCallback=function(t,n){var r,i=this,o=!1,a=new Set,s=new Set,u,c=function(d){u=d,s.forEach(function(p){return p(d)}),!o&&i.send(ln(d,{origin:n}))},l;try{l=t(c,function(d){a.add(d)})}catch(d){this.send(Ss(n,d))}if(oy(l))return this.spawnPromise(l,n);var f=(r={id:n,send:function(d){return a.forEach(function(p){return p(d)})},subscribe:function(d){var p=xc(d);return s.add(p.next),{unsubscribe:function(){s.delete(p.next)}}},stop:function(){o=!0,tt(l)&&l()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[xi]=function(){return this},r);return this.children.set(n,f),f},e.prototype.spawnObservable=function(t,n){var r,i=this,o,a=t.subscribe(function(u){o=u,i.send(ln(u,{origin:n}))},function(u){i.removeChild(n),i.send(ln(Ss(n,u),{origin:n}))},function(){i.removeChild(n),i.send(ln(Ec(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,c,l){return t.subscribe(u,c,l)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[xi]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnActor=function(t,n){return this.children.set(n,t),t},e.prototype.spawnActivity=function(t){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(!n){Pt||tn(!1,"No implementation found for activity '".concat(t.type,"'"));return}var r=n(this.state.context,t);this.spawnEffect(t.id,r)},e.prototype.spawnEffect=function(t,n){var r;this.children.set(t,(r={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}},r[xi]=function(){return this},r))},e.prototype.attachDev=function(){var t=ov();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(re(re({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:re({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}mj(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[xi]=function(){return this},e.prototype.getSnapshot=function(){return this.status===kt.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,n){return setTimeout(t,n)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},e.interpret=j0,e}(),bj=function(e){return We(e)?re(re({},fp),{name:e}):re(re(re({},fp),{name:BM()}),e)};function cy(e,t){var n=bj(t);return rj(function(r){if(!Pt){var i=ni(e)||tt(e);tn(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(ni(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):iv(e,n.name)})}function j0(e,t){var n=new gj(e,t);return n}function Sj(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function Hu(e){return re(re({type:op},e),{toJSON:function(){e.onDone,e.onError;var t=Zh(e,["onDone","onError"]);return re(re({},t),{type:op,src:Sj(e.src)})}})}var ra="",dp="#",cs="*",Ko={},Yo=function(e){return e[0]===dp},wj=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},Cj=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(We(o.target)||ni(o.target))}),i=t===ra?"the transient event":"event '".concat(t,"'");tn(!r,"One or more transitions for ".concat(i," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},xj=function(){function e(t,n,r,i){r===void 0&&(r="context"in t?t.context:void 0);var o=this,a;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(wj(),n),this.parent=i==null?void 0:i.parent,this.key=this.config.key||(i==null?void 0:i.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:E0),this.id=this.config.id||bt([this.machine.key],Ge(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,Pt||tn(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?bs(this.config.states,function(c,l){var f,d=new e(c,{},void 0,{parent:o,key:l});return Object.assign(o.idMap,re((f={},f[d.id]=d,f),d.idMap)),d}):Ko;var s=0;function u(c){var l,f;c.order=s++;try{for(var d=Be(P0(c)),p=d.next();!p.done;p=d.next()){var h=p.value;u(h)}}catch(v){l={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}finally{if(l)throw l.error}}}u(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(c){var l=c.event;return l===ra}):ra in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=hr(this.config.entry||this.config.onEntry).map(function(c){return Xs(c)}),this.onExit=hr(this.config.exit||this.config.onExit).map(function(c){return Xs(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=hr(this.config.invoke).map(function(c,l){var f,d;if(ni(c)){var p=zu(o.id,l);return o.machine.options.services=re((f={},f[p]=c,f),o.machine.options.services),Hu({src:p,id:p})}else if(We(c.src)){var p=c.id||zu(o.id,l);return Hu(re(re({},c),{id:p,src:c.src}))}else if(ni(c.src)||tt(c.src)){var p=c.id||zu(o.id,l);return o.machine.options.services=re((d={},d[p]=c.src,d),o.machine.options.services),Hu(re(re({id:p},c),{src:p}))}else{var h=c.src;return Hu(re(re({id:zu(o.id,l)},c),{src:h}))}}),this.activities=hr(this.config.activities).concat(this.invoke).map(function(c){return rv(c)}),this.transition=this.transition.bind(this),this.tags=hr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||R0(this).forEach(function(t){return t.on})},e.prototype.withConfig=function(t,n){var r=this.options,i=r.actions,o=r.activities,a=r.guards,s=r.services,u=r.delays;return new e(this.config,{actions:re(re({},i),t.actions),activities:re(re({},o),t.activities),guards:re(re({},a),t.guards),services:re(re({},s),t.services),delays:re(re({},u),t.delays)},n??this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return tt(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:bs(this.states,function(t){return t.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var n=t===ra,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===cs});return this.__cache.candidates[t]=r,r},e.prototype.getDelayedTransitions=function(){var t=this,n=this.config.after;if(!n)return[];var r=function(o,a){var s=tt(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=ej(s,t.id);return t.onEntry.push(nf(u,{delay:o})),t.onExit.push(YM(u)),u},i=Wa(n)?n.map(function(o,a){var s=r(o.delay,a);return re(re({},o),{event:s})}):Dt(Object.keys(n).map(function(o,a){var s=n[o],u=We(s)?{target:s}:s,c=isNaN(+o)?o:+o,l=r(c,a);return hr(u).map(function(f){return re(re({},f),{event:l,delay:c})})}));return i.map(function(o){var a=o.delay;return re(re({},t.formatTransition(o)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,r=this;if(!t)return[];var i=t instanceof tr?t.value:Ds(t,this.delimiter);if(We(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var a=Object.keys(i),s=[this];return s.push.apply(s,bt([],Ge(Dt(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=T0(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof tr?t:tr.create(t),r=Array.from(ws([],this.getStateNodes(n.value)));return new tr(re(re({},n),{value:this.resolve(n.value),configuration:r,done:Tc(r,this),tags:sy(r),machine:this.machine}))},e.prototype.transitionLeafNode=function(t,n,r){var i=this.getStateNode(t),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},e.prototype.transitionCompoundNode=function(t,n,r){var i=Object.keys(t),o=this.getStateNode(i[0]),a=o._transition(t[i[0]],n,r);return!a||!a.transitions.length?this.next(n,r):a},e.prototype.transitionParallelNode=function(t,n,r){var i,o,a={};try{for(var s=Be(Object.keys(t)),u=s.next();!u.done;u=s.next()){var c=u.value,l=t[c];if(l){var f=this.getStateNode(c),d=f._transition(l,n,r);d&&(a[c]=d)}}}catch(E){i={error:E}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var p=Object.keys(a).map(function(E){return a[E]}),h=Dt(p.map(function(E){return E.transitions})),v=p.some(function(E){return E.transitions.length>0});if(!v)return this.next(n,r);var C=Dt(Object.keys(a).map(function(E){return a[E].configuration}));return{transitions:h,exitSet:Dt(p.map(function(E){return E.exitSet})),configuration:C,source:n,actions:Dt(Object.keys(a).map(function(E){return a[E].actions}))}},e.prototype._transition=function(t,n,r){return We(t)?this.transitionLeafNode(t,n,r):Object.keys(t).length===1?this.transitionCompoundNode(t,n,r):this.transitionParallelNode(t,n,r)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,ln(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],c;try{for(var l=Be(this.getCandidates(a)),f=l.next();!f.done;f=l.next()){var d=f.value,p=d.cond,h=d.in,v=t.context,C=h?We(h)&&Yo(h)?t.matches(Ds(this.getStateNodeById(h).path,this.delimiter)):nv(Ds(h,this.delimiter),RM(this.path.slice(0,-2))(t.value)):!0,E=!1;try{E=!p||O0(this.machine,p,v,n,t)}catch(x){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
87
|
+
`).concat(x.message))}if(E&&C){d.target!==void 0&&(u=d.target),s.push.apply(s,bt([],Ge(d.actions),!1)),c=d;break}}}catch(x){r={error:x}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}if(c){if(!u.length)return{transitions:[c],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var y=Dt(u.map(function(x){return o.getRelativeStateNodes(x,t.historyValue)})),w=!!c.internal;return{transitions:[c],exitSet:w?[]:Dt(u.map(function(x){return o.getPotentiallyReenteringNodes(x)})),configuration:y,source:t,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var n=[],r=this,i=t;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},e.prototype.getActions=function(t,n,r,i,o,a,s){var u,c,l,f,d=this,p=a?ws([],this.getStateNodes(a.value)):[],h=new Set;try{for(var v=Be(Array.from(t).sort(function(j,L){return j.order-L.order})),C=v.next();!C.done;C=v.next()){var E=C.value;(!Cs(p,E)||Cs(r.exitSet,E)||E.parent&&h.has(E.parent))&&h.add(E)}}catch(j){u={error:j}}finally{try{C&&!C.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}try{for(var y=Be(p),w=y.next();!w.done;w=y.next()){var E=w.value;(!Cs(t,E)||Cs(r.exitSet,E.parent))&&r.exitSet.push(E)}}catch(j){l={error:j}}finally{try{w&&!w.done&&(f=y.return)&&f.call(y)}finally{if(l)throw l.error}}r.exitSet.sort(function(j,L){return L.order-j.order});var x=Array.from(h).sort(function(j,L){return j.order-L.order}),S=new Set(r.exitSet),T=Dt(x.map(function(j){var L=[];if(j.type!=="final")return L;var V=j.parent;if(!V.parent)return L;L.push(Wu(j.id,j.doneData),Wu(V.id,j.doneData?Qc(j.doneData,i,o):void 0));var H=V.parent;return H.type==="parallel"&&Js(H).every(function(R){return Tc(r.configuration,R)})&&L.push(Wu(H.id)),L})),A=x.map(function(j){var L=j.onEntry,V=j.activities.map(function(H){return XM(H)});return{type:"entry",actions:Ei(s?bt(bt([],Ge(L),!1),Ge(V),!1):bt(bt([],Ge(V),!1),Ge(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:T.map(function(j){return GM(j)})}),D=Array.from(S).map(function(j){return{type:"exit",actions:Ei(bt(bt([],Ge(j.onExit),!1),Ge(j.activities.map(function(L){return JM(L)})),!1),d.machine.options.actions)}}),I=D.concat({type:"transition",actions:Ei(r.actions,this.machine.options.actions)}).concat(A);if(n){var N=Ei(Dt(bt([],Ge(t),!1).sort(function(j,L){return L.order-j.order}).map(function(j){return j.onExit})),this.machine.options.actions).filter(function(j){return!up(j)});return I.concat({type:"stop",actions:N})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=ln(n),a;if(t instanceof tr)a=r===void 0?t:this.resolveState(tr.from(t,r));else{var s=We(t)?this.resolve(Jc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(tr.from(s,u))}if(!Pt&&o.name===cs)throw new Error("An event cannot have the wildcard type ('".concat(cs,"')"));if(this.strict&&!this.events.includes(o.name)&&!MM(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},l=ws([],this.getStateNodes(a.value)),f=c.configuration.length?ws(l,c.configuration):l;return c.configuration=bt([],Ge(f),!1),this.resolveTransition(c,a,a.context,i,o)},e.prototype.resolveRaisedTransition=function(t,n,r,i){var o,a=t.actions;return t=this.transition(t,n,void 0,i),t._event=r,t.event=r.data,(o=t.actions).unshift.apply(o,bt([],Ge(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,c,l=this;o===void 0&&(o=ga);var f=t.configuration,d=!n||t.transitions.length>0,p=d?t.configuration:n?n.configuration:[],h=Tc(p,this),v=d?uj(this.machine,f):void 0,C=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,E=this.getActions(new Set(p),h,t,r,o,n,i),y=n?re({},n.activities):{};try{for(var w=Be(E),x=w.next();!x.done;x=w.next()){var S=x.value;try{for(var T=(u=void 0,Be(S.actions)),A=T.next();!A.done;A=T.next()){var D=A.value;D.type===ip?y[D.activity.id||D.activity.type]=D:D.type===ev&&(y[D.activity.id||D.activity.type]=!1)}}catch(K){u={error:K}}finally{try{A&&!A.done&&(c=T.return)&&c.call(T)}finally{if(u)throw u.error}}}}catch(K){a={error:K}}finally{try{x&&!x.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}var I=Ge(Zc(this,n,r,o,E,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),N=I[0],j=I[1],L=Ge(_M(N,up),2),V=L[0],H=L[1],R=N.filter(function(K){var ae;return K.type===ip&&((ae=K.activity)===null||ae===void 0?void 0:ae.type)===op}),ie=R.reduce(function(K,ae){return K[ae.activity.id]=ij(ae.activity,l.machine,j,o),K},n?re({},n.children):{}),B=new tr({value:v||n.value,context:j,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?C?qM(C,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?H:[],activities:v?y:n?n.activities:{},events:[],configuration:p,transitions:t.transitions,children:ie,done:h,tags:sy(p),machine:this}),U=r!==j;B.changed=o.name===x0||U;var fe=B.history;fe&&delete fe.history;var M=!h&&(this._transient||f.some(function(K){return K._transient}));if(!d&&(!M||o.name===ra))return B;var P=B;if(!h)for(M&&(P=this.resolveRaisedTransition(P,{type:IM},o,i));V.length;){var te=V.shift();P=this.resolveRaisedTransition(P,te._event,o,i)}var oe=P.changed||(fe?!!P.actions.length||U||typeof fe.value!=typeof P.value||!M0(P.value,fe.value):void 0);return P.changed=oe,P.history=fe,P},e.prototype.getStateNode=function(t){if(Yo(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[t];if(!n)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return n},e.prototype.getStateNodeById=function(t){var n=Yo(t)?t.slice(dp.length):t;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},e.prototype.getStateNodeByPath=function(t){if(typeof t=="string"&&Yo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=sp(t,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},e.prototype.resolve=function(t){var n,r=this;if(!t)return this.initialStateValue||Ko;switch(this.type){case"parallel":return bs(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):Ko});case"compound":if(We(t)){var i=this.getStateNode(t);return i.type==="parallel"||i.type==="compound"?(n={},n[t]=i.initialStateValue,n):t}return Object.keys(t).length?bs(t,function(o,a){return o?r.getStateNode(a).resolve(o):Ko}):this.initialStateValue||{};default:return t||Ko}},e.prototype.getResolvedPath=function(t){if(Yo(t)){var n=this.machine.idMap[t.slice(dp.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return sp(t,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=iy(this.states,function(r){return r.initialStateValue||Ko},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=tl(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;We(n.target)?t=Yo(n.target)?Jc(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:t=n.target}return t},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(t,n,r){return r===void 0&&(r=!0),r?t.type==="history"?t.resolveHistory(n):t.initialStateNodes:[t]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var t=this;if(tl(this))return[this];if(this.type==="compound"&&!this.initial)return Pt||tn(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=Cc(this.initialStateValue);return Dt(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=Ge(t),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(i)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:iy(this.states,function(n,r){if(!t)return n.historyValue();var i=We(t)?void 0:t[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!t){var i=this.target;return i?Dt(Cc(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=kM(r.path,"states")(t).current;return We(o)?[r.getStateNode(o)]:Dt(Cc(o).map(function(a){return n.history==="deep"?r.getFromRelativePath(a):[r.states[a[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var t=this,n=Dt(Object.keys(this.states).map(function(r){return t.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var t,n,r,i;if(this.__cache.events)return this.__cache.events;var o=this.states,a=new Set(this.ownEvents);if(o)try{for(var s=Be(Object.keys(o)),u=s.next();!u.done;u=s.next()){var c=u.value,l=o[c];if(l.states)try{for(var f=(r=void 0,Be(l.events)),d=f.next();!d.done;d=f.next()){var p=d.value;a.add("".concat(p))}}catch(h){r={error:h}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(h){t={error:h}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(r){if(!We(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var a=n.parent.getStateNodeByPath(o);return a}catch(s){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
88
|
+
`).concat(s.message))}else return n.getStateNodeByPath(o)})},e.prototype.formatTransition=function(t){var n=this,r=VM(t.target),i="internal"in t?t.internal:r?r.some(function(u){return We(u)&&u[0]===n.delimiter}):!0,o=this.machine.options.guards,a=this.resolveTarget(r),s=re(re({},t),{actions:Ei(hr(t.actions)),cond:$0(t.cond,o),target:a,source:this,internal:i,eventType:t.event,toJSON:function(){return re(re({},s),{target:s.target?s.target.map(function(u){return"#".concat(u.id)}):void 0,source:"#".concat(n.id)})}});return s},e.prototype.formatTransitions=function(){var t,n,r=this,i;if(!this.config.on)i=[];else if(Array.isArray(this.config.on))i=this.config.on;else{var o=this.config.on,a=cs,s=o[a],u=s===void 0?[]:s,c=Zh(o,[typeof a=="symbol"?a:a+""]);i=Dt(Object.keys(c).map(function(y){!Pt&&y===ra&&tn(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(r.id,'".'));var w=Ho(y,c[y]);return Pt||Cj(r,y,w),w}).concat(Ho(cs,u)))}var l=this.config.always?Ho("",this.config.always):[],f=this.config.onDone?Ho(String(Wu(this.id)),this.config.onDone):[];Pt||tn(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var d=Dt(this.invoke.map(function(y){var w=[];return y.onDone&&w.push.apply(w,bt([],Ge(Ho(String(Ec(y.id)),y.onDone)),!1)),y.onError&&w.push.apply(w,bt([],Ge(Ho(String(Ss(y.id)),y.onError)),!1)),w})),p=this.after,h=Dt(bt(bt(bt(bt([],Ge(f),!1),Ge(d),!1),Ge(i),!1),Ge(l),!1).map(function(y){return hr(y).map(function(w){return r.formatTransition(w)})}));try{for(var v=Be(p),C=v.next();!C.done;C=v.next()){var E=C.value;h.push(E)}}catch(y){t={error:y}}finally{try{C&&!C.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}return h},e}(),ly=!1;function av(e,t){return!Pt&&!("predictableActionArguments"in e)&&!ly&&(ly=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new xj(e,t)}var Rn=ZM,Ej=nf,_0=HM,Ku=tj,rt={},sv={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});/*! *****************************************************************************
|
|
89
89
|
Copyright (c) Microsoft Corporation.
|
|
90
90
|
|
|
91
91
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -98,7 +98,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==ct.Running)throw
|
|
|
98
98
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
99
99
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
100
100
|
PERFORMANCE OF THIS SOFTWARE.
|
|
101
|
-
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var u,s=1,c=arguments.length;s<c;s++){u=arguments[s];for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&(a[l]=u[l])}return a},e.__assign.apply(this,arguments)};function t(o,a){var u={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&a.indexOf(s)<0&&(u[s]=o[s]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,s=Object.getOwnPropertySymbols(o);c<s.length;c++)a.indexOf(s[c])<0&&Object.prototype.propertyIsEnumerable.call(o,s[c])&&(u[s[c]]=o[s[c]]);return u}function n(o){var a=typeof Symbol=="function"&&Symbol.iterator,u=a&&o[a],s=0;if(u)return u.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&s>=o.length&&(o=void 0),{value:o&&o[s++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(o,a){var u=typeof Symbol=="function"&&o[Symbol.iterator];if(!u)return o;var s=u.call(o),c,l=[],f;try{for(;(a===void 0||a-- >0)&&!(c=s.next()).done;)l.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(u=s.return)&&u.call(s)}finally{if(f)throw f.error}}return l}function r(o,a,u){if(u||arguments.length===2)for(var s=0,c=a.length,l;s<c;s++)(l||!(s in a))&&(l||(l=Array.prototype.slice.call(a,0,s)),l[s]=a[s]);return o.concat(l||Array.prototype.slice.call(a))}e.__read=i,e.__rest=t,e.__spreadArray=r,e.__values=n})(_d);var Au={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ActionTypes=void 0,function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"}(e.ActionTypes||(e.ActionTypes={})),e.SpecialTargets=void 0,function(t){t.Parent="#_parent",t.Internal="#_internal"}(e.SpecialTargets||(e.SpecialTargets={}))})(Au);var mt={};Object.defineProperty(mt,"__esModule",{value:!0});var Rt=Au,V1=Rt.ActionTypes.Start,F1=Rt.ActionTypes.Stop,L1=Rt.ActionTypes.Raise,G1=Rt.ActionTypes.Send,z1=Rt.ActionTypes.Cancel,W1=Rt.ActionTypes.NullEvent,H1=Rt.ActionTypes.Assign,K1=Rt.ActionTypes.After,J1=Rt.ActionTypes.DoneState,Y1=Rt.ActionTypes.Log,X1=Rt.ActionTypes.Init,Q1=Rt.ActionTypes.Invoke,Z1=Rt.ActionTypes.ErrorExecution,eD=Rt.ActionTypes.ErrorPlatform,tD=Rt.ActionTypes.ErrorCustom,nD=Rt.ActionTypes.Update,iD=Rt.ActionTypes.Choose,rD=Rt.ActionTypes.Pure;mt.after=K1;mt.assign=H1;mt.cancel=z1;mt.choose=iD;mt.doneState=J1;mt.error=tD;mt.errorExecution=Z1;mt.errorPlatform=eD;mt.init=X1;mt.invoke=Q1;mt.log=Y1;mt.nullEvent=W1;mt.pure=rD;mt.raise=L1;mt.send=G1;mt.start=V1;mt.stop=F1;mt.update=nD;var Yy={},xo={};Object.defineProperty(xo,"__esModule",{value:!0});var oD=".",aD={},sD="xstate.guard",uD="";xo.DEFAULT_GUARD_TYPE=sD;xo.EMPTY_ACTIVITY_MAP=aD;xo.STATE_DELIMITER=oD;xo.TARGETLESS_KEY=uD;var Du={};Object.defineProperty(Du,"__esModule",{value:!0});var cD=process.env.NODE_ENV==="production";Du.IS_PRODUCTION=cD;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=_d,n=Au,i=mt,r=xo,o=Du,a;function u(y){return Object.keys(y)}function s(y,D,N){N===void 0&&(N=r.STATE_DELIMITER);var O=p(y,N),k=p(D,N);return Q(k)?Q(O)?k===O:!1:Q(O)?O in k:Object.keys(O).every(function(B){return B in k?s(O[B],k[B]):!1})}function c(y){try{return Q(y)||typeof y=="number"?"".concat(y):y.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function l(y){try{return Q(y)||typeof y=="number"?"".concat(y):Z(y)?y.name:y.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(y,D){try{return we(y)?y:y.toString().split(D)}catch{throw new Error("'".concat(y,"' is not a valid state path."))}}function d(y){return typeof y=="object"&&"value"in y&&"context"in y&&"event"in y&&"_event"in y}function p(y,D){if(d(y))return y.value;if(we(y))return h(y);if(typeof y!="string")return y;var N=f(y,D);return h(N)}function h(y){if(y.length===1)return y[0];for(var D={},N=D,O=0;O<y.length-1;O++)O===y.length-2?N[y[O]]=y[O+1]:(N[y[O]]={},N=N[y[O]]);return D}function v(y,D){for(var N={},O=Object.keys(y),k=0;k<O.length;k++){var B=O[k];N[B]=D(y[B],B,y,k)}return N}function w(y,D,N){var O,k,B={};try{for(var J=t.__values(Object.keys(y)),H=J.next();!H.done;H=J.next()){var oe=H.value,fe=y[oe];N(fe)&&(B[oe]=D(fe,oe,y))}}catch(ht){O={error:ht}}finally{try{H&&!H.done&&(k=J.return)&&k.call(J)}finally{if(O)throw O.error}}return B}var C=function(y){return function(D){var N,O,k=D;try{for(var B=t.__values(y),J=B.next();!J.done;J=B.next()){var H=J.value;k=k[H]}}catch(oe){N={error:oe}}finally{try{J&&!J.done&&(O=B.return)&&O.call(B)}finally{if(N)throw N.error}}return k}};function S(y,D){return function(N){var O,k,B=N;try{for(var J=t.__values(y),H=J.next();!H.done;H=J.next()){var oe=H.value;B=B[D][oe]}}catch(fe){O={error:fe}}finally{try{H&&!H.done&&(k=J.return)&&k.call(J)}finally{if(O)throw O.error}}return B}}function T(y){if(!y)return[[]];if(Q(y))return[[y]];var D=x(Object.keys(y).map(function(N){var O=y[N];return typeof O!="string"&&(!O||!Object.keys(O).length)?[[N]]:T(y[N]).map(function(k){return[N].concat(k)})}));return D}function I(y){var D,N,O={};if(y&&y.length===1&&y[0].length===1)return y[0][0];try{for(var k=t.__values(y),B=k.next();!B.done;B=k.next())for(var J=B.value,H=O,oe=0;oe<J.length;oe++){var fe=J[oe];if(oe===J.length-2){H[fe]=J[oe+1];break}H[fe]=H[fe]||{},H=H[fe]}}catch(ht){D={error:ht}}finally{try{B&&!B.done&&(N=k.return)&&N.call(k)}finally{if(D)throw D.error}}return O}function x(y){var D;return(D=[]).concat.apply(D,t.__spreadArray([],t.__read(y),!1))}function b(y){return we(y)?y:[y]}function E(y){return y===void 0?[]:b(y)}function P(y,D,N){var O,k;if(Z(y))return y(D,N.data);var B={};try{for(var J=t.__values(Object.keys(y)),H=J.next();!H.done;H=J.next()){var oe=H.value,fe=y[oe];Z(fe)?B[oe]=fe(D,N.data):B[oe]=fe}}catch(ht){O={error:ht}}finally{try{H&&!H.done&&(k=J.return)&&k.call(J)}finally{if(O)throw O.error}}return B}function $(y){return/^(done|error)\./.test(y)}function L(y){return!!(y instanceof Promise||y!==null&&(Z(y)||typeof y=="object")&&Z(y.then))}function R(y){return y!==null&&typeof y=="object"&&"transition"in y&&typeof y.transition=="function"}function A(y,D){var N,O,k=t.__read([[],[]],2),B=k[0],J=k[1];try{for(var H=t.__values(y),oe=H.next();!oe.done;oe=H.next()){var fe=oe.value;D(fe)?B.push(fe):J.push(fe)}}catch(ht){N={error:ht}}finally{try{oe&&!oe.done&&(O=H.return)&&O.call(H)}finally{if(N)throw N.error}}return[B,J]}function K(y,D){return v(y.states,function(N,O){if(N){var k=(Q(D)?void 0:D[O])||(N?N.current:void 0);if(k)return{current:k,states:K(N,k)}}})}function re(y,D){return{current:D,states:K(y,D)}}function ze(y,D,N,O){o.IS_PRODUCTION||e.warn(!!y,"Attempting to update undefined context");var k=y&&N.reduce(function(B,J){var H,oe,fe=J.assignment,ht={state:O,action:J,_event:D},Xi={};if(Z(fe))Xi=fe(B,D.data,ht);else try{for(var si=t.__values(Object.keys(fe)),kn=si.next();!kn.done;kn=si.next()){var No=kn.value,Qi=fe[No];Xi[No]=Z(Qi)?Qi(B,D.data,ht):Qi}}catch(Wu){H={error:Wu}}finally{try{kn&&!kn.done&&(oe=si.return)&&oe.call(si)}finally{if(H)throw H.error}}return Object.assign({},B,Xi)},y);return k}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(y,D){var N=y instanceof Error?y:void 0;if(!(!N&&y)&&console!==void 0){var O=["Warning: ".concat(D)];N&&O.push(N),console.warn.apply(console,O)}});function we(y){return Array.isArray(y)}function Z(y){return typeof y=="function"}function Q(y){return typeof y=="string"}function de(y,D){if(y)return Q(y)?{type:r.DEFAULT_GUARD_TYPE,name:y,predicate:D?D[y]:void 0}:Z(y)?{type:r.DEFAULT_GUARD_TYPE,name:y.name,predicate:y}:y}function _t(y){try{return"subscribe"in y&&Z(y.subscribe)}catch{return!1}}var ae=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),jt=(a={},a[ae]=function(){return this},a[Symbol.observable]=function(){return this},a);function rn(y){return!!y&&"__xstatenode"in y}function Pe(y){return!!y&&typeof y.send=="function"}var it=function(){var y=0;return function(){return y++,y.toString(16)}}();function Kn(y,D){return Q(y)||typeof y=="number"?t.__assign({type:y},D):y}function Jn(y,D){if(!Q(y)&&"$$type"in y&&y.$$type==="scxml")return y;var N=Kn(y);return t.__assign({name:N.type,data:N,$$type:"scxml",type:"external"},D)}function qn(y,D){var N=b(D).map(function(O){return typeof O>"u"||typeof O=="string"||rn(O)?{target:O,event:y}:t.__assign(t.__assign({},O),{event:y})});return N}function Yi(y){if(!(y===void 0||y===r.TARGETLESS_KEY))return E(y)}function $i(y,D,N){if(!o.IS_PRODUCTION){var O=y.stack?" Stacktrace was '".concat(y.stack,"'"):"";if(y===D)console.error("Missing onError handler for invocation '".concat(N,"', error was '").concat(y,"'.").concat(O));else{var k=D.stack?" Stacktrace was '".concat(D.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(N,"'. ")+"Original error: '".concat(y,"'. ").concat(O," Current error is '").concat(D,"'.").concat(k))}}}function In(y,D,N,O,k){var B=y.options.guards,J={state:k,cond:D,_event:O};if(D.type===r.DEFAULT_GUARD_TYPE)return((B==null?void 0:B[D.name])||D.predicate)(N,O.data,J);var H=B==null?void 0:B[D.type];if(!H)throw new Error("Guard '".concat(D.type,"' is not implemented on machine '").concat(y.id,"'."));return H(N,O.data,J)}function Fu(y){return typeof y=="string"?{type:y}:y}function Lu(y,D,N){var O=function(){},k=typeof y=="object",B=k?y:null;return{next:((k?y.next:y)||O).bind(B),error:((k?y.error:D)||O).bind(B),complete:((k?y.complete:N)||O).bind(B)}}function Gu(y,D){return"".concat(y,":invocation[").concat(D,"]")}function zu(y){return(y.type===i.raise||y.type===i.send&&y.to===n.SpecialTargets.Internal)&&typeof y.delay!="number"}e.createInvokeId=Gu,e.evaluateGuard=In,e.flatten=x,e.getActionType=l,e.getEventType=c,e.interopSymbols=jt,e.isActor=Pe,e.isArray=we,e.isBehavior=R,e.isBuiltInEvent=$,e.isFunction=Z,e.isMachine=rn,e.isObservable=_t,e.isPromiseLike=L,e.isRaisableAction=zu,e.isStateLike=d,e.isString=Q,e.keys=u,e.mapContext=P,e.mapFilterValues=w,e.mapValues=v,e.matchesState=s,e.nestedPath=S,e.normalizeTarget=Yi,e.partition=A,e.path=C,e.pathToStateValue=h,e.pathsToStateValue=I,e.reportUnhandledExceptionOnInvocation=$i,e.symbolObservable=ae,e.toArray=E,e.toArrayStrict=b,e.toEventObject=Kn,e.toGuard=de,e.toInvokeSource=Fu,e.toObserver=Lu,e.toSCXMLEvent=Jn,e.toStatePath=f,e.toStatePaths=T,e.toStateValue=p,e.toTransitionConfigArray=qn,e.uniqueId=it,e.updateContext=ze,e.updateHistoryStates=K,e.updateHistoryValue=re})(Yy);Object.defineProperty(ke,"__esModule",{value:!0});var Ne=_d,jn=Au,Pt=mt,Ce=Yy,Xy=Du,lD=Ce.toSCXMLEvent({type:Pt.init});function ml(e,t){return t&&t[e]||void 0}function Ou(e,t){var n;if(Ce.isString(e)||typeof e=="number"){var i=ml(e,t);Ce.isFunction(i)?n={type:e,exec:i}:i?n=i:n={type:e,exec:void 0}}else if(Ce.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var i=ml(e.type,t);if(Ce.isFunction(i))n=Ne.__assign(Ne.__assign({},e),{exec:i});else if(i){var r=i.type||e.type;n=Ne.__assign(Ne.__assign(Ne.__assign({},i),e),{type:r})}else n=e}return n}var gl=function(e,t){if(!e)return[];var n=Ce.isArray(e)?e:[e];return n.map(function(i){return Ou(i,t)})};function jd(e){var t=Ou(e);return Ne.__assign(Ne.__assign({id:Ce.isString(e)?e:t.id},t),{type:t.type})}function dD(e,t){return{type:Pt.raise,event:typeof e=="function"?e:Ce.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function Qy(e,t,n,i){var r={_event:n},o=Ce.toSCXMLEvent(Ce.isFunction(e.event)?e.event(t,n.data,r):e.event),a;if(Ce.isString(e.delay)){var u=i&&i[e.delay];a=Ce.isFunction(u)?u(t,n.data,r):u}else a=Ce.isFunction(e.delay)?e.delay(t,n.data,r):e.delay;return Ne.__assign(Ne.__assign({},e),{type:Pt.raise,_event:o,delay:a})}function ka(e,t){return{to:t?t.to:void 0,type:Pt.send,event:Ce.isFunction(e)?e:Ce.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Ce.isFunction(e)?e.name:Ce.getEventType(e)}}function Zy(e,t,n,i){var r={_event:n},o=Ce.toSCXMLEvent(Ce.isFunction(e.event)?e.event(t,n.data,r):e.event),a;if(Ce.isString(e.delay)){var u=i&&i[e.delay];a=Ce.isFunction(u)?u(t,n.data,r):u}else a=Ce.isFunction(e.delay)?e.delay(t,n.data,r):e.delay;var s=Ce.isFunction(e.to)?e.to(t,n.data,r):e.to;return Ne.__assign(Ne.__assign({},e),{to:s,_event:o,event:o.data,delay:a})}function qd(e,t){return ka(e,Ne.__assign(Ne.__assign({},t),{to:jn.SpecialTargets.Parent}))}function fD(e,t,n){return ka(t,Ne.__assign(Ne.__assign({},n),{to:e}))}function pD(){return qd(Pt.update)}function hD(e,t){return ka(e,Ne.__assign(Ne.__assign({},t),{to:function(n,i,r){var o=r._event;return o.origin}}))}var vD=function(e,t){return{context:e,event:t}};function yD(e,t){return e===void 0&&(e=vD),{type:Pt.log,label:t,expr:e}}var em=function(e,t,n){return Ne.__assign(Ne.__assign({},e),{value:Ce.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},mD=function(e){return{type:Pt.cancel,sendId:e}};function gD(e){var t=jd(e);return{type:jn.ActionTypes.Start,activity:t,exec:void 0}}function bD(e){var t=Ce.isFunction(e)?e:jd(e);return{type:jn.ActionTypes.Stop,activity:t,exec:void 0}}function tm(e,t,n){var i=Ce.isFunction(e.activity)?e.activity(t,n.data):e.activity,r=typeof i=="string"?{id:i}:i,o={type:jn.ActionTypes.Stop,activity:r};return o}var SD=function(e){return{type:Pt.assign,assignment:e}};function CD(e){return typeof e=="object"&&"type"in e}function wD(e,t){var n=t?"#".concat(t):"";return"".concat(jn.ActionTypes.After,"(").concat(e,")").concat(n)}function TD(e,t){var n="".concat(jn.ActionTypes.DoneState,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function ID(e,t){var n="".concat(jn.ActionTypes.DoneInvoke,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function ED(e,t){var n="".concat(jn.ActionTypes.ErrorPlatform,".").concat(e),i={type:n,data:t};return i.toString=function(){return n},i}function xD(e){return{type:jn.ActionTypes.Pure,get:e}}function $D(e,t){if(!Xy.IS_PRODUCTION&&(!e||typeof e=="function")){var n=e;e=function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var o=typeof n=="function"?n.apply(void 0,Ne.__spreadArray([],Ne.__read(i),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return ka(function(i,r){return r},Ne.__assign(Ne.__assign({},t),{to:e}))}function AD(e,t){return qd(function(n,i,r){return{type:Pt.error,data:Ce.isFunction(e)?e(n,i,r):e}},Ne.__assign(Ne.__assign({},t),{to:jn.SpecialTargets.Parent}))}function DD(e){return{type:jn.ActionTypes.Choose,conds:e}}var OD=function(e){var t,n,i=[];try{for(var r=Ne.__values(e),o=r.next();!o.done;o=r.next())for(var a=o.value,u=0;u<a.actions.length;){if(a.actions[u].type===Pt.assign){i.push(a.actions[u]),a.actions.splice(u,1);continue}u++}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i};function bl(e,t,n,i,r,o,a){a===void 0&&(a=!1);var u=a?[]:OD(r),s=u.length?Ce.updateContext(n,i,u,t):n,c=a?[n]:void 0,l=[];function f(h,v){var w;switch(v.type){case Pt.raise:{var C=Qy(v,s,i,e.options.delays);return o&&typeof C.delay=="number"&&o(C,s,i),C}case Pt.send:var S=Zy(v,s,i,e.options.delays);if(!Xy.IS_PRODUCTION){var T=v.delay;Ce.warn(!Ce.isString(T)||typeof S.delay=="number","No delay reference for delay expression '".concat(T,"' was found on machine '").concat(e.id,"'"))}return o&&S.to!==jn.SpecialTargets.Internal&&(h==="entry"?l.push(S):o(S,s,i)),S;case Pt.log:{var I=em(v,s,i);return o==null||o(I,s,i),I}case Pt.choose:{var x=v,b=(w=x.conds.find(function(Z){var Q=Ce.toGuard(Z.cond,e.options.guards);return!Q||Ce.evaluateGuard(e,Q,s,i,o?void 0:t)}))===null||w===void 0?void 0:w.actions;if(!b)return[];var E=Ne.__read(bl(e,t,s,i,[{type:h,actions:gl(Ce.toArray(b),e.options.actions)}],o,a),2),P=E[0],$=E[1];return s=$,c==null||c.push(s),P}case Pt.pure:{var b=v.get(s,i.data);if(!b)return[];var L=Ne.__read(bl(e,t,s,i,[{type:h,actions:gl(Ce.toArray(b),e.options.actions)}],o,a),2),R=L[0],A=L[1];return s=A,c==null||c.push(s),R}case Pt.stop:{var I=tm(v,s,i);return o==null||o(I,n,i),I}case Pt.assign:{s=Ce.updateContext(s,i,[v],o?void 0:t),c==null||c.push(s);break}default:var K=Ou(v,e.options.actions),re=K.exec;if(o)o(K,s,i);else if(re&&c){var ze=c.length-1,we=Ne.__assign(Ne.__assign({},K),{exec:function(Z){for(var Q=[],de=1;de<arguments.length;de++)Q[de-1]=arguments[de];re.apply(void 0,Ne.__spreadArray([c[ze]],Ne.__read(Q),!1))}});K=we}return K}}function d(h){var v,w,C=[];try{for(var S=Ne.__values(h.actions),T=S.next();!T.done;T=S.next()){var I=T.value,x=f(h.type,I);x&&(C=C.concat(x))}}catch(b){v={error:b}}finally{try{T&&!T.done&&(w=S.return)&&w.call(S)}finally{if(v)throw v.error}}return l.forEach(function(b){o(b,s,i)}),l.length=0,C}var p=Ce.flatten(r.map(d));return[p,s]}ke.actionTypes=Pt;ke.after=wD;ke.assign=SD;ke.cancel=mD;ke.choose=DD;ke.done=TD;ke.doneInvoke=ID;ke.error=ED;ke.escalate=AD;ke.forwardTo=$D;ke.getActionFunction=ml;ke.initEvent=lD;ke.isActionObject=CD;var ln=ke.log=yD,ND=ke.pure=xD;ke.raise=dD;ke.resolveActions=bl;ke.resolveLog=em;ke.resolveRaise=Qy;ke.resolveSend=Zy;ke.resolveStop=tm;ke.respond=hD;ke.send=ka;ke.sendParent=qd;ke.sendTo=fD;ke.sendUpdate=pD;ke.start=gD;var Yf=ke.stop=bD;ke.toActionObject=Ou;ke.toActionObjects=gl;ke.toActivityDefinition=jd;function nm(e){return function(n,i,r,o,a,u,s){return e(n,i,s)}}function Nu(e){return function(n,i,r,o){if(!n||!i||typeof n!="object"||typeof i!="object")return e(n,i,r,o);var a=o.get(n),u=o.get(i);if(a&&u)return a===i&&u===n;o.set(n,i),o.set(i,n);var s=e(n,i,r,o);return o.delete(n),o.delete(i),s}}function im(e,t){var n={};for(var i in e)n[i]=e[i];for(var i in t)n[i]=t[i];return n}function Xf(e){return e.constructor===Object||e.constructor==null}function Qf(e){return typeof e.then=="function"}function Pu(e,t){return e===t||e!==e&&t!==t}var PD="[object Arguments]",MD="[object Boolean]",RD="[object Date]",_D="[object RegExp]",jD="[object Map]",qD="[object Number]",kD="[object Object]",BD="[object Set]",UD="[object String]",Zf=Object.prototype.toString;function Mu(e){var t=e.areArraysEqual,n=e.areDatesEqual,i=e.areMapsEqual,r=e.areObjectsEqual,o=e.areRegExpsEqual,a=e.areSetsEqual,u=e.createIsNestedEqual,s=u(c);function c(l,f,d){if(l===f)return!0;if(!l||!f||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;if(Xf(l)&&Xf(f))return r(l,f,s,d);var p=Array.isArray(l),h=Array.isArray(f);if(p||h)return p===h&&t(l,f,s,d);var v=Zf.call(l);return v!==Zf.call(f)?!1:v===RD?n(l,f,s,d):v===_D?o(l,f,s,d):v===jD?i(l,f,s,d):v===BD?a(l,f,s,d):v===kD||v===PD?Qf(l)||Qf(f)?!1:r(l,f,s,d):v===MD||v===qD||v===UD?Pu(l.valueOf(),f.valueOf()):!1}return c}function rm(e,t,n,i){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n(e[r],t[r],r,r,e,t,i))return!1;return!0}var VD=Nu(rm);function om(e,t){return Pu(e.valueOf(),t.valueOf())}function am(e,t,n,i){var r=e.size===t.size;if(!r)return!1;if(!e.size)return!0;var o={},a=0;return e.forEach(function(u,s){if(r){var c=!1,l=0;t.forEach(function(f,d){!c&&!o[l]&&(c=n(s,d,a,l,e,t,i)&&n(u,f,s,d,e,t,i))&&(o[l]=!0),l++}),a++,r=c}}),r}var FD=Nu(am),LD="_owner",GD=Object.prototype.hasOwnProperty;function sm(e,t,n,i){var r=Object.keys(e),o=r.length;if(Object.keys(t).length!==o)return!1;for(var a;o-- >0;){if(a=r[o],a===LD){var u=!!e.$$typeof,s=!!t.$$typeof;if((u||s)&&u!==s)return!1}if(!GD.call(t,a)||!n(e[a],t[a],a,a,e,t,i))return!1}return!0}var zD=Nu(sm);function um(e,t){return e.source===t.source&&e.flags===t.flags}function cm(e,t,n,i){var r=e.size===t.size;if(!r)return!1;if(!e.size)return!0;var o={};return e.forEach(function(a,u){if(r){var s=!1,c=0;t.forEach(function(l,f){!s&&!o[c]&&(s=n(a,l,u,f,e,t,i))&&(o[c]=!0),c++}),r=s}}),r}var WD=Nu(cm),lm=Object.freeze({areArraysEqual:rm,areDatesEqual:om,areMapsEqual:am,areObjectsEqual:sm,areRegExpsEqual:um,areSetsEqual:cm,createIsNestedEqual:nm}),dm=Object.freeze({areArraysEqual:VD,areDatesEqual:om,areMapsEqual:FD,areObjectsEqual:zD,areRegExpsEqual:um,areSetsEqual:WD,createIsNestedEqual:nm}),HD=Mu(lm);function KD(e,t){return HD(e,t,void 0)}Mu(im(lm,{createIsNestedEqual:function(){return Pu}}));Mu(dm);Mu(im(dm,{createIsNestedEqual:function(){return Pu}}));var Sl={exports:{}},tc={},is={exports:{}},nc={};/**
|
|
101
|
+
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,c=arguments.length;u<c;u++){s=arguments[u];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(a[l]=s[l])}return a},e.__assign.apply(this,arguments)};function t(o,a){var s={};for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&a.indexOf(u)<0&&(s[u]=o[u]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,u=Object.getOwnPropertySymbols(o);c<u.length;c++)a.indexOf(u[c])<0&&Object.prototype.propertyIsEnumerable.call(o,u[c])&&(s[u[c]]=o[u[c]]);return s}function n(o){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&o[a],u=0;if(s)return s.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&u>=o.length&&(o=void 0),{value:o&&o[u++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(o,a){var s=typeof Symbol=="function"&&o[Symbol.iterator];if(!s)return o;var u=s.call(o),c,l=[],f;try{for(;(a===void 0||a-- >0)&&!(c=u.next()).done;)l.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return l}function i(o,a,s){if(s||arguments.length===2)for(var u=0,c=a.length,l;u<c;u++)(l||!(u in a))&&(l||(l=Array.prototype.slice.call(a,0,u)),l[u]=a[u]);return o.concat(l||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(sv);var rf={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ActionTypes=void 0,function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"}(e.ActionTypes||(e.ActionTypes={})),e.SpecialTargets=void 0,function(t){t.Parent="#_parent",t.Internal="#_internal"}(e.SpecialTargets||(e.SpecialTargets={}))})(rf);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});var un=rf,Tj=un.ActionTypes.Start,Ij=un.ActionTypes.Stop,Aj=un.ActionTypes.Raise,$j=un.ActionTypes.Send,Oj=un.ActionTypes.Cancel,Dj=un.ActionTypes.NullEvent,Nj=un.ActionTypes.Assign,Pj=un.ActionTypes.After,Rj=un.ActionTypes.DoneState,kj=un.ActionTypes.Log,Mj=un.ActionTypes.Init,jj=un.ActionTypes.Invoke,_j=un.ActionTypes.ErrorExecution,qj=un.ActionTypes.ErrorPlatform,Fj=un.ActionTypes.ErrorCustom,Lj=un.ActionTypes.Update,Bj=un.ActionTypes.Choose,Vj=un.ActionTypes.Pure;Ut.after=Pj;Ut.assign=Nj;Ut.cancel=Oj;Ut.choose=Bj;Ut.doneState=Rj;Ut.error=Fj;Ut.errorExecution=_j;Ut.errorPlatform=qj;Ut.init=Mj;Ut.invoke=jj;Ut.log=kj;Ut.nullEvent=Dj;Ut.pure=Vj;Ut.raise=Aj;Ut.send=$j;Ut.start=Tj;Ut.stop=Ij;Ut.update=Lj;var q0={},Ha={};Object.defineProperty(Ha,"__esModule",{value:!0});var Uj=".",Gj={},zj="xstate.guard",Wj="";Ha.DEFAULT_GUARD_TYPE=zj;Ha.EMPTY_ACTIVITY_MAP=Gj;Ha.STATE_DELIMITER=Uj;Ha.TARGETLESS_KEY=Wj;var of={};Object.defineProperty(of,"__esModule",{value:!0});var Hj=process.env.NODE_ENV==="production";of.IS_PRODUCTION=Hj;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=sv,n=rf,r=Ut,i=Ha,o=of,a;function s(g){return Object.keys(g)}function u(g,k,F){F===void 0&&(F=i.STATE_DELIMITER);var _=p(g,F),X=p(k,F);return U(X)?U(_)?X===_:!1:U(_)?_ in X:Object.keys(_).every(function(Q){return Q in X?u(_[Q],X[Q]):!1})}function c(g){try{return U(g)||typeof g=="number"?"".concat(g):g.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function l(g){try{return U(g)||typeof g=="number"?"".concat(g):B(g)?g.name:g.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(g,k){try{return ie(g)?g:g.toString().split(k)}catch{throw new Error("'".concat(g,"' is not a valid state path."))}}function d(g){return typeof g=="object"&&"value"in g&&"context"in g&&"event"in g&&"_event"in g}function p(g,k){if(d(g))return g.value;if(ie(g))return h(g);if(typeof g!="string")return g;var F=f(g,k);return h(F)}function h(g){if(g.length===1)return g[0];for(var k={},F=k,_=0;_<g.length-1;_++)_===g.length-2?F[g[_]]=g[_+1]:(F[g[_]]={},F=F[g[_]]);return k}function v(g,k){for(var F={},_=Object.keys(g),X=0;X<_.length;X++){var Q=_[X];F[Q]=k(g[Q],Q,g,X)}return F}function C(g,k,F){var _,X,Q={};try{for(var le=t.__values(Object.keys(g)),se=le.next();!se.done;se=le.next()){var Se=se.value,$e=g[Se];F($e)&&(Q[Se]=k($e,Se,g))}}catch(Ft){_={error:Ft}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(_)throw _.error}}return Q}var E=function(g){return function(k){var F,_,X=k;try{for(var Q=t.__values(g),le=Q.next();!le.done;le=Q.next()){var se=le.value;X=X[se]}}catch(Se){F={error:Se}}finally{try{le&&!le.done&&(_=Q.return)&&_.call(Q)}finally{if(F)throw F.error}}return X}};function y(g,k){return function(F){var _,X,Q=F;try{for(var le=t.__values(g),se=le.next();!se.done;se=le.next()){var Se=se.value;Q=Q[k][Se]}}catch($e){_={error:$e}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(_)throw _.error}}return Q}}function w(g){if(!g)return[[]];if(U(g))return[[g]];var k=S(Object.keys(g).map(function(F){var _=g[F];return typeof _!="string"&&(!_||!Object.keys(_).length)?[[F]]:w(g[F]).map(function(X){return[F].concat(X)})}));return k}function x(g){var k,F,_={};if(g&&g.length===1&&g[0].length===1)return g[0][0];try{for(var X=t.__values(g),Q=X.next();!Q.done;Q=X.next())for(var le=Q.value,se=_,Se=0;Se<le.length;Se++){var $e=le[Se];if(Se===le.length-2){se[$e]=le[Se+1];break}se[$e]=se[$e]||{},se=se[$e]}}catch(Ft){k={error:Ft}}finally{try{Q&&!Q.done&&(F=X.return)&&F.call(X)}finally{if(k)throw k.error}}return _}function S(g){var k;return(k=[]).concat.apply(k,t.__spreadArray([],t.__read(g),!1))}function T(g){return ie(g)?g:[g]}function A(g){return g===void 0?[]:T(g)}function D(g,k,F){var _,X;if(B(g))return g(k,F.data);var Q={};try{for(var le=t.__values(Object.keys(g)),se=le.next();!se.done;se=le.next()){var Se=se.value,$e=g[Se];B($e)?Q[Se]=$e(k,F.data):Q[Se]=$e}}catch(Ft){_={error:Ft}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(_)throw _.error}}return Q}function I(g){return/^(done|error)\./.test(g)}function N(g){return!!(g instanceof Promise||g!==null&&(B(g)||typeof g=="object")&&B(g.then))}function j(g){return g!==null&&typeof g=="object"&&"transition"in g&&typeof g.transition=="function"}function L(g,k){var F,_,X=t.__read([[],[]],2),Q=X[0],le=X[1];try{for(var se=t.__values(g),Se=se.next();!Se.done;Se=se.next()){var $e=Se.value;k($e)?Q.push($e):le.push($e)}}catch(Ft){F={error:Ft}}finally{try{Se&&!Se.done&&(_=se.return)&&_.call(se)}finally{if(F)throw F.error}}return[Q,le]}function V(g,k){return v(g.states,function(F,_){if(F){var X=(U(k)?void 0:k[_])||(F?F.current:void 0);if(X)return{current:X,states:V(F,X)}}})}function H(g,k){return{current:k,states:V(g,k)}}function R(g,k,F,_){o.IS_PRODUCTION||e.warn(!!g,"Attempting to update undefined context");var X=g&&F.reduce(function(Q,le){var se,Se,$e=le.assignment,Ft={state:_,action:le,_event:k},Ki={};if(B($e))Ki=$e(Q,k.data,Ft);else try{for(var _r=t.__values(Object.keys($e)),dr=_r.next();!dr.done;dr=_r.next()){var es=dr.value,Yi=$e[es];Ki[es]=B(Yi)?Yi(Q,k.data,Ft):Yi}}catch(Af){se={error:Af}}finally{try{dr&&!dr.done&&(Se=_r.return)&&Se.call(_r)}finally{if(se)throw se.error}}return Object.assign({},Q,Ki)},g);return X}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(g,k){var F=g instanceof Error?g:void 0;if(!(!F&&g)&&console!==void 0){var _=["Warning: ".concat(k)];F&&_.push(F),console.warn.apply(console,_)}});function ie(g){return Array.isArray(g)}function B(g){return typeof g=="function"}function U(g){return typeof g=="string"}function fe(g,k){if(g)return U(g)?{type:i.DEFAULT_GUARD_TYPE,name:g,predicate:k?k[g]:void 0}:B(g)?{type:i.DEFAULT_GUARD_TYPE,name:g.name,predicate:g}:g}function M(g){try{return"subscribe"in g&&B(g.subscribe)}catch{return!1}}var P=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[P]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(g){return!!g&&"__xstatenode"in g}function K(g){return!!g&&typeof g.send=="function"}var ae=function(){var g=0;return function(){return g++,g.toString(16)}}();function de(g,k){return U(g)||typeof g=="number"?t.__assign({type:g},k):g}function ve(g,k){if(!U(g)&&"$$type"in g&&g.$$type==="scxml")return g;var F=de(g);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},k)}function Ee(g,k){var F=T(k).map(function(_){return typeof _>"u"||typeof _=="string"||oe(_)?{target:_,event:g}:t.__assign(t.__assign({},_),{event:g})});return F}function Re(g){if(!(g===void 0||g===i.TARGETLESS_KEY))return A(g)}function De(g,k,F){if(!o.IS_PRODUCTION){var _=g.stack?" Stacktrace was '".concat(g.stack,"'"):"";if(g===k)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(g,"'.").concat(_));else{var X=k.stack?" Stacktrace was '".concat(k.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(g,"'. ").concat(_," Current error is '").concat(k,"'.").concat(X))}}}function yt(g,k,F,_,X){var Q=g.options.guards,le={state:X,cond:k,_event:_};if(k.type===i.DEFAULT_GUARD_TYPE)return((Q==null?void 0:Q[k.name])||k.predicate)(F,_.data,le);var se=Q==null?void 0:Q[k.type];if(!se)throw new Error("Guard '".concat(k.type,"' is not implemented on machine '").concat(g.id,"'."));return se(F,_.data,le)}function ce(g){return typeof g=="string"?{type:g}:g}function Nn(g,k,F){var _=function(){},X=typeof g=="object",Q=X?g:null;return{next:((X?g.next:g)||_).bind(Q),error:((X?g.error:k)||_).bind(Q),complete:((X?g.complete:F)||_).bind(Q)}}function fi(g,k){return"".concat(g,":invocation[").concat(k,"]")}function Lo(g){return(g.type===r.raise||g.type===r.send&&g.to===n.SpecialTargets.Internal)&&typeof g.delay!="number"}e.createInvokeId=fi,e.evaluateGuard=yt,e.flatten=S,e.getActionType=l,e.getEventType=c,e.interopSymbols=te,e.isActor=K,e.isArray=ie,e.isBehavior=j,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=M,e.isPromiseLike=N,e.isRaisableAction=Lo,e.isStateLike=d,e.isString=U,e.keys=s,e.mapContext=D,e.mapFilterValues=C,e.mapValues=v,e.matchesState=u,e.nestedPath=y,e.normalizeTarget=Re,e.partition=L,e.path=E,e.pathToStateValue=h,e.pathsToStateValue=x,e.reportUnhandledExceptionOnInvocation=De,e.symbolObservable=P,e.toArray=A,e.toArrayStrict=T,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=ce,e.toObserver=Nn,e.toSCXMLEvent=ve,e.toStatePath=f,e.toStatePaths=w,e.toStateValue=p,e.toTransitionConfigArray=Ee,e.uniqueId=ae,e.updateContext=R,e.updateHistoryStates=V,e.updateHistoryValue=H})(q0);Object.defineProperty(rt,"__esModule",{value:!0});var Ke=sv,fr=rf,on=Ut,Fe=q0,F0=of,Kj=Fe.toSCXMLEvent({type:on.init});function pp(e,t){return t&&t[e]||void 0}function af(e,t){var n;if(Fe.isString(e)||typeof e=="number"){var r=pp(e,t);Fe.isFunction(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Fe.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var r=pp(e.type,t);if(Fe.isFunction(r))n=Ke.__assign(Ke.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Ke.__assign(Ke.__assign(Ke.__assign({},r),e),{type:i})}else n=e}return n}var hp=function(e,t){if(!e)return[];var n=Fe.isArray(e)?e:[e];return n.map(function(r){return af(r,t)})};function uv(e){var t=af(e);return Ke.__assign(Ke.__assign({id:Fe.isString(e)?e:t.id},t),{type:t.type})}function Yj(e,t){return{type:on.raise,event:typeof e=="function"?e:Fe.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function L0(e,t,n,r){var i={_event:n},o=Fe.toSCXMLEvent(Fe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Fe.isString(e.delay)){var s=r&&r[e.delay];a=Fe.isFunction(s)?s(t,n.data,i):s}else a=Fe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return Ke.__assign(Ke.__assign({},e),{type:on.raise,_event:o,delay:a})}function xu(e,t){return{to:t?t.to:void 0,type:on.send,event:Fe.isFunction(e)?e:Fe.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Fe.isFunction(e)?e.name:Fe.getEventType(e)}}function B0(e,t,n,r){var i={_event:n},o=Fe.toSCXMLEvent(Fe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Fe.isString(e.delay)){var s=r&&r[e.delay];a=Fe.isFunction(s)?s(t,n.data,i):s}else a=Fe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=Fe.isFunction(e.to)?e.to(t,n.data,i):e.to;return Ke.__assign(Ke.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function cv(e,t){return xu(e,Ke.__assign(Ke.__assign({},t),{to:fr.SpecialTargets.Parent}))}function Xj(e,t,n){return xu(t,Ke.__assign(Ke.__assign({},n),{to:e}))}function Jj(){return cv(on.update)}function Qj(e,t){return xu(e,Ke.__assign(Ke.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var Zj=function(e,t){return{context:e,event:t}};function e_(e,t){return e===void 0&&(e=Zj),{type:on.log,label:t,expr:e}}var V0=function(e,t,n){return Ke.__assign(Ke.__assign({},e),{value:Fe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},t_=function(e){return{type:on.cancel,sendId:e}};function n_(e){var t=uv(e);return{type:fr.ActionTypes.Start,activity:t,exec:void 0}}function r_(e){var t=Fe.isFunction(e)?e:uv(e);return{type:fr.ActionTypes.Stop,activity:t,exec:void 0}}function U0(e,t,n){var r=Fe.isFunction(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:fr.ActionTypes.Stop,activity:i};return o}var i_=function(e){return{type:on.assign,assignment:e}};function o_(e){return typeof e=="object"&&"type"in e}function a_(e,t){var n=t?"#".concat(t):"";return"".concat(fr.ActionTypes.After,"(").concat(e,")").concat(n)}function s_(e,t){var n="".concat(fr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function u_(e,t){var n="".concat(fr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function c_(e,t){var n="".concat(fr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function l_(e){return{type:fr.ActionTypes.Pure,get:e}}function f_(e,t){if(!F0.IS_PRODUCTION&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,Ke.__spreadArray([],Ke.__read(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return xu(function(r,i){return i},Ke.__assign(Ke.__assign({},t),{to:e}))}function d_(e,t){return cv(function(n,r,i){return{type:on.error,data:Fe.isFunction(e)?e(n,r,i):e}},Ke.__assign(Ke.__assign({},t),{to:fr.SpecialTargets.Parent}))}function p_(e){return{type:fr.ActionTypes.Choose,conds:e}}var h_=function(e){var t,n,r=[];try{for(var i=Ke.__values(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===on.assign){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function vp(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:h_(i),u=s.length?Fe.updateContext(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var C;switch(v.type){case on.raise:{var E=L0(v,u,r,e.options.delays);return o&&typeof E.delay=="number"&&o(E,u,r),E}case on.send:var y=B0(v,u,r,e.options.delays);if(!F0.IS_PRODUCTION){var w=v.delay;Fe.warn(!Fe.isString(w)||typeof y.delay=="number","No delay reference for delay expression '".concat(w,"' was found on machine '").concat(e.id,"'"))}return o&&y.to!==fr.SpecialTargets.Internal&&(h==="entry"?l.push(y):o(y,u,r)),y;case on.log:{var x=V0(v,u,r);return o==null||o(x,u,r),x}case on.choose:{var S=v,T=(C=S.conds.find(function(B){var U=Fe.toGuard(B.cond,e.options.guards);return!U||Fe.evaluateGuard(e,U,u,r,o?void 0:t)}))===null||C===void 0?void 0:C.actions;if(!T)return[];var A=Ke.__read(vp(e,t,u,r,[{type:h,actions:hp(Fe.toArray(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case on.pure:{var T=v.get(u,r.data);if(!T)return[];var N=Ke.__read(vp(e,t,u,r,[{type:h,actions:hp(Fe.toArray(T),e.options.actions)}],o,a),2),j=N[0],L=N[1];return u=L,c==null||c.push(u),j}case on.stop:{var x=U0(v,u,r);return o==null||o(x,n,r),x}case on.assign:{u=Fe.updateContext(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=af(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=Ke.__assign(Ke.__assign({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,Ke.__spreadArray([c[R]],Ke.__read(U),!1))}});V=ie}return V}}function d(h){var v,C,E=[];try{for(var y=Ke.__values(h.actions),w=y.next();!w.done;w=y.next()){var x=w.value,S=f(h.type,x);S&&(E=E.concat(S))}}catch(T){v={error:T}}finally{try{w&&!w.done&&(C=y.return)&&C.call(y)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,E}var p=Fe.flatten(i.map(d));return[p,u]}rt.actionTypes=on;rt.after=a_;rt.assign=i_;rt.cancel=t_;rt.choose=p_;rt.done=s_;rt.doneInvoke=u_;rt.error=c_;rt.escalate=d_;rt.forwardTo=f_;rt.getActionFunction=pp;rt.initEvent=Kj;rt.isActionObject=o_;var Vn=rt.log=e_,v_=rt.pure=l_;rt.raise=Yj;rt.resolveActions=vp;rt.resolveLog=V0;rt.resolveRaise=L0;rt.resolveSend=B0;rt.resolveStop=U0;rt.respond=Qj;rt.send=xu;rt.sendParent=cv;rt.sendTo=Xj;rt.sendUpdate=Jj;rt.start=n_;var fy=rt.stop=r_;rt.toActionObject=af;rt.toActionObjects=hp;rt.toActivityDefinition=uv;function G0(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function sf(e){return function(n,r,i,o){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i,o);var a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i,o);return o.delete(n),o.delete(r),u}}function z0(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function dy(e){return e.constructor===Object||e.constructor==null}function py(e){return typeof e.then=="function"}function uf(e,t){return e===t||e!==e&&t!==t}var m_="[object Arguments]",y_="[object Boolean]",g_="[object Date]",b_="[object RegExp]",S_="[object Map]",w_="[object Number]",C_="[object Object]",x_="[object Set]",E_="[object String]",hy=Object.prototype.toString;function cf(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.areRegExpsEqual,a=e.areSetsEqual,s=e.createIsNestedEqual,u=s(c);function c(l,f,d){if(l===f)return!0;if(!l||!f||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;if(dy(l)&&dy(f))return i(l,f,u,d);var p=Array.isArray(l),h=Array.isArray(f);if(p||h)return p===h&&t(l,f,u,d);var v=hy.call(l);return v!==hy.call(f)?!1:v===g_?n(l,f,u,d):v===b_?o(l,f,u,d):v===S_?r(l,f,u,d):v===x_?a(l,f,u,d):v===C_||v===m_?py(l)||py(f)?!1:i(l,f,u,d):v===y_||v===w_||v===E_?uf(l.valueOf(),f.valueOf()):!1}return c}function W0(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var T_=sf(W0);function H0(e,t){return uf(e.valueOf(),t.valueOf())}function K0(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={},a=0;return e.forEach(function(s,u){if(i){var c=!1,l=0;t.forEach(function(f,d){!c&&!o[l]&&(c=n(u,d,a,l,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[l]=!0),l++}),a++,i=c}}),i}var I_=sf(K0),A_="_owner",$_=Object.prototype.hasOwnProperty;function Y0(e,t,n,r){var i=Object.keys(e),o=i.length;if(Object.keys(t).length!==o)return!1;for(var a;o-- >0;){if(a=i[o],a===A_){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!$_.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var O_=sf(Y0);function X0(e,t){return e.source===t.source&&e.flags===t.flags}function J0(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={};return e.forEach(function(a,s){if(i){var u=!1,c=0;t.forEach(function(l,f){!u&&!o[c]&&(u=n(a,l,s,f,e,t,r))&&(o[c]=!0),c++}),i=u}}),i}var D_=sf(J0),Q0=Object.freeze({areArraysEqual:W0,areDatesEqual:H0,areMapsEqual:K0,areObjectsEqual:Y0,areRegExpsEqual:X0,areSetsEqual:J0,createIsNestedEqual:G0}),Z0=Object.freeze({areArraysEqual:T_,areDatesEqual:H0,areMapsEqual:I_,areObjectsEqual:O_,areRegExpsEqual:X0,areSetsEqual:D_,createIsNestedEqual:G0}),N_=cf(Q0);function P_(e,t){return N_(e,t,void 0)}cf(z0(Q0,{createIsNestedEqual:function(){return uf}}));cf(Z0);cf(z0(Z0,{createIsNestedEqual:function(){return uf}}));var mp={exports:{}},kf={},Yu={exports:{}},Mf={};/**
|
|
102
102
|
* @license React
|
|
103
103
|
* use-sync-external-store-shim.production.min.js
|
|
104
104
|
*
|
|
@@ -106,7 +106,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==ct.Running)throw
|
|
|
106
106
|
*
|
|
107
107
|
* This source code is licensed under the MIT license found in the
|
|
108
108
|
* LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/var
|
|
109
|
+
*/var vy;function R_(){if(vy)return Mf;vy=1;var e=O;function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(f,d){var p=d(),h=r({inst:{value:p,getSnapshot:d}}),v=h[0].inst,C=h[1];return o(function(){v.value=p,v.getSnapshot=d,u(v)&&C({inst:v})},[f,p,d]),i(function(){return u(v)&&C({inst:v}),f(function(){u(v)&&C({inst:v})})},[f]),a(p),p}function u(f){var d=f.getSnapshot;f=f.value;try{var p=d();return!n(f,p)}catch{return!0}}function c(f,d){return d()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return Mf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,Mf}var jf={};/**
|
|
110
110
|
* @license React
|
|
111
111
|
* use-sync-external-store-shim.development.js
|
|
112
112
|
*
|
|
@@ -114,7 +114,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==ct.Running)throw
|
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the MIT license found in the
|
|
116
116
|
* LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/var
|
|
117
|
+
*/var my;function k_(){return my||(my=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var x=arguments.length,S=new Array(x>1?x-1:0),T=1;T<x;T++)S[T-1]=arguments[T];r("error",w,S)}}function r(w,x,S){{var T=t.ReactDebugCurrentFrame,A=T.getStackAddendum();A!==""&&(x+="%s",S=S.concat([A]));var D=S.map(function(I){return String(I)});D.unshift("Warning: "+x),Function.prototype.apply.call(console[w],console,D)}}function i(w,x){return w===x&&(w!==0||1/w===1/x)||w!==w&&x!==x}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,c=e.useDebugValue,l=!1,f=!1;function d(w,x,S){l||e.startTransition!==void 0&&(l=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var T=x();if(!f){var A=x();o(T,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var D=a({inst:{value:T,getSnapshot:x}}),I=D[0].inst,N=D[1];return u(function(){I.value=T,I.getSnapshot=x,p(I)&&N({inst:I})},[w,T,x]),s(function(){p(I)&&N({inst:I});var j=function(){p(I)&&N({inst:I})};return w(j)},[w]),c(T),T}function p(w){var x=w.getSnapshot,S=w.value;try{var T=x();return!o(S,T)}catch{return!0}}function h(w,x,S){return x()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",C=!v,E=C?h:d,y=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E;jf.useSyncExternalStore=y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),jf}var yy;function eC(){return yy||(yy=1,process.env.NODE_ENV==="production"?Yu.exports=R_():Yu.exports=k_()),Yu.exports}/**
|
|
118
118
|
* @license React
|
|
119
119
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
120
120
|
*
|
|
@@ -122,7 +122,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==ct.Running)throw
|
|
|
122
122
|
*
|
|
123
123
|
* This source code is licensed under the MIT license found in the
|
|
124
124
|
* LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/var
|
|
125
|
+
*/var gy;function M_(){if(gy)return kf;gy=1;var e=O,t=eC();function n(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;return kf.useSyncExternalStoreWithSelector=function(c,l,f,d,p){var h=o(null);if(h.current===null){var v={hasValue:!1,value:null};h.current=v}else v=h.current;h=s(function(){function E(T){if(!y){if(y=!0,w=T,T=d(T),p!==void 0&&v.hasValue){var A=v.value;if(p(A,T))return x=A}return x=T}if(A=x,r(w,T))return A;var D=d(T);return p!==void 0&&p(A,D)?A:(w=T,x=D)}var y=!1,w,x,S=f===void 0?null:f;return[function(){return E(l())},S===null?void 0:function(){return E(S())}]},[l,f,d,p]);var C=i(c,h[0],h[1]);return a(function(){v.hasValue=!0,v.value=C},[C]),u(C),C},kf}var _f={};/**
|
|
126
126
|
* @license React
|
|
127
127
|
* use-sync-external-store-shim/with-selector.development.js
|
|
128
128
|
*
|
|
@@ -130,9 +130,9 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==ct.Running)throw
|
|
|
130
130
|
*
|
|
131
131
|
* This source code is licensed under the MIT license found in the
|
|
132
132
|
* LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/var rp;function QD(){return rp||(rp=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=M,t=fm();function n(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var i=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,u=e.useMemo,s=e.useDebugValue;function c(l,f,d,p,h){var v=o(null),w;v.current===null?(w={hasValue:!1,value:null},v.current=w):w=v.current;var C=u(function(){var x=!1,b,E,P=function(A){if(!x){x=!0,b=A;var K=p(A);if(h!==void 0&&w.hasValue){var re=w.value;if(h(re,K))return E=re,re}return E=K,K}var ze=b,we=E;if(i(ze,A))return we;var Z=p(A);return h!==void 0&&h(we,Z)?we:(b=A,E=Z,Z)},$=d===void 0?null:d,L=function(){return P(f())},R=$===null?void 0:function(){return P($())};return[L,R]},[f,d,p,h]),S=C[0],T=C[1],I=r(l,S,T);return a(function(){w.hasValue=!0,w.value=I},[I]),s(I),I}rc.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),rc}process.env.NODE_ENV==="production"?Sl.exports=XD():Sl.exports=QD();var ZD=Sl.exports,eO=M.useLayoutEffect;function op(e){var t=Up.useRef();return t.current||(t.current={v:e()}),t.current.v}var Ws=globalThis&&globalThis.__assign||function(){return Ws=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Ws.apply(this,arguments)},tO=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n},nO=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o};function iO(e,t){var n=op(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var i=nO(M.useState(n),1),r=i[0];e!==r&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var o=t.context,a=t.guards,u=t.actions,s=t.activities,c=t.services,l=t.delays;t.state;var f=tO(t,["context","guards","actions","activities","services","delays","state"]),d=op(function(){var p={context:o,guards:a,actions:u,activities:s,services:c,delays:l},h=n.withConfig(p,function(){return Ws(Ws({},n.context),o)});return Ky(h,f)});return eO(function(){Object.assign(d.machine.options.actions,u),Object.assign(d.machine.options.guards,a),Object.assign(d.machine.options.activities,s),Object.assign(d.machine.options.services,c),Object.assign(d.machine.options.delays,l)},[u,a,s,c,l]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function rO(e,t,n){if(e.status===ct.NotStarted)return!0;var i=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||i)}var oO=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o};function aO(e){return e}function sO(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=oO(t,1),r=i[0],o=r===void 0?{}:r,a=iO(e,o),u=M.useCallback(function(){return a.status===ct.NotStarted?o.state?xn.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),s=M.useCallback(function(f,d){return rO(a,f,d)},[a]),c=M.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),l=ZD.useSyncExternalStoreWithSelector(c,u,u,aO,s);return M.useEffect(function(){var f=o.state;return a.start(f?xn.create(f):void 0),function(){a.stop(),a.status=ct.NotStarted}},[]),[l,a.send,a]}const pm=M.createContext(null),hm=M.createContext(null),uO=M.createContext(null),vm=M.createContext(null),ym=()=>M.useContext(pm),$o=()=>M.useContext(vm),mm="The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";function gm(e){if(!e)throw new Error(mm)}function Ao(e){if(!e)throw new Error(mm)}function Ji(){const e=ym();return gm(e),M.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var cO=function(e){return e._tag==="Some"},Ru=function(e){return function(t){return cO(e(t))}};const lO=Ru(e=>e.type===q.Choice?be(e):ie),dO=Ru(e=>e.type===q.Numeric?be(e):ie),fO=Ru(e=>e.type===q.Boolean?be(e):ie),pO=Ru(e=>e.type===q.Component?be(e):ie);function _u(e){return e.decision!=null&&e.decision.kind===pe.Explicit}function bm(e){return g(e.values,xt(_u),j(t=>({type:q.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function hO(e){return g(e,Ra(_u),V(()=>({type:q.Numeric,attributeId:e.id,state:null})))}function vO(e){return g(e,Ra(_u),V(()=>({type:q.Boolean,attributeId:e.id,state:null})))}function yO(e){return g(e,Ra(_u),V(()=>({type:q.Component,attributeId:e.id,state:null})))}function mO(e,t){return g(Io.filterAttributesOfComponent(t,e,!0),n=>[g(n,xt(lO),Rx(bm)),g(n,xt(dO),j(hO),gn),g(n,xt(fO),j(vO),gn),g(n,xt(pO),j(yO),gn)],gd)}function Ba(e,t=!1){const n=$o();return Ao(n),M.useMemo(()=>g(te(e),V(Mn(j(i=>Io.getAttribute(n,i)),t?Dr(te):xi)),Ve(()=>n.attributes)),[e,n,t])}function Sm(e){const t=$o(),{makeDecision:n,setManyDecision:i}=Ji();Ao(t);const r=Io.getChoiceAttribute(t,e),o=M.useMemo(()=>({makeDecision:(u,s)=>n({type:q.Choice,attributeId:e,choiceValueId:u,state:s}),clearDecisions:g(r,te,V(bm),Ct(bo),V(u=>()=>i(u,{type:"Default"})),Ve(()=>()=>Promise.resolve()))}),[e,r,n,i]),a=M.useMemo(()=>({...o,attribute:r}),[r,o]);if(r)return a}function gO(e){const t=$o(),{makeDecision:n}=Ji();Ao(t);const i=Io.getNumericAttribute(t,e),r=M.useMemo(()=>({makeDecision:a=>n({type:q.Numeric,attributeId:e,state:a})}),[e,n]),o=M.useMemo(()=>({...r,attribute:i}),[i,r]);if(i)return o}function bO(e){const t=$o(),{makeDecision:n}=Ji();Ao(t);const i=Io.getBooleanAttribute(t,e),r=M.useMemo(()=>({makeDecision:a=>n({type:q.Boolean,attributeId:e,state:a})}),[e,n]),o=M.useMemo(()=>({...r,attribute:i}),[i,r]);if(i)return o}function SO(e){const t=$o(),{makeDecision:n,setManyDecision:i}=Ji();Ao(t);const r=t.attributes,o=Io.getComponentAttribute(t,e),a=M.useMemo(()=>({makeDecision:s=>n({type:q.Component,attributeId:e,state:s}),clearSubtree:g(mO(e,r),Ra(bo),V(s=>()=>i(s,{type:"Default"})),Ve(()=>()=>Promise.resolve()))}),[e,n,r,i]),u=M.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return u}const CO=Sn((e,t)=>ty(Ze).equals(e??{},t??{})),wO=wn({attributeId:Sn(Uf),decisions:So(Sn(Uf))}),TO=Sn((e,t)=>So(wO).equals(e??[],t??[])),oc=wn({configurationModelSource:Sn((e,t)=>KD(e,t)),attributeRelations:TO,usageRuleParameters:CO}),IO=md,ac=Xc(IO),EO=()=>Rd({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{desiredClient:null,desiredSessionContext:null,actualClient:null,session:null,sessionCreationError:null,sessionUpdateError:null,hasEverSuccessfullyCreatedSession:!1},initial:"ProcessChanges",on:{ChangeConfigurationClient:{actions:["saveDesiredClient"]},ChangeSessionContext:{actions:["saveDesiredSessionContext"]}},exit:[ln("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[ln("Entering ProcessChanges","SessionManagement:"),Ur(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[ln("Entering DisposeSession","SessionManagement:"),Ur(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[ln("Entering CreateSession","SessionManagement:"),Ur(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[ln("Entering SessionCreationFailed","SessionManagement:"),Ur(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[ln("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:ln("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[ln("Entering UpdateSession","SessionManagement:"),Ur(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[ln("Entering SessionUpdateFailed","SessionManagement:"),Ur(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[ln("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:ln("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Qt({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Qt({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Qt((e,t)=>(e.session&&e.session.close().then(pi).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Qt((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Qt((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Qt({sessionCreationError:()=>null}),setSessionUpdateError:Qt((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Qt({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Qt({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:e=>e.desiredClient.createSession(e.desiredSessionContext).then(t=>({session:t,client:e.desiredClient})).catch(t=>Promise.reject({type:t.type,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({type:t.type,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!ac.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!oc.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!ac.equals(e.desiredClient,e.sessionCreationError.client)||!Xc(oc).equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!ac.equals(e.desiredClient,e.actualClient)||!Xc(oc).equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Ur(e){const t=e===0,n=e===1;return ND((i,r)=>{const o={isInitializing:(!i.hasEverSuccessfullyCreatedSession||t)&&i.sessionCreationError==null,errorType:i.sessionCreationError&&i.sessionCreationError.type},a={isUpdating:n&&i.sessionUpdateError==null,errorType:i.sessionUpdateError&&i.sessionUpdateError.type};return Jy({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:i.session})})}const xO=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),$O=()=>Rd({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[Jy((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[ln("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[ln("Entering Subscribe","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{target:"ProcessChanges",cond:(e,t)=>t.session==null||e.session!==t.session,actions:["saveSession"]}},invoke:{id:"configurationSubscriptionActor",src:(e,t)=>xO(e.session)}}}},{actions:{saveSession:Qt((e,t)=>({session:t.session}))}}),AO=()=>{let e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}},ap=()=>{const e=AO();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}},DO=()=>Rd({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:ap()},entry:[Qt({sessionManagementActor:()=>Kf(EO()),configurationSubscriptionManagementActor:()=>Kf($O())})],exit:[Yf(e=>e.sessionManagementActor),Yf(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[ns(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[ns(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[ns(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[ns(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Qt((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),U1(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Qt((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Qt((e,t)=>{var n;const i=!((n=e.sessionInitialization)!=null&&n.isInitializing)&&e.session!=null&&e.configuration!=null&&e.configuration.session===e.session;return e.isReadyPromise&&i&&(e.isReadyPromise.resolve(),e.isReadyPromise.capsule.promise=null),{isReadyPromise:(()=>i?null:e.isReadyPromise!=null?e.isReadyPromise:ap())()}})}});function OO(e){var t,n;const[i,r]=sO(DO,{logger:(...s)=>console.log("ConfigurationManagement:",...s)});M.useEffect(()=>{r({type:"ChangeConfigurationClient",client:e.configuratorClient}),e.configuratorClient||console.warn("The configurator client is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass a valid client.")},[e.configuratorClient]),M.useEffect(()=>{const s=g(te(e.sessionContext),Kx(c=>te(c.configurationModelSource)),An);r({type:"ChangeSessionContext",sessionContext:s}),s||console.warn("The session context is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass valid session context data.")},[e.sessionContext]);const o=M.useMemo(()=>{var s,c,l,f;return{isInitializing:((c=(s=i.context.isReadyPromise)==null?void 0:s.capsule)==null?void 0:c.promise)!=null,isInitializingPromise:(l=i.context.isReadyPromise)==null?void 0:l.capsule,error:((f=i.context.sessionInitialization)==null?void 0:f.errorType)&&{type:i.context.sessionInitialization.errorType,retry:()=>r({type:"RetrySessionCreation"})}}},[i.context.sessionInitialization,i.context.isReadyPromise]),a=M.useMemo(()=>{var s,c;return{isUpdating:(s=i.context.sessionUpdating)==null?void 0:s.isUpdating,error:((c=i.context.sessionUpdating)==null?void 0:c.errorType)&&{type:i.context.sessionUpdating.errorType,retry:()=>r({type:"RetrySessionUpdate"})}}},[i.context.sessionUpdating]),u=((t=i.context.configuration)==null?void 0:t.session)===i.context.session?(n=i.context.configuration)==null?void 0:n.configuration:null;return{configurationInitialization:o,configurationUpdating:a,session:i.context.session,configuration:u}}function NO(e){const{configurationInitialization:t,configurationUpdating:n,session:i,configuration:r}=OO({configuratorClient:e.configuratorClient,sessionContext:e});return X.jsx(hm.Provider,{value:t,children:X.jsx(uO.Provider,{value:n,children:X.jsx(pm.Provider,{value:i,children:X.jsx(vm.Provider,{value:r,children:e.children})})})})}function kd(){return M.useContext(hm)}function PO(e){const{children:t}=e,{isInitializingPromise:n}=kd();if(n!=null&&n.promise)throw n.promise;return X.jsx(X.Fragment,{children:t})}function Cm(){const e=ym(),t=$o();return gm(e),Ao(t),M.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const MO=M.createContext(null),sc={didCatch:!1,error:null};class RO extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=sc}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,i,r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];(n=(i=this.props).onReset)===null||n===void 0||n.call(i,{args:o,reason:"imperative-api"}),this.setState(sc)}}componentDidCatch(t,n){var i,r;(i=(r=this.props).onError)===null||i===void 0||i.call(r,t,n)}componentDidUpdate(t,n){const{didCatch:i}=this.state,{resetKeys:r}=this.props;if(i&&n.error!==null&&_O(t.resetKeys,r)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:r,prev:t.resetKeys,reason:"keys"}),this.setState(sc)}}render(){const{children:t,fallbackRender:n,FallbackComponent:i,fallback:r}=this.props,{didCatch:o,error:a}=this.state;let u=t;if(o){const s={error:a,resetErrorBoundary:this.resetErrorBoundary};if(M.isValidElement(r))u=r;else if(typeof n=="function")u=n(s);else if(i)u=M.createElement(i,s);else throw a}return M.createElement(MO.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},u)}}function _O(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,i)=>!Object.is(n,t[i]))}var tn=function(){return tn=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},tn.apply(this,arguments)};function jO(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}function io(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}function qO(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var kO=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,BO=qO(function(e){return kO.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Ye="-ms-",sa="-moz-",Be="-webkit-",wm="comm",ju="rule",Bd="decl",UO="@import",Tm="@keyframes",VO="@layer",FO=Math.abs,Ud=String.fromCharCode,Cl=Object.assign;function LO(e,t){return Ot(e,0)^45?(((t<<2^Ot(e,0))<<2^Ot(e,1))<<2^Ot(e,2))<<2^Ot(e,3):0}function Im(e){return e.trim()}function li(e,t){return(e=t.exec(e))?e[0]:e}function me(e,t,n){return e.replace(t,n)}function Ss(e,t){return e.indexOf(t)}function Ot(e,t){return e.charCodeAt(t)|0}function ro(e,t,n){return e.slice(t,n)}function ei(e){return e.length}function Em(e){return e.length}function ea(e,t){return t.push(e),e}function GO(e,t){return e.map(t).join("")}function sp(e,t){return e.filter(function(n){return!li(n,t)})}var qu=1,oo=1,xm=0,Rn=0,bt=0,Do="";function ku(e,t,n,i,r,o,a,u){return{value:e,root:t,parent:n,type:i,props:r,children:o,line:qu,column:oo,length:a,return:"",siblings:u}}function Ri(e,t){return Cl(ku("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Vr(e){for(;e.root;)e=Ri(e.root,{children:[e]});ea(e,e.siblings)}function zO(){return bt}function WO(){return bt=Rn>0?Ot(Do,--Rn):0,oo--,bt===10&&(oo=1,qu--),bt}function Hn(){return bt=Rn<xm?Ot(Do,Rn++):0,oo++,bt===10&&(oo=1,qu++),bt}function pr(){return Ot(Do,Rn)}function Cs(){return Rn}function Bu(e,t){return ro(Do,e,t)}function wl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function HO(e){return qu=oo=1,xm=ei(Do=e),Rn=0,[]}function KO(e){return Do="",e}function uc(e){return Im(Bu(Rn-1,Tl(e===91?e+2:e===40?e+1:e)))}function JO(e){for(;(bt=pr())&&bt<33;)Hn();return wl(e)>2||wl(bt)>3?"":" "}function YO(e,t){for(;--t&&Hn()&&!(bt<48||bt>102||bt>57&&bt<65||bt>70&&bt<97););return Bu(e,Cs()+(t<6&&pr()==32&&Hn()==32))}function Tl(e){for(;Hn();)switch(bt){case e:return Rn;case 34:case 39:e!==34&&e!==39&&Tl(bt);break;case 40:e===41&&Tl(e);break;case 92:Hn();break}return Rn}function XO(e,t){for(;Hn()&&e+bt!==47+10;)if(e+bt===42+42&&pr()===47)break;return"/*"+Bu(t,Rn-1)+"*"+Ud(e===47?e:Hn())}function QO(e){for(;!wl(pr());)Hn();return Bu(e,Rn)}function ZO(e){return KO(ws("",null,null,null,[""],e=HO(e),0,[0],e))}function ws(e,t,n,i,r,o,a,u,s){for(var c=0,l=0,f=a,d=0,p=0,h=0,v=1,w=1,C=1,S=0,T="",I=r,x=o,b=i,E=T;w;)switch(h=S,S=Hn()){case 40:if(h!=108&&Ot(E,f-1)==58){Ss(E+=me(uc(S),"&","&\f"),"&\f")!=-1&&(C=-1);break}case 34:case 39:case 91:E+=uc(S);break;case 9:case 10:case 13:case 32:E+=JO(h);break;case 92:E+=YO(Cs()-1,7);continue;case 47:switch(pr()){case 42:case 47:ea(eN(XO(Hn(),Cs()),t,n,s),s);break;default:E+="/"}break;case 123*v:u[c++]=ei(E)*C;case 125*v:case 59:case 0:switch(S){case 0:case 125:w=0;case 59+l:C==-1&&(E=me(E,/\f/g,"")),p>0&&ei(E)-f&&ea(p>32?cp(E+";",i,n,f-1,s):cp(me(E," ","")+";",i,n,f-2,s),s);break;case 59:E+=";";default:if(ea(b=up(E,t,n,c,l,r,u,T,I=[],x=[],f,o),o),S===123)if(l===0)ws(E,t,b,b,I,o,f,u,x);else switch(d===99&&Ot(E,3)===110?100:d){case 100:case 108:case 109:case 115:ws(e,b,b,i&&ea(up(e,b,b,0,0,r,u,T,r,I=[],f,x),x),r,x,f,u,i?I:x);break;default:ws(E,b,b,b,[""],x,0,u,x)}}c=l=p=0,v=C=1,T=E="",f=a;break;case 58:f=1+ei(E),p=h;default:if(v<1){if(S==123)--v;else if(S==125&&v++==0&&WO()==125)continue}switch(E+=Ud(S),S*v){case 38:C=l>0?1:(E+="\f",-1);break;case 44:u[c++]=(ei(E)-1)*C,C=1;break;case 64:pr()===45&&(E+=uc(Hn())),d=pr(),l=f=ei(T=E+=QO(Cs())),S++;break;case 45:h===45&&ei(E)==2&&(v=0)}}return o}function up(e,t,n,i,r,o,a,u,s,c,l,f){for(var d=r-1,p=r===0?o:[""],h=Em(p),v=0,w=0,C=0;v<i;++v)for(var S=0,T=ro(e,d+1,d=FO(w=a[v])),I=e;S<h;++S)(I=Im(w>0?p[S]+" "+T:me(T,/&\f/g,p[S])))&&(s[C++]=I);return ku(e,t,n,r===0?ju:u,s,c,l,f)}function eN(e,t,n,i){return ku(e,t,n,wm,Ud(zO()),ro(e,2,-2),0,i)}function cp(e,t,n,i,r){return ku(e,t,n,Bd,ro(e,0,i),ro(e,i+1,-1),i,r)}function $m(e,t,n){switch(LO(e,t)){case 5103:return Be+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Be+e+e;case 4789:return sa+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Be+e+sa+e+Ye+e+e;case 5936:switch(Ot(e,t+11)){case 114:return Be+e+Ye+me(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Be+e+Ye+me(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Be+e+Ye+me(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Be+e+Ye+e+e;case 6165:return Be+e+Ye+"flex-"+e+e;case 5187:return Be+e+me(e,/(\w+).+(:[^]+)/,Be+"box-$1$2"+Ye+"flex-$1$2")+e;case 5443:return Be+e+Ye+"flex-item-"+me(e,/flex-|-self/g,"")+(li(e,/flex-|baseline/)?"":Ye+"grid-row-"+me(e,/flex-|-self/g,""))+e;case 4675:return Be+e+Ye+"flex-line-pack"+me(e,/align-content|flex-|-self/g,"")+e;case 5548:return Be+e+Ye+me(e,"shrink","negative")+e;case 5292:return Be+e+Ye+me(e,"basis","preferred-size")+e;case 6060:return Be+"box-"+me(e,"-grow","")+Be+e+Ye+me(e,"grow","positive")+e;case 4554:return Be+me(e,/([^-])(transform)/g,"$1"+Be+"$2")+e;case 6187:return me(me(me(e,/(zoom-|grab)/,Be+"$1"),/(image-set)/,Be+"$1"),e,"")+e;case 5495:case 3959:return me(e,/(image-set\([^]*)/,Be+"$1$`$1");case 4968:return me(me(e,/(.+:)(flex-)?(.*)/,Be+"box-pack:$3"+Ye+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Be+e+e;case 4200:if(!li(e,/flex-|baseline/))return Ye+"grid-column-align"+ro(e,t)+e;break;case 2592:case 3360:return Ye+me(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(i,r){return t=r,li(i.props,/grid-\w+-end/)})?~Ss(e+(n=n[t].value),"span")?e:Ye+me(e,"-start","")+e+Ye+"grid-row-span:"+(~Ss(n,"span")?li(n,/\d+/):+li(n,/\d+/)-+li(e,/\d+/))+";":Ye+me(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(i){return li(i.props,/grid-\w+-start/)})?e:Ye+me(me(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return me(e,/(.+)-inline(.+)/,Be+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ei(e)-1-t>6)switch(Ot(e,t+1)){case 109:if(Ot(e,t+4)!==45)break;case 102:return me(e,/(.+:)(.+)-([^]+)/,"$1"+Be+"$2-$3$1"+sa+(Ot(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ss(e,"stretch")?$m(me(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return me(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(i,r,o,a,u,s,c){return Ye+r+":"+o+c+(a?Ye+r+"-span:"+(u?s:+s-+o)+c:"")+e});case 4949:if(Ot(e,t+6)===121)return me(e,":",":"+Be)+e;break;case 6444:switch(Ot(e,Ot(e,14)===45?18:11)){case 120:return me(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Be+(Ot(e,14)===45?"inline-":"")+"box$3$1"+Be+"$2$3$1"+Ye+"$2box$3")+e;case 100:return me(e,":",":"+Ye)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return me(e,"scroll-","scroll-snap-")+e}return e}function Hs(e,t){for(var n="",i=0;i<e.length;i++)n+=t(e[i],i,e,t)||"";return n}function tN(e,t,n,i){switch(e.type){case VO:if(e.children.length)break;case UO:case Bd:return e.return=e.return||e.value;case wm:return"";case Tm:return e.return=e.value+"{"+Hs(e.children,i)+"}";case ju:if(!ei(e.value=e.props.join(",")))return""}return ei(n=Hs(e.children,i))?e.return=e.value+"{"+n+"}":""}function nN(e){var t=Em(e);return function(n,i,r,o){for(var a="",u=0;u<t;u++)a+=e[u](n,i,r,o)||"";return a}}function iN(e){return function(t){t.root||(t=t.return)&&e(t)}}function rN(e,t,n,i){if(e.length>-1&&!e.return)switch(e.type){case Bd:e.return=$m(e.value,e.length,n);return;case Tm:return Hs([Ri(e,{value:me(e.value,"@","@"+Be)})],i);case ju:if(e.length)return GO(n=e.props,function(r){switch(li(r,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Vr(Ri(e,{props:[me(r,/:(read-\w+)/,":"+sa+"$1")]})),Vr(Ri(e,{props:[r]})),Cl(e,{props:sp(n,i)});break;case"::placeholder":Vr(Ri(e,{props:[me(r,/:(plac\w+)/,":"+Be+"input-$1")]})),Vr(Ri(e,{props:[me(r,/:(plac\w+)/,":"+sa+"$1")]})),Vr(Ri(e,{props:[me(r,/:(plac\w+)/,Ye+"input-$1")]})),Vr(Ri(e,{props:[r]})),Cl(e,{props:sp(n,i)});break}return""})}}var oN={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Tr=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Vd=typeof window<"u"&&"HTMLElement"in window,aN=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:process.env.NODE_ENV!=="production"),lp=/invalid hook call/i,rs=new Set,sN=function(e,t){if(process.env.NODE_ENV!=="production"){var n=t?' with the id of "'.concat(t,'"'):"",i="The component ".concat(e).concat(n,` has been created dynamically.
|
|
133
|
+
*/var by;function j_(){return by||(by=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=eC();function n(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;function c(l,f,d,p,h){var v=o(null),C;v.current===null?(C={hasValue:!1,value:null},v.current=C):C=v.current;var E=s(function(){var S=!1,T,A,D=function(L){if(!S){S=!0,T=L;var V=p(L);if(h!==void 0&&C.hasValue){var H=C.value;if(h(H,V))return A=H,H}return A=V,V}var R=T,ie=A;if(r(R,L))return ie;var B=p(L);return h!==void 0&&h(ie,B)?ie:(T=L,A=B,B)},I=d===void 0?null:d,N=function(){return D(f())},j=I===null?void 0:function(){return D(I())};return[N,j]},[f,d,p,h]),y=E[0],w=E[1],x=i(l,y,w);return a(function(){C.hasValue=!0,C.value=x},[x]),u(x),x}_f.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),_f}process.env.NODE_ENV==="production"?mp.exports=M_():mp.exports=j_();var __=mp.exports,q_=O.useLayoutEffect;function Sy(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var nl=globalThis&&globalThis.__assign||function(){return nl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},nl.apply(this,arguments)},F_=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},L_=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function B_(e,t){var n=Sy(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=L_(O.useState(n),1),i=r[0];e!==i&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var o=t.context,a=t.guards,s=t.actions,u=t.activities,c=t.services,l=t.delays;t.state;var f=F_(t,["context","guards","actions","activities","services","delays","state"]),d=Sy(function(){var p={context:o,guards:a,actions:s,activities:u,services:c,delays:l},h=n.withConfig(p,function(){return nl(nl({},n.context),o)});return j0(h,f)});return q_(function(){Object.assign(d.machine.options.actions,s),Object.assign(d.machine.options.guards,a),Object.assign(d.machine.options.activities,u),Object.assign(d.machine.options.services,c),Object.assign(d.machine.options.delays,l)},[s,a,u,c,l]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function V_(e,t,n){if(e.status===kt.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var U_=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function G_(e){return e}function z_(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=U_(t,1),i=r[0],o=i===void 0?{}:i,a=B_(e,o),s=O.useCallback(function(){return a.status===kt.NotStarted?o.state?tr.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return V_(a,f,d)},[a]),c=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),l=__.useSyncExternalStoreWithSelector(c,s,s,G_,u);return O.useEffect(function(){var f=o.state;return a.start(f?tr.create(f):void 0),function(){a.stop(),a.status=kt.NotStarted}},[]),[l,a.send,a]}const tC=O.createContext(null),nC=O.createContext(null),W_=O.createContext(null),rC=O.createContext(null),lv=()=>O.useContext(tC),Ka=()=>O.useContext(rC),iC="The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";function fv(e){if(!e)throw new Error(iC)}function Ya(e){if(!e)throw new Error(iC)}function Gi(){const e=lv();return fv(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var H_=function(e){return e._tag==="Some"},lf=function(e){return function(t){return H_(e(t))}};const K_=lf(e=>e.type===W.Choice?je(e):be),Y_=lf(e=>e.type===W.Numeric?je(e):be),X_=lf(e=>e.type===W.Boolean?je(e):be),J_=lf(e=>e.type===W.Component?je(e):be);function ff(e){return e.decision!=null&&e.decision.kind===Oe.Explicit}function oC(e){return b(e.values,Jt(ff),z(t=>({type:W.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function Q_(e){return b(e,bu(ff),ee(()=>({type:W.Numeric,attributeId:e.id,state:null})))}function Z_(e){return b(e,bu(ff),ee(()=>({type:W.Boolean,attributeId:e.id,state:null})))}function eq(e){return b(e,bu(ff),ee(()=>({type:W.Component,attributeId:e.id,state:null})))}function tq(e,t){return b(za.filterAttributesOfComponent(t,e,!0),n=>[b(n,Jt(K_),pP(oC)),b(n,Jt(Y_),z(Q_),Xn),b(n,Jt(X_),z(Z_),Xn),b(n,Jt(J_),z(eq),Xn)],Vh)}function aC(){const e=lv();return fv(e),O.useMemo(()=>({explain:(t,n)=>Y(n).with("decisions",r=>e.explain(t,r)).with("constraints",r=>e.explain(t,r)).with("full",r=>e.explain(t,r)).exhaustive(),applySolution:t=>e.applySolution(t)}),[e])}function Eu(e,t=!1){const n=Ka();return Ya(n),O.useMemo(()=>b(ye(e),ee(sr(z(r=>za.getAttribute(n,r)),t?jo(ye):Mr)),st(()=>n.attributes)),[e,n,t])}function sC(e){const t=Ka(),{makeDecision:n,setManyDecision:r}=Gi(),i=df(e,et.choiceValue);Ya(t);const o=za.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,c)=>n({type:W.Choice,attributeId:e,choiceValueId:u,state:c}),clearDecisions:b(o,ye,ee(oC),Ht(Mo),ee(u=>()=>r(u,{type:"Default"})),st(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function nq(e){const t=Ka(),{makeDecision:n}=Gi(),r=df(e,et.numeric);Ya(t);const i=za.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:W.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function rq(e){const t=Ka(),{makeDecision:n}=Gi(),r=df(e,et.boolean);Ya(t);const i=za.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:W.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function iq(e){const t=Ka(),{makeDecision:n,setManyDecision:r}=Gi(),i=df(e,et.component);Ya(t);const o=t.attributes,a=za.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:c=>n({type:W.Component,attributeId:e,state:c}),clearSubtree:b(tq(e,o),bu(Mo),ee(c=>()=>r(c,{type:"Default"})),st(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function df(e,t){const{explain:n,applySolution:r}=aC();return O.useMemo(()=>({explain:(i,o)=>{const a=Y(i.question).with(Lt.whyIsNotSatisfied,()=>et.attribute).otherwise(()=>t),s={...i,subject:a,attributeId:e};return Y(o).with("decisions",u=>n(s,u)).with("constraints",u=>n(s,u)).with("full",u=>n(s,u)).exhaustive()},applySolution:r}),[e,t,n,r])}const wy=On(EM),oq=On(TM),aq=On((e,t)=>Uw(pt).equals(e??{},t??{})),sq=gn({attributeId:wy,decisions:_o(wy)}),uq=On((e,t)=>_o(sq).equals(e??[],t??[])),cq=gn({type:pt}),lq=gn({type:pt}),fq=gn({type:pt,rules:_o(oq)}),dq=On((e,t)=>Y({x:e,y:t}).returnType().with({x:{type:pn.all},y:{type:pn.all}},({x:n,y:r})=>cq.equals(n,r)).with({x:{type:pn.none},y:{type:pn.none}},({x:n,y:r})=>lq.equals(n,r)).with({x:{type:pn.specific},y:{type:pn.specific}},({x:n,y:r})=>fq.equals(n,r)).otherwise(()=>!1)),pq=gn({rules:Zl(dq)}),uC=gn({configurationModelSource:On((e,t)=>P_(e,t)),attributeRelations:uq,usageRuleParameters:aq,allowedInExplain:Zl(pq)}),yp=Zl(uC),hq=Lh,Ic=Zl(hq),vq=()=>av({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{desiredClient:null,desiredSessionContext:null,actualClient:null,session:null,sessionCreationError:null,sessionUpdateError:null,hasEverSuccessfullyCreatedSession:!1},initial:"ProcessChanges",on:{ChangeConfigurationClient:{actions:["saveDesiredClient"]},ChangeSessionContext:{actions:["saveDesiredSessionContext"]}},exit:[Vn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Vn("Entering ProcessChanges","SessionManagement:"),Xo(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Vn("Entering DisposeSession","SessionManagement:"),Xo(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Vn("Entering CreateSession","SessionManagement:"),Xo(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Vn("Entering SessionCreationFailed","SessionManagement:"),Xo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Vn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Vn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Vn("Entering UpdateSession","SessionManagement:"),Xo(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Vn("Entering SessionUpdateFailed","SessionManagement:"),Xo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Vn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Vn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Rn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Rn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Rn((e,t)=>(e.session&&e.session.close().then(Ur).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Rn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Rn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Rn({sessionCreationError:()=>null}),setSessionUpdateError:Rn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Rn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Rn({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:e=>e.desiredClient.createSession(e.desiredSessionContext).then(t=>({session:t,client:e.desiredClient})).catch(t=>Promise.reject({type:t.type,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({type:t.type,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!Ic.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!uC.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!Ic.equals(e.desiredClient,e.sessionCreationError.client)||!yp.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!Ic.equals(e.desiredClient,e.actualClient)||!yp.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Xo(e){const t=e===0,n=e===1;return v_((r,i)=>{const o={isInitializing:(!r.hasEverSuccessfullyCreatedSession||t)&&r.sessionCreationError==null,errorType:r.sessionCreationError&&r.sessionCreationError.type},a={isUpdating:n&&r.sessionUpdateError==null,errorType:r.sessionUpdateError&&r.sessionUpdateError.type};return _0({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const mq=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),yq=()=>av({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[_0((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Vn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Vn("Entering Subscribe","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{target:"ProcessChanges",cond:(e,t)=>t.session==null||e.session!==t.session,actions:["saveSession"]}},invoke:{id:"configurationSubscriptionActor",src:(e,t)=>mq(e.session)}}}},{actions:{saveSession:Rn((e,t)=>({session:t.session}))}}),gq=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},Cy=()=>{const e=gq();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var bq=function(e,t,n){var r=O.useRef(),i=O.useRef(0);return r.current==null&&(r.current=e),t.equals(e,r.current)||(n&&n.debug&&process.env.NODE_ENV!=="production"&&console.info("Stable hook update triggered:",{prev:r.current,value:e}),r.current=e,i.current+=1),[i.current]},xy=function(e,t,n,r){return O.useEffect(e,bq(t,n,r))};const Sq=()=>av({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:Cy()},entry:[Rn({sessionManagementActor:()=>cy(vq()),configurationSubscriptionManagementActor:()=>cy(yq())})],exit:[fy(e=>e.sessionManagementActor),fy(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[Ku(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[Ku(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[Ku(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[Ku(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Rn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),Ej(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Rn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Rn((e,t)=>{var n;const r=!((n=e.sessionInitialization)!=null&&n.isInitializing)&&e.session!=null&&e.configuration!=null&&e.configuration.session===e.session;return e.isReadyPromise&&r&&(e.isReadyPromise.resolve(),e.isReadyPromise.capsule.promise=null),{isReadyPromise:(()=>r?null:e.isReadyPromise!=null?e.isReadyPromise:Cy())()}})}});function wq(e){var t,n;const[r,i]=z_(Sq,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});xy(()=>{i({type:"ChangeConfigurationClient",client:e.configuratorClient}),e.configuratorClient||console.warn("The configurator client is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass a valid client.")},[e.configuratorClient],Bm(Ic)),xy(()=>{const u=b(ye(e.sessionContext),AP(c=>ye(c.configurationModelSource)),nr);i({type:"ChangeSessionContext",sessionContext:u}),u||console.warn("The session context is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass valid session context data.")},[e.sessionContext],Bm(yp));const o=O.useMemo(()=>{var u,c,l,f;return{isInitializing:((c=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:c.promise)!=null,isInitializingPromise:(l=r.context.isReadyPromise)==null?void 0:l.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.errorType)&&{type:r.context.sessionInitialization.errorType,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,c;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((c=r.context.sessionUpdating)==null?void 0:c.errorType)&&{type:r.context.sessionUpdating.errorType,retry:()=>i({type:"RetrySessionUpdate"})}}},[r.context.sessionUpdating]),s=((t=r.context.configuration)==null?void 0:t.session)===r.context.session?(n=r.context.configuration)==null?void 0:n.configuration:null;return{configurationInitialization:o,configurationUpdating:a,session:r.context.session,configuration:s}}function Cq(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=wq({configuratorClient:t,sessionContext:n});return $.jsx(nC.Provider,{value:r,children:$.jsx(W_.Provider,{value:i,children:$.jsx(tC.Provider,{value:o,children:$.jsx(rC.Provider,{value:a,children:e.children})})})})}function dv(){return O.useContext(nC)}function xq(e){const{children:t}=e,{isInitializingPromise:n}=dv();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function cC(){const e=lv(),t=Ka();return fv(e),Ya(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const Eq=O.createContext(null),qf={didCatch:!1,error:null};class Tq extends O.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=qf}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(qf)}}componentDidCatch(t,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&Iq(t.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(qf)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=t;if(o){const u={error:a,resetErrorBoundary:this.resetErrorBoundary};if(O.isValidElement(i))s=i;else if(typeof n=="function")s=n(u);else if(r)s=O.createElement(r,u);else throw a}return O.createElement(Eq.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function Iq(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}var xn=function(){return xn=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},xn.apply(this,arguments)};function Aq(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Io(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function $q(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Oq=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Dq=$q(function(e){return Oq.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Ct="-ms-",Ns="-moz-",at="-webkit-",lC="comm",pf="rule",pv="decl",Nq="@import",fC="@keyframes",Pq="@layer",Rq=Math.abs,hv=String.fromCharCode,gp=Object.assign;function kq(e,t){return nn(e,0)^45?(((t<<2^nn(e,0))<<2^nn(e,1))<<2^nn(e,2))<<2^nn(e,3):0}function dC(e){return e.trim()}function Lr(e,t){return(e=t.exec(e))?e[0]:e}function ke(e,t,n){return e.replace(t,n)}function Ac(e,t){return e.indexOf(t)}function nn(e,t){return e.charCodeAt(t)|0}function Ca(e,t,n){return e.slice(t,n)}function $r(e){return e.length}function pC(e){return e.length}function xs(e,t){return t.push(e),e}function Mq(e,t){return e.map(t).join("")}function Ey(e,t){return e.filter(function(n){return!Lr(n,t)})}var hf=1,xa=1,hC=0,ur=0,zt=0,Xa="";function vf(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:hf,column:xa,length:a,return:"",siblings:s}}function bi(e,t){return gp(vf("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Jo(e){for(;e.root;)e=bi(e.root,{children:[e]});xs(e,e.siblings)}function jq(){return zt}function _q(){return zt=ur>0?nn(Xa,--ur):0,xa--,zt===10&&(xa=1,hf--),zt}function Cr(){return zt=ur<hC?nn(Xa,ur++):0,xa++,zt===10&&(xa=1,hf++),zt}function mo(){return nn(Xa,ur)}function $c(){return ur}function mf(e,t){return Ca(Xa,e,t)}function bp(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function qq(e){return hf=xa=1,hC=$r(Xa=e),ur=0,[]}function Fq(e){return Xa="",e}function Ff(e){return dC(mf(ur-1,Sp(e===91?e+2:e===40?e+1:e)))}function Lq(e){for(;(zt=mo())&&zt<33;)Cr();return bp(e)>2||bp(zt)>3?"":" "}function Bq(e,t){for(;--t&&Cr()&&!(zt<48||zt>102||zt>57&&zt<65||zt>70&&zt<97););return mf(e,$c()+(t<6&&mo()==32&&Cr()==32))}function Sp(e){for(;Cr();)switch(zt){case e:return ur;case 34:case 39:e!==34&&e!==39&&Sp(zt);break;case 40:e===41&&Sp(e);break;case 92:Cr();break}return ur}function Vq(e,t){for(;Cr()&&e+zt!==47+10;)if(e+zt===42+42&&mo()===47)break;return"/*"+mf(t,ur-1)+"*"+hv(e===47?e:Cr())}function Uq(e){for(;!bp(mo());)Cr();return mf(e,ur)}function Gq(e){return Fq(Oc("",null,null,null,[""],e=qq(e),0,[0],e))}function Oc(e,t,n,r,i,o,a,s,u){for(var c=0,l=0,f=a,d=0,p=0,h=0,v=1,C=1,E=1,y=0,w="",x=i,S=o,T=r,A=w;C;)switch(h=y,y=Cr()){case 40:if(h!=108&&nn(A,f-1)==58){Ac(A+=ke(Ff(y),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:A+=Ff(y);break;case 9:case 10:case 13:case 32:A+=Lq(h);break;case 92:A+=Bq($c()-1,7);continue;case 47:switch(mo()){case 42:case 47:xs(zq(Vq(Cr(),$c()),t,n,u),u);break;default:A+="/"}break;case 123*v:s[c++]=$r(A)*E;case 125*v:case 59:case 0:switch(y){case 0:case 125:C=0;case 59+l:E==-1&&(A=ke(A,/\f/g,"")),p>0&&$r(A)-f&&xs(p>32?Iy(A+";",r,n,f-1,u):Iy(ke(A," ","")+";",r,n,f-2,u),u);break;case 59:A+=";";default:if(xs(T=Ty(A,t,n,c,l,i,s,w,x=[],S=[],f,o),o),y===123)if(l===0)Oc(A,t,T,T,x,o,f,s,S);else switch(d===99&&nn(A,3)===110?100:d){case 100:case 108:case 109:case 115:Oc(e,T,T,r&&xs(Ty(e,T,T,0,0,i,s,w,i,x=[],f,S),S),i,S,f,s,r?x:S);break;default:Oc(A,T,T,T,[""],S,0,s,S)}}c=l=p=0,v=E=1,w=A="",f=a;break;case 58:f=1+$r(A),p=h;default:if(v<1){if(y==123)--v;else if(y==125&&v++==0&&_q()==125)continue}switch(A+=hv(y),y*v){case 38:E=l>0?1:(A+="\f",-1);break;case 44:s[c++]=($r(A)-1)*E,E=1;break;case 64:mo()===45&&(A+=Ff(Cr())),d=mo(),l=f=$r(w=A+=Uq($c())),y++;break;case 45:h===45&&$r(A)==2&&(v=0)}}return o}function Ty(e,t,n,r,i,o,a,s,u,c,l,f){for(var d=i-1,p=i===0?o:[""],h=pC(p),v=0,C=0,E=0;v<r;++v)for(var y=0,w=Ca(e,d+1,d=Rq(C=a[v])),x=e;y<h;++y)(x=dC(C>0?p[y]+" "+w:ke(w,/&\f/g,p[y])))&&(u[E++]=x);return vf(e,t,n,i===0?pf:s,u,c,l,f)}function zq(e,t,n,r){return vf(e,t,n,lC,hv(jq()),Ca(e,2,-2),0,r)}function Iy(e,t,n,r,i){return vf(e,t,n,pv,Ca(e,0,r),Ca(e,r+1,-1),r,i)}function vC(e,t,n){switch(kq(e,t)){case 5103:return at+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return at+e+e;case 4789:return Ns+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return at+e+Ns+e+Ct+e+e;case 5936:switch(nn(e,t+11)){case 114:return at+e+Ct+ke(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return at+e+Ct+ke(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return at+e+Ct+ke(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return at+e+Ct+e+e;case 6165:return at+e+Ct+"flex-"+e+e;case 5187:return at+e+ke(e,/(\w+).+(:[^]+)/,at+"box-$1$2"+Ct+"flex-$1$2")+e;case 5443:return at+e+Ct+"flex-item-"+ke(e,/flex-|-self/g,"")+(Lr(e,/flex-|baseline/)?"":Ct+"grid-row-"+ke(e,/flex-|-self/g,""))+e;case 4675:return at+e+Ct+"flex-line-pack"+ke(e,/align-content|flex-|-self/g,"")+e;case 5548:return at+e+Ct+ke(e,"shrink","negative")+e;case 5292:return at+e+Ct+ke(e,"basis","preferred-size")+e;case 6060:return at+"box-"+ke(e,"-grow","")+at+e+Ct+ke(e,"grow","positive")+e;case 4554:return at+ke(e,/([^-])(transform)/g,"$1"+at+"$2")+e;case 6187:return ke(ke(ke(e,/(zoom-|grab)/,at+"$1"),/(image-set)/,at+"$1"),e,"")+e;case 5495:case 3959:return ke(e,/(image-set\([^]*)/,at+"$1$`$1");case 4968:return ke(ke(e,/(.+:)(flex-)?(.*)/,at+"box-pack:$3"+Ct+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+at+e+e;case 4200:if(!Lr(e,/flex-|baseline/))return Ct+"grid-column-align"+Ca(e,t)+e;break;case 2592:case 3360:return Ct+ke(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,Lr(r.props,/grid-\w+-end/)})?~Ac(e+(n=n[t].value),"span")?e:Ct+ke(e,"-start","")+e+Ct+"grid-row-span:"+(~Ac(n,"span")?Lr(n,/\d+/):+Lr(n,/\d+/)-+Lr(e,/\d+/))+";":Ct+ke(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Lr(r.props,/grid-\w+-start/)})?e:Ct+ke(ke(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return ke(e,/(.+)-inline(.+)/,at+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if($r(e)-1-t>6)switch(nn(e,t+1)){case 109:if(nn(e,t+4)!==45)break;case 102:return ke(e,/(.+:)(.+)-([^]+)/,"$1"+at+"$2-$3$1"+Ns+(nn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ac(e,"stretch")?vC(ke(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return ke(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,u,c){return Ct+i+":"+o+c+(a?Ct+i+"-span:"+(s?u:+u-+o)+c:"")+e});case 4949:if(nn(e,t+6)===121)return ke(e,":",":"+at)+e;break;case 6444:switch(nn(e,nn(e,14)===45?18:11)){case 120:return ke(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+at+(nn(e,14)===45?"inline-":"")+"box$3$1"+at+"$2$3$1"+Ct+"$2box$3")+e;case 100:return ke(e,":",":"+Ct)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return ke(e,"scroll-","scroll-snap-")+e}return e}function rl(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Wq(e,t,n,r){switch(e.type){case Pq:if(e.children.length)break;case Nq:case pv:return e.return=e.return||e.value;case lC:return"";case fC:return e.return=e.value+"{"+rl(e.children,r)+"}";case pf:if(!$r(e.value=e.props.join(",")))return""}return $r(n=rl(e.children,r))?e.return=e.value+"{"+n+"}":""}function Hq(e){var t=pC(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function Kq(e){return function(t){t.root||(t=t.return)&&e(t)}}function Yq(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case pv:e.return=vC(e.value,e.length,n);return;case fC:return rl([bi(e,{value:ke(e.value,"@","@"+at)})],r);case pf:if(e.length)return Mq(n=e.props,function(i){switch(Lr(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Jo(bi(e,{props:[ke(i,/:(read-\w+)/,":"+Ns+"$1")]})),Jo(bi(e,{props:[i]})),gp(e,{props:Ey(n,r)});break;case"::placeholder":Jo(bi(e,{props:[ke(i,/:(plac\w+)/,":"+at+"input-$1")]})),Jo(bi(e,{props:[ke(i,/:(plac\w+)/,":"+Ns+"$1")]})),Jo(bi(e,{props:[ke(i,/:(plac\w+)/,Ct+"input-$1")]})),Jo(bi(e,{props:[i]})),gp(e,{props:Ey(n,r)});break}return""})}}var Xq={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ao=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",vv=typeof window<"u"&&"HTMLElement"in window,Jq=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:process.env.NODE_ENV!=="production"),Qq={},Ay=/invalid hook call/i,Xu=new Set,mC=function(e,t){if(process.env.NODE_ENV!=="production"){var n=t?' with the id of "'.concat(t,'"'):"",r="The component ".concat(e).concat(n,` has been created dynamically.
|
|
134
134
|
`)+`You may see this warning because you've called styled inside another component.
|
|
135
|
-
To resolve this only create new StyledComponents outside of any render method and function component.`,
|
|
135
|
+
To resolve this only create new StyledComponents outside of any render method and function component.`,i=console.error;try{var o=!0;console.error=function(a){for(var s=[],u=1;u<arguments.length;u++)s[u-1]=arguments[u];Ay.test(a)?(o=!1,Xu.delete(r)):i.apply(void 0,Io([a],s,!1))},O.useRef(),o&&!Xu.has(r)&&(console.warn(r),Xu.add(r))}catch(a){Ay.test(a.message)&&Xu.delete(r)}finally{console.error=i}}},yf=Object.freeze([]),Ea=Object.freeze({});function yC(e,t,n){return n===void 0&&(n=Ea),e.theme!==n.theme&&e.theme||t||n.theme}var wp=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Zq=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,eF=/(^-|-$)/g;function $y(e){return e.replace(Zq,"-").replace(eF,"")}var tF=/(a)(d)/gi,Oy=function(e){return String.fromCharCode(e+(e>25?39:97))};function Cp(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Oy(t%52)+n;return(Oy(t%52)+n).replace(tF,"$1-$2")}var Lf,so=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},gC=function(e){return so(5381,e)};function bC(e){return Cp(gC(e)>>>0)}function SC(e){return process.env.NODE_ENV!=="production"&&typeof e=="string"&&e||e.displayName||e.name||"Component"}function Bf(e){return typeof e=="string"&&(process.env.NODE_ENV==="production"||e.charAt(0)===e.charAt(0).toLowerCase())}var wC=typeof Symbol=="function"&&Symbol.for,CC=wC?Symbol.for("react.memo"):60115,nF=wC?Symbol.for("react.forward_ref"):60112,rF={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},iF={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},xC={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},oF=((Lf={})[nF]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Lf[CC]=xC,Lf);function Dy(e){return("type"in(t=e)&&t.type.$$typeof)===CC?xC:"$$typeof"in e?oF[e.$$typeof]:rF;var t}var aF=Object.defineProperty,sF=Object.getOwnPropertyNames,Ny=Object.getOwnPropertySymbols,uF=Object.getOwnPropertyDescriptor,cF=Object.getPrototypeOf,Py=Object.prototype;function EC(e,t,n){if(typeof t!="string"){if(Py){var r=cF(t);r&&r!==Py&&EC(e,r,n)}var i=sF(t);Ny&&(i=i.concat(Ny(t)));for(var o=Dy(e),a=Dy(t),s=0;s<i.length;++s){var u=i[s];if(!(u in iF||n&&n[u]||a&&u in a||o&&u in o)){var c=uF(t,u);try{aF(e,u,c)}catch{}}}}return e}function Ta(e){return typeof e=="function"}function mv(e){return typeof e=="object"&&"styledComponentId"in e}function uo(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function xp(e,t){if(e.length===0)return"";for(var n=e[0],r=1;r<e.length;r++)n+=t?t+e[r]:e[r];return n}function Ia(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Ep(e,t,n){if(n===void 0&&(n=!1),!n&&!Ia(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Ep(e[r],t[r]);else if(Ia(t))for(var r in t)e[r]=Ep(e[r],t[r]);return e}function yv(e,t){Object.defineProperty(e,"toString",{value:t})}var lF=process.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
|
|
136
136
|
|
|
137
137
|
`,2:`Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
|
|
138
138
|
|
|
@@ -173,10 +173,10 @@ as for instance in your render method then you may be running into this limitati
|
|
|
173
173
|
|
|
174
174
|
`,17:`CSSStyleSheet could not be found on HTMLStyleElement.
|
|
175
175
|
Has styled-components' style tag been unmounted or altered by another script?
|
|
176
|
-
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function
|
|
177
|
-
`);return n},e}(),
|
|
178
|
-
`),
|
|
179
|
-
`)},l=0;l<
|
|
176
|
+
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function fF(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],i=1,o=e.length;i<o;i+=1)r.push(e[i]);return r.forEach(function(a){n=n.replace(/%[a-z]/,a)}),n}function Ja(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(fF.apply(void 0,Io([lF[e]],t,!1)).trim())}var dF=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r<t;r++)n+=this.groupSizes[r];return n},e.prototype.insertRules=function(t,n){if(t>=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,o=i;t>=o;)if((o<<=1)<0)throw Ja(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=i;a<o;a++)this.groupSizes[a]=0}for(var s=this.indexOfGroup(t+1),u=(a=0,n.length);a<u;a++)this.tag.insertRule(s,n[a])&&(this.groupSizes[t]++,s++)},e.prototype.clearGroup=function(t){if(t<this.length){var n=this.groupSizes[t],r=this.indexOfGroup(t),i=r+n;this.groupSizes[t]=0;for(var o=r;o<i;o++)this.tag.deleteRule(r)}},e.prototype.getGroup=function(t){var n="";if(t>=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),o=i+r,a=i;a<o;a++)n+="".concat(this.tag.getRule(a)).concat(`/*!sc*/
|
|
177
|
+
`);return n},e}(),Dc=new Map,il=new Map,Nc=1,Ju=function(e){if(Dc.has(e))return Dc.get(e);for(;il.has(Nc);)Nc++;var t=Nc++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>1073741824))throw Ja(16,"".concat(t));return Dc.set(e,t),il.set(t,e),t},pF=function(e,t){Nc=t+1,Dc.set(e,t),il.set(t,e)},hF="style[".concat(Ao,"][").concat("data-styled-version",'="').concat("6.1.1",'"]'),vF=new RegExp("^".concat(Ao,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),mF=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o<a;o++)(r=i[o])&&e.registerName(t,r)},yF=function(e,t){for(var n,r=((n=t.textContent)!==null&&n!==void 0?n:"").split(`/*!sc*/
|
|
178
|
+
`),i=[],o=0,a=r.length;o<a;o++){var s=r[o].trim();if(s){var u=s.match(vF);if(u){var c=0|parseInt(u[1],10),l=u[2];c!==0&&(pF(l,c),mF(e,l,u[3]),e.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}};function gF(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var TC=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(s){var u=Array.from(s.querySelectorAll("style[".concat(Ao,"]")));return u[u.length-1]}(n),o=i!==void 0?i.nextSibling:null;r.setAttribute(Ao,"active"),r.setAttribute("data-styled-version","6.1.1");var a=gF();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},bF=function(){function e(t){this.element=TC(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(n){if(n.sheet)return n.sheet;for(var r=document.styleSheets,i=0,o=r.length;i<o;i++){var a=r[i];if(a.ownerNode===n)return a}throw Ja(17)}(this.element),this.length=0}return e.prototype.insertRule=function(t,n){try{return this.sheet.insertRule(n,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var n=this.sheet.cssRules[t];return n&&n.cssText?n.cssText:""},e}(),SF=function(){function e(t){this.element=TC(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,n){if(t<=this.length&&t>=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),wF=function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,n){return t<=this.length&&(this.rules.splice(t,0,n),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),Ry=vv,CF={isServer:!vv,useCSSOMInjection:!Jq},ol=function(){function e(t,n,r){t===void 0&&(t=Ea),n===void 0&&(n={});var i=this;this.options=xn(xn({},CF),t),this.gs=n,this.names=new Map(r),this.server=!!t.isServer,!this.server&&vv&&Ry&&(Ry=!1,function(o){for(var a=document.querySelectorAll(hF),s=0,u=a.length;s<u;s++){var c=a[s];c&&c.getAttribute(Ao)!=="active"&&(yF(o,c),c.parentNode&&c.parentNode.removeChild(c))}}(this)),yv(this,function(){return function(o){for(var a=o.getTag(),s=a.length,u="",c=function(f){var d=function(E){return il.get(E)}(f);if(d===void 0)return"continue";var p=o.names.get(d),h=a.getGroup(f);if(p===void 0||h.length===0)return"continue";var v="".concat(Ao,".g").concat(f,'[id="').concat(d,'"]'),C="";p!==void 0&&p.forEach(function(E){E.length>0&&(C+="".concat(E,","))}),u+="".concat(h).concat(v,'{content:"').concat(C,'"}').concat(`/*!sc*/
|
|
179
|
+
`)},l=0;l<s;l++)c(l);return u}(i)})}return e.registerId=function(t){return Ju(t)},e.prototype.reconstructWithOptions=function(t,n){return n===void 0&&(n=!0),new e(xn(xn({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(n){var r=n.useCSSOMInjection,i=n.target;return n.isServer?new wF(i):r?new bF(i):new SF(i)}(this.options),new dF(t)));var t},e.prototype.hasNameForId=function(t,n){return this.names.has(t)&&this.names.get(t).has(n)},e.prototype.registerName=function(t,n){if(Ju(t),this.names.has(t))this.names.get(t).add(n);else{var r=new Set;r.add(n),this.names.set(t,r)}},e.prototype.insertRules=function(t,n,r){this.registerName(t,n),this.getTag().insertRules(Ju(t),r)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(Ju(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e}(),xF=/&/g,EF=/^\s*\/\/.*$/gm;function IC(e,t){return e.map(function(n){return n.type==="rule"&&(n.value="".concat(t," ").concat(n.value),n.value=n.value.replaceAll(",",",".concat(t," ")),n.props=n.props.map(function(r){return"".concat(t," ").concat(r)})),Array.isArray(n.children)&&n.type!=="@keyframes"&&(n.children=IC(n.children,t)),n})}function TF(e){var t,n,r,i=e===void 0?Ea:e,o=i.options,a=o===void 0?Ea:o,s=i.plugins,u=s===void 0?yf:s,c=function(d,p,h){return h===n||h.startsWith(n)&&h.endsWith(n)&&h.replaceAll(n,"").length>0?".".concat(t):d},l=u.slice();l.push(function(d){d.type===pf&&d.value.includes("&")&&(d.props[0]=d.props[0].replace(xF,n).replace(r,c))}),a.prefix&&l.push(Yq),l.push(Wq);var f=function(d,p,h,v){p===void 0&&(p=""),h===void 0&&(h=""),v===void 0&&(v="&"),t=v,n=p,r=new RegExp("\\".concat(n,"\\b"),"g");var C=d.replace(EF,""),E=Gq(h||p?"".concat(h," ").concat(p," { ").concat(C," }"):C);a.namespace&&(E=IC(E,a.namespace));var y=[];return rl(E,Hq(l.concat(Kq(function(w){return y.push(w)})))),y};return f.hash=u.length?u.reduce(function(d,p){return p.name||Ja(15),so(d,p.name)},5381).toString():"",f}var IF=new ol,Tp=TF(),AC=O.createContext({shouldForwardProp:void 0,styleSheet:IF,stylis:Tp});AC.Consumer;O.createContext(void 0);function Ip(){return O.useContext(AC)}var ky=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=Tp);var a=r.name+o.hash;i.hasNameForId(r.id,a)||i.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,yv(this,function(){throw Ja(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Tp),this.name+t.hash},e}(),AF=function(e){return e>="A"&&e<="Z"};function My(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(n===1&&r==="-"&&e[0]==="-")return e;AF(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var $C=function(e){return e==null||e===!1||e===""},OC=function(e){var t,n,r=[];for(var i in e){var o=e[i];e.hasOwnProperty(i)&&!$C(o)&&(Array.isArray(o)&&o.isCss||Ta(o)?r.push("".concat(My(i),":"),o,";"):Ia(o)?r.push.apply(r,Io(Io(["".concat(i," {")],OC(o),!1),["}"],!1)):r.push("".concat(My(i),": ").concat((t=i,(n=o)==null||typeof n=="boolean"||n===""?"":typeof n!="number"||n===0||t in Xq||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Oi(e,t,n,r){if($C(e))return[];if(mv(e))return[".".concat(e.styledComponentId)];if(Ta(e)){if(!Ta(o=e)||o.prototype&&o.prototype.isReactComponent||!t)return[e];var i=e(t);return process.env.NODE_ENV==="production"||typeof i!="object"||Array.isArray(i)||i instanceof ky||Ia(i)||i===null||console.error("".concat(SC(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Oi(i,t,n,r)}var o;return e instanceof ky?n?(e.inject(n,r),[e.getName(r)]):[e]:Ia(e)?OC(e):Array.isArray(e)?Array.prototype.concat.apply(yf,e.map(function(a){return Oi(a,t,n,r)})):[e.toString()]}function DC(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Ta(n)&&!mv(n))return!1}return!0}var $F=gC("6.1.1"),OF=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(r===void 0||r.isStatic)&&DC(t),this.componentId=n,this.baseHash=so($F,n),this.baseStyle=r,ol.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,n,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(this.componentId,this.staticRulesId))i=uo(i,this.staticRulesId);else{var o=xp(Oi(this.rules,t,n,r)),a=Cp(so(this.baseHash,o)>>>0);if(!n.hasNameForId(this.componentId,a)){var s=r(o,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,s)}i=uo(i,a),this.staticRulesId=a}else{for(var u=so(this.baseHash,r.hash),c="",l=0;l<this.rules.length;l++){var f=this.rules[l];if(typeof f=="string")c+=f,process.env.NODE_ENV!=="production"&&(u=so(u,f));else if(f){var d=xp(Oi(f,t,n,r));u=so(u,d+l),c+=d}}if(c){var p=Cp(u>>>0);n.hasNameForId(this.componentId,p)||n.insertRules(this.componentId,p,r(c,".".concat(p),void 0,this.componentId)),i=uo(i,p)}}return i},e}(),gv=O.createContext(void 0);gv.Consumer;var Vf={},jy=new Set;function DF(e,t,n){var r=mv(e),i=e,o=!Bf(e),a=t.attrs,s=a===void 0?yf:a,u=t.componentId,c=u===void 0?function(x,S){var T=typeof x!="string"?"sc":$y(x);Vf[T]=(Vf[T]||0)+1;var A="".concat(T,"-").concat(bC("6.1.1"+T+Vf[T]));return S?"".concat(S,"-").concat(A):A}(t.displayName,t.parentComponentId):u,l=t.displayName,f=l===void 0?function(x){return Bf(x)?"styled.".concat(x):"Styled(".concat(SC(x),")")}(e):l,d=t.displayName&&t.componentId?"".concat($y(t.displayName),"-").concat(t.componentId):t.componentId||c,p=r&&i.attrs?i.attrs.concat(s).filter(Boolean):s,h=t.shouldForwardProp;if(r&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var C=t.shouldForwardProp;h=function(x,S){return v(x,S)&&C(x,S)}}else h=v}var E=new OF(n,d,r?i.componentStyle:void 0);function y(x,S){return function(T,A,D){var I=T.attrs,N=T.componentStyle,j=T.defaultProps,L=T.foldedComponentIds,V=T.styledComponentId,H=T.target,R=O.useContext(gv),ie=Ip(),B=T.shouldForwardProp||ie.shouldForwardProp;process.env.NODE_ENV!=="production"&&O.useDebugValue(V);var U=function(K,ae,de){for(var ve,Ee=xn(xn({},ae),{className:void 0,theme:de}),Re=0;Re<K.length;Re+=1){var De=Ta(ve=K[Re])?ve(Ee):ve;for(var yt in De)Ee[yt]=yt==="className"?uo(Ee[yt],De[yt]):yt==="style"?xn(xn({},Ee[yt]),De[yt]):De[yt]}return ae.className&&(Ee.className=uo(Ee.className,ae.className)),Ee}(I,A,yC(A,R,j)||Ea),fe=U.as||H,M={};for(var P in U)U[P]===void 0||P[0]==="$"||P==="as"||P==="theme"||(P==="forwardedAs"?M.as=U.forwardedAs:B&&!B(P,fe)||(M[P]=U[P],B||process.env.NODE_ENV!=="development"||Dq(P)||jy.has(P)||!wp.has(fe)||(jy.add(P),console.warn('styled-components: it looks like an unknown prop "'.concat(P,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var te=function(K,ae){var de=Ip(),ve=K.generateAndInjectStyles(ae,de.styleSheet,de.stylis);return process.env.NODE_ENV!=="production"&&O.useDebugValue(ve),ve}(N,U);process.env.NODE_ENV!=="production"&&T.warnTooManyClasses&&T.warnTooManyClasses(te);var oe=uo(L,V);return te&&(oe+=" "+te),U.className&&(oe+=" "+U.className),M[Bf(fe)&&!wp.has(fe)?"class":"className"]=oe,M.ref=D,O.createElement(fe,M)}(w,x,S)}y.displayName=f;var w=O.forwardRef(y);return w.attrs=p,w.componentStyle=E,w.displayName=f,w.shouldForwardProp=h,w.foldedComponentIds=r?uo(i.foldedComponentIds,i.styledComponentId):"",w.styledComponentId=d,w.target=r?i.target:e,Object.defineProperty(w,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(x){this._foldedDefaultProps=r?function(S){for(var T=[],A=1;A<arguments.length;A++)T[A-1]=arguments[A];for(var D=0,I=T;D<I.length;D++)Ep(S,I[D],!0);return S}({},i.defaultProps,x):x}}),process.env.NODE_ENV!=="production"&&(mC(f,d),w.warnTooManyClasses=function(x,S){var T={},A=!1;return function(D){if(!A&&(T[D]=!0,Object.keys(T).length>=200)){var I=S?' with the id of "'.concat(S,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(x).concat(I,`.
|
|
180
180
|
`)+`Consider using the attrs method, together with a style object for frequently changed styles.
|
|
181
181
|
Example:
|
|
182
182
|
const Component = styled.div.attrs(props => ({
|
|
@@ -185,22 +185,1223 @@ Example:
|
|
|
185
185
|
},
|
|
186
186
|
}))\`width: 100%;\`
|
|
187
187
|
|
|
188
|
-
<Component />`),
|
|
188
|
+
<Component />`),A=!0,T={}}}}(f,d)),yv(w,function(){return".".concat(w.styledComponentId)}),o&&EC(w,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),w}function _y(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var qy=function(e){return Object.assign(e,{isCss:!0})};function bv(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Ta(e)||Ia(e)){var r=e;return qy(Oi(_y(yf,Io([r],t,!0))))}var i=e;return t.length===0&&i.length===1&&typeof i[0]=="string"?Oi(i):qy(Oi(_y(i,t)))}function Ap(e,t,n){if(n===void 0&&(n=Ea),!t)throw Ja(1,t);var r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return e(t,n,bv.apply(void 0,Io([i],o,!1)))};return r.attrs=function(i){return Ap(e,t,xn(xn({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return Ap(e,t,xn(xn({},n),i))},r}var NC=function(e){return Ap(DF,e)},Ae=NC;wp.forEach(function(e){Ae[e]=NC(e)});var NF=function(){function e(t,n){this.rules=t,this.componentId=n,this.isStatic=DC(t),ol.registerId(this.componentId+1)}return e.prototype.createStyles=function(t,n,r,i){var o=i(xp(Oi(this.rules,n,r,i)),""),a=this.componentId+t;r.insertRules(a,a,o)},e.prototype.removeStyles=function(t,n){n.clearRules(this.componentId+t)},e.prototype.renderStyles=function(t,n,r,i){t>2&&ol.registerId(this.componentId+t),this.removeStyles(t,r),this.createStyles(t,n,r,i)},e}();function gf(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=bv.apply(void 0,Io([e],t,!1)),i="sc-global-".concat(bC(JSON.stringify(r))),o=new NF(r,i);process.env.NODE_ENV!=="production"&&mC(i);var a=function(u){var c=Ip(),l=O.useContext(gv),f=O.useRef(c.styleSheet.allocateGSInstance(i)).current;return process.env.NODE_ENV!=="production"&&O.Children.count(u.children)&&console.warn("The global style component ".concat(i," was given child JSX. createGlobalStyle does not render children.")),process.env.NODE_ENV!=="production"&&r.some(function(d){return typeof d=="string"&&d.indexOf("@import")!==-1})&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),c.styleSheet.server&&s(f,u,c.styleSheet,l,c.stylis),O.useLayoutEffect(function(){if(!c.styleSheet.server)return s(f,u,c.styleSheet,l,c.stylis),function(){return o.removeStyles(f,c.styleSheet)}},[f,u,c.styleSheet,l,c.stylis]),null};function s(u,c,l,f,d){if(o.isStatic)o.renderStyles(u,Qq,l,d);else{var p=xn(xn({},c),{theme:yC(c,f,a.defaultProps)});o.renderStyles(u,p,l,d)}}return O.memo(a)}process.env.NODE_ENV!=="production"&&typeof navigator<"u"&&navigator.product==="ReactNative"&&console.warn(`It looks like you've imported 'styled-components' on React Native.
|
|
189
189
|
Perhaps you're looking to import 'styled-components/native'?
|
|
190
|
-
Read more about this at https://www.styled-components.com/docs/basics#react-native`);var
|
|
190
|
+
Read more about this at https://www.styled-components.com/docs/basics#react-native`);var Qu="__sc-".concat(Ao,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[Qu]||(window[Qu]=0),window[Qu]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
|
|
191
191
|
|
|
192
|
-
See https://s-c.sh/2BAXzed for more info.`),window[
|
|
192
|
+
See https://s-c.sh/2BAXzed for more info.`),window[Qu]+=1);var PF={prefix:"fas",iconName:"minus",icon:[448,512,[8211,8722,10134,"subtract"],"f068","M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"]},RF={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"]},PC={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]};function Fy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fy(Object(n),!0).forEach(function(r){Zt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function al(e){"@babel/helpers - typeof";return al=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},al(e)}function kF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ly(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function MF(e,t,n){return t&&Ly(e.prototype,t),n&&Ly(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sv(e,t){return _F(e)||FF(e,t)||RC(e,t)||BF()}function Tu(e){return jF(e)||qF(e)||RC(e)||LF()}function jF(e){if(Array.isArray(e))return $p(e)}function _F(e){if(Array.isArray(e))return e}function qF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function FF(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function RC(e,t){if(e){if(typeof e=="string")return $p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $p(e,t)}}function $p(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
193
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
194
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var By=function(){},wv={},kC={},MC=null,jC={mark:By,measure:By};try{typeof window<"u"&&(wv=window),typeof document<"u"&&(kC=document),typeof MutationObserver<"u"&&(MC=MutationObserver),typeof performance<"u"&&(jC=performance)}catch{}var VF=wv.navigator||{},Vy=VF.userAgent,Uy=Vy===void 0?"":Vy,ji=wv,It=kC,Gy=MC,Zu=jC;ji.document;var ui=!!It.documentElement&&!!It.head&&typeof It.addEventListener=="function"&&typeof It.createElement=="function",_C=~Uy.indexOf("MSIE")||~Uy.indexOf("Trident/"),ec,tc,nc,rc,ic,ri="___FONT_AWESOME___",Op=16,qC="fa",FC="svg-inline--fa",$o="data-fa-i2svg",Dp="data-fa-pseudo-element",UF="data-fa-pseudo-element-pending",Cv="data-prefix",xv="data-icon",zy="fontawesome-i2svg",GF="async",zF=["HTML","HEAD","STYLE","SCRIPT"],LC=function(){try{return process.env.NODE_ENV==="production"}catch{return!1}}(),Et="classic",_t="sharp",Ev=[Et,_t];function Iu(e){return new Proxy(e,{get:function(n,r){return r in n?n[r]:n[Et]}})}var Qs=Iu((ec={},Zt(ec,Et,{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands",fak:"kit",fakd:"kit","fa-kit":"kit","fa-kit-duotone":"kit"}),Zt(ec,_t,{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"}),ec)),Zs=Iu((tc={},Zt(tc,Et,{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab",kit:"fak"}),Zt(tc,_t,{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"}),tc)),eu=Iu((nc={},Zt(nc,Et,{fab:"fa-brands",fad:"fa-duotone",fak:"fa-kit",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"}),Zt(nc,_t,{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"}),nc)),WF=Iu((rc={},Zt(rc,Et,{"fa-brands":"fab","fa-duotone":"fad","fa-kit":"fak","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"}),Zt(rc,_t,{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"}),rc)),HF=/fa(s|r|l|t|d|b|k|ss|sr|sl|st)?[\-\ ]/,BC="fa-layers-text",KF=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i,YF=Iu((ic={},Zt(ic,Et,{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"}),Zt(ic,_t,{900:"fass",400:"fasr",300:"fasl",100:"fast"}),ic)),VC=[1,2,3,4,5,6,7,8,9,10],XF=VC.concat([11,12,13,14,15,16,17,18,19,20]),JF=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],co={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},tu=new Set;Object.keys(Zs[Et]).map(tu.add.bind(tu));Object.keys(Zs[_t]).map(tu.add.bind(tu));var QF=[].concat(Ev,Tu(tu),["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",co.GROUP,co.SWAP_OPACITY,co.PRIMARY,co.SECONDARY]).concat(VC.map(function(e){return"".concat(e,"x")})).concat(XF.map(function(e){return"w-".concat(e)})),Ps=ji.FontAwesomeConfig||{};function ZF(e){var t=It.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function eL(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}if(It&&typeof It.querySelector=="function"){var tL=[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]];tL.forEach(function(e){var t=Sv(e,2),n=t[0],r=t[1],i=eL(ZF(n));i!=null&&(Ps[r]=i)})}var UC={styleDefault:"solid",familyDefault:"classic",cssPrefix:qC,replacementClass:FC,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Ps.familyPrefix&&(Ps.cssPrefix=Ps.familyPrefix);var Aa=pe(pe({},UC),Ps);Aa.autoReplaceSvg||(Aa.observeMutations=!1);var me={};Object.keys(UC).forEach(function(e){Object.defineProperty(me,e,{enumerable:!0,set:function(n){Aa[e]=n,Rs.forEach(function(r){return r(me)})},get:function(){return Aa[e]}})});Object.defineProperty(me,"familyPrefix",{enumerable:!0,set:function(t){Aa.cssPrefix=t,Rs.forEach(function(n){return n(me)})},get:function(){return Aa.cssPrefix}});ji.FontAwesomeConfig=me;var Rs=[];function nL(e){return Rs.push(e),function(){Rs.splice(Rs.indexOf(e),1)}}var hi=Op,Or={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function rL(e){if(!(!e||!ui)){var t=It.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;for(var n=It.head.childNodes,r=null,i=n.length-1;i>-1;i--){var o=n[i],a=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(a)>-1&&(r=o)}return It.head.insertBefore(t,r),e}}var iL="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function nu(){for(var e=12,t="";e-- >0;)t+=iL[Math.random()*62|0];return t}function Qa(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function Tv(e){return e.classList?Qa(e.classList):(e.getAttribute("class")||"").split(" ").filter(function(t){return t})}function GC(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function oL(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,'="').concat(GC(e[n]),'" ')},"").trim()}function bf(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,": ").concat(e[n].trim(),";")},"")}function Iv(e){return e.size!==Or.size||e.x!==Or.x||e.y!==Or.y||e.rotate!==Or.rotate||e.flipX||e.flipY}function aL(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,i={transform:"translate(".concat(n/2," 256)")},o="translate(".concat(t.x*32,", ").concat(t.y*32,") "),a="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)"),u={transform:"".concat(o," ").concat(a," ").concat(s)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:u,path:c}}function sL(e){var t=e.transform,n=e.width,r=n===void 0?Op:n,i=e.height,o=i===void 0?Op:i,a=e.startCentered,s=a===void 0?!1:a,u="";return s&&_C?u+="translate(".concat(t.x/hi-r/2,"em, ").concat(t.y/hi-o/2,"em) "):s?u+="translate(calc(-50% + ".concat(t.x/hi,"em), calc(-50% + ").concat(t.y/hi,"em)) "):u+="translate(".concat(t.x/hi,"em, ").concat(t.y/hi,"em) "),u+="scale(".concat(t.size/hi*(t.flipX?-1:1),", ").concat(t.size/hi*(t.flipY?-1:1),") "),u+="rotate(".concat(t.rotate,"deg) "),u}var uL=`:root, :host {
|
|
195
|
+
--fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";
|
|
196
|
+
--fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";
|
|
197
|
+
--fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";
|
|
198
|
+
--fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin";
|
|
199
|
+
--fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";
|
|
200
|
+
--fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";
|
|
201
|
+
--fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";
|
|
202
|
+
--fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";
|
|
203
|
+
--fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp";
|
|
204
|
+
--fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
208
|
+
overflow: visible;
|
|
209
|
+
box-sizing: content-box;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.svg-inline--fa {
|
|
213
|
+
display: var(--fa-display, inline-block);
|
|
214
|
+
height: 1em;
|
|
215
|
+
overflow: visible;
|
|
216
|
+
vertical-align: -0.125em;
|
|
217
|
+
}
|
|
218
|
+
.svg-inline--fa.fa-2xs {
|
|
219
|
+
vertical-align: 0.1em;
|
|
220
|
+
}
|
|
221
|
+
.svg-inline--fa.fa-xs {
|
|
222
|
+
vertical-align: 0em;
|
|
223
|
+
}
|
|
224
|
+
.svg-inline--fa.fa-sm {
|
|
225
|
+
vertical-align: -0.0714285705em;
|
|
226
|
+
}
|
|
227
|
+
.svg-inline--fa.fa-lg {
|
|
228
|
+
vertical-align: -0.2em;
|
|
229
|
+
}
|
|
230
|
+
.svg-inline--fa.fa-xl {
|
|
231
|
+
vertical-align: -0.25em;
|
|
232
|
+
}
|
|
233
|
+
.svg-inline--fa.fa-2xl {
|
|
234
|
+
vertical-align: -0.3125em;
|
|
235
|
+
}
|
|
236
|
+
.svg-inline--fa.fa-pull-left {
|
|
237
|
+
margin-right: var(--fa-pull-margin, 0.3em);
|
|
238
|
+
width: auto;
|
|
239
|
+
}
|
|
240
|
+
.svg-inline--fa.fa-pull-right {
|
|
241
|
+
margin-left: var(--fa-pull-margin, 0.3em);
|
|
242
|
+
width: auto;
|
|
243
|
+
}
|
|
244
|
+
.svg-inline--fa.fa-li {
|
|
245
|
+
width: var(--fa-li-width, 2em);
|
|
246
|
+
top: 0.25em;
|
|
247
|
+
}
|
|
248
|
+
.svg-inline--fa.fa-fw {
|
|
249
|
+
width: var(--fa-fw-width, 1.25em);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.fa-layers svg.svg-inline--fa {
|
|
253
|
+
bottom: 0;
|
|
254
|
+
left: 0;
|
|
255
|
+
margin: auto;
|
|
256
|
+
position: absolute;
|
|
257
|
+
right: 0;
|
|
258
|
+
top: 0;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.fa-layers-counter, .fa-layers-text {
|
|
262
|
+
display: inline-block;
|
|
263
|
+
position: absolute;
|
|
264
|
+
text-align: center;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.fa-layers {
|
|
268
|
+
display: inline-block;
|
|
269
|
+
height: 1em;
|
|
270
|
+
position: relative;
|
|
271
|
+
text-align: center;
|
|
272
|
+
vertical-align: -0.125em;
|
|
273
|
+
width: 1em;
|
|
274
|
+
}
|
|
275
|
+
.fa-layers svg.svg-inline--fa {
|
|
276
|
+
-webkit-transform-origin: center center;
|
|
277
|
+
transform-origin: center center;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.fa-layers-text {
|
|
281
|
+
left: 50%;
|
|
282
|
+
top: 50%;
|
|
283
|
+
-webkit-transform: translate(-50%, -50%);
|
|
284
|
+
transform: translate(-50%, -50%);
|
|
285
|
+
-webkit-transform-origin: center center;
|
|
286
|
+
transform-origin: center center;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.fa-layers-counter {
|
|
290
|
+
background-color: var(--fa-counter-background-color, #ff253a);
|
|
291
|
+
border-radius: var(--fa-counter-border-radius, 1em);
|
|
292
|
+
box-sizing: border-box;
|
|
293
|
+
color: var(--fa-inverse, #fff);
|
|
294
|
+
line-height: var(--fa-counter-line-height, 1);
|
|
295
|
+
max-width: var(--fa-counter-max-width, 5em);
|
|
296
|
+
min-width: var(--fa-counter-min-width, 1.5em);
|
|
297
|
+
overflow: hidden;
|
|
298
|
+
padding: var(--fa-counter-padding, 0.25em 0.5em);
|
|
299
|
+
right: var(--fa-right, 0);
|
|
300
|
+
text-overflow: ellipsis;
|
|
301
|
+
top: var(--fa-top, 0);
|
|
302
|
+
-webkit-transform: scale(var(--fa-counter-scale, 0.25));
|
|
303
|
+
transform: scale(var(--fa-counter-scale, 0.25));
|
|
304
|
+
-webkit-transform-origin: top right;
|
|
305
|
+
transform-origin: top right;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.fa-layers-bottom-right {
|
|
309
|
+
bottom: var(--fa-bottom, 0);
|
|
310
|
+
right: var(--fa-right, 0);
|
|
311
|
+
top: auto;
|
|
312
|
+
-webkit-transform: scale(var(--fa-layers-scale, 0.25));
|
|
313
|
+
transform: scale(var(--fa-layers-scale, 0.25));
|
|
314
|
+
-webkit-transform-origin: bottom right;
|
|
315
|
+
transform-origin: bottom right;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.fa-layers-bottom-left {
|
|
319
|
+
bottom: var(--fa-bottom, 0);
|
|
320
|
+
left: var(--fa-left, 0);
|
|
321
|
+
right: auto;
|
|
322
|
+
top: auto;
|
|
323
|
+
-webkit-transform: scale(var(--fa-layers-scale, 0.25));
|
|
324
|
+
transform: scale(var(--fa-layers-scale, 0.25));
|
|
325
|
+
-webkit-transform-origin: bottom left;
|
|
326
|
+
transform-origin: bottom left;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.fa-layers-top-right {
|
|
330
|
+
top: var(--fa-top, 0);
|
|
331
|
+
right: var(--fa-right, 0);
|
|
332
|
+
-webkit-transform: scale(var(--fa-layers-scale, 0.25));
|
|
333
|
+
transform: scale(var(--fa-layers-scale, 0.25));
|
|
334
|
+
-webkit-transform-origin: top right;
|
|
335
|
+
transform-origin: top right;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.fa-layers-top-left {
|
|
339
|
+
left: var(--fa-left, 0);
|
|
340
|
+
right: auto;
|
|
341
|
+
top: var(--fa-top, 0);
|
|
342
|
+
-webkit-transform: scale(var(--fa-layers-scale, 0.25));
|
|
343
|
+
transform: scale(var(--fa-layers-scale, 0.25));
|
|
344
|
+
-webkit-transform-origin: top left;
|
|
345
|
+
transform-origin: top left;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.fa-1x {
|
|
349
|
+
font-size: 1em;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.fa-2x {
|
|
353
|
+
font-size: 2em;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.fa-3x {
|
|
357
|
+
font-size: 3em;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.fa-4x {
|
|
361
|
+
font-size: 4em;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.fa-5x {
|
|
365
|
+
font-size: 5em;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.fa-6x {
|
|
369
|
+
font-size: 6em;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.fa-7x {
|
|
373
|
+
font-size: 7em;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.fa-8x {
|
|
377
|
+
font-size: 8em;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.fa-9x {
|
|
381
|
+
font-size: 9em;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.fa-10x {
|
|
385
|
+
font-size: 10em;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.fa-2xs {
|
|
389
|
+
font-size: 0.625em;
|
|
390
|
+
line-height: 0.1em;
|
|
391
|
+
vertical-align: 0.225em;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.fa-xs {
|
|
395
|
+
font-size: 0.75em;
|
|
396
|
+
line-height: 0.0833333337em;
|
|
397
|
+
vertical-align: 0.125em;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.fa-sm {
|
|
401
|
+
font-size: 0.875em;
|
|
402
|
+
line-height: 0.0714285718em;
|
|
403
|
+
vertical-align: 0.0535714295em;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.fa-lg {
|
|
407
|
+
font-size: 1.25em;
|
|
408
|
+
line-height: 0.05em;
|
|
409
|
+
vertical-align: -0.075em;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.fa-xl {
|
|
413
|
+
font-size: 1.5em;
|
|
414
|
+
line-height: 0.0416666682em;
|
|
415
|
+
vertical-align: -0.125em;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.fa-2xl {
|
|
419
|
+
font-size: 2em;
|
|
420
|
+
line-height: 0.03125em;
|
|
421
|
+
vertical-align: -0.1875em;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.fa-fw {
|
|
425
|
+
text-align: center;
|
|
426
|
+
width: 1.25em;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.fa-ul {
|
|
430
|
+
list-style-type: none;
|
|
431
|
+
margin-left: var(--fa-li-margin, 2.5em);
|
|
432
|
+
padding-left: 0;
|
|
433
|
+
}
|
|
434
|
+
.fa-ul > li {
|
|
435
|
+
position: relative;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.fa-li {
|
|
439
|
+
left: calc(var(--fa-li-width, 2em) * -1);
|
|
440
|
+
position: absolute;
|
|
441
|
+
text-align: center;
|
|
442
|
+
width: var(--fa-li-width, 2em);
|
|
443
|
+
line-height: inherit;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.fa-border {
|
|
447
|
+
border-color: var(--fa-border-color, #eee);
|
|
448
|
+
border-radius: var(--fa-border-radius, 0.1em);
|
|
449
|
+
border-style: var(--fa-border-style, solid);
|
|
450
|
+
border-width: var(--fa-border-width, 0.08em);
|
|
451
|
+
padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.fa-pull-left {
|
|
455
|
+
float: left;
|
|
456
|
+
margin-right: var(--fa-pull-margin, 0.3em);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.fa-pull-right {
|
|
460
|
+
float: right;
|
|
461
|
+
margin-left: var(--fa-pull-margin, 0.3em);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.fa-beat {
|
|
465
|
+
-webkit-animation-name: fa-beat;
|
|
466
|
+
animation-name: fa-beat;
|
|
467
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
468
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
469
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
470
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
471
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
472
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
473
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
474
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
475
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);
|
|
476
|
+
animation-timing-function: var(--fa-animation-timing, ease-in-out);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.fa-bounce {
|
|
480
|
+
-webkit-animation-name: fa-bounce;
|
|
481
|
+
animation-name: fa-bounce;
|
|
482
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
483
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
484
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
485
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
486
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
487
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
488
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
489
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
490
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));
|
|
491
|
+
animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.fa-fade {
|
|
495
|
+
-webkit-animation-name: fa-fade;
|
|
496
|
+
animation-name: fa-fade;
|
|
497
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
498
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
499
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
500
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
501
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
502
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
503
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
504
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
505
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
|
|
506
|
+
animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.fa-beat-fade {
|
|
510
|
+
-webkit-animation-name: fa-beat-fade;
|
|
511
|
+
animation-name: fa-beat-fade;
|
|
512
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
513
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
514
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
515
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
516
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
517
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
518
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
519
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
520
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
|
|
521
|
+
animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.fa-flip {
|
|
525
|
+
-webkit-animation-name: fa-flip;
|
|
526
|
+
animation-name: fa-flip;
|
|
527
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
528
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
529
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
530
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
531
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
532
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
533
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
534
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
535
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);
|
|
536
|
+
animation-timing-function: var(--fa-animation-timing, ease-in-out);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.fa-shake {
|
|
540
|
+
-webkit-animation-name: fa-shake;
|
|
541
|
+
animation-name: fa-shake;
|
|
542
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
543
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
544
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
545
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
546
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
547
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
548
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
549
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
550
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, linear);
|
|
551
|
+
animation-timing-function: var(--fa-animation-timing, linear);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
.fa-spin {
|
|
555
|
+
-webkit-animation-name: fa-spin;
|
|
556
|
+
animation-name: fa-spin;
|
|
557
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
558
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
559
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
560
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
561
|
+
-webkit-animation-duration: var(--fa-animation-duration, 2s);
|
|
562
|
+
animation-duration: var(--fa-animation-duration, 2s);
|
|
563
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
564
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
565
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, linear);
|
|
566
|
+
animation-timing-function: var(--fa-animation-timing, linear);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
.fa-spin-reverse {
|
|
570
|
+
--fa-animation-direction: reverse;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.fa-pulse,
|
|
574
|
+
.fa-spin-pulse {
|
|
575
|
+
-webkit-animation-name: fa-spin;
|
|
576
|
+
animation-name: fa-spin;
|
|
577
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
578
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
579
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
580
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
581
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
582
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
583
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, steps(8));
|
|
584
|
+
animation-timing-function: var(--fa-animation-timing, steps(8));
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
@media (prefers-reduced-motion: reduce) {
|
|
588
|
+
.fa-beat,
|
|
589
|
+
.fa-bounce,
|
|
590
|
+
.fa-fade,
|
|
591
|
+
.fa-beat-fade,
|
|
592
|
+
.fa-flip,
|
|
593
|
+
.fa-pulse,
|
|
594
|
+
.fa-shake,
|
|
595
|
+
.fa-spin,
|
|
596
|
+
.fa-spin-pulse {
|
|
597
|
+
-webkit-animation-delay: -1ms;
|
|
598
|
+
animation-delay: -1ms;
|
|
599
|
+
-webkit-animation-duration: 1ms;
|
|
600
|
+
animation-duration: 1ms;
|
|
601
|
+
-webkit-animation-iteration-count: 1;
|
|
602
|
+
animation-iteration-count: 1;
|
|
603
|
+
-webkit-transition-delay: 0s;
|
|
604
|
+
transition-delay: 0s;
|
|
605
|
+
-webkit-transition-duration: 0s;
|
|
606
|
+
transition-duration: 0s;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
@-webkit-keyframes fa-beat {
|
|
610
|
+
0%, 90% {
|
|
611
|
+
-webkit-transform: scale(1);
|
|
612
|
+
transform: scale(1);
|
|
613
|
+
}
|
|
614
|
+
45% {
|
|
615
|
+
-webkit-transform: scale(var(--fa-beat-scale, 1.25));
|
|
616
|
+
transform: scale(var(--fa-beat-scale, 1.25));
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
@keyframes fa-beat {
|
|
620
|
+
0%, 90% {
|
|
621
|
+
-webkit-transform: scale(1);
|
|
622
|
+
transform: scale(1);
|
|
623
|
+
}
|
|
624
|
+
45% {
|
|
625
|
+
-webkit-transform: scale(var(--fa-beat-scale, 1.25));
|
|
626
|
+
transform: scale(var(--fa-beat-scale, 1.25));
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
@-webkit-keyframes fa-bounce {
|
|
630
|
+
0% {
|
|
631
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
632
|
+
transform: scale(1, 1) translateY(0);
|
|
633
|
+
}
|
|
634
|
+
10% {
|
|
635
|
+
-webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
|
|
636
|
+
transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
|
|
637
|
+
}
|
|
638
|
+
30% {
|
|
639
|
+
-webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
|
|
640
|
+
transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
|
|
641
|
+
}
|
|
642
|
+
50% {
|
|
643
|
+
-webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
|
|
644
|
+
transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
|
|
645
|
+
}
|
|
646
|
+
57% {
|
|
647
|
+
-webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
|
|
648
|
+
transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
|
|
649
|
+
}
|
|
650
|
+
64% {
|
|
651
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
652
|
+
transform: scale(1, 1) translateY(0);
|
|
653
|
+
}
|
|
654
|
+
100% {
|
|
655
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
656
|
+
transform: scale(1, 1) translateY(0);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
@keyframes fa-bounce {
|
|
660
|
+
0% {
|
|
661
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
662
|
+
transform: scale(1, 1) translateY(0);
|
|
663
|
+
}
|
|
664
|
+
10% {
|
|
665
|
+
-webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
|
|
666
|
+
transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
|
|
667
|
+
}
|
|
668
|
+
30% {
|
|
669
|
+
-webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
|
|
670
|
+
transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
|
|
671
|
+
}
|
|
672
|
+
50% {
|
|
673
|
+
-webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
|
|
674
|
+
transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
|
|
675
|
+
}
|
|
676
|
+
57% {
|
|
677
|
+
-webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
|
|
678
|
+
transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
|
|
679
|
+
}
|
|
680
|
+
64% {
|
|
681
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
682
|
+
transform: scale(1, 1) translateY(0);
|
|
683
|
+
}
|
|
684
|
+
100% {
|
|
685
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
686
|
+
transform: scale(1, 1) translateY(0);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
@-webkit-keyframes fa-fade {
|
|
690
|
+
50% {
|
|
691
|
+
opacity: var(--fa-fade-opacity, 0.4);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
@keyframes fa-fade {
|
|
695
|
+
50% {
|
|
696
|
+
opacity: var(--fa-fade-opacity, 0.4);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
@-webkit-keyframes fa-beat-fade {
|
|
700
|
+
0%, 100% {
|
|
701
|
+
opacity: var(--fa-beat-fade-opacity, 0.4);
|
|
702
|
+
-webkit-transform: scale(1);
|
|
703
|
+
transform: scale(1);
|
|
704
|
+
}
|
|
705
|
+
50% {
|
|
706
|
+
opacity: 1;
|
|
707
|
+
-webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));
|
|
708
|
+
transform: scale(var(--fa-beat-fade-scale, 1.125));
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
@keyframes fa-beat-fade {
|
|
712
|
+
0%, 100% {
|
|
713
|
+
opacity: var(--fa-beat-fade-opacity, 0.4);
|
|
714
|
+
-webkit-transform: scale(1);
|
|
715
|
+
transform: scale(1);
|
|
716
|
+
}
|
|
717
|
+
50% {
|
|
718
|
+
opacity: 1;
|
|
719
|
+
-webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));
|
|
720
|
+
transform: scale(var(--fa-beat-fade-scale, 1.125));
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
@-webkit-keyframes fa-flip {
|
|
724
|
+
50% {
|
|
725
|
+
-webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
|
|
726
|
+
transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
@keyframes fa-flip {
|
|
730
|
+
50% {
|
|
731
|
+
-webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
|
|
732
|
+
transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
@-webkit-keyframes fa-shake {
|
|
736
|
+
0% {
|
|
737
|
+
-webkit-transform: rotate(-15deg);
|
|
738
|
+
transform: rotate(-15deg);
|
|
739
|
+
}
|
|
740
|
+
4% {
|
|
741
|
+
-webkit-transform: rotate(15deg);
|
|
742
|
+
transform: rotate(15deg);
|
|
743
|
+
}
|
|
744
|
+
8%, 24% {
|
|
745
|
+
-webkit-transform: rotate(-18deg);
|
|
746
|
+
transform: rotate(-18deg);
|
|
747
|
+
}
|
|
748
|
+
12%, 28% {
|
|
749
|
+
-webkit-transform: rotate(18deg);
|
|
750
|
+
transform: rotate(18deg);
|
|
751
|
+
}
|
|
752
|
+
16% {
|
|
753
|
+
-webkit-transform: rotate(-22deg);
|
|
754
|
+
transform: rotate(-22deg);
|
|
755
|
+
}
|
|
756
|
+
20% {
|
|
757
|
+
-webkit-transform: rotate(22deg);
|
|
758
|
+
transform: rotate(22deg);
|
|
759
|
+
}
|
|
760
|
+
32% {
|
|
761
|
+
-webkit-transform: rotate(-12deg);
|
|
762
|
+
transform: rotate(-12deg);
|
|
763
|
+
}
|
|
764
|
+
36% {
|
|
765
|
+
-webkit-transform: rotate(12deg);
|
|
766
|
+
transform: rotate(12deg);
|
|
767
|
+
}
|
|
768
|
+
40%, 100% {
|
|
769
|
+
-webkit-transform: rotate(0deg);
|
|
770
|
+
transform: rotate(0deg);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
@keyframes fa-shake {
|
|
774
|
+
0% {
|
|
775
|
+
-webkit-transform: rotate(-15deg);
|
|
776
|
+
transform: rotate(-15deg);
|
|
777
|
+
}
|
|
778
|
+
4% {
|
|
779
|
+
-webkit-transform: rotate(15deg);
|
|
780
|
+
transform: rotate(15deg);
|
|
781
|
+
}
|
|
782
|
+
8%, 24% {
|
|
783
|
+
-webkit-transform: rotate(-18deg);
|
|
784
|
+
transform: rotate(-18deg);
|
|
785
|
+
}
|
|
786
|
+
12%, 28% {
|
|
787
|
+
-webkit-transform: rotate(18deg);
|
|
788
|
+
transform: rotate(18deg);
|
|
789
|
+
}
|
|
790
|
+
16% {
|
|
791
|
+
-webkit-transform: rotate(-22deg);
|
|
792
|
+
transform: rotate(-22deg);
|
|
793
|
+
}
|
|
794
|
+
20% {
|
|
795
|
+
-webkit-transform: rotate(22deg);
|
|
796
|
+
transform: rotate(22deg);
|
|
797
|
+
}
|
|
798
|
+
32% {
|
|
799
|
+
-webkit-transform: rotate(-12deg);
|
|
800
|
+
transform: rotate(-12deg);
|
|
801
|
+
}
|
|
802
|
+
36% {
|
|
803
|
+
-webkit-transform: rotate(12deg);
|
|
804
|
+
transform: rotate(12deg);
|
|
805
|
+
}
|
|
806
|
+
40%, 100% {
|
|
807
|
+
-webkit-transform: rotate(0deg);
|
|
808
|
+
transform: rotate(0deg);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
@-webkit-keyframes fa-spin {
|
|
812
|
+
0% {
|
|
813
|
+
-webkit-transform: rotate(0deg);
|
|
814
|
+
transform: rotate(0deg);
|
|
815
|
+
}
|
|
816
|
+
100% {
|
|
817
|
+
-webkit-transform: rotate(360deg);
|
|
818
|
+
transform: rotate(360deg);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
@keyframes fa-spin {
|
|
822
|
+
0% {
|
|
823
|
+
-webkit-transform: rotate(0deg);
|
|
824
|
+
transform: rotate(0deg);
|
|
825
|
+
}
|
|
826
|
+
100% {
|
|
827
|
+
-webkit-transform: rotate(360deg);
|
|
828
|
+
transform: rotate(360deg);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
.fa-rotate-90 {
|
|
832
|
+
-webkit-transform: rotate(90deg);
|
|
833
|
+
transform: rotate(90deg);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
.fa-rotate-180 {
|
|
837
|
+
-webkit-transform: rotate(180deg);
|
|
838
|
+
transform: rotate(180deg);
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
.fa-rotate-270 {
|
|
842
|
+
-webkit-transform: rotate(270deg);
|
|
843
|
+
transform: rotate(270deg);
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
.fa-flip-horizontal {
|
|
847
|
+
-webkit-transform: scale(-1, 1);
|
|
848
|
+
transform: scale(-1, 1);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
.fa-flip-vertical {
|
|
852
|
+
-webkit-transform: scale(1, -1);
|
|
853
|
+
transform: scale(1, -1);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
.fa-flip-both,
|
|
857
|
+
.fa-flip-horizontal.fa-flip-vertical {
|
|
858
|
+
-webkit-transform: scale(-1, -1);
|
|
859
|
+
transform: scale(-1, -1);
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
.fa-rotate-by {
|
|
863
|
+
-webkit-transform: rotate(var(--fa-rotate-angle, none));
|
|
864
|
+
transform: rotate(var(--fa-rotate-angle, none));
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.fa-stack {
|
|
868
|
+
display: inline-block;
|
|
869
|
+
vertical-align: middle;
|
|
870
|
+
height: 2em;
|
|
871
|
+
position: relative;
|
|
872
|
+
width: 2.5em;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
.fa-stack-1x,
|
|
876
|
+
.fa-stack-2x {
|
|
877
|
+
bottom: 0;
|
|
878
|
+
left: 0;
|
|
879
|
+
margin: auto;
|
|
880
|
+
position: absolute;
|
|
881
|
+
right: 0;
|
|
882
|
+
top: 0;
|
|
883
|
+
z-index: var(--fa-stack-z-index, auto);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
.svg-inline--fa.fa-stack-1x {
|
|
887
|
+
height: 1em;
|
|
888
|
+
width: 1.25em;
|
|
889
|
+
}
|
|
890
|
+
.svg-inline--fa.fa-stack-2x {
|
|
891
|
+
height: 2em;
|
|
892
|
+
width: 2.5em;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
.fa-inverse {
|
|
896
|
+
color: var(--fa-inverse, #fff);
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.sr-only,
|
|
900
|
+
.fa-sr-only {
|
|
901
|
+
position: absolute;
|
|
902
|
+
width: 1px;
|
|
903
|
+
height: 1px;
|
|
904
|
+
padding: 0;
|
|
905
|
+
margin: -1px;
|
|
906
|
+
overflow: hidden;
|
|
907
|
+
clip: rect(0, 0, 0, 0);
|
|
908
|
+
white-space: nowrap;
|
|
909
|
+
border-width: 0;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
.sr-only-focusable:not(:focus),
|
|
913
|
+
.fa-sr-only-focusable:not(:focus) {
|
|
914
|
+
position: absolute;
|
|
915
|
+
width: 1px;
|
|
916
|
+
height: 1px;
|
|
917
|
+
padding: 0;
|
|
918
|
+
margin: -1px;
|
|
919
|
+
overflow: hidden;
|
|
920
|
+
clip: rect(0, 0, 0, 0);
|
|
921
|
+
white-space: nowrap;
|
|
922
|
+
border-width: 0;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
.svg-inline--fa .fa-primary {
|
|
926
|
+
fill: var(--fa-primary-color, currentColor);
|
|
927
|
+
opacity: var(--fa-primary-opacity, 1);
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.svg-inline--fa .fa-secondary {
|
|
931
|
+
fill: var(--fa-secondary-color, currentColor);
|
|
932
|
+
opacity: var(--fa-secondary-opacity, 0.4);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
.svg-inline--fa.fa-swap-opacity .fa-primary {
|
|
936
|
+
opacity: var(--fa-secondary-opacity, 0.4);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.svg-inline--fa.fa-swap-opacity .fa-secondary {
|
|
940
|
+
opacity: var(--fa-primary-opacity, 1);
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
.svg-inline--fa mask .fa-primary,
|
|
944
|
+
.svg-inline--fa mask .fa-secondary {
|
|
945
|
+
fill: black;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
.fad.fa-inverse,
|
|
949
|
+
.fa-duotone.fa-inverse {
|
|
950
|
+
color: var(--fa-inverse, #fff);
|
|
951
|
+
}`;function zC(){var e=qC,t=FC,n=me.cssPrefix,r=me.replacementClass,i=uL;if(n!==e||r!==t){var o=new RegExp("\\.".concat(e,"\\-"),"g"),a=new RegExp("\\--".concat(e,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");i=i.replace(o,".".concat(n,"-")).replace(a,"--".concat(n,"-")).replace(s,".".concat(r))}return i}var Wy=!1;function Uf(){me.autoAddCss&&!Wy&&(rL(zC()),Wy=!0)}var cL={mixout:function(){return{dom:{css:zC,insertCss:Uf}}},hooks:function(){return{beforeDOMElementCreation:function(){Uf()},beforeI2svg:function(){Uf()}}}},ii=ji||{};ii[ri]||(ii[ri]={});ii[ri].styles||(ii[ri].styles={});ii[ri].hooks||(ii[ri].hooks={});ii[ri].shims||(ii[ri].shims=[]);var br=ii[ri],WC=[],lL=function e(){It.removeEventListener("DOMContentLoaded",e),sl=1,WC.map(function(t){return t()})},sl=!1;ui&&(sl=(It.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(It.readyState),sl||It.addEventListener("DOMContentLoaded",lL));function fL(e){ui&&(sl?setTimeout(e,0):WC.push(e))}function Au(e){var t=e.tag,n=e.attributes,r=n===void 0?{}:n,i=e.children,o=i===void 0?[]:i;return typeof e=="string"?GC(e):"<".concat(t," ").concat(oL(r),">").concat(o.map(Au).join(""),"</").concat(t,">")}function Hy(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var dL=function(t,n){return function(r,i,o,a){return t.call(n,r,i,o,a)}},Gf=function(t,n,r,i){var o=Object.keys(t),a=o.length,s=i!==void 0?dL(n,i):n,u,c,l;for(r===void 0?(u=1,l=t[o[0]]):(u=0,l=r);u<a;u++)c=o[u],l=s(l,t[c],c,t);return l};function pL(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=e.charCodeAt(n++);(o&64512)==56320?t.push(((i&1023)<<10)+(o&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}function Np(e){var t=pL(e);return t.length===1?t[0].toString(16):null}function hL(e,t){var n=e.length,r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&n>t+1&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function Ky(e){return Object.keys(e).reduce(function(t,n){var r=e[n],i=!!r.icon;return i?t[r.iconName]=r.icon:t[n]=r,t},{})}function Pp(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,o=Ky(t);typeof br.hooks.addPack=="function"&&!i?br.hooks.addPack(e,Ky(t)):br.styles[e]=pe(pe({},br.styles[e]||{}),o),e==="fas"&&Pp("fa",t)}var oc,ac,sc,fa=br.styles,vL=br.shims,mL=(oc={},Zt(oc,Et,Object.values(eu[Et])),Zt(oc,_t,Object.values(eu[_t])),oc),Av=null,HC={},KC={},YC={},XC={},JC={},yL=(ac={},Zt(ac,Et,Object.keys(Qs[Et])),Zt(ac,_t,Object.keys(Qs[_t])),ac);function gL(e){return~QF.indexOf(e)}function bL(e,t){var n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!gL(i)?i:null}var QC=function(){var t=function(o){return Gf(fa,function(a,s,u){return a[u]=Gf(s,o,{}),a},{})};HC=t(function(i,o,a){if(o[3]&&(i[o[3]]=a),o[2]){var s=o[2].filter(function(u){return typeof u=="number"});s.forEach(function(u){i[u.toString(16)]=a})}return i}),KC=t(function(i,o,a){if(i[a]=a,o[2]){var s=o[2].filter(function(u){return typeof u=="string"});s.forEach(function(u){i[u]=a})}return i}),JC=t(function(i,o,a){var s=o[2];return i[a]=a,s.forEach(function(u){i[u]=a}),i});var n="far"in fa||me.autoFetchSvg,r=Gf(vL,function(i,o){var a=o[0],s=o[1],u=o[2];return s==="far"&&!n&&(s="fas"),typeof a=="string"&&(i.names[a]={prefix:s,iconName:u}),typeof a=="number"&&(i.unicodes[a.toString(16)]={prefix:s,iconName:u}),i},{names:{},unicodes:{}});YC=r.names,XC=r.unicodes,Av=Sf(me.styleDefault,{family:me.familyDefault})};nL(function(e){Av=Sf(e.styleDefault,{family:me.familyDefault})});QC();function $v(e,t){return(HC[e]||{})[t]}function SL(e,t){return(KC[e]||{})[t]}function lo(e,t){return(JC[e]||{})[t]}function ZC(e){return YC[e]||{prefix:null,iconName:null}}function wL(e){var t=XC[e],n=$v("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function _i(){return Av}var Ov=function(){return{prefix:null,iconName:null,rest:[]}};function Sf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,r=n===void 0?Et:n,i=Qs[r][e],o=Zs[r][e]||Zs[r][i],a=e in br.styles?e:null;return o||a||null}var Yy=(sc={},Zt(sc,Et,Object.keys(eu[Et])),Zt(sc,_t,Object.keys(eu[_t])),sc);function wf(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,o=(t={},Zt(t,Et,"".concat(me.cssPrefix,"-").concat(Et)),Zt(t,_t,"".concat(me.cssPrefix,"-").concat(_t)),t),a=null,s=Et;(e.includes(o[Et])||e.some(function(c){return Yy[Et].includes(c)}))&&(s=Et),(e.includes(o[_t])||e.some(function(c){return Yy[_t].includes(c)}))&&(s=_t);var u=e.reduce(function(c,l){var f=bL(me.cssPrefix,l);if(fa[l]?(l=mL[s].includes(l)?WF[s][l]:l,a=l,c.prefix=l):yL[s].indexOf(l)>-1?(a=l,c.prefix=Sf(l,{family:s})):f?c.iconName=f:l!==me.replacementClass&&l!==o[Et]&&l!==o[_t]&&c.rest.push(l),!i&&c.prefix&&c.iconName){var d=a==="fa"?ZC(c.iconName):{},p=lo(c.prefix,c.iconName);d.prefix&&(a=null),c.iconName=d.iconName||p||c.iconName,c.prefix=d.prefix||c.prefix,c.prefix==="far"&&!fa.far&&fa.fas&&!me.autoFetchSvg&&(c.prefix="fas")}return c},Ov());return(e.includes("fa-brands")||e.includes("fab"))&&(u.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(u.prefix="fad"),!u.prefix&&s===_t&&(fa.fass||me.autoFetchSvg)&&(u.prefix="fass",u.iconName=lo(u.prefix,u.iconName)||u.iconName),(u.prefix==="fa"||a==="fa")&&(u.prefix=_i()||"fas"),u}var CL=function(){function e(){kF(this,e),this.definitions={}}return MF(e,[{key:"add",value:function(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i.reduce(this._pullDefinitions,{});Object.keys(a).forEach(function(s){n.definitions[s]=pe(pe({},n.definitions[s]||{}),a[s]),Pp(s,a[s]);var u=eu[Et][s];u&&Pp(u,a[s]),QC()})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(n,r){var i=r.prefix&&r.iconName&&r.icon?{0:r}:r;return Object.keys(i).map(function(o){var a=i[o],s=a.prefix,u=a.iconName,c=a.icon,l=c[2];n[s]||(n[s]={}),l.length>0&&l.forEach(function(f){typeof f=="string"&&(n[s][f]=c)}),n[s][u]=c}),n}}]),e}(),Xy=[],da={},ba={},xL=Object.keys(ba);function EL(e,t){var n=t.mixoutsTo;return Xy=e,da={},Object.keys(ba).forEach(function(r){xL.indexOf(r)===-1&&delete ba[r]}),Xy.forEach(function(r){var i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(function(a){typeof i[a]=="function"&&(n[a]=i[a]),al(i[a])==="object"&&Object.keys(i[a]).forEach(function(s){n[a]||(n[a]={}),n[a][s]=i[a][s]})}),r.hooks){var o=r.hooks();Object.keys(o).forEach(function(a){da[a]||(da[a]=[]),da[a].push(o[a])})}r.provides&&r.provides(ba)}),n}function Rp(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=da[e]||[];return o.forEach(function(a){t=a.apply(null,[t].concat(r))}),t}function Oo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=da[e]||[];i.forEach(function(o){o.apply(null,n)})}function oi(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return ba[e]?ba[e].apply(null,t):void 0}function kp(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||_i();if(t)return t=lo(n,t)||t,Hy(ex.definitions,n,t)||Hy(br.styles,n,t)}var ex=new CL,TL=function(){me.autoReplaceSvg=!1,me.observeMutations=!1,Oo("noAuto")},IL={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ui?(Oo("beforeI2svg",t),oi("pseudoElements2svg",t),oi("i2svg",t)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot;me.autoReplaceSvg===!1&&(me.autoReplaceSvg=!0),me.observeMutations=!0,fL(function(){$L({autoReplaceSvgRoot:n}),Oo("watch",t)})}},AL={icon:function(t){if(t===null)return null;if(al(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:lo(t.prefix,t.iconName)||t.iconName};if(Array.isArray(t)&&t.length===2){var n=t[1].indexOf("fa-")===0?t[1].slice(3):t[1],r=Sf(t[0]);return{prefix:r,iconName:lo(r,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(me.cssPrefix,"-"))>-1||t.match(HF))){var i=wf(t.split(" "),{skipLookups:!0});return{prefix:i.prefix||_i(),iconName:lo(i.prefix,i.iconName)||i.iconName}}if(typeof t=="string"){var o=_i();return{prefix:o,iconName:lo(o,t)||t}}}},Zn={noAuto:TL,config:me,dom:IL,parse:AL,library:ex,findIconDefinition:kp,toHtml:Au},$L=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,r=n===void 0?It:n;(Object.keys(br.styles).length>0||me.autoFetchSvg)&&ui&&me.autoReplaceSvg&&Zn.dom.i2svg({node:r})};function Cf(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(r){return Au(r)})}}),Object.defineProperty(e,"node",{get:function(){if(ui){var r=It.createElement("div");return r.innerHTML=e.html,r.children}}}),e}function OL(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,o=e.styles,a=e.transform;if(Iv(a)&&n.found&&!r.found){var s=n.width,u=n.height,c={x:s/u/2,y:.5};i.style=bf(pe(pe({},o),{},{"transform-origin":"".concat(c.x+a.x/16,"em ").concat(c.y+a.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}function DL(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,o=e.symbol,a=o===!0?"".concat(t,"-").concat(me.cssPrefix,"-").concat(n):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:pe(pe({},i),{},{id:a}),children:r}]}]}function Dv(e){var t=e.icons,n=t.main,r=t.mask,i=e.prefix,o=e.iconName,a=e.transform,s=e.symbol,u=e.title,c=e.maskId,l=e.titleId,f=e.extra,d=e.watchable,p=d===void 0?!1:d,h=r.found?r:n,v=h.width,C=h.height,E=i==="fak",y=[me.replacementClass,o?"".concat(me.cssPrefix,"-").concat(o):""].filter(function(I){return f.classes.indexOf(I)===-1}).filter(function(I){return I!==""||!!I}).concat(f.classes).join(" "),w={children:[],attributes:pe(pe({},f.attributes),{},{"data-prefix":i,"data-icon":o,class:y,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(v," ").concat(C)})},x=E&&!~f.classes.indexOf("fa-fw")?{width:"".concat(v/C*16*.0625,"em")}:{};p&&(w.attributes[$o]=""),u&&(w.children.push({tag:"title",attributes:{id:w.attributes["aria-labelledby"]||"title-".concat(l||nu())},children:[u]}),delete w.attributes.title);var S=pe(pe({},w),{},{prefix:i,iconName:o,main:n,mask:r,maskId:c,transform:a,symbol:s,styles:pe(pe({},x),f.styles)}),T=r.found&&n.found?oi("generateAbstractMask",S)||{children:[],attributes:{}}:oi("generateAbstractIcon",S)||{children:[],attributes:{}},A=T.children,D=T.attributes;return S.children=A,S.attributes=D,s?DL(S):OL(S)}function Jy(e){var t=e.content,n=e.width,r=e.height,i=e.transform,o=e.title,a=e.extra,s=e.watchable,u=s===void 0?!1:s,c=pe(pe(pe({},a.attributes),o?{title:o}:{}),{},{class:a.classes.join(" ")});u&&(c[$o]="");var l=pe({},a.styles);Iv(i)&&(l.transform=sL({transform:i,startCentered:!0,width:n,height:r}),l["-webkit-transform"]=l.transform);var f=bf(l);f.length>0&&(c.style=f);var d=[];return d.push({tag:"span",attributes:c,children:[t]}),o&&d.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),d}function NL(e){var t=e.content,n=e.title,r=e.extra,i=pe(pe(pe({},r.attributes),n?{title:n}:{}),{},{class:r.classes.join(" ")}),o=bf(r.styles);o.length>0&&(i.style=o);var a=[];return a.push({tag:"span",attributes:i,children:[t]}),n&&a.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),a}var zf=br.styles;function Mp(e){var t=e[0],n=e[1],r=e.slice(4),i=Sv(r,1),o=i[0],a=null;return Array.isArray(o)?a={tag:"g",attributes:{class:"".concat(me.cssPrefix,"-").concat(co.GROUP)},children:[{tag:"path",attributes:{class:"".concat(me.cssPrefix,"-").concat(co.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(me.cssPrefix,"-").concat(co.PRIMARY),fill:"currentColor",d:o[1]}}]}:a={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:t,height:n,icon:a}}var PL={found:!1,width:512,height:512};function RL(e,t){!LC&&!me.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function jp(e,t){var n=t;return t==="fa"&&me.styleDefault!==null&&(t=_i()),new Promise(function(r,i){if(oi("missingIconAbstract"),n==="fa"){var o=ZC(e)||{};e=o.iconName||e,t=o.prefix||t}if(e&&t&&zf[t]&&zf[t][e]){var a=zf[t][e];return r(Mp(a))}RL(e,t),r(pe(pe({},PL),{},{icon:me.showMissingIcons&&e?oi("missingIconAbstract")||{}:{}}))})}var Qy=function(){},_p=me.measurePerformance&&Zu&&Zu.mark&&Zu.measure?Zu:{mark:Qy,measure:Qy},Es='FA "6.5.1"',kL=function(t){return _p.mark("".concat(Es," ").concat(t," begins")),function(){return tx(t)}},tx=function(t){_p.mark("".concat(Es," ").concat(t," ends")),_p.measure("".concat(Es," ").concat(t),"".concat(Es," ").concat(t," begins"),"".concat(Es," ").concat(t," ends"))},Nv={begin:kL,end:tx},Pc=function(){};function Zy(e){var t=e.getAttribute?e.getAttribute($o):null;return typeof t=="string"}function ML(e){var t=e.getAttribute?e.getAttribute(Cv):null,n=e.getAttribute?e.getAttribute(xv):null;return t&&n}function jL(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(me.replacementClass)}function _L(){if(me.autoReplaceSvg===!0)return Rc.replace;var e=Rc[me.autoReplaceSvg];return e||Rc.replace}function qL(e){return It.createElementNS("http://www.w3.org/2000/svg",e)}function FL(e){return It.createElement(e)}function nx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,r=n===void 0?e.tag==="svg"?qL:FL:n;if(typeof e=="string")return It.createTextNode(e);var i=r(e.tag);Object.keys(e.attributes||[]).forEach(function(a){i.setAttribute(a,e.attributes[a])});var o=e.children||[];return o.forEach(function(a){i.appendChild(nx(a,{ceFn:r}))}),i}function LL(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var Rc={replace:function(t){var n=t[0];if(n.parentNode)if(t[1].forEach(function(i){n.parentNode.insertBefore(nx(i),n)}),n.getAttribute($o)===null&&me.keepOriginalSource){var r=It.createComment(LL(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(t){var n=t[0],r=t[1];if(~Tv(n).indexOf(me.replacementClass))return Rc.replace(t);var i=new RegExp("".concat(me.cssPrefix,"-.*"));if(delete r[0].attributes.id,r[0].attributes.class){var o=r[0].attributes.class.split(" ").reduce(function(s,u){return u===me.replacementClass||u.match(i)?s.toSvg.push(u):s.toNode.push(u),s},{toNode:[],toSvg:[]});r[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?n.removeAttribute("class"):n.setAttribute("class",o.toNode.join(" "))}var a=r.map(function(s){return Au(s)}).join(`
|
|
952
|
+
`);n.setAttribute($o,""),n.innerHTML=a}};function eg(e){e()}function rx(e,t){var n=typeof t=="function"?t:Pc;if(e.length===0)n();else{var r=eg;me.mutateApproach===GF&&(r=ji.requestAnimationFrame||eg),r(function(){var i=_L(),o=Nv.begin("mutate");e.map(i),o(),n()})}}var Pv=!1;function ix(){Pv=!0}function qp(){Pv=!1}var ul=null;function tg(e){if(Gy&&me.observeMutations){var t=e.treeCallback,n=t===void 0?Pc:t,r=e.nodeCallback,i=r===void 0?Pc:r,o=e.pseudoElementsCallback,a=o===void 0?Pc:o,s=e.observeMutationsRoot,u=s===void 0?It:s;ul=new Gy(function(c){if(!Pv){var l=_i();Qa(c).forEach(function(f){if(f.type==="childList"&&f.addedNodes.length>0&&!Zy(f.addedNodes[0])&&(me.searchPseudoElements&&a(f.target),n(f.target)),f.type==="attributes"&&f.target.parentNode&&me.searchPseudoElements&&a(f.target.parentNode),f.type==="attributes"&&Zy(f.target)&&~JF.indexOf(f.attributeName))if(f.attributeName==="class"&&ML(f.target)){var d=wf(Tv(f.target)),p=d.prefix,h=d.iconName;f.target.setAttribute(Cv,p||l),h&&f.target.setAttribute(xv,h)}else jL(f.target)&&i(f.target)})}}),ui&&ul.observe(u,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function BL(){ul&&ul.disconnect()}function VL(e){var t=e.getAttribute("style"),n=[];return t&&(n=t.split(";").reduce(function(r,i){var o=i.split(":"),a=o[0],s=o.slice(1);return a&&s.length>0&&(r[a]=s.join(":").trim()),r},{})),n}function UL(e){var t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=e.innerText!==void 0?e.innerText.trim():"",i=wf(Tv(e));return i.prefix||(i.prefix=_i()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=SL(i.prefix,e.innerText)||$v(i.prefix,Np(e.innerText))),!i.iconName&&me.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i}function GL(e){var t=Qa(e.attributes).reduce(function(i,o){return i.name!=="class"&&i.name!=="style"&&(i[o.name]=o.value),i},{}),n=e.getAttribute("title"),r=e.getAttribute("data-fa-title-id");return me.autoA11y&&(n?t["aria-labelledby"]="".concat(me.replacementClass,"-title-").concat(r||nu()):(t["aria-hidden"]="true",t.focusable="false")),t}function zL(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Or,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function ng(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=UL(e),r=n.iconName,i=n.prefix,o=n.rest,a=GL(e),s=Rp("parseNodeAttributes",{},e),u=t.styleParser?VL(e):[];return pe({iconName:r,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:i,transform:Or,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:u,attributes:a}},s)}var WL=br.styles;function ox(e){var t=me.autoReplaceSvg==="nest"?ng(e,{styleParser:!1}):ng(e);return~t.extra.classes.indexOf(BC)?oi("generateLayersText",e,t):oi("generateSvgReplacementMutation",e,t)}var qi=new Set;Ev.map(function(e){qi.add("fa-".concat(e))});Object.keys(Qs[Et]).map(qi.add.bind(qi));Object.keys(Qs[_t]).map(qi.add.bind(qi));qi=Tu(qi);function rg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!ui)return Promise.resolve();var n=It.documentElement.classList,r=function(f){return n.add("".concat(zy,"-").concat(f))},i=function(f){return n.remove("".concat(zy,"-").concat(f))},o=me.autoFetchSvg?qi:Ev.map(function(l){return"fa-".concat(l)}).concat(Object.keys(WL));o.includes("fa")||o.push("fa");var a=[".".concat(BC,":not([").concat($o,"])")].concat(o.map(function(l){return".".concat(l,":not([").concat($o,"])")})).join(", ");if(a.length===0)return Promise.resolve();var s=[];try{s=Qa(e.querySelectorAll(a))}catch{}if(s.length>0)r("pending"),i("complete");else return Promise.resolve();var u=Nv.begin("onTree"),c=s.reduce(function(l,f){try{var d=ox(f);d&&l.push(d)}catch(p){LC||p.name==="MissingIcon"&&console.error(p)}return l},[]);return new Promise(function(l,f){Promise.all(c).then(function(d){rx(d,function(){r("active"),r("complete"),i("pending"),typeof t=="function"&&t(),u(),l()})}).catch(function(d){u(),f(d)})})}function HL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;ox(e).then(function(n){n&&rx([n],t)})}function KL(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(t||{}).icon?t:kp(t||{}),i=n.mask;return i&&(i=(i||{}).icon?i:kp(i||{})),e(r,pe(pe({},n),{},{mask:i}))}}var YL=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.transform,i=r===void 0?Or:r,o=n.symbol,a=o===void 0?!1:o,s=n.mask,u=s===void 0?null:s,c=n.maskId,l=c===void 0?null:c,f=n.title,d=f===void 0?null:f,p=n.titleId,h=p===void 0?null:p,v=n.classes,C=v===void 0?[]:v,E=n.attributes,y=E===void 0?{}:E,w=n.styles,x=w===void 0?{}:w;if(t){var S=t.prefix,T=t.iconName,A=t.icon;return Cf(pe({type:"icon"},t),function(){return Oo("beforeDOMElementCreation",{iconDefinition:t,params:n}),me.autoA11y&&(d?y["aria-labelledby"]="".concat(me.replacementClass,"-title-").concat(h||nu()):(y["aria-hidden"]="true",y.focusable="false")),Dv({icons:{main:Mp(A),mask:u?Mp(u.icon):{found:!1,width:null,height:null,icon:{}}},prefix:S,iconName:T,transform:pe(pe({},Or),i),symbol:a,title:d,maskId:l,titleId:h,extra:{attributes:y,styles:x,classes:C}})})}},XL={mixout:function(){return{icon:KL(YL)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=rg,n.nodeCallback=HL,n}}},provides:function(t){t.i2svg=function(n){var r=n.node,i=r===void 0?It:r,o=n.callback,a=o===void 0?function(){}:o;return rg(i,a)},t.generateSvgReplacementMutation=function(n,r){var i=r.iconName,o=r.title,a=r.titleId,s=r.prefix,u=r.transform,c=r.symbol,l=r.mask,f=r.maskId,d=r.extra;return new Promise(function(p,h){Promise.all([jp(i,s),l.iconName?jp(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(v){var C=Sv(v,2),E=C[0],y=C[1];p([n,Dv({icons:{main:E,mask:y},prefix:s,iconName:i,transform:u,symbol:c,maskId:f,title:o,titleId:a,extra:d,watchable:!0})])}).catch(h)})},t.generateAbstractIcon=function(n){var r=n.children,i=n.attributes,o=n.main,a=n.transform,s=n.styles,u=bf(s);u.length>0&&(i.style=u);var c;return Iv(a)&&(c=oi("generateAbstractTransformGrouping",{main:o,transform:a,containerWidth:o.width,iconWidth:o.width})),r.push(c||o.icon),{children:r,attributes:i}}}},JL={mixout:function(){return{layer:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.classes,o=i===void 0?[]:i;return Cf({type:"layer"},function(){Oo("beforeDOMElementCreation",{assembler:n,params:r});var a=[];return n(function(s){Array.isArray(s)?s.map(function(u){a=a.concat(u.abstract)}):a=a.concat(s.abstract)}),[{tag:"span",attributes:{class:["".concat(me.cssPrefix,"-layers")].concat(Tu(o)).join(" ")},children:a}]})}}}},QL={mixout:function(){return{counter:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.title,o=i===void 0?null:i,a=r.classes,s=a===void 0?[]:a,u=r.attributes,c=u===void 0?{}:u,l=r.styles,f=l===void 0?{}:l;return Cf({type:"counter",content:n},function(){return Oo("beforeDOMElementCreation",{content:n,params:r}),NL({content:n.toString(),title:o,extra:{attributes:c,styles:f,classes:["".concat(me.cssPrefix,"-layers-counter")].concat(Tu(s))}})})}}}},ZL={mixout:function(){return{text:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.transform,o=i===void 0?Or:i,a=r.title,s=a===void 0?null:a,u=r.classes,c=u===void 0?[]:u,l=r.attributes,f=l===void 0?{}:l,d=r.styles,p=d===void 0?{}:d;return Cf({type:"text",content:n},function(){return Oo("beforeDOMElementCreation",{content:n,params:r}),Jy({content:n,transform:pe(pe({},Or),o),title:s,extra:{attributes:f,styles:p,classes:["".concat(me.cssPrefix,"-layers-text")].concat(Tu(c))}})})}}},provides:function(t){t.generateLayersText=function(n,r){var i=r.title,o=r.transform,a=r.extra,s=null,u=null;if(_C){var c=parseInt(getComputedStyle(n).fontSize,10),l=n.getBoundingClientRect();s=l.width/c,u=l.height/c}return me.autoA11y&&!i&&(a.attributes["aria-hidden"]="true"),Promise.resolve([n,Jy({content:n.innerHTML,width:s,height:u,transform:o,title:i,extra:a,watchable:!0})])}}},e5=new RegExp('"',"ug"),ig=[1105920,1112319];function t5(e){var t=e.replace(e5,""),n=hL(t,0),r=n>=ig[0]&&n<=ig[1],i=t.length===2?t[0]===t[1]:!1;return{value:Np(i?t[0]:t),isSecondary:r||i}}function og(e,t){var n="".concat(UF).concat(t.replace(":","-"));return new Promise(function(r,i){if(e.getAttribute(n)!==null)return r();var o=Qa(e.children),a=o.filter(function(A){return A.getAttribute(Dp)===t})[0],s=ji.getComputedStyle(e,t),u=s.getPropertyValue("font-family").match(KF),c=s.getPropertyValue("font-weight"),l=s.getPropertyValue("content");if(a&&!u)return e.removeChild(a),r();if(u&&l!=="none"&&l!==""){var f=s.getPropertyValue("content"),d=~["Sharp"].indexOf(u[2])?_t:Et,p=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(u[2])?Zs[d][u[2].toLowerCase()]:YF[d][c],h=t5(f),v=h.value,C=h.isSecondary,E=u[0].startsWith("FontAwesome"),y=$v(p,v),w=y;if(E){var x=wL(v);x.iconName&&x.prefix&&(y=x.iconName,p=x.prefix)}if(y&&!C&&(!a||a.getAttribute(Cv)!==p||a.getAttribute(xv)!==w)){e.setAttribute(n,w),a&&e.removeChild(a);var S=zL(),T=S.extra;T.attributes[Dp]=t,jp(y,p).then(function(A){var D=Dv(pe(pe({},S),{},{icons:{main:A,mask:Ov()},prefix:p,iconName:w,extra:T,watchable:!0})),I=It.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(I,e.firstChild):e.appendChild(I),I.outerHTML=D.map(function(N){return Au(N)}).join(`
|
|
953
|
+
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function n5(e){return Promise.all([og(e,"::before"),og(e,"::after")])}function r5(e){return e.parentNode!==document.head&&!~zF.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(Dp)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function ag(e){if(ui)return new Promise(function(t,n){var r=Qa(e.querySelectorAll("*")).filter(r5).map(n5),i=Nv.begin("searchPseudoElements");ix(),Promise.all(r).then(function(){i(),qp(),t()}).catch(function(){i(),qp(),n()})})}var i5={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=ag,n}}},provides:function(t){t.pseudoElements2svg=function(n){var r=n.node,i=r===void 0?It:r;me.searchPseudoElements&&ag(i)}}},sg=!1,o5={mixout:function(){return{dom:{unwatch:function(){ix(),sg=!0}}}},hooks:function(){return{bootstrap:function(){tg(Rp("mutationObserverCallbacks",{}))},noAuto:function(){BL()},watch:function(n){var r=n.observeMutationsRoot;sg?qp():tg(Rp("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}},ug=function(t){var n={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t.toLowerCase().split(" ").reduce(function(r,i){var o=i.toLowerCase().split("-"),a=o[0],s=o.slice(1).join("-");if(a&&s==="h")return r.flipX=!0,r;if(a&&s==="v")return r.flipY=!0,r;if(s=parseFloat(s),isNaN(s))return r;switch(a){case"grow":r.size=r.size+s;break;case"shrink":r.size=r.size-s;break;case"left":r.x=r.x-s;break;case"right":r.x=r.x+s;break;case"up":r.y=r.y-s;break;case"down":r.y=r.y+s;break;case"rotate":r.rotate=r.rotate+s;break}return r},n)},a5={mixout:function(){return{parse:{transform:function(n){return ug(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-transform");return i&&(n.transform=ug(i)),n}}},provides:function(t){t.generateAbstractTransformGrouping=function(n){var r=n.main,i=n.transform,o=n.containerWidth,a=n.iconWidth,s={transform:"translate(".concat(o/2," 256)")},u="translate(".concat(i.x*32,", ").concat(i.y*32,") "),c="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),l="rotate(".concat(i.rotate," 0 0)"),f={transform:"".concat(u," ").concat(c," ").concat(l)},d={transform:"translate(".concat(a/2*-1," -256)")},p={outer:s,inner:f,path:d};return{tag:"g",attributes:pe({},p.outer),children:[{tag:"g",attributes:pe({},p.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:pe(pe({},r.icon.attributes),p.path)}]}]}}}},Wf={x:0,y:0,width:"100%",height:"100%"};function cg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function s5(e){return e.tag==="g"?e.children:[e]}var u5={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-mask"),o=i?wf(i.split(" ").map(function(a){return a.trim()})):Ov();return o.prefix||(o.prefix=_i()),n.mask=o,n.maskId=r.getAttribute("data-fa-mask-id"),n}}},provides:function(t){t.generateAbstractMask=function(n){var r=n.children,i=n.attributes,o=n.main,a=n.mask,s=n.maskId,u=n.transform,c=o.width,l=o.icon,f=a.width,d=a.icon,p=aL({transform:u,containerWidth:f,iconWidth:c}),h={tag:"rect",attributes:pe(pe({},Wf),{},{fill:"white"})},v=l.children?{children:l.children.map(cg)}:{},C={tag:"g",attributes:pe({},p.inner),children:[cg(pe({tag:l.tag,attributes:pe(pe({},l.attributes),p.path)},v))]},E={tag:"g",attributes:pe({},p.outer),children:[C]},y="mask-".concat(s||nu()),w="clip-".concat(s||nu()),x={tag:"mask",attributes:pe(pe({},Wf),{},{id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[h,E]},S={tag:"defs",children:[{tag:"clipPath",attributes:{id:w},children:s5(d)},x]};return r.push(S,{tag:"rect",attributes:pe({fill:"currentColor","clip-path":"url(#".concat(w,")"),mask:"url(#".concat(y,")")},Wf)}),{children:r,attributes:i}}}},c5={provides:function(t){var n=!1;ji.matchMedia&&(n=ji.matchMedia("(prefers-reduced-motion: reduce)").matches),t.missingIconAbstract=function(){var r=[],i={fill:"currentColor"},o={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};r.push({tag:"path",attributes:pe(pe({},i),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var a=pe(pe({},o),{},{attributeName:"opacity"}),s={tag:"circle",attributes:pe(pe({},i),{},{cx:"256",cy:"364",r:"28"}),children:[]};return n||s.children.push({tag:"animate",attributes:pe(pe({},o),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:pe(pe({},a),{},{values:"1;0;1;1;0;1;"})}),r.push(s),r.push({tag:"path",attributes:pe(pe({},i),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:n?[]:[{tag:"animate",attributes:pe(pe({},a),{},{values:"1;0;0;0;0;1;"})}]}),n||r.push({tag:"path",attributes:pe(pe({},i),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:pe(pe({},a),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:r}}}},l5={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-symbol"),o=i===null?!1:i===""?!0:i;return n.symbol=o,n}}}},f5=[cL,XL,JL,QL,ZL,i5,o5,a5,u5,c5,l5];EL(f5,{mixoutsTo:Zn});Zn.noAuto;Zn.config;Zn.library;Zn.dom;var Fp=Zn.parse;Zn.findIconDefinition;Zn.toHtml;var d5=Zn.icon;Zn.layer;Zn.text;Zn.counter;var Lp={exports:{}},uc={exports:{}},it={};/** @license React v16.13.1
|
|
954
|
+
* react-is.production.min.js
|
|
955
|
+
*
|
|
956
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
957
|
+
*
|
|
958
|
+
* This source code is licensed under the MIT license found in the
|
|
959
|
+
* LICENSE file in the root directory of this source tree.
|
|
960
|
+
*/var lg;function p5(){if(lg)return it;lg=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,C=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w(S){if(typeof S=="object"&&S!==null){var T=S.$$typeof;switch(T){case t:switch(S=S.type,S){case u:case c:case r:case o:case i:case f:return S;default:switch(S=S&&S.$$typeof,S){case s:case l:case h:case p:case a:return S;default:return T}}case n:return T}}}function x(S){return w(S)===c}return it.AsyncMode=u,it.ConcurrentMode=c,it.ContextConsumer=s,it.ContextProvider=a,it.Element=t,it.ForwardRef=l,it.Fragment=r,it.Lazy=h,it.Memo=p,it.Portal=n,it.Profiler=o,it.StrictMode=i,it.Suspense=f,it.isAsyncMode=function(S){return x(S)||w(S)===u},it.isConcurrentMode=x,it.isContextConsumer=function(S){return w(S)===s},it.isContextProvider=function(S){return w(S)===a},it.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},it.isForwardRef=function(S){return w(S)===l},it.isFragment=function(S){return w(S)===r},it.isLazy=function(S){return w(S)===h},it.isMemo=function(S){return w(S)===p},it.isPortal=function(S){return w(S)===n},it.isProfiler=function(S){return w(S)===o},it.isStrictMode=function(S){return w(S)===i},it.isSuspense=function(S){return w(S)===f},it.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===c||S===o||S===i||S===f||S===d||typeof S=="object"&&S!==null&&(S.$$typeof===h||S.$$typeof===p||S.$$typeof===a||S.$$typeof===s||S.$$typeof===l||S.$$typeof===C||S.$$typeof===E||S.$$typeof===y||S.$$typeof===v)},it.typeOf=w,it}var ot={};/** @license React v16.13.1
|
|
961
|
+
* react-is.development.js
|
|
962
|
+
*
|
|
963
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
964
|
+
*
|
|
965
|
+
* This source code is licensed under the MIT license found in the
|
|
966
|
+
* LICENSE file in the root directory of this source tree.
|
|
967
|
+
*/var fg;function h5(){return fg||(fg=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,C=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w(ce){return typeof ce=="string"||typeof ce=="function"||ce===r||ce===c||ce===o||ce===i||ce===f||ce===d||typeof ce=="object"&&ce!==null&&(ce.$$typeof===h||ce.$$typeof===p||ce.$$typeof===a||ce.$$typeof===s||ce.$$typeof===l||ce.$$typeof===C||ce.$$typeof===E||ce.$$typeof===y||ce.$$typeof===v)}function x(ce){if(typeof ce=="object"&&ce!==null){var Nn=ce.$$typeof;switch(Nn){case t:var fi=ce.type;switch(fi){case u:case c:case r:case o:case i:case f:return fi;default:var Lo=fi&&fi.$$typeof;switch(Lo){case s:case l:case h:case p:case a:return Lo;default:return Nn}}case n:return Nn}}}var S=u,T=c,A=s,D=a,I=t,N=l,j=r,L=h,V=p,H=n,R=o,ie=i,B=f,U=!1;function fe(ce){return U||(U=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),M(ce)||x(ce)===u}function M(ce){return x(ce)===c}function P(ce){return x(ce)===s}function te(ce){return x(ce)===a}function oe(ce){return typeof ce=="object"&&ce!==null&&ce.$$typeof===t}function K(ce){return x(ce)===l}function ae(ce){return x(ce)===r}function de(ce){return x(ce)===h}function ve(ce){return x(ce)===p}function Ee(ce){return x(ce)===n}function Re(ce){return x(ce)===o}function De(ce){return x(ce)===i}function yt(ce){return x(ce)===f}ot.AsyncMode=S,ot.ConcurrentMode=T,ot.ContextConsumer=A,ot.ContextProvider=D,ot.Element=I,ot.ForwardRef=N,ot.Fragment=j,ot.Lazy=L,ot.Memo=V,ot.Portal=H,ot.Profiler=R,ot.StrictMode=ie,ot.Suspense=B,ot.isAsyncMode=fe,ot.isConcurrentMode=M,ot.isContextConsumer=P,ot.isContextProvider=te,ot.isElement=oe,ot.isForwardRef=K,ot.isFragment=ae,ot.isLazy=de,ot.isMemo=ve,ot.isPortal=Ee,ot.isProfiler=Re,ot.isStrictMode=De,ot.isSuspense=yt,ot.isValidElementType=w,ot.typeOf=x}()),ot}var dg;function ax(){return dg||(dg=1,process.env.NODE_ENV==="production"?uc.exports=p5():uc.exports=h5()),uc.exports}/*
|
|
968
|
+
object-assign
|
|
969
|
+
(c) Sindre Sorhus
|
|
970
|
+
@license MIT
|
|
971
|
+
*/var Hf,pg;function v5(){if(pg)return Hf;pg=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var u=Object.getOwnPropertyNames(a).map(function(l){return a[l]});if(u.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(l){c[l]=l}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Hf=i()?Object.assign:function(o,a){for(var s,u=r(o),c,l=1;l<arguments.length;l++){s=Object(arguments[l]);for(var f in s)t.call(s,f)&&(u[f]=s[f]);if(e){c=e(s);for(var d=0;d<c.length;d++)n.call(s,c[d])&&(u[c[d]]=s[c[d]])}}return u},Hf}var Kf,hg;function Rv(){if(hg)return Kf;hg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Kf=e,Kf}var Yf,vg;function sx(){return vg||(vg=1,Yf=Function.call.bind(Object.prototype.hasOwnProperty)),Yf}var Xf,mg;function m5(){if(mg)return Xf;mg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Rv(),n={},r=sx();e=function(o){var a="Warning: "+o;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,a,s,u,c){if(process.env.NODE_ENV!=="production"){for(var l in o)if(r(o,l)){var f;try{if(typeof o[l]!="function"){var d=Error((u||"React class")+": "+s+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=o[l](a,l,u,s,null,t)}catch(h){f=h}if(f&&!(f instanceof Error)&&e((u||"React class")+": type specification of "+s+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var p=c?c():"";e("Failed "+s+" type: "+f.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Xf=i,Xf}var Jf,yg;function y5(){if(yg)return Jf;yg=1;var e=ax(),t=v5(),n=Rv(),r=sx(),i=m5(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(s){var u="Warning: "+s;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function a(){return null}return Jf=function(s,u){var c=typeof Symbol=="function"&&Symbol.iterator,l="@@iterator";function f(M){var P=M&&(c&&M[c]||M[l]);if(typeof P=="function")return P}var d="<<anonymous>>",p={array:E("array"),bigint:E("bigint"),bool:E("boolean"),func:E("function"),number:E("number"),object:E("object"),string:E("string"),symbol:E("symbol"),any:y(),arrayOf:w,element:x(),elementType:S(),instanceOf:T,node:N(),objectOf:D,oneOf:A,oneOfType:I,shape:L,exact:V};function h(M,P){return M===P?M!==0||1/M===1/P:M!==M&&P!==P}function v(M,P){this.message=M,this.data=P&&typeof P=="object"?P:{},this.stack=""}v.prototype=Error.prototype;function C(M){if(process.env.NODE_ENV!=="production")var P={},te=0;function oe(ae,de,ve,Ee,Re,De,yt){if(Ee=Ee||d,De=De||ve,yt!==n){if(u){var ce=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw ce.name="Invariant Violation",ce}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Nn=Ee+":"+ve;!P[Nn]&&te<3&&(o("You are manually calling a React.PropTypes validation function for the `"+De+"` prop on `"+Ee+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),P[Nn]=!0,te++)}}return de[ve]==null?ae?de[ve]===null?new v("The "+Re+" `"+De+"` is marked as required "+("in `"+Ee+"`, but its value is `null`.")):new v("The "+Re+" `"+De+"` is marked as required in "+("`"+Ee+"`, but its value is `undefined`.")):null:M(de,ve,Ee,Re,De)}var K=oe.bind(null,!1);return K.isRequired=oe.bind(null,!0),K}function E(M){function P(te,oe,K,ae,de,ve){var Ee=te[oe],Re=ie(Ee);if(Re!==M){var De=B(Ee);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+De+"` supplied to `"+K+"`, expected ")+("`"+M+"`."),{expectedType:M})}return null}return C(P)}function y(){return C(a)}function w(M){function P(te,oe,K,ae,de){if(typeof M!="function")return new v("Property `"+de+"` of component `"+K+"` has invalid PropType notation inside arrayOf.");var ve=te[oe];if(!Array.isArray(ve)){var Ee=ie(ve);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+Ee+"` supplied to `"+K+"`, expected an array."))}for(var Re=0;Re<ve.length;Re++){var De=M(ve,Re,K,ae,de+"["+Re+"]",n);if(De instanceof Error)return De}return null}return C(P)}function x(){function M(P,te,oe,K,ae){var de=P[te];if(!s(de)){var ve=ie(de);return new v("Invalid "+K+" `"+ae+"` of type "+("`"+ve+"` supplied to `"+oe+"`, expected a single ReactElement."))}return null}return C(M)}function S(){function M(P,te,oe,K,ae){var de=P[te];if(!e.isValidElementType(de)){var ve=ie(de);return new v("Invalid "+K+" `"+ae+"` of type "+("`"+ve+"` supplied to `"+oe+"`, expected a single ReactElement type."))}return null}return C(M)}function T(M){function P(te,oe,K,ae,de){if(!(te[oe]instanceof M)){var ve=M.name||d,Ee=fe(te[oe]);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+Ee+"` supplied to `"+K+"`, expected ")+("instance of `"+ve+"`."))}return null}return C(P)}function A(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),a;function P(te,oe,K,ae,de){for(var ve=te[oe],Ee=0;Ee<M.length;Ee++)if(h(ve,M[Ee]))return null;var Re=JSON.stringify(M,function(yt,ce){var Nn=B(ce);return Nn==="symbol"?String(ce):ce});return new v("Invalid "+ae+" `"+de+"` of value `"+String(ve)+"` "+("supplied to `"+K+"`, expected one of "+Re+"."))}return C(P)}function D(M){function P(te,oe,K,ae,de){if(typeof M!="function")return new v("Property `"+de+"` of component `"+K+"` has invalid PropType notation inside objectOf.");var ve=te[oe],Ee=ie(ve);if(Ee!=="object")return new v("Invalid "+ae+" `"+de+"` of type "+("`"+Ee+"` supplied to `"+K+"`, expected an object."));for(var Re in ve)if(r(ve,Re)){var De=M(ve,Re,K,ae,de+"."+Re,n);if(De instanceof Error)return De}return null}return C(P)}function I(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var P=0;P<M.length;P++){var te=M[P];if(typeof te!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+U(te)+" at index "+P+"."),a}function oe(K,ae,de,ve,Ee){for(var Re=[],De=0;De<M.length;De++){var yt=M[De],ce=yt(K,ae,de,ve,Ee,n);if(ce==null)return null;ce.data&&r(ce.data,"expectedType")&&Re.push(ce.data.expectedType)}var Nn=Re.length>0?", expected one of type ["+Re.join(", ")+"]":"";return new v("Invalid "+ve+" `"+Ee+"` supplied to "+("`"+de+"`"+Nn+"."))}return C(oe)}function N(){function M(P,te,oe,K,ae){return H(P[te])?null:new v("Invalid "+K+" `"+ae+"` supplied to "+("`"+oe+"`, expected a ReactNode."))}return C(M)}function j(M,P,te,oe,K){return new v((M||"React class")+": "+P+" type `"+te+"."+oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+K+"`.")}function L(M){function P(te,oe,K,ae,de){var ve=te[oe],Ee=ie(ve);if(Ee!=="object")return new v("Invalid "+ae+" `"+de+"` of type `"+Ee+"` "+("supplied to `"+K+"`, expected `object`."));for(var Re in M){var De=M[Re];if(typeof De!="function")return j(K,ae,de,Re,B(De));var yt=De(ve,Re,K,ae,de+"."+Re,n);if(yt)return yt}return null}return C(P)}function V(M){function P(te,oe,K,ae,de){var ve=te[oe],Ee=ie(ve);if(Ee!=="object")return new v("Invalid "+ae+" `"+de+"` of type `"+Ee+"` "+("supplied to `"+K+"`, expected `object`."));var Re=t({},te[oe],M);for(var De in Re){var yt=M[De];if(r(M,De)&&typeof yt!="function")return j(K,ae,de,De,B(yt));if(!yt)return new v("Invalid "+ae+" `"+de+"` key `"+De+"` supplied to `"+K+"`.\nBad object: "+JSON.stringify(te[oe],null," ")+`
|
|
972
|
+
Valid keys: `+JSON.stringify(Object.keys(M),null," "));var ce=yt(ve,De,K,ae,de+"."+De,n);if(ce)return ce}return null}return C(P)}function H(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(H);if(M===null||s(M))return!0;var P=f(M);if(P){var te=P.call(M),oe;if(P!==M.entries){for(;!(oe=te.next()).done;)if(!H(oe.value))return!1}else for(;!(oe=te.next()).done;){var K=oe.value;if(K&&!H(K[1]))return!1}}else return!1;return!0;default:return!1}}function R(M,P){return M==="symbol"?!0:P?P["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&P instanceof Symbol:!1}function ie(M){var P=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":R(P,M)?"symbol":P}function B(M){if(typeof M>"u"||M===null)return""+M;var P=ie(M);if(P==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return P}function U(M){var P=B(M);switch(P){case"array":case"object":return"an "+P;case"boolean":case"date":case"regexp":return"a "+P;default:return P}}function fe(M){return!M.constructor||!M.constructor.name?d:M.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},Jf}var Qf,gg;function g5(){if(gg)return Qf;gg=1;var e=Rv();function t(){}function n(){}return n.resetWarningCache=t,Qf=function(){function r(a,s,u,c,l,f){if(f!==e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Qf}if(process.env.NODE_ENV!=="production"){var b5=ax(),S5=!0;Lp.exports=y5()(b5.isElement,S5)}else Lp.exports=g5()();var w5=Lp.exports;const _e=Fb(w5);function bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ti(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bg(Object(n),!0).forEach(function(r){pa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cl(e){"@babel/helpers - typeof";return cl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cl(e)}function pa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C5(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function x5(e,t){if(e==null)return{};var n=C5(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Bp(e){return E5(e)||T5(e)||I5(e)||A5()}function E5(e){if(Array.isArray(e))return Vp(e)}function T5(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function I5(e,t){if(e){if(typeof e=="string")return Vp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vp(e,t)}}function Vp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function A5(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
973
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $5(e){var t,n=e.beat,r=e.fade,i=e.beatFade,o=e.bounce,a=e.shake,s=e.flash,u=e.spin,c=e.spinPulse,l=e.spinReverse,f=e.pulse,d=e.fixedWidth,p=e.inverse,h=e.border,v=e.listItem,C=e.flip,E=e.size,y=e.rotation,w=e.pull,x=(t={"fa-beat":n,"fa-fade":r,"fa-beat-fade":i,"fa-bounce":o,"fa-shake":a,"fa-flash":s,"fa-spin":u,"fa-spin-reverse":l,"fa-spin-pulse":c,"fa-pulse":f,"fa-fw":d,"fa-inverse":p,"fa-border":h,"fa-li":v,"fa-flip":C===!0,"fa-flip-horizontal":C==="horizontal"||C==="both","fa-flip-vertical":C==="vertical"||C==="both"},pa(t,"fa-".concat(E),typeof E<"u"&&E!==null),pa(t,"fa-rotate-".concat(y),typeof y<"u"&&y!==null&&y!==0),pa(t,"fa-pull-".concat(w),typeof w<"u"&&w!==null),pa(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(x).map(function(S){return x[S]?S:null}).filter(function(S){return S})}function O5(e){return e=e-0,e===e}function ux(e){return O5(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(t,n){return n?n.toUpperCase():""}),e.substr(0,1).toLowerCase()+e.substr(1))}var D5=["style"];function N5(e){return e.charAt(0).toUpperCase()+e.slice(1)}function P5(e){return e.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,n){var r=n.indexOf(":"),i=ux(n.slice(0,r)),o=n.slice(r+1).trim();return i.startsWith("webkit")?t[N5(i)]=o:t[i]=o,t},{})}function cx(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string")return t;var r=(t.children||[]).map(function(u){return cx(e,u)}),i=Object.keys(t.attributes||{}).reduce(function(u,c){var l=t.attributes[c];switch(c){case"class":u.attrs.className=l,delete t.attributes.class;break;case"style":u.attrs.style=P5(l);break;default:c.indexOf("aria-")===0||c.indexOf("data-")===0?u.attrs[c.toLowerCase()]=l:u.attrs[ux(c)]=l}return u},{attrs:{}}),o=n.style,a=o===void 0?{}:o,s=x5(n,D5);return i.attrs.style=Ti(Ti({},i.attrs.style),a),e.apply(void 0,[t.tag,Ti(Ti({},i.attrs),s)].concat(Bp(r)))}var lx=!1;try{lx=process.env.NODE_ENV==="production"}catch{}function R5(){if(!lx&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Sg(e){if(e&&cl(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Fp.icon)return Fp.icon(e);if(e===null)return null;if(e&&cl(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}function Zf(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?pa({},e,t):{}}var Fi=O.forwardRef(function(e,t){var n=e.icon,r=e.mask,i=e.symbol,o=e.className,a=e.title,s=e.titleId,u=e.maskId,c=Sg(n),l=Zf("classes",[].concat(Bp($5(e)),Bp(o.split(" ")))),f=Zf("transform",typeof e.transform=="string"?Fp.transform(e.transform):e.transform),d=Zf("mask",Sg(r)),p=d5(c,Ti(Ti(Ti(Ti({},l),f),d),{},{symbol:i,title:a,titleId:s,maskId:u}));if(!p)return R5("Could not find icon",c),null;var h=p.abstract,v={ref:t};return Object.keys(e).forEach(function(C){Fi.defaultProps.hasOwnProperty(C)||(v[C]=e[C])}),k5(h[0],v)});Fi.displayName="FontAwesomeIcon";Fi.propTypes={beat:_e.bool,border:_e.bool,beatFade:_e.bool,bounce:_e.bool,className:_e.string,fade:_e.bool,flash:_e.bool,mask:_e.oneOfType([_e.object,_e.array,_e.string]),maskId:_e.string,fixedWidth:_e.bool,inverse:_e.bool,flip:_e.oneOf([!0,!1,"horizontal","vertical","both"]),icon:_e.oneOfType([_e.object,_e.array,_e.string]),listItem:_e.bool,pull:_e.oneOf(["right","left"]),pulse:_e.bool,rotation:_e.oneOf([0,90,180,270]),shake:_e.bool,size:_e.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:_e.bool,spinPulse:_e.bool,spinReverse:_e.bool,symbol:_e.oneOfType([_e.bool,_e.string]),title:_e.string,titleId:_e.string,transform:_e.oneOfType([_e.string,_e.object]),swapOpacity:_e.bool};Fi.defaultProps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1};var k5=cx.bind(null,O.createElement);function fx(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=fx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function M5(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=fx(e))&&(r&&(r+=" "),r+=t);return r}var ll=am&&am.__assign||function(){return ll=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ll.apply(this,arguments)};function j5(e,t,n){if(t==="className")e.className=[e.className,n].join(" ").trim();else if(t==="style")e.style=ll(ll({},e.style),n);else if(typeof n=="function"){var r=e[t];e[t]=r?function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];r.apply(void 0,i),n.apply(void 0,i)}:n}else{if(n===void 0||typeof n!="object"&&n===e[t])return;if(!(t in e))e[t]=n;else throw new Error("Didn’t know how to merge prop '".concat(t,"'. ")+"Only 'className', 'style', and event handlers are supported")}}var _5=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length===1?t[0]:t.reduce(function(r,i){for(var o in i)j5(r,o,i[o]);return r},{})};const dx=Fb(_5);function Qo(){}function q5(){return!0}function ls(e){return!!(e||"").match(/\d/)}function wg(e){return e==null}function Cg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function F5(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function L5(e,t,n){var r=F5(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function Up(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),o=i[0],a=i[1]||"";return{beforeDecimal:o,afterDecimal:a,hasNagation:n,addNegation:r}}function B5(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function px(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function xg(e,t){return Array(t+1).join(e)}function V5(e){e+="";var t=e[0]==="-"?"-":"";t&&(e=e.substring(1));var n=e.split(/[eE]/g),r=n[0],i=n[1];if(i=Number(i),!i)return t+r;r=r.replace(".","");var o=1+i,a=r.length;return o<0?r="0."+xg("0",Math.abs(o))+r:o>=a?r=r+xg("0",o-a):r=(r.substring(0,o)||"0")+"."+r.substring(o),t+r}function U5(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=e.indexOf(".")!==-1&&t,i=Up(e),o=i.beforeDecimal,a=i.afterDecimal,s=i.hasNagation,u=parseFloat("0."+(a||"0")),c=a.length<=t?"0."+a:u.toFixed(t),l=c.split("."),f=o.split("").reverse().reduce(function(v,C,E){return v.length>E?(Number(v[0])+Number(C)).toString()+v.substring(1,v.length):C+v},l[0]),d=px(l[1]||"",Math.min(t,a.length),n),p=s?"-":"",h=r?".":"";return""+p+f+h+d}function Eg(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function G5(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[o-1-r]&&o-r>n&&i-r>n;)r++;return{start:n,end:i-r}}function ed(e,t,n){return Math.min(Math.max(e,t),n)}function Tg(e){return Math.max(e.selectionStart,e.selectionEnd)}function z5(e){return e||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function W5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)===-1&&(n[r]=e[r]);return n}var H5={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:Qo,onChange:Qo,onKeyDown:Qo,onMouseUp:Qo,onFocus:Qo,onBlur:Qo,isAllowed:q5},hx=function(e){function t(n){e.call(this,n);var r=n.defaultValue;this.validateProps();var i=this.formatValueProp(r);this.state={value:i,numAsString:this.removeFormatting(i),mounted:!1},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.componentDidMount=function(){this.setState({mounted:!0})},t.prototype.componentDidUpdate=function(r){this.updateValueIfRequired(r)},t.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},t.prototype.updateValueIfRequired=function(r){var i=this,o=i.props,a=i.state,s=i.focusedElm,u=a.value,c=a.numAsString;if(c===void 0&&(c=""),r!==o){this.validateProps();var l=this.formatNumString(c),f=wg(o.value)?l:this.formatValueProp(),d=this.removeFormatting(f),p=parseFloat(d),h=parseFloat(c);((!isNaN(p)||!isNaN(h))&&p!==h||l!==u||s===null&&f!==u)&&this.updateValue({formattedValue:f,numAsString:d,input:s,source:"prop",event:null})}},t.prototype.getFloatString=function(r){r===void 0&&(r="");var i=this.props,o=i.decimalScale,a=this.getSeparators(),s=a.decimalSeparator,u=this.getNumberRegex(!0),c=r[0]==="-";c&&(r=r.replace("-","")),s&&o===0&&(r=r.split(s)[0]),r=(r.match(u)||[]).join("").replace(s,".");var l=r.indexOf(".");return l!==-1&&(r=r.substring(0,l)+"."+r.substring(l+1,r.length).replace(new RegExp(Cg(s),"g"),"")),c&&(r="-"+r),r},t.prototype.getNumberRegex=function(r,i){var o=this.props,a=o.format,s=o.decimalScale,u=o.customNumerals,c=this.getSeparators(),l=c.decimalSeparator;return new RegExp("[0-9"+(u?u.join(""):"")+"]"+(l&&s!==0&&!i&&!a?"|"+Cg(l):""),r?"g":void 0)},t.prototype.getSeparators=function(){var r=this.props,i=r.decimalSeparator,o=this.props,a=o.thousandSeparator,s=o.allowedDecimalSeparators;return a===!0&&(a=","),s||(s=[i,"."]),{decimalSeparator:i,thousandSeparator:a,allowedDecimalSeparators:s}},t.prototype.getMaskAtIndex=function(r){var i=this.props,o=i.mask;return o===void 0&&(o=" "),typeof o=="string"?o:o[r]||" "},t.prototype.getValueObject=function(r,i){var o=parseFloat(i);return{formattedValue:r,value:i,floatValue:isNaN(o)?void 0:o}},t.prototype.validateProps=function(){var r=this.props,i=r.mask,o=this.getSeparators(),a=o.decimalSeparator,s=o.thousandSeparator;if(a===s)throw new Error(`
|
|
193
974
|
Decimal separator can't be same as thousand separator.
|
|
194
|
-
thousandSeparator: `+
|
|
975
|
+
thousandSeparator: `+s+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
195
976
|
decimalSeparator: `+a+` (default value for decimalSeparator is .)
|
|
196
|
-
`);if(
|
|
197
|
-
Mask `+
|
|
198
|
-
`)}},t.prototype.setPatchedCaretPosition=function(i,r,o){$p(i,r),this.caretPositionTimeout=setTimeout(function(){i.value===o&&$p(i,r)},0)},t.prototype.correctCaretPosition=function(i,r,o){var a=this.props,u=a.prefix,s=a.suffix,c=a.format;if(i==="")return 0;if(r=fc(r,0,i.length),!c){var l=i[0]==="-";return fc(r,u.length+(l?1:0),i.length-s.length)}if(typeof c=="function"||c[r]==="#"&&Uo(i[r])||c[r-1]==="#"&&Uo(i[r-1]))return r;var f=c.indexOf("#"),d=c.lastIndexOf("#");r=fc(r,f,d+1);for(var p=c.substring(r,c.length).indexOf("#"),h=r,v=r+(p===-1?0:p);h>f&&(c[h]!=="#"||!Uo(i[h]));)h-=1;var w=!Uo(i[v])||o==="left"&&r!==f||r-h<v-r;return w?Uo(i[h])?h+1:h:v},t.prototype.getCaretPosition=function(i,r,o){var a=this.props,u=a.format,s=this.state.value,c=this.getNumberRegex(!0),l=(i.match(c)||[]).join(""),f=(r.match(c)||[]).join(""),d,p;for(d=0,p=0;p<o;p++){var h=i[p]||"",v=r[d]||"";if(!(!h.match(c)&&h!==v)&&!(h==="0"&&v.match(c)&&v!=="0"&&l.length!==f.length)){for(;h!==r[d]&&d<r.length;)d++;d++}}return typeof u=="string"&&!s&&(d=r.length),d=this.correctCaretPosition(r,d),d},t.prototype.removePrefixAndSuffix=function(i){var r=this.props,o=r.format,a=r.prefix,u=r.suffix;if(!o&&i){var s=i[0]==="-";s&&(i=i.substring(1,i.length)),i=a&&i.indexOf(a)===0?i.substring(a.length,i.length):i;var c=i.lastIndexOf(u);i=u&&c!==-1&&c===i.length-u.length?i.substring(0,c):i,s&&(i="-"+i)}return i},t.prototype.removePatternFormatting=function(i){for(var r=this.props,o=r.format,a=o.split("#").filter(function(p){return p!==""}),u=0,s="",c=0,l=a.length;c<=l;c++){var f=a[c]||"",d=c===l?i.length:i.indexOf(f,u);if(d===-1){s=i;break}else s+=i.substring(u,d),u=d+f.length}return(s.match(this.getNumberRegex(!0))||[]).join("")},t.prototype.removeFormatting=function(i){var r=this.props,o=r.format,a=r.removeFormatting;return i&&(o?typeof o=="string"?i=this.removePatternFormatting(i):typeof a=="function"?i=a(i):i=(i.match(this.getNumberRegex(!0))||[]).join(""):(i=this.removePrefixAndSuffix(i),i=this.getFloatString(i)),i)},t.prototype.formatWithPattern=function(i){for(var r=this.props,o=r.format,a=0,u=o.split(""),s=0,c=o.length;s<c;s++)o[s]==="#"&&(u[s]=i[a]||this.getMaskAtIndex(a),a+=1);return u.join("")},t.prototype.formatAsNumber=function(i){var r=this.props,o=r.decimalScale,a=r.fixedDecimalScale,u=r.prefix,s=r.suffix,c=r.allowNegative,l=r.thousandsGroupStyle,f=this.getSeparators(),d=f.thousandSeparator,p=f.decimalSeparator,h=i.indexOf(".")!==-1||o&&a,v=Dl(i,c),w=v.beforeDecimal,C=v.afterDecimal,S=v.addNegation;return o!==void 0&&(C=Fm(C,o,a)),d&&(w=WN(w,d,l)),u&&(w=u+w),s&&(C=C+s),S&&(w="-"+w),i=w+(h&&p||"")+C,i},t.prototype.formatNumString=function(i){i===void 0&&(i="");var r=this.props,o=r.format,a=r.allowEmptyFormatting,u=r.customNumerals,s=i;if(u&&u.length===10){var c=new RegExp("["+u.join("")+"]","g");s=i.replace(c,function(l){return u.indexOf(l).toString()})}return i===""&&!a?s="":i==="-"&&!o?s="-":typeof o=="string"?s=this.formatWithPattern(s):typeof o=="function"?s=o(s):s=this.formatAsNumber(s),s},t.prototype.formatValueProp=function(i){var r=this.props,o=r.format,a=r.decimalScale,u=r.fixedDecimalScale,s=r.allowEmptyFormatting,c=this.props,l=c.value,f=c.isNumericString;l=Ip(l)?i:l;var d=!l&&l!==0;if(d&&s&&(l=""),d&&!s)return"";typeof l=="number"&&(l=KN(l),f=!0),l==="Infinity"&&f&&(l=""),f&&!o&&typeof a=="number"&&(l=JN(l,a,u));var p=f?this.formatNumString(l):this.formatInput(l);return p},t.prototype.formatNegation=function(i){i===void 0&&(i="");var r=this.props,o=r.allowNegative,a=new RegExp("(-)"),u=new RegExp("(-)(.)*(-)"),s=a.test(i),c=u.test(i);return i=i.replace(/-/g,""),s&&!c&&o&&(i="-"+i),i},t.prototype.formatInput=function(i){i===void 0&&(i="");var r=this.props,o=r.format;return o||(i=this.removePrefixAndSuffix(i),i=this.formatNegation(i)),i=this.removeFormatting(i),this.formatNumString(i)},t.prototype.isCharacterAFormat=function(i,r){var o=this.props,a=o.format,u=o.prefix,s=o.suffix,c=o.decimalScale,l=o.fixedDecimalScale,f=this.getSeparators(),d=f.decimalSeparator;return!!(typeof a=="string"&&a[i]!=="#"||!a&&(i<u.length||i>=r.length-s.length||c&&l&&r[i]===d))},t.prototype.correctInputValue=function(i,r,o){var a=this,u=this.props,s=u.format,c=u.allowNegative,l=u.prefix,f=u.suffix,d=u.decimalScale,p=this.getSeparators(),h=p.allowedDecimalSeparators,v=p.decimalSeparator,w=this.state.numAsString||"",C=this.selectionBeforeInput,S=C.selectionStart,T=C.selectionEnd,I=YN(r,o),x=I.start,b=I.end;if(!s&&x===b&&h.indexOf(o[S])!==-1){var E=d===0?"":v;return o.substr(0,S)+E+o.substr(S+1,o.length)}var P=s?0:l.length,$=r.length-(s?0:f.length);if(o.length>r.length||!o.length||x===b||S===0&&T===r.length||x===0&&b===r.length||S===P&&T===$)return o;var L=r.substr(x,b-x),R=!![].concat(L).find(function(ae,jt){return a.isCharacterAFormat(jt+x,r)});if(R){var A=r.substr(x),K={},re=[];[].concat(A).forEach(function(ae,jt){a.isCharacterAFormat(jt+x,r)?K[jt]=ae:jt>L.length-1&&re.push(ae)}),Object.keys(K).forEach(function(ae){re.length>ae?re.splice(ae,0,K[ae]):re.push(K[ae])}),o=r.substr(0,x)+re.join("")}if(!s){var ze=this.removeFormatting(o),we=Dl(ze,c),Z=we.beforeDecimal,Q=we.afterDecimal,de=we.addNegation,_t=i<o.indexOf(v)+1;if(ze.length<w.length&&_t&&Z===""&&!parseFloat(Q))return de?"-":""}return o},t.prototype.updateValue=function(i){var r=i.formattedValue,o=i.input,a=i.setCaretPosition;a===void 0&&(a=!0);var u=i.source,s=i.event,c=i.numAsString,l=i.caretPos,f=this.props,d=f.onValueChange,p=this.state,h=p.value;if(o){if(l===void 0&&a){var v=i.inputValue||o.value,w=Ap(o);o.value=r,l=this.getCaretPosition(v,r,w)}o.value=r,a&&this.setPatchedCaretPosition(o,l,r)}c===void 0&&(c=this.removeFormatting(r)),r!==h&&(this.setState({value:r,numAsString:c}),d(this.getValueObject(r,c),{event:s,source:u}))},t.prototype.onChange=function(i){var r=i.target,o=r.value,a=this,u=a.state,s=a.props,c=s.isAllowed,l=u.value||"",f=Ap(r);o=this.correctInputValue(f,l,o);var d=this.formatInput(o)||"",p=this.removeFormatting(d),h=this.getValueObject(d,p),v=c(h);v||(d=l),this.updateValue({formattedValue:d,numAsString:p,inputValue:o,input:r,event:i,source:"event"}),v&&s.onChange(i)},t.prototype.onBlur=function(i){var r=this,o=r.props,a=r.state,u=o.format,s=o.onBlur,c=o.allowLeadingZeros,l=a.numAsString,f=a.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!u){isNaN(parseFloat(l))&&(l=""),c||(l=HN(l));var d=this.formatNumString(l);if(d!==f){this.updateValue({formattedValue:d,numAsString:l,input:i.target,setCaretPosition:!1,event:i,source:"event"}),s(i);return}}s(i)},t.prototype.onKeyDown=function(i){var r=i.target,o=i.key,a=r.selectionStart,u=r.selectionEnd,s=r.value;s===void 0&&(s="");var c,l=this.props,f=l.decimalScale,d=l.fixedDecimalScale,p=l.prefix,h=l.suffix,v=l.format,w=l.onKeyDown,C=f!==void 0&&d,S=this.getNumberRegex(!1,C),T=new RegExp("-"),I=typeof v=="string";if(this.selectionBeforeInput={selectionStart:a,selectionEnd:u},o==="ArrowLeft"||o==="Backspace"?c=a-1:o==="ArrowRight"?c=a+1:o==="Delete"&&(c=a),c===void 0||a!==u){w(i);return}var x=c,b=I?v.indexOf("#"):p.length,E=I?v.lastIndexOf("#")+1:s.length-h.length;if(o==="ArrowLeft"||o==="ArrowRight"){var P=o==="ArrowLeft"?"left":"right";x=this.correctCaretPosition(s,c,P)}else if(o==="Delete"&&!S.test(s[c])&&!T.test(s[c]))for(;!S.test(s[x])&&x<E;)x++;else if(o==="Backspace"&&!S.test(s[c])){if(a<=b+1&&s[0]==="-"&&typeof v>"u"){var $=s.substring(1);this.updateValue({formattedValue:$,caretPos:x,input:r,event:i,source:"event"})}else if(!T.test(s[c])){for(;!S.test(s[x-1])&&x>b;)x--;x=this.correctCaretPosition(s,x,"left")}}(x!==c||c<b||c>E)&&(i.preventDefault(),this.setPatchedCaretPosition(r,x,s)),i.isUnitTestRun&&this.setPatchedCaretPosition(r,x,s),w(i)},t.prototype.onMouseUp=function(i){var r=i.target,o=r.selectionStart,a=r.selectionEnd,u=r.value;if(u===void 0&&(u=""),o===a){var s=this.correctCaretPosition(u,o);s!==o&&this.setPatchedCaretPosition(r,s,u)}this.props.onMouseUp(i)},t.prototype.onFocus=function(i){var r=this;i.persist(),this.focusedElm=i.target,this.focusTimeout=setTimeout(function(){var o=i.target,a=o.selectionStart,u=o.selectionEnd,s=o.value;s===void 0&&(s="");var c=r.correctCaretPosition(s,a);c!==a&&!(a===0&&u===s.length)&&r.setPatchedCaretPosition(o,c,s),r.props.onFocus(i)},0)},t.prototype.render=function(){var i=this.props,r=i.type,o=i.displayType,a=i.customInput,u=i.renderText,s=i.getInputRef,c=i.format;i.thousandSeparator,i.decimalSeparator,i.allowedDecimalSeparators,i.thousandsGroupStyle,i.decimalScale,i.fixedDecimalScale,i.prefix,i.suffix,i.removeFormatting,i.mask,i.defaultValue,i.isNumericString,i.allowNegative,i.allowEmptyFormatting,i.allowLeadingZeros,i.onValueChange,i.isAllowed,i.customNumerals,i.onChange,i.onKeyDown,i.onMouseUp,i.onFocus,i.onBlur,i.value;var l=QN(i,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"]),f=l,d=this.state,p=d.value,h=d.mounted,v=h&&XN(c)?"numeric":void 0,w=Object.assign({inputMode:v},f,{type:r,value:p,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(o==="text")return u?u(p,f)||null:M.createElement("span",Object.assign({},f,{ref:s}),p);if(a){var C=a;return M.createElement(C,Object.assign({},w,{ref:s}))}return M.createElement("input",Object.assign({},w,{ref:s}))},t}(M.Component);Lm.defaultProps=ZN;function eP(e,t,n){var i=this,r=M.useRef(null),o=M.useRef(0),a=M.useRef(null),u=M.useRef([]),s=M.useRef(),c=M.useRef(),l=M.useRef(e),f=M.useRef(!0);M.useEffect(function(){l.current=e},[e]);var d=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var p=!!(n=n||{}).leading,h=!("trailing"in n)||!!n.trailing,v="maxWait"in n,w=v?Math.max(+n.maxWait||0,t):null;M.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var C=M.useMemo(function(){var S=function(P){var $=u.current,L=s.current;return u.current=s.current=null,o.current=P,c.current=l.current.apply(L,$)},T=function(P,$){d&&cancelAnimationFrame(a.current),a.current=d?requestAnimationFrame(P):setTimeout(P,$)},I=function(P){if(!f.current)return!1;var $=P-r.current;return!r.current||$>=t||$<0||v&&P-o.current>=w},x=function(P){return a.current=null,h&&u.current?S(P):(u.current=s.current=null,c.current)},b=function P(){var $=Date.now();if(I($))return x($);if(f.current){var L=t-($-r.current),R=v?Math.min(L,w-($-o.current)):L;T(P,R)}},E=function(){var P=Date.now(),$=I(P);if(u.current=[].slice.call(arguments),s.current=i,r.current=P,$){if(!a.current&&f.current)return o.current=r.current,T(b,t),p?S(r.current):c.current;if(v)return T(b,t),S(r.current)}return a.current||T(b,t),c.current};return E.cancel=function(){a.current&&(d?cancelAnimationFrame(a.current):clearTimeout(a.current)),o.current=0,u.current=r.current=s.current=a.current=null},E.isPending=function(){return!!a.current},E.flush=function(){return a.current?x(Date.now()):c.current},E},[p,v,t,w,h,d]);return C}var Gm=function(){function e(t,n,i){this.r=0,this.g=0,this.b=0,this.set(t,n,i)}return e.prototype.set=function(t,n,i){this.r=this.clamp(t),this.g=this.clamp(n),this.b=this.clamp(i)},e.prototype.hueRotate=function(t){t===void 0&&(t=0),t=t/180*Math.PI;var n=Math.sin(t),i=Math.cos(t);this.multiply([.213+i*.787-n*.213,.715-i*.715-n*.715,.072-i*.072+n*.928,.213-i*.213+n*.143,.715+i*.285+n*.14,.072-i*.072-n*.283,.213-i*.213-n*.787,.715-i*.715+n*.715,.072+i*.928+n*.072])},e.prototype.grayscale=function(t){t===void 0&&(t=1),this.multiply([.2126+.7874*(1-t),.7152-.7152*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152+.2848*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152-.7152*(1-t),.0722+.9278*(1-t)])},e.prototype.sepia=function(t){t===void 0&&(t=1),this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])},e.prototype.saturate=function(t){t===void 0&&(t=1),this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])},e.prototype.multiply=function(t){var n=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),i=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),r=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=n,this.g=i,this.b=r},e.prototype.brightness=function(t){t===void 0&&(t=1),this.linear(t)},e.prototype.contrast=function(t){t===void 0&&(t=1),this.linear(t,-(.5*t)+.5)},e.prototype.linear=function(t,n){t===void 0&&(t=1),n===void 0&&(n=0),this.r=this.clamp(this.r*t+n*255),this.g=this.clamp(this.g*t+n*255),this.b=this.clamp(this.b*t+n*255)},e.prototype.invert=function(t){t===void 0&&(t=1),this.r=this.clamp((t+this.r/255*(1-2*t))*255),this.g=this.clamp((t+this.g/255*(1-2*t))*255),this.b=this.clamp((t+this.b/255*(1-2*t))*255)},e.prototype.hsl=function(){var t=this.r/255,n=this.g/255,i=this.b/255,r=Math.max(t,n,i),o=Math.min(t,n,i),a=0,u=0,s=(r+o)/2;if(r===o)return{h:0,s:0,l:s*100};var c=r-o;return u=s>.5?c/(2-r-o):c/(r+o),r===t?a=(n-i)/c+(n<i?6:0):r===n?a=(i-t)/c+2:r===i&&(a=(t-n)/c+4),a/=6,{h:a*100,s:u*100,l:s*100}},e.prototype.clamp=function(t){return Math.min(Math.max(t,0),255)},e}(),tP=function(){function e(t,n){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},n),this.reusedColor=new Gm(0,0,0)}return e.prototype.solve=function(){var t=this.solveNarrow(this.solveWide());return{values:t.values,called:t.called,loss:t.loss,filter:this.css(t.values)}},e.prototype.solveWide=function(){for(var t=5,n=15,i=[60,180,18e3,600,1.2,1.2],r={loss:1/0},o=0;r.loss>this.options.acceptanceLossPercentage;){var a=[50,20,3750,50,100,100],u=this.spsa({A:t,a:i,c:n,values:a,maxTriesInLoop:1e3});if(u.loss<r.loss&&(r=u),o+=1,o>=this.options.maxChecks)break}return Object.assign({},r,{called:o})},e.prototype.solveNarrow=function(t){var n=t.loss,i=2,r=n+1,o=[.25*r,.25*r,r,.25*r,.2*r,.2*r];return this.spsa({A:n,a:o,c:i,values:t.values,maxTriesInLoop:500,called:t.called})},e.prototype.fixValueByFilterIDX=function(t,n){var i=100;return n===2?i=7500:(n===4||n===5)&&(i=200),n===3?t>i?t%=i:t<0&&(t=i+t%i):t<0?t=0:t>i&&(t=i),t},e.prototype.spsa=function(t){for(var n=t.A,i=t.a,r=t.c,o=t.values,a=t.maxTriesInLoop,u=a===void 0?500:a,s=t.called,c=s===void 0?0:s,l=1,f=.16666666666666666,d=null,p=1/0,h=new Array(6),v=new Array(6),w=new Array(6),C=6,S=0;S<u;S++){for(var T=r/Math.pow(S+1,f),I=0;I<C;I++)h[I]=Math.random()>.5?1:-1,v[I]=o[I]+T*h[I],w[I]=o[I]-T*h[I];for(var x=this.loss(v)-this.loss(w),I=0;I<C;I++){var b=x/(2*T)*h[I],E=i[I]/Math.pow(n+S+1,l);o[I]=this.fixValueByFilterIDX(o[I]-E*b,I)}var P=this.loss(o);P<p&&(d=o.slice(0),p=P)}return{values:d,loss:p,called:c}},e.prototype.loss=function(t){var n=this.reusedColor;n.set(0,0,0),n.invert(t[0]/100),n.sepia(t[1]/100),n.saturate(t[2]/100),n.hueRotate(t[3]*3.6),n.brightness(t[4]/100),n.contrast(t[5]/100);var i=n.hsl();return Math.abs(n.r-this.target.r)+Math.abs(n.g-this.target.g)+Math.abs(n.b-this.target.b)+Math.abs(i.h-this.targetHSL.h)+Math.abs(i.s-this.targetHSL.s)+Math.abs(i.l-this.targetHSL.l)},e.prototype.css=function(t){var n=function(i,r){return r===void 0&&(r=1),Math.round(t[i]*r)};return["invert("+n(0)+"%)","sepia("+n(1)+"%)","saturate("+n(2)+"%)","hue-rotate("+n(3,3.6)+"deg)","brightness("+n(4)+"%)","contrast("+n(5)+"%);"].join(" ")},e}(),nP=function(e){return e.length===4?[parseInt("0x"+e[1]+e[1]),parseInt("0x"+e[2]+e[2]),parseInt("0x"+e[3]+e[3])]:e.length===7?[parseInt("0x"+e[1]+e[2]),parseInt("0x"+e[3]+e[4]),parseInt("0x"+e[5]+e[6])]:[]},pc=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},hc={},iP=function(e,t){var n;t===void 0&&(t={});var i,r,o;if(hc[e]&&!t.forceFilterRecalculation)return Object.assign({},hc[e],{cache:!0});var a;try{if(n=jO(nP(e),3),i=n[0],r=n[1],o=n[2],!pc(i)||!pc(r)||!pc(o))throw new Error("hextToRgb returned an invalid value for '"+e+"'");a=new Gm(Number(i),Number(r),Number(o))}catch(s){throw new Error("Color value should be in HEX format. "+s)}var u=new tP(a,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},t));return hc[e]=Object.assign({},u.solve(),{hex:e,rgb:[i,r,o],cache:!1})};const rP=(e,t,n,i)=>(n|t<<8|e<<16|1<<24).toString(16).slice(1)+i;function oP(e,t,n,i){let r=(e+(i||"")).toString().includes("%");if(typeof e=="string"&&!t){const o=aP(e);if(!o)throw new TypeError("Invalid or unsupported color format.");r=!1,[e,t,n,i]=o}else i!==void 0&&(i=Number.parseFloat(i));if(typeof e!="number"||typeof t!="number"||typeof n!="number"||e>255||t>255||n>255)throw new TypeError("Expected three numbers below 256");if(typeof i=="number"){if(!r&&i>=0&&i<=1)i=Math.round(255*i);else if(r&&i>=0&&i<=100)i=Math.round(255*i/100);else throw new TypeError(`Expected alpha value (${i}) as a fraction or percentage`);i=(i|256).toString(16).slice(1)}else i="";return rP(e,t,n,i)}const aP=e=>{const t=e.replace(/rgba?\(([^)]+)\)/,"$1").split(/[,\s/]+/).filter(Boolean);if(t.length<3)return;const n=(u,s)=>(u=u.trim(),u.endsWith("%")?Math.min(Number.parseFloat(u)*s/100,s):Math.min(Number.parseFloat(u),s)),i=n(t[0],255),r=n(t[1],255),o=n(t[2],255);let a;return t.length===4&&(a=n(t[3],1)),[i,r,o,a]};function sP(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var i=0;i<e.length;i++){var r=e[i];if(typeof r!="string")throw new TypeError("Url must be a string. Received "+r);r!==""&&(i>0&&(r=r.replace(/^[\/]+/,"")),i<e.length-1?r=r.replace(/[\/]+$/,""):r=r.replace(/[\/]+$/,"/"),t.push(r))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function uP(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),sP(e)}function nn(){return F.RenderTarget.current()!==F.RenderTarget.preview}function cP(e){if(nn())return null;const{error:t}=kd();if(!t)return null;switch(t.type){case vt.ConfigurationModelNotFound:return M.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:X.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case vt.ConfigurationUnauthenticated:return M.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:X.jsx("span",{children:"The HCA access token is invalid."});case vt.SpecifiedDeploymentForbidden:return M.Children.toArray(e.accessTokenRestrictionContent).length>0?e.accessTokenRestrictionContent:X.jsx("span",{children:"The HCA access token does not permit using the specified Configuration Model."});default:return M.Children.toArray(e.errorContent).length>0?e.errorContent:X.jsx("span",{children:"An error occurred while initializing the configuration."})}}function Tn(e){return t=>X.jsx(RO,{fallbackRender:()=>X.jsx("span",{children:"Component crashed"}),children:X.jsx(e,{...t})})}const zm=Tn(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:i,sessionCreateUrl:r,sessionDeleteUrl:o,deploymentName:a,channel:u,children:s}=e;if(nn())return s;const c=M.useMemo(()=>VA({hcaEngineBaseUrl:uP(t,"api","engine"),sessionHandler:W(n).with("client-side",()=>({accessToken:i})).with("server-side",()=>({sessionCreateUrl:r,sessionDeleteUrl:o})).exhaustive()}),[t,n,i,r,o]);return X.jsxs(NO,{configuratorClient:c,configurationModelSource:{type:Wi.Channel,channel:u,deploymentName:a},children:[X.jsx(cP,{...e}),X.jsx(M.Suspense,{children:X.jsx(PO,{children:s})})]})}),lP=zm;F.addPropertyControls(zm,{children:{title:"Children",type:F.ControlType.ComponentInstance},channel:{type:F.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:F.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:F.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:F.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:F.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:F.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:F.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:F.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:F.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:F.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:F.ControlType.ComponentInstance}});const Ir={attributeId:{title:"Attribute Id",type:F.ControlType.String},componentPath:{title:"Component Path",type:F.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:F.ControlType.String}},Wm={padding:{type:F.ControlType.FusedNumber,title:"Padding",toggleKey:"isMixedPadding",toggleTitles:["Padding","Padding per Side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:0}},dP=e=>({paddingTop:e.isMixedPadding?e.paddingTop:e.padding,paddingRight:e.isMixedPadding?e.paddingRight:e.padding,paddingBottom:e.isMixedPadding?e.paddingBottom:e.padding,paddingLeft:e.isMixedPadding?e.paddingLeft:e.padding}),fP={radius:{title:"Radius",type:F.ControlType.Number,defaultValue:6},...Wm,border:{title:"Border",type:F.ControlType.Object,controls:{color:{type:F.ControlType.Color,title:"Color"},width:{type:F.ControlType.FusedNumber,title:"Width",toggleKey:"isMixedWidth",toggleTitles:["Width","Width per Side"],valueKeys:["widthTop","widthRight","widthBottom","widthLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:0}}}},pP=e=>{var t,n,i,r,o,a,u,s,c,l,f,d,p;return{borderRadius:e.radius,borderColor:(t=e.border)==null?void 0:t.color,borderTopWidth:(n=e.border)!=null&&n.isMixedWidth?(i=e.border)==null?void 0:i.widthTop:(r=e.border)==null?void 0:r.width,borderRightWidth:(o=e.border)!=null&&o.isMixedWidth?(a=e.border)==null?void 0:a.widthRight:(u=e.border)==null?void 0:u.width,borderBottomWidth:(s=e.border)!=null&&s.isMixedWidth?(c=e.border)==null?void 0:c.widthBottom:(l=e.border)==null?void 0:l.width,borderLeftWidth:(f=e.border)!=null&&f.isMixedWidth?(d=e.border)==null?void 0:d.widthLeft:(p=e.border)==null?void 0:p.width}},hP={fill:{title:"Fill",type:F.ControlType.Color,defaultValue:"#EBEBEB"},...Wm,...fP},vP=e=>({...dP(e),...pP(e),backgroundColor:e.fill}),yP={color:{title:"Color",type:F.ControlType.Color,defaultValue:"black"},fontSize:{title:"Font size",type:F.ControlType.Number,defaultValue:16}},mP=e=>({color:e.color,fontSize:e.fontSize}),Ol={type:F.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:F.ControlType.Color,optional:!0},color:{title:"Color",type:F.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:F.ControlType.Color,optional:!0}}},Hm={...Ir,...yP,...hP,implicitLabelPrefix:{title:"Implicit Label Prefix",type:F.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...Ol,title:"Unsatisfied Colors"},implicitSelectedColors:{...Ol,title:"Implicit Selected Colors"}},Nl=(e,t,n)=>{var i,r,o,a,u,s;const c=vP(e),l=mP(e);return{...c,...l,backgroundColor:W({isSatisfied:t,isImplicitSelected:n,unsatisfiedFill:(i=e.unsatisfiedColors)==null?void 0:i.fill,implicitSelectedFill:(r=e.implicitSelectedColors)==null?void 0:r.fill}).with({isSatisfied:!1,unsatisfiedFill:Ee.string.minLength(1)},f=>f.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:Ee.string.minLength(1)},f=>f.implicitSelectedFill).otherwise(()=>c.backgroundColor),borderColor:W({isSatisfied:t,isImplicitSelected:n,unsatisfiedBorderColor:(o=e.unsatisfiedColors)==null?void 0:o.borderColor,implicitSelectedBorderColor:(a=e.implicitSelectedColors)==null?void 0:a.borderColor}).with({isSatisfied:!1,unsatisfiedBorderColor:Ee.string.minLength(1)},f=>f.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:Ee.string.minLength(1)},f=>f.implicitSelectedBorderColor).otherwise(()=>c.borderColor),color:W({isSatisfied:t,isImplicitSelected:n,unsatisfiedColor:(u=e.unsatisfiedColors)==null?void 0:u.color,implicitSelectedColor:(s=e.implicitSelectedColors)==null?void 0:s.color}).with({isSatisfied:!1,unsatisfiedColor:Ee.string.minLength(1)},f=>f.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:Ee.string.minLength(1)},f=>f.implicitSelectedColor).otherwise(()=>l.color),...e.style}},Gd={...Hm,resetLabel:{title:"Reset Label",type:F.ControlType.String,defaultValue:"Reset"}},co=(e,t,n)=>Nl(e,t,n);function ri(e){var t;return{localId:e.attributeId,componentPath:e.componentPath===""?[]:((t=e.componentPath)==null?void 0:t.split(" -> "))??[],sharedConfigurationModelId:e.sharedConfigurationModel===""?null:e.sharedConfigurationModel}}const Dp=Ua.select`
|
|
977
|
+
`);if(i){var u=i==="string"?i:i.toString();if(u.match(/\d/g))throw new Error(`
|
|
978
|
+
Mask `+i+` should not contain numeric character;
|
|
979
|
+
`)}},t.prototype.setPatchedCaretPosition=function(r,i,o){Eg(r,i),this.caretPositionTimeout=setTimeout(function(){r.value===o&&Eg(r,i)},0)},t.prototype.correctCaretPosition=function(r,i,o){var a=this.props,s=a.prefix,u=a.suffix,c=a.format;if(r==="")return 0;if(i=ed(i,0,r.length),!c){var l=r[0]==="-";return ed(i,s.length+(l?1:0),r.length-u.length)}if(typeof c=="function"||c[i]==="#"&&ls(r[i])||c[i-1]==="#"&&ls(r[i-1]))return i;var f=c.indexOf("#"),d=c.lastIndexOf("#");i=ed(i,f,d+1);for(var p=c.substring(i,c.length).indexOf("#"),h=i,v=i+(p===-1?0:p);h>f&&(c[h]!=="#"||!ls(r[h]));)h-=1;var C=!ls(r[v])||o==="left"&&i!==f||i-h<v-i;return C?ls(r[h])?h+1:h:v},t.prototype.getCaretPosition=function(r,i,o){var a=this.props,s=a.format,u=this.state.value,c=this.getNumberRegex(!0),l=(r.match(c)||[]).join(""),f=(i.match(c)||[]).join(""),d,p;for(d=0,p=0;p<o;p++){var h=r[p]||"",v=i[d]||"";if(!(!h.match(c)&&h!==v)&&!(h==="0"&&v.match(c)&&v!=="0"&&l.length!==f.length)){for(;h!==i[d]&&d<i.length;)d++;d++}}return typeof s=="string"&&!u&&(d=i.length),d=this.correctCaretPosition(i,d),d},t.prototype.removePrefixAndSuffix=function(r){var i=this.props,o=i.format,a=i.prefix,s=i.suffix;if(!o&&r){var u=r[0]==="-";u&&(r=r.substring(1,r.length)),r=a&&r.indexOf(a)===0?r.substring(a.length,r.length):r;var c=r.lastIndexOf(s);r=s&&c!==-1&&c===r.length-s.length?r.substring(0,c):r,u&&(r="-"+r)}return r},t.prototype.removePatternFormatting=function(r){for(var i=this.props,o=i.format,a=o.split("#").filter(function(p){return p!==""}),s=0,u="",c=0,l=a.length;c<=l;c++){var f=a[c]||"",d=c===l?r.length:r.indexOf(f,s);if(d===-1){u=r;break}else u+=r.substring(s,d),s=d+f.length}return(u.match(this.getNumberRegex(!0))||[]).join("")},t.prototype.removeFormatting=function(r){var i=this.props,o=i.format,a=i.removeFormatting;return r&&(o?typeof o=="string"?r=this.removePatternFormatting(r):typeof a=="function"?r=a(r):r=(r.match(this.getNumberRegex(!0))||[]).join(""):(r=this.removePrefixAndSuffix(r),r=this.getFloatString(r)),r)},t.prototype.formatWithPattern=function(r){for(var i=this.props,o=i.format,a=0,s=o.split(""),u=0,c=o.length;u<c;u++)o[u]==="#"&&(s[u]=r[a]||this.getMaskAtIndex(a),a+=1);return s.join("")},t.prototype.formatAsNumber=function(r){var i=this.props,o=i.decimalScale,a=i.fixedDecimalScale,s=i.prefix,u=i.suffix,c=i.allowNegative,l=i.thousandsGroupStyle,f=this.getSeparators(),d=f.thousandSeparator,p=f.decimalSeparator,h=r.indexOf(".")!==-1||o&&a,v=Up(r,c),C=v.beforeDecimal,E=v.afterDecimal,y=v.addNegation;return o!==void 0&&(E=px(E,o,a)),d&&(C=L5(C,d,l)),s&&(C=s+C),u&&(E=E+u),y&&(C="-"+C),r=C+(h&&p||"")+E,r},t.prototype.formatNumString=function(r){r===void 0&&(r="");var i=this.props,o=i.format,a=i.allowEmptyFormatting,s=i.customNumerals,u=r;if(s&&s.length===10){var c=new RegExp("["+s.join("")+"]","g");u=r.replace(c,function(l){return s.indexOf(l).toString()})}return r===""&&!a?u="":r==="-"&&!o?u="-":typeof o=="string"?u=this.formatWithPattern(u):typeof o=="function"?u=o(u):u=this.formatAsNumber(u),u},t.prototype.formatValueProp=function(r){var i=this.props,o=i.format,a=i.decimalScale,s=i.fixedDecimalScale,u=i.allowEmptyFormatting,c=this.props,l=c.value,f=c.isNumericString;l=wg(l)?r:l;var d=!l&&l!==0;if(d&&u&&(l=""),d&&!u)return"";typeof l=="number"&&(l=V5(l),f=!0),l==="Infinity"&&f&&(l=""),f&&!o&&typeof a=="number"&&(l=U5(l,a,s));var p=f?this.formatNumString(l):this.formatInput(l);return p},t.prototype.formatNegation=function(r){r===void 0&&(r="");var i=this.props,o=i.allowNegative,a=new RegExp("(-)"),s=new RegExp("(-)(.)*(-)"),u=a.test(r),c=s.test(r);return r=r.replace(/-/g,""),u&&!c&&o&&(r="-"+r),r},t.prototype.formatInput=function(r){r===void 0&&(r="");var i=this.props,o=i.format;return o||(r=this.removePrefixAndSuffix(r),r=this.formatNegation(r)),r=this.removeFormatting(r),this.formatNumString(r)},t.prototype.isCharacterAFormat=function(r,i){var o=this.props,a=o.format,s=o.prefix,u=o.suffix,c=o.decimalScale,l=o.fixedDecimalScale,f=this.getSeparators(),d=f.decimalSeparator;return!!(typeof a=="string"&&a[r]!=="#"||!a&&(r<s.length||r>=i.length-u.length||c&&l&&i[r]===d))},t.prototype.correctInputValue=function(r,i,o){var a=this,s=this.props,u=s.format,c=s.allowNegative,l=s.prefix,f=s.suffix,d=s.decimalScale,p=this.getSeparators(),h=p.allowedDecimalSeparators,v=p.decimalSeparator,C=this.state.numAsString||"",E=this.selectionBeforeInput,y=E.selectionStart,w=E.selectionEnd,x=G5(i,o),S=x.start,T=x.end;if(!u&&S===T&&h.indexOf(o[y])!==-1){var A=d===0?"":v;return o.substr(0,y)+A+o.substr(y+1,o.length)}var D=u?0:l.length,I=i.length-(u?0:f.length);if(o.length>i.length||!o.length||S===T||y===0&&w===i.length||S===0&&T===i.length||y===D&&w===I)return o;var N=i.substr(S,T-S),j=!![].concat(N).find(function(P,te){return a.isCharacterAFormat(te+S,i)});if(j){var L=i.substr(S),V={},H=[];[].concat(L).forEach(function(P,te){a.isCharacterAFormat(te+S,i)?V[te]=P:te>N.length-1&&H.push(P)}),Object.keys(V).forEach(function(P){H.length>P?H.splice(P,0,V[P]):H.push(V[P])}),o=i.substr(0,S)+H.join("")}if(!u){var R=this.removeFormatting(o),ie=Up(R,c),B=ie.beforeDecimal,U=ie.afterDecimal,fe=ie.addNegation,M=r<o.indexOf(v)+1;if(R.length<C.length&&M&&B===""&&!parseFloat(U))return fe?"-":""}return o},t.prototype.updateValue=function(r){var i=r.formattedValue,o=r.input,a=r.setCaretPosition;a===void 0&&(a=!0);var s=r.source,u=r.event,c=r.numAsString,l=r.caretPos,f=this.props,d=f.onValueChange,p=this.state,h=p.value;if(o){if(l===void 0&&a){var v=r.inputValue||o.value,C=Tg(o);o.value=i,l=this.getCaretPosition(v,i,C)}o.value=i,a&&this.setPatchedCaretPosition(o,l,i)}c===void 0&&(c=this.removeFormatting(i)),i!==h&&(this.setState({value:i,numAsString:c}),d(this.getValueObject(i,c),{event:u,source:s}))},t.prototype.onChange=function(r){var i=r.target,o=i.value,a=this,s=a.state,u=a.props,c=u.isAllowed,l=s.value||"",f=Tg(i);o=this.correctInputValue(f,l,o);var d=this.formatInput(o)||"",p=this.removeFormatting(d),h=this.getValueObject(d,p),v=c(h);v||(d=l),this.updateValue({formattedValue:d,numAsString:p,inputValue:o,input:i,event:r,source:"event"}),v&&u.onChange(r)},t.prototype.onBlur=function(r){var i=this,o=i.props,a=i.state,s=o.format,u=o.onBlur,c=o.allowLeadingZeros,l=a.numAsString,f=a.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!s){isNaN(parseFloat(l))&&(l=""),c||(l=B5(l));var d=this.formatNumString(l);if(d!==f){this.updateValue({formattedValue:d,numAsString:l,input:r.target,setCaretPosition:!1,event:r,source:"event"}),u(r);return}}u(r)},t.prototype.onKeyDown=function(r){var i=r.target,o=r.key,a=i.selectionStart,s=i.selectionEnd,u=i.value;u===void 0&&(u="");var c,l=this.props,f=l.decimalScale,d=l.fixedDecimalScale,p=l.prefix,h=l.suffix,v=l.format,C=l.onKeyDown,E=f!==void 0&&d,y=this.getNumberRegex(!1,E),w=new RegExp("-"),x=typeof v=="string";if(this.selectionBeforeInput={selectionStart:a,selectionEnd:s},o==="ArrowLeft"||o==="Backspace"?c=a-1:o==="ArrowRight"?c=a+1:o==="Delete"&&(c=a),c===void 0||a!==s){C(r);return}var S=c,T=x?v.indexOf("#"):p.length,A=x?v.lastIndexOf("#")+1:u.length-h.length;if(o==="ArrowLeft"||o==="ArrowRight"){var D=o==="ArrowLeft"?"left":"right";S=this.correctCaretPosition(u,c,D)}else if(o==="Delete"&&!y.test(u[c])&&!w.test(u[c]))for(;!y.test(u[S])&&S<A;)S++;else if(o==="Backspace"&&!y.test(u[c])){if(a<=T+1&&u[0]==="-"&&typeof v>"u"){var I=u.substring(1);this.updateValue({formattedValue:I,caretPos:S,input:i,event:r,source:"event"})}else if(!w.test(u[c])){for(;!y.test(u[S-1])&&S>T;)S--;S=this.correctCaretPosition(u,S,"left")}}(S!==c||c<T||c>A)&&(r.preventDefault(),this.setPatchedCaretPosition(i,S,u)),r.isUnitTestRun&&this.setPatchedCaretPosition(i,S,u),C(r)},t.prototype.onMouseUp=function(r){var i=r.target,o=i.selectionStart,a=i.selectionEnd,s=i.value;if(s===void 0&&(s=""),o===a){var u=this.correctCaretPosition(s,o);u!==o&&this.setPatchedCaretPosition(i,u,s)}this.props.onMouseUp(r)},t.prototype.onFocus=function(r){var i=this;r.persist(),this.focusedElm=r.target,this.focusTimeout=setTimeout(function(){var o=r.target,a=o.selectionStart,s=o.selectionEnd,u=o.value;u===void 0&&(u="");var c=i.correctCaretPosition(u,a);c!==a&&!(a===0&&s===u.length)&&i.setPatchedCaretPosition(o,c,u),i.props.onFocus(r)},0)},t.prototype.render=function(){var r=this.props,i=r.type,o=r.displayType,a=r.customInput,s=r.renderText,u=r.getInputRef,c=r.format;r.thousandSeparator,r.decimalSeparator,r.allowedDecimalSeparators,r.thousandsGroupStyle,r.decimalScale,r.fixedDecimalScale,r.prefix,r.suffix,r.removeFormatting,r.mask,r.defaultValue,r.isNumericString,r.allowNegative,r.allowEmptyFormatting,r.allowLeadingZeros,r.onValueChange,r.isAllowed,r.customNumerals,r.onChange,r.onKeyDown,r.onMouseUp,r.onFocus,r.onBlur,r.value;var l=W5(r,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"]),f=l,d=this.state,p=d.value,h=d.mounted,v=h&&z5(c)?"numeric":void 0,C=Object.assign({inputMode:v},f,{type:i,value:p,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(o==="text")return s?s(p,f)||null:O.createElement("span",Object.assign({},f,{ref:u}),p);if(a){var E=a;return O.createElement(E,Object.assign({},C,{ref:u}))}return O.createElement("input",Object.assign({},C,{ref:u}))},t}(O.Component);hx.defaultProps=H5;function K5(e,t,n){var r=this,i=O.useRef(null),o=O.useRef(0),a=O.useRef(null),s=O.useRef([]),u=O.useRef(),c=O.useRef(),l=O.useRef(e),f=O.useRef(!0);O.useEffect(function(){l.current=e},[e]);var d=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var p=!!(n=n||{}).leading,h=!("trailing"in n)||!!n.trailing,v="maxWait"in n,C=v?Math.max(+n.maxWait||0,t):null;O.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var E=O.useMemo(function(){var y=function(D){var I=s.current,N=u.current;return s.current=u.current=null,o.current=D,c.current=l.current.apply(N,I)},w=function(D,I){d&&cancelAnimationFrame(a.current),a.current=d?requestAnimationFrame(D):setTimeout(D,I)},x=function(D){if(!f.current)return!1;var I=D-i.current;return!i.current||I>=t||I<0||v&&D-o.current>=C},S=function(D){return a.current=null,h&&s.current?y(D):(s.current=u.current=null,c.current)},T=function D(){var I=Date.now();if(x(I))return S(I);if(f.current){var N=t-(I-i.current),j=v?Math.min(N,C-(I-o.current)):N;w(D,j)}},A=function(){var D=Date.now(),I=x(D);if(s.current=[].slice.call(arguments),u.current=r,i.current=D,I){if(!a.current&&f.current)return o.current=i.current,w(T,t),p?y(i.current):c.current;if(v)return w(T,t),y(i.current)}return a.current||w(T,t),c.current};return A.cancel=function(){a.current&&(d?cancelAnimationFrame(a.current):clearTimeout(a.current)),o.current=0,s.current=i.current=u.current=a.current=null},A.isPending=function(){return!!a.current},A.flush=function(){return a.current?S(Date.now()):c.current},A},[p,v,t,C,h,d]);return E}var vx=function(){function e(t,n,r){this.r=0,this.g=0,this.b=0,this.set(t,n,r)}return e.prototype.set=function(t,n,r){this.r=this.clamp(t),this.g=this.clamp(n),this.b=this.clamp(r)},e.prototype.hueRotate=function(t){t===void 0&&(t=0),t=t/180*Math.PI;var n=Math.sin(t),r=Math.cos(t);this.multiply([.213+r*.787-n*.213,.715-r*.715-n*.715,.072-r*.072+n*.928,.213-r*.213+n*.143,.715+r*.285+n*.14,.072-r*.072-n*.283,.213-r*.213-n*.787,.715-r*.715+n*.715,.072+r*.928+n*.072])},e.prototype.grayscale=function(t){t===void 0&&(t=1),this.multiply([.2126+.7874*(1-t),.7152-.7152*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152+.2848*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152-.7152*(1-t),.0722+.9278*(1-t)])},e.prototype.sepia=function(t){t===void 0&&(t=1),this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])},e.prototype.saturate=function(t){t===void 0&&(t=1),this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])},e.prototype.multiply=function(t){var n=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),r=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),i=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=n,this.g=r,this.b=i},e.prototype.brightness=function(t){t===void 0&&(t=1),this.linear(t)},e.prototype.contrast=function(t){t===void 0&&(t=1),this.linear(t,-(.5*t)+.5)},e.prototype.linear=function(t,n){t===void 0&&(t=1),n===void 0&&(n=0),this.r=this.clamp(this.r*t+n*255),this.g=this.clamp(this.g*t+n*255),this.b=this.clamp(this.b*t+n*255)},e.prototype.invert=function(t){t===void 0&&(t=1),this.r=this.clamp((t+this.r/255*(1-2*t))*255),this.g=this.clamp((t+this.g/255*(1-2*t))*255),this.b=this.clamp((t+this.b/255*(1-2*t))*255)},e.prototype.hsl=function(){var t=this.r/255,n=this.g/255,r=this.b/255,i=Math.max(t,n,r),o=Math.min(t,n,r),a=0,s=0,u=(i+o)/2;if(i===o)return{h:0,s:0,l:u*100};var c=i-o;return s=u>.5?c/(2-i-o):c/(i+o),i===t?a=(n-r)/c+(n<r?6:0):i===n?a=(r-t)/c+2:i===r&&(a=(t-n)/c+4),a/=6,{h:a*100,s:s*100,l:u*100}},e.prototype.clamp=function(t){return Math.min(Math.max(t,0),255)},e}(),Y5=function(){function e(t,n){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},n),this.reusedColor=new vx(0,0,0)}return e.prototype.solve=function(){var t=this.solveNarrow(this.solveWide());return{values:t.values,called:t.called,loss:t.loss,filter:this.css(t.values)}},e.prototype.solveWide=function(){for(var t=5,n=15,r=[60,180,18e3,600,1.2,1.2],i={loss:1/0},o=0;i.loss>this.options.acceptanceLossPercentage;){var a=[50,20,3750,50,100,100],s=this.spsa({A:t,a:r,c:n,values:a,maxTriesInLoop:1e3});if(s.loss<i.loss&&(i=s),o+=1,o>=this.options.maxChecks)break}return Object.assign({},i,{called:o})},e.prototype.solveNarrow=function(t){var n=t.loss,r=2,i=n+1,o=[.25*i,.25*i,i,.25*i,.2*i,.2*i];return this.spsa({A:n,a:o,c:r,values:t.values,maxTriesInLoop:500,called:t.called})},e.prototype.fixValueByFilterIDX=function(t,n){var r=100;return n===2?r=7500:(n===4||n===5)&&(r=200),n===3?t>r?t%=r:t<0&&(t=r+t%r):t<0?t=0:t>r&&(t=r),t},e.prototype.spsa=function(t){for(var n=t.A,r=t.a,i=t.c,o=t.values,a=t.maxTriesInLoop,s=a===void 0?500:a,u=t.called,c=u===void 0?0:u,l=1,f=.16666666666666666,d=null,p=1/0,h=new Array(6),v=new Array(6),C=new Array(6),E=6,y=0;y<s;y++){for(var w=i/Math.pow(y+1,f),x=0;x<E;x++)h[x]=Math.random()>.5?1:-1,v[x]=o[x]+w*h[x],C[x]=o[x]-w*h[x];for(var S=this.loss(v)-this.loss(C),x=0;x<E;x++){var T=S/(2*w)*h[x],A=r[x]/Math.pow(n+y+1,l);o[x]=this.fixValueByFilterIDX(o[x]-A*T,x)}var D=this.loss(o);D<p&&(d=o.slice(0),p=D)}return{values:d,loss:p,called:c}},e.prototype.loss=function(t){var n=this.reusedColor;n.set(0,0,0),n.invert(t[0]/100),n.sepia(t[1]/100),n.saturate(t[2]/100),n.hueRotate(t[3]*3.6),n.brightness(t[4]/100),n.contrast(t[5]/100);var r=n.hsl();return Math.abs(n.r-this.target.r)+Math.abs(n.g-this.target.g)+Math.abs(n.b-this.target.b)+Math.abs(r.h-this.targetHSL.h)+Math.abs(r.s-this.targetHSL.s)+Math.abs(r.l-this.targetHSL.l)},e.prototype.css=function(t){var n=function(r,i){return i===void 0&&(i=1),Math.round(t[r]*i)};return["invert("+n(0)+"%)","sepia("+n(1)+"%)","saturate("+n(2)+"%)","hue-rotate("+n(3,3.6)+"deg)","brightness("+n(4)+"%)","contrast("+n(5)+"%);"].join(" ")},e}(),X5=function(e){return e.length===4?[parseInt("0x"+e[1]+e[1]),parseInt("0x"+e[2]+e[2]),parseInt("0x"+e[3]+e[3])]:e.length===7?[parseInt("0x"+e[1]+e[2]),parseInt("0x"+e[3]+e[4]),parseInt("0x"+e[5]+e[6])]:[]},td=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},nd={},J5=function(e,t){var n;t===void 0&&(t={});var r,i,o;if(nd[e]&&!t.forceFilterRecalculation)return Object.assign({},nd[e],{cache:!0});var a;try{if(n=Aq(X5(e),3),r=n[0],i=n[1],o=n[2],!td(r)||!td(i)||!td(o))throw new Error("hextToRgb returned an invalid value for '"+e+"'");a=new vx(Number(r),Number(i),Number(o))}catch(u){throw new Error("Color value should be in HEX format. "+u)}var s=new Y5(a,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},t));return nd[e]=Object.assign({},s.solve(),{hex:e,rgb:[r,i,o],cache:!1})};const Q5=(e,t,n,r)=>(n|t<<8|e<<16|1<<24).toString(16).slice(1)+r;function Z5(e,t,n,r){let i=(e+(r||"")).toString().includes("%");if(typeof e=="string"&&!t){const o=e3(e);if(!o)throw new TypeError("Invalid or unsupported color format.");i=!1,[e,t,n,r]=o}else r!==void 0&&(r=Number.parseFloat(r));if(typeof e!="number"||typeof t!="number"||typeof n!="number"||e>255||t>255||n>255)throw new TypeError("Expected three numbers below 256");if(typeof r=="number"){if(!i&&r>=0&&r<=1)r=Math.round(255*r);else if(i&&r>=0&&r<=100)r=Math.round(255*r/100);else throw new TypeError(`Expected alpha value (${r}) as a fraction or percentage`);r=(r|256).toString(16).slice(1)}else r="";return Q5(e,t,n,r)}const e3=e=>{const t=e.replace(/rgba?\(([^)]+)\)/,"$1").split(/[,\s/]+/).filter(Boolean);if(t.length<3)return;const n=(s,u)=>(s=s.trim(),s.endsWith("%")?Math.min(Number.parseFloat(s)*u/100,u):Math.min(Number.parseFloat(s),u)),r=n(t[0],255),i=n(t[1],255),o=n(t[2],255);let a;return t.length===4&&(a=n(t[3],1)),[r,i,o,a]};function t3(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<e.length;r++){var i=e[r];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(r>0&&(i=i.replace(/^[\/]+/,"")),r<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function n3(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),t3(e)}function Dn(){return q.RenderTarget.current()!==q.RenderTarget.preview}function r3(e){if(Dn())return null;const{error:t}=dv();if(!t)return null;switch(t.type){case St.ConfigurationModelNotFound:return O.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:$.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case St.ConfigurationUnauthenticated:return O.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:$.jsx("span",{children:"The HCA access token is invalid."});case St.SpecifiedDeploymentForbidden:return O.Children.toArray(e.accessTokenRestrictionContent).length>0?e.accessTokenRestrictionContent:$.jsx("span",{children:"The HCA access token does not permit using the specified Configuration Model."});default:return O.Children.toArray(e.errorContent).length>0?e.errorContent:$.jsx("span",{children:"An error occurred while initializing the configuration."})}}function Za(e){return O.forwardRef((t,n)=>$.jsx(Tq,{fallbackRender:()=>$.jsx("span",{children:"Component crashed"}),children:$.jsx(e,{...t,ref:n})}))}const i3=gf`
|
|
980
|
+
:root {
|
|
981
|
+
--font-primary: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
982
|
+
--font-heading: "Inter-Medium", "Inter", "Inter Placeholder", sans-serif;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
/* font sizes */
|
|
986
|
+
:root {
|
|
987
|
+
--text-base-size: calc(var(--framer-font-size, 16px) * var(--framer-font-size-scale, 1));
|
|
988
|
+
--text-scale-ratio: 1.2;
|
|
989
|
+
|
|
990
|
+
--text-xs: calc(1em / (var(--text-scale-ratio) * var(--text-scale-ratio)));
|
|
991
|
+
--text-sm: calc(1em / var(--text-scale-ratio));
|
|
992
|
+
--text-md: calc(1em * var(--text-scale-ratio));
|
|
993
|
+
--text-lg: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
994
|
+
--text-xl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
995
|
+
--text-xxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
996
|
+
--text-xxxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
997
|
+
}
|
|
998
|
+
`,o3=i3,a3=gf`
|
|
999
|
+
:root {
|
|
1000
|
+
--space-unit: 1em;
|
|
1001
|
+
--space-xxs: calc(0.25 * var(--space-unit));
|
|
1002
|
+
--space-xs: calc(0.5 * var(--space-unit));
|
|
1003
|
+
--space-sm: calc(0.75 * var(--space-unit));
|
|
1004
|
+
--space-md: calc(1.25 * var(--space-unit));
|
|
1005
|
+
--space-lg: calc(2 * var(--space-unit));
|
|
1006
|
+
--space-xl: calc(3.25 * var(--space-unit));
|
|
1007
|
+
--space-xxl: calc(5.25 * var(--space-unit));
|
|
1008
|
+
|
|
1009
|
+
--space-unit-fixed: var(--text-base-size);
|
|
1010
|
+
--space-xxs-fixed: calc(0.25 * var(--space-unit-fixed));
|
|
1011
|
+
--space-xs-fixed: calc(0.5 * var(--space-unit-fixed));
|
|
1012
|
+
--space-sm-fixed: calc(0.75 * var(--space-unit-fixed));
|
|
1013
|
+
--space-md-fixed: calc(1.25 * var(--space-unit-fixed));
|
|
1014
|
+
--space-lg-fixed: calc(2 * var(--space-unit-fixed));
|
|
1015
|
+
--space-xl-fixed: calc(3.25 * var(--space-unit-fixed));
|
|
1016
|
+
--space-xxl-fixed: calc(5.25 * var(--space-unit-fixed));
|
|
1017
|
+
}
|
|
1018
|
+
`,s3=a3,u3=gf`
|
|
1019
|
+
:root {
|
|
1020
|
+
--shape-border-radius-xs: 5px;
|
|
1021
|
+
--shape-border-radius-sm: 7px;
|
|
1022
|
+
--shape-border-radius-md: 12px;
|
|
1023
|
+
--shape-border-radius-lg: 20px;
|
|
1024
|
+
}
|
|
1025
|
+
`,c3=u3,l3=gf`
|
|
1026
|
+
:root {
|
|
1027
|
+
--shadows-popover: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4));
|
|
1028
|
+
--shadows-dialog: 0.2px 0.4px 2.3px rgba(0, 0, 0, 0.02),
|
|
1029
|
+
0.6px 1px 5.7px rgba(0, 0, 0, 0.025),
|
|
1030
|
+
1.2px 2.1px 10.6px rgba(0, 0, 0, 0.03),
|
|
1031
|
+
2.3px 4px 17.2px rgba(0, 0, 0, 0.034),
|
|
1032
|
+
4.2px 7.2px 25.9px rgba(0, 0, 0, 0.04),
|
|
1033
|
+
7.6px 12.8px 37.7px rgba(0, 0, 0, 0.048),
|
|
1034
|
+
13.9px 23.6px 54.7px rgba(0, 0, 0, 0.061),
|
|
1035
|
+
40px 68px 96px rgba(0, 0, 0, 0.1);
|
|
1036
|
+
}
|
|
1037
|
+
`,f3=l3;function d3(){return $.jsxs($.Fragment,{children:[$.jsx(f3,{}),$.jsx(c3,{}),$.jsx(s3,{}),$.jsx(o3,{})]})}const ru=O.createContext(null);function zi(){const{process:e,switchMode:t,applySolution:n,dismiss:r}=O.useContext(ru);return e?{...e,switchMode:t,applySolution:n,dismiss:r}:null}function mx(e){const{explanation:t,...n}=e,r=zi();return $.jsx("button",{...n,onClick:()=>r.applySolution(t.solution),children:e.children})}const p3=Ae.div`
|
|
1038
|
+
display: flex;
|
|
1039
|
+
gap: var(--space-xs);
|
|
1040
|
+
align-items: center;
|
|
1041
|
+
background-color: var(--color-explain-attribute-value-fill);
|
|
1042
|
+
border-radius: 360px;
|
|
1043
|
+
padding-right: var(--space-sm);
|
|
1044
|
+
font-size: 0.9em;
|
|
1045
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1046
|
+
font-weight: 500;
|
|
1047
|
+
min-width: 0;
|
|
1048
|
+
`,h3=Ae.div`
|
|
1049
|
+
display: grid;
|
|
1050
|
+
place-content: center;
|
|
1051
|
+
border-top-left-radius: 360px;
|
|
1052
|
+
border-bottom-left-radius: 360px;
|
|
1053
|
+
height: 1.5em;
|
|
1054
|
+
width: 1.5em;
|
|
1055
|
+
flex-shrink: 0;
|
|
1056
|
+
|
|
1057
|
+
&.mode-add {
|
|
1058
|
+
background-color: var(--color-explain-attribute-value-add-fill);
|
|
1059
|
+
color: var(--color-explain-attribute-value-add-color);
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
&.mode-remove {
|
|
1063
|
+
background-color: var(--color-explain-attribute-value-remove-fill);
|
|
1064
|
+
color: var(--color-explain-attribute-value-remove-color);
|
|
1065
|
+
}
|
|
1066
|
+
`,v3=Ae.div`
|
|
1067
|
+
white-space: nowrap;
|
|
1068
|
+
overflow: hidden;
|
|
1069
|
+
text-overflow: ellipsis;
|
|
1070
|
+
`;function m3(e){const{decision:t}=e,n=t.intention,r=y3(t);return $.jsxs(p3,{children:[$.jsxs(h3,{className:`mode-${n}`,children:[n==="remove"&&$.jsx(Fi,{icon:PF}),n==="add"&&$.jsx(Fi,{icon:RF})]}),$.jsx(v3,{children:r})]})}function y3(e){return Y(e).returnType().with({type:W.Choice},t=>t.choiceValueId).with({type:W.Boolean},t=>t.state.toString()).with({type:W.Component},t=>t.state).with({type:W.Numeric},t=>t.state.toString()).exhaustive()}const g3=Ae.div`
|
|
1071
|
+
display: grid;
|
|
1072
|
+
grid-template-columns: subgrid;
|
|
1073
|
+
grid-column: span 2;
|
|
1074
|
+
align-items: center;
|
|
1075
|
+
`,b3=Ae.div`
|
|
1076
|
+
grid-area: name;
|
|
1077
|
+
white-space: nowrap;
|
|
1078
|
+
overflow: hidden;
|
|
1079
|
+
text-overflow: ellipsis;
|
|
1080
|
+
`,S3=Ae.div`
|
|
1081
|
+
grid-area: values;
|
|
1082
|
+
display: flex;
|
|
1083
|
+
flex-wrap: wrap;
|
|
1084
|
+
min-width: 0;
|
|
1085
|
+
gap: var(--space-xxs);
|
|
1086
|
+
`;function w3(e){const{decisions:t}=e,n=t[0].attributeId;return $.jsxs(g3,{children:[$.jsx(b3,{children:n.localId}),$.jsx(S3,{children:t.map(r=>$.jsx(m3,{decision:r}))})]})}function C3(e){const t=e.sharedConfigurationModelId&&`shared::${e.sharedConfigurationModelId}`,n=(e.componentPath??[]).join("::");return[t,n,e.localId].filter(r=>(r==null?void 0:r.length)>0).join("::")}function yx(e){const{blockingDecisions:t,desiredDecisions:n,...r}=e,i=b([...n.map(o=>({...o,intention:"add"})),...t.map(o=>({...o,intention:"remove"}))],Aw(o=>C3(o.attributeId)),Hh(uR)((o,a)=>a));return $.jsx("div",{...r,children:i.map(o=>$.jsx(w3,{decisions:o}))})}const x3=Ae.div`
|
|
1087
|
+
background-color: var(--color-explain-dialog-explanation-card);
|
|
1088
|
+
padding: var(--space-sm-fixed);
|
|
1089
|
+
box-shadow: 2px 1px 10px -5px rgba(0, 0, 0, 0.4);
|
|
1090
|
+
border-radius: var(--shape-border-radius-sm);
|
|
1091
|
+
`,gx=x3,E3=Ae(yx)`
|
|
1092
|
+
display: grid;
|
|
1093
|
+
grid-template-columns: [name] minmax(150px, auto) [values] minmax(0px, 1fr);
|
|
1094
|
+
gap: var(--space-sm);
|
|
1095
|
+
`,T3=Ae(mx)`
|
|
1096
|
+
border-radius: var(--shape-border-radius-sm);
|
|
1097
|
+
background-color: var(--color-explain-dialog-apply-solution-button-fill);
|
|
1098
|
+
color: var(--color-explain-dialog-apply-solution-button-color);
|
|
1099
|
+
font-size: 0.9em;
|
|
1100
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1101
|
+
font-weight: 600;
|
|
1102
|
+
appearance: none;
|
|
1103
|
+
padding: 0.6em 1em;
|
|
1104
|
+
border: none;
|
|
1105
|
+
width: auto;
|
|
1106
|
+
margin-top: var(--space-md);
|
|
1107
|
+
|
|
1108
|
+
&:focus {
|
|
1109
|
+
outline: 2px solid var(--color-explain-dialog-apply-solution-button-outline);
|
|
1110
|
+
outline-offset: 1px;
|
|
1111
|
+
}
|
|
1112
|
+
`;function I3(e){const{explanation:t}=e,n=t.solution.decisions.filter(r=>r.state!=null);return $.jsxs(gx,{children:[$.jsx(E3,{blockingDecisions:t.causedByDecisions,desiredDecisions:n}),$.jsx(T3,{explanation:t,children:"Apply solution"})]})}const A3=Ae(gx)`
|
|
1113
|
+
ul {
|
|
1114
|
+
margin: 0;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
line-height: 1.5em;
|
|
1118
|
+
`,$3=Ae.ul`
|
|
1119
|
+
list-style-type: none;
|
|
1120
|
+
margin-inline-start: 0;
|
|
1121
|
+
padding-inline-start: 0;
|
|
1122
|
+
`,Ig=Ae.ul`
|
|
1123
|
+
list-style-type: disc;
|
|
1124
|
+
margin-inline-start: 0;
|
|
1125
|
+
padding-inline-start: var(--space-lg);
|
|
1126
|
+
`,Ag=Ae.li`
|
|
1127
|
+
font-size: 0.9em;
|
|
1128
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1129
|
+
font-weight: 500;
|
|
1130
|
+
`;function O3(e){const{explanation:t}=e,n=t.causedByCardinalities,r=b(t.causedByRules,Aw(i=>i.configurationModelId),Hh(Hd)((i,o)=>({configurationModelId:i,rules:b(o,z(a=>a.localId),iP(Hd))})));return $.jsx(A3,{children:$.jsxs($3,{children:[r.map(i=>$.jsxs("li",{children:[$.jsx("span",{children:i.configurationModelId}),$.jsx(Ig,{children:i.rules.map(o=>$.jsx(Ag,{children:o}))})]})),n.length>0&&$.jsxs("li",{children:[$.jsx("span",{children:"Cardinality"}),$.jsx(Ig,{children:n.map(i=>$.jsx(Ag,{children:i.localId}))})]})]})})}function bx(e){const{variant:t,...n}=e,{explainQuestion:r}=zi(),i=Y(r).returnType().with({question:Lt.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:Lt.whyIsNotSatisfied,subject:et.configuration},()=>"why your configuration is not satisfied").with({question:Lt.whyIsNotSatisfied,subject:et.attribute},()=>"why your attribute is not satisfied").exhaustive(),o=Y(t).returnType().with("failedToExplain",()=>$.jsxs($.Fragment,{children:["Failed to explain ",i,".",$.jsx("br",{}),"Please check your internet connection and try again."]})).with("noExplanationFound",()=>$.jsxs($.Fragment,{children:["There was no explanation found for ",i,"."]})).with("noSolutionFound",()=>$.jsxs($.Fragment,{children:["There was no solution found for ",i,"."]})).exhaustive();return $.jsx("div",{...n,children:o})}const $g=Ae.div`
|
|
1131
|
+
font-weight: 500;
|
|
1132
|
+
font-family: var(--font-heading);
|
|
1133
|
+
margin-bottom: var(--space-xs);
|
|
1134
|
+
margin-left: var(--space-sm-fixed);
|
|
1135
|
+
`,Og=Ae.div`
|
|
1136
|
+
display: flex;
|
|
1137
|
+
flex-direction: column;
|
|
1138
|
+
gap: var(--space-xs);
|
|
1139
|
+
`,D3=Ae.div`
|
|
1140
|
+
display: flex;
|
|
1141
|
+
flex-direction: column;
|
|
1142
|
+
gap: var(--space-md);
|
|
1143
|
+
`,Dg=Ae(bx)`
|
|
1144
|
+
width: min-content;
|
|
1145
|
+
min-width: 400px;
|
|
1146
|
+
margin: var(--space-sm-fixed) var(--space-md-fixed) var(--space-sm-fixed) var(--space-sm-fixed);
|
|
1147
|
+
`;function N3(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=zi();return n?$.jsx(Dg,{variant:"failedToExplain"}):e.length===0&&t.length===0?$.jsx(Dg,{variant:"noExplanationFound"}):$.jsxs(D3,{children:[e.length>0&&$.jsxs("div",{children:[$.jsx($g,{children:"Solutions"}),$.jsx(Og,{children:e.map(r=>$.jsx(I3,{explanation:r},e.indexOf(r)))})]}),t.length>0&&$.jsxs("div",{children:[$.jsx($g,{children:"Constraint Explanations"}),$.jsx(Og,{children:t.map(r=>$.jsx(O3,{explanation:r},t.indexOf(r)))})]})]})}function ai(e){return Sx(e)?(e.nodeName||"").toLowerCase():"#document"}function Jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ci(e){var t;return(t=(Sx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sx(e){return e instanceof Node||e instanceof Jn(e).Node}function Bt(e){return e instanceof Element||e instanceof Jn(e).Element}function $n(e){return e instanceof HTMLElement||e instanceof Jn(e).HTMLElement}function Gp(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jn(e).ShadowRoot}function $u(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Qn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function P3(e){return["table","td","th"].includes(ai(e))}function kv(e){const t=Mv(),n=Qn(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function wx(e){let t=Do(e);for(;$n(t)&&!$a(t);){if(kv(t))return t;t=Do(t)}return null}function Mv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $a(e){return["html","body","#document"].includes(ai(e))}function Qn(e){return Jn(e).getComputedStyle(e)}function xf(e){return Bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Do(e){if(ai(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gp(e)&&e.host||ci(e);return Gp(t)?t.host:t}function Cx(e){const t=Do(e);return $a(t)?e.ownerDocument?e.ownerDocument.body:e.body:$n(t)&&$u(t)?t:Cx(t)}function Di(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Cx(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Jn(i);return o?t.concat(a,a.visualViewport||[],$u(i)?i:[],a.frameElement&&n?Di(a.frameElement):[]):t.concat(i,Di(i,[],n))}function ia(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Un(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Gp(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function xx(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ex(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function R3(e){return e.mozInputSource===0&&e.isTrusted?!0:zp()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function k3(e){return j3()?!1:!zp()&&e.width===0&&e.height===0||zp()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function M3(){return/apple/i.test(navigator.vendor)}function zp(){const e=/android/i;return e.test(xx())||e.test(Ex())}function j3(){return Ex().includes("jsdom/")}function Ng(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function _3(e){return"nativeEvent"in e}function q3(e){return e.matches("html,body")}function zr(e){return(e==null?void 0:e.ownerDocument)||document}function rd(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function oa(e){return"composedPath"in e?e.composedPath()[0]:e.target}const F3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Tx(e){return $n(e)&&e.matches(F3)}function id(e){e.preventDefault(),e.stopPropagation()}function L3(e){return e?e.getAttribute("role")==="combobox"&&Tx(e):!1}const Oa=Math.min,yo=Math.max,fl=Math.round,cc=Math.floor,Li=e=>({x:e,y:e}),B3={left:"right",right:"left",bottom:"top",top:"bottom"},V3={start:"end",end:"start"};function Wp(e,t,n){return yo(e,Oa(t,n))}function Ou(e,t){return typeof e=="function"?e(t):e}function No(e){return e.split("-")[0]}function Du(e){return e.split("-")[1]}function Ix(e){return e==="x"?"y":"x"}function jv(e){return e==="y"?"height":"width"}function Ef(e){return["top","bottom"].includes(No(e))?"y":"x"}function _v(e){return Ix(Ef(e))}function U3(e,t,n){n===void 0&&(n=!1);const r=Du(e),i=_v(e),o=jv(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=dl(a)),[a,dl(a)]}function G3(e){const t=dl(e);return[Hp(e),t,Hp(t)]}function Hp(e){return e.replace(/start|end/g,t=>V3[t])}function z3(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}function W3(e,t,n,r){const i=Du(e);let o=z3(No(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Hp)))),o}function dl(e){return e.replace(/left|right|bottom|top/g,t=>B3[t])}function H3(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ax(e){return typeof e!="number"?H3(e):{top:e,right:e,bottom:e,left:e}}function pl(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Pg(e,t,n){let{reference:r,floating:i}=e;const o=Ef(t),a=_v(t),s=jv(a),u=No(t),c=o==="y",l=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[s]/2-i[s]/2;let p;switch(u){case"top":p={x:l,y:r.y-i.height};break;case"bottom":p={x:l,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Du(t)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1);break}return p}const K3=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=Pg(c,r,u),d=r,p={},h=0;for(let v=0;v<s.length;v++){const{name:C,fn:E}=s[v],{x:y,y:w,data:x,reset:S}=await E({x:l,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});l=y??l,f=w??f,p={...p,[C]:{...p[C],...x}},S&&h<=50&&(h++,typeof S=="object"&&(S.placement&&(d=S.placement),S.rects&&(c=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:l,y:f}=Pg(c,d,u)),v=-1)}return{x:l,y:f,placement:d,strategy:i,middlewareData:p}};async function $x(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Ou(t,e),h=Ax(p),v=s[d?f==="floating"?"reference":"floating":f],C=pl(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:l,strategy:u})),E=f==="floating"?{...a.floating,x:r,y:i}:a.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),w=await(o.isElement==null?void 0:o.isElement(y))?await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1}:{x:1,y:1},x=pl(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:y,strategy:u}):E);return{top:(C.top-x.top+h.top)/w.y,bottom:(x.bottom-C.bottom+h.bottom)/w.y,left:(C.left-x.left+h.left)/w.x,right:(x.right-C.right+h.right)/w.x}}const Y3=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:u}=t,{element:c,padding:l=0}=Ou(e,t)||{};if(c==null)return{};const f=Ax(l),d={x:n,y:r},p=_v(i),h=jv(p),v=await a.getDimensions(c),C=p==="y",E=C?"top":"left",y=C?"bottom":"right",w=C?"clientHeight":"clientWidth",x=o.reference[h]+o.reference[p]-d[p]-o.floating[h],S=d[p]-o.reference[p],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let A=T?T[w]:0;(!A||!await(a.isElement==null?void 0:a.isElement(T)))&&(A=s.floating[w]||o.floating[h]);const D=x/2-S/2,I=A/2-v[h]/2-1,N=Oa(f[E],I),j=Oa(f[y],I),L=N,V=A-v[h]-j,H=A/2-v[h]/2+D,R=Wp(L,H,V),ie=!u.arrow&&Du(i)!=null&&H!==R&&o.reference[h]/2-(H<L?N:j)-v[h]/2<0,B=ie?H<L?H-L:H-V:0;return{[p]:d[p]+B,data:{[p]:R,centerOffset:H-R-B,...ie&&{alignmentOffset:B}},reset:ie}}}),X3=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:u,elements:c}=t,{mainAxis:l=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...C}=Ou(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=No(i),y=No(s)===s,w=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=d||(y||!v?[dl(s)]:G3(s));!d&&h!=="none"&&x.push(...W3(s,v,h,w));const S=[s,...x],T=await $x(t,C),A=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(l&&A.push(T[E]),f){const L=U3(i,a,w);A.push(T[L[0]],T[L[1]])}if(D=[...D,{placement:i,overflows:A}],!A.every(L=>L<=0)){var I,N;const L=(((I=o.flip)==null?void 0:I.index)||0)+1,V=S[L];if(V)return{data:{index:L,overflows:D},reset:{placement:V}};let H=(N=D.filter(R=>R.overflows[0]<=0).sort((R,ie)=>R.overflows[1]-ie.overflows[1])[0])==null?void 0:N.placement;if(!H)switch(p){case"bestFit":{var j;const R=(j=D.map(ie=>[ie.placement,ie.overflows.filter(B=>B>0).reduce((B,U)=>B+U,0)]).sort((ie,B)=>ie[1]-B[1])[0])==null?void 0:j[0];R&&(H=R);break}case"initialPlacement":H=s;break}if(i!==H)return{reset:{placement:H}}}return{}}}};async function J3(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=No(n),s=Du(n),u=Ef(n)==="y",c=["left","top"].includes(a)?-1:1,l=o&&u?-1:1,f=Ou(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),u?{x:p*l,y:d*c}:{x:d*c,y:p*l}}const Q3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,u=await J3(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}},Z3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:C=>{let{x:E,y}=C;return{x:E,y}}},...u}=Ou(e,t),c={x:n,y:r},l=await $x(t,u),f=Ef(No(i)),d=Ix(f);let p=c[d],h=c[f];if(o){const C=d==="y"?"top":"left",E=d==="y"?"bottom":"right",y=p+l[C],w=p-l[E];p=Wp(y,p,w)}if(a){const C=f==="y"?"top":"left",E=f==="y"?"bottom":"right",y=h+l[C],w=h-l[E];h=Wp(y,h,w)}const v=s.fn({...t,[d]:p,[f]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function Ox(e){const t=Qn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=$n(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=fl(n)!==o||fl(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function qv(e){return Bt(e)?e:e.contextElement}function Sa(e){const t=qv(e);if(!$n(t))return Li(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Ox(t);let a=(o?fl(n.width):n.width)/r,s=(o?fl(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const eB=Li(0);function Dx(e){const t=Jn(e);return!Mv()||!t.visualViewport?eB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Jn(e)?!1:t}function Po(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=qv(e);let a=Li(1);t&&(r?Bt(r)&&(a=Sa(r)):a=Sa(e));const s=tB(o,n,r)?Dx(o):Li(0);let u=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,l=i.width/a.x,f=i.height/a.y;if(o){const d=Jn(o),p=r&&Bt(r)?Jn(r):r;let h=d.frameElement;for(;h&&r&&p!==d;){const v=Sa(h),C=h.getBoundingClientRect(),E=Qn(h),y=C.left+(h.clientLeft+parseFloat(E.paddingLeft))*v.x,w=C.top+(h.clientTop+parseFloat(E.paddingTop))*v.y;u*=v.x,c*=v.y,l*=v.x,f*=v.y,u+=y,c+=w,h=Jn(h).frameElement}}return pl({width:l,height:f,x:u,y:c})}const nB=[":popover-open",":modal"];function Nx(e){let t=!1,n=0,r=0;function i(o){try{t=t||e.matches(o)}catch{}}if(nB.forEach(o=>{i(o)}),t){const o=wx(e);if(o){const a=o.getBoundingClientRect();n=a.x,r=a.y}}return[t,n,r]}function rB(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=ci(r),[a]=t?Nx(t.floating):[!1];if(r===o||a)return n;let s={scrollLeft:0,scrollTop:0},u=Li(1);const c=Li(0),l=$n(r);if((l||!l&&i!=="fixed")&&((ai(r)!=="body"||$u(o))&&(s=xf(r)),$n(r))){const f=Po(r);u=Sa(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+c.x,y:n.y*u.y-s.scrollTop*u.y+c.y}}function iB(e){return Array.from(e.getClientRects())}function Px(e){return Po(ci(e)).left+xf(e).scrollLeft}function oB(e){const t=ci(e),n=xf(e),r=e.ownerDocument.body,i=yo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=yo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Px(e);const s=-n.scrollTop;return Qn(r).direction==="rtl"&&(a+=yo(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function aB(e,t){const n=Jn(e),r=ci(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const c=Mv();(!c||c&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s,y:u}}function sB(e,t){const n=Po(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=$n(e)?Sa(e):Li(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,c=r*o.y;return{width:a,height:s,x:u,y:c}}function Rg(e,t,n){let r;if(t==="viewport")r=aB(e,n);else if(t==="document")r=oB(ci(e));else if(Bt(t))r=sB(t,n);else{const i=Dx(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return pl(r)}function Rx(e,t){const n=Do(e);return n===t||!Bt(n)||$a(n)?!1:Qn(n).position==="fixed"||Rx(n,t)}function uB(e,t){const n=t.get(e);if(n)return n;let r=Di(e,[],!1).filter(s=>Bt(s)&&ai(s)!=="body"),i=null;const o=Qn(e).position==="fixed";let a=o?Do(e):e;for(;Bt(a)&&!$a(a);){const s=Qn(a),u=kv(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&i&&["absolute","fixed"].includes(i.position)||$u(a)&&!u&&Rx(e,a))?r=r.filter(c=>c!==a):i=s,a=Do(a)}return t.set(e,r),r}function cB(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?uB(t,this._c):[].concat(n),r],a=o[0],s=o.reduce((u,c)=>{const l=Rg(t,c,i);return u.top=yo(l.top,u.top),u.right=Oa(l.right,u.right),u.bottom=Oa(l.bottom,u.bottom),u.left=yo(l.left,u.left),u},Rg(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function lB(e){const{width:t,height:n}=Ox(e);return{width:t,height:n}}function fB(e,t,n,r){const i=$n(t),o=ci(t),a=n==="fixed",s=Po(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const c=Li(0);if(i||!i&&!a)if((ai(t)!=="body"||$u(o))&&(u=xf(t)),i){const v=Po(t,!0,a,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else o&&(c.x=Px(o));let l=s.left+u.scrollLeft-c.x,f=s.top+u.scrollTop-c.y;const[d,p,h]=Nx(r);return d&&(l+=p,f+=h,i&&(l+=t.clientLeft,f+=t.clientTop)),{x:l,y:f,width:s.width,height:s.height}}function kg(e,t){return!$n(e)||Qn(e).position==="fixed"?null:t?t(e):e.offsetParent}function kx(e,t){const n=Jn(e);if(!$n(e))return n;let r=kg(e,t);for(;r&&P3(r)&&Qn(r).position==="static";)r=kg(r,t);return r&&(ai(r)==="html"||ai(r)==="body"&&Qn(r).position==="static"&&!kv(r))?n:r||wx(e)||n}const dB=async function(e){const t=this.getOffsetParent||kx,n=this.getDimensions;return{reference:fB(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function pB(e){return Qn(e).direction==="rtl"}const Mx={convertOffsetParentRelativeRectToViewportRelativeRect:rB,getDocumentElement:ci,getClippingRect:cB,getOffsetParent:kx,getElementRects:dB,getClientRects:iB,getDimensions:lB,getScale:Sa,isElement:Bt,isRTL:pB};function hB(e,t){let n=null,r;const i=ci(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),o();const{left:c,top:l,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const p=cc(l),h=cc(i.clientWidth-(c+f)),v=cc(i.clientHeight-(l+d)),C=cc(c),E={rootMargin:-p+"px "+-h+"px "+-v+"px "+-C+"px",threshold:yo(0,Oa(1,u))||1};let y=!0;function w(x){const S=x[0].intersectionRatio;if(S!==u){if(!y)return a();S?a(!1,S):r=setTimeout(()=>{a(!1,1e-7)},100)}y=!1}try{n=new IntersectionObserver(w,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,E)}n.observe(e)}return a(!0),o}function vB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=qv(e),l=i||o?[...c?Di(c):[],...Di(t)]:[];l.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const f=c&&s?hB(c,n):null;let d=-1,p=null;a&&(p=new ResizeObserver(E=>{let[y]=E;y&&y.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let h,v=u?Po(e):null;u&&C();function C(){const E=Po(e);v&&(E.x!==v.x||E.y!==v.y||E.width!==v.width||E.height!==v.height)&&n(),v=E,h=requestAnimationFrame(C)}return n(),()=>{var E;l.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),f==null||f(),(E=p)==null||E.disconnect(),p=null,u&&cancelAnimationFrame(h)}}const mB=Z3,yB=X3,Mg=Y3,gB=(e,t,n)=>{const r=new Map,i={platform:Mx,...n},o={...i.platform,_c:r};return K3(e,t,{...i,platform:o})},bB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Mg({element:r.current,padding:i}).fn(n):{}:r?Mg({element:r,padding:i}).fn(n):{}}}};var kc=typeof document<"u"?O.useLayoutEffect:O.useEffect;function hl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!hl(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!hl(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function jx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jg(e,t){const n=jx(e);return Math.round(t*n)/n}function _g(e){const t=J.useRef(e);return kc(()=>{t.current=e}),t}function SB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[l,f]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=J.useState(r);hl(d,r)||p(r);const[h,v]=J.useState(null),[C,E]=J.useState(null),y=J.useCallback(B=>{B!==T.current&&(T.current=B,v(B))},[]),w=J.useCallback(B=>{B!==A.current&&(A.current=B,E(B))},[]),x=o||h,S=a||C,T=J.useRef(null),A=J.useRef(null),D=J.useRef(l),I=u!=null,N=_g(u),j=_g(i),L=J.useCallback(()=>{if(!T.current||!A.current)return;const B={placement:t,strategy:n,middleware:d};j.current&&(B.platform=j.current),gB(T.current,A.current,B).then(U=>{const fe={...U,isPositioned:!0};V.current&&!hl(D.current,fe)&&(D.current=fe,I1.flushSync(()=>{f(fe)}))})},[d,t,n,j]);kc(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[c]);const V=J.useRef(!1);kc(()=>(V.current=!0,()=>{V.current=!1}),[]),kc(()=>{if(x&&(T.current=x),S&&(A.current=S),x&&S){if(N.current)return N.current(x,S,L);L()}},[x,S,L,N,I]);const H=J.useMemo(()=>({reference:T,floating:A,setReference:y,setFloating:w}),[y,w]),R=J.useMemo(()=>({reference:x,floating:S}),[x,S]),ie=J.useMemo(()=>{const B={position:n,left:0,top:0};if(!R.floating)return B;const U=jg(R.floating,l.x),fe=jg(R.floating,l.y);return s?{...B,transform:"translate("+U+"px, "+fe+"px)",...jx(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:fe}},[n,s,R.floating,l.x,l.y]);return J.useMemo(()=>({...l,update:L,refs:H,elements:R,floatingStyles:ie}),[l,L,H,R,ie])}/*!
|
|
1148
|
+
* tabbable 6.2.0
|
|
1149
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
1150
|
+
*/var wB=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Kp=wB.join(","),_x=typeof Element>"u",iu=_x?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,vl=!_x&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},ml=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",a=o||n&&t&&e(t.parentNode);return a},CB=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},xB=function(e,t,n){if(ml(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Kp));return t&&iu.call(e,Kp)&&r.unshift(e),r=r.filter(n),r},EB=function e(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!ml(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),u=s.length?s:a.children,c=e(u,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:a,candidates:c})}else{var l=iu.call(a,Kp);l&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),d=!ml(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&d){var p=e(f===!0?a.children:f.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:a,candidates:p})}else o.unshift.apply(o,a.children)}}return i},qx=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Fx=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||CB(e))&&!qx(e)?0:e.tabIndex},TB=function(e,t){var n=Fx(e);return n<0&&t&&!qx(e)?0:n},IB=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Lx=function(e){return e.tagName==="INPUT"},AB=function(e){return Lx(e)&&e.type==="hidden"},$B=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},OB=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},DB=function(e){if(!e.name)return!0;var t=e.form||vl(e),n=function(o){return t.querySelectorAll('input[type="radio"][name="'+o+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var i=OB(r,e.form);return!i||i===e},NB=function(e){return Lx(e)&&e.type==="radio"},PB=function(e){return NB(e)&&!DB(e)},RB=function(e){var t,n=e&&vl(e),r=(t=n)===null||t===void 0?void 0:t.host,i=!1;if(n&&n!==e){var o,a,s;for(i=!!((o=r)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(r)||e!=null&&(s=e.ownerDocument)!==null&&s!==void 0&&s.contains(e));!i&&r;){var u,c,l;n=vl(r),r=(u=n)===null||u===void 0?void 0:u.host,i=!!((c=r)!==null&&c!==void 0&&(l=c.ownerDocument)!==null&&l!==void 0&&l.contains(r))}}return i},qg=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},kB=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=iu.call(e,"details>summary:first-of-type"),o=i?e.parentElement:e;if(iu.call(o,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof r=="function"){for(var a=e;e;){var s=e.parentElement,u=vl(e);if(s&&!s.shadowRoot&&r(s)===!0)return qg(e);e.assignedSlot?e=e.assignedSlot:!s&&u!==e.ownerDocument?e=u.host:e=s}e=a}if(RB(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return qg(e);return!1},MB=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName==="LEGEND")return iu.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},jB=function(e,t){return!(t.disabled||ml(t)||AB(t)||kB(t,e)||$B(t)||MB(t))},Fg=function(e,t){return!(PB(t)||Fx(t)<0||!jB(e,t))},_B=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},qB=function e(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,u=TB(s,a),c=a?e(i.candidates):s;u===0?a?n.push.apply(n,c):n.push(s):r.push({documentOrder:o,tabIndex:u,item:i,isScope:a,content:c})}),r.sort(IB).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},Fv=function(e,t){t=t||{};var n;return t.getShadowRoot?n=EB([e],t.includeContainer,{filter:Fg.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:_B}):n=xB(e,t.includeContainer,Fg.bind(null,t)),qB(n)};function Lv(e){return J.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const FB=J["useInsertionEffect".toString()],LB=FB||(e=>e());function aa(e){const t=J.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return LB(()=>{t.current=e}),J.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}let Lg=0;function Qi(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Lg);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Lg=requestAnimationFrame(o)}var or=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Da(){return Da=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Da.apply(this,arguments)}let od=!1,BB=0;const Bg=()=>"floating-ui-"+BB++;function VB(){const[e,t]=J.useState(()=>od?Bg():void 0);return or(()=>{e==null&&t(Bg())},[]),J.useEffect(()=>{od||(od=!0)},[]),e}const UB=J["useId".toString()],Tf=UB||VB,GB=J.forwardRef(function(e,t){let{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i}},width:o=14,height:a=7,tipRadius:s=0,strokeWidth:u=0,staticOffset:c,stroke:l,d:f,style:{transform:d,...p}={},...h}=e;process.env.NODE_ENV!=="production"&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=Tf();if(!r)return null;u*=2;const C=u/2,E=o/2*(s/-8+1),y=a/2*s/4,[w,x]=n.split("-"),S=Mx.isRTL(r),T=!!f,A=w==="top"||w==="bottom",D=c&&x==="end"?"bottom":"top";let I=c&&x==="end"?"right":"left";c&&S&&(I=x==="end"?"left":"right");const N=(i==null?void 0:i.x)!=null?c||i.x:"",j=(i==null?void 0:i.y)!=null?c||i.y:"",L=f||"M0,0"+(" H"+o)+(" L"+(o-E)+","+(a-y))+(" Q"+o/2+","+a+" "+E+","+(a-y))+" Z",V={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[w];return J.createElement("svg",Da({},h,{"aria-hidden":!0,ref:t,width:T?o:o+u,height:o,viewBox:"0 0 "+o+" "+(a>o?a:o),style:{position:"absolute",pointerEvents:"none",[I]:N,[D]:j,[w]:A||T?"100%":"calc(100% - "+u/2+"px)",transform:""+V+(d??""),...p}}),u>0&&J.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:l,strokeWidth:u+(f?0:1),d:L}),J.createElement("path",{stroke:u&&!f?h.fill:"none",d:L}),J.createElement("clipPath",{id:v},J.createElement("rect",{x:-C,y:C*(T?-1:1),width:o+u,height:o})))});function zB(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const WB=J.createContext(null),HB=J.createContext(null),KB=()=>{var e;return((e=J.useContext(WB))==null?void 0:e.id)||null},Bv=()=>J.useContext(HB);function ou(e){return"data-floating-ui-"+e}function ad(e){const t=O.useRef(e);return or(()=>{t.current=e}),t}function YB(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(a=>a.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function ks(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(a=>{var s;return i.parentId===a.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}let Zo=new WeakMap,lc=new WeakSet,fc={},sd=0;const XB=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Bx=e=>e&&(e.host||Bx(e.parentNode)),JB=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Bx(n);return e.contains(r)?r:null}).filter(n=>n!=null);function QB(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=JB(t,e),s=new Set,u=new Set(a),c=[];fc[i]||(fc[i]=new WeakMap);const l=fc[i];a.forEach(f),d(t),s.clear();function f(p){!p||s.has(p)||(s.add(p),p.parentNode&&f(p.parentNode))}function d(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,h=>{if(s.has(h))d(h);else{const v=o?h.getAttribute(o):null,C=v!==null&&v!=="false",E=(Zo.get(h)||0)+1,y=(l.get(h)||0)+1;Zo.set(h,E),l.set(h,y),c.push(h),E===1&&C&&lc.add(h),y===1&&h.setAttribute(i,""),!C&&o&&h.setAttribute(o,"true")}})}return sd++,()=>{c.forEach(p=>{const h=(Zo.get(p)||0)-1,v=(l.get(p)||0)-1;Zo.set(p,h),l.set(p,v),h||(!lc.has(p)&&o&&p.removeAttribute(o),lc.delete(p)),v||p.removeAttribute(i)}),sd--,sd||(Zo=new WeakMap,Zo=new WeakMap,lc=new WeakSet,fc={})}}function Vg(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=zr(e[0]).body;return QB(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Vv=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Vx(e,t){const n=Fv(e,Vv());t==="prev"&&n.reverse();const r=n.indexOf(ia(zr(e)));return n.slice(r+1)[0]}function Ux(){return Vx(document.body,"next")}function Gx(){return Vx(document.body,"prev")}function Ms(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Un(n,r)}function ZB(e){Fv(e,Vv()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function eV(e){e.querySelectorAll("[data-tabindex]").forEach(t=>{const n=t.dataset.tabindex;delete t.dataset.tabindex,n?t.setAttribute("tabindex",n):t.removeAttribute("tabindex")})}const Uv={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let tV;function Ug(e){e.key==="Tab"&&(e.target,clearTimeout(tV))}const yl=J.forwardRef(function(e,t){const[n,r]=J.useState();or(()=>(M3()&&r("button"),document.addEventListener("keydown",Ug),()=>{document.removeEventListener("keydown",Ug)}),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[ou("focus-guard")]:"",style:Uv};return J.createElement("span",Da({},e,i))}),zx=J.createContext(null),Gg=ou("portal");function nV(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=J.useState(null),o=Tf(),a=Hx(),s=J.useRef(null);return or(()=>()=>{r==null||r.remove(),queueMicrotask(()=>{s.current=null})},[r]),or(()=>{if(s.current)return;const u=t?document.getElementById(t):null;if(!u)return;const c=document.createElement("div");c.id=o,c.setAttribute(Gg,""),u.appendChild(c),s.current=c,i(c)},[t,o]),or(()=>{if(s.current)return;let u=n||(a==null?void 0:a.portalNode);u&&!Bt(u)&&(u=u.current),u=u||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,u.appendChild(c));const l=document.createElement("div");l.id=o,l.setAttribute(Gg,""),u=c||u,u.appendChild(l),s.current=l,i(l)},[t,n,o,a]),r}function Wx(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=nV({id:n,root:r}),[a,s]=J.useState(null),u=J.useRef(null),c=J.useRef(null),l=J.useRef(null),f=J.useRef(null),d=!!a&&!a.modal&&a.open&&i&&!!(r||o);return J.useEffect(()=>{if(!o||!i||a!=null&&a.modal)return;function p(h){o&&Ms(h)&&(h.type==="focusin"?eV:ZB)(o)}return o.addEventListener("focusin",p,!0),o.addEventListener("focusout",p,!0),()=>{o.removeEventListener("focusin",p,!0),o.removeEventListener("focusout",p,!0)}},[o,i,a==null?void 0:a.modal]),J.createElement(zx.Provider,{value:J.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:c,beforeInsideRef:l,afterInsideRef:f,portalNode:o,setFocusManagerState:s}),[i,o])},d&&o&&J.createElement(yl,{"data-type":"outside",ref:u,onFocus:p=>{if(Ms(p,o)){var h;(h=l.current)==null||h.focus()}else{const v=Gx()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus()}}}),d&&o&&J.createElement("span",{"aria-owns":o.id,style:Uv}),o&&lb.createPortal(t,o),d&&o&&J.createElement(yl,{"data-type":"outside",ref:c,onFocus:p=>{if(Ms(p,o)){var h;(h=f.current)==null||h.focus()}else{const v=Ux()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,p.nativeEvent))}}}))}const Hx=()=>J.useContext(zx),zg=20;let ao=[];function ud(e){ao=ao.filter(t=>t.isConnected),e&&ai(e)!=="body"&&(ao.push(e),ao.length>zg&&(ao=ao.slice(-zg)))}function Wg(){return ao.slice().reverse().find(e=>e.isConnected)}const rV=J.forwardRef(function(e,t){return J.createElement("button",Da({},e,{type:"button",ref:t,tabIndex:-1,style:Uv}))});function Kx(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:a=0,returnFocus:s=!0,modal:u=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:l=!0}=e,{open:f,refs:d,nodeId:p,onOpenChange:h,events:v,dataRef:C,elements:{domReference:E,floating:y}}=t,w=typeof a=="number"&&a<0,x=L3(E)&&w,S=XB()?o:!0,T=ad(i),A=ad(a),D=ad(s),I=Bv(),N=Hx(),j=J.useRef(null),L=J.useRef(null),V=J.useRef(!1),H=J.useRef(!1),R=N!=null,ie=J.useCallback(function(M){return M===void 0&&(M=y),M?Fv(M,Vv()):[]},[y]),B=J.useCallback(M=>{const P=ie(M);return T.current.map(te=>E&&te==="reference"?E:y&&te==="floating"?y:P).filter(Boolean).flat()},[E,y,T,ie]);J.useEffect(()=>{if(r||!u)return;function M(te){if(te.key==="Tab"){Un(y,ia(zr(y)))&&ie().length===0&&!x&&id(te);const oe=B(),K=oa(te);T.current[0]==="reference"&&K===E&&(id(te),te.shiftKey?Qi(oe[oe.length-1]):Qi(oe[1])),T.current[1]==="floating"&&K===y&&te.shiftKey&&(id(te),Qi(oe[0]))}}const P=zr(y);return P.addEventListener("keydown",M),()=>{P.removeEventListener("keydown",M)}},[r,E,y,u,T,x,ie,B]),J.useEffect(()=>{if(r||!l)return;function M(){H.current=!0,setTimeout(()=>{H.current=!1})}function P(te){const oe=te.relatedTarget;queueMicrotask(()=>{const K=!(Un(E,oe)||Un(y,oe)||Un(oe,y)||Un(N==null?void 0:N.portalNode,oe)||oe!=null&&oe.hasAttribute(ou("focus-guard"))||I&&(ks(I.nodesRef.current,p).find(ae=>{var de,ve;return Un((de=ae.context)==null?void 0:de.elements.floating,oe)||Un((ve=ae.context)==null?void 0:ve.elements.domReference,oe)})||YB(I.nodesRef.current,p).find(ae=>{var de,ve;return((de=ae.context)==null?void 0:de.elements.floating)===oe||((ve=ae.context)==null?void 0:ve.elements.domReference)===oe})));oe&&K&&!H.current&&oe!==Wg()&&(V.current=!0,h(!1,te))})}if(y&&$n(E))return E.addEventListener("focusout",P),E.addEventListener("pointerdown",M),!u&&y.addEventListener("focusout",P),()=>{E.removeEventListener("focusout",P),E.removeEventListener("pointerdown",M),!u&&y.removeEventListener("focusout",P)}},[r,E,y,u,p,I,N,h,l]),J.useEffect(()=>{var M;if(r)return;const P=Array.from((N==null||(M=N.portalNode)==null?void 0:M.querySelectorAll("["+ou("portal")+"]"))||[]);if(y){const te=[y,...P,j.current,L.current,T.current.includes("reference")||x?E:null].filter(K=>K!=null),oe=u||x?Vg(te,S,!S):Vg(te);return()=>{oe()}}},[r,E,y,u,T,N,x,S]),or(()=>{if(r||!y)return;const M=zr(y),P=ia(M);queueMicrotask(()=>{const te=B(y),oe=A.current,K=(typeof oe=="number"?te[oe]:oe.current)||y,ae=Un(y,P);!w&&!ae&&f&&Qi(K,{preventScroll:K===y})})},[r,f,y,w,B,A]),or(()=>{if(r||!y)return;let M=!1;const P=zr(y),te=ia(P),oe=C.current;ud(te);function K(ae){let{reason:de,event:ve,nested:Ee}=ae;de==="escape-key"&&d.domReference.current&&ud(d.domReference.current),de==="hover"&&ve.type==="mouseleave"&&(V.current=!0),de==="outside-press"&&(Ee?(V.current=!1,M=!0):V.current=!(R3(ve)||k3(ve)))}return v.on("openchange",K),()=>{v.off("openchange",K);const ae=ia(P),de=Un(y,ae)||I&&ks(I.nodesRef.current,p).some(Ee=>{var Re;return Un((Re=Ee.context)==null?void 0:Re.elements.floating,ae)});(de||oe.openEvent&&["click","mousedown"].includes(oe.openEvent.type))&&d.domReference.current&&ud(d.domReference.current);const ve=Wg();D.current&&!V.current&&$n(ve)&&(!(ve!==ae&&ae!==P.body)||de)&&Qi(ve,{cancelPrevious:!1,preventScroll:M})}},[r,y,D,C,d,v,I,p]),or(()=>{if(!(r||!N))return N.setFocusManagerState({modal:u,closeOnFocusOut:l,open:f,onOpenChange:h,refs:d}),()=>{N.setFocusManagerState(null)}},[r,N,u,f,h,d,l]),or(()=>{if(r||!y||typeof MutationObserver!="function"||w)return;const M=()=>{const te=y.getAttribute("tabindex");T.current.includes("floating")||ia(zr(y))!==d.domReference.current&&ie().length===0?te!=="0"&&y.setAttribute("tabindex","0"):te!=="-1"&&y.setAttribute("tabindex","-1")};M();const P=new MutationObserver(M);return P.observe(y,{childList:!0,subtree:!0,attributes:!0}),()=>{P.disconnect()}},[r,y,d,T,ie,w]);function U(M){return r||!c||!u?null:J.createElement(rV,{ref:M==="start"?j:L,onClick:P=>h(!1,P.nativeEvent)},typeof c=="string"?c:"Dismiss")}const fe=!r&&S&&(R||u);return J.createElement(J.Fragment,null,fe&&J.createElement(yl,{"data-type":"inside",ref:N==null?void 0:N.beforeInsideRef,onFocus:M=>{if(u){const te=B();Qi(i[0]==="reference"?te[0]:te[te.length-1])}else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(V.current=!1,Ms(M,N.portalNode)){const te=Ux()||E;te==null||te.focus()}else{var P;(P=N.beforeOutsideRef.current)==null||P.focus()}}}),!x&&U("start"),n,U("end"),fe&&J.createElement(yl,{"data-type":"inside",ref:N==null?void 0:N.afterInsideRef,onFocus:M=>{if(u)Qi(B()[0]);else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(l&&(V.current=!0),Ms(M,N.portalNode)){const te=Gx()||E;te==null||te.focus()}else{var P;(P=N.afterOutsideRef.current)==null||P.focus()}}}))}const cd=new Set,Yx=J.forwardRef(function(e,t){let{lockScroll:n=!1,...r}=e;const i=Tf();return or(()=>{if(!n)return;cd.add(i);const o=/iP(hone|ad|od)|iOS/.test(xx()),a=document.body.style,s=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,c=a.left?parseFloat(a.left):window.pageXOffset,l=a.top?parseFloat(a.top):window.pageYOffset;if(a.overflow="hidden",u&&(a[s]=u+"px"),o){var f,d;const p=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,h=((d=window.visualViewport)==null?void 0:d.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(l-Math.floor(h))+"px",left:-(c-Math.floor(p))+"px",right:"0"})}return()=>{cd.delete(i),cd.size===0&&(Object.assign(a,{overflow:"",[s]:""}),o&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(c,l)))}},[i,n]),J.createElement("div",Da({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function Hg(e){return $n(e.target)&&e.target.tagName==="BUTTON"}function Kg(e){return Tx(e)}function Xx(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:a=!0,event:s="click",toggle:u=!0,ignoreMouse:c=!1,keyboardHandlers:l=!0}=t,f=J.useRef(),d=J.useRef(!1);return J.useMemo(()=>a?{reference:{onPointerDown(p){f.current=p.pointerType},onMouseDown(p){p.button===0&&(Ng(f.current,!0)&&c||s!=="click"&&(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){if(s==="mousedown"&&f.current){f.current=void 0;return}Ng(f.current,!0)&&c||(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!l||Hg(p))&&(p.key===" "&&!Kg(o)&&(p.preventDefault(),d.current=!0),p.key==="Enter"&&r(!(n&&u),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!l||Hg(p)||Kg(o)||p.key===" "&&d.current&&(d.current=!1,r(!(n&&u),p.nativeEvent,"click"))}}}:{},[a,i,s,c,l,o,u,n,r])}const iV={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},oV={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Yg=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function Jx(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:i,elements:{reference:o,domReference:a,floating:s},dataRef:u}=e,{enabled:c=!0,escapeKey:l=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:p=!1,referencePressEvent:h="pointerdown",ancestorScroll:v=!1,bubbles:C,capture:E}=t,y=Bv(),w=aa(typeof f=="function"?f:()=>!1),x=typeof f=="function"?w:f,S=J.useRef(!1),T=J.useRef(!1),{escapeKey:A,outsidePress:D}=Yg(C),{escapeKey:I,outsidePress:N}=Yg(E),j=aa(R=>{if(!n||!c||!l||R.key!=="Escape")return;const ie=y?ks(y.nodesRef.current,i):[];if(!A&&(R.stopPropagation(),ie.length>0)){let B=!0;if(ie.forEach(U=>{var fe;if((fe=U.context)!=null&&fe.open&&!U.context.dataRef.current.__escapeKeyBubbles){B=!1;return}}),!B)return}r(!1,_3(R)?R.nativeEvent:R,"escape-key")}),L=aa(R=>{var ie;const B=()=>{var U;j(R),(U=oa(R))==null||U.removeEventListener("keydown",B)};(ie=oa(R))==null||ie.addEventListener("keydown",B)}),V=aa(R=>{const ie=S.current;S.current=!1;const B=T.current;if(T.current=!1,d==="click"&&B||ie||typeof x=="function"&&!x(R))return;const U=oa(R),fe="["+ou("inert")+"]",M=zr(s).querySelectorAll(fe);let P=Bt(U)?U:null;for(;P&&!$a(P);){const K=Do(P);if($a(K)||!Bt(K))break;P=K}if(M.length&&Bt(U)&&!q3(U)&&!Un(U,s)&&Array.from(M).every(K=>!Un(P,K)))return;if($n(U)&&s){const K=U.clientWidth>0&&U.scrollWidth>U.clientWidth,ae=U.clientHeight>0&&U.scrollHeight>U.clientHeight;let de=ae&&R.offsetX>U.clientWidth;if(ae&&Qn(U).direction==="rtl"&&(de=R.offsetX<=U.offsetWidth-U.clientWidth),de||K&&R.offsetY>U.clientHeight)return}const te=y&&ks(y.nodesRef.current,i).some(K=>{var ae;return rd(R,(ae=K.context)==null?void 0:ae.elements.floating)});if(rd(R,s)||rd(R,a)||te)return;const oe=y?ks(y.nodesRef.current,i):[];if(oe.length>0){let K=!0;if(oe.forEach(ae=>{var de;if((de=ae.context)!=null&&de.open&&!ae.context.dataRef.current.__outsidePressBubbles){K=!1;return}}),!K)return}r(!1,R,"outside-press")}),H=aa(R=>{var ie;const B=()=>{var U;V(R),(U=oa(R))==null||U.removeEventListener(d,B)};(ie=oa(R))==null||ie.addEventListener(d,B)});return J.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=A,u.current.__outsidePressBubbles=D;function R(U){r(!1,U,"ancestor-scroll")}const ie=zr(s);l&&ie.addEventListener("keydown",I?L:j,I),x&&ie.addEventListener(d,N?H:V,N);let B=[];return v&&(Bt(a)&&(B=Di(a)),Bt(s)&&(B=B.concat(Di(s))),!Bt(o)&&o&&o.contextElement&&(B=B.concat(Di(o.contextElement)))),B=B.filter(U=>{var fe;return U!==((fe=ie.defaultView)==null?void 0:fe.visualViewport)}),B.forEach(U=>{U.addEventListener("scroll",R,{passive:!0})}),()=>{l&&ie.removeEventListener("keydown",I?L:j,I),x&&ie.removeEventListener(d,N?H:V,N),B.forEach(U=>{U.removeEventListener("scroll",R)})}},[u,s,a,o,l,x,d,n,r,v,c,A,D,j,I,L,V,N,H]),J.useEffect(()=>{S.current=!1},[x,d]),J.useMemo(()=>c?{reference:{onKeyDown:j,[iV[h]]:R=>{p&&r(!1,R.nativeEvent,"reference-press")}},floating:{onKeyDown:j,onMouseDown(){T.current=!0},onMouseUp(){T.current=!0},[oV[d]]:()=>{S.current=!0}}}:{},[c,p,d,h,r,j])}let Yp;process.env.NODE_ENV!=="production"&&(Yp=new Set);function Qx(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const D="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!Bt(e.elements.reference)){var a;if(!((a=Yp)!=null&&a.has(D))){var s;(s=Yp)==null||s.add(D),console.error(D)}}}const[u,c]=J.useState(null),l=((t=e.elements)==null?void 0:t.reference)||u,f=SB(e),d=Bv(),p=KB()!=null,h=aa((D,I,N)=>{D&&(C.current.openEvent=I),E.emit("openchange",{open:D,event:I,reason:N,nested:p}),r==null||r(D,I,N)}),v=J.useRef(null),C=J.useRef({}),E=J.useState(()=>zB())[0],y=Tf(),w=J.useCallback(D=>{const I=Bt(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),contextElement:D}:D;f.refs.setReference(I)},[f.refs]),x=J.useCallback(D=>{(Bt(D)||D===null)&&(v.current=D,c(D)),(Bt(f.refs.reference.current)||f.refs.reference.current===null||D!==null&&!Bt(D))&&f.refs.setReference(D)},[f.refs]),S=J.useMemo(()=>({...f.refs,setReference:x,setPositionReference:w,domReference:v}),[f.refs,x,w]),T=J.useMemo(()=>({...f.elements,domReference:l}),[f.elements,l]),A=J.useMemo(()=>({...f,refs:S,elements:T,dataRef:C,nodeId:i,floatingId:y,events:E,open:n,onOpenChange:h}),[f,i,y,E,n,h,S,T]);return or(()=>{const D=d==null?void 0:d.nodesRef.current.find(I=>I.id===i);D&&(D.context=A)}),J.useMemo(()=>({...f,context:A,refs:S,elements:T}),[f,S,T,A])}const Xg="active",Jg="selected";function ld(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[Xg]:a,[Jg]:s,...u}=e;o=u}return{...n==="floating"&&{tabIndex:-1},...o,...t.map(a=>{const s=a?a[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((a,s)=>(s&&Object.entries(s).forEach(u=>{let[c,l]=u;if(!(i&&[Xg,Jg].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof l=="function"){var f;(f=r.get(c))==null||f.push(l),a[c]=function(){for(var d,p=arguments.length,h=new Array(p),v=0;v<p;v++)h[v]=arguments[v];return(d=r.get(c))==null?void 0:d.map(C=>C(...h)).find(C=>C!==void 0)}}}else a[c]=l}),a),{})}}function Zx(e){e===void 0&&(e=[]);const t=e,n=J.useCallback(o=>ld(o,e,"reference"),t),r=J.useCallback(o=>ld(o,e,"floating"),t),i=J.useCallback(o=>ld(o,e,"item"),e.map(o=>o==null?void 0:o.item));return J.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}function aV(e={}){const{initialOpen:t=!1,open:n,onOpenChange:r}=e,[i,o]=J.useState(t),a=n??i,s=r??o,u=Qx({open:a,onOpenChange:s}),c=u.context,l=Xx(c,{enabled:n==null}),f=Jx(c,{outsidePressEvent:"mousedown"}),d=Zx([l,f]);return J.useMemo(()=>({open:a,setOpen:s,...d,...u}),[a,s,d,u])}const e1=J.createContext(null),t1=()=>{const e=J.useContext(e1);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function sV({children:e,...t}){const n=aV(t);return $.jsx(e1.Provider,{value:n,children:e})}const n1=bv`
|
|
1151
|
+
display: flex;
|
|
1152
|
+
justify-content: center;
|
|
1153
|
+
align-items: center;
|
|
1154
|
+
z-index: 100;
|
|
1155
|
+
padding: var(--space-md-fixed);
|
|
1156
|
+
`,uV=Ae(Yx)`
|
|
1157
|
+
${n1};
|
|
1158
|
+
`,cV=O.forwardRef((e,t)=>{const{style:n,children:r,components:i,...o}=e,a=t1(),s=Lv([a.refs.setFloating,t]),u=(i==null?void 0:i.Overlay)??uV;return $.jsx(Wx,{children:$.jsx(u,{lockScroll:!0,children:$.jsx(Kx,{context:a.context,children:$.jsx("div",{ref:s,...a.getFloatingProps(o),children:r})})})})}),lV=cV;function r1(e){const t=O.useContext(ru),[n,r]=O.useState(t);return $.jsx(ru.Provider,{value:n,children:e.children})}const fV=O.forwardRef((e,t)=>{const{setOpen:n}=t1();return $.jsx("button",{type:"button",...e,ref:t,onClick:r=>{var i;(i=e.onClick)==null||i.call(e,r),n(!1)}})}),dV=fV,pV=Ae.span`
|
|
1159
|
+
color: var(--color-explain-header-value-color);
|
|
1160
|
+
overflow: hidden;
|
|
1161
|
+
white-space: nowrap;
|
|
1162
|
+
text-overflow: ellipsis;
|
|
1163
|
+
`;function i1(e){const{explainQuestion:t}=zi();if(!t)return $.jsx("div",{...e,children:"Conflict"});const n=Y(t).returnType().with({subject:et.configuration},()=>"Configuration").with({subject:et.attribute},i=>i.attributeId.localId).with({subject:et.choiceValue},i=>i.choiceValueId).with({subject:et.component},i=>i.state.toString()).with({subject:et.boolean},i=>i.state.toString()).with({subject:et.numeric},i=>i.state.toString()).exhaustive(),r=Y(t).returnType().with({question:Lt.whyIsStateNotPossible},()=>"is blocked").with({question:Lt.whyIsNotSatisfied},()=>"is not satisfied").exhaustive();return $.jsxs("div",{...e,children:[$.jsx(pV,{children:n})," ",r]})}const hV=Ae.div`
|
|
1164
|
+
position: sticky;
|
|
1165
|
+
top: 0;
|
|
1166
|
+
transition: all 0.1s;
|
|
1167
|
+
border-top: 1px solid transparent;
|
|
1168
|
+
|
|
1169
|
+
&.active {
|
|
1170
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
|
1171
|
+
border-color: var(--color-explain-dialog-scroll-shadow-border);
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
@media only screen and (min-resolution: 2dppx) {
|
|
1175
|
+
border-top-width: 0.5px;
|
|
1176
|
+
}
|
|
1177
|
+
`;function vV(e){const[t,n]=O.useState(!1),r=O.useRef(null);return O.useEffect(()=>{const i=new IntersectionObserver(([a])=>n(!a.isIntersecting),{root:null,threshold:1}),o=r.current;return o&&i.observe(o),()=>{o&&i.unobserve(o)}},[]),$.jsxs($.Fragment,{children:[$.jsx("div",{ref:r}),$.jsx(hV,{...dx(e,{className:M5(t&&"active")})})]})}const mV=Ae(q.motion.div)`
|
|
1178
|
+
position: relative;
|
|
1179
|
+
background-color: var(--color-explain-dialog-fill);
|
|
1180
|
+
backdrop-filter: var(--backdrop-filter-explain-dialog);
|
|
1181
|
+
color: var(--color-explain-dialog-color);
|
|
1182
|
+
outline-offset: -1px;
|
|
1183
|
+
padding-top: 1.1em;
|
|
1184
|
+
border-radius: var(--shape-border-radius-md);
|
|
1185
|
+
box-shadow: var(--shadows-dialog);
|
|
1186
|
+
font-size: var(--text-base-size);
|
|
1187
|
+
font-family: var(--font-primary);
|
|
1188
|
+
display: grid;
|
|
1189
|
+
grid-template-rows: [header] auto [content] auto;
|
|
1190
|
+
grid-template-columns: [header content] 1fr;
|
|
1191
|
+
align-content: start;
|
|
1192
|
+
min-height: min(calc(100vh - var(--space-md) * 2), 350px);
|
|
1193
|
+
max-height: min(calc(100vh - var(--space-md) * 2), 700px);
|
|
1194
|
+
max-width: min(calc(100vw - var(--space-md) * 2), 700px);
|
|
1195
|
+
min-width: min(calc(100vw - var(--space-md) * 2), 500px);
|
|
1196
|
+
`,yV=Ae.div`
|
|
1197
|
+
overflow-y: auto;
|
|
1198
|
+
grid-area: content;
|
|
1199
|
+
padding-left: var(--space-xs-fixed);
|
|
1200
|
+
padding-right: var(--space-xs-fixed);
|
|
1201
|
+
padding-bottom: var(--space-xs-fixed);
|
|
1202
|
+
`,gV=Ae(vV)`
|
|
1203
|
+
margin-left: calc(var(--space-xs-fixed) * -1);
|
|
1204
|
+
margin-right: calc(var(--space-xs-fixed) * -1);
|
|
1205
|
+
`,bV=Ae(dV)`
|
|
1206
|
+
position: absolute;
|
|
1207
|
+
right: var(--space-sm-fixed);
|
|
1208
|
+
top: var(--space-sm-fixed);
|
|
1209
|
+
border: none;
|
|
1210
|
+
background-color: transparent;
|
|
1211
|
+
color: inherit;
|
|
1212
|
+
font-size: var(--text-sm);
|
|
1213
|
+
cursor: pointer;
|
|
1214
|
+
border-radius: var(--shape-border-radius-xs);
|
|
1215
|
+
|
|
1216
|
+
&:focus {
|
|
1217
|
+
outline: 2px solid var(--color-explain-dialog-close-button-outline);
|
|
1218
|
+
outline-offset: 1px;
|
|
1219
|
+
}
|
|
1220
|
+
`,SV=Ae(i1)`
|
|
1221
|
+
grid-area: header;
|
|
1222
|
+
font-size: var(--text-md);
|
|
1223
|
+
font-weight: 500;
|
|
1224
|
+
font-family: var(--font-heading);
|
|
1225
|
+
margin-bottom: var(--space-xs);
|
|
1226
|
+
overflow: hidden;
|
|
1227
|
+
display: flex;
|
|
1228
|
+
white-space: nowrap;
|
|
1229
|
+
text-overflow: ellipsis;
|
|
1230
|
+
margin-right: var(--space-md);
|
|
1231
|
+
margin-left: calc(var(--space-xs-fixed) + var(--space-sm-fixed));
|
|
1232
|
+
`,wV={initial:{opacity:0,scale:.5},open:{opacity:1,scale:1,transition:{type:"spring",stiffness:600,damping:40}},close:{opacity:0,scale:.7,transition:{duration:.1,ease:"cubicInOut"}}};function CV(e){return $.jsxs(mV,{variants:wV,initial:"initial",animate:"open",exit:"close",children:[$.jsx(SV,{}),$.jsxs(yV,{children:[$.jsx(gV,{}),e.children]}),$.jsx(bV,{children:$.jsx(Fi,{icon:PC})})]})}const xV=Ae(lV)`
|
|
1233
|
+
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
1234
|
+
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
1235
|
+
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
1236
|
+
--color-explain-attribute-value-remove-fill: ${e=>e.attributeValueRemoveFill};
|
|
1237
|
+
--color-explain-attribute-value-remove-color: ${e=>e.attributeValueRemoveColor};
|
|
1238
|
+
--color-explain-header-value-color: ${e=>e.headerValueColor};
|
|
1239
|
+
--color-explain-dialog-fill: ${e=>e.fill};
|
|
1240
|
+
--color-explain-dialog-color: ${e=>e.color};
|
|
1241
|
+
--color-explain-dialog-close-button-outline: ${e=>e.closeButtonOutline};
|
|
1242
|
+
--color-explain-dialog-apply-solution-button-fill: ${e=>e.applySolutionButtonFill};
|
|
1243
|
+
--color-explain-dialog-apply-solution-button-color: ${e=>e.applySolutionButtonColor};
|
|
1244
|
+
--color-explain-dialog-apply-solution-button-outline: ${e=>e.applySolutionButtonOutline};
|
|
1245
|
+
--color-explain-dialog-explanation-card: ${e=>e.explanationCard};
|
|
1246
|
+
--color-explain-dialog-scroll-shadow-border: ${e=>e.scrollShadowBorder};
|
|
1247
|
+
--backdrop-filter-explain-dialog: ${e=>e.backdropFilter};
|
|
1248
|
+
|
|
1249
|
+
display: grid;
|
|
1250
|
+
|
|
1251
|
+
&:focus {
|
|
1252
|
+
outline: none;
|
|
1253
|
+
}
|
|
1254
|
+
`;function EV(e){const t=zi(),n=(t==null?void 0:t.displayMode)==="dialog";return $.jsx(sV,{open:n,onOpenChange:r=>!r&&n&&(t==null?void 0:t.dismiss()),children:$.jsx(TV,{...e,isOpen:n,children:O.Children.toArray(e.content)[0]??$.jsx(CV,{children:$.jsx(N3,{})})})})}function TV(e){return $.jsx(q.AnimatePresence,{initial:!1,children:e.isOpen&&$.jsx(xV,{...e,components:{Overlay:AV},children:$.jsx(r1,{children:e.children})})})}const IV=Ae(q.motion(Yx))`
|
|
1255
|
+
${n1}
|
|
1256
|
+
`;function AV(e){return $.jsx(IV,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}const $V={fill:{title:"Fill",type:q.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.7)"},color:{title:"Color",type:q.ControlType.Color,defaultValue:"#171717"},attributeValueFill:{title:"Attribute Value Fill",type:q.ControlType.Color,defaultValue:"#efefef"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:q.ControlType.Color,defaultValue:"#cfefc7"},attributeValueAddColor:{title:"Attribute Value Add Color",type:q.ControlType.Color,defaultValue:"#48c52b"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:q.ControlType.Color,defaultValue:"#ffdada"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:q.ControlType.Color,defaultValue:"#c52b2b"},headerValueColor:{title:"Header Value Color",type:q.ControlType.Color,defaultValue:"#00a1e6"},closeButtonOutline:{title:"Close Button Outline",type:q.ControlType.Color,defaultValue:"#00a1e6"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:q.ControlType.Color,defaultValue:"#F2F2F2"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:q.ControlType.Color,defaultValue:"#171717"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:q.ControlType.Color,defaultValue:"#00a1e6"},explanationCard:{title:"Explanation Card",type:q.ControlType.Color,defaultValue:"white"},scrollShadowBorder:{title:"Scroll Shadow Border",type:q.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"},backdropFilter:{title:"Backdrop Filter",type:q.ControlType.String,defaultValue:"blur(10px) saturate(200%)"}},OV={fill:{title:"Fill",type:q.ControlType.Color,defaultValue:"#002134"},color:{title:"Color",type:q.ControlType.Color,defaultValue:"white"},attributeValueFill:{title:"Attribute Value Fill",type:q.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.2)"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:q.ControlType.Color,defaultValue:"rgba(47, 255, 0, 0.2)"},attributeValueAddColor:{title:"Attribute Value Add Color",type:q.ControlType.Color,defaultValue:"#63e446"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:q.ControlType.Color,defaultValue:"#ff00004a"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:q.ControlType.Color,defaultValue:"#ff6060"},headerValueColor:{title:"Header Value Color",type:q.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},closeButtonOutline:{title:"Close Button Outline",type:q.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},listSeparator:{title:"List Separator",type:q.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:q.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:q.ControlType.Color,defaultValue:"white"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:q.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},showMoreButtonOutline:{title:"Show More Button Outline",type:q.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"}},o1=O.createContext(null);function DV(e){const[t,n]=O.useState(null),{explain:r,applySolution:i}=aC(),o=O.useRef(null),a=O.useCallback(async(p,h,v,C)=>{const E=Xh();o.current=E,n(null);try{const y=await p(),w=y,x=y,S=(w==null?void 0:w.decisionExplanations)??[],T=(x==null?void 0:x.constraintExplanations)??[];E==o.current&&n({controlId:C,displayMode:S.length===0&&T.length>0?"dialog":v,explainQuestion:h,hasError:!1,decisionExplanations:NV(S),constraintExplanations:T})}catch{E==o.current&&n({controlId:C,displayMode:v,explainQuestion:h,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=O.useCallback((p,h,v)=>{const C=typeof p=="function"?p(e0):p;return a(()=>e.explainConstraints?r(C,"full"):r(C,"decisions"),C,h,v)},[e.explainConstraints,r,a]),u=O.useCallback((p,h,v)=>a(()=>Promise.resolve(p),null,h,v),[a]),c=O.useCallback(()=>{n(null)},[]),l=O.useCallback(async p=>{await i(p),c()},[i,c]),f=O.useCallback(p=>{n(h=>h!=null?{...h,displayMode:p}:h)},[]),d=O.useMemo(()=>({process:t,applySolution:l,explain:s,handleExplainAnswer:u,dismiss:c,switchMode:f}),[t,l,s,u,c,f]);return $.jsx(ru.Provider,{value:d,children:e.children})}function NV(e){const t=b(cR,Vm(r=>r.solution==null)),n=b($w,Vm(r=>r.causedByDecisions.length));return b(e,aP([t,n]))}const a1=Za(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:r,sessionCreateUrl:i,sessionDeleteUrl:o,deploymentName:a,channel:s,children:u,explainDialogProps:c,explainPopoverProps:l,explainConstraints:f}=e;if(Dn())return u;const d=O.useMemo(()=>xM({hcaEngineBaseUrl:n3(t,"api","engine"),sessionHandler:Y(n).with("client-side",()=>({accessToken:r})).with("server-side",()=>({sessionCreateUrl:i,sessionDeleteUrl:o})).exhaustive()}),[t,n,r,i,o]);return $.jsxs($.Fragment,{children:[$.jsxs(Cq,{configuratorClient:d,configurationModelSource:{type:Mi.Channel,channel:s,deploymentName:a},allowedInExplain:{rules:{type:pn.all}},children:[$.jsx(r3,{...e}),$.jsx(O.Suspense,{children:$.jsx(xq,{children:$.jsxs(DV,{explainConstraints:f,children:[$.jsx(o1.Provider,{value:l,children:u}),$.jsx(EV,{...c})]})})})]}),$.jsx(d3,{})]})}),PV=a1;q.addPropertyControls(a1,{children:{title:"Content",type:q.ControlType.ComponentInstance},channel:{type:q.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:q.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:q.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:q.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:q.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:q.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:q.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:q.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:q.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:q.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:q.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:q.ControlType.Object,optional:!1,controls:$V,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:q.ControlType.Object,optional:!1,controls:OV,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:q.ControlType.Boolean,defaultValue:!1}});const Ro={attributeId:{title:"Attribute Id",type:q.ControlType.String},componentPath:{title:"Component Path",type:q.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:q.ControlType.String}},s1={padding:{type:q.ControlType.FusedNumber,title:"Padding",toggleKey:"isMixedPadding",toggleTitles:["Padding","Padding per Side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:0}},RV=e=>({paddingTop:e.isMixedPadding?e.paddingTop:e.padding,paddingRight:e.isMixedPadding?e.paddingRight:e.padding,paddingBottom:e.isMixedPadding?e.paddingBottom:e.padding,paddingLeft:e.isMixedPadding?e.paddingLeft:e.padding}),kV={radius:{title:"Radius",type:q.ControlType.Number,defaultValue:6},...s1,border:{title:"Border",type:q.ControlType.Object,controls:{color:{type:q.ControlType.Color,title:"Color"},width:{type:q.ControlType.FusedNumber,title:"Width",toggleKey:"isMixedWidth",toggleTitles:["Width","Width per Side"],valueKeys:["widthTop","widthRight","widthBottom","widthLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:0}}}},MV=e=>{var t,n,r,i,o,a,s,u,c,l,f,d,p;return{borderRadius:e.radius,borderColor:(t=e.border)==null?void 0:t.color,borderTopWidth:(n=e.border)!=null&&n.isMixedWidth?(r=e.border)==null?void 0:r.widthTop:(i=e.border)==null?void 0:i.width,borderRightWidth:(o=e.border)!=null&&o.isMixedWidth?(a=e.border)==null?void 0:a.widthRight:(s=e.border)==null?void 0:s.width,borderBottomWidth:(u=e.border)!=null&&u.isMixedWidth?(c=e.border)==null?void 0:c.widthBottom:(l=e.border)==null?void 0:l.width,borderLeftWidth:(f=e.border)!=null&&f.isMixedWidth?(d=e.border)==null?void 0:d.widthLeft:(p=e.border)==null?void 0:p.width}},jV={fill:{title:"Fill",type:q.ControlType.Color,defaultValue:"#EBEBEB"},...s1,...kV},_V=e=>({...RV(e),...MV(e),backgroundColor:e.fill}),qV={color:{title:"Color",type:q.ControlType.Color,defaultValue:"black"},fontSize:{title:"Font size",type:q.ControlType.Number,defaultValue:16}},FV=e=>({color:e.color,fontSize:e.fontSize}),Nu={explain:{title:"Explain",type:q.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},Xp={type:q.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:q.ControlType.Color,optional:!0},color:{title:"Color",type:q.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:q.ControlType.Color,optional:!0}}},u1={...Ro,...qV,...jV,implicitLabelPrefix:{title:"Implicit Label Prefix",type:q.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...Xp,title:"Unsatisfied Colors"},implicitSelectedColors:{...Xp,title:"Implicit Selected Colors"},...Nu},Jp=(e,t,n)=>{var r,i,o,a,s,u;const c=_V(e),l=FV(e);return{...c,...l,backgroundColor:Y({isSatisfied:t,isImplicitSelected:n,unsatisfiedFill:(r=e.unsatisfiedColors)==null?void 0:r.fill,implicitSelectedFill:(i=e.implicitSelectedColors)==null?void 0:i.fill}).with({isSatisfied:!1,unsatisfiedFill:Ve.string.minLength(1)},f=>f.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:Ve.string.minLength(1)},f=>f.implicitSelectedFill).otherwise(()=>c.backgroundColor),borderColor:Y({isSatisfied:t,isImplicitSelected:n,unsatisfiedBorderColor:(o=e.unsatisfiedColors)==null?void 0:o.borderColor,implicitSelectedBorderColor:(a=e.implicitSelectedColors)==null?void 0:a.borderColor}).with({isSatisfied:!1,unsatisfiedBorderColor:Ve.string.minLength(1)},f=>f.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:Ve.string.minLength(1)},f=>f.implicitSelectedBorderColor).otherwise(()=>c.borderColor),color:Y({isSatisfied:t,isImplicitSelected:n,unsatisfiedColor:(s=e.unsatisfiedColors)==null?void 0:s.color,implicitSelectedColor:(u=e.implicitSelectedColors)==null?void 0:u.color}).with({isSatisfied:!1,unsatisfiedColor:Ve.string.minLength(1)},f=>f.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:Ve.string.minLength(1)},f=>f.implicitSelectedColor).otherwise(()=>l.color),...e.style}},Gv={...u1,resetLabel:{title:"Reset Label",type:q.ControlType.String,defaultValue:"Reset"}},Na=(e,t,n)=>Jp(e,t,n);function Nr(e){var t;return{localId:e.attributeId,componentPath:e.componentPath===""?[]:((t=e.componentPath)==null?void 0:t.split(" -> "))??[],sharedConfigurationModelId:e.sharedConfigurationModel===""?null:e.sharedConfigurationModel}}function Wi(){const{explain:e,handleExplainAnswer:t}=O.useContext(ru);return{explain:e,handleExplainAnswer:t}}function LV(e={}){const{initialOpen:t=!1,placement:n="top",modal:r=!1,open:i,onOpenChange:o,arrow:a}=e,[s,u]=O.useState(t),c=i??s,l=o??u,f=Qx({placement:n,open:c,onOpenChange:l,whileElementsMounted:vB,middleware:[Q3(((a==null?void 0:a.height)??0)+5),yB({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),mB({padding:5}),...a?[bB(a)]:[]]}),d=f.context,p=Xx(d,{enabled:i==null}),h=Jx(d),v=Zx([p,h]);return O.useMemo(()=>({open:c,setOpen:l,...v,...f,modal:r,arrow:a}),[c,l,v,f,r,a])}const c1=O.createContext(null),Pu=()=>{const e=O.useContext(c1);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function BV({children:e,...t}){const n=LV(t);return $.jsx(c1.Provider,{value:n,children:e})}const VV=O.forwardRef(function(e,t){const n=O.Children.toArray(e.children)[0],r=Pu(),i=e.children.ref,o=Lv([r.refs.setReference,t,i]);return O.isValidElement(n)?O.cloneElement(n,r.getReferenceProps({ref:o,...e,...n.props,"data-state":r.open?"open":"closed"})):$.jsx("span",{children:"Not valid children for PopoverTrigger"})}),UV=VV,GV=Ae.div`
|
|
1257
|
+
display: flex;
|
|
1258
|
+
justify-content: center;
|
|
1259
|
+
|
|
1260
|
+
// The Webstorm formatter doesn't support container queries and would be break it.
|
|
1261
|
+
// @formatter:off
|
|
1262
|
+
@container explain-actions (min-width: 300px) {
|
|
1263
|
+
justify-content: start;
|
|
1264
|
+
}
|
|
1265
|
+
`,zV=Ae.button`
|
|
1266
|
+
color: inherit;
|
|
1267
|
+
font-size: 0.9em;
|
|
1268
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1269
|
+
font-weight: 500;
|
|
1270
|
+
appearance: none;
|
|
1271
|
+
border: none;
|
|
1272
|
+
border-radius: var(--shape-border-radius-xs);
|
|
1273
|
+
margin-top: 0.9em;
|
|
1274
|
+
text-decoration: underline;
|
|
1275
|
+
cursor: pointer;
|
|
1276
|
+
background-color: transparent;
|
|
1277
|
+
|
|
1278
|
+
&:focus {
|
|
1279
|
+
outline: 2px solid var(--color-explain-popover-show-more-button-outline);
|
|
1280
|
+
outline-offset: 1px;
|
|
1281
|
+
}
|
|
1282
|
+
`;function WV(){const{decisionExplanations:e,switchMode:t}=zi(),n=e.length-1;return $.jsx(GV,{children:$.jsxs(zV,{onClick:()=>t("dialog"),children:[n>0&&$.jsxs("span",{children:["Show more (",n,")"]}),n===0&&$.jsx("span",{children:"Show Constraints"})]})})}const HV=Ae.div`
|
|
1283
|
+
font-weight: 500;
|
|
1284
|
+
font-family: var(--font-heading);
|
|
1285
|
+
margin-bottom: var(--space-xs);
|
|
1286
|
+
`,Qg=Ae.div`
|
|
1287
|
+
height: 1px;
|
|
1288
|
+
background-color: var(--color-explain-popover-list-separator);
|
|
1289
|
+
margin-left: -1.1em;
|
|
1290
|
+
margin-right: -1.1em;
|
|
1291
|
+
|
|
1292
|
+
@media only screen and (min-resolution: 2dppx) {
|
|
1293
|
+
height: 0.5px;
|
|
1294
|
+
}
|
|
1295
|
+
`,KV=Ae.div`
|
|
1296
|
+
container: explain-actions / inline-size;
|
|
1297
|
+
`,YV=Ae(yx)`
|
|
1298
|
+
display: grid;
|
|
1299
|
+
grid-template-columns: [name] minmax(100px, auto) [values] minmax(100px, 1fr);
|
|
1300
|
+
gap: var(--space-sm);
|
|
1301
|
+
padding-top: var(--space-xs);
|
|
1302
|
+
padding-bottom: var(--space-xs);
|
|
1303
|
+
padding-right: 1.1em;
|
|
1304
|
+
margin-right: -1.1em;
|
|
1305
|
+
overflow: auto;
|
|
1306
|
+
max-height: 200px;
|
|
1307
|
+
`,XV=Ae(mx)`
|
|
1308
|
+
border-radius: 360px;
|
|
1309
|
+
background-color: var(--color-explain-popover-apply-solution-button-fill);
|
|
1310
|
+
color: var(--color-explain-popover-apply-solution-button-color);
|
|
1311
|
+
font-size: 0.9em;
|
|
1312
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1313
|
+
font-weight: 600;
|
|
1314
|
+
appearance: none;
|
|
1315
|
+
padding: 0.6em 2em;
|
|
1316
|
+
border: none;
|
|
1317
|
+
width: 100%;
|
|
1318
|
+
margin-top: 1.1em;
|
|
1319
|
+
|
|
1320
|
+
&:focus {
|
|
1321
|
+
outline: 2px solid var(--color-explain-popover-apply-solution-button-outline);
|
|
1322
|
+
outline-offset: 1px;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
// The Webstorm formatter doesn't support container queries and would be break it.
|
|
1326
|
+
// @formatter:off
|
|
1327
|
+
@container explain-actions (min-width: 300px) {
|
|
1328
|
+
width: auto;
|
|
1329
|
+
}
|
|
1330
|
+
`,fd=Ae(bx)`
|
|
1331
|
+
width: min-content;
|
|
1332
|
+
min-width: 300px;
|
|
1333
|
+
`;function JV(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=zi();if(n)return $.jsx(fd,{variant:"failedToExplain"});const r=e[0];if(!r)return $.jsx(fd,{variant:"noExplanationFound"});if(!r.solution)return $.jsx(fd,{variant:"noSolutionFound"});const i=r.solution.decisions.filter(o=>o.state!=null);return $.jsxs($.Fragment,{children:[$.jsx(HV,{children:"Solution"}),$.jsx(Qg,{}),$.jsx(YV,{blockingDecisions:r.causedByDecisions,desiredDecisions:i}),$.jsx(Qg,{}),$.jsxs(KV,{children:[$.jsx(XV,{explanation:r,children:"Apply solution"}),(e.length>1||t.length>0)&&$.jsx(WV,{})]})]})}const l1=O.createContext(null),li=()=>O.useContext(l1);function QV(e){return O.forwardRef((t,n)=>{const r=O.useId();return $.jsx(l1.Provider,{value:r,children:$.jsx(e,{...t,ref:n})})})}const ZV=O.forwardRef((e,t)=>{const{style:n,children:r,...i}=e,o=Pu(),a=Lv([o.refs.setFloating,t]);return $.jsx(Wx,{children:$.jsx(Kx,{context:o.context,modal:o.modal,children:$.jsx("div",{ref:a,style:{...o.floatingStyles,...n},...o.getFloatingProps(i),children:r})})})}),eU=ZV,tU=O.forwardRef((e,t)=>{const{setOpen:n}=Pu();return $.jsx("button",{type:"button",ref:t,...e,onClick:r=>{var i;(i=e.onClick)==null||i.call(e,r),n(!1)}})}),nU=tU,rU=Ae.div`
|
|
1334
|
+
position: relative;
|
|
1335
|
+
background-color: var(--color-explain-popover-fill);
|
|
1336
|
+
color: var(--color-explain-popover-color);
|
|
1337
|
+
outline-offset: -1px;
|
|
1338
|
+
padding: 1.1em;
|
|
1339
|
+
border-radius: var(--shape-border-radius-md);
|
|
1340
|
+
font-size: var(--text-base-size);
|
|
1341
|
+
font-family: var(--font-primary);
|
|
1342
|
+
min-width: 300px;
|
|
1343
|
+
max-width: 500px;
|
|
1344
|
+
`,iU=Ae(nU)`
|
|
1345
|
+
position: absolute;
|
|
1346
|
+
right: var(--space-sm-fixed);
|
|
1347
|
+
top: var(--space-sm-fixed);
|
|
1348
|
+
border: none;
|
|
1349
|
+
background-color: transparent;
|
|
1350
|
+
color: inherit;
|
|
1351
|
+
font-size: var(--text-sm);
|
|
1352
|
+
cursor: pointer;
|
|
1353
|
+
border-radius: var(--shape-border-radius-xs);
|
|
1354
|
+
|
|
1355
|
+
&:focus {
|
|
1356
|
+
outline: 2px solid var(--color-explain-popover-close-button-outline);
|
|
1357
|
+
outline-offset: 1px;
|
|
1358
|
+
}
|
|
1359
|
+
`,oU=Ae(i1)`
|
|
1360
|
+
font-size: var(--text-md);
|
|
1361
|
+
font-weight: 500;
|
|
1362
|
+
font-family: var(--font-heading);
|
|
1363
|
+
margin-bottom: var(--space-xs);
|
|
1364
|
+
overflow: hidden;
|
|
1365
|
+
display: flex;
|
|
1366
|
+
white-space: nowrap;
|
|
1367
|
+
text-overflow: ellipsis;
|
|
1368
|
+
margin-right: var(--space-md);
|
|
1369
|
+
`;function aU(e){return $.jsxs(rU,{children:[$.jsx(oU,{}),e.children,$.jsx(iU,{children:$.jsx(Fi,{icon:PC})})]})}const sU=Ae(eU)`
|
|
1370
|
+
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
1371
|
+
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
1372
|
+
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
1373
|
+
--color-explain-attribute-value-remove-fill: ${e=>e.attributeValueRemoveFill};
|
|
1374
|
+
--color-explain-attribute-value-remove-color: ${e=>e.attributeValueRemoveColor};
|
|
1375
|
+
--color-explain-header-value-color: ${e=>e.headerValueColor};
|
|
1376
|
+
--color-explain-popover-fill: ${e=>e.fill};
|
|
1377
|
+
--color-explain-popover-color: ${e=>e.color};
|
|
1378
|
+
--color-explain-popover-close-button-outline: ${e=>e.closeButtonOutline};
|
|
1379
|
+
--color-explain-popover-list-separator: ${e=>e.listSeparator};
|
|
1380
|
+
--color-explain-popover-apply-solution-button-fill: ${e=>e.applySolutionButtonFill};
|
|
1381
|
+
--color-explain-popover-apply-solution-button-color: ${e=>e.applySolutionButtonColor};
|
|
1382
|
+
--color-explain-popover-apply-solution-button-outline: ${e=>e.applySolutionButtonOutline};
|
|
1383
|
+
--color-explain-popover-show-more-button-outline: ${e=>e.showMoreButtonOutline};
|
|
1384
|
+
|
|
1385
|
+
z-index: 10;
|
|
1386
|
+
filter: var(--shadows-popover);
|
|
1387
|
+
|
|
1388
|
+
&:focus {
|
|
1389
|
+
outline: none;
|
|
1390
|
+
}
|
|
1391
|
+
`,uU=Ae(GB)`
|
|
1392
|
+
fill: var(--color-explain-popover-fill);
|
|
1393
|
+
`,cU={initial:{opacity:0,scale:0},open:{opacity:1,scale:1,transition:{type:"spring",stiffness:600,damping:40}},close:{opacity:0,scale:0,transition:{duration:.2,ease:"cubicInOut"}}};function lU(e){const t=zi(),n=li(),r=(t==null?void 0:t.displayMode)==="popover"&&(t==null?void 0:t.controlId)===n,i=O.useRef(null);return $.jsxs(BV,{open:r,onOpenChange:o=>!o&&r&&(t==null?void 0:t.dismiss()),arrow:{width:20,height:10,padding:10,element:i},children:[$.jsx(UV,{children:e.children}),$.jsxs(fU,{isOpen:r,children:[O.Children.toArray(e.content)[0]??$.jsx(aU,{children:$.jsx(JV,{})}),$.jsx(dU,{})]})]})}function fU(e){var t,n;const r=O.useContext(o1),{middlewareData:i,arrow:o,placement:a}=Pu(),s=((t=i.arrow)==null?void 0:t.x)??0,u=((n=i.arrow)==null?void 0:n.y)??0,c=(o==null?void 0:o.height)??0,l=(o==null?void 0:o.width)??0,f=s+l/2,d=u+c,p=Y(a).with("top",()=>`${f}px calc(100% + ${c+5}px)`).with("bottom",()=>`${f}px ${-c-5}px`).with("left",()=>`calc(100% + ${c}px) ${d}px`).with("right",()=>`${-c}px ${d}px`).otherwise(()=>"");return $.jsx(q.AnimatePresence,{initial:!1,children:e.isOpen&&$.jsx(sU,{...r,children:$.jsx(q.motion.div,{variants:cU,initial:"initial",animate:"open",exit:"close",style:{transformOrigin:p},children:$.jsx(r1,{children:e.children})})})})}function dU(){const{context:e,arrow:t}=Pu();return $.jsx(uU,{ref:t.element,context:e,width:t.width,height:t.height})}function pU(e){return O.forwardRef((t,n)=>{const r=Dn();return t.explain!=="popover"||r?$.jsx(e,{...t}):$.jsx(lU,{children:$.jsx(e,{...t,ref:n})})})}function Hi(e){return Za(QV(pU(O.forwardRef(e))))}function Pr(){alert(`Failed to apply your selection.
|
|
1394
|
+
Please check your internet connection and try again.`)}function hU(){alert(`Failed to reset your configuration.
|
|
1395
|
+
Please check your internet connection and try again.`)}const Zg=Ae.select`
|
|
199
1396
|
color: inherit;
|
|
200
|
-
`,
|
|
1397
|
+
`,eb="<reset>",tb="<nothing>",f1=Hi((e,t)=>{if(Dn()){const S=Na(e,!0,!1);return $.jsx(Zg,{style:S})}const n=li(),r=Nr(e),i=sC(r),{explain:o}=Wi();if(!i)return $.jsx("span",{children:"Choice Attribute not found"});const{attribute:a,makeDecision:s,clearDecisions:u}=i,c=An.getAllowedChoiceValues(a),l=An.getBlockedChoiceValues(a),f=An.isMultiSelect(a),d=An.getSelectedChoiceValues(a),p=d.map(S=>S.id),h=p[0]??tb,v=d.some(S=>{var T;return((T=S.decision)==null?void 0:T.kind)===Oe.Explicit}),C=p.length>=1,E=d.some(S=>{var T;return((T=S.decision)==null?void 0:T.kind)===Oe.Implicit}),y=c.length===0,w=async S=>{if(S===eb)try{await u()}catch{Pr()}else if(c.some(T=>T.id===S)){const T=p.some(A=>A===S)?void 0:xt.Included;try{await s(S,T)}catch{Pr()}}else l.some(T=>T.id===S)&&e.explain!=="disabled"&&await o(T=>T.whyIsStateNotPossible.choice(a.id).choiceValue(S).state(xt.Included),e.explain,n)},x=yU(e,a.isSatisfied,E,y);return $.jsxs(Zg,{ref:t,value:f?p:h,multiple:f,onChange:S=>w(S.currentTarget.value),style:x,children:[!C&&!f&&$.jsx("option",{value:tb}),v&&$.jsx("option",{value:eb,children:e.resetLabel}),c.map(S=>{var T;return $.jsxs("option",{value:S.id,children:[((T=S.decision)==null?void 0:T.kind)===Oe.Implicit?e.implicitLabelPrefix:"",S.id]},S.id)}),l.length>0&&$.jsx("optgroup",{label:"Blocked",children:l.map(S=>$.jsx("option",{value:S.id,children:S.id},S.id))})]})}),vU=f1,mU={...Gv,noOptionsAvailableColors:{...Xp,title:"No Options Available Colors"}};q.addPropertyControls(f1,mU);const yU=(e,t,n,r)=>{var i,o,a;const s=Na(e,t,n);return{...s,backgroundColor:Y({noOptionsAvailable:r,noOptionsAvailableFill:(i=e.noOptionsAvailableColors)==null?void 0:i.fill}).with({noOptionsAvailable:!0,noOptionsAvailableFill:Ve.string.minLength(1)},u=>u.noOptionsAvailableFill).otherwise(()=>s.backgroundColor),borderColor:Y({noOptionsAvailable:r,noOptionsAvailableBorderColor:(o=e.noOptionsAvailableColors)==null?void 0:o.borderColor}).with({noOptionsAvailable:!0,noOptionsAvailableBorderColor:Ve.string.minLength(1)},u=>u.noOptionsAvailableBorderColor).otherwise(()=>s.borderColor),color:Y({noOptionsAvailable:r,noOptionsAvailableColor:(a=e.noOptionsAvailableColors)==null?void 0:a.color}).with({noOptionsAvailable:!0,noOptionsAvailableColor:Ve.string.minLength(1)},u=>u.noOptionsAvailableColor).otherwise(()=>s.color)}},nb=Ae.select`
|
|
201
1398
|
color: inherit;
|
|
202
|
-
`,
|
|
1399
|
+
`,rb="<reset>",dd="<nothing>",pd="yes",ib="no",d1=Hi((e,t)=>{var n,r,i;if(Dn()){const x=Na(e,!0,!1);return $.jsx(nb,{style:x})}const o=li(),a=Nr(e),s=rq(a),{explain:u}=Wi();if(!s)return $.jsx("span",{children:"Boolean Attribute not found"});const{attribute:c,makeDecision:l}=s,f=async x=>{const S=An.getBooleanDecision(c)!=null;if(x===rb&&S)try{await l(void 0)}catch{Pr()}else{const T=x===pd;if(An.isBooleanValuePossible(c,T))try{await l(T)}catch{Pr()}else e.explain!=="disabled"&&await u(A=>A.whyIsStateNotPossible.boolean(c.id).state(T),e.explain,o)}},d=Y((n=c.decision)==null?void 0:n.state).with(!0,()=>pd).with(!1,()=>ib).otherwise(()=>dd),p=((r=c.decision)==null?void 0:r.kind)===Oe.Explicit,h=((i=c.decision)==null?void 0:i.kind)===Oe.Implicit,v=Na(e,c.isSatisfied,h),C=An.isBooleanValuePossible(c,!0),E=An.isBooleanValuePossible(c,!1),y=$.jsxs("option",{value:pd,children:[ob(c,!0,e.implicitLabelPrefix),e.trueLabel]}),w=$.jsxs("option",{value:ib,children:[ob(c,!1,e.implicitLabelPrefix),e.falseLabel]});return $.jsxs(nb,{ref:t,value:d,onChange:x=>f(x.currentTarget.value),style:v,children:[d===dd&&$.jsx("option",{value:dd}),p&&$.jsx("option",{value:rb,children:e.resetLabel}),C&&y,E&&w,(!C||!E)&&$.jsxs("optgroup",{label:"Blocked",children:[!C&&y,!E&&w]})]})}),gU=d1,ob=(e,t,n)=>{var r,i;return((r=e.decision)==null?void 0:r.kind)===Oe.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},bU={...Gv,trueLabel:{title:"True Label",type:q.ControlType.String,defaultValue:"Yes"},falseLabel:{title:"False Label",type:q.ControlType.String,defaultValue:"No"}};q.addPropertyControls(d1,bU);const ab=Ae.select`
|
|
203
1400
|
color: inherit;
|
|
204
|
-
`,
|
|
1401
|
+
`,sb="<reset>",hd="<nothing>",vd="included",md="excluded",p1=Hi((e,t)=>{var n,r,i;if(Dn()){const S=Na(e,!0,!1);return $.jsx(ab,{style:S})}const o=li(),a=Nr(e),s=iq(a),{explain:u}=Wi();if(!s)return $.jsx("span",{children:"Component Attribute not found"});const{attribute:c,makeDecision:l}=s,f=async S=>{if(An.isComponentStatePossible(c,S))try{await l(S)}catch{Pr()}else e.explain!=="disabled"&&await u(T=>T.whyIsStateNotPossible.component(c.id).state(S),e.explain,o)},d=async S=>{var T;const A=((T=c.decision)==null?void 0:T.kind)===Oe.Explicit;S===sb&&A?await l(void 0):S===vd?await f(ut.Included):S===md&&await f(ut.Excluded)},p=Y((n=c.decision)==null?void 0:n.state).with(ut.Included,()=>vd).with(ut.Excluded,()=>md).otherwise(()=>hd),h=((r=c.decision)==null?void 0:r.kind)===Oe.Explicit,v=((i=c.decision)==null?void 0:i.kind)===Oe.Implicit,C=Na(e,c.isSatisfied,v),E=An.isComponentStatePossible(c,ut.Included),y=An.isComponentStatePossible(c,ut.Excluded),w=$.jsxs("option",{value:vd,children:[ub(c,ut.Included,e.implicitLabelPrefix),e.includedLabel]}),x=$.jsxs("option",{value:md,children:[ub(c,ut.Excluded,e.implicitLabelPrefix),e.excludedLabel]});return $.jsxs(ab,{ref:t,value:p,onChange:S=>d(S.currentTarget.value),style:C,children:[p===hd&&$.jsx("option",{value:hd}),h&&$.jsx("option",{value:sb,children:e.resetLabel}),E&&w,y&&x,(!E||!y)&&$.jsxs("optgroup",{label:"Blocked",children:[!E&&w,!y&&x]})]})}),SU=p1,ub=(e,t,n)=>{var r,i;return((r=e.decision)==null?void 0:r.kind)===Oe.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},wU={...Gv,includedLabel:{title:"Included Label",type:q.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:q.ControlType.String,defaultValue:"Excluded"}};q.addPropertyControls(p1,wU);function h1(e,t,n,r,i=1e3){const[o]=T1.useForceUpdate(),a=K5(d=>{t(d),o()},i),s=O.useRef(n),u=O.useRef(e),c=a.isPending(),l=O.useRef(c);O.useEffect(()=>{e!==u.current&&(u.current=e,c&&(a.cancel(),o()),e!==n&&r(e)),n!==s.current&&(s.current=n,n!==e?(a(n),o()):c&&(a.cancel(),o())),c!==l.current&&(l.current=c,!c&&e!==n&&r(e))},[e,n,a,c]);const f=O.useCallback(()=>{a.isPending()&&a.flush()},[a]);return O.useEffect(()=>()=>f(),[f]),{flush:f}}const cb=Ae(hx)`
|
|
205
1402
|
color: inherit;
|
|
206
|
-
`,Qm=Tn(e=>{var t,n;if(nn()){const p=Nl(e,!0,!1);return X.jsx(Bp,{style:p})}const i=ri(e),r=gO(i);if(!r)return X.jsx("span",{children:"Numeric Attribute not found"});const{attribute:o,makeDecision:a}=r,u=((t=o.decision)==null?void 0:t.kind)===pe.Implicit,s=Nl(e,o.isSatisfied,u),c=(n=o.decision)==null?void 0:n.state,[l,f]=M.useState(c),d=Xm(c,a,l,p=>f(p),e.wait);return X.jsx(Bp,{thousandsGroupStyle:"thousand",decimalSeparator:e.decimalSeparator,thousandSeparator:e.thousandSeparator,allowNegative:!0,fixedDecimalScale:!0,decimalScale:o.decimalPlaces,allowEmptyFormatting:!1,displayType:"input",placeholder:e.placeholder,prefix:xP(o,e.implicitLabelPrefix),onBlur:()=>{d.flush()},onKeyPress:p=>{p.key==="Enter"&&d.flush()},onValueChange:p=>f(p.floatValue),value:l??"",style:s})}),EP=Qm,xP=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===pe.Implicit?t:""},$P={...Hm,wait:{title:"Debounce Delay",type:F.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:F.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:F.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:F.ControlType.String,defaultValue:""}};F.addPropertyControls(Qm,$P);const Vu={choiceValueId:{title:"Choice Value Id",type:F.ControlType.String}};function Va(e,t){return M.Children.map(e,n=>M.isValidElement(n)?M.cloneElement(n,t):n)}const Zm=Tn(e=>{if(nn())return e.children;const{makeDecision:t}=Ji(),n=ri(e),i=e.choiceValueId??"",r=i.length>0,o=Ba([n])[0];if(!o)return X.jsx("span",{children:"Attribute not found"});const a=o.type===q.Choice,u=o.type===q.Numeric,s=o.type===q.Boolean,c=o.type===q.Component;if(!a&&r)return X.jsx("span",{children:"Attribute is not a Choice Attribute"});if(u)return X.jsx("span",{children:"Numeric Attribute is not supported"});let l=a?o.values.find(v=>v.id===i):null;if(r&&l==null)return X.jsx("span",{children:"Choice Value not found"});const f=v=>W({state:v,attribute:o}).with({attribute:{type:q.Choice},state:"undefined"},()=>l.decision==null).with({attribute:{type:q.Choice},state:"included"},()=>{var w,C;return((w=l.decision)==null?void 0:w.state)===nt.Included&&((C=l.decision)==null?void 0:C.kind)===pe.Explicit}).with({attribute:{type:q.Choice},state:"excluded"},()=>{var w,C;return((w=l.decision)==null?void 0:w.state)===nt.Excluded&&((C=l.decision)==null?void 0:C.kind)===pe.Explicit}).with({attribute:{type:q.Boolean},state:"undefined"},{attribute:{type:q.Component},state:"undefined"},({attribute:w})=>w.decision==null).with({attribute:{type:q.Boolean},state:"true"},({attribute:w})=>{var C,S;return((C=w.decision)==null?void 0:C.state)===!0&&((S=w.decision)==null?void 0:S.kind)===pe.Explicit}).with({attribute:{type:q.Boolean},state:"false"},({attribute:w})=>{var C,S;return((C=w.decision)==null?void 0:C.state)===!1&&((S=w.decision)==null?void 0:S.kind)===pe.Explicit}).with({attribute:{type:q.Component},state:"included"},({attribute:w})=>{var C,S;return((C=w.decision)==null?void 0:C.state)===Fe.Included&&((S=w.decision)==null?void 0:S.kind)===pe.Explicit}).with({attribute:{type:q.Component},state:"excluded"},({attribute:w})=>{var C,S;return((C=w.decision)==null?void 0:C.state)===Fe.Excluded&&((S=w.decision)==null?void 0:S.kind)===pe.Explicit}).otherwise(()=>!1),d=v=>W({isChoiceAttribute:a,isBooleanAttribute:s,isComponentAttribute:c,state:v}).with({isChoiceAttribute:!0,state:"included"},()=>nt.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>nt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Fe.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Fe.Excluded).otherwise(()=>null);f(e.toggleFrom);const p=f(e.toggleTo),h=()=>{const v=p?e.toggleFrom:e.toggleTo;t({type:o.type,attributeId:n,choiceValueId:i,state:d(v)})};return Va(e.children,{onClick:h})}),AP=Zm,DP={...Ir,...Vu,children:{title:"Children",type:F.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:F.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:F.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]}};F.addPropertyControls(Zm,DP);const eg=Tn(e=>{if(nn())return e.children;const{makeDecision:t}=Ji(),n=ri(e),i=e.choiceValueId??"",r=i.length>0,o=Ba([n])[0],a=Sm(n);if(!o)return X.jsx("span",{children:"Attribute not found"});const u=o.type===q.Choice,s=o.type===q.Numeric,c=o.type===q.Boolean,l=o.type===q.Component;if(!u&&r)return X.jsx("span",{children:"Attribute is not a Choice Attribute"});let f=u?o.values.find(h=>h.id===i):null;if(r&&f==null)return X.jsx("span",{children:"Choice Value not found"});const d=()=>W({isChoiceAttribute:u,isBooleanAttribute:c,isComponentAttribute:l,isNumericAttribute:s,hasChoiceValueId:r,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>nt.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>nt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Fe.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Fe.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),p=()=>{u&&!r&&e.setSelection==="undefined"?a.clearDecisions():t({type:o.type,attributeId:n,choiceValueId:i,state:d()})};return Va(e.children,{onClick:p})}),OP=eg,NP={...Ir,...Vu,children:{title:"Children",type:F.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:F.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:F.ControlType.Number,defaultValue:0}};F.addPropertyControls(eg,NP);const tg=Tn(e=>{var t;if(nn())return e.children;const{setManyDecision:n}=Ji(),i=e.attributes.map(ri),r=Ba(i).map((s,c)=>{if(!s)return{error:X.jsx("span",{children:"Attribute not found"})};const l=e.attributes[c],f=l.choiceValueId??"",d=f.length>0,p=s.type===q.Choice,h=s.type===q.Numeric,v=s.type===q.Boolean,w=s.type===q.Component;if(!p&&d)return{error:X.jsx("span",{children:"Attribute is not a Choice Attribute"})};let C=p?s.values.find(T=>T.id===f):null;if(d&&C==null)return{error:X.jsx("span",{children:"Choice Value not found"})};const S=()=>W({isChoiceAttribute:p,isBooleanAttribute:v,isComponentAttribute:w,isNumericAttribute:h,hasChoiceValueId:d,state:l.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>nt.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>nt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Fe.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Fe.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>l.numericValue).otherwise(()=>null);return{getDecisions:()=>p&&!d&&l.setSelection==="undefined"?s.values.filter(T=>{var I;return((I=T.decision)==null?void 0:I.kind)===pe.Explicit}).map(T=>({type:s.type,attributeId:s.id,choiceValueId:T.id,state:null})):[{type:s.type,attributeId:s.id,choiceValueId:f,state:S()}]}}),o=(t=r.find(s=>s.error))==null?void 0:t.error;if(o)return o;const a=()=>{const s=r.reduce((l,f)=>[...l,...f.getDecisions()],new Array),c=W(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:W(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();n(s,c)},u=()=>{e.trigger==="click"&&a()};return M.useEffect(()=>{e.trigger==="auto"&&a()},[]),Va(e.children,{onClick:u})}),PP=tg,MP={children:{title:"Children",type:F.ControlType.ComponentInstance},attributes:{title:"Attributes",type:F.ControlType.Array,control:{type:F.ControlType.Object,controls:{...Ir,...Vu,setSelection:{title:"Set Selection To",type:F.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:F.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:F.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:F.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:F.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"}};F.addPropertyControls(tg,MP);const ng=Tn(e=>{if(nn())return e.enabledChildren;const{configuration:t}=Cm(),{setManyDecision:n}=Ji(),i=t.attributes.some(a=>W(a).with({type:q.Choice},u=>u.values.some(s=>{var c;return((c=s.decision)==null?void 0:c.kind)===pe.Explicit})).with({type:q.Boolean},u=>{var s;return((s=u.decision)==null?void 0:s.kind)===pe.Explicit}).with({type:q.Numeric},u=>{var s;return((s=u.decision)==null?void 0:s.kind)===pe.Explicit}).with({type:q.Component},u=>{var s;return((s=u.decision)==null?void 0:s.kind)===pe.Explicit}).exhaustive()),r=()=>{i&&n([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})},o=i?e.enabledChildren:e.disabledChildren;return Va(o,{onClick:r})}),RP=ng,_P={enabledChildren:{title:"Enabled Children",type:F.ControlType.ComponentInstance},disabledChildren:{title:"Disabled Children",type:F.ControlType.ComponentInstance}};F.addPropertyControls(ng,_P);const ig=Tn(e=>{if(nn())return e.satisfiedChildren;const{configuration:t}=Cm(),n=[...e.attributeId.length>0?[ri(e)]:[],...e.attributes.map(ri)],i=()=>{var r;const o=Ba(n).map(u=>u?{isSatisfied:u.isSatisfied}:{error:X.jsx("span",{children:"Attribute not found"})});return((r=o.find(u=>u.error))==null?void 0:r.error)||o.every(u=>u.isSatisfied)};return(n.length>0?i():t.isSatisfied)?e.satisfiedChildren:e.unsatisfiedChildren}),jP=ig,qP={satisfiedChildren:{title:"Satisfied Children",type:F.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Unsatisfied Children",type:F.ControlType.ComponentInstance},...Ir,attributes:{title:"Attributes",type:F.ControlType.Array,control:{type:F.ControlType.Object,controls:{...Ir}}}};F.addPropertyControls(ig,qP);const rg=Tn(e=>{const t=l=>W(l).with(1,()=>e.content1).with(2,()=>e.content2).with(3,()=>e.content3).with(4,()=>e.content4).with(5,()=>e.content5).with(6,()=>e.content6).with(7,()=>e.content7).with(8,()=>e.content8).with(9,()=>e.content9).with(10,()=>e.content10).otherwise(()=>null),n=e.variants.find(l=>l.useInDesignTime)||e.variants[0];if(nn())return n&&t(n.content);const i=ri(e),r=e.choiceValueId??"",o=r.length>0,a=Ba([i])[0];if(!a)return X.jsx("span",{children:"Attribute not found"});const u=a.type===q.Choice;if(!u&&o)return X.jsx("span",{children:"Attribute is not a Choice Attribute"});let s=u?a.values.find(l=>l.id===r):null;if(o&&s==null)return X.jsx("span",{children:"Choice Value not found"});const c=[...e.variants].find(({selection:l,condition:f})=>W({selection:l,condition:f,attribute:a}).with({attribute:{type:q.Choice},selection:"included",condition:"blocked"},()=>!s.possibleDecisionStates.includes(nt.Included)).with({attribute:{type:q.Choice},selection:"included",condition:"implicit"},()=>{var d,p;return((d=s.decision)==null?void 0:d.state)===nt.Included&&((p=s.decision)==null?void 0:p.kind)===pe.Implicit}).with({attribute:{type:q.Choice},selection:"included",condition:"explicit"},()=>{var d,p;return((d=s.decision)==null?void 0:d.state)===nt.Included&&((p=s.decision)==null?void 0:p.kind)===pe.Explicit}).with({attribute:{type:q.Choice},selection:"included",condition:"none"},()=>{var d;return((d=s.decision)==null?void 0:d.state)===nt.Included}).with({attribute:{type:q.Choice},selection:"excluded",condition:"blocked"},()=>!s.possibleDecisionStates.includes(nt.Excluded)).with({attribute:{type:q.Choice},selection:"excluded",condition:"implicit"},()=>{var d,p;return((d=s.decision)==null?void 0:d.state)===nt.Excluded&&((p=s.decision)==null?void 0:p.kind)===pe.Implicit}).with({attribute:{type:q.Choice},selection:"excluded",condition:"explicit"},()=>{var d,p;return((d=s.decision)==null?void 0:d.state)===nt.Excluded&&((p=s.decision)==null?void 0:p.kind)===pe.Explicit}).with({attribute:{type:q.Choice},selection:"excluded",condition:"none"},()=>{var d;return((d=s.decision)==null?void 0:d.state)===nt.Excluded}).with({attribute:{type:q.Boolean},selection:"true",condition:"blocked"},({attribute:d})=>!d.possibleDecisionStates.includes(!0)).with({attribute:{type:q.Boolean},selection:"true",condition:"implicit"},({attribute:d})=>{var p,h;return((p=d.decision)==null?void 0:p.state)===!0&&((h=d.decision)==null?void 0:h.kind)===pe.Implicit}).with({attribute:{type:q.Boolean},selection:"true",condition:"explicit"},({attribute:d})=>{var p,h;return((p=d.decision)==null?void 0:p.state)===!0&&((h=d.decision)==null?void 0:h.kind)===pe.Explicit}).with({attribute:{type:q.Boolean},selection:"true",condition:"none"},({attribute:d})=>{var p;return((p=d.decision)==null?void 0:p.state)===!0}).with({attribute:{type:q.Boolean},selection:"false",condition:"blocked"},({attribute:d})=>!d.possibleDecisionStates.includes(!1)).with({attribute:{type:q.Boolean},selection:"false",condition:"implicit"},({attribute:d})=>{var p,h;return((p=d.decision)==null?void 0:p.state)===!1&&((h=d.decision)==null?void 0:h.kind)===pe.Implicit}).with({attribute:{type:q.Boolean},selection:"false",condition:"explicit"},({attribute:d})=>{var p,h;return((p=d.decision)==null?void 0:p.state)===!1&&((h=d.decision)==null?void 0:h.kind)===pe.Explicit}).with({attribute:{type:q.Boolean},selection:"false",condition:"none"},({attribute:d})=>{var p;return((p=d.decision)==null?void 0:p.state)===!1}).with({attribute:{type:q.Component},selection:"included",condition:"blocked"},({attribute:d})=>!d.possibleDecisionStates.includes(Fe.Included)).with({attribute:{type:q.Component},selection:"included",condition:"implicit"},({attribute:d})=>{var p,h;return((p=d.decision)==null?void 0:p.state)===Fe.Included&&((h=d.decision)==null?void 0:h.kind)===pe.Implicit}).with({attribute:{type:q.Component},selection:"included",condition:"explicit"},({attribute:d})=>{var p,h;return((p=d.decision)==null?void 0:p.state)===Fe.Included&&((h=d.decision)==null?void 0:h.kind)===pe.Explicit}).with({attribute:{type:q.Component},selection:"included",condition:"none"},({attribute:d})=>{var p;return((p=d.decision)==null?void 0:p.state)===Fe.Included}).with({attribute:{type:q.Component},selection:"excluded",condition:"blocked"},({attribute:d})=>!d.possibleDecisionStates.includes(Fe.Excluded)).with({attribute:{type:q.Component},selection:"excluded",condition:"implicit"},({attribute:d})=>{var p,h;return((p=d.decision)==null?void 0:p.state)===Fe.Excluded&&((h=d.decision)==null?void 0:h.kind)===pe.Implicit}).with({attribute:{type:q.Component},selection:"excluded",condition:"explicit"},({attribute:d})=>{var p,h;return((p=d.decision)==null?void 0:p.state)===Fe.Excluded&&((h=d.decision)==null?void 0:h.kind)===pe.Explicit}).with({attribute:{type:q.Component},selection:"excluded",condition:"none"},({attribute:d})=>{var p;return((p=d.decision)==null?void 0:p.state)===Fe.Excluded}).with({attribute:{type:q.Numeric},selection:"numeric",condition:"implicit"},({attribute:d})=>{var p;return((p=d.decision)==null?void 0:p.kind)===pe.Implicit}).with({attribute:{type:q.Numeric},selection:"numeric",condition:"explicit"},({attribute:d})=>{var p;return((p=d.decision)==null?void 0:p.kind)===pe.Explicit}).with({attribute:{type:q.Numeric},selection:"numeric",condition:"none"},({attribute:d})=>d.decision!=null).with({attribute:{type:q.Choice},selection:"undefined"},()=>s.decision==null).with({attribute:{type:q.Boolean},selection:"undefined"},{attribute:{type:q.Component},state:"undefined"},{attribute:{type:q.Numeric},state:"undefined"},({attribute:d})=>d.decision==null).otherwise(()=>!1));return c&&t(c.content)}),kP=rg,BP={...Ir,...Vu,variants:{title:"Variants",type:F.ControlType.Array,maxCount:10,control:{type:F.ControlType.Object,controls:{selection:{title:"Selection",type:F.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:F.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:F.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:F.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:F.ControlType.ComponentInstance},content2:{title:"Content 2",type:F.ControlType.ComponentInstance},content3:{title:"Content 3",type:F.ControlType.ComponentInstance},content4:{title:"Content 4",type:F.ControlType.ComponentInstance},content5:{title:"Content 5",type:F.ControlType.ComponentInstance},content6:{title:"Content 6",type:F.ControlType.ComponentInstance},content7:{title:"Content 7",type:F.ControlType.ComponentInstance},content8:{title:"Content 8",type:F.ControlType.ComponentInstance},content9:{title:"Content 9",type:F.ControlType.ComponentInstance},content10:{title:"Content 10",type:F.ControlType.ComponentInstance}};F.addPropertyControls(rg,BP);const og=Tn(e=>{const t=M.useRef(),[n,i]=M.useState(null),r=M.useRef(n),o=M.useMemo(()=>e.color.startsWith("var"),[e.color]),a=o?n:e.color,u=M.useMemo(()=>{if(!a)return;const s=oP(a);return iP(`#${s}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[a]);return M.useLayoutEffect(()=>{if(o){const s=t.current&&getComputedStyle(t.current).color;s!=r.current&&(r.current=s,i(s))}}),X.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:u},children:e.children})}),UP=og,VP={children:{title:"Content",type:F.ControlType.ComponentInstance},color:{title:"Color",type:F.ControlType.Color,defaultValue:"#0000ff"}};F.addPropertyControls(og,VP);const ag=Tn(e=>{if(nn())return e.children;const{error:t}=kd();return t?Va(e.children,{onClick:t.retry}):null}),FP=ag,LP={children:{title:"Content",type:F.ControlType.ComponentInstance}};F.addPropertyControls(ag,LP);function GP(e){return t=>{const n={...t.style,width:"100%",height:"100%"};return X.jsx(e,{...t,style:n})}}const zP=Object.freeze(Object.defineProperty({__proto__:null,BooleanSelect:CP,ChoiceSelect:gP,Colorize:UP,ComponentSelect:TP,Configuration:lP,InitializationRetry:FP,NumericInput:EP,ResetConfiguration:RP,SatisfactionIndicator:jP,SelectionIndicator:kP,SelectionToggle:AP,SetSelection:OP,SetSelections:PP,useDebounceValue:Xm,useRenderPlaceholder:nn,withFullSize:GP},Symbol.toStringTag,{value:"Module"}));exports.Configurator=$w;exports.ConfiguratorFramer=zP;exports.ConfiguratorReact=TE;
|
|
1403
|
+
`,v1=Hi((e,t)=>{var n,r;if(Dn()){const C=Jp(e,!0,!1);return $.jsx(cb,{style:C})}const i=li(),o=Nr(e),a=nq(o),{explain:s}=Wi();if(!a)return $.jsx("span",{children:"Numeric Attribute not found"});const{attribute:u,makeDecision:c}=a,l=((n=u.decision)==null?void 0:n.kind)===Oe.Implicit,f=Jp(e,u.isSatisfied,l),d=(r=u.decision)==null?void 0:r.state,[p,h]=O.useState(d),v=h1(d,async C=>{try{await c(C)}catch(E){const y=E;y.type===St.ConfigurationModelNotFeasible||y.type===St.ConfigurationConflict?e.explain!=="disabled"&&await s(w=>w.whyIsStateNotPossible.numeric(u.id).state(C),e.explain,i):Pr()}},p,C=>h(C),e.wait);return $.jsx(cb,{getInputRef:t,thousandsGroupStyle:"thousand",decimalSeparator:e.decimalSeparator,thousandSeparator:e.thousandSeparator,allowNegative:!0,fixedDecimalScale:!0,decimalScale:u.decimalPlaces,allowEmptyFormatting:!1,displayType:"input",placeholder:e.placeholder,prefix:xU(u,e.implicitLabelPrefix),onBlur:()=>{v.flush()},onKeyPress:C=>{C.key==="Enter"&&v.flush()},onValueChange:C=>h(C.floatValue),value:p??"",style:f})}),CU=v1,xU=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===Oe.Implicit?t:""},EU={...u1,wait:{title:"Debounce Delay",type:q.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:q.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:q.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:q.ControlType.String,defaultValue:""}};q.addPropertyControls(v1,EU);const If={choiceValueId:{title:"Choice Value Id",type:q.ControlType.String}};function Fo(e,t){return O.Children.map(e,n=>{if(O.isValidElement(n)){const r=dx(n.props,t);return O.cloneElement(n,r)}return n})}const m1=Hi((e,t)=>{if(Dn())return e.children;const n=li(),{makeDecision:r}=Gi(),i=Nr(e),o=e.choiceValueId??"",a=o.length>0,s=Eu([i])[0],{explain:u}=Wi();if(!s)return $.jsx("span",{children:"Attribute not found"});const c=s.type===W.Choice,l=s.type===W.Numeric,f=s.type===W.Boolean,d=s.type===W.Component;if(!c&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(l)return $.jsx("span",{children:"Numeric Attribute is not supported"});let p=c?s.values.find(y=>y.id===o):null;if(a&&p==null)return $.jsx("span",{children:"Choice Value not found"});const h=y=>Y({state:y,attribute:s}).with({attribute:{type:W.Choice},state:"undefined"},()=>p.decision==null).with({attribute:{type:W.Choice},state:"included"},()=>{var w,x;return((w=p.decision)==null?void 0:w.state)===xt.Included&&((x=p.decision)==null?void 0:x.kind)===Oe.Explicit}).with({attribute:{type:W.Choice},state:"excluded"},()=>{var w,x;return((w=p.decision)==null?void 0:w.state)===xt.Excluded&&((x=p.decision)==null?void 0:x.kind)===Oe.Explicit}).with({attribute:{type:W.Boolean},state:"undefined"},{attribute:{type:W.Component},state:"undefined"},({attribute:w})=>w.decision==null).with({attribute:{type:W.Boolean},state:"true"},({attribute:w})=>{var x,S;return((x=w.decision)==null?void 0:x.state)===!0&&((S=w.decision)==null?void 0:S.kind)===Oe.Explicit}).with({attribute:{type:W.Boolean},state:"false"},({attribute:w})=>{var x,S;return((x=w.decision)==null?void 0:x.state)===!1&&((S=w.decision)==null?void 0:S.kind)===Oe.Explicit}).with({attribute:{type:W.Component},state:"included"},({attribute:w})=>{var x,S;return((x=w.decision)==null?void 0:x.state)===ut.Included&&((S=w.decision)==null?void 0:S.kind)===Oe.Explicit}).with({attribute:{type:W.Component},state:"excluded"},({attribute:w})=>{var x,S;return((x=w.decision)==null?void 0:x.state)===ut.Excluded&&((S=w.decision)==null?void 0:S.kind)===Oe.Explicit}).otherwise(()=>!1),v=y=>Y({isChoiceAttribute:c,isBooleanAttribute:f,isComponentAttribute:d,state:y}).with({isChoiceAttribute:!0,state:"included"},()=>xt.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>xt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>ut.Included).with({isComponentAttribute:!0,state:"excluded"},()=>ut.Excluded).otherwise(()=>null);h(e.toggleFrom);const C=h(e.toggleTo),E=async()=>{const y=C?e.toggleFrom:e.toggleTo,w=v(y),x=d?An.isComponentStatePossible(s,w):!1,S=f?An.isBooleanValuePossible(s,w):!1;if(c&&p.possibleDecisionStates.some(T=>T===w)||S||x||w==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:w})}catch{Pr()}else if(e.explain!=="disabled"){const T=Y({isComponentAttribute:d,isBooleanAttribute:f,isChoiceAttribute:c}).returnType().with({isChoiceAttribute:!0},()=>et.choiceValue).with({isBooleanAttribute:!0},()=>et.boolean).with({isComponentAttribute:!0},()=>et.component).otherwise(()=>null);T&&await u({question:Lt.whyIsStateNotPossible,subject:T,attributeId:i,choiceValueId:o,state:w},e.explain,n)}};return Fo(e.children,{onClick:E,ref:t})}),TU=m1,IU={...Ro,...If,children:{title:"Content",type:q.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:q.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:q.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...Nu};q.addPropertyControls(m1,IU);const y1=Hi((e,t)=>{if(Dn())return e.children;const n=li(),{makeDecision:r}=Gi(),i=Nr(e),o=e.choiceValueId??"",a=o.length>0,s=Eu([i])[0],u=sC(i),{explain:c}=Wi();if(!s)return $.jsx("span",{children:"Attribute not found"});const l=s.type===W.Choice,f=s.type===W.Numeric,d=s.type===W.Boolean,p=s.type===W.Component;if(!l&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let h=l?s.values.find(E=>E.id===o):null;if(a&&h==null)return $.jsx("span",{children:"Choice Value not found"});const v=()=>Y({isChoiceAttribute:l,isBooleanAttribute:d,isComponentAttribute:p,isNumericAttribute:f,hasChoiceValueId:a,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>xt.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>xt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>ut.Included).with({isComponentAttribute:!0,state:"excluded"},()=>ut.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),C=async()=>{if(l&&!a&&e.setSelection==="undefined")try{await u.clearDecisions()}catch{Pr()}else{const E=v(),y=p?An.isComponentStatePossible(s,E):!1,w=d?An.isBooleanValuePossible(s,E):!1,x=(l?h.possibleDecisionStates.some(S=>S===E):!1)||w||y;if(f||x||E==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:E})}catch(S){const T=S;f&&(T.type===St.ConfigurationModelNotFeasible||T.type===St.ConfigurationConflict)?e.explain!=="disabled"&&await c(A=>A.whyIsStateNotPossible.numeric(s.id).state(E),e.explain,n):Pr()}else if(e.explain!=="disabled"){const S=Y({isComponentAttribute:p,isBooleanAttribute:d,isChoiceAttribute:l}).returnType().with({isChoiceAttribute:!0},()=>et.choiceValue).with({isBooleanAttribute:!0},()=>et.boolean).with({isComponentAttribute:!0},()=>et.component).otherwise(()=>null);S&&await c({question:Lt.whyIsStateNotPossible,subject:S,attributeId:i,choiceValueId:o,state:E},e.explain,n)}}};return Fo(e.children,{onClick:C,ref:t})}),AU=y1,$U={...Ro,...If,children:{title:"Content",type:q.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:q.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:q.ControlType.Number,defaultValue:0},...Nu};q.addPropertyControls(y1,$U);const g1=Hi((e,t)=>{var n;if(Dn())return e.children;const r=li(),{setManyDecision:i}=Gi(),{handleExplainAnswer:o}=Wi(),a=e.attributes.map(Nr),s=Eu(a).map((f,d)=>{if(!f)return{error:$.jsx("span",{children:"Attribute not found"})};const p=e.attributes[d],h=p.choiceValueId??"",v=h.length>0,C=f.type===W.Choice,E=f.type===W.Numeric,y=f.type===W.Boolean,w=f.type===W.Component;if(!C&&v)return{error:$.jsx("span",{children:"Attribute is not a Choice Attribute"})};let x=C?f.values.find(T=>T.id===h):null;if(v&&x==null)return{error:$.jsx("span",{children:"Choice Value not found"})};const S=()=>Y({isChoiceAttribute:C,isBooleanAttribute:y,isComponentAttribute:w,isNumericAttribute:E,hasChoiceValueId:v,state:p.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>xt.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>xt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>ut.Included).with({isComponentAttribute:!0,state:"excluded"},()=>ut.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>p.numericValue).otherwise(()=>null);return{getDecisions:()=>C&&!v&&p.setSelection==="undefined"?f.values.filter(T=>{var A;return((A=T.decision)==null?void 0:A.kind)===Oe.Explicit}).map(T=>({type:f.type,attributeId:f.id,choiceValueId:T.id,state:null})):[{type:f.type,attributeId:f.id,choiceValueId:h,state:S()}]}}),u=(n=s.find(f=>f.error))==null?void 0:n.error;if(u)return u;const c=async()=>{const f=s.reduce((p,h)=>[...p,...h.getDecisions()],new Array),d=Y(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:Y(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(f,d)}catch(p){const h=p;(h==null?void 0:h.type)===St.ConfigurationSetManyConflict&&h.decisionExplanations?e.explain!=="disabled"&&await o(h,e.explain,r):Pr()}},l=()=>{e.trigger==="click"&&c()};return O.useEffect(()=>{e.trigger==="auto"&&c()},[]),Fo(e.children,{onClick:l,ref:t})}),OU=g1,DU={children:{title:"Content",type:q.ControlType.ComponentInstance},attributes:{title:"Attributes",type:q.ControlType.Array,control:{type:q.ControlType.Object,controls:{...Ro,...If,setSelection:{title:"Set Selection To",type:q.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:q.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:q.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:q.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:q.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...Nu};q.addPropertyControls(g1,DU);const b1=Za(e=>{if(Dn())return e.enabledChildren;const{configuration:t}=cC(),{setManyDecision:n}=Gi(),r=t.attributes.some(a=>Y(a).with({type:W.Choice},s=>s.values.some(u=>{var c;return((c=u.decision)==null?void 0:c.kind)===Oe.Explicit})).with({type:W.Boolean},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Oe.Explicit}).with({type:W.Numeric},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Oe.Explicit}).with({type:W.Component},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Oe.Explicit}).exhaustive()),i=()=>{if(r)try{n([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{hU()}},o=r?e.enabledChildren:e.disabledChildren;return Fo(o,{onClick:i})}),NU=b1,PU={enabledChildren:{title:"Content – Enabled",type:q.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:q.ControlType.ComponentInstance}};q.addPropertyControls(b1,PU);const S1=Hi((e,t)=>{if(Dn())return e.satisfiedChildren;const n=li(),{configuration:r}=cC(),{explain:i}=Wi(),o=[...e.attributeId.length>0?[Nr(e)]:[],...e.attributes.map(Nr)],a=()=>{var u;const c=Eu(o).map(f=>f?{isSatisfied:f.isSatisfied}:{error:$.jsx("span",{children:"Attribute not found"})});return((u=c.find(f=>f.error))==null?void 0:u.error)||c.every(f=>f.isSatisfied)},s=async()=>{e.explain!=="disabled"&&(o.length===0?await i(u=>u.whyIsNotSatisfied.configuration,e.explain,n):o.length===1&&await i(u=>u.whyIsNotSatisfied.attribute(o[0]),e.explain,n))};return(o.length>0?a():r.isSatisfied)?e.satisfiedChildren:Fo(e.unsatisfiedChildren,{onClick:s,ref:t})}),RU=S1,kU={satisfiedChildren:{title:"Content – Satisfied",type:q.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:q.ControlType.ComponentInstance},...Ro,attributes:{title:"Attributes",type:q.ControlType.Array,control:{type:q.ControlType.Object,controls:{...Ro}}},...Nu};q.addPropertyControls(S1,kU);const w1=Za(O.forwardRef(function(e,t){const n=f=>Y(f).with(1,()=>e.content1).with(2,()=>e.content2).with(3,()=>e.content3).with(4,()=>e.content4).with(5,()=>e.content5).with(6,()=>e.content6).with(7,()=>e.content7).with(8,()=>e.content8).with(9,()=>e.content9).with(10,()=>e.content10).otherwise(()=>null),r=e.variants.find(f=>f.useInDesignTime)||e.variants[0];if(Dn())return r&&n(r.content);const i=Nr(e),o=e.choiceValueId??"",a=o.length>0,s=Eu([i])[0];if(!s)return $.jsx("span",{children:"Attribute not found"});const u=s.type===W.Choice;if(!u&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let c=u?s.values.find(f=>f.id===o):null;if(a&&c==null)return $.jsx("span",{children:"Choice Value not found"});const l=[...e.variants].find(({selection:f,condition:d})=>Y({selection:f,condition:d,attribute:s}).with({attribute:{type:W.Choice},selection:"included",condition:"blocked"},()=>!c.possibleDecisionStates.includes(xt.Included)).with({attribute:{type:W.Choice},selection:"included",condition:"implicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===xt.Included&&((h=c.decision)==null?void 0:h.kind)===Oe.Implicit}).with({attribute:{type:W.Choice},selection:"included",condition:"explicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===xt.Included&&((h=c.decision)==null?void 0:h.kind)===Oe.Explicit}).with({attribute:{type:W.Choice},selection:"included",condition:"none"},()=>{var p;return((p=c.decision)==null?void 0:p.state)===xt.Included}).with({attribute:{type:W.Choice},selection:"excluded",condition:"blocked"},()=>!c.possibleDecisionStates.includes(xt.Excluded)).with({attribute:{type:W.Choice},selection:"excluded",condition:"implicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===xt.Excluded&&((h=c.decision)==null?void 0:h.kind)===Oe.Implicit}).with({attribute:{type:W.Choice},selection:"excluded",condition:"explicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===xt.Excluded&&((h=c.decision)==null?void 0:h.kind)===Oe.Explicit}).with({attribute:{type:W.Choice},selection:"excluded",condition:"none"},()=>{var p;return((p=c.decision)==null?void 0:p.state)===xt.Excluded}).with({attribute:{type:W.Boolean},selection:"true",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!0)).with({attribute:{type:W.Boolean},selection:"true",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!0&&((v=p.decision)==null?void 0:v.kind)===Oe.Implicit}).with({attribute:{type:W.Boolean},selection:"true",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!0&&((v=p.decision)==null?void 0:v.kind)===Oe.Explicit}).with({attribute:{type:W.Boolean},selection:"true",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===!0}).with({attribute:{type:W.Boolean},selection:"false",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!1)).with({attribute:{type:W.Boolean},selection:"false",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!1&&((v=p.decision)==null?void 0:v.kind)===Oe.Implicit}).with({attribute:{type:W.Boolean},selection:"false",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!1&&((v=p.decision)==null?void 0:v.kind)===Oe.Explicit}).with({attribute:{type:W.Boolean},selection:"false",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===!1}).with({attribute:{type:W.Component},selection:"included",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(ut.Included)).with({attribute:{type:W.Component},selection:"included",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ut.Included&&((v=p.decision)==null?void 0:v.kind)===Oe.Implicit}).with({attribute:{type:W.Component},selection:"included",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ut.Included&&((v=p.decision)==null?void 0:v.kind)===Oe.Explicit}).with({attribute:{type:W.Component},selection:"included",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===ut.Included}).with({attribute:{type:W.Component},selection:"excluded",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(ut.Excluded)).with({attribute:{type:W.Component},selection:"excluded",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ut.Excluded&&((v=p.decision)==null?void 0:v.kind)===Oe.Implicit}).with({attribute:{type:W.Component},selection:"excluded",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ut.Excluded&&((v=p.decision)==null?void 0:v.kind)===Oe.Explicit}).with({attribute:{type:W.Component},selection:"excluded",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===ut.Excluded}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"implicit"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.kind)===Oe.Implicit}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"explicit"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.kind)===Oe.Explicit}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"none"},({attribute:p})=>p.decision!=null).with({attribute:{type:W.Choice},selection:"undefined"},()=>c.decision==null).with({attribute:{type:W.Boolean},selection:"undefined"},{attribute:{type:W.Component},state:"undefined"},{attribute:{type:W.Numeric},state:"undefined"},({attribute:p})=>p.decision==null).otherwise(()=>!1));return l&&Fo(n(l.content),{ref:t})})),MU=w1,jU={...Ro,...If,variants:{title:"Variants",type:q.ControlType.Array,maxCount:10,control:{type:q.ControlType.Object,controls:{selection:{title:"Selection",type:q.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:q.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:q.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:q.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:q.ControlType.ComponentInstance},content2:{title:"Content 2",type:q.ControlType.ComponentInstance},content3:{title:"Content 3",type:q.ControlType.ComponentInstance},content4:{title:"Content 4",type:q.ControlType.ComponentInstance},content5:{title:"Content 5",type:q.ControlType.ComponentInstance},content6:{title:"Content 6",type:q.ControlType.ComponentInstance},content7:{title:"Content 7",type:q.ControlType.ComponentInstance},content8:{title:"Content 8",type:q.ControlType.ComponentInstance},content9:{title:"Content 9",type:q.ControlType.ComponentInstance},content10:{title:"Content 10",type:q.ControlType.ComponentInstance}};q.addPropertyControls(w1,jU);const C1=Za(e=>{const t=O.useRef(),[n,r]=O.useState(null),i=O.useRef(n),o=O.useMemo(()=>e.color.startsWith("var"),[e.color]),a=o?n:e.color,s=O.useMemo(()=>{if(!a)return;const u=Z5(a);return J5(`#${u}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[a]);return O.useLayoutEffect(()=>{if(o){const u=t.current&&getComputedStyle(t.current).color;u!=i.current&&(i.current=u,r(u))}}),$.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),_U=C1,qU={children:{title:"Content",type:q.ControlType.ComponentInstance},color:{title:"Color",type:q.ControlType.Color,defaultValue:"#0000ff"}};q.addPropertyControls(C1,qU);const x1=Za(e=>{if(Dn())return e.children;const{error:t}=dv();return t?Fo(e.children,{onClick:t.retry}):null}),FU=x1,LU={children:{title:"Content",type:q.ControlType.ComponentInstance}};q.addPropertyControls(x1,LU);function BU(e){return O.forwardRef((t,n)=>{const r={...t.style,width:"100%",height:"100%"};return $.jsx(e,{...t,ref:n,style:r})})}const VU=Ae.div`
|
|
1404
|
+
width: 10px;
|
|
1405
|
+
height: 10px;
|
|
1406
|
+
background-color: greenyellow;
|
|
1407
|
+
`;function E1(e){const t=O.useRef(null);return O.useEffect(()=>{if(!t.current)return;const n=setTimeout(()=>{t.current.scrollIntoView()},e.delay);return()=>clearTimeout(n)},[t.current]),$.jsx(VU,{ref:t})}const UU={delay:{title:"Delay",type:q.ControlType.Number,min:0,unit:"ms",defaultValue:0,step:1}};q.addPropertyControls(E1,UU);const GU=Object.freeze(Object.defineProperty({__proto__:null,BooleanSelect:gU,ChoiceSelect:vU,Colorize:_U,ComponentSelect:SU,Configuration:PV,InitializationRetry:FU,NumericInput:CU,ResetConfiguration:NU,SatisfactionIndicator:RU,ScrollIntoView:E1,SelectionIndicator:MU,SelectionToggle:TU,SetSelection:AU,SetSelections:OU,useDebounceValue:h1,useRenderPlaceholder:Dn,withFullSize:BU},Symbol.toStringTag,{value:"Module"}));exports.Configurator=JA;exports.ConfiguratorFramer=GU;exports.ConfiguratorReact=Q2;
|