@viamedici-spc/configurator-framer-bundle 1.1.1 → 1.2.0-alpha0002
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 +102 -102
- package/dist/index.js +4303 -4280
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),$=require("react/jsx-runtime"),D=require("framer"),Bb=require("react-dom"),pT=require("framer-motion");function Ub(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=Ub(O),hT=Ub(Bb);var vT=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))},mT=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},yT=function(e){var t=mT(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function oi(e){return e}function Dc(e){return function(){return e}}var gT=Dc(null),Gb=Dc(void 0),Vr=Gb;function Zn(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 w(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 l=arguments[0],c=1;c<arguments.length;c++)l=arguments[c](l);return l}}}var Mr=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,vT([i],r,!1))}}},bT=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))},ST=function(e){return e._tag==="None"},fh=function(e){return e._tag==="Some"},Nc={_tag:"None"},Pc=function(e){return{_tag:"Some",value:e}},CT=function(e){return e._tag==="Left"},Rc=function(e){return{_tag:"Left",left:e}},kc=function(e){return{_tag:"Right",right:e}},wT=function(e){return[e]},xT=function(e){return e.length>0},TT=function(e){return e[0]},ET=function(e){return e.slice(1)},IT=[],AT={},$T=Object.prototype.hasOwnProperty,OT=function(e){return bT([e[0]],e.slice(1),!0)};function DT(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 NT(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 zb(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):zb(e,t-1,i)}}function PT(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 zb(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 RT(e){return function(t){for(var n=Object.keys(t),r=n.length,i=PT(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function kT(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function MT(e){var t=NT(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function Wb(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var jT=function(e){return function(){return Promise.resolve().then(e)}};function _T(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var Mc=function(e,t){return w(e,Hb(t))},dh=function(e,t){return w(e,qT(t))},Hb=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},qT=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)}},ph=Mr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),gu="Task",jc={URI:gu,map:Mc},hh={URI:gu,of:yu},FT={URI:gu,map:Mc,ap:dh},vh={URI:gu,map:Mc,of:yu,ap:dh,chain:ph},LT=oi,Sm=ph,Wl={URI:gu,map:Mc,of:yu,ap:dh,chain:ph,fromIO:jT,fromTask:LT};function Kb(e){return function(t){return function(n){return e.fromEither(ST(n)?Rc(t()):kc(n.value))}}}function VT(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?kc(o):Rc(r(o)))})}}}var mh=Rc,_c=kc,Yb=function(e,t){return w(e,UT(t))},BT=function(e,t){return w(e,WT(t))},yh="Either",UT=function(e){return function(t){return Mi(t)?t:_c(e(t.right))}},GT={URI:yh,map:Yb},zT=function(e){return function(t){return Mi(t)?t:Mi(e)?e:_c(t.right(e.right))}},WT=zT,HT={URI:yh,map:Yb,ap:BT},KT=function(e){return function(t){return Mi(t)?mh(e(t.left)):t}},Jb={URI:yh,fromEither:oi},YT=Kb(Jb),Mi=CT,JT=function(e,t){return function(n){return Mi(n)?e(n.left):t(n.right)}},ro=JT;Jb.fromEither;var XT=function(e){return Mi(e)?_c(e.left):mh(e.right)},Dn=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},bn=function(e){return Dn(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},Cm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Dn(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},gh={equals:function(e,t){return e===t}};gh.equals;var QT=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function ZT(e,t){return e<t?-1:e>t?1:0}var eE={equals:gh.equals,compare:ZT},tE=eE,nE=function(e){return{concat:QT(e)}},rE=nE,wm=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))},iE=IT,oE=xT,aE=function(e,t){return e<0||e>=t.length},sE=function(e){return function(t){return wm(wm([],t,!0),[e],!1)}},uE=sE,lE=function(e,t,n){if(n[e]===t)return n;var r=OT(n);return r[e]=t,r},cE=function(e){return function(t){if(t.length===1)return t;for(var n=[pE(t)],r=hE(t),i=function(u){n.every(function(l){return!e.equals(l,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},fE=wT,dE=TT,pE=dE,hE=ET,qc={equals:function(e,t){return e===t}},vE={equals:qc.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};qc.equals,vE.compare;globalThis&&globalThis.__spreadArray;var Hl=function(e){return e.length===0},bu=oE,mE=uE,yE=function(e){return function(t){if(Hl(t))return Ch;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},Xb=aE,gE=function(e){return function(t){return Xb(e,t)?t:e===0?Ch:t.slice(0,e)}},bE=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Pc(n);return Nc}};function dn(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Pc(t[n]);return Nc}}var SE=function(e,t){return function(n){return Xb(e,n)?Nc:Pc(EE(e,t(n[e]),n))}};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 la=function(e){var t=cE(e);return function(n){return bu(n)?t(n):n}},CE=function(e){return function(t){return Hl(t)?e:Hl(e)?t:t.concat(e)}},Pe=CE;function Qb(e){var t=bh(e);return function(n,r){if(r===void 0){var i=Qb(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var wE=fE,Zb=Mr(2,function(e,t){return w(e,yE(function(n,r){return t(r,n)}))}),Sh=Zb(oi),W=function(e){return function(t){return t.map(function(n){return e(n)})}},Kt=function(e){return function(t){return t.filter(e)}},xE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);fh(i)&&n.push(i.value)}return n}},jo=function(e){return xE(function(t,n){return e(n)})},Qn=jo(oi),Ad=function(e,t){return TE(e,function(n,r,i){return t(r,i)})},TE=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}},Wi=function(e){return Dn(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},EE=function(e,t,n){return bu(n)?lE(e,t,n):n},$d=function(e){return e.slice()},xm=function(e){return Hl(e)?Ch:e.slice()},Ch=iE,IE=Zb,AE=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 eo(e){return dn(e)}var xl=function(e){return function(t){return t.map(function(n){return e(n)})}},$E=Mr(2,function(e,t){return w(e,AE(function(n,r){return t(r,n)}))}),OE=$E(oi),DE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);fh(i)&&n.push(i.value)}return n}},hi=function(e){return DE(function(t,n){return e(n)})},NE=function(e){return function(t){return t.filter(e)}},eS=function(e){return function(t){return Zn(e,t)}},PE=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ge=Nc,je=Pc;function Su(e){return function(t){return e(t)?je(t):ge}}var tS=function(e,t){return w(e,ee(t))},nS=function(e,t){return w(e,RE(t))},rS="Option",_o=function(e){return{equals:function(t,n){return t===n||(Cr(t)?Cr(n):Cr(n)?!1:e.equals(t.value,n.value))}}},ee=function(e){return function(t){return Cr(t)?ge:je(e(t.value))}},$i=je,RE=function(e){return function(t){return Cr(t)||Cr(e)?ge:je(t.value(e.value))}},kE={URI:rS,map:tS,ap:nS,of:$i},wh=Mr(2,function(e,t){return Cr(e)?ge:t(e.value)}),ME={URI:rS,map:tS,ap:nS,chain:wh},jE=Mr(2,function(e,t){return Cr(e)?t():e}),Tm=jE,_E=wh(oi),Jt=function(e){return function(t){return Cr(t)?ge:e(t.value)?t:ge}},bs=fh,Cr=function(e){return e._tag==="None"},qE=function(e,t){return function(n){return Cr(n)?e():t(n.value)}},ji=qE,iS=ji,FE=function(e){return function(t){return Cr(t)?e():t.value}},lt=FE,Od=_E,LE=Mr(2,Wb(ME)),Ce=function(e){return e==null?ge:je(e)},or=ji(gT,oi),_t=ji(Gb,oi),ar=wh,VE=LE,BE=MT(kE);function UE(e){return Zn(_c,e.of)}function GE(e){return Zn(mh,e.of)}function zE(e){return kT(e,GT)}function WE(e){return DT(e,HT)}function HE(e){return function(t,n){return e.chain(t,function(r){return Mi(r)?e.of(r):n(r.right)})}}function KE(e){return function(t,n){return e.map(t,KT(n))}}function YE(e){return function(t,n){return function(r){return e.map(r,ro(t,n))}}}function JE(e){return function(t){return function(n){return e.chain(n,function(r){return Mi(r)?t(r.left):e.of(r)})}}}function XE(e){return function(t){return e.map(t,XT)}}var QE=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(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},ZE=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(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Oi=GE(hh),ja=UE(hh),eI=yu,tI=function(e){return Hb(YT(e))},Kl=YE(jc),Em=function(e,t){return function(){return QE(void 0,void 0,void 0,function(){var n;return ZE(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(kc)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Rc(t(n))];case 3:return[2]}})})}},oS=JE(vh),Im=XE(jc),aS=function(e,t){return w(e,Xt(t))},sS=function(e,t){return w(e,rI(t))},Xt=zE(jc),nI=Mr(2,KE(jc)),gr=nI,rI=WE(FT),uS=Mr(2,HE(vh)),ca=ja,xh="TaskEither",iI={URI:xh,map:aS,ap:sS,of:ca},lS={URI:xh,map:aS,ap:sS,chain:uS},Th={URI:xh,fromEither:eI},oI=Mr(2,Wb(lS)),Eh=Kb(Th);Th.fromEither;var aI=VT(Th,lS),sI=ca(AT),mr=uS,uI=oI;function lI(e){return t=>w(t,Xt(n=>(e(n)(),n)))}const Us=lI;function Yl(e){return t=>w(t,Im,Us(e),Im)}function cI(e){return t=>w(t,Us(n=>()=>e(n)()),Yl(n=>()=>e(n)()))}function fI(e){return t=>w(t,ee(n=>(e(n)(),n)))}const dI=fI;function pI(e){return Zn(je,e.of)}function hI(e){return Dc(e.of(ge))}function vI(e){var t=hI(e);return function(n,r){return e.chain(n,ji(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var mI=pI(hh),yI=yu,gI=Mr(2,vI(vh)),bI=gI,SI=yT,dt={equals:function(e,t){return e===t}};dt.equals;function cS(e){return function(t,n){if(n===void 0){var r=cS(e);return function(o){return r(o,t)}}for(var i in t)if(!$T.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function fS(e){var t=cS(e);return Dn(function(n,r){return t(n)(r)&&t(r)(n)})}function Cu(e){return Dn((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var Ih={equals:function(e,t){return e===t}};Ih.equals;const jn=Symbol.for("@ts-pattern/matcher"),dS=Symbol.for("@ts-pattern/isVariadic"),Jl="@ts-pattern/anonymous-select-key",Dd=e=>!!(e&&typeof e=="object"),Tl=e=>e&&!!e[jn],mn=(e,t,n)=>{if(Tl(e)){const r=e[jn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(Dd(e)){if(!Dd(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];Tl(s)&&s[dS]?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((l,c)=>mn(l,a[c],n))&&i.every((l,c)=>mn(l,s[c],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||Tl(o=i)&&o[jn]().matcherType==="optional")&&mn(i,t[r],n);var o})}return Object.is(t,e)},Jn=e=>{var t,n,r;return Dd(e)?Tl(e)?(t=(n=(r=e[jn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?Gs(e,Jn):Gs(Object.values(e),Jn):[]},Gs=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function CI(...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 Tn(e){return Object.assign(e,{optional:()=>Ah(e),and:t=>xt(e,t),or:t=>pS(e,t),select:t=>t===void 0?zs(e):zs(t,e)})}function Nd(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[dS]:!0})}}))(e),{optional:()=>Nd(Ah(e)),select:t=>Nd(t===void 0?zs(e):zs(t,e))})}function Ah(e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Jn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:mn(e,t,r),selections:n}},getSelectionKeys:()=>Jn(e),matcherType:"optional"})})}const wI=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},xI=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function xt(...e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>mn(i,t,r)),selections:n}},getSelectionKeys:()=>Gs(e,Jn),matcherType:"and"})})}function pS(...e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return Gs(e,Jn).forEach(i=>r(i,void 0)),{matched:e.some(i=>mn(i,t,r)),selections:n}},getSelectionKeys:()=>Gs(e,Jn),matcherType:"or"})})}function Ze(e){return{[jn]:()=>({match:t=>({matched:!!e(t)})})}}function zs(...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 Tn({[jn]:()=>({match:r=>{let i={[t??Jl]:r};return{matched:n===void 0||mn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??Jl].concat(n===void 0?[]:Jn(n))})})}function Ir(e){return typeof e=="number"}function io(e){return typeof e=="string"}function yi(e){return typeof e=="bigint"}const hS=Tn(Ze(function(e){return!0})),TI=hS,oo=e=>Object.assign(Tn(e),{startsWith:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.startsWith(n)))));var n},endsWith:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.endsWith(n)))));var n},minLength:t=>oo(xt(e,(n=>Ze(r=>io(r)&&r.length>=n))(t))),maxLength:t=>oo(xt(e,(n=>Ze(r=>io(r)&&r.length<=n))(t))),includes:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.includes(n)))));var n},regex:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&!!r.match(n)))));var n}}),EI=oo(Ze(io)),Ar=e=>Object.assign(Tn(e),{between:(t,n)=>Ar(xt(e,((r,i)=>Ze(o=>Ir(o)&&r<=o&&i>=o))(t,n))),lt:t=>Ar(xt(e,(n=>Ze(r=>Ir(r)&&r<n))(t))),gt:t=>Ar(xt(e,(n=>Ze(r=>Ir(r)&&r>n))(t))),lte:t=>Ar(xt(e,(n=>Ze(r=>Ir(r)&&r<=n))(t))),gte:t=>Ar(xt(e,(n=>Ze(r=>Ir(r)&&r>=n))(t))),int:()=>Ar(xt(e,Ze(t=>Ir(t)&&Number.isInteger(t)))),finite:()=>Ar(xt(e,Ze(t=>Ir(t)&&Number.isFinite(t)))),positive:()=>Ar(xt(e,Ze(t=>Ir(t)&&t>0))),negative:()=>Ar(xt(e,Ze(t=>Ir(t)&&t<0)))}),II=Ar(Ze(Ir)),gi=e=>Object.assign(Tn(e),{between:(t,n)=>gi(xt(e,((r,i)=>Ze(o=>yi(o)&&r<=o&&i>=o))(t,n))),lt:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r<n))(t))),gt:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r>n))(t))),lte:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r<=n))(t))),gte:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r>=n))(t))),positive:()=>gi(xt(e,Ze(t=>yi(t)&&t>0))),negative:()=>gi(xt(e,Ze(t=>yi(t)&&t<0)))}),AI=gi(Ze(yi)),$I=Tn(Ze(function(e){return typeof e=="boolean"})),OI=Tn(Ze(function(e){return typeof e=="symbol"})),DI=Tn(Ze(function(e){return e==null}));var Ct={__proto__:null,matcher:jn,optional:Ah,array:function(...e){return Nd({[jn]:()=>({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 Jn(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?[]:Jn(e[0])})})},set:function(...e){return Tn({[jn]:()=>({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:wI(t,o=>mn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Jn(e[0])})})},map:function(...e){return Tn({[jn]:()=>({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:xI(t,(s,u)=>{const l=mn(o,u,r),c=mn(a,s,r);return l&&c}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Jn(e[0]),...Jn(e[1])]})})},intersection:xt,union:pS,not:function(e){return Tn({[jn]:()=>({match:t=>({matched:!mn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Ze,select:zs,any:hS,_:TI,string:EI,number:II,bigint:AI,boolean:$I,symbol:OI,nullish:DI,instanceOf:function(e){return Tn(Ze(function(t){return n=>n instanceof t}(e)))},shape:function(e){return Tn(Ze(CI(e)))}};const Pd={matched:!1,value:void 0};function ue(e){return new NI(e,Pd)}let NI=class Rd{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=(l,c)=>{o=!0,a[l]=c},u=!r.some(l=>mn(l,this.input,s))||i&&!i(this.input)?Pd:{matched:!0,value:n(o?Jl in a?a[Jl]:a:this.input,this.input)};return new Rd(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new Rd(this.input,r?{matched:!0,value:n(this.input,this.input)}:Pd)}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 PI=Object.getOwnPropertyNames,RI=Object.getOwnPropertySymbols,kI=Object.prototype.hasOwnProperty;function Am(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function zu(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 $m(e){return PI(e).concat(RI(e))}var vS=Object.hasOwn||function(e,t){return kI.call(e,t)};function _a(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var mS="_owner",Om=Object.getOwnPropertyDescriptor,Dm=Object.keys;function MI(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 jI(e,t){return _a(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(),l=!1,c=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],h=f[1],p=s.value,v=p[0],g=p[1];!l&&!r[c]&&(l=n.equals(d,v,o,c,e,t,n)&&n.equals(h,g,d,v,e,t,n))&&(r[c]=!0),c++}if(!l)return!1;o++}return!0}function _I(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===mS&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!vS(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function cs(e,t,n){var r=$m(e),i=r.length;if($m(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===mS&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!vS(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=Om(e,o),s=Om(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function qI(e,t){return _a(e.valueOf(),t.valueOf())}function FI(e,t){return e.source===t.source&&e.flags===t.flags}function Pm(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,l=0;(a=s.next())&&!a.done;)!u&&!r[l]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[l]=!0),l++;if(!u)return!1}return!0}function LI(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 VI="[object Arguments]",BI="[object Boolean]",UI="[object Date]",GI="[object Map]",zI="[object Number]",WI="[object Object]",HI="[object RegExp]",KI="[object Set]",YI="[object String]",JI=Array.isArray,Rm=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,km=Object.assign,XI=Object.prototype.toString.call.bind(Object.prototype.toString);function QI(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(c,f,d){if(c===f)return!0;if(c==null||f==null||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;var h=c.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(c,f,d);if(JI(c))return t(c,f,d);if(Rm!=null&&Rm(c))return u(c,f,d);if(h===Date)return n(c,f,d);if(h===RegExp)return a(c,f,d);if(h===Map)return r(c,f,d);if(h===Set)return s(c,f,d);var p=XI(c);return p===UI?n(c,f,d):p===HI?a(c,f,d):p===GI?r(c,f,d):p===KI?s(c,f,d):p===WI?typeof c.then!="function"&&typeof f.then!="function"&&i(c,f,d):p===VI?i(c,f,d):p===BI||p===zI||p===YI?o(c,f,d):!1}}function ZI(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?cs:MI,areDatesEqual:jI,areMapsEqual:r?Am(Nm,cs):Nm,areObjectsEqual:r?cs:_I,arePrimitiveWrappersEqual:qI,areRegExpsEqual:FI,areSetsEqual:r?Am(Pm,cs):Pm,areTypedArraysEqual:r?cs:LI};if(n&&(i=km({},i,n(i))),t){var o=zu(i.areArraysEqual),a=zu(i.areMapsEqual),s=zu(i.areObjectsEqual),u=zu(i.areSetsEqual);i=km({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function eA(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function tA(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,l){var c=r(),f=c.cache,d=f===void 0?t?new WeakMap:void 0:f,h=c.meta;return n(u,l,{cache:d,equals:i,meta:h,strict:o})};if(t)return function(u,l){return n(u,l,{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,l){return n(u,l,a)}}var nA=Hi();Hi({strict:!0});Hi({circular:!0});Hi({circular:!0,strict:!0});Hi({createInternalComparator:function(){return _a}});Hi({strict:!0,createInternalComparator:function(){return _a}});Hi({circular:!0,createInternalComparator:function(){return _a}});Hi({circular:!0,createInternalComparator:function(){return _a},strict:!0});function Hi(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=ZI(e),u=QI(s),l=r?r(u):eA(u);return tA({circular:n,comparator:u,createState:i,equals:l,strict:a})}function rA(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 iA(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),rA(e)}var Ps=w,oA=SI(BE({concat:rE(tE).concat,empty:0}))();function aA(e){return function(t){return t.iterNumber>=e?ge:je(0)}}function sA(e,t){return function(n){return Ps(n,t,ee(function(r){return Math.min(e,r)}))}}function uA(e){return function(t){return je(e*Math.pow(2,t.iterNumber))}}var lA={iterNumber:0,cumulativeDelay:0,previousDelay:ge};function cA(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+lt(function(){return 0})(n),previousDelay:n}}function fA(e,t){var n=cA(e,t);return Ps(n.previousDelay,iS(function(){return Wl.of(n)},function(r){return _T(r)(Wl.of(n))}))}function Uo(e,t,n){var r=function(i){return Ps(i,t,Sm(function(o){return n(o)?Ps(fA(e,i),Sm(function(a){return Ps(a.previousDelay,iS(function(){return Wl.of(o)},function(){return r(a)}))})):Wl.of(o)}))};return r(lA)}var Mm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.isGuid=gS=Ws.guid=void 0;var dA=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+=jm()+"-";for(o+=r,o+=t;o.length<i;)o+=jm();return o.substring(0,i)},gS=Ws.guid=dA,jm=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},pA=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=hA(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"};Ws.isGuid=pA;var hA=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function $h(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function Fc(e){return{equals(t,n){const r=w(Ce(t),lt(()=>[])),i=w(Ce(n),lt(()=>[]));return Wi(e).equals(r,i)}}}const qo=bn({localId:dt,componentPath:Fc(dt),sharedConfigurationModelId:$h(dt)}),Oh=bn({localId:dt,configurationModelId:dt}),bS=Dn((e,t)=>ue({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>vA.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>mA.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>yA.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>gA.equals(n.x,n.y)).otherwise(()=>!1)),vA=bn({type:dt,attributeId:qo,state:dt,choiceValueId:dt}),mA=bn({type:dt,attributeId:qo,state:dt}),yA=bn({type:dt,attributeId:qo,state:qc}),gA=bn({type:dt,attributeId:qo,state:Ih});var xn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(xn||{}),zt=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(zt||{}),ma=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ma||{}),sn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(sn||{}),Yr=(e=>(e.Channel="Channel",e.Package="Package",e))(Yr||{}),Oe=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(Oe||{}),Jr=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Jr||{}),_i=(e=>(e.Included="Included",e.Excluded="Excluded",e))(_i||{}),Rr=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Rr||{}),Pr=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Pr||{}),qi=(e=>(e.Always="Always",e.Optional="Optional",e))(qi||{});const bA=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:sn,AttributeType:Oe,ChoiceValueDecisionState:Jr,ComponentDecisionState:_i,ConfigurationModelSourceType:Yr,ConstraintType:ma,DecisionKind:Rr,ExplainQuestionSubject:zt,ExplainQuestionType:xn,Inclusion:qi,Selection:Pr,eqCausedByDecision:bS,eqGlobalAttributeId:qo,eqGlobalConstraintId:Oh},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||{}),Lc=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Lc||{});const SS={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}},SA=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationConflictReason:Lc,FailureResultFactory:SS,FailureType:Gt},Symbol.toStringTag,{value:"Module"}));let CS=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:Yr.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Yr.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return w(t,Ce,ee(Zn(W(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),_t)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:w([...t.decisions],xl(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return w(Ce(t),_t)}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:sn.all},()=>({type:"AllowedRulesAll"})).with({type:sn.none},()=>({type:"AllowedRulesNone"})).with({type:sn.specific},n=>({type:"AllowedRulesSpecific",rules:w(n.rules,W(this.mapToGlobalConstraintId),$d)})).with(Ct.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function CA(e){return t=>aI(n=>n!=null,e)(t)}function wA(){return ja(Vr())}var Kn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Kn||{}),vo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(vo||{}),pn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(pn||{}),mo=(e=>(e.all="all",e.none="none",e.specific="specific",e))(mo||{});const Cn=bn({localId:dt,componentPath:Fc(dt),sharedConfigurationModel:$h(dt)}),xA=_o(Wi(bn({attributeId:Cn,decisions:Fc(Cn)}))),TA=_o(Dn((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})=>Wi(Oh).equals(n.rules,r.rules)).otherwise(()=>!1))),EA=_o(bn({rules:TA})),IA=bn({configurationModelSource:Dn((e,t)=>nA(e,t)),decisionsToRespect:xA,usageRuleParameters:fS(dt),allowedInExplain:EA});var Hs=(e=>(e.Channel="Channel",e.Package="Package",e))(Hs||{}),ct=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ct||{}),Ee=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ee||{}),Qt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Qt||{}),Rt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Rt||{}),Co=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Co||{}),wo=(e=>(e.Always="Always",e.Optional="Optional",e))(wo||{});const AA={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:_o(dt).equals(e.state,t.state)},$A={equals(e,t){return _o(qc).equals(e.value,t.value)}},OA={equals(e,t){return _o(Ih).equals(e.value,t.value)}},DA={equals(e,t){return _o(dt).equals(e.state,t.state)}},NA={equals(e,t){return Cn.equals(e.attributeId,t.attributeId)?ue({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>OA.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>$A.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>DA.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>AA.equals(r.x,r.y)).otherwise(()=>!1):!1}},PA=Wi(NA),RA={equals:(e,t)=>PA.equals(e.decisions,t.decisions)&&kA.equals(e.mode,t.mode)},kA={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 kd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(kd||{}),ya=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ya||{}),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||{}),Dh=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Dh||{});function MA(e,t){console.log(`--------------------------------------------------------------------------------
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),$=require("react/jsx-runtime"),D=require("framer"),Gb=require("react-dom"),yT=require("framer-motion");function zb(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=zb(O),gT=zb(Gb);var bT=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))},ST=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},CT=function(e){var t=ST(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function ai(e){return e}function Dc(e){return function(){return e}}var wT=Dc(null),Wb=Dc(void 0),Br=Wb;function Zn(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 w(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 l=arguments[0],c=1;c<arguments.length;c++)l=arguments[c](l);return l}}}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,bT([i],r,!1))}}},xT=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))},TT=function(e){return e._tag==="None"},ch=function(e){return e._tag==="Some"},Nc={_tag:"None"},Pc=function(e){return{_tag:"Some",value:e}},ET=function(e){return e._tag==="Left"},Rc=function(e){return{_tag:"Left",left:e}},kc=function(e){return{_tag:"Right",right:e}},IT=function(e){return[e]},AT=function(e){return e.length>0},$T=function(e){return e[0]},OT=function(e){return e.slice(1)},DT=[],NT={},PT=Object.prototype.hasOwnProperty,RT=function(e){return xT([e[0]],e.slice(1),!0)};function kT(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 MT(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 Hb(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):Hb(e,t-1,i)}}function jT(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 Hb(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 _T(e){return function(t){for(var n=Object.keys(t),r=n.length,i=jT(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function qT(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function FT(e){var t=MT(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function Kb(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var LT=function(e){return function(){return Promise.resolve().then(e)}};function VT(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var Mc=function(e,t){return w(e,Yb(t))},fh=function(e,t){return w(e,BT(t))},Yb=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},BT=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)}},dh=jr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),gu="Task",jc={URI:gu,map:Mc},ph={URI:gu,of:yu},UT={URI:gu,map:Mc,ap:fh},hh={URI:gu,map:Mc,of:yu,ap:fh,chain:dh},GT=ai,Cm=dh,Wl={URI:gu,map:Mc,of:yu,ap:fh,chain:dh,fromIO:LT,fromTask:GT};function Jb(e){return function(t){return function(n){return e.fromEither(TT(n)?Rc(t()):kc(n.value))}}}function zT(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?kc(o):Rc(r(o)))})}}}var vh=Rc,_c=kc,Xb=function(e,t){return w(e,HT(t))},WT=function(e,t){return w(e,JT(t))},mh="Either",HT=function(e){return function(t){return Mi(t)?t:_c(e(t.right))}},KT={URI:mh,map:Xb},YT=function(e){return function(t){return Mi(t)?t:Mi(e)?e:_c(t.right(e.right))}},JT=YT,XT={URI:mh,map:Xb,ap:WT},QT=function(e){return function(t){return Mi(t)?vh(e(t.left)):t}},Qb={URI:mh,fromEither:ai},ZT=Jb(Qb),Mi=ET,eE=function(e,t){return function(n){return Mi(n)?e(n.left):t(n.right)}},ro=eE;Qb.fromEither;var tE=function(e){return Mi(e)?_c(e.left):vh(e.right)},Dn=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},bn=function(e){return Dn(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},wm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Dn(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},yh={equals:function(e,t){return e===t}};yh.equals;var nE=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function rE(e,t){return e<t?-1:e>t?1:0}var iE={equals:yh.equals,compare:rE},oE=iE,aE=function(e){return{concat:nE(e)}},sE=aE,xm=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))},uE=DT,lE=AT,cE=function(e,t){return e<0||e>=t.length},fE=function(e){return function(t){return xm(xm([],t,!0),[e],!1)}},dE=fE,pE=function(e,t,n){if(n[e]===t)return n;var r=RT(n);return r[e]=t,r},hE=function(e){return function(t){if(t.length===1)return t;for(var n=[yE(t)],r=gE(t),i=function(u){n.every(function(l){return!e.equals(l,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},vE=IT,mE=$T,yE=mE,gE=OT,qc={equals:function(e,t){return e===t}},bE={equals:qc.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};qc.equals,bE.compare;globalThis&&globalThis.__spreadArray;var Hl=function(e){return e.length===0},bu=lE,SE=dE,CE=function(e){return function(t){if(Hl(t))return Sh;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},Zb=cE,wE=function(e){return function(t){return Zb(e,t)?t:e===0?Sh:t.slice(0,e)}},xE=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Pc(n);return Nc}};function pn(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Pc(t[n]);return Nc}}var TE=function(e,t){return function(n){return Zb(e,n)?Nc:Pc(OE(e,t(n[e]),n))}};function gh(e){return function(t,n){if(n===void 0){var r=gh(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 la=function(e){var t=hE(e);return function(n){return bu(n)?t(n):n}},EE=function(e){return function(t){return Hl(t)?e:Hl(e)?t:t.concat(e)}},Pe=EE;function eS(e){var t=gh(e);return function(n,r){if(r===void 0){var i=eS(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var IE=vE,tS=jr(2,function(e,t){return w(e,CE(function(n,r){return t(r,n)}))}),bh=tS(ai),W=function(e){return function(t){return t.map(function(n){return e(n)})}},Yt=function(e){return function(t){return t.filter(e)}},AE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);ch(i)&&n.push(i.value)}return n}},jo=function(e){return AE(function(t,n){return e(n)})},Qn=jo(ai),Ad=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}},Wi=function(e){return Dn(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},OE=function(e,t,n){return bu(n)?pE(e,t,n):n},$d=function(e){return e.slice()},Tm=function(e){return Hl(e)?Sh:e.slice()},Sh=uE,DE=tS,NE=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 eo(e){return pn(e)}var xl=function(e){return function(t){return t.map(function(n){return e(n)})}},PE=jr(2,function(e,t){return w(e,NE(function(n,r){return t(r,n)}))}),RE=PE(ai),kE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);ch(i)&&n.push(i.value)}return n}},hi=function(e){return kE(function(t,n){return e(n)})},ME=function(e){return function(t){return t.filter(e)}},nS=function(e){return function(t){return Zn(e,t)}},jE=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ge=Nc,je=Pc;function Su(e){return function(t){return e(t)?je(t):ge}}var rS=function(e,t){return w(e,ee(t))},iS=function(e,t){return w(e,_E(t))},oS="Option",_o=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)?ge:je(e(t.value))}},$i=je,_E=function(e){return function(t){return wr(t)||wr(e)?ge:je(t.value(e.value))}},qE={URI:oS,map:rS,ap:iS,of:$i},Ch=jr(2,function(e,t){return wr(e)?ge:t(e.value)}),FE={URI:oS,map:rS,ap:iS,chain:Ch},LE=jr(2,function(e,t){return wr(e)?t():e}),Em=LE,VE=Ch(ai),Jt=function(e){return function(t){return wr(t)?ge:e(t.value)?t:ge}},bs=ch,wr=function(e){return e._tag==="None"},BE=function(e,t){return function(n){return wr(n)?e():t(n.value)}},ji=BE,aS=ji,UE=function(e){return function(t){return wr(t)?e():t.value}},lt=UE,Od=VE,GE=jr(2,Kb(FE)),Ce=function(e){return e==null?ge:je(e)},or=ji(wT,ai),_t=ji(Wb,ai),ar=Ch,zE=GE,WE=FT(qE);function HE(e){return Zn(_c,e.of)}function KE(e){return Zn(vh,e.of)}function YE(e){return qT(e,KT)}function JE(e){return kT(e,XT)}function XE(e){return function(t,n){return e.chain(t,function(r){return Mi(r)?e.of(r):n(r.right)})}}function QE(e){return function(t,n){return e.map(t,QT(n))}}function ZE(e){return function(t,n){return function(r){return e.map(r,ro(t,n))}}}function eI(e){return function(t){return function(n){return e.chain(n,function(r){return Mi(r)?t(r.left):e.of(r)})}}}function tI(e){return function(t){return e.map(t,tE)}}var nI=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(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},rI=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(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Oi=KE(ph),ja=HE(ph),iI=yu,oI=function(e){return Yb(ZT(e))},Kl=ZE(jc),Im=function(e,t){return function(){return nI(void 0,void 0,void 0,function(){var n;return rI(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(kc)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Rc(t(n))];case 3:return[2]}})})}},sS=eI(hh),Am=tI(jc),uS=function(e,t){return w(e,Xt(t))},lS=function(e,t){return w(e,sI(t))},Xt=YE(jc),aI=jr(2,QE(jc)),br=aI,sI=JE(UT),cS=jr(2,XE(hh)),ca=ja,wh="TaskEither",uI={URI:wh,map:uS,ap:lS,of:ca},fS={URI:wh,map:uS,ap:lS,chain:cS},xh={URI:wh,fromEither:iI},lI=jr(2,Kb(fS)),Th=Jb(xh);xh.fromEither;var cI=zT(xh,fS),fI=ca(NT),yr=cS,dI=lI;function pI(e){return t=>w(t,Xt(n=>(e(n)(),n)))}const Us=pI;function Yl(e){return t=>w(t,Am,Us(e),Am)}function hI(e){return t=>w(t,Us(n=>()=>e(n)()),Yl(n=>()=>e(n)()))}function vI(e){return t=>w(t,ee(n=>(e(n)(),n)))}const mI=vI;function yI(e){return Zn(je,e.of)}function gI(e){return Dc(e.of(ge))}function bI(e){var t=gI(e);return function(n,r){return e.chain(n,ji(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var SI=yI(ph),CI=yu,wI=jr(2,bI(hh)),xI=wI,TI=CT,dt={equals:function(e,t){return e===t}};dt.equals;function dS(e){return function(t,n){if(n===void 0){var r=dS(e);return function(o){return r(o,t)}}for(var i in t)if(!PT.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function pS(e){var t=dS(e);return Dn(function(n,r){return t(n)(r)&&t(r)(n)})}function Cu(e){return Dn((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var Eh={equals:function(e,t){return e===t}};Eh.equals;const jn=Symbol.for("@ts-pattern/matcher"),hS=Symbol.for("@ts-pattern/isVariadic"),Jl="@ts-pattern/anonymous-select-key",Dd=e=>!!(e&&typeof e=="object"),Tl=e=>e&&!!e[jn],yn=(e,t,n)=>{if(Tl(e)){const r=e[jn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(Dd(e)){if(!Dd(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];Tl(s)&&s[hS]?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((l,c)=>yn(l,a[c],n))&&i.every((l,c)=>yn(l,s[c],n))&&(o.length===0||yn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>yn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||Tl(o=i)&&o[jn]().matcherType==="optional")&&yn(i,t[r],n);var o})}return Object.is(t,e)},Jn=e=>{var t,n,r;return Dd(e)?Tl(e)?(t=(n=(r=e[jn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?Gs(e,Jn):Gs(Object.values(e),Jn):[]},Gs=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function EI(...e){if(e.length===1){const[t]=e;return n=>yn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return yn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function Tn(e){return Object.assign(e,{optional:()=>Ih(e),and:t=>xt(e,t),or:t=>vS(e,t),select:t=>t===void 0?zs(e):zs(t,e)})}function Nd(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[hS]:!0})}}))(e),{optional:()=>Nd(Ih(e)),select:t=>Nd(t===void 0?zs(e):zs(t,e))})}function Ih(e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Jn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:yn(e,t,r),selections:n}},getSelectionKeys:()=>Jn(e),matcherType:"optional"})})}const II=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},AI=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function xt(...e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>yn(i,t,r)),selections:n}},getSelectionKeys:()=>Gs(e,Jn),matcherType:"and"})})}function vS(...e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return Gs(e,Jn).forEach(i=>r(i,void 0)),{matched:e.some(i=>yn(i,t,r)),selections:n}},getSelectionKeys:()=>Gs(e,Jn),matcherType:"or"})})}function Ze(e){return{[jn]:()=>({match:t=>({matched:!!e(t)})})}}function zs(...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 Tn({[jn]:()=>({match:r=>{let i={[t??Jl]:r};return{matched:n===void 0||yn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??Jl].concat(n===void 0?[]:Jn(n))})})}function Ar(e){return typeof e=="number"}function io(e){return typeof e=="string"}function yi(e){return typeof e=="bigint"}const mS=Tn(Ze(function(e){return!0})),$I=mS,oo=e=>Object.assign(Tn(e),{startsWith:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.startsWith(n)))));var n},endsWith:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.endsWith(n)))));var n},minLength:t=>oo(xt(e,(n=>Ze(r=>io(r)&&r.length>=n))(t))),maxLength:t=>oo(xt(e,(n=>Ze(r=>io(r)&&r.length<=n))(t))),includes:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.includes(n)))));var n},regex:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&!!r.match(n)))));var n}}),OI=oo(Ze(io)),$r=e=>Object.assign(Tn(e),{between:(t,n)=>$r(xt(e,((r,i)=>Ze(o=>Ar(o)&&r<=o&&i>=o))(t,n))),lt:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r<n))(t))),gt:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r>n))(t))),lte:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r<=n))(t))),gte:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r>=n))(t))),int:()=>$r(xt(e,Ze(t=>Ar(t)&&Number.isInteger(t)))),finite:()=>$r(xt(e,Ze(t=>Ar(t)&&Number.isFinite(t)))),positive:()=>$r(xt(e,Ze(t=>Ar(t)&&t>0))),negative:()=>$r(xt(e,Ze(t=>Ar(t)&&t<0)))}),DI=$r(Ze(Ar)),gi=e=>Object.assign(Tn(e),{between:(t,n)=>gi(xt(e,((r,i)=>Ze(o=>yi(o)&&r<=o&&i>=o))(t,n))),lt:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r<n))(t))),gt:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r>n))(t))),lte:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r<=n))(t))),gte:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r>=n))(t))),positive:()=>gi(xt(e,Ze(t=>yi(t)&&t>0))),negative:()=>gi(xt(e,Ze(t=>yi(t)&&t<0)))}),NI=gi(Ze(yi)),PI=Tn(Ze(function(e){return typeof e=="boolean"})),RI=Tn(Ze(function(e){return typeof e=="symbol"})),kI=Tn(Ze(function(e){return e==null}));var Ct={__proto__:null,matcher:jn,optional:Ih,array:function(...e){return Nd({[jn]:()=>({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 Jn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>yn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Jn(e[0])})})},set:function(...e){return Tn({[jn]:()=>({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:II(t,o=>yn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Jn(e[0])})})},map:function(...e){return Tn({[jn]:()=>({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:AI(t,(s,u)=>{const l=yn(o,u,r),c=yn(a,s,r);return l&&c}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Jn(e[0]),...Jn(e[1])]})})},intersection:xt,union:vS,not:function(e){return Tn({[jn]:()=>({match:t=>({matched:!yn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Ze,select:zs,any:mS,_:$I,string:OI,number:DI,bigint:NI,boolean:PI,symbol:RI,nullish:kI,instanceOf:function(e){return Tn(Ze(function(t){return n=>n instanceof t}(e)))},shape:function(e){return Tn(Ze(EI(e)))}};const Pd={matched:!1,value:void 0};function ue(e){return new MI(e,Pd)}let MI=class Rd{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=(l,c)=>{o=!0,a[l]=c},u=!r.some(l=>yn(l,this.input,s))||i&&!i(this.input)?Pd:{matched:!0,value:n(o?Jl in a?a[Jl]:a:this.input,this.input)};return new Rd(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new Rd(this.input,r?{matched:!0,value:n(this.input,this.input)}:Pd)}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 jI=Object.getOwnPropertyNames,_I=Object.getOwnPropertySymbols,qI=Object.prototype.hasOwnProperty;function $m(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function zu(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 Om(e){return jI(e).concat(_I(e))}var yS=Object.hasOwn||function(e,t){return qI.call(e,t)};function _a(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var gS="_owner",Dm=Object.getOwnPropertyDescriptor,Nm=Object.keys;function FI(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 LI(e,t){return _a(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(),l=!1,c=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],h=f[1],p=s.value,v=p[0],g=p[1];!l&&!r[c]&&(l=n.equals(d,v,o,c,e,t,n)&&n.equals(h,g,d,v,e,t,n))&&(r[c]=!0),c++}if(!l)return!1;o++}return!0}function VI(e,t,n){var r=Nm(e),i=r.length;if(Nm(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 cs(e,t,n){var r=Om(e),i=r.length;if(Om(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=Dm(e,o),s=Dm(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function BI(e,t){return _a(e.valueOf(),t.valueOf())}function UI(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,l=0;(a=s.next())&&!a.done;)!u&&!r[l]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[l]=!0),l++;if(!u)return!1}return!0}function GI(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 zI="[object Arguments]",WI="[object Boolean]",HI="[object Date]",KI="[object Map]",YI="[object Number]",JI="[object Object]",XI="[object RegExp]",QI="[object Set]",ZI="[object String]",eA=Array.isArray,km=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Mm=Object.assign,tA=Object.prototype.toString.call.bind(Object.prototype.toString);function nA(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(c,f,d){if(c===f)return!0;if(c==null||f==null||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;var h=c.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(c,f,d);if(eA(c))return t(c,f,d);if(km!=null&&km(c))return u(c,f,d);if(h===Date)return n(c,f,d);if(h===RegExp)return a(c,f,d);if(h===Map)return r(c,f,d);if(h===Set)return s(c,f,d);var p=tA(c);return p===HI?n(c,f,d):p===XI?a(c,f,d):p===KI?r(c,f,d):p===QI?s(c,f,d):p===JI?typeof c.then!="function"&&typeof f.then!="function"&&i(c,f,d):p===zI?i(c,f,d):p===WI||p===YI||p===ZI?o(c,f,d):!1}}function rA(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?cs:FI,areDatesEqual:LI,areMapsEqual:r?$m(Pm,cs):Pm,areObjectsEqual:r?cs:VI,arePrimitiveWrappersEqual:BI,areRegExpsEqual:UI,areSetsEqual:r?$m(Rm,cs):Rm,areTypedArraysEqual:r?cs:GI};if(n&&(i=Mm({},i,n(i))),t){var o=zu(i.areArraysEqual),a=zu(i.areMapsEqual),s=zu(i.areObjectsEqual),u=zu(i.areSetsEqual);i=Mm({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function iA(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function oA(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,l){var c=r(),f=c.cache,d=f===void 0?t?new WeakMap:void 0:f,h=c.meta;return n(u,l,{cache:d,equals:i,meta:h,strict:o})};if(t)return function(u,l){return n(u,l,{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,l){return n(u,l,a)}}var aA=Hi();Hi({strict:!0});Hi({circular:!0});Hi({circular:!0,strict:!0});Hi({createInternalComparator:function(){return _a}});Hi({strict:!0,createInternalComparator:function(){return _a}});Hi({circular:!0,createInternalComparator:function(){return _a}});Hi({circular:!0,createInternalComparator:function(){return _a},strict:!0});function Hi(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=rA(e),u=nA(s),l=r?r(u):iA(u);return oA({circular:n,comparator:u,createState:i,equals:l,strict:a})}function sA(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 uA(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),sA(e)}var Ps=w,lA=TI(WE({concat:sE(oE).concat,empty:0}))();function cA(e){return function(t){return t.iterNumber>=e?ge:je(0)}}function fA(e,t){return function(n){return Ps(n,t,ee(function(r){return Math.min(e,r)}))}}function dA(e){return function(t){return je(e*Math.pow(2,t.iterNumber))}}var pA={iterNumber:0,cumulativeDelay:0,previousDelay:ge};function hA(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+lt(function(){return 0})(n),previousDelay:n}}function vA(e,t){var n=hA(e,t);return Ps(n.previousDelay,aS(function(){return Wl.of(n)},function(r){return VT(r)(Wl.of(n))}))}function Uo(e,t,n){var r=function(i){return Ps(i,t,Cm(function(o){return n(o)?Ps(vA(e,i),Cm(function(a){return Ps(a.previousDelay,aS(function(){return Wl.of(o)},function(){return r(a)}))})):Wl.of(o)}))};return r(pA)}var jm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.isGuid=SS=Ws.guid=void 0;var mA=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+=_m()+"-";for(o+=r,o+=t;o.length<i;)o+=_m();return o.substring(0,i)},SS=Ws.guid=mA,_m=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},yA=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=gA(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"};Ws.isGuid=yA;var gA=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function Ah(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function Fc(e){return{equals(t,n){const r=w(Ce(t),lt(()=>[])),i=w(Ce(n),lt(()=>[]));return Wi(e).equals(r,i)}}}const qo=bn({localId:dt,componentPath:Fc(dt),sharedConfigurationModelId:Ah(dt)}),$h=bn({localId:dt,configurationModelId:dt}),CS=Dn((e,t)=>ue({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>bA.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>SA.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>CA.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>wA.equals(n.x,n.y)).otherwise(()=>!1)),bA=bn({type:dt,attributeId:qo,state:dt,choiceValueId:dt}),SA=bn({type:dt,attributeId:qo,state:dt}),CA=bn({type:dt,attributeId:qo,state:qc}),wA=bn({type:dt,attributeId:qo,state:Eh});var xn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(xn||{}),Wt=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Wt||{}),ma=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ma||{}),sn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(sn||{}),Jr=(e=>(e.Channel="Channel",e.Package="Package",e))(Jr||{}),Oe=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(Oe||{}),Xr=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Xr||{}),_i=(e=>(e.Included="Included",e.Excluded="Excluded",e))(_i||{}),kr=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(kr||{}),Rr=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Rr||{}),qi=(e=>(e.Always="Always",e.Optional="Optional",e))(qi||{});const xA=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:sn,AttributeType:Oe,ChoiceValueDecisionState:Xr,ComponentDecisionState:_i,ConfigurationModelSourceType:Jr,ConstraintType:ma,DecisionKind:kr,ExplainQuestionSubject:Wt,ExplainQuestionType:xn,Inclusion:qi,Selection:Rr,eqCausedByDecision:CS,eqGlobalAttributeId:qo,eqGlobalConstraintId:$h},Symbol.toStringTag,{value:"Module"}));var zt=(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))(zt||{}),Lc=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Lc||{});const wS={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}},TA=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationConflictReason:Lc,FailureResultFactory:wS,FailureType:zt},Symbol.toStringTag,{value:"Module"}));let xS=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 w(t,Ce,ee(Zn(W(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),_t)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:w([...t.decisions],xl(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return w(Ce(t),_t)}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:sn.all},()=>({type:"AllowedRulesAll"})).with({type:sn.none},()=>({type:"AllowedRulesNone"})).with({type:sn.specific},n=>({type:"AllowedRulesSpecific",rules:w(n.rules,W(this.mapToGlobalConstraintId),$d)})).with(Ct.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function EA(e){return t=>cI(n=>n!=null,e)(t)}function IA(){return ja(Br())}var Kn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Kn||{}),vo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(vo||{}),hn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(hn||{}),mo=(e=>(e.all="all",e.none="none",e.specific="specific",e))(mo||{});const Cn=bn({localId:dt,componentPath:Fc(dt),sharedConfigurationModel:Ah(dt)}),AA=_o(Wi(bn({attributeId:Cn,decisions:Fc(Cn)}))),$A=_o(Dn((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})=>Wi($h).equals(n.rules,r.rules)).otherwise(()=>!1))),OA=_o(bn({rules:$A})),DA=bn({configurationModelSource:Dn((e,t)=>aA(e,t)),decisionsToRespect:AA,usageRuleParameters:pS(dt),allowedInExplain:OA});var Hs=(e=>(e.Channel="Channel",e.Package="Package",e))(Hs||{}),ct=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ct||{}),Ee=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ee||{}),Qt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Qt||{}),Rt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Rt||{}),Co=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Co||{}),wo=(e=>(e.Always="Always",e.Optional="Optional",e))(wo||{});const NA={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:_o(dt).equals(e.state,t.state)},PA={equals(e,t){return _o(qc).equals(e.value,t.value)}},RA={equals(e,t){return _o(Eh).equals(e.value,t.value)}},kA={equals(e,t){return _o(dt).equals(e.state,t.state)}},MA={equals(e,t){return Cn.equals(e.attributeId,t.attributeId)?ue({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>RA.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>PA.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>kA.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>NA.equals(r.x,r.y)).otherwise(()=>!1):!1}},jA=Wi(MA),_A={equals:(e,t)=>jA.equals(e.decisions,t.decisions)&&qA.equals(e.mode,t.mode)},qA={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 kd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(kd||{}),ya=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ya||{}),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||{}),Oh=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Oh||{});function FA(e,t){console.log(`--------------------------------------------------------------------------------
|
|
2
2
|
-- ${t??""}
|
|
3
3
|
--------------------------------------------------------------------------------
|
|
4
|
-
${JSON.stringify(e,null,2)}`)}var Rs=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(Rs||{}),wS=(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))(wS||{});const jA=e=>Object.values(wS).includes(e),_A=e=>jA(e)?je(e):ge;function qA(e){const t=n=>ue(n).with("ConfigurationModelNotFound",()=>({type:we.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:we.DecisionsToRespectInvalid})).with(Ct.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:we.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:we.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:we.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:we.ConfigurationConflict,reason:Dh.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:we.ConfigurationConflict})).with(Ct.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 w(e.type,_A,ee(t))}const FA=e=>Object.values(Rs).includes(e),LA=e=>FA(e)?je(e):ge;function VA(e){return w(e,LA,ee(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 Br(e,t){MA(e,t);const n=e.type;return w(ge,Tm(()=>qA(e)),Tm(()=>VA(n)),lt(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:we.Unknown})))}let xS=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 w(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),gr(r=>Br(r,"ClientSideSessionLifetimeHandler - create")),mr(r=>this.restToDomainMapper.mapToSessionId(r)),CA(()=>({type:we.ConfigurationUnauthenticated})))}close(t){return w(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),gr(n=>Br(n,"ClientSideSessionLifetimeHandler - close")),Xt(()=>Vr()))}};var TS=(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))(TS||{});function qr(e,t,n){const r=w(Array.isArray(e)?e:[e],iA);return w(Em(()=>fetch(r,t),i=>({type:"error"})),mr(i=>w(Em(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),oS(i=>i.status===401?Oi({type:Rs.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?ja({response:i,data:{}}):i.type==="error"?Oi({type:Rs.LowLevelCommunicationError}):Oi({type:Rs.UnhandledResponseStatus})),mr(i=>w(n(i),Eh(()=>i.data))))}function Md(e,t){return qr(e,t,n=>{if(n.response.status===200)return $i(n.data);if(n.response.status===409){const r=n.data;return ue(r).with({type:"ConfigurationModelInvalid"},i=>$i(r)).with({type:"ConfigurationModelNotFeasible"},i=>$i(r)).otherwise(()=>ge)}return ge})}let BA=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 Md([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 Md([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?je(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?je(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?je(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?je(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?je(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?je(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?je({}):ge)}};var xo=(e=>(e.Included="Included",e.Excluded="Excluded",e))(xo||{}),jd=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(jd||{}),_d=(e=>(e.Always="Always",e.Optional="Optional",e))(_d||{}),Ks=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Ks||{}),Wr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Wr||{}),Un=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(Un||{}),qd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(qd||{}),Fd=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(Fd||{}),Ss=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ss||{});const Vn=bn({localId:dt,componentPath:Fc(dt),sharedConfigurationModelId:$h(dt)});let ES=class{mapToDecisions(t){return{}}mapToSessionId(t){return ue(t).with({sessionId:Ct.string},n=>ja(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=w(n.constraintExplanations,W(i=>this.mapToConstraintExplanation(i)));return Oi({type:we.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Oi({type:we.ConfigurationModelInvalid})).otherwise(()=>Oi({type:we.Unknown}))}mapToExplainAnswer(t,n){const r=ue(n).with({question:Kn.whyIsStateNotPossible,subject:pn.boolean},a=>[{type:Ee.Boolean,attributeId:a.attributeId,value:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:pn.numeric},a=>[{type:Ee.Numeric,attributeId:a.attributeId,value:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:pn.component},a=>[{type:Ee.Component,attributeId:a.attributeId,state:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:pn.choiceValue},a=>[{type:Ee.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:je(a.state)}]).otherwise(()=>[]),i=w(t.decisionExplanations,W(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=w(t.constraintExplanations,W(a=>this.mapToConstraintExplanation(a)));return ue(n).with({answerType:vo.decisions},()=>({decisionExplanations:i})).with({answerType:vo.constraints},()=>({constraintExplanations:o})).with({answerType:vo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:we.ConfigurationSetManyConflict,decisionExplanations:w(t.decisionExplanations,W(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:w(t.constraintExplanations,W(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:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Ce(t.state)}}mapToNumericDecision(t){return{type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Ce(t.state)}}mapToComponentDecision(t){return{type:Ee.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:Ee.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 w(this.mapToDecisionState(t.state),ee(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:w(t.causedByRules,W(n=>this.mapToRuleConstraint(n))),causedByCardinalities:w(t.causedByCardinalities,W(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=w(t.booleanDecisions??[],W(a=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Ce(a.state)}))),r=w(t.numericDecisions??[],W(a=>({type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Ce(a.state)}))),i=w(t.componentDecisions??[],W(a=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:w(Ce(a.state),ee(s=>this.mapToDecisionState(s)),Od)}))),o=w(t.choiceDecisions??[],W(a=>({type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:w(Ce(a.state),ee(s=>this.mapToDecisionState(s)),Od)})));return w([],Pe(n),Pe(r),Pe(i),Pe(o))}mapToDecisionExplanation(t,n,r){const i=w(t.causedByBooleanDecisions,W(p=>this.mapToCausedByBooleanDecision(p))),o=w(t.causedByNumericDecisions,W(p=>this.mapToCausedByNumericDecision(p))),a=w(t.causedByComponentDecisions,W(p=>this.mapToCausedByComponentDecision(p))),s=w(t.causedByChoiceDecisions,W(p=>this.mapToCausedByChoiceValueDecision(p))),u=w(i,W(p=>({type:Ee.Boolean,attributeId:p.attributeId,value:ge}))),l=w(o,W(p=>({type:Ee.Numeric,attributeId:p.attributeId,value:ge}))),c=w(a,W(p=>({type:Ee.Component,attributeId:p.attributeId,state:ge}))),f=w(s,W(p=>({type:Ee.ChoiceValue,attributeId:p.attributeId,choiceValueId:p.choiceValueId,state:ge}))),d=w([],Pe(u),Pe(l),Pe(c),Pe(f)),h=Qb(Dn((p,v)=>{const g=Cn.equals(p.attributeId,v.attributeId);return ue({a:p,b:v}).with({a:{type:Ee.ChoiceValue},b:{type:Ee.ChoiceValue}},C=>g&&C.a.choiceValueId===C.b.choiceValueId).otherwise(()=>g)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:w([],Pe(d),Pe(h)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return ue(t).with(qd.NotAvailable,()=>kd.NotAvailable).with(qd.StateNotPossible,()=>kd.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:Ee.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:Ee.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 w(n.canAttributeContributeToConfigurationSatisfaction,dn(h=>Vn.equals(h,d)),bs)}const i=w([],Pe(w(t.choiceValueDecisions,W(d=>d.attributeId))),Pe(w(n.choiceConsequences,W(d=>d.attributeId))),la(Vn)),o=w(i,W(d=>{const h=w(t.choiceValueDecisions??[],NE(v=>Vn.equals(v.attributeId,d))),p=w(n.choiceConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToChoiceAttributes(v,h,r(d))))}),Qn),a=w([],Pe(w(t.numericDecisions,W(d=>d.attributeId))),Pe(w(n.numericConsequences,W(d=>d.attributeId))),la(Vn)),s=w(a,W(d=>{const h=w(t.numericDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.numericConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToNumericAttribute(v,h,r(d))))}),Qn),u=w([],Pe(w(t.booleanDecisions,W(d=>d.attributeId))),Pe(w(n.booleanConsequences,W(d=>d.attributeId))),la(Vn)),l=w(u,W(d=>{const h=w(t.booleanDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.booleanConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToBooleanAttribute(v,h,r(d))))}),Qn),c=w([],Pe(w(t.componentDecisions,W(d=>d.attributeId))),Pe(w(n.componentConsequences,W(d=>d.attributeId))),la(Vn)),f=w(c,W(d=>{const h=w(t.componentDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.componentConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToComponentAttribute(v,h,r(d))))}),Qn);return w([],Pe(o),Pe(f),Pe(s),Pe(l))}mapToComponentAttribute(t,n,r){return{type:ct.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:w(t.possibleDecisionStates,xl(i=>this.mapToPossibleDecisionState(i))),decision:w(n,ar(i=>w(this.mapToDecisionState(i.state),ee(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:w(t.selection,Ce,ee(i=>this.mapToSelection(i)),_t),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=w(t.values,xl(o=>{const a=w(n,dn(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:w(n,ar(i=>w(i.state,Ce,ee(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:w(n,ar(i=>w(i.state,Ce,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=w(t.possibleDecisionStates,xl(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:w(n,ar(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return ue(t).with(Ks.Implicit,()=>Rt.Implicit).with(Ks.Explicit,()=>Rt.Explicit).exhaustive()}mapToDecisionState(t){return ue(t).with(Wr.Included,()=>je(Qt.Included)).with(Wr.Excluded,()=>je(Qt.Excluded)).with(Wr.Undefined,()=>ge).exhaustive()}mapToPossibleDecisionState(t){return ue(t).with(xo.Included,()=>Qt.Included).with(xo.Excluded,()=>Qt.Excluded).exhaustive()}mapToSelection(t){return ue(t).with(jd.Mandatory,()=>Co.Mandatory).with(jd.Optional,()=>Co.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(_d.Always,()=>wo.Always).with(_d.Optional,()=>wo.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},IS=class{constructor(t,n){this.restToDomainMapper=new ES,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=Md(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return w(r,gr(i=>Br(i,"ServerSideSessionLifetimeHandler - create")),mr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return w(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===TS.NoContent?je({}):ge),gr(n=>Br(n,"ServerSideSessionLifetimeHandler - close")),Xt(Vr))}};const Nh={whyIsNotSatisfied:{configuration:{question:xn.whyIsNotSatisfied,subject:zt.configuration},attribute:e=>({question:xn.whyIsNotSatisfied,subject:zt.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:xn.whyIsStateNotPossible,subject:zt.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:zt.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:zt.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:zt.component,attributeId:e,state:t})})}},UA=Object.freeze(Object.defineProperty({__proto__:null,explainQuestionBuilder:Nh},Symbol.toStringTag,{value:"Module"}));let GA=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=ge}setOnConfigurationChangedHandler(t){const n=w(t,Ce,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 w(this.inner.setSessionContext(n),Xt(Vr),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await w(this.inner.restoreConfiguration(n),Xt(Vr),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await w(this.inner.makeDecision(n),Xt(Vr),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await w(this.inner.setMany(r,i),Xt(Vr),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await w(this.inner.applySolution(n),Xt(Vr),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(Nh):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await w(this.inner.explain(i),Xt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await w(this.inner.close(),gr(t=>this.domainToContractMapper.mapToFailureResult(t)),Kl(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Zn(gr(t=>this.domainToContractMapper.mapToFailureResult(t)),Kl(t=>Promise.reject(t),t=>Promise.resolve(t)))}},zA=class{mapToExplainQuestion(t,n){const r={answerType:ue(n).with("decisions",()=>vo.decisions).with("constraints",()=>vo.constraints).with("full",()=>vo.all).exhaustive()};return ue(t).with({question:xn.whyIsNotSatisfied,subject:zt.configuration},i=>({...r,question:Kn.whyIsNotSatisfied,subject:pn.configuration})).with({question:xn.whyIsNotSatisfied,subject:zt.attribute},i=>({...r,question:Kn.whyIsNotSatisfied,subject:pn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:xn.whyIsStateNotPossible,subject:zt.choiceValue},i=>({...r,question:Kn.whyIsStateNotPossible,subject:pn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:xn.whyIsStateNotPossible,subject:zt.component},i=>({...r,question:Kn.whyIsStateNotPossible,subject:pn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:xn.whyIsStateNotPossible,subject:zt.numeric},i=>({...r,question:Kn.whyIsStateNotPossible,subject:pn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:xn.whyIsStateNotPossible,subject:zt.boolean},i=>({...r,question:Kn.whyIsStateNotPossible,subject:pn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:w(t.attributes,W(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return w(t,W(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:Oe.Choice,choiceValueId:Ct.string},n=>({type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:Oe.Numeric},n=>({type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:Ce(n.state)})).with({type:Oe.Boolean},n=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:Ce(n.state)})).with({type:Oe.Component},n=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(Ce(n.state),ar(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return w(Ce(t),ee(n=>w(n,W(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:w(r.decisions,W(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:Yr.Package},n=>({type:Hs.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Yr.Channel},n=>({type:Hs.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:w(t.decisions,W(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return ue(t).with({type:Oe.Boolean},n=>({type:ct.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:w(n.decision,Ce,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.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:w(n.decision,Ce,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Choice},n=>({type:ct.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:w(n.values,W(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Component},n=>({type:ct.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:w(n.decision,Ce,ar(r=>w(this.mapToDecisionStateOption(r.state),ee(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:w(n.possibleDecisionStates,W(r=>this.mapToDecisionStateOption(r)),Qn),selection:w(n.selection,Ce,ee(r=>this.mapToSelection(r)),_t),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:w(t.possibleDecisionStates,W(n=>this.mapToDecisionStateOption(n)),Qn)}}mapToChoiceValueDecision(t){return w(t.decision,Ce,ar(n=>w(this.mapToDecisionStateOption(n.state),ee(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return ue(t).with(Rr.Implicit,()=>Rt.Implicit).with(Rr.Explicit,()=>Rt.Explicit).exhaustive()}mapToSelection(t){return ue(t).with(Pr.Mandatory,()=>Co.Mandatory).with(Pr.Optional,()=>Co.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(qi.Always,()=>wo.Always).with(qi.Optional,()=>wo.Optional).exhaustive()}mapToDecisionState(t){return ue(t).with(Ct.union(Jr.Included,_i.Included),()=>Qt.Included).with(Ct.union(Jr.Excluded,_i.Excluded),()=>Qt.Excluded).exhaustive()}mapToDecisionStateOption(t){return w(Ce(t),ee(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return w(t,Ce,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return w(t,Ce,ee(n=>ue(n).returnType().with({type:sn.all},()=>({type:mo.all})).with({type:sn.none},()=>({type:mo.none})).with({type:sn.specific},r=>({type:mo.specific,rules:w(r.rules,W(this.mapToGlobalConstraintId))})).exhaustive()))}},AS=class{mapToExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},i=>w(i.decisionExplanations,W(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=ue(t).with({constraintExplanations:Ct.array(Ct.any)},i=>w(i.constraintExplanations,W(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:w(t.causedByCardinalities,W(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:w(t.causedByRules,W(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=w(t.causedByChoiceDecisions,W(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=w(t.causedByComponentDecisions,W(a=>this.mapToCausedByComponentAttributeDecision(a))),i=w(t.causedByNumericDecisions,W(a=>this.mapToCausedByNumericAttributeDecision(a))),o=w(t.causedByBooleanDecisions,W(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:w([],Pe(n),Pe(r),Pe(i),Pe(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:w(t.decisions,W(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(Dh.NumericDecisionOutOfRange,()=>Lc.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=w(n.rejectedDecisions,W(i=>this.mapToExplicitDecision(i)));return SS.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:w(n.constraintExplanations,W(r=>this.mapToConstraintExplanation(r)))})).with({type:we.ConfigurationSetManyConflict},n=>({type:Gt.ConfigurationSetManyConflict,decisionExplanations:w(n.decisionExplanations,W(r=>this.mapToDecisionExplanation(r))),constraintExplanations:w(n.constraintExplanations,W(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:w(t.attributes,W(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return w(t,ee(Zn(W(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:w(n.decisions,W(r=>this.mapToGlobalAttributeId(r)))})))),or)}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:Hs.Package},n=>({type:Yr.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Hs.Channel},n=>({type:Yr.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>({type:Oe.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.state,ee(r=>this.mapToChoiceValueDecisionState(r)),_t),choiceValueId:n.choiceValueId})).with({type:Ee.Component},n=>({type:Oe.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.state,ee(r=>this.mapToComponentDecisionState(r)),_t)})).with({type:Ee.Numeric},n=>({type:Oe.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).with({type:Ee.Boolean},n=>({type:Oe.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).exhaustive()}mapToCardinality(t){return ue(t).with(ya.Cardinality,()=>ma.Cardinality).with(ya.Component,()=>ma.Component).with(ya.Rule,()=>ma.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:Ee.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:Ee.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:Ee.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:Oe.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:Oe.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:Oe.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:Oe.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return ue(t).with(Co.Mandatory,()=>Pr.Mandatory).with(Co.Optional,()=>Pr.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:Oe.Boolean,decision:w(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),or),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ct.Numeric},r=>({...n,type:Oe.Numeric,decision:w(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),or),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ct.Choice},r=>({...n,type:Oe.Choice,cardinality:r.cardinality,values:w(r.values,W(i=>{const o=w(i.decision,ee(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),or);return{id:i.choiceValueId,possibleDecisionStates:w(i.possibleDecisionStates,W(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ct.Component},r=>({...n,type:Oe.Component,decision:w(r.decision,ee(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),or),possibleDecisionStates:w(r.possibleDecisionStates,W(i=>this.mapToComponentDecisionState(i))),selection:w(r.selection,Ce,ee(i=>this.mapToSelection(i)),_t),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return ue(t).with(wo.Always,()=>qi.Always).with(wo.Optional,()=>qi.Optional).exhaustive()}mapToComponentDecisionState(t){return ue(t).with(Qt.Included,()=>_i.Included).with(Qt.Excluded,()=>_i.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return ue(t).with(Qt.Included,()=>Jr.Included).with(Qt.Excluded,()=>Jr.Excluded).exhaustive()}mapToDecisionKind(t){return ue(t).with(Rt.Explicit,()=>Rr.Explicit).with(Rt.Implicit,()=>Rr.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return w(t,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),or)}mapToAllowedRulesInExplain(t){return w(t,ee(n=>ue(n).returnType().with({type:mo.all},()=>({type:sn.all})).with({type:mo.none},()=>({type:sn.none})).with({type:mo.specific},r=>({type:sn.specific,rules:w(r.rules,W(this.mapToGlobalConstraintId))})).exhaustive()),or)}},$S=class{constructor(t,n){this.contractToDomainMapper=new zA,this.domainToContractMapper=new AS,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await w(this.sessionHandler.recreate(n),Xt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new GA(i,this.contractToDomainMapper,this.domainToContractMapper)}),Kl(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 Ph(e){return e.possibleDecisionStates.some(t=>t===Jr.Included)}function OS(e){return!Ph(e)}const WA=Object.freeze(Object.defineProperty({__proto__:null,isAllowed:Ph,isBlocked:OS},Symbol.toStringTag,{value:"Module"}));function HA(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.lowerBound>0).with({type:Oe.Boolean},t=>t.selection===Pr.Mandatory).with({type:Oe.Numeric},t=>t.selection===Pr.Mandatory).with({type:Oe.Component},t=>t.inclusion===qi.Optional&&t.selection===Pr.Mandatory).exhaustive()}function KA(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function YA(e){return w(e.values,Kt(Ph))}function JA(e){return w(e.values,Kt(OS))}function DS(e,t){return w(e.values,jo(n=>w(n.decision,Ce,Jt(r=>r.kind===t))))}function NS(e){return w(e.values,Kt(t=>w(t.decision,Ce,ee(n=>n.state===Jr.Included),lt(()=>!1))))}const XA=NS;function PS(e){return w(e.decision,Ce,Jt(t=>t.kind===Rr.Explicit),or)}function RS(e){return w(e.decision,Ce,Jt(t=>t.kind===Rr.Explicit),or)}function QA(e,t){return e.possibleDecisionStates.some(n=>n===t)}function kS(e){return w(e.decision,Ce,or)}function MS(e){return jS(e,_i.Included)}function ZA(e){return!MS(e)}function jS(e,t){return e.possibleDecisionStates.some(n=>n===t)}const e$=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:YA,getBlockedChoiceValues:JA,getBooleanDecision:RS,getChoiceDecisions:DS,getComponentDecision:kS,getIncludedChoiceValues:NS,getNumericDecision:PS,getSelectedChoiceValues:XA,isBooleanValuePossible:QA,isComponentAllowed:MS,isComponentBlocked:ZA,isComponentStatePossible:jS,isMandatory:HA,isMultiSelect:KA},Symbol.toStringTag,{value:"Module"})),_S=e=>e.type===Oe.Boolean,qS=e=>e.type===Oe.Choice,FS=e=>e.type===Oe.Numeric,LS=e=>e.type===Oe.Component,t$=Cu(dt),_m=Wi(dt);function VS(e,t){const n=a=>t$.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return w(n,PE(t?a=>_m.equals(w(a.componentPath??[],gE(r)),e.componentPath):a=>_m.equals(a.componentPath??[],e.componentPath)))}function n$(e,t,n){const r=w(VS({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:w(t.componentPath??[],mE(t.localId))},n),eS(i=>i.id));return w(e,Kt(r))}function r$(e,t,n){const r=w(VS({sharedConfigurationModelId:t,componentPath:[]},n),eS(i=>i.id));return w(e,Kt(r))}function i$(e){return w(e,Kt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function o$(e,t){return w(BS(e),W(n=>DS(n,t)),Sh,jo(n=>Ce(n)))}function a$(e,t){return w(GS(e),Kt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>PS(n)),jo(n=>Ce(n)))}function s$(e,t){return w(zS(e),Kt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>RS(n)),jo(n=>Ce(n)))}function u$(e,t){return w(US(e),Kt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>kS(n)),jo(n=>Ce(n)))}function BS(e){return w(e.attributes,Kt(qS))}function US(e){return w(e.attributes,Kt(LS))}function GS(e){return w(e.attributes,Kt(FS))}function zS(e){return w(e.attributes,Kt(_S))}function l$(e,t){return w(wu(e,t),_t)}function c$(e,t){return w(WS(e,t),_t)}function f$(e,t,n){return w(WS(e,t),ee(r=>r.values),ar(Zn(dn(r=>r.id===n))),_t)}function d$(e,t){return w(wu(e,t),Jt(FS),_t)}function p$(e,t){return w(wu(e,t),Jt(_S),_t)}function h$(e,t){return w(wu(e,t),Jt(LS),_t)}function wu(e,t){return w(e.attributes,dn(n=>qo.equals(n.id,t)))}function WS(e,t){return w(wu(e,t),Jt(qS))}const Fo=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:n$,filterAttributesOfRoot:i$,filterAttributesOfShared:r$,getAttribute:l$,getBooleanAttribute:p$,getBooleanAttributes:zS,getBooleanDecisions:s$,getChoiceAttribute:c$,getChoiceAttributes:BS,getChoiceDecisions:o$,getChoiceValue:f$,getComponentAttribute:h$,getComponentAttributes:US,getComponentDecisions:u$,getNumericAttribute:d$,getNumericAttributes:GS,getNumericDecisions:a$},Symbol.toStringTag,{value:"Module"})),v$="https://spc.cloud.ceventis.de/api/engine",m$={hcaEngineBaseUrl:v$};function y$(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??m$.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function fs(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const HS=e=>t=>n=>w(n,bE(r=>e.equals(r,t)),ee(r=>w(n,SE(r,i=>t))),Od,lt(()=>w(n,Pe(wE(t))))),Wu=HS({equals:(e,t)=>Cn.equals(e.attributeId,t.attributeId)}),g$=HS({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let b$=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,l,c,f,d;const h=w(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],W(this.restToDomainMapper.mapToGlobalAttributeId)),p=I=>bh(Cn)(I,h),v=w(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),g=w(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=w(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=w(((s=n.consequences)==null?void 0:s.componentConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=w(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=w(((l=n.consequences)==null?void 0:l.numericConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=w(((c=n.affectedDecisions)==null?void 0:c.booleanDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=w(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=w([],Pe(w(T,W(I=>I.attributeId))),Pe(w(E,W(I=>I.attributeId))),Pe(w(b,W(I=>I.attributeId))),Pe(w(x,W(I=>I.attributeId))),Pe(w(v,W(I=>I.attributeId))),Pe(w(g,W(I=>I.attributeId))),Pe(w(C,W(I=>I.attributeId))),Pe(w(m,W(I=>I.attributeId))),la(Cn)),N=w(A,Ad(t.attributes,(I,P)=>{const _=t.attributes.find(L=>Cn.equals(L.attributeId,P));return ue(_).with({type:ct.Choice},(L,U)=>{const Y=this.mergeChoice(U,w(g,dn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(v,Kt(k=>Cn.equals(k.attributeId,P)),W(k=>k.payload)));return Wu(Y)(I)}).with({type:ct.Numeric},(L,U)=>{const Y=this.mergeNumeric(U,w(x,dn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(b,dn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Wu(Y)(I)}).with({type:ct.Boolean},(L,U)=>{const Y=this.mergeBoolean(U,w(E,dn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(T,dn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Wu(Y)(I)}).with({type:ct.Component},(L,U)=>{const Y=this.mergeComponent(U,w(m,dn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(C,dn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Wu(Y)(I)}).exhaustive()}),W(I=>{const P=p(I.attributeId);return I.canContributeToConfigurationSatisfaction!=P?{...I,canContributeToConfigurationSatisfaction:P}:I}));return{...t,isSatisfied:w((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,Ce,lt(()=>t.isSatisfied)),attributes:N}}mergeChoice(t,n,r){const i=w(n,ee(u=>u.values??[]),lt(()=>[])),o=w(r),a=w([],Pe(w(i,W(u=>u.choiceValueId))),Pe(w(o,W(u=>u.choiceValueId))),W(fs),la(dt)),s=w(a,Ad(t.values,(u,l)=>{const c=w(i,dn(p=>p.choiceValueId===l)),f=w(o,dn(p=>p.choiceValueId===l)),d=w(t.values.find(p=>p.choiceValueId===l),Ce),h=this.mergeChoiceValue(l,d,c,f);return g$(h)(u)}));return{...t,isSatisfied:w(n,ee(u=>fs(u.isSatisfied)),lt(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=w(i,ee(s=>({state:this.toDecisionState(fs(s.state)),kind:this.toDecisionKind(fs(s.kind))})),lt(()=>({state:w(n,ar(s=>w(s.decision,ee(u=>u.state)))),kind:w(n,ar(s=>w(s.decision,ee(u=>u.kind))),lt(()=>Rt.Explicit))}))),a=w(r,ee(s=>w(xm(s.possibleDecisionStates??[]),W(u=>this.toPossibleDecisionState(u)),Qn)),lt(()=>w(n,ee(s=>s.possibleDecisionStates??[]),lt(()=>[]))));return{choiceValueId:t,decision:w(o.state,ee(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=w(r,ee(a=>{const s=this.toDecisionState(fs(a.state));return w(s,ee(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),lt(()=>w(t.decision,ee(a=>({state:a.state,kind:a.kind}))))),o=w(n,ee(a=>w(xm(a.possibleDecisionStates??[]),W(s=>this.toPossibleDecisionState(s)),Qn)),lt(()=>t.possibleDecisionStates));return{...t,isSatisfied:w(n,ee(a=>a.isSatisfied),lt(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:w(n,ar(i=>Ce(i.isSatisfied)),lt(()=>t.isSatisfied)),decision:w(r,ji(()=>t.decision,i=>w(i.state,Ce,ee(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:w(n,ar(i=>Ce(i.isSatisfied)),lt(()=>t.isSatisfied)),decision:w(r,ji(()=>t.decision,i=>w(i.state,Ce,ee(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:w(n,ee(i=>i.possibleDecisionStates),lt(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return ue(t).with(xo.Included,()=>je(Qt.Included)).with(xo.Excluded,()=>je(Qt.Excluded)).otherwise(()=>ge)}toDecisionState(t){return ue(t).with(Wr.Included,()=>je(Qt.Included)).with(Wr.Excluded,()=>je(Qt.Excluded)).otherwise(()=>ge)}toDecisionKind(t){return ue(t).with(Ks.Implicit,()=>Rt.Implicit).with(Ks.Explicit,()=>Rt.Explicit).exhaustive()}},S$=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ee.Component},n=>({type:Un.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ee.Numeric},n=>({type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).with({type:Ee.Boolean},n=>({type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=w([...t],hi(u=>u.type!==Ee.Boolean?ge:je({type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:w(u.value,_t)}))),o=w([...t],hi(u=>u.type!==Ee.Numeric?ge:je({type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:w(u.value,_t)}))),a=w([...t],hi(u=>u.type!==Ee.ChoiceValue?ge:je({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=w([...t],hi(u=>u.type!==Ee.Component?ge:je({type:Un.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=w([...t],hi(a=>a.type!==ct.Boolean?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitBooleanDecision(a))))),r=w([...t],hi(a=>a.type!==ct.Numeric?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitNumericDecision(a))))),i=w([...t],hi(a=>a.type!==ct.Component?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitComponentDecision(a))))),o=w([...t],hi(a=>a.type!==ct.Choice?ge:w(this.mapToExplicitChoiceDecisions(a),Su(s=>w(s,bu)))),OE);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:w(t.componentPath,Ce,ee($d),or),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:ue(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:Ct.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:w(t.decision,ee(n=>n.state),_t)}}mapToExplicitNumericDecision(t){return{type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:w(t.decision,ee(n=>n.state),_t)}}mapToExplicitComponentDecision(t){return{type:Un.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(w(t.decision,ee(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return w(r.decision,ee(i=>i.kind===Rt.Explicit),lt(()=>!1))}return w(t.values,Kt(n),W(r=>({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(w(r.decision,ee(i=>i.state)))})),$d)}mapToDecisionState(t){return w(t,ee(n=>ue(n).with(Qt.Included,()=>Wr.Included).with(Qt.Excluded,()=>Wr.Excluded).exhaustive()),lt(()=>Wr.Undefined))}mapToPossibleDecisionState(t){return ue(t).with(Qt.Included,()=>xo.Included).with(Qt.Excluded,()=>xo.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return ue(t).with({subject:pn.attribute},n=>({type:Fd.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:pn.configuration},()=>({type:Fd.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return ue(t).with({subject:pn.boolean},n=>({type:Ss.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:pn.numeric},n=>({type:Ss.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:pn.component},n=>({type:Ss.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:pn.choiceValue},n=>({type:Ss.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},C$=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return w(t.configuration.attributes,dn(n=>ue(n).with({type:ct.Boolean},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),bs)).with({type:ct.Numeric},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),bs)).with({type:ct.Choice},r=>w(r.values,dn(i=>w(i.decision,ee(o=>o.kind===Rt.Explicit),lt(()=>!1))),bs)).with({type:ct.Component},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),bs)).exhaustive()),ji(()=>!1,()=>!0))},getExplicitDecisions(t){return w(t.configuration.attributes,W(n=>ue(n).with({type:ct.Boolean},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Boolean,attributeId:r.attributeId,value:Ce(i.state)})),ee(i=>[i]))).with({type:ct.Numeric},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Numeric,attributeId:r.attributeId,value:Ce(i.state)})),ee(i=>[i]))).with({type:ct.Choice},r=>w(r.values,W(i=>w(i.decision,Jt(o=>o.kind===Rt.Explicit),ee(o=>({type:Ee.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:Ce(o.state)})))),Qn,$i)).with({type:ct.Component},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Component,attributeId:r.attributeId,state:Ce(i.state)})),ee(i=>[i]))).exhaustive()),Qn,Sh)}}}},w$=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 C$}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)=>w(this.engineApiClient.makeDecision(i,r),gr(Br),Xt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=ue(t).with({question:Kn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Kn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return w(i,gr(Br),Xt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return w(a,mr(s=>{var u,l,c,f;return w([],Pe(w(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],W(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Pe(w(((l=s.rejectedDecisions)==null?void 0:l.numericDecisions)??[],W(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Pe(w(((c=s.rejectedDecisions)==null?void 0:c.componentDecisions)??[],W(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Pe(w(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],W(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),ca(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 w(i,Xt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return w(o,gr(Br),mr(a=>{const s={rejectedDecisions:{booleanDecisions:Ct.array(Ct.any)}},u={decisionExplanations:Ct.array(Ct.any)};return ue(a).with(s,l=>ja(l)).with(u,l=>Oi(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(l,i,n))).otherwise(()=>Oi({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 w(ca(t),mr(r=>w(r.sessionId,ji(()=>this.initializeInner(r,!1),()=>ca(r)))),mr(r=>w(r.sessionId,Eh(()=>({type:we.ConfigurationUnauthenticated})),mr(i=>n(i,r)))))}initializeInner(t,n){return w(sI,()=>w(t.sessionId,yI,bI(s=>n?mI(s):w(this.sessionHandler.close(s),Kl(()=>ge,()=>ge)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return w(s,tI(()=>({type:we.ConfigurationUnauthenticated})),oS(()=>this.sessionHandler.create(u)))},s=>w(s,uI(u=>w($i(t),Jt(this.interpreter.configurationSession.hasExplicitDecisions),ee(l=>this.replaceDecisions(u,l)),lt(()=>ca({}))))),s=>w(s,mr(u=>{const l=this.determineConsequences(u),c=this.determineDecisions(u),f=RT(iI)({consequences:l,decisions:c});return w(f,Xt(({decisions:d,consequences:h})=>this.restToDomainMapper.mapToConfigurationModel(d,h)),Xt(d=>({sessionId:$i(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return w(this.engineApiClient.getDecisions(t),gr(Br))}determineConsequences(t){return w(this.engineApiClient.getConsequence(t),gr(Br))}},x$=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 w(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return w(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:ge}}restoreConfiguration(t){return w(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return w(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return w(this.configurationSession.sessionId,ee(t=>this.sessionHandler.close(t)),ee(Zn(Xt(t=>{this.configurationSession={...this.configurationSession,sessionId:ge}}))),lt(Dc(wA())))}applySolution(t){return w(this.configurationSession.solutions,dn(n=>RA.equals(n,t)),Eh(()=>({type:we.ConfigurationSolutionNotAvailable})),Xt(n=>n.decisions),mr(n=>this.setMany(n,t.mode)))}setMany(t,n){return w(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),Yl(r=>()=>{const i=ue(r).with({decisionExplanations:Ct.array(Ct.any)},o=>je(o.decisionExplanations)).otherwise(()=>ge);this.configurationSession={...this.configurationSession,solutions:w(i,ee(Zn(W(o=>o.solution))),lt(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},r=>r.decisionExplanations).otherwise(()=>[]);return w(n,W(r=>r.solution))}invalidateAvailableSolutions(){return cI(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Yl(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Us(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Zn(Us(t=>()=>{this.configurationSession=t,w(this.onConfigurationChangedHandler,dI(n=>()=>n(this.configurationSession.configuration)))}),Xt(t=>t.configuration),this.invalidateAvailableSolutions())}},T$=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=sA(r,oA.concat(uA(i),aA(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Uo(this.policy,r,i=>w(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 ue(t).with({type:we.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:we.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},E$=class{constructor(){this.queue=[],this.operating=ge}push(t){const n=new I$(t);return this.queue.push(n),this.operating=w(this.operating,lt(()=>this.start()),$i),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=w(t,W(r=>r.argument),Ad(ge,(r,i)=>this.reduce(r,i)),ee(Zn(r=>this.execute(r),r=>r.then(i=>{w(t,W(o=>{o.resolve(i)}))}).catch(i=>{w(t,W(o=>{o.reject(i)}))}))),_t);n&&await n}this.operating=ge}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},I$=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},A$=class extends E${constructor(t){super(),this.inner=t}reduce(t,n){return je(n)}async execute(t){return await this.inner.setSessionContext(t)()}},$$=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new A$(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(IA.equals(n,t))return ja(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)}},O$=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)),w(r(),Yl(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Us(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)}},D$=class KS{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+gS()}static new(t){return new KS(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 N$(e){e=y$(e);const t=new BA(e.hcaEngineBaseUrl),n=new ES,r=new S$,i=new AS,o=new CS,a=new b$(n),s=ue(e.sessionHandler).with({create:Ct.any,close:Ct.any},c=>c).with({accessToken:Ct.string},c=>new xS(t,o,n,c)).with({sessionCreateUrl:Ct.string,sessionDeleteUrl:Ct.string},c=>new IS(o,c)).exhaustive(),u=new w$(s,t,n,r,i,a),l=(c,f)=>w(new x$(c,f),d=>new T$(d),d=>new $$(d),D$.new,d=>new O$(d,!1));return new $S(u,l)}const YS=qo.equals,JS=Oh.equals,P$=bS.equals,R$=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:sn,AttributeInterpreter:e$,AttributeType:Oe,ChoiceValueDecisionState:Jr,ChoiceValueInterpreter:WA,ClientSideSessionLifetimeHandler:xS,ComponentDecisionState:_i,ConfigurationConflictReason:Lc,ConfigurationInterpreter:Fo,ConfigurationModelSourceType:Yr,ConfiguratorClient:$S,ConstraintType:ma,ContractToRestMapper:CS,DecisionKind:Rr,ExplainQuestionBuilderModule:UA,ExplainQuestionSubject:zt,ExplainQuestionType:xn,FailureType:Gt,Inclusion:qi,Results:SA,Selection:Pr,ServerSideSessionLifetimeHandler:IS,Types:bA,causedByDecisionEquals:P$,createClient:N$,explainQuestionBuilder:Nh,globalAttributeIdEquals:YS,globalConstraintIdEquals:JS},Symbol.toStringTag,{value:"Module"}));/*! *****************************************************************************
|
|
4
|
+
${JSON.stringify(e,null,2)}`)}var Rs=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(Rs||{}),TS=(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))(TS||{});const LA=e=>Object.values(TS).includes(e),VA=e=>LA(e)?je(e):ge;function BA(e){const t=n=>ue(n).with("ConfigurationModelNotFound",()=>({type:we.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:we.DecisionsToRespectInvalid})).with(Ct.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:we.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:we.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:we.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:we.ConfigurationConflict,reason:Oh.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:we.ConfigurationConflict})).with(Ct.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 w(e.type,VA,ee(t))}const UA=e=>Object.values(Rs).includes(e),GA=e=>UA(e)?je(e):ge;function zA(e){return w(e,GA,ee(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 Ur(e,t){FA(e,t);const n=e.type;return w(ge,Em(()=>BA(e)),Em(()=>zA(n)),lt(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:we.Unknown})))}let ES=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 w(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),br(r=>Ur(r,"ClientSideSessionLifetimeHandler - create")),yr(r=>this.restToDomainMapper.mapToSessionId(r)),EA(()=>({type:we.ConfigurationUnauthenticated})))}close(t){return w(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),br(n=>Ur(n,"ClientSideSessionLifetimeHandler - close")),Xt(()=>Br()))}};var IS=(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))(IS||{});function Fr(e,t,n){const r=w(Array.isArray(e)?e:[e],uA);return w(Im(()=>fetch(r,t),i=>({type:"error"})),yr(i=>w(Im(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),sS(i=>i.status===401?Oi({type:Rs.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?ja({response:i,data:{}}):i.type==="error"?Oi({type:Rs.LowLevelCommunicationError}):Oi({type:Rs.UnhandledResponseStatus})),yr(i=>w(n(i),Th(()=>i.data))))}function Md(e,t){return Fr(e,t,n=>{if(n.response.status===200)return $i(n.data);if(n.response.status===409){const r=n.data;return ue(r).with({type:"ConfigurationModelInvalid"},i=>$i(r)).with({type:"ConfigurationModelNotFeasible"},i=>$i(r)).otherwise(()=>ge)}return ge})}let WA=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 Md([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 Md([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):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 Fr([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?je(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 Fr([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?je(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 Fr([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?je(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 Fr([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?je(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 Fr([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?je(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 Fr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?je({}):ge)}};var xo=(e=>(e.Included="Included",e.Excluded="Excluded",e))(xo||{}),jd=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(jd||{}),_d=(e=>(e.Always="Always",e.Optional="Optional",e))(_d||{}),Ks=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Ks||{}),Hr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Hr||{}),Un=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(Un||{}),qd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(qd||{}),Fd=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(Fd||{}),Ss=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ss||{});const Vn=bn({localId:dt,componentPath:Fc(dt),sharedConfigurationModelId:Ah(dt)});let AS=class{mapToDecisions(t){return{}}mapToSessionId(t){return ue(t).with({sessionId:Ct.string},n=>ja(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=w(n.constraintExplanations,W(i=>this.mapToConstraintExplanation(i)));return Oi({type:we.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Oi({type:we.ConfigurationModelInvalid})).otherwise(()=>Oi({type:we.Unknown}))}mapToExplainAnswer(t,n){const r=ue(n).with({question:Kn.whyIsStateNotPossible,subject:hn.boolean},a=>[{type:Ee.Boolean,attributeId:a.attributeId,value:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:hn.numeric},a=>[{type:Ee.Numeric,attributeId:a.attributeId,value:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:hn.component},a=>[{type:Ee.Component,attributeId:a.attributeId,state:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:hn.choiceValue},a=>[{type:Ee.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:je(a.state)}]).otherwise(()=>[]),i=w(t.decisionExplanations,W(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=w(t.constraintExplanations,W(a=>this.mapToConstraintExplanation(a)));return ue(n).with({answerType:vo.decisions},()=>({decisionExplanations:i})).with({answerType:vo.constraints},()=>({constraintExplanations:o})).with({answerType:vo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:we.ConfigurationSetManyConflict,decisionExplanations:w(t.decisionExplanations,W(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:w(t.constraintExplanations,W(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:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Ce(t.state)}}mapToNumericDecision(t){return{type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Ce(t.state)}}mapToComponentDecision(t){return{type:Ee.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:Ee.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 w(this.mapToDecisionState(t.state),ee(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:w(t.causedByRules,W(n=>this.mapToRuleConstraint(n))),causedByCardinalities:w(t.causedByCardinalities,W(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=w(t.booleanDecisions??[],W(a=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Ce(a.state)}))),r=w(t.numericDecisions??[],W(a=>({type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Ce(a.state)}))),i=w(t.componentDecisions??[],W(a=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:w(Ce(a.state),ee(s=>this.mapToDecisionState(s)),Od)}))),o=w(t.choiceDecisions??[],W(a=>({type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:w(Ce(a.state),ee(s=>this.mapToDecisionState(s)),Od)})));return w([],Pe(n),Pe(r),Pe(i),Pe(o))}mapToDecisionExplanation(t,n,r){const i=w(t.causedByBooleanDecisions,W(p=>this.mapToCausedByBooleanDecision(p))),o=w(t.causedByNumericDecisions,W(p=>this.mapToCausedByNumericDecision(p))),a=w(t.causedByComponentDecisions,W(p=>this.mapToCausedByComponentDecision(p))),s=w(t.causedByChoiceDecisions,W(p=>this.mapToCausedByChoiceValueDecision(p))),u=w(i,W(p=>({type:Ee.Boolean,attributeId:p.attributeId,value:ge}))),l=w(o,W(p=>({type:Ee.Numeric,attributeId:p.attributeId,value:ge}))),c=w(a,W(p=>({type:Ee.Component,attributeId:p.attributeId,state:ge}))),f=w(s,W(p=>({type:Ee.ChoiceValue,attributeId:p.attributeId,choiceValueId:p.choiceValueId,state:ge}))),d=w([],Pe(u),Pe(l),Pe(c),Pe(f)),h=eS(Dn((p,v)=>{const g=Cn.equals(p.attributeId,v.attributeId);return ue({a:p,b:v}).with({a:{type:Ee.ChoiceValue},b:{type:Ee.ChoiceValue}},C=>g&&C.a.choiceValueId===C.b.choiceValueId).otherwise(()=>g)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:w([],Pe(d),Pe(h)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return ue(t).with(qd.NotAvailable,()=>kd.NotAvailable).with(qd.StateNotPossible,()=>kd.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:Ee.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:Ee.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 w(n.canAttributeContributeToConfigurationSatisfaction,pn(h=>Vn.equals(h,d)),bs)}const i=w([],Pe(w(t.choiceValueDecisions,W(d=>d.attributeId))),Pe(w(n.choiceConsequences,W(d=>d.attributeId))),la(Vn)),o=w(i,W(d=>{const h=w(t.choiceValueDecisions??[],ME(v=>Vn.equals(v.attributeId,d))),p=w(n.choiceConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToChoiceAttributes(v,h,r(d))))}),Qn),a=w([],Pe(w(t.numericDecisions,W(d=>d.attributeId))),Pe(w(n.numericConsequences,W(d=>d.attributeId))),la(Vn)),s=w(a,W(d=>{const h=w(t.numericDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.numericConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToNumericAttribute(v,h,r(d))))}),Qn),u=w([],Pe(w(t.booleanDecisions,W(d=>d.attributeId))),Pe(w(n.booleanConsequences,W(d=>d.attributeId))),la(Vn)),l=w(u,W(d=>{const h=w(t.booleanDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.booleanConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToBooleanAttribute(v,h,r(d))))}),Qn),c=w([],Pe(w(t.componentDecisions,W(d=>d.attributeId))),Pe(w(n.componentConsequences,W(d=>d.attributeId))),la(Vn)),f=w(c,W(d=>{const h=w(t.componentDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.componentConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToComponentAttribute(v,h,r(d))))}),Qn);return w([],Pe(o),Pe(f),Pe(s),Pe(l))}mapToComponentAttribute(t,n,r){return{type:ct.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:w(t.possibleDecisionStates,xl(i=>this.mapToPossibleDecisionState(i))),decision:w(n,ar(i=>w(this.mapToDecisionState(i.state),ee(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:w(t.selection,Ce,ee(i=>this.mapToSelection(i)),_t),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=w(t.values,xl(o=>{const a=w(n,pn(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:w(n,ar(i=>w(i.state,Ce,ee(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:w(n,ar(i=>w(i.state,Ce,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=w(t.possibleDecisionStates,xl(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:w(n,ar(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return ue(t).with(Ks.Implicit,()=>Rt.Implicit).with(Ks.Explicit,()=>Rt.Explicit).exhaustive()}mapToDecisionState(t){return ue(t).with(Hr.Included,()=>je(Qt.Included)).with(Hr.Excluded,()=>je(Qt.Excluded)).with(Hr.Undefined,()=>ge).exhaustive()}mapToPossibleDecisionState(t){return ue(t).with(xo.Included,()=>Qt.Included).with(xo.Excluded,()=>Qt.Excluded).exhaustive()}mapToSelection(t){return ue(t).with(jd.Mandatory,()=>Co.Mandatory).with(jd.Optional,()=>Co.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(_d.Always,()=>wo.Always).with(_d.Optional,()=>wo.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},$S=class{constructor(t,n){this.restToDomainMapper=new AS,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=Md(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return w(r,br(i=>Ur(i,"ServerSideSessionLifetimeHandler - create")),yr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return w(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===IS.NoContent?je({}):ge),br(n=>Ur(n,"ServerSideSessionLifetimeHandler - close")),Xt(Br))}};const Dh={whyIsNotSatisfied:{configuration:{question:xn.whyIsNotSatisfied,subject:Wt.configuration},attribute:e=>({question:xn.whyIsNotSatisfied,subject:Wt.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:xn.whyIsStateNotPossible,subject:Wt.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:Wt.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:Wt.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:Wt.component,attributeId:e,state:t})})}},HA=Object.freeze(Object.defineProperty({__proto__:null,explainQuestionBuilder:Dh},Symbol.toStringTag,{value:"Module"}));let KA=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=ge}setOnConfigurationChangedHandler(t){const n=w(t,Ce,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 w(this.inner.setSessionContext(n),Xt(Br),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await w(this.inner.restoreConfiguration(n),Xt(Br),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await w(this.inner.makeDecision(n),Xt(Br),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await w(this.inner.setMany(r,i),Xt(Br),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await w(this.inner.applySolution(n),Xt(Br),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(Dh):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await w(this.inner.explain(i),Xt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await w(this.inner.close(),br(t=>this.domainToContractMapper.mapToFailureResult(t)),Kl(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Zn(br(t=>this.domainToContractMapper.mapToFailureResult(t)),Kl(t=>Promise.reject(t),t=>Promise.resolve(t)))}},YA=class{mapToExplainQuestion(t,n){const r={answerType:ue(n).with("decisions",()=>vo.decisions).with("constraints",()=>vo.constraints).with("full",()=>vo.all).exhaustive()};return ue(t).with({question:xn.whyIsNotSatisfied,subject:Wt.configuration},i=>({...r,question:Kn.whyIsNotSatisfied,subject:hn.configuration})).with({question:xn.whyIsNotSatisfied,subject:Wt.attribute},i=>({...r,question:Kn.whyIsNotSatisfied,subject:hn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:xn.whyIsStateNotPossible,subject:Wt.choiceValue},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:xn.whyIsStateNotPossible,subject:Wt.component},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:xn.whyIsStateNotPossible,subject:Wt.numeric},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:xn.whyIsStateNotPossible,subject:Wt.boolean},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:w(t.attributes,W(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return w(t,W(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:Oe.Choice,choiceValueId:Ct.string},n=>({type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:Oe.Numeric},n=>({type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:Ce(n.state)})).with({type:Oe.Boolean},n=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:Ce(n.state)})).with({type:Oe.Component},n=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(Ce(n.state),ar(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return w(Ce(t),ee(n=>w(n,W(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:w(r.decisions,W(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:Hs.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Jr.Channel},n=>({type:Hs.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:w(t.decisions,W(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return ue(t).with({type:Oe.Boolean},n=>({type:ct.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:w(n.decision,Ce,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.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:w(n.decision,Ce,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Choice},n=>({type:ct.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:w(n.values,W(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Component},n=>({type:ct.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:w(n.decision,Ce,ar(r=>w(this.mapToDecisionStateOption(r.state),ee(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:w(n.possibleDecisionStates,W(r=>this.mapToDecisionStateOption(r)),Qn),selection:w(n.selection,Ce,ee(r=>this.mapToSelection(r)),_t),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:w(t.possibleDecisionStates,W(n=>this.mapToDecisionStateOption(n)),Qn)}}mapToChoiceValueDecision(t){return w(t.decision,Ce,ar(n=>w(this.mapToDecisionStateOption(n.state),ee(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return ue(t).with(kr.Implicit,()=>Rt.Implicit).with(kr.Explicit,()=>Rt.Explicit).exhaustive()}mapToSelection(t){return ue(t).with(Rr.Mandatory,()=>Co.Mandatory).with(Rr.Optional,()=>Co.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(qi.Always,()=>wo.Always).with(qi.Optional,()=>wo.Optional).exhaustive()}mapToDecisionState(t){return ue(t).with(Ct.union(Xr.Included,_i.Included),()=>Qt.Included).with(Ct.union(Xr.Excluded,_i.Excluded),()=>Qt.Excluded).exhaustive()}mapToDecisionStateOption(t){return w(Ce(t),ee(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return w(t,Ce,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return w(t,Ce,ee(n=>ue(n).returnType().with({type:sn.all},()=>({type:mo.all})).with({type:sn.none},()=>({type:mo.none})).with({type:sn.specific},r=>({type:mo.specific,rules:w(r.rules,W(this.mapToGlobalConstraintId))})).exhaustive()))}},OS=class{mapToExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},i=>w(i.decisionExplanations,W(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=ue(t).with({constraintExplanations:Ct.array(Ct.any)},i=>w(i.constraintExplanations,W(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:w(t.causedByCardinalities,W(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:w(t.causedByRules,W(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=w(t.causedByChoiceDecisions,W(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=w(t.causedByComponentDecisions,W(a=>this.mapToCausedByComponentAttributeDecision(a))),i=w(t.causedByNumericDecisions,W(a=>this.mapToCausedByNumericAttributeDecision(a))),o=w(t.causedByBooleanDecisions,W(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:w([],Pe(n),Pe(r),Pe(i),Pe(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:w(t.decisions,W(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:zt.ConfigurationConflict,reason:ue(n.reason).with(Oh.NumericDecisionOutOfRange,()=>Lc.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:we.ConfigurationApplicationError},()=>({type:zt.ConfigurationApplicationError})).with({type:we.ConfigurationUnauthenticated},()=>({type:zt.ConfigurationUnauthenticated})).with({type:we.ConfigurationModelNotFound},()=>({type:zt.ConfigurationModelNotFound})).with({type:we.ConfigurationTimeout},()=>({type:zt.ConfigurationTimeout})).with({type:we.ConfigurationAttributeNotFound},()=>({type:zt.ConfigurationAttributeNotFound})).with({type:we.ConfigurationChoiceValueNotFound},()=>({type:zt.ConfigurationChoiceValueNotFound})).with({type:we.ConfigurationSolutionNotAvailable},()=>({type:zt.ConfigurationSolutionNotAvailable})).with({type:we.ConfigurationRejectedDecisionsConflict},n=>{const r=w(n.rejectedDecisions,W(i=>this.mapToExplicitDecision(i)));return wS.createConfigurationRejectedDecisionsConflict(r)}).with({type:we.DecisionsToRespectInvalid},()=>({type:zt.DecisionsToRespectInvalid})).with({type:we.ServiceError},()=>({type:zt.ServiceError})).with({type:we.CommunicationError},()=>({type:zt.CommunicationError})).with({type:we.Unknown},()=>({type:zt.Unknown})).with({type:we.ConfigurationModelInvalid},()=>({type:zt.ConfigurationModelInvalid})).with({type:we.ConfigurationInitializationFailure},()=>({type:zt.ConfigurationInitializationFailure})).with({type:we.ConfigurationModelNotFeasible},n=>({type:zt.ConfigurationModelNotFeasible,constraintExplanations:w(n.constraintExplanations,W(r=>this.mapToConstraintExplanation(r)))})).with({type:we.ConfigurationSetManyConflict},n=>({type:zt.ConfigurationSetManyConflict,decisionExplanations:w(n.decisionExplanations,W(r=>this.mapToDecisionExplanation(r))),constraintExplanations:w(n.constraintExplanations,W(r=>this.mapToConstraintExplanation(r)))})).with({type:we.SpecifiedDeploymentForbidden},n=>({type:zt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:w(t.attributes,W(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return w(t,ee(Zn(W(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:w(n.decisions,W(r=>this.mapToGlobalAttributeId(r)))})))),or)}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:Hs.Package},n=>({type:Jr.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Hs.Channel},n=>({type:Jr.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>({type:Oe.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.state,ee(r=>this.mapToChoiceValueDecisionState(r)),_t),choiceValueId:n.choiceValueId})).with({type:Ee.Component},n=>({type:Oe.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.state,ee(r=>this.mapToComponentDecisionState(r)),_t)})).with({type:Ee.Numeric},n=>({type:Oe.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).with({type:Ee.Boolean},n=>({type:Oe.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).exhaustive()}mapToCardinality(t){return ue(t).with(ya.Cardinality,()=>ma.Cardinality).with(ya.Component,()=>ma.Component).with(ya.Rule,()=>ma.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:Ee.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:Ee.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:Ee.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:Oe.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:Oe.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:Oe.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:Oe.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return ue(t).with(Co.Mandatory,()=>Rr.Mandatory).with(Co.Optional,()=>Rr.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:Oe.Boolean,decision:w(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),or),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ct.Numeric},r=>({...n,type:Oe.Numeric,decision:w(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),or),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ct.Choice},r=>({...n,type:Oe.Choice,cardinality:r.cardinality,values:w(r.values,W(i=>{const o=w(i.decision,ee(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),or);return{id:i.choiceValueId,possibleDecisionStates:w(i.possibleDecisionStates,W(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ct.Component},r=>({...n,type:Oe.Component,decision:w(r.decision,ee(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),or),possibleDecisionStates:w(r.possibleDecisionStates,W(i=>this.mapToComponentDecisionState(i))),selection:w(r.selection,Ce,ee(i=>this.mapToSelection(i)),_t),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return ue(t).with(wo.Always,()=>qi.Always).with(wo.Optional,()=>qi.Optional).exhaustive()}mapToComponentDecisionState(t){return ue(t).with(Qt.Included,()=>_i.Included).with(Qt.Excluded,()=>_i.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return ue(t).with(Qt.Included,()=>Xr.Included).with(Qt.Excluded,()=>Xr.Excluded).exhaustive()}mapToDecisionKind(t){return ue(t).with(Rt.Explicit,()=>kr.Explicit).with(Rt.Implicit,()=>kr.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return w(t,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),or)}mapToAllowedRulesInExplain(t){return w(t,ee(n=>ue(n).returnType().with({type:mo.all},()=>({type:sn.all})).with({type:mo.none},()=>({type:sn.none})).with({type:mo.specific},r=>({type:sn.specific,rules:w(r.rules,W(this.mapToGlobalConstraintId))})).exhaustive()),or)}},DS=class{constructor(t,n){this.contractToDomainMapper=new YA,this.domainToContractMapper=new OS,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await w(this.sessionHandler.recreate(n),Xt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new KA(i,this.contractToDomainMapper,this.domainToContractMapper)}),Kl(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 Nh(e){return e.possibleDecisionStates.some(t=>t===Xr.Included)}function NS(e){return!Nh(e)}const JA=Object.freeze(Object.defineProperty({__proto__:null,isAllowed:Nh,isBlocked:NS},Symbol.toStringTag,{value:"Module"}));function XA(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.lowerBound>0).with({type:Oe.Boolean},t=>t.selection===Rr.Mandatory).with({type:Oe.Numeric},t=>t.selection===Rr.Mandatory).with({type:Oe.Component},t=>t.inclusion===qi.Optional&&t.selection===Rr.Mandatory).exhaustive()}function QA(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function ZA(e){return w(e.values,Yt(Nh))}function e$(e){return w(e.values,Yt(NS))}function PS(e,t){return w(e.values,jo(n=>w(n.decision,Ce,Jt(r=>r.kind===t))))}function RS(e){return w(e.values,Yt(t=>w(t.decision,Ce,ee(n=>n.state===Xr.Included),lt(()=>!1))))}const t$=RS;function kS(e){return w(e.decision,Ce,Jt(t=>t.kind===kr.Explicit),or)}function MS(e){return w(e.decision,Ce,Jt(t=>t.kind===kr.Explicit),or)}function n$(e,t){return e.possibleDecisionStates.some(n=>n===t)}function jS(e){return w(e.decision,Ce,or)}function _S(e){return qS(e,_i.Included)}function r$(e){return!_S(e)}function qS(e,t){return e.possibleDecisionStates.some(n=>n===t)}const i$=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:ZA,getBlockedChoiceValues:e$,getBooleanDecision:MS,getChoiceDecisions:PS,getComponentDecision:jS,getIncludedChoiceValues:RS,getNumericDecision:kS,getSelectedChoiceValues:t$,isBooleanValuePossible:n$,isComponentAllowed:_S,isComponentBlocked:r$,isComponentStatePossible:qS,isMandatory:XA,isMultiSelect:QA},Symbol.toStringTag,{value:"Module"})),FS=e=>e.type===Oe.Boolean,LS=e=>e.type===Oe.Choice,VS=e=>e.type===Oe.Numeric,BS=e=>e.type===Oe.Component,o$=Cu(dt),qm=Wi(dt);function US(e,t){const n=a=>o$.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return w(n,jE(t?a=>qm.equals(w(a.componentPath??[],wE(r)),e.componentPath):a=>qm.equals(a.componentPath??[],e.componentPath)))}function a$(e,t,n){const r=w(US({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:w(t.componentPath??[],SE(t.localId))},n),nS(i=>i.id));return w(e,Yt(r))}function s$(e,t,n){const r=w(US({sharedConfigurationModelId:t,componentPath:[]},n),nS(i=>i.id));return w(e,Yt(r))}function u$(e){return w(e,Yt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function l$(e,t){return w(GS(e),W(n=>PS(n,t)),bh,jo(n=>Ce(n)))}function c$(e,t){return w(WS(e),Yt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>kS(n)),jo(n=>Ce(n)))}function f$(e,t){return w(HS(e),Yt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>MS(n)),jo(n=>Ce(n)))}function d$(e,t){return w(zS(e),Yt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>jS(n)),jo(n=>Ce(n)))}function GS(e){return w(e.attributes,Yt(LS))}function zS(e){return w(e.attributes,Yt(BS))}function WS(e){return w(e.attributes,Yt(VS))}function HS(e){return w(e.attributes,Yt(FS))}function p$(e,t){return w(wu(e,t),_t)}function h$(e,t){return w(KS(e,t),_t)}function v$(e,t,n){return w(KS(e,t),ee(r=>r.values),ar(Zn(pn(r=>r.id===n))),_t)}function m$(e,t){return w(wu(e,t),Jt(VS),_t)}function y$(e,t){return w(wu(e,t),Jt(FS),_t)}function g$(e,t){return w(wu(e,t),Jt(BS),_t)}function wu(e,t){return w(e.attributes,pn(n=>qo.equals(n.id,t)))}function KS(e,t){return w(wu(e,t),Jt(LS))}const Fo=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:a$,filterAttributesOfRoot:u$,filterAttributesOfShared:s$,getAttribute:p$,getBooleanAttribute:y$,getBooleanAttributes:HS,getBooleanDecisions:f$,getChoiceAttribute:h$,getChoiceAttributes:GS,getChoiceDecisions:l$,getChoiceValue:v$,getComponentAttribute:g$,getComponentAttributes:zS,getComponentDecisions:d$,getNumericAttribute:m$,getNumericAttributes:WS,getNumericDecisions:c$},Symbol.toStringTag,{value:"Module"})),b$="https://spc.cloud.ceventis.de/api/engine",S$={hcaEngineBaseUrl:b$};function C$(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??S$.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function fs(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const YS=e=>t=>n=>w(n,xE(r=>e.equals(r,t)),ee(r=>w(n,TE(r,i=>t))),Od,lt(()=>w(n,Pe(IE(t))))),Wu=YS({equals:(e,t)=>Cn.equals(e.attributeId,t.attributeId)}),w$=YS({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let x$=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,l,c,f,d;const h=w(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],W(this.restToDomainMapper.mapToGlobalAttributeId)),p=I=>gh(Cn)(I,h),v=w(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),g=w(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=w(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=w(((s=n.consequences)==null?void 0:s.componentConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=w(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=w(((l=n.consequences)==null?void 0:l.numericConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=w(((c=n.affectedDecisions)==null?void 0:c.booleanDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=w(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=w([],Pe(w(T,W(I=>I.attributeId))),Pe(w(E,W(I=>I.attributeId))),Pe(w(b,W(I=>I.attributeId))),Pe(w(x,W(I=>I.attributeId))),Pe(w(v,W(I=>I.attributeId))),Pe(w(g,W(I=>I.attributeId))),Pe(w(C,W(I=>I.attributeId))),Pe(w(m,W(I=>I.attributeId))),la(Cn)),N=w(A,Ad(t.attributes,(I,P)=>{const _=t.attributes.find(L=>Cn.equals(L.attributeId,P));return ue(_).with({type:ct.Choice},(L,U)=>{const Y=this.mergeChoice(U,w(g,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(v,Yt(k=>Cn.equals(k.attributeId,P)),W(k=>k.payload)));return Wu(Y)(I)}).with({type:ct.Numeric},(L,U)=>{const Y=this.mergeNumeric(U,w(x,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(b,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Wu(Y)(I)}).with({type:ct.Boolean},(L,U)=>{const Y=this.mergeBoolean(U,w(E,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(T,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Wu(Y)(I)}).with({type:ct.Component},(L,U)=>{const Y=this.mergeComponent(U,w(m,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(C,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Wu(Y)(I)}).exhaustive()}),W(I=>{const P=p(I.attributeId);return I.canContributeToConfigurationSatisfaction!=P?{...I,canContributeToConfigurationSatisfaction:P}:I}));return{...t,isSatisfied:w((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,Ce,lt(()=>t.isSatisfied)),attributes:N}}mergeChoice(t,n,r){const i=w(n,ee(u=>u.values??[]),lt(()=>[])),o=w(r),a=w([],Pe(w(i,W(u=>u.choiceValueId))),Pe(w(o,W(u=>u.choiceValueId))),W(fs),la(dt)),s=w(a,Ad(t.values,(u,l)=>{const c=w(i,pn(p=>p.choiceValueId===l)),f=w(o,pn(p=>p.choiceValueId===l)),d=w(t.values.find(p=>p.choiceValueId===l),Ce),h=this.mergeChoiceValue(l,d,c,f);return w$(h)(u)}));return{...t,isSatisfied:w(n,ee(u=>fs(u.isSatisfied)),lt(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=w(i,ee(s=>({state:this.toDecisionState(fs(s.state)),kind:this.toDecisionKind(fs(s.kind))})),lt(()=>({state:w(n,ar(s=>w(s.decision,ee(u=>u.state)))),kind:w(n,ar(s=>w(s.decision,ee(u=>u.kind))),lt(()=>Rt.Explicit))}))),a=w(r,ee(s=>w(Tm(s.possibleDecisionStates??[]),W(u=>this.toPossibleDecisionState(u)),Qn)),lt(()=>w(n,ee(s=>s.possibleDecisionStates??[]),lt(()=>[]))));return{choiceValueId:t,decision:w(o.state,ee(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=w(r,ee(a=>{const s=this.toDecisionState(fs(a.state));return w(s,ee(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),lt(()=>w(t.decision,ee(a=>({state:a.state,kind:a.kind}))))),o=w(n,ee(a=>w(Tm(a.possibleDecisionStates??[]),W(s=>this.toPossibleDecisionState(s)),Qn)),lt(()=>t.possibleDecisionStates));return{...t,isSatisfied:w(n,ee(a=>a.isSatisfied),lt(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:w(n,ar(i=>Ce(i.isSatisfied)),lt(()=>t.isSatisfied)),decision:w(r,ji(()=>t.decision,i=>w(i.state,Ce,ee(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:w(n,ar(i=>Ce(i.isSatisfied)),lt(()=>t.isSatisfied)),decision:w(r,ji(()=>t.decision,i=>w(i.state,Ce,ee(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:w(n,ee(i=>i.possibleDecisionStates),lt(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return ue(t).with(xo.Included,()=>je(Qt.Included)).with(xo.Excluded,()=>je(Qt.Excluded)).otherwise(()=>ge)}toDecisionState(t){return ue(t).with(Hr.Included,()=>je(Qt.Included)).with(Hr.Excluded,()=>je(Qt.Excluded)).otherwise(()=>ge)}toDecisionKind(t){return ue(t).with(Ks.Implicit,()=>Rt.Implicit).with(Ks.Explicit,()=>Rt.Explicit).exhaustive()}},T$=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ee.Component},n=>({type:Un.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ee.Numeric},n=>({type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).with({type:Ee.Boolean},n=>({type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=w([...t],hi(u=>u.type!==Ee.Boolean?ge:je({type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:w(u.value,_t)}))),o=w([...t],hi(u=>u.type!==Ee.Numeric?ge:je({type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:w(u.value,_t)}))),a=w([...t],hi(u=>u.type!==Ee.ChoiceValue?ge:je({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=w([...t],hi(u=>u.type!==Ee.Component?ge:je({type:Un.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=w([...t],hi(a=>a.type!==ct.Boolean?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitBooleanDecision(a))))),r=w([...t],hi(a=>a.type!==ct.Numeric?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitNumericDecision(a))))),i=w([...t],hi(a=>a.type!==ct.Component?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitComponentDecision(a))))),o=w([...t],hi(a=>a.type!==ct.Choice?ge:w(this.mapToExplicitChoiceDecisions(a),Su(s=>w(s,bu)))),RE);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:w(t.componentPath,Ce,ee($d),or),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:ue(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:Ct.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:w(t.decision,ee(n=>n.state),_t)}}mapToExplicitNumericDecision(t){return{type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:w(t.decision,ee(n=>n.state),_t)}}mapToExplicitComponentDecision(t){return{type:Un.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(w(t.decision,ee(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return w(r.decision,ee(i=>i.kind===Rt.Explicit),lt(()=>!1))}return w(t.values,Yt(n),W(r=>({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(w(r.decision,ee(i=>i.state)))})),$d)}mapToDecisionState(t){return w(t,ee(n=>ue(n).with(Qt.Included,()=>Hr.Included).with(Qt.Excluded,()=>Hr.Excluded).exhaustive()),lt(()=>Hr.Undefined))}mapToPossibleDecisionState(t){return ue(t).with(Qt.Included,()=>xo.Included).with(Qt.Excluded,()=>xo.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return ue(t).with({subject:hn.attribute},n=>({type:Fd.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:hn.configuration},()=>({type:Fd.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return ue(t).with({subject:hn.boolean},n=>({type:Ss.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.numeric},n=>({type:Ss.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.component},n=>({type:Ss.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:hn.choiceValue},n=>({type:Ss.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},E$=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return w(t.configuration.attributes,pn(n=>ue(n).with({type:ct.Boolean},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),bs)).with({type:ct.Numeric},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),bs)).with({type:ct.Choice},r=>w(r.values,pn(i=>w(i.decision,ee(o=>o.kind===Rt.Explicit),lt(()=>!1))),bs)).with({type:ct.Component},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),bs)).exhaustive()),ji(()=>!1,()=>!0))},getExplicitDecisions(t){return w(t.configuration.attributes,W(n=>ue(n).with({type:ct.Boolean},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Boolean,attributeId:r.attributeId,value:Ce(i.state)})),ee(i=>[i]))).with({type:ct.Numeric},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Numeric,attributeId:r.attributeId,value:Ce(i.state)})),ee(i=>[i]))).with({type:ct.Choice},r=>w(r.values,W(i=>w(i.decision,Jt(o=>o.kind===Rt.Explicit),ee(o=>({type:Ee.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:Ce(o.state)})))),Qn,$i)).with({type:ct.Component},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Component,attributeId:r.attributeId,state:Ce(i.state)})),ee(i=>[i]))).exhaustive()),Qn,bh)}}}},I$=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 E$}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)=>w(this.engineApiClient.makeDecision(i,r),br(Ur),Xt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=ue(t).with({question:Kn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Kn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return w(i,br(Ur),Xt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return w(a,yr(s=>{var u,l,c,f;return w([],Pe(w(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],W(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Pe(w(((l=s.rejectedDecisions)==null?void 0:l.numericDecisions)??[],W(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Pe(w(((c=s.rejectedDecisions)==null?void 0:c.componentDecisions)??[],W(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Pe(w(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],W(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),ca(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 w(i,Xt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return w(o,br(Ur),yr(a=>{const s={rejectedDecisions:{booleanDecisions:Ct.array(Ct.any)}},u={decisionExplanations:Ct.array(Ct.any)};return ue(a).with(s,l=>ja(l)).with(u,l=>Oi(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(l,i,n))).otherwise(()=>Oi({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 w(ca(t),yr(r=>w(r.sessionId,ji(()=>this.initializeInner(r,!1),()=>ca(r)))),yr(r=>w(r.sessionId,Th(()=>({type:we.ConfigurationUnauthenticated})),yr(i=>n(i,r)))))}initializeInner(t,n){return w(fI,()=>w(t.sessionId,CI,xI(s=>n?SI(s):w(this.sessionHandler.close(s),Kl(()=>ge,()=>ge)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return w(s,oI(()=>({type:we.ConfigurationUnauthenticated})),sS(()=>this.sessionHandler.create(u)))},s=>w(s,dI(u=>w($i(t),Jt(this.interpreter.configurationSession.hasExplicitDecisions),ee(l=>this.replaceDecisions(u,l)),lt(()=>ca({}))))),s=>w(s,yr(u=>{const l=this.determineConsequences(u),c=this.determineDecisions(u),f=_T(uI)({consequences:l,decisions:c});return w(f,Xt(({decisions:d,consequences:h})=>this.restToDomainMapper.mapToConfigurationModel(d,h)),Xt(d=>({sessionId:$i(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return w(this.engineApiClient.getDecisions(t),br(Ur))}determineConsequences(t){return w(this.engineApiClient.getConsequence(t),br(Ur))}},A$=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 w(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return w(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:ge}}restoreConfiguration(t){return w(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return w(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return w(this.configurationSession.sessionId,ee(t=>this.sessionHandler.close(t)),ee(Zn(Xt(t=>{this.configurationSession={...this.configurationSession,sessionId:ge}}))),lt(Dc(IA())))}applySolution(t){return w(this.configurationSession.solutions,pn(n=>_A.equals(n,t)),Th(()=>({type:we.ConfigurationSolutionNotAvailable})),Xt(n=>n.decisions),yr(n=>this.setMany(n,t.mode)))}setMany(t,n){return w(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),Yl(r=>()=>{const i=ue(r).with({decisionExplanations:Ct.array(Ct.any)},o=>je(o.decisionExplanations)).otherwise(()=>ge);this.configurationSession={...this.configurationSession,solutions:w(i,ee(Zn(W(o=>o.solution))),lt(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},r=>r.decisionExplanations).otherwise(()=>[]);return w(n,W(r=>r.solution))}invalidateAvailableSolutions(){return hI(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Yl(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Us(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Zn(Us(t=>()=>{this.configurationSession=t,w(this.onConfigurationChangedHandler,mI(n=>()=>n(this.configurationSession.configuration)))}),Xt(t=>t.configuration),this.invalidateAvailableSolutions())}},$$=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=fA(r,lA.concat(dA(i),cA(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Uo(this.policy,r,i=>w(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 ue(t).with({type:we.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:we.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},O$=class{constructor(){this.queue=[],this.operating=ge}push(t){const n=new D$(t);return this.queue.push(n),this.operating=w(this.operating,lt(()=>this.start()),$i),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=w(t,W(r=>r.argument),Ad(ge,(r,i)=>this.reduce(r,i)),ee(Zn(r=>this.execute(r),r=>r.then(i=>{w(t,W(o=>{o.resolve(i)}))}).catch(i=>{w(t,W(o=>{o.reject(i)}))}))),_t);n&&await n}this.operating=ge}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},D$=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},N$=class extends O${constructor(t){super(),this.inner=t}reduce(t,n){return je(n)}async execute(t){return await this.inner.setSessionContext(t)()}},P$=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new N$(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(DA.equals(n,t))return ja(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)}},R$=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)),w(r(),Yl(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Us(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)}},k$=class JS{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+SS()}static new(t){return new JS(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 M$(e){e=C$(e);const t=new WA(e.hcaEngineBaseUrl),n=new AS,r=new T$,i=new OS,o=new xS,a=new x$(n),s=ue(e.sessionHandler).with({create:Ct.any,close:Ct.any},c=>c).with({accessToken:Ct.string},c=>new ES(t,o,n,c)).with({sessionCreateUrl:Ct.string,sessionDeleteUrl:Ct.string},c=>new $S(o,c)).exhaustive(),u=new I$(s,t,n,r,i,a),l=(c,f)=>w(new A$(c,f),d=>new $$(d),d=>new P$(d),k$.new,d=>new R$(d,!1));return new DS(u,l)}const XS=qo.equals,QS=$h.equals,j$=CS.equals,_$=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:sn,AttributeInterpreter:i$,AttributeType:Oe,ChoiceValueDecisionState:Xr,ChoiceValueInterpreter:JA,ClientSideSessionLifetimeHandler:ES,ComponentDecisionState:_i,ConfigurationConflictReason:Lc,ConfigurationInterpreter:Fo,ConfigurationModelSourceType:Jr,ConfiguratorClient:DS,ConstraintType:ma,ContractToRestMapper:xS,DecisionKind:kr,ExplainQuestionBuilderModule:HA,ExplainQuestionSubject:Wt,ExplainQuestionType:xn,FailureType:zt,Inclusion:qi,Results:TA,Selection:Rr,ServerSideSessionLifetimeHandler:$S,Types:xA,causedByDecisionEquals:j$,createClient:M$,explainQuestionBuilder:Dh,globalAttributeIdEquals:XS,globalConstraintIdEquals:QS},Symbol.toStringTag,{value:"Module"}));/*! *****************************************************************************
|
|
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 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 Rh(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 Ve(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 ze(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 yt(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 To;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(To||(To={}));var Ld=ht.Start,kh=ht.Stop,xu=ht.Raise,Vc=ht.Send,XS=ht.Cancel,k$=ht.NullEvent,Mh=ht.Assign;ht.After;ht.DoneState;var QS=ht.Log,M$=ht.Init,Vd=ht.Invoke;ht.ErrorExecution;var qm=ht.ErrorPlatform,j$=ht.ErrorCustom,ZS=ht.Update,_$=ht.Choose,q$=ht.Pure,eC=".",Fm={},Bd="xstate.guard",F$="",$t=process.env.NODE_ENV==="production",Hu;function jh(e,t,n){n===void 0&&(n=eC);var r=ks(e,n),i=ks(t,n);return He(i)?He(r)?i===r:!1:He(r)?r in i:Object.keys(r).every(function(o){return o in i?jh(r[o],i[o]):!1})}function tC(e){try{return He(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 Ud(e,t){try{return qa(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function L$(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function ks(e,t){if(L$(e))return e.value;if(qa(e))return Xl(e);if(typeof e!="string")return e;var n=Ud(e,t);return Xl(n)}function Xl(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 Cs(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 Lm(e,t,n){var r,i,o={};try{for(var a=Ve(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];n(l)&&(o[u]=t(l,u,e))}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var V$=function(e){return function(t){var n,r,i=t;try{for(var o=Ve(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 B$(e,t){return function(n){var r,i,o=n;try{for(var a=Ve(e),s=a.next();!s.done;s=a.next()){var u=s.value;o=o[t][u]}}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 El(e){if(!e)return[[]];if(He(e))return[[e]];var t=It(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:El(e[n]).map(function(i){return[n].concat(i)})}));return t}function It(e){var t;return(t=[]).concat.apply(t,yt([],ze(e),!1))}function nC(e){return qa(e)?e:[e]}function hr(e){return e===void 0?[]:nC(e)}function Ql(e,t,n){var r,i;if(tt(e))return e(t,n.data);var o={};try{for(var a=Ve(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];tt(l)?o[u]=l(t,n.data):o[u]=l}}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 U$(e){return/^(done|error)\./.test(e)}function Vm(e){return!!(e instanceof Promise||e!==null&&(tt(e)||typeof e=="object")&&tt(e.then))}function G$(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function z$(e,t){var n,r,i=ze([[],[]],2),o=i[0],a=i[1];try{for(var s=Ve(e),u=s.next();!u.done;u=s.next()){var l=u.value;t(l)?o.push(l):a.push(l)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function rC(e,t){return Cs(e.states,function(n,r){if(n){var i=(He(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:rC(n,i)}}})}function W$(e,t){return{current:t,states:rC(e,t)}}function Bm(e,t,n,r){$t||tn(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,l=a.assignment,c={state:r,action:a,_event:t},f={};if(tt(l))f=l(o,t.data,c);else try{for(var d=Ve(Object.keys(l)),h=d.next();!h.done;h=d.next()){var p=h.value,v=l[p];f[p]=tt(v)?v(o,t.data,c):v}}catch(g){s={error:g}}finally{try{h&&!h.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var tn=function(){};$t||(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 qa(e){return Array.isArray(e)}function tt(e){return typeof e=="function"}function He(e){return typeof e=="string"}function iC(e,t){if(e)return He(e)?{type:Bd,name:e,predicate:t?t[e]:void 0}:tt(e)?{type:Bd,name:e.name,predicate:e}:e}function H$(e){try{return"subscribe"in e&&tt(e.subscribe)}catch{return!1}}var wi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Hu={},Hu[wi]=function(){return this},Hu[Symbol.observable]=function(){return this};function Xr(e){return!!e&&"__xstatenode"in e}function K$(e){return!!e&&typeof e.send=="function"}var Y$=function(){var e=0;return function(){return e++,e.toString(16)}}();function Bc(e,t){return He(e)||typeof e=="number"?ne({type:e},t):e}function cn(e,t){if(!He(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=Bc(e);return ne({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Go(e,t){var n=nC(t).map(function(r){return typeof r>"u"||typeof r=="string"||Xr(r)?{target:r,event:e}:ne(ne({},r),{event:e})});return n}function J$(e){if(!(e===void 0||e===F$))return hr(e)}function X$(e,t,n){if(!$t){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 oC(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===Bd)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 aC(e){return typeof e=="string"?{type:e}:e}function Il(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 Ku(e,t){return"".concat(e,":invocation[").concat(t,"]")}function Gd(e){return(e.type===xu||e.type===Vc&&e.to===To.Internal)&&typeof e.delay!="number"}var ga=cn({type:M$});function zd(e,t){return t&&t[e]||void 0}function Ys(e,t){var n;if(He(e)||typeof e=="number"){var r=zd(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=zd(e.type,t);if(tt(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 xi=function(e,t){if(!e)return[];var n=qa(e)?e:[e];return n.map(function(r){return Ys(r,t)})};function _h(e){var t=Ys(e);return ne(ne({id:He(e)?e:t.id},t),{type:t.type})}function Q$(e,t){return{type:xu,event:typeof e=="function"?e:Bc(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function Z$(e,t,n,r){var i={_event:n},o=cn(tt(e.event)?e.event(t,n.data,i):e.event),a;if(He(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 ne(ne({},e),{type:xu,_event:o,delay:a})}function Uc(e,t){return{to:t?t.to:void 0,type:Vc,event:tt(e)?e:Bc(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:tt(e)?e.name:tC(e)}}function eO(e,t,n,r){var i={_event:n},o=cn(tt(e.event)?e.event(t,n.data,i):e.event),a;if(He(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 ne(ne({},e),{to:u,_event:o,event:o.data,delay:a})}function tO(e,t){return Uc(e,ne(ne({},t),{to:To.Parent}))}var nO=function(e,t,n){return ne(ne({},e),{value:He(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},rO=function(e){return{type:XS,sendId:e}};function iO(e){var t=_h(e);return{type:ht.Start,activity:t,exec:void 0}}function oO(e){var t=tt(e)?e:_h(e);return{type:ht.Stop,activity:t,exec:void 0}}function aO(e,t,n){var r=tt(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 sO=function(e){return{type:Mh,assignment:e}};function uO(e,t){var n=t?"#".concat(t):"";return"".concat(ht.After,"(").concat(e,")").concat(n)}function Yu(e,t){var n="".concat(ht.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Al(e,t){var n="".concat(ht.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function ws(e,t){var n="".concat(ht.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function lO(e,t){if(!$t&&(!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,yt([],ze(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 Uc(function(r,i){return i},ne(ne({},t),{to:e}))}var cO=function(e){var t,n,r=[];try{for(var i=Ve(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===Mh){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 Zl(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:cO(i),u=s.length?Bm(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case xu:{var C=Z$(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case Vc:var m=eO(v,u,r,e.options.delays);if(!$t){var b=v.delay;tn(!He(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==To.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case QS:{var x=nO(v,u,r);return o==null||o(x,u,r),x}case _$:{var T=v,E=(g=T.conds.find(function(B){var G=iC(B.cond,e.options.guards);return!G||oC(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=ze(Zl(e,t,u,r,[{type:p,actions:xi(hr(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case q$:{var E=v.get(u,r.data);if(!E)return[];var P=ze(Zl(e,t,u,r,[{type:p,actions:xi(hr(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case kh:{var x=aO(v,u,r);return o==null||o(x,n,r),x}case Mh:{u=Bm(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=Ys(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=ne(ne({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,yt([l[k]],ze(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Ve(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=It(i.map(d));return[h,u]}var ec=[],na=function(e,t){ec.push(e);var n=t(e);return ec.pop(),n},fO=function(e){return e(ec[ec.length-1])};function sC(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 dO(e,t,n,r){var i,o=aC(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?Ql(e.data,n,r):void 0,u=a?qh(a,e.id,s):sC(e.id);return u.meta=e,u}function qh(e,t,n){var r=sC(t);if(r.deferred=!0,Xr(e)){var i=r.state=na(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function pO(e){try{return typeof e.send=="function"}catch{return!1}}function hO(e){return pO(e)&&"id"in e}function vO(e){var t;return ne((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[wi]=function(){return this},t),e)}var tc=function(e){return e.type==="atomic"||e.type==="final"};function uC(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Js(e){return uC(e).filter(function(t){return t.type!=="history"})}function lC(e){var t=[e];return tc(e)?t:t.concat(It(Js(e).map(lC)))}function xs(e,t){var n,r,i,o,a,s,u,l,c=new Set(e),f=Wd(c),d=new Set(t);try{for(var h=Ve(d),p=h.next();!p.done;p=h.next())for(var v=p.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){n={error:I}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var C=Wd(d);try{for(var m=Ve(d),b=m.next();!b.done;b=m.next()){var v=b.value;if(v.type==="compound"&&(!C.get(v)||!C.get(v).length))f.get(v)?f.get(v).forEach(function(P){return d.add(P)}):v.initialStateNodes.forEach(function(P){return d.add(P)});else if(v.type==="parallel")try{for(var x=(a=void 0,Ve(Js(v))),T=x.next();!T.done;T=x.next()){var E=T.value;d.has(E)||(d.add(E),f.get(E)?f.get(E).forEach(function(P){return d.add(P)}):E.initialStateNodes.forEach(function(P){return d.add(P)}))}}catch(P){a={error:P}}finally{try{T&&!T.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{b&&!b.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Ve(d),N=A.next();!N.done;N=A.next())for(var v=N.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){u={error:I}}finally{try{N&&!N.done&&(l=A.return)&&l.call(A)}finally{if(u)throw u.error}}return d}function cC(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(tc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=cC(o,t)}),i}function Wd(e){var t,n,r=new Map;try{for(var i=Ve(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 mO(e,t){var n=xs([e],t);return cC(e,Wd(n))}function Ts(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function yO(e){return yt([],ze(new Set(It(yt([],ze(e.map(function(t){return t.ownEvents})),!1)))),!1)}function $l(e,t){return t.type==="compound"?Js(t).some(function(n){return n.type==="final"&&Ts(e,n)}):t.type==="parallel"?Js(t).every(function(n){return $l(e,n)}):!1}function gO(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function Um(e){return new Set(It(e.map(function(t){return t.tags})))}function fC(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(He(e)||He(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return fC(e[i],t[i])})}function bO(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function SO(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 rr=function(){function e(t){var n=this,r;this.actions=[],this.activities=Fm,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||Fm,this.meta=gO(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 yO(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="."),He(t))return[t];var i=Object.keys(t);return i.concat.apply(i,yt([],ze(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=Rh(t,["configuration","transitions","tags","machine"]);return ne(ne({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return jh(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;$t&&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}(),CO={deferEvents:!1},Gm=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=ne(ne({},CO),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,wO=0,ds={bookId:function(){return"x:".concat(wO++)},register:function(e,t){return _f.set(e,t),e},get:function(e){return _f.get(e)},free:function(e){_f.delete(e)}};function Fh(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;$t||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 xO(){var e=Fh();if(e&&"__xstate__"in e)return e.__xstate__}function TO(e){if(Fh()){var t=xO();t&&t.register(e)}}function EO(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 l=i.shift();n=e.transition(n,l,u),r.forEach(function(c){return c.next(n)})}o=!1}},s=vO({id:t.id,send:function(l){i.push(l),a()},getSnapshot:function(){return n},subscribe:function(l,c,f){var d=Il(l,c,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 Hd={sync:!1,autoForward:!1},Dt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Dt||(Dt={}));var IO=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=Dt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(c,f){if(qa(c))return r.batch(c),r.state;var d=cn(Bc(c,f));if(r.status===Dt.Stopped)return $t||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.
|
|
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 Ph(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 Ve(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 ze(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 yt(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 To;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(To||(To={}));var Ld=ht.Start,Rh=ht.Stop,xu=ht.Raise,Vc=ht.Send,ZS=ht.Cancel,q$=ht.NullEvent,kh=ht.Assign;ht.After;ht.DoneState;var eC=ht.Log,F$=ht.Init,Vd=ht.Invoke;ht.ErrorExecution;var Fm=ht.ErrorPlatform,L$=ht.ErrorCustom,tC=ht.Update,V$=ht.Choose,B$=ht.Pure,nC=".",Lm={},Bd="xstate.guard",U$="",$t=process.env.NODE_ENV==="production",Hu;function Mh(e,t,n){n===void 0&&(n=nC);var r=ks(e,n),i=ks(t,n);return He(i)?He(r)?i===r:!1:He(r)?r in i:Object.keys(r).every(function(o){return o in i?Mh(r[o],i[o]):!1})}function rC(e){try{return He(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 Ud(e,t){try{return qa(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function G$(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function ks(e,t){if(G$(e))return e.value;if(qa(e))return Xl(e);if(typeof e!="string")return e;var n=Ud(e,t);return Xl(n)}function Xl(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 Cs(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 Vm(e,t,n){var r,i,o={};try{for(var a=Ve(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];n(l)&&(o[u]=t(l,u,e))}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var z$=function(e){return function(t){var n,r,i=t;try{for(var o=Ve(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 W$(e,t){return function(n){var r,i,o=n;try{for(var a=Ve(e),s=a.next();!s.done;s=a.next()){var u=s.value;o=o[t][u]}}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 El(e){if(!e)return[[]];if(He(e))return[[e]];var t=It(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:El(e[n]).map(function(i){return[n].concat(i)})}));return t}function It(e){var t;return(t=[]).concat.apply(t,yt([],ze(e),!1))}function iC(e){return qa(e)?e:[e]}function vr(e){return e===void 0?[]:iC(e)}function Ql(e,t,n){var r,i;if(tt(e))return e(t,n.data);var o={};try{for(var a=Ve(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];tt(l)?o[u]=l(t,n.data):o[u]=l}}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 H$(e){return/^(done|error)\./.test(e)}function Bm(e){return!!(e instanceof Promise||e!==null&&(tt(e)||typeof e=="object")&&tt(e.then))}function K$(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function Y$(e,t){var n,r,i=ze([[],[]],2),o=i[0],a=i[1];try{for(var s=Ve(e),u=s.next();!u.done;u=s.next()){var l=u.value;t(l)?o.push(l):a.push(l)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function oC(e,t){return Cs(e.states,function(n,r){if(n){var i=(He(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:oC(n,i)}}})}function J$(e,t){return{current:t,states:oC(e,t)}}function Um(e,t,n,r){$t||tn(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,l=a.assignment,c={state:r,action:a,_event:t},f={};if(tt(l))f=l(o,t.data,c);else try{for(var d=Ve(Object.keys(l)),h=d.next();!h.done;h=d.next()){var p=h.value,v=l[p];f[p]=tt(v)?v(o,t.data,c):v}}catch(g){s={error:g}}finally{try{h&&!h.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var tn=function(){};$t||(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 qa(e){return Array.isArray(e)}function tt(e){return typeof e=="function"}function He(e){return typeof e=="string"}function aC(e,t){if(e)return He(e)?{type:Bd,name:e,predicate:t?t[e]:void 0}:tt(e)?{type:Bd,name:e.name,predicate:e}:e}function X$(e){try{return"subscribe"in e&&tt(e.subscribe)}catch{return!1}}var wi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Hu={},Hu[wi]=function(){return this},Hu[Symbol.observable]=function(){return this};function Qr(e){return!!e&&"__xstatenode"in e}function Q$(e){return!!e&&typeof e.send=="function"}var Z$=function(){var e=0;return function(){return e++,e.toString(16)}}();function Bc(e,t){return He(e)||typeof e=="number"?ne({type:e},t):e}function fn(e,t){if(!He(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=Bc(e);return ne({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Go(e,t){var n=iC(t).map(function(r){return typeof r>"u"||typeof r=="string"||Qr(r)?{target:r,event:e}:ne(ne({},r),{event:e})});return n}function eO(e){if(!(e===void 0||e===U$))return vr(e)}function tO(e,t,n){if(!$t){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 sC(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===Bd)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 uC(e){return typeof e=="string"?{type:e}:e}function Il(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 Ku(e,t){return"".concat(e,":invocation[").concat(t,"]")}function Gd(e){return(e.type===xu||e.type===Vc&&e.to===To.Internal)&&typeof e.delay!="number"}var ga=fn({type:F$});function zd(e,t){return t&&t[e]||void 0}function Ys(e,t){var n;if(He(e)||typeof e=="number"){var r=zd(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=zd(e.type,t);if(tt(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 xi=function(e,t){if(!e)return[];var n=qa(e)?e:[e];return n.map(function(r){return Ys(r,t)})};function jh(e){var t=Ys(e);return ne(ne({id:He(e)?e:t.id},t),{type:t.type})}function nO(e,t){return{type:xu,event:typeof e=="function"?e:Bc(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function rO(e,t,n,r){var i={_event:n},o=fn(tt(e.event)?e.event(t,n.data,i):e.event),a;if(He(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 ne(ne({},e),{type:xu,_event:o,delay:a})}function Uc(e,t){return{to:t?t.to:void 0,type:Vc,event:tt(e)?e:Bc(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:tt(e)?e.name:rC(e)}}function iO(e,t,n,r){var i={_event:n},o=fn(tt(e.event)?e.event(t,n.data,i):e.event),a;if(He(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 ne(ne({},e),{to:u,_event:o,event:o.data,delay:a})}function oO(e,t){return Uc(e,ne(ne({},t),{to:To.Parent}))}var aO=function(e,t,n){return ne(ne({},e),{value:He(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},sO=function(e){return{type:ZS,sendId:e}};function uO(e){var t=jh(e);return{type:ht.Start,activity:t,exec:void 0}}function lO(e){var t=tt(e)?e:jh(e);return{type:ht.Stop,activity:t,exec:void 0}}function cO(e,t,n){var r=tt(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 fO=function(e){return{type:kh,assignment:e}};function dO(e,t){var n=t?"#".concat(t):"";return"".concat(ht.After,"(").concat(e,")").concat(n)}function Yu(e,t){var n="".concat(ht.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Al(e,t){var n="".concat(ht.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function ws(e,t){var n="".concat(ht.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function pO(e,t){if(!$t&&(!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,yt([],ze(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 Uc(function(r,i){return i},ne(ne({},t),{to:e}))}var hO=function(e){var t,n,r=[];try{for(var i=Ve(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===kh){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 Zl(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:hO(i),u=s.length?Um(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case xu:{var C=rO(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case Vc:var m=iO(v,u,r,e.options.delays);if(!$t){var b=v.delay;tn(!He(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==To.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case eC:{var x=aO(v,u,r);return o==null||o(x,u,r),x}case V$:{var T=v,E=(g=T.conds.find(function(B){var G=aC(B.cond,e.options.guards);return!G||sC(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=ze(Zl(e,t,u,r,[{type:p,actions:xi(vr(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case B$:{var E=v.get(u,r.data);if(!E)return[];var P=ze(Zl(e,t,u,r,[{type:p,actions:xi(vr(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case Rh:{var x=cO(v,u,r);return o==null||o(x,n,r),x}case kh:{u=Um(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=Ys(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=ne(ne({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,yt([l[k]],ze(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Ve(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=It(i.map(d));return[h,u]}var ec=[],na=function(e,t){ec.push(e);var n=t(e);return ec.pop(),n},vO=function(e){return e(ec[ec.length-1])};function lC(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 mO(e,t,n,r){var i,o=uC(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?Ql(e.data,n,r):void 0,u=a?_h(a,e.id,s):lC(e.id);return u.meta=e,u}function _h(e,t,n){var r=lC(t);if(r.deferred=!0,Qr(e)){var i=r.state=na(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function yO(e){try{return typeof e.send=="function"}catch{return!1}}function gO(e){return yO(e)&&"id"in e}function bO(e){var t;return ne((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[wi]=function(){return this},t),e)}var tc=function(e){return e.type==="atomic"||e.type==="final"};function cC(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Js(e){return cC(e).filter(function(t){return t.type!=="history"})}function fC(e){var t=[e];return tc(e)?t:t.concat(It(Js(e).map(fC)))}function xs(e,t){var n,r,i,o,a,s,u,l,c=new Set(e),f=Wd(c),d=new Set(t);try{for(var h=Ve(d),p=h.next();!p.done;p=h.next())for(var v=p.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){n={error:I}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var C=Wd(d);try{for(var m=Ve(d),b=m.next();!b.done;b=m.next()){var v=b.value;if(v.type==="compound"&&(!C.get(v)||!C.get(v).length))f.get(v)?f.get(v).forEach(function(P){return d.add(P)}):v.initialStateNodes.forEach(function(P){return d.add(P)});else if(v.type==="parallel")try{for(var x=(a=void 0,Ve(Js(v))),T=x.next();!T.done;T=x.next()){var E=T.value;d.has(E)||(d.add(E),f.get(E)?f.get(E).forEach(function(P){return d.add(P)}):E.initialStateNodes.forEach(function(P){return d.add(P)}))}}catch(P){a={error:P}}finally{try{T&&!T.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{b&&!b.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Ve(d),N=A.next();!N.done;N=A.next())for(var v=N.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){u={error:I}}finally{try{N&&!N.done&&(l=A.return)&&l.call(A)}finally{if(u)throw u.error}}return d}function dC(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(tc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=dC(o,t)}),i}function Wd(e){var t,n,r=new Map;try{for(var i=Ve(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 SO(e,t){var n=xs([e],t);return dC(e,Wd(n))}function Ts(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function CO(e){return yt([],ze(new Set(It(yt([],ze(e.map(function(t){return t.ownEvents})),!1)))),!1)}function $l(e,t){return t.type==="compound"?Js(t).some(function(n){return n.type==="final"&&Ts(e,n)}):t.type==="parallel"?Js(t).every(function(n){return $l(e,n)}):!1}function wO(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function Gm(e){return new Set(It(e.map(function(t){return t.tags})))}function pC(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(He(e)||He(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return pC(e[i],t[i])})}function xO(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function TO(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 rr=function(){function e(t){var n=this,r;this.actions=[],this.activities=Lm,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||Lm,this.meta=wO(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 CO(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="."),He(t))return[t];var i=Object.keys(t);return i.concat.apply(i,yt([],ze(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=Ph(t,["configuration","transitions","tags","machine"]);return ne(ne({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return Mh(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;$t&&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}(),EO={deferEvents:!1},zm=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=ne(ne({},EO),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,IO=0,ds={bookId:function(){return"x:".concat(IO++)},register:function(e,t){return _f.set(e,t),e},get:function(e){return _f.get(e)},free:function(e){_f.delete(e)}};function qh(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;$t||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 AO(){var e=qh();if(e&&"__xstate__"in e)return e.__xstate__}function $O(e){if(qh()){var t=AO();t&&t.register(e)}}function OO(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 l=i.shift();n=e.transition(n,l,u),r.forEach(function(c){return c.next(n)})}o=!1}},s=bO({id:t.id,send:function(l){i.push(l),a()},getSnapshot:function(){return n},subscribe:function(l,c,f){var d=Il(l,c,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 Hd={sync:!1,autoForward:!1},Dt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Dt||(Dt={}));var DO=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=Dt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(c,f){if(qa(c))return r.batch(c),r.state;var d=fn(Bc(c,f));if(r.status===Dt.Stopped)return $t||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.
|
|
18
18
|
Event: `).concat(JSON.stringify(d.data))),r.state;if(r.status!==Dt.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 h=r._nextState(d);r.update(h,d)}),r._state},this.sendTo=function(c,f,d){var h=r.parent&&(f===To.Parent||r.parent.id===f),p=h?r.parent:He(f)?f===To.Internal?r:r.children.get(f)||ds.get(f):
|
|
20
|
-
Event: `).concat(JSON.stringify(event)));else if(this.status!==Dt.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=[],l=function(h){var p=cn(h);n.forward(p),a=na(n,function(){return n.machine.transition(a,p,void 0,r||void 0)}),u.push.apply(u,yt([],ze(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return SO(v,a)})),!1)),s=s||!!a.changed};try{for(var c=Ve(t),f=c.next();!f.done;f=c.next()){var d=f.value;l(d)}}catch(h){i={error:h}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}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(qm)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(qm)===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=Ve(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!==Dt.Running)return qh(t,n);if(Vm(t))return this.spawnPromise(Promise.resolve(t),n);if(tt(t))return this.spawnCallback(t,n);if(hO(t))return this.spawnActor(t,n);if(H$(t))return this.spawnObservable(t,n);if(Xr(t))return this.spawnMachine(t,ne(ne({},r),{id:n}));if(G$(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({},Hd),n);o.sync&&i.onTransition(function(s){r.send(ZS,{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=EO(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(Al(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var l=ws(n,u);try{i.send(cn(l,{origin:n}))}catch(c){X$(u,c,n),i.devTools&&i.devTools.send(l,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,l,c){var f=Il(u,l,c),d=!1;return t.then(function(h){d||(f.next(h),!d&&f.complete())},function(h){d||f.error(h)}),{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,l=function(d){u=d,s.forEach(function(h){return h(d)}),!o&&i.send(cn(d,{origin:n}))},c;try{c=t(l,function(d){a.add(d)})}catch(d){this.send(ws(n,d))}if(Vm(c))return this.spawnPromise(c,n);var f=(r={id:n,send:function(d){return a.forEach(function(h){return h(d)})},subscribe:function(d){var h=Il(d);return s.add(h.next),{unsubscribe:function(){s.delete(h.next)}}},stop:function(){o=!0,tt(c)&&c()},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(ws(n,u),{origin:n}))},function(){i.removeChild(n),i.send(cn(Al(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,l,c){return t.subscribe(u,l,c)},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){$t||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[wi]=function(){return this},r))},e.prototype.attachDev=function(){var t=Fh();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)}TO(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[wi]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Dt.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=dC,e}(),AO=function(e){return He(e)?ne(ne({},Hd),{name:e}):ne(ne(ne({},Hd),{name:Y$()}),e)};function zm(e,t){var n=AO(t);return fO(function(r){if(!$t){var i=Xr(e)||tt(e);tn(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(Xr(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):qh(e,n.name)})}function dC(e,t){var n=new IO(e,t);return n}function $O(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function Ju(e){return ne(ne({type:Vd},e),{toJSON:function(){e.onDone,e.onError;var t=Rh(e,["onDone","onError"]);return ne(ne({},t),{type:Vd,src:$O(e.src)})}})}var ra="",Kd="#",ps="*",zo={},Wo=function(e){return e[0]===Kd},OO=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},DO=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(He(o.target)||Xr(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.")},NO=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(OO(),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:eC),this.id=this.config.id||yt([this.machine.key],ze(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,$t||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?Cs(this.config.states,function(l,c){var f,d=new e(l,{},void 0,{parent:o,key:c});return Object.assign(o.idMap,ne((f={},f[d.id]=d,f),d.idMap)),d}):zo;var s=0;function u(l){var c,f;l.order=s++;try{for(var d=Ve(uC(l)),h=d.next();!h.done;h=d.next()){var p=h.value;u(p)}}catch(v){c={error:v}}finally{try{h&&!h.done&&(f=d.return)&&f.call(d)}finally{if(c)throw c.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(l){var c=l.event;return c===ra}):ra in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=hr(this.config.entry||this.config.onEntry).map(function(l){return Ys(l)}),this.onExit=hr(this.config.exit||this.config.onExit).map(function(l){return Ys(l)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=hr(this.config.invoke).map(function(l,c){var f,d;if(Xr(l)){var h=Ku(o.id,c);return o.machine.options.services=ne((f={},f[h]=l,f),o.machine.options.services),Ju({src:h,id:h})}else if(He(l.src)){var h=l.id||Ku(o.id,c);return Ju(ne(ne({},l),{id:h,src:l.src}))}else if(Xr(l.src)||tt(l.src)){var h=l.id||Ku(o.id,c);return o.machine.options.services=ne((d={},d[h]=l.src,d),o.machine.options.services),Ju(ne(ne({id:h},l),{src:h}))}else{var p=l.src;return Ju(ne(ne({id:Ku(o.id,c)},l),{src:p}))}}),this.activities=hr(this.config.activities).concat(this.invoke).map(function(l){return _h(l)}),this.transition=this.transition.bind(this),this.tags=hr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||lC(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 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:Cs(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===ps});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=uO(s,t.id);return t.onEntry.push(Uc(u,{delay:o})),t.onExit.push(rO(u)),u},i=qa(n)?n.map(function(o,a){var s=r(o.delay,a);return ne(ne({},o),{event:s})}):It(Object.keys(n).map(function(o,a){var s=n[o],u=He(s)?{target:s}:s,l=isNaN(+o)?o:+o,c=r(l,a);return hr(u).map(function(f){return ne(ne({},f),{event:c,delay:l})})}));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 rr?t.value:ks(t,this.delimiter);if(He(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,yt([],ze(It(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=tC(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof rr?t:rr.create(t),r=Array.from(xs([],this.getStateNodes(n.value)));return new rr(ne(ne({},n),{value:this.resolve(n.value),configuration:r,done:$l(r,this),tags:Um(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=Ve(Object.keys(t)),u=s.next();!u.done;u=s.next()){var l=u.value,c=t[l];if(c){var f=this.getStateNode(l),d=f._transition(c,n,r);d&&(a[l]=d)}}}catch(C){i={error:C}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var h=Object.keys(a).map(function(C){return a[C]}),p=It(h.map(function(C){return C.transitions})),v=h.some(function(C){return C.transitions.length>0});if(!v)return this.next(n,r);var g=It(Object.keys(a).map(function(C){return a[C].configuration}));return{transitions:p,exitSet:It(h.map(function(C){return C.exitSet})),configuration:g,source:n,actions:It(Object.keys(a).map(function(C){return a[C].actions}))}},e.prototype._transition=function(t,n,r){return He(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=[],l;try{for(var c=Ve(this.getCandidates(a)),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.cond,p=d.in,v=t.context,g=p?He(p)&&Wo(p)?t.matches(ks(this.getStateNodeById(p).path,this.delimiter)):jh(ks(p,this.delimiter),V$(this.path.slice(0,-2))(t.value)):!0,C=!1;try{C=!h||oC(this.machine,h,v,n,t)}catch(x){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
21
|
-
`).concat(x.message))}if(C&&g){d.target!==void 0&&(u=d.target),s.push.apply(s,yt([],ze(d.actions),!1)),l=d;break}}}catch(x){r={error:x}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}if(l){if(!u.length)return{transitions:[l],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=It(u.map(function(x){return o.getRelativeStateNodes(x,t.historyValue)})),b=!!l.internal;return{transitions:[l],exitSet:b?[]:It(u.map(function(x){return o.getPotentiallyReenteringNodes(x)})),configuration:m,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,l,c,f,d=this,h=a?xs([],this.getStateNodes(a.value)):[],p=new Set;try{for(var v=Ve(Array.from(t).sort(function(_,L){return _.order-L.order})),g=v.next();!g.done;g=v.next()){var C=g.value;(!Ts(h,C)||Ts(r.exitSet,C)||C.parent&&p.has(C.parent))&&p.add(C)}}catch(_){u={error:_}}finally{try{g&&!g.done&&(l=v.return)&&l.call(v)}finally{if(u)throw u.error}}try{for(var m=Ve(h),b=m.next();!b.done;b=m.next()){var C=b.value;(!Ts(t,C)||Ts(r.exitSet,C.parent))&&r.exitSet.push(C)}}catch(_){c={error:_}}finally{try{b&&!b.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var x=Array.from(p).sort(function(_,L){return _.order-L.order}),T=new Set(r.exitSet),E=It(x.map(function(_){var L=[];if(_.type!=="final")return L;var U=_.parent;if(!U.parent)return L;L.push(Yu(_.id,_.doneData),Yu(U.id,_.doneData?Ql(_.doneData,i,o):void 0));var Y=U.parent;return Y.type==="parallel"&&Js(Y).every(function(k){return $l(r.configuration,k)})&&L.push(Yu(Y.id)),L})),A=x.map(function(_){var L=_.onEntry,U=_.activities.map(function(Y){return iO(Y)});return{type:"entry",actions:xi(s?yt(yt([],ze(L),!1),ze(U),!1):yt(yt([],ze(U),!1),ze(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:E.map(function(_){return Q$(_)})}),N=Array.from(T).map(function(_){return{type:"exit",actions:xi(yt(yt([],ze(_.onExit),!1),ze(_.activities.map(function(L){return oO(L)})),!1),d.machine.options.actions)}}),I=N.concat({type:"transition",actions:xi(r.actions,this.machine.options.actions)}).concat(A);if(n){var P=xi(It(yt([],ze(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!Gd(_)});return I.concat({type:"stop",actions:P})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=cn(n),a;if(t instanceof rr)a=r===void 0?t:this.resolveState(rr.from(t,r));else{var s=He(t)?this.resolve(Xl(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(rr.from(s,u))}if(!$t&&o.name===ps)throw new Error("An event cannot have the wildcard type ('".concat(ps,"')"));if(this.strict&&!this.events.includes(o.name)&&!U$(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var l=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},c=xs([],this.getStateNodes(a.value)),f=l.configuration.length?xs(c,l.configuration):c;return l.configuration=yt([],ze(f),!1),this.resolveTransition(l,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,yt([],ze(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,l,c=this;o===void 0&&(o=ga);var f=t.configuration,d=!n||t.transitions.length>0,h=d?t.configuration:n?n.configuration:[],p=$l(h,this),v=d?mO(this.machine,f):void 0,g=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,C=this.getActions(new Set(h),p,t,r,o,n,i),m=n?ne({},n.activities):{};try{for(var b=Ve(C),x=b.next();!x.done;x=b.next()){var T=x.value;try{for(var E=(u=void 0,Ve(T.actions)),A=E.next();!A.done;A=E.next()){var N=A.value;N.type===Ld?m[N.activity.id||N.activity.type]=N:N.type===kh&&(m[N.activity.id||N.activity.type]=!1)}}catch(X){u={error:X}}finally{try{A&&!A.done&&(l=E.return)&&l.call(E)}finally{if(u)throw u.error}}}}catch(X){a={error:X}}finally{try{x&&!x.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}var I=ze(Zl(this,n,r,o,C,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),P=I[0],_=I[1],L=ze(z$(P,Gd),2),U=L[0],Y=L[1],k=P.filter(function(X){var ae;return X.type===Ld&&((ae=X.activity)===null||ae===void 0?void 0:ae.type)===Vd}),ie=k.reduce(function(X,ae){return X[ae.activity.id]=dO(ae.activity,c.machine,_,o),X},n?ne({},n.children):{}),B=new rr({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?g?W$(g,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?Y:[],activities:v?m:n?n.activities:{},events:[],configuration:h,transitions:t.transitions,children:ie,done:p,tags:Um(h),machine:this}),G=r!==_;B.changed=o.name===ZS||G;var fe=B.history;fe&&delete fe.history;var j=!p&&(this._transient||f.some(function(X){return X._transient}));if(!d&&(!j||o.name===ra))return B;var R=B;if(!p)for(j&&(R=this.resolveRaisedTransition(R,{type:k$},o,i));U.length;){var te=U.shift();R=this.resolveRaisedTransition(R,te._event,o,i)}var oe=R.changed||(fe?!!R.actions.length||G||typeof fe.value!=typeof R.value||!fC(R.value,fe.value):void 0);return R.changed=oe,R.history=fe,R},e.prototype.getStateNode=function(t){if(Wo(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=Wo(t)?t.slice(Kd.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"&&Wo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=Ud(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||zo;switch(this.type){case"parallel":return Cs(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):zo});case"compound":if(He(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?Cs(t,function(o,a){return o?r.getStateNode(a).resolve(o):zo}):this.initialStateValue||{};default:return t||zo}},e.prototype.getResolvedPath=function(t){if(Wo(t)){var n=this.machine.idMap[t.slice(Kd.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return Ud(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=Lm(this.states,function(r){return r.initialStateValue||zo},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=tc(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;He(n.target)?t=Wo(n.target)?Xl(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(tc(this))return[this];if(this.type==="compound"&&!this.initial)return $t||tn(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=El(this.initialStateValue);return It(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=ze(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:Lm(this.states,function(n,r){if(!t)return n.historyValue();var i=He(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?It(El(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=B$(r.path,"states")(t).current;return He(o)?[r.getStateNode(o)]:It(El(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=It(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=Ve(Object.keys(o)),u=s.next();!u.done;u=s.next()){var l=u.value,c=o[l];if(c.states)try{for(var f=(r=void 0,Ve(c.events)),d=f.next();!d.done;d=f.next()){var h=d.value;a.add("".concat(h))}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(p){t={error:p}}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(!He(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=
|
|
19
|
+
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var h=r._nextState(d);r.update(h,d)}),r._state},this.sendTo=function(c,f,d){var h=r.parent&&(f===To.Parent||r.parent.id===f),p=h?r.parent:He(f)?f===To.Internal?r:r.children.get(f)||ds.get(f):Q$(f)?f:void 0;if(!p){if(!h)throw new Error("Unable to send event to child '".concat(f,"' from service '").concat(r.id,"'."));$t||tn(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(c.type));return}if("machine"in p){if(r.status!==Dt.Stopped||r.parent!==p||r.state.done){var v=ne(ne({},c),{name:c.name===L$?"".concat(ws(r.id)):c.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([p,v]):p.send(v)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([p,c.data]):p.send(c.data)},this._exec=function(c,f,d,h){h===void 0&&(h=r.machine.options.actions);var p=c.exec||zd(c.type,h),v=tt(p)?p:p?p.exec:c.exec;if(v)try{return v(f,d.data,r.machine.config.predictableActionArguments?{action:c,_event:d}:{action:c,state:r.state,_event:d})}catch(Y){throw r.parent&&r.parent.send({type:"xstate.error",data:Y}),Y}switch(c.type){case xu:{var g=c;r.defer(g);break}case Vc:var C=c;if(typeof C.delay=="number"){r.defer(C);return}else C.to?r.sendTo(C._event,C.to,d===ga):r.send(C._event);break;case ZS:r.cancel(c.sendId);break;case Ld:{if(r.status!==Dt.Running)return;var m=c.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[m.id||m.type])break;if(m.type===ht.Invoke){var b=uC(m.src),x=r.machine.options.services?r.machine.options.services[b.type]:void 0,T=m.id,E=m.data;$t||tn(!("forward"in m),"`forward` property is deprecated (found in invocation of '".concat(m.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var A="autoForward"in m?m.autoForward:!!m.forward;if(!x){$t||tn(!1,"No service found for invocation '".concat(m.src,"' in machine '").concat(r.machine.id,"'."));return}var N=E?Ql(E,f,d):void 0;if(typeof x=="string")return;var I=tt(x)?x(f,d.data,{data:N,src:b,meta:m.meta}):x;if(!I)return;var P=void 0;Qr(I)&&(I=N?I.withContext(N):I,P={autoForward:A}),r.spawn(I,T,P)}else r.spawnActivity(m);break}case Rh:{r.stopChild(c.activity.id);break}case eC:var _=c,L=_.label,U=_.value;L?r.logger(L,U):r.logger(U);break;default:$t||tn(!1,"No implementation found for action type '".concat(c.type,"'"));break}};var i=ne(ne({},e.defaultOptions),n),o=i.clock,a=i.logger,s=i.parent,u=i.id,l=u!==void 0?u:t.id;this.id=l,this.logger=a,this.clock=o,this.parent=s,this.options=i,this.scheduler=new zm({deferEvents:this.options.deferEvents}),this.sessionId=ds.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 $t||tn(this.status!==Dt.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=Ve(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,l,c,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 h=Ve(this.eventListeners),p=h.next();!p.done;p=h.next()){var v=p.value;v(t.event)}}catch(I){r={error:I}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}try{for(var g=Ve(this.listeners),C=g.next();!C.done;C=g.next()){var v=C.value;v(t,t.event)}}catch(I){o={error:I}}finally{try{C&&!C.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}try{for(var m=Ve(this.contextListeners),b=m.next();!b.done;b=m.next()){var x=b.value;x(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(I){s={error:I}}finally{try{b&&!b.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(this.state.done){var T=t.configuration.find(function(I){return I.type==="final"&&I.parent===f.machine}),E=T&&T.doneData?Ql(T.doneData,t.context,n):void 0;this._doneEvent=Al(this.id,E);try{for(var A=Ve(this.doneListeners),N=A.next();!N.done;N=A.next()){var v=N.value;v(this._doneEvent)}}catch(I){l={error:I}}finally{try{N&&!N.done&&(c=A.return)&&c.call(A)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),ds.free(this.sessionId)}},e.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Dt.Running&&t(this.state,this.state.event),this},e.prototype.subscribe=function(t,n,r){var i=this,o=Il(t,n,r);this.listeners.add(o.next),this.status!==Dt.NotStarted&&o.next(this.state);var a=function(){i.doneListeners.delete(a),i.stopListeners.delete(a),o.complete()};return this.status===Dt.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===Dt.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===Dt.Running)return this;this.machine._init(),ds.register(this.sessionId,this),this.initialized=!0,this.status=Dt.Running;var r=t===void 0?this.initialState:na(this,function(){return xO(t)?n.machine.resolveState(t):n.machine.resolveState(rr.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,l,c;try{for(var f=Ve(this.listeners),d=f.next();!d.done;d=f.next()){var h=d.value;this.listeners.delete(h)}}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 p=Ve(this.stopListeners),v=p.next();!v.done;v=p.next()){var h=v.value;h(),this.stopListeners.delete(h)}}catch(A){r={error:A}}finally{try{v&&!v.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var g=Ve(this.contextListeners),C=g.next();!C.done;C=g.next()){var h=C.value;this.contextListeners.delete(h)}}catch(A){o={error:A}}finally{try{C&&!C.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}try{for(var m=Ve(this.doneListeners),b=m.next();!b.done;b=m.next()){var h=b.value;this.doneListeners.delete(h)}}catch(A){s={error:A}}finally{try{b&&!b.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Dt.Stopped,this._initialState=void 0;try{for(var x=Ve(Object.keys(this.delayedEventsMap)),T=x.next();!T.done;T=x.next()){var E=T.value;this.clock.clearTimeout(this.delayedEventsMap[E])}}catch(A){l={error:A}}finally{try{T&&!T.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new zm({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=fn({type:"xstate.stop"}),o=na(t,function(){var a=It(yt([],ze(t.state.configuration),!1).sort(function(f,d){return d.order-f.order}).map(function(f){return xi(f.onExit,t.machine.options.actions)})),s=ze(Zl(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],l=s[1],c=new rr({value:t.state.value,context:l,_event:i,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:u.filter(function(f){return!Gd(f)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return c.changed=!0,c});t.update(o,i),t._stopChildren(),ds.free(t.sessionId)}}),this},e.prototype.batch=function(t){var n=this;if(this.status===Dt.NotStarted&&this.options.deferEvents)$t||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.
|
|
20
|
+
Event: `).concat(JSON.stringify(event)));else if(this.status!==Dt.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=[],l=function(h){var p=fn(h);n.forward(p),a=na(n,function(){return n.machine.transition(a,p,void 0,r||void 0)}),u.push.apply(u,yt([],ze(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return TO(v,a)})),!1)),s=s||!!a.changed};try{for(var c=Ve(t),f=c.next();!f.done;f=c.next()){var d=f.value;l(d)}}catch(h){i={error:h}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,fn(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=fn(t);if(i.name.indexOf(Fm)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(Fm)===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=Ve(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!==Dt.Running)return _h(t,n);if(Bm(t))return this.spawnPromise(Promise.resolve(t),n);if(tt(t))return this.spawnCallback(t,n);if(gO(t))return this.spawnActor(t,n);if(X$(t))return this.spawnObservable(t,n);if(Qr(t))return this.spawnMachine(t,ne(ne({},r),{id:n}));if(K$(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({},Hd),n);o.sync&&i.onTransition(function(s){r.send(tC,{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(fn(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=OO(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(fn(Al(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var l=ws(n,u);try{i.send(fn(l,{origin:n}))}catch(c){tO(u,c,n),i.devTools&&i.devTools.send(l,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,l,c){var f=Il(u,l,c),d=!1;return t.then(function(h){d||(f.next(h),!d&&f.complete())},function(h){d||f.error(h)}),{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,l=function(d){u=d,s.forEach(function(h){return h(d)}),!o&&i.send(fn(d,{origin:n}))},c;try{c=t(l,function(d){a.add(d)})}catch(d){this.send(ws(n,d))}if(Bm(c))return this.spawnPromise(c,n);var f=(r={id:n,send:function(d){return a.forEach(function(h){return h(d)})},subscribe:function(d){var h=Il(d);return s.add(h.next),{unsubscribe:function(){s.delete(h.next)}}},stop:function(){o=!0,tt(c)&&c()},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(fn(u,{origin:n}))},function(u){i.removeChild(n),i.send(fn(ws(n,u),{origin:n}))},function(){i.removeChild(n),i.send(fn(Al(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,l,c){return t.subscribe(u,l,c)},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){$t||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[wi]=function(){return this},r))},e.prototype.attachDev=function(){var t=qh();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)}$O(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[wi]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Dt.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=hC,e}(),NO=function(e){return He(e)?ne(ne({},Hd),{name:e}):ne(ne(ne({},Hd),{name:Z$()}),e)};function Wm(e,t){var n=NO(t);return vO(function(r){if(!$t){var i=Qr(e)||tt(e);tn(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(Qr(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):_h(e,n.name)})}function hC(e,t){var n=new DO(e,t);return n}function PO(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function Ju(e){return ne(ne({type:Vd},e),{toJSON:function(){e.onDone,e.onError;var t=Ph(e,["onDone","onError"]);return ne(ne({},t),{type:Vd,src:PO(e.src)})}})}var ra="",Kd="#",ps="*",zo={},Wo=function(e){return e[0]===Kd},RO=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},kO=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(He(o.target)||Qr(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.")},MO=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(RO(),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:nC),this.id=this.config.id||yt([this.machine.key],ze(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,$t||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?Cs(this.config.states,function(l,c){var f,d=new e(l,{},void 0,{parent:o,key:c});return Object.assign(o.idMap,ne((f={},f[d.id]=d,f),d.idMap)),d}):zo;var s=0;function u(l){var c,f;l.order=s++;try{for(var d=Ve(cC(l)),h=d.next();!h.done;h=d.next()){var p=h.value;u(p)}}catch(v){c={error:v}}finally{try{h&&!h.done&&(f=d.return)&&f.call(d)}finally{if(c)throw c.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(l){var c=l.event;return c===ra}):ra in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=vr(this.config.entry||this.config.onEntry).map(function(l){return Ys(l)}),this.onExit=vr(this.config.exit||this.config.onExit).map(function(l){return Ys(l)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=vr(this.config.invoke).map(function(l,c){var f,d;if(Qr(l)){var h=Ku(o.id,c);return o.machine.options.services=ne((f={},f[h]=l,f),o.machine.options.services),Ju({src:h,id:h})}else if(He(l.src)){var h=l.id||Ku(o.id,c);return Ju(ne(ne({},l),{id:h,src:l.src}))}else if(Qr(l.src)||tt(l.src)){var h=l.id||Ku(o.id,c);return o.machine.options.services=ne((d={},d[h]=l.src,d),o.machine.options.services),Ju(ne(ne({id:h},l),{src:h}))}else{var p=l.src;return Ju(ne(ne({id:Ku(o.id,c)},l),{src:p}))}}),this.activities=vr(this.config.activities).concat(this.invoke).map(function(l){return jh(l)}),this.transition=this.transition.bind(this),this.tags=vr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||fC(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 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:Cs(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===ps});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=dO(s,t.id);return t.onEntry.push(Uc(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})}):It(Object.keys(n).map(function(o,a){var s=n[o],u=He(s)?{target:s}:s,l=isNaN(+o)?o:+o,c=r(l,a);return vr(u).map(function(f){return ne(ne({},f),{event:c,delay:l})})}));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 rr?t.value:ks(t,this.delimiter);if(He(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,yt([],ze(It(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=rC(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof rr?t:rr.create(t),r=Array.from(xs([],this.getStateNodes(n.value)));return new rr(ne(ne({},n),{value:this.resolve(n.value),configuration:r,done:$l(r,this),tags:Gm(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=Ve(Object.keys(t)),u=s.next();!u.done;u=s.next()){var l=u.value,c=t[l];if(c){var f=this.getStateNode(l),d=f._transition(c,n,r);d&&(a[l]=d)}}}catch(C){i={error:C}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var h=Object.keys(a).map(function(C){return a[C]}),p=It(h.map(function(C){return C.transitions})),v=h.some(function(C){return C.transitions.length>0});if(!v)return this.next(n,r);var g=It(Object.keys(a).map(function(C){return a[C].configuration}));return{transitions:p,exitSet:It(h.map(function(C){return C.exitSet})),configuration:g,source:n,actions:It(Object.keys(a).map(function(C){return a[C].actions}))}},e.prototype._transition=function(t,n,r){return He(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,fn(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],l;try{for(var c=Ve(this.getCandidates(a)),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.cond,p=d.in,v=t.context,g=p?He(p)&&Wo(p)?t.matches(ks(this.getStateNodeById(p).path,this.delimiter)):Mh(ks(p,this.delimiter),z$(this.path.slice(0,-2))(t.value)):!0,C=!1;try{C=!h||sC(this.machine,h,v,n,t)}catch(x){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
21
|
+
`).concat(x.message))}if(C&&g){d.target!==void 0&&(u=d.target),s.push.apply(s,yt([],ze(d.actions),!1)),l=d;break}}}catch(x){r={error:x}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}if(l){if(!u.length)return{transitions:[l],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=It(u.map(function(x){return o.getRelativeStateNodes(x,t.historyValue)})),b=!!l.internal;return{transitions:[l],exitSet:b?[]:It(u.map(function(x){return o.getPotentiallyReenteringNodes(x)})),configuration:m,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,l,c,f,d=this,h=a?xs([],this.getStateNodes(a.value)):[],p=new Set;try{for(var v=Ve(Array.from(t).sort(function(_,L){return _.order-L.order})),g=v.next();!g.done;g=v.next()){var C=g.value;(!Ts(h,C)||Ts(r.exitSet,C)||C.parent&&p.has(C.parent))&&p.add(C)}}catch(_){u={error:_}}finally{try{g&&!g.done&&(l=v.return)&&l.call(v)}finally{if(u)throw u.error}}try{for(var m=Ve(h),b=m.next();!b.done;b=m.next()){var C=b.value;(!Ts(t,C)||Ts(r.exitSet,C.parent))&&r.exitSet.push(C)}}catch(_){c={error:_}}finally{try{b&&!b.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var x=Array.from(p).sort(function(_,L){return _.order-L.order}),T=new Set(r.exitSet),E=It(x.map(function(_){var L=[];if(_.type!=="final")return L;var U=_.parent;if(!U.parent)return L;L.push(Yu(_.id,_.doneData),Yu(U.id,_.doneData?Ql(_.doneData,i,o):void 0));var Y=U.parent;return Y.type==="parallel"&&Js(Y).every(function(k){return $l(r.configuration,k)})&&L.push(Yu(Y.id)),L})),A=x.map(function(_){var L=_.onEntry,U=_.activities.map(function(Y){return uO(Y)});return{type:"entry",actions:xi(s?yt(yt([],ze(L),!1),ze(U),!1):yt(yt([],ze(U),!1),ze(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:E.map(function(_){return nO(_)})}),N=Array.from(T).map(function(_){return{type:"exit",actions:xi(yt(yt([],ze(_.onExit),!1),ze(_.activities.map(function(L){return lO(L)})),!1),d.machine.options.actions)}}),I=N.concat({type:"transition",actions:xi(r.actions,this.machine.options.actions)}).concat(A);if(n){var P=xi(It(yt([],ze(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!Gd(_)});return I.concat({type:"stop",actions:P})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=fn(n),a;if(t instanceof rr)a=r===void 0?t:this.resolveState(rr.from(t,r));else{var s=He(t)?this.resolve(Xl(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(rr.from(s,u))}if(!$t&&o.name===ps)throw new Error("An event cannot have the wildcard type ('".concat(ps,"')"));if(this.strict&&!this.events.includes(o.name)&&!H$(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var l=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},c=xs([],this.getStateNodes(a.value)),f=l.configuration.length?xs(c,l.configuration):c;return l.configuration=yt([],ze(f),!1),this.resolveTransition(l,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,yt([],ze(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,l,c=this;o===void 0&&(o=ga);var f=t.configuration,d=!n||t.transitions.length>0,h=d?t.configuration:n?n.configuration:[],p=$l(h,this),v=d?SO(this.machine,f):void 0,g=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,C=this.getActions(new Set(h),p,t,r,o,n,i),m=n?ne({},n.activities):{};try{for(var b=Ve(C),x=b.next();!x.done;x=b.next()){var T=x.value;try{for(var E=(u=void 0,Ve(T.actions)),A=E.next();!A.done;A=E.next()){var N=A.value;N.type===Ld?m[N.activity.id||N.activity.type]=N:N.type===Rh&&(m[N.activity.id||N.activity.type]=!1)}}catch(X){u={error:X}}finally{try{A&&!A.done&&(l=E.return)&&l.call(E)}finally{if(u)throw u.error}}}}catch(X){a={error:X}}finally{try{x&&!x.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}var I=ze(Zl(this,n,r,o,C,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),P=I[0],_=I[1],L=ze(Y$(P,Gd),2),U=L[0],Y=L[1],k=P.filter(function(X){var ae;return X.type===Ld&&((ae=X.activity)===null||ae===void 0?void 0:ae.type)===Vd}),ie=k.reduce(function(X,ae){return X[ae.activity.id]=mO(ae.activity,c.machine,_,o),X},n?ne({},n.children):{}),B=new rr({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?g?J$(g,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?Y:[],activities:v?m:n?n.activities:{},events:[],configuration:h,transitions:t.transitions,children:ie,done:p,tags:Gm(h),machine:this}),G=r!==_;B.changed=o.name===tC||G;var fe=B.history;fe&&delete fe.history;var j=!p&&(this._transient||f.some(function(X){return X._transient}));if(!d&&(!j||o.name===ra))return B;var R=B;if(!p)for(j&&(R=this.resolveRaisedTransition(R,{type:q$},o,i));U.length;){var te=U.shift();R=this.resolveRaisedTransition(R,te._event,o,i)}var oe=R.changed||(fe?!!R.actions.length||G||typeof fe.value!=typeof R.value||!pC(R.value,fe.value):void 0);return R.changed=oe,R.history=fe,R},e.prototype.getStateNode=function(t){if(Wo(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=Wo(t)?t.slice(Kd.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"&&Wo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=Ud(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||zo;switch(this.type){case"parallel":return Cs(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):zo});case"compound":if(He(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?Cs(t,function(o,a){return o?r.getStateNode(a).resolve(o):zo}):this.initialStateValue||{};default:return t||zo}},e.prototype.getResolvedPath=function(t){if(Wo(t)){var n=this.machine.idMap[t.slice(Kd.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return Ud(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=Vm(this.states,function(r){return r.initialStateValue||zo},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=tc(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;He(n.target)?t=Wo(n.target)?Xl(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(tc(this))return[this];if(this.type==="compound"&&!this.initial)return $t||tn(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=El(this.initialStateValue);return It(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=ze(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:Vm(this.states,function(n,r){if(!t)return n.historyValue();var i=He(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?It(El(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=W$(r.path,"states")(t).current;return He(o)?[r.getStateNode(o)]:It(El(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=It(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=Ve(Object.keys(o)),u=s.next();!u.done;u=s.next()){var l=u.value,c=o[l];if(c.states)try{for(var f=(r=void 0,Ve(c.events)),d=f.next();!d.done;d=f.next()){var h=d.value;a.add("".concat(h))}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(p){t={error:p}}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(!He(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=eO(t.target),i="internal"in t?t.internal:r?r.some(function(u){return He(u)&&u[0]===n.delimiter}):!0,o=this.machine.options.guards,a=this.resolveTarget(r),s=ne(ne({},t),{actions:xi(vr(t.actions)),cond:aC(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=ps,s=o[a],u=s===void 0?[]:s,l=Ph(o,[typeof a=="symbol"?a:a+""]);i=It(Object.keys(l).map(function(m){!$t&&m===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 b=Go(m,l[m]);return $t||kO(r,m,b),b}).concat(Go(ps,u)))}var c=this.config.always?Go("",this.config.always):[],f=this.config.onDone?Go(String(Yu(this.id)),this.config.onDone):[];$t||tn(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var d=It(this.invoke.map(function(m){var b=[];return m.onDone&&b.push.apply(b,yt([],ze(Go(String(Al(m.id)),m.onDone)),!1)),m.onError&&b.push.apply(b,yt([],ze(Go(String(ws(m.id)),m.onError)),!1)),b})),h=this.after,p=It(yt(yt(yt(yt([],ze(f),!1),ze(d),!1),ze(i),!1),ze(c),!1).map(function(m){return vr(m).map(function(b){return r.formatTransition(b)})}));try{for(var v=Ve(h),g=v.next();!g.done;g=v.next()){var C=g.value;p.push(C)}}catch(m){t={error:m}}finally{try{g&&!g.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}return p},e}(),Hm=!1;function Fh(e,t){return!$t&&!("predictableActionArguments"in e)&&!Hm&&(Hm=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new MO(e,t)}var Rn=fO,jO=Uc,vC=oO,Xu=pO,rt={},Lh={};(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!==Dt.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 s,u=1,l=arguments.length;u<l;u++){s=arguments[u];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(a[c]=s[c])}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 l=0,u=Object.getOwnPropertySymbols(o);l<u.length;l++)a.indexOf(u[l])<0&&Object.prototype.propertyIsEnumerable.call(o,u[l])&&(s[u[l]]=o[u[l]]);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),l,c=[],f;try{for(;(a===void 0||a-- >0)&&!(l=u.next()).done;)c.push(l.value)}catch(d){f={error:d}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return c}function i(o,a,s){if(s||arguments.length===2)for(var u=0,l=a.length,c;u<l;u++)(c||!(u in a))&&(c||(c=Array.prototype.slice.call(a,0,u)),c[u]=a[u]);return o.concat(c||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(Vh);var Gc={};(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={}))})(Gc);var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});var un=Gc,RO=un.ActionTypes.Start,kO=un.ActionTypes.Stop,MO=un.ActionTypes.Raise,jO=un.ActionTypes.Send,_O=un.ActionTypes.Cancel,qO=un.ActionTypes.NullEvent,FO=un.ActionTypes.Assign,LO=un.ActionTypes.After,VO=un.ActionTypes.DoneState,BO=un.ActionTypes.Log,UO=un.ActionTypes.Init,GO=un.ActionTypes.Invoke,zO=un.ActionTypes.ErrorExecution,WO=un.ActionTypes.ErrorPlatform,HO=un.ActionTypes.ErrorCustom,KO=un.ActionTypes.Update,YO=un.ActionTypes.Choose,JO=un.ActionTypes.Pure;Bt.after=LO;Bt.assign=FO;Bt.cancel=_O;Bt.choose=YO;Bt.doneState=VO;Bt.error=HO;Bt.errorExecution=zO;Bt.errorPlatform=WO;Bt.init=UO;Bt.invoke=GO;Bt.log=BO;Bt.nullEvent=qO;Bt.pure=JO;Bt.raise=MO;Bt.send=jO;Bt.start=RO;Bt.stop=kO;Bt.update=KO;var hC={},Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});var XO=".",QO={},ZO="xstate.guard",eD="";Fa.DEFAULT_GUARD_TYPE=ZO;Fa.EMPTY_ACTIVITY_MAP=QO;Fa.STATE_DELIMITER=XO;Fa.TARGETLESS_KEY=eD;var zc={};Object.defineProperty(zc,"__esModule",{value:!0});var tD=process.env.NODE_ENV==="production";zc.IS_PRODUCTION=tD;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Vh,n=Gc,r=Bt,i=Fa,o=zc,a;function s(S){return Object.keys(S)}function u(S,M,F){F===void 0&&(F=i.STATE_DELIMITER);var q=h(S,F),Q=h(M,F);return G(Q)?G(q)?Q===q:!1:G(q)?q in Q:Object.keys(q).every(function(Z){return Z in Q?u(q[Z],Q[Z]):!1})}function l(S){try{return G(S)||typeof S=="number"?"".concat(S):S.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function c(S){try{return G(S)||typeof S=="number"?"".concat(S):B(S)?S.name:S.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(S,M){try{return ie(S)?S:S.toString().split(M)}catch{throw new Error("'".concat(S,"' is not a valid state path."))}}function d(S){return typeof S=="object"&&"value"in S&&"context"in S&&"event"in S&&"_event"in S}function h(S,M){if(d(S))return S.value;if(ie(S))return p(S);if(typeof S!="string")return S;var F=f(S,M);return p(F)}function p(S){if(S.length===1)return S[0];for(var M={},F=M,q=0;q<S.length-1;q++)q===S.length-2?F[S[q]]=S[q+1]:(F[S[q]]={},F=F[S[q]]);return M}function v(S,M){for(var F={},q=Object.keys(S),Q=0;Q<q.length;Q++){var Z=q[Q];F[Z]=M(S[Z],Z,S,Q)}return F}function g(S,M,F){var q,Q,Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];F($e)&&(Z[be]=M($e,be,S))}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}var C=function(S){return function(M){var F,q,Q=M;try{for(var Z=t.__values(S),ce=Z.next();!ce.done;ce=Z.next()){var se=ce.value;Q=Q[se]}}catch(be){F={error:be}}finally{try{ce&&!ce.done&&(q=Z.return)&&q.call(Z)}finally{if(F)throw F.error}}return Q}};function m(S,M){return function(F){var q,Q,Z=F;try{for(var ce=t.__values(S),se=ce.next();!se.done;se=ce.next()){var be=se.value;Z=Z[M][be]}}catch($e){q={error:$e}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}}function b(S){if(!S)return[[]];if(G(S))return[[S]];var M=T(Object.keys(S).map(function(F){var q=S[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:b(S[F]).map(function(Q){return[F].concat(Q)})}));return M}function x(S){var M,F,q={};if(S&&S.length===1&&S[0].length===1)return S[0][0];try{for(var Q=t.__values(S),Z=Q.next();!Z.done;Z=Q.next())for(var ce=Z.value,se=q,be=0;be<ce.length;be++){var $e=ce[be];if(be===ce.length-2){se[$e]=ce[be+1];break}se[$e]=se[$e]||{},se=se[$e]}}catch(qt){M={error:qt}}finally{try{Z&&!Z.done&&(F=Q.return)&&F.call(Q)}finally{if(M)throw M.error}}return q}function T(S){var M;return(M=[]).concat.apply(M,t.__spreadArray([],t.__read(S),!1))}function E(S){return ie(S)?S:[S]}function A(S){return S===void 0?[]:E(S)}function N(S,M,F){var q,Q;if(B(S))return S(M,F.data);var Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];B($e)?Z[be]=$e(M,F.data):Z[be]=$e}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}function I(S){return/^(done|error)\./.test(S)}function P(S){return!!(S instanceof Promise||S!==null&&(B(S)||typeof S=="object")&&B(S.then))}function _(S){return S!==null&&typeof S=="object"&&"transition"in S&&typeof S.transition=="function"}function L(S,M){var F,q,Q=t.__read([[],[]],2),Z=Q[0],ce=Q[1];try{for(var se=t.__values(S),be=se.next();!be.done;be=se.next()){var $e=be.value;M($e)?Z.push($e):ce.push($e)}}catch(qt){F={error:qt}}finally{try{be&&!be.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Z,ce]}function U(S,M){return v(S.states,function(F,q){if(F){var Q=(G(M)?void 0:M[q])||(F?F.current:void 0);if(Q)return{current:Q,states:U(F,Q)}}})}function Y(S,M){return{current:M,states:U(S,M)}}function k(S,M,F,q){o.IS_PRODUCTION||e.warn(!!S,"Attempting to update undefined context");var Q=S&&F.reduce(function(Z,ce){var se,be,$e=ce.assignment,qt={state:q,action:ce,_event:M},Qi={};if(B($e))Qi=$e(Z,M.data,qt);else try{for(var _r=t.__values(Object.keys($e)),pr=_r.next();!pr.done;pr=_r.next()){var ls=pr.value,Zi=$e[ls];Qi[ls]=B(Zi)?Zi(Z,M.data,qt):Zi}}catch(jf){se={error:jf}}finally{try{pr&&!pr.done&&(be=_r.return)&&be.call(_r)}finally{if(se)throw se.error}}return Object.assign({},Z,Qi)},S);return Q}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(S,M){var F=S instanceof Error?S:void 0;if(!(!F&&S)&&console!==void 0){var q=["Warning: ".concat(M)];F&&q.push(F),console.warn.apply(console,q)}});function ie(S){return Array.isArray(S)}function B(S){return typeof S=="function"}function G(S){return typeof S=="string"}function fe(S,M){if(S)return G(S)?{type:i.DEFAULT_GUARD_TYPE,name:S,predicate:M?M[S]:void 0}:B(S)?{type:i.DEFAULT_GUARD_TYPE,name:S.name,predicate:S}:S}function j(S){try{return"subscribe"in S&&B(S.subscribe)}catch{return!1}}var R=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[R]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(S){return!!S&&"__xstatenode"in S}function X(S){return!!S&&typeof S.send=="function"}var ae=function(){var S=0;return function(){return S++,S.toString(16)}}();function de(S,M){return G(S)||typeof S=="number"?t.__assign({type:S},M):S}function he(S,M){if(!G(S)&&"$$type"in S&&S.$$type==="scxml")return S;var F=de(S);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},M)}function Te(S,M){var F=E(M).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:S}:t.__assign(t.__assign({},q),{event:S})});return F}function ke(S){if(!(S===void 0||S===i.TARGETLESS_KEY))return A(S)}function Ne(S,M,F){if(!o.IS_PRODUCTION){var q=S.stack?" Stacktrace was '".concat(S.stack,"'"):"";if(S===M)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(S,"'.").concat(q));else{var Q=M.stack?" Stacktrace was '".concat(M.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(S,"'. ").concat(q," Current error is '").concat(M,"'.").concat(Q))}}}function mt(S,M,F,q,Q){var Z=S.options.guards,ce={state:Q,cond:M,_event:q};if(M.type===i.DEFAULT_GUARD_TYPE)return((Z==null?void 0:Z[M.name])||M.predicate)(F,q.data,ce);var se=Z==null?void 0:Z[M.type];if(!se)throw new Error("Guard '".concat(M.type,"' is not implemented on machine '").concat(S.id,"'."));return se(F,q.data,ce)}function le(S){return typeof S=="string"?{type:S}:S}function Pn(S,M,F){var q=function(){},Q=typeof S=="object",Z=Q?S:null;return{next:((Q?S.next:S)||q).bind(Z),error:((Q?S.error:M)||q).bind(Z),complete:((Q?S.complete:F)||q).bind(Z)}}function pi(S,M){return"".concat(S,":invocation[").concat(M,"]")}function Bo(S){return(S.type===r.raise||S.type===r.send&&S.to===n.SpecialTargets.Internal)&&typeof S.delay!="number"}e.createInvokeId=pi,e.evaluateGuard=mt,e.flatten=T,e.getActionType=c,e.getEventType=l,e.interopSymbols=te,e.isActor=X,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=j,e.isPromiseLike=P,e.isRaisableAction=Bo,e.isStateLike=d,e.isString=G,e.keys=s,e.mapContext=N,e.mapFilterValues=g,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=ke,e.partition=L,e.path=C,e.pathToStateValue=p,e.pathsToStateValue=x,e.reportUnhandledExceptionOnInvocation=Ne,e.symbolObservable=R,e.toArray=A,e.toArrayStrict=E,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=le,e.toObserver=Pn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=b,e.toStateValue=h,e.toTransitionConfigArray=Te,e.uniqueId=ae,e.updateContext=k,e.updateHistoryStates=U,e.updateHistoryValue=Y})(hC);Object.defineProperty(rt,"__esModule",{value:!0});var Je=Vh,fr=Gc,on=Bt,Fe=hC,vC=zc,nD=Fe.toSCXMLEvent({type:on.init});function Yd(e,t){return t&&t[e]||void 0}function Wc(e,t){var n;if(Fe.isString(e)||typeof e=="number"){var r=Yd(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=Yd(e.type,t);if(Fe.isFunction(r))n=Je.__assign(Je.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Je.__assign(Je.__assign(Je.__assign({},r),e),{type:i})}else n=e}return n}var Jd=function(e,t){if(!e)return[];var n=Fe.isArray(e)?e:[e];return n.map(function(r){return Wc(r,t)})};function Bh(e){var t=Wc(e);return Je.__assign(Je.__assign({id:Fe.isString(e)?e:t.id},t),{type:t.type})}function rD(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 mC(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 Je.__assign(Je.__assign({},e),{type:on.raise,_event:o,delay:a})}function Tu(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 yC(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 Je.__assign(Je.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function Uh(e,t){return Tu(e,Je.__assign(Je.__assign({},t),{to:fr.SpecialTargets.Parent}))}function iD(e,t,n){return Tu(t,Je.__assign(Je.__assign({},n),{to:e}))}function oD(){return Uh(on.update)}function aD(e,t){return Tu(e,Je.__assign(Je.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var sD=function(e,t){return{context:e,event:t}};function uD(e,t){return e===void 0&&(e=sD),{type:on.log,label:t,expr:e}}var gC=function(e,t,n){return Je.__assign(Je.__assign({},e),{value:Fe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},lD=function(e){return{type:on.cancel,sendId:e}};function cD(e){var t=Bh(e);return{type:fr.ActionTypes.Start,activity:t,exec:void 0}}function fD(e){var t=Fe.isFunction(e)?e:Bh(e);return{type:fr.ActionTypes.Stop,activity:t,exec:void 0}}function bC(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 dD=function(e){return{type:on.assign,assignment:e}};function pD(e){return typeof e=="object"&&"type"in e}function hD(e,t){var n=t?"#".concat(t):"";return"".concat(fr.ActionTypes.After,"(").concat(e,")").concat(n)}function vD(e,t){var n="".concat(fr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function mD(e,t){var n="".concat(fr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function yD(e,t){var n="".concat(fr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function gD(e){return{type:fr.ActionTypes.Pure,get:e}}function bD(e,t){if(!vC.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,Je.__spreadArray([],Je.__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 Tu(function(r,i){return i},Je.__assign(Je.__assign({},t),{to:e}))}function SD(e,t){return Uh(function(n,r,i){return{type:on.error,data:Fe.isFunction(e)?e(n,r,i):e}},Je.__assign(Je.__assign({},t),{to:fr.SpecialTargets.Parent}))}function CD(e){return{type:fr.ActionTypes.Choose,conds:e}}var wD=function(e){var t,n,r=[];try{for(var i=Je.__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 Xd(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:wD(i),u=s.length?Fe.updateContext(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case on.raise:{var C=mC(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case on.send:var m=yC(v,u,r,e.options.delays);if(!vC.IS_PRODUCTION){var b=v.delay;Fe.warn(!Fe.isString(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==fr.SpecialTargets.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case on.log:{var x=gC(v,u,r);return o==null||o(x,u,r),x}case on.choose:{var T=v,E=(g=T.conds.find(function(B){var G=Fe.toGuard(B.cond,e.options.guards);return!G||Fe.evaluateGuard(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=Je.__read(Xd(e,t,u,r,[{type:p,actions:Jd(Fe.toArray(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case on.pure:{var E=v.get(u,r.data);if(!E)return[];var P=Je.__read(Xd(e,t,u,r,[{type:p,actions:Jd(Fe.toArray(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case on.stop:{var x=bC(v,u,r);return o==null||o(x,n,r),x}case on.assign:{u=Fe.updateContext(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=Wc(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=Je.__assign(Je.__assign({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,Je.__spreadArray([l[k]],Je.__read(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Je.__values(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=Fe.flatten(i.map(d));return[h,u]}rt.actionTypes=on;rt.after=hD;rt.assign=dD;rt.cancel=lD;rt.choose=CD;rt.done=vD;rt.doneInvoke=mD;rt.error=yD;rt.escalate=SD;rt.forwardTo=bD;rt.getActionFunction=Yd;rt.initEvent=nD;rt.isActionObject=pD;var zn=rt.log=uD,xD=rt.pure=gD;rt.raise=rD;rt.resolveActions=Xd;rt.resolveLog=gC;rt.resolveRaise=mC;rt.resolveSend=yC;rt.resolveStop=bC;rt.respond=aD;rt.send=Tu;rt.sendParent=Uh;rt.sendTo=iD;rt.sendUpdate=oD;rt.start=cD;var Hm=rt.stop=fD;rt.toActionObject=Wc;rt.toActionObjects=Jd;rt.toActivityDefinition=Bh;function SC(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function Hc(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 CC(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 Km(e){return e.constructor===Object||e.constructor==null}function Ym(e){return typeof e.then=="function"}function Kc(e,t){return e===t||e!==e&&t!==t}var TD="[object Arguments]",ED="[object Boolean]",ID="[object Date]",AD="[object RegExp]",$D="[object Map]",OD="[object Number]",DD="[object Object]",ND="[object Set]",PD="[object String]",Jm=Object.prototype.toString;function Yc(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(l);function l(c,f,d){if(c===f)return!0;if(!c||!f||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;if(Km(c)&&Km(f))return i(c,f,u,d);var h=Array.isArray(c),p=Array.isArray(f);if(h||p)return h===p&&t(c,f,u,d);var v=Jm.call(c);return v!==Jm.call(f)?!1:v===ID?n(c,f,u,d):v===AD?o(c,f,u,d):v===$D?r(c,f,u,d):v===ND?a(c,f,u,d):v===DD||v===TD?Ym(c)||Ym(f)?!1:i(c,f,u,d):v===ED||v===OD||v===PD?Kc(c.valueOf(),f.valueOf()):!1}return l}function wC(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 RD=Hc(wC);function xC(e,t){return Kc(e.valueOf(),t.valueOf())}function TC(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 l=!1,c=0;t.forEach(function(f,d){!l&&!o[c]&&(l=n(u,d,a,c,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[c]=!0),c++}),a++,i=l}}),i}var kD=Hc(TC),MD="_owner",jD=Object.prototype.hasOwnProperty;function EC(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===MD){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!jD.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var _D=Hc(EC);function IC(e,t){return e.source===t.source&&e.flags===t.flags}function AC(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,l=0;t.forEach(function(c,f){!u&&!o[l]&&(u=n(a,c,s,f,e,t,r))&&(o[l]=!0),l++}),i=u}}),i}var qD=Hc(AC),$C=Object.freeze({areArraysEqual:wC,areDatesEqual:xC,areMapsEqual:TC,areObjectsEqual:EC,areRegExpsEqual:IC,areSetsEqual:AC,createIsNestedEqual:SC}),OC=Object.freeze({areArraysEqual:RD,areDatesEqual:xC,areMapsEqual:kD,areObjectsEqual:_D,areRegExpsEqual:IC,areSetsEqual:qD,createIsNestedEqual:SC}),FD=Yc($C);function LD(e,t){return FD(e,t,void 0)}Yc(CC($C,{createIsNestedEqual:function(){return Kc}}));Yc(OC);Yc(CC(OC,{createIsNestedEqual:function(){return Kc}}));var Qd={exports:{}},qf={},Qu={exports:{}},Ff={};/**
|
|
35
|
+
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,l=arguments.length;u<l;u++){s=arguments[u];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(a[c]=s[c])}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 l=0,u=Object.getOwnPropertySymbols(o);l<u.length;l++)a.indexOf(u[l])<0&&Object.prototype.propertyIsEnumerable.call(o,u[l])&&(s[u[l]]=o[u[l]]);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),l,c=[],f;try{for(;(a===void 0||a-- >0)&&!(l=u.next()).done;)c.push(l.value)}catch(d){f={error:d}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return c}function i(o,a,s){if(s||arguments.length===2)for(var u=0,l=a.length,c;u<l;u++)(c||!(u in a))&&(c||(c=Array.prototype.slice.call(a,0,u)),c[u]=a[u]);return o.concat(c||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(Lh);var Gc={};(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={}))})(Gc);var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});var ln=Gc,_O=ln.ActionTypes.Start,qO=ln.ActionTypes.Stop,FO=ln.ActionTypes.Raise,LO=ln.ActionTypes.Send,VO=ln.ActionTypes.Cancel,BO=ln.ActionTypes.NullEvent,UO=ln.ActionTypes.Assign,GO=ln.ActionTypes.After,zO=ln.ActionTypes.DoneState,WO=ln.ActionTypes.Log,HO=ln.ActionTypes.Init,KO=ln.ActionTypes.Invoke,YO=ln.ActionTypes.ErrorExecution,JO=ln.ActionTypes.ErrorPlatform,XO=ln.ActionTypes.ErrorCustom,QO=ln.ActionTypes.Update,ZO=ln.ActionTypes.Choose,eD=ln.ActionTypes.Pure;Bt.after=GO;Bt.assign=UO;Bt.cancel=VO;Bt.choose=ZO;Bt.doneState=zO;Bt.error=XO;Bt.errorExecution=YO;Bt.errorPlatform=JO;Bt.init=HO;Bt.invoke=KO;Bt.log=WO;Bt.nullEvent=BO;Bt.pure=eD;Bt.raise=FO;Bt.send=LO;Bt.start=_O;Bt.stop=qO;Bt.update=QO;var mC={},Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});var tD=".",nD={},rD="xstate.guard",iD="";Fa.DEFAULT_GUARD_TYPE=rD;Fa.EMPTY_ACTIVITY_MAP=nD;Fa.STATE_DELIMITER=tD;Fa.TARGETLESS_KEY=iD;var zc={};Object.defineProperty(zc,"__esModule",{value:!0});var oD=process.env.NODE_ENV==="production";zc.IS_PRODUCTION=oD;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Lh,n=Gc,r=Bt,i=Fa,o=zc,a;function s(S){return Object.keys(S)}function u(S,M,F){F===void 0&&(F=i.STATE_DELIMITER);var q=h(S,F),Q=h(M,F);return G(Q)?G(q)?Q===q:!1:G(q)?q in Q:Object.keys(q).every(function(Z){return Z in Q?u(q[Z],Q[Z]):!1})}function l(S){try{return G(S)||typeof S=="number"?"".concat(S):S.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function c(S){try{return G(S)||typeof S=="number"?"".concat(S):B(S)?S.name:S.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(S,M){try{return ie(S)?S:S.toString().split(M)}catch{throw new Error("'".concat(S,"' is not a valid state path."))}}function d(S){return typeof S=="object"&&"value"in S&&"context"in S&&"event"in S&&"_event"in S}function h(S,M){if(d(S))return S.value;if(ie(S))return p(S);if(typeof S!="string")return S;var F=f(S,M);return p(F)}function p(S){if(S.length===1)return S[0];for(var M={},F=M,q=0;q<S.length-1;q++)q===S.length-2?F[S[q]]=S[q+1]:(F[S[q]]={},F=F[S[q]]);return M}function v(S,M){for(var F={},q=Object.keys(S),Q=0;Q<q.length;Q++){var Z=q[Q];F[Z]=M(S[Z],Z,S,Q)}return F}function g(S,M,F){var q,Q,Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];F($e)&&(Z[be]=M($e,be,S))}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}var C=function(S){return function(M){var F,q,Q=M;try{for(var Z=t.__values(S),ce=Z.next();!ce.done;ce=Z.next()){var se=ce.value;Q=Q[se]}}catch(be){F={error:be}}finally{try{ce&&!ce.done&&(q=Z.return)&&q.call(Z)}finally{if(F)throw F.error}}return Q}};function m(S,M){return function(F){var q,Q,Z=F;try{for(var ce=t.__values(S),se=ce.next();!se.done;se=ce.next()){var be=se.value;Z=Z[M][be]}}catch($e){q={error:$e}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}}function b(S){if(!S)return[[]];if(G(S))return[[S]];var M=T(Object.keys(S).map(function(F){var q=S[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:b(S[F]).map(function(Q){return[F].concat(Q)})}));return M}function x(S){var M,F,q={};if(S&&S.length===1&&S[0].length===1)return S[0][0];try{for(var Q=t.__values(S),Z=Q.next();!Z.done;Z=Q.next())for(var ce=Z.value,se=q,be=0;be<ce.length;be++){var $e=ce[be];if(be===ce.length-2){se[$e]=ce[be+1];break}se[$e]=se[$e]||{},se=se[$e]}}catch(qt){M={error:qt}}finally{try{Z&&!Z.done&&(F=Q.return)&&F.call(Q)}finally{if(M)throw M.error}}return q}function T(S){var M;return(M=[]).concat.apply(M,t.__spreadArray([],t.__read(S),!1))}function E(S){return ie(S)?S:[S]}function A(S){return S===void 0?[]:E(S)}function N(S,M,F){var q,Q;if(B(S))return S(M,F.data);var Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];B($e)?Z[be]=$e(M,F.data):Z[be]=$e}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}function I(S){return/^(done|error)\./.test(S)}function P(S){return!!(S instanceof Promise||S!==null&&(B(S)||typeof S=="object")&&B(S.then))}function _(S){return S!==null&&typeof S=="object"&&"transition"in S&&typeof S.transition=="function"}function L(S,M){var F,q,Q=t.__read([[],[]],2),Z=Q[0],ce=Q[1];try{for(var se=t.__values(S),be=se.next();!be.done;be=se.next()){var $e=be.value;M($e)?Z.push($e):ce.push($e)}}catch(qt){F={error:qt}}finally{try{be&&!be.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Z,ce]}function U(S,M){return v(S.states,function(F,q){if(F){var Q=(G(M)?void 0:M[q])||(F?F.current:void 0);if(Q)return{current:Q,states:U(F,Q)}}})}function Y(S,M){return{current:M,states:U(S,M)}}function k(S,M,F,q){o.IS_PRODUCTION||e.warn(!!S,"Attempting to update undefined context");var Q=S&&F.reduce(function(Z,ce){var se,be,$e=ce.assignment,qt={state:q,action:ce,_event:M},Qi={};if(B($e))Qi=$e(Z,M.data,qt);else try{for(var qr=t.__values(Object.keys($e)),hr=qr.next();!hr.done;hr=qr.next()){var ls=hr.value,Zi=$e[ls];Qi[ls]=B(Zi)?Zi(Z,M.data,qt):Zi}}catch(jf){se={error:jf}}finally{try{hr&&!hr.done&&(be=qr.return)&&be.call(qr)}finally{if(se)throw se.error}}return Object.assign({},Z,Qi)},S);return Q}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(S,M){var F=S instanceof Error?S:void 0;if(!(!F&&S)&&console!==void 0){var q=["Warning: ".concat(M)];F&&q.push(F),console.warn.apply(console,q)}});function ie(S){return Array.isArray(S)}function B(S){return typeof S=="function"}function G(S){return typeof S=="string"}function fe(S,M){if(S)return G(S)?{type:i.DEFAULT_GUARD_TYPE,name:S,predicate:M?M[S]:void 0}:B(S)?{type:i.DEFAULT_GUARD_TYPE,name:S.name,predicate:S}:S}function j(S){try{return"subscribe"in S&&B(S.subscribe)}catch{return!1}}var R=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[R]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(S){return!!S&&"__xstatenode"in S}function X(S){return!!S&&typeof S.send=="function"}var ae=function(){var S=0;return function(){return S++,S.toString(16)}}();function de(S,M){return G(S)||typeof S=="number"?t.__assign({type:S},M):S}function he(S,M){if(!G(S)&&"$$type"in S&&S.$$type==="scxml")return S;var F=de(S);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},M)}function Te(S,M){var F=E(M).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:S}:t.__assign(t.__assign({},q),{event:S})});return F}function ke(S){if(!(S===void 0||S===i.TARGETLESS_KEY))return A(S)}function Ne(S,M,F){if(!o.IS_PRODUCTION){var q=S.stack?" Stacktrace was '".concat(S.stack,"'"):"";if(S===M)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(S,"'.").concat(q));else{var Q=M.stack?" Stacktrace was '".concat(M.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(S,"'. ").concat(q," Current error is '").concat(M,"'.").concat(Q))}}}function mt(S,M,F,q,Q){var Z=S.options.guards,ce={state:Q,cond:M,_event:q};if(M.type===i.DEFAULT_GUARD_TYPE)return((Z==null?void 0:Z[M.name])||M.predicate)(F,q.data,ce);var se=Z==null?void 0:Z[M.type];if(!se)throw new Error("Guard '".concat(M.type,"' is not implemented on machine '").concat(S.id,"'."));return se(F,q.data,ce)}function le(S){return typeof S=="string"?{type:S}:S}function Pn(S,M,F){var q=function(){},Q=typeof S=="object",Z=Q?S:null;return{next:((Q?S.next:S)||q).bind(Z),error:((Q?S.error:M)||q).bind(Z),complete:((Q?S.complete:F)||q).bind(Z)}}function pi(S,M){return"".concat(S,":invocation[").concat(M,"]")}function Bo(S){return(S.type===r.raise||S.type===r.send&&S.to===n.SpecialTargets.Internal)&&typeof S.delay!="number"}e.createInvokeId=pi,e.evaluateGuard=mt,e.flatten=T,e.getActionType=c,e.getEventType=l,e.interopSymbols=te,e.isActor=X,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=j,e.isPromiseLike=P,e.isRaisableAction=Bo,e.isStateLike=d,e.isString=G,e.keys=s,e.mapContext=N,e.mapFilterValues=g,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=ke,e.partition=L,e.path=C,e.pathToStateValue=p,e.pathsToStateValue=x,e.reportUnhandledExceptionOnInvocation=Ne,e.symbolObservable=R,e.toArray=A,e.toArrayStrict=E,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=le,e.toObserver=Pn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=b,e.toStateValue=h,e.toTransitionConfigArray=Te,e.uniqueId=ae,e.updateContext=k,e.updateHistoryStates=U,e.updateHistoryValue=Y})(mC);Object.defineProperty(rt,"__esModule",{value:!0});var Je=Lh,dr=Gc,on=Bt,Fe=mC,yC=zc,aD=Fe.toSCXMLEvent({type:on.init});function Yd(e,t){return t&&t[e]||void 0}function Wc(e,t){var n;if(Fe.isString(e)||typeof e=="number"){var r=Yd(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=Yd(e.type,t);if(Fe.isFunction(r))n=Je.__assign(Je.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Je.__assign(Je.__assign(Je.__assign({},r),e),{type:i})}else n=e}return n}var Jd=function(e,t){if(!e)return[];var n=Fe.isArray(e)?e:[e];return n.map(function(r){return Wc(r,t)})};function Vh(e){var t=Wc(e);return Je.__assign(Je.__assign({id:Fe.isString(e)?e:t.id},t),{type:t.type})}function sD(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 gC(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 Je.__assign(Je.__assign({},e),{type:on.raise,_event:o,delay:a})}function Tu(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 bC(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 Je.__assign(Je.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function Bh(e,t){return Tu(e,Je.__assign(Je.__assign({},t),{to:dr.SpecialTargets.Parent}))}function uD(e,t,n){return Tu(t,Je.__assign(Je.__assign({},n),{to:e}))}function lD(){return Bh(on.update)}function cD(e,t){return Tu(e,Je.__assign(Je.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var fD=function(e,t){return{context:e,event:t}};function dD(e,t){return e===void 0&&(e=fD),{type:on.log,label:t,expr:e}}var SC=function(e,t,n){return Je.__assign(Je.__assign({},e),{value:Fe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},pD=function(e){return{type:on.cancel,sendId:e}};function hD(e){var t=Vh(e);return{type:dr.ActionTypes.Start,activity:t,exec:void 0}}function vD(e){var t=Fe.isFunction(e)?e:Vh(e);return{type:dr.ActionTypes.Stop,activity:t,exec:void 0}}function CC(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:dr.ActionTypes.Stop,activity:i};return o}var mD=function(e){return{type:on.assign,assignment:e}};function yD(e){return typeof e=="object"&&"type"in e}function gD(e,t){var n=t?"#".concat(t):"";return"".concat(dr.ActionTypes.After,"(").concat(e,")").concat(n)}function bD(e,t){var n="".concat(dr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function SD(e,t){var n="".concat(dr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function CD(e,t){var n="".concat(dr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function wD(e){return{type:dr.ActionTypes.Pure,get:e}}function xD(e,t){if(!yC.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,Je.__spreadArray([],Je.__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 Tu(function(r,i){return i},Je.__assign(Je.__assign({},t),{to:e}))}function TD(e,t){return Bh(function(n,r,i){return{type:on.error,data:Fe.isFunction(e)?e(n,r,i):e}},Je.__assign(Je.__assign({},t),{to:dr.SpecialTargets.Parent}))}function ED(e){return{type:dr.ActionTypes.Choose,conds:e}}var ID=function(e){var t,n,r=[];try{for(var i=Je.__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 Xd(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:ID(i),u=s.length?Fe.updateContext(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case on.raise:{var C=gC(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case on.send:var m=bC(v,u,r,e.options.delays);if(!yC.IS_PRODUCTION){var b=v.delay;Fe.warn(!Fe.isString(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==dr.SpecialTargets.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case on.log:{var x=SC(v,u,r);return o==null||o(x,u,r),x}case on.choose:{var T=v,E=(g=T.conds.find(function(B){var G=Fe.toGuard(B.cond,e.options.guards);return!G||Fe.evaluateGuard(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=Je.__read(Xd(e,t,u,r,[{type:p,actions:Jd(Fe.toArray(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case on.pure:{var E=v.get(u,r.data);if(!E)return[];var P=Je.__read(Xd(e,t,u,r,[{type:p,actions:Jd(Fe.toArray(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case on.stop:{var x=CC(v,u,r);return o==null||o(x,n,r),x}case on.assign:{u=Fe.updateContext(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=Wc(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=Je.__assign(Je.__assign({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,Je.__spreadArray([l[k]],Je.__read(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Je.__values(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=Fe.flatten(i.map(d));return[h,u]}rt.actionTypes=on;rt.after=gD;rt.assign=mD;rt.cancel=pD;rt.choose=ED;rt.done=bD;rt.doneInvoke=SD;rt.error=CD;rt.escalate=TD;rt.forwardTo=xD;rt.getActionFunction=Yd;rt.initEvent=aD;rt.isActionObject=yD;var zn=rt.log=dD,AD=rt.pure=wD;rt.raise=sD;rt.resolveActions=Xd;rt.resolveLog=SC;rt.resolveRaise=gC;rt.resolveSend=bC;rt.resolveStop=CC;rt.respond=cD;rt.send=Tu;rt.sendParent=Bh;rt.sendTo=uD;rt.sendUpdate=lD;rt.start=hD;var Km=rt.stop=vD;rt.toActionObject=Wc;rt.toActionObjects=Jd;rt.toActivityDefinition=Vh;function wC(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function Hc(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 xC(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 Ym(e){return e.constructor===Object||e.constructor==null}function Jm(e){return typeof e.then=="function"}function Kc(e,t){return e===t||e!==e&&t!==t}var $D="[object Arguments]",OD="[object Boolean]",DD="[object Date]",ND="[object RegExp]",PD="[object Map]",RD="[object Number]",kD="[object Object]",MD="[object Set]",jD="[object String]",Xm=Object.prototype.toString;function Yc(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(l);function l(c,f,d){if(c===f)return!0;if(!c||!f||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;if(Ym(c)&&Ym(f))return i(c,f,u,d);var h=Array.isArray(c),p=Array.isArray(f);if(h||p)return h===p&&t(c,f,u,d);var v=Xm.call(c);return v!==Xm.call(f)?!1:v===DD?n(c,f,u,d):v===ND?o(c,f,u,d):v===PD?r(c,f,u,d):v===MD?a(c,f,u,d):v===kD||v===$D?Jm(c)||Jm(f)?!1:i(c,f,u,d):v===OD||v===RD||v===jD?Kc(c.valueOf(),f.valueOf()):!1}return l}function TC(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 _D=Hc(TC);function EC(e,t){return Kc(e.valueOf(),t.valueOf())}function IC(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 l=!1,c=0;t.forEach(function(f,d){!l&&!o[c]&&(l=n(u,d,a,c,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[c]=!0),c++}),a++,i=l}}),i}var qD=Hc(IC),FD="_owner",LD=Object.prototype.hasOwnProperty;function AC(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===FD){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!LD.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var VD=Hc(AC);function $C(e,t){return e.source===t.source&&e.flags===t.flags}function OC(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,l=0;t.forEach(function(c,f){!u&&!o[l]&&(u=n(a,c,s,f,e,t,r))&&(o[l]=!0),l++}),i=u}}),i}var BD=Hc(OC),DC=Object.freeze({areArraysEqual:TC,areDatesEqual:EC,areMapsEqual:IC,areObjectsEqual:AC,areRegExpsEqual:$C,areSetsEqual:OC,createIsNestedEqual:wC}),NC=Object.freeze({areArraysEqual:_D,areDatesEqual:EC,areMapsEqual:qD,areObjectsEqual:VD,areRegExpsEqual:$C,areSetsEqual:BD,createIsNestedEqual:wC}),UD=Yc(DC);function GD(e,t){return UD(e,t,void 0)}Yc(xC(DC,{createIsNestedEqual:function(){return Kc}}));Yc(NC);Yc(xC(NC,{createIsNestedEqual:function(){return Kc}}));var Qd={exports:{}},qf={},Qu={exports:{}},Ff={};/**
|
|
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!==Dt.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 Qm;function zD(){if(Qm)return Ff;Qm=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 h=d(),p=r({inst:{value:h,getSnapshot:d}}),v=p[0].inst,g=p[1];return o(function(){v.value=h,v.getSnapshot=d,u(v)&&g({inst:v})},[f,h,d]),i(function(){return u(v)&&g({inst:v}),f(function(){u(v)&&g({inst:v})})},[f]),a(h),h}function u(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function l(f,d){return d()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:s;return Ff.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,Ff}var Lf={};/**
|
|
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!==Dt.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 Zm;function WD(){return Zm||(Zm=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(b){{for(var x=arguments.length,T=new Array(x>1?x-1:0),E=1;E<x;E++)T[E-1]=arguments[E];r("error",b,T)}}function r(b,x,T){{var E=t.ReactDebugCurrentFrame,A=E.getStackAddendum();A!==""&&(x+="%s",T=T.concat([A]));var N=T.map(function(I){return String(I)});N.unshift("Warning: "+x),Function.prototype.apply.call(console[b],console,N)}}function i(b,x){return b===x&&(b!==0||1/b===1/x)||b!==b&&x!==x}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue,c=!1,f=!1;function d(b,x,T){c||e.startTransition!==void 0&&(c=!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 E=x();if(!f){var A=x();o(E,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var N=a({inst:{value:E,getSnapshot:x}}),I=N[0].inst,P=N[1];return u(function(){I.value=E,I.getSnapshot=x,h(I)&&P({inst:I})},[b,E,x]),s(function(){h(I)&&P({inst:I});var _=function(){h(I)&&P({inst:I})};return b(_)},[b]),l(E),E}function h(b){var x=b.getSnapshot,T=b.value;try{var E=x();return!o(T,E)}catch{return!0}}function p(b,x,T){return x()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!v,C=g?p:d,m=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:C;Lf.useSyncExternalStore=m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Lf}var ey;function PC(){return ey||(ey=1,process.env.NODE_ENV==="production"?Qu.exports=zD():Qu.exports=WD()),Qu.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!==Dt.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 ty;function HD(){if(ty)return qf;ty=1;var e=O,t=PC();function n(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}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 qf.useSyncExternalStoreWithSelector=function(l,c,f,d,h){var p=o(null);if(p.current===null){var v={hasValue:!1,value:null};p.current=v}else v=p.current;p=s(function(){function C(E){if(!m){if(m=!0,b=E,E=d(E),h!==void 0&&v.hasValue){var A=v.value;if(h(A,E))return x=A}return x=E}if(A=x,r(b,E))return A;var N=d(E);return h!==void 0&&h(A,N)?A:(b=E,x=N)}var m=!1,b,x,T=f===void 0?null:f;return[function(){return C(c())},T===null?void 0:function(){return C(T())}]},[c,f,d,h]);var g=i(l,p[0],p[1]);return a(function(){v.hasValue=!0,v.value=g},[g]),u(g),g},qf}var Vf={};/**
|
|
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!==Dt.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 ty;function GD(){return ty||(ty=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=DC();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&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 l(c,f,d,h,p){var v=o(null),g;v.current===null?(g={hasValue:!1,value:null},v.current=g):g=v.current;var C=s(function(){var T=!1,E,A,N=function(L){if(!T){T=!0,E=L;var U=h(L);if(p!==void 0&&g.hasValue){var Y=g.value;if(p(Y,U))return A=Y,Y}return A=U,U}var k=E,ie=A;if(r(k,L))return ie;var B=h(L);return p!==void 0&&p(ie,B)?ie:(E=L,A=B,B)},I=d===void 0?null:d,P=function(){return N(f())},_=I===null?void 0:function(){return N(I())};return[P,_]},[f,d,h,p]),m=C[0],b=C[1],x=i(c,m,b);return a(function(){g.hasValue=!0,g.value=x},[x]),u(x),x}Vf.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Vf}process.env.NODE_ENV==="production"?Qd.exports=UD():Qd.exports=GD();var zD=Qd.exports,WD=O.useLayoutEffect;function ny(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var nc=globalThis&&globalThis.__assign||function(){return nc=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},nc.apply(this,arguments)},HD=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},KD=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 YD(e,t){var n=ny(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=KD(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,l=t.services,c=t.delays;t.state;var f=HD(t,["context","guards","actions","activities","services","delays","state"]),d=ny(function(){var h={context:o,guards:a,actions:s,activities:u,services:l,delays:c},p=n.withConfig(h,function(){return nc(nc({},n.context),o)});return dC(p,f)});return WD(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,l),Object.assign(d.machine.options.delays,c)},[s,a,u,l,c]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function JD(e,t,n){if(e.status===Dt.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var XD=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 QD(e){return e}function ZD(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=XD(t,1),i=r[0],o=i===void 0?{}:i,a=YD(e,o),s=O.useCallback(function(){return a.status===Dt.NotStarted?o.state?rr.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return JD(a,f,d)},[a]),l=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),c=zD.useSyncExternalStoreWithSelector(l,s,s,QD,u);return O.useEffect(function(){var f=o.state;return a.start(f?rr.create(f):void 0),function(){a.stop(),a.status=Dt.NotStarted}},[]),[c,a.send,a]}const Eu=window.configuratorReactContexts??{ConfigurationSessionContext:O.createContext(null),ConfigurationInitializationContext:O.createContext(null),ConfigurationUpdatingContext:O.createContext(null),ConfigurationContext:O.createContext(null)};window.configuratorReactContexts=Eu;const NC=Eu.ConfigurationSessionContext,PC=Eu.ConfigurationInitializationContext,RC=Eu.ConfigurationUpdatingContext,kC=Eu.ConfigurationContext,Gh=()=>O.useContext(NC),La=()=>O.useContext(kC),MC="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 zh(e){if(!e)throw new Error(MC)}function Va(e){if(!e)throw new Error(MC)}function Iu(){const e=Gh();return zh(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var e2=function(e){return e._tag==="Some"},Jc=function(e){return function(t){return e2(e(t))}};const t2=Jc(e=>e.type===Oe.Choice?je(e):ge),n2=Jc(e=>e.type===Oe.Numeric?je(e):ge),r2=Jc(e=>e.type===Oe.Boolean?je(e):ge),i2=Jc(e=>e.type===Oe.Component?je(e):ge);function Xc(e){return e.decision!=null&&e.decision.kind===Rr.Explicit}function jC(e){return w(e.values,Kt(Xc),W(t=>({type:Oe.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function o2(e){return w(e,Su(Xc),ee(()=>({type:Oe.Numeric,attributeId:e.id,state:null})))}function a2(e){return w(e,Su(Xc),ee(()=>({type:Oe.Boolean,attributeId:e.id,state:null})))}function s2(e){return w(e,Su(Xc),ee(()=>({type:Oe.Component,attributeId:e.id,state:null})))}function u2(e,t){return w(Fo.filterAttributesOfComponent(t,e,!0),n=>[w(n,Kt(t2),IE(jC)),w(n,Kt(n2),W(o2),Qn),w(n,Kt(r2),W(a2),Qn),w(n,Kt(i2),W(s2),Qn)],Sh)}function _C(){const e=Gh();return zh(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 l2(e,t=!1){const n=La();return Va(n),O.useMemo(()=>w(Ce(e),ee(Zn(W(r=>Fo.getAttribute(n,r)),t?jo(Ce):oi)),lt(()=>n.attributes)),[e,n,t])}function c2(e){const t=La(),{makeDecision:n,setManyDecision:r}=Iu(),i=Qc(e,zt.choiceValue);Va(t);const o=Fo.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,l)=>n({type:Oe.Choice,attributeId:e,choiceValueId:u,state:l}),clearDecisions:w(o,Ce,ee(jC),Jt(bu),ee(u=>()=>r(u,{type:"Default"})),lt(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function f2(e){const t=La(),{makeDecision:n}=Iu(),r=Qc(e,zt.numeric);Va(t);const i=Fo.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:Oe.Numeric,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}=Iu(),r=Qc(e,zt.boolean);Va(t);const i=Fo.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:Oe.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function p2(e){const t=La(),{makeDecision:n,setManyDecision:r}=Iu(),i=Qc(e,zt.component);Va(t);const o=t.attributes,a=Fo.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:l=>n({type:Oe.Component,attributeId:e,state:l}),clearSubtree:w(u2(e,o),Su(bu),ee(l=>()=>r(l,{type:"Default"})),lt(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function Qc(e,t){const{explain:n,applySolution:r}=_C();return O.useMemo(()=>({explain:(i,o)=>{const a=ue(i.question).with(xn.whyIsNotSatisfied,()=>zt.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 ry=Dn(YS),h2=Dn(JS),v2=Dn((e,t)=>fS(dt).equals(e??{},t??{})),m2=bn({attributeId:ry,decisions:Wi(ry)}),y2=Dn((e,t)=>Wi(m2).equals(e??[],t??[])),g2=bn({type:dt}),b2=bn({type:dt}),S2=bn({type:dt,rules:Wi(h2)}),C2=Dn((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:sn.all},y:{type:sn.all}},({x:n,y:r})=>g2.equals(n,r)).with({x:{type:sn.none},y:{type:sn.none}},({x:n,y:r})=>b2.equals(n,r)).with({x:{type:sn.specific},y:{type:sn.specific}},({x:n,y:r})=>S2.equals(n,r)).otherwise(()=>!1)),w2=bn({rules:Cu(C2)}),qC=bn({configurationModelSource:Dn((e,t)=>LD(e,t)),attributeRelations:y2,usageRuleParameters:v2,allowedInExplain:Cu(w2)}),Zd=Cu(qC),x2=gh,Ol=Cu(x2),T2=()=>Lh({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:[zn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[zn("Entering ProcessChanges","SessionManagement:"),Ho(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[zn("Entering DisposeSession","SessionManagement:"),Ho(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[zn("Entering CreateSession","SessionManagement:"),Ho(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[zn("Entering SessionCreationFailed","SessionManagement:"),Ho(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[zn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:zn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[zn("Entering UpdateSession","SessionManagement:"),Ho(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[zn("Entering SessionUpdateFailed","SessionManagement:"),Ho(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[zn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:zn("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(Vr).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({failureResult:t,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({failureResult:t,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!Ol.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!qC.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!Ol.equals(e.desiredClient,e.sessionCreationError.client)||!Zd.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!Ol.equals(e.desiredClient,e.actualClient)||!Zd.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Ho(e){const t=e===0,n=e===1;return xD((r,i)=>{const o={isInitializing:(!r.hasEverSuccessfullyCreatedSession||t)&&r.sessionCreationError==null,failureResult:r.sessionCreationError&&r.sessionCreationError.failureResult},a={isUpdating:n&&r.sessionUpdateError==null,failureResult:r.sessionUpdateError&&r.sessionUpdateError.failureResult};return pC({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const E2=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),I2=()=>Lh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[pC((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[zn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[zn("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)=>E2(e.session)}}}},{actions:{saveSession:Rn((e,t)=>({session:t.session}))}}),A2=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},iy=()=>{const e=A2();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var $2=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]},oy=function(e,t,n,r){return O.useEffect(e,$2(t,n,r))};const O2=()=>Lh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:iy()},entry:[Rn({sessionManagementActor:()=>zm(T2()),configurationSubscriptionManagementActor:()=>zm(I2())})],exit:[Hm(e=>e.sessionManagementActor),Hm(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[Xu(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[Xu(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[Xu(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[Xu(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Rn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),PO(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:iy())()}})}});function D2(e){var t,n;const[r,i]=ZD(O2,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});oy(()=>{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],Cm(Ol)),oy(()=>{const u=w(Ce(e.sessionContext),VE(l=>Ce(l.configurationModelSource)),or);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],Cm(Zd));const o=O.useMemo(()=>{var u,l,c,f;return{isInitializing:((l=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:l.promise)!=null,isInitializingPromise:(c=r.context.isReadyPromise)==null?void 0:c.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.failureResult)&&{...r.context.sessionInitialization.failureResult,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,l;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((l=r.context.sessionUpdating)==null?void 0:l.failureResult)&&{...r.context.sessionUpdating.failureResult,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 N2(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=D2({configuratorClient:t,sessionContext:n});return $.jsx(PC.Provider,{value:r,children:$.jsx(RC.Provider,{value:i,children:$.jsx(NC.Provider,{value:o,children:$.jsx(kC.Provider,{value:a,children:e.children})})})})}function FC(){return O.useContext(PC)}function P2(){return O.useContext(RC)}function R2(e){const{children:t}=e,{isInitializingPromise:n}=FC();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function k2(){const e=Gh(),t=La();return zh(e),Va(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const M2=Object.freeze(Object.defineProperty({__proto__:null,Configuration:N2,ConfigurationSuspender:R2,useAttributes:l2,useBooleanAttribute:d2,useChoiceAttribute:c2,useComponentAttribute:p2,useConfiguration:k2,useConfigurationInitialization:FC,useConfigurationUpdating:P2,useDecision:Iu,useExplain:_C,useNumericAttribute:f2},Symbol.toStringTag,{value:"Module"}));var j2=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))},_2=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},q2=function(e){var t=_2(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function jr(e){return e}function Ba(e){return function(){return e}}var F2=Ba(!0),L2=Ba(null),LC=Ba(void 0),Ur=LC;function Ln(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 y(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 l=arguments[0],c=1;c<arguments.length;c++)l=arguments[c](l);return l}}}var Tr=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,j2([i],r,!1))}}},V2=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))},VC=function(e){return e._tag==="None"},Wh=function(e){return e._tag==="Some"},Ua={_tag:"None"},Ga=function(e){return{_tag:"Some",value:e}},B2=function(e){return e._tag==="Left"},Zc=function(e){return{_tag:"Left",left:e}},ef=function(e){return{_tag:"Right",right:e}},U2=function(e){return[e]},G2=function(e){return e.length>0},z2=function(e){return e[0]},W2=function(e){return e.slice(1)},H2=[],K2={},Hh=Object.prototype.hasOwnProperty,Y2=function(e){return V2([e[0]],e.slice(1),!0)},J2=function(e,t){return Tr(2,function(n,r){return t.flatMap(n,function(i){return e.fromEither(r(i))})})};function X2(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 Q2(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 BC(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):BC(e,t-1,i)}}function Z2(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 BC(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 eN(e){return function(t){for(var n=Object.keys(t),r=n.length,i=Z2(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function tN(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function nN(e){var t=Q2(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function UC(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var rN=function(e){return function(){return Promise.resolve().then(e)}};function iN(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var tf=function(e,t){return y(e,Yh(t))},Kh=function(e,t){return y(e,oN(t))},Yh=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},oN=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)}},Jh=Tr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),$u="Task",nf={URI:$u,map:tf},Xh={URI:$u,of:Au},aN={URI:$u,map:tf,ap:Kh},Qh={URI:$u,map:tf,of:Au,ap:Kh,chain:Jh},sN=jr,ay=Jh,rc={URI:$u,map:tf,of:Au,ap:Kh,chain:Jh,fromIO:rN,fromTask:sN};function GC(e){return function(t){return function(n){return e.fromEither(VC(n)?Zc(t()):ef(n.value))}}}function uN(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?ef(o):Zc(r(o)))})}}}var Hr=Zc,Lo=ef,zC=function(e,t){return y(e,cN(t))},lN=function(e,t){return y(e,pN(t))},Zh="Either",cN=function(e){return function(t){return Fi(t)?t:Lo(e(t.right))}},fN={URI:Zh,map:zC},dN=function(e){return function(t){return Fi(t)?t:Fi(e)?e:Lo(t.right(e.right))}},pN=dN,hN={URI:Zh,map:zC,ap:lN},vN=function(e){return function(t){return Fi(t)?Hr(e(t.left)):t}},WC={URI:Zh,fromEither:jr},mN=GC(WC),Fi=B2,yN=function(e,t){return function(n){return Fi(n)?e(n.left):t(n.right)}},ao=yN;WC.fromEither;var gN=function(e){return Fi(e)?Lo(e.left):Hr(e.right)},bN=function(e,t){try{return Lo(e())}catch(n){return Hr(t(n))}},An=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},Sn=function(e){return An(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},sy=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])})})},ev={equals:function(e,t){return e===t}};ev.equals;var SN=function(e){return function(t,n){return t===n||e(t,n)===0}},za=function(e){return{equals:SN(e),compare:function(t,n){return t===n?0:e(t,n)}}},Xs=function(e){return za(function(t,n){return e.compare(n,t)})},Qr=function(e){return function(t){return za(function(n,r){return t.compare(e(n),e(r))})}},CN=function(){return{concat:function(e,t){return za(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},tv=function(){return{concat:CN().concat,empty:za(function(){return 0})}},wN={equals:F2,compare:Ba(0)},xN=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function TN(e,t){return e<t?-1:e>t?1:0}var EN={equals:ev.equals,compare:TN},IN=EN,AN=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}},$N=function(e){return{concat:xN(e)}},ON=function(e){return{concat:function(){return e}}},DN=AN,NN=ON(void 0),PN=$N,uy=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))},RN=H2,HC=G2,kN=function(e,t){return e<0||e>=t.length},MN=function(e){return function(t){return uy(uy([],t,!0),[e],!1)}},jN=MN,_N=function(e,t,n){if(n[e]===t)return n;var r=Y2(n);return r[e]=t,r},qN=function(e){return function(t){if(t.length===1)return t;for(var n=[YC(t)],r=UN(t),i=function(u){n.every(function(l){return!e.equals(l,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},FN=function(e){if(HC(e)){var t=tv();return LN(e.reduce(t.concat,t.empty))}return jr},KC=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);Hh.call(n,a)?n[a].push(o):n[a]=[o]}return n}},LN=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},VN=U2,BN=z2,YC=BN,UN=W2,rf={equals:function(e,t){return e===t}},of={equals:rf.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};rf.equals,of.compare;globalThis&&globalThis.__spreadArray;var ic=function(e){return e.length===0},Wa=HC,JC=jN,nv=function(e){return VC(e)?sf:[e.value]},GN=function(e){return function(t){if(ic(t))return sf;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},rv=kN;function ep(e,t){return t===void 0?function(n){return ep(e,n)}:rv(e,t)?Ua:Ga(t[e])}var zN=function(e){return function(t){return rv(e,t)?t:e===0?sf:t.slice(0,e)}},XC=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Ga(n);return Ua}};function Pt(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Ga(t[n]);return Ua}}var WN=function(e,t){return function(n){return rv(e,n)?Ua:Ga(QN(e,t(n[e]),n))}},af=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}};function iv(e){return function(t,n){if(n===void 0){var r=iv(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 fa=function(e){var t=qN(e);return function(n){return Wa(n)?t(n):n}},HN=function(e){var t=FN(e);return function(n){return Wa(n)?t(n):n}},KN=function(e){return function(t){return ic(t)?e:ic(e)?t:t.concat(e)}},Re=KN;function QC(e){var t=iv(e);return function(n,r){if(r===void 0){var i=QC(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var YN=VN,ZC=Tr(2,function(e,t){return y(e,GN(function(n,r){return t(r,n)}))}),Ha=ZC(jr),z=function(e){return function(t){return t.map(function(n){return e(n)})}},Vt=function(e){return function(t){return t.filter(e)}},JN=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Wh(i)&&n.push(i.value)}return n}},Vo=function(e){return JN(function(t,n){return e(n)})},qn=Vo(jr),tp=function(e,t){return XN(e,function(n,r,i){return t(r,i)})},XN=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}},Ki=function(e){return An(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},QN=function(e,t,n){return Wa(n)?_N(e,t,n):n},np=function(e){return e.slice()},ly=function(e){return ic(e)?sf:e.slice()},sf=RN,ew=ZC,ZN=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 to(e){return Pt(e)}var Dl=function(e){return function(t){return t.map(function(n){return e(n)})}},eP=Tr(2,function(e,t){return y(e,ZN(function(n,r){return t(r,n)}))}),tP=eP(jr),nP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Wh(i)&&n.push(i.value)}return n}},vi=function(e){return nP(function(t,n){return e(n)})},rP=function(e){return function(t){return t.filter(e)}},tw=function(e){return function(t){return Ln(e,t)}},iP=function(e){return function(t){return function(n){return t(n)&&e(n)}}},me=Ua,De=Ga;function Ou(e){return function(t){return e(t)?De(t):me}}var oP=function(e){return e._tag==="Left"?me:De(e.right)},nw=function(e,t){return y(e,K(t))},rw=function(e,t){return y(e,aP(t))},iw="Option",Yi=function(e){return{equals:function(t,n){return t===n||(ur(t)?ur(n):ur(n)?!1:e.equals(t.value,n.value))}}},ow=function(e){return{equals:Yi(e).equals,compare:function(t,n){return t===n?0:Ii(t)?Ii(n)?e.compare(t.value,n.value):1:-1}}},K=function(e){return function(t){return ur(t)?me:De(e(t.value))}},Di=De,aP=function(e){return function(t){return ur(t)||ur(e)?me:De(t.value(e.value))}},sP={URI:iw,map:nw,ap:rw,of:Di},ov=Tr(2,function(e,t){return ur(e)?me:t(e.value)}),uP={URI:iw,map:nw,ap:rw,chain:ov},aw=Tr(2,function(e,t){return ur(e)?t():e}),rp=aw,lP=ov(jr),Mt=function(e){return function(t){return ur(t)?me:e(t.value)?t:me}},cP=oP,Ii=Wh,ur=function(e){return e._tag==="None"},fP=function(e,t){return function(n){return ur(n)?e():t(n.value)}},Zr=fP,sw=Zr,dP=function(e){return function(t){return ur(t)?e():t.value}},Qe=dP,ip=lP,pP=Tr(2,UC(uP)),ye=function(e){return e==null?me:De(e)},hP=function(e){try{return De(e())}catch{return me}},vP=function(e){return function(t){return ur(t)?me:ye(e(t.value))}},Mn=Zr(L2,jr),Et=Zr(LC,jr),Fn=ov,mP=pP,yP=nN(sP);function gP(e){return Ln(Lo,e.of)}function bP(e){return Ln(Hr,e.of)}function SP(e){return tN(e,fN)}function CP(e){return X2(e,hN)}function wP(e){return function(t,n){return e.chain(t,function(r){return Fi(r)?e.of(r):n(r.right)})}}function xP(e){return function(t,n){return e.map(t,vN(n))}}function TP(e){return function(t,n){return function(r){return e.map(r,ao(t,n))}}}function EP(e){return function(t){return function(n){return e.chain(n,function(r){return Fi(r)?t(r.left):e.of(r)})}}}function IP(e){return function(t){return e.map(t,gN)}}var AP=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(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},$P=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(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Ni=bP(Xh),Ka=gP(Xh),OP=Au,DP=function(e){return Yh(mN(e))},oc=TP(nf),cy=function(e,t){return function(){return AP(void 0,void 0,void 0,function(){var n;return $P(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(ef)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Zc(t(n))];case 3:return[2]}})})}},uw=EP(Qh),fy=IP(nf),lw=function(e,t){return y(e,Wt(t))},cw=function(e,t){return y(e,PP(t))},Wt=SP(nf),NP=Tr(2,xP(nf)),br=NP,PP=CP(aN),av=Tr(2,wP(Qh)),da=Ka,sv="TaskEither",RP={URI:sv,map:lw,ap:cw,of:da},fw={URI:sv,map:lw,ap:cw,chain:av},uv={URI:sv,fromEither:OP},kP=Tr(2,UC(fw)),lv=GC(uv),MP={fromEither:uv.fromEither},jP={flatMap:av},_P=J2(MP,jP),qP=_P,op=uN(uv,fw),FP=da(K2),yr=av,LP=kP;function VP(e){return t=>y(t,Wt(n=>(e(n)(),n)))}const Qs=VP;function Zs(e){return t=>y(t,fy,Qs(e),fy)}function BP(e){return t=>y(t,Qs(n=>()=>e(n)()),Zs(n=>()=>e(n)()))}function UP(e){return t=>y(t,K(n=>(e(n)(),n)))}const GP=UP;function zP(e){return Ln(De,e.of)}function WP(e){return Ba(e.of(me))}function HP(e){var t=WP(e);return function(n,r){return e.chain(n,Zr(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var KP=zP(Xh),YP=Au,JP=Yh(cP),XP=Tr(2,HP(Qh)),QP=XP,cv=function(e){return DN(e)(e.empty)};NN.concat;var ZP=q2,ot={equals:function(e,t){return e===t}},eu={equals:ot.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},eR=function(e,t){return function(n){return n.replace(e,t)}},tR=function(e){return function(t){return Object.keys(t).sort(e.compare)}};function fv(e){if(typeof e=="function")return fv(eu)(e);var t=tR(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 dw(e){return function(t,n){if(n===void 0){var r=dw(e);return function(o){return r(o,t)}}for(var i in t)if(!Hh.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function pw(e,t){return t===void 0?function(n){return pw(e,n)}:Hh.call(t,e)?Ga(t[e]):Ua}var nR=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function hw(e){var t=dw(e);return An(function(n,r){return t(n)(r)&&t(r)(n)})}function rR(e){return An((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var dv={equals:function(e,t){return e===t}},vw={equals:dv.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};function iR(e){const t=parseFloat(e);return isNaN(t)?me:De(t)}const _n=Symbol.for("@ts-pattern/matcher"),mw=Symbol.for("@ts-pattern/isVariadic"),ac="@ts-pattern/anonymous-select-key",ap=e=>!!(e&&typeof e=="object"),Nl=e=>e&&!!e[_n],yn=(e,t,n)=>{if(Nl(e)){const r=e[_n](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(ap(e)){if(!ap(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];Nl(s)&&s[mw]?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((l,c)=>yn(l,a[c],n))&&i.every((l,c)=>yn(l,s[c],n))&&(o.length===0||yn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>yn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||Nl(o=i)&&o[_n]().matcherType==="optional")&&yn(i,t[r],n);var o})}return Object.is(t,e)},Xn=e=>{var t,n,r;return ap(e)?Nl(e)?(t=(n=(r=e[_n]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?tu(e,Xn):tu(Object.values(e),Xn):[]},tu=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function oR(...e){if(e.length===1){const[t]=e;return n=>yn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return yn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function En(e){return Object.assign(e,{optional:()=>pv(e),and:t=>Tt(e,t),or:t=>yw(e,t),select:t=>t===void 0?nu(e):nu(t,e)})}function sp(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[mw]:!0})}}))(e),{optional:()=>sp(pv(e)),select:t=>sp(t===void 0?nu(e):nu(t,e))})}function pv(e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Xn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:yn(e,t,r),selections:n}},getSelectionKeys:()=>Xn(e),matcherType:"optional"})})}const aR=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},sR=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function Tt(...e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>yn(i,t,r)),selections:n}},getSelectionKeys:()=>tu(e,Xn),matcherType:"and"})})}function yw(...e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return tu(e,Xn).forEach(i=>r(i,void 0)),{matched:e.some(i=>yn(i,t,r)),selections:n}},getSelectionKeys:()=>tu(e,Xn),matcherType:"or"})})}function et(e){return{[_n]:()=>({match:t=>({matched:!!e(t)})})}}function nu(...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 En({[_n]:()=>({match:r=>{let i={[t??ac]:r};return{matched:n===void 0||yn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??ac].concat(n===void 0?[]:Xn(n))})})}function $r(e){return typeof e=="number"}function so(e){return typeof e=="string"}function bi(e){return typeof e=="bigint"}const gw=En(et(function(e){return!0})),uR=gw,uo=e=>Object.assign(En(e),{startsWith:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.startsWith(n)))));var n},endsWith:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.endsWith(n)))));var n},minLength:t=>uo(Tt(e,(n=>et(r=>so(r)&&r.length>=n))(t))),maxLength:t=>uo(Tt(e,(n=>et(r=>so(r)&&r.length<=n))(t))),includes:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.includes(n)))));var n},regex:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&!!r.match(n)))));var n}}),lR=uo(et(so)),Or=e=>Object.assign(En(e),{between:(t,n)=>Or(Tt(e,((r,i)=>et(o=>$r(o)&&r<=o&&i>=o))(t,n))),lt:t=>Or(Tt(e,(n=>et(r=>$r(r)&&r<n))(t))),gt:t=>Or(Tt(e,(n=>et(r=>$r(r)&&r>n))(t))),lte:t=>Or(Tt(e,(n=>et(r=>$r(r)&&r<=n))(t))),gte:t=>Or(Tt(e,(n=>et(r=>$r(r)&&r>=n))(t))),int:()=>Or(Tt(e,et(t=>$r(t)&&Number.isInteger(t)))),finite:()=>Or(Tt(e,et(t=>$r(t)&&Number.isFinite(t)))),positive:()=>Or(Tt(e,et(t=>$r(t)&&t>0))),negative:()=>Or(Tt(e,et(t=>$r(t)&&t<0)))}),cR=Or(et($r)),Si=e=>Object.assign(En(e),{between:(t,n)=>Si(Tt(e,((r,i)=>et(o=>bi(o)&&r<=o&&i>=o))(t,n))),lt:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r<n))(t))),gt:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r>n))(t))),lte:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r<=n))(t))),gte:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r>=n))(t))),positive:()=>Si(Tt(e,et(t=>bi(t)&&t>0))),negative:()=>Si(Tt(e,et(t=>bi(t)&&t<0)))}),fR=Si(et(bi)),dR=En(et(function(e){return typeof e=="boolean"})),pR=En(et(function(e){return typeof e=="symbol"})),hR=En(et(function(e){return e==null}));var qe={__proto__:null,matcher:_n,optional:pv,array:function(...e){return sp({[_n]:()=>({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 Xn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>yn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Xn(e[0])})})},set:function(...e){return En({[_n]:()=>({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:aR(t,o=>yn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Xn(e[0])})})},map:function(...e){return En({[_n]:()=>({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:sR(t,(s,u)=>{const l=yn(o,u,r),c=yn(a,s,r);return l&&c}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Xn(e[0]),...Xn(e[1])]})})},intersection:Tt,union:yw,not:function(e){return En({[_n]:()=>({match:t=>({matched:!yn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:et,select:nu,any:gw,_:uR,string:lR,number:cR,bigint:fR,boolean:dR,symbol:pR,nullish:hR,instanceOf:function(e){return En(et(function(t){return n=>n instanceof t}(e)))},shape:function(e){return En(et(oR(e)))}};const up={matched:!1,value:void 0};function H(e){return new vR(e,up)}let vR=class lp{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=(l,c)=>{o=!0,a[l]=c},u=!r.some(l=>yn(l,this.input,s))||i&&!i(this.input)?up:{matched:!0,value:n(o?ac in a?a[ac]:a:this.input,this.input)};return new lp(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new lp(this.input,r?{matched:!0,value:n(this.input,this.input)}:up)}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 mR=Object.getOwnPropertyNames,yR=Object.getOwnPropertySymbols,gR=Object.prototype.hasOwnProperty;function dy(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Zu(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 py(e){return mR(e).concat(yR(e))}var bw=Object.hasOwn||function(e,t){return gR.call(e,t)};function Ya(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var Sw="_owner",hy=Object.getOwnPropertyDescriptor,vy=Object.keys;function bR(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 SR(e,t){return Ya(e.getTime(),t.getTime())}function my(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(),l=!1,c=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],h=f[1],p=s.value,v=p[0],g=p[1];!l&&!r[c]&&(l=n.equals(d,v,o,c,e,t,n)&&n.equals(h,g,d,v,e,t,n))&&(r[c]=!0),c++}if(!l)return!1;o++}return!0}function CR(e,t,n){var r=vy(e),i=r.length;if(vy(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===Sw&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!bw(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function hs(e,t,n){var r=py(e),i=r.length;if(py(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===Sw&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!bw(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=hy(e,o),s=hy(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function wR(e,t){return Ya(e.valueOf(),t.valueOf())}function xR(e,t){return e.source===t.source&&e.flags===t.flags}function yy(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,l=0;(a=s.next())&&!a.done;)!u&&!r[l]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[l]=!0),l++;if(!u)return!1}return!0}function TR(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 ER="[object Arguments]",IR="[object Boolean]",AR="[object Date]",$R="[object Map]",OR="[object Number]",DR="[object Object]",NR="[object RegExp]",PR="[object Set]",RR="[object String]",kR=Array.isArray,gy=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,by=Object.assign,MR=Object.prototype.toString.call.bind(Object.prototype.toString);function jR(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(c,f,d){if(c===f)return!0;if(c==null||f==null||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;var h=c.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(c,f,d);if(kR(c))return t(c,f,d);if(gy!=null&&gy(c))return u(c,f,d);if(h===Date)return n(c,f,d);if(h===RegExp)return a(c,f,d);if(h===Map)return r(c,f,d);if(h===Set)return s(c,f,d);var p=MR(c);return p===AR?n(c,f,d):p===NR?a(c,f,d):p===$R?r(c,f,d):p===PR?s(c,f,d):p===DR?typeof c.then!="function"&&typeof f.then!="function"&&i(c,f,d):p===ER?i(c,f,d):p===IR||p===OR||p===RR?o(c,f,d):!1}}function _R(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?hs:bR,areDatesEqual:SR,areMapsEqual:r?dy(my,hs):my,areObjectsEqual:r?hs:CR,arePrimitiveWrappersEqual:wR,areRegExpsEqual:xR,areSetsEqual:r?dy(yy,hs):yy,areTypedArraysEqual:r?hs:TR};if(n&&(i=by({},i,n(i))),t){var o=Zu(i.areArraysEqual),a=Zu(i.areMapsEqual),s=Zu(i.areObjectsEqual),u=Zu(i.areSetsEqual);i=by({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function qR(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function FR(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,l){var c=r(),f=c.cache,d=f===void 0?t?new WeakMap:void 0:f,h=c.meta;return n(u,l,{cache:d,equals:i,meta:h,strict:o})};if(t)return function(u,l){return n(u,l,{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,l){return n(u,l,a)}}var LR=Ji();Ji({strict:!0});Ji({circular:!0});Ji({circular:!0,strict:!0});Ji({createInternalComparator:function(){return Ya}});Ji({strict:!0,createInternalComparator:function(){return Ya}});Ji({circular:!0,createInternalComparator:function(){return Ya}});Ji({circular:!0,createInternalComparator:function(){return Ya},strict:!0});function Ji(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=_R(e),u=jR(s),l=r?r(u):qR(u);return FR({circular:n,comparator:u,createState:i,equals:l,strict:a})}function VR(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 BR(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),VR(e)}var Ms=y,UR=ZP(yP({concat:PN(IN).concat,empty:0}))();function GR(e){return function(t){return t.iterNumber>=e?me:De(0)}}function zR(e,t){return function(n){return Ms(n,t,K(function(r){return Math.min(e,r)}))}}function WR(e){return function(t){return De(e*Math.pow(2,t.iterNumber))}}var HR={iterNumber:0,cumulativeDelay:0,previousDelay:me};function KR(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+Qe(function(){return 0})(n),previousDelay:n}}function YR(e,t){var n=KR(e,t);return Ms(n.previousDelay,sw(function(){return rc.of(n)},function(r){return iN(r)(rc.of(n))}))}function Ko(e,t,n){var r=function(i){return Ms(i,t,ay(function(o){return n(o)?Ms(YR(e,i),ay(function(a){return Ms(a.previousDelay,sw(function(){return rc.of(o)},function(){return r(a)}))})):rc.of(o)}))};return r(HR)}var ru={};Object.defineProperty(ru,"__esModule",{value:!0});ru.isGuid=hv=ru.guid=void 0;var JR=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+=Sy()+"-";for(o+=r,o+=t;o.length<i;)o+=Sy();return o.substring(0,i)},hv=ru.guid=JR,Sy=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},XR=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=QR(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"};ru.isGuid=XR;var QR=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function vv(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function uf(e){return{equals(t,n){const r=y(ye(t),Qe(()=>[])),i=y(ye(n),Qe(()=>[]));return Ki(e).equals(r,i)}}}const Ja=Sn({localId:ot,componentPath:uf(ot),sharedConfigurationModelId:vv(ot)}),Cw=Sn({localId:ot,configurationModelId:ot}),ZR=An((e,t)=>H({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>ek.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>tk.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>nk.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>rk.equals(n.x,n.y)).otherwise(()=>!1)),ek=Sn({type:ot,attributeId:Ja,state:ot,choiceValueId:ot}),tk=Sn({type:ot,attributeId:Ja,state:ot}),nk=Sn({type:ot,attributeId:Ja,state:rf}),rk=Sn({type:ot,attributeId:Ja,state:dv});var Ft=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Ft||{}),Ue=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Ue||{}),Pl=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(Pl||{}),hn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(hn||{}),Li=(e=>(e.Channel="Channel",e.Package="Package",e))(Li||{}),V=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(V||{}),Ye=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ye||{}),Ge=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ge||{}),Se=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Se||{}),Pi=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Pi||{}),xa=(e=>(e.Always="Always",e.Optional="Optional",e))(xa||{}),pt=(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))(pt||{}),ww=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(ww||{});const ik={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};let ok=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 H(t).with({type:Li.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Li.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return y(t,ye,K(Ln(z(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),Et)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:y([...t.decisions],Dl(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return y(ye(t),Et)}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 H(t).returnType().with({type:hn.all},()=>({type:"AllowedRulesAll"})).with({type:hn.none},()=>({type:"AllowedRulesNone"})).with({type:hn.specific},n=>({type:"AllowedRulesSpecific",rules:y(n.rules,z(this.mapToGlobalConstraintId),np)})).with(qe.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function ak(e){return t=>op(n=>n!=null,e)(t)}function sk(){return Ka(Ur())}var Yn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Yn||{}),yo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(yo||{}),vn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(vn||{}),go=(e=>(e.all="all",e.none="none",e.specific="specific",e))(go||{});const wn=Sn({localId:ot,componentPath:uf(ot),sharedConfigurationModel:vv(ot)}),uk=Yi(Ki(Sn({attributeId:wn,decisions:uf(wn)}))),lk=Yi(An((e,t)=>H({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})=>Ki(Cw).equals(n.rules,r.rules)).otherwise(()=>!1))),ck=Yi(Sn({rules:lk})),fk=Sn({configurationModelSource:An((e,t)=>LR(e,t)),decisionsToRespect:uk,usageRuleParameters:hw(ot),allowedInExplain:ck});var iu=(e=>(e.Channel="Channel",e.Package="Package",e))(iu||{}),ft=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ft||{}),Ie=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ie||{}),Zt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Zt||{}),kt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(kt||{}),Eo=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Eo||{}),Io=(e=>(e.Always="Always",e.Optional="Optional",e))(Io||{});const dk={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:Yi(ot).equals(e.state,t.state)},pk={equals(e,t){return Yi(rf).equals(e.value,t.value)}},hk={equals(e,t){return Yi(dv).equals(e.value,t.value)}},vk={equals(e,t){return Yi(ot).equals(e.state,t.state)}},mk={equals(e,t){return wn.equals(e.attributeId,t.attributeId)?H({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>hk.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>pk.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>vk.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>dk.equals(r.x,r.y)).otherwise(()=>!1):!1}},yk=Ki(mk),gk={equals:(e,t)=>yk.equals(e.decisions,t.decisions)&&bk.equals(e.mode,t.mode)},bk={equals:(e,t)=>H({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 cp=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(cp||{}),ba=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ba||{}),xe=(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))(xe||{}),mv=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(mv||{});function Sk(e,t){console.log(`--------------------------------------------------------------------------------
|
|
67
|
+
*/var ny;function KD(){return ny||(ny=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=PC();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&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 l(c,f,d,h,p){var v=o(null),g;v.current===null?(g={hasValue:!1,value:null},v.current=g):g=v.current;var C=s(function(){var T=!1,E,A,N=function(L){if(!T){T=!0,E=L;var U=h(L);if(p!==void 0&&g.hasValue){var Y=g.value;if(p(Y,U))return A=Y,Y}return A=U,U}var k=E,ie=A;if(r(k,L))return ie;var B=h(L);return p!==void 0&&p(ie,B)?ie:(E=L,A=B,B)},I=d===void 0?null:d,P=function(){return N(f())},_=I===null?void 0:function(){return N(I())};return[P,_]},[f,d,h,p]),m=C[0],b=C[1],x=i(c,m,b);return a(function(){g.hasValue=!0,g.value=x},[x]),u(x),x}Vf.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Vf}process.env.NODE_ENV==="production"?Qd.exports=HD():Qd.exports=KD();var YD=Qd.exports,JD=O.useLayoutEffect;function ry(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var nc=globalThis&&globalThis.__assign||function(){return nc=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},nc.apply(this,arguments)},XD=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},QD=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 ZD(e,t){var n=ry(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=QD(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,l=t.services,c=t.delays;t.state;var f=XD(t,["context","guards","actions","activities","services","delays","state"]),d=ry(function(){var h={context:o,guards:a,actions:s,activities:u,services:l,delays:c},p=n.withConfig(h,function(){return nc(nc({},n.context),o)});return hC(p,f)});return JD(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,l),Object.assign(d.machine.options.delays,c)},[s,a,u,l,c]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function eN(e,t,n){if(e.status===Dt.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var tN=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 nN(e){return e}function rN(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=tN(t,1),i=r[0],o=i===void 0?{}:i,a=ZD(e,o),s=O.useCallback(function(){return a.status===Dt.NotStarted?o.state?rr.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return eN(a,f,d)},[a]),l=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),c=YD.useSyncExternalStoreWithSelector(l,s,s,nN,u);return O.useEffect(function(){var f=o.state;return a.start(f?rr.create(f):void 0),function(){a.stop(),a.status=Dt.NotStarted}},[]),[c,a.send,a]}const Eu=window.configuratorReactContexts??{ConfigurationSessionContext:O.createContext(null),ConfigurationInitializationContext:O.createContext(null),ConfigurationUpdatingContext:O.createContext(null),ConfigurationContext:O.createContext(null)};window.configuratorReactContexts=Eu;const RC=Eu.ConfigurationSessionContext,kC=Eu.ConfigurationInitializationContext,MC=Eu.ConfigurationUpdatingContext,jC=Eu.ConfigurationContext,Uh=()=>O.useContext(RC),La=()=>O.useContext(jC),_C="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 Gh(e){if(!e)throw new Error(_C)}function Va(e){if(!e)throw new Error(_C)}function Iu(){const e=Uh();return Gh(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var iN=function(e){return e._tag==="Some"},Jc=function(e){return function(t){return iN(e(t))}};const oN=Jc(e=>e.type===Oe.Choice?je(e):ge),aN=Jc(e=>e.type===Oe.Numeric?je(e):ge),sN=Jc(e=>e.type===Oe.Boolean?je(e):ge),uN=Jc(e=>e.type===Oe.Component?je(e):ge);function Xc(e){return e.decision!=null&&e.decision.kind===kr.Explicit}function qC(e){return w(e.values,Yt(Xc),W(t=>({type:Oe.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function lN(e){return w(e,Su(Xc),ee(()=>({type:Oe.Numeric,attributeId:e.id,state:null})))}function cN(e){return w(e,Su(Xc),ee(()=>({type:Oe.Boolean,attributeId:e.id,state:null})))}function fN(e){return w(e,Su(Xc),ee(()=>({type:Oe.Component,attributeId:e.id,state:null})))}function dN(e,t){return w(Fo.filterAttributesOfComponent(t,e,!0),n=>[w(n,Yt(oN),DE(qC)),w(n,Yt(aN),W(lN),Qn),w(n,Yt(sN),W(cN),Qn),w(n,Yt(uN),W(fN),Qn)],bh)}function FC(){const e=Uh();return Gh(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 pN(e,t=!1){const n=La();return Va(n),O.useMemo(()=>w(Ce(e),ee(Zn(W(r=>Fo.getAttribute(n,r)),t?jo(Ce):ai)),lt(()=>n.attributes)),[e,n,t])}function hN(e){const t=La(),{makeDecision:n,setManyDecision:r}=Iu(),i=Qc(e,Wt.choiceValue);Va(t);const o=Fo.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,l)=>n({type:Oe.Choice,attributeId:e,choiceValueId:u,state:l}),clearDecisions:w(o,Ce,ee(qC),Jt(bu),ee(u=>()=>r(u,{type:"Default"})),lt(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function vN(e){const t=La(),{makeDecision:n}=Iu(),r=Qc(e,Wt.numeric);Va(t);const i=Fo.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:Oe.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function mN(e){const t=La(),{makeDecision:n}=Iu(),r=Qc(e,Wt.boolean);Va(t);const i=Fo.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:Oe.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function yN(e){const t=La(),{makeDecision:n,setManyDecision:r}=Iu(),i=Qc(e,Wt.component);Va(t);const o=t.attributes,a=Fo.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:l=>n({type:Oe.Component,attributeId:e,state:l}),clearSubtree:w(dN(e,o),Su(bu),ee(l=>()=>r(l,{type:"Default"})),lt(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function Qc(e,t){const{explain:n,applySolution:r}=FC();return O.useMemo(()=>({explain:(i,o)=>{const a=ue(i.question).with(xn.whyIsNotSatisfied,()=>Wt.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 iy=Dn(XS),gN=Dn(QS),bN=Dn((e,t)=>pS(dt).equals(e??{},t??{})),SN=bn({attributeId:iy,decisions:Wi(iy)}),CN=Dn((e,t)=>Wi(SN).equals(e??[],t??[])),wN=bn({type:dt}),xN=bn({type:dt}),TN=bn({type:dt,rules:Wi(gN)}),EN=Dn((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:sn.all},y:{type:sn.all}},({x:n,y:r})=>wN.equals(n,r)).with({x:{type:sn.none},y:{type:sn.none}},({x:n,y:r})=>xN.equals(n,r)).with({x:{type:sn.specific},y:{type:sn.specific}},({x:n,y:r})=>TN.equals(n,r)).otherwise(()=>!1)),IN=bn({rules:Cu(EN)}),LC=bn({configurationModelSource:Dn((e,t)=>GD(e,t)),attributeRelations:CN,usageRuleParameters:bN,allowedInExplain:Cu(IN)}),Zd=Cu(LC),AN=yh,Ol=Cu(AN),$N=()=>Fh({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:[zn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[zn("Entering ProcessChanges","SessionManagement:"),Ho(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[zn("Entering DisposeSession","SessionManagement:"),Ho(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[zn("Entering CreateSession","SessionManagement:"),Ho(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[zn("Entering SessionCreationFailed","SessionManagement:"),Ho(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[zn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:zn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[zn("Entering UpdateSession","SessionManagement:"),Ho(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[zn("Entering SessionUpdateFailed","SessionManagement:"),Ho(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[zn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:zn("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(Br).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({failureResult:t,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({failureResult:t,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!Ol.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!LC.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!Ol.equals(e.desiredClient,e.sessionCreationError.client)||!Zd.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!Ol.equals(e.desiredClient,e.actualClient)||!Zd.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Ho(e){const t=e===0,n=e===1;return AD((r,i)=>{const o={isInitializing:(!r.hasEverSuccessfullyCreatedSession||t)&&r.sessionCreationError==null,failureResult:r.sessionCreationError&&r.sessionCreationError.failureResult},a={isUpdating:n&&r.sessionUpdateError==null,failureResult:r.sessionUpdateError&&r.sessionUpdateError.failureResult};return vC({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const ON=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),DN=()=>Fh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[vC((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[zn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[zn("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)=>ON(e.session)}}}},{actions:{saveSession:Rn((e,t)=>({session:t.session}))}}),NN=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},oy=()=>{const e=NN();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var PN=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]},ay=function(e,t,n,r){return O.useEffect(e,PN(t,n,r))};const RN=()=>Fh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:oy()},entry:[Rn({sessionManagementActor:()=>Wm($N()),configurationSubscriptionManagementActor:()=>Wm(DN())})],exit:[Km(e=>e.sessionManagementActor),Km(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[Xu(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[Xu(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[Xu(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[Xu(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Rn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),jO(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:oy())()}})}});function kN(e){var t,n;const[r,i]=rN(RN,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});ay(()=>{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],wm(Ol)),ay(()=>{const u=w(Ce(e.sessionContext),zE(l=>Ce(l.configurationModelSource)),or);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],wm(Zd));const o=O.useMemo(()=>{var u,l,c,f;return{isInitializing:((l=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:l.promise)!=null,isInitializingPromise:(c=r.context.isReadyPromise)==null?void 0:c.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.failureResult)&&{...r.context.sessionInitialization.failureResult,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,l;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((l=r.context.sessionUpdating)==null?void 0:l.failureResult)&&{...r.context.sessionUpdating.failureResult,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 MN(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=kN({configuratorClient:t,sessionContext:n});return $.jsx(kC.Provider,{value:r,children:$.jsx(MC.Provider,{value:i,children:$.jsx(RC.Provider,{value:o,children:$.jsx(jC.Provider,{value:a,children:e.children})})})})}function VC(){return O.useContext(kC)}function jN(){return O.useContext(MC)}function _N(e){const{children:t}=e,{isInitializingPromise:n}=VC();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function qN(){const e=Uh(),t=La();return Gh(e),Va(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const FN=Object.freeze(Object.defineProperty({__proto__:null,Configuration:MN,ConfigurationSuspender:_N,useAttributes:pN,useBooleanAttribute:mN,useChoiceAttribute:hN,useComponentAttribute:yN,useConfiguration:qN,useConfigurationInitialization:VC,useConfigurationUpdating:jN,useDecision:Iu,useExplain:FC,useNumericAttribute:vN},Symbol.toStringTag,{value:"Module"}));var LN=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))},VN=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},BN=function(e){var t=VN(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function _r(e){return e}function Ba(e){return function(){return e}}var UN=Ba(!0),GN=Ba(null),BC=Ba(void 0),Gr=BC;function Ln(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 y(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 l=arguments[0],c=1;c<arguments.length;c++)l=arguments[c](l);return l}}}var Tr=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,LN([i],r,!1))}}},zN=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))},UC=function(e){return e._tag==="None"},zh=function(e){return e._tag==="Some"},Ua={_tag:"None"},Ga=function(e){return{_tag:"Some",value:e}},WN=function(e){return e._tag==="Left"},Zc=function(e){return{_tag:"Left",left:e}},ef=function(e){return{_tag:"Right",right:e}},HN=function(e){return[e]},KN=function(e){return e.length>0},YN=function(e){return e[0]},JN=function(e){return e.slice(1)},XN=[],QN={},Wh=Object.prototype.hasOwnProperty,ZN=function(e){return zN([e[0]],e.slice(1),!0)},e2=function(e,t){return Tr(2,function(n,r){return t.flatMap(n,function(i){return e.fromEither(r(i))})})};function t2(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 n2(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 GC(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):GC(e,t-1,i)}}function r2(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 GC(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 i2(e){return function(t){for(var n=Object.keys(t),r=n.length,i=r2(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function o2(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function a2(e){var t=n2(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function zC(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var s2=function(e){return function(){return Promise.resolve().then(e)}};function u2(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var tf=function(e,t){return y(e,Kh(t))},Hh=function(e,t){return y(e,l2(t))},Kh=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},l2=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)}},Yh=Tr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),$u="Task",nf={URI:$u,map:tf},Jh={URI:$u,of:Au},c2={URI:$u,map:tf,ap:Hh},Xh={URI:$u,map:tf,of:Au,ap:Hh,chain:Yh},f2=_r,sy=Yh,rc={URI:$u,map:tf,of:Au,ap:Hh,chain:Yh,fromIO:s2,fromTask:f2};function WC(e){return function(t){return function(n){return e.fromEither(UC(n)?Zc(t()):ef(n.value))}}}function d2(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?ef(o):Zc(r(o)))})}}}var Kr=Zc,Lo=ef,HC=function(e,t){return y(e,h2(t))},p2=function(e,t){return y(e,y2(t))},Qh="Either",h2=function(e){return function(t){return Fi(t)?t:Lo(e(t.right))}},v2={URI:Qh,map:HC},m2=function(e){return function(t){return Fi(t)?t:Fi(e)?e:Lo(t.right(e.right))}},y2=m2,g2={URI:Qh,map:HC,ap:p2},b2=function(e){return function(t){return Fi(t)?Kr(e(t.left)):t}},KC={URI:Qh,fromEither:_r},S2=WC(KC),Fi=WN,C2=function(e,t){return function(n){return Fi(n)?e(n.left):t(n.right)}},ao=C2;KC.fromEither;var w2=function(e){return Fi(e)?Lo(e.left):Kr(e.right)},x2=function(e,t){try{return Lo(e())}catch(n){return Kr(t(n))}},An=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},Sn=function(e){return An(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},uy=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])})})},Zh={equals:function(e,t){return e===t}};Zh.equals;var T2=function(e){return function(t,n){return t===n||e(t,n)===0}},za=function(e){return{equals:T2(e),compare:function(t,n){return t===n?0:e(t,n)}}},Xs=function(e){return za(function(t,n){return e.compare(n,t)})},Zr=function(e){return function(t){return za(function(n,r){return t.compare(e(n),e(r))})}},E2=function(){return{concat:function(e,t){return za(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},ev=function(){return{concat:E2().concat,empty:za(function(){return 0})}},I2={equals:UN,compare:Ba(0)},A2=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function $2(e,t){return e<t?-1:e>t?1:0}var O2={equals:Zh.equals,compare:$2},D2=O2,N2=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}},P2=function(e){return{concat:A2(e)}},R2=function(e){return{concat:function(){return e}}},k2=N2,M2=R2(void 0),j2=P2,ly=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))},_2=XN,YC=KN,q2=function(e,t){return e<0||e>=t.length},F2=function(e){return function(t){return ly(ly([],t,!0),[e],!1)}},L2=F2,V2=function(e,t,n){if(n[e]===t)return n;var r=ZN(n);return r[e]=t,r},B2=function(e){return function(t){if(t.length===1)return t;for(var n=[XC(t)],r=H2(t),i=function(u){n.every(function(l){return!e.equals(l,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},U2=function(e){if(YC(e)){var t=ev();return G2(e.reduce(t.concat,t.empty))}return _r},JC=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);Wh.call(n,a)?n[a].push(o):n[a]=[o]}return n}},G2=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},z2=HN,W2=YN,XC=W2,H2=JN,rf={equals:function(e,t){return e===t}},of={equals:rf.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};rf.equals,of.compare;globalThis&&globalThis.__spreadArray;var ic=function(e){return e.length===0},Wa=YC,QC=L2,tv=function(e){return UC(e)?sf:[e.value]},K2=function(e){return function(t){if(ic(t))return sf;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},nv=q2;function ep(e,t){return t===void 0?function(n){return ep(e,n)}:nv(e,t)?Ua:Ga(t[e])}var Y2=function(e){return function(t){return nv(e,t)?t:e===0?sf:t.slice(0,e)}},ZC=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Ga(n);return Ua}};function Pt(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Ga(t[n]);return Ua}}var J2=function(e,t){return function(n){return nv(e,n)?Ua:Ga(nP(e,t(n[e]),n))}},af=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}};function rv(e){return function(t,n){if(n===void 0){var r=rv(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 fa=function(e){var t=B2(e);return function(n){return Wa(n)?t(n):n}},X2=function(e){var t=U2(e);return function(n){return Wa(n)?t(n):n}},Q2=function(e){return function(t){return ic(t)?e:ic(e)?t:t.concat(e)}},Re=Q2;function ew(e){var t=rv(e);return function(n,r){if(r===void 0){var i=ew(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Z2=z2,tw=Tr(2,function(e,t){return y(e,K2(function(n,r){return t(r,n)}))}),Ha=tw(_r),z=function(e){return function(t){return t.map(function(n){return e(n)})}},Vt=function(e){return function(t){return t.filter(e)}},eP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);zh(i)&&n.push(i.value)}return n}},Vo=function(e){return eP(function(t,n){return e(n)})},qn=Vo(_r),tp=function(e,t){return tP(e,function(n,r,i){return t(r,i)})},tP=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}},Ki=function(e){return An(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},nP=function(e,t,n){return Wa(n)?V2(e,t,n):n},np=function(e){return e.slice()},cy=function(e){return ic(e)?sf:e.slice()},sf=_2,nw=tw,rP=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 to(e){return Pt(e)}var Dl=function(e){return function(t){return t.map(function(n){return e(n)})}},iP=Tr(2,function(e,t){return y(e,rP(function(n,r){return t(r,n)}))}),oP=iP(_r),aP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);zh(i)&&n.push(i.value)}return n}},vi=function(e){return aP(function(t,n){return e(n)})},sP=function(e){return function(t){return t.filter(e)}},rw=function(e){return function(t){return Ln(e,t)}},uP=function(e){return function(t){return function(n){return t(n)&&e(n)}}},me=Ua,De=Ga;function Ou(e){return function(t){return e(t)?De(t):me}}var lP=function(e){return e._tag==="Left"?me:De(e.right)},iw=function(e,t){return y(e,K(t))},ow=function(e,t){return y(e,cP(t))},aw="Option",Yi=function(e){return{equals:function(t,n){return t===n||(ur(t)?ur(n):ur(n)?!1:e.equals(t.value,n.value))}}},sw=function(e){return{equals:Yi(e).equals,compare:function(t,n){return t===n?0:Ii(t)?Ii(n)?e.compare(t.value,n.value):1:-1}}},K=function(e){return function(t){return ur(t)?me:De(e(t.value))}},Di=De,cP=function(e){return function(t){return ur(t)||ur(e)?me:De(t.value(e.value))}},fP={URI:aw,map:iw,ap:ow,of:Di},iv=Tr(2,function(e,t){return ur(e)?me:t(e.value)}),dP={URI:aw,map:iw,ap:ow,chain:iv},uw=Tr(2,function(e,t){return ur(e)?t():e}),rp=uw,pP=iv(_r),Mt=function(e){return function(t){return ur(t)?me:e(t.value)?t:me}},hP=lP,Ii=zh,ur=function(e){return e._tag==="None"},vP=function(e,t){return function(n){return ur(n)?e():t(n.value)}},ei=vP,lw=ei,mP=function(e){return function(t){return ur(t)?e():t.value}},Qe=mP,ip=pP,yP=Tr(2,zC(dP)),ye=function(e){return e==null?me:De(e)},gP=function(e){try{return De(e())}catch{return me}},bP=function(e){return function(t){return ur(t)?me:ye(e(t.value))}},Mn=ei(GN,_r),Et=ei(BC,_r),Fn=iv,SP=yP,CP=a2(fP);function wP(e){return Ln(Lo,e.of)}function xP(e){return Ln(Kr,e.of)}function TP(e){return o2(e,v2)}function EP(e){return t2(e,g2)}function IP(e){return function(t,n){return e.chain(t,function(r){return Fi(r)?e.of(r):n(r.right)})}}function AP(e){return function(t,n){return e.map(t,b2(n))}}function $P(e){return function(t,n){return function(r){return e.map(r,ao(t,n))}}}function OP(e){return function(t){return function(n){return e.chain(n,function(r){return Fi(r)?t(r.left):e.of(r)})}}}function DP(e){return function(t){return e.map(t,w2)}}var NP=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(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},PP=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(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Ni=xP(Jh),Ka=wP(Jh),RP=Au,kP=function(e){return Kh(S2(e))},oc=$P(nf),fy=function(e,t){return function(){return NP(void 0,void 0,void 0,function(){var n;return PP(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(ef)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Zc(t(n))];case 3:return[2]}})})}},cw=OP(Xh),dy=DP(nf),fw=function(e,t){return y(e,Ht(t))},dw=function(e,t){return y(e,jP(t))},Ht=TP(nf),MP=Tr(2,AP(nf)),Sr=MP,jP=EP(c2),ov=Tr(2,IP(Xh)),da=Ka,av="TaskEither",_P={URI:av,map:fw,ap:dw,of:da},pw={URI:av,map:fw,ap:dw,chain:ov},sv={URI:av,fromEither:RP},qP=Tr(2,zC(pw)),uv=WC(sv),FP={fromEither:sv.fromEither},LP={flatMap:ov},VP=e2(FP,LP),BP=VP,op=d2(sv,pw),UP=da(QN),gr=ov,GP=qP;function zP(e){return t=>y(t,Ht(n=>(e(n)(),n)))}const Qs=zP;function Zs(e){return t=>y(t,dy,Qs(e),dy)}function WP(e){return t=>y(t,Qs(n=>()=>e(n)()),Zs(n=>()=>e(n)()))}function HP(e){return t=>y(t,K(n=>(e(n)(),n)))}const KP=HP;function YP(e){return Ln(De,e.of)}function JP(e){return Ba(e.of(me))}function XP(e){var t=JP(e);return function(n,r){return e.chain(n,ei(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var QP=YP(Jh),ZP=Au,eR=Kh(hP),tR=Tr(2,XP(Xh)),nR=tR,lv=function(e){return k2(e)(e.empty)};M2.concat;var rR=BN,ot={equals:function(e,t){return e===t}},eu={equals:ot.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},iR=function(e,t){return function(n){return n.replace(e,t)}},oR=function(e){return function(t){return Object.keys(t).sort(e.compare)}};function cv(e){if(typeof e=="function")return cv(eu)(e);var t=oR(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 hw(e){return function(t,n){if(n===void 0){var r=hw(e);return function(o){return r(o,t)}}for(var i in t)if(!Wh.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function vw(e,t){return t===void 0?function(n){return vw(e,n)}:Wh.call(t,e)?Ga(t[e]):Ua}var aR=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function mw(e){var t=hw(e);return An(function(n,r){return t(n)(r)&&t(r)(n)})}function sR(e){return An((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var fv={equals:function(e,t){return e===t}},yw={equals:fv.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};function uR(e){const t=parseFloat(e);return isNaN(t)?me:De(t)}const _n=Symbol.for("@ts-pattern/matcher"),gw=Symbol.for("@ts-pattern/isVariadic"),ac="@ts-pattern/anonymous-select-key",ap=e=>!!(e&&typeof e=="object"),Nl=e=>e&&!!e[_n],gn=(e,t,n)=>{if(Nl(e)){const r=e[_n](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(ap(e)){if(!ap(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];Nl(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((l,c)=>gn(l,a[c],n))&&i.every((l,c)=>gn(l,s[c],n))&&(o.length===0||gn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>gn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||Nl(o=i)&&o[_n]().matcherType==="optional")&&gn(i,t[r],n);var o})}return Object.is(t,e)},Xn=e=>{var t,n,r;return ap(e)?Nl(e)?(t=(n=(r=e[_n]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?tu(e,Xn):tu(Object.values(e),Xn):[]},tu=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function lR(...e){if(e.length===1){const[t]=e;return n=>gn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return gn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function En(e){return Object.assign(e,{optional:()=>dv(e),and:t=>Tt(e,t),or:t=>bw(e,t),select:t=>t===void 0?nu(e):nu(t,e)})}function sp(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[gw]:!0})}}))(e),{optional:()=>sp(dv(e)),select:t=>sp(t===void 0?nu(e):nu(t,e))})}function dv(e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Xn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:gn(e,t,r),selections:n}},getSelectionKeys:()=>Xn(e),matcherType:"optional"})})}const cR=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},fR=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function Tt(...e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>gn(i,t,r)),selections:n}},getSelectionKeys:()=>tu(e,Xn),matcherType:"and"})})}function bw(...e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return tu(e,Xn).forEach(i=>r(i,void 0)),{matched:e.some(i=>gn(i,t,r)),selections:n}},getSelectionKeys:()=>tu(e,Xn),matcherType:"or"})})}function et(e){return{[_n]:()=>({match:t=>({matched:!!e(t)})})}}function nu(...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 En({[_n]:()=>({match:r=>{let i={[t??ac]:r};return{matched:n===void 0||gn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??ac].concat(n===void 0?[]:Xn(n))})})}function Or(e){return typeof e=="number"}function so(e){return typeof e=="string"}function bi(e){return typeof e=="bigint"}const Sw=En(et(function(e){return!0})),dR=Sw,uo=e=>Object.assign(En(e),{startsWith:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.startsWith(n)))));var n},endsWith:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.endsWith(n)))));var n},minLength:t=>uo(Tt(e,(n=>et(r=>so(r)&&r.length>=n))(t))),maxLength:t=>uo(Tt(e,(n=>et(r=>so(r)&&r.length<=n))(t))),includes:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.includes(n)))));var n},regex:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&!!r.match(n)))));var n}}),pR=uo(et(so)),Dr=e=>Object.assign(En(e),{between:(t,n)=>Dr(Tt(e,((r,i)=>et(o=>Or(o)&&r<=o&&i>=o))(t,n))),lt:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r<n))(t))),gt:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r>n))(t))),lte:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r<=n))(t))),gte:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r>=n))(t))),int:()=>Dr(Tt(e,et(t=>Or(t)&&Number.isInteger(t)))),finite:()=>Dr(Tt(e,et(t=>Or(t)&&Number.isFinite(t)))),positive:()=>Dr(Tt(e,et(t=>Or(t)&&t>0))),negative:()=>Dr(Tt(e,et(t=>Or(t)&&t<0)))}),hR=Dr(et(Or)),Si=e=>Object.assign(En(e),{between:(t,n)=>Si(Tt(e,((r,i)=>et(o=>bi(o)&&r<=o&&i>=o))(t,n))),lt:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r<n))(t))),gt:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r>n))(t))),lte:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r<=n))(t))),gte:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r>=n))(t))),positive:()=>Si(Tt(e,et(t=>bi(t)&&t>0))),negative:()=>Si(Tt(e,et(t=>bi(t)&&t<0)))}),vR=Si(et(bi)),mR=En(et(function(e){return typeof e=="boolean"})),yR=En(et(function(e){return typeof e=="symbol"})),gR=En(et(function(e){return e==null}));var qe={__proto__:null,matcher:_n,optional:dv,array:function(...e){return sp({[_n]:()=>({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 Xn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>gn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Xn(e[0])})})},set:function(...e){return En({[_n]:()=>({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:cR(t,o=>gn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Xn(e[0])})})},map:function(...e){return En({[_n]:()=>({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:fR(t,(s,u)=>{const l=gn(o,u,r),c=gn(a,s,r);return l&&c}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Xn(e[0]),...Xn(e[1])]})})},intersection:Tt,union:bw,not:function(e){return En({[_n]:()=>({match:t=>({matched:!gn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:et,select:nu,any:Sw,_:dR,string:pR,number:hR,bigint:vR,boolean:mR,symbol:yR,nullish:gR,instanceOf:function(e){return En(et(function(t){return n=>n instanceof t}(e)))},shape:function(e){return En(et(lR(e)))}};const up={matched:!1,value:void 0};function H(e){return new bR(e,up)}let bR=class lp{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=(l,c)=>{o=!0,a[l]=c},u=!r.some(l=>gn(l,this.input,s))||i&&!i(this.input)?up:{matched:!0,value:n(o?ac in a?a[ac]:a:this.input,this.input)};return new lp(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new lp(this.input,r?{matched:!0,value:n(this.input,this.input)}:up)}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 SR=Object.getOwnPropertyNames,CR=Object.getOwnPropertySymbols,wR=Object.prototype.hasOwnProperty;function py(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Zu(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 hy(e){return SR(e).concat(CR(e))}var Cw=Object.hasOwn||function(e,t){return wR.call(e,t)};function Ya(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var ww="_owner",vy=Object.getOwnPropertyDescriptor,my=Object.keys;function xR(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 Ya(e.getTime(),t.getTime())}function yy(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(),l=!1,c=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],h=f[1],p=s.value,v=p[0],g=p[1];!l&&!r[c]&&(l=n.equals(d,v,o,c,e,t,n)&&n.equals(h,g,d,v,e,t,n))&&(r[c]=!0),c++}if(!l)return!1;o++}return!0}function ER(e,t,n){var r=my(e),i=r.length;if(my(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===ww&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Cw(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function hs(e,t,n){var r=hy(e),i=r.length;if(hy(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===ww&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Cw(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=vy(e,o),s=vy(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function IR(e,t){return Ya(e.valueOf(),t.valueOf())}function AR(e,t){return e.source===t.source&&e.flags===t.flags}function gy(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,l=0;(a=s.next())&&!a.done;)!u&&!r[l]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[l]=!0),l++;if(!u)return!1}return!0}function $R(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 OR="[object Arguments]",DR="[object Boolean]",NR="[object Date]",PR="[object Map]",RR="[object Number]",kR="[object Object]",MR="[object RegExp]",jR="[object Set]",_R="[object String]",qR=Array.isArray,by=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Sy=Object.assign,FR=Object.prototype.toString.call.bind(Object.prototype.toString);function LR(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(c,f,d){if(c===f)return!0;if(c==null||f==null||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;var h=c.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(c,f,d);if(qR(c))return t(c,f,d);if(by!=null&&by(c))return u(c,f,d);if(h===Date)return n(c,f,d);if(h===RegExp)return a(c,f,d);if(h===Map)return r(c,f,d);if(h===Set)return s(c,f,d);var p=FR(c);return p===NR?n(c,f,d):p===MR?a(c,f,d):p===PR?r(c,f,d):p===jR?s(c,f,d):p===kR?typeof c.then!="function"&&typeof f.then!="function"&&i(c,f,d):p===OR?i(c,f,d):p===DR||p===RR||p===_R?o(c,f,d):!1}}function VR(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?hs:xR,areDatesEqual:TR,areMapsEqual:r?py(yy,hs):yy,areObjectsEqual:r?hs:ER,arePrimitiveWrappersEqual:IR,areRegExpsEqual:AR,areSetsEqual:r?py(gy,hs):gy,areTypedArraysEqual:r?hs:$R};if(n&&(i=Sy({},i,n(i))),t){var o=Zu(i.areArraysEqual),a=Zu(i.areMapsEqual),s=Zu(i.areObjectsEqual),u=Zu(i.areSetsEqual);i=Sy({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function BR(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function UR(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,l){var c=r(),f=c.cache,d=f===void 0?t?new WeakMap:void 0:f,h=c.meta;return n(u,l,{cache:d,equals:i,meta:h,strict:o})};if(t)return function(u,l){return n(u,l,{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,l){return n(u,l,a)}}var GR=Ji();Ji({strict:!0});Ji({circular:!0});Ji({circular:!0,strict:!0});Ji({createInternalComparator:function(){return Ya}});Ji({strict:!0,createInternalComparator:function(){return Ya}});Ji({circular:!0,createInternalComparator:function(){return Ya}});Ji({circular:!0,createInternalComparator:function(){return Ya},strict:!0});function Ji(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=LR(s),l=r?r(u):BR(u);return UR({circular:n,comparator:u,createState:i,equals:l,strict:a})}function zR(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 WR(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),zR(e)}var Ms=y,HR=rR(CP({concat:j2(D2).concat,empty:0}))();function KR(e){return function(t){return t.iterNumber>=e?me:De(0)}}function YR(e,t){return function(n){return Ms(n,t,K(function(r){return Math.min(e,r)}))}}function JR(e){return function(t){return De(e*Math.pow(2,t.iterNumber))}}var XR={iterNumber:0,cumulativeDelay:0,previousDelay:me};function QR(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+Qe(function(){return 0})(n),previousDelay:n}}function ZR(e,t){var n=QR(e,t);return Ms(n.previousDelay,lw(function(){return rc.of(n)},function(r){return u2(r)(rc.of(n))}))}function Ko(e,t,n){var r=function(i){return Ms(i,t,sy(function(o){return n(o)?Ms(ZR(e,i),sy(function(a){return Ms(a.previousDelay,lw(function(){return rc.of(o)},function(){return r(a)}))})):rc.of(o)}))};return r(XR)}var ru={};Object.defineProperty(ru,"__esModule",{value:!0});ru.isGuid=pv=ru.guid=void 0;var ek=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+=Cy()+"-";for(o+=r,o+=t;o.length<i;)o+=Cy();return o.substring(0,i)},pv=ru.guid=ek,Cy=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},tk=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=nk(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"};ru.isGuid=tk;var nk=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function hv(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function uf(e){return{equals(t,n){const r=y(ye(t),Qe(()=>[])),i=y(ye(n),Qe(()=>[]));return Ki(e).equals(r,i)}}}const Ja=Sn({localId:ot,componentPath:uf(ot),sharedConfigurationModelId:hv(ot)}),xw=Sn({localId:ot,configurationModelId:ot}),rk=An((e,t)=>H({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>ik.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>ok.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>ak.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>sk.equals(n.x,n.y)).otherwise(()=>!1)),ik=Sn({type:ot,attributeId:Ja,state:ot,choiceValueId:ot}),ok=Sn({type:ot,attributeId:Ja,state:ot}),ak=Sn({type:ot,attributeId:Ja,state:rf}),sk=Sn({type:ot,attributeId:Ja,state:fv});var Ft=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Ft||{}),Ue=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Ue||{}),Pl=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(Pl||{}),vn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(vn||{}),Li=(e=>(e.Channel="Channel",e.Package="Package",e))(Li||{}),V=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(V||{}),Ye=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ye||{}),Ge=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ge||{}),Se=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Se||{}),Pi=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Pi||{}),xa=(e=>(e.Always="Always",e.Optional="Optional",e))(xa||{}),pt=(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))(pt||{}),Tw=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Tw||{});const uk={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 H(t).with({type:Li.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Li.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return y(t,ye,K(Ln(z(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),Et)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:y([...t.decisions],Dl(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return y(ye(t),Et)}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 H(t).returnType().with({type:vn.all},()=>({type:"AllowedRulesAll"})).with({type:vn.none},()=>({type:"AllowedRulesNone"})).with({type:vn.specific},n=>({type:"AllowedRulesSpecific",rules:y(n.rules,z(this.mapToGlobalConstraintId),np)})).with(qe.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function ck(e){return t=>op(n=>n!=null,e)(t)}function fk(){return Ka(Gr())}var Yn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Yn||{}),yo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(yo||{}),mn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(mn||{}),go=(e=>(e.all="all",e.none="none",e.specific="specific",e))(go||{});const wn=Sn({localId:ot,componentPath:uf(ot),sharedConfigurationModel:hv(ot)}),dk=Yi(Ki(Sn({attributeId:wn,decisions:uf(wn)}))),pk=Yi(An((e,t)=>H({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})=>Ki(xw).equals(n.rules,r.rules)).otherwise(()=>!1))),hk=Yi(Sn({rules:pk})),vk=Sn({configurationModelSource:An((e,t)=>GR(e,t)),decisionsToRespect:dk,usageRuleParameters:mw(ot),allowedInExplain:hk});var iu=(e=>(e.Channel="Channel",e.Package="Package",e))(iu||{}),ft=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ft||{}),Ie=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ie||{}),Zt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Zt||{}),kt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(kt||{}),Eo=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Eo||{}),Io=(e=>(e.Always="Always",e.Optional="Optional",e))(Io||{});const mk={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:Yi(ot).equals(e.state,t.state)},yk={equals(e,t){return Yi(rf).equals(e.value,t.value)}},gk={equals(e,t){return Yi(fv).equals(e.value,t.value)}},bk={equals(e,t){return Yi(ot).equals(e.state,t.state)}},Sk={equals(e,t){return wn.equals(e.attributeId,t.attributeId)?H({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>gk.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>yk.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>bk.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>mk.equals(r.x,r.y)).otherwise(()=>!1):!1}},Ck=Ki(Sk),wk={equals:(e,t)=>Ck.equals(e.decisions,t.decisions)&&xk.equals(e.mode,t.mode)},xk={equals:(e,t)=>H({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 cp=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(cp||{}),ba=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ba||{}),xe=(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))(xe||{}),vv=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(vv||{});function Tk(e,t){console.log(`--------------------------------------------------------------------------------
|
|
68
68
|
-- ${t??""}
|
|
69
69
|
--------------------------------------------------------------------------------
|
|
70
|
-
${JSON.stringify(e,null,2)}`)}var js=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(js||{}),xw=(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))(xw||{});const Ck=e=>Object.values(xw).includes(e),wk=e=>Ck(e)?De(e):me;function xk(e){const t=n=>H(n).with("ConfigurationModelNotFound",()=>({type:xe.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:xe.DecisionsToRespectInvalid})).with(qe.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:xe.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:xe.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:xe.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:xe.ConfigurationConflict,reason:mv.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:xe.ConfigurationConflict})).with(qe.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:xe.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:xe.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:xe.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:xe.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:xe.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return y(e.type,wk,K(t))}const Tk=e=>Object.values(js).includes(e),Ek=e=>Tk(e)?De(e):me;function Ik(e){return y(e,Ek,K(n=>H(n).with("Generic::LocalClientError",()=>({type:xe.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:xe.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:xe.CommunicationError})).with("Generic::Unauthorized",()=>({type:xe.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:xe.Unknown})).exhaustive()))}function Gr(e,t){Sk(e,t);const n=e.type;return y(me,rp(()=>xk(e)),rp(()=>Ik(n)),Qe(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:xe.Unknown})))}let Ak=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 y(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),br(r=>Gr(r,"ClientSideSessionLifetimeHandler - create")),yr(r=>this.restToDomainMapper.mapToSessionId(r)),ak(()=>({type:xe.ConfigurationUnauthenticated})))}close(t){return y(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),br(n=>Gr(n,"ClientSideSessionLifetimeHandler - close")),Wt(()=>Ur()))}};var Tw=(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))(Tw||{});function Fr(e,t,n){const r=y(Array.isArray(e)?e:[e],BR);return y(cy(()=>fetch(r,t),i=>({type:"error"})),yr(i=>y(cy(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),uw(i=>i.status===401?Ni({type:js.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?Ka({response:i,data:{}}):i.type==="error"?Ni({type:js.LowLevelCommunicationError}):Ni({type:js.UnhandledResponseStatus})),yr(i=>y(n(i),lv(()=>i.data))))}function fp(e,t){return Fr(e,t,n=>{if(n.response.status===200)return Di(n.data);if(n.response.status===409){const r=n.data;return H(r).with({type:"ConfigurationModelInvalid"},i=>Di(r)).with({type:"ConfigurationModelNotFeasible"},i=>Di(r)).otherwise(()=>me)}return me})}let $k=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 fp([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 fp([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?De(i.data):me)}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?De(i.data):me)}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?De(r.data):me)}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?De(i.data):me)}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?De(i.data):me)}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?De(r.data):me)}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?De({}):me)}};var Ao=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ao||{}),dp=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(dp||{}),pp=(e=>(e.Always="Always",e.Optional="Optional",e))(pp||{}),ou=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(ou||{}),Kr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Kr||{}),Gn=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(Gn||{}),hp=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(hp||{}),vp=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(vp||{}),Es=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Es||{});const Bn=Sn({localId:ot,componentPath:uf(ot),sharedConfigurationModelId:vv(ot)});let Ew=class{mapToDecisions(t){return{}}mapToSessionId(t){return H(t).with({sessionId:qe.string},n=>Ka(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=y(n.constraintExplanations,z(i=>this.mapToConstraintExplanation(i)));return Ni({type:xe.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Ni({type:xe.ConfigurationModelInvalid})).otherwise(()=>Ni({type:xe.Unknown}))}mapToExplainAnswer(t,n){const r=H(n).with({question:Yn.whyIsStateNotPossible,subject:vn.boolean},a=>[{type:Ie.Boolean,attributeId:a.attributeId,value:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:vn.numeric},a=>[{type:Ie.Numeric,attributeId:a.attributeId,value:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:vn.component},a=>[{type:Ie.Component,attributeId:a.attributeId,state:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:vn.choiceValue},a=>[{type:Ie.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:De(a.state)}]).otherwise(()=>[]),i=y(t.decisionExplanations,z(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=y(t.constraintExplanations,z(a=>this.mapToConstraintExplanation(a)));return H(n).with({answerType:yo.decisions},()=>({decisionExplanations:i})).with({answerType:yo.constraints},()=>({constraintExplanations:o})).with({answerType:yo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:xe.ConfigurationSetManyConflict,decisionExplanations:y(t.decisionExplanations,z(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:y(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 y(this.mapToDecisionState(t.state),K(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:y(t.causedByRules,z(n=>this.mapToRuleConstraint(n))),causedByCardinalities:y(t.causedByCardinalities,z(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:ba.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:ba.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=y(t.booleanDecisions??[],z(a=>({type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),r=y(t.numericDecisions??[],z(a=>({type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),i=y(t.componentDecisions??[],z(a=>({type:Ie.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:y(ye(a.state),K(s=>this.mapToDecisionState(s)),ip)}))),o=y(t.choiceDecisions??[],z(a=>({type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:y(ye(a.state),K(s=>this.mapToDecisionState(s)),ip)})));return y([],Re(n),Re(r),Re(i),Re(o))}mapToDecisionExplanation(t,n,r){const i=y(t.causedByBooleanDecisions,z(p=>this.mapToCausedByBooleanDecision(p))),o=y(t.causedByNumericDecisions,z(p=>this.mapToCausedByNumericDecision(p))),a=y(t.causedByComponentDecisions,z(p=>this.mapToCausedByComponentDecision(p))),s=y(t.causedByChoiceDecisions,z(p=>this.mapToCausedByChoiceValueDecision(p))),u=y(i,z(p=>({type:Ie.Boolean,attributeId:p.attributeId,value:me}))),l=y(o,z(p=>({type:Ie.Numeric,attributeId:p.attributeId,value:me}))),c=y(a,z(p=>({type:Ie.Component,attributeId:p.attributeId,state:me}))),f=y(s,z(p=>({type:Ie.ChoiceValue,attributeId:p.attributeId,choiceValueId:p.choiceValueId,state:me}))),d=y([],Re(u),Re(l),Re(c),Re(f)),h=QC(An((p,v)=>{const g=wn.equals(p.attributeId,v.attributeId);return H({a:p,b:v}).with({a:{type:Ie.ChoiceValue},b:{type:Ie.ChoiceValue}},C=>g&&C.a.choiceValueId===C.b.choiceValueId).otherwise(()=>g)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:y([],Re(d),Re(h)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return H(t).with(hp.NotAvailable,()=>cp.NotAvailable).with(hp.StateNotPossible,()=>cp.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 y(n.canAttributeContributeToConfigurationSatisfaction,Pt(h=>Bn.equals(h,d)),Ii)}const i=y([],Re(y(t.choiceValueDecisions,z(d=>d.attributeId))),Re(y(n.choiceConsequences,z(d=>d.attributeId))),fa(Bn)),o=y(i,z(d=>{const h=y(t.choiceValueDecisions??[],rP(v=>Bn.equals(v.attributeId,d))),p=y(n.choiceConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToChoiceAttributes(v,h,r(d))))}),qn),a=y([],Re(y(t.numericDecisions,z(d=>d.attributeId))),Re(y(n.numericConsequences,z(d=>d.attributeId))),fa(Bn)),s=y(a,z(d=>{const h=y(t.numericDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.numericConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToNumericAttribute(v,h,r(d))))}),qn),u=y([],Re(y(t.booleanDecisions,z(d=>d.attributeId))),Re(y(n.booleanConsequences,z(d=>d.attributeId))),fa(Bn)),l=y(u,z(d=>{const h=y(t.booleanDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.booleanConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToBooleanAttribute(v,h,r(d))))}),qn),c=y([],Re(y(t.componentDecisions,z(d=>d.attributeId))),Re(y(n.componentConsequences,z(d=>d.attributeId))),fa(Bn)),f=y(c,z(d=>{const h=y(t.componentDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.componentConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToComponentAttribute(v,h,r(d))))}),qn);return y([],Re(o),Re(f),Re(s),Re(l))}mapToComponentAttribute(t,n,r){return{type:ft.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:y(t.possibleDecisionStates,Dl(i=>this.mapToPossibleDecisionState(i))),decision:y(n,Fn(i=>y(this.mapToDecisionState(i.state),K(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:y(t.selection,ye,K(i=>this.mapToSelection(i)),Et),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=y(t.values,Dl(o=>{const a=y(n,Pt(s=>s.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:ft.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(t,n,r){return{type:ft.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:y(n,Fn(i=>y(i.state,ye,K(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(t,n,r){return{type:ft.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:y(n,Fn(i=>y(i.state,ye,K(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=y(t.possibleDecisionStates,Dl(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:y(n,Fn(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return H(t).with(ou.Implicit,()=>kt.Implicit).with(ou.Explicit,()=>kt.Explicit).exhaustive()}mapToDecisionState(t){return H(t).with(Kr.Included,()=>De(Zt.Included)).with(Kr.Excluded,()=>De(Zt.Excluded)).with(Kr.Undefined,()=>me).exhaustive()}mapToPossibleDecisionState(t){return H(t).with(Ao.Included,()=>Zt.Included).with(Ao.Excluded,()=>Zt.Excluded).exhaustive()}mapToSelection(t){return H(t).with(dp.Mandatory,()=>Eo.Mandatory).with(dp.Optional,()=>Eo.Optional).exhaustive()}mapToInclusion(t){return H(t).with(pp.Always,()=>Io.Always).with(pp.Optional,()=>Io.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},Ok=class{constructor(t,n){this.restToDomainMapper=new Ew,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=fp(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return y(r,br(i=>Gr(i,"ServerSideSessionLifetimeHandler - create")),yr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return y(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===Tw.NoContent?De({}):me),br(n=>Gr(n,"ServerSideSessionLifetimeHandler - close")),Wt(Ur))}};const Iw={whyIsNotSatisfied:{configuration:{question:Ft.whyIsNotSatisfied,subject:Ue.configuration},attribute:e=>({question:Ft.whyIsNotSatisfied,subject:Ue.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:Ft.whyIsStateNotPossible,subject:Ue.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.component,attributeId:e,state:t})})}};let Dk=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=me}setOnConfigurationChangedHandler(t){const n=y(t,ye,K(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 y(this.inner.setSessionContext(n),Wt(Ur),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await y(this.inner.restoreConfiguration(n),Wt(Ur),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await y(this.inner.makeDecision(n),Wt(Ur),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await y(this.inner.setMany(r,i),Wt(Ur),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await y(this.inner.applySolution(n),Wt(Ur),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(Iw):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await y(this.inner.explain(i),Wt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await y(this.inner.close(),br(t=>this.domainToContractMapper.mapToFailureResult(t)),oc(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Ln(br(t=>this.domainToContractMapper.mapToFailureResult(t)),oc(t=>Promise.reject(t),t=>Promise.resolve(t)))}},Nk=class{mapToExplainQuestion(t,n){const r={answerType:H(n).with("decisions",()=>yo.decisions).with("constraints",()=>yo.constraints).with("full",()=>yo.all).exhaustive()};return H(t).with({question:Ft.whyIsNotSatisfied,subject:Ue.configuration},i=>({...r,question:Yn.whyIsNotSatisfied,subject:vn.configuration})).with({question:Ft.whyIsNotSatisfied,subject:Ue.attribute},i=>({...r,question:Yn.whyIsNotSatisfied,subject:vn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.choiceValue},i=>({...r,question:Yn.whyIsStateNotPossible,subject:vn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.component},i=>({...r,question:Yn.whyIsStateNotPossible,subject:vn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.numeric},i=>({...r,question:Yn.whyIsStateNotPossible,subject:vn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:Ft.whyIsStateNotPossible,subject:Ue.boolean},i=>({...r,question:Yn.whyIsStateNotPossible,subject:vn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:y(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return y(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 H(t).with({type:V.Choice,choiceValueId:qe.string},n=>({type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:V.Numeric},n=>({type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:V.Boolean},n=>({type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:V.Component},n=>({type:Ie.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(ye(n.state),Fn(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return y(ye(t),K(n=>y(n,z(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:y(r.decisions,z(i=>this.mapToGlobalAttributeId(i)))})))))}mapToMode(t){return H(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 H(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 H(t).with({type:Li.Package},n=>({type:iu.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Li.Channel},n=>({type:iu.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:y(t.decisions,z(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return H(t).with({type:V.Boolean},n=>({type:ft.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:y(n.decision,ye,K(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Numeric},n=>({type:ft.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:y(n.decision,ye,K(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Choice},n=>({type:ft.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:y(n.values,z(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Component},n=>({type:ft.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:y(n.decision,ye,Fn(r=>y(this.mapToDecisionStateOption(r.state),K(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:y(n.possibleDecisionStates,z(r=>this.mapToDecisionStateOption(r)),qn),selection:y(n.selection,ye,K(r=>this.mapToSelection(r)),Et),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:y(t.possibleDecisionStates,z(n=>this.mapToDecisionStateOption(n)),qn)}}mapToChoiceValueDecision(t){return y(t.decision,ye,Fn(n=>y(this.mapToDecisionStateOption(n.state),K(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return H(t).with(Se.Implicit,()=>kt.Implicit).with(Se.Explicit,()=>kt.Explicit).exhaustive()}mapToSelection(t){return H(t).with(Pi.Mandatory,()=>Eo.Mandatory).with(Pi.Optional,()=>Eo.Optional).exhaustive()}mapToInclusion(t){return H(t).with(xa.Always,()=>Io.Always).with(xa.Optional,()=>Io.Optional).exhaustive()}mapToDecisionState(t){return H(t).with(qe.union(Ye.Included,Ge.Included),()=>Zt.Included).with(qe.union(Ye.Excluded,Ge.Excluded),()=>Zt.Excluded).exhaustive()}mapToDecisionStateOption(t){return y(ye(t),K(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return y(t,ye,K(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return y(t,ye,K(n=>H(n).returnType().with({type:hn.all},()=>({type:go.all})).with({type:hn.none},()=>({type:go.none})).with({type:hn.specific},r=>({type:go.specific,rules:y(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()))}},Aw=class{mapToExplainAnswer(t){const n=H(t).with({decisionExplanations:qe.array(qe.any)},i=>y(i.decisionExplanations,z(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=H(t).with({constraintExplanations:qe.array(qe.any)},i=>y(i.constraintExplanations,z(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:y(t.causedByCardinalities,z(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:y(t.causedByRules,z(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=y(t.causedByChoiceDecisions,z(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=y(t.causedByComponentDecisions,z(a=>this.mapToCausedByComponentAttributeDecision(a))),i=y(t.causedByNumericDecisions,z(a=>this.mapToCausedByNumericAttributeDecision(a))),o=y(t.causedByBooleanDecisions,z(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:y([],Re(n),Re(r),Re(i),Re(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:y(t.decisions,z(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return H(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return H(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 H(t).with({type:xe.ConfigurationConflict},n=>({type:pt.ConfigurationConflict,reason:H(n.reason).with(mv.NumericDecisionOutOfRange,()=>ww.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:xe.ConfigurationApplicationError},()=>({type:pt.ConfigurationApplicationError})).with({type:xe.ConfigurationUnauthenticated},()=>({type:pt.ConfigurationUnauthenticated})).with({type:xe.ConfigurationModelNotFound},()=>({type:pt.ConfigurationModelNotFound})).with({type:xe.ConfigurationTimeout},()=>({type:pt.ConfigurationTimeout})).with({type:xe.ConfigurationAttributeNotFound},()=>({type:pt.ConfigurationAttributeNotFound})).with({type:xe.ConfigurationChoiceValueNotFound},()=>({type:pt.ConfigurationChoiceValueNotFound})).with({type:xe.ConfigurationSolutionNotAvailable},()=>({type:pt.ConfigurationSolutionNotAvailable})).with({type:xe.ConfigurationRejectedDecisionsConflict},n=>{const r=y(n.rejectedDecisions,z(i=>this.mapToExplicitDecision(i)));return ik.createConfigurationRejectedDecisionsConflict(r)}).with({type:xe.DecisionsToRespectInvalid},()=>({type:pt.DecisionsToRespectInvalid})).with({type:xe.ServiceError},()=>({type:pt.ServiceError})).with({type:xe.CommunicationError},()=>({type:pt.CommunicationError})).with({type:xe.Unknown},()=>({type:pt.Unknown})).with({type:xe.ConfigurationModelInvalid},()=>({type:pt.ConfigurationModelInvalid})).with({type:xe.ConfigurationInitializationFailure},()=>({type:pt.ConfigurationInitializationFailure})).with({type:xe.ConfigurationModelNotFeasible},n=>({type:pt.ConfigurationModelNotFeasible,constraintExplanations:y(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:xe.ConfigurationSetManyConflict},n=>({type:pt.ConfigurationSetManyConflict,decisionExplanations:y(n.decisionExplanations,z(r=>this.mapToDecisionExplanation(r))),constraintExplanations:y(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:xe.SpecifiedDeploymentForbidden},n=>({type:pt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:y(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return y(t,K(Ln(z(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:y(n.decisions,z(r=>this.mapToGlobalAttributeId(r)))})))),Mn)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return H(t).with({type:iu.Package},n=>({type:Li.Package,configurationModelPackage:n.configurationModelPackage})).with({type:iu.Channel},n=>({type:Li.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return H(t).with({type:Ie.ChoiceValue},n=>({type:V.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.state,K(r=>this.mapToChoiceValueDecisionState(r)),Et),choiceValueId:n.choiceValueId})).with({type:Ie.Component},n=>({type:V.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.state,K(r=>this.mapToComponentDecisionState(r)),Et)})).with({type:Ie.Numeric},n=>({type:V.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).with({type:Ie.Boolean},n=>({type:V.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).exhaustive()}mapToCardinality(t){return H(t).with(ba.Cardinality,()=>Pl.Cardinality).with(ba.Component,()=>Pl.Component).with(ba.Rule,()=>Pl.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return H(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:V.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:V.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:V.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:V.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return H(t).with(Eo.Mandatory,()=>Pi.Mandatory).with(Eo.Optional,()=>Pi.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return H(t).with({type:ft.Boolean},r=>({...n,type:V.Boolean,decision:y(r.decision,K(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Mn),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ft.Numeric},r=>({...n,type:V.Numeric,decision:y(r.decision,K(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Mn),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ft.Choice},r=>({...n,type:V.Choice,cardinality:r.cardinality,values:y(r.values,z(i=>{const o=y(i.decision,K(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),Mn);return{id:i.choiceValueId,possibleDecisionStates:y(i.possibleDecisionStates,z(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ft.Component},r=>({...n,type:V.Component,decision:y(r.decision,K(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),Mn),possibleDecisionStates:y(r.possibleDecisionStates,z(i=>this.mapToComponentDecisionState(i))),selection:y(r.selection,ye,K(i=>this.mapToSelection(i)),Et),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return H(t).with(Io.Always,()=>xa.Always).with(Io.Optional,()=>xa.Optional).exhaustive()}mapToComponentDecisionState(t){return H(t).with(Zt.Included,()=>Ge.Included).with(Zt.Excluded,()=>Ge.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return H(t).with(Zt.Included,()=>Ye.Included).with(Zt.Excluded,()=>Ye.Excluded).exhaustive()}mapToDecisionKind(t){return H(t).with(kt.Explicit,()=>Se.Explicit).with(kt.Implicit,()=>Se.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return y(t,K(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),Mn)}mapToAllowedRulesInExplain(t){return y(t,K(n=>H(n).returnType().with({type:go.all},()=>({type:hn.all})).with({type:go.none},()=>({type:hn.none})).with({type:go.specific},r=>({type:hn.specific,rules:y(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()),Mn)}},Pk=class{constructor(t,n){this.contractToDomainMapper=new Nk,this.domainToContractMapper=new Aw,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await y(this.sessionHandler.recreate(n),Wt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new Dk(i,this.contractToDomainMapper,this.domainToContractMapper)}),oc(r=>{const i=this.domainToContractMapper.mapToFailureResult(r);return Promise.reject(i)},r=>Promise.resolve(r)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:me,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function $w(e){return e.possibleDecisionStates.some(t=>t===Ye.Included)}function Rk(e){return!$w(e)}function kk(e){return H(e).with({type:V.Choice},t=>t.cardinality.lowerBound>0).with({type:V.Boolean},t=>t.selection===Pi.Mandatory).with({type:V.Numeric},t=>t.selection===Pi.Mandatory).with({type:V.Component},t=>t.inclusion===xa.Optional&&t.selection===Pi.Mandatory).exhaustive()}function Mk(e){return H(e).with({type:V.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function jk(e){return y(e.values,Vt($w))}function _k(e){return y(e.values,Vt(Rk))}function Ow(e,t){return y(e.values,Vo(n=>y(n.decision,ye,Mt(r=>r.kind===t))))}function Dw(e){return y(e.values,Vt(t=>y(t.decision,ye,K(n=>n.state===Ye.Included),Qe(()=>!1))))}const qk=Dw;function Nw(e){return y(e.decision,ye,Mt(t=>t.kind===Se.Explicit),Mn)}function Pw(e){return y(e.decision,ye,Mt(t=>t.kind===Se.Explicit),Mn)}function Fk(e,t){return e.possibleDecisionStates.some(n=>n===t)}function Rw(e){return y(e.decision,ye,Mn)}function kw(e){return Mw(e,Ge.Included)}function Lk(e){return!kw(e)}function Mw(e,t){return e.possibleDecisionStates.some(n=>n===t)}const $n=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:jk,getBlockedChoiceValues:_k,getBooleanDecision:Pw,getChoiceDecisions:Ow,getComponentDecision:Rw,getIncludedChoiceValues:Dw,getNumericDecision:Nw,getSelectedChoiceValues:qk,isBooleanValuePossible:Fk,isComponentAllowed:kw,isComponentBlocked:Lk,isComponentStatePossible:Mw,isMandatory:kk,isMultiSelect:Mk},Symbol.toStringTag,{value:"Module"})),jw=e=>e.type===V.Boolean,_w=e=>e.type===V.Choice,qw=e=>e.type===V.Numeric,Fw=e=>e.type===V.Component,Vk=rR(ot),Cy=Ki(ot);function Lw(e,t){const n=a=>Vk.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return y(n,iP(t?a=>Cy.equals(y(a.componentPath??[],zN(r)),e.componentPath):a=>Cy.equals(a.componentPath??[],e.componentPath)))}function Bk(e,t,n){const r=y(Lw({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:y(t.componentPath??[],JC(t.localId))},n),tw(i=>i.id));return y(e,Vt(r))}function Uk(e,t,n){const r=y(Lw({sharedConfigurationModelId:t,componentPath:[]},n),tw(i=>i.id));return y(e,Vt(r))}function Gk(e){return y(e,Vt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function zk(e,t){return y(Vw(e),z(n=>Ow(n,t)),Ha,Vo(n=>ye(n)))}function Wk(e,t){return y(Uw(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Nw(n)),Vo(n=>ye(n)))}function Hk(e,t){return y(Gw(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Pw(n)),Vo(n=>ye(n)))}function Kk(e,t){return y(Bw(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Rw(n)),Vo(n=>ye(n)))}function Vw(e){return y(e.attributes,Vt(_w))}function Bw(e){return y(e.attributes,Vt(Fw))}function Uw(e){return y(e.attributes,Vt(qw))}function Gw(e){return y(e.attributes,Vt(jw))}function Yk(e,t){return y(Du(e,t),Et)}function Jk(e,t){return y(zw(e,t),Et)}function Xk(e,t,n){return y(zw(e,t),K(r=>r.values),Fn(Ln(Pt(r=>r.id===n))),Et)}function Qk(e,t){return y(Du(e,t),Mt(qw),Et)}function Zk(e,t){return y(Du(e,t),Mt(jw),Et)}function eM(e,t){return y(Du(e,t),Mt(Fw),Et)}function Du(e,t){return y(e.attributes,Pt(n=>Ja.equals(n.id,t)))}function zw(e,t){return y(Du(e,t),Mt(_w))}const Xa=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:Bk,filterAttributesOfRoot:Gk,filterAttributesOfShared:Uk,getAttribute:Yk,getBooleanAttribute:Zk,getBooleanAttributes:Gw,getBooleanDecisions:Hk,getChoiceAttribute:Jk,getChoiceAttributes:Vw,getChoiceDecisions:zk,getChoiceValue:Xk,getComponentAttribute:eM,getComponentAttributes:Bw,getComponentDecisions:Kk,getNumericAttribute:Qk,getNumericAttributes:Uw,getNumericDecisions:Wk},Symbol.toStringTag,{value:"Module"})),tM="https://spc.cloud.ceventis.de/api/engine",nM={hcaEngineBaseUrl:tM};function rM(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??nM.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function vs(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const Ww=e=>t=>n=>y(n,XC(r=>e.equals(r,t)),K(r=>y(n,WN(r,i=>t))),ip,Qe(()=>y(n,Re(YN(t))))),el=Ww({equals:(e,t)=>wn.equals(e.attributeId,t.attributeId)}),iM=Ww({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let oM=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,l,c,f,d;const h=y(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],z(this.restToDomainMapper.mapToGlobalAttributeId)),p=I=>iv(wn)(I,h),v=y(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),g=y(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=y(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=y(((s=n.consequences)==null?void 0:s.componentConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=y(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=y(((l=n.consequences)==null?void 0:l.numericConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=y(((c=n.affectedDecisions)==null?void 0:c.booleanDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=y(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=y([],Re(y(T,z(I=>I.attributeId))),Re(y(E,z(I=>I.attributeId))),Re(y(b,z(I=>I.attributeId))),Re(y(x,z(I=>I.attributeId))),Re(y(v,z(I=>I.attributeId))),Re(y(g,z(I=>I.attributeId))),Re(y(C,z(I=>I.attributeId))),Re(y(m,z(I=>I.attributeId))),fa(wn)),N=y(A,tp(t.attributes,(I,P)=>{const _=t.attributes.find(L=>wn.equals(L.attributeId,P));return H(_).with({type:ft.Choice},(L,U)=>{const Y=this.mergeChoice(U,y(g,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(v,Vt(k=>wn.equals(k.attributeId,P)),z(k=>k.payload)));return el(Y)(I)}).with({type:ft.Numeric},(L,U)=>{const Y=this.mergeNumeric(U,y(x,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(b,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return el(Y)(I)}).with({type:ft.Boolean},(L,U)=>{const Y=this.mergeBoolean(U,y(E,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(T,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return el(Y)(I)}).with({type:ft.Component},(L,U)=>{const Y=this.mergeComponent(U,y(m,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(C,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return el(Y)(I)}).exhaustive()}),z(I=>{const P=p(I.attributeId);return I.canContributeToConfigurationSatisfaction!=P?{...I,canContributeToConfigurationSatisfaction:P}:I}));return{...t,isSatisfied:y((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,ye,Qe(()=>t.isSatisfied)),attributes:N}}mergeChoice(t,n,r){const i=y(n,K(u=>u.values??[]),Qe(()=>[])),o=y(r),a=y([],Re(y(i,z(u=>u.choiceValueId))),Re(y(o,z(u=>u.choiceValueId))),z(vs),fa(ot)),s=y(a,tp(t.values,(u,l)=>{const c=y(i,Pt(p=>p.choiceValueId===l)),f=y(o,Pt(p=>p.choiceValueId===l)),d=y(t.values.find(p=>p.choiceValueId===l),ye),h=this.mergeChoiceValue(l,d,c,f);return iM(h)(u)}));return{...t,isSatisfied:y(n,K(u=>vs(u.isSatisfied)),Qe(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=y(i,K(s=>({state:this.toDecisionState(vs(s.state)),kind:this.toDecisionKind(vs(s.kind))})),Qe(()=>({state:y(n,Fn(s=>y(s.decision,K(u=>u.state)))),kind:y(n,Fn(s=>y(s.decision,K(u=>u.kind))),Qe(()=>kt.Explicit))}))),a=y(r,K(s=>y(ly(s.possibleDecisionStates??[]),z(u=>this.toPossibleDecisionState(u)),qn)),Qe(()=>y(n,K(s=>s.possibleDecisionStates??[]),Qe(()=>[]))));return{choiceValueId:t,decision:y(o.state,K(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=y(r,K(a=>{const s=this.toDecisionState(vs(a.state));return y(s,K(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),Qe(()=>y(t.decision,K(a=>({state:a.state,kind:a.kind}))))),o=y(n,K(a=>y(ly(a.possibleDecisionStates??[]),z(s=>this.toPossibleDecisionState(s)),qn)),Qe(()=>t.possibleDecisionStates));return{...t,isSatisfied:y(n,K(a=>a.isSatisfied),Qe(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:y(n,Fn(i=>ye(i.isSatisfied)),Qe(()=>t.isSatisfied)),decision:y(r,Zr(()=>t.decision,i=>y(i.state,ye,K(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:y(n,Fn(i=>ye(i.isSatisfied)),Qe(()=>t.isSatisfied)),decision:y(r,Zr(()=>t.decision,i=>y(i.state,ye,K(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:y(n,K(i=>i.possibleDecisionStates),Qe(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return H(t).with(Ao.Included,()=>De(Zt.Included)).with(Ao.Excluded,()=>De(Zt.Excluded)).otherwise(()=>me)}toDecisionState(t){return H(t).with(Kr.Included,()=>De(Zt.Included)).with(Kr.Excluded,()=>De(Zt.Excluded)).otherwise(()=>me)}toDecisionKind(t){return H(t).with(ou.Implicit,()=>kt.Implicit).with(ou.Explicit,()=>kt.Explicit).exhaustive()}},aM=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return H(t).with({type:Ie.ChoiceValue},n=>({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ie.Component},n=>({type:Gn.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ie.Numeric},n=>({type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).with({type:Ie.Boolean},n=>({type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=y([...t],vi(u=>u.type!==Ie.Boolean?me:De({type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:y(u.value,Et)}))),o=y([...t],vi(u=>u.type!==Ie.Numeric?me:De({type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:y(u.value,Et)}))),a=y([...t],vi(u=>u.type!==Ie.ChoiceValue?me:De({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=y([...t],vi(u=>u.type!==Ie.Component?me:De({type:Gn.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=y([...t],vi(a=>a.type!==ft.Boolean?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitBooleanDecision(a))))),r=y([...t],vi(a=>a.type!==ft.Numeric?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitNumericDecision(a))))),i=y([...t],vi(a=>a.type!==ft.Component?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitComponentDecision(a))))),o=y([...t],vi(a=>a.type!==ft.Choice?me:y(this.mapToExplicitChoiceDecisions(a),Ou(s=>y(s,Wa)))),tP);return{booleanDecisions:n,numericDecisions:r,choiceDecisions:o,componentDecisions:i}}mapToMode(t){return H(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:y(t.componentPath,ye,K(np),Mn),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:H(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:qe.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:y(t.decision,K(n=>n.state),Et)}}mapToExplicitNumericDecision(t){return{type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:y(t.decision,K(n=>n.state),Et)}}mapToExplicitComponentDecision(t){return{type:Gn.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(y(t.decision,K(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return y(r.decision,K(i=>i.kind===kt.Explicit),Qe(()=>!1))}return y(t.values,Vt(n),z(r=>({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(y(r.decision,K(i=>i.state)))})),np)}mapToDecisionState(t){return y(t,K(n=>H(n).with(Zt.Included,()=>Kr.Included).with(Zt.Excluded,()=>Kr.Excluded).exhaustive()),Qe(()=>Kr.Undefined))}mapToPossibleDecisionState(t){return H(t).with(Zt.Included,()=>Ao.Included).with(Zt.Excluded,()=>Ao.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return H(t).with({subject:vn.attribute},n=>({type:vp.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:vn.configuration},()=>({type:vp.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return H(t).with({subject:vn.boolean},n=>({type:Es.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:vn.numeric},n=>({type:Es.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:vn.component},n=>({type:Es.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:vn.choiceValue},n=>({type:Es.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},sM=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return y(t.configuration.attributes,Pt(n=>H(n).with({type:ft.Boolean},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ii)).with({type:ft.Numeric},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ii)).with({type:ft.Choice},r=>y(r.values,Pt(i=>y(i.decision,K(o=>o.kind===kt.Explicit),Qe(()=>!1))),Ii)).with({type:ft.Component},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ii)).exhaustive()),Zr(()=>!1,()=>!0))},getExplicitDecisions(t){return y(t.configuration.attributes,z(n=>H(n).with({type:ft.Boolean},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Boolean,attributeId:r.attributeId,value:ye(i.state)})),K(i=>[i]))).with({type:ft.Numeric},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Numeric,attributeId:r.attributeId,value:ye(i.state)})),K(i=>[i]))).with({type:ft.Choice},r=>y(r.values,z(i=>y(i.decision,Mt(o=>o.kind===kt.Explicit),K(o=>({type:Ie.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:ye(o.state)})))),qn,Di)).with({type:ft.Component},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Component,attributeId:r.attributeId,state:ye(i.state)})),K(i=>[i]))).exhaustive()),qn,Ha)}}}},uM=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 sM}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)=>y(this.engineApiClient.makeDecision(i,r),br(Gr),Wt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=H(t).with({question:Yn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Yn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return y(i,br(Gr),Wt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return y(a,yr(s=>{var u,l,c,f;return y([],Re(y(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],z(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Re(y(((l=s.rejectedDecisions)==null?void 0:l.numericDecisions)??[],z(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Re(y(((c=s.rejectedDecisions)==null?void 0:c.componentDecisions)??[],z(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Re(y(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],z(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),da(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 y(i,Wt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return y(o,br(Gr),yr(a=>{const s={rejectedDecisions:{booleanDecisions:qe.array(qe.any)}},u={decisionExplanations:qe.array(qe.any)};return H(a).with(s,l=>Ka(l)).with(u,l=>Ni(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(l,i,n))).otherwise(()=>Ni({type:xe.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 y(da(t),yr(r=>y(r.sessionId,Zr(()=>this.initializeInner(r,!1),()=>da(r)))),yr(r=>y(r.sessionId,lv(()=>({type:xe.ConfigurationUnauthenticated})),yr(i=>n(i,r)))))}initializeInner(t,n){return y(FP,()=>y(t.sessionId,YP,QP(s=>n?KP(s):y(this.sessionHandler.close(s),oc(()=>me,()=>me)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return y(s,DP(()=>({type:xe.ConfigurationUnauthenticated})),uw(()=>this.sessionHandler.create(u)))},s=>y(s,LP(u=>y(Di(t),Mt(this.interpreter.configurationSession.hasExplicitDecisions),K(l=>this.replaceDecisions(u,l)),Qe(()=>da({}))))),s=>y(s,yr(u=>{const l=this.determineConsequences(u),c=this.determineDecisions(u),f=eN(RP)({consequences:l,decisions:c});return y(f,Wt(({decisions:d,consequences:h})=>this.restToDomainMapper.mapToConfigurationModel(d,h)),Wt(d=>({sessionId:Di(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return y(this.engineApiClient.getDecisions(t),br(Gr))}determineConsequences(t){return y(this.engineApiClient.getConsequence(t),br(Gr))}},lM=class{constructor(t,n){this.onConfigurationChangedHandler=me,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return y(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return y(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:me}}restoreConfiguration(t){return y(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return y(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return y(this.configurationSession.sessionId,K(t=>this.sessionHandler.close(t)),K(Ln(Wt(t=>{this.configurationSession={...this.configurationSession,sessionId:me}}))),Qe(Ba(sk())))}applySolution(t){return y(this.configurationSession.solutions,Pt(n=>gk.equals(n,t)),lv(()=>({type:xe.ConfigurationSolutionNotAvailable})),Wt(n=>n.decisions),yr(n=>this.setMany(n,t.mode)))}setMany(t,n){return y(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),Zs(r=>()=>{const i=H(r).with({decisionExplanations:qe.array(qe.any)},o=>De(o.decisionExplanations)).otherwise(()=>me);this.configurationSession={...this.configurationSession,solutions:y(i,K(Ln(z(o=>o.solution))),Qe(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=H(t).with({decisionExplanations:qe.array(qe.any)},r=>r.decisionExplanations).otherwise(()=>[]);return y(n,z(r=>r.solution))}invalidateAvailableSolutions(){return BP(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Zs(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Qs(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Ln(Qs(t=>()=>{this.configurationSession=t,y(this.onConfigurationChangedHandler,GP(n=>()=>n(this.configurationSession.configuration)))}),Wt(t=>t.configuration),this.invalidateAvailableSolutions())}},cM=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=zR(r,UR.concat(WR(i),GR(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Ko(this.policy,r,i=>y(i,ao(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return H(t).with({type:xe.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:xe.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},fM=class{constructor(){this.queue=[],this.operating=me}push(t){const n=new dM(t);return this.queue.push(n),this.operating=y(this.operating,Qe(()=>this.start()),Di),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=y(t,z(r=>r.argument),tp(me,(r,i)=>this.reduce(r,i)),K(Ln(r=>this.execute(r),r=>r.then(i=>{y(t,z(o=>{o.resolve(i)}))}).catch(i=>{y(t,z(o=>{o.reject(i)}))}))),Et);n&&await n}this.operating=me}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},dM=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},pM=class extends fM{constructor(t){super(),this.inner=t}reduce(t,n){return De(n)}async execute(t){return await this.inner.setSessionContext(t)()}},hM=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new pM(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(fk.equals(n,t))return Ka(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)}},vM=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)),y(r(),Zs(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Qs(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)}};class yv{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+hv()}static new(t){return new yv(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 mM(e){e=rM(e);const t=new $k(e.hcaEngineBaseUrl),n=new Ew,r=new aM,i=new Aw,o=new ok,a=new oM(n),s=H(e.sessionHandler).with({create:qe.any,close:qe.any},c=>c).with({accessToken:qe.string},c=>new Ak(t,o,n,c)).with({sessionCreateUrl:qe.string,sessionDeleteUrl:qe.string},c=>new Ok(o,c)).exhaustive(),u=new uM(s,t,n,r,i,a),l=(c,f)=>y(new lM(c,f),d=>new cM(d),d=>new hM(d),yv.new,d=>new vM(d,!1));return new Pk(u,l)}const Nu=Ja.equals,yM=Cw.equals;ZR.equals;function lf(e){return An((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}/*! *****************************************************************************
|
|
70
|
+
${JSON.stringify(e,null,2)}`)}var js=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(js||{}),Ew=(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))(Ew||{});const Ek=e=>Object.values(Ew).includes(e),Ik=e=>Ek(e)?De(e):me;function Ak(e){const t=n=>H(n).with("ConfigurationModelNotFound",()=>({type:xe.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:xe.DecisionsToRespectInvalid})).with(qe.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:xe.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:xe.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:xe.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:xe.ConfigurationConflict,reason:vv.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:xe.ConfigurationConflict})).with(qe.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:xe.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:xe.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:xe.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:xe.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:xe.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return y(e.type,Ik,K(t))}const $k=e=>Object.values(js).includes(e),Ok=e=>$k(e)?De(e):me;function Dk(e){return y(e,Ok,K(n=>H(n).with("Generic::LocalClientError",()=>({type:xe.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:xe.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:xe.CommunicationError})).with("Generic::Unauthorized",()=>({type:xe.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:xe.Unknown})).exhaustive()))}function zr(e,t){Tk(e,t);const n=e.type;return y(me,rp(()=>Ak(e)),rp(()=>Dk(n)),Qe(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:xe.Unknown})))}let Nk=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 y(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),Sr(r=>zr(r,"ClientSideSessionLifetimeHandler - create")),gr(r=>this.restToDomainMapper.mapToSessionId(r)),ck(()=>({type:xe.ConfigurationUnauthenticated})))}close(t){return y(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),Sr(n=>zr(n,"ClientSideSessionLifetimeHandler - close")),Ht(()=>Gr()))}};var Iw=(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))(Iw||{});function Lr(e,t,n){const r=y(Array.isArray(e)?e:[e],WR);return y(fy(()=>fetch(r,t),i=>({type:"error"})),gr(i=>y(fy(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),cw(i=>i.status===401?Ni({type:js.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?Ka({response:i,data:{}}):i.type==="error"?Ni({type:js.LowLevelCommunicationError}):Ni({type:js.UnhandledResponseStatus})),gr(i=>y(n(i),uv(()=>i.data))))}function fp(e,t){return Lr(e,t,n=>{if(n.response.status===200)return Di(n.data);if(n.response.status===409){const r=n.data;return H(r).with({type:"ConfigurationModelInvalid"},i=>Di(r)).with({type:"ConfigurationModelNotFeasible"},i=>Di(r)).otherwise(()=>me)}return me})}let Pk=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 fp([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 fp([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 Lr([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?De(i.data):me)}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 Lr([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?De(i.data):me)}getDecisions(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Lr([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?De(r.data):me)}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 Lr([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?De(i.data):me)}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 Lr([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?De(i.data):me)}getConsequence(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Lr([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?De(r.data):me)}deleteSessionUsingJwtBearer(t,n){const r={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return Lr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?De({}):me)}};var Ao=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ao||{}),dp=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(dp||{}),pp=(e=>(e.Always="Always",e.Optional="Optional",e))(pp||{}),ou=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(ou||{}),Yr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Yr||{}),Gn=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(Gn||{}),hp=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(hp||{}),vp=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(vp||{}),Es=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Es||{});const Bn=Sn({localId:ot,componentPath:uf(ot),sharedConfigurationModelId:hv(ot)});let Aw=class{mapToDecisions(t){return{}}mapToSessionId(t){return H(t).with({sessionId:qe.string},n=>Ka(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=y(n.constraintExplanations,z(i=>this.mapToConstraintExplanation(i)));return Ni({type:xe.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Ni({type:xe.ConfigurationModelInvalid})).otherwise(()=>Ni({type:xe.Unknown}))}mapToExplainAnswer(t,n){const r=H(n).with({question:Yn.whyIsStateNotPossible,subject:mn.boolean},a=>[{type:Ie.Boolean,attributeId:a.attributeId,value:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:mn.numeric},a=>[{type:Ie.Numeric,attributeId:a.attributeId,value:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:mn.component},a=>[{type:Ie.Component,attributeId:a.attributeId,state:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:mn.choiceValue},a=>[{type:Ie.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:De(a.state)}]).otherwise(()=>[]),i=y(t.decisionExplanations,z(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=y(t.constraintExplanations,z(a=>this.mapToConstraintExplanation(a)));return H(n).with({answerType:yo.decisions},()=>({decisionExplanations:i})).with({answerType:yo.constraints},()=>({constraintExplanations:o})).with({answerType:yo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:xe.ConfigurationSetManyConflict,decisionExplanations:y(t.decisionExplanations,z(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:y(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 y(this.mapToDecisionState(t.state),K(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:y(t.causedByRules,z(n=>this.mapToRuleConstraint(n))),causedByCardinalities:y(t.causedByCardinalities,z(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:ba.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:ba.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=y(t.booleanDecisions??[],z(a=>({type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),r=y(t.numericDecisions??[],z(a=>({type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),i=y(t.componentDecisions??[],z(a=>({type:Ie.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:y(ye(a.state),K(s=>this.mapToDecisionState(s)),ip)}))),o=y(t.choiceDecisions??[],z(a=>({type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:y(ye(a.state),K(s=>this.mapToDecisionState(s)),ip)})));return y([],Re(n),Re(r),Re(i),Re(o))}mapToDecisionExplanation(t,n,r){const i=y(t.causedByBooleanDecisions,z(p=>this.mapToCausedByBooleanDecision(p))),o=y(t.causedByNumericDecisions,z(p=>this.mapToCausedByNumericDecision(p))),a=y(t.causedByComponentDecisions,z(p=>this.mapToCausedByComponentDecision(p))),s=y(t.causedByChoiceDecisions,z(p=>this.mapToCausedByChoiceValueDecision(p))),u=y(i,z(p=>({type:Ie.Boolean,attributeId:p.attributeId,value:me}))),l=y(o,z(p=>({type:Ie.Numeric,attributeId:p.attributeId,value:me}))),c=y(a,z(p=>({type:Ie.Component,attributeId:p.attributeId,state:me}))),f=y(s,z(p=>({type:Ie.ChoiceValue,attributeId:p.attributeId,choiceValueId:p.choiceValueId,state:me}))),d=y([],Re(u),Re(l),Re(c),Re(f)),h=ew(An((p,v)=>{const g=wn.equals(p.attributeId,v.attributeId);return H({a:p,b:v}).with({a:{type:Ie.ChoiceValue},b:{type:Ie.ChoiceValue}},C=>g&&C.a.choiceValueId===C.b.choiceValueId).otherwise(()=>g)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:y([],Re(d),Re(h)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return H(t).with(hp.NotAvailable,()=>cp.NotAvailable).with(hp.StateNotPossible,()=>cp.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 y(n.canAttributeContributeToConfigurationSatisfaction,Pt(h=>Bn.equals(h,d)),Ii)}const i=y([],Re(y(t.choiceValueDecisions,z(d=>d.attributeId))),Re(y(n.choiceConsequences,z(d=>d.attributeId))),fa(Bn)),o=y(i,z(d=>{const h=y(t.choiceValueDecisions??[],sP(v=>Bn.equals(v.attributeId,d))),p=y(n.choiceConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToChoiceAttributes(v,h,r(d))))}),qn),a=y([],Re(y(t.numericDecisions,z(d=>d.attributeId))),Re(y(n.numericConsequences,z(d=>d.attributeId))),fa(Bn)),s=y(a,z(d=>{const h=y(t.numericDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.numericConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToNumericAttribute(v,h,r(d))))}),qn),u=y([],Re(y(t.booleanDecisions,z(d=>d.attributeId))),Re(y(n.booleanConsequences,z(d=>d.attributeId))),fa(Bn)),l=y(u,z(d=>{const h=y(t.booleanDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.booleanConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToBooleanAttribute(v,h,r(d))))}),qn),c=y([],Re(y(t.componentDecisions,z(d=>d.attributeId))),Re(y(n.componentConsequences,z(d=>d.attributeId))),fa(Bn)),f=y(c,z(d=>{const h=y(t.componentDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.componentConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToComponentAttribute(v,h,r(d))))}),qn);return y([],Re(o),Re(f),Re(s),Re(l))}mapToComponentAttribute(t,n,r){return{type:ft.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:y(t.possibleDecisionStates,Dl(i=>this.mapToPossibleDecisionState(i))),decision:y(n,Fn(i=>y(this.mapToDecisionState(i.state),K(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:y(t.selection,ye,K(i=>this.mapToSelection(i)),Et),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=y(t.values,Dl(o=>{const a=y(n,Pt(s=>s.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:ft.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(t,n,r){return{type:ft.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:y(n,Fn(i=>y(i.state,ye,K(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(t,n,r){return{type:ft.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:y(n,Fn(i=>y(i.state,ye,K(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=y(t.possibleDecisionStates,Dl(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:y(n,Fn(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return H(t).with(ou.Implicit,()=>kt.Implicit).with(ou.Explicit,()=>kt.Explicit).exhaustive()}mapToDecisionState(t){return H(t).with(Yr.Included,()=>De(Zt.Included)).with(Yr.Excluded,()=>De(Zt.Excluded)).with(Yr.Undefined,()=>me).exhaustive()}mapToPossibleDecisionState(t){return H(t).with(Ao.Included,()=>Zt.Included).with(Ao.Excluded,()=>Zt.Excluded).exhaustive()}mapToSelection(t){return H(t).with(dp.Mandatory,()=>Eo.Mandatory).with(dp.Optional,()=>Eo.Optional).exhaustive()}mapToInclusion(t){return H(t).with(pp.Always,()=>Io.Always).with(pp.Optional,()=>Io.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},Rk=class{constructor(t,n){this.restToDomainMapper=new Aw,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=fp(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return y(r,Sr(i=>zr(i,"ServerSideSessionLifetimeHandler - create")),gr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return y(Lr(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===Iw.NoContent?De({}):me),Sr(n=>zr(n,"ServerSideSessionLifetimeHandler - close")),Ht(Gr))}};const $w={whyIsNotSatisfied:{configuration:{question:Ft.whyIsNotSatisfied,subject:Ue.configuration},attribute:e=>({question:Ft.whyIsNotSatisfied,subject:Ue.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:Ft.whyIsStateNotPossible,subject:Ue.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.component,attributeId:e,state:t})})}};let kk=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=me}setOnConfigurationChangedHandler(t){const n=y(t,ye,K(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 y(this.inner.setSessionContext(n),Ht(Gr),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await y(this.inner.restoreConfiguration(n),Ht(Gr),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await y(this.inner.makeDecision(n),Ht(Gr),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await y(this.inner.setMany(r,i),Ht(Gr),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await y(this.inner.applySolution(n),Ht(Gr),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t($w):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await y(this.inner.explain(i),Ht(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await y(this.inner.close(),Sr(t=>this.domainToContractMapper.mapToFailureResult(t)),oc(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Ln(Sr(t=>this.domainToContractMapper.mapToFailureResult(t)),oc(t=>Promise.reject(t),t=>Promise.resolve(t)))}},Mk=class{mapToExplainQuestion(t,n){const r={answerType:H(n).with("decisions",()=>yo.decisions).with("constraints",()=>yo.constraints).with("full",()=>yo.all).exhaustive()};return H(t).with({question:Ft.whyIsNotSatisfied,subject:Ue.configuration},i=>({...r,question:Yn.whyIsNotSatisfied,subject:mn.configuration})).with({question:Ft.whyIsNotSatisfied,subject:Ue.attribute},i=>({...r,question:Yn.whyIsNotSatisfied,subject:mn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.choiceValue},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.component},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.numeric},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:Ft.whyIsStateNotPossible,subject:Ue.boolean},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:y(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return y(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 H(t).with({type:V.Choice,choiceValueId:qe.string},n=>({type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:V.Numeric},n=>({type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:V.Boolean},n=>({type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:V.Component},n=>({type:Ie.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(ye(n.state),Fn(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return y(ye(t),K(n=>y(n,z(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:y(r.decisions,z(i=>this.mapToGlobalAttributeId(i)))})))))}mapToMode(t){return H(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 H(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 H(t).with({type:Li.Package},n=>({type:iu.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Li.Channel},n=>({type:iu.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:y(t.decisions,z(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return H(t).with({type:V.Boolean},n=>({type:ft.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:y(n.decision,ye,K(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Numeric},n=>({type:ft.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:y(n.decision,ye,K(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Choice},n=>({type:ft.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:y(n.values,z(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Component},n=>({type:ft.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:y(n.decision,ye,Fn(r=>y(this.mapToDecisionStateOption(r.state),K(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:y(n.possibleDecisionStates,z(r=>this.mapToDecisionStateOption(r)),qn),selection:y(n.selection,ye,K(r=>this.mapToSelection(r)),Et),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:y(t.possibleDecisionStates,z(n=>this.mapToDecisionStateOption(n)),qn)}}mapToChoiceValueDecision(t){return y(t.decision,ye,Fn(n=>y(this.mapToDecisionStateOption(n.state),K(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return H(t).with(Se.Implicit,()=>kt.Implicit).with(Se.Explicit,()=>kt.Explicit).exhaustive()}mapToSelection(t){return H(t).with(Pi.Mandatory,()=>Eo.Mandatory).with(Pi.Optional,()=>Eo.Optional).exhaustive()}mapToInclusion(t){return H(t).with(xa.Always,()=>Io.Always).with(xa.Optional,()=>Io.Optional).exhaustive()}mapToDecisionState(t){return H(t).with(qe.union(Ye.Included,Ge.Included),()=>Zt.Included).with(qe.union(Ye.Excluded,Ge.Excluded),()=>Zt.Excluded).exhaustive()}mapToDecisionStateOption(t){return y(ye(t),K(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return y(t,ye,K(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return y(t,ye,K(n=>H(n).returnType().with({type:vn.all},()=>({type:go.all})).with({type:vn.none},()=>({type:go.none})).with({type:vn.specific},r=>({type:go.specific,rules:y(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()))}},Ow=class{mapToExplainAnswer(t){const n=H(t).with({decisionExplanations:qe.array(qe.any)},i=>y(i.decisionExplanations,z(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=H(t).with({constraintExplanations:qe.array(qe.any)},i=>y(i.constraintExplanations,z(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:y(t.causedByCardinalities,z(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:y(t.causedByRules,z(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=y(t.causedByChoiceDecisions,z(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=y(t.causedByComponentDecisions,z(a=>this.mapToCausedByComponentAttributeDecision(a))),i=y(t.causedByNumericDecisions,z(a=>this.mapToCausedByNumericAttributeDecision(a))),o=y(t.causedByBooleanDecisions,z(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:y([],Re(n),Re(r),Re(i),Re(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:y(t.decisions,z(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return H(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return H(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 H(t).with({type:xe.ConfigurationConflict},n=>({type:pt.ConfigurationConflict,reason:H(n.reason).with(vv.NumericDecisionOutOfRange,()=>Tw.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:xe.ConfigurationApplicationError},()=>({type:pt.ConfigurationApplicationError})).with({type:xe.ConfigurationUnauthenticated},()=>({type:pt.ConfigurationUnauthenticated})).with({type:xe.ConfigurationModelNotFound},()=>({type:pt.ConfigurationModelNotFound})).with({type:xe.ConfigurationTimeout},()=>({type:pt.ConfigurationTimeout})).with({type:xe.ConfigurationAttributeNotFound},()=>({type:pt.ConfigurationAttributeNotFound})).with({type:xe.ConfigurationChoiceValueNotFound},()=>({type:pt.ConfigurationChoiceValueNotFound})).with({type:xe.ConfigurationSolutionNotAvailable},()=>({type:pt.ConfigurationSolutionNotAvailable})).with({type:xe.ConfigurationRejectedDecisionsConflict},n=>{const r=y(n.rejectedDecisions,z(i=>this.mapToExplicitDecision(i)));return uk.createConfigurationRejectedDecisionsConflict(r)}).with({type:xe.DecisionsToRespectInvalid},()=>({type:pt.DecisionsToRespectInvalid})).with({type:xe.ServiceError},()=>({type:pt.ServiceError})).with({type:xe.CommunicationError},()=>({type:pt.CommunicationError})).with({type:xe.Unknown},()=>({type:pt.Unknown})).with({type:xe.ConfigurationModelInvalid},()=>({type:pt.ConfigurationModelInvalid})).with({type:xe.ConfigurationInitializationFailure},()=>({type:pt.ConfigurationInitializationFailure})).with({type:xe.ConfigurationModelNotFeasible},n=>({type:pt.ConfigurationModelNotFeasible,constraintExplanations:y(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:xe.ConfigurationSetManyConflict},n=>({type:pt.ConfigurationSetManyConflict,decisionExplanations:y(n.decisionExplanations,z(r=>this.mapToDecisionExplanation(r))),constraintExplanations:y(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:xe.SpecifiedDeploymentForbidden},n=>({type:pt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:y(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return y(t,K(Ln(z(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:y(n.decisions,z(r=>this.mapToGlobalAttributeId(r)))})))),Mn)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return H(t).with({type:iu.Package},n=>({type:Li.Package,configurationModelPackage:n.configurationModelPackage})).with({type:iu.Channel},n=>({type:Li.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return H(t).with({type:Ie.ChoiceValue},n=>({type:V.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.state,K(r=>this.mapToChoiceValueDecisionState(r)),Et),choiceValueId:n.choiceValueId})).with({type:Ie.Component},n=>({type:V.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.state,K(r=>this.mapToComponentDecisionState(r)),Et)})).with({type:Ie.Numeric},n=>({type:V.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).with({type:Ie.Boolean},n=>({type:V.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).exhaustive()}mapToCardinality(t){return H(t).with(ba.Cardinality,()=>Pl.Cardinality).with(ba.Component,()=>Pl.Component).with(ba.Rule,()=>Pl.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return H(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:V.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:V.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:V.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:V.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return H(t).with(Eo.Mandatory,()=>Pi.Mandatory).with(Eo.Optional,()=>Pi.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return H(t).with({type:ft.Boolean},r=>({...n,type:V.Boolean,decision:y(r.decision,K(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Mn),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ft.Numeric},r=>({...n,type:V.Numeric,decision:y(r.decision,K(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Mn),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ft.Choice},r=>({...n,type:V.Choice,cardinality:r.cardinality,values:y(r.values,z(i=>{const o=y(i.decision,K(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),Mn);return{id:i.choiceValueId,possibleDecisionStates:y(i.possibleDecisionStates,z(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ft.Component},r=>({...n,type:V.Component,decision:y(r.decision,K(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),Mn),possibleDecisionStates:y(r.possibleDecisionStates,z(i=>this.mapToComponentDecisionState(i))),selection:y(r.selection,ye,K(i=>this.mapToSelection(i)),Et),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return H(t).with(Io.Always,()=>xa.Always).with(Io.Optional,()=>xa.Optional).exhaustive()}mapToComponentDecisionState(t){return H(t).with(Zt.Included,()=>Ge.Included).with(Zt.Excluded,()=>Ge.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return H(t).with(Zt.Included,()=>Ye.Included).with(Zt.Excluded,()=>Ye.Excluded).exhaustive()}mapToDecisionKind(t){return H(t).with(kt.Explicit,()=>Se.Explicit).with(kt.Implicit,()=>Se.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return y(t,K(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),Mn)}mapToAllowedRulesInExplain(t){return y(t,K(n=>H(n).returnType().with({type:go.all},()=>({type:vn.all})).with({type:go.none},()=>({type:vn.none})).with({type:go.specific},r=>({type:vn.specific,rules:y(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()),Mn)}},jk=class{constructor(t,n){this.contractToDomainMapper=new Mk,this.domainToContractMapper=new Ow,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await y(this.sessionHandler.recreate(n),Ht(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new kk(i,this.contractToDomainMapper,this.domainToContractMapper)}),oc(r=>{const i=this.domainToContractMapper.mapToFailureResult(r);return Promise.reject(i)},r=>Promise.resolve(r)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:me,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function Dw(e){return e.possibleDecisionStates.some(t=>t===Ye.Included)}function _k(e){return!Dw(e)}function qk(e){return H(e).with({type:V.Choice},t=>t.cardinality.lowerBound>0).with({type:V.Boolean},t=>t.selection===Pi.Mandatory).with({type:V.Numeric},t=>t.selection===Pi.Mandatory).with({type:V.Component},t=>t.inclusion===xa.Optional&&t.selection===Pi.Mandatory).exhaustive()}function Fk(e){return H(e).with({type:V.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function Lk(e){return y(e.values,Vt(Dw))}function Vk(e){return y(e.values,Vt(_k))}function Nw(e,t){return y(e.values,Vo(n=>y(n.decision,ye,Mt(r=>r.kind===t))))}function Pw(e){return y(e.values,Vt(t=>y(t.decision,ye,K(n=>n.state===Ye.Included),Qe(()=>!1))))}const Bk=Pw;function Rw(e){return y(e.decision,ye,Mt(t=>t.kind===Se.Explicit),Mn)}function kw(e){return y(e.decision,ye,Mt(t=>t.kind===Se.Explicit),Mn)}function Uk(e,t){return e.possibleDecisionStates.some(n=>n===t)}function Mw(e){return y(e.decision,ye,Mn)}function jw(e){return _w(e,Ge.Included)}function Gk(e){return!jw(e)}function _w(e,t){return e.possibleDecisionStates.some(n=>n===t)}const $n=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:Lk,getBlockedChoiceValues:Vk,getBooleanDecision:kw,getChoiceDecisions:Nw,getComponentDecision:Mw,getIncludedChoiceValues:Pw,getNumericDecision:Rw,getSelectedChoiceValues:Bk,isBooleanValuePossible:Uk,isComponentAllowed:jw,isComponentBlocked:Gk,isComponentStatePossible:_w,isMandatory:qk,isMultiSelect:Fk},Symbol.toStringTag,{value:"Module"})),qw=e=>e.type===V.Boolean,Fw=e=>e.type===V.Choice,Lw=e=>e.type===V.Numeric,Vw=e=>e.type===V.Component,zk=sR(ot),wy=Ki(ot);function Bw(e,t){const n=a=>zk.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return y(n,uP(t?a=>wy.equals(y(a.componentPath??[],Y2(r)),e.componentPath):a=>wy.equals(a.componentPath??[],e.componentPath)))}function Wk(e,t,n){const r=y(Bw({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:y(t.componentPath??[],QC(t.localId))},n),rw(i=>i.id));return y(e,Vt(r))}function Hk(e,t,n){const r=y(Bw({sharedConfigurationModelId:t,componentPath:[]},n),rw(i=>i.id));return y(e,Vt(r))}function Kk(e){return y(e,Vt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function Yk(e,t){return y(Uw(e),z(n=>Nw(n,t)),Ha,Vo(n=>ye(n)))}function Jk(e,t){return y(zw(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Rw(n)),Vo(n=>ye(n)))}function Xk(e,t){return y(Ww(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>kw(n)),Vo(n=>ye(n)))}function Qk(e,t){return y(Gw(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Mw(n)),Vo(n=>ye(n)))}function Uw(e){return y(e.attributes,Vt(Fw))}function Gw(e){return y(e.attributes,Vt(Vw))}function zw(e){return y(e.attributes,Vt(Lw))}function Ww(e){return y(e.attributes,Vt(qw))}function Zk(e,t){return y(Du(e,t),Et)}function eM(e,t){return y(Hw(e,t),Et)}function tM(e,t,n){return y(Hw(e,t),K(r=>r.values),Fn(Ln(Pt(r=>r.id===n))),Et)}function nM(e,t){return y(Du(e,t),Mt(Lw),Et)}function rM(e,t){return y(Du(e,t),Mt(qw),Et)}function iM(e,t){return y(Du(e,t),Mt(Vw),Et)}function Du(e,t){return y(e.attributes,Pt(n=>Ja.equals(n.id,t)))}function Hw(e,t){return y(Du(e,t),Mt(Fw))}const Xa=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:Wk,filterAttributesOfRoot:Kk,filterAttributesOfShared:Hk,getAttribute:Zk,getBooleanAttribute:rM,getBooleanAttributes:Ww,getBooleanDecisions:Xk,getChoiceAttribute:eM,getChoiceAttributes:Uw,getChoiceDecisions:Yk,getChoiceValue:tM,getComponentAttribute:iM,getComponentAttributes:Gw,getComponentDecisions:Qk,getNumericAttribute:nM,getNumericAttributes:zw,getNumericDecisions:Jk},Symbol.toStringTag,{value:"Module"})),oM="https://spc.cloud.ceventis.de/api/engine",aM={hcaEngineBaseUrl:oM};function sM(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??aM.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function vs(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const Kw=e=>t=>n=>y(n,ZC(r=>e.equals(r,t)),K(r=>y(n,J2(r,i=>t))),ip,Qe(()=>y(n,Re(Z2(t))))),el=Kw({equals:(e,t)=>wn.equals(e.attributeId,t.attributeId)}),uM=Kw({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let lM=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,l,c,f,d;const h=y(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],z(this.restToDomainMapper.mapToGlobalAttributeId)),p=I=>rv(wn)(I,h),v=y(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),g=y(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=y(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=y(((s=n.consequences)==null?void 0:s.componentConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=y(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=y(((l=n.consequences)==null?void 0:l.numericConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=y(((c=n.affectedDecisions)==null?void 0:c.booleanDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=y(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=y([],Re(y(T,z(I=>I.attributeId))),Re(y(E,z(I=>I.attributeId))),Re(y(b,z(I=>I.attributeId))),Re(y(x,z(I=>I.attributeId))),Re(y(v,z(I=>I.attributeId))),Re(y(g,z(I=>I.attributeId))),Re(y(C,z(I=>I.attributeId))),Re(y(m,z(I=>I.attributeId))),fa(wn)),N=y(A,tp(t.attributes,(I,P)=>{const _=t.attributes.find(L=>wn.equals(L.attributeId,P));return H(_).with({type:ft.Choice},(L,U)=>{const Y=this.mergeChoice(U,y(g,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(v,Vt(k=>wn.equals(k.attributeId,P)),z(k=>k.payload)));return el(Y)(I)}).with({type:ft.Numeric},(L,U)=>{const Y=this.mergeNumeric(U,y(x,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(b,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return el(Y)(I)}).with({type:ft.Boolean},(L,U)=>{const Y=this.mergeBoolean(U,y(E,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(T,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return el(Y)(I)}).with({type:ft.Component},(L,U)=>{const Y=this.mergeComponent(U,y(m,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(C,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return el(Y)(I)}).exhaustive()}),z(I=>{const P=p(I.attributeId);return I.canContributeToConfigurationSatisfaction!=P?{...I,canContributeToConfigurationSatisfaction:P}:I}));return{...t,isSatisfied:y((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,ye,Qe(()=>t.isSatisfied)),attributes:N}}mergeChoice(t,n,r){const i=y(n,K(u=>u.values??[]),Qe(()=>[])),o=y(r),a=y([],Re(y(i,z(u=>u.choiceValueId))),Re(y(o,z(u=>u.choiceValueId))),z(vs),fa(ot)),s=y(a,tp(t.values,(u,l)=>{const c=y(i,Pt(p=>p.choiceValueId===l)),f=y(o,Pt(p=>p.choiceValueId===l)),d=y(t.values.find(p=>p.choiceValueId===l),ye),h=this.mergeChoiceValue(l,d,c,f);return uM(h)(u)}));return{...t,isSatisfied:y(n,K(u=>vs(u.isSatisfied)),Qe(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=y(i,K(s=>({state:this.toDecisionState(vs(s.state)),kind:this.toDecisionKind(vs(s.kind))})),Qe(()=>({state:y(n,Fn(s=>y(s.decision,K(u=>u.state)))),kind:y(n,Fn(s=>y(s.decision,K(u=>u.kind))),Qe(()=>kt.Explicit))}))),a=y(r,K(s=>y(cy(s.possibleDecisionStates??[]),z(u=>this.toPossibleDecisionState(u)),qn)),Qe(()=>y(n,K(s=>s.possibleDecisionStates??[]),Qe(()=>[]))));return{choiceValueId:t,decision:y(o.state,K(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=y(r,K(a=>{const s=this.toDecisionState(vs(a.state));return y(s,K(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),Qe(()=>y(t.decision,K(a=>({state:a.state,kind:a.kind}))))),o=y(n,K(a=>y(cy(a.possibleDecisionStates??[]),z(s=>this.toPossibleDecisionState(s)),qn)),Qe(()=>t.possibleDecisionStates));return{...t,isSatisfied:y(n,K(a=>a.isSatisfied),Qe(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:y(n,Fn(i=>ye(i.isSatisfied)),Qe(()=>t.isSatisfied)),decision:y(r,ei(()=>t.decision,i=>y(i.state,ye,K(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:y(n,Fn(i=>ye(i.isSatisfied)),Qe(()=>t.isSatisfied)),decision:y(r,ei(()=>t.decision,i=>y(i.state,ye,K(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:y(n,K(i=>i.possibleDecisionStates),Qe(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return H(t).with(Ao.Included,()=>De(Zt.Included)).with(Ao.Excluded,()=>De(Zt.Excluded)).otherwise(()=>me)}toDecisionState(t){return H(t).with(Yr.Included,()=>De(Zt.Included)).with(Yr.Excluded,()=>De(Zt.Excluded)).otherwise(()=>me)}toDecisionKind(t){return H(t).with(ou.Implicit,()=>kt.Implicit).with(ou.Explicit,()=>kt.Explicit).exhaustive()}},cM=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return H(t).with({type:Ie.ChoiceValue},n=>({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ie.Component},n=>({type:Gn.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ie.Numeric},n=>({type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).with({type:Ie.Boolean},n=>({type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=y([...t],vi(u=>u.type!==Ie.Boolean?me:De({type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:y(u.value,Et)}))),o=y([...t],vi(u=>u.type!==Ie.Numeric?me:De({type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:y(u.value,Et)}))),a=y([...t],vi(u=>u.type!==Ie.ChoiceValue?me:De({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=y([...t],vi(u=>u.type!==Ie.Component?me:De({type:Gn.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=y([...t],vi(a=>a.type!==ft.Boolean?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitBooleanDecision(a))))),r=y([...t],vi(a=>a.type!==ft.Numeric?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitNumericDecision(a))))),i=y([...t],vi(a=>a.type!==ft.Component?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitComponentDecision(a))))),o=y([...t],vi(a=>a.type!==ft.Choice?me:y(this.mapToExplicitChoiceDecisions(a),Ou(s=>y(s,Wa)))),oP);return{booleanDecisions:n,numericDecisions:r,choiceDecisions:o,componentDecisions:i}}mapToMode(t){return H(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:y(t.componentPath,ye,K(np),Mn),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:H(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:qe.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:y(t.decision,K(n=>n.state),Et)}}mapToExplicitNumericDecision(t){return{type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:y(t.decision,K(n=>n.state),Et)}}mapToExplicitComponentDecision(t){return{type:Gn.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(y(t.decision,K(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return y(r.decision,K(i=>i.kind===kt.Explicit),Qe(()=>!1))}return y(t.values,Vt(n),z(r=>({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(y(r.decision,K(i=>i.state)))})),np)}mapToDecisionState(t){return y(t,K(n=>H(n).with(Zt.Included,()=>Yr.Included).with(Zt.Excluded,()=>Yr.Excluded).exhaustive()),Qe(()=>Yr.Undefined))}mapToPossibleDecisionState(t){return H(t).with(Zt.Included,()=>Ao.Included).with(Zt.Excluded,()=>Ao.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return H(t).with({subject:mn.attribute},n=>({type:vp.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:mn.configuration},()=>({type:vp.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return H(t).with({subject:mn.boolean},n=>({type:Es.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:mn.numeric},n=>({type:Es.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:mn.component},n=>({type:Es.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:mn.choiceValue},n=>({type:Es.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},fM=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return y(t.configuration.attributes,Pt(n=>H(n).with({type:ft.Boolean},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ii)).with({type:ft.Numeric},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ii)).with({type:ft.Choice},r=>y(r.values,Pt(i=>y(i.decision,K(o=>o.kind===kt.Explicit),Qe(()=>!1))),Ii)).with({type:ft.Component},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ii)).exhaustive()),ei(()=>!1,()=>!0))},getExplicitDecisions(t){return y(t.configuration.attributes,z(n=>H(n).with({type:ft.Boolean},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Boolean,attributeId:r.attributeId,value:ye(i.state)})),K(i=>[i]))).with({type:ft.Numeric},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Numeric,attributeId:r.attributeId,value:ye(i.state)})),K(i=>[i]))).with({type:ft.Choice},r=>y(r.values,z(i=>y(i.decision,Mt(o=>o.kind===kt.Explicit),K(o=>({type:Ie.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:ye(o.state)})))),qn,Di)).with({type:ft.Component},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Component,attributeId:r.attributeId,state:ye(i.state)})),K(i=>[i]))).exhaustive()),qn,Ha)}}}},dM=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 fM}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)=>y(this.engineApiClient.makeDecision(i,r),Sr(zr),Ht(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=H(t).with({question:Yn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Yn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return y(i,Sr(zr),Ht(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return y(a,gr(s=>{var u,l,c,f;return y([],Re(y(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],z(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Re(y(((l=s.rejectedDecisions)==null?void 0:l.numericDecisions)??[],z(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Re(y(((c=s.rejectedDecisions)==null?void 0:c.componentDecisions)??[],z(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Re(y(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],z(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),da(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 y(i,Ht(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return y(o,Sr(zr),gr(a=>{const s={rejectedDecisions:{booleanDecisions:qe.array(qe.any)}},u={decisionExplanations:qe.array(qe.any)};return H(a).with(s,l=>Ka(l)).with(u,l=>Ni(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(l,i,n))).otherwise(()=>Ni({type:xe.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 y(da(t),gr(r=>y(r.sessionId,ei(()=>this.initializeInner(r,!1),()=>da(r)))),gr(r=>y(r.sessionId,uv(()=>({type:xe.ConfigurationUnauthenticated})),gr(i=>n(i,r)))))}initializeInner(t,n){return y(UP,()=>y(t.sessionId,ZP,nR(s=>n?QP(s):y(this.sessionHandler.close(s),oc(()=>me,()=>me)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return y(s,kP(()=>({type:xe.ConfigurationUnauthenticated})),cw(()=>this.sessionHandler.create(u)))},s=>y(s,GP(u=>y(Di(t),Mt(this.interpreter.configurationSession.hasExplicitDecisions),K(l=>this.replaceDecisions(u,l)),Qe(()=>da({}))))),s=>y(s,gr(u=>{const l=this.determineConsequences(u),c=this.determineDecisions(u),f=i2(_P)({consequences:l,decisions:c});return y(f,Ht(({decisions:d,consequences:h})=>this.restToDomainMapper.mapToConfigurationModel(d,h)),Ht(d=>({sessionId:Di(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return y(this.engineApiClient.getDecisions(t),Sr(zr))}determineConsequences(t){return y(this.engineApiClient.getConsequence(t),Sr(zr))}},pM=class{constructor(t,n){this.onConfigurationChangedHandler=me,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return y(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return y(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:me}}restoreConfiguration(t){return y(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return y(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return y(this.configurationSession.sessionId,K(t=>this.sessionHandler.close(t)),K(Ln(Ht(t=>{this.configurationSession={...this.configurationSession,sessionId:me}}))),Qe(Ba(fk())))}applySolution(t){return y(this.configurationSession.solutions,Pt(n=>wk.equals(n,t)),uv(()=>({type:xe.ConfigurationSolutionNotAvailable})),Ht(n=>n.decisions),gr(n=>this.setMany(n,t.mode)))}setMany(t,n){return y(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),Zs(r=>()=>{const i=H(r).with({decisionExplanations:qe.array(qe.any)},o=>De(o.decisionExplanations)).otherwise(()=>me);this.configurationSession={...this.configurationSession,solutions:y(i,K(Ln(z(o=>o.solution))),Qe(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=H(t).with({decisionExplanations:qe.array(qe.any)},r=>r.decisionExplanations).otherwise(()=>[]);return y(n,z(r=>r.solution))}invalidateAvailableSolutions(){return WP(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Zs(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Qs(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Ln(Qs(t=>()=>{this.configurationSession=t,y(this.onConfigurationChangedHandler,KP(n=>()=>n(this.configurationSession.configuration)))}),Ht(t=>t.configuration),this.invalidateAvailableSolutions())}},hM=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=YR(r,HR.concat(JR(i),KR(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Ko(this.policy,r,i=>y(i,ao(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return H(t).with({type:xe.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:xe.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},vM=class{constructor(){this.queue=[],this.operating=me}push(t){const n=new mM(t);return this.queue.push(n),this.operating=y(this.operating,Qe(()=>this.start()),Di),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=y(t,z(r=>r.argument),tp(me,(r,i)=>this.reduce(r,i)),K(Ln(r=>this.execute(r),r=>r.then(i=>{y(t,z(o=>{o.resolve(i)}))}).catch(i=>{y(t,z(o=>{o.reject(i)}))}))),Et);n&&await n}this.operating=me}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},mM=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},yM=class extends vM{constructor(t){super(),this.inner=t}reduce(t,n){return De(n)}async execute(t){return await this.inner.setSessionContext(t)()}},gM=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new yM(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(vk.equals(n,t))return Ka(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)}},bM=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)),y(r(),Zs(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Qs(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)}};class mv{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+pv()}static new(t){return new mv(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 SM(e){e=sM(e);const t=new Pk(e.hcaEngineBaseUrl),n=new Aw,r=new cM,i=new Ow,o=new lk,a=new lM(n),s=H(e.sessionHandler).with({create:qe.any,close:qe.any},c=>c).with({accessToken:qe.string},c=>new Nk(t,o,n,c)).with({sessionCreateUrl:qe.string,sessionDeleteUrl:qe.string},c=>new Rk(o,c)).exhaustive(),u=new dM(s,t,n,r,i,a),l=(c,f)=>y(new pM(c,f),d=>new hM(d),d=>new gM(d),mv.new,d=>new bM(d,!1));return new jk(u,l)}const Nu=Ja.equals,CM=xw.equals;rk.equals;function lf(e){return An((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 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 gv(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 We(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 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 $o;(function(e){e.Parent="#_parent",e.Internal="#_internal"})($o||($o={}));var mp=vt.Start,bv=vt.Stop,Pu=vt.Raise,cf=vt.Send,Hw=vt.Cancel,gM=vt.NullEvent,Sv=vt.Assign;vt.After;vt.DoneState;var Kw=vt.Log,bM=vt.Init,yp=vt.Invoke;vt.ErrorExecution;var wy=vt.ErrorPlatform,SM=vt.ErrorCustom,Yw=vt.Update,CM=vt.Choose,wM=vt.Pure,Jw=".",xy={},gp="xstate.guard",xM="",Ot=process.env.NODE_ENV==="production",tl;function Cv(e,t,n){n===void 0&&(n=Jw);var r=_s(e,n),i=_s(t,n);return Ke(i)?Ke(r)?i===r:!1:Ke(r)?r in i:Object.keys(r).every(function(o){return o in i?Cv(r[o],i[o]):!1})}function Xw(e){try{return Ke(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 bp(e,t){try{return Qa(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function TM(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function _s(e,t){if(TM(e))return e.value;if(Qa(e))return sc(e);if(typeof e!="string")return e;var n=bp(e,t);return sc(n)}function sc(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 Is(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 Ty(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,l=e[u];n(l)&&(o[u]=t(l,u,e))}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var EM=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 IM(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(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function Rl(e){if(!e)return[[]];if(Ke(e))return[[e]];var t=At(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:Rl(e[n]).map(function(i){return[n].concat(i)})}));return t}function At(e){var t;return(t=[]).concat.apply(t,gt([],We(e),!1))}function Qw(e){return Qa(e)?e:[e]}function vr(e){return e===void 0?[]:Qw(e)}function uc(e,t,n){var r,i;if(nt(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,l=e[u];nt(l)?o[u]=l(t,n.data):o[u]=l}}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 AM(e){return/^(done|error)\./.test(e)}function Ey(e){return!!(e instanceof Promise||e!==null&&(nt(e)||typeof e=="object")&&nt(e.then))}function $M(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function OM(e,t){var n,r,i=We([[],[]],2),o=i[0],a=i[1];try{for(var s=Be(e),u=s.next();!u.done;u=s.next()){var l=u.value;t(l)?o.push(l):a.push(l)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function Zw(e,t){return Is(e.states,function(n,r){if(n){var i=(Ke(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:Zw(n,i)}}})}function DM(e,t){return{current:t,states:Zw(e,t)}}function Iy(e,t,n,r){Ot||nn(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,l=a.assignment,c={state:r,action:a,_event:t},f={};if(nt(l))f=l(o,t.data,c);else try{for(var d=Be(Object.keys(l)),h=d.next();!h.done;h=d.next()){var p=h.value,v=l[p];f[p]=nt(v)?v(o,t.data,c):v}}catch(g){s={error:g}}finally{try{h&&!h.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var nn=function(){};Ot||(nn=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 nt(e){return typeof e=="function"}function Ke(e){return typeof e=="string"}function e0(e,t){if(e)return Ke(e)?{type:gp,name:e,predicate:t?t[e]:void 0}:nt(e)?{type:gp,name:e.name,predicate:e}:e}function NM(e){try{return"subscribe"in e&&nt(e.subscribe)}catch{return!1}}var Ti=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();tl={},tl[Ti]=function(){return this},tl[Symbol.observable]=function(){return this};function ei(e){return!!e&&"__xstatenode"in e}function PM(e){return!!e&&typeof e.send=="function"}var RM=function(){var e=0;return function(){return e++,e.toString(16)}}();function ff(e,t){return Ke(e)||typeof e=="number"?re({type:e},t):e}function fn(e,t){if(!Ke(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=ff(e);return re({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Yo(e,t){var n=Qw(t).map(function(r){return typeof r>"u"||typeof r=="string"||ei(r)?{target:r,event:e}:re(re({},r),{event:e})});return n}function kM(e){if(!(e===void 0||e===xM))return vr(e)}function MM(e,t,n){if(!Ot){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 t0(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===gp)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 n0(e){return typeof e=="string"?{type:e}:e}function kl(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 nl(e,t){return"".concat(e,":invocation[").concat(t,"]")}function Sp(e){return(e.type===Pu||e.type===cf&&e.to===$o.Internal)&&typeof e.delay!="number"}var Sa=fn({type:bM});function Cp(e,t){return t&&t[e]||void 0}function au(e,t){var n;if(Ke(e)||typeof e=="number"){var r=Cp(e,t);nt(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(nt(e))n={type:e.name||e.toString(),exec:e};else{var r=Cp(e.type,t);if(nt(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=Qa(e)?e:[e];return n.map(function(r){return au(r,t)})};function wv(e){var t=au(e);return re(re({id:Ke(e)?e:t.id},t),{type:t.type})}function jM(e,t){return{type:Pu,event:typeof e=="function"?e:ff(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function _M(e,t,n,r){var i={_event:n},o=fn(nt(e.event)?e.event(t,n.data,i):e.event),a;if(Ke(e.delay)){var s=r&&r[e.delay];a=nt(s)?s(t,n.data,i):s}else a=nt(e.delay)?e.delay(t,n.data,i):e.delay;return re(re({},e),{type:Pu,_event:o,delay:a})}function df(e,t){return{to:t?t.to:void 0,type:cf,event:nt(e)?e:ff(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:nt(e)?e.name:Xw(e)}}function qM(e,t,n,r){var i={_event:n},o=fn(nt(e.event)?e.event(t,n.data,i):e.event),a;if(Ke(e.delay)){var s=r&&r[e.delay];a=nt(s)?s(t,n.data,i):s}else a=nt(e.delay)?e.delay(t,n.data,i):e.delay;var u=nt(e.to)?e.to(t,n.data,i):e.to;return re(re({},e),{to:u,_event:o,event:o.data,delay:a})}function FM(e,t){return df(e,re(re({},t),{to:$o.Parent}))}var LM=function(e,t,n){return re(re({},e),{value:Ke(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},VM=function(e){return{type:Hw,sendId:e}};function BM(e){var t=wv(e);return{type:vt.Start,activity:t,exec:void 0}}function UM(e){var t=nt(e)?e:wv(e);return{type:vt.Stop,activity:t,exec:void 0}}function GM(e,t,n){var r=nt(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:Sv,assignment:e}};function WM(e,t){var n=t?"#".concat(t):"";return"".concat(vt.After,"(").concat(e,")").concat(n)}function rl(e,t){var n="".concat(vt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Ml(e,t){var n="".concat(vt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function As(e,t){var n="".concat(vt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function HM(e,t){if(!Ot&&(!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([],We(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 df(function(r,i){return i},re(re({},t),{to:e}))}var KM=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===Sv){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 lc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:KM(i),u=s.length?Iy(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case Pu:{var C=_M(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case cf:var m=qM(v,u,r,e.options.delays);if(!Ot){var b=v.delay;nn(!Ke(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==$o.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case Kw:{var x=LM(v,u,r);return o==null||o(x,u,r),x}case CM:{var T=v,E=(g=T.conds.find(function(B){var G=e0(B.cond,e.options.guards);return!G||t0(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=We(lc(e,t,u,r,[{type:p,actions:Ei(vr(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case wM:{var E=v.get(u,r.data);if(!E)return[];var P=We(lc(e,t,u,r,[{type:p,actions:Ei(vr(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case bv:{var x=GM(v,u,r);return o==null||o(x,n,r),x}case Sv:{u=Iy(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=au(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=re(re({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,gt([l[k]],We(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Be(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=At(i.map(d));return[h,u]}var cc=[],ia=function(e,t){cc.push(e);var n=t(e);return cc.pop(),n},YM=function(e){return e(cc[cc.length-1])};function r0(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[Ti]=function(){return this},t}function JM(e,t,n,r){var i,o=n0(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?uc(e.data,n,r):void 0,u=a?xv(a,e.id,s):r0(e.id);return u.meta=e,u}function xv(e,t,n){var r=r0(t);if(r.deferred=!0,ei(e)){var i=r.state=ia(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function XM(e){try{return typeof e.send=="function"}catch{return!1}}function QM(e){return XM(e)&&"id"in e}function ZM(e){var t;return re((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[Ti]=function(){return this},t),e)}var fc=function(e){return e.type==="atomic"||e.type==="final"};function i0(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function su(e){return i0(e).filter(function(t){return t.type!=="history"})}function o0(e){var t=[e];return fc(e)?t:t.concat(At(su(e).map(o0)))}function $s(e,t){var n,r,i,o,a,s,u,l,c=new Set(e),f=wp(c),d=new Set(t);try{for(var h=Be(d),p=h.next();!p.done;p=h.next())for(var v=p.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){n={error:I}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var C=wp(d);try{for(var m=Be(d),b=m.next();!b.done;b=m.next()){var v=b.value;if(v.type==="compound"&&(!C.get(v)||!C.get(v).length))f.get(v)?f.get(v).forEach(function(P){return d.add(P)}):v.initialStateNodes.forEach(function(P){return d.add(P)});else if(v.type==="parallel")try{for(var x=(a=void 0,Be(su(v))),T=x.next();!T.done;T=x.next()){var E=T.value;d.has(E)||(d.add(E),f.get(E)?f.get(E).forEach(function(P){return d.add(P)}):E.initialStateNodes.forEach(function(P){return d.add(P)}))}}catch(P){a={error:P}}finally{try{T&&!T.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{b&&!b.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Be(d),N=A.next();!N.done;N=A.next())for(var v=N.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){u={error:I}}finally{try{N&&!N.done&&(l=A.return)&&l.call(A)}finally{if(u)throw u.error}}return d}function a0(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(fc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=a0(o,t)}),i}function wp(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 ej(e,t){var n=$s([e],t);return a0(e,wp(n))}function Os(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function tj(e){return gt([],We(new Set(At(gt([],We(e.map(function(t){return t.ownEvents})),!1)))),!1)}function jl(e,t){return t.type==="compound"?su(t).some(function(n){return n.type==="final"&&Os(e,n)}):t.type==="parallel"?su(t).every(function(n){return jl(e,n)}):!1}function nj(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function Ay(e){return new Set(At(e.map(function(t){return t.tags})))}function s0(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(Ke(e)||Ke(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return s0(e[i],t[i])})}function rj(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function ij(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 ir=function(){function e(t){var n=this,r;this.actions=[],this.activities=xy,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||xy,this.meta=nj(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 tj(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=Sa;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=Sa;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="."),Ke(t))return[t];var i=Object.keys(t);return i.concat.apply(i,gt([],We(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=gv(t,["configuration","transitions","tags","machine"]);return re(re({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return Cv(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;Ot&&nn(!!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}(),oj={deferEvents:!1},$y=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=re(re({},oj),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}(),Bf=new Map,aj=0,ms={bookId:function(){return"x:".concat(aj++)},register:function(e,t){return Bf.set(e,t),e},get:function(e){return Bf.get(e)},free:function(e){Bf.delete(e)}};function Tv(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;Ot||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 sj(){var e=Tv();if(e&&"__xstate__"in e)return e.__xstate__}function uj(e){if(Tv()){var t=sj();t&&t.register(e)}}function lj(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 l=i.shift();n=e.transition(n,l,u),r.forEach(function(c){return c.next(n)})}o=!1}},s=ZM({id:t.id,send:function(l){i.push(l),a()},getSnapshot:function(){return n},subscribe:function(l,c,f){var d=kl(l,c,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 xp={sync:!1,autoForward:!1},Nt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Nt||(Nt={}));var cj=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=Nt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(c,f){if(Qa(c))return r.batch(c),r.state;var d=fn(ff(c,f));if(r.status===Nt.Stopped)return Ot||nn(!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.
|
|
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 yv(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 We(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 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 $o;(function(e){e.Parent="#_parent",e.Internal="#_internal"})($o||($o={}));var mp=vt.Start,gv=vt.Stop,Pu=vt.Raise,cf=vt.Send,Yw=vt.Cancel,wM=vt.NullEvent,bv=vt.Assign;vt.After;vt.DoneState;var Jw=vt.Log,xM=vt.Init,yp=vt.Invoke;vt.ErrorExecution;var xy=vt.ErrorPlatform,TM=vt.ErrorCustom,Xw=vt.Update,EM=vt.Choose,IM=vt.Pure,Qw=".",Ty={},gp="xstate.guard",AM="",Ot=process.env.NODE_ENV==="production",tl;function Sv(e,t,n){n===void 0&&(n=Qw);var r=_s(e,n),i=_s(t,n);return Ke(i)?Ke(r)?i===r:!1:Ke(r)?r in i:Object.keys(r).every(function(o){return o in i?Sv(r[o],i[o]):!1})}function Zw(e){try{return Ke(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 bp(e,t){try{return Qa(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function $M(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function _s(e,t){if($M(e))return e.value;if(Qa(e))return sc(e);if(typeof e!="string")return e;var n=bp(e,t);return sc(n)}function sc(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 Is(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 Ey(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,l=e[u];n(l)&&(o[u]=t(l,u,e))}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var OM=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 DM(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(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function Rl(e){if(!e)return[[]];if(Ke(e))return[[e]];var t=At(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:Rl(e[n]).map(function(i){return[n].concat(i)})}));return t}function At(e){var t;return(t=[]).concat.apply(t,gt([],We(e),!1))}function e0(e){return Qa(e)?e:[e]}function mr(e){return e===void 0?[]:e0(e)}function uc(e,t,n){var r,i;if(nt(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,l=e[u];nt(l)?o[u]=l(t,n.data):o[u]=l}}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 NM(e){return/^(done|error)\./.test(e)}function Iy(e){return!!(e instanceof Promise||e!==null&&(nt(e)||typeof e=="object")&&nt(e.then))}function PM(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function RM(e,t){var n,r,i=We([[],[]],2),o=i[0],a=i[1];try{for(var s=Be(e),u=s.next();!u.done;u=s.next()){var l=u.value;t(l)?o.push(l):a.push(l)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function t0(e,t){return Is(e.states,function(n,r){if(n){var i=(Ke(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:t0(n,i)}}})}function kM(e,t){return{current:t,states:t0(e,t)}}function Ay(e,t,n,r){Ot||nn(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,l=a.assignment,c={state:r,action:a,_event:t},f={};if(nt(l))f=l(o,t.data,c);else try{for(var d=Be(Object.keys(l)),h=d.next();!h.done;h=d.next()){var p=h.value,v=l[p];f[p]=nt(v)?v(o,t.data,c):v}}catch(g){s={error:g}}finally{try{h&&!h.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var nn=function(){};Ot||(nn=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 nt(e){return typeof e=="function"}function Ke(e){return typeof e=="string"}function n0(e,t){if(e)return Ke(e)?{type:gp,name:e,predicate:t?t[e]:void 0}:nt(e)?{type:gp,name:e.name,predicate:e}:e}function MM(e){try{return"subscribe"in e&&nt(e.subscribe)}catch{return!1}}var Ti=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();tl={},tl[Ti]=function(){return this},tl[Symbol.observable]=function(){return this};function ti(e){return!!e&&"__xstatenode"in e}function jM(e){return!!e&&typeof e.send=="function"}var _M=function(){var e=0;return function(){return e++,e.toString(16)}}();function ff(e,t){return Ke(e)||typeof e=="number"?re({type:e},t):e}function dn(e,t){if(!Ke(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=ff(e);return re({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Yo(e,t){var n=e0(t).map(function(r){return typeof r>"u"||typeof r=="string"||ti(r)?{target:r,event:e}:re(re({},r),{event:e})});return n}function qM(e){if(!(e===void 0||e===AM))return mr(e)}function FM(e,t,n){if(!Ot){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 r0(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===gp)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 i0(e){return typeof e=="string"?{type:e}:e}function kl(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 nl(e,t){return"".concat(e,":invocation[").concat(t,"]")}function Sp(e){return(e.type===Pu||e.type===cf&&e.to===$o.Internal)&&typeof e.delay!="number"}var Sa=dn({type:xM});function Cp(e,t){return t&&t[e]||void 0}function au(e,t){var n;if(Ke(e)||typeof e=="number"){var r=Cp(e,t);nt(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(nt(e))n={type:e.name||e.toString(),exec:e};else{var r=Cp(e.type,t);if(nt(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=Qa(e)?e:[e];return n.map(function(r){return au(r,t)})};function Cv(e){var t=au(e);return re(re({id:Ke(e)?e:t.id},t),{type:t.type})}function LM(e,t){return{type:Pu,event:typeof e=="function"?e:ff(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function VM(e,t,n,r){var i={_event:n},o=dn(nt(e.event)?e.event(t,n.data,i):e.event),a;if(Ke(e.delay)){var s=r&&r[e.delay];a=nt(s)?s(t,n.data,i):s}else a=nt(e.delay)?e.delay(t,n.data,i):e.delay;return re(re({},e),{type:Pu,_event:o,delay:a})}function df(e,t){return{to:t?t.to:void 0,type:cf,event:nt(e)?e:ff(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:nt(e)?e.name:Zw(e)}}function BM(e,t,n,r){var i={_event:n},o=dn(nt(e.event)?e.event(t,n.data,i):e.event),a;if(Ke(e.delay)){var s=r&&r[e.delay];a=nt(s)?s(t,n.data,i):s}else a=nt(e.delay)?e.delay(t,n.data,i):e.delay;var u=nt(e.to)?e.to(t,n.data,i):e.to;return re(re({},e),{to:u,_event:o,event:o.data,delay:a})}function UM(e,t){return df(e,re(re({},t),{to:$o.Parent}))}var GM=function(e,t,n){return re(re({},e),{value:Ke(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},zM=function(e){return{type:Yw,sendId:e}};function WM(e){var t=Cv(e);return{type:vt.Start,activity:t,exec:void 0}}function HM(e){var t=nt(e)?e:Cv(e);return{type:vt.Stop,activity:t,exec:void 0}}function KM(e,t,n){var r=nt(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 YM=function(e){return{type:bv,assignment:e}};function JM(e,t){var n=t?"#".concat(t):"";return"".concat(vt.After,"(").concat(e,")").concat(n)}function rl(e,t){var n="".concat(vt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Ml(e,t){var n="".concat(vt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function As(e,t){var n="".concat(vt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function XM(e,t){if(!Ot&&(!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([],We(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 df(function(r,i){return i},re(re({},t),{to:e}))}var QM=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===bv){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 lc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:QM(i),u=s.length?Ay(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case Pu:{var C=VM(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case cf:var m=BM(v,u,r,e.options.delays);if(!Ot){var b=v.delay;nn(!Ke(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==$o.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case Jw:{var x=GM(v,u,r);return o==null||o(x,u,r),x}case EM:{var T=v,E=(g=T.conds.find(function(B){var G=n0(B.cond,e.options.guards);return!G||r0(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=We(lc(e,t,u,r,[{type:p,actions:Ei(mr(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case IM:{var E=v.get(u,r.data);if(!E)return[];var P=We(lc(e,t,u,r,[{type:p,actions:Ei(mr(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case gv:{var x=KM(v,u,r);return o==null||o(x,n,r),x}case bv:{u=Ay(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=au(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=re(re({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,gt([l[k]],We(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Be(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=At(i.map(d));return[h,u]}var cc=[],ia=function(e,t){cc.push(e);var n=t(e);return cc.pop(),n},ZM=function(e){return e(cc[cc.length-1])};function o0(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[Ti]=function(){return this},t}function ej(e,t,n,r){var i,o=i0(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?uc(e.data,n,r):void 0,u=a?wv(a,e.id,s):o0(e.id);return u.meta=e,u}function wv(e,t,n){var r=o0(t);if(r.deferred=!0,ti(e)){var i=r.state=ia(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function tj(e){try{return typeof e.send=="function"}catch{return!1}}function nj(e){return tj(e)&&"id"in e}function rj(e){var t;return re((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[Ti]=function(){return this},t),e)}var fc=function(e){return e.type==="atomic"||e.type==="final"};function a0(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function su(e){return a0(e).filter(function(t){return t.type!=="history"})}function s0(e){var t=[e];return fc(e)?t:t.concat(At(su(e).map(s0)))}function $s(e,t){var n,r,i,o,a,s,u,l,c=new Set(e),f=wp(c),d=new Set(t);try{for(var h=Be(d),p=h.next();!p.done;p=h.next())for(var v=p.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){n={error:I}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var C=wp(d);try{for(var m=Be(d),b=m.next();!b.done;b=m.next()){var v=b.value;if(v.type==="compound"&&(!C.get(v)||!C.get(v).length))f.get(v)?f.get(v).forEach(function(P){return d.add(P)}):v.initialStateNodes.forEach(function(P){return d.add(P)});else if(v.type==="parallel")try{for(var x=(a=void 0,Be(su(v))),T=x.next();!T.done;T=x.next()){var E=T.value;d.has(E)||(d.add(E),f.get(E)?f.get(E).forEach(function(P){return d.add(P)}):E.initialStateNodes.forEach(function(P){return d.add(P)}))}}catch(P){a={error:P}}finally{try{T&&!T.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{b&&!b.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Be(d),N=A.next();!N.done;N=A.next())for(var v=N.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){u={error:I}}finally{try{N&&!N.done&&(l=A.return)&&l.call(A)}finally{if(u)throw u.error}}return d}function u0(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(fc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=u0(o,t)}),i}function wp(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 ij(e,t){var n=$s([e],t);return u0(e,wp(n))}function Os(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function oj(e){return gt([],We(new Set(At(gt([],We(e.map(function(t){return t.ownEvents})),!1)))),!1)}function jl(e,t){return t.type==="compound"?su(t).some(function(n){return n.type==="final"&&Os(e,n)}):t.type==="parallel"?su(t).every(function(n){return jl(e,n)}):!1}function aj(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function $y(e){return new Set(At(e.map(function(t){return t.tags})))}function l0(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(Ke(e)||Ke(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return l0(e[i],t[i])})}function sj(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function uj(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 ir=function(){function e(t){var n=this,r;this.actions=[],this.activities=Ty,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||Ty,this.meta=aj(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 oj(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=Sa;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=Sa;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="."),Ke(t))return[t];var i=Object.keys(t);return i.concat.apply(i,gt([],We(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=yv(t,["configuration","transitions","tags","machine"]);return re(re({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return Sv(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;Ot&&nn(!!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}(),lj={deferEvents:!1},Oy=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=re(re({},lj),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}(),Bf=new Map,cj=0,ms={bookId:function(){return"x:".concat(cj++)},register:function(e,t){return Bf.set(e,t),e},get:function(e){return Bf.get(e)},free:function(e){Bf.delete(e)}};function xv(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;Ot||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 fj(){var e=xv();if(e&&"__xstate__"in e)return e.__xstate__}function dj(e){if(xv()){var t=fj();t&&t.register(e)}}function pj(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 l=i.shift();n=e.transition(n,l,u),r.forEach(function(c){return c.next(n)})}o=!1}},s=rj({id:t.id,send:function(l){i.push(l),a()},getSnapshot:function(){return n},subscribe:function(l,c,f){var d=kl(l,c,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 xp={sync:!1,autoForward:!1},Nt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Nt||(Nt={}));var hj=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=Nt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(c,f){if(Qa(c))return r.batch(c),r.state;var d=dn(ff(c,f));if(r.status===Nt.Stopped)return Ot||nn(!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
84
|
Event: `).concat(JSON.stringify(d.data))),r.state;if(r.status!==Nt.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 h=r._nextState(d);r.update(h,d)}),r._state},this.sendTo=function(c,f,d){var h=r.parent&&(f===$o.Parent||r.parent.id===f),p=h?r.parent:Ke(f)?f===$o.Internal?r:r.children.get(f)||ms.get(f):
|
|
86
|
-
Event: `).concat(JSON.stringify(event)));else if(this.status!==Nt.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=[],l=function(h){var p=fn(h);n.forward(p),a=ia(n,function(){return n.machine.transition(a,p,void 0,r||void 0)}),u.push.apply(u,gt([],We(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return ij(v,a)})),!1)),s=s||!!a.changed};try{for(var c=Be(t),f=c.next();!f.done;f=c.next()){var d=f.value;l(d)}}catch(h){i={error:h}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,fn(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=fn(t);if(i.name.indexOf(wy)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(wy)===0}))throw i.data.data;var o=ia(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),nt(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Nt.Running)return xv(t,n);if(Ey(t))return this.spawnPromise(Promise.resolve(t),n);if(nt(t))return this.spawnCallback(t,n);if(QM(t))return this.spawnActor(t,n);if(NM(t))return this.spawnObservable(t,n);if(ei(t))return this.spawnMachine(t,re(re({},r),{id:n}));if($M(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({},xp),n);o.sync&&i.onTransition(function(s){r.send(Yw,{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(fn(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=lj(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(fn(Ml(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var l=As(n,u);try{i.send(fn(l,{origin:n}))}catch(c){MM(u,c,n),i.devTools&&i.devTools.send(l,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,l,c){var f=kl(u,l,c),d=!1;return t.then(function(h){d||(f.next(h),!d&&f.complete())},function(h){d||f.error(h)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[Ti]=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,l=function(d){u=d,s.forEach(function(h){return h(d)}),!o&&i.send(fn(d,{origin:n}))},c;try{c=t(l,function(d){a.add(d)})}catch(d){this.send(As(n,d))}if(Ey(c))return this.spawnPromise(c,n);var f=(r={id:n,send:function(d){return a.forEach(function(h){return h(d)})},subscribe:function(d){var h=kl(d);return s.add(h.next),{unsubscribe:function(){s.delete(h.next)}}},stop:function(){o=!0,nt(c)&&c()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[Ti]=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(fn(u,{origin:n}))},function(u){i.removeChild(n),i.send(fn(As(n,u),{origin:n}))},function(){i.removeChild(n),i.send(fn(Ml(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,l,c){return t.subscribe(u,l,c)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[Ti]=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){Ot||nn(!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[Ti]=function(){return this},r))},e.prototype.attachDev=function(){var t=Tv();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)}uj(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[Ti]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Nt.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=u0,e}(),fj=function(e){return Ke(e)?re(re({},xp),{name:e}):re(re(re({},xp),{name:RM()}),e)};function Oy(e,t){var n=fj(t);return YM(function(r){if(!Ot){var i=ei(e)||nt(e);nn(!!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):xv(e,n.name)})}function u0(e,t){var n=new cj(e,t);return n}function dj(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function il(e){return re(re({type:yp},e),{toJSON:function(){e.onDone,e.onError;var t=gv(e,["onDone","onError"]);return re(re({},t),{type:yp,src:dj(e.src)})}})}var oa="",Tp="#",ys="*",Jo={},Xo=function(e){return e[0]===Tp},pj=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},hj=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(Ke(o.target)||ei(o.target))}),i=t===oa?"the transient event":"event '".concat(t,"'");nn(!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.")},vj=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(pj(),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:Jw),this.id=this.config.id||gt([this.machine.key],We(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,Ot||nn(!("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?Is(this.config.states,function(l,c){var f,d=new e(l,{},void 0,{parent:o,key:c});return Object.assign(o.idMap,re((f={},f[d.id]=d,f),d.idMap)),d}):Jo;var s=0;function u(l){var c,f;l.order=s++;try{for(var d=Be(i0(l)),h=d.next();!h.done;h=d.next()){var p=h.value;u(p)}}catch(v){c={error:v}}finally{try{h&&!h.done&&(f=d.return)&&f.call(d)}finally{if(c)throw c.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(l){var c=l.event;return c===oa}):oa in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=vr(this.config.entry||this.config.onEntry).map(function(l){return au(l)}),this.onExit=vr(this.config.exit||this.config.onExit).map(function(l){return au(l)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=vr(this.config.invoke).map(function(l,c){var f,d;if(ei(l)){var h=nl(o.id,c);return o.machine.options.services=re((f={},f[h]=l,f),o.machine.options.services),il({src:h,id:h})}else if(Ke(l.src)){var h=l.id||nl(o.id,c);return il(re(re({},l),{id:h,src:l.src}))}else if(ei(l.src)||nt(l.src)){var h=l.id||nl(o.id,c);return o.machine.options.services=re((d={},d[h]=l.src,d),o.machine.options.services),il(re(re({id:h},l),{src:h}))}else{var p=l.src;return il(re(re({id:nl(o.id,c)},l),{src:p}))}}),this.activities=vr(this.config.activities).concat(this.invoke).map(function(l){return wv(l)}),this.transition=this.transition.bind(this),this.tags=vr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||o0(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 nt(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:Is(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===oa,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===ys});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=nt(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=WM(s,t.id);return t.onEntry.push(df(u,{delay:o})),t.onExit.push(VM(u)),u},i=Qa(n)?n.map(function(o,a){var s=r(o.delay,a);return re(re({},o),{event:s})}):At(Object.keys(n).map(function(o,a){var s=n[o],u=Ke(s)?{target:s}:s,l=isNaN(+o)?o:+o,c=r(l,a);return vr(u).map(function(f){return re(re({},f),{event:c,delay:l})})}));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 ir?t.value:_s(t,this.delimiter);if(Ke(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([],We(At(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=Xw(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof ir?t:ir.create(t),r=Array.from($s([],this.getStateNodes(n.value)));return new ir(re(re({},n),{value:this.resolve(n.value),configuration:r,done:jl(r,this),tags:Ay(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 l=u.value,c=t[l];if(c){var f=this.getStateNode(l),d=f._transition(c,n,r);d&&(a[l]=d)}}}catch(C){i={error:C}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var h=Object.keys(a).map(function(C){return a[C]}),p=At(h.map(function(C){return C.transitions})),v=h.some(function(C){return C.transitions.length>0});if(!v)return this.next(n,r);var g=At(Object.keys(a).map(function(C){return a[C].configuration}));return{transitions:p,exitSet:At(h.map(function(C){return C.exitSet})),configuration:g,source:n,actions:At(Object.keys(a).map(function(C){return a[C].actions}))}},e.prototype._transition=function(t,n,r){return Ke(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,fn(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],l;try{for(var c=Be(this.getCandidates(a)),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.cond,p=d.in,v=t.context,g=p?Ke(p)&&Xo(p)?t.matches(_s(this.getStateNodeById(p).path,this.delimiter)):Cv(_s(p,this.delimiter),EM(this.path.slice(0,-2))(t.value)):!0,C=!1;try{C=!h||t0(this.machine,h,v,n,t)}catch(x){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
87
|
-
`).concat(x.message))}if(C&&g){d.target!==void 0&&(u=d.target),s.push.apply(s,gt([],We(d.actions),!1)),l=d;break}}}catch(x){r={error:x}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}if(l){if(!u.length)return{transitions:[l],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=At(u.map(function(x){return o.getRelativeStateNodes(x,t.historyValue)})),b=!!l.internal;return{transitions:[l],exitSet:b?[]:At(u.map(function(x){return o.getPotentiallyReenteringNodes(x)})),configuration:m,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,l,c,f,d=this,h=a?$s([],this.getStateNodes(a.value)):[],p=new Set;try{for(var v=Be(Array.from(t).sort(function(_,L){return _.order-L.order})),g=v.next();!g.done;g=v.next()){var C=g.value;(!Os(h,C)||Os(r.exitSet,C)||C.parent&&p.has(C.parent))&&p.add(C)}}catch(_){u={error:_}}finally{try{g&&!g.done&&(l=v.return)&&l.call(v)}finally{if(u)throw u.error}}try{for(var m=Be(h),b=m.next();!b.done;b=m.next()){var C=b.value;(!Os(t,C)||Os(r.exitSet,C.parent))&&r.exitSet.push(C)}}catch(_){c={error:_}}finally{try{b&&!b.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var x=Array.from(p).sort(function(_,L){return _.order-L.order}),T=new Set(r.exitSet),E=At(x.map(function(_){var L=[];if(_.type!=="final")return L;var U=_.parent;if(!U.parent)return L;L.push(rl(_.id,_.doneData),rl(U.id,_.doneData?uc(_.doneData,i,o):void 0));var Y=U.parent;return Y.type==="parallel"&&su(Y).every(function(k){return jl(r.configuration,k)})&&L.push(rl(Y.id)),L})),A=x.map(function(_){var L=_.onEntry,U=_.activities.map(function(Y){return BM(Y)});return{type:"entry",actions:Ei(s?gt(gt([],We(L),!1),We(U),!1):gt(gt([],We(U),!1),We(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:E.map(function(_){return jM(_)})}),N=Array.from(T).map(function(_){return{type:"exit",actions:Ei(gt(gt([],We(_.onExit),!1),We(_.activities.map(function(L){return UM(L)})),!1),d.machine.options.actions)}}),I=N.concat({type:"transition",actions:Ei(r.actions,this.machine.options.actions)}).concat(A);if(n){var P=Ei(At(gt([],We(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!Sp(_)});return I.concat({type:"stop",actions:P})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=fn(n),a;if(t instanceof ir)a=r===void 0?t:this.resolveState(ir.from(t,r));else{var s=Ke(t)?this.resolve(sc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(ir.from(s,u))}if(!Ot&&o.name===ys)throw new Error("An event cannot have the wildcard type ('".concat(ys,"')"));if(this.strict&&!this.events.includes(o.name)&&!AM(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var l=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},c=$s([],this.getStateNodes(a.value)),f=l.configuration.length?$s(c,l.configuration):c;return l.configuration=gt([],We(f),!1),this.resolveTransition(l,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([],We(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,l,c=this;o===void 0&&(o=Sa);var f=t.configuration,d=!n||t.transitions.length>0,h=d?t.configuration:n?n.configuration:[],p=jl(h,this),v=d?ej(this.machine,f):void 0,g=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,C=this.getActions(new Set(h),p,t,r,o,n,i),m=n?re({},n.activities):{};try{for(var b=Be(C),x=b.next();!x.done;x=b.next()){var T=x.value;try{for(var E=(u=void 0,Be(T.actions)),A=E.next();!A.done;A=E.next()){var N=A.value;N.type===mp?m[N.activity.id||N.activity.type]=N:N.type===bv&&(m[N.activity.id||N.activity.type]=!1)}}catch(X){u={error:X}}finally{try{A&&!A.done&&(l=E.return)&&l.call(E)}finally{if(u)throw u.error}}}}catch(X){a={error:X}}finally{try{x&&!x.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}var I=We(lc(this,n,r,o,C,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),P=I[0],_=I[1],L=We(OM(P,Sp),2),U=L[0],Y=L[1],k=P.filter(function(X){var ae;return X.type===mp&&((ae=X.activity)===null||ae===void 0?void 0:ae.type)===yp}),ie=k.reduce(function(X,ae){return X[ae.activity.id]=JM(ae.activity,c.machine,_,o),X},n?re({},n.children):{}),B=new ir({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?g?DM(g,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?Y:[],activities:v?m:n?n.activities:{},events:[],configuration:h,transitions:t.transitions,children:ie,done:p,tags:Ay(h),machine:this}),G=r!==_;B.changed=o.name===Yw||G;var fe=B.history;fe&&delete fe.history;var j=!p&&(this._transient||f.some(function(X){return X._transient}));if(!d&&(!j||o.name===oa))return B;var R=B;if(!p)for(j&&(R=this.resolveRaisedTransition(R,{type:gM},o,i));U.length;){var te=U.shift();R=this.resolveRaisedTransition(R,te._event,o,i)}var oe=R.changed||(fe?!!R.actions.length||G||typeof fe.value!=typeof R.value||!s0(R.value,fe.value):void 0);return R.changed=oe,R.history=fe,R},e.prototype.getStateNode=function(t){if(Xo(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=Xo(t)?t.slice(Tp.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"&&Xo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=bp(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||Jo;switch(this.type){case"parallel":return Is(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):Jo});case"compound":if(Ke(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?Is(t,function(o,a){return o?r.getStateNode(a).resolve(o):Jo}):this.initialStateValue||{};default:return t||Jo}},e.prototype.getResolvedPath=function(t){if(Xo(t)){var n=this.machine.idMap[t.slice(Tp.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return bp(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=Ty(this.states,function(r){return r.initialStateValue||Jo},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=fc(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;Ke(n.target)?t=Xo(n.target)?sc(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(fc(this))return[this];if(this.type==="compound"&&!this.initial)return Ot||nn(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=Rl(this.initialStateValue);return At(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=We(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:Ty(this.states,function(n,r){if(!t)return n.historyValue();var i=Ke(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?At(Rl(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=IM(r.path,"states")(t).current;return Ke(o)?[r.getStateNode(o)]:At(Rl(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=At(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 l=u.value,c=o[l];if(c.states)try{for(var f=(r=void 0,Be(c.events)),d=f.next();!d.done;d=f.next()){var h=d.value;a.add("".concat(h))}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(p){t={error:p}}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(!Ke(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=
|
|
85
|
+
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var h=r._nextState(d);r.update(h,d)}),r._state},this.sendTo=function(c,f,d){var h=r.parent&&(f===$o.Parent||r.parent.id===f),p=h?r.parent:Ke(f)?f===$o.Internal?r:r.children.get(f)||ms.get(f):jM(f)?f:void 0;if(!p){if(!h)throw new Error("Unable to send event to child '".concat(f,"' from service '").concat(r.id,"'."));Ot||nn(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(c.type));return}if("machine"in p){if(r.status!==Nt.Stopped||r.parent!==p||r.state.done){var v=re(re({},c),{name:c.name===TM?"".concat(As(r.id)):c.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([p,v]):p.send(v)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([p,c.data]):p.send(c.data)},this._exec=function(c,f,d,h){h===void 0&&(h=r.machine.options.actions);var p=c.exec||Cp(c.type,h),v=nt(p)?p:p?p.exec:c.exec;if(v)try{return v(f,d.data,r.machine.config.predictableActionArguments?{action:c,_event:d}:{action:c,state:r.state,_event:d})}catch(Y){throw r.parent&&r.parent.send({type:"xstate.error",data:Y}),Y}switch(c.type){case Pu:{var g=c;r.defer(g);break}case cf:var C=c;if(typeof C.delay=="number"){r.defer(C);return}else C.to?r.sendTo(C._event,C.to,d===Sa):r.send(C._event);break;case Yw:r.cancel(c.sendId);break;case mp:{if(r.status!==Nt.Running)return;var m=c.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[m.id||m.type])break;if(m.type===vt.Invoke){var b=i0(m.src),x=r.machine.options.services?r.machine.options.services[b.type]:void 0,T=m.id,E=m.data;Ot||nn(!("forward"in m),"`forward` property is deprecated (found in invocation of '".concat(m.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var A="autoForward"in m?m.autoForward:!!m.forward;if(!x){Ot||nn(!1,"No service found for invocation '".concat(m.src,"' in machine '").concat(r.machine.id,"'."));return}var N=E?uc(E,f,d):void 0;if(typeof x=="string")return;var I=nt(x)?x(f,d.data,{data:N,src:b,meta:m.meta}):x;if(!I)return;var P=void 0;ti(I)&&(I=N?I.withContext(N):I,P={autoForward:A}),r.spawn(I,T,P)}else r.spawnActivity(m);break}case gv:{r.stopChild(c.activity.id);break}case Jw:var _=c,L=_.label,U=_.value;L?r.logger(L,U):r.logger(U);break;default:Ot||nn(!1,"No implementation found for action type '".concat(c.type,"'"));break}};var i=re(re({},e.defaultOptions),n),o=i.clock,a=i.logger,s=i.parent,u=i.id,l=u!==void 0?u:t.id;this.id=l,this.logger=a,this.clock=o,this.parent=s,this.options=i,this.scheduler=new Oy({deferEvents:this.options.deferEvents}),this.sessionId=ms.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:ia(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return Ot||nn(this.status!==Nt.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,l,c,f=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||n===Sa)&&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 h=Be(this.eventListeners),p=h.next();!p.done;p=h.next()){var v=p.value;v(t.event)}}catch(I){r={error:I}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}try{for(var g=Be(this.listeners),C=g.next();!C.done;C=g.next()){var v=C.value;v(t,t.event)}}catch(I){o={error:I}}finally{try{C&&!C.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}try{for(var m=Be(this.contextListeners),b=m.next();!b.done;b=m.next()){var x=b.value;x(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(I){s={error:I}}finally{try{b&&!b.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(this.state.done){var T=t.configuration.find(function(I){return I.type==="final"&&I.parent===f.machine}),E=T&&T.doneData?uc(T.doneData,t.context,n):void 0;this._doneEvent=Ml(this.id,E);try{for(var A=Be(this.doneListeners),N=A.next();!N.done;N=A.next()){var v=N.value;v(this._doneEvent)}}catch(I){l={error:I}}finally{try{N&&!N.done&&(c=A.return)&&c.call(A)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),ms.free(this.sessionId)}},e.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Nt.Running&&t(this.state,this.state.event),this},e.prototype.subscribe=function(t,n,r){var i=this,o=kl(t,n,r);this.listeners.add(o.next),this.status!==Nt.NotStarted&&o.next(this.state);var a=function(){i.doneListeners.delete(a),i.stopListeners.delete(a),o.complete()};return this.status===Nt.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===Nt.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===Nt.Running)return this;this.machine._init(),ms.register(this.sessionId,this),this.initialized=!0,this.status=Nt.Running;var r=t===void 0?this.initialState:ia(this,function(){return sj(t)?n.machine.resolveState(t):n.machine.resolveState(ir.from(t,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,Sa)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(t){nt(t.stop)&&t.stop()}),this.children.clear()},e.prototype._stop=function(){var t,n,r,i,o,a,s,u,l,c;try{for(var f=Be(this.listeners),d=f.next();!d.done;d=f.next()){var h=d.value;this.listeners.delete(h)}}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 p=Be(this.stopListeners),v=p.next();!v.done;v=p.next()){var h=v.value;h(),this.stopListeners.delete(h)}}catch(A){r={error:A}}finally{try{v&&!v.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var g=Be(this.contextListeners),C=g.next();!C.done;C=g.next()){var h=C.value;this.contextListeners.delete(h)}}catch(A){o={error:A}}finally{try{C&&!C.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}try{for(var m=Be(this.doneListeners),b=m.next();!b.done;b=m.next()){var h=b.value;this.doneListeners.delete(h)}}catch(A){s={error:A}}finally{try{b&&!b.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Nt.Stopped,this._initialState=void 0;try{for(var x=Be(Object.keys(this.delayedEventsMap)),T=x.next();!T.done;T=x.next()){var E=T.value;this.clock.clearTimeout(this.delayedEventsMap[E])}}catch(A){l={error:A}}finally{try{T&&!T.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new Oy({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var t=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r=dn({type:"xstate.stop"}),i=ia(t,function(){var o=At(gt([],We(t.state.configuration),!1).sort(function(c,f){return f.order-c.order}).map(function(c){return Ei(c.onExit,t.machine.options.actions)})),a=We(lc(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],l=new ir({value:t.state.value,context:u,_event:r,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:s.filter(function(c){return!Sp(c)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return l.changed=!0,l});t.update(i,r),t._stopChildren(),ms.free(t.sessionId)}),this},e.prototype.batch=function(t){var n=this;if(this.status===Nt.NotStarted&&this.options.deferEvents)Ot||nn(!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!==Nt.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=[],l=function(h){var p=dn(h);n.forward(p),a=ia(n,function(){return n.machine.transition(a,p,void 0,r||void 0)}),u.push.apply(u,gt([],We(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return uj(v,a)})),!1)),s=s||!!a.changed};try{for(var c=Be(t),f=c.next();!f.done;f=c.next()){var d=f.value;l(d)}}catch(h){i={error:h}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,dn(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=dn(t);if(i.name.indexOf(xy)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(xy)===0}))throw i.data.data;var o=ia(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),nt(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Nt.Running)return wv(t,n);if(Iy(t))return this.spawnPromise(Promise.resolve(t),n);if(nt(t))return this.spawnCallback(t,n);if(nj(t))return this.spawnActor(t,n);if(MM(t))return this.spawnObservable(t,n);if(ti(t))return this.spawnMachine(t,re(re({},r),{id:n}));if(PM(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({},xp),n);o.sync&&i.onTransition(function(s){r.send(Xw,{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(dn(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=pj(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(dn(Ml(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var l=As(n,u);try{i.send(dn(l,{origin:n}))}catch(c){FM(u,c,n),i.devTools&&i.devTools.send(l,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,l,c){var f=kl(u,l,c),d=!1;return t.then(function(h){d||(f.next(h),!d&&f.complete())},function(h){d||f.error(h)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[Ti]=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,l=function(d){u=d,s.forEach(function(h){return h(d)}),!o&&i.send(dn(d,{origin:n}))},c;try{c=t(l,function(d){a.add(d)})}catch(d){this.send(As(n,d))}if(Iy(c))return this.spawnPromise(c,n);var f=(r={id:n,send:function(d){return a.forEach(function(h){return h(d)})},subscribe:function(d){var h=kl(d);return s.add(h.next),{unsubscribe:function(){s.delete(h.next)}}},stop:function(){o=!0,nt(c)&&c()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[Ti]=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(dn(u,{origin:n}))},function(u){i.removeChild(n),i.send(dn(As(n,u),{origin:n}))},function(){i.removeChild(n),i.send(dn(Ml(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,l,c){return t.subscribe(u,l,c)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[Ti]=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){Ot||nn(!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[Ti]=function(){return this},r))},e.prototype.attachDev=function(){var t=xv();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)}dj(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[Ti]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Nt.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=c0,e}(),vj=function(e){return Ke(e)?re(re({},xp),{name:e}):re(re(re({},xp),{name:_M()}),e)};function Dy(e,t){var n=vj(t);return ZM(function(r){if(!Ot){var i=ti(e)||nt(e);nn(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(ti(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):wv(e,n.name)})}function c0(e,t){var n=new hj(e,t);return n}function mj(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function il(e){return re(re({type:yp},e),{toJSON:function(){e.onDone,e.onError;var t=yv(e,["onDone","onError"]);return re(re({},t),{type:yp,src:mj(e.src)})}})}var oa="",Tp="#",ys="*",Jo={},Xo=function(e){return e[0]===Tp},yj=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},gj=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(Ke(o.target)||ti(o.target))}),i=t===oa?"the transient event":"event '".concat(t,"'");nn(!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.")},bj=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(yj(),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:Qw),this.id=this.config.id||gt([this.machine.key],We(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,Ot||nn(!("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?Is(this.config.states,function(l,c){var f,d=new e(l,{},void 0,{parent:o,key:c});return Object.assign(o.idMap,re((f={},f[d.id]=d,f),d.idMap)),d}):Jo;var s=0;function u(l){var c,f;l.order=s++;try{for(var d=Be(a0(l)),h=d.next();!h.done;h=d.next()){var p=h.value;u(p)}}catch(v){c={error:v}}finally{try{h&&!h.done&&(f=d.return)&&f.call(d)}finally{if(c)throw c.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(l){var c=l.event;return c===oa}):oa in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=mr(this.config.entry||this.config.onEntry).map(function(l){return au(l)}),this.onExit=mr(this.config.exit||this.config.onExit).map(function(l){return au(l)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=mr(this.config.invoke).map(function(l,c){var f,d;if(ti(l)){var h=nl(o.id,c);return o.machine.options.services=re((f={},f[h]=l,f),o.machine.options.services),il({src:h,id:h})}else if(Ke(l.src)){var h=l.id||nl(o.id,c);return il(re(re({},l),{id:h,src:l.src}))}else if(ti(l.src)||nt(l.src)){var h=l.id||nl(o.id,c);return o.machine.options.services=re((d={},d[h]=l.src,d),o.machine.options.services),il(re(re({id:h},l),{src:h}))}else{var p=l.src;return il(re(re({id:nl(o.id,c)},l),{src:p}))}}),this.activities=mr(this.config.activities).concat(this.invoke).map(function(l){return Cv(l)}),this.transition=this.transition.bind(this),this.tags=mr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||s0(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 nt(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:Is(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===oa,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===ys});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=nt(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=JM(s,t.id);return t.onEntry.push(df(u,{delay:o})),t.onExit.push(zM(u)),u},i=Qa(n)?n.map(function(o,a){var s=r(o.delay,a);return re(re({},o),{event:s})}):At(Object.keys(n).map(function(o,a){var s=n[o],u=Ke(s)?{target:s}:s,l=isNaN(+o)?o:+o,c=r(l,a);return mr(u).map(function(f){return re(re({},f),{event:c,delay:l})})}));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 ir?t.value:_s(t,this.delimiter);if(Ke(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([],We(At(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=Zw(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof ir?t:ir.create(t),r=Array.from($s([],this.getStateNodes(n.value)));return new ir(re(re({},n),{value:this.resolve(n.value),configuration:r,done:jl(r,this),tags:$y(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 l=u.value,c=t[l];if(c){var f=this.getStateNode(l),d=f._transition(c,n,r);d&&(a[l]=d)}}}catch(C){i={error:C}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var h=Object.keys(a).map(function(C){return a[C]}),p=At(h.map(function(C){return C.transitions})),v=h.some(function(C){return C.transitions.length>0});if(!v)return this.next(n,r);var g=At(Object.keys(a).map(function(C){return a[C].configuration}));return{transitions:p,exitSet:At(h.map(function(C){return C.exitSet})),configuration:g,source:n,actions:At(Object.keys(a).map(function(C){return a[C].actions}))}},e.prototype._transition=function(t,n,r){return Ke(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,dn(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],l;try{for(var c=Be(this.getCandidates(a)),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.cond,p=d.in,v=t.context,g=p?Ke(p)&&Xo(p)?t.matches(_s(this.getStateNodeById(p).path,this.delimiter)):Sv(_s(p,this.delimiter),OM(this.path.slice(0,-2))(t.value)):!0,C=!1;try{C=!h||r0(this.machine,h,v,n,t)}catch(x){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
87
|
+
`).concat(x.message))}if(C&&g){d.target!==void 0&&(u=d.target),s.push.apply(s,gt([],We(d.actions),!1)),l=d;break}}}catch(x){r={error:x}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}if(l){if(!u.length)return{transitions:[l],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=At(u.map(function(x){return o.getRelativeStateNodes(x,t.historyValue)})),b=!!l.internal;return{transitions:[l],exitSet:b?[]:At(u.map(function(x){return o.getPotentiallyReenteringNodes(x)})),configuration:m,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,l,c,f,d=this,h=a?$s([],this.getStateNodes(a.value)):[],p=new Set;try{for(var v=Be(Array.from(t).sort(function(_,L){return _.order-L.order})),g=v.next();!g.done;g=v.next()){var C=g.value;(!Os(h,C)||Os(r.exitSet,C)||C.parent&&p.has(C.parent))&&p.add(C)}}catch(_){u={error:_}}finally{try{g&&!g.done&&(l=v.return)&&l.call(v)}finally{if(u)throw u.error}}try{for(var m=Be(h),b=m.next();!b.done;b=m.next()){var C=b.value;(!Os(t,C)||Os(r.exitSet,C.parent))&&r.exitSet.push(C)}}catch(_){c={error:_}}finally{try{b&&!b.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var x=Array.from(p).sort(function(_,L){return _.order-L.order}),T=new Set(r.exitSet),E=At(x.map(function(_){var L=[];if(_.type!=="final")return L;var U=_.parent;if(!U.parent)return L;L.push(rl(_.id,_.doneData),rl(U.id,_.doneData?uc(_.doneData,i,o):void 0));var Y=U.parent;return Y.type==="parallel"&&su(Y).every(function(k){return jl(r.configuration,k)})&&L.push(rl(Y.id)),L})),A=x.map(function(_){var L=_.onEntry,U=_.activities.map(function(Y){return WM(Y)});return{type:"entry",actions:Ei(s?gt(gt([],We(L),!1),We(U),!1):gt(gt([],We(U),!1),We(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:E.map(function(_){return LM(_)})}),N=Array.from(T).map(function(_){return{type:"exit",actions:Ei(gt(gt([],We(_.onExit),!1),We(_.activities.map(function(L){return HM(L)})),!1),d.machine.options.actions)}}),I=N.concat({type:"transition",actions:Ei(r.actions,this.machine.options.actions)}).concat(A);if(n){var P=Ei(At(gt([],We(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!Sp(_)});return I.concat({type:"stop",actions:P})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=dn(n),a;if(t instanceof ir)a=r===void 0?t:this.resolveState(ir.from(t,r));else{var s=Ke(t)?this.resolve(sc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(ir.from(s,u))}if(!Ot&&o.name===ys)throw new Error("An event cannot have the wildcard type ('".concat(ys,"')"));if(this.strict&&!this.events.includes(o.name)&&!NM(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var l=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},c=$s([],this.getStateNodes(a.value)),f=l.configuration.length?$s(c,l.configuration):c;return l.configuration=gt([],We(f),!1),this.resolveTransition(l,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([],We(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,l,c=this;o===void 0&&(o=Sa);var f=t.configuration,d=!n||t.transitions.length>0,h=d?t.configuration:n?n.configuration:[],p=jl(h,this),v=d?ij(this.machine,f):void 0,g=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,C=this.getActions(new Set(h),p,t,r,o,n,i),m=n?re({},n.activities):{};try{for(var b=Be(C),x=b.next();!x.done;x=b.next()){var T=x.value;try{for(var E=(u=void 0,Be(T.actions)),A=E.next();!A.done;A=E.next()){var N=A.value;N.type===mp?m[N.activity.id||N.activity.type]=N:N.type===gv&&(m[N.activity.id||N.activity.type]=!1)}}catch(X){u={error:X}}finally{try{A&&!A.done&&(l=E.return)&&l.call(E)}finally{if(u)throw u.error}}}}catch(X){a={error:X}}finally{try{x&&!x.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}var I=We(lc(this,n,r,o,C,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),P=I[0],_=I[1],L=We(RM(P,Sp),2),U=L[0],Y=L[1],k=P.filter(function(X){var ae;return X.type===mp&&((ae=X.activity)===null||ae===void 0?void 0:ae.type)===yp}),ie=k.reduce(function(X,ae){return X[ae.activity.id]=ej(ae.activity,c.machine,_,o),X},n?re({},n.children):{}),B=new ir({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?g?kM(g,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?Y:[],activities:v?m:n?n.activities:{},events:[],configuration:h,transitions:t.transitions,children:ie,done:p,tags:$y(h),machine:this}),G=r!==_;B.changed=o.name===Xw||G;var fe=B.history;fe&&delete fe.history;var j=!p&&(this._transient||f.some(function(X){return X._transient}));if(!d&&(!j||o.name===oa))return B;var R=B;if(!p)for(j&&(R=this.resolveRaisedTransition(R,{type:wM},o,i));U.length;){var te=U.shift();R=this.resolveRaisedTransition(R,te._event,o,i)}var oe=R.changed||(fe?!!R.actions.length||G||typeof fe.value!=typeof R.value||!l0(R.value,fe.value):void 0);return R.changed=oe,R.history=fe,R},e.prototype.getStateNode=function(t){if(Xo(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=Xo(t)?t.slice(Tp.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"&&Xo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=bp(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||Jo;switch(this.type){case"parallel":return Is(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):Jo});case"compound":if(Ke(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?Is(t,function(o,a){return o?r.getStateNode(a).resolve(o):Jo}):this.initialStateValue||{};default:return t||Jo}},e.prototype.getResolvedPath=function(t){if(Xo(t)){var n=this.machine.idMap[t.slice(Tp.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return bp(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=Ey(this.states,function(r){return r.initialStateValue||Jo},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=fc(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;Ke(n.target)?t=Xo(n.target)?sc(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(fc(this))return[this];if(this.type==="compound"&&!this.initial)return Ot||nn(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=Rl(this.initialStateValue);return At(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=We(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:Ey(this.states,function(n,r){if(!t)return n.historyValue();var i=Ke(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?At(Rl(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=DM(r.path,"states")(t).current;return Ke(o)?[r.getStateNode(o)]:At(Rl(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=At(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 l=u.value,c=o[l];if(c.states)try{for(var f=(r=void 0,Be(c.events)),d=f.next();!d.done;d=f.next()){var h=d.value;a.add("".concat(h))}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(p){t={error:p}}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(!Ke(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=qM(t.target),i="internal"in t?t.internal:r?r.some(function(u){return Ke(u)&&u[0]===n.delimiter}):!0,o=this.machine.options.guards,a=this.resolveTarget(r),s=re(re({},t),{actions:Ei(mr(t.actions)),cond:n0(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=ys,s=o[a],u=s===void 0?[]:s,l=yv(o,[typeof a=="symbol"?a:a+""]);i=At(Object.keys(l).map(function(m){!Ot&&m===oa&&nn(!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 b=Yo(m,l[m]);return Ot||gj(r,m,b),b}).concat(Yo(ys,u)))}var c=this.config.always?Yo("",this.config.always):[],f=this.config.onDone?Yo(String(rl(this.id)),this.config.onDone):[];Ot||nn(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var d=At(this.invoke.map(function(m){var b=[];return m.onDone&&b.push.apply(b,gt([],We(Yo(String(Ml(m.id)),m.onDone)),!1)),m.onError&&b.push.apply(b,gt([],We(Yo(String(As(m.id)),m.onError)),!1)),b})),h=this.after,p=At(gt(gt(gt(gt([],We(f),!1),We(d),!1),We(i),!1),We(c),!1).map(function(m){return mr(m).map(function(b){return r.formatTransition(b)})}));try{for(var v=Be(h),g=v.next();!g.done;g=v.next()){var C=g.value;p.push(C)}}catch(m){t={error:m}}finally{try{g&&!g.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}return p},e}(),Ny=!1;function Tv(e,t){return!Ot&&!("predictableActionArguments"in e)&&!Ny&&(Ny=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new bj(e,t)}var kn=YM,Sj=df,f0=UM,ol=XM,it={},Ev={};(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!==Nt.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 s,u=1,l=arguments.length;u<l;u++){s=arguments[u];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(a[c]=s[c])}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 l=0,u=Object.getOwnPropertySymbols(o);l<u.length;l++)a.indexOf(u[l])<0&&Object.prototype.propertyIsEnumerable.call(o,u[l])&&(s[u[l]]=o[u[l]]);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),l,c=[],f;try{for(;(a===void 0||a-- >0)&&!(l=u.next()).done;)c.push(l.value)}catch(d){f={error:d}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return c}function i(o,a,s){if(s||arguments.length===2)for(var u=0,l=a.length,c;u<l;u++)(c||!(u in a))&&(c||(c=Array.prototype.slice.call(a,0,u)),c[u]=a[u]);return o.concat(c||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(Iv);var pf={};(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={}))})(pf);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});var ln=pf,yj=ln.ActionTypes.Start,gj=ln.ActionTypes.Stop,bj=ln.ActionTypes.Raise,Sj=ln.ActionTypes.Send,Cj=ln.ActionTypes.Cancel,wj=ln.ActionTypes.NullEvent,xj=ln.ActionTypes.Assign,Tj=ln.ActionTypes.After,Ej=ln.ActionTypes.DoneState,Ij=ln.ActionTypes.Log,Aj=ln.ActionTypes.Init,$j=ln.ActionTypes.Invoke,Oj=ln.ActionTypes.ErrorExecution,Dj=ln.ActionTypes.ErrorPlatform,Nj=ln.ActionTypes.ErrorCustom,Pj=ln.ActionTypes.Update,Rj=ln.ActionTypes.Choose,kj=ln.ActionTypes.Pure;Ut.after=Tj;Ut.assign=xj;Ut.cancel=Cj;Ut.choose=Rj;Ut.doneState=Ej;Ut.error=Nj;Ut.errorExecution=Oj;Ut.errorPlatform=Dj;Ut.init=Aj;Ut.invoke=$j;Ut.log=Ij;Ut.nullEvent=wj;Ut.pure=kj;Ut.raise=bj;Ut.send=Sj;Ut.start=yj;Ut.stop=gj;Ut.update=Pj;var c0={},Za={};Object.defineProperty(Za,"__esModule",{value:!0});var Mj=".",jj={},_j="xstate.guard",qj="";Za.DEFAULT_GUARD_TYPE=_j;Za.EMPTY_ACTIVITY_MAP=jj;Za.STATE_DELIMITER=Mj;Za.TARGETLESS_KEY=qj;var hf={};Object.defineProperty(hf,"__esModule",{value:!0});var Fj=process.env.NODE_ENV==="production";hf.IS_PRODUCTION=Fj;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Iv,n=pf,r=Ut,i=Za,o=hf,a;function s(S){return Object.keys(S)}function u(S,M,F){F===void 0&&(F=i.STATE_DELIMITER);var q=h(S,F),Q=h(M,F);return G(Q)?G(q)?Q===q:!1:G(q)?q in Q:Object.keys(q).every(function(Z){return Z in Q?u(q[Z],Q[Z]):!1})}function l(S){try{return G(S)||typeof S=="number"?"".concat(S):S.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function c(S){try{return G(S)||typeof S=="number"?"".concat(S):B(S)?S.name:S.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(S,M){try{return ie(S)?S:S.toString().split(M)}catch{throw new Error("'".concat(S,"' is not a valid state path."))}}function d(S){return typeof S=="object"&&"value"in S&&"context"in S&&"event"in S&&"_event"in S}function h(S,M){if(d(S))return S.value;if(ie(S))return p(S);if(typeof S!="string")return S;var F=f(S,M);return p(F)}function p(S){if(S.length===1)return S[0];for(var M={},F=M,q=0;q<S.length-1;q++)q===S.length-2?F[S[q]]=S[q+1]:(F[S[q]]={},F=F[S[q]]);return M}function v(S,M){for(var F={},q=Object.keys(S),Q=0;Q<q.length;Q++){var Z=q[Q];F[Z]=M(S[Z],Z,S,Q)}return F}function g(S,M,F){var q,Q,Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];F($e)&&(Z[be]=M($e,be,S))}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}var C=function(S){return function(M){var F,q,Q=M;try{for(var Z=t.__values(S),ce=Z.next();!ce.done;ce=Z.next()){var se=ce.value;Q=Q[se]}}catch(be){F={error:be}}finally{try{ce&&!ce.done&&(q=Z.return)&&q.call(Z)}finally{if(F)throw F.error}}return Q}};function m(S,M){return function(F){var q,Q,Z=F;try{for(var ce=t.__values(S),se=ce.next();!se.done;se=ce.next()){var be=se.value;Z=Z[M][be]}}catch($e){q={error:$e}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}}function b(S){if(!S)return[[]];if(G(S))return[[S]];var M=T(Object.keys(S).map(function(F){var q=S[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:b(S[F]).map(function(Q){return[F].concat(Q)})}));return M}function x(S){var M,F,q={};if(S&&S.length===1&&S[0].length===1)return S[0][0];try{for(var Q=t.__values(S),Z=Q.next();!Z.done;Z=Q.next())for(var ce=Z.value,se=q,be=0;be<ce.length;be++){var $e=ce[be];if(be===ce.length-2){se[$e]=ce[be+1];break}se[$e]=se[$e]||{},se=se[$e]}}catch(qt){M={error:qt}}finally{try{Z&&!Z.done&&(F=Q.return)&&F.call(Q)}finally{if(M)throw M.error}}return q}function T(S){var M;return(M=[]).concat.apply(M,t.__spreadArray([],t.__read(S),!1))}function E(S){return ie(S)?S:[S]}function A(S){return S===void 0?[]:E(S)}function N(S,M,F){var q,Q;if(B(S))return S(M,F.data);var Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];B($e)?Z[be]=$e(M,F.data):Z[be]=$e}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}function I(S){return/^(done|error)\./.test(S)}function P(S){return!!(S instanceof Promise||S!==null&&(B(S)||typeof S=="object")&&B(S.then))}function _(S){return S!==null&&typeof S=="object"&&"transition"in S&&typeof S.transition=="function"}function L(S,M){var F,q,Q=t.__read([[],[]],2),Z=Q[0],ce=Q[1];try{for(var se=t.__values(S),be=se.next();!be.done;be=se.next()){var $e=be.value;M($e)?Z.push($e):ce.push($e)}}catch(qt){F={error:qt}}finally{try{be&&!be.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Z,ce]}function U(S,M){return v(S.states,function(F,q){if(F){var Q=(G(M)?void 0:M[q])||(F?F.current:void 0);if(Q)return{current:Q,states:U(F,Q)}}})}function Y(S,M){return{current:M,states:U(S,M)}}function k(S,M,F,q){o.IS_PRODUCTION||e.warn(!!S,"Attempting to update undefined context");var Q=S&&F.reduce(function(Z,ce){var se,be,$e=ce.assignment,qt={state:q,action:ce,_event:M},Qi={};if(B($e))Qi=$e(Z,M.data,qt);else try{for(var _r=t.__values(Object.keys($e)),pr=_r.next();!pr.done;pr=_r.next()){var ls=pr.value,Zi=$e[ls];Qi[ls]=B(Zi)?Zi(Z,M.data,qt):Zi}}catch(jf){se={error:jf}}finally{try{pr&&!pr.done&&(be=_r.return)&&be.call(_r)}finally{if(se)throw se.error}}return Object.assign({},Z,Qi)},S);return Q}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(S,M){var F=S instanceof Error?S:void 0;if(!(!F&&S)&&console!==void 0){var q=["Warning: ".concat(M)];F&&q.push(F),console.warn.apply(console,q)}});function ie(S){return Array.isArray(S)}function B(S){return typeof S=="function"}function G(S){return typeof S=="string"}function fe(S,M){if(S)return G(S)?{type:i.DEFAULT_GUARD_TYPE,name:S,predicate:M?M[S]:void 0}:B(S)?{type:i.DEFAULT_GUARD_TYPE,name:S.name,predicate:S}:S}function j(S){try{return"subscribe"in S&&B(S.subscribe)}catch{return!1}}var R=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[R]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(S){return!!S&&"__xstatenode"in S}function X(S){return!!S&&typeof S.send=="function"}var ae=function(){var S=0;return function(){return S++,S.toString(16)}}();function de(S,M){return G(S)||typeof S=="number"?t.__assign({type:S},M):S}function he(S,M){if(!G(S)&&"$$type"in S&&S.$$type==="scxml")return S;var F=de(S);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},M)}function Te(S,M){var F=E(M).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:S}:t.__assign(t.__assign({},q),{event:S})});return F}function ke(S){if(!(S===void 0||S===i.TARGETLESS_KEY))return A(S)}function Ne(S,M,F){if(!o.IS_PRODUCTION){var q=S.stack?" Stacktrace was '".concat(S.stack,"'"):"";if(S===M)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(S,"'.").concat(q));else{var Q=M.stack?" Stacktrace was '".concat(M.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(S,"'. ").concat(q," Current error is '").concat(M,"'.").concat(Q))}}}function mt(S,M,F,q,Q){var Z=S.options.guards,ce={state:Q,cond:M,_event:q};if(M.type===i.DEFAULT_GUARD_TYPE)return((Z==null?void 0:Z[M.name])||M.predicate)(F,q.data,ce);var se=Z==null?void 0:Z[M.type];if(!se)throw new Error("Guard '".concat(M.type,"' is not implemented on machine '").concat(S.id,"'."));return se(F,q.data,ce)}function le(S){return typeof S=="string"?{type:S}:S}function Pn(S,M,F){var q=function(){},Q=typeof S=="object",Z=Q?S:null;return{next:((Q?S.next:S)||q).bind(Z),error:((Q?S.error:M)||q).bind(Z),complete:((Q?S.complete:F)||q).bind(Z)}}function pi(S,M){return"".concat(S,":invocation[").concat(M,"]")}function Bo(S){return(S.type===r.raise||S.type===r.send&&S.to===n.SpecialTargets.Internal)&&typeof S.delay!="number"}e.createInvokeId=pi,e.evaluateGuard=mt,e.flatten=T,e.getActionType=c,e.getEventType=l,e.interopSymbols=te,e.isActor=X,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=j,e.isPromiseLike=P,e.isRaisableAction=Bo,e.isStateLike=d,e.isString=G,e.keys=s,e.mapContext=N,e.mapFilterValues=g,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=ke,e.partition=L,e.path=C,e.pathToStateValue=p,e.pathsToStateValue=x,e.reportUnhandledExceptionOnInvocation=Ne,e.symbolObservable=R,e.toArray=A,e.toArrayStrict=E,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=le,e.toObserver=Pn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=b,e.toStateValue=h,e.toTransitionConfigArray=Te,e.uniqueId=ae,e.updateContext=k,e.updateHistoryStates=U,e.updateHistoryValue=Y})(c0);Object.defineProperty(it,"__esModule",{value:!0});var Xe=Iv,dr=pf,an=Ut,Le=c0,f0=hf,Lj=Le.toSCXMLEvent({type:an.init});function Ep(e,t){return t&&t[e]||void 0}function vf(e,t){var n;if(Le.isString(e)||typeof e=="number"){var r=Ep(e,t);Le.isFunction(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Le.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var r=Ep(e.type,t);if(Le.isFunction(r))n=Xe.__assign(Xe.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Xe.__assign(Xe.__assign(Xe.__assign({},r),e),{type:i})}else n=e}return n}var Ip=function(e,t){if(!e)return[];var n=Le.isArray(e)?e:[e];return n.map(function(r){return vf(r,t)})};function Av(e){var t=vf(e);return Xe.__assign(Xe.__assign({id:Le.isString(e)?e:t.id},t),{type:t.type})}function Vj(e,t){return{type:an.raise,event:typeof e=="function"?e:Le.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function d0(e,t,n,r){var i={_event:n},o=Le.toSCXMLEvent(Le.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Le.isString(e.delay)){var s=r&&r[e.delay];a=Le.isFunction(s)?s(t,n.data,i):s}else a=Le.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return Xe.__assign(Xe.__assign({},e),{type:an.raise,_event:o,delay:a})}function Ru(e,t){return{to:t?t.to:void 0,type:an.send,event:Le.isFunction(e)?e:Le.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Le.isFunction(e)?e.name:Le.getEventType(e)}}function p0(e,t,n,r){var i={_event:n},o=Le.toSCXMLEvent(Le.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Le.isString(e.delay)){var s=r&&r[e.delay];a=Le.isFunction(s)?s(t,n.data,i):s}else a=Le.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=Le.isFunction(e.to)?e.to(t,n.data,i):e.to;return Xe.__assign(Xe.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function $v(e,t){return Ru(e,Xe.__assign(Xe.__assign({},t),{to:dr.SpecialTargets.Parent}))}function Bj(e,t,n){return Ru(t,Xe.__assign(Xe.__assign({},n),{to:e}))}function Uj(){return $v(an.update)}function Gj(e,t){return Ru(e,Xe.__assign(Xe.__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 Wj(e,t){return e===void 0&&(e=zj),{type:an.log,label:t,expr:e}}var h0=function(e,t,n){return Xe.__assign(Xe.__assign({},e),{value:Le.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},Hj=function(e){return{type:an.cancel,sendId:e}};function Kj(e){var t=Av(e);return{type:dr.ActionTypes.Start,activity:t,exec:void 0}}function Yj(e){var t=Le.isFunction(e)?e:Av(e);return{type:dr.ActionTypes.Stop,activity:t,exec:void 0}}function v0(e,t,n){var r=Le.isFunction(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:dr.ActionTypes.Stop,activity:i};return o}var Jj=function(e){return{type:an.assign,assignment:e}};function Xj(e){return typeof e=="object"&&"type"in e}function Qj(e,t){var n=t?"#".concat(t):"";return"".concat(dr.ActionTypes.After,"(").concat(e,")").concat(n)}function Zj(e,t){var n="".concat(dr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function e_(e,t){var n="".concat(dr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function t_(e,t){var n="".concat(dr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function n_(e){return{type:dr.ActionTypes.Pure,get:e}}function r_(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,Xe.__spreadArray([],Xe.__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 Ru(function(r,i){return i},Xe.__assign(Xe.__assign({},t),{to:e}))}function i_(e,t){return $v(function(n,r,i){return{type:an.error,data:Le.isFunction(e)?e(n,r,i):e}},Xe.__assign(Xe.__assign({},t),{to:dr.SpecialTargets.Parent}))}function o_(e){return{type:dr.ActionTypes.Choose,conds:e}}var a_=function(e){var t,n,r=[];try{for(var i=Xe.__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===an.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 Ap(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:a_(i),u=s.length?Le.updateContext(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case an.raise:{var C=d0(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case an.send:var m=p0(v,u,r,e.options.delays);if(!f0.IS_PRODUCTION){var b=v.delay;Le.warn(!Le.isString(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==dr.SpecialTargets.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case an.log:{var x=h0(v,u,r);return o==null||o(x,u,r),x}case an.choose:{var T=v,E=(g=T.conds.find(function(B){var G=Le.toGuard(B.cond,e.options.guards);return!G||Le.evaluateGuard(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=Xe.__read(Ap(e,t,u,r,[{type:p,actions:Ip(Le.toArray(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case an.pure:{var E=v.get(u,r.data);if(!E)return[];var P=Xe.__read(Ap(e,t,u,r,[{type:p,actions:Ip(Le.toArray(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case an.stop:{var x=v0(v,u,r);return o==null||o(x,n,r),x}case an.assign:{u=Le.updateContext(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=vf(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=Xe.__assign(Xe.__assign({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,Xe.__spreadArray([l[k]],Xe.__read(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Xe.__values(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=Le.flatten(i.map(d));return[h,u]}it.actionTypes=an;it.after=Qj;it.assign=Jj;it.cancel=Hj;it.choose=o_;it.done=Zj;it.doneInvoke=e_;it.error=t_;it.escalate=i_;it.forwardTo=r_;it.getActionFunction=Ep;it.initEvent=Lj;it.isActionObject=Xj;var Wn=it.log=Wj,s_=it.pure=n_;it.raise=Vj;it.resolveActions=Ap;it.resolveLog=h0;it.resolveRaise=d0;it.resolveSend=p0;it.resolveStop=v0;it.respond=Gj;it.send=Ru;it.sendParent=$v;it.sendTo=Bj;it.sendUpdate=Uj;it.start=Kj;var Ny=it.stop=Yj;it.toActionObject=vf;it.toActionObjects=Ip;it.toActivityDefinition=Av;function m0(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function mf(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 y0(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 Py(e){return e.constructor===Object||e.constructor==null}function Ry(e){return typeof e.then=="function"}function yf(e,t){return e===t||e!==e&&t!==t}var u_="[object Arguments]",l_="[object Boolean]",c_="[object Date]",f_="[object RegExp]",d_="[object Map]",p_="[object Number]",h_="[object Object]",v_="[object Set]",m_="[object String]",ky=Object.prototype.toString;function gf(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(l);function l(c,f,d){if(c===f)return!0;if(!c||!f||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;if(Py(c)&&Py(f))return i(c,f,u,d);var h=Array.isArray(c),p=Array.isArray(f);if(h||p)return h===p&&t(c,f,u,d);var v=ky.call(c);return v!==ky.call(f)?!1:v===c_?n(c,f,u,d):v===f_?o(c,f,u,d):v===d_?r(c,f,u,d):v===v_?a(c,f,u,d):v===h_||v===u_?Ry(c)||Ry(f)?!1:i(c,f,u,d):v===l_||v===p_||v===m_?yf(c.valueOf(),f.valueOf()):!1}return l}function g0(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 y_=mf(g0);function b0(e,t){return yf(e.valueOf(),t.valueOf())}function S0(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 l=!1,c=0;t.forEach(function(f,d){!l&&!o[c]&&(l=n(u,d,a,c,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[c]=!0),c++}),a++,i=l}}),i}var g_=mf(S0),b_="_owner",S_=Object.prototype.hasOwnProperty;function C0(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===b_){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!S_.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var C_=mf(C0);function w0(e,t){return e.source===t.source&&e.flags===t.flags}function x0(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,l=0;t.forEach(function(c,f){!u&&!o[l]&&(u=n(a,c,s,f,e,t,r))&&(o[l]=!0),l++}),i=u}}),i}var w_=mf(x0),T0=Object.freeze({areArraysEqual:g0,areDatesEqual:b0,areMapsEqual:S0,areObjectsEqual:C0,areRegExpsEqual:w0,areSetsEqual:x0,createIsNestedEqual:m0}),E0=Object.freeze({areArraysEqual:y_,areDatesEqual:b0,areMapsEqual:g_,areObjectsEqual:C_,areRegExpsEqual:w0,areSetsEqual:w_,createIsNestedEqual:m0}),x_=gf(T0);function T_(e,t){return x_(e,t,void 0)}gf(y0(T0,{createIsNestedEqual:function(){return yf}}));gf(E0);gf(y0(E0,{createIsNestedEqual:function(){return yf}}));var $p={exports:{}},Uf={},al={exports:{}},Gf={};/**
|
|
101
|
+
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,l=arguments.length;u<l;u++){s=arguments[u];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(a[c]=s[c])}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 l=0,u=Object.getOwnPropertySymbols(o);l<u.length;l++)a.indexOf(u[l])<0&&Object.prototype.propertyIsEnumerable.call(o,u[l])&&(s[u[l]]=o[u[l]]);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),l,c=[],f;try{for(;(a===void 0||a-- >0)&&!(l=u.next()).done;)c.push(l.value)}catch(d){f={error:d}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return c}function i(o,a,s){if(s||arguments.length===2)for(var u=0,l=a.length,c;u<l;u++)(c||!(u in a))&&(c||(c=Array.prototype.slice.call(a,0,u)),c[u]=a[u]);return o.concat(c||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(Ev);var pf={};(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={}))})(pf);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});var cn=pf,Cj=cn.ActionTypes.Start,wj=cn.ActionTypes.Stop,xj=cn.ActionTypes.Raise,Tj=cn.ActionTypes.Send,Ej=cn.ActionTypes.Cancel,Ij=cn.ActionTypes.NullEvent,Aj=cn.ActionTypes.Assign,$j=cn.ActionTypes.After,Oj=cn.ActionTypes.DoneState,Dj=cn.ActionTypes.Log,Nj=cn.ActionTypes.Init,Pj=cn.ActionTypes.Invoke,Rj=cn.ActionTypes.ErrorExecution,kj=cn.ActionTypes.ErrorPlatform,Mj=cn.ActionTypes.ErrorCustom,jj=cn.ActionTypes.Update,_j=cn.ActionTypes.Choose,qj=cn.ActionTypes.Pure;Ut.after=$j;Ut.assign=Aj;Ut.cancel=Ej;Ut.choose=_j;Ut.doneState=Oj;Ut.error=Mj;Ut.errorExecution=Rj;Ut.errorPlatform=kj;Ut.init=Nj;Ut.invoke=Pj;Ut.log=Dj;Ut.nullEvent=Ij;Ut.pure=qj;Ut.raise=xj;Ut.send=Tj;Ut.start=Cj;Ut.stop=wj;Ut.update=jj;var d0={},Za={};Object.defineProperty(Za,"__esModule",{value:!0});var Fj=".",Lj={},Vj="xstate.guard",Bj="";Za.DEFAULT_GUARD_TYPE=Vj;Za.EMPTY_ACTIVITY_MAP=Lj;Za.STATE_DELIMITER=Fj;Za.TARGETLESS_KEY=Bj;var hf={};Object.defineProperty(hf,"__esModule",{value:!0});var Uj=process.env.NODE_ENV==="production";hf.IS_PRODUCTION=Uj;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Ev,n=pf,r=Ut,i=Za,o=hf,a;function s(S){return Object.keys(S)}function u(S,M,F){F===void 0&&(F=i.STATE_DELIMITER);var q=h(S,F),Q=h(M,F);return G(Q)?G(q)?Q===q:!1:G(q)?q in Q:Object.keys(q).every(function(Z){return Z in Q?u(q[Z],Q[Z]):!1})}function l(S){try{return G(S)||typeof S=="number"?"".concat(S):S.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function c(S){try{return G(S)||typeof S=="number"?"".concat(S):B(S)?S.name:S.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(S,M){try{return ie(S)?S:S.toString().split(M)}catch{throw new Error("'".concat(S,"' is not a valid state path."))}}function d(S){return typeof S=="object"&&"value"in S&&"context"in S&&"event"in S&&"_event"in S}function h(S,M){if(d(S))return S.value;if(ie(S))return p(S);if(typeof S!="string")return S;var F=f(S,M);return p(F)}function p(S){if(S.length===1)return S[0];for(var M={},F=M,q=0;q<S.length-1;q++)q===S.length-2?F[S[q]]=S[q+1]:(F[S[q]]={},F=F[S[q]]);return M}function v(S,M){for(var F={},q=Object.keys(S),Q=0;Q<q.length;Q++){var Z=q[Q];F[Z]=M(S[Z],Z,S,Q)}return F}function g(S,M,F){var q,Q,Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];F($e)&&(Z[be]=M($e,be,S))}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}var C=function(S){return function(M){var F,q,Q=M;try{for(var Z=t.__values(S),ce=Z.next();!ce.done;ce=Z.next()){var se=ce.value;Q=Q[se]}}catch(be){F={error:be}}finally{try{ce&&!ce.done&&(q=Z.return)&&q.call(Z)}finally{if(F)throw F.error}}return Q}};function m(S,M){return function(F){var q,Q,Z=F;try{for(var ce=t.__values(S),se=ce.next();!se.done;se=ce.next()){var be=se.value;Z=Z[M][be]}}catch($e){q={error:$e}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}}function b(S){if(!S)return[[]];if(G(S))return[[S]];var M=T(Object.keys(S).map(function(F){var q=S[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:b(S[F]).map(function(Q){return[F].concat(Q)})}));return M}function x(S){var M,F,q={};if(S&&S.length===1&&S[0].length===1)return S[0][0];try{for(var Q=t.__values(S),Z=Q.next();!Z.done;Z=Q.next())for(var ce=Z.value,se=q,be=0;be<ce.length;be++){var $e=ce[be];if(be===ce.length-2){se[$e]=ce[be+1];break}se[$e]=se[$e]||{},se=se[$e]}}catch(qt){M={error:qt}}finally{try{Z&&!Z.done&&(F=Q.return)&&F.call(Q)}finally{if(M)throw M.error}}return q}function T(S){var M;return(M=[]).concat.apply(M,t.__spreadArray([],t.__read(S),!1))}function E(S){return ie(S)?S:[S]}function A(S){return S===void 0?[]:E(S)}function N(S,M,F){var q,Q;if(B(S))return S(M,F.data);var Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];B($e)?Z[be]=$e(M,F.data):Z[be]=$e}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}function I(S){return/^(done|error)\./.test(S)}function P(S){return!!(S instanceof Promise||S!==null&&(B(S)||typeof S=="object")&&B(S.then))}function _(S){return S!==null&&typeof S=="object"&&"transition"in S&&typeof S.transition=="function"}function L(S,M){var F,q,Q=t.__read([[],[]],2),Z=Q[0],ce=Q[1];try{for(var se=t.__values(S),be=se.next();!be.done;be=se.next()){var $e=be.value;M($e)?Z.push($e):ce.push($e)}}catch(qt){F={error:qt}}finally{try{be&&!be.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Z,ce]}function U(S,M){return v(S.states,function(F,q){if(F){var Q=(G(M)?void 0:M[q])||(F?F.current:void 0);if(Q)return{current:Q,states:U(F,Q)}}})}function Y(S,M){return{current:M,states:U(S,M)}}function k(S,M,F,q){o.IS_PRODUCTION||e.warn(!!S,"Attempting to update undefined context");var Q=S&&F.reduce(function(Z,ce){var se,be,$e=ce.assignment,qt={state:q,action:ce,_event:M},Qi={};if(B($e))Qi=$e(Z,M.data,qt);else try{for(var qr=t.__values(Object.keys($e)),hr=qr.next();!hr.done;hr=qr.next()){var ls=hr.value,Zi=$e[ls];Qi[ls]=B(Zi)?Zi(Z,M.data,qt):Zi}}catch(jf){se={error:jf}}finally{try{hr&&!hr.done&&(be=qr.return)&&be.call(qr)}finally{if(se)throw se.error}}return Object.assign({},Z,Qi)},S);return Q}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(S,M){var F=S instanceof Error?S:void 0;if(!(!F&&S)&&console!==void 0){var q=["Warning: ".concat(M)];F&&q.push(F),console.warn.apply(console,q)}});function ie(S){return Array.isArray(S)}function B(S){return typeof S=="function"}function G(S){return typeof S=="string"}function fe(S,M){if(S)return G(S)?{type:i.DEFAULT_GUARD_TYPE,name:S,predicate:M?M[S]:void 0}:B(S)?{type:i.DEFAULT_GUARD_TYPE,name:S.name,predicate:S}:S}function j(S){try{return"subscribe"in S&&B(S.subscribe)}catch{return!1}}var R=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[R]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(S){return!!S&&"__xstatenode"in S}function X(S){return!!S&&typeof S.send=="function"}var ae=function(){var S=0;return function(){return S++,S.toString(16)}}();function de(S,M){return G(S)||typeof S=="number"?t.__assign({type:S},M):S}function he(S,M){if(!G(S)&&"$$type"in S&&S.$$type==="scxml")return S;var F=de(S);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},M)}function Te(S,M){var F=E(M).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:S}:t.__assign(t.__assign({},q),{event:S})});return F}function ke(S){if(!(S===void 0||S===i.TARGETLESS_KEY))return A(S)}function Ne(S,M,F){if(!o.IS_PRODUCTION){var q=S.stack?" Stacktrace was '".concat(S.stack,"'"):"";if(S===M)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(S,"'.").concat(q));else{var Q=M.stack?" Stacktrace was '".concat(M.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(S,"'. ").concat(q," Current error is '").concat(M,"'.").concat(Q))}}}function mt(S,M,F,q,Q){var Z=S.options.guards,ce={state:Q,cond:M,_event:q};if(M.type===i.DEFAULT_GUARD_TYPE)return((Z==null?void 0:Z[M.name])||M.predicate)(F,q.data,ce);var se=Z==null?void 0:Z[M.type];if(!se)throw new Error("Guard '".concat(M.type,"' is not implemented on machine '").concat(S.id,"'."));return se(F,q.data,ce)}function le(S){return typeof S=="string"?{type:S}:S}function Pn(S,M,F){var q=function(){},Q=typeof S=="object",Z=Q?S:null;return{next:((Q?S.next:S)||q).bind(Z),error:((Q?S.error:M)||q).bind(Z),complete:((Q?S.complete:F)||q).bind(Z)}}function pi(S,M){return"".concat(S,":invocation[").concat(M,"]")}function Bo(S){return(S.type===r.raise||S.type===r.send&&S.to===n.SpecialTargets.Internal)&&typeof S.delay!="number"}e.createInvokeId=pi,e.evaluateGuard=mt,e.flatten=T,e.getActionType=c,e.getEventType=l,e.interopSymbols=te,e.isActor=X,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=j,e.isPromiseLike=P,e.isRaisableAction=Bo,e.isStateLike=d,e.isString=G,e.keys=s,e.mapContext=N,e.mapFilterValues=g,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=ke,e.partition=L,e.path=C,e.pathToStateValue=p,e.pathsToStateValue=x,e.reportUnhandledExceptionOnInvocation=Ne,e.symbolObservable=R,e.toArray=A,e.toArrayStrict=E,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=le,e.toObserver=Pn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=b,e.toStateValue=h,e.toTransitionConfigArray=Te,e.uniqueId=ae,e.updateContext=k,e.updateHistoryStates=U,e.updateHistoryValue=Y})(d0);Object.defineProperty(it,"__esModule",{value:!0});var Xe=Ev,pr=pf,an=Ut,Le=d0,p0=hf,Gj=Le.toSCXMLEvent({type:an.init});function Ep(e,t){return t&&t[e]||void 0}function vf(e,t){var n;if(Le.isString(e)||typeof e=="number"){var r=Ep(e,t);Le.isFunction(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Le.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var r=Ep(e.type,t);if(Le.isFunction(r))n=Xe.__assign(Xe.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Xe.__assign(Xe.__assign(Xe.__assign({},r),e),{type:i})}else n=e}return n}var Ip=function(e,t){if(!e)return[];var n=Le.isArray(e)?e:[e];return n.map(function(r){return vf(r,t)})};function Iv(e){var t=vf(e);return Xe.__assign(Xe.__assign({id:Le.isString(e)?e:t.id},t),{type:t.type})}function zj(e,t){return{type:an.raise,event:typeof e=="function"?e:Le.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function h0(e,t,n,r){var i={_event:n},o=Le.toSCXMLEvent(Le.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Le.isString(e.delay)){var s=r&&r[e.delay];a=Le.isFunction(s)?s(t,n.data,i):s}else a=Le.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return Xe.__assign(Xe.__assign({},e),{type:an.raise,_event:o,delay:a})}function Ru(e,t){return{to:t?t.to:void 0,type:an.send,event:Le.isFunction(e)?e:Le.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Le.isFunction(e)?e.name:Le.getEventType(e)}}function v0(e,t,n,r){var i={_event:n},o=Le.toSCXMLEvent(Le.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Le.isString(e.delay)){var s=r&&r[e.delay];a=Le.isFunction(s)?s(t,n.data,i):s}else a=Le.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=Le.isFunction(e.to)?e.to(t,n.data,i):e.to;return Xe.__assign(Xe.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function Av(e,t){return Ru(e,Xe.__assign(Xe.__assign({},t),{to:pr.SpecialTargets.Parent}))}function Wj(e,t,n){return Ru(t,Xe.__assign(Xe.__assign({},n),{to:e}))}function Hj(){return Av(an.update)}function Kj(e,t){return Ru(e,Xe.__assign(Xe.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var Yj=function(e,t){return{context:e,event:t}};function Jj(e,t){return e===void 0&&(e=Yj),{type:an.log,label:t,expr:e}}var m0=function(e,t,n){return Xe.__assign(Xe.__assign({},e),{value:Le.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},Xj=function(e){return{type:an.cancel,sendId:e}};function Qj(e){var t=Iv(e);return{type:pr.ActionTypes.Start,activity:t,exec:void 0}}function Zj(e){var t=Le.isFunction(e)?e:Iv(e);return{type:pr.ActionTypes.Stop,activity:t,exec:void 0}}function y0(e,t,n){var r=Le.isFunction(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:pr.ActionTypes.Stop,activity:i};return o}var e_=function(e){return{type:an.assign,assignment:e}};function t_(e){return typeof e=="object"&&"type"in e}function n_(e,t){var n=t?"#".concat(t):"";return"".concat(pr.ActionTypes.After,"(").concat(e,")").concat(n)}function r_(e,t){var n="".concat(pr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function i_(e,t){var n="".concat(pr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function o_(e,t){var n="".concat(pr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function a_(e){return{type:pr.ActionTypes.Pure,get:e}}function s_(e,t){if(!p0.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,Xe.__spreadArray([],Xe.__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 Ru(function(r,i){return i},Xe.__assign(Xe.__assign({},t),{to:e}))}function u_(e,t){return Av(function(n,r,i){return{type:an.error,data:Le.isFunction(e)?e(n,r,i):e}},Xe.__assign(Xe.__assign({},t),{to:pr.SpecialTargets.Parent}))}function l_(e){return{type:pr.ActionTypes.Choose,conds:e}}var c_=function(e){var t,n,r=[];try{for(var i=Xe.__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===an.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 Ap(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:c_(i),u=s.length?Le.updateContext(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case an.raise:{var C=h0(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case an.send:var m=v0(v,u,r,e.options.delays);if(!p0.IS_PRODUCTION){var b=v.delay;Le.warn(!Le.isString(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==pr.SpecialTargets.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case an.log:{var x=m0(v,u,r);return o==null||o(x,u,r),x}case an.choose:{var T=v,E=(g=T.conds.find(function(B){var G=Le.toGuard(B.cond,e.options.guards);return!G||Le.evaluateGuard(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=Xe.__read(Ap(e,t,u,r,[{type:p,actions:Ip(Le.toArray(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case an.pure:{var E=v.get(u,r.data);if(!E)return[];var P=Xe.__read(Ap(e,t,u,r,[{type:p,actions:Ip(Le.toArray(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case an.stop:{var x=y0(v,u,r);return o==null||o(x,n,r),x}case an.assign:{u=Le.updateContext(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=vf(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=Xe.__assign(Xe.__assign({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,Xe.__spreadArray([l[k]],Xe.__read(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Xe.__values(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=Le.flatten(i.map(d));return[h,u]}it.actionTypes=an;it.after=n_;it.assign=e_;it.cancel=Xj;it.choose=l_;it.done=r_;it.doneInvoke=i_;it.error=o_;it.escalate=u_;it.forwardTo=s_;it.getActionFunction=Ep;it.initEvent=Gj;it.isActionObject=t_;var Wn=it.log=Jj,f_=it.pure=a_;it.raise=zj;it.resolveActions=Ap;it.resolveLog=m0;it.resolveRaise=h0;it.resolveSend=v0;it.resolveStop=y0;it.respond=Kj;it.send=Ru;it.sendParent=Av;it.sendTo=Wj;it.sendUpdate=Hj;it.start=Qj;var Py=it.stop=Zj;it.toActionObject=vf;it.toActionObjects=Ip;it.toActivityDefinition=Iv;function g0(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function mf(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 b0(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 Ry(e){return e.constructor===Object||e.constructor==null}function ky(e){return typeof e.then=="function"}function yf(e,t){return e===t||e!==e&&t!==t}var d_="[object Arguments]",p_="[object Boolean]",h_="[object Date]",v_="[object RegExp]",m_="[object Map]",y_="[object Number]",g_="[object Object]",b_="[object Set]",S_="[object String]",My=Object.prototype.toString;function gf(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(l);function l(c,f,d){if(c===f)return!0;if(!c||!f||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;if(Ry(c)&&Ry(f))return i(c,f,u,d);var h=Array.isArray(c),p=Array.isArray(f);if(h||p)return h===p&&t(c,f,u,d);var v=My.call(c);return v!==My.call(f)?!1:v===h_?n(c,f,u,d):v===v_?o(c,f,u,d):v===m_?r(c,f,u,d):v===b_?a(c,f,u,d):v===g_||v===d_?ky(c)||ky(f)?!1:i(c,f,u,d):v===p_||v===y_||v===S_?yf(c.valueOf(),f.valueOf()):!1}return l}function S0(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 C_=mf(S0);function C0(e,t){return yf(e.valueOf(),t.valueOf())}function w0(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 l=!1,c=0;t.forEach(function(f,d){!l&&!o[c]&&(l=n(u,d,a,c,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[c]=!0),c++}),a++,i=l}}),i}var w_=mf(w0),x_="_owner",T_=Object.prototype.hasOwnProperty;function x0(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===x_){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!T_.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var E_=mf(x0);function T0(e,t){return e.source===t.source&&e.flags===t.flags}function E0(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,l=0;t.forEach(function(c,f){!u&&!o[l]&&(u=n(a,c,s,f,e,t,r))&&(o[l]=!0),l++}),i=u}}),i}var I_=mf(E0),I0=Object.freeze({areArraysEqual:S0,areDatesEqual:C0,areMapsEqual:w0,areObjectsEqual:x0,areRegExpsEqual:T0,areSetsEqual:E0,createIsNestedEqual:g0}),A0=Object.freeze({areArraysEqual:C_,areDatesEqual:C0,areMapsEqual:w_,areObjectsEqual:E_,areRegExpsEqual:T0,areSetsEqual:I_,createIsNestedEqual:g0}),A_=gf(I0);function $_(e,t){return A_(e,t,void 0)}gf(b0(I0,{createIsNestedEqual:function(){return yf}}));gf(A0);gf(b0(A0,{createIsNestedEqual:function(){return yf}}));var $p={exports:{}},Uf={},al={exports:{}},Gf={};/**
|
|
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!==Nt.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 jy;function O_(){if(jy)return Gf;jy=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 h=d(),p=r({inst:{value:h,getSnapshot:d}}),v=p[0].inst,g=p[1];return o(function(){v.value=h,v.getSnapshot=d,u(v)&&g({inst:v})},[f,h,d]),i(function(){return u(v)&&g({inst:v}),f(function(){u(v)&&g({inst:v})})},[f]),a(h),h}function u(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function l(f,d){return d()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:s;return Gf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,Gf}var zf={};/**
|
|
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!==Nt.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 _y;function D_(){return _y||(_y=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(b){{for(var x=arguments.length,T=new Array(x>1?x-1:0),E=1;E<x;E++)T[E-1]=arguments[E];r("error",b,T)}}function r(b,x,T){{var E=t.ReactDebugCurrentFrame,A=E.getStackAddendum();A!==""&&(x+="%s",T=T.concat([A]));var N=T.map(function(I){return String(I)});N.unshift("Warning: "+x),Function.prototype.apply.call(console[b],console,N)}}function i(b,x){return b===x&&(b!==0||1/b===1/x)||b!==b&&x!==x}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue,c=!1,f=!1;function d(b,x,T){c||e.startTransition!==void 0&&(c=!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 E=x();if(!f){var A=x();o(E,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var N=a({inst:{value:E,getSnapshot:x}}),I=N[0].inst,P=N[1];return u(function(){I.value=E,I.getSnapshot=x,h(I)&&P({inst:I})},[b,E,x]),s(function(){h(I)&&P({inst:I});var _=function(){h(I)&&P({inst:I})};return b(_)},[b]),l(E),E}function h(b){var x=b.getSnapshot,T=b.value;try{var E=x();return!o(T,E)}catch{return!0}}function p(b,x,T){return x()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!v,C=g?p:d,m=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:C;zf.useSyncExternalStore=m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),zf}var qy;function $0(){return qy||(qy=1,process.env.NODE_ENV==="production"?al.exports=O_():al.exports=D_()),al.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!==Nt.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 Fy;function N_(){if(Fy)return Uf;Fy=1;var e=O,t=$0();function n(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}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 Uf.useSyncExternalStoreWithSelector=function(l,c,f,d,h){var p=o(null);if(p.current===null){var v={hasValue:!1,value:null};p.current=v}else v=p.current;p=s(function(){function C(E){if(!m){if(m=!0,b=E,E=d(E),h!==void 0&&v.hasValue){var A=v.value;if(h(A,E))return x=A}return x=E}if(A=x,r(b,E))return A;var N=d(E);return h!==void 0&&h(A,N)?A:(b=E,x=N)}var m=!1,b,x,T=f===void 0?null:f;return[function(){return C(c())},T===null?void 0:function(){return C(T())}]},[c,f,d,h]);var g=i(l,p[0],p[1]);return a(function(){v.hasValue=!0,v.value=g},[g]),u(g),g},Uf}var Wf={};/**
|
|
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!==Nt.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 Fy;function $_(){return Fy||(Fy=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=I0();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&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 l(c,f,d,h,p){var v=o(null),g;v.current===null?(g={hasValue:!1,value:null},v.current=g):g=v.current;var C=s(function(){var T=!1,E,A,N=function(L){if(!T){T=!0,E=L;var U=h(L);if(p!==void 0&&g.hasValue){var Y=g.value;if(p(Y,U))return A=Y,Y}return A=U,U}var k=E,ie=A;if(r(k,L))return ie;var B=h(L);return p!==void 0&&p(ie,B)?ie:(E=L,A=B,B)},I=d===void 0?null:d,P=function(){return N(f())},_=I===null?void 0:function(){return N(I())};return[P,_]},[f,d,h,p]),m=C[0],b=C[1],x=i(c,m,b);return a(function(){g.hasValue=!0,g.value=x},[x]),u(x),x}Wf.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Wf}process.env.NODE_ENV==="production"?$p.exports=A_():$p.exports=$_();var O_=$p.exports,D_=O.useLayoutEffect;function Ly(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var dc=globalThis&&globalThis.__assign||function(){return dc=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},dc.apply(this,arguments)},N_=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},P_=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 R_(e,t){var n=Ly(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=P_(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,l=t.services,c=t.delays;t.state;var f=N_(t,["context","guards","actions","activities","services","delays","state"]),d=Ly(function(){var h={context:o,guards:a,actions:s,activities:u,services:l,delays:c},p=n.withConfig(h,function(){return dc(dc({},n.context),o)});return u0(p,f)});return D_(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,l),Object.assign(d.machine.options.delays,c)},[s,a,u,l,c]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function k_(e,t,n){if(e.status===Nt.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var M_=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 j_(e){return e}function __(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=M_(t,1),i=r[0],o=i===void 0?{}:i,a=R_(e,o),s=O.useCallback(function(){return a.status===Nt.NotStarted?o.state?ir.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return k_(a,f,d)},[a]),l=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),c=O_.useSyncExternalStoreWithSelector(l,s,s,j_,u);return O.useEffect(function(){var f=o.state;return a.start(f?ir.create(f):void 0),function(){a.stop(),a.status=Nt.NotStarted}},[]),[c,a.send,a]}const ku=window.configuratorReactContexts??{ConfigurationSessionContext:O.createContext(null),ConfigurationInitializationContext:O.createContext(null),ConfigurationUpdatingContext:O.createContext(null),ConfigurationContext:O.createContext(null)};window.configuratorReactContexts=ku;const A0=ku.ConfigurationSessionContext,$0=ku.ConfigurationInitializationContext,q_=ku.ConfigurationUpdatingContext,O0=ku.ConfigurationContext,Ov=()=>O.useContext(A0),es=()=>O.useContext(O0),D0="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 Dv(e){if(!e)throw new Error(D0)}function ts(e){if(!e)throw new Error(D0)}function ai(){const e=Ov();return Dv(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var F_=function(e){return e._tag==="Some"},bf=function(e){return function(t){return F_(e(t))}};const L_=bf(e=>e.type===V.Choice?De(e):me),V_=bf(e=>e.type===V.Numeric?De(e):me),B_=bf(e=>e.type===V.Boolean?De(e):me),U_=bf(e=>e.type===V.Component?De(e):me);function Sf(e){return e.decision!=null&&e.decision.kind===Se.Explicit}function N0(e){return y(e.values,Vt(Sf),z(t=>({type:V.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function G_(e){return y(e,Ou(Sf),K(()=>({type:V.Numeric,attributeId:e.id,state:null})))}function z_(e){return y(e,Ou(Sf),K(()=>({type:V.Boolean,attributeId:e.id,state:null})))}function W_(e){return y(e,Ou(Sf),K(()=>({type:V.Component,attributeId:e.id,state:null})))}function H_(e,t){return y(Xa.filterAttributesOfComponent(t,e,!0),n=>[y(n,Vt(L_),ew(N0)),y(n,Vt(V_),z(G_),qn),y(n,Vt(B_),z(z_),qn),y(n,Vt(U_),z(W_),qn)],Ha)}function P0(){const e=Ov();return Dv(e),O.useMemo(()=>({explain:(t,n)=>H(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 ns(e,t=!1){const n=es();return ts(n),O.useMemo(()=>y(ye(e),K(Ln(z(r=>Xa.getAttribute(n,r)),t?Vo(ye):jr)),Qe(()=>n.attributes)),[e,n,t])}function rs(e){const t=es(),{makeDecision:n,setManyDecision:r}=ai(),i=Cf(e,Ue.choiceValue);ts(t);const o=Xa.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,l)=>n({type:V.Choice,attributeId:e,choiceValueId:u,state:l}),clearDecisions:y(o,ye,K(N0),Mt(Wa),K(u=>()=>r(u,{type:"Default"})),Qe(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function K_(e){const t=es(),{makeDecision:n}=ai(),r=Cf(e,Ue.numeric);ts(t);const i=Xa.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:V.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function Y_(e){const t=es(),{makeDecision:n}=ai(),r=Cf(e,Ue.boolean);ts(t);const i=Xa.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:V.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function J_(e){const t=es(),{makeDecision:n,setManyDecision:r}=ai(),i=Cf(e,Ue.component);ts(t);const o=t.attributes,a=Xa.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:l=>n({type:V.Component,attributeId:e,state:l}),clearSubtree:y(H_(e,o),Ou(Wa),K(l=>()=>r(l,{type:"Default"})),Qe(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function Cf(e,t){const{explain:n,applySolution:r}=P0();return O.useMemo(()=>({explain:(i,o)=>{const a=H(i.question).with(Ft.whyIsNotSatisfied,()=>Ue.attribute).otherwise(()=>t),s={...i,subject:a,attributeId:e};return H(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 Vy=An(Nu),X_=An(yM),Q_=An((e,t)=>hw(ot).equals(e??{},t??{})),Z_=Sn({attributeId:Vy,decisions:Ki(Vy)}),eq=An((e,t)=>Ki(Z_).equals(e??[],t??[])),tq=Sn({type:ot}),nq=Sn({type:ot}),rq=Sn({type:ot,rules:Ki(X_)}),iq=An((e,t)=>H({x:e,y:t}).returnType().with({x:{type:hn.all},y:{type:hn.all}},({x:n,y:r})=>tq.equals(n,r)).with({x:{type:hn.none},y:{type:hn.none}},({x:n,y:r})=>nq.equals(n,r)).with({x:{type:hn.specific},y:{type:hn.specific}},({x:n,y:r})=>rq.equals(n,r)).otherwise(()=>!1)),oq=Sn({rules:lf(iq)}),R0=Sn({configurationModelSource:An((e,t)=>T_(e,t)),attributeRelations:eq,usageRuleParameters:Q_,allowedInExplain:lf(oq)}),Op=lf(R0),aq=ev,_l=lf(aq),sq=()=>Ev({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:[Wn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Wn("Entering ProcessChanges","SessionManagement:"),Qo(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Wn("Entering DisposeSession","SessionManagement:"),Qo(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Wn("Entering CreateSession","SessionManagement:"),Qo(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Wn("Entering SessionCreationFailed","SessionManagement:"),Qo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Wn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Wn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Wn("Entering UpdateSession","SessionManagement:"),Qo(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Wn("Entering SessionUpdateFailed","SessionManagement:"),Qo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Wn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Wn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:kn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:kn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:kn((e,t)=>(e.session&&e.session.close().then(Ur).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:kn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:kn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:kn({sessionCreationError:()=>null}),setSessionUpdateError:kn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:kn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:kn({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:e=>e.desiredClient.createSession(e.desiredSessionContext).then(t=>({session:t,client:e.desiredClient})).catch(t=>Promise.reject({failureResult:t,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({failureResult:t,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!_l.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!R0.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!_l.equals(e.desiredClient,e.sessionCreationError.client)||!Op.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!_l.equals(e.desiredClient,e.actualClient)||!Op.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Qo(e){const t=e===0,n=e===1;return s_((r,i)=>{const o={isInitializing:(!r.hasEverSuccessfullyCreatedSession||t)&&r.sessionCreationError==null,failureResult:r.sessionCreationError&&r.sessionCreationError.failureResult},a={isUpdating:n&&r.sessionUpdateError==null,failureResult:r.sessionUpdateError&&r.sessionUpdateError.failureResult};return l0({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const uq=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),lq=()=>Ev({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[l0((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Wn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Wn("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)=>uq(e.session)}}}},{actions:{saveSession:kn((e,t)=>({session:t.session}))}}),cq=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},By=()=>{const e=cq();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var fq=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]},Uy=function(e,t,n,r){return O.useEffect(e,fq(t,n,r))};const dq=()=>Ev({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:By()},entry:[kn({sessionManagementActor:()=>Oy(sq()),configurationSubscriptionManagementActor:()=>Oy(lq())})],exit:[Ny(e=>e.sessionManagementActor),Ny(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[ol(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[ol(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[ol(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[ol(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[kn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),mj(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[kn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:kn((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:By())()}})}});function pq(e){var t,n;const[r,i]=__(dq,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});Uy(()=>{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],sy(_l)),Uy(()=>{const u=y(ye(e.sessionContext),mP(l=>ye(l.configurationModelSource)),Mn);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],sy(Op));const o=O.useMemo(()=>{var u,l,c,f;return{isInitializing:((l=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:l.promise)!=null,isInitializingPromise:(c=r.context.isReadyPromise)==null?void 0:c.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.failureResult)&&{...r.context.sessionInitialization.failureResult,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,l;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((l=r.context.sessionUpdating)==null?void 0:l.failureResult)&&{...r.context.sessionUpdating.failureResult,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 hq(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=pq({configuratorClient:t,sessionContext:n});return $.jsx($0.Provider,{value:r,children:$.jsx(q_.Provider,{value:i,children:$.jsx(A0.Provider,{value:o,children:$.jsx(O0.Provider,{value:a,children:e.children})})})})}function Nv(){return O.useContext($0)}function vq(e){const{children:t}=e,{isInitializingPromise:n}=Nv();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function Pv(){const e=Ov(),t=es();return Dv(e),ts(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const mq=O.createContext(null),Hf={didCatch:!1,error:null};class yq extends O.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Hf}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(Hf)}}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&&gq(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(Hf)}}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(mq.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function gq(){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 In=function(){return In=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},In.apply(this,arguments)};function bq(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 Oo(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 Sq(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Cq=/^((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)-.*))$/,wq=Sq(function(e){return Cq.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),bt="-ms-",qs="-moz-",ut="-webkit-",k0="comm",wf="rule",Rv="decl",xq="@import",M0="@keyframes",Tq="@layer",Eq=Math.abs,kv=String.fromCharCode,Dp=Object.assign;function Iq(e,t){return rn(e,0)^45?(((t<<2^rn(e,0))<<2^rn(e,1))<<2^rn(e,2))<<2^rn(e,3):0}function j0(e){return e.trim()}function Lr(e,t){return(e=t.exec(e))?e[0]:e}function Me(e,t,n){return e.replace(t,n)}function ql(e,t){return e.indexOf(t)}function rn(e,t){return e.charCodeAt(t)|0}function Ta(e,t,n){return e.slice(t,n)}function Dr(e){return e.length}function _0(e){return e.length}function Ds(e,t){return t.push(e),e}function Aq(e,t){return e.map(t).join("")}function Gy(e,t){return e.filter(function(n){return!Lr(n,t)})}var xf=1,Ea=1,q0=0,lr=0,Ht=0,is="";function Tf(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:xf,column:Ea,length:a,return:"",siblings:s}}function Ci(e,t){return Dp(Tf("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Zo(e){for(;e.root;)e=Ci(e.root,{children:[e]});Ds(e,e.siblings)}function $q(){return Ht}function Oq(){return Ht=lr>0?rn(is,--lr):0,Ea--,Ht===10&&(Ea=1,xf--),Ht}function wr(){return Ht=lr<q0?rn(is,lr++):0,Ea++,Ht===10&&(Ea=1,xf++),Ht}function bo(){return rn(is,lr)}function Fl(){return lr}function Ef(e,t){return Ta(is,e,t)}function Np(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 Dq(e){return xf=Ea=1,q0=Dr(is=e),lr=0,[]}function Nq(e){return is="",e}function Kf(e){return j0(Ef(lr-1,Pp(e===91?e+2:e===40?e+1:e)))}function Pq(e){for(;(Ht=bo())&&Ht<33;)wr();return Np(e)>2||Np(Ht)>3?"":" "}function Rq(e,t){for(;--t&&wr()&&!(Ht<48||Ht>102||Ht>57&&Ht<65||Ht>70&&Ht<97););return Ef(e,Fl()+(t<6&&bo()==32&&wr()==32))}function Pp(e){for(;wr();)switch(Ht){case e:return lr;case 34:case 39:e!==34&&e!==39&&Pp(Ht);break;case 40:e===41&&Pp(e);break;case 92:wr();break}return lr}function kq(e,t){for(;wr()&&e+Ht!==47+10;)if(e+Ht===42+42&&bo()===47)break;return"/*"+Ef(t,lr-1)+"*"+kv(e===47?e:wr())}function Mq(e){for(;!Np(bo());)wr();return Ef(e,lr)}function jq(e){return Nq(Ll("",null,null,null,[""],e=Dq(e),0,[0],e))}function Ll(e,t,n,r,i,o,a,s,u){for(var l=0,c=0,f=a,d=0,h=0,p=0,v=1,g=1,C=1,m=0,b="",x=i,T=o,E=r,A=b;g;)switch(p=m,m=wr()){case 40:if(p!=108&&rn(A,f-1)==58){ql(A+=Me(Kf(m),"&","&\f"),"&\f")!=-1&&(C=-1);break}case 34:case 39:case 91:A+=Kf(m);break;case 9:case 10:case 13:case 32:A+=Pq(p);break;case 92:A+=Rq(Fl()-1,7);continue;case 47:switch(bo()){case 42:case 47:Ds(_q(kq(wr(),Fl()),t,n,u),u);break;default:A+="/"}break;case 123*v:s[l++]=Dr(A)*C;case 125*v:case 59:case 0:switch(m){case 0:case 125:g=0;case 59+c:C==-1&&(A=Me(A,/\f/g,"")),h>0&&Dr(A)-f&&Ds(h>32?Wy(A+";",r,n,f-1,u):Wy(Me(A," ","")+";",r,n,f-2,u),u);break;case 59:A+=";";default:if(Ds(E=zy(A,t,n,l,c,i,s,b,x=[],T=[],f,o),o),m===123)if(c===0)Ll(A,t,E,E,x,o,f,s,T);else switch(d===99&&rn(A,3)===110?100:d){case 100:case 108:case 109:case 115:Ll(e,E,E,r&&Ds(zy(e,E,E,0,0,i,s,b,i,x=[],f,T),T),i,T,f,s,r?x:T);break;default:Ll(A,E,E,E,[""],T,0,s,T)}}l=c=h=0,v=C=1,b=A="",f=a;break;case 58:f=1+Dr(A),h=p;default:if(v<1){if(m==123)--v;else if(m==125&&v++==0&&Oq()==125)continue}switch(A+=kv(m),m*v){case 38:C=c>0?1:(A+="\f",-1);break;case 44:s[l++]=(Dr(A)-1)*C,C=1;break;case 64:bo()===45&&(A+=Kf(wr())),d=bo(),c=f=Dr(b=A+=Mq(Fl())),m++;break;case 45:p===45&&Dr(A)==2&&(v=0)}}return o}function zy(e,t,n,r,i,o,a,s,u,l,c,f){for(var d=i-1,h=i===0?o:[""],p=_0(h),v=0,g=0,C=0;v<r;++v)for(var m=0,b=Ta(e,d+1,d=Eq(g=a[v])),x=e;m<p;++m)(x=j0(g>0?h[m]+" "+b:Me(b,/&\f/g,h[m])))&&(u[C++]=x);return Tf(e,t,n,i===0?wf:s,u,l,c,f)}function _q(e,t,n,r){return Tf(e,t,n,k0,kv($q()),Ta(e,2,-2),0,r)}function Wy(e,t,n,r,i){return Tf(e,t,n,Rv,Ta(e,0,r),Ta(e,r+1,-1),r,i)}function F0(e,t,n){switch(Iq(e,t)){case 5103:return ut+"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 ut+e+e;case 4789:return qs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ut+e+qs+e+bt+e+e;case 5936:switch(rn(e,t+11)){case 114:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return ut+e+bt+e+e;case 6165:return ut+e+bt+"flex-"+e+e;case 5187:return ut+e+Me(e,/(\w+).+(:[^]+)/,ut+"box-$1$2"+bt+"flex-$1$2")+e;case 5443:return ut+e+bt+"flex-item-"+Me(e,/flex-|-self/g,"")+(Lr(e,/flex-|baseline/)?"":bt+"grid-row-"+Me(e,/flex-|-self/g,""))+e;case 4675:return ut+e+bt+"flex-line-pack"+Me(e,/align-content|flex-|-self/g,"")+e;case 5548:return ut+e+bt+Me(e,"shrink","negative")+e;case 5292:return ut+e+bt+Me(e,"basis","preferred-size")+e;case 6060:return ut+"box-"+Me(e,"-grow","")+ut+e+bt+Me(e,"grow","positive")+e;case 4554:return ut+Me(e,/([^-])(transform)/g,"$1"+ut+"$2")+e;case 6187:return Me(Me(Me(e,/(zoom-|grab)/,ut+"$1"),/(image-set)/,ut+"$1"),e,"")+e;case 5495:case 3959:return Me(e,/(image-set\([^]*)/,ut+"$1$`$1");case 4968:return Me(Me(e,/(.+:)(flex-)?(.*)/,ut+"box-pack:$3"+bt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ut+e+e;case 4200:if(!Lr(e,/flex-|baseline/))return bt+"grid-column-align"+Ta(e,t)+e;break;case 2592:case 3360:return bt+Me(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,Lr(r.props,/grid-\w+-end/)})?~ql(e+(n=n[t].value),"span")?e:bt+Me(e,"-start","")+e+bt+"grid-row-span:"+(~ql(n,"span")?Lr(n,/\d+/):+Lr(n,/\d+/)-+Lr(e,/\d+/))+";":bt+Me(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Lr(r.props,/grid-\w+-start/)})?e:bt+Me(Me(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Me(e,/(.+)-inline(.+)/,ut+"$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(Dr(e)-1-t>6)switch(rn(e,t+1)){case 109:if(rn(e,t+4)!==45)break;case 102:return Me(e,/(.+:)(.+)-([^]+)/,"$1"+ut+"$2-$3$1"+qs+(rn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ql(e,"stretch")?F0(Me(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Me(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,u,l){return bt+i+":"+o+l+(a?bt+i+"-span:"+(s?u:+u-+o)+l:"")+e});case 4949:if(rn(e,t+6)===121)return Me(e,":",":"+ut)+e;break;case 6444:switch(rn(e,rn(e,14)===45?18:11)){case 120:return Me(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ut+(rn(e,14)===45?"inline-":"")+"box$3$1"+ut+"$2$3$1"+bt+"$2box$3")+e;case 100:return Me(e,":",":"+bt)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Me(e,"scroll-","scroll-snap-")+e}return e}function pc(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function qq(e,t,n,r){switch(e.type){case Tq:if(e.children.length)break;case xq:case Rv:return e.return=e.return||e.value;case k0:return"";case M0:return e.return=e.value+"{"+pc(e.children,r)+"}";case wf:if(!Dr(e.value=e.props.join(",")))return""}return Dr(n=pc(e.children,r))?e.return=e.value+"{"+n+"}":""}function Fq(e){var t=_0(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 Lq(e){return function(t){t.root||(t=t.return)&&e(t)}}function Vq(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Rv:e.return=F0(e.value,e.length,n);return;case M0:return pc([Ci(e,{value:Me(e.value,"@","@"+ut)})],r);case wf:if(e.length)return Aq(n=e.props,function(i){switch(Lr(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Zo(Ci(e,{props:[Me(i,/:(read-\w+)/,":"+qs+"$1")]})),Zo(Ci(e,{props:[i]})),Dp(e,{props:Gy(n,r)});break;case"::placeholder":Zo(Ci(e,{props:[Me(i,/:(plac\w+)/,":"+ut+"input-$1")]})),Zo(Ci(e,{props:[Me(i,/:(plac\w+)/,":"+qs+"$1")]})),Zo(Ci(e,{props:[Me(i,/:(plac\w+)/,bt+"input-$1")]})),Zo(Ci(e,{props:[i]})),Dp(e,{props:Gy(n,r)});break}return""})}}var Bq={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},Do=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Mv=typeof window<"u"&&"HTMLElement"in window,Uq=!!(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"),Gq={},Hy=/invalid hook call/i,sl=new Set,L0=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.
|
|
133
|
+
*/var Ly;function P_(){return Ly||(Ly=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=$0();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&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 l(c,f,d,h,p){var v=o(null),g;v.current===null?(g={hasValue:!1,value:null},v.current=g):g=v.current;var C=s(function(){var T=!1,E,A,N=function(L){if(!T){T=!0,E=L;var U=h(L);if(p!==void 0&&g.hasValue){var Y=g.value;if(p(Y,U))return A=Y,Y}return A=U,U}var k=E,ie=A;if(r(k,L))return ie;var B=h(L);return p!==void 0&&p(ie,B)?ie:(E=L,A=B,B)},I=d===void 0?null:d,P=function(){return N(f())},_=I===null?void 0:function(){return N(I())};return[P,_]},[f,d,h,p]),m=C[0],b=C[1],x=i(c,m,b);return a(function(){g.hasValue=!0,g.value=x},[x]),u(x),x}Wf.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Wf}process.env.NODE_ENV==="production"?$p.exports=N_():$p.exports=P_();var R_=$p.exports,k_=O.useLayoutEffect;function Vy(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var dc=globalThis&&globalThis.__assign||function(){return dc=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},dc.apply(this,arguments)},M_=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},j_=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 __(e,t){var n=Vy(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=j_(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,l=t.services,c=t.delays;t.state;var f=M_(t,["context","guards","actions","activities","services","delays","state"]),d=Vy(function(){var h={context:o,guards:a,actions:s,activities:u,services:l,delays:c},p=n.withConfig(h,function(){return dc(dc({},n.context),o)});return c0(p,f)});return k_(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,l),Object.assign(d.machine.options.delays,c)},[s,a,u,l,c]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function q_(e,t,n){if(e.status===Nt.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var F_=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 L_(e){return e}function V_(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=F_(t,1),i=r[0],o=i===void 0?{}:i,a=__(e,o),s=O.useCallback(function(){return a.status===Nt.NotStarted?o.state?ir.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return q_(a,f,d)},[a]),l=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),c=R_.useSyncExternalStoreWithSelector(l,s,s,L_,u);return O.useEffect(function(){var f=o.state;return a.start(f?ir.create(f):void 0),function(){a.stop(),a.status=Nt.NotStarted}},[]),[c,a.send,a]}const ku=window.configuratorReactContexts??{ConfigurationSessionContext:O.createContext(null),ConfigurationInitializationContext:O.createContext(null),ConfigurationUpdatingContext:O.createContext(null),ConfigurationContext:O.createContext(null)};window.configuratorReactContexts=ku;const O0=ku.ConfigurationSessionContext,D0=ku.ConfigurationInitializationContext,B_=ku.ConfigurationUpdatingContext,N0=ku.ConfigurationContext,$v=()=>O.useContext(O0),es=()=>O.useContext(N0),P0="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 Ov(e){if(!e)throw new Error(P0)}function ts(e){if(!e)throw new Error(P0)}function si(){const e=$v();return Ov(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var U_=function(e){return e._tag==="Some"},bf=function(e){return function(t){return U_(e(t))}};const G_=bf(e=>e.type===V.Choice?De(e):me),z_=bf(e=>e.type===V.Numeric?De(e):me),W_=bf(e=>e.type===V.Boolean?De(e):me),H_=bf(e=>e.type===V.Component?De(e):me);function Sf(e){return e.decision!=null&&e.decision.kind===Se.Explicit}function R0(e){return y(e.values,Vt(Sf),z(t=>({type:V.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function K_(e){return y(e,Ou(Sf),K(()=>({type:V.Numeric,attributeId:e.id,state:null})))}function Y_(e){return y(e,Ou(Sf),K(()=>({type:V.Boolean,attributeId:e.id,state:null})))}function J_(e){return y(e,Ou(Sf),K(()=>({type:V.Component,attributeId:e.id,state:null})))}function X_(e,t){return y(Xa.filterAttributesOfComponent(t,e,!0),n=>[y(n,Vt(G_),nw(R0)),y(n,Vt(z_),z(K_),qn),y(n,Vt(W_),z(Y_),qn),y(n,Vt(H_),z(J_),qn)],Ha)}function k0(){const e=$v();return Ov(e),O.useMemo(()=>({explain:(t,n)=>H(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 ns(e,t=!1){const n=es();return ts(n),O.useMemo(()=>y(ye(e),K(Ln(z(r=>Xa.getAttribute(n,r)),t?Vo(ye):_r)),Qe(()=>n.attributes)),[e,n,t])}function rs(e){const t=es(),{makeDecision:n,setManyDecision:r}=si(),i=Cf(e,Ue.choiceValue);ts(t);const o=Xa.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,l)=>n({type:V.Choice,attributeId:e,choiceValueId:u,state:l}),clearDecisions:y(o,ye,K(R0),Mt(Wa),K(u=>()=>r(u,{type:"Default"})),Qe(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function M0(e){const t=es(),{makeDecision:n}=si(),r=Cf(e,Ue.numeric);ts(t);const i=Xa.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:V.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function Q_(e){const t=es(),{makeDecision:n}=si(),r=Cf(e,Ue.boolean);ts(t);const i=Xa.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:V.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function Z_(e){const t=es(),{makeDecision:n,setManyDecision:r}=si(),i=Cf(e,Ue.component);ts(t);const o=t.attributes,a=Xa.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:l=>n({type:V.Component,attributeId:e,state:l}),clearSubtree:y(X_(e,o),Ou(Wa),K(l=>()=>r(l,{type:"Default"})),Qe(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function Cf(e,t){const{explain:n,applySolution:r}=k0();return O.useMemo(()=>({explain:(i,o)=>{const a=H(i.question).with(Ft.whyIsNotSatisfied,()=>Ue.attribute).otherwise(()=>t),s={...i,subject:a,attributeId:e};return H(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 By=An(Nu),eq=An(CM),tq=An((e,t)=>mw(ot).equals(e??{},t??{})),nq=Sn({attributeId:By,decisions:Ki(By)}),rq=An((e,t)=>Ki(nq).equals(e??[],t??[])),iq=Sn({type:ot}),oq=Sn({type:ot}),aq=Sn({type:ot,rules:Ki(eq)}),sq=An((e,t)=>H({x:e,y:t}).returnType().with({x:{type:vn.all},y:{type:vn.all}},({x:n,y:r})=>iq.equals(n,r)).with({x:{type:vn.none},y:{type:vn.none}},({x:n,y:r})=>oq.equals(n,r)).with({x:{type:vn.specific},y:{type:vn.specific}},({x:n,y:r})=>aq.equals(n,r)).otherwise(()=>!1)),uq=Sn({rules:lf(sq)}),j0=Sn({configurationModelSource:An((e,t)=>$_(e,t)),attributeRelations:rq,usageRuleParameters:tq,allowedInExplain:lf(uq)}),Op=lf(j0),lq=Zh,_l=lf(lq),cq=()=>Tv({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:[Wn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Wn("Entering ProcessChanges","SessionManagement:"),Qo(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Wn("Entering DisposeSession","SessionManagement:"),Qo(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Wn("Entering CreateSession","SessionManagement:"),Qo(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Wn("Entering SessionCreationFailed","SessionManagement:"),Qo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Wn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Wn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Wn("Entering UpdateSession","SessionManagement:"),Qo(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Wn("Entering SessionUpdateFailed","SessionManagement:"),Qo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Wn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Wn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:kn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:kn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:kn((e,t)=>(e.session&&e.session.close().then(Gr).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:kn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:kn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:kn({sessionCreationError:()=>null}),setSessionUpdateError:kn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:kn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:kn({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:e=>e.desiredClient.createSession(e.desiredSessionContext).then(t=>({session:t,client:e.desiredClient})).catch(t=>Promise.reject({failureResult:t,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({failureResult:t,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!_l.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!j0.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!_l.equals(e.desiredClient,e.sessionCreationError.client)||!Op.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!_l.equals(e.desiredClient,e.actualClient)||!Op.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Qo(e){const t=e===0,n=e===1;return f_((r,i)=>{const o={isInitializing:(!r.hasEverSuccessfullyCreatedSession||t)&&r.sessionCreationError==null,failureResult:r.sessionCreationError&&r.sessionCreationError.failureResult},a={isUpdating:n&&r.sessionUpdateError==null,failureResult:r.sessionUpdateError&&r.sessionUpdateError.failureResult};return f0({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const fq=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),dq=()=>Tv({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[f0((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Wn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Wn("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)=>fq(e.session)}}}},{actions:{saveSession:kn((e,t)=>({session:t.session}))}}),pq=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},Uy=()=>{const e=pq();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var hq=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]},Gy=function(e,t,n,r){return O.useEffect(e,hq(t,n,r))};const vq=()=>Tv({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:Uy()},entry:[kn({sessionManagementActor:()=>Dy(cq()),configurationSubscriptionManagementActor:()=>Dy(dq())})],exit:[Py(e=>e.sessionManagementActor),Py(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[ol(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[ol(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[ol(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[ol(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[kn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),Sj(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[kn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:kn((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:Uy())()}})}});function mq(e){var t,n;const[r,i]=V_(vq,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});Gy(()=>{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],uy(_l)),Gy(()=>{const u=y(ye(e.sessionContext),SP(l=>ye(l.configurationModelSource)),Mn);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],uy(Op));const o=O.useMemo(()=>{var u,l,c,f;return{isInitializing:((l=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:l.promise)!=null,isInitializingPromise:(c=r.context.isReadyPromise)==null?void 0:c.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.failureResult)&&{...r.context.sessionInitialization.failureResult,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,l;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((l=r.context.sessionUpdating)==null?void 0:l.failureResult)&&{...r.context.sessionUpdating.failureResult,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 yq(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=mq({configuratorClient:t,sessionContext:n});return $.jsx(D0.Provider,{value:r,children:$.jsx(B_.Provider,{value:i,children:$.jsx(O0.Provider,{value:o,children:$.jsx(N0.Provider,{value:a,children:e.children})})})})}function Dv(){return O.useContext(D0)}function gq(e){const{children:t}=e,{isInitializingPromise:n}=Dv();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function Nv(){const e=$v(),t=es();return Ov(e),ts(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const bq=O.createContext(null),Hf={didCatch:!1,error:null};class Sq extends O.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Hf}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(Hf)}}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&&Cq(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(Hf)}}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(bq.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function Cq(){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 In=function(){return In=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},In.apply(this,arguments)};function wq(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 Oo(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 xq(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Tq=/^((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)-.*))$/,Eq=xq(function(e){return Tq.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),bt="-ms-",qs="-moz-",ut="-webkit-",_0="comm",wf="rule",Pv="decl",Iq="@import",q0="@keyframes",Aq="@layer",$q=Math.abs,Rv=String.fromCharCode,Dp=Object.assign;function Oq(e,t){return rn(e,0)^45?(((t<<2^rn(e,0))<<2^rn(e,1))<<2^rn(e,2))<<2^rn(e,3):0}function F0(e){return e.trim()}function Vr(e,t){return(e=t.exec(e))?e[0]:e}function Me(e,t,n){return e.replace(t,n)}function ql(e,t){return e.indexOf(t)}function rn(e,t){return e.charCodeAt(t)|0}function Ta(e,t,n){return e.slice(t,n)}function Nr(e){return e.length}function L0(e){return e.length}function Ds(e,t){return t.push(e),e}function Dq(e,t){return e.map(t).join("")}function zy(e,t){return e.filter(function(n){return!Vr(n,t)})}var xf=1,Ea=1,V0=0,lr=0,Kt=0,is="";function Tf(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:xf,column:Ea,length:a,return:"",siblings:s}}function Ci(e,t){return Dp(Tf("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Zo(e){for(;e.root;)e=Ci(e.root,{children:[e]});Ds(e,e.siblings)}function Nq(){return Kt}function Pq(){return Kt=lr>0?rn(is,--lr):0,Ea--,Kt===10&&(Ea=1,xf--),Kt}function xr(){return Kt=lr<V0?rn(is,lr++):0,Ea++,Kt===10&&(Ea=1,xf++),Kt}function bo(){return rn(is,lr)}function Fl(){return lr}function Ef(e,t){return Ta(is,e,t)}function Np(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 Rq(e){return xf=Ea=1,V0=Nr(is=e),lr=0,[]}function kq(e){return is="",e}function Kf(e){return F0(Ef(lr-1,Pp(e===91?e+2:e===40?e+1:e)))}function Mq(e){for(;(Kt=bo())&&Kt<33;)xr();return Np(e)>2||Np(Kt)>3?"":" "}function jq(e,t){for(;--t&&xr()&&!(Kt<48||Kt>102||Kt>57&&Kt<65||Kt>70&&Kt<97););return Ef(e,Fl()+(t<6&&bo()==32&&xr()==32))}function Pp(e){for(;xr();)switch(Kt){case e:return lr;case 34:case 39:e!==34&&e!==39&&Pp(Kt);break;case 40:e===41&&Pp(e);break;case 92:xr();break}return lr}function _q(e,t){for(;xr()&&e+Kt!==47+10;)if(e+Kt===42+42&&bo()===47)break;return"/*"+Ef(t,lr-1)+"*"+Rv(e===47?e:xr())}function qq(e){for(;!Np(bo());)xr();return Ef(e,lr)}function Fq(e){return kq(Ll("",null,null,null,[""],e=Rq(e),0,[0],e))}function Ll(e,t,n,r,i,o,a,s,u){for(var l=0,c=0,f=a,d=0,h=0,p=0,v=1,g=1,C=1,m=0,b="",x=i,T=o,E=r,A=b;g;)switch(p=m,m=xr()){case 40:if(p!=108&&rn(A,f-1)==58){ql(A+=Me(Kf(m),"&","&\f"),"&\f")!=-1&&(C=-1);break}case 34:case 39:case 91:A+=Kf(m);break;case 9:case 10:case 13:case 32:A+=Mq(p);break;case 92:A+=jq(Fl()-1,7);continue;case 47:switch(bo()){case 42:case 47:Ds(Lq(_q(xr(),Fl()),t,n,u),u);break;default:A+="/"}break;case 123*v:s[l++]=Nr(A)*C;case 125*v:case 59:case 0:switch(m){case 0:case 125:g=0;case 59+c:C==-1&&(A=Me(A,/\f/g,"")),h>0&&Nr(A)-f&&Ds(h>32?Hy(A+";",r,n,f-1,u):Hy(Me(A," ","")+";",r,n,f-2,u),u);break;case 59:A+=";";default:if(Ds(E=Wy(A,t,n,l,c,i,s,b,x=[],T=[],f,o),o),m===123)if(c===0)Ll(A,t,E,E,x,o,f,s,T);else switch(d===99&&rn(A,3)===110?100:d){case 100:case 108:case 109:case 115:Ll(e,E,E,r&&Ds(Wy(e,E,E,0,0,i,s,b,i,x=[],f,T),T),i,T,f,s,r?x:T);break;default:Ll(A,E,E,E,[""],T,0,s,T)}}l=c=h=0,v=C=1,b=A="",f=a;break;case 58:f=1+Nr(A),h=p;default:if(v<1){if(m==123)--v;else if(m==125&&v++==0&&Pq()==125)continue}switch(A+=Rv(m),m*v){case 38:C=c>0?1:(A+="\f",-1);break;case 44:s[l++]=(Nr(A)-1)*C,C=1;break;case 64:bo()===45&&(A+=Kf(xr())),d=bo(),c=f=Nr(b=A+=qq(Fl())),m++;break;case 45:p===45&&Nr(A)==2&&(v=0)}}return o}function Wy(e,t,n,r,i,o,a,s,u,l,c,f){for(var d=i-1,h=i===0?o:[""],p=L0(h),v=0,g=0,C=0;v<r;++v)for(var m=0,b=Ta(e,d+1,d=$q(g=a[v])),x=e;m<p;++m)(x=F0(g>0?h[m]+" "+b:Me(b,/&\f/g,h[m])))&&(u[C++]=x);return Tf(e,t,n,i===0?wf:s,u,l,c,f)}function Lq(e,t,n,r){return Tf(e,t,n,_0,Rv(Nq()),Ta(e,2,-2),0,r)}function Hy(e,t,n,r,i){return Tf(e,t,n,Pv,Ta(e,0,r),Ta(e,r+1,-1),r,i)}function B0(e,t,n){switch(Oq(e,t)){case 5103:return ut+"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 ut+e+e;case 4789:return qs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ut+e+qs+e+bt+e+e;case 5936:switch(rn(e,t+11)){case 114:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return ut+e+bt+e+e;case 6165:return ut+e+bt+"flex-"+e+e;case 5187:return ut+e+Me(e,/(\w+).+(:[^]+)/,ut+"box-$1$2"+bt+"flex-$1$2")+e;case 5443:return ut+e+bt+"flex-item-"+Me(e,/flex-|-self/g,"")+(Vr(e,/flex-|baseline/)?"":bt+"grid-row-"+Me(e,/flex-|-self/g,""))+e;case 4675:return ut+e+bt+"flex-line-pack"+Me(e,/align-content|flex-|-self/g,"")+e;case 5548:return ut+e+bt+Me(e,"shrink","negative")+e;case 5292:return ut+e+bt+Me(e,"basis","preferred-size")+e;case 6060:return ut+"box-"+Me(e,"-grow","")+ut+e+bt+Me(e,"grow","positive")+e;case 4554:return ut+Me(e,/([^-])(transform)/g,"$1"+ut+"$2")+e;case 6187:return Me(Me(Me(e,/(zoom-|grab)/,ut+"$1"),/(image-set)/,ut+"$1"),e,"")+e;case 5495:case 3959:return Me(e,/(image-set\([^]*)/,ut+"$1$`$1");case 4968:return Me(Me(e,/(.+:)(flex-)?(.*)/,ut+"box-pack:$3"+bt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ut+e+e;case 4200:if(!Vr(e,/flex-|baseline/))return bt+"grid-column-align"+Ta(e,t)+e;break;case 2592:case 3360:return bt+Me(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,Vr(r.props,/grid-\w+-end/)})?~ql(e+(n=n[t].value),"span")?e:bt+Me(e,"-start","")+e+bt+"grid-row-span:"+(~ql(n,"span")?Vr(n,/\d+/):+Vr(n,/\d+/)-+Vr(e,/\d+/))+";":bt+Me(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Vr(r.props,/grid-\w+-start/)})?e:bt+Me(Me(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Me(e,/(.+)-inline(.+)/,ut+"$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(Nr(e)-1-t>6)switch(rn(e,t+1)){case 109:if(rn(e,t+4)!==45)break;case 102:return Me(e,/(.+:)(.+)-([^]+)/,"$1"+ut+"$2-$3$1"+qs+(rn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ql(e,"stretch")?B0(Me(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Me(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,u,l){return bt+i+":"+o+l+(a?bt+i+"-span:"+(s?u:+u-+o)+l:"")+e});case 4949:if(rn(e,t+6)===121)return Me(e,":",":"+ut)+e;break;case 6444:switch(rn(e,rn(e,14)===45?18:11)){case 120:return Me(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ut+(rn(e,14)===45?"inline-":"")+"box$3$1"+ut+"$2$3$1"+bt+"$2box$3")+e;case 100:return Me(e,":",":"+bt)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Me(e,"scroll-","scroll-snap-")+e}return e}function pc(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Vq(e,t,n,r){switch(e.type){case Aq:if(e.children.length)break;case Iq:case Pv:return e.return=e.return||e.value;case _0:return"";case q0:return e.return=e.value+"{"+pc(e.children,r)+"}";case wf:if(!Nr(e.value=e.props.join(",")))return""}return Nr(n=pc(e.children,r))?e.return=e.value+"{"+n+"}":""}function Bq(e){var t=L0(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 Uq(e){return function(t){t.root||(t=t.return)&&e(t)}}function Gq(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Pv:e.return=B0(e.value,e.length,n);return;case q0:return pc([Ci(e,{value:Me(e.value,"@","@"+ut)})],r);case wf:if(e.length)return Dq(n=e.props,function(i){switch(Vr(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Zo(Ci(e,{props:[Me(i,/:(read-\w+)/,":"+qs+"$1")]})),Zo(Ci(e,{props:[i]})),Dp(e,{props:zy(n,r)});break;case"::placeholder":Zo(Ci(e,{props:[Me(i,/:(plac\w+)/,":"+ut+"input-$1")]})),Zo(Ci(e,{props:[Me(i,/:(plac\w+)/,":"+qs+"$1")]})),Zo(Ci(e,{props:[Me(i,/:(plac\w+)/,bt+"input-$1")]})),Zo(Ci(e,{props:[i]})),Dp(e,{props:zy(n,r)});break}return""})}}var zq={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},Do=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",kv=typeof window<"u"&&"HTMLElement"in window,Wq=!!(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"),Hq={},Ky=/invalid hook call/i,sl=new Set,U0=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.`,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];
|
|
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];Ky.test(a)?(o=!1,sl.delete(r)):i.apply(void 0,Oo([a],s,!1))},O.useRef(),o&&!sl.has(r)&&(console.warn(r),sl.add(r))}catch(a){Ky.test(a.message)&&sl.delete(r)}finally{console.error=i}}},If=Object.freeze([]),Ia=Object.freeze({});function G0(e,t,n){return n===void 0&&(n=Ia),e.theme!==n.theme&&e.theme||t||n.theme}var Rp=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"]),Kq=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Yq=/(^-|-$)/g;function Yy(e){return e.replace(Kq,"-").replace(Yq,"")}var Jq=/(a)(d)/gi,Jy=function(e){return String.fromCharCode(e+(e>25?39:97))};function kp(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Jy(t%52)+n;return(Jy(t%52)+n).replace(Jq,"$1-$2")}var Yf,co=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},z0=function(e){return co(5381,e)};function W0(e){return kp(z0(e)>>>0)}function H0(e){return process.env.NODE_ENV!=="production"&&typeof e=="string"&&e||e.displayName||e.name||"Component"}function Jf(e){return typeof e=="string"&&(process.env.NODE_ENV==="production"||e.charAt(0)===e.charAt(0).toLowerCase())}var K0=typeof Symbol=="function"&&Symbol.for,Y0=K0?Symbol.for("react.memo"):60115,Xq=K0?Symbol.for("react.forward_ref"):60112,Qq={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Zq={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},J0={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},eF=((Yf={})[Xq]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Yf[Y0]=J0,Yf);function Xy(e){return("type"in(t=e)&&t.type.$$typeof)===Y0?J0:"$$typeof"in e?eF[e.$$typeof]:Qq;var t}var tF=Object.defineProperty,nF=Object.getOwnPropertyNames,Qy=Object.getOwnPropertySymbols,rF=Object.getOwnPropertyDescriptor,iF=Object.getPrototypeOf,Zy=Object.prototype;function X0(e,t,n){if(typeof t!="string"){if(Zy){var r=iF(t);r&&r!==Zy&&X0(e,r,n)}var i=nF(t);Qy&&(i=i.concat(Qy(t)));for(var o=Xy(e),a=Xy(t),s=0;s<i.length;++s){var u=i[s];if(!(u in Zq||n&&n[u]||a&&u in a||o&&u in o)){var l=rF(t,u);try{tF(e,u,l)}catch{}}}}return e}function Aa(e){return typeof e=="function"}function Mv(e){return typeof e=="object"&&"styledComponentId"in e}function fo(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function Mp(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 $a(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function jp(e,t,n){if(n===void 0&&(n=!1),!n&&!$a(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=jp(e[r],t[r]);else if($a(t))for(var r in t)e[r]=jp(e[r],t[r]);return e}function jv(e,t){Object.defineProperty(e,"toString",{value:t})}var oF=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}(),Vl=new Map,hc=new Map,Bl=1,ul=function(e){if(Vl.has(e))return Vl.get(e);for(;hc.has(Bl);)Bl++;var t=Bl++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>1073741824))throw os(16,"".concat(t));return Vl.set(e,t),hc.set(t,e),t},
|
|
178
|
-
`),i=[],o=0,a=r.length;o<a;o++){var s=r[o].trim();if(s){var u=s.match(
|
|
179
|
-
`)},c=0;c<s;c++)l(c);return u}(i)})}return e.registerId=function(t){return ul(t)},e.prototype.reconstructWithOptions=function(t,n){return n===void 0&&(n=!0),new e(In(In({},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
|
|
176
|
+
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function aF(){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 os(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(aF.apply(void 0,Oo([oF[e]],t,!1)).trim())}var sF=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 os(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}(),Vl=new Map,hc=new Map,Bl=1,ul=function(e){if(Vl.has(e))return Vl.get(e);for(;hc.has(Bl);)Bl++;var t=Bl++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>1073741824))throw os(16,"".concat(t));return Vl.set(e,t),hc.set(t,e),t},uF=function(e,t){Bl=t+1,Vl.set(e,t),hc.set(t,e)},lF="style[".concat(Do,"][").concat("data-styled-version",'="').concat("6.1.1",'"]'),cF=new RegExp("^".concat(Do,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),fF=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)},dF=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(cF);if(u){var l=0|parseInt(u[1],10),c=u[2];l!==0&&(uF(c,l),fF(e,c,u[3]),e.getTag().insertRules(l,i)),i.length=0}else i.push(s)}}};function pF(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var Q0=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(s){var u=Array.from(s.querySelectorAll("style[".concat(Do,"]")));return u[u.length-1]}(n),o=i!==void 0?i.nextSibling:null;r.setAttribute(Do,"active"),r.setAttribute("data-styled-version","6.1.1");var a=pF();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},hF=function(){function e(t){this.element=Q0(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 os(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}(),vF=function(){function e(t){this.element=Q0(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}(),mF=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}(),eg=kv,yF={isServer:!kv,useCSSOMInjection:!Wq},vc=function(){function e(t,n,r){t===void 0&&(t=Ia),n===void 0&&(n={});var i=this;this.options=In(In({},yF),t),this.gs=n,this.names=new Map(r),this.server=!!t.isServer,!this.server&&kv&&eg&&(eg=!1,function(o){for(var a=document.querySelectorAll(lF),s=0,u=a.length;s<u;s++){var l=a[s];l&&l.getAttribute(Do)!=="active"&&(dF(o,l),l.parentNode&&l.parentNode.removeChild(l))}}(this)),jv(this,function(){return function(o){for(var a=o.getTag(),s=a.length,u="",l=function(f){var d=function(C){return hc.get(C)}(f);if(d===void 0)return"continue";var h=o.names.get(d),p=a.getGroup(f);if(h===void 0||p.length===0)return"continue";var v="".concat(Do,".g").concat(f,'[id="').concat(d,'"]'),g="";h!==void 0&&h.forEach(function(C){C.length>0&&(g+="".concat(C,","))}),u+="".concat(p).concat(v,'{content:"').concat(g,'"}').concat(`/*!sc*/
|
|
179
|
+
`)},c=0;c<s;c++)l(c);return u}(i)})}return e.registerId=function(t){return ul(t)},e.prototype.reconstructWithOptions=function(t,n){return n===void 0&&(n=!0),new e(In(In({},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 mF(i):r?new hF(i):new vF(i)}(this.options),new sF(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(ul(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(ul(t),r)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(ul(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e}(),gF=/&/g,bF=/^\s*\/\/.*$/gm;function Z0(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=Z0(n.children,t)),n})}function SF(e){var t,n,r,i=e===void 0?Ia:e,o=i.options,a=o===void 0?Ia:o,s=i.plugins,u=s===void 0?If:s,l=function(d,h,p){return p===n||p.startsWith(n)&&p.endsWith(n)&&p.replaceAll(n,"").length>0?".".concat(t):d},c=u.slice();c.push(function(d){d.type===wf&&d.value.includes("&")&&(d.props[0]=d.props[0].replace(gF,n).replace(r,l))}),a.prefix&&c.push(Gq),c.push(Vq);var f=function(d,h,p,v){h===void 0&&(h=""),p===void 0&&(p=""),v===void 0&&(v="&"),t=v,n=h,r=new RegExp("\\".concat(n,"\\b"),"g");var g=d.replace(bF,""),C=Fq(p||h?"".concat(p," ").concat(h," { ").concat(g," }"):g);a.namespace&&(C=Z0(C,a.namespace));var m=[];return pc(C,Bq(c.concat(Uq(function(b){return m.push(b)})))),m};return f.hash=u.length?u.reduce(function(d,h){return h.name||os(15),co(d,h.name)},5381).toString():"",f}var CF=new vc,_p=SF(),ex=O.createContext({shouldForwardProp:void 0,styleSheet:CF,stylis:_p});ex.Consumer;O.createContext(void 0);function qp(){return O.useContext(ex)}var tg=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=_p);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,jv(this,function(){throw os(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=_p),this.name+t.hash},e}(),wF=function(e){return e>="A"&&e<="Z"};function ng(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(n===1&&r==="-"&&e[0]==="-")return e;wF(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var tx=function(e){return e==null||e===!1||e===""},nx=function(e){var t,n,r=[];for(var i in e){var o=e[i];e.hasOwnProperty(i)&&!tx(o)&&(Array.isArray(o)&&o.isCss||Aa(o)?r.push("".concat(ng(i),":"),o,";"):$a(o)?r.push.apply(r,Oo(Oo(["".concat(i," {")],nx(o),!1),["}"],!1)):r.push("".concat(ng(i),": ").concat((t=i,(n=o)==null||typeof n=="boolean"||n===""?"":typeof n!="number"||n===0||t in zq||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Ri(e,t,n,r){if(tx(e))return[];if(Mv(e))return[".".concat(e.styledComponentId)];if(Aa(e)){if(!Aa(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 tg||$a(i)||i===null||console.error("".concat(H0(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.")),Ri(i,t,n,r)}var o;return e instanceof tg?n?(e.inject(n,r),[e.getName(r)]):[e]:$a(e)?nx(e):Array.isArray(e)?Array.prototype.concat.apply(If,e.map(function(a){return Ri(a,t,n,r)})):[e.toString()]}function rx(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Aa(n)&&!Mv(n))return!1}return!0}var xF=z0("6.1.1"),TF=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(r===void 0||r.isStatic)&&rx(t),this.componentId=n,this.baseHash=co(xF,n),this.baseStyle=r,vc.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=fo(i,this.staticRulesId);else{var o=Mp(Ri(this.rules,t,n,r)),a=kp(co(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=fo(i,a),this.staticRulesId=a}else{for(var u=co(this.baseHash,r.hash),l="",c=0;c<this.rules.length;c++){var f=this.rules[c];if(typeof f=="string")l+=f,process.env.NODE_ENV!=="production"&&(u=co(u,f));else if(f){var d=Mp(Ri(f,t,n,r));u=co(u,d+c),l+=d}}if(l){var h=kp(u>>>0);n.hasNameForId(this.componentId,h)||n.insertRules(this.componentId,h,r(l,".".concat(h),void 0,this.componentId)),i=fo(i,h)}}return i},e}(),_v=O.createContext(void 0);_v.Consumer;var Xf={},rg=new Set;function EF(e,t,n){var r=Mv(e),i=e,o=!Jf(e),a=t.attrs,s=a===void 0?If:a,u=t.componentId,l=u===void 0?function(x,T){var E=typeof x!="string"?"sc":Yy(x);Xf[E]=(Xf[E]||0)+1;var A="".concat(E,"-").concat(W0("6.1.1"+E+Xf[E]));return T?"".concat(T,"-").concat(A):A}(t.displayName,t.parentComponentId):u,c=t.displayName,f=c===void 0?function(x){return Jf(x)?"styled.".concat(x):"Styled(".concat(H0(x),")")}(e):c,d=t.displayName&&t.componentId?"".concat(Yy(t.displayName),"-").concat(t.componentId):t.componentId||l,h=r&&i.attrs?i.attrs.concat(s).filter(Boolean):s,p=t.shouldForwardProp;if(r&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var g=t.shouldForwardProp;p=function(x,T){return v(x,T)&&g(x,T)}}else p=v}var C=new TF(n,d,r?i.componentStyle:void 0);function m(x,T){return function(E,A,N){var I=E.attrs,P=E.componentStyle,_=E.defaultProps,L=E.foldedComponentIds,U=E.styledComponentId,Y=E.target,k=O.useContext(_v),ie=qp(),B=E.shouldForwardProp||ie.shouldForwardProp;process.env.NODE_ENV!=="production"&&O.useDebugValue(U);var G=function(X,ae,de){for(var he,Te=In(In({},ae),{className:void 0,theme:de}),ke=0;ke<X.length;ke+=1){var Ne=Aa(he=X[ke])?he(Te):he;for(var mt in Ne)Te[mt]=mt==="className"?fo(Te[mt],Ne[mt]):mt==="style"?In(In({},Te[mt]),Ne[mt]):Ne[mt]}return ae.className&&(Te.className=fo(Te.className,ae.className)),Te}(I,A,G0(A,k,_)||Ia),fe=G.as||Y,j={};for(var R in G)G[R]===void 0||R[0]==="$"||R==="as"||R==="theme"||(R==="forwardedAs"?j.as=G.forwardedAs:B&&!B(R,fe)||(j[R]=G[R],B||process.env.NODE_ENV!=="development"||Eq(R)||rg.has(R)||!Rp.has(fe)||(rg.add(R),console.warn('styled-components: it looks like an unknown prop "'.concat(R,'" 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(X,ae){var de=qp(),he=X.generateAndInjectStyles(ae,de.styleSheet,de.stylis);return process.env.NODE_ENV!=="production"&&O.useDebugValue(he),he}(P,G);process.env.NODE_ENV!=="production"&&E.warnTooManyClasses&&E.warnTooManyClasses(te);var oe=fo(L,U);return te&&(oe+=" "+te),G.className&&(oe+=" "+G.className),j[Jf(fe)&&!Rp.has(fe)?"class":"className"]=oe,j.ref=N,O.createElement(fe,j)}(b,x,T)}m.displayName=f;var b=O.forwardRef(m);return b.attrs=h,b.componentStyle=C,b.displayName=f,b.shouldForwardProp=p,b.foldedComponentIds=r?fo(i.foldedComponentIds,i.styledComponentId):"",b.styledComponentId=d,b.target=r?i.target:e,Object.defineProperty(b,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(x){this._foldedDefaultProps=r?function(T){for(var E=[],A=1;A<arguments.length;A++)E[A-1]=arguments[A];for(var N=0,I=E;N<I.length;N++)jp(T,I[N],!0);return T}({},i.defaultProps,x):x}}),process.env.NODE_ENV!=="production"&&(U0(f,d),b.warnTooManyClasses=function(x,T){var E={},A=!1;return function(N){if(!A&&(E[N]=!0,Object.keys(E).length>=200)){var I=T?' with the id of "'.concat(T,'"'):"";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,13 +185,13 @@ Example:
|
|
|
185
185
|
},
|
|
186
186
|
}))\`width: 100%;\`
|
|
187
187
|
|
|
188
|
-
<Component />`),A=!0,E={}}}}(f,d)),
|
|
188
|
+
<Component />`),A=!0,E={}}}}(f,d)),jv(b,function(){return".".concat(b.styledComponentId)}),o&&X0(b,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),b}function ig(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 og=function(e){return Object.assign(e,{isCss:!0})};function qv(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Aa(e)||$a(e)){var r=e;return og(Ri(ig(If,Oo([r],t,!0))))}var i=e;return t.length===0&&i.length===1&&typeof i[0]=="string"?Ri(i):og(Ri(ig(i,t)))}function Fp(e,t,n){if(n===void 0&&(n=Ia),!t)throw os(1,t);var r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return e(t,n,qv.apply(void 0,Oo([i],o,!1)))};return r.attrs=function(i){return Fp(e,t,In(In({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return Fp(e,t,In(In({},n),i))},r}var ix=function(e){return Fp(EF,e)},Ae=ix;Rp.forEach(function(e){Ae[e]=ix(e)});var IF=function(){function e(t,n){this.rules=t,this.componentId=n,this.isStatic=rx(t),vc.registerId(this.componentId+1)}return e.prototype.createStyles=function(t,n,r,i){var o=i(Mp(Ri(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&&vc.registerId(this.componentId+t),this.removeStyles(t,r),this.createStyles(t,n,r,i)},e}();function Mu(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=qv.apply(void 0,Oo([e],t,!1)),i="sc-global-".concat(W0(JSON.stringify(r))),o=new IF(r,i);process.env.NODE_ENV!=="production"&&U0(i);var a=function(u){var l=qp(),c=O.useContext(_v),f=O.useRef(l.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."),l.styleSheet.server&&s(f,u,l.styleSheet,c,l.stylis),O.useLayoutEffect(function(){if(!l.styleSheet.server)return s(f,u,l.styleSheet,c,l.stylis),function(){return o.removeStyles(f,l.styleSheet)}},[f,u,l.styleSheet,c,l.stylis]),null};function s(u,l,c,f,d){if(o.isStatic)o.renderStyles(u,Hq,c,d);else{var h=In(In({},l),{theme:G0(l,f,a.defaultProps)});o.renderStyles(u,h,c,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
190
|
Read more about this at https://www.styled-components.com/docs/basics#react-native`);var ll="__sc-".concat(Do,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[ll]||(window[ll]=0),window[ll]===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[ll]+=1);var
|
|
193
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
194
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var
|
|
192
|
+
See https://s-c.sh/2BAXzed for more info.`),window[ll]+=1);var AF={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"]},$F={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"]},ox={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 ag(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?ag(Object(n),!0).forEach(function(r){en(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ag(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mc(e){"@babel/helpers - typeof";return mc=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},mc(e)}function OF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sg(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 DF(e,t,n){return t&&sg(e.prototype,t),n&&sg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function en(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fv(e,t){return PF(e)||kF(e,t)||ax(e,t)||jF()}function ju(e){return NF(e)||RF(e)||ax(e)||MF()}function NF(e){if(Array.isArray(e))return Lp(e)}function PF(e){if(Array.isArray(e))return e}function RF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kF(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 ax(e,t){if(e){if(typeof e=="string")return Lp(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 Lp(e,t)}}function Lp(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 MF(){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 jF(){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 ug=function(){},Lv={},sx={},ux=null,lx={mark:ug,measure:ug};try{typeof window<"u"&&(Lv=window),typeof document<"u"&&(sx=document),typeof MutationObserver<"u"&&(ux=MutationObserver),typeof performance<"u"&&(lx=performance)}catch{}var _F=Lv.navigator||{},lg=_F.userAgent,cg=lg===void 0?"":lg,Vi=Lv,wt=sx,fg=ux,cl=lx;Vi.document;var ui=!!wt.documentElement&&!!wt.head&&typeof wt.addEventListener=="function"&&typeof wt.createElement=="function",cx=~cg.indexOf("MSIE")||~cg.indexOf("Trident/"),fl,dl,pl,hl,vl,ni="___FONT_AWESOME___",Vp=16,fx="fa",dx="svg-inline--fa",No="data-fa-i2svg",Bp="data-fa-pseudo-element",qF="data-fa-pseudo-element-pending",Vv="data-prefix",Bv="data-icon",dg="fontawesome-i2svg",FF="async",LF=["HTML","HEAD","STYLE","SCRIPT"],px=function(){try{return process.env.NODE_ENV==="production"}catch{return!1}}(),St="classic",jt="sharp",Uv=[St,jt];function _u(e){return new Proxy(e,{get:function(n,r){return r in n?n[r]:n[St]}})}var uu=_u((fl={},en(fl,St,{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"}),en(fl,jt,{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"}),fl)),lu=_u((dl={},en(dl,St,{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab",kit:"fak"}),en(dl,jt,{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"}),dl)),cu=_u((pl={},en(pl,St,{fab:"fa-brands",fad:"fa-duotone",fak:"fa-kit",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"}),en(pl,jt,{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"}),pl)),VF=_u((hl={},en(hl,St,{"fa-brands":"fab","fa-duotone":"fad","fa-kit":"fak","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"}),en(hl,jt,{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"}),hl)),BF=/fa(s|r|l|t|d|b|k|ss|sr|sl|st)?[\-\ ]/,hx="fa-layers-text",UF=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i,GF=_u((vl={},en(vl,St,{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"}),en(vl,jt,{900:"fass",400:"fasr",300:"fasl",100:"fast"}),vl)),vx=[1,2,3,4,5,6,7,8,9,10],zF=vx.concat([11,12,13,14,15,16,17,18,19,20]),WF=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],po={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},fu=new Set;Object.keys(lu[St]).map(fu.add.bind(fu));Object.keys(lu[jt]).map(fu.add.bind(fu));var HF=[].concat(Uv,ju(fu),["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",po.GROUP,po.SWAP_OPACITY,po.PRIMARY,po.SECONDARY]).concat(vx.map(function(e){return"".concat(e,"x")})).concat(zF.map(function(e){return"w-".concat(e)})),Fs=Vi.FontAwesomeConfig||{};function KF(e){var t=wt.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function YF(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}if(wt&&typeof wt.querySelector=="function"){var JF=[["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"]];JF.forEach(function(e){var t=Fv(e,2),n=t[0],r=t[1],i=YF(KF(n));i!=null&&(Fs[r]=i)})}var mx={styleDefault:"solid",familyDefault:"classic",cssPrefix:fx,replacementClass:dx,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Fs.familyPrefix&&(Fs.cssPrefix=Fs.familyPrefix);var Oa=pe(pe({},mx),Fs);Oa.autoReplaceSvg||(Oa.observeMutations=!1);var ve={};Object.keys(mx).forEach(function(e){Object.defineProperty(ve,e,{enumerable:!0,set:function(n){Oa[e]=n,Ls.forEach(function(r){return r(ve)})},get:function(){return Oa[e]}})});Object.defineProperty(ve,"familyPrefix",{enumerable:!0,set:function(t){Oa.cssPrefix=t,Ls.forEach(function(n){return n(ve)})},get:function(){return Oa.cssPrefix}});Vi.FontAwesomeConfig=ve;var Ls=[];function XF(e){return Ls.push(e),function(){Ls.splice(Ls.indexOf(e),1)}}var mi=Vp,Pr={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function QF(e){if(!(!e||!ui)){var t=wt.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;for(var n=wt.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 wt.head.insertBefore(t,r),e}}var ZF="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function du(){for(var e=12,t="";e-- >0;)t+=ZF[Math.random()*62|0];return t}function as(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function Gv(e){return e.classList?as(e.classList):(e.getAttribute("class")||"").split(" ").filter(function(t){return t})}function yx(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function eL(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,'="').concat(yx(e[n]),'" ')},"").trim()}function Af(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,": ").concat(e[n].trim(),";")},"")}function zv(e){return e.size!==Pr.size||e.x!==Pr.x||e.y!==Pr.y||e.rotate!==Pr.rotate||e.flipX||e.flipY}function tL(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)},l={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:u,path:l}}function nL(e){var t=e.transform,n=e.width,r=n===void 0?Vp:n,i=e.height,o=i===void 0?Vp:i,a=e.startCentered,s=a===void 0?!1:a,u="";return s&&cx?u+="translate(".concat(t.x/mi-r/2,"em, ").concat(t.y/mi-o/2,"em) "):s?u+="translate(calc(-50% + ".concat(t.x/mi,"em), calc(-50% + ").concat(t.y/mi,"em)) "):u+="translate(".concat(t.x/mi,"em, ").concat(t.y/mi,"em) "),u+="scale(".concat(t.size/mi*(t.flipX?-1:1),", ").concat(t.size/mi*(t.flipY?-1:1),") "),u+="rotate(".concat(t.rotate,"deg) "),u}var rL=`:root, :host {
|
|
195
195
|
--fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";
|
|
196
196
|
--fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";
|
|
197
197
|
--fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";
|
|
@@ -948,41 +948,41 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
|
948
948
|
.fad.fa-inverse,
|
|
949
949
|
.fa-duotone.fa-inverse {
|
|
950
950
|
color: var(--fa-inverse, #fff);
|
|
951
|
-
}`;function vx(){var e=ux,t=lx,n=ve.cssPrefix,r=ve.replacementClass,i=eL;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 dg=!1;function Qf(){ve.autoAddCss&&!dg&&(YF(vx()),dg=!0)}var tL={mixout:function(){return{dom:{css:vx,insertCss:Qf}}},hooks:function(){return{beforeDOMElementCreation:function(){Qf()},beforeI2svg:function(){Qf()}}}},ni=Vi||{};ni[ti]||(ni[ti]={});ni[ti].styles||(ni[ti].styles={});ni[ti].hooks||(ni[ti].hooks={});ni[ti].shims||(ni[ti].shims=[]);var Sr=ni[ti],mx=[],nL=function e(){wt.removeEventListener("DOMContentLoaded",e),yc=1,mx.map(function(t){return t()})},yc=!1;si&&(yc=(wt.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(wt.readyState),yc||wt.addEventListener("DOMContentLoaded",nL));function rL(e){si&&(yc?setTimeout(e,0):mx.push(e))}function qu(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"?hx(e):"<".concat(t," ").concat(XF(r),">").concat(o.map(qu).join(""),"</").concat(t,">")}function pg(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var iL=function(t,n){return function(r,i,o,a){return t.call(n,r,i,o,a)}},Zf=function(t,n,r,i){var o=Object.keys(t),a=o.length,s=i!==void 0?iL(n,i):n,u,l,c;for(r===void 0?(u=1,c=t[o[0]]):(u=0,c=r);u<a;u++)l=o[u],c=s(c,t[l],l,t);return c};function oL(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 Up(e){var t=oL(e);return t.length===1?t[0].toString(16):null}function aL(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 hg(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 Gp(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,o=hg(t);typeof Sr.hooks.addPack=="function"&&!i?Sr.hooks.addPack(e,hg(t)):Sr.styles[e]=pe(pe({},Sr.styles[e]||{}),o),e==="fas"&&Gp("fa",t)}var ml,yl,gl,pa=Sr.styles,sL=Sr.shims,uL=(ml={},en(ml,St,Object.values(cu[St])),en(ml,jt,Object.values(cu[jt])),ml),Hv=null,yx={},gx={},bx={},Sx={},Cx={},lL=(yl={},en(yl,St,Object.keys(uu[St])),en(yl,jt,Object.keys(uu[jt])),yl);function cL(e){return~GF.indexOf(e)}function fL(e,t){var n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!cL(i)?i:null}var wx=function(){var t=function(o){return Zf(pa,function(a,s,u){return a[u]=Zf(s,o,{}),a},{})};yx=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}),gx=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}),Cx=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 pa||ve.autoFetchSvg,r=Zf(sL,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:{}});bx=r.names,Sx=r.unicodes,Hv=$f(ve.styleDefault,{family:ve.familyDefault})};KF(function(e){Hv=$f(e.styleDefault,{family:ve.familyDefault})});wx();function Kv(e,t){return(yx[e]||{})[t]}function dL(e,t){return(gx[e]||{})[t]}function ho(e,t){return(Cx[e]||{})[t]}function xx(e){return bx[e]||{prefix:null,iconName:null}}function pL(e){var t=Sx[e],n=Kv("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Bi(){return Hv}var Yv=function(){return{prefix:null,iconName:null,rest:[]}};function $f(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,r=n===void 0?St:n,i=uu[r][e],o=lu[r][e]||lu[r][i],a=e in Sr.styles?e:null;return o||a||null}var vg=(gl={},en(gl,St,Object.keys(cu[St])),en(gl,jt,Object.keys(cu[jt])),gl);function Of(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,o=(t={},en(t,St,"".concat(ve.cssPrefix,"-").concat(St)),en(t,jt,"".concat(ve.cssPrefix,"-").concat(jt)),t),a=null,s=St;(e.includes(o[St])||e.some(function(l){return vg[St].includes(l)}))&&(s=St),(e.includes(o[jt])||e.some(function(l){return vg[jt].includes(l)}))&&(s=jt);var u=e.reduce(function(l,c){var f=fL(ve.cssPrefix,c);if(pa[c]?(c=uL[s].includes(c)?qF[s][c]:c,a=c,l.prefix=c):lL[s].indexOf(c)>-1?(a=c,l.prefix=$f(c,{family:s})):f?l.iconName=f:c!==ve.replacementClass&&c!==o[St]&&c!==o[jt]&&l.rest.push(c),!i&&l.prefix&&l.iconName){var d=a==="fa"?xx(l.iconName):{},h=ho(l.prefix,l.iconName);d.prefix&&(a=null),l.iconName=d.iconName||h||l.iconName,l.prefix=d.prefix||l.prefix,l.prefix==="far"&&!pa.far&&pa.fas&&!ve.autoFetchSvg&&(l.prefix="fas")}return l},Yv());return(e.includes("fa-brands")||e.includes("fab"))&&(u.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(u.prefix="fad"),!u.prefix&&s===jt&&(pa.fass||ve.autoFetchSvg)&&(u.prefix="fass",u.iconName=ho(u.prefix,u.iconName)||u.iconName),(u.prefix==="fa"||a==="fa")&&(u.prefix=Bi()||"fas"),u}var hL=function(){function e(){IF(this,e),this.definitions={}}return AF(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]),Gp(s,a[s]);var u=cu[St][s];u&&Gp(u,a[s]),wx()})}},{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,l=a.icon,c=l[2];n[s]||(n[s]={}),c.length>0&&c.forEach(function(f){typeof f=="string"&&(n[s][f]=l)}),n[s][u]=l}),n}}]),e}(),mg=[],ha={},Ca={},vL=Object.keys(Ca);function mL(e,t){var n=t.mixoutsTo;return mg=e,ha={},Object.keys(Ca).forEach(function(r){vL.indexOf(r)===-1&&delete Ca[r]}),mg.forEach(function(r){var i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(function(a){typeof i[a]=="function"&&(n[a]=i[a]),mc(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){ha[a]||(ha[a]=[]),ha[a].push(o[a])})}r.provides&&r.provides(Ca)}),n}function zp(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=ha[e]||[];return o.forEach(function(a){t=a.apply(null,[t].concat(r))}),t}function Po(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=ha[e]||[];i.forEach(function(o){o.apply(null,n)})}function ri(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Ca[e]?Ca[e].apply(null,t):void 0}function Wp(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||Bi();if(t)return t=ho(n,t)||t,pg(Tx.definitions,n,t)||pg(Sr.styles,n,t)}var Tx=new hL,yL=function(){ve.autoReplaceSvg=!1,ve.observeMutations=!1,Po("noAuto")},gL={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return si?(Po("beforeI2svg",t),ri("pseudoElements2svg",t),ri("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;ve.autoReplaceSvg===!1&&(ve.autoReplaceSvg=!0),ve.observeMutations=!0,rL(function(){SL({autoReplaceSvgRoot:n}),Po("watch",t)})}},bL={icon:function(t){if(t===null)return null;if(mc(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:ho(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=$f(t[0]);return{prefix:r,iconName:ho(r,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(ve.cssPrefix,"-"))>-1||t.match(FF))){var i=Of(t.split(" "),{skipLookups:!0});return{prefix:i.prefix||Bi(),iconName:ho(i.prefix,i.iconName)||i.iconName}}if(typeof t=="string"){var o=Bi();return{prefix:o,iconName:ho(o,t)||t}}}},nr={noAuto:yL,config:ve,dom:gL,parse:bL,library:Tx,findIconDefinition:Wp,toHtml:qu},SL=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,r=n===void 0?wt:n;(Object.keys(Sr.styles).length>0||ve.autoFetchSvg)&&si&&ve.autoReplaceSvg&&nr.dom.i2svg({node:r})};function Df(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(r){return qu(r)})}}),Object.defineProperty(e,"node",{get:function(){if(si){var r=wt.createElement("div");return r.innerHTML=e.html,r.children}}}),e}function CL(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,o=e.styles,a=e.transform;if(Wv(a)&&n.found&&!r.found){var s=n.width,u=n.height,l={x:s/u/2,y:.5};i.style=Af(pe(pe({},o),{},{"transform-origin":"".concat(l.x+a.x/16,"em ").concat(l.y+a.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}function wL(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,o=e.symbol,a=o===!0?"".concat(t,"-").concat(ve.cssPrefix,"-").concat(n):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:pe(pe({},i),{},{id:a}),children:r}]}]}function Jv(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,l=e.maskId,c=e.titleId,f=e.extra,d=e.watchable,h=d===void 0?!1:d,p=r.found?r:n,v=p.width,g=p.height,C=i==="fak",m=[ve.replacementClass,o?"".concat(ve.cssPrefix,"-").concat(o):""].filter(function(I){return f.classes.indexOf(I)===-1}).filter(function(I){return I!==""||!!I}).concat(f.classes).join(" "),b={children:[],attributes:pe(pe({},f.attributes),{},{"data-prefix":i,"data-icon":o,class:m,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(v," ").concat(g)})},x=C&&!~f.classes.indexOf("fa-fw")?{width:"".concat(v/g*16*.0625,"em")}:{};h&&(b.attributes[No]=""),u&&(b.children.push({tag:"title",attributes:{id:b.attributes["aria-labelledby"]||"title-".concat(c||du())},children:[u]}),delete b.attributes.title);var T=pe(pe({},b),{},{prefix:i,iconName:o,main:n,mask:r,maskId:l,transform:a,symbol:s,styles:pe(pe({},x),f.styles)}),E=r.found&&n.found?ri("generateAbstractMask",T)||{children:[],attributes:{}}:ri("generateAbstractIcon",T)||{children:[],attributes:{}},A=E.children,N=E.attributes;return T.children=A,T.attributes=N,s?wL(T):CL(T)}function yg(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,l=pe(pe(pe({},a.attributes),o?{title:o}:{}),{},{class:a.classes.join(" ")});u&&(l[No]="");var c=pe({},a.styles);Wv(i)&&(c.transform=ZF({transform:i,startCentered:!0,width:n,height:r}),c["-webkit-transform"]=c.transform);var f=Af(c);f.length>0&&(l.style=f);var d=[];return d.push({tag:"span",attributes:l,children:[t]}),o&&d.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),d}function xL(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=Af(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 ed=Sr.styles;function Hp(e){var t=e[0],n=e[1],r=e.slice(4),i=Lv(r,1),o=i[0],a=null;return Array.isArray(o)?a={tag:"g",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.PRIMARY),fill:"currentColor",d:o[1]}}]}:a={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:t,height:n,icon:a}}var TL={found:!1,width:512,height:512};function EL(e,t){!cx&&!ve.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function Kp(e,t){var n=t;return t==="fa"&&ve.styleDefault!==null&&(t=Bi()),new Promise(function(r,i){if(ri("missingIconAbstract"),n==="fa"){var o=xx(e)||{};e=o.iconName||e,t=o.prefix||t}if(e&&t&&ed[t]&&ed[t][e]){var a=ed[t][e];return r(Hp(a))}EL(e,t),r(pe(pe({},TL),{},{icon:ve.showMissingIcons&&e?ri("missingIconAbstract")||{}:{}}))})}var gg=function(){},Yp=ve.measurePerformance&&cl&&cl.mark&&cl.measure?cl:{mark:gg,measure:gg},Ns='FA "6.5.1"',IL=function(t){return Yp.mark("".concat(Ns," ").concat(t," begins")),function(){return Ex(t)}},Ex=function(t){Yp.mark("".concat(Ns," ").concat(t," ends")),Yp.measure("".concat(Ns," ").concat(t),"".concat(Ns," ").concat(t," begins"),"".concat(Ns," ").concat(t," ends"))},Xv={begin:IL,end:Ex},Ul=function(){};function bg(e){var t=e.getAttribute?e.getAttribute(No):null;return typeof t=="string"}function AL(e){var t=e.getAttribute?e.getAttribute(Bv):null,n=e.getAttribute?e.getAttribute(Uv):null;return t&&n}function $L(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(ve.replacementClass)}function OL(){if(ve.autoReplaceSvg===!0)return Gl.replace;var e=Gl[ve.autoReplaceSvg];return e||Gl.replace}function DL(e){return wt.createElementNS("http://www.w3.org/2000/svg",e)}function NL(e){return wt.createElement(e)}function Ix(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,r=n===void 0?e.tag==="svg"?DL:NL:n;if(typeof e=="string")return wt.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(Ix(a,{ceFn:r}))}),i}function PL(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var Gl={replace:function(t){var n=t[0];if(n.parentNode)if(t[1].forEach(function(i){n.parentNode.insertBefore(Ix(i),n)}),n.getAttribute(No)===null&&ve.keepOriginalSource){var r=wt.createComment(PL(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(t){var n=t[0],r=t[1];if(~zv(n).indexOf(ve.replacementClass))return Gl.replace(t);var i=new RegExp("".concat(ve.cssPrefix,"-.*"));if(delete r[0].attributes.id,r[0].attributes.class){var o=r[0].attributes.class.split(" ").reduce(function(s,u){return u===ve.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 qu(s)}).join(`
|
|
952
|
-
`);n.setAttribute(No,""),n.innerHTML=a}};function
|
|
953
|
-
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function
|
|
951
|
+
}`;function gx(){var e=fx,t=dx,n=ve.cssPrefix,r=ve.replacementClass,i=rL;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 pg=!1;function Qf(){ve.autoAddCss&&!pg&&(QF(gx()),pg=!0)}var iL={mixout:function(){return{dom:{css:gx,insertCss:Qf}}},hooks:function(){return{beforeDOMElementCreation:function(){Qf()},beforeI2svg:function(){Qf()}}}},ri=Vi||{};ri[ni]||(ri[ni]={});ri[ni].styles||(ri[ni].styles={});ri[ni].hooks||(ri[ni].hooks={});ri[ni].shims||(ri[ni].shims=[]);var Cr=ri[ni],bx=[],oL=function e(){wt.removeEventListener("DOMContentLoaded",e),yc=1,bx.map(function(t){return t()})},yc=!1;ui&&(yc=(wt.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(wt.readyState),yc||wt.addEventListener("DOMContentLoaded",oL));function aL(e){ui&&(yc?setTimeout(e,0):bx.push(e))}function qu(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"?yx(e):"<".concat(t," ").concat(eL(r),">").concat(o.map(qu).join(""),"</").concat(t,">")}function hg(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var sL=function(t,n){return function(r,i,o,a){return t.call(n,r,i,o,a)}},Zf=function(t,n,r,i){var o=Object.keys(t),a=o.length,s=i!==void 0?sL(n,i):n,u,l,c;for(r===void 0?(u=1,c=t[o[0]]):(u=0,c=r);u<a;u++)l=o[u],c=s(c,t[l],l,t);return c};function uL(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 Up(e){var t=uL(e);return t.length===1?t[0].toString(16):null}function lL(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 vg(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 Gp(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,o=vg(t);typeof Cr.hooks.addPack=="function"&&!i?Cr.hooks.addPack(e,vg(t)):Cr.styles[e]=pe(pe({},Cr.styles[e]||{}),o),e==="fas"&&Gp("fa",t)}var ml,yl,gl,pa=Cr.styles,cL=Cr.shims,fL=(ml={},en(ml,St,Object.values(cu[St])),en(ml,jt,Object.values(cu[jt])),ml),Wv=null,Sx={},Cx={},wx={},xx={},Tx={},dL=(yl={},en(yl,St,Object.keys(uu[St])),en(yl,jt,Object.keys(uu[jt])),yl);function pL(e){return~HF.indexOf(e)}function hL(e,t){var n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!pL(i)?i:null}var Ex=function(){var t=function(o){return Zf(pa,function(a,s,u){return a[u]=Zf(s,o,{}),a},{})};Sx=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}),Cx=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}),Tx=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 pa||ve.autoFetchSvg,r=Zf(cL,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:{}});wx=r.names,xx=r.unicodes,Wv=$f(ve.styleDefault,{family:ve.familyDefault})};XF(function(e){Wv=$f(e.styleDefault,{family:ve.familyDefault})});Ex();function Hv(e,t){return(Sx[e]||{})[t]}function vL(e,t){return(Cx[e]||{})[t]}function ho(e,t){return(Tx[e]||{})[t]}function Ix(e){return wx[e]||{prefix:null,iconName:null}}function mL(e){var t=xx[e],n=Hv("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Bi(){return Wv}var Kv=function(){return{prefix:null,iconName:null,rest:[]}};function $f(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,r=n===void 0?St:n,i=uu[r][e],o=lu[r][e]||lu[r][i],a=e in Cr.styles?e:null;return o||a||null}var mg=(gl={},en(gl,St,Object.keys(cu[St])),en(gl,jt,Object.keys(cu[jt])),gl);function Of(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,o=(t={},en(t,St,"".concat(ve.cssPrefix,"-").concat(St)),en(t,jt,"".concat(ve.cssPrefix,"-").concat(jt)),t),a=null,s=St;(e.includes(o[St])||e.some(function(l){return mg[St].includes(l)}))&&(s=St),(e.includes(o[jt])||e.some(function(l){return mg[jt].includes(l)}))&&(s=jt);var u=e.reduce(function(l,c){var f=hL(ve.cssPrefix,c);if(pa[c]?(c=fL[s].includes(c)?VF[s][c]:c,a=c,l.prefix=c):dL[s].indexOf(c)>-1?(a=c,l.prefix=$f(c,{family:s})):f?l.iconName=f:c!==ve.replacementClass&&c!==o[St]&&c!==o[jt]&&l.rest.push(c),!i&&l.prefix&&l.iconName){var d=a==="fa"?Ix(l.iconName):{},h=ho(l.prefix,l.iconName);d.prefix&&(a=null),l.iconName=d.iconName||h||l.iconName,l.prefix=d.prefix||l.prefix,l.prefix==="far"&&!pa.far&&pa.fas&&!ve.autoFetchSvg&&(l.prefix="fas")}return l},Kv());return(e.includes("fa-brands")||e.includes("fab"))&&(u.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(u.prefix="fad"),!u.prefix&&s===jt&&(pa.fass||ve.autoFetchSvg)&&(u.prefix="fass",u.iconName=ho(u.prefix,u.iconName)||u.iconName),(u.prefix==="fa"||a==="fa")&&(u.prefix=Bi()||"fas"),u}var yL=function(){function e(){OF(this,e),this.definitions={}}return DF(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]),Gp(s,a[s]);var u=cu[St][s];u&&Gp(u,a[s]),Ex()})}},{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,l=a.icon,c=l[2];n[s]||(n[s]={}),c.length>0&&c.forEach(function(f){typeof f=="string"&&(n[s][f]=l)}),n[s][u]=l}),n}}]),e}(),yg=[],ha={},Ca={},gL=Object.keys(Ca);function bL(e,t){var n=t.mixoutsTo;return yg=e,ha={},Object.keys(Ca).forEach(function(r){gL.indexOf(r)===-1&&delete Ca[r]}),yg.forEach(function(r){var i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(function(a){typeof i[a]=="function"&&(n[a]=i[a]),mc(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){ha[a]||(ha[a]=[]),ha[a].push(o[a])})}r.provides&&r.provides(Ca)}),n}function zp(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=ha[e]||[];return o.forEach(function(a){t=a.apply(null,[t].concat(r))}),t}function Po(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=ha[e]||[];i.forEach(function(o){o.apply(null,n)})}function ii(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Ca[e]?Ca[e].apply(null,t):void 0}function Wp(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||Bi();if(t)return t=ho(n,t)||t,hg(Ax.definitions,n,t)||hg(Cr.styles,n,t)}var Ax=new yL,SL=function(){ve.autoReplaceSvg=!1,ve.observeMutations=!1,Po("noAuto")},CL={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ui?(Po("beforeI2svg",t),ii("pseudoElements2svg",t),ii("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;ve.autoReplaceSvg===!1&&(ve.autoReplaceSvg=!0),ve.observeMutations=!0,aL(function(){xL({autoReplaceSvgRoot:n}),Po("watch",t)})}},wL={icon:function(t){if(t===null)return null;if(mc(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:ho(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=$f(t[0]);return{prefix:r,iconName:ho(r,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(ve.cssPrefix,"-"))>-1||t.match(BF))){var i=Of(t.split(" "),{skipLookups:!0});return{prefix:i.prefix||Bi(),iconName:ho(i.prefix,i.iconName)||i.iconName}}if(typeof t=="string"){var o=Bi();return{prefix:o,iconName:ho(o,t)||t}}}},nr={noAuto:SL,config:ve,dom:CL,parse:wL,library:Ax,findIconDefinition:Wp,toHtml:qu},xL=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,r=n===void 0?wt:n;(Object.keys(Cr.styles).length>0||ve.autoFetchSvg)&&ui&&ve.autoReplaceSvg&&nr.dom.i2svg({node:r})};function Df(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(r){return qu(r)})}}),Object.defineProperty(e,"node",{get:function(){if(ui){var r=wt.createElement("div");return r.innerHTML=e.html,r.children}}}),e}function TL(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,o=e.styles,a=e.transform;if(zv(a)&&n.found&&!r.found){var s=n.width,u=n.height,l={x:s/u/2,y:.5};i.style=Af(pe(pe({},o),{},{"transform-origin":"".concat(l.x+a.x/16,"em ").concat(l.y+a.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}function EL(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,o=e.symbol,a=o===!0?"".concat(t,"-").concat(ve.cssPrefix,"-").concat(n):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:pe(pe({},i),{},{id:a}),children:r}]}]}function Yv(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,l=e.maskId,c=e.titleId,f=e.extra,d=e.watchable,h=d===void 0?!1:d,p=r.found?r:n,v=p.width,g=p.height,C=i==="fak",m=[ve.replacementClass,o?"".concat(ve.cssPrefix,"-").concat(o):""].filter(function(I){return f.classes.indexOf(I)===-1}).filter(function(I){return I!==""||!!I}).concat(f.classes).join(" "),b={children:[],attributes:pe(pe({},f.attributes),{},{"data-prefix":i,"data-icon":o,class:m,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(v," ").concat(g)})},x=C&&!~f.classes.indexOf("fa-fw")?{width:"".concat(v/g*16*.0625,"em")}:{};h&&(b.attributes[No]=""),u&&(b.children.push({tag:"title",attributes:{id:b.attributes["aria-labelledby"]||"title-".concat(c||du())},children:[u]}),delete b.attributes.title);var T=pe(pe({},b),{},{prefix:i,iconName:o,main:n,mask:r,maskId:l,transform:a,symbol:s,styles:pe(pe({},x),f.styles)}),E=r.found&&n.found?ii("generateAbstractMask",T)||{children:[],attributes:{}}:ii("generateAbstractIcon",T)||{children:[],attributes:{}},A=E.children,N=E.attributes;return T.children=A,T.attributes=N,s?EL(T):TL(T)}function gg(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,l=pe(pe(pe({},a.attributes),o?{title:o}:{}),{},{class:a.classes.join(" ")});u&&(l[No]="");var c=pe({},a.styles);zv(i)&&(c.transform=nL({transform:i,startCentered:!0,width:n,height:r}),c["-webkit-transform"]=c.transform);var f=Af(c);f.length>0&&(l.style=f);var d=[];return d.push({tag:"span",attributes:l,children:[t]}),o&&d.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),d}function IL(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=Af(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 ed=Cr.styles;function Hp(e){var t=e[0],n=e[1],r=e.slice(4),i=Fv(r,1),o=i[0],a=null;return Array.isArray(o)?a={tag:"g",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.PRIMARY),fill:"currentColor",d:o[1]}}]}:a={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:t,height:n,icon:a}}var AL={found:!1,width:512,height:512};function $L(e,t){!px&&!ve.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function Kp(e,t){var n=t;return t==="fa"&&ve.styleDefault!==null&&(t=Bi()),new Promise(function(r,i){if(ii("missingIconAbstract"),n==="fa"){var o=Ix(e)||{};e=o.iconName||e,t=o.prefix||t}if(e&&t&&ed[t]&&ed[t][e]){var a=ed[t][e];return r(Hp(a))}$L(e,t),r(pe(pe({},AL),{},{icon:ve.showMissingIcons&&e?ii("missingIconAbstract")||{}:{}}))})}var bg=function(){},Yp=ve.measurePerformance&&cl&&cl.mark&&cl.measure?cl:{mark:bg,measure:bg},Ns='FA "6.5.1"',OL=function(t){return Yp.mark("".concat(Ns," ").concat(t," begins")),function(){return $x(t)}},$x=function(t){Yp.mark("".concat(Ns," ").concat(t," ends")),Yp.measure("".concat(Ns," ").concat(t),"".concat(Ns," ").concat(t," begins"),"".concat(Ns," ").concat(t," ends"))},Jv={begin:OL,end:$x},Ul=function(){};function Sg(e){var t=e.getAttribute?e.getAttribute(No):null;return typeof t=="string"}function DL(e){var t=e.getAttribute?e.getAttribute(Vv):null,n=e.getAttribute?e.getAttribute(Bv):null;return t&&n}function NL(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(ve.replacementClass)}function PL(){if(ve.autoReplaceSvg===!0)return Gl.replace;var e=Gl[ve.autoReplaceSvg];return e||Gl.replace}function RL(e){return wt.createElementNS("http://www.w3.org/2000/svg",e)}function kL(e){return wt.createElement(e)}function Ox(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,r=n===void 0?e.tag==="svg"?RL:kL:n;if(typeof e=="string")return wt.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(Ox(a,{ceFn:r}))}),i}function ML(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var Gl={replace:function(t){var n=t[0];if(n.parentNode)if(t[1].forEach(function(i){n.parentNode.insertBefore(Ox(i),n)}),n.getAttribute(No)===null&&ve.keepOriginalSource){var r=wt.createComment(ML(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(t){var n=t[0],r=t[1];if(~Gv(n).indexOf(ve.replacementClass))return Gl.replace(t);var i=new RegExp("".concat(ve.cssPrefix,"-.*"));if(delete r[0].attributes.id,r[0].attributes.class){var o=r[0].attributes.class.split(" ").reduce(function(s,u){return u===ve.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 qu(s)}).join(`
|
|
952
|
+
`);n.setAttribute(No,""),n.innerHTML=a}};function Cg(e){e()}function Dx(e,t){var n=typeof t=="function"?t:Ul;if(e.length===0)n();else{var r=Cg;ve.mutateApproach===FF&&(r=Vi.requestAnimationFrame||Cg),r(function(){var i=PL(),o=Jv.begin("mutate");e.map(i),o(),n()})}}var Xv=!1;function Nx(){Xv=!0}function Jp(){Xv=!1}var gc=null;function wg(e){if(fg&&ve.observeMutations){var t=e.treeCallback,n=t===void 0?Ul:t,r=e.nodeCallback,i=r===void 0?Ul:r,o=e.pseudoElementsCallback,a=o===void 0?Ul:o,s=e.observeMutationsRoot,u=s===void 0?wt:s;gc=new fg(function(l){if(!Xv){var c=Bi();as(l).forEach(function(f){if(f.type==="childList"&&f.addedNodes.length>0&&!Sg(f.addedNodes[0])&&(ve.searchPseudoElements&&a(f.target),n(f.target)),f.type==="attributes"&&f.target.parentNode&&ve.searchPseudoElements&&a(f.target.parentNode),f.type==="attributes"&&Sg(f.target)&&~WF.indexOf(f.attributeName))if(f.attributeName==="class"&&DL(f.target)){var d=Of(Gv(f.target)),h=d.prefix,p=d.iconName;f.target.setAttribute(Vv,h||c),p&&f.target.setAttribute(Bv,p)}else NL(f.target)&&i(f.target)})}}),ui&&gc.observe(u,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function jL(){gc&&gc.disconnect()}function _L(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 qL(e){var t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=e.innerText!==void 0?e.innerText.trim():"",i=Of(Gv(e));return i.prefix||(i.prefix=Bi()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=vL(i.prefix,e.innerText)||Hv(i.prefix,Up(e.innerText))),!i.iconName&&ve.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i}function FL(e){var t=as(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 ve.autoA11y&&(n?t["aria-labelledby"]="".concat(ve.replacementClass,"-title-").concat(r||du()):(t["aria-hidden"]="true",t.focusable="false")),t}function LL(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Pr,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function xg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=qL(e),r=n.iconName,i=n.prefix,o=n.rest,a=FL(e),s=zp("parseNodeAttributes",{},e),u=t.styleParser?_L(e):[];return pe({iconName:r,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:i,transform:Pr,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:u,attributes:a}},s)}var VL=Cr.styles;function Px(e){var t=ve.autoReplaceSvg==="nest"?xg(e,{styleParser:!1}):xg(e);return~t.extra.classes.indexOf(hx)?ii("generateLayersText",e,t):ii("generateSvgReplacementMutation",e,t)}var Ui=new Set;Uv.map(function(e){Ui.add("fa-".concat(e))});Object.keys(uu[St]).map(Ui.add.bind(Ui));Object.keys(uu[jt]).map(Ui.add.bind(Ui));Ui=ju(Ui);function Tg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!ui)return Promise.resolve();var n=wt.documentElement.classList,r=function(f){return n.add("".concat(dg,"-").concat(f))},i=function(f){return n.remove("".concat(dg,"-").concat(f))},o=ve.autoFetchSvg?Ui:Uv.map(function(c){return"fa-".concat(c)}).concat(Object.keys(VL));o.includes("fa")||o.push("fa");var a=[".".concat(hx,":not([").concat(No,"])")].concat(o.map(function(c){return".".concat(c,":not([").concat(No,"])")})).join(", ");if(a.length===0)return Promise.resolve();var s=[];try{s=as(e.querySelectorAll(a))}catch{}if(s.length>0)r("pending"),i("complete");else return Promise.resolve();var u=Jv.begin("onTree"),l=s.reduce(function(c,f){try{var d=Px(f);d&&c.push(d)}catch(h){px||h.name==="MissingIcon"&&console.error(h)}return c},[]);return new Promise(function(c,f){Promise.all(l).then(function(d){Dx(d,function(){r("active"),r("complete"),i("pending"),typeof t=="function"&&t(),u(),c()})}).catch(function(d){u(),f(d)})})}function BL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Px(e).then(function(n){n&&Dx([n],t)})}function UL(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(t||{}).icon?t:Wp(t||{}),i=n.mask;return i&&(i=(i||{}).icon?i:Wp(i||{})),e(r,pe(pe({},n),{},{mask:i}))}}var GL=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.transform,i=r===void 0?Pr:r,o=n.symbol,a=o===void 0?!1:o,s=n.mask,u=s===void 0?null:s,l=n.maskId,c=l===void 0?null:l,f=n.title,d=f===void 0?null:f,h=n.titleId,p=h===void 0?null:h,v=n.classes,g=v===void 0?[]:v,C=n.attributes,m=C===void 0?{}:C,b=n.styles,x=b===void 0?{}:b;if(t){var T=t.prefix,E=t.iconName,A=t.icon;return Df(pe({type:"icon"},t),function(){return Po("beforeDOMElementCreation",{iconDefinition:t,params:n}),ve.autoA11y&&(d?m["aria-labelledby"]="".concat(ve.replacementClass,"-title-").concat(p||du()):(m["aria-hidden"]="true",m.focusable="false")),Yv({icons:{main:Hp(A),mask:u?Hp(u.icon):{found:!1,width:null,height:null,icon:{}}},prefix:T,iconName:E,transform:pe(pe({},Pr),i),symbol:a,title:d,maskId:c,titleId:p,extra:{attributes:m,styles:x,classes:g}})})}},zL={mixout:function(){return{icon:UL(GL)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=Tg,n.nodeCallback=BL,n}}},provides:function(t){t.i2svg=function(n){var r=n.node,i=r===void 0?wt:r,o=n.callback,a=o===void 0?function(){}:o;return Tg(i,a)},t.generateSvgReplacementMutation=function(n,r){var i=r.iconName,o=r.title,a=r.titleId,s=r.prefix,u=r.transform,l=r.symbol,c=r.mask,f=r.maskId,d=r.extra;return new Promise(function(h,p){Promise.all([Kp(i,s),c.iconName?Kp(c.iconName,c.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(v){var g=Fv(v,2),C=g[0],m=g[1];h([n,Yv({icons:{main:C,mask:m},prefix:s,iconName:i,transform:u,symbol:l,maskId:f,title:o,titleId:a,extra:d,watchable:!0})])}).catch(p)})},t.generateAbstractIcon=function(n){var r=n.children,i=n.attributes,o=n.main,a=n.transform,s=n.styles,u=Af(s);u.length>0&&(i.style=u);var l;return zv(a)&&(l=ii("generateAbstractTransformGrouping",{main:o,transform:a,containerWidth:o.width,iconWidth:o.width})),r.push(l||o.icon),{children:r,attributes:i}}}},WL={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 Df({type:"layer"},function(){Po("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(ve.cssPrefix,"-layers")].concat(ju(o)).join(" ")},children:a}]})}}}},HL={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,l=u===void 0?{}:u,c=r.styles,f=c===void 0?{}:c;return Df({type:"counter",content:n},function(){return Po("beforeDOMElementCreation",{content:n,params:r}),IL({content:n.toString(),title:o,extra:{attributes:l,styles:f,classes:["".concat(ve.cssPrefix,"-layers-counter")].concat(ju(s))}})})}}}},KL={mixout:function(){return{text:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.transform,o=i===void 0?Pr:i,a=r.title,s=a===void 0?null:a,u=r.classes,l=u===void 0?[]:u,c=r.attributes,f=c===void 0?{}:c,d=r.styles,h=d===void 0?{}:d;return Df({type:"text",content:n},function(){return Po("beforeDOMElementCreation",{content:n,params:r}),gg({content:n,transform:pe(pe({},Pr),o),title:s,extra:{attributes:f,styles:h,classes:["".concat(ve.cssPrefix,"-layers-text")].concat(ju(l))}})})}}},provides:function(t){t.generateLayersText=function(n,r){var i=r.title,o=r.transform,a=r.extra,s=null,u=null;if(cx){var l=parseInt(getComputedStyle(n).fontSize,10),c=n.getBoundingClientRect();s=c.width/l,u=c.height/l}return ve.autoA11y&&!i&&(a.attributes["aria-hidden"]="true"),Promise.resolve([n,gg({content:n.innerHTML,width:s,height:u,transform:o,title:i,extra:a,watchable:!0})])}}},YL=new RegExp('"',"ug"),Eg=[1105920,1112319];function JL(e){var t=e.replace(YL,""),n=lL(t,0),r=n>=Eg[0]&&n<=Eg[1],i=t.length===2?t[0]===t[1]:!1;return{value:Up(i?t[0]:t),isSecondary:r||i}}function Ig(e,t){var n="".concat(qF).concat(t.replace(":","-"));return new Promise(function(r,i){if(e.getAttribute(n)!==null)return r();var o=as(e.children),a=o.filter(function(A){return A.getAttribute(Bp)===t})[0],s=Vi.getComputedStyle(e,t),u=s.getPropertyValue("font-family").match(UF),l=s.getPropertyValue("font-weight"),c=s.getPropertyValue("content");if(a&&!u)return e.removeChild(a),r();if(u&&c!=="none"&&c!==""){var f=s.getPropertyValue("content"),d=~["Sharp"].indexOf(u[2])?jt:St,h=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(u[2])?lu[d][u[2].toLowerCase()]:GF[d][l],p=JL(f),v=p.value,g=p.isSecondary,C=u[0].startsWith("FontAwesome"),m=Hv(h,v),b=m;if(C){var x=mL(v);x.iconName&&x.prefix&&(m=x.iconName,h=x.prefix)}if(m&&!g&&(!a||a.getAttribute(Vv)!==h||a.getAttribute(Bv)!==b)){e.setAttribute(n,b),a&&e.removeChild(a);var T=LL(),E=T.extra;E.attributes[Bp]=t,Kp(m,h).then(function(A){var N=Yv(pe(pe({},T),{},{icons:{main:A,mask:Kv()},prefix:h,iconName:b,extra:E,watchable:!0})),I=wt.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(I,e.firstChild):e.appendChild(I),I.outerHTML=N.map(function(P){return qu(P)}).join(`
|
|
953
|
+
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function XL(e){return Promise.all([Ig(e,"::before"),Ig(e,"::after")])}function QL(e){return e.parentNode!==document.head&&!~LF.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(Bp)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function Ag(e){if(ui)return new Promise(function(t,n){var r=as(e.querySelectorAll("*")).filter(QL).map(XL),i=Jv.begin("searchPseudoElements");Nx(),Promise.all(r).then(function(){i(),Jp(),t()}).catch(function(){i(),Jp(),n()})})}var ZL={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?wt:r;ve.searchPseudoElements&&Ag(i)}}},$g=!1,eV={mixout:function(){return{dom:{unwatch:function(){Nx(),$g=!0}}}},hooks:function(){return{bootstrap:function(){wg(zp("mutationObserverCallbacks",{}))},noAuto:function(){jL()},watch:function(n){var r=n.observeMutationsRoot;$g?Jp():wg(zp("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}},Og=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)},tV={mixout:function(){return{parse:{transform:function(n){return Og(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-transform");return i&&(n.transform=Og(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,") "),l="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),c="rotate(".concat(i.rotate," 0 0)"),f={transform:"".concat(u," ").concat(l," ").concat(c)},d={transform:"translate(".concat(a/2*-1," -256)")},h={outer:s,inner:f,path:d};return{tag:"g",attributes:pe({},h.outer),children:[{tag:"g",attributes:pe({},h.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:pe(pe({},r.icon.attributes),h.path)}]}]}}}},td={x:0,y:0,width:"100%",height:"100%"};function Dg(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 nV(e){return e.tag==="g"?e.children:[e]}var rV={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-mask"),o=i?Of(i.split(" ").map(function(a){return a.trim()})):Kv();return o.prefix||(o.prefix=Bi()),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,l=o.width,c=o.icon,f=a.width,d=a.icon,h=tL({transform:u,containerWidth:f,iconWidth:l}),p={tag:"rect",attributes:pe(pe({},td),{},{fill:"white"})},v=c.children?{children:c.children.map(Dg)}:{},g={tag:"g",attributes:pe({},h.inner),children:[Dg(pe({tag:c.tag,attributes:pe(pe({},c.attributes),h.path)},v))]},C={tag:"g",attributes:pe({},h.outer),children:[g]},m="mask-".concat(s||du()),b="clip-".concat(s||du()),x={tag:"mask",attributes:pe(pe({},td),{},{id:m,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[p,C]},T={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:nV(d)},x]};return r.push(T,{tag:"rect",attributes:pe({fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(m,")")},td)}),{children:r,attributes:i}}}},iV={provides:function(t){var n=!1;Vi.matchMedia&&(n=Vi.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}}}},oV={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}}}},aV=[iL,zL,WL,HL,KL,ZL,eV,tV,rV,iV,oV];bL(aV,{mixoutsTo:nr});nr.noAuto;nr.config;nr.library;nr.dom;var Xp=nr.parse;nr.findIconDefinition;nr.toHtml;var sV=nr.icon;nr.layer;nr.text;nr.counter;var Qp={exports:{}},bl={exports:{}},at={};/** @license React v16.13.1
|
|
954
954
|
* react-is.production.min.js
|
|
955
955
|
*
|
|
956
956
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
957
957
|
*
|
|
958
958
|
* This source code is licensed under the MIT license found in the
|
|
959
959
|
* LICENSE file in the root directory of this source tree.
|
|
960
|
-
*/var
|
|
960
|
+
*/var Ng;function uV(){if(Ng)return at;Ng=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,l=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function b(T){if(typeof T=="object"&&T!==null){var E=T.$$typeof;switch(E){case t:switch(T=T.type,T){case u:case l:case r:case o:case i:case f:return T;default:switch(T=T&&T.$$typeof,T){case s:case c:case p:case h:case a:return T;default:return E}}case n:return E}}}function x(T){return b(T)===l}return at.AsyncMode=u,at.ConcurrentMode=l,at.ContextConsumer=s,at.ContextProvider=a,at.Element=t,at.ForwardRef=c,at.Fragment=r,at.Lazy=p,at.Memo=h,at.Portal=n,at.Profiler=o,at.StrictMode=i,at.Suspense=f,at.isAsyncMode=function(T){return x(T)||b(T)===u},at.isConcurrentMode=x,at.isContextConsumer=function(T){return b(T)===s},at.isContextProvider=function(T){return b(T)===a},at.isElement=function(T){return typeof T=="object"&&T!==null&&T.$$typeof===t},at.isForwardRef=function(T){return b(T)===c},at.isFragment=function(T){return b(T)===r},at.isLazy=function(T){return b(T)===p},at.isMemo=function(T){return b(T)===h},at.isPortal=function(T){return b(T)===n},at.isProfiler=function(T){return b(T)===o},at.isStrictMode=function(T){return b(T)===i},at.isSuspense=function(T){return b(T)===f},at.isValidElementType=function(T){return typeof T=="string"||typeof T=="function"||T===r||T===l||T===o||T===i||T===f||T===d||typeof T=="object"&&T!==null&&(T.$$typeof===p||T.$$typeof===h||T.$$typeof===a||T.$$typeof===s||T.$$typeof===c||T.$$typeof===g||T.$$typeof===C||T.$$typeof===m||T.$$typeof===v)},at.typeOf=b,at}var st={};/** @license React v16.13.1
|
|
961
961
|
* react-is.development.js
|
|
962
962
|
*
|
|
963
963
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
964
964
|
*
|
|
965
965
|
* This source code is licensed under the MIT license found in the
|
|
966
966
|
* LICENSE file in the root directory of this source tree.
|
|
967
|
-
*/var
|
|
967
|
+
*/var Pg;function lV(){return Pg||(Pg=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,l=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function b(le){return typeof le=="string"||typeof le=="function"||le===r||le===l||le===o||le===i||le===f||le===d||typeof le=="object"&&le!==null&&(le.$$typeof===p||le.$$typeof===h||le.$$typeof===a||le.$$typeof===s||le.$$typeof===c||le.$$typeof===g||le.$$typeof===C||le.$$typeof===m||le.$$typeof===v)}function x(le){if(typeof le=="object"&&le!==null){var Pn=le.$$typeof;switch(Pn){case t:var pi=le.type;switch(pi){case u:case l:case r:case o:case i:case f:return pi;default:var Bo=pi&&pi.$$typeof;switch(Bo){case s:case c:case p:case h:case a:return Bo;default:return Pn}}case n:return Pn}}}var T=u,E=l,A=s,N=a,I=t,P=c,_=r,L=p,U=h,Y=n,k=o,ie=i,B=f,G=!1;function fe(le){return G||(G=!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.")),j(le)||x(le)===u}function j(le){return x(le)===l}function R(le){return x(le)===s}function te(le){return x(le)===a}function oe(le){return typeof le=="object"&&le!==null&&le.$$typeof===t}function X(le){return x(le)===c}function ae(le){return x(le)===r}function de(le){return x(le)===p}function he(le){return x(le)===h}function Te(le){return x(le)===n}function ke(le){return x(le)===o}function Ne(le){return x(le)===i}function mt(le){return x(le)===f}st.AsyncMode=T,st.ConcurrentMode=E,st.ContextConsumer=A,st.ContextProvider=N,st.Element=I,st.ForwardRef=P,st.Fragment=_,st.Lazy=L,st.Memo=U,st.Portal=Y,st.Profiler=k,st.StrictMode=ie,st.Suspense=B,st.isAsyncMode=fe,st.isConcurrentMode=j,st.isContextConsumer=R,st.isContextProvider=te,st.isElement=oe,st.isForwardRef=X,st.isFragment=ae,st.isLazy=de,st.isMemo=he,st.isPortal=Te,st.isProfiler=ke,st.isStrictMode=Ne,st.isSuspense=mt,st.isValidElementType=b,st.typeOf=x}()),st}var Rg;function Rx(){return Rg||(Rg=1,process.env.NODE_ENV==="production"?bl.exports=uV():bl.exports=lV()),bl.exports}/*
|
|
968
968
|
object-assign
|
|
969
969
|
(c) Sindre Sorhus
|
|
970
970
|
@license MIT
|
|
971
|
-
*/var nd,
|
|
972
|
-
Valid keys: `+JSON.stringify(Object.keys(j),null," "));var le=mt(he,Ne,X,ae,de+"."+Ne,n);if(le)return le}return null}return g(R)}function Y(j){switch(typeof j){case"number":case"string":case"undefined":return!0;case"boolean":return!j;case"object":if(Array.isArray(j))return j.every(Y);if(j===null||s(j))return!0;var R=f(j);if(R){var te=R.call(j),oe;if(R!==j.entries){for(;!(oe=te.next()).done;)if(!Y(oe.value))return!1}else for(;!(oe=te.next()).done;){var X=oe.value;if(X&&!Y(X[1]))return!1}}else return!1;return!0;default:return!1}}function k(j,R){return j==="symbol"?!0:R?R["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&R instanceof Symbol:!1}function ie(j){var R=typeof j;return Array.isArray(j)?"array":j instanceof RegExp?"object":k(R,j)?"symbol":R}function B(j){if(typeof j>"u"||j===null)return""+j;var R=ie(j);if(R==="object"){if(j instanceof Date)return"date";if(j instanceof RegExp)return"regexp"}return R}function G(j){var R=B(j);switch(R){case"array":case"object":return"an "+R;case"boolean":case"date":case"regexp":return"a "+R;default:return R}}function fe(j){return!j.constructor||!j.constructor.name?d:j.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},ad}var sd,
|
|
973
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
971
|
+
*/var nd,kg;function cV(){if(kg)return nd;kg=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(c){return a[c]});if(u.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(c){l[c]=c}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return nd=i()?Object.assign:function(o,a){for(var s,u=r(o),l,c=1;c<arguments.length;c++){s=Object(arguments[c]);for(var f in s)t.call(s,f)&&(u[f]=s[f]);if(e){l=e(s);for(var d=0;d<l.length;d++)n.call(s,l[d])&&(u[l[d]]=s[l[d]])}}return u},nd}var rd,Mg;function Qv(){if(Mg)return rd;Mg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return rd=e,rd}var id,jg;function kx(){return jg||(jg=1,id=Function.call.bind(Object.prototype.hasOwnProperty)),id}var od,_g;function fV(){if(_g)return od;_g=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Qv(),n={},r=kx();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,l){if(process.env.NODE_ENV!=="production"){for(var c in o)if(r(o,c)){var f;try{if(typeof o[c]!="function"){var d=Error((u||"React class")+": "+s+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=o[c](a,c,u,s,null,t)}catch(p){f=p}if(f&&!(f instanceof Error)&&e((u||"React class")+": type specification of "+s+" `"+c+"` 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 h=l?l():"";e("Failed "+s+" type: "+f.message+(h??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},od=i,od}var ad,qg;function dV(){if(qg)return ad;qg=1;var e=Rx(),t=cV(),n=Qv(),r=kx(),i=fV(),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 ad=function(s,u){var l=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function f(j){var R=j&&(l&&j[l]||j[c]);if(typeof R=="function")return R}var d="<<anonymous>>",h={array:C("array"),bigint:C("bigint"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:m(),arrayOf:b,element:x(),elementType:T(),instanceOf:E,node:P(),objectOf:N,oneOf:A,oneOfType:I,shape:L,exact:U};function p(j,R){return j===R?j!==0||1/j===1/R:j!==j&&R!==R}function v(j,R){this.message=j,this.data=R&&typeof R=="object"?R:{},this.stack=""}v.prototype=Error.prototype;function g(j){if(process.env.NODE_ENV!=="production")var R={},te=0;function oe(ae,de,he,Te,ke,Ne,mt){if(Te=Te||d,Ne=Ne||he,mt!==n){if(u){var le=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 le.name="Invariant Violation",le}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Pn=Te+":"+he;!R[Pn]&&te<3&&(o("You are manually calling a React.PropTypes validation function for the `"+Ne+"` prop on `"+Te+"`. 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."),R[Pn]=!0,te++)}}return de[he]==null?ae?de[he]===null?new v("The "+ke+" `"+Ne+"` is marked as required "+("in `"+Te+"`, but its value is `null`.")):new v("The "+ke+" `"+Ne+"` is marked as required in "+("`"+Te+"`, but its value is `undefined`.")):null:j(de,he,Te,ke,Ne)}var X=oe.bind(null,!1);return X.isRequired=oe.bind(null,!0),X}function C(j){function R(te,oe,X,ae,de,he){var Te=te[oe],ke=ie(Te);if(ke!==j){var Ne=B(Te);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+Ne+"` supplied to `"+X+"`, expected ")+("`"+j+"`."),{expectedType:j})}return null}return g(R)}function m(){return g(a)}function b(j){function R(te,oe,X,ae,de){if(typeof j!="function")return new v("Property `"+de+"` of component `"+X+"` has invalid PropType notation inside arrayOf.");var he=te[oe];if(!Array.isArray(he)){var Te=ie(he);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+Te+"` supplied to `"+X+"`, expected an array."))}for(var ke=0;ke<he.length;ke++){var Ne=j(he,ke,X,ae,de+"["+ke+"]",n);if(Ne instanceof Error)return Ne}return null}return g(R)}function x(){function j(R,te,oe,X,ae){var de=R[te];if(!s(de)){var he=ie(de);return new v("Invalid "+X+" `"+ae+"` of type "+("`"+he+"` supplied to `"+oe+"`, expected a single ReactElement."))}return null}return g(j)}function T(){function j(R,te,oe,X,ae){var de=R[te];if(!e.isValidElementType(de)){var he=ie(de);return new v("Invalid "+X+" `"+ae+"` of type "+("`"+he+"` supplied to `"+oe+"`, expected a single ReactElement type."))}return null}return g(j)}function E(j){function R(te,oe,X,ae,de){if(!(te[oe]instanceof j)){var he=j.name||d,Te=fe(te[oe]);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+Te+"` supplied to `"+X+"`, expected ")+("instance of `"+he+"`."))}return null}return g(R)}function A(j){if(!Array.isArray(j))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 R(te,oe,X,ae,de){for(var he=te[oe],Te=0;Te<j.length;Te++)if(p(he,j[Te]))return null;var ke=JSON.stringify(j,function(mt,le){var Pn=B(le);return Pn==="symbol"?String(le):le});return new v("Invalid "+ae+" `"+de+"` of value `"+String(he)+"` "+("supplied to `"+X+"`, expected one of "+ke+"."))}return g(R)}function N(j){function R(te,oe,X,ae,de){if(typeof j!="function")return new v("Property `"+de+"` of component `"+X+"` has invalid PropType notation inside objectOf.");var he=te[oe],Te=ie(he);if(Te!=="object")return new v("Invalid "+ae+" `"+de+"` of type "+("`"+Te+"` supplied to `"+X+"`, expected an object."));for(var ke in he)if(r(he,ke)){var Ne=j(he,ke,X,ae,de+"."+ke,n);if(Ne instanceof Error)return Ne}return null}return g(R)}function I(j){if(!Array.isArray(j))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var R=0;R<j.length;R++){var te=j[R];if(typeof te!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+G(te)+" at index "+R+"."),a}function oe(X,ae,de,he,Te){for(var ke=[],Ne=0;Ne<j.length;Ne++){var mt=j[Ne],le=mt(X,ae,de,he,Te,n);if(le==null)return null;le.data&&r(le.data,"expectedType")&&ke.push(le.data.expectedType)}var Pn=ke.length>0?", expected one of type ["+ke.join(", ")+"]":"";return new v("Invalid "+he+" `"+Te+"` supplied to "+("`"+de+"`"+Pn+"."))}return g(oe)}function P(){function j(R,te,oe,X,ae){return Y(R[te])?null:new v("Invalid "+X+" `"+ae+"` supplied to "+("`"+oe+"`, expected a ReactNode."))}return g(j)}function _(j,R,te,oe,X){return new v((j||"React class")+": "+R+" type `"+te+"."+oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+X+"`.")}function L(j){function R(te,oe,X,ae,de){var he=te[oe],Te=ie(he);if(Te!=="object")return new v("Invalid "+ae+" `"+de+"` of type `"+Te+"` "+("supplied to `"+X+"`, expected `object`."));for(var ke in j){var Ne=j[ke];if(typeof Ne!="function")return _(X,ae,de,ke,B(Ne));var mt=Ne(he,ke,X,ae,de+"."+ke,n);if(mt)return mt}return null}return g(R)}function U(j){function R(te,oe,X,ae,de){var he=te[oe],Te=ie(he);if(Te!=="object")return new v("Invalid "+ae+" `"+de+"` of type `"+Te+"` "+("supplied to `"+X+"`, expected `object`."));var ke=t({},te[oe],j);for(var Ne in ke){var mt=j[Ne];if(r(j,Ne)&&typeof mt!="function")return _(X,ae,de,Ne,B(mt));if(!mt)return new v("Invalid "+ae+" `"+de+"` key `"+Ne+"` supplied to `"+X+"`.\nBad object: "+JSON.stringify(te[oe],null," ")+`
|
|
972
|
+
Valid keys: `+JSON.stringify(Object.keys(j),null," "));var le=mt(he,Ne,X,ae,de+"."+Ne,n);if(le)return le}return null}return g(R)}function Y(j){switch(typeof j){case"number":case"string":case"undefined":return!0;case"boolean":return!j;case"object":if(Array.isArray(j))return j.every(Y);if(j===null||s(j))return!0;var R=f(j);if(R){var te=R.call(j),oe;if(R!==j.entries){for(;!(oe=te.next()).done;)if(!Y(oe.value))return!1}else for(;!(oe=te.next()).done;){var X=oe.value;if(X&&!Y(X[1]))return!1}}else return!1;return!0;default:return!1}}function k(j,R){return j==="symbol"?!0:R?R["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&R instanceof Symbol:!1}function ie(j){var R=typeof j;return Array.isArray(j)?"array":j instanceof RegExp?"object":k(R,j)?"symbol":R}function B(j){if(typeof j>"u"||j===null)return""+j;var R=ie(j);if(R==="object"){if(j instanceof Date)return"date";if(j instanceof RegExp)return"regexp"}return R}function G(j){var R=B(j);switch(R){case"array":case"object":return"an "+R;case"boolean":case"date":case"regexp":return"a "+R;default:return R}}function fe(j){return!j.constructor||!j.constructor.name?d:j.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},ad}var sd,Fg;function pV(){if(Fg)return sd;Fg=1;var e=Qv();function t(){}function n(){}return n.resetWarningCache=t,sd=function(){function r(a,s,u,l,c,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},sd}if(process.env.NODE_ENV!=="production"){var hV=Rx(),vV=!0;Qp.exports=dV()(hV.isElement,vV)}else Qp.exports=pV()();var mV=Qp.exports;const _e=bS(mV);function Lg(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 Ai(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lg(Object(n),!0).forEach(function(r){va(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bc(e){"@babel/helpers - typeof";return bc=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},bc(e)}function va(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yV(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 gV(e,t){if(e==null)return{};var n=yV(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 Zp(e){return bV(e)||SV(e)||CV(e)||wV()}function bV(e){if(Array.isArray(e))return eh(e)}function SV(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CV(e,t){if(e){if(typeof e=="string")return eh(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 eh(e,t)}}function eh(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 wV(){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 xV(e){var t,n=e.beat,r=e.fade,i=e.beatFade,o=e.bounce,a=e.shake,s=e.flash,u=e.spin,l=e.spinPulse,c=e.spinReverse,f=e.pulse,d=e.fixedWidth,h=e.inverse,p=e.border,v=e.listItem,g=e.flip,C=e.size,m=e.rotation,b=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":c,"fa-spin-pulse":l,"fa-pulse":f,"fa-fw":d,"fa-inverse":h,"fa-border":p,"fa-li":v,"fa-flip":g===!0,"fa-flip-horizontal":g==="horizontal"||g==="both","fa-flip-vertical":g==="vertical"||g==="both"},va(t,"fa-".concat(C),typeof C<"u"&&C!==null),va(t,"fa-rotate-".concat(m),typeof m<"u"&&m!==null&&m!==0),va(t,"fa-pull-".concat(b),typeof b<"u"&&b!==null),va(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(x).map(function(T){return x[T]?T:null}).filter(function(T){return T})}function TV(e){return e=e-0,e===e}function Mx(e){return TV(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(t,n){return n?n.toUpperCase():""}),e.substr(0,1).toLowerCase()+e.substr(1))}var EV=["style"];function IV(e){return e.charAt(0).toUpperCase()+e.slice(1)}function AV(e){return e.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,n){var r=n.indexOf(":"),i=Mx(n.slice(0,r)),o=n.slice(r+1).trim();return i.startsWith("webkit")?t[IV(i)]=o:t[i]=o,t},{})}function jx(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 jx(e,u)}),i=Object.keys(t.attributes||{}).reduce(function(u,l){var c=t.attributes[l];switch(l){case"class":u.attrs.className=c,delete t.attributes.class;break;case"style":u.attrs.style=AV(c);break;default:l.indexOf("aria-")===0||l.indexOf("data-")===0?u.attrs[l.toLowerCase()]=c:u.attrs[Mx(l)]=c}return u},{attrs:{}}),o=n.style,a=o===void 0?{}:o,s=gV(n,EV);return i.attrs.style=Ai(Ai({},i.attrs.style),a),e.apply(void 0,[t.tag,Ai(Ai({},i.attrs),s)].concat(Zp(r)))}var _x=!1;try{_x=process.env.NODE_ENV==="production"}catch{}function $V(){if(!_x&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Vg(e){if(e&&bc(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Xp.icon)return Xp.icon(e);if(e===null)return null;if(e&&bc(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 ud(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?va({},e,t):{}}var Gi=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,l=Vg(n),c=ud("classes",[].concat(Zp(xV(e)),Zp(o.split(" ")))),f=ud("transform",typeof e.transform=="string"?Xp.transform(e.transform):e.transform),d=ud("mask",Vg(r)),h=sV(l,Ai(Ai(Ai(Ai({},c),f),d),{},{symbol:i,title:a,titleId:s,maskId:u}));if(!h)return $V("Could not find icon",l),null;var p=h.abstract,v={ref:t};return Object.keys(e).forEach(function(g){Gi.defaultProps.hasOwnProperty(g)||(v[g]=e[g])}),OV(p[0],v)});Gi.displayName="FontAwesomeIcon";Gi.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};Gi.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 OV=jx.bind(null,O.createElement);function qx(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=qx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function DV(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=qx(e))&&(r&&(r+=" "),r+=t);return r}var Sc=jm&&jm.__assign||function(){return Sc=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},Sc.apply(this,arguments)};function NV(e,t,n){if(t==="className")e.className=[e.className,n].join(" ").trim();else if(t==="style")e.style=Sc(Sc({},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 PV=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)NV(r,o,i[o]);return r},{})};const Fx=bS(PV);/*!
|
|
974
974
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
975
975
|
* http://github.com/janl/mustache.js
|
|
976
|
-
*/var
|
|
977
|
-
`&&(c(),u="",l=0,n=!1);if(!v.scan(f))break;if(a=!0,C=v.scan(
|
|
976
|
+
*/var RV=Object.prototype.toString,ss=Array.isArray||function(t){return RV.call(t)==="[object Array]"};function Zv(e){return typeof e=="function"}function kV(e){return ss(e)?"array":typeof e}function ld(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Bg(e,t){return e!=null&&typeof e=="object"&&t in e}function MV(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var jV=RegExp.prototype.test;function _V(e,t){return jV.call(e,t)}var qV=/\S/;function FV(e){return!_V(qV,e)}var LV={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function VV(e){return String(e).replace(/[&<>"'`=\/]/g,function(n){return LV[n]})}var BV=/\s*/,UV=/\s+/,Ug=/\s*=/,GV=/\s*\}/,zV=/#|\^|\/|>|\{|&|=|!/;function WV(e,t){if(!e)return[];var n=!1,r=[],i=[],o=[],a=!1,s=!1,u="",l=0;function c(){if(a&&!s)for(;o.length;)delete i[o.pop()];else o=[];a=!1,s=!1}var f,d,h;function p(N){if(typeof N=="string"&&(N=N.split(UV,2)),!ss(N)||N.length!==2)throw new Error("Invalid tags: "+N);f=new RegExp(ld(N[0])+"\\s*"),d=new RegExp("\\s*"+ld(N[1])),h=new RegExp("\\s*"+ld("}"+N[1]))}p(t||cr.tags);for(var v=new Fu(e),g,C,m,b,x,T;!v.eos();){if(g=v.pos,m=v.scanUntil(f),m)for(var E=0,A=m.length;E<A;++E)b=m.charAt(E),FV(b)?(o.push(i.length),u+=b):(s=!0,n=!0,u+=" "),i.push(["text",b,g,g+1]),g+=1,b===`
|
|
977
|
+
`&&(c(),u="",l=0,n=!1);if(!v.scan(f))break;if(a=!0,C=v.scan(zV)||"name",v.scan(BV),C==="="?(m=v.scanUntil(Ug),v.scan(Ug),v.scanUntil(d)):C==="{"?(m=v.scanUntil(h),v.scan(GV),v.scanUntil(d),C="&"):m=v.scanUntil(d),!v.scan(d))throw new Error("Unclosed tag at "+v.pos);if(C==">"?x=[C,m,g,v.pos,u,l,n]:x=[C,m,g,v.pos],l++,i.push(x),C==="#"||C==="^")r.push(x);else if(C==="/"){if(T=r.pop(),!T)throw new Error('Unopened section "'+m+'" at '+g);if(T[1]!==m)throw new Error('Unclosed section "'+T[1]+'" at '+g)}else C==="name"||C==="{"||C==="&"?s=!0:C==="="&&p(m)}if(c(),T=r.pop(),T)throw new Error('Unclosed section "'+T[1]+'" at '+v.pos);return KV(HV(i))}function HV(e){for(var t=[],n,r,i=0,o=e.length;i<o;++i)n=e[i],n&&(n[0]==="text"&&r&&r[0]==="text"?(r[1]+=n[1],r[3]=n[3]):(t.push(n),r=n));return t}function KV(e){for(var t=[],n=t,r=[],i,o,a=0,s=e.length;a<s;++a)switch(i=e[a],i[0]){case"#":case"^":n.push(i),r.push(i),n=i[4]=[];break;case"/":o=r.pop(),o[5]=i[2],n=r.length>0?r[r.length-1][4]:t;break;default:n.push(i)}return t}function Fu(e){this.string=e,this.tail=e,this.pos=0}Fu.prototype.eos=function(){return this.tail===""};Fu.prototype.scan=function(t){var n=this.tail.match(t);if(!n||n.index!==0)return"";var r=n[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};Fu.prototype.scanUntil=function(t){var n=this.tail.search(t),r;switch(n){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=r.length,r};function Da(e,t){this.view=e,this.cache={".":this.view},this.parent=t}Da.prototype.push=function(t){return new Da(t,this)};Da.prototype.lookup=function(t){var n=this.cache,r;if(n.hasOwnProperty(t))r=n[t];else{for(var i=this,o,a,s,u=!1;i;){if(t.indexOf(".")>0)for(o=i.view,a=t.split("."),s=0;o!=null&&s<a.length;)s===a.length-1&&(u=Bg(o,a[s])||MV(o,a[s])),o=o[a[s++]];else o=i.view[t],u=Bg(i.view,t);if(u){r=o;break}i=i.parent}n[t]=r}return Zv(r)&&(r=r.call(this.view)),r};function Nn(){this.templateCache={_cache:{},set:function(t,n){this._cache[t]=n},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}Nn.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Nn.prototype.parse=function(t,n){var r=this.templateCache,i=t+":"+(n||cr.tags).join(":"),o=typeof r<"u",a=o?r.get(i):void 0;return a==null&&(a=WV(t,n),o&&r.set(i,a)),a};Nn.prototype.render=function(t,n,r,i){var o=this.getConfigTags(i),a=this.parse(t,o),s=n instanceof Da?n:new Da(n,void 0);return this.renderTokens(a,s,r,t,i)};Nn.prototype.renderTokens=function(t,n,r,i,o){for(var a="",s,u,l,c=0,f=t.length;c<f;++c)l=void 0,s=t[c],u=s[0],u==="#"?l=this.renderSection(s,n,r,i,o):u==="^"?l=this.renderInverted(s,n,r,i,o):u===">"?l=this.renderPartial(s,n,r,o):u==="&"?l=this.unescapedValue(s,n):u==="name"?l=this.escapedValue(s,n,o):u==="text"&&(l=this.rawValue(s)),l!==void 0&&(a+=l);return a};Nn.prototype.renderSection=function(t,n,r,i,o){var a=this,s="",u=n.lookup(t[1]);function l(d){return a.render(d,n,r,o)}if(u){if(ss(u))for(var c=0,f=u.length;c<f;++c)s+=this.renderTokens(t[4],n.push(u[c]),r,i,o);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")s+=this.renderTokens(t[4],n.push(u),r,i,o);else if(Zv(u)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(n.view,i.slice(t[3],t[5]),l),u!=null&&(s+=u)}else s+=this.renderTokens(t[4],n,r,i,o);return s}};Nn.prototype.renderInverted=function(t,n,r,i,o){var a=n.lookup(t[1]);if(!a||ss(a)&&a.length===0)return this.renderTokens(t[4],n,r,i,o)};Nn.prototype.indentPartial=function(t,n,r){for(var i=n.replace(/[^ \t]/g,""),o=t.split(`
|
|
978
978
|
`),a=0;a<o.length;a++)o[a].length&&(a>0||!r)&&(o[a]=i+o[a]);return o.join(`
|
|
979
|
-
`)};Nn.prototype.renderPartial=function(t,n,r,i){if(r){var o=this.getConfigTags(i),a=
|
|
979
|
+
`)};Nn.prototype.renderPartial=function(t,n,r,i){if(r){var o=this.getConfigTags(i),a=Zv(r)?r(t[1]):r[t[1]];if(a!=null){var s=t[6],u=t[5],l=t[4],c=a;u==0&&l&&(c=this.indentPartial(a,l,s));var f=this.parse(c,o);return this.renderTokens(f,n,r,c,i)}}};Nn.prototype.unescapedValue=function(t,n){var r=n.lookup(t[1]);if(r!=null)return r};Nn.prototype.escapedValue=function(t,n,r){var i=this.getConfigEscape(r)||cr.escape,o=n.lookup(t[1]);if(o!=null)return typeof o=="number"&&i===cr.escape?String(o):i(o)};Nn.prototype.rawValue=function(t){return t[1]};Nn.prototype.getConfigTags=function(t){return ss(t)?t:t&&typeof t=="object"?t.tags:void 0};Nn.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!ss(t))return t.escape};var cr={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){pu.templateCache=e},get templateCache(){return pu.templateCache}},pu=new Nn;cr.clearCache=function(){return pu.clearCache()};cr.parse=function(t,n){return pu.parse(t,n)};cr.render=function(t,n,r,i){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+kV(t)+'" was given as the first argument for mustache#render(template, view, partials)');return pu.render(t,n,r,i)};cr.escape=VV;cr.Scanner=Fu;cr.Context=Da;cr.Writer=Nn;function ea(){}function YV(){return!0}function gs(e){return!!(e||"").match(/\d/)}function Gg(e){return e==null}function zg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function JV(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 XV(e,t,n){var r=JV(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 th(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 QV(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 Lx(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function Wg(e,t){return Array(t+1).join(e)}function ZV(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."+Wg("0",Math.abs(o))+r:o>=a?r=r+Wg("0",o-a):r=(r.substring(0,o)||"0")+"."+r.substring(o),t+r}function e5(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=e.indexOf(".")!==-1&&t,i=th(e),o=i.beforeDecimal,a=i.afterDecimal,s=i.hasNagation,u=parseFloat("0."+(a||"0")),l=a.length<=t?"0."+a:u.toFixed(t),c=l.split("."),f=o.split("").reverse().reduce(function(v,g,C){return v.length>C?(Number(v[0])+Number(g)).toString()+v.substring(1,v.length):g+v},c[0]),d=Lx(c[1]||"",Math.min(t,a.length),n),h=s?"-":"",p=r?".":"";return""+h+f+p+d}function Hg(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 t5(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 cd(e,t,n){return Math.min(Math.max(e,t),n)}function Kg(e){return Math.max(e.selectionStart,e.selectionEnd)}function n5(e){return e||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function r5(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 i5={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:ea,onChange:ea,onKeyDown:ea,onMouseUp:ea,onFocus:ea,onBlur:ea,isAllowed:YV},Vx=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,l=a.numAsString;if(l===void 0&&(l=""),r!==o){this.validateProps();var c=this.formatNumString(l),f=Gg(o.value)?c:this.formatValueProp(),d=this.removeFormatting(f),h=parseFloat(d),p=parseFloat(l);((!isNaN(h)||!isNaN(p))&&h!==p||c!==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),l=r[0]==="-";l&&(r=r.replace("-","")),s&&o===0&&(r=r.split(s)[0]),r=(r.match(u)||[]).join("").replace(s,".");var c=r.indexOf(".");return c!==-1&&(r=r.substring(0,c)+"."+r.substring(c+1,r.length).replace(new RegExp(zg(s),"g"),"")),l&&(r="-"+r),r},t.prototype.getNumberRegex=function(r,i){var o=this.props,a=o.format,s=o.decimalScale,u=o.customNumerals,l=this.getSeparators(),c=l.decimalSeparator;return new RegExp("[0-9"+(u?u.join(""):"")+"]"+(c&&s!==0&&!i&&!a?"|"+zg(c):""),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(`
|
|
980
980
|
Decimal separator can't be same as thousand separator.
|
|
981
981
|
thousandSeparator: `+s+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
982
982
|
decimalSeparator: `+a+` (default value for decimalSeparator is .)
|
|
983
983
|
`);if(i){var u=i==="string"?i:i.toString();if(u.match(/\d/g))throw new Error(`
|
|
984
984
|
Mask `+i+` should not contain numeric character;
|
|
985
|
-
`)}},t.prototype.setPatchedCaretPosition=function(r,i,o){Wg(r,i),this.caretPositionTimeout=setTimeout(function(){r.value===o&&Wg(r,i)},0)},t.prototype.correctCaretPosition=function(r,i,o){var a=this.props,s=a.prefix,u=a.suffix,l=a.format;if(r==="")return 0;if(i=cd(i,0,r.length),!l){var c=r[0]==="-";return cd(i,s.length+(c?1:0),r.length-u.length)}if(typeof l=="function"||l[i]==="#"&&gs(r[i])||l[i-1]==="#"&&gs(r[i-1]))return i;var f=l.indexOf("#"),d=l.lastIndexOf("#");i=cd(i,f,d+1);for(var h=l.substring(i,l.length).indexOf("#"),p=i,v=i+(h===-1?0:h);p>f&&(l[p]!=="#"||!gs(r[p]));)p-=1;var g=!gs(r[v])||o==="left"&&i!==f||i-p<v-i;return g?gs(r[p])?p+1:p:v},t.prototype.getCaretPosition=function(r,i,o){var a=this.props,s=a.format,u=this.state.value,l=this.getNumberRegex(!0),c=(r.match(l)||[]).join(""),f=(i.match(l)||[]).join(""),d,h;for(d=0,h=0;h<o;h++){var p=r[h]||"",v=i[d]||"";if(!(!p.match(l)&&p!==v)&&!(p==="0"&&v.match(l)&&v!=="0"&&c.length!==f.length)){for(;p!==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 l=r.lastIndexOf(s);r=s&&l!==-1&&l===r.length-s.length?r.substring(0,l):r,u&&(r="-"+r)}return r},t.prototype.removePatternFormatting=function(r){for(var i=this.props,o=i.format,a=o.split("#").filter(function(h){return h!==""}),s=0,u="",l=0,c=a.length;l<=c;l++){var f=a[l]||"",d=l===c?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,l=o.length;u<l;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,l=i.allowNegative,c=i.thousandsGroupStyle,f=this.getSeparators(),d=f.thousandSeparator,h=f.decimalSeparator,p=r.indexOf(".")!==-1||o&&a,v=th(r,l),g=v.beforeDecimal,C=v.afterDecimal,m=v.addNegation;return o!==void 0&&(C=_x(C,o,a)),d&&(g=KV(g,d,c)),s&&(g=s+g),u&&(C=C+u),m&&(g="-"+g),r=g+(p&&h||"")+C,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 l=new RegExp("["+s.join("")+"]","g");u=r.replace(l,function(c){return s.indexOf(c).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,l=this.props,c=l.value,f=l.isNumericString;c=Ug(c)?r:c;var d=!c&&c!==0;if(d&&u&&(c=""),d&&!u)return"";typeof c=="number"&&(c=JV(c),f=!0),c==="Infinity"&&f&&(c=""),f&&!o&&typeof a=="number"&&(c=XV(c,a,s));var h=f?this.formatNumString(c):this.formatInput(c);return h},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),l=s.test(r);return r=r.replace(/-/g,""),u&&!l&&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,l=o.decimalScale,c=o.fixedDecimalScale,f=this.getSeparators(),d=f.decimalSeparator;return!!(typeof a=="string"&&a[r]!=="#"||!a&&(r<s.length||r>=i.length-u.length||l&&c&&i[r]===d))},t.prototype.correctInputValue=function(r,i,o){var a=this,s=this.props,u=s.format,l=s.allowNegative,c=s.prefix,f=s.suffix,d=s.decimalScale,h=this.getSeparators(),p=h.allowedDecimalSeparators,v=h.decimalSeparator,g=this.state.numAsString||"",C=this.selectionBeforeInput,m=C.selectionStart,b=C.selectionEnd,x=QV(i,o),T=x.start,E=x.end;if(!u&&T===E&&p.indexOf(o[m])!==-1){var A=d===0?"":v;return o.substr(0,m)+A+o.substr(m+1,o.length)}var N=u?0:c.length,I=i.length-(u?0:f.length);if(o.length>i.length||!o.length||T===E||m===0&&b===i.length||T===0&&E===i.length||m===N&&b===I)return o;var P=i.substr(T,E-T),_=!![].concat(P).find(function(R,te){return a.isCharacterAFormat(te+T,i)});if(_){var L=i.substr(T),U={},Y=[];[].concat(L).forEach(function(R,te){a.isCharacterAFormat(te+T,i)?U[te]=R:te>P.length-1&&Y.push(R)}),Object.keys(U).forEach(function(R){Y.length>R?Y.splice(R,0,U[R]):Y.push(U[R])}),o=i.substr(0,T)+Y.join("")}if(!u){var k=this.removeFormatting(o),ie=th(k,l),B=ie.beforeDecimal,G=ie.afterDecimal,fe=ie.addNegation,j=r<o.indexOf(v)+1;if(k.length<g.length&&j&&B===""&&!parseFloat(G))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,l=r.numAsString,c=r.caretPos,f=this.props,d=f.onValueChange,h=this.state,p=h.value;if(o){if(c===void 0&&a){var v=r.inputValue||o.value,g=Hg(o);o.value=i,c=this.getCaretPosition(v,i,g)}o.value=i,a&&this.setPatchedCaretPosition(o,c,i)}l===void 0&&(l=this.removeFormatting(i)),i!==p&&(this.setState({value:i,numAsString:l}),d(this.getValueObject(i,l),{event:u,source:s}))},t.prototype.onChange=function(r){var i=r.target,o=i.value,a=this,s=a.state,u=a.props,l=u.isAllowed,c=s.value||"",f=Hg(i);o=this.correctInputValue(f,c,o);var d=this.formatInput(o)||"",h=this.removeFormatting(d),p=this.getValueObject(d,h),v=l(p);v||(d=c),this.updateValue({formattedValue:d,numAsString:h,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,l=o.allowLeadingZeros,c=a.numAsString,f=a.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!s){isNaN(parseFloat(c))&&(c=""),l||(c=YV(c));var d=this.formatNumString(c);if(d!==f){this.updateValue({formattedValue:d,numAsString:c,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 l,c=this.props,f=c.decimalScale,d=c.fixedDecimalScale,h=c.prefix,p=c.suffix,v=c.format,g=c.onKeyDown,C=f!==void 0&&d,m=this.getNumberRegex(!1,C),b=new RegExp("-"),x=typeof v=="string";if(this.selectionBeforeInput={selectionStart:a,selectionEnd:s},o==="ArrowLeft"||o==="Backspace"?l=a-1:o==="ArrowRight"?l=a+1:o==="Delete"&&(l=a),l===void 0||a!==s){g(r);return}var T=l,E=x?v.indexOf("#"):h.length,A=x?v.lastIndexOf("#")+1:u.length-p.length;if(o==="ArrowLeft"||o==="ArrowRight"){var N=o==="ArrowLeft"?"left":"right";T=this.correctCaretPosition(u,l,N)}else if(o==="Delete"&&!m.test(u[l])&&!b.test(u[l]))for(;!m.test(u[T])&&T<A;)T++;else if(o==="Backspace"&&!m.test(u[l])){if(a<=E+1&&u[0]==="-"&&typeof v>"u"){var I=u.substring(1);this.updateValue({formattedValue:I,caretPos:T,input:i,event:r,source:"event"})}else if(!b.test(u[l])){for(;!m.test(u[T-1])&&T>E;)T--;T=this.correctCaretPosition(u,T,"left")}}(T!==l||l<E||l>A)&&(r.preventDefault(),this.setPatchedCaretPosition(i,T,u)),r.isUnitTestRun&&this.setPatchedCaretPosition(i,T,u),g(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 l=i.correctCaretPosition(u,a);l!==a&&!(a===0&&s===u.length)&&i.setPatchedCaretPosition(o,l,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,l=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 c=e5(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=c,d=this.state,h=d.value,p=d.mounted,v=p&&ZV(l)?"numeric":void 0,g=Object.assign({inputMode:v},f,{type:i,value:h,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(o==="text")return s?s(h,f)||null:O.createElement("span",Object.assign({},f,{ref:u}),h);if(a){var C=a;return O.createElement(C,Object.assign({},g,{ref:u}))}return O.createElement("input",Object.assign({},g,{ref:u}))},t}(O.Component);qx.defaultProps=t5;function n5(e,t,n){var r=this,i=O.useRef(null),o=O.useRef(0),a=O.useRef(null),s=O.useRef([]),u=O.useRef(),l=O.useRef(),c=O.useRef(e),f=O.useRef(!0);O.useEffect(function(){c.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 h=!!(n=n||{}).leading,p=!("trailing"in n)||!!n.trailing,v="maxWait"in n,g=v?Math.max(+n.maxWait||0,t):null;O.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var C=O.useMemo(function(){var m=function(N){var I=s.current,P=u.current;return s.current=u.current=null,o.current=N,l.current=c.current.apply(P,I)},b=function(N,I){d&&cancelAnimationFrame(a.current),a.current=d?requestAnimationFrame(N):setTimeout(N,I)},x=function(N){if(!f.current)return!1;var I=N-i.current;return!i.current||I>=t||I<0||v&&N-o.current>=g},T=function(N){return a.current=null,p&&s.current?m(N):(s.current=u.current=null,l.current)},E=function N(){var I=Date.now();if(x(I))return T(I);if(f.current){var P=t-(I-i.current),_=v?Math.min(P,g-(I-o.current)):P;b(N,_)}},A=function(){var N=Date.now(),I=x(N);if(s.current=[].slice.call(arguments),u.current=r,i.current=N,I){if(!a.current&&f.current)return o.current=i.current,b(E,t),h?m(i.current):l.current;if(v)return b(E,t),m(i.current)}return a.current||b(E,t),l.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?T(Date.now()):l.current},A},[h,v,t,g,p,d]);return C}var Fx=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 l=i-o;return s=u>.5?l/(2-i-o):l/(i+o),i===t?a=(n-r)/l+(n<r?6:0):i===n?a=(r-t)/l+2:i===r&&(a=(t-n)/l+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}(),r5=function(){function e(t,n){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},n),this.reusedColor=new Fx(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,l=u===void 0?0:u,c=1,f=.16666666666666666,d=null,h=1/0,p=new Array(6),v=new Array(6),g=new Array(6),C=6,m=0;m<s;m++){for(var b=i/Math.pow(m+1,f),x=0;x<C;x++)p[x]=Math.random()>.5?1:-1,v[x]=o[x]+b*p[x],g[x]=o[x]-b*p[x];for(var T=this.loss(v)-this.loss(g),x=0;x<C;x++){var E=T/(2*b)*p[x],A=r[x]/Math.pow(n+m+1,c);o[x]=this.fixValueByFilterIDX(o[x]-A*E,x)}var N=this.loss(o);N<h&&(d=o.slice(0),h=N)}return{values:d,loss:h,called:l}},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}(),i5=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])]:[]},fd=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},dd={},o5=function(e,t){var n;t===void 0&&(t={});var r,i,o;if(dd[e]&&!t.forceFilterRecalculation)return Object.assign({},dd[e],{cache:!0});var a;try{if(n=bq(i5(e),3),r=n[0],i=n[1],o=n[2],!fd(r)||!fd(i)||!fd(o))throw new Error("hextToRgb returned an invalid value for '"+e+"'");a=new Fx(Number(r),Number(i),Number(o))}catch(u){throw new Error("Color value should be in HEX format. "+u)}var s=new r5(a,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},t));return dd[e]=Object.assign({},s.solve(),{hex:e,rgb:[r,i,o],cache:!1})};const a5=(e,t,n,r)=>(n|t<<8|e<<16|1<<24).toString(16).slice(1)+r;function s5(e,t,n,r){let i=(e+(r||"")).toString().includes("%");if(typeof e=="string"&&!t){const o=u5(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 a5(e,t,n,r)}const u5=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]},l5=/[\p{Lu}]/u,c5=/[\p{Ll}]/u,Kg=/^[\p{Lu}](?![\p{Lu}])/gu,Lx=/([\p{Alpha}\p{N}_]|$)/u,tm=/[_.\- ]+/,f5=new RegExp("^"+tm.source),Yg=new RegExp(tm.source+Lx.source,"gu"),Jg=new RegExp("\\d+"+Lx.source,"gu"),d5=(e,t,n,r)=>{let i=!1,o=!1,a=!1,s=!1;for(let u=0;u<e.length;u++){const l=e[u];s=u>2?e[u-3]==="-":!0,i&&l5.test(l)?(e=e.slice(0,u)+"-"+e.slice(u),i=!1,a=o,o=!0,u++):o&&a&&c5.test(l)&&(!s||r)?(e=e.slice(0,u-1)+"-"+e.slice(u-1),a=o,o=!1,i=!0):(i=t(l)===l&&n(l)!==l,a=o,o=n(l)===l&&t(l)!==l)}return e},p5=(e,t)=>(Kg.lastIndex=0,e.replaceAll(Kg,n=>t(n))),h5=(e,t)=>(Yg.lastIndex=0,Jg.lastIndex=0,e.replaceAll(Jg,(n,r,i)=>["_","-"].includes(e.charAt(i+n.length))?n:t(n)).replaceAll(Yg,(n,r)=>t(r)));function v5(e,t){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");if(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},Array.isArray(e)?e=e.map(o=>o.trim()).filter(o=>o.length).join("-"):e=e.trim(),e.length===0)return"";const n=t.locale===!1?o=>o.toLowerCase():o=>o.toLocaleLowerCase(t.locale),r=t.locale===!1?o=>o.toUpperCase():o=>o.toLocaleUpperCase(t.locale);return e.length===1?tm.test(e)?"":t.pascalCase?r(e):n(e):(e!==n(e)&&(e=d5(e,n,r,t.preserveConsecutiveUppercase)),e=e.replace(f5,""),e=t.preserveConsecutiveUppercase?p5(e,n):n(e),t.pascalCase&&(e=r(e.charAt(0))+e.slice(1)),h5(e,r))}function m5(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 y5(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),m5(e)}function Yt(){return D.RenderTarget.current()!==D.RenderTarget.preview}function g5(e){if(Yt())return null;const{error:t}=Nv();if(!t)return null;switch(t.type){case pt.ConfigurationModelNotFound:return O.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:$.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case pt.ConfigurationUnauthenticated:return O.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:$.jsx("span",{children:"The HCA access token is invalid."});case pt.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."});case pt.DecisionsToRespectInvalid:return $.jsx("span",{children:"The definition of Attribute Relations is invalid."});default:return O.Children.toArray(e.errorContent).length>0?e.errorContent:$.jsx("span",{children:"An error occurred while initializing the configuration."})}}function ui(e){return O.forwardRef((t,n)=>$.jsx(yq,{fallbackRender:()=>$.jsx("span",{children:"Component crashed"}),children:$.jsx(e,{...t,ref:n})}))}const b5=Mu`
|
|
985
|
+
`)}},t.prototype.setPatchedCaretPosition=function(r,i,o){Hg(r,i),this.caretPositionTimeout=setTimeout(function(){r.value===o&&Hg(r,i)},0)},t.prototype.correctCaretPosition=function(r,i,o){var a=this.props,s=a.prefix,u=a.suffix,l=a.format;if(r==="")return 0;if(i=cd(i,0,r.length),!l){var c=r[0]==="-";return cd(i,s.length+(c?1:0),r.length-u.length)}if(typeof l=="function"||l[i]==="#"&&gs(r[i])||l[i-1]==="#"&&gs(r[i-1]))return i;var f=l.indexOf("#"),d=l.lastIndexOf("#");i=cd(i,f,d+1);for(var h=l.substring(i,l.length).indexOf("#"),p=i,v=i+(h===-1?0:h);p>f&&(l[p]!=="#"||!gs(r[p]));)p-=1;var g=!gs(r[v])||o==="left"&&i!==f||i-p<v-i;return g?gs(r[p])?p+1:p:v},t.prototype.getCaretPosition=function(r,i,o){var a=this.props,s=a.format,u=this.state.value,l=this.getNumberRegex(!0),c=(r.match(l)||[]).join(""),f=(i.match(l)||[]).join(""),d,h;for(d=0,h=0;h<o;h++){var p=r[h]||"",v=i[d]||"";if(!(!p.match(l)&&p!==v)&&!(p==="0"&&v.match(l)&&v!=="0"&&c.length!==f.length)){for(;p!==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 l=r.lastIndexOf(s);r=s&&l!==-1&&l===r.length-s.length?r.substring(0,l):r,u&&(r="-"+r)}return r},t.prototype.removePatternFormatting=function(r){for(var i=this.props,o=i.format,a=o.split("#").filter(function(h){return h!==""}),s=0,u="",l=0,c=a.length;l<=c;l++){var f=a[l]||"",d=l===c?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,l=o.length;u<l;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,l=i.allowNegative,c=i.thousandsGroupStyle,f=this.getSeparators(),d=f.thousandSeparator,h=f.decimalSeparator,p=r.indexOf(".")!==-1||o&&a,v=th(r,l),g=v.beforeDecimal,C=v.afterDecimal,m=v.addNegation;return o!==void 0&&(C=Lx(C,o,a)),d&&(g=XV(g,d,c)),s&&(g=s+g),u&&(C=C+u),m&&(g="-"+g),r=g+(p&&h||"")+C,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 l=new RegExp("["+s.join("")+"]","g");u=r.replace(l,function(c){return s.indexOf(c).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,l=this.props,c=l.value,f=l.isNumericString;c=Gg(c)?r:c;var d=!c&&c!==0;if(d&&u&&(c=""),d&&!u)return"";typeof c=="number"&&(c=ZV(c),f=!0),c==="Infinity"&&f&&(c=""),f&&!o&&typeof a=="number"&&(c=e5(c,a,s));var h=f?this.formatNumString(c):this.formatInput(c);return h},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),l=s.test(r);return r=r.replace(/-/g,""),u&&!l&&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,l=o.decimalScale,c=o.fixedDecimalScale,f=this.getSeparators(),d=f.decimalSeparator;return!!(typeof a=="string"&&a[r]!=="#"||!a&&(r<s.length||r>=i.length-u.length||l&&c&&i[r]===d))},t.prototype.correctInputValue=function(r,i,o){var a=this,s=this.props,u=s.format,l=s.allowNegative,c=s.prefix,f=s.suffix,d=s.decimalScale,h=this.getSeparators(),p=h.allowedDecimalSeparators,v=h.decimalSeparator,g=this.state.numAsString||"",C=this.selectionBeforeInput,m=C.selectionStart,b=C.selectionEnd,x=t5(i,o),T=x.start,E=x.end;if(!u&&T===E&&p.indexOf(o[m])!==-1){var A=d===0?"":v;return o.substr(0,m)+A+o.substr(m+1,o.length)}var N=u?0:c.length,I=i.length-(u?0:f.length);if(o.length>i.length||!o.length||T===E||m===0&&b===i.length||T===0&&E===i.length||m===N&&b===I)return o;var P=i.substr(T,E-T),_=!![].concat(P).find(function(R,te){return a.isCharacterAFormat(te+T,i)});if(_){var L=i.substr(T),U={},Y=[];[].concat(L).forEach(function(R,te){a.isCharacterAFormat(te+T,i)?U[te]=R:te>P.length-1&&Y.push(R)}),Object.keys(U).forEach(function(R){Y.length>R?Y.splice(R,0,U[R]):Y.push(U[R])}),o=i.substr(0,T)+Y.join("")}if(!u){var k=this.removeFormatting(o),ie=th(k,l),B=ie.beforeDecimal,G=ie.afterDecimal,fe=ie.addNegation,j=r<o.indexOf(v)+1;if(k.length<g.length&&j&&B===""&&!parseFloat(G))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,l=r.numAsString,c=r.caretPos,f=this.props,d=f.onValueChange,h=this.state,p=h.value;if(o){if(c===void 0&&a){var v=r.inputValue||o.value,g=Kg(o);o.value=i,c=this.getCaretPosition(v,i,g)}o.value=i,a&&this.setPatchedCaretPosition(o,c,i)}l===void 0&&(l=this.removeFormatting(i)),i!==p&&(this.setState({value:i,numAsString:l}),d(this.getValueObject(i,l),{event:u,source:s}))},t.prototype.onChange=function(r){var i=r.target,o=i.value,a=this,s=a.state,u=a.props,l=u.isAllowed,c=s.value||"",f=Kg(i);o=this.correctInputValue(f,c,o);var d=this.formatInput(o)||"",h=this.removeFormatting(d),p=this.getValueObject(d,h),v=l(p);v||(d=c),this.updateValue({formattedValue:d,numAsString:h,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,l=o.allowLeadingZeros,c=a.numAsString,f=a.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!s){isNaN(parseFloat(c))&&(c=""),l||(c=QV(c));var d=this.formatNumString(c);if(d!==f){this.updateValue({formattedValue:d,numAsString:c,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 l,c=this.props,f=c.decimalScale,d=c.fixedDecimalScale,h=c.prefix,p=c.suffix,v=c.format,g=c.onKeyDown,C=f!==void 0&&d,m=this.getNumberRegex(!1,C),b=new RegExp("-"),x=typeof v=="string";if(this.selectionBeforeInput={selectionStart:a,selectionEnd:s},o==="ArrowLeft"||o==="Backspace"?l=a-1:o==="ArrowRight"?l=a+1:o==="Delete"&&(l=a),l===void 0||a!==s){g(r);return}var T=l,E=x?v.indexOf("#"):h.length,A=x?v.lastIndexOf("#")+1:u.length-p.length;if(o==="ArrowLeft"||o==="ArrowRight"){var N=o==="ArrowLeft"?"left":"right";T=this.correctCaretPosition(u,l,N)}else if(o==="Delete"&&!m.test(u[l])&&!b.test(u[l]))for(;!m.test(u[T])&&T<A;)T++;else if(o==="Backspace"&&!m.test(u[l])){if(a<=E+1&&u[0]==="-"&&typeof v>"u"){var I=u.substring(1);this.updateValue({formattedValue:I,caretPos:T,input:i,event:r,source:"event"})}else if(!b.test(u[l])){for(;!m.test(u[T-1])&&T>E;)T--;T=this.correctCaretPosition(u,T,"left")}}(T!==l||l<E||l>A)&&(r.preventDefault(),this.setPatchedCaretPosition(i,T,u)),r.isUnitTestRun&&this.setPatchedCaretPosition(i,T,u),g(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 l=i.correctCaretPosition(u,a);l!==a&&!(a===0&&s===u.length)&&i.setPatchedCaretPosition(o,l,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,l=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 c=r5(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=c,d=this.state,h=d.value,p=d.mounted,v=p&&n5(l)?"numeric":void 0,g=Object.assign({inputMode:v},f,{type:i,value:h,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(o==="text")return s?s(h,f)||null:O.createElement("span",Object.assign({},f,{ref:u}),h);if(a){var C=a;return O.createElement(C,Object.assign({},g,{ref:u}))}return O.createElement("input",Object.assign({},g,{ref:u}))},t}(O.Component);Vx.defaultProps=i5;function o5(e,t,n){var r=this,i=O.useRef(null),o=O.useRef(0),a=O.useRef(null),s=O.useRef([]),u=O.useRef(),l=O.useRef(),c=O.useRef(e),f=O.useRef(!0);O.useEffect(function(){c.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 h=!!(n=n||{}).leading,p=!("trailing"in n)||!!n.trailing,v="maxWait"in n,g=v?Math.max(+n.maxWait||0,t):null;O.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var C=O.useMemo(function(){var m=function(N){var I=s.current,P=u.current;return s.current=u.current=null,o.current=N,l.current=c.current.apply(P,I)},b=function(N,I){d&&cancelAnimationFrame(a.current),a.current=d?requestAnimationFrame(N):setTimeout(N,I)},x=function(N){if(!f.current)return!1;var I=N-i.current;return!i.current||I>=t||I<0||v&&N-o.current>=g},T=function(N){return a.current=null,p&&s.current?m(N):(s.current=u.current=null,l.current)},E=function N(){var I=Date.now();if(x(I))return T(I);if(f.current){var P=t-(I-i.current),_=v?Math.min(P,g-(I-o.current)):P;b(N,_)}},A=function(){var N=Date.now(),I=x(N);if(s.current=[].slice.call(arguments),u.current=r,i.current=N,I){if(!a.current&&f.current)return o.current=i.current,b(E,t),h?m(i.current):l.current;if(v)return b(E,t),m(i.current)}return a.current||b(E,t),l.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?T(Date.now()):l.current},A},[h,v,t,g,p,d]);return C}var Bx=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 l=i-o;return s=u>.5?l/(2-i-o):l/(i+o),i===t?a=(n-r)/l+(n<r?6:0):i===n?a=(r-t)/l+2:i===r&&(a=(t-n)/l+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}(),a5=function(){function e(t,n){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},n),this.reusedColor=new Bx(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,l=u===void 0?0:u,c=1,f=.16666666666666666,d=null,h=1/0,p=new Array(6),v=new Array(6),g=new Array(6),C=6,m=0;m<s;m++){for(var b=i/Math.pow(m+1,f),x=0;x<C;x++)p[x]=Math.random()>.5?1:-1,v[x]=o[x]+b*p[x],g[x]=o[x]-b*p[x];for(var T=this.loss(v)-this.loss(g),x=0;x<C;x++){var E=T/(2*b)*p[x],A=r[x]/Math.pow(n+m+1,c);o[x]=this.fixValueByFilterIDX(o[x]-A*E,x)}var N=this.loss(o);N<h&&(d=o.slice(0),h=N)}return{values:d,loss:h,called:l}},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}(),s5=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])]:[]},fd=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},dd={},u5=function(e,t){var n;t===void 0&&(t={});var r,i,o;if(dd[e]&&!t.forceFilterRecalculation)return Object.assign({},dd[e],{cache:!0});var a;try{if(n=wq(s5(e),3),r=n[0],i=n[1],o=n[2],!fd(r)||!fd(i)||!fd(o))throw new Error("hextToRgb returned an invalid value for '"+e+"'");a=new Bx(Number(r),Number(i),Number(o))}catch(u){throw new Error("Color value should be in HEX format. "+u)}var s=new a5(a,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},t));return dd[e]=Object.assign({},s.solve(),{hex:e,rgb:[r,i,o],cache:!1})};const l5=(e,t,n,r)=>(n|t<<8|e<<16|1<<24).toString(16).slice(1)+r;function c5(e,t,n,r){let i=(e+(r||"")).toString().includes("%");if(typeof e=="string"&&!t){const o=f5(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 l5(e,t,n,r)}const f5=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]},d5=/[\p{Lu}]/u,p5=/[\p{Ll}]/u,Yg=/^[\p{Lu}](?![\p{Lu}])/gu,Ux=/([\p{Alpha}\p{N}_]|$)/u,em=/[_.\- ]+/,h5=new RegExp("^"+em.source),Jg=new RegExp(em.source+Ux.source,"gu"),Xg=new RegExp("\\d+"+Ux.source,"gu"),v5=(e,t,n,r)=>{let i=!1,o=!1,a=!1,s=!1;for(let u=0;u<e.length;u++){const l=e[u];s=u>2?e[u-3]==="-":!0,i&&d5.test(l)?(e=e.slice(0,u)+"-"+e.slice(u),i=!1,a=o,o=!0,u++):o&&a&&p5.test(l)&&(!s||r)?(e=e.slice(0,u-1)+"-"+e.slice(u-1),a=o,o=!1,i=!0):(i=t(l)===l&&n(l)!==l,a=o,o=n(l)===l&&t(l)!==l)}return e},m5=(e,t)=>(Yg.lastIndex=0,e.replaceAll(Yg,n=>t(n))),y5=(e,t)=>(Jg.lastIndex=0,Xg.lastIndex=0,e.replaceAll(Xg,(n,r,i)=>["_","-"].includes(e.charAt(i+n.length))?n:t(n)).replaceAll(Jg,(n,r)=>t(r)));function g5(e,t){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");if(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},Array.isArray(e)?e=e.map(o=>o.trim()).filter(o=>o.length).join("-"):e=e.trim(),e.length===0)return"";const n=t.locale===!1?o=>o.toLowerCase():o=>o.toLocaleLowerCase(t.locale),r=t.locale===!1?o=>o.toUpperCase():o=>o.toLocaleUpperCase(t.locale);return e.length===1?em.test(e)?"":t.pascalCase?r(e):n(e):(e!==n(e)&&(e=v5(e,n,r,t.preserveConsecutiveUppercase)),e=e.replace(h5,""),e=t.preserveConsecutiveUppercase?m5(e,n):n(e),t.pascalCase&&(e=r(e.charAt(0))+e.slice(1)),y5(e,r))}function b5(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 S5(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),b5(e)}function Gt(){return D.RenderTarget.current()!==D.RenderTarget.preview}function C5(e){if(Gt())return null;const{error:t}=Dv();if(!t)return null;switch(t.type){case pt.ConfigurationModelNotFound:return O.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:$.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case pt.ConfigurationUnauthenticated:return O.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:$.jsx("span",{children:"The HCA access token is invalid."});case pt.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."});case pt.DecisionsToRespectInvalid:return $.jsx("span",{children:"The definition of Attribute Relations is invalid."});default:return O.Children.toArray(e.errorContent).length>0?e.errorContent:$.jsx("span",{children:"An error occurred while initializing the configuration."})}}function Er(e){return O.forwardRef((t,n)=>$.jsx(Sq,{fallbackRender:()=>$.jsx("span",{children:"Component crashed"}),children:$.jsx(e,{...t,ref:n})}))}const w5=Mu`
|
|
986
986
|
:root {
|
|
987
987
|
--font-primary: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
988
988
|
--font-heading: "Inter-Medium", "Inter", "Inter Placeholder", sans-serif;
|
|
@@ -1001,7 +1001,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1001
1001
|
--text-xxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
1002
1002
|
--text-xxxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
1003
1003
|
}
|
|
1004
|
-
`,
|
|
1004
|
+
`,x5=w5,T5=Mu`
|
|
1005
1005
|
:root {
|
|
1006
1006
|
--space-unit: 1em;
|
|
1007
1007
|
--space-xxs: calc(0.25 * var(--space-unit));
|
|
@@ -1021,14 +1021,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1021
1021
|
--space-xl-fixed: calc(3.25 * var(--space-unit-fixed));
|
|
1022
1022
|
--space-xxl-fixed: calc(5.25 * var(--space-unit-fixed));
|
|
1023
1023
|
}
|
|
1024
|
-
`,
|
|
1024
|
+
`,E5=T5,I5=Mu`
|
|
1025
1025
|
:root {
|
|
1026
1026
|
--shape-border-radius-xs: 5px;
|
|
1027
1027
|
--shape-border-radius-sm: 7px;
|
|
1028
1028
|
--shape-border-radius-md: 12px;
|
|
1029
1029
|
--shape-border-radius-lg: 20px;
|
|
1030
1030
|
}
|
|
1031
|
-
`,
|
|
1031
|
+
`,A5=I5,$5=Mu`
|
|
1032
1032
|
:root {
|
|
1033
1033
|
--shadows-popover: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4));
|
|
1034
1034
|
--shadows-dialog: 0.2px 0.4px 2.3px rgba(0, 0, 0, 0.02),
|
|
@@ -1040,7 +1040,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1040
1040
|
13.9px 23.6px 54.7px rgba(0, 0, 0, 0.061),
|
|
1041
1041
|
40px 68px 96px rgba(0, 0, 0, 0.1);
|
|
1042
1042
|
}
|
|
1043
|
-
`,
|
|
1043
|
+
`,O5=$5;function Qg(){return $.jsxs($.Fragment,{children:[$.jsx(O5,{}),$.jsx(A5,{}),$.jsx(E5,{}),$.jsx(x5,{})]})}const hu=O.createContext(null);function Xi(){const{process:e,switchMode:t,applySolution:n,dismiss:r}=O.useContext(hu);return e?{...e,switchMode:t,applySolution:n,dismiss:r}:null}function Gx(e){const{explanation:t,...n}=e,r=Xi();return $.jsx("button",{...n,onClick:()=>r.applySolution(t.solution),children:e.children})}function zx(e,t,n){return H(e).returnType().with({type:V.Choice},r=>t[r.choiceValueId]??r.choiceValueId).with({type:V.Boolean,state:!0},()=>n.booleanDecisionStateTrueLabel).with({type:V.Boolean,state:!1},()=>n.booleanDecisionStateFalseLabel).with({type:V.Component,state:Ge.Included},()=>n.componentDecisionStateIncludedLabel).with({type:V.Component,state:Ge.Excluded},()=>n.componentDecisionStateExcludedLabel).with({type:V.Numeric},r=>r.state.toString()).exhaustive()}const Wx={applySolutionButtonCaption:{title:"Apply Solution Button Caption",type:D.ControlType.String,defaultValue:"Apply Solution"},configurationSubjectTitle:{title:"Configuration Subject Title",type:D.ControlType.String,defaultValue:"Configuration"},generalConflictTitle:{title:"General Conflict Title",type:D.ControlType.String,defaultValue:"Conflict"},componentDecisionStateIncludedLabel:{title:"Component Decision State Included Label",type:D.ControlType.String,defaultValue:"Included"},componentDecisionStateExcludedLabel:{title:"Component Decision State Excluded Label",type:D.ControlType.String,defaultValue:"Excluded"},booleanDecisionStateTrueLabel:{title:"Boolean Decision State True Label",type:D.ControlType.String,defaultValue:"Yes"},booleanDecisionStateFalseLabel:{title:"Boolean Decision State False Label",type:D.ControlType.String,defaultValue:"No"},isBlockedSuffix:{title:"Is Blocked Suffix",type:D.ControlType.String,defaultValue:"is blocked"},isNotSatisfiedSuffix:{title:"Is Not Satisfied Suffix",type:D.ControlType.String,defaultValue:"is not satisfied"}},D5={fill:{title:"Fill",type:D.ControlType.Color,defaultValue:"#002134"},color:{title:"Color",type:D.ControlType.Color,defaultValue:"white"},attributeValueFill:{title:"Attribute Value Fill",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.2)"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:D.ControlType.Color,defaultValue:"rgba(47, 255, 0, 0.2)"},attributeValueAddColor:{title:"Attribute Value Add Color",type:D.ControlType.Color,defaultValue:"#63e446"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:D.ControlType.Color,defaultValue:"#ff00004a"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:D.ControlType.Color,defaultValue:"#ff6060"},headerValueColor:{title:"Header Value Color",type:D.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},closeButtonOutline:{title:"Close Button Outline",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},listSeparator:{title:"List Separator",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:D.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:D.ControlType.Color,defaultValue:"white"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},showMoreButtonOutline:{title:"Show More Button Outline",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},solutionTitle:{title:"Solution Title",type:D.ControlType.String,defaultValue:"Solution"},showMoreButtonCaption:{title:"Show More Button Caption",type:D.ControlType.String,defaultValue:"Show more ({{amount}})"},showConstraintsButtonCaption:{title:"Show Constraints Button Caption",type:D.ControlType.String,defaultValue:"Show Constraints"},...Wx},tm=O.createContext(null),nm=()=>O.useContext(tm),N5={fill:{title:"Fill",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.7)"},color:{title:"Color",type:D.ControlType.Color,defaultValue:"#171717"},attributeValueFill:{title:"Attribute Value Fill",type:D.ControlType.Color,defaultValue:"#efefef"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:D.ControlType.Color,defaultValue:"#cfefc7"},attributeValueAddColor:{title:"Attribute Value Add Color",type:D.ControlType.Color,defaultValue:"#48c52b"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:D.ControlType.Color,defaultValue:"#ffdada"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:D.ControlType.Color,defaultValue:"#c52b2b"},headerValueColor:{title:"Header Value Color",type:D.ControlType.Color,defaultValue:"#00a1e6"},closeButtonOutline:{title:"Close Button Outline",type:D.ControlType.Color,defaultValue:"#00a1e6"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:D.ControlType.Color,defaultValue:"#F2F2F2"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:D.ControlType.Color,defaultValue:"#171717"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:D.ControlType.Color,defaultValue:"#00a1e6"},explanationCard:{title:"Explanation Card",type:D.ControlType.Color,defaultValue:"white"},scrollShadowBorder:{title:"Scroll Shadow Border",type:D.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"},backdropFilter:{title:"Backdrop Filter",type:D.ControlType.String,defaultValue:"blur(10px) saturate(200%)"},decisionExplanationSolutionsTitle:{title:"Decision Explanation Solutions Title",type:D.ControlType.String,defaultValue:"Solutions"},constraintExplanationSolutionsTitle:{title:"Constraint Explanation Solutions Title",type:D.ControlType.String,defaultValue:"Constraint Explanations"},...Wx},rm=O.createContext(null),Hx=()=>O.useContext(rm),P5=()=>O.useContext(tm)||O.useContext(rm),im=P5,R5=Ae.div`
|
|
1044
1044
|
display: flex;
|
|
1045
1045
|
gap: var(--space-xs);
|
|
1046
1046
|
align-items: center;
|
|
@@ -1051,7 +1051,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1051
1051
|
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1052
1052
|
font-weight: 500;
|
|
1053
1053
|
min-width: 0;
|
|
1054
|
-
`,
|
|
1054
|
+
`,k5=Ae.div`
|
|
1055
1055
|
display: grid;
|
|
1056
1056
|
place-content: center;
|
|
1057
1057
|
border-top-left-radius: 360px;
|
|
@@ -1069,36 +1069,36 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1069
1069
|
background-color: var(--color-explain-attribute-value-remove-fill);
|
|
1070
1070
|
color: var(--color-explain-attribute-value-remove-color);
|
|
1071
1071
|
}
|
|
1072
|
-
`,
|
|
1072
|
+
`,M5=Ae.div`
|
|
1073
1073
|
white-space: nowrap;
|
|
1074
1074
|
overflow: hidden;
|
|
1075
1075
|
text-overflow: ellipsis;
|
|
1076
|
-
`;function
|
|
1076
|
+
`;function j5(e){const{decision:t,choiceValuesNames:n}=e,r=t.intention,i=im(),o=zx(t,n,i);return $.jsxs(R5,{children:[$.jsxs(k5,{className:`mode-${r}`,children:[r==="remove"&&$.jsx(Gi,{icon:AF}),r==="add"&&$.jsx(Gi,{icon:$F})]}),$.jsx(M5,{children:o})]})}function un(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 Nf=O.createContext(null);function om(e){const{attributes:t}=O.useContext(Nf),{activeLocale:n}=D.useLocaleInfo(),r=n.code;return O.useMemo(()=>y(t,Pt(i=>Nu(un(i),e)),K(i=>i.name),tv,Ha,am(r),Et),[t,r,e.localId,e.componentPath,e.sharedConfigurationModelId])}function Pf(e){const{choiceValues:t}=O.useContext(Nf),{activeLocale:n}=D.useLocaleInfo(),r=rs(e);if(!r)return{};const i=O.useMemo(()=>y(t,Vt(s=>Nu(un(s),e))),[t,e.localId,e.componentPath,e.sharedConfigurationModelId]),o=n.code,a=r.attribute.values;return O.useMemo(()=>y(a,z(s=>y(i,Pt(u=>u.choiceValueId===s.id),K(u=>u.name),tv,Ha,am(o),K(u=>[s.id,u]))),qn,aR),[a,i,o])}function _5(e,t){const{choiceValues:n}=O.useContext(Nf),{activeLocale:r}=D.useLocaleInfo(),i=r.code;return O.useMemo(()=>y(n,Pt(o=>Nu(un(o),e)&&o.choiceValueId===t),K(o=>o.name),tv,Ha,am(i),Et),[n,i,e.localId,e.componentPath,e.sharedConfigurationModelId,t])}function am(e){return Ln(Pt(t=>t.localeCode.localeCompare(e,void 0,{sensitivity:"accent"})===0),K(t=>t.translation))}const q5=Ae.div`
|
|
1077
1077
|
display: grid;
|
|
1078
1078
|
grid-template-columns: subgrid;
|
|
1079
1079
|
grid-column: span 2;
|
|
1080
1080
|
align-items: center;
|
|
1081
|
-
`,
|
|
1081
|
+
`,F5=Ae.div`
|
|
1082
1082
|
grid-area: name;
|
|
1083
1083
|
white-space: nowrap;
|
|
1084
1084
|
overflow: hidden;
|
|
1085
1085
|
text-overflow: ellipsis;
|
|
1086
|
-
`,
|
|
1086
|
+
`,L5=Ae.div`
|
|
1087
1087
|
grid-area: values;
|
|
1088
1088
|
display: flex;
|
|
1089
1089
|
flex-wrap: wrap;
|
|
1090
1090
|
min-width: 0;
|
|
1091
1091
|
gap: var(--space-xxs);
|
|
1092
|
-
`;function
|
|
1092
|
+
`;function V5(e){const{decisions:t}=e,n=t[0].attributeId,r=Pf(n),i=om(n),o=im(),a=y(eu,Zr(u=>zx(u,r,o))),s=y(t,af(a));return $.jsxs(q5,{children:[$.jsx(F5,{children:i??n.localId}),$.jsx(L5,{children:s.map((u,l)=>$.jsx(j5,{decision:u,choiceValuesNames:r},l))})]})}function B5(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("::")}const U5=y(eu,Zr(e=>e.attributeId.localId));function Kx(e){const{blockingDecisions:t,desiredDecisions:n,...r}=e,i=y([...n.map(o=>({...o,intention:"add"})),...t.map(o=>({...o,intention:"remove"}))],JC(o=>B5(o.attributeId)),cv(I2)((o,a)=>({key:o,attributeId:XC(a).attributeId,decisions:a})),af(U5));return $.jsx("div",{...r,children:i.map(o=>$.jsx(V5,{decisions:o.decisions},o.key))})}const G5=Ae.div`
|
|
1093
1093
|
background-color: var(--color-explain-dialog-explanation-card);
|
|
1094
1094
|
padding: var(--space-sm-fixed);
|
|
1095
1095
|
box-shadow: 2px 1px 10px -5px rgba(0, 0, 0, 0.4);
|
|
1096
1096
|
border-radius: var(--shape-border-radius-sm);
|
|
1097
|
-
`,
|
|
1097
|
+
`,Yx=G5,z5=Ae(Kx)`
|
|
1098
1098
|
display: grid;
|
|
1099
1099
|
grid-template-columns: [name] minmax(150px, auto) [values] minmax(0px, 1fr);
|
|
1100
1100
|
gap: var(--space-sm);
|
|
1101
|
-
`,
|
|
1101
|
+
`,W5=Ae(Gx)`
|
|
1102
1102
|
border-radius: var(--shape-border-radius-sm);
|
|
1103
1103
|
background-color: var(--color-explain-dialog-apply-solution-button-fill);
|
|
1104
1104
|
color: var(--color-explain-dialog-apply-solution-button-color);
|
|
@@ -1115,58 +1115,58 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1115
1115
|
outline: 2px solid var(--color-explain-dialog-apply-solution-button-outline);
|
|
1116
1116
|
outline-offset: 1px;
|
|
1117
1117
|
}
|
|
1118
|
-
`;function
|
|
1118
|
+
`;function H5(e){const{explanation:t}=e,{applySolutionButtonCaption:n}=Hx(),r=t.solution.decisions.filter(i=>i.state!=null);return $.jsxs(Yx,{children:[$.jsx(z5,{blockingDecisions:t.causedByDecisions,desiredDecisions:r}),$.jsx(W5,{explanation:t,children:n})]})}const K5=Ae(Yx)`
|
|
1119
1119
|
ul {
|
|
1120
1120
|
margin: 0;
|
|
1121
1121
|
}
|
|
1122
1122
|
|
|
1123
1123
|
line-height: 1.5em;
|
|
1124
|
-
`,
|
|
1124
|
+
`,Y5=Ae.ul`
|
|
1125
1125
|
list-style-type: none;
|
|
1126
1126
|
margin-inline-start: 0;
|
|
1127
1127
|
padding-inline-start: 0;
|
|
1128
|
-
`,
|
|
1128
|
+
`,Zg=Ae.ul`
|
|
1129
1129
|
list-style-type: disc;
|
|
1130
1130
|
margin-inline-start: 0;
|
|
1131
1131
|
padding-inline-start: var(--space-lg);
|
|
1132
|
-
`,
|
|
1132
|
+
`,eb=Ae.li`
|
|
1133
1133
|
font-size: 0.9em;
|
|
1134
1134
|
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1135
1135
|
font-weight: 500;
|
|
1136
|
-
`;function
|
|
1136
|
+
`;function J5(e){const{explanation:t}=e,n=t.causedByCardinalities,r=y(t.causedByRules,JC(i=>i.configurationModelId),cv(eu)((i,o)=>({configurationModelId:i,rules:y(o,z(a=>a.localId),af(eu))})));return $.jsx(K5,{children:$.jsxs(Y5,{children:[r.map(i=>$.jsxs("li",{children:[$.jsx("span",{children:i.configurationModelId}),$.jsx(Zg,{children:i.rules.map(o=>$.jsx(eb,{children:o}))})]})),n.length>0&&$.jsxs("li",{children:[$.jsx("span",{children:"Cardinality"}),$.jsx(Zg,{children:n.map(i=>$.jsx(eb,{children:i.localId}))})]})]})})}function Jx(e){const{variant:t,...n}=e,{explainQuestion:r}=Xi(),i=H(r).returnType().with({question:Ft.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:Ft.whyIsNotSatisfied,subject:Ue.configuration},()=>"why your configuration is not satisfied").with({question:Ft.whyIsNotSatisfied,subject:Ue.attribute},()=>"why your attribute is not satisfied").with(qe.nullish,()=>"why your selections are not possible").exhaustive(),o=H(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 tb=Ae.div`
|
|
1137
1137
|
font-weight: 500;
|
|
1138
1138
|
font-family: var(--font-heading);
|
|
1139
1139
|
margin-bottom: var(--space-xs);
|
|
1140
1140
|
margin-left: var(--space-sm-fixed);
|
|
1141
|
-
`,
|
|
1141
|
+
`,nb=Ae.div`
|
|
1142
1142
|
display: flex;
|
|
1143
1143
|
flex-direction: column;
|
|
1144
1144
|
gap: var(--space-xs);
|
|
1145
|
-
`,
|
|
1145
|
+
`,X5=Ae.div`
|
|
1146
1146
|
display: flex;
|
|
1147
1147
|
flex-direction: column;
|
|
1148
1148
|
gap: var(--space-md);
|
|
1149
|
-
`,
|
|
1149
|
+
`,rb=Ae(Jx)`
|
|
1150
1150
|
width: min-content;
|
|
1151
1151
|
min-width: 400px;
|
|
1152
1152
|
margin: var(--space-sm-fixed) var(--space-md-fixed) var(--space-sm-fixed) var(--space-sm-fixed);
|
|
1153
|
-
`;function Y5(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=Xi(),{decisionExplanationSolutionsTitle:r,constraintExplanationSolutionsTitle:i}=Gx();return n?$.jsx(nb,{variant:"failedToExplain"}):e.length===0&&t.length===0?$.jsx(nb,{variant:"noExplanationFound"}):$.jsxs(K5,{children:[e.length>0&&$.jsxs("div",{children:[$.jsx(eb,{children:r}),$.jsx(tb,{children:e.map(o=>$.jsx(G5,{explanation:o},e.indexOf(o)))})]}),t.length>0&&$.jsxs("div",{children:[$.jsx(eb,{children:i}),$.jsx(tb,{children:t.map(o=>$.jsx(H5,{explanation:o},t.indexOf(o)))})]})]})}function ii(e){return Kx(e)?(e.nodeName||"").toLowerCase():"#document"}function er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function li(e){var t;return(t=(Kx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kx(e){return e instanceof Node||e instanceof er(e).Node}function Lt(e){return e instanceof Element||e instanceof er(e).Element}function On(e){return e instanceof HTMLElement||e instanceof er(e).HTMLElement}function nh(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof er(e).ShadowRoot}function Lu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=tr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function J5(e){return["table","td","th"].includes(ii(e))}function um(e){const t=lm(),n=tr(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 Yx(e){let t=Ro(e);for(;On(t)&&!Na(t);){if(um(t))return t;t=Ro(t)}return null}function lm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Na(e){return["html","body","#document"].includes(ii(e))}function tr(e){return er(e).getComputedStyle(e)}function Rf(e){return Lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ro(e){if(ii(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nh(e)&&e.host||li(e);return nh(t)?t.host:t}function Jx(e){const t=Ro(e);return Na(t)?e.ownerDocument?e.ownerDocument.body:e.body:On(t)&&Lu(t)?t:Jx(t)}function ki(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Jx(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=er(i);return o?t.concat(a,a.visualViewport||[],Lu(i)?i:[],a.frameElement&&n?ki(a.frameElement):[]):t.concat(i,ki(i,[],n))}function aa(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 Hn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&nh(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 Qx(){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 X5(e){return e.mozInputSource===0&&e.isTrusted?!0:rh()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Q5(e){return e3()?!1:!rh()&&e.width===0&&e.height===0||rh()&&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 Z5(){return/apple/i.test(navigator.vendor)}function rh(){const e=/android/i;return e.test(Xx())||e.test(Qx())}function e3(){return Qx().includes("jsdom/")}function rb(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function t3(e){return"nativeEvent"in e}function n3(e){return e.matches("html,body")}function zr(e){return(e==null?void 0:e.ownerDocument)||document}function pd(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 sa(e){return"composedPath"in e?e.composedPath()[0]:e.target}const r3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Zx(e){return On(e)&&e.matches(r3)}function hd(e){e.preventDefault(),e.stopPropagation()}function i3(e){return e?e.getAttribute("role")==="combobox"&&Zx(e):!1}const Pa=Math.min,So=Math.max,Cc=Math.round,Sl=Math.floor,zi=e=>({x:e,y:e}),o3={left:"right",right:"left",bottom:"top",top:"bottom"},a3={start:"end",end:"start"};function ih(e,t,n){return So(e,Pa(t,n))}function Vu(e,t){return typeof e=="function"?e(t):e}function ko(e){return e.split("-")[0]}function Bu(e){return e.split("-")[1]}function e1(e){return e==="x"?"y":"x"}function cm(e){return e==="y"?"height":"width"}function kf(e){return["top","bottom"].includes(ko(e))?"y":"x"}function fm(e){return e1(kf(e))}function s3(e,t,n){n===void 0&&(n=!1);const r=Bu(e),i=fm(e),o=cm(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=wc(a)),[a,wc(a)]}function u3(e){const t=wc(e);return[oh(e),t,oh(t)]}function oh(e){return e.replace(/start|end/g,t=>a3[t])}function l3(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 c3(e,t,n,r){const i=Bu(e);let o=l3(ko(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(oh)))),o}function wc(e){return e.replace(/left|right|bottom|top/g,t=>o3[t])}function f3(e){return{top:0,right:0,bottom:0,left:0,...e}}function t1(e){return typeof e!="number"?f3(e):{top:e,right:e,bottom:e,left:e}}function xc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ib(e,t,n){let{reference:r,floating:i}=e;const o=kf(t),a=fm(t),s=cm(a),u=ko(t),l=o==="y",c=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 h;switch(u){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Bu(t)){case"start":h[a]-=d*(n&&l?-1:1);break;case"end":h[a]+=d*(n&&l?-1:1);break}return h}const d3=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 l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=ib(l,r,u),d=r,h={},p=0;for(let v=0;v<s.length;v++){const{name:g,fn:C}=s[v],{x:m,y:b,data:x,reset:T}=await C({x:c,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});c=m??c,f=b??f,h={...h,[g]:{...h[g],...x}},T&&p<=50&&(p++,typeof T=="object"&&(T.placement&&(d=T.placement),T.rects&&(l=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:c,y:f}=ib(l,d,u)),v=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:h}};async function n1(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Vu(t,e),p=t1(h),v=s[d?f==="floating"?"reference":"floating":f],g=xc(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:l,rootBoundary:c,strategy:u})),C=f==="floating"?{...a.floating,x:r,y:i}:a.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),b=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},x=xc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:C,offsetParent:m,strategy:u}):C);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}const p3=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:l,padding:c=0}=Vu(e,t)||{};if(l==null)return{};const f=t1(c),d={x:n,y:r},h=fm(i),p=cm(h),v=await a.getDimensions(l),g=h==="y",C=g?"top":"left",m=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=o.reference[p]+o.reference[h]-d[h]-o.floating[p],T=d[h]-o.reference[h],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let A=E?E[b]:0;(!A||!await(a.isElement==null?void 0:a.isElement(E)))&&(A=s.floating[b]||o.floating[p]);const N=x/2-T/2,I=A/2-v[p]/2-1,P=Pa(f[C],I),_=Pa(f[m],I),L=P,U=A-v[p]-_,Y=A/2-v[p]/2+N,k=ih(L,Y,U),ie=!u.arrow&&Bu(i)!=null&&Y!==k&&o.reference[p]/2-(Y<L?P:_)-v[p]/2<0,B=ie?Y<L?Y-L:Y-U:0;return{[h]:d[h]+B,data:{[h]:k,centerOffset:Y-k-B,...ie&&{alignmentOffset:B}},reset:ie}}}),h3=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:l}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...g}=Vu(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=ko(i),m=ko(s)===s,b=await(u.isRTL==null?void 0:u.isRTL(l.floating)),x=d||(m||!v?[wc(s)]:u3(s));!d&&p!=="none"&&x.push(...c3(s,v,p,b));const T=[s,...x],E=await n1(t,g),A=[];let N=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&A.push(E[C]),f){const L=s3(i,a,b);A.push(E[L[0]],E[L[1]])}if(N=[...N,{placement:i,overflows:A}],!A.every(L=>L<=0)){var I,P;const L=(((I=o.flip)==null?void 0:I.index)||0)+1,U=T[L];if(U)return{data:{index:L,overflows:N},reset:{placement:U}};let Y=(P=N.filter(k=>k.overflows[0]<=0).sort((k,ie)=>k.overflows[1]-ie.overflows[1])[0])==null?void 0:P.placement;if(!Y)switch(h){case"bestFit":{var _;const k=(_=N.map(ie=>[ie.placement,ie.overflows.filter(B=>B>0).reduce((B,G)=>B+G,0)]).sort((ie,B)=>ie[1]-B[1])[0])==null?void 0:_[0];k&&(Y=k);break}case"initialPlacement":Y=s;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};async function v3(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=ko(n),s=Bu(n),u=kf(n)==="y",l=["left","top"].includes(a)?-1:1,c=o&&u?-1:1,f=Vu(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof p=="number"&&(h=s==="end"?p*-1:p),u?{x:h*c,y:d*l}:{x:d*l,y:h*c}}const m3=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 v3(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}}}}},y3=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:g=>{let{x:C,y:m}=g;return{x:C,y:m}}},...u}=Vu(e,t),l={x:n,y:r},c=await n1(t,u),f=kf(ko(i)),d=e1(f);let h=l[d],p=l[f];if(o){const g=d==="y"?"top":"left",C=d==="y"?"bottom":"right",m=h+c[g],b=h-c[C];h=ih(m,h,b)}if(a){const g=f==="y"?"top":"left",C=f==="y"?"bottom":"right",m=p+c[g],b=p-c[C];p=ih(m,p,b)}const v=s.fn({...t,[d]:h,[f]:p});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function r1(e){const t=tr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=On(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Cc(n)!==o||Cc(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function dm(e){return Lt(e)?e:e.contextElement}function wa(e){const t=dm(e);if(!On(t))return zi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=r1(t);let a=(o?Cc(n.width):n.width)/r,s=(o?Cc(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const g3=zi(0);function i1(e){const t=er(e);return!lm()||!t.visualViewport?g3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function b3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==er(e)?!1:t}function Mo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=dm(e);let a=zi(1);t&&(r?Lt(r)&&(a=wa(r)):a=wa(e));const s=b3(o,n,r)?i1(o):zi(0);let u=(i.left+s.x)/a.x,l=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o){const d=er(o),h=r&&Lt(r)?er(r):r;let p=d.frameElement;for(;p&&r&&h!==d;){const v=wa(p),g=p.getBoundingClientRect(),C=tr(p),m=g.left+(p.clientLeft+parseFloat(C.paddingLeft))*v.x,b=g.top+(p.clientTop+parseFloat(C.paddingTop))*v.y;u*=v.x,l*=v.y,c*=v.x,f*=v.y,u+=m,l+=b,p=er(p).frameElement}}return xc({width:c,height:f,x:u,y:l})}const S3=[":popover-open",":modal"];function o1(e){let t=!1,n=0,r=0;function i(o){try{t=t||e.matches(o)}catch{}}if(S3.forEach(o=>{i(o)}),t){const o=Yx(e);if(o){const a=o.getBoundingClientRect();n=a.x,r=a.y}}return[t,n,r]}function C3(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=li(r),[a]=t?o1(t.floating):[!1];if(r===o||a)return n;let s={scrollLeft:0,scrollTop:0},u=zi(1);const l=zi(0),c=On(r);if((c||!c&&i!=="fixed")&&((ii(r)!=="body"||Lu(o))&&(s=Rf(r)),On(r))){const f=Mo(r);u=wa(r),l.x=f.x+r.clientLeft,l.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+l.x,y:n.y*u.y-s.scrollTop*u.y+l.y}}function w3(e){return Array.from(e.getClientRects())}function a1(e){return Mo(li(e)).left+Rf(e).scrollLeft}function x3(e){const t=li(e),n=Rf(e),r=e.ownerDocument.body,i=So(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=So(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+a1(e);const s=-n.scrollTop;return tr(r).direction==="rtl"&&(a+=So(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function T3(e,t){const n=er(e),r=li(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const l=lm();(!l||l&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s,y:u}}function E3(e,t){const n=Mo(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=On(e)?wa(e):zi(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,l=r*o.y;return{width:a,height:s,x:u,y:l}}function ob(e,t,n){let r;if(t==="viewport")r=T3(e,n);else if(t==="document")r=x3(li(e));else if(Lt(t))r=E3(t,n);else{const i=i1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return xc(r)}function s1(e,t){const n=Ro(e);return n===t||!Lt(n)||Na(n)?!1:tr(n).position==="fixed"||s1(n,t)}function I3(e,t){const n=t.get(e);if(n)return n;let r=ki(e,[],!1).filter(s=>Lt(s)&&ii(s)!=="body"),i=null;const o=tr(e).position==="fixed";let a=o?Ro(e):e;for(;Lt(a)&&!Na(a);){const s=tr(a),u=um(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&i&&["absolute","fixed"].includes(i.position)||Lu(a)&&!u&&s1(e,a))?r=r.filter(l=>l!==a):i=s,a=Ro(a)}return t.set(e,r),r}function A3(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?I3(t,this._c):[].concat(n),r],a=o[0],s=o.reduce((u,l)=>{const c=ob(t,l,i);return u.top=So(c.top,u.top),u.right=Pa(c.right,u.right),u.bottom=Pa(c.bottom,u.bottom),u.left=So(c.left,u.left),u},ob(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function $3(e){const{width:t,height:n}=r1(e);return{width:t,height:n}}function O3(e,t,n,r){const i=On(t),o=li(t),a=n==="fixed",s=Mo(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const l=zi(0);if(i||!i&&!a)if((ii(t)!=="body"||Lu(o))&&(u=Rf(t)),i){const v=Mo(t,!0,a,t);l.x=v.x+t.clientLeft,l.y=v.y+t.clientTop}else o&&(l.x=a1(o));let c=s.left+u.scrollLeft-l.x,f=s.top+u.scrollTop-l.y;const[d,h,p]=o1(r);return d&&(c+=h,f+=p,i&&(c+=t.clientLeft,f+=t.clientTop)),{x:c,y:f,width:s.width,height:s.height}}function ab(e,t){return!On(e)||tr(e).position==="fixed"?null:t?t(e):e.offsetParent}function u1(e,t){const n=er(e);if(!On(e))return n;let r=ab(e,t);for(;r&&J5(r)&&tr(r).position==="static";)r=ab(r,t);return r&&(ii(r)==="html"||ii(r)==="body"&&tr(r).position==="static"&&!um(r))?n:r||Yx(e)||n}const D3=async function(e){const t=this.getOffsetParent||u1,n=this.getDimensions;return{reference:O3(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function N3(e){return tr(e).direction==="rtl"}const l1={convertOffsetParentRelativeRectToViewportRelativeRect:C3,getDocumentElement:li,getClippingRect:A3,getOffsetParent:u1,getElementRects:D3,getClientRects:w3,getDimensions:$3,getScale:wa,isElement:Lt,isRTL:N3};function P3(e,t){let n=null,r;const i=li(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:l,top:c,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const h=Sl(c),p=Sl(i.clientWidth-(l+f)),v=Sl(i.clientHeight-(c+d)),g=Sl(l),C={rootMargin:-h+"px "+-p+"px "+-v+"px "+-g+"px",threshold:So(0,Pa(1,u))||1};let m=!0;function b(x){const T=x[0].intersectionRatio;if(T!==u){if(!m)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},100)}m=!1}try{n=new IntersectionObserver(b,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,C)}n.observe(e)}return a(!0),o}function R3(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,l=dm(e),c=i||o?[...l?ki(l):[],...ki(t)]:[];c.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const f=l&&s?P3(l,n):null;let d=-1,h=null;a&&(h=new ResizeObserver(C=>{let[m]=C;m&&m.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),l&&!u&&h.observe(l),h.observe(t));let p,v=u?Mo(e):null;u&&g();function g(){const C=Mo(e);v&&(C.x!==v.x||C.y!==v.y||C.width!==v.width||C.height!==v.height)&&n(),v=C,p=requestAnimationFrame(g)}return n(),()=>{var C;c.forEach(m=>{i&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),f==null||f(),(C=h)==null||C.disconnect(),h=null,u&&cancelAnimationFrame(p)}}const k3=y3,M3=h3,sb=p3,j3=(e,t,n)=>{const r=new Map,i={platform:l1,...n},o={...i.platform,_c:r};return d3(e,t,{...i,platform:o})},_3=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?sb({element:r.current,padding:i}).fn(n):{}:r?sb({element:r,padding:i}).fn(n):{}}}};var zl=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Tc(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(!Tc(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)&&!Tc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function c1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ub(e,t){const n=c1(e);return Math.round(t*n)/n}function lb(e){const t=J.useRef(e);return zl(()=>{t.current=e}),t}function q3(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:l}=e,[c,f]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=J.useState(r);Tc(d,r)||h(r);const[p,v]=J.useState(null),[g,C]=J.useState(null),m=J.useCallback(B=>{B!==E.current&&(E.current=B,v(B))},[]),b=J.useCallback(B=>{B!==A.current&&(A.current=B,C(B))},[]),x=o||p,T=a||g,E=J.useRef(null),A=J.useRef(null),N=J.useRef(c),I=u!=null,P=lb(u),_=lb(i),L=J.useCallback(()=>{if(!E.current||!A.current)return;const B={placement:t,strategy:n,middleware:d};_.current&&(B.platform=_.current),j3(E.current,A.current,B).then(G=>{const fe={...G,isPositioned:!0};U.current&&!Tc(N.current,fe)&&(N.current=fe,hT.flushSync(()=>{f(fe)}))})},[d,t,n,_]);zl(()=>{l===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[l]);const U=J.useRef(!1);zl(()=>(U.current=!0,()=>{U.current=!1}),[]),zl(()=>{if(x&&(E.current=x),T&&(A.current=T),x&&T){if(P.current)return P.current(x,T,L);L()}},[x,T,L,P,I]);const Y=J.useMemo(()=>({reference:E,floating:A,setReference:m,setFloating:b}),[m,b]),k=J.useMemo(()=>({reference:x,floating:T}),[x,T]),ie=J.useMemo(()=>{const B={position:n,left:0,top:0};if(!k.floating)return B;const G=ub(k.floating,c.x),fe=ub(k.floating,c.y);return s?{...B,transform:"translate("+G+"px, "+fe+"px)",...c1(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:fe}},[n,s,k.floating,c.x,c.y]);return J.useMemo(()=>({...c,update:L,refs:Y,elements:k,floatingStyles:ie}),[c,L,Y,k,ie])}/*!
|
|
1153
|
+
`;function Q5(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=Xi(),{decisionExplanationSolutionsTitle:r,constraintExplanationSolutionsTitle:i}=Hx();return n?$.jsx(rb,{variant:"failedToExplain"}):e.length===0&&t.length===0?$.jsx(rb,{variant:"noExplanationFound"}):$.jsxs(X5,{children:[e.length>0&&$.jsxs("div",{children:[$.jsx(tb,{children:r}),$.jsx(nb,{children:e.map(o=>$.jsx(H5,{explanation:o},e.indexOf(o)))})]}),t.length>0&&$.jsxs("div",{children:[$.jsx(tb,{children:i}),$.jsx(nb,{children:t.map(o=>$.jsx(J5,{explanation:o},t.indexOf(o)))})]})]})}function oi(e){return Xx(e)?(e.nodeName||"").toLowerCase():"#document"}function er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function li(e){var t;return(t=(Xx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Xx(e){return e instanceof Node||e instanceof er(e).Node}function Lt(e){return e instanceof Element||e instanceof er(e).Element}function On(e){return e instanceof HTMLElement||e instanceof er(e).HTMLElement}function nh(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof er(e).ShadowRoot}function Lu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=tr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Z5(e){return["table","td","th"].includes(oi(e))}function sm(e){const t=um(),n=tr(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 Qx(e){let t=Ro(e);for(;On(t)&&!Na(t);){if(sm(t))return t;t=Ro(t)}return null}function um(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Na(e){return["html","body","#document"].includes(oi(e))}function tr(e){return er(e).getComputedStyle(e)}function Rf(e){return Lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ro(e){if(oi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nh(e)&&e.host||li(e);return nh(t)?t.host:t}function Zx(e){const t=Ro(e);return Na(t)?e.ownerDocument?e.ownerDocument.body:e.body:On(t)&&Lu(t)?t:Zx(t)}function ki(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Zx(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=er(i);return o?t.concat(a,a.visualViewport||[],Lu(i)?i:[],a.frameElement&&n?ki(a.frameElement):[]):t.concat(i,ki(i,[],n))}function aa(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 Hn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&nh(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function e1(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function t1(){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 e3(e){return e.mozInputSource===0&&e.isTrusted?!0:rh()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function t3(e){return r3()?!1:!rh()&&e.width===0&&e.height===0||rh()&&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 n3(){return/apple/i.test(navigator.vendor)}function rh(){const e=/android/i;return e.test(e1())||e.test(t1())}function r3(){return t1().includes("jsdom/")}function ib(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function i3(e){return"nativeEvent"in e}function o3(e){return e.matches("html,body")}function Wr(e){return(e==null?void 0:e.ownerDocument)||document}function pd(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 sa(e){return"composedPath"in e?e.composedPath()[0]:e.target}const a3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function n1(e){return On(e)&&e.matches(a3)}function hd(e){e.preventDefault(),e.stopPropagation()}function s3(e){return e?e.getAttribute("role")==="combobox"&&n1(e):!1}const Pa=Math.min,So=Math.max,Cc=Math.round,Sl=Math.floor,zi=e=>({x:e,y:e}),u3={left:"right",right:"left",bottom:"top",top:"bottom"},l3={start:"end",end:"start"};function ih(e,t,n){return So(e,Pa(t,n))}function Vu(e,t){return typeof e=="function"?e(t):e}function ko(e){return e.split("-")[0]}function Bu(e){return e.split("-")[1]}function r1(e){return e==="x"?"y":"x"}function lm(e){return e==="y"?"height":"width"}function kf(e){return["top","bottom"].includes(ko(e))?"y":"x"}function cm(e){return r1(kf(e))}function c3(e,t,n){n===void 0&&(n=!1);const r=Bu(e),i=cm(e),o=lm(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=wc(a)),[a,wc(a)]}function f3(e){const t=wc(e);return[oh(e),t,oh(t)]}function oh(e){return e.replace(/start|end/g,t=>l3[t])}function d3(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 p3(e,t,n,r){const i=Bu(e);let o=d3(ko(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(oh)))),o}function wc(e){return e.replace(/left|right|bottom|top/g,t=>u3[t])}function h3(e){return{top:0,right:0,bottom:0,left:0,...e}}function i1(e){return typeof e!="number"?h3(e):{top:e,right:e,bottom:e,left:e}}function xc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ob(e,t,n){let{reference:r,floating:i}=e;const o=kf(t),a=cm(t),s=lm(a),u=ko(t),l=o==="y",c=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 h;switch(u){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Bu(t)){case"start":h[a]-=d*(n&&l?-1:1);break;case"end":h[a]+=d*(n&&l?-1:1);break}return h}const v3=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 l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=ob(l,r,u),d=r,h={},p=0;for(let v=0;v<s.length;v++){const{name:g,fn:C}=s[v],{x:m,y:b,data:x,reset:T}=await C({x:c,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});c=m??c,f=b??f,h={...h,[g]:{...h[g],...x}},T&&p<=50&&(p++,typeof T=="object"&&(T.placement&&(d=T.placement),T.rects&&(l=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:c,y:f}=ob(l,d,u)),v=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:h}};async function o1(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Vu(t,e),p=i1(h),v=s[d?f==="floating"?"reference":"floating":f],g=xc(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:l,rootBoundary:c,strategy:u})),C=f==="floating"?{...a.floating,x:r,y:i}:a.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),b=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},x=xc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:C,offsetParent:m,strategy:u}):C);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}const m3=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:l,padding:c=0}=Vu(e,t)||{};if(l==null)return{};const f=i1(c),d={x:n,y:r},h=cm(i),p=lm(h),v=await a.getDimensions(l),g=h==="y",C=g?"top":"left",m=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=o.reference[p]+o.reference[h]-d[h]-o.floating[p],T=d[h]-o.reference[h],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let A=E?E[b]:0;(!A||!await(a.isElement==null?void 0:a.isElement(E)))&&(A=s.floating[b]||o.floating[p]);const N=x/2-T/2,I=A/2-v[p]/2-1,P=Pa(f[C],I),_=Pa(f[m],I),L=P,U=A-v[p]-_,Y=A/2-v[p]/2+N,k=ih(L,Y,U),ie=!u.arrow&&Bu(i)!=null&&Y!==k&&o.reference[p]/2-(Y<L?P:_)-v[p]/2<0,B=ie?Y<L?Y-L:Y-U:0;return{[h]:d[h]+B,data:{[h]:k,centerOffset:Y-k-B,...ie&&{alignmentOffset:B}},reset:ie}}}),y3=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:l}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...g}=Vu(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=ko(i),m=ko(s)===s,b=await(u.isRTL==null?void 0:u.isRTL(l.floating)),x=d||(m||!v?[wc(s)]:f3(s));!d&&p!=="none"&&x.push(...p3(s,v,p,b));const T=[s,...x],E=await o1(t,g),A=[];let N=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&A.push(E[C]),f){const L=c3(i,a,b);A.push(E[L[0]],E[L[1]])}if(N=[...N,{placement:i,overflows:A}],!A.every(L=>L<=0)){var I,P;const L=(((I=o.flip)==null?void 0:I.index)||0)+1,U=T[L];if(U)return{data:{index:L,overflows:N},reset:{placement:U}};let Y=(P=N.filter(k=>k.overflows[0]<=0).sort((k,ie)=>k.overflows[1]-ie.overflows[1])[0])==null?void 0:P.placement;if(!Y)switch(h){case"bestFit":{var _;const k=(_=N.map(ie=>[ie.placement,ie.overflows.filter(B=>B>0).reduce((B,G)=>B+G,0)]).sort((ie,B)=>ie[1]-B[1])[0])==null?void 0:_[0];k&&(Y=k);break}case"initialPlacement":Y=s;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};async function g3(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=ko(n),s=Bu(n),u=kf(n)==="y",l=["left","top"].includes(a)?-1:1,c=o&&u?-1:1,f=Vu(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof p=="number"&&(h=s==="end"?p*-1:p),u?{x:h*c,y:d*l}:{x:d*l,y:h*c}}const b3=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 g3(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}}}}},S3=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:g=>{let{x:C,y:m}=g;return{x:C,y:m}}},...u}=Vu(e,t),l={x:n,y:r},c=await o1(t,u),f=kf(ko(i)),d=r1(f);let h=l[d],p=l[f];if(o){const g=d==="y"?"top":"left",C=d==="y"?"bottom":"right",m=h+c[g],b=h-c[C];h=ih(m,h,b)}if(a){const g=f==="y"?"top":"left",C=f==="y"?"bottom":"right",m=p+c[g],b=p-c[C];p=ih(m,p,b)}const v=s.fn({...t,[d]:h,[f]:p});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function a1(e){const t=tr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=On(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Cc(n)!==o||Cc(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function fm(e){return Lt(e)?e:e.contextElement}function wa(e){const t=fm(e);if(!On(t))return zi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=a1(t);let a=(o?Cc(n.width):n.width)/r,s=(o?Cc(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const C3=zi(0);function s1(e){const t=er(e);return!um()||!t.visualViewport?C3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function w3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==er(e)?!1:t}function Mo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=fm(e);let a=zi(1);t&&(r?Lt(r)&&(a=wa(r)):a=wa(e));const s=w3(o,n,r)?s1(o):zi(0);let u=(i.left+s.x)/a.x,l=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o){const d=er(o),h=r&&Lt(r)?er(r):r;let p=d.frameElement;for(;p&&r&&h!==d;){const v=wa(p),g=p.getBoundingClientRect(),C=tr(p),m=g.left+(p.clientLeft+parseFloat(C.paddingLeft))*v.x,b=g.top+(p.clientTop+parseFloat(C.paddingTop))*v.y;u*=v.x,l*=v.y,c*=v.x,f*=v.y,u+=m,l+=b,p=er(p).frameElement}}return xc({width:c,height:f,x:u,y:l})}const x3=[":popover-open",":modal"];function u1(e){let t=!1,n=0,r=0;function i(o){try{t=t||e.matches(o)}catch{}}if(x3.forEach(o=>{i(o)}),t){const o=Qx(e);if(o){const a=o.getBoundingClientRect();n=a.x,r=a.y}}return[t,n,r]}function T3(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=li(r),[a]=t?u1(t.floating):[!1];if(r===o||a)return n;let s={scrollLeft:0,scrollTop:0},u=zi(1);const l=zi(0),c=On(r);if((c||!c&&i!=="fixed")&&((oi(r)!=="body"||Lu(o))&&(s=Rf(r)),On(r))){const f=Mo(r);u=wa(r),l.x=f.x+r.clientLeft,l.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+l.x,y:n.y*u.y-s.scrollTop*u.y+l.y}}function E3(e){return Array.from(e.getClientRects())}function l1(e){return Mo(li(e)).left+Rf(e).scrollLeft}function I3(e){const t=li(e),n=Rf(e),r=e.ownerDocument.body,i=So(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=So(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+l1(e);const s=-n.scrollTop;return tr(r).direction==="rtl"&&(a+=So(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function A3(e,t){const n=er(e),r=li(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const l=um();(!l||l&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s,y:u}}function $3(e,t){const n=Mo(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=On(e)?wa(e):zi(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,l=r*o.y;return{width:a,height:s,x:u,y:l}}function ab(e,t,n){let r;if(t==="viewport")r=A3(e,n);else if(t==="document")r=I3(li(e));else if(Lt(t))r=$3(t,n);else{const i=s1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return xc(r)}function c1(e,t){const n=Ro(e);return n===t||!Lt(n)||Na(n)?!1:tr(n).position==="fixed"||c1(n,t)}function O3(e,t){const n=t.get(e);if(n)return n;let r=ki(e,[],!1).filter(s=>Lt(s)&&oi(s)!=="body"),i=null;const o=tr(e).position==="fixed";let a=o?Ro(e):e;for(;Lt(a)&&!Na(a);){const s=tr(a),u=sm(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&i&&["absolute","fixed"].includes(i.position)||Lu(a)&&!u&&c1(e,a))?r=r.filter(l=>l!==a):i=s,a=Ro(a)}return t.set(e,r),r}function D3(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?O3(t,this._c):[].concat(n),r],a=o[0],s=o.reduce((u,l)=>{const c=ab(t,l,i);return u.top=So(c.top,u.top),u.right=Pa(c.right,u.right),u.bottom=Pa(c.bottom,u.bottom),u.left=So(c.left,u.left),u},ab(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function N3(e){const{width:t,height:n}=a1(e);return{width:t,height:n}}function P3(e,t,n,r){const i=On(t),o=li(t),a=n==="fixed",s=Mo(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const l=zi(0);if(i||!i&&!a)if((oi(t)!=="body"||Lu(o))&&(u=Rf(t)),i){const v=Mo(t,!0,a,t);l.x=v.x+t.clientLeft,l.y=v.y+t.clientTop}else o&&(l.x=l1(o));let c=s.left+u.scrollLeft-l.x,f=s.top+u.scrollTop-l.y;const[d,h,p]=u1(r);return d&&(c+=h,f+=p,i&&(c+=t.clientLeft,f+=t.clientTop)),{x:c,y:f,width:s.width,height:s.height}}function sb(e,t){return!On(e)||tr(e).position==="fixed"?null:t?t(e):e.offsetParent}function f1(e,t){const n=er(e);if(!On(e))return n;let r=sb(e,t);for(;r&&Z5(r)&&tr(r).position==="static";)r=sb(r,t);return r&&(oi(r)==="html"||oi(r)==="body"&&tr(r).position==="static"&&!sm(r))?n:r||Qx(e)||n}const R3=async function(e){const t=this.getOffsetParent||f1,n=this.getDimensions;return{reference:P3(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function k3(e){return tr(e).direction==="rtl"}const d1={convertOffsetParentRelativeRectToViewportRelativeRect:T3,getDocumentElement:li,getClippingRect:D3,getOffsetParent:f1,getElementRects:R3,getClientRects:E3,getDimensions:N3,getScale:wa,isElement:Lt,isRTL:k3};function M3(e,t){let n=null,r;const i=li(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:l,top:c,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const h=Sl(c),p=Sl(i.clientWidth-(l+f)),v=Sl(i.clientHeight-(c+d)),g=Sl(l),C={rootMargin:-h+"px "+-p+"px "+-v+"px "+-g+"px",threshold:So(0,Pa(1,u))||1};let m=!0;function b(x){const T=x[0].intersectionRatio;if(T!==u){if(!m)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},100)}m=!1}try{n=new IntersectionObserver(b,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,C)}n.observe(e)}return a(!0),o}function j3(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,l=fm(e),c=i||o?[...l?ki(l):[],...ki(t)]:[];c.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const f=l&&s?M3(l,n):null;let d=-1,h=null;a&&(h=new ResizeObserver(C=>{let[m]=C;m&&m.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),l&&!u&&h.observe(l),h.observe(t));let p,v=u?Mo(e):null;u&&g();function g(){const C=Mo(e);v&&(C.x!==v.x||C.y!==v.y||C.width!==v.width||C.height!==v.height)&&n(),v=C,p=requestAnimationFrame(g)}return n(),()=>{var C;c.forEach(m=>{i&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),f==null||f(),(C=h)==null||C.disconnect(),h=null,u&&cancelAnimationFrame(p)}}const _3=S3,q3=y3,ub=m3,F3=(e,t,n)=>{const r=new Map,i={platform:d1,...n},o={...i.platform,_c:r};return v3(e,t,{...i,platform:o})},L3=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?ub({element:r.current,padding:i}).fn(n):{}:r?ub({element:r,padding:i}).fn(n):{}}}};var zl=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Tc(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(!Tc(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)&&!Tc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function p1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lb(e,t){const n=p1(e);return Math.round(t*n)/n}function cb(e){const t=J.useRef(e);return zl(()=>{t.current=e}),t}function V3(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:l}=e,[c,f]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=J.useState(r);Tc(d,r)||h(r);const[p,v]=J.useState(null),[g,C]=J.useState(null),m=J.useCallback(B=>{B!==E.current&&(E.current=B,v(B))},[]),b=J.useCallback(B=>{B!==A.current&&(A.current=B,C(B))},[]),x=o||p,T=a||g,E=J.useRef(null),A=J.useRef(null),N=J.useRef(c),I=u!=null,P=cb(u),_=cb(i),L=J.useCallback(()=>{if(!E.current||!A.current)return;const B={placement:t,strategy:n,middleware:d};_.current&&(B.platform=_.current),F3(E.current,A.current,B).then(G=>{const fe={...G,isPositioned:!0};U.current&&!Tc(N.current,fe)&&(N.current=fe,gT.flushSync(()=>{f(fe)}))})},[d,t,n,_]);zl(()=>{l===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[l]);const U=J.useRef(!1);zl(()=>(U.current=!0,()=>{U.current=!1}),[]),zl(()=>{if(x&&(E.current=x),T&&(A.current=T),x&&T){if(P.current)return P.current(x,T,L);L()}},[x,T,L,P,I]);const Y=J.useMemo(()=>({reference:E,floating:A,setReference:m,setFloating:b}),[m,b]),k=J.useMemo(()=>({reference:x,floating:T}),[x,T]),ie=J.useMemo(()=>{const B={position:n,left:0,top:0};if(!k.floating)return B;const G=lb(k.floating,c.x),fe=lb(k.floating,c.y);return s?{...B,transform:"translate("+G+"px, "+fe+"px)",...p1(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:fe}},[n,s,k.floating,c.x,c.y]);return J.useMemo(()=>({...c,update:L,refs:Y,elements:k,floatingStyles:ie}),[c,L,Y,k,ie])}/*!
|
|
1154
1154
|
* tabbable 6.2.0
|
|
1155
1155
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
1156
|
-
*/var F3=["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])"],ah=F3.join(","),f1=typeof Element>"u",vu=f1?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ec=!f1&&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},Ic=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},L3=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},V3=function(e,t,n){if(Ic(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ah));return t&&vu.call(e,ah)&&r.unshift(e),r=r.filter(n),r},B3=function e(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!Ic(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),u=s.length?s:a.children,l=e(u,!0,r);r.flatten?i.push.apply(i,l):i.push({scopeParent:a,candidates:l})}else{var c=vu.call(a,ah);c&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),d=!Ic(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&d){var h=e(f===!0?a.children:f.children,!0,r);r.flatten?i.push.apply(i,h):i.push({scopeParent:a,candidates:h})}else o.unshift.apply(o,a.children)}}return i},d1=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},p1=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||L3(e))&&!d1(e)?0:e.tabIndex},U3=function(e,t){var n=p1(e);return n<0&&t&&!d1(e)?0:n},G3=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},h1=function(e){return e.tagName==="INPUT"},z3=function(e){return h1(e)&&e.type==="hidden"},W3=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},H3=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},K3=function(e){if(!e.name)return!0;var t=e.form||Ec(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=H3(r,e.form);return!i||i===e},Y3=function(e){return h1(e)&&e.type==="radio"},J3=function(e){return Y3(e)&&!K3(e)},X3=function(e){var t,n=e&&Ec(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,l,c;n=Ec(r),r=(u=n)===null||u===void 0?void 0:u.host,i=!!((l=r)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(r))}}return i},cb=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Q3=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=vu.call(e,"details>summary:first-of-type"),o=i?e.parentElement:e;if(vu.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=Ec(e);if(s&&!s.shadowRoot&&r(s)===!0)return cb(e);e.assignedSlot?e=e.assignedSlot:!s&&u!==e.ownerDocument?e=u.host:e=s}e=a}if(X3(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return cb(e);return!1},Z3=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 vu.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},eB=function(e,t){return!(t.disabled||Ic(t)||z3(t)||Q3(t,e)||W3(t)||Z3(t))},fb=function(e,t){return!(J3(t)||p1(t)<0||!eB(e,t))},tB=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},nB=function e(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,u=U3(s,a),l=a?e(i.candidates):s;u===0?a?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:u,item:i,isScope:a,content:l})}),r.sort(G3).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},pm=function(e,t){t=t||{};var n;return t.getShadowRoot?n=B3([e],t.includeContainer,{filter:fb.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:tB}):n=V3(e,t.includeContainer,fb.bind(null,t)),nB(n)};function hm(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 rB=J["useInsertionEffect".toString()],iB=rB||(e=>e());function ua(e){const t=J.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return iB(()=>{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 db=0;function no(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(db);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():db=requestAnimationFrame(o)}var sr=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Ra(){return Ra=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},Ra.apply(this,arguments)}let vd=!1,oB=0;const pb=()=>"floating-ui-"+oB++;function aB(){const[e,t]=J.useState(()=>vd?pb():void 0);return sr(()=>{e==null&&t(pb())},[]),J.useEffect(()=>{vd||(vd=!0)},[]),e}const sB=J["useId".toString()],Mf=sB||aB,uB=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:l,stroke:c,d:f,style:{transform:d,...h}={},...p}=e;process.env.NODE_ENV!=="production"&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=Mf();if(!r)return null;u*=2;const g=u/2,C=o/2*(s/-8+1),m=a/2*s/4,[b,x]=n.split("-"),T=l1.isRTL(r),E=!!f,A=b==="top"||b==="bottom",N=l&&x==="end"?"bottom":"top";let I=l&&x==="end"?"right":"left";l&&T&&(I=x==="end"?"left":"right");const P=(i==null?void 0:i.x)!=null?l||i.x:"",_=(i==null?void 0:i.y)!=null?l||i.y:"",L=f||"M0,0"+(" H"+o)+(" L"+(o-C)+","+(a-m))+(" Q"+o/2+","+a+" "+C+","+(a-m))+" Z",U={top:E?"rotate(180deg)":"",left:E?"rotate(90deg)":"rotate(-90deg)",bottom:E?"":"rotate(180deg)",right:E?"rotate(-90deg)":"rotate(90deg)"}[b];return J.createElement("svg",Ra({},p,{"aria-hidden":!0,ref:t,width:E?o:o+u,height:o,viewBox:"0 0 "+o+" "+(a>o?a:o),style:{position:"absolute",pointerEvents:"none",[I]:P,[N]:_,[b]:A||E?"100%":"calc(100% - "+u/2+"px)",transform:""+U+(d??""),...h}}),u>0&&J.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:c,strokeWidth:u+(f?0:1),d:L}),J.createElement("path",{stroke:u&&!f?p.fill:"none",d:L}),J.createElement("clipPath",{id:v},J.createElement("rect",{x:-g,y:g*(E?-1:1),width:o+u,height:o})))});function lB(){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 cB=J.createContext(null),fB=J.createContext(null),dB=()=>{var e;return((e=J.useContext(cB))==null?void 0:e.id)||null},vm=()=>J.useContext(fB);function mu(e){return"data-floating-ui-"+e}function md(e){const t=O.useRef(e);return sr(()=>{t.current=e}),t}function pB(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 Vs(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 ta=new WeakMap,Cl=new WeakSet,wl={},yd=0;const hB=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,v1=e=>e&&(e.host||v1(e.parentNode)),vB=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=v1(n);return e.contains(r)?r:null}).filter(n=>n!=null);function mB(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=vB(t,e),s=new Set,u=new Set(a),l=[];wl[i]||(wl[i]=new WeakMap);const c=wl[i];a.forEach(f),d(t),s.clear();function f(h){!h||s.has(h)||(s.add(h),h.parentNode&&f(h.parentNode))}function d(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,p=>{if(s.has(p))d(p);else{const v=o?p.getAttribute(o):null,g=v!==null&&v!=="false",C=(ta.get(p)||0)+1,m=(c.get(p)||0)+1;ta.set(p,C),c.set(p,m),l.push(p),C===1&&g&&Cl.add(p),m===1&&p.setAttribute(i,""),!g&&o&&p.setAttribute(o,"true")}})}return yd++,()=>{l.forEach(h=>{const p=(ta.get(h)||0)-1,v=(c.get(h)||0)-1;ta.set(h,p),c.set(h,v),p||(!Cl.has(h)&&o&&h.removeAttribute(o),Cl.delete(h)),v||h.removeAttribute(i)}),yd--,yd||(ta=new WeakMap,ta=new WeakMap,Cl=new WeakSet,wl={})}}function hb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=zr(e[0]).body;return mB(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const mm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function m1(e,t){const n=pm(e,mm());t==="prev"&&n.reverse();const r=n.indexOf(aa(zr(e)));return n.slice(r+1)[0]}function y1(){return m1(document.body,"next")}function g1(){return m1(document.body,"prev")}function Bs(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Hn(n,r)}function yB(e){pm(e,mm()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function gB(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 ym={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 bB;function vb(e){e.key==="Tab"&&(e.target,clearTimeout(bB))}const Ac=J.forwardRef(function(e,t){const[n,r]=J.useState();sr(()=>(Z5()&&r("button"),document.addEventListener("keydown",vb),()=>{document.removeEventListener("keydown",vb)}),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[mu("focus-guard")]:"",style:ym};return J.createElement("span",Ra({},e,i))}),b1=J.createContext(null),mb=mu("portal");function SB(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=J.useState(null),o=Mf(),a=C1(),s=J.useRef(null);return sr(()=>()=>{r==null||r.remove(),queueMicrotask(()=>{s.current=null})},[r]),sr(()=>{if(s.current)return;const u=t?document.getElementById(t):null;if(!u)return;const l=document.createElement("div");l.id=o,l.setAttribute(mb,""),u.appendChild(l),s.current=l,i(l)},[t,o]),sr(()=>{if(s.current)return;let u=n||(a==null?void 0:a.portalNode);u&&!Lt(u)&&(u=u.current),u=u||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,u.appendChild(l));const c=document.createElement("div");c.id=o,c.setAttribute(mb,""),u=l||u,u.appendChild(c),s.current=c,i(c)},[t,n,o,a]),r}function S1(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=SB({id:n,root:r}),[a,s]=J.useState(null),u=J.useRef(null),l=J.useRef(null),c=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 h(p){o&&Bs(p)&&(p.type==="focusin"?gB:yB)(o)}return o.addEventListener("focusin",h,!0),o.addEventListener("focusout",h,!0),()=>{o.removeEventListener("focusin",h,!0),o.removeEventListener("focusout",h,!0)}},[o,i,a==null?void 0:a.modal]),J.createElement(b1.Provider,{value:J.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:l,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:s}),[i,o])},d&&o&&J.createElement(Ac,{"data-type":"outside",ref:u,onFocus:h=>{if(Bs(h,o)){var p;(p=c.current)==null||p.focus()}else{const v=g1()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus()}}}),d&&o&&J.createElement("span",{"aria-owns":o.id,style:ym}),o&&Bb.createPortal(t,o),d&&o&&J.createElement(Ac,{"data-type":"outside",ref:l,onFocus:h=>{if(Bs(h,o)){var p;(p=f.current)==null||p.focus()}else{const v=y1()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,h.nativeEvent))}}}))}const C1=()=>J.useContext(b1),yb=20;let lo=[];function gd(e){lo=lo.filter(t=>t.isConnected),e&&ii(e)!=="body"&&(lo.push(e),lo.length>yb&&(lo=lo.slice(-yb)))}function gb(){return lo.slice().reverse().find(e=>e.isConnected)}const CB=J.forwardRef(function(e,t){return J.createElement("button",Ra({},e,{type:"button",ref:t,tabIndex:-1,style:ym}))});function w1(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:l=!1,closeOnFocusOut:c=!0}=e,{open:f,refs:d,nodeId:h,onOpenChange:p,events:v,dataRef:g,elements:{domReference:C,floating:m}}=t,b=typeof a=="number"&&a<0,x=i3(C)&&b,T=hB()?o:!0,E=md(i),A=md(a),N=md(s),I=vm(),P=C1(),_=J.useRef(null),L=J.useRef(null),U=J.useRef(!1),Y=J.useRef(!1),k=P!=null,ie=J.useCallback(function(j){return j===void 0&&(j=m),j?pm(j,mm()):[]},[m]),B=J.useCallback(j=>{const R=ie(j);return E.current.map(te=>C&&te==="reference"?C:m&&te==="floating"?m:R).filter(Boolean).flat()},[C,m,E,ie]);J.useEffect(()=>{if(r||!u)return;function j(te){if(te.key==="Tab"){Hn(m,aa(zr(m)))&&ie().length===0&&!x&&hd(te);const oe=B(),X=sa(te);E.current[0]==="reference"&&X===C&&(hd(te),te.shiftKey?no(oe[oe.length-1]):no(oe[1])),E.current[1]==="floating"&&X===m&&te.shiftKey&&(hd(te),no(oe[0]))}}const R=zr(m);return R.addEventListener("keydown",j),()=>{R.removeEventListener("keydown",j)}},[r,C,m,u,E,x,ie,B]),J.useEffect(()=>{if(r||!c)return;function j(){Y.current=!0,setTimeout(()=>{Y.current=!1})}function R(te){const oe=te.relatedTarget;queueMicrotask(()=>{const X=!(Hn(C,oe)||Hn(m,oe)||Hn(oe,m)||Hn(P==null?void 0:P.portalNode,oe)||oe!=null&&oe.hasAttribute(mu("focus-guard"))||I&&(Vs(I.nodesRef.current,h).find(ae=>{var de,he;return Hn((de=ae.context)==null?void 0:de.elements.floating,oe)||Hn((he=ae.context)==null?void 0:he.elements.domReference,oe)})||pB(I.nodesRef.current,h).find(ae=>{var de,he;return((de=ae.context)==null?void 0:de.elements.floating)===oe||((he=ae.context)==null?void 0:he.elements.domReference)===oe})));oe&&X&&!Y.current&&oe!==gb()&&(U.current=!0,p(!1,te))})}if(m&&On(C))return C.addEventListener("focusout",R),C.addEventListener("pointerdown",j),!u&&m.addEventListener("focusout",R),()=>{C.removeEventListener("focusout",R),C.removeEventListener("pointerdown",j),!u&&m.removeEventListener("focusout",R)}},[r,C,m,u,h,I,P,p,c]),J.useEffect(()=>{var j;if(r)return;const R=Array.from((P==null||(j=P.portalNode)==null?void 0:j.querySelectorAll("["+mu("portal")+"]"))||[]);if(m){const te=[m,...R,_.current,L.current,E.current.includes("reference")||x?C:null].filter(X=>X!=null),oe=u||x?hb(te,T,!T):hb(te);return()=>{oe()}}},[r,C,m,u,E,P,x,T]),sr(()=>{if(r||!m)return;const j=zr(m),R=aa(j);queueMicrotask(()=>{const te=B(m),oe=A.current,X=(typeof oe=="number"?te[oe]:oe.current)||m,ae=Hn(m,R);!b&&!ae&&f&&no(X,{preventScroll:X===m})})},[r,f,m,b,B,A]),sr(()=>{if(r||!m)return;let j=!1;const R=zr(m),te=aa(R),oe=g.current;gd(te);function X(ae){let{reason:de,event:he,nested:Te}=ae;de==="escape-key"&&d.domReference.current&&gd(d.domReference.current),de==="hover"&&he.type==="mouseleave"&&(U.current=!0),de==="outside-press"&&(Te?(U.current=!1,j=!0):U.current=!(X5(he)||Q5(he)))}return v.on("openchange",X),()=>{v.off("openchange",X);const ae=aa(R),de=Hn(m,ae)||I&&Vs(I.nodesRef.current,h).some(Te=>{var ke;return Hn((ke=Te.context)==null?void 0:ke.elements.floating,ae)});(de||oe.openEvent&&["click","mousedown"].includes(oe.openEvent.type))&&d.domReference.current&&gd(d.domReference.current);const he=gb();N.current&&!U.current&&On(he)&&(!(he!==ae&&ae!==R.body)||de)&&no(he,{cancelPrevious:!1,preventScroll:j})}},[r,m,N,g,d,v,I,h]),sr(()=>{if(!(r||!P))return P.setFocusManagerState({modal:u,closeOnFocusOut:c,open:f,onOpenChange:p,refs:d}),()=>{P.setFocusManagerState(null)}},[r,P,u,f,p,d,c]),sr(()=>{if(r||!m||typeof MutationObserver!="function"||b)return;const j=()=>{const te=m.getAttribute("tabindex");E.current.includes("floating")||aa(zr(m))!==d.domReference.current&&ie().length===0?te!=="0"&&m.setAttribute("tabindex","0"):te!=="-1"&&m.setAttribute("tabindex","-1")};j();const R=new MutationObserver(j);return R.observe(m,{childList:!0,subtree:!0,attributes:!0}),()=>{R.disconnect()}},[r,m,d,E,ie,b]);function G(j){return r||!l||!u?null:J.createElement(CB,{ref:j==="start"?_:L,onClick:R=>p(!1,R.nativeEvent)},typeof l=="string"?l:"Dismiss")}const fe=!r&&T&&(k||u);return J.createElement(J.Fragment,null,fe&&J.createElement(Ac,{"data-type":"inside",ref:P==null?void 0:P.beforeInsideRef,onFocus:j=>{if(u){const te=B();no(i[0]==="reference"?te[0]:te[te.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(U.current=!1,Bs(j,P.portalNode)){const te=y1()||C;te==null||te.focus()}else{var R;(R=P.beforeOutsideRef.current)==null||R.focus()}}}),!x&&G("start"),n,G("end"),fe&&J.createElement(Ac,{"data-type":"inside",ref:P==null?void 0:P.afterInsideRef,onFocus:j=>{if(u)no(B()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(c&&(U.current=!0),Bs(j,P.portalNode)){const te=g1()||C;te==null||te.focus()}else{var R;(R=P.afterOutsideRef.current)==null||R.focus()}}}))}const bd=new Set,x1=J.forwardRef(function(e,t){let{lockScroll:n=!1,...r}=e;const i=Mf();return sr(()=>{if(!n)return;bd.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,l=a.left?parseFloat(a.left):window.pageXOffset,c=a.top?parseFloat(a.top):window.pageYOffset;if(a.overflow="hidden",u&&(a[s]=u+"px"),o){var f,d;const h=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,p=((d=window.visualViewport)==null?void 0:d.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(c-Math.floor(p))+"px",left:-(l-Math.floor(h))+"px",right:"0"})}return()=>{bd.delete(i),bd.size===0&&(Object.assign(a,{overflow:"",[s]:""}),o&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(l,c)))}},[i,n]),J.createElement("div",Ra({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function bb(e){return On(e.target)&&e.target.tagName==="BUTTON"}function Sb(e){return Zx(e)}function T1(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:l=!1,keyboardHandlers:c=!0}=t,f=J.useRef(),d=J.useRef(!1);return J.useMemo(()=>a?{reference:{onPointerDown(h){f.current=h.pointerType},onMouseDown(h){h.button===0&&(rb(f.current,!0)&&l||s!=="click"&&(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,h.nativeEvent,"click"):(h.preventDefault(),r(!0,h.nativeEvent,"click"))))},onClick(h){if(s==="mousedown"&&f.current){f.current=void 0;return}rb(f.current,!0)&&l||(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,h.nativeEvent,"click"):r(!0,h.nativeEvent,"click"))},onKeyDown(h){f.current=void 0,!(h.defaultPrevented||!c||bb(h))&&(h.key===" "&&!Sb(o)&&(h.preventDefault(),d.current=!0),h.key==="Enter"&&r(!(n&&u),h.nativeEvent,"click"))},onKeyUp(h){h.defaultPrevented||!c||bb(h)||Sb(o)||h.key===" "&&d.current&&(d.current=!1,r(!(n&&u),h.nativeEvent,"click"))}}}:{},[a,i,s,l,c,o,u,n,r])}const wB={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},xB={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Cb=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 E1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:i,elements:{reference:o,domReference:a,floating:s},dataRef:u}=e,{enabled:l=!0,escapeKey:c=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:h=!1,referencePressEvent:p="pointerdown",ancestorScroll:v=!1,bubbles:g,capture:C}=t,m=vm(),b=ua(typeof f=="function"?f:()=>!1),x=typeof f=="function"?b:f,T=J.useRef(!1),E=J.useRef(!1),{escapeKey:A,outsidePress:N}=Cb(g),{escapeKey:I,outsidePress:P}=Cb(C),_=ua(k=>{if(!n||!l||!c||k.key!=="Escape")return;const ie=m?Vs(m.nodesRef.current,i):[];if(!A&&(k.stopPropagation(),ie.length>0)){let B=!0;if(ie.forEach(G=>{var fe;if((fe=G.context)!=null&&fe.open&&!G.context.dataRef.current.__escapeKeyBubbles){B=!1;return}}),!B)return}r(!1,t3(k)?k.nativeEvent:k,"escape-key")}),L=ua(k=>{var ie;const B=()=>{var G;_(k),(G=sa(k))==null||G.removeEventListener("keydown",B)};(ie=sa(k))==null||ie.addEventListener("keydown",B)}),U=ua(k=>{const ie=T.current;T.current=!1;const B=E.current;if(E.current=!1,d==="click"&&B||ie||typeof x=="function"&&!x(k))return;const G=sa(k),fe="["+mu("inert")+"]",j=zr(s).querySelectorAll(fe);let R=Lt(G)?G:null;for(;R&&!Na(R);){const X=Ro(R);if(Na(X)||!Lt(X))break;R=X}if(j.length&&Lt(G)&&!n3(G)&&!Hn(G,s)&&Array.from(j).every(X=>!Hn(R,X)))return;if(On(G)&&s){const X=G.clientWidth>0&&G.scrollWidth>G.clientWidth,ae=G.clientHeight>0&&G.scrollHeight>G.clientHeight;let de=ae&&k.offsetX>G.clientWidth;if(ae&&tr(G).direction==="rtl"&&(de=k.offsetX<=G.offsetWidth-G.clientWidth),de||X&&k.offsetY>G.clientHeight)return}const te=m&&Vs(m.nodesRef.current,i).some(X=>{var ae;return pd(k,(ae=X.context)==null?void 0:ae.elements.floating)});if(pd(k,s)||pd(k,a)||te)return;const oe=m?Vs(m.nodesRef.current,i):[];if(oe.length>0){let X=!0;if(oe.forEach(ae=>{var de;if((de=ae.context)!=null&&de.open&&!ae.context.dataRef.current.__outsidePressBubbles){X=!1;return}}),!X)return}r(!1,k,"outside-press")}),Y=ua(k=>{var ie;const B=()=>{var G;U(k),(G=sa(k))==null||G.removeEventListener(d,B)};(ie=sa(k))==null||ie.addEventListener(d,B)});return J.useEffect(()=>{if(!n||!l)return;u.current.__escapeKeyBubbles=A,u.current.__outsidePressBubbles=N;function k(G){r(!1,G,"ancestor-scroll")}const ie=zr(s);c&&ie.addEventListener("keydown",I?L:_,I),x&&ie.addEventListener(d,P?Y:U,P);let B=[];return v&&(Lt(a)&&(B=ki(a)),Lt(s)&&(B=B.concat(ki(s))),!Lt(o)&&o&&o.contextElement&&(B=B.concat(ki(o.contextElement)))),B=B.filter(G=>{var fe;return G!==((fe=ie.defaultView)==null?void 0:fe.visualViewport)}),B.forEach(G=>{G.addEventListener("scroll",k,{passive:!0})}),()=>{c&&ie.removeEventListener("keydown",I?L:_,I),x&&ie.removeEventListener(d,P?Y:U,P),B.forEach(G=>{G.removeEventListener("scroll",k)})}},[u,s,a,o,c,x,d,n,r,v,l,A,N,_,I,L,U,P,Y]),J.useEffect(()=>{T.current=!1},[x,d]),J.useMemo(()=>l?{reference:{onKeyDown:_,[wB[p]]:k=>{h&&r(!1,k.nativeEvent,"reference-press")}},floating:{onKeyDown:_,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[xB[d]]:()=>{T.current=!0}}}:{},[l,h,d,p,r,_])}let sh;process.env.NODE_ENV!=="production"&&(sh=new Set);function I1(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 N="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&&!Lt(e.elements.reference)){var a;if(!((a=sh)!=null&&a.has(N))){var s;(s=sh)==null||s.add(N),console.error(N)}}}const[u,l]=J.useState(null),c=((t=e.elements)==null?void 0:t.reference)||u,f=q3(e),d=vm(),h=dB()!=null,p=ua((N,I,P)=>{N&&(g.current.openEvent=I),C.emit("openchange",{open:N,event:I,reason:P,nested:h}),r==null||r(N,I,P)}),v=J.useRef(null),g=J.useRef({}),C=J.useState(()=>lB())[0],m=Mf(),b=J.useCallback(N=>{const I=Lt(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),contextElement:N}:N;f.refs.setReference(I)},[f.refs]),x=J.useCallback(N=>{(Lt(N)||N===null)&&(v.current=N,l(N)),(Lt(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!Lt(N))&&f.refs.setReference(N)},[f.refs]),T=J.useMemo(()=>({...f.refs,setReference:x,setPositionReference:b,domReference:v}),[f.refs,x,b]),E=J.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),A=J.useMemo(()=>({...f,refs:T,elements:E,dataRef:g,nodeId:i,floatingId:m,events:C,open:n,onOpenChange:p}),[f,i,m,C,n,p,T,E]);return sr(()=>{const N=d==null?void 0:d.nodesRef.current.find(I=>I.id===i);N&&(N.context=A)}),J.useMemo(()=>({...f,context:A,refs:T,elements:E}),[f,T,E,A])}const wb="active",xb="selected";function Sd(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[wb]:a,[xb]: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[l,c]=u;if(!(i&&[wb,xb].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof c=="function"){var f;(f=r.get(l))==null||f.push(c),a[l]=function(){for(var d,h=arguments.length,p=new Array(h),v=0;v<h;v++)p[v]=arguments[v];return(d=r.get(l))==null?void 0:d.map(g=>g(...p)).find(g=>g!==void 0)}}}else a[l]=c}),a),{})}}function A1(e){e===void 0&&(e=[]);const t=e,n=J.useCallback(o=>Sd(o,e,"reference"),t),r=J.useCallback(o=>Sd(o,e,"floating"),t),i=J.useCallback(o=>Sd(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 TB(e={}){const{initialOpen:t=!1,open:n,onOpenChange:r}=e,[i,o]=J.useState(t),a=n??i,s=r??o,u=I1({open:a,onOpenChange:s}),l=u.context,c=T1(l,{enabled:n==null}),f=E1(l,{outsidePressEvent:"mousedown"}),d=A1([c,f]);return J.useMemo(()=>({open:a,setOpen:s,...d,...u}),[a,s,d,u])}const $1=J.createContext(null),O1=()=>{const e=J.useContext($1);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function EB({children:e,...t}){const n=TB(t);return $.jsx($1.Provider,{value:n,children:e})}const D1=Fv`
|
|
1156
|
+
*/var B3=["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])"],ah=B3.join(","),h1=typeof Element>"u",vu=h1?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ec=!h1&&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},Ic=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},U3=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},G3=function(e,t,n){if(Ic(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ah));return t&&vu.call(e,ah)&&r.unshift(e),r=r.filter(n),r},z3=function e(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!Ic(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),u=s.length?s:a.children,l=e(u,!0,r);r.flatten?i.push.apply(i,l):i.push({scopeParent:a,candidates:l})}else{var c=vu.call(a,ah);c&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),d=!Ic(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&d){var h=e(f===!0?a.children:f.children,!0,r);r.flatten?i.push.apply(i,h):i.push({scopeParent:a,candidates:h})}else o.unshift.apply(o,a.children)}}return i},v1=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},m1=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||U3(e))&&!v1(e)?0:e.tabIndex},W3=function(e,t){var n=m1(e);return n<0&&t&&!v1(e)?0:n},H3=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},y1=function(e){return e.tagName==="INPUT"},K3=function(e){return y1(e)&&e.type==="hidden"},Y3=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},J3=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},X3=function(e){if(!e.name)return!0;var t=e.form||Ec(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=J3(r,e.form);return!i||i===e},Q3=function(e){return y1(e)&&e.type==="radio"},Z3=function(e){return Q3(e)&&!X3(e)},eB=function(e){var t,n=e&&Ec(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,l,c;n=Ec(r),r=(u=n)===null||u===void 0?void 0:u.host,i=!!((l=r)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(r))}}return i},fb=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},tB=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=vu.call(e,"details>summary:first-of-type"),o=i?e.parentElement:e;if(vu.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=Ec(e);if(s&&!s.shadowRoot&&r(s)===!0)return fb(e);e.assignedSlot?e=e.assignedSlot:!s&&u!==e.ownerDocument?e=u.host:e=s}e=a}if(eB(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return fb(e);return!1},nB=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 vu.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},rB=function(e,t){return!(t.disabled||Ic(t)||K3(t)||tB(t,e)||Y3(t)||nB(t))},db=function(e,t){return!(Z3(t)||m1(t)<0||!rB(e,t))},iB=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},oB=function e(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,u=W3(s,a),l=a?e(i.candidates):s;u===0?a?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:u,item:i,isScope:a,content:l})}),r.sort(H3).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},dm=function(e,t){t=t||{};var n;return t.getShadowRoot?n=z3([e],t.includeContainer,{filter:db.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:iB}):n=G3(e,t.includeContainer,db.bind(null,t)),oB(n)};function pm(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 aB=J["useInsertionEffect".toString()],sB=aB||(e=>e());function ua(e){const t=J.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return sB(()=>{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 pb=0;function no(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(pb);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():pb=requestAnimationFrame(o)}var sr=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Ra(){return Ra=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},Ra.apply(this,arguments)}let vd=!1,uB=0;const hb=()=>"floating-ui-"+uB++;function lB(){const[e,t]=J.useState(()=>vd?hb():void 0);return sr(()=>{e==null&&t(hb())},[]),J.useEffect(()=>{vd||(vd=!0)},[]),e}const cB=J["useId".toString()],Mf=cB||lB,fB=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:l,stroke:c,d:f,style:{transform:d,...h}={},...p}=e;process.env.NODE_ENV!=="production"&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=Mf();if(!r)return null;u*=2;const g=u/2,C=o/2*(s/-8+1),m=a/2*s/4,[b,x]=n.split("-"),T=d1.isRTL(r),E=!!f,A=b==="top"||b==="bottom",N=l&&x==="end"?"bottom":"top";let I=l&&x==="end"?"right":"left";l&&T&&(I=x==="end"?"left":"right");const P=(i==null?void 0:i.x)!=null?l||i.x:"",_=(i==null?void 0:i.y)!=null?l||i.y:"",L=f||"M0,0"+(" H"+o)+(" L"+(o-C)+","+(a-m))+(" Q"+o/2+","+a+" "+C+","+(a-m))+" Z",U={top:E?"rotate(180deg)":"",left:E?"rotate(90deg)":"rotate(-90deg)",bottom:E?"":"rotate(180deg)",right:E?"rotate(-90deg)":"rotate(90deg)"}[b];return J.createElement("svg",Ra({},p,{"aria-hidden":!0,ref:t,width:E?o:o+u,height:o,viewBox:"0 0 "+o+" "+(a>o?a:o),style:{position:"absolute",pointerEvents:"none",[I]:P,[N]:_,[b]:A||E?"100%":"calc(100% - "+u/2+"px)",transform:""+U+(d??""),...h}}),u>0&&J.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:c,strokeWidth:u+(f?0:1),d:L}),J.createElement("path",{stroke:u&&!f?p.fill:"none",d:L}),J.createElement("clipPath",{id:v},J.createElement("rect",{x:-g,y:g*(E?-1:1),width:o+u,height:o})))});function dB(){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 pB=J.createContext(null),hB=J.createContext(null),vB=()=>{var e;return((e=J.useContext(pB))==null?void 0:e.id)||null},hm=()=>J.useContext(hB);function mu(e){return"data-floating-ui-"+e}function md(e){const t=O.useRef(e);return sr(()=>{t.current=e}),t}function mB(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 Vs(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 ta=new WeakMap,Cl=new WeakSet,wl={},yd=0;const yB=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,g1=e=>e&&(e.host||g1(e.parentNode)),gB=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=g1(n);return e.contains(r)?r:null}).filter(n=>n!=null);function bB(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=gB(t,e),s=new Set,u=new Set(a),l=[];wl[i]||(wl[i]=new WeakMap);const c=wl[i];a.forEach(f),d(t),s.clear();function f(h){!h||s.has(h)||(s.add(h),h.parentNode&&f(h.parentNode))}function d(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,p=>{if(s.has(p))d(p);else{const v=o?p.getAttribute(o):null,g=v!==null&&v!=="false",C=(ta.get(p)||0)+1,m=(c.get(p)||0)+1;ta.set(p,C),c.set(p,m),l.push(p),C===1&&g&&Cl.add(p),m===1&&p.setAttribute(i,""),!g&&o&&p.setAttribute(o,"true")}})}return yd++,()=>{l.forEach(h=>{const p=(ta.get(h)||0)-1,v=(c.get(h)||0)-1;ta.set(h,p),c.set(h,v),p||(!Cl.has(h)&&o&&h.removeAttribute(o),Cl.delete(h)),v||h.removeAttribute(i)}),yd--,yd||(ta=new WeakMap,ta=new WeakMap,Cl=new WeakSet,wl={})}}function vb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Wr(e[0]).body;return bB(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const vm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function b1(e,t){const n=dm(e,vm());t==="prev"&&n.reverse();const r=n.indexOf(aa(Wr(e)));return n.slice(r+1)[0]}function S1(){return b1(document.body,"next")}function C1(){return b1(document.body,"prev")}function Bs(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Hn(n,r)}function SB(e){dm(e,vm()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function CB(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 mm={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 wB;function mb(e){e.key==="Tab"&&(e.target,clearTimeout(wB))}const Ac=J.forwardRef(function(e,t){const[n,r]=J.useState();sr(()=>(n3()&&r("button"),document.addEventListener("keydown",mb),()=>{document.removeEventListener("keydown",mb)}),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[mu("focus-guard")]:"",style:mm};return J.createElement("span",Ra({},e,i))}),w1=J.createContext(null),yb=mu("portal");function xB(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=J.useState(null),o=Mf(),a=T1(),s=J.useRef(null);return sr(()=>()=>{r==null||r.remove(),queueMicrotask(()=>{s.current=null})},[r]),sr(()=>{if(s.current)return;const u=t?document.getElementById(t):null;if(!u)return;const l=document.createElement("div");l.id=o,l.setAttribute(yb,""),u.appendChild(l),s.current=l,i(l)},[t,o]),sr(()=>{if(s.current)return;let u=n||(a==null?void 0:a.portalNode);u&&!Lt(u)&&(u=u.current),u=u||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,u.appendChild(l));const c=document.createElement("div");c.id=o,c.setAttribute(yb,""),u=l||u,u.appendChild(c),s.current=c,i(c)},[t,n,o,a]),r}function x1(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=xB({id:n,root:r}),[a,s]=J.useState(null),u=J.useRef(null),l=J.useRef(null),c=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 h(p){o&&Bs(p)&&(p.type==="focusin"?CB:SB)(o)}return o.addEventListener("focusin",h,!0),o.addEventListener("focusout",h,!0),()=>{o.removeEventListener("focusin",h,!0),o.removeEventListener("focusout",h,!0)}},[o,i,a==null?void 0:a.modal]),J.createElement(w1.Provider,{value:J.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:l,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:s}),[i,o])},d&&o&&J.createElement(Ac,{"data-type":"outside",ref:u,onFocus:h=>{if(Bs(h,o)){var p;(p=c.current)==null||p.focus()}else{const v=C1()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus()}}}),d&&o&&J.createElement("span",{"aria-owns":o.id,style:mm}),o&&Gb.createPortal(t,o),d&&o&&J.createElement(Ac,{"data-type":"outside",ref:l,onFocus:h=>{if(Bs(h,o)){var p;(p=f.current)==null||p.focus()}else{const v=S1()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,h.nativeEvent))}}}))}const T1=()=>J.useContext(w1),gb=20;let lo=[];function gd(e){lo=lo.filter(t=>t.isConnected),e&&oi(e)!=="body"&&(lo.push(e),lo.length>gb&&(lo=lo.slice(-gb)))}function bb(){return lo.slice().reverse().find(e=>e.isConnected)}const TB=J.forwardRef(function(e,t){return J.createElement("button",Ra({},e,{type:"button",ref:t,tabIndex:-1,style:mm}))});function E1(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:l=!1,closeOnFocusOut:c=!0}=e,{open:f,refs:d,nodeId:h,onOpenChange:p,events:v,dataRef:g,elements:{domReference:C,floating:m}}=t,b=typeof a=="number"&&a<0,x=s3(C)&&b,T=yB()?o:!0,E=md(i),A=md(a),N=md(s),I=hm(),P=T1(),_=J.useRef(null),L=J.useRef(null),U=J.useRef(!1),Y=J.useRef(!1),k=P!=null,ie=J.useCallback(function(j){return j===void 0&&(j=m),j?dm(j,vm()):[]},[m]),B=J.useCallback(j=>{const R=ie(j);return E.current.map(te=>C&&te==="reference"?C:m&&te==="floating"?m:R).filter(Boolean).flat()},[C,m,E,ie]);J.useEffect(()=>{if(r||!u)return;function j(te){if(te.key==="Tab"){Hn(m,aa(Wr(m)))&&ie().length===0&&!x&&hd(te);const oe=B(),X=sa(te);E.current[0]==="reference"&&X===C&&(hd(te),te.shiftKey?no(oe[oe.length-1]):no(oe[1])),E.current[1]==="floating"&&X===m&&te.shiftKey&&(hd(te),no(oe[0]))}}const R=Wr(m);return R.addEventListener("keydown",j),()=>{R.removeEventListener("keydown",j)}},[r,C,m,u,E,x,ie,B]),J.useEffect(()=>{if(r||!c)return;function j(){Y.current=!0,setTimeout(()=>{Y.current=!1})}function R(te){const oe=te.relatedTarget;queueMicrotask(()=>{const X=!(Hn(C,oe)||Hn(m,oe)||Hn(oe,m)||Hn(P==null?void 0:P.portalNode,oe)||oe!=null&&oe.hasAttribute(mu("focus-guard"))||I&&(Vs(I.nodesRef.current,h).find(ae=>{var de,he;return Hn((de=ae.context)==null?void 0:de.elements.floating,oe)||Hn((he=ae.context)==null?void 0:he.elements.domReference,oe)})||mB(I.nodesRef.current,h).find(ae=>{var de,he;return((de=ae.context)==null?void 0:de.elements.floating)===oe||((he=ae.context)==null?void 0:he.elements.domReference)===oe})));oe&&X&&!Y.current&&oe!==bb()&&(U.current=!0,p(!1,te))})}if(m&&On(C))return C.addEventListener("focusout",R),C.addEventListener("pointerdown",j),!u&&m.addEventListener("focusout",R),()=>{C.removeEventListener("focusout",R),C.removeEventListener("pointerdown",j),!u&&m.removeEventListener("focusout",R)}},[r,C,m,u,h,I,P,p,c]),J.useEffect(()=>{var j;if(r)return;const R=Array.from((P==null||(j=P.portalNode)==null?void 0:j.querySelectorAll("["+mu("portal")+"]"))||[]);if(m){const te=[m,...R,_.current,L.current,E.current.includes("reference")||x?C:null].filter(X=>X!=null),oe=u||x?vb(te,T,!T):vb(te);return()=>{oe()}}},[r,C,m,u,E,P,x,T]),sr(()=>{if(r||!m)return;const j=Wr(m),R=aa(j);queueMicrotask(()=>{const te=B(m),oe=A.current,X=(typeof oe=="number"?te[oe]:oe.current)||m,ae=Hn(m,R);!b&&!ae&&f&&no(X,{preventScroll:X===m})})},[r,f,m,b,B,A]),sr(()=>{if(r||!m)return;let j=!1;const R=Wr(m),te=aa(R),oe=g.current;gd(te);function X(ae){let{reason:de,event:he,nested:Te}=ae;de==="escape-key"&&d.domReference.current&&gd(d.domReference.current),de==="hover"&&he.type==="mouseleave"&&(U.current=!0),de==="outside-press"&&(Te?(U.current=!1,j=!0):U.current=!(e3(he)||t3(he)))}return v.on("openchange",X),()=>{v.off("openchange",X);const ae=aa(R),de=Hn(m,ae)||I&&Vs(I.nodesRef.current,h).some(Te=>{var ke;return Hn((ke=Te.context)==null?void 0:ke.elements.floating,ae)});(de||oe.openEvent&&["click","mousedown"].includes(oe.openEvent.type))&&d.domReference.current&&gd(d.domReference.current);const he=bb();N.current&&!U.current&&On(he)&&(!(he!==ae&&ae!==R.body)||de)&&no(he,{cancelPrevious:!1,preventScroll:j})}},[r,m,N,g,d,v,I,h]),sr(()=>{if(!(r||!P))return P.setFocusManagerState({modal:u,closeOnFocusOut:c,open:f,onOpenChange:p,refs:d}),()=>{P.setFocusManagerState(null)}},[r,P,u,f,p,d,c]),sr(()=>{if(r||!m||typeof MutationObserver!="function"||b)return;const j=()=>{const te=m.getAttribute("tabindex");E.current.includes("floating")||aa(Wr(m))!==d.domReference.current&&ie().length===0?te!=="0"&&m.setAttribute("tabindex","0"):te!=="-1"&&m.setAttribute("tabindex","-1")};j();const R=new MutationObserver(j);return R.observe(m,{childList:!0,subtree:!0,attributes:!0}),()=>{R.disconnect()}},[r,m,d,E,ie,b]);function G(j){return r||!l||!u?null:J.createElement(TB,{ref:j==="start"?_:L,onClick:R=>p(!1,R.nativeEvent)},typeof l=="string"?l:"Dismiss")}const fe=!r&&T&&(k||u);return J.createElement(J.Fragment,null,fe&&J.createElement(Ac,{"data-type":"inside",ref:P==null?void 0:P.beforeInsideRef,onFocus:j=>{if(u){const te=B();no(i[0]==="reference"?te[0]:te[te.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(U.current=!1,Bs(j,P.portalNode)){const te=S1()||C;te==null||te.focus()}else{var R;(R=P.beforeOutsideRef.current)==null||R.focus()}}}),!x&&G("start"),n,G("end"),fe&&J.createElement(Ac,{"data-type":"inside",ref:P==null?void 0:P.afterInsideRef,onFocus:j=>{if(u)no(B()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(c&&(U.current=!0),Bs(j,P.portalNode)){const te=C1()||C;te==null||te.focus()}else{var R;(R=P.afterOutsideRef.current)==null||R.focus()}}}))}const bd=new Set,I1=J.forwardRef(function(e,t){let{lockScroll:n=!1,...r}=e;const i=Mf();return sr(()=>{if(!n)return;bd.add(i);const o=/iP(hone|ad|od)|iOS/.test(e1()),a=document.body.style,s=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,l=a.left?parseFloat(a.left):window.pageXOffset,c=a.top?parseFloat(a.top):window.pageYOffset;if(a.overflow="hidden",u&&(a[s]=u+"px"),o){var f,d;const h=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,p=((d=window.visualViewport)==null?void 0:d.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(c-Math.floor(p))+"px",left:-(l-Math.floor(h))+"px",right:"0"})}return()=>{bd.delete(i),bd.size===0&&(Object.assign(a,{overflow:"",[s]:""}),o&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(l,c)))}},[i,n]),J.createElement("div",Ra({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function Sb(e){return On(e.target)&&e.target.tagName==="BUTTON"}function Cb(e){return n1(e)}function A1(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:l=!1,keyboardHandlers:c=!0}=t,f=J.useRef(),d=J.useRef(!1);return J.useMemo(()=>a?{reference:{onPointerDown(h){f.current=h.pointerType},onMouseDown(h){h.button===0&&(ib(f.current,!0)&&l||s!=="click"&&(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,h.nativeEvent,"click"):(h.preventDefault(),r(!0,h.nativeEvent,"click"))))},onClick(h){if(s==="mousedown"&&f.current){f.current=void 0;return}ib(f.current,!0)&&l||(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,h.nativeEvent,"click"):r(!0,h.nativeEvent,"click"))},onKeyDown(h){f.current=void 0,!(h.defaultPrevented||!c||Sb(h))&&(h.key===" "&&!Cb(o)&&(h.preventDefault(),d.current=!0),h.key==="Enter"&&r(!(n&&u),h.nativeEvent,"click"))},onKeyUp(h){h.defaultPrevented||!c||Sb(h)||Cb(o)||h.key===" "&&d.current&&(d.current=!1,r(!(n&&u),h.nativeEvent,"click"))}}}:{},[a,i,s,l,c,o,u,n,r])}const EB={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},IB={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},wb=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 $1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:i,elements:{reference:o,domReference:a,floating:s},dataRef:u}=e,{enabled:l=!0,escapeKey:c=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:h=!1,referencePressEvent:p="pointerdown",ancestorScroll:v=!1,bubbles:g,capture:C}=t,m=hm(),b=ua(typeof f=="function"?f:()=>!1),x=typeof f=="function"?b:f,T=J.useRef(!1),E=J.useRef(!1),{escapeKey:A,outsidePress:N}=wb(g),{escapeKey:I,outsidePress:P}=wb(C),_=ua(k=>{if(!n||!l||!c||k.key!=="Escape")return;const ie=m?Vs(m.nodesRef.current,i):[];if(!A&&(k.stopPropagation(),ie.length>0)){let B=!0;if(ie.forEach(G=>{var fe;if((fe=G.context)!=null&&fe.open&&!G.context.dataRef.current.__escapeKeyBubbles){B=!1;return}}),!B)return}r(!1,i3(k)?k.nativeEvent:k,"escape-key")}),L=ua(k=>{var ie;const B=()=>{var G;_(k),(G=sa(k))==null||G.removeEventListener("keydown",B)};(ie=sa(k))==null||ie.addEventListener("keydown",B)}),U=ua(k=>{const ie=T.current;T.current=!1;const B=E.current;if(E.current=!1,d==="click"&&B||ie||typeof x=="function"&&!x(k))return;const G=sa(k),fe="["+mu("inert")+"]",j=Wr(s).querySelectorAll(fe);let R=Lt(G)?G:null;for(;R&&!Na(R);){const X=Ro(R);if(Na(X)||!Lt(X))break;R=X}if(j.length&&Lt(G)&&!o3(G)&&!Hn(G,s)&&Array.from(j).every(X=>!Hn(R,X)))return;if(On(G)&&s){const X=G.clientWidth>0&&G.scrollWidth>G.clientWidth,ae=G.clientHeight>0&&G.scrollHeight>G.clientHeight;let de=ae&&k.offsetX>G.clientWidth;if(ae&&tr(G).direction==="rtl"&&(de=k.offsetX<=G.offsetWidth-G.clientWidth),de||X&&k.offsetY>G.clientHeight)return}const te=m&&Vs(m.nodesRef.current,i).some(X=>{var ae;return pd(k,(ae=X.context)==null?void 0:ae.elements.floating)});if(pd(k,s)||pd(k,a)||te)return;const oe=m?Vs(m.nodesRef.current,i):[];if(oe.length>0){let X=!0;if(oe.forEach(ae=>{var de;if((de=ae.context)!=null&&de.open&&!ae.context.dataRef.current.__outsidePressBubbles){X=!1;return}}),!X)return}r(!1,k,"outside-press")}),Y=ua(k=>{var ie;const B=()=>{var G;U(k),(G=sa(k))==null||G.removeEventListener(d,B)};(ie=sa(k))==null||ie.addEventListener(d,B)});return J.useEffect(()=>{if(!n||!l)return;u.current.__escapeKeyBubbles=A,u.current.__outsidePressBubbles=N;function k(G){r(!1,G,"ancestor-scroll")}const ie=Wr(s);c&&ie.addEventListener("keydown",I?L:_,I),x&&ie.addEventListener(d,P?Y:U,P);let B=[];return v&&(Lt(a)&&(B=ki(a)),Lt(s)&&(B=B.concat(ki(s))),!Lt(o)&&o&&o.contextElement&&(B=B.concat(ki(o.contextElement)))),B=B.filter(G=>{var fe;return G!==((fe=ie.defaultView)==null?void 0:fe.visualViewport)}),B.forEach(G=>{G.addEventListener("scroll",k,{passive:!0})}),()=>{c&&ie.removeEventListener("keydown",I?L:_,I),x&&ie.removeEventListener(d,P?Y:U,P),B.forEach(G=>{G.removeEventListener("scroll",k)})}},[u,s,a,o,c,x,d,n,r,v,l,A,N,_,I,L,U,P,Y]),J.useEffect(()=>{T.current=!1},[x,d]),J.useMemo(()=>l?{reference:{onKeyDown:_,[EB[p]]:k=>{h&&r(!1,k.nativeEvent,"reference-press")}},floating:{onKeyDown:_,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[IB[d]]:()=>{T.current=!0}}}:{},[l,h,d,p,r,_])}let sh;process.env.NODE_ENV!=="production"&&(sh=new Set);function O1(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 N="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&&!Lt(e.elements.reference)){var a;if(!((a=sh)!=null&&a.has(N))){var s;(s=sh)==null||s.add(N),console.error(N)}}}const[u,l]=J.useState(null),c=((t=e.elements)==null?void 0:t.reference)||u,f=V3(e),d=hm(),h=vB()!=null,p=ua((N,I,P)=>{N&&(g.current.openEvent=I),C.emit("openchange",{open:N,event:I,reason:P,nested:h}),r==null||r(N,I,P)}),v=J.useRef(null),g=J.useRef({}),C=J.useState(()=>dB())[0],m=Mf(),b=J.useCallback(N=>{const I=Lt(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),contextElement:N}:N;f.refs.setReference(I)},[f.refs]),x=J.useCallback(N=>{(Lt(N)||N===null)&&(v.current=N,l(N)),(Lt(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!Lt(N))&&f.refs.setReference(N)},[f.refs]),T=J.useMemo(()=>({...f.refs,setReference:x,setPositionReference:b,domReference:v}),[f.refs,x,b]),E=J.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),A=J.useMemo(()=>({...f,refs:T,elements:E,dataRef:g,nodeId:i,floatingId:m,events:C,open:n,onOpenChange:p}),[f,i,m,C,n,p,T,E]);return sr(()=>{const N=d==null?void 0:d.nodesRef.current.find(I=>I.id===i);N&&(N.context=A)}),J.useMemo(()=>({...f,context:A,refs:T,elements:E}),[f,T,E,A])}const xb="active",Tb="selected";function Sd(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[xb]:a,[Tb]: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[l,c]=u;if(!(i&&[xb,Tb].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof c=="function"){var f;(f=r.get(l))==null||f.push(c),a[l]=function(){for(var d,h=arguments.length,p=new Array(h),v=0;v<h;v++)p[v]=arguments[v];return(d=r.get(l))==null?void 0:d.map(g=>g(...p)).find(g=>g!==void 0)}}}else a[l]=c}),a),{})}}function D1(e){e===void 0&&(e=[]);const t=e,n=J.useCallback(o=>Sd(o,e,"reference"),t),r=J.useCallback(o=>Sd(o,e,"floating"),t),i=J.useCallback(o=>Sd(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 AB(e={}){const{initialOpen:t=!1,open:n,onOpenChange:r}=e,[i,o]=J.useState(t),a=n??i,s=r??o,u=O1({open:a,onOpenChange:s}),l=u.context,c=A1(l,{enabled:n==null}),f=$1(l,{outsidePressEvent:"mousedown"}),d=D1([c,f]);return J.useMemo(()=>({open:a,setOpen:s,...d,...u}),[a,s,d,u])}const N1=J.createContext(null),P1=()=>{const e=J.useContext(N1);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function $B({children:e,...t}){const n=AB(t);return $.jsx(N1.Provider,{value:n,children:e})}const R1=qv`
|
|
1157
1157
|
display: flex;
|
|
1158
1158
|
justify-content: center;
|
|
1159
1159
|
align-items: center;
|
|
1160
1160
|
z-index: 100;
|
|
1161
1161
|
padding: var(--space-md-fixed);
|
|
1162
|
-
`,
|
|
1163
|
-
${
|
|
1164
|
-
`,
|
|
1162
|
+
`,OB=Ae(I1)`
|
|
1163
|
+
${R1};
|
|
1164
|
+
`,DB=O.forwardRef((e,t)=>{const{style:n,children:r,components:i,...o}=e,a=P1(),s=pm([a.refs.setFloating,t]),u=(i==null?void 0:i.Overlay)??OB;return $.jsx(x1,{children:$.jsx(u,{lockScroll:!0,children:$.jsx(E1,{context:a.context,children:$.jsx("div",{ref:s,...a.getFloatingProps(o),children:r})})})})}),NB=DB;function k1(e){const t=O.useContext(hu),[n,r]=O.useState(t);return $.jsx(hu.Provider,{value:n,children:e.children})}const PB=O.forwardRef((e,t)=>{const{setOpen:n}=P1();return $.jsx("button",{type:"button",...e,ref:t,onClick:r=>{var i;(i=e.onClick)==null||i.call(e,r),n(!1)}})}),RB=PB,kB=Ae.span`
|
|
1165
1165
|
color: var(--color-explain-header-value-color);
|
|
1166
1166
|
overflow: hidden;
|
|
1167
1167
|
white-space: nowrap;
|
|
1168
1168
|
text-overflow: ellipsis;
|
|
1169
|
-
`;function
|
|
1169
|
+
`;function M1(e){const{explainQuestion:t}=Xi(),{configurationSubjectTitle:n,componentDecisionStateIncludedLabel:r,componentDecisionStateExcludedLabel:i,booleanDecisionStateFalseLabel:o,booleanDecisionStateTrueLabel:a,isBlockedSuffix:s,isNotSatisfiedSuffix:u,generalConflictTitle:l}=im();if(!t)return $.jsx("div",{...e,children:l});const c=H(t).returnType().with({subject:Ue.configuration},()=>n).with({subject:Ue.attribute},d=>om(d.attributeId)??d.attributeId.localId).with({subject:Ue.choiceValue},d=>Pf(d.attributeId)[d.choiceValueId]??d.choiceValueId).with({subject:Ue.component,state:Ge.Included},()=>r).with({subject:Ue.component,state:Ge.Excluded},()=>i).with({subject:Ue.boolean,state:!0},()=>a).with({subject:Ue.boolean,state:!1},()=>o).with({subject:Ue.numeric},d=>d.state.toString()).exhaustive(),f=H(t).returnType().with({question:Ft.whyIsStateNotPossible},()=>s).with({question:Ft.whyIsNotSatisfied},()=>u).exhaustive();return $.jsxs("div",{...e,children:[$.jsx(kB,{children:c})," ",f]})}const MB=Ae.div`
|
|
1170
1170
|
position: sticky;
|
|
1171
1171
|
top: 0;
|
|
1172
1172
|
transition: all 0.1s;
|
|
@@ -1180,7 +1180,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1180
1180
|
@media only screen and (min-resolution: 2dppx) {
|
|
1181
1181
|
border-top-width: 0.5px;
|
|
1182
1182
|
}
|
|
1183
|
-
`;function
|
|
1183
|
+
`;function jB(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(MB,{...Fx(e,{className:DV(t&&"active")})})]})}const _B=Ae(D.motion.div)`
|
|
1184
1184
|
position: relative;
|
|
1185
1185
|
background-color: var(--color-explain-dialog-fill);
|
|
1186
1186
|
backdrop-filter: var(--backdrop-filter-explain-dialog);
|
|
@@ -1199,16 +1199,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1199
1199
|
max-height: min(calc(100vh - var(--space-md) * 2), 700px);
|
|
1200
1200
|
max-width: min(calc(100vw - var(--space-md) * 2), 700px);
|
|
1201
1201
|
min-width: min(calc(100vw - var(--space-md) * 2), 500px);
|
|
1202
|
-
`,
|
|
1202
|
+
`,qB=Ae.div`
|
|
1203
1203
|
overflow-y: auto;
|
|
1204
1204
|
grid-area: content;
|
|
1205
1205
|
padding-left: var(--space-xs-fixed);
|
|
1206
1206
|
padding-right: var(--space-xs-fixed);
|
|
1207
1207
|
padding-bottom: var(--space-xs-fixed);
|
|
1208
|
-
`,
|
|
1208
|
+
`,FB=Ae(jB)`
|
|
1209
1209
|
margin-left: calc(var(--space-xs-fixed) * -1);
|
|
1210
1210
|
margin-right: calc(var(--space-xs-fixed) * -1);
|
|
1211
|
-
`,
|
|
1211
|
+
`,LB=Ae(RB)`
|
|
1212
1212
|
position: absolute;
|
|
1213
1213
|
right: var(--space-sm-fixed);
|
|
1214
1214
|
top: var(--space-sm-fixed);
|
|
@@ -1223,7 +1223,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1223
1223
|
outline: 2px solid var(--color-explain-dialog-close-button-outline);
|
|
1224
1224
|
outline-offset: 1px;
|
|
1225
1225
|
}
|
|
1226
|
-
`,
|
|
1226
|
+
`,VB=Ae(M1)`
|
|
1227
1227
|
grid-area: header;
|
|
1228
1228
|
font-size: var(--text-md);
|
|
1229
1229
|
font-weight: 500;
|
|
@@ -1235,7 +1235,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1235
1235
|
text-overflow: ellipsis;
|
|
1236
1236
|
margin-right: var(--space-md);
|
|
1237
1237
|
margin-left: calc(var(--space-xs-fixed) + var(--space-sm-fixed));
|
|
1238
|
-
`,
|
|
1238
|
+
`,BB={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 UB(e){return $.jsxs(_B,{variants:BB,initial:"initial",animate:"open",exit:"close",children:[$.jsx(VB,{}),$.jsxs(qB,{children:[$.jsx(FB,{}),e.children]}),$.jsx(LB,{children:$.jsx(Gi,{icon:ox})})]})}const GB=Ae(NB)`
|
|
1239
1239
|
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
1240
1240
|
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
1241
1241
|
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
@@ -1257,9 +1257,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1257
1257
|
&:focus {
|
|
1258
1258
|
outline: none;
|
|
1259
1259
|
}
|
|
1260
|
-
`;function
|
|
1261
|
-
${
|
|
1262
|
-
`;function zB(e){return $.jsx(GB,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}function WB(e){const[t,n]=O.useState(null),{explain:r,applySolution:i}=P0(),o=O.useRef(null),a=O.useCallback(async(h,p,v,g)=>{const C=hv();o.current=C,n(null);try{const m=await h(),b=m,x=m,T=(b==null?void 0:b.decisionExplanations)??[],E=(x==null?void 0:x.constraintExplanations)??[];C==o.current&&n({controlId:g,displayMode:T.length===0&&E.length>0?"dialog":v,explainQuestion:p,hasError:!1,decisionExplanations:HB(T),constraintExplanations:E})}catch{C==o.current&&n({controlId:g,displayMode:v,explainQuestion:p,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=O.useCallback((h,p,v)=>{const g=typeof h=="function"?h(Iw):h;return a(()=>e.explainConstraints?r(g,"full"):r(g,"decisions"),g,p,v)},[e.explainConstraints,r,a]),u=O.useCallback((h,p,v)=>a(()=>Promise.resolve(h),null,p,v),[a]),l=O.useCallback(()=>{n(null)},[]),c=O.useCallback(async h=>{await i(h),l()},[i,l]),f=O.useCallback(h=>{n(p=>p!=null?{...p,displayMode:h}:p)},[]),d=O.useMemo(()=>({process:t,applySolution:c,explain:s,handleExplainAnswer:u,dismiss:l,switchMode:f}),[t,c,s,u,l,f]);return $.jsx(hu.Provider,{value:d,children:e.children})}function HB(e){const t=y(vw,Qr(r=>r.solution==null)),n=y(of,Qr(r=>r.causedByDecisions.length));return y(e,HN([t,n]))}const ka=new Map;function $c(e){const{singletonId:t,children:n}=e,[r,i]=O.useState(!1),o=O.useRef({chose:()=>i(!0)});return O.useEffect(()=>(KB(t,o.current),()=>YB(t,o.current)),[]),r?$.jsx($.Fragment,{children:n}):null}function KB(e,t){XB(e).candidates.add(t),R1(e)}function YB(e,t){let n=ka.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),JB(e),R1(e))}function R1(e){let t=ka.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function JB(e){let t=ka.get(e);t==null||t.candidates.size>0||ka.delete(e)}function XB(e){let t=ka.get(e);return t==null&&(t={chosen:null,candidates:new Set},ka.set(e,t)),t}const xr={attributeId:{title:"Attribute Id",type:D.ControlType.String},componentPath:{title:"Component Path",type:D.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:D.ControlType.String}},Tb={description:{title:"Description",type:D.ControlType.String},regex:{title:"Regex",type:D.ControlType.String},direction:{title:"Direction",type:D.ControlType.Enum,defaultValue:"asc",options:["asc","desc"],displaySegmentedControl:!0},mode:{title:"Mode",type:D.ControlType.Enum,defaultValue:"isMatch",options:["isMatch","string","numeric"]}},QB={choiceValueSorting:{title:"Choice Value Sorting",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{defaultRules:{title:"Default Rules",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:Tb}},attributes:{title:"Attribute",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...xr,choiceValues:{title:"Choice Values",type:D.ControlType.Array,control:{type:D.ControlType.String}},rules:{title:"Rules",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:Tb}}}}},jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}}};function ZB(e,t){const n=[],r=(o,a)=>{const s=n.find(l=>e.equals(l.first,o)&&e.equals(l.second,a));if(s)return s.ordering;const u=t.compare(o,a);return n.push({first:o,second:a,ordering:u}),u},i=za(r);return{cachedOrderings:n,...i}}function eU(){const e=[];return{getCache:(t,n)=>{const r=e.find(o=>o.eq===t&&o.ord===n);if(r)return r.ordCache;const i=ZB(t,n);return e.push({eq:t,ord:n,ordCache:i}),i}}}const k1=tv(),tU=new Intl.Collator("en",{sensitivity:"base"}),nU=new Intl.Collator("en",{sensitivity:"variant"}),rU={regex:".*",direction:"asc",mode:"string"},iU=y([tU,nU],z(dU),cv(tv())),oU=y(vw,Qr(e=>Ii(e))),aU=of;function sU(e,t){return y((t==null?void 0:t.attributes)??[],Pt(n=>Nu(gn(n),e)),K(n=>[uU(n.choiceValues??[]),Eb(n.rules??[])]),Qe(()=>[Eb((t==null?void 0:t.defaultRules)??[])]),JC(M1(rU)),cv(k1))}function uU(e){return y(of,Xs,ow,Xs,Qr(t=>y(e,XC(n=>ot.equals(t,n)))))}function Eb(e){return y(e,z(M1),cv(k1))}function M1(e){const t=hP(()=>new RegExp(e.regex)),n=H(e.mode).returnType().with("string",()=>lU(e.direction)).with("numeric",()=>cU(e.direction)).with("isMatch",()=>fU(e.direction)).exhaustive();return y(n,Qr(r=>y(t,vP(i=>(i.lastIndex=0,i[Symbol.match](r))),Fn(i=>y(i,ep(1),rp(()=>y(i,ep(0))))))))}function lU(e){return y(iU,gm(e),j1)}function cU(e){return y(aU,gm(e),j1,Qr(Fn(iR)))}function fU(e){return y(oU,gm(e))}function j1(e){return y(e,Xs,ow,Xs)}function gm(e){return t=>H(e).returnType().with("asc",()=>t).with("desc",()=>Xs(t)).exhaustive()}function dU(e){return za((t,n)=>H(e.compare(t,n)).returnType().with(qe.number.gt(0),()=>1).with(qe.number.lt(0),()=>-1).otherwise(()=>0))}const pU=eU(),_1=O.createContext(null);function Oc(e,t,n){const r=O.useContext(_1),i=O.useMemo(()=>y(sU(e,r),a=>pU.getCache(ot,a),Qr(a=>y(t,pw(a.id),Zr(()=>a.id,s=>s)))),[t]),{attribute:o}=rs(e);return y(n??(o==null?void 0:o.values)??[],af(i))}const hU={localization:{title:"Localization",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}}},q1=ui(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:r,sessionCreateUrl:i,sessionDeleteUrl:o,deploymentName:a,channel:s,children:u,explainDialogProps:l,explainPopoverProps:c,explainConstraints:f}=e,{activeLocale:d}=D.useLocaleInfo(),h=d.code;if(O.useEffect(()=>{console.info("Current locale code:",h)},[h]),Yt())return $.jsxs($.Fragment,{children:[u,$.jsx($c,{singletonId:"Configuration",children:$.jsx(Xg,{})})]});const p=O.useMemo(()=>mM({hcaEngineBaseUrl:y5(t,"api","engine"),sessionHandler:H(n).with("client-side",()=>({accessToken:r})).with("server-side",()=>({sessionCreateUrl:i,sessionDeleteUrl:o})).exhaustive()}),[t,n,r,i,o]),v=O.useMemo(()=>{var m;return y(ye((m=e.attributeRelations)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),Mn)},[e.attributeRelations]),g=O.useMemo(()=>{var m;return y(ye((m=e.choiceValueSorting)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),aw(()=>ye(e.choiceValueSorting)),Qe(()=>({attributes:[],defaultRules:[]})))},[e.choiceValueSorting]),C=O.useMemo(()=>{var m;return y(ye((m=e.localization)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),Qe(()=>({attributes:[],choiceValues:[]})))},[e.localization]);return $.jsxs($.Fragment,{children:[$.jsxs(hq,{configuratorClient:p,configurationModelSource:{type:Li.Channel,channel:s,deploymentName:a},attributeRelations:v,allowedInExplain:{rules:{type:hn.all}},children:[$.jsx(g5,{...e}),$.jsx(O.Suspense,{children:$.jsx(vq,{children:$.jsx(Nf.Provider,{value:C,children:$.jsxs(WB,{explainConstraints:f,children:[$.jsx(nm.Provider,{value:c,children:$.jsx(_1.Provider,{value:g,children:u})}),$.jsx(BB,{...l})]})})})})]}),$.jsx($c,{singletonId:"Configuration",children:$.jsx(Xg,{})})]})}),vU=q1;D.addPropertyControls(q1,{children:{title:"Content",type:D.ControlType.ComponentInstance},channel:{type:D.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:D.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:D.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:D.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:D.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:D.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:D.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:D.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:D.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:D.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:D.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:D.ControlType.Object,optional:!1,controls:$5,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:D.ControlType.Object,optional:!1,controls:A5,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:D.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}},...QB,...hU});const F1={padding:{type:D.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}},mU=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}),yU={radius:{title:"Radius",type:D.ControlType.Number,defaultValue:6},...F1,border:{title:"Border",type:D.ControlType.Object,controls:{color:{type:D.ControlType.Color,title:"Color"},width:{type:D.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}}}},gU=e=>{var t,n,r,i,o,a,s,u,l,c,f,d,h;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?(l=e.border)==null?void 0:l.widthBottom:(c=e.border)==null?void 0:c.width,borderLeftWidth:(f=e.border)!=null&&f.isMixedWidth?(d=e.border)==null?void 0:d.widthLeft:(h=e.border)==null?void 0:h.width}},bU={fill:{title:"Fill",type:D.ControlType.Color,defaultValue:"#EBEBEB"},...F1,...yU},SU=e=>({...mU(e),...gU(e),backgroundColor:e.fill}),CU={color:{title:"Color",type:D.ControlType.Color,defaultValue:"black"},fontSize:{title:"Font size",type:D.ControlType.Number,defaultValue:16}},wU=e=>({color:e.color,fontSize:e.fontSize}),us={explain:{title:"Explain",type:D.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},uh={type:D.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:D.ControlType.Color,optional:!0},color:{title:"Color",type:D.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:D.ControlType.Color,optional:!0}}},L1={...xr,...CU,...bU,implicitLabelPrefix:{title:"Implicit Label Prefix",type:D.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...uh,title:"Unsatisfied Colors"},implicitSelectedColors:{...uh,title:"Implicit Selected Colors"},...us},lh=(e,t,n)=>{var r,i,o,a,s,u;const l=SU(e),c=wU(e);return{...l,...c,backgroundColor:H({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:qe.string.minLength(1)},f=>f.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:qe.string.minLength(1)},f=>f.implicitSelectedFill).otherwise(()=>l.backgroundColor),borderColor:H({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:qe.string.minLength(1)},f=>f.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:qe.string.minLength(1)},f=>f.implicitSelectedBorderColor).otherwise(()=>l.borderColor),color:H({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:qe.string.minLength(1)},f=>f.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:qe.string.minLength(1)},f=>f.implicitSelectedColor).otherwise(()=>c.color),...e.style}},bm={...L1,resetLabel:{title:"Reset Label",type:D.ControlType.String,defaultValue:"Reset"},blockedLabel:{title:"Blocked Label",type:D.ControlType.String,defaultValue:"Blocked"},appearance:{title:"Appearance",type:D.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]},textAlign:{title:"Text Align",type:D.ControlType.Enum,defaultValue:"initial",options:["initial","start","center","end"]}},Ma=(e,t,n)=>({...lh(e,t,n),appearance:e.appearance,textAlign:e.textAlign});function ci(){const{explain:e,handleExplainAnswer:t}=O.useContext(hu);return{explain:e,handleExplainAnswer:t}}function xU(e={}){const{initialOpen:t=!1,placement:n="top",modal:r=!1,open:i,onOpenChange:o,arrow:a}=e,[s,u]=O.useState(t),l=i??s,c=o??u,f=I1({placement:n,open:l,onOpenChange:c,whileElementsMounted:R3,middleware:[m3(((a==null?void 0:a.height)??0)+5),M3({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),k3({padding:5}),...a?[_3(a)]:[]]}),d=f.context,h=T1(d,{enabled:i==null}),p=E1(d),v=A1([h,p]);return O.useMemo(()=>({open:l,setOpen:c,...v,...f,modal:r,arrow:a}),[l,c,v,f,r,a])}const V1=O.createContext(null),Uu=()=>{const e=O.useContext(V1);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function TU({children:e,...t}){const n=xU(t);return $.jsx(V1.Provider,{value:n,children:e})}const EU=O.forwardRef(function(e,t){const n=O.Children.toArray(e.children)[0],r=Uu(),i=e.children.ref,o=hm([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"})}),IU=EU,AU=Ae.div`
|
|
1260
|
+
`;function zB(e){const t=Xi(),n=(t==null?void 0:t.displayMode)==="dialog";return $.jsx($B,{open:n,onOpenChange:r=>!r&&n&&(t==null?void 0:t.dismiss()),children:$.jsx(WB,{...e,isOpen:n,children:O.Children.toArray(e.content)[0]??$.jsx(UB,{children:$.jsx(Q5,{})})})})}function WB(e){return $.jsx(D.AnimatePresence,{initial:!1,children:e.isOpen&&$.jsx(rm.Provider,{value:e,children:$.jsx(GB,{...e,components:{Overlay:KB},children:$.jsx(k1,{children:e.children})})})})}const HB=Ae(D.motion(I1))`
|
|
1261
|
+
${R1}
|
|
1262
|
+
`;function KB(e){return $.jsx(HB,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}function YB(e){const[t,n]=O.useState(null),{explain:r,applySolution:i}=k0(),o=O.useRef(null),a=O.useCallback(async(h,p,v,g)=>{const C=pv();o.current=C,n(null);try{const m=await h(),b=m,x=m,T=(b==null?void 0:b.decisionExplanations)??[],E=(x==null?void 0:x.constraintExplanations)??[];C==o.current&&n({controlId:g,displayMode:T.length===0&&E.length>0?"dialog":v,explainQuestion:p,hasError:!1,decisionExplanations:JB(T),constraintExplanations:E})}catch{C==o.current&&n({controlId:g,displayMode:v,explainQuestion:p,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=O.useCallback((h,p,v)=>{const g=typeof h=="function"?h($w):h;return a(()=>e.explainConstraints?r(g,"full"):r(g,"decisions"),g,p,v)},[e.explainConstraints,r,a]),u=O.useCallback((h,p,v)=>a(()=>Promise.resolve(h),null,p,v),[a]),l=O.useCallback(()=>{n(null)},[]),c=O.useCallback(async h=>{await i(h),l()},[i,l]),f=O.useCallback(h=>{n(p=>p!=null?{...p,displayMode:h}:p)},[]),d=O.useMemo(()=>({process:t,applySolution:c,explain:s,handleExplainAnswer:u,dismiss:l,switchMode:f}),[t,c,s,u,l,f]);return $.jsx(hu.Provider,{value:d,children:e.children})}function JB(e){const t=y(yw,Zr(r=>r.solution==null)),n=y(of,Zr(r=>r.causedByDecisions.length));return y(e,X2([t,n]))}const ka=new Map;function $c(e){const{singletonId:t,children:n}=e,[r,i]=O.useState(!1),o=O.useRef({chose:()=>i(!0)});return O.useEffect(()=>(XB(t,o.current),()=>QB(t,o.current)),[]),r?$.jsx($.Fragment,{children:n}):null}function XB(e,t){eU(e).candidates.add(t),j1(e)}function QB(e,t){let n=ka.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),ZB(e),j1(e))}function j1(e){let t=ka.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function ZB(e){let t=ka.get(e);t==null||t.candidates.size>0||ka.delete(e)}function eU(e){let t=ka.get(e);return t==null&&(t={chosen:null,candidates:new Set},ka.set(e,t)),t}const fr={attributeId:{title:"Attribute Id",type:D.ControlType.String},componentPath:{title:"Component Path",type:D.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:D.ControlType.String}},Eb={description:{title:"Description",type:D.ControlType.String},regex:{title:"Regex",type:D.ControlType.String},direction:{title:"Direction",type:D.ControlType.Enum,defaultValue:"asc",options:["asc","desc"],displaySegmentedControl:!0},mode:{title:"Mode",type:D.ControlType.Enum,defaultValue:"isMatch",options:["isMatch","string","numeric"]}},tU={choiceValueSorting:{title:"Choice Value Sorting",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{defaultRules:{title:"Default Rules",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:Eb}},attributes:{title:"Attribute",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...fr,choiceValues:{title:"Choice Values",type:D.ControlType.Array,control:{type:D.ControlType.String}},rules:{title:"Rules",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:Eb}}}}},jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}}};function nU(e,t){const n=[],r=(o,a)=>{const s=n.find(l=>e.equals(l.first,o)&&e.equals(l.second,a));if(s)return s.ordering;const u=t.compare(o,a);return n.push({first:o,second:a,ordering:u}),u},i=za(r);return{cachedOrderings:n,...i}}function rU(){const e=[];return{getCache:(t,n)=>{const r=e.find(o=>o.eq===t&&o.ord===n);if(r)return r.ordCache;const i=nU(t,n);return e.push({eq:t,ord:n,ordCache:i}),i}}}const _1=ev(),iU=new Intl.Collator("en",{sensitivity:"base"}),oU=new Intl.Collator("en",{sensitivity:"variant"}),aU={regex:".*",direction:"asc",mode:"string"},sU=y([iU,oU],z(vU),lv(ev())),uU=y(yw,Zr(e=>Ii(e))),lU=of;function cU(e,t){return y((t==null?void 0:t.attributes)??[],Pt(n=>Nu(un(n),e)),K(n=>[fU(n.choiceValues??[]),Ib(n.rules??[])]),Qe(()=>[Ib((t==null?void 0:t.defaultRules)??[])]),QC(q1(aU)),lv(_1))}function fU(e){return y(of,Xs,sw,Xs,Zr(t=>y(e,ZC(n=>ot.equals(t,n)))))}function Ib(e){return y(e,z(q1),lv(_1))}function q1(e){const t=gP(()=>new RegExp(e.regex)),n=H(e.mode).returnType().with("string",()=>dU(e.direction)).with("numeric",()=>pU(e.direction)).with("isMatch",()=>hU(e.direction)).exhaustive();return y(n,Zr(r=>y(t,bP(i=>(i.lastIndex=0,i[Symbol.match](r))),Fn(i=>y(i,ep(1),rp(()=>y(i,ep(0))))))))}function dU(e){return y(sU,ym(e),F1)}function pU(e){return y(lU,ym(e),F1,Zr(Fn(uR)))}function hU(e){return y(uU,ym(e))}function F1(e){return y(e,Xs,sw,Xs)}function ym(e){return t=>H(e).returnType().with("asc",()=>t).with("desc",()=>Xs(t)).exhaustive()}function vU(e){return za((t,n)=>H(e.compare(t,n)).returnType().with(qe.number.gt(0),()=>1).with(qe.number.lt(0),()=>-1).otherwise(()=>0))}const mU=rU(),L1=O.createContext(null);function Oc(e,t,n){const r=O.useContext(L1),i=O.useMemo(()=>y(cU(e,r),a=>mU.getCache(ot,a),Zr(a=>y(t,vw(a.id),ei(()=>a.id,s=>s)))),[t]),{attribute:o}=rs(e);return y(n??(o==null?void 0:o.values)??[],af(i))}const yU={localization:{title:"Localization",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}}},V1=Er(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:r,sessionCreateUrl:i,sessionDeleteUrl:o,deploymentName:a,channel:s,children:u,explainDialogProps:l,explainPopoverProps:c,explainConstraints:f}=e,{activeLocale:d}=D.useLocaleInfo(),h=d.code;if(O.useEffect(()=>{console.info("Current locale code:",h)},[h]),Gt())return $.jsxs($.Fragment,{children:[u,$.jsx($c,{singletonId:"Configuration",children:$.jsx(Qg,{})})]});const p=O.useMemo(()=>SM({hcaEngineBaseUrl:S5(t,"api","engine"),sessionHandler:H(n).with("client-side",()=>({accessToken:r})).with("server-side",()=>({sessionCreateUrl:i,sessionDeleteUrl:o})).exhaustive()}),[t,n,r,i,o]),v=O.useMemo(()=>{var m;return y(ye((m=e.attributeRelations)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),Mn)},[e.attributeRelations]),g=O.useMemo(()=>{var m;return y(ye((m=e.choiceValueSorting)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),uw(()=>ye(e.choiceValueSorting)),Qe(()=>({attributes:[],defaultRules:[]})))},[e.choiceValueSorting]),C=O.useMemo(()=>{var m;return y(ye((m=e.localization)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),Qe(()=>({attributes:[],choiceValues:[]})))},[e.localization]);return $.jsxs($.Fragment,{children:[$.jsxs(yq,{configuratorClient:p,configurationModelSource:{type:Li.Channel,channel:s,deploymentName:a},attributeRelations:v,allowedInExplain:{rules:{type:vn.all}},children:[$.jsx(C5,{...e}),$.jsx(O.Suspense,{children:$.jsx(gq,{children:$.jsx(Nf.Provider,{value:C,children:$.jsxs(YB,{explainConstraints:f,children:[$.jsx(tm.Provider,{value:c,children:$.jsx(L1.Provider,{value:g,children:u})}),$.jsx(zB,{...l})]})})})})]}),$.jsx($c,{singletonId:"Configuration",children:$.jsx(Qg,{})})]})}),gU=V1;D.addPropertyControls(V1,{children:{title:"Content",type:D.ControlType.ComponentInstance},channel:{type:D.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:D.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:D.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:D.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:D.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:D.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:D.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:D.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:D.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:D.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:D.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:D.ControlType.Object,optional:!1,controls:N5,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:D.ControlType.Object,optional:!1,controls:D5,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:D.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}},...tU,...yU});const B1={padding:{type:D.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}},bU=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}),SU={radius:{title:"Radius",type:D.ControlType.Number,defaultValue:6},...B1,border:{title:"Border",type:D.ControlType.Object,controls:{color:{type:D.ControlType.Color,title:"Color"},width:{type:D.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}}}},CU=e=>{var t,n,r,i,o,a,s,u,l,c,f,d,h;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?(l=e.border)==null?void 0:l.widthBottom:(c=e.border)==null?void 0:c.width,borderLeftWidth:(f=e.border)!=null&&f.isMixedWidth?(d=e.border)==null?void 0:d.widthLeft:(h=e.border)==null?void 0:h.width}},wU={fill:{title:"Fill",type:D.ControlType.Color,defaultValue:"#EBEBEB"},...B1,...SU},xU=e=>({...bU(e),...CU(e),backgroundColor:e.fill}),TU={color:{title:"Color",type:D.ControlType.Color,defaultValue:"black"},fontSize:{title:"Font size",type:D.ControlType.Number,defaultValue:16}},EU=e=>({color:e.color,fontSize:e.fontSize}),us={explain:{title:"Explain",type:D.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},uh={type:D.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:D.ControlType.Color,optional:!0},color:{title:"Color",type:D.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:D.ControlType.Color,optional:!0}}},U1={...fr,...TU,...wU,implicitLabelPrefix:{title:"Implicit Label Prefix",type:D.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...uh,title:"Unsatisfied Colors"},implicitSelectedColors:{...uh,title:"Implicit Selected Colors"},...us},lh=(e,t,n)=>{var r,i,o,a,s,u;const l=xU(e),c=EU(e);return{...l,...c,backgroundColor:H({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:qe.string.minLength(1)},f=>f.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:qe.string.minLength(1)},f=>f.implicitSelectedFill).otherwise(()=>l.backgroundColor),borderColor:H({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:qe.string.minLength(1)},f=>f.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:qe.string.minLength(1)},f=>f.implicitSelectedBorderColor).otherwise(()=>l.borderColor),color:H({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:qe.string.minLength(1)},f=>f.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:qe.string.minLength(1)},f=>f.implicitSelectedColor).otherwise(()=>c.color),...e.style}},gm={...U1,resetLabel:{title:"Reset Label",type:D.ControlType.String,defaultValue:"Reset"},blockedLabel:{title:"Blocked Label",type:D.ControlType.String,defaultValue:"Blocked"},appearance:{title:"Appearance",type:D.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]},textAlign:{title:"Text Align",type:D.ControlType.Enum,defaultValue:"initial",options:["initial","start","center","end"]}},Ma=(e,t,n)=>({...lh(e,t,n),appearance:e.appearance,textAlign:e.textAlign});function ci(){const{explain:e,handleExplainAnswer:t}=O.useContext(hu);return{explain:e,handleExplainAnswer:t}}function IU(e={}){const{initialOpen:t=!1,placement:n="top",modal:r=!1,open:i,onOpenChange:o,arrow:a}=e,[s,u]=O.useState(t),l=i??s,c=o??u,f=O1({placement:n,open:l,onOpenChange:c,whileElementsMounted:j3,middleware:[b3(((a==null?void 0:a.height)??0)+5),q3({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),_3({padding:5}),...a?[L3(a)]:[]]}),d=f.context,h=A1(d,{enabled:i==null}),p=$1(d),v=D1([h,p]);return O.useMemo(()=>({open:l,setOpen:c,...v,...f,modal:r,arrow:a}),[l,c,v,f,r,a])}const G1=O.createContext(null),Uu=()=>{const e=O.useContext(G1);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function AU({children:e,...t}){const n=IU(t);return $.jsx(G1.Provider,{value:n,children:e})}const $U=O.forwardRef(function(e,t){const n=O.Children.toArray(e.children)[0],r=Uu(),i=e.children.ref,o=pm([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"})}),OU=$U,DU=Ae.div`
|
|
1263
1263
|
display: flex;
|
|
1264
1264
|
justify-content: center;
|
|
1265
1265
|
|
|
@@ -1268,7 +1268,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1268
1268
|
@container explain-actions (min-width: 300px) {
|
|
1269
1269
|
justify-content: start;
|
|
1270
1270
|
}
|
|
1271
|
-
|
|
1271
|
+
`,NU=Ae.button`
|
|
1272
1272
|
color: inherit;
|
|
1273
1273
|
font-size: 0.9em;
|
|
1274
1274
|
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
@@ -1285,11 +1285,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1285
1285
|
outline: 2px solid var(--color-explain-popover-show-more-button-outline);
|
|
1286
1286
|
outline-offset: 1px;
|
|
1287
1287
|
}
|
|
1288
|
-
`;function
|
|
1288
|
+
`;function PU(){const{decisionExplanations:e,switchMode:t}=Xi(),{showConstraintsButtonCaption:n,showMoreButtonCaption:r}=nm(),i=e.length-1,o=O.useMemo(()=>i>0&&cr.render(r,{amount:i}),[r,i]);return $.jsx(DU,{children:$.jsxs(NU,{onClick:()=>t("dialog"),children:[i>0&&$.jsx("span",{children:o}),i===0&&$.jsx("span",{children:n})]})})}const RU=Ae.div`
|
|
1289
1289
|
font-weight: 500;
|
|
1290
1290
|
font-family: var(--font-heading);
|
|
1291
1291
|
margin-bottom: var(--space-xs);
|
|
1292
|
-
`,
|
|
1292
|
+
`,Ab=Ae.div`
|
|
1293
1293
|
height: 1px;
|
|
1294
1294
|
background-color: var(--color-explain-popover-list-separator);
|
|
1295
1295
|
margin-left: -1.1em;
|
|
@@ -1298,9 +1298,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1298
1298
|
@media only screen and (min-resolution: 2dppx) {
|
|
1299
1299
|
height: 0.5px;
|
|
1300
1300
|
}
|
|
1301
|
-
`,
|
|
1301
|
+
`,kU=Ae.div`
|
|
1302
1302
|
container: explain-actions / inline-size;
|
|
1303
|
-
`,
|
|
1303
|
+
`,MU=Ae(Kx)`
|
|
1304
1304
|
display: grid;
|
|
1305
1305
|
grid-template-columns: [name] minmax(100px, auto) [values] minmax(100px, 1fr);
|
|
1306
1306
|
gap: var(--space-sm);
|
|
@@ -1310,7 +1310,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1310
1310
|
margin-right: -1.1em;
|
|
1311
1311
|
overflow: auto;
|
|
1312
1312
|
max-height: 200px;
|
|
1313
|
-
`,
|
|
1313
|
+
`,jU=Ae(Gx)`
|
|
1314
1314
|
border-radius: 360px;
|
|
1315
1315
|
background-color: var(--color-explain-popover-apply-solution-button-fill);
|
|
1316
1316
|
color: var(--color-explain-popover-apply-solution-button-color);
|
|
@@ -1333,10 +1333,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1333
1333
|
@container explain-actions (min-width: 300px) {
|
|
1334
1334
|
width: auto;
|
|
1335
1335
|
}
|
|
1336
|
-
`,Cd=Ae(
|
|
1336
|
+
`,Cd=Ae(Jx)`
|
|
1337
1337
|
width: min-content;
|
|
1338
1338
|
min-width: 300px;
|
|
1339
|
-
`;function
|
|
1339
|
+
`;function _U(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=Xi(),{solutionTitle:r,applySolutionButtonCaption:i}=nm();if(n)return $.jsx(Cd,{variant:"failedToExplain"});const o=e[0];if(!o)return $.jsx(Cd,{variant:"noExplanationFound"});if(!o.solution)return $.jsx(Cd,{variant:"noSolutionFound"});const a=o.solution.decisions.filter(s=>s.state!=null);return $.jsxs($.Fragment,{children:[$.jsx(RU,{children:r}),$.jsx(Ab,{}),$.jsx(MU,{blockingDecisions:o.causedByDecisions,desiredDecisions:a}),$.jsx(Ab,{}),$.jsxs(kU,{children:[$.jsx(jU,{explanation:o,children:i}),(e.length>1||t.length>0)&&$.jsx(PU,{})]})]})}const z1=O.createContext(null),Ir=()=>O.useContext(z1);function W1(e){return O.forwardRef((t,n)=>{const r=O.useId();return $.jsx(z1.Provider,{value:r,children:$.jsx(e,{...t,ref:n})})})}const qU=O.forwardRef((e,t)=>{const{style:n,children:r,...i}=e,o=Uu(),a=pm([o.refs.setFloating,t]);return $.jsx(x1,{children:$.jsx(E1,{context:o.context,modal:o.modal,children:$.jsx("div",{ref:a,style:{...o.floatingStyles,...n},...o.getFloatingProps(i),children:r})})})}),FU=qU,LU=O.forwardRef((e,t)=>{const{setOpen:n}=Uu();return $.jsx("button",{type:"button",ref:t,...e,onClick:r=>{var i;(i=e.onClick)==null||i.call(e,r),n(!1)}})}),VU=LU,BU=Ae.div`
|
|
1340
1340
|
position: relative;
|
|
1341
1341
|
background-color: var(--color-explain-popover-fill);
|
|
1342
1342
|
color: var(--color-explain-popover-color);
|
|
@@ -1347,7 +1347,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1347
1347
|
font-family: var(--font-primary);
|
|
1348
1348
|
min-width: 300px;
|
|
1349
1349
|
max-width: 500px;
|
|
1350
|
-
`,
|
|
1350
|
+
`,UU=Ae(VU)`
|
|
1351
1351
|
position: absolute;
|
|
1352
1352
|
right: var(--space-sm-fixed);
|
|
1353
1353
|
top: var(--space-sm-fixed);
|
|
@@ -1362,7 +1362,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1362
1362
|
outline: 2px solid var(--color-explain-popover-close-button-outline);
|
|
1363
1363
|
outline-offset: 1px;
|
|
1364
1364
|
}
|
|
1365
|
-
`,
|
|
1365
|
+
`,GU=Ae(M1)`
|
|
1366
1366
|
font-size: var(--text-md);
|
|
1367
1367
|
font-weight: 500;
|
|
1368
1368
|
font-family: var(--font-heading);
|
|
@@ -1372,7 +1372,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1372
1372
|
white-space: nowrap;
|
|
1373
1373
|
text-overflow: ellipsis;
|
|
1374
1374
|
margin-right: var(--space-md);
|
|
1375
|
-
`;function
|
|
1375
|
+
`;function zU(e){return $.jsxs(BU,{children:[$.jsx(GU,{}),e.children,$.jsx(UU,{children:$.jsx(Gi,{icon:ox})})]})}const WU=Ae(FU)`
|
|
1376
1376
|
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
1377
1377
|
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
1378
1378
|
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
@@ -1394,28 +1394,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1394
1394
|
&:focus {
|
|
1395
1395
|
outline: none;
|
|
1396
1396
|
}
|
|
1397
|
-
`,
|
|
1397
|
+
`,HU=Ae(fB)`
|
|
1398
1398
|
fill: var(--color-explain-popover-fill);
|
|
1399
|
-
`,
|
|
1400
|
-
Please check your internet connection and try again.`)}function
|
|
1401
|
-
Please check your internet connection and try again.`)}const
|
|
1399
|
+
`,KU={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 YU(e){const t=Xi(),n=Ir(),r=(t==null?void 0:t.displayMode)==="popover"&&(t==null?void 0:t.controlId)===n,i=O.useRef(null);return $.jsxs(AU,{open:r,onOpenChange:o=>!o&&r&&(t==null?void 0:t.dismiss()),arrow:{width:20,height:10,padding:10,element:i},children:[$.jsx(OU,{children:e.children}),$.jsxs(JU,{isOpen:r,children:[O.Children.toArray(e.content)[0]??$.jsx(zU,{children:$.jsx(_U,{})}),$.jsx(XU,{})]})]})}function JU(e){var t,n;const r=nm(),{middlewareData:i,arrow:o,placement:a}=Uu(),s=((t=i.arrow)==null?void 0:t.x)??0,u=((n=i.arrow)==null?void 0:n.y)??0,l=(o==null?void 0:o.height)??0,c=(o==null?void 0:o.width)??0,f=s+c/2,d=u+l,h=H(a).with("top",()=>`${f}px calc(100% + ${l+5}px)`).with("bottom",()=>`${f}px ${-l-5}px`).with("left",()=>`calc(100% + ${l}px) ${d}px`).with("right",()=>`${-l}px ${d}px`).otherwise(()=>"");return $.jsx(D.AnimatePresence,{initial:!1,children:e.isOpen&&$.jsx(WU,{...r,children:$.jsx(D.motion.div,{variants:KU,initial:"initial",animate:"open",exit:"close",style:{transformOrigin:h},children:$.jsx(k1,{children:e.children})})})})}function XU(){const{context:e,arrow:t}=Uu();return $.jsx(HU,{ref:t.element,context:e,width:t.width,height:t.height})}function QU(e){return O.forwardRef((t,n)=>{const r=Gt();return t.explain!=="popover"||r?$.jsx(e,{...t}):$.jsx(YU,{children:$.jsx(e,{...t,ref:n})})})}function fi(e){return Er(W1(QU(O.forwardRef(e))))}function Mr(){alert(`Failed to apply your selection.
|
|
1400
|
+
Please check your internet connection and try again.`)}function ZU(){alert(`Failed to reset your configuration.
|
|
1401
|
+
Please check your internet connection and try again.`)}const $b=Ae.select`
|
|
1402
1402
|
color: inherit;
|
|
1403
|
-
|
|
1403
|
+
`,Ob="<reset>",Db="<nothing>",H1=fi((e,t)=>{if(Gt()){const E=Ma(e,!0,!1);return $.jsx($b,{style:E})}const n=Ir(),r=un(e),i=rs(r);if(!i)return $.jsx("span",{children:"Choice Attribute not found"});const{explain:o}=ci(),a=Pf(r),{attribute:s,makeDecision:u,clearDecisions:l}=i,c=Oc(r,a,$n.getAllowedChoiceValues(s)),f=Oc(r,a,$n.getBlockedChoiceValues(s)),d=$n.isMultiSelect(s),h=$n.getSelectedChoiceValues(s),p=h.map(E=>E.id),v=p[0]??Db,g=h.some(E=>{var A;return((A=E.decision)==null?void 0:A.kind)===Se.Explicit}),C=p.length>=1,m=h.some(E=>{var A;return((A=E.decision)==null?void 0:A.kind)===Se.Implicit}),b=c.length===0,x=async E=>{if(E===Ob)try{await l()}catch{Mr()}else if(c.some(A=>A.id===E)){const A=p.some(N=>N===E)?void 0:Ye.Included;try{await u(E,A)}catch{Mr()}}else f.some(A=>A.id===E)&&e.explain!=="disabled"&&await o(A=>A.whyIsStateNotPossible.choice(s.id).choiceValue(E).state(Ye.Included),e.explain,n)},T=n4(e,s.isSatisfied,m,b);return $.jsxs($b,{ref:t,value:d?p:v,multiple:d,onChange:E=>x(E.currentTarget.value),style:T,children:[!C&&!d&&$.jsx("option",{value:Db}),g&&$.jsx("option",{value:Ob,children:e.resetLabel}),c.map(E=>{var A;return $.jsxs("option",{value:E.id,children:[((A=E.decision)==null?void 0:A.kind)===Se.Implicit?e.implicitLabelPrefix:"",a[E.id]??E.id]},E.id)}),f.length>0&&$.jsx("optgroup",{label:e.blockedLabel,children:f.map(E=>$.jsx("option",{value:E.id,children:a[E.id]??E.id},E.id))})]})}),e4=H1,t4={...gm,noOptionsAvailableColors:{...uh,title:"No Options Available Colors"}};D.addPropertyControls(H1,t4);const n4=(e,t,n,r)=>{var i,o,a;const s=Ma(e,t,n);return{...s,backgroundColor:H({noOptionsAvailable:r,noOptionsAvailableFill:(i=e.noOptionsAvailableColors)==null?void 0:i.fill}).with({noOptionsAvailable:!0,noOptionsAvailableFill:qe.string.minLength(1)},u=>u.noOptionsAvailableFill).otherwise(()=>s.backgroundColor),borderColor:H({noOptionsAvailable:r,noOptionsAvailableBorderColor:(o=e.noOptionsAvailableColors)==null?void 0:o.borderColor}).with({noOptionsAvailable:!0,noOptionsAvailableBorderColor:qe.string.minLength(1)},u=>u.noOptionsAvailableBorderColor).otherwise(()=>s.borderColor),color:H({noOptionsAvailable:r,noOptionsAvailableColor:(a=e.noOptionsAvailableColors)==null?void 0:a.color}).with({noOptionsAvailable:!0,noOptionsAvailableColor:qe.string.minLength(1)},u=>u.noOptionsAvailableColor).otherwise(()=>s.color)}},Nb=Ae.select`
|
|
1404
1404
|
color: inherit;
|
|
1405
|
-
`,
|
|
1405
|
+
`,Pb="<reset>",wd="<nothing>",xd="yes",Rb="no",K1=fi((e,t)=>{var n,r,i;if(Gt()){const x=Ma(e,!0,!1);return $.jsx(Nb,{style:x})}const o=Ir(),a=un(e),s=Q_(a),{explain:u}=ci();if(!s)return $.jsx("span",{children:"Boolean Attribute not found"});const{attribute:l,makeDecision:c}=s,f=async x=>{const T=$n.getBooleanDecision(l)!=null;if(x===Pb&&T)try{await c(void 0)}catch{Mr()}else{const E=x===xd;if($n.isBooleanValuePossible(l,E))try{await c(E)}catch{Mr()}else e.explain!=="disabled"&&await u(A=>A.whyIsStateNotPossible.boolean(l.id).state(E),e.explain,o)}},d=H((n=l.decision)==null?void 0:n.state).with(!0,()=>xd).with(!1,()=>Rb).otherwise(()=>wd),h=((r=l.decision)==null?void 0:r.kind)===Se.Explicit,p=((i=l.decision)==null?void 0:i.kind)===Se.Implicit,v=Ma(e,l.isSatisfied,p),g=$n.isBooleanValuePossible(l,!0),C=$n.isBooleanValuePossible(l,!1),m=$.jsxs("option",{value:xd,children:[kb(l,!0,e.implicitLabelPrefix),e.trueLabel]}),b=$.jsxs("option",{value:Rb,children:[kb(l,!1,e.implicitLabelPrefix),e.falseLabel]});return $.jsxs(Nb,{ref:t,value:d,onChange:x=>f(x.currentTarget.value),style:v,children:[d===wd&&$.jsx("option",{value:wd}),h&&$.jsx("option",{value:Pb,children:e.resetLabel}),g&&m,C&&b,(!g||!C)&&$.jsxs("optgroup",{label:e.blockedLabel,children:[!g&&m,!C&&b]})]})}),r4=K1,kb=(e,t,n)=>{var r,i;return((r=e.decision)==null?void 0:r.kind)===Se.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},i4={...gm,trueLabel:{title:"True Label",type:D.ControlType.String,defaultValue:"Yes"},falseLabel:{title:"False Label",type:D.ControlType.String,defaultValue:"No"}};D.addPropertyControls(K1,i4);const Mb=Ae.select`
|
|
1406
1406
|
color: inherit;
|
|
1407
|
-
`,
|
|
1407
|
+
`,jb="<reset>",Td="<nothing>",Ed="included",Id="excluded",Y1=fi((e,t)=>{var n,r,i;if(Gt()){const T=Ma(e,!0,!1);return $.jsx(Mb,{style:T})}const o=Ir(),a=un(e),s=Z_(a),{explain:u}=ci();if(!s)return $.jsx("span",{children:"Component Attribute not found"});const{attribute:l,makeDecision:c}=s,f=async T=>{if($n.isComponentStatePossible(l,T))try{await c(T)}catch{Mr()}else e.explain!=="disabled"&&await u(E=>E.whyIsStateNotPossible.component(l.id).state(T),e.explain,o)},d=async T=>{var E;const A=((E=l.decision)==null?void 0:E.kind)===Se.Explicit;T===jb&&A?await c(void 0):T===Ed?await f(Ge.Included):T===Id&&await f(Ge.Excluded)},h=H((n=l.decision)==null?void 0:n.state).with(Ge.Included,()=>Ed).with(Ge.Excluded,()=>Id).otherwise(()=>Td),p=((r=l.decision)==null?void 0:r.kind)===Se.Explicit,v=((i=l.decision)==null?void 0:i.kind)===Se.Implicit,g=Ma(e,l.isSatisfied,v),C=$n.isComponentStatePossible(l,Ge.Included),m=$n.isComponentStatePossible(l,Ge.Excluded),b=$.jsxs("option",{value:Ed,children:[_b(l,Ge.Included,e.implicitLabelPrefix),e.includedLabel]}),x=$.jsxs("option",{value:Id,children:[_b(l,Ge.Excluded,e.implicitLabelPrefix),e.excludedLabel]});return $.jsxs(Mb,{ref:t,value:h,onChange:T=>d(T.currentTarget.value),style:g,children:[h===Td&&$.jsx("option",{value:Td}),p&&$.jsx("option",{value:jb,children:e.resetLabel}),C&&b,m&&x,(!C||!m)&&$.jsxs("optgroup",{label:e.blockedLabel,children:[!C&&b,!m&&x]})]})}),o4=Y1,_b=(e,t,n)=>{var r,i;return((r=e.decision)==null?void 0:r.kind)===Se.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},a4={...gm,includedLabel:{title:"Included Label",type:D.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:D.ControlType.String,defaultValue:"Excluded"}};D.addPropertyControls(Y1,a4);function J1(e,t,n,r,i=1e3){const[o]=yT.useForceUpdate(),a=o5(d=>{t(d),o()},i),s=O.useRef(n),u=O.useRef(e),l=a.isPending(),c=O.useRef(l);O.useEffect(()=>{e!==u.current&&(u.current=e,l&&(a.cancel(),o()),e!==n&&r(e)),n!==s.current&&(s.current=n,n!==e?(a(n),o()):l&&(a.cancel(),o())),l!==c.current&&(c.current=l,!l&&e!==n&&r(e))},[e,n,a,l]);const f=O.useCallback(()=>{a.isPending()&&a.flush()},[a]);return O.useEffect(()=>()=>f(),[f]),{flush:f}}const qb=Ae(Vx)`
|
|
1408
1408
|
color: inherit;
|
|
1409
|
-
`,K1=fi((e,t)=>{var n,r;if(Yt()){const m=lh(e,!0,!1);return $.jsx(_b,{style:m})}const i=Er(),o=gn(e),a=K_(o),{explain:s}=ci();if(!a)return $.jsx("span",{children:"Numeric Attribute not found"});const{attribute:u,makeDecision:l}=a,c=((n=u.decision)==null?void 0:n.kind)===Se.Implicit,f=lh(e,u.isSatisfied,c),d=(r=u.decision)==null?void 0:r.state,[h,p]=O.useState(d),{min:v,max:g}=u.range,C=H1(d,async m=>{if(m<v){alert(`The value must be smaller than or equal to ${v}.`);return}if(m>g){alert(`The value must be greater than or equal to ${g}.`);return}try{await l(m)}catch(b){const x=b;x.type===pt.ConfigurationModelNotFeasible||x.type===pt.ConfigurationConflict?e.explain!=="disabled"&&await s(T=>T.whyIsStateNotPossible.numeric(u.id).state(m),e.explain,i):kr()}},h,m=>p(m),e.wait);return $.jsx(_b,{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:o4(u,e.implicitLabelPrefix),onBlur:()=>{C.flush()},onKeyPress:m=>{m.key==="Enter"&&C.flush()},onValueChange:m=>p(m.floatValue),value:h??"",style:f})}),i4=K1,o4=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===Se.Implicit?t:""},a4={...L1,wait:{title:"Debounce Delay",type:D.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:D.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:D.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:D.ControlType.String,defaultValue:""}};D.addPropertyControls(K1,a4);const Gu={choiceValueId:{title:"Choice Value Id",type:D.ControlType.String}};function di(e,t){return O.Children.map(e,n=>{if(O.isValidElement(n)){const r=jx(n.props,t);return O.cloneElement(n,r)}return n})}const Y1=fi((e,t)=>{if(Yt())return e.children;const n=Er(),{makeDecision:r}=ai(),i=gn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],{explain:u}=ci();if(!s)return $.jsx("span",{children:"Attribute not found"});const l=s.type===V.Choice,c=s.type===V.Numeric,f=s.type===V.Boolean,d=s.type===V.Component;if(!l&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(c)return $.jsx("span",{children:"Numeric Attribute is not supported"});let h=l?s.values.find(m=>m.id===o):null;if(a&&h==null)return $.jsx("span",{children:"Choice Value not found"});const p=m=>H({state:m,attribute:s}).with({attribute:{type:V.Choice},state:"undefined"},()=>h.decision==null).with({attribute:{type:V.Choice},state:"included"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Included&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Choice},state:"excluded"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Excluded&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"undefined"},{attribute:{type:V.Component},state:"undefined"},({attribute:b})=>b.decision==null).with({attribute:{type:V.Boolean},state:"true"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!0&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"false"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!1&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"included"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Included&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"excluded"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Excluded&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).otherwise(()=>!1),v=m=>H({isChoiceAttribute:l,isBooleanAttribute:f,isComponentAttribute:d,state:m}).with({isChoiceAttribute:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).otherwise(()=>null);p(e.toggleFrom);const g=p(e.toggleTo),C=async()=>{const m=g?e.toggleFrom:e.toggleTo,b=v(m),x=d?$n.isComponentStatePossible(s,b):!1,T=f?$n.isBooleanValuePossible(s,b):!1;if(l&&h.possibleDecisionStates.some(E=>E===b)||T||x||b==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:b})}catch{kr()}else if(e.explain!=="disabled"){const E=H({isComponentAttribute:d,isBooleanAttribute:f,isChoiceAttribute:l}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);E&&await u({question:Ft.whyIsStateNotPossible,subject:E,attributeId:i,choiceValueId:o,state:b},e.explain,n)}};return di(e.children,{onClick:C,ref:t})}),s4=Y1,u4={...xr,...Gu,children:{title:"Content",type:D.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:D.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...us};D.addPropertyControls(Y1,u4);const J1=fi((e,t)=>{if(Yt())return e.children;const n=Er(),{makeDecision:r}=ai(),i=gn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],u=rs(i),{explain:l}=ci();if(!s)return $.jsx("span",{children:"Attribute not found"});const c=s.type===V.Choice,f=s.type===V.Numeric,d=s.type===V.Boolean,h=s.type===V.Component;if(!c&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let p=c?s.values.find(C=>C.id===o):null;if(a&&p==null)return $.jsx("span",{children:"Choice Value not found"});const v=()=>H({isChoiceAttribute:c,isBooleanAttribute:d,isComponentAttribute:h,isNumericAttribute:f,hasChoiceValueId:a,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),g=async()=>{if(c&&!a&&e.setSelection==="undefined")try{await u.clearDecisions()}catch{kr()}else{const C=v(),m=h?$n.isComponentStatePossible(s,C):!1,b=d?$n.isBooleanValuePossible(s,C):!1,x=(c?p.possibleDecisionStates.some(T=>T===C):!1)||b||m;if(f||x||C==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:C})}catch(T){const E=T;f&&(E.type===pt.ConfigurationModelNotFeasible||E.type===pt.ConfigurationConflict)?e.explain!=="disabled"&&await l(A=>A.whyIsStateNotPossible.numeric(s.id).state(C),e.explain,n):kr()}else if(e.explain!=="disabled"){const T=H({isComponentAttribute:h,isBooleanAttribute:d,isChoiceAttribute:c}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);T&&await l({question:Ft.whyIsStateNotPossible,subject:T,attributeId:i,choiceValueId:o,state:C},e.explain,n)}}};return di(e.children,{onClick:g,ref:t})}),l4=J1,c4={...xr,...Gu,children:{title:"Content",type:D.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0},...us};D.addPropertyControls(J1,c4);const X1=fi((e,t)=>{var n;if(Yt())return e.children;const r=Er(),{setManyDecision:i}=ai(),{handleExplainAnswer:o}=ci(),a=e.attributes.map(gn),s=ns(a).map((f,d)=>{if(!f)return{error:$.jsx("span",{children:"Attribute not found"})};const h=e.attributes[d],p=h.choiceValueId??"",v=p.length>0,g=f.type===V.Choice,C=f.type===V.Numeric,m=f.type===V.Boolean,b=f.type===V.Component;if(!g&&v)return{error:$.jsx("span",{children:"Attribute is not a Choice Attribute"})};let x=g?f.values.find(E=>E.id===p):null;if(v&&x==null)return{error:$.jsx("span",{children:"Choice Value not found"})};const T=()=>H({isChoiceAttribute:g,isBooleanAttribute:m,isComponentAttribute:b,isNumericAttribute:C,hasChoiceValueId:v,state:h.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>h.numericValue).otherwise(()=>null);return{getDecisions:()=>g&&!v&&h.setSelection==="undefined"?f.values.filter(E=>{var A;return((A=E.decision)==null?void 0:A.kind)===Se.Explicit}).map(E=>({type:f.type,attributeId:f.id,choiceValueId:E.id,state:null})):[{type:f.type,attributeId:f.id,choiceValueId:p,state:T()}]}}),u=(n=s.find(f=>f.error))==null?void 0:n.error;if(u)return u;const l=async()=>{const f=s.reduce((h,p)=>[...h,...p.getDecisions()],new Array),d=H(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:H(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(f,d)}catch(h){const p=h;if(console.debug("SetMany failed",p),(p==null?void 0:p.type)===pt.ConfigurationSetManyConflict&&p.decisionExplanations){e.explain!=="disabled"&&await o(p,e.explain,r);return}kr();return}},c=()=>{e.trigger==="click"&&l()};return O.useEffect(()=>{e.trigger==="auto"&&l()},[]),di(e.children,{onClick:c,ref:t})}),f4=X1,d4={children:{title:"Content",type:D.ControlType.ComponentInstance},attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...xr,...Gu,setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:D.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:D.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:D.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...us};D.addPropertyControls(X1,d4);const Q1=ui(e=>{if(Yt())return e.enabledChildren;const{configuration:t}=Pv(),{setManyDecision:n}=ai(),r=t.attributes.some(a=>H(a).with({type:V.Choice},s=>s.values.some(u=>{var l;return((l=u.decision)==null?void 0:l.kind)===Se.Explicit})).with({type:V.Boolean},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Numeric},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Component},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).exhaustive()),i=()=>{if(r)try{n([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{JU()}},o=r?e.enabledChildren:e.disabledChildren;return di(o,{onClick:i})}),p4=Q1,h4={enabledChildren:{title:"Content – Enabled",type:D.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:D.ControlType.ComponentInstance}};D.addPropertyControls(Q1,h4);const Z1=fi((e,t)=>{if(Yt())return e.unsatisfiedChildren;const n=Er(),{configuration:r}=Pv(),{explain:i}=ci(),o=[...e.attributeId.length>0?[gn(e)]:[],...e.attributes.map(gn)],a=()=>{var u;const l=ns(o).map(f=>f?{isSatisfied:f.isSatisfied}:{error:$.jsx("span",{children:"Attribute not found"})});return((u=l.find(f=>f.error))==null?void 0:u.error)||l.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:di(e.unsatisfiedChildren,{onClick:s,ref:t})}),v4=Z1,m4={satisfiedChildren:{title:"Content – Satisfied",type:D.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:D.ControlType.ComponentInstance},...xr,attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...xr}}},...us};D.addPropertyControls(Z1,m4);const eT=ui(O.forwardRef(function(e,t){const n=d=>H(d).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(d=>d.useInDesignTime)||e.variants[0];if(Yt())return r&&n(r.content);const i=gn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0];if(!s)return $.jsx("span",{children:"Attribute not found"});const u=s.type===V.Choice;if(!u&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let l=u&&a?s.values.find(d=>d.id===o):null;if(a&&l==null)return $.jsx("span",{children:"Choice Value not found"});const c=d=>()=>l?d(l):s.values.some(d),f=[...e.variants].find(({selection:d,condition:h})=>H({selection:d,condition:h,attribute:s}).with({attribute:{type:V.Choice},selection:"included",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Included))).with({attribute:{type:V.Choice},selection:"included",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"included",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"included",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Included})).with({attribute:{type:V.Choice},selection:"excluded",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Excluded))).with({attribute:{type:V.Choice},selection:"excluded",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded})).with({attribute:{type:V.Boolean},selection:"true",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!0)).with({attribute:{type:V.Boolean},selection:"true",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!0}).with({attribute:{type:V.Boolean},selection:"false",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!1)).with({attribute:{type:V.Boolean},selection:"false",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!1}).with({attribute:{type:V.Component},selection:"included",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Included)).with({attribute:{type:V.Component},selection:"included",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"included",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"included",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Included}).with({attribute:{type:V.Component},selection:"excluded",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Excluded)).with({attribute:{type:V.Component},selection:"excluded",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"implicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Implicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"explicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Explicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"none"},({attribute:p})=>p.decision!=null).with({attribute:{type:V.Choice},selection:"undefined"},()=>l.decision==null).with({attribute:{type:V.Boolean},selection:"undefined"},{attribute:{type:V.Component},selection:"undefined"},{attribute:{type:V.Numeric},selection:"undefined"},({attribute:p})=>p.decision==null).otherwise(()=>!1));return f&&di(n(f.content),{ref:t})})),y4=eT,g4={...xr,...Gu,variants:{title:"Variants",type:D.ControlType.Array,maxCount:10,control:{type:D.ControlType.Object,controls:{selection:{title:"Selection",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:D.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:D.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:D.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:D.ControlType.ComponentInstance},content2:{title:"Content 2",type:D.ControlType.ComponentInstance},content3:{title:"Content 3",type:D.ControlType.ComponentInstance},content4:{title:"Content 4",type:D.ControlType.ComponentInstance},content5:{title:"Content 5",type:D.ControlType.ComponentInstance},content6:{title:"Content 6",type:D.ControlType.ComponentInstance},content7:{title:"Content 7",type:D.ControlType.ComponentInstance},content8:{title:"Content 8",type:D.ControlType.ComponentInstance},content9:{title:"Content 9",type:D.ControlType.ComponentInstance},content10:{title:"Content 10",type:D.ControlType.ComponentInstance}};D.addPropertyControls(eT,g4);const tT=ui(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=s5(a);return o5(`#${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})}),b4=tT,S4={children:{title:"Content",type:D.ControlType.ComponentInstance},color:{title:"Color",type:D.ControlType.Color,defaultValue:"#0000ff"}};D.addPropertyControls(tT,S4);const nT=ui(e=>{if(Yt())return e.children;const{error:t}=Nv();return t?di(e.children,{onClick:t.retry}):null}),C4=nT,w4={children:{title:"Content",type:D.ControlType.ComponentInstance}};D.addPropertyControls(nT,w4);function x4(e){return O.forwardRef((t,n)=>{const r={...t.style,width:"100%",height:"100%"};return $.jsx(e,{...t,ref:n,style:r})})}const T4=Ae.div`
|
|
1409
|
+
`,X1=fi((e,t)=>{var n,r;if(Gt()){const m=lh(e,!0,!1);return $.jsx(qb,{style:m})}const i=Ir(),o=un(e),a=M0(o),{explain:s}=ci();if(!a)return $.jsx("span",{children:"Numeric Attribute not found"});const{attribute:u,makeDecision:l}=a,c=((n=u.decision)==null?void 0:n.kind)===Se.Implicit,f=lh(e,u.isSatisfied,c),d=(r=u.decision)==null?void 0:r.state,[h,p]=O.useState(d),{min:v,max:g}=u.range,C=J1(d,async m=>{if(m<v){alert(`The value must be smaller than or equal to ${v}.`);return}if(m>g){alert(`The value must be greater than or equal to ${g}.`);return}try{await l(m)}catch(b){const x=b;x.type===pt.ConfigurationModelNotFeasible||x.type===pt.ConfigurationConflict?e.explain!=="disabled"&&await s(T=>T.whyIsStateNotPossible.numeric(u.id).state(m),e.explain,i):Mr()}},h,m=>p(m),e.wait);return $.jsx(qb,{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:u4(u,e.implicitLabelPrefix),onBlur:()=>{C.flush()},onKeyPress:m=>{m.key==="Enter"&&C.flush()},onValueChange:m=>p(m.floatValue),value:h??"",style:f})}),s4=X1,u4=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===Se.Implicit?t:""},l4={...U1,wait:{title:"Debounce Delay",type:D.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:D.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:D.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:D.ControlType.String,defaultValue:""}};D.addPropertyControls(X1,l4);const Gu={choiceValueId:{title:"Choice Value Id",type:D.ControlType.String}};function di(e,t){return O.Children.map(e,n=>{if(O.isValidElement(n)){const r=Fx(n.props,t);return O.cloneElement(n,r)}return n})}const Q1=fi((e,t)=>{if(Gt())return e.children;const n=Ir(),{makeDecision:r}=si(),i=un(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],{explain:u}=ci();if(!s)return $.jsx("span",{children:"Attribute not found"});const l=s.type===V.Choice,c=s.type===V.Numeric,f=s.type===V.Boolean,d=s.type===V.Component;if(!l&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(c)return $.jsx("span",{children:"Numeric Attribute is not supported"});let h=l?s.values.find(m=>m.id===o):null;if(a&&h==null)return $.jsx("span",{children:"Choice Value not found"});const p=m=>H({state:m,attribute:s}).with({attribute:{type:V.Choice},state:"undefined"},()=>h.decision==null).with({attribute:{type:V.Choice},state:"included"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Included&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Choice},state:"excluded"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Excluded&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"undefined"},{attribute:{type:V.Component},state:"undefined"},({attribute:b})=>b.decision==null).with({attribute:{type:V.Boolean},state:"true"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!0&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"false"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!1&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"included"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Included&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"excluded"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Excluded&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).otherwise(()=>!1),v=m=>H({isChoiceAttribute:l,isBooleanAttribute:f,isComponentAttribute:d,state:m}).with({isChoiceAttribute:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).otherwise(()=>null);p(e.toggleFrom);const g=p(e.toggleTo),C=async()=>{const m=g?e.toggleFrom:e.toggleTo,b=v(m),x=d?$n.isComponentStatePossible(s,b):!1,T=f?$n.isBooleanValuePossible(s,b):!1;if(l&&h.possibleDecisionStates.some(E=>E===b)||T||x||b==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:b})}catch{Mr()}else if(e.explain!=="disabled"){const E=H({isComponentAttribute:d,isBooleanAttribute:f,isChoiceAttribute:l}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);E&&await u({question:Ft.whyIsStateNotPossible,subject:E,attributeId:i,choiceValueId:o,state:b},e.explain,n)}};return di(e.children,{onClick:C,ref:t})}),c4=Q1,f4={...fr,...Gu,children:{title:"Content",type:D.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:D.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...us};D.addPropertyControls(Q1,f4);const Z1=fi((e,t)=>{if(Gt())return e.children;const n=Ir(),{makeDecision:r}=si(),i=un(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],u=rs(i),{explain:l}=ci();if(!s)return $.jsx("span",{children:"Attribute not found"});const c=s.type===V.Choice,f=s.type===V.Numeric,d=s.type===V.Boolean,h=s.type===V.Component;if(!c&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let p=c?s.values.find(C=>C.id===o):null;if(a&&p==null)return $.jsx("span",{children:"Choice Value not found"});const v=()=>H({isChoiceAttribute:c,isBooleanAttribute:d,isComponentAttribute:h,isNumericAttribute:f,hasChoiceValueId:a,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),g=async()=>{if(c&&!a&&e.setSelection==="undefined")try{await u.clearDecisions()}catch{Mr()}else{const C=v(),m=h?$n.isComponentStatePossible(s,C):!1,b=d?$n.isBooleanValuePossible(s,C):!1,x=(c?p.possibleDecisionStates.some(T=>T===C):!1)||b||m;if(f||x||C==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:C})}catch(T){const E=T;f&&(E.type===pt.ConfigurationModelNotFeasible||E.type===pt.ConfigurationConflict)?e.explain!=="disabled"&&await l(A=>A.whyIsStateNotPossible.numeric(s.id).state(C),e.explain,n):Mr()}else if(e.explain!=="disabled"){const T=H({isComponentAttribute:h,isBooleanAttribute:d,isChoiceAttribute:c}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);T&&await l({question:Ft.whyIsStateNotPossible,subject:T,attributeId:i,choiceValueId:o,state:C},e.explain,n)}}};return di(e.children,{onClick:g,ref:t})}),d4=Z1,p4={...fr,...Gu,children:{title:"Content",type:D.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0},...us};D.addPropertyControls(Z1,p4);const eT=fi((e,t)=>{var n;if(Gt())return e.children;const r=Ir(),{setManyDecision:i}=si(),{handleExplainAnswer:o}=ci(),a=e.attributes.map(un),s=ns(a).map((f,d)=>{if(!f)return{error:$.jsx("span",{children:"Attribute not found"})};const h=e.attributes[d],p=h.choiceValueId??"",v=p.length>0,g=f.type===V.Choice,C=f.type===V.Numeric,m=f.type===V.Boolean,b=f.type===V.Component;if(!g&&v)return{error:$.jsx("span",{children:"Attribute is not a Choice Attribute"})};let x=g?f.values.find(E=>E.id===p):null;if(v&&x==null)return{error:$.jsx("span",{children:"Choice Value not found"})};const T=()=>H({isChoiceAttribute:g,isBooleanAttribute:m,isComponentAttribute:b,isNumericAttribute:C,hasChoiceValueId:v,state:h.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>h.numericValue).otherwise(()=>null);return{getDecisions:()=>g&&!v&&h.setSelection==="undefined"?f.values.filter(E=>{var A;return((A=E.decision)==null?void 0:A.kind)===Se.Explicit}).map(E=>({type:f.type,attributeId:f.id,choiceValueId:E.id,state:null})):[{type:f.type,attributeId:f.id,choiceValueId:p,state:T()}]}}),u=(n=s.find(f=>f.error))==null?void 0:n.error;if(u)return u;const l=async()=>{const f=s.reduce((h,p)=>[...h,...p.getDecisions()],new Array),d=H(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:H(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(f,d)}catch(h){const p=h;if(console.debug("SetMany failed",p),(p==null?void 0:p.type)===pt.ConfigurationSetManyConflict&&p.decisionExplanations){e.explain!=="disabled"&&await o(p,e.explain,r);return}Mr();return}},c=()=>{e.trigger==="click"&&l()};return O.useEffect(()=>{e.trigger==="auto"&&l()},[]),di(e.children,{onClick:c,ref:t})}),h4=eT,v4={children:{title:"Content",type:D.ControlType.ComponentInstance},attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...fr,...Gu,setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:D.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:D.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:D.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...us};D.addPropertyControls(eT,v4);const tT=Er(e=>{if(Gt())return e.enabledChildren;const{configuration:t}=Nv(),{setManyDecision:n}=si(),r=t.attributes.some(a=>H(a).with({type:V.Choice},s=>s.values.some(u=>{var l;return((l=u.decision)==null?void 0:l.kind)===Se.Explicit})).with({type:V.Boolean},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Numeric},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Component},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).exhaustive()),i=()=>{if(r)try{n([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{ZU()}},o=r?e.enabledChildren:e.disabledChildren;return di(o,{onClick:i})}),m4=tT,y4={enabledChildren:{title:"Content – Enabled",type:D.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:D.ControlType.ComponentInstance}};D.addPropertyControls(tT,y4);const nT=fi((e,t)=>{if(Gt())return e.unsatisfiedChildren;const n=Ir(),{configuration:r}=Nv(),{explain:i}=ci(),o=[...e.attributeId.length>0?[un(e)]:[],...e.attributes.map(un)],a=()=>{var u;const l=ns(o).map(f=>f?{isSatisfied:f.isSatisfied}:{error:$.jsx("span",{children:"Attribute not found"})});return((u=l.find(f=>f.error))==null?void 0:u.error)||l.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:di(e.unsatisfiedChildren,{onClick:s,ref:t})}),g4=nT,b4={satisfiedChildren:{title:"Content – Satisfied",type:D.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:D.ControlType.ComponentInstance},...fr,attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...fr}}},...us};D.addPropertyControls(nT,b4);const rT=Er(O.forwardRef(function(e,t){const n=d=>H(d).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(d=>d.useInDesignTime)||e.variants[0];if(Gt())return r&&n(r.content);const i=un(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0];if(!s)return $.jsx("span",{children:"Attribute not found"});const u=s.type===V.Choice;if(!u&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let l=u&&a?s.values.find(d=>d.id===o):null;if(a&&l==null)return $.jsx("span",{children:"Choice Value not found"});const c=d=>()=>l?d(l):s.values.some(d),f=[...e.variants].find(({selection:d,condition:h})=>H({selection:d,condition:h,attribute:s}).with({attribute:{type:V.Choice},selection:"included",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Included))).with({attribute:{type:V.Choice},selection:"included",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"included",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"included",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Included})).with({attribute:{type:V.Choice},selection:"excluded",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Excluded))).with({attribute:{type:V.Choice},selection:"excluded",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded})).with({attribute:{type:V.Boolean},selection:"true",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!0)).with({attribute:{type:V.Boolean},selection:"true",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!0}).with({attribute:{type:V.Boolean},selection:"false",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!1)).with({attribute:{type:V.Boolean},selection:"false",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!1}).with({attribute:{type:V.Component},selection:"included",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Included)).with({attribute:{type:V.Component},selection:"included",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"included",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"included",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Included}).with({attribute:{type:V.Component},selection:"excluded",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Excluded)).with({attribute:{type:V.Component},selection:"excluded",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"implicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Implicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"explicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Explicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"none"},({attribute:p})=>p.decision!=null).with({attribute:{type:V.Choice},selection:"undefined"},()=>l.decision==null).with({attribute:{type:V.Boolean},selection:"undefined"},{attribute:{type:V.Component},selection:"undefined"},{attribute:{type:V.Numeric},selection:"undefined"},({attribute:p})=>p.decision==null).otherwise(()=>!1));return f&&di(n(f.content),{ref:t})})),S4=rT,C4={...fr,...Gu,variants:{title:"Variants",type:D.ControlType.Array,maxCount:10,control:{type:D.ControlType.Object,controls:{selection:{title:"Selection",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:D.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:D.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:D.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:D.ControlType.ComponentInstance},content2:{title:"Content 2",type:D.ControlType.ComponentInstance},content3:{title:"Content 3",type:D.ControlType.ComponentInstance},content4:{title:"Content 4",type:D.ControlType.ComponentInstance},content5:{title:"Content 5",type:D.ControlType.ComponentInstance},content6:{title:"Content 6",type:D.ControlType.ComponentInstance},content7:{title:"Content 7",type:D.ControlType.ComponentInstance},content8:{title:"Content 8",type:D.ControlType.ComponentInstance},content9:{title:"Content 9",type:D.ControlType.ComponentInstance},content10:{title:"Content 10",type:D.ControlType.ComponentInstance}};D.addPropertyControls(rT,C4);const iT=Er(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=c5(a);return u5(`#${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})}),w4=iT,x4={children:{title:"Content",type:D.ControlType.ComponentInstance},color:{title:"Color",type:D.ControlType.Color,defaultValue:"#0000ff"}};D.addPropertyControls(iT,x4);const oT=Er(e=>{if(Gt())return e.children;const{error:t}=Dv();return t?di(e.children,{onClick:t.retry}):null}),T4=oT,E4={children:{title:"Content",type:D.ControlType.ComponentInstance}};D.addPropertyControls(oT,E4);function I4(e){return O.forwardRef((t,n)=>{const r={...t.style,width:"100%",height:"100%"};return $.jsx(e,{...t,ref:n,style:r})})}const A4=Ae.div`
|
|
1410
1410
|
width: 10px;
|
|
1411
1411
|
height: 10px;
|
|
1412
1412
|
background-color: greenyellow;
|
|
1413
|
-
`;function
|
|
1413
|
+
`;function aT(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(A4,{ref:t})}const $4={delay:{title:"Delay",type:D.ControlType.Number,min:0,unit:"ms",defaultValue:0,step:1}};D.addPropertyControls(aT,$4);const sT=Ae.div`
|
|
1414
1414
|
display: contents;
|
|
1415
|
-
`,
|
|
1415
|
+
`,O4=Mu`
|
|
1416
1416
|
:root {
|
|
1417
|
-
*:has(> ${
|
|
1417
|
+
*:has(> ${sT}) {
|
|
1418
1418
|
display: contents !important;
|
|
1419
1419
|
}
|
|
1420
1420
|
}
|
|
1421
|
-
`,oT=ui(U1(e=>{const t=Er(),n=Yt(),r=n?(()=>O.Children.toArray(e.itemTemplate)[0])():(()=>{const f=d=>{var h;const p=O.Children.toArray(d)[0],v=(h=p.props)==null?void 0:h.children;return v?f(v):p};return f(e.itemTemplate)})();if(!r)return $.jsx("span",{children:"Choice Value Template not defined"});const i=(f,d)=>f.map(h=>O.cloneElement(r,{key:h,layoutId:`${t}_${h}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:h,choiceValueName:d[h]??h}));if(n)return $.jsx(qb,{...e,children:i(["Choice Value 1","Choice Value 2","Choice Value 3"],{})});const o=gn(e),a=rs(o);if(!a)return $.jsx("span",{children:"Choice Attribute not found"});const s=Pf(o),u=e.filter??new Array,l=a.attribute.values.filter(f=>u.length===0||u.some(({selection:d,condition:h})=>H({selection:d,condition:h}).with({selection:"included",condition:"blocked"},()=>!f.possibleDecisionStates.includes(Ye.Included)).with({selection:"included",condition:"implicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Included&&((v=f.decision)==null?void 0:v.kind)===Se.Implicit}).with({selection:"included",condition:"explicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Included&&((v=f.decision)==null?void 0:v.kind)===Se.Explicit}).with({selection:"included",condition:"none"},()=>{var p;return((p=f.decision)==null?void 0:p.state)===Ye.Included}).with({selection:"excluded",condition:"blocked"},()=>!f.possibleDecisionStates.includes(Ye.Excluded)).with({selection:"excluded",condition:"implicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded&&((v=f.decision)==null?void 0:v.kind)===Se.Implicit}).with({selection:"excluded",condition:"explicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded&&((v=f.decision)==null?void 0:v.kind)===Se.Explicit}).with({selection:"excluded",condition:"none"},()=>{var p;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded}).with({selection:"undefined"},()=>f.decision==null).otherwise(()=>!1))),c=Oc(o,s,l).map(f=>f.id);return $.jsx(qb,{...e,children:i(c,s)})}));function qb(e){return $.jsxs($.Fragment,{children:[$.jsx($c,{singletonId:"ChoiceValueListRenderer",children:$.jsx(I4,{})}),$.jsx(iT,{style:e.style,children:e.children})]})}const A4=oT,$4={...xr,itemTemplate:{title:"Choice Value Template",type:D.ControlType.ComponentInstance},filter:{title:"Filter",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{selection:{title:"Selection",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded"]},condition:{title:"Condition",type:D.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]}}}}};D.addPropertyControls(oT,$4);const{isValidElement:Fb,cloneElement:Lb}=J;function O4(e,t){return t?(Array.isArray(t)&&(t=t.map((n,r)=>Fb(n)&&typeof n.props=="object"?Lb(n,{...n.props,key:r}):n)),!e||Array.isArray(e)?t:Fb(e)?Lb(e,{...e.props,children:t}):e):e}const{isValidElement:D4}=J;function aT(e,t,n){function r(o,a){return t.visit(o,n,a)}function i(o,a){return aT(o,t,a||n)}if(D4(e)){if(typeof e.type=="function")return"prototype"in e.type&&e.type.prototype.isReactComponent?e=new e.type(e.props).render():e=e.type(e.props),i(e);if(e.props&&"children"in e.props){const o=e.props.children;return r(e,a=>Array.isArray(o)?o.map(s=>i(s,a)):i(o,a))}}else if(Array.isArray(e)){const o=e;return r(e,a=>o.map(s=>i(s,a)))}return r(e)}const{isValidElement:Vb}=J;function N4(e,t){let n;const{replace:r,updateState:i}=t;return"matchElement"in t?n=o=>Vb(o)&&o.type===t.matchElement:"matchLiteral"in t?n=o=>!Array.isArray(o)&&!Vb(o)&&t.matchLiteral(o):n=t.match,aT(e,{visit(o,a,s){const u=i?i(a):a,l=s?s(u):void 0,c=O4(o,l);return n(c,u)?r(c,u):c}},t.initialState)}function ch(e){return $.jsx($.Fragment,{children:N4(e.children,e)})}const sT=ui(e=>{const{attributeId:t,children:n,customName:r}=e,i=gn(e),o=(r==null?void 0:r.length)>0,a=Yt(),s=o?r:a?t:(()=>ns([i],!1)[0]?am(i)??t:"Attribute not found")();return $.jsx(ch,{match:u=>typeof u=="string",replace:u=>u==="<AttributeName>"?s:u,children:n})}),P4=sT,R4={children:{title:"Content",type:D.ControlType.ComponentInstance},...xr,customName:{title:"Custom Name",type:D.ControlType.String}};D.addPropertyControls(sT,R4);function k4(e){return y(e,eR(/[\s\u2013]/g,"-"),v5)}const uT=ui(e=>{const{choiceValueId:t,children:n,customName:r,mode:i,replaceString:o,propName:a,elementName:s}=e,u=gn(e),l=r.length>0,c=t.length>0,f=Yt(),d=l?r:f?t.length>0?t:"Choice Value":(()=>{const h=rs(u);return h?c?h.attribute.values.find(p=>p.id===t)==null?"Choice Value not found":k5(u,t)??t:"Choice Value Id missing":"Choice Attribute not found"})();return i==="replace"?$.jsx(ch,{match:h=>typeof h=="string",replace:h=>h===o?d:h,children:n}):i==="set-prop"?$.jsx(ch,{match:h=>{var p;return((p=h.type)==null?void 0:p.displayName)===s},replace:h=>O.cloneElement(h,{[k4(a)]:d}),children:n}):n}),M4=uT,j4={children:{title:"Content",type:D.ControlType.ComponentInstance},...xr,...Gu,customName:{title:"Custom Name",type:D.ControlType.String},mode:{title:"Mode",type:D.ControlType.Enum,defaultValue:"replace",options:["replace","set-prop"],displaySegmentedControl:!0},replaceString:{title:"Replace Text",type:D.ControlType.String,defaultValue:"<ChoiceValueName>",hidden:e=>e.mode!=="replace"},elementName:{title:"Element Name",type:D.ControlType.String,hidden:e=>e.mode!=="set-prop"},propName:{title:"Property Name",type:D.ControlType.String,hidden:e=>e.mode!=="set-prop"}};D.addPropertyControls(uT,j4);function lT(e){return e.children}const _4={children:{title:"Content",type:D.ControlType.ComponentInstance}};D.addPropertyControls(lT,_4);function cT(e){const{children:t,fileExtension:n,fileName:r,target:i}=e;if(Yt())return t;const{configuration:o}=Pv();return di(t,{onClick:async()=>{const a={type:"spc-stored-configuration",storedConfiguration:F4(o)};i==="file"?L4(a,`${r}.${n}`):i==="clipboard"&&V4(a)}})}const q4={children:{title:"Content",type:D.ControlType.ComponentInstance},target:{title:"Target",type:D.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileName:{title:"File Name",type:D.ControlType.String,defaultValue:"configuration",hidden:e=>e.target!=="file"},fileExtension:{title:"File Extension",type:D.ControlType.String,defaultValue:"json",hidden:e=>e.target!=="file"}};D.addPropertyControls(cT,q4);function F4(e){return{schemaVersion:1,explicitDecisions:y(e.attributes,ew(t=>H(t).returnType().with({type:V.Choice},n=>n.values.filter(r=>{var i;return((i=r.decision)==null?void 0:i.kind)===Se.Explicit}).map(r=>({type:V.Choice,attributeId:n.id,choiceValueId:r.id,state:r.decision.state}))).with({type:V.Numeric},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Numeric,attributeId:n.id,state:n.decision.state}]:[]}).with({type:V.Boolean},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Boolean,attributeId:n.id,state:n.decision.state}]:[]}).with({type:V.Component},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Component,attributeId:n.id,state:n.decision.state}]:[]}).exhaustive()))}}function L4(e,t){const n=JSON.stringify(e),r=new Blob([n],{type:"application/json"}),i=window.URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(i)}function V4(e){const t=JSON.stringify(e);navigator.clipboard.writeText(t).catch(n=>{alert("Failed to copy the configuration to clipboard: "+n)})}var fT=(e=>(e[e.parseError=0]="parseError",e[e.noConfiguration=1]="noConfiguration",e[e.unsupportedSchemaVersion=2]="unsupportedSchemaVersion",e[e.noFileSelected=3]="noFileSelected",e[e.fileReadError=4]="fileReadError",e[e.noClipboardData=5]="noClipboardData",e[e.clipboardReadError=6]="clipboardReadError",e))(fT||{});const dT=fi((e,t)=>{const{children:n,fileExtension:r,source:i}=e;if(Yt())return n;const o=Er(),{setManyDecision:a}=ai(),{handleExplainAnswer:s}=ci();return di(n,{onClick:async()=>{const u=y(await H4(i,r),Mn);if(!u)return;const l={type:"DropExistingDecisions",conflictHandling:H(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()};try{const c=G4(u);await a(c,l)}catch(c){const f=c;if(console.debug("Failed to restore stored configuration",f),(f==null?void 0:f.type)===pt.ConfigurationSetManyConflict&&f.decisionExplanations){e.explain!=="disabled"&&await s(f,e.explain,o);return}alert("Failed to restore your configuration.");return}},ref:t})}),B4=dT,U4={children:{title:"Content",type:D.ControlType.ComponentInstance},source:{title:"Source",type:D.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileExtension:{title:"File Extension",type:D.ControlType.String,defaultValue:"json",hidden:e=>e.source!=="file"},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:D.ControlType.Boolean,defaultValue:!0},...us};D.addPropertyControls(dT,U4);function G4(e){return e.explicitDecisions.map(t=>H(t).returnType().with({type:V.Choice},n=>({type:V.Choice,attributeId:n.attributeId,choiceValueId:n.choiceValueId,state:n.state})).with({type:V.Numeric},n=>({type:V.Numeric,attributeId:n.attributeId,state:n.state})).with({type:V.Boolean},n=>({type:V.Boolean,attributeId:n.attributeId,state:n.state})).with({type:V.Component},n=>({type:V.Component,attributeId:n.attributeId,state:n.state})).exhaustive())}function z4(e){return()=>new Promise(t=>{const n=document.createElement("input");n.type="file",n.accept=`.${e}`,n.onchange=r=>{const i=r.target;if(!i.files||i.files.length===0){t(Hr(3));return}const o=i.files[0],a=new FileReader;a.onload=()=>{t(Lo(a.result))},a.onerror=()=>{t(Hr(4))},a.readAsText(o)},n.oncancel=()=>{t(Hr(3))},n.click()})}function W4(){return()=>navigator.clipboard.readText().then(e=>e?Lo(e):Hr(5)).catch(()=>Hr(6))}function H4(e,t){return y(e==="file"?z4(t):W4(),qP(n=>bN(()=>JSON.parse(n),()=>0)),op(n=>n.type==="spc-stored-configuration",()=>1),op(n=>{var r;return((r=n.storedConfiguration)==null?void 0:r.schemaVersion)===1},()=>2),Wt(n=>n.storedConfiguration),Zs(n=>()=>{console.debug(`Failed to load stored configuration: ${fT[n]}`),n==4?alert("Failed to read the selected file. Maybe it is damaged."):n==1||n==0?e==="file"?alert("The selected file doesn't contain a valid configuration."):e==="clipboard"&&alert("The clipboard doesn't contain a valid configuration."):n==2?alert("The specific configuration is not supported. Maybe the configuration was created with new application version than the current one."):n==6?alert("Can't read the clipboard. Make to give a permission for reading the clipboard."):n==5&&alert("The clipboard doesn't contain a configuration.")}),JP)()}const K4=Object.freeze(Object.defineProperty({__proto__:null,AttributeName:P4,BooleanSelect:e4,ChoiceSelect:XU,ChoiceValueListRenderer:A4,ChoiceValueName:M4,Colorize:b4,ComponentSelect:n4,Configuration:vU,InitializationRetry:C4,NumericInput:i4,ResetConfiguration:p4,RestoreConfiguration:B4,SatisfactionIndicator:v4,ScrollIntoView:rT,SelectionIndicator:y4,SelectionToggle:s4,SetSelection:l4,SetSelections:f4,Singleton:$c,Slot:lT,StoreConfiguration:cT,useDebounceValue:H1,useRenderPlaceholder:Yt,useSortedChoiceValues:Oc,withFullSize:x4},Symbol.toStringTag,{value:"Module"}));exports.Configurator=R$;exports.ConfiguratorFramer=K4;exports.ConfiguratorReact=M2;
|
|
1421
|
+
`,uT=Er(W1(e=>{const t=Ir(),n=Gt(),r=n?(()=>O.Children.toArray(e.itemTemplate)[0])():(()=>{const f=d=>{var h;const p=O.Children.toArray(d)[0],v=(h=p.props)==null?void 0:h.children;return v?f(v):p};return f(e.itemTemplate)})();if(!r)return $.jsx("span",{children:"Choice Value Template not defined"});const i=(f,d)=>f.map(h=>O.cloneElement(r,{key:h,layoutId:`${t}_${h}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:h,choiceValueName:d[h]??h}));if(n)return $.jsx(Fb,{...e,children:i(["Choice Value 1","Choice Value 2","Choice Value 3"],{})});const o=un(e),a=rs(o);if(!a)return $.jsx("span",{children:"Choice Attribute not found"});const s=Pf(o),u=e.filter??new Array,l=a.attribute.values.filter(f=>u.length===0||u.some(({selection:d,condition:h})=>H({selection:d,condition:h}).with({selection:"included",condition:"blocked"},()=>!f.possibleDecisionStates.includes(Ye.Included)).with({selection:"included",condition:"implicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Included&&((v=f.decision)==null?void 0:v.kind)===Se.Implicit}).with({selection:"included",condition:"explicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Included&&((v=f.decision)==null?void 0:v.kind)===Se.Explicit}).with({selection:"included",condition:"none"},()=>{var p;return((p=f.decision)==null?void 0:p.state)===Ye.Included}).with({selection:"excluded",condition:"blocked"},()=>!f.possibleDecisionStates.includes(Ye.Excluded)).with({selection:"excluded",condition:"implicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded&&((v=f.decision)==null?void 0:v.kind)===Se.Implicit}).with({selection:"excluded",condition:"explicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded&&((v=f.decision)==null?void 0:v.kind)===Se.Explicit}).with({selection:"excluded",condition:"none"},()=>{var p;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded}).with({selection:"undefined"},()=>f.decision==null).otherwise(()=>!1))),c=Oc(o,s,l).map(f=>f.id);return $.jsx(Fb,{...e,children:i(c,s)})}));function Fb(e){return $.jsxs($.Fragment,{children:[$.jsx($c,{singletonId:"ChoiceValueListRenderer",children:$.jsx(O4,{})}),$.jsx(sT,{style:e.style,children:e.children})]})}const D4=uT,N4={...fr,itemTemplate:{title:"Choice Value Template",type:D.ControlType.ComponentInstance},filter:{title:"Filter",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{selection:{title:"Selection",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded"]},condition:{title:"Condition",type:D.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]}}}}};D.addPropertyControls(uT,N4);const{isValidElement:Lb,cloneElement:Vb}=J;function P4(e,t){return t?(Array.isArray(t)&&(t=t.map((n,r)=>Lb(n)&&typeof n.props=="object"?Vb(n,{...n.props,key:r}):n)),!e||Array.isArray(e)?t:Lb(e)?Vb(e,{...e.props,children:t}):e):e}const{isValidElement:R4}=J;function lT(e,t,n){function r(o,a){return t.visit(o,n,a)}function i(o,a){return lT(o,t,a||n)}if(R4(e)){if(typeof e.type=="function")return"prototype"in e.type&&e.type.prototype.isReactComponent?e=new e.type(e.props).render():e=e.type(e.props),i(e);if(e.props&&"children"in e.props){const o=e.props.children;return r(e,a=>Array.isArray(o)?o.map(s=>i(s,a)):i(o,a))}}else if(Array.isArray(e)){const o=e;return r(e,a=>o.map(s=>i(s,a)))}return r(e)}const{isValidElement:Bb}=J;function k4(e,t){let n;const{replace:r,updateState:i}=t;return"matchElement"in t?n=o=>Bb(o)&&o.type===t.matchElement:"matchLiteral"in t?n=o=>!Array.isArray(o)&&!Bb(o)&&t.matchLiteral(o):n=t.match,lT(e,{visit(o,a,s){const u=i?i(a):a,l=s?s(u):void 0,c=P4(o,l);return n(c,u)?r(c,u):c}},t.initialState)}function Ub(e){return $.jsx($.Fragment,{children:k4(e.children,e)})}function M4(e){return y(e,iR(/[\s\u2013]/g,"-"),g5)}const j4=Er(e=>{const{children:t,mode:n,replaceString:r,propName:i,elementName:o,text:a}=e;return n==="replace"?$.jsx(Ub,{match:s=>typeof s=="string",replace:s=>s===r?a:s,children:t}):n==="set-prop"?$.jsx(Ub,{match:s=>{var u;return((u=s.type)==null?void 0:u.displayName)===o},replace:s=>O.cloneElement(s,{[M4(i)]:a}),children:t}):t}),bm=j4,Sm=e=>({children:{title:"Content",type:D.ControlType.ComponentInstance},mode:{title:"Mode",type:D.ControlType.Enum,defaultValue:"replace",options:["replace","set-prop"],displaySegmentedControl:!0},replaceString:{title:"Replace Text",type:D.ControlType.String,defaultValue:e,hidden:t=>t.mode!=="replace"},elementName:{title:"Element Name",type:D.ControlType.String,hidden:t=>t.mode!=="set-prop"},propName:{title:"Property Name",type:D.ControlType.String,hidden:t=>t.mode!=="set-prop"}}),cT=Er(e=>{const{attributeId:t,children:n,customName:r}=e,i=un(e),o=(r==null?void 0:r.length)>0,a=Gt(),s=o?r:a?t:(()=>ns([i],!1)[0]?om(i)??t:"Attribute not found")();return $.jsx(bm,{...e,text:s})}),_4=cT,q4={...fr,customName:{title:"Custom Name",type:D.ControlType.String},...Sm("<AttributeName>")};D.addPropertyControls(cT,q4);const fT=Er(e=>{const{choiceValueId:t,children:n,customName:r,mode:i,replaceString:o,propName:a,elementName:s}=e,u=un(e),l=r.length>0,c=t.length>0,f=Gt(),d=l?r:f?t.length>0?t:"Choice Value":(()=>{const h=rs(u);return h?c?h.attribute.values.find(p=>p.id===t)==null?"Choice Value not found":_5(u,t)??t:"Choice Value Id missing":"Choice Attribute not found"})();return $.jsx(bm,{...e,text:d})}),F4=fT,L4={...fr,...Gu,customName:{title:"Custom Name",type:D.ControlType.String},...Sm("<ChoiceValueName>")};D.addPropertyControls(fT,L4);function dT(e){return e.children}const V4={children:{title:"Content",type:D.ControlType.ComponentInstance}};D.addPropertyControls(dT,V4);function pT(e){const{children:t,fileExtension:n,fileName:r,target:i}=e;if(Gt())return t;const{configuration:o}=Nv();return di(t,{onClick:async()=>{const a={type:"spc-stored-configuration",storedConfiguration:U4(o)};i==="file"?G4(a,`${r}.${n}`):i==="clipboard"&&z4(a)}})}const B4={children:{title:"Content",type:D.ControlType.ComponentInstance},target:{title:"Target",type:D.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileName:{title:"File Name",type:D.ControlType.String,defaultValue:"configuration",hidden:e=>e.target!=="file"},fileExtension:{title:"File Extension",type:D.ControlType.String,defaultValue:"json",hidden:e=>e.target!=="file"}};D.addPropertyControls(pT,B4);function U4(e){return{schemaVersion:1,explicitDecisions:y(e.attributes,nw(t=>H(t).returnType().with({type:V.Choice},n=>n.values.filter(r=>{var i;return((i=r.decision)==null?void 0:i.kind)===Se.Explicit}).map(r=>({type:V.Choice,attributeId:n.id,choiceValueId:r.id,state:r.decision.state}))).with({type:V.Numeric},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Numeric,attributeId:n.id,state:n.decision.state}]:[]}).with({type:V.Boolean},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Boolean,attributeId:n.id,state:n.decision.state}]:[]}).with({type:V.Component},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Component,attributeId:n.id,state:n.decision.state}]:[]}).exhaustive()))}}function G4(e,t){const n=JSON.stringify(e),r=new Blob([n],{type:"application/json"}),i=window.URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(i)}function z4(e){const t=JSON.stringify(e);navigator.clipboard.writeText(t).catch(n=>{alert("Failed to copy the configuration to clipboard: "+n)})}var hT=(e=>(e[e.parseError=0]="parseError",e[e.noConfiguration=1]="noConfiguration",e[e.unsupportedSchemaVersion=2]="unsupportedSchemaVersion",e[e.noFileSelected=3]="noFileSelected",e[e.fileReadError=4]="fileReadError",e[e.noClipboardData=5]="noClipboardData",e[e.clipboardReadError=6]="clipboardReadError",e))(hT||{});const vT=fi((e,t)=>{const{children:n,fileExtension:r,source:i}=e;if(Gt())return n;const o=Ir(),{setManyDecision:a}=si(),{handleExplainAnswer:s}=ci();return di(n,{onClick:async()=>{const u=y(await X4(i,r),Mn);if(!u)return;const l={type:"DropExistingDecisions",conflictHandling:H(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()};try{const c=K4(u);await a(c,l)}catch(c){const f=c;if(console.debug("Failed to restore stored configuration",f),(f==null?void 0:f.type)===pt.ConfigurationSetManyConflict&&f.decisionExplanations){e.explain!=="disabled"&&await s(f,e.explain,o);return}alert("Failed to restore your configuration.");return}},ref:t})}),W4=vT,H4={children:{title:"Content",type:D.ControlType.ComponentInstance},source:{title:"Source",type:D.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileExtension:{title:"File Extension",type:D.ControlType.String,defaultValue:"json",hidden:e=>e.source!=="file"},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:D.ControlType.Boolean,defaultValue:!0},...us};D.addPropertyControls(vT,H4);function K4(e){return e.explicitDecisions.map(t=>H(t).returnType().with({type:V.Choice},n=>({type:V.Choice,attributeId:n.attributeId,choiceValueId:n.choiceValueId,state:n.state})).with({type:V.Numeric},n=>({type:V.Numeric,attributeId:n.attributeId,state:n.state})).with({type:V.Boolean},n=>({type:V.Boolean,attributeId:n.attributeId,state:n.state})).with({type:V.Component},n=>({type:V.Component,attributeId:n.attributeId,state:n.state})).exhaustive())}function Y4(e){return()=>new Promise(t=>{const n=document.createElement("input");n.type="file",n.accept=`.${e}`,n.onchange=r=>{const i=r.target;if(!i.files||i.files.length===0){t(Kr(3));return}const o=i.files[0],a=new FileReader;a.onload=()=>{t(Lo(a.result))},a.onerror=()=>{t(Kr(4))},a.readAsText(o)},n.oncancel=()=>{t(Kr(3))},n.click()})}function J4(){return()=>navigator.clipboard.readText().then(e=>e?Lo(e):Kr(5)).catch(()=>Kr(6))}function X4(e,t){return y(e==="file"?Y4(t):J4(),BP(n=>x2(()=>JSON.parse(n),()=>0)),op(n=>n.type==="spc-stored-configuration",()=>1),op(n=>{var r;return((r=n.storedConfiguration)==null?void 0:r.schemaVersion)===1},()=>2),Ht(n=>n.storedConfiguration),Zs(n=>()=>{console.debug(`Failed to load stored configuration: ${hT[n]}`),n==4?alert("Failed to read the selected file. Maybe it is damaged."):n==1||n==0?e==="file"?alert("The selected file doesn't contain a valid configuration."):e==="clipboard"&&alert("The clipboard doesn't contain a valid configuration."):n==2?alert("The specific configuration is not supported. Maybe the configuration was created with new application version than the current one."):n==6?alert("Can't read the clipboard. Make to give a permission for reading the clipboard."):n==5&&alert("The clipboard doesn't contain a configuration.")}),eR)()}const mT=Er(e=>{const{fallback:t}=e,n=un(e),r=Gt()?"0.0":(()=>{var i;const o=M0(n);if(!o)return"Numeric Attribute not found";const a=(i=o.attribute.decision)==null?void 0:i.state;return a!=null?a.toLocaleString():t})();return $.jsx(bm,{...e,text:r})}),Q4=mT,Z4={...fr,fallback:{title:"Unselected Text",type:D.ControlType.String,defaultValue:""},...Sm("<NumericValue>")};D.addPropertyControls(mT,Z4);const eG=Object.freeze(Object.defineProperty({__proto__:null,AttributeName:_4,BooleanSelect:r4,ChoiceSelect:e4,ChoiceValueListRenderer:D4,ChoiceValueName:F4,Colorize:w4,ComponentSelect:o4,Configuration:gU,InitializationRetry:T4,NumericInput:s4,ResetConfiguration:m4,RestoreConfiguration:W4,SatisfactionIndicator:g4,ScrollIntoView:aT,SelectedNumericValue:Q4,SelectionIndicator:S4,SelectionToggle:c4,SetSelection:d4,SetSelections:h4,Singleton:$c,Slot:dT,StoreConfiguration:pT,useDebounceValue:J1,useRenderPlaceholder:Gt,useSortedChoiceValues:Oc,withFullSize:I4},Symbol.toStringTag,{value:"Module"}));exports.Configurator=_$;exports.ConfiguratorFramer=eG;exports.ConfiguratorReact=FN;
|