@viamedici-spc/configurator-framer-bundle 0.1.0 → 1.0.1
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 +1362 -14
- package/dist/index.js +26770 -6294
- package/package.json +12 -13
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),Be=require("react/jsx-runtime"),po=require("framer");function Eu(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const xu=Eu(X);var Au=globalThis&&globalThis.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Du=function(t){return function(){return{concat:function(e,n){return function(r){return t.concat(e(r),n(r))}}}}},Ou=function(t){var e=Du(t);return function(){return{concat:e().concat,empty:function(){return t.empty}}}};function $e(t){return t}function Dr(t){return function(){return t}}var Nu=Dr(null),na=Dr(void 0),Ee=na;function ne(t,e,n,r,i,o,a,u,s){switch(arguments.length){case 1:return t;case 2:return function(){return e(t.apply(this,arguments))};case 3:return function(){return n(e(t.apply(this,arguments)))};case 4:return function(){return r(n(e(t.apply(this,arguments))))};case 5:return function(){return i(r(n(e(t.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(e(t.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(e(t.apply(this,arguments)))))))};case 8:return function(){return u(a(o(i(r(n(e(t.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(i(r(n(e(t.apply(this,arguments)))))))))}}}function c(t,e,n,r,i,o,a,u,s){switch(arguments.length){case 1:return t;case 2:return e(t);case 3:return n(e(t));case 4:return r(n(e(t)));case 5:return i(r(n(e(t))));case 6:return o(i(r(n(e(t)))));case 7:return a(o(i(r(n(e(t))))));case 8:return u(a(o(i(r(n(e(t)))))));case 9:return s(u(a(o(i(r(n(e(t))))))));default:{for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}}}var we=function(t,e){var n=typeof t=="number"?function(r){return r.length>=t}:t;return function(){var r=Array.from(arguments);return n(arguments)?e.apply(this,r):function(i){return e.apply(void 0,Au([i],r,!1))}}},_u=globalThis&&globalThis.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Mu=function(t){return t._tag==="None"},$i=function(t){return t._tag==="Some"},Or={_tag:"None"},Nr=function(t){return{_tag:"Some",value:t}},$u=function(t){return t._tag==="Left"},_r=function(t){return{_tag:"Left",left:t}},Mr=function(t){return{_tag:"Right",right:t}},qu=function(t){return[t]},Pu=function(t){return t.length>0},Ru=function(t){return t[0]},ju=function(t){return t.slice(1)},Uu=[],ku={},Bu=Object.prototype.hasOwnProperty,Vu=function(t){return _u([t[0]],t.slice(1),!0)};function Fu(t,e){return function(n){return function(r){return t.ap(t.map(r,function(i){return function(o){return e.ap(i,o)}}),n)}}}function Gu(t){return function(e){return{concat:function(n,r){return t.ap(t.map(n,function(i){return function(o){return e.concat(i,o)}}),r)}}}}function ra(t,e,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,e===0?t.apply(null,i):ra(t,e-1,i)}}function Lu(t){var e=t.length;switch(e){case 1:return function(n){var r;return r={},r[t[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return u={},u[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return ra(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<e;o++)i[t[o]]=n[o];return i},e-1,[])}}function zu(t){return function(e){for(var n=Object.keys(e),r=n.length,i=Lu(n),o=t.map(e[n[0]],i),a=1;a<r;a++)o=t.ap(o,e[n[a]]);return o}}function Hu(t,e){return function(n){return function(r){return t.map(r,function(i){return e.map(i,n)})}}}function Wu(t){var e=Gu(t);return function(n){return{concat:e(n).concat,empty:t.of(n.empty)}}}function Ku(t){return function(e,n){return t.chain(e,function(r){return t.map(n(r),function(){return r})})}}function ia(t){return function(e){return function(n){return t.fromEither(Mu(n)?_r(e()):Mr(n.value))}}}function Ju(t,e){return function(n,r){return function(i){return e.chain(i,function(o){return t.fromEither(n(o)?Mr(o):_r(r(o)))})}}}var dn=function(t){return{equals:function(e,n){return e===n||t(e,n)}}},fe=function(t){return dn(function(e,n){for(var r in t)if(!t[r].equals(e[r],n[r]))return!1;return!0})},Xu={equals:function(t,e){return t===e}},Yu=function(t){return function(e,n){return e===n||t.compare(e,n)>-1?e:n}};function Qu(t,e){return t<e?-1:t>e?1:0}var Zu={equals:Xu.equals,compare:Qu},tc=Zu,ec=function(t){return{concat:Yu(t)}},nc=ec,R=Or,J=Nr;function rc(t){return function(e){return t(e)?J(e):R}}var ic=function(t,e){return c(t,x(e))},oc=function(t,e){return c(t,sc(e))},ac="Option",Ln=function(t){return{equals:function(e,n){return e===n||(re(e)?re(n):re(n)?!1:t.equals(e.value,n.value))}}},x=function(t){return function(e){return re(e)?R:J(t(e.value))}},Oe=J,sc=function(t){return function(e){return re(e)||re(t)?R:J(e.value(t.value))}},uc={URI:ac,map:ic,ap:oc,of:Oe},oa=we(2,function(t,e){return re(t)?R:e(t.value)}),cc=we(2,function(t,e){return re(t)?e():t}),vo=cc,lc=oa($e),At=function(t){return function(e){return re(e)?R:t(e.value)?e:R}},Dn=$i,re=function(t){return t._tag==="None"},fc=function(t,e){return function(n){return re(n)?t():e(n.value)}},me=fc,aa=me,dc=function(t){return function(e){return re(e)?t():e.value}},st=dc,li=lc,V=function(t){return t==null?R:J(t)},De=me(Nu,$e),yt=me(na,$e),Xt=oa,hc=Wu(uc),$r={equals:function(t,e){return t===e}},pc={equals:$r.equals,compare:function(t,e){return t<e?-1:t>e?1:0}};$r.equals,pc.compare;globalThis&&globalThis.__spreadArray;var vc=Uu,yc=Pu,mc=function(t,e){return t<0||t>=e.length},gc=function(t,e,n){if(n[t]===e)return n;var r=Vu(n);return r[t]=e,r},bc=function(t){return function(e){if(e.length===1)return e;for(var n=[wc(e)],r=Tc(e),i=function(s){n.every(function(l){return!t.equals(l,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},Sc=qu,Cc=Ru,wc=Cc,Tc=ju;globalThis&&globalThis.__spreadArray;var mr=function(t){return t.length===0},qr=yc,Ic=function(t){return function(e){if(mr(e))return fa;for(var n=[],r=0;r<e.length;r++)n.push.apply(n,t(r,e[r]));return n}},Ec=mc,xc=function(t){return function(e){for(var n=0;n<e.length;n++)if(t(e[n]))return Nr(n);return Or}};function _t(t){return function(e){for(var n=0;n<e.length;n++)if(t(e[n]))return Nr(e[n]);return Or}}var Ac=function(t,e){return function(n){return Ec(t,n)?Or:Nr(qc(t,e(n[t]),n))}},Dc=function(t,e,n){for(var r=[],i=Math.min(t.length,e.length),o=0;o<i;o++)r[o]=n(t[o],e[o]);return r};function sa(t,e){return e===void 0?function(n){return sa(n,t)}:Dc(t,e,function(n,r){return[n,r]})}function ua(t){return function(e,n){if(n===void 0){var r=ua(t);return function(a){return r(e,a)}}for(var i=function(a){return t.equals(a,e)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var an=function(t){var e=bc(t);return function(n){return qr(n)?e(n):n}},Oc=function(t){return function(e){return mr(e)?t:mr(t)?e:e.concat(t)}},L=Oc;function ca(t){var e=ua(t);return function(n,r){if(r===void 0){var i=ca(t);return function(o){return i(o,n)}}return n.filter(function(o){return!e(o,r)})}}var Nc=Sc,_c=we(2,function(t,e){return c(t,Ic(function(n,r){return e(r,n)}))}),la=_c($e),b=function(t){return function(e){return e.map(function(n){return t(n)})}},Gt=function(t){return function(e){return e.filter(t)}},Mc=function(t){return function(e){for(var n=[],r=0;r<e.length;r++){var i=t(r,e[r]);$i(i)&&n.push(i.value)}return n}},hn=function(t){return Mc(function(e,n){return t(n)})},se=hn($e),fi=function(t,e){return $c(t,function(n,r,i){return e(r,i)})},$c=function(t,e){return function(n){for(var r=n.length,i=t,o=0;o<r;o++)i=e(o,i,n[o]);return i}},qi=function(t){return dn(function(e,n){return e.length===n.length&&e.every(function(r,i){return t.equals(r,n[i])})})},qc=function(t,e,n){return qr(n)?gc(t,e,n):n},yo=function(t){return t.slice()},mo=function(t){return mr(t)?fa:t.slice()},fa=vc;function Pc(t){return function(e){return e.every(t)}}var ie=Symbol("@ts-pattern/matcher"),gr="@ts-pattern/anonymous-select-key",di=function(t){return!!(t&&typeof t=="object")},fr=function(t){return t&&!!t[ie]},Je=function t(e,n,r){if(di(e)){if(fr(e)){var i=e[ie]().match(n),o=i.matched,a=i.selections;return o&&a&&Object.keys(a).forEach(function(s){return r(s,a[s])}),o}if(!di(n))return!1;if(Array.isArray(e))return!!Array.isArray(n)&&e.length===n.length&&e.every(function(s,l){return t(s,n[l],r)});if(e instanceof Map)return n instanceof Map&&Array.from(e.keys()).every(function(s){return t(e.get(s),n.get(s),r)});if(e instanceof Set){if(!(n instanceof Set))return!1;if(e.size===0)return n.size===0;if(e.size===1){var u=Array.from(e.values())[0];return fr(u)?Array.from(n.values()).every(function(s){return t(u,s,r)}):n.has(u)}return Array.from(e.values()).every(function(s){return n.has(s)})}return Object.keys(e).every(function(s){var l,f=e[s];return(s in n||fr(l=f)&&l[ie]().matcherType==="optional")&&t(f,n[s],r)})}return Object.is(n,e)},Ne=function t(e){var n,r,i;return di(e)?fr(e)?(n=(r=(i=e[ie]()).getSelectionKeys)==null?void 0:r.call(i))!=null?n:[]:Array.isArray(e)?jn(e,t):jn(Object.values(e),t):[]},jn=function(t,e){return t.reduce(function(n,r){return n.concat(e(r))},[])};function go(t){var e;return(e={})[ie]=function(){return{match:function(n){var r={},i=function(o,a){r[o]=a};return n===void 0?(Ne(t).forEach(function(o){return i(o,void 0)}),{matched:!0,selections:r}):{matched:Je(t,n,i),selections:r}},getSelectionKeys:function(){return Ne(t)},matcherType:"optional"}},e}function bo(t){var e;return(e={})[ie]=function(){return{match:function(n){if(!Array.isArray(n))return{matched:!1};var r={};if(n.length===0)return Ne(t).forEach(function(o){r[o]=[]}),{matched:!0,selections:r};var i=function(o,a){r[o]=(r[o]||[]).concat([a])};return{matched:n.every(function(o){return Je(t,o,i)}),selections:r}},getSelectionKeys:function(){return Ne(t)}}},e}function So(){var t,e=[].slice.call(arguments);return(t={})[ie]=function(){return{match:function(n){var r={},i=function(o,a){r[o]=a};return{matched:e.every(function(o){return Je(o,n,i)}),selections:r}},getSelectionKeys:function(){return jn(e,Ne)},matcherType:"and"}},t}function Co(){var t,e=[].slice.call(arguments);return(t={})[ie]=function(){return{match:function(n){var r={},i=function(o,a){r[o]=a};return jn(e,Ne).forEach(function(o){return i(o,void 0)}),{matched:e.some(function(o){return Je(o,n,i)}),selections:r}},getSelectionKeys:function(){return jn(e,Ne)},matcherType:"or"}},t}function wo(t){var e;return(e={})[ie]=function(){return{match:function(n){return{matched:!Je(t,n,function(){})}},getSelectionKeys:function(){return[]},matcherType:"not"}},e}function ue(t){var e;return(e={})[ie]=function(){return{match:function(n){return{matched:!!t(n)}}}},e}function To(){var t,e=[].slice.call(arguments),n=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return(t={})[ie]=function(){return{match:function(i){var o,a=((o={})[n??gr]=i,o);return{matched:r===void 0||Je(r,i,function(u,s){a[u]=s}),selections:a}},getSelectionKeys:function(){return[n??gr].concat(r===void 0?[]:Ne(r))}}},t}var da=ue(function(t){return!0}),Rc=da,jc=ue(function(t){return typeof t=="string"}),Uc=ue(function(t){return typeof t=="number"}),kc=ue(function(t){return typeof t=="boolean"}),Bc=ue(function(t){return typeof t=="bigint"}),Vc=ue(function(t){return typeof t=="symbol"}),Fc=ue(function(t){return t==null}),ft={__proto__:null,optional:go,array:bo,intersection:So,union:Co,not:wo,when:ue,select:To,any:da,_:Rc,string:jc,number:Uc,boolean:kc,bigint:Bc,symbol:Vc,nullish:Fc,instanceOf:function(t){return ue(function(e){return function(n){return n instanceof e}}(t))},typed:function(){return{array:bo,optional:go,intersection:So,union:Co,not:wo,select:To,when:ue}}};function O(t){return new Gc(t,[])}var Gc=function(){function t(n,r){this.value=void 0,this.cases=void 0,this.value=n,this.cases=r}var e=t.prototype;return e.with=function(){var n=[].slice.call(arguments),r=n[n.length-1],i=[n[0]],o=[];return n.length===3&&typeof n[1]=="function"?(i.push(n[0]),o.push(n[1])):n.length>2&&i.push.apply(i,n.slice(1,n.length-1)),new t(this.value,this.cases.concat([{match:function(a){var u={},s=!!(i.some(function(l){return Je(l,a,function(f,h){u[f]=h})})&&o.every(function(l){return l(a)}));return{matched:s,value:s&&Object.keys(u).length?gr in u?u[gr]:u:a}},handler:r}]))},e.when=function(n,r){return new t(this.value,this.cases.concat([{match:function(i){return{matched:!!n(i),value:i}},handler:r}]))},e.otherwise=function(n){return new t(this.value,this.cases.concat([{match:function(r){return{matched:!0,value:r}},handler:n}])).run()},e.exhaustive=function(){return this.run()},e.run=function(){for(var n=this.value,r=void 0,i=0;i<this.cases.length;i++){var o=this.cases[i],a=o.match(this.value);if(a.matched){n=a.value,r=o.handler;break}}if(!r){var u;try{u=JSON.stringify(this.value)}catch{u=this.value}throw new Error("Pattern matching error: no pattern matches value "+u)}return r(n,this.value)},t}(),ht={equals:function(t,e){return t===e}};ht.equals;var Pi={equals:function(t,e){return t===e}};Pi.equals;var Lc=function(t){return function(e){for(var n=[],r=0;r<e.length;r++)n.push.apply(n,t(r,e[r]));return n}};function Ue(t){return _t(t)}var dr=function(t){return function(e){return e.map(function(n){return t(n)})}},zc=we(2,function(t,e){return c(t,Lc(function(n,r){return e(r,n)}))}),Hc=zc($e),Wc=function(t){return function(e){for(var n=[],r=0;r<e.length;r++){var i=t(r,e[r]);$i(i)&&n.push(i.value)}return n}},Ie=function(t){return Wc(function(e,n){return t(n)})},Kc=function(t){return function(e){return e.filter(t)}},Ri=_r,Pr=Mr,ha=function(t,e){return c(t,Xc(e))},Jc=function(t,e){return c(t,Zc(e))},ji="Either",Xc=function(t){return function(e){return _e(e)?e:Pr(t(e.right))}},Yc={URI:ji,map:ha},Qc=function(t){return function(e){return _e(e)?e:_e(t)?t:Pr(e.right(t.right))}},Zc=Qc,tl={URI:ji,map:ha,ap:Jc},el=function(t){return function(e){return _e(e)?Ri(t(e.left)):e}},pa={URI:ji,fromEither:$e},nl=ia(pa),_e=$u,rl=function(t,e){return function(n){return _e(n)?t(n.left):e(n.right)}},ke=rl;pa.fromEither;var il=function(t){return _e(t)?Pr(t.left):Ri(t.right)};function ol(t){return ne(Pr,t.of)}function al(t){return ne(Ri,t.of)}function sl(t){return Hu(t,Yc)}function ul(t){return Fu(t,tl)}function cl(t){return function(e,n){return t.chain(e,function(r){return _e(r)?t.of(r):n(r.right)})}}function ll(t){return function(e,n){return t.map(e,el(n))}}function fl(t){return function(e,n){return function(r){return t.map(r,ke(e,n))}}}function dl(t){return function(e){return function(n){return t.chain(n,function(r){return _e(r)?e(r.left):t.of(r)})}}}function hl(t){return function(e){return t.map(e,il)}}var pl=function(t){return function(){return Promise.resolve().then(t)}};function vl(t){return function(e){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(e).then(n)},t)})}}}var Rr=function(t,e){return c(t,va(e))},Ui=function(t,e){return c(t,yl(e))},va=function(t){return function(e){return function(){return Promise.resolve().then(e).then(t)}}},yl=function(t){return function(e){return function(){return Promise.all([Promise.resolve().then(e),Promise.resolve().then(t)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},zn=function(t){return function(){return Promise.resolve(t)}},ki=we(2,function(t,e){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}),Hn="Task",jr={URI:Hn,map:Rr},Bi={URI:Hn,of:zn},ml={URI:Hn,map:Rr,ap:Ui},Vi={URI:Hn,map:Rr,of:zn,ap:Ui,chain:ki},gl=$e,Io=ki,br={URI:Hn,map:Rr,of:zn,ap:Ui,chain:ki,fromIO:pl,fromTask:gl},bl=globalThis&&globalThis.__awaiter||function(t,e,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 u(f){try{l(r.next(f))}catch(h){a(h)}}function s(f){try{l(r.throw(f))}catch(h){a(h)}}function l(f){f.done?o(f.value):i(f.value).then(u,s)}l((r=r.apply(t,e||[])).next())})},Sl=globalThis&&globalThis.__generator||function(t,e){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:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(l){return function(f){return s([l,f])}}function s(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=e.call(t,n)}catch(f){l=[6,f],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},pe=al(Bi),pn=ol(Bi),Cl=zn,wl=function(t){return va(nl(t))},Sr=fl(jr),Eo=function(t,e){return function(){return bl(void 0,void 0,void 0,function(){var n;return Sl(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(Mr)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,_r(e(n))];case 3:return[2]}})})}},ya=dl(Vi),xo=hl(jr),ma=function(t,e){return c(t,Tt(e))},ga=function(t,e){return c(t,Il(e))},Tt=sl(jr),Tl=we(2,ll(jr)),ee=Tl,Il=ul(ml),ba=we(2,cl(Vi)),sn=pn,Fi="TaskEither",El={URI:Fi,map:ma,ap:ga,of:sn},Sa={URI:Fi,map:ma,ap:ga,chain:ba},Gi={URI:Fi,fromEither:Cl},xl=we(2,Ku(Sa)),Li=ia(Gi);Gi.fromEither;var Al=Ju(Gi,Sa),Dl=sn(ku),te=ba,Ol=xl,Nl=Object.getOwnPropertyNames,_l=Object.getOwnPropertySymbols,Ml=Object.prototype.hasOwnProperty;function Ao(t,e){return function(r,i,o){return t(r,i,o)&&e(r,i,o)}}function rr(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);var o=i.cache,a=o.get(n),u=o.get(r);if(a&&u)return a===r&&u===n;o.set(n,r),o.set(r,n);var s=t(n,r,i);return o.delete(n),o.delete(r),s}}function Do(t){return Nl(t).concat(_l(t))}var Ca=Object.hasOwn||function(t,e){return Ml.call(t,e)};function vn(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var wa="_owner",Oo=Object.getOwnPropertyDescriptor,No=Object.keys;function $l(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function ql(t,e){return vn(t.getTime(),e.getTime())}function _o(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),o=0,a,u;(a=i.next())&&!a.done;){for(var s=e.entries(),l=!1,f=0;(u=s.next())&&!u.done;){var h=a.value,d=h[0],y=h[1],m=u.value,v=m[0],w=m[1];!l&&!r[f]&&(l=n.equals(d,v,o,f,t,e,n)&&n.equals(y,w,d,v,t,e,n))&&(r[f]=!0),f++}if(!l)return!1;o++}return!0}function Pl(t,e,n){var r=No(t),i=r.length;if(No(e).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===wa&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Ca(e,o)||!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function In(t,e,n){var r=Do(t),i=r.length;if(Do(e).length!==i)return!1;for(var o,a,u;i-- >0;)if(o=r[i],o===wa&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Ca(e,o)||!n.equals(t[o],e[o],o,o,t,e,n)||(a=Oo(t,o),u=Oo(e,o),(a||u)&&(!a||!u||a.configurable!==u.configurable||a.enumerable!==u.enumerable||a.writable!==u.writable)))return!1;return!0}function Rl(t,e){return vn(t.valueOf(),e.valueOf())}function jl(t,e){return t.source===e.source&&t.flags===e.flags}function Mo(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),o,a;(o=i.next())&&!o.done;){for(var u=e.values(),s=!1,l=0;(a=u.next())&&!a.done;)!s&&!r[l]&&(s=n.equals(o.value,a.value,o.value,a.value,t,e,n))&&(r[l]=!0),l++;if(!s)return!1}return!0}function Ul(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var kl="[object Arguments]",Bl="[object Boolean]",Vl="[object Date]",Fl="[object Map]",Gl="[object Number]",Ll="[object Object]",zl="[object RegExp]",Hl="[object Set]",Wl="[object String]",Kl=Array.isArray,$o=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,qo=Object.assign,Jl=Object.prototype.toString.call.bind(Object.prototype.toString);function Xl(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,o=t.arePrimitiveWrappersEqual,a=t.areRegExpsEqual,u=t.areSetsEqual,s=t.areTypedArraysEqual;return function(f,h,d){if(f===h)return!0;if(f==null||h==null||typeof f!="object"||typeof h!="object")return f!==f&&h!==h;var y=f.constructor;if(y!==h.constructor)return!1;if(y===Object)return i(f,h,d);if(Kl(f))return e(f,h,d);if($o!=null&&$o(f))return s(f,h,d);if(y===Date)return n(f,h,d);if(y===RegExp)return a(f,h,d);if(y===Map)return r(f,h,d);if(y===Set)return u(f,h,d);var m=Jl(f);return m===Vl?n(f,h,d):m===zl?a(f,h,d):m===Fl?r(f,h,d):m===Hl?u(f,h,d):m===Ll?typeof f.then!="function"&&typeof h.then!="function"&&i(f,h,d):m===kl?i(f,h,d):m===Bl||m===Gl||m===Wl?o(f,h,d):!1}}function Yl(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?In:$l,areDatesEqual:ql,areMapsEqual:r?Ao(_o,In):_o,areObjectsEqual:r?In:Pl,arePrimitiveWrappersEqual:Rl,areRegExpsEqual:jl,areSetsEqual:r?Ao(Mo,In):Mo,areTypedArraysEqual:r?In:Ul};if(n&&(i=qo({},i,n(i))),e){var o=rr(i.areArraysEqual),a=rr(i.areMapsEqual),u=rr(i.areObjectsEqual),s=rr(i.areSetsEqual);i=qo({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:u,areSetsEqual:s})}return i}function Ql(t){return function(e,n,r,i,o,a,u){return t(e,n,u)}}function Zl(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(s,l){var f=r(),h=f.cache,d=h===void 0?e?new WeakMap:void 0:h,y=f.meta;return n(s,l,{cache:d,equals:i,meta:y,strict:o})};if(e)return function(s,l){return n(s,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(s,l){return n(s,l,a)}}var tf=qe();qe({strict:!0});qe({circular:!0});qe({circular:!0,strict:!0});qe({createInternalComparator:function(){return vn}});qe({strict:!0,createInternalComparator:function(){return vn}});qe({circular:!0,createInternalComparator:function(){return vn}});qe({circular:!0,createInternalComparator:function(){return vn},strict:!0});function qe(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,a=o===void 0?!1:o,u=Yl(t),s=Xl(u),l=r?r(s):Ql(s);return Zl({circular:n,comparator:s,createState:i,equals:l,strict:a})}function Ta(t){return function(e,n){if(n===void 0){var r=Ta(t);return function(o){return r(o,e)}}for(var i in e)if(!Bu.call(n,i)||!t.equals(e[i],n[i]))return!1;return!0}}function ef(t){var e=Ta(t);return dn(function(n,r){return e(n)(r)&&e(r)(n)})}function nf(t){return ne(J,t.of)}function rf(t){return Dr(t.of(R))}function of(t){var e=rf(t);return function(n,r){return t.chain(n,me(function(){return e()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var af=nf(Bi),sf=zn,uf=we(2,of(Vi)),cf=uf,lf=Ou,qn=c,ff=lf(hc({concat:nc(tc).concat,empty:0}))();function df(t){return function(e){return e.iterNumber>=t?R:J(0)}}function hf(t,e){return function(n){return qn(n,e,x(function(r){return Math.min(t,r)}))}}function pf(t){return function(e){return J(t*Math.pow(2,e.iterNumber))}}var vf={iterNumber:0,cumulativeDelay:0,previousDelay:R};function yf(t,e){var n=t(e);return{iterNumber:e.iterNumber+1,cumulativeDelay:e.cumulativeDelay+st(function(){return 0})(n),previousDelay:n}}function mf(t,e){var n=yf(t,e);return qn(n.previousDelay,aa(function(){return br.of(n)},function(r){return vl(r)(br.of(n))}))}function Qe(t,e,n){var r=function(i){return qn(i,e,Io(function(o){return n(o)?qn(mf(t,i),Io(function(a){return qn(a.previousDelay,aa(function(){return br.of(o)},function(){return r(a)}))})):br.of(o)}))};return r(vf)}function gf(t){return e=>c(e,Tt(n=>(t(n)(),n)))}const Un=gf;function Cr(t){return e=>c(e,xo,Un(t),xo)}function bf(t){return e=>c(e,Un(n=>()=>t(n)()),Cr(n=>()=>t(n)()))}function Sf(t){return e=>c(e,x(n=>(t(n)(),n)))}const Cf=Sf;function zi(t){return{equals(e,n){return e==null&&n==null?!0:e==null||n===null||n===void 0?!1:t.equals(e,n)}}}function Wn(t){return{equals(e,n){const r=c(V(e),st(()=>[])),i=c(V(n),st(()=>[]));return qi(t).equals(r,i)}}}const Xe=fe({localId:ht,componentPath:Wn(ht),sharedConfigurationModelId:zi(ht)}),Ia=fe({localId:ht,configurationModelId:ht}),Ea=dn((t,e)=>O({x:t,y:e}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>wf.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>Tf.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>If.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>Ef.equals(n.x,n.y)).otherwise(()=>!1)),wf=fe({type:ht,attributeId:Xe,state:ht,choiceValueId:ht}),Tf=fe({type:ht,attributeId:Xe,state:ht}),If=fe({type:ht,attributeId:Xe,state:$r}),Ef=fe({type:ht,attributeId:Xe,state:Pi});var Rt=(t=>(t.whyIsNotSatisfied="why-is-not-satisfied",t.whyIsStateNotPossible="why-is-state-not-possible",t))(Rt||{}),jt=(t=>(t.choiceValue="choice-value",t.component="component",t.boolean="boolean",t.numeric="numeric",t.configuration="configuration",t.attribute="attribute",t))(jt||{}),un=(t=>(t.Rule="Rule",t.Cardinality="Cardinality",t.Component="Component",t))(un||{}),kn=(t=>(t.all="all",t.none="none",t.specific="specific",t))(kn||{}),ge=(t=>(t.Channel="Channel",t.Package="Package",t))(ge||{}),it=(t=>(t.Boolean="Boolean",t.Numeric="Numeric",t.Choice="Choice",t.Component="Component",t))(it||{}),be=(t=>(t.Included="Included",t.Excluded="Excluded",t))(be||{}),Me=(t=>(t.Included="Included",t.Excluded="Excluded",t))(Me||{}),Se=(t=>(t.Implicit="Implicit",t.Explicit="Explicit",t))(Se||{}),Fe=(t=>(t.Mandatory="Mandatory",t.Optional="Optional",t))(Fe||{}),Ge=(t=>(t.Always="Always",t.Optional="Optional",t))(Ge||{});const xf=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:kn,AttributeType:it,ChoiceValueDecisionState:be,ComponentDecisionState:Me,ConfigurationModelSourceType:ge,ConstraintType:un,DecisionKind:Se,ExplainQuestionSubject:jt,ExplainQuestionType:Rt,Inclusion:Ge,Selection:Fe,eqCausedByDecision:Ea,eqGlobalAttributeId:Xe,eqGlobalConstraintId:Ia},Symbol.toStringTag,{value:"Module"}));var wt=(t=>(t.Unknown="Unknown",t.CommunicationError="Local.LowLevelCommunicationError",t.ServiceError="ServiceError",t.ConfigurationConflict="ConfigurationConflict",t.ConfigurationUnauthenticated="ConfigurationUnauthenticated",t.ConfigurationUnauthorized="ConfigurationUnauthorized",t.ConfigurationApplicationError="ConfigurationApplicationError",t.ConfigurationTimeout="ConfigurationTimeout",t.ConfigurationModelNotFound="ConfigurationModelNotFound",t.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",t.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",t.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",t.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",t.DecisionsToRespectInvalid="DecisionsToRespectInvalid",t.ConfigurationModelInvalid="ConfigurationModelInvalid",t.ConfigurationInitializationFailure="ConfigurationInitializationFailure",t.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",t.ConfigurationSetManyConflict="ConfigurationSetManyConflict",t))(wt||{}),Ur=(t=>(t[t.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",t))(Ur||{});const xa={createConfigurationRejectedDecisionsConflict(t){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:t}}},Af=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationConflictReason:Ur,FailureResultFactory:xa,FailureType:wt},Symbol.toStringTag,{value:"Module"}));class Aa{mapToCreateSessionRequest(e){return{configurationModelSource:this.mapToConfigurationModelSource(e.configurationModelSource),attributeRelations:this.mapToAttributeRelations(e.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(e.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(e.allowedInExplain)}}mapToConfigurationModelSource(e){return O(e).with({type:ge.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:ge.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(e){return c(e,V,x(ne(b(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),yt)}mapToDecisionsToRespect(e){return{attributeId:e.attributeId,decisions:c([...e.decisions],dr(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(e){return c(V(e),yt)}mapToGlobalAttributeId(e){return{localId:e.localId,componentPath:e.componentPath,sharedConfigurationModelId:e.sharedConfigurationModelId}}mapToAllowedInExplain(e){return O(e).with({rules:{type:kn.none}},n=>({rules:{type:"AllowedRulesNone"}})).with({rules:{type:kn.specific,rules:ft.array(ft.any)}},n=>({rules:{type:"AllowedRulesSpecific",rules:c(n.rules.rules,b(r=>this.mapToGlobalConstraintId(r)),r=>[...r])}})).otherwise(()=>({rules:{type:"AllowedRulesAll"}}))}mapToGlobalConstraintId(e){return{localId:e.localId,configurationModelId:e.configurationModelId}}}function Df(t){return e=>Al(n=>n!=null,t)(e)}function Of(){return pn(Ee())}var Kt=(t=>(t.whyIsNotSatisfied="why-is-not-satisfied",t.whyIsStateNotPossible="why-is-state-not-possible",t))(Kt||{}),Ve=(t=>(t.decisions="decisions",t.constraints="constraints",t.all="all",t))(Ve||{}),Mt=(t=>(t.choiceValue="choice-value",t.component="component",t.boolean="boolean",t.numeric="numeric",t.configuration="configuration",t.attribute="attribute",t))(Mt||{});const Pt=fe({localId:ht,componentPath:Wn(ht),sharedConfigurationModel:zi(ht)}),Nf=Ln(qi(fe({attributeId:Pt,decisions:Wn(Pt)}))),_f=fe({configurationModelSource:dn((t,e)=>tf(t,e)),decisionsToRespect:Nf,usageRuleParameters:ef(ht)});var Bn=(t=>(t.Channel="Channel",t.Package="Package",t))(Bn||{}),ot=(t=>(t.Boolean="Boolean",t.Numeric="Numeric",t.Choice="Choice",t.Component="Component",t))(ot||{}),B=(t=>(t.Boolean="Boolean",t.Numeric="Numeric",t.ChoiceValue="ChoiceValue",t.Component="Component",t))(B||{}),It=(t=>(t.Included="Included",t.Excluded="Excluded",t))(It||{}),St=(t=>(t.Implicit="Implicit",t.Explicit="Explicit",t))(St||{}),Le=(t=>(t.Mandatory="Mandatory",t.Optional="Optional",t))(Le||{}),ze=(t=>(t.Always="Always",t.Optional="Optional",t))(ze||{});const Mf={equals:(t,e)=>t.choiceValueId!==e.choiceValueId?!1:Ln(ht).equals(t.state,e.state)},$f={equals(t,e){return Ln($r).equals(t.value,e.value)}},qf={equals(t,e){return Ln(Pi).equals(t.value,e.value)}},Pf={equals(t,e){return Ln(ht).equals(t.state,e.state)}},Rf={equals(t,e){return Pt.equals(t.attributeId,e.attributeId)?O({x:t,y:e}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>qf.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>$f.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>Pf.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>Mf.equals(r.x,r.y)).otherwise(()=>!1):!1}},jf=qi(Rf),Uf={equals:(t,e)=>jf.equals(t.decisions,e.decisions)&&kf.equals(t.mode,e.mode)},kf={equals:(t,e)=>O({x:t,y:e}).with({x:{type:"Default"},y:{type:"Default"}},n=>!0).with({x:{type:"DropExistingDecisions"},y:{type:"DropExistingDecisions"}},n=>!0).otherwise(()=>!1)};var hi=(t=>(t.NotAvailable="NotAvailable",t.StateNotPossible="StateNotPossible",t))(hi||{}),cn=(t=>(t.Rule="Rule",t.Cardinality="Cardinality",t.Component="Component",t))(cn||{}),j=(t=>(t.ServiceError="ServiceError",t.Unknown="Unknown",t.CommunicationError="CommunicationError",t.ConfigurationConflict="ConfigurationConflict",t.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",t.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",t.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",t.ConfigurationUnauthenticated="ConfigurationUnauthenticated",t.ConfigurationApplicationError="ConfigurationApplicationError",t.ConfigurationTimeout="ConfigurationTimeout",t.ConfigurationModelNotFound="ConfigurationModelNotFound",t.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",t.ConfigurationSetManyConflict="ConfigurationSetManyConflict",t.DecisionsToRespectInvalid="DecisionsToRespectInvalid",t.ConfigurationModelInvalid="ConfigurationModelInvalid",t.ConfigurationInitializationFailure="ConfigurationInitializationFailure",t.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",t))(j||{}),Hi=(t=>(t[t.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",t))(Hi||{});const Bf={createConfigurationRejectedDecisionsConflict(t){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:t}}};function Vf(t,e){console.log(`--------------------------------------------------------------------------------
|
|
2
|
-
-- ${
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),$=require("react/jsx-runtime"),P=require("framer"),ab=require("react-dom"),T1=require("framer-motion");function sb(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=sb(O),I1=sb(ab);var A1=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},$1=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},O1=function(e){var t=$1(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function ti(e){return e}function ml(e){return function(){return e}}var D1=ml(null),ub=ml(void 0),qr=ub;function Xn(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 C(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return s(a(o(i(r(n(t(e)))))));case 9:return u(s(a(o(i(r(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var Dr=function(e,t){var n=typeof e=="number"?function(r){return r.length>=e}:e;return function(){var r=Array.from(arguments);return n(arguments)?t.apply(this,r):function(i){return t.apply(void 0,A1([i],r,!1))}}},N1=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},P1=function(e){return e._tag==="None"},Kp=function(e){return e._tag==="Some"},yl={_tag:"None"},gl=function(e){return{_tag:"Some",value:e}},R1=function(e){return e._tag==="Left"},bl=function(e){return{_tag:"Left",left:e}},Sl=function(e){return{_tag:"Right",right:e}},k1=function(e){return[e]},M1=function(e){return e.length>0},j1=function(e){return e[0]},_1=function(e){return e.slice(1)},q1=[],F1={},L1=Object.prototype.hasOwnProperty,V1=function(e){return N1([e[0]],e.slice(1),!0)};function B1(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function U1(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function cb(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):cb(e,t-1,i)}}function G1(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return cb(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function z1(e){return function(t){for(var n=Object.keys(t),r=n.length,i=G1(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function W1(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function H1(e){var t=U1(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function lb(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var K1=function(e){return function(){return Promise.resolve().then(e)}};function Y1(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var Cl=function(e,t){return C(e,fb(t))},Yp=function(e,t){return C(e,X1(t))},fb=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},X1=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},ru=function(e){return function(){return Promise.resolve(e)}},Xp=Dr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),iu="Task",wl={URI:iu,map:Cl},Jp={URI:iu,of:ru},J1={URI:iu,map:Cl,ap:Yp},Qp={URI:iu,map:Cl,of:ru,ap:Yp,chain:Xp},Q1=ti,Wv=Xp,Nc={URI:iu,map:Cl,of:ru,ap:Yp,chain:Xp,fromIO:K1,fromTask:Q1};function db(e){return function(t){return function(n){return e.fromEither(P1(n)?bl(t()):Sl(n.value))}}}function Z1(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Sl(o):bl(r(o)))})}}}var Zp=bl,xl=Sl,pb=function(e,t){return C(e,tE(t))},eE=function(e,t){return C(e,iE(t))},eh="Either",tE=function(e){return function(t){return Ii(t)?t:xl(e(t.right))}},nE={URI:eh,map:pb},rE=function(e){return function(t){return Ii(t)?t:Ii(e)?e:xl(t.right(e.right))}},iE=rE,oE={URI:eh,map:pb,ap:eE},aE=function(e){return function(t){return Ii(t)?Zp(e(t.left)):t}},hb={URI:eh,fromEither:ti},sE=db(hb),Ii=R1,uE=function(e,t){return function(n){return Ii(n)?e(n.left):t(n.right)}},Qi=uE;hb.fromEither;var cE=function(e){return Ii(e)?xl(e.left):Zp(e.right)},On=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},yn=function(e){return On(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},Hv=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return On(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},th={equals:function(e,t){return e===t}};th.equals;var lE=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function fE(e,t){return e<t?-1:e>t?1:0}var dE={equals:th.equals,compare:fE},pE=dE,hE=function(e){return{concat:lE(e)}},vE=hE,Kv=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},mE=q1,yE=M1,gE=function(e,t){return e<0||e>=t.length},bE=function(e){return function(t){return Kv(Kv([],t,!0),[e],!1)}},SE=bE,CE=function(e,t,n){if(n[e]===t)return n;var r=V1(n);return r[e]=t,r},wE=function(e){return function(t){if(t.length===1)return t;for(var n=[TE(t)],r=IE(t),i=function(u){n.every(function(c){return!e.equals(c,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},xE=k1,EE=j1,TE=EE,IE=_1,El={equals:function(e,t){return e===t}},AE={equals:El.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};El.equals,AE.compare;globalThis&&globalThis.__spreadArray;var Pc=function(e){return e.length===0},ou=yE,$E=SE,OE=function(e){return function(t){if(Pc(t))return ih;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},vb=gE,DE=function(e){return function(t){return vb(e,t)?t:e===0?ih:t.slice(0,e)}},NE=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return gl(n);return yl}};function fn(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return gl(t[n]);return yl}}var PE=function(e,t){return function(n){return vb(e,n)?yl:gl(_E(e,t(n[e]),n))}};function nh(e){return function(t,n){if(n===void 0){var r=nh(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 oa=function(e){var t=wE(e);return function(n){return ou(n)?t(n):n}},RE=function(e){return function(t){return Pc(t)?e:Pc(e)?t:t.concat(e)}},Ne=RE;function mb(e){var t=nh(e);return function(n,r){if(r===void 0){var i=mb(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var kE=xE,yb=Dr(2,function(e,t){return C(e,OE(function(n,r){return t(r,n)}))}),rh=yb(ti),z=function(e){return function(t){return t.map(function(n){return e(n)})}},zt=function(e){return function(t){return t.filter(e)}},ME=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Kp(i)&&n.push(i.value)}return n}},No=function(e){return ME(function(t,n){return e(n)})},Kn=No(ti),dd=function(e,t){return jE(e,function(n,r,i){return t(r,i)})},jE=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}},qi=function(e){return On(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},_E=function(e,t,n){return ou(n)?CE(e,t,n):n},pd=function(e){return e.slice()},Yv=function(e){return Pc(e)?ih:e.slice()},ih=mE,qE=yb,FE=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 Yi(e){return fn(e)}var uc=function(e){return function(t){return t.map(function(n){return e(n)})}},LE=Dr(2,function(e,t){return C(e,FE(function(n,r){return t(r,n)}))}),VE=LE(ti),BE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Kp(i)&&n.push(i.value)}return n}},oi=function(e){return BE(function(t,n){return e(n)})},UE=function(e){return function(t){return t.filter(e)}},gb=function(e){return function(t){return Xn(e,t)}},GE=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ge=yl,je=gl;function au(e){return function(t){return e(t)?je(t):ge}}var bb=function(e,t){return C(e,ee(t))},Sb=function(e,t){return C(e,zE(t))},Cb="Option",Po=function(e){return{equals:function(t,n){return t===n||(br(t)?br(n):br(n)?!1:e.equals(t.value,n.value))}}},ee=function(e){return function(t){return br(t)?ge:je(e(t.value))}},bi=je,zE=function(e){return function(t){return br(t)||br(e)?ge:je(t.value(e.value))}},WE={URI:Cb,map:bb,ap:Sb,of:bi},oh=Dr(2,function(e,t){return br(e)?ge:t(e.value)}),HE={URI:Cb,map:bb,ap:Sb,chain:oh},KE=Dr(2,function(e,t){return br(e)?t():e}),Xv=KE,YE=oh(ti),Ht=function(e){return function(t){return br(t)?ge:e(t.value)?t:ge}},ss=Kp,br=function(e){return e._tag==="None"},XE=function(e,t){return function(n){return br(n)?e():t(n.value)}},Ai=XE,wb=Ai,JE=function(e){return function(t){return br(t)?e():t.value}},ut=JE,hd=YE,QE=Dr(2,lb(HE)),Se=function(e){return e==null?ge:je(e)},rr=Ai(D1,ti),kt=Ai(ub,ti),ir=oh,ZE=QE,eT=H1(WE);function tT(e){return Xn(xl,e.of)}function nT(e){return Xn(Zp,e.of)}function rT(e){return W1(e,nE)}function iT(e){return B1(e,oE)}function oT(e){return function(t,n){return e.chain(t,function(r){return Ii(r)?e.of(r):n(r.right)})}}function aT(e){return function(t,n){return e.map(t,aE(n))}}function sT(e){return function(t,n){return function(r){return e.map(r,Qi(t,n))}}}function uT(e){return function(t){return function(n){return e.chain(n,function(r){return Ii(r)?t(r.left):e.of(r)})}}}function cT(e){return function(t){return e.map(t,cE)}}var lT=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(l){try{c(r.next(l))}catch(f){a(f)}}function u(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((r=r.apply(e,t||[])).next())})},fT=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Si=nT(Jp),Na=tT(Jp),dT=ru,pT=function(e){return fb(sE(e))},Rc=sT(wl),Jv=function(e,t){return function(){return lT(void 0,void 0,void 0,function(){var n;return fT(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Sl)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,bl(t(n))];case 3:return[2]}})})}},xb=uT(Qp),Qv=cT(wl),Eb=function(e,t){return C(e,Kt(t))},Tb=function(e,t){return C(e,vT(t))},Kt=rT(wl),hT=Dr(2,aT(wl)),mr=hT,vT=iT(J1),Ib=Dr(2,oT(Qp)),aa=Na,ah="TaskEither",mT={URI:ah,map:Eb,ap:Tb,of:aa},Ab={URI:ah,map:Eb,ap:Tb,chain:Ib},sh={URI:ah,fromEither:dT},yT=Dr(2,lb(Ab)),uh=db(sh);sh.fromEither;var gT=Z1(sh,Ab),bT=aa(F1),hr=Ib,ST=yT;function CT(e){return t=>C(t,Kt(n=>(e(n)(),n)))}const Ns=CT;function kc(e){return t=>C(t,Qv,Ns(e),Qv)}function wT(e){return t=>C(t,Ns(n=>()=>e(n)()),kc(n=>()=>e(n)()))}function xT(e){return t=>C(t,ee(n=>(e(n)(),n)))}const ET=xT;function TT(e){return Xn(je,e.of)}function IT(e){return ml(e.of(ge))}function AT(e){var t=IT(e);return function(n,r){return e.chain(n,Ai(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var $T=TT(Jp),OT=ru,DT=Dr(2,AT(Qp)),NT=DT,PT=O1,ft={equals:function(e,t){return e===t}};ft.equals;function $b(e){return function(t,n){if(n===void 0){var r=$b(e);return function(o){return r(o,t)}}for(var i in t)if(!L1.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function Ob(e){var t=$b(e);return On(function(n,r){return t(n)(r)&&t(r)(n)})}function su(e){return On((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var ch={equals:function(e,t){return e===t}};ch.equals;const Rn=Symbol.for("@ts-pattern/matcher"),Db=Symbol.for("@ts-pattern/isVariadic"),Mc="@ts-pattern/anonymous-select-key",vd=e=>!!(e&&typeof e=="object"),cc=e=>e&&!!e[Rn],vn=(e,t,n)=>{if(cc(e)){const r=e[Rn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(vd(e)){if(!vd(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];cc(s)&&s[Db]?o.push(s):o.length?i.push(s):r.push(s)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<r.length+i.length)return!1;const a=t.slice(0,r.length),s=i.length===0?[]:t.slice(-i.length),u=t.slice(r.length,i.length===0?1/0:-i.length);return r.every((c,l)=>vn(c,a[l],n))&&i.every((c,l)=>vn(c,s[l],n))&&(o.length===0||vn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>vn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||cc(o=i)&&o[Rn]().matcherType==="optional")&&vn(i,t[r],n);var o})}return Object.is(t,e)},Wn=e=>{var t,n,r;return vd(e)?cc(e)?(t=(n=(r=e[Rn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?Ps(e,Wn):Ps(Object.values(e),Wn):[]},Ps=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function RT(...e){if(e.length===1){const[t]=e;return n=>vn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return vn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function wn(e){return Object.assign(e,{optional:()=>lh(e),and:t=>xt(e,t),or:t=>Nb(e,t),select:t=>t===void 0?Rs(e):Rs(t,e)})}function md(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[Db]:!0})}}))(e),{optional:()=>md(lh(e)),select:t=>md(t===void 0?Rs(e):Rs(t,e))})}function lh(e){return wn({[Rn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Wn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:vn(e,t,r),selections:n}},getSelectionKeys:()=>Wn(e),matcherType:"optional"})})}const kT=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},MT=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function xt(...e){return wn({[Rn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>vn(i,t,r)),selections:n}},getSelectionKeys:()=>Ps(e,Wn),matcherType:"and"})})}function Nb(...e){return wn({[Rn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return Ps(e,Wn).forEach(i=>r(i,void 0)),{matched:e.some(i=>vn(i,t,r)),selections:n}},getSelectionKeys:()=>Ps(e,Wn),matcherType:"or"})})}function Ye(e){return{[Rn]:()=>({match:t=>({matched:!!e(t)})})}}function Rs(...e){const t=typeof e[0]=="string"?e[0]:void 0,n=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return wn({[Rn]:()=>({match:r=>{let i={[t??Mc]:r};return{matched:n===void 0||vn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??Mc].concat(n===void 0?[]:Wn(n))})})}function Cr(e){return typeof e=="number"}function Zi(e){return typeof e=="string"}function ui(e){return typeof e=="bigint"}const Pb=wn(Ye(function(e){return!0})),jT=Pb,eo=e=>Object.assign(wn(e),{startsWith:t=>{return eo(xt(e,(n=t,Ye(r=>Zi(r)&&r.startsWith(n)))));var n},endsWith:t=>{return eo(xt(e,(n=t,Ye(r=>Zi(r)&&r.endsWith(n)))));var n},minLength:t=>eo(xt(e,(n=>Ye(r=>Zi(r)&&r.length>=n))(t))),maxLength:t=>eo(xt(e,(n=>Ye(r=>Zi(r)&&r.length<=n))(t))),includes:t=>{return eo(xt(e,(n=t,Ye(r=>Zi(r)&&r.includes(n)))));var n},regex:t=>{return eo(xt(e,(n=t,Ye(r=>Zi(r)&&!!r.match(n)))));var n}}),_T=eo(Ye(Zi)),wr=e=>Object.assign(wn(e),{between:(t,n)=>wr(xt(e,((r,i)=>Ye(o=>Cr(o)&&r<=o&&i>=o))(t,n))),lt:t=>wr(xt(e,(n=>Ye(r=>Cr(r)&&r<n))(t))),gt:t=>wr(xt(e,(n=>Ye(r=>Cr(r)&&r>n))(t))),lte:t=>wr(xt(e,(n=>Ye(r=>Cr(r)&&r<=n))(t))),gte:t=>wr(xt(e,(n=>Ye(r=>Cr(r)&&r>=n))(t))),int:()=>wr(xt(e,Ye(t=>Cr(t)&&Number.isInteger(t)))),finite:()=>wr(xt(e,Ye(t=>Cr(t)&&Number.isFinite(t)))),positive:()=>wr(xt(e,Ye(t=>Cr(t)&&t>0))),negative:()=>wr(xt(e,Ye(t=>Cr(t)&&t<0)))}),qT=wr(Ye(Cr)),ci=e=>Object.assign(wn(e),{between:(t,n)=>ci(xt(e,((r,i)=>Ye(o=>ui(o)&&r<=o&&i>=o))(t,n))),lt:t=>ci(xt(e,(n=>Ye(r=>ui(r)&&r<n))(t))),gt:t=>ci(xt(e,(n=>Ye(r=>ui(r)&&r>n))(t))),lte:t=>ci(xt(e,(n=>Ye(r=>ui(r)&&r<=n))(t))),gte:t=>ci(xt(e,(n=>Ye(r=>ui(r)&&r>=n))(t))),positive:()=>ci(xt(e,Ye(t=>ui(t)&&t>0))),negative:()=>ci(xt(e,Ye(t=>ui(t)&&t<0)))}),FT=ci(Ye(ui)),LT=wn(Ye(function(e){return typeof e=="boolean"})),VT=wn(Ye(function(e){return typeof e=="symbol"})),BT=wn(Ye(function(e){return e==null}));var Ct={__proto__:null,matcher:Rn,optional:lh,array:function(...e){return md({[Rn]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const n=e[0];let r={};if(t.length===0)return Wn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>vn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Wn(e[0])})})},set:function(...e){return wn({[Rn]:()=>({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:kT(t,o=>vn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Wn(e[0])})})},map:function(...e){return wn({[Rn]:()=>({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:MT(t,(s,u)=>{const c=vn(o,u,r),l=vn(a,s,r);return c&&l}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Wn(e[0]),...Wn(e[1])]})})},intersection:xt,union:Nb,not:function(e){return wn({[Rn]:()=>({match:t=>({matched:!vn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Ye,select:Rs,any:Pb,_:jT,string:_T,number:qT,bigint:FT,boolean:LT,symbol:VT,nullish:BT,instanceOf:function(e){return wn(Ye(function(t){return n=>n instanceof t}(e)))},shape:function(e){return wn(Ye(RT(e)))}};const yd={matched:!1,value:void 0};function ue(e){return new UT(e,yd)}let UT=class gd{constructor(t,n){this.input=void 0,this.state=void 0,this.input=t,this.state=n}with(...t){if(this.state.matched)return this;const n=t[t.length-1],r=[t[0]];let i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&r.push(...t.slice(1,t.length-1));let o=!1,a={};const s=(c,l)=>{o=!0,a[c]=l},u=!r.some(c=>vn(c,this.input,s))||i&&!i(this.input)?yd:{matched:!0,value:n(o?Mc in a?a[Mc]:a:this.input,this.input)};return new gd(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new gd(this.input,r?{matched:!0,value:n(this.input,this.input)}:yd)}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 GT=Object.getOwnPropertyNames,zT=Object.getOwnPropertySymbols,WT=Object.prototype.hasOwnProperty;function Zv(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Du(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 em(e){return GT(e).concat(zT(e))}var Rb=Object.hasOwn||function(e,t){return WT.call(e,t)};function Pa(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var kb="_owner",tm=Object.getOwnPropertyDescriptor,nm=Object.keys;function HT(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 KT(e,t){return Pa(e.getTime(),t.getTime())}function rm(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var u=t.entries(),c=!1,l=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],p=f[1],h=s.value,v=h[0],x=h[1];!c&&!r[l]&&(c=n.equals(d,v,o,l,e,t,n)&&n.equals(p,x,d,v,e,t,n))&&(r[l]=!0),l++}if(!c)return!1;o++}return!0}function YT(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===kb&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Rb(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function Qa(e,t,n){var r=em(e),i=r.length;if(em(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===kb&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Rb(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=tm(e,o),s=tm(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function XT(e,t){return Pa(e.valueOf(),t.valueOf())}function JT(e,t){return e.source===t.source&&e.flags===t.flags}function im(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var s=t.values(),u=!1,c=0;(a=s.next())&&!a.done;)!u&&!r[c]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[c]=!0),c++;if(!u)return!1}return!0}function QT(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 ZT="[object Arguments]",eI="[object Boolean]",tI="[object Date]",nI="[object Map]",rI="[object Number]",iI="[object Object]",oI="[object RegExp]",aI="[object Set]",sI="[object String]",uI=Array.isArray,om=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,am=Object.assign,cI=Object.prototype.toString.call.bind(Object.prototype.toString);function lI(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,u=e.areTypedArraysEqual;return function(l,f,d){if(l===f)return!0;if(l==null||f==null||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;var p=l.constructor;if(p!==f.constructor)return!1;if(p===Object)return i(l,f,d);if(uI(l))return t(l,f,d);if(om!=null&&om(l))return u(l,f,d);if(p===Date)return n(l,f,d);if(p===RegExp)return a(l,f,d);if(p===Map)return r(l,f,d);if(p===Set)return s(l,f,d);var h=cI(l);return h===tI?n(l,f,d):h===oI?a(l,f,d):h===nI?r(l,f,d):h===aI?s(l,f,d):h===iI?typeof l.then!="function"&&typeof f.then!="function"&&i(l,f,d):h===ZT?i(l,f,d):h===eI||h===rI||h===sI?o(l,f,d):!1}}function fI(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?Qa:HT,areDatesEqual:KT,areMapsEqual:r?Zv(rm,Qa):rm,areObjectsEqual:r?Qa:YT,arePrimitiveWrappersEqual:XT,areRegExpsEqual:JT,areSetsEqual:r?Zv(im,Qa):im,areTypedArraysEqual:r?Qa:QT};if(n&&(i=am({},i,n(i))),t){var o=Du(i.areArraysEqual),a=Du(i.areMapsEqual),s=Du(i.areObjectsEqual),u=Du(i.areSetsEqual);i=am({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function dI(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function pI(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,c){var l=r(),f=l.cache,d=f===void 0?t?new WeakMap:void 0:f,p=l.meta;return n(u,c,{cache:d,equals:i,meta:p,strict:o})};if(t)return function(u,c){return n(u,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(u,c){return n(u,c,a)}}var hI=Fi();Fi({strict:!0});Fi({circular:!0});Fi({circular:!0,strict:!0});Fi({createInternalComparator:function(){return Pa}});Fi({strict:!0,createInternalComparator:function(){return Pa}});Fi({circular:!0,createInternalComparator:function(){return Pa}});Fi({circular:!0,createInternalComparator:function(){return Pa},strict:!0});function Fi(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=fI(e),u=lI(s),c=r?r(u):dI(u);return pI({circular:n,comparator:u,createState:i,equals:c,strict:a})}function vI(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 mI(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),vI(e)}var Ss=C,yI=PT(eT({concat:vE(pE).concat,empty:0}))();function gI(e){return function(t){return t.iterNumber>=e?ge:je(0)}}function bI(e,t){return function(n){return Ss(n,t,ee(function(r){return Math.min(e,r)}))}}function SI(e){return function(t){return je(e*Math.pow(2,t.iterNumber))}}var CI={iterNumber:0,cumulativeDelay:0,previousDelay:ge};function wI(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+ut(function(){return 0})(n),previousDelay:n}}function xI(e,t){var n=wI(e,t);return Ss(n.previousDelay,wb(function(){return Nc.of(n)},function(r){return Y1(r)(Nc.of(n))}))}function Fo(e,t,n){var r=function(i){return Ss(i,t,Wv(function(o){return n(o)?Ss(xI(e,i),Wv(function(a){return Ss(a.previousDelay,wb(function(){return Nc.of(o)},function(){return r(a)}))})):Nc.of(o)}))};return r(CI)}var sm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ks={};Object.defineProperty(ks,"__esModule",{value:!0});ks.isGuid=jb=ks.guid=void 0;var EI=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+=um()+"-";for(o+=r,o+=t;o.length<i;)o+=um();return o.substring(0,i)},jb=ks.guid=EI,um=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},TI=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=II(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"};ks.isGuid=TI;var II=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function fh(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function Tl(e){return{equals(t,n){const r=C(Se(t),ut(()=>[])),i=C(Se(n),ut(()=>[]));return qi(e).equals(r,i)}}}const Ro=yn({localId:ft,componentPath:Tl(ft),sharedConfigurationModelId:fh(ft)}),dh=yn({localId:ft,configurationModelId:ft}),_b=On((e,t)=>ue({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>AI.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>$I.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>OI.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>DI.equals(n.x,n.y)).otherwise(()=>!1)),AI=yn({type:ft,attributeId:Ro,state:ft,choiceValueId:ft}),$I=yn({type:ft,attributeId:Ro,state:ft}),OI=yn({type:ft,attributeId:Ro,state:El}),DI=yn({type:ft,attributeId:Ro,state:ch});var Cn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Cn||{}),Ut=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Ut||{}),da=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(da||{}),an=(e=>(e.all="all",e.none="none",e.specific="specific",e))(an||{}),zr=(e=>(e.Channel="Channel",e.Package="Package",e))(zr||{}),Oe=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(Oe||{}),Wr=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Wr||{}),$i=(e=>(e.Included="Included",e.Excluded="Excluded",e))($i||{}),$r=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))($r||{}),Ar=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Ar||{}),Oi=(e=>(e.Always="Always",e.Optional="Optional",e))(Oi||{});const NI=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:an,AttributeType:Oe,ChoiceValueDecisionState:Wr,ComponentDecisionState:$i,ConfigurationModelSourceType:zr,ConstraintType:da,DecisionKind:$r,ExplainQuestionSubject:Ut,ExplainQuestionType:Cn,Inclusion:Oi,Selection:Ar,eqCausedByDecision:_b,eqGlobalAttributeId:Ro,eqGlobalConstraintId:dh},Symbol.toStringTag,{value:"Module"}));var Bt=(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))(Bt||{}),Il=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Il||{});const qb={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}},PI=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationConflictReason:Il,FailureResultFactory:qb,FailureType:Bt},Symbol.toStringTag,{value:"Module"}));let Fb=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:zr.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:zr.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return C(t,Se,ee(Xn(z(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),kt)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:C([...t.decisions],uc(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return C(Se(t),kt)}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:an.all},()=>({type:"AllowedRulesAll"})).with({type:an.none},()=>({type:"AllowedRulesNone"})).with({type:an.specific},n=>({type:"AllowedRulesSpecific",rules:C(n.rules,z(this.mapToGlobalConstraintId),pd)})).with(Ct.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function RI(e){return t=>gT(n=>n!=null,e)(t)}function kI(){return Na(qr())}var Gn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Gn||{}),co=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(co||{}),dn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(dn||{}),lo=(e=>(e.all="all",e.none="none",e.specific="specific",e))(lo||{});const bn=yn({localId:ft,componentPath:Tl(ft),sharedConfigurationModel:fh(ft)}),MI=Po(qi(yn({attributeId:bn,decisions:Tl(bn)}))),jI=Po(On((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})=>qi(dh).equals(n.rules,r.rules)).otherwise(()=>!1))),_I=Po(yn({rules:jI})),qI=yn({configurationModelSource:On((e,t)=>hI(e,t)),decisionsToRespect:MI,usageRuleParameters:Ob(ft),allowedInExplain:_I});var Ms=(e=>(e.Channel="Channel",e.Package="Package",e))(Ms||{}),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||{}),Xt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Xt||{}),Nt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Nt||{}),mo=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(mo||{}),yo=(e=>(e.Always="Always",e.Optional="Optional",e))(yo||{});const FI={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:Po(ft).equals(e.state,t.state)},LI={equals(e,t){return Po(El).equals(e.value,t.value)}},VI={equals(e,t){return Po(ch).equals(e.value,t.value)}},BI={equals(e,t){return Po(ft).equals(e.state,t.state)}},UI={equals(e,t){return bn.equals(e.attributeId,t.attributeId)?ue({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>VI.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>LI.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>BI.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>FI.equals(r.x,r.y)).otherwise(()=>!1):!1}},GI=qi(UI),zI={equals:(e,t)=>GI.equals(e.decisions,t.decisions)&&WI.equals(e.mode,t.mode)},WI={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 bd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(bd||{}),pa=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(pa||{}),Ce=(e=>(e.ServiceError="ServiceError",e.Unknown="Unknown",e.CommunicationError="CommunicationError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(Ce||{}),ph=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(ph||{});function HI(e,t){console.log(`--------------------------------------------------------------------------------
|
|
2
|
+
-- ${t??""}
|
|
3
3
|
--------------------------------------------------------------------------------
|
|
4
|
-
${JSON.stringify(t,null,2)}`)}var Pn=(t=>(t.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",t.ClientError="Generic::LocalClientError",t.ServerError="Generic::ServerError",t.UnhandledResponseStatus="LocalUnhandledResponseStatus",t.LowLevelCommunicationError="LocalLowLevelCommunicationError",t))(Pn||{}),Da=(t=>(t.BooleanAttributeNotFound="BooleanAttributeNotFound",t.ChoiceAttributeNotFound="ChoiceAttributeNotFound",t.ChoiceValueNotFound="ChoiceValueNotFound",t.ConfigurationInitializationFailure="InitializationFailure",t.ConfigurationModelInvalid="ConfigurationModelInvalid",t.LegacyConfigurationModelInvalid="DeploymentStore.Core.Store.SnapshotInvalid",t.LegacySnapshotInvalid="SnapshotInvalid",t.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",t.ConfigurationModelNotFound="ConfigurationModelNotFound",t.ConflictWithConsequence="ConflictWithConsequence",t.DecisionInvalid="DecisionInvalid",t.DecisionsToRespectInvalid="DecisionsToRespectInvalid",t.NumericAttributeNotFound="NumericAttributeNotFound",t.NumericDecisionOutOfRange="NumericDecisionOutOfRange",t.SessionNotFound="SessionNotFound",t.SetDecisionConflict="SetDecisionConflict",t.Unauthorized="Unauthorized",t))(Da||{});const Ff=t=>Object.values(Da).includes(t),Gf=t=>Ff(t)?J(t):R;function Lf(t){return c(t,Gf,x(e=>O(e).with("ConfigurationModelNotFound",()=>({type:j.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:j.DecisionsToRespectInvalid})).with(ft.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:j.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:j.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:j.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:j.ConfigurationConflict,reason:Hi.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:j.ConfigurationConflict})).with(ft.union("SessionNotFound","Unauthorized"),()=>({type:j.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:j.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:j.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:j.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:j.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",n=>({type:j.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:j.ConfigurationConflict})).exhaustive()))}const zf=t=>Object.values(Pn).includes(t),Hf=t=>zf(t)?J(t):R;function Wf(t){return c(t,Hf,x(e=>O(e).with("Generic::LocalClientError",()=>({type:j.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:j.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:j.CommunicationError})).with("Generic::Unauthorized",()=>({type:j.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:j.Unknown})).exhaustive()))}function he(t,e){Vf(t,e);const n=t.type;return c(R,vo(()=>Lf(n)),vo(()=>Wf(n)),st(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",t,"Context",e),{type:j.Unknown})))}class Oa{constructor(e,n,r,i){this.engineApiClient=e,this.contractToRestMapper=n,this.restToDomainMapper=r,this.options=i}create(e){const n=this.contractToRestMapper.mapToCreateSessionRequest(e);return c(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),ee(r=>he(r,"ClientSideSessionLifetimeHandler - create")),te(r=>this.restToDomainMapper.mapToSessionId(r)),Df(()=>({type:j.ConfigurationUnauthenticated})))}close(e){return c(this.engineApiClient.deleteSessionUsingJwtBearer(e,this.options.accessToken),ee(n=>he(n,"ClientSideSessionLifetimeHandler - close")),Tt(()=>Ee()))}}function Kf(t){var e=[];if(t.length===0)return"";if(typeof t[0]!="string")throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var n=t.shift();t[0]=n+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<t.length;r++){var i=t[r];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(r>0&&(i=i.replace(/^[\/]+/,"")),r<t.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),e.push(i))}var o=e.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function Jf(){var t;return typeof arguments[0]=="object"?t=arguments[0]:t=[].slice.call(arguments),Kf(t)}var Na=(t=>(t[t.Ok=200]="Ok",t[t.NoContent=204]="NoContent",t[t.BadRequest=400]="BadRequest",t[t.Unauthorized=401]="Unauthorized",t[t.NotFound=404]="NotFound",t[t.Conflict=409]="Conflict",t))(Na||{});function de(t,e,n){const r=c(Array.isArray(t)?t:[t],Jf);return c(Eo(()=>fetch(r,e),i=>({type:"error"})),te(i=>c(Eo(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),ya(i=>i.status===401?pe({type:Pn.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?pn({response:i,data:{}}):i.type==="error"?pe({type:Pn.LowLevelCommunicationError}):pe({type:Pn.UnhandledResponseStatus})),te(i=>c(n(i),Li(()=>i.data))))}function pi(t,e){return de(t,e,n=>{if(n.response.status===200)return Oe(n.data);if(n.response.status===409){const r=n.data;return O(r).with({type:"ConfigurationModelInvalid"},i=>Oe(r)).with({type:"ConfigurationModelNotFeasible"},i=>Oe(r)).otherwise(()=>R)}return R})}class Xf{constructor(e){this.baseUrl=e}createSessionUsingApiKey(e,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-API-KEY":n},body:JSON.stringify(e)};return pi([this.baseUrl,"v2/session"],r)}createSessionUsingJwtBearer(e,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify(e)};return pi([this.baseUrl,"v2/session"],r)}setMany(e,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":e},body:JSON.stringify(n)};return de([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?J(i.data):R)}makeDecision(e,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":e},body:JSON.stringify(n)};return de([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?J(i.data):R)}getDecisions(e){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":e}};return de([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?J(r.data):R)}getWhyStateNotPossible(e,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":e},body:JSON.stringify(n)};return de([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?J(i.data):R)}getWhyNotSatisfied(e,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":e},body:JSON.stringify(n)};return de([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?J(i.data):R)}getConsequence(e){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":e}};return de([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?J(r.data):R)}deleteSessionUsingJwtBearer(e,n){const r={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return de([this.baseUrl,`v2/session/${e}`],r,i=>i.response.status===204?J({}):R)}}var He=(t=>(t.Included="Included",t.Excluded="Excluded",t))(He||{}),vi=(t=>(t.Mandatory="Mandatory",t.Optional="Optional",t))(vi||{}),yi=(t=>(t.Always="Always",t.Optional="Optional",t))(yi||{}),Vn=(t=>(t.Implicit="Implicit",t.Explicit="Explicit",t))(Vn||{}),ve=(t=>(t.Included="Included",t.Excluded="Excluded",t.Undefined="Undefined",t))(ve||{}),Ht=(t=>(t.Choice="Choice",t.Numeric="Numeric",t.Boolean="Boolean",t.Component="Component",t))(Ht||{}),mi=(t=>(t.NotAvailable="NotAvailable",t.StateNotPossible="StateNotPossible",t))(mi||{}),gi=(t=>(t.Attribute="Attribute",t.Configuration="Configuration",t))(gi||{}),On=(t=>(t.Boolean="Boolean",t.Numeric="Numeric",t.ChoiceValue="ChoiceValue",t.Component="Component",t))(On||{});const zt=fe({localId:ht,componentPath:Wn(ht),sharedConfigurationModelId:zi(ht)});let _a=class{mapToDecisions(e){return{}}mapToSessionId(e){return O(e).with({sessionId:ft.string},n=>pn(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=c(n.constraintExplanations,b(i=>this.mapToConstraintExplanation(i)));return pe({type:j.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>pe({type:j.ConfigurationModelInvalid})).otherwise(()=>pe({type:j.Unknown}))}mapToExplainAnswer(e,n){const r=O(n).with({question:Kt.whyIsStateNotPossible,subject:Mt.boolean},a=>[{type:B.Boolean,attributeId:a.attributeId,value:J(a.state)}]).with({question:Kt.whyIsStateNotPossible,subject:Mt.numeric},a=>[{type:B.Numeric,attributeId:a.attributeId,value:J(a.state)}]).with({question:Kt.whyIsStateNotPossible,subject:Mt.component},a=>[{type:B.Component,attributeId:a.attributeId,state:J(a.state)}]).with({question:Kt.whyIsStateNotPossible,subject:Mt.choiceValue},a=>[{type:B.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:J(a.state)}]).otherwise(()=>[]),i=c(e.decisionExplanations,b(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=c(e.constraintExplanations,b(a=>this.mapToConstraintExplanation(a)));return O(n).with({answerType:Ve.decisions},()=>({decisionExplanations:i})).with({answerType:Ve.constraints},()=>({constraintExplanations:o})).with({answerType:Ve.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(e,n,r){const i=this.mapToExplicitDecisions(n);return{type:j.ConfigurationSetManyConflict,decisionExplanations:c(e.decisionExplanations,b(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:c(e.constraintExplanations,b(o=>this.mapToConstraintExplanation(o)))}}mapToGlobalConstraintId(e){return{localId:e.localId,configurationModelId:e.configurationModelId}}mapToConfigurationModel(e,n){const r=this.mapToAttributes(e,n);return{isSatisfied:n.isConfigurationSatisfied??!1,attributes:r}}mapToBooleanDecision(e){return{type:B.Boolean,attributeId:this.mapToGlobalAttributeId(e.attributeId),value:V(e.state)}}mapToNumericDecision(e){return{type:B.Numeric,attributeId:this.mapToGlobalAttributeId(e.attributeId),value:V(e.state)}}mapToComponentDecision(e){return{type:B.Component,attributeId:this.mapToGlobalAttributeId(e.attributeId),state:this.mapToDecisionState(e.state)}}mapToExplicitChoiceValueDecision(e){return{type:B.ChoiceValue,attributeId:this.mapToGlobalAttributeId(e.attributeId),choiceValueId:e.choiceValueId,state:this.mapToDecisionState(e.state)}}mapToGlobalAttributeId(e){return{localId:e.localId,sharedConfigurationModel:e.sharedConfigurationModelId,componentPath:e.componentPath??[]}}mapToChoiceValueDecision(e){return c(this.mapToDecisionState(e.state),x(n=>({kind:this.mapToDecisionKind(e.kind),state:n})))}mapToConstraintExplanation(e){return{causedByRules:c(e.causedByRules,b(n=>this.mapToRuleConstraint(n))),causedByCardinalities:c(e.causedByCardinalities,b(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(e){return{type:cn.Rule,ruleId:this.mapToGlobalConstraintId(e.constraintId)}}mapToCardinalityConstraint(e){return{type:cn.Cardinality,attributeId:this.mapToGlobalAttributeId(e.attributeId)}}mapToExplicitDecisions(e){const n=c(e.booleanDecisions??[],b(a=>({type:B.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:V(a.state)}))),r=c(e.numericDecisions??[],b(a=>({type:B.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:V(a.state)}))),i=c(e.componentDecisions??[],b(a=>({type:B.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:c(V(a.state),x(u=>this.mapToDecisionState(u)),li)}))),o=c(e.choiceDecisions??[],b(a=>({type:B.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:c(V(a.state),x(u=>this.mapToDecisionState(u)),li)})));return c([],L(n),L(r),L(i),L(o))}mapToDecisionExplanation(e,n,r){const i=c(e.causedByBooleanDecisions,b(m=>this.mapToCausedByBooleanDecision(m))),o=c(e.causedByNumericDecisions,b(m=>this.mapToCausedByNumericDecision(m))),a=c(e.causedByComponentDecisions,b(m=>this.mapToCausedByComponentDecision(m))),u=c(e.causedByChoiceDecisions,b(m=>this.mapToCausedByChoiceValueDecision(m))),s=c(i,b(m=>({type:B.Boolean,attributeId:m.attributeId,value:R}))),l=c(o,b(m=>({type:B.Numeric,attributeId:m.attributeId,value:R}))),f=c(a,b(m=>({type:B.Component,attributeId:m.attributeId,state:R}))),h=c(u,b(m=>({type:B.ChoiceValue,attributeId:m.attributeId,choiceValueId:m.choiceValueId,state:R}))),d=c([],L(s),L(l),L(f),L(h)),y=ca(dn((m,v)=>{const w=Pt.equals(m.attributeId,v.attributeId);return O({a:m,b:v}).with({a:{type:B.ChoiceValue},b:{type:B.ChoiceValue}},E=>w&&E.a.choiceValueId===E.b.choiceValueId).otherwise(()=>w)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:u,solution:{decisions:c([],L(d),L(y)),mode:r}}}mapToCausedByBooleanDecision(e){return{type:B.Boolean,attributeId:this.mapToGlobalAttributeId(e.attributeId),state:e.state,reason:this.mapToReason(e.reason)}}mapToReason(e){return O(e).with(mi.NotAvailable,()=>hi.NotAvailable).with(mi.StateNotPossible,()=>hi.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(e){return{type:B.Numeric,attributeId:this.mapToGlobalAttributeId(e.attributeId),state:e.state,reason:this.mapToReason(e.reason)}}mapToCausedByComponentDecision(e){return{type:B.Component,attributeId:this.mapToGlobalAttributeId(e.attributeId),state:this.mapToPossibleDecisionState(e.state),reason:this.mapToReason(e.reason)}}mapToCausedByChoiceValueDecision(e){return{type:B.ChoiceValue,attributeId:this.mapToGlobalAttributeId(e.attributeId),choiceValueId:e.choiceValueId,state:this.mapToPossibleDecisionState(e.state),reason:this.mapToReason(e.reason)}}mapToAttributes(e,n){function r(d){return c(n.canAttributeContributeToConfigurationSatisfaction,_t(y=>zt.equals(y,d)),Dn)}const i=c([],L(c(e.choiceValueDecisions,b(d=>d.attributeId))),L(c(n.choiceConsequences,b(d=>d.attributeId))),an(zt)),o=c(i,b(d=>{const y=c(e.choiceValueDecisions??[],Kc(v=>zt.equals(v.attributeId,d))),m=c(n.choiceConsequences??[],Ue(v=>zt.equals(v.attributeId,d)));return c(m,x(v=>this.mapToChoiceAttributes(v,y,r(d))))}),se),a=c([],L(c(e.numericDecisions,b(d=>d.attributeId))),L(c(n.numericConsequences,b(d=>d.attributeId))),an(zt)),u=c(a,b(d=>{const y=c(e.numericDecisions??[],Ue(v=>zt.equals(v.attributeId,d))),m=c(n.numericConsequences??[],Ue(v=>zt.equals(v.attributeId,d)));return c(m,x(v=>this.mapToNumericAttribute(v,y,r(d))))}),se),s=c([],L(c(e.booleanDecisions,b(d=>d.attributeId))),L(c(n.booleanConsequences,b(d=>d.attributeId))),an(zt)),l=c(s,b(d=>{const y=c(e.booleanDecisions??[],Ue(v=>zt.equals(v.attributeId,d))),m=c(n.booleanConsequences??[],Ue(v=>zt.equals(v.attributeId,d)));return c(m,x(v=>this.mapToBooleanAttribute(v,y,r(d))))}),se),f=c([],L(c(e.componentDecisions,b(d=>d.attributeId))),L(c(n.componentConsequences,b(d=>d.attributeId))),an(zt)),h=c(f,b(d=>{const y=c(e.componentDecisions??[],Ue(v=>zt.equals(v.attributeId,d))),m=c(n.componentConsequences??[],Ue(v=>zt.equals(v.attributeId,d)));return c(m,x(v=>this.mapToComponentAttribute(v,y,r(d))))}),se);return c([],L(o),L(h),L(u),L(l))}mapToComponentAttribute(e,n,r){return{type:ot.Component,attributeId:this.mapToGlobalAttributeId(e.attributeId),isSatisfied:e.isSatisfied,possibleDecisionStates:c(e.possibleDecisionStates,dr(i=>this.mapToPossibleDecisionState(i))),decision:c(n,Xt(i=>c(this.mapToDecisionState(i.state),x(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(e.inclusion),selection:c(e.selection,V,x(i=>this.mapToSelection(i)),yt),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(e,n,r){const i=c(e.values,dr(o=>{const a=c(n,_t(u=>u.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:ot.Choice,attributeId:this.mapToGlobalAttributeId(e.attributeId),isSatisfied:e.isSatisfied,cardinality:this.mapToCardinality(e.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(e,n,r){return{type:ot.Boolean,attributeId:this.mapToGlobalAttributeId(e.attributeId),isSatisfied:e.isSatisfied,selection:this.mapToSelection(e.selection),possibleDecisionStates:e.possibleDecisionStates,decision:c(n,Xt(i=>c(i.state,V,x(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(e,n,r){return{type:ot.Numeric,attributeId:this.mapToGlobalAttributeId(e.attributeId),isSatisfied:e.isSatisfied,range:{min:e.range.min,max:e.range.max},selection:this.mapToSelection(e.selection),decimalPlaces:e.decimalPlaces,decision:c(n,Xt(i=>c(i.state,V,x(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(e,n){const r=c(e.possibleDecisionStates,dr(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:e.choiceValueId,decision:c(n,Xt(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(e){return O(e).with(Vn.Implicit,()=>St.Implicit).with(Vn.Explicit,()=>St.Explicit).exhaustive()}mapToDecisionState(e){return O(e).with(ve.Included,()=>J(It.Included)).with(ve.Excluded,()=>J(It.Excluded)).with(ve.Undefined,()=>R).exhaustive()}mapToPossibleDecisionState(e){return O(e).with(He.Included,()=>It.Included).with(He.Excluded,()=>It.Excluded).exhaustive()}mapToSelection(e){return O(e).with(vi.Mandatory,()=>Le.Mandatory).with(vi.Optional,()=>Le.Optional).exhaustive()}mapToInclusion(e){return O(e).with(yi.Always,()=>ze.Always).with(yi.Optional,()=>ze.Optional).exhaustive()}mapToCardinality(e){return{lowerBound:e.lowerBound,upperBound:e.upperBound}}},Ma=class{constructor(e,n){this.restToDomainMapper=new _a,this.contractToRestMapper=e,this.options=n}create(e){const n=this.contractToRestMapper.mapToCreateSessionRequest(e),r=pi(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return c(r,ee(i=>he(i,"ServerSideSessionLifetimeHandler - create")),te(i=>this.restToDomainMapper.mapToSessionId(i)))}close(e){return c(de(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":e}},n=>n.response.status===Na.NoContent?J({}):R),ee(n=>he(n,"ServerSideSessionLifetimeHandler - close")),Tt(Ee))}},Yf=class{constructor(e,n,r){this.inner=e,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=R}setOnConfigurationChangedHandler(e){const n=c(e,V,x(r=>i=>{const o=this.domainToContractMapper.mapToConfiguration(i);r(o)}));this.inner.setOnConfigurationChangedHandler(n)}getConfiguration(){const e=this.inner.getConfiguration();return this.domainToContractMapper.mapToConfiguration(e)}getSessionContext(){const e=this.inner.getSessionContext();return this.domainToContractMapper.mapToSessionContext(e)}async setSessionContext(e){const n=this.contractToDomainMapper.mapToSessionContext(e);return await c(this.inner.setSessionContext(n),Tt(Ee),this.adaptToContractPromise())()}async restoreConfiguration(e){const n=this.contractToDomainMapper.mapToConfiguration(e);return await c(this.inner.restoreConfiguration(n),Tt(Ee),this.adaptToContractPromise())()}async makeDecision(e){const n=this.contractToDomainMapper.mapToAttributeDecision(e);return await c(this.inner.makeDecision(n),Tt(Ee),this.adaptToContractPromise())()}async setMany(e,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(e),i=this.contractToDomainMapper.mapToMode(n);return await c(this.inner.setMany(r,i),Tt(Ee),this.adaptToContractPromise())()}async applySolution(e){const n=this.contractToDomainMapper.mapToSolution(e);return await c(this.inner.applySolution(n),Tt(Ee),this.adaptToContractPromise())()}async explain(e,n){const r=this.contractToDomainMapper.mapToExplainQuestion(e,n);return await c(this.inner.explain(r),Tt(i=>this.domainToContractMapper.mapToExplainAnswer(i)),this.adaptToContractPromise())()}async close(){return await c(this.inner.close(),ee(e=>this.domainToContractMapper.mapToFailureResult(e)),Sr(Promise.reject,e=>Promise.resolve()))()}adaptToContractPromise(){return ne(ee(e=>this.domainToContractMapper.mapToFailureResult(e)),Sr(e=>Promise.reject(e),e=>Promise.resolve(e)))}},Qf=class{mapToExplainQuestion(e,n){const r={answerType:O(n).with("decisions",()=>Ve.decisions).with("constraints",()=>Ve.constraints).with("full",()=>Ve.all).exhaustive()};return O(e).with({question:Rt.whyIsNotSatisfied,subject:jt.configuration},i=>({...r,question:Kt.whyIsNotSatisfied,subject:Mt.configuration})).with({question:Rt.whyIsNotSatisfied,subject:jt.attribute},i=>({...r,question:Kt.whyIsNotSatisfied,subject:Mt.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:Rt.whyIsStateNotPossible,subject:jt.choiceValue},i=>({...r,question:Kt.whyIsStateNotPossible,subject:Mt.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:Rt.whyIsStateNotPossible,subject:jt.component},i=>({...r,question:Kt.whyIsStateNotPossible,subject:Mt.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:Rt.whyIsStateNotPossible,subject:jt.numeric},i=>({...r,question:Kt.whyIsStateNotPossible,subject:Mt.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:Rt.whyIsStateNotPossible,subject:jt.boolean},i=>({...r,question:Kt.whyIsStateNotPossible,subject:Mt.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(e){return{isSatisfied:e.isSatisfied,attributes:c(e.attributes,b(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(e){return c(e,b(n=>this.mapToAttributeDecision(n)))}mapToSessionContext(e){return{configurationModelSource:this.mapToConfigurationModelSource(e.configurationModelSource),decisionsToRespect:this.mapToDecisionsToRespect(e.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(e.usageRuleParameters)}}mapToAttributeDecision(e){return O(e).with({type:it.Choice,choiceValueId:ft.string},n=>({type:B.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:it.Numeric},n=>({type:B.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:V(n.state)})).with({type:it.Boolean},n=>({type:B.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:V(n.state)})).with({type:it.Component},n=>({type:B.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:c(V(n.state),Xt(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(e){return c(V(e),x(n=>c(n,b(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:c(r.decisions,b(i=>this.mapToGlobalAttributeId(i)))})))))}mapToMode(e){return O(e).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(e){return O(e).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToGlobalAttributeId(e){return{localId:e.localId,componentPath:e.componentPath??[],sharedConfigurationModel:e.sharedConfigurationModelId}}mapToConfigurationModelSource(e){return O(e).with({type:ge.Package},n=>({type:Bn.Package,configurationModelPackage:n.configurationModelPackage})).with({type:ge.Channel},n=>({type:Bn.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(e){return{decisions:c(e.decisions,b(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(e.mode)}}mapToAttribute(e){return O(e).with({type:it.Boolean},n=>({type:ot.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:c(n.decision,V,x(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:it.Numeric},n=>({type:ot.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:c(n.decision,V,x(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:it.Choice},n=>({type:ot.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:c(n.values,b(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:it.Component},n=>({type:ot.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:c(n.decision,V,Xt(r=>c(this.mapToDecisionStateOption(r.state),x(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:c(n.possibleDecisionStates,b(r=>this.mapToDecisionStateOption(r)),se),selection:c(n.selection,V,x(r=>this.mapToSelection(r)),yt),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(e){return{choiceValueId:e.id,decision:this.mapToChoiceValueDecision(e),possibleDecisionStates:c(e.possibleDecisionStates,b(n=>this.mapToDecisionStateOption(n)),se)}}mapToChoiceValueDecision(e){return c(e.decision,V,Xt(n=>c(this.mapToDecisionStateOption(n.state),x(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(e){return O(e).with(Se.Implicit,()=>St.Implicit).with(Se.Explicit,()=>St.Explicit).exhaustive()}mapToSelection(e){return O(e).with(Fe.Mandatory,()=>Le.Mandatory).with(Fe.Optional,()=>Le.Optional).exhaustive()}mapToInclusion(e){return O(e).with(Ge.Always,()=>ze.Always).with(Ge.Optional,()=>ze.Optional).exhaustive()}mapToDecisionState(e){return O(e).with(ft.union(be.Included,Me.Included),()=>It.Included).with(ft.union(be.Excluded,Me.Excluded),()=>It.Excluded).exhaustive()}mapToDecisionStateOption(e){return c(V(e),x(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(e){return e??{}}},$a=class{mapToExplainAnswer(e){const n=O(e).with({decisionExplanations:ft.array(ft.any)},i=>c(i.decisionExplanations,b(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=O(e).with({constraintExplanations:ft.array(ft.any)},i=>c(i.constraintExplanations,b(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(e){return{causedByCardinalities:c(e.causedByCardinalities,b(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:c(e.causedByRules,b(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(e){const n=c(e.causedByChoiceDecisions,b(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=c(e.causedByComponentDecisions,b(a=>this.mapToCausedByComponentAttributeDecision(a))),i=c(e.causedByNumericDecisions,b(a=>this.mapToCausedByNumericAttributeDecision(a))),o=c(e.causedByBooleanDecisions,b(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:c([],L(n),L(r),L(i),L(o)),solution:this.mapToSolution(e.solution)}}mapToSolution(e){return{decisions:c(e.decisions,b(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(e.mode)}}mapToMode(e){return O(e).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(e){return O(e).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToSessionContext(e){return{configurationModelSource:this.mapToConfigurationModelSource(e.configurationModelSource),attributeRelations:this.mapToDecisionsToRespect(e.decisionsToRespect),usageRuleParameters:this.mapToUsageRuleParameters(e.usageRuleParameters)}}mapToFailureResult(e){return O(e).with({type:j.ConfigurationConflict},n=>({type:wt.ConfigurationConflict,reason:O(n.reason).with(Hi.NumericDecisionOutOfRange,()=>Ur.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:j.ConfigurationApplicationError},()=>({type:wt.ConfigurationApplicationError})).with({type:j.ConfigurationUnauthenticated},()=>({type:wt.ConfigurationUnauthenticated})).with({type:j.ConfigurationModelNotFound},()=>({type:wt.ConfigurationModelNotFound})).with({type:j.ConfigurationTimeout},()=>({type:wt.ConfigurationTimeout})).with({type:j.ConfigurationAttributeNotFound},()=>({type:wt.ConfigurationAttributeNotFound})).with({type:j.ConfigurationChoiceValueNotFound},()=>({type:wt.ConfigurationChoiceValueNotFound})).with({type:j.ConfigurationSolutionNotAvailable},()=>({type:wt.ConfigurationSolutionNotAvailable})).with({type:j.ConfigurationRejectedDecisionsConflict},n=>{const r=c(n.rejectedDecisions,b(i=>this.mapToExplicitDecision(i)));return xa.createConfigurationRejectedDecisionsConflict(r)}).with({type:j.DecisionsToRespectInvalid},()=>({type:wt.DecisionsToRespectInvalid})).with({type:j.ServiceError},()=>({type:wt.ServiceError})).with({type:j.CommunicationError},()=>({type:wt.CommunicationError})).with({type:j.Unknown},()=>({type:wt.Unknown})).with({type:j.ConfigurationModelInvalid},()=>({type:wt.ConfigurationModelInvalid})).with({type:j.ConfigurationInitializationFailure},()=>({type:wt.ConfigurationInitializationFailure})).with({type:j.ConfigurationModelNotFeasible},n=>({type:wt.ConfigurationModelNotFeasible,constraintExplanations:c(n.constraintExplanations,b(r=>this.mapToConstraintExplanation(r)))})).with({type:j.ConfigurationSetManyConflict},n=>({type:wt.ConfigurationSetManyConflict,decisionExplanations:c(n.decisionExplanations,b(r=>this.mapToDecisionExplanation(r))),constraintExplanations:c(n.constraintExplanations,b(r=>this.mapToConstraintExplanation(r)))})).exhaustive()}mapToConfiguration(e){return{isSatisfied:e.isSatisfied,attributes:c(e.attributes,b(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(e){return c(e,x(ne(b(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:c(n.decisions,b(r=>this.mapToGlobalAttributeId(r)))})))),yt)}mapToGlobalAttributeId(e){return{localId:e.localId,sharedConfigurationModelId:e.sharedConfigurationModel,componentPath:[...e.componentPath??[]]}}mapToGlobalConstraintId(e){return{localId:e.localId,configurationModelId:e.configurationModelId}}mapToConfigurationModelSource(e){return O(e).with({type:Bn.Package},n=>({type:ge.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Bn.Channel},n=>({type:ge.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(e){return O(e).with({type:B.ChoiceValue},n=>({type:it.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:c(n.state,x(r=>this.mapToChoiceValueDecisionState(r)),yt),choiceValueId:n.choiceValueId})).with({type:B.Component},n=>({type:it.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:c(n.state,x(r=>this.mapToComponentDecisionState(r)),yt)})).with({type:B.Numeric},n=>({type:it.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:c(n.value,yt)})).with({type:B.Boolean},n=>({type:it.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:c(n.value,yt)})).exhaustive()}mapToCardinality(e){return O(e).with(cn.Cardinality,()=>un.Cardinality).with(cn.Component,()=>un.Component).with(cn.Rule,()=>un.Rule).exhaustive()}mapToCausedByAttributeDecision(e){return O(e).with({type:B.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:B.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:B.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:B.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(e){return{type:it.Choice,attributeId:this.mapToGlobalAttributeId(e.attributeId),choiceValueId:e.choiceValueId,state:this.mapToChoiceValueDecisionState(e.state)}}mapToCausedByNumericAttributeDecision(e){return{type:it.Numeric,attributeId:this.mapToGlobalAttributeId(e.attributeId),state:e.state}}mapToCausedByBooleanAttributeDecision(e){return{type:it.Boolean,attributeId:this.mapToGlobalAttributeId(e.attributeId),state:e.state}}mapToCausedByComponentAttributeDecision(e){return{type:it.Component,attributeId:this.mapToGlobalAttributeId(e.attributeId),state:this.mapToComponentDecisionState(e.state)}}mapToSelection(e){return O(e).with(Le.Mandatory,()=>Fe.Mandatory).with(Le.Optional,()=>Fe.Optional).exhaustive()}mapToAttribute(e){const n={id:this.mapToGlobalAttributeId(e.attributeId),isSatisfied:e.isSatisfied,canContributeToConfigurationSatisfaction:e.canContributeToConfigurationSatisfaction};return O(e).with({type:ot.Boolean},r=>({...n,type:it.Boolean,decision:c(r.decision,x(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),De),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ot.Numeric},r=>({...n,type:it.Numeric,decision:c(r.decision,x(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),De),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ot.Choice},r=>({...n,type:it.Choice,cardinality:r.cardinality,values:c(r.values,b(i=>{const o=c(i.decision,x(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),De);return{id:i.choiceValueId,possibleDecisionStates:c(i.possibleDecisionStates,b(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ot.Component},r=>({...n,type:it.Component,decision:c(r.decision,x(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),De),possibleDecisionStates:c(r.possibleDecisionStates,b(i=>this.mapToComponentDecisionState(i))),selection:c(r.selection,V,x(i=>this.mapToSelection(i)),yt),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(e){return O(e).with(ze.Always,()=>Ge.Always).with(ze.Optional,()=>Ge.Optional).exhaustive()}mapToComponentDecisionState(e){return O(e).with(It.Included,()=>Me.Included).with(It.Excluded,()=>Me.Excluded).exhaustive()}mapToChoiceValueDecisionState(e){return O(e).with(It.Included,()=>be.Included).with(It.Excluded,()=>be.Excluded).exhaustive()}mapToDecisionKind(e){return O(e).with(St.Explicit,()=>Se.Explicit).with(St.Implicit,()=>Se.Implicit).exhaustive()}mapToUsageRuleParameters(e){return e}},qa=class{constructor(e,n){this.contractToDomainMapper=new Qf,this.domainToContractMapper=new $a,this.sessionHandler=e,this.internalConfigurationSessionCreator=n}async createSession(e){const n=this.configurationSessionFrom(e);return await c(this.sessionHandler.recreate(n),Tt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new Yf(i,this.contractToDomainMapper,this.domainToContractMapper)}),Sr(r=>{const i=this.domainToContractMapper.mapToFailureResult(r);return Promise.reject(i)},r=>Promise.resolve(r)))()}configurationSessionFrom(e){return{context:this.contractToDomainMapper.mapToSessionContext(e),sessionId:R,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function Wi(t){return t.possibleDecisionStates.some(e=>e===be.Included)}function Pa(t){return!Wi(t)}const Zf=Object.freeze(Object.defineProperty({__proto__:null,isAllowed:Wi,isBlocked:Pa},Symbol.toStringTag,{value:"Module"}));function td(t){return O(t).with({type:it.Choice},e=>e.cardinality.lowerBound>0).otherwise(()=>!0)}function ed(t){return O(t).with({type:it.Choice},e=>e.cardinality.upperBound>1).otherwise(()=>!1)}function nd(t){return c(t.values,Gt(Wi))}function rd(t){return c(t.values,Gt(Pa))}function Ra(t,e){return c(t.values,hn(n=>c(n.decision,V,At(r=>r.kind===e))))}function ja(t){return c(t.values,Gt(e=>c(e.decision,V,x(n=>n.state===be.Included),st(()=>!1))))}const id=ja;function Ua(t){return c(t.decision,V,At(e=>e.kind===Se.Explicit),De)}function ka(t){return c(t.decision,V,At(e=>e.kind===Se.Explicit),De)}function od(t,e){return t.possibleDecisionStates.some(n=>n===e)}function Ba(t){return c(t.decision,V,De)}function Va(t){return Fa(t,Me.Included)}function ad(t){return!Va(t)}function Fa(t,e){return t.possibleDecisionStates.some(n=>n===e)}const sd=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:nd,getBlockedChoiceValues:rd,getBooleanDecision:ka,getChoiceDecisions:Ra,getComponentDecision:Ba,getIncludedChoiceValues:ja,getNumericDecision:Ua,getSelectedChoiceValues:id,isBooleanValuePossible:od,isComponentAllowed:Va,isComponentBlocked:ad,isComponentStatePossible:Fa,isMandatory:td,isMultiSelect:ed},Symbol.toStringTag,{value:"Module"})),Ga=t=>t.type===it.Boolean,La=t=>t.type===it.Choice,za=t=>t.type===it.Numeric,Ha=t=>t.type===it.Component,ud=Wn(ht);function cd(t,e,n){var r;const i=((r=e.componentPath)==null?void 0:r.length)??0;return c(t,Gt(o=>{var a;const u=((a=o.id.componentPath)==null?void 0:a.length)??0;return n?i>u?!1:c(o.id.componentPath??[],sa(e.componentPath??[]),Pc(([s,l])=>s===l)):ud.equals(o.id.componentPath,e.componentPath)}))}function ld(t,e,n){return[]}function fd(t){return c(t,Gt(e=>{const n=c(e.id.componentPath,V,x(i=>i.length===0),st(()=>!0)),r=c(e.id.sharedConfigurationModelId,V,me(()=>!0,()=>!1));return n&&r}))}function dd(t,e){return c(Wa(t),b(n=>Ra(n,e)),la,hn(n=>V(n)))}function hd(t,e){return c(Ja(t),Gt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===e}),b(n=>Ua(n)),hn(n=>V(n)))}function pd(t,e){return c(Xa(t),Gt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===e}),b(n=>ka(n)),hn(n=>V(n)))}function vd(t,e){return c(Ka(t),Gt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===e}),b(n=>Ba(n)),hn(n=>V(n)))}function Wa(t){return c(t.attributes,Gt(La))}function Ka(t){return c(t.attributes,Gt(Ha))}function Ja(t){return c(t.attributes,Gt(za))}function Xa(t){return c(t.attributes,Gt(Ga))}function yd(t,e){return c(Kn(t,e),yt)}function md(t,e){return c(Ya(t,e),yt)}function gd(t,e,n){return c(Ya(t,e),x(r=>r.values),Xt(ne(_t(r=>r.id===n))),yt)}function bd(t,e){return c(Kn(t,e),At(za),yt)}function Sd(t,e){return c(Kn(t,e),At(Ga),yt)}function Cd(t,e){return c(Kn(t,e),At(Ha),yt)}function Kn(t,e){return c(t.attributes,_t(n=>Xe.equals(n.id,e)))}function Ya(t,e){return c(Kn(t,e),At(La))}const wd=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:cd,filterAttributesOfRoot:fd,filterAttributesOfShared:ld,getAttribute:yd,getBooleanAttribute:Sd,getBooleanAttributes:Xa,getBooleanDecisions:pd,getChoiceAttribute:md,getChoiceAttributes:Wa,getChoiceDecisions:dd,getChoiceValue:gd,getComponentAttribute:Cd,getComponentAttributes:Ka,getComponentDecisions:vd,getNumericAttribute:bd,getNumericAttributes:Ja,getNumericDecisions:hd},Symbol.toStringTag,{value:"Module"})),Qa={whyIsNotSatisfied:{configuration:{question:Rt.whyIsNotSatisfied,subject:jt.configuration},attribute:t=>({question:Rt.whyIsNotSatisfied,subject:jt.attribute,attributeId:t})},whyIsStateNotPossible:{choice:t=>({choiceValue:e=>({state:n=>({question:Rt.whyIsStateNotPossible,subject:jt.choiceValue,attributeId:t,choiceValueId:e,state:n})})}),boolean:t=>({state:e=>({question:Rt.whyIsStateNotPossible,subject:jt.boolean,attributeId:t,state:e})}),numeric:t=>({state:e=>({question:Rt.whyIsStateNotPossible,subject:jt.numeric,attributeId:t,state:e})}),component:t=>({state:e=>({question:Rt.whyIsStateNotPossible,subject:jt.component,attributeId:t,state:e})})}},Td=Object.freeze(Object.defineProperty({__proto__:null,explainQuestionBuilder:Qa},Symbol.toStringTag,{value:"Module"})),Id="https://spc.cloud.ceventis.de/api/engine",Ed={hcaEngineBaseUrl:Id};function xd(t){return{hcaEngineBaseUrl:t.hcaEngineBaseUrl??Ed.hcaEngineBaseUrl,sessionHandler:t.sessionHandler}}function En(t){if(t==null)throw new Error("Implementation Error: Unexpected null value encountered");return t}const Za=t=>e=>n=>c(n,xc(r=>t.equals(r,e)),x(r=>c(n,Ac(r,i=>e))),li,st(()=>c(n,L(Nc(e))))),ir=Za({equals:(t,e)=>Pt.equals(t.attributeId,e.attributeId)}),Ad=Za({equals:(t,e)=>t.choiceValueId===e.choiceValueId});let Dd=class{constructor(e){this.restToDomainMapper=e}updateConfigurationSession(e,n){const r=this.updateConfigurationModel(e.configuration,n);return{...e,configuration:r}}updateConfigurationModel(e,n){var r,i,o,a,u,s,l,f,h;const d=c(((r=n.affectedDecisions)==null?void 0:r.choiceValueDecisions)??[],b(g=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(g.attributeId),payload:g}))),y=c(((i=n.consequences)==null?void 0:i.choiceConsequences)??[],b(g=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(g.attributeId),payload:g}))),m=c(((o=n.affectedDecisions)==null?void 0:o.componentDecisions)??[],b(g=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(g.attributeId),payload:g}))),v=c(((a=n.consequences)==null?void 0:a.componentConsequences)??[],b(g=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(g.attributeId),payload:g}))),w=c(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],b(g=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(g.attributeId),payload:g}))),E=c(((s=n.consequences)==null?void 0:s.numericConsequences)??[],b(g=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(g.attributeId),payload:g}))),C=c(((l=n.affectedDecisions)==null?void 0:l.booleanDecisions)??[],b(g=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(g.attributeId),payload:g}))),S=c(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],b(g=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(g.attributeId),payload:g}))),I=c([],L(c(C,b(g=>g.attributeId))),L(c(S,b(g=>g.attributeId))),L(c(w,b(g=>g.attributeId))),L(c(E,b(g=>g.attributeId))),L(c(d,b(g=>g.attributeId))),L(c(y,b(g=>g.attributeId))),L(c(m,b(g=>g.attributeId))),L(c(v,b(g=>g.attributeId))),an(Pt)),P=c(I,fi(e.attributes,(g,N)=>{const F=e.attributes.find($=>Pt.equals($.attributeId,N));return O(F).with({type:ot.Choice},($,z)=>{const q=this.mergeChoice(z,c(y,_t(D=>Pt.equals(D.attributeId,N)),x(D=>D.payload)),c(d,Gt(D=>Pt.equals(D.attributeId,N)),b(D=>D.payload)));return ir(q)(g)}).with({type:ot.Numeric},($,z)=>{const q=this.mergeNumeric(z,c(E,_t(D=>Pt.equals(D.attributeId,N)),x(D=>D.payload)),c(w,_t(D=>Pt.equals(D.attributeId,N)),x(D=>D.payload)));return ir(q)(g)}).with({type:ot.Boolean},($,z)=>{const q=this.mergeBoolean(z,c(S,_t(D=>Pt.equals(D.attributeId,N)),x(D=>D.payload)),c(C,_t(D=>Pt.equals(D.attributeId,N)),x(D=>D.payload)));return ir(q)(g)}).with({type:ot.Component},($,z)=>{const q=this.mergeComponent(z,c(v,_t(D=>Pt.equals(D.attributeId,N)),x(D=>D.payload)),c(m,_t(D=>Pt.equals(D.attributeId,N)),x(D=>D.payload)));return ir(q)(g)}).exhaustive()}));return{...e,isSatisfied:c((h=n.consequences)==null?void 0:h.isConfigurationSatisfied,V,st(()=>e.isSatisfied)),attributes:P}}mergeChoice(e,n,r){const i=c(n,x(s=>s.values??[]),st(()=>[])),o=c(r),a=c([],L(c(i,b(s=>s.choiceValueId))),L(c(o,b(s=>s.choiceValueId))),b(En),an(ht)),u=c(a,fi(e.values,(s,l)=>{const f=c(i,_t(m=>m.choiceValueId===l)),h=c(o,_t(m=>m.choiceValueId===l)),d=c(e.values.find(m=>m.choiceValueId===l),V),y=this.mergeChoiceValue(l,d,f,h);return Ad(y)(s)}));return{...e,isSatisfied:c(n,x(s=>En(s.isSatisfied)),st(()=>e.isSatisfied)),values:u}}mergeChoiceValue(e,n,r,i){const o=c(i,x(u=>({state:this.toDecisionState(En(u.state)),kind:this.toDecisionKind(En(u.kind))})),st(()=>({state:c(n,Xt(u=>c(u.decision,x(s=>s.state)))),kind:c(n,Xt(u=>c(u.decision,x(s=>s.kind))),st(()=>St.Explicit))}))),a=c(r,x(u=>c(mo(u.possibleDecisionStates??[]),b(s=>this.toPossibleDecisionState(s)),se)),st(()=>c(n,x(u=>u.possibleDecisionStates??[]),st(()=>[]))));return{choiceValueId:e,decision:c(o.state,x(u=>({state:u,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(e,n,r){const i=c(r,x(a=>{const u=this.toDecisionState(En(a.state));return c(u,x(s=>({state:s,kind:this.toDecisionKind(a.kind)})))}),st(()=>c(e.decision,x(a=>({state:a.state,kind:a.kind}))))),o=c(n,x(a=>c(mo(a.possibleDecisionStates??[]),b(u=>this.toPossibleDecisionState(u)),se)),st(()=>e.possibleDecisionStates));return{...e,isSatisfied:c(n,x(a=>a.isSatisfied),st(()=>e.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(e,n,r){return{...e,isSatisfied:c(n,Xt(i=>V(i.isSatisfied)),st(()=>e.isSatisfied)),decision:c(r,me(()=>e.decision,i=>c(i.state,V,x(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(e,n,r){return{...e,isSatisfied:c(n,Xt(i=>V(i.isSatisfied)),st(()=>e.isSatisfied)),decision:c(r,me(()=>e.decision,i=>c(i.state,V,x(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:c(n,x(i=>i.possibleDecisionStates),st(()=>e.possibleDecisionStates))}}toPossibleDecisionState(e){return O(e).with(He.Included,()=>J(It.Included)).with(He.Excluded,()=>J(It.Excluded)).otherwise(()=>R)}toDecisionState(e){return O(e).with(ve.Included,()=>J(It.Included)).with(ve.Excluded,()=>J(It.Excluded)).otherwise(()=>R)}toDecisionKind(e){return O(e).with(Vn.Implicit,()=>St.Implicit).with(Vn.Explicit,()=>St.Explicit).exhaustive()}},Od=class{mapSessionToExplicitDecisions(e){return this.mapToExplicitDecisionsInner(e.configuration.attributes)}mapToExplicitDecision(e){return O(e).with({type:B.ChoiceValue},n=>({type:Ht.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:B.Component},n=>({type:Ht.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:B.Numeric},n=>({type:Ht.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:c(n.value,yt)})).with({type:B.Boolean},n=>({type:Ht.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:c(n.value,yt)})).exhaustive()}mapToExplicitDecisions(e,n){const r=this.mapToMode(n),i=c([...e],Ie(s=>s.type!==B.Boolean?R:J({type:Ht.Boolean,attributeId:this.mapToGlobalAttributeId(s.attributeId),state:c(s.value,yt)}))),o=c([...e],Ie(s=>s.type!==B.Numeric?R:J({type:Ht.Numeric,attributeId:this.mapToGlobalAttributeId(s.attributeId),state:c(s.value,yt)}))),a=c([...e],Ie(s=>s.type!==B.ChoiceValue?R:J({type:Ht.Choice,attributeId:this.mapToGlobalAttributeId(s.attributeId),choiceValueId:s.choiceValueId,state:this.mapToDecisionState(s.state)}))),u=c([...e],Ie(s=>s.type!==B.Component?R:J({type:Ht.Component,attributeId:this.mapToGlobalAttributeId(s.attributeId),state:this.mapToDecisionState(s.state)})));return{mode:r,choiceDecisions:a,numericDecisions:o,booleanDecisions:i,componentDecisions:u}}mapToExplicitDecisionsInner(e){const n=c([...e],Ie(a=>a.type!==ot.Boolean?R:c(a.decision,At(u=>u.kind===St.Explicit),x(()=>this.mapToExplicitBooleanDecision(a))))),r=c([...e],Ie(a=>a.type!==ot.Numeric?R:c(a.decision,At(u=>u.kind===St.Explicit),x(()=>this.mapToExplicitNumericDecision(a))))),i=c([...e],Ie(a=>a.type!==ot.Component?R:c(a.decision,At(u=>u.kind===St.Explicit),x(()=>this.mapToExplicitComponentDecision(a))))),o=c([...e],Ie(a=>a.type!==ot.Choice?R:c(this.mapToExplicitChoiceDecisions(a),rc(u=>c(u,qr)))),Hc);return{booleanDecisions:n,numericDecisions:r,choiceDecisions:o,componentDecisions:i}}mapToMode(e){return O(e).with({type:"Default"},n=>({type:"Default"})).with({type:"DropExistingDecisions"},n=>this.mapToDropExistingDecisionsMode(n)).exhaustive()}mapToGlobalAttributeId(e){return{localId:e.localId,componentPath:c(e.componentPath,V,x(yo),De),sharedConfigurationModelId:e.sharedConfigurationModel}}mapToDropExistingDecisionsMode(e){return{type:"DropExistingDecisions",conflictResolution:O(e.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:ft.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(e){return{type:Ht.Boolean,attributeId:this.mapToGlobalAttributeId(e.attributeId),state:c(e.decision,x(n=>n.state),yt)}}mapToExplicitNumericDecision(e){return{type:Ht.Numeric,attributeId:this.mapToGlobalAttributeId(e.attributeId),state:c(e.decision,x(n=>n.state),yt)}}mapToExplicitComponentDecision(e){return{type:Ht.Component,attributeId:this.mapToGlobalAttributeId(e.attributeId),state:this.mapToDecisionState(c(e.decision,x(n=>n.state)))}}mapToExplicitChoiceDecisions(e){function n(r){return c(r.decision,x(i=>i.kind===St.Explicit),st(()=>!1))}return c(e.values,Gt(n),b(r=>({type:Ht.Choice,attributeId:this.mapToGlobalAttributeId(e.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(c(r.decision,x(i=>i.state)))})),yo)}mapToDecisionState(e){return c(e,x(n=>O(n).with(It.Included,()=>ve.Included).with(It.Excluded,()=>ve.Excluded).exhaustive()),st(()=>ve.Undefined))}mapToPossibleDecisionState(e){return O(e).with(It.Included,()=>He.Included).with(It.Excluded,()=>He.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(e){return O(e).with({subject:Mt.attribute},n=>({type:gi.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:Mt.configuration},()=>({type:gi.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(e){return O(e).with({subject:Mt.boolean},n=>({type:On.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:Mt.numeric},n=>({type:On.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:Mt.component},n=>({type:On.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:Mt.choiceValue},n=>({type:On.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},Nd=class{constructor(){this.configurationSession={hasExplicitDecisions(e){return c(e.configuration.attributes,_t(n=>O(n).with({type:ot.Boolean},r=>c(r.decision,At(i=>i.kind===St.Explicit),Dn)).with({type:ot.Numeric},r=>c(r.decision,At(i=>i.kind===St.Explicit),Dn)).with({type:ot.Choice},r=>c(r.values,_t(i=>c(i.decision,x(o=>o.kind===St.Explicit),st(()=>!1))),Dn)).with({type:ot.Component},r=>c(r.decision,At(i=>i.kind===St.Explicit),Dn)).exhaustive()),me(()=>!1,()=>!0))},getExplicitDecisions(e){return c(e.configuration.attributes,b(n=>O(n).with({type:ot.Boolean},r=>c(r.decision,At(i=>i.kind===St.Explicit),x(i=>({type:B.Boolean,attributeId:r.attributeId,value:V(i.state)})),x(i=>[i]))).with({type:ot.Numeric},r=>c(r.decision,At(i=>i.kind===St.Explicit),x(i=>({type:B.Numeric,attributeId:r.attributeId,value:V(i.state)})),x(i=>[i]))).with({type:ot.Choice},r=>c(r.values,b(i=>c(i.decision,At(o=>o.kind===St.Explicit),x(o=>({type:B.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:V(o.state)})))),se,Oe)).with({type:ot.Component},r=>c(r.decision,At(i=>i.kind===St.Explicit),x(i=>({type:B.Component,attributeId:r.attributeId,state:V(i.state)})),x(i=>[i]))).exhaustive()),se,la)}}}},_d=class{constructor(e,n,r,i,o,a){this.engineApiClient=n,this.domainToRestMapper=i,this.restToDomainMapper=r,this.domainToContractMapper=o,this.domainUpdater=a,this.sessionHandler=e,this.interpreter=new Nd}close(e){return this.sessionHandler.close(e)}recreate(e){return this.initializeInner(e,!1)}reinitialize(e){return this.initializeInner(e,!0)}makeDecision(e,n){const r=this.domainToRestMapper.mapToExplicitDecision(e);return this.withSession(n,(i,o)=>c(this.engineApiClient.makeDecision(i,r),ee(he),Tt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(e,n){return this.withSession(n,r=>{const i=O(e).with({question:Kt.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Kt.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return c(i,ee(he),Tt(o=>this.restToDomainMapper.mapToExplainAnswer(o,e)))})}setMany(e,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(e,n,i);return c(a,te(u=>{var s,l,f,h;const d=c([],L(c(((s=u.rejectedDecisions)==null?void 0:s.booleanDecisions)??[],b(y=>this.restToDomainMapper.mapToBooleanDecision(y)))),L(c(((l=u.rejectedDecisions)==null?void 0:l.numericDecisions)??[],b(y=>this.restToDomainMapper.mapToNumericDecision(y)))),L(c(((f=u.rejectedDecisions)==null?void 0:f.componentDecisions)??[],b(y=>this.restToDomainMapper.mapToComponentDecision(y)))),L(c(((h=u.rejectedDecisions)==null?void 0:h.choiceValueDecisions)??[],b(y=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(y)))));return c(d,qr)?pe(Bf.createConfigurationRejectedDecisionsConflict(d)):sn(this.domainUpdater.updateConfigurationSession(o,u))}))})}replaceDecisions(e,n){const r=this.interpreter.configurationSession.getExplicitDecisions(n),i=this.setManyInner(r,{type:"DropExistingDecisions",conflictHandling:{type:"Automatic"}},e);return c(i,Tt(o=>({})))}setManyInner(e,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(e,n),o=this.engineApiClient.setMany(r,i);return c(o,ee(he),te(a=>{const u={rejectedDecisions:{booleanDecisions:ft.array(ft.any)}},s={decisionExplanations:ft.array(ft.any)};return O(a).with(u,l=>pn(l)).with(s,l=>pe(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(l,i,n))).otherwise(()=>pe({type:j.Unknown}))}))}explainWhyStateNotPossible(e,n){const r=this.domainToRestMapper.mapToWhyStateNotPossibleRequest(e);return this.engineApiClient.getWhyStateNotPossible(n,r)}explainWhyNotSatisfied(e,n){const r=this.domainToRestMapper.mapToWhyNotSatisfiedRequest(e);return this.engineApiClient.getWhyNotSatisfied(n,r)}withSession(e,n){return c(sn(e),te(r=>c(r.sessionId,me(()=>this.initializeInner(r,!1),()=>sn(r)))),te(r=>c(r.sessionId,Li(()=>({type:j.ConfigurationUnauthenticated})),te(i=>n(i,r)))))}initializeInner(e,n){return c(Dl,()=>c(e.sessionId,sf,cf(r=>n?af(r):c(this.sessionHandler.close(r),Sr(()=>R,()=>R)))),r=>{const i=this.domainToContractMapper.mapToSessionContext(e.context);return c(r,wl(()=>({type:j.ConfigurationUnauthenticated})),ya(()=>this.sessionHandler.create(i)))},r=>c(r,Ol(i=>c(Oe(e),At(this.interpreter.configurationSession.hasExplicitDecisions),x(o=>this.replaceDecisions(i,o)),st(()=>sn({}))))),r=>c(r,te(i=>{const o=this.determineConsequences(i),a=this.determineDecisions(i),u=zu(El)({consequences:o,decisions:a});return c(u,Tt(({decisions:s,consequences:l})=>this.restToDomainMapper.mapToConfigurationModel(s,l)),Tt(s=>({sessionId:Oe(i),configuration:s,context:e.context,solutions:[]})))})))}determineDecisions(e){return c(this.engineApiClient.getDecisions(e),ee(he))}determineConsequences(e){return c(this.engineApiClient.getConsequence(e),ee(he))}},Md=class{constructor(e,n){this.onConfigurationChangedHandler=R,this.sessionHandler=e,this.configurationSession=n}setOnConfigurationChangedHandler(e){this.onConfigurationChangedHandler=e}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(e){return c(this.sessionHandler.explain(e,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(e){return c(this.sessionHandler.recreate({...this.configurationSession,context:e}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:R}}restoreConfiguration(e){return c(this.sessionHandler.reinitialize({...this.configurationSession,configuration:e}),this.updateSession())}makeDecision(e){return c(this.sessionHandler.makeDecision(e,this.configurationSession),this.updateSession())}close(){return c(this.configurationSession.sessionId,x(e=>this.sessionHandler.close(e)),x(ne(Tt(e=>{this.configurationSession={...this.configurationSession,sessionId:R}}))),st(Dr(Of())))}applySolution(e){return c(this.configurationSession.solutions,_t(n=>Uf.equals(n,e)),Li(()=>({type:j.ConfigurationSolutionNotAvailable})),Tt(n=>n.decisions),te(n=>this.setMany(n,e.mode)))}setMany(e,n){return c(this.sessionHandler.setMany(e,n,this.configurationSession),this.updateSession(),Cr(r=>()=>{const i=O(r).with({decisionExplanations:ft.array(ft.any)},o=>J(o.decisionExplanations)).otherwise(()=>R);this.configurationSession={...this.configurationSession,solutions:c(i,x(ne(b(o=>o.solution))),st(()=>[]))}}))}deriveSolutionsFromExplainAnswer(e){const n=O(e).with({decisionExplanations:ft.array(ft.any)},r=>r.decisionExplanations).otherwise(()=>[]);return c(n,b(r=>r.solution))}invalidateAvailableSolutions(){return bf(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Cr(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(e){return Un(n=>()=>{this.configurationSession={...this.configurationSession,solutions:e(n)}})}updateSession(){return ne(Un(e=>()=>{this.configurationSession=e,c(this.onConfigurationChangedHandler,Cf(n=>()=>n(this.configurationSession.configuration)))}),Tt(e=>e.configuration),this.invalidateAvailableSolutions())}},$d=class{constructor(e){this.inner=e;const n=3,r=2e3,i=200;this.policy=hf(r,ff.concat(pf(i),df(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(e){const n=()=>this.inner.setSessionContext(e);return Qe(this.policy,n,r=>c(r,ke(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(e){const n=()=>this.inner.makeDecision(e);return Qe(this.policy,n,r=>c(r,ke(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(e){const n=()=>this.inner.restoreConfiguration(e);return Qe(this.policy,n,r=>c(r,ke(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(e){const n=()=>this.inner.explain(e);return Qe(this.policy,n,r=>c(r,ke(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(e){const n=()=>this.inner.applySolution(e);return Qe(this.policy,n,r=>c(r,ke(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(e,n){const r=()=>this.inner.setMany(e,n);return Qe(this.policy,r,i=>c(i,ke(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(e){this.inner.setOnConfigurationChangedHandler(e)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(e){return O(e).with({type:j.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:j.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},qd=class{constructor(){this.queue=[],this.operating=R}push(e){const n=new Pd(e);return this.queue.push(n),this.operating=c(this.operating,st(()=>this.start()),Oe),n.promise}async start(){for(;this.queue.length;){const e=[...this.queue];this.queue=[];const n=c(e,b(r=>r.argument),fi(R,(r,i)=>this.reduce(r,i)),x(ne(r=>this.execute(r),r=>r.then(i=>{c(e,b(o=>{o.resolve(i)}))}).catch(i=>{c(e,b(o=>{o.reject(i)}))}))),yt);n&&await n}this.operating=R}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},Pd=class{constructor(e){this.resolve=()=>{},this.reject=()=>{},this.argument=e,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},Rd=class extends qd{constructor(e){super(),this.inner=e}reduce(e,n){return J(n)}async execute(e){return await this.inner.setSessionContext(e)()}},jd=class{constructor(e){this.inner=e,this.setContextReducingTaskExecutor=new Rd(e)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(e){const n=this.inner.getSessionContext();if(_f.equals(n,e))return pn(this.getConfiguration());const r=this.setContextReducingTaskExecutor.push(e);return()=>r}applySolution(e){return this.inner.applySolution(e)}close(){return this.inner.close()}makeDecision(e){return this.inner.makeDecision(e)}restoreConfiguration(e){return this.inner.restoreConfiguration(e)}setMany(e,n){return this.inner.setMany(e,n)}explain(e){return this.inner.explain(e)}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(e){return this.inner.setOnConfigurationChangedHandler(e)}},Ud=class{constructor(e,n=!1){this.stringify=n,this.inner=e,this.durationNumberFormat=new Intl.NumberFormat("en-EN",{maximumFractionDigits:3})}withLogging(e,n,r){const i=performance.now(),o=()=>{const a=performance.now()-i;return this.durationNumberFormat.format(a)};return console.debug(`Operation ${e} started with`,this.renderAsRequired(n)),c(r(),Cr(a=>()=>{console.debug(`Operation ${e} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Un(a=>()=>{console.debug(`Operation ${e} completed after ${o()}ms with success`,this.renderAsRequired(a))}))}renderAsRequired(e){return this.stringify?JSON.stringify(e,null,2):e}explain(e){return this.withLogging("explain",[e],()=>this.inner.explain(e))}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(e){return this.withLogging("setSessionContext",[e],()=>this.inner.setSessionContext(e))}applySolution(e){return this.withLogging("applySolution",[e],()=>this.inner.applySolution(e))}close(){return this.inner.close()}makeDecision(e){return this.withLogging("makeDecision",[e],()=>this.inner.makeDecision(e))}restoreConfiguration(e){return this.withLogging("restoreConfiguration",[e],()=>this.inner.restoreConfiguration(e))}setMany(e,n){return this.withLogging("setMany",[e,n],()=>this.inner.setMany(e,n))}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(e){return this.inner.setOnConfigurationChangedHandler(e)}};function kd(t){t=xd(t);const e=new Xf(t.hcaEngineBaseUrl),n=new _a,r=new Od,i=new $a,o=new Aa,a=new Dd(n),u=O(t.sessionHandler).with({create:ft.any,close:ft.any},f=>f).with({accessToken:ft.string},f=>new Oa(e,o,n,f)).with({sessionCreateUrl:ft.string,sessionDeleteUrl:ft.string},f=>new Ma(o,f)).exhaustive(),s=new _d(u,e,n,r,i,a),l=(f,h)=>c(new Md(f,h),d=>new $d(d),d=>new jd(d),d=>new Ud(d,!1));return new qa(s,l)}const Bd=Xe.equals,Vd=Ia.equals,Fd=Ea.equals,Gd=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:kn,AttributeInterpreter:sd,AttributeType:it,ChoiceValueDecisionState:be,ChoiceValueInterpreter:Zf,ClientSideSessionLifetimeHandler:Oa,ComponentDecisionState:Me,ConfigurationConflictReason:Ur,ConfigurationInterpreter:wd,ConfigurationModelSourceType:ge,ConfiguratorClient:qa,ConstraintType:un,ContractToRestMapper:Aa,DecisionKind:Se,ExplainQuestionSubject:jt,ExplainQuestionType:Rt,FailureType:wt,Inclusion:Ge,QuestionBuilder:Td,Results:Af,Selection:Fe,ServerSideSessionLifetimeHandler:Ma,Types:xf,causedByDecisionEquals:Fd,createClient:kd,explainQuestionBuilder:Qa,globalAttributeIdEquals:Bd,globalConstraintIdEquals:Vd},Symbol.toStringTag,{value:"Module"}));function ts(t){return function(n,r,i,o,a,u,s){return t(n,r,s)}}function kr(t){return function(n,r,i,o){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i,o);var a=o.get(n),u=o.get(r);if(a&&u)return a===r&&u===n;o.set(n,r),o.set(r,n);var s=t(n,r,i,o);return o.delete(n),o.delete(r),s}}function es(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n}function Po(t){return t.constructor===Object||t.constructor==null}function Ro(t){return typeof t.then=="function"}function Br(t,e){return t===e||t!==t&&e!==e}var Ld="[object Arguments]",zd="[object Boolean]",Hd="[object Date]",Wd="[object RegExp]",Kd="[object Map]",Jd="[object Number]",Xd="[object Object]",Yd="[object Set]",Qd="[object String]",jo=Object.prototype.toString;function Vr(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,o=t.areRegExpsEqual,a=t.areSetsEqual,u=t.createIsNestedEqual,s=u(l);function l(f,h,d){if(f===h)return!0;if(!f||!h||typeof f!="object"||typeof h!="object")return f!==f&&h!==h;if(Po(f)&&Po(h))return i(f,h,s,d);var y=Array.isArray(f),m=Array.isArray(h);if(y||m)return y===m&&e(f,h,s,d);var v=jo.call(f);return v!==jo.call(h)?!1:v===Hd?n(f,h,s,d):v===Wd?o(f,h,s,d):v===Kd?r(f,h,s,d):v===Yd?a(f,h,s,d):v===Xd||v===Ld?Ro(f)||Ro(h)?!1:i(f,h,s,d):v===zd||v===Jd||v===Qd?Br(f.valueOf(),h.valueOf()):!1}return l}function ns(t,e,n,r){var i=t.length;if(e.length!==i)return!1;for(;i-- >0;)if(!n(t[i],e[i],i,i,t,e,r))return!1;return!0}var Zd=kr(ns);function rs(t,e){return Br(t.valueOf(),e.valueOf())}function is(t,e,n,r){var i=t.size===e.size;if(!i)return!1;if(!t.size)return!0;var o={},a=0;return t.forEach(function(u,s){if(i){var l=!1,f=0;e.forEach(function(h,d){!l&&!o[f]&&(l=n(s,d,a,f,t,e,r)&&n(u,h,s,d,t,e,r))&&(o[f]=!0),f++}),a++,i=l}}),i}var th=kr(is),eh="_owner",nh=Object.prototype.hasOwnProperty;function os(t,e,n,r){var i=Object.keys(t),o=i.length;if(Object.keys(e).length!==o)return!1;for(var a;o-- >0;){if(a=i[o],a===eh){var u=!!t.$$typeof,s=!!e.$$typeof;if((u||s)&&u!==s)return!1}if(!nh.call(e,a)||!n(t[a],e[a],a,a,t,e,r))return!1}return!0}var rh=kr(os);function as(t,e){return t.source===e.source&&t.flags===e.flags}function ss(t,e,n,r){var i=t.size===e.size;if(!i)return!1;if(!t.size)return!0;var o={};return t.forEach(function(a,u){if(i){var s=!1,l=0;e.forEach(function(f,h){!s&&!o[l]&&(s=n(a,f,u,h,t,e,r))&&(o[l]=!0),l++}),i=s}}),i}var ih=kr(ss),us=Object.freeze({areArraysEqual:ns,areDatesEqual:rs,areMapsEqual:is,areObjectsEqual:os,areRegExpsEqual:as,areSetsEqual:ss,createIsNestedEqual:ts}),cs=Object.freeze({areArraysEqual:Zd,areDatesEqual:rs,areMapsEqual:th,areObjectsEqual:rh,areRegExpsEqual:as,areSetsEqual:ih,createIsNestedEqual:ts}),oh=Vr(us);function ah(t,e){return oh(t,e,void 0)}Vr(es(us,{createIsNestedEqual:function(){return Br}}));Vr(cs);Vr(es(cs,{createIsNestedEqual:function(){return Br}}));/*! *****************************************************************************
|
|
4
|
+
${JSON.stringify(e,null,2)}`)}var Cs=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(Cs||{}),Lb=(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))(Lb||{});const KI=e=>Object.values(Lb).includes(e),YI=e=>KI(e)?je(e):ge;function XI(e){const t=n=>ue(n).with("ConfigurationModelNotFound",()=>({type:Ce.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:Ce.DecisionsToRespectInvalid})).with(Ct.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:Ce.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:Ce.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:Ce.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:Ce.ConfigurationConflict,reason:ph.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:Ce.ConfigurationConflict})).with(Ct.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:Ce.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:Ce.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:Ce.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:Ce.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:Ce.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return C(e.type,YI,ee(t))}const JI=e=>Object.values(Cs).includes(e),QI=e=>JI(e)?je(e):ge;function ZI(e){return C(e,QI,ee(n=>ue(n).with("Generic::LocalClientError",()=>({type:Ce.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:Ce.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:Ce.CommunicationError})).with("Generic::Unauthorized",()=>({type:Ce.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:Ce.Unknown})).exhaustive()))}function Fr(e,t){HI(e,t);const n=e.type;return C(ge,Xv(()=>XI(e)),Xv(()=>ZI(n)),ut(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:Ce.Unknown})))}let Vb=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 C(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),mr(r=>Fr(r,"ClientSideSessionLifetimeHandler - create")),hr(r=>this.restToDomainMapper.mapToSessionId(r)),RI(()=>({type:Ce.ConfigurationUnauthenticated})))}close(t){return C(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),mr(n=>Fr(n,"ClientSideSessionLifetimeHandler - close")),Kt(()=>qr()))}};var Bb=(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))(Bb||{});function Mr(e,t,n){const r=C(Array.isArray(e)?e:[e],mI);return C(Jv(()=>fetch(r,t),i=>({type:"error"})),hr(i=>C(Jv(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),xb(i=>i.status===401?Si({type:Cs.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?Na({response:i,data:{}}):i.type==="error"?Si({type:Cs.LowLevelCommunicationError}):Si({type:Cs.UnhandledResponseStatus})),hr(i=>C(n(i),uh(()=>i.data))))}function Sd(e,t){return Mr(e,t,n=>{if(n.response.status===200)return bi(n.data);if(n.response.status===409){const r=n.data;return ue(r).with({type:"ConfigurationModelInvalid"},i=>bi(r)).with({type:"ConfigurationModelNotFeasible"},i=>bi(r)).otherwise(()=>ge)}return ge})}let eA=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 Sd([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 Sd([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 Mr([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 Mr([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 Mr([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 Mr([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 Mr([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 Mr([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 Mr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?je({}):ge)}};var go=(e=>(e.Included="Included",e.Excluded="Excluded",e))(go||{}),Cd=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Cd||{}),wd=(e=>(e.Always="Always",e.Optional="Optional",e))(wd||{}),js=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(js||{}),Ur=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Ur||{}),qn=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(qn||{}),xd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(xd||{}),Ed=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(Ed||{}),us=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(us||{});const jn=yn({localId:ft,componentPath:Tl(ft),sharedConfigurationModelId:fh(ft)});let Ub=class{mapToDecisions(t){return{}}mapToSessionId(t){return ue(t).with({sessionId:Ct.string},n=>Na(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=C(n.constraintExplanations,z(i=>this.mapToConstraintExplanation(i)));return Si({type:Ce.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Si({type:Ce.ConfigurationModelInvalid})).otherwise(()=>Si({type:Ce.Unknown}))}mapToExplainAnswer(t,n){const r=ue(n).with({question:Gn.whyIsStateNotPossible,subject:dn.boolean},a=>[{type:Ee.Boolean,attributeId:a.attributeId,value:je(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:dn.numeric},a=>[{type:Ee.Numeric,attributeId:a.attributeId,value:je(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:dn.component},a=>[{type:Ee.Component,attributeId:a.attributeId,state:je(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:dn.choiceValue},a=>[{type:Ee.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:je(a.state)}]).otherwise(()=>[]),i=C(t.decisionExplanations,z(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=C(t.constraintExplanations,z(a=>this.mapToConstraintExplanation(a)));return ue(n).with({answerType:co.decisions},()=>({decisionExplanations:i})).with({answerType:co.constraints},()=>({constraintExplanations:o})).with({answerType:co.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:Ce.ConfigurationSetManyConflict,decisionExplanations:C(t.decisionExplanations,z(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:C(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:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Se(t.state)}}mapToNumericDecision(t){return{type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Se(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 C(this.mapToDecisionState(t.state),ee(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:C(t.causedByRules,z(n=>this.mapToRuleConstraint(n))),causedByCardinalities:C(t.causedByCardinalities,z(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:pa.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:pa.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=C(t.booleanDecisions??[],z(a=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Se(a.state)}))),r=C(t.numericDecisions??[],z(a=>({type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Se(a.state)}))),i=C(t.componentDecisions??[],z(a=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:C(Se(a.state),ee(s=>this.mapToDecisionState(s)),hd)}))),o=C(t.choiceDecisions??[],z(a=>({type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:C(Se(a.state),ee(s=>this.mapToDecisionState(s)),hd)})));return C([],Ne(n),Ne(r),Ne(i),Ne(o))}mapToDecisionExplanation(t,n,r){const i=C(t.causedByBooleanDecisions,z(h=>this.mapToCausedByBooleanDecision(h))),o=C(t.causedByNumericDecisions,z(h=>this.mapToCausedByNumericDecision(h))),a=C(t.causedByComponentDecisions,z(h=>this.mapToCausedByComponentDecision(h))),s=C(t.causedByChoiceDecisions,z(h=>this.mapToCausedByChoiceValueDecision(h))),u=C(i,z(h=>({type:Ee.Boolean,attributeId:h.attributeId,value:ge}))),c=C(o,z(h=>({type:Ee.Numeric,attributeId:h.attributeId,value:ge}))),l=C(a,z(h=>({type:Ee.Component,attributeId:h.attributeId,state:ge}))),f=C(s,z(h=>({type:Ee.ChoiceValue,attributeId:h.attributeId,choiceValueId:h.choiceValueId,state:ge}))),d=C([],Ne(u),Ne(c),Ne(l),Ne(f)),p=mb(On((h,v)=>{const x=bn.equals(h.attributeId,v.attributeId);return ue({a:h,b:v}).with({a:{type:Ee.ChoiceValue},b:{type:Ee.ChoiceValue}},E=>x&&E.a.choiceValueId===E.b.choiceValueId).otherwise(()=>x)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:C([],Ne(d),Ne(p)),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(xd.NotAvailable,()=>bd.NotAvailable).with(xd.StateNotPossible,()=>bd.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 C(n.canAttributeContributeToConfigurationSatisfaction,fn(p=>jn.equals(p,d)),ss)}const i=C([],Ne(C(t.choiceValueDecisions,z(d=>d.attributeId))),Ne(C(n.choiceConsequences,z(d=>d.attributeId))),oa(jn)),o=C(i,z(d=>{const p=C(t.choiceValueDecisions??[],UE(v=>jn.equals(v.attributeId,d))),h=C(n.choiceConsequences??[],Yi(v=>jn.equals(v.attributeId,d)));return C(h,ee(v=>this.mapToChoiceAttributes(v,p,r(d))))}),Kn),a=C([],Ne(C(t.numericDecisions,z(d=>d.attributeId))),Ne(C(n.numericConsequences,z(d=>d.attributeId))),oa(jn)),s=C(a,z(d=>{const p=C(t.numericDecisions??[],Yi(v=>jn.equals(v.attributeId,d))),h=C(n.numericConsequences??[],Yi(v=>jn.equals(v.attributeId,d)));return C(h,ee(v=>this.mapToNumericAttribute(v,p,r(d))))}),Kn),u=C([],Ne(C(t.booleanDecisions,z(d=>d.attributeId))),Ne(C(n.booleanConsequences,z(d=>d.attributeId))),oa(jn)),c=C(u,z(d=>{const p=C(t.booleanDecisions??[],Yi(v=>jn.equals(v.attributeId,d))),h=C(n.booleanConsequences??[],Yi(v=>jn.equals(v.attributeId,d)));return C(h,ee(v=>this.mapToBooleanAttribute(v,p,r(d))))}),Kn),l=C([],Ne(C(t.componentDecisions,z(d=>d.attributeId))),Ne(C(n.componentConsequences,z(d=>d.attributeId))),oa(jn)),f=C(l,z(d=>{const p=C(t.componentDecisions??[],Yi(v=>jn.equals(v.attributeId,d))),h=C(n.componentConsequences??[],Yi(v=>jn.equals(v.attributeId,d)));return C(h,ee(v=>this.mapToComponentAttribute(v,p,r(d))))}),Kn);return C([],Ne(o),Ne(f),Ne(s),Ne(c))}mapToComponentAttribute(t,n,r){return{type:ct.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:C(t.possibleDecisionStates,uc(i=>this.mapToPossibleDecisionState(i))),decision:C(n,ir(i=>C(this.mapToDecisionState(i.state),ee(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:C(t.selection,Se,ee(i=>this.mapToSelection(i)),kt),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=C(t.values,uc(o=>{const a=C(n,fn(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:C(n,ir(i=>C(i.state,Se,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:C(n,ir(i=>C(i.state,Se,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=C(t.possibleDecisionStates,uc(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:C(n,ir(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return ue(t).with(js.Implicit,()=>Nt.Implicit).with(js.Explicit,()=>Nt.Explicit).exhaustive()}mapToDecisionState(t){return ue(t).with(Ur.Included,()=>je(Xt.Included)).with(Ur.Excluded,()=>je(Xt.Excluded)).with(Ur.Undefined,()=>ge).exhaustive()}mapToPossibleDecisionState(t){return ue(t).with(go.Included,()=>Xt.Included).with(go.Excluded,()=>Xt.Excluded).exhaustive()}mapToSelection(t){return ue(t).with(Cd.Mandatory,()=>mo.Mandatory).with(Cd.Optional,()=>mo.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(wd.Always,()=>yo.Always).with(wd.Optional,()=>yo.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},Gb=class{constructor(t,n){this.restToDomainMapper=new Ub,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=Sd(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return C(r,mr(i=>Fr(i,"ServerSideSessionLifetimeHandler - create")),hr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return C(Mr(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===Bb.NoContent?je({}):ge),mr(n=>Fr(n,"ServerSideSessionLifetimeHandler - close")),Kt(qr))}};const hh={whyIsNotSatisfied:{configuration:{question:Cn.whyIsNotSatisfied,subject:Ut.configuration},attribute:e=>({question:Cn.whyIsNotSatisfied,subject:Ut.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:Cn.whyIsStateNotPossible,subject:Ut.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:Cn.whyIsStateNotPossible,subject:Ut.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:Cn.whyIsStateNotPossible,subject:Ut.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:Cn.whyIsStateNotPossible,subject:Ut.component,attributeId:e,state:t})})}},tA=Object.freeze(Object.defineProperty({__proto__:null,explainQuestionBuilder:hh},Symbol.toStringTag,{value:"Module"}));let nA=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=ge}setOnConfigurationChangedHandler(t){const n=C(t,Se,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 C(this.inner.setSessionContext(n),Kt(qr),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await C(this.inner.restoreConfiguration(n),Kt(qr),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await C(this.inner.makeDecision(n),Kt(qr),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await C(this.inner.setMany(r,i),Kt(qr),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await C(this.inner.applySolution(n),Kt(qr),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(hh):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await C(this.inner.explain(i),Kt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await C(this.inner.close(),mr(t=>this.domainToContractMapper.mapToFailureResult(t)),Rc(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Xn(mr(t=>this.domainToContractMapper.mapToFailureResult(t)),Rc(t=>Promise.reject(t),t=>Promise.resolve(t)))}},rA=class{mapToExplainQuestion(t,n){const r={answerType:ue(n).with("decisions",()=>co.decisions).with("constraints",()=>co.constraints).with("full",()=>co.all).exhaustive()};return ue(t).with({question:Cn.whyIsNotSatisfied,subject:Ut.configuration},i=>({...r,question:Gn.whyIsNotSatisfied,subject:dn.configuration})).with({question:Cn.whyIsNotSatisfied,subject:Ut.attribute},i=>({...r,question:Gn.whyIsNotSatisfied,subject:dn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:Cn.whyIsStateNotPossible,subject:Ut.choiceValue},i=>({...r,question:Gn.whyIsStateNotPossible,subject:dn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:Cn.whyIsStateNotPossible,subject:Ut.component},i=>({...r,question:Gn.whyIsStateNotPossible,subject:dn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:Cn.whyIsStateNotPossible,subject:Ut.numeric},i=>({...r,question:Gn.whyIsStateNotPossible,subject:dn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:Cn.whyIsStateNotPossible,subject:Ut.boolean},i=>({...r,question:Gn.whyIsStateNotPossible,subject:dn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:C(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return C(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 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:Se(n.state)})).with({type:Oe.Boolean},n=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:Se(n.state)})).with({type:Oe.Component},n=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:C(Se(n.state),ir(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return C(Se(t),ee(n=>C(n,z(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:C(r.decisions,z(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:zr.Package},n=>({type:Ms.Package,configurationModelPackage:n.configurationModelPackage})).with({type:zr.Channel},n=>({type:Ms.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:C(t.decisions,z(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:C(n.decision,Se,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:C(n.decision,Se,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:C(n.values,z(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Component},n=>({type:ct.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:C(n.decision,Se,ir(r=>C(this.mapToDecisionStateOption(r.state),ee(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:C(n.possibleDecisionStates,z(r=>this.mapToDecisionStateOption(r)),Kn),selection:C(n.selection,Se,ee(r=>this.mapToSelection(r)),kt),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:C(t.possibleDecisionStates,z(n=>this.mapToDecisionStateOption(n)),Kn)}}mapToChoiceValueDecision(t){return C(t.decision,Se,ir(n=>C(this.mapToDecisionStateOption(n.state),ee(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return ue(t).with($r.Implicit,()=>Nt.Implicit).with($r.Explicit,()=>Nt.Explicit).exhaustive()}mapToSelection(t){return ue(t).with(Ar.Mandatory,()=>mo.Mandatory).with(Ar.Optional,()=>mo.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(Oi.Always,()=>yo.Always).with(Oi.Optional,()=>yo.Optional).exhaustive()}mapToDecisionState(t){return ue(t).with(Ct.union(Wr.Included,$i.Included),()=>Xt.Included).with(Ct.union(Wr.Excluded,$i.Excluded),()=>Xt.Excluded).exhaustive()}mapToDecisionStateOption(t){return C(Se(t),ee(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return C(t,Se,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return C(t,Se,ee(n=>ue(n).returnType().with({type:an.all},()=>({type:lo.all})).with({type:an.none},()=>({type:lo.none})).with({type:an.specific},r=>({type:lo.specific,rules:C(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()))}},zb=class{mapToExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},i=>C(i.decisionExplanations,z(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=ue(t).with({constraintExplanations:Ct.array(Ct.any)},i=>C(i.constraintExplanations,z(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:C(t.causedByCardinalities,z(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:C(t.causedByRules,z(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=C(t.causedByChoiceDecisions,z(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=C(t.causedByComponentDecisions,z(a=>this.mapToCausedByComponentAttributeDecision(a))),i=C(t.causedByNumericDecisions,z(a=>this.mapToCausedByNumericAttributeDecision(a))),o=C(t.causedByBooleanDecisions,z(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:C([],Ne(n),Ne(r),Ne(i),Ne(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:C(t.decisions,z(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:Ce.ConfigurationConflict},n=>({type:Bt.ConfigurationConflict,reason:ue(n.reason).with(ph.NumericDecisionOutOfRange,()=>Il.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:Ce.ConfigurationApplicationError},()=>({type:Bt.ConfigurationApplicationError})).with({type:Ce.ConfigurationUnauthenticated},()=>({type:Bt.ConfigurationUnauthenticated})).with({type:Ce.ConfigurationModelNotFound},()=>({type:Bt.ConfigurationModelNotFound})).with({type:Ce.ConfigurationTimeout},()=>({type:Bt.ConfigurationTimeout})).with({type:Ce.ConfigurationAttributeNotFound},()=>({type:Bt.ConfigurationAttributeNotFound})).with({type:Ce.ConfigurationChoiceValueNotFound},()=>({type:Bt.ConfigurationChoiceValueNotFound})).with({type:Ce.ConfigurationSolutionNotAvailable},()=>({type:Bt.ConfigurationSolutionNotAvailable})).with({type:Ce.ConfigurationRejectedDecisionsConflict},n=>{const r=C(n.rejectedDecisions,z(i=>this.mapToExplicitDecision(i)));return qb.createConfigurationRejectedDecisionsConflict(r)}).with({type:Ce.DecisionsToRespectInvalid},()=>({type:Bt.DecisionsToRespectInvalid})).with({type:Ce.ServiceError},()=>({type:Bt.ServiceError})).with({type:Ce.CommunicationError},()=>({type:Bt.CommunicationError})).with({type:Ce.Unknown},()=>({type:Bt.Unknown})).with({type:Ce.ConfigurationModelInvalid},()=>({type:Bt.ConfigurationModelInvalid})).with({type:Ce.ConfigurationInitializationFailure},()=>({type:Bt.ConfigurationInitializationFailure})).with({type:Ce.ConfigurationModelNotFeasible},n=>({type:Bt.ConfigurationModelNotFeasible,constraintExplanations:C(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:Ce.ConfigurationSetManyConflict},n=>({type:Bt.ConfigurationSetManyConflict,decisionExplanations:C(n.decisionExplanations,z(r=>this.mapToDecisionExplanation(r))),constraintExplanations:C(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:Ce.SpecifiedDeploymentForbidden},n=>({type:Bt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:C(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return C(t,ee(Xn(z(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:C(n.decisions,z(r=>this.mapToGlobalAttributeId(r)))})))),rr)}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:Ms.Package},n=>({type:zr.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Ms.Channel},n=>({type:zr.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:C(n.state,ee(r=>this.mapToChoiceValueDecisionState(r)),kt),choiceValueId:n.choiceValueId})).with({type:Ee.Component},n=>({type:Oe.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:C(n.state,ee(r=>this.mapToComponentDecisionState(r)),kt)})).with({type:Ee.Numeric},n=>({type:Oe.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:C(n.value,kt)})).with({type:Ee.Boolean},n=>({type:Oe.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:C(n.value,kt)})).exhaustive()}mapToCardinality(t){return ue(t).with(pa.Cardinality,()=>da.Cardinality).with(pa.Component,()=>da.Component).with(pa.Rule,()=>da.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(mo.Mandatory,()=>Ar.Mandatory).with(mo.Optional,()=>Ar.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:C(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),rr),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ct.Numeric},r=>({...n,type:Oe.Numeric,decision:C(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),rr),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ct.Choice},r=>({...n,type:Oe.Choice,cardinality:r.cardinality,values:C(r.values,z(i=>{const o=C(i.decision,ee(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),rr);return{id:i.choiceValueId,possibleDecisionStates:C(i.possibleDecisionStates,z(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ct.Component},r=>({...n,type:Oe.Component,decision:C(r.decision,ee(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),rr),possibleDecisionStates:C(r.possibleDecisionStates,z(i=>this.mapToComponentDecisionState(i))),selection:C(r.selection,Se,ee(i=>this.mapToSelection(i)),kt),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return ue(t).with(yo.Always,()=>Oi.Always).with(yo.Optional,()=>Oi.Optional).exhaustive()}mapToComponentDecisionState(t){return ue(t).with(Xt.Included,()=>$i.Included).with(Xt.Excluded,()=>$i.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return ue(t).with(Xt.Included,()=>Wr.Included).with(Xt.Excluded,()=>Wr.Excluded).exhaustive()}mapToDecisionKind(t){return ue(t).with(Nt.Explicit,()=>$r.Explicit).with(Nt.Implicit,()=>$r.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return C(t,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),rr)}mapToAllowedRulesInExplain(t){return C(t,ee(n=>ue(n).returnType().with({type:lo.all},()=>({type:an.all})).with({type:lo.none},()=>({type:an.none})).with({type:lo.specific},r=>({type:an.specific,rules:C(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()),rr)}},Wb=class{constructor(t,n){this.contractToDomainMapper=new rA,this.domainToContractMapper=new zb,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await C(this.sessionHandler.recreate(n),Kt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new nA(i,this.contractToDomainMapper,this.domainToContractMapper)}),Rc(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 vh(e){return e.possibleDecisionStates.some(t=>t===Wr.Included)}function Hb(e){return!vh(e)}const iA=Object.freeze(Object.defineProperty({__proto__:null,isAllowed:vh,isBlocked:Hb},Symbol.toStringTag,{value:"Module"}));function oA(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.lowerBound>0).with({type:Oe.Boolean},t=>t.selection===Ar.Mandatory).with({type:Oe.Numeric},t=>t.selection===Ar.Mandatory).with({type:Oe.Component},t=>t.inclusion===Oi.Optional&&t.selection===Ar.Mandatory).exhaustive()}function aA(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function sA(e){return C(e.values,zt(vh))}function uA(e){return C(e.values,zt(Hb))}function Kb(e,t){return C(e.values,No(n=>C(n.decision,Se,Ht(r=>r.kind===t))))}function Yb(e){return C(e.values,zt(t=>C(t.decision,Se,ee(n=>n.state===Wr.Included),ut(()=>!1))))}const cA=Yb;function Xb(e){return C(e.decision,Se,Ht(t=>t.kind===$r.Explicit),rr)}function Jb(e){return C(e.decision,Se,Ht(t=>t.kind===$r.Explicit),rr)}function lA(e,t){return e.possibleDecisionStates.some(n=>n===t)}function Qb(e){return C(e.decision,Se,rr)}function Zb(e){return eS(e,$i.Included)}function fA(e){return!Zb(e)}function eS(e,t){return e.possibleDecisionStates.some(n=>n===t)}const dA=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:sA,getBlockedChoiceValues:uA,getBooleanDecision:Jb,getChoiceDecisions:Kb,getComponentDecision:Qb,getIncludedChoiceValues:Yb,getNumericDecision:Xb,getSelectedChoiceValues:cA,isBooleanValuePossible:lA,isComponentAllowed:Zb,isComponentBlocked:fA,isComponentStatePossible:eS,isMandatory:oA,isMultiSelect:aA},Symbol.toStringTag,{value:"Module"})),tS=e=>e.type===Oe.Boolean,nS=e=>e.type===Oe.Choice,rS=e=>e.type===Oe.Numeric,iS=e=>e.type===Oe.Component,pA=su(ft),cm=qi(ft);function oS(e,t){const n=a=>pA.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return C(n,GE(t?a=>cm.equals(C(a.componentPath??[],DE(r)),e.componentPath):a=>cm.equals(a.componentPath??[],e.componentPath)))}function hA(e,t,n){const r=C(oS({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:C(t.componentPath??[],$E(t.localId))},n),gb(i=>i.id));return C(e,zt(r))}function vA(e,t,n){const r=C(oS({sharedConfigurationModelId:t,componentPath:[]},n),gb(i=>i.id));return C(e,zt(r))}function mA(e){return C(e,zt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function yA(e,t){return C(aS(e),z(n=>Kb(n,t)),rh,No(n=>Se(n)))}function gA(e,t){return C(uS(e),zt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Xb(n)),No(n=>Se(n)))}function bA(e,t){return C(cS(e),zt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Jb(n)),No(n=>Se(n)))}function SA(e,t){return C(sS(e),zt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Qb(n)),No(n=>Se(n)))}function aS(e){return C(e.attributes,zt(nS))}function sS(e){return C(e.attributes,zt(iS))}function uS(e){return C(e.attributes,zt(rS))}function cS(e){return C(e.attributes,zt(tS))}function CA(e,t){return C(uu(e,t),kt)}function wA(e,t){return C(lS(e,t),kt)}function xA(e,t,n){return C(lS(e,t),ee(r=>r.values),ir(Xn(fn(r=>r.id===n))),kt)}function EA(e,t){return C(uu(e,t),Ht(rS),kt)}function TA(e,t){return C(uu(e,t),Ht(tS),kt)}function IA(e,t){return C(uu(e,t),Ht(iS),kt)}function uu(e,t){return C(e.attributes,fn(n=>Ro.equals(n.id,t)))}function lS(e,t){return C(uu(e,t),Ht(nS))}const ko=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:hA,filterAttributesOfRoot:mA,filterAttributesOfShared:vA,getAttribute:CA,getBooleanAttribute:TA,getBooleanAttributes:cS,getBooleanDecisions:bA,getChoiceAttribute:wA,getChoiceAttributes:aS,getChoiceDecisions:yA,getChoiceValue:xA,getComponentAttribute:IA,getComponentAttributes:sS,getComponentDecisions:SA,getNumericAttribute:EA,getNumericAttributes:uS,getNumericDecisions:gA},Symbol.toStringTag,{value:"Module"})),AA="https://spc.cloud.ceventis.de/api/engine",$A={hcaEngineBaseUrl:AA};function OA(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??$A.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function Za(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const fS=e=>t=>n=>C(n,NE(r=>e.equals(r,t)),ee(r=>C(n,PE(r,i=>t))),hd,ut(()=>C(n,Ne(kE(t))))),Nu=fS({equals:(e,t)=>bn.equals(e.attributeId,t.attributeId)}),DA=fS({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let NA=class{constructor(t){this.restToDomainMapper=t}updateConfigurationSession(t,n){const r=this.updateConfiguration(t.configuration,n);return{...t,configuration:r}}updateConfiguration(t,n){var r,i,o,a,s,u,c,l,f,d;const p=C(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],z(this.restToDomainMapper.mapToGlobalAttributeId)),h=I=>nh(bn)(I,p),v=C(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=C(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=C(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),y=C(((s=n.consequences)==null?void 0:s.componentConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),S=C(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),w=C(((c=n.consequences)==null?void 0:c.numericConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=C(((l=n.affectedDecisions)==null?void 0:l.booleanDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=C(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=C([],Ne(C(b,z(I=>I.attributeId))),Ne(C(T,z(I=>I.attributeId))),Ne(C(S,z(I=>I.attributeId))),Ne(C(w,z(I=>I.attributeId))),Ne(C(v,z(I=>I.attributeId))),Ne(C(x,z(I=>I.attributeId))),Ne(C(E,z(I=>I.attributeId))),Ne(C(y,z(I=>I.attributeId))),oa(bn)),D=C(A,dd(t.attributes,(I,N)=>{const _=t.attributes.find(L=>bn.equals(L.attributeId,N));return ue(_).with({type:ct.Choice},(L,B)=>{const K=this.mergeChoice(B,C(x,fn(k=>bn.equals(k.attributeId,N)),ee(k=>k.payload)),C(v,zt(k=>bn.equals(k.attributeId,N)),z(k=>k.payload)));return Nu(K)(I)}).with({type:ct.Numeric},(L,B)=>{const K=this.mergeNumeric(B,C(w,fn(k=>bn.equals(k.attributeId,N)),ee(k=>k.payload)),C(S,fn(k=>bn.equals(k.attributeId,N)),ee(k=>k.payload)));return Nu(K)(I)}).with({type:ct.Boolean},(L,B)=>{const K=this.mergeBoolean(B,C(T,fn(k=>bn.equals(k.attributeId,N)),ee(k=>k.payload)),C(b,fn(k=>bn.equals(k.attributeId,N)),ee(k=>k.payload)));return Nu(K)(I)}).with({type:ct.Component},(L,B)=>{const K=this.mergeComponent(B,C(y,fn(k=>bn.equals(k.attributeId,N)),ee(k=>k.payload)),C(E,fn(k=>bn.equals(k.attributeId,N)),ee(k=>k.payload)));return Nu(K)(I)}).exhaustive()}),z(I=>{const N=h(I.attributeId);return I.canContributeToConfigurationSatisfaction!=N?{...I,canContributeToConfigurationSatisfaction:N}:I}));return{...t,isSatisfied:C((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,Se,ut(()=>t.isSatisfied)),attributes:D}}mergeChoice(t,n,r){const i=C(n,ee(u=>u.values??[]),ut(()=>[])),o=C(r),a=C([],Ne(C(i,z(u=>u.choiceValueId))),Ne(C(o,z(u=>u.choiceValueId))),z(Za),oa(ft)),s=C(a,dd(t.values,(u,c)=>{const l=C(i,fn(h=>h.choiceValueId===c)),f=C(o,fn(h=>h.choiceValueId===c)),d=C(t.values.find(h=>h.choiceValueId===c),Se),p=this.mergeChoiceValue(c,d,l,f);return DA(p)(u)}));return{...t,isSatisfied:C(n,ee(u=>Za(u.isSatisfied)),ut(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=C(i,ee(s=>({state:this.toDecisionState(Za(s.state)),kind:this.toDecisionKind(Za(s.kind))})),ut(()=>({state:C(n,ir(s=>C(s.decision,ee(u=>u.state)))),kind:C(n,ir(s=>C(s.decision,ee(u=>u.kind))),ut(()=>Nt.Explicit))}))),a=C(r,ee(s=>C(Yv(s.possibleDecisionStates??[]),z(u=>this.toPossibleDecisionState(u)),Kn)),ut(()=>C(n,ee(s=>s.possibleDecisionStates??[]),ut(()=>[]))));return{choiceValueId:t,decision:C(o.state,ee(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=C(r,ee(a=>{const s=this.toDecisionState(Za(a.state));return C(s,ee(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),ut(()=>C(t.decision,ee(a=>({state:a.state,kind:a.kind}))))),o=C(n,ee(a=>C(Yv(a.possibleDecisionStates??[]),z(s=>this.toPossibleDecisionState(s)),Kn)),ut(()=>t.possibleDecisionStates));return{...t,isSatisfied:C(n,ee(a=>a.isSatisfied),ut(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:C(n,ir(i=>Se(i.isSatisfied)),ut(()=>t.isSatisfied)),decision:C(r,Ai(()=>t.decision,i=>C(i.state,Se,ee(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:C(n,ir(i=>Se(i.isSatisfied)),ut(()=>t.isSatisfied)),decision:C(r,Ai(()=>t.decision,i=>C(i.state,Se,ee(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:C(n,ee(i=>i.possibleDecisionStates),ut(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return ue(t).with(go.Included,()=>je(Xt.Included)).with(go.Excluded,()=>je(Xt.Excluded)).otherwise(()=>ge)}toDecisionState(t){return ue(t).with(Ur.Included,()=>je(Xt.Included)).with(Ur.Excluded,()=>je(Xt.Excluded)).otherwise(()=>ge)}toDecisionKind(t){return ue(t).with(js.Implicit,()=>Nt.Implicit).with(js.Explicit,()=>Nt.Explicit).exhaustive()}},PA=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>({type:qn.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ee.Component},n=>({type:qn.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ee.Numeric},n=>({type:qn.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:C(n.value,kt)})).with({type:Ee.Boolean},n=>({type:qn.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:C(n.value,kt)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=C([...t],oi(u=>u.type!==Ee.Boolean?ge:je({type:qn.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:C(u.value,kt)}))),o=C([...t],oi(u=>u.type!==Ee.Numeric?ge:je({type:qn.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:C(u.value,kt)}))),a=C([...t],oi(u=>u.type!==Ee.ChoiceValue?ge:je({type:qn.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=C([...t],oi(u=>u.type!==Ee.Component?ge:je({type:qn.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=C([...t],oi(a=>a.type!==ct.Boolean?ge:C(a.decision,Ht(s=>s.kind===Nt.Explicit),ee(()=>this.mapToExplicitBooleanDecision(a))))),r=C([...t],oi(a=>a.type!==ct.Numeric?ge:C(a.decision,Ht(s=>s.kind===Nt.Explicit),ee(()=>this.mapToExplicitNumericDecision(a))))),i=C([...t],oi(a=>a.type!==ct.Component?ge:C(a.decision,Ht(s=>s.kind===Nt.Explicit),ee(()=>this.mapToExplicitComponentDecision(a))))),o=C([...t],oi(a=>a.type!==ct.Choice?ge:C(this.mapToExplicitChoiceDecisions(a),au(s=>C(s,ou)))),VE);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:C(t.componentPath,Se,ee(pd),rr),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:qn.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:C(t.decision,ee(n=>n.state),kt)}}mapToExplicitNumericDecision(t){return{type:qn.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:C(t.decision,ee(n=>n.state),kt)}}mapToExplicitComponentDecision(t){return{type:qn.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(C(t.decision,ee(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return C(r.decision,ee(i=>i.kind===Nt.Explicit),ut(()=>!1))}return C(t.values,zt(n),z(r=>({type:qn.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(C(r.decision,ee(i=>i.state)))})),pd)}mapToDecisionState(t){return C(t,ee(n=>ue(n).with(Xt.Included,()=>Ur.Included).with(Xt.Excluded,()=>Ur.Excluded).exhaustive()),ut(()=>Ur.Undefined))}mapToPossibleDecisionState(t){return ue(t).with(Xt.Included,()=>go.Included).with(Xt.Excluded,()=>go.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return ue(t).with({subject:dn.attribute},n=>({type:Ed.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:dn.configuration},()=>({type:Ed.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return ue(t).with({subject:dn.boolean},n=>({type:us.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:dn.numeric},n=>({type:us.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:dn.component},n=>({type:us.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:dn.choiceValue},n=>({type:us.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},RA=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return C(t.configuration.attributes,fn(n=>ue(n).with({type:ct.Boolean},r=>C(r.decision,Ht(i=>i.kind===Nt.Explicit),ss)).with({type:ct.Numeric},r=>C(r.decision,Ht(i=>i.kind===Nt.Explicit),ss)).with({type:ct.Choice},r=>C(r.values,fn(i=>C(i.decision,ee(o=>o.kind===Nt.Explicit),ut(()=>!1))),ss)).with({type:ct.Component},r=>C(r.decision,Ht(i=>i.kind===Nt.Explicit),ss)).exhaustive()),Ai(()=>!1,()=>!0))},getExplicitDecisions(t){return C(t.configuration.attributes,z(n=>ue(n).with({type:ct.Boolean},r=>C(r.decision,Ht(i=>i.kind===Nt.Explicit),ee(i=>({type:Ee.Boolean,attributeId:r.attributeId,value:Se(i.state)})),ee(i=>[i]))).with({type:ct.Numeric},r=>C(r.decision,Ht(i=>i.kind===Nt.Explicit),ee(i=>({type:Ee.Numeric,attributeId:r.attributeId,value:Se(i.state)})),ee(i=>[i]))).with({type:ct.Choice},r=>C(r.values,z(i=>C(i.decision,Ht(o=>o.kind===Nt.Explicit),ee(o=>({type:Ee.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:Se(o.state)})))),Kn,bi)).with({type:ct.Component},r=>C(r.decision,Ht(i=>i.kind===Nt.Explicit),ee(i=>({type:Ee.Component,attributeId:r.attributeId,state:Se(i.state)})),ee(i=>[i]))).exhaustive()),Kn,rh)}}}},kA=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 RA}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)=>C(this.engineApiClient.makeDecision(i,r),mr(Fr),Kt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=ue(t).with({question:Gn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Gn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return C(i,mr(Fr),Kt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return C(a,hr(s=>{var u,c,l,f;return C([],Ne(C(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],z(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Ne(C(((c=s.rejectedDecisions)==null?void 0:c.numericDecisions)??[],z(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Ne(C(((l=s.rejectedDecisions)==null?void 0:l.componentDecisions)??[],z(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Ne(C(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],z(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),aa(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 C(i,Kt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return C(o,mr(Fr),hr(a=>{const s={rejectedDecisions:{booleanDecisions:Ct.array(Ct.any)}},u={decisionExplanations:Ct.array(Ct.any)};return ue(a).with(s,c=>Na(c)).with(u,c=>Si(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(c,i,n))).otherwise(()=>Si({type:Ce.Unknown}))}))}explainWhyStateNotPossible(t,n){const r=this.domainToRestMapper.mapToWhyStateNotPossibleRequest(t);return this.engineApiClient.getWhyStateNotPossible(n,r)}explainWhyNotSatisfied(t,n){const r=this.domainToRestMapper.mapToWhyNotSatisfiedRequest(t);return this.engineApiClient.getWhyNotSatisfied(n,r)}withSession(t,n){return C(aa(t),hr(r=>C(r.sessionId,Ai(()=>this.initializeInner(r,!1),()=>aa(r)))),hr(r=>C(r.sessionId,uh(()=>({type:Ce.ConfigurationUnauthenticated})),hr(i=>n(i,r)))))}initializeInner(t,n){return C(bT,()=>C(t.sessionId,OT,NT(s=>n?$T(s):C(this.sessionHandler.close(s),Rc(()=>ge,()=>ge)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return C(s,pT(()=>({type:Ce.ConfigurationUnauthenticated})),xb(()=>this.sessionHandler.create(u)))},s=>C(s,ST(u=>C(bi(t),Ht(this.interpreter.configurationSession.hasExplicitDecisions),ee(c=>this.replaceDecisions(u,c)),ut(()=>aa({}))))),s=>C(s,hr(u=>{const c=this.determineConsequences(u),l=this.determineDecisions(u),f=z1(mT)({consequences:c,decisions:l});return C(f,Kt(({decisions:d,consequences:p})=>this.restToDomainMapper.mapToConfigurationModel(d,p)),Kt(d=>({sessionId:bi(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return C(this.engineApiClient.getDecisions(t),mr(Fr))}determineConsequences(t){return C(this.engineApiClient.getConsequence(t),mr(Fr))}},MA=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 C(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return C(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:ge}}restoreConfiguration(t){return C(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return C(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return C(this.configurationSession.sessionId,ee(t=>this.sessionHandler.close(t)),ee(Xn(Kt(t=>{this.configurationSession={...this.configurationSession,sessionId:ge}}))),ut(ml(kI())))}applySolution(t){return C(this.configurationSession.solutions,fn(n=>zI.equals(n,t)),uh(()=>({type:Ce.ConfigurationSolutionNotAvailable})),Kt(n=>n.decisions),hr(n=>this.setMany(n,t.mode)))}setMany(t,n){return C(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),kc(r=>()=>{const i=ue(r).with({decisionExplanations:Ct.array(Ct.any)},o=>je(o.decisionExplanations)).otherwise(()=>ge);this.configurationSession={...this.configurationSession,solutions:C(i,ee(Xn(z(o=>o.solution))),ut(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},r=>r.decisionExplanations).otherwise(()=>[]);return C(n,z(r=>r.solution))}invalidateAvailableSolutions(){return wT(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return kc(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Ns(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Xn(Ns(t=>()=>{this.configurationSession=t,C(this.onConfigurationChangedHandler,ET(n=>()=>n(this.configurationSession.configuration)))}),Kt(t=>t.configuration),this.invalidateAvailableSolutions())}},jA=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=bI(r,yI.concat(SI(i),gI(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Fo(this.policy,n,r=>C(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Fo(this.policy,n,r=>C(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Fo(this.policy,n,r=>C(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Fo(this.policy,n,r=>C(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Fo(this.policy,n,r=>C(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Fo(this.policy,r,i=>C(i,Qi(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:Ce.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:Ce.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},_A=class{constructor(){this.queue=[],this.operating=ge}push(t){const n=new qA(t);return this.queue.push(n),this.operating=C(this.operating,ut(()=>this.start()),bi),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=C(t,z(r=>r.argument),dd(ge,(r,i)=>this.reduce(r,i)),ee(Xn(r=>this.execute(r),r=>r.then(i=>{C(t,z(o=>{o.resolve(i)}))}).catch(i=>{C(t,z(o=>{o.reject(i)}))}))),kt);n&&await n}this.operating=ge}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},qA=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},FA=class extends _A{constructor(t){super(),this.inner=t}reduce(t,n){return je(n)}async execute(t){return await this.inner.setSessionContext(t)()}},LA=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new FA(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(qI.equals(n,t))return Na(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)}},VA=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)),C(r(),kc(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Ns(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)}},BA=class dS{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+jb()}static new(t){return new dS(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 UA(e){e=OA(e);const t=new eA(e.hcaEngineBaseUrl),n=new Ub,r=new PA,i=new zb,o=new Fb,a=new NA(n),s=ue(e.sessionHandler).with({create:Ct.any,close:Ct.any},l=>l).with({accessToken:Ct.string},l=>new Vb(t,o,n,l)).with({sessionCreateUrl:Ct.string,sessionDeleteUrl:Ct.string},l=>new Gb(o,l)).exhaustive(),u=new kA(s,t,n,r,i,a),c=(l,f)=>C(new MA(l,f),d=>new jA(d),d=>new LA(d),BA.new,d=>new VA(d,!1));return new Wb(u,c)}const pS=Ro.equals,hS=dh.equals,GA=_b.equals,zA=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:an,AttributeInterpreter:dA,AttributeType:Oe,ChoiceValueDecisionState:Wr,ChoiceValueInterpreter:iA,ClientSideSessionLifetimeHandler:Vb,ComponentDecisionState:$i,ConfigurationConflictReason:Il,ConfigurationInterpreter:ko,ConfigurationModelSourceType:zr,ConfiguratorClient:Wb,ConstraintType:da,ContractToRestMapper:Fb,DecisionKind:$r,ExplainQuestionBuilderModule:tA,ExplainQuestionSubject:Ut,ExplainQuestionType:Cn,FailureType:Bt,Inclusion:Oi,Results:PI,Selection:Ar,ServerSideSessionLifetimeHandler:Gb,Types:NI,causedByDecisionEquals:GA,createClient:UA,explainQuestionBuilder:hh,globalAttributeIdEquals:pS,globalConstraintIdEquals:hS},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 T=function(){return T=Object.assign||function(e){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)&&(e[o]=n[o])}return e},T.apply(this,arguments)};function Ki(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function K(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Q(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function lt(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var at;(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"})(at||(at={}));var We;(function(t){t.Parent="#_parent",t.Internal="#_internal"})(We||(We={}));var bi=at.Start,Ji=at.Stop,Jn=at.Raise,Fr=at.Send,ls=at.Cancel,sh=at.NullEvent,Xi=at.Assign;at.After;at.DoneState;var fs=at.Log,uh=at.Init,Si=at.Invoke;at.ErrorExecution;var Uo=at.ErrorPlatform,ch=at.ErrorCustom,ds=at.Update,lh=at.Choose,fh=at.Pure,hs=".",ko={},Ci="xstate.guard",dh="",vt=process.env.NODE_ENV==="production",or;function Yi(t,e,n){n===void 0&&(n=hs);var r=Rn(t,n),i=Rn(e,n);return Z(i)?Z(r)?i===r:!1:Z(r)?r in i:Object.keys(r).every(function(o){return o in i?Yi(r[o],i[o]):!1})}function ps(t){try{return Z(t)||typeof t=="number"?"".concat(t):t.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function wi(t,e){try{return yn(t)?t:t.toString().split(e)}catch{throw new Error("'".concat(t,"' is not a valid state path."))}}function hh(t){return typeof t=="object"&&"value"in t&&"context"in t&&"event"in t&&"_event"in t}function Rn(t,e){if(hh(t))return t.value;if(yn(t))return wr(t);if(typeof t!="string")return t;var n=wi(t,e);return wr(n)}function wr(t){if(t.length===1)return t[0];for(var e={},n=e,r=0;r<t.length-1;r++)r===t.length-2?n[t[r]]=t[r+1]:(n[t[r]]={},n=n[t[r]]);return e}function Nn(t,e){for(var n={},r=Object.keys(t),i=0;i<r.length;i++){var o=r[i];n[o]=e(t[o],o,t,i)}return n}function Bo(t,e,n){var r,i,o={};try{for(var a=K(Object.keys(t)),u=a.next();!u.done;u=a.next()){var s=u.value,l=t[s];n(l)&&(o[s]=e(l,s,t))}}catch(f){r={error:f}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var ph=function(t){return function(e){var n,r,i=e;try{for(var o=K(t),a=o.next();!a.done;a=o.next()){var u=a.value;i=i[u]}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function vh(t,e){return function(n){var r,i,o=n;try{for(var a=K(t),u=a.next();!u.done;u=a.next()){var s=u.value;o=o[e][s]}}catch(l){r={error:l}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function hr(t){if(!t)return[[]];if(Z(t))return[[t]];var e=pt(Object.keys(t).map(function(n){var r=t[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:hr(t[n]).map(function(i){return[n].concat(i)})}));return e}function pt(t){var e;return(e=[]).concat.apply(e,lt([],Q(t),!1))}function vs(t){return yn(t)?t:[t]}function Zt(t){return t===void 0?[]:vs(t)}function Tr(t,e,n){var r,i;if(nt(t))return t(e,n.data);var o={};try{for(var a=K(Object.keys(t)),u=a.next();!u.done;u=a.next()){var s=u.value,l=t[s];nt(l)?o[s]=l(e,n.data):o[s]=l}}catch(f){r={error:f}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function yh(t){return/^(done|error)\./.test(t)}function Vo(t){return!!(t instanceof Promise||t!==null&&(nt(t)||typeof t=="object")&&nt(t.then))}function mh(t){return t!==null&&typeof t=="object"&&"transition"in t&&typeof t.transition=="function"}function gh(t,e){var n,r,i=Q([[],[]],2),o=i[0],a=i[1];try{for(var u=K(t),s=u.next();!s.done;s=u.next()){var l=s.value;e(l)?o.push(l):a.push(l)}}catch(f){n={error:f}}finally{try{s&&!s.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return[o,a]}function ys(t,e){return Nn(t.states,function(n,r){if(n){var i=(Z(e)?void 0:e[r])||(n?n.current:void 0);if(i)return{current:i,states:ys(n,i)}}})}function bh(t,e){return{current:e,states:ys(t,e)}}function Fo(t,e,n,r){vt||xt(!!t,"Attempting to update undefined context");var i=t&&n.reduce(function(o,a){var u,s,l=a.assignment,f={state:r,action:a,_event:e},h={};if(nt(l))h=l(o,e.data,f);else try{for(var d=K(Object.keys(l)),y=d.next();!y.done;y=d.next()){var m=y.value,v=l[m];h[m]=nt(v)?v(o,e.data,f):v}}catch(w){u={error:w}}finally{try{y&&!y.done&&(s=d.return)&&s.call(d)}finally{if(u)throw u.error}}return Object.assign({},o,h)},t);return i}var xt=function(){};vt||(xt=function(t,e){var n=t instanceof Error?t:void 0;if(!(!n&&t)&&console!==void 0){var r=["Warning: ".concat(e)];n&&r.push(n),console.warn.apply(console,r)}});function yn(t){return Array.isArray(t)}function nt(t){return typeof t=="function"}function Z(t){return typeof t=="string"}function ms(t,e){if(t)return Z(t)?{type:Ci,name:t,predicate:e?e[t]:void 0}:nt(t)?{type:Ci,name:t.name,predicate:t}:t}function Sh(t){try{return"subscribe"in t&&nt(t.subscribe)}catch{return!1}}var xe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();or={},or[xe]=function(){return this},or[Symbol.observable]=function(){return this};function Ce(t){return!!t&&"__xstatenode"in t}function Ch(t){return!!t&&typeof t.send=="function"}var wh=function(){var t=0;return function(){return t++,t.toString(16)}}();function Gr(t,e){return Z(t)||typeof t=="number"?T({type:t},e):t}function Nt(t,e){if(!Z(t)&&"$$type"in t&&t.$$type==="scxml")return t;var n=Gr(t);return T({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function Ze(t,e){var n=vs(e).map(function(r){return typeof r>"u"||typeof r=="string"||Ce(r)?{target:r,event:t}:T(T({},r),{event:t})});return n}function Th(t){if(!(t===void 0||t===dh))return Zt(t)}function Ih(t,e,n){if(!vt){var r=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";if(t===e)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(t,"'.").concat(r));else{var i=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(t,"'. ").concat(r," Current error is '").concat(e,"'.").concat(i))}}}function gs(t,e,n,r,i){var o=t.options.guards,a={state:i,cond:e,_event:r};if(e.type===Ci)return((o==null?void 0:o[e.name])||e.predicate)(n,r.data,a);var u=o==null?void 0:o[e.type];if(!u)throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return u(n,r.data,a)}function bs(t){return typeof t=="string"?{type:t}:t}function pr(t,e,n){var r=function(){},i=typeof t=="object",o=i?t:null;return{next:((i?t.next:t)||r).bind(o),error:((i?t.error:e)||r).bind(o),complete:((i?t.complete:n)||r).bind(o)}}function ar(t,e){return"".concat(t,":invocation[").concat(e,"]")}function Ti(t){return(t.type===Jn||t.type===Fr&&t.to===We.Internal)&&typeof t.delay!="number"}var ln=Nt({type:uh});function Ii(t,e){return e&&e[t]||void 0}function Fn(t,e){var n;if(Z(t)||typeof t=="number"){var r=Ii(t,e);nt(r)?n={type:t,exec:r}:r?n=r:n={type:t,exec:void 0}}else if(nt(t))n={type:t.name||t.toString(),exec:t};else{var r=Ii(t.type,e);if(nt(r))n=T(T({},t),{exec:r});else if(r){var i=r.type||t.type;n=T(T(T({},r),t),{type:i})}else n=t}return n}var Ae=function(t,e){if(!t)return[];var n=yn(t)?t:[t];return n.map(function(r){return Fn(r,e)})};function Qi(t){var e=Fn(t);return T(T({id:Z(t)?t:e.id},e),{type:e.type})}function Eh(t,e){return{type:Jn,event:typeof t=="function"?t:Gr(t),delay:e?e.delay:void 0,id:e==null?void 0:e.id}}function xh(t,e,n,r){var i={_event:n},o=Nt(nt(t.event)?t.event(e,n.data,i):t.event),a;if(Z(t.delay)){var u=r&&r[t.delay];a=nt(u)?u(e,n.data,i):u}else a=nt(t.delay)?t.delay(e,n.data,i):t.delay;return T(T({},t),{type:Jn,_event:o,delay:a})}function Lr(t,e){return{to:e?e.to:void 0,type:Fr,event:nt(t)?t:Gr(t),delay:e?e.delay:void 0,id:e&&e.id!==void 0?e.id:nt(t)?t.name:ps(t)}}function Ah(t,e,n,r){var i={_event:n},o=Nt(nt(t.event)?t.event(e,n.data,i):t.event),a;if(Z(t.delay)){var u=r&&r[t.delay];a=nt(u)?u(e,n.data,i):u}else a=nt(t.delay)?t.delay(e,n.data,i):t.delay;var s=nt(t.to)?t.to(e,n.data,i):t.to;return T(T({},t),{to:s,_event:o,event:o.data,delay:a})}function Dh(t,e){return Lr(t,T(T({},e),{to:We.Parent}))}var Oh=function(t,e,n){return T(T({},t),{value:Z(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})},Nh=function(t){return{type:ls,sendId:t}};function _h(t){var e=Qi(t);return{type:at.Start,activity:e,exec:void 0}}function Mh(t){var e=nt(t)?t:Qi(t);return{type:at.Stop,activity:e,exec:void 0}}function $h(t,e,n){var r=nt(t.activity)?t.activity(e,n.data):t.activity,i=typeof r=="string"?{id:r}:r,o={type:at.Stop,activity:i};return o}var qh=function(t){return{type:Xi,assignment:t}};function Ph(t,e){var n=e?"#".concat(e):"";return"".concat(at.After,"(").concat(t,")").concat(n)}function sr(t,e){var n="".concat(at.DoneState,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function vr(t,e){var n="".concat(at.DoneInvoke,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function _n(t,e){var n="".concat(at.ErrorPlatform,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function Rh(t,e){if(!vt&&(!t||typeof t=="function")){var n=t;t=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,lt([],Q(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 Lr(function(r,i){return i},T(T({},e),{to:t}))}var jh=function(t){var e,n,r=[];try{for(var i=K(t),o=i.next();!o.done;o=i.next())for(var a=o.value,u=0;u<a.actions.length;){if(a.actions[u].type===Xi){r.push(a.actions[u]),a.actions.splice(u,1);continue}u++}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r};function Ir(t,e,n,r,i,o,a){a===void 0&&(a=!1);var u=a?[]:jh(i),s=u.length?Fo(n,r,u,e):n,l=a?[n]:void 0,f=[];function h(m,v){var w;switch(v.type){case Jn:{var E=xh(v,s,r,t.options.delays);return o&&typeof E.delay=="number"&&o(E,s,r),E}case Fr:var C=Ah(v,s,r,t.options.delays);if(!vt){var S=v.delay;xt(!Z(S)||typeof C.delay=="number","No delay reference for delay expression '".concat(S,"' was found on machine '").concat(t.id,"'"))}return o&&C.to!==We.Internal&&(m==="entry"?f.push(C):o(C,s,r)),C;case fs:{var I=Oh(v,s,r);return o==null||o(I,s,r),I}case lh:{var P=v,g=(w=P.conds.find(function(dt){var ut=ms(dt.cond,t.options.guards);return!ut||gs(t,ut,s,r,o?void 0:e)}))===null||w===void 0?void 0:w.actions;if(!g)return[];var N=Q(Ir(t,e,s,r,[{type:m,actions:Ae(Zt(g),t.options.actions)}],o,a),2),F=N[0],$=N[1];return s=$,l==null||l.push(s),F}case fh:{var g=v.get(s,r.data);if(!g)return[];var z=Q(Ir(t,e,s,r,[{type:m,actions:Ae(Zt(g),t.options.actions)}],o,a),2),q=z[0],D=z[1];return s=D,l==null||l.push(s),q}case Ji:{var I=$h(v,s,r);return o==null||o(I,n,r),I}case Xi:{s=Fo(s,r,[v],o?void 0:e),l==null||l.push(s);break}default:var et=Fn(v,t.options.actions),mt=et.exec;if(o)o(et,s,r);else if(mt&&l){var Qt=l.length-1,kt=T(T({},et),{exec:function(dt){for(var ut=[],Et=1;Et<arguments.length;Et++)ut[Et-1]=arguments[Et];mt.apply(void 0,lt([l[Qt]],Q(ut),!1))}});et=kt}return et}}function d(m){var v,w,E=[];try{for(var C=K(m.actions),S=C.next();!S.done;S=C.next()){var I=S.value,P=h(m.type,I);P&&(E=E.concat(P))}}catch(g){v={error:g}}finally{try{S&&!S.done&&(w=C.return)&&w.call(C)}finally{if(v)throw v.error}}return f.forEach(function(g){o(g,s,r)}),f.length=0,E}var y=pt(i.map(d));return[y,s]}var Er=[],rn=function(t,e){Er.push(t);var n=e(t);return Er.pop(),n},Uh=function(t){return t(Er[Er.length-1])};function Ss(t){var e;return e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}},e[xe]=function(){return this},e}function kh(t,e,n,r){var i,o=bs(t.src),a=(i=e==null?void 0:e.options.services)===null||i===void 0?void 0:i[o.type],u=t.data?Tr(t.data,n,r):void 0,s=a?Zi(a,t.id,u):Ss(t.id);return s.meta=t,s}function Zi(t,e,n){var r=Ss(e);if(r.deferred=!0,Ce(t)){var i=r.state=rn(void 0,function(){return(n?t.withContext(n):t).initialState});r.getSnapshot=function(){return i}}return r}function Bh(t){try{return typeof t.send=="function"}catch{return!1}}function Vh(t){return Bh(t)&&"id"in t}function Fh(t){var e;return T((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},e[xe]=function(){return this},e),t)}var xr=function(t){return t.type==="atomic"||t.type==="final"};function Cs(t){return Object.keys(t.states).map(function(e){return t.states[e]})}function Gn(t){return Cs(t).filter(function(e){return e.type!=="history"})}function ws(t){var e=[t];return xr(t)?e:e.concat(pt(Gn(t).map(ws)))}function Mn(t,e){var n,r,i,o,a,u,s,l,f=new Set(t),h=Ei(f),d=new Set(e);try{for(var y=K(d),m=y.next();!m.done;m=y.next())for(var v=m.value,w=v.parent;w&&!d.has(w);)d.add(w),w=w.parent}catch($){n={error:$}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}var E=Ei(d);try{for(var C=K(d),S=C.next();!S.done;S=C.next()){var v=S.value;if(v.type==="compound"&&(!E.get(v)||!E.get(v).length))h.get(v)?h.get(v).forEach(function(z){return d.add(z)}):v.initialStateNodes.forEach(function(z){return d.add(z)});else if(v.type==="parallel")try{for(var I=(a=void 0,K(Gn(v))),P=I.next();!P.done;P=I.next()){var g=P.value;d.has(g)||(d.add(g),h.get(g)?h.get(g).forEach(function(z){return d.add(z)}):g.initialStateNodes.forEach(function(z){return d.add(z)}))}}catch(z){a={error:z}}finally{try{P&&!P.done&&(u=I.return)&&u.call(I)}finally{if(a)throw a.error}}}}catch($){i={error:$}}finally{try{S&&!S.done&&(o=C.return)&&o.call(C)}finally{if(i)throw i.error}}try{for(var N=K(d),F=N.next();!F.done;F=N.next())for(var v=F.value,w=v.parent;w&&!d.has(w);)d.add(w),w=w.parent}catch($){s={error:$}}finally{try{F&&!F.done&&(l=N.return)&&l.call(N)}finally{if(s)throw s.error}}return d}function Ts(t,e){var n=e.get(t);if(!n)return{};if(t.type==="compound"){var r=n[0];if(r){if(xr(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=Ts(o,e)}),i}function Ei(t){var e,n,r=new Map;try{for(var i=K(t),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(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function Gh(t,e){var n=Mn([t],e);return Ts(t,Ei(n))}function $n(t,e){return Array.isArray(t)?t.some(function(n){return n===e}):t instanceof Set?t.has(e):!1}function Lh(t){return lt([],Q(new Set(pt(lt([],Q(t.map(function(e){return e.ownEvents})),!1)))),!1)}function yr(t,e){return e.type==="compound"?Gn(e).some(function(n){return n.type==="final"&&$n(t,n)}):e.type==="parallel"?Gn(e).every(function(n){return yr(t,n)}):!1}function zh(t){return t===void 0&&(t=[]),t.reduce(function(e,n){return n.meta!==void 0&&(e[n.id]=n.meta),e},{})}function Go(t){return new Set(pt(t.map(function(e){return e.tags})))}function Is(t,e){if(t===e)return!0;if(t===void 0||e===void 0)return!1;if(Z(t)||Z(e))return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(function(i){return Is(t[i],e[i])})}function Hh(t){return typeof t!="object"||t===null?!1:"value"in t&&"_event"in t}function Wh(t,e){var n=t.exec,r=T(T({},t),{exec:n!==void 0?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0});return r}var Jt=function(){function t(e){var n=this,r;this.actions=[],this.activities=ko,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||ko,this.meta=zh(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=(r=Array.isArray(e.tags)?new Set(e.tags):e.tags)!==null&&r!==void 0?r:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return Lh(n.configuration)}})}return t.from=function(e,n){if(e instanceof t)return e.context!==n?new t({value:e.value,context:n,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):e;var r=ln;return new t({value:e,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(e){return new t(e)},t.inert=function(e,n){if(e instanceof t){if(!e.actions.length)return e;var r=ln;return new t({value:e.value,context:n,_event:r,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,n)},t.prototype.toStrings=function(e,n){var r=this;if(e===void 0&&(e=this.value),n===void 0&&(n="."),Z(e))return[e];var i=Object.keys(e);return i.concat.apply(i,lt([],Q(i.map(function(o){return r.toStrings(e[o],n).map(function(a){return o+n+a})})),!1))},t.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var n=e.tags;e.machine;var r=Ki(e,["configuration","transitions","tags","machine"]);return T(T({},r),{tags:Array.from(n)})},t.prototype.matches=function(e){return Yi(e,this.value)},t.prototype.hasTag=function(e){return this.tags.has(e)},t.prototype.can=function(e){var n;vt&&xt(!!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,e);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},t}(),Kh={deferEvents:!1},Lo=function(){function t(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=T(T({},Kh),e)}return t.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents){this.schedule(e);return}this.process(e)}this.flushEvents()},t.prototype.schedule=function(e){if(!this.initialized||this.processingEvent){this.queue.push(e);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},t.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},t}(),ni=new Map,Jh=0,xn={bookId:function(){return"x:".concat(Jh++)},register:function(t,e){return ni.set(t,e),t},get:function(t){return ni.get(t)},free:function(t){ni.delete(t)}};function to(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;vt||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 Xh(){var t=to();if(t&&"__xstate__"in t)return t.__xstate__}function Yh(t){if(to()){var e=Xh();e&&e.register(t)}}function Qh(t,e){e===void 0&&(e={});var n=t.initialState,r=new Set,i=[],o=!1,a=function(){if(!o){for(o=!0;i.length>0;){var l=i.shift();n=t.transition(n,l,s),r.forEach(function(f){return f.next(n)})}o=!1}},u=Fh({id:e.id,send:function(l){i.push(l),a()},getSnapshot:function(){return n},subscribe:function(l,f,h){var d=pr(l,f,h);return r.add(d),d.next(n),{unsubscribe:function(){r.delete(d)}}}}),s={parent:e.parent,self:u,id:e.id||"anonymous",observers:r};return n=t.start?t.start(s):n,u}var xi={sync:!1,autoForward:!1},bt;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(bt||(bt={}));var Zh=function(){function t(e,n){n===void 0&&(n=t.defaultOptions);var r=this;this.machine=e,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=bt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(f,h){if(yn(f))return r.batch(f),r.state;var d=Nt(Gr(f,h));if(r.status===bt.Stopped)return vt||xt(!1,'Event "'.concat(d.name,'" was sent to stopped service "').concat(r.machine.id,`". This service has already reached its final state, and will not transition.
|
|
18
|
-
Event: `).concat(JSON.stringify(d.data))),r.state;if(r.status!==
|
|
19
|
-
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var
|
|
20
|
-
Event: `).concat(JSON.stringify(event)));else if(this.status!==bt.Running)throw new Error("".concat(e.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(e.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,a=n.state,u=!1,s=[],l=function(y){var m=Nt(y);n.forward(m),a=rn(n,function(){return n.machine.transition(a,m,void 0,r||void 0)}),s.push.apply(s,lt([],Q(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return Wh(v,a)})),!1)),u=u||!!a.changed};try{for(var f=K(e),h=f.next();!h.done;h=f.next()){var d=h.value;l(d)}}catch(y){i={error:y}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}a.changed=u,a.actions=s,n.update(a,Nt(e[e.length-1]))})}},t.prototype.sender=function(e){return this.send.bind(this,e)},t.prototype._nextState=function(e,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=Nt(e);if(i.name.indexOf(Uo)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(Uo)===0}))throw i.data.data;var o=rn(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},t.prototype.nextState=function(e){return this._nextState(e,!1)},t.prototype.forward=function(e){var n,r;try{for(var i=K(this.forwardTo),o=i.next();!o.done;o=i.next()){var a=o.value,u=this.children.get(a);if(!u)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));u.send(e)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},t.prototype.defer=function(e){var n=this,r=this.clock.setTimeout(function(){"to"in e&&e.to?n.sendTo(e._event,e.to,!0):n.send(e._event)},e.delay);e.id&&(this.delayedEventsMap[e.id]=r)},t.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},t.prototype.exec=function(e,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(e,n.context,n._event,r)},t.prototype.removeChild=function(e){var n;this.children.delete(e),this.forwardTo.delete(e),(n=this.state)===null||n===void 0||delete n.children[e]},t.prototype.stopChild=function(e){var n=this.children.get(e);n&&(this.removeChild(e),nt(n.stop)&&n.stop())},t.prototype.spawn=function(e,n,r){if(this.status!==bt.Running)return Zi(e,n);if(Vo(e))return this.spawnPromise(Promise.resolve(e),n);if(nt(e))return this.spawnCallback(e,n);if(Vh(e))return this.spawnActor(e,n);if(Sh(e))return this.spawnObservable(e,n);if(Ce(e))return this.spawnMachine(e,T(T({},r),{id:n}));if(mh(e))return this.spawnBehavior(e,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof e,'".'))},t.prototype.spawnMachine=function(e,n){var r=this;n===void 0&&(n={});var i=new t(e,T(T({},this.options),{parent:this,id:n.id||e.id})),o=T(T({},xi),n);o.sync&&i.onTransition(function(u){r.send(ds,{state:u,id:i.id})});var a=i;return this.children.set(i.id,a),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(u){r.removeChild(i.id),r.send(Nt(u,{origin:i.id}))}).start(),a},t.prototype.spawnBehavior=function(e,n){var r=Qh(e,{id:n,parent:this});return this.children.set(n,r),r},t.prototype.spawnPromise=function(e,n){var r,i=this,o=!1,a;e.then(function(s){o||(a=s,i.removeChild(n),i.send(Nt(vr(n,s),{origin:n})))},function(s){if(!o){i.removeChild(n);var l=_n(n,s);try{i.send(Nt(l,{origin:n}))}catch(f){Ih(s,f,n),i.devTools&&i.devTools.send(l,i.state),i.machine.strict&&i.stop()}}});var u=(r={id:n,send:function(){},subscribe:function(s,l,f){var h=pr(s,l,f),d=!1;return e.then(function(y){d||(h.next(y),!d&&h.complete())},function(y){d||h.error(y)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[xe]=function(){return this},r);return this.children.set(n,u),u},t.prototype.spawnCallback=function(e,n){var r,i=this,o=!1,a=new Set,u=new Set,s,l=function(d){s=d,u.forEach(function(y){return y(d)}),!o&&i.send(Nt(d,{origin:n}))},f;try{f=e(l,function(d){a.add(d)})}catch(d){this.send(_n(n,d))}if(Vo(f))return this.spawnPromise(f,n);var h=(r={id:n,send:function(d){return a.forEach(function(y){return y(d)})},subscribe:function(d){var y=pr(d);return u.add(y.next),{unsubscribe:function(){u.delete(y.next)}}},stop:function(){o=!0,nt(f)&&f()},toJSON:function(){return{id:n}},getSnapshot:function(){return s}},r[xe]=function(){return this},r);return this.children.set(n,h),h},t.prototype.spawnObservable=function(e,n){var r,i=this,o,a=e.subscribe(function(s){o=s,i.send(Nt(s,{origin:n}))},function(s){i.removeChild(n),i.send(Nt(_n(n,s),{origin:n}))},function(){i.removeChild(n),i.send(Nt(vr(n),{origin:n}))}),u=(r={id:n,send:function(){},subscribe:function(s,l,f){return e.subscribe(s,l,f)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[xe]=function(){return this},r);return this.children.set(n,u),u},t.prototype.spawnActor=function(e,n){return this.children.set(n,e),e},t.prototype.spawnActivity=function(e){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(!n){vt||xt(!1,"No implementation found for activity '".concat(e.type,"'"));return}var r=n(this.state.context,e);this.spawnEffect(e.id,r)},t.prototype.spawnEffect=function(e,n){var r;this.children.set(e,(r={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}},r[xe]=function(){return this},r))},t.prototype.attachDev=function(){var e=to();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(T(T({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:T({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}Yh(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[xe]=function(){return this},t.prototype.getSnapshot=function(){return this.status===bt.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,n){return setTimeout(e,n)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},t.interpret=Es,t}(),tp=function(t){return Z(t)?T(T({},xi),{name:t}):T(T(T({},xi),{name:wh()}),t)};function zo(t,e){var n=tp(e);return Uh(function(r){if(!vt){var i=Ce(t)||nt(t);xt(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(Ce(t)?t.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(t,n.name,n):Zi(t,n.name)})}function Es(t,e){var n=new Zh(t,e);return n}function ep(t){if(typeof t=="string"){var e={type:t};return e.toString=function(){return t},e}return t}function ur(t){return T(T({type:Si},t),{toJSON:function(){t.onDone,t.onError;var e=Ki(t,["onDone","onError"]);return T(T({},e),{type:Si,src:ep(t.src)})}})}var on="",Ai="#",An="*",tn={},en=function(t){return t[0]===Ai},np=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},rp=function(t,e,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(Z(o.target)||Ce(o.target))}),i=e===on?"the transient event":"event '".concat(e,"'");xt(!r,"One or more transitions for ".concat(i," on state '").concat(t.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},ip=function(){function t(e,n,r,i){r===void 0&&(r="context"in e?e.context:void 0);var o=this,a;this.config=e,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(np(),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:hs),this.id=this.config.id||lt([this.machine.key],Q(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,vt||xt(!("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?Nn(this.config.states,function(l,f){var h,d=new t(l,{},void 0,{parent:o,key:f});return Object.assign(o.idMap,T((h={},h[d.id]=d,h),d.idMap)),d}):tn;var u=0;function s(l){var f,h;l.order=u++;try{for(var d=K(Cs(l)),y=d.next();!y.done;y=d.next()){var m=y.value;s(m)}}catch(v){f={error:v}}finally{try{y&&!y.done&&(h=d.return)&&h.call(d)}finally{if(f)throw f.error}}}s(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(l){var f=l.event;return f===on}):on in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=Zt(this.config.entry||this.config.onEntry).map(function(l){return Fn(l)}),this.onExit=Zt(this.config.exit||this.config.onExit).map(function(l){return Fn(l)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=Zt(this.config.invoke).map(function(l,f){var h,d;if(Ce(l)){var y=ar(o.id,f);return o.machine.options.services=T((h={},h[y]=l,h),o.machine.options.services),ur({src:y,id:y})}else if(Z(l.src)){var y=l.id||ar(o.id,f);return ur(T(T({},l),{id:y,src:l.src}))}else if(Ce(l.src)||nt(l.src)){var y=l.id||ar(o.id,f);return o.machine.options.services=T((d={},d[y]=l.src,d),o.machine.options.services),ur(T(T({id:y},l),{src:y}))}else{var m=l.src;return ur(T(T({id:ar(o.id,f)},l),{src:m}))}}),this.activities=Zt(this.config.activities).concat(this.invoke).map(function(l){return Qi(l)}),this.transition=this.transition.bind(this),this.tags=Zt(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||ws(this).forEach(function(e){return e.on})},t.prototype.withConfig=function(e,n){var r=this.options,i=r.actions,o=r.activities,a=r.guards,u=r.services,s=r.delays;return new t(this.config,{actions:T(T({},i),e.actions),activities:T(T({},o),e.activities),guards:T(T({},a),e.guards),services:T(T({},u),e.services),delays:T(T({},s),e.delays)},n??this.context)},t.prototype.withContext=function(e){return new t(this.config,this.options,e)},Object.defineProperty(t.prototype,"context",{get:function(){return nt(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.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:Nn(this.states,function(e){return e.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}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var n=e===on,r=this.transitions.filter(function(i){var o=i.eventType===e;return n?o:o||i.eventType===An});return this.__cache.candidates[e]=r,r},t.prototype.getDelayedTransitions=function(){var e=this,n=this.config.after;if(!n)return[];var r=function(o,a){var u=nt(o)?"".concat(e.id,":delay[").concat(a,"]"):o,s=Ph(u,e.id);return e.onEntry.push(Lr(s,{delay:o})),e.onExit.push(Nh(s)),s},i=yn(n)?n.map(function(o,a){var u=r(o.delay,a);return T(T({},o),{event:u})}):pt(Object.keys(n).map(function(o,a){var u=n[o],s=Z(u)?{target:u}:u,l=isNaN(+o)?o:+o,f=r(l,a);return Zt(s).map(function(h){return T(T({},h),{event:f,delay:l})})}));return i.map(function(o){var a=o.delay;return T(T({},e.formatTransition(o)),{delay:a})})},t.prototype.getStateNodes=function(e){var n,r=this;if(!e)return[];var i=e instanceof Jt?e.value:Rn(e,this.delimiter);if(Z(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),u=[this];return u.push.apply(u,lt([],Q(pt(a.map(function(s){return r.getStateNode(s).getStateNodes(i[s])}))),!1)),u},t.prototype.handles=function(e){var n=ps(e);return this.events.includes(n)},t.prototype.resolveState=function(e){var n=e instanceof Jt?e:Jt.create(e),r=Array.from(Mn([],this.getStateNodes(n.value)));return new Jt(T(T({},n),{value:this.resolve(n.value),configuration:r,done:yr(r,this),tags:Go(r),machine:this.machine}))},t.prototype.transitionLeafNode=function(e,n,r){var i=this.getStateNode(e),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},t.prototype.transitionCompoundNode=function(e,n,r){var i=Object.keys(e),o=this.getStateNode(i[0]),a=o._transition(e[i[0]],n,r);return!a||!a.transitions.length?this.next(n,r):a},t.prototype.transitionParallelNode=function(e,n,r){var i,o,a={};try{for(var u=K(Object.keys(e)),s=u.next();!s.done;s=u.next()){var l=s.value,f=e[l];if(f){var h=this.getStateNode(l),d=h._transition(f,n,r);d&&(a[l]=d)}}}catch(E){i={error:E}}finally{try{s&&!s.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}var y=Object.keys(a).map(function(E){return a[E]}),m=pt(y.map(function(E){return E.transitions})),v=y.some(function(E){return E.transitions.length>0});if(!v)return this.next(n,r);var w=pt(Object.keys(a).map(function(E){return a[E].configuration}));return{transitions:m,exitSet:pt(y.map(function(E){return E.exitSet})),configuration:w,source:n,actions:pt(Object.keys(a).map(function(E){return a[E].actions}))}},t.prototype._transition=function(e,n,r){return Z(e)?this.transitionLeafNode(e,n,r):Object.keys(e).length===1?this.transitionCompoundNode(e,n,r):this.transitionParallelNode(e,n,r)},t.prototype.getTransitionData=function(e,n){return this._transition(e.value,e,Nt(n))},t.prototype.next=function(e,n){var r,i,o=this,a=n.name,u=[],s=[],l;try{for(var f=K(this.getCandidates(a)),h=f.next();!h.done;h=f.next()){var d=h.value,y=d.cond,m=d.in,v=e.context,w=m?Z(m)&&en(m)?e.matches(Rn(this.getStateNodeById(m).path,this.delimiter)):Yi(Rn(m,this.delimiter),ph(this.path.slice(0,-2))(e.value)):!0,E=!1;try{E=!y||gs(this.machine,y,v,n,e)}catch(I){throw new Error("Unable to evaluate guard '".concat(y.name||y.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
21
|
-
`).concat(I.message))}if(E&&w){d.target!==void 0&&(s=d.target),u.push.apply(u,lt([],Q(d.actions),!1)),l=d;break}}}catch(I){r={error:I}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}if(l){if(!s.length)return{transitions:[l],exitSet:[],configuration:e.value?[this]:[],source:e,actions:u};var C=pt(s.map(function(I){return o.getRelativeStateNodes(I,e.historyValue)})),S=!!l.internal;return{transitions:[l],exitSet:S?[]:pt(s.map(function(I){return o.getPotentiallyReenteringNodes(I)})),configuration:C,source:e,actions:u}}},t.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var n=[],r=this,i=e;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},t.prototype.getActions=function(e,n,r,i,o,a,u){var s,l,f,h,d=this,y=a?Mn([],this.getStateNodes(a.value)):[],m=new Set;try{for(var v=K(Array.from(e).sort(function(q,D){return q.order-D.order})),w=v.next();!w.done;w=v.next()){var E=w.value;(!$n(y,E)||$n(r.exitSet,E)||E.parent&&m.has(E.parent))&&m.add(E)}}catch(q){s={error:q}}finally{try{w&&!w.done&&(l=v.return)&&l.call(v)}finally{if(s)throw s.error}}try{for(var C=K(y),S=C.next();!S.done;S=C.next()){var E=S.value;(!$n(e,E)||$n(r.exitSet,E.parent))&&r.exitSet.push(E)}}catch(q){f={error:q}}finally{try{S&&!S.done&&(h=C.return)&&h.call(C)}finally{if(f)throw f.error}}r.exitSet.sort(function(q,D){return D.order-q.order});var I=Array.from(m).sort(function(q,D){return q.order-D.order}),P=new Set(r.exitSet),g=pt(I.map(function(q){var D=[];if(q.type!=="final")return D;var et=q.parent;if(!et.parent)return D;D.push(sr(q.id,q.doneData),sr(et.id,q.doneData?Tr(q.doneData,i,o):void 0));var mt=et.parent;return mt.type==="parallel"&&Gn(mt).every(function(Qt){return yr(r.configuration,Qt)})&&D.push(sr(mt.id)),D})),N=I.map(function(q){var D=q.onEntry,et=q.activities.map(function(mt){return _h(mt)});return{type:"entry",actions:Ae(u?lt(lt([],Q(D),!1),Q(et),!1):lt(lt([],Q(et),!1),Q(D),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:g.map(function(q){return Eh(q)})}),F=Array.from(P).map(function(q){return{type:"exit",actions:Ae(lt(lt([],Q(q.onExit),!1),Q(q.activities.map(function(D){return Mh(D)})),!1),d.machine.options.actions)}}),$=F.concat({type:"transition",actions:Ae(r.actions,this.machine.options.actions)}).concat(N);if(n){var z=Ae(pt(lt([],Q(e),!1).sort(function(q,D){return D.order-q.order}).map(function(q){return q.onExit})),this.machine.options.actions).filter(function(q){return!Ti(q)});return $.concat({type:"stop",actions:z})}return $},t.prototype.transition=function(e,n,r,i){e===void 0&&(e=this.initialState);var o=Nt(n),a;if(e instanceof Jt)a=r===void 0?e:this.resolveState(Jt.from(e,r));else{var u=Z(e)?this.resolve(wr(this.getResolvedPath(e))):this.resolve(e),s=r??this.machine.context;a=this.resolveState(Jt.from(u,s))}if(!vt&&o.name===An)throw new Error("An event cannot have the wildcard type ('".concat(An,"')"));if(this.strict&&!this.events.includes(o.name)&&!yh(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:[]},f=Mn([],this.getStateNodes(a.value)),h=l.configuration.length?Mn(f,l.configuration):f;return l.configuration=lt([],Q(h),!1),this.resolveTransition(l,a,a.context,i,o)},t.prototype.resolveRaisedTransition=function(e,n,r,i){var o,a=e.actions;return e=this.transition(e,n,void 0,i),e._event=r,e.event=r.data,(o=e.actions).unshift.apply(o,lt([],Q(a),!1)),e},t.prototype.resolveTransition=function(e,n,r,i,o){var a,u,s,l,f=this;o===void 0&&(o=ln);var h=e.configuration,d=!n||e.transitions.length>0,y=d?e.configuration:n?n.configuration:[],m=yr(y,this),v=d?Gh(this.machine,h):void 0,w=n?n.historyValue?n.historyValue:e.source?this.machine.historyValue(n.value):void 0:void 0,E=this.getActions(new Set(y),m,e,r,o,n,i),C=n?T({},n.activities):{};try{for(var S=K(E),I=S.next();!I.done;I=S.next()){var P=I.value;try{for(var g=(s=void 0,K(P.actions)),N=g.next();!N.done;N=g.next()){var F=N.value;F.type===bi?C[F.activity.id||F.activity.type]=F:F.type===Ji&&(C[F.activity.id||F.activity.type]=!1)}}catch(Lt){s={error:Lt}}finally{try{N&&!N.done&&(l=g.return)&&l.call(g)}finally{if(s)throw s.error}}}}catch(Lt){a={error:Lt}}finally{try{I&&!I.done&&(u=S.return)&&u.call(S)}finally{if(a)throw a.error}}var $=Q(Ir(this,n,r,o,E,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),z=$[0],q=$[1],D=Q(gh(z,Ti),2),et=D[0],mt=D[1],Qt=z.filter(function(Lt){var Te;return Lt.type===bi&&((Te=Lt.activity)===null||Te===void 0?void 0:Te.type)===Si}),kt=Qt.reduce(function(Lt,Te){return Lt[Te.activity.id]=kh(Te.activity,f.machine,q,o),Lt},n?T({},n.children):{}),dt=new Jt({value:v||n.value,context:q,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?w?bh(w,v):void 0:n?n.historyValue:void 0,history:!v||e.source?n:void 0,actions:v?mt:[],activities:v?C:n?n.activities:{},events:[],configuration:y,transitions:e.transitions,children:kt,done:m,tags:Go(y),machine:this}),ut=r!==q;dt.changed=o.name===ds||ut;var Et=dt.history;Et&&delete Et.history;var tr=!m&&(this._transient||h.some(function(Lt){return Lt._transient}));if(!d&&(!tr||o.name===on))return dt;var Bt=dt;if(!m)for(tr&&(Bt=this.resolveRaisedTransition(Bt,{type:sh},o,i));et.length;){var Zr=et.shift();Bt=this.resolveRaisedTransition(Bt,Zr._event,o,i)}var er=Bt.changed||(Et?!!Bt.actions.length||ut||typeof Et.value!=typeof Bt.value||!Is(Bt.value,Et.value):void 0);return Bt.changed=er,Bt.history=Et,Bt},t.prototype.getStateNode=function(e){if(en(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[e];if(!n)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return n},t.prototype.getStateNodeById=function(e){var n=en(e)?e.slice(Ai.length):e;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},t.prototype.getStateNodeByPath=function(e){if(typeof e=="string"&&en(e))try{return this.getStateNodeById(e.slice(1))}catch{}for(var n=wi(e,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},t.prototype.resolve=function(e){var n,r=this;if(!e)return this.initialStateValue||tn;switch(this.type){case"parallel":return Nn(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(e[a]||o):tn});case"compound":if(Z(e)){var i=this.getStateNode(e);return i.type==="parallel"||i.type==="compound"?(n={},n[e]=i.initialStateValue,n):e}return Object.keys(e).length?Nn(e,function(o,a){return o?r.getStateNode(a).resolve(o):tn}):this.initialStateValue||{};default:return e||tn}},t.prototype.getResolvedPath=function(e){if(en(e)){var n=this.machine.idMap[e.slice(Ai.length)];if(!n)throw new Error("Unable to find state node '".concat(e,"'"));return n.path}return wi(e,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=Bo(this.states,function(r){return r.initialStateValue||tn},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=xr(this.states[this.initial])?this.initial:(e={},e[this.initial]=this.states[this.initial].initialStateValue,e)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(e,n){this._init();var r=this.getStateNodes(e);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var e;if(this.type==="history"){var n=this.config;Z(n.target)?e=en(n.target)?wr(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:e=n.target}return e},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(e,n,r){return r===void 0&&(r=!0),r?e.type==="history"?e.resolveHistory(n):e.initialStateNodes:[e]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var e=this;if(xr(this))return[this];if(this.type==="compound"&&!this.initial)return vt||xt(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=hr(this.initialStateValue);return pt(n.map(function(r){return e.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var n=Q(e),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)},t.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:Bo(this.states,function(n,r){if(!e)return n.historyValue();var i=Z(e)?void 0:e[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},t.prototype.resolveHistory=function(e){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!e){var i=this.target;return i?pt(hr(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=vh(r.path,"states")(e).current;return Z(o)?[r.getStateNode(o)]:pt(hr(o).map(function(a){return n.history==="deep"?r.getFromRelativePath(a):[r.states[a[0]]]}))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var e=this,n=pt(Object.keys(this.states).map(function(r){return e.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var e,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 u=K(Object.keys(o)),s=u.next();!s.done;s=u.next()){var l=s.value,f=o[l];if(f.states)try{for(var h=(r=void 0,K(f.events)),d=h.next();!d.done;d=h.next()){var y=d.value;a.add("".concat(y))}}catch(m){r={error:m}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}}catch(m){e={error:m}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(e)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(e){var n=this;if(e!==void 0)return e.map(function(r){if(!Z(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(u){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
22
|
-
`).concat(
|
|
17
|
+
***************************************************************************** */var ne=function(){return ne=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ne.apply(this,arguments)};function mh(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 Ue(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function mt(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 dt;(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"})(dt||(dt={}));var bo;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(bo||(bo={}));var Td=dt.Start,yh=dt.Stop,cu=dt.Raise,Al=dt.Send,vS=dt.Cancel,WA=dt.NullEvent,gh=dt.Assign;dt.After;dt.DoneState;var mS=dt.Log,HA=dt.Init,Id=dt.Invoke;dt.ErrorExecution;var lm=dt.ErrorPlatform,KA=dt.ErrorCustom,yS=dt.Update,YA=dt.Choose,XA=dt.Pure,gS=".",fm={},Ad="xstate.guard",JA="",At=process.env.NODE_ENV==="production",Pu;function bh(e,t,n){n===void 0&&(n=gS);var r=ws(e,n),i=ws(t,n);return ze(i)?ze(r)?i===r:!1:ze(r)?r in i:Object.keys(r).every(function(o){return o in i?bh(r[o],i[o]):!1})}function bS(e){try{return ze(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function $d(e,t){try{return Ra(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function QA(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function ws(e,t){if(QA(e))return e.value;if(Ra(e))return jc(e);if(typeof e!="string")return e;var n=$d(e,t);return jc(n)}function jc(e){if(e.length===1)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function 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 dm(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,c=e[u];n(c)&&(o[u]=t(c,u,e))}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var ZA=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 e$(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(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function lc(e){if(!e)return[[]];if(ze(e))return[[e]];var t=Tt(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:lc(e[n]).map(function(i){return[n].concat(i)})}));return t}function Tt(e){var t;return(t=[]).concat.apply(t,mt([],Ue(e),!1))}function SS(e){return Ra(e)?e:[e]}function dr(e){return e===void 0?[]:SS(e)}function _c(e,t,n){var r,i;if(Je(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,c=e[u];Je(c)?o[u]=c(t,n.data):o[u]=c}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function t$(e){return/^(done|error)\./.test(e)}function pm(e){return!!(e instanceof Promise||e!==null&&(Je(e)||typeof e=="object")&&Je(e.then))}function n$(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function r$(e,t){var n,r,i=Ue([[],[]],2),o=i[0],a=i[1];try{for(var s=Ve(e),u=s.next();!u.done;u=s.next()){var c=u.value;t(c)?o.push(c):a.push(c)}}catch(l){n={error:l}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function CS(e,t){return cs(e.states,function(n,r){if(n){var i=(ze(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:CS(n,i)}}})}function i$(e,t){return{current:t,states:CS(e,t)}}function hm(e,t,n,r){At||en(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,c=a.assignment,l={state:r,action:a,_event:t},f={};if(Je(c))f=c(o,t.data,l);else try{for(var d=Ve(Object.keys(c)),p=d.next();!p.done;p=d.next()){var h=p.value,v=c[h];f[h]=Je(v)?v(o,t.data,l):v}}catch(x){s={error:x}}finally{try{p&&!p.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var en=function(){};At||(en=function(e,t){var n=e instanceof Error?e:void 0;if(!(!n&&e)&&console!==void 0){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});function Ra(e){return Array.isArray(e)}function Je(e){return typeof e=="function"}function ze(e){return typeof e=="string"}function wS(e,t){if(e)return ze(e)?{type:Ad,name:e,predicate:t?t[e]:void 0}:Je(e)?{type:Ad,name:e.name,predicate:e}:e}function o$(e){try{return"subscribe"in e&&Je(e.subscribe)}catch{return!1}}var pi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Pu={},Pu[pi]=function(){return this},Pu[Symbol.observable]=function(){return this};function Hr(e){return!!e&&"__xstatenode"in e}function a$(e){return!!e&&typeof e.send=="function"}var s$=function(){var e=0;return function(){return e++,e.toString(16)}}();function $l(e,t){return ze(e)||typeof e=="number"?ne({type:e},t):e}function cn(e,t){if(!ze(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=$l(e);return ne({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Lo(e,t){var n=SS(t).map(function(r){return typeof r>"u"||typeof r=="string"||Hr(r)?{target:r,event:e}:ne(ne({},r),{event:e})});return n}function u$(e){if(!(e===void 0||e===JA))return dr(e)}function c$(e,t,n){if(!At){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 xS(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===Ad)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 ES(e){return typeof e=="string"?{type:e}:e}function fc(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 Ru(e,t){return"".concat(e,":invocation[").concat(t,"]")}function Od(e){return(e.type===cu||e.type===Al&&e.to===bo.Internal)&&typeof e.delay!="number"}var ha=cn({type:HA});function Dd(e,t){return t&&t[e]||void 0}function _s(e,t){var n;if(ze(e)||typeof e=="number"){var r=Dd(e,t);Je(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Je(e))n={type:e.name||e.toString(),exec:e};else{var r=Dd(e.type,t);if(Je(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 hi=function(e,t){if(!e)return[];var n=Ra(e)?e:[e];return n.map(function(r){return _s(r,t)})};function Sh(e){var t=_s(e);return ne(ne({id:ze(e)?e:t.id},t),{type:t.type})}function l$(e,t){return{type:cu,event:typeof e=="function"?e:$l(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function f$(e,t,n,r){var i={_event:n},o=cn(Je(e.event)?e.event(t,n.data,i):e.event),a;if(ze(e.delay)){var s=r&&r[e.delay];a=Je(s)?s(t,n.data,i):s}else a=Je(e.delay)?e.delay(t,n.data,i):e.delay;return ne(ne({},e),{type:cu,_event:o,delay:a})}function Ol(e,t){return{to:t?t.to:void 0,type:Al,event:Je(e)?e:$l(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Je(e)?e.name:bS(e)}}function d$(e,t,n,r){var i={_event:n},o=cn(Je(e.event)?e.event(t,n.data,i):e.event),a;if(ze(e.delay)){var s=r&&r[e.delay];a=Je(s)?s(t,n.data,i):s}else a=Je(e.delay)?e.delay(t,n.data,i):e.delay;var u=Je(e.to)?e.to(t,n.data,i):e.to;return ne(ne({},e),{to:u,_event:o,event:o.data,delay:a})}function p$(e,t){return Ol(e,ne(ne({},t),{to:bo.Parent}))}var h$=function(e,t,n){return ne(ne({},e),{value:ze(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},v$=function(e){return{type:vS,sendId:e}};function m$(e){var t=Sh(e);return{type:dt.Start,activity:t,exec:void 0}}function y$(e){var t=Je(e)?e:Sh(e);return{type:dt.Stop,activity:t,exec:void 0}}function g$(e,t,n){var r=Je(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:dt.Stop,activity:i};return o}var b$=function(e){return{type:gh,assignment:e}};function S$(e,t){var n=t?"#".concat(t):"";return"".concat(dt.After,"(").concat(e,")").concat(n)}function ku(e,t){var n="".concat(dt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function dc(e,t){var n="".concat(dt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function ls(e,t){var n="".concat(dt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function C$(e,t){if(!At&&(!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,mt([],Ue(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return Ol(function(r,i){return i},ne(ne({},t),{to:e}))}var w$=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===gh){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 qc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:w$(i),u=s.length?hm(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var x;switch(v.type){case cu:{var E=f$(v,u,r,e.options.delays);return o&&typeof E.delay=="number"&&o(E,u,r),E}case Al:var y=d$(v,u,r,e.options.delays);if(!At){var S=v.delay;en(!ze(S)||typeof y.delay=="number","No delay reference for delay expression '".concat(S,"' was found on machine '").concat(e.id,"'"))}return o&&y.to!==bo.Internal&&(h==="entry"?l.push(y):o(y,u,r)),y;case mS:{var w=h$(v,u,r);return o==null||o(w,u,r),w}case YA:{var b=v,T=(x=b.conds.find(function(V){var U=wS(V.cond,e.options.guards);return!U||xS(e,U,u,r,o?void 0:t)}))===null||x===void 0?void 0:x.actions;if(!T)return[];var A=Ue(qc(e,t,u,r,[{type:h,actions:hi(dr(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case XA:{var T=v.get(u,r.data);if(!T)return[];var N=Ue(qc(e,t,u,r,[{type:h,actions:hi(dr(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case yh:{var w=g$(v,u,r);return o==null||o(w,n,r),w}case gh:{u=hm(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var B=_s(v,e.options.actions),K=B.exec;if(o)o(B,u,r);else if(K&&c){var k=c.length-1,ie=ne(ne({},B),{exec:function(V){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];K.apply(void 0,mt([c[k]],Ue(U),!1))}});B=ie}return B}}function d(h){var v,x,E=[];try{for(var y=Ve(h.actions),S=y.next();!S.done;S=y.next()){var w=S.value,b=f(h.type,w);b&&(E=E.concat(b))}}catch(T){v={error:T}}finally{try{S&&!S.done&&(x=y.return)&&x.call(y)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,E}var p=Tt(i.map(d));return[p,u]}var Fc=[],Qo=function(e,t){Fc.push(e);var n=t(e);return Fc.pop(),n},x$=function(e){return e(Fc[Fc.length-1])};function TS(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[pi]=function(){return this},t}function E$(e,t,n,r){var i,o=ES(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?_c(e.data,n,r):void 0,u=a?Ch(a,e.id,s):TS(e.id);return u.meta=e,u}function Ch(e,t,n){var r=TS(t);if(r.deferred=!0,Hr(e)){var i=r.state=Qo(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function T$(e){try{return typeof e.send=="function"}catch{return!1}}function I$(e){return T$(e)&&"id"in e}function A$(e){var t;return ne((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[pi]=function(){return this},t),e)}var Lc=function(e){return e.type==="atomic"||e.type==="final"};function IS(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function qs(e){return IS(e).filter(function(t){return t.type!=="history"})}function AS(e){var t=[e];return Lc(e)?t:t.concat(Tt(qs(e).map(AS)))}function fs(e,t){var n,r,i,o,a,s,u,c,l=new Set(e),f=Nd(l),d=new Set(t);try{for(var p=Ve(d),h=p.next();!h.done;h=p.next())for(var v=h.value,x=v.parent;x&&!d.has(x);)d.add(x),x=x.parent}catch(I){n={error:I}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var E=Nd(d);try{for(var y=Ve(d),S=y.next();!S.done;S=y.next()){var v=S.value;if(v.type==="compound"&&(!E.get(v)||!E.get(v).length))f.get(v)?f.get(v).forEach(function(N){return d.add(N)}):v.initialStateNodes.forEach(function(N){return d.add(N)});else if(v.type==="parallel")try{for(var w=(a=void 0,Ve(qs(v))),b=w.next();!b.done;b=w.next()){var T=b.value;d.has(T)||(d.add(T),f.get(T)?f.get(T).forEach(function(N){return d.add(N)}):T.initialStateNodes.forEach(function(N){return d.add(N)}))}}catch(N){a={error:N}}finally{try{b&&!b.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{S&&!S.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}try{for(var A=Ve(d),D=A.next();!D.done;D=A.next())for(var v=D.value,x=v.parent;x&&!d.has(x);)d.add(x),x=x.parent}catch(I){u={error:I}}finally{try{D&&!D.done&&(c=A.return)&&c.call(A)}finally{if(u)throw u.error}}return d}function $S(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(Lc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=$S(o,t)}),i}function Nd(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 $$(e,t){var n=fs([e],t);return $S(e,Nd(n))}function ds(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function O$(e){return mt([],Ue(new Set(Tt(mt([],Ue(e.map(function(t){return t.ownEvents})),!1)))),!1)}function pc(e,t){return t.type==="compound"?qs(t).some(function(n){return n.type==="final"&&ds(e,n)}):t.type==="parallel"?qs(t).every(function(n){return pc(e,n)}):!1}function D$(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function vm(e){return new Set(Tt(e.map(function(t){return t.tags})))}function OS(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(ze(e)||ze(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return OS(e[i],t[i])})}function N$(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function P$(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 tr=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=D$(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 O$(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=ha;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=ha;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var r=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),ze(t))return[t];var i=Object.keys(t);return i.concat.apply(i,mt([],Ue(i.map(function(o){return r.toStrings(t[o],n).map(function(a){return o+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var r=mh(t,["configuration","transitions","tags","machine"]);return ne(ne({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return bh(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;At&&en(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,t);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},e}(),R$={deferEvents:!1},mm=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=ne(ne({},R$),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}(),xf=new Map,k$=0,es={bookId:function(){return"x:".concat(k$++)},register:function(e,t){return xf.set(e,t),e},get:function(e){return xf.get(e)},free:function(e){xf.delete(e)}};function wh(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;At||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues")}function M$(){var e=wh();if(e&&"__xstate__"in e)return e.__xstate__}function j$(e){if(wh()){var t=M$();t&&t.register(e)}}function _$(e,t){t===void 0&&(t={});var n=e.initialState,r=new Set,i=[],o=!1,a=function(){if(!o){for(o=!0;i.length>0;){var c=i.shift();n=e.transition(n,c,u),r.forEach(function(l){return l.next(n)})}o=!1}},s=A$({id:t.id,send:function(c){i.push(c),a()},getSnapshot:function(){return n},subscribe:function(c,l,f){var d=fc(c,l,f);return r.add(d),d.next(n),{unsubscribe:function(){r.delete(d)}}}}),u={parent:t.parent,self:s,id:t.id||"anonymous",observers:r};return n=e.start?e.start(u):n,s}var Pd={sync:!1,autoForward:!1},Ot;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ot||(Ot={}));var q$=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=Ot.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(l,f){if(Ra(l))return r.batch(l),r.state;var d=cn($l(l,f));if(r.status===Ot.Stopped)return At||en(!1,'Event "'.concat(d.name,'" was sent to stopped service "').concat(r.machine.id,`". This service has already reached its final state, and will not transition.
|
|
18
|
+
Event: `).concat(JSON.stringify(d.data))),r.state;if(r.status!==Ot.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(d.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
|
|
19
|
+
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var p=r._nextState(d);r.update(p,d)}),r._state},this.sendTo=function(l,f,d){var p=r.parent&&(f===bo.Parent||r.parent.id===f),h=p?r.parent:ze(f)?f===bo.Internal?r:r.children.get(f)||es.get(f):a$(f)?f:void 0;if(!h){if(!p)throw new Error("Unable to send event to child '".concat(f,"' from service '").concat(r.id,"'."));At||en(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(l.type));return}if("machine"in h){if(r.status!==Ot.Stopped||r.parent!==h||r.state.done){var v=ne(ne({},l),{name:l.name===KA?"".concat(ls(r.id)):l.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,v]):h.send(v)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,l.data]):h.send(l.data)},this._exec=function(l,f,d,p){p===void 0&&(p=r.machine.options.actions);var h=l.exec||Dd(l.type,p),v=Je(h)?h:h?h.exec:l.exec;if(v)try{return v(f,d.data,r.machine.config.predictableActionArguments?{action:l,_event:d}:{action:l,state:r.state,_event:d})}catch(K){throw r.parent&&r.parent.send({type:"xstate.error",data:K}),K}switch(l.type){case cu:{var x=l;r.defer(x);break}case Al:var E=l;if(typeof E.delay=="number"){r.defer(E);return}else E.to?r.sendTo(E._event,E.to,d===ha):r.send(E._event);break;case vS:r.cancel(l.sendId);break;case Td:{if(r.status!==Ot.Running)return;var y=l.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[y.id||y.type])break;if(y.type===dt.Invoke){var S=ES(y.src),w=r.machine.options.services?r.machine.options.services[S.type]:void 0,b=y.id,T=y.data;At||en(!("forward"in y),"`forward` property is deprecated (found in invocation of '".concat(y.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var A="autoForward"in y?y.autoForward:!!y.forward;if(!w){At||en(!1,"No service found for invocation '".concat(y.src,"' in machine '").concat(r.machine.id,"'."));return}var D=T?_c(T,f,d):void 0;if(typeof w=="string")return;var I=Je(w)?w(f,d.data,{data:D,src:S,meta:y.meta}):w;if(!I)return;var N=void 0;Hr(I)&&(I=D?I.withContext(D):I,N={autoForward:A}),r.spawn(I,b,N)}else r.spawnActivity(y);break}case yh:{r.stopChild(l.activity.id);break}case mS:var _=l,L=_.label,B=_.value;L?r.logger(L,B):r.logger(B);break;default:At||en(!1,"No implementation found for action type '".concat(l.type,"'"));break}};var i=ne(ne({},e.defaultOptions),n),o=i.clock,a=i.logger,s=i.parent,u=i.id,c=u!==void 0?u:t.id;this.id=c,this.logger=a,this.clock=o,this.parent=s,this.options=i,this.scheduler=new mm({deferEvents:this.options.deferEvents}),this.sessionId=es.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:Qo(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return At||en(this.status!==Ot.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,c,l,f=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||n===ha)&&this.options.execute)this.execute(this.state);else for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);if(this.children.forEach(function(I){f.state.children[I.id]=I}),this.devTools&&this.devTools.send(n.data,t),t.event)try{for(var p=Ve(this.eventListeners),h=p.next();!h.done;h=p.next()){var v=h.value;v(t.event)}}catch(I){r={error:I}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var x=Ve(this.listeners),E=x.next();!E.done;E=x.next()){var v=E.value;v(t,t.event)}}catch(I){o={error:I}}finally{try{E&&!E.done&&(a=x.return)&&a.call(x)}finally{if(o)throw o.error}}try{for(var y=Ve(this.contextListeners),S=y.next();!S.done;S=y.next()){var w=S.value;w(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(I){s={error:I}}finally{try{S&&!S.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}if(this.state.done){var b=t.configuration.find(function(I){return I.type==="final"&&I.parent===f.machine}),T=b&&b.doneData?_c(b.doneData,t.context,n):void 0;this._doneEvent=dc(this.id,T);try{for(var A=Ve(this.doneListeners),D=A.next();!D.done;D=A.next()){var v=D.value;v(this._doneEvent)}}catch(I){c={error:I}}finally{try{D&&!D.done&&(l=A.return)&&l.call(A)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),es.free(this.sessionId)}},e.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Ot.Running&&t(this.state,this.state.event),this},e.prototype.subscribe=function(t,n,r){var i=this,o=fc(t,n,r);this.listeners.add(o.next),this.status!==Ot.NotStarted&&o.next(this.state);var a=function(){i.doneListeners.delete(a),i.stopListeners.delete(a),o.complete()};return this.status===Ot.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===Ot.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===Ot.Running)return this;this.machine._init(),es.register(this.sessionId,this),this.initialized=!0,this.status=Ot.Running;var r=t===void 0?this.initialState:Qo(this,function(){return N$(t)?n.machine.resolveState(t):n.machine.resolveState(tr.from(t,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,ha)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(t){Je(t.stop)&&t.stop()}),this.children.clear()},e.prototype._stop=function(){var t,n,r,i,o,a,s,u,c,l;try{for(var f=Ve(this.listeners),d=f.next();!d.done;d=f.next()){var p=d.value;this.listeners.delete(p)}}catch(A){t={error:A}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}try{for(var h=Ve(this.stopListeners),v=h.next();!v.done;v=h.next()){var p=v.value;p(),this.stopListeners.delete(p)}}catch(A){r={error:A}}finally{try{v&&!v.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}try{for(var x=Ve(this.contextListeners),E=x.next();!E.done;E=x.next()){var p=E.value;this.contextListeners.delete(p)}}catch(A){o={error:A}}finally{try{E&&!E.done&&(a=x.return)&&a.call(x)}finally{if(o)throw o.error}}try{for(var y=Ve(this.doneListeners),S=y.next();!S.done;S=y.next()){var p=S.value;this.doneListeners.delete(p)}}catch(A){s={error:A}}finally{try{S&&!S.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Ot.Stopped,this._initialState=void 0;try{for(var w=Ve(Object.keys(this.delayedEventsMap)),b=w.next();!b.done;b=w.next()){var T=b.value;this.clock.clearTimeout(this.delayedEventsMap[T])}}catch(A){c={error:A}}finally{try{b&&!b.done&&(l=w.return)&&l.call(w)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new mm({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var t=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r;if(!(!((r=t._state)===null||r===void 0)&&r.done)){var i=cn({type:"xstate.stop"}),o=Qo(t,function(){var a=Tt(mt([],Ue(t.state.configuration),!1).sort(function(f,d){return d.order-f.order}).map(function(f){return hi(f.onExit,t.machine.options.actions)})),s=Ue(qc(t.machine,t.state,t.state.context,i,[{type:"exit",actions:a}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),u=s[0],c=s[1],l=new tr({value:t.state.value,context:c,_event:i,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:u.filter(function(f){return!Od(f)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return l.changed=!0,l});t.update(o,i),t._stopChildren(),es.free(t.sessionId)}}),this},e.prototype.batch=function(t){var n=this;if(this.status===Ot.NotStarted&&this.options.deferEvents)At||en(!1,"".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,`" and are deferred. Make sure .start() is called for this service.
|
|
20
|
+
Event: `).concat(JSON.stringify(event)));else if(this.status!==Ot.Running)throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(t.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,a=n.state,s=!1,u=[],c=function(p){var h=cn(p);n.forward(h),a=Qo(n,function(){return n.machine.transition(a,h,void 0,r||void 0)}),u.push.apply(u,mt([],Ue(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return P$(v,a)})),!1)),s=s||!!a.changed};try{for(var l=Ve(t),f=l.next();!f.done;f=l.next()){var d=f.value;c(d)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,cn(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=cn(t);if(i.name.indexOf(lm)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(lm)===0}))throw i.data.data;var o=Qo(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),Je(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Ot.Running)return Ch(t,n);if(pm(t))return this.spawnPromise(Promise.resolve(t),n);if(Je(t))return this.spawnCallback(t,n);if(I$(t))return this.spawnActor(t,n);if(o$(t))return this.spawnObservable(t,n);if(Hr(t))return this.spawnMachine(t,ne(ne({},r),{id:n}));if(n$(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({},Pd),n);o.sync&&i.onTransition(function(s){r.send(yS,{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=_$(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(dc(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var c=ls(n,u);try{i.send(cn(c,{origin:n}))}catch(l){c$(u,l,n),i.devTools&&i.devTools.send(c,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,c,l){var f=fc(u,c,l),d=!1;return t.then(function(p){d||(f.next(p),!d&&f.complete())},function(p){d||f.error(p)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[pi]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnCallback=function(t,n){var r,i=this,o=!1,a=new Set,s=new Set,u,c=function(d){u=d,s.forEach(function(p){return p(d)}),!o&&i.send(cn(d,{origin:n}))},l;try{l=t(c,function(d){a.add(d)})}catch(d){this.send(ls(n,d))}if(pm(l))return this.spawnPromise(l,n);var f=(r={id:n,send:function(d){return a.forEach(function(p){return p(d)})},subscribe:function(d){var p=fc(d);return s.add(p.next),{unsubscribe:function(){s.delete(p.next)}}},stop:function(){o=!0,Je(l)&&l()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[pi]=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(ls(n,u),{origin:n}))},function(){i.removeChild(n),i.send(cn(dc(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,c,l){return t.subscribe(u,c,l)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[pi]=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){At||en(!1,"No implementation found for activity '".concat(t.type,"'"));return}var r=n(this.state.context,t);this.spawnEffect(t.id,r)},e.prototype.spawnEffect=function(t,n){var r;this.children.set(t,(r={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}},r[pi]=function(){return this},r))},e.prototype.attachDev=function(){var t=wh();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)}j$(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[pi]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Ot.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=DS,e}(),F$=function(e){return ze(e)?ne(ne({},Pd),{name:e}):ne(ne(ne({},Pd),{name:s$()}),e)};function ym(e,t){var n=F$(t);return x$(function(r){if(!At){var i=Hr(e)||Je(e);en(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(Hr(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):Ch(e,n.name)})}function DS(e,t){var n=new q$(e,t);return n}function L$(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function Mu(e){return ne(ne({type:Id},e),{toJSON:function(){e.onDone,e.onError;var t=mh(e,["onDone","onError"]);return ne(ne({},t),{type:Id,src:L$(e.src)})}})}var Zo="",Rd="#",ts="*",Vo={},Bo=function(e){return e[0]===Rd},V$=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},B$=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(ze(o.target)||Hr(o.target))}),i=t===Zo?"the transient event":"event '".concat(t,"'");en(!r,"One or more transitions for ".concat(i," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},U$=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(V$(),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:gS),this.id=this.config.id||mt([this.machine.key],Ue(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,At||en(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?cs(this.config.states,function(c,l){var f,d=new e(c,{},void 0,{parent:o,key:l});return Object.assign(o.idMap,ne((f={},f[d.id]=d,f),d.idMap)),d}):Vo;var s=0;function u(c){var l,f;c.order=s++;try{for(var d=Ve(IS(c)),p=d.next();!p.done;p=d.next()){var h=p.value;u(h)}}catch(v){l={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}finally{if(l)throw l.error}}}u(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(c){var l=c.event;return l===Zo}):Zo in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=dr(this.config.entry||this.config.onEntry).map(function(c){return _s(c)}),this.onExit=dr(this.config.exit||this.config.onExit).map(function(c){return _s(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=dr(this.config.invoke).map(function(c,l){var f,d;if(Hr(c)){var p=Ru(o.id,l);return o.machine.options.services=ne((f={},f[p]=c,f),o.machine.options.services),Mu({src:p,id:p})}else if(ze(c.src)){var p=c.id||Ru(o.id,l);return Mu(ne(ne({},c),{id:p,src:c.src}))}else if(Hr(c.src)||Je(c.src)){var p=c.id||Ru(o.id,l);return o.machine.options.services=ne((d={},d[p]=c.src,d),o.machine.options.services),Mu(ne(ne({id:p},c),{src:p}))}else{var h=c.src;return Mu(ne(ne({id:Ru(o.id,l)},c),{src:h}))}}),this.activities=dr(this.config.activities).concat(this.invoke).map(function(c){return Sh(c)}),this.transition=this.transition.bind(this),this.tags=dr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||AS(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 Je(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states: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===Zo,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===ts});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=Je(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=S$(s,t.id);return t.onEntry.push(Ol(u,{delay:o})),t.onExit.push(v$(u)),u},i=Ra(n)?n.map(function(o,a){var s=r(o.delay,a);return ne(ne({},o),{event:s})}):Tt(Object.keys(n).map(function(o,a){var s=n[o],u=ze(s)?{target:s}:s,c=isNaN(+o)?o:+o,l=r(c,a);return dr(u).map(function(f){return ne(ne({},f),{event:l,delay:c})})}));return i.map(function(o){var a=o.delay;return ne(ne({},t.formatTransition(o)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,r=this;if(!t)return[];var i=t instanceof tr?t.value:ws(t,this.delimiter);if(ze(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var a=Object.keys(i),s=[this];return s.push.apply(s,mt([],Ue(Tt(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=bS(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof tr?t:tr.create(t),r=Array.from(fs([],this.getStateNodes(n.value)));return new tr(ne(ne({},n),{value:this.resolve(n.value),configuration:r,done:pc(r,this),tags:vm(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 c=u.value,l=t[c];if(l){var f=this.getStateNode(c),d=f._transition(l,n,r);d&&(a[c]=d)}}}catch(E){i={error:E}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var p=Object.keys(a).map(function(E){return a[E]}),h=Tt(p.map(function(E){return E.transitions})),v=p.some(function(E){return E.transitions.length>0});if(!v)return this.next(n,r);var x=Tt(Object.keys(a).map(function(E){return a[E].configuration}));return{transitions:h,exitSet:Tt(p.map(function(E){return E.exitSet})),configuration:x,source:n,actions:Tt(Object.keys(a).map(function(E){return a[E].actions}))}},e.prototype._transition=function(t,n,r){return ze(t)?this.transitionLeafNode(t,n,r):Object.keys(t).length===1?this.transitionCompoundNode(t,n,r):this.transitionParallelNode(t,n,r)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,cn(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],c;try{for(var l=Ve(this.getCandidates(a)),f=l.next();!f.done;f=l.next()){var d=f.value,p=d.cond,h=d.in,v=t.context,x=h?ze(h)&&Bo(h)?t.matches(ws(this.getStateNodeById(h).path,this.delimiter)):bh(ws(h,this.delimiter),ZA(this.path.slice(0,-2))(t.value)):!0,E=!1;try{E=!p||xS(this.machine,p,v,n,t)}catch(w){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
21
|
+
`).concat(w.message))}if(E&&x){d.target!==void 0&&(u=d.target),s.push.apply(s,mt([],Ue(d.actions),!1)),c=d;break}}}catch(w){r={error:w}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}if(c){if(!u.length)return{transitions:[c],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var y=Tt(u.map(function(w){return o.getRelativeStateNodes(w,t.historyValue)})),S=!!c.internal;return{transitions:[c],exitSet:S?[]:Tt(u.map(function(w){return o.getPotentiallyReenteringNodes(w)})),configuration:y,source:t,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var n=[],r=this,i=t;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},e.prototype.getActions=function(t,n,r,i,o,a,s){var u,c,l,f,d=this,p=a?fs([],this.getStateNodes(a.value)):[],h=new Set;try{for(var v=Ve(Array.from(t).sort(function(_,L){return _.order-L.order})),x=v.next();!x.done;x=v.next()){var E=x.value;(!ds(p,E)||ds(r.exitSet,E)||E.parent&&h.has(E.parent))&&h.add(E)}}catch(_){u={error:_}}finally{try{x&&!x.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}try{for(var y=Ve(p),S=y.next();!S.done;S=y.next()){var E=S.value;(!ds(t,E)||ds(r.exitSet,E.parent))&&r.exitSet.push(E)}}catch(_){l={error:_}}finally{try{S&&!S.done&&(f=y.return)&&f.call(y)}finally{if(l)throw l.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var w=Array.from(h).sort(function(_,L){return _.order-L.order}),b=new Set(r.exitSet),T=Tt(w.map(function(_){var L=[];if(_.type!=="final")return L;var B=_.parent;if(!B.parent)return L;L.push(ku(_.id,_.doneData),ku(B.id,_.doneData?_c(_.doneData,i,o):void 0));var K=B.parent;return K.type==="parallel"&&qs(K).every(function(k){return pc(r.configuration,k)})&&L.push(ku(K.id)),L})),A=w.map(function(_){var L=_.onEntry,B=_.activities.map(function(K){return m$(K)});return{type:"entry",actions:hi(s?mt(mt([],Ue(L),!1),Ue(B),!1):mt(mt([],Ue(B),!1),Ue(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:T.map(function(_){return l$(_)})}),D=Array.from(b).map(function(_){return{type:"exit",actions:hi(mt(mt([],Ue(_.onExit),!1),Ue(_.activities.map(function(L){return y$(L)})),!1),d.machine.options.actions)}}),I=D.concat({type:"transition",actions:hi(r.actions,this.machine.options.actions)}).concat(A);if(n){var N=hi(Tt(mt([],Ue(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!Od(_)});return I.concat({type:"stop",actions:N})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=cn(n),a;if(t instanceof tr)a=r===void 0?t:this.resolveState(tr.from(t,r));else{var s=ze(t)?this.resolve(jc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(tr.from(s,u))}if(!At&&o.name===ts)throw new Error("An event cannot have the wildcard type ('".concat(ts,"')"));if(this.strict&&!this.events.includes(o.name)&&!t$(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},l=fs([],this.getStateNodes(a.value)),f=c.configuration.length?fs(l,c.configuration):l;return c.configuration=mt([],Ue(f),!1),this.resolveTransition(c,a,a.context,i,o)},e.prototype.resolveRaisedTransition=function(t,n,r,i){var o,a=t.actions;return t=this.transition(t,n,void 0,i),t._event=r,t.event=r.data,(o=t.actions).unshift.apply(o,mt([],Ue(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,c,l=this;o===void 0&&(o=ha);var f=t.configuration,d=!n||t.transitions.length>0,p=d?t.configuration:n?n.configuration:[],h=pc(p,this),v=d?$$(this.machine,f):void 0,x=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,E=this.getActions(new Set(p),h,t,r,o,n,i),y=n?ne({},n.activities):{};try{for(var S=Ve(E),w=S.next();!w.done;w=S.next()){var b=w.value;try{for(var T=(u=void 0,Ve(b.actions)),A=T.next();!A.done;A=T.next()){var D=A.value;D.type===Td?y[D.activity.id||D.activity.type]=D:D.type===yh&&(y[D.activity.id||D.activity.type]=!1)}}catch(Y){u={error:Y}}finally{try{A&&!A.done&&(c=T.return)&&c.call(T)}finally{if(u)throw u.error}}}}catch(Y){a={error:Y}}finally{try{w&&!w.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}var I=Ue(qc(this,n,r,o,E,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),N=I[0],_=I[1],L=Ue(r$(N,Od),2),B=L[0],K=L[1],k=N.filter(function(Y){var ae;return Y.type===Td&&((ae=Y.activity)===null||ae===void 0?void 0:ae.type)===Id}),ie=k.reduce(function(Y,ae){return Y[ae.activity.id]=E$(ae.activity,l.machine,_,o),Y},n?ne({},n.children):{}),V=new tr({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?x?i$(x,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?K:[],activities:v?y:n?n.activities:{},events:[],configuration:p,transitions:t.transitions,children:ie,done:h,tags:vm(p),machine:this}),U=r!==_;V.changed=o.name===yS||U;var fe=V.history;fe&&delete fe.history;var j=!h&&(this._transient||f.some(function(Y){return Y._transient}));if(!d&&(!j||o.name===Zo))return V;var R=V;if(!h)for(j&&(R=this.resolveRaisedTransition(R,{type:WA},o,i));B.length;){var te=B.shift();R=this.resolveRaisedTransition(R,te._event,o,i)}var oe=R.changed||(fe?!!R.actions.length||U||typeof fe.value!=typeof R.value||!OS(R.value,fe.value):void 0);return R.changed=oe,R.history=fe,R},e.prototype.getStateNode=function(t){if(Bo(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=Bo(t)?t.slice(Rd.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"&&Bo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=$d(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||Vo;switch(this.type){case"parallel":return cs(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):Vo});case"compound":if(ze(t)){var i=this.getStateNode(t);return i.type==="parallel"||i.type==="compound"?(n={},n[t]=i.initialStateValue,n):t}return Object.keys(t).length?cs(t,function(o,a){return o?r.getStateNode(a).resolve(o):Vo}):this.initialStateValue||{};default:return t||Vo}},e.prototype.getResolvedPath=function(t){if(Bo(t)){var n=this.machine.idMap[t.slice(Rd.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return $d(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=dm(this.states,function(r){return r.initialStateValue||Vo},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=Lc(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;ze(n.target)?t=Bo(n.target)?jc(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:t=n.target}return t},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(t,n,r){return r===void 0&&(r=!0),r?t.type==="history"?t.resolveHistory(n):t.initialStateNodes:[t]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var t=this;if(Lc(this))return[this];if(this.type==="compound"&&!this.initial)return At||en(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=lc(this.initialStateValue);return Tt(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=Ue(t),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(i)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:dm(this.states,function(n,r){if(!t)return n.historyValue();var i=ze(t)?void 0:t[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!t){var i=this.target;return i?Tt(lc(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=e$(r.path,"states")(t).current;return ze(o)?[r.getStateNode(o)]:Tt(lc(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=Tt(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 c=u.value,l=o[c];if(l.states)try{for(var f=(r=void 0,Ve(l.events)),d=f.next();!d.done;d=f.next()){var p=d.value;a.add("".concat(p))}}catch(h){r={error:h}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(h){t={error:h}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(r){if(!ze(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var a=n.parent.getStateNodeByPath(o);return a}catch(s){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
22
|
+
`).concat(s.message))}else return n.getStateNodeByPath(o)})},e.prototype.formatTransition=function(t){var n=this,r=u$(t.target),i="internal"in t?t.internal:r?r.some(function(u){return ze(u)&&u[0]===n.delimiter}):!0,o=this.machine.options.guards,a=this.resolveTarget(r),s=ne(ne({},t),{actions:hi(dr(t.actions)),cond:wS(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=ts,s=o[a],u=s===void 0?[]:s,c=mh(o,[typeof a=="symbol"?a:a+""]);i=Tt(Object.keys(c).map(function(y){!At&&y===Zo&&en(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(r.id,'".'));var S=Lo(y,c[y]);return At||B$(r,y,S),S}).concat(Lo(ts,u)))}var l=this.config.always?Lo("",this.config.always):[],f=this.config.onDone?Lo(String(ku(this.id)),this.config.onDone):[];At||en(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var d=Tt(this.invoke.map(function(y){var S=[];return y.onDone&&S.push.apply(S,mt([],Ue(Lo(String(dc(y.id)),y.onDone)),!1)),y.onError&&S.push.apply(S,mt([],Ue(Lo(String(ls(y.id)),y.onError)),!1)),S})),p=this.after,h=Tt(mt(mt(mt(mt([],Ue(f),!1),Ue(d),!1),Ue(i),!1),Ue(l),!1).map(function(y){return dr(y).map(function(S){return r.formatTransition(S)})}));try{for(var v=Ve(p),x=v.next();!x.done;x=v.next()){var E=x.value;h.push(E)}}catch(y){t={error:y}}finally{try{x&&!x.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}return h},e}(),gm=!1;function xh(e,t){return!At&&!("predictableActionArguments"in e)&&!gm&&(gm=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new U$(e,t)}var Nn=b$,G$=Ol,NS=p$,ju=C$,et={},Eh={};(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!==bt.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
|
-
***************************************************************************** */t.__assign=function(){return t.__assign=Object.assign||function(a){for(var u,s=1,l=arguments.length;s<l;s++){u=arguments[s];for(var f in u)Object.prototype.hasOwnProperty.call(u,f)&&(a[f]=u[f])}return a},t.__assign.apply(this,arguments)};function e(o,a){var u={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&a.indexOf(s)<0&&(u[s]=o[s]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,s=Object.getOwnPropertySymbols(o);l<s.length;l++)a.indexOf(s[l])<0&&Object.prototype.propertyIsEnumerable.call(o,s[l])&&(u[s[l]]=o[s[l]]);return u}function n(o){var a=typeof Symbol=="function"&&Symbol.iterator,u=a&&o[a],s=0;if(u)return u.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&s>=o.length&&(o=void 0),{value:o&&o[s++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(o,a){var u=typeof Symbol=="function"&&o[Symbol.iterator];if(!u)return o;var s=u.call(o),l,f=[],h;try{for(;(a===void 0||a-- >0)&&!(l=s.next()).done;)f.push(l.value)}catch(d){h={error:d}}finally{try{l&&!l.done&&(u=s.return)&&u.call(s)}finally{if(h)throw h.error}}return f}function i(o,a,u){if(u||arguments.length===2)for(var s=0,l=a.length,f;s<l;s++)(f||!(s in a))&&(f||(f=Array.prototype.slice.call(a,0,s)),f[s]=a[s]);return o.concat(f||Array.prototype.slice.call(a))}t.__read=r,t.__rest=e,t.__spreadArray=i,t.__values=n})(no);var zr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ActionTypes=void 0,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"}(t.ActionTypes||(t.ActionTypes={})),t.SpecialTargets=void 0,function(e){e.Parent="#_parent",e.Internal="#_internal"}(t.SpecialTargets||(t.SpecialTargets={}))})(zr);var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});var Ot=zr,ap=Ot.ActionTypes.Start,sp=Ot.ActionTypes.Stop,up=Ot.ActionTypes.Raise,cp=Ot.ActionTypes.Send,lp=Ot.ActionTypes.Cancel,fp=Ot.ActionTypes.NullEvent,dp=Ot.ActionTypes.Assign,hp=Ot.ActionTypes.After,pp=Ot.ActionTypes.DoneState,vp=Ot.ActionTypes.Log,yp=Ot.ActionTypes.Init,mp=Ot.ActionTypes.Invoke,gp=Ot.ActionTypes.ErrorExecution,bp=Ot.ActionTypes.ErrorPlatform,Sp=Ot.ActionTypes.ErrorCustom,Cp=Ot.ActionTypes.Update,wp=Ot.ActionTypes.Choose,Tp=Ot.ActionTypes.Pure;Ct.after=hp;Ct.assign=dp;Ct.cancel=lp;Ct.choose=wp;Ct.doneState=pp;Ct.error=Sp;Ct.errorExecution=gp;Ct.errorPlatform=bp;Ct.init=yp;Ct.invoke=mp;Ct.log=vp;Ct.nullEvent=fp;Ct.pure=Tp;Ct.raise=up;Ct.send=cp;Ct.start=ap;Ct.stop=sp;Ct.update=Cp;var As={},mn={};Object.defineProperty(mn,"__esModule",{value:!0});var Ip=".",Ep={},xp="xstate.guard",Ap="";mn.DEFAULT_GUARD_TYPE=xp;mn.EMPTY_ACTIVITY_MAP=Ep;mn.STATE_DELIMITER=Ip;mn.TARGETLESS_KEY=Ap;var Hr={};Object.defineProperty(Hr,"__esModule",{value:!0});var Dp=process.env.NODE_ENV==="production";Hr.IS_PRODUCTION=Dp;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=no,n=zr,r=Ct,i=mn,o=Hr,a;function u(p){return Object.keys(p)}function s(p,A,M){M===void 0&&(M=i.STATE_DELIMITER);var _=y(p,M),U=y(A,M);return ut(U)?ut(_)?U===_:!1:ut(_)?_ in U:Object.keys(_).every(function(k){return k in U?s(_[k],U[k]):!1})}function l(p){try{return ut(p)||typeof p=="number"?"".concat(p):p.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function f(p){try{return ut(p)||typeof p=="number"?"".concat(p):dt(p)?p.name:p.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function h(p,A){try{return kt(p)?p:p.toString().split(A)}catch{throw new Error("'".concat(p,"' is not a valid state path."))}}function d(p){return typeof p=="object"&&"value"in p&&"context"in p&&"event"in p&&"_event"in p}function y(p,A){if(d(p))return p.value;if(kt(p))return m(p);if(typeof p!="string")return p;var M=h(p,A);return m(M)}function m(p){if(p.length===1)return p[0];for(var A={},M=A,_=0;_<p.length-1;_++)_===p.length-2?M[p[_]]=p[_+1]:(M[p[_]]={},M=M[p[_]]);return A}function v(p,A){for(var M={},_=Object.keys(p),U=0;U<_.length;U++){var k=_[U];M[k]=A(p[k],k,p,U)}return M}function w(p,A,M){var _,U,k={};try{for(var Y=e.__values(Object.keys(p)),H=Y.next();!H.done;H=Y.next()){var ct=H.value,gt=p[ct];M(gt)&&(k[ct]=A(gt,ct,p))}}catch(ae){_={error:ae}}finally{try{H&&!H.done&&(U=Y.return)&&U.call(Y)}finally{if(_)throw _.error}}return k}var E=function(p){return function(A){var M,_,U=A;try{for(var k=e.__values(p),Y=k.next();!Y.done;Y=k.next()){var H=Y.value;U=U[H]}}catch(ct){M={error:ct}}finally{try{Y&&!Y.done&&(_=k.return)&&_.call(k)}finally{if(M)throw M.error}}return U}};function C(p,A){return function(M){var _,U,k=M;try{for(var Y=e.__values(p),H=Y.next();!H.done;H=Y.next()){var ct=H.value;k=k[A][ct]}}catch(gt){_={error:gt}}finally{try{H&&!H.done&&(U=Y.return)&&U.call(Y)}finally{if(_)throw _.error}}return k}}function S(p){if(!p)return[[]];if(ut(p))return[[p]];var A=P(Object.keys(p).map(function(M){var _=p[M];return typeof _!="string"&&(!_||!Object.keys(_).length)?[[M]]:S(p[M]).map(function(U){return[M].concat(U)})}));return A}function I(p){var A,M,_={};if(p&&p.length===1&&p[0].length===1)return p[0][0];try{for(var U=e.__values(p),k=U.next();!k.done;k=U.next())for(var Y=k.value,H=_,ct=0;ct<Y.length;ct++){var gt=Y[ct];if(ct===Y.length-2){H[gt]=Y[ct+1];break}H[gt]=H[gt]||{},H=H[gt]}}catch(ae){A={error:ae}}finally{try{k&&!k.done&&(M=U.return)&&M.call(U)}finally{if(A)throw A.error}}return _}function P(p){var A;return(A=[]).concat.apply(A,e.__spreadArray([],e.__read(p),!1))}function g(p){return kt(p)?p:[p]}function N(p){return p===void 0?[]:g(p)}function F(p,A,M){var _,U;if(dt(p))return p(A,M.data);var k={};try{for(var Y=e.__values(Object.keys(p)),H=Y.next();!H.done;H=Y.next()){var ct=H.value,gt=p[ct];dt(gt)?k[ct]=gt(A,M.data):k[ct]=gt}}catch(ae){_={error:ae}}finally{try{H&&!H.done&&(U=Y.return)&&U.call(Y)}finally{if(_)throw _.error}}return k}function $(p){return/^(done|error)\./.test(p)}function z(p){return!!(p instanceof Promise||p!==null&&(dt(p)||typeof p=="object")&&dt(p.then))}function q(p){return p!==null&&typeof p=="object"&&"transition"in p&&typeof p.transition=="function"}function D(p,A){var M,_,U=e.__read([[],[]],2),k=U[0],Y=U[1];try{for(var H=e.__values(p),ct=H.next();!ct.done;ct=H.next()){var gt=ct.value;A(gt)?k.push(gt):Y.push(gt)}}catch(ae){M={error:ae}}finally{try{ct&&!ct.done&&(_=H.return)&&_.call(H)}finally{if(M)throw M.error}}return[k,Y]}function et(p,A){return v(p.states,function(M,_){if(M){var U=(ut(A)?void 0:A[_])||(M?M.current:void 0);if(U)return{current:U,states:et(M,U)}}})}function mt(p,A){return{current:A,states:et(p,A)}}function Qt(p,A,M,_){o.IS_PRODUCTION||t.warn(!!p,"Attempting to update undefined context");var U=p&&M.reduce(function(k,Y){var H,ct,gt=Y.assignment,ae={state:_,action:Y,_event:A},ti={};if(dt(gt))ti=gt(k,A.data,ae);else try{for(var nr=e.__values(Object.keys(gt)),Tn=nr.next();!Tn.done;Tn=nr.next()){var ho=Tn.value,ei=gt[ho];ti[ho]=dt(ei)?ei(k,A.data,ae):ei}}catch(Iu){H={error:Iu}}finally{try{Tn&&!Tn.done&&(ct=nr.return)&&ct.call(nr)}finally{if(H)throw H.error}}return Object.assign({},k,ti)},p);return U}t.warn=function(){},o.IS_PRODUCTION||(t.warn=function(p,A){var M=p instanceof Error?p:void 0;if(!(!M&&p)&&console!==void 0){var _=["Warning: ".concat(A)];M&&_.push(M),console.warn.apply(console,_)}});function kt(p){return Array.isArray(p)}function dt(p){return typeof p=="function"}function ut(p){return typeof p=="string"}function Et(p,A){if(p)return ut(p)?{type:i.DEFAULT_GUARD_TYPE,name:p,predicate:A?A[p]:void 0}:dt(p)?{type:i.DEFAULT_GUARD_TYPE,name:p.name,predicate:p}:p}function tr(p){try{return"subscribe"in p&&dt(p.subscribe)}catch{return!1}}var Bt=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Zr=(a={},a[Bt]=function(){return this},a[Symbol.observable]=function(){return this},a);function er(p){return!!p&&"__xstatenode"in p}function Lt(p){return!!p&&typeof p.send=="function"}var Te=function(){var p=0;return function(){return p++,p.toString(16)}}();function fo(p,A){return ut(p)||typeof p=="number"?e.__assign({type:p},A):p}function vu(p,A){if(!ut(p)&&"$$type"in p&&p.$$type==="scxml")return p;var M=fo(p);return e.__assign({name:M.type,data:M,$$type:"scxml",type:"external"},A)}function yu(p,A){var M=g(A).map(function(_){return typeof _>"u"||typeof _=="string"||er(_)?{target:_,event:p}:e.__assign(e.__assign({},_),{event:p})});return M}function mu(p){if(!(p===void 0||p===i.TARGETLESS_KEY))return N(p)}function gu(p,A,M){if(!o.IS_PRODUCTION){var _=p.stack?" Stacktrace was '".concat(p.stack,"'"):"";if(p===A)console.error("Missing onError handler for invocation '".concat(M,"', error was '").concat(p,"'.").concat(_));else{var U=A.stack?" Stacktrace was '".concat(A.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(M,"'. ")+"Original error: '".concat(p,"'. ").concat(_," Current error is '").concat(A,"'.").concat(U))}}}function bu(p,A,M,_,U){var k=p.options.guards,Y={state:U,cond:A,_event:_};if(A.type===i.DEFAULT_GUARD_TYPE)return((k==null?void 0:k[A.name])||A.predicate)(M,_.data,Y);var H=k==null?void 0:k[A.type];if(!H)throw new Error("Guard '".concat(A.type,"' is not implemented on machine '").concat(p.id,"'."));return H(M,_.data,Y)}function Su(p){return typeof p=="string"?{type:p}:p}function Cu(p,A,M){var _=function(){},U=typeof p=="object",k=U?p:null;return{next:((U?p.next:p)||_).bind(k),error:((U?p.error:A)||_).bind(k),complete:((U?p.complete:M)||_).bind(k)}}function wu(p,A){return"".concat(p,":invocation[").concat(A,"]")}function Tu(p){return(p.type===r.raise||p.type===r.send&&p.to===n.SpecialTargets.Internal)&&typeof p.delay!="number"}t.createInvokeId=wu,t.evaluateGuard=bu,t.flatten=P,t.getActionType=f,t.getEventType=l,t.interopSymbols=Zr,t.isActor=Lt,t.isArray=kt,t.isBehavior=q,t.isBuiltInEvent=$,t.isFunction=dt,t.isMachine=er,t.isObservable=tr,t.isPromiseLike=z,t.isRaisableAction=Tu,t.isStateLike=d,t.isString=ut,t.keys=u,t.mapContext=F,t.mapFilterValues=w,t.mapValues=v,t.matchesState=s,t.nestedPath=C,t.normalizeTarget=mu,t.partition=D,t.path=E,t.pathToStateValue=m,t.pathsToStateValue=I,t.reportUnhandledExceptionOnInvocation=gu,t.symbolObservable=Bt,t.toArray=N,t.toArrayStrict=g,t.toEventObject=fo,t.toGuard=Et,t.toInvokeSource=Su,t.toObserver=Cu,t.toSCXMLEvent=vu,t.toStatePath=h,t.toStatePaths=S,t.toStateValue=y,t.toTransitionConfigArray=yu,t.uniqueId=Te,t.updateContext=Qt,t.updateHistoryStates=et,t.updateHistoryValue=mt})(As);Object.defineProperty(rt,"__esModule",{value:!0});var tt=no,Yt=zr,Dt=Ct,W=As,Ds=Hr,Op=W.toSCXMLEvent({type:Dt.init});function Di(t,e){return e&&e[t]||void 0}function Wr(t,e){var n;if(W.isString(t)||typeof t=="number"){var r=Di(t,e);W.isFunction(r)?n={type:t,exec:r}:r?n=r:n={type:t,exec:void 0}}else if(W.isFunction(t))n={type:t.name||t.toString(),exec:t};else{var r=Di(t.type,e);if(W.isFunction(r))n=tt.__assign(tt.__assign({},t),{exec:r});else if(r){var i=r.type||t.type;n=tt.__assign(tt.__assign(tt.__assign({},r),t),{type:i})}else n=t}return n}var Oi=function(t,e){if(!t)return[];var n=W.isArray(t)?t:[t];return n.map(function(r){return Wr(r,e)})};function ro(t){var e=Wr(t);return tt.__assign(tt.__assign({id:W.isString(t)?t:e.id},e),{type:e.type})}function Np(t,e){return{type:Dt.raise,event:typeof t=="function"?t:W.toEventObject(t),delay:e?e.delay:void 0,id:e==null?void 0:e.id}}function Os(t,e,n,r){var i={_event:n},o=W.toSCXMLEvent(W.isFunction(t.event)?t.event(e,n.data,i):t.event),a;if(W.isString(t.delay)){var u=r&&r[t.delay];a=W.isFunction(u)?u(e,n.data,i):u}else a=W.isFunction(t.delay)?t.delay(e,n.data,i):t.delay;return tt.__assign(tt.__assign({},t),{type:Dt.raise,_event:o,delay:a})}function Xn(t,e){return{to:e?e.to:void 0,type:Dt.send,event:W.isFunction(t)?t:W.toEventObject(t),delay:e?e.delay:void 0,id:e&&e.id!==void 0?e.id:W.isFunction(t)?t.name:W.getEventType(t)}}function Ns(t,e,n,r){var i={_event:n},o=W.toSCXMLEvent(W.isFunction(t.event)?t.event(e,n.data,i):t.event),a;if(W.isString(t.delay)){var u=r&&r[t.delay];a=W.isFunction(u)?u(e,n.data,i):u}else a=W.isFunction(t.delay)?t.delay(e,n.data,i):t.delay;var s=W.isFunction(t.to)?t.to(e,n.data,i):t.to;return tt.__assign(tt.__assign({},t),{to:s,_event:o,event:o.data,delay:a})}function io(t,e){return Xn(t,tt.__assign(tt.__assign({},e),{to:Yt.SpecialTargets.Parent}))}function _p(t,e,n){return Xn(e,tt.__assign(tt.__assign({},n),{to:t}))}function Mp(){return io(Dt.update)}function $p(t,e){return Xn(t,tt.__assign(tt.__assign({},e),{to:function(n,r,i){var o=i._event;return o.origin}}))}var qp=function(t,e){return{context:t,event:e}};function Pp(t,e){return t===void 0&&(t=qp),{type:Dt.log,label:e,expr:t}}var _s=function(t,e,n){return tt.__assign(tt.__assign({},t),{value:W.isString(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})},Rp=function(t){return{type:Dt.cancel,sendId:t}};function jp(t){var e=ro(t);return{type:Yt.ActionTypes.Start,activity:e,exec:void 0}}function Up(t){var e=W.isFunction(t)?t:ro(t);return{type:Yt.ActionTypes.Stop,activity:e,exec:void 0}}function Ms(t,e,n){var r=W.isFunction(t.activity)?t.activity(e,n.data):t.activity,i=typeof r=="string"?{id:r}:r,o={type:Yt.ActionTypes.Stop,activity:i};return o}var kp=function(t){return{type:Dt.assign,assignment:t}};function Bp(t){return typeof t=="object"&&"type"in t}function Vp(t,e){var n=e?"#".concat(e):"";return"".concat(Yt.ActionTypes.After,"(").concat(t,")").concat(n)}function Fp(t,e){var n="".concat(Yt.ActionTypes.DoneState,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function Gp(t,e){var n="".concat(Yt.ActionTypes.DoneInvoke,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function Lp(t,e){var n="".concat(Yt.ActionTypes.ErrorPlatform,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function zp(t){return{type:Yt.ActionTypes.Pure,get:t}}function Hp(t,e){if(!Ds.IS_PRODUCTION&&(!t||typeof t=="function")){var n=t;t=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,tt.__spreadArray([],tt.__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 Xn(function(r,i){return i},tt.__assign(tt.__assign({},e),{to:t}))}function Wp(t,e){return io(function(n,r,i){return{type:Dt.error,data:W.isFunction(t)?t(n,r,i):t}},tt.__assign(tt.__assign({},e),{to:Yt.SpecialTargets.Parent}))}function Kp(t){return{type:Yt.ActionTypes.Choose,conds:t}}var Jp=function(t){var e,n,r=[];try{for(var i=tt.__values(t),o=i.next();!o.done;o=i.next())for(var a=o.value,u=0;u<a.actions.length;){if(a.actions[u].type===Dt.assign){r.push(a.actions[u]),a.actions.splice(u,1);continue}u++}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r};function Ni(t,e,n,r,i,o,a){a===void 0&&(a=!1);var u=a?[]:Jp(i),s=u.length?W.updateContext(n,r,u,e):n,l=a?[n]:void 0,f=[];function h(m,v){var w;switch(v.type){case Dt.raise:{var E=Os(v,s,r,t.options.delays);return o&&typeof E.delay=="number"&&o(E,s,r),E}case Dt.send:var C=Ns(v,s,r,t.options.delays);if(!Ds.IS_PRODUCTION){var S=v.delay;W.warn(!W.isString(S)||typeof C.delay=="number","No delay reference for delay expression '".concat(S,"' was found on machine '").concat(t.id,"'"))}return o&&C.to!==Yt.SpecialTargets.Internal&&(m==="entry"?f.push(C):o(C,s,r)),C;case Dt.log:{var I=_s(v,s,r);return o==null||o(I,s,r),I}case Dt.choose:{var P=v,g=(w=P.conds.find(function(dt){var ut=W.toGuard(dt.cond,t.options.guards);return!ut||W.evaluateGuard(t,ut,s,r,o?void 0:e)}))===null||w===void 0?void 0:w.actions;if(!g)return[];var N=tt.__read(Ni(t,e,s,r,[{type:m,actions:Oi(W.toArray(g),t.options.actions)}],o,a),2),F=N[0],$=N[1];return s=$,l==null||l.push(s),F}case Dt.pure:{var g=v.get(s,r.data);if(!g)return[];var z=tt.__read(Ni(t,e,s,r,[{type:m,actions:Oi(W.toArray(g),t.options.actions)}],o,a),2),q=z[0],D=z[1];return s=D,l==null||l.push(s),q}case Dt.stop:{var I=Ms(v,s,r);return o==null||o(I,n,r),I}case Dt.assign:{s=W.updateContext(s,r,[v],o?void 0:e),l==null||l.push(s);break}default:var et=Wr(v,t.options.actions),mt=et.exec;if(o)o(et,s,r);else if(mt&&l){var Qt=l.length-1,kt=tt.__assign(tt.__assign({},et),{exec:function(dt){for(var ut=[],Et=1;Et<arguments.length;Et++)ut[Et-1]=arguments[Et];mt.apply(void 0,tt.__spreadArray([l[Qt]],tt.__read(ut),!1))}});et=kt}return et}}function d(m){var v,w,E=[];try{for(var C=tt.__values(m.actions),S=C.next();!S.done;S=C.next()){var I=S.value,P=h(m.type,I);P&&(E=E.concat(P))}}catch(g){v={error:g}}finally{try{S&&!S.done&&(w=C.return)&&w.call(C)}finally{if(v)throw v.error}}return f.forEach(function(g){o(g,s,r)}),f.length=0,E}var y=W.flatten(i.map(d));return[y,s]}rt.actionTypes=Dt;rt.after=Vp;rt.assign=kp;rt.cancel=Rp;rt.choose=Kp;rt.done=Fp;rt.doneInvoke=Gp;rt.error=Lp;rt.escalate=Wp;rt.forwardTo=Hp;rt.getActionFunction=Di;rt.initEvent=Op;rt.isActionObject=Bp;var Wt=rt.log=Pp,Xp=rt.pure=zp;rt.raise=Np;rt.resolveActions=Ni;rt.resolveLog=_s;rt.resolveRaise=Os;rt.resolveSend=Ns;rt.resolveStop=Ms;rt.respond=$p;rt.send=Xn;rt.sendParent=io;rt.sendTo=_p;rt.sendUpdate=Mp;rt.start=jp;var Wo=rt.stop=Up;rt.toActionObject=Wr;rt.toActionObjects=Oi;rt.toActivityDefinition=ro;var _i={exports:{}},ri={},lr={exports:{}},ii={};/**
|
|
35
|
+
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,c=arguments.length;u<c;u++){s=arguments[u];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(a[l]=s[l])}return a},e.__assign.apply(this,arguments)};function t(o,a){var s={};for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&a.indexOf(u)<0&&(s[u]=o[u]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,u=Object.getOwnPropertySymbols(o);c<u.length;c++)a.indexOf(u[c])<0&&Object.prototype.propertyIsEnumerable.call(o,u[c])&&(s[u[c]]=o[u[c]]);return s}function n(o){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&o[a],u=0;if(s)return s.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&u>=o.length&&(o=void 0),{value:o&&o[u++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(o,a){var s=typeof Symbol=="function"&&o[Symbol.iterator];if(!s)return o;var u=s.call(o),c,l=[],f;try{for(;(a===void 0||a-- >0)&&!(c=u.next()).done;)l.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return l}function i(o,a,s){if(s||arguments.length===2)for(var u=0,c=a.length,l;u<c;u++)(l||!(u in a))&&(l||(l=Array.prototype.slice.call(a,0,u)),l[u]=a[u]);return o.concat(l||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(Eh);var Dl={};(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={}))})(Dl);var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});var sn=Dl,z$=sn.ActionTypes.Start,W$=sn.ActionTypes.Stop,H$=sn.ActionTypes.Raise,K$=sn.ActionTypes.Send,Y$=sn.ActionTypes.Cancel,X$=sn.ActionTypes.NullEvent,J$=sn.ActionTypes.Assign,Q$=sn.ActionTypes.After,Z$=sn.ActionTypes.DoneState,eO=sn.ActionTypes.Log,tO=sn.ActionTypes.Init,nO=sn.ActionTypes.Invoke,rO=sn.ActionTypes.ErrorExecution,iO=sn.ActionTypes.ErrorPlatform,oO=sn.ActionTypes.ErrorCustom,aO=sn.ActionTypes.Update,sO=sn.ActionTypes.Choose,uO=sn.ActionTypes.Pure;Lt.after=Q$;Lt.assign=J$;Lt.cancel=Y$;Lt.choose=sO;Lt.doneState=Z$;Lt.error=oO;Lt.errorExecution=rO;Lt.errorPlatform=iO;Lt.init=tO;Lt.invoke=nO;Lt.log=eO;Lt.nullEvent=X$;Lt.pure=uO;Lt.raise=H$;Lt.send=K$;Lt.start=z$;Lt.stop=W$;Lt.update=aO;var PS={},ka={};Object.defineProperty(ka,"__esModule",{value:!0});var cO=".",lO={},fO="xstate.guard",dO="";ka.DEFAULT_GUARD_TYPE=fO;ka.EMPTY_ACTIVITY_MAP=lO;ka.STATE_DELIMITER=cO;ka.TARGETLESS_KEY=dO;var Nl={};Object.defineProperty(Nl,"__esModule",{value:!0});var pO=process.env.NODE_ENV==="production";Nl.IS_PRODUCTION=pO;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Eh,n=Dl,r=Lt,i=ka,o=Nl,a;function s(g){return Object.keys(g)}function u(g,M,F){F===void 0&&(F=i.STATE_DELIMITER);var q=p(g,F),X=p(M,F);return U(X)?U(q)?X===q:!1:U(q)?q in X:Object.keys(q).every(function(Z){return Z in X?u(q[Z],X[Z]):!1})}function c(g){try{return U(g)||typeof g=="number"?"".concat(g):g.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function l(g){try{return U(g)||typeof g=="number"?"".concat(g):V(g)?g.name:g.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(g,M){try{return ie(g)?g:g.toString().split(M)}catch{throw new Error("'".concat(g,"' is not a valid state path."))}}function d(g){return typeof g=="object"&&"value"in g&&"context"in g&&"event"in g&&"_event"in g}function p(g,M){if(d(g))return g.value;if(ie(g))return h(g);if(typeof g!="string")return g;var F=f(g,M);return h(F)}function h(g){if(g.length===1)return g[0];for(var M={},F=M,q=0;q<g.length-1;q++)q===g.length-2?F[g[q]]=g[q+1]:(F[g[q]]={},F=F[g[q]]);return M}function v(g,M){for(var F={},q=Object.keys(g),X=0;X<q.length;X++){var Z=q[X];F[Z]=M(g[Z],Z,g,X)}return F}function x(g,M,F){var q,X,Z={};try{for(var le=t.__values(Object.keys(g)),se=le.next();!se.done;se=le.next()){var be=se.value,Ae=g[be];F(Ae)&&(Z[be]=M(Ae,be,g))}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Z}var E=function(g){return function(M){var F,q,X=M;try{for(var Z=t.__values(g),le=Z.next();!le.done;le=Z.next()){var se=le.value;X=X[se]}}catch(be){F={error:be}}finally{try{le&&!le.done&&(q=Z.return)&&q.call(Z)}finally{if(F)throw F.error}}return X}};function y(g,M){return function(F){var q,X,Z=F;try{for(var le=t.__values(g),se=le.next();!se.done;se=le.next()){var be=se.value;Z=Z[M][be]}}catch(Ae){q={error:Ae}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Z}}function S(g){if(!g)return[[]];if(U(g))return[[g]];var M=b(Object.keys(g).map(function(F){var q=g[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:S(g[F]).map(function(X){return[F].concat(X)})}));return M}function w(g){var M,F,q={};if(g&&g.length===1&&g[0].length===1)return g[0][0];try{for(var X=t.__values(g),Z=X.next();!Z.done;Z=X.next())for(var le=Z.value,se=q,be=0;be<le.length;be++){var Ae=le[be];if(be===le.length-2){se[Ae]=le[be+1];break}se[Ae]=se[Ae]||{},se=se[Ae]}}catch(jt){M={error:jt}}finally{try{Z&&!Z.done&&(F=X.return)&&F.call(X)}finally{if(M)throw M.error}}return q}function b(g){var M;return(M=[]).concat.apply(M,t.__spreadArray([],t.__read(g),!1))}function T(g){return ie(g)?g:[g]}function A(g){return g===void 0?[]:T(g)}function D(g,M,F){var q,X;if(V(g))return g(M,F.data);var Z={};try{for(var le=t.__values(Object.keys(g)),se=le.next();!se.done;se=le.next()){var be=se.value,Ae=g[be];V(Ae)?Z[be]=Ae(M,F.data):Z[be]=Ae}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Z}function I(g){return/^(done|error)\./.test(g)}function N(g){return!!(g instanceof Promise||g!==null&&(V(g)||typeof g=="object")&&V(g.then))}function _(g){return g!==null&&typeof g=="object"&&"transition"in g&&typeof g.transition=="function"}function L(g,M){var F,q,X=t.__read([[],[]],2),Z=X[0],le=X[1];try{for(var se=t.__values(g),be=se.next();!be.done;be=se.next()){var Ae=be.value;M(Ae)?Z.push(Ae):le.push(Ae)}}catch(jt){F={error:jt}}finally{try{be&&!be.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Z,le]}function B(g,M){return v(g.states,function(F,q){if(F){var X=(U(M)?void 0:M[q])||(F?F.current:void 0);if(X)return{current:X,states:B(F,X)}}})}function K(g,M){return{current:M,states:B(g,M)}}function k(g,M,F,q){o.IS_PRODUCTION||e.warn(!!g,"Attempting to update undefined context");var X=g&&F.reduce(function(Z,le){var se,be,Ae=le.assignment,jt={state:q,action:le,_event:M},Hi={};if(V(Ae))Hi=Ae(Z,M.data,jt);else try{for(var kr=t.__values(Object.keys(Ae)),fr=kr.next();!fr.done;fr=kr.next()){var Ja=fr.value,Ki=Ae[Ja];Hi[Ja]=V(Ki)?Ki(Z,M.data,jt):Ki}}catch(wf){se={error:wf}}finally{try{fr&&!fr.done&&(be=kr.return)&&be.call(kr)}finally{if(se)throw se.error}}return Object.assign({},Z,Hi)},g);return X}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(g,M){var F=g instanceof Error?g:void 0;if(!(!F&&g)&&console!==void 0){var q=["Warning: ".concat(M)];F&&q.push(F),console.warn.apply(console,q)}});function ie(g){return Array.isArray(g)}function V(g){return typeof g=="function"}function U(g){return typeof g=="string"}function fe(g,M){if(g)return U(g)?{type:i.DEFAULT_GUARD_TYPE,name:g,predicate:M?M[g]:void 0}:V(g)?{type:i.DEFAULT_GUARD_TYPE,name:g.name,predicate:g}:g}function j(g){try{return"subscribe"in g&&V(g.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(g){return!!g&&"__xstatenode"in g}function Y(g){return!!g&&typeof g.send=="function"}var ae=function(){var g=0;return function(){return g++,g.toString(16)}}();function de(g,M){return U(g)||typeof g=="number"?t.__assign({type:g},M):g}function he(g,M){if(!U(g)&&"$$type"in g&&g.$$type==="scxml")return g;var F=de(g);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},M)}function xe(g,M){var F=T(M).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:g}:t.__assign(t.__assign({},q),{event:g})});return F}function ke(g){if(!(g===void 0||g===i.TARGETLESS_KEY))return A(g)}function De(g,M,F){if(!o.IS_PRODUCTION){var q=g.stack?" Stacktrace was '".concat(g.stack,"'"):"";if(g===M)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(g,"'.").concat(q));else{var X=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(g,"'. ").concat(q," Current error is '").concat(M,"'.").concat(X))}}}function ht(g,M,F,q,X){var Z=g.options.guards,le={state:X,cond:M,_event:q};if(M.type===i.DEFAULT_GUARD_TYPE)return((Z==null?void 0:Z[M.name])||M.predicate)(F,q.data,le);var se=Z==null?void 0:Z[M.type];if(!se)throw new Error("Guard '".concat(M.type,"' is not implemented on machine '").concat(g.id,"'."));return se(F,q.data,le)}function ce(g){return typeof g=="string"?{type:g}:g}function Dn(g,M,F){var q=function(){},X=typeof g=="object",Z=X?g:null;return{next:((X?g.next:g)||q).bind(Z),error:((X?g.error:M)||q).bind(Z),complete:((X?g.complete:F)||q).bind(Z)}}function ii(g,M){return"".concat(g,":invocation[").concat(M,"]")}function qo(g){return(g.type===r.raise||g.type===r.send&&g.to===n.SpecialTargets.Internal)&&typeof g.delay!="number"}e.createInvokeId=ii,e.evaluateGuard=ht,e.flatten=b,e.getActionType=l,e.getEventType=c,e.interopSymbols=te,e.isActor=Y,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=V,e.isMachine=oe,e.isObservable=j,e.isPromiseLike=N,e.isRaisableAction=qo,e.isStateLike=d,e.isString=U,e.keys=s,e.mapContext=D,e.mapFilterValues=x,e.mapValues=v,e.matchesState=u,e.nestedPath=y,e.normalizeTarget=ke,e.partition=L,e.path=E,e.pathToStateValue=h,e.pathsToStateValue=w,e.reportUnhandledExceptionOnInvocation=De,e.symbolObservable=R,e.toArray=A,e.toArrayStrict=T,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=ce,e.toObserver=Dn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=S,e.toStateValue=p,e.toTransitionConfigArray=xe,e.uniqueId=ae,e.updateContext=k,e.updateHistoryStates=B,e.updateHistoryValue=K})(PS);Object.defineProperty(et,"__esModule",{value:!0});var He=Eh,cr=Dl,rn=Lt,qe=PS,RS=Nl,hO=qe.toSCXMLEvent({type:rn.init});function kd(e,t){return t&&t[e]||void 0}function Pl(e,t){var n;if(qe.isString(e)||typeof e=="number"){var r=kd(e,t);qe.isFunction(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(qe.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var r=kd(e.type,t);if(qe.isFunction(r))n=He.__assign(He.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=He.__assign(He.__assign(He.__assign({},r),e),{type:i})}else n=e}return n}var Md=function(e,t){if(!e)return[];var n=qe.isArray(e)?e:[e];return n.map(function(r){return Pl(r,t)})};function Th(e){var t=Pl(e);return He.__assign(He.__assign({id:qe.isString(e)?e:t.id},t),{type:t.type})}function vO(e,t){return{type:rn.raise,event:typeof e=="function"?e:qe.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function kS(e,t,n,r){var i={_event:n},o=qe.toSCXMLEvent(qe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(qe.isString(e.delay)){var s=r&&r[e.delay];a=qe.isFunction(s)?s(t,n.data,i):s}else a=qe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return He.__assign(He.__assign({},e),{type:rn.raise,_event:o,delay:a})}function lu(e,t){return{to:t?t.to:void 0,type:rn.send,event:qe.isFunction(e)?e:qe.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:qe.isFunction(e)?e.name:qe.getEventType(e)}}function MS(e,t,n,r){var i={_event:n},o=qe.toSCXMLEvent(qe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(qe.isString(e.delay)){var s=r&&r[e.delay];a=qe.isFunction(s)?s(t,n.data,i):s}else a=qe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=qe.isFunction(e.to)?e.to(t,n.data,i):e.to;return He.__assign(He.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function Ih(e,t){return lu(e,He.__assign(He.__assign({},t),{to:cr.SpecialTargets.Parent}))}function mO(e,t,n){return lu(t,He.__assign(He.__assign({},n),{to:e}))}function yO(){return Ih(rn.update)}function gO(e,t){return lu(e,He.__assign(He.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var bO=function(e,t){return{context:e,event:t}};function SO(e,t){return e===void 0&&(e=bO),{type:rn.log,label:t,expr:e}}var jS=function(e,t,n){return He.__assign(He.__assign({},e),{value:qe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},CO=function(e){return{type:rn.cancel,sendId:e}};function wO(e){var t=Th(e);return{type:cr.ActionTypes.Start,activity:t,exec:void 0}}function xO(e){var t=qe.isFunction(e)?e:Th(e);return{type:cr.ActionTypes.Stop,activity:t,exec:void 0}}function _S(e,t,n){var r=qe.isFunction(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:cr.ActionTypes.Stop,activity:i};return o}var EO=function(e){return{type:rn.assign,assignment:e}};function TO(e){return typeof e=="object"&&"type"in e}function IO(e,t){var n=t?"#".concat(t):"";return"".concat(cr.ActionTypes.After,"(").concat(e,")").concat(n)}function AO(e,t){var n="".concat(cr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function $O(e,t){var n="".concat(cr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function OO(e,t){var n="".concat(cr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function DO(e){return{type:cr.ActionTypes.Pure,get:e}}function NO(e,t){if(!RS.IS_PRODUCTION&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,He.__spreadArray([],He.__read(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return lu(function(r,i){return i},He.__assign(He.__assign({},t),{to:e}))}function PO(e,t){return Ih(function(n,r,i){return{type:rn.error,data:qe.isFunction(e)?e(n,r,i):e}},He.__assign(He.__assign({},t),{to:cr.SpecialTargets.Parent}))}function RO(e){return{type:cr.ActionTypes.Choose,conds:e}}var kO=function(e){var t,n,r=[];try{for(var i=He.__values(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===rn.assign){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function jd(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:kO(i),u=s.length?qe.updateContext(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var x;switch(v.type){case rn.raise:{var E=kS(v,u,r,e.options.delays);return o&&typeof E.delay=="number"&&o(E,u,r),E}case rn.send:var y=MS(v,u,r,e.options.delays);if(!RS.IS_PRODUCTION){var S=v.delay;qe.warn(!qe.isString(S)||typeof y.delay=="number","No delay reference for delay expression '".concat(S,"' was found on machine '").concat(e.id,"'"))}return o&&y.to!==cr.SpecialTargets.Internal&&(h==="entry"?l.push(y):o(y,u,r)),y;case rn.log:{var w=jS(v,u,r);return o==null||o(w,u,r),w}case rn.choose:{var b=v,T=(x=b.conds.find(function(V){var U=qe.toGuard(V.cond,e.options.guards);return!U||qe.evaluateGuard(e,U,u,r,o?void 0:t)}))===null||x===void 0?void 0:x.actions;if(!T)return[];var A=He.__read(jd(e,t,u,r,[{type:h,actions:Md(qe.toArray(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case rn.pure:{var T=v.get(u,r.data);if(!T)return[];var N=He.__read(jd(e,t,u,r,[{type:h,actions:Md(qe.toArray(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case rn.stop:{var w=_S(v,u,r);return o==null||o(w,n,r),w}case rn.assign:{u=qe.updateContext(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var B=Pl(v,e.options.actions),K=B.exec;if(o)o(B,u,r);else if(K&&c){var k=c.length-1,ie=He.__assign(He.__assign({},B),{exec:function(V){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];K.apply(void 0,He.__spreadArray([c[k]],He.__read(U),!1))}});B=ie}return B}}function d(h){var v,x,E=[];try{for(var y=He.__values(h.actions),S=y.next();!S.done;S=y.next()){var w=S.value,b=f(h.type,w);b&&(E=E.concat(b))}}catch(T){v={error:T}}finally{try{S&&!S.done&&(x=y.return)&&x.call(y)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,E}var p=qe.flatten(i.map(d));return[p,u]}et.actionTypes=rn;et.after=IO;et.assign=EO;et.cancel=CO;et.choose=RO;et.done=AO;et.doneInvoke=$O;et.error=OO;et.escalate=PO;et.forwardTo=NO;et.getActionFunction=kd;et.initEvent=hO;et.isActionObject=TO;var Ln=et.log=SO,MO=et.pure=DO;et.raise=vO;et.resolveActions=jd;et.resolveLog=jS;et.resolveRaise=kS;et.resolveSend=MS;et.resolveStop=_S;et.respond=gO;et.send=lu;et.sendParent=Ih;et.sendTo=mO;et.sendUpdate=yO;et.start=wO;var bm=et.stop=xO;et.toActionObject=Pl;et.toActionObjects=Md;et.toActivityDefinition=Th;function qS(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function Rl(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 FS(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 Sm(e){return e.constructor===Object||e.constructor==null}function Cm(e){return typeof e.then=="function"}function kl(e,t){return e===t||e!==e&&t!==t}var jO="[object Arguments]",_O="[object Boolean]",qO="[object Date]",FO="[object RegExp]",LO="[object Map]",VO="[object Number]",BO="[object Object]",UO="[object Set]",GO="[object String]",wm=Object.prototype.toString;function Ml(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.areRegExpsEqual,a=e.areSetsEqual,s=e.createIsNestedEqual,u=s(c);function c(l,f,d){if(l===f)return!0;if(!l||!f||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;if(Sm(l)&&Sm(f))return i(l,f,u,d);var p=Array.isArray(l),h=Array.isArray(f);if(p||h)return p===h&&t(l,f,u,d);var v=wm.call(l);return v!==wm.call(f)?!1:v===qO?n(l,f,u,d):v===FO?o(l,f,u,d):v===LO?r(l,f,u,d):v===UO?a(l,f,u,d):v===BO||v===jO?Cm(l)||Cm(f)?!1:i(l,f,u,d):v===_O||v===VO||v===GO?kl(l.valueOf(),f.valueOf()):!1}return c}function LS(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 zO=Rl(LS);function VS(e,t){return kl(e.valueOf(),t.valueOf())}function BS(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={},a=0;return e.forEach(function(s,u){if(i){var c=!1,l=0;t.forEach(function(f,d){!c&&!o[l]&&(c=n(u,d,a,l,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[l]=!0),l++}),a++,i=c}}),i}var WO=Rl(BS),HO="_owner",KO=Object.prototype.hasOwnProperty;function US(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===HO){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!KO.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var YO=Rl(US);function GS(e,t){return e.source===t.source&&e.flags===t.flags}function zS(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={};return e.forEach(function(a,s){if(i){var u=!1,c=0;t.forEach(function(l,f){!u&&!o[c]&&(u=n(a,l,s,f,e,t,r))&&(o[c]=!0),c++}),i=u}}),i}var XO=Rl(zS),WS=Object.freeze({areArraysEqual:LS,areDatesEqual:VS,areMapsEqual:BS,areObjectsEqual:US,areRegExpsEqual:GS,areSetsEqual:zS,createIsNestedEqual:qS}),HS=Object.freeze({areArraysEqual:zO,areDatesEqual:VS,areMapsEqual:WO,areObjectsEqual:YO,areRegExpsEqual:GS,areSetsEqual:XO,createIsNestedEqual:qS}),JO=Ml(WS);function QO(e,t){return JO(e,t,void 0)}Ml(FS(WS,{createIsNestedEqual:function(){return kl}}));Ml(HS);Ml(FS(HS,{createIsNestedEqual:function(){return kl}}));var _d={exports:{}},Ef={},_u={exports:{}},Tf={};/**
|
|
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!==bt.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 xm;function ZO(){if(xm)return Tf;xm=1;var e=O;function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(f,d){var p=d(),h=r({inst:{value:p,getSnapshot:d}}),v=h[0].inst,x=h[1];return o(function(){v.value=p,v.getSnapshot=d,u(v)&&x({inst:v})},[f,p,d]),i(function(){return u(v)&&x({inst:v}),f(function(){u(v)&&x({inst:v})})},[f]),a(p),p}function u(f){var d=f.getSnapshot;f=f.value;try{var p=d();return!n(f,p)}catch{return!0}}function c(f,d){return d()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return Tf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,Tf}var If={};/**
|
|
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!==bt.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 Em;function eD(){return Em||(Em=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(S){{for(var w=arguments.length,b=new Array(w>1?w-1:0),T=1;T<w;T++)b[T-1]=arguments[T];r("error",S,b)}}function r(S,w,b){{var T=t.ReactDebugCurrentFrame,A=T.getStackAddendum();A!==""&&(w+="%s",b=b.concat([A]));var D=b.map(function(I){return String(I)});D.unshift("Warning: "+w),Function.prototype.apply.call(console[S],console,D)}}function i(S,w){return S===w&&(S!==0||1/S===1/w)||S!==S&&w!==w}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,c=e.useDebugValue,l=!1,f=!1;function d(S,w,b){l||e.startTransition!==void 0&&(l=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var T=w();if(!f){var A=w();o(T,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var D=a({inst:{value:T,getSnapshot:w}}),I=D[0].inst,N=D[1];return u(function(){I.value=T,I.getSnapshot=w,p(I)&&N({inst:I})},[S,T,w]),s(function(){p(I)&&N({inst:I});var _=function(){p(I)&&N({inst:I})};return S(_)},[S]),c(T),T}function p(S){var w=S.getSnapshot,b=S.value;try{var T=w();return!o(b,T)}catch{return!0}}function h(S,w,b){return w()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!v,E=x?h:d,y=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E;If.useSyncExternalStore=y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),If}var Tm;function KS(){return Tm||(Tm=1,process.env.NODE_ENV==="production"?_u.exports=ZO():_u.exports=eD()),_u.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!==bt.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 Im;function tD(){if(Im)return Ef;Im=1;var e=O,t=KS();function n(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;return Ef.useSyncExternalStoreWithSelector=function(c,l,f,d,p){var h=o(null);if(h.current===null){var v={hasValue:!1,value:null};h.current=v}else v=h.current;h=s(function(){function E(T){if(!y){if(y=!0,S=T,T=d(T),p!==void 0&&v.hasValue){var A=v.value;if(p(A,T))return w=A}return w=T}if(A=w,r(S,T))return A;var D=d(T);return p!==void 0&&p(A,D)?A:(S=T,w=D)}var y=!1,S,w,b=f===void 0?null:f;return[function(){return E(l())},b===null?void 0:function(){return E(b())}]},[l,f,d,p]);var x=i(c,h[0],h[1]);return a(function(){v.hasValue=!0,v.value=x},[x]),u(x),x},Ef}var Af={};/**
|
|
60
60
|
* @license React
|
|
61
61
|
* use-sync-external-store-shim/with-selector.development.js
|
|
62
62
|
*
|
|
@@ -64,4 +64,1352 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==bt.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 Qo;function tv(){return Qo||(Qo=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 t=X,e=$s();function n(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,o=t.useRef,a=t.useEffect,u=t.useMemo,s=t.useDebugValue;function l(f,h,d,y,m){var v=o(null),w;v.current===null?(w={hasValue:!1,value:null},v.current=w):w=v.current;var E=u(function(){var P=!1,g,N,F=function(D){if(!P){P=!0,g=D;var et=y(D);if(m!==void 0&&w.hasValue){var mt=w.value;if(m(mt,et))return N=mt,mt}return N=et,et}var Qt=g,kt=N;if(r(Qt,D))return kt;var dt=y(D);return m!==void 0&&m(kt,dt)?kt:(g=D,N=dt,dt)},$=d===void 0?null:d,z=function(){return F(h())},q=$===null?void 0:function(){return F($())};return[z,q]},[h,d,y,m]),C=E[0],S=E[1],I=i(f,C,S);return a(function(){w.hasValue=!0,w.value=I},[I]),s(I),I}ai.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),ai}process.env.NODE_ENV==="production"?_i.exports=Zp():_i.exports=tv();var ev=_i.exports,nv=X.useLayoutEffect;function Zo(t){var e=xu.useRef();return e.current||(e.current={v:t()}),e.current.v}var Ar=globalThis&&globalThis.__assign||function(){return Ar=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ar.apply(this,arguments)},rv=globalThis&&globalThis.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},iv=globalThis&&globalThis.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function ov(t,e){var n=Zo(function(){return typeof t=="function"?t():t});if(process.env.NODE_ENV!=="production"&&typeof t!="function"){var r=iv(X.useState(n),1),i=r[0];t!==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=e.context,a=e.guards,u=e.actions,s=e.activities,l=e.services,f=e.delays;e.state;var h=rv(e,["context","guards","actions","activities","services","delays","state"]),d=Zo(function(){var y={context:o,guards:a,actions:u,activities:s,services:l,delays:f},m=n.withConfig(y,function(){return Ar(Ar({},n.context),o)});return Es(m,h)});return nv(function(){Object.assign(d.machine.options.actions,u),Object.assign(d.machine.options.guards,a),Object.assign(d.machine.options.activities,s),Object.assign(d.machine.options.services,l),Object.assign(d.machine.options.delays,f)},[u,a,s,l,f]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function av(t,e,n){if(t.status===bt.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof e.changed=="boolean");return!(n.changed||r)}var sv=globalThis&&globalThis.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function uv(t){return t}function cv(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=sv(e,1),i=r[0],o=i===void 0?{}:i,a=ov(t,o),u=X.useCallback(function(){return a.status===bt.NotStarted?o.state?Jt.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),s=X.useCallback(function(h,d){return av(a,h,d)},[a]),l=X.useCallback(function(h){var d=a.subscribe(h).unsubscribe;return d},[a]),f=ev.useSyncExternalStoreWithSelector(l,u,u,uv,s);return X.useEffect(function(){var h=o.state;return a.start(h?Jt.create(h):void 0),function(){a.stop(),a.status=bt.NotStarted}},[]),[f,a.send,a]}var lv=globalThis&&globalThis.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function Yn(t){return t}function qs(t){return function(){return t}}var fv=qs(null),Ps=qs(void 0),dv=Ps;function Rs(t,e,n,r,i,o,a,u,s){switch(arguments.length){case 1:return t;case 2:return function(){return e(t.apply(this,arguments))};case 3:return function(){return n(e(t.apply(this,arguments)))};case 4:return function(){return r(n(e(t.apply(this,arguments))))};case 5:return function(){return i(r(n(e(t.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(e(t.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(e(t.apply(this,arguments)))))))};case 8:return function(){return u(a(o(i(r(n(e(t.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(i(r(n(e(t.apply(this,arguments)))))))))}}}function G(t,e,n,r,i,o,a,u,s){switch(arguments.length){case 1:return t;case 2:return e(t);case 3:return n(e(t));case 4:return r(n(e(t)));case 5:return i(r(n(e(t))));case 6:return o(i(r(n(e(t)))));case 7:return a(o(i(r(n(e(t))))));case 8:return u(a(o(i(r(n(e(t)))))));case 9:return s(u(a(o(i(r(n(e(t))))))));default:{for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}}}var oo=function(t,e){var n=typeof t=="number"?function(r){return r.length>=t}:t;return function(){var r=Array.from(arguments);return n(arguments)?e.apply(this,r):function(i){return e.apply(void 0,lv([i],r,!1))}}},js=function(t){return t._tag==="Some"},Us={_tag:"None"},ks=function(t){return{_tag:"Some",value:t}},hv=function(t){return t.length>0},pv=[],vv=Object.prototype.hasOwnProperty;function yv(t){return function(e,n){return t.chain(e,function(r){return t.map(n(r),function(){return r})})}}var ce=function(t){return{equals:function(e,n){return e===n||t(e,n)}}},Pe=function(t){return ce(function(e,n){for(var r in t)if(!t[r].equals(e[r],n[r]))return!1;return!0})},Bs={equals:function(t,e){return t===e}};Bs.equals;var oe=Us,Re=ks;function Kr(t){return function(e){return t(e)?Re(e):oe}}var mv=function(t,e){return G(t,le(e))},gv=function(t,e){return G(t,Sv(e))},bv="Option",le=function(t){return function(e){return Ke(e)?oe:Re(t(e.value))}},Sv=function(t){return function(e){return Ke(e)||Ke(t)?oe:Re(e.value(t.value))}},Vs=oo(2,function(t,e){return Ke(t)?oe:e(t.value)}),Cv={URI:bv,map:mv,ap:gv,chain:Vs},je=function(t){return function(e){return Ke(e)?oe:t(e.value)?e:oe}},Ke=function(t){return t._tag==="None"},wv=function(t,e){return function(n){return Ke(n)?t():e(n.value)}},ao=wv,Tv=function(t){return function(e){return Ke(e)?t():e.value}},fn=Tv,Iv=oo(2,yv(Cv)),$t=function(t){return t==null?oe:Re(t)},Jr=ao(fv,Yn),gn=ao(Ps,Yn),Ev=Vs,xv=Iv,so={equals:function(t,e){return t===e}};so.equals;so.equals;var Av=pv,Dv=hv,Ov=function(t){return t.length===0},Fs=Dv,Nv=function(t){return function(e){if(Ov(e))return $v;for(var n=[],r=0;r<e.length;r++)n.push.apply(n,t(r,e[r]));return n}};function Gs(t){return function(e){for(var n=0;n<e.length;n++)if(t(e[n]))return ks(e[n]);return Us}}var _v=function(t,e,n){for(var r=[],i=Math.min(t.length,e.length),o=0;o<i;o++)r[o]=n(t[o],e[o]);return r};function Ls(t,e){return e===void 0?function(n){return Ls(n,t)}:_v(t,e,function(n,r){return[n,r]})}var zs=oo(2,function(t,e){return G(t,Nv(function(n,r){return e(r,n)}))}),Hs=zs(Yn),ye=function(t){return function(e){return e.map(function(n){return t(n)})}},Ft=function(t){return function(e){return e.filter(t)}},Mv=function(t){return function(e){for(var n=[],r=0;r<e.length;r++){var i=t(r,e[r]);js(i)&&n.push(i.value)}return n}},Ye=function(t){return Mv(function(e,n){return t(n)})},si=Ye(Yn),uo=function(t){return ce(function(e,n){return e.length===n.length&&e.every(function(r,i){return t.equals(r,n[i])})})},$v=Av;function qv(t){return function(e){return e.every(t)}}var Pv=zs,Ut={equals:function(t,e){return t===e}};Ut.equals;var Ws={equals:function(t,e){return t===e}};Ws.equals;function Ks(t){return function(e,n){if(n===void 0){var r=Ks(t);return function(o){return r(o,e)}}for(var i in e)if(!vv.call(n,i)||!t.equals(e[i],n[i]))return!1;return!0}}function Rv(t){var e=Ks(t);return ce(function(n,r){return e(n)(r)&&e(r)(n)})}function jv(t){return{equals(e,n){return e==null&&n==null?!0:e==null||n===null||n===void 0?!1:t.equals(e,n)}}}function Js(t){return{equals(e,n){const r=G($t(e),fn(()=>[])),i=G($t(n),fn(()=>[]));return uo(t).equals(r,i)}}}const bn=Pe({localId:Ut,componentPath:Js(Ut),sharedConfigurationModelId:jv(Ut)}),Uv=Pe({localId:Ut,configurationModelId:Ut}),kv=ce((t,e)=>O({x:t,y:e}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>Bv.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>Vv.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>Fv.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>Gv.equals(n.x,n.y)).otherwise(()=>!1)),Bv=Pe({type:Ut,attributeId:bn,state:Ut,choiceValueId:Ut}),Vv=Pe({type:Ut,attributeId:bn,state:Ut}),Fv=Pe({type:Ut,attributeId:bn,state:so}),Gv=Pe({type:Ut,attributeId:bn,state:Ws});var Xs=(t=>(t.whyIsNotSatisfied="why-is-not-satisfied",t.whyIsStateNotPossible="why-is-state-not-possible",t))(Xs||{}),Ys=(t=>(t.choiceValue="choice-value",t.component="component",t.boolean="boolean",t.numeric="numeric",t.configuration="configuration",t.attribute="attribute",t))(Ys||{}),qt=(t=>(t.Boolean="Boolean",t.Numeric="Numeric",t.Choice="Choice",t.Component="Component",t))(qt||{}),Xr=(t=>(t.Implicit="Implicit",t.Explicit="Explicit",t))(Xr||{});function Lv(t,e){return G(t.values,Ye(n=>G(n.decision,$t,je(r=>r.kind===e))))}function zv(t){return G(t.decision,$t,je(e=>e.kind===Xr.Explicit),Jr)}function Hv(t){return G(t.decision,$t,je(e=>e.kind===Xr.Explicit),Jr)}function Wv(t){return G(t.decision,$t,Jr)}const Qs=t=>t.type===qt.Boolean,Zs=t=>t.type===qt.Choice,tu=t=>t.type===qt.Numeric,eu=t=>t.type===qt.Component,Kv=Js(Ut);function Jv(t,e,n){var r;const i=((r=e.componentPath)==null?void 0:r.length)??0;return G(t,Ft(o=>{var a;const u=((a=o.id.componentPath)==null?void 0:a.length)??0;return n?i>u?!1:G(o.id.componentPath??[],Ls(e.componentPath??[]),qv(([s,l])=>s===l)):Kv.equals(o.id.componentPath,e.componentPath)}))}function Xv(t,e,n){return[]}function Yv(t){return G(t,Ft(e=>{const n=G(e.id.componentPath,$t,le(i=>i.length===0),fn(()=>!0)),r=G(e.id.sharedConfigurationModelId,$t,ao(()=>!0,()=>!1));return n&&r}))}function Qv(t,e){return G(nu(t),ye(n=>Lv(n,e)),Hs,Ye(n=>$t(n)))}function Zv(t,e){return G(iu(t),Ft(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===e}),ye(n=>zv(n)),Ye(n=>$t(n)))}function ty(t,e){return G(ou(t),Ft(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===e}),ye(n=>Hv(n)),Ye(n=>$t(n)))}function ey(t,e){return G(ru(t),Ft(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===e}),ye(n=>Wv(n)),Ye(n=>$t(n)))}function nu(t){return G(t.attributes,Ft(Zs))}function ru(t){return G(t.attributes,Ft(eu))}function iu(t){return G(t.attributes,Ft(tu))}function ou(t){return G(t.attributes,Ft(Qs))}function ny(t,e){return G(Qn(t,e),gn)}function ry(t,e){return G(au(t,e),gn)}function iy(t,e,n){return G(au(t,e),le(r=>r.values),Ev(Rs(Gs(r=>r.id===n))),gn)}function oy(t,e){return G(Qn(t,e),je(tu),gn)}function ay(t,e){return G(Qn(t,e),je(Qs),gn)}function sy(t,e){return G(Qn(t,e),je(eu),gn)}function Qn(t,e){return G(t.attributes,Gs(n=>bn.equals(n.id,e)))}function au(t,e){return G(Qn(t,e),je(Zs))}const Sn=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:Jv,filterAttributesOfRoot:Yv,filterAttributesOfShared:Xv,getAttribute:ny,getBooleanAttribute:ay,getBooleanAttributes:ou,getBooleanDecisions:ty,getChoiceAttribute:ry,getChoiceAttributes:nu,getChoiceDecisions:Qv,getChoiceValue:iy,getComponentAttribute:sy,getComponentAttributes:ru,getComponentDecisions:ey,getNumericAttribute:oy,getNumericAttributes:iu,getNumericDecisions:Zv},Symbol.toStringTag,{value:"Module"}));Xs.whyIsNotSatisfied,Ys.configuration;const ta=bn.equals;Uv.equals;kv.equals;function Mi(t){return ce((e,n)=>{const r=e==null,i=n==null;return r&&i||!r&&!i&&t.equals(e,n)})}const su=X.createContext(null),uu=X.createContext(null),cu=X.createContext(null),lu=X.createContext(null),co=()=>X.useContext(su),Cn=()=>X.useContext(lu),fu="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 lo(t){if(!t)throw new Error(fu)}function wn(t){if(!t)throw new Error(fu)}function Zn(){const t=co();return lo(t),X.useMemo(()=>({makeDecision:e=>t.makeDecision(e),setManyDecision:(e,n)=>t.setMany(e,n)}),[t])}var Yr=function(t){return function(e){return js(t(e))}};const uy=Yr(t=>t.type===qt.Choice?Re(t):oe),cy=Yr(t=>t.type===qt.Numeric?Re(t):oe),ly=Yr(t=>t.type===qt.Boolean?Re(t):oe),fy=Yr(t=>t.type===qt.Component?Re(t):oe);function Qr(t){return t.decision!=null&&t.decision.kind===Xr.Explicit}function du(t){return G(t.values,Ft(Qr),ye(e=>({type:qt.Choice,attributeId:t.id,choiceValueId:e.id,state:null})))}function dy(t){return G(t,Kr(Qr),le(()=>({type:qt.Numeric,attributeId:t.id,state:null})))}function hy(t){return G(t,Kr(Qr),le(()=>({type:qt.Boolean,attributeId:t.id,state:null})))}function py(t){return G(t,Kr(Qr),le(()=>({type:qt.Component,attributeId:t.id,state:null})))}function vy(t,e){return G(Sn.filterAttributesOfComponent(e,t,!0),n=>[G(n,Ft(uy),Pv(du)),G(n,Ft(cy),ye(dy),si),G(n,Ft(ly),ye(hy),si),G(n,Ft(fy),ye(py),si)],Hs)}function yy(t,e){const n=Cn();return wn(n),X.useMemo(()=>G($t(t),le(Rs(ye(r=>Sn.getAttribute(n,r)),e??!1?Yn:Ye($t))),fn(()=>n.attributes)),[t,n,e])}function my(t){const e=Cn(),{makeDecision:n,setManyDecision:r}=Zn();wn(e);const i=Sn.getChoiceAttribute(e,t),o=X.useMemo(()=>({makeDecision:(u,s)=>n({type:qt.Choice,attributeId:t,choiceValueId:u,state:s}),clearDecisions:G(i,$t,le(du),je(Fs),le(u=>()=>r(u,{type:"Default"})),fn(()=>()=>Promise.resolve()))}),[t,i,n,r]),a=X.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function gy(t){const e=Cn(),{makeDecision:n}=Zn();wn(e);const r=Sn.getNumericAttribute(e,t),i=X.useMemo(()=>({makeDecision:a=>n({type:qt.Numeric,attributeId:t,state:a})}),[t,n]),o=X.useMemo(()=>({...i,attribute:r}),[r,i]);if(r)return o}function by(t){const e=Cn(),{makeDecision:n}=Zn();wn(e);const r=Sn.getBooleanAttribute(e,t),i=X.useMemo(()=>({makeDecision:a=>n({type:qt.Boolean,attributeId:t,state:a})}),[t,n]),o=X.useMemo(()=>({...i,attribute:r}),[r,i]);if(r)return o}function Sy(t){const e=Cn(),{makeDecision:n,setManyDecision:r}=Zn();wn(e);const i=e.attributes,o=Sn.getComponentAttribute(e,t),a=X.useMemo(()=>({makeDecision:s=>n({type:qt.Component,attributeId:t,state:s}),clearSubtree:G(vy(t,i),Kr(Fs),le(s=>()=>r(s,{type:"Default"})),fn(()=>()=>Promise.resolve()))}),[t,n,i,r]),u=X.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return u}const Cy=ce((t,e)=>Rv(Ut).equals(t??{},e??{})),wy=Pe({attributeId:ce(ta),decisions:uo(ce(ta))}),Ty=ce((t,e)=>uo(wy).equals(t??[],e??[])),ui=Pe({configurationModelSource:ce((t,e)=>ah(t,e)),attributeRelations:Ty,usageRuleParameters:Cy}),Iy=Bs,ci=Mi(Iy),Ey=()=>eo({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:[Wt("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Wt("Entering ProcessChanges","SessionManagement:"),nn(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Wt("Entering DisposeSession","SessionManagement:"),nn(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Wt("Entering CreateSession","SessionManagement:"),nn(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Wt("Entering SessionCreationFailed","SessionManagement:"),nn(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Wt("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Wt("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Wt("Entering UpdateSession","SessionManagement:"),nn(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Wt("Entering SessionUpdateFailed","SessionManagement:"),nn(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Wt("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Wt("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Vt({desiredClient:(t,e)=>e.client}),saveDesiredSessionContext:Vt({desiredSessionContext:(t,e)=>e.sessionContext}),disposeOldSession:Vt((t,e)=>(t.session&&t.session.close().then(dv).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Vt((t,e)=>({session:e.data.session,actualClient:e.data.client})),setSessionCreationError:Vt((t,e)=>({sessionCreationError:e.data})),clearSessionCreationError:Vt({sessionCreationError:()=>null}),setSessionUpdateError:Vt((t,e)=>({sessionUpdateError:e.data})),clearSessionUpdateError:Vt({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Vt({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:t=>t.desiredClient.createSession(t.desiredSessionContext).then(e=>({session:e,client:t.desiredClient})).catch(e=>Promise.reject({type:e.type,client:t.desiredClient,sessionContext:t.desiredSessionContext})),updateSession:t=>t.session.setSessionContext(t.desiredSessionContext).catch(e=>Promise.reject({type:e.type,sessionContext:t.desiredSessionContext}))},guards:{shallDisposeSession:t=>t.session!=null&&(t.desiredSessionContext==null||t.desiredClient==null||!ci.equals(t.actualClient,t.desiredClient)),shallCreateSession:t=>t.session==null&&t.desiredClient!=null&&t.desiredSessionContext!=null,shallUpdateSession:t=>t.session!=null&&!ui.equals(t.session.getSessionContext(),t.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:t=>!ci.equals(t.desiredClient,t.sessionCreationError.client)||!Mi(ui).equals(t.desiredSessionContext,t.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:t=>!ci.equals(t.desiredClient,t.actualClient)||!Mi(ui).equals(t.desiredSessionContext,t.sessionUpdateError.sessionContext)}});function nn(t){const e=t===0,n=t===1;return Xp((r,i)=>{const o={isInitializing:(!r.hasEverSuccessfullyCreatedSession||e)&&r.sessionCreationError==null,errorType:r.sessionCreationError&&r.sessionCreationError.type},a={isUpdating:n&&r.sessionUpdateError==null,errorType:r.sessionUpdateError&&r.sessionUpdateError.type};return xs({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const xy=t=>e=>(e({type:"ConfigurationChanged",session:t,configuration:t.getConfiguration()}),t.setOnConfigurationChangedHandler(n=>{e({type:"ConfigurationChanged",session:t,configuration:n})}),()=>{t.setOnConfigurationChangedHandler(null)}),Ay=()=>eo({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[xs((t,e)=>e)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Wt("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(t,e)=>t.session!=null}]},Subscribe:{entry:[Wt("Entering Subscribe","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{target:"ProcessChanges",cond:(t,e)=>e.session==null||t.session!==e.session,actions:["saveSession"]}},invoke:{id:"configurationSubscriptionActor",src:(t,e)=>xy(t.session)}}}},{actions:{saveSession:Vt((t,e)=>({session:e.session}))}}),Dy=()=>{let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}},ea=()=>{const t=Dy();return{capsule:{promise:t.promise},resolve:t.resolve,reject:t.reject}},Oy=()=>eo({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:ea()},entry:[Vt({sessionManagementActor:()=>zo(Ey()),configurationSubscriptionManagementActor:()=>zo(Ay())})],exit:[Wo(t=>t.sessionManagementActor),Wo(t=>t.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[cr(t=>t.sessionManagementActor)]},ChangeSessionContext:{actions:[cr(t=>t.sessionManagementActor)]},RetrySessionCreation:{actions:[cr(t=>t.sessionManagementActor)]},RetrySessionUpdate:{actions:[cr(t=>t.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Vt((t,e)=>({session:e.session,sessionInitialization:e.sessionInitialization,sessionUpdating:e.sessionUpdating})),op(t=>({type:"ChangeSession",session:t.session}),{to:t=>t.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Vt((t,e)=>({configuration:{session:e.session,configuration:e.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Vt((t,e)=>{var n;const r=!((n=t.sessionInitialization)!=null&&n.isInitializing)&&t.session!=null&&t.configuration!=null&&t.configuration.session===t.session;return t.isReadyPromise&&r&&(t.isReadyPromise.resolve(),t.isReadyPromise.capsule.promise=null),{isReadyPromise:(()=>r?null:t.isReadyPromise!=null?t.isReadyPromise:ea())()}})}});function Ny(t){var e,n;const[r,i]=cv(Oy,{logger:(...s)=>console.log("ConfigurationManagement:",...s)});X.useEffect(()=>{i({type:"ChangeConfigurationClient",client:t.configuratorClient}),t.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.")},[t.configuratorClient]),X.useEffect(()=>{const s=G($t(t.sessionContext),xv(l=>$t(l.configurationModelSource)),Jr);i({type:"ChangeSessionContext",sessionContext:s}),s||console.warn("The session context is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass valid session context data.")},[t.sessionContext]);const o=X.useMemo(()=>{var s,l,f,h;return{isInitializing:((l=(s=r.context.isReadyPromise)==null?void 0:s.capsule)==null?void 0:l.promise)!=null,isInitializingPromise:(f=r.context.isReadyPromise)==null?void 0:f.capsule,error:((h=r.context.sessionInitialization)==null?void 0:h.errorType)&&{type:r.context.sessionInitialization.errorType,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=X.useMemo(()=>{var s,l;return{isUpdating:(s=r.context.sessionUpdating)==null?void 0:s.isUpdating,error:((l=r.context.sessionUpdating)==null?void 0:l.errorType)&&{type:r.context.sessionUpdating.errorType,retry:()=>i({type:"RetrySessionUpdate"})}}},[r.context.sessionUpdating]),u=((e=r.context.configuration)==null?void 0:e.session)===r.context.session?(n=r.context.configuration)==null?void 0:n.configuration:null;return{configurationInitialization:o,configurationUpdating:a,session:r.context.session,configuration:u}}function _y(t){const{configurationInitialization:e,configurationUpdating:n,session:r,configuration:i}=Ny({configuratorClient:t.configuratorClient,sessionContext:t});return Be.jsx(uu.Provider,{value:e,children:Be.jsx(cu.Provider,{value:n,children:Be.jsx(su.Provider,{value:r,children:Be.jsx(lu.Provider,{value:i,children:t.children})})})})}function hu(){return X.useContext(uu)}function My(){return X.useContext(cu)}function $y(t){const{children:e}=t,{isInitializingPromise:n}=hu();if(n!=null&&n.promise)throw n.promise;return Be.jsx(Be.Fragment,{children:e})}function qy(){const t=co();return lo(t),X.useMemo(()=>({}),[t])}function Py(){const t=co(),e=Cn();return lo(t),wn(e),X.useMemo(()=>({configuration:e,restoreConfiguration:n=>t.restoreConfiguration(n)}),[e,t])}const Ry=Object.freeze(Object.defineProperty({__proto__:null,Configuration:_y,ConfigurationSuspender:$y,useAttributes:yy,useBooleanAttribute:by,useChoiceAttribute:my,useComponentAttribute:Sy,useConfiguration:Py,useConfigurationInitialization:hu,useConfigurationUpdating:My,useDecision:Zn,useExplain:qy,useNumericAttribute:gy},Symbol.toStringTag,{value:"Module"}));function pu(t){return Be.jsxs("div",{children:["Hello World from ",t.name.toUpperCase()]})}po.addPropertyControls(pu,{name:{title:"Name",type:po.ControlType.String}});const jy=Object.freeze(Object.defineProperty({__proto__:null,HelloWorld:pu},Symbol.toStringTag,{value:"Module"}));exports.Configurator=Gd;exports.ConfiguratorFramer=jy;exports.ConfiguratorReact=Ry;
|
|
67
|
+
*/var Am;function nD(){return Am||(Am=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=KS();function n(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;function c(l,f,d,p,h){var v=o(null),x;v.current===null?(x={hasValue:!1,value:null},v.current=x):x=v.current;var E=s(function(){var b=!1,T,A,D=function(L){if(!b){b=!0,T=L;var B=p(L);if(h!==void 0&&x.hasValue){var K=x.value;if(h(K,B))return A=K,K}return A=B,B}var k=T,ie=A;if(r(k,L))return ie;var V=p(L);return h!==void 0&&h(ie,V)?ie:(T=L,A=V,V)},I=d===void 0?null:d,N=function(){return D(f())},_=I===null?void 0:function(){return D(I())};return[N,_]},[f,d,p,h]),y=E[0],S=E[1],w=i(l,y,S);return a(function(){x.hasValue=!0,x.value=w},[w]),u(w),w}Af.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Af}process.env.NODE_ENV==="production"?_d.exports=tD():_d.exports=nD();var rD=_d.exports,iD=O.useLayoutEffect;function $m(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var Vc=globalThis&&globalThis.__assign||function(){return Vc=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},Vc.apply(this,arguments)},oD=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},aD=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 sD(e,t){var n=$m(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=aD(O.useState(n),1),i=r[0];e!==i&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var o=t.context,a=t.guards,s=t.actions,u=t.activities,c=t.services,l=t.delays;t.state;var f=oD(t,["context","guards","actions","activities","services","delays","state"]),d=$m(function(){var p={context:o,guards:a,actions:s,activities:u,services:c,delays:l},h=n.withConfig(p,function(){return Vc(Vc({},n.context),o)});return DS(h,f)});return iD(function(){Object.assign(d.machine.options.actions,s),Object.assign(d.machine.options.guards,a),Object.assign(d.machine.options.activities,u),Object.assign(d.machine.options.services,c),Object.assign(d.machine.options.delays,l)},[s,a,u,c,l]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function uD(e,t,n){if(e.status===Ot.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var cD=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 lD(e){return e}function fD(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=cD(t,1),i=r[0],o=i===void 0?{}:i,a=sD(e,o),s=O.useCallback(function(){return a.status===Ot.NotStarted?o.state?tr.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return uD(a,f,d)},[a]),c=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),l=rD.useSyncExternalStoreWithSelector(c,s,s,lD,u);return O.useEffect(function(){var f=o.state;return a.start(f?tr.create(f):void 0),function(){a.stop(),a.status=Ot.NotStarted}},[]),[l,a.send,a]}const YS=O.createContext(null),XS=O.createContext(null),JS=O.createContext(null),QS=O.createContext(null),Ah=()=>O.useContext(YS),Ma=()=>O.useContext(QS),ZS="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 $h(e){if(!e)throw new Error(ZS)}function ja(e){if(!e)throw new Error(ZS)}function fu(){const e=Ah();return $h(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var dD=function(e){return e._tag==="Some"},jl=function(e){return function(t){return dD(e(t))}};const pD=jl(e=>e.type===Oe.Choice?je(e):ge),hD=jl(e=>e.type===Oe.Numeric?je(e):ge),vD=jl(e=>e.type===Oe.Boolean?je(e):ge),mD=jl(e=>e.type===Oe.Component?je(e):ge);function _l(e){return e.decision!=null&&e.decision.kind===$r.Explicit}function eC(e){return C(e.values,zt(_l),z(t=>({type:Oe.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function yD(e){return C(e,au(_l),ee(()=>({type:Oe.Numeric,attributeId:e.id,state:null})))}function gD(e){return C(e,au(_l),ee(()=>({type:Oe.Boolean,attributeId:e.id,state:null})))}function bD(e){return C(e,au(_l),ee(()=>({type:Oe.Component,attributeId:e.id,state:null})))}function SD(e,t){return C(ko.filterAttributesOfComponent(t,e,!0),n=>[C(n,zt(pD),qE(eC)),C(n,zt(hD),z(yD),Kn),C(n,zt(vD),z(gD),Kn),C(n,zt(mD),z(bD),Kn)],rh)}function tC(){const e=Ah();return $h(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 CD(e,t=!1){const n=Ma();return ja(n),O.useMemo(()=>C(Se(e),ee(Xn(z(r=>ko.getAttribute(n,r)),t?No(Se):ti)),ut(()=>n.attributes)),[e,n,t])}function wD(e){const t=Ma(),{makeDecision:n,setManyDecision:r}=fu(),i=ql(e,Ut.choiceValue);ja(t);const o=ko.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,c)=>n({type:Oe.Choice,attributeId:e,choiceValueId:u,state:c}),clearDecisions:C(o,Se,ee(eC),Ht(ou),ee(u=>()=>r(u,{type:"Default"})),ut(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function xD(e){const t=Ma(),{makeDecision:n}=fu(),r=ql(e,Ut.numeric);ja(t);const i=ko.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 ED(e){const t=Ma(),{makeDecision:n}=fu(),r=ql(e,Ut.boolean);ja(t);const i=ko.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 TD(e){const t=Ma(),{makeDecision:n,setManyDecision:r}=fu(),i=ql(e,Ut.component);ja(t);const o=t.attributes,a=ko.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:c=>n({type:Oe.Component,attributeId:e,state:c}),clearSubtree:C(SD(e,o),au(ou),ee(c=>()=>r(c,{type:"Default"})),ut(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function ql(e,t){const{explain:n,applySolution:r}=tC();return O.useMemo(()=>({explain:(i,o)=>{const a=ue(i.question).with(Cn.whyIsNotSatisfied,()=>Ut.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 Om=On(pS),ID=On(hS),AD=On((e,t)=>Ob(ft).equals(e??{},t??{})),$D=yn({attributeId:Om,decisions:qi(Om)}),OD=On((e,t)=>qi($D).equals(e??[],t??[])),DD=yn({type:ft}),ND=yn({type:ft}),PD=yn({type:ft,rules:qi(ID)}),RD=On((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:an.all},y:{type:an.all}},({x:n,y:r})=>DD.equals(n,r)).with({x:{type:an.none},y:{type:an.none}},({x:n,y:r})=>ND.equals(n,r)).with({x:{type:an.specific},y:{type:an.specific}},({x:n,y:r})=>PD.equals(n,r)).otherwise(()=>!1)),kD=yn({rules:su(RD)}),nC=yn({configurationModelSource:On((e,t)=>QO(e,t)),attributeRelations:OD,usageRuleParameters:AD,allowedInExplain:su(kD)}),qd=su(nC),MD=th,hc=su(MD),jD=()=>xh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{desiredClient:null,desiredSessionContext:null,actualClient:null,session:null,sessionCreationError:null,sessionUpdateError:null,hasEverSuccessfullyCreatedSession:!1},initial:"ProcessChanges",on:{ChangeConfigurationClient:{actions:["saveDesiredClient"]},ChangeSessionContext:{actions:["saveDesiredSessionContext"]}},exit:[Ln("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Ln("Entering ProcessChanges","SessionManagement:"),Uo(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Ln("Entering DisposeSession","SessionManagement:"),Uo(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Ln("Entering CreateSession","SessionManagement:"),Uo(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Ln("Entering SessionCreationFailed","SessionManagement:"),Uo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Ln("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Ln("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Ln("Entering UpdateSession","SessionManagement:"),Uo(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Ln("Entering SessionUpdateFailed","SessionManagement:"),Uo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Ln("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Ln("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Nn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Nn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Nn((e,t)=>(e.session&&e.session.close().then(qr).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Nn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Nn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Nn({sessionCreationError:()=>null}),setSessionUpdateError:Nn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Nn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Nn({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||!hc.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!nC.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!hc.equals(e.desiredClient,e.sessionCreationError.client)||!qd.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!hc.equals(e.desiredClient,e.actualClient)||!qd.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Uo(e){const t=e===0,n=e===1;return MO((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 NS({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const _D=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),qD=()=>xh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[NS((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Ln("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Ln("Entering Subscribe","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{target:"ProcessChanges",cond:(e,t)=>t.session==null||e.session!==t.session,actions:["saveSession"]}},invoke:{id:"configurationSubscriptionActor",src:(e,t)=>_D(e.session)}}}},{actions:{saveSession:Nn((e,t)=>({session:t.session}))}}),FD=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},Dm=()=>{const e=FD();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var LD=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]},Nm=function(e,t,n,r){return O.useEffect(e,LD(t,n,r))};const VD=()=>xh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:Dm()},entry:[Nn({sessionManagementActor:()=>ym(jD()),configurationSubscriptionManagementActor:()=>ym(qD())})],exit:[bm(e=>e.sessionManagementActor),bm(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[ju(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[ju(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[ju(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[ju(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Nn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),G$(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Nn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Nn((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:Dm())()}})}});function BD(e){var t,n;const[r,i]=fD(VD,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});Nm(()=>{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],Hv(hc)),Nm(()=>{const u=C(Se(e.sessionContext),ZE(c=>Se(c.configurationModelSource)),rr);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],Hv(qd));const o=O.useMemo(()=>{var u,c,l,f;return{isInitializing:((c=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:c.promise)!=null,isInitializingPromise:(l=r.context.isReadyPromise)==null?void 0:l.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.failureResult)&&{...r.context.sessionInitialization.failureResult,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,c;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((c=r.context.sessionUpdating)==null?void 0:c.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 UD(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=BD({configuratorClient:t,sessionContext:n});return $.jsx(XS.Provider,{value:r,children:$.jsx(JS.Provider,{value:i,children:$.jsx(YS.Provider,{value:o,children:$.jsx(QS.Provider,{value:a,children:e.children})})})})}function rC(){return O.useContext(XS)}function GD(){return O.useContext(JS)}function zD(e){const{children:t}=e,{isInitializingPromise:n}=rC();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function WD(){const e=Ah(),t=Ma();return $h(e),ja(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const HD=Object.freeze(Object.defineProperty({__proto__:null,Configuration:UD,ConfigurationSuspender:zD,useAttributes:CD,useBooleanAttribute:ED,useChoiceAttribute:wD,useComponentAttribute:TD,useConfiguration:WD,useConfigurationInitialization:rC,useConfigurationUpdating:GD,useDecision:fu,useExplain:tC,useNumericAttribute:xD},Symbol.toStringTag,{value:"Module"}));var KD=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))},YD=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},XD=function(e){var t=YD(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function Nr(e){return e}function _a(e){return function(){return e}}var JD=_a(!0),QD=_a(null),iC=_a(void 0),Lr=iC;function Jn(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return u(s(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function m(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return s(a(o(i(r(n(t(e)))))));case 9:return u(s(a(o(i(r(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var Pr=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,KD([i],r,!1))}}},ZD=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))},e2=function(e){return e._tag==="None"},Oh=function(e){return e._tag==="Some"},du={_tag:"None"},pu=function(e){return{_tag:"Some",value:e}},t2=function(e){return e._tag==="Left"},Fl=function(e){return{_tag:"Left",left:e}},Ll=function(e){return{_tag:"Right",right:e}},n2=function(e){return[e]},r2=function(e){return e.length>0},i2=function(e){return e[0]},o2=function(e){return e.slice(1)},a2=[],s2={},oC=Object.prototype.hasOwnProperty,u2=function(e){return ZD([e[0]],e.slice(1),!0)};function c2(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 l2(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 aC(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):aC(e,t-1,i)}}function f2(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 aC(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 d2(e){return function(t){for(var n=Object.keys(t),r=n.length,i=f2(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function p2(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function h2(e){var t=l2(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function sC(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var v2=function(e){return function(){return Promise.resolve().then(e)}};function m2(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var Vl=function(e,t){return m(e,uC(t))},Dh=function(e,t){return m(e,y2(t))},uC=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},y2=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)})}}},hu=function(e){return function(){return Promise.resolve(e)}},Nh=Pr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),vu="Task",Bl={URI:vu,map:Vl},Ph={URI:vu,of:hu},g2={URI:vu,map:Vl,ap:Dh},Rh={URI:vu,map:Vl,of:hu,ap:Dh,chain:Nh},b2=Nr,Pm=Nh,Bc={URI:vu,map:Vl,of:hu,ap:Dh,chain:Nh,fromIO:v2,fromTask:b2};function cC(e){return function(t){return function(n){return e.fromEither(e2(n)?Fl(t()):Ll(n.value))}}}function S2(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Ll(o):Fl(r(o)))})}}}var kh=Fl,Ul=Ll,lC=function(e,t){return m(e,w2(t))},C2=function(e,t){return m(e,T2(t))},Mh="Either",w2=function(e){return function(t){return Di(t)?t:Ul(e(t.right))}},x2={URI:Mh,map:lC},E2=function(e){return function(t){return Di(t)?t:Di(e)?e:Ul(t.right(e.right))}},T2=E2,I2={URI:Mh,map:lC,ap:C2},A2=function(e){return function(t){return Di(t)?kh(e(t.left)):t}},fC={URI:Mh,fromEither:Nr},$2=cC(fC),Di=t2,O2=function(e,t){return function(n){return Di(n)?e(n.left):t(n.right)}},to=O2;fC.fromEither;var D2=function(e){return Di(e)?Ul(e.left):kh(e.right)},Tn=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},gn=function(e){return Tn(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},Rm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Tn(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},jh={equals:function(e,t){return e===t}};jh.equals;var N2=function(e){return function(t,n){return t===n||e(t,n)===0}},qa=function(e){return{equals:N2(e),compare:function(t,n){return t===n?0:e(t,n)}}},Fs=function(e){return qa(function(t,n){return e.compare(n,t)})},Kr=function(e){return function(t){return qa(function(n,r){return t.compare(e(n),e(r))})}},P2=function(){return{concat:function(e,t){return qa(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},_h=function(){return{concat:P2().concat,empty:qa(function(){return 0})}},R2={equals:JD,compare:_a(0)},k2=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function M2(e,t){return e<t?-1:e>t?1:0}var j2={equals:jh.equals,compare:M2},_2=j2,q2=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}},F2=function(e){return{concat:k2(e)}},L2=function(e){return{concat:function(){return e}}},V2=q2,B2=L2(void 0),U2=F2,km=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))},G2=a2,dC=r2,z2=function(e,t){return e<0||e>=t.length},W2=function(e){return function(t){return km(km([],t,!0),[e],!1)}},H2=W2,K2=function(e,t,n){if(n[e]===t)return n;var r=u2(n);return r[e]=t,r},Y2=function(e){return function(t){if(t.length===1)return t;for(var n=[hC(t)],r=eN(t),i=function(u){n.every(function(c){return!e.equals(c,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},X2=function(e){if(dC(e)){var t=_h();return J2(e.reduce(t.concat,t.empty))}return Nr},pC=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);oC.call(n,a)?n[a].push(o):n[a]=[o]}return n}},J2=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},Q2=n2,Z2=i2,hC=Z2,eN=o2,Gl={equals:function(e,t){return e===t}},zl={equals:Gl.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};Gl.equals,zl.compare;globalThis&&globalThis.__spreadArray;var Uc=function(e){return e.length===0},Fa=dC,vC=H2,tN=function(e){return function(t){if(Uc(t))return Vh;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},qh=z2;function Fd(e,t){return t===void 0?function(n){return Fd(e,n)}:qh(e,t)?du:pu(t[e])}var nN=function(e){return function(t){return qh(e,t)?t:e===0?Vh:t.slice(0,e)}},mC=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return pu(n);return du}};function Zt(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return pu(t[n]);return du}}var rN=function(e,t){return function(n){return qh(e,n)?du:pu(cN(e,t(n[e]),n))}},Wl=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}};function Fh(e){return function(t,n){if(n===void 0){var r=Fh(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var sa=function(e){var t=Y2(e);return function(n){return Fa(n)?t(n):n}},iN=function(e){var t=X2(e);return function(n){return Fa(n)?t(n):n}},oN=function(e){return function(t){return Uc(t)?e:Uc(e)?t:t.concat(e)}},Pe=oN;function yC(e){var t=Fh(e);return function(n,r){if(r===void 0){var i=yC(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var aN=Q2,gC=Pr(2,function(e,t){return m(e,tN(function(n,r){return t(r,n)}))}),Lh=gC(Nr),G=function(e){return function(t){return t.map(function(n){return e(n)})}},Wt=function(e){return function(t){return t.filter(e)}},sN=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Oh(i)&&n.push(i.value)}return n}},Mo=function(e){return sN(function(t,n){return e(n)})},Yn=Mo(Nr),Ld=function(e,t){return uN(e,function(n,r,i){return t(r,i)})},uN=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}},Li=function(e){return Tn(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},cN=function(e,t,n){return Fa(n)?K2(e,t,n):n},Vd=function(e){return e.slice()},Mm=function(e){return Uc(e)?Vh:e.slice()},Vh=G2,lN=gC,fN=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}};function Xi(e){return Zt(e)}var vc=function(e){return function(t){return t.map(function(n){return e(n)})}},dN=Pr(2,function(e,t){return m(e,fN(function(n,r){return t(r,n)}))}),pN=dN(Nr),hN=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Oh(i)&&n.push(i.value)}return n}},ai=function(e){return hN(function(t,n){return e(n)})},vN=function(e){return function(t){return t.filter(e)}},bC=function(e){return function(t){return Jn(e,t)}},mN=function(e){return function(t){return function(n){return t(n)&&e(n)}}},me=du,Re=pu;function mu(e){return function(t){return e(t)?Re(t):me}}var SC=function(e,t){return m(e,Q(t))},CC=function(e,t){return m(e,yN(t))},wC="Option",Vi=function(e){return{equals:function(t,n){return t===n||(ar(t)?ar(n):ar(n)?!1:e.equals(t.value,n.value))}}},xC=function(e){return{equals:Vi(e).equals,compare:function(t,n){return t===n?0:yi(t)?yi(n)?e.compare(t.value,n.value):1:-1}}},Q=function(e){return function(t){return ar(t)?me:Re(e(t.value))}},Ci=Re,yN=function(e){return function(t){return ar(t)||ar(e)?me:Re(t.value(e.value))}},gN={URI:wC,map:SC,ap:CC,of:Ci},Bh=Pr(2,function(e,t){return ar(e)?me:t(e.value)}),bN={URI:wC,map:SC,ap:CC,chain:Bh},EC=Pr(2,function(e,t){return ar(e)?t():e}),Bd=EC,SN=Bh(Nr),_t=function(e){return function(t){return ar(t)?me:e(t.value)?t:me}},yi=Oh,ar=function(e){return e._tag==="None"},CN=function(e,t){return function(n){return ar(n)?e():t(n.value)}},Ni=CN,TC=Ni,wN=function(e){return function(t){return ar(t)?e():t.value}},nt=wN,Ud=SN,xN=Pr(2,sC(bN)),ye=function(e){return e==null?me:Re(e)},EN=function(e){try{return Re(e())}catch{return me}},TN=function(e){return function(t){return ar(t)?me:ye(e(t.value))}},Un=Ni(QD,Nr),Mt=Ni(iC,Nr),Mn=Bh,IN=xN,AN=h2(gN);function $N(e){return Jn(Ul,e.of)}function ON(e){return Jn(kh,e.of)}function DN(e){return p2(e,x2)}function NN(e){return c2(e,I2)}function PN(e){return function(t,n){return e.chain(t,function(r){return Di(r)?e.of(r):n(r.right)})}}function RN(e){return function(t,n){return e.map(t,A2(n))}}function kN(e){return function(t,n){return function(r){return e.map(r,to(t,n))}}}function MN(e){return function(t){return function(n){return e.chain(n,function(r){return Di(r)?t(r.left):e.of(r)})}}}function jN(e){return function(t){return e.map(t,D2)}}var _N=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(l){try{c(r.next(l))}catch(f){a(f)}}function u(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((r=r.apply(e,t||[])).next())})},qN=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},wi=ON(Ph),La=$N(Ph),FN=hu,LN=function(e){return uC($2(e))},Gc=kN(Bl),jm=function(e,t){return function(){return _N(void 0,void 0,void 0,function(){var n;return qN(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Ll)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Fl(t(n))];case 3:return[2]}})})}},IC=MN(Rh),_m=jN(Bl),AC=function(e,t){return m(e,Yt(t))},$C=function(e,t){return m(e,BN(t))},Yt=DN(Bl),VN=Pr(2,RN(Bl)),yr=VN,BN=NN(g2),OC=Pr(2,PN(Rh)),ua=La,Uh="TaskEither",UN={URI:Uh,map:AC,ap:$C,of:ua},DC={URI:Uh,map:AC,ap:$C,chain:OC},Gh={URI:Uh,fromEither:FN},GN=Pr(2,sC(DC)),zh=cC(Gh);Gh.fromEither;var zN=S2(Gh,DC),WN=ua(s2),vr=OC,HN=GN;function KN(e){return t=>m(t,Yt(n=>(e(n)(),n)))}const Ls=KN;function zc(e){return t=>m(t,_m,Ls(e),_m)}function YN(e){return t=>m(t,Ls(n=>()=>e(n)()),zc(n=>()=>e(n)()))}function XN(e){return t=>m(t,Q(n=>(e(n)(),n)))}const JN=XN;function QN(e){return Jn(Re,e.of)}function ZN(e){return _a(e.of(me))}function eP(e){var t=ZN(e);return function(n,r){return e.chain(n,Ni(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var tP=QN(Ph),nP=hu,rP=Pr(2,eP(Rh)),iP=rP,Wh=function(e){return V2(e)(e.empty)};B2.concat;var oP=XD,rt={equals:function(e,t){return e===t}},Vs={equals:rt.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},aP=function(e){return function(t){return Object.keys(t).sort(e.compare)}};function Hh(e){if(typeof e=="function")return Hh(Vs)(e);var t=aP(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 NC(e){return function(t,n){if(n===void 0){var r=NC(e);return function(o){return r(o,t)}}for(var i in t)if(!oC.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function PC(e){var t=NC(e);return Tn(function(n,r){return t(n)(r)&&t(r)(n)})}function sP(e){return Tn((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var Kh={equals:function(e,t){return e===t}},RC={equals:Kh.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};function uP(e){const t=parseFloat(e);return isNaN(t)?me:Re(t)}const kn=Symbol.for("@ts-pattern/matcher"),kC=Symbol.for("@ts-pattern/isVariadic"),Wc="@ts-pattern/anonymous-select-key",Gd=e=>!!(e&&typeof e=="object"),mc=e=>e&&!!e[kn],mn=(e,t,n)=>{if(mc(e)){const r=e[kn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(Gd(e)){if(!Gd(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];mc(s)&&s[kC]?o.push(s):o.length?i.push(s):r.push(s)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<r.length+i.length)return!1;const a=t.slice(0,r.length),s=i.length===0?[]:t.slice(-i.length),u=t.slice(r.length,i.length===0?1/0:-i.length);return r.every((c,l)=>mn(c,a[l],n))&&i.every((c,l)=>mn(c,s[l],n))&&(o.length===0||mn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>mn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||mc(o=i)&&o[kn]().matcherType==="optional")&&mn(i,t[r],n);var o})}return Object.is(t,e)},Hn=e=>{var t,n,r;return Gd(e)?mc(e)?(t=(n=(r=e[kn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?Bs(e,Hn):Bs(Object.values(e),Hn):[]},Bs=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function cP(...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 xn(e){return Object.assign(e,{optional:()=>Yh(e),and:t=>Et(e,t),or:t=>MC(e,t),select:t=>t===void 0?Us(e):Us(t,e)})}function zd(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[kC]:!0})}}))(e),{optional:()=>zd(Yh(e)),select:t=>zd(t===void 0?Us(e):Us(t,e))})}function Yh(e){return xn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Hn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:mn(e,t,r),selections:n}},getSelectionKeys:()=>Hn(e),matcherType:"optional"})})}const lP=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},fP=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function Et(...e){return xn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>mn(i,t,r)),selections:n}},getSelectionKeys:()=>Bs(e,Hn),matcherType:"and"})})}function MC(...e){return xn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return Bs(e,Hn).forEach(i=>r(i,void 0)),{matched:e.some(i=>mn(i,t,r)),selections:n}},getSelectionKeys:()=>Bs(e,Hn),matcherType:"or"})})}function Xe(e){return{[kn]:()=>({match:t=>({matched:!!e(t)})})}}function Us(...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 xn({[kn]:()=>({match:r=>{let i={[t??Wc]:r};return{matched:n===void 0||mn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??Wc].concat(n===void 0?[]:Hn(n))})})}function xr(e){return typeof e=="number"}function no(e){return typeof e=="string"}function li(e){return typeof e=="bigint"}const jC=xn(Xe(function(e){return!0})),dP=jC,ro=e=>Object.assign(xn(e),{startsWith:t=>{return ro(Et(e,(n=t,Xe(r=>no(r)&&r.startsWith(n)))));var n},endsWith:t=>{return ro(Et(e,(n=t,Xe(r=>no(r)&&r.endsWith(n)))));var n},minLength:t=>ro(Et(e,(n=>Xe(r=>no(r)&&r.length>=n))(t))),maxLength:t=>ro(Et(e,(n=>Xe(r=>no(r)&&r.length<=n))(t))),includes:t=>{return ro(Et(e,(n=t,Xe(r=>no(r)&&r.includes(n)))));var n},regex:t=>{return ro(Et(e,(n=t,Xe(r=>no(r)&&!!r.match(n)))));var n}}),pP=ro(Xe(no)),Er=e=>Object.assign(xn(e),{between:(t,n)=>Er(Et(e,((r,i)=>Xe(o=>xr(o)&&r<=o&&i>=o))(t,n))),lt:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r<n))(t))),gt:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r>n))(t))),lte:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r<=n))(t))),gte:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r>=n))(t))),int:()=>Er(Et(e,Xe(t=>xr(t)&&Number.isInteger(t)))),finite:()=>Er(Et(e,Xe(t=>xr(t)&&Number.isFinite(t)))),positive:()=>Er(Et(e,Xe(t=>xr(t)&&t>0))),negative:()=>Er(Et(e,Xe(t=>xr(t)&&t<0)))}),hP=Er(Xe(xr)),fi=e=>Object.assign(xn(e),{between:(t,n)=>fi(Et(e,((r,i)=>Xe(o=>li(o)&&r<=o&&i>=o))(t,n))),lt:t=>fi(Et(e,(n=>Xe(r=>li(r)&&r<n))(t))),gt:t=>fi(Et(e,(n=>Xe(r=>li(r)&&r>n))(t))),lte:t=>fi(Et(e,(n=>Xe(r=>li(r)&&r<=n))(t))),gte:t=>fi(Et(e,(n=>Xe(r=>li(r)&&r>=n))(t))),positive:()=>fi(Et(e,Xe(t=>li(t)&&t>0))),negative:()=>fi(Et(e,Xe(t=>li(t)&&t<0)))}),vP=fi(Xe(li)),mP=xn(Xe(function(e){return typeof e=="boolean"})),yP=xn(Xe(function(e){return typeof e=="symbol"})),gP=xn(Xe(function(e){return e==null}));var Le={__proto__:null,matcher:kn,optional:Yh,array:function(...e){return zd({[kn]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const n=e[0];let r={};if(t.length===0)return Hn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>mn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Hn(e[0])})})},set:function(...e){return xn({[kn]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};if(e.length===0)return{matched:!0};const r=(o,a)=>{n[o]=(n[o]||[]).concat([a])},i=e[0];return{matched:lP(t,o=>mn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Hn(e[0])})})},map:function(...e){return xn({[kn]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};const r=(s,u)=>{n[s]=(n[s]||[]).concat([u])};if(e.length===0)return{matched:!0};var i;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(i=e[0])==null?void 0:i.toString()}`);const[o,a]=e;return{matched:fP(t,(s,u)=>{const c=mn(o,u,r),l=mn(a,s,r);return c&&l}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Hn(e[0]),...Hn(e[1])]})})},intersection:Et,union:MC,not:function(e){return xn({[kn]:()=>({match:t=>({matched:!mn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Xe,select:Us,any:jC,_:dP,string:pP,number:hP,bigint:vP,boolean:mP,symbol:yP,nullish:gP,instanceOf:function(e){return xn(Xe(function(t){return n=>n instanceof t}(e)))},shape:function(e){return xn(Xe(cP(e)))}};const Wd={matched:!1,value:void 0};function H(e){return new bP(e,Wd)}let bP=class Hd{constructor(t,n){this.input=void 0,this.state=void 0,this.input=t,this.state=n}with(...t){if(this.state.matched)return this;const n=t[t.length-1],r=[t[0]];let i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&r.push(...t.slice(1,t.length-1));let o=!1,a={};const s=(c,l)=>{o=!0,a[c]=l},u=!r.some(c=>mn(c,this.input,s))||i&&!i(this.input)?Wd:{matched:!0,value:n(o?Wc in a?a[Wc]:a:this.input,this.input)};return new Hd(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new Hd(this.input,r?{matched:!0,value:n(this.input,this.input)}:Wd)}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 SP=Object.getOwnPropertyNames,CP=Object.getOwnPropertySymbols,wP=Object.prototype.hasOwnProperty;function qm(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function qu(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 Fm(e){return SP(e).concat(CP(e))}var _C=Object.hasOwn||function(e,t){return wP.call(e,t)};function Va(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var qC="_owner",Lm=Object.getOwnPropertyDescriptor,Vm=Object.keys;function xP(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 EP(e,t){return Va(e.getTime(),t.getTime())}function Bm(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var u=t.entries(),c=!1,l=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],p=f[1],h=s.value,v=h[0],x=h[1];!c&&!r[l]&&(c=n.equals(d,v,o,l,e,t,n)&&n.equals(p,x,d,v,e,t,n))&&(r[l]=!0),l++}if(!c)return!1;o++}return!0}function TP(e,t,n){var r=Vm(e),i=r.length;if(Vm(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===qC&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!_C(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function ns(e,t,n){var r=Fm(e),i=r.length;if(Fm(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===qC&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!_C(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=Lm(e,o),s=Lm(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function IP(e,t){return Va(e.valueOf(),t.valueOf())}function AP(e,t){return e.source===t.source&&e.flags===t.flags}function Um(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var s=t.values(),u=!1,c=0;(a=s.next())&&!a.done;)!u&&!r[c]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[c]=!0),c++;if(!u)return!1}return!0}function $P(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 OP="[object Arguments]",DP="[object Boolean]",NP="[object Date]",PP="[object Map]",RP="[object Number]",kP="[object Object]",MP="[object RegExp]",jP="[object Set]",_P="[object String]",qP=Array.isArray,Gm=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,zm=Object.assign,FP=Object.prototype.toString.call.bind(Object.prototype.toString);function LP(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,u=e.areTypedArraysEqual;return function(l,f,d){if(l===f)return!0;if(l==null||f==null||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;var p=l.constructor;if(p!==f.constructor)return!1;if(p===Object)return i(l,f,d);if(qP(l))return t(l,f,d);if(Gm!=null&&Gm(l))return u(l,f,d);if(p===Date)return n(l,f,d);if(p===RegExp)return a(l,f,d);if(p===Map)return r(l,f,d);if(p===Set)return s(l,f,d);var h=FP(l);return h===NP?n(l,f,d):h===MP?a(l,f,d):h===PP?r(l,f,d):h===jP?s(l,f,d):h===kP?typeof l.then!="function"&&typeof f.then!="function"&&i(l,f,d):h===OP?i(l,f,d):h===DP||h===RP||h===_P?o(l,f,d):!1}}function VP(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?ns:xP,areDatesEqual:EP,areMapsEqual:r?qm(Bm,ns):Bm,areObjectsEqual:r?ns:TP,arePrimitiveWrappersEqual:IP,areRegExpsEqual:AP,areSetsEqual:r?qm(Um,ns):Um,areTypedArraysEqual:r?ns:$P};if(n&&(i=zm({},i,n(i))),t){var o=qu(i.areArraysEqual),a=qu(i.areMapsEqual),s=qu(i.areObjectsEqual),u=qu(i.areSetsEqual);i=zm({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function BP(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function UP(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,c){var l=r(),f=l.cache,d=f===void 0?t?new WeakMap:void 0:f,p=l.meta;return n(u,c,{cache:d,equals:i,meta:p,strict:o})};if(t)return function(u,c){return n(u,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(u,c){return n(u,c,a)}}var GP=Bi();Bi({strict:!0});Bi({circular:!0});Bi({circular:!0,strict:!0});Bi({createInternalComparator:function(){return Va}});Bi({strict:!0,createInternalComparator:function(){return Va}});Bi({circular:!0,createInternalComparator:function(){return Va}});Bi({circular:!0,createInternalComparator:function(){return Va},strict:!0});function Bi(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,s=VP(e),u=LP(s),c=r?r(u):BP(u);return UP({circular:n,comparator:u,createState:i,equals:c,strict:a})}function zP(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 WP(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),zP(e)}var xs=m,HP=oP(AN({concat:U2(_2).concat,empty:0}))();function KP(e){return function(t){return t.iterNumber>=e?me:Re(0)}}function YP(e,t){return function(n){return xs(n,t,Q(function(r){return Math.min(e,r)}))}}function XP(e){return function(t){return Re(e*Math.pow(2,t.iterNumber))}}var JP={iterNumber:0,cumulativeDelay:0,previousDelay:me};function QP(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+nt(function(){return 0})(n),previousDelay:n}}function ZP(e,t){var n=QP(e,t);return xs(n.previousDelay,TC(function(){return Bc.of(n)},function(r){return m2(r)(Bc.of(n))}))}function Go(e,t,n){var r=function(i){return xs(i,t,Pm(function(o){return n(o)?xs(ZP(e,i),Pm(function(a){return xs(a.previousDelay,TC(function(){return Bc.of(o)},function(){return r(a)}))})):Bc.of(o)}))};return r(JP)}var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.isGuid=Xh=Gs.guid=void 0;var eR=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+=Wm()+"-";for(o+=r,o+=t;o.length<i;)o+=Wm();return o.substring(0,i)},Xh=Gs.guid=eR,Wm=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},tR=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=nR(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"};Gs.isGuid=tR;var nR=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function Jh(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function Hl(e){return{equals(t,n){const r=m(ye(t),nt(()=>[])),i=m(ye(n),nt(()=>[]));return Li(e).equals(r,i)}}}const Ba=gn({localId:rt,componentPath:Hl(rt),sharedConfigurationModelId:Jh(rt)}),FC=gn({localId:rt,configurationModelId:rt}),rR=Tn((e,t)=>H({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>iR.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>oR.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>aR.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>sR.equals(n.x,n.y)).otherwise(()=>!1)),iR=gn({type:rt,attributeId:Ba,state:rt,choiceValueId:rt}),oR=gn({type:rt,attributeId:Ba,state:rt}),aR=gn({type:rt,attributeId:Ba,state:Gl}),sR=gn({type:rt,attributeId:Ba,state:Kh});var qt=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(qt||{}),Qe=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Qe||{}),yc=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(yc||{}),pn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(pn||{}),Pi=(e=>(e.Channel="Channel",e.Package="Package",e))(Pi||{}),W=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(W||{}),bt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(bt||{}),st=(e=>(e.Included="Included",e.Excluded="Excluded",e))(st||{}),$e=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))($e||{}),xi=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(xi||{}),ba=(e=>(e.Always="Always",e.Optional="Optional",e))(ba||{}),vt=(e=>(e.Unknown="Unknown",e.CommunicationError="Local.LowLevelCommunicationError",e.ServiceError="ServiceError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationUnauthorized="ConfigurationUnauthorized",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(vt||{}),LC=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(LC||{});const uR={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};let cR=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:Pi.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Pi.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return m(t,ye,Q(Jn(G(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),Mt)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:m([...t.decisions],vc(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return m(ye(t),Mt)}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:pn.all},()=>({type:"AllowedRulesAll"})).with({type:pn.none},()=>({type:"AllowedRulesNone"})).with({type:pn.specific},n=>({type:"AllowedRulesSpecific",rules:m(n.rules,G(this.mapToGlobalConstraintId),Vd)})).with(Le.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function lR(e){return t=>zN(n=>n!=null,e)(t)}function fR(){return La(Lr())}var zn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(zn||{}),fo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(fo||{}),hn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(hn||{}),po=(e=>(e.all="all",e.none="none",e.specific="specific",e))(po||{});const Sn=gn({localId:rt,componentPath:Hl(rt),sharedConfigurationModel:Jh(rt)}),dR=Vi(Li(gn({attributeId:Sn,decisions:Hl(Sn)}))),pR=Vi(Tn((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})=>Li(FC).equals(n.rules,r.rules)).otherwise(()=>!1))),hR=Vi(gn({rules:pR})),vR=gn({configurationModelSource:Tn((e,t)=>GP(e,t)),decisionsToRespect:dR,usageRuleParameters:PC(rt),allowedInExplain:hR});var zs=(e=>(e.Channel="Channel",e.Package="Package",e))(zs||{}),lt=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(lt||{}),Te=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Te||{}),Jt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Jt||{}),Pt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Pt||{}),So=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(So||{}),Co=(e=>(e.Always="Always",e.Optional="Optional",e))(Co||{});const mR={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:Vi(rt).equals(e.state,t.state)},yR={equals(e,t){return Vi(Gl).equals(e.value,t.value)}},gR={equals(e,t){return Vi(Kh).equals(e.value,t.value)}},bR={equals(e,t){return Vi(rt).equals(e.state,t.state)}},SR={equals(e,t){return Sn.equals(e.attributeId,t.attributeId)?H({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>gR.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>yR.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>bR.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>mR.equals(r.x,r.y)).otherwise(()=>!1):!1}},CR=Li(SR),wR={equals:(e,t)=>CR.equals(e.decisions,t.decisions)&&xR.equals(e.mode,t.mode)},xR={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 Kd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(Kd||{}),va=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(va||{}),we=(e=>(e.ServiceError="ServiceError",e.Unknown="Unknown",e.CommunicationError="CommunicationError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(we||{}),Qh=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Qh||{});function ER(e,t){console.log(`--------------------------------------------------------------------------------
|
|
68
|
+
-- ${t??""}
|
|
69
|
+
--------------------------------------------------------------------------------
|
|
70
|
+
${JSON.stringify(e,null,2)}`)}var Es=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(Es||{}),VC=(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))(VC||{});const TR=e=>Object.values(VC).includes(e),IR=e=>TR(e)?Re(e):me;function AR(e){const t=n=>H(n).with("ConfigurationModelNotFound",()=>({type:we.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:we.DecisionsToRespectInvalid})).with(Le.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:we.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:we.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:we.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:we.ConfigurationConflict,reason:Qh.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:we.ConfigurationConflict})).with(Le.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:we.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:we.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:we.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:we.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:we.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:we.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:we.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:we.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return m(e.type,IR,Q(t))}const $R=e=>Object.values(Es).includes(e),OR=e=>$R(e)?Re(e):me;function DR(e){return m(e,OR,Q(n=>H(n).with("Generic::LocalClientError",()=>({type:we.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:we.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:we.CommunicationError})).with("Generic::Unauthorized",()=>({type:we.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:we.Unknown})).exhaustive()))}function Vr(e,t){ER(e,t);const n=e.type;return m(me,Bd(()=>AR(e)),Bd(()=>DR(n)),nt(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:we.Unknown})))}let NR=class{constructor(t,n,r,i){this.engineApiClient=t,this.contractToRestMapper=n,this.restToDomainMapper=r,this.options=i}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t);return m(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),yr(r=>Vr(r,"ClientSideSessionLifetimeHandler - create")),vr(r=>this.restToDomainMapper.mapToSessionId(r)),lR(()=>({type:we.ConfigurationUnauthenticated})))}close(t){return m(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),yr(n=>Vr(n,"ClientSideSessionLifetimeHandler - close")),Yt(()=>Lr()))}};var BC=(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))(BC||{});function jr(e,t,n){const r=m(Array.isArray(e)?e:[e],WP);return m(jm(()=>fetch(r,t),i=>({type:"error"})),vr(i=>m(jm(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),IC(i=>i.status===401?wi({type:Es.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?La({response:i,data:{}}):i.type==="error"?wi({type:Es.LowLevelCommunicationError}):wi({type:Es.UnhandledResponseStatus})),vr(i=>m(n(i),zh(()=>i.data))))}function Yd(e,t){return jr(e,t,n=>{if(n.response.status===200)return Ci(n.data);if(n.response.status===409){const r=n.data;return H(r).with({type:"ConfigurationModelInvalid"},i=>Ci(r)).with({type:"ConfigurationModelNotFeasible"},i=>Ci(r)).otherwise(()=>me)}return me})}let PR=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 Yd([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 Yd([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 jr([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?Re(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 jr([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?Re(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 jr([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?Re(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 jr([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?Re(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 jr([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?Re(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 jr([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?Re(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 jr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?Re({}):me)}};var wo=(e=>(e.Included="Included",e.Excluded="Excluded",e))(wo||{}),Xd=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Xd||{}),Jd=(e=>(e.Always="Always",e.Optional="Optional",e))(Jd||{}),Ws=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Ws||{}),Gr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Gr||{}),Fn=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(Fn||{}),Qd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(Qd||{}),Zd=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(Zd||{}),ps=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(ps||{});const _n=gn({localId:rt,componentPath:Hl(rt),sharedConfigurationModelId:Jh(rt)});let UC=class{mapToDecisions(t){return{}}mapToSessionId(t){return H(t).with({sessionId:Le.string},n=>La(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=m(n.constraintExplanations,G(i=>this.mapToConstraintExplanation(i)));return wi({type:we.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>wi({type:we.ConfigurationModelInvalid})).otherwise(()=>wi({type:we.Unknown}))}mapToExplainAnswer(t,n){const r=H(n).with({question:zn.whyIsStateNotPossible,subject:hn.boolean},a=>[{type:Te.Boolean,attributeId:a.attributeId,value:Re(a.state)}]).with({question:zn.whyIsStateNotPossible,subject:hn.numeric},a=>[{type:Te.Numeric,attributeId:a.attributeId,value:Re(a.state)}]).with({question:zn.whyIsStateNotPossible,subject:hn.component},a=>[{type:Te.Component,attributeId:a.attributeId,state:Re(a.state)}]).with({question:zn.whyIsStateNotPossible,subject:hn.choiceValue},a=>[{type:Te.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:Re(a.state)}]).otherwise(()=>[]),i=m(t.decisionExplanations,G(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=m(t.constraintExplanations,G(a=>this.mapToConstraintExplanation(a)));return H(n).with({answerType:fo.decisions},()=>({decisionExplanations:i})).with({answerType:fo.constraints},()=>({constraintExplanations:o})).with({answerType:fo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:we.ConfigurationSetManyConflict,decisionExplanations:m(t.decisionExplanations,G(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:m(t.constraintExplanations,G(o=>this.mapToConstraintExplanation(o)))}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModel(t,n){const r=this.mapToAttributes(t,n);return{isSatisfied:n.isConfigurationSatisfied??!1,attributes:r}}mapToBooleanDecision(t){return{type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:ye(t.state)}}mapToNumericDecision(t){return{type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:ye(t.state)}}mapToComponentDecision(t){return{type:Te.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToDecisionState(t.state)}}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModel:t.sharedConfigurationModelId,componentPath:t.componentPath??[]}}mapToChoiceValueDecision(t){return m(this.mapToDecisionState(t.state),Q(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:m(t.causedByRules,G(n=>this.mapToRuleConstraint(n))),causedByCardinalities:m(t.causedByCardinalities,G(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:va.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:va.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=m(t.booleanDecisions??[],G(a=>({type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),r=m(t.numericDecisions??[],G(a=>({type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),i=m(t.componentDecisions??[],G(a=>({type:Te.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:m(ye(a.state),Q(s=>this.mapToDecisionState(s)),Ud)}))),o=m(t.choiceDecisions??[],G(a=>({type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:m(ye(a.state),Q(s=>this.mapToDecisionState(s)),Ud)})));return m([],Pe(n),Pe(r),Pe(i),Pe(o))}mapToDecisionExplanation(t,n,r){const i=m(t.causedByBooleanDecisions,G(h=>this.mapToCausedByBooleanDecision(h))),o=m(t.causedByNumericDecisions,G(h=>this.mapToCausedByNumericDecision(h))),a=m(t.causedByComponentDecisions,G(h=>this.mapToCausedByComponentDecision(h))),s=m(t.causedByChoiceDecisions,G(h=>this.mapToCausedByChoiceValueDecision(h))),u=m(i,G(h=>({type:Te.Boolean,attributeId:h.attributeId,value:me}))),c=m(o,G(h=>({type:Te.Numeric,attributeId:h.attributeId,value:me}))),l=m(a,G(h=>({type:Te.Component,attributeId:h.attributeId,state:me}))),f=m(s,G(h=>({type:Te.ChoiceValue,attributeId:h.attributeId,choiceValueId:h.choiceValueId,state:me}))),d=m([],Pe(u),Pe(c),Pe(l),Pe(f)),p=yC(Tn((h,v)=>{const x=Sn.equals(h.attributeId,v.attributeId);return H({a:h,b:v}).with({a:{type:Te.ChoiceValue},b:{type:Te.ChoiceValue}},E=>x&&E.a.choiceValueId===E.b.choiceValueId).otherwise(()=>x)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:m([],Pe(d),Pe(p)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return H(t).with(Qd.NotAvailable,()=>Kd.NotAvailable).with(Qd.StateNotPossible,()=>Kd.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:Te.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToAttributes(t,n){function r(d){return m(n.canAttributeContributeToConfigurationSatisfaction,Zt(p=>_n.equals(p,d)),yi)}const i=m([],Pe(m(t.choiceValueDecisions,G(d=>d.attributeId))),Pe(m(n.choiceConsequences,G(d=>d.attributeId))),sa(_n)),o=m(i,G(d=>{const p=m(t.choiceValueDecisions??[],vN(v=>_n.equals(v.attributeId,d))),h=m(n.choiceConsequences??[],Xi(v=>_n.equals(v.attributeId,d)));return m(h,Q(v=>this.mapToChoiceAttributes(v,p,r(d))))}),Yn),a=m([],Pe(m(t.numericDecisions,G(d=>d.attributeId))),Pe(m(n.numericConsequences,G(d=>d.attributeId))),sa(_n)),s=m(a,G(d=>{const p=m(t.numericDecisions??[],Xi(v=>_n.equals(v.attributeId,d))),h=m(n.numericConsequences??[],Xi(v=>_n.equals(v.attributeId,d)));return m(h,Q(v=>this.mapToNumericAttribute(v,p,r(d))))}),Yn),u=m([],Pe(m(t.booleanDecisions,G(d=>d.attributeId))),Pe(m(n.booleanConsequences,G(d=>d.attributeId))),sa(_n)),c=m(u,G(d=>{const p=m(t.booleanDecisions??[],Xi(v=>_n.equals(v.attributeId,d))),h=m(n.booleanConsequences??[],Xi(v=>_n.equals(v.attributeId,d)));return m(h,Q(v=>this.mapToBooleanAttribute(v,p,r(d))))}),Yn),l=m([],Pe(m(t.componentDecisions,G(d=>d.attributeId))),Pe(m(n.componentConsequences,G(d=>d.attributeId))),sa(_n)),f=m(l,G(d=>{const p=m(t.componentDecisions??[],Xi(v=>_n.equals(v.attributeId,d))),h=m(n.componentConsequences??[],Xi(v=>_n.equals(v.attributeId,d)));return m(h,Q(v=>this.mapToComponentAttribute(v,p,r(d))))}),Yn);return m([],Pe(o),Pe(f),Pe(s),Pe(c))}mapToComponentAttribute(t,n,r){return{type:lt.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:m(t.possibleDecisionStates,vc(i=>this.mapToPossibleDecisionState(i))),decision:m(n,Mn(i=>m(this.mapToDecisionState(i.state),Q(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:m(t.selection,ye,Q(i=>this.mapToSelection(i)),Mt),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=m(t.values,vc(o=>{const a=m(n,Zt(s=>s.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:lt.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(t,n,r){return{type:lt.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:m(n,Mn(i=>m(i.state,ye,Q(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(t,n,r){return{type:lt.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,range:{min:t.range.min,max:t.range.max},selection:this.mapToSelection(t.selection),decimalPlaces:t.decimalPlaces,decision:m(n,Mn(i=>m(i.state,ye,Q(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=m(t.possibleDecisionStates,vc(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:m(n,Mn(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return H(t).with(Ws.Implicit,()=>Pt.Implicit).with(Ws.Explicit,()=>Pt.Explicit).exhaustive()}mapToDecisionState(t){return H(t).with(Gr.Included,()=>Re(Jt.Included)).with(Gr.Excluded,()=>Re(Jt.Excluded)).with(Gr.Undefined,()=>me).exhaustive()}mapToPossibleDecisionState(t){return H(t).with(wo.Included,()=>Jt.Included).with(wo.Excluded,()=>Jt.Excluded).exhaustive()}mapToSelection(t){return H(t).with(Xd.Mandatory,()=>So.Mandatory).with(Xd.Optional,()=>So.Optional).exhaustive()}mapToInclusion(t){return H(t).with(Jd.Always,()=>Co.Always).with(Jd.Optional,()=>Co.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},RR=class{constructor(t,n){this.restToDomainMapper=new UC,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=Yd(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return m(r,yr(i=>Vr(i,"ServerSideSessionLifetimeHandler - create")),vr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return m(jr(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===BC.NoContent?Re({}):me),yr(n=>Vr(n,"ServerSideSessionLifetimeHandler - close")),Yt(Lr))}};const GC={whyIsNotSatisfied:{configuration:{question:qt.whyIsNotSatisfied,subject:Qe.configuration},attribute:e=>({question:qt.whyIsNotSatisfied,subject:Qe.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:qt.whyIsStateNotPossible,subject:Qe.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:qt.whyIsStateNotPossible,subject:Qe.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:qt.whyIsStateNotPossible,subject:Qe.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:qt.whyIsStateNotPossible,subject:Qe.component,attributeId:e,state:t})})}};let kR=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=me}setOnConfigurationChangedHandler(t){const n=m(t,ye,Q(r=>i=>{const o=this.domainToContractMapper.mapToConfiguration(i);r(o)}));this.inner.setOnConfigurationChangedHandler(n)}getConfiguration(){const t=this.inner.getConfiguration();return this.domainToContractMapper.mapToConfiguration(t)}getSessionContext(){const t=this.inner.getSessionContext();return this.domainToContractMapper.mapToSessionContext(t)}async setSessionContext(t){const n=this.contractToDomainMapper.mapToSessionContext(t);return await m(this.inner.setSessionContext(n),Yt(Lr),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await m(this.inner.restoreConfiguration(n),Yt(Lr),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await m(this.inner.makeDecision(n),Yt(Lr),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await m(this.inner.setMany(r,i),Yt(Lr),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await m(this.inner.applySolution(n),Yt(Lr),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(GC):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await m(this.inner.explain(i),Yt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await m(this.inner.close(),yr(t=>this.domainToContractMapper.mapToFailureResult(t)),Gc(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Jn(yr(t=>this.domainToContractMapper.mapToFailureResult(t)),Gc(t=>Promise.reject(t),t=>Promise.resolve(t)))}},MR=class{mapToExplainQuestion(t,n){const r={answerType:H(n).with("decisions",()=>fo.decisions).with("constraints",()=>fo.constraints).with("full",()=>fo.all).exhaustive()};return H(t).with({question:qt.whyIsNotSatisfied,subject:Qe.configuration},i=>({...r,question:zn.whyIsNotSatisfied,subject:hn.configuration})).with({question:qt.whyIsNotSatisfied,subject:Qe.attribute},i=>({...r,question:zn.whyIsNotSatisfied,subject:hn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:qt.whyIsStateNotPossible,subject:Qe.choiceValue},i=>({...r,question:zn.whyIsStateNotPossible,subject:hn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:qt.whyIsStateNotPossible,subject:Qe.component},i=>({...r,question:zn.whyIsStateNotPossible,subject:hn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:qt.whyIsStateNotPossible,subject:Qe.numeric},i=>({...r,question:zn.whyIsStateNotPossible,subject:hn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:qt.whyIsStateNotPossible,subject:Qe.boolean},i=>({...r,question:zn.whyIsStateNotPossible,subject:hn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:m(t.attributes,G(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return m(t,G(n=>this.mapToAttributeDecision(n)))}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),decisionsToRespect:this.mapToDecisionsToRespect(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToAttributeDecision(t){return H(t).with({type:W.Choice,choiceValueId:Le.string},n=>({type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:W.Numeric},n=>({type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:W.Boolean},n=>({type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:W.Component},n=>({type:Te.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(ye(n.state),Mn(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return m(ye(t),Q(n=>m(n,G(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:m(r.decisions,G(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:Pi.Package},n=>({type:zs.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Pi.Channel},n=>({type:zs.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:m(t.decisions,G(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return H(t).with({type:W.Boolean},n=>({type:lt.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:m(n.decision,ye,Q(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.Numeric},n=>({type:lt.Numeric,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,range:{min:n.range.min,max:n.range.max},decimalPlaces:n.decimalPlaces,selection:this.mapToSelection(n.selection),decision:m(n.decision,ye,Q(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.Choice},n=>({type:lt.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:m(n.values,G(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.Component},n=>({type:lt.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:m(n.decision,ye,Mn(r=>m(this.mapToDecisionStateOption(r.state),Q(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:m(n.possibleDecisionStates,G(r=>this.mapToDecisionStateOption(r)),Yn),selection:m(n.selection,ye,Q(r=>this.mapToSelection(r)),Mt),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:m(t.possibleDecisionStates,G(n=>this.mapToDecisionStateOption(n)),Yn)}}mapToChoiceValueDecision(t){return m(t.decision,ye,Mn(n=>m(this.mapToDecisionStateOption(n.state),Q(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return H(t).with($e.Implicit,()=>Pt.Implicit).with($e.Explicit,()=>Pt.Explicit).exhaustive()}mapToSelection(t){return H(t).with(xi.Mandatory,()=>So.Mandatory).with(xi.Optional,()=>So.Optional).exhaustive()}mapToInclusion(t){return H(t).with(ba.Always,()=>Co.Always).with(ba.Optional,()=>Co.Optional).exhaustive()}mapToDecisionState(t){return H(t).with(Le.union(bt.Included,st.Included),()=>Jt.Included).with(Le.union(bt.Excluded,st.Excluded),()=>Jt.Excluded).exhaustive()}mapToDecisionStateOption(t){return m(ye(t),Q(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return m(t,ye,Q(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return m(t,ye,Q(n=>H(n).returnType().with({type:pn.all},()=>({type:po.all})).with({type:pn.none},()=>({type:po.none})).with({type:pn.specific},r=>({type:po.specific,rules:m(r.rules,G(this.mapToGlobalConstraintId))})).exhaustive()))}},zC=class{mapToExplainAnswer(t){const n=H(t).with({decisionExplanations:Le.array(Le.any)},i=>m(i.decisionExplanations,G(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=H(t).with({constraintExplanations:Le.array(Le.any)},i=>m(i.constraintExplanations,G(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:m(t.causedByCardinalities,G(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:m(t.causedByRules,G(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=m(t.causedByChoiceDecisions,G(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=m(t.causedByComponentDecisions,G(a=>this.mapToCausedByComponentAttributeDecision(a))),i=m(t.causedByNumericDecisions,G(a=>this.mapToCausedByNumericAttributeDecision(a))),o=m(t.causedByBooleanDecisions,G(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:m([],Pe(n),Pe(r),Pe(i),Pe(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:m(t.decisions,G(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return 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:we.ConfigurationConflict},n=>({type:vt.ConfigurationConflict,reason:H(n.reason).with(Qh.NumericDecisionOutOfRange,()=>LC.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:we.ConfigurationApplicationError},()=>({type:vt.ConfigurationApplicationError})).with({type:we.ConfigurationUnauthenticated},()=>({type:vt.ConfigurationUnauthenticated})).with({type:we.ConfigurationModelNotFound},()=>({type:vt.ConfigurationModelNotFound})).with({type:we.ConfigurationTimeout},()=>({type:vt.ConfigurationTimeout})).with({type:we.ConfigurationAttributeNotFound},()=>({type:vt.ConfigurationAttributeNotFound})).with({type:we.ConfigurationChoiceValueNotFound},()=>({type:vt.ConfigurationChoiceValueNotFound})).with({type:we.ConfigurationSolutionNotAvailable},()=>({type:vt.ConfigurationSolutionNotAvailable})).with({type:we.ConfigurationRejectedDecisionsConflict},n=>{const r=m(n.rejectedDecisions,G(i=>this.mapToExplicitDecision(i)));return uR.createConfigurationRejectedDecisionsConflict(r)}).with({type:we.DecisionsToRespectInvalid},()=>({type:vt.DecisionsToRespectInvalid})).with({type:we.ServiceError},()=>({type:vt.ServiceError})).with({type:we.CommunicationError},()=>({type:vt.CommunicationError})).with({type:we.Unknown},()=>({type:vt.Unknown})).with({type:we.ConfigurationModelInvalid},()=>({type:vt.ConfigurationModelInvalid})).with({type:we.ConfigurationInitializationFailure},()=>({type:vt.ConfigurationInitializationFailure})).with({type:we.ConfigurationModelNotFeasible},n=>({type:vt.ConfigurationModelNotFeasible,constraintExplanations:m(n.constraintExplanations,G(r=>this.mapToConstraintExplanation(r)))})).with({type:we.ConfigurationSetManyConflict},n=>({type:vt.ConfigurationSetManyConflict,decisionExplanations:m(n.decisionExplanations,G(r=>this.mapToDecisionExplanation(r))),constraintExplanations:m(n.constraintExplanations,G(r=>this.mapToConstraintExplanation(r)))})).with({type:we.SpecifiedDeploymentForbidden},n=>({type:vt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:m(t.attributes,G(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return m(t,Q(Jn(G(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:m(n.decisions,G(r=>this.mapToGlobalAttributeId(r)))})))),Un)}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:zs.Package},n=>({type:Pi.Package,configurationModelPackage:n.configurationModelPackage})).with({type:zs.Channel},n=>({type:Pi.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return H(t).with({type:Te.ChoiceValue},n=>({type:W.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.state,Q(r=>this.mapToChoiceValueDecisionState(r)),Mt),choiceValueId:n.choiceValueId})).with({type:Te.Component},n=>({type:W.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.state,Q(r=>this.mapToComponentDecisionState(r)),Mt)})).with({type:Te.Numeric},n=>({type:W.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,Mt)})).with({type:Te.Boolean},n=>({type:W.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,Mt)})).exhaustive()}mapToCardinality(t){return H(t).with(va.Cardinality,()=>yc.Cardinality).with(va.Component,()=>yc.Component).with(va.Rule,()=>yc.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return H(t).with({type:Te.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:Te.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:Te.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:Te.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:W.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:W.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:W.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:W.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return H(t).with(So.Mandatory,()=>xi.Mandatory).with(So.Optional,()=>xi.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return H(t).with({type:lt.Boolean},r=>({...n,type:W.Boolean,decision:m(r.decision,Q(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Un),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:lt.Numeric},r=>({...n,type:W.Numeric,decision:m(r.decision,Q(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Un),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:lt.Choice},r=>({...n,type:W.Choice,cardinality:r.cardinality,values:m(r.values,G(i=>{const o=m(i.decision,Q(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),Un);return{id:i.choiceValueId,possibleDecisionStates:m(i.possibleDecisionStates,G(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:lt.Component},r=>({...n,type:W.Component,decision:m(r.decision,Q(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),Un),possibleDecisionStates:m(r.possibleDecisionStates,G(i=>this.mapToComponentDecisionState(i))),selection:m(r.selection,ye,Q(i=>this.mapToSelection(i)),Mt),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return H(t).with(Co.Always,()=>ba.Always).with(Co.Optional,()=>ba.Optional).exhaustive()}mapToComponentDecisionState(t){return H(t).with(Jt.Included,()=>st.Included).with(Jt.Excluded,()=>st.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return H(t).with(Jt.Included,()=>bt.Included).with(Jt.Excluded,()=>bt.Excluded).exhaustive()}mapToDecisionKind(t){return H(t).with(Pt.Explicit,()=>$e.Explicit).with(Pt.Implicit,()=>$e.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return m(t,Q(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),Un)}mapToAllowedRulesInExplain(t){return m(t,Q(n=>H(n).returnType().with({type:po.all},()=>({type:pn.all})).with({type:po.none},()=>({type:pn.none})).with({type:po.specific},r=>({type:pn.specific,rules:m(r.rules,G(this.mapToGlobalConstraintId))})).exhaustive()),Un)}},jR=class{constructor(t,n){this.contractToDomainMapper=new MR,this.domainToContractMapper=new zC,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await m(this.sessionHandler.recreate(n),Yt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new kR(i,this.contractToDomainMapper,this.domainToContractMapper)}),Gc(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 WC(e){return e.possibleDecisionStates.some(t=>t===bt.Included)}function _R(e){return!WC(e)}function qR(e){return H(e).with({type:W.Choice},t=>t.cardinality.lowerBound>0).with({type:W.Boolean},t=>t.selection===xi.Mandatory).with({type:W.Numeric},t=>t.selection===xi.Mandatory).with({type:W.Component},t=>t.inclusion===ba.Optional&&t.selection===xi.Mandatory).exhaustive()}function FR(e){return H(e).with({type:W.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function LR(e){return m(e.values,Wt(WC))}function VR(e){return m(e.values,Wt(_R))}function HC(e,t){return m(e.values,Mo(n=>m(n.decision,ye,_t(r=>r.kind===t))))}function KC(e){return m(e.values,Wt(t=>m(t.decision,ye,Q(n=>n.state===bt.Included),nt(()=>!1))))}const BR=KC;function YC(e){return m(e.decision,ye,_t(t=>t.kind===$e.Explicit),Un)}function XC(e){return m(e.decision,ye,_t(t=>t.kind===$e.Explicit),Un)}function UR(e,t){return e.possibleDecisionStates.some(n=>n===t)}function JC(e){return m(e.decision,ye,Un)}function QC(e){return ZC(e,st.Included)}function GR(e){return!QC(e)}function ZC(e,t){return e.possibleDecisionStates.some(n=>n===t)}const An=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:LR,getBlockedChoiceValues:VR,getBooleanDecision:XC,getChoiceDecisions:HC,getComponentDecision:JC,getIncludedChoiceValues:KC,getNumericDecision:YC,getSelectedChoiceValues:BR,isBooleanValuePossible:UR,isComponentAllowed:QC,isComponentBlocked:GR,isComponentStatePossible:ZC,isMandatory:qR,isMultiSelect:FR},Symbol.toStringTag,{value:"Module"})),e0=e=>e.type===W.Boolean,t0=e=>e.type===W.Choice,n0=e=>e.type===W.Numeric,r0=e=>e.type===W.Component,zR=sP(rt),Hm=Li(rt);function i0(e,t){const n=a=>zR.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return m(n,mN(t?a=>Hm.equals(m(a.componentPath??[],nN(r)),e.componentPath):a=>Hm.equals(a.componentPath??[],e.componentPath)))}function WR(e,t,n){const r=m(i0({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:m(t.componentPath??[],vC(t.localId))},n),bC(i=>i.id));return m(e,Wt(r))}function HR(e,t,n){const r=m(i0({sharedConfigurationModelId:t,componentPath:[]},n),bC(i=>i.id));return m(e,Wt(r))}function KR(e){return m(e,Wt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function YR(e,t){return m(o0(e),G(n=>HC(n,t)),Lh,Mo(n=>ye(n)))}function XR(e,t){return m(s0(e),Wt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>YC(n)),Mo(n=>ye(n)))}function JR(e,t){return m(u0(e),Wt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>XC(n)),Mo(n=>ye(n)))}function QR(e,t){return m(a0(e),Wt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>JC(n)),Mo(n=>ye(n)))}function o0(e){return m(e.attributes,Wt(t0))}function a0(e){return m(e.attributes,Wt(r0))}function s0(e){return m(e.attributes,Wt(n0))}function u0(e){return m(e.attributes,Wt(e0))}function ZR(e,t){return m(yu(e,t),Mt)}function ek(e,t){return m(c0(e,t),Mt)}function tk(e,t,n){return m(c0(e,t),Q(r=>r.values),Mn(Jn(Zt(r=>r.id===n))),Mt)}function nk(e,t){return m(yu(e,t),_t(n0),Mt)}function rk(e,t){return m(yu(e,t),_t(e0),Mt)}function ik(e,t){return m(yu(e,t),_t(r0),Mt)}function yu(e,t){return m(e.attributes,Zt(n=>Ba.equals(n.id,t)))}function c0(e,t){return m(yu(e,t),_t(t0))}const Ua=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:WR,filterAttributesOfRoot:KR,filterAttributesOfShared:HR,getAttribute:ZR,getBooleanAttribute:rk,getBooleanAttributes:u0,getBooleanDecisions:JR,getChoiceAttribute:ek,getChoiceAttributes:o0,getChoiceDecisions:YR,getChoiceValue:tk,getComponentAttribute:ik,getComponentAttributes:a0,getComponentDecisions:QR,getNumericAttribute:nk,getNumericAttributes:s0,getNumericDecisions:XR},Symbol.toStringTag,{value:"Module"})),ok="https://spc.cloud.ceventis.de/api/engine",ak={hcaEngineBaseUrl:ok};function sk(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??ak.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function rs(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const l0=e=>t=>n=>m(n,mC(r=>e.equals(r,t)),Q(r=>m(n,rN(r,i=>t))),Ud,nt(()=>m(n,Pe(aN(t))))),Fu=l0({equals:(e,t)=>Sn.equals(e.attributeId,t.attributeId)}),uk=l0({equals:(e,t)=>e.choiceValueId===t.choiceValueId});class ck{constructor(t){this.restToDomainMapper=t}updateConfigurationSession(t,n){const r=this.updateConfiguration(t.configuration,n);return{...t,configuration:r}}updateConfiguration(t,n){var r,i,o,a,s,u,c,l,f,d;const p=m(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],G(this.restToDomainMapper.mapToGlobalAttributeId)),h=I=>Fh(Sn)(I,p),v=m(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=m(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=m(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),y=m(((s=n.consequences)==null?void 0:s.componentConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),S=m(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),w=m(((c=n.consequences)==null?void 0:c.numericConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=m(((l=n.affectedDecisions)==null?void 0:l.booleanDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=m(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=m([],Pe(m(b,G(I=>I.attributeId))),Pe(m(T,G(I=>I.attributeId))),Pe(m(S,G(I=>I.attributeId))),Pe(m(w,G(I=>I.attributeId))),Pe(m(v,G(I=>I.attributeId))),Pe(m(x,G(I=>I.attributeId))),Pe(m(E,G(I=>I.attributeId))),Pe(m(y,G(I=>I.attributeId))),sa(Sn)),D=m(A,Ld(t.attributes,(I,N)=>{const _=t.attributes.find(L=>Sn.equals(L.attributeId,N));return H(_).with({type:lt.Choice},(L,B)=>{const K=this.mergeChoice(B,m(x,Zt(k=>Sn.equals(k.attributeId,N)),Q(k=>k.payload)),m(v,Wt(k=>Sn.equals(k.attributeId,N)),G(k=>k.payload)));return Fu(K)(I)}).with({type:lt.Numeric},(L,B)=>{const K=this.mergeNumeric(B,m(w,Zt(k=>Sn.equals(k.attributeId,N)),Q(k=>k.payload)),m(S,Zt(k=>Sn.equals(k.attributeId,N)),Q(k=>k.payload)));return Fu(K)(I)}).with({type:lt.Boolean},(L,B)=>{const K=this.mergeBoolean(B,m(T,Zt(k=>Sn.equals(k.attributeId,N)),Q(k=>k.payload)),m(b,Zt(k=>Sn.equals(k.attributeId,N)),Q(k=>k.payload)));return Fu(K)(I)}).with({type:lt.Component},(L,B)=>{const K=this.mergeComponent(B,m(y,Zt(k=>Sn.equals(k.attributeId,N)),Q(k=>k.payload)),m(E,Zt(k=>Sn.equals(k.attributeId,N)),Q(k=>k.payload)));return Fu(K)(I)}).exhaustive()}),G(I=>{const N=h(I.attributeId);return I.canContributeToConfigurationSatisfaction!=N?{...I,canContributeToConfigurationSatisfaction:N}:I}));return{...t,isSatisfied:m((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,ye,nt(()=>t.isSatisfied)),attributes:D}}mergeChoice(t,n,r){const i=m(n,Q(u=>u.values??[]),nt(()=>[])),o=m(r),a=m([],Pe(m(i,G(u=>u.choiceValueId))),Pe(m(o,G(u=>u.choiceValueId))),G(rs),sa(rt)),s=m(a,Ld(t.values,(u,c)=>{const l=m(i,Zt(h=>h.choiceValueId===c)),f=m(o,Zt(h=>h.choiceValueId===c)),d=m(t.values.find(h=>h.choiceValueId===c),ye),p=this.mergeChoiceValue(c,d,l,f);return uk(p)(u)}));return{...t,isSatisfied:m(n,Q(u=>rs(u.isSatisfied)),nt(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=m(i,Q(s=>({state:this.toDecisionState(rs(s.state)),kind:this.toDecisionKind(rs(s.kind))})),nt(()=>({state:m(n,Mn(s=>m(s.decision,Q(u=>u.state)))),kind:m(n,Mn(s=>m(s.decision,Q(u=>u.kind))),nt(()=>Pt.Explicit))}))),a=m(r,Q(s=>m(Mm(s.possibleDecisionStates??[]),G(u=>this.toPossibleDecisionState(u)),Yn)),nt(()=>m(n,Q(s=>s.possibleDecisionStates??[]),nt(()=>[]))));return{choiceValueId:t,decision:m(o.state,Q(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=m(r,Q(a=>{const s=this.toDecisionState(rs(a.state));return m(s,Q(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),nt(()=>m(t.decision,Q(a=>({state:a.state,kind:a.kind}))))),o=m(n,Q(a=>m(Mm(a.possibleDecisionStates??[]),G(s=>this.toPossibleDecisionState(s)),Yn)),nt(()=>t.possibleDecisionStates));return{...t,isSatisfied:m(n,Q(a=>a.isSatisfied),nt(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:m(n,Mn(i=>ye(i.isSatisfied)),nt(()=>t.isSatisfied)),decision:m(r,Ni(()=>t.decision,i=>m(i.state,ye,Q(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:m(n,Mn(i=>ye(i.isSatisfied)),nt(()=>t.isSatisfied)),decision:m(r,Ni(()=>t.decision,i=>m(i.state,ye,Q(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:m(n,Q(i=>i.possibleDecisionStates),nt(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return H(t).with(wo.Included,()=>Re(Jt.Included)).with(wo.Excluded,()=>Re(Jt.Excluded)).otherwise(()=>me)}toDecisionState(t){return H(t).with(Gr.Included,()=>Re(Jt.Included)).with(Gr.Excluded,()=>Re(Jt.Excluded)).otherwise(()=>me)}toDecisionKind(t){return H(t).with(Ws.Implicit,()=>Pt.Implicit).with(Ws.Explicit,()=>Pt.Explicit).exhaustive()}}class lk{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return H(t).with({type:Te.ChoiceValue},n=>({type:Fn.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Te.Component},n=>({type:Fn.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Te.Numeric},n=>({type:Fn.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,Mt)})).with({type:Te.Boolean},n=>({type:Fn.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:m(n.value,Mt)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=m([...t],ai(u=>u.type!==Te.Boolean?me:Re({type:Fn.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:m(u.value,Mt)}))),o=m([...t],ai(u=>u.type!==Te.Numeric?me:Re({type:Fn.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:m(u.value,Mt)}))),a=m([...t],ai(u=>u.type!==Te.ChoiceValue?me:Re({type:Fn.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=m([...t],ai(u=>u.type!==Te.Component?me:Re({type:Fn.Component,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:this.mapToDecisionState(u.state)})));return{mode:r,choiceDecisions:a,numericDecisions:o,booleanDecisions:i,componentDecisions:s}}mapToExplicitDecisionsInner(t){const n=m([...t],ai(a=>a.type!==lt.Boolean?me:m(a.decision,_t(s=>s.kind===Pt.Explicit),Q(()=>this.mapToExplicitBooleanDecision(a))))),r=m([...t],ai(a=>a.type!==lt.Numeric?me:m(a.decision,_t(s=>s.kind===Pt.Explicit),Q(()=>this.mapToExplicitNumericDecision(a))))),i=m([...t],ai(a=>a.type!==lt.Component?me:m(a.decision,_t(s=>s.kind===Pt.Explicit),Q(()=>this.mapToExplicitComponentDecision(a))))),o=m([...t],ai(a=>a.type!==lt.Choice?me:m(this.mapToExplicitChoiceDecisions(a),mu(s=>m(s,Fa)))),pN);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:m(t.componentPath,ye,Q(Vd),Un),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:H(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:Le.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:Fn.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:m(t.decision,Q(n=>n.state),Mt)}}mapToExplicitNumericDecision(t){return{type:Fn.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:m(t.decision,Q(n=>n.state),Mt)}}mapToExplicitComponentDecision(t){return{type:Fn.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(m(t.decision,Q(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return m(r.decision,Q(i=>i.kind===Pt.Explicit),nt(()=>!1))}return m(t.values,Wt(n),G(r=>({type:Fn.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(m(r.decision,Q(i=>i.state)))})),Vd)}mapToDecisionState(t){return m(t,Q(n=>H(n).with(Jt.Included,()=>Gr.Included).with(Jt.Excluded,()=>Gr.Excluded).exhaustive()),nt(()=>Gr.Undefined))}mapToPossibleDecisionState(t){return H(t).with(Jt.Included,()=>wo.Included).with(Jt.Excluded,()=>wo.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return H(t).with({subject:hn.attribute},n=>({type:Zd.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:hn.configuration},()=>({type:Zd.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return H(t).with({subject:hn.boolean},n=>({type:ps.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.numeric},n=>({type:ps.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.component},n=>({type:ps.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:hn.choiceValue},n=>({type:ps.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}}let fk=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return m(t.configuration.attributes,Zt(n=>H(n).with({type:lt.Boolean},r=>m(r.decision,_t(i=>i.kind===Pt.Explicit),yi)).with({type:lt.Numeric},r=>m(r.decision,_t(i=>i.kind===Pt.Explicit),yi)).with({type:lt.Choice},r=>m(r.values,Zt(i=>m(i.decision,Q(o=>o.kind===Pt.Explicit),nt(()=>!1))),yi)).with({type:lt.Component},r=>m(r.decision,_t(i=>i.kind===Pt.Explicit),yi)).exhaustive()),Ni(()=>!1,()=>!0))},getExplicitDecisions(t){return m(t.configuration.attributes,G(n=>H(n).with({type:lt.Boolean},r=>m(r.decision,_t(i=>i.kind===Pt.Explicit),Q(i=>({type:Te.Boolean,attributeId:r.attributeId,value:ye(i.state)})),Q(i=>[i]))).with({type:lt.Numeric},r=>m(r.decision,_t(i=>i.kind===Pt.Explicit),Q(i=>({type:Te.Numeric,attributeId:r.attributeId,value:ye(i.state)})),Q(i=>[i]))).with({type:lt.Choice},r=>m(r.values,G(i=>m(i.decision,_t(o=>o.kind===Pt.Explicit),Q(o=>({type:Te.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:ye(o.state)})))),Yn,Ci)).with({type:lt.Component},r=>m(r.decision,_t(i=>i.kind===Pt.Explicit),Q(i=>({type:Te.Component,attributeId:r.attributeId,state:ye(i.state)})),Q(i=>[i]))).exhaustive()),Yn,Lh)}}}};class dk{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 fk}close(t){return this.sessionHandler.close(t)}recreate(t){return this.initializeInner(t,!1)}reinitialize(t){return this.initializeInner(t,!0)}makeDecision(t,n){const r=this.domainToRestMapper.mapToExplicitDecision(t);return this.withSession(n,(i,o)=>m(this.engineApiClient.makeDecision(i,r),yr(Vr),Yt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=H(t).with({question:zn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:zn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return m(i,yr(Vr),Yt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return m(a,vr(s=>{var u,c,l,f;return m([],Pe(m(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],G(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Pe(m(((c=s.rejectedDecisions)==null?void 0:c.numericDecisions)??[],G(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Pe(m(((l=s.rejectedDecisions)==null?void 0:l.componentDecisions)??[],G(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Pe(m(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],G(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),ua(this.domainUpdater.updateConfigurationSession(o,s))}))})}replaceDecisions(t,n){const r=this.interpreter.configurationSession.getExplicitDecisions(n),i=this.setManyInner(r,{type:"DropExistingDecisions",conflictHandling:{type:"Automatic"}},t);return m(i,Yt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return m(o,yr(Vr),vr(a=>{const s={rejectedDecisions:{booleanDecisions:Le.array(Le.any)}},u={decisionExplanations:Le.array(Le.any)};return H(a).with(s,c=>La(c)).with(u,c=>wi(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(c,i,n))).otherwise(()=>wi({type:we.Unknown}))}))}explainWhyStateNotPossible(t,n){const r=this.domainToRestMapper.mapToWhyStateNotPossibleRequest(t);return this.engineApiClient.getWhyStateNotPossible(n,r)}explainWhyNotSatisfied(t,n){const r=this.domainToRestMapper.mapToWhyNotSatisfiedRequest(t);return this.engineApiClient.getWhyNotSatisfied(n,r)}withSession(t,n){return m(ua(t),vr(r=>m(r.sessionId,Ni(()=>this.initializeInner(r,!1),()=>ua(r)))),vr(r=>m(r.sessionId,zh(()=>({type:we.ConfigurationUnauthenticated})),vr(i=>n(i,r)))))}initializeInner(t,n){return m(WN,()=>m(t.sessionId,nP,iP(s=>n?tP(s):m(this.sessionHandler.close(s),Gc(()=>me,()=>me)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return m(s,LN(()=>({type:we.ConfigurationUnauthenticated})),IC(()=>this.sessionHandler.create(u)))},s=>m(s,HN(u=>m(Ci(t),_t(this.interpreter.configurationSession.hasExplicitDecisions),Q(c=>this.replaceDecisions(u,c)),nt(()=>ua({}))))),s=>m(s,vr(u=>{const c=this.determineConsequences(u),l=this.determineDecisions(u),f=d2(UN)({consequences:c,decisions:l});return m(f,Yt(({decisions:d,consequences:p})=>this.restToDomainMapper.mapToConfigurationModel(d,p)),Yt(d=>({sessionId:Ci(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return m(this.engineApiClient.getDecisions(t),yr(Vr))}determineConsequences(t){return m(this.engineApiClient.getConsequence(t),yr(Vr))}}let pk=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 m(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return m(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:me}}restoreConfiguration(t){return m(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return m(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return m(this.configurationSession.sessionId,Q(t=>this.sessionHandler.close(t)),Q(Jn(Yt(t=>{this.configurationSession={...this.configurationSession,sessionId:me}}))),nt(_a(fR())))}applySolution(t){return m(this.configurationSession.solutions,Zt(n=>wR.equals(n,t)),zh(()=>({type:we.ConfigurationSolutionNotAvailable})),Yt(n=>n.decisions),vr(n=>this.setMany(n,t.mode)))}setMany(t,n){return m(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),zc(r=>()=>{const i=H(r).with({decisionExplanations:Le.array(Le.any)},o=>Re(o.decisionExplanations)).otherwise(()=>me);this.configurationSession={...this.configurationSession,solutions:m(i,Q(Jn(G(o=>o.solution))),nt(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=H(t).with({decisionExplanations:Le.array(Le.any)},r=>r.decisionExplanations).otherwise(()=>[]);return m(n,G(r=>r.solution))}invalidateAvailableSolutions(){return YN(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return zc(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Ls(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Jn(Ls(t=>()=>{this.configurationSession=t,m(this.onConfigurationChangedHandler,JN(n=>()=>n(this.configurationSession.configuration)))}),Yt(t=>t.configuration),this.invalidateAvailableSolutions())}};class hk{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=YP(r,HP.concat(XP(i),KP(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Go(this.policy,n,r=>m(r,to(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Go(this.policy,n,r=>m(r,to(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Go(this.policy,n,r=>m(r,to(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Go(this.policy,n,r=>m(r,to(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Go(this.policy,n,r=>m(r,to(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Go(this.policy,r,i=>m(i,to(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:we.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:we.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}}class vk{constructor(){this.queue=[],this.operating=me}push(t){const n=new mk(t);return this.queue.push(n),this.operating=m(this.operating,nt(()=>this.start()),Ci),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=m(t,G(r=>r.argument),Ld(me,(r,i)=>this.reduce(r,i)),Q(Jn(r=>this.execute(r),r=>r.then(i=>{m(t,G(o=>{o.resolve(i)}))}).catch(i=>{m(t,G(o=>{o.reject(i)}))}))),Mt);n&&await n}this.operating=me}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}}class mk{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}}class yk extends vk{constructor(t){super(),this.inner=t}reduce(t,n){return Re(n)}async execute(t){return await this.inner.setSessionContext(t)()}}class gk{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new yk(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(vR.equals(n,t))return La(this.getConfiguration());const r=this.setContextReducingTaskExecutor.push(t);return()=>r}applySolution(t){return this.inner.applySolution(t)}close(){return this.inner.close()}makeDecision(t){return this.inner.makeDecision(t)}restoreConfiguration(t){return this.inner.restoreConfiguration(t)}setMany(t,n){return this.inner.setMany(t,n)}explain(t){return this.inner.explain(t)}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}}class bk{constructor(t,n=!1){this.stringify=n,this.inner=t,this.durationNumberFormat=new Intl.NumberFormat("en-EN",{maximumFractionDigits:3})}withLogging(t,n,r){const i=performance.now(),o=()=>{const a=performance.now()-i;return this.durationNumberFormat.format(a)};return console.debug(`Operation ${t} started with`,this.renderAsRequired(n)),m(r(),zc(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Ls(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with success`,this.renderAsRequired(a))}))}renderAsRequired(t){return this.stringify?JSON.stringify(t,null,2):t}explain(t){return this.withLogging("explain",[t],()=>this.inner.explain(t))}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){return this.withLogging("setSessionContext",[t],()=>this.inner.setSessionContext(t))}applySolution(t){return this.withLogging("applySolution",[t],()=>this.inner.applySolution(t))}close(){return this.inner.close()}makeDecision(t){return this.withLogging("makeDecision",[t],()=>this.inner.makeDecision(t))}restoreConfiguration(t){return this.withLogging("restoreConfiguration",[t],()=>this.inner.restoreConfiguration(t))}setMany(t,n){return this.withLogging("setMany",[t,n],()=>this.inner.setMany(t,n))}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}}let Sk=class f0{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+Xh()}static new(t){return new f0(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 Ck(e){e=sk(e);const t=new PR(e.hcaEngineBaseUrl),n=new UC,r=new lk,i=new zC,o=new cR,a=new ck(n),s=H(e.sessionHandler).with({create:Le.any,close:Le.any},l=>l).with({accessToken:Le.string},l=>new NR(t,o,n,l)).with({sessionCreateUrl:Le.string,sessionDeleteUrl:Le.string},l=>new RR(o,l)).exhaustive(),u=new dk(s,t,n,r,i,a),c=(l,f)=>m(new pk(l,f),d=>new hk(d),d=>new gk(d),Sk.new,d=>new bk(d,!1));return new jR(u,c)}const d0=Ba.equals,wk=FC.equals;rR.equals;function Kl(e){return Tn((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}/*! *****************************************************************************
|
|
71
|
+
Copyright (c) Microsoft Corporation.
|
|
72
|
+
|
|
73
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
74
|
+
purpose with or without fee is hereby granted.
|
|
75
|
+
|
|
76
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
77
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
78
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
79
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
80
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
81
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
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 Zh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Be(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ge(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function 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 pt;(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"})(pt||(pt={}));var xo;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(xo||(xo={}));var ep=pt.Start,ev=pt.Stop,gu=pt.Raise,Yl=pt.Send,p0=pt.Cancel,xk=pt.NullEvent,tv=pt.Assign;pt.After;pt.DoneState;var h0=pt.Log,Ek=pt.Init,tp=pt.Invoke;pt.ErrorExecution;var Km=pt.ErrorPlatform,Tk=pt.ErrorCustom,v0=pt.Update,Ik=pt.Choose,Ak=pt.Pure,m0=".",Ym={},np="xstate.guard",$k="",$t=process.env.NODE_ENV==="production",Lu;function nv(e,t,n){n===void 0&&(n=m0);var r=Ts(e,n),i=Ts(t,n);return We(i)?We(r)?i===r:!1:We(r)?r in i:Object.keys(r).every(function(o){return o in i?nv(r[o],i[o]):!1})}function y0(e){try{return We(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function rp(e,t){try{return Ga(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function Ok(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function Ts(e,t){if(Ok(e))return e.value;if(Ga(e))return Hc(e);if(typeof e!="string")return e;var n=rp(e,t);return Hc(n)}function Hc(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 hs(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 Xm(e,t,n){var r,i,o={};try{for(var a=Be(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];n(c)&&(o[u]=t(c,u,e))}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var Dk=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 Nk(e,t){return function(n){var r,i,o=n;try{for(var a=Be(e),s=a.next();!s.done;s=a.next()){var u=s.value;o=o[t][u]}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function gc(e){if(!e)return[[]];if(We(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]]:gc(e[n]).map(function(i){return[n].concat(i)})}));return t}function It(e){var t;return(t=[]).concat.apply(t,yt([],Ge(e),!1))}function g0(e){return Ga(e)?e:[e]}function pr(e){return e===void 0?[]:g0(e)}function Kc(e,t,n){var r,i;if(Ze(e))return e(t,n.data);var o={};try{for(var a=Be(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];Ze(c)?o[u]=c(t,n.data):o[u]=c}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function Pk(e){return/^(done|error)\./.test(e)}function Jm(e){return!!(e instanceof Promise||e!==null&&(Ze(e)||typeof e=="object")&&Ze(e.then))}function Rk(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function kk(e,t){var n,r,i=Ge([[],[]],2),o=i[0],a=i[1];try{for(var s=Be(e),u=s.next();!u.done;u=s.next()){var c=u.value;t(c)?o.push(c):a.push(c)}}catch(l){n={error:l}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function b0(e,t){return hs(e.states,function(n,r){if(n){var i=(We(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:b0(n,i)}}})}function Mk(e,t){return{current:t,states:b0(e,t)}}function Qm(e,t,n,r){$t||tn(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,c=a.assignment,l={state:r,action:a,_event:t},f={};if(Ze(c))f=c(o,t.data,l);else try{for(var d=Be(Object.keys(c)),p=d.next();!p.done;p=d.next()){var h=p.value,v=c[h];f[h]=Ze(v)?v(o,t.data,l):v}}catch(x){s={error:x}}finally{try{p&&!p.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var tn=function(){};$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 Ga(e){return Array.isArray(e)}function Ze(e){return typeof e=="function"}function We(e){return typeof e=="string"}function S0(e,t){if(e)return We(e)?{type:np,name:e,predicate:t?t[e]:void 0}:Ze(e)?{type:np,name:e.name,predicate:e}:e}function jk(e){try{return"subscribe"in e&&Ze(e.subscribe)}catch{return!1}}var vi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Lu={},Lu[vi]=function(){return this},Lu[Symbol.observable]=function(){return this};function Yr(e){return!!e&&"__xstatenode"in e}function _k(e){return!!e&&typeof e.send=="function"}var qk=function(){var e=0;return function(){return e++,e.toString(16)}}();function Xl(e,t){return We(e)||typeof e=="number"?re({type:e},t):e}function ln(e,t){if(!We(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=Xl(e);return re({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function zo(e,t){var n=g0(t).map(function(r){return typeof r>"u"||typeof r=="string"||Yr(r)?{target:r,event:e}:re(re({},r),{event:e})});return n}function Fk(e){if(!(e===void 0||e===$k))return pr(e)}function Lk(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 C0(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===np)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 w0(e){return typeof e=="string"?{type:e}:e}function bc(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 Vu(e,t){return"".concat(e,":invocation[").concat(t,"]")}function ip(e){return(e.type===gu||e.type===Yl&&e.to===xo.Internal)&&typeof e.delay!="number"}var ma=ln({type:Ek});function op(e,t){return t&&t[e]||void 0}function Hs(e,t){var n;if(We(e)||typeof e=="number"){var r=op(e,t);Ze(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Ze(e))n={type:e.name||e.toString(),exec:e};else{var r=op(e.type,t);if(Ze(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 mi=function(e,t){if(!e)return[];var n=Ga(e)?e:[e];return n.map(function(r){return Hs(r,t)})};function rv(e){var t=Hs(e);return re(re({id:We(e)?e:t.id},t),{type:t.type})}function Vk(e,t){return{type:gu,event:typeof e=="function"?e:Xl(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function Bk(e,t,n,r){var i={_event:n},o=ln(Ze(e.event)?e.event(t,n.data,i):e.event),a;if(We(e.delay)){var s=r&&r[e.delay];a=Ze(s)?s(t,n.data,i):s}else a=Ze(e.delay)?e.delay(t,n.data,i):e.delay;return re(re({},e),{type:gu,_event:o,delay:a})}function Jl(e,t){return{to:t?t.to:void 0,type:Yl,event:Ze(e)?e:Xl(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Ze(e)?e.name:y0(e)}}function Uk(e,t,n,r){var i={_event:n},o=ln(Ze(e.event)?e.event(t,n.data,i):e.event),a;if(We(e.delay)){var s=r&&r[e.delay];a=Ze(s)?s(t,n.data,i):s}else a=Ze(e.delay)?e.delay(t,n.data,i):e.delay;var u=Ze(e.to)?e.to(t,n.data,i):e.to;return re(re({},e),{to:u,_event:o,event:o.data,delay:a})}function Gk(e,t){return Jl(e,re(re({},t),{to:xo.Parent}))}var zk=function(e,t,n){return re(re({},e),{value:We(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},Wk=function(e){return{type:p0,sendId:e}};function Hk(e){var t=rv(e);return{type:pt.Start,activity:t,exec:void 0}}function Kk(e){var t=Ze(e)?e:rv(e);return{type:pt.Stop,activity:t,exec:void 0}}function Yk(e,t,n){var r=Ze(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:pt.Stop,activity:i};return o}var Xk=function(e){return{type:tv,assignment:e}};function Jk(e,t){var n=t?"#".concat(t):"";return"".concat(pt.After,"(").concat(e,")").concat(n)}function Bu(e,t){var n="".concat(pt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Sc(e,t){var n="".concat(pt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function vs(e,t){var n="".concat(pt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Qk(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([],Ge(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return Jl(function(r,i){return i},re(re({},t),{to:e}))}var Zk=function(e){var t,n,r=[];try{for(var i=Be(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===tv){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function Yc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:Zk(i),u=s.length?Qm(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var x;switch(v.type){case gu:{var E=Bk(v,u,r,e.options.delays);return o&&typeof E.delay=="number"&&o(E,u,r),E}case Yl:var y=Uk(v,u,r,e.options.delays);if(!$t){var S=v.delay;tn(!We(S)||typeof y.delay=="number","No delay reference for delay expression '".concat(S,"' was found on machine '").concat(e.id,"'"))}return o&&y.to!==xo.Internal&&(h==="entry"?l.push(y):o(y,u,r)),y;case h0:{var w=zk(v,u,r);return o==null||o(w,u,r),w}case Ik:{var b=v,T=(x=b.conds.find(function(V){var U=S0(V.cond,e.options.guards);return!U||C0(e,U,u,r,o?void 0:t)}))===null||x===void 0?void 0:x.actions;if(!T)return[];var A=Ge(Yc(e,t,u,r,[{type:h,actions:mi(pr(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case Ak:{var T=v.get(u,r.data);if(!T)return[];var N=Ge(Yc(e,t,u,r,[{type:h,actions:mi(pr(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case ev:{var w=Yk(v,u,r);return o==null||o(w,n,r),w}case tv:{u=Qm(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var B=Hs(v,e.options.actions),K=B.exec;if(o)o(B,u,r);else if(K&&c){var k=c.length-1,ie=re(re({},B),{exec:function(V){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];K.apply(void 0,yt([c[k]],Ge(U),!1))}});B=ie}return B}}function d(h){var v,x,E=[];try{for(var y=Be(h.actions),S=y.next();!S.done;S=y.next()){var w=S.value,b=f(h.type,w);b&&(E=E.concat(b))}}catch(T){v={error:T}}finally{try{S&&!S.done&&(x=y.return)&&x.call(y)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,E}var p=It(i.map(d));return[p,u]}var Xc=[],ea=function(e,t){Xc.push(e);var n=t(e);return Xc.pop(),n},eM=function(e){return e(Xc[Xc.length-1])};function x0(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[vi]=function(){return this},t}function tM(e,t,n,r){var i,o=w0(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?Kc(e.data,n,r):void 0,u=a?iv(a,e.id,s):x0(e.id);return u.meta=e,u}function iv(e,t,n){var r=x0(t);if(r.deferred=!0,Yr(e)){var i=r.state=ea(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function nM(e){try{return typeof e.send=="function"}catch{return!1}}function rM(e){return nM(e)&&"id"in e}function iM(e){var t;return re((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[vi]=function(){return this},t),e)}var Jc=function(e){return e.type==="atomic"||e.type==="final"};function E0(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Ks(e){return E0(e).filter(function(t){return t.type!=="history"})}function T0(e){var t=[e];return Jc(e)?t:t.concat(It(Ks(e).map(T0)))}function ms(e,t){var n,r,i,o,a,s,u,c,l=new Set(e),f=ap(l),d=new Set(t);try{for(var p=Be(d),h=p.next();!h.done;h=p.next())for(var v=h.value,x=v.parent;x&&!d.has(x);)d.add(x),x=x.parent}catch(I){n={error:I}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var E=ap(d);try{for(var y=Be(d),S=y.next();!S.done;S=y.next()){var v=S.value;if(v.type==="compound"&&(!E.get(v)||!E.get(v).length))f.get(v)?f.get(v).forEach(function(N){return d.add(N)}):v.initialStateNodes.forEach(function(N){return d.add(N)});else if(v.type==="parallel")try{for(var w=(a=void 0,Be(Ks(v))),b=w.next();!b.done;b=w.next()){var T=b.value;d.has(T)||(d.add(T),f.get(T)?f.get(T).forEach(function(N){return d.add(N)}):T.initialStateNodes.forEach(function(N){return d.add(N)}))}}catch(N){a={error:N}}finally{try{b&&!b.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{S&&!S.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}try{for(var A=Be(d),D=A.next();!D.done;D=A.next())for(var v=D.value,x=v.parent;x&&!d.has(x);)d.add(x),x=x.parent}catch(I){u={error:I}}finally{try{D&&!D.done&&(c=A.return)&&c.call(A)}finally{if(u)throw u.error}}return d}function I0(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(Jc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=I0(o,t)}),i}function ap(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 oM(e,t){var n=ms([e],t);return I0(e,ap(n))}function ys(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function aM(e){return yt([],Ge(new Set(It(yt([],Ge(e.map(function(t){return t.ownEvents})),!1)))),!1)}function Cc(e,t){return t.type==="compound"?Ks(t).some(function(n){return n.type==="final"&&ys(e,n)}):t.type==="parallel"?Ks(t).every(function(n){return Cc(e,n)}):!1}function sM(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function Zm(e){return new Set(It(e.map(function(t){return t.tags})))}function A0(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(We(e)||We(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return A0(e[i],t[i])})}function uM(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function cM(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 nr=function(){function e(t){var n=this,r;this.actions=[],this.activities=Ym,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||Ym,this.meta=sM(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 aM(n.configuration)}})}return e.from=function(t,n){if(t instanceof e)return t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t;var r=ma;return new e({value:t,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=ma;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var r=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),We(t))return[t];var i=Object.keys(t);return i.concat.apply(i,yt([],Ge(i.map(function(o){return r.toStrings(t[o],n).map(function(a){return o+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var r=Zh(t,["configuration","transitions","tags","machine"]);return re(re({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return nv(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;$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}(),lM={deferEvents:!1},ey=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=re(re({},lM),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,fM=0,is={bookId:function(){return"x:".concat(fM++)},register:function(e,t){return $f.set(e,t),e},get:function(e){return $f.get(e)},free:function(e){$f.delete(e)}};function ov(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;$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 dM(){var e=ov();if(e&&"__xstate__"in e)return e.__xstate__}function pM(e){if(ov()){var t=dM();t&&t.register(e)}}function hM(e,t){t===void 0&&(t={});var n=e.initialState,r=new Set,i=[],o=!1,a=function(){if(!o){for(o=!0;i.length>0;){var c=i.shift();n=e.transition(n,c,u),r.forEach(function(l){return l.next(n)})}o=!1}},s=iM({id:t.id,send:function(c){i.push(c),a()},getSnapshot:function(){return n},subscribe:function(c,l,f){var d=bc(c,l,f);return r.add(d),d.next(n),{unsubscribe:function(){r.delete(d)}}}}),u={parent:t.parent,self:s,id:t.id||"anonymous",observers:r};return n=e.start?e.start(u):n,s}var sp={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 vM=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(l,f){if(Ga(l))return r.batch(l),r.state;var d=ln(Xl(l,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.
|
|
84
|
+
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.
|
|
85
|
+
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var p=r._nextState(d);r.update(p,d)}),r._state},this.sendTo=function(l,f,d){var p=r.parent&&(f===xo.Parent||r.parent.id===f),h=p?r.parent:We(f)?f===xo.Internal?r:r.children.get(f)||is.get(f):_k(f)?f:void 0;if(!h){if(!p)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(l.type));return}if("machine"in h){if(r.status!==Dt.Stopped||r.parent!==h||r.state.done){var v=re(re({},l),{name:l.name===Tk?"".concat(vs(r.id)):l.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,v]):h.send(v)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,l.data]):h.send(l.data)},this._exec=function(l,f,d,p){p===void 0&&(p=r.machine.options.actions);var h=l.exec||op(l.type,p),v=Ze(h)?h:h?h.exec:l.exec;if(v)try{return v(f,d.data,r.machine.config.predictableActionArguments?{action:l,_event:d}:{action:l,state:r.state,_event:d})}catch(K){throw r.parent&&r.parent.send({type:"xstate.error",data:K}),K}switch(l.type){case gu:{var x=l;r.defer(x);break}case Yl:var E=l;if(typeof E.delay=="number"){r.defer(E);return}else E.to?r.sendTo(E._event,E.to,d===ma):r.send(E._event);break;case p0:r.cancel(l.sendId);break;case ep:{if(r.status!==Dt.Running)return;var y=l.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[y.id||y.type])break;if(y.type===pt.Invoke){var S=w0(y.src),w=r.machine.options.services?r.machine.options.services[S.type]:void 0,b=y.id,T=y.data;$t||tn(!("forward"in y),"`forward` property is deprecated (found in invocation of '".concat(y.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var A="autoForward"in y?y.autoForward:!!y.forward;if(!w){$t||tn(!1,"No service found for invocation '".concat(y.src,"' in machine '").concat(r.machine.id,"'."));return}var D=T?Kc(T,f,d):void 0;if(typeof w=="string")return;var I=Ze(w)?w(f,d.data,{data:D,src:S,meta:y.meta}):w;if(!I)return;var N=void 0;Yr(I)&&(I=D?I.withContext(D):I,N={autoForward:A}),r.spawn(I,b,N)}else r.spawnActivity(y);break}case ev:{r.stopChild(l.activity.id);break}case h0:var _=l,L=_.label,B=_.value;L?r.logger(L,B):r.logger(B);break;default:$t||tn(!1,"No implementation found for action type '".concat(l.type,"'"));break}};var i=re(re({},e.defaultOptions),n),o=i.clock,a=i.logger,s=i.parent,u=i.id,c=u!==void 0?u:t.id;this.id=c,this.logger=a,this.clock=o,this.parent=s,this.options=i,this.scheduler=new ey({deferEvents:this.options.deferEvents}),this.sessionId=is.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:ea(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return $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=Be(t.actions),a=o.next();!a.done;a=o.next()){var s=a.value;this.exec(s,t,n)}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},e.prototype.update=function(t,n){var r,i,o,a,s,u,c,l,f=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||n===ma)&&this.options.execute)this.execute(this.state);else for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);if(this.children.forEach(function(I){f.state.children[I.id]=I}),this.devTools&&this.devTools.send(n.data,t),t.event)try{for(var p=Be(this.eventListeners),h=p.next();!h.done;h=p.next()){var v=h.value;v(t.event)}}catch(I){r={error:I}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var x=Be(this.listeners),E=x.next();!E.done;E=x.next()){var v=E.value;v(t,t.event)}}catch(I){o={error:I}}finally{try{E&&!E.done&&(a=x.return)&&a.call(x)}finally{if(o)throw o.error}}try{for(var y=Be(this.contextListeners),S=y.next();!S.done;S=y.next()){var w=S.value;w(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(I){s={error:I}}finally{try{S&&!S.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}if(this.state.done){var b=t.configuration.find(function(I){return I.type==="final"&&I.parent===f.machine}),T=b&&b.doneData?Kc(b.doneData,t.context,n):void 0;this._doneEvent=Sc(this.id,T);try{for(var A=Be(this.doneListeners),D=A.next();!D.done;D=A.next()){var v=D.value;v(this._doneEvent)}}catch(I){c={error:I}}finally{try{D&&!D.done&&(l=A.return)&&l.call(A)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),is.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=bc(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(),is.register(this.sessionId,this),this.initialized=!0,this.status=Dt.Running;var r=t===void 0?this.initialState:ea(this,function(){return uM(t)?n.machine.resolveState(t):n.machine.resolveState(nr.from(t,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,ma)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(t){Ze(t.stop)&&t.stop()}),this.children.clear()},e.prototype._stop=function(){var t,n,r,i,o,a,s,u,c,l;try{for(var f=Be(this.listeners),d=f.next();!d.done;d=f.next()){var p=d.value;this.listeners.delete(p)}}catch(A){t={error:A}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}try{for(var h=Be(this.stopListeners),v=h.next();!v.done;v=h.next()){var p=v.value;p(),this.stopListeners.delete(p)}}catch(A){r={error:A}}finally{try{v&&!v.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}try{for(var x=Be(this.contextListeners),E=x.next();!E.done;E=x.next()){var p=E.value;this.contextListeners.delete(p)}}catch(A){o={error:A}}finally{try{E&&!E.done&&(a=x.return)&&a.call(x)}finally{if(o)throw o.error}}try{for(var y=Be(this.doneListeners),S=y.next();!S.done;S=y.next()){var p=S.value;this.doneListeners.delete(p)}}catch(A){s={error:A}}finally{try{S&&!S.done&&(u=y.return)&&u.call(y)}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 w=Be(Object.keys(this.delayedEventsMap)),b=w.next();!b.done;b=w.next()){var T=b.value;this.clock.clearTimeout(this.delayedEventsMap[T])}}catch(A){c={error:A}}finally{try{b&&!b.done&&(l=w.return)&&l.call(w)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new ey({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var t=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r=ln({type:"xstate.stop"}),i=ea(t,function(){var o=It(yt([],Ge(t.state.configuration),!1).sort(function(l,f){return f.order-l.order}).map(function(l){return mi(l.onExit,t.machine.options.actions)})),a=Ge(Yc(t.machine,t.state,t.state.context,r,[{type:"exit",actions:o}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),s=a[0],u=a[1],c=new nr({value:t.state.value,context:u,_event:r,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:s.filter(function(l){return!ip(l)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return c.changed=!0,c});t.update(i,r),t._stopChildren(),is.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.
|
|
86
|
+
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=[],c=function(p){var h=ln(p);n.forward(h),a=ea(n,function(){return n.machine.transition(a,h,void 0,r||void 0)}),u.push.apply(u,yt([],Ge(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return cM(v,a)})),!1)),s=s||!!a.changed};try{for(var l=Be(t),f=l.next();!f.done;f=l.next()){var d=f.value;c(d)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,ln(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=ln(t);if(i.name.indexOf(Km)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(Km)===0}))throw i.data.data;var o=ea(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},e.prototype.nextState=function(t){return this._nextState(t,!1)},e.prototype.forward=function(t){var n,r;try{for(var i=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),Ze(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Dt.Running)return iv(t,n);if(Jm(t))return this.spawnPromise(Promise.resolve(t),n);if(Ze(t))return this.spawnCallback(t,n);if(rM(t))return this.spawnActor(t,n);if(jk(t))return this.spawnObservable(t,n);if(Yr(t))return this.spawnMachine(t,re(re({},r),{id:n}));if(Rk(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({},sp),n);o.sync&&i.onTransition(function(s){r.send(v0,{state:s,id:i.id})});var a=i;return this.children.set(i.id,a),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(s){r.removeChild(i.id),r.send(ln(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=hM(t,{id:n,parent:this});return this.children.set(n,r),r},e.prototype.spawnPromise=function(t,n){var r,i=this,o=!1,a;t.then(function(u){o||(a=u,i.removeChild(n),i.send(ln(Sc(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var c=vs(n,u);try{i.send(ln(c,{origin:n}))}catch(l){Lk(u,l,n),i.devTools&&i.devTools.send(c,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,c,l){var f=bc(u,c,l),d=!1;return t.then(function(p){d||(f.next(p),!d&&f.complete())},function(p){d||f.error(p)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[vi]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnCallback=function(t,n){var r,i=this,o=!1,a=new Set,s=new Set,u,c=function(d){u=d,s.forEach(function(p){return p(d)}),!o&&i.send(ln(d,{origin:n}))},l;try{l=t(c,function(d){a.add(d)})}catch(d){this.send(vs(n,d))}if(Jm(l))return this.spawnPromise(l,n);var f=(r={id:n,send:function(d){return a.forEach(function(p){return p(d)})},subscribe:function(d){var p=bc(d);return s.add(p.next),{unsubscribe:function(){s.delete(p.next)}}},stop:function(){o=!0,Ze(l)&&l()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[vi]=function(){return this},r);return this.children.set(n,f),f},e.prototype.spawnObservable=function(t,n){var r,i=this,o,a=t.subscribe(function(u){o=u,i.send(ln(u,{origin:n}))},function(u){i.removeChild(n),i.send(ln(vs(n,u),{origin:n}))},function(){i.removeChild(n),i.send(ln(Sc(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,c,l){return t.subscribe(u,c,l)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[vi]=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[vi]=function(){return this},r))},e.prototype.attachDev=function(){var t=ov();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(re(re({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:re({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}pM(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[vi]=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=$0,e}(),mM=function(e){return We(e)?re(re({},sp),{name:e}):re(re(re({},sp),{name:qk()}),e)};function ty(e,t){var n=mM(t);return eM(function(r){if(!$t){var i=Yr(e)||Ze(e);tn(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(Yr(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):iv(e,n.name)})}function $0(e,t){var n=new vM(e,t);return n}function yM(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function Uu(e){return re(re({type:tp},e),{toJSON:function(){e.onDone,e.onError;var t=Zh(e,["onDone","onError"]);return re(re({},t),{type:tp,src:yM(e.src)})}})}var ta="",up="#",os="*",Wo={},Ho=function(e){return e[0]===up},gM=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},bM=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(We(o.target)||Yr(o.target))}),i=t===ta?"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.")},SM=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(gM(),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:m0),this.id=this.config.id||yt([this.machine.key],Ge(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,$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?hs(this.config.states,function(c,l){var f,d=new e(c,{},void 0,{parent:o,key:l});return Object.assign(o.idMap,re((f={},f[d.id]=d,f),d.idMap)),d}):Wo;var s=0;function u(c){var l,f;c.order=s++;try{for(var d=Be(E0(c)),p=d.next();!p.done;p=d.next()){var h=p.value;u(h)}}catch(v){l={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}finally{if(l)throw l.error}}}u(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(c){var l=c.event;return l===ta}):ta in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=pr(this.config.entry||this.config.onEntry).map(function(c){return Hs(c)}),this.onExit=pr(this.config.exit||this.config.onExit).map(function(c){return Hs(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=pr(this.config.invoke).map(function(c,l){var f,d;if(Yr(c)){var p=Vu(o.id,l);return o.machine.options.services=re((f={},f[p]=c,f),o.machine.options.services),Uu({src:p,id:p})}else if(We(c.src)){var p=c.id||Vu(o.id,l);return Uu(re(re({},c),{id:p,src:c.src}))}else if(Yr(c.src)||Ze(c.src)){var p=c.id||Vu(o.id,l);return o.machine.options.services=re((d={},d[p]=c.src,d),o.machine.options.services),Uu(re(re({id:p},c),{src:p}))}else{var h=c.src;return Uu(re(re({id:Vu(o.id,l)},c),{src:h}))}}),this.activities=pr(this.config.activities).concat(this.invoke).map(function(c){return rv(c)}),this.transition=this.transition.bind(this),this.tags=pr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||T0(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 Ze(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:hs(this.states,function(t){return t.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var n=t===ta,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===os});return this.__cache.candidates[t]=r,r},e.prototype.getDelayedTransitions=function(){var t=this,n=this.config.after;if(!n)return[];var r=function(o,a){var s=Ze(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=Jk(s,t.id);return t.onEntry.push(Jl(u,{delay:o})),t.onExit.push(Wk(u)),u},i=Ga(n)?n.map(function(o,a){var s=r(o.delay,a);return re(re({},o),{event:s})}):It(Object.keys(n).map(function(o,a){var s=n[o],u=We(s)?{target:s}:s,c=isNaN(+o)?o:+o,l=r(c,a);return pr(u).map(function(f){return re(re({},f),{event:l,delay:c})})}));return i.map(function(o){var a=o.delay;return re(re({},t.formatTransition(o)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,r=this;if(!t)return[];var i=t instanceof nr?t.value:Ts(t,this.delimiter);if(We(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var a=Object.keys(i),s=[this];return s.push.apply(s,yt([],Ge(It(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=y0(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof nr?t:nr.create(t),r=Array.from(ms([],this.getStateNodes(n.value)));return new nr(re(re({},n),{value:this.resolve(n.value),configuration:r,done:Cc(r,this),tags:Zm(r),machine:this.machine}))},e.prototype.transitionLeafNode=function(t,n,r){var i=this.getStateNode(t),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},e.prototype.transitionCompoundNode=function(t,n,r){var i=Object.keys(t),o=this.getStateNode(i[0]),a=o._transition(t[i[0]],n,r);return!a||!a.transitions.length?this.next(n,r):a},e.prototype.transitionParallelNode=function(t,n,r){var i,o,a={};try{for(var s=Be(Object.keys(t)),u=s.next();!u.done;u=s.next()){var c=u.value,l=t[c];if(l){var f=this.getStateNode(c),d=f._transition(l,n,r);d&&(a[c]=d)}}}catch(E){i={error:E}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var p=Object.keys(a).map(function(E){return a[E]}),h=It(p.map(function(E){return E.transitions})),v=p.some(function(E){return E.transitions.length>0});if(!v)return this.next(n,r);var x=It(Object.keys(a).map(function(E){return a[E].configuration}));return{transitions:h,exitSet:It(p.map(function(E){return E.exitSet})),configuration:x,source:n,actions:It(Object.keys(a).map(function(E){return a[E].actions}))}},e.prototype._transition=function(t,n,r){return We(t)?this.transitionLeafNode(t,n,r):Object.keys(t).length===1?this.transitionCompoundNode(t,n,r):this.transitionParallelNode(t,n,r)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,ln(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],c;try{for(var l=Be(this.getCandidates(a)),f=l.next();!f.done;f=l.next()){var d=f.value,p=d.cond,h=d.in,v=t.context,x=h?We(h)&&Ho(h)?t.matches(Ts(this.getStateNodeById(h).path,this.delimiter)):nv(Ts(h,this.delimiter),Dk(this.path.slice(0,-2))(t.value)):!0,E=!1;try{E=!p||C0(this.machine,p,v,n,t)}catch(w){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
87
|
+
`).concat(w.message))}if(E&&x){d.target!==void 0&&(u=d.target),s.push.apply(s,yt([],Ge(d.actions),!1)),c=d;break}}}catch(w){r={error:w}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}if(c){if(!u.length)return{transitions:[c],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var y=It(u.map(function(w){return o.getRelativeStateNodes(w,t.historyValue)})),S=!!c.internal;return{transitions:[c],exitSet:S?[]:It(u.map(function(w){return o.getPotentiallyReenteringNodes(w)})),configuration:y,source:t,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var n=[],r=this,i=t;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},e.prototype.getActions=function(t,n,r,i,o,a,s){var u,c,l,f,d=this,p=a?ms([],this.getStateNodes(a.value)):[],h=new Set;try{for(var v=Be(Array.from(t).sort(function(_,L){return _.order-L.order})),x=v.next();!x.done;x=v.next()){var E=x.value;(!ys(p,E)||ys(r.exitSet,E)||E.parent&&h.has(E.parent))&&h.add(E)}}catch(_){u={error:_}}finally{try{x&&!x.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}try{for(var y=Be(p),S=y.next();!S.done;S=y.next()){var E=S.value;(!ys(t,E)||ys(r.exitSet,E.parent))&&r.exitSet.push(E)}}catch(_){l={error:_}}finally{try{S&&!S.done&&(f=y.return)&&f.call(y)}finally{if(l)throw l.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var w=Array.from(h).sort(function(_,L){return _.order-L.order}),b=new Set(r.exitSet),T=It(w.map(function(_){var L=[];if(_.type!=="final")return L;var B=_.parent;if(!B.parent)return L;L.push(Bu(_.id,_.doneData),Bu(B.id,_.doneData?Kc(_.doneData,i,o):void 0));var K=B.parent;return K.type==="parallel"&&Ks(K).every(function(k){return Cc(r.configuration,k)})&&L.push(Bu(K.id)),L})),A=w.map(function(_){var L=_.onEntry,B=_.activities.map(function(K){return Hk(K)});return{type:"entry",actions:mi(s?yt(yt([],Ge(L),!1),Ge(B),!1):yt(yt([],Ge(B),!1),Ge(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:T.map(function(_){return Vk(_)})}),D=Array.from(b).map(function(_){return{type:"exit",actions:mi(yt(yt([],Ge(_.onExit),!1),Ge(_.activities.map(function(L){return Kk(L)})),!1),d.machine.options.actions)}}),I=D.concat({type:"transition",actions:mi(r.actions,this.machine.options.actions)}).concat(A);if(n){var N=mi(It(yt([],Ge(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!ip(_)});return I.concat({type:"stop",actions:N})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=ln(n),a;if(t instanceof nr)a=r===void 0?t:this.resolveState(nr.from(t,r));else{var s=We(t)?this.resolve(Hc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(nr.from(s,u))}if(!$t&&o.name===os)throw new Error("An event cannot have the wildcard type ('".concat(os,"')"));if(this.strict&&!this.events.includes(o.name)&&!Pk(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},l=ms([],this.getStateNodes(a.value)),f=c.configuration.length?ms(l,c.configuration):l;return c.configuration=yt([],Ge(f),!1),this.resolveTransition(c,a,a.context,i,o)},e.prototype.resolveRaisedTransition=function(t,n,r,i){var o,a=t.actions;return t=this.transition(t,n,void 0,i),t._event=r,t.event=r.data,(o=t.actions).unshift.apply(o,yt([],Ge(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,c,l=this;o===void 0&&(o=ma);var f=t.configuration,d=!n||t.transitions.length>0,p=d?t.configuration:n?n.configuration:[],h=Cc(p,this),v=d?oM(this.machine,f):void 0,x=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,E=this.getActions(new Set(p),h,t,r,o,n,i),y=n?re({},n.activities):{};try{for(var S=Be(E),w=S.next();!w.done;w=S.next()){var b=w.value;try{for(var T=(u=void 0,Be(b.actions)),A=T.next();!A.done;A=T.next()){var D=A.value;D.type===ep?y[D.activity.id||D.activity.type]=D:D.type===ev&&(y[D.activity.id||D.activity.type]=!1)}}catch(Y){u={error:Y}}finally{try{A&&!A.done&&(c=T.return)&&c.call(T)}finally{if(u)throw u.error}}}}catch(Y){a={error:Y}}finally{try{w&&!w.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}var I=Ge(Yc(this,n,r,o,E,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),N=I[0],_=I[1],L=Ge(kk(N,ip),2),B=L[0],K=L[1],k=N.filter(function(Y){var ae;return Y.type===ep&&((ae=Y.activity)===null||ae===void 0?void 0:ae.type)===tp}),ie=k.reduce(function(Y,ae){return Y[ae.activity.id]=tM(ae.activity,l.machine,_,o),Y},n?re({},n.children):{}),V=new nr({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?x?Mk(x,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?K:[],activities:v?y:n?n.activities:{},events:[],configuration:p,transitions:t.transitions,children:ie,done:h,tags:Zm(p),machine:this}),U=r!==_;V.changed=o.name===v0||U;var fe=V.history;fe&&delete fe.history;var j=!h&&(this._transient||f.some(function(Y){return Y._transient}));if(!d&&(!j||o.name===ta))return V;var R=V;if(!h)for(j&&(R=this.resolveRaisedTransition(R,{type:xk},o,i));B.length;){var te=B.shift();R=this.resolveRaisedTransition(R,te._event,o,i)}var oe=R.changed||(fe?!!R.actions.length||U||typeof fe.value!=typeof R.value||!A0(R.value,fe.value):void 0);return R.changed=oe,R.history=fe,R},e.prototype.getStateNode=function(t){if(Ho(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=Ho(t)?t.slice(up.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"&&Ho(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=rp(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||Wo;switch(this.type){case"parallel":return hs(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):Wo});case"compound":if(We(t)){var i=this.getStateNode(t);return i.type==="parallel"||i.type==="compound"?(n={},n[t]=i.initialStateValue,n):t}return Object.keys(t).length?hs(t,function(o,a){return o?r.getStateNode(a).resolve(o):Wo}):this.initialStateValue||{};default:return t||Wo}},e.prototype.getResolvedPath=function(t){if(Ho(t)){var n=this.machine.idMap[t.slice(up.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return rp(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=Xm(this.states,function(r){return r.initialStateValue||Wo},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=Jc(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;We(n.target)?t=Ho(n.target)?Hc(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(Jc(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=gc(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=Ge(t),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(i)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:Xm(this.states,function(n,r){if(!t)return n.historyValue();var i=We(t)?void 0:t[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!t){var i=this.target;return i?It(gc(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=Nk(r.path,"states")(t).current;return We(o)?[r.getStateNode(o)]:It(gc(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=Be(Object.keys(o)),u=s.next();!u.done;u=s.next()){var c=u.value,l=o[c];if(l.states)try{for(var f=(r=void 0,Be(l.events)),d=f.next();!d.done;d=f.next()){var p=d.value;a.add("".concat(p))}}catch(h){r={error:h}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(h){t={error:h}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(r){if(!We(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var a=n.parent.getStateNodeByPath(o);return a}catch(s){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
88
|
+
`).concat(s.message))}else return n.getStateNodeByPath(o)})},e.prototype.formatTransition=function(t){var n=this,r=Fk(t.target),i="internal"in t?t.internal:r?r.some(function(u){return We(u)&&u[0]===n.delimiter}):!0,o=this.machine.options.guards,a=this.resolveTarget(r),s=re(re({},t),{actions:mi(pr(t.actions)),cond:S0(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=os,s=o[a],u=s===void 0?[]:s,c=Zh(o,[typeof a=="symbol"?a:a+""]);i=It(Object.keys(c).map(function(y){!$t&&y===ta&&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 S=zo(y,c[y]);return $t||bM(r,y,S),S}).concat(zo(os,u)))}var l=this.config.always?zo("",this.config.always):[],f=this.config.onDone?zo(String(Bu(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(y){var S=[];return y.onDone&&S.push.apply(S,yt([],Ge(zo(String(Sc(y.id)),y.onDone)),!1)),y.onError&&S.push.apply(S,yt([],Ge(zo(String(vs(y.id)),y.onError)),!1)),S})),p=this.after,h=It(yt(yt(yt(yt([],Ge(f),!1),Ge(d),!1),Ge(i),!1),Ge(l),!1).map(function(y){return pr(y).map(function(S){return r.formatTransition(S)})}));try{for(var v=Be(p),x=v.next();!x.done;x=v.next()){var E=x.value;h.push(E)}}catch(y){t={error:y}}finally{try{x&&!x.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}return h},e}(),ny=!1;function av(e,t){return!$t&&!("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 SM(e,t)}var Pn=Xk,CM=Jl,O0=Gk,Gu=Qk,tt={},sv={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});/*! *****************************************************************************
|
|
89
|
+
Copyright (c) Microsoft Corporation.
|
|
90
|
+
|
|
91
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
92
|
+
purpose with or without fee is hereby granted.
|
|
93
|
+
|
|
94
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
95
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
96
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
97
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
98
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
99
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
100
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
101
|
+
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,c=arguments.length;u<c;u++){s=arguments[u];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(a[l]=s[l])}return a},e.__assign.apply(this,arguments)};function t(o,a){var s={};for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&a.indexOf(u)<0&&(s[u]=o[u]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,u=Object.getOwnPropertySymbols(o);c<u.length;c++)a.indexOf(u[c])<0&&Object.prototype.propertyIsEnumerable.call(o,u[c])&&(s[u[c]]=o[u[c]]);return s}function n(o){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&o[a],u=0;if(s)return s.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&u>=o.length&&(o=void 0),{value:o&&o[u++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(o,a){var s=typeof Symbol=="function"&&o[Symbol.iterator];if(!s)return o;var u=s.call(o),c,l=[],f;try{for(;(a===void 0||a-- >0)&&!(c=u.next()).done;)l.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return l}function i(o,a,s){if(s||arguments.length===2)for(var u=0,c=a.length,l;u<c;u++)(l||!(u in a))&&(l||(l=Array.prototype.slice.call(a,0,u)),l[u]=a[u]);return o.concat(l||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(sv);var Ql={};(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={}))})(Ql);var Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});var un=Ql,wM=un.ActionTypes.Start,xM=un.ActionTypes.Stop,EM=un.ActionTypes.Raise,TM=un.ActionTypes.Send,IM=un.ActionTypes.Cancel,AM=un.ActionTypes.NullEvent,$M=un.ActionTypes.Assign,OM=un.ActionTypes.After,DM=un.ActionTypes.DoneState,NM=un.ActionTypes.Log,PM=un.ActionTypes.Init,RM=un.ActionTypes.Invoke,kM=un.ActionTypes.ErrorExecution,MM=un.ActionTypes.ErrorPlatform,jM=un.ActionTypes.ErrorCustom,_M=un.ActionTypes.Update,qM=un.ActionTypes.Choose,FM=un.ActionTypes.Pure;Vt.after=OM;Vt.assign=$M;Vt.cancel=IM;Vt.choose=qM;Vt.doneState=DM;Vt.error=jM;Vt.errorExecution=kM;Vt.errorPlatform=MM;Vt.init=PM;Vt.invoke=RM;Vt.log=NM;Vt.nullEvent=AM;Vt.pure=FM;Vt.raise=EM;Vt.send=TM;Vt.start=wM;Vt.stop=xM;Vt.update=_M;var D0={},za={};Object.defineProperty(za,"__esModule",{value:!0});var LM=".",VM={},BM="xstate.guard",UM="";za.DEFAULT_GUARD_TYPE=BM;za.EMPTY_ACTIVITY_MAP=VM;za.STATE_DELIMITER=LM;za.TARGETLESS_KEY=UM;var Zl={};Object.defineProperty(Zl,"__esModule",{value:!0});var GM=process.env.NODE_ENV==="production";Zl.IS_PRODUCTION=GM;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=sv,n=Ql,r=Vt,i=za,o=Zl,a;function s(g){return Object.keys(g)}function u(g,M,F){F===void 0&&(F=i.STATE_DELIMITER);var q=p(g,F),X=p(M,F);return U(X)?U(q)?X===q:!1:U(q)?q in X:Object.keys(q).every(function(Z){return Z in X?u(q[Z],X[Z]):!1})}function c(g){try{return U(g)||typeof g=="number"?"".concat(g):g.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function l(g){try{return U(g)||typeof g=="number"?"".concat(g):V(g)?g.name:g.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(g,M){try{return ie(g)?g:g.toString().split(M)}catch{throw new Error("'".concat(g,"' is not a valid state path."))}}function d(g){return typeof g=="object"&&"value"in g&&"context"in g&&"event"in g&&"_event"in g}function p(g,M){if(d(g))return g.value;if(ie(g))return h(g);if(typeof g!="string")return g;var F=f(g,M);return h(F)}function h(g){if(g.length===1)return g[0];for(var M={},F=M,q=0;q<g.length-1;q++)q===g.length-2?F[g[q]]=g[q+1]:(F[g[q]]={},F=F[g[q]]);return M}function v(g,M){for(var F={},q=Object.keys(g),X=0;X<q.length;X++){var Z=q[X];F[Z]=M(g[Z],Z,g,X)}return F}function x(g,M,F){var q,X,Z={};try{for(var le=t.__values(Object.keys(g)),se=le.next();!se.done;se=le.next()){var be=se.value,Ae=g[be];F(Ae)&&(Z[be]=M(Ae,be,g))}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Z}var E=function(g){return function(M){var F,q,X=M;try{for(var Z=t.__values(g),le=Z.next();!le.done;le=Z.next()){var se=le.value;X=X[se]}}catch(be){F={error:be}}finally{try{le&&!le.done&&(q=Z.return)&&q.call(Z)}finally{if(F)throw F.error}}return X}};function y(g,M){return function(F){var q,X,Z=F;try{for(var le=t.__values(g),se=le.next();!se.done;se=le.next()){var be=se.value;Z=Z[M][be]}}catch(Ae){q={error:Ae}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Z}}function S(g){if(!g)return[[]];if(U(g))return[[g]];var M=b(Object.keys(g).map(function(F){var q=g[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:S(g[F]).map(function(X){return[F].concat(X)})}));return M}function w(g){var M,F,q={};if(g&&g.length===1&&g[0].length===1)return g[0][0];try{for(var X=t.__values(g),Z=X.next();!Z.done;Z=X.next())for(var le=Z.value,se=q,be=0;be<le.length;be++){var Ae=le[be];if(be===le.length-2){se[Ae]=le[be+1];break}se[Ae]=se[Ae]||{},se=se[Ae]}}catch(jt){M={error:jt}}finally{try{Z&&!Z.done&&(F=X.return)&&F.call(X)}finally{if(M)throw M.error}}return q}function b(g){var M;return(M=[]).concat.apply(M,t.__spreadArray([],t.__read(g),!1))}function T(g){return ie(g)?g:[g]}function A(g){return g===void 0?[]:T(g)}function D(g,M,F){var q,X;if(V(g))return g(M,F.data);var Z={};try{for(var le=t.__values(Object.keys(g)),se=le.next();!se.done;se=le.next()){var be=se.value,Ae=g[be];V(Ae)?Z[be]=Ae(M,F.data):Z[be]=Ae}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Z}function I(g){return/^(done|error)\./.test(g)}function N(g){return!!(g instanceof Promise||g!==null&&(V(g)||typeof g=="object")&&V(g.then))}function _(g){return g!==null&&typeof g=="object"&&"transition"in g&&typeof g.transition=="function"}function L(g,M){var F,q,X=t.__read([[],[]],2),Z=X[0],le=X[1];try{for(var se=t.__values(g),be=se.next();!be.done;be=se.next()){var Ae=be.value;M(Ae)?Z.push(Ae):le.push(Ae)}}catch(jt){F={error:jt}}finally{try{be&&!be.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Z,le]}function B(g,M){return v(g.states,function(F,q){if(F){var X=(U(M)?void 0:M[q])||(F?F.current:void 0);if(X)return{current:X,states:B(F,X)}}})}function K(g,M){return{current:M,states:B(g,M)}}function k(g,M,F,q){o.IS_PRODUCTION||e.warn(!!g,"Attempting to update undefined context");var X=g&&F.reduce(function(Z,le){var se,be,Ae=le.assignment,jt={state:q,action:le,_event:M},Hi={};if(V(Ae))Hi=Ae(Z,M.data,jt);else try{for(var kr=t.__values(Object.keys(Ae)),fr=kr.next();!fr.done;fr=kr.next()){var Ja=fr.value,Ki=Ae[Ja];Hi[Ja]=V(Ki)?Ki(Z,M.data,jt):Ki}}catch(wf){se={error:wf}}finally{try{fr&&!fr.done&&(be=kr.return)&&be.call(kr)}finally{if(se)throw se.error}}return Object.assign({},Z,Hi)},g);return X}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(g,M){var F=g instanceof Error?g:void 0;if(!(!F&&g)&&console!==void 0){var q=["Warning: ".concat(M)];F&&q.push(F),console.warn.apply(console,q)}});function ie(g){return Array.isArray(g)}function V(g){return typeof g=="function"}function U(g){return typeof g=="string"}function fe(g,M){if(g)return U(g)?{type:i.DEFAULT_GUARD_TYPE,name:g,predicate:M?M[g]:void 0}:V(g)?{type:i.DEFAULT_GUARD_TYPE,name:g.name,predicate:g}:g}function j(g){try{return"subscribe"in g&&V(g.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(g){return!!g&&"__xstatenode"in g}function Y(g){return!!g&&typeof g.send=="function"}var ae=function(){var g=0;return function(){return g++,g.toString(16)}}();function de(g,M){return U(g)||typeof g=="number"?t.__assign({type:g},M):g}function he(g,M){if(!U(g)&&"$$type"in g&&g.$$type==="scxml")return g;var F=de(g);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},M)}function xe(g,M){var F=T(M).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:g}:t.__assign(t.__assign({},q),{event:g})});return F}function ke(g){if(!(g===void 0||g===i.TARGETLESS_KEY))return A(g)}function De(g,M,F){if(!o.IS_PRODUCTION){var q=g.stack?" Stacktrace was '".concat(g.stack,"'"):"";if(g===M)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(g,"'.").concat(q));else{var X=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(g,"'. ").concat(q," Current error is '").concat(M,"'.").concat(X))}}}function ht(g,M,F,q,X){var Z=g.options.guards,le={state:X,cond:M,_event:q};if(M.type===i.DEFAULT_GUARD_TYPE)return((Z==null?void 0:Z[M.name])||M.predicate)(F,q.data,le);var se=Z==null?void 0:Z[M.type];if(!se)throw new Error("Guard '".concat(M.type,"' is not implemented on machine '").concat(g.id,"'."));return se(F,q.data,le)}function ce(g){return typeof g=="string"?{type:g}:g}function Dn(g,M,F){var q=function(){},X=typeof g=="object",Z=X?g:null;return{next:((X?g.next:g)||q).bind(Z),error:((X?g.error:M)||q).bind(Z),complete:((X?g.complete:F)||q).bind(Z)}}function ii(g,M){return"".concat(g,":invocation[").concat(M,"]")}function qo(g){return(g.type===r.raise||g.type===r.send&&g.to===n.SpecialTargets.Internal)&&typeof g.delay!="number"}e.createInvokeId=ii,e.evaluateGuard=ht,e.flatten=b,e.getActionType=l,e.getEventType=c,e.interopSymbols=te,e.isActor=Y,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=V,e.isMachine=oe,e.isObservable=j,e.isPromiseLike=N,e.isRaisableAction=qo,e.isStateLike=d,e.isString=U,e.keys=s,e.mapContext=D,e.mapFilterValues=x,e.mapValues=v,e.matchesState=u,e.nestedPath=y,e.normalizeTarget=ke,e.partition=L,e.path=E,e.pathToStateValue=h,e.pathsToStateValue=w,e.reportUnhandledExceptionOnInvocation=De,e.symbolObservable=R,e.toArray=A,e.toArrayStrict=T,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=ce,e.toObserver=Dn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=S,e.toStateValue=p,e.toTransitionConfigArray=xe,e.uniqueId=ae,e.updateContext=k,e.updateHistoryStates=B,e.updateHistoryValue=K})(D0);Object.defineProperty(tt,"__esModule",{value:!0});var Ke=sv,lr=Ql,on=Vt,Fe=D0,N0=Zl,zM=Fe.toSCXMLEvent({type:on.init});function cp(e,t){return t&&t[e]||void 0}function ef(e,t){var n;if(Fe.isString(e)||typeof e=="number"){var r=cp(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=cp(e.type,t);if(Fe.isFunction(r))n=Ke.__assign(Ke.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Ke.__assign(Ke.__assign(Ke.__assign({},r),e),{type:i})}else n=e}return n}var lp=function(e,t){if(!e)return[];var n=Fe.isArray(e)?e:[e];return n.map(function(r){return ef(r,t)})};function uv(e){var t=ef(e);return Ke.__assign(Ke.__assign({id:Fe.isString(e)?e:t.id},t),{type:t.type})}function WM(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 P0(e,t,n,r){var i={_event:n},o=Fe.toSCXMLEvent(Fe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Fe.isString(e.delay)){var s=r&&r[e.delay];a=Fe.isFunction(s)?s(t,n.data,i):s}else a=Fe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return Ke.__assign(Ke.__assign({},e),{type:on.raise,_event:o,delay:a})}function bu(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 R0(e,t,n,r){var i={_event:n},o=Fe.toSCXMLEvent(Fe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Fe.isString(e.delay)){var s=r&&r[e.delay];a=Fe.isFunction(s)?s(t,n.data,i):s}else a=Fe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=Fe.isFunction(e.to)?e.to(t,n.data,i):e.to;return Ke.__assign(Ke.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function cv(e,t){return bu(e,Ke.__assign(Ke.__assign({},t),{to:lr.SpecialTargets.Parent}))}function HM(e,t,n){return bu(t,Ke.__assign(Ke.__assign({},n),{to:e}))}function KM(){return cv(on.update)}function YM(e,t){return bu(e,Ke.__assign(Ke.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var XM=function(e,t){return{context:e,event:t}};function JM(e,t){return e===void 0&&(e=XM),{type:on.log,label:t,expr:e}}var k0=function(e,t,n){return Ke.__assign(Ke.__assign({},e),{value:Fe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},QM=function(e){return{type:on.cancel,sendId:e}};function ZM(e){var t=uv(e);return{type:lr.ActionTypes.Start,activity:t,exec:void 0}}function ej(e){var t=Fe.isFunction(e)?e:uv(e);return{type:lr.ActionTypes.Stop,activity:t,exec:void 0}}function M0(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:lr.ActionTypes.Stop,activity:i};return o}var tj=function(e){return{type:on.assign,assignment:e}};function nj(e){return typeof e=="object"&&"type"in e}function rj(e,t){var n=t?"#".concat(t):"";return"".concat(lr.ActionTypes.After,"(").concat(e,")").concat(n)}function ij(e,t){var n="".concat(lr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function oj(e,t){var n="".concat(lr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function aj(e,t){var n="".concat(lr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function sj(e){return{type:lr.ActionTypes.Pure,get:e}}function uj(e,t){if(!N0.IS_PRODUCTION&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,Ke.__spreadArray([],Ke.__read(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return bu(function(r,i){return i},Ke.__assign(Ke.__assign({},t),{to:e}))}function cj(e,t){return cv(function(n,r,i){return{type:on.error,data:Fe.isFunction(e)?e(n,r,i):e}},Ke.__assign(Ke.__assign({},t),{to:lr.SpecialTargets.Parent}))}function lj(e){return{type:lr.ActionTypes.Choose,conds:e}}var fj=function(e){var t,n,r=[];try{for(var i=Ke.__values(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===on.assign){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function fp(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:fj(i),u=s.length?Fe.updateContext(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var x;switch(v.type){case on.raise:{var E=P0(v,u,r,e.options.delays);return o&&typeof E.delay=="number"&&o(E,u,r),E}case on.send:var y=R0(v,u,r,e.options.delays);if(!N0.IS_PRODUCTION){var S=v.delay;Fe.warn(!Fe.isString(S)||typeof y.delay=="number","No delay reference for delay expression '".concat(S,"' was found on machine '").concat(e.id,"'"))}return o&&y.to!==lr.SpecialTargets.Internal&&(h==="entry"?l.push(y):o(y,u,r)),y;case on.log:{var w=k0(v,u,r);return o==null||o(w,u,r),w}case on.choose:{var b=v,T=(x=b.conds.find(function(V){var U=Fe.toGuard(V.cond,e.options.guards);return!U||Fe.evaluateGuard(e,U,u,r,o?void 0:t)}))===null||x===void 0?void 0:x.actions;if(!T)return[];var A=Ke.__read(fp(e,t,u,r,[{type:h,actions:lp(Fe.toArray(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case on.pure:{var T=v.get(u,r.data);if(!T)return[];var N=Ke.__read(fp(e,t,u,r,[{type:h,actions:lp(Fe.toArray(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case on.stop:{var w=M0(v,u,r);return o==null||o(w,n,r),w}case on.assign:{u=Fe.updateContext(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var B=ef(v,e.options.actions),K=B.exec;if(o)o(B,u,r);else if(K&&c){var k=c.length-1,ie=Ke.__assign(Ke.__assign({},B),{exec:function(V){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];K.apply(void 0,Ke.__spreadArray([c[k]],Ke.__read(U),!1))}});B=ie}return B}}function d(h){var v,x,E=[];try{for(var y=Ke.__values(h.actions),S=y.next();!S.done;S=y.next()){var w=S.value,b=f(h.type,w);b&&(E=E.concat(b))}}catch(T){v={error:T}}finally{try{S&&!S.done&&(x=y.return)&&x.call(y)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,E}var p=Fe.flatten(i.map(d));return[p,u]}tt.actionTypes=on;tt.after=rj;tt.assign=tj;tt.cancel=QM;tt.choose=lj;tt.done=ij;tt.doneInvoke=oj;tt.error=aj;tt.escalate=cj;tt.forwardTo=uj;tt.getActionFunction=cp;tt.initEvent=zM;tt.isActionObject=nj;var Vn=tt.log=JM,dj=tt.pure=sj;tt.raise=WM;tt.resolveActions=fp;tt.resolveLog=k0;tt.resolveRaise=P0;tt.resolveSend=R0;tt.resolveStop=M0;tt.respond=YM;tt.send=bu;tt.sendParent=cv;tt.sendTo=HM;tt.sendUpdate=KM;tt.start=ZM;var ry=tt.stop=ej;tt.toActionObject=ef;tt.toActionObjects=lp;tt.toActivityDefinition=uv;function j0(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function tf(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 _0(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 iy(e){return e.constructor===Object||e.constructor==null}function oy(e){return typeof e.then=="function"}function nf(e,t){return e===t||e!==e&&t!==t}var pj="[object Arguments]",hj="[object Boolean]",vj="[object Date]",mj="[object RegExp]",yj="[object Map]",gj="[object Number]",bj="[object Object]",Sj="[object Set]",Cj="[object String]",ay=Object.prototype.toString;function rf(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.areRegExpsEqual,a=e.areSetsEqual,s=e.createIsNestedEqual,u=s(c);function c(l,f,d){if(l===f)return!0;if(!l||!f||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;if(iy(l)&&iy(f))return i(l,f,u,d);var p=Array.isArray(l),h=Array.isArray(f);if(p||h)return p===h&&t(l,f,u,d);var v=ay.call(l);return v!==ay.call(f)?!1:v===vj?n(l,f,u,d):v===mj?o(l,f,u,d):v===yj?r(l,f,u,d):v===Sj?a(l,f,u,d):v===bj||v===pj?oy(l)||oy(f)?!1:i(l,f,u,d):v===hj||v===gj||v===Cj?nf(l.valueOf(),f.valueOf()):!1}return c}function q0(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 wj=tf(q0);function F0(e,t){return nf(e.valueOf(),t.valueOf())}function L0(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={},a=0;return e.forEach(function(s,u){if(i){var c=!1,l=0;t.forEach(function(f,d){!c&&!o[l]&&(c=n(u,d,a,l,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[l]=!0),l++}),a++,i=c}}),i}var xj=tf(L0),Ej="_owner",Tj=Object.prototype.hasOwnProperty;function V0(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===Ej){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!Tj.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var Ij=tf(V0);function B0(e,t){return e.source===t.source&&e.flags===t.flags}function U0(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={};return e.forEach(function(a,s){if(i){var u=!1,c=0;t.forEach(function(l,f){!u&&!o[c]&&(u=n(a,l,s,f,e,t,r))&&(o[c]=!0),c++}),i=u}}),i}var Aj=tf(U0),G0=Object.freeze({areArraysEqual:q0,areDatesEqual:F0,areMapsEqual:L0,areObjectsEqual:V0,areRegExpsEqual:B0,areSetsEqual:U0,createIsNestedEqual:j0}),z0=Object.freeze({areArraysEqual:wj,areDatesEqual:F0,areMapsEqual:xj,areObjectsEqual:Ij,areRegExpsEqual:B0,areSetsEqual:Aj,createIsNestedEqual:j0}),$j=rf(G0);function Oj(e,t){return $j(e,t,void 0)}rf(_0(G0,{createIsNestedEqual:function(){return nf}}));rf(z0);rf(_0(z0,{createIsNestedEqual:function(){return nf}}));var dp={exports:{}},Of={},zu={exports:{}},Df={};/**
|
|
102
|
+
* @license React
|
|
103
|
+
* use-sync-external-store-shim.production.min.js
|
|
104
|
+
*
|
|
105
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the MIT license found in the
|
|
108
|
+
* LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/var sy;function Dj(){if(sy)return Df;sy=1;var e=O;function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(f,d){var p=d(),h=r({inst:{value:p,getSnapshot:d}}),v=h[0].inst,x=h[1];return o(function(){v.value=p,v.getSnapshot=d,u(v)&&x({inst:v})},[f,p,d]),i(function(){return u(v)&&x({inst:v}),f(function(){u(v)&&x({inst:v})})},[f]),a(p),p}function u(f){var d=f.getSnapshot;f=f.value;try{var p=d();return!n(f,p)}catch{return!0}}function c(f,d){return d()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return Df.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,Df}var Nf={};/**
|
|
110
|
+
* @license React
|
|
111
|
+
* use-sync-external-store-shim.development.js
|
|
112
|
+
*
|
|
113
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the MIT license found in the
|
|
116
|
+
* LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/var uy;function Nj(){return uy||(uy=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(S){{for(var w=arguments.length,b=new Array(w>1?w-1:0),T=1;T<w;T++)b[T-1]=arguments[T];r("error",S,b)}}function r(S,w,b){{var T=t.ReactDebugCurrentFrame,A=T.getStackAddendum();A!==""&&(w+="%s",b=b.concat([A]));var D=b.map(function(I){return String(I)});D.unshift("Warning: "+w),Function.prototype.apply.call(console[S],console,D)}}function i(S,w){return S===w&&(S!==0||1/S===1/w)||S!==S&&w!==w}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,c=e.useDebugValue,l=!1,f=!1;function d(S,w,b){l||e.startTransition!==void 0&&(l=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var T=w();if(!f){var A=w();o(T,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var D=a({inst:{value:T,getSnapshot:w}}),I=D[0].inst,N=D[1];return u(function(){I.value=T,I.getSnapshot=w,p(I)&&N({inst:I})},[S,T,w]),s(function(){p(I)&&N({inst:I});var _=function(){p(I)&&N({inst:I})};return S(_)},[S]),c(T),T}function p(S){var w=S.getSnapshot,b=S.value;try{var T=w();return!o(b,T)}catch{return!0}}function h(S,w,b){return w()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!v,E=x?h:d,y=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E;Nf.useSyncExternalStore=y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Nf}var cy;function W0(){return cy||(cy=1,process.env.NODE_ENV==="production"?zu.exports=Dj():zu.exports=Nj()),zu.exports}/**
|
|
118
|
+
* @license React
|
|
119
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
120
|
+
*
|
|
121
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the MIT license found in the
|
|
124
|
+
* LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/var ly;function Pj(){if(ly)return Of;ly=1;var e=O,t=W0();function n(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;return Of.useSyncExternalStoreWithSelector=function(c,l,f,d,p){var h=o(null);if(h.current===null){var v={hasValue:!1,value:null};h.current=v}else v=h.current;h=s(function(){function E(T){if(!y){if(y=!0,S=T,T=d(T),p!==void 0&&v.hasValue){var A=v.value;if(p(A,T))return w=A}return w=T}if(A=w,r(S,T))return A;var D=d(T);return p!==void 0&&p(A,D)?A:(S=T,w=D)}var y=!1,S,w,b=f===void 0?null:f;return[function(){return E(l())},b===null?void 0:function(){return E(b())}]},[l,f,d,p]);var x=i(c,h[0],h[1]);return a(function(){v.hasValue=!0,v.value=x},[x]),u(x),x},Of}var Pf={};/**
|
|
126
|
+
* @license React
|
|
127
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
128
|
+
*
|
|
129
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the MIT license found in the
|
|
132
|
+
* LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/var fy;function Rj(){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=W0();function n(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;function c(l,f,d,p,h){var v=o(null),x;v.current===null?(x={hasValue:!1,value:null},v.current=x):x=v.current;var E=s(function(){var b=!1,T,A,D=function(L){if(!b){b=!0,T=L;var B=p(L);if(h!==void 0&&x.hasValue){var K=x.value;if(h(K,B))return A=K,K}return A=B,B}var k=T,ie=A;if(r(k,L))return ie;var V=p(L);return h!==void 0&&h(ie,V)?ie:(T=L,A=V,V)},I=d===void 0?null:d,N=function(){return D(f())},_=I===null?void 0:function(){return D(I())};return[N,_]},[f,d,p,h]),y=E[0],S=E[1],w=i(l,y,S);return a(function(){x.hasValue=!0,x.value=w},[w]),u(w),w}Pf.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Pf}process.env.NODE_ENV==="production"?dp.exports=Pj():dp.exports=Rj();var kj=dp.exports,Mj=O.useLayoutEffect;function dy(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var Qc=globalThis&&globalThis.__assign||function(){return Qc=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},Qc.apply(this,arguments)},jj=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 qj(e,t){var n=dy(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,c=t.services,l=t.delays;t.state;var f=jj(t,["context","guards","actions","activities","services","delays","state"]),d=dy(function(){var p={context:o,guards:a,actions:s,activities:u,services:c,delays:l},h=n.withConfig(p,function(){return Qc(Qc({},n.context),o)});return $0(h,f)});return Mj(function(){Object.assign(d.machine.options.actions,s),Object.assign(d.machine.options.guards,a),Object.assign(d.machine.options.activities,u),Object.assign(d.machine.options.services,c),Object.assign(d.machine.options.delays,l)},[s,a,u,c,l]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function Fj(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 Lj=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 Vj(e){return e}function Bj(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Lj(t,1),i=r[0],o=i===void 0?{}:i,a=qj(e,o),s=O.useCallback(function(){return a.status===Dt.NotStarted?o.state?nr.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return Fj(a,f,d)},[a]),c=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),l=kj.useSyncExternalStoreWithSelector(c,s,s,Vj,u);return O.useEffect(function(){var f=o.state;return a.start(f?nr.create(f):void 0),function(){a.stop(),a.status=Dt.NotStarted}},[]),[l,a.send,a]}const H0=O.createContext(null),K0=O.createContext(null),Uj=O.createContext(null),Y0=O.createContext(null),lv=()=>O.useContext(H0),Wa=()=>O.useContext(Y0),X0="The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";function fv(e){if(!e)throw new Error(X0)}function Ha(e){if(!e)throw new Error(X0)}function Ui(){const e=lv();return fv(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var Gj=function(e){return e._tag==="Some"},of=function(e){return function(t){return Gj(e(t))}};const zj=of(e=>e.type===W.Choice?Re(e):me),Wj=of(e=>e.type===W.Numeric?Re(e):me),Hj=of(e=>e.type===W.Boolean?Re(e):me),Kj=of(e=>e.type===W.Component?Re(e):me);function af(e){return e.decision!=null&&e.decision.kind===$e.Explicit}function J0(e){return m(e.values,Wt(af),G(t=>({type:W.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function Yj(e){return m(e,mu(af),Q(()=>({type:W.Numeric,attributeId:e.id,state:null})))}function Xj(e){return m(e,mu(af),Q(()=>({type:W.Boolean,attributeId:e.id,state:null})))}function Jj(e){return m(e,mu(af),Q(()=>({type:W.Component,attributeId:e.id,state:null})))}function Qj(e,t){return m(Ua.filterAttributesOfComponent(t,e,!0),n=>[m(n,Wt(zj),lN(J0)),m(n,Wt(Wj),G(Yj),Yn),m(n,Wt(Hj),G(Xj),Yn),m(n,Wt(Kj),G(Jj),Yn)],Lh)}function Q0(){const e=lv();return fv(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 Su(e,t=!1){const n=Wa();return Ha(n),O.useMemo(()=>m(ye(e),Q(Jn(G(r=>Ua.getAttribute(n,r)),t?Mo(ye):Nr)),nt(()=>n.attributes)),[e,n,t])}function sf(e){const t=Wa(),{makeDecision:n,setManyDecision:r}=Ui(),i=uf(e,Qe.choiceValue);Ha(t);const o=Ua.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,c)=>n({type:W.Choice,attributeId:e,choiceValueId:u,state:c}),clearDecisions:m(o,ye,Q(J0),_t(Fa),Q(u=>()=>r(u,{type:"Default"})),nt(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function Zj(e){const t=Wa(),{makeDecision:n}=Ui(),r=uf(e,Qe.numeric);Ha(t);const i=Ua.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:W.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function e_(e){const t=Wa(),{makeDecision:n}=Ui(),r=uf(e,Qe.boolean);Ha(t);const i=Ua.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:W.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function t_(e){const t=Wa(),{makeDecision:n,setManyDecision:r}=Ui(),i=uf(e,Qe.component);Ha(t);const o=t.attributes,a=Ua.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:c=>n({type:W.Component,attributeId:e,state:c}),clearSubtree:m(Qj(e,o),mu(Fa),Q(c=>()=>r(c,{type:"Default"})),nt(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function uf(e,t){const{explain:n,applySolution:r}=Q0();return O.useMemo(()=>({explain:(i,o)=>{const a=H(i.question).with(qt.whyIsNotSatisfied,()=>Qe.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 py=Tn(d0),n_=Tn(wk),r_=Tn((e,t)=>PC(rt).equals(e??{},t??{})),i_=gn({attributeId:py,decisions:Li(py)}),o_=Tn((e,t)=>Li(i_).equals(e??[],t??[])),a_=gn({type:rt}),s_=gn({type:rt}),u_=gn({type:rt,rules:Li(n_)}),c_=Tn((e,t)=>H({x:e,y:t}).returnType().with({x:{type:pn.all},y:{type:pn.all}},({x:n,y:r})=>a_.equals(n,r)).with({x:{type:pn.none},y:{type:pn.none}},({x:n,y:r})=>s_.equals(n,r)).with({x:{type:pn.specific},y:{type:pn.specific}},({x:n,y:r})=>u_.equals(n,r)).otherwise(()=>!1)),l_=gn({rules:Kl(c_)}),Z0=gn({configurationModelSource:Tn((e,t)=>Oj(e,t)),attributeRelations:o_,usageRuleParameters:r_,allowedInExplain:Kl(l_)}),pp=Kl(Z0),f_=jh,wc=Kl(f_),d_=()=>av({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{desiredClient:null,desiredSessionContext:null,actualClient:null,session:null,sessionCreationError:null,sessionUpdateError:null,hasEverSuccessfullyCreatedSession:!1},initial:"ProcessChanges",on:{ChangeConfigurationClient:{actions:["saveDesiredClient"]},ChangeSessionContext:{actions:["saveDesiredSessionContext"]}},exit:[Vn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Vn("Entering ProcessChanges","SessionManagement:"),Ko(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Vn("Entering DisposeSession","SessionManagement:"),Ko(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Vn("Entering CreateSession","SessionManagement:"),Ko(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Vn("Entering SessionCreationFailed","SessionManagement:"),Ko(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Vn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Vn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Vn("Entering UpdateSession","SessionManagement:"),Ko(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Vn("Entering SessionUpdateFailed","SessionManagement:"),Ko(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Vn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Vn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Pn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Pn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Pn((e,t)=>(e.session&&e.session.close().then(Lr).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Pn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Pn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Pn({sessionCreationError:()=>null}),setSessionUpdateError:Pn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Pn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Pn({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:e=>e.desiredClient.createSession(e.desiredSessionContext).then(t=>({session:t,client:e.desiredClient})).catch(t=>Promise.reject({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||!wc.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!Z0.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!wc.equals(e.desiredClient,e.sessionCreationError.client)||!pp.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!wc.equals(e.desiredClient,e.actualClient)||!pp.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Ko(e){const t=e===0,n=e===1;return dj((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 O0({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const p_=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),h_=()=>av({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[O0((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Vn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Vn("Entering Subscribe","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{target:"ProcessChanges",cond:(e,t)=>t.session==null||e.session!==t.session,actions:["saveSession"]}},invoke:{id:"configurationSubscriptionActor",src:(e,t)=>p_(e.session)}}}},{actions:{saveSession:Pn((e,t)=>({session:t.session}))}}),v_=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},hy=()=>{const e=v_();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var m_=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]},vy=function(e,t,n,r){return O.useEffect(e,m_(t,n,r))};const y_=()=>av({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:hy()},entry:[Pn({sessionManagementActor:()=>ty(d_()),configurationSubscriptionManagementActor:()=>ty(h_())})],exit:[ry(e=>e.sessionManagementActor),ry(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[Gu(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[Gu(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[Gu(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[Gu(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Pn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),CM(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Pn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Pn((e,t)=>{var n;const r=!((n=e.sessionInitialization)!=null&&n.isInitializing)&&e.session!=null&&e.configuration!=null&&e.configuration.session===e.session;return e.isReadyPromise&&r&&(e.isReadyPromise.resolve(),e.isReadyPromise.capsule.promise=null),{isReadyPromise:(()=>r?null:e.isReadyPromise!=null?e.isReadyPromise:hy())()}})}});function g_(e){var t,n;const[r,i]=Bj(y_,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});vy(()=>{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],Rm(wc)),vy(()=>{const u=m(ye(e.sessionContext),IN(c=>ye(c.configurationModelSource)),Un);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],Rm(pp));const o=O.useMemo(()=>{var u,c,l,f;return{isInitializing:((c=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:c.promise)!=null,isInitializingPromise:(l=r.context.isReadyPromise)==null?void 0:l.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.failureResult)&&{...r.context.sessionInitialization.failureResult,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,c;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((c=r.context.sessionUpdating)==null?void 0:c.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 b_(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=g_({configuratorClient:t,sessionContext:n});return $.jsx(K0.Provider,{value:r,children:$.jsx(Uj.Provider,{value:i,children:$.jsx(H0.Provider,{value:o,children:$.jsx(Y0.Provider,{value:a,children:e.children})})})})}function dv(){return O.useContext(K0)}function S_(e){const{children:t}=e,{isInitializingPromise:n}=dv();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function ew(){const e=lv(),t=Wa();return fv(e),Ha(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const C_=O.createContext(null),Rf={didCatch:!1,error:null};class w_ extends O.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Rf}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(Rf)}}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&&x_(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(Rf)}}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(C_.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function x_(){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 En=function(){return En=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},En.apply(this,arguments)};function E_(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 Eo(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 T_(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var I_=/^((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)-.*))$/,A_=T_(function(e){return I_.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),gt="-ms-",Is="-moz-",at="-webkit-",tw="comm",cf="rule",pv="decl",$_="@import",nw="@keyframes",O_="@layer",D_=Math.abs,hv=String.fromCharCode,hp=Object.assign;function N_(e,t){return nn(e,0)^45?(((t<<2^nn(e,0))<<2^nn(e,1))<<2^nn(e,2))<<2^nn(e,3):0}function rw(e){return e.trim()}function _r(e,t){return(e=t.exec(e))?e[0]:e}function Me(e,t,n){return e.replace(t,n)}function xc(e,t){return e.indexOf(t)}function nn(e,t){return e.charCodeAt(t)|0}function Sa(e,t,n){return e.slice(t,n)}function Tr(e){return e.length}function iw(e){return e.length}function gs(e,t){return t.push(e),e}function P_(e,t){return e.map(t).join("")}function my(e,t){return e.filter(function(n){return!_r(n,t)})}var lf=1,Ca=1,ow=0,sr=0,Gt=0,Ka="";function ff(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:lf,column:Ca,length:a,return:"",siblings:s}}function di(e,t){return hp(ff("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Yo(e){for(;e.root;)e=di(e.root,{children:[e]});gs(e,e.siblings)}function R_(){return Gt}function k_(){return Gt=sr>0?nn(Ka,--sr):0,Ca--,Gt===10&&(Ca=1,lf--),Gt}function Sr(){return Gt=sr<ow?nn(Ka,sr++):0,Ca++,Gt===10&&(Ca=1,lf++),Gt}function ho(){return nn(Ka,sr)}function Ec(){return sr}function df(e,t){return Sa(Ka,e,t)}function vp(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 M_(e){return lf=Ca=1,ow=Tr(Ka=e),sr=0,[]}function j_(e){return Ka="",e}function kf(e){return rw(df(sr-1,mp(e===91?e+2:e===40?e+1:e)))}function __(e){for(;(Gt=ho())&&Gt<33;)Sr();return vp(e)>2||vp(Gt)>3?"":" "}function q_(e,t){for(;--t&&Sr()&&!(Gt<48||Gt>102||Gt>57&&Gt<65||Gt>70&&Gt<97););return df(e,Ec()+(t<6&&ho()==32&&Sr()==32))}function mp(e){for(;Sr();)switch(Gt){case e:return sr;case 34:case 39:e!==34&&e!==39&&mp(Gt);break;case 40:e===41&&mp(e);break;case 92:Sr();break}return sr}function F_(e,t){for(;Sr()&&e+Gt!==47+10;)if(e+Gt===42+42&&ho()===47)break;return"/*"+df(t,sr-1)+"*"+hv(e===47?e:Sr())}function L_(e){for(;!vp(ho());)Sr();return df(e,sr)}function V_(e){return j_(Tc("",null,null,null,[""],e=M_(e),0,[0],e))}function Tc(e,t,n,r,i,o,a,s,u){for(var c=0,l=0,f=a,d=0,p=0,h=0,v=1,x=1,E=1,y=0,S="",w=i,b=o,T=r,A=S;x;)switch(h=y,y=Sr()){case 40:if(h!=108&&nn(A,f-1)==58){xc(A+=Me(kf(y),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:A+=kf(y);break;case 9:case 10:case 13:case 32:A+=__(h);break;case 92:A+=q_(Ec()-1,7);continue;case 47:switch(ho()){case 42:case 47:gs(B_(F_(Sr(),Ec()),t,n,u),u);break;default:A+="/"}break;case 123*v:s[c++]=Tr(A)*E;case 125*v:case 59:case 0:switch(y){case 0:case 125:x=0;case 59+l:E==-1&&(A=Me(A,/\f/g,"")),p>0&&Tr(A)-f&&gs(p>32?gy(A+";",r,n,f-1,u):gy(Me(A," ","")+";",r,n,f-2,u),u);break;case 59:A+=";";default:if(gs(T=yy(A,t,n,c,l,i,s,S,w=[],b=[],f,o),o),y===123)if(l===0)Tc(A,t,T,T,w,o,f,s,b);else switch(d===99&&nn(A,3)===110?100:d){case 100:case 108:case 109:case 115:Tc(e,T,T,r&&gs(yy(e,T,T,0,0,i,s,S,i,w=[],f,b),b),i,b,f,s,r?w:b);break;default:Tc(A,T,T,T,[""],b,0,s,b)}}c=l=p=0,v=E=1,S=A="",f=a;break;case 58:f=1+Tr(A),p=h;default:if(v<1){if(y==123)--v;else if(y==125&&v++==0&&k_()==125)continue}switch(A+=hv(y),y*v){case 38:E=l>0?1:(A+="\f",-1);break;case 44:s[c++]=(Tr(A)-1)*E,E=1;break;case 64:ho()===45&&(A+=kf(Sr())),d=ho(),l=f=Tr(S=A+=L_(Ec())),y++;break;case 45:h===45&&Tr(A)==2&&(v=0)}}return o}function yy(e,t,n,r,i,o,a,s,u,c,l,f){for(var d=i-1,p=i===0?o:[""],h=iw(p),v=0,x=0,E=0;v<r;++v)for(var y=0,S=Sa(e,d+1,d=D_(x=a[v])),w=e;y<h;++y)(w=rw(x>0?p[y]+" "+S:Me(S,/&\f/g,p[y])))&&(u[E++]=w);return ff(e,t,n,i===0?cf:s,u,c,l,f)}function B_(e,t,n,r){return ff(e,t,n,tw,hv(R_()),Sa(e,2,-2),0,r)}function gy(e,t,n,r,i){return ff(e,t,n,pv,Sa(e,0,r),Sa(e,r+1,-1),r,i)}function aw(e,t,n){switch(N_(e,t)){case 5103:return at+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return at+e+e;case 4789:return Is+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return at+e+Is+e+gt+e+e;case 5936:switch(nn(e,t+11)){case 114:return at+e+gt+Me(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return at+e+gt+Me(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return at+e+gt+Me(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return at+e+gt+e+e;case 6165:return at+e+gt+"flex-"+e+e;case 5187:return at+e+Me(e,/(\w+).+(:[^]+)/,at+"box-$1$2"+gt+"flex-$1$2")+e;case 5443:return at+e+gt+"flex-item-"+Me(e,/flex-|-self/g,"")+(_r(e,/flex-|baseline/)?"":gt+"grid-row-"+Me(e,/flex-|-self/g,""))+e;case 4675:return at+e+gt+"flex-line-pack"+Me(e,/align-content|flex-|-self/g,"")+e;case 5548:return at+e+gt+Me(e,"shrink","negative")+e;case 5292:return at+e+gt+Me(e,"basis","preferred-size")+e;case 6060:return at+"box-"+Me(e,"-grow","")+at+e+gt+Me(e,"grow","positive")+e;case 4554:return at+Me(e,/([^-])(transform)/g,"$1"+at+"$2")+e;case 6187:return Me(Me(Me(e,/(zoom-|grab)/,at+"$1"),/(image-set)/,at+"$1"),e,"")+e;case 5495:case 3959:return Me(e,/(image-set\([^]*)/,at+"$1$`$1");case 4968:return Me(Me(e,/(.+:)(flex-)?(.*)/,at+"box-pack:$3"+gt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+at+e+e;case 4200:if(!_r(e,/flex-|baseline/))return gt+"grid-column-align"+Sa(e,t)+e;break;case 2592:case 3360:return gt+Me(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,_r(r.props,/grid-\w+-end/)})?~xc(e+(n=n[t].value),"span")?e:gt+Me(e,"-start","")+e+gt+"grid-row-span:"+(~xc(n,"span")?_r(n,/\d+/):+_r(n,/\d+/)-+_r(e,/\d+/))+";":gt+Me(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return _r(r.props,/grid-\w+-start/)})?e:gt+Me(Me(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Me(e,/(.+)-inline(.+)/,at+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Tr(e)-1-t>6)switch(nn(e,t+1)){case 109:if(nn(e,t+4)!==45)break;case 102:return Me(e,/(.+:)(.+)-([^]+)/,"$1"+at+"$2-$3$1"+Is+(nn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~xc(e,"stretch")?aw(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,c){return gt+i+":"+o+c+(a?gt+i+"-span:"+(s?u:+u-+o)+c:"")+e});case 4949:if(nn(e,t+6)===121)return Me(e,":",":"+at)+e;break;case 6444:switch(nn(e,nn(e,14)===45?18:11)){case 120:return Me(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+at+(nn(e,14)===45?"inline-":"")+"box$3$1"+at+"$2$3$1"+gt+"$2box$3")+e;case 100:return Me(e,":",":"+gt)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Me(e,"scroll-","scroll-snap-")+e}return e}function Zc(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function U_(e,t,n,r){switch(e.type){case O_:if(e.children.length)break;case $_:case pv:return e.return=e.return||e.value;case tw:return"";case nw:return e.return=e.value+"{"+Zc(e.children,r)+"}";case cf:if(!Tr(e.value=e.props.join(",")))return""}return Tr(n=Zc(e.children,r))?e.return=e.value+"{"+n+"}":""}function G_(e){var t=iw(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 z_(e){return function(t){t.root||(t=t.return)&&e(t)}}function W_(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case pv:e.return=aw(e.value,e.length,n);return;case nw:return Zc([di(e,{value:Me(e.value,"@","@"+at)})],r);case cf:if(e.length)return P_(n=e.props,function(i){switch(_r(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Yo(di(e,{props:[Me(i,/:(read-\w+)/,":"+Is+"$1")]})),Yo(di(e,{props:[i]})),hp(e,{props:my(n,r)});break;case"::placeholder":Yo(di(e,{props:[Me(i,/:(plac\w+)/,":"+at+"input-$1")]})),Yo(di(e,{props:[Me(i,/:(plac\w+)/,":"+Is+"$1")]})),Yo(di(e,{props:[Me(i,/:(plac\w+)/,gt+"input-$1")]})),Yo(di(e,{props:[i]})),hp(e,{props:my(n,r)});break}return""})}}var H_={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},To=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",vv=typeof window<"u"&&"HTMLElement"in window,K_=!!(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"),Y_={},by=/invalid hook call/i,Wu=new Set,sw=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
|
+
`)+`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];by.test(a)?(o=!1,Wu.delete(r)):i.apply(void 0,Eo([a],s,!1))},O.useRef(),o&&!Wu.has(r)&&(console.warn(r),Wu.add(r))}catch(a){by.test(a.message)&&Wu.delete(r)}finally{console.error=i}}},pf=Object.freeze([]),wa=Object.freeze({});function uw(e,t,n){return n===void 0&&(n=wa),e.theme!==n.theme&&e.theme||t||n.theme}var yp=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"]),X_=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,J_=/(^-|-$)/g;function Sy(e){return e.replace(X_,"-").replace(J_,"")}var Q_=/(a)(d)/gi,Cy=function(e){return String.fromCharCode(e+(e>25?39:97))};function gp(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Cy(t%52)+n;return(Cy(t%52)+n).replace(Q_,"$1-$2")}var Mf,oo=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},cw=function(e){return oo(5381,e)};function lw(e){return gp(cw(e)>>>0)}function fw(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 dw=typeof Symbol=="function"&&Symbol.for,pw=dw?Symbol.for("react.memo"):60115,Z_=dw?Symbol.for("react.forward_ref"):60112,eq={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},tq={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},hw={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},nq=((Mf={})[Z_]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Mf[pw]=hw,Mf);function wy(e){return("type"in(t=e)&&t.type.$$typeof)===pw?hw:"$$typeof"in e?nq[e.$$typeof]:eq;var t}var rq=Object.defineProperty,iq=Object.getOwnPropertyNames,xy=Object.getOwnPropertySymbols,oq=Object.getOwnPropertyDescriptor,aq=Object.getPrototypeOf,Ey=Object.prototype;function vw(e,t,n){if(typeof t!="string"){if(Ey){var r=aq(t);r&&r!==Ey&&vw(e,r,n)}var i=iq(t);xy&&(i=i.concat(xy(t)));for(var o=wy(e),a=wy(t),s=0;s<i.length;++s){var u=i[s];if(!(u in tq||n&&n[u]||a&&u in a||o&&u in o)){var c=oq(t,u);try{rq(e,u,c)}catch{}}}}return e}function xa(e){return typeof e=="function"}function mv(e){return typeof e=="object"&&"styledComponentId"in e}function ao(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function bp(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 Ea(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Sp(e,t,n){if(n===void 0&&(n=!1),!n&&!Ea(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Sp(e[r],t[r]);else if(Ea(t))for(var r in t)e[r]=Sp(e[r],t[r]);return e}function yv(e,t){Object.defineProperty(e,"toString",{value:t})}var sq=process.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
|
|
136
|
+
|
|
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
|
+
|
|
139
|
+
- Are you trying to reuse it across renders?
|
|
140
|
+
- Are you accidentally calling collectStyles twice?
|
|
141
|
+
|
|
142
|
+
`,3:`Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.
|
|
143
|
+
|
|
144
|
+
`,4:`The \`StyleSheetManager\` expects a valid target or sheet prop!
|
|
145
|
+
|
|
146
|
+
- Does this error occur on the client and is your target falsy?
|
|
147
|
+
- Does this error occur on the server and is the sheet falsy?
|
|
148
|
+
|
|
149
|
+
`,5:`The clone method cannot be used on the client!
|
|
150
|
+
|
|
151
|
+
- Are you running in a client-like environment on the server?
|
|
152
|
+
- Are you trying to run SSR on the client?
|
|
153
|
+
|
|
154
|
+
`,6:`Trying to insert a new style tag, but the given Node is unmounted!
|
|
155
|
+
|
|
156
|
+
- Are you using a custom target that isn't mounted?
|
|
157
|
+
- Does your document not have a valid head element?
|
|
158
|
+
- Have you accidentally removed a style tag manually?
|
|
159
|
+
|
|
160
|
+
`,7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:`ThemeProvider: Please make your "theme" prop an object.
|
|
161
|
+
|
|
162
|
+
`,9:"Missing document `<head>`\n\n",10:`Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021
|
|
163
|
+
|
|
164
|
+
`,11:`_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.
|
|
165
|
+
|
|
166
|
+
`,12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:`%s 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.
|
|
167
|
+
|
|
168
|
+
`,14:`ThemeProvider: "theme" prop is required.
|
|
169
|
+
|
|
170
|
+
`,15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:`Reached the limit of how many styled components may be created at group %s.
|
|
171
|
+
You may only create up to 1,073,741,824 components. If you're creating components dynamically,
|
|
172
|
+
as for instance in your render method then you may be running into this limitation.
|
|
173
|
+
|
|
174
|
+
`,17:`CSSStyleSheet could not be found on HTMLStyleElement.
|
|
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 uq(){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 Ya(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(uq.apply(void 0,Eo([sq[e]],t,!1)).trim())}var cq=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 Ya(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}(),Ic=new Map,el=new Map,Ac=1,Hu=function(e){if(Ic.has(e))return Ic.get(e);for(;el.has(Ac);)Ac++;var t=Ac++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>1073741824))throw Ya(16,"".concat(t));return Ic.set(e,t),el.set(t,e),t},lq=function(e,t){Ac=t+1,Ic.set(e,t),el.set(t,e)},fq="style[".concat(To,"][").concat("data-styled-version",'="').concat("6.1.1",'"]'),dq=new RegExp("^".concat(To,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),pq=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)},hq=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(dq);if(u){var c=0|parseInt(u[1],10),l=u[2];c!==0&&(lq(l,c),pq(e,l,u[3]),e.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}};function vq(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var mw=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(s){var u=Array.from(s.querySelectorAll("style[".concat(To,"]")));return u[u.length-1]}(n),o=i!==void 0?i.nextSibling:null;r.setAttribute(To,"active"),r.setAttribute("data-styled-version","6.1.1");var a=vq();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},mq=function(){function e(t){this.element=mw(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 Ya(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}(),yq=function(){function e(t){this.element=mw(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}(),gq=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}(),Ty=vv,bq={isServer:!vv,useCSSOMInjection:!K_},tl=function(){function e(t,n,r){t===void 0&&(t=wa),n===void 0&&(n={});var i=this;this.options=En(En({},bq),t),this.gs=n,this.names=new Map(r),this.server=!!t.isServer,!this.server&&vv&&Ty&&(Ty=!1,function(o){for(var a=document.querySelectorAll(fq),s=0,u=a.length;s<u;s++){var c=a[s];c&&c.getAttribute(To)!=="active"&&(hq(o,c),c.parentNode&&c.parentNode.removeChild(c))}}(this)),yv(this,function(){return function(o){for(var a=o.getTag(),s=a.length,u="",c=function(f){var d=function(E){return el.get(E)}(f);if(d===void 0)return"continue";var p=o.names.get(d),h=a.getGroup(f);if(p===void 0||h.length===0)return"continue";var v="".concat(To,".g").concat(f,'[id="').concat(d,'"]'),x="";p!==void 0&&p.forEach(function(E){E.length>0&&(x+="".concat(E,","))}),u+="".concat(h).concat(v,'{content:"').concat(x,'"}').concat(`/*!sc*/
|
|
179
|
+
`)},l=0;l<s;l++)c(l);return u}(i)})}return e.registerId=function(t){return Hu(t)},e.prototype.reconstructWithOptions=function(t,n){return n===void 0&&(n=!0),new e(En(En({},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 gq(i):r?new mq(i):new yq(i)}(this.options),new cq(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(Hu(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(Hu(t),r)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(Hu(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Sq=/&/g,Cq=/^\s*\/\/.*$/gm;function yw(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=yw(n.children,t)),n})}function wq(e){var t,n,r,i=e===void 0?wa:e,o=i.options,a=o===void 0?wa:o,s=i.plugins,u=s===void 0?pf:s,c=function(d,p,h){return h===n||h.startsWith(n)&&h.endsWith(n)&&h.replaceAll(n,"").length>0?".".concat(t):d},l=u.slice();l.push(function(d){d.type===cf&&d.value.includes("&")&&(d.props[0]=d.props[0].replace(Sq,n).replace(r,c))}),a.prefix&&l.push(W_),l.push(U_);var f=function(d,p,h,v){p===void 0&&(p=""),h===void 0&&(h=""),v===void 0&&(v="&"),t=v,n=p,r=new RegExp("\\".concat(n,"\\b"),"g");var x=d.replace(Cq,""),E=V_(h||p?"".concat(h," ").concat(p," { ").concat(x," }"):x);a.namespace&&(E=yw(E,a.namespace));var y=[];return Zc(E,G_(l.concat(z_(function(S){return y.push(S)})))),y};return f.hash=u.length?u.reduce(function(d,p){return p.name||Ya(15),oo(d,p.name)},5381).toString():"",f}var xq=new tl,Cp=wq(),gw=O.createContext({shouldForwardProp:void 0,styleSheet:xq,stylis:Cp});gw.Consumer;O.createContext(void 0);function wp(){return O.useContext(gw)}var Iy=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=Cp);var a=r.name+o.hash;i.hasNameForId(r.id,a)||i.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,yv(this,function(){throw Ya(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Cp),this.name+t.hash},e}(),Eq=function(e){return e>="A"&&e<="Z"};function Ay(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(n===1&&r==="-"&&e[0]==="-")return e;Eq(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var bw=function(e){return e==null||e===!1||e===""},Sw=function(e){var t,n,r=[];for(var i in e){var o=e[i];e.hasOwnProperty(i)&&!bw(o)&&(Array.isArray(o)&&o.isCss||xa(o)?r.push("".concat(Ay(i),":"),o,";"):Ea(o)?r.push.apply(r,Eo(Eo(["".concat(i," {")],Sw(o),!1),["}"],!1)):r.push("".concat(Ay(i),": ").concat((t=i,(n=o)==null||typeof n=="boolean"||n===""?"":typeof n!="number"||n===0||t in H_||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Ei(e,t,n,r){if(bw(e))return[];if(mv(e))return[".".concat(e.styledComponentId)];if(xa(e)){if(!xa(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 Iy||Ea(i)||i===null||console.error("".concat(fw(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.")),Ei(i,t,n,r)}var o;return e instanceof Iy?n?(e.inject(n,r),[e.getName(r)]):[e]:Ea(e)?Sw(e):Array.isArray(e)?Array.prototype.concat.apply(pf,e.map(function(a){return Ei(a,t,n,r)})):[e.toString()]}function Cw(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(xa(n)&&!mv(n))return!1}return!0}var Tq=cw("6.1.1"),Iq=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(r===void 0||r.isStatic)&&Cw(t),this.componentId=n,this.baseHash=oo(Tq,n),this.baseStyle=r,tl.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=ao(i,this.staticRulesId);else{var o=bp(Ei(this.rules,t,n,r)),a=gp(oo(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=ao(i,a),this.staticRulesId=a}else{for(var u=oo(this.baseHash,r.hash),c="",l=0;l<this.rules.length;l++){var f=this.rules[l];if(typeof f=="string")c+=f,process.env.NODE_ENV!=="production"&&(u=oo(u,f));else if(f){var d=bp(Ei(f,t,n,r));u=oo(u,d+l),c+=d}}if(c){var p=gp(u>>>0);n.hasNameForId(this.componentId,p)||n.insertRules(this.componentId,p,r(c,".".concat(p),void 0,this.componentId)),i=ao(i,p)}}return i},e}(),gv=O.createContext(void 0);gv.Consumer;var _f={},$y=new Set;function Aq(e,t,n){var r=mv(e),i=e,o=!jf(e),a=t.attrs,s=a===void 0?pf:a,u=t.componentId,c=u===void 0?function(w,b){var T=typeof w!="string"?"sc":Sy(w);_f[T]=(_f[T]||0)+1;var A="".concat(T,"-").concat(lw("6.1.1"+T+_f[T]));return b?"".concat(b,"-").concat(A):A}(t.displayName,t.parentComponentId):u,l=t.displayName,f=l===void 0?function(w){return jf(w)?"styled.".concat(w):"Styled(".concat(fw(w),")")}(e):l,d=t.displayName&&t.componentId?"".concat(Sy(t.displayName),"-").concat(t.componentId):t.componentId||c,p=r&&i.attrs?i.attrs.concat(s).filter(Boolean):s,h=t.shouldForwardProp;if(r&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var x=t.shouldForwardProp;h=function(w,b){return v(w,b)&&x(w,b)}}else h=v}var E=new Iq(n,d,r?i.componentStyle:void 0);function y(w,b){return function(T,A,D){var I=T.attrs,N=T.componentStyle,_=T.defaultProps,L=T.foldedComponentIds,B=T.styledComponentId,K=T.target,k=O.useContext(gv),ie=wp(),V=T.shouldForwardProp||ie.shouldForwardProp;process.env.NODE_ENV!=="production"&&O.useDebugValue(B);var U=function(Y,ae,de){for(var he,xe=En(En({},ae),{className:void 0,theme:de}),ke=0;ke<Y.length;ke+=1){var De=xa(he=Y[ke])?he(xe):he;for(var ht in De)xe[ht]=ht==="className"?ao(xe[ht],De[ht]):ht==="style"?En(En({},xe[ht]),De[ht]):De[ht]}return ae.className&&(xe.className=ao(xe.className,ae.className)),xe}(I,A,uw(A,k,_)||wa),fe=U.as||K,j={};for(var R in U)U[R]===void 0||R[0]==="$"||R==="as"||R==="theme"||(R==="forwardedAs"?j.as=U.forwardedAs:V&&!V(R,fe)||(j[R]=U[R],V||process.env.NODE_ENV!=="development"||A_(R)||$y.has(R)||!yp.has(fe)||($y.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(Y,ae){var de=wp(),he=Y.generateAndInjectStyles(ae,de.styleSheet,de.stylis);return process.env.NODE_ENV!=="production"&&O.useDebugValue(he),he}(N,U);process.env.NODE_ENV!=="production"&&T.warnTooManyClasses&&T.warnTooManyClasses(te);var oe=ao(L,B);return te&&(oe+=" "+te),U.className&&(oe+=" "+U.className),j[jf(fe)&&!yp.has(fe)?"class":"className"]=oe,j.ref=D,O.createElement(fe,j)}(S,w,b)}y.displayName=f;var S=O.forwardRef(y);return S.attrs=p,S.componentStyle=E,S.displayName=f,S.shouldForwardProp=h,S.foldedComponentIds=r?ao(i.foldedComponentIds,i.styledComponentId):"",S.styledComponentId=d,S.target=r?i.target:e,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(w){this._foldedDefaultProps=r?function(b){for(var T=[],A=1;A<arguments.length;A++)T[A-1]=arguments[A];for(var D=0,I=T;D<I.length;D++)Sp(b,I[D],!0);return b}({},i.defaultProps,w):w}}),process.env.NODE_ENV!=="production"&&(sw(f,d),S.warnTooManyClasses=function(w,b){var T={},A=!1;return function(D){if(!A&&(T[D]=!0,Object.keys(T).length>=200)){var I=b?' with the id of "'.concat(b,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(w).concat(I,`.
|
|
180
|
+
`)+`Consider using the attrs method, together with a style object for frequently changed styles.
|
|
181
|
+
Example:
|
|
182
|
+
const Component = styled.div.attrs(props => ({
|
|
183
|
+
style: {
|
|
184
|
+
background: props.background,
|
|
185
|
+
},
|
|
186
|
+
}))\`width: 100%;\`
|
|
187
|
+
|
|
188
|
+
<Component />`),A=!0,T={}}}}(f,d)),yv(S,function(){return".".concat(S.styledComponentId)}),o&&vw(S,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),S}function Oy(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 Dy=function(e){return Object.assign(e,{isCss:!0})};function bv(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(xa(e)||Ea(e)){var r=e;return Dy(Ei(Oy(pf,Eo([r],t,!0))))}var i=e;return t.length===0&&i.length===1&&typeof i[0]=="string"?Ei(i):Dy(Ei(Oy(i,t)))}function xp(e,t,n){if(n===void 0&&(n=wa),!t)throw Ya(1,t);var r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return e(t,n,bv.apply(void 0,Eo([i],o,!1)))};return r.attrs=function(i){return xp(e,t,En(En({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return xp(e,t,En(En({},n),i))},r}var ww=function(e){return xp(Aq,e)},Ie=ww;yp.forEach(function(e){Ie[e]=ww(e)});var $q=function(){function e(t,n){this.rules=t,this.componentId=n,this.isStatic=Cw(t),tl.registerId(this.componentId+1)}return e.prototype.createStyles=function(t,n,r,i){var o=i(bp(Ei(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&&tl.registerId(this.componentId+t),this.removeStyles(t,r),this.createStyles(t,n,r,i)},e}();function Cu(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=bv.apply(void 0,Eo([e],t,!1)),i="sc-global-".concat(lw(JSON.stringify(r))),o=new $q(r,i);process.env.NODE_ENV!=="production"&&sw(i);var a=function(u){var c=wp(),l=O.useContext(gv),f=O.useRef(c.styleSheet.allocateGSInstance(i)).current;return process.env.NODE_ENV!=="production"&&O.Children.count(u.children)&&console.warn("The global style component ".concat(i," was given child JSX. createGlobalStyle does not render children.")),process.env.NODE_ENV!=="production"&&r.some(function(d){return typeof d=="string"&&d.indexOf("@import")!==-1})&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),c.styleSheet.server&&s(f,u,c.styleSheet,l,c.stylis),O.useLayoutEffect(function(){if(!c.styleSheet.server)return s(f,u,c.styleSheet,l,c.stylis),function(){return o.removeStyles(f,c.styleSheet)}},[f,u,c.styleSheet,l,c.stylis]),null};function s(u,c,l,f,d){if(o.isStatic)o.renderStyles(u,Y_,l,d);else{var p=En(En({},c),{theme:uw(c,f,a.defaultProps)});o.renderStyles(u,p,l,d)}}return O.memo(a)}process.env.NODE_ENV!=="production"&&typeof navigator<"u"&&navigator.product==="ReactNative"&&console.warn(`It looks like you've imported 'styled-components' on React Native.
|
|
189
|
+
Perhaps you're looking to import 'styled-components/native'?
|
|
190
|
+
Read more about this at https://www.styled-components.com/docs/basics#react-native`);var Ku="__sc-".concat(To,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[Ku]||(window[Ku]=0),window[Ku]===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
|
+
|
|
192
|
+
See https://s-c.sh/2BAXzed for more info.`),window[Ku]+=1);var Oq={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"]},Dq={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"]},xw={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 Ny(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?Ny(Object(n),!0).forEach(function(r){Qt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ny(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nl(e){"@babel/helpers - typeof";return nl=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},nl(e)}function Nq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Py(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 Pq(e,t,n){return t&&Py(e.prototype,t),n&&Py(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sv(e,t){return kq(e)||jq(e,t)||Ew(e,t)||qq()}function wu(e){return Rq(e)||Mq(e)||Ew(e)||_q()}function Rq(e){if(Array.isArray(e))return Ep(e)}function kq(e){if(Array.isArray(e))return e}function Mq(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jq(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 Ew(e,t){if(e){if(typeof e=="string")return Ep(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 Ep(e,t)}}function Ep(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 _q(){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 qq(){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 Ry=function(){},Cv={},Tw={},Iw=null,Aw={mark:Ry,measure:Ry};try{typeof window<"u"&&(Cv=window),typeof document<"u"&&(Tw=document),typeof MutationObserver<"u"&&(Iw=MutationObserver),typeof performance<"u"&&(Aw=performance)}catch{}var Fq=Cv.navigator||{},ky=Fq.userAgent,My=ky===void 0?"":ky,Ri=Cv,wt=Tw,jy=Iw,Yu=Aw;Ri.document;var ni=!!wt.documentElement&&!!wt.head&&typeof wt.addEventListener=="function"&&typeof wt.createElement=="function",$w=~My.indexOf("MSIE")||~My.indexOf("Trident/"),Xu,Ju,Qu,Zu,ec,Xr="___FONT_AWESOME___",Tp=16,Ow="fa",Dw="svg-inline--fa",Io="data-fa-i2svg",Ip="data-fa-pseudo-element",Lq="data-fa-pseudo-element-pending",wv="data-prefix",xv="data-icon",_y="fontawesome-i2svg",Vq="async",Bq=["HTML","HEAD","STYLE","SCRIPT"],Nw=function(){try{return process.env.NODE_ENV==="production"}catch{return!1}}(),St="classic",Rt="sharp",Ev=[St,Rt];function xu(e){return new Proxy(e,{get:function(n,r){return r in n?n[r]:n[St]}})}var Ys=xu((Xu={},Qt(Xu,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"}),Qt(Xu,Rt,{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"}),Xu)),Xs=xu((Ju={},Qt(Ju,St,{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab",kit:"fak"}),Qt(Ju,Rt,{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"}),Ju)),Js=xu((Qu={},Qt(Qu,St,{fab:"fa-brands",fad:"fa-duotone",fak:"fa-kit",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"}),Qt(Qu,Rt,{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"}),Qu)),Uq=xu((Zu={},Qt(Zu,St,{"fa-brands":"fab","fa-duotone":"fad","fa-kit":"fak","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"}),Qt(Zu,Rt,{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"}),Zu)),Gq=/fa(s|r|l|t|d|b|k|ss|sr|sl|st)?[\-\ ]/,Pw="fa-layers-text",zq=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i,Wq=xu((ec={},Qt(ec,St,{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"}),Qt(ec,Rt,{900:"fass",400:"fasr",300:"fasl",100:"fast"}),ec)),Rw=[1,2,3,4,5,6,7,8,9,10],Hq=Rw.concat([11,12,13,14,15,16,17,18,19,20]),Kq=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],so={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Qs=new Set;Object.keys(Xs[St]).map(Qs.add.bind(Qs));Object.keys(Xs[Rt]).map(Qs.add.bind(Qs));var Yq=[].concat(Ev,wu(Qs),["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",so.GROUP,so.SWAP_OPACITY,so.PRIMARY,so.SECONDARY]).concat(Rw.map(function(e){return"".concat(e,"x")})).concat(Hq.map(function(e){return"w-".concat(e)})),As=Ri.FontAwesomeConfig||{};function Xq(e){var t=wt.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function Jq(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}if(wt&&typeof wt.querySelector=="function"){var Qq=[["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"]];Qq.forEach(function(e){var t=Sv(e,2),n=t[0],r=t[1],i=Jq(Xq(n));i!=null&&(As[r]=i)})}var kw={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ow,replacementClass:Dw,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};As.familyPrefix&&(As.cssPrefix=As.familyPrefix);var Ta=pe(pe({},kw),As);Ta.autoReplaceSvg||(Ta.observeMutations=!1);var ve={};Object.keys(kw).forEach(function(e){Object.defineProperty(ve,e,{enumerable:!0,set:function(n){Ta[e]=n,$s.forEach(function(r){return r(ve)})},get:function(){return Ta[e]}})});Object.defineProperty(ve,"familyPrefix",{enumerable:!0,set:function(t){Ta.cssPrefix=t,$s.forEach(function(n){return n(ve)})},get:function(){return Ta.cssPrefix}});Ri.FontAwesomeConfig=ve;var $s=[];function Zq(e){return $s.push(e),function(){$s.splice($s.indexOf(e),1)}}var si=Tp,Ir={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function eF(e){if(!(!e||!ni)){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 tF="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function Zs(){for(var e=12,t="";e-- >0;)t+=tF[Math.random()*62|0];return t}function Xa(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function Tv(e){return e.classList?Xa(e.classList):(e.getAttribute("class")||"").split(" ").filter(function(t){return t})}function Mw(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function nF(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,'="').concat(Mw(e[n]),'" ')},"").trim()}function hf(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,": ").concat(e[n].trim(),";")},"")}function Iv(e){return e.size!==Ir.size||e.x!==Ir.x||e.y!==Ir.y||e.rotate!==Ir.rotate||e.flipX||e.flipY}function rF(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,i={transform:"translate(".concat(n/2," 256)")},o="translate(".concat(t.x*32,", ").concat(t.y*32,") "),a="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)"),u={transform:"".concat(o," ").concat(a," ").concat(s)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:u,path:c}}function iF(e){var t=e.transform,n=e.width,r=n===void 0?Tp:n,i=e.height,o=i===void 0?Tp:i,a=e.startCentered,s=a===void 0?!1:a,u="";return s&&$w?u+="translate(".concat(t.x/si-r/2,"em, ").concat(t.y/si-o/2,"em) "):s?u+="translate(calc(-50% + ".concat(t.x/si,"em), calc(-50% + ").concat(t.y/si,"em)) "):u+="translate(".concat(t.x/si,"em, ").concat(t.y/si,"em) "),u+="scale(".concat(t.size/si*(t.flipX?-1:1),", ").concat(t.size/si*(t.flipY?-1:1),") "),u+="rotate(".concat(t.rotate,"deg) "),u}var oF=`:root, :host {
|
|
195
|
+
--fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";
|
|
196
|
+
--fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";
|
|
197
|
+
--fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";
|
|
198
|
+
--fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin";
|
|
199
|
+
--fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";
|
|
200
|
+
--fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";
|
|
201
|
+
--fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";
|
|
202
|
+
--fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";
|
|
203
|
+
--fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp";
|
|
204
|
+
--fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
208
|
+
overflow: visible;
|
|
209
|
+
box-sizing: content-box;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.svg-inline--fa {
|
|
213
|
+
display: var(--fa-display, inline-block);
|
|
214
|
+
height: 1em;
|
|
215
|
+
overflow: visible;
|
|
216
|
+
vertical-align: -0.125em;
|
|
217
|
+
}
|
|
218
|
+
.svg-inline--fa.fa-2xs {
|
|
219
|
+
vertical-align: 0.1em;
|
|
220
|
+
}
|
|
221
|
+
.svg-inline--fa.fa-xs {
|
|
222
|
+
vertical-align: 0em;
|
|
223
|
+
}
|
|
224
|
+
.svg-inline--fa.fa-sm {
|
|
225
|
+
vertical-align: -0.0714285705em;
|
|
226
|
+
}
|
|
227
|
+
.svg-inline--fa.fa-lg {
|
|
228
|
+
vertical-align: -0.2em;
|
|
229
|
+
}
|
|
230
|
+
.svg-inline--fa.fa-xl {
|
|
231
|
+
vertical-align: -0.25em;
|
|
232
|
+
}
|
|
233
|
+
.svg-inline--fa.fa-2xl {
|
|
234
|
+
vertical-align: -0.3125em;
|
|
235
|
+
}
|
|
236
|
+
.svg-inline--fa.fa-pull-left {
|
|
237
|
+
margin-right: var(--fa-pull-margin, 0.3em);
|
|
238
|
+
width: auto;
|
|
239
|
+
}
|
|
240
|
+
.svg-inline--fa.fa-pull-right {
|
|
241
|
+
margin-left: var(--fa-pull-margin, 0.3em);
|
|
242
|
+
width: auto;
|
|
243
|
+
}
|
|
244
|
+
.svg-inline--fa.fa-li {
|
|
245
|
+
width: var(--fa-li-width, 2em);
|
|
246
|
+
top: 0.25em;
|
|
247
|
+
}
|
|
248
|
+
.svg-inline--fa.fa-fw {
|
|
249
|
+
width: var(--fa-fw-width, 1.25em);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.fa-layers svg.svg-inline--fa {
|
|
253
|
+
bottom: 0;
|
|
254
|
+
left: 0;
|
|
255
|
+
margin: auto;
|
|
256
|
+
position: absolute;
|
|
257
|
+
right: 0;
|
|
258
|
+
top: 0;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.fa-layers-counter, .fa-layers-text {
|
|
262
|
+
display: inline-block;
|
|
263
|
+
position: absolute;
|
|
264
|
+
text-align: center;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.fa-layers {
|
|
268
|
+
display: inline-block;
|
|
269
|
+
height: 1em;
|
|
270
|
+
position: relative;
|
|
271
|
+
text-align: center;
|
|
272
|
+
vertical-align: -0.125em;
|
|
273
|
+
width: 1em;
|
|
274
|
+
}
|
|
275
|
+
.fa-layers svg.svg-inline--fa {
|
|
276
|
+
-webkit-transform-origin: center center;
|
|
277
|
+
transform-origin: center center;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.fa-layers-text {
|
|
281
|
+
left: 50%;
|
|
282
|
+
top: 50%;
|
|
283
|
+
-webkit-transform: translate(-50%, -50%);
|
|
284
|
+
transform: translate(-50%, -50%);
|
|
285
|
+
-webkit-transform-origin: center center;
|
|
286
|
+
transform-origin: center center;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.fa-layers-counter {
|
|
290
|
+
background-color: var(--fa-counter-background-color, #ff253a);
|
|
291
|
+
border-radius: var(--fa-counter-border-radius, 1em);
|
|
292
|
+
box-sizing: border-box;
|
|
293
|
+
color: var(--fa-inverse, #fff);
|
|
294
|
+
line-height: var(--fa-counter-line-height, 1);
|
|
295
|
+
max-width: var(--fa-counter-max-width, 5em);
|
|
296
|
+
min-width: var(--fa-counter-min-width, 1.5em);
|
|
297
|
+
overflow: hidden;
|
|
298
|
+
padding: var(--fa-counter-padding, 0.25em 0.5em);
|
|
299
|
+
right: var(--fa-right, 0);
|
|
300
|
+
text-overflow: ellipsis;
|
|
301
|
+
top: var(--fa-top, 0);
|
|
302
|
+
-webkit-transform: scale(var(--fa-counter-scale, 0.25));
|
|
303
|
+
transform: scale(var(--fa-counter-scale, 0.25));
|
|
304
|
+
-webkit-transform-origin: top right;
|
|
305
|
+
transform-origin: top right;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.fa-layers-bottom-right {
|
|
309
|
+
bottom: var(--fa-bottom, 0);
|
|
310
|
+
right: var(--fa-right, 0);
|
|
311
|
+
top: auto;
|
|
312
|
+
-webkit-transform: scale(var(--fa-layers-scale, 0.25));
|
|
313
|
+
transform: scale(var(--fa-layers-scale, 0.25));
|
|
314
|
+
-webkit-transform-origin: bottom right;
|
|
315
|
+
transform-origin: bottom right;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.fa-layers-bottom-left {
|
|
319
|
+
bottom: var(--fa-bottom, 0);
|
|
320
|
+
left: var(--fa-left, 0);
|
|
321
|
+
right: auto;
|
|
322
|
+
top: auto;
|
|
323
|
+
-webkit-transform: scale(var(--fa-layers-scale, 0.25));
|
|
324
|
+
transform: scale(var(--fa-layers-scale, 0.25));
|
|
325
|
+
-webkit-transform-origin: bottom left;
|
|
326
|
+
transform-origin: bottom left;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.fa-layers-top-right {
|
|
330
|
+
top: var(--fa-top, 0);
|
|
331
|
+
right: var(--fa-right, 0);
|
|
332
|
+
-webkit-transform: scale(var(--fa-layers-scale, 0.25));
|
|
333
|
+
transform: scale(var(--fa-layers-scale, 0.25));
|
|
334
|
+
-webkit-transform-origin: top right;
|
|
335
|
+
transform-origin: top right;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.fa-layers-top-left {
|
|
339
|
+
left: var(--fa-left, 0);
|
|
340
|
+
right: auto;
|
|
341
|
+
top: var(--fa-top, 0);
|
|
342
|
+
-webkit-transform: scale(var(--fa-layers-scale, 0.25));
|
|
343
|
+
transform: scale(var(--fa-layers-scale, 0.25));
|
|
344
|
+
-webkit-transform-origin: top left;
|
|
345
|
+
transform-origin: top left;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.fa-1x {
|
|
349
|
+
font-size: 1em;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.fa-2x {
|
|
353
|
+
font-size: 2em;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.fa-3x {
|
|
357
|
+
font-size: 3em;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.fa-4x {
|
|
361
|
+
font-size: 4em;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.fa-5x {
|
|
365
|
+
font-size: 5em;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.fa-6x {
|
|
369
|
+
font-size: 6em;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.fa-7x {
|
|
373
|
+
font-size: 7em;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.fa-8x {
|
|
377
|
+
font-size: 8em;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.fa-9x {
|
|
381
|
+
font-size: 9em;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.fa-10x {
|
|
385
|
+
font-size: 10em;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.fa-2xs {
|
|
389
|
+
font-size: 0.625em;
|
|
390
|
+
line-height: 0.1em;
|
|
391
|
+
vertical-align: 0.225em;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.fa-xs {
|
|
395
|
+
font-size: 0.75em;
|
|
396
|
+
line-height: 0.0833333337em;
|
|
397
|
+
vertical-align: 0.125em;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.fa-sm {
|
|
401
|
+
font-size: 0.875em;
|
|
402
|
+
line-height: 0.0714285718em;
|
|
403
|
+
vertical-align: 0.0535714295em;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.fa-lg {
|
|
407
|
+
font-size: 1.25em;
|
|
408
|
+
line-height: 0.05em;
|
|
409
|
+
vertical-align: -0.075em;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.fa-xl {
|
|
413
|
+
font-size: 1.5em;
|
|
414
|
+
line-height: 0.0416666682em;
|
|
415
|
+
vertical-align: -0.125em;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.fa-2xl {
|
|
419
|
+
font-size: 2em;
|
|
420
|
+
line-height: 0.03125em;
|
|
421
|
+
vertical-align: -0.1875em;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.fa-fw {
|
|
425
|
+
text-align: center;
|
|
426
|
+
width: 1.25em;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.fa-ul {
|
|
430
|
+
list-style-type: none;
|
|
431
|
+
margin-left: var(--fa-li-margin, 2.5em);
|
|
432
|
+
padding-left: 0;
|
|
433
|
+
}
|
|
434
|
+
.fa-ul > li {
|
|
435
|
+
position: relative;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.fa-li {
|
|
439
|
+
left: calc(var(--fa-li-width, 2em) * -1);
|
|
440
|
+
position: absolute;
|
|
441
|
+
text-align: center;
|
|
442
|
+
width: var(--fa-li-width, 2em);
|
|
443
|
+
line-height: inherit;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.fa-border {
|
|
447
|
+
border-color: var(--fa-border-color, #eee);
|
|
448
|
+
border-radius: var(--fa-border-radius, 0.1em);
|
|
449
|
+
border-style: var(--fa-border-style, solid);
|
|
450
|
+
border-width: var(--fa-border-width, 0.08em);
|
|
451
|
+
padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.fa-pull-left {
|
|
455
|
+
float: left;
|
|
456
|
+
margin-right: var(--fa-pull-margin, 0.3em);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.fa-pull-right {
|
|
460
|
+
float: right;
|
|
461
|
+
margin-left: var(--fa-pull-margin, 0.3em);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.fa-beat {
|
|
465
|
+
-webkit-animation-name: fa-beat;
|
|
466
|
+
animation-name: fa-beat;
|
|
467
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
468
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
469
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
470
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
471
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
472
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
473
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
474
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
475
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);
|
|
476
|
+
animation-timing-function: var(--fa-animation-timing, ease-in-out);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.fa-bounce {
|
|
480
|
+
-webkit-animation-name: fa-bounce;
|
|
481
|
+
animation-name: fa-bounce;
|
|
482
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
483
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
484
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
485
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
486
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
487
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
488
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
489
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
490
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));
|
|
491
|
+
animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.fa-fade {
|
|
495
|
+
-webkit-animation-name: fa-fade;
|
|
496
|
+
animation-name: fa-fade;
|
|
497
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
498
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
499
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
500
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
501
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
502
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
503
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
504
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
505
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
|
|
506
|
+
animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.fa-beat-fade {
|
|
510
|
+
-webkit-animation-name: fa-beat-fade;
|
|
511
|
+
animation-name: fa-beat-fade;
|
|
512
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
513
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
514
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
515
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
516
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
517
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
518
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
519
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
520
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
|
|
521
|
+
animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.fa-flip {
|
|
525
|
+
-webkit-animation-name: fa-flip;
|
|
526
|
+
animation-name: fa-flip;
|
|
527
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
528
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
529
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
530
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
531
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
532
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
533
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
534
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
535
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);
|
|
536
|
+
animation-timing-function: var(--fa-animation-timing, ease-in-out);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.fa-shake {
|
|
540
|
+
-webkit-animation-name: fa-shake;
|
|
541
|
+
animation-name: fa-shake;
|
|
542
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
543
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
544
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
545
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
546
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
547
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
548
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
549
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
550
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, linear);
|
|
551
|
+
animation-timing-function: var(--fa-animation-timing, linear);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
.fa-spin {
|
|
555
|
+
-webkit-animation-name: fa-spin;
|
|
556
|
+
animation-name: fa-spin;
|
|
557
|
+
-webkit-animation-delay: var(--fa-animation-delay, 0s);
|
|
558
|
+
animation-delay: var(--fa-animation-delay, 0s);
|
|
559
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
560
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
561
|
+
-webkit-animation-duration: var(--fa-animation-duration, 2s);
|
|
562
|
+
animation-duration: var(--fa-animation-duration, 2s);
|
|
563
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
564
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
565
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, linear);
|
|
566
|
+
animation-timing-function: var(--fa-animation-timing, linear);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
.fa-spin-reverse {
|
|
570
|
+
--fa-animation-direction: reverse;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.fa-pulse,
|
|
574
|
+
.fa-spin-pulse {
|
|
575
|
+
-webkit-animation-name: fa-spin;
|
|
576
|
+
animation-name: fa-spin;
|
|
577
|
+
-webkit-animation-direction: var(--fa-animation-direction, normal);
|
|
578
|
+
animation-direction: var(--fa-animation-direction, normal);
|
|
579
|
+
-webkit-animation-duration: var(--fa-animation-duration, 1s);
|
|
580
|
+
animation-duration: var(--fa-animation-duration, 1s);
|
|
581
|
+
-webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
582
|
+
animation-iteration-count: var(--fa-animation-iteration-count, infinite);
|
|
583
|
+
-webkit-animation-timing-function: var(--fa-animation-timing, steps(8));
|
|
584
|
+
animation-timing-function: var(--fa-animation-timing, steps(8));
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
@media (prefers-reduced-motion: reduce) {
|
|
588
|
+
.fa-beat,
|
|
589
|
+
.fa-bounce,
|
|
590
|
+
.fa-fade,
|
|
591
|
+
.fa-beat-fade,
|
|
592
|
+
.fa-flip,
|
|
593
|
+
.fa-pulse,
|
|
594
|
+
.fa-shake,
|
|
595
|
+
.fa-spin,
|
|
596
|
+
.fa-spin-pulse {
|
|
597
|
+
-webkit-animation-delay: -1ms;
|
|
598
|
+
animation-delay: -1ms;
|
|
599
|
+
-webkit-animation-duration: 1ms;
|
|
600
|
+
animation-duration: 1ms;
|
|
601
|
+
-webkit-animation-iteration-count: 1;
|
|
602
|
+
animation-iteration-count: 1;
|
|
603
|
+
-webkit-transition-delay: 0s;
|
|
604
|
+
transition-delay: 0s;
|
|
605
|
+
-webkit-transition-duration: 0s;
|
|
606
|
+
transition-duration: 0s;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
@-webkit-keyframes fa-beat {
|
|
610
|
+
0%, 90% {
|
|
611
|
+
-webkit-transform: scale(1);
|
|
612
|
+
transform: scale(1);
|
|
613
|
+
}
|
|
614
|
+
45% {
|
|
615
|
+
-webkit-transform: scale(var(--fa-beat-scale, 1.25));
|
|
616
|
+
transform: scale(var(--fa-beat-scale, 1.25));
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
@keyframes fa-beat {
|
|
620
|
+
0%, 90% {
|
|
621
|
+
-webkit-transform: scale(1);
|
|
622
|
+
transform: scale(1);
|
|
623
|
+
}
|
|
624
|
+
45% {
|
|
625
|
+
-webkit-transform: scale(var(--fa-beat-scale, 1.25));
|
|
626
|
+
transform: scale(var(--fa-beat-scale, 1.25));
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
@-webkit-keyframes fa-bounce {
|
|
630
|
+
0% {
|
|
631
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
632
|
+
transform: scale(1, 1) translateY(0);
|
|
633
|
+
}
|
|
634
|
+
10% {
|
|
635
|
+
-webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
|
|
636
|
+
transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
|
|
637
|
+
}
|
|
638
|
+
30% {
|
|
639
|
+
-webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
|
|
640
|
+
transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
|
|
641
|
+
}
|
|
642
|
+
50% {
|
|
643
|
+
-webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
|
|
644
|
+
transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
|
|
645
|
+
}
|
|
646
|
+
57% {
|
|
647
|
+
-webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
|
|
648
|
+
transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
|
|
649
|
+
}
|
|
650
|
+
64% {
|
|
651
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
652
|
+
transform: scale(1, 1) translateY(0);
|
|
653
|
+
}
|
|
654
|
+
100% {
|
|
655
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
656
|
+
transform: scale(1, 1) translateY(0);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
@keyframes fa-bounce {
|
|
660
|
+
0% {
|
|
661
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
662
|
+
transform: scale(1, 1) translateY(0);
|
|
663
|
+
}
|
|
664
|
+
10% {
|
|
665
|
+
-webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
|
|
666
|
+
transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
|
|
667
|
+
}
|
|
668
|
+
30% {
|
|
669
|
+
-webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
|
|
670
|
+
transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
|
|
671
|
+
}
|
|
672
|
+
50% {
|
|
673
|
+
-webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
|
|
674
|
+
transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
|
|
675
|
+
}
|
|
676
|
+
57% {
|
|
677
|
+
-webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
|
|
678
|
+
transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
|
|
679
|
+
}
|
|
680
|
+
64% {
|
|
681
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
682
|
+
transform: scale(1, 1) translateY(0);
|
|
683
|
+
}
|
|
684
|
+
100% {
|
|
685
|
+
-webkit-transform: scale(1, 1) translateY(0);
|
|
686
|
+
transform: scale(1, 1) translateY(0);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
@-webkit-keyframes fa-fade {
|
|
690
|
+
50% {
|
|
691
|
+
opacity: var(--fa-fade-opacity, 0.4);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
@keyframes fa-fade {
|
|
695
|
+
50% {
|
|
696
|
+
opacity: var(--fa-fade-opacity, 0.4);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
@-webkit-keyframes fa-beat-fade {
|
|
700
|
+
0%, 100% {
|
|
701
|
+
opacity: var(--fa-beat-fade-opacity, 0.4);
|
|
702
|
+
-webkit-transform: scale(1);
|
|
703
|
+
transform: scale(1);
|
|
704
|
+
}
|
|
705
|
+
50% {
|
|
706
|
+
opacity: 1;
|
|
707
|
+
-webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));
|
|
708
|
+
transform: scale(var(--fa-beat-fade-scale, 1.125));
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
@keyframes fa-beat-fade {
|
|
712
|
+
0%, 100% {
|
|
713
|
+
opacity: var(--fa-beat-fade-opacity, 0.4);
|
|
714
|
+
-webkit-transform: scale(1);
|
|
715
|
+
transform: scale(1);
|
|
716
|
+
}
|
|
717
|
+
50% {
|
|
718
|
+
opacity: 1;
|
|
719
|
+
-webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));
|
|
720
|
+
transform: scale(var(--fa-beat-fade-scale, 1.125));
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
@-webkit-keyframes fa-flip {
|
|
724
|
+
50% {
|
|
725
|
+
-webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
|
|
726
|
+
transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
@keyframes fa-flip {
|
|
730
|
+
50% {
|
|
731
|
+
-webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
|
|
732
|
+
transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
@-webkit-keyframes fa-shake {
|
|
736
|
+
0% {
|
|
737
|
+
-webkit-transform: rotate(-15deg);
|
|
738
|
+
transform: rotate(-15deg);
|
|
739
|
+
}
|
|
740
|
+
4% {
|
|
741
|
+
-webkit-transform: rotate(15deg);
|
|
742
|
+
transform: rotate(15deg);
|
|
743
|
+
}
|
|
744
|
+
8%, 24% {
|
|
745
|
+
-webkit-transform: rotate(-18deg);
|
|
746
|
+
transform: rotate(-18deg);
|
|
747
|
+
}
|
|
748
|
+
12%, 28% {
|
|
749
|
+
-webkit-transform: rotate(18deg);
|
|
750
|
+
transform: rotate(18deg);
|
|
751
|
+
}
|
|
752
|
+
16% {
|
|
753
|
+
-webkit-transform: rotate(-22deg);
|
|
754
|
+
transform: rotate(-22deg);
|
|
755
|
+
}
|
|
756
|
+
20% {
|
|
757
|
+
-webkit-transform: rotate(22deg);
|
|
758
|
+
transform: rotate(22deg);
|
|
759
|
+
}
|
|
760
|
+
32% {
|
|
761
|
+
-webkit-transform: rotate(-12deg);
|
|
762
|
+
transform: rotate(-12deg);
|
|
763
|
+
}
|
|
764
|
+
36% {
|
|
765
|
+
-webkit-transform: rotate(12deg);
|
|
766
|
+
transform: rotate(12deg);
|
|
767
|
+
}
|
|
768
|
+
40%, 100% {
|
|
769
|
+
-webkit-transform: rotate(0deg);
|
|
770
|
+
transform: rotate(0deg);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
@keyframes fa-shake {
|
|
774
|
+
0% {
|
|
775
|
+
-webkit-transform: rotate(-15deg);
|
|
776
|
+
transform: rotate(-15deg);
|
|
777
|
+
}
|
|
778
|
+
4% {
|
|
779
|
+
-webkit-transform: rotate(15deg);
|
|
780
|
+
transform: rotate(15deg);
|
|
781
|
+
}
|
|
782
|
+
8%, 24% {
|
|
783
|
+
-webkit-transform: rotate(-18deg);
|
|
784
|
+
transform: rotate(-18deg);
|
|
785
|
+
}
|
|
786
|
+
12%, 28% {
|
|
787
|
+
-webkit-transform: rotate(18deg);
|
|
788
|
+
transform: rotate(18deg);
|
|
789
|
+
}
|
|
790
|
+
16% {
|
|
791
|
+
-webkit-transform: rotate(-22deg);
|
|
792
|
+
transform: rotate(-22deg);
|
|
793
|
+
}
|
|
794
|
+
20% {
|
|
795
|
+
-webkit-transform: rotate(22deg);
|
|
796
|
+
transform: rotate(22deg);
|
|
797
|
+
}
|
|
798
|
+
32% {
|
|
799
|
+
-webkit-transform: rotate(-12deg);
|
|
800
|
+
transform: rotate(-12deg);
|
|
801
|
+
}
|
|
802
|
+
36% {
|
|
803
|
+
-webkit-transform: rotate(12deg);
|
|
804
|
+
transform: rotate(12deg);
|
|
805
|
+
}
|
|
806
|
+
40%, 100% {
|
|
807
|
+
-webkit-transform: rotate(0deg);
|
|
808
|
+
transform: rotate(0deg);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
@-webkit-keyframes fa-spin {
|
|
812
|
+
0% {
|
|
813
|
+
-webkit-transform: rotate(0deg);
|
|
814
|
+
transform: rotate(0deg);
|
|
815
|
+
}
|
|
816
|
+
100% {
|
|
817
|
+
-webkit-transform: rotate(360deg);
|
|
818
|
+
transform: rotate(360deg);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
@keyframes fa-spin {
|
|
822
|
+
0% {
|
|
823
|
+
-webkit-transform: rotate(0deg);
|
|
824
|
+
transform: rotate(0deg);
|
|
825
|
+
}
|
|
826
|
+
100% {
|
|
827
|
+
-webkit-transform: rotate(360deg);
|
|
828
|
+
transform: rotate(360deg);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
.fa-rotate-90 {
|
|
832
|
+
-webkit-transform: rotate(90deg);
|
|
833
|
+
transform: rotate(90deg);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
.fa-rotate-180 {
|
|
837
|
+
-webkit-transform: rotate(180deg);
|
|
838
|
+
transform: rotate(180deg);
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
.fa-rotate-270 {
|
|
842
|
+
-webkit-transform: rotate(270deg);
|
|
843
|
+
transform: rotate(270deg);
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
.fa-flip-horizontal {
|
|
847
|
+
-webkit-transform: scale(-1, 1);
|
|
848
|
+
transform: scale(-1, 1);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
.fa-flip-vertical {
|
|
852
|
+
-webkit-transform: scale(1, -1);
|
|
853
|
+
transform: scale(1, -1);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
.fa-flip-both,
|
|
857
|
+
.fa-flip-horizontal.fa-flip-vertical {
|
|
858
|
+
-webkit-transform: scale(-1, -1);
|
|
859
|
+
transform: scale(-1, -1);
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
.fa-rotate-by {
|
|
863
|
+
-webkit-transform: rotate(var(--fa-rotate-angle, none));
|
|
864
|
+
transform: rotate(var(--fa-rotate-angle, none));
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.fa-stack {
|
|
868
|
+
display: inline-block;
|
|
869
|
+
vertical-align: middle;
|
|
870
|
+
height: 2em;
|
|
871
|
+
position: relative;
|
|
872
|
+
width: 2.5em;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
.fa-stack-1x,
|
|
876
|
+
.fa-stack-2x {
|
|
877
|
+
bottom: 0;
|
|
878
|
+
left: 0;
|
|
879
|
+
margin: auto;
|
|
880
|
+
position: absolute;
|
|
881
|
+
right: 0;
|
|
882
|
+
top: 0;
|
|
883
|
+
z-index: var(--fa-stack-z-index, auto);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
.svg-inline--fa.fa-stack-1x {
|
|
887
|
+
height: 1em;
|
|
888
|
+
width: 1.25em;
|
|
889
|
+
}
|
|
890
|
+
.svg-inline--fa.fa-stack-2x {
|
|
891
|
+
height: 2em;
|
|
892
|
+
width: 2.5em;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
.fa-inverse {
|
|
896
|
+
color: var(--fa-inverse, #fff);
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.sr-only,
|
|
900
|
+
.fa-sr-only {
|
|
901
|
+
position: absolute;
|
|
902
|
+
width: 1px;
|
|
903
|
+
height: 1px;
|
|
904
|
+
padding: 0;
|
|
905
|
+
margin: -1px;
|
|
906
|
+
overflow: hidden;
|
|
907
|
+
clip: rect(0, 0, 0, 0);
|
|
908
|
+
white-space: nowrap;
|
|
909
|
+
border-width: 0;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
.sr-only-focusable:not(:focus),
|
|
913
|
+
.fa-sr-only-focusable:not(:focus) {
|
|
914
|
+
position: absolute;
|
|
915
|
+
width: 1px;
|
|
916
|
+
height: 1px;
|
|
917
|
+
padding: 0;
|
|
918
|
+
margin: -1px;
|
|
919
|
+
overflow: hidden;
|
|
920
|
+
clip: rect(0, 0, 0, 0);
|
|
921
|
+
white-space: nowrap;
|
|
922
|
+
border-width: 0;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
.svg-inline--fa .fa-primary {
|
|
926
|
+
fill: var(--fa-primary-color, currentColor);
|
|
927
|
+
opacity: var(--fa-primary-opacity, 1);
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.svg-inline--fa .fa-secondary {
|
|
931
|
+
fill: var(--fa-secondary-color, currentColor);
|
|
932
|
+
opacity: var(--fa-secondary-opacity, 0.4);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
.svg-inline--fa.fa-swap-opacity .fa-primary {
|
|
936
|
+
opacity: var(--fa-secondary-opacity, 0.4);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.svg-inline--fa.fa-swap-opacity .fa-secondary {
|
|
940
|
+
opacity: var(--fa-primary-opacity, 1);
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
.svg-inline--fa mask .fa-primary,
|
|
944
|
+
.svg-inline--fa mask .fa-secondary {
|
|
945
|
+
fill: black;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
.fad.fa-inverse,
|
|
949
|
+
.fa-duotone.fa-inverse {
|
|
950
|
+
color: var(--fa-inverse, #fff);
|
|
951
|
+
}`;function jw(){var e=Ow,t=Dw,n=ve.cssPrefix,r=ve.replacementClass,i=oF;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 qy=!1;function qf(){ve.autoAddCss&&!qy&&(eF(jw()),qy=!0)}var aF={mixout:function(){return{dom:{css:jw,insertCss:qf}}},hooks:function(){return{beforeDOMElementCreation:function(){qf()},beforeI2svg:function(){qf()}}}},Jr=Ri||{};Jr[Xr]||(Jr[Xr]={});Jr[Xr].styles||(Jr[Xr].styles={});Jr[Xr].hooks||(Jr[Xr].hooks={});Jr[Xr].shims||(Jr[Xr].shims=[]);var gr=Jr[Xr],_w=[],sF=function e(){wt.removeEventListener("DOMContentLoaded",e),rl=1,_w.map(function(t){return t()})},rl=!1;ni&&(rl=(wt.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(wt.readyState),rl||wt.addEventListener("DOMContentLoaded",sF));function uF(e){ni&&(rl?setTimeout(e,0):_w.push(e))}function Eu(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"?Mw(e):"<".concat(t," ").concat(nF(r),">").concat(o.map(Eu).join(""),"</").concat(t,">")}function Fy(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var cF=function(t,n){return function(r,i,o,a){return t.call(n,r,i,o,a)}},Ff=function(t,n,r,i){var o=Object.keys(t),a=o.length,s=i!==void 0?cF(n,i):n,u,c,l;for(r===void 0?(u=1,l=t[o[0]]):(u=0,l=r);u<a;u++)c=o[u],l=s(l,t[c],c,t);return l};function lF(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 Ap(e){var t=lF(e);return t.length===1?t[0].toString(16):null}function fF(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 Ly(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 $p(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,o=Ly(t);typeof gr.hooks.addPack=="function"&&!i?gr.hooks.addPack(e,Ly(t)):gr.styles[e]=pe(pe({},gr.styles[e]||{}),o),e==="fas"&&$p("fa",t)}var tc,nc,rc,ca=gr.styles,dF=gr.shims,pF=(tc={},Qt(tc,St,Object.values(Js[St])),Qt(tc,Rt,Object.values(Js[Rt])),tc),Av=null,qw={},Fw={},Lw={},Vw={},Bw={},hF=(nc={},Qt(nc,St,Object.keys(Ys[St])),Qt(nc,Rt,Object.keys(Ys[Rt])),nc);function vF(e){return~Yq.indexOf(e)}function mF(e,t){var n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!vF(i)?i:null}var Uw=function(){var t=function(o){return Ff(ca,function(a,s,u){return a[u]=Ff(s,o,{}),a},{})};qw=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}),Fw=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}),Bw=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 ca||ve.autoFetchSvg,r=Ff(dF,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:{}});Lw=r.names,Vw=r.unicodes,Av=vf(ve.styleDefault,{family:ve.familyDefault})};Zq(function(e){Av=vf(e.styleDefault,{family:ve.familyDefault})});Uw();function $v(e,t){return(qw[e]||{})[t]}function yF(e,t){return(Fw[e]||{})[t]}function uo(e,t){return(Bw[e]||{})[t]}function Gw(e){return Lw[e]||{prefix:null,iconName:null}}function gF(e){var t=Vw[e],n=$v("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function ki(){return Av}var Ov=function(){return{prefix:null,iconName:null,rest:[]}};function vf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,r=n===void 0?St:n,i=Ys[r][e],o=Xs[r][e]||Xs[r][i],a=e in gr.styles?e:null;return o||a||null}var Vy=(rc={},Qt(rc,St,Object.keys(Js[St])),Qt(rc,Rt,Object.keys(Js[Rt])),rc);function mf(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,o=(t={},Qt(t,St,"".concat(ve.cssPrefix,"-").concat(St)),Qt(t,Rt,"".concat(ve.cssPrefix,"-").concat(Rt)),t),a=null,s=St;(e.includes(o[St])||e.some(function(c){return Vy[St].includes(c)}))&&(s=St),(e.includes(o[Rt])||e.some(function(c){return Vy[Rt].includes(c)}))&&(s=Rt);var u=e.reduce(function(c,l){var f=mF(ve.cssPrefix,l);if(ca[l]?(l=pF[s].includes(l)?Uq[s][l]:l,a=l,c.prefix=l):hF[s].indexOf(l)>-1?(a=l,c.prefix=vf(l,{family:s})):f?c.iconName=f:l!==ve.replacementClass&&l!==o[St]&&l!==o[Rt]&&c.rest.push(l),!i&&c.prefix&&c.iconName){var d=a==="fa"?Gw(c.iconName):{},p=uo(c.prefix,c.iconName);d.prefix&&(a=null),c.iconName=d.iconName||p||c.iconName,c.prefix=d.prefix||c.prefix,c.prefix==="far"&&!ca.far&&ca.fas&&!ve.autoFetchSvg&&(c.prefix="fas")}return c},Ov());return(e.includes("fa-brands")||e.includes("fab"))&&(u.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(u.prefix="fad"),!u.prefix&&s===Rt&&(ca.fass||ve.autoFetchSvg)&&(u.prefix="fass",u.iconName=uo(u.prefix,u.iconName)||u.iconName),(u.prefix==="fa"||a==="fa")&&(u.prefix=ki()||"fas"),u}var bF=function(){function e(){Nq(this,e),this.definitions={}}return Pq(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]),$p(s,a[s]);var u=Js[St][s];u&&$p(u,a[s]),Uw()})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(n,r){var i=r.prefix&&r.iconName&&r.icon?{0:r}:r;return Object.keys(i).map(function(o){var a=i[o],s=a.prefix,u=a.iconName,c=a.icon,l=c[2];n[s]||(n[s]={}),l.length>0&&l.forEach(function(f){typeof f=="string"&&(n[s][f]=c)}),n[s][u]=c}),n}}]),e}(),By=[],la={},ya={},SF=Object.keys(ya);function CF(e,t){var n=t.mixoutsTo;return By=e,la={},Object.keys(ya).forEach(function(r){SF.indexOf(r)===-1&&delete ya[r]}),By.forEach(function(r){var i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(function(a){typeof i[a]=="function"&&(n[a]=i[a]),nl(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){la[a]||(la[a]=[]),la[a].push(o[a])})}r.provides&&r.provides(ya)}),n}function Op(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=la[e]||[];return o.forEach(function(a){t=a.apply(null,[t].concat(r))}),t}function Ao(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=la[e]||[];i.forEach(function(o){o.apply(null,n)})}function Qr(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return ya[e]?ya[e].apply(null,t):void 0}function Dp(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||ki();if(t)return t=uo(n,t)||t,Fy(zw.definitions,n,t)||Fy(gr.styles,n,t)}var zw=new bF,wF=function(){ve.autoReplaceSvg=!1,ve.observeMutations=!1,Ao("noAuto")},xF={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ni?(Ao("beforeI2svg",t),Qr("pseudoElements2svg",t),Qr("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,uF(function(){TF({autoReplaceSvgRoot:n}),Ao("watch",t)})}},EF={icon:function(t){if(t===null)return null;if(nl(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:uo(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=vf(t[0]);return{prefix:r,iconName:uo(r,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(ve.cssPrefix,"-"))>-1||t.match(Gq))){var i=mf(t.split(" "),{skipLookups:!0});return{prefix:i.prefix||ki(),iconName:uo(i.prefix,i.iconName)||i.iconName}}if(typeof t=="string"){var o=ki();return{prefix:o,iconName:uo(o,t)||t}}}},er={noAuto:wF,config:ve,dom:xF,parse:EF,library:zw,findIconDefinition:Dp,toHtml:Eu},TF=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,r=n===void 0?wt:n;(Object.keys(gr.styles).length>0||ve.autoFetchSvg)&&ni&&ve.autoReplaceSvg&&er.dom.i2svg({node:r})};function yf(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(r){return Eu(r)})}}),Object.defineProperty(e,"node",{get:function(){if(ni){var r=wt.createElement("div");return r.innerHTML=e.html,r.children}}}),e}function IF(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,o=e.styles,a=e.transform;if(Iv(a)&&n.found&&!r.found){var s=n.width,u=n.height,c={x:s/u/2,y:.5};i.style=hf(pe(pe({},o),{},{"transform-origin":"".concat(c.x+a.x/16,"em ").concat(c.y+a.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}function AF(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 Dv(e){var t=e.icons,n=t.main,r=t.mask,i=e.prefix,o=e.iconName,a=e.transform,s=e.symbol,u=e.title,c=e.maskId,l=e.titleId,f=e.extra,d=e.watchable,p=d===void 0?!1:d,h=r.found?r:n,v=h.width,x=h.height,E=i==="fak",y=[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(" "),S={children:[],attributes:pe(pe({},f.attributes),{},{"data-prefix":i,"data-icon":o,class:y,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(v," ").concat(x)})},w=E&&!~f.classes.indexOf("fa-fw")?{width:"".concat(v/x*16*.0625,"em")}:{};p&&(S.attributes[Io]=""),u&&(S.children.push({tag:"title",attributes:{id:S.attributes["aria-labelledby"]||"title-".concat(l||Zs())},children:[u]}),delete S.attributes.title);var b=pe(pe({},S),{},{prefix:i,iconName:o,main:n,mask:r,maskId:c,transform:a,symbol:s,styles:pe(pe({},w),f.styles)}),T=r.found&&n.found?Qr("generateAbstractMask",b)||{children:[],attributes:{}}:Qr("generateAbstractIcon",b)||{children:[],attributes:{}},A=T.children,D=T.attributes;return b.children=A,b.attributes=D,s?AF(b):IF(b)}function Uy(e){var t=e.content,n=e.width,r=e.height,i=e.transform,o=e.title,a=e.extra,s=e.watchable,u=s===void 0?!1:s,c=pe(pe(pe({},a.attributes),o?{title:o}:{}),{},{class:a.classes.join(" ")});u&&(c[Io]="");var l=pe({},a.styles);Iv(i)&&(l.transform=iF({transform:i,startCentered:!0,width:n,height:r}),l["-webkit-transform"]=l.transform);var f=hf(l);f.length>0&&(c.style=f);var d=[];return d.push({tag:"span",attributes:c,children:[t]}),o&&d.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),d}function $F(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=hf(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 Lf=gr.styles;function Np(e){var t=e[0],n=e[1],r=e.slice(4),i=Sv(r,1),o=i[0],a=null;return Array.isArray(o)?a={tag:"g",attributes:{class:"".concat(ve.cssPrefix,"-").concat(so.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(so.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(so.PRIMARY),fill:"currentColor",d:o[1]}}]}:a={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:t,height:n,icon:a}}var OF={found:!1,width:512,height:512};function DF(e,t){!Nw&&!ve.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function Pp(e,t){var n=t;return t==="fa"&&ve.styleDefault!==null&&(t=ki()),new Promise(function(r,i){if(Qr("missingIconAbstract"),n==="fa"){var o=Gw(e)||{};e=o.iconName||e,t=o.prefix||t}if(e&&t&&Lf[t]&&Lf[t][e]){var a=Lf[t][e];return r(Np(a))}DF(e,t),r(pe(pe({},OF),{},{icon:ve.showMissingIcons&&e?Qr("missingIconAbstract")||{}:{}}))})}var Gy=function(){},Rp=ve.measurePerformance&&Yu&&Yu.mark&&Yu.measure?Yu:{mark:Gy,measure:Gy},bs='FA "6.5.1"',NF=function(t){return Rp.mark("".concat(bs," ").concat(t," begins")),function(){return Ww(t)}},Ww=function(t){Rp.mark("".concat(bs," ").concat(t," ends")),Rp.measure("".concat(bs," ").concat(t),"".concat(bs," ").concat(t," begins"),"".concat(bs," ").concat(t," ends"))},Nv={begin:NF,end:Ww},$c=function(){};function zy(e){var t=e.getAttribute?e.getAttribute(Io):null;return typeof t=="string"}function PF(e){var t=e.getAttribute?e.getAttribute(wv):null,n=e.getAttribute?e.getAttribute(xv):null;return t&&n}function RF(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(ve.replacementClass)}function kF(){if(ve.autoReplaceSvg===!0)return Oc.replace;var e=Oc[ve.autoReplaceSvg];return e||Oc.replace}function MF(e){return wt.createElementNS("http://www.w3.org/2000/svg",e)}function jF(e){return wt.createElement(e)}function Hw(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,r=n===void 0?e.tag==="svg"?MF:jF: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(Hw(a,{ceFn:r}))}),i}function _F(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var Oc={replace:function(t){var n=t[0];if(n.parentNode)if(t[1].forEach(function(i){n.parentNode.insertBefore(Hw(i),n)}),n.getAttribute(Io)===null&&ve.keepOriginalSource){var r=wt.createComment(_F(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(t){var n=t[0],r=t[1];if(~Tv(n).indexOf(ve.replacementClass))return Oc.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 Eu(s)}).join(`
|
|
952
|
+
`);n.setAttribute(Io,""),n.innerHTML=a}};function Wy(e){e()}function Kw(e,t){var n=typeof t=="function"?t:$c;if(e.length===0)n();else{var r=Wy;ve.mutateApproach===Vq&&(r=Ri.requestAnimationFrame||Wy),r(function(){var i=kF(),o=Nv.begin("mutate");e.map(i),o(),n()})}}var Pv=!1;function Yw(){Pv=!0}function kp(){Pv=!1}var il=null;function Hy(e){if(jy&&ve.observeMutations){var t=e.treeCallback,n=t===void 0?$c:t,r=e.nodeCallback,i=r===void 0?$c:r,o=e.pseudoElementsCallback,a=o===void 0?$c:o,s=e.observeMutationsRoot,u=s===void 0?wt:s;il=new jy(function(c){if(!Pv){var l=ki();Xa(c).forEach(function(f){if(f.type==="childList"&&f.addedNodes.length>0&&!zy(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"&&zy(f.target)&&~Kq.indexOf(f.attributeName))if(f.attributeName==="class"&&PF(f.target)){var d=mf(Tv(f.target)),p=d.prefix,h=d.iconName;f.target.setAttribute(wv,p||l),h&&f.target.setAttribute(xv,h)}else RF(f.target)&&i(f.target)})}}),ni&&il.observe(u,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function qF(){il&&il.disconnect()}function FF(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 LF(e){var t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=e.innerText!==void 0?e.innerText.trim():"",i=mf(Tv(e));return i.prefix||(i.prefix=ki()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=yF(i.prefix,e.innerText)||$v(i.prefix,Ap(e.innerText))),!i.iconName&&ve.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i}function VF(e){var t=Xa(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||Zs()):(t["aria-hidden"]="true",t.focusable="false")),t}function BF(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Ir,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function Ky(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=LF(e),r=n.iconName,i=n.prefix,o=n.rest,a=VF(e),s=Op("parseNodeAttributes",{},e),u=t.styleParser?FF(e):[];return pe({iconName:r,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:i,transform:Ir,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:u,attributes:a}},s)}var UF=gr.styles;function Xw(e){var t=ve.autoReplaceSvg==="nest"?Ky(e,{styleParser:!1}):Ky(e);return~t.extra.classes.indexOf(Pw)?Qr("generateLayersText",e,t):Qr("generateSvgReplacementMutation",e,t)}var Mi=new Set;Ev.map(function(e){Mi.add("fa-".concat(e))});Object.keys(Ys[St]).map(Mi.add.bind(Mi));Object.keys(Ys[Rt]).map(Mi.add.bind(Mi));Mi=wu(Mi);function Yy(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!ni)return Promise.resolve();var n=wt.documentElement.classList,r=function(f){return n.add("".concat(_y,"-").concat(f))},i=function(f){return n.remove("".concat(_y,"-").concat(f))},o=ve.autoFetchSvg?Mi:Ev.map(function(l){return"fa-".concat(l)}).concat(Object.keys(UF));o.includes("fa")||o.push("fa");var a=[".".concat(Pw,":not([").concat(Io,"])")].concat(o.map(function(l){return".".concat(l,":not([").concat(Io,"])")})).join(", ");if(a.length===0)return Promise.resolve();var s=[];try{s=Xa(e.querySelectorAll(a))}catch{}if(s.length>0)r("pending"),i("complete");else return Promise.resolve();var u=Nv.begin("onTree"),c=s.reduce(function(l,f){try{var d=Xw(f);d&&l.push(d)}catch(p){Nw||p.name==="MissingIcon"&&console.error(p)}return l},[]);return new Promise(function(l,f){Promise.all(c).then(function(d){Kw(d,function(){r("active"),r("complete"),i("pending"),typeof t=="function"&&t(),u(),l()})}).catch(function(d){u(),f(d)})})}function GF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Xw(e).then(function(n){n&&Kw([n],t)})}function zF(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(t||{}).icon?t:Dp(t||{}),i=n.mask;return i&&(i=(i||{}).icon?i:Dp(i||{})),e(r,pe(pe({},n),{},{mask:i}))}}var WF=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.transform,i=r===void 0?Ir:r,o=n.symbol,a=o===void 0?!1:o,s=n.mask,u=s===void 0?null:s,c=n.maskId,l=c===void 0?null:c,f=n.title,d=f===void 0?null:f,p=n.titleId,h=p===void 0?null:p,v=n.classes,x=v===void 0?[]:v,E=n.attributes,y=E===void 0?{}:E,S=n.styles,w=S===void 0?{}:S;if(t){var b=t.prefix,T=t.iconName,A=t.icon;return yf(pe({type:"icon"},t),function(){return Ao("beforeDOMElementCreation",{iconDefinition:t,params:n}),ve.autoA11y&&(d?y["aria-labelledby"]="".concat(ve.replacementClass,"-title-").concat(h||Zs()):(y["aria-hidden"]="true",y.focusable="false")),Dv({icons:{main:Np(A),mask:u?Np(u.icon):{found:!1,width:null,height:null,icon:{}}},prefix:b,iconName:T,transform:pe(pe({},Ir),i),symbol:a,title:d,maskId:l,titleId:h,extra:{attributes:y,styles:w,classes:x}})})}},HF={mixout:function(){return{icon:zF(WF)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=Yy,n.nodeCallback=GF,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 Yy(i,a)},t.generateSvgReplacementMutation=function(n,r){var i=r.iconName,o=r.title,a=r.titleId,s=r.prefix,u=r.transform,c=r.symbol,l=r.mask,f=r.maskId,d=r.extra;return new Promise(function(p,h){Promise.all([Pp(i,s),l.iconName?Pp(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(v){var x=Sv(v,2),E=x[0],y=x[1];p([n,Dv({icons:{main:E,mask:y},prefix:s,iconName:i,transform:u,symbol:c,maskId:f,title:o,titleId:a,extra:d,watchable:!0})])}).catch(h)})},t.generateAbstractIcon=function(n){var r=n.children,i=n.attributes,o=n.main,a=n.transform,s=n.styles,u=hf(s);u.length>0&&(i.style=u);var c;return Iv(a)&&(c=Qr("generateAbstractTransformGrouping",{main:o,transform:a,containerWidth:o.width,iconWidth:o.width})),r.push(c||o.icon),{children:r,attributes:i}}}},KF={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 yf({type:"layer"},function(){Ao("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(wu(o)).join(" ")},children:a}]})}}}},YF={mixout:function(){return{counter:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.title,o=i===void 0?null:i,a=r.classes,s=a===void 0?[]:a,u=r.attributes,c=u===void 0?{}:u,l=r.styles,f=l===void 0?{}:l;return yf({type:"counter",content:n},function(){return Ao("beforeDOMElementCreation",{content:n,params:r}),$F({content:n.toString(),title:o,extra:{attributes:c,styles:f,classes:["".concat(ve.cssPrefix,"-layers-counter")].concat(wu(s))}})})}}}},XF={mixout:function(){return{text:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.transform,o=i===void 0?Ir:i,a=r.title,s=a===void 0?null:a,u=r.classes,c=u===void 0?[]:u,l=r.attributes,f=l===void 0?{}:l,d=r.styles,p=d===void 0?{}:d;return yf({type:"text",content:n},function(){return Ao("beforeDOMElementCreation",{content:n,params:r}),Uy({content:n,transform:pe(pe({},Ir),o),title:s,extra:{attributes:f,styles:p,classes:["".concat(ve.cssPrefix,"-layers-text")].concat(wu(c))}})})}}},provides:function(t){t.generateLayersText=function(n,r){var i=r.title,o=r.transform,a=r.extra,s=null,u=null;if($w){var c=parseInt(getComputedStyle(n).fontSize,10),l=n.getBoundingClientRect();s=l.width/c,u=l.height/c}return ve.autoA11y&&!i&&(a.attributes["aria-hidden"]="true"),Promise.resolve([n,Uy({content:n.innerHTML,width:s,height:u,transform:o,title:i,extra:a,watchable:!0})])}}},JF=new RegExp('"',"ug"),Xy=[1105920,1112319];function QF(e){var t=e.replace(JF,""),n=fF(t,0),r=n>=Xy[0]&&n<=Xy[1],i=t.length===2?t[0]===t[1]:!1;return{value:Ap(i?t[0]:t),isSecondary:r||i}}function Jy(e,t){var n="".concat(Lq).concat(t.replace(":","-"));return new Promise(function(r,i){if(e.getAttribute(n)!==null)return r();var o=Xa(e.children),a=o.filter(function(A){return A.getAttribute(Ip)===t})[0],s=Ri.getComputedStyle(e,t),u=s.getPropertyValue("font-family").match(zq),c=s.getPropertyValue("font-weight"),l=s.getPropertyValue("content");if(a&&!u)return e.removeChild(a),r();if(u&&l!=="none"&&l!==""){var f=s.getPropertyValue("content"),d=~["Sharp"].indexOf(u[2])?Rt:St,p=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(u[2])?Xs[d][u[2].toLowerCase()]:Wq[d][c],h=QF(f),v=h.value,x=h.isSecondary,E=u[0].startsWith("FontAwesome"),y=$v(p,v),S=y;if(E){var w=gF(v);w.iconName&&w.prefix&&(y=w.iconName,p=w.prefix)}if(y&&!x&&(!a||a.getAttribute(wv)!==p||a.getAttribute(xv)!==S)){e.setAttribute(n,S),a&&e.removeChild(a);var b=BF(),T=b.extra;T.attributes[Ip]=t,Pp(y,p).then(function(A){var D=Dv(pe(pe({},b),{},{icons:{main:A,mask:Ov()},prefix:p,iconName:S,extra:T,watchable:!0})),I=wt.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(I,e.firstChild):e.appendChild(I),I.outerHTML=D.map(function(N){return Eu(N)}).join(`
|
|
953
|
+
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function ZF(e){return Promise.all([Jy(e,"::before"),Jy(e,"::after")])}function eL(e){return e.parentNode!==document.head&&!~Bq.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(Ip)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function Qy(e){if(ni)return new Promise(function(t,n){var r=Xa(e.querySelectorAll("*")).filter(eL).map(ZF),i=Nv.begin("searchPseudoElements");Yw(),Promise.all(r).then(function(){i(),kp(),t()}).catch(function(){i(),kp(),n()})})}var tL={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=Qy,n}}},provides:function(t){t.pseudoElements2svg=function(n){var r=n.node,i=r===void 0?wt:r;ve.searchPseudoElements&&Qy(i)}}},Zy=!1,nL={mixout:function(){return{dom:{unwatch:function(){Yw(),Zy=!0}}}},hooks:function(){return{bootstrap:function(){Hy(Op("mutationObserverCallbacks",{}))},noAuto:function(){qF()},watch:function(n){var r=n.observeMutationsRoot;Zy?kp():Hy(Op("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}},eg=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)},rL={mixout:function(){return{parse:{transform:function(n){return eg(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-transform");return i&&(n.transform=eg(i)),n}}},provides:function(t){t.generateAbstractTransformGrouping=function(n){var r=n.main,i=n.transform,o=n.containerWidth,a=n.iconWidth,s={transform:"translate(".concat(o/2," 256)")},u="translate(".concat(i.x*32,", ").concat(i.y*32,") "),c="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),l="rotate(".concat(i.rotate," 0 0)"),f={transform:"".concat(u," ").concat(c," ").concat(l)},d={transform:"translate(".concat(a/2*-1," -256)")},p={outer:s,inner:f,path:d};return{tag:"g",attributes:pe({},p.outer),children:[{tag:"g",attributes:pe({},p.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:pe(pe({},r.icon.attributes),p.path)}]}]}}}},Vf={x:0,y:0,width:"100%",height:"100%"};function tg(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 iL(e){return e.tag==="g"?e.children:[e]}var oL={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-mask"),o=i?mf(i.split(" ").map(function(a){return a.trim()})):Ov();return o.prefix||(o.prefix=ki()),n.mask=o,n.maskId=r.getAttribute("data-fa-mask-id"),n}}},provides:function(t){t.generateAbstractMask=function(n){var r=n.children,i=n.attributes,o=n.main,a=n.mask,s=n.maskId,u=n.transform,c=o.width,l=o.icon,f=a.width,d=a.icon,p=rF({transform:u,containerWidth:f,iconWidth:c}),h={tag:"rect",attributes:pe(pe({},Vf),{},{fill:"white"})},v=l.children?{children:l.children.map(tg)}:{},x={tag:"g",attributes:pe({},p.inner),children:[tg(pe({tag:l.tag,attributes:pe(pe({},l.attributes),p.path)},v))]},E={tag:"g",attributes:pe({},p.outer),children:[x]},y="mask-".concat(s||Zs()),S="clip-".concat(s||Zs()),w={tag:"mask",attributes:pe(pe({},Vf),{},{id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[h,E]},b={tag:"defs",children:[{tag:"clipPath",attributes:{id:S},children:iL(d)},w]};return r.push(b,{tag:"rect",attributes:pe({fill:"currentColor","clip-path":"url(#".concat(S,")"),mask:"url(#".concat(y,")")},Vf)}),{children:r,attributes:i}}}},aL={provides:function(t){var n=!1;Ri.matchMedia&&(n=Ri.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}}}},sL={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}}}},uL=[aF,HF,KF,YF,XF,tL,nL,rL,oL,aL,sL];CF(uL,{mixoutsTo:er});er.noAuto;er.config;er.library;er.dom;var Mp=er.parse;er.findIconDefinition;er.toHtml;var cL=er.icon;er.layer;er.text;er.counter;var jp={exports:{}},ic={exports:{}},it={};/** @license React v16.13.1
|
|
954
|
+
* react-is.production.min.js
|
|
955
|
+
*
|
|
956
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
957
|
+
*
|
|
958
|
+
* This source code is licensed under the MIT license found in the
|
|
959
|
+
* LICENSE file in the root directory of this source tree.
|
|
960
|
+
*/var ng;function lL(){if(ng)return it;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,c=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function S(b){if(typeof b=="object"&&b!==null){var T=b.$$typeof;switch(T){case t:switch(b=b.type,b){case u:case c:case r:case o:case i:case f:return b;default:switch(b=b&&b.$$typeof,b){case s:case l:case h:case p:case a:return b;default:return T}}case n:return T}}}function w(b){return S(b)===c}return it.AsyncMode=u,it.ConcurrentMode=c,it.ContextConsumer=s,it.ContextProvider=a,it.Element=t,it.ForwardRef=l,it.Fragment=r,it.Lazy=h,it.Memo=p,it.Portal=n,it.Profiler=o,it.StrictMode=i,it.Suspense=f,it.isAsyncMode=function(b){return w(b)||S(b)===u},it.isConcurrentMode=w,it.isContextConsumer=function(b){return S(b)===s},it.isContextProvider=function(b){return S(b)===a},it.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},it.isForwardRef=function(b){return S(b)===l},it.isFragment=function(b){return S(b)===r},it.isLazy=function(b){return S(b)===h},it.isMemo=function(b){return S(b)===p},it.isPortal=function(b){return S(b)===n},it.isProfiler=function(b){return S(b)===o},it.isStrictMode=function(b){return S(b)===i},it.isSuspense=function(b){return S(b)===f},it.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===c||b===o||b===i||b===f||b===d||typeof b=="object"&&b!==null&&(b.$$typeof===h||b.$$typeof===p||b.$$typeof===a||b.$$typeof===s||b.$$typeof===l||b.$$typeof===x||b.$$typeof===E||b.$$typeof===y||b.$$typeof===v)},it.typeOf=S,it}var ot={};/** @license React v16.13.1
|
|
961
|
+
* react-is.development.js
|
|
962
|
+
*
|
|
963
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
964
|
+
*
|
|
965
|
+
* This source code is licensed under the MIT license found in the
|
|
966
|
+
* LICENSE file in the root directory of this source tree.
|
|
967
|
+
*/var rg;function fL(){return rg||(rg=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function S(ce){return typeof ce=="string"||typeof ce=="function"||ce===r||ce===c||ce===o||ce===i||ce===f||ce===d||typeof ce=="object"&&ce!==null&&(ce.$$typeof===h||ce.$$typeof===p||ce.$$typeof===a||ce.$$typeof===s||ce.$$typeof===l||ce.$$typeof===x||ce.$$typeof===E||ce.$$typeof===y||ce.$$typeof===v)}function w(ce){if(typeof ce=="object"&&ce!==null){var Dn=ce.$$typeof;switch(Dn){case t:var ii=ce.type;switch(ii){case u:case c:case r:case o:case i:case f:return ii;default:var qo=ii&&ii.$$typeof;switch(qo){case s:case l:case h:case p:case a:return qo;default:return Dn}}case n:return Dn}}}var b=u,T=c,A=s,D=a,I=t,N=l,_=r,L=h,B=p,K=n,k=o,ie=i,V=f,U=!1;function fe(ce){return U||(U=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),j(ce)||w(ce)===u}function j(ce){return w(ce)===c}function R(ce){return w(ce)===s}function te(ce){return w(ce)===a}function oe(ce){return typeof ce=="object"&&ce!==null&&ce.$$typeof===t}function Y(ce){return w(ce)===l}function ae(ce){return w(ce)===r}function de(ce){return w(ce)===h}function he(ce){return w(ce)===p}function xe(ce){return w(ce)===n}function ke(ce){return w(ce)===o}function De(ce){return w(ce)===i}function ht(ce){return w(ce)===f}ot.AsyncMode=b,ot.ConcurrentMode=T,ot.ContextConsumer=A,ot.ContextProvider=D,ot.Element=I,ot.ForwardRef=N,ot.Fragment=_,ot.Lazy=L,ot.Memo=B,ot.Portal=K,ot.Profiler=k,ot.StrictMode=ie,ot.Suspense=V,ot.isAsyncMode=fe,ot.isConcurrentMode=j,ot.isContextConsumer=R,ot.isContextProvider=te,ot.isElement=oe,ot.isForwardRef=Y,ot.isFragment=ae,ot.isLazy=de,ot.isMemo=he,ot.isPortal=xe,ot.isProfiler=ke,ot.isStrictMode=De,ot.isSuspense=ht,ot.isValidElementType=S,ot.typeOf=w}()),ot}var ig;function Jw(){return ig||(ig=1,process.env.NODE_ENV==="production"?ic.exports=lL():ic.exports=fL()),ic.exports}/*
|
|
968
|
+
object-assign
|
|
969
|
+
(c) Sindre Sorhus
|
|
970
|
+
@license MIT
|
|
971
|
+
*/var Bf,og;function dL(){if(og)return Bf;og=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var u=Object.getOwnPropertyNames(a).map(function(l){return a[l]});if(u.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(l){c[l]=l}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Bf=i()?Object.assign:function(o,a){for(var s,u=r(o),c,l=1;l<arguments.length;l++){s=Object(arguments[l]);for(var f in s)t.call(s,f)&&(u[f]=s[f]);if(e){c=e(s);for(var d=0;d<c.length;d++)n.call(s,c[d])&&(u[c[d]]=s[c[d]])}}return u},Bf}var Uf,ag;function Rv(){if(ag)return Uf;ag=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Uf=e,Uf}var Gf,sg;function Qw(){return sg||(sg=1,Gf=Function.call.bind(Object.prototype.hasOwnProperty)),Gf}var zf,ug;function pL(){if(ug)return zf;ug=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Rv(),n={},r=Qw();e=function(o){var a="Warning: "+o;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,a,s,u,c){if(process.env.NODE_ENV!=="production"){for(var l in o)if(r(o,l)){var f;try{if(typeof o[l]!="function"){var d=Error((u||"React class")+": "+s+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=o[l](a,l,u,s,null,t)}catch(h){f=h}if(f&&!(f instanceof Error)&&e((u||"React class")+": type specification of "+s+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var p=c?c():"";e("Failed "+s+" type: "+f.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},zf=i,zf}var Wf,cg;function hL(){if(cg)return Wf;cg=1;var e=Jw(),t=dL(),n=Rv(),r=Qw(),i=pL(),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 Wf=function(s,u){var c=typeof Symbol=="function"&&Symbol.iterator,l="@@iterator";function f(j){var R=j&&(c&&j[c]||j[l]);if(typeof R=="function")return R}var d="<<anonymous>>",p={array:E("array"),bigint:E("bigint"),bool:E("boolean"),func:E("function"),number:E("number"),object:E("object"),string:E("string"),symbol:E("symbol"),any:y(),arrayOf:S,element:w(),elementType:b(),instanceOf:T,node:N(),objectOf:D,oneOf:A,oneOfType:I,shape:L,exact:B};function h(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 x(j){if(process.env.NODE_ENV!=="production")var R={},te=0;function oe(ae,de,he,xe,ke,De,ht){if(xe=xe||d,De=De||he,ht!==n){if(u){var ce=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw ce.name="Invariant Violation",ce}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Dn=xe+":"+he;!R[Dn]&&te<3&&(o("You are manually calling a React.PropTypes validation function for the `"+De+"` prop on `"+xe+"`. 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[Dn]=!0,te++)}}return de[he]==null?ae?de[he]===null?new v("The "+ke+" `"+De+"` is marked as required "+("in `"+xe+"`, but its value is `null`.")):new v("The "+ke+" `"+De+"` is marked as required in "+("`"+xe+"`, but its value is `undefined`.")):null:j(de,he,xe,ke,De)}var Y=oe.bind(null,!1);return Y.isRequired=oe.bind(null,!0),Y}function E(j){function R(te,oe,Y,ae,de,he){var xe=te[oe],ke=ie(xe);if(ke!==j){var De=V(xe);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+De+"` supplied to `"+Y+"`, expected ")+("`"+j+"`."),{expectedType:j})}return null}return x(R)}function y(){return x(a)}function S(j){function R(te,oe,Y,ae,de){if(typeof j!="function")return new v("Property `"+de+"` of component `"+Y+"` has invalid PropType notation inside arrayOf.");var he=te[oe];if(!Array.isArray(he)){var xe=ie(he);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+xe+"` supplied to `"+Y+"`, expected an array."))}for(var ke=0;ke<he.length;ke++){var De=j(he,ke,Y,ae,de+"["+ke+"]",n);if(De instanceof Error)return De}return null}return x(R)}function w(){function j(R,te,oe,Y,ae){var de=R[te];if(!s(de)){var he=ie(de);return new v("Invalid "+Y+" `"+ae+"` of type "+("`"+he+"` supplied to `"+oe+"`, expected a single ReactElement."))}return null}return x(j)}function b(){function j(R,te,oe,Y,ae){var de=R[te];if(!e.isValidElementType(de)){var he=ie(de);return new v("Invalid "+Y+" `"+ae+"` of type "+("`"+he+"` supplied to `"+oe+"`, expected a single ReactElement type."))}return null}return x(j)}function T(j){function R(te,oe,Y,ae,de){if(!(te[oe]instanceof j)){var he=j.name||d,xe=fe(te[oe]);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+xe+"` supplied to `"+Y+"`, expected ")+("instance of `"+he+"`."))}return null}return x(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,Y,ae,de){for(var he=te[oe],xe=0;xe<j.length;xe++)if(h(he,j[xe]))return null;var ke=JSON.stringify(j,function(ht,ce){var Dn=V(ce);return Dn==="symbol"?String(ce):ce});return new v("Invalid "+ae+" `"+de+"` of value `"+String(he)+"` "+("supplied to `"+Y+"`, expected one of "+ke+"."))}return x(R)}function D(j){function R(te,oe,Y,ae,de){if(typeof j!="function")return new v("Property `"+de+"` of component `"+Y+"` has invalid PropType notation inside objectOf.");var he=te[oe],xe=ie(he);if(xe!=="object")return new v("Invalid "+ae+" `"+de+"` of type "+("`"+xe+"` supplied to `"+Y+"`, expected an object."));for(var ke in he)if(r(he,ke)){var De=j(he,ke,Y,ae,de+"."+ke,n);if(De instanceof Error)return De}return null}return x(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 "+U(te)+" at index "+R+"."),a}function oe(Y,ae,de,he,xe){for(var ke=[],De=0;De<j.length;De++){var ht=j[De],ce=ht(Y,ae,de,he,xe,n);if(ce==null)return null;ce.data&&r(ce.data,"expectedType")&&ke.push(ce.data.expectedType)}var Dn=ke.length>0?", expected one of type ["+ke.join(", ")+"]":"";return new v("Invalid "+he+" `"+xe+"` supplied to "+("`"+de+"`"+Dn+"."))}return x(oe)}function N(){function j(R,te,oe,Y,ae){return K(R[te])?null:new v("Invalid "+Y+" `"+ae+"` supplied to "+("`"+oe+"`, expected a ReactNode."))}return x(j)}function _(j,R,te,oe,Y){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 `"+Y+"`.")}function L(j){function R(te,oe,Y,ae,de){var he=te[oe],xe=ie(he);if(xe!=="object")return new v("Invalid "+ae+" `"+de+"` of type `"+xe+"` "+("supplied to `"+Y+"`, expected `object`."));for(var ke in j){var De=j[ke];if(typeof De!="function")return _(Y,ae,de,ke,V(De));var ht=De(he,ke,Y,ae,de+"."+ke,n);if(ht)return ht}return null}return x(R)}function B(j){function R(te,oe,Y,ae,de){var he=te[oe],xe=ie(he);if(xe!=="object")return new v("Invalid "+ae+" `"+de+"` of type `"+xe+"` "+("supplied to `"+Y+"`, expected `object`."));var ke=t({},te[oe],j);for(var De in ke){var ht=j[De];if(r(j,De)&&typeof ht!="function")return _(Y,ae,de,De,V(ht));if(!ht)return new v("Invalid "+ae+" `"+de+"` key `"+De+"` supplied to `"+Y+"`.\nBad object: "+JSON.stringify(te[oe],null," ")+`
|
|
972
|
+
Valid keys: `+JSON.stringify(Object.keys(j),null," "));var ce=ht(he,De,Y,ae,de+"."+De,n);if(ce)return ce}return null}return x(R)}function K(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(K);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(!K(oe.value))return!1}else for(;!(oe=te.next()).done;){var Y=oe.value;if(Y&&!K(Y[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 V(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 U(j){var R=V(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 p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},Wf}var Hf,lg;function vL(){if(lg)return Hf;lg=1;var e=Rv();function t(){}function n(){}return n.resetWarningCache=t,Hf=function(){function r(a,s,u,c,l,f){if(f!==e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Hf}if(process.env.NODE_ENV!=="production"){var mL=Jw(),yL=!0;jp.exports=hL()(mL.isElement,yL)}else jp.exports=vL()();var gL=jp.exports;const _e=Mb(gL);function fg(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 gi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fg(Object(n),!0).forEach(function(r){fa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ol(e){"@babel/helpers - typeof";return ol=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},ol(e)}function fa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bL(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 SL(e,t){if(e==null)return{};var n=bL(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 _p(e){return CL(e)||wL(e)||xL(e)||EL()}function CL(e){if(Array.isArray(e))return qp(e)}function wL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xL(e,t){if(e){if(typeof e=="string")return qp(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 qp(e,t)}}function qp(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 EL(){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 TL(e){var t,n=e.beat,r=e.fade,i=e.beatFade,o=e.bounce,a=e.shake,s=e.flash,u=e.spin,c=e.spinPulse,l=e.spinReverse,f=e.pulse,d=e.fixedWidth,p=e.inverse,h=e.border,v=e.listItem,x=e.flip,E=e.size,y=e.rotation,S=e.pull,w=(t={"fa-beat":n,"fa-fade":r,"fa-beat-fade":i,"fa-bounce":o,"fa-shake":a,"fa-flash":s,"fa-spin":u,"fa-spin-reverse":l,"fa-spin-pulse":c,"fa-pulse":f,"fa-fw":d,"fa-inverse":p,"fa-border":h,"fa-li":v,"fa-flip":x===!0,"fa-flip-horizontal":x==="horizontal"||x==="both","fa-flip-vertical":x==="vertical"||x==="both"},fa(t,"fa-".concat(E),typeof E<"u"&&E!==null),fa(t,"fa-rotate-".concat(y),typeof y<"u"&&y!==null&&y!==0),fa(t,"fa-pull-".concat(S),typeof S<"u"&&S!==null),fa(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(w).map(function(b){return w[b]?b:null}).filter(function(b){return b})}function IL(e){return e=e-0,e===e}function Zw(e){return IL(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(t,n){return n?n.toUpperCase():""}),e.substr(0,1).toLowerCase()+e.substr(1))}var AL=["style"];function $L(e){return e.charAt(0).toUpperCase()+e.slice(1)}function OL(e){return e.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,n){var r=n.indexOf(":"),i=Zw(n.slice(0,r)),o=n.slice(r+1).trim();return i.startsWith("webkit")?t[$L(i)]=o:t[i]=o,t},{})}function ex(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 ex(e,u)}),i=Object.keys(t.attributes||{}).reduce(function(u,c){var l=t.attributes[c];switch(c){case"class":u.attrs.className=l,delete t.attributes.class;break;case"style":u.attrs.style=OL(l);break;default:c.indexOf("aria-")===0||c.indexOf("data-")===0?u.attrs[c.toLowerCase()]=l:u.attrs[Zw(c)]=l}return u},{attrs:{}}),o=n.style,a=o===void 0?{}:o,s=SL(n,AL);return i.attrs.style=gi(gi({},i.attrs.style),a),e.apply(void 0,[t.tag,gi(gi({},i.attrs),s)].concat(_p(r)))}var tx=!1;try{tx=process.env.NODE_ENV==="production"}catch{}function DL(){if(!tx&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function dg(e){if(e&&ol(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Mp.icon)return Mp.icon(e);if(e===null)return null;if(e&&ol(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 Kf(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?fa({},e,t):{}}var ji=O.forwardRef(function(e,t){var n=e.icon,r=e.mask,i=e.symbol,o=e.className,a=e.title,s=e.titleId,u=e.maskId,c=dg(n),l=Kf("classes",[].concat(_p(TL(e)),_p(o.split(" ")))),f=Kf("transform",typeof e.transform=="string"?Mp.transform(e.transform):e.transform),d=Kf("mask",dg(r)),p=cL(c,gi(gi(gi(gi({},l),f),d),{},{symbol:i,title:a,titleId:s,maskId:u}));if(!p)return DL("Could not find icon",c),null;var h=p.abstract,v={ref:t};return Object.keys(e).forEach(function(x){ji.defaultProps.hasOwnProperty(x)||(v[x]=e[x])}),NL(h[0],v)});ji.displayName="FontAwesomeIcon";ji.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};ji.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 NL=ex.bind(null,O.createElement);function nx(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=nx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function PL(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=nx(e))&&(r&&(r+=" "),r+=t);return r}var al=sm&&sm.__assign||function(){return al=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},al.apply(this,arguments)};function RL(e,t,n){if(t==="className")e.className=[e.className,n].join(" ").trim();else if(t==="style")e.style=al(al({},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 kL=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)RL(r,o,i[o]);return r},{})};const rx=Mb(kL);function Xo(){}function ML(){return!0}function as(e){return!!(e||"").match(/\d/)}function pg(e){return e==null}function hg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function jL(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 _L(e,t,n){var r=jL(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 Fp(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 qL(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 ix(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function vg(e,t){return Array(t+1).join(e)}function FL(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."+vg("0",Math.abs(o))+r:o>=a?r=r+vg("0",o-a):r=(r.substring(0,o)||"0")+"."+r.substring(o),t+r}function LL(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=e.indexOf(".")!==-1&&t,i=Fp(e),o=i.beforeDecimal,a=i.afterDecimal,s=i.hasNagation,u=parseFloat("0."+(a||"0")),c=a.length<=t?"0."+a:u.toFixed(t),l=c.split("."),f=o.split("").reverse().reduce(function(v,x,E){return v.length>E?(Number(v[0])+Number(x)).toString()+v.substring(1,v.length):x+v},l[0]),d=ix(l[1]||"",Math.min(t,a.length),n),p=s?"-":"",h=r?".":"";return""+p+f+h+d}function mg(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 VL(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 Yf(e,t,n){return Math.min(Math.max(e,t),n)}function yg(e){return Math.max(e.selectionStart,e.selectionEnd)}function BL(e){return e||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function UL(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 GL={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:Xo,onChange:Xo,onKeyDown:Xo,onMouseUp:Xo,onFocus:Xo,onBlur:Xo,isAllowed:ML},ox=function(e){function t(n){e.call(this,n);var r=n.defaultValue;this.validateProps();var i=this.formatValueProp(r);this.state={value:i,numAsString:this.removeFormatting(i),mounted:!1},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.componentDidMount=function(){this.setState({mounted:!0})},t.prototype.componentDidUpdate=function(r){this.updateValueIfRequired(r)},t.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},t.prototype.updateValueIfRequired=function(r){var i=this,o=i.props,a=i.state,s=i.focusedElm,u=a.value,c=a.numAsString;if(c===void 0&&(c=""),r!==o){this.validateProps();var l=this.formatNumString(c),f=pg(o.value)?l:this.formatValueProp(),d=this.removeFormatting(f),p=parseFloat(d),h=parseFloat(c);((!isNaN(p)||!isNaN(h))&&p!==h||l!==u||s===null&&f!==u)&&this.updateValue({formattedValue:f,numAsString:d,input:s,source:"prop",event:null})}},t.prototype.getFloatString=function(r){r===void 0&&(r="");var i=this.props,o=i.decimalScale,a=this.getSeparators(),s=a.decimalSeparator,u=this.getNumberRegex(!0),c=r[0]==="-";c&&(r=r.replace("-","")),s&&o===0&&(r=r.split(s)[0]),r=(r.match(u)||[]).join("").replace(s,".");var l=r.indexOf(".");return l!==-1&&(r=r.substring(0,l)+"."+r.substring(l+1,r.length).replace(new RegExp(hg(s),"g"),"")),c&&(r="-"+r),r},t.prototype.getNumberRegex=function(r,i){var o=this.props,a=o.format,s=o.decimalScale,u=o.customNumerals,c=this.getSeparators(),l=c.decimalSeparator;return new RegExp("[0-9"+(u?u.join(""):"")+"]"+(l&&s!==0&&!i&&!a?"|"+hg(l):""),r?"g":void 0)},t.prototype.getSeparators=function(){var r=this.props,i=r.decimalSeparator,o=this.props,a=o.thousandSeparator,s=o.allowedDecimalSeparators;return a===!0&&(a=","),s||(s=[i,"."]),{decimalSeparator:i,thousandSeparator:a,allowedDecimalSeparators:s}},t.prototype.getMaskAtIndex=function(r){var i=this.props,o=i.mask;return o===void 0&&(o=" "),typeof o=="string"?o:o[r]||" "},t.prototype.getValueObject=function(r,i){var o=parseFloat(i);return{formattedValue:r,value:i,floatValue:isNaN(o)?void 0:o}},t.prototype.validateProps=function(){var r=this.props,i=r.mask,o=this.getSeparators(),a=o.decimalSeparator,s=o.thousandSeparator;if(a===s)throw new Error(`
|
|
974
|
+
Decimal separator can't be same as thousand separator.
|
|
975
|
+
thousandSeparator: `+s+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
976
|
+
decimalSeparator: `+a+` (default value for decimalSeparator is .)
|
|
977
|
+
`);if(i){var u=i==="string"?i:i.toString();if(u.match(/\d/g))throw new Error(`
|
|
978
|
+
Mask `+i+` should not contain numeric character;
|
|
979
|
+
`)}},t.prototype.setPatchedCaretPosition=function(r,i,o){mg(r,i),this.caretPositionTimeout=setTimeout(function(){r.value===o&&mg(r,i)},0)},t.prototype.correctCaretPosition=function(r,i,o){var a=this.props,s=a.prefix,u=a.suffix,c=a.format;if(r==="")return 0;if(i=Yf(i,0,r.length),!c){var l=r[0]==="-";return Yf(i,s.length+(l?1:0),r.length-u.length)}if(typeof c=="function"||c[i]==="#"&&as(r[i])||c[i-1]==="#"&&as(r[i-1]))return i;var f=c.indexOf("#"),d=c.lastIndexOf("#");i=Yf(i,f,d+1);for(var p=c.substring(i,c.length).indexOf("#"),h=i,v=i+(p===-1?0:p);h>f&&(c[h]!=="#"||!as(r[h]));)h-=1;var x=!as(r[v])||o==="left"&&i!==f||i-h<v-i;return x?as(r[h])?h+1:h:v},t.prototype.getCaretPosition=function(r,i,o){var a=this.props,s=a.format,u=this.state.value,c=this.getNumberRegex(!0),l=(r.match(c)||[]).join(""),f=(i.match(c)||[]).join(""),d,p;for(d=0,p=0;p<o;p++){var h=r[p]||"",v=i[d]||"";if(!(!h.match(c)&&h!==v)&&!(h==="0"&&v.match(c)&&v!=="0"&&l.length!==f.length)){for(;h!==i[d]&&d<i.length;)d++;d++}}return typeof s=="string"&&!u&&(d=i.length),d=this.correctCaretPosition(i,d),d},t.prototype.removePrefixAndSuffix=function(r){var i=this.props,o=i.format,a=i.prefix,s=i.suffix;if(!o&&r){var u=r[0]==="-";u&&(r=r.substring(1,r.length)),r=a&&r.indexOf(a)===0?r.substring(a.length,r.length):r;var c=r.lastIndexOf(s);r=s&&c!==-1&&c===r.length-s.length?r.substring(0,c):r,u&&(r="-"+r)}return r},t.prototype.removePatternFormatting=function(r){for(var i=this.props,o=i.format,a=o.split("#").filter(function(p){return p!==""}),s=0,u="",c=0,l=a.length;c<=l;c++){var f=a[c]||"",d=c===l?r.length:r.indexOf(f,s);if(d===-1){u=r;break}else u+=r.substring(s,d),s=d+f.length}return(u.match(this.getNumberRegex(!0))||[]).join("")},t.prototype.removeFormatting=function(r){var i=this.props,o=i.format,a=i.removeFormatting;return r&&(o?typeof o=="string"?r=this.removePatternFormatting(r):typeof a=="function"?r=a(r):r=(r.match(this.getNumberRegex(!0))||[]).join(""):(r=this.removePrefixAndSuffix(r),r=this.getFloatString(r)),r)},t.prototype.formatWithPattern=function(r){for(var i=this.props,o=i.format,a=0,s=o.split(""),u=0,c=o.length;u<c;u++)o[u]==="#"&&(s[u]=r[a]||this.getMaskAtIndex(a),a+=1);return s.join("")},t.prototype.formatAsNumber=function(r){var i=this.props,o=i.decimalScale,a=i.fixedDecimalScale,s=i.prefix,u=i.suffix,c=i.allowNegative,l=i.thousandsGroupStyle,f=this.getSeparators(),d=f.thousandSeparator,p=f.decimalSeparator,h=r.indexOf(".")!==-1||o&&a,v=Fp(r,c),x=v.beforeDecimal,E=v.afterDecimal,y=v.addNegation;return o!==void 0&&(E=ix(E,o,a)),d&&(x=_L(x,d,l)),s&&(x=s+x),u&&(E=E+u),y&&(x="-"+x),r=x+(h&&p||"")+E,r},t.prototype.formatNumString=function(r){r===void 0&&(r="");var i=this.props,o=i.format,a=i.allowEmptyFormatting,s=i.customNumerals,u=r;if(s&&s.length===10){var c=new RegExp("["+s.join("")+"]","g");u=r.replace(c,function(l){return s.indexOf(l).toString()})}return r===""&&!a?u="":r==="-"&&!o?u="-":typeof o=="string"?u=this.formatWithPattern(u):typeof o=="function"?u=o(u):u=this.formatAsNumber(u),u},t.prototype.formatValueProp=function(r){var i=this.props,o=i.format,a=i.decimalScale,s=i.fixedDecimalScale,u=i.allowEmptyFormatting,c=this.props,l=c.value,f=c.isNumericString;l=pg(l)?r:l;var d=!l&&l!==0;if(d&&u&&(l=""),d&&!u)return"";typeof l=="number"&&(l=FL(l),f=!0),l==="Infinity"&&f&&(l=""),f&&!o&&typeof a=="number"&&(l=LL(l,a,s));var p=f?this.formatNumString(l):this.formatInput(l);return p},t.prototype.formatNegation=function(r){r===void 0&&(r="");var i=this.props,o=i.allowNegative,a=new RegExp("(-)"),s=new RegExp("(-)(.)*(-)"),u=a.test(r),c=s.test(r);return r=r.replace(/-/g,""),u&&!c&&o&&(r="-"+r),r},t.prototype.formatInput=function(r){r===void 0&&(r="");var i=this.props,o=i.format;return o||(r=this.removePrefixAndSuffix(r),r=this.formatNegation(r)),r=this.removeFormatting(r),this.formatNumString(r)},t.prototype.isCharacterAFormat=function(r,i){var o=this.props,a=o.format,s=o.prefix,u=o.suffix,c=o.decimalScale,l=o.fixedDecimalScale,f=this.getSeparators(),d=f.decimalSeparator;return!!(typeof a=="string"&&a[r]!=="#"||!a&&(r<s.length||r>=i.length-u.length||c&&l&&i[r]===d))},t.prototype.correctInputValue=function(r,i,o){var a=this,s=this.props,u=s.format,c=s.allowNegative,l=s.prefix,f=s.suffix,d=s.decimalScale,p=this.getSeparators(),h=p.allowedDecimalSeparators,v=p.decimalSeparator,x=this.state.numAsString||"",E=this.selectionBeforeInput,y=E.selectionStart,S=E.selectionEnd,w=VL(i,o),b=w.start,T=w.end;if(!u&&b===T&&h.indexOf(o[y])!==-1){var A=d===0?"":v;return o.substr(0,y)+A+o.substr(y+1,o.length)}var D=u?0:l.length,I=i.length-(u?0:f.length);if(o.length>i.length||!o.length||b===T||y===0&&S===i.length||b===0&&T===i.length||y===D&&S===I)return o;var N=i.substr(b,T-b),_=!![].concat(N).find(function(R,te){return a.isCharacterAFormat(te+b,i)});if(_){var L=i.substr(b),B={},K=[];[].concat(L).forEach(function(R,te){a.isCharacterAFormat(te+b,i)?B[te]=R:te>N.length-1&&K.push(R)}),Object.keys(B).forEach(function(R){K.length>R?K.splice(R,0,B[R]):K.push(B[R])}),o=i.substr(0,b)+K.join("")}if(!u){var k=this.removeFormatting(o),ie=Fp(k,c),V=ie.beforeDecimal,U=ie.afterDecimal,fe=ie.addNegation,j=r<o.indexOf(v)+1;if(k.length<x.length&&j&&V===""&&!parseFloat(U))return fe?"-":""}return o},t.prototype.updateValue=function(r){var i=r.formattedValue,o=r.input,a=r.setCaretPosition;a===void 0&&(a=!0);var s=r.source,u=r.event,c=r.numAsString,l=r.caretPos,f=this.props,d=f.onValueChange,p=this.state,h=p.value;if(o){if(l===void 0&&a){var v=r.inputValue||o.value,x=yg(o);o.value=i,l=this.getCaretPosition(v,i,x)}o.value=i,a&&this.setPatchedCaretPosition(o,l,i)}c===void 0&&(c=this.removeFormatting(i)),i!==h&&(this.setState({value:i,numAsString:c}),d(this.getValueObject(i,c),{event:u,source:s}))},t.prototype.onChange=function(r){var i=r.target,o=i.value,a=this,s=a.state,u=a.props,c=u.isAllowed,l=s.value||"",f=yg(i);o=this.correctInputValue(f,l,o);var d=this.formatInput(o)||"",p=this.removeFormatting(d),h=this.getValueObject(d,p),v=c(h);v||(d=l),this.updateValue({formattedValue:d,numAsString:p,inputValue:o,input:i,event:r,source:"event"}),v&&u.onChange(r)},t.prototype.onBlur=function(r){var i=this,o=i.props,a=i.state,s=o.format,u=o.onBlur,c=o.allowLeadingZeros,l=a.numAsString,f=a.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!s){isNaN(parseFloat(l))&&(l=""),c||(l=qL(l));var d=this.formatNumString(l);if(d!==f){this.updateValue({formattedValue:d,numAsString:l,input:r.target,setCaretPosition:!1,event:r,source:"event"}),u(r);return}}u(r)},t.prototype.onKeyDown=function(r){var i=r.target,o=r.key,a=i.selectionStart,s=i.selectionEnd,u=i.value;u===void 0&&(u="");var c,l=this.props,f=l.decimalScale,d=l.fixedDecimalScale,p=l.prefix,h=l.suffix,v=l.format,x=l.onKeyDown,E=f!==void 0&&d,y=this.getNumberRegex(!1,E),S=new RegExp("-"),w=typeof v=="string";if(this.selectionBeforeInput={selectionStart:a,selectionEnd:s},o==="ArrowLeft"||o==="Backspace"?c=a-1:o==="ArrowRight"?c=a+1:o==="Delete"&&(c=a),c===void 0||a!==s){x(r);return}var b=c,T=w?v.indexOf("#"):p.length,A=w?v.lastIndexOf("#")+1:u.length-h.length;if(o==="ArrowLeft"||o==="ArrowRight"){var D=o==="ArrowLeft"?"left":"right";b=this.correctCaretPosition(u,c,D)}else if(o==="Delete"&&!y.test(u[c])&&!S.test(u[c]))for(;!y.test(u[b])&&b<A;)b++;else if(o==="Backspace"&&!y.test(u[c])){if(a<=T+1&&u[0]==="-"&&typeof v>"u"){var I=u.substring(1);this.updateValue({formattedValue:I,caretPos:b,input:i,event:r,source:"event"})}else if(!S.test(u[c])){for(;!y.test(u[b-1])&&b>T;)b--;b=this.correctCaretPosition(u,b,"left")}}(b!==c||c<T||c>A)&&(r.preventDefault(),this.setPatchedCaretPosition(i,b,u)),r.isUnitTestRun&&this.setPatchedCaretPosition(i,b,u),x(r)},t.prototype.onMouseUp=function(r){var i=r.target,o=i.selectionStart,a=i.selectionEnd,s=i.value;if(s===void 0&&(s=""),o===a){var u=this.correctCaretPosition(s,o);u!==o&&this.setPatchedCaretPosition(i,u,s)}this.props.onMouseUp(r)},t.prototype.onFocus=function(r){var i=this;r.persist(),this.focusedElm=r.target,this.focusTimeout=setTimeout(function(){var o=r.target,a=o.selectionStart,s=o.selectionEnd,u=o.value;u===void 0&&(u="");var c=i.correctCaretPosition(u,a);c!==a&&!(a===0&&s===u.length)&&i.setPatchedCaretPosition(o,c,u),i.props.onFocus(r)},0)},t.prototype.render=function(){var r=this.props,i=r.type,o=r.displayType,a=r.customInput,s=r.renderText,u=r.getInputRef,c=r.format;r.thousandSeparator,r.decimalSeparator,r.allowedDecimalSeparators,r.thousandsGroupStyle,r.decimalScale,r.fixedDecimalScale,r.prefix,r.suffix,r.removeFormatting,r.mask,r.defaultValue,r.isNumericString,r.allowNegative,r.allowEmptyFormatting,r.allowLeadingZeros,r.onValueChange,r.isAllowed,r.customNumerals,r.onChange,r.onKeyDown,r.onMouseUp,r.onFocus,r.onBlur,r.value;var l=UL(r,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"]),f=l,d=this.state,p=d.value,h=d.mounted,v=h&&BL(c)?"numeric":void 0,x=Object.assign({inputMode:v},f,{type:i,value:p,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(o==="text")return s?s(p,f)||null:O.createElement("span",Object.assign({},f,{ref:u}),p);if(a){var E=a;return O.createElement(E,Object.assign({},x,{ref:u}))}return O.createElement("input",Object.assign({},x,{ref:u}))},t}(O.Component);ox.defaultProps=GL;function zL(e,t,n){var r=this,i=O.useRef(null),o=O.useRef(0),a=O.useRef(null),s=O.useRef([]),u=O.useRef(),c=O.useRef(),l=O.useRef(e),f=O.useRef(!0);O.useEffect(function(){l.current=e},[e]);var d=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var p=!!(n=n||{}).leading,h=!("trailing"in n)||!!n.trailing,v="maxWait"in n,x=v?Math.max(+n.maxWait||0,t):null;O.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var E=O.useMemo(function(){var y=function(D){var I=s.current,N=u.current;return s.current=u.current=null,o.current=D,c.current=l.current.apply(N,I)},S=function(D,I){d&&cancelAnimationFrame(a.current),a.current=d?requestAnimationFrame(D):setTimeout(D,I)},w=function(D){if(!f.current)return!1;var I=D-i.current;return!i.current||I>=t||I<0||v&&D-o.current>=x},b=function(D){return a.current=null,h&&s.current?y(D):(s.current=u.current=null,c.current)},T=function D(){var I=Date.now();if(w(I))return b(I);if(f.current){var N=t-(I-i.current),_=v?Math.min(N,x-(I-o.current)):N;S(D,_)}},A=function(){var D=Date.now(),I=w(D);if(s.current=[].slice.call(arguments),u.current=r,i.current=D,I){if(!a.current&&f.current)return o.current=i.current,S(T,t),p?y(i.current):c.current;if(v)return S(T,t),y(i.current)}return a.current||S(T,t),c.current};return A.cancel=function(){a.current&&(d?cancelAnimationFrame(a.current):clearTimeout(a.current)),o.current=0,s.current=i.current=u.current=a.current=null},A.isPending=function(){return!!a.current},A.flush=function(){return a.current?b(Date.now()):c.current},A},[p,v,t,x,h,d]);return E}var ax=function(){function e(t,n,r){this.r=0,this.g=0,this.b=0,this.set(t,n,r)}return e.prototype.set=function(t,n,r){this.r=this.clamp(t),this.g=this.clamp(n),this.b=this.clamp(r)},e.prototype.hueRotate=function(t){t===void 0&&(t=0),t=t/180*Math.PI;var n=Math.sin(t),r=Math.cos(t);this.multiply([.213+r*.787-n*.213,.715-r*.715-n*.715,.072-r*.072+n*.928,.213-r*.213+n*.143,.715+r*.285+n*.14,.072-r*.072-n*.283,.213-r*.213-n*.787,.715-r*.715+n*.715,.072+r*.928+n*.072])},e.prototype.grayscale=function(t){t===void 0&&(t=1),this.multiply([.2126+.7874*(1-t),.7152-.7152*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152+.2848*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152-.7152*(1-t),.0722+.9278*(1-t)])},e.prototype.sepia=function(t){t===void 0&&(t=1),this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])},e.prototype.saturate=function(t){t===void 0&&(t=1),this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])},e.prototype.multiply=function(t){var n=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),r=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),i=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=n,this.g=r,this.b=i},e.prototype.brightness=function(t){t===void 0&&(t=1),this.linear(t)},e.prototype.contrast=function(t){t===void 0&&(t=1),this.linear(t,-(.5*t)+.5)},e.prototype.linear=function(t,n){t===void 0&&(t=1),n===void 0&&(n=0),this.r=this.clamp(this.r*t+n*255),this.g=this.clamp(this.g*t+n*255),this.b=this.clamp(this.b*t+n*255)},e.prototype.invert=function(t){t===void 0&&(t=1),this.r=this.clamp((t+this.r/255*(1-2*t))*255),this.g=this.clamp((t+this.g/255*(1-2*t))*255),this.b=this.clamp((t+this.b/255*(1-2*t))*255)},e.prototype.hsl=function(){var t=this.r/255,n=this.g/255,r=this.b/255,i=Math.max(t,n,r),o=Math.min(t,n,r),a=0,s=0,u=(i+o)/2;if(i===o)return{h:0,s:0,l:u*100};var c=i-o;return s=u>.5?c/(2-i-o):c/(i+o),i===t?a=(n-r)/c+(n<r?6:0):i===n?a=(r-t)/c+2:i===r&&(a=(t-n)/c+4),a/=6,{h:a*100,s:s*100,l:u*100}},e.prototype.clamp=function(t){return Math.min(Math.max(t,0),255)},e}(),WL=function(){function e(t,n){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},n),this.reusedColor=new ax(0,0,0)}return e.prototype.solve=function(){var t=this.solveNarrow(this.solveWide());return{values:t.values,called:t.called,loss:t.loss,filter:this.css(t.values)}},e.prototype.solveWide=function(){for(var t=5,n=15,r=[60,180,18e3,600,1.2,1.2],i={loss:1/0},o=0;i.loss>this.options.acceptanceLossPercentage;){var a=[50,20,3750,50,100,100],s=this.spsa({A:t,a:r,c:n,values:a,maxTriesInLoop:1e3});if(s.loss<i.loss&&(i=s),o+=1,o>=this.options.maxChecks)break}return Object.assign({},i,{called:o})},e.prototype.solveNarrow=function(t){var n=t.loss,r=2,i=n+1,o=[.25*i,.25*i,i,.25*i,.2*i,.2*i];return this.spsa({A:n,a:o,c:r,values:t.values,maxTriesInLoop:500,called:t.called})},e.prototype.fixValueByFilterIDX=function(t,n){var r=100;return n===2?r=7500:(n===4||n===5)&&(r=200),n===3?t>r?t%=r:t<0&&(t=r+t%r):t<0?t=0:t>r&&(t=r),t},e.prototype.spsa=function(t){for(var n=t.A,r=t.a,i=t.c,o=t.values,a=t.maxTriesInLoop,s=a===void 0?500:a,u=t.called,c=u===void 0?0:u,l=1,f=.16666666666666666,d=null,p=1/0,h=new Array(6),v=new Array(6),x=new Array(6),E=6,y=0;y<s;y++){for(var S=i/Math.pow(y+1,f),w=0;w<E;w++)h[w]=Math.random()>.5?1:-1,v[w]=o[w]+S*h[w],x[w]=o[w]-S*h[w];for(var b=this.loss(v)-this.loss(x),w=0;w<E;w++){var T=b/(2*S)*h[w],A=r[w]/Math.pow(n+y+1,l);o[w]=this.fixValueByFilterIDX(o[w]-A*T,w)}var D=this.loss(o);D<p&&(d=o.slice(0),p=D)}return{values:d,loss:p,called:c}},e.prototype.loss=function(t){var n=this.reusedColor;n.set(0,0,0),n.invert(t[0]/100),n.sepia(t[1]/100),n.saturate(t[2]/100),n.hueRotate(t[3]*3.6),n.brightness(t[4]/100),n.contrast(t[5]/100);var r=n.hsl();return Math.abs(n.r-this.target.r)+Math.abs(n.g-this.target.g)+Math.abs(n.b-this.target.b)+Math.abs(r.h-this.targetHSL.h)+Math.abs(r.s-this.targetHSL.s)+Math.abs(r.l-this.targetHSL.l)},e.prototype.css=function(t){var n=function(r,i){return i===void 0&&(i=1),Math.round(t[r]*i)};return["invert("+n(0)+"%)","sepia("+n(1)+"%)","saturate("+n(2)+"%)","hue-rotate("+n(3,3.6)+"deg)","brightness("+n(4)+"%)","contrast("+n(5)+"%);"].join(" ")},e}(),HL=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])]:[]},Xf=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Jf={},KL=function(e,t){var n;t===void 0&&(t={});var r,i,o;if(Jf[e]&&!t.forceFilterRecalculation)return Object.assign({},Jf[e],{cache:!0});var a;try{if(n=E_(HL(e),3),r=n[0],i=n[1],o=n[2],!Xf(r)||!Xf(i)||!Xf(o))throw new Error("hextToRgb returned an invalid value for '"+e+"'");a=new ax(Number(r),Number(i),Number(o))}catch(u){throw new Error("Color value should be in HEX format. "+u)}var s=new WL(a,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},t));return Jf[e]=Object.assign({},s.solve(),{hex:e,rgb:[r,i,o],cache:!1})};const YL=(e,t,n,r)=>(n|t<<8|e<<16|1<<24).toString(16).slice(1)+r;function XL(e,t,n,r){let i=(e+(r||"")).toString().includes("%");if(typeof e=="string"&&!t){const o=JL(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 YL(e,t,n,r)}const JL=e=>{const t=e.replace(/rgba?\(([^)]+)\)/,"$1").split(/[,\s/]+/).filter(Boolean);if(t.length<3)return;const n=(s,u)=>(s=s.trim(),s.endsWith("%")?Math.min(Number.parseFloat(s)*u/100,u):Math.min(Number.parseFloat(s),u)),r=n(t[0],255),i=n(t[1],255),o=n(t[2],255);let a;return t.length===4&&(a=n(t[3],1)),[r,i,o,a]};function QL(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 ZL(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),QL(e)}function In(){return P.RenderTarget.current()!==P.RenderTarget.preview}function eV(e){if(In())return null;const{error:t}=dv();if(!t)return null;switch(t.type){case vt.ConfigurationModelNotFound:return O.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:$.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case vt.ConfigurationUnauthenticated:return O.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:$.jsx("span",{children:"The HCA access token is invalid."});case vt.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 vt.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 jo(e){return O.forwardRef((t,n)=>$.jsx(w_,{fallbackRender:()=>$.jsx("span",{children:"Component crashed"}),children:$.jsx(e,{...t,ref:n})}))}const tV=Cu`
|
|
980
|
+
:root {
|
|
981
|
+
--font-primary: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
982
|
+
--font-heading: "Inter-Medium", "Inter", "Inter Placeholder", sans-serif;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
/* font sizes */
|
|
986
|
+
:root {
|
|
987
|
+
--text-base-size: calc(var(--framer-font-size, 16px) * var(--framer-font-size-scale, 1));
|
|
988
|
+
--text-scale-ratio: 1.2;
|
|
989
|
+
|
|
990
|
+
--text-xs: calc(1em / (var(--text-scale-ratio) * var(--text-scale-ratio)));
|
|
991
|
+
--text-sm: calc(1em / var(--text-scale-ratio));
|
|
992
|
+
--text-md: calc(1em * var(--text-scale-ratio));
|
|
993
|
+
--text-lg: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
994
|
+
--text-xl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
995
|
+
--text-xxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
996
|
+
--text-xxxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
997
|
+
}
|
|
998
|
+
`,nV=tV,rV=Cu`
|
|
999
|
+
:root {
|
|
1000
|
+
--space-unit: 1em;
|
|
1001
|
+
--space-xxs: calc(0.25 * var(--space-unit));
|
|
1002
|
+
--space-xs: calc(0.5 * var(--space-unit));
|
|
1003
|
+
--space-sm: calc(0.75 * var(--space-unit));
|
|
1004
|
+
--space-md: calc(1.25 * var(--space-unit));
|
|
1005
|
+
--space-lg: calc(2 * var(--space-unit));
|
|
1006
|
+
--space-xl: calc(3.25 * var(--space-unit));
|
|
1007
|
+
--space-xxl: calc(5.25 * var(--space-unit));
|
|
1008
|
+
|
|
1009
|
+
--space-unit-fixed: var(--text-base-size);
|
|
1010
|
+
--space-xxs-fixed: calc(0.25 * var(--space-unit-fixed));
|
|
1011
|
+
--space-xs-fixed: calc(0.5 * var(--space-unit-fixed));
|
|
1012
|
+
--space-sm-fixed: calc(0.75 * var(--space-unit-fixed));
|
|
1013
|
+
--space-md-fixed: calc(1.25 * var(--space-unit-fixed));
|
|
1014
|
+
--space-lg-fixed: calc(2 * var(--space-unit-fixed));
|
|
1015
|
+
--space-xl-fixed: calc(3.25 * var(--space-unit-fixed));
|
|
1016
|
+
--space-xxl-fixed: calc(5.25 * var(--space-unit-fixed));
|
|
1017
|
+
}
|
|
1018
|
+
`,iV=rV,oV=Cu`
|
|
1019
|
+
:root {
|
|
1020
|
+
--shape-border-radius-xs: 5px;
|
|
1021
|
+
--shape-border-radius-sm: 7px;
|
|
1022
|
+
--shape-border-radius-md: 12px;
|
|
1023
|
+
--shape-border-radius-lg: 20px;
|
|
1024
|
+
}
|
|
1025
|
+
`,aV=oV,sV=Cu`
|
|
1026
|
+
:root {
|
|
1027
|
+
--shadows-popover: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4));
|
|
1028
|
+
--shadows-dialog: 0.2px 0.4px 2.3px rgba(0, 0, 0, 0.02),
|
|
1029
|
+
0.6px 1px 5.7px rgba(0, 0, 0, 0.025),
|
|
1030
|
+
1.2px 2.1px 10.6px rgba(0, 0, 0, 0.03),
|
|
1031
|
+
2.3px 4px 17.2px rgba(0, 0, 0, 0.034),
|
|
1032
|
+
4.2px 7.2px 25.9px rgba(0, 0, 0, 0.04),
|
|
1033
|
+
7.6px 12.8px 37.7px rgba(0, 0, 0, 0.048),
|
|
1034
|
+
13.9px 23.6px 54.7px rgba(0, 0, 0, 0.061),
|
|
1035
|
+
40px 68px 96px rgba(0, 0, 0, 0.1);
|
|
1036
|
+
}
|
|
1037
|
+
`,uV=sV;function gg(){return $.jsxs($.Fragment,{children:[$.jsx(uV,{}),$.jsx(aV,{}),$.jsx(iV,{}),$.jsx(nV,{})]})}const eu=O.createContext(null);function Gi(){const{process:e,switchMode:t,applySolution:n,dismiss:r}=O.useContext(eu);return e?{...e,switchMode:t,applySolution:n,dismiss:r}:null}function sx(e){const{explanation:t,...n}=e,r=Gi();return $.jsx("button",{...n,onClick:()=>r.applySolution(t.solution),children:e.children})}function ux(e){return H(e).returnType().with({type:W.Choice},t=>t.choiceValueId).with({type:W.Boolean},t=>t.state.toString()).with({type:W.Component},t=>t.state).with({type:W.Numeric},t=>t.state.toString()).exhaustive()}const cV=Ie.div`
|
|
1038
|
+
display: flex;
|
|
1039
|
+
gap: var(--space-xs);
|
|
1040
|
+
align-items: center;
|
|
1041
|
+
background-color: var(--color-explain-attribute-value-fill);
|
|
1042
|
+
border-radius: 360px;
|
|
1043
|
+
padding-right: var(--space-sm);
|
|
1044
|
+
font-size: 0.9em;
|
|
1045
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1046
|
+
font-weight: 500;
|
|
1047
|
+
min-width: 0;
|
|
1048
|
+
`,lV=Ie.div`
|
|
1049
|
+
display: grid;
|
|
1050
|
+
place-content: center;
|
|
1051
|
+
border-top-left-radius: 360px;
|
|
1052
|
+
border-bottom-left-radius: 360px;
|
|
1053
|
+
height: 1.5em;
|
|
1054
|
+
width: 1.5em;
|
|
1055
|
+
flex-shrink: 0;
|
|
1056
|
+
|
|
1057
|
+
&.mode-add {
|
|
1058
|
+
background-color: var(--color-explain-attribute-value-add-fill);
|
|
1059
|
+
color: var(--color-explain-attribute-value-add-color);
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
&.mode-remove {
|
|
1063
|
+
background-color: var(--color-explain-attribute-value-remove-fill);
|
|
1064
|
+
color: var(--color-explain-attribute-value-remove-color);
|
|
1065
|
+
}
|
|
1066
|
+
`,fV=Ie.div`
|
|
1067
|
+
white-space: nowrap;
|
|
1068
|
+
overflow: hidden;
|
|
1069
|
+
text-overflow: ellipsis;
|
|
1070
|
+
`;function dV(e){const{decision:t}=e,n=t.intention,r=ux(t);return $.jsxs(cV,{children:[$.jsxs(lV,{className:`mode-${n}`,children:[n==="remove"&&$.jsx(ji,{icon:Oq}),n==="add"&&$.jsx(ji,{icon:Dq})]}),$.jsx(fV,{children:r})]})}const pV=Ie.div`
|
|
1071
|
+
display: grid;
|
|
1072
|
+
grid-template-columns: subgrid;
|
|
1073
|
+
grid-column: span 2;
|
|
1074
|
+
align-items: center;
|
|
1075
|
+
`,hV=Ie.div`
|
|
1076
|
+
grid-area: name;
|
|
1077
|
+
white-space: nowrap;
|
|
1078
|
+
overflow: hidden;
|
|
1079
|
+
text-overflow: ellipsis;
|
|
1080
|
+
`,vV=Ie.div`
|
|
1081
|
+
grid-area: values;
|
|
1082
|
+
display: flex;
|
|
1083
|
+
flex-wrap: wrap;
|
|
1084
|
+
min-width: 0;
|
|
1085
|
+
gap: var(--space-xxs);
|
|
1086
|
+
`,mV=m(Vs,Kr(e=>ux(e)));function yV(e){const{decisions:t}=e,n=t[0].attributeId,r=m(t,Wl(mV));return $.jsxs(pV,{children:[$.jsx(hV,{children:n.localId}),$.jsx(vV,{children:r.map((i,o)=>$.jsx(dV,{decision:i},o))})]})}function gV(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 bV=m(Vs,Kr(e=>e.attributeId.localId));function cx(e){const{blockingDecisions:t,desiredDecisions:n,...r}=e,i=m([...n.map(o=>({...o,intention:"add"})),...t.map(o=>({...o,intention:"remove"}))],pC(o=>gV(o.attributeId)),Hh(R2)((o,a)=>({key:o,attributeId:hC(a).attributeId,decisions:a})),Wl(bV));return $.jsx("div",{...r,children:i.map(o=>$.jsx(yV,{decisions:o.decisions},o.key))})}const SV=Ie.div`
|
|
1087
|
+
background-color: var(--color-explain-dialog-explanation-card);
|
|
1088
|
+
padding: var(--space-sm-fixed);
|
|
1089
|
+
box-shadow: 2px 1px 10px -5px rgba(0, 0, 0, 0.4);
|
|
1090
|
+
border-radius: var(--shape-border-radius-sm);
|
|
1091
|
+
`,lx=SV,CV=Ie(cx)`
|
|
1092
|
+
display: grid;
|
|
1093
|
+
grid-template-columns: [name] minmax(150px, auto) [values] minmax(0px, 1fr);
|
|
1094
|
+
gap: var(--space-sm);
|
|
1095
|
+
`,wV=Ie(sx)`
|
|
1096
|
+
border-radius: var(--shape-border-radius-sm);
|
|
1097
|
+
background-color: var(--color-explain-dialog-apply-solution-button-fill);
|
|
1098
|
+
color: var(--color-explain-dialog-apply-solution-button-color);
|
|
1099
|
+
font-size: 0.9em;
|
|
1100
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1101
|
+
font-weight: 600;
|
|
1102
|
+
appearance: none;
|
|
1103
|
+
padding: 0.6em 1em;
|
|
1104
|
+
border: none;
|
|
1105
|
+
width: auto;
|
|
1106
|
+
margin-top: var(--space-md);
|
|
1107
|
+
|
|
1108
|
+
&:focus {
|
|
1109
|
+
outline: 2px solid var(--color-explain-dialog-apply-solution-button-outline);
|
|
1110
|
+
outline-offset: 1px;
|
|
1111
|
+
}
|
|
1112
|
+
`;function xV(e){const{explanation:t}=e,n=t.solution.decisions.filter(r=>r.state!=null);return $.jsxs(lx,{children:[$.jsx(CV,{blockingDecisions:t.causedByDecisions,desiredDecisions:n}),$.jsx(wV,{explanation:t,children:"Apply solution"})]})}const EV=Ie(lx)`
|
|
1113
|
+
ul {
|
|
1114
|
+
margin: 0;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
line-height: 1.5em;
|
|
1118
|
+
`,TV=Ie.ul`
|
|
1119
|
+
list-style-type: none;
|
|
1120
|
+
margin-inline-start: 0;
|
|
1121
|
+
padding-inline-start: 0;
|
|
1122
|
+
`,bg=Ie.ul`
|
|
1123
|
+
list-style-type: disc;
|
|
1124
|
+
margin-inline-start: 0;
|
|
1125
|
+
padding-inline-start: var(--space-lg);
|
|
1126
|
+
`,Sg=Ie.li`
|
|
1127
|
+
font-size: 0.9em;
|
|
1128
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1129
|
+
font-weight: 500;
|
|
1130
|
+
`;function IV(e){const{explanation:t}=e,n=t.causedByCardinalities,r=m(t.causedByRules,pC(i=>i.configurationModelId),Hh(Vs)((i,o)=>({configurationModelId:i,rules:m(o,G(a=>a.localId),Wl(Vs))})));return $.jsx(EV,{children:$.jsxs(TV,{children:[r.map(i=>$.jsxs("li",{children:[$.jsx("span",{children:i.configurationModelId}),$.jsx(bg,{children:i.rules.map(o=>$.jsx(Sg,{children:o}))})]})),n.length>0&&$.jsxs("li",{children:[$.jsx("span",{children:"Cardinality"}),$.jsx(bg,{children:n.map(i=>$.jsx(Sg,{children:i.localId}))})]})]})})}function fx(e){const{variant:t,...n}=e,{explainQuestion:r}=Gi(),i=H(r).returnType().with({question:qt.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:qt.whyIsNotSatisfied,subject:Qe.configuration},()=>"why your configuration is not satisfied").with({question:qt.whyIsNotSatisfied,subject:Qe.attribute},()=>"why your attribute is not satisfied").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 Cg=Ie.div`
|
|
1131
|
+
font-weight: 500;
|
|
1132
|
+
font-family: var(--font-heading);
|
|
1133
|
+
margin-bottom: var(--space-xs);
|
|
1134
|
+
margin-left: var(--space-sm-fixed);
|
|
1135
|
+
`,wg=Ie.div`
|
|
1136
|
+
display: flex;
|
|
1137
|
+
flex-direction: column;
|
|
1138
|
+
gap: var(--space-xs);
|
|
1139
|
+
`,AV=Ie.div`
|
|
1140
|
+
display: flex;
|
|
1141
|
+
flex-direction: column;
|
|
1142
|
+
gap: var(--space-md);
|
|
1143
|
+
`,xg=Ie(fx)`
|
|
1144
|
+
width: min-content;
|
|
1145
|
+
min-width: 400px;
|
|
1146
|
+
margin: var(--space-sm-fixed) var(--space-md-fixed) var(--space-sm-fixed) var(--space-sm-fixed);
|
|
1147
|
+
`;function $V(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=Gi();return n?$.jsx(xg,{variant:"failedToExplain"}):e.length===0&&t.length===0?$.jsx(xg,{variant:"noExplanationFound"}):$.jsxs(AV,{children:[e.length>0&&$.jsxs("div",{children:[$.jsx(Cg,{children:"Solutions"}),$.jsx(wg,{children:e.map(r=>$.jsx(xV,{explanation:r},e.indexOf(r)))})]}),t.length>0&&$.jsxs("div",{children:[$.jsx(Cg,{children:"Constraint Explanations"}),$.jsx(wg,{children:t.map(r=>$.jsx(IV,{explanation:r},t.indexOf(r)))})]})]})}function Zr(e){return dx(e)?(e.nodeName||"").toLowerCase():"#document"}function Qn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ri(e){var t;return(t=(dx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dx(e){return e instanceof Node||e instanceof Qn(e).Node}function Ft(e){return e instanceof Element||e instanceof Qn(e).Element}function $n(e){return e instanceof HTMLElement||e instanceof Qn(e).HTMLElement}function Lp(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qn(e).ShadowRoot}function Tu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function OV(e){return["table","td","th"].includes(Zr(e))}function kv(e){const t=Mv(),n=Zn(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 px(e){let t=$o(e);for(;$n(t)&&!Ia(t);){if(kv(t))return t;t=$o(t)}return null}function Mv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ia(e){return["html","body","#document"].includes(Zr(e))}function Zn(e){return Qn(e).getComputedStyle(e)}function gf(e){return Ft(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function $o(e){if(Zr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lp(e)&&e.host||ri(e);return Lp(t)?t.host:t}function hx(e){const t=$o(e);return Ia(t)?e.ownerDocument?e.ownerDocument.body:e.body:$n(t)&&Tu(t)?t:hx(t)}function Ti(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=hx(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Qn(i);return o?t.concat(a,a.visualViewport||[],Tu(i)?i:[],a.frameElement&&n?Ti(a.frameElement):[]):t.concat(i,Ti(i,[],n))}function na(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 Bn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Lp(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function vx(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function mx(){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 DV(e){return e.mozInputSource===0&&e.isTrusted?!0:Vp()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function NV(e){return RV()?!1:!Vp()&&e.width===0&&e.height===0||Vp()&&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 PV(){return/apple/i.test(navigator.vendor)}function Vp(){const e=/android/i;return e.test(vx())||e.test(mx())}function RV(){return mx().includes("jsdom/")}function Eg(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function kV(e){return"nativeEvent"in e}function MV(e){return e.matches("html,body")}function Br(e){return(e==null?void 0:e.ownerDocument)||document}function Qf(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 ra(e){return"composedPath"in e?e.composedPath()[0]:e.target}const jV="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function yx(e){return $n(e)&&e.matches(jV)}function Zf(e){e.preventDefault(),e.stopPropagation()}function _V(e){return e?e.getAttribute("role")==="combobox"&&yx(e):!1}const Aa=Math.min,vo=Math.max,sl=Math.round,oc=Math.floor,_i=e=>({x:e,y:e}),qV={left:"right",right:"left",bottom:"top",top:"bottom"},FV={start:"end",end:"start"};function Bp(e,t,n){return vo(e,Aa(t,n))}function Iu(e,t){return typeof e=="function"?e(t):e}function Oo(e){return e.split("-")[0]}function Au(e){return e.split("-")[1]}function gx(e){return e==="x"?"y":"x"}function jv(e){return e==="y"?"height":"width"}function bf(e){return["top","bottom"].includes(Oo(e))?"y":"x"}function _v(e){return gx(bf(e))}function LV(e,t,n){n===void 0&&(n=!1);const r=Au(e),i=_v(e),o=jv(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=ul(a)),[a,ul(a)]}function VV(e){const t=ul(e);return[Up(e),t,Up(t)]}function Up(e){return e.replace(/start|end/g,t=>FV[t])}function BV(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 UV(e,t,n,r){const i=Au(e);let o=BV(Oo(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Up)))),o}function ul(e){return e.replace(/left|right|bottom|top/g,t=>qV[t])}function GV(e){return{top:0,right:0,bottom:0,left:0,...e}}function bx(e){return typeof e!="number"?GV(e):{top:e,right:e,bottom:e,left:e}}function cl(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Tg(e,t,n){let{reference:r,floating:i}=e;const o=bf(t),a=_v(t),s=jv(a),u=Oo(t),c=o==="y",l=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[s]/2-i[s]/2;let p;switch(u){case"top":p={x:l,y:r.y-i.height};break;case"bottom":p={x:l,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Au(t)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1);break}return p}const zV=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=Tg(c,r,u),d=r,p={},h=0;for(let v=0;v<s.length;v++){const{name:x,fn:E}=s[v],{x:y,y:S,data:w,reset:b}=await E({x:l,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});l=y??l,f=S??f,p={...p,[x]:{...p[x],...w}},b&&h<=50&&(h++,typeof b=="object"&&(b.placement&&(d=b.placement),b.rects&&(c=b.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),{x:l,y:f}=Tg(c,d,u)),v=-1)}return{x:l,y:f,placement:d,strategy:i,middlewareData:p}};async function Sx(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Iu(t,e),h=bx(p),v=s[d?f==="floating"?"reference":"floating":f],x=cl(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:l,strategy:u})),E=f==="floating"?{...a.floating,x:r,y:i}:a.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),S=await(o.isElement==null?void 0:o.isElement(y))?await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1}:{x:1,y:1},w=cl(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:y,strategy:u}):E);return{top:(x.top-w.top+h.top)/S.y,bottom:(w.bottom-x.bottom+h.bottom)/S.y,left:(x.left-w.left+h.left)/S.x,right:(w.right-x.right+h.right)/S.x}}const WV=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:u}=t,{element:c,padding:l=0}=Iu(e,t)||{};if(c==null)return{};const f=bx(l),d={x:n,y:r},p=_v(i),h=jv(p),v=await a.getDimensions(c),x=p==="y",E=x?"top":"left",y=x?"bottom":"right",S=x?"clientHeight":"clientWidth",w=o.reference[h]+o.reference[p]-d[p]-o.floating[h],b=d[p]-o.reference[p],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let A=T?T[S]:0;(!A||!await(a.isElement==null?void 0:a.isElement(T)))&&(A=s.floating[S]||o.floating[h]);const D=w/2-b/2,I=A/2-v[h]/2-1,N=Aa(f[E],I),_=Aa(f[y],I),L=N,B=A-v[h]-_,K=A/2-v[h]/2+D,k=Bp(L,K,B),ie=!u.arrow&&Au(i)!=null&&K!==k&&o.reference[h]/2-(K<L?N:_)-v[h]/2<0,V=ie?K<L?K-L:K-B:0;return{[p]:d[p]+V,data:{[p]:k,centerOffset:K-k-V,...ie&&{alignmentOffset:V}},reset:ie}}}),HV=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:u,elements:c}=t,{mainAxis:l=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...x}=Iu(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Oo(i),y=Oo(s)===s,S=await(u.isRTL==null?void 0:u.isRTL(c.floating)),w=d||(y||!v?[ul(s)]:VV(s));!d&&h!=="none"&&w.push(...UV(s,v,h,S));const b=[s,...w],T=await Sx(t,x),A=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(l&&A.push(T[E]),f){const L=LV(i,a,S);A.push(T[L[0]],T[L[1]])}if(D=[...D,{placement:i,overflows:A}],!A.every(L=>L<=0)){var I,N;const L=(((I=o.flip)==null?void 0:I.index)||0)+1,B=b[L];if(B)return{data:{index:L,overflows:D},reset:{placement:B}};let K=(N=D.filter(k=>k.overflows[0]<=0).sort((k,ie)=>k.overflows[1]-ie.overflows[1])[0])==null?void 0:N.placement;if(!K)switch(p){case"bestFit":{var _;const k=(_=D.map(ie=>[ie.placement,ie.overflows.filter(V=>V>0).reduce((V,U)=>V+U,0)]).sort((ie,V)=>ie[1]-V[1])[0])==null?void 0:_[0];k&&(K=k);break}case"initialPlacement":K=s;break}if(i!==K)return{reset:{placement:K}}}return{}}}};async function KV(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Oo(n),s=Au(n),u=bf(n)==="y",c=["left","top"].includes(a)?-1:1,l=o&&u?-1:1,f=Iu(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),u?{x:p*l,y:d*c}:{x:d*c,y:p*l}}const YV=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 KV(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}}}}},XV=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:x=>{let{x:E,y}=x;return{x:E,y}}},...u}=Iu(e,t),c={x:n,y:r},l=await Sx(t,u),f=bf(Oo(i)),d=gx(f);let p=c[d],h=c[f];if(o){const x=d==="y"?"top":"left",E=d==="y"?"bottom":"right",y=p+l[x],S=p-l[E];p=Bp(y,p,S)}if(a){const x=f==="y"?"top":"left",E=f==="y"?"bottom":"right",y=h+l[x],S=h-l[E];h=Bp(y,h,S)}const v=s.fn({...t,[d]:p,[f]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function Cx(e){const t=Zn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=$n(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=sl(n)!==o||sl(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function qv(e){return Ft(e)?e:e.contextElement}function ga(e){const t=qv(e);if(!$n(t))return _i(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Cx(t);let a=(o?sl(n.width):n.width)/r,s=(o?sl(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const JV=_i(0);function wx(e){const t=Qn(e);return!Mv()||!t.visualViewport?JV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function QV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qn(e)?!1:t}function Do(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=qv(e);let a=_i(1);t&&(r?Ft(r)&&(a=ga(r)):a=ga(e));const s=QV(o,n,r)?wx(o):_i(0);let u=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,l=i.width/a.x,f=i.height/a.y;if(o){const d=Qn(o),p=r&&Ft(r)?Qn(r):r;let h=d.frameElement;for(;h&&r&&p!==d;){const v=ga(h),x=h.getBoundingClientRect(),E=Zn(h),y=x.left+(h.clientLeft+parseFloat(E.paddingLeft))*v.x,S=x.top+(h.clientTop+parseFloat(E.paddingTop))*v.y;u*=v.x,c*=v.y,l*=v.x,f*=v.y,u+=y,c+=S,h=Qn(h).frameElement}}return cl({width:l,height:f,x:u,y:c})}const ZV=[":popover-open",":modal"];function xx(e){let t=!1,n=0,r=0;function i(o){try{t=t||e.matches(o)}catch{}}if(ZV.forEach(o=>{i(o)}),t){const o=px(e);if(o){const a=o.getBoundingClientRect();n=a.x,r=a.y}}return[t,n,r]}function e5(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=ri(r),[a]=t?xx(t.floating):[!1];if(r===o||a)return n;let s={scrollLeft:0,scrollTop:0},u=_i(1);const c=_i(0),l=$n(r);if((l||!l&&i!=="fixed")&&((Zr(r)!=="body"||Tu(o))&&(s=gf(r)),$n(r))){const f=Do(r);u=ga(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+c.x,y:n.y*u.y-s.scrollTop*u.y+c.y}}function t5(e){return Array.from(e.getClientRects())}function Ex(e){return Do(ri(e)).left+gf(e).scrollLeft}function n5(e){const t=ri(e),n=gf(e),r=e.ownerDocument.body,i=vo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=vo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Ex(e);const s=-n.scrollTop;return Zn(r).direction==="rtl"&&(a+=vo(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function r5(e,t){const n=Qn(e),r=ri(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const c=Mv();(!c||c&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s,y:u}}function i5(e,t){const n=Do(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=$n(e)?ga(e):_i(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,c=r*o.y;return{width:a,height:s,x:u,y:c}}function Ig(e,t,n){let r;if(t==="viewport")r=r5(e,n);else if(t==="document")r=n5(ri(e));else if(Ft(t))r=i5(t,n);else{const i=wx(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return cl(r)}function Tx(e,t){const n=$o(e);return n===t||!Ft(n)||Ia(n)?!1:Zn(n).position==="fixed"||Tx(n,t)}function o5(e,t){const n=t.get(e);if(n)return n;let r=Ti(e,[],!1).filter(s=>Ft(s)&&Zr(s)!=="body"),i=null;const o=Zn(e).position==="fixed";let a=o?$o(e):e;for(;Ft(a)&&!Ia(a);){const s=Zn(a),u=kv(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&i&&["absolute","fixed"].includes(i.position)||Tu(a)&&!u&&Tx(e,a))?r=r.filter(c=>c!==a):i=s,a=$o(a)}return t.set(e,r),r}function a5(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?o5(t,this._c):[].concat(n),r],a=o[0],s=o.reduce((u,c)=>{const l=Ig(t,c,i);return u.top=vo(l.top,u.top),u.right=Aa(l.right,u.right),u.bottom=Aa(l.bottom,u.bottom),u.left=vo(l.left,u.left),u},Ig(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function s5(e){const{width:t,height:n}=Cx(e);return{width:t,height:n}}function u5(e,t,n,r){const i=$n(t),o=ri(t),a=n==="fixed",s=Do(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const c=_i(0);if(i||!i&&!a)if((Zr(t)!=="body"||Tu(o))&&(u=gf(t)),i){const v=Do(t,!0,a,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else o&&(c.x=Ex(o));let l=s.left+u.scrollLeft-c.x,f=s.top+u.scrollTop-c.y;const[d,p,h]=xx(r);return d&&(l+=p,f+=h,i&&(l+=t.clientLeft,f+=t.clientTop)),{x:l,y:f,width:s.width,height:s.height}}function Ag(e,t){return!$n(e)||Zn(e).position==="fixed"?null:t?t(e):e.offsetParent}function Ix(e,t){const n=Qn(e);if(!$n(e))return n;let r=Ag(e,t);for(;r&&OV(r)&&Zn(r).position==="static";)r=Ag(r,t);return r&&(Zr(r)==="html"||Zr(r)==="body"&&Zn(r).position==="static"&&!kv(r))?n:r||px(e)||n}const c5=async function(e){const t=this.getOffsetParent||Ix,n=this.getDimensions;return{reference:u5(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function l5(e){return Zn(e).direction==="rtl"}const Ax={convertOffsetParentRelativeRectToViewportRelativeRect:e5,getDocumentElement:ri,getClippingRect:a5,getOffsetParent:Ix,getElementRects:c5,getClientRects:t5,getDimensions:s5,getScale:ga,isElement:Ft,isRTL:l5};function f5(e,t){let n=null,r;const i=ri(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),o();const{left:c,top:l,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const p=oc(l),h=oc(i.clientWidth-(c+f)),v=oc(i.clientHeight-(l+d)),x=oc(c),E={rootMargin:-p+"px "+-h+"px "+-v+"px "+-x+"px",threshold:vo(0,Aa(1,u))||1};let y=!0;function S(w){const b=w[0].intersectionRatio;if(b!==u){if(!y)return a();b?a(!1,b):r=setTimeout(()=>{a(!1,1e-7)},100)}y=!1}try{n=new IntersectionObserver(S,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,E)}n.observe(e)}return a(!0),o}function d5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=qv(e),l=i||o?[...c?Ti(c):[],...Ti(t)]:[];l.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const f=c&&s?f5(c,n):null;let d=-1,p=null;a&&(p=new ResizeObserver(E=>{let[y]=E;y&&y.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let h,v=u?Do(e):null;u&&x();function x(){const E=Do(e);v&&(E.x!==v.x||E.y!==v.y||E.width!==v.width||E.height!==v.height)&&n(),v=E,h=requestAnimationFrame(x)}return n(),()=>{var E;l.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),f==null||f(),(E=p)==null||E.disconnect(),p=null,u&&cancelAnimationFrame(h)}}const p5=XV,h5=HV,$g=WV,v5=(e,t,n)=>{const r=new Map,i={platform:Ax,...n},o={...i.platform,_c:r};return zV(e,t,{...i,platform:o})},m5=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?$g({element:r.current,padding:i}).fn(n):{}:r?$g({element:r,padding:i}).fn(n):{}}}};var Dc=typeof document<"u"?O.useLayoutEffect:O.useEffect;function ll(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(!ll(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)&&!ll(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function $x(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Og(e,t){const n=$x(e);return Math.round(t*n)/n}function Dg(e){const t=J.useRef(e);return Dc(()=>{t.current=e}),t}function y5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[l,f]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=J.useState(r);ll(d,r)||p(r);const[h,v]=J.useState(null),[x,E]=J.useState(null),y=J.useCallback(V=>{V!==T.current&&(T.current=V,v(V))},[]),S=J.useCallback(V=>{V!==A.current&&(A.current=V,E(V))},[]),w=o||h,b=a||x,T=J.useRef(null),A=J.useRef(null),D=J.useRef(l),I=u!=null,N=Dg(u),_=Dg(i),L=J.useCallback(()=>{if(!T.current||!A.current)return;const V={placement:t,strategy:n,middleware:d};_.current&&(V.platform=_.current),v5(T.current,A.current,V).then(U=>{const fe={...U,isPositioned:!0};B.current&&!ll(D.current,fe)&&(D.current=fe,I1.flushSync(()=>{f(fe)}))})},[d,t,n,_]);Dc(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(V=>({...V,isPositioned:!1})))},[c]);const B=J.useRef(!1);Dc(()=>(B.current=!0,()=>{B.current=!1}),[]),Dc(()=>{if(w&&(T.current=w),b&&(A.current=b),w&&b){if(N.current)return N.current(w,b,L);L()}},[w,b,L,N,I]);const K=J.useMemo(()=>({reference:T,floating:A,setReference:y,setFloating:S}),[y,S]),k=J.useMemo(()=>({reference:w,floating:b}),[w,b]),ie=J.useMemo(()=>{const V={position:n,left:0,top:0};if(!k.floating)return V;const U=Og(k.floating,l.x),fe=Og(k.floating,l.y);return s?{...V,transform:"translate("+U+"px, "+fe+"px)",...$x(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:fe}},[n,s,k.floating,l.x,l.y]);return J.useMemo(()=>({...l,update:L,refs:K,elements:k,floatingStyles:ie}),[l,L,K,k,ie])}/*!
|
|
1148
|
+
* tabbable 6.2.0
|
|
1149
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
1150
|
+
*/var g5=["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])"],Gp=g5.join(","),Ox=typeof Element>"u",tu=Ox?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fl=!Ox&&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},dl=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},b5=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},S5=function(e,t,n){if(dl(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Gp));return t&&tu.call(e,Gp)&&r.unshift(e),r=r.filter(n),r},C5=function e(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!dl(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),u=s.length?s:a.children,c=e(u,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:a,candidates:c})}else{var l=tu.call(a,Gp);l&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),d=!dl(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&d){var p=e(f===!0?a.children:f.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:a,candidates:p})}else o.unshift.apply(o,a.children)}}return i},Dx=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Nx=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||b5(e))&&!Dx(e)?0:e.tabIndex},w5=function(e,t){var n=Nx(e);return n<0&&t&&!Dx(e)?0:n},x5=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Px=function(e){return e.tagName==="INPUT"},E5=function(e){return Px(e)&&e.type==="hidden"},T5=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},I5=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},A5=function(e){if(!e.name)return!0;var t=e.form||fl(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=I5(r,e.form);return!i||i===e},$5=function(e){return Px(e)&&e.type==="radio"},O5=function(e){return $5(e)&&!A5(e)},D5=function(e){var t,n=e&&fl(e),r=(t=n)===null||t===void 0?void 0:t.host,i=!1;if(n&&n!==e){var o,a,s;for(i=!!((o=r)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(r)||e!=null&&(s=e.ownerDocument)!==null&&s!==void 0&&s.contains(e));!i&&r;){var u,c,l;n=fl(r),r=(u=n)===null||u===void 0?void 0:u.host,i=!!((c=r)!==null&&c!==void 0&&(l=c.ownerDocument)!==null&&l!==void 0&&l.contains(r))}}return i},Ng=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},N5=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=tu.call(e,"details>summary:first-of-type"),o=i?e.parentElement:e;if(tu.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=fl(e);if(s&&!s.shadowRoot&&r(s)===!0)return Ng(e);e.assignedSlot?e=e.assignedSlot:!s&&u!==e.ownerDocument?e=u.host:e=s}e=a}if(D5(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return Ng(e);return!1},P5=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 tu.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},R5=function(e,t){return!(t.disabled||dl(t)||E5(t)||N5(t,e)||T5(t)||P5(t))},Pg=function(e,t){return!(O5(t)||Nx(t)<0||!R5(e,t))},k5=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},M5=function e(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,u=w5(s,a),c=a?e(i.candidates):s;u===0?a?n.push.apply(n,c):n.push(s):r.push({documentOrder:o,tabIndex:u,item:i,isScope:a,content:c})}),r.sort(x5).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},Fv=function(e,t){t=t||{};var n;return t.getShadowRoot?n=C5([e],t.includeContainer,{filter:Pg.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:k5}):n=S5(e,t.includeContainer,Pg.bind(null,t)),M5(n)};function Lv(e){return J.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const j5=J["useInsertionEffect".toString()],_5=j5||(e=>e());function ia(e){const t=J.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return _5(()=>{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 Rg=0;function Ji(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Rg);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Rg=requestAnimationFrame(o)}var or=typeof document<"u"?O.useLayoutEffect:O.useEffect;function $a(){return $a=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},$a.apply(this,arguments)}let ed=!1,q5=0;const kg=()=>"floating-ui-"+q5++;function F5(){const[e,t]=J.useState(()=>ed?kg():void 0);return or(()=>{e==null&&t(kg())},[]),J.useEffect(()=>{ed||(ed=!0)},[]),e}const L5=J["useId".toString()],Sf=L5||F5,V5=J.forwardRef(function(e,t){let{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i}},width:o=14,height:a=7,tipRadius:s=0,strokeWidth:u=0,staticOffset:c,stroke:l,d:f,style:{transform:d,...p}={},...h}=e;process.env.NODE_ENV!=="production"&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=Sf();if(!r)return null;u*=2;const x=u/2,E=o/2*(s/-8+1),y=a/2*s/4,[S,w]=n.split("-"),b=Ax.isRTL(r),T=!!f,A=S==="top"||S==="bottom",D=c&&w==="end"?"bottom":"top";let I=c&&w==="end"?"right":"left";c&&b&&(I=w==="end"?"left":"right");const N=(i==null?void 0:i.x)!=null?c||i.x:"",_=(i==null?void 0:i.y)!=null?c||i.y:"",L=f||"M0,0"+(" H"+o)+(" L"+(o-E)+","+(a-y))+(" Q"+o/2+","+a+" "+E+","+(a-y))+" Z",B={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[S];return J.createElement("svg",$a({},h,{"aria-hidden":!0,ref:t,width:T?o:o+u,height:o,viewBox:"0 0 "+o+" "+(a>o?a:o),style:{position:"absolute",pointerEvents:"none",[I]:N,[D]:_,[S]:A||T?"100%":"calc(100% - "+u/2+"px)",transform:""+B+(d??""),...p}}),u>0&&J.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:l,strokeWidth:u+(f?0:1),d:L}),J.createElement("path",{stroke:u&&!f?h.fill:"none",d:L}),J.createElement("clipPath",{id:v},J.createElement("rect",{x:-x,y:x*(T?-1:1),width:o+u,height:o})))});function B5(){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 U5=J.createContext(null),G5=J.createContext(null),z5=()=>{var e;return((e=J.useContext(U5))==null?void 0:e.id)||null},Vv=()=>J.useContext(G5);function nu(e){return"data-floating-ui-"+e}function td(e){const t=O.useRef(e);return or(()=>{t.current=e}),t}function W5(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 Os(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 Jo=new WeakMap,ac=new WeakSet,sc={},nd=0;const H5=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Rx=e=>e&&(e.host||Rx(e.parentNode)),K5=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Rx(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Y5(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=K5(t,e),s=new Set,u=new Set(a),c=[];sc[i]||(sc[i]=new WeakMap);const l=sc[i];a.forEach(f),d(t),s.clear();function f(p){!p||s.has(p)||(s.add(p),p.parentNode&&f(p.parentNode))}function d(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,h=>{if(s.has(h))d(h);else{const v=o?h.getAttribute(o):null,x=v!==null&&v!=="false",E=(Jo.get(h)||0)+1,y=(l.get(h)||0)+1;Jo.set(h,E),l.set(h,y),c.push(h),E===1&&x&&ac.add(h),y===1&&h.setAttribute(i,""),!x&&o&&h.setAttribute(o,"true")}})}return nd++,()=>{c.forEach(p=>{const h=(Jo.get(p)||0)-1,v=(l.get(p)||0)-1;Jo.set(p,h),l.set(p,v),h||(!ac.has(p)&&o&&p.removeAttribute(o),ac.delete(p)),v||p.removeAttribute(i)}),nd--,nd||(Jo=new WeakMap,Jo=new WeakMap,ac=new WeakSet,sc={})}}function Mg(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Br(e[0]).body;return Y5(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Bv=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function kx(e,t){const n=Fv(e,Bv());t==="prev"&&n.reverse();const r=n.indexOf(na(Br(e)));return n.slice(r+1)[0]}function Mx(){return kx(document.body,"next")}function jx(){return kx(document.body,"prev")}function Ds(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Bn(n,r)}function X5(e){Fv(e,Bv()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function J5(e){e.querySelectorAll("[data-tabindex]").forEach(t=>{const n=t.dataset.tabindex;delete t.dataset.tabindex,n?t.setAttribute("tabindex",n):t.removeAttribute("tabindex")})}const Uv={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let Q5;function jg(e){e.key==="Tab"&&(e.target,clearTimeout(Q5))}const pl=J.forwardRef(function(e,t){const[n,r]=J.useState();or(()=>(PV()&&r("button"),document.addEventListener("keydown",jg),()=>{document.removeEventListener("keydown",jg)}),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[nu("focus-guard")]:"",style:Uv};return J.createElement("span",$a({},e,i))}),_x=J.createContext(null),_g=nu("portal");function Z5(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=J.useState(null),o=Sf(),a=Fx(),s=J.useRef(null);return or(()=>()=>{r==null||r.remove(),queueMicrotask(()=>{s.current=null})},[r]),or(()=>{if(s.current)return;const u=t?document.getElementById(t):null;if(!u)return;const c=document.createElement("div");c.id=o,c.setAttribute(_g,""),u.appendChild(c),s.current=c,i(c)},[t,o]),or(()=>{if(s.current)return;let u=n||(a==null?void 0:a.portalNode);u&&!Ft(u)&&(u=u.current),u=u||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,u.appendChild(c));const l=document.createElement("div");l.id=o,l.setAttribute(_g,""),u=c||u,u.appendChild(l),s.current=l,i(l)},[t,n,o,a]),r}function qx(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=Z5({id:n,root:r}),[a,s]=J.useState(null),u=J.useRef(null),c=J.useRef(null),l=J.useRef(null),f=J.useRef(null),d=!!a&&!a.modal&&a.open&&i&&!!(r||o);return J.useEffect(()=>{if(!o||!i||a!=null&&a.modal)return;function p(h){o&&Ds(h)&&(h.type==="focusin"?J5:X5)(o)}return o.addEventListener("focusin",p,!0),o.addEventListener("focusout",p,!0),()=>{o.removeEventListener("focusin",p,!0),o.removeEventListener("focusout",p,!0)}},[o,i,a==null?void 0:a.modal]),J.createElement(_x.Provider,{value:J.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:c,beforeInsideRef:l,afterInsideRef:f,portalNode:o,setFocusManagerState:s}),[i,o])},d&&o&&J.createElement(pl,{"data-type":"outside",ref:u,onFocus:p=>{if(Ds(p,o)){var h;(h=l.current)==null||h.focus()}else{const v=jx()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus()}}}),d&&o&&J.createElement("span",{"aria-owns":o.id,style:Uv}),o&&ab.createPortal(t,o),d&&o&&J.createElement(pl,{"data-type":"outside",ref:c,onFocus:p=>{if(Ds(p,o)){var h;(h=f.current)==null||h.focus()}else{const v=Mx()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,p.nativeEvent))}}}))}const Fx=()=>J.useContext(_x),qg=20;let io=[];function rd(e){io=io.filter(t=>t.isConnected),e&&Zr(e)!=="body"&&(io.push(e),io.length>qg&&(io=io.slice(-qg)))}function Fg(){return io.slice().reverse().find(e=>e.isConnected)}const e3=J.forwardRef(function(e,t){return J.createElement("button",$a({},e,{type:"button",ref:t,tabIndex:-1,style:Uv}))});function Lx(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:a=0,returnFocus:s=!0,modal:u=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:l=!0}=e,{open:f,refs:d,nodeId:p,onOpenChange:h,events:v,dataRef:x,elements:{domReference:E,floating:y}}=t,S=typeof a=="number"&&a<0,w=_V(E)&&S,b=H5()?o:!0,T=td(i),A=td(a),D=td(s),I=Vv(),N=Fx(),_=J.useRef(null),L=J.useRef(null),B=J.useRef(!1),K=J.useRef(!1),k=N!=null,ie=J.useCallback(function(j){return j===void 0&&(j=y),j?Fv(j,Bv()):[]},[y]),V=J.useCallback(j=>{const R=ie(j);return T.current.map(te=>E&&te==="reference"?E:y&&te==="floating"?y:R).filter(Boolean).flat()},[E,y,T,ie]);J.useEffect(()=>{if(r||!u)return;function j(te){if(te.key==="Tab"){Bn(y,na(Br(y)))&&ie().length===0&&!w&&Zf(te);const oe=V(),Y=ra(te);T.current[0]==="reference"&&Y===E&&(Zf(te),te.shiftKey?Ji(oe[oe.length-1]):Ji(oe[1])),T.current[1]==="floating"&&Y===y&&te.shiftKey&&(Zf(te),Ji(oe[0]))}}const R=Br(y);return R.addEventListener("keydown",j),()=>{R.removeEventListener("keydown",j)}},[r,E,y,u,T,w,ie,V]),J.useEffect(()=>{if(r||!l)return;function j(){K.current=!0,setTimeout(()=>{K.current=!1})}function R(te){const oe=te.relatedTarget;queueMicrotask(()=>{const Y=!(Bn(E,oe)||Bn(y,oe)||Bn(oe,y)||Bn(N==null?void 0:N.portalNode,oe)||oe!=null&&oe.hasAttribute(nu("focus-guard"))||I&&(Os(I.nodesRef.current,p).find(ae=>{var de,he;return Bn((de=ae.context)==null?void 0:de.elements.floating,oe)||Bn((he=ae.context)==null?void 0:he.elements.domReference,oe)})||W5(I.nodesRef.current,p).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&&Y&&!K.current&&oe!==Fg()&&(B.current=!0,h(!1,te))})}if(y&&$n(E))return E.addEventListener("focusout",R),E.addEventListener("pointerdown",j),!u&&y.addEventListener("focusout",R),()=>{E.removeEventListener("focusout",R),E.removeEventListener("pointerdown",j),!u&&y.removeEventListener("focusout",R)}},[r,E,y,u,p,I,N,h,l]),J.useEffect(()=>{var j;if(r)return;const R=Array.from((N==null||(j=N.portalNode)==null?void 0:j.querySelectorAll("["+nu("portal")+"]"))||[]);if(y){const te=[y,...R,_.current,L.current,T.current.includes("reference")||w?E:null].filter(Y=>Y!=null),oe=u||w?Mg(te,b,!b):Mg(te);return()=>{oe()}}},[r,E,y,u,T,N,w,b]),or(()=>{if(r||!y)return;const j=Br(y),R=na(j);queueMicrotask(()=>{const te=V(y),oe=A.current,Y=(typeof oe=="number"?te[oe]:oe.current)||y,ae=Bn(y,R);!S&&!ae&&f&&Ji(Y,{preventScroll:Y===y})})},[r,f,y,S,V,A]),or(()=>{if(r||!y)return;let j=!1;const R=Br(y),te=na(R),oe=x.current;rd(te);function Y(ae){let{reason:de,event:he,nested:xe}=ae;de==="escape-key"&&d.domReference.current&&rd(d.domReference.current),de==="hover"&&he.type==="mouseleave"&&(B.current=!0),de==="outside-press"&&(xe?(B.current=!1,j=!0):B.current=!(DV(he)||NV(he)))}return v.on("openchange",Y),()=>{v.off("openchange",Y);const ae=na(R),de=Bn(y,ae)||I&&Os(I.nodesRef.current,p).some(xe=>{var ke;return Bn((ke=xe.context)==null?void 0:ke.elements.floating,ae)});(de||oe.openEvent&&["click","mousedown"].includes(oe.openEvent.type))&&d.domReference.current&&rd(d.domReference.current);const he=Fg();D.current&&!B.current&&$n(he)&&(!(he!==ae&&ae!==R.body)||de)&&Ji(he,{cancelPrevious:!1,preventScroll:j})}},[r,y,D,x,d,v,I,p]),or(()=>{if(!(r||!N))return N.setFocusManagerState({modal:u,closeOnFocusOut:l,open:f,onOpenChange:h,refs:d}),()=>{N.setFocusManagerState(null)}},[r,N,u,f,h,d,l]),or(()=>{if(r||!y||typeof MutationObserver!="function"||S)return;const j=()=>{const te=y.getAttribute("tabindex");T.current.includes("floating")||na(Br(y))!==d.domReference.current&&ie().length===0?te!=="0"&&y.setAttribute("tabindex","0"):te!=="-1"&&y.setAttribute("tabindex","-1")};j();const R=new MutationObserver(j);return R.observe(y,{childList:!0,subtree:!0,attributes:!0}),()=>{R.disconnect()}},[r,y,d,T,ie,S]);function U(j){return r||!c||!u?null:J.createElement(e3,{ref:j==="start"?_:L,onClick:R=>h(!1,R.nativeEvent)},typeof c=="string"?c:"Dismiss")}const fe=!r&&b&&(k||u);return J.createElement(J.Fragment,null,fe&&J.createElement(pl,{"data-type":"inside",ref:N==null?void 0:N.beforeInsideRef,onFocus:j=>{if(u){const te=V();Ji(i[0]==="reference"?te[0]:te[te.length-1])}else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(B.current=!1,Ds(j,N.portalNode)){const te=Mx()||E;te==null||te.focus()}else{var R;(R=N.beforeOutsideRef.current)==null||R.focus()}}}),!w&&U("start"),n,U("end"),fe&&J.createElement(pl,{"data-type":"inside",ref:N==null?void 0:N.afterInsideRef,onFocus:j=>{if(u)Ji(V()[0]);else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(l&&(B.current=!0),Ds(j,N.portalNode)){const te=jx()||E;te==null||te.focus()}else{var R;(R=N.afterOutsideRef.current)==null||R.focus()}}}))}const id=new Set,Vx=J.forwardRef(function(e,t){let{lockScroll:n=!1,...r}=e;const i=Sf();return or(()=>{if(!n)return;id.add(i);const o=/iP(hone|ad|od)|iOS/.test(vx()),a=document.body.style,s=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,c=a.left?parseFloat(a.left):window.pageXOffset,l=a.top?parseFloat(a.top):window.pageYOffset;if(a.overflow="hidden",u&&(a[s]=u+"px"),o){var f,d;const p=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,h=((d=window.visualViewport)==null?void 0:d.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(l-Math.floor(h))+"px",left:-(c-Math.floor(p))+"px",right:"0"})}return()=>{id.delete(i),id.size===0&&(Object.assign(a,{overflow:"",[s]:""}),o&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(c,l)))}},[i,n]),J.createElement("div",$a({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function Lg(e){return $n(e.target)&&e.target.tagName==="BUTTON"}function Vg(e){return yx(e)}function Bx(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:a=!0,event:s="click",toggle:u=!0,ignoreMouse:c=!1,keyboardHandlers:l=!0}=t,f=J.useRef(),d=J.useRef(!1);return J.useMemo(()=>a?{reference:{onPointerDown(p){f.current=p.pointerType},onMouseDown(p){p.button===0&&(Eg(f.current,!0)&&c||s!=="click"&&(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){if(s==="mousedown"&&f.current){f.current=void 0;return}Eg(f.current,!0)&&c||(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!l||Lg(p))&&(p.key===" "&&!Vg(o)&&(p.preventDefault(),d.current=!0),p.key==="Enter"&&r(!(n&&u),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!l||Lg(p)||Vg(o)||p.key===" "&&d.current&&(d.current=!1,r(!(n&&u),p.nativeEvent,"click"))}}}:{},[a,i,s,c,l,o,u,n,r])}const t3={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},n3={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Bg=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 Ux(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:i,elements:{reference:o,domReference:a,floating:s},dataRef:u}=e,{enabled:c=!0,escapeKey:l=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:p=!1,referencePressEvent:h="pointerdown",ancestorScroll:v=!1,bubbles:x,capture:E}=t,y=Vv(),S=ia(typeof f=="function"?f:()=>!1),w=typeof f=="function"?S:f,b=J.useRef(!1),T=J.useRef(!1),{escapeKey:A,outsidePress:D}=Bg(x),{escapeKey:I,outsidePress:N}=Bg(E),_=ia(k=>{if(!n||!c||!l||k.key!=="Escape")return;const ie=y?Os(y.nodesRef.current,i):[];if(!A&&(k.stopPropagation(),ie.length>0)){let V=!0;if(ie.forEach(U=>{var fe;if((fe=U.context)!=null&&fe.open&&!U.context.dataRef.current.__escapeKeyBubbles){V=!1;return}}),!V)return}r(!1,kV(k)?k.nativeEvent:k,"escape-key")}),L=ia(k=>{var ie;const V=()=>{var U;_(k),(U=ra(k))==null||U.removeEventListener("keydown",V)};(ie=ra(k))==null||ie.addEventListener("keydown",V)}),B=ia(k=>{const ie=b.current;b.current=!1;const V=T.current;if(T.current=!1,d==="click"&&V||ie||typeof w=="function"&&!w(k))return;const U=ra(k),fe="["+nu("inert")+"]",j=Br(s).querySelectorAll(fe);let R=Ft(U)?U:null;for(;R&&!Ia(R);){const Y=$o(R);if(Ia(Y)||!Ft(Y))break;R=Y}if(j.length&&Ft(U)&&!MV(U)&&!Bn(U,s)&&Array.from(j).every(Y=>!Bn(R,Y)))return;if($n(U)&&s){const Y=U.clientWidth>0&&U.scrollWidth>U.clientWidth,ae=U.clientHeight>0&&U.scrollHeight>U.clientHeight;let de=ae&&k.offsetX>U.clientWidth;if(ae&&Zn(U).direction==="rtl"&&(de=k.offsetX<=U.offsetWidth-U.clientWidth),de||Y&&k.offsetY>U.clientHeight)return}const te=y&&Os(y.nodesRef.current,i).some(Y=>{var ae;return Qf(k,(ae=Y.context)==null?void 0:ae.elements.floating)});if(Qf(k,s)||Qf(k,a)||te)return;const oe=y?Os(y.nodesRef.current,i):[];if(oe.length>0){let Y=!0;if(oe.forEach(ae=>{var de;if((de=ae.context)!=null&&de.open&&!ae.context.dataRef.current.__outsidePressBubbles){Y=!1;return}}),!Y)return}r(!1,k,"outside-press")}),K=ia(k=>{var ie;const V=()=>{var U;B(k),(U=ra(k))==null||U.removeEventListener(d,V)};(ie=ra(k))==null||ie.addEventListener(d,V)});return J.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=A,u.current.__outsidePressBubbles=D;function k(U){r(!1,U,"ancestor-scroll")}const ie=Br(s);l&&ie.addEventListener("keydown",I?L:_,I),w&&ie.addEventListener(d,N?K:B,N);let V=[];return v&&(Ft(a)&&(V=Ti(a)),Ft(s)&&(V=V.concat(Ti(s))),!Ft(o)&&o&&o.contextElement&&(V=V.concat(Ti(o.contextElement)))),V=V.filter(U=>{var fe;return U!==((fe=ie.defaultView)==null?void 0:fe.visualViewport)}),V.forEach(U=>{U.addEventListener("scroll",k,{passive:!0})}),()=>{l&&ie.removeEventListener("keydown",I?L:_,I),w&&ie.removeEventListener(d,N?K:B,N),V.forEach(U=>{U.removeEventListener("scroll",k)})}},[u,s,a,o,l,w,d,n,r,v,c,A,D,_,I,L,B,N,K]),J.useEffect(()=>{b.current=!1},[w,d]),J.useMemo(()=>c?{reference:{onKeyDown:_,[t3[h]]:k=>{p&&r(!1,k.nativeEvent,"reference-press")}},floating:{onKeyDown:_,onMouseDown(){T.current=!0},onMouseUp(){T.current=!0},[n3[d]]:()=>{b.current=!0}}}:{},[c,p,d,h,r,_])}let zp;process.env.NODE_ENV!=="production"&&(zp=new Set);function Gx(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const D="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!Ft(e.elements.reference)){var a;if(!((a=zp)!=null&&a.has(D))){var s;(s=zp)==null||s.add(D),console.error(D)}}}const[u,c]=J.useState(null),l=((t=e.elements)==null?void 0:t.reference)||u,f=y5(e),d=Vv(),p=z5()!=null,h=ia((D,I,N)=>{D&&(x.current.openEvent=I),E.emit("openchange",{open:D,event:I,reason:N,nested:p}),r==null||r(D,I,N)}),v=J.useRef(null),x=J.useRef({}),E=J.useState(()=>B5())[0],y=Sf(),S=J.useCallback(D=>{const I=Ft(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),contextElement:D}:D;f.refs.setReference(I)},[f.refs]),w=J.useCallback(D=>{(Ft(D)||D===null)&&(v.current=D,c(D)),(Ft(f.refs.reference.current)||f.refs.reference.current===null||D!==null&&!Ft(D))&&f.refs.setReference(D)},[f.refs]),b=J.useMemo(()=>({...f.refs,setReference:w,setPositionReference:S,domReference:v}),[f.refs,w,S]),T=J.useMemo(()=>({...f.elements,domReference:l}),[f.elements,l]),A=J.useMemo(()=>({...f,refs:b,elements:T,dataRef:x,nodeId:i,floatingId:y,events:E,open:n,onOpenChange:h}),[f,i,y,E,n,h,b,T]);return or(()=>{const D=d==null?void 0:d.nodesRef.current.find(I=>I.id===i);D&&(D.context=A)}),J.useMemo(()=>({...f,context:A,refs:b,elements:T}),[f,b,T,A])}const Ug="active",Gg="selected";function od(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[Ug]:a,[Gg]:s,...u}=e;o=u}return{...n==="floating"&&{tabIndex:-1},...o,...t.map(a=>{const s=a?a[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((a,s)=>(s&&Object.entries(s).forEach(u=>{let[c,l]=u;if(!(i&&[Ug,Gg].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof l=="function"){var f;(f=r.get(c))==null||f.push(l),a[c]=function(){for(var d,p=arguments.length,h=new Array(p),v=0;v<p;v++)h[v]=arguments[v];return(d=r.get(c))==null?void 0:d.map(x=>x(...h)).find(x=>x!==void 0)}}}else a[c]=l}),a),{})}}function zx(e){e===void 0&&(e=[]);const t=e,n=J.useCallback(o=>od(o,e,"reference"),t),r=J.useCallback(o=>od(o,e,"floating"),t),i=J.useCallback(o=>od(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 r3(e={}){const{initialOpen:t=!1,open:n,onOpenChange:r}=e,[i,o]=J.useState(t),a=n??i,s=r??o,u=Gx({open:a,onOpenChange:s}),c=u.context,l=Bx(c,{enabled:n==null}),f=Ux(c,{outsidePressEvent:"mousedown"}),d=zx([l,f]);return J.useMemo(()=>({open:a,setOpen:s,...d,...u}),[a,s,d,u])}const Wx=J.createContext(null),Hx=()=>{const e=J.useContext(Wx);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function i3({children:e,...t}){const n=r3(t);return $.jsx(Wx.Provider,{value:n,children:e})}const Kx=bv`
|
|
1151
|
+
display: flex;
|
|
1152
|
+
justify-content: center;
|
|
1153
|
+
align-items: center;
|
|
1154
|
+
z-index: 100;
|
|
1155
|
+
padding: var(--space-md-fixed);
|
|
1156
|
+
`,o3=Ie(Vx)`
|
|
1157
|
+
${Kx};
|
|
1158
|
+
`,a3=O.forwardRef((e,t)=>{const{style:n,children:r,components:i,...o}=e,a=Hx(),s=Lv([a.refs.setFloating,t]),u=(i==null?void 0:i.Overlay)??o3;return $.jsx(qx,{children:$.jsx(u,{lockScroll:!0,children:$.jsx(Lx,{context:a.context,children:$.jsx("div",{ref:s,...a.getFloatingProps(o),children:r})})})})}),s3=a3;function Yx(e){const t=O.useContext(eu),[n,r]=O.useState(t);return $.jsx(eu.Provider,{value:n,children:e.children})}const u3=O.forwardRef((e,t)=>{const{setOpen:n}=Hx();return $.jsx("button",{type:"button",...e,ref:t,onClick:r=>{var i;(i=e.onClick)==null||i.call(e,r),n(!1)}})}),c3=u3,l3=Ie.span`
|
|
1159
|
+
color: var(--color-explain-header-value-color);
|
|
1160
|
+
overflow: hidden;
|
|
1161
|
+
white-space: nowrap;
|
|
1162
|
+
text-overflow: ellipsis;
|
|
1163
|
+
`;function Xx(e){const{explainQuestion:t}=Gi();if(!t)return $.jsx("div",{...e,children:"Conflict"});const n=H(t).returnType().with({subject:Qe.configuration},()=>"Configuration").with({subject:Qe.attribute},i=>i.attributeId.localId).with({subject:Qe.choiceValue},i=>i.choiceValueId).with({subject:Qe.component},i=>i.state.toString()).with({subject:Qe.boolean},i=>i.state.toString()).with({subject:Qe.numeric},i=>i.state.toString()).exhaustive(),r=H(t).returnType().with({question:qt.whyIsStateNotPossible},()=>"is blocked").with({question:qt.whyIsNotSatisfied},()=>"is not satisfied").exhaustive();return $.jsxs("div",{...e,children:[$.jsx(l3,{children:n})," ",r]})}const f3=Ie.div`
|
|
1164
|
+
position: sticky;
|
|
1165
|
+
top: 0;
|
|
1166
|
+
transition: all 0.1s;
|
|
1167
|
+
border-top: 1px solid transparent;
|
|
1168
|
+
|
|
1169
|
+
&.active {
|
|
1170
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
|
1171
|
+
border-color: var(--color-explain-dialog-scroll-shadow-border);
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
@media only screen and (min-resolution: 2dppx) {
|
|
1175
|
+
border-top-width: 0.5px;
|
|
1176
|
+
}
|
|
1177
|
+
`;function d3(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(f3,{...rx(e,{className:PL(t&&"active")})})]})}const p3=Ie(P.motion.div)`
|
|
1178
|
+
position: relative;
|
|
1179
|
+
background-color: var(--color-explain-dialog-fill);
|
|
1180
|
+
backdrop-filter: var(--backdrop-filter-explain-dialog);
|
|
1181
|
+
color: var(--color-explain-dialog-color);
|
|
1182
|
+
outline-offset: -1px;
|
|
1183
|
+
padding-top: 1.1em;
|
|
1184
|
+
border-radius: var(--shape-border-radius-md);
|
|
1185
|
+
box-shadow: var(--shadows-dialog);
|
|
1186
|
+
font-size: var(--text-base-size);
|
|
1187
|
+
font-family: var(--font-primary);
|
|
1188
|
+
display: grid;
|
|
1189
|
+
grid-template-rows: [header] auto [content] auto;
|
|
1190
|
+
grid-template-columns: [header content] 1fr;
|
|
1191
|
+
align-content: start;
|
|
1192
|
+
min-height: min(calc(100vh - var(--space-md) * 2), 350px);
|
|
1193
|
+
max-height: min(calc(100vh - var(--space-md) * 2), 700px);
|
|
1194
|
+
max-width: min(calc(100vw - var(--space-md) * 2), 700px);
|
|
1195
|
+
min-width: min(calc(100vw - var(--space-md) * 2), 500px);
|
|
1196
|
+
`,h3=Ie.div`
|
|
1197
|
+
overflow-y: auto;
|
|
1198
|
+
grid-area: content;
|
|
1199
|
+
padding-left: var(--space-xs-fixed);
|
|
1200
|
+
padding-right: var(--space-xs-fixed);
|
|
1201
|
+
padding-bottom: var(--space-xs-fixed);
|
|
1202
|
+
`,v3=Ie(d3)`
|
|
1203
|
+
margin-left: calc(var(--space-xs-fixed) * -1);
|
|
1204
|
+
margin-right: calc(var(--space-xs-fixed) * -1);
|
|
1205
|
+
`,m3=Ie(c3)`
|
|
1206
|
+
position: absolute;
|
|
1207
|
+
right: var(--space-sm-fixed);
|
|
1208
|
+
top: var(--space-sm-fixed);
|
|
1209
|
+
border: none;
|
|
1210
|
+
background-color: transparent;
|
|
1211
|
+
color: inherit;
|
|
1212
|
+
font-size: var(--text-sm);
|
|
1213
|
+
cursor: pointer;
|
|
1214
|
+
border-radius: var(--shape-border-radius-xs);
|
|
1215
|
+
|
|
1216
|
+
&:focus {
|
|
1217
|
+
outline: 2px solid var(--color-explain-dialog-close-button-outline);
|
|
1218
|
+
outline-offset: 1px;
|
|
1219
|
+
}
|
|
1220
|
+
`,y3=Ie(Xx)`
|
|
1221
|
+
grid-area: header;
|
|
1222
|
+
font-size: var(--text-md);
|
|
1223
|
+
font-weight: 500;
|
|
1224
|
+
font-family: var(--font-heading);
|
|
1225
|
+
margin-bottom: var(--space-xs);
|
|
1226
|
+
overflow: hidden;
|
|
1227
|
+
display: flex;
|
|
1228
|
+
white-space: nowrap;
|
|
1229
|
+
text-overflow: ellipsis;
|
|
1230
|
+
margin-right: var(--space-md);
|
|
1231
|
+
margin-left: calc(var(--space-xs-fixed) + var(--space-sm-fixed));
|
|
1232
|
+
`,g3={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 b3(e){return $.jsxs(p3,{variants:g3,initial:"initial",animate:"open",exit:"close",children:[$.jsx(y3,{}),$.jsxs(h3,{children:[$.jsx(v3,{}),e.children]}),$.jsx(m3,{children:$.jsx(ji,{icon:xw})})]})}const S3=Ie(s3)`
|
|
1233
|
+
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
1234
|
+
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
1235
|
+
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
1236
|
+
--color-explain-attribute-value-remove-fill: ${e=>e.attributeValueRemoveFill};
|
|
1237
|
+
--color-explain-attribute-value-remove-color: ${e=>e.attributeValueRemoveColor};
|
|
1238
|
+
--color-explain-header-value-color: ${e=>e.headerValueColor};
|
|
1239
|
+
--color-explain-dialog-fill: ${e=>e.fill};
|
|
1240
|
+
--color-explain-dialog-color: ${e=>e.color};
|
|
1241
|
+
--color-explain-dialog-close-button-outline: ${e=>e.closeButtonOutline};
|
|
1242
|
+
--color-explain-dialog-apply-solution-button-fill: ${e=>e.applySolutionButtonFill};
|
|
1243
|
+
--color-explain-dialog-apply-solution-button-color: ${e=>e.applySolutionButtonColor};
|
|
1244
|
+
--color-explain-dialog-apply-solution-button-outline: ${e=>e.applySolutionButtonOutline};
|
|
1245
|
+
--color-explain-dialog-explanation-card: ${e=>e.explanationCard};
|
|
1246
|
+
--color-explain-dialog-scroll-shadow-border: ${e=>e.scrollShadowBorder};
|
|
1247
|
+
--backdrop-filter-explain-dialog: ${e=>e.backdropFilter};
|
|
1248
|
+
|
|
1249
|
+
display: grid;
|
|
1250
|
+
|
|
1251
|
+
&:focus {
|
|
1252
|
+
outline: none;
|
|
1253
|
+
}
|
|
1254
|
+
`;function C3(e){const t=Gi(),n=(t==null?void 0:t.displayMode)==="dialog";return $.jsx(i3,{open:n,onOpenChange:r=>!r&&n&&(t==null?void 0:t.dismiss()),children:$.jsx(w3,{...e,isOpen:n,children:O.Children.toArray(e.content)[0]??$.jsx(b3,{children:$.jsx($V,{})})})})}function w3(e){return $.jsx(P.AnimatePresence,{initial:!1,children:e.isOpen&&$.jsx(S3,{...e,components:{Overlay:E3},children:$.jsx(Yx,{children:e.children})})})}const x3=Ie(P.motion(Vx))`
|
|
1255
|
+
${Kx}
|
|
1256
|
+
`;function E3(e){return $.jsx(x3,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}const T3={fill:{title:"Fill",type:P.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.7)"},color:{title:"Color",type:P.ControlType.Color,defaultValue:"#171717"},attributeValueFill:{title:"Attribute Value Fill",type:P.ControlType.Color,defaultValue:"#efefef"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:P.ControlType.Color,defaultValue:"#cfefc7"},attributeValueAddColor:{title:"Attribute Value Add Color",type:P.ControlType.Color,defaultValue:"#48c52b"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:P.ControlType.Color,defaultValue:"#ffdada"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:P.ControlType.Color,defaultValue:"#c52b2b"},headerValueColor:{title:"Header Value Color",type:P.ControlType.Color,defaultValue:"#00a1e6"},closeButtonOutline:{title:"Close Button Outline",type:P.ControlType.Color,defaultValue:"#00a1e6"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:P.ControlType.Color,defaultValue:"#F2F2F2"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:P.ControlType.Color,defaultValue:"#171717"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:P.ControlType.Color,defaultValue:"#00a1e6"},explanationCard:{title:"Explanation Card",type:P.ControlType.Color,defaultValue:"white"},scrollShadowBorder:{title:"Scroll Shadow Border",type:P.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"},backdropFilter:{title:"Backdrop Filter",type:P.ControlType.String,defaultValue:"blur(10px) saturate(200%)"}},I3={fill:{title:"Fill",type:P.ControlType.Color,defaultValue:"#002134"},color:{title:"Color",type:P.ControlType.Color,defaultValue:"white"},attributeValueFill:{title:"Attribute Value Fill",type:P.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.2)"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:P.ControlType.Color,defaultValue:"rgba(47, 255, 0, 0.2)"},attributeValueAddColor:{title:"Attribute Value Add Color",type:P.ControlType.Color,defaultValue:"#63e446"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:P.ControlType.Color,defaultValue:"#ff00004a"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:P.ControlType.Color,defaultValue:"#ff6060"},headerValueColor:{title:"Header Value Color",type:P.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},closeButtonOutline:{title:"Close Button Outline",type:P.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},listSeparator:{title:"List Separator",type:P.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:P.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:P.ControlType.Color,defaultValue:"white"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:P.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},showMoreButtonOutline:{title:"Show More Button Outline",type:P.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"}},Jx=O.createContext(null);function A3(e){const[t,n]=O.useState(null),{explain:r,applySolution:i}=Q0(),o=O.useRef(null),a=O.useCallback(async(p,h,v,x)=>{const E=Xh();o.current=E,n(null);try{const y=await p(),S=y,w=y,b=(S==null?void 0:S.decisionExplanations)??[],T=(w==null?void 0:w.constraintExplanations)??[];E==o.current&&n({controlId:x,displayMode:b.length===0&&T.length>0?"dialog":v,explainQuestion:h,hasError:!1,decisionExplanations:$3(b),constraintExplanations:T})}catch{E==o.current&&n({controlId:x,displayMode:v,explainQuestion:h,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=O.useCallback((p,h,v)=>{const x=typeof p=="function"?p(GC):p;return a(()=>e.explainConstraints?r(x,"full"):r(x,"decisions"),x,h,v)},[e.explainConstraints,r,a]),u=O.useCallback((p,h,v)=>a(()=>Promise.resolve(p),null,h,v),[a]),c=O.useCallback(()=>{n(null)},[]),l=O.useCallback(async p=>{await i(p),c()},[i,c]),f=O.useCallback(p=>{n(h=>h!=null?{...h,displayMode:p}:h)},[]),d=O.useMemo(()=>({process:t,applySolution:l,explain:s,handleExplainAnswer:u,dismiss:c,switchMode:f}),[t,l,s,u,c,f]);return $.jsx(eu.Provider,{value:d,children:e.children})}function $3(e){const t=m(RC,Kr(r=>r.solution==null)),n=m(zl,Kr(r=>r.causedByDecisions.length));return m(e,iN([t,n]))}const Oa=new Map;function hl(e){const{singletonId:t,children:n}=e,[r,i]=O.useState(!1),o=O.useRef({chose:()=>i(!0)});return O.useEffect(()=>(O3(t,o.current),()=>D3(t,o.current)),[]),r?$.jsx($.Fragment,{children:n}):null}function O3(e,t){P3(e).candidates.add(t),Qx(e)}function D3(e,t){let n=Oa.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),N3(e),Qx(e))}function Qx(e){let t=Oa.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function N3(e){let t=Oa.get(e);t==null||t.candidates.size>0||Oa.delete(e)}function P3(e){let t=Oa.get(e);return t==null&&(t={chosen:null,candidates:new Set},Oa.set(e,t)),t}const ei={attributeId:{title:"Attribute Id",type:P.ControlType.String},componentPath:{title:"Component Path",type:P.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:P.ControlType.String}},zg={description:{title:"Description",type:P.ControlType.String},regex:{title:"Regex",type:P.ControlType.String},direction:{title:"Direction",type:P.ControlType.Enum,defaultValue:"asc",options:["asc","desc"],displaySegmentedControl:!0},mode:{title:"Mode",type:P.ControlType.Enum,defaultValue:"isMatch",options:["isMatch","string","numeric"]}},R3={choiceValueSorting:{title:"Choice Value Sorting",type:P.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{defaultRules:{title:"Default Rules",type:P.ControlType.Array,control:{type:P.ControlType.Object,controls:zg}},attributes:{title:"Attribute",type:P.ControlType.Array,control:{type:P.ControlType.Object,controls:{...ei,choiceValues:{title:"Choice Values",type:P.ControlType.Array,control:{type:P.ControlType.String}},rules:{title:"Rules",type:P.ControlType.Array,control:{type:P.ControlType.Object,controls:zg}}}}},jsonDefinition:{title:"Definition – JSON",type:P.ControlType.String,displayTextArea:!0}}}};function k3(e,t){const n=[],r=(o,a)=>{const s=n.find(c=>e.equals(c.first,o)&&e.equals(c.second,a));if(s)return s.ordering;const u=t.compare(o,a);return n.push({first:o,second:a,ordering:u}),u},i=qa(r);return{cachedOrderings:n,...i}}function M3(){const e=[];return{getCache:(t,n)=>{const r=e.find(o=>o.eq===t&&o.ord===n);if(r)return r.ordCache;const i=k3(t,n);return e.push({eq:t,ord:n,ordCache:i}),i}}}function ur(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 Zx=_h(),j3=new Intl.Collator("en",{sensitivity:"base"}),_3=new Intl.Collator("en",{sensitivity:"variant"}),q3={regex:".*",direction:"asc",mode:"string"},F3=m([j3,_3],G(H3),Wh(_h())),L3=m(RC,Kr(e=>yi(e))),V3=zl;function B3(e,t){return m((t==null?void 0:t.attributes)??[],Zt(n=>d0(ur(n),e)),Q(n=>[U3(n.choiceValues??[]),Wg(n.rules??[])]),nt(()=>[Wg((t==null?void 0:t.defaultRules)??[])]),vC(e1(q3)),Wh(Zx))}function U3(e){return m(zl,Fs,xC,Fs,Kr(t=>m(e,mC(n=>rt.equals(t,n)))))}function Wg(e){return m(e,G(e1),Wh(Zx))}function e1(e){const t=EN(()=>new RegExp(e.regex)),n=H(e.mode).returnType().with("string",()=>G3(e.direction)).with("numeric",()=>z3(e.direction)).with("isMatch",()=>W3(e.direction)).exhaustive();return m(n,Kr(r=>m(t,TN(i=>(i.lastIndex=0,i[Symbol.match](r))),Mn(i=>m(i,Fd(1),Bd(()=>m(i,Fd(0))))))))}function G3(e){return m(F3,Gv(e),t1)}function z3(e){return m(V3,Gv(e),t1,Kr(Mn(uP)))}function W3(e){return m(L3,Gv(e))}function t1(e){return m(e,Fs,xC,Fs)}function Gv(e){return t=>H(e).returnType().with("asc",()=>t).with("desc",()=>Fs(t)).exhaustive()}function H3(e){return qa((t,n)=>H(e.compare(t,n)).returnType().with(Le.number.gt(0),()=>1).with(Le.number.lt(0),()=>-1).otherwise(()=>0))}const K3=M3(),n1=O.createContext(null);function vl(e,t){const n=O.useContext(n1),r=O.useMemo(()=>m(B3(e,n),o=>K3.getCache(rt,o),Kr(o=>o.id)),[]),{attribute:i}=sf(e);return m(t??(i==null?void 0:i.values)??[],Wl(r))}const r1=jo(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:r,sessionCreateUrl:i,sessionDeleteUrl:o,deploymentName:a,channel:s,children:u,explainDialogProps:c,explainPopoverProps:l,explainConstraints:f}=e;if(In())return $.jsxs($.Fragment,{children:[u,$.jsx(hl,{singletonId:"Configuration",children:$.jsx(gg,{})})]});const d=O.useMemo(()=>Ck({hcaEngineBaseUrl:ZL(t,"api","engine"),sessionHandler:H(n).with("client-side",()=>({accessToken:r})).with("server-side",()=>({sessionCreateUrl:i,sessionDeleteUrl:o})).exhaustive()}),[t,n,r,i,o]),p=O.useMemo(()=>{var v;return m(ye((v=e.attributeRelations)==null?void 0:v.jsonDefinition),_t(x=>x.length>0),Q(x=>JSON.parse(x)),Un)},[e.attributeRelations]),h=O.useMemo(()=>{var v;return m(ye((v=e.choiceValueSorting)==null?void 0:v.jsonDefinition),_t(x=>x.length>0),Q(x=>JSON.parse(x)),EC(()=>ye(e.choiceValueSorting)),nt(()=>({attributes:[],defaultRules:[]})))},[e.choiceValueSorting]);return $.jsxs($.Fragment,{children:[$.jsxs(b_,{configuratorClient:d,configurationModelSource:{type:Pi.Channel,channel:s,deploymentName:a},attributeRelations:p,allowedInExplain:{rules:{type:pn.all}},children:[$.jsx(eV,{...e}),$.jsx(O.Suspense,{children:$.jsx(S_,{children:$.jsxs(A3,{explainConstraints:f,children:[$.jsx(Jx.Provider,{value:l,children:$.jsx(n1.Provider,{value:h,children:u})}),$.jsx(C3,{...c})]})})})]}),$.jsx(hl,{singletonId:"Configuration",children:$.jsx(gg,{})})]})}),Y3=r1;P.addPropertyControls(r1,{children:{title:"Content",type:P.ControlType.ComponentInstance},channel:{type:P.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:P.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:P.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:P.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:P.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:P.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:P.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:P.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:P.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:P.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:P.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:P.ControlType.Object,optional:!1,controls:T3,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:P.ControlType.Object,optional:!1,controls:I3,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:P.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:P.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:P.ControlType.String,displayTextArea:!0}}},...R3});const i1={padding:{type:P.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}},X3=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}),J3={radius:{title:"Radius",type:P.ControlType.Number,defaultValue:6},...i1,border:{title:"Border",type:P.ControlType.Object,controls:{color:{type:P.ControlType.Color,title:"Color"},width:{type:P.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}}}},Q3=e=>{var t,n,r,i,o,a,s,u,c,l,f,d,p;return{borderRadius:e.radius,borderColor:(t=e.border)==null?void 0:t.color,borderTopWidth:(n=e.border)!=null&&n.isMixedWidth?(r=e.border)==null?void 0:r.widthTop:(i=e.border)==null?void 0:i.width,borderRightWidth:(o=e.border)!=null&&o.isMixedWidth?(a=e.border)==null?void 0:a.widthRight:(s=e.border)==null?void 0:s.width,borderBottomWidth:(u=e.border)!=null&&u.isMixedWidth?(c=e.border)==null?void 0:c.widthBottom:(l=e.border)==null?void 0:l.width,borderLeftWidth:(f=e.border)!=null&&f.isMixedWidth?(d=e.border)==null?void 0:d.widthLeft:(p=e.border)==null?void 0:p.width}},Z3={fill:{title:"Fill",type:P.ControlType.Color,defaultValue:"#EBEBEB"},...i1,...J3},eB=e=>({...X3(e),...Q3(e),backgroundColor:e.fill}),tB={color:{title:"Color",type:P.ControlType.Color,defaultValue:"black"},fontSize:{title:"Font size",type:P.ControlType.Number,defaultValue:16}},nB=e=>({color:e.color,fontSize:e.fontSize}),$u={explain:{title:"Explain",type:P.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},Wp={type:P.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:P.ControlType.Color,optional:!0},color:{title:"Color",type:P.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:P.ControlType.Color,optional:!0}}},o1={...ei,...tB,...Z3,implicitLabelPrefix:{title:"Implicit Label Prefix",type:P.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...Wp,title:"Unsatisfied Colors"},implicitSelectedColors:{...Wp,title:"Implicit Selected Colors"},...$u},Hp=(e,t,n)=>{var r,i,o,a,s,u;const c=eB(e),l=nB(e);return{...c,...l,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:Le.string.minLength(1)},f=>f.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:Le.string.minLength(1)},f=>f.implicitSelectedFill).otherwise(()=>c.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:Le.string.minLength(1)},f=>f.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:Le.string.minLength(1)},f=>f.implicitSelectedBorderColor).otherwise(()=>c.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:Le.string.minLength(1)},f=>f.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:Le.string.minLength(1)},f=>f.implicitSelectedColor).otherwise(()=>l.color),...e.style}},zv={...o1,resetLabel:{title:"Reset Label",type:P.ControlType.String,defaultValue:"Reset"},appearance:{title:"Appearance",type:P.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]},textAlign:{title:"Text Align",type:P.ControlType.Enum,defaultValue:"initial",options:["initial","start","center","end"]}},Da=(e,t,n)=>({...Hp(e,t,n),appearance:e.appearance,textAlign:e.textAlign});function zi(){const{explain:e,handleExplainAnswer:t}=O.useContext(eu);return{explain:e,handleExplainAnswer:t}}function rB(e={}){const{initialOpen:t=!1,placement:n="top",modal:r=!1,open:i,onOpenChange:o,arrow:a}=e,[s,u]=O.useState(t),c=i??s,l=o??u,f=Gx({placement:n,open:c,onOpenChange:l,whileElementsMounted:d5,middleware:[YV(((a==null?void 0:a.height)??0)+5),h5({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),p5({padding:5}),...a?[m5(a)]:[]]}),d=f.context,p=Bx(d,{enabled:i==null}),h=Ux(d),v=zx([p,h]);return O.useMemo(()=>({open:c,setOpen:l,...v,...f,modal:r,arrow:a}),[c,l,v,f,r,a])}const a1=O.createContext(null),Ou=()=>{const e=O.useContext(a1);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function iB({children:e,...t}){const n=rB(t);return $.jsx(a1.Provider,{value:n,children:e})}const oB=O.forwardRef(function(e,t){const n=O.Children.toArray(e.children)[0],r=Ou(),i=e.children.ref,o=Lv([r.refs.setReference,t,i]);return O.isValidElement(n)?O.cloneElement(n,r.getReferenceProps({ref:o,...e,...n.props,"data-state":r.open?"open":"closed"})):$.jsx("span",{children:"Not valid children for PopoverTrigger"})}),aB=oB,sB=Ie.div`
|
|
1257
|
+
display: flex;
|
|
1258
|
+
justify-content: center;
|
|
1259
|
+
|
|
1260
|
+
// The Webstorm formatter doesn't support container queries and would be break it.
|
|
1261
|
+
// @formatter:off
|
|
1262
|
+
@container explain-actions (min-width: 300px) {
|
|
1263
|
+
justify-content: start;
|
|
1264
|
+
}
|
|
1265
|
+
`,uB=Ie.button`
|
|
1266
|
+
color: inherit;
|
|
1267
|
+
font-size: 0.9em;
|
|
1268
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1269
|
+
font-weight: 500;
|
|
1270
|
+
appearance: none;
|
|
1271
|
+
border: none;
|
|
1272
|
+
border-radius: var(--shape-border-radius-xs);
|
|
1273
|
+
margin-top: 0.9em;
|
|
1274
|
+
text-decoration: underline;
|
|
1275
|
+
cursor: pointer;
|
|
1276
|
+
background-color: transparent;
|
|
1277
|
+
|
|
1278
|
+
&:focus {
|
|
1279
|
+
outline: 2px solid var(--color-explain-popover-show-more-button-outline);
|
|
1280
|
+
outline-offset: 1px;
|
|
1281
|
+
}
|
|
1282
|
+
`;function cB(){const{decisionExplanations:e,switchMode:t}=Gi(),n=e.length-1;return $.jsx(sB,{children:$.jsxs(uB,{onClick:()=>t("dialog"),children:[n>0&&$.jsxs("span",{children:["Show more (",n,")"]}),n===0&&$.jsx("span",{children:"Show Constraints"})]})})}const lB=Ie.div`
|
|
1283
|
+
font-weight: 500;
|
|
1284
|
+
font-family: var(--font-heading);
|
|
1285
|
+
margin-bottom: var(--space-xs);
|
|
1286
|
+
`,Hg=Ie.div`
|
|
1287
|
+
height: 1px;
|
|
1288
|
+
background-color: var(--color-explain-popover-list-separator);
|
|
1289
|
+
margin-left: -1.1em;
|
|
1290
|
+
margin-right: -1.1em;
|
|
1291
|
+
|
|
1292
|
+
@media only screen and (min-resolution: 2dppx) {
|
|
1293
|
+
height: 0.5px;
|
|
1294
|
+
}
|
|
1295
|
+
`,fB=Ie.div`
|
|
1296
|
+
container: explain-actions / inline-size;
|
|
1297
|
+
`,dB=Ie(cx)`
|
|
1298
|
+
display: grid;
|
|
1299
|
+
grid-template-columns: [name] minmax(100px, auto) [values] minmax(100px, 1fr);
|
|
1300
|
+
gap: var(--space-sm);
|
|
1301
|
+
padding-top: var(--space-xs);
|
|
1302
|
+
padding-bottom: var(--space-xs);
|
|
1303
|
+
padding-right: 1.1em;
|
|
1304
|
+
margin-right: -1.1em;
|
|
1305
|
+
overflow: auto;
|
|
1306
|
+
max-height: 200px;
|
|
1307
|
+
`,pB=Ie(sx)`
|
|
1308
|
+
border-radius: 360px;
|
|
1309
|
+
background-color: var(--color-explain-popover-apply-solution-button-fill);
|
|
1310
|
+
color: var(--color-explain-popover-apply-solution-button-color);
|
|
1311
|
+
font-size: 0.9em;
|
|
1312
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1313
|
+
font-weight: 600;
|
|
1314
|
+
appearance: none;
|
|
1315
|
+
padding: 0.6em 2em;
|
|
1316
|
+
border: none;
|
|
1317
|
+
width: 100%;
|
|
1318
|
+
margin-top: 1.1em;
|
|
1319
|
+
|
|
1320
|
+
&:focus {
|
|
1321
|
+
outline: 2px solid var(--color-explain-popover-apply-solution-button-outline);
|
|
1322
|
+
outline-offset: 1px;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
// The Webstorm formatter doesn't support container queries and would be break it.
|
|
1326
|
+
// @formatter:off
|
|
1327
|
+
@container explain-actions (min-width: 300px) {
|
|
1328
|
+
width: auto;
|
|
1329
|
+
}
|
|
1330
|
+
`,ad=Ie(fx)`
|
|
1331
|
+
width: min-content;
|
|
1332
|
+
min-width: 300px;
|
|
1333
|
+
`;function hB(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=Gi();if(n)return $.jsx(ad,{variant:"failedToExplain"});const r=e[0];if(!r)return $.jsx(ad,{variant:"noExplanationFound"});if(!r.solution)return $.jsx(ad,{variant:"noSolutionFound"});const i=r.solution.decisions.filter(o=>o.state!=null);return $.jsxs($.Fragment,{children:[$.jsx(lB,{children:"Solution"}),$.jsx(Hg,{}),$.jsx(dB,{blockingDecisions:r.causedByDecisions,desiredDecisions:i}),$.jsx(Hg,{}),$.jsxs(fB,{children:[$.jsx(pB,{explanation:r,children:"Apply solution"}),(e.length>1||t.length>0)&&$.jsx(cB,{})]})]})}const s1=O.createContext(null),Rr=()=>O.useContext(s1);function u1(e){return O.forwardRef((t,n)=>{const r=O.useId();return $.jsx(s1.Provider,{value:r,children:$.jsx(e,{...t,ref:n})})})}const vB=O.forwardRef((e,t)=>{const{style:n,children:r,...i}=e,o=Ou(),a=Lv([o.refs.setFloating,t]);return $.jsx(qx,{children:$.jsx(Lx,{context:o.context,modal:o.modal,children:$.jsx("div",{ref:a,style:{...o.floatingStyles,...n},...o.getFloatingProps(i),children:r})})})}),mB=vB,yB=O.forwardRef((e,t)=>{const{setOpen:n}=Ou();return $.jsx("button",{type:"button",ref:t,...e,onClick:r=>{var i;(i=e.onClick)==null||i.call(e,r),n(!1)}})}),gB=yB,bB=Ie.div`
|
|
1334
|
+
position: relative;
|
|
1335
|
+
background-color: var(--color-explain-popover-fill);
|
|
1336
|
+
color: var(--color-explain-popover-color);
|
|
1337
|
+
outline-offset: -1px;
|
|
1338
|
+
padding: 1.1em;
|
|
1339
|
+
border-radius: var(--shape-border-radius-md);
|
|
1340
|
+
font-size: var(--text-base-size);
|
|
1341
|
+
font-family: var(--font-primary);
|
|
1342
|
+
min-width: 300px;
|
|
1343
|
+
max-width: 500px;
|
|
1344
|
+
`,SB=Ie(gB)`
|
|
1345
|
+
position: absolute;
|
|
1346
|
+
right: var(--space-sm-fixed);
|
|
1347
|
+
top: var(--space-sm-fixed);
|
|
1348
|
+
border: none;
|
|
1349
|
+
background-color: transparent;
|
|
1350
|
+
color: inherit;
|
|
1351
|
+
font-size: var(--text-sm);
|
|
1352
|
+
cursor: pointer;
|
|
1353
|
+
border-radius: var(--shape-border-radius-xs);
|
|
1354
|
+
|
|
1355
|
+
&:focus {
|
|
1356
|
+
outline: 2px solid var(--color-explain-popover-close-button-outline);
|
|
1357
|
+
outline-offset: 1px;
|
|
1358
|
+
}
|
|
1359
|
+
`,CB=Ie(Xx)`
|
|
1360
|
+
font-size: var(--text-md);
|
|
1361
|
+
font-weight: 500;
|
|
1362
|
+
font-family: var(--font-heading);
|
|
1363
|
+
margin-bottom: var(--space-xs);
|
|
1364
|
+
overflow: hidden;
|
|
1365
|
+
display: flex;
|
|
1366
|
+
white-space: nowrap;
|
|
1367
|
+
text-overflow: ellipsis;
|
|
1368
|
+
margin-right: var(--space-md);
|
|
1369
|
+
`;function wB(e){return $.jsxs(bB,{children:[$.jsx(CB,{}),e.children,$.jsx(SB,{children:$.jsx(ji,{icon:xw})})]})}const xB=Ie(mB)`
|
|
1370
|
+
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
1371
|
+
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
1372
|
+
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
1373
|
+
--color-explain-attribute-value-remove-fill: ${e=>e.attributeValueRemoveFill};
|
|
1374
|
+
--color-explain-attribute-value-remove-color: ${e=>e.attributeValueRemoveColor};
|
|
1375
|
+
--color-explain-header-value-color: ${e=>e.headerValueColor};
|
|
1376
|
+
--color-explain-popover-fill: ${e=>e.fill};
|
|
1377
|
+
--color-explain-popover-color: ${e=>e.color};
|
|
1378
|
+
--color-explain-popover-close-button-outline: ${e=>e.closeButtonOutline};
|
|
1379
|
+
--color-explain-popover-list-separator: ${e=>e.listSeparator};
|
|
1380
|
+
--color-explain-popover-apply-solution-button-fill: ${e=>e.applySolutionButtonFill};
|
|
1381
|
+
--color-explain-popover-apply-solution-button-color: ${e=>e.applySolutionButtonColor};
|
|
1382
|
+
--color-explain-popover-apply-solution-button-outline: ${e=>e.applySolutionButtonOutline};
|
|
1383
|
+
--color-explain-popover-show-more-button-outline: ${e=>e.showMoreButtonOutline};
|
|
1384
|
+
|
|
1385
|
+
z-index: 10;
|
|
1386
|
+
filter: var(--shadows-popover);
|
|
1387
|
+
|
|
1388
|
+
&:focus {
|
|
1389
|
+
outline: none;
|
|
1390
|
+
}
|
|
1391
|
+
`,EB=Ie(V5)`
|
|
1392
|
+
fill: var(--color-explain-popover-fill);
|
|
1393
|
+
`,TB={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 IB(e){const t=Gi(),n=Rr(),r=(t==null?void 0:t.displayMode)==="popover"&&(t==null?void 0:t.controlId)===n,i=O.useRef(null);return $.jsxs(iB,{open:r,onOpenChange:o=>!o&&r&&(t==null?void 0:t.dismiss()),arrow:{width:20,height:10,padding:10,element:i},children:[$.jsx(aB,{children:e.children}),$.jsxs(AB,{isOpen:r,children:[O.Children.toArray(e.content)[0]??$.jsx(wB,{children:$.jsx(hB,{})}),$.jsx($B,{})]})]})}function AB(e){var t,n;const r=O.useContext(Jx),{middlewareData:i,arrow:o,placement:a}=Ou(),s=((t=i.arrow)==null?void 0:t.x)??0,u=((n=i.arrow)==null?void 0:n.y)??0,c=(o==null?void 0:o.height)??0,l=(o==null?void 0:o.width)??0,f=s+l/2,d=u+c,p=H(a).with("top",()=>`${f}px calc(100% + ${c+5}px)`).with("bottom",()=>`${f}px ${-c-5}px`).with("left",()=>`calc(100% + ${c}px) ${d}px`).with("right",()=>`${-c}px ${d}px`).otherwise(()=>"");return $.jsx(P.AnimatePresence,{initial:!1,children:e.isOpen&&$.jsx(xB,{...r,children:$.jsx(P.motion.div,{variants:TB,initial:"initial",animate:"open",exit:"close",style:{transformOrigin:p},children:$.jsx(Yx,{children:e.children})})})})}function $B(){const{context:e,arrow:t}=Ou();return $.jsx(EB,{ref:t.element,context:e,width:t.width,height:t.height})}function OB(e){return O.forwardRef((t,n)=>{const r=In();return t.explain!=="popover"||r?$.jsx(e,{...t}):$.jsx(IB,{children:$.jsx(e,{...t,ref:n})})})}function Wi(e){return jo(u1(OB(O.forwardRef(e))))}function Or(){alert(`Failed to apply your selection.
|
|
1394
|
+
Please check your internet connection and try again.`)}function DB(){alert(`Failed to reset your configuration.
|
|
1395
|
+
Please check your internet connection and try again.`)}const Kg=Ie.select`
|
|
1396
|
+
color: inherit;
|
|
1397
|
+
`,Yg="<reset>",Xg="<nothing>",c1=Wi((e,t)=>{if(In()){const b=Da(e,!0,!1);return $.jsx(Kg,{style:b})}const n=Rr(),r=ur(e),i=sf(r),{explain:o}=zi();if(!i)return $.jsx("span",{children:"Choice Attribute not found"});const{attribute:a,makeDecision:s,clearDecisions:u}=i,c=vl(r,An.getAllowedChoiceValues(a)),l=vl(r,An.getBlockedChoiceValues(a)),f=An.isMultiSelect(a),d=An.getSelectedChoiceValues(a),p=d.map(b=>b.id),h=p[0]??Xg,v=d.some(b=>{var T;return((T=b.decision)==null?void 0:T.kind)===$e.Explicit}),x=p.length>=1,E=d.some(b=>{var T;return((T=b.decision)==null?void 0:T.kind)===$e.Implicit}),y=c.length===0,S=async b=>{if(b===Yg)try{await u()}catch{Or()}else if(c.some(T=>T.id===b)){const T=p.some(A=>A===b)?void 0:bt.Included;try{await s(b,T)}catch{Or()}}else l.some(T=>T.id===b)&&e.explain!=="disabled"&&await o(T=>T.whyIsStateNotPossible.choice(a.id).choiceValue(b).state(bt.Included),e.explain,n)},w=RB(e,a.isSatisfied,E,y);return $.jsxs(Kg,{ref:t,value:f?p:h,multiple:f,onChange:b=>S(b.currentTarget.value),style:w,children:[!x&&!f&&$.jsx("option",{value:Xg}),v&&$.jsx("option",{value:Yg,children:e.resetLabel}),c.map(b=>{var T;return $.jsxs("option",{value:b.id,children:[((T=b.decision)==null?void 0:T.kind)===$e.Implicit?e.implicitLabelPrefix:"",b.id]},b.id)}),l.length>0&&$.jsx("optgroup",{label:"Blocked",children:l.map(b=>$.jsx("option",{value:b.id,children:b.id},b.id))})]})}),NB=c1,PB={...zv,noOptionsAvailableColors:{...Wp,title:"No Options Available Colors"}};P.addPropertyControls(c1,PB);const RB=(e,t,n,r)=>{var i,o,a;const s=Da(e,t,n);return{...s,backgroundColor:H({noOptionsAvailable:r,noOptionsAvailableFill:(i=e.noOptionsAvailableColors)==null?void 0:i.fill}).with({noOptionsAvailable:!0,noOptionsAvailableFill:Le.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:Le.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:Le.string.minLength(1)},u=>u.noOptionsAvailableColor).otherwise(()=>s.color)}},Jg=Ie.select`
|
|
1398
|
+
color: inherit;
|
|
1399
|
+
`,Qg="<reset>",sd="<nothing>",ud="yes",Zg="no",l1=Wi((e,t)=>{var n,r,i;if(In()){const w=Da(e,!0,!1);return $.jsx(Jg,{style:w})}const o=Rr(),a=ur(e),s=e_(a),{explain:u}=zi();if(!s)return $.jsx("span",{children:"Boolean Attribute not found"});const{attribute:c,makeDecision:l}=s,f=async w=>{const b=An.getBooleanDecision(c)!=null;if(w===Qg&&b)try{await l(void 0)}catch{Or()}else{const T=w===ud;if(An.isBooleanValuePossible(c,T))try{await l(T)}catch{Or()}else e.explain!=="disabled"&&await u(A=>A.whyIsStateNotPossible.boolean(c.id).state(T),e.explain,o)}},d=H((n=c.decision)==null?void 0:n.state).with(!0,()=>ud).with(!1,()=>Zg).otherwise(()=>sd),p=((r=c.decision)==null?void 0:r.kind)===$e.Explicit,h=((i=c.decision)==null?void 0:i.kind)===$e.Implicit,v=Da(e,c.isSatisfied,h),x=An.isBooleanValuePossible(c,!0),E=An.isBooleanValuePossible(c,!1),y=$.jsxs("option",{value:ud,children:[eb(c,!0,e.implicitLabelPrefix),e.trueLabel]}),S=$.jsxs("option",{value:Zg,children:[eb(c,!1,e.implicitLabelPrefix),e.falseLabel]});return $.jsxs(Jg,{ref:t,value:d,onChange:w=>f(w.currentTarget.value),style:v,children:[d===sd&&$.jsx("option",{value:sd}),p&&$.jsx("option",{value:Qg,children:e.resetLabel}),x&&y,E&&S,(!x||!E)&&$.jsxs("optgroup",{label:"Blocked",children:[!x&&y,!E&&S]})]})}),kB=l1,eb=(e,t,n)=>{var r,i;return((r=e.decision)==null?void 0:r.kind)===$e.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},MB={...zv,trueLabel:{title:"True Label",type:P.ControlType.String,defaultValue:"Yes"},falseLabel:{title:"False Label",type:P.ControlType.String,defaultValue:"No"}};P.addPropertyControls(l1,MB);const tb=Ie.select`
|
|
1400
|
+
color: inherit;
|
|
1401
|
+
`,nb="<reset>",cd="<nothing>",ld="included",fd="excluded",f1=Wi((e,t)=>{var n,r,i;if(In()){const b=Da(e,!0,!1);return $.jsx(tb,{style:b})}const o=Rr(),a=ur(e),s=t_(a),{explain:u}=zi();if(!s)return $.jsx("span",{children:"Component Attribute not found"});const{attribute:c,makeDecision:l}=s,f=async b=>{if(An.isComponentStatePossible(c,b))try{await l(b)}catch{Or()}else e.explain!=="disabled"&&await u(T=>T.whyIsStateNotPossible.component(c.id).state(b),e.explain,o)},d=async b=>{var T;const A=((T=c.decision)==null?void 0:T.kind)===$e.Explicit;b===nb&&A?await l(void 0):b===ld?await f(st.Included):b===fd&&await f(st.Excluded)},p=H((n=c.decision)==null?void 0:n.state).with(st.Included,()=>ld).with(st.Excluded,()=>fd).otherwise(()=>cd),h=((r=c.decision)==null?void 0:r.kind)===$e.Explicit,v=((i=c.decision)==null?void 0:i.kind)===$e.Implicit,x=Da(e,c.isSatisfied,v),E=An.isComponentStatePossible(c,st.Included),y=An.isComponentStatePossible(c,st.Excluded),S=$.jsxs("option",{value:ld,children:[rb(c,st.Included,e.implicitLabelPrefix),e.includedLabel]}),w=$.jsxs("option",{value:fd,children:[rb(c,st.Excluded,e.implicitLabelPrefix),e.excludedLabel]});return $.jsxs(tb,{ref:t,value:p,onChange:b=>d(b.currentTarget.value),style:x,children:[p===cd&&$.jsx("option",{value:cd}),h&&$.jsx("option",{value:nb,children:e.resetLabel}),E&&S,y&&w,(!E||!y)&&$.jsxs("optgroup",{label:"Blocked",children:[!E&&S,!y&&w]})]})}),jB=f1,rb=(e,t,n)=>{var r,i;return((r=e.decision)==null?void 0:r.kind)===$e.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},_B={...zv,includedLabel:{title:"Included Label",type:P.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:P.ControlType.String,defaultValue:"Excluded"}};P.addPropertyControls(f1,_B);function d1(e,t,n,r,i=1e3){const[o]=T1.useForceUpdate(),a=zL(d=>{t(d),o()},i),s=O.useRef(n),u=O.useRef(e),c=a.isPending(),l=O.useRef(c);O.useEffect(()=>{e!==u.current&&(u.current=e,c&&(a.cancel(),o()),e!==n&&r(e)),n!==s.current&&(s.current=n,n!==e?(a(n),o()):c&&(a.cancel(),o())),c!==l.current&&(l.current=c,!c&&e!==n&&r(e))},[e,n,a,c]);const f=O.useCallback(()=>{a.isPending()&&a.flush()},[a]);return O.useEffect(()=>()=>f(),[f]),{flush:f}}const ib=Ie(ox)`
|
|
1402
|
+
color: inherit;
|
|
1403
|
+
`,p1=Wi((e,t)=>{var n,r;if(In()){const y=Hp(e,!0,!1);return $.jsx(ib,{style:y})}const i=Rr(),o=ur(e),a=Zj(o),{explain:s}=zi();if(!a)return $.jsx("span",{children:"Numeric Attribute not found"});const{attribute:u,makeDecision:c}=a,l=((n=u.decision)==null?void 0:n.kind)===$e.Implicit,f=Hp(e,u.isSatisfied,l),d=(r=u.decision)==null?void 0:r.state,[p,h]=O.useState(d),{min:v,max:x}=u.range,E=d1(d,async y=>{if(y<v){alert(`The value must be smaller than or equal to ${v}.`);return}if(y>x){alert(`The value must be greater than or equal to ${x}.`);return}try{await c(y)}catch(S){const w=S;w.type===vt.ConfigurationModelNotFeasible||w.type===vt.ConfigurationConflict?e.explain!=="disabled"&&await s(b=>b.whyIsStateNotPossible.numeric(u.id).state(y),e.explain,i):Or()}},p,y=>h(y),e.wait);return $.jsx(ib,{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:FB(u,e.implicitLabelPrefix),onBlur:()=>{E.flush()},onKeyPress:y=>{y.key==="Enter"&&E.flush()},onValueChange:y=>h(y.floatValue),value:p??"",style:f})}),qB=p1,FB=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===$e.Implicit?t:""},LB={...o1,wait:{title:"Debounce Delay",type:P.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:P.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:P.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:P.ControlType.String,defaultValue:""}};P.addPropertyControls(p1,LB);const Cf={choiceValueId:{title:"Choice Value Id",type:P.ControlType.String}};function _o(e,t){return O.Children.map(e,n=>{if(O.isValidElement(n)){const r=rx(n.props,t);return O.cloneElement(n,r)}return n})}const h1=Wi((e,t)=>{if(In())return e.children;const n=Rr(),{makeDecision:r}=Ui(),i=ur(e),o=e.choiceValueId??"",a=o.length>0,s=Su([i])[0],{explain:u}=zi();if(!s)return $.jsx("span",{children:"Attribute not found"});const c=s.type===W.Choice,l=s.type===W.Numeric,f=s.type===W.Boolean,d=s.type===W.Component;if(!c&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(l)return $.jsx("span",{children:"Numeric Attribute is not supported"});let p=c?s.values.find(y=>y.id===o):null;if(a&&p==null)return $.jsx("span",{children:"Choice Value not found"});const h=y=>H({state:y,attribute:s}).with({attribute:{type:W.Choice},state:"undefined"},()=>p.decision==null).with({attribute:{type:W.Choice},state:"included"},()=>{var S,w;return((S=p.decision)==null?void 0:S.state)===bt.Included&&((w=p.decision)==null?void 0:w.kind)===$e.Explicit}).with({attribute:{type:W.Choice},state:"excluded"},()=>{var S,w;return((S=p.decision)==null?void 0:S.state)===bt.Excluded&&((w=p.decision)==null?void 0:w.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},state:"undefined"},{attribute:{type:W.Component},state:"undefined"},({attribute:S})=>S.decision==null).with({attribute:{type:W.Boolean},state:"true"},({attribute:S})=>{var w,b;return((w=S.decision)==null?void 0:w.state)===!0&&((b=S.decision)==null?void 0:b.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},state:"false"},({attribute:S})=>{var w,b;return((w=S.decision)==null?void 0:w.state)===!1&&((b=S.decision)==null?void 0:b.kind)===$e.Explicit}).with({attribute:{type:W.Component},state:"included"},({attribute:S})=>{var w,b;return((w=S.decision)==null?void 0:w.state)===st.Included&&((b=S.decision)==null?void 0:b.kind)===$e.Explicit}).with({attribute:{type:W.Component},state:"excluded"},({attribute:S})=>{var w,b;return((w=S.decision)==null?void 0:w.state)===st.Excluded&&((b=S.decision)==null?void 0:b.kind)===$e.Explicit}).otherwise(()=>!1),v=y=>H({isChoiceAttribute:c,isBooleanAttribute:f,isComponentAttribute:d,state:y}).with({isChoiceAttribute:!0,state:"included"},()=>bt.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>bt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>st.Included).with({isComponentAttribute:!0,state:"excluded"},()=>st.Excluded).otherwise(()=>null);h(e.toggleFrom);const x=h(e.toggleTo),E=async()=>{const y=x?e.toggleFrom:e.toggleTo,S=v(y),w=d?An.isComponentStatePossible(s,S):!1,b=f?An.isBooleanValuePossible(s,S):!1;if(c&&p.possibleDecisionStates.some(T=>T===S)||b||w||S==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:S})}catch{Or()}else if(e.explain!=="disabled"){const T=H({isComponentAttribute:d,isBooleanAttribute:f,isChoiceAttribute:c}).returnType().with({isChoiceAttribute:!0},()=>Qe.choiceValue).with({isBooleanAttribute:!0},()=>Qe.boolean).with({isComponentAttribute:!0},()=>Qe.component).otherwise(()=>null);T&&await u({question:qt.whyIsStateNotPossible,subject:T,attributeId:i,choiceValueId:o,state:S},e.explain,n)}};return _o(e.children,{onClick:E,ref:t})}),VB=h1,BB={...ei,...Cf,children:{title:"Content",type:P.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:P.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:P.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...$u};P.addPropertyControls(h1,BB);const v1=Wi((e,t)=>{if(In())return e.children;const n=Rr(),{makeDecision:r}=Ui(),i=ur(e),o=e.choiceValueId??"",a=o.length>0,s=Su([i])[0],u=sf(i),{explain:c}=zi();if(!s)return $.jsx("span",{children:"Attribute not found"});const l=s.type===W.Choice,f=s.type===W.Numeric,d=s.type===W.Boolean,p=s.type===W.Component;if(!l&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let h=l?s.values.find(E=>E.id===o):null;if(a&&h==null)return $.jsx("span",{children:"Choice Value not found"});const v=()=>H({isChoiceAttribute:l,isBooleanAttribute:d,isComponentAttribute:p,isNumericAttribute:f,hasChoiceValueId:a,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>bt.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>bt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>st.Included).with({isComponentAttribute:!0,state:"excluded"},()=>st.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),x=async()=>{if(l&&!a&&e.setSelection==="undefined")try{await u.clearDecisions()}catch{Or()}else{const E=v(),y=p?An.isComponentStatePossible(s,E):!1,S=d?An.isBooleanValuePossible(s,E):!1,w=(l?h.possibleDecisionStates.some(b=>b===E):!1)||S||y;if(f||w||E==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:E})}catch(b){const T=b;f&&(T.type===vt.ConfigurationModelNotFeasible||T.type===vt.ConfigurationConflict)?e.explain!=="disabled"&&await c(A=>A.whyIsStateNotPossible.numeric(s.id).state(E),e.explain,n):Or()}else if(e.explain!=="disabled"){const b=H({isComponentAttribute:p,isBooleanAttribute:d,isChoiceAttribute:l}).returnType().with({isChoiceAttribute:!0},()=>Qe.choiceValue).with({isBooleanAttribute:!0},()=>Qe.boolean).with({isComponentAttribute:!0},()=>Qe.component).otherwise(()=>null);b&&await c({question:qt.whyIsStateNotPossible,subject:b,attributeId:i,choiceValueId:o,state:E},e.explain,n)}}};return _o(e.children,{onClick:x,ref:t})}),UB=v1,GB={...ei,...Cf,children:{title:"Content",type:P.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:P.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:P.ControlType.Number,defaultValue:0},...$u};P.addPropertyControls(v1,GB);const m1=Wi((e,t)=>{var n;if(In())return e.children;const r=Rr(),{setManyDecision:i}=Ui(),{handleExplainAnswer:o}=zi(),a=e.attributes.map(ur),s=Su(a).map((f,d)=>{if(!f)return{error:$.jsx("span",{children:"Attribute not found"})};const p=e.attributes[d],h=p.choiceValueId??"",v=h.length>0,x=f.type===W.Choice,E=f.type===W.Numeric,y=f.type===W.Boolean,S=f.type===W.Component;if(!x&&v)return{error:$.jsx("span",{children:"Attribute is not a Choice Attribute"})};let w=x?f.values.find(T=>T.id===h):null;if(v&&w==null)return{error:$.jsx("span",{children:"Choice Value not found"})};const b=()=>H({isChoiceAttribute:x,isBooleanAttribute:y,isComponentAttribute:S,isNumericAttribute:E,hasChoiceValueId:v,state:p.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>bt.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>bt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>st.Included).with({isComponentAttribute:!0,state:"excluded"},()=>st.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>p.numericValue).otherwise(()=>null);return{getDecisions:()=>x&&!v&&p.setSelection==="undefined"?f.values.filter(T=>{var A;return((A=T.decision)==null?void 0:A.kind)===$e.Explicit}).map(T=>({type:f.type,attributeId:f.id,choiceValueId:T.id,state:null})):[{type:f.type,attributeId:f.id,choiceValueId:h,state:b()}]}}),u=(n=s.find(f=>f.error))==null?void 0:n.error;if(u)return u;const c=async()=>{const f=s.reduce((p,h)=>[...p,...h.getDecisions()],new Array),d=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(p){const h=p;if(console.debug("SetMany failed",h),(h==null?void 0:h.type)===vt.ConfigurationSetManyConflict&&h.decisionExplanations){e.explain!=="disabled"&&await o(h,e.explain,r);return}Or();return}},l=()=>{e.trigger==="click"&&c()};return O.useEffect(()=>{e.trigger==="auto"&&c()},[]),_o(e.children,{onClick:l,ref:t})}),zB=m1,WB={children:{title:"Content",type:P.ControlType.ComponentInstance},attributes:{title:"Attributes",type:P.ControlType.Array,control:{type:P.ControlType.Object,controls:{...ei,...Cf,setSelection:{title:"Set Selection To",type:P.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:P.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:P.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:P.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:P.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...$u};P.addPropertyControls(m1,WB);const y1=jo(e=>{if(In())return e.enabledChildren;const{configuration:t}=ew(),{setManyDecision:n}=Ui(),r=t.attributes.some(a=>H(a).with({type:W.Choice},s=>s.values.some(u=>{var c;return((c=u.decision)==null?void 0:c.kind)===$e.Explicit})).with({type:W.Boolean},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===$e.Explicit}).with({type:W.Numeric},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===$e.Explicit}).with({type:W.Component},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===$e.Explicit}).exhaustive()),i=()=>{if(r)try{n([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{DB()}},o=r?e.enabledChildren:e.disabledChildren;return _o(o,{onClick:i})}),HB=y1,KB={enabledChildren:{title:"Content – Enabled",type:P.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:P.ControlType.ComponentInstance}};P.addPropertyControls(y1,KB);const g1=Wi((e,t)=>{if(In())return e.satisfiedChildren;const n=Rr(),{configuration:r}=ew(),{explain:i}=zi(),o=[...e.attributeId.length>0?[ur(e)]:[],...e.attributes.map(ur)],a=()=>{var u;const c=Su(o).map(f=>f?{isSatisfied:f.isSatisfied}:{error:$.jsx("span",{children:"Attribute not found"})});return((u=c.find(f=>f.error))==null?void 0:u.error)||c.every(f=>f.isSatisfied)},s=async()=>{e.explain!=="disabled"&&(o.length===0?await i(u=>u.whyIsNotSatisfied.configuration,e.explain,n):o.length===1&&await i(u=>u.whyIsNotSatisfied.attribute(o[0]),e.explain,n))};return(o.length>0?a():r.isSatisfied)?e.satisfiedChildren:_o(e.unsatisfiedChildren,{onClick:s,ref:t})}),YB=g1,XB={satisfiedChildren:{title:"Content – Satisfied",type:P.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:P.ControlType.ComponentInstance},...ei,attributes:{title:"Attributes",type:P.ControlType.Array,control:{type:P.ControlType.Object,controls:{...ei}}},...$u};P.addPropertyControls(g1,XB);const b1=jo(O.forwardRef(function(e,t){const n=f=>H(f).with(1,()=>e.content1).with(2,()=>e.content2).with(3,()=>e.content3).with(4,()=>e.content4).with(5,()=>e.content5).with(6,()=>e.content6).with(7,()=>e.content7).with(8,()=>e.content8).with(9,()=>e.content9).with(10,()=>e.content10).otherwise(()=>null),r=e.variants.find(f=>f.useInDesignTime)||e.variants[0];if(In())return r&&n(r.content);const i=ur(e),o=e.choiceValueId??"",a=o.length>0,s=Su([i])[0];if(!s)return $.jsx("span",{children:"Attribute not found"});const u=s.type===W.Choice;if(!u&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(u&&!a)return $.jsx("span",{children:"Choice Value Id missing"});let c=u?s.values.find(f=>f.id===o):null;if(a&&c==null)return $.jsx("span",{children:"Choice Value not found"});const l=[...e.variants].find(({selection:f,condition:d})=>H({selection:f,condition:d,attribute:s}).with({attribute:{type:W.Choice},selection:"included",condition:"blocked"},()=>!c.possibleDecisionStates.includes(bt.Included)).with({attribute:{type:W.Choice},selection:"included",condition:"implicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Included&&((h=c.decision)==null?void 0:h.kind)===$e.Implicit}).with({attribute:{type:W.Choice},selection:"included",condition:"explicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Included&&((h=c.decision)==null?void 0:h.kind)===$e.Explicit}).with({attribute:{type:W.Choice},selection:"included",condition:"none"},()=>{var p;return((p=c.decision)==null?void 0:p.state)===bt.Included}).with({attribute:{type:W.Choice},selection:"excluded",condition:"blocked"},()=>!c.possibleDecisionStates.includes(bt.Excluded)).with({attribute:{type:W.Choice},selection:"excluded",condition:"implicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Excluded&&((h=c.decision)==null?void 0:h.kind)===$e.Implicit}).with({attribute:{type:W.Choice},selection:"excluded",condition:"explicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Excluded&&((h=c.decision)==null?void 0:h.kind)===$e.Explicit}).with({attribute:{type:W.Choice},selection:"excluded",condition:"none"},()=>{var p;return((p=c.decision)==null?void 0:p.state)===bt.Excluded}).with({attribute:{type:W.Boolean},selection:"true",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!0)).with({attribute:{type:W.Boolean},selection:"true",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!0&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Boolean},selection:"true",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!0&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},selection:"true",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===!0}).with({attribute:{type:W.Boolean},selection:"false",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!1)).with({attribute:{type:W.Boolean},selection:"false",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!1&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Boolean},selection:"false",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!1&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},selection:"false",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===!1}).with({attribute:{type:W.Component},selection:"included",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(st.Included)).with({attribute:{type:W.Component},selection:"included",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===st.Included&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Component},selection:"included",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===st.Included&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Component},selection:"included",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===st.Included}).with({attribute:{type:W.Component},selection:"excluded",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(st.Excluded)).with({attribute:{type:W.Component},selection:"excluded",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===st.Excluded&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Component},selection:"excluded",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===st.Excluded&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Component},selection:"excluded",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===st.Excluded}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"implicit"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.kind)===$e.Implicit}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"explicit"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.kind)===$e.Explicit}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"none"},({attribute:p})=>p.decision!=null).with({attribute:{type:W.Choice},selection:"undefined"},()=>c.decision==null).with({attribute:{type:W.Boolean},selection:"undefined"},{attribute:{type:W.Component},selection:"undefined"},{attribute:{type:W.Numeric},selection:"undefined"},({attribute:p})=>p.decision==null).otherwise(()=>!1));return l&&_o(n(l.content),{ref:t})})),JB=b1,QB={...ei,...Cf,variants:{title:"Variants",type:P.ControlType.Array,maxCount:10,control:{type:P.ControlType.Object,controls:{selection:{title:"Selection",type:P.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:P.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:P.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:P.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:P.ControlType.ComponentInstance},content2:{title:"Content 2",type:P.ControlType.ComponentInstance},content3:{title:"Content 3",type:P.ControlType.ComponentInstance},content4:{title:"Content 4",type:P.ControlType.ComponentInstance},content5:{title:"Content 5",type:P.ControlType.ComponentInstance},content6:{title:"Content 6",type:P.ControlType.ComponentInstance},content7:{title:"Content 7",type:P.ControlType.ComponentInstance},content8:{title:"Content 8",type:P.ControlType.ComponentInstance},content9:{title:"Content 9",type:P.ControlType.ComponentInstance},content10:{title:"Content 10",type:P.ControlType.ComponentInstance}};P.addPropertyControls(b1,QB);const S1=jo(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=XL(a);return KL(`#${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})}),ZB=S1,eU={children:{title:"Content",type:P.ControlType.ComponentInstance},color:{title:"Color",type:P.ControlType.Color,defaultValue:"#0000ff"}};P.addPropertyControls(S1,eU);const C1=jo(e=>{if(In())return e.children;const{error:t}=dv();return t?_o(e.children,{onClick:t.retry}):null}),tU=C1,nU={children:{title:"Content",type:P.ControlType.ComponentInstance}};P.addPropertyControls(C1,nU);function rU(e){return O.forwardRef((t,n)=>{const r={...t.style,width:"100%",height:"100%"};return $.jsx(e,{...t,ref:n,style:r})})}const iU=Ie.div`
|
|
1404
|
+
width: 10px;
|
|
1405
|
+
height: 10px;
|
|
1406
|
+
background-color: greenyellow;
|
|
1407
|
+
`;function w1(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(iU,{ref:t})}const oU={delay:{title:"Delay",type:P.ControlType.Number,min:0,unit:"ms",defaultValue:0,step:1}};P.addPropertyControls(w1,oU);const x1=Ie.div`
|
|
1408
|
+
display: contents;
|
|
1409
|
+
`,aU=Cu`
|
|
1410
|
+
:root {
|
|
1411
|
+
*:has(> ${x1}) {
|
|
1412
|
+
display: contents !important;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
`,E1=jo(u1(e=>{const t=Rr(),n=In(),r=n?(()=>O.Children.toArray(e.itemTemplate)[0])():(()=>{const c=l=>{var f;const d=O.Children.toArray(l)[0],p=(f=d.props)==null?void 0:f.children;return p?c(p):d};return c(e.itemTemplate)})();if(!r)return $.jsx("span",{children:"Choice Value Template not defined"});const i=c=>c.map(l=>O.cloneElement(r,{key:l,layoutId:`${t}_${l}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:l}));if(n)return $.jsx(ob,{...e,children:i(["Choice Value 1","Choice Value 2","Choice Value 3"])});const o=ur(e),a=sf(o),s=vl(o);if(!a)return $.jsx("span",{children:"Choice Attribute not found"});const u=s.map(c=>c.id);return $.jsx(ob,{...e,children:i(u)})}));function ob(e){return $.jsxs($.Fragment,{children:[$.jsx(hl,{singletonId:"ChoiceValueListRenderer",children:$.jsx(aU,{})}),$.jsx(x1,{style:e.style,children:e.children})]})}const sU=E1,uU={...ei,itemTemplate:{title:"Choice Value Template",type:P.ControlType.ComponentInstance}};P.addPropertyControls(E1,uU);const cU=Object.freeze(Object.defineProperty({__proto__:null,BooleanSelect:kB,ChoiceSelect:NB,ChoiceValueListRenderer:sU,Colorize:ZB,ComponentSelect:jB,Configuration:Y3,InitializationRetry:tU,NumericInput:qB,ResetConfiguration:HB,SatisfactionIndicator:YB,ScrollIntoView:w1,SelectionIndicator:JB,SelectionToggle:VB,SetSelection:UB,SetSelections:zB,Singleton:hl,useDebounceValue:d1,useRenderPlaceholder:In,useSortedChoiceValues:vl,withFullSize:rU},Symbol.toStringTag,{value:"Module"}));exports.Configurator=zA;exports.ConfiguratorFramer=cU;exports.ConfiguratorReact=HD;
|